text
stringlengths 1
22.8M
|
|---|
Euroea or Euroia (; also transcribed as Eurœa) was a city in Epirus, in western Greece, during late antiquity. It was abandoned in the early 7th century due to Slavic invasions. During the 4th–8th centuries, it was a bishopric. Since the 18th century, it has also been a titular see of the Catholic Church. Its site is located near the modern village of Glyki in Greece.
History
St. Donatus, bishop of Euroea, lived under Theodosius I () and performed miracles, including providing a local settlement with abundant watersources (likely connected to the name "Euroea", "well-flowing"). A church dedicated to St. Donatus was erected, probably on the site of an ancient pagan temple (Omphalion). The town belonged to the Roman province of Epirus vetus.
Bishops of Euroea are attested at councils in the 5th and 6th centuries, and the city is mentioned by Hierocles. According to Procopius, Emperor Justinian I () resettled the inhabitants of Euroea to an islet in a neighbouring lake and built there a strong city, commonly thought to be on the site of Ioannina.
As a result of the Slavic invasions, in 603 the Bishop of Euroea and the inhabitants, taking the relics of St. Donatus with them, fled to Kassiopi on Corfu. The original site of Euroea is unclear: Michel Le Quien identified it with modern Paramythia, others with the nearby ancient settlement of Photice. It is now tentatively located near the village of Glyky.
Bishopric
The first (and only) mention of the bishopric in one of the Notitiae Episcopatuum is in the so-called "iconoclast notitia" (compiled some time after 787), where it is listed (as Εὐρόσου) as the second among the suffragans of the Metropolis of Nicopolis.
The known bishops are:
St. Donatus, under Theodosius I ()
Mark, participant in the Second Council of Ephesus in 449 and the Council of Chalcedon in 451
Eugenius, signatory of a letter by the synod of Epirus vetus on the Council of Chalcedon and the murder of Proterius of Alexandria to Emperor Leo I the Thracian
Theodotus, attended the 536 council under Patriarch Menas of Constantinople
John I, mentioned by Procopius
John II, mentioned in a letter by Pope Gregory the Great; he presided over the flight of the Euroeans to Corfu
Catholic titular see
The Roman Catholic Church has established "Eurœa" (since 1933: "Eurœa in Epiro") as a titular see. Its incumbents are:
Bishop Jean de Brunet de Pujols de Castelpers de Panat (1739.09.30 – ?)
Bishop Joachin Salvetti (艾若亞敬), O.F.M. (1815.02.21 – 1843.09.21)
Bishop Gabriel Grioglio, O.F.M. (1844.03.02 – 1891.01.09)
Bishop Salvatore di Pietro, S.J. (1893.01.03 – 1898.08.23)
Bishop Jean-Baptiste-Marie Budes de Guébriant (光若翰), M.E.P. (later Archbishop) (1910.08.12 – 1921.12.11)
Bishop Giovanni Battista Peruzzo, C.P. (later Archbishop) (1924.01.18 – 1928.10.19)
Bishop Pedro Dionisio Tibiletti (1929.01.25 – 1934.09.13)
Blessed Bishop Florentino Asensio Barroso (1935.11.11 – 1936.08.09)
Bishop Alfredo Del Tomba (1937.07.10 – 1944.08.10)
Bishop Ezio Barbieri (1945.07.21 – 1949.08.02)
Bishop Policarpo da Costa Vaz (高德華) (1950.04.17 – 1954.01.29)
Bishop João Pereira Venâncio, O.R.C. (1954.09.30 – 1958.09.13)
Bishop Alfonso Niehues (later Archbishop) (1959.01.08 – 1965.08.03)
References
Ancient Greek cities
Catholic titular sees in Europe
Former dioceses in Europe
Former populated places in Greece
Populated places in ancient Epirus
Populated places of the Byzantine Empire
Souli
|
Paul Steenhuisen (born 1965 in Vancouver, British Columbia) is a Canadian composer working with a broad range of acoustic and digital media. His concert music consists of orchestral, chamber, solo, and vocal music, and often includes live electronics and soundfiles. He creates electroacoustic, radio, and installation pieces. Steenhuisen's music is regularly performed and broadcast in Europe, Asia, Australia, and North America. He contributes all audio content and programming to the Hyposurface installation project, based in Cambridge, Massachusetts.
Education
Steenhuisen obtained his Doctor of Musical Arts degree in composition from the University of British Columbia, where he studied with Keith Hamel. Between academic degrees, he studied with Louis Andriessen and Gilius van Bergeijk at the Royal Conservatory of The Hague. While living in Amsterdam, he worked with Michael Finnissy in Hove, England. He was one of ten composers selected to take part in the Cursus de Composition et Informatiques at IRCAM (Paris, 1996/97), where he had lessons with Tristan Murail. He attended master classes and individual lessons with Mauricio Kagel, Helmut Lachenmann, Jean-Claude Risset, Luciano Berio, Pierre Boulez, Brian Ferneyhough, Frederic Rzewski, Magnus Lindberg, and others.
Career
During his student years, Steenhuisen was laureate of more than a dozen national and international awards for his music. These include four prizes in the Canadian Broadcasting Corporation Young Composers Competition, seven in the PROCAN/SOCAN Competition, first prize in the Vancouver New Music Composers Competition, and the Governor General of Canada Gold Medal as the outstanding student in all faculties (UBC, 1990). Music by Steenhuisen was selected for competition at the Gaudeamus Music Week. After a winter residency at the Banff Centre for the Arts, Steenhuisen became Associate Composer in Residence with the Toronto Symphony Orchestra (1998–2000). At the behest of the TSO, he wrote the chamber work Ciphering in Tongues, and orchestral pieces Airstream and Pensacola (a melodrama for orchestra, computer, and spatialized brass). Pensacola has been performed by the Esprit Orchestra, Orchestre Symphonique de Montréal, and the Winnipeg Symphony Orchestra. During this time, Bramwell Tovey and the Vancouver Symphony Orchestra commissioned another orchestral piece, Your Soul is a Bottle Full of Thirsting Salt.
Wonder, for orchestra, tape, and soprano, was commissioned by the CBC for the CBC Radio Orchestra, and was selected to represent Canada at the International Rostrum of Composers (UNESCO, Paris). It was ranked third in the world, and ascribed the honour of recommended work, with subsequent broadcasts in twenty-five countries. As a result, the Austrian Radio Philharmonic performed the work and commissioned Bread for Sylvain Cambreling and Klangforum Wien to perform at MuzikProtokoll in Graz, Austria. Bread was also performed at the 2001 ISCM World Music Days in Yokohama, Japan, by the Tokyo Ensemble COmeT, and at the BONK festival (Tampa, Florida), where Steenhuisen was a frequent guest. In 2003, Dr. Steenhuisen was appointed Assistant Professor of Composition at the University of Alberta, where he was the founder of the Electroacoustic Research Studios (UA-EARS). He served as director of the new studios until his resignation in 2007. In early 2009, the University of Alberta Press published its first music text, Steenhuisen's Sonic Mosaics: Conversations with Composers, a collection of interviews with thirty-two composers.
In 2011 Steenhuisen was awarded the Victor Martyn Lynch Staunton Award as the outstanding mid-career artist in music by the Canada Council.
Affiliations
Steenhuisen is an associate composer of the Canadian Music Centre, served on the Council of the Canadian League of Composers (2000–2008), and was president of the International Society for Contemporary Music, Canadian Section (2003–2008). He serves on the editorial board of the World New Music Magazine.
Writing
Since 1987, Paul Steenhuisen has made contributions to numerous magazines and journals, including Discorder (CiTR Radio, Vancouver), MusicWorks, Circuit, Wholenote Magazine, Anjelaki: Journal of the Theoretical Humanities, Contemporary Music Review, and others. Sonic Mosaics: Conversations with Composers (UA Press, 2009) is a 314-page collection of interviews with composers.
Works
Orchestral
Pensacola (2001/2002) Orchestra, spatialized brass, computer
Your Soul is a Bottle Full of Thirsting Salt (2001) large orchestra
Airstream (1999) orchestra
Wonder (1996) orchestra, tape, soprano
Exegesis (1990) string orchestra
Ensemble
Intaglio sulla cervello (2010) piano trio
Copralite Culture and Analysis Results #1–20 (2008–09) percussion and piano
Material / Ultramaterial (2005) eight instruments and soundfiles
Sommes-nous pilotées par nos genes? (2005) septet
Vorwissen (2004) piano trio
Hobo Action Figures (2003) jazz quintet and soundfiles
Bread (1999) thirteen instruments and soundfiles
Ciphering in Tongues (1998) twelve instruments
Mycenaean Wound (1992) quintet
Your Golden Hair Margarethe ... (1991) two violas
Corpus Inconnu (1991) octet
Solo
Revolutions per Minute (2009–2010)
Every Joy Pop Turbo (2008–09) piano
Toneland Security (2005) bass flute
Recipes for the Common Man (2001) oboe and CD
Cette obscure clarté qui tombe des étoiles (2000) flute and CD
Pomme de terre (1999) piccolo or E-flat clarinet
Now Is a Creature (1997, revised 2003) trombone and live electronics
Plea (1995) piano
Huskless (Freedman Etudes) (1994) 12' bass clarinet
Tract (1992) harp
Foundry (1990) flute
Amaranth (1989) cello
Voice
Les enfers éternels des gens désespérés (2003) four male voices and electronics
A Book From The Harbour, Chapter III (1995) soprano and piano
On a Pin's Point My Love is Spinning (1994) women's choir
A Book From The Harbour, Chapter II (1994) soprano and piano
Between Lips and Lips There Are Cities (1993) two 8-part antiphonal choirs
Millennia (1991) soprano, violin, piccolo
Two Rivers (1989) choir
A Book from the Harbour, Chapter I (1988) soprano and piano
Electroacoustic and installation works
LoK8Tr internet project (2010) audio and video with live telematic improvisation
Blueblood (2008) soundtrack for art installation
Hyposurface Interactive Audio (2007–) architectural installation
dECOi I (2006)
Frank O. Lunaire #10: Raub (2005)
There's a Glacier in our Sink (2004) radio documentary
Circumnavigating the Sea of Shit (1996)
Poland is Not Yet Lost (1992)
Tube Shelter Perspective (1991)
Enclaves intèrieures (1990) three percussionists and tape
Deep Mountain (1989)
References
External links
Paul Steenhuisen – composer website
"Soundlab New Music Podcast" hosted by Paul Steenhuisen
Art Music Promotion website
CD: Miniatures concrètes
"Sonic Mosaics: Conversations with Composers"
CD: Huskless
Radio Documentary: There's a Glacier in our Sink
1965 births
Canadian contemporary classical composers
Canadian male classical composers
Living people
Musicians from Vancouver
Pupils of Louis Andriessen
Royal Conservatory of The Hague alumni
|
Phyllocycla is a genus of clubtails in the family Gomphidae, commonly known as the lesser forceptails. There are at least 30 described species in Phyllocycla.
See also
List of Phyllocycla species
References
Gomphidae
Odonata genera
|
```javascript
Asynchronous Code
Working with Promises
Delayed Root Suite
Timeouts
Chai Spies
```
|
The First State Bank of Baggs, also known as the Bank Club, is a building in Baggs, Wyoming, USA. Built in 1907–08 to house a bank, it is one of the relatively few original buildings left in Baggs. After the bank closed in 1924, the building became a doctor's office and, during Prohibition, it housed a bootleg liquor business. After Prohibition was repealed it became Baggs Liquor. In 1946, it was renamed the Bank Club Bar.
The one story log structure is covered by stamped sheet metal and has a Greek Revival pedimented front with Ionic columns in antis between Doric pilastered walls.
The First State Bank of Baggs was placed on the National Register of Historic Places on September 13, 1984.
References
External links
First State Bank of Baggs at the Wyioming State Historic Preservation Office
National Register of Historic Places in Carbon County, Wyoming
Commercial buildings completed in 1907
Greek Revival architecture in Wyoming
Defunct banks of the United States
|
Speedy Meade is a 1919 American silent Western film directed by Ira M. Lowry and starring Louis Bennison, Katherine MacDonald, Neil Moran, Claire Adams, and Norman Jefferies. The film was released by Goldwyn Pictures on March 23, 1919.
Plot
Cast
Louis Bennison as Speedy Meade
Katherine MacDonald as Mary Dillman
Neil Moran as Robert Bridges
Claire Adams as Alice Hall
Norman Jefferies as Bud Lester
Edward Roseman as Buck Lennon
Ricca Allen as Mrs. Buck Lennon
William Bailey as Cal Merchant
Preservation
The film is now considered lost.
References
External links
1919 films
1919 Western (genre) films
American black-and-white films
Goldwyn Pictures films
Lost American Western (genre) films
Silent American Western (genre) films
1910s American films
1910s English-language films
|
```smalltalk
using System;
using System.Runtime.InteropServices;
using Foundation;
using ObjCRuntime;
namespace Test {
[Protocol]
public interface First {
[Abstract]
[Export ("doit:itwith:more:")]
void DoIt (int a, int b, int c);
}
[Protocol]
public interface Second {
[Abstract]
[Export ("doit:itwith:more:")]
void DoIt (int a, int b, int c, int d);
}
[BaseType (typeof (NSObject))]
public partial interface Derived : First, Second {
}
}
```
|
The HTC TyTN (also known as the HTC Hermes and the HTC P4500) is an Internet-enabled Windows Mobile Pocket PC PDA designed and marketed by High Tech Computer Corporation of Taiwan. It has a touchscreen with a left-side slide-out QWERTY keyboard. The TyTN's functions include those of a camera phone and a portable media player in addition to text messaging and multimedia messaging. It also offers Internet services such as e-mail (including Microsoft's DirectPush push e-mail solution, as well as BlackBerry services with applications provided by BlackBerry-partnered carriers), instant messaging, web browsing, and local Wi-Fi connectivity. It is a quad-band GSM phone with GPRS, and EDGE, and a single/dual band UMTS phone with HSDPA. It is a part of the first line of PDAs directly marketed and sold by HTC. On AT&T/Cingular, the TyTN was the successor to the HTC Wizard, known as the Cingular 8125. Also on AT&T, the TyTN was superseded by the HTC TyTN II, known as the AT&T 8925 and the AT&T Tilt.
Versions
Besides the branding differences, there are several models of the HTC TyTN: the TyTN 100, the TyTN 200, and the TyTN 300. The TyTN 100 has no front-facing camera or a .1-megapixel front-facing camera; the TyTN 200 has a .1-megapixel front-facing camera; and the TyTN 300 has a .3-megapixel front-facing camera.
The TyTN Model was sold as:
HTC TyTN 100
AT&T/Cingular 8525 (US)
Dopod 838Pro (Asia)
i-mate JASJAM (Middle East)
NTT DoCoMo hTc Z (Japan)
O2 XDA Trion
Orange United Kingdom SPV M3100
Qtek 9600
HTC TyTN 200
Dopod CHT 9000
HTC TyTN P4500
SoftBank X01HT (Japan)
Swisscom XPA v1605
Vodafone v1605 (Europe)
Vodafone VPA Compact III
HTC TyTN 300
T-Mobile MDA Vario II
ROM Updates
The TyTN shipped with Windows Mobile 5 AKU 2.3. HTC released AKU3 ROMs to carriers, though it was up to the carriers to provide updates to end users. In July 2007, HTC released a generic update to Windows Mobile 6, freely available to the public. In November 2007, AT&T released an update to Windows Mobile 6.
Official ROM updates are or were available for several versions of the TyTN, including the AT&T/Cingular 8525, the Dopod 838Pro, the i-mate JASJAM, the O2 XDA Trion, and the Orange SPV M3100 (AKU 3.3.0). Some of these updates update the TyTN to Windows Mobile 5 AKU 3.n.n, others update it to Windows Mobile 6.
Specifications
Screen size:
Screen resolution: 240×320 pixels at 139 ppi, 4:3 aspect ratio, flips into 320x240 landscape mode when keyboard is slid out.
Screen colors: 65536 (16-bit) colors
Input devices: Touchscreen interface, slide-out QWERTY keyboard, and jog wheel
Battery: 1300 or 1350 mAh, user-accessible
Battery has up to 5–6 hours of talk on 3G network and up to 250 hours of standby.
1.9 megapixel camera with fixed focus lens, LED flash, self-portrait mirror, and macro mode
Location finding by detection of cell towers and Wi-Fi networks (through Google Maps Mobile)
Samsung SC32442A (400 MHz ARM ARM920T processor)
ATI Imageon Graphics Processing Unit
RAM: 64 MB DRAM
ROM: 128 MB flash memory
Removable Media: microSD, up to 8GB (microSDHC, up to 32 GB if running Windows Mobile 6)
Operating System: Windows Mobile 5.0 stock ROM with Windows Mobile 6 available to upgrade through HTC e-Club. Unofficial cooked roms for Windows Mobile 6.5 available.
Quad band GSM / GPRS / EDGE (GSM 850, GSM 900, GSM 1800, GSM 1900)
Tri band HSDPA (UMTS 850, UMTS 1900, UMTS 2100) A UMTS 800 band option appears on some updated phones, but has not been confirmed to work.
Wi-Fi (802.11b/g)
Bluetooth 2.0 + EDR
Mini USB combo jack for data transfer, charging, and multi-purpose headset.
Stereo headphone jack (certain models only?)
IrDA
Size: (h) (w) (d)
Weight:
Pre-Loaded Software
(Varies by operator)
AT&T 8525 and Cingular 8525
AOL Instant Messenger
ClearVUE PDF
Excel Mobile
Good Mobile Messaging
Pocket MSN
PowerPoint Mobile
Smart dialing
TeleNav
Windows Live Instant Messenger
Word Mobile
Xpress Mail
Yahoo! Instant Messenger
Notes
The TyTN has a GPS receiver, however it has no GPS antenna and the GPS is disabled both in ROM and physically through disconnection of certain pins on the circuit.
Early models of the TyTN (HT624xxx - HT632xxx) have been known to suffer from screen alignment problems and should be avoided.
See also
HTC Wizard
HTC TyTN II
High Tech Computer Corporation
References
Discussion Forums
HTC TyTN Forum
HowardForums HTC Forum
HowardForums Windows Mobile Professional Forum
HTCGeeks Forum
PDAPhoneHome HTC TyTN Forum
PPCGeeks HTC TyTN Forum
XDA-Developers HTC TyTN Forum
External links
XDA-Developers HTC TyTN Wiki
The Hermes Guide, a website dedicated through guiding users through upgrading safely
Custom built WM6.1 ROM for HTC TyTN and compatible devices
Mobile phones introduced in 2006
Digital audio players
TyTN
Windows Mobile Professional devices
Mobile phones with an integrated hardware keyboard
Mobile phones with infrared transmitter
Mobile phones with user-replaceable battery
|
The women's team foil was one of eight fencing events on the fencing at the 1964 Summer Olympics programme. It was the second appearance of the event. The competition was held from October 16 – 17 1964. 47 fencers from 10 nations competed.
Medalists
Results
Round 1
Ties between teams were broken by individual victories (in parentheses), then by touches received.
Championship rounds
Rosters
Australia
Jan Redman
Johanna Winter
Val Winter
Janet Hopner
Ulrike Winter
France
Catherine Rousselet-Ceretti
Marie-Chantal Depetris-Demaille
Brigitte Gapais-Dumont
Annick Level
Colette Revenu
Germany
Helga Mees
Heidi Schmid
Romy Weiß-Scherberger
Gundi Theuerkauff
Great Britain
Shirley Netherway
Theresa Offredy
Janet Bewley-Cathie-Wardell-Yerburgh
Mary Watts-Tobin
Hungary
Ildikó Ságiné Ujlakyné Rejtő
Lídia Sákovicsné Dömölky
Katalin Nagyné Juhász
Judit Ágoston-Mendelényi
Paula Marosi
Italy
Antonella Ragno-Lonzi
Giovanna Masciotta
Irene Camber-Corno
Natalina Sanguinetti
Bruna Colombetti-Peroncini
Japan
Yoshie Komori
Tamiko Yasui
Tomoko Owada
Yoshie Takeuchi
Romania
Olga Orban-Szabo
Ileana Gyulai-Drîmbă-Jenei
Ana Derșidan-Ene-Pascu
Maria Vicol
Ecaterina Stahl-Iencic
Soviet Union
Valentina Rastvorova
Tatyana Petrenko-Samusenko
Lyudmila Shishova
Valentina Prudskova
Galina Gorokhova
United States
Anne Drungis
Jan York-Romary
Denise O'Connor
Harriet King
Tommy Angell
References
Sources
Fencing at the 1964 Summer Olympics
Olymp
Fen
|
```c++
// __ _____ _____ _____
// __| | __| | | | JSON for Modern C++
// | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| path_to_url
//
#pragma once
#include <algorithm> // reverse
#include <array> // array
#include <map> // map
#include <cmath> // isnan, isinf
#include <cstdint> // uint8_t, uint16_t, uint32_t, uint64_t
#include <cstring> // memcpy
#include <limits> // numeric_limits
#include <string> // string
#include <utility> // move
#include <vector> // vector
#include <nlohmann/detail/input/binary_reader.hpp>
#include <nlohmann/detail/macro_scope.hpp>
#include <nlohmann/detail/output/output_adapters.hpp>
#include <nlohmann/detail/string_concat.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
///////////////////
// binary writer //
///////////////////
/*!
@brief serialization to CBOR and MessagePack values
*/
template<typename BasicJsonType, typename CharType>
class binary_writer
{
using string_t = typename BasicJsonType::string_t;
using binary_t = typename BasicJsonType::binary_t;
using number_float_t = typename BasicJsonType::number_float_t;
public:
/*!
@brief create a binary writer
@param[in] adapter output adapter to write to
*/
explicit binary_writer(output_adapter_t<CharType> adapter) : oa(std::move(adapter))
{
JSON_ASSERT(oa);
}
/*!
@param[in] j JSON value to serialize
@pre j.type() == value_t::object
*/
void write_bson(const BasicJsonType& j)
{
switch (j.type())
{
case value_t::object:
{
write_bson_object(*j.m_data.m_value.object);
break;
}
case value_t::null:
case value_t::array:
case value_t::string:
case value_t::boolean:
case value_t::number_integer:
case value_t::number_unsigned:
case value_t::number_float:
case value_t::binary:
case value_t::discarded:
default:
{
JSON_THROW(type_error::create(317, concat("to serialize to BSON, top-level type must be object, but is ", j.type_name()), &j));
}
}
}
/*!
@param[in] j JSON value to serialize
*/
void write_cbor(const BasicJsonType& j)
{
switch (j.type())
{
case value_t::null:
{
oa->write_character(to_char_type(0xF6));
break;
}
case value_t::boolean:
{
oa->write_character(j.m_data.m_value.boolean
? to_char_type(0xF5)
: to_char_type(0xF4));
break;
}
case value_t::number_integer:
{
if (j.m_data.m_value.number_integer >= 0)
{
// CBOR does not differentiate between positive signed
// integers and unsigned integers. Therefore, we used the
// code from the value_t::number_unsigned case here.
if (j.m_data.m_value.number_integer <= 0x17)
{
write_number(static_cast<std::uint8_t>(j.m_data.m_value.number_integer));
}
else if (j.m_data.m_value.number_integer <= (std::numeric_limits<std::uint8_t>::max)())
{
oa->write_character(to_char_type(0x18));
write_number(static_cast<std::uint8_t>(j.m_data.m_value.number_integer));
}
else if (j.m_data.m_value.number_integer <= (std::numeric_limits<std::uint16_t>::max)())
{
oa->write_character(to_char_type(0x19));
write_number(static_cast<std::uint16_t>(j.m_data.m_value.number_integer));
}
else if (j.m_data.m_value.number_integer <= (std::numeric_limits<std::uint32_t>::max)())
{
oa->write_character(to_char_type(0x1A));
write_number(static_cast<std::uint32_t>(j.m_data.m_value.number_integer));
}
else
{
oa->write_character(to_char_type(0x1B));
write_number(static_cast<std::uint64_t>(j.m_data.m_value.number_integer));
}
}
else
{
// The conversions below encode the sign in the first
// byte, and the value is converted to a positive number.
const auto positive_number = -1 - j.m_data.m_value.number_integer;
if (j.m_data.m_value.number_integer >= -24)
{
write_number(static_cast<std::uint8_t>(0x20 + positive_number));
}
else if (positive_number <= (std::numeric_limits<std::uint8_t>::max)())
{
oa->write_character(to_char_type(0x38));
write_number(static_cast<std::uint8_t>(positive_number));
}
else if (positive_number <= (std::numeric_limits<std::uint16_t>::max)())
{
oa->write_character(to_char_type(0x39));
write_number(static_cast<std::uint16_t>(positive_number));
}
else if (positive_number <= (std::numeric_limits<std::uint32_t>::max)())
{
oa->write_character(to_char_type(0x3A));
write_number(static_cast<std::uint32_t>(positive_number));
}
else
{
oa->write_character(to_char_type(0x3B));
write_number(static_cast<std::uint64_t>(positive_number));
}
}
break;
}
case value_t::number_unsigned:
{
if (j.m_data.m_value.number_unsigned <= 0x17)
{
write_number(static_cast<std::uint8_t>(j.m_data.m_value.number_unsigned));
}
else if (j.m_data.m_value.number_unsigned <= (std::numeric_limits<std::uint8_t>::max)())
{
oa->write_character(to_char_type(0x18));
write_number(static_cast<std::uint8_t>(j.m_data.m_value.number_unsigned));
}
else if (j.m_data.m_value.number_unsigned <= (std::numeric_limits<std::uint16_t>::max)())
{
oa->write_character(to_char_type(0x19));
write_number(static_cast<std::uint16_t>(j.m_data.m_value.number_unsigned));
}
else if (j.m_data.m_value.number_unsigned <= (std::numeric_limits<std::uint32_t>::max)())
{
oa->write_character(to_char_type(0x1A));
write_number(static_cast<std::uint32_t>(j.m_data.m_value.number_unsigned));
}
else
{
oa->write_character(to_char_type(0x1B));
write_number(static_cast<std::uint64_t>(j.m_data.m_value.number_unsigned));
}
break;
}
case value_t::number_float:
{
if (std::isnan(j.m_data.m_value.number_float))
{
// NaN is 0xf97e00 in CBOR
oa->write_character(to_char_type(0xF9));
oa->write_character(to_char_type(0x7E));
oa->write_character(to_char_type(0x00));
}
else if (std::isinf(j.m_data.m_value.number_float))
{
// Infinity is 0xf97c00, -Infinity is 0xf9fc00
oa->write_character(to_char_type(0xf9));
oa->write_character(j.m_data.m_value.number_float > 0 ? to_char_type(0x7C) : to_char_type(0xFC));
oa->write_character(to_char_type(0x00));
}
else
{
write_compact_float(j.m_data.m_value.number_float, detail::input_format_t::cbor);
}
break;
}
case value_t::string:
{
// step 1: write control byte and the string length
const auto N = j.m_data.m_value.string->size();
if (N <= 0x17)
{
write_number(static_cast<std::uint8_t>(0x60 + N));
}
else if (N <= (std::numeric_limits<std::uint8_t>::max)())
{
oa->write_character(to_char_type(0x78));
write_number(static_cast<std::uint8_t>(N));
}
else if (N <= (std::numeric_limits<std::uint16_t>::max)())
{
oa->write_character(to_char_type(0x79));
write_number(static_cast<std::uint16_t>(N));
}
else if (N <= (std::numeric_limits<std::uint32_t>::max)())
{
oa->write_character(to_char_type(0x7A));
write_number(static_cast<std::uint32_t>(N));
}
// LCOV_EXCL_START
else if (N <= (std::numeric_limits<std::uint64_t>::max)())
{
oa->write_character(to_char_type(0x7B));
write_number(static_cast<std::uint64_t>(N));
}
// LCOV_EXCL_STOP
// step 2: write the string
oa->write_characters(
reinterpret_cast<const CharType*>(j.m_data.m_value.string->c_str()),
j.m_data.m_value.string->size());
break;
}
case value_t::array:
{
// step 1: write control byte and the array size
const auto N = j.m_data.m_value.array->size();
if (N <= 0x17)
{
write_number(static_cast<std::uint8_t>(0x80 + N));
}
else if (N <= (std::numeric_limits<std::uint8_t>::max)())
{
oa->write_character(to_char_type(0x98));
write_number(static_cast<std::uint8_t>(N));
}
else if (N <= (std::numeric_limits<std::uint16_t>::max)())
{
oa->write_character(to_char_type(0x99));
write_number(static_cast<std::uint16_t>(N));
}
else if (N <= (std::numeric_limits<std::uint32_t>::max)())
{
oa->write_character(to_char_type(0x9A));
write_number(static_cast<std::uint32_t>(N));
}
// LCOV_EXCL_START
else if (N <= (std::numeric_limits<std::uint64_t>::max)())
{
oa->write_character(to_char_type(0x9B));
write_number(static_cast<std::uint64_t>(N));
}
// LCOV_EXCL_STOP
// step 2: write each element
for (const auto& el : *j.m_data.m_value.array)
{
write_cbor(el);
}
break;
}
case value_t::binary:
{
if (j.m_data.m_value.binary->has_subtype())
{
if (j.m_data.m_value.binary->subtype() <= (std::numeric_limits<std::uint8_t>::max)())
{
write_number(static_cast<std::uint8_t>(0xd8));
write_number(static_cast<std::uint8_t>(j.m_data.m_value.binary->subtype()));
}
else if (j.m_data.m_value.binary->subtype() <= (std::numeric_limits<std::uint16_t>::max)())
{
write_number(static_cast<std::uint8_t>(0xd9));
write_number(static_cast<std::uint16_t>(j.m_data.m_value.binary->subtype()));
}
else if (j.m_data.m_value.binary->subtype() <= (std::numeric_limits<std::uint32_t>::max)())
{
write_number(static_cast<std::uint8_t>(0xda));
write_number(static_cast<std::uint32_t>(j.m_data.m_value.binary->subtype()));
}
else if (j.m_data.m_value.binary->subtype() <= (std::numeric_limits<std::uint64_t>::max)())
{
write_number(static_cast<std::uint8_t>(0xdb));
write_number(static_cast<std::uint64_t>(j.m_data.m_value.binary->subtype()));
}
}
// step 1: write control byte and the binary array size
const auto N = j.m_data.m_value.binary->size();
if (N <= 0x17)
{
write_number(static_cast<std::uint8_t>(0x40 + N));
}
else if (N <= (std::numeric_limits<std::uint8_t>::max)())
{
oa->write_character(to_char_type(0x58));
write_number(static_cast<std::uint8_t>(N));
}
else if (N <= (std::numeric_limits<std::uint16_t>::max)())
{
oa->write_character(to_char_type(0x59));
write_number(static_cast<std::uint16_t>(N));
}
else if (N <= (std::numeric_limits<std::uint32_t>::max)())
{
oa->write_character(to_char_type(0x5A));
write_number(static_cast<std::uint32_t>(N));
}
// LCOV_EXCL_START
else if (N <= (std::numeric_limits<std::uint64_t>::max)())
{
oa->write_character(to_char_type(0x5B));
write_number(static_cast<std::uint64_t>(N));
}
// LCOV_EXCL_STOP
// step 2: write each element
oa->write_characters(
reinterpret_cast<const CharType*>(j.m_data.m_value.binary->data()),
N);
break;
}
case value_t::object:
{
// step 1: write control byte and the object size
const auto N = j.m_data.m_value.object->size();
if (N <= 0x17)
{
write_number(static_cast<std::uint8_t>(0xA0 + N));
}
else if (N <= (std::numeric_limits<std::uint8_t>::max)())
{
oa->write_character(to_char_type(0xB8));
write_number(static_cast<std::uint8_t>(N));
}
else if (N <= (std::numeric_limits<std::uint16_t>::max)())
{
oa->write_character(to_char_type(0xB9));
write_number(static_cast<std::uint16_t>(N));
}
else if (N <= (std::numeric_limits<std::uint32_t>::max)())
{
oa->write_character(to_char_type(0xBA));
write_number(static_cast<std::uint32_t>(N));
}
// LCOV_EXCL_START
else if (N <= (std::numeric_limits<std::uint64_t>::max)())
{
oa->write_character(to_char_type(0xBB));
write_number(static_cast<std::uint64_t>(N));
}
// LCOV_EXCL_STOP
// step 2: write each element
for (const auto& el : *j.m_data.m_value.object)
{
write_cbor(el.first);
write_cbor(el.second);
}
break;
}
case value_t::discarded:
default:
break;
}
}
/*!
@param[in] j JSON value to serialize
*/
void write_msgpack(const BasicJsonType& j)
{
switch (j.type())
{
case value_t::null: // nil
{
oa->write_character(to_char_type(0xC0));
break;
}
case value_t::boolean: // true and false
{
oa->write_character(j.m_data.m_value.boolean
? to_char_type(0xC3)
: to_char_type(0xC2));
break;
}
case value_t::number_integer:
{
if (j.m_data.m_value.number_integer >= 0)
{
// MessagePack does not differentiate between positive
// signed integers and unsigned integers. Therefore, we used
// the code from the value_t::number_unsigned case here.
if (j.m_data.m_value.number_unsigned < 128)
{
// positive fixnum
write_number(static_cast<std::uint8_t>(j.m_data.m_value.number_integer));
}
else if (j.m_data.m_value.number_unsigned <= (std::numeric_limits<std::uint8_t>::max)())
{
// uint 8
oa->write_character(to_char_type(0xCC));
write_number(static_cast<std::uint8_t>(j.m_data.m_value.number_integer));
}
else if (j.m_data.m_value.number_unsigned <= (std::numeric_limits<std::uint16_t>::max)())
{
// uint 16
oa->write_character(to_char_type(0xCD));
write_number(static_cast<std::uint16_t>(j.m_data.m_value.number_integer));
}
else if (j.m_data.m_value.number_unsigned <= (std::numeric_limits<std::uint32_t>::max)())
{
// uint 32
oa->write_character(to_char_type(0xCE));
write_number(static_cast<std::uint32_t>(j.m_data.m_value.number_integer));
}
else if (j.m_data.m_value.number_unsigned <= (std::numeric_limits<std::uint64_t>::max)())
{
// uint 64
oa->write_character(to_char_type(0xCF));
write_number(static_cast<std::uint64_t>(j.m_data.m_value.number_integer));
}
}
else
{
if (j.m_data.m_value.number_integer >= -32)
{
// negative fixnum
write_number(static_cast<std::int8_t>(j.m_data.m_value.number_integer));
}
else if (j.m_data.m_value.number_integer >= (std::numeric_limits<std::int8_t>::min)() &&
j.m_data.m_value.number_integer <= (std::numeric_limits<std::int8_t>::max)())
{
// int 8
oa->write_character(to_char_type(0xD0));
write_number(static_cast<std::int8_t>(j.m_data.m_value.number_integer));
}
else if (j.m_data.m_value.number_integer >= (std::numeric_limits<std::int16_t>::min)() &&
j.m_data.m_value.number_integer <= (std::numeric_limits<std::int16_t>::max)())
{
// int 16
oa->write_character(to_char_type(0xD1));
write_number(static_cast<std::int16_t>(j.m_data.m_value.number_integer));
}
else if (j.m_data.m_value.number_integer >= (std::numeric_limits<std::int32_t>::min)() &&
j.m_data.m_value.number_integer <= (std::numeric_limits<std::int32_t>::max)())
{
// int 32
oa->write_character(to_char_type(0xD2));
write_number(static_cast<std::int32_t>(j.m_data.m_value.number_integer));
}
else if (j.m_data.m_value.number_integer >= (std::numeric_limits<std::int64_t>::min)() &&
j.m_data.m_value.number_integer <= (std::numeric_limits<std::int64_t>::max)())
{
// int 64
oa->write_character(to_char_type(0xD3));
write_number(static_cast<std::int64_t>(j.m_data.m_value.number_integer));
}
}
break;
}
case value_t::number_unsigned:
{
if (j.m_data.m_value.number_unsigned < 128)
{
// positive fixnum
write_number(static_cast<std::uint8_t>(j.m_data.m_value.number_integer));
}
else if (j.m_data.m_value.number_unsigned <= (std::numeric_limits<std::uint8_t>::max)())
{
// uint 8
oa->write_character(to_char_type(0xCC));
write_number(static_cast<std::uint8_t>(j.m_data.m_value.number_integer));
}
else if (j.m_data.m_value.number_unsigned <= (std::numeric_limits<std::uint16_t>::max)())
{
// uint 16
oa->write_character(to_char_type(0xCD));
write_number(static_cast<std::uint16_t>(j.m_data.m_value.number_integer));
}
else if (j.m_data.m_value.number_unsigned <= (std::numeric_limits<std::uint32_t>::max)())
{
// uint 32
oa->write_character(to_char_type(0xCE));
write_number(static_cast<std::uint32_t>(j.m_data.m_value.number_integer));
}
else if (j.m_data.m_value.number_unsigned <= (std::numeric_limits<std::uint64_t>::max)())
{
// uint 64
oa->write_character(to_char_type(0xCF));
write_number(static_cast<std::uint64_t>(j.m_data.m_value.number_integer));
}
break;
}
case value_t::number_float:
{
write_compact_float(j.m_data.m_value.number_float, detail::input_format_t::msgpack);
break;
}
case value_t::string:
{
// step 1: write control byte and the string length
const auto N = j.m_data.m_value.string->size();
if (N <= 31)
{
// fixstr
write_number(static_cast<std::uint8_t>(0xA0 | N));
}
else if (N <= (std::numeric_limits<std::uint8_t>::max)())
{
// str 8
oa->write_character(to_char_type(0xD9));
write_number(static_cast<std::uint8_t>(N));
}
else if (N <= (std::numeric_limits<std::uint16_t>::max)())
{
// str 16
oa->write_character(to_char_type(0xDA));
write_number(static_cast<std::uint16_t>(N));
}
else if (N <= (std::numeric_limits<std::uint32_t>::max)())
{
// str 32
oa->write_character(to_char_type(0xDB));
write_number(static_cast<std::uint32_t>(N));
}
// step 2: write the string
oa->write_characters(
reinterpret_cast<const CharType*>(j.m_data.m_value.string->c_str()),
j.m_data.m_value.string->size());
break;
}
case value_t::array:
{
// step 1: write control byte and the array size
const auto N = j.m_data.m_value.array->size();
if (N <= 15)
{
// fixarray
write_number(static_cast<std::uint8_t>(0x90 | N));
}
else if (N <= (std::numeric_limits<std::uint16_t>::max)())
{
// array 16
oa->write_character(to_char_type(0xDC));
write_number(static_cast<std::uint16_t>(N));
}
else if (N <= (std::numeric_limits<std::uint32_t>::max)())
{
// array 32
oa->write_character(to_char_type(0xDD));
write_number(static_cast<std::uint32_t>(N));
}
// step 2: write each element
for (const auto& el : *j.m_data.m_value.array)
{
write_msgpack(el);
}
break;
}
case value_t::binary:
{
// step 0: determine if the binary type has a set subtype to
// determine whether or not to use the ext or fixext types
const bool use_ext = j.m_data.m_value.binary->has_subtype();
// step 1: write control byte and the byte string length
const auto N = j.m_data.m_value.binary->size();
if (N <= (std::numeric_limits<std::uint8_t>::max)())
{
std::uint8_t output_type{};
bool fixed = true;
if (use_ext)
{
switch (N)
{
case 1:
output_type = 0xD4; // fixext 1
break;
case 2:
output_type = 0xD5; // fixext 2
break;
case 4:
output_type = 0xD6; // fixext 4
break;
case 8:
output_type = 0xD7; // fixext 8
break;
case 16:
output_type = 0xD8; // fixext 16
break;
default:
output_type = 0xC7; // ext 8
fixed = false;
break;
}
}
else
{
output_type = 0xC4; // bin 8
fixed = false;
}
oa->write_character(to_char_type(output_type));
if (!fixed)
{
write_number(static_cast<std::uint8_t>(N));
}
}
else if (N <= (std::numeric_limits<std::uint16_t>::max)())
{
const std::uint8_t output_type = use_ext
? 0xC8 // ext 16
: 0xC5; // bin 16
oa->write_character(to_char_type(output_type));
write_number(static_cast<std::uint16_t>(N));
}
else if (N <= (std::numeric_limits<std::uint32_t>::max)())
{
const std::uint8_t output_type = use_ext
? 0xC9 // ext 32
: 0xC6; // bin 32
oa->write_character(to_char_type(output_type));
write_number(static_cast<std::uint32_t>(N));
}
// step 1.5: if this is an ext type, write the subtype
if (use_ext)
{
write_number(static_cast<std::int8_t>(j.m_data.m_value.binary->subtype()));
}
// step 2: write the byte string
oa->write_characters(
reinterpret_cast<const CharType*>(j.m_data.m_value.binary->data()),
N);
break;
}
case value_t::object:
{
// step 1: write control byte and the object size
const auto N = j.m_data.m_value.object->size();
if (N <= 15)
{
// fixmap
write_number(static_cast<std::uint8_t>(0x80 | (N & 0xF)));
}
else if (N <= (std::numeric_limits<std::uint16_t>::max)())
{
// map 16
oa->write_character(to_char_type(0xDE));
write_number(static_cast<std::uint16_t>(N));
}
else if (N <= (std::numeric_limits<std::uint32_t>::max)())
{
// map 32
oa->write_character(to_char_type(0xDF));
write_number(static_cast<std::uint32_t>(N));
}
// step 2: write each element
for (const auto& el : *j.m_data.m_value.object)
{
write_msgpack(el.first);
write_msgpack(el.second);
}
break;
}
case value_t::discarded:
default:
break;
}
}
/*!
@param[in] j JSON value to serialize
@param[in] use_count whether to use '#' prefixes (optimized format)
@param[in] use_type whether to use '$' prefixes (optimized format)
@param[in] add_prefix whether prefixes need to be used for this value
@param[in] use_bjdata whether write in BJData format, default is false
*/
void write_ubjson(const BasicJsonType& j, const bool use_count,
const bool use_type, const bool add_prefix = true,
const bool use_bjdata = false)
{
switch (j.type())
{
case value_t::null:
{
if (add_prefix)
{
oa->write_character(to_char_type('Z'));
}
break;
}
case value_t::boolean:
{
if (add_prefix)
{
oa->write_character(j.m_data.m_value.boolean
? to_char_type('T')
: to_char_type('F'));
}
break;
}
case value_t::number_integer:
{
write_number_with_ubjson_prefix(j.m_data.m_value.number_integer, add_prefix, use_bjdata);
break;
}
case value_t::number_unsigned:
{
write_number_with_ubjson_prefix(j.m_data.m_value.number_unsigned, add_prefix, use_bjdata);
break;
}
case value_t::number_float:
{
write_number_with_ubjson_prefix(j.m_data.m_value.number_float, add_prefix, use_bjdata);
break;
}
case value_t::string:
{
if (add_prefix)
{
oa->write_character(to_char_type('S'));
}
write_number_with_ubjson_prefix(j.m_data.m_value.string->size(), true, use_bjdata);
oa->write_characters(
reinterpret_cast<const CharType*>(j.m_data.m_value.string->c_str()),
j.m_data.m_value.string->size());
break;
}
case value_t::array:
{
if (add_prefix)
{
oa->write_character(to_char_type('['));
}
bool prefix_required = true;
if (use_type && !j.m_data.m_value.array->empty())
{
JSON_ASSERT(use_count);
const CharType first_prefix = ubjson_prefix(j.front(), use_bjdata);
const bool same_prefix = std::all_of(j.begin() + 1, j.end(),
[this, first_prefix, use_bjdata](const BasicJsonType & v)
{
return ubjson_prefix(v, use_bjdata) == first_prefix;
});
std::vector<CharType> bjdx = {'[', '{', 'S', 'H', 'T', 'F', 'N', 'Z'}; // excluded markers in bjdata optimized type
if (same_prefix && !(use_bjdata && std::find(bjdx.begin(), bjdx.end(), first_prefix) != bjdx.end()))
{
prefix_required = false;
oa->write_character(to_char_type('$'));
oa->write_character(first_prefix);
}
}
if (use_count)
{
oa->write_character(to_char_type('#'));
write_number_with_ubjson_prefix(j.m_data.m_value.array->size(), true, use_bjdata);
}
for (const auto& el : *j.m_data.m_value.array)
{
write_ubjson(el, use_count, use_type, prefix_required, use_bjdata);
}
if (!use_count)
{
oa->write_character(to_char_type(']'));
}
break;
}
case value_t::binary:
{
if (add_prefix)
{
oa->write_character(to_char_type('['));
}
if (use_type && !j.m_data.m_value.binary->empty())
{
JSON_ASSERT(use_count);
oa->write_character(to_char_type('$'));
oa->write_character('U');
}
if (use_count)
{
oa->write_character(to_char_type('#'));
write_number_with_ubjson_prefix(j.m_data.m_value.binary->size(), true, use_bjdata);
}
if (use_type)
{
oa->write_characters(
reinterpret_cast<const CharType*>(j.m_data.m_value.binary->data()),
j.m_data.m_value.binary->size());
}
else
{
for (size_t i = 0; i < j.m_data.m_value.binary->size(); ++i)
{
oa->write_character(to_char_type('U'));
oa->write_character(j.m_data.m_value.binary->data()[i]);
}
}
if (!use_count)
{
oa->write_character(to_char_type(']'));
}
break;
}
case value_t::object:
{
if (use_bjdata && j.m_data.m_value.object->size() == 3 && j.m_data.m_value.object->find("_ArrayType_") != j.m_data.m_value.object->end() && j.m_data.m_value.object->find("_ArraySize_") != j.m_data.m_value.object->end() && j.m_data.m_value.object->find("_ArrayData_") != j.m_data.m_value.object->end())
{
if (!write_bjdata_ndarray(*j.m_data.m_value.object, use_count, use_type)) // decode bjdata ndarray in the JData format (path_to_url
{
break;
}
}
if (add_prefix)
{
oa->write_character(to_char_type('{'));
}
bool prefix_required = true;
if (use_type && !j.m_data.m_value.object->empty())
{
JSON_ASSERT(use_count);
const CharType first_prefix = ubjson_prefix(j.front(), use_bjdata);
const bool same_prefix = std::all_of(j.begin(), j.end(),
[this, first_prefix, use_bjdata](const BasicJsonType & v)
{
return ubjson_prefix(v, use_bjdata) == first_prefix;
});
std::vector<CharType> bjdx = {'[', '{', 'S', 'H', 'T', 'F', 'N', 'Z'}; // excluded markers in bjdata optimized type
if (same_prefix && !(use_bjdata && std::find(bjdx.begin(), bjdx.end(), first_prefix) != bjdx.end()))
{
prefix_required = false;
oa->write_character(to_char_type('$'));
oa->write_character(first_prefix);
}
}
if (use_count)
{
oa->write_character(to_char_type('#'));
write_number_with_ubjson_prefix(j.m_data.m_value.object->size(), true, use_bjdata);
}
for (const auto& el : *j.m_data.m_value.object)
{
write_number_with_ubjson_prefix(el.first.size(), true, use_bjdata);
oa->write_characters(
reinterpret_cast<const CharType*>(el.first.c_str()),
el.first.size());
write_ubjson(el.second, use_count, use_type, prefix_required, use_bjdata);
}
if (!use_count)
{
oa->write_character(to_char_type('}'));
}
break;
}
case value_t::discarded:
default:
break;
}
}
private:
//////////
// BSON //
//////////
/*!
@return The size of a BSON document entry header, including the id marker
and the entry name size (and its null-terminator).
*/
static std::size_t calc_bson_entry_header_size(const string_t& name, const BasicJsonType& j)
{
const auto it = name.find(static_cast<typename string_t::value_type>(0));
if (JSON_HEDLEY_UNLIKELY(it != BasicJsonType::string_t::npos))
{
JSON_THROW(out_of_range::create(409, concat("BSON key cannot contain code point U+0000 (at byte ", std::to_string(it), ")"), &j));
static_cast<void>(j);
}
return /*id*/ 1ul + name.size() + /*zero-terminator*/1u;
}
/*!
@brief Writes the given @a element_type and @a name to the output adapter
*/
void write_bson_entry_header(const string_t& name,
const std::uint8_t element_type)
{
oa->write_character(to_char_type(element_type)); // boolean
oa->write_characters(
reinterpret_cast<const CharType*>(name.c_str()),
name.size() + 1u);
}
/*!
@brief Writes a BSON element with key @a name and boolean value @a value
*/
void write_bson_boolean(const string_t& name,
const bool value)
{
write_bson_entry_header(name, 0x08);
oa->write_character(value ? to_char_type(0x01) : to_char_type(0x00));
}
/*!
@brief Writes a BSON element with key @a name and double value @a value
*/
void write_bson_double(const string_t& name,
const double value)
{
write_bson_entry_header(name, 0x01);
write_number<double>(value, true);
}
/*!
@return The size of the BSON-encoded string in @a value
*/
static std::size_t calc_bson_string_size(const string_t& value)
{
return sizeof(std::int32_t) + value.size() + 1ul;
}
/*!
@brief Writes a BSON element with key @a name and string value @a value
*/
void write_bson_string(const string_t& name,
const string_t& value)
{
write_bson_entry_header(name, 0x02);
write_number<std::int32_t>(static_cast<std::int32_t>(value.size() + 1ul), true);
oa->write_characters(
reinterpret_cast<const CharType*>(value.c_str()),
value.size() + 1);
}
/*!
@brief Writes a BSON element with key @a name and null value
*/
void write_bson_null(const string_t& name)
{
write_bson_entry_header(name, 0x0A);
}
/*!
@return The size of the BSON-encoded integer @a value
*/
static std::size_t calc_bson_integer_size(const std::int64_t value)
{
return (std::numeric_limits<std::int32_t>::min)() <= value && value <= (std::numeric_limits<std::int32_t>::max)()
? sizeof(std::int32_t)
: sizeof(std::int64_t);
}
/*!
@brief Writes a BSON element with key @a name and integer @a value
*/
void write_bson_integer(const string_t& name,
const std::int64_t value)
{
if ((std::numeric_limits<std::int32_t>::min)() <= value && value <= (std::numeric_limits<std::int32_t>::max)())
{
write_bson_entry_header(name, 0x10); // int32
write_number<std::int32_t>(static_cast<std::int32_t>(value), true);
}
else
{
write_bson_entry_header(name, 0x12); // int64
write_number<std::int64_t>(static_cast<std::int64_t>(value), true);
}
}
/*!
@return The size of the BSON-encoded unsigned integer in @a j
*/
static constexpr std::size_t calc_bson_unsigned_size(const std::uint64_t value) noexcept
{
return (value <= static_cast<std::uint64_t>((std::numeric_limits<std::int32_t>::max)()))
? sizeof(std::int32_t)
: sizeof(std::int64_t);
}
/*!
@brief Writes a BSON element with key @a name and unsigned @a value
*/
void write_bson_unsigned(const string_t& name,
const BasicJsonType& j)
{
if (j.m_data.m_value.number_unsigned <= static_cast<std::uint64_t>((std::numeric_limits<std::int32_t>::max)()))
{
write_bson_entry_header(name, 0x10 /* int32 */);
write_number<std::int32_t>(static_cast<std::int32_t>(j.m_data.m_value.number_unsigned), true);
}
else if (j.m_data.m_value.number_unsigned <= static_cast<std::uint64_t>((std::numeric_limits<std::int64_t>::max)()))
{
write_bson_entry_header(name, 0x12 /* int64 */);
write_number<std::int64_t>(static_cast<std::int64_t>(j.m_data.m_value.number_unsigned), true);
}
else
{
JSON_THROW(out_of_range::create(407, concat("integer number ", std::to_string(j.m_data.m_value.number_unsigned), " cannot be represented by BSON as it does not fit int64"), &j));
}
}
/*!
@brief Writes a BSON element with key @a name and object @a value
*/
void write_bson_object_entry(const string_t& name,
const typename BasicJsonType::object_t& value)
{
write_bson_entry_header(name, 0x03); // object
write_bson_object(value);
}
/*!
@return The size of the BSON-encoded array @a value
*/
static std::size_t calc_bson_array_size(const typename BasicJsonType::array_t& value)
{
std::size_t array_index = 0ul;
const std::size_t embedded_document_size = std::accumulate(std::begin(value), std::end(value), static_cast<std::size_t>(0), [&array_index](std::size_t result, const typename BasicJsonType::array_t::value_type & el)
{
return result + calc_bson_element_size(std::to_string(array_index++), el);
});
return sizeof(std::int32_t) + embedded_document_size + 1ul;
}
/*!
@return The size of the BSON-encoded binary array @a value
*/
static std::size_t calc_bson_binary_size(const typename BasicJsonType::binary_t& value)
{
return sizeof(std::int32_t) + value.size() + 1ul;
}
/*!
@brief Writes a BSON element with key @a name and array @a value
*/
void write_bson_array(const string_t& name,
const typename BasicJsonType::array_t& value)
{
write_bson_entry_header(name, 0x04); // array
write_number<std::int32_t>(static_cast<std::int32_t>(calc_bson_array_size(value)), true);
std::size_t array_index = 0ul;
for (const auto& el : value)
{
write_bson_element(std::to_string(array_index++), el);
}
oa->write_character(to_char_type(0x00));
}
/*!
@brief Writes a BSON element with key @a name and binary value @a value
*/
void write_bson_binary(const string_t& name,
const binary_t& value)
{
write_bson_entry_header(name, 0x05);
write_number<std::int32_t>(static_cast<std::int32_t>(value.size()), true);
write_number(value.has_subtype() ? static_cast<std::uint8_t>(value.subtype()) : static_cast<std::uint8_t>(0x00));
oa->write_characters(reinterpret_cast<const CharType*>(value.data()), value.size());
}
/*!
@brief Calculates the size necessary to serialize the JSON value @a j with its @a name
@return The calculated size for the BSON document entry for @a j with the given @a name.
*/
static std::size_t calc_bson_element_size(const string_t& name,
const BasicJsonType& j)
{
const auto header_size = calc_bson_entry_header_size(name, j);
switch (j.type())
{
case value_t::object:
return header_size + calc_bson_object_size(*j.m_data.m_value.object);
case value_t::array:
return header_size + calc_bson_array_size(*j.m_data.m_value.array);
case value_t::binary:
return header_size + calc_bson_binary_size(*j.m_data.m_value.binary);
case value_t::boolean:
return header_size + 1ul;
case value_t::number_float:
return header_size + 8ul;
case value_t::number_integer:
return header_size + calc_bson_integer_size(j.m_data.m_value.number_integer);
case value_t::number_unsigned:
return header_size + calc_bson_unsigned_size(j.m_data.m_value.number_unsigned);
case value_t::string:
return header_size + calc_bson_string_size(*j.m_data.m_value.string);
case value_t::null:
return header_size + 0ul;
// LCOV_EXCL_START
case value_t::discarded:
default:
JSON_ASSERT(false); // NOLINT(cert-dcl03-c,hicpp-static-assert,misc-static-assert)
return 0ul;
// LCOV_EXCL_STOP
}
}
/*!
@brief Serializes the JSON value @a j to BSON and associates it with the
key @a name.
@param name The name to associate with the JSON entity @a j within the
current BSON document
*/
void write_bson_element(const string_t& name,
const BasicJsonType& j)
{
switch (j.type())
{
case value_t::object:
return write_bson_object_entry(name, *j.m_data.m_value.object);
case value_t::array:
return write_bson_array(name, *j.m_data.m_value.array);
case value_t::binary:
return write_bson_binary(name, *j.m_data.m_value.binary);
case value_t::boolean:
return write_bson_boolean(name, j.m_data.m_value.boolean);
case value_t::number_float:
return write_bson_double(name, j.m_data.m_value.number_float);
case value_t::number_integer:
return write_bson_integer(name, j.m_data.m_value.number_integer);
case value_t::number_unsigned:
return write_bson_unsigned(name, j);
case value_t::string:
return write_bson_string(name, *j.m_data.m_value.string);
case value_t::null:
return write_bson_null(name);
// LCOV_EXCL_START
case value_t::discarded:
default:
JSON_ASSERT(false); // NOLINT(cert-dcl03-c,hicpp-static-assert,misc-static-assert)
return;
// LCOV_EXCL_STOP
}
}
/*!
@brief Calculates the size of the BSON serialization of the given
JSON-object @a j.
@param[in] value JSON value to serialize
@pre value.type() == value_t::object
*/
static std::size_t calc_bson_object_size(const typename BasicJsonType::object_t& value)
{
const std::size_t document_size = std::accumulate(value.begin(), value.end(), static_cast<std::size_t>(0),
[](size_t result, const typename BasicJsonType::object_t::value_type & el)
{
return result += calc_bson_element_size(el.first, el.second);
});
return sizeof(std::int32_t) + document_size + 1ul;
}
/*!
@param[in] value JSON value to serialize
@pre value.type() == value_t::object
*/
void write_bson_object(const typename BasicJsonType::object_t& value)
{
write_number<std::int32_t>(static_cast<std::int32_t>(calc_bson_object_size(value)), true);
for (const auto& el : value)
{
write_bson_element(el.first, el.second);
}
oa->write_character(to_char_type(0x00));
}
//////////
// CBOR //
//////////
static constexpr CharType get_cbor_float_prefix(float /*unused*/)
{
return to_char_type(0xFA); // Single-Precision Float
}
static constexpr CharType get_cbor_float_prefix(double /*unused*/)
{
return to_char_type(0xFB); // Double-Precision Float
}
/////////////
// MsgPack //
/////////////
static constexpr CharType get_msgpack_float_prefix(float /*unused*/)
{
return to_char_type(0xCA); // float 32
}
static constexpr CharType get_msgpack_float_prefix(double /*unused*/)
{
return to_char_type(0xCB); // float 64
}
////////////
// UBJSON //
////////////
// UBJSON: write number (floating point)
template<typename NumberType, typename std::enable_if<
std::is_floating_point<NumberType>::value, int>::type = 0>
void write_number_with_ubjson_prefix(const NumberType n,
const bool add_prefix,
const bool use_bjdata)
{
if (add_prefix)
{
oa->write_character(get_ubjson_float_prefix(n));
}
write_number(n, use_bjdata);
}
// UBJSON: write number (unsigned integer)
template<typename NumberType, typename std::enable_if<
std::is_unsigned<NumberType>::value, int>::type = 0>
void write_number_with_ubjson_prefix(const NumberType n,
const bool add_prefix,
const bool use_bjdata)
{
if (n <= static_cast<std::uint64_t>((std::numeric_limits<std::int8_t>::max)()))
{
if (add_prefix)
{
oa->write_character(to_char_type('i')); // int8
}
write_number(static_cast<std::uint8_t>(n), use_bjdata);
}
else if (n <= (std::numeric_limits<std::uint8_t>::max)())
{
if (add_prefix)
{
oa->write_character(to_char_type('U')); // uint8
}
write_number(static_cast<std::uint8_t>(n), use_bjdata);
}
else if (n <= static_cast<std::uint64_t>((std::numeric_limits<std::int16_t>::max)()))
{
if (add_prefix)
{
oa->write_character(to_char_type('I')); // int16
}
write_number(static_cast<std::int16_t>(n), use_bjdata);
}
else if (use_bjdata && n <= static_cast<uint64_t>((std::numeric_limits<uint16_t>::max)()))
{
if (add_prefix)
{
oa->write_character(to_char_type('u')); // uint16 - bjdata only
}
write_number(static_cast<std::uint16_t>(n), use_bjdata);
}
else if (n <= static_cast<std::uint64_t>((std::numeric_limits<std::int32_t>::max)()))
{
if (add_prefix)
{
oa->write_character(to_char_type('l')); // int32
}
write_number(static_cast<std::int32_t>(n), use_bjdata);
}
else if (use_bjdata && n <= static_cast<uint64_t>((std::numeric_limits<uint32_t>::max)()))
{
if (add_prefix)
{
oa->write_character(to_char_type('m')); // uint32 - bjdata only
}
write_number(static_cast<std::uint32_t>(n), use_bjdata);
}
else if (n <= static_cast<std::uint64_t>((std::numeric_limits<std::int64_t>::max)()))
{
if (add_prefix)
{
oa->write_character(to_char_type('L')); // int64
}
write_number(static_cast<std::int64_t>(n), use_bjdata);
}
else if (use_bjdata && n <= (std::numeric_limits<uint64_t>::max)())
{
if (add_prefix)
{
oa->write_character(to_char_type('M')); // uint64 - bjdata only
}
write_number(static_cast<std::uint64_t>(n), use_bjdata);
}
else
{
if (add_prefix)
{
oa->write_character(to_char_type('H')); // high-precision number
}
const auto number = BasicJsonType(n).dump();
write_number_with_ubjson_prefix(number.size(), true, use_bjdata);
for (std::size_t i = 0; i < number.size(); ++i)
{
oa->write_character(to_char_type(static_cast<std::uint8_t>(number[i])));
}
}
}
// UBJSON: write number (signed integer)
template < typename NumberType, typename std::enable_if <
std::is_signed<NumberType>::value&&
!std::is_floating_point<NumberType>::value, int >::type = 0 >
void write_number_with_ubjson_prefix(const NumberType n,
const bool add_prefix,
const bool use_bjdata)
{
if ((std::numeric_limits<std::int8_t>::min)() <= n && n <= (std::numeric_limits<std::int8_t>::max)())
{
if (add_prefix)
{
oa->write_character(to_char_type('i')); // int8
}
write_number(static_cast<std::int8_t>(n), use_bjdata);
}
else if (static_cast<std::int64_t>((std::numeric_limits<std::uint8_t>::min)()) <= n && n <= static_cast<std::int64_t>((std::numeric_limits<std::uint8_t>::max)()))
{
if (add_prefix)
{
oa->write_character(to_char_type('U')); // uint8
}
write_number(static_cast<std::uint8_t>(n), use_bjdata);
}
else if ((std::numeric_limits<std::int16_t>::min)() <= n && n <= (std::numeric_limits<std::int16_t>::max)())
{
if (add_prefix)
{
oa->write_character(to_char_type('I')); // int16
}
write_number(static_cast<std::int16_t>(n), use_bjdata);
}
else if (use_bjdata && (static_cast<std::int64_t>((std::numeric_limits<std::uint16_t>::min)()) <= n && n <= static_cast<std::int64_t>((std::numeric_limits<std::uint16_t>::max)())))
{
if (add_prefix)
{
oa->write_character(to_char_type('u')); // uint16 - bjdata only
}
write_number(static_cast<uint16_t>(n), use_bjdata);
}
else if ((std::numeric_limits<std::int32_t>::min)() <= n && n <= (std::numeric_limits<std::int32_t>::max)())
{
if (add_prefix)
{
oa->write_character(to_char_type('l')); // int32
}
write_number(static_cast<std::int32_t>(n), use_bjdata);
}
else if (use_bjdata && (static_cast<std::int64_t>((std::numeric_limits<std::uint32_t>::min)()) <= n && n <= static_cast<std::int64_t>((std::numeric_limits<std::uint32_t>::max)())))
{
if (add_prefix)
{
oa->write_character(to_char_type('m')); // uint32 - bjdata only
}
write_number(static_cast<uint32_t>(n), use_bjdata);
}
else if ((std::numeric_limits<std::int64_t>::min)() <= n && n <= (std::numeric_limits<std::int64_t>::max)())
{
if (add_prefix)
{
oa->write_character(to_char_type('L')); // int64
}
write_number(static_cast<std::int64_t>(n), use_bjdata);
}
// LCOV_EXCL_START
else
{
if (add_prefix)
{
oa->write_character(to_char_type('H')); // high-precision number
}
const auto number = BasicJsonType(n).dump();
write_number_with_ubjson_prefix(number.size(), true, use_bjdata);
for (std::size_t i = 0; i < number.size(); ++i)
{
oa->write_character(to_char_type(static_cast<std::uint8_t>(number[i])));
}
}
// LCOV_EXCL_STOP
}
/*!
@brief determine the type prefix of container values
*/
CharType ubjson_prefix(const BasicJsonType& j, const bool use_bjdata) const noexcept
{
switch (j.type())
{
case value_t::null:
return 'Z';
case value_t::boolean:
return j.m_data.m_value.boolean ? 'T' : 'F';
case value_t::number_integer:
{
if ((std::numeric_limits<std::int8_t>::min)() <= j.m_data.m_value.number_integer && j.m_data.m_value.number_integer <= (std::numeric_limits<std::int8_t>::max)())
{
return 'i';
}
if ((std::numeric_limits<std::uint8_t>::min)() <= j.m_data.m_value.number_integer && j.m_data.m_value.number_integer <= (std::numeric_limits<std::uint8_t>::max)())
{
return 'U';
}
if ((std::numeric_limits<std::int16_t>::min)() <= j.m_data.m_value.number_integer && j.m_data.m_value.number_integer <= (std::numeric_limits<std::int16_t>::max)())
{
return 'I';
}
if (use_bjdata && ((std::numeric_limits<std::uint16_t>::min)() <= j.m_data.m_value.number_integer && j.m_data.m_value.number_integer <= (std::numeric_limits<std::uint16_t>::max)()))
{
return 'u';
}
if ((std::numeric_limits<std::int32_t>::min)() <= j.m_data.m_value.number_integer && j.m_data.m_value.number_integer <= (std::numeric_limits<std::int32_t>::max)())
{
return 'l';
}
if (use_bjdata && ((std::numeric_limits<std::uint32_t>::min)() <= j.m_data.m_value.number_integer && j.m_data.m_value.number_integer <= (std::numeric_limits<std::uint32_t>::max)()))
{
return 'm';
}
if ((std::numeric_limits<std::int64_t>::min)() <= j.m_data.m_value.number_integer && j.m_data.m_value.number_integer <= (std::numeric_limits<std::int64_t>::max)())
{
return 'L';
}
// anything else is treated as high-precision number
return 'H'; // LCOV_EXCL_LINE
}
case value_t::number_unsigned:
{
if (j.m_data.m_value.number_unsigned <= static_cast<std::uint64_t>((std::numeric_limits<std::int8_t>::max)()))
{
return 'i';
}
if (j.m_data.m_value.number_unsigned <= static_cast<std::uint64_t>((std::numeric_limits<std::uint8_t>::max)()))
{
return 'U';
}
if (j.m_data.m_value.number_unsigned <= static_cast<std::uint64_t>((std::numeric_limits<std::int16_t>::max)()))
{
return 'I';
}
if (use_bjdata && j.m_data.m_value.number_unsigned <= static_cast<std::uint64_t>((std::numeric_limits<std::uint16_t>::max)()))
{
return 'u';
}
if (j.m_data.m_value.number_unsigned <= static_cast<std::uint64_t>((std::numeric_limits<std::int32_t>::max)()))
{
return 'l';
}
if (use_bjdata && j.m_data.m_value.number_unsigned <= static_cast<std::uint64_t>((std::numeric_limits<std::uint32_t>::max)()))
{
return 'm';
}
if (j.m_data.m_value.number_unsigned <= static_cast<std::uint64_t>((std::numeric_limits<std::int64_t>::max)()))
{
return 'L';
}
if (use_bjdata && j.m_data.m_value.number_unsigned <= (std::numeric_limits<std::uint64_t>::max)())
{
return 'M';
}
// anything else is treated as high-precision number
return 'H'; // LCOV_EXCL_LINE
}
case value_t::number_float:
return get_ubjson_float_prefix(j.m_data.m_value.number_float);
case value_t::string:
return 'S';
case value_t::array: // fallthrough
case value_t::binary:
return '[';
case value_t::object:
return '{';
case value_t::discarded:
default: // discarded values
return 'N';
}
}
static constexpr CharType get_ubjson_float_prefix(float /*unused*/)
{
return 'd'; // float 32
}
static constexpr CharType get_ubjson_float_prefix(double /*unused*/)
{
return 'D'; // float 64
}
/*!
@return false if the object is successfully converted to a bjdata ndarray, true if the type or size is invalid
*/
bool write_bjdata_ndarray(const typename BasicJsonType::object_t& value, const bool use_count, const bool use_type)
{
std::map<string_t, CharType> bjdtype = {{"uint8", 'U'}, {"int8", 'i'}, {"uint16", 'u'}, {"int16", 'I'},
{"uint32", 'm'}, {"int32", 'l'}, {"uint64", 'M'}, {"int64", 'L'}, {"single", 'd'}, {"double", 'D'}, {"char", 'C'}
};
string_t key = "_ArrayType_";
auto it = bjdtype.find(static_cast<string_t>(value.at(key)));
if (it == bjdtype.end())
{
return true;
}
CharType dtype = it->second;
key = "_ArraySize_";
std::size_t len = (value.at(key).empty() ? 0 : 1);
for (const auto& el : value.at(key))
{
len *= static_cast<std::size_t>(el.m_data.m_value.number_unsigned);
}
key = "_ArrayData_";
if (value.at(key).size() != len)
{
return true;
}
oa->write_character('[');
oa->write_character('$');
oa->write_character(dtype);
oa->write_character('#');
key = "_ArraySize_";
write_ubjson(value.at(key), use_count, use_type, true, true);
key = "_ArrayData_";
if (dtype == 'U' || dtype == 'C')
{
for (const auto& el : value.at(key))
{
write_number(static_cast<std::uint8_t>(el.m_data.m_value.number_unsigned), true);
}
}
else if (dtype == 'i')
{
for (const auto& el : value.at(key))
{
write_number(static_cast<std::int8_t>(el.m_data.m_value.number_integer), true);
}
}
else if (dtype == 'u')
{
for (const auto& el : value.at(key))
{
write_number(static_cast<std::uint16_t>(el.m_data.m_value.number_unsigned), true);
}
}
else if (dtype == 'I')
{
for (const auto& el : value.at(key))
{
write_number(static_cast<std::int16_t>(el.m_data.m_value.number_integer), true);
}
}
else if (dtype == 'm')
{
for (const auto& el : value.at(key))
{
write_number(static_cast<std::uint32_t>(el.m_data.m_value.number_unsigned), true);
}
}
else if (dtype == 'l')
{
for (const auto& el : value.at(key))
{
write_number(static_cast<std::int32_t>(el.m_data.m_value.number_integer), true);
}
}
else if (dtype == 'M')
{
for (const auto& el : value.at(key))
{
write_number(static_cast<std::uint64_t>(el.m_data.m_value.number_unsigned), true);
}
}
else if (dtype == 'L')
{
for (const auto& el : value.at(key))
{
write_number(static_cast<std::int64_t>(el.m_data.m_value.number_integer), true);
}
}
else if (dtype == 'd')
{
for (const auto& el : value.at(key))
{
write_number(static_cast<float>(el.m_data.m_value.number_float), true);
}
}
else if (dtype == 'D')
{
for (const auto& el : value.at(key))
{
write_number(static_cast<double>(el.m_data.m_value.number_float), true);
}
}
return false;
}
///////////////////////
// Utility functions //
///////////////////////
/*
@brief write a number to output input
@param[in] n number of type @a NumberType
@param[in] OutputIsLittleEndian Set to true if output data is
required to be little endian
@tparam NumberType the type of the number
@note This function needs to respect the system's endianness, because bytes
in CBOR, MessagePack, and UBJSON are stored in network order (big
endian) and therefore need reordering on little endian systems.
On the other hand, BSON and BJData use little endian and should reorder
on big endian systems.
*/
template<typename NumberType>
void write_number(const NumberType n, const bool OutputIsLittleEndian = false)
{
// step 1: write number to array of length NumberType
std::array<CharType, sizeof(NumberType)> vec{};
std::memcpy(vec.data(), &n, sizeof(NumberType));
// step 2: write array to output (with possible reordering)
if (is_little_endian != OutputIsLittleEndian)
{
// reverse byte order prior to conversion if necessary
std::reverse(vec.begin(), vec.end());
}
oa->write_characters(vec.data(), sizeof(NumberType));
}
void write_compact_float(const number_float_t n, detail::input_format_t format)
{
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
#endif
if (static_cast<double>(n) >= static_cast<double>(std::numeric_limits<float>::lowest()) &&
static_cast<double>(n) <= static_cast<double>((std::numeric_limits<float>::max)()) &&
static_cast<double>(static_cast<float>(n)) == static_cast<double>(n))
{
oa->write_character(format == detail::input_format_t::cbor
? get_cbor_float_prefix(static_cast<float>(n))
: get_msgpack_float_prefix(static_cast<float>(n)));
write_number(static_cast<float>(n));
}
else
{
oa->write_character(format == detail::input_format_t::cbor
? get_cbor_float_prefix(n)
: get_msgpack_float_prefix(n));
write_number(n);
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
}
public:
// The following to_char_type functions are implement the conversion
// between uint8_t and CharType. In case CharType is not unsigned,
// such a conversion is required to allow values greater than 128.
// See <path_to_url for a discussion.
template < typename C = CharType,
enable_if_t < std::is_signed<C>::value && std::is_signed<char>::value > * = nullptr >
static constexpr CharType to_char_type(std::uint8_t x) noexcept
{
return *reinterpret_cast<char*>(&x);
}
template < typename C = CharType,
enable_if_t < std::is_signed<C>::value && std::is_unsigned<char>::value > * = nullptr >
static CharType to_char_type(std::uint8_t x) noexcept
{
static_assert(sizeof(std::uint8_t) == sizeof(CharType), "size of CharType must be equal to std::uint8_t");
static_assert(std::is_trivial<CharType>::value, "CharType must be trivial");
CharType result;
std::memcpy(&result, &x, sizeof(x));
return result;
}
template<typename C = CharType,
enable_if_t<std::is_unsigned<C>::value>* = nullptr>
static constexpr CharType to_char_type(std::uint8_t x) noexcept
{
return x;
}
template < typename InputCharType, typename C = CharType,
enable_if_t <
std::is_signed<C>::value &&
std::is_signed<char>::value &&
std::is_same<char, typename std::remove_cv<InputCharType>::type>::value
> * = nullptr >
static constexpr CharType to_char_type(InputCharType x) noexcept
{
return x;
}
private:
/// whether we can assume little endianness
const bool is_little_endian = little_endianness();
/// the output
output_adapter_t<CharType> oa = nullptr;
};
} // namespace detail
NLOHMANN_JSON_NAMESPACE_END
```
|
Liu Liankun () (20 January 1933 – 15 August 1999), was a major general (shao jiang) in the People's Liberation Army who provided the Republic of China (ROC) in Taiwan with secret intelligence about the status of missiles from the People's Republic of China (PRC). During the Third Taiwan Strait Crisis in 1996, the ROC Ministry of National Defense notified the public that the missiles launched by the PRC actually carried unarmed warheads. This tipped off Beijing that Taipei had a high-level mole working on the mainland. Liu, a top Chinese military logistics officer, was arrested, court-martialed and executed in 1999.
The ROC's Military Intelligence Bureau confirmed that Liu was one of its spies in 2018.
See also
Tong Daning
References
1933 births
1999 deaths
20th-century executions by China
20th-century spies
Executed Chinese people
Executed military leaders
Executed people from Heilongjiang
Executed People's Republic of China people
Executed spies
Expelled members of the Chinese Communist Party
People executed by China by lethal injection
People from Qiqihar
People's Liberation Army generals from Heilongjiang
Post–Cold War spies
Taiwanese spies
|
The Ditrău mine is a large zirconium mine located in central Romania in Harghita County, close to Ditrău. Ditrău represents one of the largest zirconium reserves in Romania having estimated reserves of 100,000 tonnes of ore grading 2% zirconium metal.
References
Zirconium mines in Romania
|
```c++
//
// 2.15.variadic.template.param.cpp
// chapter 2 language usability
// modern cpp tutorial
//
// created by changkun at changkun.de
// path_to_url
//
#include <iostream>
#include <vector>
#include <string>
// sizeof...
template<typename... Ts>
void magic(Ts... args) {
std::cout << sizeof...(args) << std::endl;
}
// 1. recursive parameter unpack
template<typename T0>
void printf1(T0 value) {
std::cout << value << std::endl;
}
template<typename T, typename... Ts>
void printf1(T value, Ts... args) {
std::cout << value << std::endl;
printf1(args...);
}
// 2. variadic template parameter unfold
template<typename T0, typename... T>
void printf2(T0 t0, T... t) {
std::cout << t0 << std::endl;
if constexpr (sizeof...(t) > 0) printf2(t...);
}
// 3. parameter unpack using initializer_list
template<typename T, typename... Ts>
auto printf3(T value, Ts... args) {
std::cout << value << std::endl;
(void) std::initializer_list<T>{([&args] {
std::cout << args << std::endl;
}(), value)...};
}
int main() {
magic();
magic(1);
magic(1,"");
printf1(1, 2, "123", 1.1);
printf2(1, 2.3, "abc");
printf3(111, 123, "alpha", 1.2);
return 0;
}
```
|
Desarmeaux is a village in the Bonbon commune of the Jérémie Arrondissement, in the Grand'Anse department of Haiti.
References
Populated places in Grand'Anse (department)
|
```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 "SkGradientShader.h"
#include "SkPaint.h"
#include "SkPatchUtils.h"
#include "SkString.h"
/**
* This bench measures the rendering time of the call SkCanvas::drawPatch with different types of
* input patches (regular case, with loops, a square, with a big difference between "parallel"
* sides). This bench also tests the different combination of optional parameters for the function
* (passing texture coordinates and colors, only textures coordinates, only colors or none).
* Finally, it applies a scale to test if the size affects the rendering time.
*/
class PatchBench : public Benchmark {
public:
enum VertexMode {
kNone_VertexMode,
kColors_VertexMode,
kTexCoords_VertexMode,
kBoth_VertexMode
};
PatchBench(SkPoint scale, VertexMode vertexMode)
: fScale(scale)
, fVertexMode(vertexMode) { }
// to add name of specific class override this method
virtual void appendName(SkString* name) {
name->append("normal");
}
// to make other type of patches override this method
virtual void setCubics() {
const SkPoint points[SkPatchUtils::kNumCtrlPts] = {
//top points
{100,100},{150,50},{250,150}, {300,100},
//right points
{350, 150},{250,200},
//bottom points
{300,300},{250,250},{150,350},{100,300},
//left points
{50,250},{150,50}
};
memcpy(fCubics, points, SkPatchUtils::kNumCtrlPts * sizeof(SkPoint));
}
virtual void setColors() {
const SkColor colors[SkPatchUtils::kNumCorners] = {
SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorCYAN
};
memcpy(fColors, colors, SkPatchUtils::kNumCorners * sizeof(SkColor));
}
virtual void setTexCoords() {
const SkPoint texCoords[SkPatchUtils::kNumCorners] = {
{0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f,1.0f}, {0.0f, 1.0f}
};
memcpy(fTexCoords, texCoords, SkPatchUtils::kNumCorners * sizeof(SkPoint));
}
// override this method to change the shader
virtual SkShader* createShader() {
const SkColor colors[] = {
SK_ColorRED, SK_ColorCYAN, SK_ColorGREEN, SK_ColorWHITE,
SK_ColorMAGENTA, SK_ColorBLUE, SK_ColorYELLOW,
};
const SkPoint pts[] = { { 200.f / 4.f, 0.f }, { 3.f * 200.f / 4, 200.f } };
return SkGradientShader::CreateLinear(pts, colors, NULL,
SK_ARRAY_COUNT(colors),
SkShader::kMirror_TileMode);
}
protected:
const char* onGetName() override {
SkString vertexMode;
switch (fVertexMode) {
case kNone_VertexMode:
vertexMode.set("meshlines");
break;
case kColors_VertexMode:
vertexMode.set("colors");
break;
case kTexCoords_VertexMode:
vertexMode.set("texs");
break;
case kBoth_VertexMode:
vertexMode.set("colors_texs");
break;
default:
break;
}
SkString type;
this->appendName(&type);
fName.printf("patch_%s_%s_[%f,%f]", type.c_str(), vertexMode.c_str(),
fScale.x(), fScale.y());
return fName.c_str();
}
void onPreDraw() override {
this->setCubics();
this->setColors();
this->setTexCoords();
this->setupPaint(&fPaint);
switch (fVertexMode) {
case kTexCoords_VertexMode:
case kBoth_VertexMode:
fPaint.setShader(this->createShader())->unref();
break;
default:
fPaint.setShader(NULL);
break;
}
}
void onDraw(const int loops, SkCanvas* canvas) override {
canvas->scale(fScale.x(), fScale.y());
for (int i = 0; i < loops; i++) {
switch (fVertexMode) {
case kNone_VertexMode:
canvas->drawPatch(fCubics, NULL, NULL, NULL, fPaint);
break;
case kColors_VertexMode:
canvas->drawPatch(fCubics, fColors, NULL, NULL, fPaint);
break;
case kTexCoords_VertexMode:
canvas->drawPatch(fCubics, NULL, fTexCoords, NULL, fPaint);
break;
case kBoth_VertexMode:
canvas->drawPatch(fCubics, fColors, fTexCoords, NULL, fPaint);
break;
default:
break;
}
}
}
SkPaint fPaint;
SkString fName;
SkVector fScale;
SkPoint fCubics[12];
SkPoint fTexCoords[4];
SkColor fColors[4];
VertexMode fVertexMode;
typedef Benchmark INHERITED;
};
class SquarePatchBench : public PatchBench {
public:
SquarePatchBench(SkPoint scale, VertexMode vertexMode)
: INHERITED(scale, vertexMode) { }
void appendName(SkString* name) override {
name->append("square");
}
void setCubics() override {
const SkPoint points[SkPatchUtils::kNumCtrlPts] = {
//top points
{100,100},{150,100},{250,100}, {300,100},
//right points
{300, 150},{300,250},
//bottom points
{300,300},{250,300},{150,300},{100,300},
//left points
{100,250},{100,150}
};
memcpy(fCubics, points, SkPatchUtils::kNumCtrlPts * sizeof(SkPoint));
}
private:
typedef PatchBench INHERITED;
};
class LODDiffPatchBench : public PatchBench {
public:
LODDiffPatchBench(SkPoint scale, VertexMode vertexMode)
: INHERITED(scale, vertexMode) { }
void appendName(SkString* name) override {
name->append("LOD_Diff");
}
void setCubics() override {
const SkPoint points[SkPatchUtils::kNumCtrlPts] = {
//top points
{100,175},{150,100},{250,100}, {300,0},
//right points
{300, 150},{300,250},
//bottom points
{300,400},{250,300},{150,300},{100,225},
//left points
{100,215},{100,185}
};
memcpy(fCubics, points, SkPatchUtils::kNumCtrlPts * sizeof(SkPoint));
}
private:
typedef PatchBench INHERITED;
};
class LoopPatchBench : public PatchBench {
public:
LoopPatchBench(SkPoint scale, VertexMode vertexMode)
: INHERITED(scale, vertexMode) { }
void appendName(SkString* name) override {
name->append("loop");
}
void setCubics() override {
const SkPoint points[SkPatchUtils::kNumCtrlPts] = {
//top points
{100,100},{300,200},{100,200}, {300,100},
//right points
{380, 400},{380,0},
//bottom points
{300,300},{250,250},{30,200},{100,300},
//left points
{140,325},{150,150}
};
memcpy(fCubics, points, SkPatchUtils::kNumCtrlPts * sizeof(SkPoint));
}
private:
typedef PatchBench INHERITED;
};
///////////////////////////////////////////////////////////////////////////////
DEF_BENCH( return new PatchBench(SkVector::Make(0.1f, 0.1f), PatchBench::kNone_VertexMode); )
DEF_BENCH( return new PatchBench(SkVector::Make(0.1f, 0.1f), PatchBench::kColors_VertexMode); )
DEF_BENCH( return new PatchBench(SkVector::Make(0.1f, 0.1f), PatchBench::kTexCoords_VertexMode); )
DEF_BENCH( return new PatchBench(SkVector::Make(0.1f, 0.1f), PatchBench::kBoth_VertexMode); )
DEF_BENCH( return new PatchBench(SkVector::Make(1.f, 1.0f), PatchBench::kNone_VertexMode); )
DEF_BENCH( return new PatchBench(SkVector::Make(1.0f, 1.0f), PatchBench::kColors_VertexMode); )
DEF_BENCH( return new PatchBench(SkVector::Make(1.0f, 1.0f), PatchBench::kTexCoords_VertexMode); )
DEF_BENCH( return new PatchBench(SkVector::Make(1.0f, 1.0f), PatchBench::kBoth_VertexMode); )
DEF_BENCH( return new PatchBench(SkVector::Make(3.0f, 3.0f), PatchBench::kNone_VertexMode); )
DEF_BENCH( return new PatchBench(SkVector::Make(3.0f, 3.0f), PatchBench::kColors_VertexMode); )
DEF_BENCH( return new PatchBench(SkVector::Make(3.0f, 3.0f), PatchBench::kTexCoords_VertexMode); )
DEF_BENCH( return new PatchBench(SkVector::Make(3.0f, 3.0f), PatchBench::kBoth_VertexMode); )
DEF_BENCH( return new SquarePatchBench(SkVector::Make(0.1f, 0.1f),
PatchBench::kNone_VertexMode); )
DEF_BENCH( return new SquarePatchBench(SkVector::Make(0.1f, 0.1f),
PatchBench::kColors_VertexMode); )
DEF_BENCH( return new SquarePatchBench(SkVector::Make(0.1f, 0.1f),
PatchBench::kTexCoords_VertexMode); )
DEF_BENCH( return new SquarePatchBench(SkVector::Make(0.1f, 0.1f),
PatchBench::kBoth_VertexMode); )
DEF_BENCH( return new SquarePatchBench(SkVector::Make(1.f, 1.0f),
PatchBench::kNone_VertexMode); )
DEF_BENCH( return new SquarePatchBench(SkVector::Make(1.0f, 1.0f),
PatchBench::kColors_VertexMode); )
DEF_BENCH( return new SquarePatchBench(SkVector::Make(1.0f, 1.0f),
PatchBench::kTexCoords_VertexMode); )
DEF_BENCH( return new SquarePatchBench(SkVector::Make(1.0f, 1.0f),
PatchBench::kBoth_VertexMode); )
DEF_BENCH( return new SquarePatchBench(SkVector::Make(3.0f, 3.0f),
PatchBench::kNone_VertexMode); )
DEF_BENCH( return new SquarePatchBench(SkVector::Make(3.0f, 3.0f),
PatchBench::kColors_VertexMode); )
DEF_BENCH( return new SquarePatchBench(SkVector::Make(3.0f, 3.0f),
PatchBench::kTexCoords_VertexMode); )
DEF_BENCH( return new SquarePatchBench(SkVector::Make(3.0f, 3.0f),
PatchBench::kBoth_VertexMode); )
DEF_BENCH( return new LODDiffPatchBench(SkVector::Make(0.1f, 0.1f),
PatchBench::kNone_VertexMode); )
DEF_BENCH( return new LODDiffPatchBench(SkVector::Make(0.1f, 0.1f),
PatchBench::kColors_VertexMode); )
DEF_BENCH( return new LODDiffPatchBench(SkVector::Make(0.1f, 0.1f),
PatchBench::kTexCoords_VertexMode); )
DEF_BENCH( return new LODDiffPatchBench(SkVector::Make(0.1f, 0.1f),
PatchBench::kBoth_VertexMode); )
DEF_BENCH( return new LODDiffPatchBench(SkVector::Make(1.f, 1.0f),
PatchBench::kNone_VertexMode); )
DEF_BENCH( return new LODDiffPatchBench(SkVector::Make(1.0f, 1.0f),
PatchBench::kColors_VertexMode); )
DEF_BENCH( return new LODDiffPatchBench(SkVector::Make(1.0f, 1.0f),
PatchBench::kTexCoords_VertexMode); )
DEF_BENCH( return new LODDiffPatchBench(SkVector::Make(1.0f, 1.0f),
PatchBench::kBoth_VertexMode); )
DEF_BENCH( return new LODDiffPatchBench(SkVector::Make(3.0f, 3.0f),
PatchBench::kNone_VertexMode); )
DEF_BENCH( return new LODDiffPatchBench(SkVector::Make(3.0f, 3.0f),
PatchBench::kColors_VertexMode); )
DEF_BENCH( return new LODDiffPatchBench(SkVector::Make(3.0f, 3.0f),
PatchBench::kTexCoords_VertexMode); )
DEF_BENCH( return new LODDiffPatchBench(SkVector::Make(3.0f, 3.0f),
PatchBench::kBoth_VertexMode); )
DEF_BENCH( return new LoopPatchBench(SkVector::Make(0.1f, 0.1f),
PatchBench::kNone_VertexMode); )
DEF_BENCH( return new LoopPatchBench(SkVector::Make(0.1f, 0.1f),
PatchBench::kColors_VertexMode); )
DEF_BENCH( return new LoopPatchBench(SkVector::Make(0.1f, 0.1f),
PatchBench::kTexCoords_VertexMode); )
DEF_BENCH( return new LoopPatchBench(SkVector::Make(0.1f, 0.1f),
PatchBench::kBoth_VertexMode); )
DEF_BENCH( return new LoopPatchBench(SkVector::Make(1.f, 1.0f),
PatchBench::kNone_VertexMode); )
DEF_BENCH( return new LoopPatchBench(SkVector::Make(1.0f, 1.0f),
PatchBench::kColors_VertexMode); )
DEF_BENCH( return new LoopPatchBench(SkVector::Make(1.0f, 1.0f),
PatchBench::kTexCoords_VertexMode); )
DEF_BENCH( return new LoopPatchBench(SkVector::Make(1.0f, 1.0f),
PatchBench::kBoth_VertexMode); )
DEF_BENCH( return new LoopPatchBench(SkVector::Make(3.0f, 3.0f),
PatchBench::kNone_VertexMode); )
DEF_BENCH( return new LoopPatchBench(SkVector::Make(3.0f, 3.0f),
PatchBench::kColors_VertexMode); )
DEF_BENCH( return new LoopPatchBench(SkVector::Make(3.0f, 3.0f),
PatchBench::kTexCoords_VertexMode); )
DEF_BENCH( return new LoopPatchBench(SkVector::Make(3.0f, 3.0f),
PatchBench::kBoth_VertexMode); )
```
|
The 2009 Meteor Music Awards ceremony took place on 17 March 2009 in the RDS Simmonscourt, Dublin. It was the ninth edition of Ireland's national music awards. The event was recorded and it aired on RTÉ Two on 18 March 2009. The awards show was hosted by television presenter Amanda Byram.
The general public were eligible to vote in eight categories - Best Irish Band, Best Irish Male, Best Irish Female, Best Irish Pop Act, Best Irish Album, Best Irish Live Performance, Best National DJ and Best Regional DJ. AC/DC, Coldplay, Elbow, The Killers and Kings of Leon were nominated for Best International Band, whilst Boyzone, The Blizzards, The Coronas, The Script and Westlife were the nominees for Best Irish Pop Act. Mick Flannery, Damien Dempsey, Duke Special, David Holmes and Richard Egan of Jape were nominated in the Best Irish Male category, whilst Enya, Lisa Hannigan, Gemma Hayes, Imelda May, Tara Blaise and Camille O'Sullivan were nominated in the Best Irish Female category. The Hope for 2009 nominees were announced on 18 February, with public voting commencing on 23 February. Hot Press editor Niall Stokes received an industry award, whilst Father Shay Cullen's PREDA Foundation received €100,000. The Lifetime Achievement Award was given to traditional folk musician Sharon Shannon.
Performances
Boyzone, The Blizzards, Sharon Shannon, Stereophonics and Imelda May performed on the night.
Nominations
The nominees were officially announced on 28 January 2009, having initially been published on the official site the night before only to be quickly removed. And the winners are...
Public Voting Categories
Best National DJ
Alison Curtis – Today FM
Dave Fanning – RTÉ 2fm
Tony Fenton – Today FM
Ray Foley – Today FM
Dan Hegarty – RTÉ 2fm
Rick O'Shea – RTÉ 2fm
Presented by Lorraine Keane
Best Regional DJ
Keith Cunningham (KC) - RedFM
Dermot, Dave & Siobhan – Dublin's 98
Leigh Doyle – Beat 102-103
Mark Noble – FM 104
Jon Richards – Galway Bay FM
The Zoo Crew – Spin South West
Presented by Lucy Kennedy and Nancy Cartwright
Best Irish Band
The Blizzards
Fight Like Apes
Republic of Loose
The Script
Snow Patrol
Presented by Sonya Lennon and Brendan Courtney
Best Irish Male
Damien Dempsey
Duke Special
Mick Flannery
David Holmes
Jape
Best Irish Female
Tara Blaise
Lisa Hannigan
Gemma Hayes
Imelda May
Camille O'Sullivan
Best Irish Pop Act
Boyzone
The Blizzards
The Coronas
The Script
Westlife
Presented by Pádraig Harrington
Best Irish Album
Fight Like Apes – Fight Like Apes and the Mystery of the Golden Medallion
Lisa Hannigan – Sea Sew
Messiah J & The Expert – From the Word Go
The Script – The Script
Snow Patrol – A Hundred Million Suns
Presented by Tony Lundon, Liam McCormack and Sinéad McKenna
Best Irish Live Performance
The Blizzards - Oxegen 2008
The Coronas - The Button Factory
Fight Like Apes - Whelan's
Republic of Loose - The Academy
The Swell Season - Olympia Theatre
Presented by Craig Doyle and Devon Murray
Non-Public Voting Categories
Best Traditional/Folk
Damien Dempsey
Martin Hayes & Dennis Cahill
Colm Mac Con Iomaire
Eleanor McEvoy
John Spillane
Presented by Bláthnaid Ní Chofaigh and Anna Nolan
Best International Live Performance
The Script
Coldplay
Kings of Leon
Bruce Springsteen
The Killers
Best International Band
AC/DC
Coldplay
Elbow
The Killers
Kings of Leon
Presented by Caprice and Laura Whitmore
Elbow won the award in 2009.
Best International Female
Beyoncé
Duffy
Lykke Li
Pink
Rihanna
Best International Male
Chris Brown
Nick Cave
Bon Iver
James Morrison
Kanye West
Presented by Louis Walsh
Best International Album
Day & Age - The Killers
Fleet Foxes - Fleet Foxes
Only by the Night - Kings of Leon
The Circus - Take That
Viva la Vida or Death and All His Friends - Coldplay
Lifetime Achievement Award
Sharon Shannon
Presented by Gráinne and Síle Seoige
Humanitarian Award
Father Shay Cullen's PREDA Foundation
Presented by Pat Kenny and Conor Carmody from Meteor
Industry Award
Niall Stokes
Presented by Dave Fanning and Joe Elliott
Hope for 2009
Autumn Owls
Fred
House of Cosy Cushions
James Vincent McMorrow
Wallis Bird
Presented by Rick O'Shea
Most Downloaded Song
"Galway Girl" – Mundy and Sharon Shannon
Multiple nominations
Lisa Hannigan was the only solo artist to be nominated in more than one category. She was nominated in two categories, Best Irish Female and Best Irish Album. She won neither.
3 - The Blizzards
3 - Coldplay
3 - Fight Like Apes
3 - The Killers
3 - Kings of Leon
3 - The Script
2 - The Coronas
2 - Lisa Hannigan
2 - Republic of Loose
2 - Snow Patrol
References
External links
Official site
MCD Promotions
List of winners through the years
2009 photos at Hot Press
Meteor Music Awards
Meteor Awards
Meteor Awards
|
```yaml
gl:
activerecord:
models:
decidim/pages/page:
one: Pxina
other: Pxinas
decidim:
admin_log:
page:
update: "%{user_name} actualizou a pxina %{resource_name} en %{space_name}"
components:
pages:
name: Pxina
settings:
global:
announcement: Anuncio
step:
announcement: Anuncio
pages:
admin:
models:
components:
body: Corpo
pages:
edit:
save: Actualizacin
title: Editar pxina
update:
invalid: Produciuse un erro ao gardar a pxina.
success: A pxina gardouse correctamente.
```
|
Robert Forbes (1708–1775) was a Scottish Non-juring Anglican bishop. He served as the bishop of Ross and Caithness for the Scottish Episcopal Church.
Life
Forbes was born in 1708 at Rayne in Aberdeenshire, where his father was schoolmaster. He was educated at Marischal College, Aberdeen (A.M. 1726). In 1735 he went to Edinburgh, was ordained priest by Bishop David Freebairn, and was shortly appointed minister of the episcopal congregation at Leith, a town which was his home for the rest of his life. In his room there, in 1740, John Skinner received baptism at his hands.
On 7 September 1745, when Charles Edward Stuart was on his descent from the Highlands, Forbes was one of three episcopal clergymen who were arrested at St. Ninians, near Stirling, suspected of intending to join the rebels, confined in Stirling Castle till 4 February 1746, and in Edinburgh Castle until 29 May.
In 1762 the episcopal clergy of Ross and Caithness elected him their bishop, and he was consecrated at Forfar on 24 June by the Primus of the Scottish Episcopal Church, William Falconer, with Bishops Andrew Gerard and Alexander. He continued to live at Leith, but made two visitations of his northern flock in 1762 and 1770. In 1764 he had a new church built for him, where he gathered a good congregation; but he would not ‘qualify’ according to law, and he was soon reported to government. Soldiers were sent to his meeting to see whether he prayed for King George III, and he was summoned before the colonel-commanding (Dalrymple). An account of the interview that ensued is preserved in his third ‘Journal.’ He made no submission, but thought it better to have his services without singing; and, receiving advice from a friend, he went for some weeks to London. There he worshipped with the remnant of the nonjurors, and received from their bishop Robert Gordon a staff that had once belonged to George Hickes. In 1769 he was at a meeting of Jacobites at Moffat, when proposals were discussed for the continuance of the Stuart line and the Stuart pretensions by marrying Charles Edward to a Protestant.
On the death of Gerard, Forbes was elected bishop of Aberdeen and Orkney in 1765, but difficulties arose and he declined the appointment.
Forbes died at Leith 18 November 1775, and was buried in the Maltman's aisle of South Leith parish church.
Works
Forbes began about 1760 to write in the Edinburgh Magazine, his articles being chiefly topographical and antiquarian. He took part in updating the communion office of the Scottish Episcopal Church, the editions of 1763, 1764, and 1765 being printed under his supervision. The Journals of his episcopal visitations were edited in 1886 by James Brown Craven.
In the bishop's own lifetime appeared An Essay on Christian Burial, and the Respect due to Burying-Grounds, by a ‘Ruling Elder of the Church of Scotland’ (1765), and an Account of the Chapel of Roslin (1774).
His major work is the ‘Lyon in Mourning,’ ten octavo volumes in manuscript, bound in black, and filled with collections relative to the Jacobite Rising of 1745 with which are bound up a number of relics of the same expedition. Among those interviewed in detail for the project was the Scottish Gaelic poet and Jacobite propagandist Alasdair MacMhaighstir Alasdair.
The volumes date from 1747 to 1775; extracts from them were published (1834) under the title of Jacobite Memoirs, by Robert Chambers, from the originals in the Advocates' Library, Edinburgh. An edition appeared in 1895: The Lyon in Mourning, edited by Henry Paton, Scottish History Society, Edinburgh.
Family
Forbes was twice married. His first wife was Agnes Gairey, whom he married in 1749 and who died the following year. His second wife was Rachel Houston, daughter of Ludovick Houston of Johnstone; she was as enthusiastic a Jacobite as her husband, and frequent mention is made of her in The Lyon in Mourning. The bishop permitted favoured guests to drink out of Prince Charlie's brogues; Rachel sent to the ‘royal exile’ the seed-cake which Oliphant of Gask presented to him.
References
External links
Scottish History in Print: "The Lyon in Mourning", By Bishop Robert Forbes.
1708 births
1775 deaths
Alumni of the University of Aberdeen
Clergy from Aberdeenshire
18th-century Scottish Episcopalian bishops
Protestant Jacobites
Scottish Jacobites
Jacobite propagandists
Bishops of Moray, Ross and Caithness
|
The Gölbaşı Ground Station () is a ground station designed as a terminal for telecommunication with Türksat spacecraft. Owned and operated by the state-owned telecommunications provider Türksat company, it is situated in Gölbaşı district of Ankara Province in Turkey.
The earth station was established in 1994 for servicing Turkey's first communications satellite Türksat 1B launched on August 11 that year. For the location of its backup facility, the campus of Middle East Technical University (ODTÜ) was chosen, about away.
The ground station consists of equipment such as and parabolic antennas of high reliance, electronic devices, data processing system and uninterrupted power supply unit for telecommunication with the Türksat 1C, 2A 3A satellites currently in orbit. The backup station has a antenna available.
The facility features, in full backup, a satellite control center, an observation and control center, a communications observation center and a data encryption center. Further, a satellite simulator provides training for the operators, which is also used for approval purposes of procedures to be applied on the spacecraft.
Since the ground station in Gölbaşı is capable of servicing three satellites at a time only, it is projected to expand its capacity with regard of the launch of Türksat 4A satellite in 2014. The construction of a backup ground station in Konya is planned.
Earthquake risk
On December 20, 2007, an earthquake of 5.7 magnitude occurred in Balâ, Ankara, about far from Gölbaşı Ground Station. Although the ground station was not affected by the earthquake, the incident showed the possible risk of telecommunication blackout and loss of satellites in orbit in case of an earthquake. Due to proximity of the backup facility to the ground station, the earthquake risk is much high. It is required that the backup facility's location should be at least away.
A report states that when the link between the spacecraft and the earth station is interrupted for a period of 48 hours, the re-establishment of the link is unlikely.
References
Earth stations in Turkey
1994 establishments in Turkey
Buildings and structures completed in 1994
Buildings and structures in Ankara Province
Satellite Control Ground Center
|
Pimelea ammocharis is a species of small shrub in the family Thymelaeaceae. It is a small shrub with white-yellow to orange flowers and is endemic to Western Australia.
Description
Pimelea ammocharis is a small, upright shrub high with new growth stems densely hairy. The leaves are arranged alternately, with a short leaf stalk, narrowly elliptic to egg-shaped or linear, long, wide and light silvery green throughout. The inflorescence may be either pendulous or upright, usually in a tight head of numerous tubular white to deep yellow to orange flowers long. The flowers are smooth on the inside and thickly hairy on the outside and the sepals long. The male flowers are mostly evenly hairy or hairs slightly longer near the base. The female or bisexual flowers remain or sporadically tear above the fruit, they are covered with hairs long near the base, considerably shorter at the apex. Flowering occurs from March to October.
Taxonomy and naming
Pimelea ammocharis was first formally described in 1857 by Ferdinand von Mueller and the description was published in Hooker's Journal of Botany and Kew Garden Miscellany. The specific epithet (ammocharis) is derived from ammos meaning "sand" and charis meaning "grace".
Distribution and habitat
This species occurs from the southern part of the Kimberley to the Kennedy-Blackstone Range and east to central Northern Territory usually along watercourses or red sandy soil and rocky outcrops in dryer regions.
References
ammocharis
Malvales of Australia
Taxa named by Ferdinand von Mueller
Plants described in 1857
|
```javascript
/**
* @license Apache-2.0
*
*
*
* 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.
*/
/* This is a generated file. Do not edit directly. */
'use strict';
// MAIN //
/**
* Evaluates a polynomial.
*
* ## Notes
*
* - The implementation uses [Horner's rule][horners-method] for efficient computation.
*
* [horners-method]: path_to_url
*
* @private
* @param {number} x - value at which to evaluate the polynomial
* @returns {number} evaluated polynomial
*/
function evalpoly( x ) {
if ( x === 0.0 ) {
return 0.6666666666666735;
}
return 0.6666666666666735 + (x * (0.2857142874366239 + (x * (0.1818357216161805 + (x * 0.14798198605116586))))); // eslint-disable-line max-len
}
// EXPORTS //
module.exports = evalpoly;
```
|
Francis Glebas (born April 12, 1952) is an American keynote speaker, writer, film director, storyboard artist, and teacher. He worked in films such as Aladdin, The Lion King, Pocahontas, The Hunchback of Notre Dame, Dinosaur, Hercules, Treasure Planet, Fantasia 2000, Piglet's Big Movie, Space Chimps, Rio and Ice Age: Continental Drift.
He has taught and consulted on animation, story, storytelling and storyboarding at the New York Institute of Technology, University of California, Los Angeles, Gnomon School of Visual Effects and Walt Disney Imagineering.
He has given Keynote speeches at TMRE 2016, CalArts 2016, Gnomon School of Visual Effects 2017.
Publications
Directing the Story: Professional Storyboarding and Storytelling Techniques for Live Action and Animation, Focal Press, 2008.
The Animator's Eye, Focal Press, 2012.
Iggy's Incredibly Easy Way to Write a Story, 2012
References
External links
Francis Glebas
Francis Glebas story artist
Francis Glebas on Blogspot
1952 births
American male writers
Animators from California
American male screenwriters
American film directors
American film producers
American animated film directors
American animated film producers
Animation screenwriters
Place of birth missing (living people)
American storyboard artists
Living people
Walt Disney Animation Studios people
New York Institute of Technology faculty
University of California, Los Angeles faculty
|
Mawuse Dake was a Ghanaian politician and academic.
Politics
Dake was the running mate for the presidential bid of Ibrahim Mahama for the Social Democratic Front in the 1979 Ghanaian general election. They won 3.72% of the vote, coming fifth.
He left for Kenya where he worked as a consultant for some years.
Following the coup d'état on 31 December 1981, Dake was appointed Secretary for Works and Housing in the Provisional National Defence Council military government led by Jerry Rawlings. In 1983, he was made the Secretary to the National Defence Committee.
In 1992, when the ban on party politics was lifted, he became one of the founding members of the People's Heritage Party (PHP) whose leader was Emmanuel Erskine. He is reported to have been influential in the merger between the PHP and the National Independence Party (NIP) led by Kwabena Darko to form the People's Convention Party (PCP). He is reported to have been against the alliance formed between the New Patriotic Party and the PCP called the Great Alliance to fight the 1996 Ghanaian general election. He is also reported to have been influential in the PCP and the National Convention Party (NCP) merging to reform the Convention People's Party.
Sports
Dake was keen on football and was Chairman of Voradep Football Club as well as a Director of Accra Great Olympics F.C.
Publications
References
Year of birth missing
2000 deaths
Ewe people
Convention People's Party (Ghana) politicians
Social Democratic Front (Ghana) politicians
|
```java
package lee;
import java.util.ArrayList;
import java.util.Random;
/**
* java -server -Xms10G -Xmx10G -XX:+PrintGCDetails
* -XX:+UseConcMarkSweepGC -XX:CompileThreshold=1000 lee/StringTest
* taskset -c 0-[0,1,3,7] java ...
* @author CarpenterLee
*/
public class StringTest {
public static void main(String[] args) {
new StringTest().doTest();
}
public void doTest(){
warmUp();
int[] lengths = {
10000,
100000,
1000000,
10000000,
20000000,
40000000
};
for(int length : lengths){
System.out.println(String.format("---List length: %d---", length));
ArrayList<String> list = randomStringList(length);
int times = 4;
String min1 = "1";
String min2 = "2";
String min3 = "3";
long startTime;
startTime = System.nanoTime();
for(int i=0; i<times; i++){
min1 = minStringForLoop(list);
}
TimeUtil.outTimeUs(startTime, "minStringForLoop time:", times);
startTime = System.nanoTime();
for(int i=0; i<times; i++){
min2 = minStringStream(list);
}
TimeUtil.outTimeUs(startTime, "minStringStream time:", times);
startTime = System.nanoTime();
for(int i=0; i<times; i++){
min3 = minStringParallelStream(list);
}
TimeUtil.outTimeUs(startTime, "minStringParallelStream time:", times);
System.out.println(min1.equals(min2) && min2.equals(min3));
// System.out.println(min1);
}
}
private void warmUp(){
ArrayList<String> list = randomStringList(10);
for(int i=0; i<20000; i++){
minStringForLoop(list);
minStringStream(list);
minStringParallelStream(list);
}
}
private String minStringForLoop(ArrayList<String> list){
String minStr = null;
boolean first = true;
for(String str : list){
if(first){
first = false;
minStr = str;
}
if(minStr.compareTo(str)>0){
minStr = str;
}
}
return minStr;
}
private String minStringStream(ArrayList<String> list){
return list.stream().min(String::compareTo).get();
}
private String minStringParallelStream(ArrayList<String> list){
return list.stream().parallel().min(String::compareTo).get();
}
private ArrayList<String> randomStringList(int listLength){
ArrayList<String> list = new ArrayList<>(listLength);
Random rand = new Random();
int strLength = 10;
StringBuilder buf = new StringBuilder(strLength);
for(int i=0; i<listLength; i++){
buf.delete(0, buf.length());
for(int j=0; j<strLength; j++){
buf.append((char)('a'+rand.nextInt(26)));
}
list.add(buf.toString());
}
return list;
}
}
```
|
Bhadauria also referred as Bhadoria, Bhadouria, Bhadauriya, Bhadoriya or Bhaduria are a Kshatriya Rajput clan belonging to the Chauhans of Shakambhari and Ajmer. They were historically mainly concentrated in the ethno-linguistic and geographical regions of the modern day Braj and the Chambal river valley, in what are now the districts of Agra, Etawah, Bhind and Dholpur, in the states of Uttar Pradesh, Madhya Pradesh, and Rajasthan.
The chief of the clan was the ruler of the Bhadawar Estate in the region of Bhind in Madhya Pradesh before the Partition of India in 1947. The rulers of Bhadawar commissioned the construction of the Ater Fort, situated near Bhind, which later also served as their ruling seat. The majority of the Bhadaurias today are present in the states of Madhya Pradesh, Rajasthan, Uttar Pradesh and Delhi.
During the decline of the Mughal Empire, Raja Kalyan Singh Bhadauria obtained possession of the Princely state of Dholpur in the state of Rajasthan. Thus the boundaries of the estate extended up to Gwalior in the South, Dholpur in the West, Mathura, Agra and Etawah in the North and parts of Kanpur in the East.
References
2. https://forebears.io/surnames/bhadoria
Rajput clans of Uttar Pradesh
Rajput clans of Madhya Pradesh
Rajput clans of Rajasthan
|
The patellar reflex, also called the knee reflex or knee-jerk, is a stretch reflex which tests the L2, L3, and L4 segments of the spinal cord. Many animals, most significantly humans, have been seen to have the patellar reflex, including dogs, cats, horses, and other mammalian species.
Mechanism
Striking of the patellar tendon with a reflex hammer just below the patella stretches the muscle spindle in the quadriceps muscle. This produces a signal which travels back to the spinal cord and synapses (without interneurons) at the level of L3 or L4 in the spinal cord, completely independent of higher centres. From there, an alpha motor neuron conducts an efferent impulse back to the quadriceps femoris muscle, triggering contraction. This contraction, coordinated with the relaxation of the antagonistic flexor hamstring muscle causes the leg to kick. There is a latency of around 18 ms between stretch of the patellar tendon and the beginning of contraction of the quadriceps femoris muscle. This is a reflex of proprioception which helps maintain posture and balance, allowing to keep one's balance with little effort or conscious thought.
The patellar reflex is a clinical and classic example of the monosynaptic reflex arc. There is no interneuron in the pathway leading to contraction of the quadriceps muscle. Instead, the sensory neuron synapses directly on a motor neuron in the spinal cord. However, there is an inhibitory interneuron used to relax the antagonistic hamstring muscle (reciprocal innervation).
This test of a basic automatic reflex may be influenced by the patient consciously inhibiting or exaggerating the response; the doctor may use the Jendrassik maneuver in order to ensure a more valid reflex test.
Clinical significance
After the tap of a hammer, the leg is normally extended once and comes to rest. The absence or decrease of this reflex is problematic, and known as Westphal's sign. This reflex may be diminished or absent in lower motor neuron lesions and during sleep. On the other hand, multiple oscillation of the leg (pendular reflex) following the tap may be a sign of cerebellar diseases. Exaggerated (brisk) deep tendon reflexes such as this can be found in upper motor neuron lesions, hyperthyroidism, anxiety or nervousness. The test itself assesses the nervous tissue between and including the L2 and L4 segments of the spinal cord.
The patellar reflex is often tested in infants to test the nervous system.
History
Wilhelm Heinrich Erb (1840–1921) and Carl Friedrich Westphal (1833–1890) simultaneously reported the patellar tendon or knee reflex in 1875. The term knee-jerk was recorded by Sir Michael Foster in his Textbook of physiology in 1877: "Striking the tendon below the patella gives rise to a sudden extension of the leg, known as the knee-jerk."
In popular culture
The term began to be used figuratively from the early 20th century onwards. O. O. McIntyre, in his New York Day-By-Day column in The Coshocton Tribune, October 1921, wrote: "Itinerant preacher stemming Broadway on a soap box. And gets only an occasional knee-jerk."
See also
References
Sources
Examination of the knee
Reflexes
|
Aldersbrook Manor or the Manor of Aldersbrook was a feudal manor in the parish of Little Ilford, now part of the London Borough of Newham. It was named after the Alders Brook which flowed through it and the manor's lands mostly now mostly fall within the City of London Cemetery and Crematorium, with its manor house about halfway between the Cemetery's catacombs and its eastern boundary fence. It was known as Aldersbrook House and also had an associated farmhouse about 0.3 km to its west.
The lands it covers originally formed part of the manor of Wanstead. It seems to have originated as the tenement of Naget (later Naked) hall, recorded as held from Barking Abbey by John Huntercombe and his wife Margaret at his death in 1383 along with Wanstead and the tenement of Sayes. Naget Hall seems to have descended with Wanstead until around 1512, when it was made a separate manor called Aldersbrook Manor, at around the same time as Wanstead was enclosed - the two manors remained closely linked, with boundary disputes between them in the 1500s and 1600s. Aldersbrook was sold to the crown in 1532 by Sir Giles Heron, holder of manor of Wanstead - it was then known as Naked Hall (Hawe) or Alderbroke. Three years later it was granted to Anthony Knevett and his wife, before being sold by the crown to Katherine Addington in 1544, to Robert Dudley, Earl of Leicester in 1585 and to John Lethieullier in 1693.
Both its farm and manor house were recorded as still existing in 1630. The manor house was the birthplace of the antiquarian Smart Lethieullier, who inherited it and the estate in 1737. His heir Sir Edward Hulse disposed of most of the lands relating to Aldersbrook Manor to Sir James Tylney-Long, which reunited those lands with Wanstead Manor. (The part not sold to Tylney-Long continued to function as Aldersbrook Farm, for which a new farmhouse was constructed around 1863.) Tylney-Long demolished the manorhouse, using its site for a farmhouse which was itself demolished just after the City of London Corporation acquired much of Aldersbrook Manor for its cemetery. The manor was excavated between 1972 and 1973 and the finds are now with Newham Heritage Service, the successor to the Passmore Edwards Museum.
External links
Manors in Essex
History of the London Borough of Newham
|
Kerria japonica, commonly known as Japanese kerria or Japanese rose, is a deciduous, yellow-flowering shrub in the rose family (Rosaceae), native to China, Japan and Korea. It is the only species in the genus Kerria. In the wild, it grows in thickets on mountain slopes. A double-flowered cultivar, K. japonica 'Pleniflora', is commonly called bachelor's buttons.
Description
Kerria japonica grows to tall, with weak arching stems often scrambling over other vegetation or rocks. In the wild it grows in thickets on mountain slopes. The leaves are alternate, simple, 3–10 cm long, with a doubly serrated margin. The flowers are golden yellow, with five petals, and evenly-spaced along branches of new green growth. The fruit is a dry single-seeded achene 4–4.5 mm long.
Cultivation
Kerria is valued in gardens for its golden yellow flowers, which appear in the spring. It is best grown with some shade from full sunlight to avoid blanching the flowers, and needs to be pruned after flowering to maintain health and vigour. Two cultivars have gained the Royal Horticultural Society's Award of Garden Merit, K. japonica 'Golden guinea' and the double-flowered K. japonica 'Pleniflora', commonly known as bachelor's buttons.
Pests and diseases
Since 2014 the UK's Royal Horticultural Society has been receiving reports from gardeners and horticulturalists of damage to plants of the shrub Kerria japonica. Symptoms include multiple red spots on leaves, and lesions on the stems, resulting in defoliation and eventual death. It has been determined that this infection is caused by the fungus Blumeriella kerriae, which is specific to the kerria. This highly contagious disease, known in English as kerria twig and leaf blight, was known in the U.S. but has not previously been observed on British plants. It is regarded as a serious threat to the cultivated kerria plants, which are popular garden shrubs.
Medicinal use
The plant has anti-inflammatory properties and a decoction of the flowering shoots with honey has been used in China in the treatment of coughs and gynecological disorders.
Chemistry
The leaves and roots contain 0.002% Hydrogen cyanide, while the tender shoots are a rich source of Vitamin C (200 mg/100g) and the seeds contain 44.9% protein and 45.3% fat. The flower petals contain the O-methylated flavonoid pectolinarin, (5,7-dihydroxy-4,6-dimethoxyflavone-7-rutinoside), a cytotoxic compound known also as Neolinarin and found also in Linaria spp., Kickxia elatine and the Duranta species D. plumieri.
References
External links
Kerrieae
Flora of Japan
Flora of China
Flora of Korea
Plants described in 1771
|
```c++
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "mc/animation/ScrollOffsetAnimationCurve.h"
#include <algorithm>
#include <cmath>
#include "mc/animation/TimingFunction.h"
#include "mc/base/TimeUtil.h"
#include "mc/base/Tween.h"
#include "third_party/WebKit/Source/platform/geometry/FloatPoint.h"
const double kDurationDivisor = 60.0;
namespace mc {
namespace {
static float maximumDimension(const blink::FloatPoint& delta)
{
return std::max(std::abs(delta.x()), std::abs(delta.y()));
}
static base::TimeDelta durationFromDelta(const blink::FloatPoint& delta)
{
// The duration of a scroll animation depends on the size of the scroll.
// The exact relationship between the size and the duration isn't specified
// by the CSSOM View smooth scroll spec and is instead left up to user agents
// to decide. The calculation performed here will very likely be further
// tweaked before the smooth scroll API ships.
return base::TimeDelta::FromMicroseconds((std::sqrt(maximumDimension(delta)) / kDurationDivisor) * base::Time::kMicrosecondsPerSecond);
}
static WTF::PassOwnPtr<TimingFunction> easeOutWithInitialVelocity(double velocity)
{
// Based on EaseInOutTimingFunction::Create with first control point rotated.
if (std::abs(velocity) < 1000.0) {
const double r2 = 0.42 * 0.42;
const double v2 = velocity * velocity;
const double x1 = std::sqrt(r2 / (v2 + 1));
const double y1 = std::sqrt(r2 * v2 / (v2 + 1));
return CubicBezierTimingFunction::create(x1, y1, 0.58, 1);
}
// For large |velocity|, x1 approaches 0 and y1 approaches 0.42. To avoid the
// risk of floating point arithmetic involving infinity and NaN, use those
// values directly rather than computing them above.
return CubicBezierTimingFunction::create(0, 0.42, 0.58, 1);
}
static blink::FloatPoint deltaFrom(const blink::FloatPoint& a, const blink::FloatPoint& b)
{
return blink::FloatPoint((float)(a.x() - b.x()), (float)(a.y() - b.y()));
}
} // namespace
WTF::PassOwnPtr<ScrollOffsetAnimationCurve> ScrollOffsetAnimationCurve::create(const blink::FloatPoint& targetValue, WTF::PassOwnPtr<TimingFunction> timingFunction)
{
return adoptPtr(new ScrollOffsetAnimationCurve(targetValue, timingFunction));
}
ScrollOffsetAnimationCurve::ScrollOffsetAnimationCurve(const blink::FloatPoint& targetValue, WTF::PassOwnPtr<TimingFunction> timingFunction)
: m_targetValue(targetValue), m_timingFunction(timingFunction)
{
}
ScrollOffsetAnimationCurve::~ScrollOffsetAnimationCurve() {}
void ScrollOffsetAnimationCurve::setInitialValue(const blink::FloatPoint& initialValue)
{
m_initialValue = initialValue;
m_totalAnimationDuration = durationFromDelta(deltaFrom(m_targetValue, m_initialValue));
}
blink::FloatPoint ScrollOffsetAnimationCurve::getValue(base::TimeDelta t) const
{
base::TimeDelta duration = m_totalAnimationDuration - m_lastRetarget;
t -= m_lastRetarget;
if (t <= base::TimeDelta())
return m_initialValue;
if (t >= duration)
return m_targetValue;
double progress = m_timingFunction->getValue(TimeUtil::divide(t, duration));
return blink::FloatPoint(
Tween::floatValueBetween(progress, m_initialValue.x(), m_targetValue.x()),
Tween::floatValueBetween(progress, m_initialValue.y(), m_targetValue.y()));
}
base::TimeDelta ScrollOffsetAnimationCurve::duration() const
{
return m_totalAnimationDuration;
}
AnimationCurve::CurveType ScrollOffsetAnimationCurve::type() const
{
return SCROLL_OFFSET;
}
WTF::PassOwnPtr<AnimationCurve> ScrollOffsetAnimationCurve::clone() const
{
WTF::PassOwnPtr<TimingFunction> timingFunction((m_timingFunction->clone()));
WTF::PassOwnPtr<ScrollOffsetAnimationCurve> curveClone = create(m_targetValue, timingFunction);
curveClone->m_initialValue = m_initialValue;
curveClone->m_totalAnimationDuration = m_totalAnimationDuration;
curveClone->m_lastRetarget = m_lastRetarget;
return curveClone;
}
void ScrollOffsetAnimationCurve::updateTarget(double t, const blink::FloatPoint& newTarget)
{
blink::FloatPoint currentPosition = getValue(base::TimeDelta::FromSecondsD(t));
blink::FloatPoint oldDelta = deltaFrom(m_targetValue, m_initialValue);
blink::FloatPoint newDelta = deltaFrom(newTarget, currentPosition);
double oldDuration = (m_totalAnimationDuration - m_lastRetarget).InSecondsF();
double newDuration = durationFromDelta(newDelta).InSecondsF();
double oldVelocity = m_timingFunction->velocity((t - m_lastRetarget.InSecondsF()) / oldDuration);
// TimingFunction::Velocity gives the slope of the curve from 0 to 1.
// To match the "true" velocity in px/sec we must adjust this slope for
// differences in duration and scroll delta between old and new curves.
double new_velocity = oldVelocity * (newDuration / oldDuration) * (maximumDimension(oldDelta) / maximumDimension(newDelta));
m_initialValue = currentPosition;
m_targetValue = newTarget;
m_totalAnimationDuration = base::TimeDelta::FromSecondsD(t + newDuration);
m_lastRetarget = base::TimeDelta::FromSecondsD(t);
m_timingFunction = easeOutWithInitialVelocity(new_velocity);
}
} // namespace mc
```
|
```ruby
require_relative '../../spec_helper'
require_relative 'fixtures/common'
describe "Dir#initialize" do
before :each do
DirSpecs.create_mock_dirs
end
after :each do
DirSpecs.delete_mock_dirs
end
it "calls #to_path on non-String arguments" do
p = mock('path')
p.stub!(:to_path).and_return(DirSpecs.mock_dir)
dir = Dir.new(p)
begin
dir.path.should == DirSpecs.mock_dir
ensure
dir.close
end
end
end
```
|
```objective-c
See the file COPYING for copying permission.
*/
#ifndef Expat_External_INCLUDED
#define Expat_External_INCLUDED 1
/* External API definitions */
/* Namespace external symbols to allow multiple libexpat version to
co-exist. */
#include "pyexpatns.h"
#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
#define XML_USE_MSC_EXTENSIONS 1
#endif
/* Expat tries very hard to make the API boundary very specifically
defined. There are two macros defined to control this boundary;
each of these can be defined before including this header to
achieve some different behavior, but doing so it not recommended or
tested frequently.
XMLCALL - The calling convention to use for all calls across the
"library boundary." This will default to cdecl, and
try really hard to tell the compiler that's what we
want.
XMLIMPORT - Whatever magic is needed to note that a function is
to be imported from a dynamically loaded library
(.dll, .so, or .sl, depending on your platform).
The XMLCALL macro was added in Expat 1.95.7. The only one which is
expected to be directly useful in client code is XMLCALL.
Note that on at least some Unix versions, the Expat library must be
compiled with the cdecl calling convention as the default since
system headers may assume the cdecl convention.
*/
#ifndef XMLCALL
#if defined(_MSC_VER)
#define XMLCALL __cdecl
#elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER)
#define XMLCALL __attribute__((cdecl))
#else
/* For any platform which uses this definition and supports more than
one calling convention, we need to extend this definition to
declare the convention used on that platform, if it's possible to
do so.
If this is the case for your platform, please file a bug report
with information on how to identify your platform via the C
pre-processor and how to specify the same calling convention as the
platform's malloc() implementation.
*/
#define XMLCALL
#endif
#endif /* not defined XMLCALL */
#if !defined(XML_STATIC) && !defined(XMLIMPORT)
#ifndef XML_BUILDING_EXPAT
/* using Expat from an application */
#ifdef XML_USE_MSC_EXTENSIONS
#define XMLIMPORT __declspec(dllimport)
#endif
#endif
#endif /* not defined XML_STATIC */
/* If we didn't define it above, define it away: */
#ifndef XMLIMPORT
#define XMLIMPORT
#endif
#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
#ifdef __cplusplus
extern "C" {
#endif
#ifdef XML_UNICODE_WCHAR_T
#define XML_UNICODE
#endif
#ifdef XML_UNICODE /* Information is UTF-16 encoded. */
#ifdef XML_UNICODE_WCHAR_T
typedef wchar_t XML_Char;
typedef wchar_t XML_LChar;
#else
typedef unsigned short XML_Char;
typedef char XML_LChar;
#endif /* XML_UNICODE_WCHAR_T */
#else /* Information is UTF-8 encoded. */
typedef char XML_Char;
typedef char XML_LChar;
#endif /* XML_UNICODE */
#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
typedef __int64 XML_Index;
typedef unsigned __int64 XML_Size;
#else
typedef long long XML_Index;
typedef unsigned long long XML_Size;
#endif
#else
typedef long XML_Index;
typedef unsigned long XML_Size;
#endif /* XML_LARGE_SIZE */
#ifdef __cplusplus
}
#endif
#endif /* not Expat_External_INCLUDED */
```
|
Luant () is a commune in the Indre department in central France. The writer Raymonde Vincent (1908–1985), winner of the Prix Femina in 1937 was born in Luant.
Geography
The commune is located in the parc naturel régional de la Brenne.
Population
See also
Communes of the Indre department
References
Communes of Indre
|
The Imcheon Lee clan () is one of the Korean clans. Their bon-gwan is in Buyeo County, South Chungcheong Province. According to the census in 2000, the number of members was 704. Their founder was Yi Hyeon. He was an Uighur and was naturalized at the end of the Goryeo Dynasty. After visiting Nanking as an interpreter for Goryeo, he was given territories in Imcheon as a reward, and began the Imcheon Yi clan.
See also
Korean clan names of foreign origin
References
External links
Uyghur Khaganate
Clans based in South Chungcheong Province
|
```java
package com.example.video;
// Represents a model that stores labels detected in a video.
public class FaceItems {
private String ageRange;
private String beard;
private String eyeglasses;
private String eyesOpen;
private String mustache;
private String smile;
public String getAgeRange() {
return this.ageRange;
}
public void setAgeRange(String age) {
this.ageRange = age;
}
public String getBeard() {
return this.beard;
}
public void setBeard(String beard) {
this.beard = beard;
}
public String getEyesOpen() {
return this.eyesOpen;
}
public void setEyesOpen(String eyesOpen) {
this.eyesOpen = eyesOpen;
}
public String getEyeglasses() {
return this.eyeglasses;
}
public void setEyeglasses(String eyeglasses) {
this.eyeglasses = eyeglasses;
}
public String gettMustache() {
return this.mustache;
}
public void setMustache(String mustache) {
this.mustache = mustache;
}
public String gettSmile() {
return this.smile;
}
public void setSmile(String smile) {
this.smile = smile;
}
}
```
|
Renata Śliwińska (born 5 September 1996) is a Polish Paralympic athlete competing in F40-classification discus throw and shot put events. She won the gold medal in the women's shot put F40 event at the 2020 Summer Paralympics held in Tokyo, Japan. In this event, she is also a two-time gold medalist at the World Para Athletics European Championships and a three-time medalist, including gold, at the World Para Athletics Championships.
Career
In 2016, Śliwińska represented Poland at the Summer Paralympics and she competed in both the women's discus throw F41 and women's shot put F40 events. In the women's discus throw event she set a new world record of 23.34. She represented Poland at the 2020 Summer Paralympics in the women's shot put F40 event after she finished 2nd in the women's shot put F40 event at the 2019 World Para Athletics Championships held in Dubai, United Arab Emirates.
Śliwińska won the gold medal in the women's shot put F40 event at the 2018 World Para Athletics European Championships in Berlin, Germany. She also won the silver medal in the women's discus throw F41 event.
References
External links
Living people
1996 births
Polish female discus throwers
Polish female shot putters
Paralympic athletes for Poland
Athletes (track and field) at the 2016 Summer Paralympics
Athletes (track and field) at the 2020 Summer Paralympics
Medalists at the 2020 Summer Paralympics
Paralympic gold medalists for Poland
World record holders in para-athletics
Medalists at the World Para Athletics European Championships
Medalists at the World Para Athletics Championships
World Para Athletics Championships winners
People from Skwierzyna
Sportspeople from Lubusz Voivodeship
21st-century Polish women
|
Walter Charles Fletcher (born December 17, 1996) is an American professional Canadian football running back for the Montreal Alouettes of the Canadian Football League (CFL). Fletcher played college football at Edinboro University of Pennsylvania and Ball State. He made his professional football debut in 2021 as a member of the Edmonton Elks.
High school career
Fletcher was an all-state selection in football at Centennial High School. Fletcher was a three-year starter, rushing for 1,736 (236 carries) yards and 24 touchdowns as a senior. He was also named to First Team All-Howard County. Fletcher set school records for rushing yards in a single game (306) and single season (1,736). Fletcher was named second team All-County as a junior. He finishes his career with 2,955 career rushing yards (program record) and 29 career touchdowns.
In 2014, Fletched attended a post-graduate school named East Coast Prep located in Great Barrington, Massachusetts for 3 months. Concluding the season, Fletcher enrolled in NCAA Division III's Randolph-Macon College in the spring of 2015 and later transferred to NCAA Division II's Edinboro University of Pennsylvania for the fall semester of 2015 as a walk-on.
College career
Fletcher played three years at Edinboro University of Pennsylvania (Division II), member of NCAA Division II's Pennsylvania State Athletic Conference. After his sophomore year, he ran for a school-record 1,740 yards on 253 carries, which ranks fifth in a season. Fletcher ranked second in NCAA Division II in rushing yards, along with ranking second nationally in rushing yards per game (158.2 ypg.) Fletcher scored 18 touchdowns rushing and added three touchdowns receiving for 21 total touchdowns. He rushed for 100-or-more yards in eight of eleven games.
Concluding his junior season, Fletcher was named 2018's PSAC West Offensive Player of the Year. He was the first player to do so since Trevor Harris in 2008. Fletcher concluded his 3 seasons with 632 carries, 3,913 yards (6.2 ypc) and 41 touchdowns. He also added 93 receptions, 692 yards and 6 receiving touchdowns. He holds school records for yards in a season, single game (328), career points (288), most 200 yard games in a season (4), career running back receptions (93) and Edinboro University's first ever 100 rushing/100 receiving game. He ranks 3rd all-time in career rushing yards and a 2nd in career touchdowns.
As a graduate transfer, Fletcher enrolled to play for the Ball State Cardinals in 2019. Fletcher finished with 1,032 offensive all-purpose yardage in his lone season with the Cardinals. He had 132 rushing attempts for 726 yards with five rushing touchdowns. Fletcher averaged 5.5 yards per carry which was the second highest by a Ball State running back with at least 100 carries dating back to 2000. Fletcher also caught 26 passes for 306 yards (10.6 ypc) and two touchdowns.
Professional career
Edmonton Elks
After going undrafted in the 2020 NFL Draft Fletcher signed with the Edmonton Elks of the Canadian Football League (CFL) on December 31, 2020. During the 2021 season Fletcher played in 11 games and carried the ball 67 times for 302 yards. He also caught 22 passes for 177 yards. Fletcher was selected as one of the Elk players to debut the team's new uniform designs for the 2022 season.
Montreal Alouettes
Following an injury to their incumbent starting running back, William Stanback, the Montreal Alouettes traded for Fletcher on June 14, 2022, in exchange for a sixth-round pick in the 2023 CFL Draft. He played in 14 regular season games for the team, starting in six, where he had 85 carries for 486 yards with one touchdown and 29 receptions for 353 yards and one receiving touchdown.
References
External links
Ball State Cardinals bio
Montreal Alouettes bio
Living people
1996 births
American football running backs
Canadian football running backs
Edmonton Elks players
Ball State Cardinals football players
Edinboro Fighting Scots football players
Montreal Alouettes players
Players of American football from Maryland
Players of Canadian football from Maryland
|
Peringottukara is a village in the western coastal side of India, located on the western side of Thrissur district, Kerala. The village is much famous for Vishnumaya Temples. Peringottukara village includes kizhakkumuri, vadakkumuri, and peringottukara center. Peringottukara village has main two junctions, the four-way junction, and three-way junction. The four-way junction has a petrol pump, three-star hotel, hypermarket, nationalized bank, Co-operative banks, and grocery stores. Peringottukara 3 way junction also has the same facilities. There are Chathan Seva temples at Peringottukara, such as Kanadi Kavu, Avanangattu Kalari, and Devasthanam. Among these Avanangattu Kalari is the biggest and oldest Temple. The biggest building, Shiva Parvathy Vishnumaya Terracotta Statue in Kerala is situated in front of the Peringottukara devasthanam, Its height is 52 ft.
History
Peringottukara was visited by Sree Narayana Guru who founded Sree Somashekhara Temple, a Shiva temple in 1919.
Festivals
Peringottukara is the place where Peringottukara Ulsavam takes place. The temple committee also runs a Lower Primary School.
The Peringottukara Ulsavam is considered as one of the major festivals of Thrissur.
Peringottukara is divided into four segments such as Vadakkummuri, Thekkummuri, Padinjattummuri, and Kizhakkummri. Another temple is Thiruvanikavu Temple, a Bhagawati Temple. The ulsavam happens every year in Malayalam month Makaram on Aswati Nakshatra. People from various places get here for the blessings of Devi. Peringottukara holds two Cinema theaters, a supermarket, a high school, and many more which helped a lot in her reputation.
Visit of Sree Narayana Guru 1903
In 1903, K. S. Krishna Thandan invited Sree Narayana Guru and N. Kumaran Asan to Peringuttukara. On 23 January, they reached Karattuparambil Tharavadu, Krishna Thandan's residence. The next day of his visit to this thiyya Tharavadu he demolished the Bhagavathi Temple where the family members worshiped. That was a clear message to those who are worshiping gods who want animal sacrifice. In this temple Every year they used to sacrifice more than 200 Roosters during the time of festivals. (K.R Achuthan M.A B.L, author of the first history of Somasekhara Temple). After this historic demolishing of bad faith, Guru called for a meeting. N.Kumaran Asan presided over the meeting and in this meeting a society was formed to spread Guru's principles "One Caste, One Religion, One God". The name of this society was Sree Narayana Guru Smaraka Samajam. K.S. Krishna Thandan and Thandassery Kunjayyappan were the promoters of the society. After staying a week at Karattuprambil Tharavadu, Guru and his disciple Asan went back to Moothakunnam after visiting other Thiyya Tharavadus like Thandassery (Kizhakkummury), Adipparambil (Valappad), Pokkanchery, Thachappally (Engandiyur) and Vazhoor.
After three months, Guru sent his first disciple Shivalinkadas to Peringottukara. According to K.R. Achuthan it happened the following July. Sivalinkadas stayed at Krishna Thandan's residence and started the collection of funds to construct an Ashramam (the holy place where Hindu Saints live). The construction of Sree Narayana Asrama was completed in 1906. During this time Guru visited Peringottukara again and again and helped people to free themselves from castism and untouchability.
Ashram
After the opening of Sree Narayana Ashrama, Guru appointed scholars of different disciplines as teachers to this Ashrama. Among them were P. Govindanassan, Swamy Shivalingadas and Swamy Bhodhananda Giry. There was a long array of disciples studied at Sree Narayana Ashrama. The important personalities were Sadguru Malayala Swamy (founder of Sri Vyasashram at Yerpedu, Andhra Pradesh) and Swamy Ramananda (founder of Siddhavaidyasramam Kurkkanchery, Thrissur).
The idea of Swamy Bodhananda to destroy casteism and Brahmin supremacy was quiet different from Sree Narayana Guru. He was against religious beliefs and opposed idol worship. The humanism he practiced was self-purification of thought and action. The First Social Reformer introduced a common dining table, common staying homes, common school rooms and inter-caste marriage system for Dalits in India was Swamy Bodhananda Giri. Later, Sahodaran Ayyappan Accepted these principles as his life mission.
Bodhananda Swami organized an armed organization for crushing untouchability castism and Brahmin supremacy. The name of this organization was Dharmabhadasena. It fought three decisive battles against Brahmins. They were Cheloor Kalapam at Thriprayar (1912), Arattupuzha Poooram Kalapam at Peringottukara and Chirakkal(1918) Thanissery Kalapam (1918) at Thanissery near Irinjalakkuda. Bengaly Asan, Thoppiyil Bahuleyan, and Ottappalam Krishnan were leaders and heroes.
In the British ruled Cochin state, Peringottukara was the cultural capital of Thiyyas and other backward people. It all started under the leadership of Sree Narayana guru.
References
External links
https://web.archive.org/web/20120706045805/http://www.avanangattilkalari.com/
Villages in Thrissur district
|
History
The Mortier de 220 mm L mle 1880 was one of a series of heavy artillery pieces designed by Colonel Charles Ragon de Bange. On 11 May 1874 three de Bange heavy cannons (120 mm, 155 mm, 240 mm) and two mortars (220 mm, 270 mm) were ordered by the French Army. The mle 1880 was advanced for its time due to being built completely of steel instead of a steel liner and cast iron reinforcing hoops of the previous Canon de 240 mm C mle 1870-87.
Although the majority of combatants had heavy field artillery prior to the outbreak of the First World War, none had adequate numbers of heavy guns in service, nor had they foreseen the growing importance of heavy artillery once the Western Front stagnated and trench warfare set in. Fortresses, armories, coastal fortifications, and museums were scoured for heavy artillery and sent to the front. Suitable field and rail carriages were built for these guns in an effort to give their forces the heavy field artillery needed to overcome trenches and hardened concrete fortifications.
Variants
mle 1880
The mle 1880 was a breech loaded mortar with a de Bange obturator and used separate loading bagged charges and projectiles. The mle 1880 was originally built without a recoil mechanism and in order to traverse the carriage needed to be levered into position before and after each shot. For transport, the mle 1880 could be broken down for transport into two wagon loads (barrel and carriage) for towing by two horse teams. The mortars could also be transferred to narrow gauge rail wagons for the final leg to their firing positions. These narrow gauge tracks were also used to re-position the mortars and bring up their ammunition and supplies. Site preparation included creating a firing platform made of wooden beams on soft ground. At the outbreak of the First World War, it is estimated there were 300 mle 1880s available.
mle 1880/91
A modification program in 1891 gave the mle 1880 a carriage with a hydraulic recoil mechanism and limited traverse. The new carriage was similar to the one used on the Mortier de 270 mm modèle 1885. The 130 mortars modified were designated as the mle 1880/1891 and consisted of a U shaped gun cradle which held the trunnioned barrel and a slightly inclined firing platform with hydraulic buffers. When the gun fired the hydro-buffer slowed the recoil of the cradle which slid up a set of inclined rails on the firing platform and then returned to position by the combined action of the buffers and gravity. For transport, it could be broken down into three loads for towing by horse teams or by artillery tractor. Site preparation consisted of creating a firing platform from wooden beams. However, a downside to the carriage modernization was the combined weight had doubled, which made transport and setup more difficult.
mle 1880 A.C.S.
The Mortier de 220 mm L modèle 1880 was a French heavy mortar employed as siege artillery during the First world war.
In an effort to improve the mobility of the mle 1880, 100 mortars were given six-wheeled carriages called Affût de Circonstance Schneider. The carriages were built from steel with a two-wheeled axle at the front and a four-wheeled axle at the rear. The bed of the ACS formed the base of the mortar and it had the same recoil system as the earlier mle 1880/91. Once in position, the wheels could be retracted and the mortar sat on its base. The advantage of this system was its mobility and reduced setup time. The downside was excessive weight, it could only be towed by artillery tractors and it was unsuitable for use on soft ground.
The 220 mle 1880 A.C.S. entered in service in June 1917 with the artillerie lourde à tracteurs (motorized heavy artillery). By August 1918, all of them had been replaced by 220 mm TR mle 1915/1916. The remaining mortars were used by the artillerie à pied (foot artillery) until November 1918.
Weapons of comparable performance and era
Mortaio da 210/8 D.S. - A comparable Italian mortar.
21 cm Mörser 10 - A comparable German mortar.
Photo gallery
References
Artillery of France
World War I artillery of France
World War I guns
Siege artillery
|
Konstantinovy Lázně () is a spa municipality and village in Tachov District in the Plzeň Region of the Czech Republic. It has about 900 inhabitants.
Konstantinovy Lázně lies approximately east of Tachov, north-west of Plzeň, and west of Prague.
Administrative parts
Villages of Břetislav, Dlouhé Hradiště, Nová Ves, Okrouhlé Hradiště, Poloučany, Potín and Šipín are administrative parts of Konstantinovy Lázně.
Spa
The local spa focuses on the treatment of cardiovascular diseases and diseases of the musculoskeletal system. The clients of the spa are treated with balneotherapy. The Konstantinovy Lázně spring has the highest content of free carbon dioxide in the Czech Republic.
References
Villages in Tachov District
Spa towns in the Czech Republic
|
Aitzaz may refer to:
Aitzaz Ahsan (born 1945), Pakistani politician and former Leader of the House in the Senate of Pakistan
Aitzaz Hasan (1997–2014), school boy from Khyber Pakhtunkhwa, Pakistan, who died while preventing a suicide bomber from entering his school
Aitzaz Hasan Shaheed High School, in Hangu, Khyber Pakhtunkhwa, Pakistan
|
Tolmetin () is a nonsteroidal anti-inflammatory drug (NSAID) of the heterocyclic acetic acid derivative class.
Tolmetin was originally approved by the US FDA in 1976, but may no longer be readily available in the US, generics may be available. It is available internationally.
It is used primarily to reduce hormones that cause pain, swelling, tenderness, and stiffness in conditions such as osteoarthritis and rheumatoid arthritis, including juvenile rheumatoid arthritis. In the United States it was marketed as Tolectin and comes as a tablet or capsule.
Clinical usage
Tolmetin is applicable in the treatment of rheumatoid arthritis, osteoarthrosis, pain, and ankylosing spondylitis.
Mechanism of action
Although the mechanism of action of tolmetin is unknown, research involving humans and animals has shown that tolmetin does not achieve anti-inflammatory response by stimulation of the adrenal or pituitary gland, but it has shown tolmetin restrains prostaglandin synthetase in vitro and reduces plasma levels of prostaglandin E, possibly causing the anti-inflammatory response.
When tested in rats, tolmetin prevented experimentally stimulated polyarthritis and reduced inflammation. In patients with rheumatoid arthritis or osteoarthritis tolmetin was as effective as aspirin and indometacin, although the occurrence of mild gastrointestinal adverse effects and tinnitus was lower in patients treated with tolmetin than it was with aspirin-treated patients and the occurrence of adverse effects of the central nervous system was lower with tolmetin than it was with indometacin.
Side effects
Tolmetin can increase the risk of heart or circulatory conditions such as heart attacks and strokes. It should not be taken shortly before or after coronary artery bypass surgery. Tolmetin can also increase the risk of gastrointestinal conditions such as perforation or bleeding, which can be fatal. Antacids can be taken with tolmetin to relieve stomachaches that often occur. Overdose can result in drowsiness, nausea, epigastric pain, and vomiting.
In October 2020, the U.S. Food and Drug Administration (FDA) required the drug label to be updated for all nonsteroidal anti-inflammatory medications to describe the risk of kidney problems in unborn babies that result from low amniotic fluid. They recommend avoiding NSAIDs in pregnant women at 20 weeks or later in pregnancy.
References
Nonsteroidal anti-inflammatory drugs
Pyrroles
Aromatic ketones
Acetic acids
4-Tolyl compounds
|
```java
/*
This file is part of the iText (R) project.
Authors: Apryse Software.
This program is offered under a commercial and under the AGPL license.
For commercial licensing, contact us at path_to_url For AGPL licensing, see below.
AGPL licensing:
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
along with this program. If not, see <path_to_url
*/
package com.itextpdf.kernel.utils.annotationsflattening;
import com.itextpdf.kernel.pdf.PdfName;
import java.util.HashMap;
import java.util.function.Supplier;
/**
* Helper class to retrieve the annotation flatten worker for the specified annotation subtype.
*/
public class PdfAnnotationFlattenFactory {
private static final HashMap<PdfName, Supplier<IAnnotationFlattener>> map;
private static final PdfName UNKNOWN = new PdfName("Unknown");
static {
map = new HashMap<>();
map.put(PdfName.Link, () -> new DefaultAnnotationFlattener());
map.put(PdfName.Popup, () -> new RemoveWithoutDrawingFlattener());
map.put(PdfName.Widget, () -> new WarnFormfieldFlattener());
map.put(PdfName.Screen, () -> new DefaultAnnotationFlattener());
map.put(PdfName._3D, () -> new DefaultAnnotationFlattener());
map.put(PdfName.Highlight, () -> new HighLightTextMarkupAnnotationFlattener());
map.put(PdfName.Underline, () -> new UnderlineTextMarkupAnnotationFlattener());
map.put(PdfName.Squiggly, () -> new SquigglyTextMarkupAnnotationFlattener());
map.put(PdfName.StrikeOut, () -> new StrikeOutTextMarkupAnnotationFlattener());
map.put(PdfName.Caret, () -> new DefaultAnnotationFlattener());
map.put(PdfName.Text, () -> new DefaultAnnotationFlattener());
map.put(PdfName.Sound, () -> new DefaultAnnotationFlattener());
map.put(PdfName.Stamp, () -> new DefaultAnnotationFlattener());
map.put(PdfName.FileAttachment, () -> new DefaultAnnotationFlattener());
map.put(PdfName.Ink, () -> new DefaultAnnotationFlattener());
map.put(PdfName.PrinterMark, () -> new DefaultAnnotationFlattener());
// TrapNet is a deprecated property in the PDF 2.0 version
map.put(PdfName.TrapNet, () -> new DefaultAnnotationFlattener());
map.put(PdfName.FreeText, () -> new DefaultAnnotationFlattener());
map.put(PdfName.Square, () -> new DefaultAnnotationFlattener());
map.put(PdfName.Circle, () -> new DefaultAnnotationFlattener());
map.put(PdfName.Line, () -> new DefaultAnnotationFlattener());
map.put(PdfName.Polygon, () -> new DefaultAnnotationFlattener());
map.put(PdfName.PolyLine, () -> new DefaultAnnotationFlattener());
map.put(PdfName.Redact, () -> new DefaultAnnotationFlattener());
map.put(PdfName.Watermark, () -> new DefaultAnnotationFlattener());
// To allow for the unknown subtype
map.put(UNKNOWN, () -> new NotSupportedFlattener());
}
/**
* Creates a new {@link PdfAnnotationFlattenFactory} instance.
*/
public PdfAnnotationFlattenFactory() {
// Empty constructor
}
/**
* Gets the annotation flatten worker for the specified annotation subtype.
*
* @param name the annotation subtype. If the subtype is unknown, the worker for the null type will be returned.
*
* @return the annotation flatten worker
*/
public IAnnotationFlattener getAnnotationFlattenWorker(PdfName name) {
Supplier<IAnnotationFlattener> worker = map.get(name);
if (worker == null) {
worker = map.get(UNKNOWN);
}
return worker.get();
}
}
```
|
Montreal Diocesan Theological College (known as Montreal Dio) is a theological seminary of the Anglican Church of Canada. It offers the Master of Divinity, Diploma in Ministry, Bachelor of Theology, and Master of Sacred Theology (S.T.M.) to candidates for ordination and other students, from Anglican and non-Anglican traditions. It also offers a distance education program, the Reading and Tutorial Course in Theology, leading to the Licentiate in Theology.
Andrew Taylor designed the former Montreal Diocesan Theological College building at University Street near Milton Street, 1895–96, mostly funded by the philanthropist Andrew Frederick Gault.
The college is a founding member of the ecumenical Montreal School of Theology, is affiliated with the McGill University School of Religious Studies, and is accredited by the Association of Theological Schools.
A World War I memorial window (1935) by Charles William Kelsey depicting Saint Stephen the Martyr was dedicated to Albert Withey of the 24th Canadian Battalion.
External links
Montreal Diocesan Theological College
McGill School of Religious Studies
References
Howard, Oswald Montreal Diocesan Theological College (Montreal) Call Number 363.H.34.0
Anglican seminaries and theological colleges
Seminaries and theological colleges in Canada
Alumni of Montreal Diocesan Theological College
McGill University buildings
|
```c++
// (See accompanying file LICENSE_1_0.txt or copy at
// path_to_url
// See path_to_url for the library home page.
//
/// @file
/// Test results collecting facility.
///
// ***************************************************************************
#ifndef BOOST_TEST_RESULTS_COLLECTOR_IPP_021105GER
#define BOOST_TEST_RESULTS_COLLECTOR_IPP_021105GER
// Boost.Test
#include <boost/test/unit_test_log.hpp>
#include <boost/test/results_collector.hpp>
#include <boost/test/framework.hpp>
#include <boost/test/execution_monitor.hpp>
#include <boost/test/tree/test_unit.hpp>
#include <boost/test/tree/visitor.hpp>
#include <boost/test/tree/test_case_counter.hpp>
#include <boost/test/tree/traverse.hpp>
// Boost
#include <boost/cstdlib.hpp>
// STL
#include <map>
#include <boost/test/detail/suppress_warnings.hpp>
//your_sha256_hash____________//
namespace boost {
namespace unit_test {
// ************************************************************************** //
// ************** test_results ************** //
// ************************************************************************** //
test_results::test_results()
{
clear();
}
//your_sha256_hash____________//
bool
test_results::passed() const
{
// if it is skipped, it is not passed. However, if any children is not failed/aborted
// then their skipped status is not taken into account.
return !p_skipped &&
p_test_cases_failed == 0 &&
p_assertions_failed <= p_expected_failures &&
// p_test_cases_skipped == 0 &&
!p_timed_out &&
p_test_cases_timed_out == 0 &&
!aborted();
}
//your_sha256_hash____________//
bool
test_results::aborted() const
{
return p_aborted;
}
//your_sha256_hash____________//
bool
test_results::skipped() const
{
return p_skipped;
}
//your_sha256_hash____________//
int
test_results::result_code() const
{
return passed() ? exit_success
: ( (p_assertions_failed > p_expected_failures || p_skipped || p_timed_out || p_test_cases_timed_out )
? exit_test_failure
: exit_exception_failure );
}
//your_sha256_hash____________//
void
test_results::operator+=( test_results const& tr )
{
p_test_suites.value += tr.p_test_suites;
p_assertions_passed.value += tr.p_assertions_passed;
p_assertions_failed.value += tr.p_assertions_failed;
p_warnings_failed.value += tr.p_warnings_failed;
p_test_cases_passed.value += tr.p_test_cases_passed;
p_test_cases_warned.value += tr.p_test_cases_warned;
p_test_cases_failed.value += tr.p_test_cases_failed;
p_test_cases_skipped.value += tr.p_test_cases_skipped;
p_test_cases_aborted.value += tr.p_test_cases_aborted;
p_test_cases_timed_out.value += tr.p_test_cases_timed_out;
p_test_suites_timed_out.value += tr.p_test_suites_timed_out;
p_duration_microseconds.value += tr.p_duration_microseconds;
}
//your_sha256_hash____________//
void
test_results::clear()
{
p_test_suites.value = 0;
p_assertions_passed.value = 0;
p_assertions_failed.value = 0;
p_warnings_failed.value = 0;
p_expected_failures.value = 0;
p_test_cases_passed.value = 0;
p_test_cases_warned.value = 0;
p_test_cases_failed.value = 0;
p_test_cases_skipped.value = 0;
p_test_cases_aborted.value = 0;
p_test_cases_timed_out.value = 0;
p_test_suites_timed_out.value = 0;
p_duration_microseconds.value= 0;
p_aborted.value = false;
p_skipped.value = false;
p_timed_out.value = false;
}
//your_sha256_hash____________//
// ************************************************************************** //
// ************** results_collector ************** //
// ************************************************************************** //
namespace {
struct results_collector_impl {
std::map<test_unit_id,test_results> m_results_store;
};
results_collector_impl& s_rc_impl() { static results_collector_impl the_inst; return the_inst; }
// deletes the entries of results_collector_impl
class clear_subtree_result : public test_tree_visitor {
public:
clear_subtree_result(results_collector_impl& store)
: m_store( store )
{}
private:
bool visit( test_unit const& tu) BOOST_OVERRIDE
{
typedef std::map<test_unit_id,test_results>::iterator iterator;
iterator found = m_store.m_results_store.find(tu.p_id);
if(found != m_store.m_results_store.end()) {
m_store.m_results_store.erase( found );
}
return true;
}
results_collector_impl& m_store;
};
} // local namespace
//your_sha256_hash____________//
BOOST_TEST_SINGLETON_CONS_IMPL( results_collector_t )
//your_sha256_hash____________//
void
results_collector_t::test_start( counter_t, test_unit_id id )
{
// deletes the results under id only
clear_subtree_result tree_clear(s_rc_impl());
traverse_test_tree( id, tree_clear );
}
//your_sha256_hash____________//
void
results_collector_t::test_unit_start( test_unit const& tu )
{
// init test_results entry
test_results& tr = s_rc_impl().m_results_store[tu.p_id];
tr.clear();
tr.p_expected_failures.value = tu.p_expected_failures;
}
//your_sha256_hash____________//
class results_collect_helper : public test_tree_visitor {
public:
explicit results_collect_helper( test_results& tr, test_unit const& ts ) : m_tr( tr ), m_ts( ts ) {}
void visit( test_case const& tc ) BOOST_OVERRIDE
{
test_results const& tr = results_collector.results( tc.p_id );
m_tr += tr;
if( tr.passed() ) {
if( tr.p_warnings_failed )
m_tr.p_test_cases_warned.value++;
else
m_tr.p_test_cases_passed.value++;
}
else if( tr.p_timed_out ) {
m_tr.p_test_cases_timed_out.value++;
}
else if( tr.p_skipped || !tc.is_enabled() ) {
m_tr.p_test_cases_skipped.value++;
}
else {
if( tr.p_aborted )
m_tr.p_test_cases_aborted.value++;
m_tr.p_test_cases_failed.value++;
}
}
bool test_suite_start( test_suite const& ts ) BOOST_OVERRIDE
{
if( m_ts.p_id == ts.p_id )
return true;
m_tr += results_collector.results( ts.p_id );
m_tr.p_test_suites.value++;
if( results_collector.results( ts.p_id ).p_timed_out )
m_tr.p_test_suites_timed_out.value++;
return false;
}
private:
// Data members
test_results& m_tr;
test_unit const& m_ts;
};
//your_sha256_hash____________//
void
results_collector_t::test_unit_finish( test_unit const& tu, unsigned long elapsed_in_microseconds )
{
test_results & tr = s_rc_impl().m_results_store[tu.p_id];
if( tu.p_type == TUT_SUITE ) {
results_collect_helper ch( tr, tu );
traverse_test_tree( tu, ch, true ); // true to ignore the status: we need to count the skipped/disabled tests
}
else {
bool num_failures_match = tr.p_aborted || tr.p_assertions_failed >= tr.p_expected_failures;
if( !num_failures_match )
BOOST_TEST_FRAMEWORK_MESSAGE( "Test case " << tu.full_name() << " has fewer failures than expected" );
bool check_any_assertions = tr.p_aborted || (tr.p_assertions_failed != 0) || (tr.p_assertions_passed != 0);
if( !check_any_assertions )
BOOST_TEST_FRAMEWORK_MESSAGE( "Test case " << tu.full_name() << " did not check any assertions" );
}
tr.p_duration_microseconds.value = elapsed_in_microseconds;
}
//your_sha256_hash____________//
void
results_collector_t::test_unit_skipped( test_unit const& tu, const_string /*reason*/ )
{
test_results& tr = s_rc_impl().m_results_store[tu.p_id];
tr.clear();
tr.p_skipped.value = true;
if( tu.p_type == TUT_SUITE ) {
test_case_counter tcc(true);
traverse_test_tree( tu, tcc, true ); // true because need to count the disabled tests/units
tr.p_test_cases_skipped.value = tcc.p_count;
}
}
//your_sha256_hash____________//
void
results_collector_t::test_unit_timed_out(test_unit const& tu)
{
test_results& tr = s_rc_impl().m_results_store[tu.p_id];
tr.p_timed_out.value = true;
}
//your_sha256_hash____________//
void
results_collector_t::assertion_result( unit_test::assertion_result ar )
{
test_results& tr = s_rc_impl().m_results_store[framework::current_test_case_id()];
switch( ar ) {
case AR_PASSED: tr.p_assertions_passed.value++; break;
case AR_FAILED: tr.p_assertions_failed.value++; break;
case AR_TRIGGERED: tr.p_warnings_failed.value++; break;
}
if( tr.p_assertions_failed == 1 )
first_failed_assertion();
}
//your_sha256_hash____________//
void
results_collector_t::exception_caught( execution_exception const& ex)
{
test_results& tr = s_rc_impl().m_results_store[framework::current_test_case_id()];
tr.p_assertions_failed.value++;
if( ex.code() == execution_exception::timeout_error ) {
tr.p_timed_out.value = true;
}
}
//your_sha256_hash____________//
void
results_collector_t::test_unit_aborted( test_unit const& tu )
{
s_rc_impl().m_results_store[tu.p_id].p_aborted.value = true;
}
//your_sha256_hash____________//
test_results const&
results_collector_t::results( test_unit_id id ) const
{
return s_rc_impl().m_results_store[id];
}
//your_sha256_hash____________//
} // namespace unit_test
} // namespace boost
#include <boost/test/detail/enable_warnings.hpp>
#endif // BOOST_TEST_RESULTS_COLLECTOR_IPP_021105GER
```
|
The Nissan Trade is a light commercial vehicle that was produced by Nissan Motor Ibérica from 1987 to 2001 in Spain and was marketed only in Europe. It was a replacement for the Ebro F108, itself a rebadged Alfa Romeo Romeo van which was marketed exclusively in Spain.
Production
It was available in both van and chassis cab forms, although the van variants were mostly available to Spain, with the chassis cabs being exported. It was based on the same chassis as the Ebro F108 vehicle, although it had different drivetrain and engine options.
Heavy-duty versions had a rear-wheel-drive configuration, while lighter versions were front-wheel drive. These vehicles were powered by Perkins engines. There was also a Trade Van version, which had an even simpler equipment and had swing-leaf side doors, instead of sliding doors.
Due to its outdated design and equipment (it did not have airbags and ABS in the 1990s), the Trade was not popular in some European countries. It did not offer contemporary comfort or a large number of standard features. Power steering was available as an option.
From 1993, a version with a 2.8-liter 86 hp turbodiesel was optional. During that time Nissan made a joint venture with Renault to produce the Renault Master, under the name Nissan Interstar, as a replacement for the Nissan Trade, but due to its popularity in some markets, the Trade models were produced until 2001.
It was also assembled in Avia Vehicles factories, a firm that was responsible for the design of the van.
References
Trade
Vans
Pickup trucks
Cab over vehicles
Vehicles introduced in 1987
Rear-wheel-drive vehicles
|
```go
/*
path_to_url
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package framework
import (
"sync"
"testing"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch"
)
// ensure the watch delivers the requested and only the requested items.
func consume(t *testing.T, w watch.Interface, rvs []string, done *sync.WaitGroup) {
defer done.Done()
for _, rv := range rvs {
got, ok := <-w.ResultChan()
if !ok {
t.Errorf("%#v: unexpected channel close, wanted %v", rvs, rv)
return
}
gotRV := got.Object.(*v1.Pod).ObjectMeta.ResourceVersion
if e, a := rv, gotRV; e != a {
t.Errorf("wanted %v, got %v", e, a)
} else {
t.Logf("Got %v as expected", gotRV)
}
}
// We should not get anything else.
got, open := <-w.ResultChan()
if open {
t.Errorf("%#v: unwanted object %#v", rvs, got)
}
}
func TestRCNumber(t *testing.T) {
pod := func(name string) *v1.Pod {
return &v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: name,
},
}
}
wg := &sync.WaitGroup{}
wg.Add(3)
source := NewFakeControllerSource()
source.Add(pod("foo"))
source.Modify(pod("foo"))
source.Modify(pod("foo"))
w, err := source.Watch(metav1.ListOptions{ResourceVersion: "1"})
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}
go consume(t, w, []string{"2", "3"}, wg)
list, err := source.List(metav1.ListOptions{})
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}
if e, a := "3", list.(*v1.List).ResourceVersion; e != a {
t.Errorf("wanted %v, got %v", e, a)
}
w2, err := source.Watch(metav1.ListOptions{ResourceVersion: "2"})
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}
go consume(t, w2, []string{"3"}, wg)
w3, err := source.Watch(metav1.ListOptions{ResourceVersion: "3"})
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}
go consume(t, w3, []string{}, wg)
source.Shutdown()
wg.Wait()
}
// TestResetWatch validates that the FakeController correctly mocks a watch
// falling behind and ResourceVersions aging out.
func TestResetWatch(t *testing.T) {
pod := func(name string) *v1.Pod {
return &v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: name,
},
}
}
wg := &sync.WaitGroup{}
wg.Add(1)
source := NewFakeControllerSource()
source.Add(pod("foo")) // RV = 1
source.Modify(pod("foo")) // RV = 2
source.Modify(pod("foo")) // RV = 3
// Kill watch, delete change history
source.ResetWatch()
// This should fail, RV=1 was lost with ResetWatch
_, err := source.Watch(metav1.ListOptions{ResourceVersion: "1"})
if err == nil {
t.Fatalf("Unexpected non-error")
}
// This should succeed, RV=3 is current
w, err := source.Watch(metav1.ListOptions{ResourceVersion: "3"})
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}
// Modify again, ensure the watch is still working
source.Modify(pod("foo"))
go consume(t, w, []string{"4"}, wg)
source.Shutdown()
wg.Wait()
}
```
|
```c++
CMFCToolBarsCustomizeDialog *pDlgCust = new CMFCToolBarsCustomizeDialog(this,
TRUE /* Automatic menus scaning */,
AFX_CUSTOMIZE_MENU_SHADOWS | AFX_CUSTOMIZE_TEXT_LABELS |
AFX_CUSTOMIZE_MENU_ANIMATIONS, // default parameters
&lstCustomPages); // pointer to the list of runtime classes of the custom property pages
```
|
Georgia Speller (1931–1988) was an African American artist known for her colorful, dynamic drawings and paintings on paper.
Early life
Speller grew up the daughter of a blacksmith in northeast Mississippi, in a town called Aberdeen. She learned to draw at a young age, but did not hone her craft until she was encouraged to do so by her husband, artist Henry Speller.
Career
Speller's evolution as an artist alongside her husband was outlined in an interview: "She had learned to draw as a child but became actively involved in her art only after being encouraged by her husband. It was an important element of their life together. They often engaged in playful yet serious competition, drawing the same subjects and comparing results. "I ain't near as good as Henry" was her assessment. "She done come to be a whole lot better than me" was his."
Most of Speller's oeuvre comprises orgiastic, ecstatic scenes of revelry in nature. These orgies often show the Moon and Sun simultaneously in the sky, which has been interpreted as implying a duration, not an instant. Women are depicted as mutually benefiting or dominant intimate partners. Art historian Xenia Zed saw in Speller's work "the revisionist feminist of the nineties; the sexual exhibitionists of the sixties and seventies; the romantic/erotic/pornographic gaze; the symbolic that can range from thoughts on African retention to psychoanalysis."
Speller's work often includes architectural paintings and drawings of houses, train stations, and cityscapes.
Collections
Works by Speller are in the collections of the Metropolitan Museum of Art, the High Museum of Art, Minneapolis Institute of Art, and the National Gallery of Art.
References
1931 births
1987 deaths
20th-century American women artists
20th-century American artists
Quilters
African-American women artists
Artists from Alabama
20th-century African-American women
20th-century African-American artists
People from Aberdeen, Mississippi
|
```powershell
Describe "Basic Function Provider Tests" -Tags "CI" {
BeforeAll {
$existingFunction = "existingFunction"
$nonExistingFunction = "nonExistingFunction"
$text = "Hello World!"
$functionValue = { return $text }
$restoreLocation = Get-Location
$newName = "renamedFunction"
Set-Location Function:
}
AfterAll {
Set-Location -Path $restoreLocation
}
BeforeEach {
Set-Item $existingFunction -Options "None" -Value $functionValue
}
AfterEach {
Remove-Item $existingFunction -ErrorAction SilentlyContinue -Force
Remove-Item $nonExistingFunction -ErrorAction SilentlyContinue -Force
Remove-Item $newName -ErrorAction SilentlyContinue -Force
}
Context "Validate Set-Item Cmdlet" {
It "Sets the new options in existing function" {
$newOptions = "ReadOnly, AllScope"
(Get-Item $existingFunction).Options | Should -BeExactly "None"
Set-Item $existingFunction -Options $newOptions
(Get-Item $existingFunction).Options | Should -BeExactly $newOptions
}
It "Sets the options and a value of type ScriptBlock for a new function" {
$options = "ReadOnly"
Set-Item $nonExistingFunction -Options $options -Value $functionValue
$getItemResult = Get-Item $nonExistingFunction
$getItemResult.Options | Should -BeExactly $options
$getItemResult.ScriptBlock | Should -BeExactly $functionValue
}
It "Removes existing function if Set-Item has no arguments beside function name" {
Set-Item $existingFunction
$existingFunction | Should -Not -Exist
}
It "Sets a value of type FunctionInfo for a new function" {
Set-Item $nonExistingFunction -Value (Get-Item $existingFunction)
Invoke-Expression $nonExistingFunction | Should -BeExactly $text
}
It "Sets a value of type String for a new function" {
Set-Item $nonExistingFunction -Value "return '$text' "
Invoke-Expression $nonExistingFunction | Should -BeExactly $text
}
It "Throws PSArgumentException when Set-Item is called with incorrect function value" {
{ Set-Item $nonExistingFunction -Value 123 -ErrorAction Stop } | Should -Throw -ErrorId "Argument,Microsoft.PowerShell.Commands.SetItemCommand"
}
}
Context "Validate Get-Item Cmdlet" {
It "Gets existing functions by name" {
$getItemResult = Get-Item $existingFunction
$getItemResult.Name | Should -BeExactly $existingFunction
$getItemResult.Options | Should -BeExactly "None"
$getItemResult.ScriptBlock | Should -BeExactly $functionValue
}
It "Matches regex with stars to the function names" {
$getItemResult = Get-Item "ex*on"
$getItemResult.Name | Should -BeExactly $existingFunction
# Stars representing empty string.
$getItemResult = Get-Item "*existingFunction*"
$getItemResult.Name | Should -BeExactly $existingFunction
# Finds 2 functions that match the regex.
Set-Item $nonExistingFunction -Value $functionValue
$getItemResults = Get-Item "*Function"
$getItemResults.Count | Should -BeGreaterThan 1
}
}
Context "Validate Remove-Item Cmdlet" {
It "Removes function" {
Remove-Item $existingFunction
{ Get-Item $existingFunction -ErrorAction Stop } | Should -Throw -ErrorId "PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand"
}
It "Fails to remove not existing function" {
{ Remove-Item $nonExistingFunction -ErrorAction Stop } | Should -Throw -ErrorId "PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand"
}
}
Context "Validate Rename-Item Cmdlet" {
It "Renames existing function with None options" {
Rename-Item $existingFunction -NewName $newName
{ Get-Item $existingFunction -ErrorAction Stop } | Should -Throw -ErrorId "PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand"
(Get-Item $newName).Count | Should -BeExactly 1
}
It "Fails to rename not existing function" {
{ Rename-Item $nonExistingFunction -NewName $newName -ErrorAction Stop } | Should -Throw -ErrorId "PathNotFound,Microsoft.PowerShell.Commands.RenameItemCommand"
}
It "Fails to rename function which is Constant" {
Set-Item $nonExistingFunction -Options "Constant" -Value $functionValue
{ Rename-Item $nonExistingFunction -NewName $newName -ErrorAction Stop } | Should -Throw -ErrorId "CannotRenameFunction,Microsoft.PowerShell.Commands.RenameItemCommand"
}
It "Fails to rename function which is ReadOnly" {
Set-Item $nonExistingFunction -Options "ReadOnly" -Value $functionValue
{ Rename-Item $nonExistingFunction -NewName $newName -ErrorAction Stop } | Should -Throw -ErrorId "CannotRenameFunction,Microsoft.PowerShell.Commands.RenameItemCommand"
}
It "Renames ReadOnly function when -Force parameter is on" {
Set-Item $nonExistingFunction -Options "ReadOnly" -Value $functionValue
Rename-Item $nonExistingFunction -NewName $newName -Force
{ Get-Item $nonExistingFunction -ErrorAction Stop } | Should -Throw -ErrorId "PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand"
(Get-Item $newName).Count | Should -BeExactly 1
}
}
}
```
|
```go
//
//
// path_to_url
//
// Unless required by applicable law or agreed to in writing, software
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
package display
import (
"strings"
"github.com/pulumi/pulumi/sdk/v3/go/common/diag/colors"
"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
)
func columnHeader(msg string) string {
return colors.Underline + colors.BrightBlue + msg + colors.Reset
}
func messagePadding(message string, maxWidth, extraPadding int) string {
extraWhitespace := maxWidth - colors.MeasureColorizedString(message)
contract.Assertf(extraWhitespace >= 0, "Neg whitespace. %v %s", maxWidth, message)
// Place two spaces between all columns (except after the first column). The first
// column already has a ": " so it doesn't need the extra space.
extraWhitespace += extraPadding
return strings.Repeat(" ", extraWhitespace)
}
// Gets the padding necessary to prepend to a column in order to keep it aligned in the terminal.
func columnPadding(columns []string, columnIndex int, maxColumnWidths []int) string {
extraWhitespace := " "
if columnIndex >= 0 && len(maxColumnWidths) > 0 {
column := columns[columnIndex]
maxWidth := maxColumnWidths[columnIndex]
extraWhitespace = messagePadding(column, maxWidth, 2)
}
return extraWhitespace
}
// Gets the fully padded message to be shown. The message will always include the ID of the
// status, then some amount of optional padding, then some amount of msgWithColors, then the
// suffix. Importantly, if there isn't enough room to display all of that on the terminal, then
// the msg will be truncated to try to make it fit.
func renderRow(columns []string, maxColumnWidths []int) string {
var row strings.Builder
for i := 0; i < len(columns); i++ {
row.WriteString(columnPadding(columns, i-1, maxColumnWidths))
row.WriteString(columns[i])
}
return row.String()
}
```
|
Jehovah-Nissi Ogulu, known professionally as Nissi, is a Nigerian singer, songwriter, fine artist and founder of Creele Animation Studios.
Early life
Ogulu was born to Bose and Samuel Ogulu and is the younger sister to Nigerian Afrobeats artiste Burna Boy. She started with music at six years old and went on to study Mechanical Engineering at the University of Warwick. Her mother, Bose Ogulu, is a two time Grammy-nominated talent manager, Grammy-award winning Co-executive producer for best global album 2020 Twice as Tall. Nissi’s grandfather is Benson Idonije, a radio broadcaster and first band manager of the late Fela Aníkúlápó Kuti
Career
Nissi’s debut single “Pay Attention” was released in September 2016. She later released the official visuals directed by 2012 Stanley Kubrick Award winner; Labi Odebunmi. Her third single titled ‘’Familiar’’ was produced by Nigerian music producer Chopstix and was also released in 2016. In 2020, she released her EP titled, IGNITE, and followed up with singles, Hold in 2021, Gravity (2022) and Overthinking (2022).
In 2021, she was one of the Jaguar Land Rover engineering team that designed and put together the 2023 Range Rover Model and launched a charity NFT collection on the Binance NFT marketplace. She also released a 3D Animation short film titled "The Satchel" where she worked in the roles of a director, producer and composer created by her company. She also the 2022 Havana Club X Burna design awarded most innovative product at Paris Packaging week 2023.
Filmography
"The Satchel" (2021)
Discography
EPs
Ignite (2020)
Singles
"Criminal" (2016)
"Pay Attention" (2016)
"Familiar" (2016)
"Over Here" (2019)
"Move X2" (2021)
"Hold" (2021)
"Gravity" (2022)
"Overthinking" (2022)
References
Living people
Nigerian singer-songwriters
Nigerian women singer-songwriters
21st-century Nigerian businesspeople
21st-century Nigerian businesswomen
Afrobeats musicians
Year of birth missing (living people)
|
The 2018 Poreč Trophy was the 19th edition of the Poreč Trophy road cycling one day race. It was part of UCI Europe Tour in category 1.2.
Teams
Thirty teams were invited to take part in the race. All of them were UCI Continental or club teams.
Result
References
2018 UCI Europe Tour
2018 in Slovenian sport
|
Grassy Ridge Bald is a bald mountain in North Carolina and is part of the Roan Highlands, within the Pisgah National Forest. Its elevation reaches and is on the boundary between Avery County, North Carolina (highest point) and Mitchell County, North Carolina. The mountain generates feeder streams for the North Toe River.
See also
List of mountains in North Carolina
References
Mountains of North Carolina
Southern Sixers
Mountains of Avery County, North Carolina
Landforms of Mitchell County, North Carolina
Mountains on the Appalachian Trail
|
```ruby
# frozen_string_literal: true
require_relative 'helper'
require 'date'
module Psych
class TestScalarScanner < TestCase
attr_reader :ss
def setup
super
@ss = Psych::ScalarScanner.new ClassLoader.new
end
def test_scan_time
{ '2001-12-15T02:59:43.1Z' => Time.utc(2001, 12, 15, 02, 59, 43, 100000),
'2001-12-14t21:59:43.10-05:00' => Time.utc(2001, 12, 15, 02, 59, 43, 100000),
'2001-12-14 21:59:43.10 -5' => Time.utc(2001, 12, 15, 02, 59, 43, 100000),
'2001-12-15 2:59:43.10' => Time.utc(2001, 12, 15, 02, 59, 43, 100000),
'2011-02-24 11:17:06 -0800' => Time.utc(2011, 02, 24, 19, 17, 06)
}.each do |time_str, time|
assert_equal time, @ss.tokenize(time_str)
end
end
def test_scan_bad_time
[ '2001-12-15T02:59:73.1Z',
'2001-12-14t90:59:43.10-05:00',
'2001-92-14 21:59:43.10 -5',
'2001-12-15 92:59:43.10',
'2011-02-24 81:17:06 -0800',
].each do |time_str|
assert_equal time_str, @ss.tokenize(time_str)
end
end
def test_scan_bad_dates
x = '2000-15-01'
assert_equal x, @ss.tokenize(x)
x = '2000-10-51'
assert_equal x, @ss.tokenize(x)
x = '2000-10-32'
assert_equal x, @ss.tokenize(x)
end
def test_scan_good_edge_date
x = '2000-1-31'
assert_equal Date.strptime(x, '%Y-%m-%d'), @ss.tokenize(x)
end
def test_scan_bad_edge_date
x = '2000-11-31'
assert_equal x, @ss.tokenize(x)
end
def test_scan_date
date = '1980-12-16'
token = @ss.tokenize date
assert_equal 1980, token.year
assert_equal 12, token.month
assert_equal 16, token.day
end
def test_scan_inf
assert_equal(1 / 0.0, ss.tokenize('.inf'))
end
def test_scan_plus_inf
assert_equal(1 / 0.0, ss.tokenize('+.inf'))
end
def test_scan_minus_inf
assert_equal(-1 / 0.0, ss.tokenize('-.inf'))
end
def test_scan_nan
assert ss.tokenize('.nan').nan?
end
def test_scan_float_with_exponent_but_no_fraction
assert_equal(0.0, ss.tokenize('0.E+0'))
end
def test_scan_null
assert_nil ss.tokenize('null')
assert_nil ss.tokenize('~')
assert_nil ss.tokenize('')
end
def test_scan_symbol
assert_equal :foo, ss.tokenize(':foo')
end
def test_scan_not_sexagesimal
assert_equal '00:00:00:00:0f', ss.tokenize('00:00:00:00:0f')
assert_equal '00:00:00:00:00', ss.tokenize('00:00:00:00:00')
assert_equal '00:00:00:00:00.0', ss.tokenize('00:00:00:00:00.0')
end
def test_scan_sexagesimal_float
assert_equal 685230.15, ss.tokenize('190:20:30.15')
end
def test_scan_sexagesimal_int
assert_equal 685230, ss.tokenize('190:20:30')
end
def test_scan_float
assert_equal 1.2, ss.tokenize('1.2')
end
def test_scan_true
assert_equal true, ss.tokenize('true')
end
def test_scan_strings_starting_with_underscores
assert_equal '_100', ss.tokenize('_100')
end
def test_scan_strings_starting_with_number
assert_equal '450D', ss.tokenize('450D')
end
def test_scan_strings_ending_with_underscores
assert_equal '100_', ss.tokenize('100_')
end
def test_scan_int_commas_and_underscores
# NB: This test is to ensure backward compatibility with prior Psych versions,
# not to test against any actual YAML specification.
assert_equal 123_456_789, ss.tokenize('123_456_789')
assert_equal 123_456_789, ss.tokenize('123,456,789')
assert_equal 123_456_789, ss.tokenize('1_2,3,4_5,6_789')
assert_equal 1, ss.tokenize('1')
assert_equal 1, ss.tokenize('+1')
assert_equal(-1, ss.tokenize('-1'))
assert_equal 0b010101010, ss.tokenize('0b010101010')
assert_equal 0b010101010, ss.tokenize('0b0,1_0,1_,0,1_01,0')
assert_equal 01234567, ss.tokenize('01234567')
assert_equal 01234567, ss.tokenize('0_,,,1_2,_34567')
assert_equal 0x123456789abcdef, ss.tokenize('0x123456789abcdef')
assert_equal 0x123456789abcdef, ss.tokenize('0x12_,34,_56,_789abcdef')
assert_equal 0x123456789abcdef, ss.tokenize('0x_12_,34,_56,_789abcdef')
assert_equal 0x123456789abcdef, ss.tokenize('0x12_,34,_56,_789abcdef__')
end
def test_scan_strict_int_commas_and_underscores
# this test is to ensure adherance to YML spec using the 'strict_integer' option
scanner = Psych::ScalarScanner.new ClassLoader.new, strict_integer: true
assert_equal 123_456_789, scanner.tokenize('123_456_789')
assert_equal '123,456,789', scanner.tokenize('123,456,789')
assert_equal '1_2,3,4_5,6_789', scanner.tokenize('1_2,3,4_5,6_789')
assert_equal 1, scanner.tokenize('1')
assert_equal 1, scanner.tokenize('+1')
assert_equal(-1, scanner.tokenize('-1'))
assert_equal 0b010101010, scanner.tokenize('0b010101010')
assert_equal 0b010101010, scanner.tokenize('0b01_01_01_010')
assert_equal '0b0,1_0,1_,0,1_01,0', scanner.tokenize('0b0,1_0,1_,0,1_01,0')
assert_equal 01234567, scanner.tokenize('01234567')
assert_equal '0_,,,1_2,_34567', scanner.tokenize('0_,,,1_2,_34567')
assert_equal 0x123456789abcdef, scanner.tokenize('0x123456789abcdef')
assert_equal 0x123456789abcdef, scanner.tokenize('0x12_34_56_789abcdef')
assert_equal '0x12_,34,_56,_789abcdef', scanner.tokenize('0x12_,34,_56,_789abcdef')
assert_equal '0x_12_,34,_56,_789abcdef', scanner.tokenize('0x_12_,34,_56,_789abcdef')
assert_equal '0x12_,34,_56,_789abcdef__', scanner.tokenize('0x12_,34,_56,_789abcdef__')
end
def test_scan_dot
assert_equal '.', ss.tokenize('.')
end
def test_scan_plus_dot
assert_equal '+.', ss.tokenize('+.')
end
class MatchCallCounter < String
attr_reader :match_call_count
def match?(pat)
@match_call_count ||= 0
@match_call_count += 1
super
end
end
def test_scan_ascii_matches_quickly
ascii = MatchCallCounter.new('abcdefghijklmnopqrstuvwxyz')
ss.tokenize(ascii)
assert_equal 1, ascii.match_call_count
end
def test_scan_unicode_matches_quickly
unicode = MatchCallCounter.new('')
ss.tokenize(unicode)
assert_equal 1, unicode.match_call_count
end
end
end
```
|
Malaville () is a former commune in the Charente department in southwestern France. On 1 January 2017, it was merged into the new commune Bellevigne.
Population
See also
Communes of the Charente department
References
Former communes of Charente
|
Tables is a collaborative database program developed out of Google's Area 120 incubator. Tables is available as a web application. The app allows users to collaborate in real-time to track work more efficiently using automation.
History
Tables originated as an experiment within Google's Area 120 product incubator, and launched to a public beta in the United States on September 22, 2020. It was first released as a test for a limited number of early testers on March 5, 2020, and then expanded to a larger early access program on May 5, 2020. Tables is not part of the Google Drive or Google Workspace service.
In June of 2021, it was announced that the Area 120 experiment was a success and that Google Cloud "has committed to investing in this product area long-term".
Platforms
Tables is available as a web application supported on the Google Chrome, Microsoft Edge, Apple Safari, and Mozilla Firefox web browsers.
Key Features
Core concepts
Tables anchors around several core concepts:
Tables: containers of rows and columns of structured data. Columns (aka "fields") define the table structure and enforce data type/format and relationships.
Workspaces: allow users to group tables together in a tabbed interface. Tables can be in more than one workspace.
Views: allow users to create customized views of the data with different layouts, groupings, and filters/sorts applied. Layouts allow you to switch between different ways to visualize the table records, such as a ticket queue, kanban board, or map.
Forms: allow users to collect input without giving access to the table. Tables forms are separate from Google Forms.
Bots: allow users to automate tasks, such as send emails, update data, or send weekly reports, and send data to 3rd party webhooks to trigger Google Chat or Slack notifications or Zapier workflows.
Data types
Tables allow users to set specific data types for columns:
Integrations
Tables allows users to import data directly from a Google Sheet or CSV file, and also performs a one-way recurring sync of data from a table into Google Sheets.
Person-type columns in Tables allow the user to search for and select Google users from your Gmail contacts.
Sharing in Tables allows the user to share with existing Google users, Google Groups, or with their entire work domain.
Tables also offers a public API and the ability to call the Tables API via Apps Script.
Collaboration and revision history
Tables allows users to collaborate in real-time on records in a table. Tables can be shared, opened, and edited by multiple users simultaneously and users are able to see field-by-field changes as collaborators make edits. All changes to table records are automatically saved to Google's servers, and a change history for records are automatically kept so past edits may be viewed and reverted to. Deleted rows, columns, tables, and workspaces can also be restored within a given timeframe.
Sharing and access control
Users can share their tables and workspaces from Tables using similar permissioning roles as Google Drive, such as editors, commenters, and viewers. Tables also supports an additional "writer" role that allows users to modify rows in the table, but not the table or columns.
Users can share tables and workspaces with other individual Google users, Google Groups, or with their entire work domain.
Tables and workspaces can be shared independently of each other, and you can restrict access to a table within a workspace to provide more granular control of which users can see which data.
References
External links
Official help center
Collaborative software
Google software
|
```java
/***************************************************************************
* CLASS PcalResourceFileReader *
* *
* A PcalResourceFileReader returns an object for reading a resource file, *
* which is a file kept in the same directory as the pcal.AST class. *
* The constructor takes a file name as argument. The object's two public *
* methods are *
* *
* getLine() : Returns the next line of the file as a string. Returns *
* null after the last line. *
* *
* close() : Closes the file. *
***************************************************************************/
package pcal ;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Vector;
import pcal.exception.PcalResourceFileReaderException;
public class PcalResourceFileReader
{ public PcalResourceFileReader(String fileName) throws PcalResourceFileReaderException
/*********************************************************************
* The constructor, where fileName is the name of a file that's *
* in the same directory as pcal.AST. *
*********************************************************************/
{ name = fileName ;
Class cl = null ;
// TODO fix this!
try { cl = Class.forName("pcal.AST"); }
catch (ClassNotFoundException e)
{ throw new PcalResourceFileReaderException(
"Java could not find class pcal.AST. There \n"
+ " is probably something wrong with the way\n"
+ " the +cal translator is installed");
} ;
InputStream input = cl.getResourceAsStream(fileName) ;
if (input == null)
{ throw new PcalResourceFileReaderException(
"Could not find resource file " + fileName + ".\n"
+ " There is probably something wrong with the way\n"
+ " the +cal translator is installed");
} ;
inputReader = new BufferedReader(new InputStreamReader(input)) ;
};
public static Vector<String> ResourceFileToStringVector(String fileName) throws PcalResourceFileReaderException
/***********************************************************************
* Reads file fileName into a StringVector, a vector in which each *
* element is a line of the file. *
***********************************************************************/
{ Vector<String> inputVec = new Vector<String>(100) ;
PcalResourceFileReader wordFileReader
= new PcalResourceFileReader(fileName);
String word = wordFileReader.getLine();
while (word != null)
{ inputVec.addElement(word) ;
word = wordFileReader.getLine() ;
} ;
wordFileReader.close();
return inputVec ;
}
public String getLine() throws PcalResourceFileReaderException
/*********************************************************************
* Returns the next line of input. After it returns the last line *
* of input, it returns null. *
*********************************************************************/
{ try { return inputReader.readLine();
}
catch (java.io.IOException e)
{ throw new PcalResourceFileReaderException(
"Error reading the +cal translator resource file "
+ name + ".\n"
+ " You may be having file system problems");
}
}
private boolean done = false;
/*********************************************************************
* If the last line of input doesn't end with a '\n', then getLine() *
* returns that line and sets done to true. *
*********************************************************************/
private BufferedReader inputReader ;
/*********************************************************************
* The actual reader for the resource file. *
*********************************************************************/
private String name ;
/*********************************************************************
* A copy of the resource file name, kept for error messages. *
*********************************************************************/
public void close() throws PcalResourceFileReaderException
{ try { inputReader.close(); }
catch (java.io.IOException e)
{ throw new PcalResourceFileReaderException(
"Error trying to close the +cal translator resource file "
+ name + ".\n"
+ " You may be having file system problems");
} ;
} ;
}
/* Last modified on Wed 3 Aug 2005 at 18:41:43 UT by lamport */
```
|
```c
/*****************************************************************************
All rights reserved.
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.
*****************************************************************************
* Contents: Native middle-level C interface to LAPACK function zggevx
* Author: Intel Corporation
*****************************************************************************/
#include "lapacke_utils.h"
lapack_int API_SUFFIX(LAPACKE_zggevx_work)( int matrix_layout, char balanc, char jobvl,
char jobvr, char sense, lapack_int n,
lapack_complex_double* a, lapack_int lda,
lapack_complex_double* b, lapack_int ldb,
lapack_complex_double* alpha,
lapack_complex_double* beta,
lapack_complex_double* vl, lapack_int ldvl,
lapack_complex_double* vr, lapack_int ldvr,
lapack_int* ilo, lapack_int* ihi,
double* lscale, double* rscale, double* abnrm,
double* bbnrm, double* rconde, double* rcondv,
lapack_complex_double* work, lapack_int lwork,
double* rwork, lapack_int* iwork,
lapack_logical* bwork )
{
lapack_int info = 0;
if( matrix_layout == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_zggevx( &balanc, &jobvl, &jobvr, &sense, &n, a, &lda, b, &ldb,
alpha, beta, vl, &ldvl, vr, &ldvr, ilo, ihi, lscale,
rscale, abnrm, bbnrm, rconde, rcondv, work, &lwork,
rwork, iwork, bwork, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
lapack_int lda_t = MAX(1,n);
lapack_int ldb_t = MAX(1,n);
lapack_int ldvl_t = MAX(1,n);
lapack_int ldvr_t = MAX(1,n);
lapack_complex_double* a_t = NULL;
lapack_complex_double* b_t = NULL;
lapack_complex_double* vl_t = NULL;
lapack_complex_double* vr_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -8;
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_zggevx_work", info );
return info;
}
if( ldb < n ) {
info = -10;
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_zggevx_work", info );
return info;
}
if( ldvl < n ) {
info = -14;
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_zggevx_work", info );
return info;
}
if( ldvr < n ) {
info = -16;
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_zggevx_work", info );
return info;
}
/* Query optimal working array(s) size if requested */
if( lwork == -1 ) {
LAPACK_zggevx( &balanc, &jobvl, &jobvr, &sense, &n, a, &lda_t, b,
&ldb_t, alpha, beta, vl, &ldvl_t, vr, &ldvr_t, ilo,
ihi, lscale, rscale, abnrm, bbnrm, rconde, rcondv,
work, &lwork, rwork, iwork, bwork, &info );
return (info < 0) ? (info - 1) : info;
}
/* Allocate memory for temporary array(s) */
a_t = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
b_t = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) * ldb_t * MAX(1,n) );
if( b_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_1;
}
if( API_SUFFIX(LAPACKE_lsame)( jobvl, 'v' ) ) {
vl_t = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) *
ldvl_t * MAX(1,n) );
if( vl_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_2;
}
}
if( API_SUFFIX(LAPACKE_lsame)( jobvr, 'v' ) ) {
vr_t = (lapack_complex_double*)
LAPACKE_malloc( sizeof(lapack_complex_double) *
ldvr_t * MAX(1,n) );
if( vr_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_3;
}
}
/* Transpose input matrices */
API_SUFFIX(LAPACKE_zge_trans)( matrix_layout, n, n, a, lda, a_t, lda_t );
API_SUFFIX(LAPACKE_zge_trans)( matrix_layout, n, n, b, ldb, b_t, ldb_t );
/* Call LAPACK function and adjust info */
LAPACK_zggevx( &balanc, &jobvl, &jobvr, &sense, &n, a_t, &lda_t, b_t,
&ldb_t, alpha, beta, vl_t, &ldvl_t, vr_t, &ldvr_t, ilo,
ihi, lscale, rscale, abnrm, bbnrm, rconde, rcondv, work,
&lwork, rwork, iwork, bwork, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
API_SUFFIX(LAPACKE_zge_trans)( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
API_SUFFIX(LAPACKE_zge_trans)( LAPACK_COL_MAJOR, n, n, b_t, ldb_t, b, ldb );
if( API_SUFFIX(LAPACKE_lsame)( jobvl, 'v' ) ) {
API_SUFFIX(LAPACKE_zge_trans)( LAPACK_COL_MAJOR, n, n, vl_t, ldvl_t, vl, ldvl );
}
if( API_SUFFIX(LAPACKE_lsame)( jobvr, 'v' ) ) {
API_SUFFIX(LAPACKE_zge_trans)( LAPACK_COL_MAJOR, n, n, vr_t, ldvr_t, vr, ldvr );
}
/* Release memory and exit */
if( API_SUFFIX(LAPACKE_lsame)( jobvr, 'v' ) ) {
LAPACKE_free( vr_t );
}
exit_level_3:
if( API_SUFFIX(LAPACKE_lsame)( jobvl, 'v' ) ) {
LAPACKE_free( vl_t );
}
exit_level_2:
LAPACKE_free( b_t );
exit_level_1:
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_zggevx_work", info );
}
} else {
info = -1;
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_zggevx_work", info );
}
return info;
}
```
|
McGregor Glacier () is a tributary glacier, long and wide, draining the southwest slopes of the Prince Olav Mountains in Antarctica, and flowing west to enter Shackleton Glacier just north of the Cumulus Hills. It was named by the Southern Party of the New Zealand Geological Survey Antarctic Expedition (1961–62) for V.R. McGregor, a geologist with that party.
References
Glaciers of Dufek Coast
|
Ofelia Hernandez is a former mayor of Huntington Park, California.
In March 2003, Hernandez was elected to serve a 4-year term on the 5-member Huntington Park City Council. In March 2005, she was appointed as mayor by the City Council. In March 2007, she won re-election to the City Council and repeated her success in the March 2011 election. In March 2013, she was appointed mayor.
References
Living people
Mayors of places in California
Women mayors of places in California
People from Huntington Park, California
Year of birth missing (living people)
California city council members
Women city councillors in California
Hispanic and Latino American mayors in California
Hispanic and Latino American politicians
Hispanic and Latino American women in politics
21st-century American women
|
Season 2: All-Time Classic American Love Songs was compiled of classic American love songs performed by the top eleven finalists from season 2 of American Idol and contains two ensemble tracks. It was released in 2003.
The album debuted at No.2 on the Nielsen Soundscan U.S. album chart for the week ending May 4, 2003 with sales of 101,225 the first week. It was certified gold on May 30, 2003, and its total sales reached 648,000.
Track listing
"What the World Needs Now is Love" (Burt Bacharach) – American Idol Season 2 Finalists
"Superstar" (The Carpenters) – Ruben Studdard
"On the Wings of Love" (Jeffrey Osborne) – Clay Aiken
"At Last" (Etta James) – Julia DeMato
"Three Times a Lady" (Commodores) – Josh Gracin
"Let's Stay Together" (Al Green) – Trenyce
"Back At One" (Brian McKnight) – Rickey Smith
"Killing Me Softly" (Roberta Flack) – Kimberly Caldwell
"Open Arms" (Journey) – Corey Clark
"How Do I Live" (LeAnn Rimes) – Carmen Rasmusen
"Over the Rainbow" (Judy Garland) – Kimberley Locke
"Overjoyed" (Stevie Wonder) – Charles Grigsby
"God Bless the USA" (Lee Greenwood) – American Idol Season 2 Finalists
Charts
Weekly charts
Year-end charts
References
American Idol compilation series
2003 soundtrack albums
2003 compilation albums
|
```c++
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/api/api-inl.h"
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/heap/heap-inl.h" // For ToBoolean. TODO(jkummerow): Drop.
#include "src/json/json-stringifier.h"
#include "src/logging/counters.h"
#include "src/objects/objects-inl.h"
namespace v8 {
namespace internal {
namespace {
using v8::tracing::TracedValue;
#define MAX_STACK_LENGTH 100
class MaybeUtf8 {
public:
explicit MaybeUtf8(Isolate* isolate, Handle<String> string) : buf_(data_) {
string = String::Flatten(isolate, string);
int len;
if (string->IsOneByteRepresentation()) {
// Technically this allows unescaped latin1 characters but the trace
// events mechanism currently does the same and the current consuming
// tools are tolerant of it. A more correct approach here would be to
// escape non-ascii characters but this is easier and faster.
len = string->length();
AllocateSufficientSpace(len);
if (len > 0) {
// Why copy? Well, the trace event mechanism requires null-terminated
// strings, the bytes we get from SeqOneByteString are not. buf_ is
// guaranteed to be null terminated.
DisallowHeapAllocation no_gc;
memcpy(buf_, Handle<SeqOneByteString>::cast(string)->GetChars(no_gc),
len);
}
} else {
Local<v8::String> local = Utils::ToLocal(string);
auto* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate);
len = local->Utf8Length(v8_isolate);
AllocateSufficientSpace(len);
if (len > 0) {
local->WriteUtf8(v8_isolate, reinterpret_cast<char*>(buf_));
}
}
buf_[len] = 0;
}
const char* operator*() const { return reinterpret_cast<const char*>(buf_); }
private:
void AllocateSufficientSpace(int len) {
if (len + 1 > MAX_STACK_LENGTH) {
allocated_.reset(new uint8_t[len + 1]);
buf_ = allocated_.get();
}
}
// In the most common cases, the buffer here will be stack allocated.
// A heap allocation will only occur if the data is more than MAX_STACK_LENGTH
// Given that this is used primarily for trace event categories and names,
// the MAX_STACK_LENGTH should be more than enough.
uint8_t* buf_;
uint8_t data_[MAX_STACK_LENGTH];
std::unique_ptr<uint8_t> allocated_;
};
class JsonTraceValue : public ConvertableToTraceFormat {
public:
explicit JsonTraceValue(Isolate* isolate, Handle<String> object) {
// object is a JSON string serialized using JSON.stringify() from within
// the BUILTIN(Trace) method. This may (likely) contain UTF8 values so
// to grab the appropriate buffer data we have to serialize it out. We
// hold on to the bits until the AppendAsTraceFormat method is called.
MaybeUtf8 data(isolate, object);
data_ = *data;
}
void AppendAsTraceFormat(std::string* out) const override { *out += data_; }
private:
std::string data_;
};
const uint8_t* GetCategoryGroupEnabled(Isolate* isolate,
Handle<String> string) {
MaybeUtf8 category(isolate, string);
return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(*category);
}
#undef MAX_STACK_LENGTH
} // namespace
// Builins::kIsTraceCategoryEnabled(category) : bool
BUILTIN(IsTraceCategoryEnabled) {
HandleScope scope(isolate);
Handle<Object> category = args.atOrUndefined(isolate, 1);
if (!category->IsString()) {
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewTypeError(MessageTemplate::kTraceEventCategoryError));
}
return isolate->heap()->ToBoolean(
*GetCategoryGroupEnabled(isolate, Handle<String>::cast(category)));
}
// Builtins::kTrace(phase, category, name, id, data) : bool
BUILTIN(Trace) {
HandleScope handle_scope(isolate);
Handle<Object> phase_arg = args.atOrUndefined(isolate, 1);
Handle<Object> category = args.atOrUndefined(isolate, 2);
Handle<Object> name_arg = args.atOrUndefined(isolate, 3);
Handle<Object> id_arg = args.atOrUndefined(isolate, 4);
Handle<Object> data_arg = args.atOrUndefined(isolate, 5);
const uint8_t* category_group_enabled =
GetCategoryGroupEnabled(isolate, Handle<String>::cast(category));
// Exit early if the category group is not enabled.
if (!*category_group_enabled) {
return ReadOnlyRoots(isolate).false_value();
}
if (!phase_arg->IsNumber()) {
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewTypeError(MessageTemplate::kTraceEventPhaseError));
}
if (!category->IsString()) {
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewTypeError(MessageTemplate::kTraceEventCategoryError));
}
if (!name_arg->IsString()) {
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewTypeError(MessageTemplate::kTraceEventNameError));
}
uint32_t flags = TRACE_EVENT_FLAG_COPY;
int32_t id = 0;
if (!id_arg->IsNullOrUndefined(isolate)) {
if (!id_arg->IsNumber()) {
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewTypeError(MessageTemplate::kTraceEventIDError));
}
flags |= TRACE_EVENT_FLAG_HAS_ID;
id = DoubleToInt32(id_arg->Number());
}
Handle<String> name_str = Handle<String>::cast(name_arg);
if (name_str->length() == 0) {
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewTypeError(MessageTemplate::kTraceEventNameLengthError));
}
MaybeUtf8 name(isolate, name_str);
// We support passing one additional trace event argument with the
// name "data". Any JSON serializable value may be passed.
static const char* arg_name = "data";
int32_t num_args = 0;
uint8_t arg_type;
uint64_t arg_value;
if (!data_arg->IsUndefined(isolate)) {
// Serializes the data argument as a JSON string, which is then
// copied into an object. This eliminates duplicated code but
// could have perf costs. It is also subject to all the same
// limitations as JSON.stringify() as it relates to circular
// references and value limitations (e.g. BigInt is not supported).
Handle<Object> result;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, result,
JsonStringify(isolate, data_arg, isolate->factory()->undefined_value(),
isolate->factory()->undefined_value()));
std::unique_ptr<JsonTraceValue> traced_value;
traced_value.reset(
new JsonTraceValue(isolate, Handle<String>::cast(result)));
tracing::SetTraceValue(std::move(traced_value), &arg_type, &arg_value);
num_args++;
}
TRACE_EVENT_API_ADD_TRACE_EVENT(
static_cast<char>(DoubleToInt32(phase_arg->Number())),
category_group_enabled, *name, tracing::kGlobalScope, id, tracing::kNoId,
num_args, &arg_name, &arg_type, &arg_value, flags);
return ReadOnlyRoots(isolate).true_value();
}
} // namespace internal
} // namespace v8
```
|
Lowndes Academy is an independent school in Lowndesboro, Alabama.
History
Lowndes Academy was founded in 1966 as a segregation academy. The school was established by white parents who were boycotting racially integrated public schools in Hayneville. In a 1968 interview, headmaster S. M. Champion said that he "didn't know" if the school would admit a qualified black student.
In the school's early days, the school relied on revenue from football games to fund school operations.
Accreditation
Lowndes Academy is accredited by the Alabama Independent School Association.
Demographics
Of 241 non-prekindergarten students enrolled in the 2009–2010 school year, 239 were white and 2 were black. The 2010 demographic profile of Lowndes County, where the school is located, showed the population as 25.5% white and 73.8% black.
References
External links
Lowndes Academy
Educational institutions established in 1966
Segregation academies in Alabama
Private high schools in Alabama
1966 establishments in Alabama
|
```javascript
/*!
* Select2 4.0.6-rc.1
* path_to_url
*
* Released under the MIT license
* path_to_url
*/
;(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node/CommonJS
module.exports = function (root, jQuery) {
if (jQuery === undefined) {
// require('jQuery') returns a factory that requires window to
// build a jQuery instance, we normalize how we use modules
// that require this pattern but the window provided is a noop
// if it's defined (how jquery works)
if (typeof window !== 'undefined') {
jQuery = require('jquery');
}
else {
jQuery = require('jquery')(root);
}
}
factory(jQuery);
return jQuery;
};
} else {
// Browser globals
factory(jQuery);
}
} (function (jQuery) {
// This is needed so we can catch the AMD loader configuration and use it
// The inner file should be wrapped (by `banner.start.js`) in a function that
// returns the AMD loader references.
var S2 =(function () {
// Restore the Select2 AMD loader so it can be used
// Needed mostly in the language files, where the loader is not inserted
if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
var S2 = jQuery.fn.select2.amd;
}
var S2;(function () { if (!S2 || !S2.requirejs) {
if (!S2) { S2 = {}; } else { require = S2; }
/**
* Released under MIT license, path_to_url
*/
//Going sloppy to avoid 'use strict' string cost, but strict practices should
//be followed.
/*global setTimeout: false */
var requirejs, require, define;
(function (undef) {
var main, req, makeMap, handlers,
defined = {},
waiting = {},
config = {},
defining = {},
hasOwn = Object.prototype.hasOwnProperty,
aps = [].slice,
jsSuffixRegExp = /\.js$/;
function hasProp(obj, prop) {
return hasOwn.call(obj, prop);
}
/**
* Given a relative module name, like ./something, normalize it to
* a real name that can be mapped to a path.
* @param {String} name the relative name
* @param {String} baseName a real name that the name arg is relative
* to.
* @returns {String} normalized name
*/
function normalize(name, baseName) {
var nameParts, nameSegment, mapValue, foundMap, lastIndex,
foundI, foundStarMap, starI, i, j, part, normalizedBaseParts,
baseParts = baseName && baseName.split("/"),
map = config.map,
starMap = (map && map['*']) || {};
//Adjust any relative paths.
if (name) {
name = name.split('/');
lastIndex = name.length - 1;
// If wanting node ID compatibility, strip .js from end
// of IDs. Have to do this here, and not in nameToUrl
// because node allows either .js or non .js to map
// to same file.
if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
}
// Starts with a '.' so need the baseName
if (name[0].charAt(0) === '.' && baseParts) {
//Convert baseName to array, and lop off the last part,
//so that . matches that 'directory' and not name of the baseName's
//module. For instance, baseName of 'one/two/three', maps to
//'one/two/three.js', but we want the directory, 'one/two' for
//this normalization.
normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
name = normalizedBaseParts.concat(name);
}
//start trimDots
for (i = 0; i < name.length; i++) {
part = name[i];
if (part === '.') {
name.splice(i, 1);
i -= 1;
} else if (part === '..') {
// If at the start, or previous value is still ..,
// keep them so that when converted to a path it may
// still work when converted to a path, even though
// as an ID it is less than ideal. In larger point
// releases, may be better to just kick out an error.
if (i === 0 || (i === 1 && name[2] === '..') || name[i - 1] === '..') {
continue;
} else if (i > 0) {
name.splice(i - 1, 2);
i -= 2;
}
}
}
//end trimDots
name = name.join('/');
}
//Apply map config if available.
if ((baseParts || starMap) && map) {
nameParts = name.split('/');
for (i = nameParts.length; i > 0; i -= 1) {
nameSegment = nameParts.slice(0, i).join("/");
if (baseParts) {
//Find the longest baseName segment match in the config.
//So, do joins on the biggest to smallest lengths of baseParts.
for (j = baseParts.length; j > 0; j -= 1) {
mapValue = map[baseParts.slice(0, j).join('/')];
//baseName segment has config, find if it has one for
//this name.
if (mapValue) {
mapValue = mapValue[nameSegment];
if (mapValue) {
//Match, update name to the new value.
foundMap = mapValue;
foundI = i;
break;
}
}
}
}
if (foundMap) {
break;
}
//Check for a star map match, but just hold on to it,
//if there is a shorter segment match later in a matching
//config, then favor over this star map.
if (!foundStarMap && starMap && starMap[nameSegment]) {
foundStarMap = starMap[nameSegment];
starI = i;
}
}
if (!foundMap && foundStarMap) {
foundMap = foundStarMap;
foundI = starI;
}
if (foundMap) {
nameParts.splice(0, foundI, foundMap);
name = nameParts.join('/');
}
}
return name;
}
function makeRequire(relName, forceSync) {
return function () {
//A version of a require function that passes a moduleName
//value for items that may need to
//look up paths relative to the moduleName
var args = aps.call(arguments, 0);
//If first arg is not require('string'), and there is only
//one arg, it is the array form without a callback. Insert
//a null so that the following concat is correct.
if (typeof args[0] !== 'string' && args.length === 1) {
args.push(null);
}
return req.apply(undef, args.concat([relName, forceSync]));
};
}
function makeNormalize(relName) {
return function (name) {
return normalize(name, relName);
};
}
function makeLoad(depName) {
return function (value) {
defined[depName] = value;
};
}
function callDep(name) {
if (hasProp(waiting, name)) {
var args = waiting[name];
delete waiting[name];
defining[name] = true;
main.apply(undef, args);
}
if (!hasProp(defined, name) && !hasProp(defining, name)) {
throw new Error('No ' + name);
}
return defined[name];
}
//Turns a plugin!resource to [plugin, resource]
//with the plugin being undefined if the name
//did not have a plugin prefix.
function splitPrefix(name) {
var prefix,
index = name ? name.indexOf('!') : -1;
if (index > -1) {
prefix = name.substring(0, index);
name = name.substring(index + 1, name.length);
}
return [prefix, name];
}
//Creates a parts array for a relName where first part is plugin ID,
//second part is resource ID. Assumes relName has already been normalized.
function makeRelParts(relName) {
return relName ? splitPrefix(relName) : [];
}
/**
* Makes a name map, normalizing the name, and using a plugin
* for normalization if necessary. Grabs a ref to plugin
* too, as an optimization.
*/
makeMap = function (name, relParts) {
var plugin,
parts = splitPrefix(name),
prefix = parts[0],
relResourceName = relParts[1];
name = parts[1];
if (prefix) {
prefix = normalize(prefix, relResourceName);
plugin = callDep(prefix);
}
//Normalize according
if (prefix) {
if (plugin && plugin.normalize) {
name = plugin.normalize(name, makeNormalize(relResourceName));
} else {
name = normalize(name, relResourceName);
}
} else {
name = normalize(name, relResourceName);
parts = splitPrefix(name);
prefix = parts[0];
name = parts[1];
if (prefix) {
plugin = callDep(prefix);
}
}
//Using ridiculous property names for space reasons
return {
f: prefix ? prefix + '!' + name : name, //fullName
n: name,
pr: prefix,
p: plugin
};
};
function makeConfig(name) {
return function () {
return (config && config.config && config.config[name]) || {};
};
}
handlers = {
require: function (name) {
return makeRequire(name);
},
exports: function (name) {
var e = defined[name];
if (typeof e !== 'undefined') {
return e;
} else {
return (defined[name] = {});
}
},
module: function (name) {
return {
id: name,
uri: '',
exports: defined[name],
config: makeConfig(name)
};
}
};
main = function (name, deps, callback, relName) {
var cjsModule, depName, ret, map, i, relParts,
args = [],
callbackType = typeof callback,
usingExports;
//Use name if no relName
relName = relName || name;
relParts = makeRelParts(relName);
//Call the callback to define the module, if necessary.
if (callbackType === 'undefined' || callbackType === 'function') {
//Pull out the defined dependencies and pass the ordered
//values to the callback.
//Default to [require, exports, module] if no deps
deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
for (i = 0; i < deps.length; i += 1) {
map = makeMap(deps[i], relParts);
depName = map.f;
//Fast path CommonJS standard dependencies.
if (depName === "require") {
args[i] = handlers.require(name);
} else if (depName === "exports") {
//CommonJS module spec 1.1
args[i] = handlers.exports(name);
usingExports = true;
} else if (depName === "module") {
//CommonJS module spec 1.1
cjsModule = args[i] = handlers.module(name);
} else if (hasProp(defined, depName) ||
hasProp(waiting, depName) ||
hasProp(defining, depName)) {
args[i] = callDep(depName);
} else if (map.p) {
map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
args[i] = defined[depName];
} else {
throw new Error(name + ' missing ' + depName);
}
}
ret = callback ? callback.apply(defined[name], args) : undefined;
if (name) {
//If setting exports via "module" is in play,
//favor that over return value and exports. After that,
//favor a non-undefined return value over exports use.
if (cjsModule && cjsModule.exports !== undef &&
cjsModule.exports !== defined[name]) {
defined[name] = cjsModule.exports;
} else if (ret !== undef || !usingExports) {
//Use the return value from the function.
defined[name] = ret;
}
}
} else if (name) {
//May just be an object definition for the module. Only
//worry about defining if have a module name.
defined[name] = callback;
}
};
requirejs = require = req = function (deps, callback, relName, forceSync, alt) {
if (typeof deps === "string") {
if (handlers[deps]) {
//callback in this case is really relName
return handlers[deps](callback);
}
//Just return the module wanted. In this scenario, the
//deps arg is the module name, and second arg (if passed)
//is just the relName.
//Normalize module name, if it contains . or ..
return callDep(makeMap(deps, makeRelParts(callback)).f);
} else if (!deps.splice) {
//deps is a config object, not an array.
config = deps;
if (config.deps) {
req(config.deps, config.callback);
}
if (!callback) {
return;
}
if (callback.splice) {
//callback is an array, which means it is a dependency list.
//Adjust args if there are dependencies
deps = callback;
callback = relName;
relName = null;
} else {
deps = undef;
}
}
//Support require(['a'])
callback = callback || function () {};
//If relName is a function, it is an errback handler,
//so remove it.
if (typeof relName === 'function') {
relName = forceSync;
forceSync = alt;
}
//Simulate async callback;
if (forceSync) {
main(undef, deps, callback, relName);
} else {
//Using a non-zero value because of concern for what old browsers
//do, and latest browsers "upgrade" to 4 if lower value is used:
//path_to_url#dom-windowtimers-settimeout:
//If want a value immediately, use require('id') instead -- something
//that works in almond on the global level, but not guaranteed and
//unlikely to work in other AMD implementations.
setTimeout(function () {
main(undef, deps, callback, relName);
}, 4);
}
return req;
};
/**
* Just drops the config on the floor, but returns req in case
* the config return value is used.
*/
req.config = function (cfg) {
return req(cfg);
};
/**
* Expose module registry for debugging and tooling
*/
requirejs._defined = defined;
define = function (name, deps, callback) {
if (typeof name !== 'string') {
throw new Error('See almond README: incorrect module build, no module name');
}
//This module may not have dependencies
if (!deps.splice) {
//deps is not an array, so probably means
//an object literal or factory function for
//the value. Adjust args.
callback = deps;
deps = [];
}
if (!hasProp(defined, name) && !hasProp(waiting, name)) {
waiting[name] = [name, deps, callback];
}
};
define.amd = {
jQuery: true
};
}());
S2.requirejs = requirejs;S2.require = require;S2.define = define;
}
}());
S2.define("almond", function(){});
/* global jQuery:false, $:false */
S2.define('jquery',[],function () {
var _$ = jQuery || $;
if (_$ == null && console && console.error) {
console.error(
'Select2: An instance of jQuery or a jQuery-compatible library was not ' +
'found. Make sure that you are including jQuery before Select2 on your ' +
'web page.'
);
}
return _$;
});
S2.define('select2/utils',[
'jquery'
], function ($) {
var Utils = {};
Utils.Extend = function (ChildClass, SuperClass) {
var __hasProp = {}.hasOwnProperty;
function BaseConstructor () {
this.constructor = ChildClass;
}
for (var key in SuperClass) {
if (__hasProp.call(SuperClass, key)) {
ChildClass[key] = SuperClass[key];
}
}
BaseConstructor.prototype = SuperClass.prototype;
ChildClass.prototype = new BaseConstructor();
ChildClass.__super__ = SuperClass.prototype;
return ChildClass;
};
function getMethods (theClass) {
var proto = theClass.prototype;
var methods = [];
for (var methodName in proto) {
var m = proto[methodName];
if (typeof m !== 'function') {
continue;
}
if (methodName === 'constructor') {
continue;
}
methods.push(methodName);
}
return methods;
}
Utils.Decorate = function (SuperClass, DecoratorClass) {
var decoratedMethods = getMethods(DecoratorClass);
var superMethods = getMethods(SuperClass);
function DecoratedClass () {
var unshift = Array.prototype.unshift;
var argCount = DecoratorClass.prototype.constructor.length;
var calledConstructor = SuperClass.prototype.constructor;
if (argCount > 0) {
unshift.call(arguments, SuperClass.prototype.constructor);
calledConstructor = DecoratorClass.prototype.constructor;
}
calledConstructor.apply(this, arguments);
}
DecoratorClass.displayName = SuperClass.displayName;
function ctr () {
this.constructor = DecoratedClass;
}
DecoratedClass.prototype = new ctr();
for (var m = 0; m < superMethods.length; m++) {
var superMethod = superMethods[m];
DecoratedClass.prototype[superMethod] =
SuperClass.prototype[superMethod];
}
var calledMethod = function (methodName) {
// Stub out the original method if it's not decorating an actual method
var originalMethod = function () {};
if (methodName in DecoratedClass.prototype) {
originalMethod = DecoratedClass.prototype[methodName];
}
var decoratedMethod = DecoratorClass.prototype[methodName];
return function () {
var unshift = Array.prototype.unshift;
unshift.call(arguments, originalMethod);
return decoratedMethod.apply(this, arguments);
};
};
for (var d = 0; d < decoratedMethods.length; d++) {
var decoratedMethod = decoratedMethods[d];
DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod);
}
return DecoratedClass;
};
var Observable = function () {
this.listeners = {};
};
Observable.prototype.on = function (event, callback) {
this.listeners = this.listeners || {};
if (event in this.listeners) {
this.listeners[event].push(callback);
} else {
this.listeners[event] = [callback];
}
};
Observable.prototype.trigger = function (event) {
var slice = Array.prototype.slice;
var params = slice.call(arguments, 1);
this.listeners = this.listeners || {};
// Params should always come in as an array
if (params == null) {
params = [];
}
// If there are no arguments to the event, use a temporary object
if (params.length === 0) {
params.push({});
}
// Set the `_type` of the first object to the event
params[0]._type = event;
if (event in this.listeners) {
this.invoke(this.listeners[event], slice.call(arguments, 1));
}
if ('*' in this.listeners) {
this.invoke(this.listeners['*'], arguments);
}
};
Observable.prototype.invoke = function (listeners, params) {
for (var i = 0, len = listeners.length; i < len; i++) {
listeners[i].apply(this, params);
}
};
Utils.Observable = Observable;
Utils.generateChars = function (length) {
var chars = '';
for (var i = 0; i < length; i++) {
var randomChar = Math.floor(Math.random() * 36);
chars += randomChar.toString(36);
}
return chars;
};
Utils.bind = function (func, context) {
return function () {
func.apply(context, arguments);
};
};
Utils._convertData = function (data) {
for (var originalKey in data) {
var keys = originalKey.split('-');
var dataLevel = data;
if (keys.length === 1) {
continue;
}
for (var k = 0; k < keys.length; k++) {
var key = keys[k];
// Lowercase the first letter
// By default, dash-separated becomes camelCase
key = key.substring(0, 1).toLowerCase() + key.substring(1);
if (!(key in dataLevel)) {
dataLevel[key] = {};
}
if (k == keys.length - 1) {
dataLevel[key] = data[originalKey];
}
dataLevel = dataLevel[key];
}
delete data[originalKey];
}
return data;
};
Utils.hasScroll = function (index, el) {
// Adapted from the function created by @ShadowScripter
// and adapted by @BillBarry on the Stack Exchange Code Review website.
// The original code can be found at
// path_to_url
// and was designed to be used with the Sizzle selector engine.
var $el = $(el);
var overflowX = el.style.overflowX;
var overflowY = el.style.overflowY;
//Check both x and y declarations
if (overflowX === overflowY &&
(overflowY === 'hidden' || overflowY === 'visible')) {
return false;
}
if (overflowX === 'scroll' || overflowY === 'scroll') {
return true;
}
return ($el.innerHeight() < el.scrollHeight ||
$el.innerWidth() < el.scrollWidth);
};
Utils.escapeMarkup = function (markup) {
var replaceMap = {
'\\': '\',
'&': '&',
'<': '<',
'>': '>',
'"': '"',
'\'': ''',
'/': '/'
};
// Do not try to escape the markup if it's not a string
if (typeof markup !== 'string') {
return markup;
}
return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
return replaceMap[match];
});
};
// Append an array of jQuery nodes to a given element.
Utils.appendMany = function ($element, $nodes) {
// jQuery 1.7.x does not support $.fn.append() with an array
// Fall back to a jQuery object collection using $.fn.add()
if ($.fn.jquery.substr(0, 3) === '1.7') {
var $jqNodes = $();
$.map($nodes, function (node) {
$jqNodes = $jqNodes.add(node);
});
$nodes = $jqNodes;
}
$element.append($nodes);
};
// Cache objects in Utils.__cache instead of $.data (see #4346)
Utils.__cache = {};
var id = 0;
Utils.GetUniqueElementId = function (element) {
// Get a unique element Id. If element has no id,
// creates a new unique number, stores it in the id
// attribute and returns the new id.
// If an id already exists, it simply returns it.
var select2Id = element.getAttribute('data-select2-id');
if (select2Id == null) {
// If element has id, use it.
if (element.id) {
select2Id = element.id;
element.setAttribute('data-select2-id', select2Id);
} else {
element.setAttribute('data-select2-id', ++id);
select2Id = id.toString();
}
}
return select2Id;
};
Utils.StoreData = function (element, name, value) {
// Stores an item in the cache for a specified element.
// name is the cache key.
var id = Utils.GetUniqueElementId(element);
if (!Utils.__cache[id]) {
Utils.__cache[id] = {};
}
Utils.__cache[id][name] = value;
};
Utils.GetData = function (element, name) {
// Retrieves a value from the cache by its key (name)
// name is optional. If no name specified, return
// all cache items for the specified element.
// and for a specified element.
var id = Utils.GetUniqueElementId(element);
if (name) {
if (Utils.__cache[id]) {
return Utils.__cache[id][name] != null ?
Utils.__cache[id][name]:
$(element).data(name); // Fallback to HTML5 data attribs.
}
return $(element).data(name); // Fallback to HTML5 data attribs.
} else {
return Utils.__cache[id];
}
};
Utils.RemoveData = function (element) {
// Removes all cached items for a specified element.
var id = Utils.GetUniqueElementId(element);
if (Utils.__cache[id] != null) {
delete Utils.__cache[id];
}
};
return Utils;
});
S2.define('select2/results',[
'jquery',
'./utils'
], function ($, Utils) {
function Results ($element, options, dataAdapter) {
this.$element = $element;
this.data = dataAdapter;
this.options = options;
Results.__super__.constructor.call(this);
}
Utils.Extend(Results, Utils.Observable);
Results.prototype.render = function () {
var $results = $(
'<ul class="select2-results__options" role="tree"></ul>'
);
if (this.options.get('multiple')) {
$results.attr('aria-multiselectable', 'true');
}
this.$results = $results;
return $results;
};
Results.prototype.clear = function () {
this.$results.empty();
};
Results.prototype.displayMessage = function (params) {
var escapeMarkup = this.options.get('escapeMarkup');
this.clear();
this.hideLoading();
var $message = $(
'<li role="treeitem" aria-live="assertive"' +
' class="select2-results__option"></li>'
);
var message = this.options.get('translations').get(params.message);
$message.append(
escapeMarkup(
message(params.args)
)
);
$message[0].className += ' select2-results__message';
this.$results.append($message);
};
Results.prototype.hideMessages = function () {
this.$results.find('.select2-results__message').remove();
};
Results.prototype.append = function (data) {
this.hideLoading();
var $options = [];
if (data.results == null || data.results.length === 0) {
if (this.$results.children().length === 0) {
this.trigger('results:message', {
message: 'noResults'
});
}
return;
}
data.results = this.sort(data.results);
for (var d = 0; d < data.results.length; d++) {
var item = data.results[d];
var $option = this.option(item);
$options.push($option);
}
this.$results.append($options);
};
Results.prototype.position = function ($results, $dropdown) {
var $resultsContainer = $dropdown.find('.select2-results');
$resultsContainer.append($results);
};
Results.prototype.sort = function (data) {
var sorter = this.options.get('sorter');
return sorter(data);
};
Results.prototype.highlightFirstItem = function () {
var $options = this.$results
.find('.select2-results__option[aria-selected]');
var $selected = $options.filter('[aria-selected=true]');
// Check if there are any selected options
if ($selected.length > 0) {
// If there are selected options, highlight the first
$selected.first().trigger('mouseenter');
} else {
// If there are no selected options, highlight the first option
// in the dropdown
$options.first().trigger('mouseenter');
}
this.ensureHighlightVisible();
};
Results.prototype.setClasses = function () {
var self = this;
this.data.current(function (selected) {
var selectedIds = $.map(selected, function (s) {
return s.id.toString();
});
var $options = self.$results
.find('.select2-results__option[aria-selected]');
$options.each(function () {
var $option = $(this);
var item = Utils.GetData(this, 'data');
// id needs to be converted to a string when comparing
var id = '' + item.id;
if ((item.element != null && item.element.selected) ||
(item.element == null && $.inArray(id, selectedIds) > -1)) {
$option.attr('aria-selected', 'true');
} else {
$option.attr('aria-selected', 'false');
}
});
});
};
Results.prototype.showLoading = function (params) {
this.hideLoading();
var loadingMore = this.options.get('translations').get('searching');
var loading = {
disabled: true,
loading: true,
text: loadingMore(params)
};
var $loading = this.option(loading);
$loading.className += ' loading-results';
this.$results.prepend($loading);
};
Results.prototype.hideLoading = function () {
this.$results.find('.loading-results').remove();
};
Results.prototype.option = function (data) {
var option = document.createElement('li');
option.className = 'select2-results__option';
var attrs = {
'role': 'treeitem',
'aria-selected': 'false'
};
if (data.disabled) {
delete attrs['aria-selected'];
attrs['aria-disabled'] = 'true';
}
if (data.id == null) {
delete attrs['aria-selected'];
}
if (data._resultId != null) {
option.id = data._resultId;
}
if (data.title) {
option.title = data.title;
}
if (data.children) {
attrs.role = 'group';
attrs['aria-label'] = data.text;
delete attrs['aria-selected'];
}
for (var attr in attrs) {
var val = attrs[attr];
option.setAttribute(attr, val);
}
if (data.children) {
var $option = $(option);
var label = document.createElement('strong');
label.className = 'select2-results__group';
var $label = $(label);
this.template(data, label);
var $children = [];
for (var c = 0; c < data.children.length; c++) {
var child = data.children[c];
var $child = this.option(child);
$children.push($child);
}
var $childrenContainer = $('<ul></ul>', {
'class': 'select2-results__options select2-results__options--nested'
});
$childrenContainer.append($children);
$option.append(label);
$option.append($childrenContainer);
} else {
this.template(data, option);
}
Utils.StoreData(option, 'data', data);
return option;
};
Results.prototype.bind = function (container, $container) {
var self = this;
var id = container.id + '-results';
this.$results.attr('id', id);
container.on('results:all', function (params) {
self.clear();
self.append(params.data);
if (container.isOpen()) {
self.setClasses();
self.highlightFirstItem();
}
});
container.on('results:append', function (params) {
self.append(params.data);
if (container.isOpen()) {
self.setClasses();
}
});
container.on('query', function (params) {
self.hideMessages();
self.showLoading(params);
});
container.on('select', function () {
if (!container.isOpen()) {
return;
}
self.setClasses();
self.highlightFirstItem();
});
container.on('unselect', function () {
if (!container.isOpen()) {
return;
}
self.setClasses();
self.highlightFirstItem();
});
container.on('open', function () {
// When the dropdown is open, aria-expended="true"
self.$results.attr('aria-expanded', 'true');
self.$results.attr('aria-hidden', 'false');
self.setClasses();
self.ensureHighlightVisible();
});
container.on('close', function () {
// When the dropdown is closed, aria-expended="false"
self.$results.attr('aria-expanded', 'false');
self.$results.attr('aria-hidden', 'true');
self.$results.removeAttr('aria-activedescendant');
});
container.on('results:toggle', function () {
var $highlighted = self.getHighlightedResults();
if ($highlighted.length === 0) {
return;
}
$highlighted.trigger('mouseup');
});
container.on('results:select', function () {
var $highlighted = self.getHighlightedResults();
if ($highlighted.length === 0) {
return;
}
var data = Utils.GetData($highlighted[0], 'data');
if ($highlighted.attr('aria-selected') == 'true') {
self.trigger('close', {});
} else {
self.trigger('select', {
data: data
});
}
});
container.on('results:previous', function () {
var $highlighted = self.getHighlightedResults();
var $options = self.$results.find('[aria-selected]');
var currentIndex = $options.index($highlighted);
// If we are already at te top, don't move further
// If no options, currentIndex will be -1
if (currentIndex <= 0) {
return;
}
var nextIndex = currentIndex - 1;
// If none are highlighted, highlight the first
if ($highlighted.length === 0) {
nextIndex = 0;
}
var $next = $options.eq(nextIndex);
$next.trigger('mouseenter');
var currentOffset = self.$results.offset().top;
var nextTop = $next.offset().top;
var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset);
if (nextIndex === 0) {
self.$results.scrollTop(0);
} else if (nextTop - currentOffset < 0) {
self.$results.scrollTop(nextOffset);
}
});
container.on('results:next', function () {
var $highlighted = self.getHighlightedResults();
var $options = self.$results.find('[aria-selected]');
var currentIndex = $options.index($highlighted);
var nextIndex = currentIndex + 1;
// If we are at the last option, stay there
if (nextIndex >= $options.length) {
return;
}
var $next = $options.eq(nextIndex);
$next.trigger('mouseenter');
var currentOffset = self.$results.offset().top +
self.$results.outerHeight(false);
var nextBottom = $next.offset().top + $next.outerHeight(false);
var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset;
if (nextIndex === 0) {
self.$results.scrollTop(0);
} else if (nextBottom > currentOffset) {
self.$results.scrollTop(nextOffset);
}
});
container.on('results:focus', function (params) {
params.element.addClass('select2-results__option--highlighted');
});
container.on('results:message', function (params) {
self.displayMessage(params);
});
if ($.fn.mousewheel) {
this.$results.on('mousewheel', function (e) {
var top = self.$results.scrollTop();
var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
if (isAtTop) {
self.$results.scrollTop(0);
e.preventDefault();
e.stopPropagation();
} else if (isAtBottom) {
self.$results.scrollTop(
self.$results.get(0).scrollHeight - self.$results.height()
);
e.preventDefault();
e.stopPropagation();
}
});
}
this.$results.on('mouseup', '.select2-results__option[aria-selected]',
function (evt) {
var $this = $(this);
var data = Utils.GetData(this, 'data');
if ($this.attr('aria-selected') === 'true') {
if (self.options.get('multiple')) {
self.trigger('unselect', {
originalEvent: evt,
data: data
});
} else {
self.trigger('close', {});
}
return;
}
self.trigger('select', {
originalEvent: evt,
data: data
});
});
this.$results.on('mouseenter', '.select2-results__option[aria-selected]',
function (evt) {
var data = Utils.GetData(this, 'data');
self.getHighlightedResults()
.removeClass('select2-results__option--highlighted');
self.trigger('results:focus', {
data: data,
element: $(this)
});
});
};
Results.prototype.getHighlightedResults = function () {
var $highlighted = this.$results
.find('.select2-results__option--highlighted');
return $highlighted;
};
Results.prototype.destroy = function () {
this.$results.remove();
};
Results.prototype.ensureHighlightVisible = function () {
var $highlighted = this.getHighlightedResults();
if ($highlighted.length === 0) {
return;
}
var $options = this.$results.find('[aria-selected]');
var currentIndex = $options.index($highlighted);
var currentOffset = this.$results.offset().top;
var nextTop = $highlighted.offset().top;
var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset);
var offsetDelta = nextTop - currentOffset;
nextOffset -= $highlighted.outerHeight(false) * 2;
if (currentIndex <= 2) {
this.$results.scrollTop(0);
} else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) {
this.$results.scrollTop(nextOffset);
}
};
Results.prototype.template = function (result, container) {
var template = this.options.get('templateResult');
var escapeMarkup = this.options.get('escapeMarkup');
var content = template(result, container);
if (content == null) {
container.style.display = 'none';
} else if (typeof content === 'string') {
container.innerHTML = escapeMarkup(content);
} else {
$(container).append(content);
}
};
return Results;
});
S2.define('select2/keys',[
], function () {
var KEYS = {
BACKSPACE: 8,
TAB: 9,
ENTER: 13,
SHIFT: 16,
CTRL: 17,
ALT: 18,
ESC: 27,
SPACE: 32,
PAGE_UP: 33,
PAGE_DOWN: 34,
END: 35,
HOME: 36,
LEFT: 37,
UP: 38,
RIGHT: 39,
DOWN: 40,
DELETE: 46
};
return KEYS;
});
S2.define('select2/selection/base',[
'jquery',
'../utils',
'../keys'
], function ($, Utils, KEYS) {
function BaseSelection ($element, options) {
this.$element = $element;
this.options = options;
BaseSelection.__super__.constructor.call(this);
}
Utils.Extend(BaseSelection, Utils.Observable);
BaseSelection.prototype.render = function () {
var $selection = $(
'<span class="select2-selection" role="combobox" ' +
' aria-haspopup="true" aria-expanded="false">' +
'</span>'
);
this._tabindex = 0;
if (Utils.GetData(this.$element[0], 'old-tabindex') != null) {
this._tabindex = Utils.GetData(this.$element[0], 'old-tabindex');
} else if (this.$element.attr('tabindex') != null) {
this._tabindex = this.$element.attr('tabindex');
}
$selection.attr('title', this.$element.attr('title'));
$selection.attr('tabindex', this._tabindex);
this.$selection = $selection;
return $selection;
};
BaseSelection.prototype.bind = function (container, $container) {
var self = this;
var id = container.id + '-container';
var resultsId = container.id + '-results';
this.container = container;
this.$selection.on('focus', function (evt) {
self.trigger('focus', evt);
});
this.$selection.on('blur', function (evt) {
self._handleBlur(evt);
});
this.$selection.on('keydown', function (evt) {
self.trigger('keypress', evt);
if (evt.which === KEYS.SPACE) {
evt.preventDefault();
}
});
container.on('results:focus', function (params) {
self.$selection.attr('aria-activedescendant', params.data._resultId);
});
container.on('selection:update', function (params) {
self.update(params.data);
});
container.on('open', function () {
// When the dropdown is open, aria-expanded="true"
self.$selection.attr('aria-expanded', 'true');
self.$selection.attr('aria-owns', resultsId);
self._attachCloseHandler(container);
});
container.on('close', function () {
// When the dropdown is closed, aria-expanded="false"
self.$selection.attr('aria-expanded', 'false');
self.$selection.removeAttr('aria-activedescendant');
self.$selection.removeAttr('aria-owns');
self.$selection.focus();
window.setTimeout(function () {
self.$selection.focus();
}, 0);
self._detachCloseHandler(container);
});
container.on('enable', function () {
self.$selection.attr('tabindex', self._tabindex);
});
container.on('disable', function () {
self.$selection.attr('tabindex', '-1');
});
};
BaseSelection.prototype._handleBlur = function (evt) {
var self = this;
// This needs to be delayed as the active element is the body when the tab
// key is pressed, possibly along with others.
window.setTimeout(function () {
// Don't trigger `blur` if the focus is still in the selection
if (
(document.activeElement == self.$selection[0]) ||
($.contains(self.$selection[0], document.activeElement))
) {
return;
}
self.trigger('blur', evt);
}, 1);
};
BaseSelection.prototype._attachCloseHandler = function (container) {
var self = this;
$(document.body).on('mousedown.select2.' + container.id, function (e) {
var $target = $(e.target);
var $select = $target.closest('.select2');
var $all = $('.select2.select2-container--open');
$all.each(function () {
var $this = $(this);
if (this == $select[0]) {
return;
}
var $element = Utils.GetData(this, 'element');
$element.select2('close');
});
});
};
BaseSelection.prototype._detachCloseHandler = function (container) {
$(document.body).off('mousedown.select2.' + container.id);
};
BaseSelection.prototype.position = function ($selection, $container) {
var $selectionContainer = $container.find('.selection');
$selectionContainer.append($selection);
};
BaseSelection.prototype.destroy = function () {
this._detachCloseHandler(this.container);
};
BaseSelection.prototype.update = function (data) {
throw new Error('The `update` method must be defined in child classes.');
};
return BaseSelection;
});
S2.define('select2/selection/single',[
'jquery',
'./base',
'../utils',
'../keys'
], function ($, BaseSelection, Utils, KEYS) {
function SingleSelection () {
SingleSelection.__super__.constructor.apply(this, arguments);
}
Utils.Extend(SingleSelection, BaseSelection);
SingleSelection.prototype.render = function () {
var $selection = SingleSelection.__super__.render.call(this);
$selection.addClass('select2-selection--single');
$selection.html(
'<span class="select2-selection__rendered"></span>' +
'<span class="select2-selection__arrow" role="presentation">' +
'<b role="presentation"></b>' +
'</span>'
);
return $selection;
};
SingleSelection.prototype.bind = function (container, $container) {
var self = this;
SingleSelection.__super__.bind.apply(this, arguments);
var id = container.id + '-container';
this.$selection.find('.select2-selection__rendered')
.attr('id', id)
.attr('role', 'textbox')
.attr('aria-readonly', 'true');
this.$selection.attr('aria-labelledby', id);
this.$selection.on('mousedown', function (evt) {
// Only respond to left clicks
if (evt.which !== 1) {
return;
}
self.trigger('toggle', {
originalEvent: evt
});
});
this.$selection.on('focus', function (evt) {
// User focuses on the container
});
this.$selection.on('blur', function (evt) {
// User exits the container
});
container.on('focus', function (evt) {
if (!container.isOpen()) {
self.$selection.focus();
}
});
};
SingleSelection.prototype.clear = function () {
var $rendered = this.$selection.find('.select2-selection__rendered');
$rendered.empty();
$rendered.removeAttr('title'); // clear tooltip on empty
};
SingleSelection.prototype.display = function (data, container) {
var template = this.options.get('templateSelection');
var escapeMarkup = this.options.get('escapeMarkup');
return escapeMarkup(template(data, container));
};
SingleSelection.prototype.selectionContainer = function () {
return $('<span></span>');
};
SingleSelection.prototype.update = function (data) {
if (data.length === 0) {
this.clear();
return;
}
var selection = data[0];
var $rendered = this.$selection.find('.select2-selection__rendered');
var formatted = this.display(selection, $rendered);
$rendered.empty().append(formatted);
$rendered.attr('title', selection.title || selection.text);
};
return SingleSelection;
});
S2.define('select2/selection/multiple',[
'jquery',
'./base',
'../utils'
], function ($, BaseSelection, Utils) {
function MultipleSelection ($element, options) {
MultipleSelection.__super__.constructor.apply(this, arguments);
}
Utils.Extend(MultipleSelection, BaseSelection);
MultipleSelection.prototype.render = function () {
var $selection = MultipleSelection.__super__.render.call(this);
$selection.addClass('select2-selection--multiple');
$selection.html(
'<ul class="select2-selection__rendered"></ul>'
);
return $selection;
};
MultipleSelection.prototype.bind = function (container, $container) {
var self = this;
MultipleSelection.__super__.bind.apply(this, arguments);
this.$selection.on('click', function (evt) {
self.trigger('toggle', {
originalEvent: evt
});
});
this.$selection.on(
'click',
'.select2-selection__choice__remove',
function (evt) {
// Ignore the event if it is disabled
if (self.options.get('disabled')) {
return;
}
var $remove = $(this);
var $selection = $remove.parent();
var data = Utils.GetData($selection[0], 'data');
self.trigger('unselect', {
originalEvent: evt,
data: data
});
}
);
};
MultipleSelection.prototype.clear = function () {
var $rendered = this.$selection.find('.select2-selection__rendered');
$rendered.empty();
$rendered.removeAttr('title');
};
MultipleSelection.prototype.display = function (data, container) {
var template = this.options.get('templateSelection');
var escapeMarkup = this.options.get('escapeMarkup');
return escapeMarkup(template(data, container));
};
MultipleSelection.prototype.selectionContainer = function () {
var $container = $(
'<li class="select2-selection__choice">' +
'<span class="select2-selection__choice__remove" role="presentation">' +
'×' +
'</span>' +
'</li>'
);
return $container;
};
MultipleSelection.prototype.update = function (data) {
this.clear();
if (data.length === 0) {
return;
}
var $selections = [];
for (var d = 0; d < data.length; d++) {
var selection = data[d];
var $selection = this.selectionContainer();
var formatted = this.display(selection, $selection);
$selection.append(formatted);
$selection.attr('title', selection.title || selection.text);
Utils.StoreData($selection[0], 'data', selection);
$selections.push($selection);
}
var $rendered = this.$selection.find('.select2-selection__rendered');
Utils.appendMany($rendered, $selections);
};
return MultipleSelection;
});
S2.define('select2/selection/placeholder',[
'../utils'
], function (Utils) {
function Placeholder (decorated, $element, options) {
this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
decorated.call(this, $element, options);
}
Placeholder.prototype.normalizePlaceholder = function (_, placeholder) {
if (typeof placeholder === 'string') {
placeholder = {
id: '',
text: placeholder
};
}
return placeholder;
};
Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
var $placeholder = this.selectionContainer();
$placeholder.html(this.display(placeholder));
$placeholder.addClass('select2-selection__placeholder')
.removeClass('select2-selection__choice');
return $placeholder;
};
Placeholder.prototype.update = function (decorated, data) {
var singlePlaceholder = (
data.length == 1 && data[0].id != this.placeholder.id
);
var multipleSelections = data.length > 1;
if (multipleSelections || singlePlaceholder) {
return decorated.call(this, data);
}
this.clear();
var $placeholder = this.createPlaceholder(this.placeholder);
this.$selection.find('.select2-selection__rendered').append($placeholder);
};
return Placeholder;
});
S2.define('select2/selection/allowClear',[
'jquery',
'../keys',
'../utils'
], function ($, KEYS, Utils) {
function AllowClear () { }
AllowClear.prototype.bind = function (decorated, container, $container) {
var self = this;
decorated.call(this, container, $container);
if (this.placeholder == null) {
if (this.options.get('debug') && window.console && console.error) {
console.error(
'Select2: The `allowClear` option should be used in combination ' +
'with the `placeholder` option.'
);
}
}
this.$selection.on('mousedown', '.select2-selection__clear',
function (evt) {
self._handleClear(evt);
});
container.on('keypress', function (evt) {
self._handleKeyboardClear(evt, container);
});
};
AllowClear.prototype._handleClear = function (_, evt) {
// Ignore the event if it is disabled
if (this.options.get('disabled')) {
return;
}
var $clear = this.$selection.find('.select2-selection__clear');
// Ignore the event if nothing has been selected
if ($clear.length === 0) {
return;
}
evt.stopPropagation();
var data = Utils.GetData($clear[0], 'data');
var previousVal = this.$element.val();
this.$element.val(this.placeholder.id);
var unselectData = {
data: data
};
this.trigger('clear', unselectData);
if (unselectData.prevented) {
this.$element.val(previousVal);
return;
}
for (var d = 0; d < data.length; d++) {
unselectData = {
data: data[d]
};
// Trigger the `unselect` event, so people can prevent it from being
// cleared.
this.trigger('unselect', unselectData);
// If the event was prevented, don't clear it out.
if (unselectData.prevented) {
this.$element.val(previousVal);
return;
}
}
this.$element.trigger('change');
this.trigger('toggle', {});
};
AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
if (container.isOpen()) {
return;
}
if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) {
this._handleClear(evt);
}
};
AllowClear.prototype.update = function (decorated, data) {
decorated.call(this, data);
if (this.$selection.find('.select2-selection__placeholder').length > 0 ||
data.length === 0) {
return;
}
var $remove = $(
'<span class="select2-selection__clear">' +
'×' +
'</span>'
);
Utils.StoreData($remove[0], 'data', data);
this.$selection.find('.select2-selection__rendered').prepend($remove);
};
return AllowClear;
});
S2.define('select2/selection/search',[
'jquery',
'../utils',
'../keys'
], function ($, Utils, KEYS) {
function Search (decorated, $element, options) {
decorated.call(this, $element, options);
}
Search.prototype.render = function (decorated) {
var $search = $(
'<li class="select2-search select2-search--inline">' +
'<input class="select2-search__field" type="search" tabindex="-1"' +
' autocomplete="off" autocorrect="off" autocapitalize="none"' +
' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
'</li>'
);
this.$searchContainer = $search;
this.$search = $search.find('input');
var $rendered = decorated.call(this);
this._transferTabIndex();
return $rendered;
};
Search.prototype.bind = function (decorated, container, $container) {
var self = this;
decorated.call(this, container, $container);
container.on('open', function () {
self.$search.trigger('focus');
});
container.on('close', function () {
self.$search.val('');
self.$search.removeAttr('aria-activedescendant');
self.$search.trigger('focus');
});
container.on('enable', function () {
self.$search.prop('disabled', false);
self._transferTabIndex();
});
container.on('disable', function () {
self.$search.prop('disabled', true);
});
container.on('focus', function (evt) {
self.$search.trigger('focus');
});
container.on('results:focus', function (params) {
self.$search.attr('aria-activedescendant', params.id);
});
this.$selection.on('focusin', '.select2-search--inline', function (evt) {
self.trigger('focus', evt);
});
this.$selection.on('focusout', '.select2-search--inline', function (evt) {
self._handleBlur(evt);
});
this.$selection.on('keydown', '.select2-search--inline', function (evt) {
evt.stopPropagation();
self.trigger('keypress', evt);
self._keyUpPrevented = evt.isDefaultPrevented();
var key = evt.which;
if (key === KEYS.BACKSPACE && self.$search.val() === '') {
var $previousChoice = self.$searchContainer
.prev('.select2-selection__choice');
if ($previousChoice.length > 0) {
var item = Utils.GetData($previousChoice[0], 'data');
self.searchRemoveChoice(item);
evt.preventDefault();
}
}
});
// Try to detect the IE version should the `documentMode` property that
// is stored on the document. This is only implemented in IE and is
// slightly cleaner than doing a user agent check.
// This property is not available in Edge, but Edge also doesn't have
// this bug.
var msie = document.documentMode;
var disableInputEvents = msie && msie <= 11;
// Workaround for browsers which do not support the `input` event
// This will prevent double-triggering of events for browsers which support
// both the `keyup` and `input` events.
this.$selection.on(
'input.searchcheck',
'.select2-search--inline',
function (evt) {
// IE will trigger the `input` event when a placeholder is used on a
// search box. To get around this issue, we are forced to ignore all
// `input` events in IE and keep using `keyup`.
if (disableInputEvents) {
self.$selection.off('input.search input.searchcheck');
return;
}
// Unbind the duplicated `keyup` event
self.$selection.off('keyup.search');
}
);
this.$selection.on(
'keyup.search input.search',
'.select2-search--inline',
function (evt) {
// IE will trigger the `input` event when a placeholder is used on a
// search box. To get around this issue, we are forced to ignore all
// `input` events in IE and keep using `keyup`.
if (disableInputEvents && evt.type === 'input') {
self.$selection.off('input.search input.searchcheck');
return;
}
var key = evt.which;
// We can freely ignore events from modifier keys
if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
return;
}
// Tabbing will be handled during the `keydown` phase
if (key == KEYS.TAB) {
return;
}
self.handleSearch(evt);
}
);
};
/**
* This method will transfer the tabindex attribute from the rendered
* selection to the search box. This allows for the search box to be used as
* the primary focus instead of the selection container.
*
* @private
*/
Search.prototype._transferTabIndex = function (decorated) {
this.$search.attr('tabindex', this.$selection.attr('tabindex'));
this.$selection.attr('tabindex', '-1');
};
Search.prototype.createPlaceholder = function (decorated, placeholder) {
this.$search.attr('placeholder', placeholder.text);
};
Search.prototype.update = function (decorated, data) {
var searchHadFocus = this.$search[0] == document.activeElement;
this.$search.attr('placeholder', '');
decorated.call(this, data);
this.$selection.find('.select2-selection__rendered')
.append(this.$searchContainer);
this.resizeSearch();
if (searchHadFocus) {
var isTagInput = this.$element.find('[data-select2-tag]').length;
if (isTagInput) {
// fix IE11 bug where tag input lost focus
this.$element.focus();
} else {
this.$search.focus();
}
}
};
Search.prototype.handleSearch = function () {
this.resizeSearch();
if (!this._keyUpPrevented) {
var input = this.$search.val();
this.trigger('query', {
term: input
});
}
this._keyUpPrevented = false;
};
Search.prototype.searchRemoveChoice = function (decorated, item) {
this.trigger('unselect', {
data: item
});
this.$search.val(item.text);
this.handleSearch();
};
Search.prototype.resizeSearch = function () {
this.$search.css('width', '25px');
var width = '';
if (this.$search.attr('placeholder') !== '') {
width = this.$selection.find('.select2-selection__rendered').innerWidth();
} else {
var minimumWidth = this.$search.val().length + 1;
width = (minimumWidth * 0.75) + 'em';
}
this.$search.css('width', width);
};
return Search;
});
S2.define('select2/selection/eventRelay',[
'jquery'
], function ($) {
function EventRelay () { }
EventRelay.prototype.bind = function (decorated, container, $container) {
var self = this;
var relayEvents = [
'open', 'opening',
'close', 'closing',
'select', 'selecting',
'unselect', 'unselecting',
'clear', 'clearing'
];
var preventableEvents = [
'opening', 'closing', 'selecting', 'unselecting', 'clearing'
];
decorated.call(this, container, $container);
container.on('*', function (name, params) {
// Ignore events that should not be relayed
if ($.inArray(name, relayEvents) === -1) {
return;
}
// The parameters should always be an object
params = params || {};
// Generate the jQuery event for the Select2 event
var evt = $.Event('select2:' + name, {
params: params
});
self.$element.trigger(evt);
// Only handle preventable events if it was one
if ($.inArray(name, preventableEvents) === -1) {
return;
}
params.prevented = evt.isDefaultPrevented();
});
};
return EventRelay;
});
S2.define('select2/translation',[
'jquery',
'require'
], function ($, require) {
function Translation (dict) {
this.dict = dict || {};
}
Translation.prototype.all = function () {
return this.dict;
};
Translation.prototype.get = function (key) {
return this.dict[key];
};
Translation.prototype.extend = function (translation) {
this.dict = $.extend({}, translation.all(), this.dict);
};
// Static functions
Translation._cache = {};
Translation.loadPath = function (path) {
if (!(path in Translation._cache)) {
var translations = require(path);
Translation._cache[path] = translations;
}
return new Translation(Translation._cache[path]);
};
return Translation;
});
S2.define('select2/diacritics',[
], function () {
var diacritics = {
'\u24B6': 'A',
'\uFF21': 'A',
'\u00C0': 'A',
'\u00C1': 'A',
'\u00C2': 'A',
'\u1EA6': 'A',
'\u1EA4': 'A',
'\u1EAA': 'A',
'\u1EA8': 'A',
'\u00C3': 'A',
'\u0100': 'A',
'\u0102': 'A',
'\u1EB0': 'A',
'\u1EAE': 'A',
'\u1EB4': 'A',
'\u1EB2': 'A',
'\u0226': 'A',
'\u01E0': 'A',
'\u00C4': 'A',
'\u01DE': 'A',
'\u1EA2': 'A',
'\u00C5': 'A',
'\u01FA': 'A',
'\u01CD': 'A',
'\u0200': 'A',
'\u0202': 'A',
'\u1EA0': 'A',
'\u1EAC': 'A',
'\u1EB6': 'A',
'\u1E00': 'A',
'\u0104': 'A',
'\u023A': 'A',
'\u2C6F': 'A',
'\uA732': 'AA',
'\u00C6': 'AE',
'\u01FC': 'AE',
'\u01E2': 'AE',
'\uA734': 'AO',
'\uA736': 'AU',
'\uA738': 'AV',
'\uA73A': 'AV',
'\uA73C': 'AY',
'\u24B7': 'B',
'\uFF22': 'B',
'\u1E02': 'B',
'\u1E04': 'B',
'\u1E06': 'B',
'\u0243': 'B',
'\u0182': 'B',
'\u0181': 'B',
'\u24B8': 'C',
'\uFF23': 'C',
'\u0106': 'C',
'\u0108': 'C',
'\u010A': 'C',
'\u010C': 'C',
'\u00C7': 'C',
'\u1E08': 'C',
'\u0187': 'C',
'\u023B': 'C',
'\uA73E': 'C',
'\u24B9': 'D',
'\uFF24': 'D',
'\u1E0A': 'D',
'\u010E': 'D',
'\u1E0C': 'D',
'\u1E10': 'D',
'\u1E12': 'D',
'\u1E0E': 'D',
'\u0110': 'D',
'\u018B': 'D',
'\u018A': 'D',
'\u0189': 'D',
'\uA779': 'D',
'\u01F1': 'DZ',
'\u01C4': 'DZ',
'\u01F2': 'Dz',
'\u01C5': 'Dz',
'\u24BA': 'E',
'\uFF25': 'E',
'\u00C8': 'E',
'\u00C9': 'E',
'\u00CA': 'E',
'\u1EC0': 'E',
'\u1EBE': 'E',
'\u1EC4': 'E',
'\u1EC2': 'E',
'\u1EBC': 'E',
'\u0112': 'E',
'\u1E14': 'E',
'\u1E16': 'E',
'\u0114': 'E',
'\u0116': 'E',
'\u00CB': 'E',
'\u1EBA': 'E',
'\u011A': 'E',
'\u0204': 'E',
'\u0206': 'E',
'\u1EB8': 'E',
'\u1EC6': 'E',
'\u0228': 'E',
'\u1E1C': 'E',
'\u0118': 'E',
'\u1E18': 'E',
'\u1E1A': 'E',
'\u0190': 'E',
'\u018E': 'E',
'\u24BB': 'F',
'\uFF26': 'F',
'\u1E1E': 'F',
'\u0191': 'F',
'\uA77B': 'F',
'\u24BC': 'G',
'\uFF27': 'G',
'\u01F4': 'G',
'\u011C': 'G',
'\u1E20': 'G',
'\u011E': 'G',
'\u0120': 'G',
'\u01E6': 'G',
'\u0122': 'G',
'\u01E4': 'G',
'\u0193': 'G',
'\uA7A0': 'G',
'\uA77D': 'G',
'\uA77E': 'G',
'\u24BD': 'H',
'\uFF28': 'H',
'\u0124': 'H',
'\u1E22': 'H',
'\u1E26': 'H',
'\u021E': 'H',
'\u1E24': 'H',
'\u1E28': 'H',
'\u1E2A': 'H',
'\u0126': 'H',
'\u2C67': 'H',
'\u2C75': 'H',
'\uA78D': 'H',
'\u24BE': 'I',
'\uFF29': 'I',
'\u00CC': 'I',
'\u00CD': 'I',
'\u00CE': 'I',
'\u0128': 'I',
'\u012A': 'I',
'\u012C': 'I',
'\u0130': 'I',
'\u00CF': 'I',
'\u1E2E': 'I',
'\u1EC8': 'I',
'\u01CF': 'I',
'\u0208': 'I',
'\u020A': 'I',
'\u1ECA': 'I',
'\u012E': 'I',
'\u1E2C': 'I',
'\u0197': 'I',
'\u24BF': 'J',
'\uFF2A': 'J',
'\u0134': 'J',
'\u0248': 'J',
'\u24C0': 'K',
'\uFF2B': 'K',
'\u1E30': 'K',
'\u01E8': 'K',
'\u1E32': 'K',
'\u0136': 'K',
'\u1E34': 'K',
'\u0198': 'K',
'\u2C69': 'K',
'\uA740': 'K',
'\uA742': 'K',
'\uA744': 'K',
'\uA7A2': 'K',
'\u24C1': 'L',
'\uFF2C': 'L',
'\u013F': 'L',
'\u0139': 'L',
'\u013D': 'L',
'\u1E36': 'L',
'\u1E38': 'L',
'\u013B': 'L',
'\u1E3C': 'L',
'\u1E3A': 'L',
'\u0141': 'L',
'\u023D': 'L',
'\u2C62': 'L',
'\u2C60': 'L',
'\uA748': 'L',
'\uA746': 'L',
'\uA780': 'L',
'\u01C7': 'LJ',
'\u01C8': 'Lj',
'\u24C2': 'M',
'\uFF2D': 'M',
'\u1E3E': 'M',
'\u1E40': 'M',
'\u1E42': 'M',
'\u2C6E': 'M',
'\u019C': 'M',
'\u24C3': 'N',
'\uFF2E': 'N',
'\u01F8': 'N',
'\u0143': 'N',
'\u00D1': 'N',
'\u1E44': 'N',
'\u0147': 'N',
'\u1E46': 'N',
'\u0145': 'N',
'\u1E4A': 'N',
'\u1E48': 'N',
'\u0220': 'N',
'\u019D': 'N',
'\uA790': 'N',
'\uA7A4': 'N',
'\u01CA': 'NJ',
'\u01CB': 'Nj',
'\u24C4': 'O',
'\uFF2F': 'O',
'\u00D2': 'O',
'\u00D3': 'O',
'\u00D4': 'O',
'\u1ED2': 'O',
'\u1ED0': 'O',
'\u1ED6': 'O',
'\u1ED4': 'O',
'\u00D5': 'O',
'\u1E4C': 'O',
'\u022C': 'O',
'\u1E4E': 'O',
'\u014C': 'O',
'\u1E50': 'O',
'\u1E52': 'O',
'\u014E': 'O',
'\u022E': 'O',
'\u0230': 'O',
'\u00D6': 'O',
'\u022A': 'O',
'\u1ECE': 'O',
'\u0150': 'O',
'\u01D1': 'O',
'\u020C': 'O',
'\u020E': 'O',
'\u01A0': 'O',
'\u1EDC': 'O',
'\u1EDA': 'O',
'\u1EE0': 'O',
'\u1EDE': 'O',
'\u1EE2': 'O',
'\u1ECC': 'O',
'\u1ED8': 'O',
'\u01EA': 'O',
'\u01EC': 'O',
'\u00D8': 'O',
'\u01FE': 'O',
'\u0186': 'O',
'\u019F': 'O',
'\uA74A': 'O',
'\uA74C': 'O',
'\u01A2': 'OI',
'\uA74E': 'OO',
'\u0222': 'OU',
'\u24C5': 'P',
'\uFF30': 'P',
'\u1E54': 'P',
'\u1E56': 'P',
'\u01A4': 'P',
'\u2C63': 'P',
'\uA750': 'P',
'\uA752': 'P',
'\uA754': 'P',
'\u24C6': 'Q',
'\uFF31': 'Q',
'\uA756': 'Q',
'\uA758': 'Q',
'\u024A': 'Q',
'\u24C7': 'R',
'\uFF32': 'R',
'\u0154': 'R',
'\u1E58': 'R',
'\u0158': 'R',
'\u0210': 'R',
'\u0212': 'R',
'\u1E5A': 'R',
'\u1E5C': 'R',
'\u0156': 'R',
'\u1E5E': 'R',
'\u024C': 'R',
'\u2C64': 'R',
'\uA75A': 'R',
'\uA7A6': 'R',
'\uA782': 'R',
'\u24C8': 'S',
'\uFF33': 'S',
'\u1E9E': 'S',
'\u015A': 'S',
'\u1E64': 'S',
'\u015C': 'S',
'\u1E60': 'S',
'\u0160': 'S',
'\u1E66': 'S',
'\u1E62': 'S',
'\u1E68': 'S',
'\u0218': 'S',
'\u015E': 'S',
'\u2C7E': 'S',
'\uA7A8': 'S',
'\uA784': 'S',
'\u24C9': 'T',
'\uFF34': 'T',
'\u1E6A': 'T',
'\u0164': 'T',
'\u1E6C': 'T',
'\u021A': 'T',
'\u0162': 'T',
'\u1E70': 'T',
'\u1E6E': 'T',
'\u0166': 'T',
'\u01AC': 'T',
'\u01AE': 'T',
'\u023E': 'T',
'\uA786': 'T',
'\uA728': 'TZ',
'\u24CA': 'U',
'\uFF35': 'U',
'\u00D9': 'U',
'\u00DA': 'U',
'\u00DB': 'U',
'\u0168': 'U',
'\u1E78': 'U',
'\u016A': 'U',
'\u1E7A': 'U',
'\u016C': 'U',
'\u00DC': 'U',
'\u01DB': 'U',
'\u01D7': 'U',
'\u01D5': 'U',
'\u01D9': 'U',
'\u1EE6': 'U',
'\u016E': 'U',
'\u0170': 'U',
'\u01D3': 'U',
'\u0214': 'U',
'\u0216': 'U',
'\u01AF': 'U',
'\u1EEA': 'U',
'\u1EE8': 'U',
'\u1EEE': 'U',
'\u1EEC': 'U',
'\u1EF0': 'U',
'\u1EE4': 'U',
'\u1E72': 'U',
'\u0172': 'U',
'\u1E76': 'U',
'\u1E74': 'U',
'\u0244': 'U',
'\u24CB': 'V',
'\uFF36': 'V',
'\u1E7C': 'V',
'\u1E7E': 'V',
'\u01B2': 'V',
'\uA75E': 'V',
'\u0245': 'V',
'\uA760': 'VY',
'\u24CC': 'W',
'\uFF37': 'W',
'\u1E80': 'W',
'\u1E82': 'W',
'\u0174': 'W',
'\u1E86': 'W',
'\u1E84': 'W',
'\u1E88': 'W',
'\u2C72': 'W',
'\u24CD': 'X',
'\uFF38': 'X',
'\u1E8A': 'X',
'\u1E8C': 'X',
'\u24CE': 'Y',
'\uFF39': 'Y',
'\u1EF2': 'Y',
'\u00DD': 'Y',
'\u0176': 'Y',
'\u1EF8': 'Y',
'\u0232': 'Y',
'\u1E8E': 'Y',
'\u0178': 'Y',
'\u1EF6': 'Y',
'\u1EF4': 'Y',
'\u01B3': 'Y',
'\u024E': 'Y',
'\u1EFE': 'Y',
'\u24CF': 'Z',
'\uFF3A': 'Z',
'\u0179': 'Z',
'\u1E90': 'Z',
'\u017B': 'Z',
'\u017D': 'Z',
'\u1E92': 'Z',
'\u1E94': 'Z',
'\u01B5': 'Z',
'\u0224': 'Z',
'\u2C7F': 'Z',
'\u2C6B': 'Z',
'\uA762': 'Z',
'\u24D0': 'a',
'\uFF41': 'a',
'\u1E9A': 'a',
'\u00E0': 'a',
'\u00E1': 'a',
'\u00E2': 'a',
'\u1EA7': 'a',
'\u1EA5': 'a',
'\u1EAB': 'a',
'\u1EA9': 'a',
'\u00E3': 'a',
'\u0101': 'a',
'\u0103': 'a',
'\u1EB1': 'a',
'\u1EAF': 'a',
'\u1EB5': 'a',
'\u1EB3': 'a',
'\u0227': 'a',
'\u01E1': 'a',
'\u00E4': 'a',
'\u01DF': 'a',
'\u1EA3': 'a',
'\u00E5': 'a',
'\u01FB': 'a',
'\u01CE': 'a',
'\u0201': 'a',
'\u0203': 'a',
'\u1EA1': 'a',
'\u1EAD': 'a',
'\u1EB7': 'a',
'\u1E01': 'a',
'\u0105': 'a',
'\u2C65': 'a',
'\u0250': 'a',
'\uA733': 'aa',
'\u00E6': 'ae',
'\u01FD': 'ae',
'\u01E3': 'ae',
'\uA735': 'ao',
'\uA737': 'au',
'\uA739': 'av',
'\uA73B': 'av',
'\uA73D': 'ay',
'\u24D1': 'b',
'\uFF42': 'b',
'\u1E03': 'b',
'\u1E05': 'b',
'\u1E07': 'b',
'\u0180': 'b',
'\u0183': 'b',
'\u0253': 'b',
'\u24D2': 'c',
'\uFF43': 'c',
'\u0107': 'c',
'\u0109': 'c',
'\u010B': 'c',
'\u010D': 'c',
'\u00E7': 'c',
'\u1E09': 'c',
'\u0188': 'c',
'\u023C': 'c',
'\uA73F': 'c',
'\u2184': 'c',
'\u24D3': 'd',
'\uFF44': 'd',
'\u1E0B': 'd',
'\u010F': 'd',
'\u1E0D': 'd',
'\u1E11': 'd',
'\u1E13': 'd',
'\u1E0F': 'd',
'\u0111': 'd',
'\u018C': 'd',
'\u0256': 'd',
'\u0257': 'd',
'\uA77A': 'd',
'\u01F3': 'dz',
'\u01C6': 'dz',
'\u24D4': 'e',
'\uFF45': 'e',
'\u00E8': 'e',
'\u00E9': 'e',
'\u00EA': 'e',
'\u1EC1': 'e',
'\u1EBF': 'e',
'\u1EC5': 'e',
'\u1EC3': 'e',
'\u1EBD': 'e',
'\u0113': 'e',
'\u1E15': 'e',
'\u1E17': 'e',
'\u0115': 'e',
'\u0117': 'e',
'\u00EB': 'e',
'\u1EBB': 'e',
'\u011B': 'e',
'\u0205': 'e',
'\u0207': 'e',
'\u1EB9': 'e',
'\u1EC7': 'e',
'\u0229': 'e',
'\u1E1D': 'e',
'\u0119': 'e',
'\u1E19': 'e',
'\u1E1B': 'e',
'\u0247': 'e',
'\u025B': 'e',
'\u01DD': 'e',
'\u24D5': 'f',
'\uFF46': 'f',
'\u1E1F': 'f',
'\u0192': 'f',
'\uA77C': 'f',
'\u24D6': 'g',
'\uFF47': 'g',
'\u01F5': 'g',
'\u011D': 'g',
'\u1E21': 'g',
'\u011F': 'g',
'\u0121': 'g',
'\u01E7': 'g',
'\u0123': 'g',
'\u01E5': 'g',
'\u0260': 'g',
'\uA7A1': 'g',
'\u1D79': 'g',
'\uA77F': 'g',
'\u24D7': 'h',
'\uFF48': 'h',
'\u0125': 'h',
'\u1E23': 'h',
'\u1E27': 'h',
'\u021F': 'h',
'\u1E25': 'h',
'\u1E29': 'h',
'\u1E2B': 'h',
'\u1E96': 'h',
'\u0127': 'h',
'\u2C68': 'h',
'\u2C76': 'h',
'\u0265': 'h',
'\u0195': 'hv',
'\u24D8': 'i',
'\uFF49': 'i',
'\u00EC': 'i',
'\u00ED': 'i',
'\u00EE': 'i',
'\u0129': 'i',
'\u012B': 'i',
'\u012D': 'i',
'\u00EF': 'i',
'\u1E2F': 'i',
'\u1EC9': 'i',
'\u01D0': 'i',
'\u0209': 'i',
'\u020B': 'i',
'\u1ECB': 'i',
'\u012F': 'i',
'\u1E2D': 'i',
'\u0268': 'i',
'\u0131': 'i',
'\u24D9': 'j',
'\uFF4A': 'j',
'\u0135': 'j',
'\u01F0': 'j',
'\u0249': 'j',
'\u24DA': 'k',
'\uFF4B': 'k',
'\u1E31': 'k',
'\u01E9': 'k',
'\u1E33': 'k',
'\u0137': 'k',
'\u1E35': 'k',
'\u0199': 'k',
'\u2C6A': 'k',
'\uA741': 'k',
'\uA743': 'k',
'\uA745': 'k',
'\uA7A3': 'k',
'\u24DB': 'l',
'\uFF4C': 'l',
'\u0140': 'l',
'\u013A': 'l',
'\u013E': 'l',
'\u1E37': 'l',
'\u1E39': 'l',
'\u013C': 'l',
'\u1E3D': 'l',
'\u1E3B': 'l',
'\u017F': 'l',
'\u0142': 'l',
'\u019A': 'l',
'\u026B': 'l',
'\u2C61': 'l',
'\uA749': 'l',
'\uA781': 'l',
'\uA747': 'l',
'\u01C9': 'lj',
'\u24DC': 'm',
'\uFF4D': 'm',
'\u1E3F': 'm',
'\u1E41': 'm',
'\u1E43': 'm',
'\u0271': 'm',
'\u026F': 'm',
'\u24DD': 'n',
'\uFF4E': 'n',
'\u01F9': 'n',
'\u0144': 'n',
'\u00F1': 'n',
'\u1E45': 'n',
'\u0148': 'n',
'\u1E47': 'n',
'\u0146': 'n',
'\u1E4B': 'n',
'\u1E49': 'n',
'\u019E': 'n',
'\u0272': 'n',
'\u0149': 'n',
'\uA791': 'n',
'\uA7A5': 'n',
'\u01CC': 'nj',
'\u24DE': 'o',
'\uFF4F': 'o',
'\u00F2': 'o',
'\u00F3': 'o',
'\u00F4': 'o',
'\u1ED3': 'o',
'\u1ED1': 'o',
'\u1ED7': 'o',
'\u1ED5': 'o',
'\u00F5': 'o',
'\u1E4D': 'o',
'\u022D': 'o',
'\u1E4F': 'o',
'\u014D': 'o',
'\u1E51': 'o',
'\u1E53': 'o',
'\u014F': 'o',
'\u022F': 'o',
'\u0231': 'o',
'\u00F6': 'o',
'\u022B': 'o',
'\u1ECF': 'o',
'\u0151': 'o',
'\u01D2': 'o',
'\u020D': 'o',
'\u020F': 'o',
'\u01A1': 'o',
'\u1EDD': 'o',
'\u1EDB': 'o',
'\u1EE1': 'o',
'\u1EDF': 'o',
'\u1EE3': 'o',
'\u1ECD': 'o',
'\u1ED9': 'o',
'\u01EB': 'o',
'\u01ED': 'o',
'\u00F8': 'o',
'\u01FF': 'o',
'\u0254': 'o',
'\uA74B': 'o',
'\uA74D': 'o',
'\u0275': 'o',
'\u01A3': 'oi',
'\u0223': 'ou',
'\uA74F': 'oo',
'\u24DF': 'p',
'\uFF50': 'p',
'\u1E55': 'p',
'\u1E57': 'p',
'\u01A5': 'p',
'\u1D7D': 'p',
'\uA751': 'p',
'\uA753': 'p',
'\uA755': 'p',
'\u24E0': 'q',
'\uFF51': 'q',
'\u024B': 'q',
'\uA757': 'q',
'\uA759': 'q',
'\u24E1': 'r',
'\uFF52': 'r',
'\u0155': 'r',
'\u1E59': 'r',
'\u0159': 'r',
'\u0211': 'r',
'\u0213': 'r',
'\u1E5B': 'r',
'\u1E5D': 'r',
'\u0157': 'r',
'\u1E5F': 'r',
'\u024D': 'r',
'\u027D': 'r',
'\uA75B': 'r',
'\uA7A7': 'r',
'\uA783': 'r',
'\u24E2': 's',
'\uFF53': 's',
'\u00DF': 's',
'\u015B': 's',
'\u1E65': 's',
'\u015D': 's',
'\u1E61': 's',
'\u0161': 's',
'\u1E67': 's',
'\u1E63': 's',
'\u1E69': 's',
'\u0219': 's',
'\u015F': 's',
'\u023F': 's',
'\uA7A9': 's',
'\uA785': 's',
'\u1E9B': 's',
'\u24E3': 't',
'\uFF54': 't',
'\u1E6B': 't',
'\u1E97': 't',
'\u0165': 't',
'\u1E6D': 't',
'\u021B': 't',
'\u0163': 't',
'\u1E71': 't',
'\u1E6F': 't',
'\u0167': 't',
'\u01AD': 't',
'\u0288': 't',
'\u2C66': 't',
'\uA787': 't',
'\uA729': 'tz',
'\u24E4': 'u',
'\uFF55': 'u',
'\u00F9': 'u',
'\u00FA': 'u',
'\u00FB': 'u',
'\u0169': 'u',
'\u1E79': 'u',
'\u016B': 'u',
'\u1E7B': 'u',
'\u016D': 'u',
'\u00FC': 'u',
'\u01DC': 'u',
'\u01D8': 'u',
'\u01D6': 'u',
'\u01DA': 'u',
'\u1EE7': 'u',
'\u016F': 'u',
'\u0171': 'u',
'\u01D4': 'u',
'\u0215': 'u',
'\u0217': 'u',
'\u01B0': 'u',
'\u1EEB': 'u',
'\u1EE9': 'u',
'\u1EEF': 'u',
'\u1EED': 'u',
'\u1EF1': 'u',
'\u1EE5': 'u',
'\u1E73': 'u',
'\u0173': 'u',
'\u1E77': 'u',
'\u1E75': 'u',
'\u0289': 'u',
'\u24E5': 'v',
'\uFF56': 'v',
'\u1E7D': 'v',
'\u1E7F': 'v',
'\u028B': 'v',
'\uA75F': 'v',
'\u028C': 'v',
'\uA761': 'vy',
'\u24E6': 'w',
'\uFF57': 'w',
'\u1E81': 'w',
'\u1E83': 'w',
'\u0175': 'w',
'\u1E87': 'w',
'\u1E85': 'w',
'\u1E98': 'w',
'\u1E89': 'w',
'\u2C73': 'w',
'\u24E7': 'x',
'\uFF58': 'x',
'\u1E8B': 'x',
'\u1E8D': 'x',
'\u24E8': 'y',
'\uFF59': 'y',
'\u1EF3': 'y',
'\u00FD': 'y',
'\u0177': 'y',
'\u1EF9': 'y',
'\u0233': 'y',
'\u1E8F': 'y',
'\u00FF': 'y',
'\u1EF7': 'y',
'\u1E99': 'y',
'\u1EF5': 'y',
'\u01B4': 'y',
'\u024F': 'y',
'\u1EFF': 'y',
'\u24E9': 'z',
'\uFF5A': 'z',
'\u017A': 'z',
'\u1E91': 'z',
'\u017C': 'z',
'\u017E': 'z',
'\u1E93': 'z',
'\u1E95': 'z',
'\u01B6': 'z',
'\u0225': 'z',
'\u0240': 'z',
'\u2C6C': 'z',
'\uA763': 'z',
'\u0386': '\u0391',
'\u0388': '\u0395',
'\u0389': '\u0397',
'\u038A': '\u0399',
'\u03AA': '\u0399',
'\u038C': '\u039F',
'\u038E': '\u03A5',
'\u03AB': '\u03A5',
'\u038F': '\u03A9',
'\u03AC': '\u03B1',
'\u03AD': '\u03B5',
'\u03AE': '\u03B7',
'\u03AF': '\u03B9',
'\u03CA': '\u03B9',
'\u0390': '\u03B9',
'\u03CC': '\u03BF',
'\u03CD': '\u03C5',
'\u03CB': '\u03C5',
'\u03B0': '\u03C5',
'\u03C9': '\u03C9',
'\u03C2': '\u03C3'
};
return diacritics;
});
S2.define('select2/data/base',[
'../utils'
], function (Utils) {
function BaseAdapter ($element, options) {
BaseAdapter.__super__.constructor.call(this);
}
Utils.Extend(BaseAdapter, Utils.Observable);
BaseAdapter.prototype.current = function (callback) {
throw new Error('The `current` method must be defined in child classes.');
};
BaseAdapter.prototype.query = function (params, callback) {
throw new Error('The `query` method must be defined in child classes.');
};
BaseAdapter.prototype.bind = function (container, $container) {
// Can be implemented in subclasses
};
BaseAdapter.prototype.destroy = function () {
// Can be implemented in subclasses
};
BaseAdapter.prototype.generateResultId = function (container, data) {
var id = container.id + '-result-';
id += Utils.generateChars(4);
if (data.id != null) {
id += '-' + data.id.toString();
} else {
id += '-' + Utils.generateChars(4);
}
return id;
};
return BaseAdapter;
});
S2.define('select2/data/select',[
'./base',
'../utils',
'jquery'
], function (BaseAdapter, Utils, $) {
function SelectAdapter ($element, options) {
this.$element = $element;
this.options = options;
SelectAdapter.__super__.constructor.call(this);
}
Utils.Extend(SelectAdapter, BaseAdapter);
SelectAdapter.prototype.current = function (callback) {
var data = [];
var self = this;
this.$element.find(':selected').each(function () {
var $option = $(this);
var option = self.item($option);
data.push(option);
});
callback(data);
};
SelectAdapter.prototype.select = function (data) {
var self = this;
data.selected = true;
// If data.element is a DOM node, use it instead
if ($(data.element).is('option')) {
data.element.selected = true;
this.$element.trigger('change');
return;
}
if (this.$element.prop('multiple')) {
this.current(function (currentData) {
var val = [];
data = [data];
data.push.apply(data, currentData);
for (var d = 0; d < data.length; d++) {
var id = data[d].id;
if ($.inArray(id, val) === -1) {
val.push(id);
}
}
self.$element.val(val);
self.$element.trigger('change');
});
} else {
var val = data.id;
this.$element.val(val);
this.$element.trigger('change');
}
};
SelectAdapter.prototype.unselect = function (data) {
var self = this;
if (!this.$element.prop('multiple')) {
return;
}
data.selected = false;
if ($(data.element).is('option')) {
data.element.selected = false;
this.$element.trigger('change');
return;
}
this.current(function (currentData) {
var val = [];
for (var d = 0; d < currentData.length; d++) {
var id = currentData[d].id;
if (id !== data.id && $.inArray(id, val) === -1) {
val.push(id);
}
}
self.$element.val(val);
self.$element.trigger('change');
});
};
SelectAdapter.prototype.bind = function (container, $container) {
var self = this;
this.container = container;
container.on('select', function (params) {
self.select(params.data);
});
container.on('unselect', function (params) {
self.unselect(params.data);
});
};
SelectAdapter.prototype.destroy = function () {
// Remove anything added to child elements
this.$element.find('*').each(function () {
// Remove any custom data set by Select2
Utils.RemoveData(this);
});
};
SelectAdapter.prototype.query = function (params, callback) {
var data = [];
var self = this;
var $options = this.$element.children();
$options.each(function () {
var $option = $(this);
if (!$option.is('option') && !$option.is('optgroup')) {
return;
}
var option = self.item($option);
var matches = self.matches(params, option);
if (matches !== null) {
data.push(matches);
}
});
callback({
results: data
});
};
SelectAdapter.prototype.addOptions = function ($options) {
Utils.appendMany(this.$element, $options);
};
SelectAdapter.prototype.option = function (data) {
var option;
if (data.children) {
option = document.createElement('optgroup');
option.label = data.text;
} else {
option = document.createElement('option');
if (option.textContent !== undefined) {
option.textContent = data.text;
} else {
option.innerText = data.text;
}
}
if (data.id !== undefined) {
option.value = data.id;
}
if (data.disabled) {
option.disabled = true;
}
if (data.selected) {
option.selected = true;
}
if (data.title) {
option.title = data.title;
}
var $option = $(option);
var normalizedData = this._normalizeItem(data);
normalizedData.element = option;
// Override the option's data with the combined data
Utils.StoreData(option, 'data', normalizedData);
return $option;
};
SelectAdapter.prototype.item = function ($option) {
var data = {};
data = Utils.GetData($option[0], 'data');
if (data != null) {
return data;
}
if ($option.is('option')) {
data = {
id: $option.val(),
text: $option.text(),
disabled: $option.prop('disabled'),
selected: $option.prop('selected'),
title: $option.prop('title')
};
} else if ($option.is('optgroup')) {
data = {
text: $option.prop('label'),
children: [],
title: $option.prop('title')
};
var $children = $option.children('option');
var children = [];
for (var c = 0; c < $children.length; c++) {
var $child = $($children[c]);
var child = this.item($child);
children.push(child);
}
data.children = children;
}
data = this._normalizeItem(data);
data.element = $option[0];
Utils.StoreData($option[0], 'data', data);
return data;
};
SelectAdapter.prototype._normalizeItem = function (item) {
if (item !== Object(item)) {
item = {
id: item,
text: item
};
}
item = $.extend({}, {
text: ''
}, item);
var defaults = {
selected: false,
disabled: false
};
if (item.id != null) {
item.id = item.id.toString();
}
if (item.text != null) {
item.text = item.text.toString();
}
if (item._resultId == null && item.id && this.container != null) {
item._resultId = this.generateResultId(this.container, item);
}
return $.extend({}, defaults, item);
};
SelectAdapter.prototype.matches = function (params, data) {
var matcher = this.options.get('matcher');
return matcher(params, data);
};
return SelectAdapter;
});
S2.define('select2/data/array',[
'./select',
'../utils',
'jquery'
], function (SelectAdapter, Utils, $) {
function ArrayAdapter ($element, options) {
var data = options.get('data') || [];
ArrayAdapter.__super__.constructor.call(this, $element, options);
this.addOptions(this.convertToOptions(data));
}
Utils.Extend(ArrayAdapter, SelectAdapter);
ArrayAdapter.prototype.select = function (data) {
var $option = this.$element.find('option').filter(function (i, elm) {
return elm.value == data.id.toString();
});
if ($option.length === 0) {
$option = this.option(data);
this.addOptions($option);
}
ArrayAdapter.__super__.select.call(this, data);
};
ArrayAdapter.prototype.convertToOptions = function (data) {
var self = this;
var $existing = this.$element.find('option');
var existingIds = $existing.map(function () {
return self.item($(this)).id;
}).get();
var $options = [];
// Filter out all items except for the one passed in the argument
function onlyItem (item) {
return function () {
return $(this).val() == item.id;
};
}
for (var d = 0; d < data.length; d++) {
var item = this._normalizeItem(data[d]);
// Skip items which were pre-loaded, only merge the data
if ($.inArray(item.id, existingIds) >= 0) {
var $existingOption = $existing.filter(onlyItem(item));
var existingData = this.item($existingOption);
var newData = $.extend(true, {}, item, existingData);
var $newOption = this.option(newData);
$existingOption.replaceWith($newOption);
continue;
}
var $option = this.option(item);
if (item.children) {
var $children = this.convertToOptions(item.children);
Utils.appendMany($option, $children);
}
$options.push($option);
}
return $options;
};
return ArrayAdapter;
});
S2.define('select2/data/ajax',[
'./array',
'../utils',
'jquery'
], function (ArrayAdapter, Utils, $) {
function AjaxAdapter ($element, options) {
this.ajaxOptions = this._applyDefaults(options.get('ajax'));
if (this.ajaxOptions.processResults != null) {
this.processResults = this.ajaxOptions.processResults;
}
AjaxAdapter.__super__.constructor.call(this, $element, options);
}
Utils.Extend(AjaxAdapter, ArrayAdapter);
AjaxAdapter.prototype._applyDefaults = function (options) {
var defaults = {
data: function (params) {
return $.extend({}, params, {
q: params.term
});
},
transport: function (params, success, failure) {
var $request = $.ajax(params);
$request.then(success);
$request.fail(failure);
return $request;
}
};
return $.extend({}, defaults, options, true);
};
AjaxAdapter.prototype.processResults = function (results) {
return results;
};
AjaxAdapter.prototype.query = function (params, callback) {
var matches = [];
var self = this;
if (this._request != null) {
// JSONP requests cannot always be aborted
if ($.isFunction(this._request.abort)) {
this._request.abort();
}
this._request = null;
}
var options = $.extend({
type: 'GET'
}, this.ajaxOptions);
if (typeof options.url === 'function') {
options.url = options.url.call(this.$element, params);
}
if (typeof options.data === 'function') {
options.data = options.data.call(this.$element, params);
}
function request () {
var $request = options.transport(options, function (data) {
var results = self.processResults(data, params);
if (self.options.get('debug') && window.console && console.error) {
// Check to make sure that the response included a `results` key.
if (!results || !results.results || !$.isArray(results.results)) {
console.error(
'Select2: The AJAX results did not return an array in the ' +
'`results` key of the response.'
);
}
}
callback(results);
}, function () {
// Attempt to detect if a request was aborted
// Only works if the transport exposes a status property
if ('status' in $request &&
($request.status === 0 || $request.status === '0')) {
return;
}
self.trigger('results:message', {
message: 'errorLoading'
});
});
self._request = $request;
}
if (this.ajaxOptions.delay && params.term != null) {
if (this._queryTimeout) {
window.clearTimeout(this._queryTimeout);
}
this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);
} else {
request();
}
};
return AjaxAdapter;
});
S2.define('select2/data/tags',[
'jquery'
], function ($) {
function Tags (decorated, $element, options) {
var tags = options.get('tags');
var createTag = options.get('createTag');
if (createTag !== undefined) {
this.createTag = createTag;
}
var insertTag = options.get('insertTag');
if (insertTag !== undefined) {
this.insertTag = insertTag;
}
decorated.call(this, $element, options);
if ($.isArray(tags)) {
for (var t = 0; t < tags.length; t++) {
var tag = tags[t];
var item = this._normalizeItem(tag);
var $option = this.option(item);
this.$element.append($option);
}
}
}
Tags.prototype.query = function (decorated, params, callback) {
var self = this;
this._removeOldTags();
if (params.term == null || params.page != null) {
decorated.call(this, params, callback);
return;
}
function wrapper (obj, child) {
var data = obj.results;
for (var i = 0; i < data.length; i++) {
var option = data[i];
var checkChildren = (
option.children != null &&
!wrapper({
results: option.children
}, true)
);
var optionText = (option.text || '').toUpperCase();
var paramsTerm = (params.term || '').toUpperCase();
var checkText = optionText === paramsTerm;
if (checkText || checkChildren) {
if (child) {
return false;
}
obj.data = data;
callback(obj);
return;
}
}
if (child) {
return true;
}
var tag = self.createTag(params);
if (tag != null) {
var $option = self.option(tag);
$option.attr('data-select2-tag', true);
self.addOptions([$option]);
self.insertTag(data, tag);
}
obj.results = data;
callback(obj);
}
decorated.call(this, params, wrapper);
};
Tags.prototype.createTag = function (decorated, params) {
var term = $.trim(params.term);
if (term === '') {
return null;
}
return {
id: term,
text: term
};
};
Tags.prototype.insertTag = function (_, data, tag) {
data.unshift(tag);
};
Tags.prototype._removeOldTags = function (_) {
var tag = this._lastTag;
var $options = this.$element.find('option[data-select2-tag]');
$options.each(function () {
if (this.selected) {
return;
}
$(this).remove();
});
};
return Tags;
});
S2.define('select2/data/tokenizer',[
'jquery'
], function ($) {
function Tokenizer (decorated, $element, options) {
var tokenizer = options.get('tokenizer');
if (tokenizer !== undefined) {
this.tokenizer = tokenizer;
}
decorated.call(this, $element, options);
}
Tokenizer.prototype.bind = function (decorated, container, $container) {
decorated.call(this, container, $container);
this.$search = container.dropdown.$search || container.selection.$search ||
$container.find('.select2-search__field');
};
Tokenizer.prototype.query = function (decorated, params, callback) {
var self = this;
function createAndSelect (data) {
// Normalize the data object so we can use it for checks
var item = self._normalizeItem(data);
// Check if the data object already exists as a tag
// Select it if it doesn't
var $existingOptions = self.$element.find('option').filter(function () {
return $(this).val() === item.id;
});
// If an existing option wasn't found for it, create the option
if (!$existingOptions.length) {
var $option = self.option(item);
$option.attr('data-select2-tag', true);
self._removeOldTags();
self.addOptions([$option]);
}
// Select the item, now that we know there is an option for it
select(item);
}
function select (data) {
self.trigger('select', {
data: data
});
}
params.term = params.term || '';
var tokenData = this.tokenizer(params, this.options, createAndSelect);
if (tokenData.term !== params.term) {
// Replace the search term if we have the search box
if (this.$search.length) {
this.$search.val(tokenData.term);
this.$search.focus();
}
params.term = tokenData.term;
}
decorated.call(this, params, callback);
};
Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
var separators = options.get('tokenSeparators') || [];
var term = params.term;
var i = 0;
var createTag = this.createTag || function (params) {
return {
id: params.term,
text: params.term
};
};
while (i < term.length) {
var termChar = term[i];
if ($.inArray(termChar, separators) === -1) {
i++;
continue;
}
var part = term.substr(0, i);
var partParams = $.extend({}, params, {
term: part
});
var data = createTag(partParams);
if (data == null) {
i++;
continue;
}
callback(data);
// Reset the term to not include the tokenized portion
term = term.substr(i + 1) || '';
i = 0;
}
return {
term: term
};
};
return Tokenizer;
});
S2.define('select2/data/minimumInputLength',[
], function () {
function MinimumInputLength (decorated, $e, options) {
this.minimumInputLength = options.get('minimumInputLength');
decorated.call(this, $e, options);
}
MinimumInputLength.prototype.query = function (decorated, params, callback) {
params.term = params.term || '';
if (params.term.length < this.minimumInputLength) {
this.trigger('results:message', {
message: 'inputTooShort',
args: {
minimum: this.minimumInputLength,
input: params.term,
params: params
}
});
return;
}
decorated.call(this, params, callback);
};
return MinimumInputLength;
});
S2.define('select2/data/maximumInputLength',[
], function () {
function MaximumInputLength (decorated, $e, options) {
this.maximumInputLength = options.get('maximumInputLength');
decorated.call(this, $e, options);
}
MaximumInputLength.prototype.query = function (decorated, params, callback) {
params.term = params.term || '';
if (this.maximumInputLength > 0 &&
params.term.length > this.maximumInputLength) {
this.trigger('results:message', {
message: 'inputTooLong',
args: {
maximum: this.maximumInputLength,
input: params.term,
params: params
}
});
return;
}
decorated.call(this, params, callback);
};
return MaximumInputLength;
});
S2.define('select2/data/maximumSelectionLength',[
], function (){
function MaximumSelectionLength (decorated, $e, options) {
this.maximumSelectionLength = options.get('maximumSelectionLength');
decorated.call(this, $e, options);
}
MaximumSelectionLength.prototype.query =
function (decorated, params, callback) {
var self = this;
this.current(function (currentData) {
var count = currentData != null ? currentData.length : 0;
if (self.maximumSelectionLength > 0 &&
count >= self.maximumSelectionLength) {
self.trigger('results:message', {
message: 'maximumSelected',
args: {
maximum: self.maximumSelectionLength
}
});
return;
}
decorated.call(self, params, callback);
});
};
return MaximumSelectionLength;
});
S2.define('select2/dropdown',[
'jquery',
'./utils'
], function ($, Utils) {
function Dropdown ($element, options) {
this.$element = $element;
this.options = options;
Dropdown.__super__.constructor.call(this);
}
Utils.Extend(Dropdown, Utils.Observable);
Dropdown.prototype.render = function () {
var $dropdown = $(
'<span class="select2-dropdown">' +
'<span class="select2-results"></span>' +
'</span>'
);
$dropdown.attr('dir', this.options.get('dir'));
this.$dropdown = $dropdown;
return $dropdown;
};
Dropdown.prototype.bind = function () {
// Should be implemented in subclasses
};
Dropdown.prototype.position = function ($dropdown, $container) {
// Should be implmented in subclasses
};
Dropdown.prototype.destroy = function () {
// Remove the dropdown from the DOM
this.$dropdown.remove();
};
return Dropdown;
});
S2.define('select2/dropdown/search',[
'jquery',
'../utils'
], function ($, Utils) {
function Search () { }
Search.prototype.render = function (decorated) {
var $rendered = decorated.call(this);
var $search = $(
'<span class="select2-search select2-search--dropdown">' +
'<input class="select2-search__field" type="search" tabindex="-1"' +
' autocomplete="off" autocorrect="off" autocapitalize="none"' +
' spellcheck="false" role="textbox" />' +
'</span>'
);
this.$searchContainer = $search;
this.$search = $search.find('input');
$rendered.prepend($search);
return $rendered;
};
Search.prototype.bind = function (decorated, container, $container) {
var self = this;
decorated.call(this, container, $container);
this.$search.on('keydown', function (evt) {
self.trigger('keypress', evt);
self._keyUpPrevented = evt.isDefaultPrevented();
});
// Workaround for browsers which do not support the `input` event
// This will prevent double-triggering of events for browsers which support
// both the `keyup` and `input` events.
this.$search.on('input', function (evt) {
// Unbind the duplicated `keyup` event
$(this).off('keyup');
});
this.$search.on('keyup input', function (evt) {
self.handleSearch(evt);
});
container.on('open', function () {
self.$search.attr('tabindex', 0);
self.$search.focus();
window.setTimeout(function () {
self.$search.focus();
}, 0);
});
container.on('close', function () {
self.$search.attr('tabindex', -1);
self.$search.val('');
self.$search.blur();
});
container.on('focus', function () {
if (!container.isOpen()) {
self.$search.focus();
}
});
container.on('results:all', function (params) {
if (params.query.term == null || params.query.term === '') {
var showSearch = self.showSearch(params);
if (showSearch) {
self.$searchContainer.removeClass('select2-search--hide');
} else {
self.$searchContainer.addClass('select2-search--hide');
}
}
});
};
Search.prototype.handleSearch = function (evt) {
if (!this._keyUpPrevented) {
var input = this.$search.val();
this.trigger('query', {
term: input
});
}
this._keyUpPrevented = false;
};
Search.prototype.showSearch = function (_, params) {
return true;
};
return Search;
});
S2.define('select2/dropdown/hidePlaceholder',[
], function () {
function HidePlaceholder (decorated, $element, options, dataAdapter) {
this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
decorated.call(this, $element, options, dataAdapter);
}
HidePlaceholder.prototype.append = function (decorated, data) {
data.results = this.removePlaceholder(data.results);
decorated.call(this, data);
};
HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {
if (typeof placeholder === 'string') {
placeholder = {
id: '',
text: placeholder
};
}
return placeholder;
};
HidePlaceholder.prototype.removePlaceholder = function (_, data) {
var modifiedData = data.slice(0);
for (var d = data.length - 1; d >= 0; d--) {
var item = data[d];
if (this.placeholder.id === item.id) {
modifiedData.splice(d, 1);
}
}
return modifiedData;
};
return HidePlaceholder;
});
S2.define('select2/dropdown/infiniteScroll',[
'jquery'
], function ($) {
function InfiniteScroll (decorated, $element, options, dataAdapter) {
this.lastParams = {};
decorated.call(this, $element, options, dataAdapter);
this.$loadingMore = this.createLoadingMore();
this.loading = false;
}
InfiniteScroll.prototype.append = function (decorated, data) {
this.$loadingMore.remove();
this.loading = false;
decorated.call(this, data);
if (this.showLoadingMore(data)) {
this.$results.append(this.$loadingMore);
}
};
InfiniteScroll.prototype.bind = function (decorated, container, $container) {
var self = this;
decorated.call(this, container, $container);
container.on('query', function (params) {
self.lastParams = params;
self.loading = true;
});
container.on('query:append', function (params) {
self.lastParams = params;
self.loading = true;
});
this.$results.on('scroll', function () {
var isLoadMoreVisible = $.contains(
document.documentElement,
self.$loadingMore[0]
);
if (self.loading || !isLoadMoreVisible) {
return;
}
var currentOffset = self.$results.offset().top +
self.$results.outerHeight(false);
var loadingMoreOffset = self.$loadingMore.offset().top +
self.$loadingMore.outerHeight(false);
if (currentOffset + 50 >= loadingMoreOffset) {
self.loadMore();
}
});
};
InfiniteScroll.prototype.loadMore = function () {
this.loading = true;
var params = $.extend({}, {page: 1}, this.lastParams);
params.page++;
this.trigger('query:append', params);
};
InfiniteScroll.prototype.showLoadingMore = function (_, data) {
return data.pagination && data.pagination.more;
};
InfiniteScroll.prototype.createLoadingMore = function () {
var $option = $(
'<li ' +
'class="select2-results__option select2-results__option--load-more"' +
'role="treeitem" aria-disabled="true"></li>'
);
var message = this.options.get('translations').get('loadingMore');
$option.html(message(this.lastParams));
return $option;
};
return InfiniteScroll;
});
S2.define('select2/dropdown/attachBody',[
'jquery',
'../utils'
], function ($, Utils) {
function AttachBody (decorated, $element, options) {
this.$dropdownParent = options.get('dropdownParent') || $(document.body);
decorated.call(this, $element, options);
}
AttachBody.prototype.bind = function (decorated, container, $container) {
var self = this;
var setupResultsEvents = false;
decorated.call(this, container, $container);
container.on('open', function () {
self._showDropdown();
self._attachPositioningHandler(container);
if (!setupResultsEvents) {
setupResultsEvents = true;
container.on('results:all', function () {
self._positionDropdown();
self._resizeDropdown();
});
container.on('results:append', function () {
self._positionDropdown();
self._resizeDropdown();
});
}
});
container.on('close', function () {
self._hideDropdown();
self._detachPositioningHandler(container);
});
this.$dropdownContainer.on('mousedown', function (evt) {
evt.stopPropagation();
});
};
AttachBody.prototype.destroy = function (decorated) {
decorated.call(this);
this.$dropdownContainer.remove();
};
AttachBody.prototype.position = function (decorated, $dropdown, $container) {
// Clone all of the container classes
$dropdown.attr('class', $container.attr('class'));
$dropdown.removeClass('select2');
$dropdown.addClass('select2-container--open');
$dropdown.css({
position: 'absolute',
top: -999999
});
this.$container = $container;
};
AttachBody.prototype.render = function (decorated) {
var $container = $('<span></span>');
var $dropdown = decorated.call(this);
$container.append($dropdown);
this.$dropdownContainer = $container;
return $container;
};
AttachBody.prototype._hideDropdown = function (decorated) {
this.$dropdownContainer.detach();
};
AttachBody.prototype._attachPositioningHandler =
function (decorated, container) {
var self = this;
var scrollEvent = 'scroll.select2.' + container.id;
var resizeEvent = 'resize.select2.' + container.id;
var orientationEvent = 'orientationchange.select2.' + container.id;
var $watchers = this.$container.parents().filter(Utils.hasScroll);
$watchers.each(function () {
Utils.StoreData(this, 'select2-scroll-position', {
x: $(this).scrollLeft(),
y: $(this).scrollTop()
});
});
$watchers.on(scrollEvent, function (ev) {
var position = Utils.GetData(this, 'select2-scroll-position');
$(this).scrollTop(position.y);
});
$(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
function (e) {
self._positionDropdown();
self._resizeDropdown();
});
};
AttachBody.prototype._detachPositioningHandler =
function (decorated, container) {
var scrollEvent = 'scroll.select2.' + container.id;
var resizeEvent = 'resize.select2.' + container.id;
var orientationEvent = 'orientationchange.select2.' + container.id;
var $watchers = this.$container.parents().filter(Utils.hasScroll);
$watchers.off(scrollEvent);
$(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
};
AttachBody.prototype._positionDropdown = function () {
var $window = $(window);
var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above');
var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below');
var newDirection = null;
var offset = this.$container.offset();
offset.bottom = offset.top + this.$container.outerHeight(false);
var container = {
height: this.$container.outerHeight(false)
};
container.top = offset.top;
container.bottom = offset.top + container.height;
var dropdown = {
height: this.$dropdown.outerHeight(false)
};
var viewport = {
top: $window.scrollTop(),
bottom: $window.scrollTop() + $window.height()
};
var enoughRoomAbove = viewport.top < (offset.top - dropdown.height);
var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height);
var css = {
left: offset.left,
top: container.bottom
};
// Determine what the parent element is to use for calciulating the offset
var $offsetParent = this.$dropdownParent;
// For statically positoned elements, we need to get the element
// that is determining the offset
if ($offsetParent.css('position') === 'static') {
$offsetParent = $offsetParent.offsetParent();
}
var parentOffset = $offsetParent.offset();
css.top -= parentOffset.top;
css.left -= parentOffset.left;
if (!isCurrentlyAbove && !isCurrentlyBelow) {
newDirection = 'below';
}
if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
newDirection = 'above';
} else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
newDirection = 'below';
}
if (newDirection == 'above' ||
(isCurrentlyAbove && newDirection !== 'below')) {
css.top = container.top - parentOffset.top - dropdown.height;
}
if (newDirection != null) {
this.$dropdown
.removeClass('select2-dropdown--below select2-dropdown--above')
.addClass('select2-dropdown--' + newDirection);
this.$container
.removeClass('select2-container--below select2-container--above')
.addClass('select2-container--' + newDirection);
}
this.$dropdownContainer.css(css);
};
AttachBody.prototype._resizeDropdown = function () {
var css = {
width: this.$container.outerWidth(false) + 'px'
};
if (this.options.get('dropdownAutoWidth')) {
css.minWidth = css.width;
css.position = 'relative';
css.width = 'auto';
}
this.$dropdown.css(css);
};
AttachBody.prototype._showDropdown = function (decorated) {
this.$dropdownContainer.appendTo(this.$dropdownParent);
this._positionDropdown();
this._resizeDropdown();
};
return AttachBody;
});
S2.define('select2/dropdown/minimumResultsForSearch',[
], function () {
function countResults (data) {
var count = 0;
for (var d = 0; d < data.length; d++) {
var item = data[d];
if (item.children) {
count += countResults(item.children);
} else {
count++;
}
}
return count;
}
function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
this.minimumResultsForSearch = options.get('minimumResultsForSearch');
if (this.minimumResultsForSearch < 0) {
this.minimumResultsForSearch = Infinity;
}
decorated.call(this, $element, options, dataAdapter);
}
MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {
if (countResults(params.data.results) < this.minimumResultsForSearch) {
return false;
}
return decorated.call(this, params);
};
return MinimumResultsForSearch;
});
S2.define('select2/dropdown/selectOnClose',[
'../utils'
], function (Utils) {
function SelectOnClose () { }
SelectOnClose.prototype.bind = function (decorated, container, $container) {
var self = this;
decorated.call(this, container, $container);
container.on('close', function (params) {
self._handleSelectOnClose(params);
});
};
SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
if (params && params.originalSelect2Event != null) {
var event = params.originalSelect2Event;
// Don't select an item if the close event was triggered from a select or
// unselect event
if (event._type === 'select' || event._type === 'unselect') {
return;
}
}
var $highlightedResults = this.getHighlightedResults();
// Only select highlighted results
if ($highlightedResults.length < 1) {
return;
}
var data = Utils.GetData($highlightedResults[0], 'data');
// Don't re-select already selected resulte
if (
(data.element != null && data.element.selected) ||
(data.element == null && data.selected)
) {
return;
}
this.trigger('select', {
data: data
});
};
return SelectOnClose;
});
S2.define('select2/dropdown/closeOnSelect',[
], function () {
function CloseOnSelect () { }
CloseOnSelect.prototype.bind = function (decorated, container, $container) {
var self = this;
decorated.call(this, container, $container);
container.on('select', function (evt) {
self._selectTriggered(evt);
});
container.on('unselect', function (evt) {
self._selectTriggered(evt);
});
};
CloseOnSelect.prototype._selectTriggered = function (_, evt) {
var originalEvent = evt.originalEvent;
// Don't close if the control key is being held
if (originalEvent && originalEvent.ctrlKey) {
return;
}
this.trigger('close', {
originalEvent: originalEvent,
originalSelect2Event: evt
});
};
return CloseOnSelect;
});
S2.define('select2/i18n/en',[],function () {
// English
return {
errorLoading: function () {
return 'The results could not be loaded.';
},
inputTooLong: function (args) {
var overChars = args.input.length - args.maximum;
var message = 'Please delete ' + overChars + ' character';
if (overChars != 1) {
message += 's';
}
return message;
},
inputTooShort: function (args) {
var remainingChars = args.minimum - args.input.length;
var message = 'Please enter ' + remainingChars + ' or more characters';
return message;
},
loadingMore: function () {
return 'Loading more results';
},
maximumSelected: function (args) {
var message = 'You can only select ' + args.maximum + ' item';
if (args.maximum != 1) {
message += 's';
}
return message;
},
noResults: function () {
return 'No results found';
},
searching: function () {
return 'Searching';
}
};
});
S2.define('select2/defaults',[
'jquery',
'require',
'./results',
'./selection/single',
'./selection/multiple',
'./selection/placeholder',
'./selection/allowClear',
'./selection/search',
'./selection/eventRelay',
'./utils',
'./translation',
'./diacritics',
'./data/select',
'./data/array',
'./data/ajax',
'./data/tags',
'./data/tokenizer',
'./data/minimumInputLength',
'./data/maximumInputLength',
'./data/maximumSelectionLength',
'./dropdown',
'./dropdown/search',
'./dropdown/hidePlaceholder',
'./dropdown/infiniteScroll',
'./dropdown/attachBody',
'./dropdown/minimumResultsForSearch',
'./dropdown/selectOnClose',
'./dropdown/closeOnSelect',
'./i18n/en'
], function ($, require,
ResultsList,
SingleSelection, MultipleSelection, Placeholder, AllowClear,
SelectionSearch, EventRelay,
Utils, Translation, DIACRITICS,
SelectData, ArrayData, AjaxData, Tags, Tokenizer,
MinimumInputLength, MaximumInputLength, MaximumSelectionLength,
Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect,
EnglishTranslation) {
function Defaults () {
this.reset();
}
Defaults.prototype.apply = function (options) {
options = $.extend(true, {}, this.defaults, options);
if (options.dataAdapter == null) {
if (options.ajax != null) {
options.dataAdapter = AjaxData;
} else if (options.data != null) {
options.dataAdapter = ArrayData;
} else {
options.dataAdapter = SelectData;
}
if (options.minimumInputLength > 0) {
options.dataAdapter = Utils.Decorate(
options.dataAdapter,
MinimumInputLength
);
}
if (options.maximumInputLength > 0) {
options.dataAdapter = Utils.Decorate(
options.dataAdapter,
MaximumInputLength
);
}
if (options.maximumSelectionLength > 0) {
options.dataAdapter = Utils.Decorate(
options.dataAdapter,
MaximumSelectionLength
);
}
if (options.tags) {
options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);
}
if (options.tokenSeparators != null || options.tokenizer != null) {
options.dataAdapter = Utils.Decorate(
options.dataAdapter,
Tokenizer
);
}
if (options.query != null) {
var Query = require(options.amdBase + 'compat/query');
options.dataAdapter = Utils.Decorate(
options.dataAdapter,
Query
);
}
if (options.initSelection != null) {
var InitSelection = require(options.amdBase + 'compat/initSelection');
options.dataAdapter = Utils.Decorate(
options.dataAdapter,
InitSelection
);
}
}
if (options.resultsAdapter == null) {
options.resultsAdapter = ResultsList;
if (options.ajax != null) {
options.resultsAdapter = Utils.Decorate(
options.resultsAdapter,
InfiniteScroll
);
}
if (options.placeholder != null) {
options.resultsAdapter = Utils.Decorate(
options.resultsAdapter,
HidePlaceholder
);
}
if (options.selectOnClose) {
options.resultsAdapter = Utils.Decorate(
options.resultsAdapter,
SelectOnClose
);
}
}
if (options.dropdownAdapter == null) {
if (options.multiple) {
options.dropdownAdapter = Dropdown;
} else {
var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);
options.dropdownAdapter = SearchableDropdown;
}
if (options.minimumResultsForSearch !== 0) {
options.dropdownAdapter = Utils.Decorate(
options.dropdownAdapter,
MinimumResultsForSearch
);
}
if (options.closeOnSelect) {
options.dropdownAdapter = Utils.Decorate(
options.dropdownAdapter,
CloseOnSelect
);
}
if (
options.dropdownCssClass != null ||
options.dropdownCss != null ||
options.adaptDropdownCssClass != null
) {
var DropdownCSS = require(options.amdBase + 'compat/dropdownCss');
options.dropdownAdapter = Utils.Decorate(
options.dropdownAdapter,
DropdownCSS
);
}
options.dropdownAdapter = Utils.Decorate(
options.dropdownAdapter,
AttachBody
);
}
if (options.selectionAdapter == null) {
if (options.multiple) {
options.selectionAdapter = MultipleSelection;
} else {
options.selectionAdapter = SingleSelection;
}
// Add the placeholder mixin if a placeholder was specified
if (options.placeholder != null) {
options.selectionAdapter = Utils.Decorate(
options.selectionAdapter,
Placeholder
);
}
if (options.allowClear) {
options.selectionAdapter = Utils.Decorate(
options.selectionAdapter,
AllowClear
);
}
if (options.multiple) {
options.selectionAdapter = Utils.Decorate(
options.selectionAdapter,
SelectionSearch
);
}
if (
options.containerCssClass != null ||
options.containerCss != null ||
options.adaptContainerCssClass != null
) {
var ContainerCSS = require(options.amdBase + 'compat/containerCss');
options.selectionAdapter = Utils.Decorate(
options.selectionAdapter,
ContainerCSS
);
}
options.selectionAdapter = Utils.Decorate(
options.selectionAdapter,
EventRelay
);
}
if (typeof options.language === 'string') {
// Check if the language is specified with a region
if (options.language.indexOf('-') > 0) {
// Extract the region information if it is included
var languageParts = options.language.split('-');
var baseLanguage = languageParts[0];
options.language = [options.language, baseLanguage];
} else {
options.language = [options.language];
}
}
if ($.isArray(options.language)) {
var languages = new Translation();
options.language.push('en');
var languageNames = options.language;
for (var l = 0; l < languageNames.length; l++) {
var name = languageNames[l];
var language = {};
try {
// Try to load it with the original name
language = Translation.loadPath(name);
} catch (e) {
try {
// If we couldn't load it, check if it wasn't the full path
name = this.defaults.amdLanguageBase + name;
language = Translation.loadPath(name);
} catch (ex) {
// The translation could not be loaded at all. Sometimes this is
// because of a configuration problem, other times this can be
// because of how Select2 helps load all possible translation files.
if (options.debug && window.console && console.warn) {
console.warn(
'Select2: The language file for "' + name + '" could not be ' +
'automatically loaded. A fallback will be used instead.'
);
}
continue;
}
}
languages.extend(language);
}
options.translations = languages;
} else {
var baseTranslation = Translation.loadPath(
this.defaults.amdLanguageBase + 'en'
);
var customTranslation = new Translation(options.language);
customTranslation.extend(baseTranslation);
options.translations = customTranslation;
}
return options;
};
Defaults.prototype.reset = function () {
function stripDiacritics (text) {
// Used 'uni range + named function' from path_to_url
function match(a) {
return DIACRITICS[a] || a;
}
return text.replace(/[^\u0000-\u007E]/g, match);
}
function matcher (params, data) {
// Always return the object if there is nothing to compare
if ($.trim(params.term) === '') {
return data;
}
// Do a recursive check for options with children
if (data.children && data.children.length > 0) {
// Clone the data object if there are children
// This is required as we modify the object to remove any non-matches
var match = $.extend(true, {}, data);
// Check each child of the option
for (var c = data.children.length - 1; c >= 0; c--) {
var child = data.children[c];
var matches = matcher(params, child);
// If there wasn't a match, remove the object in the array
if (matches == null) {
match.children.splice(c, 1);
}
}
// If any children matched, return the new object
if (match.children.length > 0) {
return match;
}
// If there were no matching children, check just the plain object
return matcher(params, match);
}
var original = stripDiacritics(data.text).toUpperCase();
var term = stripDiacritics(params.term).toUpperCase();
// Check if the text contains the term
if (original.indexOf(term) > -1) {
return data;
}
// If it doesn't contain the term, don't return anything
return null;
}
this.defaults = {
amdBase: './',
amdLanguageBase: './i18n/',
closeOnSelect: true,
debug: false,
dropdownAutoWidth: false,
escapeMarkup: Utils.escapeMarkup,
language: EnglishTranslation,
matcher: matcher,
minimumInputLength: 0,
maximumInputLength: 0,
maximumSelectionLength: 0,
minimumResultsForSearch: 0,
selectOnClose: false,
sorter: function (data) {
return data;
},
templateResult: function (result) {
return result.text;
},
templateSelection: function (selection) {
return selection.text;
},
theme: 'default',
width: 'resolve'
};
};
Defaults.prototype.set = function (key, value) {
var camelKey = $.camelCase(key);
var data = {};
data[camelKey] = value;
var convertedData = Utils._convertData(data);
$.extend(true, this.defaults, convertedData);
};
var defaults = new Defaults();
return defaults;
});
S2.define('select2/options',[
'require',
'jquery',
'./defaults',
'./utils'
], function (require, $, Defaults, Utils) {
function Options (options, $element) {
this.options = options;
if ($element != null) {
this.fromElement($element);
}
this.options = Defaults.apply(this.options);
if ($element && $element.is('input')) {
var InputCompat = require(this.get('amdBase') + 'compat/inputData');
this.options.dataAdapter = Utils.Decorate(
this.options.dataAdapter,
InputCompat
);
}
}
Options.prototype.fromElement = function ($e) {
var excludedData = ['select2'];
if (this.options.multiple == null) {
this.options.multiple = $e.prop('multiple');
}
if (this.options.disabled == null) {
this.options.disabled = $e.prop('disabled');
}
if (this.options.language == null) {
if ($e.prop('lang')) {
this.options.language = $e.prop('lang').toLowerCase();
} else if ($e.closest('[lang]').prop('lang')) {
this.options.language = $e.closest('[lang]').prop('lang');
}
}
if (this.options.dir == null) {
if ($e.prop('dir')) {
this.options.dir = $e.prop('dir');
} else if ($e.closest('[dir]').prop('dir')) {
this.options.dir = $e.closest('[dir]').prop('dir');
} else {
this.options.dir = 'ltr';
}
}
$e.prop('disabled', this.options.disabled);
$e.prop('multiple', this.options.multiple);
if (Utils.GetData($e[0], 'select2Tags')) {
if (this.options.debug && window.console && console.warn) {
console.warn(
'Select2: The `data-select2-tags` attribute has been changed to ' +
'use the `data-data` and `data-tags="true"` attributes and will be ' +
'removed in future versions of Select2.'
);
}
Utils.StoreData($e[0], 'data', Utils.GetData($e[0], 'select2Tags'));
Utils.StoreData($e[0], 'tags', true);
}
if (Utils.GetData($e[0], 'ajaxUrl')) {
if (this.options.debug && window.console && console.warn) {
console.warn(
'Select2: The `data-ajax-url` attribute has been changed to ' +
'`data-ajax--url` and support for the old attribute will be removed' +
' in future versions of Select2.'
);
}
$e.attr('ajax--url', Utils.GetData($e[0], 'ajaxUrl'));
Utils.StoreData($e[0], 'ajax-Url', Utils.GetData($e[0], 'ajaxUrl'));
}
var dataset = {};
// Prefer the element's `dataset` attribute if it exists
// jQuery 1.x does not correctly handle data attributes with multiple dashes
if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
dataset = $.extend(true, {}, $e[0].dataset, Utils.GetData($e[0]));
} else {
dataset = Utils.GetData($e[0]);
}
var data = $.extend(true, {}, dataset);
data = Utils._convertData(data);
for (var key in data) {
if ($.inArray(key, excludedData) > -1) {
continue;
}
if ($.isPlainObject(this.options[key])) {
$.extend(this.options[key], data[key]);
} else {
this.options[key] = data[key];
}
}
return this;
};
Options.prototype.get = function (key) {
return this.options[key];
};
Options.prototype.set = function (key, val) {
this.options[key] = val;
};
return Options;
});
S2.define('select2/core',[
'jquery',
'./options',
'./utils',
'./keys'
], function ($, Options, Utils, KEYS) {
var Select2 = function ($element, options) {
if (Utils.GetData($element[0], 'select2') != null) {
Utils.GetData($element[0], 'select2').destroy();
}
this.$element = $element;
this.id = this._generateId($element);
options = options || {};
this.options = new Options(options, $element);
Select2.__super__.constructor.call(this);
// Set up the tabindex
var tabindex = $element.attr('tabindex') || 0;
Utils.StoreData($element[0], 'old-tabindex', tabindex);
$element.attr('tabindex', '-1');
// Set up containers and adapters
var DataAdapter = this.options.get('dataAdapter');
this.dataAdapter = new DataAdapter($element, this.options);
var $container = this.render();
this._placeContainer($container);
var SelectionAdapter = this.options.get('selectionAdapter');
this.selection = new SelectionAdapter($element, this.options);
this.$selection = this.selection.render();
this.selection.position(this.$selection, $container);
var DropdownAdapter = this.options.get('dropdownAdapter');
this.dropdown = new DropdownAdapter($element, this.options);
this.$dropdown = this.dropdown.render();
this.dropdown.position(this.$dropdown, $container);
var ResultsAdapter = this.options.get('resultsAdapter');
this.results = new ResultsAdapter($element, this.options, this.dataAdapter);
this.$results = this.results.render();
this.results.position(this.$results, this.$dropdown);
// Bind events
var self = this;
// Bind the container to all of the adapters
this._bindAdapters();
// Register any DOM event handlers
this._registerDomEvents();
// Register any internal event handlers
this._registerDataEvents();
this._registerSelectionEvents();
this._registerDropdownEvents();
this._registerResultsEvents();
this._registerEvents();
// Set the initial state
this.dataAdapter.current(function (initialData) {
self.trigger('selection:update', {
data: initialData
});
});
// Hide the original select
$element.addClass('select2-hidden-accessible');
$element.attr('aria-hidden', 'true');
// Synchronize any monitored attributes
this._syncAttributes();
Utils.StoreData($element[0], 'select2', this);
// Ensure backwards compatibility with $element.data('select2').
$element.data('select2', this);
};
Utils.Extend(Select2, Utils.Observable);
Select2.prototype._generateId = function ($element) {
var id = '';
if ($element.attr('id') != null) {
id = $element.attr('id');
} else if ($element.attr('name') != null) {
id = $element.attr('name') + '-' + Utils.generateChars(2);
} else {
id = Utils.generateChars(4);
}
id = id.replace(/(:|\.|\[|\]|,)/g, '');
id = 'select2-' + id;
return id;
};
Select2.prototype._placeContainer = function ($container) {
$container.insertAfter(this.$element);
var width = this._resolveWidth(this.$element, this.options.get('width'));
if (width != null) {
$container.css('width', width);
}
};
Select2.prototype._resolveWidth = function ($element, method) {
var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
if (method == 'resolve') {
var styleWidth = this._resolveWidth($element, 'style');
if (styleWidth != null) {
return styleWidth;
}
return this._resolveWidth($element, 'element');
}
if (method == 'element') {
var elementWidth = $element.outerWidth(false);
if (elementWidth <= 0) {
return 'auto';
}
return elementWidth + 'px';
}
if (method == 'style') {
var style = $element.attr('style');
if (typeof(style) !== 'string') {
return null;
}
var attrs = style.split(';');
for (var i = 0, l = attrs.length; i < l; i = i + 1) {
var attr = attrs[i].replace(/\s/g, '');
var matches = attr.match(WIDTH);
if (matches !== null && matches.length >= 1) {
return matches[1];
}
}
return null;
}
return method;
};
Select2.prototype._bindAdapters = function () {
this.dataAdapter.bind(this, this.$container);
this.selection.bind(this, this.$container);
this.dropdown.bind(this, this.$container);
this.results.bind(this, this.$container);
};
Select2.prototype._registerDomEvents = function () {
var self = this;
this.$element.on('change.select2', function () {
self.dataAdapter.current(function (data) {
self.trigger('selection:update', {
data: data
});
});
});
this.$element.on('focus.select2', function (evt) {
self.trigger('focus', evt);
});
this._syncA = Utils.bind(this._syncAttributes, this);
this._syncS = Utils.bind(this._syncSubtree, this);
if (this.$element[0].attachEvent) {
this.$element[0].attachEvent('onpropertychange', this._syncA);
}
var observer = window.MutationObserver ||
window.WebKitMutationObserver ||
window.MozMutationObserver
;
if (observer != null) {
this._observer = new observer(function (mutations) {
$.each(mutations, self._syncA);
$.each(mutations, self._syncS);
});
this._observer.observe(this.$element[0], {
attributes: true,
childList: true,
subtree: false
});
} else if (this.$element[0].addEventListener) {
this.$element[0].addEventListener(
'DOMAttrModified',
self._syncA,
false
);
this.$element[0].addEventListener(
'DOMNodeInserted',
self._syncS,
false
);
this.$element[0].addEventListener(
'DOMNodeRemoved',
self._syncS,
false
);
}
};
Select2.prototype._registerDataEvents = function () {
var self = this;
this.dataAdapter.on('*', function (name, params) {
self.trigger(name, params);
});
};
Select2.prototype._registerSelectionEvents = function () {
var self = this;
var nonRelayEvents = ['toggle', 'focus'];
this.selection.on('toggle', function () {
self.toggleDropdown();
});
this.selection.on('focus', function (params) {
self.focus(params);
});
this.selection.on('*', function (name, params) {
if ($.inArray(name, nonRelayEvents) !== -1) {
return;
}
self.trigger(name, params);
});
};
Select2.prototype._registerDropdownEvents = function () {
var self = this;
this.dropdown.on('*', function (name, params) {
self.trigger(name, params);
});
};
Select2.prototype._registerResultsEvents = function () {
var self = this;
this.results.on('*', function (name, params) {
self.trigger(name, params);
});
};
Select2.prototype._registerEvents = function () {
var self = this;
this.on('open', function () {
self.$container.addClass('select2-container--open');
});
this.on('close', function () {
self.$container.removeClass('select2-container--open');
});
this.on('enable', function () {
self.$container.removeClass('select2-container--disabled');
});
this.on('disable', function () {
self.$container.addClass('select2-container--disabled');
});
this.on('blur', function () {
self.$container.removeClass('select2-container--focus');
});
this.on('query', function (params) {
if (!self.isOpen()) {
self.trigger('open', {});
}
this.dataAdapter.query(params, function (data) {
self.trigger('results:all', {
data: data,
query: params
});
});
});
this.on('query:append', function (params) {
this.dataAdapter.query(params, function (data) {
self.trigger('results:append', {
data: data,
query: params
});
});
});
this.on('keypress', function (evt) {
var key = evt.which;
if (self.isOpen()) {
if (key === KEYS.ESC || key === KEYS.TAB ||
(key === KEYS.UP && evt.altKey)) {
self.close();
evt.preventDefault();
} else if (key === KEYS.ENTER) {
self.trigger('results:select', {});
evt.preventDefault();
} else if ((key === KEYS.SPACE && evt.ctrlKey)) {
self.trigger('results:toggle', {});
evt.preventDefault();
} else if (key === KEYS.UP) {
self.trigger('results:previous', {});
evt.preventDefault();
} else if (key === KEYS.DOWN) {
self.trigger('results:next', {});
evt.preventDefault();
}
} else {
if (key === KEYS.ENTER || key === KEYS.SPACE ||
(key === KEYS.DOWN && evt.altKey)) {
self.open();
evt.preventDefault();
}
}
});
};
Select2.prototype._syncAttributes = function () {
this.options.set('disabled', this.$element.prop('disabled'));
if (this.options.get('disabled')) {
if (this.isOpen()) {
this.close();
}
this.trigger('disable', {});
} else {
this.trigger('enable', {});
}
};
Select2.prototype._syncSubtree = function (evt, mutations) {
var changed = false;
var self = this;
// Ignore any mutation events raised for elements that aren't options or
// optgroups. This handles the case when the select element is destroyed
if (
evt && evt.target && (
evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP'
)
) {
return;
}
if (!mutations) {
// If mutation events aren't supported, then we can only assume that the
// change affected the selections
changed = true;
} else if (mutations.addedNodes && mutations.addedNodes.length > 0) {
for (var n = 0; n < mutations.addedNodes.length; n++) {
var node = mutations.addedNodes[n];
if (node.selected) {
changed = true;
}
}
} else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
changed = true;
}
// Only re-pull the data if we think there is a change
if (changed) {
this.dataAdapter.current(function (currentData) {
self.trigger('selection:update', {
data: currentData
});
});
}
};
/**
* Override the trigger method to automatically trigger pre-events when
* there are events that can be prevented.
*/
Select2.prototype.trigger = function (name, args) {
var actualTrigger = Select2.__super__.trigger;
var preTriggerMap = {
'open': 'opening',
'close': 'closing',
'select': 'selecting',
'unselect': 'unselecting',
'clear': 'clearing'
};
if (args === undefined) {
args = {};
}
if (name in preTriggerMap) {
var preTriggerName = preTriggerMap[name];
var preTriggerArgs = {
prevented: false,
name: name,
args: args
};
actualTrigger.call(this, preTriggerName, preTriggerArgs);
if (preTriggerArgs.prevented) {
args.prevented = true;
return;
}
}
actualTrigger.call(this, name, args);
};
Select2.prototype.toggleDropdown = function () {
if (this.options.get('disabled')) {
return;
}
if (this.isOpen()) {
this.close();
} else {
this.open();
}
};
Select2.prototype.open = function () {
if (this.isOpen()) {
return;
}
this.trigger('query', {});
};
Select2.prototype.close = function () {
if (!this.isOpen()) {
return;
}
this.trigger('close', {});
};
Select2.prototype.isOpen = function () {
return this.$container.hasClass('select2-container--open');
};
Select2.prototype.hasFocus = function () {
return this.$container.hasClass('select2-container--focus');
};
Select2.prototype.focus = function (data) {
// No need to re-trigger focus events if we are already focused
if (this.hasFocus()) {
return;
}
this.$container.addClass('select2-container--focus');
this.trigger('focus', {});
};
Select2.prototype.enable = function (args) {
if (this.options.get('debug') && window.console && console.warn) {
console.warn(
'Select2: The `select2("enable")` method has been deprecated and will' +
' be removed in later Select2 versions. Use $element.prop("disabled")' +
' instead.'
);
}
if (args == null || args.length === 0) {
args = [true];
}
var disabled = !args[0];
this.$element.prop('disabled', disabled);
};
Select2.prototype.data = function () {
if (this.options.get('debug') &&
arguments.length > 0 && window.console && console.warn) {
console.warn(
'Select2: Data can no longer be set using `select2("data")`. You ' +
'should consider setting the value instead using `$element.val()`.'
);
}
var data = [];
this.dataAdapter.current(function (currentData) {
data = currentData;
});
return data;
};
Select2.prototype.val = function (args) {
if (this.options.get('debug') && window.console && console.warn) {
console.warn(
'Select2: The `select2("val")` method has been deprecated and will be' +
' removed in later Select2 versions. Use $element.val() instead.'
);
}
if (args == null || args.length === 0) {
return this.$element.val();
}
var newVal = args[0];
if ($.isArray(newVal)) {
newVal = $.map(newVal, function (obj) {
return obj.toString();
});
}
this.$element.val(newVal).trigger('change');
};
Select2.prototype.destroy = function () {
this.$container.remove();
if (this.$element[0].detachEvent) {
this.$element[0].detachEvent('onpropertychange', this._syncA);
}
if (this._observer != null) {
this._observer.disconnect();
this._observer = null;
} else if (this.$element[0].removeEventListener) {
this.$element[0]
.removeEventListener('DOMAttrModified', this._syncA, false);
this.$element[0]
.removeEventListener('DOMNodeInserted', this._syncS, false);
this.$element[0]
.removeEventListener('DOMNodeRemoved', this._syncS, false);
}
this._syncA = null;
this._syncS = null;
this.$element.off('.select2');
this.$element.attr('tabindex',
Utils.GetData(this.$element[0], 'old-tabindex'));
this.$element.removeClass('select2-hidden-accessible');
this.$element.attr('aria-hidden', 'false');
Utils.RemoveData(this.$element[0]);
this.$element.removeData('select2');
this.dataAdapter.destroy();
this.selection.destroy();
this.dropdown.destroy();
this.results.destroy();
this.dataAdapter = null;
this.selection = null;
this.dropdown = null;
this.results = null;
};
Select2.prototype.render = function () {
var $container = $(
'<span class="select2 select2-container">' +
'<span class="selection"></span>' +
'<span class="dropdown-wrapper" aria-hidden="true"></span>' +
'</span>'
);
$container.attr('dir', this.options.get('dir'));
this.$container = $container;
this.$container.addClass('select2-container--' + this.options.get('theme'));
Utils.StoreData($container[0], 'element', this.$element);
return $container;
};
return Select2;
});
S2.define('select2/compat/utils',[
'jquery'
], function ($) {
function syncCssClasses ($dest, $src, adapter) {
var classes, replacements = [], adapted;
classes = $.trim($dest.attr('class'));
if (classes) {
classes = '' + classes; // for IE which returns object
$(classes.split(/\s+/)).each(function () {
// Save all Select2 classes
if (this.indexOf('select2-') === 0) {
replacements.push(this);
}
});
}
classes = $.trim($src.attr('class'));
if (classes) {
classes = '' + classes; // for IE which returns object
$(classes.split(/\s+/)).each(function () {
// Only adapt non-Select2 classes
if (this.indexOf('select2-') !== 0) {
adapted = adapter(this);
if (adapted != null) {
replacements.push(adapted);
}
}
});
}
$dest.attr('class', replacements.join(' '));
}
return {
syncCssClasses: syncCssClasses
};
});
S2.define('select2/compat/containerCss',[
'jquery',
'./utils'
], function ($, CompatUtils) {
// No-op CSS adapter that discards all classes by default
function _containerAdapter (clazz) {
return null;
}
function ContainerCSS () { }
ContainerCSS.prototype.render = function (decorated) {
var $container = decorated.call(this);
var containerCssClass = this.options.get('containerCssClass') || '';
if ($.isFunction(containerCssClass)) {
containerCssClass = containerCssClass(this.$element);
}
var containerCssAdapter = this.options.get('adaptContainerCssClass');
containerCssAdapter = containerCssAdapter || _containerAdapter;
if (containerCssClass.indexOf(':all:') !== -1) {
containerCssClass = containerCssClass.replace(':all:', '');
var _cssAdapter = containerCssAdapter;
containerCssAdapter = function (clazz) {
var adapted = _cssAdapter(clazz);
if (adapted != null) {
// Append the old one along with the adapted one
return adapted + ' ' + clazz;
}
return clazz;
};
}
var containerCss = this.options.get('containerCss') || {};
if ($.isFunction(containerCss)) {
containerCss = containerCss(this.$element);
}
CompatUtils.syncCssClasses($container, this.$element, containerCssAdapter);
$container.css(containerCss);
$container.addClass(containerCssClass);
return $container;
};
return ContainerCSS;
});
S2.define('select2/compat/dropdownCss',[
'jquery',
'./utils'
], function ($, CompatUtils) {
// No-op CSS adapter that discards all classes by default
function _dropdownAdapter (clazz) {
return null;
}
function DropdownCSS () { }
DropdownCSS.prototype.render = function (decorated) {
var $dropdown = decorated.call(this);
var dropdownCssClass = this.options.get('dropdownCssClass') || '';
if ($.isFunction(dropdownCssClass)) {
dropdownCssClass = dropdownCssClass(this.$element);
}
var dropdownCssAdapter = this.options.get('adaptDropdownCssClass');
dropdownCssAdapter = dropdownCssAdapter || _dropdownAdapter;
if (dropdownCssClass.indexOf(':all:') !== -1) {
dropdownCssClass = dropdownCssClass.replace(':all:', '');
var _cssAdapter = dropdownCssAdapter;
dropdownCssAdapter = function (clazz) {
var adapted = _cssAdapter(clazz);
if (adapted != null) {
// Append the old one along with the adapted one
return adapted + ' ' + clazz;
}
return clazz;
};
}
var dropdownCss = this.options.get('dropdownCss') || {};
if ($.isFunction(dropdownCss)) {
dropdownCss = dropdownCss(this.$element);
}
CompatUtils.syncCssClasses($dropdown, this.$element, dropdownCssAdapter);
$dropdown.css(dropdownCss);
$dropdown.addClass(dropdownCssClass);
return $dropdown;
};
return DropdownCSS;
});
S2.define('select2/compat/initSelection',[
'jquery'
], function ($) {
function InitSelection (decorated, $element, options) {
if (options.get('debug') && window.console && console.warn) {
console.warn(
'Select2: The `initSelection` option has been deprecated in favor' +
' of a custom data adapter that overrides the `current` method. ' +
'This method is now called multiple times instead of a single ' +
'time when the instance is initialized. Support will be removed ' +
'for the `initSelection` option in future versions of Select2'
);
}
this.initSelection = options.get('initSelection');
this._isInitialized = false;
decorated.call(this, $element, options);
}
InitSelection.prototype.current = function (decorated, callback) {
var self = this;
if (this._isInitialized) {
decorated.call(this, callback);
return;
}
this.initSelection.call(null, this.$element, function (data) {
self._isInitialized = true;
if (!$.isArray(data)) {
data = [data];
}
callback(data);
});
};
return InitSelection;
});
S2.define('select2/compat/inputData',[
'jquery',
'../utils'
], function ($, Utils) {
function InputData (decorated, $element, options) {
this._currentData = [];
this._valueSeparator = options.get('valueSeparator') || ',';
if ($element.prop('type') === 'hidden') {
if (options.get('debug') && console && console.warn) {
console.warn(
'Select2: Using a hidden input with Select2 is no longer ' +
'supported and may stop working in the future. It is recommended ' +
'to use a `<select>` element instead.'
);
}
}
decorated.call(this, $element, options);
}
InputData.prototype.current = function (_, callback) {
function getSelected (data, selectedIds) {
var selected = [];
if (data.selected || $.inArray(data.id, selectedIds) !== -1) {
data.selected = true;
selected.push(data);
} else {
data.selected = false;
}
if (data.children) {
selected.push.apply(selected, getSelected(data.children, selectedIds));
}
return selected;
}
var selected = [];
for (var d = 0; d < this._currentData.length; d++) {
var data = this._currentData[d];
selected.push.apply(
selected,
getSelected(
data,
this.$element.val().split(
this._valueSeparator
)
)
);
}
callback(selected);
};
InputData.prototype.select = function (_, data) {
if (!this.options.get('multiple')) {
this.current(function (allData) {
$.map(allData, function (data) {
data.selected = false;
});
});
this.$element.val(data.id);
this.$element.trigger('change');
} else {
var value = this.$element.val();
value += this._valueSeparator + data.id;
this.$element.val(value);
this.$element.trigger('change');
}
};
InputData.prototype.unselect = function (_, data) {
var self = this;
data.selected = false;
this.current(function (allData) {
var values = [];
for (var d = 0; d < allData.length; d++) {
var item = allData[d];
if (data.id == item.id) {
continue;
}
values.push(item.id);
}
self.$element.val(values.join(self._valueSeparator));
self.$element.trigger('change');
});
};
InputData.prototype.query = function (_, params, callback) {
var results = [];
for (var d = 0; d < this._currentData.length; d++) {
var data = this._currentData[d];
var matches = this.matches(params, data);
if (matches !== null) {
results.push(matches);
}
}
callback({
results: results
});
};
InputData.prototype.addOptions = function (_, $options) {
var options = $.map($options, function ($option) {
return Utils.GetData($option[0], 'data');
});
this._currentData.push.apply(this._currentData, options);
};
return InputData;
});
S2.define('select2/compat/matcher',[
'jquery'
], function ($) {
function oldMatcher (matcher) {
function wrappedMatcher (params, data) {
var match = $.extend(true, {}, data);
if (params.term == null || $.trim(params.term) === '') {
return match;
}
if (data.children) {
for (var c = data.children.length - 1; c >= 0; c--) {
var child = data.children[c];
// Check if the child object matches
// The old matcher returned a boolean true or false
var doesMatch = matcher(params.term, child.text, child);
// If the child didn't match, pop it off
if (!doesMatch) {
match.children.splice(c, 1);
}
}
if (match.children.length > 0) {
return match;
}
}
if (matcher(params.term, data.text, data)) {
return match;
}
return null;
}
return wrappedMatcher;
}
return oldMatcher;
});
S2.define('select2/compat/query',[
], function () {
function Query (decorated, $element, options) {
if (options.get('debug') && window.console && console.warn) {
console.warn(
'Select2: The `query` option has been deprecated in favor of a ' +
'custom data adapter that overrides the `query` method. Support ' +
'will be removed for the `query` option in future versions of ' +
'Select2.'
);
}
decorated.call(this, $element, options);
}
Query.prototype.query = function (_, params, callback) {
params.callback = callback;
var query = this.options.get('query');
query.call(null, params);
};
return Query;
});
S2.define('select2/dropdown/attachContainer',[
], function () {
function AttachContainer (decorated, $element, options) {
decorated.call(this, $element, options);
}
AttachContainer.prototype.position =
function (decorated, $dropdown, $container) {
var $dropdownContainer = $container.find('.dropdown-wrapper');
$dropdownContainer.append($dropdown);
$dropdown.addClass('select2-dropdown--below');
$container.addClass('select2-container--below');
};
return AttachContainer;
});
S2.define('select2/dropdown/stopPropagation',[
], function () {
function StopPropagation () { }
StopPropagation.prototype.bind = function (decorated, container, $container) {
decorated.call(this, container, $container);
var stoppedEvents = [
'blur',
'change',
'click',
'dblclick',
'focus',
'focusin',
'focusout',
'input',
'keydown',
'keyup',
'keypress',
'mousedown',
'mouseenter',
'mouseleave',
'mousemove',
'mouseover',
'mouseup',
'search',
'touchend',
'touchstart'
];
this.$dropdown.on(stoppedEvents.join(' '), function (evt) {
evt.stopPropagation();
});
};
return StopPropagation;
});
S2.define('select2/selection/stopPropagation',[
], function () {
function StopPropagation () { }
StopPropagation.prototype.bind = function (decorated, container, $container) {
decorated.call(this, container, $container);
var stoppedEvents = [
'blur',
'change',
'click',
'dblclick',
'focus',
'focusin',
'focusout',
'input',
'keydown',
'keyup',
'keypress',
'mousedown',
'mouseenter',
'mouseleave',
'mousemove',
'mouseover',
'mouseup',
'search',
'touchend',
'touchstart'
];
this.$selection.on(stoppedEvents.join(' '), function (evt) {
evt.stopPropagation();
});
};
return StopPropagation;
});
/*!
* jQuery Mousewheel 3.1.13
*
* Released under the MIT license
* path_to_url
*/
(function (factory) {
if ( typeof S2.define === 'function' && S2.define.amd ) {
// AMD. Register as an anonymous module.
S2.define('jquery-mousewheel',['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS style for Browserify
module.exports = factory;
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
slice = Array.prototype.slice,
nullLowestDeltaTimeout, lowestDelta;
if ( $.event.fixHooks ) {
for ( var i = toFix.length; i; ) {
$.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
}
}
var special = $.event.special.mousewheel = {
version: '3.1.12',
setup: function() {
if ( this.addEventListener ) {
for ( var i = toBind.length; i; ) {
this.addEventListener( toBind[--i], handler, false );
}
} else {
this.onmousewheel = handler;
}
// Store the line height and page height for this particular element
$.data(this, 'mousewheel-line-height', special.getLineHeight(this));
$.data(this, 'mousewheel-page-height', special.getPageHeight(this));
},
teardown: function() {
if ( this.removeEventListener ) {
for ( var i = toBind.length; i; ) {
this.removeEventListener( toBind[--i], handler, false );
}
} else {
this.onmousewheel = null;
}
// Clean up the data we added to the element
$.removeData(this, 'mousewheel-line-height');
$.removeData(this, 'mousewheel-page-height');
},
getLineHeight: function(elem) {
var $elem = $(elem),
$parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
if (!$parent.length) {
$parent = $('body');
}
return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16;
},
getPageHeight: function(elem) {
return $(elem).height();
},
settings: {
adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
normalizeOffset: true // calls getBoundingClientRect for each event
}
};
$.fn.extend({
mousewheel: function(fn) {
return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
},
unmousewheel: function(fn) {
return this.unbind('mousewheel', fn);
}
});
function handler(event) {
var orgEvent = event || window.event,
args = slice.call(arguments, 1),
delta = 0,
deltaX = 0,
deltaY = 0,
absDelta = 0,
offsetX = 0,
offsetY = 0;
event = $.event.fix(orgEvent);
event.type = 'mousewheel';
// Old school scrollwheel delta
if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; }
if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; }
if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; }
if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
// Firefox < 17 horizontal scrolling related to DOMMouseScroll event
if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
deltaX = deltaY * -1;
deltaY = 0;
}
// Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
delta = deltaY === 0 ? deltaX : deltaY;
// New school wheel delta (wheel event)
if ( 'deltaY' in orgEvent ) {
deltaY = orgEvent.deltaY * -1;
delta = deltaY;
}
if ( 'deltaX' in orgEvent ) {
deltaX = orgEvent.deltaX;
if ( deltaY === 0 ) { delta = deltaX * -1; }
}
// No change actually happened, no reason to go any further
if ( deltaY === 0 && deltaX === 0 ) { return; }
// Need to convert lines and pages to pixels if we aren't already in pixels
// There are three delta modes:
// * deltaMode 0 is by pixels, nothing to do
// * deltaMode 1 is by lines
// * deltaMode 2 is by pages
if ( orgEvent.deltaMode === 1 ) {
var lineHeight = $.data(this, 'mousewheel-line-height');
delta *= lineHeight;
deltaY *= lineHeight;
deltaX *= lineHeight;
} else if ( orgEvent.deltaMode === 2 ) {
var pageHeight = $.data(this, 'mousewheel-page-height');
delta *= pageHeight;
deltaY *= pageHeight;
deltaX *= pageHeight;
}
// Store lowest absolute delta to normalize the delta values
absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
if ( !lowestDelta || absDelta < lowestDelta ) {
lowestDelta = absDelta;
// Adjust older deltas if necessary
if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
lowestDelta /= 40;
}
}
// Adjust older deltas if necessary
if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
// Divide all the things by 40!
delta /= 40;
deltaX /= 40;
deltaY /= 40;
}
// Get a whole, normalized value for the deltas
delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta);
deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
// Normalise offsetX and offsetY properties
if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
var boundingRect = this.getBoundingClientRect();
offsetX = event.clientX - boundingRect.left;
offsetY = event.clientY - boundingRect.top;
}
// Add information to the event object
event.deltaX = deltaX;
event.deltaY = deltaY;
event.deltaFactor = lowestDelta;
event.offsetX = offsetX;
event.offsetY = offsetY;
// Go ahead and set deltaMode to 0 since we converted to pixels
// Although this is a little odd since we overwrite the deltaX/Y
// properties with normalized deltas.
event.deltaMode = 0;
// Add event and delta to the front of the arguments
args.unshift(event, delta, deltaX, deltaY);
// Clearout lowestDelta after sometime to better
// handle multiple device types that give different
// a different lowestDelta
// Ex: trackpad = 3 and mouse wheel = 120
if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
return ($.event.dispatch || $.event.handle).apply(this, args);
}
function nullLowestDelta() {
lowestDelta = null;
}
function shouldAdjustOldDeltas(orgEvent, absDelta) {
// If this is an older event and the delta is divisable by 120,
// then we are assuming that the browser is treating this as an
// older mouse wheel event and that we should divide the deltas
// by 40 to try and get a more usable deltaFactor.
// Side note, this actually impacts the reported scroll distance
// in older browsers and can cause scrolling to be slower than native.
// Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
}
}));
S2.define('jquery.select2',[
'jquery',
'jquery-mousewheel',
'./select2/core',
'./select2/defaults',
'./select2/utils'
], function ($, _, Select2, Defaults, Utils) {
if ($.fn.select2 == null) {
// All methods that should return the element
var thisMethods = ['open', 'close', 'destroy'];
$.fn.select2 = function (options) {
options = options || {};
if (typeof options === 'object') {
this.each(function () {
var instanceOptions = $.extend(true, {}, options);
var instance = new Select2($(this), instanceOptions);
});
return this;
} else if (typeof options === 'string') {
var ret;
var args = Array.prototype.slice.call(arguments, 1);
this.each(function () {
var instance = Utils.GetData(this, 'select2');
if (instance == null && window.console && console.error) {
console.error(
'The select2(\'' + options + '\') method was called on an ' +
'element that is not using Select2.'
);
}
ret = instance[options].apply(instance, args);
});
// Check if we should be returning `this`
if ($.inArray(options, thisMethods) > -1) {
return this;
}
return ret;
} else {
throw new Error('Invalid arguments for Select2: ' + options);
}
};
}
if ($.fn.select2.defaults == null) {
$.fn.select2.defaults = Defaults;
}
return Select2;
});
// Return the AMD loader configuration so it can be used outside of this file
return {
define: S2.define,
require: S2.require
};
}());
// Autoload the jQuery bindings
// We know that all of the modules exist above this, so we're safe
var select2 = S2.require('jquery.select2');
// Hold the AMD module references on the jQuery function that was just loaded
// This allows Select2 to use the internal loader outside of this file, such
// as in the language files.
jQuery.fn.select2.amd = S2;
// Return the Select2 instance for anyone who is importing it.
return select2;
}));
```
|
```makefile
#/
# @license Apache-2.0
#
#
#
# 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.
#/
# VARIABLES #
# Define the path to the [plato][1] executable.
#
# To install plato:
#
# ```bash
# $ npm install plato
# ```
#
# [1]: path_to_url
PLATO ?= $(BIN_DIR)/plato
# Define the command for determining JavaScript code complexity:
JAVASCRIPT_COMPLEXITY ?= $(PLATO)
# Define the title of the report:
PLATO_REPORT_TITLE ?= 'JavaScript Complexity'
# Define the output file path for the HTML report generated by plato:
PLATO_HTML_REPORT ?= $(JAVASCRIPT_COMPLEXITY_OUT)/index.html
# Define the command-line options to use when invoking the plato executable:
JAVASCRIPT_COMPLEXITY_FLAGS ?= \
--dir $(JAVASCRIPT_COMPLEXITY_OUT) \
--title $(PLATO_REPORT_TITLE)
# RULES #
# View a complexity report.
#
# This target opens an HTML complexity report in a local web browser.
view-plato-report:
$(QUIET) $(OPEN) $(PLATO_HTML_REPORT)
.PHONY: view-plato-report
```
|
```xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<set key="set1" value="1" />
<set key="set2" value="2" />
<set key="set3" value="3" />
<set key="set4" value="4" />
</config>
```
|
The Wigan by-election of 11 March 1942 was held after the death of the incumbent Labour MP, John Parkinson.
The by-election was only contested by one candidate, William Foster, who retained the seat for Labour unopposed.
Result of the by-election
Result of the previous General Election
}
References
Wigan
Wigan
1940s in Lancashire
Elections in the Metropolitan Borough of Wigan
Wigan 1942
Wigan 1942
Unopposed by-elections to the Parliament of the United Kingdom (need citation)
|
```java
package org.eclipse.milo.opcua.sdk.client.model.types.objects;
import java.util.concurrent.CompletableFuture;
import org.eclipse.milo.opcua.sdk.client.model.types.variables.PropertyType;
import org.eclipse.milo.opcua.sdk.core.QualifiedProperty;
import org.eclipse.milo.opcua.sdk.core.ValueRanks;
import org.eclipse.milo.opcua.stack.core.UaException;
import org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeId;
import org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode;
import org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger;
public interface StateType extends BaseObjectType {
QualifiedProperty<UInteger> STATE_NUMBER = new QualifiedProperty<>(
"path_to_url",
"StateNumber",
ExpandedNodeId.parse("nsu=path_to_url"),
ValueRanks.Scalar,
UInteger.class
);
/**
* Get the local value of the StateNumber Node.
* <p>
* The returned value is the last seen; it is not read live from the server.
*
* @return the local value of the StateNumber Node.
* @throws UaException if an error occurs creating or getting the StateNumber Node.
*/
UInteger getStateNumber() throws UaException;
/**
* Set the local value of the StateNumber Node.
* <p>
* The value is only updated locally; it is not written to the server.
*
* @param stateNumber the local value to set for the StateNumber Node.
* @throws UaException if an error occurs creating or getting the StateNumber Node.
*/
void setStateNumber(UInteger stateNumber) throws UaException;
/**
* Read the value of the StateNumber Node from the server and update the local value if the
* operation succeeds.
*
* @return the {@link UInteger} value read from the server.
* @throws UaException if a service- or operation-level error occurs.
*/
UInteger readStateNumber() throws UaException;
/**
* Write a new value for the StateNumber Node to the server and update the local value if
* the operation succeeds.
*
* @param stateNumber the {@link UInteger} value to write to the server.
* @throws UaException if a service- or operation-level error occurs.
*/
void writeStateNumber(UInteger stateNumber) throws UaException;
/**
* An asynchronous implementation of {@link #readStateNumber()}.
*
* @return a CompletableFuture that completes successfully with the property value or completes
* exceptionally if an operation- or service-level error occurs.
*/
CompletableFuture<? extends UInteger> readStateNumberAsync();
/**
* An asynchronous implementation of {@link #writeStateNumber(UInteger)}.
*
* @return a CompletableFuture that completes successfully with the operation result or
* completes exceptionally if a service-level error occurs.
*/
CompletableFuture<StatusCode> writeStateNumberAsync(UInteger stateNumber);
/**
* Get the StateNumber {@link PropertyType} Node, or {@code null} if it does not exist.
* <p>
* The Node is created when first accessed and cached for subsequent calls.
*
* @return the StateNumber {@link PropertyType} Node, or {@code null} if it does not exist.
* @throws UaException if an error occurs creating or getting the Node.
*/
PropertyType getStateNumberNode() throws UaException;
/**
* Asynchronous implementation of {@link #getStateNumberNode()}.
*
* @return a CompletableFuture that completes successfully with the
* ? extends PropertyType Node or completes exceptionally if an error occurs
* creating or getting the Node.
*/
CompletableFuture<? extends PropertyType> getStateNumberNodeAsync();
}
```
|
```powershell
Import-Module HelpersCommon
Describe "WinRM based remoting session abrupt disconnect" -Tags 'Feature','RequireAdminOnWindows' {
BeforeAll {
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()
$pendingTest = (Test-IsWinWow64)
$skipTest = !$IsWindows
if ($pendingTest)
{
$PSDefaultParameterValues["it:pending"] = $true
return
}
elseif ($skipTest)
{
$PSDefaultParameterValues["it:skip"] = $true
return
}
$disconnectScript = @'
param (
[int] $RunspaceId
)
$rs = Get-Runspace -Id $RunspaceId
if (! $rs.RunspaceIsRemote)
{
throw "Runspace $RunspaceId is not a remote runspace."
}
# Wait up to one minute for Runspace to begin running script
$count = 0
while (($rs.RunspaceAvailability -ne "busy") -and (++$count -le 60)) {
Start-Sleep 1
}
if ($rs.RunspaceAvailability -ne "busy")
{
throw "Runspace $RunspaceId is not running any script after one minute."
}
# Disconnect running runspace
$rs.Disconnect()
'@
$endPointName = "PowerShell.$(${PSVersionTable}.GitCommitId)"
$endPoint = (Get-PSSessionConfiguration -Name $endPointName -ErrorAction SilentlyContinue).Name
if ($endPoint -eq $null)
{
Enable-PSRemoting -SkipNetworkProfileCheck
$endPoint = (Get-PSSessionConfiguration -Name $endPointName).Name
}
$session = New-RemoteSession -ConfigurationName $endPoint
$ps = [powershell]::Create("NewRunspace")
$ps.AddScript($disconnectScript).AddParameter("RunspaceId", $session.Runspace.Id)
}
AfterAll {
$global:PSDefaultParameterValues = $originalDefaultParameterValues
if ($pendingTest -or $skipTest)
{
return
}
if ($ps -ne $null) { $ps.Dispose() }
if ($session -ne $null) { Remove-PSSession -Session $session }
if ($script:job -ne $null) { Remove-Job -Job $script:job -Force }
}
It "Verifies that an abruptly disconnected Invoke-Command session produces a valid disconnected job needed for reconnect" {
# Start disconnect script running.
$ps.BeginInvoke()
# Run script synchronously on remote session, and let disconnect script disconnect the remote session.
$null = Invoke-Command -Session $session -ScriptBlock {
1..60 | ForEach-Object { Start-Sleep 1; "Output $_" }
} -ErrorAction SilentlyContinue
# Session should be disconnected.
$session.State | Should -BeLikeExactly 'Disconnect*'
# A disconnected job should have been created for reconnect.
$script:job = Get-Job | Where-Object { $_.ChildJobs[0].Runspace.Id -eq $session.Runspace.Id }
$script:job | Should -Not -BeNullOrEmpty
$script:job.State | Should -BeExactly 'Disconnected'
}
}
```
|
```cuda
#pragma once
#include <ATen/core/TensorBase.h>
#include <ATen/cuda/detail/TensorInfo.cuh>
#include <ATen/native/CanUse32BitIndexMath.h>
namespace at::cuda::detail {
TORCH_CUDA_CU_API bool maybeOverlappingIndices(const at::TensorBase &t);
using at::native::canUse32BitIndexMath;
template <typename scalar, typename IndexType>
TensorInfo<scalar, IndexType>
getTensorInfo(const at::TensorBase &t) {
IndexType sz[MAX_TENSORINFO_DIMS];
IndexType st[MAX_TENSORINFO_DIMS];
int dims = t.dim();
for (int i = 0; i < dims; ++i) {
sz[i] = t.size(i);
st[i] = t.stride(i);
}
scalar* data_ptr = nullptr;
if constexpr (std::is_const<scalar>::value) {
data_ptr = t.const_data_ptr<scalar>();
} else {
data_ptr = t.mutable_data_ptr<scalar>();
}
return TensorInfo<scalar, IndexType>(
data_ptr, dims, sz, st);
}
} // namespace at::cuda::detail
```
|
```xml
import { SwitchField } from '@@/form-components/SwitchField';
import { FormValues } from './types';
export function DeploymentOptions({
setFieldValue,
values,
}: {
values: FormValues;
setFieldValue: <T>(field: string, value: T) => void;
}) {
return (
<>
<div className="form-group">
<div className="col-sm-12">
<SwitchField
checked={values.prePullImage}
name="prePullImage"
label="Pre-pull images"
tooltip="When enabled, the image will be pre-pulled before deployment is started. This is useful in scenarios where the image download may be delayed or intermittent and would subsequently cause the deployment to fail"
labelClass="col-sm-3 col-lg-2"
onChange={(value) => setFieldValue('prePullImage', value)}
data-cy="pre-pull-images-switch"
/>
</div>
</div>
<div className="form-group">
<div className="col-sm-12">
<SwitchField
checked={values.retryDeploy}
name="retryDeploy"
label="Retry deployment"
tooltip="When enabled, this will allow the edge agent to retry deployment if failed to deploy initially"
labelClass="col-sm-3 col-lg-2"
onChange={(value) => setFieldValue('retryDeploy', value)}
data-cy="retry-deployment-switch"
/>
</div>
</div>
</>
);
}
```
|
List of military corps – List of Finnish corps in the Winter War
This is a list of Finnish corps that existed during the Winter War, 1939–1940.
I Corps – formed February 19, 1940
II Corps
III Corps
IV Corps
Swedish Volunteer Corps – Svenska Frivilligkåren, arrived in 1940
See also
Finnish Army
List of Finnish corps in the Continuation War
List of Finnish divisions in the Continuation War
List of Finnish divisions in the Winter War
References
Winter War
Military units and formations of Finland in World War II
Finnish corps
Winter War
|
Gene Frederick Dresselhaus (November 7, 1929, Ancón, Panama – September 29, 2021, California) was an American condensed matter physicist. He is known as a pioneer of spintronics and for his 1955 discovery of the eponymous Dresselhaus effect.
Biography
Dresselhaus studied physics at University of California, Berkeley, receiving his bachelor's degree in 1951 and his doctorate in 1955. At Berkeley he worked under the supervision of Charles Kittel and Arthur F. Kip on early cyclotron resonance experiments on semiconductors and semimetals. As a postdoc Dresselhaus was for the academic year 1955–1956 an instructor at the University of Chicago. From 1956 to 1960 he was an assistant professor at Cornell University. He was also a consultant to General Electric Research Laboratories from 1956 to 1960 and to the Oak Ridge National Laboratory from 1958 to 1960. From 1960 he worked at the Lincoln Laboratory of the Massachusetts Institute of Technology (MIT) and from 1977 at the Francis Bitter National Magnetic Laboratory of MIT. He was also a professor of physics at MIT.
He did research on carbon nanotubes, fullerenes, electronic energy bands in solids, surface impedance of metals, excitons in insulators, electronic surface states, optical properties of solids, and high-temperature superconductivity.
In 1958 he married the physicist Mildred Dresselhaus (née Spiewak) — for many years the couple extensively collaborated and published their scientific findings. They had a daughter and three sons.
Honors and awards
He was elected in 1966 a Fellow of the American Physical Society.
In 2022 he shared the Oliver E. Buckley Condensed Matter Prize with Emmanuel I. Rashba for "pioneering research on spin-orbit coupling in crystals, particularly the foundational discovery of chiral spin-orbit interactions, which continue to enable new developments in spin transport and topological materials." His death in 2021 shortly preceded the announcement of the prize.
Selected publications
Articles
Books
(1st edition 1988)
(1st edition 2001)
References
1929 births
2021 deaths
University of California, Berkeley alumni
Massachusetts Institute of Technology faculty
Condensed matter physicists
20th-century American physicists
21st-century American physicists
Fellows of the American Physical Society
Oliver E. Buckley Condensed Matter Prize winners
Cornell University faculty
People from Panamá District
Panamanian people of German descent
|
```javascript
import {
get,
set,
del,
clear,
keys,
values,
entries,
setMany,
update,
getMany,
delMany,
} from '../dist';
a(
get,
set,
del,
clear,
keys,
values,
entries,
setMany,
update,
getMany,
delMany,
);
```
|
Numerous police and international intelligence agencies classify the Hells Angels Motorcycle Club as a motorcycle gang and contend that members carry out widespread violent crimes, including drug dealing, trafficking in stolen goods, gunrunning, extortion, and prostitution rings. Members of the organization have continuously asserted that they are only a group of motorcycle enthusiasts who have joined to ride motorcycles together, to organize social events such as group road trips, fundraisers, parties, and motorcycle rallies, and that any crimes are the responsibility of the individuals who carried them out and not the club as a whole.
There are more Hells Angels chapters in California than in any other U.S. state. With over 300 members statewide, the Hells Angels are the most significant motorcycle gang in California in terms of membership and criminal activity. The club has a significant role in the manufacture and distribution of methamphetamine, and in other illegal enterprises. The West Coast faction of the HAMC has also been especially active in the infiltration of legitimate businesses, including motorcycle and automobile services, catering operations, bars, restaurants, and antique stores. Additionally, the California Hells Angels have associated in criminal ventures with the Aryan Brotherhood, the Mexican Mafia, and the Nazi Lowriders. A 1990 review by the California Department of Justice determined that the 215 members of fourteen Hells Angels chapters in the state had been arrested an average of 10.4 times each, in a total of 2,202 charges – most commonly, narcotics violations, assault, weapons violations, burglary and robbery. The offenders' crimes generally escalated after they gained membership of the club.
Early incidents
Shortly after the foundation of the Hells Angels' North Sacramento chapter in 1956, twelve club members were arrested at a house party in Sacramento's Ben Ali neighborhood. After being elected sheriff of Sacramento County in January 1961, John Misterly began a campaign of surveillance and purported harassment against the Hells Angels. In 1964, one Hells Angel, Ernest Cannada, appeared before the Sacramento City Council and read a letter protesting alleged illegal tactics against the club by sheriff's deputies. During this period, Hells Angels members would reportedly remove their "colors" before entering Sacramento County due to Misterly's hostility towards the club. In the spring of 1965, James "Mother" Miles, the founding president of the Sacramento Hells Angels, disbanded the chapter and relocated it to Richmond, where its members joined forces with Hells Angels from the San Francisco Bay Area to form a Nomads chapter. Misterly took credit for ousting the Angels from the county and denied that his deputies were guilty of harassing the bikers. Misterly's supporters told The Sacramento Bee that his "harassment techniques" were "instrumental in the breakup of the Hells Angels", however. Miserly allowed the Hells Angels to return to Sacramento as part of a one-day truce to attend the funeral of Miles, who was killed in a motorcycle accident in Berkeley on January 9, 1966. Up to 300 Hells Angels from eleven club chapters throughout California were present at Miles' funeral before they were given a police escort out of the city. The Sacramento chapter was re-established in 1973.
On January 29, 1963, the Hells Angels' Oakland headquarters was raided by police, and seven club members were charged with the alleged gang rape of a 29 old woman, which took place on January 27. Other charges included Hitlerism, marijuana possession and theft. A swastika flag and a picture of Adolf Hitler, with the inscription "Hitler is alive, our buddy", were also found on the premises.
Five people were charged with inciting a riot and one with the illegal possession of a weapon after the Tulare County Sheriff's Department, the California Highway Patrol and local police dispersed approximately 200 members of seven motorcycle clubs from across California, including the Hells Angels and the Galloping Goose, who converged in Porterville on August 31 and September 1, 1963. Among numerous incidents of violence, a group of bikers allegedly stormed Sierra View District Hospital in an attempt to continue a fight with G.E. Montgomery, a resident of the city who was receiving medical treatment after earlier being beaten at a local tavern.
48 Hells Angels members and their girlfriends were arrested at their clubhouse on San Francisco's Folsom Street on December 5, 1964, on charges of robbery, assault with a deadly weapon, possession of marijuana, contributing to the delinquency of a minor (three of the girls were alleged to be underage), aiding suspected felons, and the alleged rape of a twenty-five-year-old woman, who claimed she was assaulted on the premises the day before. The raid also pertained to a robbery in a nearby alley of a man who was allegedly knocked unconscious and dispossessed of his wallet.
A group of Hells Angels members, as well as some of their girlfriends, were charged in connection with a fight which broke out during a birthday celebration at a cafe in San Francisco in September 1965. The violence allegedly erupted when the bikers attacked two police officers who arrived at the establishment.
Sixteen Hells Angels members attacked anti-Vietnam War demonstrators at a Vietnam Day Committee protest march in Berkeley on October 16, 1965, resulting in six Hells Angels being arrested and one police officer suffering a broken leg. The incident led to a collection of students, left-wing political groups and labor unions led by Allen Ginsberg and Jerry Rubin meeting with a group of motorcycle club representatives, headed by the president of the Sacramento HAMC chapter, in the cafeteria at San Jose State College, seeking assurance that a planned protest march in Oakland on November 20 would go undisturbed. On November 19, five Hells Angels members led by the club's reputed national leader Sonny Barger held a press conference at their bail bondsman's office, announcing that the club would not attend the protest the following day as "Any physical encounter would only produce sympathy for this mob of traitors", according to Barger. He went on to read out a telegram sent to President Lyndon B. Johnson, reading "I volunteer a group of loyal Americans for behind the line duty in Vietnam. We feel that a crack group of trained guerillas could demoralize the Viet Cong and advance the cause of freedom." President Johnson did not reply to the letter.
Eight Hells Angels were arrested when a fight broke out in a Daly City tavern on April 15, 1966, following the funeral of San Francisco HAMC chapter member Larry Dean Lucas, who died in a motorcycle accident near Santa Maria on April 9.
For at least five years beginning in 1967, the Oakland chapter of the Hells Angels turned over weapons acquired on the black market or locations of weapons, which could otherwise be used by Black Panther Party and Weather Underground radicals, to the Oakland Police Department (OPD) in exchange for the release of jailed Hells Angels members. OPD sergeant Edward "Ted" Hilliard testified in 1972 that he accepted guns, dynamite and grenades from the club's president Sonny Barger in return for deals on arrests during at least fifteen separate meetings, the most recent of which took place in the spring of 1971. Hilliard also testified that Barger had offered "to deliver the bagged body of a leftist for every Angel released from jail". He denied, however, that authorities permitted crimes committed by the Hells Angels.
Hells Angels member Charles "Crazy Chuck" Forsyth was arrested in possession of marijuana on February 16, 1967, and the San Bernardino County Sheriff's Department was subsequently granted a warrant by the Ontario Municipal Court Judge Richard C. Garner to search the Gray Ranch in Alta Loma, which served as the headquarters of the club's San Bernardino chapter, as deputies had probable cause to suspect the ranch contained more marijuana. The Gray Ranch was rented by the Hells Angels from landlord W.H. LaBand of West Covina. On February 18, 1967, thirteen Hells Angels members, including "Berdoo" chapter president Otto Friedli, and eight women were arrested on drug and weapons possession charges when 27 officers of the Sheriff's Department vice squad and special enforcement unit, and the California Highway Patrol raided the ranch. Four boys aged three to six, who were the children of Hells Angels members, were sent to juvenile hall. The arrests were largely uneventful, although one Hells Angel, David Friedli, had to be restrained when he attacked a photographer from The Sun-Telegram. Quantities of marijuana and other drugs; an arsenal of 21 firearms, including semi-automatic rifles and pistols, and ammunition; several switchblade knives, Nazi insignia; motorcycles and motorcycle parts were seized in the raid. On March 20, 1967, four of the accused were released due to lack of evidence. Dennis L. Thomas and David Lee Baumgardner pleaded guilty to possession of marijuana on November 27, 1967. Due to the publicity the raid received, four senior members of the San Bernardino chapter were granted a change of venue to stand trial, with their cases moving to Santa Ana in Orange County. Friedli was convicted of maintaining a place for the unlawful use of marijuana, and unlawful possession of a firearm by a former felon. On February 29, 1968, two other Hells Angels, Theodore Moses Medina and Ralph D. Ladd, were found guilty of marijuana possession. The Hells Angels subsequently abandoned the Gray Ranch.
Sex crimes
Approximately 300 Hells Angels descended on Monterey during Labor Day Weekend 1964 for the purpose of raising funds among themselves to transport the body of a former member, who was killed in an accident, back to his mother in North Carolina. On September 6, 1964, two girls, aged fourteen and fifteen, were allegedly taken from their dates and gang raped by Hells Angels members. Four Hells Angels were jailed for rape, although the charges were dismissed on September 25 due to insufficient evidence. The club was also banned from the city. The incident prompted an investigation into the Hells Angels and other motorcycle gangs by the Attorney General of California. The Lynch Report, compiled over a six-month period and released on March 15, 1965, detailed various alleged crimes committed by the club, such as assault, robbery, forgery, car theft and trafficking in narcotics.
In April 1968, almost the entire membership of the Hells Angels' San Diego chapter were indicted on charges of kidnapping, assault, false imprisonment, robbery and rape. The charges related to an incident in which a twenty-eight-year-old woman was abducted from a San Diego bar and taken to a nearby residence, where she was beaten, raped and tortured by several Hells Angels members and their girlfriends.
A woman was allegedly gang raped by four members of the San Diego chapter of the Hells Angels on July 27, 1969. After filing charges against the four, she was subjected to threats and intimidated into leaving the San Diego area, and she refused to testify in court for fear of reprisal.
Members of the San Bernardino Hells Angels chapter, along with bikers from the Glendale chapter of the Mongols, the Straight Satans of Venice, and the Glendale Night Riders, committed a sexual assault on a fifteen year-old girl in August 1972. On April 5, 1973, Hells Angels members John R. Fisher, Glenn M. Little, John W. Stratton, David L. Winn and Thomas A. Neilly were among eleven motorcycle gang members convicted in Los Angeles of rape and sex perversion.
A woman alleged that she was beaten and assaulted with a rubber dildo by two San Diego Hells Angels members' girlfriends, and that she was forced to orally copulate a Hells Angel and a German Shepherd dog after she accepted a ride home from a biker funeral with the group in 1975. The charges were dismissed as law enforcement were unable to locate the woman after she filed a criminal complaint.
On March 6, 1977, a woman was allegedly stripped of her clothing, beaten and forced to ingest LSD by Hells Angels members and their girlfriends at the residence of the club's San Diego chapter president. She had been accompanied to the residence under the pretense of attending a party after meeting a Hells Angel at an Ocean Beach bar earlier that night.
Drug trafficking
According to the Drug Enforcement Administration (DEA), the Hells Angels began large-scale drug distribution during mid-1967, and soon became the leading manufacturer and distributor of LSD in California. At that time, the HAMC became involved in a drug war with the Gypsy Jokers in the San Francisco Bay Area. The clubs reached an accord that year; the Jokers left California for Oregon, where the Angels agreed to stay out of. The California Department of Justice estimated that the Hells Angels distributed approximately $31 million of narcotics between 1969 and 1972.
Thirty-three members of the Oakland Hells Angels chapter, including the club's president Sonny Barger, and four of their girlfriends were arrested on drug charges after police raided a bar and a duplex apartment in the city on August 30, 1968. $7,000 worth of heroin and $2,500 worth of other narcotics were confiscated, as were firearms – including an M16 rifle, two shotguns and an M1 carbine – and a large cache of ammunition, knives, chains and suspected stolen merchandise. The raids were the result of a three-week investigation.
Hells Angels Oakland chapter president and national leader Sonny Barger was arrested on narcotics charges after Donald Howarth, a film studio property manager and 1967 Mr. America from Studio City, was apprehended while walking towards Barger's Oakland home with seventeen ounces of cocaine and thirty ounces of heroin (with an estimated retail worth of $350,000) in a suitcase on April 11, 1970. Barger temporarily resigned as president of the Oakland chapter in June 1970 to fight the charges, but returned to the position within months after his successor, John "Johnny Angel" Palomar, was sentenced to a ten-year prison term for shooting a bartender. The drug charges against Barger were later dismissed, although Howarth was convicted and sentenced to serve five years-to-life in prison.
Palomar, while deputizing as president of the Oakland HAMC chapter on behalf of Barger, was charged with narcotics and weapons violations after a raid on his home by a police drug squad uncovered small quantities of drugs and a small arsenal of firearms on June 25, 1970. The charges were later dismissed, although he was sentenced to ten years in prison after being convicted of the shooting of a bartender on January 26, 1971.
Oakland Hells Angels members Sonny Barger, Sergey Walton, Donald Duane "Whitey" Smith and "Oakland" Gary Benjamin Popkin were charged with the May 21, 1972, murder of Servio Winston Agero – a drug trafficker from McAllen, Texas, who had travelled to Oakland with a consignment of narcotics for sale – which allegedly occurred following a dispute over an $80,000 cocaine deal. A prosecution witness, Richard Ivaldi, testified that he witnessed Barger shoot Agero dead as he slept at the home of an absent acquaintance, and that Barger subsequently ordered the others to set fire to the residence. The four defendants were acquitted on December 29, 1972, following a seven-week trial after Ivaldi's credibility came under scrutiny. According to Barger's chief attorney James Crew, Ivaldi himself was involved in the conspiracy to kill Agero and, knowing he was a prime suspect and fearing retaliation from the "Texas Mafia", he tried to shift the blame to the Hells Angels. The killing of Agero was one of five possibly linked murders committed in the area around that time. Three men – drug dealers Kelly Patrick Smith, Willard Thomas and Gary Kemp, an acquaintance of Ivaldi – were found shot to death in a house near San Leandro the day after Agero's murder, and the body of a woman, Karen S. Long, was discovered in the trunk of a car in Oakland on May 26. An informant had led investigating detectives to the location of the automobile in which Long's corpse was found. John Joseph Devaney, Long's former husband, was found dead in a car in Hayward on June 14 in an apparent suicide by carbon monoxide poisoning.
Barger was sentenced to a prison term of ten years-to-life on March 16, 1973, after he was convicted of possession of narcotics for sale (thirty-seven grams of heroin), and possession of a weapon by a convicted felon. His girlfriend, Sharon Gruhlke, was a co-defendant; her case ended in a mistrial when a jury failed to reach a verdict. According to police intelligence reports, Barger had designated San Jose chapter president Fillmore Cross as his international successor during a motorcycle run at Bass Lake prior to his imprisonment. Cross was also imprisoned, for possession of amphetamine in 1975, however, and Barger allegedly continued to lead the Hells Angels from his cell at Folsom Prison. Barger was paroled on November 3, 1977, after serving four-and-a-half years of his sentence.
Drug dealer Gail Elmer English and Vallejo HAMC chapter president John Henderson were killed, and another Hells Angel, Ted DeWilde, was left in critical condition as a result of a gun battle at English's Vallejo home on November 1, 1973. English was allegedly killed on the orders of senior San Francisco Bay Area Hells Angels member Kenneth Jay "K.O." Owen for intruding on Owen's narcotics franchise.
Hells Angels associate Henry Crabtree was extradited from Arkansas – where he was charged with the October 18, 1979, murder of Michael Burch – in November 1979 to testify for the government against nine East Bay club members and associates, implicating the bikers in drug dealing which took place between 1968 and mid-1977. Crabtree, who had grossed $100,000 per month from selling methamphetamine he obtained from HAMC members, withdrew from the club's milieu in August 1977 and began cooperating with authorities in January 1978 after learning that Oakland chapter enforcer James Brandes had put a $10,000 contract on his life in the belief that he had turned informant. Members of the Aryan Brotherhood attempted to shoot Crabtree and also interrogated his friends in an effort to collect the bounty. Crabtree testified in front of a grand jury that he and two Hells Angels – Kenneth Owen and Sergey Walton, the Oakland chapter president – stole bottles of phenyl-2-propanone and enough glassware to build five methamphetamine laboratories during a heist at a local chemical company in January 1977.
Douglas Chester Schultz, president of the San Diego Hells Angels, was arrested on October 31, 1985, and indicted on eighteen counts of possession of methamphetamine, intent to distribute and conspiracy. Two employees of Schultz's limousine service, Gerald Robert Ladley and Thomas Longnecker, were also charged with distributing methamphetamine from the business. On April 8, 1986, Schultz and three others were charged with the February 1986 assault of William Eugene Barr, a federal informant in the case. Schultz was sentenced to five years in prison for conspiracy to distribute methamphetamine and using a telephone to facilitate a drug transaction on June 30, 1986. He was one of four members voted out of the San Diego chapter during the fall of that year. The club later reinstated him, however, as they had unknowingly violated their national charter by expelling an incarcerated member.
San Diego Hells Angels chapter president Guy Russell Castiglione and his girlfriend, Kathleen Rebecca Pirelli, were indicted on charges of conspiracy to possess two pounds of methamphetamine with intent to distribute after the drugs were found in Pirelli's purse during a search by U.S. Border Patrol agents at a Temecula checkpoint on May 13, 1989. Castiglione pleaded guilty to the charges on December 20, 1989, while Pirelli pleaded guilty to using a telephone to facilitate a drug transaction. On March 5, 1990, Castiglione was sentenced to five years in federal prison and fined $100,000, and Pirelli was sentenced to two years.
Thirteen members of the Hades Riders MC in Fresno were arrested in July 1989 on narcotics and weapons violations charges. As part of the investigation, authorities seized a methamphetamine lab, along with various amounts of methamphetamine, marijuana and cocaine, as well as forty weapons – including several assault rifles – and evidence showing a conspiracy involving the Hades Rides and the Monterey Hells Angels chapter to distribute methamphetamine.
Odis "Buck" Garrett, president of the Hells Angels' Vallejo-based nomads chapter, and several of his associates were indicted in late 1989 and early 1990 on various narcotics and weapons charges. Garrett was additionally charged with continuing criminal enterprise, money laundering and conspiracy to distribute eleven pounds of methamphetamine to the club's Winston-Salem, North Carolina, chapter. Authorities believed that Hells Angels members and associates were operating a large-scale methamphetamine distribution ring, with clandestine laboratories in San Bernardino, Butte and Modoc counties. Garrett, who oversaw what prosecutors described as the largest methamphetamine manufacturing and distribution case in the United States, made millions of dollars from distributing thousands of kilograms of the drug. He was convicted of various conspiracy, possession, distribution, and interstate drug trafficking charges in June 1992 and was sentenced to life in prison without possibility of parole on September 28, 1992. Former Winston-Salem chapter officer Charles Terry Norman testified against members of his former club in the case, which also resulted in the convictions of Carl Dulinsky and Harris Blane Shimel. Garrett was sentenced to an additional four consecutive life sentences after he was convicted on four counts of murder in an unrelated case on July 26, 1995. He died at FCI Lompoc aged seventy-four on February 12, 2017.
Nine members and associates of the San Diego Hells Angels chapter were indicted on narcotic and weapon violation charges in December 1990. The bikers allegedly manufactured and distributed methamphetamine between Jamul, Indio and Las Vegas, Nevada.
The DEA, along with state and local law enforcement agencies, began investigating the HAMC's San Jose and Grass Valley-based California nomads chapters as a result of intelligence suggesting that the Hells Angels was manufacturing and transporting methamphetamine to Savanna, Georgia. The San Jose and nomads chapter clubhouses were raided, with authorities seizing weapons, 80 pounds of ephedrine, three pounds of methamphetamine, $230,000 in cash. Several club members and associates in California and Georgia were arrested.
Hells Angels member Obediah Breer was arrested on state charges on August 15, 2018, when a police SWAT team executed a search warrant on his Escondido residence and discovered cocaine, methamphetamine, pharmaceutical pills and a firearm. The warrant was based on an incident in which Breer was alleged to have brandished a firearm during a traffic encounter with other motorists on August 5, 2018, and then evaded police officers in a subsequent chase. On September 11, 2018, when Breer was out of custody on pretrial release for the earlier offense, police officers conducted a traffic stop of Breer on his motorcycle and discovered that he was in possession of methamphetamine and cocaine. He was sentenced to twelve years' imprisonment for methamphetamine distribution on June 17, 2019.
On June 25, 2019, Modesto Hells Angels chapter president Randy Picchi, his wife Tina Picchi, Michael Mize, and club prospect Michael Pack were arrested and charged with conspiracy to distribute and possess with intent to distribute methamphetamine. Three other members of the chapter, including the vice-president and secretary, were indicted for various offences on September 19, 2019. Vice-president Michael Shafer was charged with conspiring to distribute marijuana, conspiring to distribute heroin, distribution of marijuana, and two counts of use of a communication facility to facilitate a drug trafficking offense, and secretary Patrick Gonzales was charged with being a felon in possession of firearm and ammunition, while Ricky Blackwell was charged with possession of cocaine with intent to distribute, possession of a firearm in furtherance of a drug trafficking offense, and possession of a firearm after suffering a misdemeanor domestic violence conviction. The case was the result of a months-long investigation into the chapter by the Federal Bureau of Investigation (FBI), Bureau of Alcohol, Tobacco, Firearms and Explosives (ATF), IRS Criminal Investigation and two local police departments. On February 8, 2021, Blackwell was sentenced to six-and-a-half years in prison for possession with intent to distribute cocaine and possession of a firearm in furtherance of a drug trafficking offense.
Altamont Free Concert
One major event in Hells Angels' history involved the December 6, 1969 Altamont Free Concert at the Altamont Speedway – partially documented in the 1970 film Gimme Shelter – featuring Jefferson Airplane, The Flying Burrito Brothers, and The Rolling Stones. The Grateful Dead were also scheduled to perform but cancelled at the last minute owing to the ensuing circumstances at the venue. The Angels had been hired by The Rolling Stones as crowd security for a fee which was said to include $500 worth of beer. The Angels parked their motorcycles in front of the stage in order to create a buffer between the stage and the hundreds of thousands of concertgoers. Crowd management proved to be difficult, resulting in both spectator injury and death. Over the course of the day, the Hells Angels became increasingly agitated as the crowd turned more aggressive. At a later murder trial of Hells Angel Alan Passaro, a security guard testified he heard the Hells Angels being summoned over the loudspeakers when the helicopter bearing The Rolling Stones landed. Debate after the event was over whether the Hells Angels were to manage security for the entire concert or just for The Rolling Stones. Sam Cutler, the Stones' agent who had arranged to pay the Hells Angels said their role was as bodyguards to the Rolling Stones. This was denied by the Hells Angels as well as others connected to the event. During the opening act of Santana, the Hells Angels surged into the crowd numerous times to keep persons off stage. By the time The Rolling Stones took stage, numerous incidents of violence had occurred both between the Hells Angels and internally within the crowd, not the least of which featured a circus performer weighing over 350 pounds stripping naked and running amok amid the concertgoers. Audience members attempted to detain him. Eventually, the irate man was subdued after Angels intervened with fists and makeshift weapons, while a crowd of 4,000–5,000 looked on from the edge of the stage. The aggression did not subside there. After an Angel's motorcycle was toppled, club members' tempers continued to escalate, their ire spread wide between the audience and performers alike. At one point, Marty Balin of Jefferson Airplane was knocked unconscious following an altercation with an Angel, an event later depicted in Gimme Shelter. The Grateful Dead refused to play following the Balin incident, and left the venue. A shoving match erupted near the stage during a rendition of the song "Under My Thumb". As the song began, a man in the audience, Meredith Hunter, was allegedly harassed, then violently pushed back by the Hells Angels. He returned, producing a handgun. Hunter was stabbed to death. A Hells Angel member, Alan Passaro, was later acquitted of murder on grounds of self-defense. After the concert and critical media attention given to the HAMC, Sonny Barger went on a local California radio station to justify the actions of the Hells Angels and to present their side of the story. He claimed that violence only started once the crowd began vandalizing the Hells Angels' motorcycles. Barger would later claim that Hunter fired a shot which struck a Hells Angels member with what he described as "just a flesh wound."
In 2005, after a two-year exhaustive cold-case renewal of the file, the Alameda County District Attorney's office permanently closed the case. An enhanced and slowed down version of the original film footage was produced for the police, and after examining it, Alameda County Sheriff's Office sergeant Scott Dudek said Passaro, who died in 1985, was the only person to stab Hunter and he did so only after Hunter pointed a handgun at the stage where the Stones were performing. Alan Passaro is the only person who stabbed Meredith Hunter, Dudek said, adding that Passaro's lawyer confirmed his client was the sole assailant. "Passaro acted with a knife to stop Meredith Hunter from shooting."
Gang wars
Axemen
In 1970, during a conflict with the Axemen motorcycle gang, San Diego Hells Angels chapter vice president Andrew Horn was shot and killed with a sawed-off shotgun by Axemen biker Rick McCart, who was acquitted of the killing and subsequently fled the area. In 1975, several Axemen members survived the bombing of their clubhouse via a remote-controlled explosive device. An Axemen member was shot dead as he rode his motorcycle the following year. According to a police informant and former Hells Angel, the murder was committed by the San Diego Hells Angels.
Mongols
The Hells Angels became involved in a dispute with the Mongols after the rival club began wearing a California "bottom rocker" – a patch displayed on a biker's "colors" denoting the club's territory. The Mongols had previously listed only individual chapter locations on their "colors", and the Hells Angels asserted that they were the only club allowed to wear a California patch as they were the dominant club in the state. The Mongols objected to this, infuriating the Angels. The Hells Angels declared war on the Mongols at a meeting on July 7, 1977. The conflict would result in the deaths of four Mongols members and an innocent fifteen-year-old boy. Mongols member Allyn Bishop was shot off his motorcycle in Kern County on July 29, 1977. Two other members of the Mongols' San Diego chapter – Raymond "Jingles" Smith and chapter president Emerson "Redbeard" Morris – were shot with an ArmaLite AR-15 assault rifle while riding their motorcycles on Interstate 15 near Escondido on September 5, 1977. One man died at the scene while the other died at Palomar Medical Center. The two bikers' spouses, who were riding on the back of their motorcycles, were wounded; Morris' wife Delores was left paralyzed. On September 9, 1977, a van bomb was detonated at the funeral of Morris and Smith in Lemon Grove, injuring two Mongols members and the father of a member. Mongols member Henry Jimenez and Raymond Hernandez, the fifteen-year-old brother of another biker, were killed in an explosion after Jimenez began working on a tire rigged with a bomb at a motorcycle repair shop in Highland Park, Los Angeles on September 24, 1977. Days later, San Fernando Valley Mongols chapter president Luis Gutierrez survived a car bombing outside his home. The violence led to a crackdown by law enforcement, and on October 7, 1977, 32 members and associates of the San Diego Hells Angels were arrested on various charges, including chapter president Thomas James "Crunch" Renzulli who was charged with attempted murder. Fourteen of those arrested were "patch holding" members of the San Diego chapter. The arrests followed a ten-month investigation of the club, which involved infiltration by a police informant. Six sticks of dynamite were discovered attached to the vehicle of a San Diego Mongols member on October 11, 1977. ATF agents matched the bomb components to the explosives given to the informant by Renzulli on September 30. Five Hells Angels members – including "Gorgeous" Guy Russell Castiglione, James "Brett" Eaton and Thomas James Renzulli – were indicted on racketeering and conspiracy charges in September 1982. The indictment alleges the group were responsible for the murders of Morris and Smith as well as the bombing of their funeral. Another Hells Angel, Thomas Heath, was convicted in 1994 of two counts of second-degree murder for the killings of Hernandez and Jimenez. He was sentenced to seven years in prison.
The Mongols seized control of Southern California from the Hells Angels during the 1980s. San Diego Hells Angels sergeant-at-arms Raymond "Fat Ray" Piltz became the Angels' first casualty in the conflict when he was shot and killed in a biker bar in Lemon Grove on January 17, 1982. Five Mongols members were indicted over his death, and one – Bill Michael "Mike" Munz – was convicted of involuntary manslaughter and sentenced to six years in prison.
In an attempt to end the Hells Angels–Mongols war, the clubs agreed to a truce, in which the Angels yielded Southern California to the Mongols. Under the terms of the truce, the Angels retained their charters in Monterey, Orange County, Riverside, Fresno, Ventura, San Diego and San Bernardino, but allowed the Mongols free rein over the rest of the Southern California and gave their rivals permission to wear a California "rocker". The Mongols, in turn, promised not to establish any chapters in Northern California. The feud was reactivated, however, when 50 to 100 members of the rival clubs clashed at a motorcycle trade show in Long Beach on February 10, 1989, resulting in San Bernardino Hells Angels chapter sergeant-at-arms Aristeo Andres "Art" Carbajal being stabbed to death and several others wounded. No suspects have been arrested in the murder.
Hells Angels member Christian Harvey Tate was killed when several gunshots fired from another vehicle struck him in the back while he was riding his motorcycle on Interstate 40 near Ludlow on April 27, 2002. He had been returning to San Diego after attending the Laughlin River Run motorcycle rally. Although police surmised at the time that Tate's death was connected to the River Run riot, a fatal confrontation between members of the Hells Angels and the Mongols which occurred in Laughlin, Nevada, earlier that day, the homicide has gone unsolved.
Seventeen members and associates of the Hells Angels in San Diego County were arrested on June 11, 2003, as a result of a two-year investigation into drug trafficking and racketeering. The HAMC clubhouse in El Cajon was raided as part of the operation. Federal wiretaps also recorded club members planning to kill Mongols members in retaliation for the murder of Christian Tate. Ten HAMC members, including San Diego chapter president Guy Russell Castiglione and sergeant-at-arms Mark Alan Toycen, pleaded guilty to conspiracy. Castiglione was sentenced to seventy months' imprisonment on September 22, 2005, and Toycen was sentenced to fourteen years' on July 28, 2006. The convictions effectively dismantled the chapter.
A two-year ATF investigation of the HAMC resulted in the arrests of twenty-six club members in the San Fernando Valley, San Francisco and Ventura County on December 3, 2003, on racketeering charges filed at the U.S. District Court for the District of Nevada and stemming from the River Run riot. Nine Hells Angels, including the chapter president and three officers, were arrested in the San Fernando Valley and another seventeen were taken into custody in northern California. The arrests were carried out as part of a five-state operation involving over 700 federal, state and municipal law enforcement officers which resulted in the arrests of fifty-seven Hells Angels across the country and the seizure of approximately 125 firearms, more than a thousand rounds of ammunition, several stolen vehicles and a quarter-pound of methamphetamine. Three Californian Angels – Maurice "Pete" Eunice, Raymond Foakes and James Hannigan – were among the six club members convicted of committing a violent crime in the aid of racketeering following their extradition to Las Vegas, Nevada, to face charges. On February 13, 2007, Eunice was sentenced to two-and-a-half years' imprisonment and Foakes was sentenced to twelve months', while Hannigan was sentenced to two years' on February 23, 2007. Charges were dismissed against the remaining thirty-six defendants in the case.
In 2008, Mark "Papa" Guardado, the president of the San Francisco chapter, was shot dead after a bar fight in the Mission District of San Francisco. Christopher Bryan Ablett, a member of the rival Mongols MC club, was later arrested for Guardado's murder.
On May 21, 2017, Mongols member Joshua Herbert exited a car driven by another, unidentified, man and opened fire with a revolver on a group of five Hells Angels members who were refuelling their motorcycles at a Shell gas station in Riverside, killing Orange County Hells Angel James Duty and wounding another. The incident followed a series of shootings and attempted murders between the clubs over the previous eight months in Orange and Los Angeles counties. After a month-long investigation by the Riverside Police Department, FBI, ATF and California Department of Justice, Herbert was charged with murder and firearm offenses June 21, 2017.
Aryan Brotherhood
Oakland Hells Angels chapter vice-president Michael O'Farrell was killed after being stabbed in the neck, chest and back, and shot four times from behind at a San Leandro bar on June 6, 1989. Another Hells Angels member, Michael Musick, was wounded in the attack. Police stated that O'Farrell's killing may have been the result of a power struggle between the HAMC and the Aryan Brotherhood in the East Bay. Two Aryan Brotherhood members charged with O'Farrell's homicide, Aaron "Jerry" Marsh and Michael Bruce "Tank" Shepherd, were arrested in the following weeks. Marsh was taken into custody in Manteca on June 27, and Shepherd was apprehended by San Bernardino County Sheriff's Department deputies and California Highway Patrol troopers on Route 60 on July 26 after a high-speed chase through Chino and Ontario. Shepherd allegedly admitted his guilt in the killing to his lawyer Steven Gore. Marsh was strangled to death in Pelican Bay State Prison on July 25, 1997, by cellmate Gary J. Littrell after refusing an order from the Aryan Brotherhood leadership to murder another inmate, and Shepherd committed suicide by hanging himself in his cell at Santa Ana Central Jail in December 2004 shortly after pleading guilty in a RICO case.
Vagos
On October 26, 2001, a fight between a small group of Hells Angels and Vagos escalated into a mass brawl involving up to 80 participants at a motorcycle swap meet held at the Orange County Fairgrounds in Costa Mesa. Motorcycle parts such as handlebars and tail pipes were used as weapons in the melee, which ended when officers from four local police departments and the Orange County Sheriff's Department arrived at the scene approximately five minutes after the fighting began and bikers began to flee. A man was arrested on suspicion of assaulting a police officer, and two injured people were treated at the scene. Investigators were unable to determine the amount of property damage and the number of people injured due to a lack of cooperation from witnesses. It was also unclear if members of the Mongols, who also attended the swap meet, became involved.
In 2011, president of the San Jose chapter Jeffrey Pettigrew, was shot four times in the back on September 23, 2011, at a casino in Sparks, Nevada. Two California members of the Vagos motorcycle club at the crime scene were also shot but survived. Pettigrew was in Sparks for 'Street Vibrations', a long-running motorcycle festival in the Reno area. Sparks declared a state of emergency after another motorcyclist wearing Vagos colors was shot shortly afterwards in the stomach from a passing vehicle. Cesar Villagrana, who had been with Pettigrew, was charged with discharging a firearm and other offenses. Ernesto Manuel Gonzales was later arrested in San Francisco in connection with the death of Pettigrew. Another Hell's Angel, Steve Tausan, an "enforcer" for the Santa Cruz chapter, was shot at Pettigrew's funeral. According to police, after the shooting, the suspect, Steve Ruiz, disappeared and one or more people tampered with the crime scene, washing away bloodstains and removing evidence of the shooting.
Hells Angels member James Vincent Dickson was among five people arrested after a shooting at the Third Street Tavern in Highland on November 6, 2021, which left three people injured, including two of the suspects. On April 24, 2022, Dickson was killed and three others were wounded in a shooting at the Marquis Lounge in San Bernardino. In an incident that law enforcement theorized was carried out in retaliation for Dickson's killing, six Vagos and one Hells Angel were injured when a group of Angels opened fire on Vagos bikers on U.S. Route 95 in Henderson, Nevada, on May 29, 2022.
Infighting
On January 22, 1972, five Oakland Hells Angels – Sonny Barger, Russell Stanley Beyea, Bobby V. "the Durt" England, Gary Benjamin Popkin and Bert Samuel Stefanson – were charged with attempted murder, kidnapping and assault with a deadly weapon after being arrested while driving through Redwood Regional Park by police and park rangers who discovered two bound, gagged and beaten club prospects – William D. Hood and Danny Jarman – in the trunk of the vehicle. All five pleaded guilty to a lesser charge of unlawful imprisonment.
In September 1972, Hells Angels member William "Whispering Bill" Pifer, who was suffering from terminal throat cancer while incarcerated at Alameda County jail in Oakland on various state and federal charges, offered police information on a Hells Angels burial ground in exchange for immunity from prosecution in order to spend the remainder of his life as a free man. His testimony led Mendocino County deputies to a ranch, owned by former Oakland Hells Angels chapter vice-president George J. "Baby Huey" Wethern and his wife Helen, near Ukiah, where they discovered the bodies of two club prospects – Charles "Charlie" Baker and Thomas Shepherd "Big Tom" Shull – and a woman, Patricia Ann McNight, in abandoned wells on October 30 and November 1, 1972. Baker and Shull had been beaten and strangled to death by Pifer and other members of the club's Richmond chapter after being spiked with LSD at a party on January 15, 1971, while the McNight was killed by a gunshot to the head. Police also seized cocaine and stolen firearms at the ranch. Wethern and his wife were charged with drug and stolen property possession, and four other Hells Angels – Edward "Junior" Carter, Chester M. "Festus" Green, William Mark "Zorro" Mitten and William John Moran – were charged with murder and accessory to murder. Wethern became a government witness and the charges against him and his wife were dismissed. While in protective custody on November 7, 1972, he attempted to blind himself by gouging pencils into his eyes before attempting to strangle his wife. Carter pleaded guilty to accessory to murder, and charges against Green and Mitten were dropped. On April 5, 1973, Moran was convicted of the murder of Baker and acquitted of Shull's murder. Pifer died after the first few days of the trial, during which Green testified for the prosecution. Richmond chapter president "Rotten" Richard Allen Barker was convicted of first-degree murder and involuntary manslaughter in the deaths of Baker and Schull in 1975.
Theodore L. "Ted" DeWilde, president of the Vallejo Hells Angels chapter, was indicted on federal gun law violation charges in June 1973 after allegedly selling two dynamite bombs and a machine gun to an undercover federal agent. He initially pleaded guilty to the charges and was scheduled to be sentenced in May 1974, but judge Philip C. Wilkins granted a motion by DeWilde's lawyer allowing him to withdraw the guilty plea and demand a jury trial. DeWilde later disappeared, allegedly murdered, welded inside a fifty-five-gallon drum and disposed of in the San Francisco Bay by his fellow Hells Angels who became concerned that methamphetamine addiction and pending prison time may have caused him to cooperate with authorities.
Vallejo Hells Angels chapter president Dennis C. Myhre was one of five men charged with various counts of rape and sex perversion in relation to a January 13, 1974, sexual assault reported by a twenty-three-year-old Richmond woman. The victim in the case died of a heroin overdose two days after attorney Hugh Comisky, who was retained as counsel for one of the accused, inadvertently revealed her home address during pretrial proceedings. Myhre later disappeared. According to informants, he was killed by the Hells Angels, who believed that he was cooperating with authorities.
Oakland Hells Angels chapter member Ray Dale "Stork" Keefauver, who had been scheduled to testify for the prosecution in a Redwood City murder trial, was found shot to death in a ravine near Port Costa on June 16, 1974. On August 24, the bodies of Hells Angels associate Alvin Lloyd Prater and his wife Mary Ellen (née Kanihan) were discovered by the side of a road near Sunol. They had each been fatally shot in the head two days earlier after being handcuffed and beaten. Alvin Prater was allegedly killed over the theft of an engine block from a Harley-Davidson motorcycle belonging to a Hells Angels member. In June 1979, James Ezekiel "Jim-Jim" Brandes, an enforcer and senior member of the HAMC's Oakland chapter, was charged with the murders of Keefauver and the Praters as part of a racketeering case against the club. Brandes, who was implicated in a total of four of five homicides, was ultimately never convicted of any. The initial trial ended in a mistrial in July 1980 as did the subsequent retrial in February 1981. He later hanged himself in prison . The murders remain unsolved.
Mark Gary Robles, sergeant-at-arms of the Hells Angels' San Diego chapter, was fatally shot several times in the back before his body was discovered in his parked van in San Diego's Clairemont neighborhood in October 1976. Three former Hells Angels later told investigators that Robles was killed by a fellow club member, Douglas Chester "Dutch" Schultz, with approval from the Oakland "mother chapter" during an internal dispute.
San Francisco HAMC chapter president Harry "the Horse" Flamburis and his girlfriend Dannette Barrett were each shot in head and killed after being bound at their home in Daly City on January 6, 1977. $22,000 worth of cocaine and a quantity of LSD was also stolen from a safe at the house. Prior to his death, Flamburis had resisted the Hells Angels' move into prostitution and narcotics racketeering. His successor as San Francisco chapter president, "Flash" Gordon Gary Grow, operated a brothel in partnership with Odis "Buck" Garrett, president of the nomads chapter in Vallejo. Flamburis was laid to rest at Cypress Lawn Memorial Park in Colma on January 15, and his Harley-Davidson motorcycle was buried with him three months later on April 22. His funeral was attended by approximately 200 members of the Hells Angels and other motorcycle clubs from as far away as Hawaii, Anchorage, Alaska, and Lowell, Massachusetts. Although police at the time suspected two or three possible motives, the murders have never been solved. The house in which Flamburis and Barrett were killed was burned down in an apparent arson on April 24, 1977.
Three members of the Hells Angels' Los Angeles chapter were arrested on January 6, 1978, in connection with the theft of two thousand pounds of dynamite, which was stolen from a construction site in San Diego County in September 1977. The trio were found in possession of the stolen explosives, as well as a machine gun and other weapons. Following the seizure, search warrants were served on the residences of all known members of the Los Angeles Hells Angels. When serving a warrant at the home of chapter president Ora Ray "Indian Ray" Glore, police found him dead with nine .22 caliber bullet wounds to the head. Officers discovered files on every Hells Angels member in the United States and Europe at Glore's residence. According to a statement given to investigators by one of the Hells Angels arrested in the explosives seizure, "Old Man" John Noble, Glore was assassinated over a personal dispute with Russell Beyea, a senior member of the Oakland Hells Angels. Noble claimed to have been present at a meeting of California chapter officers in Oakland at which a majority of the participants voted in favor of killing Glore.
Arms trafficking
Bert Stefanson and Sergey C. Walton, both members of the Hells Angels' Oakland chapter, were charged with weapons and narcotics violations when police found loaded pistols, hand grenades, tear gas canisters, blasting caps, three bags of cocaine and $8,911 in cash in the car in which they were travelling after they were stopped for speeding in Sacramento in March 1972. Walton pleaded guilty to cocaine possession and appeared as a witness during the trial of Stefanson, who was convicted on five felony charges of possessing narcotics and transporting explosives on February 16, 1973.
Members of the San Diego Hells Angels chapter were suspected in the theft of 2,000 pounds of dynamite from a construction site in San Diego County in September 1977. On January 6, 1978, three members of the Hells Angels' Los Angeles chapter were arrested in possession of a case of the stolen dynamite as well as a machine gun and other weapons. Law enforcement subsequently served search warrants on the residences of all known Hells Angels members in Los Angeles. Officers serving a warrant at the home of Los Angeles chapter president Ora Ray "Indian Ray" Glore discovered his corpse; he had been shot in the head. Glore's unsolved killing was reportedly carried out by members of his own club.
Oakland chapter member Sergey Walton was arrested in October 1979 and convicted in March 1980 of possessing a machine gun. He fled from San Francisco County Jail on March 24, 1981, while awaiting transfer to a federal prison in Illinois to begin serving an eight-year sentence. His disappearance was not discovered until March 28, 1981, when he was scheduled to be transferred. On May 28, 1981, Walton was apprehended by the Bureau of Alcohol, Tobacco, Firearms and Explosives (ATF) and the U.S. Marshals Service at a cabin at Ben Lomond in the Santa Cruz Mountains. Two women found in the cabin with Walton – Kimberly Lee "Kimbra" Townsend and Laufey Gayle Owen, the wife of HAMC member Kenneth Owen – were charged with harboring a fugitive. Two machine guns and accompanying ammunition were also found. Walton was sentenced in February 1983 for the jailbreak to ten years in prison to be served consecutively with the prior eight-year sentence. He later became a government witness and entered the Federal Witness Protection Program. Former deputy sheriff Louis "Lou" Ivankovich pleaded guilty on February 18, 1983, to conspiring to aid Walton in his escape. He was sentenced to three years in federal prison. Walton died on October 19, 2006, aged sixty-two.
In November 1981, a task force of federal, state and local law enforcement officers raided a Hells Angels clubhouse in San Diego and confiscated machine guns, shotguns, more than fifty handguns, explosives, explosives manuals, torture kits, electronic eavesdropping equipment, police radio scanners and narcotics.
Violent incidents
Hells Angels member Robert Lee "Wildman" Bright was charged with criminal mayhem after he, aided by two other inmates, used a spoon heated on a hot plate to burn a tattoo, which resembled the HAMC insignia, off of a cellmate's arm on October 29, 1973, at San Diego County jail, where he was awaiting trial on a narcotics charge. Bright, a Marine Corps veteran of the Vietnam War, died of natural causes at the age of sixty in Humboldt County on April 10, 2006.
Two members of the San Diego Hells Angels chapter – Michael Varner, the chapter president, and his brother John G. Varner – were shot to death by an unidentified gunman in a tavern in Modesto on November 6, 1973. Police were unable to establish a motive for the killings.
A Hells Angels member was hospitalized with a skull fracture and multiple abrasions when he was beaten unconscious by a group of bar patrons after he brandished a hunting knife following a disagreement with another patron at an East San Diego bar on January 26, 1975. On February 16, a heating and air conditioning company owned by the patron and his partner in Santee was targeted in an arson attack, which law enforcement believe was carried out by the HAMC in retaliation for the injuries suffered by the Hells Angel in the earlier incident.
Hells Angels member Gerald "Butch" Lester shot two people in a van in Sacramento County on October 26, 1977, killing one and wounding the other. Lester used a sleeping bag to conceal his victims' bodies and then dumped their vehicle in a river. The incident, for which Lester spent four years in state prison, was reportedly the result of a dispute over $5,000 worth of methamphetamine.
Laurence Richard "Large Larry" Lajeunesse, a senior member of the Hells Angels' San Fernando Valley chapter, and his girlfriend Tammie Ann Brannigan were shot to death in the converted industrial garage in Chatsworth, Los Angeles where they lived on December 3, 1998, by Daniel Ray Waring, who was described by prosecutors as an aspirant Hells Angels member involved in a feud with Lajeunesse over methamphetamine dealing. Waring robbed and killed the couple, shooting Lajeunesse five or six times in the head before also shooting Brannigan to eliminate her as a witness. Waring, a tow truck driver who worked as an informant for California Highway Patrol detectives for over ten years, was convicted of first-degree murder on October 12, 2001, and sentenced to two consecutive life prison terms without the possibility of parole on February 8, 2002. He died aged 60 on September 27, 2017. The case was documented in the North Mission Road episode "Hells Angels Mystery", which aired on August 22, 2005.
In 2001, eleven men associated with the Hells Angels in Fresno were arrested for allegedly assaulting members of another motorcycle club that had ignored their order to disband.
Ventura Hells Angels chapter member Thomas Heath was sentenced to thirty-five years to life in prison in February 2012 after being convicted of a fifth strike offense. In 1992, he was sentenced to seven years' imprisonment after being convicted of assault with a deadly weapon and dissuading a witness by threats for the beating of his wife at a hamburger stand. Heath was sentenced to an additional seven years' in 1994 when he pleaded guilty to two counts of first-degree murder for killing a rival biker and an innocent bystander with a bomb in Los Angeles on September 24, 1977, during a war with the Mongols. On November 22, 2010, he threatened the lives of his female roommate and her son, a crime for which he was found guilty on December 16, 2011, of dissuading a witness, threatening a witness and street terrorism.
On June 6, 2023, a group of Hells Angels allegedly attacked three African American men in the Ocean Beach neighborhood of San Diego. One of the victims was stabbed, another was beaten unconscious, and the third managed to flee. 17 Hells Angels members and associates were arrested on September 17, 2023, charged with carrying out the attack in association with a criminal street gang.
Murders
Bradley Parkhurst
Three Hells Angels members and one of their girlfriends were charged on March 8, 1972, with the murder of Bradley Parkhurst, an Alameda longshoreman who was beaten and stomped to death in the basement of an Oakland home on February 24. Parkhurst had arrived at the residence of Connie Perry, a Hells Angel's girlfriend, to inspect a motorcycle and was killed by HAMC members Russell Beyea and "Mouldy" Marvin William Gilbert after Gilbert took offence to a "nigger's handshake" from Parkhurst, who was pronounced dead at Highland Hospital. It is believed that, due to Beyea's status as a senior Hells Angel, Gilbert was pressured by the club to testify and exculpate Beyea during the trial. Despite his testimony, both Gilbert and Beyea were convicted of second-degree murder on August 17, 1972. Following the jury's verdict, a Hells Angels member approached Gilbert and threatened his life in the presence of a deputy sheriff due to his failure to exonerate Beyea. Gilbert later moved to Spokane, Washington, becoming vice-president of the Hells Angels chapter there, and died at the age of sixty-five on June 22, 2007.
Compton family
Margo Compton began working at a Hells Angels-owned massage parlor in San Francisco, where she was required to perform sex acts on patrons, in early 1977 in order to pay off a debt for amphetamine given to her on consignment by Odis "Buck" Garrett, president of the Vallejo-based HAMC nomads chapter. Compton contacted law enforcement after she was beaten and raped by a patron, resulting in Garrett being indicted on felony morality charges. In July 1977, Compton testified on behalf of the prosecution in a California state criminal prosecution that she and four other women working at the parlor were being pimped by the Hells Angels, and that the operation was under the protection of two San Francisco Police Department (SFPD) vice squad officers who were bribed with cash and sexual favors. After testifying, Compton fled to a cottage in Gaston, Oregon, where she, her six-year-old twin daughters, Sylvia and Sandra, and Gary Seslar, the nineteen-year-old son of her boyfriend, were shot dead with a .22 caliber handgun after being bound with rope on August 7, 1977. Garrett was imprisoned after being convicted of pimping and pandering in October 1977.
In 1991, Garrett and Hells Angels hangaround Robert G. "Bugeye Bob" McClure were charged with the murders while imprisoned on separate narcotics convictions after prison informants reported that McClure had bragged of committing the crime. McClure was convicted of quadruple murder and sentenced to four consecutive life terms on July 30, 1994. Garrett was also sentenced to four consecutive life sentences in prison after being found guilty on four counts of murder on July 26, 1995. Over forty witnesses including former Aryan Brotherhood council member Michael "Iron Mike" Thompson testified during each of the trials, held in Hillsboro, Oregon. According to prosecutors, Garrett had ordered the killings of Compton and her daughters in retaliation for her testimony without approval from the HAMC. Seslar was killed because he happened to be present at the time of the murders. Thompson claimed that the Aryan Brotherhood had been approached by the Hells Angels leadership in California to carry out the murders but had turned down the contract because of their unwillingness to kill children. McClure's alleged accomplice in the murders, fellow Hells Angels associate Benjamin Wai "Psycho" Silva, was never charged in the case; prosecutors felt it wasn't worth the expense and effort as he was already awaiting execution at San Quentin State Prison for the 1981 kidnapping, rape, torture and murder of two college students in Lassen County.
Additionally, Garrett was a suspect in the possible homicide of Rhonda Lynn Yocom, a nineteen-year-old Filipina American woman who was last seen getting into a car with Garrett in Oroville on February 10, 1985, before she disappeared. Garrett was purported to be taking Yocom to the Klamath Falls, Oregon, area in order for her to flee the state to avoid a court appearance in a criminal matter. She has never been located and it is believed that she was the victim of a homicide. Garret died in prison at the age of seventy-four on February 12, 2017.
Maureen and Telesforo Bautista
Los Angeles Hells Angels member and methamphetamine manufacturer Robert Frederick Garceau stabbed to death his girlfriend Maureen Bautista and her fourteen-year-old son Telesforo in a Bakersfield apartment on September 6 or 7, 1984 after Bautista threatened to inform her former lover, drug dealer Eddie Nash, of Garceau's whereabouts and drug operation. Nash had previously paid Garceau to fulfill a contract which he failed to perform, and Nash was subsequently searching for Garceau. Two of Garceau's acquaintances, Greg Rambo and Larry Tom Whittington, disposed of the bodies by placing them inside a hollow bedroom dresser which was then buried beneath a layer of concrete in the yard behind Rambo's residence in Shandon. Garceau shot and killed Rambo, one of his drug business partners, in Monterey County on February 19, 1985, after he became concerned that Rambo may become an informant. Garceau and another acquaintance, Harlyn Codd, then deposited Rambo's body in a ravine at Deer Creek in Tulare County. In view of Rambo's disappearance and fearing for her own life, his wife, Susan, contacted the Kern County Sheriff's Office on March 6, 1985. Her statements led to the excavation of the Bautistas' bodies on March 8, 1985, and the arrest of Garceau in Gorman on March 14, 1985.
In 1987, Garceau was sentenced to death in Kern County for the Bautista murders, and an additional thirty-three-years-to-life in Monterey County for Rambo's murder. He died from cancer at the age of fifty-eight on December 29, 2004, while on death row at San Quentin State Prison.
Grondalski family
On October 5, 1986, former Hells Angels member William Ivan "Billy" Grondalski, his wife Patricia ("Patty"), five-year-old daughter Dallas and seventeen-year-old stepson Nolan Jerami Vandagriff were murdered in their home near Fort Bragg by Gerald Michael "Butch" Lester and Charles Anthony "Chuck" Diaz, the president and vice-president, respectively, of the Vallejo Hells Angels chapter. Billy Grondalski, Patty Grondalski and Vandagriff were each killed by a single gunshot wound to the head from Lester, while Dallas Grondalski died as a result of multiple stab wounds from Diaz, which severed her spinal cord and caused a near-decapitation. She was also shot by Lester post-mortem. Billy Grondalski had been expelled by the Vallejo Hells Angels on September 28, less than a week before the massacre, and Lester and Diaz had come to his home to retrieve a monetary debt, his motorcycle and items of club property in his possession – $900 worth of HAMC support decals and a Hells Angels tattoo on his left arm, reading "84 In, 86 Out". According to investigators, Grondalski was ousted from the HAMC due to a drug debt. Lester and Diaz later claimed that the killings at the Grondalski home began after a .45 caliber pistol that Lester was using to threaten Billy Grondalski accidentally discharged, killing him instantly, and that the remaining family members were killed to eliminate witnesses. After his death, Grondalski's Hells Angels tattoo was severed from his body and later disposed of by Lester in the toilet of a recreational vehicle owned by associates of his. The handgun used in the killings was melted down with a blowtorch and the slag was scattered over several northern California counties by Michael W. "Little Mike" Tankersley, a member of the Hells Angels' Sonoma County chapter. The day after the murders, Lester and Sonoma County Hells Angels member "Big Arm" Charles Francis Haas returned to the home and set fire to it in an effort to destroy evidence. The corpses of the family were discovered by firefighters responding to the blaze.
Haas implicated Diaz and Lester in the murders after becoming a cooperating witness for the government in February 1994 while awaiting sentencing on a federal drug conviction relating to a large-scale methamphetamine ring in Virginia. He was granted immunity from prosecution in the Grondalski case other than for the murders in return for his testimony, and also hoped for a reduced sentence in the drug case. Haas was sentenced to twenty-seven years' imprisonment on March 31, 1994. On May 5, 1995, Diaz, by then the Vallejo chapter president, was arrested in Ukiah and Lester was apprehended in Fort Smith, Arkansas, where he was living after leaving the club in June 1987. They were each charged with four counts of murder. Tankersley also emerged as a witness in February 1996 when he was arrested in Arkansas on a fugitive warrant for assault charges he faced in Marin and Sonoma counties. He was also charged with three counts of attempted capital murder after he used his vehicle to ram the car of the police officers who arrested him. Tankersley had been expelled from the Sonoma County Hells Angels in 1987 and fled the state to escape retribution from the club and also to avoid criminal prosecution. Due to his testimony, the attempted murder charges against him were reduced to three counts of aggravated assault, for which he was sentenced to serve six years' imprisonment, with three-and-a-half years suspended, concurrent to any sentence stemming from the assault charges in California, from which he ultimately escaped prosecution. Following two mistrials, Lester was convicted of four counts of murder on November 6, 1997. He was sentenced on January 23, 1998, to four life terms at the maximum-security Pelican Bay State Prison. Charges against Diaz were dismissed twice due to lack of evidence, once in 1996 and again on January 4, 1999, but he was reindicted on October 25, 1999, charged with the murder of Dallas Grondalski. Diaz was convicted of first-degree murder on May 5, 2004, and sentenced to serve twenty-six-years to life in state prison on June 10, 2004. Three co-defendants – Mary Anne Hodgson, Sonoma County HAMC member Robert L. Huffman and Sammie Louise Lester, the wife of Gerald Lester – were convicted of conspiring to obstruct justice. Sammie Lester was sentenced to two years and eight months in state prison and fined £200 on May 27, 2004, Huffman was sentenced to one year and eight months on June 10, 2004, and Hodgson was given a three-year sentence ordered to pay $600 restitution on June 29, 2004.
Targeting of law enforcement personnel
San Jose Police Department (SJPD) sergeant John Kracht survived an attempt on his life when a bomb detonated near his car on February 19, 1977. Kracht, who was in charge of all SJPD motorcycle gang investigations, had been involved in arresting numerous Hells Angels members, and he had testified against club members on several occasions. James Ezekiel "Jim-Jim" Brandes, vice-president and enforcer for the Oakland HAMC chapter, was charged with the attempted murder of Kracht as well as other crimes as part of a racketeering case against the club in June 1979. Brandes' first trial ended in a mistrial in July 1980 as did the retrial in February 1981.
Vallejo Hells Angels chapter member Kenneth Owen was charged with two felony counts after police discovered methamphetamine and prohibited firearms – a derringer, two rifles and an Ithaca sixteen-gauge shotgun – at his home, a rural property in Solano County, during a raid led by Solano County Sherriff's Office narcotics detective William O. "Bill" Zerby on June 21, 1977. On November 14, 1977, Oakland Hells Angels chapter vice-president James Patton "Sleepy Jim" Brandes was found to be in possession of a pound of methamphetamine, which was hidden behind a threshold plate in a door of his Lincoln Continental, as well as a police radio, a radio band directory, a homemade police siren, a blue flasher, a pocket-sized tape recorder, a radio transmitter and a device for detecting surveillance equipment after he was pulled over by Zerby and his partner, inspector Richard Grundy. Also among the contraband was a military handbook on booby traps and an address book containing the home address, phone number and the license-plate number of Zerby. On January 30, 1978, Zerby was seriously injured and deafened as a result of an explosive device detonated as he was entering a vehicle parked in front of his home in Vallejo. The detective was en route to court for a prehearing in the methamphetamine possession trial of Brandes at the time. Forty-two HAMC members and associates were served with grand jury subpoenas on March 27, 1978, as part of the investigation into the bombing. In or around November 1978, Brandes stated to a reporter for Rolling Stone magazine that "Zerby drew a line and stepped over it. I don't take that from anybody in the streets, and I sure ain't gonna take that from him. I don't let nobody come around and shove me around. I don't think anyone does if he's a man." The following year, Brandes and Owen were charged with the attempted murder of Zerby as part of a racketeering case against the club. The pair were ultimately acquitted of the attempted murder. In 1982, Brandes arrived in Australia with a photograph and the home address of the Victoria state policeman Bob Armstrong who was in dispute with the Angels Melbourne chapter. Brandes was deported to the United States. Brandes committed suicide by hanging himself in prison , and Owen died July 4, 2016. Zerby, who was forced to retire from his law enforcement agency due to the injuries he sustained in the explosion, died in 2021 at the age of seventy-nine. The 1982 made-for-television film Hear No Evil was based on the incident.
Two San Diego Hells Angels chapter prospects – Robert Michael "Mexican Mike" Johnson and William Lester "Filthy Bill" Peters – were charged with conspiring to murder San Diego County District Attorney's Office Organized Crime Unit investigator Raymond C. Morgan after being arrested while conducting surveillance of Morgan's residence in Poway on February 27, 1978. An M3 submachine gun, a High Standard .22 Pistol fitted with a silencer, ammunition for both weapons, rubber gloves, camouflage clothing and a hand-drawn map to Morgan's home were found at Johnson's residence, and an electronic listening device with a parabolic microphone was found in Peters' residence after search warrants were issued. Johnson's girlfriend, Linda Sue Osborne, was also charged in the case. Morgan, who had been assigned to investigate motorcycle gang activity in the area in 1975, retired from law enforcement and fled California with his family due to intelligence reports that there was a $50,000 bounty on his head. It is believed that the San Diego Hells Angels obtained permission from the club's Oakland "mother chapter" to carry out the attempted assassination.
Four police officers were fired and another four were suspended as a result of a brawl between policemen and Hells Angels members outside the HAMC clubhouse in Oakland on April 2, 1978. The fight began after two patrolmen began issuing citations for public drunkenness to the bikers, who had gathered to attend a meeting and a birthday party, and forty-one patrol cars later converged at the scene.
Oakland police officers manning a command post during a Hells Angels member's funeral came under fire from a drive-by shooting carried by a club associate who opened fire in frustration at their presence; he fired shots, then left before returning and firing again. No casualties were reported.
RICO case
Thirty-three members and associates of the Hells Angels' Oakland, San Francisco, Marin County, San Jose, Los Angeles and Vallejo chapters, including Oakland chapter president and reputed national leader Sonny Barger, were indicted on Racketeer Influenced and Corrupt Organizations (RICO) Act statutes on June 13, 1979. Twenty-one of those were arrested during large-scale raids involving approximately 200 federal agents on the day of the indictments. Ultimately, eighteen defendants stood trial as a result of dismissals and other legal maneuvers, while others remained fugitives. The prosecution team, representing the federal government, attempted to demonstrate a pattern of behavior to convict Barger and other members of the club of racketeering offenses related to guns and illegal drugs. On July 2, 1980, following an eight-month trial in which 194 witnesses testified, a mistrial was declared when a jury failed to reach a verdict on the primary counts of racketeering conspiracy against the eighteen defendants. On the remaining charges, which included drug possession and firearms offenses, six of the accused – Ronald H. Elledge, John Palomar, Alan Passaro, Manuel Rubio, Donald Smith and Bert Stefanson – were convicted, while the remaining twelve were acquitted.
On August 12, 1980, the government returned a superseding RICO indictment, which omitted the allegation that the HAMC itself constituted a criminal enterprise, against fourteen defendants – including some of those in the original case. Eleven of those stood trial. In addition to the racketeering charge, a second count of the indictment charged James Brandes with the murder of fellow Hells Angel Ray Keefauver, and the attempted murders of SJPD sergeant John Kracht and Solano County Bureau of Narcotic Enforcement inspector William Zerby. Kenneth Owen was also charged with the attempted murder of Zerby. The second RICO trial also ended in a mistrial in February 1981.
Operation Roughrider
Members and associates of the Hells Angels in Sacramento, San Diego and the San Francisco Bay Area were arrested and charged with racketeering and drug trafficking on May 2, 1985, as part of Operation Roughrider, a three-year FBI investigation into the club. Six people were arrested – including San Francisco chapter president Gary Kautzman – and forty firearms were confiscated in the Bay Area. The operation, involving approximately a thousand law enforcement personnel, resulted in the arrests of a total of 133 Hells Angels members and associates during around fifty raids in eleven states, and the seizure of $2 million in cocaine, marijuana, methamphetamine, hashish, PCP and LSD, as well as weapons including Uzi submachine guns and rocket launchers. Much of the intelligence that led to the indictments was provided by Kevin P. Bonner, an undercover FBI agent who infiltrated the club for twenty-six months and made drug deals with various chapters. He purchased methamphetamine and cocaine from Kautzman on five occasions between June 4 and November 6, 1982.
Operation CACUS
On November 10, 1987, thirteen Hells Angels – including Sonny Barger and his second-in-command, Michael O'Farrell – were arrested on drugs, weapons, explosives and conspiracy charges during 26 raids carried out by 250 Bureau of Alcohol, Tobacco, Firearms and Explosives (ATF), Federal Bureau of Investigation (FBI) and California State Police (CSP) personnel in the San Francisco Bay Area, which also resulted in the seizure of over a hundred weapons, more than $1 million in cash and narcotics, and three methamphetamine laboratories. Approximately $1 million in cash was discovered at the Oakland home of Kenneth Owen, a club member arrested for methamphetamine distribution. The raids were the culmination of the undercover Organized Crime Drug Enforcement Task Force (OCDETF) Operation CACUS. The operation in the Bay Area was executed in synchronization with raids on various other HAMC chapters in four other states – producing a total of 38 arrests – and concluded a two-year investigation of the club, which commenced in 1985 after Anthony John Tait, the sergeant-at-arms of the Anchorage, Alaska Hells Angels chapter, volunteered to become a paid FBI informant. Travelling the country at government expense, Tait made documented purchases of weapons, explosives and drugs from the Hells Angels. He also covertly recorded club meetings by wearing a wire.
Owen was convicted of selling three pounds of methamphetamine to Tait, and was sentenced to 41 years in prison and a $2.1 million fine on September 9, 1988. Barger and O'Farrell were among ten Hells Angels from California and Alaska extradited to Louisville, Kentucky, to face trail for conspiring to transport firearms and explosives across state lines in order to kill members of the Outlaws in retaliation for the death of John Cleave Webb. Webb, the president of the Anchorage HAMC chapter, who was shot and killed by two Outlaws members outside a bar in Jefferson County, Kentucky, on August 12, 1986. Barger and O'Farrell were convicted of conspiracy on October 28, 1988. Other members of the California and Alaska chapters were convicted on state drug and firearm charges either side of the federal trial. O'Farrell was shot and stabbed to death by two men during a bar fight in San Leandro on June 6, 1989, while awaiting sentencing. Barger served three-and-a-half years of a four-year sentence at FCI Phoenix in Arizona and was released on November 6, 1992. Owen died July 4, 2016. A $1 million bounty was allegedly put on Tait's life by the Hells Angels.
Crackdowns
On April 29, 2011, Ventura County Sheriff's Office gang unit detectives raided the Ventura Hells Angels chapter clubhouse during a club meeting, arresting five members on charges including being under the influence of methamphetamine, possession of marijuana for sale or possession of a deadly weapon. Among the arrested was George Christie III, the son of the Hells Angels leader George Christie, Jr.. The raid followed a three-week investigation into the theft of a gun safe from a home in Ojai.
26 members and associates of the Hells Angels were arrested on federal drug charges in raids by SWAT teams of the Federal Bureau of Investigation (FBI), the San Diego Police Department and the Oceanside Police Department in 19 locations across San Diego County on September 29, 2011. An additional six defendants already in custody as well as four fugitives were named in an affidavit. Thousands of dollars in currency, 10 firearms, and narcotics were also seized. The charges stemmed from a two-year investigation conducted by the FBI's Violent Crime Gang Task Force, which investigated methamphetamine trafficking and violent crimes committed by the San Diego charter of the Hells Angels.
Hells Angels member Charles Nucci was arrested when the San Francisco Police Department gang task force raided the headquarters of the Hells Angels in the Dogpatch neighborhood of San Francisco on May 14, 2014, serving a warrant in connection with an aggravated assault in 2013 in which several assailants wearing Hells Angels jackets allegedly attacked a victim in San Francisco.
On February 11, 2015, SWAT officers and Riverside County Sheriff's Department deputies raided the Hells Angels clubhouse on West 19th Street in San Bernardino, serving a gang-related warrant and arresting one member of the club. A shotgun was confiscated, as was a batch of a suspicious white powder. The raid was part of a larger operation which overall resulted in multiple arrests, and the recovery of 19 firearms, narcotics, stolen property and a stolen motorcycle, as 17 warrants were served in relation to gang violence and unsolved violent crimes.
References
Bibliography
Criminal allegations and incidents in California
Gangs in California
Gangs in Los Angeles
Gangs in San Diego
Gangs in San Francisco
|
Marianne Ploska is a Canadian cinematographer. She is most noted for her work on the film Prayer for a Lost Mitten (Prière pour une mitaine perdue), for which she received a Prix Iris nomination for Best Cinematography in a Documentary at the 23rd Quebec Cinema Awards in 2021, and won the Canadian Screen Award for Best Cinematography in a Documentary at the 10th Canadian Screen Awards in 2022.
References
External links
Canadian cinematographers
Canadian women cinematographers
Living people
Year of birth missing (living people)
Best Cinematography in a Documentary Canadian Screen Award winners
|
The WSSUS (Wide-Sense Stationary Uncorrelated Scattering) model provides a statistical description of the transmission behavior of wireless channels. "Wide-sense stationarity" means the second-order moments of the channel are stationary, which means that they depends only on the time difference, while "uncorrelated scattering" refers to the delay τ due to scatterers.
Modelling of mobile channels as WSSUS (wide sense stationary uncorrelated scattering) has become popular among specialists. The model was introduced by Phillip A. Bello in 1963.
A commonly used description of time variant channel applies the set of Bello functions and the theory of stochastic processes.
References
Kurth, R. R.; Snyder, D. L.; Hoversten, E. V. (1969) "Detection and Estimation Theory", Massachusetts Institute of Technology, Research Laboratory of Electronics, Quarterly Progress Report, No. 93 (IX), 177–205
Primary documents
Bello, Phillip A., "Characterization of randomly time-variant linear channels", IEEE Transactions on Communications Systems, vol. 11, iss. 4, pp. 360-393, December 1963.
External links
Wide Sense Stationary Uncorrelated Scattering at www.WirelessCommunication.NL
Information theory
Scattering
Scattering, absorption and radiative transfer (optics)
Signal processing
Stochastic models
Telecommunication theory
Wireless
Wireless networking
|
```sqlpl
SET NOCOUNT ON;
DECLARE @sqlcmd NVARCHAR(4000), @params NVARCHAR(500), @ErrorMessage NVARCHAR(1000)
DECLARE @cacheentries bigint, @cachename NVARCHAR(256), @entriesthreshold int
DECLARE @tmpCacheTbl AS TABLE (cachename NVARCHAR(256), entries_count bigint, is_done bit)
SET @entriesthreshold = 10000 -- Triggers cache cleanup if exceeded
-- Populate cache table
INSERT INTO @tmpCacheTbl
SELECT name, entries_count, 0
FROM sys.dm_os_memory_cache_counters
WHERE name IN ('Object Plans', 'SQL Plans', 'Bound Trees', 'Extended Stored Procedures', 'Temporary Tables & Table Variables')
WHILE (SELECT COUNT(cachename) FROM @tmpCacheTbl WHERE is_done = 0) > 0
BEGIN
SELECT TOP 1 @cachename = cachename, @cacheentries = entries_count FROM @tmpCacheTbl WHERE is_done = 0
IF @cacheentries >= @entriesthreshold
BEGIN
SELECT @ErrorMessage = CONVERT(NVARCHAR(50), GETDATE()) + ': ' + @cachename + ' will be evicted because it exceeds ' + CONVERT(NVARCHAR(12), @entriesthreshold) + ' number of objects (' + CONVERT(NVARCHAR(12), @cacheentries) + ').'
RAISERROR (@ErrorMessage, 10, 1, N'Manual cache eviction');
EXECUTE ('DBCC FREESYSTEMCACHE (''' + @cachename + ''') WITH MARK_IN_USE_FOR_REMOVAL')
END
ELSE
BEGIN
SELECT @ErrorMessage = CONVERT(NVARCHAR(50), GETDATE()) + ': ' + @cachename + ' does not exceed ' + CONVERT(NVARCHAR(12), @entriesthreshold) + ' number of objects (' + CONVERT(NVARCHAR(12), @cacheentries) + ').'
RAISERROR (@ErrorMessage, 10, 1, N'Manual cache eviction');
END
UPDATE @tmpCacheTbl
SET is_done = 1
WHERE cachename = @cachename
END
GO
```
|
Shi Zhiyong may refer to:
Shi Zhiyong (weightlifter, born 1980) (), Chinese retired weightlifter, born in Longyan, Fujian, who won gold at the men's 62 kg class of 2004 Summer Olympics
Shi Zhiyong (weightlifter, born 1993) (), Chinese weightlifter, born in Guilin, Guangxi, who won gold at the men's 69 kg class of 2016 Summer Olympics
|
The Mario Schenberg (Gravitational Wave Detector, or Brazilian Graviton Project or Graviton) is a spherical, resonant-mass, gravitational wave detector formerly run by the Physics Institute of the University of São Paulo, named after Mário Schenberg. Similar to the Dutch-run MiniGrail, the 1.15 ton, 65 cm diameter spherical test mass is suspended in a cryogenic vacuum enclosure, kept at 20 mK; and the sensors (transducers) for this detector/antenna are developed at the National Institute for Space Research (INPE), in Sao José dos Campos, Brazil. As of 2016, the antenna has not detected any gravitational waves, and development of the antenna continues. It has been decided that the antenna will be transferred from the University of São Paulo to INPE.
See also
List of radio telescopes
References
Gravitational-wave telescopes
Astronomical observatories in Brazil
|
```java
package com.hijacker;
/*
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
along with this program. If not, see <path_to_url
*/
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.app.FragmentManager;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import static com.hijacker.MainActivity.background;
import static com.hijacker.MainActivity.file_explorer_adapter;
public class FileExplorerDialog extends DialogFragment{
static final int SELECT_EXISTING_FILE=1, SELECT_DIR=2;
static List<RootFile> list = new ArrayList<>();
RootFile result = null;
ListView listView;
ImageButton backButton, newFolderButton;
TextView currentDir;
Runnable onSelect = null, onCancel = null;
RootFile start = null, current = null;
int toSelect = 0;
@Override
public Dialog onCreateDialog(Bundle savedInstanceState){
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
View view = getActivity().getLayoutInflater().inflate(R.layout.file_explorer, null);
currentDir = view.findViewById(R.id.currentDir);
backButton = view.findViewById(R.id.backButton);
backButton.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
goToDirectory(new RootFile(current.getParentPath()));
}
});
newFolderButton = view.findViewById(R.id.newFolderButton);
newFolderButton.setVisibility(toSelect==SELECT_DIR ? View.VISIBLE : View.INVISIBLE);
newFolderButton.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
final EditTextDialog dialog = new EditTextDialog();
dialog.setTitle(getString(R.string.folder_name));
dialog.setRunnable(new Runnable(){
@Override
public void run(){
RootFile newFolder = new RootFile(current.getAbsolutePath() + "/" + dialog.result);
if(newFolder.exists()){
Toast.makeText(getActivity(), getString(R.string.folder_exists), Toast.LENGTH_SHORT).show();
}else{
newFolder.mkdir();
goToDirectory(newFolder);
}
}
});
dialog.show(getFragmentManager(), "EditTextDialog");
}
});
listView = view.findViewById(R.id.explorer_listview);
listView.setAdapter(file_explorer_adapter);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id){
RootFile clicked = list.get(position);
if(clicked.isDirectory()){
goToDirectory(list.get(position));
}else{
onSelect(clicked);
}
}
});
builder.setView(view);
if(toSelect==SELECT_DIR){
builder.setPositiveButton(R.string.select, new DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog, int id){
onSelect(current);
}
});
}
builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
if(onCancel!=null){
onCancel.run();
}
}
});
goToDirectory(start==null ? new RootFile("/") : start);
return builder.create();
}
@Override
public void show(FragmentManager fragmentManager, String tag){
if(!background) super.show(fragmentManager, tag);
}
void goToDirectory(RootFile file){
while(!file.exists()){
file = new RootFile(file.getParentPath());
}
current = file;
list = file.listFiles();
for(int i=0;i<list.size();i++){
if((toSelect==SELECT_DIR && !list.get(i).isDirectory()) || list.get(i).isUnknownType()){
list.remove(i);
i--;
}
}
Collections.sort(list, new Comparator<RootFile>(){
@Override
public int compare(RootFile o1, RootFile o2){
if(o1.isFile() && o2.isDirectory()) return 1;
else if(o1.isDirectory() && o2.isFile()) return -1;
else return o1.getName().compareToIgnoreCase(o2.getName());
}
});
file_explorer_adapter.notifyDataSetChanged();
backButton.setEnabled(!current.getAbsolutePath().equals("/"));
currentDir.setText(current.getAbsolutePath());
}
void onSelect(RootFile file){
result = file;
if(onSelect!=null){
onSelect.run();
}
this.dismissAllowingStateLoss();
}
void setStartingDir(RootFile file){
start = file;
}
void setOnSelect(Runnable runnable){
onSelect = runnable;
}
void setOnCancel(Runnable runnable){
onCancel = runnable;
}
void setToSelect(int selection){
toSelect = selection;
}
}
```
|
```xml
export default function Page() {
return <h1>Profile</h1>
}
```
|
H1 is a para-cycling classification. It includes people with a number of disability types including spinal cord injuries and cerebral palsy. Handcycles that can be used by people in races include the AP2 recumbent and AP3 recumbent. The classification competes at the Paralympic Games and has international rankings done by the UCI.
Definition
Union Cycliste Internationale (UCI) defines H1 as:
Tetraplegia C6 or above and severe athetosis/ataxia/dystonia
Tetraplegic with impairments corresponding to a complete cervical lesion at C6 or above
Complete loss of trunk stability and lower limb function
Limited extension of the elbow with a muscle score of 6 (total of both tri- ceps)
Limited handgrip
Non-spinal cord injury, but functional ability profile equivalent to sport class H 1.1
Impaired sympathetic nerve system
Recumbent position in handbike mandatory (AP-bikes)
Severe athetosis/ataxia/dystonia and elbow extension limitation
Asymmetric or symmetric quadriplegia with at least grade 3 spasticity in upper limbs and lower limbs.
The UCI recommends this be coded as MH1 or WH1.
Disability groups
People with cerebral palsy are one of the classes eligible to compete in this class, including CP/ISRA CP2 classified cyclists. All CP2 cyclists are required to wear a helmet, with a special color used to designate their class. Their helmet color is red.
CP2 cyclists tend to use electric wheelchairs in everyday life. They may have controlled shakes and twitches. This bodily activity can spike their metabolic rate. They can operate a manual wheelchair but this is restricted because of motor control issues. Functional control issues effect all or most of their limbs. When participating in sport, CP2 competitors tend to have low energy expenditure.
The cycle
This classification can use an AP2 recumbent, which is a competition cycle that is reclined at 30 degrees and has a rigid frame. This classification can also use an AP3 hand cycle which is inclined at 0 degrees and is reclined on a rigid competition frame.
Classification history
Cycling first became a Paralympic sport at the 1988 Summer Paralympics. In September 2006, governance for para-cycling passed from the International Paralympic Committee's International Cycling Committee to UCI at a meeting in Switzerland. When this happened, the responsibility of classifying the sport also changed.
At the Paralympic Games
For the 2016 Summer Paralympics in Rio, the International Paralympic Committee had a zero classification at the Games policy. This policy was put into place in 2014, with the goal of avoiding last minute changes in classes that would negatively impact athlete training preparations. All competitors needed to be internationally classified with their classification status confirmed prior to the Games, with exceptions to this policy being dealt with on a case-by-case basis.
Rankings
The following are the men's rankings for this classification :
Becoming classified
Classification is handled by Union Cycliste Internationale. Classification for the UCI Para-Cycling World Championships is completed by at least two classification panels. Members of the classification panel must not have a relationship with the cyclist and must not be involved in the World Championships in any other role than as classifier. In national competitions, the classification is handled by the national cycling federation. Classification often has three components: physical, technical and observation assessment.
References
Para-cycling classification
Parasports classifications
|
```objective-c
/* xdlc.h
* Define *DLC frame types, and routine to dissect the control field of
* a *DLC frame.
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
*
* This program is free software; you can redistribute it and/or
* as published by the Free Software Foundation; either version 2
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __XDLC_H__
#define __XDLC_H__
#include "ws_symbol_export.h"
/** @file
* Define *DLC frame types, and routine to dissect the control field of
* a *DLC frame.
*/
/*
* Low-order bits of first (extended) or only (basic) octet of control
* field, specifying the frame type.
*/
#define XDLC_I_MASK 0x01 /**< Mask to test for I or not I */
#define XDLC_I 0x00 /**< Information frames */
#define XDLC_S_U_MASK 0x03 /**< Mask to test for S or U */
#define XDLC_S 0x01 /**< Supervisory frames */
#define XDLC_U 0x03 /**< Unnumbered frames */
/*
* N(S) and N(R) fields, in basic and extended operation.
*/
#define XDLC_N_R_MASK 0xE0 /**< basic */
#define XDLC_N_R_SHIFT 5
#define XDLC_N_R_EXT_MASK 0xFE00 /**< extended */
#define XDLC_N_R_EXT_SHIFT 9
#define XDLC_N_S_MASK 0x0E /**< basic */
#define XDLC_N_S_SHIFT 1
#define XDLC_N_S_EXT_MASK 0x00FE /**< extended */
#define XDLC_N_S_EXT_SHIFT 1
/*
* Poll/Final bit, in basic and extended operation.
*/
#define XDLC_P_F 0x10 /**< basic */
#define XDLC_P_F_EXT 0x0100 /**< extended */
/*
* S-format frame types.
*/
#define XDLC_S_FTYPE_MASK 0x0C
#define XDLC_RR 0x00 /**< Receiver ready */
#define XDLC_RNR 0x04 /**< Receiver not ready */
#define XDLC_REJ 0x08 /**< Reject */
#define XDLC_SREJ 0x0C /**< Selective reject */
/*
* U-format modifiers.
*/
#define XDLC_U_MODIFIER_MASK 0xEC
#define XDLC_UI 0x00 /**< Unnumbered Information */
#define XDLC_UP 0x20 /**< Unnumbered Poll */
#define XDLC_DISC 0x40 /**< Disconnect (command) */
#define XDLC_RD 0x40 /**< Request Disconnect (response) */
#define XDLC_UA 0x60 /**< Unnumbered Acknowledge */
#define XDLC_SNRM 0x80 /**< Set Normal Response Mode */
#define XDLC_TEST 0xE0 /**< Test */
#define XDLC_SIM 0x04 /**< Set Initialization Mode (command) */
#define XDLC_RIM 0x04 /**< Request Initialization Mode (response) */
#define XDLC_FRMR 0x84 /**< Frame reject */
#define XDLC_CFGR 0xC4 /**< Configure */
#define XDLC_SARM 0x0C /**< Set Asynchronous Response Mode (command) */
#define XDLC_DM 0x0C /**< Disconnected mode (response) */
#define XDLC_SABM 0x2C /**< Set Asynchronous Balanced Mode */
#define XDLC_SARME 0x4C /**< Set Asynchronous Response Mode Extended */
#define XDLC_SABME 0x6C /**< Set Asynchronous Balanced Mode Extended */
#define XDLC_RESET 0x8C /**< Reset */
#define XDLC_XID 0xAC /**< Exchange identification */
#define XDLC_SNRME 0xCC /**< Set Normal Response Mode Extended */
#define XDLC_BCN 0xEC /**< Beacon */
/**
* This macro takes the control field of an xDLC frame, as returned by
* "get_xdlc_control()" or "dissect_xdlc_control()", and evaluates to
* TRUE if the frame is an "information" frame and FALSE if it isn't.
* Note that frames other than information frames can have data in them,
* e.g. TEST frames.
*/
#define XDLC_IS_INFORMATION(control) \
(((control) & XDLC_I_MASK) == XDLC_I || (control) == (XDLC_UI|XDLC_U))
/**
* This macro takes the control field of an xDLC frame, and a flag saying
* whether we're doing basic or extended operation, and evaluates to
* the length of that field (if it's an Unnumbered frame, or we're not
* in extended mode, it's 1 byte long, otherwise it's 2 bytes long).
*/
#define XDLC_CONTROL_LEN(control, is_extended) \
((((control) & XDLC_S_U_MASK) == XDLC_U || !(is_extended)) ? 1 : 2)
/**
* Structure containing pointers to hf_ values for various subfields of
* the control field.
*/
typedef struct {
int *hf_xdlc_n_r;
int *hf_xdlc_n_s;
int *hf_xdlc_p;
int *hf_xdlc_f;
int *hf_xdlc_s_ftype;
int *hf_xdlc_u_modifier_cmd;
int *hf_xdlc_u_modifier_resp;
int *hf_xdlc_ftype_i;
int *hf_xdlc_ftype_s_u;
} xdlc_cf_items;
extern const value_string ftype_vals[];
extern const value_string stype_vals[];
extern const value_string modifier_vals_cmd[];
extern const value_string modifier_vals_resp[];
extern int get_xdlc_control(const guchar *pd, int offset, gboolean is_extended);
/**
* Check whether the control field of the packet looks valid.
*/
WS_DLL_PUBLIC gboolean check_xdlc_control(tvbuff_t *tvb, int offset,
const value_string *u_modifier_short_vals_cmd,
const value_string *u_modifier_short_vals_resp, gboolean is_response,
gboolean is_extended _U_);
WS_DLL_PUBLIC int dissect_xdlc_control(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *xdlc_tree, int hf_xdlc_control, gint ett_xdlc_control,
const xdlc_cf_items *cf_items_nonext, const xdlc_cf_items *cf_items_ext,
const value_string *u_modifier_short_vals_cmd,
const value_string *u_modifier_short_vals_resp, gboolean is_response,
gboolean is_extended, gboolean append_info);
#endif
```
|
```php
@extends('home::layouts.UserLayout')
@section('title')
<title>{{env('WEBSITE_TITLE')}} | Dailymotion</title>
@endsection
@section('discoveryActive')
active
@endsection
@section('links')
<link rel="stylesheet" type="text/css" href="{{asset('plugins/custom/emojionearea/css/emojionearea.min.css') }}" />
@endsection
@section('content')
<div class="content d-flex flex-column flex-column-fluid" id="Sb_content">
<!--begin::Entry-->
<div class="d-flex flex-column-fluid">
<!--begin::Container-->
<div class=" container-fluid ">
<!--begin::Profile-->
<!--begin::Row-->
<div class="row" data-sticky-container="">
{!! $html !!}
<p id="notification">Please enter the keyword to find DailyMotions </p>
<div class="col-xl-8">
<!--begin::Feeds-->
<div class="card-columns feeds-container" id="list"></div>
<!--end::Feeds-->
</div>
</div>
<!--end::Row-->
<!--end::Profile-->
</div>
<!--end::Container-->
</div>
<!--end::Entry-->
</div>
@endsection
@section('scripts')
<script>
$('#dailymotione').css('background','#e4e4e4').find('span').css('color','#3699FF');
let nextUrl = 'Dailymotion';
</script>
<script src="{{asset('js/contentStudio/search.js')}}"></script>
<script src="{{asset('js/contentStudio/publishContent.js')}}"></script>
<script src="{{asset('plugins/custom/dropify/dist/js/dropify.min.js') }}"></script>
<script src="{{asset('plugins/custom/emojionearea/js/emojionearea.min.js') }}"></script>
@endsection
```
|
```c++
#include <chrono>
#include <thread>
#include "envoy/config/core/v3/http_uri.pb.h"
#include "source/common/http/message_impl.h"
#include "source/common/protobuf/utility.h"
#include "source/extensions/filters/http/common/jwks_fetcher.h"
#include "test/extensions/filters/http/common/mock.h"
#include "test/mocks/http/mocks.h"
#include "test/mocks/server/factory_context.h"
#include "test/test_common/utility.h"
using envoy::extensions::filters::http::jwt_authn::v3::RemoteJwks;
namespace Envoy {
namespace Extensions {
namespace HttpFilters {
namespace Common {
namespace {
const char publicKey[] = R"(
{
"keys": [
{
"kty": "RSA",
"alg": "RS256",
"use": "sig",
"kid": "62a93512c9ee4c7f8067b5a216dade2763d32a47",
"n": your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashTqDziYQwZN4aGsqVKQb9Vw",
"e": "AQAB"
},
{
"kty": "RSA",
"alg": "RS256",
"use": "sig",
"kid": "b3319a147514df7ee5e4bcdee51350cc890cc89e",
"n": your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashTqDziYQwZN4aGsqVKQb9Vw",
"e": "AQAB"
}
]
}
)";
const std::string config = R"(
http_uri:
uri: path_to_url
cluster: pubkey_cluster
timeout:
seconds: 5
)";
class JwksFetcherTest : public testing::Test {
public:
void setupFetcher(const std::string& config_str) {
TestUtility::loadFromYaml(config_str, remote_jwks_);
mock_factory_ctx_.server_factory_context_.cluster_manager_.initializeThreadLocalClusters(
{"pubkey_cluster"});
fetcher_ = JwksFetcher::create(mock_factory_ctx_.server_factory_context_.cluster_manager_,
remote_jwks_);
EXPECT_TRUE(fetcher_ != nullptr);
}
RemoteJwks remote_jwks_;
testing::NiceMock<Server::Configuration::MockFactoryContext> mock_factory_ctx_;
std::unique_ptr<JwksFetcher> fetcher_;
NiceMock<Tracing::MockSpan> parent_span_;
};
// Test findByIssuer
TEST_F(JwksFetcherTest, TestGetSuccess) {
// Setup
setupFetcher(config);
MockUpstream mock_pubkey(mock_factory_ctx_.server_factory_context_.cluster_manager_, "200",
publicKey);
MockJwksReceiver receiver;
EXPECT_CALL(receiver, onJwksSuccessImpl(testing::_));
EXPECT_CALL(receiver, onJwksError(testing::_)).Times(0);
// Act
fetcher_->fetch(parent_span_, receiver);
}
TEST_F(JwksFetcherTest, TestGet400) {
// Setup
setupFetcher(config);
MockUpstream mock_pubkey(mock_factory_ctx_.server_factory_context_.cluster_manager_, "400",
"invalid");
MockJwksReceiver receiver;
EXPECT_CALL(receiver, onJwksSuccessImpl(testing::_)).Times(0);
EXPECT_CALL(receiver, onJwksError(JwksFetcher::JwksReceiver::Failure::Network));
// Act
fetcher_->fetch(parent_span_, receiver);
}
TEST_F(JwksFetcherTest, TestGetNoBody) {
// Setup
setupFetcher(config);
MockUpstream mock_pubkey(mock_factory_ctx_.server_factory_context_.cluster_manager_, "200", "");
MockJwksReceiver receiver;
EXPECT_CALL(receiver, onJwksSuccessImpl(testing::_)).Times(0);
EXPECT_CALL(receiver, onJwksError(JwksFetcher::JwksReceiver::Failure::Network));
// Act
fetcher_->fetch(parent_span_, receiver);
}
TEST_F(JwksFetcherTest, TestGetInvalidJwks) {
// Setup
setupFetcher(config);
MockUpstream mock_pubkey(mock_factory_ctx_.server_factory_context_.cluster_manager_, "200",
"invalid");
MockJwksReceiver receiver;
EXPECT_CALL(receiver, onJwksSuccessImpl(testing::_)).Times(0);
EXPECT_CALL(receiver, onJwksError(JwksFetcher::JwksReceiver::Failure::InvalidJwks));
// Act
fetcher_->fetch(parent_span_, receiver);
}
TEST_F(JwksFetcherTest, TestHttpFailure) {
// Setup
setupFetcher(config);
MockUpstream mock_pubkey(mock_factory_ctx_.server_factory_context_.cluster_manager_,
Http::AsyncClient::FailureReason::Reset);
MockJwksReceiver receiver;
EXPECT_CALL(receiver, onJwksSuccessImpl(testing::_)).Times(0);
EXPECT_CALL(receiver, onJwksError(JwksFetcher::JwksReceiver::Failure::Network));
// Act
fetcher_->fetch(parent_span_, receiver);
}
TEST_F(JwksFetcherTest, TestCancel) {
// Setup
setupFetcher(config);
Http::MockAsyncClientRequest request(&(mock_factory_ctx_.server_factory_context_.cluster_manager_
.thread_local_cluster_.async_client_));
MockUpstream mock_pubkey(mock_factory_ctx_.server_factory_context_.cluster_manager_, &request);
MockJwksReceiver receiver;
EXPECT_CALL(request, cancel());
EXPECT_CALL(receiver, onJwksSuccessImpl(testing::_)).Times(0);
EXPECT_CALL(receiver, onJwksError(testing::_)).Times(0);
// Act
fetcher_->fetch(parent_span_, receiver);
// Proper cancel
fetcher_->cancel();
// Re-entrant cancel
fetcher_->cancel();
}
TEST_F(JwksFetcherTest, TestSpanPassedDown) {
// Setup
setupFetcher(config);
MockUpstream mock_pubkey(mock_factory_ctx_.server_factory_context_.cluster_manager_, "200",
publicKey);
NiceMock<MockJwksReceiver> receiver;
// Expectations for span
EXPECT_CALL(mock_factory_ctx_.server_factory_context_.cluster_manager_.thread_local_cluster_
.async_client_,
send_(_, _, _))
.WillOnce(Invoke(
[this](Http::RequestMessagePtr&, Http::AsyncClient::Callbacks&,
const Http::AsyncClient::RequestOptions& options) -> Http::AsyncClient::Request* {
EXPECT_TRUE(options.parent_span_ == &this->parent_span_);
EXPECT_TRUE(options.child_span_name_ == "JWT Remote PubKey Fetch");
return nullptr;
}));
// Act
fetcher_->fetch(parent_span_, receiver);
}
struct RetryingParameters {
RetryingParameters(const std::string& config, uint32_t n, int64_t base_ms, int64_t max_ms)
: config_(config), expected_num_retries_(n), expected_backoff_base_interval_ms_(base_ms),
expected_backoff_max_interval_ms_(max_ms) {}
std::string config_;
uint32_t expected_num_retries_;
int64_t expected_backoff_base_interval_ms_;
int64_t expected_backoff_max_interval_ms_;
};
class JwksFetcherRetryingTest : public testing::TestWithParam<RetryingParameters> {
public:
void setupFetcher(const std::string& config_str) {
TestUtility::loadFromYaml(config_str, remote_jwks_);
mock_factory_ctx_.server_factory_context_.cluster_manager_.initializeThreadLocalClusters(
{"pubkey_cluster"});
fetcher_ = JwksFetcher::create(mock_factory_ctx_.server_factory_context_.cluster_manager_,
remote_jwks_);
EXPECT_TRUE(fetcher_ != nullptr);
}
RemoteJwks remote_jwks_;
testing::NiceMock<Server::Configuration::MockFactoryContext> mock_factory_ctx_;
std::unique_ptr<JwksFetcher> fetcher_;
NiceMock<Tracing::MockSpan> parent_span_;
};
INSTANTIATE_TEST_SUITE_P(Retrying, JwksFetcherRetryingTest,
testing::Values(RetryingParameters{R"(
http_uri:
uri: path_to_url
cluster: pubkey_cluster
timeout:
seconds: 5
retry_policy:
retry_back_off:
base_interval: 0.1s
max_interval: 32s
num_retries: 10
)",
10, 100, 32000},
RetryingParameters{R"(
http_uri:
uri: path_to_url
cluster: pubkey_cluster
timeout:
seconds: 5
retry_policy: {}
)",
1, 1000, 10000},
RetryingParameters{R"(
http_uri:
uri: path_to_url
cluster: pubkey_cluster
timeout:
seconds: 5
retry_policy:
num_retries: 2
)",
2, 1000, 10000}));
TEST_P(JwksFetcherRetryingTest, TestCompleteRetryPolicy) {
// Setup
setupFetcher(GetParam().config_);
MockUpstream mock_pubkey(mock_factory_ctx_.server_factory_context_.cluster_manager_, "200",
publicKey);
NiceMock<MockJwksReceiver> receiver;
// Expectations for envoy.config.core.v3.RetryPolicy to envoy.config.route.v3.RetryPolicy
// used by async client.
// execution deep down in async_client_'s route entry implementation
// is not exercised here, just the configuration adaptation.
EXPECT_CALL(mock_factory_ctx_.server_factory_context_.cluster_manager_.thread_local_cluster_
.async_client_,
send_(_, _, _))
.WillOnce(Invoke(
[](Http::RequestMessagePtr&, Http::AsyncClient::Callbacks&,
const Http::AsyncClient::RequestOptions& options) -> Http::AsyncClient::Request* {
RetryingParameters const& rp = GetParam();
EXPECT_TRUE(options.retry_policy.has_value());
EXPECT_TRUE(options.buffer_body_for_retry);
EXPECT_TRUE(options.retry_policy.value().has_num_retries());
EXPECT_EQ(PROTOBUF_GET_WRAPPED_REQUIRED(options.retry_policy.value(), num_retries),
rp.expected_num_retries_);
EXPECT_TRUE(options.retry_policy.value().has_retry_back_off());
EXPECT_TRUE(options.retry_policy.value().retry_back_off().has_base_interval());
EXPECT_EQ(PROTOBUF_GET_MS_REQUIRED(options.retry_policy.value().retry_back_off(),
base_interval),
rp.expected_backoff_base_interval_ms_);
EXPECT_TRUE(options.retry_policy.value().retry_back_off().has_max_interval());
EXPECT_EQ(PROTOBUF_GET_MS_REQUIRED(options.retry_policy.value().retry_back_off(),
max_interval),
rp.expected_backoff_max_interval_ms_);
EXPECT_TRUE(options.retry_policy.value().has_per_try_timeout());
EXPECT_LE(PROTOBUF_GET_MS_REQUIRED(options.retry_policy.value().retry_back_off(),
max_interval),
PROTOBUF_GET_MS_REQUIRED(options.retry_policy.value(), per_try_timeout));
const std::string& retry_on = options.retry_policy.value().retry_on();
std::set<std::string> retry_on_modes = absl::StrSplit(retry_on, ',');
EXPECT_EQ(retry_on_modes.count("5xx"), 1);
EXPECT_EQ(retry_on_modes.count("gateway-error"), 1);
EXPECT_EQ(retry_on_modes.count("connect-failure"), 1);
EXPECT_EQ(retry_on_modes.count("reset"), 1);
return nullptr;
}));
// Act
fetcher_->fetch(parent_span_, receiver);
}
} // namespace
} // namespace Common
} // namespace HttpFilters
} // namespace Extensions
} // namespace Envoy
```
|
Ruediger May (born 26 November 1974 in Meerane, Saxony) is a prolific German cruiserweight boxer known for his stinging jab. He challenged once for the WBO world cruiserweight title in 2004.
Professional
As an amateur May boxed in 76 fights, managing to win 55, before turning professional on 26 February 1994 at the age of 19. He boxed his first professional fight in San Jose, California, winning the bout against Fred Simmons, by unanimous decision.
He went on to win his first 24 pro fights before winning the German BDB cruiserweight title on 4 September 1999 with a points victory over Silvio Meinel. This was however followed by his first professional defeat at the hands of Turkish boxer Turan Bagci in Spain. After 2 successful title defenses against Michael Klötzsch and Firat Arslan, May was given a shot at the EBU (European) cruiserweight title in a bout against Ukraine's Alexander Gurov in 2001. Gurov had won the European cruiserweight championship belt from no other than May's brother, Torsten May, that same year. Rudiger lost the bout however by TKO in the 4th round, his second pro defeat.
In 2002 he boxed Alexander Petkovic, with both the WBC International cruiserweight title and German International cruiserweight title at stake. The fight ended in a disappointing draw. In 2003 however May won the vacant EBU-EU (European Union) cruiserweight title with a victory over Frenchman Frédéric Serrat. He managed 3 title defences before being given another shot at the
EBU (European) cruiserweight title in 2004 against the holder Vincenzo Cantatore, a former Italian heavyweight champion and holder of the WBC International cruiserweight title. He boxed to another draw and the belt remained with Cantatore.
That same year May's promoter Wilfried Sauerland secured him a world championship fight with WBO title holder Johnny Nelson. May missed his opportunity though, losing the bout by TKO in the 7th round.
In April 2005 May fought Poland's Krzysztof Wlodarczyk for the vacated EBU-EU (European Union) cruiserweight title but was beaten by knockout in the tenth round. Due to an alleged lack of prospects in professional boxing, May's promoter Sauerland arranged a better matched duel for May against the emerging and then still undefeated Marco Huck. May lost the fight on points over ten rounds.
After a two-year break from boxing, May returned to the ring on 31 March 2007 in a successful comeback fight against Sven Hazel. After two more victories he was handed another world championship fight, this time against WBC International cruiserweight title holder Herbie Hide in March 2008. May lost the bout by technical knockout in the second round, Hide's power proving too much for May, despite his height advantage.
Record
| style="text-align:center;" colspan=8|43 Wins (11 knockouts, 32 decisions), 6 Loss, 3 Draws
|-
! style="text-align:center; border-style:none none solid solid; background:#e3e3e3;"|Res.
! style="text-align:center; border-style:none none solid solid; background:#e3e3e3;"|Opponent
! style="text-align:center; border-style:none none solid solid; background:#e3e3e3;"|Type
! style="text-align:center; border-style:none none solid solid; background:#e3e3e3;"|Rd.
! style="text-align:center; border-style:none none solid solid; background:#e3e3e3;"|Date
! style="text-align:center; border-style:none none solid solid; background:#e3e3e3;"|Venue
! style="text-align:center; border-style:none none solid solid; background:#e3e3e3;"|Location
! style="text-align:center; border-style:none none solid solid; background:#e3e3e3;"|Notes
|-
| Loss
| Herbie Hide
|TKO
|2
|11 March 2008
|Maritim Hotel
| Halle an der Saale, Germany
|
|-
| Win
| Jevgenijs Andrejevs
|Decision
|6
|17 November 2007
|Sporthalle "Neue Zeit"
| Schwedt, Germany
|
|-
| Win
| Dzemail Skrijeli
|KO
|3
|7 July 2007
|Kölnarena
| Cologne, Germany
|
|-
| Win
| Sven Haselhuhn
|TKO
|6
|31 March 2007
|Olympiahalle
| Munich, Germany
|
|-
| Loss
| Marco Huck
|Decision
|10
|3 September 2005
|International Congress Center
| Charlottenburg, Berlin, Germany
|
|-
| Loss
| Krzysztof Wlodarczyk
|KO
|10
|16 April 2005
|
| Bydgoszcz, Poland
|
|-
| Win
| Roman Bugaj
|Decision
|8
|4 December 2004
|Estrel Convention Center
| Neukölln, Berlin, Germany
|
|-
| Loss
| Johnny Nelson
|TKO
|7
|4 September 2004
|Grugahalle
| Essen, Germany
|
|-
|style="background:#abcdef;"|Draw
| Vincenzo Cantatore
|Draw
|12
|5 June 2004
|Chemnitz Arena
| Chemnitz, Germany
|
|-
| Win
| Nate Zeikle
|KO
|2
|28 February 2004
|Mehrzweckhalle
| Dresden, Germany
|
|-
|style="background:#abcdef;"|Draw
| Vincenzo Rossitto
|Draw
|10
|22 November 2003
|Erdgas Arena
| Riesa, Germany
|
|-
| Win
| Alain Simon
|Decision
|10
|6 September 2003
|Messehalle
| Erfurt, Germany
|
|-
| Win
| Ismail Abdoul
|Decision
|10
|31 May 2003
|Brandenburg Halle
| Frankfurt, Germany
|
|-
| Win
| Frédéric Serrat
|TD
|7
|15 March 2003
|Max Schmeling Halle
| Berlin, Germany
|
|-
| Win
| Eric French
|TKO
|4
|1 February 2003
|Chemnitz Arena
| Chemnitz, Germany
|
|-
|style="background:#abcdef;"|Draw
| Alexander Petkovic
|Draw
|12
|20 July 2002
|Westfalenhalle
| Dortmund, Germany
|
|-
| Win
| Vage Kocharyan
|Decision
|8
|27 April 2002
|Sachsen Arena
| Riesa, Germany
|
|-
| Win
| Vladislav Druso
|Decision
|8
|9 March 2002
|Brandenburg Halle
| Frankfurt, Germany
|
|-
| Loss
| Alexander Gurov
|TKO
|4
|1 December 2001
|Westfalenhalle
| Dortmund, Germany
|
|-
| Win
| Mohamed Ali Bouraoui
|TKO
|2
|1 September 2001
|Bördelandhalle
| Magdeburg, Germany
|
|-
| Win
| Firat Arslan
|Decision
|10
|19 May 2001
|Maritim Hotel
| Cologne, Germany
|
|-
| Win
| Henry Mobio
|Decision
|8
|24 March 2001
|Bördelandhalle
| Magdeburg, Germany
|
|-
| Win
| Lee Manuel Ossie
|Decision
|12
|27 January 2001
|Sachsen Arena
| Riesa, Germany
|
|-
| Win
| Mohamed Ali Bouraoui
|Decision
|8
|16 December 2000
|Europahalle
| Karlsruhe, Germany
|
|-
| Win
| Michael Kloetzsch
|TKO
|3
|2 September 2000
|Bördelandhalle
| Magdeburg, Germany
|
|-
| Win
| Darron Griffiths
|Decision
|8
|6 May 2000
|Ballsporthalle
| Frankfurt, Germany
|
|-
| Loss
| Turan Bagci
|Decision
|8
|2 November 1999
|
| Ciudad Real, Spain
|
|-
| Win
| Silvio Meinel
|Decision
|10
|4 September 1999
|
| Meinsdorf, Brandenburg, Germany
|
|-
| Win
| Francis Fofoh
|Decision
|8
|8 May 1999
|Philipshalle
| Düsseldorf, Germany
|
|-
| Win
| Nigel Rafferty
|Decision
|8
|27 February 1999
|Max-Schmeling-Halle
| Berlin, Prenzlauer Berg, Germany
|
|-
| Win
| Matthew Charleston
|Decision
|6
|5 December 1998
|
| Cologne, Germany
|
|-
| Win
| Geert Blieck
|Decision
|6
|10 October 1998
|
| Vienna, Austria
|
|-
| Win
| Marco van Spaendonck
|Decision
|6
|23 March 1998
|Max-Schmeling-Halle
| Berlin, Prenzlauer Berg, Germany
|
|-
| Win
| Peter Hrivnak
|Decision
|6
|6 December 1997
|
| Neuwied, Germany
|
|-
| Win
| Stephen Brown
|Decision
|6
|5 October 1997
|
| Gera, Germany
|
|-
| Win
| Simon McDougall
|Decision
|6
|1 June 1997
|
| Riesa, Germany
|
|-
| Win
| Jerry Halstead
|Decision
|6
|26 April 1997
|
| Leipzig, Germany
|
|-
| Win
| Dan Kosmicki
|Decision
|6
|22 March 1997
|Max-Schmeling-Halle
| Berlin, Prenzlauer Berg, Germany
|
|-
| Win
| Mike McGrady
|Decision
|6
|7 December 1996
|
| Vienna, Austria
|
|-
| Win
| Albert Call
|Decision
|6
|19 October 1996
|Zoo-Gesellschaftshaus
| Frankfurt, Germany
|
|-
| Win
| Tim St Clair
|TKO
|5
|25 May 1996
|Neue Messehallen
| Leipzig, Germany
|
|-
| Win
| Slavomir Selicky
|Decision
|6
|20 April 1996
|
| Düsseldorf, Germany
|
|-
| Win
| Carlos Vásquez
|KO
|2
|23 March 1996
|Madison Square Garden
| New York City, United States
|
|-
| Win
| Ed Mosley
|KO
|2
|17 February 1996
|Westfalenhalle
| Dortmund, Germany
|
|-
| Win
| Cliff Elden
|Decision
|6
|29 January 1996
|Café Royal
|Piccadilly, London, United Kingdom
|
|-
| Win
| Scott Lindecker
|KO
|1
|3 November 1995
|Zoo-Gesellschaftshaus
| Frankfurt, Germany
|
|-
| Win
| Sean Gibbons
|KO
|4
|9 September 1995
|Seidenstickerhalle
| Bielefeld, Germany
|
|-
| Win
| John Keeton
|Decision
|6
|11 February 1995
|Festhalle Frankfurt
| Frankfurt, Germany
|
|-
| Win
| Steve Osborne
|Decision
|6
|26 November 1994
|
| Wuppertal, Germany
|
|-
| Win
| Art Stacey
|Decision
|6
|8 October 1994
|Gerry Weber Stadion
| Halle, North Rhine-Westphalia, Germany
|
|-
| Win
| Nicky Wadman
|Decision
|4
|17 September 1994
|
| Leverkusen, Germany
|
|-
| Win
| Fred Simmons
|Decision
|4
|26 February 1994
|The Event Center Arena
| San Jose, United States
|
Other Information
His brother is Torsten May, who was also a boxer.
In 2008 May spent a period of time as David Haye's sparring partner in Hayes preparation for his title defence fight with Enzo Maccarinelli and May's preparation for his world championship showdown with Herbie Hide.
References
External links
1974 births
Living people
People from Meerane
German male boxers
Cruiserweight boxers
Sportspeople from Saxony
|
```asciidoc
[[leveraging-ecmascript-collections]]
== Leveraging ECMAScript Collections
JavaScript data structures ((("ECMAScript (ES)", id="ecmas5")))are flexible enough that we're able to turn any object into a hash-map, where we map string keys to arbitrary values. For example, one might use an object to map npm package names to their metadata, as shown next.
[source,javascript]
----
const registry = {}
function set(name, meta) {
registry[name] = meta
}
function get(name) {
return registry[name]
}
set('contra', { description: 'Asynchronous flow control' })
set('dragula', { description: 'Drag and drop' })
set('woofmark', { description: 'Markdown and WYSIWYG editor' })
----
There are several problems with this approach, outlined here:
- Security issues where user-provided keys like `__proto__`, `toString`, or anything in `Object.prototype` break expectations and make interaction with this kind of hash-map data structures more cumbersome
- When iterating using `for..in` we need to rely on `Object#hasOwnProperty` to make sure properties aren't inherited
- Iteration over list items with `Object.keys(registry).forEach` is also verbose
- Keys are limited to strings, making it hard to create hash-maps where you'd like to index values by DOM elements or other nonstring references
The first problem could be fixed using a prefix, and being careful to always get or set values in the hash-map through functions that add those prefixes, to avoid mistakes.
[source,javascript]
----
const registry = {}
function set(name, meta) {
registry['pkg:' + name] = meta
}
function get(name) {
return registry['pkg:' + name]
}
----
An alternative could also be using `Object.create(null)` instead of an empty object literal. In this case, the created object won't inherit from `Object.prototype`, meaning it won't be harmed by `__proto__` and friends.
[source,javascript]
----
const registry = Object.create(null)
function set(name, meta) {
registry[name] = meta
}
function get(name) {
return registry[name]
}
----
For iteration we could create a `list` function that returns key/value tuples.
[source,javascript]
----
const registry = Object.create(null)
function list() {
return Object.keys(registry).map(key => [key, registry[key]])
}
----
Or we could implement the iterator protocol on our hash-map. Here we are trading complexity in favor of convenience: the iterator code is more complicated to read than the former case where we had a `list` function with familiar `Object.keys` and `Array#map` methods. In the following example, however, accessing the list is even easier and more convenient than through `list`: following the iterator protocol means there's no need for a custom `list` function.
[source,javascript]
----
const registry = Object.create(null)
registry[Symbol.iterator] = () => {
const keys = Object.keys(registry)
return {
next() {
const done = keys.length === 0
const key = keys.shift()
const value = [key, registry[key]]
return { done, value }
}
}
}
console.log([...registry])
----
When it comes to using nonstring keys, though, we hit a hard limit in ES5 code. Luckily for us, though, ES6 collections provide us with an even better solution. ES6 collections don't have key-naming issues, and they facilitate collection behaviors, like the iterator we've implemented on our custom hash-map, out the box. At the same time, ES6 collections allow arbitrary keys, and aren't limited to string keys like regular JavaScript objects.
Let's plunge into their practical usage and inner workings.
=== Using ES6 Maps
ES6 ((("ECMAScript (ES)", "using ES6 maps", id="ecma5ues6m")))((("ES6 maps", id="es5m")))introduces built-in collections, such as `Map`, meant to alleviate implementation of patterns such as those we outlined earlier when building our own hash-map from scratch. `Map` ((("Map", seealso="ES6 maps")))is a key/value data structure in ES6 that more naturally and efficiently lends itself to creating maps in JavaScript without the need for object literals.
==== First Look into ES6 Maps
Here's how what we had earlier would have looked when using ES6 maps. As you can see, the implementation details we've had to come up with for our custom ES5 hash-map are already built into `Map`, vastly simplifying our use case.
[source,javascript]
----
const map = new Map()
map.set('contra', { description: 'Asynchronous flow control' })
map.set('dragula', { description: 'Drag and drop' })
map.set('woofmark', {
description: 'Markdown and WYSIWYG editor'
})
console.log([...map])
----
Once you have a map, ((("ES6 maps", "keys", id="es5k")))you can query whether it contains an entry by a `key` provided via the `map.has` ((("map.has")))method.
[source,javascript]
----
map.has('contra')
// <- true
map.has('jquery')
// <- false
----
Earlier, we pointed out that maps don't cast keys the way traditional objects do. This is typically an advantage, but you need to keep in mind that they won't be treated the same when querying the map, either. The following example uses the `Map` constructor, which takes an iterable of key/value pairs and then illustrates how maps don't cast their keys to strings.
[source,javascript]
----
const map = new Map([[1, 'the number one']])
map.has(1)
// <- true
map.has('1')
// <- false
----
The `map.get` ((("map.get")))method takes a map entry `key` and returns the `value` if an entry by the provided key is found.
[source,javascript]
----
map.get('contra')
// <- { description: 'Asynchronous flow control' }
----
Deleting values from the map is possible through ((("map.delete")))the `map.delete` method, providing the `key` for the entry you want to remove.
[source,javascript]
----
map.delete('contra')
map.get('contra')
// <- undefined
----
You can clear the entries for a `Map` entirely, without losing the reference to the map itself. This can be handy in cases where you want to reset state for an object.
[source,javascript]
----
const map = new Map([[1, 2], [3, 4], [5, 6]])
map.has(1)
// <- true
map.clear()
map.has(1)
// <- false
[...map]
// <- []
----
Maps come with a read-only `.size` property that behaves similarly to ++Array#length++at any point in time it gives you the current amount of entries in the map.
[source,javascript]
----
const map = new Map([[1, 2], [3, 4], [5, 6]])
map.size
// <- 3
map.delete(3)
map.size
// <- 2
map.clear()
map.size
// <- 0
----
You're able to use arbitrary objects when choosing map keys: you're not limited to using primitive values like symbols, numbers, or strings. Instead, you can use functions, objects, dates--and even DOM elements, too. Keys won't be cast to strings as we observe with plain JavaScript objects, but instead their references are preserved.
[source,javascript]
----
const map = new Map()
map.set(new Date(), function today() {})
map.set(() => 'key', { key: 'door' })
map.set(Symbol('items'), [1, 2])
----
As an example, if we chose to use a symbol as the key for a map entry, we'd have to use a reference to that same symbol to get the item back, as demonstrated in the following snippet of code.
[source,javascript]
----
const map = new Map()
const key = Symbol('items')
map.set(key, [1, 2])
map.get(Symbol('items')) // not the same reference as "key"
// <- undefined
map.get(key)
// <- [1, 2]
----
Assuming an array of key/value pair `items` you want to include on a map, we could use a `for..of` ((("for..of")))loop to iterate over those `items` and add each pair to the map ((("map.set")))using `map.set`, as shown in the following code snippet. Note how we're using ((("destructuring")))destructuring during the `for..of` loop in order to effortlessly pull the `key` and `value` out of each two-dimensional item in `items`.
[source,javascript]
----
const items = [
[new Date(), function today() {}],
[() => 'key', { key: 'door' }],
[Symbol('items'), [1, 2]]
]
const map = new Map()
for (const [key, value] of items) {
map.set(key, value)
}
----
Maps are ((("ES6 maps", "keys", startref="es5k")))iterable objects as well, because they implement a `Symbol.iterator` method. Thus, a copy of the map can be created using a `for..of` loop using similar code to what we've just used to create a map out of the `items` array.
[source,javascript]
----
const copy = new Map()
for (const [key, value] of map) {
copy.set(key, value)
}
----
In order to keep things simple, you can initialize maps directly using any object that follows the iterable protocol and produces a collection of `[key, value]` items. The following code snippet uses an array to seed a newly created `Map`. In this case, iteration occurs entirely in the `Map` constructor.
[source,javascript]
----
const items = [
[new Date(), function today() {}],
[() => 'key', { key: 'door' }],
[Symbol('items'), [1, 2]]
]
const map = new Map(items)
----
Creating a copy of a map is even easier: you feed the map you want to copy into a new map's constructor, and get a copy back. There isn't a special `new Map(Map)` overload. Instead, we take advantage that `map` implements the iterable protocol and also consumes iterables when constructing a new map. The following code snippet demonstrates how simple that is.
[source,javascript]
----
const copy = new Map(map)
----
Just like maps are easily fed into other maps because they're iterable objects, they're also easy to consume. The following piece of code demonstrates how we can use the ((("spread operator")))spread operator to this effect.
[source,javascript]
----
const map = new Map()
map.set(1, 'one')
map.set(2, 'two')
map.set(3, 'three')
console.log([...map])
// <- [[1, 'one'], [2, 'two'], [3, 'three']]
----
In the following piece of code we've combined several new features in ES6: `Map`, the `for..of` loop, `let` variables, and a template literal.
[source,javascript]
----
const map = new Map()
map.set(1, 'one')
map.set(2, 'two')
map.set(3, 'three')
for (const [key, value] of map) {
console.log(`${ key }: ${ value }`)
// <- '1: one'
// <- '2: two'
// <- '3: three'
}
----
Even though map items are accessed through a programmatic API, their keys are unique, just like with hash-maps. Setting a key over and over again will only overwrite its value. The following code snippet demonstrates how writing the `'a'` item over and over again results in a map containing only a single item.
[source,javascript]
----
const map = new Map()
map.set('a', 1)
map.set('a', 2)
map.set('a', 3)
console.log([...map])
// <- [['a', 3]]
----
ES6 maps compare ((("ES6 maps", "keys")))keys using an algorithm called `SameValueZero` in ((("SameValueZero")))the specification, where `NaN` equals `NaN` but `-0` equals `+0`. The following piece of code shows how even though `NaN` is typically evaluated to be different than itself, `Map` considers `NaN` to be a constant value that's always the same.
[source,javascript]
----
console.log(NaN === NaN)
// <- false
console.log(-0 === +0)
// <- true
const map = new Map()
map.set(NaN, 'one')
map.set(NaN, 'two')
map.set(-0, 'three')
map.set(+0, 'four')
console.log([...map])
// <- [[NaN, 'two'], [0, 'four']]
----
When you ((("iteration protocol", "in maps")))iterate over a `Map`, you are actually looping over its `.entries()`. That means that you don't need to explicitly iterate over `.entries()`. It'll be done on your behalf anyway: `map[Symbol.iterator]` points to `map.entries`. The `.entries()` method returns an iterator for the key/value pairs in the map.
[source,javascript]
----
console.log(map[Symbol.iterator] === map.entries)
// <- true
----
There are two other `Map` iterators you can leverage: `.keys()` (((".keys()", primary-sortas="keys")))(((".keys()")))and `.values()`. (((".values()", primary-sortas="values")))(((".values()")))The first enumerates keys in a map while the second enumerates values, as opposed to `.entries()`, which enumerates key/value pairs. The following snippet illustrates the differences between all three methods.
[source,javascript]
----
const map = new Map([[1, 2], [3, 4], [5, 6]])
console.log([...map.keys()])
// <- [1, 3, 5]
console.log([...map.values()])
// <- [2, 4, 6]
console.log([...map.entries()])
// <- [[1, 2], [3, 4], [5, 6]]
----
Map entries are always iterated in insertion order. This contrasts with `Object.keys`, which is specified to follow an arbitrary order. Although in practice, insertion order is typically preserved by JavaScript engines regardless of the specification.
Maps have a `.forEach` method that's equivalent in behavior to that in ES5 `Array` objects. The signature is `(value, key, map)`, where `value` and `key` correspond to the current item in the iteration, while `map` is the map being iterated. Once again, keys do not get cast into strings in the case of `Map`, as demonstrated here.
[source,javascript]
----
const map = new Map([
[NaN, 1],
[Symbol(), 2],
['key', 'value'],
[{ name: 'Kent' }, 'is a person']
])
map.forEach((value, key) => console.log(key, value))
// <- NaN 1
// <- Symbol() 2
// <- 'key' 'value'
// <- { name: 'Kent' } 'is a person'
----
Earlier, we brought up the ability of providing arbitrary object references as the key to a `Map` entry. Let's go into a concrete use case for that ((("ECMAScript (ES)", "using ES6 maps", startref="ecma5ues6m")))((("ES6 maps", startref="es5m")))API.
==== Hash-Maps and the DOM
In ES5, ((("ES6 maps", "hash maps and the DOM", id="es5hmatdom")))((("DOM elements", "in maps", secondary-sortas="maps", id="dom5im")))whenever we wanted to associate a DOM element with an API object connecting that element with some library, we had to implement a verbose and slow pattern such as the one in the following code listing. That code returns an API object with a few methods associated to a given DOM element, allowing us to put DOM elements on a map from which we can later retrieve the API object for a DOM element.
[source,javascript]
----
const map = []
function customThing(el) {
const mapped = findByElement(el)
if (mapped) {
return mapped
}
const api = {
// custom thing api methods
}
const entry = storeInMap(el, api)
api.destroy = destroy.bind(null, entry)
return api
}
function storeInMap(el, api) {
const entry = { el, api }
map.push(entry)
return entry
}
function findByElement(query) {
for (const { el, api } of map) {
if (el === query) {
return api
}
}
}
function destroy(entry) {
const index = map.indexOf(entry)
map.splice(index, 1)
}
----
One of the most valuable aspects of `Map` is the ability to index by any object, such as DOM elements. That, combined with the fact that `Map` also has collection manipulation abilities greatly simplifies things. This is crucial for DOM manipulation in jQuery and other DOM-heavy libraries, which often need to map DOM elements to their internal state.
The following example shows how `Map` would reduce the burden of maintenance in user code.
[source,javascript]
----
const map = new Map()
function customThing(el) {
const mapped = findByElement(el)
if (mapped) {
return mapped
}
const api = {
// custom thing api methods
destroy: destroy.bind(null, el)
}
storeInMap(el, api)
return api
}
function storeInMap(el, api) {
map.set(el, api)
}
function findByElement(el) {
return map.get(el)
}
function destroy(el) {
map.delete(el)
}
----
The fact that mapping functions have become one-liners thanks to native `Map` methods means we could inline those functions instead, as readability is no longer an issue. The following piece of code is a vastly simplified alternative to the ES5 piece of code we started with. Here we're not concerned with implementation details anymore, but have instead boiled the DOM-to-API mapping to its bare essentials.
[source,javascript]
----
const map = new Map()
function customThing(el) {
const mapped = map.get(el)
if (mapped) {
return mapped
}
const api = {
// custom thing api methods
destroy: () => map.delete(el)
}
map.set(el, api)
return api
}
----
Maps aren't ((("ES6 maps", "hash maps and the DOM", startref="es5hmatdom")))((("DOM elements", "in maps", secondary-sortas="maps", startref="dom5im")))the only kind of built-in collection in ES6; there's also `WeakMap`, `Set`, and `WeakSet`. Let's proceed by digging into `WeakMap`.
=== Understanding and Using WeakMap
For ((("WeakMap", id="wm5")))((("ES6 maps", "WeakMap", id="es5wm")))the most part, you can think of `WeakMap` as a subset of `Map`. The `WeakMap` collection has a reduced API surface with fewer affordances than what we could find in `Map`. Collections created using `WeakMap` are not iterable like `Map`, meaning there is no iterable protocol in `WeakMap`, no `WeakMap#entries`, no `WeakMap#keys`, no `WeakMap#values`, no `WeakMap#forEach`, and no `WeakMap#clear` methods.
Another distinction found in `WeakMap` is that every `key` must be an object. This is in contrast with `Map`, where, while object references were allowed as keys, they weren't enforced. Remember that `Symbol` is a value type, and as such, isn't allowed either.
[source,javascript]
----
const map = new WeakMap()
map.set(Date.now, 'now')
map.set(1, 1)
// <- TypeError
map.set(Symbol(), 2)
// <- TypeError
----
In exchange for having a more limited feature set, `WeakMap` key references are weakly held, meaning that the objects referenced by `WeakMap` keys are subject to garbage collection if there are no references to them--other than weak references. This kind of behavior is useful when you have metadata about a `person`, for example, but you want the `person` to be garbage-collected when and if the only reference back to `person` is their associated metadata. You can now keep that metadata in a `WeakMap` using `person` as the key.
In that sense, a `WeakMap` is most useful when the component maintaining it doesn't own the mapped objects, but wants to assign its own information to them without modifying the original objects or their lifecycle; letting memory be reclaimed when, for example, a DOM node is removed from the document.
To initialize a `WeakMap`, you are able to provide an iterable through the constructor. This should be a list of key/value pairs, just like with `Map`.
[source,javascript]
----
const map = new WeakMap([
[new Date(), 'foo'],
[() => 'bar', 'baz']
])
----
While `WeakMap` has a smaller API surface in order to effectively allow for weak references, it still carries `.has`, `.get`, and `.delete` methods like `Map` does. The brief snippet of code shown next demonstrates these methods.
[source,javascript]
----
const date = new Date()
const map = new WeakMap([[date, 'foo'], [() => 'bar', 'baz']])
map.has(date)
// <- true
map.get(date)
// <- 'foo'
map.delete(date)
map.has(date)
// <- false
----
==== Is WeakMap a Worse Map?
The distinction that makes `WeakMap` worth the trouble is in its name. Given that `WeakMap` holds references to its keys weakly, those objects are subject to garbage collection if there are no other references to them other than as `WeakMap` keys. This is in contrast with `Map`, which holds strong object references, preventing `Map` keys and values from being garbage-collected.
Correspondingly, use cases for `WeakMap` revolve around the need to specify metadata or extend an object while still being able to garbage-collect that object if there are no other references to it. A perfect example might be the underlying implementation for `process.on('unhandledRejection')` in Node.js, which uses a `WeakMap` to keep track of rejected promises that weren't dealt with yet. By using `WeakMap`, the implementation prevents memory leaks because the `WeakMap` won't be grabbing onto the state related to those promises strongly. In this case, we have a simple map that weakly holds onto state, but is flexible enough to handle entries being removed from the map when promises are no longer referenced anywhere else.
Keeping data about DOM elements that should be released from memory when they're no longer of interest is another important use case, and in this regard using `WeakMap` is an even better solution to the DOM-related API caching solution we implemented earlier using `Map`.
In so many words, then: no, `WeakMap` is definitely not worse than ++Map++they just cater to different ((("WeakMap", startref="wm5")))((("ES6 maps", "WeakMap", startref="es5wm")))use cases.
=== Sets in ES6
The `Set` ((("ES6 sets", id="ess5")))((("Set", id="set5")))built-in is a new collection type in ES6 used to represent a grouping of values. In several aspects, `Set` is similar to `Map`:
- `Set` is also iterable
- `Set` constructor also accepts an iterable
- `Set` also has a `.size` property
- `Set` values can be arbitrary values or object references, like `Map` keys
- `Set` values must be unique, like `Map` keys
- `NaN` equals `NaN` when it comes to `Set` too
- All of `.keys`, `.values`, `.entries`, `.forEach`, `.has`, `.delete`, and `.clear`
At the same time, sets are different from `Map` in a few key ways. Sets don't hold key/value pairs; there's only one dimension. You can think of sets as being similar to arrays where every element is distinct from each other.
There isn't a `.get` method in `Set`. A `set.get(value)` method would be redundant: if you already have the `value` then there isn't anything else to get, as that's the only dimension. If we wanted to check for whether the `value` is in the set, there's `set.has(value)` to fulfill that role.
Similarly, a `set.set(value)` method wouldn't be aptly named, as you aren't setting a `key` to a `value`, but merely adding a value to the set instead. Thus, the method to add values to a set is `set.add`, as demonstrated in the next snippet.
[source,javascript]
----
const set = new Set()
set.add({ an: 'example' })
----
Sets are iterable, but unlike maps you only iterate over values, not key/value pairs. The following example demonstrates how sets can be spread over an array using the spread operator and creating a single dimensional list.
[source,javascript]
----
const set = new Set(['a', 'b', 'c'])
console.log([...set])
// <- ['a', 'b', 'c']
----
In the following example you can note how a set won't contain duplicate entries: every element in a `Set` must be unique.
[source,javascript]
----
const set = new Set(['a', 'b', 'b', 'c', 'c'])
console.log([...set])
// <- ['a', 'b', 'c']
----
The following piece of code creates a `Set` with all of the `<div>` elements on a page and then prints how many were found. Then, we query the DOM again and call `set.add` again for every DOM element. Given that they're all already in the `set`, the `.size` property won't change, meaning the `set` remains the same.
[source,javascript]
----
function divs() {
return document.querySelectorAll('div')
}
const set = new Set(divs())
console.log(set.size)
// <- 56
divs().forEach(div => set.add(div))
console.log(set.size)
// <- 56
----
Given that a `Set` has no keys, the `Set#entries` method returns an iterator of `[value, value]` for each element in the set.
[source,javascript]
----
const set = new Set(['a', 'b', 'c'])
console.log([...set.entries()])
// <- [['a', 'a'], ['b', 'b'], ['c', 'c']]
----
The `Set#entries` method ((("Set#entries")))is consistent with `Map#entries`, which ((("Map#entries")))returns an iterator of `[key, value]` pairs. Using `Set#entries` as the default iterator for `Set` collections wouldn't be valuable, since it's used in `for..of`, when spreading a `set`, and in `Array.from`. In all of those cases, you probably want to iterate over a sequence of values in the set, but not a sequence of `[value, value]` pairs.
As demonstrated next, the default `Set` iterator ((("Set#values")))uses `Set#values`, as opposed to `Map`, which defined its iterator as `Map#entries`.
[source,javascript]
----
const map = new Map()
console.log(map[Symbol.iterator] === map.entries)
// <- true
const set = new Set()
console.log(set[Symbol.iterator] === set.entries)
// <- false
console.log(set[Symbol.iterator] === set.values)
// <- true
----
The `Set#keys` method ((("Set#keys")))also returns an iterator for values, again for consistency, and it's in fact a reference to the `Set#values` iterator.
[source,javascript]
----
const set = new Set()
console.log(set.keys === set.values)
// <- true
----
=== ES6 WeakSets
In a ((("WeakSet", id="ws5")))similar fashion to `Map` and `WeakMap`, `WeakSet` is the weak version of `Set` that can't be iterated over. The values in a `WeakSet` must be unique object references. If nothing else is referencing a `value` found in a `WeakSet`, it'll be subject to garbage collection.
You can only `.set`, `.delete`, and check if the `WeakSet` `.has` a given `value`. Just like in `Set`, there's no `.get` because sets are one-dimensional.
Like with `WeakMap`, we aren't allowed to add primitive values such as strings or symbols to a `WeakSet`.
[source,javascript]
----
const set = new WeakSet()
set.add('a')
// <- TypeError
set.add(Symbol())
// <- TypeError
----
Passing iterators to the constructor is allowed, even though a `WeakSet` instance is not iterable itself. That iterable will be iterated when the set is constructed, adding each entry in the iterable sequence to the set. The following snippet of code serves as an example.
[source,javascript]
----
const set = new WeakSet([
new Date(),
{},
() => {},
[1]
])
----
As a use case for `WeakSet`, you may consider the following piece of code where we have a `Car` class that ensures its methods are only called upon car objects that are instances of the `Car` class by using a `WeakSet`.
[source,javascript]
----
const cars = new WeakSet()
class Car {
constructor() {
cars.add(this)
}
fuelUp() {
if (!cars.has(this)) {
throw new TypeError('Car#fuelUp called on a non-Car!')
}
}
}
----
For a better use case, consider the following `listOwnProperties` interface, where the provided object is recursively iterated in order to print every property of a tree. The `listOwnProperties` function should also know how to handle circular references, instead of becoming stuck in an infinite loop. How would you implement such an API?
[source,javascript]
----
const circle = { cx: 20, cy: 5, r: 15 }
circle.self = circle
listOwnProperties({
circle,
numbers: [1, 5, 7],
sum: (a, b) => a + b
})
// <- circle.cx: 20
// <- circle.cy: 5
// <- circle.r: 15
// <- circle.self: [circular]
// <- numbers.0: 1
// <- numbers.1: 5
// <- numbers.2: 7
// <- sum: (a, b) => a + b
----
One way to do it would be by keeping a list of `seen` references in a `WeakSet`, so that we don't need to worry about nonlinear lookups. We use a `WeakSet` instead of a `Set` because we don't need any of the extra features that can be found in a `Set`.
[source,javascript]
----
function listOwnProperties(input) {
recurse(input)
function recurse(source, lastPrefix, seen = new WeakSet()) {
Object.keys(source).forEach(printOrRecurse)
function printOrRecurse(key) {
const value = source[key]
const prefix = lastPrefix
? `${ lastPrefix }.${ key }`
: key
const shouldRecur = (
isObject(value) ||
Array.isArray(value)
)
if (shouldRecur) {
if (!seen.has(value)) {
seen.add(value)
recurse(value, prefix, seen)
} else {
console.log(`${ prefix }: [circular]`)
}
} else {
console.log(`${ prefix }: ${ value }`)
}
}
}
}
function isObject(value) {
return Object.prototype.toString.call(value) ===
'[object Object]'
}
----
A far more common use case would be to keep a list of DOM elements. Consider the case of a DOM library that needs to manipulate DOM elements in some way the first time it interacts with them, but which also can't leave any traces behind. Perhaps the library wants to add children onto the `target` element but it has no surefire way of identifying those children, and it doesn't want to meddle with the `target` either. Or maybe it wants to do something contextual, but only the first time it's called.
[source,javascript]
----
const elements = new WeakSet()
function dommy(target) {
if (elements.has(target)) {
return
}
elements.add(target)
// do work ..
})
----
Whatever the reason, whenever we want to keep flags associated with a DOM element without visibly altering that DOM element, `WeakSet` is probably the way to go. If instead you wanted to associate arbitrary data instead of a simple flag, then maybe you should use `WeakMap`. When it comes to deciding whether to use `Map`, `WeakMap`, `Set`, or `WeakSet`, there's a series of questions you should ask yourself. For instance, if you need to keep object-related data, then you should know to look at weak collections. If your only concern is whether something is present, then you probably need a `Set`. If you are looking to create a cache, you should probably ((("WeakSet", startref="ws5")))use a `Map`.
Collections in ES6 provide built-in solutions for common use cases that were previously cumbersome to implement by users, such as the case of `Map`, or hard to execute correctly, as in the case of `WeakMap`, where we allow references to be released if they're no longer interesting, avoiding memory ((("ES6 sets", startref="ess5")))((("Set", startref="set5")))((("ECMAScript (ES)", startref="ecmas5")))leaks.
```
|
Nao Hibino defeated Linda Nosková in the final, 6–4, 6–1 to win the singles tennis title at the 2023 Prague Open. She became only the fifth lucky loser in WTA Tour history to win a singles title, and the second to do so in the last month (after Maria Timofeeva in Budapest).
Marie Bouzková was the defending champion, but lost in the first round to Jaqueline Cristian.
Seeds
Draw
Finals
Top half
Bottom half
Qualifying
Seeds
Qualifiers
Lucky losers
Qualifying draw
First qualifier
Second qualifier
Third qualifier
Fourth qualifier
Fifth qualifier
Sixth qualifier
References
External links
Main draw
Qualifying draw
2023 WTA Tour
2023 Prague Open - 1
|
```c++
This program is free software; you can redistribute it and/or modify
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
// First include (the generated) my_config.h, to get correct platform defines.
#include "my_config.h"
#include <gtest/gtest.h>
#include "my_sys.h" // my_strerror()
#include "my_base.h" // HA_ERR_KEY_NOT_FOUND
#include <string.h>
namespace my_error_unittest {
TEST(MyErrorTest, MyStrErrorSystem)
{
char buf[512];
const char *msg;
msg= my_strerror(buf, sizeof(buf) - 1, 9999);
EXPECT_TRUE(!strcasecmp("unknown error", msg) ||
!strcasecmp("unknown error: 9999", msg) ||
!strcasecmp("unknown error 9999", msg))
<< "msg<" << msg << ">";
// try a proper error number
msg= my_strerror(buf, sizeof(buf) - 1, EPERM);
const char *os_msg= strerror(EPERM);
EXPECT_STREQ(os_msg, msg)
<< "msg<" << msg << ">";
}
TEST(MyErrorTest, MyStrErrorHandlerPlugin)
{
char buf[512];
const char *msg;
// try a HA error number
msg= my_strerror(buf, sizeof(buf) - 1, HA_ERR_KEY_NOT_FOUND);
EXPECT_STREQ("Didn't find key on read or update", msg);
}
TEST(MyErrorTest, MyGetErrMsgUnitialized)
{
const char *msg;
msg= my_get_err_msg(HA_ERR_KEY_NOT_FOUND);
EXPECT_TRUE(msg == NULL);
}
const char *faux_errmsgs[]= { "alpha", "beta", NULL, "delta" };
const char** get_faux_errmsgs()
{
return faux_errmsgs;
}
static const int faux_error_first= 8000;
static const int faux_error_last= 8003;
TEST(MyErrorTest, MyGetErrMsgInitialized)
{
const char *msg;
EXPECT_EQ(0, my_error_register(get_faux_errmsgs,
faux_error_first,
faux_error_last));
// flag error when trying to register overlapping area
EXPECT_NE(0, my_error_register(get_faux_errmsgs,
faux_error_first + 2,
faux_error_last + 2));
msg= my_get_err_msg(faux_error_first);
EXPECT_STREQ("alpha", msg);
msg= my_get_err_msg(faux_error_first + 1);
EXPECT_STREQ("beta", msg);
// within range. gives NULL here. higher level function will
// substitute a default string before printing.
msg= my_get_err_msg(faux_error_first + 2);
EXPECT_TRUE(msg == NULL);
// out of range
msg= my_get_err_msg(faux_error_first - 1);
EXPECT_TRUE(msg == NULL);
msg= my_get_err_msg(faux_error_last);
EXPECT_STREQ("delta", msg);
// out of range
msg= my_get_err_msg(faux_error_last + 1);
EXPECT_TRUE(msg == NULL);
EXPECT_TRUE(my_error_unregister(faux_error_first, faux_error_last) != NULL);
// flag error when trying to unregister twice
EXPECT_TRUE(my_error_unregister(faux_error_first, faux_error_last) == NULL);
}
}
```
|
Carcinosis, or carcinomatosis, is disseminated cancer, forms of metastasis, whether used generally or in specific patterns of spread.
Usage
Carcinomatosis is often restricted to tumors of epithelial origin, adenocarcinomas, while sarcomatosis describes the dissemination of tumors of mesenchymal origin, sarcomas.
Lung
Lymphangitic carcinomatosis
When most tumors metastasize to the lung, they form distinct nodules, but about 7% spread through the lymph vessels of the lung. They may impair breathing in several ways; the lung becomes stiffer; blood vessels traveling alongside the distended lymph vessels become compressed.
Miliary carcinosis
A pattern of multiple small nodular metastases has been described as miliary carcinosis which has a radiographic appearance similar to miliary tuberculosis.
Body cavities
Any potential space may be seeded with tumor cells that grow along surfaces, but which may not invade below the surfaces. In rare cases, the joint spaces are affected.
Peritoneal carcinomatosis
The lining of the abdominal cavity is a common site for surface dissemination. Ovarian carcinomas are common. Fluid produced by the cells can produce ascites which is typical in carcinomatosis, but less common in peritoneal sarcomatosis. Fluid can be serous as seen in primary peritoneal carcinoma or mucinous such as found in pseudomyxoma peritonei which is typically a tumor derived from the appendix.
Pleural carcinosis
Pleural carcinosis is associated with malignant pleural effusion and poor prognosis.
Leptomeningeal carcinomatosis
The meningeal covering of the central nervous system may be the site of tumor growth. Breast cancer, lung cancer and melanoma are the most common tumors.
Treatment
Colorectal cancer patients with peritoneal involvement can be treated with Oxaliplatin- or Irinotecan-based chemotherapy. Such treatment is not expected to be curative, but can extend the lives of patients. Some patients may be cured through Hyperthermic intraperitoneal chemotherapy, but the procedure entails a high degree of risk for morbidity or death.
References
External links
Carcinosis entry in the public domain NCI Dictionary of Cancer Terms
Oncology
|
```java
package com.yahoo.vespa.model.content.utils;
import com.yahoo.config.model.test.MockRoot;
import com.yahoo.vespa.model.content.cluster.ContentCluster;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import static com.yahoo.config.model.test.TestUtil.joinLines;
/**
* Class for building a content cluster with indexed search (used for testing only).
*
* @author geirst
*/
public class ContentClusterBuilder {
private String name = "mycluster";
private int redundancy = 1;
private int searchableCopies = 1;
private List<DocType> docTypes = List.of(DocType.index("test"));
private String groupXml = getSimpleGroupXml();
private Optional<String> dispatchXml = Optional.empty();
private Optional<Double> protonDiskLimit = Optional.empty();
private Optional<Double> protonMemoryLimit = Optional.empty();
private Optional<Double> clusterControllerDiskLimit = Optional.empty();
private Optional<Double> clusterControllerMemoryLimit = Optional.empty();
private Optional<Boolean> syncTransactionLog = Optional.empty();
public ContentClusterBuilder() {
}
public ContentClusterBuilder name(String name) {
this.name = name;
return this;
}
public ContentClusterBuilder redundancy(int redundancy) {
this.redundancy = redundancy;
return this;
}
public ContentClusterBuilder syncTransactionLog(boolean syncTransactionLog) {
this.syncTransactionLog = Optional.of(syncTransactionLog);
return this;
}
public ContentClusterBuilder searchableCopies(int searchableCopies) {
this.searchableCopies = searchableCopies;
return this;
}
public ContentClusterBuilder docTypes(String ... docTypes) {
this.docTypes = Arrays.stream(docTypes).
map(DocType::index).
toList();
return this;
}
public ContentClusterBuilder docTypes(List<DocType> docTypes) {
this.docTypes = docTypes;
return this;
}
public ContentClusterBuilder groupXml(String groupXml) {
this.groupXml = groupXml;
return this;
}
public ContentClusterBuilder dispatchXml(Optional<String> dispatchXml) {
this.dispatchXml = dispatchXml;
return this;
}
public ContentClusterBuilder protonDiskLimit(double limit) {
protonDiskLimit = Optional.of(limit);
return this;
}
public ContentClusterBuilder protonMemoryLimit(double limit) {
protonMemoryLimit = Optional.of(limit);
return this;
}
public ContentClusterBuilder clusterControllerDiskLimit(double limit) {
clusterControllerDiskLimit = Optional.of(limit);
return this;
}
public ContentClusterBuilder clusterControllerMemoryLimit(double limit) {
clusterControllerMemoryLimit = Optional.of(limit);
return this;
}
public ContentCluster build(MockRoot root) {
return ContentClusterUtils.createCluster(getXml(), root);
}
public String getXml() {
String xml = joinLines("<content version='1.0' id='" + name + "'>",
" <redundancy>" + redundancy + "</redundancy>",
DocType.listToXml(docTypes),
" <engine>",
" <proton>",
" <searchable-copies>" + searchableCopies + "</searchable-copies>",
getProtonResourceLimitsXml(" "),
getTransactionLogSyncXml(" "),
" </proton>",
" </engine>");
if (dispatchXml.isPresent()) {
xml += dispatchXml.get();
}
xml += groupXml;
xml += joinLines(" <tuning>",
getTuningResourceLimitsXml(" "),
" </tuning>");
return xml + "</content>";
}
private static String getSimpleGroupXml() {
return joinLines(" <group>",
" <node distribution-key='0' hostalias='mockhost'/>",
" </group>");
}
private String getProtonResourceLimitsXml(String indent) {
return getResourceLimitsXml(indent, protonDiskLimit, protonMemoryLimit);
}
private String getTuningResourceLimitsXml(String indent) {
return getResourceLimitsXml(indent, clusterControllerDiskLimit, clusterControllerMemoryLimit);
}
private String getResourceLimitsXml(String indent, Optional<Double> diskLimit, Optional<Double> memoryLimit) {
if (diskLimit.isPresent() || memoryLimit.isPresent()) {
String xml = joinLines(indent + "<resource-limits>",
getXmlLine("disk", diskLimit, indent + " "),
getXmlLine("memory", memoryLimit, indent + " "),
indent + "</resource-limits>");
return xml;
}
return "";
}
private String getTransactionLogSyncXml(String indent) {
return getXmlLine("sync-transactionlog", syncTransactionLog, indent);
}
private static <T> String getXmlLine(String tag, Optional<T> value, String indent) {
if (value.isPresent()) {
return indent + "<" + tag + ">" + value.get() + "</" + tag + ">\n";
}
return "";
}
}
```
|
The montane racket-tail (Prioniturus montanus) or the Luzon racket-tail, is a species of parrot in the family Psittaculidae.
It was previously conspecific with the Mindanao racket-tail. It is endemic to the mountains of northern Luzon in the Philippines. It is threatened by habitat loss and the cage bird trade.
Description and taxonomy
EBird describes the bird as "A medium-sized parrot of montane forest on Luzon. The two central tail feathers have extended shafts ending in a racket shape. Overall green in color, darker on the back and paler below. Male has a blue face and a red crown. The similar Green racket-tail may overlap geographically, but Luzon is usually found at higher elevations and has a darker back. Voice includes various grating calls and shrill squeals.
Exhibits sexual dimorphism in which males have a blueish crown with a bright red spot with the females having a green head with a very light blue tinge.
It eats berries, seeds and nuts.
Breeding occurs in August to September. Like all other Racket-tails, they are cavity nesters.
Habitat and conservation status
It inhabits tropic moist montane forest at 700–2,900 meters above sea level. Has been to known to visit cultivated areas.
IUCN has assessed this bird as near threatened with its population being estimated as 1,500 to 7,000 mature individuals. . Forest loss is a threat but it is not thought to have as significant impact within this species's alititudinal range as compared to lowland forest. Its lowland counterpart the Green racket-tail is considered much more threatened being listed as endangered with many local extinctions. Many parrots in the region are affected by trapping for trade, but its impacts upon this species are not known.
It is recommended to gather data on the impacts of international and national trade. Undergo surveys to have a better population estimate. Calculate rates of forest loss within its altitudinal and geographic range using satellite imagery and remote sensing techniques. Effectively protect habitat at key sites,
References
montane racket-tail
Birds of Luzon
montane racket-tail
Taxonomy articles created by Polbot
|
```objective-c
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_VM_STATE_INL_H_
#define V8_VM_STATE_INL_H_
#include "src/vm-state.h"
#include "src/log.h"
#include "src/simulator.h"
#include "src/tracing/trace-event.h"
namespace v8 {
namespace internal {
//
// VMState class implementation. A simple stack of VM states held by the
// logger and partially threaded through the call stack. States are pushed by
// VMState construction and popped by destruction.
//
inline const char* StateToString(StateTag state) {
switch (state) {
case JS:
return "JS";
case GC:
return "GC";
case COMPILER:
return "COMPILER";
case OTHER:
return "OTHER";
case EXTERNAL:
return "EXTERNAL";
default:
UNREACHABLE();
return NULL;
}
}
template <StateTag Tag>
VMState<Tag>::VMState(Isolate* isolate)
: isolate_(isolate), previous_tag_(isolate->current_vm_state()) {
if (FLAG_log_timer_events && previous_tag_ != EXTERNAL && Tag == EXTERNAL) {
LOG(isolate_, TimerEvent(Logger::START, TimerEventExternal::name()));
}
isolate_->set_current_vm_state(Tag);
}
template <StateTag Tag>
VMState<Tag>::~VMState() {
if (FLAG_log_timer_events && previous_tag_ != EXTERNAL && Tag == EXTERNAL) {
LOG(isolate_, TimerEvent(Logger::END, TimerEventExternal::name()));
}
isolate_->set_current_vm_state(previous_tag_);
}
ExternalCallbackScope::ExternalCallbackScope(Isolate* isolate, Address callback)
: isolate_(isolate),
callback_(callback),
previous_scope_(isolate->external_callback_scope()) {
#ifdef USE_SIMULATOR
scope_address_ = Simulator::current(isolate)->get_sp();
#endif
isolate_->set_external_callback_scope(this);
if (FLAG_runtime_call_stats) {
RuntimeCallStats* stats = isolate->counters()->runtime_call_stats();
timer_.Initialize(&stats->ExternalCallback, stats->current_timer());
stats->Enter(&timer_);
}
TRACE_EVENT_BEGIN0(TRACE_DISABLED_BY_DEFAULT("v8.runtime"),
"V8.ExternalCallback");
}
ExternalCallbackScope::~ExternalCallbackScope() {
if (FLAG_runtime_call_stats) {
isolate_->counters()->runtime_call_stats()->Leave(&timer_);
}
isolate_->set_external_callback_scope(previous_scope_);
TRACE_EVENT_END0(TRACE_DISABLED_BY_DEFAULT("v8.runtime"),
"V8.ExternalCallback");
}
Address ExternalCallbackScope::scope_address() {
#ifdef USE_SIMULATOR
return scope_address_;
#else
return reinterpret_cast<Address>(this);
#endif
}
} // namespace internal
} // namespace v8
#endif // V8_VM_STATE_INL_H_
```
|
AgInSbTe, or silver-indium-antimony-tellurium, is a phase change material from the group of chalcogenide glasses, used in rewritable optical discs (such as rewritable CDs) and phase-change memory applications. It is a quaternary compound of silver, indium, antimony, and tellurium.
During writing, the material is first erased, initialized into its crystalline state, with long, lower-intensity laser irradiation. The material heats up to its crystallization temperature, but not up to its melting point, and crystallizes in a metastable face-centered cubic structure. Then the information is written on the crystalline phase, by heating spots of it with short (<10 ns), high-intensity laser pulses; the material locally melts and is quickly cooled, remaining in the amorphous phase. As the amorphous phase has lower reflectivity than the crystalline phase, the bitstream can be recorded as "dark" amorphous spots on the crystalline background. At low linear velocities, clusters of crystalline material can exist in the amorphous spots.
Another similar material is GeSbTe, offering a lower linear density, but with higher overwrite cycles by 1-2 orders of magnitude. It is used in pit-and-groove recording formats, often in rewritable DVDs.
References
Optical materials
Non-oxide glasses
Compact disc
Chalcogenides
Silver compounds
Indium compounds
Antimony compounds
Tellurium compounds
|
```javascript
// @flow
import theme from 'shared/theme';
import styled from 'styled-components';
import { hexa } from 'src/components/globals';
import { OutlineButton } from 'src/components/button';
import { MEDIA_BREAK } from 'src/components/layout';
export const Container = styled.div`
display: flex;
flex: none;
flex-direction: column;
align-self: stretch;
align-items: stretch;
position: relative;
> div {
display: flex;
flex: none;
flex-direction: column;
align-self: stretch;
align-items: stretch;
}
`;
export const FetchMoreButton = styled(OutlineButton)`
width: 100%;
padding: 16px 0;
@media (max-width: ${MEDIA_BREAK}px) {
padding: 32px 0;
border-radius: 0;
background: #fff;
font-size: 16px;
font-weight: 600;
color: ${theme.brand.default};
border: none;
box-shadow: none;
border-top: 2px solid ${theme.bg.border};
&:hover {
background: ${theme.bg.wash};
border-radius: 0;
box-shadow: none;
}
}
`;
export const Divider = styled.div`
border-bottom: 2px solid ${theme.bg.border};
width: 100%;
display: block;
padding-top: 24px;
margin-bottom: 24px;
`;
export const NullColumn = styled.div`
display: flex;
align-items: center;
justify-content: center;
align-self: stretch;
text-align: center;
flex-direction: column;
padding: 24px;
background: ${theme.bg.default};
flex: 1;
button {
flex: 1;
}
@media (max-width: ${MEDIA_BREAK}px) {
border-bottom: 1px solid ${theme.bg.border};
}
`;
export const NullColumnHeading = styled.h3`
font-size: 24px;
font-weight: 700;
line-height: 1.3;
margin-bottom: 8px;
color: ${theme.text.default};
max-width: 540px;
`;
export const NullColumnSubheading = styled.p`
margin-top: 8px;
font-size: 16px;
font-weight: 400;
line-height: 1.4;
color: ${theme.text.secondary};
margin-bottom: 24px;
max-width: 360px;
`;
export const LoadingPill = styled.span`
position: absolute;
left: 50%;
transform: translateX(-50%)
translateY(${props => (props.isVisible ? '12px' : '0px')});
transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
padding: 2px 44px;
min-height: 24px;
border-radius: 48px;
background: ${theme.brand.alt};
border: 1px solid ${theme.brand.default};
opacity: ${props => (props.isVisible ? '1' : '0')};
pointer-events: none;
z-index: 11;
box-shadow: 0 2px 4px rgba(${hexa(theme.brand.alt, 0.12)});
`;
```
|
```javascript
CKEDITOR.plugins.setLang("find","lt",{find:"Rasti",findOptions:"Paiekos nustatymai",findWhat:"Surasti tekst:",matchCase:"Skirti didisias ir masias raides",matchCyclic:"Sutampantis ciklikumas",matchWord:"Atitikti piln od",notFoundMsg:"Nurodytas tekstas nerastas.",replace:"Pakeisti",replaceAll:"Pakeisti visk",replaceSuccessMsg:"%1 sutapimas() buvo pakeisti.",replaceWith:"Pakeisti tekstu:",title:"Surasti ir pakeisti"});
```
|
```java
/*
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing,
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* specific language governing permissions and limitations
*/
package org.apache.guacamole.net.auth;
import java.util.ArrayList;
import java.util.Collection;
import org.apache.guacamole.GuacamoleException;
/**
* Directory implementation which simplifies decorating the objects within an
* underlying Directory. The decorate() and undecorate() functions must be
* implemented to define how each object is decorated, and how that decoration
* may be removed.
*
* @param <ObjectType>
* The type of objects stored within this Directory.
*/
public abstract class DecoratingDirectory<ObjectType extends Identifiable>
extends DelegatingDirectory<ObjectType> {
/**
* Creates a new DecoratingDirectory which decorates the objects within
* the given directory.
*
* @param directory
* The Directory whose objects are being decorated.
*/
public DecoratingDirectory(Directory<ObjectType> directory) {
super(directory);
}
/**
* Given an object retrieved from a Directory which originates from a
* different AuthenticationProvider, returns an identical type of object
* optionally wrapped with additional information, functionality, etc. If
* this directory chooses to decorate the object provided, it is up to the
* implementation of that decorated object to properly pass through
* operations as appropriate, as well as provide for an eventual
* undecorate() operation. All objects retrieved from this
* DecoratingDirectory will first be passed through this function.
*
* @param object
* An object from a Directory which originates from a different
* AuthenticationProvider.
*
* @return
* An object which may have been decorated by this
* DecoratingDirectory. If the object was not decorated, the original,
* unmodified object may be returned instead.
*
* @throws GuacamoleException
* If the provided object cannot be decorated due to an error.
*/
protected abstract ObjectType decorate(ObjectType object)
throws GuacamoleException;
/**
* Given an object originally returned from a call to this
* DecoratingDirectory's decorate() function, reverses the decoration
* operation, returning the original object. This function is effectively
* the exact inverse of the decorate() function. The return value of
* undecorate(decorate(X)) must be identically X. All objects given to this
* DecoratingDirectory via add() or update() will first be passed through
* this function.
*
* @param object
* An object which was originally returned by a call to this
* DecoratingDirectory's decorate() function.
*
* @return
* The original object which was provided to this DecoratingDirectory's
* decorate() function.
*
* @throws GuacamoleException
* If the provided object cannot be undecorated due to an error.
*/
protected abstract ObjectType undecorate(ObjectType object)
throws GuacamoleException;
@Override
public ObjectType get(String identifier) throws GuacamoleException {
// Decorate only if object exists
ObjectType object = super.get(identifier);
if (object != null)
return decorate(object);
return null;
}
@Override
public Collection<ObjectType> getAll(Collection<String> identifiers)
throws GuacamoleException {
Collection<ObjectType> objects = super.getAll(identifiers);
// Decorate all retrieved objects, if any
Collection<ObjectType> decorated = new ArrayList<ObjectType>(objects.size());
for (ObjectType object : objects)
decorated.add(decorate(object));
return decorated;
}
@Override
public void add(ObjectType object) throws GuacamoleException {
super.add(decorate(object));
}
@Override
public void update(ObjectType object) throws GuacamoleException {
super.update(undecorate(object));
}
}
```
|
```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: --expose-gc
function Test(o) {
var x = o;
var y = this;
x.gc();
x.gc();
return y;
}
var o = {gc:gc};
assertTrue(Test(o) === this);
```
|
The Reer Caynaashe also spelled Reer Caynaanshe () are a royal Somali clan and the traditional rulers of the Habr Yunis. They divide into 17 major sub-clans that together form the Baha Ainanshe and Rer Sugulle, from the latter descend the rulers of the Habr Yunis Sultanate. They inhabit the Togdheer and Maroodi Jeex regions of Somaliland and the Daroor, Danot and Misraq Gashamo regions of Ethiopia
Origins and etymology
The clan traces their paternal lineage to Said Ismail who was the grandson of Sheikh Ishaaq bin Ahmed, an Arab Islamic scholar of the Banu Hashim. They take their name from their 18th century ancestor Ainanshe who was the son of Hersi Osman of the Ismail Arreh and a woman of the Ali Said clan. He had seven brothers: Said, Fahiya, Hildid, Warsame, Yusuf, Ali and Abdi whom they shared the same mother and are together known as the Ba Ali in reference to their mother's clan. Ainanshe was the Chieftain of the Habar Yoonis clan. His first wife belonged to the Jibrahil clan and was the mother of his eldest sons Samatar and Sugulle who would go on to found the Ba Jibrahil Rer Sugulle which is the section of the clan that all the Habr Yunis Sultan's descend. Ainanshe's other wives Mun, Basla and Egalo bore him 16 sons who are collectively known as the Baha Ainanshe. The etymology of the name Ainanshe originates from the word Ainan which in Somali means the horse's reins, when suffixed with she it takes on the meaning of one who is holding the reins, leading and guiding from disaster. Ainanshe's tomb is located to the south of Burao in the town of Jameecada Caynaanshe near the Oodweyne district border.
Enrico Baudi i Vesme who visited Burao in 1889 met the sons of Burao Chieftains Guled Ahmed Sugulle and Awad Gal, they relayed to him the following:
..They told me the story of their tribe. The chieftain of the Habr Yunis lineage, named Ainanshe, had 17 sons, one of whose name was Sugulle. First they stayed together, then they separated, forming one
Rer Sugulle, who are the most numerous, the other 16 sons together, the Baha Ainanshe. When, a few years ago, there was war between Awad and Nur, the latter ended up settling in Toyo with part of the Habr Yunis.
Volume 7 of Etiopia rassegna illustrata dell'Impero describing the Rer Ainanshe, states :
Rer Ainanshe (Baha) and Rer Sugulle belonging to the Ismail Arreh are the center of the Habr Yunis group and also their backbone. Their prestige is probably the highest among the Somalis, and in number, compactness, fighting ability and raids may perhaps be considered to occupy the first place, together being equal to each other. The Rer Sugulle, in fact, belongs to the main branch of the Ainanshe but can be considered a separate group. The two are not at all intertwined but in case of a Habr Yunis movement the tribe may gather around these two sub-tribes.
History
Habr Yunis Sultanate
The Habr Yunis Sultanate finds its roots in the Isaaq Sultanate which was established by the Rer Guled branch of the Eidagale after the Isaaq successfully defeated the Absame clan at Lafaruug in the 17th century. With time the Habr Yunis and later the Habr Awal and Habr Je'lo would break from the Isaaq Sultanate with the Habr Yunis forming their own Sultanate led by Sugulle the son of the previous Habr Yunis Chieftain, Ainanshe Hersi. Sultan Deria Sugulleh would establish his capital at Wadhan (Waram) near the Sheikh pass and tax and administer the affairs of the Habr Yunis from the town. Large caravans bound for Berbera would pass through Habr Yunis territory through Burao and then Wadhan and proved a lucrative source of income for Sultan Deria.
Deria was succeeded by Hersi the son of Aman Deria who had died before his Sultan father, he was an important Habr Yunis chieftain. Vesme Baudi travelling through Habr Je'lo country east of Burao in 1889 gives an account of Aman's tomb.
At nine o'clock we arrived at Baiadowal, on the Thug Dehr, a charming site, where the trees form a small forest, in which the most delightful coolness is enjoyed. A few hundred meters away there is a tomb surrounded by a palisade of tree trunks made with care. There rests a chieftain of the Habr Junis, by name Ohman-Dhirrin [Aman Deria]..his tribe had intermingled with the Habr Gialeh, and when that chief had died, they had made him that tomb with a palisade in memory of his great merits.
Hersi Aman is remembered for his successful conquests and expansion of Garhajis territory in the Haud. His reign was abruptly ended when he was killed in a battle against the kindred Baha Sugulleh.
Ismail Mire in his famous poem Ragow Kibirka Waa Lagu Kufaa (Pride Comes Before a Fall) comments on Hersi's conquests, pride and desire to rule.
Dual Sultans Era
After the death of Sultan Hersi Aman, the Baha Deria and Baha Makahil sections of the Sugulle dynasty vied for the Sultanship, which divided the Habr Yunis clan into two factions, the Baha Deria faction led by Guled Haji crowned Awad Deria a surviving son of the Sultan Deria Sugulleh. The Bah Makahil crowned Nur Ahmed Aman a young Mullah and nephew of Hersi Aman. Nur was initially uneasy and preferred his life as a Mullah rather than being the Sultan designate. The Habr Yunis were not interrupted by the British Somaliland protectorate which had been established in 1884 and was still largely relegated to the coast and its capital of Berbera. The two Sultans engaged in a lengthy war and divided the Sultanate's territory, where Awad ruled the Sultanate from his chosen capital of Burao and Nur from the Tuuyo plains and Oodweyne.
Frank Linsly James visited Sultan Awad at Burao in 1884 and witnessed the dissenting situation between the two Sultans. Describing the political situation in the region and frequent raids between the two rival Rer Sugulleh factions and their allied Habr Yunis subclans
It appeared the great Habr Gerhajis tribe was divided into two rival factions, the one owning allegiance to Sultan Owd, the other to his cousin, Sultan Noor. Between these two the country was about evenly divided, and the border-line was an everlasting scene of wars and rumours of wars, cattle raids, and attempted murders.
The Haber-Gerhajis tribe had formerly been under one Sultan and were very powerful, making frequent raids into Ogadayn, but on his death, two cousins, Awad and Nur, divided the country between them.
Awad was killed fighting in Ogaden by the Reer Ali. This allowed Nur to establish himself at Burao and rule over the entirety of the Habr Yunis. The Baha Deria still did not concede defeat and would eventually choose Awad's nephew, Madar Hersi, as their successor following Nur's death. Sultan Nur convened a shir of the Habr Yunis and decided to draw lots to settle the dispute with his challenger Madar Hersi rather than continue the senseless infighting that had lasted since Hersi Aman's death. Sultan Nur won the draw and gave Madar Hersi 100 camels as compensation and was proclaimed the uncontested Sultan of the Habr Yunis. The reunified rule under one Sultan Nur would last until the formation of the Dervish Movement several years later in 1899.
Early Dervish period
Sultan Nur had been the architect of disturbances at Berbera and was the man who narrated the famous story of French Catholic missionaries in Berbera converting Somali children. According to the consul-general James Hayes Sadler this news was either spread or concocted by Sultan Nur of the Habr Yunis. Madar Hersi his former rival for the Sultan title had aided the Mullahs of Kob Fardod in recovering livestock that was previously looted by some of the Habr Yunis and this reignited after receiving aid from the Mullahs there notably Mohammed Abdullah Hassan. Upon his visit to Oodweyne in July 1899 Sultan Nur convened a great shir of the western Habr Yunis clans and called on them to join the new Dervish movement and upon their refusal he would leave to Burao and successfully rallied the eastern sections of the clan. The Dervish would declare war from Burao on September 1 of 1899. Madar was soon propagated as the legitimate Sultan by British authorities and managed the western sections of the clan throughout the period of the Dervish wars.
The last intelligence report mention of Sultan Nur in the Italian archives was in 1907. After the death of Sultan Nur 1907/1908 in the Dervish camp at Taleh his son Dolal Nur ascended the sultanate in the dervish camp.
Sultan Nur was buried by his dervish in a large domed tomb in Taleh, his tomb predated the later dervish forts. His white tomb in the dervish capital is a testimony to his contribution to the movement. Few dervish founders are commemorated in Taleh, numbering only four.
William Archibald Macfadyen, a British geologist and the only scholar to study the structures of Taleh fort, mentioned the handful of tombs constructed by the dervish for their leaders and gave a detailed description of the tombs in 1931. In his article Macfayden only identified Sultan Nur's tomb by name out of the four dervish entombed in Taleh:
"South of the main cave-well is the considerable tomb of Abdullah Hasan senior, well plastered inside and out; it is now said to be empty. Adjoining this on the west is a walled garden with massive gateway and guard-house; the rest of the wall is not more than 5 feet high and plastered. There are still odd bushes and signs of cultivation to be seen, but the comparatively deep well in the middle is dry. To the east lies a row of four tombs. The most northerly is that of oneSoldan Nur of the Habr Yunis tribe; the next two, neither being plastered.and the first with the top left unfinished, are those of Hawiya notables whosenames my Somalis did not know. The most southerly tomb is that of aman of the Habr Jaalo tribe. The isolated tomb still farther east is that of'AbdullahHasan's mother. All the tombs are provided with narrow but very massive wooden doors, swinging about vertical extensions from top and baseof one side."
After the Bombing campaign of the Taleh fort and the Dervish retreat into Ethiopia, Tribal Chief Haji Mohammad Bullaleh (Haji the Hyena), a cousin of Sultan Nur, commanded a 3000 strong army that consisted of Habr Yunis, Habr Je'lo and Dhulbahante warriors and pursued the fleeing Dervishes. They attacked Muhammad Abdallah Hassan and his army in the Ogaden region and swiftly defeated them, causing Muhammad to flee to the town of Imi. Haji and his army looted 60,000 livestock and 700 rifles from the dervishes, which dealt a severe blow to them economically, a blow from which they did not recover.
Rulers
The Habr Yunis Sultanate had eight rulers throughout its duration and the institution of Sultan still lasts today with the Baha Deria leading I conflict still not being completely resolved. The Bah Makahil maintain a well respected pretender although the current Sultan Osman Ali Madar of the Baha Deria is considered as the Sultan of the Habr Yunis.
Anti-colonialism
The Rer Ainanshe along with their Hersi Osman kin were at the forefront of anti-colonial activity in the Somaliland protectorate and Italian Abyssinia. Lieutenant Mosye-Bartlette author of the Kings African rifles states that they constantly defied and resisted the British Protectrate government. In his 1884 publication La confrérie musulmane (Muslim Brotherhood) Henri Duveyrier states that the Rer Ainanshe had ties with the Senoussis, later Kings of Libya, who in the 19th century were involved in many anti-colonial upheavals across Muslim Africa. In 1896 Sultan Nur received a Senoussi delegation, at that time he was involved in war with the British government then based at Berbera.
Langton Walsh details an account of one of Nur's raids on the British in 1896, he states:
Ten days elapsed, but no reply to my letter came from Sultan Nur. I heard, however, that two Senousi Akwan were guests in his kraal ; and this was a very significant fact, since it showed that these guests, members of a very influential community, were hatching a scheme to retaliate on and injure the Administration...With the aid of a telescope fixed on a swivel tripod we easily made out the raiders, but the scout could not even approximately tell us the number of horsemen we might have to contend with if we attacked them. He would not agree that they were mere Murrasseh bandits, but asserted that they were tribesmen led by two important chiefs. One chief was a Dulbanta with a large mounted force, and the other an infantry soldier magnate named Sultan Nur, who commanded in person possibly a few hundred horsemen of his own tribe and fifteen hundred footmen. The scout was certain that Sultan Nur was in command, since the sultan's horse, a whitish-grey, was well known to the Aysa Musa scout...Sultan Nur on this occasion had made a haul of about 1,500 camels, since there happened to be at Berbera three or four large caravans from the interior, in addition to the camels of the townsmen which had also been driven off. It transpired later that three raiders had been shot dead, and a few others were no doubt wounded by rifle fire. We also found four dead horses on the field. No doubt Sultan Nur had not been sufficiently punished
In 1899 Several members of the Rer Ainanshe would be among the founders of the Dervish movement, most prominent among being the Rer Amman brothers; Sultan Nur, Geele Ahmed and Hersi Ahmed.
Sections of the Hersi Osman once again clashed with the British in 1922 after a heavy tax was imposed upon them at Burao, the Rer Ainanshe and Said Hersi revolted in opposition to the tax and this caused them to clash with other sections of the Habr Yunis and the British colonial government. In the ensuing riot and shootout between the British and Hersi Osman, Captain Allan Gibb, a Dervish war veteran and district commissioner, was shot and killed. The British fearing they could not contain the revolt requested from Sir Winston Churchill, then-Secretary of State for the Colonies, to send troops from Aden and Airplane bombers in order to bomb Burao and livestock of the revolting clans to quell any further rebellion. The RAF planes arrived at Burao within two days and proceeded to Bomb the town with incendiaries, effectively burning the entire settlement to the ground.
Telegram from Sir Geoffrey Archer, Governor of British Somaliland to Sir Winston Churchill the Secretary of State for the Colonies:
I deeply regret to inform that during an affray at Burao yesterday between Rer Sugulleh and Akils of other tribes Captain Gibb was shot dead. Having called out Camel corps company to quell the disturbance, he went forward himself with his interperter, whereupon fire opened on him by some Rer segulleh riflemen and he was instantly killed. Miscreants then disappeared under the cover of darkness. In order to meet the situation created by the Murder of Gibb, we require two aeroplanes for about fourteen days. I have arranged with resident, Aden, for these. And made formal application, which please confirm. It is proposed they fly via Perim, confining sea crossing to 12 miles. We propose to inflict fine of 2,500 camels on implicated sections, who are practically isolated and demand surrender of man who killed Gibbs. He is known. Fine to be doubled in failure to comply with latter conditions and aeroplanes to be used to bomb stock on grazing grounds.
James Lawrence author of Imperial Rearguard: Wars of Empire writes
[Gibb]..was murdered by rioters during a protest against taxation at Burao. Governor Archer immediately called for aircraft which were at Burao within two days. The inhabitants of the native township were turned out of their houses, and the entire area was razed by a combination of bombing, machine-gun fire and burning.
After the RAF aircraft bombed Burao to the ground and months of unrest the Rer Ainanshe and other Hersi Osman clans agreed to pay a small fine for Gibbs death, but they refused to identify and apprehend the accused individuals. Most of the men responsible for Gibb's shooting evaded capture. In light of the failure to implement the taxation without provoking a violent response, the British abandoned the policy altogether.
Clan tree
Ainanshe Hersi
Egal Ainanshe
Omar Ainanshe
Suban Ainanshe
Esa Ainanshe
Guled Ainanshe
Ahmed Ainanshe
Samaale Ainanshe
Hersi Ainanshe
Abdi Ainanshe
Farah Ainanshe
Butiye Ainanshe
Meigag Ainanshe
Wais Ainanshe
Koshin Ainanshe
Liban Ainanshe
Gutale Ainanshe
Warsame Guutaale
Adan Guutaale
Yusuf Guutaale
Mohamed Guutaale
Abar Guutaale
Ghazali Guutaale
Midle Guutaale
Magan Guutaale
Abdille Guutaale
Elmi Guutaale
Fahiye Guutaale
Sugulle Guutaale
Hirsi Guutaale
Dualeh Gutaale
Ateye Guutaale
Said Guutaale
Sultan Sugulle Ainanshe
Gelle Sugulle
Farah Sugulle
Mahamoud Sugulle
Duale Sugulle
Mohamed Sugulle
Wais Sugulle
Roble Sugulle
Ahmed Sugulle (Father of Aqil Guled Haji)
Sultan Deria Sugulle
Adan Deria
Abdillahi Deria
Yusuf Deria
Ali Deria
Ismail Deria
Samatar Deria
Abokor Deria
Mahamud Deria
Egal Deria
Nur Deria
Guled Deria
Isman Deria
Ahmed Deria
Hassan Deria
Jama Deria
Sultan Awad Deria
Hersi Deria (Father of Sultan Madar)
Aman Deria (Father of Sultan Hersi and Grandfather of Sultan Nur)
Notable People
Abdillahi Diiriye Guled - literary scholar and discoverer of the Somali prosodic system
Abdulkadir Said Ahmed - Footballer who plays as a midfielder for Finnish club VJS and the Somalia national team
Ahmed Said Ahmed - international footballer who plays for VJS, as a defender and Captain of the Somalia national team
Ali Ismail Yacqub - First Minister of Defence for the Somali Republic
Awad Deria - 4th Sultan of the Habr Yunis clan
Deria Sugulleh Ainashe- 2nd Sultan of the Habr Yunis clan
Dolal Nur - 6th Sultan of the Habr Yunis clan
Guled Haji - was a Somali wiseman, chief akil of Ba Eli section of the Rer Sugulle, and the commander of Habr Yunis sultanate.
Hassan Adan Wadadid - Somali Republic ambassador to Saudi Arabia and Pakistan and one of the original founders and Vice Chairman of the Somali National Movement
Hassan Ismail Yusuf - Somali politician and served as the Minister of Health of Somaliland
Hersi Aman - 3rd Sultan of the Habr Yunis clan
Madar Hersi - 5th Sultan of the Habr Yunis
Mohamed Ainanshe Guled - Brigadier General of SNA and the vice president of the Somali Democratic Republic
Mohamed Bullaleh - prominent 20th Century tribal chief and commander of the Hagoogane raid that destroyed Dervish movement
Nur Ahmed Aman - 4th sultan of the Habr Yunis and one of the founders of the Somali Dervish movement
Osman Jama Ali - Prime Minister of Somalia under the Transitional National Government
Ridwan Hirsi Mohamed - former Deputy Prime Minister of Somalia and Former Minister of Religious Affairs of Somalia.
Said Sulub Mohamed - Somali politician, who is currently serving as the Minister of Livestock and Fisheries of Somaliland.
Suldaan Said Ahmed - Finnish politician who is a member of the Parliament of Finland and the Helsinki City Council for the Left Alliance.
Yasin Handule Wais religious scholar and founder of Somaliland's first Islamic party in the mid 20th century
References
Somali royalty
Somali royal clans
Somali clans
Somaliland noble families
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.