text
stringlengths 1
22.8M
|
|---|
The Alexandria Gazette was a succession of newspapers based in Alexandria, Virginia, United States. The newspaper offers an important source of information for events in Alexandria, particularly in the nineteenth century. The newspaper served as the dominant newspaper in Alexandria from 1834 to 1974. It served as a voice to the Whig Party and later the Democratic Party.
The predecessor to the Gazette was established on February 5, 1784, by George Richards & Company as the Virginia Journal. The Alexandria Gazette building on Prince Street was burned during the Civil War by rioting federal troops. It was rebuilt by the publisher and editor Edgar Snowden after the war. The newspaper was subsequently located at 317 King Street.
A successor to the earlier iterations ran as a daily newspaper from 1834 to 1974. Its first publisher was Edgar Snowden (1810–1875), who represented Alexandria in the Virginia House of Delegates several times as well as unsuccessfully run for Governor of Virginia (losing to Extra-Billy Smith). Snowden was pro-slavery and threatened abolitionist publishers William Lloyd Garrison and Arthur Tappan with lynching should they visit Alexandria.
During the first half of the 20th century U.S. Representative Charles Creighton Carlin and his son Charles Creighton Carlin Jr. edited the paper.
In popular culture
The paper is prominently shown in Alfred Hitchcock's 1969 film Topaz.
References
External links
A-Z of obituaries in the Alexandria Gazette
Alexandria Gazette at Chronicling America
Defunct newspapers published in Virginia
History of Alexandria, Virginia
Publications disestablished in 1974
Publications established in 1784
1784 establishments in Virginia
1974 disestablishments in Virginia
|
The collateral source rule, or collateral source doctrine, is an American case law evidentiary rule that prohibits the admission of evidence that the plaintiff or victim has received compensation from some source other than the damages sought against the defendant. The purpose of the rule is to ensure that the wrongful party pays the full cost of the harm caused, so that future harmful conduct is thereby deterred or, at least, fully included in the defendant's cost of doing business. Subrogation and indemnification principles then commonly provide that the person who paid the initial compensation to the plaintiff or victim has a right to recover any double recovery from the plaintiff or victim. For example, in a personal injury action, evidence that the plaintiff's medical bills were paid by medical insurance, or by workers' compensation, is not generally admissible and the plaintiff can recover the amount of those bills from the defendant. If the plaintiff then collects the amount of medical bills from the defendant, that amount is then typically paid by the plaintiff to the insurance carrier under principles of subrogation and indemnification.
The collateral source doctrine has come under attack by tort reform advocates. They argue that if the plaintiff's injuries and damages have already been compensated, it is unfair and duplicative to allow an award of damages against the tortfeasor. As a result some states have altered or partially abrogated the rule by statute. Proponents of the rule note that without it, the wrongdoer [tortfeasor] gets the benefit of the injured party carrying insurance or obtaining minimal benefits through government programs and obtains a form of subsidy where the wrongdoer does not pay the full cost of their wrongful conduct but instead transfers some of that cost [insurance premiums] to the victims causing insurance rates to be higher.
Nevertheless, some courts have held that the rule ought not to provide a safe haven in a contract action for an unfaithful contracting party.
References
United States evidence law
Judicial remedies
Legal doctrines and principles
Tort law
|
The Embassy of the Republic of Finland in Moscow is the chief diplomatic mission of Finland in the Russian Federation. It is located at 15-17 Kropotkinsky Lane () in the Khamovniki District of Moscow.
Ambassadors
Soviet Union
Russia
See also
Finland–Russia relations
Diplomatic missions in Russia
Moscow Finnish School
References
External links
Embassy of Finland in Moscow
Finland–Russia relations
Finland
Moscow
Khamovniki District
Finland–Soviet Union relations
Cultural heritage monuments in Moscow
|
```kotlin
package mega.privacy.android.app.getLink
import mega.privacy.android.shared.resources.R as sharedR
import android.app.Activity.RESULT_OK
import android.content.Intent
import android.os.Bundle
import android.view.LayoutInflater
import android.view.Menu
import android.view.MenuInflater
import android.view.MenuItem
import android.view.View
import android.view.ViewGroup
import androidx.activity.result.ActivityResultLauncher
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.lifecycle.lifecycleScope
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.flow.filterNotNull
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import mega.privacy.android.app.R
import mega.privacy.android.app.activities.contract.ChatExplorerActivityContract
import mega.privacy.android.app.components.PositionDividerItemDecoration
import mega.privacy.android.app.components.attacher.MegaAttacher
import mega.privacy.android.app.databinding.FragmentGetSeveralLinksBinding
import mega.privacy.android.app.featuretoggle.AppFeatures
import mega.privacy.android.app.getLink.adapter.LinksAdapter
import mega.privacy.android.app.getLink.data.LinkItem
import mega.privacy.android.app.interfaces.ActivityLauncher
import mega.privacy.android.app.interfaces.SnackbarShower
import mega.privacy.android.app.interfaces.showSnackbar
import mega.privacy.android.app.utils.Constants
import mega.privacy.android.app.utils.Constants.ALPHA_VIEW_DISABLED
import mega.privacy.android.app.utils.Constants.ALPHA_VIEW_ENABLED
import mega.privacy.android.app.utils.Constants.EXTRA_SEVERAL_LINKS
import mega.privacy.android.app.utils.Constants.REQUEST_CODE_SELECT_CHAT
import mega.privacy.android.app.utils.Constants.TYPE_TEXT_PLAIN
import mega.privacy.android.app.utils.MenuUtils.toggleAllMenuItemsVisibility
import mega.privacy.android.app.utils.TextUtil.copyToClipboard
import mega.privacy.android.domain.usecase.featureflag.GetFeatureFlagValueUseCase
import nz.mega.sdk.MegaApiJava
import java.util.UUID
import javax.inject.Inject
/**
* Fragment of [GetLinkActivity] to allow the creation of multiple links.
*/
@AndroidEntryPoint
class GetSeveralLinksFragment : Fragment() {
private val viewModel: GetSeveralLinksViewModel by activityViewModels()
private lateinit var binding: FragmentGetSeveralLinksBinding
private lateinit var chatLauncher: ActivityResultLauncher<Unit?>
private var menu: Menu? = null
private val linksAdapter by lazy { LinksAdapter() }
private val handles: LongArray? by lazy {
activity?.intent?.getLongArrayExtra(Constants.HANDLE_LIST)
}
@Inject
lateinit var getFeatureFlagValueUseCase: GetFeatureFlagValueUseCase
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
chatLauncher = registerForActivityResult(ChatExplorerActivityContract()) { data ->
data?.putStringArrayListExtra(EXTRA_SEVERAL_LINKS, viewModel.getLinksList())
MegaAttacher(requireActivity() as ActivityLauncher).handleActivityResult(
REQUEST_CODE_SELECT_CHAT,
RESULT_OK,
data,
requireActivity() as SnackbarShower
)
}
}
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?,
): View {
binding = FragmentGetSeveralLinksBinding.inflate(layoutInflater)
setHasOptionsMenu(true)
return binding.root
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
initialize()
}
private fun initialize() {
viewLifecycleOwner.lifecycleScope.launch {
if (getFeatureFlagValueUseCase(AppFeatures.HiddenNodes)) {
checkSensitiveItems()
} else {
initNodes()
setupView()
setupObservers()
}
}
}
private fun checkSensitiveItems() {
val handles = handles ?: run {
activity?.finish()
return
}
viewModel.hasSensitiveItemsFlow
.filterNotNull()
.onEach { hasSensitiveItems ->
if (hasSensitiveItems) {
showSharingSensitiveItemsWarningDialog()
} else {
initNodes()
setupView()
setupObservers()
}
}.launchIn(viewLifecycleOwner.lifecycleScope)
viewModel.checkSensitiveItems(handles.toList())
}
private fun showSharingSensitiveItemsWarningDialog() {
val context = context ?: return
MaterialAlertDialogBuilder(context)
.setTitle(getString(sharedR.string.hidden_items))
.setMessage(getString(sharedR.string.share_hidden_item_links_description))
.setCancelable(false)
.setPositiveButton(R.string.button_continue) { _, _ ->
initNodes()
setupView()
setupObservers()
}
.setNegativeButton(R.string.general_cancel) { _, _ -> activity?.finish() }
.show()
}
private fun initNodes() {
val context = context ?: return
val handles = handles ?: run {
activity?.finish()
return
}
viewModel.initNodes(handles, context)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
android.R.id.home -> {
requireActivity().onBackPressedDispatcher.onBackPressed()
}
R.id.action_share -> {
val uniqueId = UUID.randomUUID()
startActivity(
Intent(Intent.ACTION_SEND)
.setType(TYPE_TEXT_PLAIN)
.putExtra(Intent.EXTRA_SUBJECT, "${uniqueId}.url")
.putExtra(Intent.EXTRA_TEXT, viewModel.getLinksString())
)
}
R.id.action_chat -> {
chatLauncher.launch(Unit)
}
}
return super.onOptionsItemSelected(item)
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
inflater.inflate(R.menu.activity_get_link, menu)
this.menu = menu
refreshMenuOptionsVisibility()
super.onCreateOptionsMenu(menu, inflater)
}
/**
* Sets the right Toolbar options depending on current situation.
*/
private fun refreshMenuOptionsVisibility() {
val menu = this.menu ?: return
menu.toggleAllMenuItemsVisibility(!viewModel.isExportingNodes())
}
private fun setupView() {
binding.linksList.apply {
adapter = linksAdapter
setHasFixedSize(true)
addItemDecoration(
PositionDividerItemDecoration(
requireContext(),
resources.displayMetrics,
0
)
)
}
binding.copyButton.apply {
isEnabled = false
setOnClickListener {
copyLinks(
links = viewModel.getLinksString(),
isForFirstTime = false
)
}
}
}
private fun setupObservers() {
viewModel.getLinkItems().observe(viewLifecycleOwner, ::showLinks)
viewModel.getExportingNodes().observe(viewLifecycleOwner, ::updateUI)
}
/**
* Shows the links in the list.
*
* @param links List of [LinkItem]s to show.
*/
private fun showLinks(links: List<LinkItem>) {
linksAdapter.submitList(links)
if (viewModel.getLinksString().isNotBlank()) {
copyLinks(links = viewModel.getLinksString(), isForFirstTime = true)
}
}
/**
* Updates the UI depending on if is exporting nodes yet or not.
*
* @param isExportingNodes True if is exporting nodes, false otherwise.
*/
private fun updateUI(isExportingNodes: Boolean) {
binding.copyButton.apply {
isEnabled = !isExportingNodes
alpha = if (isExportingNodes) ALPHA_VIEW_DISABLED else ALPHA_VIEW_ENABLED
}
refreshMenuOptionsVisibility()
}
/**
* Copies to the clipboard all the links.
*
* @param links String containing all the links to copy.
*/
private fun copyLinks(links: String, isForFirstTime: Boolean) {
copyToClipboard(requireActivity(), links)
(requireActivity() as SnackbarShower).showSnackbar(
if (isForFirstTime) {
requireContext().resources.getQuantityString(
R.plurals.general_snackbar_link_created_and_copied,
viewModel.getLinksNumber()
)
} else {
requireContext().resources.getQuantityString(
R.plurals.links_copied_clipboard,
viewModel.getLinksNumber()
)
}
)
}
}
```
|
The Argonauts is a book by poet and critic Maggie Nelson, published in 2015. It mixes philosophical theory with memoir. The book discusses her romantic relationship with the transgender artist Harry Dodge leading to her pregnancy as well as topics ranging from the death of a parent, transgender embodiment, academia, familial relationships, and the limitations of language. Nelson also explores and criticizes ideas from several philosophers including Gilles Deleuze, Judith Butler and Eve Kosofsky Sedgwick. The title is a reference to Roland Barthes' idea that to love someone is similar to an Argonaut who constantly replaces parts of their ship without the ship changing names. The book won a National Book Critics Circle Award for criticism for books published in 2015.
References
2015 non-fiction books
American non-fiction books
Transgender non-fiction books
Books about families
National Book Critics Circle Award-winning works
Philosophy books
Graywolf Press books
2010s LGBT literature
LGBT literature in the United States
|
The 1992–93 Liga Leumit, Israeli national soccer league season ended with Beitar Jerusalem winning the championship after being promoted in the previous season from Liga Artzit.
League standings
Results
First and second round
Third round
Promotion-relegation play-off
A promotion-relegation play-off between the 13th-placed team in Liga Leumit, Hapoel Petah Tikva, and the 4th team in Liga Artzit, Maccabi Jaffa.
Hapoel Petah Tikva won 5–1 on aggregate and remained in Liga Leumit.
References
Israel - List of Final Tables RSSSF
Liga Leumit seasons
Israel
1
|
The Parish of Blackwood is a remote civil parish of Poole County in far North West New South Wales,
Geography
The geography is mostly the flat, arid landscape of the Channel Country. The nearest town is Tibooburra to the south east, which is on the Silver City Highway and lies south of the Sturt National Park.
The parish has a Köppen climate classification of BWh (Hot desert). The County is barely inhabited with a population density of less than 1 person per 150 km² and the landscape is a flat arid scrubland.
History
Charles Sturt camped at nearby Preservation Creek (Mount Poole) for six months during 1845, and in 1861 the Burke and Wills expedition passed to the east, through what is now the Pindera Aboriginal Area.
Gold was discovered nearby in the 1870s.
References
Parishes of Poole County
Far West (New South Wales)
|
Ronald Vuijk (born 22 October 1965 in The Hague) is a Dutch politician. As a member of the People's Party for Freedom and Democracy (Volkspartij voor Vrijheid en Democratie) he was an MP between 8 November 2012 and 23 March 2017. Previously he was a municipal councillor of Delft from 2002 to 2005 and also from 2010 to 2011. In the meantime he was an alderman of this municipality. From 2011 to 2012, he was an alderman of the municipality of Midden-Delfland.
References
1956 births
Living people
Members of the House of Representatives (Netherlands)
Municipal councillors of Delft
Aldermen in South Holland
People from Midden-Delfland
Politicians from The Hague
People's Party for Freedom and Democracy politicians
21st-century Dutch politicians
|
Tequatrovirus is a genus of viruses in the order Caudovirales, in the family Myoviridae, in the subfamily Tevenvirinae. Gram-negative bacteria serve as the natural host, with transmission achieved through passive diffusion. There are 75 species in this genus.
Taxonomy
The following species are assigned to the genus:
Citrobacter virus CrRp10
Citrobacter virus PhiZZ6
Citrobacter virus PhiZZ23
Enterobacteria virus Aplg8
Enterobacteria virus GiZh
Enterobacteria virus IME340
Enterobacteria virus Kha5h
Enterobacteria virus RB18
Enterobacteria virus RB27
Enterobacteria virus T6
Escherichia virus AR1
Escherichia virus AREG1
Escherichia virus C40
Escherichia virus CF2
Escherichia virus DalCa
Escherichia virus E112
Escherichia virus EC121
Escherichia virus ECML134
Escherichia virus EcNP1
Escherichia virus ECO4
Escherichia virus EcoMF1
Escherichia virus F2
Escherichia virus fFiEco06
Escherichia virus G8
Escherichia virus G28
Escherichia virus G50
Escherichia virus G4498
Escherichia virus G4507
Escherichia virus G9062
Escherichia virus HY01
Escherichia virus HY03
Escherichia virus Ime09
Escherichia virus IME537
Escherichia virus KAW1E185
Escherichia virus KIT03
Escherichia virus Lutter
Escherichia virus NBEco003
Escherichia virus NBG2
Escherichia virus OE5505
Escherichia virus Ozark
Escherichia virus PD112
Escherichia virus PE37
Escherichia virus PP01
Escherichia virus RB3
Escherichia virus RB14
Escherichia virus RB32
Escherichia virus slur03
Escherichia virus slur04
Escherichia virus T2
Escherichia virus T4
Escherichia virus teqdroes
Escherichia virus teqhad
Escherichia virus teqskov
Escherichia virus YUEEL01
Salmonella virus SG1
Salmonella virus SNUABM-01
Serratia virus PhiZZ30
Shigella virus CM8
Shigella virus JK45
Shigella virus pSs1
Shigella virus Sf21
Shigella virus Sf22
Shigella virus Sf23
Shigella virus Sf24
Shigella virus SH7
Shigella virus SHBML501
Shigella virus SHBML-50-1
Shigella virus Shfl2
Shigella virus SHFML11
Shigella virus SHFML26
Yersinia virus D1
Yersinia virus fPS-2
Yersinia virus PST
Yersinia virus PYPS2T
Yersinia virus ZN18
Structure
Tequatrovirus species are nonenveloped, with a head and tail. The head is a prolate spheroid approximately 120 nm in length and 86 nm in width, with an elongated icosahedral symmetry (T=13, Q=21) composed of 152 total capsomers. The tail has six long terminal fibers, six short spikes, and a small base plate. The tail is enclosed in a sheath, which loosens and slides around the tail core upon contraction.
Genome
Genomes are linear, around 169kb in length. The genome codes for 300 proteins. Some species have been fully sequenced and are available from ICTV. They range between 159k and 235k nucleotides, with 242 to 292 proteins. The complete genomes are available from the National Center for Biotechnology Information, along with the complete genomes for dozens of other similar, unclassified virus strains.
Life cycle
Viral replication is cytoplasmic. The virus attaches to the host cell using its terminal fibers, and uses viral exolysin to degrade the cell wall enough to eject the viral DNA into the host cytoplasm via contraction of its tail sheath. DNA-templated transcription is the method of transcription. The virus exits the host cell by lysis, and holin/endolysin/spanin proteins. Once the viral genes have been replicated, the procapsid is assembled and packed. The tail is then assembled and the mature virions are released via lysis. Gram-negative bacteria serve as the natural host. Transmission routes are passive diffusion.
History
The ICTV's first report (1971) included the genus T-even phages, unassigned to an order, family, or subfamily. The genus was renamed in 1976 to T-even phage group, moved into the newly created family Myoviridae in 1981. In 1993, it was renamed again to T4-like phages, and was moved into the newly created order Caudovirales in 1998. The next year (1999), it was renamed to T4-like viruses. Once more, the genus was moved into the newly created subfamily Tevenvirinae in 2010-11, renamed to T4likevirus in 2012, and renamed again to T4virus in 2015. The proposals before 1993, and from 1998 are unavailable online. The other proposals are available here: 1993, 1999, 2010, 2012.
References
External links
Viralzone: T4virus
ICTV
Tevenvirinae
Virus genera
|
The Battle of Santiago (1660) was an engagement between Dominican militia and French buccaneers.
Conflict
Pirates out of Tortuga attacked the Dominican town of Santiago de los Caballeros on March 27, 1660. Some 25 or 30 Spaniards were killed outright during their initial onslaught. After ransacking the town, they departed with a number of hostages on March 29, 1660. Several hundred Dominican militia cavalrymen had in the interim managed to rally from throughout the district, and prepared an ambush ahead of the French column. The leading two buccaneers were shot dead and a two-hour firefight ensued, before the Dominicans finally broke.
See also
Battle of Sabana Real
Dominican-French War
References
History of the Colony of Santo Domingo
Santiago 1660
Santiago 1660
Santiago
|
The Duchy of Anhalt () was a historical German duchy. The duchy was located between the Harz Mountains in the west and the River Elbe and beyond to the Fläming Heath in the east. The territory was once ruled by the House of Ascania, and is now part of the federal state of Saxony-Anhalt.
History
Anhalt's origins lie in the Principality of Anhalt, a state of the Holy Roman Empire.
Dukes of Anhalt
During the 9th century, most of Anhalt was part of the Duchy of Saxony. In the 12th century, it came under the rule of Albert the Bear, margrave of Brandenburg. Albert was descended from Albert, count of Ballenstedt, whose son Esico (died 1059 or 1060) appears to have been the first to bear the title of count of Anhalt. Esico's grandson, Otto the Rich, count of Ballenstedt, was the father of Albert the Bear, who united Anhalt with the Margraviate of Brandenburg (March of Brandenburg). When Albert died in 1170, his son Bernard, who received the title of duke of Saxony in 1180, became count of Anhalt. Bernard died in 1212, and Anhalt, separated from Saxony, passed to his son Henry I, who in 1218 took the title of prince and was the real founder of the house of Anhalt.
Princes of Anhalt
Over the next six hundred years multiple divisions of the Anhalt principality took place as younger sons were granted appanages and founded lines of their own. These divisions included:
Anhalt-Bernburg 1252–1468, 1603–1863
Anhalt-Dessau 1396–1561, 1603–1863
Anhalt-Köthen 1396–1562, 1603–1853
Anhalt-Plötzkau 1544–1553, 1603–1665
Anhalt-Zerbst 1252–1396, 1544–1796
19th century duchies
In 1806, Napoleon elevated the remaining states of Anhalt-Bernburg, Anhalt-Dessau and Anhalt-Köthen to duchies (Anhalt-Plötzkau and Anhalt-Zerbst had ceased to exist in the meantime). These duchies were united in 1863 to form a united Anhalt again due to the extinction of the Köthen and Bernburg lines. The new duchy consisted of two large portions – Eastern and Western Anhalt, separated by the interposition of a part of the Prussian Province of Saxony – and of five enclaves surrounded by Prussian territory: Alsleben, Muhlingen, Dornburg, Gödnitz and Tilkerode-Abberode. The eastern and larger portion of the duchy was enclosed by the Prussian government district of Potsdam (in the Prussian Province of Brandenburg), Province of Magdeburg and Merseburg (belonging to the Prussian Province of Saxony). The western or smaller portion (the so-called Upper Duchy or Ballenstedt) was also enclosed by the two latter districts and by the Duchy of Brunswick.
The capital of Anhalt (at the times when it was a united state) was Dessau.
In 1918, Anhalt became a state within the Weimar Republic (see Free State of Anhalt). After World War II it was united with the Prussian parts of Saxony in order to form the new state of Saxony-Anhalt. Having been dissolved in 1952, the state was reestablished prior to the German reunification and is now part of the Bundesland Saxony-Anhalt in Germany.
Constitution
The duchy, by virtue of a fundamental law, proclaimed on September 17, 1859 and subsequently modified by various decrees, was a constitutional monarchy. The duke, who was addressed as "Highness," wielded the executive power while sharing the legislation with the estates. The diet (Landtag) was composed of thirty-six members, of whom two were appointed by the duke, eight were representatives of landowners paying the highest taxes, two of the highest assessed members of the commercial and manufacturing classes, fourteen of the other electors of the towns and ten of the rural districts. The representatives were chosen for six years by indirect vote and must have completed their twenty-fifth year. The duke governed through a minister of state, who was the praeses of all the departments—finance, home affairs, education, public worship and statistics.
Geography
In the west, the land is undulating and in the extreme southwest, where it forms part of the Harz range, mountainous, the Ramberg peak being the tallest at 1900 ft (579 m). From the Harz, the country gently slopes down to the Saale; between this river and the Elbe is fertile country. East of the Elbe, the land is mostly a flat sandy plain, with extensive pine forests, interspersed with bog-land and rich pastures. The Elbe is the chief river, intersecting the eastern portion of the former duchy, from east to west, and at Rosslau is met by the Mulde. The navigable Saale takes a northerly direction through the western portion of the eastern part of the territory and receives, on the right, the Fuhne and, on the left, the Wipper and the Bode.
The climate is generally mild, less so in the higher regions to the south-west. The area of the former duchy is . The population was 203,354 in 1871| and 328,007 in 1905.
The country was divided into the districts of Dessau, Köthen, Zerbst, Bernburg and Ballenstedt with Bernburg being the most, and Ballenstedt the least. populated. Four towns, namely Dessau, Bernburg, Köthen and Zerbst, had populations exceeding 20,000. The inhabitants of the former duchy, who were primarily upper Saxons, belonged, with the exception of about 12,000 Roman Catholics and 1700 Jews, to the Evangelical Church. The supreme ecclesiastical authority was the consistory in Dessau; while a synod of 39 members, elected for six years, assembled at periods to deliberate on internal matters touching the organization of Church of Anhalt. The Roman Catholics were under the Bishop of Paderborn.
Rulers of Anhalt, Middle Ages
Esico ?–1059/1060, first Count of Anhalt
Otto the Rich, Count of Ballenstedt
Albert the Bear ?–1170
Bernard ?–1212
Henry I 1212–1252
Dukes of Anhalt, 1863–1918
Leopold IV 1863–1871
Friedrich I 1871–1904
Friedrich II 1904–1918
Eduard 1918
Joachim Ernst 1918
Heads of the House of Anhalt since 1918
Joachim Ernst 1918–1947
Friedrich 1947–1963
Eduard 1963–present
See also
Former countries in Europe after 1815
Notes
References
Attribution:
External links
— Map of Saxony and Anhalt in 1789
Anhalt
States of the North German Confederation
States of the German Empire
History of Anhalt
1863 establishments in Europe
1918 disestablishments in Europe
|
```xml
/**
* @vitest-environment jsdom
*/
import { expect, it, describe } from 'vitest';
import React from 'react';
import isValidElement from '../src/is-valid-element';
describe('isValidElement', () => {
it('basic', () => {
function App() {
return (<div>
<div>isValidElement</div>
</div>);
}
expect(isValidElement(<App />)).toBe(true);
expect(isValidElement({})).toBe(false);
expect(isValidElement('')).toBe(false);
expect(isValidElement(1)).toBe(false);
expect(isValidElement(() => { })).toBe(false);
});
});
```
|
The 2002 North Dakota State Bison football team was an American football team that represented North Dakota State University during the 2002 NCAA Division II football season as a member of the North Central Conference. In their sixth year under head coach Bob Babich, the team compiled a 2–8 record.
Schedule
References
North Dakota State
North Dakota State Bison football seasons
North Dakota State Bison football
|
Viy (Spirit of Evil or Vii, ) is a 1967 Soviet horror film directed by Konstantin Yershov and Georgi Kropachyov. Based on the story of the same name by Nikolai Gogol, the film's screenplay was written by Yershov, Kropachyov and Aleksandr Ptushko. The film was distributed by Mosfilm, and was the first Soviet-era horror film to be officially released in the USSR.
Plot
As a class of seminary students are sent home for vacation, three of them get lost on the way in the middle of the night. One spots a farmhouse in the distance, and they ask the old woman at the gate to let them spend the night. She agrees, on the condition that they sleep in separate areas of the farm. As one of them, Khoma Brutus, lies down in the barn to sleep, the old woman comes to him and tries to seduce him, which he staunchly refuses. She puts him under a spell and makes him lie down so she can climb on his back. She then rides him around the countryside like a horse. Khoma suddenly finds that they are flying and realizes she is a witch. He demands that she put him back down and, as soon as they land, he grabs a stick and beats her violently. As she cries out that she's dying, he looks and sees she has turned into a beautiful young woman. Horrified, he runs back to his seminary, where he finds the Rector has sent for him. Khoma is told that a rich merchant has a daughter who is dying and needs prayers for her soul, and that she specifically asked for Khoma by name. He refuses to go, but the Rector threatens him with a public beating, so he relents and finds he is returning to the farm where he met the witch. The girl dies before he gets there, and to his horror, he realizes she is the witch, and that he is the cause of her death (but he tells no one). The girl's father promises him great reward if he will stand vigil and pray for her soul for the next three nights. If he does not, grave punishment is implied. After the funeral rites, Khoma is told of a huntsman who fell in love with the young girl, and how when she came into the stable and asked his help to get on her horse, he said he would like it more if she rode on his back, then took her on his back and ran off with her, reminding Khoma of his encounter (the men telling the tale suspect the girl was a witch). He is taken to the chapel where the girl's body lies and is locked in for the night.
As soon as Khoma walks in, several cats scurry across the floor at his feet. He lights every candle in the chapel for comfort, then begins to recite the prayers for the girl's soul. He pauses to sniff tobacco, and when he sneezes, the girl opens her eyes and climbs out of the coffin, blindly searching for him (apparently, she can hear but cannot see). He quickly draws a sacred circle of chalk around himself, and this acts as a barrier, the night passes with Khoma praying fervently and the girl trying to get to him. When the rooster crows in the morning, the girl returns to her coffin and all the candles blow out.
The men of the rich man's estate, who escort Khoma to and from the chapel, surround him and asked what happened that night, to which he replies, "Nothing much. Just some noises".
Khoma gets drunk to strengthen himself for the second night. This time, a flurry of birds fly out from the coffin, startling him into running for the door, which is shut by one of the rich man's men. Khoma returns to the prayer podium and is frightened by a bird flying out his prayer book. He draws the sacred circle again and begins the prayers. The whole covered coffin rises into the air and bangs against the protection of the sacred circle, causing a panicked Khoma to cry out to God to protect him. The cover falls off the coffin, and the girl sits up and again starts reaching blindly to him, but once more, she cannot see him or get to him. The coffin continues to fly around the room as the girl reaches blindly for Khoma and calls his name. As the rooster crows, the coffin returns to its place and the girl lies down, but her voice is heard placing a curse on Khoma, to turn his hair white and render him blind—however, his hair actually turns grey and he retains his sight. The rich man's men have to help him off the floor and out of the chapel, placing a hat on his head. When they return to the farm, Khoma demands music and begins dancing as a young boy plays on his flute. He removes his hat, and all the servants can see his hair is grey. He asks to speak to their master, saying he will explain what happened and that he doesn't want to pray in the chapel any more.
Khoma meets with the rich man, trying to explain what happened in the chapel and begging to be allowed to leave, but the sotnik threatens him with a thousand lashes if he refuse, and a thousand pieces of chervonetses if he succeeds. In spite of this, Khoma tries to escape, but makes a wrong turn and winds up in the hands of the rich man's men, and is returned to the farm.
He returns to the chapel a third time, drunk, but still remembers to draw the sacred circle before beginning the prayers. The girl sits up on the coffin and begins to curse him, causing him to have visions of walking skeletons and grasping, ghostly hands. She summons various hideous, demonic figures to torment him, but they cannot get past the sacred circle either. She finally calls on Viy, a name which causes all the demons to tremble in fear. A large monster emerges, and orders his huge eyelids to be moved from his eyes. Khoma realizes he cannot look this demon in the eye or he is lost. Viy is able to see Khoma, which allows the other demons to pounce on him and beat him, but when the rooster crows once more, the demons all flee away, leaving Khoma motionless on the floor. The girl turns back into the old woman and lies down in the coffin, which instantly falls apart. The Rector enters the chapel to this scene, and races off to tell the others.
The last scene shows Khoma's two friends from the start of the movie back at the seminary, painting some walls. One offers to drink to Khoma's memory, while the other doubts that Khoma is really dead.
The movie follows the original tale in a somewhat loose fashion, but manages to retain the majority of the images and action.
Cast
Leonid Kuravlyov as Khoma Brutus
Natalya Varley as Pannochka (voiced by Klara Rumyanova)
Alexei Glazyrin as sotnik
Vadim Zakharchenko as Khalyava
Nikolai Kutuzov as witch
Pyotr Vesklyarov as Dorosh
Dmitri Kapka as Overko
Stepan Shkurat as Yavtukh
Georgy Sochevko as Stepan
Nikolai Yakovchenko as Spirid
Nikolai Panasyev as comforter
Boryslav Brondukov as bursak
Production
Some of the "witch" scenes and the ending where Viy appears were toned down due to technological limitations as well as then current restrictions on Soviet film production. The directors were able to avoid the previous restrictions by using what was considered a "folk tale".
Reception
Richard Gilliam of AllMovie gave the film four out of five stars, commending production design, pacing, and Kuravlyov's performance. In his book 1001 Movies You Must See Before You Die, Steven Jay Schneider refers to the film as "a colorful, entertaining, and genuinely frightening film of demons and witchcraft that boasts some remarkable special-effects work by Russia's master of cinematic fantasy, Aleksandr Ptushko." Anne Billson wrote in Sight & Sound declared that "Thanks to effects that transcend the limitations of their time, the uncanny occurrences of 'Viy' can still generate a frisson" and that "this exquisite presentation is a must-see for every aficionado of folk-horror and dark fairytales." Martin Unsworth of Starburst gave the film a five star rating, declaring that what "makes Viy so special isn’t so much the direction of Konstantin Ershov and Georgiy Kropachyov but the effects created by Aleksandr Ptushko alongside the cinematography of Viktor Pishchalnikov and Fyodor Provorov. There are terrifying moments early on that stand out, especially the transgressive scene involving the old witch (played by male actor Nikolai Kutuzov), which is the stuff of nightmares alone. The film gains its classic status, however, thanks to a bombardment of in-camera effects, jaunty camera angles, and a building sense of dread that explodes with an assault of strange, nightmarish characters."
Home media
The film was released on DVD on 21 August 2001 by Image Entertainment. It was re-released on DVD by Hanzibar Films on 28 March 2005. Severin Films released the film on Blu-ray in 2019.
Remake
A modern version starring Jason Flemyng was in production for several years and went through several different deadlines, but was released in 2014. The 1990 Serbian version of the film, called A Holy Place, ran on the Fantasia Festival 2010.
References
Sources
External links
1967 films
Soviet horror films
Russian fantasy films
1960s Russian-language films
1967 horror films
Mosfilm films
Russian supernatural horror films
Films based on Viy (story)
Films set in Ukraine
Films shot in Ukraine
Russian horror films
Folk horror films
Films based on Russian folklore
Films based on Slavic mythology
Films about witchcraft
Gothic horror films
Russian dark fantasy films
|
```javascript
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var Subject_1 = require("../Subject");
var async_1 = require("../scheduler/async");
var Subscriber_1 = require("../Subscriber");
var isNumeric_1 = require("../util/isNumeric");
var isScheduler_1 = require("../util/isScheduler");
function windowTime(windowTimeSpan) {
var scheduler = async_1.async;
var windowCreationInterval = null;
var maxWindowSize = Number.POSITIVE_INFINITY;
if (isScheduler_1.isScheduler(arguments[3])) {
scheduler = arguments[3];
}
if (isScheduler_1.isScheduler(arguments[2])) {
scheduler = arguments[2];
}
else if (isNumeric_1.isNumeric(arguments[2])) {
maxWindowSize = arguments[2];
}
if (isScheduler_1.isScheduler(arguments[1])) {
scheduler = arguments[1];
}
else if (isNumeric_1.isNumeric(arguments[1])) {
windowCreationInterval = arguments[1];
}
return function windowTimeOperatorFunction(source) {
return source.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler));
};
}
exports.windowTime = windowTime;
var WindowTimeOperator = (function () {
function WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {
this.windowTimeSpan = windowTimeSpan;
this.windowCreationInterval = windowCreationInterval;
this.maxWindowSize = maxWindowSize;
this.scheduler = scheduler;
}
WindowTimeOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.maxWindowSize, this.scheduler));
};
return WindowTimeOperator;
}());
var CountedSubject = (function (_super) {
__extends(CountedSubject, _super);
function CountedSubject() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._numberOfNextedValues = 0;
return _this;
}
CountedSubject.prototype.next = function (value) {
this._numberOfNextedValues++;
_super.prototype.next.call(this, value);
};
Object.defineProperty(CountedSubject.prototype, "numberOfNextedValues", {
get: function () {
return this._numberOfNextedValues;
},
enumerable: true,
configurable: true
});
return CountedSubject;
}(Subject_1.Subject));
var WindowTimeSubscriber = (function (_super) {
__extends(WindowTimeSubscriber, _super);
function WindowTimeSubscriber(destination, windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {
var _this = _super.call(this, destination) || this;
_this.destination = destination;
_this.windowTimeSpan = windowTimeSpan;
_this.windowCreationInterval = windowCreationInterval;
_this.maxWindowSize = maxWindowSize;
_this.scheduler = scheduler;
_this.windows = [];
var window = _this.openWindow();
if (windowCreationInterval !== null && windowCreationInterval >= 0) {
var closeState = { subscriber: _this, window: window, context: null };
var creationState = { windowTimeSpan: windowTimeSpan, windowCreationInterval: windowCreationInterval, subscriber: _this, scheduler: scheduler };
_this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState));
_this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState));
}
else {
var timeSpanOnlyState = { subscriber: _this, window: window, windowTimeSpan: windowTimeSpan };
_this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState));
}
return _this;
}
WindowTimeSubscriber.prototype._next = function (value) {
var windows = this.windows;
var len = windows.length;
for (var i = 0; i < len; i++) {
var window_1 = windows[i];
if (!window_1.closed) {
window_1.next(value);
if (window_1.numberOfNextedValues >= this.maxWindowSize) {
this.closeWindow(window_1);
}
}
}
};
WindowTimeSubscriber.prototype._error = function (err) {
var windows = this.windows;
while (windows.length > 0) {
windows.shift().error(err);
}
this.destination.error(err);
};
WindowTimeSubscriber.prototype._complete = function () {
var windows = this.windows;
while (windows.length > 0) {
var window_2 = windows.shift();
if (!window_2.closed) {
window_2.complete();
}
}
this.destination.complete();
};
WindowTimeSubscriber.prototype.openWindow = function () {
var window = new CountedSubject();
this.windows.push(window);
var destination = this.destination;
destination.next(window);
return window;
};
WindowTimeSubscriber.prototype.closeWindow = function (window) {
window.complete();
var windows = this.windows;
windows.splice(windows.indexOf(window), 1);
};
return WindowTimeSubscriber;
}(Subscriber_1.Subscriber));
function dispatchWindowTimeSpanOnly(state) {
var subscriber = state.subscriber, windowTimeSpan = state.windowTimeSpan, window = state.window;
if (window) {
subscriber.closeWindow(window);
}
state.window = subscriber.openWindow();
this.schedule(state, windowTimeSpan);
}
function dispatchWindowCreation(state) {
var windowTimeSpan = state.windowTimeSpan, subscriber = state.subscriber, scheduler = state.scheduler, windowCreationInterval = state.windowCreationInterval;
var window = subscriber.openWindow();
var action = this;
var context = { action: action, subscription: null };
var timeSpanState = { subscriber: subscriber, window: window, context: context };
context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState);
action.add(context.subscription);
action.schedule(state, windowCreationInterval);
}
function dispatchWindowClose(state) {
var subscriber = state.subscriber, window = state.window, context = state.context;
if (context && context.action && context.subscription) {
context.action.remove(context.subscription);
}
subscriber.closeWindow(window);
}
//# sourceMappingURL=windowTime.js.map
```
|
```html
<html lang="en">
<head>
<title>Server Prefix - GDB's Obsolete Annotations</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GDB's Obsolete Annotations">
<meta name="generator" content="makeinfo 4.11">
<link title="Top" rel="start" href="index.html#Top">
<link rel="prev" href="Migrating-to-GDB_002fMI.html#Migrating-to-GDB_002fMI" title="Migrating to GDB/MI">
<link rel="next" href="Value-Annotations.html#Value-Annotations" title="Value Annotations">
<link href="path_to_url" rel="generator-home" title="Texinfo Homepage">
<!--
Permission is granted to copy, distribute and/or modify this document
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the section entitled ``GNU
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<p>
<a name="Server-Prefix"></a>
Next: <a rel="next" accesskey="n" href="Value-Annotations.html#Value-Annotations">Value Annotations</a>,
Previous: <a rel="previous" accesskey="p" href="Migrating-to-GDB_002fMI.html#Migrating-to-GDB_002fMI">Migrating to GDB/MI</a>,
Up: <a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr>
</div>
<h2 class="chapter">4 The Server Prefix</h2>
<p><a name="index-server-prefix-for-annotations-2"></a>
To issue a command to <span class="sc">gdb</span> without affecting certain aspects of
the state which is seen by users, prefix it with ‘<samp><span class="samp">server </span></samp>’. This
means that this command will not affect the command history, nor will it
affect <span class="sc">gdb</span>'s notion of which command to repeat if <RET> is
pressed on a line by itself.
<p>The server prefix does not affect the recording of values into the value
history; to print a value without recording it into the value history,
use the <code>output</code> command instead of the <code>print</code> command.
</body></html>
```
|
```go
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
/*
Package mux implements a request router and dispatcher.
The name mux stands for "HTTP request multiplexer". Like the standard
http.ServeMux, mux.Router matches incoming requests against a list of
registered routes and calls a handler for the route that matches the URL
or other conditions. The main features are:
* Requests can be matched based on URL host, path, path prefix, schemes,
header and query values, HTTP methods or using custom matchers.
* URL hosts and paths can have variables with an optional regular
expression.
* Registered URLs can be built, or "reversed", which helps maintaining
references to resources.
* Routes can be used as subrouters: nested routes are only tested if the
parent route matches. This is useful to define groups of routes that
share common conditions like a host, a path prefix or other repeated
attributes. As a bonus, this optimizes request matching.
* It implements the http.Handler interface so it is compatible with the
standard http.ServeMux.
Let's start registering a couple of URL paths and handlers:
func main() {
r := mux.NewRouter()
r.HandleFunc("/", HomeHandler)
r.HandleFunc("/products", ProductsHandler)
r.HandleFunc("/articles", ArticlesHandler)
http.Handle("/", r)
}
Here we register three routes mapping URL paths to handlers. This is
equivalent to how http.HandleFunc() works: if an incoming request URL matches
one of the paths, the corresponding handler is called passing
(http.ResponseWriter, *http.Request) as parameters.
Paths can have variables. They are defined using the format {name} or
{name:pattern}. If a regular expression pattern is not defined, the matched
variable will be anything until the next slash. For example:
r := mux.NewRouter()
r.HandleFunc("/products/{key}", ProductHandler)
r.HandleFunc("/articles/{category}/", ArticlesCategoryHandler)
r.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler)
Groups can be used inside patterns, as long as they are non-capturing (?:re). For example:
r.HandleFunc("/articles/{category}/{sort:(?:asc|desc|new)}", ArticlesCategoryHandler)
The names are used to create a map of route variables which can be retrieved
calling mux.Vars():
vars := mux.Vars(request)
category := vars["category"]
And this is all you need to know about the basic usage. More advanced options
are explained below.
Routes can also be restricted to a domain or subdomain. Just define a host
pattern to be matched. They can also have variables:
r := mux.NewRouter()
// Only matches if domain is "www.example.com".
r.Host("www.example.com")
// Matches a dynamic subdomain.
r.Host("{subdomain:[a-z]+}.domain.com")
There are several other matchers that can be added. To match path prefixes:
r.PathPrefix("/products/")
...or HTTP methods:
r.Methods("GET", "POST")
...or URL schemes:
r.Schemes("https")
...or header values:
r.Headers("X-Requested-With", "XMLHttpRequest")
...or query values:
r.Queries("key", "value")
...or to use a custom matcher function:
r.MatcherFunc(func(r *http.Request, rm *RouteMatch) bool {
return r.ProtoMajor == 0
})
...and finally, it is possible to combine several matchers in a single route:
r.HandleFunc("/products", ProductsHandler).
Host("www.example.com").
Methods("GET").
Schemes("http")
Setting the same matching conditions again and again can be boring, so we have
a way to group several routes that share the same requirements.
We call it "subrouting".
For example, let's say we have several URLs that should only match when the
host is "www.example.com". Create a route for that host and get a "subrouter"
from it:
r := mux.NewRouter()
s := r.Host("www.example.com").Subrouter()
Then register routes in the subrouter:
s.HandleFunc("/products/", ProductsHandler)
s.HandleFunc("/products/{key}", ProductHandler)
s.HandleFunc("/articles/{category}/{id:[0-9]+}"), ArticleHandler)
The three URL paths we registered above will only be tested if the domain is
"www.example.com", because the subrouter is tested first. This is not
only convenient, but also optimizes request matching. You can create
subrouters combining any attribute matchers accepted by a route.
Subrouters can be used to create domain or path "namespaces": you define
subrouters in a central place and then parts of the app can register its
paths relatively to a given subrouter.
There's one more thing about subroutes. When a subrouter has a path prefix,
the inner routes use it as base for their paths:
r := mux.NewRouter()
s := r.PathPrefix("/products").Subrouter()
// "/products/"
s.HandleFunc("/", ProductsHandler)
// "/products/{key}/"
s.HandleFunc("/{key}/", ProductHandler)
// "/products/{key}/details"
s.HandleFunc("/{key}/details", ProductDetailsHandler)
Note that the path provided to PathPrefix() represents a "wildcard": calling
PathPrefix("/static/").Handler(...) means that the handler will be passed any
request that matches "/static/*". This makes it easy to serve static files with mux:
func main() {
var dir string
flag.StringVar(&dir, "dir", ".", "the directory to serve files from. Defaults to the current dir")
flag.Parse()
r := mux.NewRouter()
// This will serve files under path_to_url
r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir(dir))))
srv := &http.Server{
Handler: r,
Addr: "127.0.0.1:8000",
// Good practice: enforce timeouts for servers you create!
WriteTimeout: 15 * time.Second,
ReadTimeout: 15 * time.Second,
}
log.Fatal(srv.ListenAndServe())
}
Now let's see how to build registered URLs.
Routes can be named. All routes that define a name can have their URLs built,
or "reversed". We define a name calling Name() on a route. For example:
r := mux.NewRouter()
r.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler).
Name("article")
To build a URL, get the route and call the URL() method, passing a sequence of
key/value pairs for the route variables. For the previous route, we would do:
url, err := r.Get("article").URL("category", "technology", "id", "42")
...and the result will be a url.URL with the following path:
"/articles/technology/42"
This also works for host variables:
r := mux.NewRouter()
r.Host("{subdomain}.domain.com").
Path("/articles/{category}/{id:[0-9]+}").
HandlerFunc(ArticleHandler).
Name("article")
// url.String() will be "path_to_url"
url, err := r.Get("article").URL("subdomain", "news",
"category", "technology",
"id", "42")
All variables defined in the route are required, and their values must
conform to the corresponding patterns. These requirements guarantee that a
generated URL will always match a registered route -- the only exception is
for explicitly defined "build-only" routes which never match.
Regex support also exists for matching Headers within a route. For example, we could do:
r.HeadersRegexp("Content-Type", "application/(text|json)")
...and the route will match both requests with a Content-Type of `application/json` as well as
`application/text`
There's also a way to build only the URL host or path for a route:
use the methods URLHost() or URLPath() instead. For the previous route,
we would do:
// "path_to_url"
host, err := r.Get("article").URLHost("subdomain", "news")
// "/articles/technology/42"
path, err := r.Get("article").URLPath("category", "technology", "id", "42")
And if you use subrouters, host and path defined separately can be built
as well:
r := mux.NewRouter()
s := r.Host("{subdomain}.domain.com").Subrouter()
s.Path("/articles/{category}/{id:[0-9]+}").
HandlerFunc(ArticleHandler).
Name("article")
// "path_to_url"
url, err := r.Get("article").URL("subdomain", "news",
"category", "technology",
"id", "42")
*/
package mux
```
|
A History of the World in the 20th Century is a history textbook by J. A. S. Grenville, first published in 1994.
It is followed by A History of the World from the 20th to the 21st Century, which has reached its 5th edition, and is commonly used in International Baccalaureate 20th Century World History classes.
Table of contents
Social change and national rivalry in the West, 1900–1914
The response of China and Japan to western dominance
The Great War, revolution and the search for stability
The continuing world crisis, 1929–1939
The Second World War
Post-war Europe, 1945–1947
The United States and the beginning of the Cold War, 1945–1948
The transformation of Asia, 1945–1955
The ending of European dominance in the Middle East, 1919–1980
The Cold War : superpower confrontation, 1948–1964
The recovery of Western Europe in the 1950s and 1960s
Who will liberate the Third World? : 1954-1968
Two faces of Asia : after 1949
Latin America after 1945 : problems unresolved
Africa after 1945 : conflict and the threat of famine
The United States and the Soviet bloc after 1963 : the great transformation
Western Europe gathers strength : after 1968
The Cold War and after
References
Publication data
A History of the World in the Twentieth Century, Belknap Press of Harvard University Press (2000), 1002 p.,
A History of the World From the Twentieth to the Twenty-first Century, Routledge (2005), 995 p.,
History textbooks
1994 non-fiction books
|
```yaml
---
parsed_sample:
- inbound_acl: ""
interface: "Tunnel500"
ip_address: []
ip_helper: []
link_status: "up"
mtu: "1456"
outgoing_acl: ""
prefix_length: []
protocol_status: "down"
vrf: ""
```
|
```c++
//your_sha256_hash-----------//
//
// See accompanying file LICENSE_1_0.txt or copy at
// path_to_url
//
// See path_to_url for more information.
//your_sha256_hash-----------//
#ifndef BOOST_COMPUTE_ALGORITHM_DETAIL_COPY_TO_HOST_HPP
#define BOOST_COMPUTE_ALGORITHM_DETAIL_COPY_TO_HOST_HPP
#include <iterator>
#include <boost/utility/addressof.hpp>
#include <boost/compute/command_queue.hpp>
#include <boost/compute/async/future.hpp>
#include <boost/compute/iterator/buffer_iterator.hpp>
#include <boost/compute/memory/svm_ptr.hpp>
#include <boost/compute/detail/iterator_plus_distance.hpp>
namespace boost {
namespace compute {
namespace detail {
template<class DeviceIterator, class HostIterator>
inline HostIterator copy_to_host(DeviceIterator first,
DeviceIterator last,
HostIterator result,
command_queue &queue)
{
typedef typename
std::iterator_traits<DeviceIterator>::value_type
value_type;
size_t count = iterator_range_size(first, last);
if(count == 0){
return result;
}
const buffer &buffer = first.get_buffer();
size_t offset = first.get_index();
queue.enqueue_read_buffer(buffer,
offset * sizeof(value_type),
count * sizeof(value_type),
::boost::addressof(*result));
return iterator_plus_distance(result, count);
}
template<class DeviceIterator, class HostIterator>
inline HostIterator copy_to_host_map(DeviceIterator first,
DeviceIterator last,
HostIterator result,
command_queue &queue)
{
typedef typename
std::iterator_traits<DeviceIterator>::value_type
value_type;
typedef typename
std::iterator_traits<DeviceIterator>::difference_type
difference_type;
size_t count = iterator_range_size(first, last);
if(count == 0){
return result;
}
size_t offset = first.get_index();
// map [first; last) buffer to host
value_type *pointer = static_cast<value_type*>(
queue.enqueue_map_buffer(
first.get_buffer(),
CL_MAP_READ,
offset * sizeof(value_type),
count * sizeof(value_type)
)
);
// copy [first; last) to result buffer
std::copy(
pointer,
pointer + static_cast<difference_type>(count),
result
);
// unmap [first; last)
boost::compute::event unmap_event = queue.enqueue_unmap_buffer(
first.get_buffer(),
static_cast<void*>(pointer)
);
unmap_event.wait();
return iterator_plus_distance(result, count);
}
template<class DeviceIterator, class HostIterator>
inline future<HostIterator> copy_to_host_async(DeviceIterator first,
DeviceIterator last,
HostIterator result,
command_queue &queue)
{
typedef typename
std::iterator_traits<DeviceIterator>::value_type
value_type;
size_t count = iterator_range_size(first, last);
if(count == 0){
return future<HostIterator>();
}
const buffer &buffer = first.get_buffer();
size_t offset = first.get_index();
event event_ =
queue.enqueue_read_buffer_async(buffer,
offset * sizeof(value_type),
count * sizeof(value_type),
::boost::addressof(*result));
return make_future(iterator_plus_distance(result, count), event_);
}
#ifdef BOOST_COMPUTE_CL_VERSION_2_0
// copy_to_host() specialization for svm_ptr
template<class T, class HostIterator>
inline HostIterator copy_to_host(svm_ptr<T> first,
svm_ptr<T> last,
HostIterator result,
command_queue &queue)
{
size_t count = iterator_range_size(first, last);
if(count == 0){
return result;
}
queue.enqueue_svm_memcpy(
::boost::addressof(*result), first.get(), count * sizeof(T)
);
return result + count;
}
template<class T, class HostIterator>
inline future<HostIterator> copy_to_host_async(svm_ptr<T> first,
svm_ptr<T> last,
HostIterator result,
command_queue &queue)
{
size_t count = iterator_range_size(first, last);
if(count == 0){
return future<HostIterator>();
}
event event_ = queue.enqueue_svm_memcpy_async(
::boost::addressof(*result), first.get(), count * sizeof(T)
);
return make_future(iterator_plus_distance(result, count), event_);
}
template<class T, class HostIterator>
inline HostIterator copy_to_host_map(svm_ptr<T> first,
svm_ptr<T> last,
HostIterator result,
command_queue &queue)
{
size_t count = iterator_range_size(first, last);
if(count == 0){
return result;
}
// map
queue.enqueue_svm_map(first.get(), count * sizeof(T), CL_MAP_READ);
// copy [first; last) to result
std::copy(
static_cast<T*>(first.get()),
static_cast<T*>(last.get()),
result
);
// unmap [first; last)
queue.enqueue_svm_unmap(first.get()).wait();
return iterator_plus_distance(result, count);
}
#endif // BOOST_COMPUTE_CL_VERSION_2_0
} // end detail namespace
} // end compute namespace
} // end boost namespace
#endif // BOOST_COMPUTE_ALGORITHM_DETAIL_COPY_TO_HOST_HPP
```
|
```shell
#!/usr/bin/env bash
# vim:ts=4:sts=4:sw=4:et
#
# Author: Hari Sekhon
# Date: 2024-08-02 10:14:03 +0300 (Fri, 02 Aug 2024)
#
# https///github.com/HariSekhon/DevOps-Bash-tools
#
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
#
# path_to_url
#
set -euo pipefail
[ -n "${DEBUG:-}" ] && set -x
srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck disable=SC1090,SC1091
. "$srcdir/lib/aws.sh"
# shellcheck disable=SC2034,SC2154
usage_description="
Creates a snapshot of a given EBS volume ID and waits for it to complete with exponential backoff
Useful to take before enlarging EBS volumes as a backup in case anything goes wrong
Automatically determines the EC2 instance name and prefixes it to the snapshot description
Use the adjacent script aws_ec2_ebs_volumes.sh to easily get the volume ID
$usage_aws_cli_required
"
# used by usage() in lib/utils.sh
# shellcheck disable=SC2034
usage_args="<ebs_volume_id> <description>"
help_usage "$@"
# enforce giving a 2nd arg for description
num_args 2 "$@"
volume_id="$1"
description="$2"
aws_validate_volume_id "$volume_id"
export MAX_WATCH_SLEEP_SECS=300
export AWS_DEFAULT_OUTPUT=json
timestamp "Finding EC2 instance ID for volume ID '$volume_id'"
instance_id="$(aws ec2 describe-volumes --volume-ids "$volume_id" --query 'Volumes[*].Attachments[*].InstanceId' --output text)"
timestamp "Finding EC2 instance name for instance ID '$instance_id'"
# false positive
# shellcheck disable=SC2016
instance_name="$(aws ec2 describe-instances --instance-ids "$instance_id" --query 'Reservations[*].Instances[*].{InstanceID:InstanceId,Name:Tags[?Key==`Name`].Value|[0]}' --output json | jq -r '.[].[].Name' | head -n 1)"
# automatically prefix the description with the instance name
description="$instance_name: $description"
timestamp "Taking snapshot of volume '$volume_id' on EC2 instance '$instance_name' with description '$description'"
snapshot="$(aws ec2 create-snapshot --volume-id "$volume_id" --description "$description" --output json)"
snapshot_id="$(jq -r '.SnapshotId' <<< "$snapshot")"
echo
get_aws_pending_snapshots(){
# false positive
# shellcheck disable=SC2016
aws ec2 describe-snapshots --snapshot-id "$snapshot_id" --query 'Snapshots[?State==`pending`].[VolumeId,SnapshotId,Description,State,Progress]' --output table
}
# will double this for exponential backoff up to MAX_WATCH_SLEEP_SECS interval
sleep_secs=5
# loop indefinitely until we explicitly break using time check
while : ; do
if [ "$SECONDS" -gt 7200 ]; then
die "Timed out waiting 2 hours for EBS snapshot to complete!"
fi
if get_aws_pending_snapshots | tee /dev/stderr | grep -Fq "$description"; then
echo
timestamp "Snapshot still in pending state, waiting $sleep_secs secs before checking again"
sleep "$sleep_secs"
# exponential backoff
sleep_secs="$(exponential "$sleep_secs" "$MAX_WATCH_SLEEP_SECS")"
continue
fi
break
done
echo
timestamp "Snapshot completed"
```
|
```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 plugin
import (
"fmt"
"net/http"
"net/http/httptest"
"reflect"
"testing"
"github.com/containernetworking/cni/pkg/skel"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"istio.io/api/annotation"
"istio.io/api/label"
"istio.io/istio/pkg/config/constants"
"istio.io/istio/pkg/kube"
"istio.io/istio/pkg/test/util/assert"
)
const (
testPodName = "testPod"
testNSName = "testNS"
testSandboxDirectory = "/tmp"
invalidVersion = "0.1.0"
preVersion = "0.2.0"
)
var mockConfTmpl = `{
"cniVersion": "%s",
"name": "istio-plugin-sample-test",
"type": "sample",
"capabilities": {
"testCapability": false
},
"ipam": {
"type": "testIPAM"
},
"dns": {
"nameservers": ["testNameServer"],
"domain": "testDomain",
"search": ["testSearch"],
"options": ["testOption"]
},
"prevResult": {
"cniversion": "%s",
"interfaces": [
{
"name": "%s",
"sandbox": "%s"
}
],
"ips": [
{
"version": "4",
"address": "10.0.0.2/24",
"gateway": "10.0.0.1",
"interface": 0
}
],
"routes": []
},
"plugin_log_level": "debug",
"cni_agent_run_dir": "%s",
"ambient_enabled": %t,
"exclude_namespaces": ["testExcludeNS"],
"kubernetes": {
"k8s_api_root": "APIRoot",
"kubeconfig": "testK8sConfig",
"intercept_type": "%s"
}
}`
type mockInterceptRuleMgr struct {
lastRedirect []*Redirect
}
func buildMockConf(ambientEnabled bool) string {
return fmt.Sprintf(
mockConfTmpl,
"1.0.0",
"1.0.0",
"eth0",
testSandboxDirectory,
"", // unused here
ambientEnabled,
"mock",
)
}
func buildFakePodAndNSForClient() (*corev1.Pod, *corev1.Namespace) {
proxy := corev1.Container{Name: "mockContainer"}
app := corev1.Container{Name: "foo-init"}
fakePod := &corev1.Pod{
TypeMeta: metav1.TypeMeta{
APIVersion: "core/v1",
Kind: "Pod",
},
ObjectMeta: metav1.ObjectMeta{
Name: testPodName,
Namespace: testNSName,
Annotations: map[string]string{},
},
Spec: corev1.PodSpec{
Containers: []corev1.Container{app, proxy},
},
}
fakeNS := &corev1.Namespace{
TypeMeta: metav1.TypeMeta{
APIVersion: "core/v1",
Kind: "Namespace",
},
ObjectMeta: metav1.ObjectMeta{
Name: testNSName,
Namespace: "",
Labels: map[string]string{},
},
}
return fakePod, fakeNS
}
func (mrdir *mockInterceptRuleMgr) Program(podName, netns string, redirect *Redirect) error {
mrdir.lastRedirect = append(mrdir.lastRedirect, redirect)
return nil
}
// returns the test server URL and a dispose func for the test server
func setupCNIEventClientWithMockServer(serverErr bool) func() bool {
cniAddServerCalled := false
testServer := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
cniAddServerCalled = true
if serverErr {
res.WriteHeader(http.StatusInternalServerError)
res.Write([]byte("server not happy"))
return
}
res.WriteHeader(http.StatusOK)
res.Write([]byte("server happy"))
}))
// replace the global CNI client with mock
newCNIClient = func(address, path string) CNIEventClient {
c := http.DefaultClient
eventC := CNIEventClient{
client: c,
url: testServer.URL + path,
}
return eventC
}
return func() bool {
testServer.Close()
return cniAddServerCalled
}
}
func buildCmdArgs(stdinData, podName, podNamespace string) *skel.CmdArgs {
return &skel.CmdArgs{
ContainerID: "testContainerID",
Netns: testSandboxDirectory,
IfName: "eth0",
Args: fmt.Sprintf("K8S_POD_NAMESPACE=%s;K8S_POD_NAME=%s", podNamespace, podName),
Path: "/tmp",
StdinData: []byte(stdinData),
}
}
func testCmdAddExpectFail(t *testing.T, stdinData string, objects ...runtime.Object) *mockInterceptRuleMgr {
args := buildCmdArgs(stdinData, testPodName, testNSName)
conf, err := parseConfig(args.StdinData)
if err != nil {
t.Fatalf("config parse failed with error: %v", err)
}
// Create a kube client
client := kube.NewFakeClient(objects...)
mockRedir := &mockInterceptRuleMgr{}
err = doAddRun(args, conf, client.Kube(), mockRedir)
if err == nil {
t.Fatal("expected to fail, but did not!")
}
return mockRedir
}
func testDoAddRun(t *testing.T, stdinData, nsName string, objects ...runtime.Object) *mockInterceptRuleMgr {
args := buildCmdArgs(stdinData, testPodName, nsName)
conf, err := parseConfig(args.StdinData)
if err != nil {
t.Fatalf("config parse failed with error: %v", err)
}
// Create a kube client
client := kube.NewFakeClient(objects...)
mockRedir := &mockInterceptRuleMgr{}
err = doAddRun(args, conf, client.Kube(), mockRedir)
if err != nil {
t.Fatalf("failed with error: %v", err)
}
return mockRedir
}
func TestCmdAddAmbientEnabledOnNS(t *testing.T) {
serverClose := setupCNIEventClientWithMockServer(false)
cniConf := buildMockConf(true)
pod, ns := buildFakePodAndNSForClient()
ns.ObjectMeta.Labels = map[string]string{constants.DataplaneModeLabel: constants.DataplaneModeAmbient}
testDoAddRun(t, cniConf, testNSName, pod, ns)
wasCalled := serverClose()
// Pod in namespace with enabled ambient label, should be added to mesh
assert.Equal(t, wasCalled, true)
}
func TestCmdAddAmbientEnabledOnNSServerFails(t *testing.T) {
serverClose := setupCNIEventClientWithMockServer(true)
cniConf := buildMockConf(true)
pod, ns := buildFakePodAndNSForClient()
ns.ObjectMeta.Labels = map[string]string{constants.DataplaneModeLabel: constants.DataplaneModeAmbient}
testCmdAddExpectFail(t, cniConf, pod, ns)
wasCalled := serverClose()
// server called, but errored
assert.Equal(t, wasCalled, true)
}
func TestCmdAddPodWithProxySidecarAmbientEnabledNS(t *testing.T) {
serverClose := setupCNIEventClientWithMockServer(false)
cniConf := buildMockConf(true)
pod, ns := buildFakePodAndNSForClient()
proxy := corev1.Container{Name: "istio-proxy"}
app := corev1.Container{Name: "app"}
pod.Spec.Containers = []corev1.Container{app, proxy}
pod.ObjectMeta.Annotations = map[string]string{annotation.SidecarStatus.Name: "true"}
ns.ObjectMeta.Labels = map[string]string{constants.DataplaneModeLabel: constants.DataplaneModeAmbient}
testDoAddRun(t, cniConf, testNSName, pod, ns)
wasCalled := serverClose()
// Pod has sidecar annotation from injector, should not be added to mesh
assert.Equal(t, wasCalled, false)
}
func TestCmdAddPodWithGenericSidecar(t *testing.T) {
serverClose := setupCNIEventClientWithMockServer(false)
cniConf := buildMockConf(true)
pod, ns := buildFakePodAndNSForClient()
proxy := corev1.Container{Name: "istio-proxy"}
app := corev1.Container{Name: "app"}
pod.Spec.Containers = []corev1.Container{app, proxy}
ns.ObjectMeta.Labels = map[string]string{constants.DataplaneModeLabel: constants.DataplaneModeAmbient}
testDoAddRun(t, cniConf, testNSName, pod, ns)
wasCalled := serverClose()
// Pod should be added to ambient mesh
assert.Equal(t, wasCalled, true)
}
func TestCmdAddPodDisabledLabel(t *testing.T) {
serverClose := setupCNIEventClientWithMockServer(false)
cniConf := buildMockConf(true)
pod, ns := buildFakePodAndNSForClient()
app := corev1.Container{Name: "app"}
ns.ObjectMeta.Labels = map[string]string{constants.DataplaneModeLabel: constants.DataplaneModeAmbient}
pod.ObjectMeta.Labels = map[string]string{constants.DataplaneModeLabel: constants.DataplaneModeNone}
pod.Spec.Containers = []corev1.Container{app}
testDoAddRun(t, cniConf, testNSName, pod, ns)
wasCalled := serverClose()
// Pod has an explicit opt-out label, should not be added to ambient mesh
assert.Equal(t, wasCalled, false)
}
func TestCmdAddPodEnabledNamespaceDisabled(t *testing.T) {
serverClose := setupCNIEventClientWithMockServer(false)
cniConf := buildMockConf(true)
pod, ns := buildFakePodAndNSForClient()
app := corev1.Container{Name: "app"}
pod.ObjectMeta.Labels = map[string]string{constants.DataplaneModeLabel: constants.DataplaneModeAmbient}
pod.Spec.Containers = []corev1.Container{app}
testDoAddRun(t, cniConf, testNSName, pod, ns)
wasCalled := serverClose()
assert.Equal(t, wasCalled, true)
}
func TestCmdAddPodInExcludedNamespace(t *testing.T) {
serverClose := setupCNIEventClientWithMockServer(false)
cniConf := buildMockConf(true)
excludedNS := "testExcludeNS"
pod, ns := buildFakePodAndNSForClient()
app := corev1.Container{Name: "app"}
ns.ObjectMeta.Name = excludedNS
ns.ObjectMeta.Labels = map[string]string{constants.DataplaneModeLabel: constants.AmbientRedirectionEnabled}
pod.ObjectMeta.Namespace = excludedNS
pod.Spec.Containers = []corev1.Container{app}
testDoAddRun(t, cniConf, excludedNS, pod, ns)
wasCalled := serverClose()
// If the pod is being added to a namespace that is explicitly excluded by plugin config denylist
// it should never be added, even if the namespace has the annotation
assert.Equal(t, wasCalled, false)
}
func TestCmdAdd(t *testing.T) {
pod, ns := buildFakePodAndNSForClient()
testDoAddRun(t, buildMockConf(true), testNSName, pod, ns)
}
func TestCmdAddTwoContainersWithAnnotation(t *testing.T) {
pod, ns := buildFakePodAndNSForClient()
pod.Spec.Containers[0].Name = "mockContainer"
pod.Spec.Containers[1].Name = "istio-proxy"
pod.ObjectMeta.Annotations[injectAnnotationKey] = "false"
testDoAddRun(t, buildMockConf(true), testNSName, pod, ns)
}
func TestCmdAddTwoContainersWithLabel(t *testing.T) {
pod, ns := buildFakePodAndNSForClient()
pod.Spec.Containers[0].Name = "mockContainer"
pod.Spec.Containers[1].Name = "istio-proxy"
pod.ObjectMeta.Annotations[label.SidecarInject.Name] = "false"
testDoAddRun(t, buildMockConf(true), testNSName, pod, ns)
}
func TestCmdAddTwoContainers(t *testing.T) {
pod, ns := buildFakePodAndNSForClient()
pod.Spec.Containers[0].Name = "mockContainer"
pod.Spec.Containers[1].Name = "istio-proxy"
pod.ObjectMeta.Annotations[sidecarStatusKey] = "true"
mockIntercept := testDoAddRun(t, buildMockConf(false), testNSName, pod, ns)
if len(mockIntercept.lastRedirect) == 0 {
t.Fatal("expected nsenterFunc to be called")
}
r := mockIntercept.lastRedirect[len(mockIntercept.lastRedirect)-1]
if r.includeInboundPorts != "*" {
t.Fatalf("expect includeInboundPorts has value '*' set by istio, actual %v", r.includeInboundPorts)
}
}
func TestCmdAddTwoContainersWithStarInboundPort(t *testing.T) {
pod, ns := buildFakePodAndNSForClient()
pod.Spec.Containers[0].Name = "mockContainer"
pod.Spec.Containers[1].Name = "istio-proxy"
pod.ObjectMeta.Annotations[sidecarStatusKey] = "true"
pod.ObjectMeta.Annotations[includeInboundPortsKey] = "*"
mockIntercept := testDoAddRun(t, buildMockConf(true), testNSName, pod, ns)
if len(mockIntercept.lastRedirect) != 1 {
t.Fatal("expected nsenterFunc to be called")
}
r := mockIntercept.lastRedirect[len(mockIntercept.lastRedirect)-1]
if r.includeInboundPorts != "*" {
t.Fatalf("expect includeInboundPorts is '*', actual %v", r.includeInboundPorts)
}
}
func TestCmdAddTwoContainersWithEmptyInboundPort(t *testing.T) {
pod, ns := buildFakePodAndNSForClient()
pod.Spec.Containers[0].Name = "mockContainer"
pod.Spec.Containers[1].Name = "istio-proxy"
pod.ObjectMeta.Annotations[sidecarStatusKey] = "true"
pod.ObjectMeta.Annotations[includeInboundPortsKey] = ""
mockIntercept := testDoAddRun(t, buildMockConf(true), testNSName, pod, ns)
if len(mockIntercept.lastRedirect) != 1 {
t.Fatal("expected nsenterFunc to be called")
}
r := mockIntercept.lastRedirect[len(mockIntercept.lastRedirect)-1]
if r.includeInboundPorts != "" {
t.Fatalf("expect includeInboundPorts is \"\", actual %v", r.includeInboundPorts)
}
}
func TestCmdAddTwoContainersWithEmptyExcludeInboundPort(t *testing.T) {
pod, ns := buildFakePodAndNSForClient()
pod.Spec.Containers[0].Name = "mockContainer"
pod.Spec.Containers[1].Name = "istio-proxy"
pod.ObjectMeta.Annotations[sidecarStatusKey] = "true"
pod.ObjectMeta.Annotations[excludeInboundPortsKey] = ""
mockIntercept := testDoAddRun(t, buildMockConf(true), testNSName, pod, ns)
if len(mockIntercept.lastRedirect) != 1 {
t.Fatal("expected nsenterFunc to be called")
}
r := mockIntercept.lastRedirect[len(mockIntercept.lastRedirect)-1]
if r.excludeInboundPorts != "15020,15021,15090" {
t.Fatalf("expect excludeInboundPorts is \"15090\", actual %v", r.excludeInboundPorts)
}
}
func TestCmdAddTwoContainersWithExplictExcludeInboundPort(t *testing.T) {
pod, ns := buildFakePodAndNSForClient()
pod.Spec.Containers[0].Name = "mockContainer"
pod.Spec.Containers[1].Name = "istio-proxy"
pod.ObjectMeta.Annotations[sidecarStatusKey] = "true"
pod.ObjectMeta.Annotations[excludeInboundPortsKey] = "3306"
mockIntercept := testDoAddRun(t, buildMockConf(true), testNSName, pod, ns)
if len(mockIntercept.lastRedirect) == 0 {
t.Fatal("expected nsenterFunc to be called")
}
r := mockIntercept.lastRedirect[len(mockIntercept.lastRedirect)-1]
if r.excludeInboundPorts != "3306,15020,15021,15090" {
t.Fatalf("expect excludeInboundPorts is \"3306,15090\", actual %v", r.excludeInboundPorts)
}
}
func TestCmdAddTwoContainersWithoutSideCar(t *testing.T) {
pod, ns := buildFakePodAndNSForClient()
pod.Spec.Containers[0].Name = "mockContainer"
pod.Spec.Containers[1].Name = "istio-proxy"
mockIntercept := testDoAddRun(t, buildMockConf(true), testNSName, pod, ns)
if len(mockIntercept.lastRedirect) != 0 {
t.Fatal("Didnt Expect nsenterFunc to be called because this pod does not contain a sidecar")
}
}
func TestCmdAddExcludePod(t *testing.T) {
pod, ns := buildFakePodAndNSForClient()
mockIntercept := testDoAddRun(t, buildMockConf(true), "testExcludeNS", pod, ns)
if len(mockIntercept.lastRedirect) != 0 {
t.Fatal("failed to exclude pod")
}
}
func TestCmdAddExcludePodWithIstioInitContainer(t *testing.T) {
pod, ns := buildFakePodAndNSForClient()
pod.ObjectMeta.Annotations[sidecarStatusKey] = "true"
pod.Spec.Containers = append(pod.Spec.Containers, corev1.Container{Name: "istio-init"})
mockIntercept := testDoAddRun(t, buildMockConf(true), testNSName, pod, ns)
if len(mockIntercept.lastRedirect) != 0 {
t.Fatal("failed to exclude pod")
}
}
func TestCmdAddExcludePodWithEnvoyDisableEnv(t *testing.T) {
pod, ns := buildFakePodAndNSForClient()
pod.ObjectMeta.Annotations[sidecarStatusKey] = "true"
pod.Spec.Containers = append(pod.Spec.Containers, corev1.Container{
Name: "istio-init",
Env: []corev1.EnvVar{{Name: "DISABLE_ENVOY", Value: "true"}},
})
mockIntercept := testDoAddRun(t, buildMockConf(true), testNSName, pod, ns)
if len(mockIntercept.lastRedirect) != 0 {
t.Fatal("failed to exclude pod")
}
}
func TestCmdAddNoPrevResult(t *testing.T) {
confNoPrevResult := `{
"cniVersion": "1.0.0",
"name": "istio-plugin-sample-test",
"type": "sample",
"runtimeconfig": {
"sampleconfig": []
},
"loglevel": "debug",
"ambient_enabled": %t,
"kubernetes": {
"k8sapiroot": "APIRoot",
"kubeconfig": "testK8sConfig",
"nodename": "testNodeName",
"excludenamespaces": "testNS",
"cnibindir": "/testDirectory"
}
}`
pod, ns := buildFakePodAndNSForClient()
testDoAddRun(t, fmt.Sprintf(confNoPrevResult, false), testNSName, pod, ns)
testDoAddRun(t, fmt.Sprintf(confNoPrevResult, true), testNSName, pod, ns)
}
func TestCmdAddEnableDualStack(t *testing.T) {
pod, ns := buildFakePodAndNSForClient()
pod.ObjectMeta.Annotations[sidecarStatusKey] = "true"
pod.Spec.Containers = []corev1.Container{
{
Name: "istio-proxy",
Env: []corev1.EnvVar{{Name: "ISTIO_DUAL_STACK", Value: "true"}},
}, {Name: "mockContainer"},
}
mockIntercept := testDoAddRun(t, buildMockConf(true), testNSName, pod, ns)
if len(mockIntercept.lastRedirect) == 0 {
t.Fatal("expected nsenterFunc to be called")
}
r := mockIntercept.lastRedirect[len(mockIntercept.lastRedirect)-1]
if !r.dualStack {
t.Fatalf("expect dualStack is true, actual %v", r.dualStack)
}
}
func Test_dedupPorts(t *testing.T) {
type args struct {
ports []string
}
tests := []struct {
name string
args args
want []string
}{
{
name: "No duplicates",
args: args{ports: []string{"1234", "2345"}},
want: []string{"1234", "2345"},
},
{
name: "Sequential Duplicates",
args: args{ports: []string{"1234", "1234", "2345", "2345"}},
want: []string{"1234", "2345"},
},
{
name: "Mixed Duplicates",
args: args{ports: []string{"1234", "2345", "1234", "2345"}},
want: []string{"1234", "2345"},
},
{
name: "Empty",
args: args{ports: []string{}},
want: []string{},
},
{
name: "Non-parseable",
args: args{ports: []string{"abcd", "2345", "abcd"}},
want: []string{"abcd", "2345"},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := dedupPorts(tt.args.ports); !reflect.DeepEqual(got, tt.want) {
t.Errorf("dedupPorts() = %v, want %v", got, tt.want)
}
})
}
}
```
|
```java
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package org.flowable.engine.test.eventregistry;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.tuple;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.flowable.common.engine.impl.interceptor.EngineConfigurationConstants;
import org.flowable.engine.ProcessEngineConfiguration;
import org.flowable.engine.repository.DeploymentBuilder;
import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.eventregistry.api.EventDefinition;
import org.flowable.eventregistry.api.EventRegistry;
import org.flowable.eventregistry.api.EventRepositoryService;
import org.flowable.eventregistry.api.InboundEventChannelAdapter;
import org.flowable.eventregistry.api.model.EventModelBuilder;
import org.flowable.eventregistry.api.model.EventPayloadTypes;
import org.flowable.eventregistry.impl.EventRegistryEngineConfiguration;
import org.flowable.eventregistry.model.ChannelModel;
import org.flowable.eventregistry.model.InboundChannelModel;
import org.flowable.eventsubscription.api.EventSubscription;
import org.flowable.task.api.Task;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
/**
* @author Joram Barrez
*/
public class MultiTenantBpmnEventRegistryConsumerTest extends FlowableEventRegistryBpmnTestCase {
/**
* Setup: two tenants: tenantA and tenantB.
*
* Default tenant: - event definition 'defaultTenantSameKey'
*
* TenantA: - event definition 'sameKey'
* - event definition 'tenantAKey'
*
* TenantB: - event definition 'sameKey'
* - event definition 'tenantBKey'
*
* The event with 'defaultTenantSameKey' comes in through a channel with a tenantId selector, but it's deployed to the default tenant.
* The event with 'sameKey' comes in through a channel with a tenantId detector, but each tenant has a deployment for the event definition.
* The events with tenant specific keys come in through dedicated channels with a static tenantId, each tenant has a specific deployment for the event definition.
*/
private static final String TENANT_A = "tenantA";
private static final String TENANT_B = "tenantB";
private InboundChannelModel defaultSharedInboundChannelModel;
private InboundChannelModel sharedInboundChannelModel;
private InboundChannelModel tenantAChannelModel;
private InboundChannelModel tenantBChannelModel;
private Set<String> cleanupDeploymentIds = new HashSet<>();
@BeforeEach
public void setup() {
getEventRegistryEngineConfiguration().setFallbackToDefaultTenant(true);
Map<Object, Object> beans = getEventRegistryEngineConfiguration().getExpressionManager().getBeans();
beans.put("testInboundChannelAdapter", new TestInboundChannelAdapter());
beans.put("testInboundChannelAdapter2", new TestInboundChannelAdapter());
beans.put("testInboundChannelAdapter3", new TestInboundChannelAdapter());
beans.put("testInboundChannelAdapter4", new TestInboundChannelAdapter());
// Shared channel and event in default tenant
getEventRepositoryService().createInboundChannelModelBuilder()
.key("sharedDefaultChannel")
.resourceName("sharedDefaultChannel.channel")
.channelAdapter("${testInboundChannelAdapter}")
.jsonDeserializer()
.fixedEventKey("defaultTenantSameKey")
.detectEventTenantUsingJsonPointerExpression("/tenantId")
.jsonFieldsMapDirectlyToPayload()
.deploy();
defaultSharedInboundChannelModel = (InboundChannelModel) getEventRepositoryService().getChannelModelByKey("sharedDefaultChannel");
deployEventDefinition(defaultSharedInboundChannelModel, "defaultTenantSameKey", null);
// Shared channel with 'sameKey' event
getEventRepositoryService().createInboundChannelModelBuilder()
.key("sharedChannel")
.resourceName("sharedChannel.channel")
.channelAdapter("${testInboundChannelAdapter2}")
.jsonDeserializer()
.fixedEventKey("sameKey")
.detectEventTenantUsingJsonPointerExpression("/tenantId")
.jsonFieldsMapDirectlyToPayload()
.deploy();
sharedInboundChannelModel = (InboundChannelModel) getEventRepositoryService().getChannelModelByKey("sharedChannel", TENANT_A);
deployEventDefinition(sharedInboundChannelModel, "sameKey", TENANT_A, "tenantAData");
deployEventDefinition(sharedInboundChannelModel, "sameKey", TENANT_B, "tenantBData", "someMoreTenantBData");
// Tenant A specific events
getEventRepositoryService().createInboundChannelModelBuilder()
.key("tenantAChannel")
.resourceName("tenantAChannel.channel")
.deploymentTenantId(TENANT_A)
.channelAdapter("${testInboundChannelAdapter3}")
.jsonDeserializer()
.fixedEventKey("tenantAKey")
.fixedTenantId("tenantA")
.jsonFieldsMapDirectlyToPayload()
.deploy();
tenantAChannelModel = (InboundChannelModel) getEventRepositoryService().getChannelModelByKey("tenantAChannel", TENANT_A);
deployEventDefinition(tenantAChannelModel, "tenantAKey", TENANT_A);
// Tenant B specific events
getEventRepositoryService().createInboundChannelModelBuilder()
.key("tenantBChannel")
.resourceName("tenantBChannel.channel")
.deploymentTenantId(TENANT_B)
.channelAdapter("${testInboundChannelAdapter4}")
.jsonDeserializer()
.fixedEventKey("tenantBKey")
.fixedTenantId("tenantB")
.jsonFieldsMapDirectlyToPayload()
.deploy();
tenantBChannelModel = (InboundChannelModel) getEventRepositoryService().getChannelModelByKey("tenantBChannel", TENANT_B);
deployEventDefinition(tenantBChannelModel, "tenantBKey", TENANT_B);
}
private void deployEventDefinition(ChannelModel channelModel, String key, String tenantId, String ... optionalExtraPayload) {
EventModelBuilder eventModelBuilder = getEventRepositoryService().createEventModelBuilder()
.key(key)
.resourceName("myEvent.event")
.correlationParameter("customerId", EventPayloadTypes.STRING)
.payload("testPayload", EventPayloadTypes.STRING);
if (tenantId != null) {
eventModelBuilder.deploymentTenantId(tenantId);
}
if (optionalExtraPayload != null) {
for (String payload : optionalExtraPayload) {
eventModelBuilder.payload(payload, EventPayloadTypes.STRING);
}
}
eventModelBuilder.deploy();
}
@AfterEach
public void cleanup() {
getEventRepositoryService().createDeploymentQuery().list()
.forEach(eventDeployment -> getEventRepositoryService().deleteDeployment(eventDeployment.getId()));
for (String cleanupDeploymentId : cleanupDeploymentIds) {
repositoryService.deleteDeployment(cleanupDeploymentId, true);
}
cleanupDeploymentIds.clear();
getEventRegistryEngineConfiguration().setFallbackToDefaultTenant(false);
}
private void deployProcessModel(String modelResource, String tenantId) {
String resource = getClass().getPackage().toString().replace("package ", "").replace(".", "/");
resource += "/MultiTenantBpmnEventRegistryConsumerTest." + modelResource;
DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().addClasspathResource(resource);
if (tenantId != null) {
deploymentBuilder.tenantId(tenantId);
}
String deploymentId = deploymentBuilder.deploy().getId();
cleanupDeploymentIds.add(deploymentId);
assertThat(repositoryService.createProcessDefinitionQuery().deploymentId(deploymentId).singleResult()).isNotNull();
}
@Test
public void validateEventModelDeployments() {
EventDefinition eventDefinitionDefaultTenant = getEventRepositoryService().createEventDefinitionQuery()
.eventDefinitionKey("defaultTenantSameKey").singleResult();
assertThat(eventDefinitionDefaultTenant.getTenantId()).isEqualTo(ProcessEngineConfiguration.NO_TENANT_ID);
List<EventDefinition> sameKeyEventDefinitions = getEventRepositoryService().createEventDefinitionQuery()
.eventDefinitionKey("sameKey").orderByTenantId().asc().list();
assertThat(sameKeyEventDefinitions)
.extracting(EventDefinition::getTenantId)
.containsExactly(TENANT_A, TENANT_B);
EventDefinition tenantAEventDefinition = getEventRepositoryService().createEventDefinitionQuery()
.eventDefinitionKey("tenantAKey").singleResult();
assertThat(tenantAEventDefinition).isNotNull();
assertThat(tenantAEventDefinition.getId()).isEqualTo(getEventRepositoryService().createEventDefinitionQuery()
.eventDefinitionKey("tenantAKey").tenantId(TENANT_A).singleResult().getId());
assertThat(getEventRepositoryService().createEventDefinitionQuery()
.eventDefinitionKey("tenantBKey").tenantId(TENANT_A).singleResult()).isNull();
EventDefinition tenantBEventDefinition = getEventRepositoryService().createEventDefinitionQuery()
.eventDefinitionKey("tenantBKey").singleResult();
assertThat(tenantBEventDefinition).isNotNull();
assertThat(tenantBEventDefinition.getId()).isEqualTo( getEventRepositoryService().createEventDefinitionQuery()
.eventDefinitionKey("tenantBKey").tenantId(TENANT_B).singleResult().getId());
assertThat(getEventRepositoryService().createEventDefinitionQuery()
.eventDefinitionKey("tenantAKey").tenantId(TENANT_B).singleResult()).isNull();
}
@Test
public void testStartProcessInstanceWithTenantSpecificEvent() {
deployProcessModel("startProcessInstanceTenantA.bpmn20.xml", TENANT_A);
deployProcessModel("startProcessInstanceTenantB.bpmn20.xml", TENANT_B);
assertThat(runtimeService.createProcessInstanceQuery().count()).isZero();
assertThat(runtimeService.createEventSubscriptionQuery().tenantId(TENANT_A).list())
.extracting(EventSubscription::getEventType, EventSubscription::getTenantId)
.containsOnly(tuple("tenantAKey", "tenantA"));
assertThat(runtimeService.createEventSubscriptionQuery().tenantId(TENANT_B).list())
.extracting(EventSubscription::getEventType, EventSubscription::getTenantId)
.containsOnly(tuple("tenantBKey", "tenantB"));
// Note that #triggerEventWithoutTenantId doesn't have a tenantId set, but the channel has it hardcoded
for (int i = 0; i < 5; i++) {
((TestInboundChannelAdapter) tenantAChannelModel.getInboundEventChannelAdapter()).triggerEventWithoutTenantId("customerA");
assertThat(runtimeService.createProcessInstanceQuery().processInstanceTenantId(TENANT_A).count()).isEqualTo(i + 1);
assertThat(runtimeService.createProcessInstanceQuery().processInstanceTenantId(TENANT_B).count()).isZero();
}
((TestInboundChannelAdapter) tenantBChannelModel.getInboundEventChannelAdapter()).triggerEventWithoutTenantId("customerA");
assertThat(runtimeService.createProcessInstanceQuery().processInstanceTenantId(TENANT_A).count()).isEqualTo(5);
assertThat(runtimeService.createProcessInstanceQuery().processInstanceTenantId(TENANT_B).count()).isEqualTo(1);
waitForJobExecutorOnCondition(10000L, 100L, () -> taskService.createTaskQuery().count() == 6);
assertThat(taskService.createTaskQuery().orderByTaskName().asc().list())
.extracting(Task::getName)
.containsExactly("task tenant A", "task tenant A", "task tenant A", "task tenant A", "task tenant A", "task tenant B");
}
@Test
public void your_sha256_hashts() {
deployProcessModel("startProcessInstanceSameKeyTenantA.bpmn20.xml", TENANT_A);
deployProcessModel("startProcessInstanceSameKeyTenantB.bpmn20.xml", TENANT_B);
((TestInboundChannelAdapter) sharedInboundChannelModel.getInboundEventChannelAdapter()).triggerEventForTenantId("customerA", TENANT_A);
assertThat(runtimeService.createProcessInstanceQuery().processInstanceTenantId(TENANT_A).count()).isEqualTo(1);
assertThat(runtimeService.createProcessInstanceQuery().processInstanceTenantId(TENANT_B).count()).isZero();
((TestInboundChannelAdapter) sharedInboundChannelModel.getInboundEventChannelAdapter()).triggerEventForTenantId("customerA", TENANT_B);
((TestInboundChannelAdapter) sharedInboundChannelModel.getInboundEventChannelAdapter()).triggerEventForTenantId("customerA", TENANT_B);
assertThat(runtimeService.createProcessInstanceQuery().processInstanceTenantId(TENANT_A).count()).isEqualTo(1);
assertThat(runtimeService.createProcessInstanceQuery().processInstanceTenantId(TENANT_B).count()).isEqualTo(2);
waitForJobExecutorOnCondition(10000L, 100L, () -> taskService.createTaskQuery().count() == 3);
assertThat(taskService.createTaskQuery().orderByTaskName().asc().list())
.extracting(Task::getName)
.containsExactly("task tenant A", "task tenant B", "task tenant B");
}
@Test
public void your_sha256_hashtTenants() {
deployProcessModel("startUniqueProcessInstanceSameKeyTenantA.bpmn20.xml", TENANT_A);
deployProcessModel("startUniqueProcessInstanceSameKeyTenantB.bpmn20.xml", TENANT_B);
((TestInboundChannelAdapter) sharedInboundChannelModel.getInboundEventChannelAdapter()).triggerEventForTenantId("customerA", TENANT_A);
assertThat(runtimeService.createProcessInstanceQuery().processInstanceTenantId(TENANT_A).count()).isEqualTo(1);
assertThat(runtimeService.createProcessInstanceQuery().processInstanceTenantId(TENANT_B).count()).isZero();
((TestInboundChannelAdapter) sharedInboundChannelModel.getInboundEventChannelAdapter()).triggerEventForTenantId("customerA", TENANT_B);
((TestInboundChannelAdapter) sharedInboundChannelModel.getInboundEventChannelAdapter()).triggerEventForTenantId("customerA", TENANT_B);
assertThat(runtimeService.createProcessInstanceQuery().processInstanceTenantId(TENANT_A).count()).isEqualTo(1);
assertThat(runtimeService.createProcessInstanceQuery().processInstanceTenantId(TENANT_B).count()).isEqualTo(1); // unique instance for same correlation
waitForJobExecutorOnCondition(10000L, 100L, () -> taskService.createTaskQuery().count() == 2);
assertThat(taskService.createTaskQuery().orderByTaskName().asc().list())
.extracting(Task::getName)
.containsExactly("task tenant A", "task tenant B");
}
@Test
public void testStartProcessInstanceWithProcessAndEventInDefaultTenant() {
// Both the process model and the event definition are part of the default tenant
deployProcessModel("startProcessInstanceDefaultTenant.bpmn20.xml", null);
String tenantId = runtimeService.createEventSubscriptionQuery().singleResult().getTenantId();
assertThat(tenantId).isNullOrEmpty();
assertThat(runtimeService.createProcessInstanceQuery().processInstanceTenantId(TENANT_A).count()).isZero();
assertThat(runtimeService.createProcessInstanceQuery().processInstanceTenantId(TENANT_B).count()).isZero();
((TestInboundChannelAdapter) defaultSharedInboundChannelModel.getInboundEventChannelAdapter()).triggerEventForTenantId("customerA", TENANT_A);
assertThat(runtimeService.createProcessInstanceQuery().processInstanceTenantId(TENANT_A).count()).isEqualTo(1);
assertThat(runtimeService.createProcessInstanceQuery().processInstanceTenantId(TENANT_B).count()).isZero();
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceTenantId(TENANT_A).singleResult();
assertThat(processInstance.getTenantId()).isEqualTo(TENANT_A);
for (int i = 0; i < 4; i++) {
((TestInboundChannelAdapter) defaultSharedInboundChannelModel.getInboundEventChannelAdapter()).triggerEventForTenantId("customerB", TENANT_B);
assertThat(runtimeService.createProcessInstanceQuery().processInstanceTenantId(TENANT_A).count()).isEqualTo(1);
assertThat(runtimeService.createProcessInstanceQuery().processInstanceTenantId(TENANT_B).count()).isEqualTo(i + 1);
}
}
@Test
public void your_sha256_hashInSpecificTenant() {
deployProcessModel("boundaryEventSameKey.bpmn20.xml", null);
runtimeService.createProcessInstanceBuilder().processDefinitionKey("process").fallbackToDefaultTenant().overrideProcessDefinitionTenantId(TENANT_A).start();
runtimeService.createProcessInstanceBuilder().processDefinitionKey("process").fallbackToDefaultTenant().overrideProcessDefinitionTenantId(TENANT_B).start();
// Event subscription should be for specific tenants
assertThat(runtimeService.createEventSubscriptionQuery().list())
.extracting(EventSubscription::getTenantId)
.containsOnly(TENANT_A, TENANT_B);
((TestInboundChannelAdapter) defaultSharedInboundChannelModel.getInboundEventChannelAdapter()).triggerEventForTenantId("no_correlation", TENANT_A);
((TestInboundChannelAdapter) defaultSharedInboundChannelModel.getInboundEventChannelAdapter()).triggerEventForTenantId("no_correlation", TENANT_B);
assertThat(runtimeService.createEventSubscriptionQuery().list())
.extracting(EventSubscription::getTenantId)
.containsOnly(TENANT_A, TENANT_B);
assertThat(taskService.createTaskQuery().list())
.extracting(Task::getName)
.containsOnly("Task with boundary event", "Task with boundary event");
((TestInboundChannelAdapter) defaultSharedInboundChannelModel.getInboundEventChannelAdapter()).triggerEventForTenantId("abc", TENANT_A); // abc = correlation
assertThat(runtimeService.createEventSubscriptionQuery().list())
.extracting(EventSubscription::getTenantId)
.containsOnly(TENANT_B);
assertThat(taskService.createTaskQuery().list())
.extracting(Task::getName)
.containsOnly("Task with boundary event", "Task tenantA");
((TestInboundChannelAdapter) defaultSharedInboundChannelModel.getInboundEventChannelAdapter()).triggerEventForTenantId("abc", TENANT_B);
assertThat(runtimeService.createEventSubscriptionQuery().list()).isEmpty();
assertThat(taskService.createTaskQuery().list())
.extracting(Task::getName)
.containsOnly("Task tenantA", "Task tenantB");
}
@Test
public void testBoundaryEventWithSpecificTenantEvent() {
// Note that both events correlate on 'customerId' being 'ABC'
deployProcessModel("boundaryEventTenantA.bpmn20.xml", TENANT_A);
deployProcessModel("boundaryEventTenantB.bpmn20.xml", TENANT_B);
runtimeService.createProcessInstanceBuilder().processDefinitionKey("process").tenantId(TENANT_A).start();
runtimeService.createProcessInstanceBuilder().processDefinitionKey("process").tenantId(TENANT_B).start();
// Triggering through the tenant A channel should only correlate
((TestInboundChannelAdapter) tenantAChannelModel.getInboundEventChannelAdapter()).triggerEventWithoutTenantId("ABC");
assertThat(taskService.createTaskQuery().taskName("Task from tenant A").count()).isEqualTo(1);
assertThat(taskService.createTaskQuery().taskName("Task from tenant B").count()).isZero();
runtimeService.createProcessInstanceBuilder().processDefinitionKey("process").tenantId(TENANT_A).start();
((TestInboundChannelAdapter) tenantAChannelModel.getInboundEventChannelAdapter()).triggerEventWithoutTenantId("Doesn't correlate");
assertThat(taskService.createTaskQuery().taskName("Task from tenant A").count()).isEqualTo(1);
assertThat(taskService.createTaskQuery().taskName("Task from tenant B").count()).isZero();
((TestInboundChannelAdapter) tenantBChannelModel.getInboundEventChannelAdapter()).triggerEventWithoutTenantId("ABC");
assertThat(taskService.createTaskQuery().taskName("Task from tenant A").count()).isEqualTo(1);
assertThat(taskService.createTaskQuery().taskName("Task from tenant B").count()).isEqualTo(1);
}
@Test
public void testBoundaryEventWithSameEventKeyEvent() {
// Note that both events correlate on 'customerId' being 'ABC'
deployProcessModel("boundaryEventSameKeyTenantA.bpmn20.xml", TENANT_A);
deployProcessModel("boundaryEventSameKeyTenantB.bpmn20.xml", TENANT_B);
runtimeService.createProcessInstanceBuilder().processDefinitionKey("process").tenantId(TENANT_A).start();
runtimeService.createProcessInstanceBuilder().processDefinitionKey("process").tenantId(TENANT_B).start();
// Triggering through the tenant A channel should only correlate
((TestInboundChannelAdapter) sharedInboundChannelModel.getInboundEventChannelAdapter()).triggerEventForTenantId("ABC", TENANT_A);
assertThat(taskService.createTaskQuery().taskName("Task from tenant A").count()).isEqualTo(1);
assertThat(taskService.createTaskQuery().taskName("Task from tenant B").count()).isZero();
runtimeService.createProcessInstanceBuilder().processDefinitionKey("process").tenantId(TENANT_A).start();
((TestInboundChannelAdapter) sharedInboundChannelModel.getInboundEventChannelAdapter()).triggerEventForTenantId("Doesn't correlate", TENANT_A);
assertThat(taskService.createTaskQuery().taskName("Task from tenant A").count()).isEqualTo(1);
assertThat(taskService.createTaskQuery().taskName("Task from tenant B").count()).isZero();
((TestInboundChannelAdapter) sharedInboundChannelModel.getInboundEventChannelAdapter()).triggerEventForTenantId("ABC", TENANT_A);
assertThat(taskService.createTaskQuery().taskName("Task from tenant A").count()).isEqualTo(2);
assertThat(taskService.createTaskQuery().taskName("Task from tenant B").count()).isZero();
((TestInboundChannelAdapter) sharedInboundChannelModel.getInboundEventChannelAdapter()).triggerEventForTenantId("ABC", TENANT_B);
assertThat(taskService.createTaskQuery().taskName("Task from tenant A").count()).isEqualTo(2);
assertThat(taskService.createTaskQuery().taskName("Task from tenant B").count()).isEqualTo(1);
}
private static class TestInboundChannelAdapter implements InboundEventChannelAdapter {
protected InboundChannelModel inboundChannelModel;
protected EventRegistry eventRegistry;
@Override
public void setInboundChannelModel(InboundChannelModel inboundChannelModel) {
this.inboundChannelModel = inboundChannelModel;
}
@Override
public void setEventRegistry(EventRegistry eventRegistry) {
this.eventRegistry = eventRegistry;
}
public void triggerEventWithoutTenantId(String customerId) {
ObjectMapper objectMapper = new ObjectMapper();
ObjectNode json = objectMapper.createObjectNode();
json.put("type", "tenantAKey");
if (customerId != null) {
json.put("customerId", customerId);
}
json.put("payload", "Hello World");
try {
eventRegistry.eventReceived(inboundChannelModel, objectMapper.writeValueAsString(json));
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}
public void triggerEventForTenantId(String customerId, String tenantId) {
ObjectMapper objectMapper = new ObjectMapper();
ObjectNode json = objectMapper.createObjectNode();
json.put("type", "tenantAKey");
if (customerId != null) {
json.put("customerId", customerId);
}
json.put("tenantAData", "tenantAValue");
json.put("tenantBData", "tenantBValue");
json.put("someMoreTenantBData", "someMoreTenantBValue");
json.put("payload", "Hello World");
json.put("tenantId", tenantId);
try {
eventRegistry.eventReceived(inboundChannelModel, objectMapper.writeValueAsString(json));
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}
}
@Override
protected EventRepositoryService getEventRepositoryService() {
return getEventRegistryEngineConfiguration().getEventRepositoryService();
}
@Override
protected EventRegistry getEventRegistry() {
return getEventRegistryEngineConfiguration().getEventRegistry();
}
@Override
protected EventRegistryEngineConfiguration getEventRegistryEngineConfiguration() {
return (EventRegistryEngineConfiguration) processEngineConfiguration.getEngineConfigurations()
.get(EngineConfigurationConstants.KEY_EVENT_REGISTRY_CONFIG);
}
}
```
|
```python
import datetime
import os
import tempfile
import flask_restful
import requests
from flask import Blueprint, request
from flask import abort
from flask import flash
from flask import redirect
from flask import render_template
from flask import session
from flask_restful_swagger import swagger
from werkzeug.utils import secure_filename
from SpiderKeeper.app import db, api, agent, app
from SpiderKeeper.app.spider.model import JobInstance, Project, JobExecution, SpiderInstance, JobRunType
api_spider_bp = Blueprint('spider', __name__)
'''
========= api =========
'''
class ProjectCtrl(flask_restful.Resource):
@swagger.operation(
summary='list projects',
parameters=[])
def get(self):
return [project.to_dict() for project in Project.query.all()]
@swagger.operation(
summary='add project',
parameters=[{
"name": "project_name",
"description": "project name",
"required": True,
"paramType": "form",
"dataType": 'string'
}])
def post(self):
project_name = request.form['project_name']
project = Project()
project.project_name = project_name
db.session.add(project)
db.session.commit()
return project.to_dict()
class SpiderCtrl(flask_restful.Resource):
@swagger.operation(
summary='list spiders',
parameters=[{
"name": "project_id",
"description": "project id",
"required": True,
"paramType": "path",
"dataType": 'int'
}])
def get(self, project_id):
project = Project.find_project_by_id(project_id)
return [spider_instance.to_dict() for spider_instance in
SpiderInstance.query.filter_by(project_id=project_id).all()]
class SpiderDetailCtrl(flask_restful.Resource):
@swagger.operation(
summary='spider detail',
parameters=[{
"name": "project_id",
"description": "project id",
"required": True,
"paramType": "path",
"dataType": 'int'
}, {
"name": "spider_id",
"description": "spider instance id",
"required": True,
"paramType": "path",
"dataType": 'int'
}])
def get(self, project_id, spider_id):
spider_instance = SpiderInstance.query.filter_by(project_id=project_id, id=spider_id).first()
return spider_instance.to_dict() if spider_instance else abort(404)
@swagger.operation(
summary='run spider',
parameters=[{
"name": "project_id",
"description": "project id",
"required": True,
"paramType": "path",
"dataType": 'int'
}, {
"name": "spider_id",
"description": "spider instance id",
"required": True,
"paramType": "path",
"dataType": 'int'
}, {
"name": "spider_arguments",
"description": "spider arguments",
"required": False,
"paramType": "form",
"dataType": 'string'
}, {
"name": "priority",
"description": "LOW: -1, NORMAL: 0, HIGH: 1, HIGHEST: 2",
"required": False,
"paramType": "form",
"dataType": 'int'
}, {
"name": "tags",
"description": "spider tags",
"required": False,
"paramType": "form",
"dataType": 'string'
}, {
"name": "desc",
"description": "spider desc",
"required": False,
"paramType": "form",
"dataType": 'string'
}])
def put(self, project_id, spider_id):
spider_instance = SpiderInstance.query.filter_by(project_id=project_id, id=spider_id).first()
if not spider_instance: abort(404)
job_instance = JobInstance()
job_instance.spider_name = spider_instance.spider_name
job_instance.project_id = project_id
job_instance.spider_arguments = request.form.get('spider_arguments')
job_instance.desc = request.form.get('desc')
job_instance.tags = request.form.get('tags')
job_instance.run_type = JobRunType.ONETIME
job_instance.priority = request.form.get('priority', 0)
job_instance.enabled = -1
db.session.add(job_instance)
db.session.commit()
agent.start_spider(job_instance)
return True
JOB_INSTANCE_FIELDS = [column.name for column in JobInstance.__table__.columns]
JOB_INSTANCE_FIELDS.remove('id')
JOB_INSTANCE_FIELDS.remove('date_created')
JOB_INSTANCE_FIELDS.remove('date_modified')
class JobCtrl(flask_restful.Resource):
@swagger.operation(
summary='list job instance',
parameters=[{
"name": "project_id",
"description": "project id",
"required": True,
"paramType": "path",
"dataType": 'int'
}])
def get(self, project_id):
return [job_instance.to_dict() for job_instance in
JobInstance.query.filter_by(run_type="periodic", project_id=project_id).all()]
@swagger.operation(
summary='add job instance',
notes="json keys: <br>" + "<br>".join(JOB_INSTANCE_FIELDS),
parameters=[{
"name": "project_id",
"description": "project id",
"required": True,
"paramType": "path",
"dataType": 'int'
}, {
"name": "spider_name",
"description": "spider_name",
"required": True,
"paramType": "form",
"dataType": 'string'
}, {
"name": "spider_arguments",
"description": "spider_arguments, split by ','",
"required": False,
"paramType": "form",
"dataType": 'string'
}, {
"name": "desc",
"description": "desc",
"required": False,
"paramType": "form",
"dataType": 'string'
}, {
"name": "tags",
"description": "tags , split by ','",
"required": False,
"paramType": "form",
"dataType": 'string'
}, {
"name": "run_type",
"description": "onetime/periodic",
"required": False,
"paramType": "form",
"dataType": 'string'
}, {
"name": "priority",
"description": "LOW: -1, NORMAL: 0, HIGH: 1, HIGHEST: 2",
"required": False,
"paramType": "form",
"dataType": 'int'
}, {
"name": "cron_minutes",
"description": "@see path_to_url",
"required": False,
"paramType": "form",
"dataType": 'string'
}, {
"name": "cron_hour",
"description": "",
"required": False,
"paramType": "form",
"dataType": 'string'
}, {
"name": "cron_day_of_month",
"description": "",
"required": False,
"paramType": "form",
"dataType": 'string'
}, {
"name": "cron_day_of_week",
"description": "",
"required": False,
"paramType": "form",
"dataType": 'string'
}, {
"name": "cron_month",
"description": "",
"required": False,
"paramType": "form",
"dataType": 'string'
}])
def post(self, project_id):
post_data = request.form
if post_data:
job_instance = JobInstance()
job_instance.spider_name = post_data['spider_name']
job_instance.project_id = project_id
job_instance.spider_arguments = post_data.get('spider_arguments')
job_instance.desc = post_data.get('desc')
job_instance.tags = post_data.get('tags')
job_instance.run_type = post_data['run_type']
job_instance.priority = post_data.get('priority', 0)
if job_instance.run_type == "periodic":
job_instance.cron_minutes = post_data.get('cron_minutes') or '0'
job_instance.cron_hour = post_data.get('cron_hour') or '*'
job_instance.cron_day_of_month = post_data.get('cron_day_of_month') or '*'
job_instance.cron_day_of_week = post_data.get('cron_day_of_week') or '*'
job_instance.cron_month = post_data.get('cron_month') or '*'
db.session.add(job_instance)
db.session.commit()
return True
class JobDetailCtrl(flask_restful.Resource):
@swagger.operation(
summary='update job instance',
notes="json keys: <br>" + "<br>".join(JOB_INSTANCE_FIELDS),
parameters=[{
"name": "project_id",
"description": "project id",
"required": True,
"paramType": "path",
"dataType": 'int'
}, {
"name": "job_id",
"description": "job instance id",
"required": True,
"paramType": "path",
"dataType": 'int'
}, {
"name": "spider_name",
"description": "spider_name",
"required": False,
"paramType": "form",
"dataType": 'string'
}, {
"name": "spider_arguments",
"description": "spider_arguments, split by ','",
"required": False,
"paramType": "form",
"dataType": 'string'
}, {
"name": "desc",
"description": "desc",
"required": False,
"paramType": "form",
"dataType": 'string'
}, {
"name": "tags",
"description": "tags , split by ','",
"required": False,
"paramType": "form",
"dataType": 'string'
}, {
"name": "run_type",
"description": "onetime/periodic",
"required": False,
"paramType": "form",
"dataType": 'string'
}, {
"name": "priority",
"description": "LOW: -1, NORMAL: 0, HIGH: 1, HIGHEST: 2",
"required": False,
"paramType": "form",
"dataType": 'int'
}, {
"name": "cron_minutes",
"description": "@see path_to_url",
"required": False,
"paramType": "form",
"dataType": 'string'
}, {
"name": "cron_hour",
"description": "",
"required": False,
"paramType": "form",
"dataType": 'string'
}, {
"name": "cron_day_of_month",
"description": "",
"required": False,
"paramType": "form",
"dataType": 'string'
}, {
"name": "cron_day_of_week",
"description": "",
"required": False,
"paramType": "form",
"dataType": 'string'
}, {
"name": "cron_month",
"description": "",
"required": False,
"paramType": "form",
"dataType": 'string'
}, {
"name": "enabled",
"description": "-1 / 0, default: 0",
"required": False,
"paramType": "form",
"dataType": 'int'
}, {
"name": "status",
"description": "if set to 'run' will run the job",
"required": False,
"paramType": "form",
"dataType": 'int'
}
])
def put(self, project_id, job_id):
post_data = request.form
if post_data:
job_instance = JobInstance.query.filter_by(project_id=project_id, id=job_id).first()
if not job_instance: abort(404)
job_instance.spider_arguments = post_data.get('spider_arguments') or job_instance.spider_arguments
job_instance.priority = post_data.get('priority') or job_instance.priority
job_instance.enabled = post_data.get('enabled', 0)
job_instance.cron_minutes = post_data.get('cron_minutes') or job_instance.cron_minutes
job_instance.cron_hour = post_data.get('cron_hour') or job_instance.cron_hour
job_instance.cron_day_of_month = post_data.get('cron_day_of_month') or job_instance.cron_day_of_month
job_instance.cron_day_of_week = post_data.get('cron_day_of_week') or job_instance.cron_day_of_week
job_instance.cron_month = post_data.get('cron_month') or job_instance.cron_month
job_instance.desc = post_data.get('desc', 0) or job_instance.desc
job_instance.tags = post_data.get('tags', 0) or job_instance.tags
db.session.commit()
if post_data.get('status') == 'run':
agent.start_spider(job_instance)
return True
class JobExecutionCtrl(flask_restful.Resource):
@swagger.operation(
summary='list job execution status',
parameters=[{
"name": "project_id",
"description": "project id",
"required": True,
"paramType": "path",
"dataType": 'int'
}])
def get(self, project_id):
return JobExecution.list_jobs(project_id)
class JobExecutionDetailCtrl(flask_restful.Resource):
@swagger.operation(
summary='stop job',
notes='',
parameters=[
{
"name": "project_id",
"description": "project id",
"required": True,
"paramType": "path",
"dataType": 'int'
},
{
"name": "job_exec_id",
"description": "job_execution_id",
"required": True,
"paramType": "path",
"dataType": 'string'
}
])
def put(self, project_id, job_exec_id):
job_execution = JobExecution.query.filter_by(project_id=project_id, id=job_exec_id).first()
if job_execution:
agent.cancel_spider(job_execution)
return True
api.add_resource(ProjectCtrl, "/api/projects")
api.add_resource(SpiderCtrl, "/api/projects/<project_id>/spiders")
api.add_resource(SpiderDetailCtrl, "/api/projects/<project_id>/spiders/<spider_id>")
api.add_resource(JobCtrl, "/api/projects/<project_id>/jobs")
api.add_resource(JobDetailCtrl, "/api/projects/<project_id>/jobs/<job_id>")
api.add_resource(JobExecutionCtrl, "/api/projects/<project_id>/jobexecs")
api.add_resource(JobExecutionDetailCtrl, "/api/projects/<project_id>/jobexecs/<job_exec_id>")
'''
========= Router =========
'''
@app.before_request
def intercept_no_project():
if request.path.find('/project//') > -1:
flash("create project first")
return redirect("/project/manage", code=302)
@app.context_processor
def inject_common():
return dict(now=datetime.datetime.now(),
servers=agent.servers)
@app.context_processor
def inject_project():
project_context = {}
project_context['project_list'] = Project.query.all()
if project_context['project_list'] and (not session.get('project_id')):
project = Project.query.first()
session['project_id'] = project.id
if session.get('project_id'):
project_context['project'] = Project.find_project_by_id(session['project_id'])
project_context['spider_list'] = [spider_instance.to_dict() for spider_instance in
SpiderInstance.query.filter_by(project_id=session['project_id']).all()]
else:
project_context['project'] = {}
return project_context
@app.context_processor
def utility_processor():
def timedelta(end_time, start_time):
'''
:param end_time:
:param start_time:
:param unit: s m h
:return:
'''
if not end_time or not start_time:
return ''
if type(end_time) == str:
end_time = datetime.datetime.strptime(end_time, '%Y-%m-%d %H:%M:%S')
if type(start_time) == str:
start_time = datetime.datetime.strptime(start_time, '%Y-%m-%d %H:%M:%S')
total_seconds = (end_time - start_time).total_seconds()
return readable_time(total_seconds)
def readable_time(total_seconds):
if not total_seconds:
return '-'
if total_seconds < 60:
return '%s s' % total_seconds
if total_seconds < 3600:
return '%s m' % int(total_seconds / 60)
return '%s h %s m' % (int(total_seconds / 3600), int((total_seconds % 3600) / 60))
return dict(timedelta=timedelta, readable_time=readable_time)
@app.route("/")
def index():
project = Project.query.first()
if project:
return redirect("/project/%s/job/dashboard" % project.id, code=302)
return redirect("/project/manage", code=302)
@app.route("/project/<project_id>")
def project_index(project_id):
session['project_id'] = project_id
return redirect("/project/%s/job/dashboard" % project_id, code=302)
@app.route("/project/create", methods=['post'])
def project_create():
project_name = request.form['project_name']
project = Project()
project.project_name = project_name
db.session.add(project)
db.session.commit()
return redirect("/project/%s/spider/deploy" % project.id, code=302)
@app.route("/project/<project_id>/delete")
def project_delete(project_id):
project = Project.find_project_by_id(project_id)
agent.delete_project(project)
db.session.delete(project)
db.session.commit()
return redirect("/project/manage", code=302)
@app.route("/project/manage")
def project_manage():
return render_template("project_manage.html")
@app.route("/project/<project_id>/job/dashboard")
def job_dashboard(project_id):
return render_template("job_dashboard.html", job_status=JobExecution.list_jobs(project_id))
@app.route("/project/<project_id>/job/periodic")
def job_periodic(project_id):
project = Project.find_project_by_id(project_id)
job_instance_list = [job_instance.to_dict() for job_instance in
JobInstance.query.filter_by(run_type="periodic", project_id=project_id).all()]
return render_template("job_periodic.html",
job_instance_list=job_instance_list)
@app.route("/project/<project_id>/job/add", methods=['post'])
def job_add(project_id):
project = Project.find_project_by_id(project_id)
job_instance = JobInstance()
job_instance.spider_name = request.form['spider_name']
job_instance.project_id = project_id
job_instance.spider_arguments = request.form['spider_arguments']
job_instance.priority = request.form.get('priority', 0)
job_instance.run_type = request.form['run_type']
# chose daemon manually
if request.form['daemon'] != 'auto':
spider_args = []
if request.form['spider_arguments']:
spider_args = request.form['spider_arguments'].split(",")
spider_args.append("daemon={}".format(request.form['daemon']))
job_instance.spider_arguments = ','.join(spider_args)
if job_instance.run_type == JobRunType.ONETIME:
job_instance.enabled = -1
db.session.add(job_instance)
db.session.commit()
agent.start_spider(job_instance)
if job_instance.run_type == JobRunType.PERIODIC:
job_instance.cron_minutes = request.form.get('cron_minutes') or '0'
job_instance.cron_hour = request.form.get('cron_hour') or '*'
job_instance.cron_day_of_month = request.form.get('cron_day_of_month') or '*'
job_instance.cron_day_of_week = request.form.get('cron_day_of_week') or '*'
job_instance.cron_month = request.form.get('cron_month') or '*'
# set cron exp manually
if request.form.get('cron_exp'):
job_instance.cron_minutes, job_instance.cron_hour, job_instance.cron_day_of_month, job_instance.cron_day_of_week, job_instance.cron_month = \
request.form['cron_exp'].split(' ')
db.session.add(job_instance)
db.session.commit()
return redirect(request.referrer, code=302)
@app.route("/project/<project_id>/jobexecs/<job_exec_id>/stop")
def job_stop(project_id, job_exec_id):
job_execution = JobExecution.query.filter_by(project_id=project_id, id=job_exec_id).first()
agent.cancel_spider(job_execution)
return redirect(request.referrer, code=302)
@app.route("/project/<project_id>/jobexecs/<job_exec_id>/log")
def job_log(project_id, job_exec_id):
job_execution = JobExecution.query.filter_by(project_id=project_id, id=job_exec_id).first()
res = requests.get(agent.log_url(job_execution))
res.encoding = 'utf8'
raw = res.text
return render_template("job_log.html", log_lines=raw.split('\n'))
@app.route("/project/<project_id>/job/<job_instance_id>/run")
def job_run(project_id, job_instance_id):
job_instance = JobInstance.query.filter_by(project_id=project_id, id=job_instance_id).first()
agent.start_spider(job_instance)
return redirect(request.referrer, code=302)
@app.route("/project/<project_id>/job/<job_instance_id>/remove")
def job_remove(project_id, job_instance_id):
job_instance = JobInstance.query.filter_by(project_id=project_id, id=job_instance_id).first()
db.session.delete(job_instance)
db.session.commit()
return redirect(request.referrer, code=302)
@app.route("/project/<project_id>/job/<job_instance_id>/switch")
def job_switch(project_id, job_instance_id):
job_instance = JobInstance.query.filter_by(project_id=project_id, id=job_instance_id).first()
job_instance.enabled = -1 if job_instance.enabled == 0 else 0
db.session.commit()
return redirect(request.referrer, code=302)
@app.route("/project/<project_id>/spider/dashboard")
def spider_dashboard(project_id):
spider_instance_list = SpiderInstance.list_spiders(project_id)
return render_template("spider_dashboard.html",
spider_instance_list=spider_instance_list)
@app.route("/project/<project_id>/spider/deploy")
def spider_deploy(project_id):
project = Project.find_project_by_id(project_id)
return render_template("spider_deploy.html")
@app.route("/project/<project_id>/spider/upload", methods=['post'])
def spider_egg_upload(project_id):
project = Project.find_project_by_id(project_id)
if 'file' not in request.files:
flash('No file part')
return redirect(request.referrer)
file = request.files['file']
# if user does not select file, browser also
# submit a empty part without filename
if file.filename == '':
flash('No selected file')
return redirect(request.referrer)
if file:
filename = secure_filename(file.filename)
dst = os.path.join(tempfile.gettempdir(), filename)
file.save(dst)
agent.deploy(project, dst)
flash('deploy success!')
return redirect(request.referrer)
@app.route("/project/<project_id>/project/stats")
def project_stats(project_id):
project = Project.find_project_by_id(project_id)
run_stats = JobExecution.list_run_stats_by_hours(project_id)
return render_template("project_stats.html", run_stats=run_stats)
@app.route("/project/<project_id>/server/stats")
def service_stats(project_id):
project = Project.find_project_by_id(project_id)
run_stats = JobExecution.list_run_stats_by_hours(project_id)
return render_template("server_stats.html", run_stats=run_stats)
```
|
The Moses Mould House is a Registered Historic Place located at the junction of NY 17K and Kaistertown Road in the Town of Montgomery, in Orange County, New York. It is just up Kaisertown from another site on the National Register, the Jacob Shafer House. Mould was the first of a large family of German settlers in the town to bear the name. The house was built in a Greek Revival style.
It was added to the National Register of Historic Places in 2002.
See also
National Register of Historic Places listings in Orange County, New York
References
Houses on the National Register of Historic Places in New York (state)
Houses in Orange County, New York
National Register of Historic Places in Orange County, New York
Greek Revival houses in New York (state)
|
```groff
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" This software is provided by Joseph Koshy ``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 Joseph Koshy 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.
.\"
.\" $Id: gelf_checksum.3,v 1.1 2019/02/01 05:27:37 jsg Exp $
.\"
.Dd August 29, 2006
.Dt GELF_CHECKSUM 3
.Os
.Sh NAME
.Nm elf32_checksum ,
.Nm elf64_checksum ,
.Nm gelf_checksum
.Nd return the checksum of an ELF object
.Sh LIBRARY
.Lb libelf
.Sh SYNOPSIS
.In libelf.h
.Ft long
.Fn elf32_checksum "Elf *elf"
.Ft long
.Fn elf64_checksum "Elf *elf"
.In gelf.h
.Ft long
.Fn gelf_checksum "Elf *elf"
.Sh DESCRIPTION
These functions return a simple checksum of the ELF object described
by their argument
.Ar elf .
The checksum is computed in way that allows its value to remain
unchanged in presence of modifications to the ELF object by utilities
like
.Xr strip 1 .
.Pp
Function
.Fn elf32_checksum
returns a checksum for an ELF descriptor
.Ar elf
of class
.Dv ELFCLASS32 .
.Pp
Function
.Fn elf64_checksum
returns a checksum for an ELF descriptor
.Ar elf
of class
.Dv ELFCLASS64 .
.Pp
Function
.Fn gelf_checksum
provides a class-independent way retrieving the checksum
for ELF object
.Ar elf .
.Sh RETURN VALUES
These functions return the checksum of the ELF object, or zero in case
an error was encountered.
.Sh ERRORS
These functions may fail with the following errors:
.Bl -tag -width "[ELF_E_RESOURCE]"
.It Bq Er ELF_E_ARGUMENT
Argument
.Ar elf
was NULL.
.It Bq Er ELF_E_ARGUMENT
Argument
.Ar elf
was not a descriptor for an ELF file.
.It Bq Er ELF_E_ARGUMENT
The ELF descriptor
.Ar elf
was not opened for reading or updating.
.It Bq Er ELF_E_CLASS
For functions
.Fn elf32_checksum
and
.Fn elf64_checksum ,
ELF descriptor
.Ar elf
did not match the class of the called function.
.It Bq Er ELF_E_HEADER
The ELF object specified by argument
.Ar elf
had a malformed executable header.
.It Bq Er ELF_E_RESOURCE
An out of memory condition was detected during processing.
.It Bq Er ELF_E_SECTION
The ELF object specified by argument
.Ar elf
contained a section with a malformed section header.
.It Bq Er ELF_E_VERSION
The ELF object was of an unsupported version.
.El
.Sh SEE ALSO
.Xr strip 1 ,
.Xr elf 3 ,
.Xr gelf 3
```
|
The 2016–17 Jacksonville Dolphins women's basketball team represented Jacksonville University in the 2016–17 NCAA Division I women's basketball season. The Dolphins, led by fourth year head coach Yolett McPhee-McCuin, played their home games at Swisher Gymnasium and were members of the Atlantic Sun Conference. They finish the season 23–9, 11–3 in A-Sun play finish in third place. They advanced to the semifinals of the 2017 Atlantic Sun women's basketball tournament where they lost to Florida Gulf Coast. They were invited to the WNIT where they lost to Georgia Tech in the first round.
Media
All home games and conference road games were shown on ESPN3 or A-Sun.TV.
Roster
Schedule
|-
!colspan=9 style="background:#004D40; color:#FFFFFF;"| Non-conference regular season
|-
!colspan=9 style="background:#004D40; color:#FFFFFF;"| Atlantic Sun regular season
|-
!colspan=9 style="background:#004D40; color:#FFFFFF;"| Atlantic Sun Women's Tournament
|-
!colspan=9 style="background:#004D40; color:#FFFFFF;"| WNIT
Rankings
See also
2016–17 Jacksonville Dolphins men's basketball team
References
Jacksonville
Jacksonville Dolphins women's basketball seasons
2017 Women's National Invitation Tournament participants
Jacksonville Dolphins women's basketball team
Jacksonville Dolphins women's basketball team
|
Cooper is an English surname originating in England; see Cooper (profession). Occasionally it is an Anglicized form of the German surname Kiefer. Cooper is the 8th most common surname in Liberia and 27th most common in England.
A
Adam Cooper (dancer) (born 1971), actor, choreographer, dancer and theater director
Adrian Cooper (born 1968), American football tight end
Adrienne Cooper (1946–2011), American Yiddish singer, musician and activist
Afua Cooper (born 1957), Jamaican-Canadian poet and academic
Alan Cooper (bishop) (1909–1999), British Anglican bishop
Alan Cooper (born 1952), American creator of Visual Basic
Alan Cooper (biblical scholar), American
Albert Cooper (disambiguation), multiple people
Alex Cooper (architect) (born 1936), American architect
Alex Cooper (sailor) (born 1942), Bermudian Olympic sailor
Alex Cooper (footballer) (born 1991), Scottish footballer
Alexander Cooper (1609–1660), English painter
Alfred Cooper (disambiguation), multiple people
Alice Cooper (born 1948), born Vincent Damon Furnier, American Singer and musician
Alison Cooper (born 1966), British businesswoman
Allen Foster Cooper (1838–1918), American politician
Amari Cooper (born 1994), American football wide receiver
Anderson Cooper (born 1967), American journalist
Andre Cooper (born 1975), American footballer wide receiver
Andrew Cooper (disambiguation), multiple people
Angus Cooper (born 1964), New Zealand hammer thrower
Ann Cooper Whitall (1716–1797), American Quaker
Ann Nixon Cooper (1902–2009), African-American representative
Anna J. Cooper (1859–1964), African-American educator
Anthony Ashley-Cooper (disambiguation), 10 of the 12 Earls of Shaftesbury
Anton Cooper (born 1994), New Zealand cross-country mountain biker
Arif Cooper (died 2023), Jamaican musician
Armando Cooper (born 1987), Panamanian footballer
Artemis Cooper (born 1953), British writer
Ashley Cooper (disambiguation), multiple people
Astley Cooper (1768–1841), English surgeon
Audrey Cooper (born 1977), American journalist
B
B. Cooper (born 1984), American Christian hip-hop musician
Barbara Cooper (politician) (1929–2022), American politician
Barbara Cooper (RAF officer) (born 1959), British Royal Air Force officer
Barry Cooper (disambiguation), multiple people
Ben Cooper (disambiguation), multiple people
Bernard Cooper (born 1951), American novelist
Bert Cooper (American football) (born 1952), American football player
Bert Cooper (1966–2019), American boxer
Bertie Cooper (1892–1916), Australian rules footballer
Besse Cooper (1896–2012), American supercentenarian and world's oldest person during 2011–2012
Bette Cooper (1924–2017), Miss America 1937
Bill and Billy Cooper (disambiguation), multiple people
Bill Cooper (American football) (born 1939), professional football player for the San Francisco 49ers
Bill Cooper (hurler) (born 1987), Irish hurler
Billy Cooper (footballer) (born 1917), English footballer
Billy Cooper (Canadian football) (born 1945), Canadian football player
Billy Cooper (trumpeter), cricket supporter and trumpet player for the Barmy Army
Blake Cooper (born 2001), American actor
Bob Cooper (disambiguation), multiple people
Bob Cooper (musician) (1925–1993), American jazz musician
Bob Cooper (racing driver) (born 1935), American NASCAR Cup Series driver
Bob Cooper (politician) (1936–2004), politician and activist in Northern Ireland
Bob Cooper (speedway rider) (born 1950), English speedway rider
Bob Cooper (journalist) (born 1954), freelance writer and Runner's World columnist, ultramarathoner
Bob Cooper (rugby league), Australian former professional rugby league footballer
Bonnie Cooper (1935–2018), All-American Girls Professional Baseball League player.
BP Cooper, American screenwriter, film and commercial producer
Brad Cooper (born 1954), Australian Olympic swimmer
Bradley Cooper (athlete) (born 1957), Bahamian discus thrower and shot putter
Bradley Cooper (born 1975), American actor
Bransby Cooper (1844–1914), Australian cricketer
Brenda Cooper, American author
Brent Cooper (judoka) (born 1960), New Zealand Olympic judoka and judo administrator
Bret Cooper (born 1970), American football player
Brett Cooper (footballer) (born 1959), Australian rules footballer
Brett Cooper (fighter) (born 1987), American mixed martial artist
Brett Cooper (political commentator) (born 2001), American actress and political commentator
Brian Cooper (disambiguation), multiple people
Britney Cooper (born 1989), West Indian cricketer from Trinidad
Brittnee Cooper (born 1988), American volleyball player
Bryan Cooper (politician) (1884–1930), Irish politician
Bryan Cooper (jockey) (born 1992), Irish National Hunt jockey
Buster Cooper (1929–2016), American jazz trombonist
C
Caitlin Cooper (born 1988), Australian soccer player
Calico Cooper (born 1981), American actor, dancer, and singer, the daughter of rock singer Alice Cooper and dancer Sheryl Cooper
Camille Cooper (born 1979), American basketball player
Carl Cooper (born 1960), British Anglican bishop
Carolyn Cooper (born 1950), Jamaican author
Cary Cooper (born 1940), American-born British psychologist
Cathy Cooper (born 1960), American artist
Cec Cooper (1926-2010), Australian rugby league footballer
Cecil Cooper (bishop) (1882–1964), British Bishop
Cecil Cooper (born 1949), American baseball player
Charles Cooper (disambiguation), multiple people
Charlotte Cooper (disambiguation), multiple people
Chris Cooper (disambiguation), multiple people
Christin Cooper (born 1959), American skier
Clarence Cooper (disambiguation), multiple people
Colin Cooper (disambiguation), multiple people
Colm Cooper (born 1983), Irish Gaelic footballer
Courtney Ryley Cooper (1886–1940), American circus clown
Craig Cooper (disambiguation), multiple people
Curtis Cooper (disambiguation), multiple people
Cynthia Cooper (disambiguation), multiple people
Cyrus Cooper, rheumatologist
D
Daniel C. Cooper (1773–1818), early American surveyor and politician
D. B. Cooper, epithet for an unknown airline hijacker from 1971
D. C. Cooper (born 1965), American heavy metal singer
D. J. Cooper (born 1990), American basketball player in the Israeli Basketball Premier League
David Cooper (disambiguation), multiple people
Darren Cooper (died 2016), British Labour Party politician
Dennis Cooper (born 1953), American poet and writer
Dewey Cooper (born 1974), American kickboxer and boxer
Lady Diana Cooper (1892–1986), British actress
Dolores G. Cooper (1922–1999), American politician
Dominic Cooper (born 1978), British actor
Don Cooper (born 1957), American baseball player
Don Cooper, American curler
Douglas Cooper (disambiguation), multiple people
Duff Cooper (1890–1954), British politician and writer
E
Earl Cooper (1886–1965), American race car driver
Eddie Cooper (actor) (born 1987), British actor
Eddie Cooper (cricketer) (1915–1968), English cricketer
Edmund Cooper (1926–1982), English writer
Edward Cooper (disambiguation), multiple people
Edwin Cooper (1785–1833), English artist
Ethan Cooper, American football player
Elizabeth Cooper (died 1960), Filipino-American actress
Emma Lampert Cooper (1855–1920), American painter
Eric Cooper (1966–2019), American professional baseball umpire
Eric Thirkell Cooper, British soldier and war poet during World War 1
F
Frank Cooper (disambiguation), multiple people
Frederic Taber Cooper (1864–1937), American writer, editor and academic
Frederick Cooper (disambiguation), multiple people
G
G. Cooper (Surrey cricketer), English amateur cricketer
Gareth Cooper, Wales rugby union player
Garrett Cooper, American baseball player
Gary Cooper (disambiguation), multiple people
George Cooper (disambiguation), multiple people
Gladys Cooper (1888–1971), English actress
Gordon Cooper (1927–2004), American astronaut
Graham Cooper (cricketer) (1936–2012), English cricketer
Grant Cooper (born 1982), Spanish millionaire
Grey Cooper (1720–1801), English politician
H
Harry Cooper (disambiguation), multiple people
Helen Cooper (disambiguation), multiple people
Helene Cooper (born 1966), Liberian-American author and journalist
Henry Cooper (disambiguation), multiple people
Hugh Lincoln Cooper (1865–1937), American engineer
Humility Cooper, English passenger on the Mayflower
I
Ian Cooper (disambiguation), multiple people
Ivan Cooper (1944–2019), Northern Ireland politician
J
Jack Cooper (disambiguation), multiple people
Jackie Cooper (1922–2011), American actor
Jacqui Cooper (born 1973), Australian skier
Jade Holland Cooper (born 1986/1987), British fashion designer
James Cooper (disambiguation), multiple people
Jeanne Cooper (1928–2013), American actress
Jeff Cooper (disambiguation), multiple people
Jenny Cooper (born 1974), Canadian actress
Jenny Cooper (lawyer), corporate lawyer and Queen's Counsel from New Zealand
Jere Cooper (1893–1957), American politician
Jerry W. Cooper (1948–2020), American politician
Jessica Cooper (born 1967), British artist
Jessie Cooper (1914–1993), Australian politician
Jilly Cooper (born 1937), English novelist
Jim Cooper (disambiguation), multiple people
Jimmy Cooper (disambiguation), multiple people
Joan Cooper (social worker) (1914–1999), English civil servant and social worker
Job Adams Cooper (1843–1899), American politician
Joe Cooper (disambiguation), multiple people
John Cooper (disambiguation), multiple people
Johnny Cooper (disambiguation), multiple people
Jonathon Cooper (born 1998), American football player
Joseph Cooper (disambiguation), multiple people
Joshua Cooper (disambiguation), multiple people
Julie Cooper (disambiguation), multiple people
Justin Cooper (disambiguation), multiple people
Justine Cooper (disambiguation), multiple people
K
Kenneth H. Cooper (born 1931), American Air Force colonel, doctor and aerobics pioneer
Kenny Cooper (born 1984), American soccer player
Kenny Cooper Sr. (born 1946), former English soccer goalkeeper and coach
Kevin Cooper (disambiguation), multiple people
Kevon Cooper (born 1989), Trinidadian cricketer
Kitty Cooper, American bridge player
Korey Cooper (born 1972), American musician, member of Skillet
Kyle Cooper (born 1962), American designer of motion picture title sequences
Kyle Cooper (rugby union) (born 1989), South African rugby union player
L
Lamart Cooper (born 1973), American football player
Leigh Cooper (born 1961), English footballer
Leon Cooper (born 1930), American physicist
Les Cooper (1921–2013), American musician
Lettice Cooper (1897–1994), English writer
Levi Cooper – The Maggid of Melbourne, Australian Orthodox Jewish teacher
Lindsay Cooper (1951–2013), English musician (bassoon and oboe), composer and activist
Lindsay L. Cooper (1940–2001), Scottish musician (double-bass and cello)
Lionel Cooper, Australian rugby league player
Lionel Cooper (1915–1979), South African mathematician
Louise Cooper (1952–2009), British writer
M
MacDella Cooper (born 1977), Liberian philanthropist
Malcolm Cooper, British sport shooter
Malcolm Cooper (footballer), Aboriginal Australian footballer
Marc Cooper, American journalist and blogger
Marianne Leone Cooper (born 1952), American actress
Mark Cooper (disambiguation), multiple people
Marquis Cooper (1982–2009), American football player
Martha Cooper (born c. 1940), American photojournalist
Martin Cooper (disambiguation), multiple people
Matt Cooper (disambiguation), multiple people
Matthew Cooper (disambiguation), multiple people
Merian C. Cooper (1893–1973), American movie actor, director, screenwriter and producer
Michael Cooper (disambiguation), multiple people
Mike Cooper (disambiguation), multiple people
Milton William Cooper (1943–2001), American writer
Miranda Cooper (born 1975), British songwriter
Mort Cooper (1913–1958), American baseball player
Muriel Cooper (1925–1994), American artist and designer
Myers Y. Cooper (1873–1958), American politician
N
Nancy Cooper, American journalist, editor of Newsweek
Nathan Cooper (disambiguation), multiple people
Neale Cooper (born 1963), Scottish football manager
Nicholas Ashley-Cooper, 12th Earl of Shaftesbury (born 1979), Earl of Shaftesbury
P
Pat Cooper (1929–2023), American comedian
Paul Cooper (disambiguation), multiple people
Paulette Cooper (born 1944), American journalist
Peter Cooper (disambiguation), multiple people
Philip Cooper (1885–1950), English cricketer
Philip H. Cooper (1844–1912), American admiral
Priscilla Cooper Tyler (1816–1889), de facto First Lady of USA 1842–44
Q
Quade Cooper (born 1988), Australian rugby union player
R
Ray Cooper (born 1942), English musician
Revel Cooper (died 1983), Australian artist
Richard Cooper (disambiguation), multiple people
Riley Cooper (born 1987), US American Football player
Risteárd Cooper, Irish comedian
Robert Cooper (disambiguation), multiple people
Roger Cooper (born 1944), Minnesota politician
Roger Cooper (British businessman) (born 1935), jailed as spy in Iran
Roger Cooper (paleontologist) (1939–2020), New Zealand paleontologist
Rosa Cooper (1829–1877), English actress in Australia.
Rosie Cooper (born 1950), British politician
Roxanne Cooper, British singer
Roy Cooper (disambiguation), multiple people
Rusi Cooper (1922–2023), Indian cricketer
Russell Cooper (disambiguation), multiple people
S
Samuel Cooper (disambiguation), multiple people
Sarah Cooper (disambiguation), multiple people
Selina Cooper (1864–1946), English suffragist and politician
Shane Cooper (disambiguation), multiple people
Shani Cooper, Israeli diplomat
Sharife Cooper (born 2001), American basketball player
Shaun Cooper (born 1983), English footballer
Sherry Cooper, Canadian-American, Chief Economist of BMO Capital Markets
Sheryl Cooper (born c. 1957), dancer and stage performer, wife of rock singer Alice Cooper
(Thomas) Sidney Cooper (1803–1902), English painter
Simon Cooper (disambiguation), multiple people
Stoney Cooper (1918–1977), American country musician
Susan Cooper (disambiguation), multiple people
T
Tarzan Cooper (1907–1980), American basketball player
Terence Cooper (1933–1997), Northern Irish actor
Terry Cooper (disambiguation), multiple people
Terry Cooper (footballer, born 1944) (1944–2021), with Leeds United
Terry Cooper (footballer, born 1950), Welsh footballer with Lincoln City
Theodore Cooper (1839–1919), American engineer
Thomas Cooper (disambiguation), multiple people, including
Thomas Cooper (American politician, born 1759) (1759–1840), American educationalist and political philosopher in South Carolina
Thomas Cooper (American politician, born 1764) (1764–1829), U.S. congressman from Delaware
Thomas Cooper (bishop) (c. 1517–1594), English bishop of Lincoln and Winchester
Thomas Cooper (brewer) (1826–1897), founder of Coopers Brewery
Thomas Cooper (Parliamentarian) (died 1659), colonel in the Parliamentary Army and politician
Thomas Cooper (poet) (1805–1892), English poet and Chartist
Thomas Cooper de Leon (1839–1914), American journalist, author and playwright
Thomas Apthorpe Cooper (1776–1849), English actor
Thomas E. Cooper (born 1943), Assistant Secretary, U.S. Air Force
Thomas Edwin Cooper (1874–1942), English architect
Thomas Frederick Cooper, Tommy Cooper (1921–1984), British comedian and magician
Thomas Frederick Cooper (watchmaker) (1789–1863), English watchmaker
Thomas Haller Cooper (1919–1987), member of the British Free Corps and convicted traitor
Thomas Joshua Cooper (born 1946), American landscape photographer
Thomas Buchecker Cooper (1823–1862), U.S. congressman from Pennsylvania
Thomas Sidney Cooper (1803–1902), English painter
Thomas Thornville Cooper (1839–1878), English traveller in China
Thomas Valentine Cooper (1835–1909), American politician from Pennsylvania
Thomas Cooper, 1st Baron Cooper of Culross (1892–1955), Scottish politician, judge and historian
Tim Cooper (disambiguation), multiple people, including
Tim Cooper (brewer), managing director of Coopers Brewery
Tim Cooper (footballer), New Zealand international
Tina Cooper (1918–1986), English paediatrician
Tom Cooper (baseball) (1927–1985), American Negro league baseball player
Tom Cooper (cricketer) (born 1986), Netherlands and South Australia cricketer
Tom Cooper (cyclist) (1874–1906), American racing cyclist and early automobile driver
Tom Cooper (footballer) (1904–1940), England international footballer
Tom Cooper (rugby union) (born 1987), English rugby union player
Tommy Cooper (1921–1984), British magician and comedian
W
Walker Cooper (1915–1991), American baseball player
Warren Cooper (born 1933), New Zealand politician
Whina Cooper (1895–1994), New Zealand Māori leader
Wilbur Cooper (1892–1973), American baseball player
W. E. Shewell-Cooper (1900–1982), British organic gardener
Wilhelmina Cooper (1939–1980), American model
William Cooper (disambiguation), multiple people
Wilson Marion Cooper (died 1916), American Sacred Harp teacher
Wyatt Emory Cooper (1927–1978), American screenwriter
Wyllis Cooper (1899–1955), American radio writer
Y
Yvette Cooper (born 1969), British Labour Party politician and 2015 Labour leadership contender
Fictional characters
Alison Cooper, character from Ghosts 2019 TV series
Barbara Cooper, character from One Day at a Time (1975 TV series)
Betty Cooper, character from Archie Comics
Buzz Cooper, character from the soap opera Guiding Light
Dale Cooper, character from the TV show Twin Peaks
Gwen Cooper, character from the Doctor Who spinoff series Torchwood
Gwendolyn "Winnie" Cooper, character from The Wonder Years TV Series
Harriet Cooper, character from the 1966 Batman series
Kaitlin Cooper, character from the TV series The O.C.
Lauren Cooper, character in The Catherine Tate Show
Marina Cooper, character from the soap opera Guiding Light
Marissa Cooper, character from the TV series The O.C.
Mark Cooper, character from the TV series Hangin' with Mr. Cooper
Mike Cooper, character from the 2019 TV series Ghosts
Sheldon Cooper, character from the American TV sitcom The Big Bang Theory
Sly Cooper, character from the Sly Cooper video games
Tamia "Coop" Cooper, a character in the television series All American
Valerie "Val" Cooper, character from the Marvel Universe
K.C. Cooper and other members of her family, from K.C. Undercover
See also
Cooper (given name)
Cooper (disambiguation)
Justice Cooper (disambiguation)
Couper, a surname
Cowper (surname)
Kupper, a related surname of Germanic origin
Hooper (surname)
Coopes, a surname
Coops, a surname
Coope, a surname
Coop (surname)
Botero
Notes
English-language surnames
Occupational surnames
Surnames of English origin
Surnames of Liberian origin
English-language occupational surnames
Surnames of Romani origin
|
```c++
// (See accompanying file LICENSE_1_0.txt or copy at
// path_to_url
// This work is based on an earlier work:
// "Algorithm 910: A Portable C++ Multiple-Precision System for Special-Function Calculations",
// in ACM TOMS, {VOL 37, ISSUE 4, (February 2011)} (C) ACM, 2011. path_to_url
//
// This file has no include guards or namespaces - it's expanded inline inside default_ops.hpp
//
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable:6326) // comparison of two constants
#endif
namespace detail{
template<typename T, typename U>
inline void pow_imp(T& result, const T& t, const U& p, const mpl::false_&)
{
// Compute the pure power of typename T t^p.
// Use the S-and-X binary method, as described in
// D. E. Knuth, "The Art of Computer Programming", Vol. 2,
// Section 4.6.3 . The resulting computational complexity
// is order log2[abs(p)].
typedef typename boost::multiprecision::detail::canonical<U, T>::type int_type;
if(&result == &t)
{
T temp;
pow_imp(temp, t, p, mpl::false_());
result = temp;
return;
}
// This will store the result.
if(U(p % U(2)) != U(0))
{
result = t;
}
else
result = int_type(1);
U p2(p);
// The variable x stores the binary powers of t.
T x(t);
while(U(p2 /= 2) != U(0))
{
// Square x for each binary power.
eval_multiply(x, x);
const bool has_binary_power = (U(p2 % U(2)) != U(0));
if(has_binary_power)
{
// Multiply the result with each binary power contained in the exponent.
eval_multiply(result, x);
}
}
}
template<typename T, typename U>
inline void pow_imp(T& result, const T& t, const U& p, const mpl::true_&)
{
// Signed integer power, just take care of the sign then call the unsigned version:
typedef typename boost::multiprecision::detail::canonical<U, T>::type int_type;
typedef typename make_unsigned<U>::type ui_type;
if(p < 0)
{
T temp;
temp = static_cast<int_type>(1);
T denom;
pow_imp(denom, t, static_cast<ui_type>(-p), mpl::false_());
eval_divide(result, temp, denom);
return;
}
pow_imp(result, t, static_cast<ui_type>(p), mpl::false_());
}
} // namespace detail
template<typename T, typename U>
inline typename enable_if<is_integral<U> >::type eval_pow(T& result, const T& t, const U& p)
{
detail::pow_imp(result, t, p, boost::is_signed<U>());
}
template <class T>
void hyp0F0(T& H0F0, const T& x)
{
// Compute the series representation of Hypergeometric0F0 taken from
// path_to_url
// There are no checks on input range or parameter boundaries.
typedef typename mpl::front<typename T::unsigned_types>::type ui_type;
BOOST_ASSERT(&H0F0 != &x);
long tol = boost::multiprecision::detail::digits2<number<T, et_on> >::value();
T t;
T x_pow_n_div_n_fact(x);
eval_add(H0F0, x_pow_n_div_n_fact, ui_type(1));
T lim;
eval_ldexp(lim, H0F0, 1 - tol);
if(eval_get_sign(lim) < 0)
lim.negate();
ui_type n;
const unsigned series_limit =
boost::multiprecision::detail::digits2<number<T, et_on> >::value() < 100
? 100 : boost::multiprecision::detail::digits2<number<T, et_on> >::value();
// Series expansion of hyperg_0f0(; ; x).
for(n = 2; n < series_limit; ++n)
{
eval_multiply(x_pow_n_div_n_fact, x);
eval_divide(x_pow_n_div_n_fact, n);
eval_add(H0F0, x_pow_n_div_n_fact);
bool neg = eval_get_sign(x_pow_n_div_n_fact) < 0;
if(neg)
x_pow_n_div_n_fact.negate();
if(lim.compare(x_pow_n_div_n_fact) > 0)
break;
if(neg)
x_pow_n_div_n_fact.negate();
}
if(n >= series_limit)
BOOST_THROW_EXCEPTION(std::runtime_error("H0F0 failed to converge"));
}
template <class T>
void hyp1F0(T& H1F0, const T& a, const T& x)
{
// Compute the series representation of Hypergeometric1F0 taken from
// path_to_url
// and also see the corresponding section for the power function (i.e. x^a).
// There are no checks on input range or parameter boundaries.
typedef typename boost::multiprecision::detail::canonical<int, T>::type si_type;
BOOST_ASSERT(&H1F0 != &x);
BOOST_ASSERT(&H1F0 != &a);
T x_pow_n_div_n_fact(x);
T pochham_a (a);
T ap (a);
eval_multiply(H1F0, pochham_a, x_pow_n_div_n_fact);
eval_add(H1F0, si_type(1));
T lim;
eval_ldexp(lim, H1F0, 1 - boost::multiprecision::detail::digits2<number<T, et_on> >::value());
if(eval_get_sign(lim) < 0)
lim.negate();
si_type n;
T term, part;
const si_type series_limit =
boost::multiprecision::detail::digits2<number<T, et_on> >::value() < 100
? 100 : boost::multiprecision::detail::digits2<number<T, et_on> >::value();
// Series expansion of hyperg_1f0(a; ; x).
for(n = 2; n < series_limit; n++)
{
eval_multiply(x_pow_n_div_n_fact, x);
eval_divide(x_pow_n_div_n_fact, n);
eval_increment(ap);
eval_multiply(pochham_a, ap);
eval_multiply(term, pochham_a, x_pow_n_div_n_fact);
eval_add(H1F0, term);
if(eval_get_sign(term) < 0)
term.negate();
if(lim.compare(term) >= 0)
break;
}
if(n >= series_limit)
BOOST_THROW_EXCEPTION(std::runtime_error("H1F0 failed to converge"));
}
template <class T>
void eval_exp(T& result, const T& x)
{
BOOST_STATIC_ASSERT_MSG(number_category<T>::value == number_kind_floating_point, "The exp function is only valid for floating point types.");
if(&x == &result)
{
T temp;
eval_exp(temp, x);
result = temp;
return;
}
typedef typename boost::multiprecision::detail::canonical<unsigned, T>::type ui_type;
typedef typename boost::multiprecision::detail::canonical<int, T>::type si_type;
typedef typename T::exponent_type exp_type;
typedef typename boost::multiprecision::detail::canonical<exp_type, T>::type canonical_exp_type;
// Handle special arguments.
int type = eval_fpclassify(x);
bool isneg = eval_get_sign(x) < 0;
if(type == (int)FP_NAN)
{
result = x;
errno = EDOM;
return;
}
else if(type == (int)FP_INFINITE)
{
if(isneg)
result = ui_type(0u);
else
result = x;
return;
}
else if(type == (int)FP_ZERO)
{
result = ui_type(1);
return;
}
// Get local copy of argument and force it to be positive.
T xx = x;
T exp_series;
if(isneg)
xx.negate();
// Check the range of the argument.
if(xx.compare(si_type(1)) <= 0)
{
//
// Use series for exp(x) - 1:
//
T lim;
if(std::numeric_limits<number<T, et_on> >::is_specialized)
lim = std::numeric_limits<number<T, et_on> >::epsilon().backend();
else
{
result = ui_type(1);
eval_ldexp(lim, result, 1 - boost::multiprecision::detail::digits2<number<T, et_on> >::value());
}
unsigned k = 2;
exp_series = xx;
result = si_type(1);
if(isneg)
eval_subtract(result, exp_series);
else
eval_add(result, exp_series);
eval_multiply(exp_series, xx);
eval_divide(exp_series, ui_type(k));
eval_add(result, exp_series);
while(exp_series.compare(lim) > 0)
{
++k;
eval_multiply(exp_series, xx);
eval_divide(exp_series, ui_type(k));
if(isneg && (k&1))
eval_subtract(result, exp_series);
else
eval_add(result, exp_series);
}
return;
}
// Check for pure-integer arguments which can be either signed or unsigned.
typename boost::multiprecision::detail::canonical<boost::intmax_t, T>::type ll;
eval_trunc(exp_series, x);
eval_convert_to(&ll, exp_series);
if(x.compare(ll) == 0)
{
detail::pow_imp(result, get_constant_e<T>(), ll, mpl::true_());
return;
}
else if(exp_series.compare(x) == 0)
{
// We have a value that has no fractional part, but is too large to fit
// in a long long, in this situation the code below will fail, so
// we're just going to assume that this will overflow:
if(isneg)
result = ui_type(0);
else
result = std::numeric_limits<number<T> >::has_infinity ? std::numeric_limits<number<T> >::infinity().backend() : (std::numeric_limits<number<T> >::max)().backend();
return;
}
// The algorithm for exp has been taken from MPFUN.
// exp(t) = [ (1 + r + r^2/2! + r^3/3! + r^4/4! ...)^p2 ] * 2^n
// where p2 is a power of 2 such as 2048, r = t_prime / p2, and
// t_prime = t - n*ln2, with n chosen to minimize the absolute
// value of t_prime. In the resulting Taylor series, which is
// implemented as a hypergeometric function, |r| is bounded by
// ln2 / p2. For small arguments, no scaling is done.
// Compute the exponential series of the (possibly) scaled argument.
eval_divide(result, xx, get_constant_ln2<T>());
exp_type n;
eval_convert_to(&n, result);
if (n == (std::numeric_limits<exp_type>::max)())
{
// Exponent is too large to fit in our exponent type:
if (isneg)
result = ui_type(0);
else
result = std::numeric_limits<number<T> >::has_infinity ? std::numeric_limits<number<T> >::infinity().backend() : (std::numeric_limits<number<T> >::max)().backend();
return;
}
// The scaling is 2^11 = 2048.
const si_type p2 = static_cast<si_type>(si_type(1) << 11);
eval_multiply(exp_series, get_constant_ln2<T>(), static_cast<canonical_exp_type>(n));
eval_subtract(exp_series, xx);
eval_divide(exp_series, p2);
exp_series.negate();
hyp0F0(result, exp_series);
detail::pow_imp(exp_series, result, p2, mpl::true_());
result = ui_type(1);
eval_ldexp(result, result, n);
eval_multiply(exp_series, result);
if(isneg)
eval_divide(result, ui_type(1), exp_series);
else
result = exp_series;
}
template <class T>
void eval_log(T& result, const T& arg)
{
BOOST_STATIC_ASSERT_MSG(number_category<T>::value == number_kind_floating_point, "The log function is only valid for floating point types.");
//
// We use a variation of path_to_url#i
// using frexp to reduce the argument to x * 2^n,
// then let y = x - 1 and compute:
// log(x) = log(2) * n + log1p(1 + y)
//
typedef typename boost::multiprecision::detail::canonical<unsigned, T>::type ui_type;
typedef typename T::exponent_type exp_type;
typedef typename boost::multiprecision::detail::canonical<exp_type, T>::type canonical_exp_type;
typedef typename mpl::front<typename T::float_types>::type fp_type;
int s = eval_signbit(arg);
switch(eval_fpclassify(arg))
{
case FP_NAN:
result = arg;
errno = EDOM;
return;
case FP_INFINITE:
if(s) break;
result = arg;
return;
case FP_ZERO:
result = std::numeric_limits<number<T> >::has_infinity ? std::numeric_limits<number<T> >::infinity().backend() : (std::numeric_limits<number<T> >::max)().backend();
result.negate();
errno = ERANGE;
return;
}
if(s)
{
result = std::numeric_limits<number<T> >::quiet_NaN().backend();
errno = EDOM;
return;
}
exp_type e;
T t;
eval_frexp(t, arg, &e);
bool alternate = false;
if(t.compare(fp_type(2) / fp_type(3)) <= 0)
{
alternate = true;
eval_ldexp(t, t, 1);
--e;
}
eval_multiply(result, get_constant_ln2<T>(), canonical_exp_type(e));
INSTRUMENT_BACKEND(result);
eval_subtract(t, ui_type(1)); /* -0.3 <= t <= 0.3 */
if(!alternate)
t.negate(); /* 0 <= t <= 0.33333 */
T pow = t;
T lim;
T t2;
if(alternate)
eval_add(result, t);
else
eval_subtract(result, t);
if(std::numeric_limits<number<T, et_on> >::is_specialized)
eval_multiply(lim, result, std::numeric_limits<number<T, et_on> >::epsilon().backend());
else
eval_ldexp(lim, result, 1 - boost::multiprecision::detail::digits2<number<T, et_on> >::value());
if(eval_get_sign(lim) < 0)
lim.negate();
INSTRUMENT_BACKEND(lim);
ui_type k = 1;
do
{
++k;
eval_multiply(pow, t);
eval_divide(t2, pow, k);
INSTRUMENT_BACKEND(t2);
if(alternate && ((k & 1) != 0))
eval_add(result, t2);
else
eval_subtract(result, t2);
INSTRUMENT_BACKEND(result);
}while(lim.compare(t2) < 0);
}
template <class T>
const T& get_constant_log10()
{
static BOOST_MP_THREAD_LOCAL T result;
static BOOST_MP_THREAD_LOCAL bool b = false;
static BOOST_MP_THREAD_LOCAL long digits = boost::multiprecision::detail::digits2<number<T> >::value();
if(!b || (digits != boost::multiprecision::detail::digits2<number<T> >::value()))
{
typedef typename boost::multiprecision::detail::canonical<unsigned, T>::type ui_type;
T ten;
ten = ui_type(10u);
eval_log(result, ten);
b = true;
digits = boost::multiprecision::detail::digits2<number<T> >::value();
}
constant_initializer<T, &get_constant_log10<T> >::do_nothing();
return result;
}
template <class T>
void eval_log10(T& result, const T& arg)
{
BOOST_STATIC_ASSERT_MSG(number_category<T>::value == number_kind_floating_point, "The log10 function is only valid for floating point types.");
eval_log(result, arg);
eval_divide(result, get_constant_log10<T>());
}
template <class R, class T>
inline void eval_log2(R& result, const T& a)
{
eval_log(result, a);
eval_divide(result, get_constant_ln2<R>());
}
template<typename T>
inline void eval_pow(T& result, const T& x, const T& a)
{
BOOST_STATIC_ASSERT_MSG(number_category<T>::value == number_kind_floating_point, "The pow function is only valid for floating point types.");
typedef typename boost::multiprecision::detail::canonical<int, T>::type si_type;
typedef typename mpl::front<typename T::float_types>::type fp_type;
if((&result == &x) || (&result == &a))
{
T t;
eval_pow(t, x, a);
result = t;
return;
}
if((a.compare(si_type(1)) == 0) || (x.compare(si_type(1)) == 0))
{
result = x;
return;
}
if(a.compare(si_type(0)) == 0)
{
result = si_type(1);
return;
}
int type = eval_fpclassify(x);
switch(type)
{
case FP_ZERO:
switch(eval_fpclassify(a))
{
case FP_ZERO:
result = si_type(1);
break;
case FP_NAN:
result = a;
break;
case FP_NORMAL:
{
// Need to check for a an odd integer as a special case:
try
{
typename boost::multiprecision::detail::canonical<boost::intmax_t, T>::type i;
eval_convert_to(&i, a);
if(a.compare(i) == 0)
{
if(eval_signbit(a))
{
if(i & 1)
{
result = std::numeric_limits<number<T> >::infinity().backend();
if(eval_signbit(x))
result.negate();
errno = ERANGE;
}
else
{
result = std::numeric_limits<number<T> >::infinity().backend();
errno = ERANGE;
}
}
else if(i & 1)
{
result = x;
}
else
result = si_type(0);
return;
}
}
catch(const std::exception&)
{
// fallthrough..
}
}
default:
if(eval_signbit(a))
{
result = std::numeric_limits<number<T> >::infinity().backend();
errno = ERANGE;
}
else
result = x;
break;
}
return;
case FP_NAN:
result = x;
errno = ERANGE;
return;
default: ;
}
int s = eval_get_sign(a);
if(s == 0)
{
result = si_type(1);
return;
}
if(s < 0)
{
T t, da;
t = a;
t.negate();
eval_pow(da, x, t);
eval_divide(result, si_type(1), da);
return;
}
typename boost::multiprecision::detail::canonical<boost::intmax_t, T>::type an;
typename boost::multiprecision::detail::canonical<boost::intmax_t, T>::type max_an =
std::numeric_limits<typename boost::multiprecision::detail::canonical<boost::intmax_t, T>::type>::is_specialized ?
(std::numeric_limits<typename boost::multiprecision::detail::canonical<boost::intmax_t, T>::type>::max)() :
static_cast<typename boost::multiprecision::detail::canonical<boost::intmax_t, T>::type>(1) << (sizeof(typename boost::multiprecision::detail::canonical<boost::intmax_t, T>::type) * CHAR_BIT - 2);
typename boost::multiprecision::detail::canonical<boost::intmax_t, T>::type min_an =
std::numeric_limits<typename boost::multiprecision::detail::canonical<boost::intmax_t, T>::type>::is_specialized ?
(std::numeric_limits<typename boost::multiprecision::detail::canonical<boost::intmax_t, T>::type>::min)() :
-min_an;
T fa;
#ifndef BOOST_NO_EXCEPTIONS
try
{
#endif
eval_convert_to(&an, a);
if(a.compare(an) == 0)
{
detail::pow_imp(result, x, an, mpl::true_());
return;
}
#ifndef BOOST_NO_EXCEPTIONS
}
catch(const std::exception&)
{
// conversion failed, just fall through, value is not an integer.
an = (std::numeric_limits<boost::intmax_t>::max)();
}
#endif
if((eval_get_sign(x) < 0))
{
typename boost::multiprecision::detail::canonical<boost::uintmax_t, T>::type aun;
#ifndef BOOST_NO_EXCEPTIONS
try
{
#endif
eval_convert_to(&aun, a);
if(a.compare(aun) == 0)
{
fa = x;
fa.negate();
eval_pow(result, fa, a);
if(aun & 1u)
result.negate();
return;
}
#ifndef BOOST_NO_EXCEPTIONS
}
catch(const std::exception&)
{
// conversion failed, just fall through, value is not an integer.
}
#endif
eval_floor(result, a);
// -1^INF is a special case in C99:
if((x.compare(si_type(-1)) == 0) && (eval_fpclassify(a) == FP_INFINITE))
{
result = si_type(1);
}
else if(a.compare(result) == 0)
{
// exponent is so large we have no fractional part:
if(x.compare(si_type(-1)) < 0)
{
result = std::numeric_limits<number<T, et_on> >::infinity().backend();
}
else
{
result = si_type(0);
}
}
else if(type == FP_INFINITE)
{
result = std::numeric_limits<number<T, et_on> >::infinity().backend();
}
else if(std::numeric_limits<number<T, et_on> >::has_quiet_NaN)
{
result = std::numeric_limits<number<T, et_on> >::quiet_NaN().backend();
errno = EDOM;
}
else
{
BOOST_THROW_EXCEPTION(std::domain_error("Result of pow is undefined or non-real and there is no NaN for this number type."));
}
return;
}
T t, da;
eval_subtract(da, a, an);
if((x.compare(fp_type(0.5)) >= 0) && (x.compare(fp_type(0.9)) < 0) && (an < max_an) && (an > min_an))
{
if(a.compare(fp_type(1e-5f)) <= 0)
{
// Series expansion for small a.
eval_log(t, x);
eval_multiply(t, a);
hyp0F0(result, t);
return;
}
else
{
// Series expansion for moderately sized x. Note that for large power of a,
// the power of the integer part of a is calculated using the pown function.
if(an)
{
da.negate();
t = si_type(1);
eval_subtract(t, x);
hyp1F0(result, da, t);
detail::pow_imp(t, x, an, mpl::true_());
eval_multiply(result, t);
}
else
{
da = a;
da.negate();
t = si_type(1);
eval_subtract(t, x);
hyp1F0(result, da, t);
}
}
}
else
{
// Series expansion for pow(x, a). Note that for large power of a, the power
// of the integer part of a is calculated using the pown function.
if(an)
{
eval_log(t, x);
eval_multiply(t, da);
eval_exp(result, t);
detail::pow_imp(t, x, an, mpl::true_());
eval_multiply(result, t);
}
else
{
eval_log(t, x);
eval_multiply(t, a);
eval_exp(result, t);
}
}
}
template<class T, class A>
inline typename enable_if<is_floating_point<A>, void>::type eval_pow(T& result, const T& x, const A& a)
{
// Note this one is restricted to float arguments since pow.hpp already has a version for
// integer powers....
typedef typename boost::multiprecision::detail::canonical<A, T>::type canonical_type;
typedef typename mpl::if_<is_same<A, canonical_type>, T, canonical_type>::type cast_type;
cast_type c;
c = a;
eval_pow(result, x, c);
}
template<class T, class A>
inline typename enable_if<is_arithmetic<A>, void>::type eval_pow(T& result, const A& x, const T& a)
{
typedef typename boost::multiprecision::detail::canonical<A, T>::type canonical_type;
typedef typename mpl::if_<is_same<A, canonical_type>, T, canonical_type>::type cast_type;
cast_type c;
c = x;
eval_pow(result, c, a);
}
template <class T>
void eval_exp2(T& result, const T& arg)
{
BOOST_STATIC_ASSERT_MSG(number_category<T>::value == number_kind_floating_point, "The log function is only valid for floating point types.");
// Check for pure-integer arguments which can be either signed or unsigned.
typename boost::multiprecision::detail::canonical<typename T::exponent_type, T>::type i;
T temp;
try {
eval_trunc(temp, arg);
eval_convert_to(&i, temp);
if(arg.compare(i) == 0)
{
temp = static_cast<typename mpl::front<typename T::unsigned_types>::type>(1u);
eval_ldexp(result, temp, i);
return;
}
}
catch(const boost::math::rounding_error&)
{ /* Fallthrough */ }
catch(const std::runtime_error&)
{ /* Fallthrough */ }
temp = static_cast<typename mpl::front<typename T::unsigned_types>::type>(2u);
eval_pow(result, temp, arg);
}
namespace detail{
template <class T>
void small_sinh_series(T x, T& result)
{
typedef typename boost::multiprecision::detail::canonical<unsigned, T>::type ui_type;
bool neg = eval_get_sign(x) < 0;
if(neg)
x.negate();
T p(x);
T mult(x);
eval_multiply(mult, x);
result = x;
ui_type k = 1;
T lim(x);
eval_ldexp(lim, lim, 1 - boost::multiprecision::detail::digits2<number<T, et_on> >::value());
do
{
eval_multiply(p, mult);
eval_divide(p, ++k);
eval_divide(p, ++k);
eval_add(result, p);
}while(p.compare(lim) >= 0);
if(neg)
result.negate();
}
template <class T>
void sinhcosh(const T& x, T* p_sinh, T* p_cosh)
{
typedef typename boost::multiprecision::detail::canonical<unsigned, T>::type ui_type;
typedef typename mpl::front<typename T::float_types>::type fp_type;
switch(eval_fpclassify(x))
{
case FP_NAN:
errno = EDOM;
// fallthrough...
case FP_INFINITE:
if(p_sinh)
*p_sinh = x;
if(p_cosh)
{
*p_cosh = x;
if(eval_get_sign(x) < 0)
p_cosh->negate();
}
return;
case FP_ZERO:
if(p_sinh)
*p_sinh = x;
if(p_cosh)
*p_cosh = ui_type(1);
return;
default: ;
}
bool small_sinh = eval_get_sign(x) < 0 ? x.compare(fp_type(-0.5)) > 0 : x.compare(fp_type(0.5)) < 0;
if(p_cosh || !small_sinh)
{
T e_px, e_mx;
eval_exp(e_px, x);
eval_divide(e_mx, ui_type(1), e_px);
if(eval_signbit(e_mx) != eval_signbit(e_px))
e_mx.negate(); // Handles lack of signed zero in some types
if(p_sinh)
{
if(small_sinh)
{
small_sinh_series(x, *p_sinh);
}
else
{
eval_subtract(*p_sinh, e_px, e_mx);
eval_ldexp(*p_sinh, *p_sinh, -1);
}
}
if(p_cosh)
{
eval_add(*p_cosh, e_px, e_mx);
eval_ldexp(*p_cosh, *p_cosh, -1);
}
}
else
{
small_sinh_series(x, *p_sinh);
}
}
} // namespace detail
template <class T>
inline void eval_sinh(T& result, const T& x)
{
BOOST_STATIC_ASSERT_MSG(number_category<T>::value == number_kind_floating_point, "The sinh function is only valid for floating point types.");
detail::sinhcosh(x, &result, static_cast<T*>(0));
}
template <class T>
inline void eval_cosh(T& result, const T& x)
{
BOOST_STATIC_ASSERT_MSG(number_category<T>::value == number_kind_floating_point, "The cosh function is only valid for floating point types.");
detail::sinhcosh(x, static_cast<T*>(0), &result);
}
template <class T>
inline void eval_tanh(T& result, const T& x)
{
BOOST_STATIC_ASSERT_MSG(number_category<T>::value == number_kind_floating_point, "The tanh function is only valid for floating point types.");
T c;
detail::sinhcosh(x, &result, &c);
if((eval_fpclassify(result) == FP_INFINITE) && (eval_fpclassify(c) == FP_INFINITE))
{
bool s = eval_signbit(result) != eval_signbit(c);
result = static_cast<typename mpl::front<typename T::unsigned_types>::type>(1u);
if(s)
result.negate();
return;
}
eval_divide(result, c);
}
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
```
|
Eozenillia is a genus of flies in the family Tachinidae.The larvae of Eozenillia equatorialis are known to be parasitoids of Mahasena corbetti.
Species
Eozenillia equatorialis Townsend, 1926
Eozenillia psychidarum (Baranov, 1934)
Eozenillia remota (Walker, 1853)
References
Tachinidae
Brachycera genera
Taxa named by Charles Henry Tyler Townsend
Diptera of Asia
Diptera of Australasia
|
YouTorrent was a BitTorrent search engine which allowed parallel searches on different torrent search engines.
As of April 14, 2008, YouTorrent changed from searching all torrent sites to only sites which provide licensed, certified content. This change angered many users and caused most of them to leave the site.
As of 4 April 2013, YouTorrent shut down its services stating "The stigmatisation of the word torrent proved a hurdle that was too hard to overcome when trying to build a legitimate and legal platform." and introduced a new platform called Clowdy. Clowdy is a platform with music, film and photography in the one place.
History
The YouTorrent.com domain was bought for $20,000. It originally searched torrents on The Pirate Bay.
References
External links
YouTorrent site
Techcrunch - YouTorrent: Give It A Shot Before It’s Shut Down
Defunct BitTorrent websites
|
```xml
// @ts-ignore
import { GeoMapDefaultProps, ChoroplethDefaultProps } from '@nivo/geo'
import { getLegendsProps, groupProperties } from '../../../lib/componentProperties'
import { props as geoProps } from '../geo/props'
import { ChartProperty } from '../../../types'
const props: ChartProperty[] = [
...geoProps,
{
key: 'label',
group: 'Base',
type: 'string | Function',
required: false,
flavors: ['svg', 'canvas'],
help: 'Label accessor.',
description: `
Accessor to label, if a string is provided,
the value will be retrieved using it as
a key, if it's a function, it's its responsibility
to return the label.
`,
defaultValue: ChoroplethDefaultProps.label,
},
{
key: 'value',
group: 'Base',
type: 'string | Function',
required: false,
flavors: ['svg', 'canvas'],
help: 'Value accessor.',
description: `
Accessor to data value, if a string is provided,
the value will be retrieved using
it as a key, if it's a function, it's its responsibility
to return the value.
`,
defaultValue: ChoroplethDefaultProps.value,
},
{
key: 'valueFormat',
group: 'Base',
type: 'string | Function',
required: false,
flavors: ['svg', 'canvas'],
help: 'Value formatter.',
description: `
Optional formatting of values, if provided, it will
be used for labels/tooltips. You can either pass
a function which will receive the node's data
and must return the formatted value, or a string
which will be used as a directive for
[d3-format](path_to_url
`,
defaultValue: ChoroplethDefaultProps.value,
},
{
key: 'domain',
help: 'Defines uppper and lower bounds of color shading',
description: `
The Domain prop is a required two element array that
defines the minimum and maximum values for the color shading
of the Choropleth. The minimum and maximum provided should
roughly match, or be slightly outside of the minimum and
maximum values in your data.
`,
type: 'number[]',
required: true,
flavors: ['svg', 'canvas'],
group: 'Base',
},
{
key: 'colors',
group: 'Style',
help: 'Defines color range.',
type: 'string | Function | string[]',
required: false,
flavors: ['svg', 'canvas'],
defaultValue: 'nivo',
control: { type: 'quantizeColors' },
},
{
key: 'unknownColor',
group: 'Style',
help: 'Defines the color to use for features without value.',
type: 'string',
required: false,
flavors: ['svg', 'canvas'],
defaultValue: 'nivo',
control: { type: 'colorPicker' },
},
{
key: 'layers',
group: 'Customization',
type: `Array<'graticule' | 'features' | Function>`,
required: false,
flavors: ['svg', 'canvas'],
help: 'Defines the order of layers.',
description: `
Defines the order of layers, available layers are:
\`graticule\`, \`features\`.
You can also use this to insert extra layers
to the chart, this extra layer must be
a function which will receive the chart
computed data and must return a valid SVG
element for the SVG implementation or receive
a Canvas 2d context for the canvas
one. Custom layers will also receive the
computed data/projection.
`,
defaultValue: GeoMapDefaultProps.layers,
},
{
key: 'tooltip',
group: 'Interactivity',
type: 'Function',
required: false,
flavors: ['svg', 'canvas'],
help: 'Custom tooltip component.',
description: `
A function allowing complete tooltip customisation,
it must return a valid HTML
element and will receive the node's data.
`,
},
{
key: 'custom tooltip example',
group: 'Interactivity',
excludeFromDoc: true,
required: false,
help: 'Showcase custom tooltip.',
type: 'boolean',
flavors: ['svg', 'canvas'],
control: { type: 'switch' },
},
{
key: 'legends',
type: '{Array<object>}',
help: `Optional chart's legends.`,
group: 'Legends',
flavors: ['svg', 'canvas'],
required: false,
control: {
type: 'array',
props: getLegendsProps(['svg', 'canvas']),
shouldCreate: true,
addLabel: 'add legend',
shouldRemove: true,
defaults: {
anchor: 'center',
direction: 'column',
justify: false,
translateX: 0,
translateY: 0,
itemWidth: 100,
itemHeight: 20,
itemsSpacing: 4,
symbolSize: 20,
itemDirection: 'left-to-right',
itemTextColor: '#777',
onClick: (data: any) => {
console.log(JSON.stringify(data, null, ' '))
},
effects: [
{
on: 'hover',
style: {
itemTextColor: '#000',
itemBackground: '#f7fafb',
},
},
],
},
},
},
]
export const groups = groupProperties(props)
```
|
Jeffrey Lewis is an American expert in nuclear nonproliferation and geopolitics, currently a professor at the James Martin Center for Nonproliferation Studies (otherwise known as the CNS) at the Middlebury Institute of International Studies at Monterey, and director of the CNS East Asia Nonproliferation Program. He has written two books on China's nuclear weapons, and numerous journal and magazine articles, blog posts, and podcasts on nonproliferation and related topics.
Since 2004 Lewis has run the blog site Arms Control Wonk, later hosting a podcast by the same name with Aaron Stein.
Lewis has been cited as an expert on nuclear programs of China, North Korea, Iran, Pakistan, and South Africa in the media.
His research interests have also included open-source intelligence, using and promoting the use of analysis of satellite images, photography, and other information sources to understand events and issues in proliferation and related topics.
Education
Lewis received a PhD in Policy Studies from the University of Maryland and a B.A. in Philosophy and Political Science from Augustana College.
Research and policy work
From 2007 to 2010, Lewis directed the Nuclear Strategy and Nonproliferation Initiative at the New America Foundation. From 2006 to 2007, he was Executive Director of the Managing the Atom Project at the Belfer Center for Science and International Affairs at Harvard University.
Since 2010, Lewis has been the Director of the East Asia Nonproliferation Program at the James Martin Center for Nonproliferation Studies at MIIS in Monterey, California, and an adjunct professor at MIIS. Research topics have included nuclear proliferation and weapons programs of China, North Korea, Iran, and other states, and open-source intelligence performed by the policy community itself (see for example Eliot Higgins).
He has worked with graduate students and MIIS and other researchers to develop tools and provide training on tools and technology for open source intelligence.
He is also an affiliate with the Stanford University Center for International Security and Cooperation.
North Korea
Lewis has extensively written and spoken, including for media reports, on the weapons tests, development program, and missile programs of North Korea, a country covered by the East Asia Nonproliferation Program.
Lewis has written specifically about North Korea's nuclear materials production; weapons design choices (including nuclear weapon size/miniaturization and use of fissile uranium or plutonium in warheads); missiles and the North Korean space program; North Korea's missile press coverage, propaganda, and misinformation. He makes frequent use of open source intelligence from satellite and press/propaganda images and stories.
On April 27, 2017, Lewis dismissed the notion, promoted by Peter Vincent Pry and others, that North Korea could seriously harm the United States with an EMP weapon.
China
One of the countries covered by the East Asia Nonproliferation Program, China has been a focus for Lewis, including his two books and monograph. His books Paper Tigers: China's Nuclear Posture (2014) and The Minimum Means of Reprisal: China's Search for Security in the Nuclear Age (2007) examine China's nuclear weapons and missiles policies. He wrote, podcasted, and was cited in mainstream press coverage in 2015 rebutting claims that China's adding MIRVs to its larger missiles was a dangerous escalation, arguing instead that it was a natural evolution for the Chinese older, larger missile force. He has also studied and written about China's nuclear program as it relates to other powers such as India.
Lewis has also written on China's conventional weapons program, including antiship and conventional ballistic missile programs and their testing of a hypervelocity weapon system.
Publications
Books
The 2020 Commission Report on the North Korean Nuclear Attacks Against the United States: A Speculative Novel – Mariner Books (2018) –
Paper Tigers: China's Nuclear Posture – Adelphi Series – Routledge (2014) –
The Minimum Means of Reprisal: China's Search for Security in the Nuclear Age – MIT Press (2007) –
Monographs
A Place for One's Mat: China's Space Program, 1956–2003 (with Gregory Kulacki), American Academy of Arts and Sciences Occasional Paper (July 2009).
Journals
Lewis has written for Bulletin of the Atomic Scientists, Foreign Policy magazine, Jane's Intelligence Review, Nonproliferation Review and New Scientist among other journals.
Blogs and online journals
Lewis is the publisher of Arms Control Wonk blog. He additionally contributes to Foreign Policy – ForeignPolicy.com columnist since 2013., and to 38 North, an online journal on published by the US-Korea Institute at the Paul H. Nitze School of Advanced International Studies at Johns Hopkins University.
References
External links
armscontrolwonk.com
Middlebury College faculty
Living people
Augustana College (Illinois) alumni
Year of birth missing (living people)
|
Sir Robert Holt Leigh, 1st Baronet (1762–1843) was a British Member of Parliament.
Early life
He was born on 25 December 1762, the eldest son of Holt and Mary Leigh née Owen. He had a younger brother, Roger, and a sister; Roger pre-deceased him, dying from injuries sustained in violence ahead of the election on 4 May 1831
Leigh was educated at Manchester Grammar School, and matriculated in 1781 at Christ Church, Oxford. He was much later granted a B.A. degree by Oxford, in 1837, and an M.A. in 1838. He is described by the National Archives as a classical scholar, widely travelled and a cultivated man, versed in Greek literature. He lived at Whitley Hall until 1811 when he moved to Hindley Hall after rebuilding it. He sought advice from his sister during the rebuilding process but neglected to plan for staircases in the three storied building.
Later life
Leigh was appointed Captain-Commandant of the Wigan Volunteer Association on 17 May 1798. He trained as a barrister, and then was returned unopposed to Parliament for the Borough of Wigan on 8 July 1802, a seat he kept until retiring in 1820. After the 1812 election he was listed as one of George Canning’s 11 personal followers returned to the new Parliament. Canning nominated Leigh as one of the men whom he wanted to offer a baronetcy. The Leigh Baronetcy, of Whitley in the County of Lancaster, was created in the Baronetage of the United Kingdom on 27 December 1814 for Robert Holt Leigh.
In 1830 Leigh was one of the initial proprietors of the Wigan Branch Railway. He was a feoffees (or governor) of the Manchester free school in the 1830s. By this time the school was getting richer on the proceeds of the mills which provided its funding and had a growing surplus on account. Its feoffees were heavily criticised for running the school to suit the needs of their offspring rather than as originally intended, the poor of Manchester. This led to a long running suit at the Court of Chancery, which eventually promoted the commercial side at the expense of the classical side of the school.
In his later years, Leigh had a notorious affair with Sarah Yates, the wife of one of his tenant farmers. He died unmarried on 21 January 1843, leaving a life interest in his estates to Thomas Pemberton (son of his cousin Margaret Leigh), who assumed the additional surname of Leigh and who was subsequently raised to the peerage in his own right as Baron Kingsdown. The reversion of his estates, after Baron Kingsdown died, together with the interest on £20,000, was left to Sarah Yates's son Roger Leigh, whom Sir Robert adopted, as long as he remained a member of the Church of England.
Notes
References
1762 births
1843 deaths
Baronets in the Baronetage of the United Kingdom
Members of the Parliament of the United Kingdom for Wigan
UK MPs 1802–1806
UK MPs 1806–1807
UK MPs 1807–1812
UK MPs 1812–1818
UK MPs 1818–1820
|
```dart
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:http_parser/http_parser.dart';
import '../core/core.dart';
import 'http_request_context.dart';
/// An implementation of [ResponseContext] that abstracts over an [HttpResponse].
class HttpResponseContext extends ResponseContext<HttpResponse> {
/// The underlying [HttpResponse] under this instance.
@override
final HttpResponse rawResponse;
Angel app;
LockableBytesBuilder _buffer;
final HttpRequestContext _correspondingRequest;
bool _isDetached = false, _isClosed = false, _streamInitialized = false;
HttpResponseContext(this.rawResponse, this.app, [this._correspondingRequest]);
@override
HttpResponse detach() {
_isDetached = true;
return rawResponse;
}
@override
RequestContext get correspondingRequest {
return _correspondingRequest;
}
@override
bool get isOpen {
return !_isClosed && !_isDetached;
}
@override
bool get isBuffered => _buffer != null;
@override
BytesBuilder get buffer => _buffer;
@override
void addError(Object error, [StackTrace stackTrace]) {
rawResponse.addError(error, stackTrace);
super.addError(error, stackTrace);
}
@override
void useBuffer() {
_buffer = LockableBytesBuilder();
}
Iterable<String> __allowedEncodings;
Iterable<String> get _allowedEncodings {
return __allowedEncodings ??= correspondingRequest.headers
.value('accept-encoding')
?.split(',')
?.map((s) => s.trim())
?.where((s) => s.isNotEmpty)
?.map((str) {
// Ignore quality specifications in accept-encoding
// ex. gzip;q=0.8
if (!str.contains(';')) return str;
return str.split(';')[0];
});
}
@override
set contentType(MediaType value) {
super.contentType = value;
if (!_streamInitialized) {
rawResponse.headers.contentType =
ContentType(value.type, value.subtype, parameters: value.parameters);
}
}
bool _openStream() {
if (!_streamInitialized) {
// If this is the first stream added to this response,
// then add headers, status code, etc.
rawResponse
..statusCode = statusCode
..cookies.addAll(cookies);
headers.forEach(rawResponse.headers.set);
if (headers.containsKey('content-length')) {
rawResponse.contentLength = int.tryParse(headers['content-length']) ??
rawResponse.contentLength;
}
rawResponse.headers.contentType = ContentType(
contentType.type, contentType.subtype,
charset: contentType.parameters['charset'],
parameters: contentType.parameters);
if (encoders.isNotEmpty && correspondingRequest != null) {
if (_allowedEncodings != null) {
for (var encodingName in _allowedEncodings) {
Converter<List<int>, List<int>> encoder;
String key = encodingName;
if (encoders.containsKey(encodingName)) {
encoder = encoders[encodingName];
} else if (encodingName == '*') {
encoder = encoders[key = encoders.keys.first];
}
if (encoder != null) {
rawResponse.headers.set('content-encoding', key);
break;
}
}
}
}
//_isClosed = true;
return _streamInitialized = true;
}
return false;
}
@override
Future addStream(Stream<List<int>> stream) {
if (_isClosed && isBuffered) throw ResponseContext.closed();
_openStream();
Stream<List<int>> output = stream;
if (encoders.isNotEmpty && correspondingRequest != null) {
if (_allowedEncodings != null) {
for (var encodingName in _allowedEncodings) {
Converter<List<int>, List<int>> encoder;
String key = encodingName;
if (encoders.containsKey(encodingName)) {
encoder = encoders[encodingName];
} else if (encodingName == '*') {
encoder = encoders[key = encoders.keys.first];
}
if (encoder != null) {
output = encoders[key].bind(output);
break;
}
}
}
}
return rawResponse.addStream(output);
}
@override
void add(List<int> data) {
if (_isClosed && isBuffered) {
throw ResponseContext.closed();
} else if (!isBuffered) {
if (!_isClosed) {
_openStream();
if (encoders.isNotEmpty && correspondingRequest != null) {
if (_allowedEncodings != null) {
for (var encodingName in _allowedEncodings) {
Converter<List<int>, List<int>> encoder;
String key = encodingName;
if (encoders.containsKey(encodingName)) {
encoder = encoders[encodingName];
} else if (encodingName == '*') {
encoder = encoders[key = encoders.keys.first];
}
if (encoder != null) {
data = encoders[key].convert(data);
break;
}
}
}
}
rawResponse.add(data);
}
} else {
buffer.add(data);
}
}
@override
Future close() {
if (!_isDetached) {
if (!_isClosed) {
if (!isBuffered) {
try {
_openStream();
rawResponse.close();
} catch (_) {
// This only seems to occur on `MockHttpRequest`, but
// this try/catch prevents a crash.
}
} else {
_buffer.lock();
}
_isClosed = true;
}
super.close();
}
return Future.value();
}
}
```
|
```objective-c
/*
* 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
*/
#ifndef GUACENC_WEBP_H
#define GUACENC_WEBP_H
#include "config.h"
#include "image-stream.h"
/**
* Decoder implementation which handles "image/webp" images.
*/
guacenc_decoder guacenc_webp_decoder;
#endif
```
|
Storflaket is a permafrost plateau peat bog on the southern shore of Torneträsk lake, in northern Sweden. Storflaket together with Stordalen is one of the main sites of studying palsas and methane emissions in Scandinavia. The bog received its name, Storflaket, due to its relatively large extent and flat surface during the buildings works of Malmbanan railroad in early 20th century.
See also
Abisko Scientific Research Station
Stordalen
Kiruna
Bogs of Sweden
Palsas
Patterned grounds
Landforms of Norrbotten County
|
```css
Make text unselectable
Use `box-sizing` to define an element's `width` and `height` properties
Use pseudo-classes to describe a special state of an element
Use `border-radius` to style rounded corners of an element
Autohiding scrollbars for **IE**
```
|
This glossary of industrial automation is a list of definitions of terms and illustrations related specifically to the field of industrial automation. For a more general view on electric engineering, see Glossary of electrical and electronics engineering. For terms related to engineering in general, see Glossary of engineering.
A
See also
Glossary of engineering
Glossary of power electronics
Glossary of civil engineering
Glossary of mechanical engineering
Glossary of structural engineering
Notes
References
Attribution
External links
Websites
Glossary of Industrial Automation
Automation Glossary of terms
Glossary of technical terms commonly used by ABB
An automation glossary
Glossary - Industrial Electronic/Electrical Terms
Robotics Glossary: a Guide to Terms and Technologies
PDFs
Glossary of Terms used in Programmable Controller-based Systems
Glossary of Terms for Process Control
INDUSTRY 4.0: Glossary of terms/buzzwords/jargon
Electrical engineering
Electronic engineering
Industrial automation
Industrial automation
Industrial automation
Wikipedia glossaries using description lists
|
```java
/*
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package org.apache.beam.sdk.util;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.Arrays;
import org.checkerframework.checker.nullness.qual.Nullable;
/**
* A wrapper around {@link Throwable} that preserves the stack trace on serialization, unlike
* regular {@link Throwable}.
*/
@SuppressWarnings({
"nullness" // TODO(path_to_url
})
public final class SerializableThrowable implements Serializable {
private final @Nullable Throwable throwable;
private final StackTraceElement @Nullable [] stackTrace;
public SerializableThrowable(@Nullable Throwable t) {
this.throwable = t;
this.stackTrace = (t == null) ? null : t.getStackTrace();
}
public @Nullable Throwable getThrowable() {
return throwable;
}
private void readObject(ObjectInputStream is) throws IOException, ClassNotFoundException {
is.defaultReadObject();
if (throwable != null) {
throwable.setStackTrace(stackTrace);
}
}
@Override
public boolean equals(@Nullable Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SerializableThrowable that = (SerializableThrowable) o;
return Arrays.equals(stackTrace, that.stackTrace);
}
@Override
public int hashCode() {
return Arrays.hashCode(stackTrace);
}
}
```
|
The is a railway museum in Ōme, Tokyo, Japan. It opened in 1962, and is operated by the East Japan Railway Culture Foundation, a foundation established by East Japan Railway Company.
Exhibits
Seven steam locomotives, one electric locomotive and one 0 Series Shinkansen EMU car are on display. (as of July 2023)
Shinkansen car 22-75 was repainted into Tohoku ivory/green livery for short period in late 1980s.
JNR Class C51 steam locomotive No. C51 5 was also preserved here until it was moved to the Railway Museum in Saitama, Saitama.
JGR Class 110 steam locomotive No. 110 was also sectioned and put on display here, until its sectioned part was restored was moved to CIAL Sakuragichō Station in June 2020.
Access
The museum is located 15 minutes walk from Ome Station on the Ome Line.
Address
2-155 Katsunuma, Ōme, Tokyo
References
External links
List of engines
Museums established in 1962
Museums in Tokyo
Railway museums in Japan
Open-air museums in Japan
1962 establishments in Japan
Ōme, Tokyo
East Japan Railway Company
|
```java
/**
* This file is part of Skript.
*
* Skript is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* Skript is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*
* along with Skript. If not, see <path_to_url
*
*/
package ch.njol.skript.util;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.event.weather.ThunderChangeEvent;
import org.bukkit.event.weather.WeatherChangeEvent;
import org.bukkit.event.weather.WeatherEvent;
import org.eclipse.jdt.annotation.Nullable;
import ch.njol.skript.localization.Language;
/**
* @author Peter Gttinger
*/
public enum WeatherType {
CLEAR, RAIN, THUNDER;
String[] names;
@Nullable
String adjective;
final static Map<String, WeatherType> byName = new HashMap<>();
WeatherType(final String... names) {
this.names = names;
}
static {
Language.addListener(() -> {
byName.clear();
for (final WeatherType t : values()) {
t.names = Language.getList("weather." + t.name() + ".name");
t.adjective = Language.get("weather." + t.name() + ".adjective");
for (final String name : t.names) {
byName.put(name, t);
}
}
});
}
@Nullable
public static WeatherType parse(final String s) {
return byName.get(s);
}
public static WeatherType fromWorld(final World world) {
assert world != null;
if (world.isThundering() && world.hasStorm()) // Sometimes thundering but no storm
return THUNDER;
if (world.hasStorm())
return RAIN;
return CLEAR;
}
public static WeatherType fromEvent(final WeatherEvent e) {
if (e instanceof WeatherChangeEvent)
return fromEvent((WeatherChangeEvent) e);
if (e instanceof ThunderChangeEvent)
return fromEvent((ThunderChangeEvent) e);
assert false;
return CLEAR;
}
public static WeatherType fromEvent(final WeatherChangeEvent e) {
assert e != null;
if (!e.toWeatherState())
return CLEAR;
if (e.getWorld().isThundering())
return THUNDER;
return RAIN;
}
public static WeatherType fromEvent(final ThunderChangeEvent e) {
assert e != null;
if (e.toThunderState())
return THUNDER;
if (e.getWorld().hasStorm())
return RAIN;
return CLEAR;
}
@Nullable
public static WeatherType fromPlayer(final Player player) {
org.bukkit.WeatherType weather = player.getPlayerWeather();
if (weather == null) {
return null;
}
switch (weather) {
case DOWNFALL:
return RAIN;
case CLEAR:
return CLEAR;
default:
return null;
}
}
public void setWeather(Player player) {
switch (this) {
case RAIN:
case THUNDER:
player.setPlayerWeather(org.bukkit.WeatherType.DOWNFALL);
break;
case CLEAR:
player.setPlayerWeather(org.bukkit.WeatherType.CLEAR);
break;
default:
player.resetPlayerWeather();
}
}
@SuppressWarnings("null")
@Override
public String toString() {
return names[0];
}
// REMIND flags?
@SuppressWarnings("null")
public String toString(final int flags) {
return names[0];
}
@Nullable
public String adjective() {
return adjective;
}
public boolean isWeather(final World w) {
return isWeather(w.hasStorm(), w.isThundering());
}
public boolean isWeather(final boolean rain, final boolean thunder) {
switch (this) {
case CLEAR:
return !thunder && !rain;
case RAIN:
return !thunder && rain;
case THUNDER:
return thunder && rain;
}
assert false;
return false;
}
public void setWeather(final World w) {
if (w.isThundering() != (this == THUNDER))
w.setThundering(this == THUNDER);
if (w.hasStorm() == (this == CLEAR))
w.setStorm(this != CLEAR);
}
}
```
|
```smalltalk
// The .NET Foundation licenses this file to you under the MIT license.
using NuGet.Common;
namespace Microsoft.NET.Build.Tasks.UnitTests
{
public class MockContentAssetPreprocessor : IContentAssetPreprocessor
{
private Dictionary<string, string> _preprocessorValues = new();
private string _preprocessedOutputDirectory = null;
private readonly Func<string, bool> _exists;
public string MockReadContent { get; set; }
public string MockWrittenContent { get; set; }
public MockContentAssetPreprocessor(Func<string, bool> exists)
{
_exists = exists;
}
public void ConfigurePreprocessor(string outputDirectoryBase, Dictionary<string, string> preprocessorValues)
{
_preprocessorValues = preprocessorValues ?? new Dictionary<string, string>();
_preprocessedOutputDirectory = Path.Combine(outputDirectoryBase, "test");
}
public bool Process(string originalAssetPath, string relativeOutputPath, out string pathToFinalAsset)
{
bool fileWritten = false;
pathToFinalAsset = Path.Combine(_preprocessedOutputDirectory, relativeOutputPath);
if (!_exists(pathToFinalAsset))
{
// Mock reading, processing and writing content
var inputBytes = Encoding.ASCII.GetBytes(MockReadContent);
using (MemoryStream input = new(inputBytes))
{
string result = Preprocessor.Process(input, (token) =>
{
string value;
if (!_preprocessorValues.TryGetValue(token, out value))
{
throw new InvalidDataException($"The token '${token}$' is unrecognized");
}
return value;
});
MockWrittenContent = result;
fileWritten = true;
}
}
return fileWritten;
}
}
}
```
|
Jomel Andrel Warrican (born 20 May 1992) is a West Indian cricketer. He is a slow left-arm orthodox bowler and a right-handed tail-end batsman.
In September 2015 he was named in the Test squad for the West Indies tour to Sri Lanka. He made his Test debut against Sri Lanka on 22 October 2015, taking 4 wickets for 67 runs on the first day.
Early career
Born in Saint Vincent, Warrican moved to Barbados and attended Combermere School and joined the Empire Cricket Club. He was awarded the Lord Gavron Award for promising young cricketers in Barbados alongside Jason Holder in 2009 before representing the West Indies at the 2010 ICC Under-19 Cricket World Cup. He was the second Gavron Award winner to spend a season playing for Sefton Park in the Liverpool and District Cricket Competition in 2011, taking 51 wickets and scoring 373 runs. Warrican continued to impress on his return to the Caribbean and made his first-class debut for Barbados in March 2012 although a regular place wasn't claimed until his success in the 2014 season when he both led the BCA Elite Cricket league wicket-takers and broke the record for a slow bowler as he helped Empire to win the 3-day game championship. This form was carried in the Regional Four Day Competition where he took 49 wickets including two 8 wicket hauls.
In June 2020, Warrican was named as one of eleven reserve players in the West Indies' Test squad, for their series against England. The Test series was originally scheduled to start in May 2020, but was moved back to July 2020 due to the COVID-19 pandemic.
References
External links
1992 births
Living people
Barbados cricketers
West Indies Test cricketers
Place of birth missing (living people)
St Kitts and Nevis Patriots cricketers
Saint Vincent and the Grenadines cricketers
Immigrants to Barbados
Saint Vincent and the Grenadines emigrants
|
```javascript
Globbing in Node
Deleting Files and Folders
Using `gulp-mocha`
Server with Live-Reloading
Sharing Streams with Stream Factories
```
|
```javascript
/*eslint no-console: 0*/
import fs from 'fs'
import path from 'path'
import { log } from './LogUtils'
import { APP_PATH } from './Constants'
export const pkgPath = path.join(APP_PATH, 'package.json')
export function getPackageJSON() {
if (!fs.existsSync(pkgPath))
logNoPackageJSON()
let packageJSON
try {
packageJSON = require(pkgPath)
} catch(e) {
logCantReadPackageJSON()
}
return packageJSON
}
export function getDXConfig() {
const packageJSON = getPackageJSON()
validatePackageJSON(packageJSON)
return getPackageJSON()['react-project']
}
export function copyProps(source, target, field) {
if (!target[field])
target[field] = {}
for (const key in source[field]) {
if (!target[field][key])
target[field][key] = source[field][key]
}
}
function validatePackageJSON(appPackageJSON) {
if (!appPackageJSON['react-project']) {
logNoDX()
}
if (
!appPackageJSON['react-project'] ||
!appPackageJSON['react-project'].client ||
!appPackageJSON['react-project'].server
) {
logError('No "react-project" entry found in package.json')
log('It should look something like this:')
console.log()
console.log(' {')
console.log(' ...')
console.log(' "react-project": {')
console.log(' "server": "modules/server.js",')
console.log(' "client": "modules/client.js"')
console.log(' }')
console.log(' }')
console.log()
process.exit()
}
}
function logCantReadPackageJSON() {
logError('Can\'t read "package.json", go fix it or maybe run this:')
log()
log(' npm init .')
log()
process.exit()
}
function logNoPackageJSON() {
log('No "package.json" found, run this:')
log()
log(' npm init .')
log()
process.exit()
}
function logNoDX() {
log('No "react-project" entry found in package.json')
log('It should look something like this:')
console.log()
console.log(' {')
console.log(' ...')
console.log(' "react-project": {')
console.log(' "server": "modules/server.js",')
console.log(' "client": "modules/client.js",')
console.log(' "webpack": "modules/webpack.config.js"')
console.log(' }')
console.log(' }')
console.log()
process.exit()
}
```
|
Jean Boht (née Dance; 6 March 1932 – 12 September 2023) was an English actress, most famous for the role of Nellie Boswell in Carla Lane's sitcom Bread, remaining one of several actors to remain with the show for its entire seven series tenure from 1986 to 1991.
Early life
Boht was born as Jean Dance on 6 March 1932 in Bebington, then in Cheshire, her mother was pianist Edna May "Teddy" Dance. She was educated at Wirral Grammar School for Girls.
Career
Boht trained at the Liverpool Playhouse, where she started her career as a theatre actress, before touring the United Kingdom in stage roles, working in numerous West End Theatres including the Royal National Theatre and the Bristol Old Vic. In a career spanning from 1962 to 2018, she appeared largely in television productions. These included guesting parts in Softly, Softly (1971), Some Mothers Do 'Ave 'Em (1978), Grange Hill (1978), Last of the Summer Wine (1978), Boys from the Blackstuff (1982), Scully (1984), Juliet Bravo in the mid-1980s.
In was through her regular role in the sitcom Bread (1986–91), as matriarch Nellie Boswell, in which she found her largest audience, with the series attracting some 20 million viewers.
In 1989, she was the subject of This Is Your Life, and in 2008 she made a guest appearance in BBC One's daytime TV soap, Doctors.
Boht starred in The Brighton Belles, an unsuccessful British adaptation of the American sitcom The Golden Girls as the character of Josephine, based on Sophia Petrillo, the part made famous by Estelle Getty.
On stage, Boht appeared with Jeremy Irons in Embers (2006) at the Duke of York's Theatre in London.
Boht also appeared in the film Mothers and Daughters (2004), and starred in Chris Shepherd's award-winning short film Bad Night for the Blues (2010).
Personal life, illness and death
Her first marriage to William Boht ended in divorce. She married the American-British conductor and composer Carl Davis on 28 December 1970. They had two daughters, filmmakers Hannah (born 1972) and Jessie (born 1974). Boht and Davis were executive producers on Hannah Davis's film The Understudy and they appeared in the film as a married couple. Davis died on 3 August 2023.
Boht was diagnosed with vascular dementia and Alzheimer's disease. She was a resident at Denville Hall, a retirement home in Northwood, London, for actors and other members of the entertainment industry.
Boht died from complications of dementia on 12 September 2023, aged 91.
Awards
Boht won a British Comedy Award (now known as the "National Comedy Awards") for Best Comedy Actress in 1990.
Filmography
Film
Television
Video games
References
External links
1932 births
2023 deaths
20th-century English actresses
21st-century English actresses
Actresses from Cheshire
Deaths from Alzheimer's disease
Deaths from dementia in England
Deaths from vascular dementia
English soap opera actresses
English stage actresses
English television actresses
People educated at Wirral Grammar School for Girls
People from Bebington
|
Frank Drohan (13 August 1879 – 5 March 1953) was an Irish politician. He was elected unopposed at the 1921 elections for the Waterford–Tipperary East constituency as a Sinn Féin Teachta Dála (TD) in the 2nd Dáil.
He was personally opposed to the Anglo-Irish Treaty signed on 6 December 1921, but the local Sinn Féin branch instructed him to vote in favour; he felt the only honourable course was to submit his resignation, which was read out by the Ceann Comhairle Eoin MacNeill on 5 January 1922, two days before the Dáil voted to accept the Treaty.
Frank Drohan Road is the section of the N24 serving as an inner relief road outside Clonmel.
References
1879 births
1953 deaths
Early Sinn Féin TDs
Members of the 2nd Dáil
People from Clonmel
Politicians from County Tipperary
|
```jsx
/* @flow */
/** @jsx node */
/* eslint max-lines: 0 */
import { node, dom } from "@krakenjs/jsx-pragmatic/src";
import {
getLogger,
getPayPalDomainRegex,
getSDKMeta,
getPayPalDomain,
getLocale,
getCSPNonce,
} from "@paypal/sdk-client/src";
import { create, type ZoidComponent } from "@krakenjs/zoid/src";
import { inlineMemoize } from "@krakenjs/belter/src";
import { Overlay, SpinnerPage } from "@paypal/common-components/src";
import { type InstallmentsProps } from "./props";
export type InstallmentsComponent = ZoidComponent<InstallmentsProps>;
export function getInstallmentsComponent(): InstallmentsComponent {
return inlineMemoize(getInstallmentsComponent, () => {
return create({
tag: "paypal-installments",
url: () =>
`${getPayPalDomain()}${__PAYPAL_CHECKOUT__.__URI__.__INSTALLMENTS__}`,
domain: getPayPalDomainRegex(),
autoResize: {
width: false,
height: true,
},
dimensions: {
width: "100%",
height: "100%",
},
// 2023-08-23 Shane Brunson
// I don't think Zoid uses this logger prop and I don't think we the SDK
// use it anywhere either. I'm trying to fix the main branch from building
// though and removing all these logger calls is more of risky change than
// I'm willing to make right now though.
// $FlowIssue mismatch between beaver-logger and zoid logger type
logger: getLogger(),
prerenderTemplate: ({ doc, props }) => {
const nonce = props.nonce || getCSPNonce();
return (<SpinnerPage nonce={nonce} />).render(dom({ doc }));
},
containerTemplate: ({
context,
close,
focus,
doc,
event,
frame,
prerenderFrame,
props,
}) => {
const { nonce } = props;
return (
<Overlay
context={context}
close={close}
focus={focus}
event={event}
frame={frame}
prerenderFrame={prerenderFrame}
autoResize={true}
hideCloseButton={true}
nonce={nonce}
/>
).render(dom({ doc }));
},
props: {
sdkMeta: {
type: "string",
queryParam: true,
sendToChild: false,
value: getSDKMeta,
},
clientID: {
type: "string",
queryParam: true,
},
locale: {
type: "object",
queryParam: true,
value: getLocale,
},
nonce: {
type: "string",
default: getCSPNonce,
required: false,
},
},
});
});
}
```
|
Michail Kletcherov (); born in Bansko on ) is a Bulgarian biathlete.
He competed in the 2010 Winter Olympics for Bulgaria. His best finish was 16th, as a member of the Bulgarian relay team. His best individual performance was 44th, in the pursuit.
As of February 2013, his best performance at the Biathlon World Championships, is 9th, in the 2013 mixed relay. His best individual performance in a World Championships is 27th, in the 2012 individual.
As of February 2013, his best Biathlon World Cup finish is 11th, achieved in two men's relay events and one mixed relay. His best individual finish is 13th, in the mass start at Antholz in 2011/12. His best overall finish in the Biathlon World Cup is 47th, in 2011/12.
References
1982 births
Biathletes at the 2010 Winter Olympics
Biathletes at the 2014 Winter Olympics
Bulgarian male biathletes
Living people
Olympic biathletes for Bulgaria
People from Bansko
Sportspeople from Blagoevgrad Province
20th-century Bulgarian people
21st-century Bulgarian people
|
Ballycuirke Lough (), also known as Ballyquirke Lough, is a freshwater lake in the west of Ireland. It is part of the Lough Corrib catchment in County Galway.
Geography and natural history
Ballycuirke Lough is located about northwest of Galway city, on the N59 road, near the village of Moycullen. The lake is a pike fishing destination.
See also
List of loughs in Ireland
References
Ballycuirke
|
```php
<?php
/*
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
*/
namespace Google\Service\ServiceControl;
class EsfMigrationServerOverride extends \Google\Model
{
/**
* @var string
*/
public $overrideMode;
/**
* @param string
*/
public function setOverrideMode($overrideMode)
{
$this->overrideMode = $overrideMode;
}
/**
* @return string
*/
public function getOverrideMode()
{
return $this->overrideMode;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(EsfMigrationServerOverride::class, 'Google_Service_ServiceControl_EsfMigrationServerOverride');
```
|
The 1961 World Archery Championships was the 21st edition of the event. It was held in Oslo, Norway on 10–13 August 1961 and was organised by World Archery Federation (FITA).
Medals summary
Recurve
Medals table
References
External links
World Archery website
Complete results
World Championship
A
World Archery Championships
1961 in Norwegian sport
International sports competitions in Oslo
1960s in Oslo
|
The 2008 Bolivian political crisis saw protests against President Evo Morales and calls for greater autonomy for the country's eastern departments. Demonstrators escalated the protests by seizing natural gas infrastructure and government buildings. In response, supporters of the national government and its reform of the constitution, mobilized across these regions.
Violence between supporters of Morales and opponents, which reached its peak in the Porvenir massacre on September 11, resulted in at least 15 deaths.
Protests begin
On August 19, the eastern departments of Santa Cruz, Beni, Pando, Tarija, and Chuquisaca called strikes and protests in opposition to central government plans to divert part of the national direct tax on hydrocarbons towards its Renta Dignidad pension plan. Brief clashes occurred in the Santa Cruz de la Sierra, capital of Santa Cruz, between police and armed youths enforcing the strike. In Tarija protesters seized and occupied government buildings. In response to the unrest Morales ordered the Bolivian Army to protect oil and gas infrastructure in the five departments.
The governors of the departments warned on September 3, 2008 that if the government didn't change its course that the protests could lead to a cut-off of natural gas exports to Argentina and Brazil. They also threatened setting up roadblocks in the five departments in addition to road blocks set up on roads leading to Argentina and Paraguay. The governors also demanded government troops withdraw from Trinidad, the capital of Beni department, following clashes between MPs and protesters trying to seize facilities of the National Tax Service in the city. President Morales accused the governors of launching a "civil coup" against his government.
Violence escalates
Protesters caused the explosion of a natural gas pipeline on September 10, 2008 according to the head of Bolivia's state energy company. He called the attack a "terrorist attack" and said it result in 10% cut in exports to Brazil. President Morales sent additional troops to the region following the attack. The next day clashes erupted between supporters and opponents of the government in the northeastern town of Cobija, capital of Pando department, resulting in 20 deaths. Morales said his government would be patient with the unrest but warned that "patience has its limits, really." A spokesman for Morales said the unrest was opening the way to "a sort of civil war."
The leader of the national opposition, Jorge Quiroga, accused the central government of organizing militias to retake the city of Cobija. Central government work had also ceased while American Airlines was suspending flights to the airport. Peasant supporters of Morales were also threatening to encircle Santa Cruz. Venezuelan President Hugo Chávez warned that if Morales was overthrown or killed Venezuela would give a "green light" to conduct military operations in Bolivia. Bolivia's army said it rejected "external intervention of any nature" in response to Chávez. Morales ruled out the use of force against protesters, calling for talks with opposition leaders.
The Governor of Tarija department, Mario Cossío, went to La Paz on September 12, 2008 to hold negotiations representing three other opposition governors who had rejected talks with the central government. Morales said he was open to dialogue not only with the governors but with mayors and different social sectors. Before the meeting Mario Cossio called for dialogue saying "The first task is to pacify the country, and we hope to agree with President Morales on that. Our presence has to do with that clear will to lay the foundations and hopefully launch a process of dialogue that ends in a great agreement for national reconciliation." Vice President Álvaro García declared a day of national mourning for 20 people killed in Pando most of whom were pro-Morales farmers shot dead by people the government claims were associated with the opposition.
Pando state of emergency
Bolivian authorities declared a state of emergency in Pando which began at midnight on September 12, 2008. During the state of emergency, constitutional guarantees are suspended, private vehicles without authorization are banned from the streets, groups are not allowed to meet; bars, restaurants and discos must close at midnight, and residents are prohibited from carrying firearms. Morales said martial law was not needed anywhere else in the country.
Following the declaration of a state of emergency, Bolivian troops took control of the airport in Pando's capital, Cobija, and prepared to retake the city. Morales accused the governor of Pando of orchestrating "a massacre" of farmers supporting Morales. Pando Governor Leopoldo Fernández rejected the accusation, saying "They've accused me of using hit men, when everyone knows those socialist peasants, those fake peasants, were armed." In a speech in Cochabamba, Morales condemned the opposition governors, saying they were "conspiring against us with a fascist, racist coup," and said they were "the enemies of all Bolivians." While promising to adopt a constitution opposed by the governors Morales said Bolivia's "democratic revolution" had to be seen through saying "We have always cried 'fatherland or death'. If we don't emerge victorious, we have to die for the country and the Bolivian people." Morales also said he would not hesitate to extend the state of emergency to other opposition-controlled departments. Rubén Costas, the governor of Santa Cruz, belittled the chances of a breakthrough in talks adding that "if there is just one more death or person wounded, any possibility of dialogue will be broken."
Opposition protest leader and pro-autonomy businessman Branko Marinkovic announced on September 14, 2008 that the demonstrators he led would be removing their road blocks as "a sign of good will" to allow dialogue to prosper and calling on the government to end "repression and genocide in the department of Pando." Troops who had landed at Cobija also began patrolling the streets before dawn and began uncovering more dead bodies from the September 11 clash in Pando between Morales supporters and opposition protesters. Alfredo Rada, government minister for Pando, referring to casualty figures, said "We are nearing the 30 mark." An aide to the opposition governor in Pando denied the army was in control of the departmental capital. Troops were also hunting for Pando governor Fernández with orders to arrest him.
A spokesman for Morales said blockades remained on the highway and said "an armed group" had set fire to the town hall in Filadelfia, a municipality near Cobija. The Pando government spokesman said the citizens of Cobija did not want the Army to enter the city, and that they were not going to follow martial law.
Bolivia's army arrested as many as 10 people for alleged involvement in the deadly clashes. Leopoldo Fernández was also taken into custody by the armed forces on September 16, to be flown to La Paz to face accusations that he hired hitmen to fire on pro-government supporters. He was charged with committing genocide.
The U.S. began evacuating Peace Corps volunteers from Bolivia and organized at least two evacuation flights in response. In spite of the arrest, opposition governors agreed to talks, conditioned on anti-Morales protesters ending occupations of government buildings. Matters up for discussion include the opposition drive for more autonomy for their provinces and a larger share of state energy revenue. Talks were expected to begin on Thursday. The army also professed its support for Morales.
Morales appointed Navy Rear Admiral Landelino Bandeiras as the replacement for the governor of Pando September 20, 2008. Difficulties were reported in the peace talks by presidential spokesman Ivan Canelas, who said the position of the opposition governors could hinder peace talks and condemned the "lack of political will of these authorities to backup the efforts being made by the central government to preserve peace and national unity."
Supporters of Morales have threatened to storm the city of Santa Cruz if the talks should fail.
On September 25, 2008, Morales rejected autonomy proposals by the Eastern provinces, putting the talks on hold. On October 20, 2008, Morales and the opposition agreed to hold the referendum on January 25, 2009 and early elections in December 2009; Morales in turn promised he would not run again in 2014 after his likely reelection in 2009, despite being allowed to do so under the new constitution.
Diplomatic response
Accusing the United States of supporting the opposition governors and attempting to overthrow his government, Morales declared the United States Ambassador to Bolivia Philip Goldberg persona non grata, and ordered him to leave the country. The U.S. responded by expelling Bolivia's ambassador in Washington. U.S. State Department spokesman Sean McCormack expressed regret at the diplomatic fallout saying it will "prejudice the interests of both countries, undermine the ongoing fight against drug trafficking and will have serious regional implications." President Morales said he does not want to break diplomatic ties with the U.S. but said the actions of the ambassador were "very serious", claiming he met with provincial leaders and instigated the unrest. Before his departure the American ambassador warned Bolivia that it would face "serious consequences" and had "not correctly evaluated" the retaliation from Washington.
Venezuela's President Hugo Chávez ordered the U.S. ambassador in Caracas Patrick Duddy to also leave saying it was in part out of solidarity with Bolivia. Chávez also said he was recalling Venezuela's ambassador to the U.S. until a new government takes office. Chávez accused the United States of being involved in the unrest saying "The U.S. is behind the plan against Bolivia, behind the terrorism."
State Department spokesman Sean McCormack said the expulsions by Bolivia and Venezuela reflect "the weakness and desperation of these leaders as they face internal challenges." Morales responded that the act was "not of weakness, but of dignity," and was about freeing Bolivia from "the American Empire."
Other responses
National governments
: The Foreign Ministry said Brazil's government was taking the necessary measures to guarantee gas supplies in the country. It also expressed "grave concern" at the unrest in Bolivia deploring the outbreak of violence and attacks on state institutions and public order. Aides to President Luiz Inácio Lula da Silva said high-ranking members of his government and Argentina's were ready to try to negotiate a deal between Morales and his opponents.
: President Rafael Correa said both Bolivia and Venezuela had sufficient reason to expel the U.S. ambassadors saying Ecuador would expel someone if they interfered in his country's internal affairs.
: President Manuel Zelaya put off a ceremony at which the U.S. ambassador would present a letter with his diplomatic credentials "in solidarity with Bolivian President Evo Morales." A few days later he told the envoy to present his credentials as ambassador later in the week.
: President Daniel Ortega announced his support for Bolivia's expulsion of the U.S. ambassador. He later rejected an invitation to meet with U.S. President George W. Bush out of "solidarity" with Morales.
Intergovernmental organizations
Secretary General of the Andean Community of Nations Freddy Ehlers condemned the violence in Bolivia and called for dialogue between the government and opposition.
: In a statement the EU urged "all parties to take steps to rapidly establish" talks to stop the situation getting worse, offered to mediate between opposing parties, and expressed regret over attacks on aid projects.
: Secretary-General Ban Ki-moon "rejects the use of violence as a means to advance political ends and joins others, including the Secretary General of the Organization of American States, José Miguel Insulza, and Bolivia's Conference of Catholic Bishops, in calling for dialogue, urgently, to seek consensus on the pressing issues affecting the Bolivian people," according to a statement issued by the UN.
President of Chile and President pro tempore of the Union of South American Nations Michelle Bachelet summoned an emergency meeting of heads of state in Santiago de Chile to analyze the political situation in Bolivia, scheduled for Monday September 15. That meeting ended with backing for the Bolivian leader. On September 24, 2008 Unasur agreed to send a special commission to investigate the violence in Pando.
See also
Bolivian gas conflict, 2003–2006 social conflict stemming from issues around gas taxation and privatization
Bolivian autonomy referendums, 2008
2019 Bolivian protests
2019 Bolivian political crisis
References
Protests in Bolivia
Unrest In Bolivia, 2008
Unrest In Bolivia, 2008
|
Xecutioner's Return is the seventh studio album by American death metal band Obituary, released on August 28, 2007 through Candlelight Records. The title of the album is derived from the band's original band name, which was Xecutioner. The album is their first album since 1990's Cause of Death to be recorded without guitarist Allen West and the first album to feature guitarist Ralph Santolla. Though hailed as a partial return to the more speed-based style of the band's early work, it received positive reviews from critics but mixed reviews from the fanbase.
A music video was made for "Evil Ways".
Track listing
Personnel
John Tardy – vocals
Ralph Santolla – lead guitar
Trevor Peres – rhythm guitar
Frank Watkins – bass
Donald Tardy – drums
References
Obituary (band) albums
2007 albums
|
A spur castle is a type of medieval fortification that is sited on a spur of a hill or mountain for defensive purposes. Ideally, it would be protected on three sides by steep hillsides; the only vulnerable side being that where the spur joins the hill from which it projects. By contrast, a ridge castle is only protected by steep terrain on two sides.
Description
A spur castle was one of several types of hill castle. Depending on the local topography, a spur castle may have relied mainly on its inaccessible position or may have integrated further features such as shield walls and towers into the defences. In addition castle builders may have improved the natural defences of the terrain by hewing into them to make the hillsides harder to climb and reduce the risk of landslide. A classic feature is the neck ditch, cutting off the spur from the rest of the hill. A long spur castle is sometimes, but not always, subdivided into a lower ward and a more strongly defended upper ward (or even a succession of three or more wards).
High spur and hilltop castles were built and improved by the Franks to hinder increasing use of the counterweight trebuchet. In the case of spur castles, heavy siege machinery could only be deployed on the uphill side enabling defensive works and forces to be concentrated there.
Examples
The crusader castle Krak des Chevaliers in Syria lies on a spur accessible from the south. At the same time, it has strong concentric castle defences on all sides.
The Citadel of Salah Ed-Din, western Syria, has defences concentrated on the vulnerable side of the spur, most notably a deep ditch. The lower bailey at Saône (as the French call it) has weaker walls and towers.
The Alamut Castle in Persia (now northwestern Iran), was atop a narrow rock base rising approximately 180 m. It was thought to be impregnable to direct attack.
The Alcázar of Segovia, central Spain, is on a narrow spur with deep drops all around except from the east where it is approached on level ground.
Stirling Castle, Scotland, is on a narrow spur with drops on three sides and a gentle slope providing access from the south-east.
Château de Chinon, central France, was used by the counts of Anjou in the 12th century. In 1205, it was captured by the French king and was the largest castle in the Loire valley.
Poenari Castle, elevated on a clifftop 440 m over the river Argeș in Romania. Used as Vlad the Impaler's fortress.
Château de Montségur in France was used by the Cathars and lies on the spur of a mountain.
Cefnllys Castle in Wales, is a series of 2 castles in Wales.
See also
Castle
Hill castle
Hillside castle
Hilltop castle
Ridge castle
References
Castles by type
|
```javascript
Async File Write in Node.js
Custom Node REPL Server
Node Inspector
Wrapping errors in Node.js using _node-verror_
`try-catch` only for **sync** code
```
|
```javascript
'use strict';
/*
* This is a regression test for
* path_to_url and
* path_to_url
*
* When a timer is added in another timer's callback, its underlying timer
* handle was started with a timeout that was actually incorrect.
*
* The reason was that the value that represents the current time was not
* updated between the time the original callback was called and the time
* the added timer was processed by timers.listOnTimeout. That led the
* logic in timers.listOnTimeout to do an incorrect computation that made
* the added timer fire with a timeout of scheduledTimeout +
* timeSpentInCallback.
*
* This test makes sure that a timer added by another timer's callback
* fires with the expected timeout.
*
* It makes sure that it works when the timers list for a given timeout is
* empty (see testAddingTimerToEmptyTimersList) and when the timers list
* is not empty (see testAddingTimerToNonEmptyTimersList).
*/
const common = require('../common');
const assert = require('assert');
const Timer = process.binding('timer_wrap').Timer;
const TIMEOUT = 100;
let nbBlockingCallbackCalls;
let latestDelay;
let timeCallbackScheduled;
// These tests are timing dependent so they may fail even when the bug is
// not present (if the host is sufficiently busy that the timers are delayed
// significantly). However, they fail 100% of the time when the bug *is*
// present, so to increase reliability, allow for a small number of retries.
let retries = 2;
function initTest() {
nbBlockingCallbackCalls = 0;
latestDelay = 0;
timeCallbackScheduled = 0;
}
function blockingCallback(retry, callback) {
++nbBlockingCallbackCalls;
if (nbBlockingCallbackCalls > 1) {
latestDelay = Timer.now() - timeCallbackScheduled;
// Even if timers can fire later than when they've been scheduled
// to fire, they shouldn't generally be more than 100% late in this case.
// But they are guaranteed to be at least 100ms late given the bug in
// path_to_url and
// path_to_url
if (latestDelay >= TIMEOUT * 2) {
if (retries > 0) {
retries--;
return retry(callback);
}
assert.fail(`timeout delayed by more than 100% (${latestDelay}ms)`);
}
if (callback)
return callback();
} else {
// block by busy-looping to trigger the issue
common.busyLoop(TIMEOUT);
timeCallbackScheduled = Timer.now();
setTimeout(blockingCallback.bind(null, retry, callback), TIMEOUT);
}
}
function testAddingTimerToEmptyTimersList(callback) {
initTest();
// Call setTimeout just once to make sure the timers list is
// empty when blockingCallback is called.
setTimeout(
blockingCallback.bind(null, testAddingTimerToEmptyTimersList, callback),
TIMEOUT
);
}
function testAddingTimerToNonEmptyTimersList() {
// If both timers fail and attempt a retry, only actually do anything for one
// of them.
let retryOK = true;
const retry = () => {
if (retryOK)
testAddingTimerToNonEmptyTimersList();
retryOK = false;
};
initTest();
// Call setTimeout twice with the same timeout to make
// sure the timers list is not empty when blockingCallback is called.
setTimeout(
blockingCallback.bind(null, retry),
TIMEOUT
);
setTimeout(
blockingCallback.bind(null, retry),
TIMEOUT
);
}
// Run the test for the empty timers list case, and then for the non-empty
// timers list one.
testAddingTimerToEmptyTimersList(
common.mustCall(testAddingTimerToNonEmptyTimersList)
);
```
|
Despatch Box is a late night political analysis television programme produced by the BBC. It was broadcast on BBC Two between 20 October 1998 and 20 December 2002. The programme was a replacement for the nightly political programme The Midnight Hour, and like its predecessor, was initially presented by a team of single-presenter journalists, rotated nightly, consisting of Zeinab Badawi, Michael Dobbs, Andrew Neil and Steve Richards. The programme regularly gained an audience of more than 350,000viewers. Following a change of format, it was decided that the programme should have one, regular presenter, a role for which Andrew Neil was chosen. The programme was produced at the BBC's Millbank studios in London.
Following changes to sitting hours in the United Kingdom parliament, and extensive changes to the BBC's line-up of political programmes, Despatch Box was discontinued, and the programme's then regular presenter, Andrew Neil, moved on to present the Daily Politics and This Week.
See also
Westminster Live
References
BBC television news shows
1998 British television series debuts
2002 British television series endings
1990s British political television series
2000s British political television series
English-language television shows
|
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<!-- Publishing configuration -->
<PublishReadyToRun>true</PublishReadyToRun>
<SelfContained>false</SelfContained>
<PublishSingleFile>false</PublishSingleFile>
<PublishTrimmed>false</PublishTrimmed>
</PropertyGroup>
<ItemGroup>
<None Include="paket.references" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../LibExecution/LibExecution.fsproj" />
<ProjectReference Include="../LibCloud/LibCloud.fsproj" />
</ItemGroup>
<ItemGroup>
<Compile Include="CronChecker.fs" />
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>
```
|
Eula Biss (born 1977) is an American non-fiction writer who is the author of four books.
Biss has won the Carl Sandburg Literary Award, the Rona Jaffe Foundation Writers' Award, the Graywolf Press Nonfiction Prize, the Pushcart Prize, and the National Book Critics Circle Award. She is a founding editor of Essay Press and a Guggenheim Fellow.
Life and career
After earning a bachelor's degree in non-fiction writing from Hampshire College, Biss moved to New York City, San Diego, and then Iowa City, where she went on to complete her MFA in the University of Iowa's Nonfiction Writing Program.
Biss taught writing at Northwestern University for fifteen years, from 2006-2021. She is the author of four books and the founder of Essay Press. Her second book, Notes from No Man's Land, won the Graywolf Press Nonfiction Prize, and in March 2010, the National Book Critics Circle Award in the criticism category. Her third book, On Immunity: An Inoculation, was one of the New York Times Book Review'''s 10 Best Books of 2014 and was a finalist for the 2014 National Book Critics Circle Award (Criticism).
Biss lives outside Chicago. She is married to the writer John Bresland, and they have a son.
WorksThe Balloonists, Hanging Loose Press, 2002, Notes from No Man's Land, Graywolf Press, 2009, On Immunity: An Inoculation, Graywolf Press, 2014, Having and Being Had, Riverhead Books, 2020,
References
External links
Author's website
Radio Interview: Eula Biss discusses her book On Immunity, public health and anti-vaccination movements on The 7th Avenue Project radio show.
Radio interview: Eula Biss is interviewed about race and "Whiteness" by host Krista Tippett on On Being
The "F-Word": Fragment and the Futility of Genre Classification: a Roundtable Discussion with Eula Biss, Sarah Manguso, Maggie Nelson, and Allie Rowbottom in Gulf Coast: A Journal of Literature and Fine Arts'' (25.1)
Book TV: Eula Biss "Notes From No Man's Land"
1977 births
Living people
American non-fiction writers
Hampshire College alumni
University of Iowa alumni
Northwestern University faculty
Rona Jaffe Foundation Writers' Award winners
21st-century American women writers
21st-century American essayists
American women essayists
American women academics
|
Bernardino Fenier (also Bernardino Venerio) (died 1535) was a Roman Catholic prelate who served as Bishop of Chioggia (1487–1535).
Biography
On 24 January 1487, Bernardino Fenier was appointed during the papacy of Innocent VIII as Bishop of Chioggia. In April 1487, he was consecrated bishop by Antonio Ursi, Bishop of Canea. He served as Bishop of Chioggia until his death in 1535.
While bishop, he was the principal co-consecrator of Luigi Contarini, Patriarch of Venice (1508).
References
External links and additional sources
(for Chronology of Bishops)
(for Chronology of Bishops)
16th-century Italian Roman Catholic bishops
15th-century Roman Catholic bishops in the Republic of Venice
Bishops appointed by Pope Innocent VIII
1535 deaths
|
The Joint Dark Energy Mission (JDEM) was an Einstein probe that planned to focus on investigating dark energy. JDEM was a partnership between NASA and the U.S. Department of Energy (DOE).
In August 2010, the Board on Physics and Astronomy of the National Science Foundation (NSF) recommended the Wide Field Infrared Survey Telescope (WFIRST) mission, a renamed JDEM-Omega proposal which has superseded SNAP, Destiny, and Advanced Dark Energy Physics Telescope (ADEPT), as the highest priority for development in the decade around 2020. This would be a 1.5-meter telescope with a 144-megapixel HgCdTe focal plane array, located at the Sun-Earth L2 Lagrange point. The expected cost is around US$1.6 billion.
Earlier proposals
Dark Energy Space Telescope (Destiny)
The Dark Energy Space Telescope (Destiny), was a planned project by NASA and DOE, designed to perform precision measurements of the universe to provide an understanding of dark energy. The space telescope will derive the expansion of the universe by measuring up to 3,000 distant supernovae each year of its three-year mission lifetime, and will additionally study the structure of matter in the universe by measuring millions of galaxies in a weak gravitational lensing survey. The Destiny spacecraft features an optical telescope with a 1.8 metre primary mirror. The telescope images infrared light onto an array of solid-state detectors. The mission is designed to be deployed in a halo orbit about the Sun-Earth Lagrange point.
The Destiny proposal has been superseded by the Wide Field Infrared Survey Telescope (WFIRST).
SuperNova Acceleration Probe (SNAP)
The SuperNova Acceleration Probe (SNAP) mission was proposed to provide an understanding of the mechanism driving the acceleration of the universe and determine the nature of dark energy. To achieve these goals, the spacecraft needed to be able to detect these supernova when they are at their brightest moment. The mission was proposed as an experiment for the JDEM. The satellite observatory would be capable of measuring up to 2,000 distant supernovae each year of its three-year mission lifetime. SNAP was also planned to observe the small distortions of light from distant galaxies to reveal more about the expansion history of the universe. SNAP was initially planned to launch in 2013.
To understand what is driving the acceleration of the universe, scientists need to see greater redshifts from supernovas than what is seen from Earth. The SNAP would detect redshifts of 1.7 from distant supernovas up to 10 billion light years away. At this distance, the acceleration of the universe is easily seen. To measure the presence of dark energy, a process called weak lensing can be used.
The SNAP would have used an optical setup called the three-mirror anastigmat. This consists of a main mirror with a diameter of 2 meters to take in light. It reflects this light to a second mirror. Then this light is transferred to two additional smaller mirrors which direct the light to the spacecraft's instruments. It will also contain 72 different cameras. 36 of them are able to detect visible light and the other 36 detect infrared light. Its cameras combined produces the equivalence of a 600 megapixel camera. The resolution of the camera is about 0.2 arcseconds in the visible spectrum and 0.3 arcseconds in the infrared spectrum. The SNAP would also have a spectrograph attached to it. The purpose of it is to detect what type of supernova SNAP is observing, determine the redshift, detect changes between different supernovas, and store supernova spectra for future reference.
JDEM recognized several potential problems of the SNAP project:
The supernovas that SNAP would detect may not all be SN 1a type. Some other 1b and 1c type supernovas have similar spectra which could potentially confuse SNAP.
Hypothetical gray dust could contaminate results. Gray dust absorbs all wavelengths of light, making supernovas dimmer than they actually are.
The behavior of supernovas could potentially be altered by its binary-star system.
Any objects between the viewed supernova and the SNAP could gravitationally produce inaccurate results.
The SNAP proposal has been superseded by the Wide Field Infrared Survey Telescope (WFIRST).
See also
Wide-field Infrared Survey Explorer (2009–2011)
References
External links
JDEM at Berkley Lab
Space telescopes
Cancelled spacecraft
Spacecraft using halo orbits
Dark energy
Artificial satellites at Earth-Sun Lagrange points
|
The 361st Tactical Missile Squadron is an inactive United States Air Force unit. It was formed in 1985 by the consolidation of the 1st Antisubmarine Squadron and the 661st Bombardment Squadron. However, the squadron was ever active under its new title.
The first predecessor of the squadron was activated in 1942 as the 361st Bombardment Squadron. It engaged in antisubmarine operations off the Pacific Coast. In November 1942, it was redesignated as the 1st Antisubmarine Squadron and operated from bases in England, Morocco, and Tunisia until the antisubmarine mission transferred to the United States Navy. It returned to the United States in January 1944 and its remaining personnel were used to form new heavy bomber units.
The squadron's second predecessor was the 661st Bombardment Squadron, formed in 1958 when Strategic Air Command (SAC) expanded its Boeing B-47 Stratojet units from three to four squadrons when they began standing alert at their home stations. It was inactivated in 1962 when SAC's alert commitment changed.
History
World War II
The first predecessor of the squadron was organized as the 361st Bombardment Squadron at Salt Lake City Army Air Base, Utah in July 1942. It was one of the original squadrons of the 304th Bombardment Group. The squadron was only nominally manned until September, when it moved with the 304th Group to Geiger Field, Washington. The squadron moved to Ephrata Army Air Field, Washington, later that month and equipped with Boeing B-17 Flying Fortress (briefly) and Consolidated B-24 Liberator heavy bombers.
The following month, the 304th Group moved to Langley Field, Virginia, where it became part of AAF Antisubmarine Command. In the fall of 1942, the Kriegsmarine began to equip its U-boats with radar receivers capable of detecting the Royal Air Force's long wave radars used for Air-to-Surface Vessel radar. This enabled the subs to dive, avoiding detection while on the surface. RAF's Coastal Command requested reinforcements from the AAFin the form of B-24s equipped with radars operating in the microwave band. In response, the squadron's air echelon was dispatched to RAF St Eval, England on 10 November to support Coastal Command. On arrival in England, it was attached to VIII Bomber Command for operations. Later that month, it was redesignated the 1st Antisubmarine Squadron.
The squadron flew its first mission from St Eval on 10 November, operating under the control of Coastal Command, training on British operational methods and use of radar while conducting operational missions over the Atlantic lasting up to twelve hours. In January, the squadron was joined by the 2d Antisubmarine Squadron, forming a provisional group. In February, the squadron joined RAF units in a concerted attack on German submarines returning from attacks on convoys in the Atlantic. The group conducted its last mission from England on 5 March 1943.
In March the squadron moved to Craw Field, French Morocco, where they augmented two United States Navy squadrons flying Consolidated PBY Catalinas defending the Atlantic approaches to the Straits of Gibraltar. It was administratively attached to the Northwest African Coastal Air Force, but was operationally assigned to Fleet Air Wing 15 of the Moroccan Sea Frontier. Much of the squadron's flying time was spent providing convoy coverage to ships approaching or departing the Straits of Gibraltar, but it also flew patrols as far north as Cape Finisterre and as far west as 1000 miles west of Port Lyautey, French Morocco into the Atlantic.
As the German submarine threat in the Atlantic diminished and moved farther west in August 1943, the squadron moved to Protville Airfield, Tunisia in September. It attacked enemy submarines and shipping in the area of Sicily and the Italian peninsula until Operation Avalanche began with landings at Salerno, Italy. It extended antisubmarine patrols after 9 September to cover the sea west of Sardinia and Corsica. In addition to the antisubmarine patrols, the squadron covered the escape of Italian naval vessels from Genoa and Spezia to Malta following Italy's surrender. The squadron's actions in Europe earned it a Distinguished Unit Citation.
The squadron returned to Morocco on 18 September and returned to the United States in November 1943, it was inactivated in January 1944 and its personnel were used as cadres for newly forming heavy bomber groups.
Cold War
From 1958, the Boeing B-47 Stratojet wings of Strategic Air Command (SAC) began to assume an alert posture at their home bases, reducing the amount of time spent on alert at overseas bases. The SAC alert cycle divided itself into four parts: planning, flying, alert and rest to meet General Thomas S. Power’s initial goal of maintaining one third of SAC’s planes on fifteen minute ground alert, fully fueled and ready for combat to reduce vulnerability to a Soviet missile strike. To implement this new system B-47 wings reorganized from three to four squadrons. The 661st was activated at Pease Air Force Base as the fourth squadron of the 509th Bombardment Wing. The alert commitment was increased to half the squadron's aircraft in 1962 and the four squadron pattern no longer met the alert cycle commitment, so the squadron was inactivated on 1 January 1962.
In 1985, the two previous squadrons were consolidated, on paper, under the title of the 361st Tactical Missile Squadron.
Lineage
1st Antisubmarine Squadron
Constituted as the 361st Bombardment Squadron (Heavy) on 28 January 1942
Activated on 15 July 1942
Redesignated: 1st Antisubmarine Squadron (Heavy) on 23 November 1942
Disbanded on 29 January 1944
Reconstituted and consolidated with the 661st Bombardment Squadron, Medium as the 361st Tactical Missile Squadron on 19 September 1985
661st Bombardment Squadron
Constituted as the 661st Bombardment Squadron, Medium on 1 December 1958
Activated on 1 March 1959
Inactivated on 1 January 1962
Consolidated with the 1st Antisubmarine Squadron on 15 September 1985 as the 361st Tactical Missile Squadron
Consolidated Squadron
Formed on 15 September 1985 by consolidation of the 1st Antisubmarine Squadron and the 661st Bombardment Squadron (inactive)
Assignments
304th Bombardment Group, 15 July 1942 (air echelon attached to VIII Bomber Command after c. 10 November 1942)
25th Antisubmarine Wing, 30 December 1942 (air echelon attached to VIII Bomber Command until 15 January 1943), (attached to 1st Antisubmarine Group (Provisional) until l March 1943, 2037th Antisubmarine Wing (Provisional))
480th Antisubmarine Group, 21 June 1943 – 29 January 1944
509th Bombardment Wing, 1 March 1959 – 1 January 1962
Stations
Salt Lake City Army Air Base, Utah, 15 July 1942
Geiger Field, Washington, 15 September 1942
Ephrata Army Air Field, Washington, 1 October 1942
Langley Field, Virginia, 29 October–26 December 1942 (operated from RAF St Eval, England after 10 November 1942)
RAF St Eval (Sta 129), England, 13 January 1943
Port Lyautey, French Morocco, 9 March–27 November 1943 (operated from Agadir, French Morocco, July 1943, Protville Airfield, Tunisia, 2–18 September 1943)
Clovis Army Air Field, New Mexico, c. 4–29 January 1944
Pease Air Force Base, New Hampshire, 1 March 1959 – 1 January 1962
Aircraft
Boeing B-17 Flying Fortress, 1942
Consolidated B-24 Liberator, 1942-1944
Boeing B-47 Stratojet, 1958-1962
Awards and campaigns
References
Notes
Bibliography
Further reading
External links
(Introduction only, full article requires subscription)
Antisubmarine squadrons of the United States Army Air Forces
Military units and formations disestablished in 1944
|
```javascript
(function()
{
Sidebar.prototype.addEipPalette = function()
{
this.setCurrentSearchEntryLibrary('eip', 'eipMessage Construction');
this.addEipMessageConstructionPalette();
this.setCurrentSearchEntryLibrary('eip', 'eipMessage Routing');
this.addEipMessageRoutingPalette();
this.setCurrentSearchEntryLibrary('eip', 'eipMessage Transformation');
this.addEipMessageTransformationPalette();
this.setCurrentSearchEntryLibrary('eip', 'eipMessaging Channels');
this.addEipMessagingChannelsPalette();
this.setCurrentSearchEntryLibrary('eip', 'eipMessaging Endpoints');
this.addEipMessagingEndpointsPalette();
this.setCurrentSearchEntryLibrary('eip', 'eipMessaging Systems');
this.addEipMessagingSystemsPalette();
this.setCurrentSearchEntryLibrary('eip', 'eipSystem Management');
this.addEipSystemManagementPalette();
this.setCurrentSearchEntryLibrary();
}
// Adds EIP shapes
Sidebar.prototype.addEipMessageConstructionPalette = function(expand)
{
var s = "strokeWidth=2;dashed=0;align=center;fontSize=8;shape=";
var s2 = "strokeWidth=2;outlineConnect=0;dashed=0;align=center;fontSize=8;shape=mxgraph.eip.";
var s3 = "strokeWidth=3;outlineConnect=0;dashed=0;align=center;fontSize=8;shape=mxgraph.eip.";
var gn = 'mxgraph.eip';
var dt = 'eip enterprise integration pattern message construction ';
var sb = this;
var fns = [
this.createEdgeTemplateEntry('edgeStyle=none;html=1;strokeColor=#808080;endArrow=block;endSize=10;dashed=0;verticalAlign=bottom;strokeWidth=2;',
160, 0, '', 'Pipe', null, this.getTagsForStencil(gn, '', dt + 'pipe').join(' ')),
this.createVertexTemplateEntry(s + 'rect;fillColor=#c0f5a9;verticalLabelPosition=bottom;verticalAlign=top;html=1;',
150, 90, '', 'Filter', null, null, this.getTagsForStencil(gn, '', dt + 'filter').join(' ')),
this.addEntry(dt + 'command message', function()
{
var bg1 = new mxCell('', new mxGeometry(0, 0, 12, 12), s + 'ellipse;fillColor=#808080;strokeColor=none;');
bg1.vertex = true;
var bg2 = new mxCell('C', new mxGeometry(16, 18, 12, 12), s + 'rect;fillColor=#FF8080;fontStyle=1;whiteSpace=wrap;html=1;');
bg2.vertex = true;
var edge1 = new mxCell('', new mxGeometry(0, 0, 0, 0), 'edgeStyle=orthogonalEdgeStyle;rounded=0;exitX=0;exitY=0.5;endArrow=none;dashed=0;html=1;strokeColor=#808080;strokeWidth=2;');
edge1.geometry.relative = true;
edge1.edge = true;
bg1.insertEdge(edge1, false);
bg2.insertEdge(edge1, true);
return sb.createVertexTemplateFromCells([edge1, bg1, bg2], 28, 30, 'Command Message');
}),
this.addDataEntry(dt + 'correlation identifier', 78, 30, 'Correlation Identifier',
'7ZZNj9MwEIZ/Ta4oH/SD47a73RMSUg/your_sha256_hashiaRCtt3bdErRO8lSVSXGf5HlK/yRfXRjN+tG0EQZqe01C7hOehd6Dj/hAa4your_sha512_hash+kUU89T9hpH3qrSSRnKK+AW7VQYMWtybDYemPmSFqYCxTGJSfSJjegTcgTVHmmJAC6uew+qi9W41zDtDJoM5f5t58U8wn8fMZ3+O+esrmJ9JfdK4eQrp0OhK6ZDVmEhEb7V6QwgjpS6Q+5VMOPUdKqqYpx0T4I4/BlvilOyour_sha512_hash/qcR3kW8PjAWup9V8sBrdjP4uSSoStow9pJ+n0b87n4XQAMbG9Mb2j/aGGl/nerxcjL2R/your_sha512_hash'),
this.addEntry(dt + 'document message', function()
{
var bg1 = new mxCell('', new mxGeometry(0, 0, 12, 12), s + 'ellipse;fillColor=#808080;strokeColor=none;');
bg1.vertex = true;
var bg2 = new mxCell('D', new mxGeometry(16, 18, 12, 12), s + 'rect;fillColor=#C7A0FF;fontStyle=1;whiteSpace=wrap;html=1;');
bg2.vertex = true;
var edge1 = new mxCell('', new mxGeometry(0, 0, 0, 0), 'edgeStyle=orthogonalEdgeStyle;rounded=0;exitX=0;exitY=0.5;endArrow=none;dashed=0;html=1;strokeColor=#808080;strokeWidth=2;');
edge1.geometry.relative = true;
edge1.edge = true;
bg1.insertEdge(edge1, false);
bg2.insertEdge(edge1, true);
return sb.createVertexTemplateFromCells([edge1, bg1, bg2], 28, 30, 'Document Message');
}),
this.addEntry(dt + 'event message', function()
{
var bg1 = new mxCell('', new mxGeometry(0, 0, 12, 12), s + 'ellipse;fillColor=#808080;strokeColor=none;');
bg1.vertex = true;
var bg2 = new mxCell('E', new mxGeometry(16, 18, 12, 12), s + 'rect;fillColor=#83BEFF;fontStyle=1;whiteSpace=wrap;html=1;');
bg2.vertex = true;
var edge1 = new mxCell('', new mxGeometry(0, 0, 0, 0), 'edgeStyle=orthogonalEdgeStyle;rounded=0;exitX=0;exitY=0.5;endArrow=none;dashed=0;html=1;strokeColor=#808080;strokeWidth=2;');
edge1.geometry.relative = true;
edge1.edge = true;
bg1.insertEdge(edge1, false);
bg2.insertEdge(edge1, true);
return sb.createVertexTemplateFromCells([edge1, bg1, bg2], 28, 30, 'Event Message');
}),
this.createVertexTemplateEntry(s3 + 'messExp;html=1;verticalLabelPosition=bottom;verticalAlign=top',
48, 48, '', 'Message Expiration', null, null, this.getTagsForStencil(gn, '', dt + 'message expiration').join(' ')),
this.addDataEntry(dt + 'message sequence', 60, 24, 'Message Sequence',
'7ZbPb4MgFMf/Gu4KtvG6urWnJUt62Jnpm5KiGMSq++sHQlsM7bLDsmzZmjThfd8Pee+DRESyetxJ2laPogCOyAMimRRC2VU9ZsA5whErELlHGEf6j/D2hjeevVFLJTTqMwnYJhwp78EqVujUxJ2Q9/IIJjxGZANNcSelGLT5wkV+0FKlau68nZLiAJngQs65JM6ybRSdPc+sUJX2YFtpz97MM4i2pOibYn6KibZ7gKKERVud6GXupJWVFJUluE6TsPk50XW+your_sha256_hashyour_sha256_hashoVPR1qwl5Mp4GecexDTabtfZNbzRyour_sha512_hash+fxzrgQf554CT9Jh7avHxC2PvM/8J4Bw=='),
this.createVertexTemplateEntry(s3 + 'retAddr;html=1;verticalLabelPosition=bottom;fillColor=#FFE040;verticalAlign=top;',
78, 48, '', 'Return Address', null, null, this.getTagsForStencil(gn, 'retAddr', dt + 'return address').join(' '))
];
this.addPalette('eipMessage Construction', 'EIP / Message Construction', expand || false, mxUtils.bind(this, function(content)
{
for (var i = 0; i < fns.length; i++)
{
content.appendChild(fns[i](content));
}
}));
};
Sidebar.prototype.addEipMessageRoutingPalette = function(expand)
{
var s = "strokeWidth=2;dashed=0;align=center;fontSize=8;shape=rect;fillColor=#fffbc0;";
var s2 = "html=1;strokeWidth=2;outlineConnect=0;dashed=0;align=center;fontSize=8;fillColor=#c0f5a9;verticalLabelPosition=bottom;verticalAlign=top;shape=mxgraph.eip.";
var s3 = "edgeStyle=none;endArrow=none;dashed=0;html=1;strokeWidth=2;";
var gn = 'mxgraph.eip';
var dt = 'eip enterprise integration pattern message routing ';
var sb = this;
var fns = [
this.createVertexTemplateEntry(s2 + 'aggregator;',
150, 90, '', 'Aggregator', null, null, this.getTagsForStencil(gn, 'aggregator', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'composed_message_processor;',
150, 90, '', 'Composed Message Processor', null, null, this.getTagsForStencil(gn, 'composed_message_processor', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'content_based_router;',
150, 90, '', 'Content Based Router', null, null, this.getTagsForStencil(gn, 'content_based_router', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'dynamic_router;',
150, 90, '', 'Dynamic Router', null, null, this.getTagsForStencil(gn, 'dynamic_router', dt + '').join(' ')),
this.addDataEntry(dt + 'message broker', 120, 90, 'Message Broker',
'5ZjJboMwEIafxneDWZJjQ9qcesqhZxcGjGpwZJytT1+DnQUpUZEqmYQiIWb+YcbMZySwEUmqw0rSDXsXGXBEXhFJpBDKWNUhAc6Rj8sMkSXyfaxP5L/diXpdFG+ohFoNSfBNwo7yLRjFCI06cis0Soov+your_sha256_hashitO8jz/your_sha256_hashyour_sha256_hash+F/wPX2yLN/Yd8Z3NjLfFOchnTvmSyJnfOe/84WsgLV1a1HrywLq7EVKsb8oPeRMVXq8pXfGdj05pn5btAerEVuZQm/SFZUFqN6v4QCkEjhV5a5f/S+your_sha256_hashJ8QM='),
this.createVertexTemplateEntry(s2 + 'message_filter;',
150, 90, '', 'Message Filter', null, null, this.getTagsForStencil(gn, 'message_filter', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'process_manager;',
150, 90, '', 'Process Manager', null, null, this.getTagsForStencil(gn, 'process_manager', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'recipient_list;',
150, 90, '', 'Recipient List', null, null, this.getTagsForStencil(gn, 'recipient_list', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'resequencer;',
150, 90, '', 'Resequencer', null, null, this.getTagsForStencil(gn, 'resequencer', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'routing_slip;',
150, 90, '', 'Routing Slip', null, null, this.getTagsForStencil(gn, 'routing_slip', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'splitter;',
150, 90, '', 'Splitter', null, null, this.getTagsForStencil(gn, 'splitter', dt + '').join(' '))
];
this.addPalette('eipMessage Routing', 'EIP / Message Routing', expand || false, mxUtils.bind(this, function(content)
{
for (var i = 0; i < fns.length; i++)
{
content.appendChild(fns[i](content));
}
}));
};
Sidebar.prototype.addEipMessageTransformationPalette = function(expand)
{
var s = "html=1;strokeWidth=2;outlineConnect=0;dashed=0;align=center;fontSize=8;fillColor=#c0f5a9;verticalLabelPosition=bottom;verticalAlign=top;shape=mxgraph.eip.";
var gn = 'mxgraph.eip';
var dt = 'eip enterprise integration pattern message transformation ';
this.addPaletteFunctions('eipMessage Transformation', 'EIP / Message Transformation', false,
[
this.createVertexTemplateEntry(s + 'claim_check;',
150, 90, '', 'Claim Check', null, null, this.getTagsForStencil(gn, 'claim_check', dt + '').join(' ')),
this.createVertexTemplateEntry(s + 'content_enricher;',
150, 90, '', 'Content Enricher', null, null, this.getTagsForStencil(gn, 'content_enricher', dt + '').join(' ')),
this.createVertexTemplateEntry(s + 'content_filter;',
150, 90, '', 'Content Filter', null, null, this.getTagsForStencil(gn, 'content_filter', dt + '').join(' ')),
this.createVertexTemplateEntry(s + 'envelope_wrapper;',
150, 90, '', 'Envelope Wrapper', null, null, this.getTagsForStencil(gn, 'envelope_wrapper', dt + '').join(' ')),
this.createVertexTemplateEntry(s + 'normalizer;',
150, 90, '', 'Normalizer', null, null, this.getTagsForStencil(gn, 'normalizer', dt + '').join(' '))
]);
};
Sidebar.prototype.addEipMessagingChannelsPalette = function(expand)
{
var s = "strokeWidth=2;dashed=0;align=center;fontSize=8;html=1;shape=";
var s2 = "strokeWidth=2;outlineConnect=0;dashed=0;align=center;html=1;fontSize=8;shape=mxgraph.eip.";
var s3 = "strokeWidth=1;outlineConnect=0;dashed=0;align=center;html=1;fontSize=8;shape=mxgraph.eip.";
var gn = 'mxgraph.eip';
var dt = 'eip enterprise integration pattern messaging channel message ';
var sb = this;
var fns = [
this.createEdgeTemplateEntry('edgeStyle=none;html=1;strokeColor=#808080;endArrow=block;endSize=10;dashed=0;verticalAlign=bottom;strokeWidth=2;',
160, 0, '', 'Point to Point Channel', null, this.getTagsForStencil(gn, '', dt + 'point').join(' ')),
this.addDataEntry(dt + 'publish subscribe', 80, 160, 'Publish Subscribe Channel',
'7ZbBbsIwDIafJvfQMMR1FMYJaRKHnbPWayvSGLmBwZ5+bhNKYaAxDTihqlL8O3aS72/VChWXmynpZT7DFIxQE6FiQnR+your_sha256_hashyour_sha256_hashAznYnN1+I4W9TwFLcLTlKaGg708nt2FyOK3UlReytmLPgAcBw2kk6nckhCubtgTAps9E+MmhRQteCQR68phXl0dDNkaD1PRVQ1lfbabL3O8B0gwOUDlNGbgDLy+gR2C0K9aHrU4xC6WvWHDHH9R3FRWuKIEw6Qh0u+pF7Pt/Zs9A5iGJ5HLM0Goz2atdd94NJou72uPJ3Mue3VswOPLHPyTX8Ofp4c/1Xp/b2zV42PV/u4a3sovD/YfeT+/+B3wD'),
this.createVertexTemplateEntry(s2 + 'channel_adapter;fillColor=#9ddbef;',
45, 90, '', 'Channel Adapter', null, null, this.getTagsForStencil(gn, 'channel_adapter', dt + '').join(' ')),
this.createVertexTemplateEntry(s3 + 'messageChannel;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;',
100, 20, '', 'Message Channel', null, null, this.getTagsForStencil(gn, 'messageChannel', dt + '').join(' ')),
this.createVertexTemplateEntry(s3 + 'dataChannel;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;',
100, 20, '', 'Datatype Channel', null, null, this.getTagsForStencil(gn, 'dataChannel', dt + '').join(' ')),
this.createVertexTemplateEntry(s3 + 'deadLetterChannel;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;',
100, 20, '', 'Dead Letter Channel', null, null, this.getTagsForStencil(gn, 'deadLetterChannel', dt + '').join(' ')),
this.createVertexTemplateEntry(s3 + 'invalidMessageChannel;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;',
100, 20, '', 'Invalid Message Channel', null, null, this.getTagsForStencil(gn, 'invalidMessageChannel', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'messaging_bridge;verticalLabelPosition=bottom;verticalAlign=top;fillColor=#c0f5a9;',
150, 90, '', 'Messaging Bridge', null, null, this.getTagsForStencil(gn, 'messaging_bridge', dt + '').join(' ')),
this.addDataEntry(dt + 'message bus', 120, 140, 'Message Bus',
'7ZbPb8IgFMf/Gq6Gwma8rtV5WrLEw84ob4VISwOodX/9oLBq/ZF5MJ5s0+S9L7xX+your_sha256_hashSQWbJnaQFSiYN1eJcE6o9fwJbkTXiCI5lEptNKmm0Jxd/kRzqyA0DokTMmy9vHKrwX8zFy4ym9wmvnwW9duIX/CKyaho2BNiKu2DFaMQDajCqxlJRSC1XUwJk9LBeOgvbrdTkp7nYOuwJm9n7KPo+PoBt6l3YSC5BAWIEuRuvxpzMa87DsdvPRBsvOytfR/a4GXsEgpqKXezQ5Cfu670Zua9/ZCzd+M0TufLpVerbsSZtxFMXmdpcLjdMDsCNEZ5QkOdw8iLH6Awb+nBDf4rm4gY0AxJ7fDVpd8T6WfWvqOBLdDoglw9nJCzuqNWUEqOoHXr+Imni9Png/geXry7sfv9cnvgefx/vzGT34P4JfhewH06eE/Jk4//s35BQ==')
];
this.addPalette('eipMessaging Channels', 'EIP / Messaging Channels', expand || false, mxUtils.bind(this, function(content)
{
for (var i = 0; i < fns.length; i++)
{
content.appendChild(fns[i](content));
}
}));
};
Sidebar.prototype.addEipMessagingEndpointsPalette = function(expand)
{
var s = "dashed=0;outlineConnect=0;strokeWidth=2;html=1;align=center;fontSize=8;verticalLabelPosition=bottom;verticalAlign=top;shape=mxgraph.eip.";
var s2 = 'fillColor=#c0f5a9;' + s;
var gn = 'mxgraph.eip';
var dt = 'eip enterprise integration pattern messaging endpoint ';
this.addPaletteFunctions('eipMessaging Endpoints', 'EIP / Messaging Endpoints', false,
[
this.createVertexTemplateEntry(s2 + 'competing_consumers;',
150, 90, '', 'Competing Consumers', null, null, this.getTagsForStencil(gn, 'competing_consumers', dt + '').join(' ')),
this.createVertexTemplateEntry(s + 'durable_subscriber;fillColor=#a0a0a0;',
30, 35, '', 'Durable Subscriber', null, null, this.getTagsForStencil(gn, 'durable_subscriber', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'event_driven_consumer;',
150, 90, '', 'Event Driven Consumer', null, null, this.getTagsForStencil(gn, 'event_driven_consumer', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'message_dispatcher;',
150, 90, '', 'Message Dispatcher', null, null, this.getTagsForStencil(gn, 'message_dispatcher', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'messaging_gateway;',
150, 90, '', 'Messaging Gateway', null, null, this.getTagsForStencil(gn, 'messaging_gateway', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'polling_consumer;',
150, 90, '', 'Polling Consumer', null, null, this.getTagsForStencil(gn, 'polling_consumer', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'selective_consumer;',
150, 90, '', 'Selective Consumer', null, null, this.getTagsForStencil(gn, 'selective_consumer', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'service_activator;',
150, 90, '', 'Service Activator', null, null, this.getTagsForStencil(gn, 'service_activator', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'transactional_client;',
150, 90, '', 'Transactional Client', null, null, this.getTagsForStencil(gn, 'transactional_client', dt + '').join(' '))
]);
};
Sidebar.prototype.addEipMessagingSystemsPalette = function(expand)
{
var s = "strokeWidth=2;dashed=0;align=center;fontSize=8;shape=";
var s2 = "html=1;strokeWidth=2;outlineConnect=0;dashed=0;align=center;fontSize=8;shape=mxgraph.eip.";
var s3 = "html=1;strokeWidth=1;dashed=0;align=center;fontSize=8;shape=";
var s4 = "strokeWidth=1;outlineConnect=0;dashed=0;align=center;fontSize=8;shape=mxgraph.eip.";
var gn = 'mxgraph.eip';
var dt = 'eip enterprise integration pattern messaging system ';
var sb = this;
var fns = [
this.createVertexTemplateEntry(s2 + 'content_based_router;verticalLabelPosition=bottom;verticalAlign=top;fillColor=#c0f5a9;',
150, 90, '', 'Message Router', null, null, this.getTagsForStencil(gn, 'content_based_router', dt + '').join(' ')),
this.createVertexTemplateEntry(s4 + 'messageChannel;html=1;verticalLabelPosition=bottom;verticalAlign=top;',
100, 20, '', 'Message Channel', null, null, this.getTagsForStencil(gn, 'messageChannel', dt + '').join(' ')),
this.addEntry(dt + 'message endpoint', function()
{
var bg1 = new mxCell('', new mxGeometry(0, 0, 150, 90), s + 'rect;verticalLabelPosition=bottom;verticalAlign=top;fillColor=#c0f5a9;html=1;');
bg1.vertex = true;
var bg2 = new mxCell('', new mxGeometry(85, 25, 40, 40), s3 + 'rect;');
bg2.vertex = true;
bg1.insert(bg2);
return sb.createVertexTemplateFromCells([bg1], bg1.geometry.width, bg1.geometry.height, 'Message Endpoint');
}),
this.addEntry(dt + 'message endpoint', function()
{
var bg1 = new mxCell('', new mxGeometry(0, 0, 150, 90), s + 'rect;verticalLabelPosition=bottom;verticalAlign=top;fillColor=#c0f5a9;html=1;');
bg1.vertex = true;
var bg2 = new mxCell('', new mxGeometry(25, 25, 40, 40), s3 + 'rect');
bg2.vertex = true;
bg1.insert(bg2);
return sb.createVertexTemplateFromCells([bg1], bg1.geometry.width, bg1.geometry.height, 'Message Endpoint');
}),
this.addDataEntry(dt + 'message endpoint', 400, 90, 'Message Endpoint',
'your_sha512_hashxII1Jj5fsIlPI4k4nnTz3OmXk8/your_sha256_hasho7NjKANsMKCFvLLVg+your_sha256_hashh3koYu5UQlgbNKDdsTgfGdHs0abC/ylMNOZLmgDmQPpiUndu3zQgbLlkGMs1c2chhomr89FR6Zt0Yjvh+Efx7RRg8VoRVfT2DCLxfBFfAw6bi0HVbEgU9CgUPUCh4/mPyoH4/Uc0uyP2z/g+fv//vZTf4kd3hvzXyy+your_sha256_hash64Le4vBBoye/curNmY3U1HpQo3OobOi9csJgXq9OINJ0WDEiS33dHv0Ma45+98Hev8BnwD'),
this.addDataEntry(dt + 'message', 28, 48, 'Message',
'5ZVNb8IwDIZ/Ta9TaEcFx1E+your_sha256_hashyour_sha256_hashDmvvKo1M5UpSsTipM622MgW7IzEeNByfz+wXa9your_sha512_hash/SWpNtFjWoEqAPXeLNEgKPJdd3daOTc/rjtBNobn3M88+hfM4z/F/P5z5pen7JCigufS2BtTOxhCs0xJXPM3mz2xkBgtrW3+l5eVBZ1xIYZxHiKyour_sha512_hash+N7706ce4N2xL/cjiybTsnlLH/Ujr4enLXo+9sRxT/VDuOebug21rnA3wE='),
this.addEntry(dt + 'message', function()
{
var bg1 = new mxCell('', new mxGeometry(0, 0, 12, 12), s + 'ellipse;fillColor=#808080;strokeColor=none;');
bg1.vertex = true;
var bg2 = new mxCell('', new mxGeometry(16, 18, 12, 12), s + 'rect;fillColor=#80FF6C;fontStyle=1;whiteSpace=wrap;html=1;');
bg2.vertex = true;
var edge1 = new mxCell('', new mxGeometry(0, 0, 0, 0), 'edgeStyle=orthogonalEdgeStyle;rounded=0;exitX=0;exitY=0.5;endArrow=none;dashed=0;html=1;strokeColor=#808080;strokeWidth=2;');
edge1.geometry.relative = true;
edge1.edge = true;
bg1.insertEdge(edge1, false);
bg2.insertEdge(edge1, true);
return sb.createVertexTemplateFromCells([edge1, bg1, bg2], 28, 30, 'Message');
}),
this.addDataEntry(dt + 'message', 28, 48, 'Message',
'vZTBboMwDIafhutEoZva40q7nnbqYdsxKoZECzEKbqF7+jkkbYcY2qROAyHZv/MH5yMkSrOq21pRy2fMQUfpJkozi0g+qroMtI6SWOVRuo6SJOYnSp4mqrO+GtfCgqHfGBJvOAp9AK94oaGTDgLkJexCipYklmiE3lzVlcWDycHNGHMGnaLXL/Gbi+/uXWbyR2uxZcGgcc5cNPJilFTxyour_sha512_hash+your_sha256_hash6Gue5Er5K6A8sQTe5ryZotaFnNyKsS4IqJQ21W/jN/42fhT2N4RXFchmP4XEl7q/zfKGd2XBrt1IR7GrR782Wf/wbgZ8ND95xCunCp3//OTi9Hk99bXB6fQI='),
this.addEntry(dt + 'message', function()
{
var bg1 = new mxCell('', new mxGeometry(0, 0, 12, 12), s + 'ellipse;fillColor=#808080;strokeColor=none;');
bg1.vertex = true;
var bg2 = new mxCell('', new mxGeometry(16, 18, 12, 12), s2 + 'message_1;fillColor=#ff5500;fontStyle=1;whiteSpace=wrap;html=1;');
bg2.vertex = true;
var edge1 = new mxCell('', new mxGeometry(0, 0, 0, 0), 'edgeStyle=orthogonalEdgeStyle;rounded=0;exitX=0;exitY=0.5;endArrow=none;dashed=0;html=1;strokeColor=#808080;strokeWidth=2;');
edge1.geometry.relative = true;
edge1.edge = true;
bg1.insertEdge(edge1, false);
bg2.insertEdge(edge1, true);
return sb.createVertexTemplateFromCells([edge1, bg1, bg2], 28, 30, 'Message');
}),
this.addEntry(dt + 'message', function()
{
var bg1 = new mxCell('', new mxGeometry(0, 0, 12, 12), s + 'ellipse;fillColor=#808080;strokeColor=none;');
bg1.vertex = true;
var bg2 = new mxCell('', new mxGeometry(16, 18, 12, 12), s2 + 'message_2;fillColor=#00cc00;fontStyle=1;whiteSpace=wrap;html=1;');
bg2.vertex = true;
var edge1 = new mxCell('', new mxGeometry(0, 0, 0, 0), 'edgeStyle=orthogonalEdgeStyle;rounded=0;exitX=0;exitY=0.5;endArrow=none;dashed=0;html=1;strokeColor=#808080;strokeWidth=2;');
edge1.geometry.relative = true;
edge1.edge = true;
bg1.insertEdge(edge1, false);
bg2.insertEdge(edge1, true);
return sb.createVertexTemplateFromCells([edge1, bg1, bg2], 28, 30, 'Message');
}),
this.createVertexTemplateEntry(s2 + 'message_translator;fillColor=#c0f5a9;verticalLabelPosition=bottom;verticalAlign=top;',
150, 90, '', 'Message-Translator', null, null, this.getTagsForStencil(gn, 'message_translator', dt + '').join(' '))
];
this.addPalette('eipMessaging Systems', 'EIP / Messaging Systems', expand || false, mxUtils.bind(this, function(content)
{
for (var i = 0; i < fns.length; i++)
{
content.appendChild(fns[i](content));
}
}));
};
Sidebar.prototype.addEipSystemManagementPalette = function(expand)
{
var s2 = "html=1;strokeWidth=2;outlineConnect=0;dashed=0;align=center;fontSize=8;verticalLabelPosition=bottom;verticalAlign=top;shape=mxgraph.eip.";
var gn = 'mxgraph.eip';
var dt = 'eip enterprise integration pattern system management ';
this.addPaletteFunctions('eipSystem Management', 'EIP / System Management', false,
[
this.createVertexTemplateEntry(s2 + 'channel_purger;fillColor=#c0f5a9',
150, 90, '', 'Channel Purger', null, null, this.getTagsForStencil(gn, 'channel_purger', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'control_bus;fillColor=#c0f5a9',
60, 40, '', 'Control Bus', null, null, this.getTagsForStencil(gn, 'control_bus', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'detour;fillColor=#c0f5a9',
150, 90, '', 'Detour', null, null, this.getTagsForStencil(gn, 'detour', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'message_store;fillColor=#c0f5a9',
150, 90, '', 'Message Store', null, null, this.getTagsForStencil(gn, 'message_store', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'smart_proxy;fillColor=#c0f5a9',
70, 90, '', 'Smart Proxy', null, null, this.getTagsForStencil(gn, 'smart_proxy', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'test_message;fillColor=#c0f5a9',
150, 90, '', 'Test Message', null, null, this.getTagsForStencil(gn, 'test_message', dt + '').join(' ')),
this.createVertexTemplateEntry(s2 + 'wire_tap;fillColor=#c0f5a9',
150, 90, '', 'Wire Tap', null, null, this.getTagsForStencil(gn, 'wire_tap', dt + '').join(' '))
]);
};
})();
```
|
The 22223/22224 Mumbai CSMT–Sainagar Shirdi Vande Bharat Express is India's 10th Vande Bharat Express train, running across the state of Maharashtra.
Overview
This train is operated by Indian Railways, connecting Mumbai CSMT, Dadar Ctrl, Thane, Kalyan Jn, Nashik Road and Sainagar Shirdi Terminus. It is currently operated with train numbers 22223/22224 on 6 days a week basis.
Rakes
It is the eighth 2nd Generation Vande Bharat Express train and was designed and manufactured by the Integral Coach Factory (ICF) under the leadership of Sudhanshu Mani at Perambur, Chennai under the Make in India initiative.
Coach Composition
The 22223/22224 Mumbai CSMT–Sainagar Shirdi Vande Bharat Express currently has 14 AC Chair Car and 2 Executive Chair Cars coaches.
The coaches in Aqua colour indicate AC Chair Cars and the coaches in Pink colour indicate AC Executive Chair Cars.
Service
The 22223/22224 Mumbai CSMT–Sainagar Shirdi Vande Bharat Express will currently operate 6 days a week, covering a distance of 339 km (211 mi) in a travel time of 5 hrs 20 mins with average speed of 64 km/h. The Maximum Permissible Speed (MPS) given is 110 km/h.
Schedule
The schedule of this 22223/22224 Mumbai CSMT–Sainagar Shirdi Vande Bharat Express is given below:-
See also
Vande Bharat Express
Tejas Express
Gatimaan Express
Mumbai CSMT Terminus
Sainagar Shirdi Terminus
References
Vande Bharat Express trains
Named passenger trains of India
Higher-speed rail
Express trains in India
Transport in Mumbai
Rail transport in Mumbai
Rail transport in Maharashtra
Transport in Shirdi
|
The 2022 United States Senate election in Ohio was held on November 8, 2022, to elect a member of the United States Senate to represent the State of Ohio. Republican writer and venture capitalist J. D. Vance defeated Democratic U.S. Representative Tim Ryan to succeed retiring incumbent Republican Rob Portman.
Vance won by a 6.1 point margin, which was significantly closer than all other concurrently held elections for statewide offices in Ohio won by Republicans. Despite his defeat, Ryan flipped four counties carried by Portman in re-election in 2016: Summit, Montgomery, Hamilton, and Lorain, the latter of which Trump won in 2020. However, Vance scored wins in Ryan's home county of Trumbull and the industrial-based Mahoning County that contains much of Youngstown. Both counties were represented by Ryan in his congressional district.
Vance was endorsed by Donald Trump and became the only candidate in the seven statewide general election races funded by Trump's PAC to win.
Republican primary
As a result of Portman's retirement, this primary was expected to be one of the most competitive in the nation. Due to his high approval ratings within the Republican Party, most of the candidates sought the endorsement of former President Donald Trump. Former State Treasurer Josh Mandel, who had been the Republican nominee for Senate in 2012, led most polls until late January, when businessman Mike Gibbons surged after spending millions in TV ads. At a forum in March 2022, Gibbons and Mandel got into a forceful argument over Mandel's private sector experience. The debate moderator interfered after it was feared that the two candidates would come to blows. On April 9, Gibbons said that middle-class Americans don't pay enough in income taxes, which immediately led to his poll numbers plummeting. On April 15, Trump endorsed writer and commentator J. D. Vance, who had criticized him in the past.
Vance had been trailing in the polls, but as a result of Trump's support, he surged to become the race's frontrunner for the first time and led in most polls up to election day. Meanwhile, State Senator Matt Dolan, who disavowed Trump's claims of voter fraud in the 2020 United States presidential election, saw a late surge after buying ad time. Vance won with 32% of the vote with Mandel in second and Dolan in a close third. The primary was considered by many as a test of Trump's influence over the Republican Party as he won Ohio by 8 points in 2020. The primary was also the most expensive in the state's history, with the candidates spending a combined $66 million throughout the campaign.
Candidates
Nominee
J. D. Vance, author of Hillbilly Elegy, U.S. Marine Corps veteran, and venture capitalist
Eliminated in primary
Matt Dolan, state senator from the 24th district since 2017 and nominee for Cuyahoga County executive in 2010
Mike Gibbons, investment banker and candidate for the U.S. Senate in 2018
Josh Mandel, U.S. Marine Corps Reserve Iraq War veteran, former Ohio state treasurer (2011–2019), nominee for the U.S. Senate in 2012 and candidate for the U.S. Senate in 2018
Neil Patel, businessman
Mark Pukita, IT executive
Jane Timken, former chair of the Ohio Republican Party (2017–2021)
Withdrawn
John Berman, electronic hardware design, test engineer and candidate for U.S. Senate (Minnesota and Kansas) in 2020
Bernie Moreno, businessman
Disqualified
Bill Graham, attorney
Mike Holt
Michael Leipold, MedFlight pilot and retired U.S. Army chief warrant officer
MacKenzie Thompson, U.S. Air Force veteran
Declined
Troy Balderson, U.S. representative for Ohio's 12th congressional district (2018–present)
Warren Davidson, U.S. representative for Ohio's 8th congressional district (2016–present)
Anthony Gonzalez, U.S. representative for Ohio's 16th congressional district (2019–2023)
Jon A. Husted, lieutenant governor of Ohio (2019–present) (ran for re-election)
Bill Johnson, U.S. representative for Ohio's 6th congressional district (2011–present)
Jim Jordan, U.S. representative for Ohio's 4th congressional district (2007–present) (running for re-election)
David Joyce, U.S. representative for Ohio's 14th congressional district (2013–present) (ran for re-election)
John Kasich, former governor of Ohio (2011–2019) and candidate for President of the United States in 2000 and 2016
Mark Kvamme, co-founder of Drive Capital
Frank LaRose, Ohio secretary of state (2019–present) (endorsed Vance) (ran for re-election)
Rob Portman, incumbent U.S. Senator (2011–2023)
Vivek Ramaswamy, entrepreneur, author and businessman
Jim Renacci, former U.S. representative for Ohio's 16th congressional district (2011–2019) and nominee for U.S. Senate in 2018 (ran for governor)
Geraldo Rivera, journalist, author, attorney, and former TV host
Darrell C. Scott, pastor and CEO of the National Diversity Coalition for Trump (endorsed Moreno) (expressed interest in running for Ohio's 16th congressional district)
Steve Stivers, former U.S. representative for Ohio's 15th congressional district (2011–2021)
Pat Tiberi, former U.S. representative for Ohio's 12th congressional district (2001–2018)
Jim Tressel, president of Youngstown State University and former Ohio State football coach
Mike Turner, U.S. representative for Ohio's 10th congressional district (2003–present) (ran for re-election)
Brad Wenstrup, U.S. representative for Ohio's 2nd congressional district (2013–present) (ran for re-election)
Dave Yost, attorney general of Ohio (2019–present) and former Ohio state auditor (2011–2019) (ran for re-election)
Endorsements
Polling
Graphical summary
Results
Democratic primary
Candidates
Nominee
Tim Ryan, U.S. representative for Ohio's 13th congressional district (2013–2023) and candidate for President of the United States in 2020
Eliminated in primary
Morgan Harper, former senior advisor at the Consumer Financial Protection Bureau and candidate for in 2020
Traci Johnson, activist and tech executive
Disqualified
Demar Sheffey, treasurer of the Cuyahoga Soil and Water Conservation District
Rick Taylor
LaShondra Tinsley, former case manager for Franklin County Jobs and Family Services
Declined
Amy Acton, former director of the Ohio Department of Health
Joyce Beatty, U.S. representative for Ohio's 3rd congressional district (2013–present) (ran for re-election)
Kevin Boyce, president of the Franklin County board of commissioners and former Ohio State Treasurer
Kathleen Clyde, former Portage County commissioner, former state representative, and nominee for Ohio Secretary of State in 2018
John Cranley, former mayor of Cincinnati (ran for governor)
Michael Coleman, former Mayor of Columbus
LeBron James, professional basketball player for the Los Angeles Lakers and former player for the Cleveland Cavaliers
Zach Klein, Columbus city attorney
Danny O'Connor, Franklin county recorder and nominee for Ohio's 12th congressional district in 2018
Aftab Pureval, attorney and Hamilton County clerk of courts (elected Mayor of Cincinnati in 2021)
Alicia Reece, Hamilton County commissioner
Connie Schultz, former columnist for The Plain Dealer and wife of U.S. Senator Sherrod Brown
Emilia Sykes, minority leader of the Ohio House of Representatives (ran for the U.S. House in Ohio's 13th congressional district)
Nina Turner, president of Our Revolution, former state senator, and nominee for Ohio Secretary of State in 2014 (ran for the U.S. House in Ohio's 11th congressional district)
Nan Whaley, former mayor of Dayton (ran for governor)
Endorsements
Polling
Results
Third-party and independent candidates
Candidates
Declared
Stephen Faris, candidate for the U.S. Senate in 2018 (write-in)
John Cheng (write-in)
Matthew R. Esh (write-in)
Shane Hoffman (write-in)
Lashondra Tinsley (write-in)
Disqualified
Shannon Marie Taylor (Libertarian)
Sam Ronan, United States Air Force veteran, candidate for Ohio's 1st congressional district in 2018, and candidate for chair of the Democratic National Committee in 2017 (Independent)
Eric Meiring (Independent)
General election
Ohio has trended Republican in recent years, voting for Donald Trump by eight points in both the 2016 and 2020 presidential elections. As such, most analysts expected that this seat would easily remain in Republican hands. However, aggregate polling on the run-up to the election indicated a competitive race, and most outlets considered it to be “lean Republican”. In the end, J. D. Vance held the open seat for the Republicans.
Predictions
Debates
Endorsements
Polling
Aggregate polls
Graphical summary
Josh Mandel vs. Amy Acton
Josh Mandel vs. Tim Ryan
Jane Timken vs. Amy Acton
Jane Timken vs. Tim Ryan
J. D. Vance vs. Amy Acton
Results
County Results
Counties that flipped from Republican to Democratic
Hamilton (largest municipality: Cincinnati)
Lorain (largest municipality: Lorain)
Montgomery (largest municipality: Dayton)
Summit (largest municipality: Akron)
By congressional district
Vance won 10 of 15 congressional districts.
Voter demographics
According to exit polls by the National Election Pool, Vance won the election (53% to 47%), winning majority of white voters (59% to 40%), while Ryan received majorities of Black vote (86% to 13%) and, to smaller extent, Latino vote (59% to 41%).
See also
2022 United States Senate elections
2022 Ohio elections
Notes
Partisan clients
References
External links
Official campaign websites
Stephen Faris (I) for Senate
Sam Ronan (I) for Senate
Tim Ryan (D) for Senate
J. D. Vance (R) for Senate
Ohio
2022
United States Senate
|
```c++
//
// stream_descriptor.cpp
// ~~~~~~~~~~~~~~~~~~~~~
//
//
// file LICENSE_1_0.txt or copy at path_to_url
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include <boost/asio/posix/stream_descriptor.hpp>
#include <boost/asio/io_context.hpp>
#include "../archetypes/async_result.hpp"
#include "../unit_test.hpp"
//your_sha256_hash--------------
// posix_stream_descriptor_compile test
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// The following test checks that all public member functions on the class
// posix::stream_descriptor compile and link correctly. Runtime failures are
// ignored.
namespace posix_stream_descriptor_compile {
void wait_handler(const boost::system::error_code&)
{
}
void write_some_handler(const boost::system::error_code&, std::size_t)
{
}
void read_some_handler(const boost::system::error_code&, std::size_t)
{
}
void test()
{
#if defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
using namespace boost::asio;
namespace posix = boost::asio::posix;
try
{
io_context ioc;
char mutable_char_buffer[128] = "";
const char const_char_buffer[128] = "";
posix::descriptor_base::bytes_readable io_control_command;
archetypes::lazy_handler lazy;
boost::system::error_code ec;
// basic_stream_descriptor constructors.
posix::stream_descriptor descriptor1(ioc);
int native_descriptor1 = -1;
posix::stream_descriptor descriptor2(ioc, native_descriptor1);
#if defined(BOOST_ASIO_HAS_MOVE)
posix::stream_descriptor descriptor3(std::move(descriptor2));
#endif // defined(BOOST_ASIO_HAS_MOVE)
// basic_stream_descriptor operators.
#if defined(BOOST_ASIO_HAS_MOVE)
descriptor1 = posix::stream_descriptor(ioc);
descriptor1 = std::move(descriptor2);
#endif // defined(BOOST_ASIO_HAS_MOVE)
// basic_io_object functions.
#if !defined(BOOST_ASIO_NO_DEPRECATED)
io_context& ioc_ref = descriptor1.get_io_context();
(void)ioc_ref;
#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
posix::stream_descriptor::executor_type ex = descriptor1.get_executor();
(void)ex;
// basic_descriptor functions.
posix::stream_descriptor::lowest_layer_type& lowest_layer
= descriptor1.lowest_layer();
(void)lowest_layer;
const posix::stream_descriptor& descriptor4 = descriptor1;
const posix::stream_descriptor::lowest_layer_type& lowest_layer2
= descriptor4.lowest_layer();
(void)lowest_layer2;
int native_descriptor2 = -1;
descriptor1.assign(native_descriptor2);
bool is_open = descriptor1.is_open();
(void)is_open;
descriptor1.close();
descriptor1.close(ec);
posix::stream_descriptor::native_handle_type native_descriptor3
= descriptor1.native_handle();
(void)native_descriptor3;
posix::stream_descriptor::native_handle_type native_descriptor4
= descriptor1.release();
(void)native_descriptor4;
descriptor1.cancel();
descriptor1.cancel(ec);
descriptor1.io_control(io_control_command);
descriptor1.io_control(io_control_command, ec);
bool non_blocking1 = descriptor1.non_blocking();
(void)non_blocking1;
descriptor1.non_blocking(true);
descriptor1.non_blocking(false, ec);
bool non_blocking2 = descriptor1.native_non_blocking();
(void)non_blocking2;
descriptor1.native_non_blocking(true);
descriptor1.native_non_blocking(false, ec);
descriptor1.wait(posix::descriptor_base::wait_read);
descriptor1.wait(posix::descriptor_base::wait_write, ec);
descriptor1.async_wait(posix::descriptor_base::wait_read, &wait_handler);
int i1 = descriptor1.async_wait(posix::descriptor_base::wait_write, lazy);
(void)i1;
// basic_stream_descriptor functions.
descriptor1.write_some(buffer(mutable_char_buffer));
descriptor1.write_some(buffer(const_char_buffer));
descriptor1.write_some(null_buffers());
descriptor1.write_some(buffer(mutable_char_buffer), ec);
descriptor1.write_some(buffer(const_char_buffer), ec);
descriptor1.write_some(null_buffers(), ec);
descriptor1.async_write_some(buffer(mutable_char_buffer),
write_some_handler);
descriptor1.async_write_some(buffer(const_char_buffer),
write_some_handler);
descriptor1.async_write_some(null_buffers(),
write_some_handler);
int i2 = descriptor1.async_write_some(buffer(mutable_char_buffer), lazy);
(void)i2;
int i3 = descriptor1.async_write_some(buffer(const_char_buffer), lazy);
(void)i3;
int i4 = descriptor1.async_write_some(null_buffers(), lazy);
(void)i4;
descriptor1.read_some(buffer(mutable_char_buffer));
descriptor1.read_some(buffer(mutable_char_buffer), ec);
descriptor1.read_some(null_buffers(), ec);
descriptor1.async_read_some(buffer(mutable_char_buffer), read_some_handler);
descriptor1.async_read_some(null_buffers(), read_some_handler);
int i5 = descriptor1.async_read_some(buffer(mutable_char_buffer), lazy);
(void)i5;
int i6 = descriptor1.async_read_some(null_buffers(), lazy);
(void)i6;
}
catch (std::exception&)
{
}
#endif // defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
}
} // namespace posix_stream_descriptor_compile
//your_sha256_hash--------------
BOOST_ASIO_TEST_SUITE
(
"posix/stream_descriptor",
BOOST_ASIO_TEST_CASE(posix_stream_descriptor_compile::test)
)
```
|
```python
"""
Module for testing the model_selection.search module.
"""
import os
import numpy as np
import pytest
from scipy.stats import randint, uniform
from surprise import Dataset, Reader, SVD
from surprise.model_selection import (
cross_validate,
GridSearchCV,
KFold,
PredefinedKFold,
RandomizedSearchCV,
)
# Tests for GridSearchCV class
def test_basesearchcv_parse_options():
"""Check that _parse_options explodes nested dictionaries."""
param_grid = {
"bsl_options": {"method": ["als", "sgd"], "reg": [1, 2]},
"k": [2, 3],
"sim_options": {
"name": ["msd", "cosine"],
"min_support": [1, 5],
"user_based": [False],
},
}
gs = GridSearchCV(SVD, param_grid)
parsed_params = gs.param_grid
assert len(parsed_params["sim_options"]) == 4 # 2 method x 2 reg
assert len(parsed_params["bsl_options"]) == 4 # 2 method x 2 reg
def test_gridsearchcv_parameter_combinations():
"""Make sure that parameter_combinations attribute is correct (has correct
size). Dict parameters like bsl_options and sim_options require special
treatment in the param_grid argument. We here test both in one shot with
KNNBaseline."""
param_grid = {
"bsl_options": {"method": ["als", "sgd"], "reg": [1, 2]},
"k": [2, 3],
"sim_options": {
"name": ["msd", "cosine"],
"min_support": [1, 5],
"user_based": [False],
},
}
gs = GridSearchCV(SVD, param_grid)
assert len(gs.param_combinations) == 32
def test_gridsearchcv_best_estimator(u1_ml100k):
"""Ensure that the best estimator is the one giving the best score (by
re-running it)"""
param_grid = {
"n_epochs": [5],
"lr_all": [0.002, 0.005],
"reg_all": [0.4, 0.6],
"n_factors": [1],
"init_std_dev": [0],
}
gs = GridSearchCV(
SVD, param_grid, measures=["mae"], cv=PredefinedKFold(), joblib_verbose=100
)
gs.fit(u1_ml100k)
best_estimator = gs.best_estimator["mae"]
# recompute MAE of best_estimator
mae = cross_validate(
best_estimator, u1_ml100k, measures=["MAE"], cv=PredefinedKFold()
)["test_mae"]
assert mae == gs.best_score["mae"]
def test_gridsearchcv_same_splits():
"""Ensure that all parameter combinations are tested on the same splits (we
check their RMSE scores are the same once averaged over the splits, which
should be enough)."""
data_file = os.path.join(os.path.dirname(__file__), "./u1_ml100k_test")
data = Dataset.load_from_file(data_file, reader=Reader("ml-100k"))
kf = KFold(3, shuffle=True, random_state=4)
# all RMSE should be the same (as param combinations are the same)
param_grid = {
"n_epochs": [5],
"lr_all": [0.2, 0.2],
"reg_all": [0.4, 0.4],
"n_factors": [5],
"random_state": [0],
}
gs = GridSearchCV(SVD, param_grid, measures=["RMSE"], cv=kf, n_jobs=1)
gs.fit(data)
rmse_scores = [m for m in gs.cv_results["mean_test_rmse"]]
assert len(set(rmse_scores)) == 1 # assert rmse_scores are all equal
# Note: actually, even when setting random_state=None in kf, the same folds
# are used because we use product(param_comb, kf.split(...)). However, it's
# needed to have the same folds when calling fit again:
gs.fit(data)
rmse_scores += [m for m in gs.cv_results["mean_test_rmse"]]
assert len(set(rmse_scores)) == 1 # assert rmse_scores are all equal
def test_gridsearchcv_cv_results():
"""Test the cv_results attribute"""
f = os.path.join(os.path.dirname(__file__), "./u1_ml100k_test")
data = Dataset.load_from_file(f, Reader("ml-100k"))
kf = KFold(3, shuffle=True, random_state=4)
param_grid = {
"n_epochs": [5],
"lr_all": [0.2, 0.4],
"reg_all": [0.4, 0.6],
"n_factors": [5],
"random_state": [0],
}
gs = GridSearchCV(
SVD,
param_grid,
measures=["RMSE", "mae", "fcp"],
cv=kf,
return_train_measures=True,
)
gs.fit(data)
# test keys split*_test_rmse, mean and std dev.
assert gs.cv_results["split0_test_rmse"].shape == (4,) # 4 param comb.
assert gs.cv_results["split1_test_rmse"].shape == (4,) # 4 param comb.
assert gs.cv_results["split2_test_rmse"].shape == (4,) # 4 param comb.
assert gs.cv_results["mean_test_rmse"].shape == (4,) # 4 param comb.
assert np.allclose(
gs.cv_results["mean_test_rmse"],
np.mean(
[
gs.cv_results["split0_test_rmse"],
gs.cv_results["split1_test_rmse"],
gs.cv_results["split2_test_rmse"],
],
axis=0,
),
)
assert np.allclose(
gs.cv_results["std_test_rmse"],
np.std(
[
gs.cv_results["split0_test_rmse"],
gs.cv_results["split1_test_rmse"],
gs.cv_results["split2_test_rmse"],
],
axis=0,
),
)
# test keys split*_train_mae, mean and std dev.
assert gs.cv_results["split0_train_rmse"].shape == (4,) # 4 param comb.
assert gs.cv_results["split1_train_rmse"].shape == (4,) # 4 param comb.
assert gs.cv_results["split2_train_rmse"].shape == (4,) # 4 param comb.
assert gs.cv_results["mean_train_rmse"].shape == (4,) # 4 param comb.
assert np.allclose(
gs.cv_results["mean_train_rmse"],
np.mean(
[
gs.cv_results["split0_train_rmse"],
gs.cv_results["split1_train_rmse"],
gs.cv_results["split2_train_rmse"],
],
axis=0,
),
)
assert np.allclose(
gs.cv_results["std_train_rmse"],
np.std(
[
gs.cv_results["split0_train_rmse"],
gs.cv_results["split1_train_rmse"],
gs.cv_results["split2_train_rmse"],
],
axis=0,
),
)
# test fit and train times dimensions.
assert gs.cv_results["mean_fit_time"].shape == (4,) # 4 param comb.
assert gs.cv_results["std_fit_time"].shape == (4,) # 4 param comb.
assert gs.cv_results["mean_test_time"].shape == (4,) # 4 param comb.
assert gs.cv_results["std_test_time"].shape == (4,) # 4 param comb.
assert gs.cv_results["params"] is gs.param_combinations
# assert that best parameter in gs.cv_results['rank_test_measure'] is
# indeed the best_param attribute.
best_index = np.argmin(gs.cv_results["rank_test_rmse"])
assert gs.cv_results["params"][best_index] == gs.best_params["rmse"]
best_index = np.argmin(gs.cv_results["rank_test_mae"])
assert gs.cv_results["params"][best_index] == gs.best_params["mae"]
best_index = np.argmin(gs.cv_results["rank_test_fcp"])
assert gs.cv_results["params"][best_index] == gs.best_params["fcp"]
def test_gridsearchcv_refit(u1_ml100k):
"""Test refit function of GridSearchCV."""
data_file = os.path.join(os.path.dirname(__file__), "./u1_ml100k_test")
data = Dataset.load_from_file(data_file, Reader("ml-100k"))
param_grid = {
"n_epochs": [5],
"lr_all": [0.002, 0.005],
"reg_all": [0.4, 0.6],
"n_factors": [2],
}
# assert gs.fit() and gs.test will use best estimator for mae (first
# appearing in measures)
gs = GridSearchCV(SVD, param_grid, measures=["mae", "rmse"], cv=2, refit=True)
gs.fit(data)
gs_preds = gs.test(data.construct_testset(data.raw_ratings))
mae_preds = gs.best_estimator["mae"].test(data.construct_testset(data.raw_ratings))
assert gs_preds == mae_preds
# assert gs.fit() and gs.test will use best estimator for rmse
gs = GridSearchCV(SVD, param_grid, measures=["mae", "rmse"], cv=2, refit="rmse")
gs.fit(data)
gs_preds = gs.test(data.construct_testset(data.raw_ratings))
rmse_preds = gs.best_estimator["rmse"].test(
data.construct_testset(data.raw_ratings)
)
assert gs_preds == rmse_preds
# test that predict() can be called
gs.predict(2, 4)
# assert test() and predict() cannot be used when refit is false
gs = GridSearchCV(SVD, param_grid, measures=["mae", "rmse"], cv=2, refit=False)
gs.fit(data)
with pytest.raises(ValueError):
gs_preds = gs.test(data.construct_testset(data.raw_ratings))
with pytest.raises(ValueError):
gs.predict("1", "2")
# test that error is raised if used with load_from_folds
gs = GridSearchCV(SVD, param_grid, measures=["mae", "rmse"], cv=2, refit=True)
with pytest.raises(ValueError):
gs.fit(u1_ml100k)
# Tests for RandomizedSearchCV
def test_randomizedsearchcv_parameter_combinations_all_lists():
"""Ensure the parameter_combinations attribute populates correctly by
checking its length."""
param_distributions = {
"bsl_options": {"method": ["als", "sgd"], "reg": [1, 2]},
"k": [2, 3],
"sim_options": {
"name": ["msd", "cosine"],
"min_support": [1, 5],
"user_based": [False],
},
}
rs = RandomizedSearchCV(SVD, param_distributions, n_iter=10)
assert len(rs.param_combinations) == 10
def your_sha256_hash():
"""Ensure the parameter_combinations attribute populates correctly by
checking its length."""
param_distributions = {
"bsl_options": {"method": ["als", "sgd"], "reg": [1, 2]},
"k": randint(2, 4), # min inclusive, max exclusive
"sim_options": {
"name": ["msd", "cosine"],
"min_support": [1, 5],
"user_based": [False],
},
}
rs = RandomizedSearchCV(SVD, param_distributions, n_iter=10)
assert len(rs.param_combinations) == 10
def test_randomizedsearchcv_best_estimator(u1_ml100k):
"""Ensure that the best estimator is the one that gives the best score (by
re-running it)"""
param_distributions = {
"n_epochs": [5],
"lr_all": uniform(0.002, 0.003),
"reg_all": uniform(0.04, 0.02),
"n_factors": [1],
"init_std_dev": [0],
}
rs = RandomizedSearchCV(
SVD,
param_distributions,
measures=["mae"],
cv=PredefinedKFold(),
joblib_verbose=100,
)
rs.fit(u1_ml100k)
best_estimator = rs.best_estimator["mae"]
# recompute MAE of best_estimator
mae = cross_validate(
best_estimator, u1_ml100k, measures=["MAE"], cv=PredefinedKFold()
)["test_mae"]
assert mae == rs.best_score["mae"]
def test_randomizedsearchcv_same_splits():
"""Ensure that all parameter combinations are tested on the same splits (we
check their RMSE scores are the same once averaged over the splits, which
should be enough). We use as much parallelism as possible."""
data_file = os.path.join(os.path.dirname(__file__), "./u1_ml100k_test")
data = Dataset.load_from_file(data_file, reader=Reader("ml-100k"))
kf = KFold(3, shuffle=True, random_state=4)
# all RMSE should be the same (as param combinations are the same)
param_distributions = {
"n_epochs": [5],
"lr_all": uniform(0.2, 0),
"reg_all": uniform(0.4, 0),
"n_factors": [5],
"random_state": [0],
}
rs = RandomizedSearchCV(
SVD, param_distributions, measures=["RMSE"], cv=kf, n_jobs=1
)
rs.fit(data)
rmse_scores = [m for m in rs.cv_results["mean_test_rmse"]]
assert len(set(rmse_scores)) == 1 # assert rmse_scores are all equal
# Note: actually, even when setting random_state=None in kf, the same folds
# are used because we use product(param_comb, kf.split(...)). However, it's
# needed to have the same folds when calling fit again:
rs.fit(data)
rmse_scores += [m for m in rs.cv_results["mean_test_rmse"]]
assert len(set(rmse_scores)) == 1 # assert rmse_scores are all equal
def test_randomizedsearchcv_cv_results():
"""Test the cv_results attribute"""
f = os.path.join(os.path.dirname(__file__), "./u1_ml100k_test")
data = Dataset.load_from_file(f, Reader("ml-100k"))
kf = KFold(3, shuffle=True, random_state=4)
param_distributions = {
"n_epochs": [5],
"lr_all": uniform(0.2, 0.3),
"reg_all": uniform(0.4, 0.3),
"n_factors": [5],
"random_state": [0],
}
n_iter = 5
rs = RandomizedSearchCV(
SVD,
param_distributions,
n_iter=n_iter,
measures=["RMSE", "mae"],
cv=kf,
return_train_measures=True,
)
rs.fit(data)
# test keys split*_test_rmse, mean and std dev.
assert rs.cv_results["split0_test_rmse"].shape == (n_iter,)
assert rs.cv_results["split1_test_rmse"].shape == (n_iter,)
assert rs.cv_results["split2_test_rmse"].shape == (n_iter,)
assert rs.cv_results["mean_test_rmse"].shape == (n_iter,)
assert np.allclose(
rs.cv_results["mean_test_rmse"],
np.mean(
[
rs.cv_results["split0_test_rmse"],
rs.cv_results["split1_test_rmse"],
rs.cv_results["split2_test_rmse"],
],
axis=0,
),
)
assert np.allclose(
rs.cv_results["std_test_rmse"],
np.std(
[
rs.cv_results["split0_test_rmse"],
rs.cv_results["split1_test_rmse"],
rs.cv_results["split2_test_rmse"],
],
axis=0,
),
)
# test keys split*_train_mae, mean and std dev.
assert rs.cv_results["split0_train_rmse"].shape == (n_iter,)
assert rs.cv_results["split1_train_rmse"].shape == (n_iter,)
assert rs.cv_results["split2_train_rmse"].shape == (n_iter,)
assert rs.cv_results["mean_train_rmse"].shape == (n_iter,)
assert np.allclose(
rs.cv_results["mean_train_rmse"],
np.mean(
[
rs.cv_results["split0_train_rmse"],
rs.cv_results["split1_train_rmse"],
rs.cv_results["split2_train_rmse"],
],
axis=0,
),
)
assert np.allclose(
rs.cv_results["std_train_rmse"],
np.std(
[
rs.cv_results["split0_train_rmse"],
rs.cv_results["split1_train_rmse"],
rs.cv_results["split2_train_rmse"],
],
axis=0,
),
)
# test fit and train times dimensions.
assert rs.cv_results["mean_fit_time"].shape == (n_iter,)
assert rs.cv_results["std_fit_time"].shape == (n_iter,)
assert rs.cv_results["mean_test_time"].shape == (n_iter,)
assert rs.cv_results["std_test_time"].shape == (n_iter,)
assert rs.cv_results["params"] is rs.param_combinations
# assert that best parameter in rs.cv_results['rank_test_measure'] is
# indeed the best_param attribute.
best_index = np.argmin(rs.cv_results["rank_test_rmse"])
assert rs.cv_results["params"][best_index] == rs.best_params["rmse"]
best_index = np.argmin(rs.cv_results["rank_test_mae"])
assert rs.cv_results["params"][best_index] == rs.best_params["mae"]
def test_randomizedsearchcv_refit(u1_ml100k):
"""Test refit method of RandomizedSearchCV class."""
data_file = os.path.join(os.path.dirname(__file__), "./u1_ml100k_test")
data = Dataset.load_from_file(data_file, Reader("ml-100k"))
param_distributions = {
"n_epochs": [5],
"lr_all": uniform(0.002, 0.003),
"reg_all": uniform(0.4, 0.2),
"n_factors": [2],
}
# assert rs.fit() and rs.test will use best estimator for mae (first
# appearing in measures)
rs = RandomizedSearchCV(
SVD, param_distributions, measures=["mae", "rmse"], cv=2, refit=True
)
rs.fit(data)
rs_preds = rs.test(data.construct_testset(data.raw_ratings))
mae_preds = rs.best_estimator["mae"].test(data.construct_testset(data.raw_ratings))
assert rs_preds == mae_preds
# assert rs.fit() and rs.test will use best estimator for rmse
rs = RandomizedSearchCV(
SVD, param_distributions, measures=["mae", "rmse"], cv=2, refit="rmse"
)
rs.fit(data)
rs_preds = rs.test(data.construct_testset(data.raw_ratings))
rmse_preds = rs.best_estimator["rmse"].test(
data.construct_testset(data.raw_ratings)
)
assert rs_preds == rmse_preds
# test that predict() can be called
rs.predict(2, 4)
# assert test() and predict() cannot be used when refit is false
rs = RandomizedSearchCV(
SVD, param_distributions, measures=["mae", "rmse"], cv=2, refit=False
)
rs.fit(data)
with pytest.raises(ValueError):
rs.test(data.construct_testset(data.raw_ratings))
with pytest.raises(ValueError):
rs.predict("1", "2")
# test that error is raised if used with load_from_folds
rs = RandomizedSearchCV(
SVD, param_distributions, measures=["mae", "rmse"], cv=2, refit=True
)
with pytest.raises(ValueError):
rs.fit(u1_ml100k)
```
|
Polish Canadians (, ) are citizens of Canada with Polish ancestry, and Poles who immigrated to Canada from abroad. At the 2016 Census, there were 1,106,585 Canadians who claimed full or partial Polish heritage.
History
The first Polish immigrant on record, was Dominik Barcz, came to Canada in 1752. He was a fur merchant from Gdańsk who settled in Montreal. He was followed in 1757 by Charles Blaskowicz, a deputy surveyor-general of lands. In 1776 arrived army surgeon, August Franz Globensky. His grandson, Charles Auguste Maximilien Globensky, was elected to the House of Commons in Ottawa in 1875.
Among the earliest Polish immigrants to Canada were members of the Watt and De Meuron military regiments from Saxony and Switzerland sent overseas to help the British Army in North America. Several were émigrés who took part in the November Uprising of 1830 and the 1863 insurrection against the Russian Empire in the Russian sector of partitioned Poland.
In 1841, Casimir Stanislaus Gzowski arrived in Canada from partitioned Poland via the US, and for 50 years worked in the engineering, military and community sectors in Toronto and Southern Ontario, for which he was knighted by Queen Victoria. His great-grandson, Peter Gzowski, became one of Canada's famous radio personalities.
Charles Horecki immigrated in 1872. He was an engineer with the cross-Canada railway construction from Edmonton to the Pacific Ocean through the Peace River Valley. Today, a mountain and a body of water in British Columbia are named after him.
Polish immigration stopped during World War I and between the wars, over 100,000 Polish immigrants arrived in Canada.
Group-settlers
The first significant group of Polish group-settlers were ethnic Kashubians from northern Poland, who were escaping Prussian and German oppression resulting from the occupation after the partitions. They arrived in Renfrew County of Ontario in 1858, where they founded the settlements of Wilno, Barry's Bay, and Round Lake. By 1890 there were about 270 Kashubian families working in the Madawaska Valley of Renfrew County, mostly in the lumber industry of the Ottawa Valley
The consecutive waves of Polish immigrants in periods from 1890–1914, 1920–1939, and 1941 to this day, settled across Canada from Cape Breton to Vancouver, and made numerous and significant contributions to the agricultural, manufacturing, engineering, teaching, publishing, religious, mining, cultural, professional, sports, military, research, business, governmental and political life in Canada.
Geographical distribution
Data from this section from Statistics Canada, 2021.
Provinces & territories
Religious services
All Polish Canadians including their descendants are encouraged by organizations such as the Congress, to preserve their background and retain some ties with Poland and its people. In the past, the most significant role in the preservation of various aspects of Polish traditions and customs among the Polish communities in Canada fell for the Polish urban parishes, which retain the use of the Polish language during services.
The first Polish Catholic priest visited Polish immigrants in 1862 in Kitchener. The first church serving Polish immigrants was built in 1875 in Wilno, Ontario. In Winnipeg, the Holy Ghost Church was built in 1899 with the church in Winnipeg publishing the first Polish newspaper in Canada, Gazeta Katolicka in 1908. In Sydney, Nova Scotia, St. Mary's Polish Parish was established in 1913 by immigrant steelworkers and coal miners, many of whom had previously formed the St. Michael's Polish Benefit Society (est. 1909). The parish remains the only Polish parish in Atlantic Canada, although there is a Polish mission (St. Faustina) in Halifax.
The first Polish-Canadian Roman Catholic bishop is Reverend Mathew Ustrzycki, consecrated in June 1985, auxiliary bishop of the Hamilton Diocese. There are Polish-Canadian priests in many congregations and orders, such as the Franciscans, Jesuits, Redemptorists, Saletinians, Resurrectionists, Oblates, Michaelites, and the Society of Christ. In addition, 80 priests serve in 120 parishes.
Largest Polish Canadian communities
Polish Canadian organizations
Polonia Inclusive
Canadian Polish Congress
Polish Culture Society of Edmonton
Polish National Union of Canada
Konekt
Polycultural Immigrant and Community Services
Canadian Polish Research Institute
Poland in the Rockies
The Polish Institute of Arts and Sciences in Canada
Canadian Federation of Polish Women
Federation of Polish Jews of Canada
Recognition
The Victoria Cross
Numerous Polish-Canadians have been recognized with awards and appointments by the Queen and the Canadian governments as well as universities and various organizations. One of the most notable recipients was Andrew Mynarski, pilot-gunner from Winnipeg, awarded the Victoria Cross posthumously for extreme valor in World War II.
The Order of Canada
Mary Adamowska Panaro, C.M. Winnipeg, Welfare Council of Winnipeg
Dr. Henry Wojcicki – Edmonton, distinguished psychiatrist, University of Alberta senator
Dr.Tom Brzustowski Waterloo, president of NSERC
Walter Gretzky, Brantford, Ontario, Canada
The Honourable Allan H. Wachowich, C.M., A.O.E., Q.C.Edmonton, Alberta. Member November 18, 2019.
Judges
Their Honours
Judge Paul Staniszewski – of Toronto, Montreal and the County Court of Windsor
Judge Alfred Harold Joseph Swencisky – of the Superior Court of BC in Vancouver; past president of the Vancouver Hospital Association
Judge P. Swiecicki – of the Superior Court of BC in Vancouver
Judge Allan H. J. Wachowich – of the Court of Queen's Bench in Edmonton
Chief Judge Edward R. Wachowich - of the Provincial Court of Alberta (deceased 2012)
Judge E.F. Wrzeszczinski-Wren – of the County Court of Toronto (deceased)
Notable Polish Canadians
See also
Canada–Poland relations
Great Emigration
Canadian-Polish Congress
Polish Culture Society of Edmonton
Polish Americans
Polish Cathedral style, North America
Polish British
Polish Australians
Polish Brazilians
Kashubians § Diaspora
References
External links
Polonia Edmonton
History of Ours: the Polish Community in Brantford - Brantford library
Zwiazkowiec (Alliancer), 1935–1978 digitized issues of Toronto newspaper - Multicultural Canada
European Canadian
Canada
Polish
|
More Demi Moore or the August 1991 Vanity Fair cover was a controversial handbra nude photograph of then seven-months pregnant Demi Moore taken by Annie Leibovitz for the August 1991 cover of Vanity Fair to accompany a cover story about Moore.
The cover has had a lasting societal impact. Since the cover was released, several celebrities have posed for photographs in advanced stages of pregnancy, although not necessarily as naked as Moore. This trend has made pregnancy photos fashionable and created a booming business. The photograph is one of the most highly regarded magazine covers of all time, and it is one of Leibovitz's best known works.
The picture has been parodied several times, including for advertising Naked Gun : The Final Insult (1994). This led to the 1998 Second Circuit fair use case Leibovitz v. Paramount Pictures Corp. In addition to being satirically parodied and popularizing pregnancy photographs, there was also backlash. Some critics rated it grotesque and obscene, and it was also seriously considered when Internet decency standards were first being legislated and adjudicated. Others thought it was a powerful artistic statement.
In each of the subsequent two years, Moore made follow-up cover appearances on Vanity Fair, the first of which propelled Joanne Gair to prominence as a trompe-l'œil body painter.
Background
In 1991, Demi Moore was a budding A-list film star who had been married to Bruce Willis since 1987. The couple had had their first child Rumer Willis in 1988, and they had hired three photographers for an audience of six friends for the delivery. In 1990, she had starred in that year's highest-grossing film, Ghost, for which she was paid $750,000, and she had earned $2.5 million for 1991 roles in The Butcher's Wife and Mortal Thoughts. Following the photo, she would earn $3 million for her 1992 role in A Few Good Men and $5 million apiece for roles in Indecent Proposal (1993), Disclosure (1994) and The Scarlet Letter (1995).
Annie Leibovitz had been chief photographer at Rolling Stone from 1973 until 1983, when she moved to Vanity Fair. In 1991, she had the first mid-career show, Annie Leibovitz Photographs 1970-1990, ever given a photographer by the National Portrait Gallery in Washington, D.C., with a similarly titled accompanying book. The show traveled to New York City at the International Center of Photography for a showing that would run until December 1, 1991.
Details
The photograph was one of several taken by Leibovitz of seven-months pregnant 28-year-old Moore, then pregnant with the couple's second daughter, Scout LaRue. The photographs ranged from Moore in lacy underwear and spiked high heels, to a revealing peignoir. The final selection had Moore wearing only a diamond ring. Joanne Gair worked on make-up for the shoot. Samuel Irving Newhouse, Jr., chairman of Conde Nast Publications, was very supportive of the chosen cover despite the potential for lost sales. Tina Brown, Vanity Fair editor, quickly realized that there would be harsh backlash for regular distribution of the magazine; the issue had to be wrapped in a white envelope with only Moore's eyes visible. Some editions had a brown wrapper that implied naughtiness. However, Brown viewed the image as a chance to make a statement about the decade of the 1990s after a decade dominated by power suits. Approximately 100 million people saw the cover.
The use of a pregnant sex symbol was in a sense an attempt to combat the pop culture representations of the anathema of the awkward, uncomfortable, and grotesquely excessive female form in a culture that values thinness. Leibovitz' candid portrayal drew a wide spectrum of responses from television, radio and newspaper personalities and the public at large ranging from complaints of sexual objectification to celebrations of the photograph as a symbol of empowerment. One of the judges in Leibovitz v. Paramount Pictures Corp. stated that the image evoked Botticelli's Birth of Venus. The contemporary retrospective view of some is that this photograph is "high art". The intent of the photograph was to portray pregnancy with a celebrity in a way that was bold, proud and understated in an "anti-Hollywood, anti-glitz" manner. It was successful in some regards as many perceived it as a statement of beauty and pride. However, many took offense and the cover drew unusually intense controversy for Vanity Fair in the form of ninety-five television spots, sixty-four radio shows, 1,500 newspaper articles and a dozen cartoons. Some stores and newsstands refused to carry the August issue, while others modestly concealed it in the wrapper evocative of porn magazines.
The photo is not only considered one of Leibovitz's most famous, but also an almost mythical representation. It is considered emblematic of Si Newhouse's reputation for "newsy features and provocative photos." It is the first photo mentioned in the New York Times review of Leibovitz's exhibition Annie Leibovitz: A Photographer's Life, 1990-2005 at the Brooklyn Museum and it is contrasted with another of her female pregnancy photographs (of Melania Trump).
A year later, Moore still did not understand the controversy that caused photos of a naked, pregnant woman to be viewed as morally objectionable. Moore stated that, "I did feel glamorous, beautiful and more free about my body. I don't know how much more family oriented I could possibly have gotten." She considered the cover to be a healthy "feminist statement." In 2007, Moore stated that the picture was not originally intended for publication. She had posed in a personal photo session, not a cover shoot. Leibovitz has had personal photo sessions of Moore and all of her daughters.
Cover story
One journalist's professional account of the cover story describes it as "relentlessly long", and a second journalist's description is that it is a "very long profile". The article discussed the then three-year-old Rumer Willis and husband Bruce Willis. Willis and Moore discuss each other in the article. The article also spends three pages recounting her life. The article spent little time on her next film, The Butcher's Wife, or the child she was pregnant with, Scout LaRue Willis.
Legal issues
Naked Gun
The photograph was parodied on several occasions, including the computer-generated Spy magazine version, which placed Willis' head on Moore's body. In Leibovitz v. Paramount Pictures Corp., Leibovitz sued over one parody featuring Leslie Nielsen, made to promote the 1994 film Naked Gun : The Final Insult. In the parody, the model's body was used and "the guilty and smirking face of Mr. Nielsen appeared above". The teaser said "Due this March". The case was dismissed in 1996 because the parody relied "for its comic effect on the contrast between the original".
In a parody ruling, the court must determine whether a work is transformative in a way that gives a new expression, meaning or message to the original work. In this case, the court ruled that the "ad may reasonably be perceived, as commenting on the seriousness and even pretentiousness of the original." It also ruled that the ad differed from the original "in a way that may, reasonably, be perceived as commenting, through ridicule on what a viewer might reasonably think is the undue self-importance conveyed by the subject of the Leibovitz photograph."
Other issues
When the Internet arose as a popular and important medium and the United States Supreme Court issued a ruling on the Communications Decency Act of 1996 (CDA), Moore's image was described as a sort of litmus test to determine if the law could be reasonably applied in the current environment by the trial court. When John Paul Stevens' rendered an opinion over a year later, the image was still on the minds of legal scholars.
Follow-ups
In the Demi's Birthday Suit August 1992 issue of Vanity Fair, Moore was shown on the cover in the body painting photo by Joanne Gair. It made Gair an immediate pop culture star as the most prominent body paint artist, which prompted consideration for an Absolut Vodka Absolut Gair ad campaign. The 1992 cover, which required a thirteen-hour sitting for Gair and her team of make-up artists, was a commemoration of the August 1991 photo. Leibovitz could not decide where to shoot, and reserved two mobile homes, four hotel rooms and five houses.
In December 1993, Moore was again on the cover of Vanity Fair, but this time she was dressed in two straps and a large red bow and was sitting on David Letterman's lap while he was dressed up as Santa Claus.
Other celebrities have since posed nude or semi-nude while in advanced pregnancy, including Christina Aguilera and Britney Spears whose billboard advertisements led to great controversy. Newsweek referred to the pose more than a decade later, and The New York Times coined "demiclad" for the nude pregnant handbra pose. Eventually, Vogue and Harper's Bazaar included pregnant cover models, and Star included a pregnant foursome of Katie Holmes, Gwen Stefani, Gwyneth Paltrow and Angelina Jolie. They also had a "Bump Brigade" of Jennie Garth, Maggie Gyllenhaal and Sofia Coppola. Vogue had a very pregnant 37-year-old Brooke Shields on the cover of its April 2003 issue. By the time Linda Evangelista appeared pregnant (and clothed) on the August 2006 cover of Vogue, pregnancy was not the emphasis of the story. However, even at the end of 2007 appearing bare-bellied and pregnant on the cover of a magazine, as Aguilera did for Marie Claire, was still considered a derivative of Moore's original. When Melania Trump appeared in American Vogue, she held in esteem as a model of maternity fashion by Anna Wintour. A commemoration of the photo was a self-portrait by Leibovitz in which she appeared in profile and pregnant for her A Photographer's Life exhibition. Myleene Klass posed for a similar nude pregnant photo for Glamour magazine in 2007.
Serena Williams appeared pregnant in very nearly the same pose on the cover of the August 2017 issue of Vanity Fair, 26 years after the August 1991 cover featuring pregnant Demi Moore.
Legacy
The photo has had long cultural and social impact in the U.S. Many women feel that the rush of celebrities taking pregnant photos has made taking such photos glamorous for pregnant mothers. As the photos have become more common on magazine covers the business of documenting pregnancies photographically has boomed. Furthermore, the photo is critically acclaimed. Almost fifteen years after its publication the American Society of Magazine Editors listed it as the second best magazine cover of the last forty years.
Parodies
Two months after the photo's publication, it was parodied on the cover of The Sensational She-Hulk #34 in October 1991. The cover features She-Hulk, a character known for breaking the fourth wall and parodying pop culture, in the same pose as Moore with a green beach ball in place of the baby bump, while telling the reader "It's not fair to accuse me of vanity! I just thrive on controversy!"
In 2006, graffiti artist Banksy used a Simpsons-like character to replace Moore's head for a promotion in Los Angeles, California. He illegally posted the parody around Los Angeles to promote his website and his exhibition.
See also
Pregnancy fetishism
References
1991 works
1991 in art
1991 controversies in the United States
Color photographs
Photographs of the United States
Works about human pregnancy
Works originally published in Vanity Fair (magazine)
Nude photography
1990s photographs
Photographs by Annie Leibovitz
|
```go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package pipesiface provides an interface to enable mocking the Amazon EventBridge Pipes service client
// for testing your code.
//
// It is important to note that this interface will have breaking changes
// when the service model is updated and adds new API operations, paginators,
// and waiters.
package pipesiface
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/pipes"
)
// PipesAPI provides an interface to enable mocking the
// pipes.Pipes service client's API operation,
// paginators, and waiters. This make unit testing your code that calls out
// to the SDK's service client's calls easier.
//
// The best way to use this interface is so the SDK's service client's calls
// can be stubbed out for unit testing your code with the SDK without needing
// to inject custom request handlers into the SDK's request pipeline.
//
// // myFunc uses an SDK service client to make a request to
// // Amazon EventBridge Pipes.
// func myFunc(svc pipesiface.PipesAPI) bool {
// // Make svc.CreatePipe request
// }
//
// func main() {
// sess := session.New()
// svc := pipes.New(sess)
//
// myFunc(svc)
// }
//
// In your _test.go file:
//
// // Define a mock struct to be used in your unit tests of myFunc.
// type mockPipesClient struct {
// pipesiface.PipesAPI
// }
// func (m *mockPipesClient) CreatePipe(input *pipes.CreatePipeInput) (*pipes.CreatePipeOutput, error) {
// // mock response/functionality
// }
//
// func TestMyFunc(t *testing.T) {
// // Setup Test
// mockSvc := &mockPipesClient{}
//
// myfunc(mockSvc)
//
// // Verify myFunc's functionality
// }
//
// It is important to note that this interface will have breaking changes
// when the service model is updated and adds new API operations, paginators,
// and waiters. Its suggested to use the pattern above for testing, or using
// tooling to generate mocks to satisfy the interfaces.
type PipesAPI interface {
CreatePipe(*pipes.CreatePipeInput) (*pipes.CreatePipeOutput, error)
CreatePipeWithContext(aws.Context, *pipes.CreatePipeInput, ...request.Option) (*pipes.CreatePipeOutput, error)
CreatePipeRequest(*pipes.CreatePipeInput) (*request.Request, *pipes.CreatePipeOutput)
DeletePipe(*pipes.DeletePipeInput) (*pipes.DeletePipeOutput, error)
DeletePipeWithContext(aws.Context, *pipes.DeletePipeInput, ...request.Option) (*pipes.DeletePipeOutput, error)
DeletePipeRequest(*pipes.DeletePipeInput) (*request.Request, *pipes.DeletePipeOutput)
DescribePipe(*pipes.DescribePipeInput) (*pipes.DescribePipeOutput, error)
DescribePipeWithContext(aws.Context, *pipes.DescribePipeInput, ...request.Option) (*pipes.DescribePipeOutput, error)
DescribePipeRequest(*pipes.DescribePipeInput) (*request.Request, *pipes.DescribePipeOutput)
ListPipes(*pipes.ListPipesInput) (*pipes.ListPipesOutput, error)
ListPipesWithContext(aws.Context, *pipes.ListPipesInput, ...request.Option) (*pipes.ListPipesOutput, error)
ListPipesRequest(*pipes.ListPipesInput) (*request.Request, *pipes.ListPipesOutput)
ListPipesPages(*pipes.ListPipesInput, func(*pipes.ListPipesOutput, bool) bool) error
ListPipesPagesWithContext(aws.Context, *pipes.ListPipesInput, func(*pipes.ListPipesOutput, bool) bool, ...request.Option) error
ListTagsForResource(*pipes.ListTagsForResourceInput) (*pipes.ListTagsForResourceOutput, error)
ListTagsForResourceWithContext(aws.Context, *pipes.ListTagsForResourceInput, ...request.Option) (*pipes.ListTagsForResourceOutput, error)
ListTagsForResourceRequest(*pipes.ListTagsForResourceInput) (*request.Request, *pipes.ListTagsForResourceOutput)
StartPipe(*pipes.StartPipeInput) (*pipes.StartPipeOutput, error)
StartPipeWithContext(aws.Context, *pipes.StartPipeInput, ...request.Option) (*pipes.StartPipeOutput, error)
StartPipeRequest(*pipes.StartPipeInput) (*request.Request, *pipes.StartPipeOutput)
StopPipe(*pipes.StopPipeInput) (*pipes.StopPipeOutput, error)
StopPipeWithContext(aws.Context, *pipes.StopPipeInput, ...request.Option) (*pipes.StopPipeOutput, error)
StopPipeRequest(*pipes.StopPipeInput) (*request.Request, *pipes.StopPipeOutput)
TagResource(*pipes.TagResourceInput) (*pipes.TagResourceOutput, error)
TagResourceWithContext(aws.Context, *pipes.TagResourceInput, ...request.Option) (*pipes.TagResourceOutput, error)
TagResourceRequest(*pipes.TagResourceInput) (*request.Request, *pipes.TagResourceOutput)
UntagResource(*pipes.UntagResourceInput) (*pipes.UntagResourceOutput, error)
UntagResourceWithContext(aws.Context, *pipes.UntagResourceInput, ...request.Option) (*pipes.UntagResourceOutput, error)
UntagResourceRequest(*pipes.UntagResourceInput) (*request.Request, *pipes.UntagResourceOutput)
UpdatePipe(*pipes.UpdatePipeInput) (*pipes.UpdatePipeOutput, error)
UpdatePipeWithContext(aws.Context, *pipes.UpdatePipeInput, ...request.Option) (*pipes.UpdatePipeOutput, error)
UpdatePipeRequest(*pipes.UpdatePipeInput) (*request.Request, *pipes.UpdatePipeOutput)
}
var _ PipesAPI = (*pipes.Pipes)(nil)
```
|
```java
package com.kalessil.phpStorm.phpInspectionsEA.api;
import com.jetbrains.php.config.PhpLanguageLevel;
import com.jetbrains.php.config.PhpProjectConfigurationFacade;
import com.kalessil.phpStorm.phpInspectionsEA.PhpCodeInsightFixtureTestCase;
import com.kalessil.phpStorm.phpInspectionsEA.inspectors.apiUsage.fileSystem.CascadingDirnameCallsInspector;
final public class CascadingDirnameCallsInspectorTest extends PhpCodeInsightFixtureTestCase {
public void testIfFindsAllPatterns() {
PhpProjectConfigurationFacade.getInstance(myFixture.getProject()).setLanguageLevel(PhpLanguageLevel.PHP710);
myFixture.enableInspections(new CascadingDirnameCallsInspector());
myFixture.configureByFile("testData/fixtures/api/cascade-dirname.php");
myFixture.testHighlighting(true, false, true);
myFixture.getAllQuickFixes().forEach(fix -> myFixture.launchAction(fix));
myFixture.setTestDataPath(".");
myFixture.checkResultByFile("testData/fixtures/api/cascade-dirname.fixed.php");
}
}
```
|
```xml
import { ComponentSlotStylesPrepared, ICSSInJSStyle } from '@fluentui/styles';
import { VideoStylesProps } from '../../../../components/Video/Video';
import { VideoVariables } from './videoVariables';
export const videoStyles: ComponentSlotStylesPrepared<VideoStylesProps, VideoVariables> = {
root: ({ variables: v }): ICSSInJSStyle => ({
display: 'inline-block',
verticalAlign: 'middle',
width: v.width,
height: v.height || 'auto',
}),
};
```
|
Voznesensk Raion () is a raion (district) in Mykolaiv Oblast, Ukraine. Its administrative center is the town of Voznesensk. Population:
History
In 1923, uyezds in Ukrainian Soviet Socialist Republic were abolished, and the governorates were divided into okruhas. In 1923, Voznesensk Raion with the administrative center located in Voznesensk was established. It belonged to Mykolaiv Okruha of Odessa Governorate. In 1925, the governorates were abolished, and okruhas were directly subordinated to Ukrainian SSR. In 1930, okruhas were abolished, and on 27 February 1932, Odessa Oblast was established, and Voznesensk Raion was included into Odessa Oblast. In 1944, Voznesensk Raion was transferred to Mykolaiv Oblast. In 1975, Voznesensk became the city of oblast significance.
On 18 July 2020, as part of the administrative reform of Ukraine, the number of raions of Mykolaiv Oblast was reduced to four, and the area of Voznesensk Raion was significantly expanded. Four abolished raions, Bratske, Domanivka, Veselynove, and Yelanets Raions, as well as the cities of Voznesensk and Yuzhnoukrainsk, which were previously incorporated as a city of oblast significance and did not belong to any raion, were merged into Voznesensk Raion. The January 2020 estimate of the raion population was
Subdivisions
Current
After the reform in July 2020, the raion consisted of 13 hromadas:
Bratske settlement hromada with the administration in the urban-type settlement of Bratske, transferred from Bratske Raion;
Domanivka settlement hromada with the administration in the urban-type settlement of Domanivka, transferred from Domanivka Raion;
Buzke rural hromada with the administration in the selo of Buzke, retained from Voznesensk Raion;
Doroshivka rural hromada with the administration in the selo of Doroshivka, retained from Voznesensk Raion;
Mostove rural hromada with the administration in the selo of Mostove, transferred from Domanivka Raion;
Novomarivka rural hromada with the administration in the selo of Novomarivka, transferred from Bratske Raion;
Oleksandrivka settlement hromada with the administration in the urban-type settlement of Oleksandrivka, retained from Voznesensk Raion;
Prybuzhany rural hromada with the administration in the selo of Prybuzhany, retained from Voznesensk Raion;
Prybuzhzhia rural hromada with the administration in the selo of Prybuzhzhia, transferred from Domanivka Raion;
Veselynove settlement hromada with the administration in the urban-type settlement of Veselynove, transferred from Veselynove Raion;
Voznesensk urban hromada with the administration in the city of Voznesensk, transferred from the city of oblast significance of Voznesensk;
Yelanets settlement hromada with the administration in the urban-type settlement of Yelanets, transferred from Yelanets Raion;
Yuzhnoukrainsk urban hromada with the administration in the city of Yuzhnoukrainsk, transferred from the city of oblast significance of Yuzhnoukrainsk.
Before 2020
Before the 2020 reform, the raion consisted of four hromadas,
Buzke rural hromada with the administration in Buzke;
Doroshivka rural hromada with the administration in Doroshivka;
Oleksandrivka settlement hromada with the administration in Oleksandrivka;
Prybuzhany rural hromada with the administration in Prybuzhany.
References
Raions of Mykolaiv Oblast
1923 establishments in Ukraine
States and territories established in 1923
|
```go
package settings
import (
"net/http"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/services/context"
)
// GetGeneralUISettings returns instance's global settings for ui
func GetGeneralUISettings(ctx *context.APIContext) {
// swagger:operation GET /settings/ui settings getGeneralUISettings
// ---
// summary: Get instance's global settings for ui
// produces:
// - application/json
// responses:
// "200":
// "$ref": "#/responses/GeneralUISettings"
ctx.JSON(http.StatusOK, api.GeneralUISettings{
DefaultTheme: setting.UI.DefaultTheme,
AllowedReactions: setting.UI.Reactions,
CustomEmojis: setting.UI.CustomEmojis,
})
}
// GetGeneralAPISettings returns instance's global settings for api
func GetGeneralAPISettings(ctx *context.APIContext) {
// swagger:operation GET /settings/api settings getGeneralAPISettings
// ---
// summary: Get instance's global settings for api
// produces:
// - application/json
// responses:
// "200":
// "$ref": "#/responses/GeneralAPISettings"
ctx.JSON(http.StatusOK, api.GeneralAPISettings{
MaxResponseItems: setting.API.MaxResponseItems,
DefaultPagingNum: setting.API.DefaultPagingNum,
DefaultGitTreesPerPage: setting.API.DefaultGitTreesPerPage,
DefaultMaxBlobSize: setting.API.DefaultMaxBlobSize,
})
}
// GetGeneralRepoSettings returns instance's global settings for repositories
func GetGeneralRepoSettings(ctx *context.APIContext) {
// swagger:operation GET /settings/repository settings getGeneralRepositorySettings
// ---
// summary: Get instance's global settings for repositories
// produces:
// - application/json
// responses:
// "200":
// "$ref": "#/responses/GeneralRepoSettings"
ctx.JSON(http.StatusOK, api.GeneralRepoSettings{
MirrorsDisabled: !setting.Mirror.Enabled,
HTTPGitDisabled: setting.Repository.DisableHTTPGit,
MigrationsDisabled: setting.Repository.DisableMigrations,
StarsDisabled: setting.Repository.DisableStars,
TimeTrackingDisabled: !setting.Service.EnableTimetracking,
LFSDisabled: !setting.LFS.StartServer,
})
}
// GetGeneralAttachmentSettings returns instance's global settings for Attachment
func GetGeneralAttachmentSettings(ctx *context.APIContext) {
// swagger:operation GET /settings/attachment settings getGeneralAttachmentSettings
// ---
// summary: Get instance's global settings for Attachment
// produces:
// - application/json
// responses:
// "200":
// "$ref": "#/responses/GeneralAttachmentSettings"
ctx.JSON(http.StatusOK, api.GeneralAttachmentSettings{
Enabled: setting.Attachment.Enabled,
AllowedTypes: setting.Attachment.AllowedTypes,
MaxFiles: setting.Attachment.MaxFiles,
MaxSize: setting.Attachment.MaxSize,
})
}
```
|
The 1968–69 season was Leeds United's fifth consecutive season in the First Division. Along with the First Division, they competed in the FA Cup, Football League Cup and the Inter-Cities Fairs Cup. The season covers the period from 1 July 1968 to 30 June 1969.
Background
Following the resignation of Jack Taylor, Don Revie was appointed as player-manager.
Revie implemented a change of kit colour to an all-white strip in the style of Real Madrid, and concentrating the club policy on scouting and developing youth talent, rather than just trying to buy players. He appointed experienced coaches like Les Cocker, Maurice Lindley and Syd Owen, and implemented radical techniques like forming a family atmosphere around the club. Revie took on more revolutionary techniques, his pre-match preparation was meticulous for its day, his staff prepared highly detailed dossiers on the opposition before every match and pioneered a highly detailed approach to the way opposing teams could be analysed. Coaches like Les Cocker were also responsible for developing high fitness levels in the Leeds players, using diets and rigorous, military style training programs. Revie forged a completely new team around a crop of outstanding youth talents, including Norman Hunter, Paul Reaney, Peter Lorimer, Eddie Gray, Billy Bremner, Paul Madeley, Albert Johanneson and these were backed up by more experienced heads Jack Charlton, and veteran Scottish international central midfielder Bobby Collins. Revie also made a shrewd purchase in acquiring former Busby Babe winger John Giles from Manchester United, who Leeds' coaching staff would mould into one of the most influential central midfielders of the game. In 1964 this new team won promotion once more to the First Division.
Leeds made an immediate impact; they began the season with a scintillating 4–2 victory over defending league champions Liverpool, which would set the tone for the rest of the season. Revie's young side chased an improbable league and cup double finishing the 1964–65 season as runners up only to Busby's Manchester United, losing the title on goal average. They turned the tables on Manchester United in the FA cup semi-final replay, reaching the FA Cup Final where they were beaten 2–1 by Liverpool in a dour game, best remembered for the appearance of Albert Johanneson, the first black player to play in an FA Cup final.
The 1965–66 season saw Leeds consolidate their place in the First Division, finishing as runners up in the league again, and progressing through to the semi-finals of the Inter-Cities Fairs Cup with victories over sides such as Valencia and Torino.
The 1966–67 season saw Leeds finish 4th in the league, as well as reaching the FA Cup Semi-finals and making an early exit from the League Cup. In addition, their European campaign ended as beaten finalists in the Inter-Cities Fairs Cup, losing 2–0 to Dinamo Zagreb.
Leeds spent the 1967–68 season chasing four trophies; leading the title race for much of the season, although eventually losing out to Manchester City and finishing fourth. Revie's men were also beaten semi-finalists in the FA Cup, although they did find their first domestic and European successes, completing a League Cup and Fairs Cup double. Terry Cooper's goal securing a tense League Cup final victory against Arsenal, and a Mick Jones goal secured the Fairs cup victory over the veteran Hungarian side Ferencváros. Leeds were the first British team to win the trophy.
Season summary
Having found success in both domestic and European cup competitions, manager Revie chose to focus on the league for the 1968–69 campaign. Leeds secured the title in April 1969 with a 0–0 draw with challengers Liverpool at Anfield, whose supporters congratulated the Leeds team. Leeds set a number of records including most points (67), most wins (27), fewest defeats (2) and most home points (39); a still-unbroken club record is their 34 match unbeaten run that extended into the following season. Leeds strengthened their front line, breaking the British transfer record by signing Allan Clarke from Leicester City for £165,000. They targeted the treble in 1969–70 and came close to achieving this, only to fail on all three fronts in a congested close season, finishing second in the league to Everton, losing the 1970 FA Cup Final to Chelsea (after a replay), and exiting the European Cup with a semi-final defeat to Celtic.
Competitions
Football League First Division
League table
Matches
FA Cup
Football League Cup
Inter-Cities Fairs Cup
Statistics
Appearances and goals
Notes
References
1968-69
Leeds United F.C. season
1968-69
1960s in Leeds
|
```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.pulsar.broker.stats;
import io.opentelemetry.api.metrics.BatchCallback;
import io.opentelemetry.api.metrics.ObservableDoubleMeasurement;
import io.opentelemetry.api.metrics.ObservableLongMeasurement;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import org.apache.pulsar.broker.PulsarService;
import org.apache.pulsar.broker.service.AbstractReplicator;
import org.apache.pulsar.broker.service.nonpersistent.NonPersistentReplicator;
import org.apache.pulsar.broker.service.persistent.PersistentReplicator;
import org.apache.pulsar.common.stats.MetricsUtil;
public class OpenTelemetryReplicatorStats implements AutoCloseable {
// Replaces pulsar_replication_rate_in
public static final String MESSAGE_IN_COUNTER = "pulsar.broker.replication.message.incoming.count";
private final ObservableLongMeasurement messageInCounter;
// Replaces pulsar_replication_rate_out
public static final String MESSAGE_OUT_COUNTER = "pulsar.broker.replication.message.outgoing.count";
private final ObservableLongMeasurement messageOutCounter;
// Replaces pulsar_replication_throughput_in
public static final String BYTES_IN_COUNTER = "pulsar.broker.replication.message.incoming.size";
private final ObservableLongMeasurement bytesInCounter;
// Replaces pulsar_replication_throughput_out
public static final String BYTES_OUT_COUNTER = "pulsar.broker.replication.message.outgoing.size";
private final ObservableLongMeasurement bytesOutCounter;
// Replaces pulsar_replication_backlog
public static final String BACKLOG_COUNTER = "pulsar.broker.replication.message.backlog.count";
private final ObservableLongMeasurement backlogCounter;
// Replaces pulsar_replication_delay_in_seconds
public static final String DELAY_GAUGE = "pulsar.broker.replication.message.backlog.age";
private final ObservableDoubleMeasurement delayGauge;
// Replaces pulsar_replication_rate_expired
public static final String EXPIRED_COUNTER = "pulsar.broker.replication.message.expired.count";
private final ObservableLongMeasurement expiredCounter;
public static final String DROPPED_COUNTER = "pulsar.broker.replication.message.dropped.count";
private final ObservableLongMeasurement droppedCounter;
private final BatchCallback batchCallback;
public OpenTelemetryReplicatorStats(PulsarService pulsar) {
var meter = pulsar.getOpenTelemetry().getMeter();
messageInCounter = meter
.upDownCounterBuilder(MESSAGE_IN_COUNTER)
.setUnit("{message}")
.setDescription(
"The total number of messages received from the remote cluster through this replicator.")
.buildObserver();
messageOutCounter = meter
.upDownCounterBuilder(MESSAGE_OUT_COUNTER)
.setUnit("{message}")
.setDescription("The total number of messages sent to the remote cluster through this replicator.")
.buildObserver();
bytesInCounter = meter
.upDownCounterBuilder(BYTES_IN_COUNTER)
.setUnit("{By}")
.setDescription(
"The total number of messages bytes received from the remote cluster through this replicator.")
.buildObserver();
bytesOutCounter = meter
.upDownCounterBuilder(BYTES_OUT_COUNTER)
.setUnit("{By}")
.setDescription(
"The total number of messages bytes sent to the remote cluster through this replicator.")
.buildObserver();
backlogCounter = meter
.upDownCounterBuilder(BACKLOG_COUNTER)
.setUnit("{message}")
.setDescription("The total number of messages in the backlog for this replicator.")
.buildObserver();
delayGauge = meter
.gaugeBuilder(DELAY_GAUGE)
.setUnit("s")
.setDescription("The age of the oldest message in the replicator backlog.")
.buildObserver();
expiredCounter = meter
.upDownCounterBuilder(EXPIRED_COUNTER)
.setUnit("{message}")
.setDescription("The total number of messages that expired for this replicator.")
.buildObserver();
droppedCounter = meter
.upDownCounterBuilder(DROPPED_COUNTER)
.setUnit("{message}")
.setDescription("The total number of messages dropped by this replicator.")
.buildObserver();
batchCallback = meter.batchCallback(() -> pulsar.getBrokerService()
.getTopics()
.values()
.stream()
.filter(topicFuture -> topicFuture.isDone() && !topicFuture.isCompletedExceptionally())
.map(CompletableFuture::join)
.filter(Optional::isPresent)
.map(Optional::get)
.flatMap(topic -> topic.getReplicators().values().stream())
.map(AbstractReplicator.class::cast)
.forEach(this::recordMetricsForReplicator),
messageInCounter,
messageOutCounter,
bytesInCounter,
bytesOutCounter,
backlogCounter,
delayGauge,
expiredCounter,
droppedCounter);
}
@Override
public void close() {
batchCallback.close();
}
private void recordMetricsForReplicator(AbstractReplicator replicator) {
var attributes = replicator.getAttributes();
var stats = replicator.getStats();
messageInCounter.record(stats.getMsgInCount(), attributes);
messageOutCounter.record(stats.getMsgOutCount(), attributes);
bytesInCounter.record(stats.getBytesInCount(), attributes);
bytesOutCounter.record(stats.getBytesOutCount(), attributes);
var delaySeconds = MetricsUtil.convertToSeconds(replicator.getReplicationDelayMs(), TimeUnit.MILLISECONDS);
delayGauge.record(delaySeconds, attributes);
if (replicator instanceof PersistentReplicator persistentReplicator) {
expiredCounter.record(persistentReplicator.getMessageExpiredCount(), attributes);
backlogCounter.record(persistentReplicator.getNumberOfEntriesInBacklog(), attributes);
} else if (replicator instanceof NonPersistentReplicator nonPersistentReplicator) {
droppedCounter.record(nonPersistentReplicator.getStats().getMsgDropCount(), attributes);
}
}
}
```
|
```c
/*
* friso hash table implements functions
* defined in header file "friso_API.h".
*
* @author chenxin <chenxin619315@gmail.com>
*/
#include "friso_API.h"
#include <stdlib.h>
#include <string.h>
//-166411799L
//31 131 1331 13331 133331 ..
//31 131 1313 13131 131313 .. the best
#define HASH_FACTOR 1313131
/* ************************
* mapping function area *
**************************/
__STATIC_API__ uint_t hash( fstring str, uint_t length )
{
//hash code
uint_t h = 0;
while ( *str != '\0' ) {
h = h * HASH_FACTOR + ( *str++ );
}
return (h % length);
}
/*test if a integer is a prime.*/
__STATIC_API__ int is_prime( int n )
{
int j;
if ( n == 2 || n == 3 ) {
return 1;
}
if ( n == 1 || n % 2 == 0 ) {
return 0;
}
for ( j = 3; j * j < n; j++ ) {
if ( n % j == 0 ) {
return 0;
}
}
return 1;
}
/*get the next prime just after the speicified integer.*/
__STATIC_API__ int next_prime( int n )
{
if ( n % 2 == 0 ) n++;
for ( ; ! is_prime( n ); n = n + 2 ) ;
return n;
}
//fstring copy, return the pointer of the new string.
//static fstring string_copy( fstring _src ) {
//int bytes = strlen( _src );
//fstring _dst = ( fstring ) FRISO_MALLOC( bytes + 1 );
//register int t = 0;
//do {
//_dst[t] = _src[t];
//t++;
//} while ( _src[t] != '\0' );
//_dst[t] = '\0';
//return _dst;
//}
/* *********************************
* static hashtable function area. *
***********************************/
__STATIC_API__ hash_entry_t new_hash_entry(
fstring key,
void * value,
hash_entry_t next )
{
hash_entry_t e = ( hash_entry_t )
FRISO_MALLOC( sizeof( friso_hash_entry ) );
if ( e == NULL ) {
___ALLOCATION_ERROR___
}
//e->_key = string_copy( key );
e->_key = key;
e->_val = value;
e->_next = next;
return e;
}
//create blocks copy of entries.
__STATIC_API__ hash_entry_t * create_hash_entries( uint_t blocks )
{
register uint_t t;
hash_entry_t *e = ( hash_entry_t * )
FRISO_CALLOC( sizeof( hash_entry_t ), blocks );
if ( e == NULL ) {
___ALLOCATION_ERROR___
}
for ( t = 0; t < blocks; t++ ) {
e[t] = NULL;
}
return e;
}
//a static function to do the re-hash work.
__STATIC_API__ void rebuild_hash( friso_hash_t _hash )
{
//printf("rehashed.\n");
//find the next prime as the length of the hashtable.
uint_t t, length = next_prime( _hash->length * 2 + 1 );
hash_entry_t e, next, *_src = _hash->table, \
*table = create_hash_entries( length );
uint_t bucket;
//copy the nodes
for ( t = 0; t < _hash->length; t++ ) {
e = *( _src + t );
if ( e != NULL ) {
do {
next = e->_next;
bucket = hash( e->_key, length );
e->_next = table[bucket];
table[bucket] = e;
e = next;
} while ( e != NULL );
}
}
_hash->table = table;
_hash->length = length;
_hash->threshold = ( uint_t ) ( _hash->length * _hash->factor );
//free the old hash_entry_t blocks allocations.
FRISO_FREE( _src );
}
/* ********************************
* hashtable interface functions. *
* ********************************/
//create a new hash table.
FRISO_API friso_hash_t new_hash_table( void )
{
friso_hash_t _hash = ( friso_hash_t ) FRISO_MALLOC( sizeof ( friso_hash_cdt ) );
if ( _hash == NULL ) {
___ALLOCATION_ERROR___
}
//initialize the the hashtable
_hash->length = DEFAULT_LENGTH;
_hash->size = 0;
_hash->factor = DEFAULT_FACTOR;
_hash->threshold = ( uint_t ) ( _hash->length * _hash->factor );
_hash->table = create_hash_entries( _hash->length );
return _hash;
}
FRISO_API void free_hash_table(
friso_hash_t _hash,
fhash_callback_fn_t fentry_func )
{
register uint_t j;
hash_entry_t e, n;
for ( j = 0; j < _hash->length; j++ ) {
e = *( _hash->table + j );
for ( ; e != NULL ; ) {
n = e->_next;
if ( fentry_func != NULL ) fentry_func(e);
FRISO_FREE( e );
e = n;
}
}
//free the pointer array block ( 4 * htable->length continuous bytes ).
FRISO_FREE( _hash->table );
FRISO_FREE( _hash );
}
//put a new mapping insite.
//the value cannot be NULL.
FRISO_API void *hash_put_mapping(
friso_hash_t _hash,
fstring key,
void * value )
{
uint_t bucket = ( key == NULL ) ? 0 : hash( key, _hash->length );
hash_entry_t e = *( _hash->table + bucket );
void *oval = NULL;
//check the given key is already exists or not.
for ( ; e != NULL; e = e->_next ) {
if ( key == e->_key
|| ( key != NULL && e->_key != NULL
&& strcmp( key, e->_key ) == 0 ) ) {
oval = e->_val; //bak the old value
e->_key = key;
e->_val = value;
return oval;
}
}
//put a new mapping into the hashtable.
_hash->table[bucket] = new_hash_entry( key, value, _hash->table[bucket] );
_hash->size++;
//check the condition to rebuild the hashtable.
if ( _hash->size >= _hash->threshold ) {
rebuild_hash( _hash );
}
return oval;
}
//check the existence of the mapping associated with the given key.
FRISO_API int hash_exist_mapping(
friso_hash_t _hash, fstring key )
{
uint_t bucket = ( key == NULL ) ? 0 : hash( key, _hash->length );
hash_entry_t e;
for ( e = *( _hash->table + bucket );
e != NULL; e = e->_next ) {
if ( key == e->_key
|| ( key != NULL && e->_key != NULL
&& strcmp( key, e->_key ) == 0 )) {
return 1;
}
}
return 0;
}
//get the value associated with the given key.
FRISO_API void *hash_get_value( friso_hash_t _hash, fstring key )
{
uint_t bucket = ( key == NULL ) ? 0 : hash( key, _hash->length );
hash_entry_t e;
for ( e = *( _hash->table + bucket );
e != NULL; e = e->_next ) {
if ( key == e->_key
|| ( key != NULL && e->_key != NULL
&& strcmp( key, e->_key ) == 0 )) {
return e->_val;
}
}
return NULL;
}
//remove the mapping associated with the given key.
FRISO_API hash_entry_t hash_remove_mapping(
friso_hash_t _hash, fstring key )
{
uint_t bucket = ( key == NULL ) ? 0 : hash( key, _hash->length );
hash_entry_t e, prev = NULL;
hash_entry_t b;
for ( e = *( _hash->table + bucket );
e != NULL; prev = e, e = e->_next ) {
if ( key == e->_key
|| ( key != NULL && e->_key != NULL
&& strcmp( key, e->_key ) == 0 ) ) {
b = e;
//the node located at *( htable->table + bucket )
if ( prev == NULL ) {
_hash->table[bucket] = e->_next;
} else {
prev->_next = e->_next;
}
//printf("%s was removed\n", b->_key);
_hash->size--;
//FRISO_FREE( b );
return b;
}
}
return NULL;
}
//count the size.(A macro define has replace this.)
//FRISO_API uint_t hash_get_size( friso_hash_t _hash ) {
// return _hash->size;
//}
```
|
```xml
import type { JSXElementConstructor, ReactNode } from 'react';
import type { ButtonLikeShape, ButtonLikeSize } from '@proton/atoms/Button';
import type { FeatureCode, IconName } from '@proton/components';
import type { COUPON_CODES, CYCLE } from '@proton/shared/lib/constants';
import type { Currency, Optional, PlanIDs } from '@proton/shared/lib/interfaces';
export type OfferId =
// This offer runs all the time and is used to remind users to upgrade once their account is old enough
| 'subscription-reminder'
| 'duo-plan-2024-yearly'
| 'duo-plan-2024-two-years'
| 'go-unlimited-2022'
| 'mail-trial-2023'
| 'mail-trial-2024'
| 'black-friday-2023-inbox-free'
| 'black-friday-2023-inbox-mail'
| 'black-friday-2023-inbox-unlimited'
| 'black-friday-2023-vpn-free'
| 'black-friday-2023-vpn-monthly'
| 'black-friday-2023-vpn-yearly'
| 'black-friday-2023-vpn-two-years'
| 'black-friday-2023-drive-free'
| 'black-friday-2023-drive-plus'
| 'black-friday-2023-drive-unlimited';
export type OfferGlobalFeatureCodeValue = Record<OfferId, boolean>;
export enum OfferUserFeatureCodeValue {
Default = 0,
Visited = 1,
Hide = 2,
}
export interface OfferProps {
currency: Currency;
offer: Offer;
onChangeCurrency: (currency: Currency) => void;
onSelectDeal: (offer: Offer, deal: Deal, current: Currency) => void;
onCloseModal: () => void;
}
export type OfferLayoutProps = Optional<OfferProps, 'offer'>;
export interface Operation {
config: OfferConfig;
isValid: boolean;
isLoading: boolean;
isEligible: boolean;
isUsingMoreThan80PercentStorage?: boolean;
}
export interface OfferImages {
sideImage?: string;
sideImage2x?: string;
bannerImage?: string;
bannerImage2x?: string;
}
export interface OfferConfig {
ID: OfferId;
featureCode: FeatureCode;
autoPopUp?: 'each-time' | 'one-time';
canBeDisabled?: boolean;
deals: Deal[];
layout: JSXElementConstructor<OfferLayoutProps>;
/** Displays countdown if present */
periodEnd?: Date;
topButton?: {
shape?: ButtonLikeShape;
gradient?: boolean;
iconGradient?: boolean;
icon?: IconName;
getCTAContent?: () => string;
variant?: string;
};
images?: OfferImages;
darkBackground?: boolean; // Will use a light close button if true (ghost button with white text)
enableCycleSelector?: boolean; // Allow the selection of cycles if true in the checkout process
/** only make sense for 1 plan offer and IF the plan title is above the plan card */
hideDealTitle?: boolean;
/** if you want to hide all "save xx%"" in the bubble on top of all plans */
hideDiscountBubble?: boolean;
hideDealPriceInfos?: boolean;
}
interface Feature {
badge?: string;
disabled?: boolean;
icon?: IconName;
name: string;
tooltip?: string;
}
export interface Deal {
couponCode?: COUPON_CODES;
ref: string;
cycle: CYCLE;
features?: () => Feature[];
getCTAContent?: () => string;
buttonSize?: ButtonLikeSize;
planIDs: PlanIDs; // planIDs used to subscribe
dealName: string; // most of the time we show the plan name of the deal
popular?: number; // 1 = most popular, 2 = second most popular, etc.
mobileOrder?: number; // 1 = most popular, 2 = second most popular, etc. if using this, please specify it for all plans to avoid issues
header?: () => string | ReactNode;
star?: string;
isGuaranteed?: boolean;
dealSuffixPrice?: () => string;
suffixOnNewLine?: boolean;
}
export interface Prices {
withCoupon: number;
withoutCoupon: number;
withoutCouponMonthly: number;
}
export type DealWithPrices = Deal & { prices: Prices };
export interface Offer extends OfferConfig {
deals: DealWithPrices[];
}
export interface DealProps extends Required<OfferProps> {
deal: Offer['deals'][number];
}
```
|
Mahatma Gandhi (1869–1948) is widely regarded as the main icon of the Indian independence movement.
Gandhi or Ghandhi may also refer to:
Gandhi (surname), a surname, and list of people with the name
Gandhi (Chhimba clan), a clan of the Chhimba caste in India
Arts
Gandhi Before India, a biography of Gandhi written by historian Ramachandra Guha.
Gandhi: The Years That Changed the World, a biography of Gandhi written by historian Ramachandra Guha.
Gandhi (film), a 1982 biographical film about Gandhi
Gandhi, My Father, a 2007 film about the relationship between Gandhi and his son
Gandhi (American band)
Gandhi (Costa Rican band)
"Gandhi", a song by Anne McCue
"Gandhi", a song from the Patti Smith album Trampin'
People
Indira Gandhi, former Prime Minister of India
Rajiv Gandhi, former Prime Minister of India
Rahul Gandhi, President of the Indian National Congress
Sonia Gandhi, President of the Indian National Congress
Mahatma Gandhi (footballer), Brazilian footballer
Other
Gandhi (bookstore), a Mexican bookstore chain
MV Hannington Court (1954) or Gandhi, a cargo ship
Nickname of Rehavam Ze'evi (1926-2001), Israeli general and politician
Gandhi (Mexico City Metrobús), a BRT station in Mexico City
Gandhi (Clone High), a character of the animated sitcom Clone High
See also
Gandhi family (disambiguation)
Gandhism, ideology of Mahatma Gandhi
Gandhigiri, a revival of Gandhism in India
Gandi, a French domain name registrar and web host
Gandy (disambiguation)
Gondi (disambiguation)
Statue of Mahatma Gandhi (disambiguation)
List of things named after Mahatma Gandhi
Gandhinagar (disambiguation)
Indira Gandhi ministry (disambiguation)
Rajiv Gandhi ministry (disambiguation)
|
```javascript
import { useState } from "react";
import Router from "next/router";
import { useUser } from "../lib/hooks";
import Layout from "../components/layout";
import Form from "../components/form";
const Signup = () => {
useUser({ redirectTo: "/", redirectIfFound: true });
const [errorMsg, setErrorMsg] = useState("");
async function handleSubmit(e) {
e.preventDefault();
if (errorMsg) setErrorMsg("");
const body = {
username: e.currentTarget.username.value,
password: e.currentTarget.password.value,
};
if (body.password !== e.currentTarget.rpassword.value) {
setErrorMsg(`The passwords don't match`);
return;
}
try {
const res = await fetch("/api/signup", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(body),
});
if (res.status === 200) {
Router.push("/login");
} else {
throw new Error(await res.text());
}
} catch (error) {
console.error("An unexpected error happened occurred:", error);
setErrorMsg(error.message);
}
}
return (
<Layout>
<div className="login">
<Form isLogin={false} errorMessage={errorMsg} onSubmit={handleSubmit} />
</div>
<style jsx>{`
.login {
max-width: 21rem;
margin: 0 auto;
padding: 1rem;
border: 1px solid #ccc;
border-radius: 4px;
}
`}</style>
</Layout>
);
};
export default Signup;
```
|
```objective-c
GOST_KEY_TRANSPORT *make_rfc4490_keytransport_2001(EVP_PKEY *pubk,
BIGNUM *eph_key,
const unsigned char *key,
size_t keylen,
unsigned char *ukm,
size_t ukm_len);
int decrypt_rfc4490_shared_key_2001(EVP_PKEY *priv,
GOST_KEY_TRANSPORT * gkt,
unsigned char *key_buf, int key_buf_len);
```
|
```rust
//! Vertex storage containers.
use crate::{
has_field::HasField,
vertex::{Deinterleave, Vertex},
};
use std::{marker::PhantomData, mem};
#[derive(Debug)]
pub enum VertexStorage<'a, V> {
NoStorage,
Interleaved(&'a mut Interleaved<V>),
Deinterleaved(&'a mut Deinterleaved<V>),
}
pub trait AsVertexStorage<V> {
fn as_vertex_storage(&mut self) -> VertexStorage<V>;
}
impl<V> AsVertexStorage<V> for () {
fn as_vertex_storage(&mut self) -> VertexStorage<V> {
VertexStorage::NoStorage
}
}
impl<V> AsVertexStorage<V> for Interleaved<V> {
fn as_vertex_storage(&mut self) -> VertexStorage<V> {
VertexStorage::Interleaved(self)
}
}
impl<V> AsVertexStorage<V> for Deinterleaved<V> {
fn as_vertex_storage(&mut self) -> VertexStorage<V> {
VertexStorage::Deinterleaved(self)
}
}
pub trait VertexStorageFamily {
type Storage<V>: AsVertexStorage<V>;
}
impl VertexStorageFamily for () {
type Storage<V> = ();
}
#[derive(Debug)]
pub struct Interleaving;
impl VertexStorageFamily for Interleaving {
type Storage<V> = Interleaved<V>;
}
#[derive(Debug)]
pub struct Deinterleaving;
impl VertexStorageFamily for Deinterleaving {
type Storage<V> = Deinterleaved<V>;
}
/// Store vertices as an interleaved array.
#[derive(Debug)]
pub struct Interleaved<V> {
vertices: Vec<V>,
primitive_restart: bool,
}
impl<V> Interleaved<V> {
/// Build a new interleaved storage.
pub fn new() -> Self {
Self {
vertices: Vec::new(),
primitive_restart: false,
}
}
/// Set vertices.
pub fn set_vertices(mut self, vertices: impl Into<Vec<V>>) -> Self {
self.vertices = vertices.into();
self
}
/// Get access to the vertices.
pub fn vertices(&self) -> &Vec<V> {
&self.vertices
}
/// Get access to the vertices.
pub fn vertices_mut(&mut self) -> &mut Vec<V> {
&mut self.vertices
}
/// Get access to the vertices as bytes.
pub fn vertices_as_bytes(&self) -> &[u8] {
let data = self.vertices.as_ptr();
let len = self.vertices.len();
unsafe { std::slice::from_raw_parts(data as _, len * mem::size_of::<V>()) }
}
pub fn primitive_restart(&self) -> bool {
self.primitive_restart
}
pub fn set_primitive_restart(mut self, primitive_restart: bool) -> Self {
self.primitive_restart = primitive_restart;
self
}
}
/// Store vertices as deinterleaved arrays.
#[derive(Debug)]
pub struct Deinterleaved<V> {
components_list: Vec<Vec<u8>>,
primitive_restart: bool,
_phantom: PhantomData<V>,
}
impl<V> Deinterleaved<V>
where
V: Vertex,
{
/// Create a new empty deinterleaved storage.
pub fn new() -> Self {
let components_count = V::components_count();
Self {
components_list: vec![Vec::new(); components_count],
primitive_restart: false,
_phantom: PhantomData,
}
}
/// Set named components.
pub fn set_components<const NAME: &'static str>(
mut self,
components: impl Into<Vec<<V as HasField<NAME>>::FieldType>>,
) -> Self
where
V: Deinterleave<NAME>,
{
// turn the components into a raw vector (Vec<u8>)
let boxed_slice = components.into().into_boxed_slice();
let len = boxed_slice.len();
let len_bytes = len * std::mem::size_of::<<V as HasField<NAME>>::FieldType>();
let ptr = Box::into_raw(boxed_slice);
let raw = unsafe { Vec::from_raw_parts(ptr as _, len_bytes, len_bytes) };
self.components_list[<V as Deinterleave<NAME>>::RANK] = raw;
self
}
/// Get all components
pub fn components_list(&self) -> &Vec<Vec<u8>> {
&self.components_list
}
pub fn primitive_restart(&self) -> bool {
self.primitive_restart
}
pub fn set_primitive_restart(mut self, primitive_restart: bool) -> Self {
self.primitive_restart = primitive_restart;
self
}
}
```
|
```go
package gitrepo
func RepoGitURL(repo Repository) string {
return repoPath(repo)
}
```
|
Aleksandyr Gerow () (1919–1997) was a Bulgarian poet and writer.
1919 births
1997 deaths
20th-century Bulgarian poets
Bulgarian male poets
Bulgarian male writers
20th-century male writers
|
```objective-c
/*
** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
**
** 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, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
** Any non-GPL usage of this software or parts of this software is strictly
** forbidden.
**
** The "appropriate copyright message" mentioned in section 2c of the GPLv2
** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
**
** Commercial non-GPL licensing of this software is possible.
** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
**
** $Id: hcb_11.h,v 1.5 2007/11/01 12:34:11 menno Exp $
**/
/* 2-step huffman table HCB_11 */
/* 1st step: 5 bits
* 2^5 = 32 entries
*
* Used to find offset into 2nd step table and number of extra bits to get
*/
static hcb hcb11_1[] = {
/* 4 bits */
{ /* 00000 */ 0, 0 },
{ /* */ 0, 0 },
{ /* 00010 */ 1, 0 },
{ /* */ 1, 0 },
/* 5 bits */
{ /* 00100 */ 2, 0 },
{ /* 00101 */ 3, 0 },
{ /* 00110 */ 4, 0 },
{ /* 00111 */ 5, 0 },
{ /* 01000 */ 6, 0 },
{ /* 01001 */ 7, 0 },
/* 6 bits */
{ /* 01010 */ 8, 1 },
{ /* 01011 */ 10, 1 },
{ /* 01100 */ 12, 1 },
/* 6/7 bits */
{ /* 01101 */ 14, 2 },
/* 7 bits */
{ /* 01110 */ 18, 2 },
{ /* 01111 */ 22, 2 },
{ /* 10000 */ 26, 2 },
/* 7/8 bits */
{ /* 10001 */ 30, 3 },
/* 8 bits */
{ /* 10010 */ 38, 3 },
{ /* 10011 */ 46, 3 },
{ /* 10100 */ 54, 3 },
{ /* 10101 */ 62, 3 },
{ /* 10110 */ 70, 3 },
{ /* 10111 */ 78, 3 },
/* 8/9 bits */
{ /* 11000 */ 86, 4 },
/* 9 bits */
{ /* 11001 */ 102, 4 },
{ /* 11010 */ 118, 4 },
{ /* 11011 */ 134, 4 },
/* 9/10 bits */
{ /* 11100 */ 150, 5 },
/* 10 bits */
{ /* 11101 */ 182, 5 },
{ /* 11110 */ 214, 5 },
/* 10/11/12 bits */
{ /* 11111 */ 246, 7 }
};
/* 2nd step table
*
* Gives size of codeword and actual data (x,y,v,w)
*/
static hcb_2_pair hcb11_2[] = {
/* 4 */
{ 4, 0, 0 },
{ 4, 1, 1 },
/* 5 */
{ 5, 16, 16 },
{ 5, 1, 0 },
{ 5, 0, 1 },
{ 5, 2, 1 },
{ 5, 1, 2 },
{ 5, 2, 2 },
/* 6 */
{ 6, 1, 3 },
{ 6, 3, 1 },
{ 6, 3, 2 },
{ 6, 2, 0 },
{ 6, 2, 3 },
{ 6, 0, 2 },
/* 6/7 */
{ 6, 3, 3 }, { 6, 3, 3 },
{ 7, 4, 1 },
{ 7, 1, 4 },
/* 7 */
{ 7, 4, 2 },
{ 7, 2, 4 },
{ 7, 4, 3 },
{ 7, 3, 4 },
{ 7, 3, 0 },
{ 7, 0, 3 },
{ 7, 5, 1 },
{ 7, 5, 2 },
{ 7, 2, 5 },
{ 7, 4, 4 },
{ 7, 1, 5 },
{ 7, 5, 3 },
/* 7/8 */
{ 7, 3, 5 }, { 7, 3, 5 },
{ 7, 5, 4 }, { 7, 5, 4 },
{ 8, 4, 5 },
{ 8, 6, 2 },
{ 8, 2, 6 },
{ 8, 6, 1 },
/* 8 */
{ 8, 6, 3 },
{ 8, 3, 6 },
{ 8, 1, 6 },
{ 8, 4, 16 },
{ 8, 3, 16 },
{ 8, 16, 5 },
{ 8, 16, 3 },
{ 8, 16, 4 },
{ 8, 6, 4 },
{ 8, 16, 6 },
{ 8, 4, 0 },
{ 8, 4, 6 },
{ 8, 0, 4 },
{ 8, 2, 16 },
{ 8, 5, 5 },
{ 8, 5, 16 },
{ 8, 16, 7 },
{ 8, 16, 2 },
{ 8, 16, 8 },
{ 8, 2, 7 },
{ 8, 7, 2 },
{ 8, 3, 7 },
{ 8, 6, 5 },
{ 8, 5, 6 },
{ 8, 6, 16 },
{ 8, 16, 10 },
{ 8, 7, 3 },
{ 8, 7, 1 },
{ 8, 16, 9 },
{ 8, 7, 16 },
{ 8, 1, 16 },
{ 8, 1, 7 },
{ 8, 4, 7 },
{ 8, 16, 11 },
{ 8, 7, 4 },
{ 8, 16, 12 },
{ 8, 8, 16 },
{ 8, 16, 1 },
{ 8, 6, 6 },
{ 8, 9, 16 },
{ 8, 2, 8 },
{ 8, 5, 7 },
{ 8, 10, 16 },
{ 8, 16, 13 },
{ 8, 8, 3 },
{ 8, 8, 2 },
{ 8, 3, 8 },
{ 8, 5, 0 },
/* 8/9 */
{ 8, 16, 14 }, { 8, 16, 14 },
{ 8, 11, 16 }, { 8, 11, 16 },
{ 8, 7, 5 }, { 8, 7, 5 },
{ 8, 4, 8 }, { 8, 4, 8 },
{ 8, 6, 7 }, { 8, 6, 7 },
{ 8, 7, 6 }, { 8, 7, 6 },
{ 8, 0, 5 }, { 8, 0, 5 },
{ 9, 8, 4 },
{ 9, 16, 15 },
/* 9 */
{ 9, 12, 16 },
{ 9, 1, 8 },
{ 9, 8, 1 },
{ 9, 14, 16 },
{ 9, 5, 8 },
{ 9, 13, 16 },
{ 9, 3, 9 },
{ 9, 8, 5 },
{ 9, 7, 7 },
{ 9, 2, 9 },
{ 9, 8, 6 },
{ 9, 9, 2 },
{ 9, 9, 3 },
{ 9, 15, 16 },
{ 9, 4, 9 },
{ 9, 6, 8 },
{ 9, 6, 0 },
{ 9, 9, 4 },
{ 9, 5, 9 },
{ 9, 8, 7 },
{ 9, 7, 8 },
{ 9, 1, 9 },
{ 9, 10, 3 },
{ 9, 0, 6 },
{ 9, 10, 2 },
{ 9, 9, 1 },
{ 9, 9, 5 },
{ 9, 4, 10 },
{ 9, 2, 10 },
{ 9, 9, 6 },
{ 9, 3, 10 },
{ 9, 6, 9 },
{ 9, 10, 4 },
{ 9, 8, 8 },
{ 9, 10, 5 },
{ 9, 9, 7 },
{ 9, 11, 3 },
{ 9, 1, 10 },
{ 9, 7, 0 },
{ 9, 10, 6 },
{ 9, 7, 9 },
{ 9, 3, 11 },
{ 9, 5, 10 },
{ 9, 10, 1 },
{ 9, 4, 11 },
{ 9, 11, 2 },
{ 9, 13, 2 },
{ 9, 6, 10 },
/* 9/10 */
{ 9, 13, 3 }, { 9, 13, 3 },
{ 9, 2, 11 }, { 9, 2, 11 },
{ 9, 16, 0 }, { 9, 16, 0 },
{ 9, 5, 11 }, { 9, 5, 11 },
{ 9, 11, 5 }, { 9, 11, 5 },
{ 10, 11, 4 },
{ 10, 9, 8 },
{ 10, 7, 10 },
{ 10, 8, 9 },
{ 10, 0, 16 },
{ 10, 4, 13 },
{ 10, 0, 7 },
{ 10, 3, 13 },
{ 10, 11, 6 },
{ 10, 13, 1 },
{ 10, 13, 4 },
{ 10, 12, 3 },
{ 10, 2, 13 },
{ 10, 13, 5 },
{ 10, 8, 10 },
{ 10, 6, 11 },
{ 10, 10, 8 },
{ 10, 10, 7 },
{ 10, 14, 2 },
{ 10, 12, 4 },
{ 10, 1, 11 },
{ 10, 4, 12 },
/* 10 */
{ 10, 11, 1 },
{ 10, 3, 12 },
{ 10, 1, 13 },
{ 10, 12, 2 },
{ 10, 7, 11 },
{ 10, 3, 14 },
{ 10, 5, 12 },
{ 10, 5, 13 },
{ 10, 14, 4 },
{ 10, 4, 14 },
{ 10, 11, 7 },
{ 10, 14, 3 },
{ 10, 12, 5 },
{ 10, 13, 6 },
{ 10, 12, 6 },
{ 10, 8, 0 },
{ 10, 11, 8 },
{ 10, 2, 12 },
{ 10, 9, 9 },
{ 10, 14, 5 },
{ 10, 6, 13 },
{ 10, 10, 10 },
{ 10, 15, 2 },
{ 10, 8, 11 },
{ 10, 9, 10 },
{ 10, 14, 6 },
{ 10, 10, 9 },
{ 10, 5, 14 },
{ 10, 11, 9 },
{ 10, 14, 1 },
{ 10, 2, 14 },
{ 10, 6, 12 },
{ 10, 1, 12 },
{ 10, 13, 8 },
{ 10, 0, 8 },
{ 10, 13, 7 },
{ 10, 7, 12 },
{ 10, 12, 7 },
{ 10, 7, 13 },
{ 10, 15, 3 },
{ 10, 12, 1 },
{ 10, 6, 14 },
{ 10, 2, 15 },
{ 10, 15, 5 },
{ 10, 15, 4 },
{ 10, 1, 14 },
{ 10, 9, 11 },
{ 10, 4, 15 },
{ 10, 14, 7 },
{ 10, 8, 13 },
{ 10, 13, 9 },
{ 10, 8, 12 },
{ 10, 5, 15 },
{ 10, 3, 15 },
{ 10, 10, 11 },
{ 10, 11, 10 },
{ 10, 12, 8 },
{ 10, 15, 6 },
{ 10, 15, 7 },
{ 10, 8, 14 },
{ 10, 15, 1 },
{ 10, 7, 14 },
{ 10, 9, 0 },
{ 10, 0, 9 },
/* 10/11/12 */
{ 10, 9, 13 }, { 10, 9, 13 }, { 10, 9, 13 }, { 10, 9, 13 },
{ 10, 9, 12 }, { 10, 9, 12 }, { 10, 9, 12 }, { 10, 9, 12 },
{ 10, 12, 9 }, { 10, 12, 9 }, { 10, 12, 9 }, { 10, 12, 9 },
{ 10, 14, 8 }, { 10, 14, 8 }, { 10, 14, 8 }, { 10, 14, 8 },
{ 10, 10, 13 }, { 10, 10, 13 }, { 10, 10, 13 }, { 10, 10, 13 },
{ 10, 14, 9 }, { 10, 14, 9 }, { 10, 14, 9 }, { 10, 14, 9 },
{ 10, 12, 10 }, { 10, 12, 10 }, { 10, 12, 10 }, { 10, 12, 10 },
{ 10, 6, 15 }, { 10, 6, 15 }, { 10, 6, 15 }, { 10, 6, 15 },
{ 10, 7, 15 }, { 10, 7, 15 }, { 10, 7, 15 }, { 10, 7, 15 },
{ 11, 9, 14 }, { 11, 9, 14 },
{ 11, 15, 8 }, { 11, 15, 8 },
{ 11, 11, 11 }, { 11, 11, 11 },
{ 11, 11, 14 }, { 11, 11, 14 },
{ 11, 1, 15 }, { 11, 1, 15 },
{ 11, 10, 12 }, { 11, 10, 12 },
{ 11, 10, 14 }, { 11, 10, 14 },
{ 11, 13, 11 }, { 11, 13, 11 },
{ 11, 13, 10 }, { 11, 13, 10 },
{ 11, 11, 13 }, { 11, 11, 13 },
{ 11, 11, 12 }, { 11, 11, 12 },
{ 11, 8, 15 }, { 11, 8, 15 },
{ 11, 14, 11 }, { 11, 14, 11 },
{ 11, 13, 12 }, { 11, 13, 12 },
{ 11, 12, 13 }, { 11, 12, 13 },
{ 11, 15, 9 }, { 11, 15, 9 },
{ 11, 14, 10 }, { 11, 14, 10 },
{ 11, 10, 0 }, { 11, 10, 0 },
{ 11, 12, 11 }, { 11, 12, 11 },
{ 11, 9, 15 }, { 11, 9, 15 },
{ 11, 0, 10 }, { 11, 0, 10 },
{ 11, 12, 12 }, { 11, 12, 12 },
{ 11, 11, 0 }, { 11, 11, 0 },
{ 11, 12, 14 }, { 11, 12, 14 },
{ 11, 10, 15 }, { 11, 10, 15 },
{ 11, 13, 13 }, { 11, 13, 13 },
{ 11, 0, 13 }, { 11, 0, 13 },
{ 11, 14, 12 }, { 11, 14, 12 },
{ 11, 15, 10 }, { 11, 15, 10 },
{ 11, 15, 11 }, { 11, 15, 11 },
{ 11, 11, 15 }, { 11, 11, 15 },
{ 11, 14, 13 }, { 11, 14, 13 },
{ 11, 13, 0 }, { 11, 13, 0 },
{ 11, 0, 11 }, { 11, 0, 11 },
{ 11, 13, 14 }, { 11, 13, 14 },
{ 11, 15, 12 }, { 11, 15, 12 },
{ 11, 15, 13 }, { 11, 15, 13 },
{ 11, 12, 15 }, { 11, 12, 15 },
{ 11, 14, 0 }, { 11, 14, 0 },
{ 11, 14, 14 }, { 11, 14, 14 },
{ 11, 13, 15 }, { 11, 13, 15 },
{ 11, 12, 0 }, { 11, 12, 0 },
{ 11, 14, 15 }, { 11, 14, 15 },
{ 12, 0, 14 },
{ 12, 0, 12 },
{ 12, 15, 14 },
{ 12, 15, 0 },
{ 12, 0, 15 },
{ 12, 15, 15 }
};
```
|
Ernest Rudolph Johnson (April 29, 1888 – May 1, 1952) was an American professional baseball shortstop. He played in Major League Baseball (MLB) for the Chicago White Sox (1912, 1921–23), St. Louis Terriers (Federal League 1915), St. Louis Browns (1916–1918), and New York Yankees (1923–1925). In between, he spent with the Salt Lake City Bees as their player-manager.
Johnson took over the White Sox shortstop job from the recently banned Swede Risberg in 1921. He hit .295 and was fourth in the American League with 22 stolen bases. In 1922 his batting average dropped to .254 and he had the dubious distinction of leading the league in outs (494).
He was acquired by the Yankees via waivers on May 31, 1923, and he batted .447 for them in a limited role. He played in two games of the 1923 World Series against the New York Giants and scored the series-deciding run as a pinch runner in game number six. Johnson spent the next two years with New York in a part-time role, batting .353 and .282. On October 28, 1925, at age 37, Johnson was sent to the St. Paul Saints of the American Association as part of a multi-player trade.
Johnson's career totals for 813 games include 697 hits, 19 home runs, 257 runs batted in, 372 runs scored, a .266 batting average, and a slugging percentage of .350.
After Johnson's playing career, he spent several years as a manager in the minor leagues. He managed the Portland Beavers from until and the Seattle Indians from until . After that, he worked for the Boston Red Sox as an advance scout until his death in 1952.
His son was former major league second baseman Don Johnson. His brother, George, was a long-time minor league umpire.
Sources
External links
1888 births
1952 deaths
Baseball players from Chicago
Boston Red Sox scouts
Chicago Green Sox players
Chicago White Sox players
Dubuque Hustlers players
Los Angeles Angels (minor league) players
Major League Baseball shortstops
New York Yankees players
Portland Beavers managers
Portland Beavers players
St. Louis Browns players
St. Louis Terriers players
Salt Lake City Bees players
Seattle Indians players
|
The Caldwell United States Post Office, located at 14 N. Main St. in Caldwell, Kansas, was listed on the National Register of Historic Places in 1989. It is Classical Revival in style and was built in 1941.
It includes a tempura mural Cowboys Driving Cattle by artist Kenneth Evett.
It was listed on the National Register as US Post Office—Caldwell.
References
Government buildings on the National Register of Historic Places in Kansas
Neoclassical architecture in Kansas
Government buildings completed in 1941
National Register of Historic Places in Sumner County, Kansas
|
In the field of topology, the signature is an integer invariant which is defined for an oriented manifold M of dimension divisible by four.
This invariant of a manifold has been studied in detail, starting with Rokhlin's theorem for 4-manifolds, and Hirzebruch signature theorem.
Definition
Given a connected and oriented manifold M of dimension 4k, the cup product gives rise to a quadratic form Q on the 'middle' real cohomology group
.
The basic identity for the cup product
shows that with p = q = 2k the product is symmetric. It takes values in
.
If we assume also that M is compact, Poincaré duality identifies this with
which can be identified with . Therefore the cup product, under these hypotheses, does give rise to a symmetric bilinear form on H2k(M,R); and therefore to a quadratic form Q. The form Q is non-degenerate due to Poincaré duality, as it pairs non-degenerately with itself. More generally, the signature can be defined in this way for any general compact polyhedron with 4n-dimensional Poincaré duality.
The signature of M is by definition the signature of Q, that is, where any diagonal matrix defining Q has positive entries and negative entries. If M is not connected, its signature is defined to be the sum of the signatures of its connected components.
Other dimensions
If M has dimension not divisible by 4, its signature is usually defined to be 0. There are alternative generalization in L-theory: the signature can be interpreted as the 4k-dimensional (simply connected) symmetric L-group or as the 4k-dimensional quadratic L-group and these invariants do not always vanish for other dimensions. The Kervaire invariant is a mod 2 (i.e., an element of ) for framed manifolds of dimension 4k+2 (the quadratic L-group ), while the de Rham invariant is a mod 2 invariant of manifolds of dimension 4k+1 (the symmetric L-group ); the other dimensional L-groups vanish.
Kervaire invariant
When is twice an odd integer (singly even), the same construction gives rise to an antisymmetric bilinear form. Such forms do not have a signature invariant; if they are non-degenerate, any two such forms are equivalent. However, if one takes a quadratic refinement of the form, which occurs if one has a framed manifold, then the resulting ε-quadratic forms need not be equivalent, being distinguished by the Arf invariant. The resulting invariant of a manifold is called the Kervaire invariant.
Properties
Compact oriented manifolds M and N satisfy by definition, and satisfy by a Künneth formula.
If M is an oriented boundary, then .
René Thom (1954) showed that the signature of a manifold is a cobordism invariant, and in particular is given by some linear combination of its Pontryagin numbers. For example, in four dimensions, it is given by . Friedrich Hirzebruch (1954) found an explicit expression for this linear combination as the L genus of the manifold.
William Browder (1962) proved that a simply connected compact polyhedron with 4n-dimensional Poincaré duality is homotopy equivalent to a manifold if and only if its signature satisfies the expression of the Hirzebruch signature theorem.
Rokhlin's theorem says that the signature of a 4-dimensional simply connected manifold with a spin structure is divisible by 16.
See also
Hirzebruch signature theorem
Genus of a multiplicative sequence
Rokhlin's theorem
References
Geometric topology
Quadratic forms
|
```ruby
# frozen_string_literal: true
module Decidim
module Initiatives
# A command with all the business logic that updates an
# existing initiative.
class UpdateInitiative < Decidim::Command
include ::Decidim::MultipleAttachmentsMethods
include ::Decidim::GalleryMethods
include CurrentLocale
delegate :current_user, to: :form
# Public: Initializes the command.
#
# initiative - Decidim::Initiative
# form - A form object with the params.
def initialize(initiative, form)
@form = form
@initiative = initiative
@attached_to = initiative
end
# Executes the command. Broadcasts these events:
#
# - :ok when everything is valid.
# - :invalid if the form was not valid and we could not proceed.
#
# Returns nothing.
def call
return broadcast(:invalid) if form.invalid?
if process_attachments?
build_attachments
return broadcast(:invalid) if attachments_invalid?
end
if process_gallery?
build_gallery
return broadcast(:invalid) if gallery_invalid?
end
@initiative = Decidim.traceability.update!(
initiative,
current_user,
attributes
)
photo_cleanup!
document_cleanup!
create_attachments if process_attachments?
create_gallery if process_gallery?
broadcast(:ok, initiative)
rescue ActiveRecord::RecordInvalid
broadcast(:invalid, initiative)
end
private
attr_reader :form, :initiative
def attributes
attrs = {
title: { current_locale => form.title },
description: { current_locale => form.description },
hashtag: form.hashtag,
decidim_user_group_id: form.decidim_user_group_id
}
if form.signature_type_updatable?
attrs[:signature_type] = form.signature_type
attrs[:scoped_type_id] = form.scoped_type_id if form.scoped_type_id
end
if initiative.created?
attrs[:signature_end_date] = form.signature_end_date if initiative.custom_signature_end_date_enabled?
attrs[:decidim_area_id] = form.area_id if initiative.area_enabled?
end
attrs
end
end
end
end
```
|
```java
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package org.flowable.spring.test.engine;
import static org.assertj.core.api.Assertions.assertThat;
import org.flowable.idm.engine.IdmEngines;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit.jupiter.SpringExtension;
/**
* Spring process engine base test
*
* @author Henry Yan
*/
@ExtendWith(SpringExtension.class)
@ContextConfiguration("classpath:org/flowable/spring/test/engine/springIdmEngine-context.xml")
public class SpringIdmEngineTest {
@Test
public void testGetEngineFromCache() {
assertThat(IdmEngines.getDefaultIdmEngine()).isNotNull();
assertThat(IdmEngines.getIdmEngine("default")).isNotNull();
}
}
```
|
Sanicula arguta is a species of flowering plant in the family Apiaceae known by the common names sharptooth sanicle and sharptooth blacksnakeroot.
It is native to the coastal hills and mountains of the central coast and southern California and Baja California, the San Francisco Bay Area, and the Channel Islands. It grows in many types of local habitat, including California chaparral and woodlands.
Description
Sanicula arguta is a perennial herb growing from a thick taproot resembling a turnip. The plant is mostly erect, growing up to half a meter tall. The leaves are up to 10 centimeters long and are divided into several sharp-toothed lobes.
The inflorescence is made up of one or more heads of bisexual and male-only flowers with tiny, curving, golden yellow petals. The prickly fruits are about half a centimeter long.
External links
Jepson Manual Treatment
USDA Plants Profile
Photo gallery
arguta
Flora of California
Flora of Baja California
Natural history of the California chaparral and woodlands
Natural history of the California Coast Ranges
Natural history of the Channel Islands of California
Natural history of the Peninsular Ranges
Natural history of the Transverse Ranges
Flora without expected TNC conservation status
|
The European Academy of Sociology (EAS) is an organization of European scholars with expertise in many different areas of sociology and a common concern with high quality standards for sociological research and education. Currently, the Academy has 42 elected fellows (including, for instance, Melinda Mills, Diego Gambetta, and Lars-Erik Cederman) and 16 emeritus fellows (including, for instance, John Goldthorpe, Anuška Ferligoj, and Anthony Heath).
History
EAS was founded in Paris in 2000 and Raymond Boudon was its first President. Subsequent Presidents were Peter Hedström, Werner Raub, Frank Kalter, and Emmanuel Lazega. The current President is Lucinda Platt.
Mission
The European Academy of Sociology aims to promote and maintain rigorous quality standards for research and education in sociology that help the general public, policy makers, funders, and prospective students to identify excellent research and teaching programs. To that aim, the fellows are willing to offer their services for international bodies of accreditation and evaluation.
The Academy annually awards two prizes recognizing research excellence in sociology: A prize for distinguished publications (since 2005) and the Raymond Boudon Award for Early Career Achievement (since 2016). The Raymond Boudon Award winner is invited to deliver a lecture at the Academy´s Annual Meeting, and one or more fellows and/or invited scholars deliver additional lectures. Some of these lectures were published in the European Sociological Review.
Raymond Boudon Award winners
The following scholars have received the Raymond Boudon award:
2016: Delia Baldassarri, New York University and Bocconi University
2017: Arnout van de Rijt, European University Institute
2018: Christoph Stadtfeld, ETH Zürich
2019: Ozan Aksoy, University College London
2021: Dominik Hangartner, ETH Zürich
2022: Kristian Bernt Karlson, University of Copenhagen
External links
Official website:
References
Sociological organizations
Organizations established in 2000
|
Sean Gilbert (born April 10, 1970) is an American football coach and former player. He is the head football coach for Livingstone College in Salisbury, North Carolina; a position he has held since January 2020. Gilbert played professionally as a defensive tackle in the National Football League (NFL) . He was selected by the Los Angeles Rams as the third overall pick of the 1992 NFL Draft. He played college football at University of Pittsburgh.
Early life
Gilbert played football for the Aliquippa Quips. As a senior Gilbert was a Parade Magazine All-America and the USA Today Prep Defensive Player of the Year and the Associated Press named him to its First-team All-state after leading the "Quips" to a 14–1 record and a Western Pennsylvania AAA championship. He made 91 tackles as a senior and recovered two fumbles for touchdowns. He also played guard on offense for Aliquippa.
College career
As a defensive tackle Gilbert was an All-America choice in 1991. He had 99 tackles (21 for a loss) and 6 sacks in his final two seasons at Pitt. In 1991 against Penn State, Gilbert totaled 11 tackles (6 for a loss) and 1 sack. One observer said Gilbert "played like a man possessed.".As a senior Gilbert had 17 tackles for a loss and 4 sacks. Gilbert played in 6 games, missing almost half of the season with a knee injury. He did not play as a freshman due to the NCAA "Prop 48 rule."
While playing at the University of Pittsburgh, he played with a stellar list of teammates and coaches. On the coaching staff while he was there were Jon Gruden, Mike McCarthy and Marvin Lewis, all of whom later became NFL head coaches. His teammates included NFL standouts Curtis Martin, Billy Davis, Keith Hamilton, Anthony Dorsett and WWE wrestler Matt Bloom.
Professional career
Pre-draft
Height: 6-4½ Weight:315
40-yard time: 4.59
Bench Press: 440 lbs.
Gilbert entered the 1992 NFL Draft as a junior after only two collegiate seasons, where he was selected as the third overall pick by the Los Angeles Rams.
Los Angeles / St. Louis Rams
On April 27, 1992, Gilbert signed a five-year $7.5 million contract, including a $3 million signing bonus.
Gilbert started as a rookie, recorded 5 sacks, and was named All-rookie by Pro Football Writers Association. In 1993 Gilbert was voted to his first Pro Bowl and recorded 10.5 sacks. He was also an All-NFC choice by UPI and Pro Football Weekly. In addition he was named All-Madden and was the NFC Defensive Player of the Week after a 4 sack performance against the Pittsburgh Steelers.
In 1995 Gilbert moved to right defensive end (RDE) and was a Pro Bowl alternate, recording 5.5 sacks. The signing of Pro Bowl RDE Leslie O'Neal made Gilbert expendable. "We've got Kevin Carter, D'Marco Farr, Jimmie Jones, and Leslie O'Neal", Rams vice president and director of football operations Steve Ortmayer said.
Washington Redskins
On April 8, 1996, he was traded to the Washington Redskins for a first-round pick (sixth overall) in the 1996 NFL Draft.
With the Redskins, Gilbert was again an alternate to the Pro Bowl. He had 113 tackles and 3 sacks and was a force against the run. As Rams quarterback Steve Walsh said, "Sean Gilbert is playing like a monster." He also helped the defense by drawing double-team blocking. He sprained his knee against the Dallas Cowboys on Thanksgiving Day.
The Redskins made Gilbert their franchise player, but rather than sign the one-year $3.4 million tender offer, Gilbert sat out the 1997 season. After the 1997 season the Redskins again made Gilbert a franchise player, this time offering a one-year contract for $2.97 million (the average of the 5 highest paid DTs). Gilbert objected and asked for arbitration saying the Redskins did not have the right to place their franchise player tag on him for a second straight year. On March 17, 1998, the NFLPA and the NFL had an all-day hearing to resolve the case.
Carolina Panthers
The Redskins received compensation of two first round draft picks from the Carolina Panthers for not matching the Panthers offer of $46.5 million. Gilbert returned to right defensive end in 1998 and recorded 81 tackles, 25 quarterback pressures, and 6 sacks, starting all 16 games. In 1999 and 2000 Gilbert moved to his preferred right defensive tackle position and averaged 50 tackles and 3 sacks during those two seasons. In 2001, Gilbert switched to left defensive tackle and recorded 25 tackles and 2 sacks, playing and starting in only nine games due to injury.
Gilbert broke his right hip on October 27, 2002, during a game versus the Tampa Bay Buccaneers and missed the last eight games of the season. Gilbert totaled 5 tackles during the injury-shortened season.
On March 10, 2003, the Panthers released Gilbert.
Oakland Raiders
The Raiders signed him on October 29, 2003. He ended the year with 7 tackles. After the season. Gilbert became an unrestricted free agent and after not being picked up by a team, he decided to retire.
Coaching career
Gilbert was an assistant football coach at South Mecklenburg High School and West Charlotte High School in Charlotte, North Carolina. In January 2020, he was hired as the head football coach at Livingstone College in Salisbury, North Carolina.
Family
Gilbert and his wife, Nicole, have four children: Deshaun, A'lexus, Zaccheaus, and A'lea. Gilbert is the uncle of former NFL cornerback Darrelle Revis and current cornerback Mark Gilbert.
Head coaching record
References
External links
Livingstone profile
1970 births
Living people
American football defensive ends
Carolina Panthers players
Livingstone Blue Bears football coaches
Los Angeles Rams players
Oakland Raiders players
Pittsburgh Panthers football players
St. Louis Rams players
Washington Redskins players
High school football coaches in North Carolina
National Conference Pro Bowl players
People from Aliquippa, Pennsylvania
Players of American football from Beaver County, Pennsylvania
Coaches of American football from Pennsylvania
African-American coaches of American football
African-American players of American football
20th-century African-American sportspeople
21st-century African-American sportspeople
|
The Journal of Scottish Historical Studies is a bi-annual peer-reviewed academic journal published by Edinburgh University Press on behalf of the Economic and Social History Society of Scotland in May and November of each year. It was established in 1980 as Scottish Economic and Social History and took its current title in 2004. It covers research on the history of Scotland.
External links
Economic and Social History Society of Scotland
Edinburgh University Press academic journals
Academic journals established in 1980
Biannual journals
British history journals
English-language journals
Historiography of Scotland
1980 establishments in Scotland
Scottish studies
|
```php
<?php
/**
*/
namespace OC;
use OCP\IConfig;
/**
* Class which provides access to the system config values stored in config.php
* Internal class for bootstrap only.
* fixes cyclic DI: AllConfig needs AppConfig needs Database needs AllConfig
*/
class SystemConfig {
/** @var array */
protected $sensitiveValues = [
'instanceid' => true,
'datadirectory' => true,
'dbname' => true,
'dbhost' => true,
'dbpassword' => true,
'dbuser' => true,
'dbreplica' => true,
'activity_dbname' => true,
'activity_dbhost' => true,
'activity_dbpassword' => true,
'activity_dbuser' => true,
'mail_from_address' => true,
'mail_domain' => true,
'mail_smtphost' => true,
'mail_smtpname' => true,
'mail_smtppassword' => true,
'passwordsalt' => true,
'secret' => true,
'updater.secret' => true,
'updater.server.url' => true,
'trusted_proxies' => true,
'preview_imaginary_url' => true,
'preview_imaginary_key' => true,
'proxyuserpwd' => true,
'sentry.dsn' => true,
'sentry.public-dsn' => true,
'zammad.download.secret' => true,
'zammad.portal.secret' => true,
'zammad.secret' => true,
'github.client_id' => true,
'github.client_secret' => true,
'log.condition' => [
'shared_secret' => true,
'matches' => true,
],
'license-key' => true,
'redis' => [
'host' => true,
'password' => true,
],
'redis.cluster' => [
'seeds' => true,
'password' => true,
],
'objectstore' => [
'arguments' => [
// Legacy Swift (path_to_url#discussion_r341302207)
'options' => [
'credentials' => [
'key' => true,
'secret' => true,
]
],
// S3
'key' => true,
'secret' => true,
// Swift v2
'username' => true,
'password' => true,
// Swift v3
'user' => [
'name' => true,
'password' => true,
],
],
],
'objectstore_multibucket' => [
'arguments' => [
'options' => [
'credentials' => [
'key' => true,
'secret' => true,
]
],
// S3
'key' => true,
'secret' => true,
// Swift v2
'username' => true,
'password' => true,
// Swift v3
'user' => [
'name' => true,
'password' => true,
],
],
],
'onlyoffice' => [
'jwt_secret' => true,
],
];
public function __construct(
private Config $config,
) {
}
/**
* Lists all available config keys
* @return array an array of key names
*/
public function getKeys() {
return $this->config->getKeys();
}
/**
* Sets a new system wide value
*
* @param string $key the key of the value, under which will be saved
* @param mixed $value the value that should be stored
*/
public function setValue($key, $value) {
$this->config->setValue($key, $value);
}
/**
* Sets and deletes values and writes the config.php
*
* @param array $configs Associative array with `key => value` pairs
* If value is null, the config key will be deleted
*/
public function setValues(array $configs) {
$this->config->setValues($configs);
}
/**
* Looks up a system wide defined value
*
* @param string $key the key of the value, under which it was saved
* @param mixed $default the default value to be returned if the value isn't set
* @return mixed the value or $default
*/
public function getValue($key, $default = '') {
return $this->config->getValue($key, $default);
}
/**
* Looks up a system wide defined value and filters out sensitive data
*
* @param string $key the key of the value, under which it was saved
* @param mixed $default the default value to be returned if the value isn't set
* @return mixed the value or $default
*/
public function getFilteredValue($key, $default = '') {
$value = $this->getValue($key, $default);
if (isset($this->sensitiveValues[$key])) {
$value = $this->removeSensitiveValue($this->sensitiveValues[$key], $value);
}
return $value;
}
/**
* Delete a system wide defined value
*
* @param string $key the key of the value, under which it was saved
*/
public function deleteValue($key) {
$this->config->deleteKey($key);
}
/**
* @param bool|array $keysToRemove
* @param mixed $value
* @return mixed
*/
protected function removeSensitiveValue($keysToRemove, $value) {
if ($keysToRemove === true) {
return IConfig::SENSITIVE_VALUE;
}
if (is_array($value)) {
foreach ($keysToRemove as $keyToRemove => $valueToRemove) {
if (isset($value[$keyToRemove])) {
$value[$keyToRemove] = $this->removeSensitiveValue($valueToRemove, $value[$keyToRemove]);
}
}
}
return $value;
}
}
```
|
```python
r"""An implementation of the Web Site Process Bus.
This module is completely standalone, depending only on the stdlib.
Web Site Process Bus
--------------------
A Bus object is used to contain and manage site-wide behavior:
daemonization, HTTP server start/stop, process reload, signal handling,
drop privileges, PID file management, logging for all of these,
and many more.
In addition, a Bus object provides a place for each web framework
to register code that runs in response to site-wide events (like
process start and stop), or which controls or otherwise interacts with
the site-wide components mentioned above. For example, a framework which
uses file-based templates would add known template filenames to an
autoreload component.
Ideally, a Bus object will be flexible enough to be useful in a variety
of invocation scenarios:
1. The deployer starts a site from the command line via a
framework-neutral deployment script; applications from multiple frameworks
are mixed in a single site. Command-line arguments and configuration
files are used to define site-wide components such as the HTTP server,
WSGI component graph, autoreload behavior, signal handling, etc.
2. The deployer starts a site via some other process, such as Apache;
applications from multiple frameworks are mixed in a single site.
Autoreload and signal handling (from Python at least) are disabled.
3. The deployer starts a site via a framework-specific mechanism;
for example, when running tests, exploring tutorials, or deploying
single applications from a single framework. The framework controls
which site-wide components are enabled as it sees fit.
The Bus object in this package uses topic-based publish-subscribe
messaging to accomplish all this. A few topic channels are built in
('start', 'stop', 'exit', 'graceful', 'log', and 'main'). Frameworks and
site containers are free to define their own. If a message is sent to a
channel that has not been defined or has no listeners, there is no effect.
In general, there should only ever be a single Bus object per process.
Frameworks and site containers share a single Bus object by publishing
messages and subscribing listeners.
The Bus object works as a finite state machine which models the current
state of the process. Bus methods move it from one state to another;
those methods then publish to subscribed listeners on the channel for
the new state.::
O
|
V
STOPPING --> STOPPED --> EXITING -> X
A A |
| \___ |
| \ |
| V V
STARTED <-- STARTING
"""
import atexit
try:
import ctypes
except ImportError:
"""Google AppEngine is shipped without ctypes.
:seealso: path_to_url
"""
ctypes = None
import operator
import os
import sys
import threading
import time
import traceback as _traceback
import warnings
import subprocess
import functools
from more_itertools import always_iterable
# Here I save the value of os.getcwd(), which, if I am imported early enough,
# will be the directory from which the startup script was run. This is needed
# by _do_execv(), to change back to the original directory before execv()ing a
# new process. This is a defense against the application having changed the
# current working directory (which could make sys.executable "not found" if
# sys.executable is a relative-path, and/or cause other problems).
_startup_cwd = os.getcwd()
class ChannelFailures(Exception):
"""Exception raised during errors on Bus.publish()."""
delimiter = '\n'
def __init__(self, *args, **kwargs):
"""Initialize ChannelFailures errors wrapper."""
super(ChannelFailures, self).__init__(*args, **kwargs)
self._exceptions = list()
def handle_exception(self):
"""Append the current exception to self."""
self._exceptions.append(sys.exc_info()[1])
def get_instances(self):
"""Return a list of seen exception instances."""
return self._exceptions[:]
def __str__(self):
"""Render the list of errors, which happened in channel."""
exception_strings = map(repr, self.get_instances())
return self.delimiter.join(exception_strings)
__repr__ = __str__
def __bool__(self):
"""Determine whether any error happened in channel."""
return bool(self._exceptions)
__nonzero__ = __bool__
# Use a flag to indicate the state of the bus.
class _StateEnum(object):
class State(object):
name = None
def __repr__(self):
return 'states.%s' % self.name
def __setattr__(self, key, value):
if isinstance(value, self.State):
value.name = key
object.__setattr__(self, key, value)
states = _StateEnum()
states.STOPPED = states.State()
states.STARTING = states.State()
states.STARTED = states.State()
states.STOPPING = states.State()
states.EXITING = states.State()
try:
import fcntl
except ImportError:
max_files = 0
else:
try:
max_files = os.sysconf('SC_OPEN_MAX')
except AttributeError:
max_files = 1024
class Bus(object):
"""Process state-machine and messenger for HTTP site deployment.
All listeners for a given channel are guaranteed to be called even
if others at the same channel fail. Each failure is logged, but
execution proceeds on to the next listener. The only way to stop all
processing from inside a listener is to raise SystemExit and stop
the whole server.
"""
states = states
state = states.STOPPED
execv = False
max_cloexec_files = max_files
def __init__(self):
"""Initialize pub/sub bus."""
self.execv = False
self.state = states.STOPPED
channels = 'start', 'stop', 'exit', 'graceful', 'log', 'main'
self.listeners = dict(
(channel, set())
for channel in channels
)
self._priorities = {}
def subscribe(self, channel, callback=None, priority=None):
"""Add the given callback at the given channel (if not present).
If callback is None, return a partial suitable for decorating
the callback.
"""
if callback is None:
return functools.partial(
self.subscribe,
channel,
priority=priority,
)
ch_listeners = self.listeners.setdefault(channel, set())
ch_listeners.add(callback)
if priority is None:
priority = getattr(callback, 'priority', 50)
self._priorities[(channel, callback)] = priority
def unsubscribe(self, channel, callback):
"""Discard the given callback (if present)."""
listeners = self.listeners.get(channel)
if listeners and callback in listeners:
listeners.discard(callback)
del self._priorities[(channel, callback)]
def publish(self, channel, *args, **kwargs):
"""Return output of all subscribers for the given channel."""
if channel not in self.listeners:
return []
exc = ChannelFailures()
output = []
raw_items = (
(self._priorities[(channel, listener)], listener)
for listener in self.listeners[channel]
)
items = sorted(raw_items, key=operator.itemgetter(0))
for priority, listener in items:
try:
output.append(listener(*args, **kwargs))
except KeyboardInterrupt:
raise
except SystemExit:
e = sys.exc_info()[1]
# If we have previous errors ensure the exit code is non-zero
if exc and e.code == 0:
e.code = 1
raise
except Exception:
exc.handle_exception()
if channel == 'log':
# Assume any further messages to 'log' will fail.
pass
else:
self.log('Error in %r listener %r' % (channel, listener),
level=40, traceback=True)
if exc:
raise exc
return output
def _clean_exit(self):
"""Assert that the Bus is not running in atexit handler callback."""
if self.state != states.EXITING:
warnings.warn(
'The main thread is exiting, but the Bus is in the %r state; '
'shutting it down automatically now. You must either call '
'bus.block() after start(), or call bus.exit() before the '
'main thread exits.' % self.state, RuntimeWarning)
self.exit()
def start(self):
"""Start all services."""
atexit.register(self._clean_exit)
self.state = states.STARTING
self.log('Bus STARTING')
try:
self.publish('start')
self.state = states.STARTED
self.log('Bus STARTED')
except (KeyboardInterrupt, SystemExit):
raise
except Exception:
self.log('Shutting down due to error in start listener:',
level=40, traceback=True)
e_info = sys.exc_info()[1]
try:
self.exit()
except Exception:
# Any stop/exit errors will be logged inside publish().
pass
# Re-raise the original error
raise e_info
def exit(self):
"""Stop all services and prepare to exit the process."""
exitstate = self.state
EX_SOFTWARE = 70
try:
self.stop()
self.state = states.EXITING
self.log('Bus EXITING')
self.publish('exit')
# This isn't strictly necessary, but it's better than seeing
# "Waiting for child threads to terminate..." and then nothing.
self.log('Bus EXITED')
except Exception:
# This method is often called asynchronously (whether thread,
# signal handler, console handler, or atexit handler), so we
# can't just let exceptions propagate out unhandled.
# Assume it's been logged and just die.
os._exit(EX_SOFTWARE)
if exitstate == states.STARTING:
# exit() was called before start() finished, possibly due to
# Ctrl-C because a start listener got stuck. In this case,
# we could get stuck in a loop where Ctrl-C never exits the
# process, so we just call os.exit here.
os._exit(EX_SOFTWARE)
def restart(self):
"""Restart the process (may close connections).
This method does not restart the process from the calling
thread; instead, it stops the bus and asks the main thread to
call execv.
"""
self.execv = True
self.exit()
def graceful(self):
"""Advise all services to reload."""
self.log('Bus graceful')
self.publish('graceful')
def block(self, interval=0.1):
"""Wait for the EXITING state, KeyboardInterrupt or SystemExit.
This function is intended to be called only by the main thread.
After waiting for the EXITING state, it also waits for all
threads to terminate, and then calls os.execv if self.execv is
True. This design allows another thread to call bus.restart, yet
have the main thread perform the actual execv call (required on
some platforms).
"""
try:
self.wait(states.EXITING, interval=interval, channel='main')
except (KeyboardInterrupt, IOError):
# The time.sleep call might raise
# "IOError: [Errno 4] Interrupted function call" on KBInt.
self.log('Keyboard Interrupt: shutting down bus')
self.exit()
except SystemExit:
self.log('SystemExit raised: shutting down bus')
self.exit()
raise
# Waiting for ALL child threads to finish is necessary on OS X.
# See path_to_url
# It's also good to let them all shut down before allowing
# the main thread to call atexit handlers.
# See path_to_url
self.log('Waiting for child threads to terminate...')
for t in threading.enumerate():
# Validate the we're not trying to join the MainThread
# that will cause a deadlock and the case exist when
# implemented as a windows service and in any other case
# that another thread executes cherrypy.engine.exit()
if (
t != threading.current_thread() and
not isinstance(t, threading._MainThread) and
# Note that any dummy (external) threads are
# always daemonic.
not t.daemon
):
self.log('Waiting for thread %s.' % t.name)
t.join()
if self.execv:
self._do_execv()
def wait(self, state, interval=0.1, channel=None):
"""Poll for the given state(s) at intervals; publish to channel."""
states = set(always_iterable(state))
while self.state not in states:
time.sleep(interval)
self.publish(channel)
def _do_execv(self):
"""Re-execute the current process.
This must be called from the main thread, because certain
platforms (OS X) don't allow execv to be called in a child
thread very well.
"""
try:
args = self._get_true_argv()
except NotImplementedError:
"""It's probably win32 or GAE."""
args = [sys.executable] + self._get_interpreter_argv() + sys.argv
self.log('Re-spawning %s' % ' '.join(args))
self._extend_pythonpath(os.environ)
if sys.platform[:4] == 'java':
from _systemrestart import SystemRestart
raise SystemRestart
else:
if sys.platform == 'win32':
args = ['"%s"' % arg for arg in args]
os.chdir(_startup_cwd)
if self.max_cloexec_files:
self._set_cloexec()
os.execv(sys.executable, args)
@staticmethod
def _get_interpreter_argv():
"""Retrieve current Python interpreter's arguments.
Returns empty tuple in case of frozen mode, uses built-in arguments
reproduction function otherwise.
Frozen mode is possible for the app has been packaged into a binary
executable using py2exe. In this case the interpreter's arguments are
already built-in into that executable.
:seealso: path_to_url
Ref: path_to_url
"""
return ([]
if getattr(sys, 'frozen', False)
else subprocess._args_from_interpreter_flags())
@staticmethod
def _get_true_argv():
"""Retrieve all real arguments of the python interpreter.
...even those not listed in ``sys.argv``
:seealso: path_to_url
:seealso: path_to_url
:seealso: path_to_url
"""
try:
char_p = ctypes.c_wchar_p
argv = ctypes.POINTER(char_p)()
argc = ctypes.c_int()
ctypes.pythonapi.Py_GetArgcArgv(
ctypes.byref(argc),
ctypes.byref(argv),
)
_argv = argv[:argc.value]
# The code below is trying to correctly handle special cases.
# `-c`'s argument interpreted by Python itself becomes `-c` as
# well. Same applies to `-m`. This snippet is trying to survive
# at least the case with `-m`
# Ref: path_to_url
# Ref: python/cpython@418baf9
argv_len, is_command, is_module = len(_argv), False, False
try:
m_ind = _argv.index('-m')
if m_ind < argv_len - 1 and _argv[m_ind + 1] in ('-c', '-m'):
"""
In some older Python versions `-m`'s argument may be
substituted with `-c`, not `-m`
"""
is_module = True
except (IndexError, ValueError):
m_ind = None
try:
c_ind = _argv.index('-c')
if c_ind < argv_len - 1 and _argv[c_ind + 1] == '-c':
is_command = True
except (IndexError, ValueError):
c_ind = None
if is_module:
"""It's containing `-m -m` sequence of arguments."""
if is_command and c_ind < m_ind:
"""There's `-c -c` before `-m`"""
raise RuntimeError(
"Cannot reconstruct command from '-c'. Ref: "
'path_to_url
# Survive module argument here
original_module = sys.argv[0]
if not os.access(original_module, os.R_OK):
"""There's no such module exist."""
raise AttributeError(
"{} doesn't seem to be a module "
'accessible by current user'.format(original_module))
del _argv[m_ind:m_ind + 2] # remove `-m -m`
# ... and substitute it with the original module path:
_argv.insert(m_ind, original_module)
elif is_command:
"""It's containing just `-c -c` sequence of arguments."""
raise RuntimeError(
"Cannot reconstruct command from '-c'. "
'Ref: path_to_url
except AttributeError:
"""It looks Py_GetArgcArgv's completely absent in some environments
It is known, that there's no Py_GetArgcArgv in MS Windows and
``ctypes`` module is completely absent in Google AppEngine
:seealso: path_to_url
:seealso: path_to_url
:ref: path_to_url
"""
raise NotImplementedError
else:
return _argv
@staticmethod
def _extend_pythonpath(env):
"""Prepend current working dir to PATH environment variable if needed.
If sys.path[0] is an empty string, the interpreter was likely
invoked with -m and the effective path is about to change on re-
exec. Add the current directory to $PYTHONPATH to ensure that
the new process sees the same path.
This issue cannot be addressed in the general case because
Python cannot reliably reconstruct the original command line (
path_to_url
(This idea filched from tornado.autoreload)
"""
path_prefix = '.' + os.pathsep
existing_path = env.get('PYTHONPATH', '')
needs_patch = (
sys.path[0] == '' and
not existing_path.startswith(path_prefix)
)
if needs_patch:
env['PYTHONPATH'] = path_prefix + existing_path
def _set_cloexec(self):
"""Set the CLOEXEC flag on all open files (except stdin/out/err).
If self.max_cloexec_files is an integer (the default), then on
platforms which support it, it represents the max open files
setting for the operating system. This function will be called
just before the process is restarted via os.execv() to prevent
open files from persisting into the new process.
Set self.max_cloexec_files to 0 to disable this behavior.
"""
for fd in range(3, self.max_cloexec_files): # skip stdin/out/err
try:
flags = fcntl.fcntl(fd, fcntl.F_GETFD)
except IOError:
continue
fcntl.fcntl(fd, fcntl.F_SETFD, flags | fcntl.FD_CLOEXEC)
def stop(self):
"""Stop all services."""
self.state = states.STOPPING
self.log('Bus STOPPING')
self.publish('stop')
self.state = states.STOPPED
self.log('Bus STOPPED')
def start_with_callback(self, func, args=None, kwargs=None):
"""Start 'func' in a new thread T, then start self (and return T)."""
if args is None:
args = ()
if kwargs is None:
kwargs = {}
args = (func,) + args
def _callback(func, *a, **kw):
self.wait(states.STARTED)
func(*a, **kw)
t = threading.Thread(target=_callback, args=args, kwargs=kwargs)
t.name = 'Bus Callback ' + t.name
t.start()
self.start()
return t
def log(self, msg='', level=20, traceback=False):
"""Log the given message.
Append the last traceback if requested.
"""
if traceback:
msg += '\n' + ''.join(_traceback.format_exception(*sys.exc_info()))
self.publish('log', msg, level)
bus = Bus()
```
|
Lord Black may refer to the following:
William Black, Baron Black (1893–1984), British automotive executive
Conrad Black, Baron Black of Crossharbour (born 1944), Canadian-born British former newspaper publisher
Guy Black, Baron Black of Brentwood (born 1964), Deputy Chairman of the Telegraph Media Group
|
Harrie Vredenburg (born 1952) is a leading scholar in the areas of competitive strategy, innovation, sustainable development and corporate governance in global energy and natural resource industries and is Professor of Strategy and Suncor Chair in Strategy and Sustainability at the University of Calgary's Haskayne School of Business. He also holds appointments as a Research Fellow at the School of Public Policy at the University of Calgary and as an International Research Fellow at the Saïd Business School at the University of Oxford in the UK. In addition, he has taught annually at ESSAM, the European Summer School for Advanced Management since 2002.
Vredenburg was one of the visionaries who founded Haskayne's Global Energy Executive MBA and served as its Academic Director from its inception in 2010 to 2018. Students in this two year blended learning executive program live and work around the world and attend two-week intensive modules in Calgary, Houston, London, Beijing/Shanghai and Doha and between face-to-face modules do coursework online. He was also co-founder and Academic Director of the University of Calgary's MSc in Sustainable Energy Development from its inception in 1996 until 2006.
He has authored or co-authored more than 50 frequently cited articles in leading international scholarly publications including Strategic Management Journal, Organization Science, MIT Sloan Management Review, Harvard Business Review, Energy Policy, Energies, Technovation, International Journal of Economics & Business Research and Global Business & Economics Review. He has also coauthored government reports on industry regulation, innovation and competitiveness and on nuclear energy and he consults to industry. According to Google Scholar, his publications have been cited more than 5,000 times. A leading authority on corporate strategy, governance, innovation and the management of environmental issues in energy and resource industries, Vredenburg's work is recognized in academic circles, corporations, governments and non-profits.
A popular teacher, he lectures in MBA, Executive MBA, doctoral, executive development and corporate directors programs. He was honoured with the 2016-2017 Haskayne MBA Society Top MBA Teacher Award, based on a vote by MBA students. He was also voted 2015-2016 Haskayne MBA Society Top MBA Teacher.
He serves as a non-executive member of the boards of directors of several publicly traded and private international energy companies. He holds the ICD.D designation from the Institute of Corporate Directors as a certified corporate director.
He is married to Dr Jennifer Maguire. They have three adult children.
Early life
Vredenburg was born in the Netherlands and moved to Canada as a youth when his father, an avionics technologist, took a position with American defense contractor Litton Systems in Toronto. He received a BA (Honours) in history from the University of Toronto in 1975 and an MBA in international business and finance, with Dean's list distinction (top 10% of graduating class), from McMaster University in 1979. After working in financial services marketing at American Express in Toronto, he completed a PhD in strategic management from the University of Western Ontario in 1986.
Career
Before joining the University of Calgary in 1989, Vredenburg was a professor at McGill University (1984–1989). He was also a visiting professor at the University of British Columbia (1993–1994) and at the Rotterdam School of Management at Erasmus University (2003). He was founding director of the Haskayne School of Business' International Resource Industries and Sustainability Centre (now Energy and Environmental Initiatives), affiliated with the Institute for Sustainable Energy, Environment and Economy, from 1994 to 2007.
References
1952 births
Living people
Academic staff of McGill University
McMaster University alumni
University of Toronto alumni
University of Western Ontario alumni
Academic staff of the University of Calgary
Dutch emigrants to Canada
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.