text
stringlengths 1
22.8M
|
|---|
```objective-c
/*
* VARCem Virtual ARchaeological Computer EMulator.
* An emulator of (mostly) x86-based PC systems and devices,
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
* spanning the era between 1981 and 1995.
*
* Definitions for the network module.
*
*
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
*
*
* 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 entire
* above 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.
*
* 3. Neither the name of the copyright holder nor the names
* of its contributors may be used to endorse or promote
* products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef EMU_NETWORK_H
#define EMU_NETWORK_H
#include <stdint.h>
/* Network provider types. */
#define NET_TYPE_NONE 0 /* use the null network driver */
#define NET_TYPE_SLIRP 1 /* use the SLiRP port forwarder */
#define NET_TYPE_PCAP 2 /* use the (Win)Pcap API */
#define NET_TYPE_VDE 3 /* use the VDE plug API */
#define NET_MAX_FRAME 1518
/* Queue size must be a power of 2 */
#define NET_QUEUE_LEN 16
#define NET_QUEUE_LEN_MASK (NET_QUEUE_LEN - 1)
#define NET_QUEUE_COUNT 3
#define NET_CARD_MAX 4
#define NET_HOST_INTF_MAX 64
#define NET_PERIOD_10M 0.8
#define NET_PERIOD_100M 0.08
/* Error buffers for network driver init */
#define NET_DRV_ERRBUF_SIZE 384
enum {
NET_LINK_DOWN = (1 << 1),
NET_LINK_TEMP_DOWN = (1 << 2),
NET_LINK_10_HD = (1 << 3),
NET_LINK_10_FD = (1 << 4),
NET_LINK_100_HD = (1 << 5),
NET_LINK_100_FD = (1 << 6),
NET_LINK_1000_HD = (1 << 7),
NET_LINK_1000_FD = (1 << 8),
};
enum {
NET_NONE = 0,
NET_INTERNAL
};
enum {
NET_QUEUE_RX = 0,
NET_QUEUE_TX_VM = 1,
NET_QUEUE_TX_HOST = 2
};
typedef struct netcard_conf_t {
uint16_t device_num;
int net_type;
char host_dev_name[128];
uint32_t link_state;
} netcard_conf_t;
extern netcard_conf_t net_cards_conf[NET_CARD_MAX];
extern uint16_t net_card_current;
typedef int (*NETRXCB)(void *, uint8_t *, int);
typedef int (*NETSETLINKSTATE)(void *, uint32_t link_state);
typedef struct netpkt {
uint8_t *data;
int len;
} netpkt_t;
typedef struct netqueue_t {
netpkt_t packets[NET_QUEUE_LEN];
int head;
int tail;
} netqueue_t;
typedef struct _netcard_t netcard_t;
typedef struct netdrv_t {
void (*notify_in)(void *priv);
void *(*init)(const netcard_t *card, const uint8_t *mac_addr, void *priv, char *netdrv_errbuf);
void (*close)(void *priv);
void *priv;
} netdrv_t;
extern const netdrv_t net_pcap_drv;
extern const netdrv_t net_slirp_drv;
extern const netdrv_t net_vde_drv;
extern const netdrv_t net_null_drv;
struct _netcard_t {
const device_t *device;
void *card_drv;
struct netdrv_t host_drv;
NETRXCB rx;
NETSETLINKSTATE set_link_state;
netqueue_t queues[NET_QUEUE_COUNT];
netpkt_t queued_pkt;
mutex_t *tx_mutex;
mutex_t *rx_mutex;
pc_timer_t timer;
uint16_t card_num;
double byte_period;
uint32_t led_timer;
uint32_t led_state;
uint32_t link_state;
};
typedef struct {
char device[128];
char description[128];
} netdev_t;
typedef struct {
int has_slirp;
int has_pcap;
int has_vde;
} network_devmap_t;
#define HAS_NOSLIRP_NET(x) (x.has_pcap || x.has_vde)
#ifdef __cplusplus
extern "C" {
#endif
/* Global variables. */
extern int nic_do_log; // config
extern network_devmap_t network_devmap;
extern int network_ndev; // Number of pcap devices
extern network_devmap_t network_devmap; // Bitmap of available network types
extern netdev_t network_devs[NET_HOST_INTF_MAX];
/* Function prototypes. */
extern void network_init(void);
extern netcard_t *network_attach(void *card_drv, uint8_t *mac, NETRXCB rx, NETSETLINKSTATE set_link_state);
extern void netcard_close(netcard_t *card);
extern void network_close(void);
extern void network_reset(void);
extern int network_available(void);
extern void network_tx(netcard_t *card, uint8_t *, int);
extern int net_pcap_prepare(netdev_t *);
extern int net_vde_prepare(void);
extern void network_connect(int id, int connect);
extern int network_is_connected(int id);
extern int network_dev_available(int);
extern int network_dev_to_id(char *);
extern int network_card_available(int);
extern int network_card_has_config(int);
extern const char *network_card_get_internal_name(int);
extern int network_card_get_from_internal_name(char *);
#ifdef EMU_DEVICE_H
extern const device_t *network_card_getdevice(int);
#endif
extern int network_tx_pop(netcard_t *card, netpkt_t *out_pkt);
extern int network_tx_popv(netcard_t *card, netpkt_t *pkt_vec, int vec_size);
extern int network_rx_put(netcard_t *card, uint8_t *bufp, int len);
extern int network_rx_put_pkt(netcard_t *card, netpkt_t *pkt);
#ifdef EMU_DEVICE_H
/* 3Com Etherlink */
extern const device_t threec501_device;
extern const device_t threec503_device;
/* Novell NE2000 and compatibles */
extern const device_t ne1000_device;
extern const device_t ne1000_compat_device;
extern const device_t ne2000_device;
extern const device_t ne2000_compat_device;
extern const device_t ne2000_compat_8bit_device;
extern const device_t ethernext_mc_device;
extern const device_t rtl8019as_device;
extern const device_t de220p_device;
extern const device_t rtl8029as_device;
/* AMD PCnet*/
extern const device_t pcnet_am79c960_device;
extern const device_t pcnet_am79c960_eb_device;
extern const device_t pcnet_am79c960_vlb_device;
extern const device_t pcnet_am79c961_device;
extern const device_t pcnet_am79c970a_device;
extern const device_t pcnet_am79c973_device;
extern const device_t pcnet_am79c973_onboard_device;
/* Modem */
extern const device_t modem_device;
/* PLIP */
#ifdef EMU_LPT_H
extern const lpt_device_t lpt_plip_device;
#endif
extern const device_t plip_device;
/* Realtek RTL8139C+ */
extern const device_t rtl8139c_plus_device;
/* DEC Tulip */
extern const device_t dec_tulip_device;
extern const device_t dec_tulip_21140_device;
extern const device_t dec_tulip_21140_vpc_device;
extern const device_t dec_tulip_21040_device;
/* WD 80x3 */
extern const device_t wd8003e_device;
extern const device_t wd8003eb_device;
extern const device_t wd8013ebt_device;
extern const device_t wd8003eta_device;
extern const device_t wd8003ea_device;
extern const device_t wd8013epa_device;
#endif
#ifdef __cplusplus
}
#endif
#endif /*EMU_NETWORK_H*/
```
|
```chuck
/*++
version 3. Alternative licensing terms are available. Contact
info@minocacorp.com for details. See the LICENSE file at the root of this
project for complete licensing information.
Module Name:
chroot.ck
Abstract:
This module implements chroot-based container support.
Author:
Evan Green 25-May-2017
Environment:
Chalk
--*/
//
// your_sha256_hash--- Includes
//
from santa.build import shell;
from santa.config import config;
from santa.containment import Containment, ContainmentError;
from santa.file import chdir, chmod, chroot, mkdir, path, rmtree;
//
// your_sha256_hash----- Macros
//
//
// your_sha256_hash Definitions
//
//
// ------------------------------------------------------ Data Type Definitions
//
//
// ----------------------------------------------- Internal Function Prototypes
//
//
// your_sha256_hash---- Globals
//
//
// your_sha256_hash-- Functions
//
class ChrootContainment is Containment {
var _parameters;
function
create (
parameters
)
/*++
Routine Description:
This routine creates a new container and initializes this instance's
internal variables to represent it.
Arguments:
parameters - Supplies a dictionary of creation parameters.
Return Value:
None.
--*/
{
var rootpath;
_parameters = parameters.copy();
_parameters.type = "chroot";
try {
rootpath = parameters.path;
} except KeyError {
Core.raise(ContainmentError("Required parameter is missing"));
}
if ((rootpath == "") || (rootpath == "/")) {
Core.raise(ContainmentError("Invalid chroot path"));
}
mkdir(rootpath + "/tmp");
chmod(rootpath + "/tmp", 0777);
mkdir(rootpath + "/dev");
shell("set -e\n"
"_world=%s\n"
"for d in null full zero urandom tty; do\n"
" touch $_world/dev/$d\n"
" mount --bind /dev/$d $_world/dev/$d\n"
"done" % path(rootpath));
if (config.getKey("core.verbose")) {
Core.print("Created chroot environment at %s" % rootpath);
}
return;
}
function
destroy (
)
/*++
Routine Description:
This routine destroys the container represented by this instance.
Arguments:
None.
Return Value:
None.
--*/
{
var rootpath = _parameters.path;
var verbose = config.getKey("core.verbose");
if (verbose) {
Core.print("Destroying chroot environment at %s" % rootpath);
}
shell("_world=%s\n"
"for d in null full zero urandom tty; do\n"
" umount $_world/dev/$d\n"
"done\n"
"true" % path(rootpath));
rmtree(rootpath);
_parameters = null;
if (verbose) {
Core.print("Destroyed chroot environment at %s" % rootpath);
}
return;
}
function
load (
parameters
)
/*++
Routine Description:
This routine initializes this instance to reflect the container
identified by the given parameters.
Arguments:
parameters - Supplies a dictionary of parameters.
Return Value:
None.
--*/
{
_parameters = parameters;
try {
parameters.path;
} except KeyError {
Core.raise(ContainmentError("Required parameter is missing"));
}
return;
}
function
save (
)
/*++
Routine Description:
This routine returns the dictionary of state and identification needed
to restore information about this container by other instances of this
class.
Arguments:
None.
Return Value:
Returns a dictionary of parameters to save describing this instance.
--*/
{
return _parameters;
}
function
enter (
parameters
)
/*++
Routine Description:
This routine enters the given container environment.
Arguments:
parameters - Supplies an optional set of additional parameters
specific to this entry into the environment.
Return Value:
None. Upon return, the current execution environment will be confined
to the container.
--*/
{
var path = _parameters.path;
chdir(path);
chroot(path);
if (config.getKey("core.verbose")) {
Core.print("Entered chroot environment at %s" % path);
}
}
function
outerPath (
filepath
)
/*++
Routine Description:
This routine translates from a path within the container to a path
outside of the container.
Arguments:
filepath - Supplies the path rooted from within the container.
Return Value:
Returns the path to the file from the perspective of an application
not executing within the container.
--*/
{
var rootpath = path(_parameters.path);
if (filepath == "/") {
return rootpath;
}
return "/".join([rootpath, filepath]);
}
function
innerPath (
filepath
)
/*++
Routine Description:
This routine translates from a path outside the container to a path
within of the container.
Arguments:
filepath - Supplies the path rooted from outside the container.
Return Value:
Returns the path to the file from the perspective of an application
executing within the container.
--*/
{
var rootpath = _parameters.path;
if (!filepath.startsWith(rootpath)) {
rootpath = path(rootpath);
if (!filepath.startsWith(rootpath)) {
Core.raise(ValueError("Path '%s' does not start in container "
"rooted at '%s'" % [filepath, rootpath]));
}
}
filepath = filepath[rootpath.length()...-1];
if (filepath == "") {
return "/";
}
return filepath;
}
}
//
// Set the variables needed so that the module loader can enumerate this class.
//
var description = "Containment based on chroot.";
var containment = ChrootContainment;
//
// --------------------------------------------------------- Internal Functions
//
```
|
```go
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package websocket
import (
"bufio"
"fmt"
"io"
"net/http"
)
func newServerConn(rwc io.ReadWriteCloser, buf *bufio.ReadWriter, req *http.Request, config *Config, handshake func(*Config, *http.Request) error) (conn *Conn, err error) {
var hs serverHandshaker = &hybiServerHandshaker{Config: config}
code, err := hs.ReadHandshake(buf.Reader, req)
if err == ErrBadWebSocketVersion {
fmt.Fprintf(buf, "HTTP/1.1 %03d %s\r\n", code, http.StatusText(code))
fmt.Fprintf(buf, "Sec-WebSocket-Version: %s\r\n", SupportedProtocolVersion)
buf.WriteString("\r\n")
buf.WriteString(err.Error())
buf.Flush()
return
}
if err != nil {
fmt.Fprintf(buf, "HTTP/1.1 %03d %s\r\n", code, http.StatusText(code))
buf.WriteString("\r\n")
buf.WriteString(err.Error())
buf.Flush()
return
}
if handshake != nil {
err = handshake(config, req)
if err != nil {
code = http.StatusForbidden
fmt.Fprintf(buf, "HTTP/1.1 %03d %s\r\n", code, http.StatusText(code))
buf.WriteString("\r\n")
buf.Flush()
return
}
}
err = hs.AcceptHandshake(buf.Writer)
if err != nil {
code = http.StatusBadRequest
fmt.Fprintf(buf, "HTTP/1.1 %03d %s\r\n", code, http.StatusText(code))
buf.WriteString("\r\n")
buf.Flush()
return
}
conn = hs.NewServerConn(buf, rwc, req)
return
}
// Server represents a server of a WebSocket.
type Server struct {
// Config is a WebSocket configuration for new WebSocket connection.
Config
// Handshake is an optional function in WebSocket handshake.
// For example, you can check, or don't check Origin header.
// Another example, you can select config.Protocol.
Handshake func(*Config, *http.Request) error
// Handler handles a WebSocket connection.
Handler
}
// ServeHTTP implements the http.Handler interface for a WebSocket
func (s Server) ServeHTTP(w http.ResponseWriter, req *http.Request) {
s.serveWebSocket(w, req)
}
func (s Server) serveWebSocket(w http.ResponseWriter, req *http.Request) {
rwc, buf, err := w.(http.Hijacker).Hijack()
if err != nil {
panic("Hijack failed: " + err.Error())
}
// The server should abort the WebSocket connection if it finds
// the client did not send a handshake that matches with protocol
// specification.
defer rwc.Close()
conn, err := newServerConn(rwc, buf, req, &s.Config, s.Handshake)
if err != nil {
return
}
if conn == nil {
panic("unexpected nil conn")
}
s.Handler(conn)
}
// Handler is a simple interface to a WebSocket browser client.
// It checks if Origin header is valid URL by default.
// You might want to verify websocket.Conn.Config().Origin in the func.
// If you use Server instead of Handler, you could call websocket.Origin and
// check the origin in your Handshake func. So, if you want to accept
// non-browser clients, which do not send an Origin header, set a
// Server.Handshake that does not check the origin.
type Handler func(*Conn)
func checkOrigin(config *Config, req *http.Request) (err error) {
config.Origin, err = Origin(config, req)
if err == nil && config.Origin == nil {
return fmt.Errorf("null origin")
}
return err
}
// ServeHTTP implements the http.Handler interface for a WebSocket
func (h Handler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
s := Server{Handler: h, Handshake: checkOrigin}
s.serveWebSocket(w, req)
}
```
|
Weiskirchen is a municipality in the district Merzig-Wadern, in Saarland, Germany. It is situated in the Hunsrück, approx. 20 km northeast of Merzig, and 25 km southeast of Trier.
Geography
Districts
Konfeld
Rappweiler-Zwalbach
Thailen
Weierweiler
Weiskirchen
Sights
In Rappweiler is the "Wild and hiking park Weiskirchen-Rappweiler", whose stock consists mainly of red deer. In the park is also the information center of the Saar-Hunsrück Nature Park with a permanent exhibition.
References
Merzig-Wadern
|
1001 Books You Must Read Before You Die is a literary reference book compiled by over one hundred literary critics worldwide and edited by Peter Boxall, Professor of English at Sussex University, with an introduction by Peter Ackroyd. Each title is accompanied by a brief synopsis and critique briefly explaining why the book was chosen. Some entries have illustrations. This book is part of a series from Quintessence Editions Ltd.
The list
The list contains 1001 titles and is made up of novels, short stories, and short story collections. There is also one pamphlet (A Modest Proposal), one book of collected text (Adjunct: An Undigest), and one graphic novel (Watchmen). The most featured authors on the 2006 list are J. M. Coetzee and Charles Dickens with ten titles each.
There was a major revision of 280 odd titles in 2008. The clear shift within the list has been the removal of ~300 works almost entirely by English-language authors who have more than one title on the original list in favour of lesser known works, often by non-English-language writers.
The 2010 revised and updated edition of the book is less Anglocentric and lists only four titles from Dickens and five from Coetzee, who has the most of any writer on the list. It also includes a collection of essays by Albert Camus, The Rebel.
Minor changes of fewer than 20 books were made in 2010 and 2012.
Editions
1001 Books You Must Read Before You Die, edited by Dr. Peter Boxall, Universe Publishing, United Kingdom, 2006 9781844-34178. First Edition
1001 Books You Must Read Before You Die, edited by Dr. Peter Boxall, Universe Publishing, New York, 2006 9780789314206
1001 Books You Must Read Before You Die, edited by Dr. Peter Boxall, Universe Publishing New York, 2008 9781844036141
1001 Books You Must Read Before You Die, edited by Dr. Peter Boxall, Universe Publishing New York, 2010 9780789320391
1001 Books You Must Read Before You Die, edited by Dr. Peter Boxall, Universe Publishing New York, 2012 9781844037407
References
Top book lists
Books about books
Cassell (publisher) books
2006 books
|
```c++
//===your_sha256_hash------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
//
//===your_sha256_hash------===//
//
// file LICENSE_1_0.txt or copy at path_to_url
// <boost/thread/locks.hpp>
// template <class Mutex> class unique_lock;
// unique_lock& operator=(unique_lock const&) = delete;
#include <boost/thread/lock_types.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/detail/lightweight_test.hpp>
boost::mutex m0;
boost::mutex m1;
int main()
{
boost::unique_lock<boost::mutex> lk0(m0);
boost::unique_lock<boost::mutex> lk1(m1);
lk1 = lk0;
BOOST_TEST(lk1.mutex() == &m0);
BOOST_TEST(lk1.owns_lock() == true);
BOOST_TEST(lk0.mutex() == 0);
BOOST_TEST(lk0.owns_lock() == false);
}
#include "../../../../../remove_error_code_unused_warning.hpp"
```
|
Jean de Ligne, Duke of Arenberg (c. 1525 – 1568) was Baron of Barbançon, founder of the House of Arenberg and stadtholder of the Dutch provinces of Friesland, Groningen, Drenthe and Overijssel from 1549 until his death.
He was the son of Louis de Ligne, Baron of Barbançon from the House of Ligne and Marie of Glymes, Lady of Zevenbergen (1503–1566), daughter of Cornelis of Glymes.
Jean de Ligne belonged to the closest circles around Charles V and was made a Knight in the Order of the Golden Fleece in 1546. In 1549 he became stadtholder of the Northern provinces of Friesland, Groningen, Drenthe and Overijssel. By his marriage to Marguerite de la Marck-Arenberg, sister of Robert III von der Marck-Arenberg who died without children, he became the founder of the third House of Arenberg.
He participated in the campaign in France and distinguished himself in the Battle of St. Quentin (1557) where he, together with Henry V, Duke of Brunswick-Lüneburg, led the left wing of the infantry in the final attack against the French.
At the start of the rebellion he distanced himself of his good friend William the Silent, Lamoral, Count of Egmont and Philip de Montmorency, Count of Hoorn, and remained loyal to the King Philip II of Spain.
He was unable to stop the spread of Protestantism in his Northern provinces, but succeeded in 1567 to keep them loyal to the Crown without bloodshed.
Back south, he joined the army under the Duke of Alva, but objected against the arrests of Egmont and Hoorn.
When Louis and Adolf of Nassau (brothers of William I of Orange) invaded Groningen, he was sent back by Alva to repulse this army.
There he was killed in the Battle of Heiligerlee on 23 May 1568. Cardinal Granvelle described his death as a great loss for the Catholic faith and the King.
Arenberg was buried in the Saint Catherine Church in Zevenbergen, and his remains were moved in 1614 to the family vault in Enghien.
He had seven children, amongst whom:
Charles de Ligne, 2nd Prince of Arenberg (1550–1616), his successor
Margareth (1552–1611), married in 1569 with Philip of Lalaing
Robert (1564–1614), first Prince of Barbançon
Antonia Wilhelmina (1557–1626), married in 1577 with Salentin IX of Isenburg-Grenzau, Archbishop of Cologne, who left the clergy to marry her.
References
External links
Biography (in Dutch)
Archives and Cultural Centre of Arenberg
1520s births
1568 deaths
Year of birth uncertain
Stadtholders in the Low Countries
Jean de Ligne
Jean
Knights of the Golden Fleece
Lords of Zuid-Polsbroek
Military personnel killed in action
Military personnel of the Holy Roman Empire
Nobility of the Spanish Netherlands
Royal reburials
16th-century governors
Stadtholders of Frisia
|
Roman Hemby (born August 16, 2002) is an American football running back for the Maryland Terrapins.
Early life and high school career
Hemby grew up in Edgewood, Maryland and attended The John Carroll School. Hemby was rated a three-star recruit and committed to play college football at Maryland over offers from Appalachian State, Duke, NC State, Vanderbilt, and West Virginia.
College career
Hemby played in four games and rushed 17 times for 71 yards and two touchdowns as a true freshman before redshirting the season. Hemby entered his redshirt freshman as one of the Terrapins' primary running backs alongside Antwain Littleton II. He was named the Big Ten Conference Freshman of the Week after rushing for 114 yards and two touchdowns on seven carries in Maryland's season opener against Buffalo. Hemby repeated as the conference Freshman of the week after rushing for 179 yards and three touchdowns in a 31-24 win over Northwestern. He was also named The Athletic's midseason Freshman All-American.
References
External links
Maryland Terrapins bio
Living people
American football running backs
Maryland Terrapins football players
Players of American football from Maryland
2002 births
|
Uniondale or Union Dale may refer to:
In South Africa:
Uniondale, Western Cape, a small town in South Africa
In the United States:
Union Dale, Pennsylvania, a borough in Susquehanna County
Uniondale, Indiana, a town in Wells County
Uniondale, New York, a hamlet and census-designated place in Nassau County
|
```rust
/*
*
* This software may be used and distributed according to the terms of the
*/
use std::clone::Clone;
use std::collections::HashMap;
use std::collections::HashSet;
use std::sync::Arc;
use anyhow::anyhow;
use anyhow::bail;
use anyhow::Context;
use anyhow::Result;
use bytes::Bytes;
use cloned::cloned;
use commit_transformation::rewrite_commit;
use commit_transformation::RewriteOpts;
use context::CoreContext;
use filestore::StoreRequest;
use fsnodes::RootFsnodeId;
use futures::future;
use futures::stream;
use futures::stream::StreamExt;
use futures::stream::TryStreamExt;
use itertools::Itertools;
use manifest::ManifestOps;
use mononoke_types::BonsaiChangesetMut;
use mononoke_types::ChangesetId;
use mononoke_types::ContentId;
use mononoke_types::FileChange;
use mononoke_types::FileType;
use mononoke_types::FsnodeId;
use mononoke_types::GitLfs;
use mononoke_types::NonRootMPath;
use movers::Mover;
use crate::commit_syncers_lib::mover_to_multi_mover;
use crate::git_submodules::expand::SubmoduleExpansionData;
use crate::git_submodules::git_hash_from_submodule_metadata_file;
use crate::git_submodules::utils::get_x_repo_submodule_metadata_file_path;
use crate::git_submodules::validation::SubmoduleExpansionValidationToken;
use crate::git_submodules::validation::ValidSubmoduleExpansionBonsai;
use crate::git_submodules::SubmodulePath;
use crate::reporting::log_debug;
use crate::reporting::log_error;
use crate::reporting::log_trace;
use crate::reporting::run_and_log_stats_to_scuba;
use crate::types::Repo;
/// Wrapper type to ensure that the bonsai generated by compacting the submodule
/// expansion **can only be used to be rewritten to a small repo**.
///
/// This is needed because the large repo should never have file changes of type
/// GitSubmodule, but the process of compacting/backsyncing submodule expansion
/// changes involves creating these file changes.
///
/// To make it harder for these bonsais to be saved to the large repo, this type
/// only exposes one method: which is to rewrite itself for a small repo.
pub(crate) struct CompactedSubmoduleBonsai(BonsaiChangesetMut);
impl CompactedSubmoduleBonsai {
pub(crate) async fn rewrite_to_small_repo<'a, R: Repo>(
self,
ctx: &'a CoreContext,
remapped_parents: &'a HashMap<ChangesetId, ChangesetId>,
mover: Mover,
large_repo: &'a R,
rewrite_opts: RewriteOpts,
) -> Result<Option<BonsaiChangesetMut>> {
rewrite_commit(
ctx,
self.0,
remapped_parents,
mover_to_multi_mover(mover),
large_repo,
None,
rewrite_opts,
)
.await
.context("Failed to rewrite compacted submodule bonsai for small repo")
}
}
/// Given a large repo bonsai that might contain submodule expansions, validate
/// that all submodule expansions are valid and return a new bonsai without
/// the submodule expansion file changes and with the proper file change
/// of type GitSubmodule that can be backsynced to the small repo.
pub(crate) async fn compact_all_submodule_expansion_file_changes<'a, R: Repo>(
ctx: &'a CoreContext,
// Large repo bonsai
bonsai_mut: BonsaiChangesetMut,
sm_exp_data: SubmoduleExpansionData<'a, R>,
large_repo: &'a R,
// Forward sync mover is needed to convert paths from submodule configs,
// which are all relative small repo root, to their large repo counter-parts
forward_sync_mover: Mover,
) -> Result<CompactedSubmoduleBonsai> {
let bonsai = bonsai_mut.freeze()?;
log_trace(
ctx,
format!(
"Compacting all submodule expansions of bonsai: {0:#?}",
bonsai.message()
),
);
let valid_bonsai = run_and_log_stats_to_scuba(
ctx,
"Validating all submodule expansions",
None,
ValidSubmoduleExpansionBonsai::validate_all_submodule_expansions(
ctx,
sm_exp_data.clone(),
bonsai,
forward_sync_mover.clone(),
),
)
.await
.context("Validation of submodule expansion failed")?;
compact_all_submodule_expansion_file_changes_impl(
ctx,
valid_bonsai,
sm_exp_data,
large_repo,
forward_sync_mover,
)
.await
.map(CompactedSubmoduleBonsai)
}
/// Given a bonsai that has passed submodule expansion validation, compact
/// changes made to all submodule expansions by replacing them with file changes
/// of type GitSubmodule.
async fn compact_all_submodule_expansion_file_changes_impl<'a, R: Repo>(
ctx: &CoreContext,
valid_bonsai: ValidSubmoduleExpansionBonsai,
sm_exp_data: SubmoduleExpansionData<'a, R>,
large_repo: &'a R,
forward_sync_mover: Mover,
) -> Result<BonsaiChangesetMut> {
let (bonsai, validation_token) = valid_bonsai.into_inner_with_token();
let bonsai_mut = bonsai.into_mut();
// Remove all recursive submodules from the submodule deps, because any
// change to them will also change a top-level submodule expansion.
// Since all expansion changes are removed, we only need to generate a
// GitSubmodule file change to the top-level submodule.
let top_level_submodule_deps: HashMap<NonRootMPath, Arc<R>> = sm_exp_data
.submodule_deps
.clone()
.into_iter()
// Submodule paths need to be sorted for the filtering below to work
.sorted_by_key(|(sm_path, _repo)| sm_path.clone())
.fold(HashMap::new(), |mut filtered_paths, (sm_path, sm_repo)| {
for path in filtered_paths.keys() {
if path.is_prefix_of(&sm_path) && *path != sm_path {
// Recursive submodule path, so it can be ignored
return filtered_paths;
}
}
filtered_paths.insert(sm_path, sm_repo);
filtered_paths
});
let compacted_bonsai_mut = stream::iter(top_level_submodule_deps)
.map(anyhow::Ok)
.try_fold(bonsai_mut, |bonsai_mut, (sm_path, _)| {
cloned!(forward_sync_mover);
let x_repo_submodule_metadata_file_prefix =
sm_exp_data.x_repo_submodule_metadata_file_prefix;
async move {
compact_submodule_expansion_file_changes(
ctx,
bonsai_mut,
large_repo,
x_repo_submodule_metadata_file_prefix,
forward_sync_mover,
&sm_path,
validation_token,
)
.await
}
})
.await?;
Ok(compacted_bonsai_mut)
}
/// If there are any changes made to a submodule's expansion, compact them, which
/// means:
///
/// 1. Getting the submodule commit being expanded from the submodule expansion
/// metadata file.
/// 2. Removing all the file changes from the expansion and metadata file from
/// the bonsai.
/// 3. Adding a single file change of type GitSubmodule to the bonsai, pointing
/// to the submodule commit.
///
/// IMPORTANT: this function assumes that the provided bonsai **has a valid
/// submodule expansion**. So **never call this without validating the expansion
/// first!**
async fn compact_submodule_expansion_file_changes<'a, R: Repo>(
ctx: &'a CoreContext,
// Large repo bonsai
mut bonsai_mut: BonsaiChangesetMut,
large_repo: &'a R,
x_repo_submodule_metadata_file_prefix: &'a str,
forward_sync_mover: Mover,
sm_path: &'a NonRootMPath,
// Token that ensures that this function can't be called without performing
// submodule expansion validation on the provided bonsai.
_validation_token: SubmoduleExpansionValidationToken,
) -> Result<BonsaiChangesetMut> {
let x_repo_sm_metadata_file_path = get_x_repo_submodule_metadata_file_path(
&SubmodulePath(sm_path.clone()),
x_repo_submodule_metadata_file_prefix,
)?;
log_trace(
ctx,
format!(
"Compacting submodule {sm_path}. Metadata file path: {x_repo_sm_metadata_file_path}"
),
);
let synced_sm_metadata_file_path = forward_sync_mover(&x_repo_sm_metadata_file_path)
.with_context(|| anyhow!("Mover failed on path {x_repo_sm_metadata_file_path}"))?
.ok_or_else(|| {
anyhow!("Mover didn't return any path for path {x_repo_sm_metadata_file_path}")
})?;
let large_repo_sm_path = forward_sync_mover(sm_path)
.with_context(|| anyhow!("Forward sync mover failed on submodule path: {sm_path}"))?
.ok_or(anyhow!(
"Forward sync mover didn't provide large repo path for submodule path: {sm_path}"
))?;
log_trace(
ctx,
format!("synced_sm_metadata_file_path is {synced_sm_metadata_file_path}"),
);
// Consindering that the provided bonsai is valid, any change affecting the
// expansion will be affecting the expansion's metadata file.
match bonsai_mut
.file_changes
.remove(&synced_sm_metadata_file_path)
{
Some(sm_metadata_file_fc) => {
log_trace(
ctx,
format!("Submodule metadata file {synced_sm_metadata_file_path} was modified"),
);
match sm_metadata_file_fc {
FileChange::Change(tfc) => {
compact_submodule_expansion_update(
ctx,
bonsai_mut,
large_repo,
large_repo_sm_path,
tfc.content_id(),
)
.await
}
FileChange::Deletion => {
compact_submodule_expansion_deletion(
ctx,
bonsai_mut,
large_repo,
large_repo_sm_path,
)
.await
}
_ => bail!("Unsupported change to submodule metadata file"),
}
}
None => {
log_trace(
ctx,
format!("Submodule metadata file {synced_sm_metadata_file_path} was NOT modified"),
);
Ok(bonsai_mut)
}
}
}
/// Handle updates to the submodulen pointer, i.e. where the metadata file was
/// updated with a git commit and the expansion working copy was updated to
/// match the working copy of that commit.
async fn compact_submodule_expansion_update<'a, R: Repo>(
ctx: &'a CoreContext,
mut bonsai_mut: BonsaiChangesetMut,
large_repo: &'a R,
large_repo_sm_path: NonRootMPath,
sm_metadata_file_content_id: ContentId,
) -> Result<BonsaiChangesetMut> {
// If the submodule metadata file was changed, remove all changes from the
// expansion.
bonsai_mut
.file_changes
.retain(|path, _fc| !large_repo_sm_path.is_prefix_of(path));
let git_submodule_sha1 =
git_hash_from_submodule_metadata_file(ctx, large_repo, sm_metadata_file_content_id).await?;
let oid = git_submodule_sha1
.to_object_id()
.context("Object id from GitSha1")?;
let oid_bytes = Bytes::copy_from_slice(oid.as_slice());
let submodule_commit_content_id = filestore::store(
large_repo.repo_blobstore(),
*large_repo.filestore_config(),
ctx,
&StoreRequest::new(oid_bytes.len() as u64),
stream::once(async move { Ok(oid_bytes) }),
)
.await
.context("filestore: upload GitSubmodule file change")?;
let sm_file_change = FileChange::tracked(
submodule_commit_content_id.content_id,
FileType::GitSubmodule,
submodule_commit_content_id.total_size,
None,
GitLfs::FullContent,
);
bonsai_mut
.file_changes
.insert(large_repo_sm_path, sm_file_change);
Ok(bonsai_mut)
}
/// Handle deletion of the submodule expansion.
///
///
/// Even though deleting only the submodule metadata file would be a valid,
/// "back-syncable" change, this change would add the entire expansion working
/// copy to the small repo.
/// Because users would likely shoot themselves in the foot when doing this,
/// we'll only allow the deletion of the metadata file if the **entire
/// submodule expansion is also deleted**.
///
/// NOTE: when this function is called, the caller has already removed the
/// submodule metadata file change from the bonsai.
async fn compact_submodule_expansion_deletion<'a, R: Repo>(
ctx: &'a CoreContext,
bonsai_mut: BonsaiChangesetMut,
large_repo: &'a R,
large_repo_sm_path: NonRootMPath,
) -> Result<BonsaiChangesetMut> {
let parents = bonsai_mut.parents.clone();
let parent_cs_id = match parents[..] {
[cs_id] => cs_id,
[] => bail!("Can't compact expansion in bonsai without parents"),
_ => bail!("Can't compact expansion in bonsai with multiple parents"),
};
let parent_fsnode_id: FsnodeId = large_repo
.repo_derived_data()
.derive::<RootFsnodeId>(ctx, parent_cs_id)
.await
.context("Failed to derive parent root fsnode id")?
.into_fsnode_id();
let expansion_files_stream = parent_fsnode_id.list_leaf_entries_under(
ctx.clone(),
large_repo.repo_blobstore_arc(),
[large_repo_sm_path.clone()],
);
// Iterate over all the files in the submodule expansion working copy to
// ensure that they're all being deleted in this changeset.
//
// Keep track of any file in the expansion that is not being deleted, to
// throw an error and log.
let (mut bonsai_mut, missing_paths) = expansion_files_stream
.try_fold(
(bonsai_mut, HashSet::new()),
|(mut bonsai_mut, mut missing_paths), (file_path, _)| {
let fc = bonsai_mut.file_changes.remove(&file_path);
match fc {
// File in expansion is being deleted, as expected
Some(FileChange::Deletion) => (),
Some(fc) => {
log_trace(
ctx,
format!("File {file_path} is being modified when it should be deleted. Change: {fc:#?}"),
);
missing_paths.insert(file_path);
}
None => {
log_trace(ctx, format!("File {file_path} was not deleted"));
missing_paths.insert(file_path);
}
};
future::ok((bonsai_mut, missing_paths))
},
)
.await?;
if !missing_paths.is_empty() {
let msg = format!(
"Submodule metadata file was deleted but {} files in the submodule expansion were not.",
missing_paths.len()
);
log_error(ctx, msg.clone());
let examples = missing_paths.into_iter().take(10).collect::<Vec<_>>();
log_debug(
ctx,
format!("Example paths that should be deleted but weren't: {examples:#?}"),
);
return Err(anyhow!(msg));
}
// All paths in submodule expansion were removed. The submodule metadata
// file change was removed by the caller, so now we just need to insert a
// deletion for the submodule.
bonsai_mut
.file_changes
.insert(large_repo_sm_path, FileChange::Deletion);
Ok(bonsai_mut)
}
```
|
```smalltalk
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using Certify.Core.Management;
using Certify.Management;
using Certify.Management.Servers;
using Certify.Models;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Certify.Core.Tests
{
[TestClass]
/// <summary>
/// Integration tests for IIS Manager
/// </summary>
public class IISManagerTests : IntegrationTestBase, IDisposable
{
private ServerProviderIIS iisManager;
private string testSiteName = "Test2CertRequest";
private readonly string testSiteDomain = "test.com";
private readonly int testSiteHttpPort = 81;
private string testSitePath = "c:\\inetpub\\wwwroot";
private string _siteId = "";
public IISManagerTests()
{
iisManager = new ServerProviderIIS();
// see integration test base for env variable
testSiteDomain = "integration2." + PrimaryTestDomain;
//perform setup for IIS
SetupIIS().Wait();
}
/// <summary>
/// Perform teardown for IIS
/// </summary>
public void Dispose() => TeardownIIS().Wait();
public async Task SetupIIS()
{
if (await iisManager.SiteExists(testSiteName))
{
await iisManager.DeleteSite(testSiteName);
}
var site = await iisManager.CreateSite(testSiteName, testSiteDomain, _primaryWebRoot, "DefaultAppPool");
_siteId = site.Id.ToString();
Assert.IsTrue(await iisManager.SiteExists(testSiteName));
}
public async Task TeardownIIS()
{
await iisManager.DeleteSite(testSiteName);
Assert.IsFalse(await iisManager.SiteExists(testSiteName));
}
[TestMethod]
public async Task TestIISVersionCheck()
{
var version = await iisManager.GetServerVersion();
Assert.IsTrue(version.Major >= 7);
}
[TestMethod]
public async Task TestIISIsAvailable()
{
var isAvailable = await iisManager.IsAvailable();
Assert.IsTrue(isAvailable);
}
[TestMethod]
public async Task TestIISSiteRunning()
{
//this site should be running
var isRunning = await iisManager.IsSiteRunning(_siteId);
Assert.IsTrue(isRunning);
//this site should not be running
isRunning = await iisManager.IsSiteRunning("MadeUpSiteId");
Assert.IsFalse(isRunning);
}
[TestMethod]
public async Task TestGetBinding()
{
var b = await iisManager.GetSiteBindingByDomain(testSiteDomain);
Assert.AreEqual(b.Host, testSiteDomain);
b = await iisManager.GetSiteBindingByDomain("randomdomain.com");
Assert.IsNull(b);
}
[TestMethod]
public async Task TestCreateUnusualBindings()
{
var siteName = "MSMQTest";
//delete test if it exists
if (await iisManager.SiteExists(siteName))
{
await iisManager.DeleteSite(siteName);
}
try
{
// create net.msmq://localhost binding, no port or ip
await iisManager.CreateSite(siteName, "localhost", _primaryWebRoot, null, protocol: "net.msmq", ipAddress: null, port: null);
var sites = iisManager.GetSiteBindingList(false);
}
finally
{
await iisManager.DeleteSite(siteName);
}
}
[TestMethod]
public async Task TestCreateFixedIPBindings()
{
var testName = testSiteName + "FixedIP";
var testDomainName = "FixedIPtest.com";
if (await iisManager.SiteExists(testName))
{
await iisManager.DeleteSite(testName);
}
try
{
var ipAddress = Dns.GetHostEntry(Dns.GetHostName()).AddressList[0].ToString();
var site = await iisManager.CreateSite(testName, testDomainName, _primaryWebRoot, "DefaultAppPool", "http", ipAddress);
Assert.IsTrue(await iisManager.SiteExists(testSiteName));
Assert.IsTrue(site.Bindings.Any(b => b.Host == testDomainName && b.BindingInformation.Contains(ipAddress)));
}
finally
{
await iisManager.DeleteSite(testName);
}
}
[TestMethod]
[Ignore]
public async Task TestManySiteBindingUpdates()
{
var numSites = 100;
// create a large number of site bindings, to see if we encounter isses saving IIS changes
try
{
var allResults = new List<ActionStep>();
for (var i = 0; i < numSites; i++)
{
var domain = "site_" + i + "_toomany.com";
var testSiteName = "ManySites_" + i;
if (await iisManager.SiteExists(testSiteName))
{
await iisManager.DeleteSite(testSiteName);
}
await iisManager.CreateSite(testSiteName, "site_" + i + "_toomany.com", _primaryWebRoot, null, protocol: "http");
var site = await iisManager.GetSiteBindingByDomain(domain);
for (var d = 0; d < 2; d++)
{
var testDomain = Guid.NewGuid().ToString() + domain;
allResults.Add(await iisManager.AddOrUpdateSiteBinding(new BindingInfo
{
SiteId = site.SiteId,
Host = testDomain,
PhysicalPath = _primaryWebRoot
}, addNew: true));
}
}
// now attempt async creation of bindings
var allBindingTasksSet1 = new List<Task<ActionStep>>();
var allBindingTasksSet2 = new List<Task<ActionStep>>();
for (var i = 0; i < numSites; i++)
{
var domain = "site_" + i + "_toomany.com";
var testSiteName = "ManySites_" + i;
var site = await iisManager.GetSiteBindingByDomain(domain);
for (var d = 0; d < 2; d++)
{
var testDomain = Guid.NewGuid().ToString() + domain;
if (i < numSites / 2)
{
allBindingTasksSet1.Add(iisManager.AddOrUpdateSiteBinding(new BindingInfo
{
SiteId = site.SiteId,
Host = testDomain,
PhysicalPath = _primaryWebRoot
}, addNew: true));
}
else
{
allBindingTasksSet2.Add(iisManager.AddOrUpdateSiteBinding(new BindingInfo
{
SiteId = site.SiteId,
Host = testDomain,
PhysicalPath = _primaryWebRoot
}, addNew: true));
}
}
}
ThreadPool.QueueUserWorkItem(async x =>
{
Thread.Sleep(500);
var results = await Task.WhenAll<ActionStep>(allBindingTasksSet1);
// verify all actions ok
Assert.IsFalse(results.Any(r => r.HasError), "Thread1: One or more actions failed");
});
ThreadPool.QueueUserWorkItem(async x =>
{
var results = await Task.WhenAll<ActionStep>(allBindingTasksSet2);
// verify all actions ok
Assert.IsFalse(results.Any(r => r.HasError), "Thread2: One or more actions failed");
});
}
finally
{
// now clean up
for (var i = 0; i < numSites; i++)
{
var testSiteName = "ManySites_" + i;
var domain = "site_" + i + "_toomany.com";
try
{
await iisManager.DeleteSite(testSiteName);
}
catch { }
}
}
}
[TestMethod]
[Ignore]
public async Task TestTooManyBindings()
{
//delete test if it exists
if (await iisManager.SiteExists("ManyBindings"))
{
await iisManager.DeleteSite("ManyBindings");
}
try
{
// create net.msmq://localhost binding, no port or ip
await iisManager.CreateSite("ManyBindings", "toomany.com", _primaryWebRoot, null, protocol: "http");
var site = await iisManager.GetSiteBindingByDomain("toomany.com");
var domains = new List<string>();
for (var i = 0; i < 101; i++)
{
domains.Add(Guid.NewGuid().ToString() + ".toomany.com");
}
await iisManager.AddSiteBindings(site.SiteId, domains);
}
finally
{
await iisManager.DeleteSite("ManyBindings");
}
}
[TestMethod]
public async Task TestLongBinding()
{
var testName = testSiteName + "LongBinding";
var testDomainName = "86098fca1cae7442046562057b1ea940.f3368e3a3240d27430a814c46f7b2c5d.acme.invalid";
if (await iisManager.SiteExists(testName))
{
await iisManager.DeleteSite(testName);
}
var site = await iisManager.CreateSite(testName, testDomainName, _primaryWebRoot, null);
try
{
var certStoreName = CertificateManager.DEFAULT_STORE_NAME;
var cert = CertificateManager.GetCertificatesFromStore().First();
await new IISBindingDeploymentTarget(new ServerProviderIIS()).AddBinding(
new BindingInfo
{
Host = testDomainName,
CertificateHashBytes = cert.GetCertHash(),
CertificateStore = certStoreName,
Port = 443,
Protocol = "https",
SiteId = site.Id.ToString()
}
);
Assert.IsTrue(await iisManager.SiteExists(testName));
}
finally
{
await iisManager.DeleteSite(testName);
}
}
[TestMethod]
public async Task TestPrimarySites()
{
//get all sites
var sites = await iisManager.GetPrimarySites(includeOnlyStartedSites: false);
Assert.IsTrue(sites.Any());
//get all sites excluding stopped sites
sites = await iisManager.GetPrimarySites(includeOnlyStartedSites: true);
Assert.IsTrue(sites.Any());
}
private bool IsCertHashEqual(byte[] a, byte[] b) => StructuralComparisons.StructuralEqualityComparer.Equals(a, b);
[TestMethod, TestCategory("MegaTest")]
public async Task TestBindingMatch()
{
// create test site with mix of hostname and IP only bindings
var testStr = "abc123";
PrimaryTestDomain = $"test-{testStr}." + PrimaryTestDomain;
var testBindingSiteName = "TestAllBinding_" + testStr;
var testSiteDomain = "test" + testStr + "." + PrimaryTestDomain;
if (await iisManager.SiteExists(testBindingSiteName))
{
await iisManager.DeleteSite(testBindingSiteName);
}
// create site with IP all unassigned, no hostname
var site = await iisManager.CreateSite(testBindingSiteName, "", _primaryWebRoot, "DefaultAppPool", port: testSiteHttpPort);
// add another hostname binding (matching cert and not matching cert)
var testDomains = new List<string> { testSiteDomain, "label1." + testSiteDomain, "nested.label." + testSiteDomain };
await iisManager.AddSiteBindings(site.Id.ToString(), testDomains, testSiteHttpPort);
// get fresh instance of site since updates
site = await iisManager.GetIISSiteById(site.Id.ToString());
var bindingsBeforeApply = site.Bindings.ToList();
Assert.AreEqual(site.Name, testBindingSiteName);
var dummyCertPath = Environment.CurrentDirectory + "\\Assets\\dummycert.pfx";
var managedCertificate = new ManagedCertificate
{
Id = Guid.NewGuid().ToString(),
Name = testSiteName,
ServerSiteId = site.Id.ToString(),
UseStagingMode = true,
RequestConfig = new CertRequestConfig
{
PrimaryDomain = testSiteDomain,
Challenges = new ObservableCollection<CertRequestChallengeConfig>(
new List<CertRequestChallengeConfig>
{
new CertRequestChallengeConfig{
ChallengeType="http-01"
}
}),
PerformAutoConfig = true,
PerformAutomatedCertBinding = true,
PerformChallengeFileCopy = true,
PerformExtensionlessConfigChecks = true,
WebsiteRootPath = testSitePath,
DeploymentSiteOption = DeploymentOption.SingleSite,
DeploymentBindingMatchHostname = true,
DeploymentBindingBlankHostname = true,
DeploymentBindingReplacePrevious = true,
SubjectAlternativeNames = new string[] { testSiteDomain, "label1." + testSiteDomain }
},
ItemType = ManagedCertificateType.SSL_ACME,
CertificatePath = dummyCertPath
};
var actions = await new BindingDeploymentManager().StoreAndDeploy(
iisManager.GetDeploymentTarget(),
managedCertificate, dummyCertPath, "",
false, CertificateManager.DEFAULT_STORE_NAME);
foreach (var a in actions)
{
System.Console.WriteLine(a.Description);
}
// get cert info to compare hash
var certInfo = CertificateManager.LoadCertificate(managedCertificate.CertificatePath);
// check IIS site bindings
site = await iisManager.GetIISSiteById(site.Id.ToString());
var finalBindings = site.Bindings.ToList();
Assert.IsTrue(bindingsBeforeApply.Count < finalBindings.Count, "Should have new bindings");
try
{
// check we have the new bindings we expected
// blank hostname binding
var testBinding = finalBindings.FirstOrDefault(b => b.Host == "" && b.Protocol == "https");
Assert.IsTrue(IsCertHashEqual(testBinding.CertificateHash, certInfo.GetCertHash()), "Blank hostname binding should be added and have certificate set");
// TODO: testDomains includes matches and not matches to test
foreach (var d in testDomains)
{
// check san domain now has an https binding
testBinding = finalBindings.FirstOrDefault(b => b.Host == d && b.Protocol == "https");
if (!d.StartsWith("nested."))
{
Assert.IsNotNull(testBinding);
Assert.IsTrue(IsCertHashEqual(testBinding.CertificateHash, certInfo.GetCertHash()), "hostname binding should be added and have certificate set");
}
else
{
Assert.IsNull(testBinding, "nested binding should be null");
}
}
// check existing bindings have been updated as expected
/*foreach (var b in finalBindings)
{
if (b.Protocol == "https")
{
// check this item is one we should have included (is matching domain or has
// no hostname)
bool shouldBeIncluded = false;
if (!String.IsNullOrEmpty(b.Host))
{
if (testDomains.Contains(b.Host))
{
shouldBeIncluded = true;
}
}
else
{
shouldBeIncluded = true;
}
bool isCertMatch = StructuralComparisons.StructuralEqualityComparer.Equals(b.CertificateHash, certInfo.GetCertHash());
if (shouldBeIncluded)
{
Assert.IsTrue(isCertMatch, "Binding should have been updated with cert hash but was not.");
}
else
{
Assert.IsFalse(isCertMatch, "Binding should not have been updated with cert hash but was.");
}
}
}*/
}
finally
{
// clean up IIS either way
await iisManager.DeleteSite(testBindingSiteName);
if (certInfo != null)
{
CertificateManager.RemoveCertificate(certInfo);
}
}
}
}
}
```
|
Telecommunication Breakdown is an album by Emergency Broadcast Network. It was released in 1995 by TVT Records. The CD includes three video tracks in addition to the audio, and a floppy disc includes an interactive press kit.
The music was produced by Jack Dangers, as a side project from his group Meat Beat Manifesto. The album features a number of guest performers: Brian Eno on "Homicidal Schizophrenic," with Jamie West-Oram of The Fixx on guitar; Bill Laswell contributed to "Shoot the Mac-10," with Grandmaster Melle Mel rapping.
Critical reception
The New York Times wrote: "Outrageous and aggressive, Breakdown is guaranteed to have you either laughing, dancing or running from the room in terror ... Emergency Broadcast Network has a CD-ROM vision that matches and, to an extent, deepens its sonic attack."
Track listing
"search" – 0:59
"Electronic Behavior Control System" – 4:33
"go to" – 0:12
"Sexual Orientation" – 3:06
"Station Identification" – 4:40
"Get Down Ver. 2.2" – 3:45
"Shoot the Mac-10" – 4:03
"You Have 5 Seconds to Complete This Section" – 3:06
"Super Zen State (Power Chant No.3)" – 6:50
"State Extension" – 1:15
"interruption" – 0:23
"Dream Induction" – 3:20
"transition" – 0:06
"Electronic Behavior Control System Ver. 2.0" – 2:24
"We Must Have the Facts" – 3:05
"interference" – 0:14
"3:7:8" – 3:43
"Beginning of the End" – 2:45
"Homicidal Schizophrenic (A Lad Insane)" – 4:08
"end of audio program" – 0:45
Video track listing
"Electronic Behavior Control System" - 5:33
"3:7:8" – 3:42
"Homicidal Schizophrenic (A Lad Insane)" – 4:17
References
1995 albums
Electronic albums by American artists
TVT Records albums
Albums produced by Jack Dangers
|
Crow foot, crow's foot, crow's feet or crowfoot may refer to:
People
Crowfoot (1830–1890), First Nations chief, of the Blackfoot
Crow Foot (1873–1890), Native American of the Sioux
John Winter Crowfoot (1873–1959), British archaeologist
Bert Crowfoot (born 1954), Canadian journalist, photographer and television producer
Places
Crowfoot, New Jersey, an unincorporated community, US
Canada
Crowfoot Mountain (Alberta), Canadian Rockies, Alberta
Crowfoot Glacier
Crowfoot (electoral district), an electoral district in Alberta
Crowfoot station, a light rail station in Calgary, Alberta
Science and technology
Crow's foot notation, a set of symbols used to show relationships in a relational database management system
Crowfoot wrench
Crow's feet, a name for wrinkles in the outer corner of the eyes resulting from aging
Plants
Cranesbill, or wild geranium
Cardamine concatenata, crow's foot toothwort
Eleusine indica, crow's foot grass
Erodium spp.
Crow's foot violet, two species of violets; See List of Viola species
Water crowfoot, several Ranunculus species
Diphasiastrum digitatum, crowsfoot
Other uses
Crowfoot (band), a 1970s-era California-based rock band
Crow's-foot stitch, a kind of embroidery stitch
Caltrop, an archaic anti-personnel weapon
Broad arrow or pheon, a marker for government property
Algiz or Elhaz, a Proto-Germanic rune
See also
Bird's Foot (disambiguation)
Chicken foot (disambiguation)
Chicken claw (disambiguation)
|
Sveinung Valle (1959 – 20 March 2016) was a Norwegian farmer and politician for the Labour Party.
He was a cattle farmer in Lindås, and joined the Labour Party in 1997. He was an elected member of Lindås municipal council and Hordaland county council, chaired Hordaland Labour Party from 2009 to 2014 and Lindås Labour Party. He also chaired Hordaland Agrarian Association, and from 2000 to 2001 he served in Stoltenberg's First Cabinet as State Secretary in the Ministry of Agriculture.
Valle died suddenly in his home in March 2016.
References
1959 births
2016 deaths
People from Lindås
Norwegian farmers
Hordaland politicians
Labour Party (Norway) politicians
Norwegian state secretaries
|
```xml
import { removeBin, removeBinsOfDependency } from './removeBins'
export {
removeBin,
removeBinsOfDependency,
}
```
|
The Khulna Titans are a franchise cricket team based in Khulna, Bangladesh, which plays in the Bangladesh Premier League (BPL). They are one of the seven teams that are competing in the 2016 Bangladesh Premier League. The team is captained by Mahmudullah Riyad.
Player draft
The 2016 BPL draft was held on 30 September. Prior to the draft, the seven clubs signed 38 foreign players to contracts and each existing franchise was able to retain two home-grown players from the 2015 season. A total 301 players participated in the draft, including 133 local and 168 foreign players. 85 players were selected in the draft.
Player transfers
Prior to the 2016 draft, a number of high-profile players moved teams. These included transfers between competing teams and due to the suspension of the Sylhet Super Stars and the introduction of two new teams, Khulna Titans and Rajshahi Kings. Transfers included the move of Barisal Bulls captain Mahmudullah Riyad to the Khulna Titans.
Standings
The top four teams will qualify for playoffs
advanced to the Qualifier
advanced to the Eliminator
Current squad
Support staff
Managing Director – [Md Enam Ahmed]
Head Coach –Stuart Law
Manager – Nafees Iqbal
Technical Advisor –Habibul Bashar
References
Bangladesh Premier League
Khulna Tigers cricketers
|
```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.protocol;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.same;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.expectThrows;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import java.net.InetSocketAddress;
import java.util.Map;
import org.apache.pulsar.broker.ServiceConfiguration;
import org.apache.pulsar.broker.service.BrokerService;
import org.apache.pulsar.common.nar.NarClassLoader;
import org.testng.annotations.Test;
/**
* Unit test {@link ProtocolHandlerWithClassLoader}.
*/
@Test(groups = "broker")
public class ProtocolHandlerWithClassLoaderTest {
@Test
public void testWrapper() throws Exception {
ProtocolHandler h = mock(ProtocolHandler.class);
NarClassLoader loader = mock(NarClassLoader.class);
ProtocolHandlerWithClassLoader wrapper = new ProtocolHandlerWithClassLoader(h, loader);
String protocol = "kafka";
when(h.protocolName()).thenReturn(protocol);
assertEquals(protocol, wrapper.protocolName());
verify(h, times(1)).protocolName();
when(h.accept(eq(protocol))).thenReturn(true);
assertTrue(wrapper.accept(protocol));
verify(h, times(1)).accept(same(protocol));
ServiceConfiguration conf = new ServiceConfiguration();
wrapper.initialize(conf);
verify(h, times(1)).initialize(same(conf));
BrokerService service = mock(BrokerService.class);
wrapper.start(service);
verify(h, times(1)).start(service);
String protocolData = "test-protocol-data";
when(h.getProtocolDataToAdvertise()).thenReturn(protocolData);
assertEquals(protocolData, wrapper.getProtocolDataToAdvertise());
verify(h, times(1)).getProtocolDataToAdvertise();
}
@Test
public void testClassLoaderSwitcher() throws Exception {
NarClassLoader loader = mock(NarClassLoader.class);
String protocol = "test-protocol";
ProtocolHandler h = new ProtocolHandler() {
@Override
public String protocolName() {
assertEquals(Thread.currentThread().getContextClassLoader(), loader);
return protocol;
}
@Override
public boolean accept(String protocol) {
assertEquals(Thread.currentThread().getContextClassLoader(), loader);
return true;
}
@Override
public void initialize(ServiceConfiguration conf) throws Exception {
assertEquals(Thread.currentThread().getContextClassLoader(), loader);
throw new Exception("test exception");
}
@Override
public String getProtocolDataToAdvertise() {
assertEquals(Thread.currentThread().getContextClassLoader(), loader);
return "test-protocol-data";
}
@Override
public void start(BrokerService service) {
assertEquals(Thread.currentThread().getContextClassLoader(), loader);
}
@Override
public Map<InetSocketAddress, ChannelInitializer<SocketChannel>> newChannelInitializers() {
assertEquals(Thread.currentThread().getContextClassLoader(), loader);
return null;
}
@Override
public void close() {
assertEquals(Thread.currentThread().getContextClassLoader(), loader);
}
};
ProtocolHandlerWithClassLoader wrapper = new ProtocolHandlerWithClassLoader(h, loader);
ClassLoader curClassLoader = Thread.currentThread().getContextClassLoader();
assertEquals(wrapper.protocolName(), protocol);
assertEquals(Thread.currentThread().getContextClassLoader(), curClassLoader);
assertTrue(wrapper.accept(protocol));
assertEquals(Thread.currentThread().getContextClassLoader(), curClassLoader);
ServiceConfiguration conf = new ServiceConfiguration();
expectThrows(Exception.class, () -> wrapper.initialize(conf));
assertEquals(Thread.currentThread().getContextClassLoader(), curClassLoader);
assertEquals(wrapper.getProtocolDataToAdvertise(), "test-protocol-data");
assertEquals(Thread.currentThread().getContextClassLoader(), curClassLoader);
BrokerService service = mock(BrokerService.class);
wrapper.start(service);
assertEquals(Thread.currentThread().getContextClassLoader(), curClassLoader);
assertNull(wrapper.newChannelInitializers());
assertEquals(Thread.currentThread().getContextClassLoader(), curClassLoader);
wrapper.close();
assertEquals(Thread.currentThread().getContextClassLoader(), curClassLoader);
}
}
```
|
Magic Town is a 1947 American comedy film directed by William A. Wellman and starring James Stewart and Jane Wyman. The picture is one of the first films about the then-new practice of public opinion polling. The film was inspired by the Middletown studies. It is also known as The Magic City.
The "magic" of the title is the mathematical miracle (as it is called in the film) that certain towns can be used to fairly accurately predict the actions of the whole country.
This was character actor Donald Meek’s final film.
Plot
Lawrence "Rip" Smith (James Stewart) is a former basketball player and ex-military who now runs a company that performs polls and consumer surveys. Lately he has started obsessing about being able to find a perfect mathematical "miracle formula" to perform the perfect survey, and compete for real with his rival companies. Because he lacks funds, he is far behind his number one rival, George Stringer.
One day Rip discovers that a survey made by a friend and ex-Army colleague of his, Hoopendecker (Kent Smith), in the small town of Grandview, exactly matches one that Stringer has made on a national level. Rip concludes that the small town demographic is a perfect match for the country as a whole, and believes he has finally found his miracle formula.
Eager to test his theory, Rip sells a survey on progressive education to a client, with a promise the result will stand for the whole country. Furthermore he promises to deliver the result the same day as Stringer's company, even though the rival has been working on the project for quite some time.
Rip and his team of professionals then travel to Grandview to perform the survey. They are pretending to be insurance salesmen. But trouble starts already when Rip overhears a conversation between a woman named Mary Peterman (Jane Wyman) trying to convince the mayor (Harry Holman) to expand the town and build a number of new buildings: a civic center. Rip wants this town to stay exactly as it is, so he can make his perfect surveys, mirroring the demographic of the country. Rip holds an electrifying speech to preserve the town, and the conservative members of the town council listen to him rather than Mary, whose proposition is laid to the side.
Mary writes a bold and angry editorial against Rip in the local newspaper, which is run by her family. Rip starts a charm offensive towards Mary to soften her up, but she holds her ground. The two combatants are attracted to each other though. They spend a lot of time together while Rip secretly gathers information for his survey. One of Rip's colleagues warns him that he is becoming too involved in the subject he is supposed to be studying, but Rip is blinded by his attraction to Mary. Rip starts coaching the school basketball team, and attends a school dance where he meets Mary's family. When Rip later slips away to talk to his client over the phone, Mary follows him, eavesdrops on the conversation, and finds out the truth about Rip being in town.
Angered by his deceit, she publishes the story in the newspaper the next day. A larger nationwide paper picks up the story, and soon the town is crawling with reporters. The town is called "the public opinion capital of the U.S." and its inhabitants start selling their views on consumer products on every street corner. The city council start making bold plans to expand the town, and both Rip and Mary feel ashamed of what they have done to change the town structure. Rip leaves Grandview and Mary and returns home. Soon enough a strange poll from Grandview says Americans would want a female president. The town is ridiculed in the press and the expansion plans get an abrupt ending.
But Rip cannot forget Mary, and he returns to Grandview to reveal his true feelings. Mary admits she has feelings for him too, but also tells Rip that they have to fix the mess they have caused in Grandview before they can start a relationship. Rip starts by talking to a Grandview U.S. Senator Wilton (George Irving), to get help from him raising money to save the town. They display their plan in front of the city council, but the lead council member, Richard Nickleby, is negative. Upset, Rip tells Nickleby that he is "walking out on the team".
Later, Rip learns from Nickleby's son Hank (Mickey Kuhn) that his father already has sold land where the main expansion would take place to a company. To stop this, Rip manages to publish parts of the council speech a few weeks earlier, where it said that they would expand the town "with their own hands". A lot of inhabitants who read the article start demanding that the city council build on the designated land to save the reputation of the town.
It turns out the property sale agreement was not formally correct and the land is returned to the town. The inhabitants all pitch in to build a civic center on the land, and Rip and Mary become a couple.
Cast
James Stewart as Rip Smith
Jane Wyman as Mary Peterman
Kent Smith as Hoopendecker
Ned Sparks as Ike
Wallace Ford as Lou Dicketts
Regis Toomey as Ed Weaver
Ann Doran as Mrs. Weaver
Donald Meek as Mr. Twiddle
Ann Shoemaker as Ma Peterman
Mickey Kuhn as Hank Nickleby
George Irving as Senator Wilton
Julia Dean as Mrs. Wilton
Paul Scardon as Hodges
Ray Walker as Stinger's Associate
Harry Holman as Mayor
Robert Dudley as Dickey
George Chandler as Bus Driver
Edgar Dearing as Questioning Grandview Citizen
Dick Elliott as New Arrival
Franklyn Farnum as Townsman
Bess Flowers as Mayor's Secretary
Gabriel Heatter as Gabriel Heatter - Radio Newscaster
Tom Kennedy as Moving Man
Knox Manning as Radio Broadcaster
Ken Niles as Reporter
Vic Perrin as Elevator Starter
Snub Pollard as Townsman
Cyril Ring as Newspaper Man
Dick Wessel as Moving Man
Lee "Lasses" White as Shoe Shine Man
Joe Yule as Radio Comic
Reception
As with Stewart's previous film, It's a Wonderful Life, the film was a box office flop at the time of its release.
The film recorded a loss of $350,000.
References
External links
1947 films
1947 comedy films
American black-and-white films
American comedy films
1940s English-language films
Films directed by William A. Wellman
Films scored by Roy Webb
Opinion polling in the United States
RKO Pictures films
Films with screenplays by Robert Riskin
1940s American films
English-language comedy films
|
```c
double
foo (float a, float b) { return (double) a * (double) b; }
```
|
50 Signs of Mental Illness: A Guide to Understanding Mental Health is a 2005 book by psychiatrist James Whitney Hicks published by Yale University Press. The book is designed as an accessible psychiatric reference for non-professionals that describes symptoms, treatments and strategies for understanding mental health.
List of signs
The 50 signs covered in the book are:
Anger
Antisocial Behavior
Anxiety
Appetite disturbances
Avoidance
Body image problems
Compulsions
Confusion
Craving
Deceitfulness
Delusions
Denial
Depression
Dissociation
Euphoria
Fatigue
Fears
Flashbacks
Grandiosity
Grief
Hallucinations
Histrionics
Hyperactivity
Identity confusion
Impulsiveness
Intoxication
Jealousy
Learning difficulties
Mania
Memory loss
Mood swings
Movement problems
Nonsense
Obsessions
Oddness
Panic
Paranoia
Physical complaints and pain
Psychosis
Religious preoccupations
Self-esteem problems
Self-mutilation
Sexual performance problems
Sexual preoccupations
Sleep problems
Sloppiness
Speech difficulties
Stress
Suicidal thoughts
Psychological trauma
Reception
A review in the American Journal of Psychiatry commended Hicks's phrasing of acceptable ways to speak about mental illness.
A review in The National Medical Journal of India likewise applauded the book's accessibility to non-experts, though it criticized Hicks's choice of symptoms and suggested "It would be difficult for an Indian to relate to the book" due to the examples he uses.
The book also received attention from Health, Library Journal, The Baltimore Sun, and The Washington Post.
References
Further reading
Bardi, C. A. (2005). The Promise And Perils Of Psychological Self-Help. PsycCRITIQUES, 50(51).
American Psychiatric Association (July, 2018)
External links
Official site
Yale University Press
2005 non-fiction books
Books about mental health
Psychology books
Yale University Press books
|
Mikołaj of Kórnik (died 1382), was bishop of Poznań from 1375-1382.
Biography
His family were of the Łodzia coat of arms. He was a son of Mikołaj from Będlewo, nephew of the bishop of Poznań, Jan of the Łodzia coat of arms. He studied law in Italy, finishing his doctorate with decrees, which he obtained before 1365. After returning to Poland (between 9 July 1365 and 27 January 1368) he became a cantor in Poznań. He also related to the court of Bodzanta, Bodzanty, who appointed him the court judge, in 1359 a canon of Cracow, and in 1364 as the vicar of Bishop.
In 1366, the Pope appointed him a canon of Gniezno, and in 1368 he received the provost of the Blessed Virgin Mary in Kraków. He was also a papal sub-collector, and from 1365 or 1366 to 1372 he was the office of the Chancellor of Greater Poland. Thanks to this last office, he established close relations with the court of King Ludwik Węgierski, which allowed him to remove political opponents, the most powerful of which was the Crown Deputy Chancellor Jan of Czarnków. Probably Nicholas contributed to accusing him of profaning the tomb of Casimir the Great and stealing the coronation insignia, which meant that Jan was deprived of office.
After the death of Jan of Lutogniew, the Poznań bishop's office slowed down. On 7 May 1375 he received the sacrament and sat on the throne of the Poznań bishop. As a bishop he began reconstruction in the Gothic style of the Poznań Cathedral and surrounded Słupca with walls. In politics, he was asking for favors and further assignments for the bishopric of the Mazovian Piasts, but otherwise he did not show any particular political line. In the consciousness of successive generations, his negative picture was fixed by Janek of Czarnków, who described him as a dishonest and corrupt man. He died on 18 March 1382 in Ciążeń, he was buried in the Poznań cathedral.
References
Bishops of Poznań
14th-century Roman Catholic bishops in Poland
14th-century Polish nobility
Year of birth unknown
14th-century births
1382 deaths
|
CBF-FM is a French-language radio station licensed to Montreal, Quebec, Canada.
Owned and operated by the government-owned Canadian Broadcasting Corporation, it transmits on 95.1 MHz from the Mount Royal candelabra tower with an effective radiated power of 100,000 watts (class C1) using an omnidirectional antenna. Its studios and master control are located at Maison Radio-Canada in Montreal.
The station has a non-commercial news/talk format and is the flagship of the Ici Radio-Canada Première network which operates across Canada. Like all Première stations, but unlike most FM stations, it broadcasts in mono. In the summer of 2018, the Montreal 95.1 station started to broadcast in FM multiplex.
History
CBF went on the air on December 11, 1937, as the CBC launched its French-language network, known as Radio-Canada. CBF operated on 910 using 50,000 watts full-time with an omnidirectional antenna as a clear channel Class I-A station. The transmitter was located in Contrecoeur.
The station moved to 690 on March 29, 1941, as a result of the North American Regional Broadcasting Agreement. In 1978, the CBC consolidated its two Montréal AM broadcast transmitters and the station moved to a new transmitter site shared with CBM in Brossard (Now known as CBME-FM on 88.5 FM).
CBF started to broadcast from Maison Radio-Canada in November 1971. Commercial advertising on the station was eliminated in 1974 except for Montreal Canadiens NHL hockey games. (CBF was the Canadiens' radio flagship since its opening in 1937 and would remain so until 1997.)
CBF applied to move to FM and was authorized to do so by the CRTC on July 4, 1997. The AM signal covered much of the western half of Quebec, and was strong enough to be heard in Ottawa and the National Capital Region, as well as parts of New York State and Vermont. Indeed, until CBOF signed on in 1964, CBF doubled as the Radio-Canada outlet for Ottawa as well. Its nighttime signal covered most of the eastern half of North America, including much of Eastern Canada. However, radio frequency interference rendered it almost unlistenable in parts of Montreal during the day, which prompted the decision to move the station to the FM dial.
The FM transmitter was put on the air ahead of schedule on January 22, 1998, and initially had special programming targeting people affected by the 1998 Ice Storm (i.e., people without electricity). The AM signal was shut down on January 21, 1999. (English-language sister station CBM got permission to move to FM and started FM operations at the same time, retaining its AM signal until May 14, 1999.) CBF became CBF-FM when it moved to the FM dial. The existing station with the CBF-FM callsign at 100.7 MHz was renamed CBFX-FM. The station's old home at 690 was taken over by CKVL, which moved from 850 under the new callsign CINF. That station closed down in 2010, and the frequency remained dark until 2012, when English-language sports station CKGM moved there.
To improve reception, CBF was authorized to increase its power from 17,030 watts to 100,000 watts on June 2, 2000. The power increase was implemented in mid-2001.
In recent years the popularity of the station has increased significantly. The station is now usually one of the top five stations in Bureau of Broadcast Measurement ratings (using shares), after decades of being an also-ran.
On September 27, 2018, CBF-FM began broadcasting in HD Radio for compatible receivers, with its second digital radio subchannel offering ICI Musique Classique, a digital-only music feed.
Transmitters
On October 17, 1986 the CRTC approved the CBC's application to change CBF-3's frequency from 1400 to 650 kHz. (Now part of CHLM-FM).
CBF-FM-10 in Sherbrooke and CBF-FM-8 in Trois-Rivières were once full satellites of CBF, but began airing some local programming in 1998. They have both been licensed as full-fledged stations since 2000, despite still having rebroadcaster-like call signs. Both stations have their own local programs and news bulletins; otherwise, their schedules are similar to CBF.
On July 5, 2010, the CBC applied to decrease the effective radiated power of CBF-20, and also on the same date, the CBC also applied to broadcast, on the rebroadcasting transmitters CBF-16, CBF-17 and CBF-18, the programming of CBF-8 instead of the programming of CBF. All technical parameters of the rebroadcasters would remain unchanged.
On July 29, 2010, the CRTC approved the application to transfer transmitters CBF-1, CBF-3 and CBF-4 from CBF to CHLM-FM Rouyn-Noranda.
On October 30, 2012, the CBC received approval to change the source of programming from CBF to CBFG-FM Chisasibi on the following repeaters: CBFA-1 Manawan, CBFA-2 Obedjiwan, CBFW Wemindji, CBFM Mistissini, CBFA-3 Wemotaci, CBFH Waskaganish and CBFV Waswanipi.
Sirius XM
As of 2015, the entirety of CBF's schedule is broadcast live throughout North America via Sirius XM Canada on channel 170. In effect, CBF is one of only two terrestrial stations in North America to be broadcast on Sirius XM, and the only one broadcast using the same feed as the local station (WBBR in New York City; is the only other station, though any local commercials are replaced with national commercials and promos).
References
External links
Official website
BF
BF
BF
Radio stations established in 1937
1937 establishments in Quebec
HD Radio stations
|
```kotlin
package de.westnordost.streetcomplete.quests.max_height
import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AlertDialog
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.osm.mapdata.ElementType
import de.westnordost.streetcomplete.quests.AbstractOsmQuestForm
import de.westnordost.streetcomplete.quests.AnswerItem
import de.westnordost.streetcomplete.view.controller.LengthInputViewController
class AddMaxHeightForm : AbstractOsmQuestForm<MaxHeightAnswer>() {
private lateinit var lengthInput: LengthInputViewController
override val contentLayoutResId get() = when (countryInfo.countryCode) {
"AU", "NZ", "US", "CA" -> R.layout.quest_maxheight_mutcd
"FI", "IS", "SE" -> R.layout.quest_maxheight_fi
else -> R.layout.quest_maxheight
}
override val otherAnswers = listOf(
AnswerItem(R.string.quest_maxheight_answer_noSign) { confirmNoSign() }
)
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
if (element.type == ElementType.WAY) {
setHint(getString(R.string.quest_maxheight_split_way_hint,
getString(R.string.quest_generic_answer_differs_along_the_way)
))
}
lengthInput = LengthInputViewController(
unitSelect = view.findViewById(R.id.heightUnitSelect),
metersContainer = view.findViewById(R.id.meterInputSign),
metersInput = view.findViewById(R.id.meterInput),
feetInchesContainer = view.findViewById(R.id.feetInputSign),
feetInput = view.findViewById(R.id.feetInput),
inchesInput = view.findViewById(R.id.inchInput)
)
lengthInput.maxFeetDigits = 2
lengthInput.maxMeterDigits = Pair(2, 2)
lengthInput.selectableUnits = countryInfo.lengthUnits
lengthInput.onInputChanged = { checkIsFormComplete() }
}
override fun isFormComplete() = lengthInput.length != null
override fun onClickOk() {
if (userSelectedUnrealisticHeight()) {
confirmUnusualInput { applyMaxHeightFormAnswer() }
} else {
applyMaxHeightFormAnswer()
}
}
private fun userSelectedUnrealisticHeight(): Boolean {
val m = lengthInput.length?.toMeters() ?: return false
return m > 6 || m < 1.8
}
private fun applyMaxHeightFormAnswer() {
applyAnswer(MaxHeight(lengthInput.length!!))
}
private fun confirmNoSign() {
activity?.let { AlertDialog.Builder(requireContext())
.setTitle(R.string.quest_generic_confirmation_title)
.setPositiveButton(R.string.quest_generic_confirmation_yes) { _, _ -> applyAnswer(NoMaxHeightSign) }
.setNegativeButton(R.string.quest_generic_confirmation_no, null)
.show()
}
}
private fun confirmUnusualInput(callback: () -> (Unit)) {
activity?.let { AlertDialog.Builder(it)
.setTitle(R.string.quest_generic_confirmation_title)
.setMessage(R.string.quest_maxheight_unusualInput_confirmation_description)
.setPositiveButton(R.string.quest_generic_confirmation_yes) { _, _ -> callback() }
.setNegativeButton(R.string.quest_generic_confirmation_no, null)
.show()
}
}
}
```
|
```ruby
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
# This benchmark is is derived from Stefan Marr's Are-We-Fast-Yet benchmark
# suite available at path_to_url
require_relative 'dependencies/som'
class Plan < Vector
def initialize
super(15)
end
def execute
each { |c| c.execute }
end
end
class Planner
def initialize
@current_mark = 1
end
def incremental_add(constraint)
mark = new_mark
overridden = constraint.satisfy(mark, self)
overridden = overridden.satisfy(mark, self) while overridden
end
def incremental_remove(constraint)
out_v = constraint.output
constraint.mark_unsatisfied
constraint.remove_from_graph
unsatisfied = remove_propagate_from(out_v)
unsatisfied.each { |u| incremental_add(u) }
end
def extract_plan_from_constraints(constraints)
sources = Vector.new
constraints.each do |c|
sources.append(c) if c.is_input && c.is_satisfied
end
make_plan(sources)
end
def make_plan(sources)
mark = new_mark
plan = Plan.new
todo = sources
until todo.empty?
c = todo.remove_first
if c.output.mark != mark && c.inputs_known(mark)
plan.append(c)
c.output.mark = mark
add_constraints_consuming_to(c.output, todo)
end
end
plan
end
def propagate_from(v)
todo = Vector.new
add_constraints_consuming_to(v, todo)
until todo.empty?
c = todo.remove_first
c.execute
add_constraints_consuming_to(c.output, todo)
end
end
def add_constraints_consuming_to(v, coll)
determining_c = v.determined_by
v.constraints.each do |c|
coll.append(c) if (!c.equal? determining_c) && c.is_satisfied
end
end
def add_propagate(c, mark)
todo = Vector.with(c)
until todo.empty?
d = todo.remove_first
if d.output.mark == mark
incremental_remove(c)
return false
end
d.recalculate
add_constraints_consuming_to(d.output, todo)
end
true
end
def change_var(var, val)
edit_constraint = EditConstraint.new(var, SYM_PREFERRED, self)
plan = extract_plan_from_constraints(Vector.with(edit_constraint))
10.times do
var.value = val
plan.execute
end
edit_constraint.destroy_constraint(self)
end
def constraints_consuming(v)
determining_c = v.determined_by
v.constraints.each do |c|
yield c if c != determining_c && c.is_satisfied
end
end
def new_mark
@current_mark += 1
end
def remove_propagate_from(out_v)
unsatisfied = Vector.new
out_v.determined_by = nil
out_v.walk_strength = ABSOLUTE_WEAKEST
out_v.stay = true
todo = Vector.with(out_v)
until todo.empty?
v = todo.remove_first
v.constraints.each do |c|
unsatisfied.append(c) unless c.is_satisfied
end
constraints_consuming(v) do |c|
c.recalculate
todo.append(c.output)
end
end
unsatisfied.sort { |c1, c2| c1.strength.stronger(c2.strength) }
unsatisfied
end
def self.chain_test(n)
# This is the standard DeltaBlue benchmark. A long chain of equality
# constraints is constructed with a stay constraint on one end. An
# edit constraint is then added to the opposite end and the time is
# measured for adding and removing this constraint, and extracting
# and executing a constraint satisfaction plan. There are two cases.
# In case 1, the added constraint is stronger than the stay
# constraint and values must propagate down the entire length of the
# chain. In case 2, the added constraint is weaker than the stay
# constraint so it cannot be accomodated. The cost in this case is,
# of course, very low. Typical situations lie somewhere between these
# two extremes.
planner = Planner.new
vars = Array.new(n + 1) { Variable.new }
# thread a chain of equality constraints through the variables
(0..(n - 1)).each do |i|
v1 = vars[i]
v2 = vars[i + 1]
EqualityConstraint.new(v1, v2, SYM_REQUIRED, planner)
end
StayConstraint.new(vars.last, SYM_STRONG_DEFAULT, planner)
edit = EditConstraint.new(vars.first, SYM_PREFERRED, planner)
plan = planner.extract_plan_from_constraints([edit])
(1..100).each do |v|
vars.first.value = v
plan.execute
raise 'Chain test failed!!' if vars.last.value != v
end
edit.destroy_constraint(planner)
end
def self.projection_test(n)
# This test constructs a two sets of variables related to each
# other by a simple linear transformation (scale and offset). The
# time is measured to change a variable on either side of the
# mapping and to change the scale and offset factors.
planner = Planner.new
dests = Vector.new
scale = Variable.value(10)
offset = Variable.value(1000)
src = nil
dst = nil
(1..n).each do |i|
src = Variable.value(i)
dst = Variable.value(i)
dests.append(dst)
StayConstraint.new(src, SYM_DEFAULT, planner)
ScaleConstraint.new(src, scale, offset, dst, SYM_REQUIRED, planner)
end
planner.change_var(src, 17)
raise 'Projection 1 failed' if dst.value != 1170
planner.change_var(dst, 1050)
raise 'Projection 2 failed' if src.value != 5
planner.change_var(scale, 5)
(0..(n - 2)).each do |i|
raise 'Projection 3 failed' if dests.at(i).value != ((i + 1) * 5 + 1000)
end
planner.change_var(offset, 2000)
(0..(n - 2)).each do |i|
raise 'Projection 4 failed' if dests.at(i).value != ((i + 1) * 5 + 2000)
end
end
end
class Sym
attr_reader :custom_hash
def initialize(hash)
@custom_hash = hash
end
end
SYM_ABSOLUTE_STRONGEST = Sym.new(0)
SYM_REQUIRED = Sym.new(1)
SYM_STRONG_PREFERRED = Sym.new(2)
SYM_PREFERRED = Sym.new(3)
SYM_STRONG_DEFAULT = Sym.new(4)
SYM_DEFAULT = Sym.new(5)
SYM_WEAK_DEFAULT = Sym.new(6)
SYM_ABSOLUTE_WEAKEST = Sym.new(7)
class Strength
attr_reader :arithmetic_value
def initialize(strength_sym)
@symbolic_value = strength_sym
@arithmetic_value = STRENGHT_TABLE.at(strength_sym)
end
def same_as(strength)
@arithmetic_value == strength.arithmetic_value
end
def stronger(strength)
@arithmetic_value < strength.arithmetic_value
end
def weaker(strength)
@arithmetic_value > strength.arithmetic_value
end
def strongest(strength)
if strength.stronger(self)
strength
else
self
end
end
def weakest(strength)
if strength.weaker(self)
strength
else
self
end
end
def self.create_strength_table
table = IdentityDictionary.new
table.at_put(SYM_ABSOLUTE_STRONGEST, -10_000)
table.at_put(SYM_REQUIRED, -800)
table.at_put(SYM_STRONG_PREFERRED, -600)
table.at_put(SYM_PREFERRED, -400)
table.at_put(SYM_STRONG_DEFAULT, -200)
table.at_put(SYM_DEFAULT, 0)
table.at_put(SYM_WEAK_DEFAULT, 500)
table.at_put(SYM_ABSOLUTE_WEAKEST, 10_000)
table
end
def self.create_strength_constants
constants = IdentityDictionary.new
STRENGHT_TABLE.keys.each do |strength_sym|
constants.at_put(strength_sym, new(strength_sym))
end
constants
end
STRENGHT_TABLE = create_strength_table
STRENGHT_CONSTANTS = create_strength_constants
def self.of(sym)
STRENGHT_CONSTANTS.at(sym)
end
end
class AbstractConstraint
attr_reader :strength
def initialize(strength_sym)
@strength = Strength.of(strength_sym)
end
def is_input
false
end
def add_constraint(planner)
add_to_graph
planner.incremental_add(self)
end
def destroy_constraint(planner)
planner.incremental_remove(self) if is_satisfied
remove_from_graph
end
def inputs_known(mark)
!inputs_has_one { |v| !(v.mark == mark || v.stay || !v.determined_by) }
end
def satisfy(mark, planner)
choose_method(mark)
if is_satisfied
inputs_do { |i| i.mark = mark }
outx = output
overridden = outx.determined_by
overridden.mark_unsatisfied if overridden
outx.determined_by = self
unless planner.add_propagate(self, mark)
raise 'Cycle encountered adding: Constraint removed'
end
outx.mark = mark
overridden
else
if @strength.same_as(REQUIRED)
raise 'Failed to satisfy a required constraint'
end
nil
end
end
end
class BinaryConstraint < AbstractConstraint
def initialize(v1, v2, strength, _planner)
super(strength)
@v1 = v1
@v2 = v2
@direction = nil
end
def is_satisfied
@direction != nil
end
def add_to_graph
@v1.add_constraint(self)
@v2.add_constraint(self)
@direction = nil
end
def remove_from_graph
@v1.remove_constraint(self) if @v1
@v2.remove_constraint(self) if @v2
@direction = nil
end
def choose_method(mark)
if @v1.mark == mark
if @v2.mark != mark && @strength.stronger(@v2.walk_strength)
return @direction = :forward
else
return @direction = nil
end
end
if @v2.mark == mark
if @v1.mark != mark && @strength.stronger(@v1.walk_strength)
return @direction = :backward
else
return @direction = nil
end
end
if @v1.walk_strength.weaker(@v2.walk_strength)
if @strength.stronger(@v1.walk_strength)
@direction = :backward
else
@direction = nil
end
else
if @strength.stronger(@v2.walk_strength)
@direction = :forward
else
@direction = nil
end
end
end
def inputs_do
if @direction == :forward
yield @v1
else
yield @v2
end
end
def inputs_has_one
if @direction == :forward
yield @v1
else
yield @v2
end
end
def mark_unsatisfied
@direction = nil
end
def output
if @direction == :forward
@v2
else
@v1
end
end
def recalculate
if @direction == :forward
ihn = @v1
outx = @v2
else
ihn = @v2
outx = @v1
end
outx.walk_strength = @strength.weakest(ihn.walk_strength)
outx.stay = ihn.stay
execute if outx.stay
end
end
class UnaryConstraint < AbstractConstraint
attr_reader :output
def initialize(v, strength, planner)
super(strength)
@output = v
@satisfied = false
add_constraint(planner)
end
def is_satisfied
@satisfied
end
def add_to_graph
@output.add_constraint(self)
@satisfied = false
end
def remove_from_graph
@output.remove_constraint(self) if @output
@satisfied = false
end
def choose_method(mark)
@satisfied = @output.mark != mark &&
@strength.stronger(@output.walk_strength)
end
def inputs_do
# No-op. I have no input variable.
end
def inputs_has_one
false
end
def mark_unsatisfied
@satisfied = false
end
def recalculate
@output.walk_strength = @strength
@output.stay = !is_input
execute if @output.stay
end
end
class EditConstraint < UnaryConstraint
def is_input
true
end
def execute
# Edit constraints does nothing.
end
end
class EqualityConstraint < BinaryConstraint
def initialize(var1, var2, strength, planner)
super(var1, var2, strength, planner)
add_constraint(planner)
end
def execute
if @direction == :forward
@v2.value = @v1.value
else
@v1.value = @v2.value
end
end
end
class ScaleConstraint < BinaryConstraint
def initialize(src, scale, offset, dest, strength, planner)
super(src, dest, strength, planner)
@scale = scale
@offset = offset
add_constraint(planner)
end
def add_to_graph
@v1.add_constraint(self)
@v2.add_constraint(self)
@scale.add_constraint(self)
@offset.add_constraint(self)
@direction = nil
end
def remove_from_graph
@v1.remove_constraint(self) if @v1
@v2.remove_constraint(self) if @v2
@scale.remove_constraint(self) if @scale
@offset.remove_constraint(self) if @offset
@direction = nil
end
def execute
if @direction == :forward
@v2.value = @v1.value * @scale.value + @offset.value
else
@v1.value = (@v2.value - @offset.value) / @scale.value
end
end
def inputs_do
if @direction == :forward
yield @v1
yield @scale
yield @offset
else
yield @v2
yield @scale
yield @offset
end
end
def recalculate
if @direction == :forward
ihn = @v1
outx = @v2
else
outx = @v2
ihn = @v1
end
outx.walk_strength = @strength.weakest(ihn.walk_strength)
outx.stay = (ihn.stay && @scale.stay && @offset.stay)
execute if outx.stay
end
end
class StayConstraint < UnaryConstraint
def execute
# Stay Constraints do nothing
end
end
class Variable
attr_accessor :value, :constraints, :determined_by, :walk_strength, :stay, :mark
def initialize
@value = 0
@constraints = Vector.new(2)
@determined_by = nil
@walk_strength = ABSOLUTE_WEAKEST
@stay = true
@mark = 0
end
def add_constraint(constraint)
@constraints.append(constraint)
end
def remove_constraint(constraint)
@constraints.remove(constraint)
@determined_by = nil if @determined_by == constraint
end
def self.value(initial_value)
o = new
o.value = initial_value
o
end
end
ABSOLUTE_STRONGEST = Strength.of(SYM_ABSOLUTE_STRONGEST)
ABSOLUTE_WEAKEST = Strength.of(SYM_ABSOLUTE_WEAKEST)
REQUIRED = Strength.of(SYM_REQUIRED)
def run
inner_iterations = 1000
Planner.chain_test(inner_iterations)
Planner.projection_test(inner_iterations)
return Planner
end
```
|
Dieter Oesterhelt (10 November 1940 – 28 November 2022) was a German biochemist. From 1980 until 2008, he was director of the Max Planck Institute for Biochemistry, Martinsried.
Biography
Oesterhelt studied chemistry at the University of Munich from 1959 to 1963. From 1964 to 1967 he worked at the Institute of Biochemistry at the same university under Feodor Lynen. He was then a research assistant at the Max Planck Institute for Cell Chemistry until 1969. From 1969 to 1973 he worked as an academic adviser at the Institute for Biochemistry at the University of Munich and carried out work on the structure, function and biosynthesis of the purple membrane of Halobacterium salinarum. In 1975 he became a junior research group leader at the Friedrich Miescher Laboratory in Tübingen. From 1976 to 1979 he was a full professor at the University of Würzburg. Oesterhelt has been a member of the Max Planck Society and director of the Max Planck Institute for Biochemistry, Martinsried, since 1980. He retired in 2008.
In 1969, Oesterhelt went to the University of California at San Francisco, where he joined the lab of Walther Stoeckenius to study the cell membrane of Halobacterium salinarum. He proved that retinaldehyde was contained in a protein of the so-called "purple membrane" of Halobacterium. This protein was isolated and called bacteriorhodopsin. After returned to Germany, Oesterhelt showed that physiological function of bacteriorhodopsin is to pump protons out of the cell. Members of his department at the Max Planck Institute for Biochemistry researched the structure-function relationships of membrane proteins and other microbial rhodopsins such as halorhodopsin, which later became a molecular tool in optogenetics. In 2021 he received the Albert Lasker Award for Basic Medical Research.
Oesterhelt died on 28 November 2022, at the age of 82.
Honors and awards
Member of the Deutschen Akademie der Technikwissenschaften (acatech)
1983: Liebig Medal
1989: Member of the Academy of Sciences Leopoldina and the Academia Europaea
1990: Karl Heinz Beckurts-Preis
1991: Otto Warburg Medal
1991: Corresponding Member of the Nordrhein-Westfälischen Akademie der Wissenschaften und der Künste
1993: Gregor-Mendel-Medal of the Deutschen Akademie der Naturforscher Leopoldina
1998: Alfried-Krupp-Wissenschaftspreis
2000: Werner von Siemens Ring
2002: Paul-Karrer-Lecture and Medal
2004: Officer's Cross of the Order of Merit of the Federal Republic of Germany
2011: Wissenschaftspreis: Forschung zwischen Grundlagen und Anwendungen
2016: Bayerischer Maximiliansorden für Wissenschaft und Kunst
2021: Albert Lasker Award for Basic Medical Research
References
Further reading
Christina Beck: Single-celled organisms shed light on neurobiology, in: MaxPlanckForschung 4/2014, p. 19–25.
1940 births
2022 deaths
Werner von Siemens Ring laureates
Officers Crosses of the Order of Merit of the Federal Republic of Germany
Members of the Bavarian Academy of Sciences
Members of the Göttingen Academy of Sciences and Humanities
Corresponding Members of the Austrian Academy of Sciences
Members of Academia Europaea
Max Planck Society people
Recipients of the Albert Lasker Award for Basic Medical Research
Academic staff of Max Planck Society
Academic staff of the University of Würzburg
Scientists from Munich
Max Planck Institute directors
|
```javascript
export default `
ALTER TABLE setup_state ADD COLUMN profileSetup INTEGER DEFAULT 0;
PRAGMA user_version = 48;
`
```
|
```ruby
# frozen_string_literal: true
class CreateDecidimSurveyAnswerChoices < ActiveRecord::Migration[5.1]
class SurveyAnswer < ApplicationRecord
self.table_name = :decidim_surveys_survey_answers
end
class SurveyAnswerChoice < ApplicationRecord
self.table_name = :decidim_surveys_survey_answer_choices
end
class SurveyQuestion < ApplicationRecord
self.table_name = :decidim_surveys_survey_questions
end
class SurveyAnswerOption < ApplicationRecord
self.table_name = :decidim_surveys_survey_answer_options
end
def up
create_table :decidim_surveys_survey_answer_choices do |t|
t.references :decidim_survey_answer, index: { name: "index_decidim_surveys_answer_choices_answer_id" }
t.references :decidim_survey_answer_option, index: { name: "index_decidim_surveys_answer_choices_answer_option_id" }
t.jsonb :body
end
SurveyAnswer.find_each do |answer|
question = SurveyQuestion.find_by(id: answer.decidim_survey_question_id)
choices = SurveyAnswerChoice.where(decidim_survey_answer_id: answer.id)
choices.each do |answer_choice|
answer_options = SurveyAnswerOption.where(decidim_survey_question_id: question.id)
answer_option = answer_options.find do |option|
option.body.has_value?(answer_choice)
end
SurveyAnswerChoice.create!(
decidim_survey_answer_id: answer.id,
decidim_survey_answer_option_id: answer_option.id,
body: answer_choice
)
end
end
remove_column :decidim_surveys_survey_answers, :choices
end
def down
add_column :decidim_surveys_survey_answers, :choices, :jsonb, default: []
SurveyAnswerChoice.find_each do |answer_choice|
answer = SurveyAnswer.find_by(id: answer_choice.decidim_survey_answer_id)
answer.choices << answer_choice.body
answer.save!
end
drop_table :decidim_surveys_survey_answer_choices
end
end
```
|
Akasya Durağı was a Turkish comedy television series on Kanal D, which initially broadcast in 2008.
Overview
The story is about Nuri (mostly called Dad, because of his age), an old, wise and kind man and his taxi company called Akasya Durağı. As he is a retired man, the story circles mostly around the taxi drivers, the tea maker-office boy, their family and their friends, with situations where they end up in jail, in between mafia shootouts and in other comedic but also adventurous circumstances. Due to the series not having a common thread running throughout it, the story goes on as said.
Turkish comedy television series
2008 Turkish television series debuts
2012 Turkish television series endings
2000s Turkish television series
2010s Turkish television series
Kanal D original programming
Turkish television series endings
Television shows set in Istanbul
Television series produced in Istanbul
|
```shell
The `2>&1` redirection
`Cron` dot-in-filename issues when using `run-parts`
Fixing the shell in cron
Common issue with scripts in `cron`
How to pause a process and run others in the background
```
|
```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.activiti.engine.impl.cfg;
/**
* @author Tom Baeyens
*/
public interface TransactionContext {
void commit();
void rollback();
void addTransactionListener(TransactionState transactionState, TransactionListener transactionListener);
}
```
|
Blowing Rock is a rocky outcropping land feature in the town of Blowing Rock, North Carolina, above a gorge in the northern most portion of Caldwell County.
The prevailing wind blows through the gorge toward Blowing Rock. There, at the end of the gorge, the wind's path of least resistance is up the steep slopes surmounted by the outcropping, resulting in a nearly vertical and typically strong wind.
The legend of the Blowing Rock is that a Cherokee brave leapt from the rock into the wilderness below, only to have a gust of wind return him to his lover on top of the rock. This is a typical example of a lover's leap legend. Blowing Rock is private property; a fee for access is payable at the adjacent souvenir shop.
The 2008 feature film Goodbye Solo features Blowing Rock in its concluding scene.
References
External links
Blowing Rock website
Landforms of Caldwell County, North Carolina
Tourist attractions in Caldwell County, North Carolina
Yadkin-Pee Dee River Basin
Rock formations of the United States
|
Appetite for Extinction is an album by Some Velvet Sidewalk. It was released in 1990.
Critical reception
Trouser Press wrote that "between the epic grind of 'Snow' and the too-brief pop discourse of '20,000 Leagues', Some Velvet Sidewalk covers all of nerd-pop’s bases, getting thrown out only when they unplug on the insufferably twee 'Crayons'."
Track listing
"Seasons"
"Old Bridges"
"Dinosaur"
"Hurt."
"Sidewalkin'"
"Crayons"
"Snow."
"alright"
"Moment"
"Sidewalk and Sky"
"Old Bridges (Live)"
"20,000 Leagues"
References
Some Velvet Sidewalk albums
1990 albums
|
```objective-c
#import "GPUImageSingleComponentGaussianBlurFilter.h"
@implementation GPUImageSingleComponentGaussianBlurFilter
+ (NSString *)vertexShaderForOptimizedBlurOfRadius:(NSUInteger)blurRadius sigma:(CGFloat)sigma;
{
if (blurRadius < 1)
{
return kGPUImageVertexShaderString;
}
// First, generate the normal Gaussian weights for a given sigma
GLfloat *standardGaussianWeights = calloc(blurRadius + 1, sizeof(GLfloat));
GLfloat sumOfWeights = 0.0;
for (NSUInteger currentGaussianWeightIndex = 0; currentGaussianWeightIndex < blurRadius + 1; currentGaussianWeightIndex++)
{
standardGaussianWeights[currentGaussianWeightIndex] = (1.0 / sqrt(2.0 * M_PI * pow(sigma, 2.0))) * exp(-pow(currentGaussianWeightIndex, 2.0) / (2.0 * pow(sigma, 2.0)));
if (currentGaussianWeightIndex == 0)
{
sumOfWeights += standardGaussianWeights[currentGaussianWeightIndex];
}
else
{
sumOfWeights += 2.0 * standardGaussianWeights[currentGaussianWeightIndex];
}
}
// Next, normalize these weights to prevent the clipping of the Gaussian curve at the end of the discrete samples from reducing luminance
for (NSUInteger currentGaussianWeightIndex = 0; currentGaussianWeightIndex < blurRadius + 1; currentGaussianWeightIndex++)
{
standardGaussianWeights[currentGaussianWeightIndex] = standardGaussianWeights[currentGaussianWeightIndex] / sumOfWeights;
}
// From these weights we calculate the offsets to read interpolated values from
NSUInteger numberOfOptimizedOffsets = MIN(blurRadius / 2 + (blurRadius % 2), 7);
GLfloat *optimizedGaussianOffsets = calloc(numberOfOptimizedOffsets, sizeof(GLfloat));
for (NSUInteger currentOptimizedOffset = 0; currentOptimizedOffset < numberOfOptimizedOffsets; currentOptimizedOffset++)
{
GLfloat firstWeight = standardGaussianWeights[currentOptimizedOffset*2 + 1];
GLfloat secondWeight = standardGaussianWeights[currentOptimizedOffset*2 + 2];
GLfloat optimizedWeight = firstWeight + secondWeight;
optimizedGaussianOffsets[currentOptimizedOffset] = (firstWeight * (currentOptimizedOffset*2 + 1) + secondWeight * (currentOptimizedOffset*2 + 2)) / optimizedWeight;
}
NSMutableString *shaderString = [[NSMutableString alloc] init];
// Header
[shaderString appendFormat:@"\
attribute vec4 position;\n\
attribute vec4 inputTextureCoordinate;\n\
\n\
uniform float texelWidthOffset;\n\
uniform float texelHeightOffset;\n\
\n\
varying vec2 blurCoordinates[%lu];\n\
\n\
void main()\n\
{\n\
gl_Position = position;\n\
\n\
vec2 singleStepOffset = vec2(texelWidthOffset, texelHeightOffset);\n", (unsigned long)(1 + (numberOfOptimizedOffsets * 2))];
// Inner offset loop
[shaderString appendString:@"blurCoordinates[0] = inputTextureCoordinate.xy;\n"];
for (NSUInteger currentOptimizedOffset = 0; currentOptimizedOffset < numberOfOptimizedOffsets; currentOptimizedOffset++)
{
[shaderString appendFormat:@"\
blurCoordinates[%lu] = inputTextureCoordinate.xy + singleStepOffset * %f;\n\
blurCoordinates[%lu] = inputTextureCoordinate.xy - singleStepOffset * %f;\n", (unsigned long)((currentOptimizedOffset * 2) + 1), optimizedGaussianOffsets[currentOptimizedOffset], (unsigned long)((currentOptimizedOffset * 2) + 2), optimizedGaussianOffsets[currentOptimizedOffset]];
}
// Footer
[shaderString appendString:@"}\n"];
free(optimizedGaussianOffsets);
free(standardGaussianWeights);
return shaderString;
}
+ (NSString *)fragmentShaderForOptimizedBlurOfRadius:(NSUInteger)blurRadius sigma:(CGFloat)sigma;
{
if (blurRadius < 1)
{
return kGPUImagePassthroughFragmentShaderString;
}
// First, generate the normal Gaussian weights for a given sigma
GLfloat *standardGaussianWeights = calloc(blurRadius + 1, sizeof(GLfloat));
GLfloat sumOfWeights = 0.0;
for (NSUInteger currentGaussianWeightIndex = 0; currentGaussianWeightIndex < blurRadius + 1; currentGaussianWeightIndex++)
{
standardGaussianWeights[currentGaussianWeightIndex] = (1.0 / sqrt(2.0 * M_PI * pow(sigma, 2.0))) * exp(-pow(currentGaussianWeightIndex, 2.0) / (2.0 * pow(sigma, 2.0)));
if (currentGaussianWeightIndex == 0)
{
sumOfWeights += standardGaussianWeights[currentGaussianWeightIndex];
}
else
{
sumOfWeights += 2.0 * standardGaussianWeights[currentGaussianWeightIndex];
}
}
// Next, normalize these weights to prevent the clipping of the Gaussian curve at the end of the discrete samples from reducing luminance
for (NSUInteger currentGaussianWeightIndex = 0; currentGaussianWeightIndex < blurRadius + 1; currentGaussianWeightIndex++)
{
standardGaussianWeights[currentGaussianWeightIndex] = standardGaussianWeights[currentGaussianWeightIndex] / sumOfWeights;
}
// From these weights we calculate the offsets to read interpolated values from
NSUInteger numberOfOptimizedOffsets = MIN(blurRadius / 2 + (blurRadius % 2), 7);
NSUInteger trueNumberOfOptimizedOffsets = blurRadius / 2 + (blurRadius % 2);
NSMutableString *shaderString = [[NSMutableString alloc] init];
// Header
#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE
[shaderString appendFormat:@"\
uniform sampler2D inputImageTexture;\n\
uniform highp float texelWidthOffset;\n\
uniform highp float texelHeightOffset;\n\
\n\
varying highp vec2 blurCoordinates[%lu];\n\
\n\
void main()\n\
{\n\
lowp float sum = 0.0;\n", (unsigned long)(1 + (numberOfOptimizedOffsets * 2)) ];
#else
[shaderString appendFormat:@"\
uniform sampler2D inputImageTexture;\n\
uniform float texelWidthOffset;\n\
uniform float texelHeightOffset;\n\
\n\
varying vec2 blurCoordinates[%lu];\n\
\n\
void main()\n\
{\n\
float sum = 0.0;\n", 1 + (numberOfOptimizedOffsets * 2) ];
#endif
// Inner texture loop
[shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[0]).r * %f;\n", standardGaussianWeights[0]];
for (NSUInteger currentBlurCoordinateIndex = 0; currentBlurCoordinateIndex < numberOfOptimizedOffsets; currentBlurCoordinateIndex++)
{
GLfloat firstWeight = standardGaussianWeights[currentBlurCoordinateIndex * 2 + 1];
GLfloat secondWeight = standardGaussianWeights[currentBlurCoordinateIndex * 2 + 2];
GLfloat optimizedWeight = firstWeight + secondWeight;
[shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[%lu]).r * %f;\n", (unsigned long)((currentBlurCoordinateIndex * 2) + 1), optimizedWeight];
[shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[%lu]).r * %f;\n", (unsigned long)((currentBlurCoordinateIndex * 2) + 2), optimizedWeight];
}
// If the number of required samples exceeds the amount we can pass in via varyings, we have to do dependent texture reads in the fragment shader
if (trueNumberOfOptimizedOffsets > numberOfOptimizedOffsets)
{
#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE
[shaderString appendString:@"highp vec2 singleStepOffset = vec2(texelWidthOffset, texelHeightOffset);\n"];
#else
[shaderString appendString:@"highp vec2 singleStepOffset = vec2(texelWidthOffset, texelHeightOffset);\n"];
#endif
for (NSUInteger currentOverlowTextureRead = numberOfOptimizedOffsets; currentOverlowTextureRead < trueNumberOfOptimizedOffsets; currentOverlowTextureRead++)
{
GLfloat firstWeight = standardGaussianWeights[currentOverlowTextureRead * 2 + 1];
GLfloat secondWeight = standardGaussianWeights[currentOverlowTextureRead * 2 + 2];
GLfloat optimizedWeight = firstWeight + secondWeight;
GLfloat optimizedOffset = (firstWeight * (currentOverlowTextureRead * 2 + 1) + secondWeight * (currentOverlowTextureRead * 2 + 2)) / optimizedWeight;
[shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[0] + singleStepOffset * %f).r * %f;\n", optimizedOffset, optimizedWeight];
[shaderString appendFormat:@"sum += texture2D(inputImageTexture, blurCoordinates[0] - singleStepOffset * %f).r * %f;\n", optimizedOffset, optimizedWeight];
}
}
// Footer
[shaderString appendString:@"\
gl_FragColor = vec4(sum, sum, sum, 1.0);\n\
}\n"];
free(standardGaussianWeights);
return shaderString;
}
@end
```
|
```yaml
---
parsed_sample:
- interface: []
ip_address: "0.0.0.0"
nexthop:
- "no route"
prefix_length: "0"
- interface: []
ip_address: "0.0.0.0"
nexthop:
- "drop"
prefix_length: "8"
- interface: []
ip_address: "0.0.0.0"
nexthop:
- "receive"
prefix_length: "32"
- interface: []
ip_address: "127.0.0.0"
nexthop:
- "drop"
prefix_length: "8"
- interface: []
ip_address: "224.0.0.0"
nexthop:
- "drop"
prefix_length: "4"
- interface: []
ip_address: "224.0.0.0"
nexthop:
- "receive"
prefix_length: "24"
- interface: []
ip_address: "240.0.0.0"
nexthop:
- "drop"
prefix_length: "4"
- interface: []
ip_address: "255.255.255.255"
nexthop:
- "receive"
prefix_length: "32"
```
|
```groff
.\" $OpenBSD: hilid.4,v 1.5 2007/05/31 19:19:50 jmc Exp $
.\"
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistribution of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR 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.
.\"
.\"
.Dd $Mdocdate: May 31 2007 $
.Dt HILID 4
.Os
.Sh NAME
.Nm hilid
.Nd HIL ID module device
.Sh SYNOPSIS
.Cd "hilid* at hil?"
.Sh DESCRIPTION
This driver recognizes the HIL
.Dq ID module
device.
The only purpose of this device is to provide a small, unique,
bitstring.
.Sh SEE ALSO
.Xr hil 4 ,
.Xr intro 4
.Sh BUGS
There is currently no way to communicate the ID module bitstring to
userland applications.
```
|
In 2013, two independent protests occurred in Israel. In May, an attempt to change the Tal Law, which excluded ultra-Orthodox Jewish men for doing military service, led to protests by Haredi against military conscription. Again in November, Bedouins in the Negev called for a 'Day of Rage' against their displacement by the Israeli government to state developed townships as a result of the Prawer-Begin plan.
Haredi protest
Following the announcements that the new government was planning to gradually incorporate the Haredi Jewish population of Israel into the country's armed forces, there were widespread protests against the government and the draft by the ultra-Orthodox community in Israel, called Haredim in Hebrew. Haredim are exempt from military service for religious reasons. This exemption has been given to the Haredi community since the establishment of the State of Israel and gives them the space to devote themselves fully to the study of the Torah. Many ultra-Orthodox men are not against the Israeli military as such and see themselves as patriots. However, they wish to contribute to the protection of the state by studying the scriptures in yeshivas, in order to obtain the protection from God.
The universal draft is an issue within Israeli society since the establishment of the state. In February 2012 the High Court of Justice considered the Tal Law, granting exemptions to yeshiva students, as unconstitutional, which caused unrest under the Haredim communities in Israel. Several attempts have been made before to formulate new laws in order to draft the Haredim into the Israeli military but without much success. This made Israeli political parties like Yesh Atid and Jewish Home make the issue of the draft of the Haredim community a key point in their political campaigns. In April 2013, a ministerial committee led by minister Yaakov Peri announced that a bill on national service for all citizens, including Haredim, would be presented to the Knesset within two months. Besides that, the coalition government of former prime minister Benjamin Netanyahu said to be committed to increase the military drafting of the Haredim. Because of this renewed attention to the issue of the universal drafting, pamphlets were handed out in Haredi neighbourhoods in Jerusalem to motivate the Haredi men to demonstrate against army drafting of yeshiva students.
On 16 May 2013, between 15,000 and 30,000 Haredi men demonstrated outside an IDF recruiting office in Jerusalem. Some allegedly threw stones and bottles at police and called them Nazis. Rabbis warned the ultra-Orthodox community that army service would seriously harm and threaten their way of life. As Rabbi David Zycherman told the protesters crowd: "The government wants to uproot [our traditions] and secularise us, they call it a melting pot, but people cannot be melted. You cannot change our [way of life],” Other protesters read out loud passages from the Torah to “annul the evil decree” of military service.
Background
Tension between the Haredi community and the state of Israel is something that existed for a long time. The Jewish State of Israel was proclaimed in 1948 because of Zionist ideology. Before the establishment of the state secular Zionist and Haredim already disagreed on what a Jewish state should look like and what the role of Judaism should be in that state. In the first place, the pre-state Haredi community was against the establishment of the state of Israel, since they believe this should be done by the Messiah who, according to most religious Jews, is still yet to come. Zionism has no legitimacy without Judaism, since it is based on the ancient covenant of the Jewish people with the Bible. Besides that, the Zionist needed worldwide Jewish support for the establishment of the state of Israel and needed to please the Haredi community. This was done by compromising on religious issues. Even though the Haredim did not support the man-made Jewish state, after the Holocaust almost all orthodox centers in Europe were destroyed and the establishment of the new state of Israel gave them the opportunity to rebuild their communities and guaranteed their lifestyle.
This resulted in a status quo agreement initiated by David Ben-Gurion and ultra-Orthodox party Agudat Israel. It assured that the establishment of the state would protect ultra-Orthodox lifestyle, including exclusion from military service of 800 yeshiva students. When Menachem Begin became president in 1977, all yeshiva students got exemption from military service, which resulted in an increase in yeshiva students. In the Haredi community it is common to have an average of 7 children per family, therefore the number of those exempt from military service is growing rapidly. In addition to being exempt from military service, the Haredi community also has a low labor participation rate and often live on benefits. These are paid from the taxes of working people in society who are mostly not Haredim and also serve the military. This is why the discussion of military drafting often reappears in Israeli politics, it is part of a greater discussion of equality in society and a cause of polarisation between the secular and Haredim in Israel.
In 1998, the Israel High Court of Justice decided that the unequal drafting of people in Israel was unreasonable and inequitable and asked the Knesset to find a solution. The government, which contained a coalition with the ultra-Orthodox parties Shas and the United Torah Judaism, set up a committee chaired by former Supreme Court Justice Tzvi Tal to study the issue (the Tal Committee) and to make policy recommendations. In 2002 the Tal Law (The Service Deferment Law for Yeshiva Students for whom the Torah is Their Trade) was passed. The Tal committee accepted the principle that national conscription should be done by everyone in Israel but only if someone would consent in going into the army. According to the Tal Committee, the resistance of the Haredi community that the drafting would bring, would not serve the interests either of the IDF or the nation. In addition, the Tal law offered 23-year-old ultra-Orthodox men an optional “year of decision” where they were given a year off to study secular subjects, engage in vocational training or find work, without endangering their draft exemption, after which they were allowed to decide whether they wanted to do military service or not. Only a few took advantage of this. The Tal law therefore did not change the regulations surrounding the drafting of the ultra-Orthodox but rather legalised the existing policy.
Bedouin protests
On 30 November 2013, a 'Day of Rage' was called against the Prawer-Begin plan in which 40,000-70.000 Bedouin citizens are forced to move from their homes into townships, specially designed by the Israeli government. The Prawer-Begin plan intends to remove the tents of between 40.000 and 70.000 Bedouins from 35 villages out of their ancestral villages, which the government has classified as "illegal" and a "land grab,". The Bedouin community in Israel are Israeli citizens who make up around 30% of the population of the Negev, their villages take up around 2,5% of the land. Half of the Bedouin community in Israel lives in classified 'informal villages'. However, the Bedouin communities do not want to move from their villages and want to maintain their traditional, (semi)nomadic way of life.
The Prawer-Begin plan was established in 2011, a committee was set up by the Israeli government to make a plan regarding the Bedouins headed by planning policy chief Ehud Prawer. This committee proposed that 50% of the land claimed by the Bedouin be turned over to the state and the demolition of 35 unrecognized villages. The Bedouin had no representation in this committee. Former General Doron Almog, who is tasked with implementing the plan, said: "The idea is to ... better integrate Jews and Bedouins; to bring many more Bedouins to our work force; to employ and educate many more women for employment; and to build new communities; and to expand some of the current communities and make them modern." Its stated aim is also to "modernize" the Bedouin and improve their quality of life. US$340m has been allocated over five years for the project. According to the Bedouin community, it is the state of Israel that is denying them access to infrastructure, water and electricity because the state does not recognize their villages. The United Nations' High Commissioner for Human Rights Navi Pillay commented, "As citizens of Israel, the Arab Bedouins are entitled to the same rights to property, housing, and public services as any other group in Israel. The government must recognize and respect the specific rights of its Bedouin communities, including recognition of Bedouin land ownership claims."
The main protest was scheduled to be held near the Bedouin township of Hura on November 30, with other protests planned in Israel, the West Bank, the Gaza Strip and in several other cities across Europe, North America and the Middle East like Londen, Berlin, Rome, Istanbul and Cairo. Bedouin activist Huda Abu-Obeid said: "The government is trying to present the plan as 'in the best interest of the Bedouin', while with one hand it is acting to destroy Bedouin villages… and on the other it is building new Jewish localities in the Negev, some of these in the very same places where the [Bedouin] villages stand today." The aim of the protests, according to the Bedouin community, was to drop the Prawer-Begin plan because they consider it racist and see it as a way to drive Bedouins off their land. In the Negev, the Israeli police used teargas and water cannons against the protesters. Around 28 people in Haifa and the Negev got arrested, 15 police officers got injured.
Following expectation that the plan would fail a Knesset vote, it was canceled. Benny Begin, who jointly formulated the plan, said: "Right and left, Arabs and Jews joined forces - while exploiting the plight of many Bedouin - to heat things up for political gain. There is no majority in the coalition for the bill. [But Netanyahu agreed to] carry out the development plan for Bedouin settlements in the coming years."
Background
Before the establishment of the State of Israel in 1948, the Bedouin lived a nomadic life in the Negev, keeping animals and cultivating land. After the establishment of the state, it was difficult for Bedouins to claim the land where they lived. This was mainly due to the Ottoman-Turkish Tabu Law of 1858, which required landowners to register their land in order to pay tax over it. This happened very rarely among the Bedouins. As a result, they were not registered as owners and lost their rights over the land. This meant that by the 1970s the Israeli government removed most of the Bedouin settlements. The state of Israel mainly uses the Negev for building new housing, for military training and firing ranges. Israeli officials claim that they do not want to force Bedouins into sedentarization but want to help and guide them towards a permanent settlement on the land. However, the restrictive measures that Israel enforced made the Bedouin community experience a significant and rapid change in their economic and social life and therefore a strong influence and limitation of the Bedouin lifestyle.
See also
Protest against conscription of yeshiva students
Israel Defense Forces
Tal Committee
Status quo (Israel)
Religion in Israel
Bedouin in Israel
Negev Bedouin
Unrecognized Bedouin villages in Israel
References
2013 in Israel
2013 protests
May 2013 events in Asia
November 2013 events in Asia
Conscription in Israel
Haredi anti-Zionism
Bedouins in Israel
Haredi Judaism in Israel
Protests in Israel
|
The spiny whorltail iguana (Stenocercus crassicaudatus) is a species of lizard of the Tropiduridae family, found in the state of Cusco, southeast Peru. It was first described by Johann Jakob von Tschudi in 1845.
References
Stenocercus
Reptiles described in 1845
Taxa named by Johann Jakob von Tschudi
Endemic fauna of Peru
Reptiles of Peru
|
Jane Griffiths (born 1970) is a British poet and literary historian.
Career and writings
Griffiths was born in Exeter, England, and brought up in the Netherlands. She studied English at Oxford University, where she won the Newdigate prize for her poem "The House". After working as a bookbinder in London and Norfolk, she returned to Oxford to gain a doctorate with a dissertation on the Tudor poet John Skelton, and became an editor on the Oxford English Dictionary. Her poetry gained her an Eric Gregory Award in 1996.
Griffiths taught at Oxford University's St. Edmund Hall, before becoming a lecturer in English literature at the University of Edinburgh. She was appointed a lecturer in the Department of English at the University of Bristol in 2007. In 2012, she left her position as senior lecturer in English literature at the University of Bristol to become a CUF Lecturer in medieval and early modern English literature at the University of Oxford and a tutorial fellow of Wadham College. According to her university page, Griffiths works primarily on the poetry and drama of the fifteenth and early sixteenth centuries. Her first monograph on John Skelton was published by Oxford University Press (OUP) in 2005, and she is working on a second monograph, on marginal glosses, which is also to be published by OUP.
Her collection Another Country was short-listed for the 2008 Forward Poetry Prize.
Griffiths' fourth collection of poetry Terrestrial Variations was published by Bloodaxe Books in 2012. It was described by Adam Thorpe (The Guardian) as "sensuously wrought and even, at times, subtly erotic, her poems simultaneously evoke another level of pure abstraction, with words in place of coils of paint". In 2017 Griffiths’ fifth collection of poems Silent In Finisterre was published. It was described by Sarah Broom in The Times Literary Supplement as "a major achievement, outstanding, complex and subtle in thought, supple of tone and piercing in its observation".
Her collection Little Silver was published by Bloodaxe Books in 2022.
Poetry volumes
The House (Hitchin: Mandeville Press, 1990).
A Grip on Thin Air (Tarset, Northumberland: Bloodaxe Books, 2000).
Icarus on Earth (Tarset, Northumberland: Bloodaxe Books, 2005).
Another Country: New and Selected Poems (Tarset, Northumberland: Bloodaxe Books, 2008). .
Terrestrial Variations (Tarset, Northumberland: Bloodaxe Books, 2012) .
Silent In Finisterre (Tarset, Northumberland: Bloodaxe Books, 2017) .
Little Silver (Tarset, Northumberland: Bloodaxe Books, 2022) .
References
1970 births
Living people
English women poets
21st-century English poets
21st-century English women
|
```javascript
var test = 'test';
var test = 'test';
object.test();
```
|
RBB Berlin (formerly B1 and SFB1) was the third television channel for Berlin, Germany from October 1992 until March 2004. Until May 2003 it was owned by Sender Freies Berlin (SFB), then by its successor, Rundfunk Berlin-Brandenburg (RBB), under the provisional name RBB Berlin. On 1 March 2004, the two previous regional television channels RBB Berlin and RBB Brandenburg were replaced by the new rbb Fernsehen.
History
In 1965 Norddeutscher Rundfunk (NDR), Radio Bremen (RB) and Sender Freies Berlin (SFB) founded a joint third television programme, the Nordkette (later: Nord 3, N3 and today: NDR Fernsehen). NDR was in charge of the Nordkette. The SFB remained involved in the Nordkette until 1992.
After the German reunification, which also reunited both parts of Berlin, the SFB decided to launch its own regional television channel with a vision to create private regional programmes for Berlin in the near future. This program was called B1 (which stood for Berlin 1) and replaced the Berlin version of N3.
On 21 April 2001, the programme was renamed SFB1 at the same time as being broadcast on an analogue Astra satellite channel (daily from 6 p.m. to 2 a.m.). One reason for the renaming was that many inhabitants of Berlin had not associated the abbreviation B1 with the SFB.
From May 2003 onwards (merger of SFB and ORB to rbb), the programme was broadcast as rbb Berlin. At the end of March 2004, it was broadcast on the new rbb Fernsehen channel together with rbb Brandenburg. Since then, only the evening shows on Berlin's regional programme (Berliner Abendschau) and Brandenburg's regional programme (Brandenburg aktuell) have been broadcast separately every day for 30 minutes from 7.30 p.m. onwards.
References
External links
Sender Freies Berlin
Rundfunk Berlin-Brandenburg
ARD (broadcaster)
Defunct television channels in Germany
Television channels and stations established in 1992
Television channels and stations disestablished in 2004
1992 establishments in Germany
2004 disestablishments in Germany
Mass media in Berlin
German-language television stations
|
```xml
import { Droppable } from '@hello-pangea/dnd';
import { Box, Stack, Typography } from '@mui/material';
import { Deal } from '../types';
import { DealCard } from './DealCard';
import { useConfigurationContext } from '../root/ConfigurationContext';
import { findDealLabel } from './deal';
export const DealColumn = ({
stage,
deals,
}: {
stage: string;
deals: Deal[];
}) => {
const totalAmount = deals.reduce((sum, deal) => sum + deal.amount, 0);
const { dealStages } = useConfigurationContext();
return (
<Box
sx={{
flex: 1,
paddingTop: '8px',
paddingBottom: '16px',
bgcolor: '#eaeaee',
'&:first-of-type': {
paddingLeft: '5px',
borderTopLeftRadius: 5,
},
'&:last-of-type': {
paddingRight: '5px',
borderTopRightRadius: 5,
},
}}
>
<Stack alignItems="center">
<Typography variant="subtitle1">
{findDealLabel(dealStages, stage)}
</Typography>
<Typography
variant="subtitle1"
color="text.secondary"
fontSize="small"
>
{totalAmount.toLocaleString('en-US', {
notation: 'compact',
style: 'currency',
currency: 'USD',
currencyDisplay: 'narrowSymbol',
minimumSignificantDigits: 3,
})}
</Typography>
</Stack>
<Droppable droppableId={stage}>
{(droppableProvided, snapshot) => (
<Box
ref={droppableProvided.innerRef}
{...droppableProvided.droppableProps}
className={
snapshot.isDraggingOver ? ' isDraggingOver' : ''
}
sx={{
display: 'flex',
flexDirection: 'column',
borderRadius: 1,
padding: '5px',
'&.isDraggingOver': {
bgcolor: '#dadadf',
},
}}
>
{deals.map((deal, index) => (
<DealCard key={deal.id} deal={deal} index={index} />
))}
{droppableProvided.placeholder}
</Box>
)}
</Droppable>
</Box>
);
};
```
|
The 448th Rocket Brigade named for S.P. Nepobedimy is a tactical ballistic missile brigade of the Russian Ground Forces. Based in Kursk, the brigade is part of the 20th Guards Army.
History
The brigade was formed in September 1987 at Born in East Germany. It was composed of the 639th, 650th and 697th Separate Rocket Battalions, as well as a technical battery. The 639th and 650th Battalions were based at Born and the 697th Battalion was based at Schönebeck. The 639th had been transferred from the 10th Guards Tank Division, the 650th from the 12th Guards Tank Division and the 697th from the 7th Guards Tank Division. The brigade was subordinated to the 3rd Red Banner Army. It was equipped with the OTR-21 Tochka tactical ballistic missile. In December 1990, the brigade moved to Kursk and became part of the 20th Guards Army.
The OTR-21 Tochka missiles of the brigade are planned to be replaced with 9K720 Iskander missiles. On 2 August 2021, the brigade was named for Tochka missile designer Sergey Nepobedimy.
The brigade is reportedly taking part in the Russian invasion of Ukraine.
References
Military units and formations established in 1987
Theatre rocket brigades of Russia
Theatre rocket brigades of the Soviet Union
Military units and formations of Russia in the Russian invasion of Ukraine
|
```objective-c
/*
* audio conversion
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
*
* You should have received a copy of the GNU Lesser General Public
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef SWRESAMPLE_AUDIOCONVERT_H
#define SWRESAMPLE_AUDIOCONVERT_H
/**
* @file
* Audio format conversion routines
*/
#include "swresample_internal.h"
#include "libavutil/cpu.h"
typedef void (conv_func_type)(uint8_t *po, const uint8_t *pi, int is, int os, uint8_t *end);
typedef void (simd_func_type)(uint8_t **dst, const uint8_t **src, int len);
typedef struct AudioConvert {
int channels;
int in_simd_align_mask;
int out_simd_align_mask;
conv_func_type *conv_f;
simd_func_type *simd_f;
const int *ch_map;
uint8_t silence[8]; ///< silence input sample
}AudioConvert;
/**
* Create an audio sample format converter context
* @param out_fmt Output sample format
* @param in_fmt Input sample format
* @param channels Number of channels
* @param flags See AV_CPU_FLAG_xx
* @param ch_map list of the channels id to pick from the source stream, NULL
* if all channels must be selected
* @return NULL on error
*/
AudioConvert *swri_audio_convert_alloc(enum AVSampleFormat out_fmt,
enum AVSampleFormat in_fmt,
int channels, const int *ch_map,
int flags);
/**
* Free audio sample format converter context.
* and set the pointer to NULL
*/
void swri_audio_convert_free(AudioConvert **ctx);
/**
* Convert between audio sample formats
* @param[in] out array of output buffers for each channel. set to NULL to ignore processing of the given channel.
* @param[in] in array of input buffers for each channel
* @param len length of audio frame size (measured in samples)
*/
int swri_audio_convert(AudioConvert *ctx, AudioData *out, AudioData *in, int len);
#endif /* SWRESAMPLE_AUDIOCONVERT_H */
```
|
Von Erdmannsdorff is the name of:
Friedrich Wilhelm von Erdmannsdorff (1736–1800), German architect
Gottfried von Erdmannsdorff (1893-1946), German Wehrmacht general
Otto von Erdmannsdorff (1888–1978), German diplomat
|
La Gorce Island is an island within the city of Miami Beach in Miami-Dade County, Florida, United States. It is located in Biscayne Bay in the La Gorce neighborhood, in the area of the city referred to as North Beach. The island and surrounding La Gorce neighborhood were named after Miami Beach developer Carl Fisher’s close friend, John Oliver La Gorce, a renowned explorer, author, and president of the National Geographic Society.
References
Islands of Miami Beach, Florida
|
```scss
// MDCs default textarea styles cannot be used because they only apply if a special
// class is applied to the "mdc-text-field" wrapper. Since we cannot know whether the
// registered form-field control is a textarea and MDC by default does not have styles
// for textareas in the fill appearance, we add our own minimal textarea styles
// which are scoped to the actual textarea element (i.e. not require a class in the
// text-field wrapper) and integrate better with the any configured appearance.
// Mixin that can be included to override the default MDC text-field styles
// to properly support textareas.
@mixin private-text-field-textarea-overrides() {
// Ensures that textarea elements inside of the form-field have proper vertical spacing
// to account for the floating label. Also ensures that there is no vertical text overflow.
// **Note**: Before changing this selector, make sure the `cdk-textarea-autosize` class is
// still able to override the `resize` property to `none`.
.mat-mdc-form-field-textarea-control {
// Set the vertical alignment for textareas inside form fields to be the middle. This
// ensures that textareas do not stretch the infix container vertically without having
// multiple rows of text. See: path_to_url
vertical-align: middle;
// Textareas by default also allow users to resize the textarea horizontally. This
// causes the textarea to overflow the form-field. We only allow vertical resizing.
resize: vertical;
box-sizing: border-box;
height: auto;
// Using padding for textareas causes a bad user experience because the text outside
// of the text box will overflow vertically. Also, the vertical spacing for controls
// is set through the infix container to allow for arbitrary form-field controls.
margin: 0;
padding: 0;
border: none;
// By default IE always renders scrollbars on textarea.
// This brings it in line with other browsers.
overflow: auto;
}
}
```
|
Petrophile axillaris is a species of flowering plant in the family Proteaceae and is endemic to southwestern Western Australia. It is a shrub with pinnately-divided, sharply-pointed leaves, and spherical heads of hairy pink or grey flowers.
Description
Petrophile axillaris is a shrub that typically grows to a height of and has ribbed, hairy, grey or brown branchlets. The leaves are pinnately-divided to the midrib, long with twenty-five to seventy-six cylindrical, sharply-pointed lobes. The flowers are mostly arranged in leaf axils in more or less spherical heads long and wide, with elliptic to egg-shaped involucral bracts at the base. The flowers are long, pink or grey and hairy. Flowering mainly occurs from September to November and the fruit is a nut, fused with others in a spherical to oval head long.
Taxonomy
Petrophile axillaris was first formally described in 1855 by Carl Meissner in Hooker's Journal of Botany and Kew Garden Miscellany from material collected by James Drummond. The specific epithet (axillaris) means "axillary", referring to the flowers.
Distribution and habitat
This petrophile grows in sandy or gravelly limestone soils in near-coastal areas between Geraldton and Yalgorup National Park and disjunctly in the Leeuwin-Naturaliste National Park in southwestern Western Australia.
Conservation status
Petrophile axillaris is classified as "not threatened" by the Western Australian Government Department of Parks and Wildlife.
References
axillaris
Eudicots of Western Australia
Endemic flora of Western Australia
Plants described in 1855
Taxa named by Carl Meissner
|
The Battle of Holy Ground, or Battle of Econochaca (Meaning holy ground in Creek), was a battle fought on December 23, 1813, between the United States militia and the Red Stick Creek Indians during the Creek War. The battle took place at Econochaca, the site of a fortified encampment established in the summer of 1813 by Josiah Francis on a bluff above the Alabama River, in what is now Lowndes County, Alabama. It was one of three encampments erected by Red Stick Creeks that summer. In addition to the physical defenses, Creek prophets performed ceremonies at the site to create a spiritual barrier of protection. Hence the Creek name "Econochaca," loosely translated as holy ground, but properly translated as sacred or beloved ground.
History
Following the Battle of Burnt Corn and the subsequent Fort Mims massacre, General Ferdinand Claiborne, under the orders of General Thomas Flournoy, began attempting to round-up troops to attack the Red Stick Creeks. By early December he had amassed a force of roughly 1,000 men, including 150 Choctaw warriors under their leader, Pushmataha. Weatherford's Creeks numbered around 320 men. On December 13, Claiborne's force set out from Fort Claiborne to Holy Ground. On December 22, 1813, Claiborne's force set up camp about south of Econochaca. Upon learning of this, the Creeks, under William Weatherford, evacuated women and children from settlement. On December 23 Claiborne attacked the defenses, killing between 20 and 30 Red Stick warriors and losing one man himself. Most of the Creeks escaped, with Weatherford riding his horse, Arrow over the bluff and into the river while under fire. The U.S. forces then destroyed the encampment and the Creek supplies.
The site is now home to Holy Ground Battlefield Park, maintained by the United States Army Corps of Engineers. It was added to the Alabama Register of Landmarks and Heritage on May 26, 1976.
Two active battalions of the Regular Army (1-1 Inf and 2-1 Inf) perpetuate the lineage of the old 3rd Infantry Regiment, elements of which were at the Battle of Econochaca.
References
Holy Ground
Holy Ground
Properties on the Alabama Register of Landmarks and Heritage
Native American history of Alabama
1813 in the United States
December 1813 events
Holy Ground
Lowndes County, Alabama
|
```go
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build go1.21
package slog
import (
"io"
"log/slog"
)
// TextHandler is a Handler that writes Records to an io.Writer as a
// sequence of key=value pairs separated by spaces and followed by a newline.
type TextHandler = slog.TextHandler
// NewTextHandler creates a TextHandler that writes to w,
// using the given options.
// If opts is nil, the default options are used.
func NewTextHandler(w io.Writer, opts *HandlerOptions) *TextHandler {
return slog.NewTextHandler(w, opts)
}
```
|
```python
"""Coordinate sequence utilities
"""
import sys
from array import array
from ctypes import byref, c_double, c_uint
from shapely.geos import lgeos
from shapely.topology import Validating
if sys.version_info[0] < 3:
range = xrange
class CoordinateSequence(object):
"""
Iterative access to coordinate tuples from the parent geometry's coordinate
sequence.
Example:
>>> from shapely.wkt import loads
>>> g = loads('POINT (0.0 0.0)')
>>> list(g.coords)
[(0.0, 0.0)]
"""
# Attributes
# ----------
# _cseq : c_void_p
# Ctypes pointer to GEOS coordinate sequence
# _ndim : int
# Number of dimensions (2 or 3, generally)
# __p__ : object
# Parent (Shapely) geometry
_cseq = None
_ndim = None
__p__ = None
def __init__(self, parent):
self.__p__ = parent
def _update(self):
self._ndim = self.__p__._ndim
self._cseq = lgeos.GEOSGeom_getCoordSeq(self.__p__._geom)
def __len__(self):
self._update()
cs_len = c_uint(0)
lgeos.GEOSCoordSeq_getSize(self._cseq, byref(cs_len))
return cs_len.value
def __iter__(self):
self._update()
dx = c_double()
dy = c_double()
dz = c_double()
has_z = self._ndim == 3
for i in range(self.__len__()):
lgeos.GEOSCoordSeq_getX(self._cseq, i, byref(dx))
lgeos.GEOSCoordSeq_getY(self._cseq, i, byref(dy))
if has_z:
lgeos.GEOSCoordSeq_getZ(self._cseq, i, byref(dz))
yield (dx.value, dy.value, dz.value)
else:
yield (dx.value, dy.value)
def __getitem__(self, key):
self._update()
dx = c_double()
dy = c_double()
dz = c_double()
m = self.__len__()
has_z = self._ndim == 3
if isinstance(key, int):
if key + m < 0 or key >= m:
raise IndexError("index out of range")
if key < 0:
i = m + key
else:
i = key
lgeos.GEOSCoordSeq_getX(self._cseq, i, byref(dx))
lgeos.GEOSCoordSeq_getY(self._cseq, i, byref(dy))
if has_z:
lgeos.GEOSCoordSeq_getZ(self._cseq, i, byref(dz))
return (dx.value, dy.value, dz.value)
else:
return (dx.value, dy.value)
elif isinstance(key, slice):
res = []
start, stop, stride = key.indices(m)
for i in range(start, stop, stride):
lgeos.GEOSCoordSeq_getX(self._cseq, i, byref(dx))
lgeos.GEOSCoordSeq_getY(self._cseq, i, byref(dy))
if has_z:
lgeos.GEOSCoordSeq_getZ(self._cseq, i, byref(dz))
res.append((dx.value, dy.value, dz.value))
else:
res.append((dx.value, dy.value))
return res
else:
raise TypeError("key must be an index or slice")
@property
def ctypes(self):
self._update()
has_z = self._ndim == 3
n = self._ndim
m = self.__len__()
array_type = c_double * (m * n)
data = array_type()
temp = c_double()
for i in range(m):
lgeos.GEOSCoordSeq_getX(self._cseq, i, byref(temp))
data[n*i] = temp.value
lgeos.GEOSCoordSeq_getY(self._cseq, i, byref(temp))
data[n*i+1] = temp.value
if has_z:
lgeos.GEOSCoordSeq_getZ(self._cseq, i, byref(temp))
data[n*i+2] = temp.value
return data
def array_interface(self):
"""Provide the Numpy array protocol."""
if sys.byteorder == 'little':
typestr = '<f8'
elif sys.byteorder == 'big':
typestr = '>f8'
else:
raise ValueError(
"Unsupported byteorder: neither little nor big-endian")
ai = {
'version': 3,
'typestr': typestr,
'data': self.ctypes,
}
ai.update({'shape': (len(self), self._ndim)})
return ai
__array_interface__ = property(array_interface)
@property
def xy(self):
"""X and Y arrays"""
self._update()
m = self.__len__()
x = array('d')
y = array('d')
temp = c_double()
for i in range(m):
lgeos.GEOSCoordSeq_getX(self._cseq, i, byref(temp))
x.append(temp.value)
lgeos.GEOSCoordSeq_getY(self._cseq, i, byref(temp))
y.append(temp.value)
return x, y
class BoundsOp(Validating):
def __init__(self, *args):
pass
def __call__(self, this):
self._validate(this)
env = this.envelope
if env.geom_type == 'Point':
return env.bounds
cs = lgeos.GEOSGeom_getCoordSeq(env.exterior._geom)
cs_len = c_uint(0)
lgeos.GEOSCoordSeq_getSize(cs, byref(cs_len))
minx = 1.e+20
maxx = -1e+20
miny = 1.e+20
maxy = -1e+20
temp = c_double()
for i in range(cs_len.value):
lgeos.GEOSCoordSeq_getX(cs, i, byref(temp))
x = temp.value
if x < minx: minx = x
if x > maxx: maxx = x
lgeos.GEOSCoordSeq_getY(cs, i, byref(temp))
y = temp.value
if y < miny: miny = y
if y > maxy: maxy = y
return (minx, miny, maxx, maxy)
```
|
Gottasecca is a comune (municipality) in the Province of Cuneo in the Italian region Piedmont, located about southeast of Turin and about east of Cuneo.
Gottasecca borders the following municipalities: Cairo Montenotte, Camerana, Castelletto Uzzone, Dego, Monesiglio, Prunetto, and Saliceto.
References
Cities and towns in Piedmont
|
```html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "path_to_url">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Class template treap_set</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../intrusive/reference.html#header.boost.intrusive.treap_set_hpp" title="Header <boost/intrusive/treap_set.hpp>">
<link rel="prev" href="treap_algorithms/insert_commit_data.html" title="Struct insert_commit_data">
<link rel="next" href="make_treap_set.html" title="Struct template make_treap_set">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="path_to_url">People</a></td>
<td align="center"><a href="path_to_url">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="treap_algorithms/insert_commit_data.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../intrusive/reference.html#header.boost.intrusive.treap_set_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="make_treap_set.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.intrusive.treap_set"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template treap_set</span></h2>
<p>boost::intrusive::treap_set</p>
</div>
<h2 xmlns:rev="path_to_url~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="path_to_url~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../intrusive/reference.html#header.boost.intrusive.treap_set_hpp" title="Header <boost/intrusive/treap_set.hpp>">boost/intrusive/treap_set.hpp</a>>
</span><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> Options<span class="special">></span>
<span class="keyword">class</span> <a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
<span class="comment">// types</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">value_type</span> <a name="boost.intrusive.treap_set.value_type"></a><span class="identifier">value_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">value_traits</span> <a name="boost.intrusive.treap_set.value_traits"></a><span class="identifier">value_traits</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">key_type</span> <a name="boost.intrusive.treap_set.key_type"></a><span class="identifier">key_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">key_of_value</span> <a name="boost.intrusive.treap_set.key_of_value"></a><span class="identifier">key_of_value</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">pointer</span> <a name="boost.intrusive.treap_set.pointer"></a><span class="identifier">pointer</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">const_pointer</span> <a name="boost.intrusive.treap_set.const_pointer"></a><span class="identifier">const_pointer</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">reference</span> <a name="boost.intrusive.treap_set.reference"></a><span class="identifier">reference</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">const_reference</span> <a name="boost.intrusive.treap_set.const_reference"></a><span class="identifier">const_reference</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">difference_type</span> <a name="boost.intrusive.treap_set.difference_type"></a><span class="identifier">difference_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">size_type</span> <a name="boost.intrusive.treap_set.size_type"></a><span class="identifier">size_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">value_compare</span> <a name="boost.intrusive.treap_set.value_compare"></a><span class="identifier">value_compare</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">key_compare</span> <a name="boost.intrusive.treap_set.key_compare"></a><span class="identifier">key_compare</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">priority_compare</span> <a name="boost.intrusive.treap_set.priority_compare"></a><span class="identifier">priority_compare</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">iterator</span> <a name="boost.intrusive.treap_set.iterator"></a><span class="identifier">iterator</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">const_iterator</span> <a name="boost.intrusive.treap_set.const_iterator"></a><span class="identifier">const_iterator</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">reverse_iterator</span> <a name="boost.intrusive.treap_set.reverse_iterator"></a><span class="identifier">reverse_iterator</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">const_reverse_iterator</span> <a name="boost.intrusive.treap_set.const_reverse_iterator"></a><span class="identifier">const_reverse_iterator</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">insert_commit_data</span> <a name="boost.intrusive.treap_set.insert_commit_data"></a><span class="identifier">insert_commit_data</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">node_traits</span> <a name="boost.intrusive.treap_set.node_traits"></a><span class="identifier">node_traits</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">node</span> <a name="boost.intrusive.treap_set.node"></a><span class="identifier">node</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">node_ptr</span> <a name="boost.intrusive.treap_set.node_ptr"></a><span class="identifier">node_ptr</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">const_node_ptr</span> <a name="boost.intrusive.treap_set.const_node_ptr"></a><span class="identifier">const_node_ptr</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">node_algorithms</span> <a name="boost.intrusive.treap_set.node_algorithms"></a><span class="identifier">node_algorithms</span><span class="special">;</span>
<span class="comment">// <a class="link" href="treap_set.html#boost.intrusive.treap_setconstruct-copy-destruct">construct/copy/destruct</a></span>
<a class="link" href="treap_set.html#idp64168128-bb"><span class="identifier">treap_set</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">explicit</span> <a class="link" href="treap_set.html#idp64171296-bb"><span class="identifier">treap_set</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_compare</span> <span class="special">&</span><span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">priority_compare</span> <span class="special">&</span> <span class="special">=</span> <span class="identifier">priority_compare</span><span class="special">(</span><span class="special">)</span><span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">value_traits</span> <span class="special">&</span> <span class="special">=</span> <span class="identifier">value_traits</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Iterator<span class="special">></span>
<a class="link" href="treap_set.html#idp64177392-bb"><span class="identifier">treap_set</span></a><span class="special">(</span><span class="identifier">Iterator</span><span class="special">,</span> <span class="identifier">Iterator</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">key_compare</span> <span class="special">&</span> <span class="special">=</span> <span class="identifier">key_compare</span><span class="special">(</span><span class="special">)</span><span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">priority_compare</span> <span class="special">&</span> <span class="special">=</span> <span class="identifier">priority_compare</span><span class="special">(</span><span class="special">)</span><span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">value_traits</span> <span class="special">&</span> <span class="special">=</span> <span class="identifier">value_traits</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span>
<a class="link" href="treap_set.html#idp64186864-bb"><span class="identifier">treap_set</span></a><span class="special">(</span><a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">&&</span><span class="special">)</span><span class="special">;</span>
<a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">&</span> <a class="link" href="treap_set.html#idp64189104-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">&&</span><span class="special">)</span><span class="special">;</span>
<a class="link" href="treap_set.html#idp64191920-bb"><span class="special">~</span><span class="identifier">treap_set</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="comment">// <a class="link" href="treap_set.html#idp63657920-bb">public member functions</a></span>
<span class="identifier">iterator</span> <a class="link" href="treap_set.html#idp63658480-bb"><span class="identifier">begin</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">const_iterator</span> <a class="link" href="treap_set.html#idp63662048-bb"><span class="identifier">begin</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">const_iterator</span> <a class="link" href="treap_set.html#idp63665888-bb"><span class="identifier">cbegin</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">iterator</span> <a class="link" href="treap_set.html#idp63669728-bb"><span class="identifier">end</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">const_iterator</span> <a class="link" href="treap_set.html#idp63673296-bb"><span class="identifier">end</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">const_iterator</span> <a class="link" href="treap_set.html#idp63677136-bb"><span class="identifier">cend</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">reverse_iterator</span> <a class="link" href="treap_set.html#idp63680976-bb"><span class="identifier">rbegin</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">const_reverse_iterator</span> <a class="link" href="treap_set.html#idp63684560-bb"><span class="identifier">rbegin</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">const_reverse_iterator</span> <a class="link" href="treap_set.html#idp63688416-bb"><span class="identifier">crbegin</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">reverse_iterator</span> <a class="link" href="treap_set.html#idp63692272-bb"><span class="identifier">rend</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">const_reverse_iterator</span> <a class="link" href="treap_set.html#idp63695856-bb"><span class="identifier">rend</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">const_reverse_iterator</span> <a class="link" href="treap_set.html#idp63699712-bb"><span class="identifier">crend</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">iterator</span> <a class="link" href="treap_set.html#idp63703568-bb"><span class="identifier">root</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">const_iterator</span> <a class="link" href="treap_set.html#idp63707168-bb"><span class="identifier">root</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">const_iterator</span> <a class="link" href="treap_set.html#idp63711040-bb"><span class="identifier">croot</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">key_compare</span> <a class="link" href="treap_set.html#idp63714912-bb"><span class="identifier">key_comp</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">value_compare</span> <a class="link" href="treap_set.html#idp63718768-bb"><span class="identifier">value_comp</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="keyword">bool</span> <a class="link" href="treap_set.html#idp63722640-bb"><span class="identifier">empty</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">size_type</span> <a class="link" href="treap_set.html#idp63726464-bb"><span class="identifier">size</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="keyword">void</span> <a class="link" href="treap_set.html#idp63730400-bb"><span class="identifier">swap</span></a><span class="special">(</span><a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Cloner<span class="special">,</span> <span class="keyword">typename</span> Disposer<span class="special">></span>
<span class="keyword">void</span> <a class="link" href="treap_set.html#idp63734944-bb"><span class="identifier">clone_from</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">&</span><span class="special">,</span> <span class="identifier">Cloner</span><span class="special">,</span> <span class="identifier">Disposer</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Cloner<span class="special">,</span> <span class="keyword">typename</span> Disposer<span class="special">></span>
<span class="keyword">void</span> <a class="link" href="treap_set.html#idp63744000-bb"><span class="identifier">clone_from</span></a><span class="special">(</span><a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">&&</span><span class="special">,</span> <span class="identifier">Cloner</span><span class="special">,</span> <span class="identifier">Disposer</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">iterator</span> <a class="link" href="treap_set.html#idp63752896-bb"><span class="identifier">top</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">const_iterator</span> <a class="link" href="treap_set.html#idp63756480-bb"><span class="identifier">top</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">const_iterator</span> <a class="link" href="treap_set.html#idp63760336-bb"><span class="identifier">ctop</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">reverse_iterator</span> <a class="link" href="treap_set.html#idp63764192-bb"><span class="identifier">rtop</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">const_reverse_iterator</span> <a class="link" href="treap_set.html#idp63767792-bb"><span class="identifier">rtop</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">const_reverse_iterator</span> <a class="link" href="treap_set.html#idp63771664-bb"><span class="identifier">crtop</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">priority_compare</span> <a class="link" href="treap_set.html#idp63775536-bb"><span class="identifier">priority_comp</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">iterator</span><span class="special">,</span> <span class="keyword">bool</span> <span class="special">></span> <a class="link" href="treap_set.html#idp63779408-bb"><span class="identifier">insert</span></a><span class="special">(</span><span class="identifier">reference</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">iterator</span> <a class="link" href="treap_set.html#idp63785584-bb"><span class="identifier">insert</span></a><span class="special">(</span><span class="identifier">const_iterator</span><span class="special">,</span> <span class="identifier">reference</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">iterator</span><span class="special">,</span> <span class="keyword">bool</span> <span class="special">></span>
<a class="link" href="treap_set.html#idp63792576-bb"><span class="identifier">insert_check</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">insert_commit_data</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">iterator</span><span class="special">,</span> <span class="keyword">bool</span> <span class="special">></span>
<a class="link" href="treap_set.html#idp63800880-bb"><span class="identifier">insert_check</span></a><span class="special">(</span><span class="identifier">const_iterator</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">insert_commit_data</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">,</span>
<span class="keyword">typename</span> KeyValuePrioCompare<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">iterator</span><span class="special">,</span> <span class="keyword">bool</span> <span class="special">></span>
<a class="link" href="treap_set.html#idp63809968-bb"><span class="identifier">insert_check</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span><span class="special">,</span> <span class="identifier">KeyValuePrioCompare</span><span class="special">,</span>
<span class="identifier">insert_commit_data</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">,</span>
<span class="keyword">typename</span> KeyValuePrioCompare<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">iterator</span><span class="special">,</span> <span class="keyword">bool</span> <span class="special">></span>
<a class="link" href="treap_set.html#idp63822768-bb"><span class="identifier">insert_check</span></a><span class="special">(</span><span class="identifier">const_iterator</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span><span class="special">,</span>
<span class="identifier">KeyValuePrioCompare</span><span class="special">,</span> <span class="identifier">insert_commit_data</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Iterator<span class="special">></span> <span class="keyword">void</span> <a class="link" href="treap_set.html#idp63836352-bb"><span class="identifier">insert</span></a><span class="special">(</span><span class="identifier">Iterator</span><span class="special">,</span> <span class="identifier">Iterator</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">iterator</span> <a class="link" href="treap_set.html#idp63844160-bb"><span class="identifier">insert_commit</span></a><span class="special">(</span><span class="identifier">reference</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">insert_commit_data</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">iterator</span> <a class="link" href="treap_set.html#idp63852912-bb"><span class="identifier">insert_before</span></a><span class="special">(</span><span class="identifier">const_iterator</span><span class="special">,</span> <span class="identifier">reference</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">void</span> <a class="link" href="../container/set.html#idp63859920-bb"><span class="identifier">push_back</span></a><span class="special">(</span><span class="identifier">reference</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">void</span> <a class="link" href="treap_set.html#idp63866256-bb"><span class="identifier">push_front</span></a><span class="special">(</span><span class="identifier">reference</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">iterator</span> <a class="link" href="treap_set.html#idp63872592-bb"><span class="identifier">erase</span></a><span class="special">(</span><span class="identifier">const_iterator</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">iterator</span> <a class="link" href="treap_set.html#idp63877856-bb"><span class="identifier">erase</span></a><span class="special">(</span><span class="identifier">const_iterator</span><span class="special">,</span> <span class="identifier">const_iterator</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">size_type</span> <a class="link" href="treap_set.html#idp63883872-bb"><span class="identifier">erase</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">size_type</span> <a class="link" href="treap_set.html#idp63889968-bb"><span class="identifier">erase</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Disposer<span class="special">></span>
<span class="identifier">iterator</span> <a class="link" href="treap_set.html#idp63898528-bb"><span class="identifier">erase_and_dispose</span></a><span class="special">(</span><span class="identifier">const_iterator</span><span class="special">,</span> <span class="identifier">Disposer</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Disposer<span class="special">></span>
<span class="identifier">iterator</span> <a class="link" href="treap_set.html#idp63906208-bb"><span class="identifier">erase_and_dispose</span></a><span class="special">(</span><span class="identifier">const_iterator</span><span class="special">,</span> <span class="identifier">const_iterator</span><span class="special">,</span> <span class="identifier">Disposer</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Disposer<span class="special">></span>
<span class="identifier">size_type</span> <a class="link" href="treap_set.html#idp63914640-bb"><span class="identifier">erase_and_dispose</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">Disposer</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">,</span> <span class="keyword">typename</span> Disposer<span class="special">></span>
<span class="identifier">size_type</span> <a class="link" href="treap_set.html#idp63923312-bb"><span class="identifier">erase_and_dispose</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span><span class="special">,</span> <span class="identifier">Disposer</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">void</span> <a class="link" href="treap_set.html#idp63933776-bb"><span class="identifier">clear</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Disposer<span class="special">></span> <span class="keyword">void</span> <a class="link" href="treap_set.html#idp63938368-bb"><span class="identifier">clear_and_dispose</span></a><span class="special">(</span><span class="identifier">Disposer</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">size_type</span> <a class="link" href="treap_set.html#idp63944400-bb"><span class="identifier">count</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">size_type</span> <a class="link" href="treap_set.html#idp63949472-bb"><span class="identifier">count</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">iterator</span> <a class="link" href="treap_set.html#idp63958528-bb"><span class="identifier">lower_bound</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">iterator</span> <a class="link" href="treap_set.html#idp63963280-bb"><span class="identifier">lower_bound</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">const_iterator</span> <a class="link" href="treap_set.html#idp63970128-bb"><span class="identifier">lower_bound</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">const_iterator</span> <a class="link" href="treap_set.html#idp63975152-bb"><span class="identifier">lower_bound</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">iterator</span> <a class="link" href="treap_set.html#idp63982272-bb"><span class="identifier">upper_bound</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">iterator</span> <a class="link" href="treap_set.html#idp63987024-bb"><span class="identifier">upper_bound</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">const_iterator</span> <a class="link" href="treap_set.html#idp63995728-bb"><span class="identifier">upper_bound</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">const_iterator</span> <a class="link" href="treap_set.html#idp64000752-bb"><span class="identifier">upper_bound</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">iterator</span> <a class="link" href="treap_set.html#idp64009728-bb"><span class="identifier">find</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">iterator</span> <a class="link" href="treap_set.html#idp64014464-bb"><span class="identifier">find</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">const_iterator</span> <a class="link" href="treap_set.html#idp64023200-bb"><span class="identifier">find</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">const_iterator</span> <a class="link" href="treap_set.html#idp64028208-bb"><span class="identifier">find</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">iterator</span><span class="special">,</span> <span class="identifier">iterator</span> <span class="special">></span> <a class="link" href="treap_set.html#idp64037216-bb"><span class="identifier">equal_range</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">iterator</span><span class="special">,</span> <span class="identifier">iterator</span> <span class="special">></span>
<a class="link" href="treap_set.html#idp64042048-bb"><span class="identifier">equal_range</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">const_iterator</span><span class="special">,</span> <span class="identifier">const_iterator</span> <span class="special">></span>
<a class="link" href="treap_set.html#idp64050880-bb"><span class="identifier">equal_range</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">const_iterator</span><span class="special">,</span> <span class="identifier">const_iterator</span> <span class="special">></span>
<a class="link" href="treap_set.html#idp64056000-bb"><span class="identifier">equal_range</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">iterator</span><span class="special">,</span> <span class="identifier">iterator</span> <span class="special">></span>
<a class="link" href="treap_set.html#idp64065120-bb"><span class="identifier">bounded_range</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">iterator</span><span class="special">,</span> <span class="identifier">iterator</span> <span class="special">></span>
<a class="link" href="treap_set.html#idp64077552-bb"><span class="identifier">bounded_range</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">,</span>
<span class="keyword">bool</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">const_iterator</span><span class="special">,</span> <span class="identifier">const_iterator</span> <span class="special">></span>
<a class="link" href="treap_set.html#idp64094352-bb"><span class="identifier">bounded_range</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">const_iterator</span><span class="special">,</span> <span class="identifier">const_iterator</span> <span class="special">></span>
<a class="link" href="treap_set.html#idp64107072-bb"><span class="identifier">bounded_range</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">,</span>
<span class="keyword">bool</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">iterator</span> <a class="link" href="treap_set.html#idp64124160-bb"><span class="identifier">iterator_to</span></a><span class="special">(</span><span class="identifier">reference</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">const_iterator</span> <a class="link" href="treap_set.html#idp64129376-bb"><span class="identifier">iterator_to</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">pointer</span> <a class="link" href="treap_set.html#idp64134864-bb"><span class="identifier">unlink_leftmost_without_rebalance</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">void</span> <a class="link" href="treap_set.html#idp64139504-bb"><span class="identifier">replace_node</span></a><span class="special">(</span><span class="identifier">iterator</span><span class="special">,</span> <span class="identifier">reference</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">void</span> <a class="link" href="treap_set.html#idp64146496-bb"><span class="identifier">remove_node</span></a><span class="special">(</span><span class="identifier">reference</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span><span class="special">...</span> Options2<span class="special">></span> <span class="keyword">void</span> <a class="link" href="treap_set.html#idp64152064-bb"><span class="identifier">merge</span></a><span class="special">(</span><a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Options2</span><span class="special">...</span><span class="special">></span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span><span class="special">...</span> Options2<span class="special">></span> <span class="keyword">void</span> <a class="link" href="treap_set.html#idp64160016-bb"><span class="identifier">merge</span></a><span class="special">(</span><a class="link" href="treap_multiset.html" title="Class template treap_multiset">treap_multiset</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Options2</span><span class="special">...</span><span class="special">></span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="comment">// <a class="link" href="treap_set.html#idp64195824-bb">public static functions</a></span>
<span class="keyword">static</span> <a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">&</span> <a class="link" href="treap_set.html#idp64196384-bb"><span class="identifier">container_from_end_iterator</span></a><span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">static</span> <span class="keyword">const</span> <a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">&</span> <a class="link" href="treap_set.html#idp64202128-bb"><span class="identifier">container_from_end_iterator</span></a><span class="special">(</span><span class="identifier">const_iterator</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">static</span> <a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">&</span> <a class="link" href="treap_set.html#idp64208032-bb"><span class="identifier">container_from_iterator</span></a><span class="special">(</span><span class="identifier">iterator</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">static</span> <span class="keyword">const</span> <a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">&</span> <a class="link" href="treap_set.html#idp64213728-bb"><span class="identifier">container_from_iterator</span></a><span class="special">(</span><span class="identifier">const_iterator</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">static</span> <span class="identifier">iterator</span> <a class="link" href="treap_set.html#idp64219584-bb"><span class="identifier">s_iterator_to</span></a><span class="special">(</span><span class="identifier">reference</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">static</span> <span class="identifier">const_iterator</span> <a class="link" href="treap_set.html#idp64226400-bb"><span class="identifier">s_iterator_to</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">static</span> <span class="keyword">void</span> <a class="link" href="treap_set.html#idp64233216-bb"><span class="identifier">init_node</span></a><span class="special">(</span><span class="identifier">reference</span><span class="special">)</span><span class="special">;</span>
<span class="comment">// public data members</span>
<span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">constant_time_size</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.19.43.42.3.4"></a><h2>Description</h2>
<p>The class template <a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> is an intrusive container, that mimics most of the interface of std::set as described in the C++ standard.</p>
<p>The template parameter <code class="computeroutput">T</code> is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.</p>
<p>The container supports the following options: <code class="computeroutput">base_hook<>/member_hook<>/value_traits<></code>, <code class="computeroutput">constant_time_size<></code>, <code class="computeroutput">size_type<></code>, <code class="computeroutput">compare<></code> and <code class="computeroutput">priority_compare<></code> </p>
<div class="refsect2">
<a name="id-1.3.19.43.42.3.4.5"></a><h3>
<a name="boost.intrusive.treap_setconstruct-copy-destruct"></a><code class="computeroutput">treap_set</code>
public
construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="idp64168128-bb"></a><span class="identifier">treap_set</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty container.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">explicit</span> <a name="idp64171296-bb"></a><span class="identifier">treap_set</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_compare</span> <span class="special">&</span> cmp<span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">priority_compare</span> <span class="special">&</span> pcmp <span class="special">=</span> <span class="identifier">priority_compare</span><span class="special">(</span><span class="special">)</span><span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">value_traits</span> <span class="special">&</span> v_traits <span class="special">=</span> <span class="identifier">value_traits</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty container.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Iterator<span class="special">></span>
<a name="idp64177392-bb"></a><span class="identifier">treap_set</span><span class="special">(</span><span class="identifier">Iterator</span> b<span class="special">,</span> <span class="identifier">Iterator</span> e<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">key_compare</span> <span class="special">&</span> cmp <span class="special">=</span> <span class="identifier">key_compare</span><span class="special">(</span><span class="special">)</span><span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">priority_compare</span> <span class="special">&</span> pcmp <span class="special">=</span> <span class="identifier">priority_compare</span><span class="special">(</span><span class="special">)</span><span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">value_traits</span> <span class="special">&</span> v_traits <span class="special">=</span> <span class="identifier">value_traits</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: Dereferencing iterator must yield an lvalue of type value_type. cmp must be a comparison function that induces a strict weak ordering.</p>
<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty container and inserts elements from [b, e).</p>
<p><span class="bold"><strong>Complexity</strong></span>: Linear in N if [b, e) is already sorted using comp and otherwise N * log N, where N is the distance between first and last.</p>
<p><span class="bold"><strong>Throws</strong></span>: If value_traits::node_traits::node constructor throws (this does not happen with predefined Boost.Intrusive hooks) or the copy constructor/operator() of the key_compare/priority_compare objects throw. Basic guarantee. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idp64186864-bb"></a><span class="identifier">treap_set</span><span class="special">(</span><a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">&&</span> x<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: to-do </p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">&</span> <a name="idp64189104-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">&&</span> x<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: to-do </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idp64191920-bb"></a><span class="special">~</span><span class="identifier">treap_set</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Detaches all elements from this. The objects in the set are not deleted (i.e. no destructors are called), but the nodes according to the <code class="computeroutput"><a class="link" href="value_traits.html" title="Struct template value_traits">value_traits</a></code> template parameter are reinitialized and thus can be reused.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Linear to elements contained in *this.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.19.43.42.3.4.6"></a><h3>
<a name="idp63657920-bb"></a><code class="computeroutput">treap_set</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="identifier">iterator</span> <a name="idp63658480-bb"></a><span class="identifier">begin</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator pointing to the beginning of the container.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idp63662048-bb"></a><span class="identifier">begin</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator pointing to the beginning of the container.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idp63665888-bb"></a><span class="identifier">cbegin</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator pointing to the beginning of the container.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">iterator</span> <a name="idp63669728-bb"></a><span class="identifier">end</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator pointing to the end of the container.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idp63673296-bb"></a><span class="identifier">end</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator pointing to the end of the container.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idp63677136-bb"></a><span class="identifier">cend</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator pointing to the end of the container.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">reverse_iterator</span> <a name="idp63680976-bb"></a><span class="identifier">rbegin</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the beginning of the reversed container.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_reverse_iterator</span> <a name="idp63684560-bb"></a><span class="identifier">rbegin</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_reverse_iterator</span> <a name="idp63688416-bb"></a><span class="identifier">crbegin</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">reverse_iterator</span> <a name="idp63692272-bb"></a><span class="identifier">rend</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the end of the reversed container.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_reverse_iterator</span> <a name="idp63695856-bb"></a><span class="identifier">rend</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the end of the reversed container.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_reverse_iterator</span> <a name="idp63699712-bb"></a><span class="identifier">crend</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the end of the reversed container.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">iterator</span> <a name="idp63703568-bb"></a><span class="identifier">root</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a iterator pointing to the root node of the container or end() if not present.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idp63707168-bb"></a><span class="identifier">root</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idp63711040-bb"></a><span class="identifier">croot</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator pointing to the root node of the container or cend() if not present.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">key_compare</span> <a name="idp63714912-bb"></a><span class="identifier">key_comp</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns the key_compare object used by the container.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: If key_compare copy-constructor throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">value_compare</span> <a name="idp63718768-bb"></a><span class="identifier">value_comp</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns the value_compare object used by the container.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: If value_compare copy-constructor throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="idp63722640-bb"></a><span class="identifier">empty</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns true if the container is empty.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">size_type</span> <a name="idp63726464-bb"></a><span class="identifier">size</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns the number of elements stored in the container.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Linear to elements contained in *this if constant-time size option is disabled. Constant time otherwise.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp63730400-bb"></a><span class="identifier">swap</span><span class="special">(</span><a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">&</span> other<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Swaps the contents of two treaps.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: If the comparison functor's swap call throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Cloner<span class="special">,</span> <span class="keyword">typename</span> Disposer<span class="special">></span>
<span class="keyword">void</span> <a name="idp63734944-bb"></a><span class="identifier">clone_from</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">&</span> src<span class="special">,</span> <span class="identifier">Cloner</span> cloner<span class="special">,</span> <span class="identifier">Disposer</span> disposer<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</p>
<p><span class="bold"><strong>Effects</strong></span>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(const_reference ) and inserts them on *this. Copies the predicate from the source container.</p>
<p>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</p>
<p><span class="bold"><strong>Complexity</strong></span>: Linear to erased plus inserted elements.</p>
<p><span class="bold"><strong>Throws</strong></span>: If cloner throws or predicate copy assignment throws. Basic guarantee. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Cloner<span class="special">,</span> <span class="keyword">typename</span> Disposer<span class="special">></span>
<span class="keyword">void</span> <a name="idp63744000-bb"></a><span class="identifier">clone_from</span><span class="special">(</span><a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">&&</span> src<span class="special">,</span> <span class="identifier">Cloner</span> cloner<span class="special">,</span> <span class="identifier">Disposer</span> disposer<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: Disposer::operator()(pointer) shouldn't throw. Cloner should yield to nodes equivalent to the original nodes.</p>
<p><span class="bold"><strong>Effects</strong></span>: Erases all the elements from *this calling Disposer::operator()(pointer), clones all the elements from src calling Cloner::operator()(reference) and inserts them on *this. Copies the predicate from the source container.</p>
<p>If cloner throws, all cloned elements are unlinked and disposed calling Disposer::operator()(pointer).</p>
<p><span class="bold"><strong>Complexity</strong></span>: Linear to erased plus inserted elements.</p>
<p><span class="bold"><strong>Throws</strong></span>: If cloner throws or predicate copy assignment throws. Basic guarantee. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">iterator</span> <a name="idp63752896-bb"></a><span class="identifier">top</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator pointing to the highest priority object of the treap.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idp63756480-bb"></a><span class="identifier">top</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator pointing to the highest priority object of the treap..</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idp63760336-bb"></a><span class="identifier">ctop</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator pointing to the highest priority object of the treap..</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">reverse_iterator</span> <a name="idp63764192-bb"></a><span class="identifier">rtop</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the highest priority object of the reversed treap.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_reverse_iterator</span> <a name="idp63767792-bb"></a><span class="identifier">rtop</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the highest priority objec of the reversed treap.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_reverse_iterator</span> <a name="idp63771664-bb"></a><span class="identifier">crtop</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the highest priority object of the reversed treap.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">priority_compare</span> <a name="idp63775536-bb"></a><span class="identifier">priority_comp</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the highest priority object of the reversed treap.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">iterator</span><span class="special">,</span> <span class="keyword">bool</span> <span class="special">></span> <a name="idp63779408-bb"></a><span class="identifier">insert</span><span class="special">(</span><span class="identifier">reference</span> value<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: value must be an lvalue</p>
<p><span class="bold"><strong>Effects</strong></span>: Inserts value into the container if the value is not already present.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Average complexity for insert element is at most logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</p>
<p><span class="bold"><strong>Note</strong></span>: Does not affect the validity of iterators and references. No copy-constructors are called. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">iterator</span> <a name="idp63785584-bb"></a><span class="identifier">insert</span><span class="special">(</span><span class="identifier">const_iterator</span> hint<span class="special">,</span> <span class="identifier">reference</span> value<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: value must be an lvalue, and "hint" must be a valid iterator</p>
<p><span class="bold"><strong>Effects</strong></span>: Tries to insert x into the container, using "hint" as a hint to where it will be inserted.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic in general, but it is amortized constant time (two comparisons in the worst case) if t is inserted immediately before hint.</p>
<p><span class="bold"><strong>Throws</strong></span>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</p>
<p><span class="bold"><strong>Note</strong></span>: Does not affect the validity of iterators and references. No copy-constructors are called. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">iterator</span><span class="special">,</span> <span class="keyword">bool</span> <span class="special">></span>
<a name="idp63792576-bb"></a><span class="identifier">insert_check</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span> key<span class="special">,</span> <span class="identifier">insert_commit_data</span> <span class="special">&</span> commit_data<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</p>
<p><span class="bold"><strong>Returns</strong></span>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Average complexity is at most logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If the comparison or predicate functions throw. Strong guarantee.</p>
<p><span class="bold"><strong>Notes</strong></span>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</p>
<p>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</p>
<p>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">iterator</span><span class="special">,</span> <span class="keyword">bool</span> <span class="special">></span>
<a name="idp63800880-bb"></a><span class="identifier">insert_check</span><span class="special">(</span><span class="identifier">const_iterator</span> hint<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span> key<span class="special">,</span>
<span class="identifier">insert_commit_data</span> <span class="special">&</span> commit_data<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</p>
<p><span class="bold"><strong>Returns</strong></span>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</p>
<p><span class="bold"><strong>Throws</strong></span>: If the comparison or predicate functions throw. Strong guarantee.</p>
<p><span class="bold"><strong>Notes</strong></span>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</p>
<p>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</p>
<p>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">,</span>
<span class="keyword">typename</span> KeyValuePrioCompare<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">iterator</span><span class="special">,</span> <span class="keyword">bool</span> <span class="special">></span>
<a name="idp63809968-bb"></a><span class="identifier">insert_check</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span> key<span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span> comp<span class="special">,</span>
<span class="identifier">KeyValuePrioCompare</span> key_value_pcomp<span class="special">,</span>
<span class="identifier">insert_commit_data</span> <span class="special">&</span> commit_data<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: comp must be a comparison function that induces the same strict weak ordering as key_compare. key_value_pcomp must be a comparison function that induces the same strict weak ordering as priority_compare. The difference is that key_value_pcomp and comp compare an arbitrary key with the contained values.</p>
<p><span class="bold"><strong>Effects</strong></span>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself.</p>
<p><span class="bold"><strong>Returns</strong></span>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Average complexity is at most logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If the comp or key_value_pcomp ordering functions throw. Strong guarantee.</p>
<p><span class="bold"><strong>Notes</strong></span>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that part to check if the insertion will be successful.</p>
<p>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).</p>
<p>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">,</span>
<span class="keyword">typename</span> KeyValuePrioCompare<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">iterator</span><span class="special">,</span> <span class="keyword">bool</span> <span class="special">></span>
<a name="idp63822768-bb"></a><span class="identifier">insert_check</span><span class="special">(</span><span class="identifier">const_iterator</span> hint<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span> key<span class="special">,</span>
<span class="identifier">KeyTypeKeyCompare</span> comp<span class="special">,</span> <span class="identifier">KeyValuePrioCompare</span> key_value_pcomp<span class="special">,</span>
<span class="identifier">insert_commit_data</span> <span class="special">&</span> commit_data<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: comp must be a comparison function that induces the same strict weak ordering as key_compare. key_value_pcomp must be a comparison function that induces the same strict weak ordering as priority_compare. The difference is that key_value_pcomp and comp compare an arbitrary key with the contained values.</p>
<p><span class="bold"><strong>Effects</strong></span>: Checks if a value can be inserted in the container, using a user provided key instead of the value itself, using "hint" as a hint to where it will be inserted.</p>
<p><span class="bold"><strong>Returns</strong></span>: If there is an equivalent value returns a pair containing an iterator to the already present value and false. If the value can be inserted returns true in the returned pair boolean and fills "commit_data" that is meant to be used with the "insert_commit" function.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic in general, but it's amortized constant time if t is inserted immediately before hint.</p>
<p><span class="bold"><strong>Throws</strong></span>: If the comp or key_value_pcomp ordering functions throw. Strong guarantee.</p>
<p><span class="bold"><strong>Notes</strong></span>: This function is used to improve performance when constructing a value_type is expensive: if there is an equivalent value the constructed object must be discarded. Many times, the part of the constructing that is used to impose the order is much cheaper to construct than the value_type and this function offers the possibility to use that key to check if the insertion will be successful.</p>
<p>If the check is successful, the user can construct the value_type and use "insert_commit" to insert the object in constant-time. This can give a total constant-time complexity to the insertion: check(O(1)) + commit(O(1)).</p>
<p>"commit_data" remains valid for a subsequent "insert_commit" only if no more objects are inserted or erased from the container. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Iterator<span class="special">></span> <span class="keyword">void</span> <a name="idp63836352-bb"></a><span class="identifier">insert</span><span class="special">(</span><span class="identifier">Iterator</span> b<span class="special">,</span> <span class="identifier">Iterator</span> e<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: Dereferencing iterator must yield an lvalue of type value_type.</p>
<p><span class="bold"><strong>Effects</strong></span>: Tries to insert each element of a range into the container.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Insert range is in general O(N * log(N)), where N is the size of the range. However, it is linear in N if the range is already sorted by key_comp().</p>
<p><span class="bold"><strong>Throws</strong></span>: If the internal key_compare or priority_compare functions throw. Strong guarantee.</p>
<p><span class="bold"><strong>Note</strong></span>: Does not affect the validity of iterators and references. No copy-constructors are called. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">iterator</span> <a name="idp63844160-bb"></a><span class="identifier">insert_commit</span><span class="special">(</span><span class="identifier">reference</span> value<span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">insert_commit_data</span> <span class="special">&</span> commit_data<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: value must be an lvalue of type value_type. commit_data must have been obtained from a previous call to "insert_check". No objects should have been inserted or erased from the container between the "insert_check" that filled "commit_data" and the call to "insert_commit".</p>
<p><span class="bold"><strong>Effects</strong></span>: Inserts the value in the <code class="computeroutput"><a class="link" href="avl_set.html" title="Class template avl_set">avl_set</a></code> using the information obtained from the "commit_data" that a previous "insert_check" filled.</p>
<p><span class="bold"><strong>Returns</strong></span>: An iterator to the newly inserted object.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant time.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing</p>
<p><span class="bold"><strong>Notes</strong></span>: This function has only sense if a "insert_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">iterator</span> <a name="idp63852912-bb"></a><span class="identifier">insert_before</span><span class="special">(</span><span class="identifier">const_iterator</span> pos<span class="special">,</span> <span class="identifier">reference</span> value<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: value must be an lvalue, "pos" must be a valid iterator (or end) and must be the succesor of value once inserted according to the predicate</p>
<p><span class="bold"><strong>Effects</strong></span>: Inserts x into the container before "pos".</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant time.</p>
<p><span class="bold"><strong>Throws</strong></span>: If the internal priority_compare function throws. Strong guarantee.</p>
<p><span class="bold"><strong>Note</strong></span>: This function does not check preconditions so if "pos" is not the successor of "value" container ordering invariant will be broken. This is a low-level function to be used only for performance reasons by advanced users. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp63859920-bb"></a><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">reference</span> value<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: value must be an lvalue, and it must be no less than the greatest inserted key</p>
<p><span class="bold"><strong>Effects</strong></span>: Inserts x into the container in the last position.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant time.</p>
<p><span class="bold"><strong>Throws</strong></span>: If the internal priority_compare function throws. Strong guarantee.</p>
<p><span class="bold"><strong>Note</strong></span>: This function does not check preconditions so if value is less than the greatest inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp63866256-bb"></a><span class="identifier">push_front</span><span class="special">(</span><span class="identifier">reference</span> value<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: value must be an lvalue, and it must be no greater than the minimum inserted key</p>
<p><span class="bold"><strong>Effects</strong></span>: Inserts x into the container in the first position.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant time.</p>
<p><span class="bold"><strong>Throws</strong></span>: If the internal priority_compare function throws. Strong guarantee.</p>
<p><span class="bold"><strong>Note</strong></span>: This function does not check preconditions so if value is greater than the minimum inserted key container ordering invariant will be broken. This function is slightly more efficient than using "insert_before". This is a low-level function to be used only for performance reasons by advanced users. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">iterator</span> <a name="idp63872592-bb"></a><span class="identifier">erase</span><span class="special">(</span><span class="identifier">const_iterator</span> i<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Erases the element pointed to by i.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Average complexity for erase element is constant time.</p>
<p><span class="bold"><strong>Throws</strong></span>: if the internal priority_compare function throws. Strong guarantee.</p>
<p><span class="bold"><strong>Note</strong></span>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">iterator</span> <a name="idp63877856-bb"></a><span class="identifier">erase</span><span class="special">(</span><span class="identifier">const_iterator</span> b<span class="special">,</span> <span class="identifier">const_iterator</span> e<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Erases the range pointed to by b end e.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</p>
<p><span class="bold"><strong>Throws</strong></span>: if the internal priority_compare function throws. Strong guarantee.</p>
<p><span class="bold"><strong>Note</strong></span>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">size_type</span> <a name="idp63883872-bb"></a><span class="identifier">erase</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span> key<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Erases all the elements with the given value.</p>
<p><span class="bold"><strong>Returns</strong></span>: The number of erased elements.</p>
<p><span class="bold"><strong>Complexity</strong></span>: O(log(size() + N).</p>
<p><span class="bold"><strong>Throws</strong></span>: if the internal priority_compare function throws. Strong guarantee.</p>
<p><span class="bold"><strong>Note</strong></span>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">size_type</span> <a name="idp63889968-bb"></a><span class="identifier">erase</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span> key<span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span> comp<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Erases all the elements with the given key. according to the comparison functor "comp".</p>
<p><span class="bold"><strong>Returns</strong></span>: The number of erased elements.</p>
<p><span class="bold"><strong>Complexity</strong></span>: O(log(size() + N).</p>
<p><span class="bold"><strong>Throws</strong></span>: if the internal priority_compare function throws. Equivalent guarantee to <span class="emphasis"><em>while(beg != end) erase(beg++);</em></span></p>
<p><span class="bold"><strong>Note</strong></span>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Disposer<span class="special">></span>
<span class="identifier">iterator</span> <a name="idp63898528-bb"></a><span class="identifier">erase_and_dispose</span><span class="special">(</span><span class="identifier">const_iterator</span> i<span class="special">,</span> <span class="identifier">Disposer</span> disposer<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: Disposer::operator()(pointer) shouldn't throw.</p>
<p><span class="bold"><strong>Effects</strong></span>: Erases the element pointed to by i. Disposer::operator()(pointer) is called for the removed element.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Average complexity for erase element is constant time.</p>
<p><span class="bold"><strong>Throws</strong></span>: if the internal priority_compare function throws. Strong guarantee.</p>
<p><span class="bold"><strong>Note</strong></span>: Invalidates the iterators to the erased elements. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Disposer<span class="special">></span>
<span class="identifier">iterator</span> <a name="idp63906208-bb"></a><span class="identifier">erase_and_dispose</span><span class="special">(</span><span class="identifier">const_iterator</span> b<span class="special">,</span> <span class="identifier">const_iterator</span> e<span class="special">,</span>
<span class="identifier">Disposer</span> disposer<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: Disposer::operator()(pointer) shouldn't throw.</p>
<p><span class="bold"><strong>Effects</strong></span>: Erases the range pointed to by b end e. Disposer::operator()(pointer) is called for the removed elements.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Average complexity for erase range is at most O(log(size() + N)), where N is the number of elements in the range.</p>
<p><span class="bold"><strong>Throws</strong></span>: if the internal priority_compare function throws. Strong guarantee.</p>
<p><span class="bold"><strong>Note</strong></span>: Invalidates the iterators to the erased elements. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Disposer<span class="special">></span>
<span class="identifier">size_type</span> <a name="idp63914640-bb"></a><span class="identifier">erase_and_dispose</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span> key<span class="special">,</span> <span class="identifier">Disposer</span> disposer<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: Disposer::operator()(pointer) shouldn't throw.</p>
<p><span class="bold"><strong>Effects</strong></span>: Erases all the elements with the given value. Disposer::operator()(pointer) is called for the removed elements.</p>
<p><span class="bold"><strong>Returns</strong></span>: The number of erased elements.</p>
<p><span class="bold"><strong>Complexity</strong></span>: O(log(size() + N).</p>
<p><span class="bold"><strong>Throws</strong></span>: if the priority_compare function throws then weak guarantee and heap invariants are broken. The safest thing would be to clear or destroy the container.</p>
<p><span class="bold"><strong>Note</strong></span>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">,</span> <span class="keyword">typename</span> Disposer<span class="special">></span>
<span class="identifier">size_type</span> <a name="idp63923312-bb"></a><span class="identifier">erase_and_dispose</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span> key<span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span> comp<span class="special">,</span>
<span class="identifier">Disposer</span> disposer<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: Disposer::operator()(pointer) shouldn't throw.</p>
<p><span class="bold"><strong>Effects</strong></span>: Erases all the elements with the given key. according to the comparison functor "comp". Disposer::operator()(pointer) is called for the removed elements.</p>
<p><span class="bold"><strong>Returns</strong></span>: The number of erased elements.</p>
<p><span class="bold"><strong>Complexity</strong></span>: O(log(size() + N).</p>
<p><span class="bold"><strong>Throws</strong></span>: if the priority_compare function throws then weak guarantee and heap invariants are broken. The safest thing would be to clear or destroy the container.</p>
<p><span class="bold"><strong>Note</strong></span>: Invalidates the iterators to the erased elements. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp63933776-bb"></a><span class="identifier">clear</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Erases all of the elements.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements on the container. if it's a safe-mode or auto-unlink value_type. Constant time otherwise.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
<p><span class="bold"><strong>Note</strong></span>: Invalidates the iterators (but not the references) to the erased elements. No destructors are called. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Disposer<span class="special">></span> <span class="keyword">void</span> <a name="idp63938368-bb"></a><span class="identifier">clear_and_dispose</span><span class="special">(</span><span class="identifier">Disposer</span> disposer<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Erases all of the elements calling disposer(p) for each node to be erased. <span class="bold"><strong>Complexity</strong></span>: Average complexity for is at most O(log(size() + N)), where N is the number of elements in the container.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
<p><span class="bold"><strong>Note</strong></span>: Invalidates the iterators (but not the references) to the erased elements. Calls N times to disposer functor. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">size_type</span> <a name="idp63944400-bb"></a><span class="identifier">count</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span> key<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns the number of contained elements with the given value</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic to the number of elements contained plus lineal to number of objects with the given value.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">key_compare</code> throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">size_type</span> <a name="idp63949472-bb"></a><span class="identifier">count</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span> key<span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span> comp<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: key is a value such that <code class="computeroutput">*this</code> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <code class="computeroutput">*this</code>.</p>
<p><span class="bold"><strong>Effects</strong></span>: Returns the number of contained elements with the given key</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic to the number of elements contained plus lineal to number of objects with the given key.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">comp</code> throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">iterator</span> <a name="idp63958528-bb"></a><span class="identifier">lower_bound</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span> key<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">key_compare</code> throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">iterator</span> <a name="idp63963280-bb"></a><span class="identifier">lower_bound</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span> key<span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span> comp<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">key_compare</code> throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idp63970128-bb"></a><span class="identifier">lower_bound</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span> key<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">key_compare</code> throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">const_iterator</span>
<a name="idp63975152-bb"></a><span class="identifier">lower_bound</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span> key<span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span> comp<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the first element whose key is not less than k or end() if that element does not exist.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">key_compare</code> throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">iterator</span> <a name="idp63982272-bb"></a><span class="identifier">upper_bound</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span> key<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">key_compare</code> throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">iterator</span> <a name="idp63987024-bb"></a><span class="identifier">upper_bound</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span> key<span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span> comp<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: key is a value such that <code class="computeroutput">*this</code> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <code class="computeroutput">*this</code>.</p>
<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">comp</code> throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idp63995728-bb"></a><span class="identifier">upper_bound</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span> key<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the first element whose key is greater than k or end() if that element does not exist.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">key_compare</code> throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">const_iterator</span>
<a name="idp64000752-bb"></a><span class="identifier">upper_bound</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span> key<span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span> comp<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: key is a value such that <code class="computeroutput">*this</code> is partitioned with respect to !comp(key, nk), with nk the key_type of a value_type inserted into <code class="computeroutput">*this</code>.</p>
<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the first element whose key is greater than k according to comp or end() if that element does not exist.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">comp</code> throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">iterator</span> <a name="idp64009728-bb"></a><span class="identifier">find</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span> key<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">key_compare</code> throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">iterator</span> <a name="idp64014464-bb"></a><span class="identifier">find</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span> key<span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span> comp<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: key is a value such that <code class="computeroutput">*this</code> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <code class="computeroutput">*this</code>.</p>
<p><span class="bold"><strong>Effects</strong></span>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">comp</code> throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idp64023200-bb"></a><span class="identifier">find</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span> key<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">key_compare</code> throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">const_iterator</span> <a name="idp64028208-bb"></a><span class="identifier">find</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span> key<span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span> comp<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: key is a value such that <code class="computeroutput">*this</code> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), and nk the key_type of a value_type inserted into <code class="computeroutput">*this</code>.</p>
<p><span class="bold"><strong>Effects</strong></span>: Finds an iterator to the first element whose key is k or end() if that element does not exist.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">comp</code> throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">iterator</span><span class="special">,</span> <span class="identifier">iterator</span> <span class="special">></span> <a name="idp64037216-bb"></a><span class="identifier">equal_range</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span> key<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">key_compare</code> throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">iterator</span><span class="special">,</span> <span class="identifier">iterator</span> <span class="special">></span>
<a name="idp64042048-bb"></a><span class="identifier">equal_range</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span> key<span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span> comp<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: key is a value such that <code class="computeroutput">*this</code> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <code class="computeroutput">*this</code>.</p>
<p><span class="bold"><strong>Effects</strong></span>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">comp</code> throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">const_iterator</span><span class="special">,</span> <span class="identifier">const_iterator</span> <span class="special">></span>
<a name="idp64050880-bb"></a><span class="identifier">equal_range</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span> key<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">key_compare</code> throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">const_iterator</span><span class="special">,</span> <span class="identifier">const_iterator</span> <span class="special">></span>
<a name="idp64056000-bb"></a><span class="identifier">equal_range</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span> key<span class="special">,</span> <span class="identifier">KeyTypeKeyCompare</span> comp<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: key is a value such that <code class="computeroutput">*this</code> is partitioned with respect to comp(nk, key) and !comp(key, nk), with comp(nk, key) implying !comp(key, nk), with nk the key_type of a value_type inserted into <code class="computeroutput">*this</code>.</p>
<p><span class="bold"><strong>Effects</strong></span>: Finds a range containing all elements whose key is k or an empty range that indicates the position where those elements would be if they there is no elements with key k.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">comp</code> throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">iterator</span><span class="special">,</span> <span class="identifier">iterator</span> <span class="special">></span>
<a name="idp64065120-bb"></a><span class="identifier">bounded_range</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span> lower_key<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span> upper_key<span class="special">,</span>
<span class="keyword">bool</span> left_closed<span class="special">,</span> <span class="keyword">bool</span> right_closed<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: <code class="computeroutput">upper_key</code> shall not precede <code class="computeroutput">lower_key</code> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</p>
<p>If <code class="computeroutput">lower_key</code> is equivalent to <code class="computeroutput">upper_key</code> [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</p>
<p><span class="bold"><strong>Effects</strong></span>: Returns an a pair with the following criteria:</p>
<p>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</p>
<p>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">key_compare</code> throws.</p>
<p><span class="bold"><strong>Note</strong></span>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</p>
<p><span class="bold"><strong>Note</strong></span>: Experimental function, the interface might change in future releases. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">iterator</span><span class="special">,</span> <span class="identifier">iterator</span> <span class="special">></span>
<a name="idp64077552-bb"></a><span class="identifier">bounded_range</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span> lower_key<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span> upper_key<span class="special">,</span>
<span class="identifier">KeyTypeKeyCompare</span> comp<span class="special">,</span> <span class="keyword">bool</span> left_closed<span class="special">,</span> <span class="keyword">bool</span> right_closed<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: <code class="computeroutput">lower_key</code> is a value such that <code class="computeroutput">*this</code> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</p>
<p><code class="computeroutput">upper_key</code> is a value such that <code class="computeroutput">*this</code> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</p>
<p><code class="computeroutput">upper_key</code> shall not precede <code class="computeroutput">lower_key</code> according to comp [comp(upper_key, lower_key) shall be false]</p>
<p>If <code class="computeroutput">lower_key</code> is equivalent to <code class="computeroutput">upper_key</code> [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</p>
<p><span class="bold"><strong>Effects</strong></span>: Returns an a pair with the following criteria:</p>
<p>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</p>
<p>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">comp</code> throws.</p>
<p><span class="bold"><strong>Note</strong></span>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</p>
<p><span class="bold"><strong>Note</strong></span>: Experimental function, the interface might change in future releases. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">const_iterator</span><span class="special">,</span> <span class="identifier">const_iterator</span> <span class="special">></span>
<a name="idp64094352-bb"></a><span class="identifier">bounded_range</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span> lower_key<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">key_type</span> <span class="special">&</span> upper_key<span class="special">,</span>
<span class="keyword">bool</span> left_closed<span class="special">,</span> <span class="keyword">bool</span> right_closed<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: <code class="computeroutput">upper_key</code> shall not precede <code class="computeroutput">lower_key</code> according to key_compare. [key_comp()(upper_key, lower_key) shall be false]</p>
<p>If <code class="computeroutput">lower_key</code> is equivalent to <code class="computeroutput">upper_key</code> [!key_comp()(upper_key, lower_key) && !key_comp()(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</p>
<p><span class="bold"><strong>Effects</strong></span>: Returns an a pair with the following criteria:</p>
<p>first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise</p>
<p>second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">key_compare</code> throws.</p>
<p><span class="bold"><strong>Note</strong></span>: This function can be more efficient than calling upper_bound and lower_bound for lower_value and upper_value.</p>
<p><span class="bold"><strong>Note</strong></span>: Experimental function, the interface might change in future releases. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> KeyType<span class="special">,</span> <span class="keyword">typename</span> KeyTypeKeyCompare<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span> <span class="identifier">const_iterator</span><span class="special">,</span> <span class="identifier">const_iterator</span> <span class="special">></span>
<a name="idp64107072-bb"></a><span class="identifier">bounded_range</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span> lower_key<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">KeyType</span> <span class="special">&</span> upper_key<span class="special">,</span>
<span class="identifier">KeyTypeKeyCompare</span> comp<span class="special">,</span> <span class="keyword">bool</span> left_closed<span class="special">,</span> <span class="keyword">bool</span> right_closed<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: <code class="computeroutput">lower_key</code> is a value such that <code class="computeroutput">*this</code> is partitioned with respect to comp(nk, lower_key) if left_closed is true, with respect to !comp(lower_key, nk) otherwise.</p>
<p><code class="computeroutput">upper_key</code> is a value such that <code class="computeroutput">*this</code> is partitioned with respect to !comp(upper_key, nk) if right_closed is true, with respect to comp(nk, upper_key) otherwise.</p>
<p><code class="computeroutput">upper_key</code> shall not precede <code class="computeroutput">lower_key</code> according to comp [comp(upper_key, lower_key) shall be false]</p>
<p>If <code class="computeroutput">lower_key</code> is equivalent to <code class="computeroutput">upper_key</code> [!comp(upper_key, lower_key) && !comp(lower_key, upper_key)] then ('left_closed' || 'right_closed') must be false.</p>
<p><span class="bold"><strong>Effects</strong></span>: Returns an a pair with the following criteria:</p>
<p>first = lower_bound(lower_key, comp) if left_closed, upper_bound(lower_key, comp) otherwise</p>
<p>second = upper_bound(upper_key, comp) if right_closed, lower_bound(upper_key, comp) otherwise</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.</p>
<p><span class="bold"><strong>Throws</strong></span>: If <code class="computeroutput">comp</code> throws.</p>
<p><span class="bold"><strong>Note</strong></span>: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.</p>
<p><span class="bold"><strong>Note</strong></span>: Experimental function, the interface might change in future releases. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">iterator</span> <a name="idp64124160-bb"></a><span class="identifier">iterator_to</span><span class="special">(</span><span class="identifier">reference</span> value<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</p>
<p><span class="bold"><strong>Effects</strong></span>: Returns: a valid iterator i belonging to the set that points to the value</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_iterator</span> <a name="idp64129376-bb"></a><span class="identifier">iterator_to</span><span class="special">(</span><span class="identifier">const_reference</span> value<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</p>
<p><span class="bold"><strong>Effects</strong></span>: Returns: a valid const_iterator i belonging to the set that points to the value</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">pointer</span> <a name="idp64134864-bb"></a><span class="identifier">unlink_leftmost_without_rebalance</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Unlinks the leftmost node from the container.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Average complexity is constant time.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
<p><span class="bold"><strong>Notes</strong></span>: This function breaks the container and the container can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the container. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp64139504-bb"></a><span class="identifier">replace_node</span><span class="special">(</span><span class="identifier">iterator</span> replace_this<span class="special">,</span> <span class="identifier">reference</span> with_this<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: replace_this must be a valid iterator of *this and with_this must not be inserted in any container.</p>
<p><span class="bold"><strong>Effects</strong></span>: Replaces replace_this in its position in the container with with_this. The container does not need to be rebalanced.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
<p><span class="bold"><strong>Note</strong></span>: This function will break container ordering invariants if with_this is not equivalent to *replace_this according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp64146496-bb"></a><span class="identifier">remove_node</span><span class="special">(</span><span class="identifier">reference</span> value<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: removes "value" from the container.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic time.</p>
<p><span class="bold"><strong>Note</strong></span>: This static function is only usable with non-constant time size containers that have stateless comparison functors.</p>
<p>If the user calls this function with a constant time size container or stateful comparison functor a compilation error will be issued. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span><span class="special">...</span> Options2<span class="special">></span> <span class="keyword">void</span> <a name="idp64152064-bb"></a><span class="identifier">merge</span><span class="special">(</span><a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Options2</span><span class="special">...</span><span class="special">></span> <span class="special">&</span> source<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: "source" container's Options can only can differ in the comparison function from *this.</p>
<p><span class="bold"><strong>Effects</strong></span>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</p>
<p><span class="bold"><strong>Postcondition</strong></span>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing unless the comparison object throws.</p>
<p><span class="bold"><strong>Complexity</strong></span>: N log(a.size() + N) (N has the value source.size()) </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span><span class="special">...</span> Options2<span class="special">></span>
<span class="keyword">void</span> <a name="idp64160016-bb"></a><span class="identifier">merge</span><span class="special">(</span><a class="link" href="treap_multiset.html" title="Class template treap_multiset">treap_multiset</a><span class="special"><</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Options2</span><span class="special">...</span><span class="special">></span> <span class="special">&</span> source<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: "source" container's Options can only can differ in the comparison function from *this.</p>
<p><span class="bold"><strong>Effects</strong></span>: Attempts to extract each element in source and insert it into a using the comparison object of *this. If there is an element in a with key equivalent to the key of an element from source, then that element is not extracted from source.</p>
<p><span class="bold"><strong>Postcondition</strong></span>: Pointers and references to the transferred elements of source refer to those same elements but as members of *this. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into *this, not into source.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing unless the comparison object throws.</p>
<p><span class="bold"><strong>Complexity</strong></span>: N log(a.size() + N) (N has the value source.size()) </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.19.43.42.3.4.7"></a><h3>
<a name="idp64195824-bb"></a><code class="computeroutput">treap_set</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">&</span> <a name="idp64196384-bb"></a><span class="identifier">container_from_end_iterator</span><span class="special">(</span><span class="identifier">iterator</span> end_iterator<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Precondition</strong></span>: end_iterator must be a valid end iterator of the container.</p>
<p><span class="bold"><strong>Effects</strong></span>: Returns a const reference to the container associated to the end iterator</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="keyword">const</span> <a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">&</span>
<a name="idp64202128-bb"></a><span class="identifier">container_from_end_iterator</span><span class="special">(</span><span class="identifier">const_iterator</span> end_iterator<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Precondition</strong></span>: end_iterator must be a valid end iterator of the container.</p>
<p><span class="bold"><strong>Effects</strong></span>: Returns a const reference to the container associated to the end iterator</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">&</span> <a name="idp64208032-bb"></a><span class="identifier">container_from_iterator</span><span class="special">(</span><span class="identifier">iterator</span> it<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Precondition</strong></span>: it must be a valid iterator of the container.</p>
<p><span class="bold"><strong>Effects</strong></span>: Returns a const reference to the container associated to the iterator</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="keyword">const</span> <a class="link" href="treap_set.html" title="Class template treap_set">treap_set</a> <span class="special">&</span> <a name="idp64213728-bb"></a><span class="identifier">container_from_iterator</span><span class="special">(</span><span class="identifier">const_iterator</span> it<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Precondition</strong></span>: it must be a valid iterator of the container.</p>
<p><span class="bold"><strong>Effects</strong></span>: Returns a const reference to the container associated to the iterator</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="identifier">iterator</span> <a name="idp64219584-bb"></a><span class="identifier">s_iterator_to</span><span class="special">(</span><span class="identifier">reference</span> value<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</p>
<p><span class="bold"><strong>Effects</strong></span>: Returns: a valid iterator i belonging to the set that points to the value</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
<p><span class="bold"><strong>Note</strong></span>: This static function is available only if the <span class="emphasis"><em>value traits</em></span> is stateless. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="identifier">const_iterator</span> <a name="idp64226400-bb"></a><span class="identifier">s_iterator_to</span><span class="special">(</span><span class="identifier">const_reference</span> value<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: value must be an lvalue and shall be in a set of appropriate type. Otherwise the behavior is undefined.</p>
<p><span class="bold"><strong>Effects</strong></span>: Returns: a valid iterator i belonging to the set that points to the value</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
<p><span class="bold"><strong>Note</strong></span>: This static function is available only if the <span class="emphasis"><em>value traits</em></span> is stateless. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="keyword">void</span> <a name="idp64233216-bb"></a><span class="identifier">init_node</span><span class="special">(</span><span class="identifier">reference</span> value<span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Requires</strong></span>: value shall not be in a container.</p>
<p><span class="bold"><strong>Effects</strong></span>: init_node puts the hook of a value in a well-known default state.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant time.</p>
<p><span class="bold"><strong>Note</strong></span>: This function puts the hook in the well-known default state used by auto_unlink and safe hooks. </p>
</li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="path_to_url~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
file LICENSE_1_0.txt or copy at <a href="path_to_url" target="_top">path_to_url
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="treap_algorithms/insert_commit_data.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../intrusive/reference.html#header.boost.intrusive.treap_set_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="make_treap_set.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
```
|
```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.
*/
/**
* Http Client abstractions and factory.
*/
@NonNullApi
package reactor.netty.http.client;
import reactor.util.annotation.NonNullApi;
```
|
```c++
//
//
// file LICENSE_1_0.txt or copy at path_to_url
//
// Official repository: path_to_url
//
#ifndef BOOST_BEAST_WEBSOCKET_IMPL_CLOSE_IPP
#define BOOST_BEAST_WEBSOCKET_IMPL_CLOSE_IPP
#include <boost/beast/websocket/teardown.hpp>
#include <boost/beast/core/handler_ptr.hpp>
#include <boost/beast/core/flat_static_buffer.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/beast/core/detail/config.hpp>
#include <boost/asio/associated_allocator.hpp>
#include <boost/asio/associated_executor.hpp>
#include <boost/asio/coroutine.hpp>
#include <boost/asio/handler_continuation_hook.hpp>
#include <boost/asio/post.hpp>
#include <boost/throw_exception.hpp>
#include <memory>
namespace boost {
namespace beast {
namespace websocket {
/* Close the WebSocket Connection
This composed operation sends the close frame if it hasn't already
been sent, then reads and discards frames until receiving a close
frame. Finally it invokes the teardown operation to shut down the
underlying connection.
*/
template<class NextLayer>
template<class Handler>
class stream<NextLayer>::close_op
: public boost::asio::coroutine
{
struct state
{
stream<NextLayer>& ws;
detail::frame_buffer fb;
error_code ev;
token tok;
bool cont = false;
state(
Handler&,
stream<NextLayer>& ws_,
close_reason const& cr)
: ws(ws_)
, tok(ws.tok_.unique())
{
// Serialize the close frame
ws.template write_close<
flat_static_buffer_base>(fb, cr);
}
};
handler_ptr<state, Handler> d_;
public:
close_op(close_op&&) = default;
close_op(close_op const&) = default;
template<class DeducedHandler>
close_op(
DeducedHandler&& h,
stream<NextLayer>& ws,
close_reason const& cr)
: d_(std::forward<DeducedHandler>(h), ws, cr)
{
}
using allocator_type =
boost::asio::associated_allocator_t<Handler>;
allocator_type
get_allocator() const noexcept
{
return boost::asio::get_associated_allocator(d_.handler());
}
using executor_type = boost::asio::associated_executor_t<
Handler, decltype(std::declval<stream<NextLayer>&>().get_executor())>;
executor_type
get_executor() const noexcept
{
return boost::asio::get_associated_executor(
d_.handler(), d_->ws.get_executor());
}
void
operator()(
error_code ec = {},
std::size_t bytes_transferred = 0,
bool cont = true);
friend
bool asio_handler_is_continuation(close_op* op)
{
using boost::asio::asio_handler_is_continuation;
return op->d_->cont || asio_handler_is_continuation(
std::addressof(op->d_.handler()));
}
};
template<class NextLayer>
template<class Handler>
void
stream<NextLayer>::
close_op<Handler>::
operator()(
error_code ec,
std::size_t bytes_transferred,
bool cont)
{
using beast::detail::clamp;
auto& d = *d_;
close_code code{};
d.cont = cont;
BOOST_ASIO_CORO_REENTER(*this)
{
// Maybe suspend
if(! d.ws.wr_block_)
{
// Acquire the write block
d.ws.wr_block_ = d.tok;
// Make sure the stream is open
if(! d.ws.check_open(ec))
goto upcall;
}
else
{
// Suspend
BOOST_ASSERT(d.ws.wr_block_ != d.tok);
BOOST_ASIO_CORO_YIELD
d.ws.paused_close_.emplace(std::move(*this));
// Acquire the write block
BOOST_ASSERT(! d.ws.wr_block_);
d.ws.wr_block_ = d.tok;
// Resume
BOOST_ASIO_CORO_YIELD
boost::asio::post(
d.ws.get_executor(), std::move(*this));
BOOST_ASSERT(d.ws.wr_block_ == d.tok);
// Make sure the stream is open
if(! d.ws.check_open(ec))
goto upcall;
}
// Can't call close twice
BOOST_ASSERT(! d.ws.wr_close_);
// Change status to closing
BOOST_ASSERT(d.ws.status_ == status::open);
d.ws.status_ = status::closing;
// Send close frame
d.ws.wr_close_ = true;
BOOST_ASIO_CORO_YIELD
boost::asio::async_write(d.ws.stream_,
d.fb.data(), std::move(*this));
if(! d.ws.check_ok(ec))
goto upcall;
if(d.ws.rd_close_)
{
// This happens when the read_op gets a close frame
// at the same time close_op is sending the close frame.
// The read_op will be suspended on the write block.
goto teardown;
}
// Maybe suspend
if(! d.ws.rd_block_)
{
// Acquire the read block
d.ws.rd_block_ = d.tok;
}
else
{
// Suspend
BOOST_ASSERT(d.ws.rd_block_ != d.tok);
BOOST_ASIO_CORO_YIELD
d.ws.paused_r_close_.emplace(std::move(*this));
// Acquire the read block
BOOST_ASSERT(! d.ws.rd_block_);
d.ws.rd_block_ = d.tok;
// Resume
BOOST_ASIO_CORO_YIELD
boost::asio::post(
d.ws.get_executor(), std::move(*this));
BOOST_ASSERT(d.ws.rd_block_ == d.tok);
// Make sure the stream is open
BOOST_ASSERT(d.ws.status_ != status::open);
BOOST_ASSERT(d.ws.status_ != status::closed);
if( d.ws.status_ == status::failed)
goto upcall;
BOOST_ASSERT(! d.ws.rd_close_);
}
// Drain
if(d.ws.rd_remain_ > 0)
goto read_payload;
for(;;)
{
// Read frame header
while(! d.ws.parse_fh(
d.ws.rd_fh_, d.ws.rd_buf_, code))
{
if(code != close_code::none)
{
d.ev = error::failed;
goto teardown;
}
BOOST_ASIO_CORO_YIELD
d.ws.stream_.async_read_some(
d.ws.rd_buf_.prepare(read_size(d.ws.rd_buf_,
d.ws.rd_buf_.max_size())),
std::move(*this));
if(! d.ws.check_ok(ec))
goto upcall;
d.ws.rd_buf_.commit(bytes_transferred);
}
if(detail::is_control(d.ws.rd_fh_.op))
{
// Process control frame
if(d.ws.rd_fh_.op == detail::opcode::close)
{
BOOST_ASSERT(! d.ws.rd_close_);
d.ws.rd_close_ = true;
auto const mb = buffers_prefix(
clamp(d.ws.rd_fh_.len),
d.ws.rd_buf_.data());
if(d.ws.rd_fh_.len > 0 && d.ws.rd_fh_.mask)
detail::mask_inplace(mb, d.ws.rd_key_);
detail::read_close(d.ws.cr_, mb, code);
if(code != close_code::none)
{
// Protocol error
d.ev = error::failed;
goto teardown;
}
d.ws.rd_buf_.consume(clamp(d.ws.rd_fh_.len));
goto teardown;
}
d.ws.rd_buf_.consume(clamp(d.ws.rd_fh_.len));
}
else
{
read_payload:
while(d.ws.rd_buf_.size() < d.ws.rd_remain_)
{
d.ws.rd_remain_ -= d.ws.rd_buf_.size();
d.ws.rd_buf_.consume(d.ws.rd_buf_.size());
BOOST_ASIO_CORO_YIELD
d.ws.stream_.async_read_some(
d.ws.rd_buf_.prepare(read_size(d.ws.rd_buf_,
d.ws.rd_buf_.max_size())),
std::move(*this));
if(! d.ws.check_ok(ec))
goto upcall;
d.ws.rd_buf_.commit(bytes_transferred);
}
BOOST_ASSERT(d.ws.rd_buf_.size() >= d.ws.rd_remain_);
d.ws.rd_buf_.consume(clamp(d.ws.rd_remain_));
d.ws.rd_remain_ = 0;
}
}
teardown:
// Teardown
BOOST_ASSERT(d.ws.wr_block_ == d.tok);
using beast::websocket::async_teardown;
BOOST_ASIO_CORO_YIELD
async_teardown(d.ws.role_,
d.ws.stream_, std::move(*this));
BOOST_ASSERT(d.ws.wr_block_ == d.tok);
if(ec == boost::asio::error::eof)
{
// Rationale:
// path_to_url
ec.assign(0, ec.category());
}
if(! ec)
ec = d.ev;
if(ec)
d.ws.status_ = status::failed;
else
d.ws.status_ = status::closed;
d.ws.close();
upcall:
BOOST_ASSERT(d.ws.wr_block_ == d.tok);
d.ws.wr_block_.reset();
if(d.ws.rd_block_ == d.tok)
{
d.ws.rd_block_.reset();
d.ws.paused_r_rd_.maybe_invoke();
}
d.ws.paused_rd_.maybe_invoke() ||
d.ws.paused_ping_.maybe_invoke() ||
d.ws.paused_wr_.maybe_invoke();
if(! d.cont)
{
auto& ws = d.ws;
return boost::asio::post(
ws.stream_.get_executor(),
bind_handler(d_.release_handler(), ec));
}
d_.invoke(ec);
}
}
//your_sha256_hash--------------
template<class NextLayer>
void
stream<NextLayer>::
close(close_reason const& cr)
{
static_assert(is_sync_stream<next_layer_type>::value,
"SyncStream requirements not met");
error_code ec;
close(cr, ec);
if(ec)
BOOST_THROW_EXCEPTION(system_error{ec});
}
template<class NextLayer>
void
stream<NextLayer>::
close(close_reason const& cr, error_code& ec)
{
static_assert(is_sync_stream<next_layer_type>::value,
"SyncStream requirements not met");
using beast::detail::clamp;
ec.assign(0, ec.category());
// Make sure the stream is open
if(! check_open(ec))
return;
// If rd_close_ is set then we already sent a close
BOOST_ASSERT(! rd_close_);
BOOST_ASSERT(! wr_close_);
wr_close_ = true;
{
detail::frame_buffer fb;
write_close<flat_static_buffer_base>(fb, cr);
boost::asio::write(stream_, fb.data(), ec);
}
if(! check_ok(ec))
return;
status_ = status::closing;
// Drain the connection
close_code code{};
if(rd_remain_ > 0)
goto read_payload;
for(;;)
{
// Read frame header
while(! parse_fh(rd_fh_, rd_buf_, code))
{
if(code != close_code::none)
return do_fail(close_code::none,
error::failed, ec);
auto const bytes_transferred =
stream_.read_some(
rd_buf_.prepare(read_size(rd_buf_,
rd_buf_.max_size())), ec);
if(! check_ok(ec))
return;
rd_buf_.commit(bytes_transferred);
}
if(detail::is_control(rd_fh_.op))
{
// Process control frame
if(rd_fh_.op == detail::opcode::close)
{
BOOST_ASSERT(! rd_close_);
rd_close_ = true;
auto const mb = buffers_prefix(
clamp(rd_fh_.len),
rd_buf_.data());
if(rd_fh_.len > 0 && rd_fh_.mask)
detail::mask_inplace(mb, rd_key_);
detail::read_close(cr_, mb, code);
if(code != close_code::none)
{
// Protocol error
return do_fail(close_code::none,
error::failed, ec);
}
rd_buf_.consume(clamp(rd_fh_.len));
break;
}
rd_buf_.consume(clamp(rd_fh_.len));
}
else
{
read_payload:
while(rd_buf_.size() < rd_remain_)
{
rd_remain_ -= rd_buf_.size();
rd_buf_.consume(rd_buf_.size());
auto const bytes_transferred =
stream_.read_some(
rd_buf_.prepare(read_size(rd_buf_,
rd_buf_.max_size())), ec);
if(! check_ok(ec))
return;
rd_buf_.commit(bytes_transferred);
}
BOOST_ASSERT(rd_buf_.size() >= rd_remain_);
rd_buf_.consume(clamp(rd_remain_));
rd_remain_ = 0;
}
}
// _Close the WebSocket Connection_
do_fail(close_code::none, error::closed, ec);
if(ec == error::closed)
ec.assign(0, ec.category());
}
template<class NextLayer>
template<class CloseHandler>
BOOST_ASIO_INITFN_RESULT_TYPE(
CloseHandler, void(error_code))
stream<NextLayer>::
async_close(close_reason const& cr, CloseHandler&& handler)
{
static_assert(is_async_stream<next_layer_type>::value,
"AsyncStream requirements not met");
boost::asio::async_completion<CloseHandler,
void(error_code)> init{handler};
close_op<BOOST_ASIO_HANDLER_TYPE(
CloseHandler, void(error_code))>{
init.completion_handler, *this, cr}(
{}, 0, false);
return init.result.get();
}
} // websocket
} // beast
} // boost
#endif
```
|
```java
/**
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package io.pravega.segmentstore.server.containers;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.AbstractIdleService;
import io.pravega.common.Exceptions;
import io.pravega.common.TimeoutTimer;
import io.pravega.common.concurrent.Futures;
import io.pravega.common.concurrent.Services;
import io.pravega.common.util.BufferView;
import io.pravega.common.util.Retry;
import io.pravega.segmentstore.contracts.AttributeId;
import io.pravega.segmentstore.contracts.AttributeUpdate;
import io.pravega.segmentstore.contracts.AttributeUpdateCollection;
import io.pravega.segmentstore.contracts.ExtendedChunkInfo;
import io.pravega.segmentstore.contracts.MergeStreamSegmentResult;
import io.pravega.segmentstore.contracts.ReadResult;
import io.pravega.segmentstore.contracts.SegmentProperties;
import io.pravega.segmentstore.contracts.SegmentType;
import io.pravega.segmentstore.contracts.StreamSegmentNotExistsException;
import io.pravega.segmentstore.server.DirectSegmentAccess;
import io.pravega.segmentstore.server.SegmentContainer;
import io.pravega.segmentstore.server.SegmentContainerExtension;
import io.pravega.segmentstore.server.logs.operations.OperationPriority;
import io.pravega.segmentstore.server.reading.StreamSegmentStorageReader;
import io.pravega.segmentstore.storage.ReadOnlyStorage;
import io.pravega.segmentstore.storage.StorageFactory;
import java.time.Duration;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.Nullable;
import lombok.extern.slf4j.Slf4j;
/**
* A slimmed down version of StreamSegmentContainer that is only able to perform reads from Storage. This SegmentContainer
* cannot make any modifications to any Segments, nor can it create new or delete existing ones. It also cannot access data
* that exists solely in DurableDataLog (which has not yet been transferred into permanent Storage).
*/
@Slf4j
class ReadOnlySegmentContainer extends AbstractIdleService implements SegmentContainer {
//region Members
@VisibleForTesting
static final int MAX_READ_AT_ONCE_BYTES = 4 * 1024 * 1024;
private static final int CONTAINER_ID = Integer.MAX_VALUE; // So that it doesn't collide with any other real Container Id.
private static final int CONTAINER_EPOCH = 1; // This guarantees that any write operations should be fenced out if attempted.
private static final Retry.RetryAndThrowExceptionally<StreamSegmentNotExistsException, RuntimeException> READ_RETRY = Retry
.withExpBackoff(30, 10, 4)
.retryingOn(StreamSegmentNotExistsException.class)
.throwingOn(RuntimeException.class);
private final ReadOnlyStorage storage;
private final ScheduledExecutorService executor;
private final AtomicBoolean closed;
//endregion
//region Constructor
/**
* Creates a new instance of the ReadOnlySegmentContainer class.
*
* @param storageFactory A StorageFactory used to create Storage adapters.
* @param executor An Executor to use for async operations.
*/
ReadOnlySegmentContainer(StorageFactory storageFactory, ScheduledExecutorService executor) {
Preconditions.checkNotNull(storageFactory, "storageFactory");
this.executor = Preconditions.checkNotNull(executor, "executor");
this.storage = storageFactory.createStorageAdapter();
this.closed = new AtomicBoolean();
}
//endregion
//region AutoCloseable Implementation
@Override
public void close() {
if (this.closed.compareAndSet(false, true)) {
Futures.await(Services.stopAsync(this, this.executor));
this.storage.close();
log.info("Closed.");
}
}
//endregion
//region AbstractIdleService Implementation
@Override
protected Executor executor() {
return this.executor;
}
@Override
protected void startUp() {
this.storage.initialize(CONTAINER_EPOCH);
log.info("Started.");
}
@Override
protected void shutDown() {
log.info("Stopped.");
}
//endregion
// SegmentContainer Implementation
@Override
public int getId() {
return CONTAINER_ID;
}
@Override
public boolean isOffline() {
// ReadOnlySegmentContainer is always online.
return false;
}
@Override
public CompletableFuture<ReadResult> read(String streamSegmentName, long offset, int maxLength, Duration timeout) {
Exceptions.checkNotClosed(this.closed.get(), this);
TimeoutTimer timer = new TimeoutTimer(timeout);
return READ_RETRY.run(() -> getStreamSegmentInfo(streamSegmentName, timer.getRemaining())
.thenApply(si -> StreamSegmentStorageReader.read(si, offset, maxLength, MAX_READ_AT_ONCE_BYTES, this.storage)));
}
@Override
public CompletableFuture<SegmentProperties> getStreamSegmentInfo(String streamSegmentName, Duration timeout) {
Exceptions.checkNotClosed(this.closed.get(), this);
return READ_RETRY.run(() -> this.storage.getStreamSegmentInfo(streamSegmentName, timeout));
}
//endregion
//region Unsupported Operations
@Override
public Collection<SegmentProperties> getActiveSegments() {
throw new UnsupportedOperationException("getActiveSegments is not supported on " + getClass().getSimpleName());
}
@Override
public <T extends SegmentContainerExtension> T getExtension(Class<T> extensionClass) {
throw new UnsupportedOperationException("getExtension is not supported on " + getClass().getSimpleName());
}
@Override
public CompletableFuture<Void> flushToStorage(Duration timeout) {
throw new UnsupportedOperationException("flushToStorage is not supported on " + getClass().getSimpleName());
}
@Override
public CompletableFuture<List<ExtendedChunkInfo>> getExtendedChunkInfo(String streamSegmentName, Duration timeout) {
throw new UnsupportedOperationException("getExtendedChunkInfo is not supported on " + getClass().getSimpleName());
}
@Override
public CompletableFuture<Long> append(String streamSegmentName, BufferView data, AttributeUpdateCollection attributeUpdates, Duration timeout) {
return unsupported("append");
}
@Override
public CompletableFuture<Long> append(String streamSegmentName, long offset, BufferView data, AttributeUpdateCollection attributeUpdates, Duration timeout) {
return unsupported("append");
}
@Override
public CompletableFuture<Void> updateAttributes(String streamSegmentName, AttributeUpdateCollection attributeUpdates, Duration timeout) {
return unsupported("updateAttributes");
}
@Override
public CompletableFuture<Map<AttributeId, Long>> getAttributes(String streamSegmentName, Collection<AttributeId> attributeIds, boolean cache, Duration timeout) {
return unsupported("getAttributes");
}
@Override
public CompletableFuture<Void> createStreamSegment(String streamSegmentName, SegmentType segmentType, Collection<AttributeUpdate> attributes, Duration timeout) {
return unsupported("createStreamSegment");
}
@Override
public CompletableFuture<MergeStreamSegmentResult> mergeStreamSegment(String targetStreamSegment, String sourceStreamSegment, Duration timeout) {
return unsupported("mergeStreamSegment");
}
@Override
public CompletableFuture<MergeStreamSegmentResult> mergeStreamSegment(String targetStreamSegment, String sourceStreamSegment,
AttributeUpdateCollection attributes, Duration timeout) {
return unsupported("mergeStreamSegment");
}
@Override
public CompletableFuture<Long> sealStreamSegment(String streamSegmentName, Duration timeout) {
return unsupported("sealStreamSegment");
}
@Override
public CompletableFuture<Void> deleteStreamSegment(String streamSegmentName, Duration timeout) {
return unsupported("deleteStreamSegment");
}
@Override
public CompletableFuture<Void> truncateStreamSegment(String streamSegmentName, long offset, Duration timeout) {
return unsupported("truncateStreamSegment");
}
@Override
public CompletableFuture<DirectSegmentAccess> forSegment(String streamSegmentName, @Nullable OperationPriority priority, Duration timeout) {
return unsupported("forSegment");
}
private <T> CompletableFuture<T> unsupported(String methodName) {
return Futures.failedFuture(new UnsupportedOperationException(methodName + " is unsupported on " + getClass().getSimpleName()));
}
//endregion
}
```
|
Bogyoke Aung San Road (, formerly Montgomery Road) is a major road of southern Yangon, Burma. It crosses the city in a west–east direction, running parallel with Maha Bandula Road. The road contains several hospitals, BEHS 1 Latha (Central High School), BEHS 2 Latha (St. John's Convent School) and Yangon General Hospital is just off the road.
Streets in Yangon
|
Edward Pulgar is a Venezuelan violinist and conductor.
Early life and education
Born in Caracas, Pulgar was trained through the National Youth Orchestra System in Venezuela (currently known as "El Sistema"). He began musical studies at age eight in solfege, percussion and violin at the Escuela de Música “Elias David Curiel” in Coro. His teachers included Giuseppe Maiolino, Miroslaw Kulikowsky, and Józef Szatanek. At thirteen years old, he won the special prize in the Juan Bautista Plaza V National Violin Competition and several other competitions in Venezuela. He continued his studies in violin and orchestral conducting at the Conservatorio José Luis Paz of Maracaibo, the Conservatorio Simón Bolívar, and the Latin-American Violin Academy under José Francisco del Castillo in Caracas. Pulgar earned an artist diploma from Duquesne University in Pittsburgh and recently a master's in music performance from Michigan State University.
Career
He made his debut as a conductor at age twenty with the Zulia Symphony Orchestra in Venezuela. Three years later he became a member of Simón Bolívar Symphony Orchestra of Venezuela. Also, he has been a member of the Grand Rapids Symphony Orchestra in Michigan and Associate Principal of the Wheeling Symphony Orchestra in West Virginia, United States.
Mr. Pulgar has appeared as a soloist and concertmaster with symphonic orchestras in Venezuela and South America, and more recently with the Knoxville Symphony Orchestra at important concert halls such as Teresa Carreño Cultural Complex of Caracas, Panama's National Theatre, Beethovensaal of Stuttgart and Bonn, Teatro Colón of Bogota, the PNC Recital Hall and Carnegie Music Hall in Pittsburgh, the Niswonger Performing Arts Center of Greenville, TN and the Knoxville Civic Auditorium, among others.
Currently, Mr. Pulgar is the Principal Second Violin of the Knoxville Symphony Orchestra, and a member of the Knoxville Symphony’s Principal String Quartet, appearing throughout East Tennessee in recitals, concerts and radio and television appearances. He is also an Adjunct Professor of Strings at Carson-Newman University. He eagerly continues to pursue solo and chamber music in the U.S. and Latin America along with guest appearances as conductor.
Critical reviews
"Large and beautiful sonority, with impeccable intonation...."
"...The concerto was superbly executed by Edward Pulgar..."
"In the Saint-Saëns, Pulgar exploited with great freedom the possibilities of the violin..."
"The audience gave back [to Mr. Pulgar] the same stamp he sealed in both pieces of very high levels of technique, with much applause and a well-deserved ovation..."
"A soloist of admirable pedagogy..."
“[When] Edward Pulgar conducts, he draws music with his hands...”
External links
1974 births
Living people
Duquesne University alumni
Michigan State University alumni
Musicians from Caracas
Venezuelan classical violinists
Male classical violinists
Venezuelan conductors (music)
Male conductors (music)
21st-century conductors (music)
21st-century classical violinists
21st-century male musicians
|
```smalltalk
"
A unit test class for class LocaleID
"
Class {
#name : 'LocaleIDTest',
#superclass : 'TestCase',
#category : 'System-Localization-Tests-Locales',
#package : 'System-Localization-Tests',
#tag : 'Locales'
}
{ #category : 'tests - test data' }
LocaleIDTest >> frenchLocaleID [
^LocaleID isoLanguage: 'fr'
]
{ #category : 'tests - test data' }
LocaleIDTest >> germanLocaleID [
^LocaleID isoLanguage: 'de'
]
{ #category : 'tests' }
LocaleIDTest >> testComparision [
self deny: self germanLocaleID equals: self frenchLocaleID.
self assert: self germanLocaleID equals: self germanLocaleID
]
{ #category : 'tests' }
LocaleIDTest >> testFromISOString [
| locale |
locale := LocaleID isoString: 'en-us'.
self
assert: locale isoLanguage equals: 'en';
assert: locale isoCountry equals: 'us'
]
{ #category : 'tests' }
LocaleIDTest >> testFromSingleISOString [
| locale |
locale := LocaleID isoString: 'en'.
self
assert: locale isoLanguage equals: 'en';
assert: locale isoCountry isNil
]
{ #category : 'tests' }
LocaleIDTest >> testHashing [
self assert: self germanLocaleID hash equals: self germanLocaleID hash.
self assert: self frenchLocaleID hash equals: self frenchLocaleID hash
]
{ #category : 'tests' }
LocaleIDTest >> testInstanceCreationWithISOLanguage [
|germanLocale|
germanLocale := LocaleID isoLanguage: 'de'.
self assert: germanLocale isoLanguage equals: 'de'
]
{ #category : 'tests' }
LocaleIDTest >> testInstanceCreationWithISOLanguageAndCountry [
|locale|
locale := LocaleID isoLanguage: 'zh' isoCountry: 'CN'.
self
assert: locale isoLanguage equals: 'zh';
assert: locale isoCountry equals: 'CN'
]
{ #category : 'tests' }
LocaleIDTest >> testPosixNameConversion [
| locale |
locale := LocaleID posixName: 'en_us'.
self
assert: locale isoLanguage equals: 'en';
assert: locale isoCountry equals: 'us'
]
{ #category : 'tests' }
LocaleIDTest >> testPrintString [
| locale |
locale := LocaleID isoString: 'en-us'.
self assert: locale printString equals: 'en-us'
]
```
|
```javascript
'use strict';
module.exports = (it, expect, collect) => {
it('should return a new collection with the specified number of items', () => {
const collection = collect([0, 1, 2, 3, 4, 5]);
const chunk = collection.take(3);
expect(chunk.all()).to.eql([0, 1, 2]);
expect(collection.all()).to.eql([0, 1, 2, 3, 4, 5]);
});
it('should take from the end of the collection when passed a negative integer', () => {
const collection = collect([0, 1, 2, 3, 4, 5]);
const chunk = collection.take(-2);
expect(chunk.all()).to.eql([4, 5]);
expect(collection.all()).to.eql([0, 1, 2, 3, 4, 5]);
});
it('should work when the collection is based on an object', () => {
const collection = collect({
name: 'Darwin Nez',
number: 27,
club: 'Liverpool FC',
});
const chunk = collection.take(1);
expect(chunk.all()).to.eql({ name: 'Darwin Nez' });
const chunk2 = collection.take(-1);
expect(chunk2.all()).to.eql({ club: 'Liverpool FC' });
expect(collection.all()).to.eql({
name: 'Darwin Nez',
number: 27,
club: 'Liverpool FC',
});
});
};
```
|
```c++
/*=============================================================================
Use modification and distribution are subject to the Boost Software
path_to_url
Problem:
How to "do the Bind?"
This recipe shows how to implement a function binder, similar to
Boost.Bind based on the Functional module of Fusion.
It works as follows:
'bind' is a global, stateless function object. It is implemented in
fused form (fused_binder) and transformed into a variadic function
object. When called, 'bind' returns another function object, which
holds the arguments of the call to 'bind'. It is, again, implemented
in fused form (fused_bound_function) and transformed into unfused
form.
==============================================================================*/
#include <boost/fusion/functional/invocation/invoke.hpp>
#include <boost/fusion/functional/adapter/unfused.hpp>
#include <boost/fusion/support/deduce_sequence.hpp>
#include <boost/fusion/sequence/intrinsic/at.hpp>
#include <boost/fusion/sequence/intrinsic/front.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/algorithm/transformation/transform.hpp>
#include <boost/fusion/algorithm/transformation/pop_front.hpp>
#include <boost/fusion/algorithm/iteration/fold.hpp>
#include <boost/fusion/view/filter_view.hpp>
#include <boost/functional/forward_adapter.hpp>
#include <boost/functional/lightweight_forward_adapter.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/max.hpp>
#include <boost/mpl/next.hpp>
#include <boost/ref.hpp>
#include <iostream>
#include <typeinfo>
namespace impl
{
namespace fusion = boost::fusion;
namespace traits = boost::fusion::traits;
namespace result_of = boost::fusion::result_of;
namespace mpl = boost::mpl;
using mpl::placeholders::_;
// Placeholders (we inherit from mpl::int_, so we can use placeholders
// as indices for fusion::at, later)
template <int I> struct placeholder : mpl::int_<I> { };
// A traits class to find out whether T is a placeholeder
template <typename T> struct is_placeholder : mpl::false_ { };
template <int I> struct is_placeholder< placeholder<I> > : mpl::true_ { };
template <int I> struct is_placeholder< placeholder<I> & > : mpl::true_ { };
template <int I> struct is_placeholder< placeholder<I> const > : mpl::true_ { };
template <int I> struct is_placeholder< placeholder<I> const & > : mpl::true_ { };
// This class template provides a Polymorphic Function Object to be used
// with fusion::transform. It is applied to the sequence of arguments that
// describes the binding and holds a reference to the sequence of arguments
// from the final call.
template<class FinalArgs> struct argument_transform
{
FinalArgs const & ref_final_args;
public:
explicit argument_transform(FinalArgs const & final_args)
: ref_final_args(final_args)
{ }
// A placeholder? Replace it with an argument from the final call...
template <int Index>
inline typename result_of::at_c<FinalArgs const, Index>::type
operator()(placeholder<Index> const &) const
{
return fusion::at_c<Index>(this->ref_final_args);
}
// ...just return the bound argument, otherwise.
template <typename T> inline T & operator()(T & bound) const
{
return bound;
}
template <typename Signature>
struct result;
template <class Self, typename T>
struct result< Self (T) >
: mpl::eval_if< is_placeholder<T>,
result_of::at<FinalArgs,typename boost::remove_reference<T>::type>,
mpl::identity<T>
>
{ };
};
// Fused implementation of the bound function, the function object
// returned by bind
template <class BindArgs> class fused_bound_function
{
// Transform arguments to be held by value
typedef typename traits::deduce_sequence<BindArgs>::type bound_args;
bound_args fsq_bind_args;
public:
fused_bound_function(BindArgs const & bind_args)
: fsq_bind_args(bind_args)
{ }
template <typename Signature>
struct result;
template <class FinalArgs>
struct result_impl
: result_of::invoke< typename result_of::front<bound_args>::type,
typename result_of::transform<
typename result_of::pop_front<bound_args>::type,
argument_transform<FinalArgs> const
>::type
>
{ };
template <class Self, class FinalArgs>
struct result< Self (FinalArgs) >
: result_impl< typename boost::remove_reference<FinalArgs>::type >
{ };
template <class FinalArgs>
inline typename result_impl<FinalArgs>::type
operator()(FinalArgs const & final_args) const
{
return fusion::invoke( fusion::front(this->fsq_bind_args),
fusion::transform( fusion::pop_front(this->fsq_bind_args),
argument_transform<FinalArgs>(final_args) ) );
}
// Could add a non-const variant - omitted for readability
};
// Find the number of placeholders in use
struct n_placeholders
{
struct fold_op
{
template <typename Sig> struct result;
template <class S, class A, class B> struct result< S(A &,B &) >
: mpl::max<A,B> { };
};
struct filter_pred
{
template <class X> struct apply : is_placeholder<X> { };
};
template <typename Seq>
struct apply
: mpl::next< typename result_of::fold<
fusion::filter_view<Seq,filter_pred>, mpl::int_<-1>, fold_op
>::type>::type
{ };
};
// Fused implementation of the 'bind' function
struct fused_binder
{
template <class Signature>
struct result;
template <class BindArgs,
int Placeholders = n_placeholders::apply<BindArgs>::value>
struct result_impl
{
typedef boost::forward_adapter<fusion::unfused<
fused_bound_function<BindArgs>,!Placeholders>,Placeholders> type;
};
template <class Self, class BindArgs>
struct result< Self (BindArgs) >
: result_impl< typename boost::remove_reference<BindArgs>::type >
{ };
template <class BindArgs>
inline typename result_impl< BindArgs >::type
operator()(BindArgs & bind_args) const
{
return typename result< void(BindArgs) >::type(
fusion::unfused< fused_bound_function<BindArgs>,
! n_placeholders::apply<BindArgs>::value >(bind_args) );
}
};
// The binder's unfused type. We use lightweght_forward_adapter to make
// that thing more similar to Boost.Bind. Because of that we have to use
// Boost.Ref (below in the sample code)
typedef boost::lightweight_forward_adapter< fusion::unfused<fused_binder> > binder;
}
// Placeholder globals
impl::placeholder<0> const _1_ = impl::placeholder<0>();
impl::placeholder<1> const _2_ = impl::placeholder<1>();
impl::placeholder<2> const _3_ = impl::placeholder<2>();
impl::placeholder<3> const _4_ = impl::placeholder<3>();
// The bind function is a global, too
impl::binder const bind = impl::binder();
// OK, let's try it out:
struct func
{
typedef int result_type;
inline int operator()() const
{
std::cout << "operator()" << std::endl;
return 0;
}
template <typename A>
inline int operator()(A const & a) const
{
std::cout << "operator()(A const & a)" << std::endl;
std::cout << " a = " << a << " A = " << typeid(A).name() << std::endl;
return 1;
}
template <typename A, typename B>
inline int operator()(A const & a, B & b) const
{
std::cout << "operator()(A const & a, B & b)" << std::endl;
std::cout << " a = " << a << " A = " << typeid(A).name() << std::endl;
std::cout << " b = " << b << " B = " << typeid(B).name() << std::endl;
return 2;
}
};
int main()
{
func f;
int value = 42;
using boost::ref;
int errors = 0;
errors += !( bind(f)() == 0);
errors += !( bind(f,"Hi")() == 1);
errors += !( bind(f,_1_)("there.") == 1);
errors += !( bind(f,"The answer is",_1_)(12) == 2);
errors += !( bind(f,_1_,ref(value))("Really?") == 2);
errors += !( bind(f,_1_,_2_)("Dunno. If there is an answer, it's",value) == 2);
return !! errors;
}
```
|
```objective-c
//
// Aspia Project
//
// This program is free software: you can redistribute it and/or modify
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//
// along with this program. If not, see <path_to_url
//
#ifndef BASE_SYSTEM_ERROR_H
#define BASE_SYSTEM_ERROR_H
#include "build/build_config.h"
#include <string>
namespace base {
class SystemError
{
public:
#if defined(OS_WIN)
using Code = unsigned long;
#elif defined(OS_POSIX)
using Code = int;
#else
#error Platform support not implemented
#endif
explicit SystemError(Code code);
~SystemError() = default;
SystemError(const SystemError& other) = default;
SystemError& operator=(const SystemError& other) = default;
// Alias for GetLastError() on Windows and errno on POSIX. Avoids having to pull in Windows.h
// just for GetLastError() and DWORD.
static SystemError last();
// Returns an error code.
Code code() const;
// Returns a string description of the error in UTF-8 encoding.
std::string toString();
static std::string toString(Code code);
private:
Code code_;
};
} // namespace base
#endif // BASE_SYSTEM_ERROR_H
```
|
```smalltalk
using Android.App;
using Android.Widget;
using Android.OS;
using Android.Content.PM;
using Android.Views;
namespace SkiaSharpSample
{
[Activity(
MainLauncher = true,
ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges,
WindowSoftInputMode = SoftInput.AdjustPan | SoftInput.StateHidden
)]
public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity
{
}
}
```
|
Wes DeMott is an American political thriller writer who was born in Roseburg, Oregon. He honorably served in the U.S. Navy, is a former FBI agent, private investigator, and has worked as an actor.
Bibliography
Loving Zelda, A Story of Change Reluctantly Told (2011), Admiral House Publishing
The Typhoon Sanction (2011), . Admiral House Publishing
Tortuga Gold, A Mayday Salvage and Rescue Adventure (2011), Admiral House Publishing
Walking K (1998), . 9780965960267. Admiral House
Vapors (1999), , Admiral House
Stiny, (2000) , . Czech translation of Vapors, published by Alpress.
Árnyak (2001), , , Hungarian translation of Vapors, Athenaeum (Hungary).
Фонд (2008), , , 978-5-226-00257-1. Russian translation of Vapors.
The Fund (2004), , . Leisure Books
Heat Sync, (2006), . 9780843955453. Leisure Books
The Fund, audio book (2009) . Books in Motion.
Heat Sync, audio book (2009) . Books in Motion
"Walking K", audio book (2009), . Books in Motion
References
External links
author website
20th-century American novelists
Novelists from Florida
Living people
Novelists from Oregon
Federal Bureau of Investigation agents
American thriller writers
21st-century American novelists
American male novelists
20th-century American male writers
21st-century American male writers
Year of birth missing (living people)
People from Roseburg, Oregon
|
Oxylymma caeruleocincta is a species of beetle in the family Cerambycidae. It was described by Bates in 1885.
References
Rhinotragini
Beetles described in 1885
|
```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 net.grandcentrix.thirtyinch.distinctuntilchanged;
import static org.assertj.core.api.Assertions.*;
import net.grandcentrix.thirtyinch.TiView;
import org.junit.*;
/**
* Testing {@link DistinctUntilChanged} annotation via {@link DistinctUntilChangedInterceptor}
* requires interfaces extending {@link TiView}.
*/
public class DistinctUntilChangedTest {
private class CountWrapper {
private int mCalled = 0;
public void call() {
mCalled++;
}
public int getCalled() {
return mCalled;
}
}
/**
* This class doesn't have a good hashcode method
*/
private class BadHashObject {
private final String mTest;
public BadHashObject(final String test) {
mTest = test;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final BadHashObject that = (BadHashObject) o;
return mTest != null ? mTest.equals(that.mTest) : that.mTest == null;
}
@Override
public int hashCode() {
return 42;
}
}
/**
* This class doesn't have a good equals method
*/
private class BadEqualsObject {
private final String mTest;
public BadEqualsObject(final String test) {
mTest = test;
}
@SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
@Override
public boolean equals(final Object o) {
return true;
}
@Override
public int hashCode() {
return mTest != null ? mTest.hashCode() : 0;
}
}
private interface TestViewHash extends TiView {
@DistinctUntilChanged(comparator = HashComparator.class)
void annotatedMethod(Object o);
}
private interface TestViewEquals extends TiView {
@DistinctUntilChanged(comparator = EqualsComparator.class)
void annotatedMethod(Object o);
}
/**
* Using {@link EqualsComparator} should work on well defined objects.
*/
@Test
public void testDistinctUntilChangedEquals() throws Exception {
DistinctUntilChangedInterceptor interceptor = new DistinctUntilChangedInterceptor();
final CountWrapper counter = new CountWrapper();
final TestViewEquals testView = new TestViewEquals() {
@Override
public void annotatedMethod(final Object o) {
counter.call();
}
};
final TestViewEquals testViewWrapped = interceptor.intercept(testView);
testViewWrapped.annotatedMethod("test");
testViewWrapped.annotatedMethod("test");
testViewWrapped.annotatedMethod("test2");
assertThat(counter.getCalled()).isEqualTo(2);
}
/**
* Using {@link HashComparator} should work on well defined objects.
*/
@Test
public void testDistinctUntilChangedHash() throws Exception {
DistinctUntilChangedInterceptor interceptor = new DistinctUntilChangedInterceptor();
final CountWrapper counter = new CountWrapper();
final TestViewHash testView = new TestViewHash() {
@Override
public void annotatedMethod(final Object o) {
counter.call();
}
};
final TestViewHash testViewWrapped = interceptor.intercept(testView);
testViewWrapped.annotatedMethod("test");
testViewWrapped.annotatedMethod("test");
testViewWrapped.annotatedMethod("test2");
assertThat(counter.getCalled()).isEqualTo(2);
}
/**
* test custom equals implementation (always equals)
*/
@Test
public void testEqualsComparison_badEquals() throws Exception {
DistinctUntilChangedInterceptor interceptor = new DistinctUntilChangedInterceptor();
final CountWrapper counter = new CountWrapper();
final TestViewEquals testView = new TestViewEquals() {
@Override
public void annotatedMethod(final Object o) {
counter.call();
}
};
final TestViewEquals testViewWrapped = interceptor.intercept(testView);
testViewWrapped.annotatedMethod(new BadEqualsObject("test"));
testViewWrapped.annotatedMethod(new BadEqualsObject("test"));
testViewWrapped.annotatedMethod(new BadEqualsObject("test2"));
assertThat(counter.getCalled()).isEqualTo(1);
}
/**
* make sure the equals comparison doesn't use the hash implementation
*/
@Test
public void testEqualsComparison_badHash_works() throws Exception {
DistinctUntilChangedInterceptor interceptor = new DistinctUntilChangedInterceptor();
final CountWrapper counter = new CountWrapper();
final TestViewEquals testView = new TestViewEquals() {
@Override
public void annotatedMethod(final Object o) {
counter.call();
}
};
final TestViewEquals testViewWrapped = interceptor.intercept(testView);
testViewWrapped.annotatedMethod(new BadHashObject("test"));
testViewWrapped.annotatedMethod(new BadHashObject("test"));
testViewWrapped.annotatedMethod(new BadHashObject("test2"));
assertThat(counter.getCalled()).isEqualTo(2);
}
/**
* make sure the hash comparison doesn't use the equals implementation
*/
@Test
public void testHashComparison_badEquals_works() throws Exception {
DistinctUntilChangedInterceptor interceptor = new DistinctUntilChangedInterceptor();
final CountWrapper counter = new CountWrapper();
final TestViewHash testView = new TestViewHash() {
@Override
public void annotatedMethod(final Object o) {
counter.call();
}
};
final TestViewHash testViewWrapped = interceptor.intercept(testView);
testViewWrapped.annotatedMethod(new BadEqualsObject("test"));
testViewWrapped.annotatedMethod(new BadEqualsObject("test"));
testViewWrapped.annotatedMethod(new BadEqualsObject("test2"));
assertThat(counter.getCalled()).isEqualTo(2);
}
/**
* test custom hash implementation (always the same)
*/
@Test
public void testHashComparison_badHash() throws Exception {
DistinctUntilChangedInterceptor interceptor = new DistinctUntilChangedInterceptor();
final CountWrapper counter = new CountWrapper();
final TestViewHash testView = new TestViewHash() {
@Override
public void annotatedMethod(final Object o) {
counter.call();
}
};
final TestViewHash testViewWrapped = interceptor.intercept(testView);
testViewWrapped.annotatedMethod(new BadHashObject("test"));
testViewWrapped.annotatedMethod(new BadHashObject("test"));
testViewWrapped.annotatedMethod(new BadHashObject("test2"));
assertThat(counter.getCalled()).isEqualTo(1);
}
}
```
|
```java
Java Virtual Machine
Altering format string output by changing a format specifier's `argument_index`
Using `synchronized` statements
Detect or prevent integer overflow
Do not perform bitwise and arithmetic operations on the same data
```
|
```yaml
common:
filter: TOOLCHAIN_HAS_NEWLIB == 1
arch_exclude: posix
tags:
- clib
- newlib
integration_platforms:
- mps2/an521/cpu0
- qemu_x86
tests:
libraries.libc.newlib.thread_safety:
min_ram: 64
libraries.libc.newlib.thread_safety.stress:
extra_configs:
- CONFIG_NEWLIB_THREAD_SAFETY_TEST_STRESS=y
slow: true
min_ram: 192
libraries.libc.newlib.thread_safety.userspace:
extra_args: CONF_FILE=prj_userspace.conf
filter: CONFIG_ARCH_HAS_USERSPACE
tags:
- userspace
min_ram: 64
libraries.libc.newlib.thread_safety.userspace.stress:
extra_args: CONF_FILE=prj_userspace.conf
extra_configs:
- CONFIG_NEWLIB_THREAD_SAFETY_TEST_STRESS=y
- CONFIG_NEWLIB_LIBC_ALIGNED_HEAP_SIZE=8192
filter: CONFIG_ARCH_HAS_USERSPACE
slow: true
tags:
- userspace
min_ram: 192
timeout: 120
platform_exclude: acrn_ehl_crb # See #61129
libraries.libc.newlib_nano.thread_safety:
extra_configs:
- CONFIG_NEWLIB_LIBC_NANO=y
filter: CONFIG_HAS_NEWLIB_LIBC_NANO
min_ram: 64
libraries.libc.newlib_nano.thread_safety.stress:
extra_configs:
- CONFIG_NEWLIB_THREAD_SAFETY_TEST_STRESS=y
- CONFIG_NEWLIB_LIBC_NANO=y
filter: CONFIG_HAS_NEWLIB_LIBC_NANO
slow: true
min_ram: 192
libraries.libc.newlib_nano.thread_safety.userspace:
extra_args: CONF_FILE=prj_userspace.conf
extra_configs:
- CONFIG_NEWLIB_LIBC_NANO=y
filter: CONFIG_ARCH_HAS_USERSPACE and CONFIG_HAS_NEWLIB_LIBC_NANO
tags:
- userspace
min_ram: 64
libraries.libc.newlib_nano.thread_safety.userspace.stress:
extra_args: CONF_FILE=prj_userspace.conf
extra_configs:
- CONFIG_NEWLIB_THREAD_SAFETY_TEST_STRESS=y
- CONFIG_NEWLIB_LIBC_NANO=y
- CONFIG_NEWLIB_LIBC_ALIGNED_HEAP_SIZE=2048
filter: CONFIG_ARCH_HAS_USERSPACE and CONFIG_HAS_NEWLIB_LIBC_NANO
slow: true
tags:
- userspace
min_ram: 192
timeout: 120
platform_exclude: acrn_ehl_crb # See #61129
```
|
```lua
--[[your_sha256_hash------------
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
your_sha256_hash--------------]]
local BBoxNorm, parent = torch.class('nn.BBoxNorm','nn.Module')
function BBoxNorm:__init(mean, std)
assert(mean and std)
parent.__init(self)
self.mean = mean
self.std = std
end
function BBoxNorm:updateOutput(input)
assert(input:dim() == 2 and input:size(2) % 4 == 0)
self.output:set(input)
if not self.train then
if not input:isContiguous() then
self._output = self._output or input.new()
self._output:resizeAs(input):copy(input)
self.output = self._output
end
local output = self.output:view(-1, 4)
output:cmul(self.std:expandAs(output)):add(self.mean:expandAs(output))
end
return self.output
end
function BBoxNorm:updateGradInput(input, gradOutput)
assert(self.train, 'cannot updateGradInput in evaluate mode')
self.gradInput = gradOutput
return self.gradInput
end
function BBoxNorm:clearState()
nn.utils.clear(self, '_output')
return parent.clearState(self)
end
```
|
Lee Hun Chung (이헌정) (born 1967 in Seoul, South Korea) is a South Korean artist. He is famous for working with ceramics and concrete in a wide range from small objects to large installations. Lee creates modern day pieces using techniques and colors dating back to the Joseon Dynasty. Lee attended Hong-ik University in Seoul from 1986–1991 with a BFA in ceramic sculpture. He continued his education throughout San Francisco and Korea, and getting a PH.D in architecture from Kyung-Won University in Gyeonggi-do, South Korea.
Work
SOLO EXHIBITION
2010 LeeHwaik gallery, Seoul, Korea
2009 MSU Copeland Gallery, Bozeman, U.S.A
2009 On the Table, Daegu, Korea
2008 Seomi & tuus Gallery, Seoul, Korea
2007 Park Ryu Sook Gallery, JeJu, Korea
2007 SP Gallery, Seoul, Korea
2006 U-Ri-Gu-Rut RYU, Seoul, Korea
2006 Kangha Museum, Yangpeong
2005 Wong Gallery, Seoul
2004 Gallery Artside, Seoul, Korea
2003 Pack Hye Young Gallery, Seoul, Korea
2002 U-Ri-Gu-Rut RYU, Seoul, Korea
2001 Wong Gallery, Seoul, Korea
2001 U-Ri-Gu-Rut RYU, Seoul, Korea
2000 The Korean Culture & Art Foundation Art Center, Seoul, Korea
2000 Tokonoma Gallery, Geneva, Switzerland
2000 U-Ri-Gu-Rut RYU, Seoul, Korea
1998 Total Museum, Jangheung, Korea
1997 Tho-Dorang, Seoul, Korea
1996 Tho-Art Space, Seoul, Korea
SELECTED GROUP EXHIBITION
2015 Korea now! Design, Craft, Fashion and Graphic Design in Korea exhibition, Musée des Arts décoratifs, Paris, France
2015 Living In Art II, Connect, Seomi International, Los Angeles, CA, USA
2015 Living In Art, Seomi International, Los Angeles, CA, USA.
2014 Korean Contemporary Design: EDWARD TYLER NAHEM FINE ART/ NEW YORK, NY, USA
2011 Poetry in Clay: Korean Buncheong Ceramics from Leeum, Samsung Museum of Art, The Metropolitan Museum of Art, New York
2010 Contemporary Korean Design Show, R20th Gallery, New York, U.S.A
2010 Pagus 21.5, Boutique Monaco Museum, Seoul, Korea
2010 Design Miami Basel, Miami, U.S.A
2009 Sulwha cultural exhibition, Kring, Seoul, Korea
2009 Hongik art/design festival, Hongik Univ. Contemporary Museum, Seoul, Korea
2009 Design High, Seomi & tuus Gallery, Seoul, Korea
2009 Design Miami Basel, Basel, Switzerland
2009 Gyeonggi Annual Project Contemporary Ceramic Art, Gyeonggi Museum of Modern Art, Ansan
2009 Insa Art Center CLIO 'Cosmetic Jam', Seoul, Korea
2009 Gallery Idm "The Party with Ceramic" Busan, Korea
2008 Daegu Textile Art Documenta, Daegu Arts & Culture Center, Daegu, Korea
2008 Yangpyeong Eco Art Festival_Yangpyeong Project
2008 The 2nd China Changchun International Sculpture
2007 Suwon Hwaseong Fortress Theatre Festival, Installation Art, Suwon
2006 Melbourne Art Fair, Royal Exhibition Building, Melbourne
Clayarch Gimhae Museum, Gimhae New York S.O.F.A., Regiment Armory, New York
2005 From Korea Function &Object D'Art, Hillside Terrace, Tokyo,
World Trade Art Gallery, New York, Mille Plateaux, Paris
E-MOMM, E-Wha Womans University A-dong Museum, Seoul
The Beauty of Korean, Korean Embassy of Venezuela, Venezuela
2004 Looking at the Atelier, Insa art center, Seoul
Sinawi Exhibition, Insa Art Center, Seoul
2004 International Exchange Exhibition of The Korean Society of Basic Design & Art,
Kukmin Univ., Seoul
Melbourne Art Fair, Royal Exhibition Building, Melbourne, Australia
2003 San Francisco International Art Exposition, Park-Ryu_Sook Gallery, CA, U.S.A.
Park-Ryu_Sook Gallery the 20th Anniversary Exhibition, Seoul
2002 Melbourne Art Fair, Royal Exhibition Building, Melbourne, Australia
Pusan International Art Fair, Bexco, Pusan
Korean Print Fair, Seoul Arts Center, Seoul
Korean-Japan craft Exhibition, Sagan Gallery, Seoul
Artists at Art Fair, Parkryusook Gallery, Seoul
2001 Horizon of Crafts, Korean Craft Museum, Chongju
Archie Bray Foundation 50th Anniversary Clay odyssey Invitation Artist Show,
Archie Bray Center, Montana, U.S.A.
Ban-Ban, The Richmond Art Center, Richmond, U.S.A
The Ware for Gift, U-Ri-Gu-Rut RYU, Seoul, Korea
Spring Ware, Korean Craft Promotion Foundation, Seoul, Korea
Ceramic with Flower, Kumgang Art shop, Daecheon
The Ware for Spring, U-Ri-Gu-Rut RYU, Seoul, Korea
2000 Morasai, Sagan Gallery, Seoul, Korea
The 6th Seoul Print Art Fair, Seoul Metropolitan Museum of Art, Seoul, Korea
The Rice cake with Vessel, U-Ri-Gu-Rut RYU, Seoul, Korea
Seoul Living Design Fair, Coex, Seoul
Melbourne Art Fair, Royal Exhibition Building, Melbourne, Australia
Millennium Christmas Exhibition, the makers Gallery, Seoul, Korea
1999 Wares for The Traditional New Year, Park Ryu Sook Gallery, Seoul, Korea
Wares for The Spring, Galleria Department Store Oasis Hall, Seoul, Korea
Ban-Ban, The Korean Culture & Art Foundation Art Center, Seoul, Korea
Korea and Japan Ceramic Exhibition, NHK Gallery, Osaka, Japan
Craft Festival-For Weeding, Gana Art Space, Seoul, Korea
Gift for Full Moon Day, U-Ri-Gu-Rut Ryu, Seoul, Korea
International Ceramic Expo. Art Fair, Seoul Art Center, Seoul, Korea
Bosigi Exhibition, U-Ri-Gu-Rut Ryu, Seoul, Korea
The Ware Around Us, Kais Gallery, Seoul, Korea
1998 The Exhibition by Hong-Ik ceramic artist Association,
The Korean Culture & Art Foundation Art Center, Seoul, Korea
The Warm ware around Us, Sinsegae Gana Art, Seoul, Korea
The Wild Flower around Us, Gana Art Space, Seoul, Korea
The Letter, Gallery Mokumto, Seoul, Korea
Korean Ceramic Table-Ware for Dessert, Park Ryu Sook Gallery, Seoul, Korea
Korean ware, Inter Continental Hotel Lobby, Seoul, Korea
1997 Spiritual of The Clay, Walkerhill Museum, Seoul, Korea
Archie Bray Foundation Invitation Artist Show, Archie Bray Center, Montana, U.S.A.
The Exhibition by Hong-Ik ceramic artist Association, Moonhwa Newspaper Museum, Seoul, Korea
Joyful Ceramic, Tho-Art Space, Seoul, Korea
The 4th Tho-Ceramic Contest, Hyundai Art Gallery, Seoul, Korea
1996 Jinro International Ceramic Art Exhibition, Hangaram Museum, Seoul, Korea
San Francisco Art Institute M.F.A. Graduate Show, Fort Mason Gallery, San Francisco, U.S.A
1995 Seoul Contemporary Ceramic Art Biennale, Seoul Metropolitan Museum of art, Seoul, Korea
1994 San Francisco Art Institute M.F.A. Spring Show, Mabean Gallery, San Francisco, U.S.A
Korean American Art Festival, Luggage Store Gallery, San Francisco, U.S.A
1992 25×25×25, Dangong Gallery, Choi Gallery, Karam Culture Center, Seoul. Daegu, Korea
1991 Oceah, sonamoo Gallery, Seoul, Korea
Young Artist of The 3rd Gallery, The 3rd Gallery, Seoul, Korea
1990 Space Behind The Wall, The 3rd Gallery, Seoul, Korea
FAIRS
2015 Design Miami/Basel, Switzerland
2014 FOG, San Francisco, CA, USA
2014 Collective, New York City, NY, USA
2014 The Salon, New York City, NY, USA
2013 Design Miami/ Basel, Basel Design Days Dubai, Dubai
2012 Design Miami/, Miami, FL
2012 PAD, Pavilion of Art & Design, London
2012 Design Miami/ Basel, Basel, Switzerland
2012 Design Days Dubai, Dubai
2011 Design Miami/, Miami, FL
2011 Design Miami/ Basel, Basel, Switzerland
2010 Design Miami/Basel Miami, FL
2010 Design Miami/ Basel, Switzerland
2006 Melbourne Art Fair, Royal Exhibition Building, Melbourne
2004 Melbourne Art Fair, Royal Exhibition Building, Melbourne
2002 Melbourne Art Fair, Royal Exhibition Building, Melbourne
2002 Busan International Art Fair, Bexco, Busan
2000 Seoul Living Design Fair, Coex, Seoul
SELECTED COLLECTIONS
Archie Bray Foundation Center, Montana, USA
Boleslawiec Museum, Poland
Dae-yoo Culture Foundation, Seoul, Korea
Haesley Nine Bridge Golf Club, Yeoju, Korea
Jinro Foundation of Culture, Seoul, Korea
Kyung Duk Jin University Museum, China
Niagara Gallery, Melbourne, Australia National Museum of Contemporary Art,
National Museum of Modern and Contemporary Art, Korea, Seoul, Korea
References
External links
Official Website
South Korean artists
Artists from Seoul
1967 births
Living people
|
```python
#
#
# 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.
import unittest
import numpy as np
import paddle
from paddle.base import core
from paddle.incubate.autograd import primapi
paddle.framework.random._manual_program_seed(2023)
def fn(x):
dropout1 = paddle.nn.Dropout(p=0.5)
dropout2 = paddle.nn.Dropout(p=0.6)
y = dropout1(x)
z = dropout2(y)
return z
class TestCompositeCopyOp(unittest.TestCase):
"""This case is set to test copying op process even if some attrs of origin op has been blocked during constructing program."""
def cal_composite(self, inputs):
paddle.enable_static()
core._set_prim_forward_enabled(True)
startup_program = paddle.static.Program()
main_program = paddle.static.Program()
with paddle.static.program_guard(main_program, startup_program):
x = paddle.static.data(
'x', shape=inputs.shape, dtype=str(inputs.dtype)
)
y = fn(x)
blocks = main_program.blocks
fwd_ops = [op.type for op in blocks[0].ops]
# Ensure that dropout in original block
self.assertTrue('dropout' in fwd_ops)
primapi.to_prim(blocks)
fwd_ops_new = [op.type for op in blocks[0].ops]
# Ensure that dropout is not splitted into small ops
self.assertTrue('dropout' in fwd_ops_new)
exe = paddle.static.Executor()
exe.run(startup_program)
res = exe.run(main_program, feed={'x': inputs}, fetch_list=[y])
paddle.disable_static()
core._set_prim_forward_enabled(False)
return res
def test_forward(self):
core._set_prim_forward_blacklist("dropout")
np_data = np.random.random([16, 64, 128, 128]).astype("float32")
tensor_data = paddle.to_tensor(np_data)
expect = fn(tensor_data).numpy()
actual = self.cal_composite(np_data)[0]
assert expect.dtype == actual.dtype
np.testing.assert_allclose(
expect,
actual,
rtol=0,
atol=0,
)
if __name__ == '__main__':
unittest.main()
```
|
```swift
import Foundation
public enum IPInterval {
case IPv4(UInt32), IPv6(UInt128)
}
```
|
```go
package test
import "testing"
import "time"
func TestNumRuns(t *testing.T) {
// Just take up a little time here so it's obvious how a number of runs
// multiplies up the duration (Go's so fast that this is essentially instant otherwise).
time.Sleep(100 * time.Millisecond)
}
```
|
```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\Document;
class GoogleLongrunningOperation extends \Google\Model
{
/**
* @var bool
*/
public $done;
protected $errorType = GoogleRpcStatus::class;
protected $errorDataType = '';
/**
* @var array[]
*/
public $metadata;
/**
* @var string
*/
public $name;
/**
* @var array[]
*/
public $response;
/**
* @param bool
*/
public function setDone($done)
{
$this->done = $done;
}
/**
* @return bool
*/
public function getDone()
{
return $this->done;
}
/**
* @param GoogleRpcStatus
*/
public function setError(GoogleRpcStatus $error)
{
$this->error = $error;
}
/**
* @return GoogleRpcStatus
*/
public function getError()
{
return $this->error;
}
/**
* @param array[]
*/
public function setMetadata($metadata)
{
$this->metadata = $metadata;
}
/**
* @return array[]
*/
public function getMetadata()
{
return $this->metadata;
}
/**
* @param string
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param array[]
*/
public function setResponse($response)
{
$this->response = $response;
}
/**
* @return array[]
*/
public function getResponse()
{
return $this->response;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GoogleLongrunningOperation::class, 'Google_Service_Document_GoogleLongrunningOperation');
```
|
Obadiah Titus (January 20, 1789 – September 2, 1854) was a U.S. Representative from New York.
Biography
Born in what is now Millbrook, Dutchess County, New York, Titus was educated locally and studied law. He was admitted to the bar and commenced practice in the town of Washington, New York. He was also active in farming, and served as Secretary of the Dutchess County Agricultural Society. In addition, Titus was an organizer of the Dutchess County Mutual Insurance Company.
He was active in the New York Militia, and was appointed an ensign in Lieutenant Colonel Benjamin Herrick's Regiment of Light Infantry. During the War of 1812 he was a captain in New York's 141st Infantry Regiment.
Titus served in local offices, including county judge. He served as Sheriff of Dutchess County, New York from 1828 to 1831.
Titus was elected as a Democrat to the Twenty-fifth Congress (March 4, 1837 – March 3, 1839). He was an unsuccessful candidate for reelection in 1838 to the Twenty-sixth Congress. He resumed the practice of law, and was also active in business, including serving as a Vice President of the New York and Albany Railroad.
He died in the town of Washington on September 2, 1854. He was interred in Nine Partners (Friends) Burial Ground in Millbrook.
References
1789 births
1854 deaths
American militia officers
American militiamen in the War of 1812
Democratic Party members of the United States House of Representatives from New York (state)
Sheriffs of Dutchess County, New York
New York (state) state court judges
New York (state) lawyers
Burials in New York (state)
19th-century American politicians
19th-century American judges
19th-century American lawyers
|
```html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<link rel="stylesheet" href="../css/weui.css"/>
<link rel="stylesheet" href="../css/weuix.css"/>
<script src="../js/zepto.min.js"></script>
<script src="../js/zepto.weui.js"></script>
<script src="../js/iscroll-lite.js"></script>
<script>
$(function(){
TagNav('#tagnav',{
type: 'scrollToNext',
curClassName: 'weui-state-active',
index:2
});
$('#t1').tab({
defaultIndex: 0,
activeClass: 'tab-green',
onToggle: function (index) {
console.log('index'+index);
}
})
$('#t2').tab({
defaultIndex: 1,
activeClass: 'tab-red'
})
$('#t3').tab({
defaultIndex:2,
activeClass: 'tab-blue'
})
$('#t4').tab({defaultIndex:1,activeClass:"bg-green"});
$('#t5').tab({defaultIndex:2,activeClass:"bg-red"});
})
</script>
</head>
<body ontouchstart>
<div class="container">
<div class="page-hd">
<h1 class="page-hd-title">
navbar/
</h1>
<p class="page-hd-desc">iscroll-lite.js,,</p>
</div>
<div id="tagnav" class="weui-navigator weui-navigator-wrapper">
<ul class="weui-navigator-list">
<li><a href="javascript:;"></a></li>
<li><a href="javascript:;"></a></li>
<li><a href="javascript:;"></a></li>
<li><a href="javascript:;"></a></li>
<li><a href="javascript:;"></a></li>
<li><a href="javascript:;"></a></li>
<li><a href="javascript:;"></a></li>
<li><a href="javascript:;"></a></li>
<li><a href="javascript:;"></a></li>
<li><a href="javascript:;"></a></li>
<li><a href="javascript:;"></a></li>
<li><a href="javascript:;"></a></li>
<li><a href="javascript:;"></a></li>
<li><a href="javascript:;"></a></li>
<li><a href="javascript:;"></a></li>
</ul>
</div>
<br>
<br>
<div class="weui-tab" id="t1" style="height:44px;">
<div class="weui-navbar">
<div class="weui-navbar__item">
</div>
<div class="weui-navbar__item">
</div>
<div class="weui-navbar__item">
</div>
</div>
</div>
<br>
<div class="weui-tab" id="t2" style="height:44px;">
<div class="weui-navbar">
<div class="weui-navbar__item">
</div>
<div class="weui-navbar__item">
</div>
<div class="weui-navbar__item">
</div>
</div>
</div>
<br>
<div class="weui-tab" id="t3" style="height:44px;">
<div class="weui-navbar">
<div class="weui-navbar__item">
</div>
<div class="weui-navbar__item">
</div>
<div class="weui-navbar__item">
</div>
</div>
</div>
<br>
<div class="weui-tab" style="height:44px;" id="t4">
<div class="weui-tab-nav"> <a href="javascript:" class="weui-navbar__item weui-nav-green"> </a> <a href="javascript:" class="weui-navbar__item weui-nav-green"> </a> <a href="javascript:" class="weui-navbar__item weui-nav-green"> </a> </div>
</div>
<div class="weui-tab" style="height:44px;" id="t5">
<div class="weui-tab-nav"> <a href="javascript:" class="weui-navbar__item weui-nav-red"> </a> <a href="javascript:" class="weui-navbar__item weui-nav-red"> </a> <a href="javascript:" class="weui-navbar__item weui-nav-red"> </a><a href="javascript:" class="weui-navbar__item weui-nav-red"> </a> </div>
</div>
<br>
<br>
<div class="weui-footer weui-footer_fixed-bottom">
<p class="weui-footer__links">
<a href="../index.html" class="weui-footer__link">WeUI</a>
</p>
</div>
</div>
<script>
//4
$(document).on("click", "#show-actions", function() {
$.actions({
title: "",
onClose: function() {
console.log("close");
},
actions: [
{
text: "",
className: "color-primary",
onClick: function() {
$.alert("");
}
},
{
text: "",
className: "color-warning",
onClick: function() {
$.alert("");
}
},
{
text: "",
className: 'color-danger',
onClick: function() {
$.alert("");
}
}
]
});
});
$(document).on("click", "#show-actions-bg", function() {
$.actions({
actions: [
{
text: "",
className: "bg-primary",
},
{
text: "",
className: "bg-warning",
},
{
text: "",
className: 'bg-danger',
} ,{
text: "",
className: 'bg-success',
}
]
});
});
</script>
</body>
</html>
```
|
is one of the Ōsumi Islands in Kagoshima Prefecture, Japan. The island, in area, has a population of 13,178. Access to the island is by hydrofoil ferry (7 or 8 times a day from Kagoshima, depending on the season), slow car ferry (once or twice a day from Kagoshima), or by air to Yakushima Airport (3 to 5 times daily from Kagoshima, once daily from Fukuoka and once daily from Osaka).
Administratively, the whole island is the town of Yakushima. The town also serves neighbouring Kuchinoerabujima. 42% of the island is within the borders of the Yakushima National Park.
Yakushima's electricity is more than 50% hydroelectric, and surplus power has been used to produce hydrogen gas in an experiment by Kagoshima University. The island has been a test site for Honda's hydrogen fuel cell vehicle research. (There are no hydrogen cars stationed on the island but electric cars are run by the municipality.)
World Heritage designation
In 1980, an area of was designated a UNESCO Man and the Biosphere Reserve. In 1993, of wetland at Nagata-hama was designated a Ramsar Site. It is the largest nesting ground for the endangered loggerhead sea turtle in the North Pacific. Yakushima's unique remnant of warm/temperate ancient forest has been a natural World Heritage Site since 1993. In the Wilderness core area () of the World Heritage Site, no record of past tree cutting can be traced.
The island is visited by 300,000 tourists every year.
Geography
Overview
Yakushima is located approximately south of the southern tip of Ōsumi Peninsula in southern Kyushu, or south of Kagoshima. The Vincennes Strait (Yakushima Kaikyō) separates it from the nearby island of Tanegashima, which is home to the Japanese Space Centre. Periodic rocket launches from Tanegashima can clearly be seen from Yakushima.
The bedrock of the island is granite, and as such it hosts no active volcanoes. It has an area of approximately . The island is roughly circular in shape, with a circumference of and a diameter of . The highest elevations on the island are , with a height of , and , with a height of above sea level; however, Yakushima has another 30 peaks of over in height. There are numerous hot springs on the island.
Settlements
Major settlements of the island, composing Yakushima Municipality, are the port towns of Anbō and Miyanoura. Between them is located Yakushima Airport. Other settlements are the coastal villages of Hiranai, Kuriobashi, Nagata, Okonotaki and the abandoned forest village of Kosugidani. Among the localities, there are the gorges of Shiratani Unsui, Arakawa, Yakushima Airport, Kigensugi and Yakusugi.
History
Yakushima has been settled since at least the Jōmon period. It was first mentioned in written documents of the Chinese Sui dynasty of the 6th century, and in the Japanese Shoku Nihongi in an entry dated 702 CE. It formed part of ancient Tane Province. It was often mentioned in the diaries of travelers between Tang dynasty China and Nara period Japan.
During the Edo period, Yakushima was ruled by the Shimazu clan of the Satsuma Domain and was considered part of Ōsumi Province. Following the Meiji restoration, the island has been administered as part of Kagoshima Prefecture.
In 2017, Yakushima was struck by Typhoon Noru causing one death.
Demographics and economics
The population of Yakushima reached a peak in 1960 with 24,010 inhabitants. It thereafter declined until about 1995, but has subsequently stabilized at just over 13,000 inhabitants.
Traditionally, the economic mainstays of the population were forestry and the export of wood products (principally cedar roof shingles), and commercial fishing. Cultivation of oranges and tea, the distilling of shōchū, and tourism are now the main sources of income.
Flora and fauna
Yakushima contains one of the largest tracts of existing Nansei Islands subtropical evergreen forests, an endangered habitat ecoregion. The only large animals indigenous to the island are red-bottomed macaques (Yakushima macaque) and a variety of sika deer (yakushika). The Japanese raccoon dog is also a common animal, but is not native to the island. Japanese weasels (Mustela itatsi) may also be seen from time to time. The island is a spawning ground for migratory loggerhead turtles, and dolphins are to be found offshore. The coastal areas have coral reefs in places, although to a much lesser extent than are found farther south in the islands of Okinawa. The island, along with neighbouring Tanegashima, has been recognised as an Important Bird Area (IBA) by BirdLife International because they support populations of Japanese wood pigeons, Ryukyu green pigeons and Ryukyu robins.
Yakushima is famous for its lush vegetation. Most of the island has at one time or another been logged (dating back at least to the early Edo period), but has been extensively replanted and reseeded since logging ended in the late 1960s, at which time a conservation regime was established. In addition to this secondary forest, there are some remaining areas of primary forest, composed mainly of a variety of Cryptomeria japonica, or Japanese cedar, known as , the best known single example of which is named the , as its age is estimated to date to at least the Jōmon period of Japanese history, 2300 years ago. In addition, the island lists over 50 varieties of endemic flower, notably rhododendrons, and hundreds of rare endemic Bryophyta, as well as a number of endemic trees.
Climate
Yakushima has a humid subtropical climate (Köppen climate classification Cfa) with hot, humid summers and mild winters. Precipitation is extremely heavy, with at least in each month and as much as in June alone. Yakushima is Japan's wettest place, and annual precipitation in Yakushima is one of the world's highest at . It is said by the locals to rain "35 days a month". There are drier periods in autumn and winter, while the heaviest downpours occur in spring and summer, often accompanied by landslides. It is the southernmost place in Japan where there is snow in the mountains, often for months, while the ocean temperature is never below
Pollution
According to a disputed theory, airborne pollutants from the People's Republic of China may have affected Yakushima white pine in the forest on the island. The scientific results have been published in a 2009 paper.
Transportation
Airport
Yakushima Airport (KUM) is the only airport serving the island. Scheduled commercial flights are operated by Japan Air Commuter, a JAL subsidiary. As of 2019, the runway was in the process of extension from 1500m to 2000m, which would allow jet aircraft to operate and a wider range of destinations to be served.
Ferries
Tanegayaku High Speed Ship Jetfoil "Toppy" "Rocket"
Kagoshima Port, Minato Pier, Kagoshima City- Ibusuki Port ( Ibusuki City ) in Tanegashima, Nishinoomote Port ( Nishinoomote City ), Yakushima, Miyanoura Port or Anbo Port.
Other
Orita Kisen “Ferry Yakushima 2”
Kagoshima Minato-ku Minami Pier-Yakushima / Miyanoura Port
Kagoshima Merchant Ship & Shinyashiki Shoji Ferry "Haibisukasu" [40]
Taniyama Port 2 Ward (Kagoshima City)-Tanegashima Nishinoomote Port (Nishinoomote City)-Yakushima Miyanoura Port
Forward (Taniyamako onset) after arriving in Nishinoomote Port at night Todokohaku, the next morning to go to Miyanoura Port [41] .
Yakushima Town "Ferry Taiyo"
Kuchinoerabujima -Yakushima / Miyanoura Port-Tanegashima / Shimama Port ( Minamitanemachi )
Buses
The number of bus routes is relatively high on both Tanegashima and Yakushima. They operate from morning until evening. However, the frequency of buses on each route is low, so careful planning is required.
Cars
There are several rental car companies. The northwestern road, called the Western Forest Road, is a narrow road on which it is difficult for cars to pass each other. The road is often closed due to steep curves, slopes, and occasional landslides. Gasoline prices on the island are significantly higher than on the Japanese mainland.
Railway
The last operating narrow gauge (762mm gauge) timber railway in Japan is on the island but it is freight only. Several other lines did operate but are now closed. The track is used by some hikers as a path but this can be dangerous as the line is very much still in operation.
Onsen
There are several onsen (hot springs) on Yakushima.
Onoma Onsen
Yakushima Onsen
Hirauchi underwater hot spring
Yudomari Onsen
Oura hot spring - originally a hot spring, but it's now a communal bath with boiling spring water
Yodogawa Onsen
Yunoko no Yu
Jomon no Yado Manten - outpatient Bathing
In popular culture
The forests of Yakushima inspired the forest setting in Hayao Miyazaki's film Princess Mononoke.
Yakushima is the inspiration behind the forest of Dremuchij in Metal Gear Solid 3: Snake Eater.
Fictional characters Jun and Jin Kazama of Tekken lived on Yakushima.
Eiji Miyake, the protagonist of David Mitchell's novel number9dream, is from Yakushima. Parts of the novel take place in the narrator's childhood on the island.
The island also featured prominently in the 1996 film Rebirth of Mothra. In the movie The Young Mothra swims to the island to transform into the new and more powerful Mothra taking its life essence and new powers from the eternal forest.
The protagonists of Atlus's role-playing video game, Persona 3, visit Yakushima at the start of summer break.
The first two episodes of the 2005 TV show, Kamen Rider Hibiki, take place primarily on Yakushima.
The landscapes in Oni: Thunder God's Tale are inspired by Yakushima's forests.
See also
Ernest Henry Wilson - Wilson stump
List of Special Places of Scenic Beauty, Special Historic Sites and Special Natural Monuments
List of World Heritage Sites in Japan
List of national parks of Japan
Ramsar sites in Japan
Notes
References
Witham, Clive. Yakushima: A Yakumonkey Guide. Siesta Press. (2009)
External links
UNESCO World Heritage Site Entry
Ōsumi Islands
Islands of Kagoshima Prefecture
Biosphere reserves of Japan
Cultural Landscapes of Japan
Ramsar sites in Japan
Tourist attractions in Kagoshima Prefecture
World Heritage Sites in Japan
Important Bird Areas of the Nansei Islands
|
The 92 KQRS Morning Show (also known as the KQ Morning Crew) is a popular, long-running radio morning drive time show originating from KQRS-FM in Minneapolis, Minnesota. From the 1990s into the early 2000s, it was one of the highest-rated morning shows in the U.S.
The show was hosted by Tom Barnard for 37 years, retiring at the end of 2022. Barnard was replaced by Steve Gorman of the rock group The Black Crows. Brian Zepp, Candice Wheeler and Tony Lee are also heard on the show.
Controversy
Asian-Americans
On June 9, 1998, Barnard was reading a news item about a Hmong girl who had killed her newborn son. The crew made several derisive remarks. In particular, Barnard stated that Hmongs should "assimilate or hit the goddamn road." and, in response to his reading of the $10,000 fine levied against the girl, "That's a lot of egg rolls." KQRS weathered protests from the Asian-American community and eventually issued a public apology in addition to making several PR-building concessions to the community. In a related concession, Tony Lee's stereotypical character "Tak" and his segment, "A Talk with Tak" was removed from the show.
Native Americans
In September 2007, Bernard made comments about the Minnesota Chippewa and Sioux tribes. The American Indian Alliance that raised concerns from the tribes. The tribes mounted several protests throughout October, and the station again issued a public apology.
Footnotes
References
Associated Press (via wire), KQRS morning show host addresses racial controversy, Minnesota Daily, October 21, 1998. Retrieved May 29, 2008.
Collins, Terry, KQRS remarks upset Indian leaders, Star Tribune, October 29, 2007. Retrieved May 28, 2008.
Evans, Melanie, 'Free speech' wins in KQRS case, Minnesota Daily, November 15, 1998. Retrieved May 27, 2008.
Lambert. Brian, Tommy B: King of All Radio, The Rake, October 29, 2007. Retrieved May 29, 2008.
––, Howard's End, St. Paul Pioneer Press, April 11, 1999. Retrieved May 29, 2008.
National Association of Broadcasters (NAB), 2006 Large Market Personality of the Year Winner: Tom Barnard, KQRS, 2006. Retrieved May 29, 2008.
Silverstein, Tom, Packer Notes: Favre ponders lawsuit, Milwaukee Journal-Sentinel, December 4, 1997. Retrieved May 29, 2008.
Minneapolis–Saint Paul
American radio programs
|
```c++
// Protocol Buffers - Google's data interchange format
// path_to_url
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// from google3/strings/strutil.cc
#include <google/protobuf/stubs/strutil.h>
#include <errno.h>
#include <float.h> // FLT_DIG and DBL_DIG
#include <limits>
#include <limits.h>
#include <stdio.h>
#include <iterator>
#ifdef _WIN32
// MSVC has only _snprintf, not snprintf.
//
// MinGW has both snprintf and _snprintf, but they appear to be different
// functions. The former is buggy. When invoked like so:
// char buffer[32];
// snprintf(buffer, 32, "%.*g\n", FLT_DIG, 1.23e10f);
// it prints "1.23000e+10". This is plainly wrong: %g should never print
// trailing zeros after the decimal point. For some reason this bug only
// occurs with some input values, not all. In any case, _snprintf does the
// right thing, so we use it.
#define snprintf _snprintf
#endif
namespace google {
namespace protobuf {
inline bool IsNaN(double value) {
// NaN is never equal to anything, even itself.
return value != value;
}
// These are defined as macros on some platforms. #undef them so that we can
// redefine them.
#undef isxdigit
#undef isprint
// The definitions of these in ctype.h change based on locale. Since our
// string manipulation is all in relation to the protocol buffer and C++
// languages, we always want to use the C locale. So, we re-define these
// exactly as we want them.
inline bool isxdigit(char c) {
return ('0' <= c && c <= '9') ||
('a' <= c && c <= 'f') ||
('A' <= c && c <= 'F');
}
inline bool isprint(char c) {
return c >= 0x20 && c <= 0x7E;
}
// your_sha256_hash------
// StripString
// Replaces any occurrence of the character 'remove' (or the characters
// in 'remove') with the character 'replacewith'.
// your_sha256_hash------
void StripString(string* s, const char* remove, char replacewith) {
const char * str_start = s->c_str();
const char * str = str_start;
for (str = strpbrk(str, remove);
str != NULL;
str = strpbrk(str + 1, remove)) {
(*s)[str - str_start] = replacewith;
}
}
// your_sha256_hash------
// StringReplace()
// Replace the "old" pattern with the "new" pattern in a string,
// and append the result to "res". If replace_all is false,
// it only replaces the first instance of "old."
// your_sha256_hash------
void StringReplace(const string& s, const string& oldsub,
const string& newsub, bool replace_all,
string* res) {
if (oldsub.empty()) {
res->append(s); // if empty, append the given string.
return;
}
string::size_type start_pos = 0;
string::size_type pos;
do {
pos = s.find(oldsub, start_pos);
if (pos == string::npos) {
break;
}
res->append(s, start_pos, pos - start_pos);
res->append(newsub);
start_pos = pos + oldsub.size(); // start searching again after the "old"
} while (replace_all);
res->append(s, start_pos, s.length() - start_pos);
}
// your_sha256_hash------
// StringReplace()
// Give me a string and two patterns "old" and "new", and I replace
// the first instance of "old" in the string with "new", if it
// exists. If "global" is true; call this repeatedly until it
// fails. RETURN a new string, regardless of whether the replacement
// happened or not.
// your_sha256_hash------
string StringReplace(const string& s, const string& oldsub,
const string& newsub, bool replace_all) {
string ret;
StringReplace(s, oldsub, newsub, replace_all, &ret);
return ret;
}
// your_sha256_hash------
// SplitStringUsing()
// Split a string using a character delimiter. Append the components
// to 'result'.
//
// Note: For multi-character delimiters, this routine will split on *ANY* of
// the characters in the string, not the entire string as a single delimiter.
// your_sha256_hash------
template <typename ITR>
static inline
void SplitStringToIteratorUsing(const string& full,
const char* delim,
ITR& result) {
// Optimize the common case where delim is a single character.
if (delim[0] != '\0' && delim[1] == '\0') {
char c = delim[0];
const char* p = full.data();
const char* end = p + full.size();
while (p != end) {
if (*p == c) {
++p;
} else {
const char* start = p;
while (++p != end && *p != c);
*result++ = string(start, p - start);
}
}
return;
}
string::size_type begin_index, end_index;
begin_index = full.find_first_not_of(delim);
while (begin_index != string::npos) {
end_index = full.find_first_of(delim, begin_index);
if (end_index == string::npos) {
*result++ = full.substr(begin_index);
return;
}
*result++ = full.substr(begin_index, (end_index - begin_index));
begin_index = full.find_first_not_of(delim, end_index);
}
}
void SplitStringUsing(const string& full,
const char* delim,
vector<string>* result) {
back_insert_iterator< vector<string> > it(*result);
SplitStringToIteratorUsing(full, delim, it);
}
// Split a string using a character delimiter. Append the components
// to 'result'. If there are consecutive delimiters, this function
// will return corresponding empty strings. The string is split into
// at most the specified number of pieces greedily. This means that the
// last piece may possibly be split further. To split into as many pieces
// as possible, specify 0 as the number of pieces.
//
// If "full" is the empty string, yields an empty string as the only value.
//
// If "pieces" is negative for some reason, it returns the whole string
// your_sha256_hash------
template <typename StringType, typename ITR>
static inline
void SplitStringToIteratorAllowEmpty(const StringType& full,
const char* delim,
int pieces,
ITR& result) {
string::size_type begin_index, end_index;
begin_index = 0;
for (int i = 0; (i < pieces-1) || (pieces == 0); i++) {
end_index = full.find_first_of(delim, begin_index);
if (end_index == string::npos) {
*result++ = full.substr(begin_index);
return;
}
*result++ = full.substr(begin_index, (end_index - begin_index));
begin_index = end_index + 1;
}
*result++ = full.substr(begin_index);
}
void SplitStringAllowEmpty(const string& full, const char* delim,
vector<string>* result) {
back_insert_iterator<vector<string> > it(*result);
SplitStringToIteratorAllowEmpty(full, delim, 0, it);
}
// your_sha256_hash------
// JoinStrings()
// This merges a vector of string components with delim inserted
// as separaters between components.
//
// your_sha256_hash------
template <class ITERATOR>
static void JoinStringsIterator(const ITERATOR& start,
const ITERATOR& end,
const char* delim,
string* result) {
GOOGLE_CHECK(result != NULL);
result->clear();
int delim_length = strlen(delim);
// Precompute resulting length so we can reserve() memory in one shot.
int length = 0;
for (ITERATOR iter = start; iter != end; ++iter) {
if (iter != start) {
length += delim_length;
}
length += iter->size();
}
result->reserve(length);
// Now combine everything.
for (ITERATOR iter = start; iter != end; ++iter) {
if (iter != start) {
result->append(delim, delim_length);
}
result->append(iter->data(), iter->size());
}
}
void JoinStrings(const vector<string>& components,
const char* delim,
string * result) {
JoinStringsIterator(components.begin(), components.end(), delim, result);
}
// your_sha256_hash------
// UnescapeCEscapeSequences()
// This does all the unescaping that C does: \ooo, \r, \n, etc
// Returns length of resulting string.
// The implementation of \x parses any positive number of hex digits,
// but it is an error if the value requires more than 8 bits, and the
// result is truncated to 8 bits.
//
// The second call stores its errors in a supplied string vector.
// If the string vector pointer is NULL, it reports the errors with LOG().
// your_sha256_hash------
#define IS_OCTAL_DIGIT(c) (((c) >= '0') && ((c) <= '7'))
inline int hex_digit_to_int(char c) {
/* Assume ASCII. */
assert('0' == 0x30 && 'A' == 0x41 && 'a' == 0x61);
assert(isxdigit(c));
int x = static_cast<unsigned char>(c);
if (x > '9') {
x += 9;
}
return x & 0xf;
}
// Protocol buffers doesn't ever care about errors, but I don't want to remove
// the code.
#define LOG_STRING(LEVEL, VECTOR) GOOGLE_LOG_IF(LEVEL, false)
int UnescapeCEscapeSequences(const char* source, char* dest) {
return UnescapeCEscapeSequences(source, dest, NULL);
}
int UnescapeCEscapeSequences(const char* source, char* dest,
vector<string> *errors) {
GOOGLE_DCHECK(errors == NULL) << "Error reporting not implemented.";
char* d = dest;
const char* p = source;
// Small optimization for case where source = dest and there's no escaping
while ( p == d && *p != '\0' && *p != '\\' )
p++, d++;
while (*p != '\0') {
if (*p != '\\') {
*d++ = *p++;
} else {
switch ( *++p ) { // skip past the '\\'
case '\0':
LOG_STRING(ERROR, errors) << "String cannot end with \\";
*d = '\0';
return d - dest; // we're done with p
case 'a': *d++ = '\a'; break;
case 'b': *d++ = '\b'; break;
case 'f': *d++ = '\f'; break;
case 'n': *d++ = '\n'; break;
case 'r': *d++ = '\r'; break;
case 't': *d++ = '\t'; break;
case 'v': *d++ = '\v'; break;
case '\\': *d++ = '\\'; break;
case '?': *d++ = '\?'; break; // \? Who knew?
case '\'': *d++ = '\''; break;
case '"': *d++ = '\"'; break;
case '0': case '1': case '2': case '3': // octal digit: 1 to 3 digits
case '4': case '5': case '6': case '7': {
char ch = *p - '0';
if ( IS_OCTAL_DIGIT(p[1]) )
ch = ch * 8 + *++p - '0';
if ( IS_OCTAL_DIGIT(p[1]) ) // safe (and easy) to do this twice
ch = ch * 8 + *++p - '0'; // now points at last digit
*d++ = ch;
break;
}
case 'x': case 'X': {
if (!isxdigit(p[1])) {
if (p[1] == '\0') {
LOG_STRING(ERROR, errors) << "String cannot end with \\x";
} else {
LOG_STRING(ERROR, errors) <<
"\\x cannot be followed by non-hex digit: \\" << *p << p[1];
}
break;
}
unsigned int ch = 0;
const char *hex_start = p;
while (isxdigit(p[1])) // arbitrarily many hex digits
ch = (ch << 4) + hex_digit_to_int(*++p);
if (ch > 0xFF)
LOG_STRING(ERROR, errors) << "Value of " <<
"\\" << string(hex_start, p+1-hex_start) << " exceeds 8 bits";
*d++ = ch;
break;
}
#if 0 // TODO(kenton): Support \u and \U? Requires runetochar().
case 'u': {
// \uhhhh => convert 4 hex digits to UTF-8
char32 rune = 0;
const char *hex_start = p;
for (int i = 0; i < 4; ++i) {
if (isxdigit(p[1])) { // Look one char ahead.
rune = (rune << 4) + hex_digit_to_int(*++p); // Advance p.
} else {
LOG_STRING(ERROR, errors)
<< "\\u must be followed by 4 hex digits: \\"
<< string(hex_start, p+1-hex_start);
break;
}
}
d += runetochar(d, &rune);
break;
}
case 'U': {
// \Uhhhhhhhh => convert 8 hex digits to UTF-8
char32 rune = 0;
const char *hex_start = p;
for (int i = 0; i < 8; ++i) {
if (isxdigit(p[1])) { // Look one char ahead.
// Don't change rune until we're sure this
// is within the Unicode limit, but do advance p.
char32 newrune = (rune << 4) + hex_digit_to_int(*++p);
if (newrune > 0x10FFFF) {
LOG_STRING(ERROR, errors)
<< "Value of \\"
<< string(hex_start, p + 1 - hex_start)
<< " exceeds Unicode limit (0x10FFFF)";
break;
} else {
rune = newrune;
}
} else {
LOG_STRING(ERROR, errors)
<< "\\U must be followed by 8 hex digits: \\"
<< string(hex_start, p+1-hex_start);
break;
}
}
d += runetochar(d, &rune);
break;
}
#endif
default:
LOG_STRING(ERROR, errors) << "Unknown escape sequence: \\" << *p;
}
p++; // read past letter we escaped
}
}
*d = '\0';
return d - dest;
}
// your_sha256_hash------
// UnescapeCEscapeString()
// This does the same thing as UnescapeCEscapeSequences, but creates
// a new string. The caller does not need to worry about allocating
// a dest buffer. This should be used for non performance critical
// tasks such as printing debug messages. It is safe for src and dest
// to be the same.
//
// The second call stores its errors in a supplied string vector.
// If the string vector pointer is NULL, it reports the errors with LOG().
//
// In the first and second calls, the length of dest is returned. In the
// the third call, the new string is returned.
// your_sha256_hash------
int UnescapeCEscapeString(const string& src, string* dest) {
return UnescapeCEscapeString(src, dest, NULL);
}
int UnescapeCEscapeString(const string& src, string* dest,
vector<string> *errors) {
scoped_array<char> unescaped(new char[src.size() + 1]);
int len = UnescapeCEscapeSequences(src.c_str(), unescaped.get(), errors);
GOOGLE_CHECK(dest);
dest->assign(unescaped.get(), len);
return len;
}
string UnescapeCEscapeString(const string& src) {
scoped_array<char> unescaped(new char[src.size() + 1]);
int len = UnescapeCEscapeSequences(src.c_str(), unescaped.get(), NULL);
return string(unescaped.get(), len);
}
// your_sha256_hash------
// CEscapeString()
// CHexEscapeString()
// Copies 'src' to 'dest', escaping dangerous characters using
// C-style escape sequences. This is very useful for preparing query
// flags. 'src' and 'dest' should not overlap. The 'Hex' version uses
// hexadecimal rather than octal sequences.
// Returns the number of bytes written to 'dest' (not including the \0)
// or -1 if there was insufficient space.
//
// Currently only \n, \r, \t, ", ', \ and !isprint() chars are escaped.
// your_sha256_hash------
int CEscapeInternal(const char* src, int src_len, char* dest,
int dest_len, bool use_hex, bool utf8_safe) {
const char* src_end = src + src_len;
int used = 0;
bool last_hex_escape = false; // true if last output char was \xNN
for (; src < src_end; src++) {
if (dest_len - used < 2) // Need space for two letter escape
return -1;
bool is_hex_escape = false;
switch (*src) {
case '\n': dest[used++] = '\\'; dest[used++] = 'n'; break;
case '\r': dest[used++] = '\\'; dest[used++] = 'r'; break;
case '\t': dest[used++] = '\\'; dest[used++] = 't'; break;
case '\"': dest[used++] = '\\'; dest[used++] = '\"'; break;
case '\'': dest[used++] = '\\'; dest[used++] = '\''; break;
case '\\': dest[used++] = '\\'; dest[used++] = '\\'; break;
default:
// Note that if we emit \xNN and the src character after that is a hex
// digit then that digit must be escaped too to prevent it being
// interpreted as part of the character code by C.
if ((!utf8_safe || static_cast<uint8>(*src) < 0x80) &&
(!isprint(*src) ||
(last_hex_escape && isxdigit(*src)))) {
if (dest_len - used < 4) // need space for 4 letter escape
return -1;
sprintf(dest + used, (use_hex ? "\\x%02x" : "\\%03o"),
static_cast<uint8>(*src));
is_hex_escape = use_hex;
used += 4;
} else {
dest[used++] = *src; break;
}
}
last_hex_escape = is_hex_escape;
}
if (dest_len - used < 1) // make sure that there is room for \0
return -1;
dest[used] = '\0'; // doesn't count towards return value though
return used;
}
int CEscapeString(const char* src, int src_len, char* dest, int dest_len) {
return CEscapeInternal(src, src_len, dest, dest_len, false, false);
}
// your_sha256_hash------
// CEscape()
// CHexEscape()
// Copies 'src' to result, escaping dangerous characters using
// C-style escape sequences. This is very useful for preparing query
// flags. 'src' and 'dest' should not overlap. The 'Hex' version
// hexadecimal rather than octal sequences.
//
// Currently only \n, \r, \t, ", ', \ and !isprint() chars are escaped.
// your_sha256_hash------
string CEscape(const string& src) {
const int dest_length = src.size() * 4 + 1; // Maximum possible expansion
scoped_array<char> dest(new char[dest_length]);
const int len = CEscapeInternal(src.data(), src.size(),
dest.get(), dest_length, false, false);
GOOGLE_DCHECK_GE(len, 0);
return string(dest.get(), len);
}
namespace strings {
string Utf8SafeCEscape(const string& src) {
const int dest_length = src.size() * 4 + 1; // Maximum possible expansion
scoped_array<char> dest(new char[dest_length]);
const int len = CEscapeInternal(src.data(), src.size(),
dest.get(), dest_length, false, true);
GOOGLE_DCHECK_GE(len, 0);
return string(dest.get(), len);
}
string CHexEscape(const string& src) {
const int dest_length = src.size() * 4 + 1; // Maximum possible expansion
scoped_array<char> dest(new char[dest_length]);
const int len = CEscapeInternal(src.data(), src.size(),
dest.get(), dest_length, true, false);
GOOGLE_DCHECK_GE(len, 0);
return string(dest.get(), len);
}
} // namespace strings
// your_sha256_hash------
// strto32_adaptor()
// strtou32_adaptor()
// Implementation of strto[u]l replacements that have identical
// overflow and underflow characteristics for both ILP-32 and LP-64
// platforms, including errno preservation in error-free calls.
// your_sha256_hash------
int32 strto32_adaptor(const char *nptr, char **endptr, int base) {
const int saved_errno = errno;
errno = 0;
const long result = strtol(nptr, endptr, base);
if (errno == ERANGE && result == LONG_MIN) {
return kint32min;
} else if (errno == ERANGE && result == LONG_MAX) {
return kint32max;
} else if (errno == 0 && result < kint32min) {
errno = ERANGE;
return kint32min;
} else if (errno == 0 && result > kint32max) {
errno = ERANGE;
return kint32max;
}
if (errno == 0)
errno = saved_errno;
return static_cast<int32>(result);
}
uint32 strtou32_adaptor(const char *nptr, char **endptr, int base) {
const int saved_errno = errno;
errno = 0;
const unsigned long result = strtoul(nptr, endptr, base);
if (errno == ERANGE && result == ULONG_MAX) {
return kuint32max;
} else if (errno == 0 && result > kuint32max) {
errno = ERANGE;
return kuint32max;
}
if (errno == 0)
errno = saved_errno;
return static_cast<uint32>(result);
}
// your_sha256_hash------
// FastIntToBuffer()
// FastInt64ToBuffer()
// FastHexToBuffer()
// FastHex64ToBuffer()
// FastHex32ToBuffer()
// your_sha256_hash------
// Offset into buffer where FastInt64ToBuffer places the end of string
// null character. Also used by FastInt64ToBufferLeft.
static const int kFastInt64ToBufferOffset = 21;
char *FastInt64ToBuffer(int64 i, char* buffer) {
// We could collapse the positive and negative sections, but that
// would be slightly slower for positive numbers...
// 22 bytes is enough to store -2**64, -18446744073709551616.
char* p = buffer + kFastInt64ToBufferOffset;
*p-- = '\0';
if (i >= 0) {
do {
*p-- = '0' + i % 10;
i /= 10;
} while (i > 0);
return p + 1;
} else {
// On different platforms, % and / have different behaviors for
// negative numbers, so we need to jump through hoops to make sure
// we don't divide negative numbers.
if (i > -10) {
i = -i;
*p-- = '0' + i;
*p = '-';
return p;
} else {
// Make sure we aren't at MIN_INT, in which case we can't say i = -i
i = i + 10;
i = -i;
*p-- = '0' + i % 10;
// Undo what we did a moment ago
i = i / 10 + 1;
do {
*p-- = '0' + i % 10;
i /= 10;
} while (i > 0);
*p = '-';
return p;
}
}
}
// Offset into buffer where FastInt32ToBuffer places the end of string
// null character. Also used by FastInt32ToBufferLeft
static const int kFastInt32ToBufferOffset = 11;
// Yes, this is a duplicate of FastInt64ToBuffer. But, we need this for the
// compiler to generate 32 bit arithmetic instructions. It's much faster, at
// least with 32 bit binaries.
char *FastInt32ToBuffer(int32 i, char* buffer) {
// We could collapse the positive and negative sections, but that
// would be slightly slower for positive numbers...
// 12 bytes is enough to store -2**32, -4294967296.
char* p = buffer + kFastInt32ToBufferOffset;
*p-- = '\0';
if (i >= 0) {
do {
*p-- = '0' + i % 10;
i /= 10;
} while (i > 0);
return p + 1;
} else {
// On different platforms, % and / have different behaviors for
// negative numbers, so we need to jump through hoops to make sure
// we don't divide negative numbers.
if (i > -10) {
i = -i;
*p-- = '0' + i;
*p = '-';
return p;
} else {
// Make sure we aren't at MIN_INT, in which case we can't say i = -i
i = i + 10;
i = -i;
*p-- = '0' + i % 10;
// Undo what we did a moment ago
i = i / 10 + 1;
do {
*p-- = '0' + i % 10;
i /= 10;
} while (i > 0);
*p = '-';
return p;
}
}
}
char *FastHexToBuffer(int i, char* buffer) {
GOOGLE_CHECK(i >= 0) << "FastHexToBuffer() wants non-negative integers, not " << i;
static const char *hexdigits = "0123456789abcdef";
char *p = buffer + 21;
*p-- = '\0';
do {
*p-- = hexdigits[i & 15]; // mod by 16
i >>= 4; // divide by 16
} while (i > 0);
return p + 1;
}
char *InternalFastHexToBuffer(uint64 value, char* buffer, int num_byte) {
static const char *hexdigits = "0123456789abcdef";
buffer[num_byte] = '\0';
for (int i = num_byte - 1; i >= 0; i--) {
#ifdef _M_X64
// MSVC x64 platform has a bug optimizing the uint32(value) in the #else
// block. Given that the uint32 cast was to improve performance on 32-bit
// platforms, we use 64-bit '&' directly.
buffer[i] = hexdigits[value & 0xf];
#else
buffer[i] = hexdigits[uint32(value) & 0xf];
#endif
value >>= 4;
}
return buffer;
}
char *FastHex64ToBuffer(uint64 value, char* buffer) {
return InternalFastHexToBuffer(value, buffer, 16);
}
char *FastHex32ToBuffer(uint32 value, char* buffer) {
return InternalFastHexToBuffer(value, buffer, 8);
}
static inline char* PlaceNum(char* p, int num, char prev_sep) {
*p-- = '0' + num % 10;
*p-- = '0' + num / 10;
*p-- = prev_sep;
return p;
}
// your_sha256_hash------
// FastInt32ToBufferLeft()
// FastUInt32ToBufferLeft()
// FastInt64ToBufferLeft()
// FastUInt64ToBufferLeft()
//
// Like the Fast*ToBuffer() functions above, these are intended for speed.
// Unlike the Fast*ToBuffer() functions, however, these functions write
// their output to the beginning of the buffer (hence the name, as the
// output is left-aligned). The caller is responsible for ensuring that
// the buffer has enough space to hold the output.
//
// Returns a pointer to the end of the string (i.e. the null character
// terminating the string).
// your_sha256_hash------
static const char two_ASCII_digits[100][2] = {
{'0','0'}, {'0','1'}, {'0','2'}, {'0','3'}, {'0','4'},
{'0','5'}, {'0','6'}, {'0','7'}, {'0','8'}, {'0','9'},
{'1','0'}, {'1','1'}, {'1','2'}, {'1','3'}, {'1','4'},
{'1','5'}, {'1','6'}, {'1','7'}, {'1','8'}, {'1','9'},
{'2','0'}, {'2','1'}, {'2','2'}, {'2','3'}, {'2','4'},
{'2','5'}, {'2','6'}, {'2','7'}, {'2','8'}, {'2','9'},
{'3','0'}, {'3','1'}, {'3','2'}, {'3','3'}, {'3','4'},
{'3','5'}, {'3','6'}, {'3','7'}, {'3','8'}, {'3','9'},
{'4','0'}, {'4','1'}, {'4','2'}, {'4','3'}, {'4','4'},
{'4','5'}, {'4','6'}, {'4','7'}, {'4','8'}, {'4','9'},
{'5','0'}, {'5','1'}, {'5','2'}, {'5','3'}, {'5','4'},
{'5','5'}, {'5','6'}, {'5','7'}, {'5','8'}, {'5','9'},
{'6','0'}, {'6','1'}, {'6','2'}, {'6','3'}, {'6','4'},
{'6','5'}, {'6','6'}, {'6','7'}, {'6','8'}, {'6','9'},
{'7','0'}, {'7','1'}, {'7','2'}, {'7','3'}, {'7','4'},
{'7','5'}, {'7','6'}, {'7','7'}, {'7','8'}, {'7','9'},
{'8','0'}, {'8','1'}, {'8','2'}, {'8','3'}, {'8','4'},
{'8','5'}, {'8','6'}, {'8','7'}, {'8','8'}, {'8','9'},
{'9','0'}, {'9','1'}, {'9','2'}, {'9','3'}, {'9','4'},
{'9','5'}, {'9','6'}, {'9','7'}, {'9','8'}, {'9','9'}
};
char* FastUInt32ToBufferLeft(uint32 u, char* buffer) {
int digits;
const char *ASCII_digits = NULL;
// The idea of this implementation is to trim the number of divides to as few
// as possible by using multiplication and subtraction rather than mod (%),
// and by outputting two digits at a time rather than one.
// The huge-number case is first, in the hopes that the compiler will output
// that case in one branch-free block of code, and only output conditional
// branches into it from below.
if (u >= 1000000000) { // >= 1,000,000,000
digits = u / 100000000; // 100,000,000
ASCII_digits = two_ASCII_digits[digits];
buffer[0] = ASCII_digits[0];
buffer[1] = ASCII_digits[1];
buffer += 2;
sublt100_000_000:
u -= digits * 100000000; // 100,000,000
lt100_000_000:
digits = u / 1000000; // 1,000,000
ASCII_digits = two_ASCII_digits[digits];
buffer[0] = ASCII_digits[0];
buffer[1] = ASCII_digits[1];
buffer += 2;
sublt1_000_000:
u -= digits * 1000000; // 1,000,000
lt1_000_000:
digits = u / 10000; // 10,000
ASCII_digits = two_ASCII_digits[digits];
buffer[0] = ASCII_digits[0];
buffer[1] = ASCII_digits[1];
buffer += 2;
sublt10_000:
u -= digits * 10000; // 10,000
lt10_000:
digits = u / 100;
ASCII_digits = two_ASCII_digits[digits];
buffer[0] = ASCII_digits[0];
buffer[1] = ASCII_digits[1];
buffer += 2;
sublt100:
u -= digits * 100;
lt100:
digits = u;
ASCII_digits = two_ASCII_digits[digits];
buffer[0] = ASCII_digits[0];
buffer[1] = ASCII_digits[1];
buffer += 2;
done:
*buffer = 0;
return buffer;
}
if (u < 100) {
digits = u;
if (u >= 10) goto lt100;
*buffer++ = '0' + digits;
goto done;
}
if (u < 10000) { // 10,000
if (u >= 1000) goto lt10_000;
digits = u / 100;
*buffer++ = '0' + digits;
goto sublt100;
}
if (u < 1000000) { // 1,000,000
if (u >= 100000) goto lt1_000_000;
digits = u / 10000; // 10,000
*buffer++ = '0' + digits;
goto sublt10_000;
}
if (u < 100000000) { // 100,000,000
if (u >= 10000000) goto lt100_000_000;
digits = u / 1000000; // 1,000,000
*buffer++ = '0' + digits;
goto sublt1_000_000;
}
// we already know that u < 1,000,000,000
digits = u / 100000000; // 100,000,000
*buffer++ = '0' + digits;
goto sublt100_000_000;
}
char* FastInt32ToBufferLeft(int32 i, char* buffer) {
uint32 u = i;
if (i < 0) {
*buffer++ = '-';
u = -i;
}
return FastUInt32ToBufferLeft(u, buffer);
}
char* FastUInt64ToBufferLeft(uint64 u64, char* buffer) {
int digits;
const char *ASCII_digits = NULL;
uint32 u = static_cast<uint32>(u64);
if (u == u64) return FastUInt32ToBufferLeft(u, buffer);
uint64 top_11_digits = u64 / 1000000000;
buffer = FastUInt64ToBufferLeft(top_11_digits, buffer);
u = u64 - (top_11_digits * 1000000000);
digits = u / 10000000; // 10,000,000
GOOGLE_DCHECK_LT(digits, 100);
ASCII_digits = two_ASCII_digits[digits];
buffer[0] = ASCII_digits[0];
buffer[1] = ASCII_digits[1];
buffer += 2;
u -= digits * 10000000; // 10,000,000
digits = u / 100000; // 100,000
ASCII_digits = two_ASCII_digits[digits];
buffer[0] = ASCII_digits[0];
buffer[1] = ASCII_digits[1];
buffer += 2;
u -= digits * 100000; // 100,000
digits = u / 1000; // 1,000
ASCII_digits = two_ASCII_digits[digits];
buffer[0] = ASCII_digits[0];
buffer[1] = ASCII_digits[1];
buffer += 2;
u -= digits * 1000; // 1,000
digits = u / 10;
ASCII_digits = two_ASCII_digits[digits];
buffer[0] = ASCII_digits[0];
buffer[1] = ASCII_digits[1];
buffer += 2;
u -= digits * 10;
digits = u;
*buffer++ = '0' + digits;
*buffer = 0;
return buffer;
}
char* FastInt64ToBufferLeft(int64 i, char* buffer) {
uint64 u = i;
if (i < 0) {
*buffer++ = '-';
u = -i;
}
return FastUInt64ToBufferLeft(u, buffer);
}
// your_sha256_hash------
// SimpleItoa()
// Description: converts an integer to a string.
//
// Return value: string
// your_sha256_hash------
string SimpleItoa(int i) {
char buffer[kFastToBufferSize];
return (sizeof(i) == 4) ?
FastInt32ToBuffer(i, buffer) :
FastInt64ToBuffer(i, buffer);
}
string SimpleItoa(unsigned int i) {
char buffer[kFastToBufferSize];
return string(buffer, (sizeof(i) == 4) ?
FastUInt32ToBufferLeft(i, buffer) :
FastUInt64ToBufferLeft(i, buffer));
}
string SimpleItoa(long i) {
char buffer[kFastToBufferSize];
return (sizeof(i) == 4) ?
FastInt32ToBuffer(i, buffer) :
FastInt64ToBuffer(i, buffer);
}
string SimpleItoa(unsigned long i) {
char buffer[kFastToBufferSize];
return string(buffer, (sizeof(i) == 4) ?
FastUInt32ToBufferLeft(i, buffer) :
FastUInt64ToBufferLeft(i, buffer));
}
string SimpleItoa(long long i) {
char buffer[kFastToBufferSize];
return (sizeof(i) == 4) ?
FastInt32ToBuffer(i, buffer) :
FastInt64ToBuffer(i, buffer);
}
string SimpleItoa(unsigned long long i) {
char buffer[kFastToBufferSize];
return string(buffer, (sizeof(i) == 4) ?
FastUInt32ToBufferLeft(i, buffer) :
FastUInt64ToBufferLeft(i, buffer));
}
// your_sha256_hash------
// SimpleDtoa()
// SimpleFtoa()
// DoubleToBuffer()
// FloatToBuffer()
// We want to print the value without losing precision, but we also do
// not want to print more digits than necessary. This turns out to be
// trickier than it sounds. Numbers like 0.2 cannot be represented
// exactly in binary. If we print 0.2 with a very large precision,
// e.g. "%.50g", we get "0.2000000000000000111022302462515654042363167".
// On the other hand, if we set the precision too low, we lose
// significant digits when printing numbers that actually need them.
// It turns out there is no precision value that does the right thing
// for all numbers.
//
// Our strategy is to first try printing with a precision that is never
// over-precise, then parse the result with strtod() to see if it
// matches. If not, we print again with a precision that will always
// give a precise result, but may use more digits than necessary.
//
// An arguably better strategy would be to use the algorithm described
// in "How to Print Floating-Point Numbers Accurately" by Steele &
// White, e.g. as implemented by David M. Gay's dtoa(). It turns out,
// however, that the following implementation is about as fast as
// DMG's code. Furthermore, DMG's code locks mutexes, which means it
// will not scale well on multi-core machines. DMG's code is slightly
// more accurate (in that it will never use more digits than
// necessary), but this is probably irrelevant for most users.
//
// Rob Pike and Ken Thompson also have an implementation of dtoa() in
// third_party/fmt/fltfmt.cc. Their implementation is similar to this
// one in that it makes guesses and then uses strtod() to check them.
// Their implementation is faster because they use their own code to
// generate the digits in the first place rather than use snprintf(),
// thus avoiding format string parsing overhead. However, this makes
// it considerably more complicated than the following implementation,
// and it is embedded in a larger library. If speed turns out to be
// an issue, we could re-implement this in terms of their
// implementation.
// your_sha256_hash------
string SimpleDtoa(double value) {
char buffer[kDoubleToBufferSize];
return DoubleToBuffer(value, buffer);
}
string SimpleFtoa(float value) {
char buffer[kFloatToBufferSize];
return FloatToBuffer(value, buffer);
}
static inline bool IsValidFloatChar(char c) {
return ('0' <= c && c <= '9') ||
c == 'e' || c == 'E' ||
c == '+' || c == '-';
}
void DelocalizeRadix(char* buffer) {
// Fast check: if the buffer has a normal decimal point, assume no
// translation is needed.
if (strchr(buffer, '.') != NULL) return;
// Find the first unknown character.
while (IsValidFloatChar(*buffer)) ++buffer;
if (*buffer == '\0') {
// No radix character found.
return;
}
// We are now pointing at the locale-specific radix character. Replace it
// with '.'.
*buffer = '.';
++buffer;
if (!IsValidFloatChar(*buffer) && *buffer != '\0') {
// It appears the radix was a multi-byte character. We need to remove the
// extra bytes.
char* target = buffer;
do { ++buffer; } while (!IsValidFloatChar(*buffer) && *buffer != '\0');
memmove(target, buffer, strlen(buffer) + 1);
}
}
char* DoubleToBuffer(double value, char* buffer) {
// DBL_DIG is 15 for IEEE-754 doubles, which are used on almost all
// platforms these days. Just in case some system exists where DBL_DIG
// is significantly larger -- and risks overflowing our buffer -- we have
// this assert.
GOOGLE_COMPILE_ASSERT(DBL_DIG < 20, DBL_DIG_is_too_big);
if (value == numeric_limits<double>::infinity()) {
strcpy(buffer, "inf");
return buffer;
} else if (value == -numeric_limits<double>::infinity()) {
strcpy(buffer, "-inf");
return buffer;
} else if (IsNaN(value)) {
strcpy(buffer, "nan");
return buffer;
}
int snprintf_result =
snprintf(buffer, kDoubleToBufferSize, "%.*g", DBL_DIG, value);
// The snprintf should never overflow because the buffer is significantly
// larger than the precision we asked for.
GOOGLE_DCHECK(snprintf_result > 0 && snprintf_result < kDoubleToBufferSize);
// We need to make parsed_value volatile in order to force the compiler to
// write it out to the stack. Otherwise, it may keep the value in a
// register, and if it does that, it may keep it as a long double instead
// of a double. This long double may have extra bits that make it compare
// unequal to "value" even though it would be exactly equal if it were
// truncated to a double.
volatile double parsed_value = strtod(buffer, NULL);
if (parsed_value != value) {
int snprintf_result =
snprintf(buffer, kDoubleToBufferSize, "%.*g", DBL_DIG+2, value);
// Should never overflow; see above.
GOOGLE_DCHECK(snprintf_result > 0 && snprintf_result < kDoubleToBufferSize);
}
DelocalizeRadix(buffer);
return buffer;
}
bool safe_strtof(const char* str, float* value) {
char* endptr;
errno = 0; // errno only gets set on errors
#if defined(_WIN32) || defined (__hpux) // has no strtof()
*value = strtod(str, &endptr);
#else
*value = strtof(str, &endptr);
#endif
return *str != 0 && *endptr == 0 && errno == 0;
}
char* FloatToBuffer(float value, char* buffer) {
// FLT_DIG is 6 for IEEE-754 floats, which are used on almost all
// platforms these days. Just in case some system exists where FLT_DIG
// is significantly larger -- and risks overflowing our buffer -- we have
// this assert.
GOOGLE_COMPILE_ASSERT(FLT_DIG < 10, FLT_DIG_is_too_big);
if (value == numeric_limits<double>::infinity()) {
strcpy(buffer, "inf");
return buffer;
} else if (value == -numeric_limits<double>::infinity()) {
strcpy(buffer, "-inf");
return buffer;
} else if (IsNaN(value)) {
strcpy(buffer, "nan");
return buffer;
}
int snprintf_result =
snprintf(buffer, kFloatToBufferSize, "%.*g", FLT_DIG, value);
// The snprintf should never overflow because the buffer is significantly
// larger than the precision we asked for.
GOOGLE_DCHECK(snprintf_result > 0 && snprintf_result < kFloatToBufferSize);
float parsed_value;
if (!safe_strtof(buffer, &parsed_value) || parsed_value != value) {
int snprintf_result =
snprintf(buffer, kFloatToBufferSize, "%.*g", FLT_DIG+2, value);
// Should never overflow; see above.
GOOGLE_DCHECK(snprintf_result > 0 && snprintf_result < kFloatToBufferSize);
}
DelocalizeRadix(buffer);
return buffer;
}
// your_sha256_hash------
// NoLocaleStrtod()
// This code will make you cry.
// your_sha256_hash------
// Returns a string identical to *input except that the character pointed to
// by radix_pos (which should be '.') is replaced with the locale-specific
// radix character.
string LocalizeRadix(const char* input, const char* radix_pos) {
// Determine the locale-specific radix character by calling sprintf() to
// print the number 1.5, then stripping off the digits. As far as I can
// tell, this is the only portable, thread-safe way to get the C library
// to divuldge the locale's radix character. No, localeconv() is NOT
// thread-safe.
char temp[16];
int size = sprintf(temp, "%.1f", 1.5);
GOOGLE_CHECK_EQ(temp[0], '1');
GOOGLE_CHECK_EQ(temp[size-1], '5');
GOOGLE_CHECK_LE(size, 6);
// Now replace the '.' in the input with it.
string result;
result.reserve(strlen(input) + size - 3);
result.append(input, radix_pos);
result.append(temp + 1, size - 2);
result.append(radix_pos + 1);
return result;
}
double NoLocaleStrtod(const char* text, char** original_endptr) {
// We cannot simply set the locale to "C" temporarily with setlocale()
// as this is not thread-safe. Instead, we try to parse in the current
// locale first. If parsing stops at a '.' character, then this is a
// pretty good hint that we're actually in some other locale in which
// '.' is not the radix character.
char* temp_endptr;
double result = strtod(text, &temp_endptr);
if (original_endptr != NULL) *original_endptr = temp_endptr;
if (*temp_endptr != '.') return result;
// Parsing halted on a '.'. Perhaps we're in a different locale? Let's
// try to replace the '.' with a locale-specific radix character and
// try again.
string localized = LocalizeRadix(text, temp_endptr);
const char* localized_cstr = localized.c_str();
char* localized_endptr;
result = strtod(localized_cstr, &localized_endptr);
if ((localized_endptr - localized_cstr) >
(temp_endptr - text)) {
// This attempt got further, so replacing the decimal must have helped.
// Update original_endptr to point at the right location.
if (original_endptr != NULL) {
// size_diff is non-zero if the localized radix has multiple bytes.
int size_diff = localized.size() - strlen(text);
// const_cast is necessary to match the strtod() interface.
*original_endptr = const_cast<char*>(
text + (localized_endptr - localized_cstr - size_diff));
}
}
return result;
}
} // namespace protobuf
} // namespace google
```
|
The real was the currency of Colombia until 1837. No subdivisions of the real existed until after the real had ceased to be the primary unit of currency. However, 8 reales = 1 peso and 16 reales = 1 escudo.
History
Until 1820, Colombia used the Spanish colonial real, some of which were minted in Bogotá and Popayán. After 1820, issues were made specifically for Colombia, under the various names that the state used. In 1837, the peso, worth 8 reales, became the primary unit of currency. The real continued to circulate as an eighth of a peso until 1847, when a new real was introduced worth one tenth of a peso and subdivided into 10 decimos de real. This new real was renamed the decimo in 1853, although coins denominated in reales were again issued 1859-1862 and in 1880.
Coins
During the Spanish colonial period, silver , , 1, 2, 4 and 8 reales and gold 1, 2, 4 and 8 escudos were struck at Bogotá and Popayán, the last of which were produced in 1820. During the war of independence, regional issues were made by royalists in Popayán and Santa Marta, and by republicans in Cartagena and Cundinamarca. Popayán issued copper , 2 and 8 real coins, Santa Marta issued copper and real and silver 2 reales, Cartagena issued copper and 2 reales, and Cundinamarca issued silver , , 1 and 2 reales. Cundinamarca went on to issue silver , 1, 2 and 8 reales between 1820 and 1823.
The United Provinces of New Granada issued silver coins in denominations of , 1, 2 and 8 reales between 1819 and 1822. These were followed by coins of the Republic of Colombia, silver , , 1 and 8 reales, and gold 1 peso, 1, 2, 4 and 8 escudos.
Banknotes
Around 1819, notes were issued by the government in denominations of , 1, 2 and 4 reales, also denominated as , , 25 and 50 centavos. These were followed, some time in the 1820s, by notes for 1, 2, 3 and 5 pesos.
References
Modern obsolete currencies
Economic history of Colombia
Finance in Colombia
1837 disestablishments
|
Gmina Kozy is a rural gmina (administrative district) in Bielsko County, Silesian Voivodeship, in southern Poland. Its seat is the village of Kozy, which lies approximately east of Bielsko-Biała and south of the regional capital Katowice.
The gmina covers an area of , and as of 2019 its total population is 12,979.
Neighbouring gminas
Gmina Kozy is bordered by the city of Bielsko-Biała and by the gminas of Czernichów, Kęty, Porąbka, Wilamowice and Wilkowice.
Twin towns – sister cities
Gmina Kozy is twinned with:
Hričovské Podhradie, Slovakia
Jásztelek, Hungary
Kenderes, Hungary
Mošovce, Slovakia
References
Kozy
Bielsko County
|
A minimum employer contribution is a mandatory pension contribution in the United Kingdom, which was made compulsory by the Pensions Act 2008, however it did not come into force until 2012. As a result, all staff are required to be automatically enrolled in a pension scheme when they join a firm. The Cameron Ministry modified this rule by means of the 2011 Pension Act, which brought the rule into force in a series of tranches of employers, over several years (finishing by the end of 2017), instead of all at one moment.
The pension scheme involves a portion of one's earnings being put into a fund by both the employer and the employee, in order to save money for their retirement. Employers are initially only required to contribute 1% towards the employee's pension fund; this will increase to 2% on April 6, 2018, and then to 3% on April 6, 2019. In addition to this, the minimum employee contribution coming out of their workplace earnings will increase from 1% to 3% in April 2018, and will then further increase to 5% in April 2019. If an employer chooses to provide more than the minimum, the employee will only be required to contribute enough to ensure that the total minimum contribution is satisfied.
The National Employment Savings Trust (NEST) was established to assist employers in adhering to the regulations of the Pensions Act 2008. NEST is a low cost pension provider which employers default to using if they are not able to make arrangements with any other provider or would prefer not to do so. In practice, employers were more successful at finding alternative providers than the government had expected, and the restrictions placed on NEST so that it didn't compete with other providers are now deemed unnecessary by the government, hence they were to be removed in April 2017.
The Act also places requirements on defined contribution pension providers who have a choice of funds in which employees can invest; there must be a default option, which must be sensible, for employees who are automatically enrolled, and do not provide any preference about which funds they wish their contributions to be placed in.
References
Pensions in the United Kingdom
|
The Sapporo Grand Hotel is an historic hotel in the Chūō district of Sapporo, Japan. It is said to have been constructed at Prince Chichibu's suggestion in 1928, while he was on a skiing trip, that the city needed a western-style hotel. The Grand Hotel first opened its doors in 1934 and was at the time of its construction the tallest building in the city. It benefited considerably from the Japanese Imperial Army's decision to use that part of Hokkaidō for military maneuvers during the 1930s.
After World War II, the hotel was requisitioned by the U.S. Army and only reopened in 1952. The original building was demolished in 1973 and replaced by a seventeen-story building whose construction was completed in 1976.
References
External links
Hotels in Sapporo
Chūō-ku, Sapporo
Hotels established in 1934
Hotel buildings completed in 1976
|
Bulbophyllum nabawanense is a species of orchid in the genus Bulbophyllum.
References
The Bulbophyllum-Checklist
The Internet Orchid Species Photo Encyclopedia
nabawanense
|
```objective-c
//===- Parser.h - Matcher expression parser ---------------------*- C++ -*-===//
//
// See path_to_url for license information.
//
//===your_sha256_hash------===//
//
/// \file
/// Simple matcher expression parser.
///
/// The parser understands matcher expressions of the form:
/// MatcherName(Arg0, Arg1, ..., ArgN)
/// as well as simple types like strings.
/// The parser does not know how to process the matchers. It delegates this task
/// to a Sema object received as an argument.
///
/// \code
/// Grammar for the expressions supported:
/// <Expression> := <Literal> | <NamedValue> | <MatcherExpression>
/// <Literal> := <StringLiteral> | <Boolean> | <Double> | <Unsigned>
/// <StringLiteral> := "quoted string"
/// <Boolean> := true | false
/// <Double> := [0-9]+.[0-9]* | [0-9]+.[0-9]*[eE][-+]?[0-9]+
/// <Unsigned> := [0-9]+
/// <NamedValue> := <Identifier>
/// <MatcherExpression> := <Identifier>(<ArgumentList>) |
/// <Identifier>(<ArgumentList>).bind(<StringLiteral>)
/// <Identifier> := [a-zA-Z]+
/// <ArgumentList> := <Expression> | <Expression>,<ArgumentList>
/// \endcode
//
//===your_sha256_hash------===//
#ifndef LLVM_CLANG_ASTMATCHERS_DYNAMIC_PARSER_H
#define LLVM_CLANG_ASTMATCHERS_DYNAMIC_PARSER_H
#include "clang/ASTMatchers/ASTMatchersInternal.h"
#include "clang/ASTMatchers/Dynamic/Registry.h"
#include "clang/ASTMatchers/Dynamic/VariantValue.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include <optional>
#include <utility>
#include <vector>
namespace clang {
namespace ast_matchers {
namespace dynamic {
class Diagnostics;
/// Matcher expression parser.
class Parser {
public:
/// Interface to connect the parser with the registry and more.
///
/// The parser uses the Sema instance passed into
/// parseMatcherExpression() to handle all matcher tokens. The simplest
/// processor implementation would simply call into the registry to create
/// the matchers.
/// However, a more complex processor might decide to intercept the matcher
/// creation and do some extra work. For example, it could apply some
/// transformation to the matcher by adding some id() nodes, or could detect
/// specific matcher nodes for more efficient lookup.
class Sema {
public:
virtual ~Sema();
/// Process a matcher expression.
///
/// All the arguments passed here have already been processed.
///
/// \param Ctor A matcher constructor looked up by lookupMatcherCtor.
///
/// \param NameRange The location of the name in the matcher source.
/// Useful for error reporting.
///
/// \param BindID The ID to use to bind the matcher, or a null \c StringRef
/// if no ID is specified.
///
/// \param Args The argument list for the matcher.
///
/// \return The matcher objects constructed by the processor, or a null
/// matcher if an error occurred. In that case, \c Error will contain a
/// description of the error.
virtual VariantMatcher actOnMatcherExpression(MatcherCtor Ctor,
SourceRange NameRange,
StringRef BindID,
ArrayRef<ParserValue> Args,
Diagnostics *Error) = 0;
/// Look up a matcher by name.
///
/// \param MatcherName The matcher name found by the parser.
///
/// \return The matcher constructor, or std::optional<MatcherCtor>() if not
/// found.
virtual std::optional<MatcherCtor>
lookupMatcherCtor(StringRef MatcherName) = 0;
virtual bool isBuilderMatcher(MatcherCtor) const = 0;
virtual ASTNodeKind nodeMatcherType(MatcherCtor) const = 0;
virtual internal::MatcherDescriptorPtr
buildMatcherCtor(MatcherCtor, SourceRange NameRange,
ArrayRef<ParserValue> Args, Diagnostics *Error) const = 0;
/// Compute the list of completion types for \p Context.
///
/// Each element of \p Context represents a matcher invocation, going from
/// outermost to innermost. Elements are pairs consisting of a reference to
/// the matcher constructor and the index of the next element in the
/// argument list of that matcher (or for the last element, the index of
/// the completion point in the argument list). An empty list requests
/// completion for the root matcher.
virtual std::vector<ArgKind> getAcceptedCompletionTypes(
llvm::ArrayRef<std::pair<MatcherCtor, unsigned>> Context);
/// Compute the list of completions that match any of
/// \p AcceptedTypes.
///
/// \param AcceptedTypes All types accepted for this completion.
///
/// \return All completions for the specified types.
/// Completions should be valid when used in \c lookupMatcherCtor().
/// The matcher constructed from the return of \c lookupMatcherCtor()
/// should be convertible to some type in \p AcceptedTypes.
virtual std::vector<MatcherCompletion>
getMatcherCompletions(llvm::ArrayRef<ArgKind> AcceptedTypes);
};
/// Sema implementation that uses the matcher registry to process the
/// tokens.
class RegistrySema : public Parser::Sema {
public:
~RegistrySema() override;
std::optional<MatcherCtor>
lookupMatcherCtor(StringRef MatcherName) override;
VariantMatcher actOnMatcherExpression(MatcherCtor Ctor,
SourceRange NameRange,
StringRef BindID,
ArrayRef<ParserValue> Args,
Diagnostics *Error) override;
std::vector<ArgKind> getAcceptedCompletionTypes(
llvm::ArrayRef<std::pair<MatcherCtor, unsigned>> Context) override;
bool isBuilderMatcher(MatcherCtor Ctor) const override;
ASTNodeKind nodeMatcherType(MatcherCtor) const override;
internal::MatcherDescriptorPtr
buildMatcherCtor(MatcherCtor, SourceRange NameRange,
ArrayRef<ParserValue> Args,
Diagnostics *Error) const override;
std::vector<MatcherCompletion>
getMatcherCompletions(llvm::ArrayRef<ArgKind> AcceptedTypes) override;
};
using NamedValueMap = llvm::StringMap<VariantValue>;
/// Parse a matcher expression.
///
/// \param MatcherCode The matcher expression to parse.
///
/// \param S The Sema instance that will help the parser
/// construct the matchers. If null, it uses the default registry.
///
/// \param NamedValues A map of precomputed named values. This provides
/// the dictionary for the <NamedValue> rule of the grammar.
/// If null, it is ignored.
///
/// \return The matcher object constructed by the processor, or an empty
/// Optional if an error occurred. In that case, \c Error will contain a
/// description of the error.
/// The caller takes ownership of the DynTypedMatcher object returned.
static std::optional<DynTypedMatcher>
parseMatcherExpression(StringRef &MatcherCode, Sema *S,
const NamedValueMap *NamedValues, Diagnostics *Error);
static std::optional<DynTypedMatcher>
parseMatcherExpression(StringRef &MatcherCode, Sema *S, Diagnostics *Error) {
return parseMatcherExpression(MatcherCode, S, nullptr, Error);
}
static std::optional<DynTypedMatcher>
parseMatcherExpression(StringRef &MatcherCode, Diagnostics *Error) {
return parseMatcherExpression(MatcherCode, nullptr, Error);
}
/// Parse an expression.
///
/// Parses any expression supported by this parser. In general, the
/// \c parseMatcherExpression function is a better approach to get a matcher
/// object.
///
/// \param S The Sema instance that will help the parser
/// construct the matchers. If null, it uses the default registry.
///
/// \param NamedValues A map of precomputed named values. This provides
/// the dictionary for the <NamedValue> rule of the grammar.
/// If null, it is ignored.
static bool parseExpression(StringRef &Code, Sema *S,
const NamedValueMap *NamedValues,
VariantValue *Value, Diagnostics *Error);
static bool parseExpression(StringRef &Code, Sema *S, VariantValue *Value,
Diagnostics *Error) {
return parseExpression(Code, S, nullptr, Value, Error);
}
static bool parseExpression(StringRef &Code, VariantValue *Value,
Diagnostics *Error) {
return parseExpression(Code, nullptr, Value, Error);
}
/// Complete an expression at the given offset.
///
/// \param S The Sema instance that will help the parser
/// construct the matchers. If null, it uses the default registry.
///
/// \param NamedValues A map of precomputed named values. This provides
/// the dictionary for the <NamedValue> rule of the grammar.
/// If null, it is ignored.
///
/// \return The list of completions, which may be empty if there are no
/// available completions or if an error occurred.
static std::vector<MatcherCompletion>
completeExpression(StringRef &Code, unsigned CompletionOffset, Sema *S,
const NamedValueMap *NamedValues);
static std::vector<MatcherCompletion>
completeExpression(StringRef &Code, unsigned CompletionOffset, Sema *S) {
return completeExpression(Code, CompletionOffset, S, nullptr);
}
static std::vector<MatcherCompletion>
completeExpression(StringRef &Code, unsigned CompletionOffset) {
return completeExpression(Code, CompletionOffset, nullptr);
}
private:
class CodeTokenizer;
struct ScopedContextEntry;
struct TokenInfo;
Parser(CodeTokenizer *Tokenizer, Sema *S,
const NamedValueMap *NamedValues,
Diagnostics *Error);
bool parseBindID(std::string &BindID);
bool parseExpressionImpl(VariantValue *Value);
bool parseMatcherBuilder(MatcherCtor Ctor, const TokenInfo &NameToken,
const TokenInfo &OpenToken, VariantValue *Value);
bool parseMatcherExpressionImpl(const TokenInfo &NameToken,
const TokenInfo &OpenToken,
std::optional<MatcherCtor> Ctor,
VariantValue *Value);
bool parseIdentifierPrefixImpl(VariantValue *Value);
void addCompletion(const TokenInfo &CompToken,
const MatcherCompletion &Completion);
void addExpressionCompletions();
std::vector<MatcherCompletion>
getNamedValueCompletions(ArrayRef<ArgKind> AcceptedTypes);
CodeTokenizer *const Tokenizer;
Sema *const S;
const NamedValueMap *const NamedValues;
Diagnostics *const Error;
using ContextStackTy = std::vector<std::pair<MatcherCtor, unsigned>>;
ContextStackTy ContextStack;
std::vector<MatcherCompletion> Completions;
};
} // namespace dynamic
} // namespace ast_matchers
} // namespace clang
#endif // LLVM_CLANG_ASTMATCHERS_DYNAMIC_PARSER_H
```
|
Several vessels have been named Sappho for the Greek poet Sappho:
was launched at Shields in 1785. She spent most of her career trading with the Baltic, though she made some voyages elsewhere, and in particular, between 1788 and 1799 she made a voyage to the Falkland Islands as a whaler. She was last listed in 1798, having perhaps been captured in late 1797.
was launched in France circa 1803, probably under another name, and captured in 1804. She became a West Indiaman and then privateer that the French Navy recaptured and destroyed in March 1808.
was launched in Sunderland. She traded widely, first as a West Indiaman and later to the Baltic. She also made one voyage to India, sailing under a licence from the British East India Company (EIC). She stranded on 9 July 1823, was gotten off, condemned, and sold.
was launched at Whitby and moved her registration to London in 1814. Thereafter she traded widely. She made to voyages to India, one to Bombay and one to Bengal, sailing under a licence from the British East India Company (EIC). She was last listed in 1833.
See also
– one of several ships of the French Navy
– one of five vessels of the Royal Navy, and two planned vessels
– either of two vessels of the United States Navy
Ship names
|
```xml
<?xml version='1.0' encoding='ISO-8859-1' ?>
<!--
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
-->
<project name="test-lom" default="test" basedir=".">
<target name="test" depends="" description="run functional test cases">
<delete dir="out-dir" />
<java failonerror="true" fork="true" classname="javacc" classpath="../../target/javacc.jar" >
<arg line="Parser.jj" />
</java>
<javac srcdir="out-dir" destdir="out-dir" source="1.7" debug="true" includeantruntime='false'
classpath="../../target/javacc.jar">
</javac>
<java classname="Parser" classpath="out-dir" outputproperty="test.out" failonerror="true"> </java>
<echo>${test.out}</echo>
<fail message="lengthOfMessage failed">
<condition>
<or>
<not> <contains string="${test.out}" substring="PLAIN_STRING=12" /> </not>
<not> <contains string="${test.out}" substring="a-z=3" /> </not>
<not> <contains string="${test.out}" substring="space=1" /> </not>
<not> <contains string="${test.out}" substring="A|B=1" /> </not>
</or>
</condition>
</fail>
</target>
<target name="clean">
<delete dir="out-dir" />
</target>
</project>
```
|
GTI Club+: Rally Côte d'Azur is the PlayStation 3 racing game by Konami. The arcade version itself is a remake of the original GTI Club released in 1996.
GTI Club+ was ported in HD by Sumo Digital, a Foundation 9 Entertainment affiliate, and was released through the European PlayStation Store on 4 December 2008, and the North American Store on 15 January 2009, and the Japan Store on 25 February 2010. As of 2012, it is no longer available for purchase due to license expiration.
Production
A first trailer was unveiled at the Leipzig Game Convention 2008. The video was followed by a playable demo on 27 November.
This enhanced version is rendered in 720p and runs at 60fps. It supports Dolby Digital 5.1 surround sound and the original BGM has been remixed by Atjazz.
Features
Compared with the arcade version, GTI Club+ adds a solo mode, an eight-player online multiplayer mode (Race and Time Bomb modes) instead of four-player, an online rankings leaderboard and is compatible with the PlayStation Eye which allows players to see themselves during playtime. Voice chat is also possible through the PlayStation Eye or Bluetooth headset. It also supports motion sensor steering through Sixaxis, rumble through DualShock 3 and PlayStation Network Trophies feature.
Cars & tracks
The arcade version contains four circuits: France, England, Italy and USA. This home version has only one out of the box, France, hence the title. The GTI Club+ official website claimed some new circuits to be available during 2009.
The Rally Côte d'Azur (a.k.a. France Course) consists in fictitious urban and harbour areas located in the Côte d'azur, also known as French Riviera. Road signs clearly hint at Monaco's Monte Carlo (Musée océanographique, parking Louis II, parking Square Gastaud) with references to nearby French cities of Menton (Port Garavan), Antibes, Digne and Nice.
Solo mode consists of four circuits named Easy, Medium, Hard and Free Run. Easy is a 3-lap course within a small area. Medium adds traffic and new sections to the Easy course. Hard is a 5-lap reverse version of the Medium course. Free Run is a traffic-free Time Attack version of Medium course.
Playable vehicles are the original 1996 GTI Club's four licensed European superminis from the '80s, namely the Morris Mini Cooper 1275S (Mk1), Renault 5 Alpine Turbo (A5/R122B), Volkswagen Golf GTi (Mk1), Autobianchi A112 Abarth plus the Lancia Delta HF 4WD. All of which are taken from the Supermini Festa! version.
A car customisation feature allows painting, horn selection as well as the use of stickers and decals. Alternative car versions are unlockable by winning races. Easy difficulty unlocks a Police colour scheme for the car the race was won in and said scheme is reminiscent of the livery of the police force of the country the car was made in (i.e. "Police", "Polizia" or "Polizei", though the Renault has a "Polizia" livery instead of the French "Police" for some reasons). Medium difficulty unlocks Taxi schemes for the cars. These Police and Taxi versions cannot be customized though.
An hidden vehicle called Toy Dog is unlocked when beating the Hard difficulty. This extra racer consists of a German Shepherd Dog-shaped wooden rocking dog.
Downloadable content
The first set of DLC entitled 'Car Pack 1' was released on 4 June 2009, adding four cars taken from GTI Club Supermini Festa!. These are the Fiat 500 Abarth, BMW Mini Cooper S (MkII), Peugeot 207 GTi (with a Supermini Festa! sticker) and Volkswagen Polo GTI (Mk5) with their respective Police and Taxi versions as in the arcade game. This first DLC also features a set of ten PSN Trophies.
Additional cars should be available as hinted by the empty car slots found in GTI Club+ 's Garage. These cars are likely to be the remaining three from the arcade version, i.e. Volkswagen Golf GTI 16v (Mk2), Fiat 500 Abarth 695SS and Nissan Micra (K12C).
Reception
The game received above-average reviews according to the review aggregation website Metacritic.
References
External links
Official website (Japanese)
2008 video games
Konami games
Multiplayer and single-player video games
PlayStation 3 games
PlayStation 3-only games
PlayStation Network games
Racing video games
Sumo Digital games
Video game remakes
Video games developed in the United Kingdom
|
Home Island, also known locally as Pulu Selma, is one of only two permanently inhabited islands of the 26 islands of the Southern Atoll of the Cocos (Keeling) Islands, an Australian external territory in the central-eastern Indian Ocean.
Description
It is in area and contains the largest settlement of the territory, Bantam, with a population of about 500 Cocos Malay people. Local attractions include a museum covering local culture and traditions, flora and fauna, Australian naval history, and the early owners of the Cocos-Keeling Islands.
The Home Island Mosque is one of the busiest places on the island, and the minaret is painted in territorial flag colours of green and gold.
There is also a trail leading to Oceania House, which was the ancestral home of the Clunies-Ross family, the former rulers of the Cocos-Keeling Islands and is over a century old.
Education
Cocos Islands District High School operates a primary education centre on Home Island; most of the staff live on West Island and travel to their jobs on a daily basis. Secondary level students go to the West Island campus.
Heritage listings
Home Island contains a number of heritage-listed sites, including:
Captain Ballard's Grave
Jalan Kipas: Early Settlers' Graves
Home Island Cemetery
Jalan Panti: Home Island Foreshore
Jalan Bunga Mawar: Home Island Industrial Precinct
Jalan Bunga Kangkong: Oceania House
Jalan Bunga Mawar: Old Co-Op Shop
References
External links
|
```raw token data
MAC ADDR VLAN ID STATE PORT INDEX AGING TIME(s)
0000-1111-2222 1 Learned Bridge-Aggregation1 AGING
fedc-ba09-8765 10 Learned GigabitEthernet1/0/20 NOAGED
aaaa-bbbb-cccc 10 Learned GigabitEthernet1/0/41 AGING
dead-beef-0042 20 Learned GigabitEthernet1/0/10 AGING
```
|
The Bilan d'aptitude délivré par les grandes écoles (BADGE, in English Assessment of competency issued by grandes écoles) is a French degree created in 2001 by the Conférence des Grandes Écoles and primarily intended for owners of a two-year degree after the Baccalauréat.
Presentation
According to the rules of organization of training programs accredited by the Conférence des Grandes Écoles , ""The BADGE ... of the School... " is a registered collective ownership of the Conférence des Grandes Écoles, attributed to a specific training organized by a school member of the CGE. It is intended primarily for owners of a two-year degree after the Baccalauréat'".
Be considered applicants who hold one of the following qualifications:
Two-year degree after the Baccalauréat;
Baccalauréat'' and a significant professional experience relevant to the subject of the application of at least five years.
The BADGE program necessarily includes a number of common elements: at least 200 hours of instruction, including theoretical, practical work, team projects and possibly distance learning and a final validation test.
The program takes place over a period of 7 weeks to 24 months maximum, subject to alternating training / business where the period exceeds 6 months and is 15 to 25 ECTS-credits.
References
External links
BADGE on Conférence des grandes écoles website
Management education
Higher education in France
Academic degrees of France
|
```objective-c
// AUTOGENERATED, DO NOT EDIT
#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_SSE
# define CV_TRY_SSE 1
# define CV_CPU_FORCE_SSE 1
# define CV_CPU_HAS_SUPPORT_SSE 1
# define CV_CPU_CALL_SSE(fn, args) return (cpu_baseline::fn args)
# define CV_CPU_CALL_SSE_(fn, args) return (opt_SSE::fn args)
#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_SSE
# define CV_TRY_SSE 1
# define CV_CPU_FORCE_SSE 0
# define CV_CPU_HAS_SUPPORT_SSE (cv::checkHardwareSupport(CV_CPU_SSE))
# define CV_CPU_CALL_SSE(fn, args) if (CV_CPU_HAS_SUPPORT_SSE) return (opt_SSE::fn args)
# define CV_CPU_CALL_SSE_(fn, args) if (CV_CPU_HAS_SUPPORT_SSE) return (opt_SSE::fn args)
#else
# define CV_TRY_SSE 0
# define CV_CPU_FORCE_SSE 0
# define CV_CPU_HAS_SUPPORT_SSE 0
# define CV_CPU_CALL_SSE(fn, args)
# define CV_CPU_CALL_SSE_(fn, args)
#endif
#define __CV_CPU_DISPATCH_CHAIN_SSE(fn, args, mode, ...) CV_CPU_CALL_SSE(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))
#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_SSE2
# define CV_TRY_SSE2 1
# define CV_CPU_FORCE_SSE2 1
# define CV_CPU_HAS_SUPPORT_SSE2 1
# define CV_CPU_CALL_SSE2(fn, args) return (cpu_baseline::fn args)
# define CV_CPU_CALL_SSE2_(fn, args) return (opt_SSE2::fn args)
#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_SSE2
# define CV_TRY_SSE2 1
# define CV_CPU_FORCE_SSE2 0
# define CV_CPU_HAS_SUPPORT_SSE2 (cv::checkHardwareSupport(CV_CPU_SSE2))
# define CV_CPU_CALL_SSE2(fn, args) if (CV_CPU_HAS_SUPPORT_SSE2) return (opt_SSE2::fn args)
# define CV_CPU_CALL_SSE2_(fn, args) if (CV_CPU_HAS_SUPPORT_SSE2) return (opt_SSE2::fn args)
#else
# define CV_TRY_SSE2 0
# define CV_CPU_FORCE_SSE2 0
# define CV_CPU_HAS_SUPPORT_SSE2 0
# define CV_CPU_CALL_SSE2(fn, args)
# define CV_CPU_CALL_SSE2_(fn, args)
#endif
#define __CV_CPU_DISPATCH_CHAIN_SSE2(fn, args, mode, ...) CV_CPU_CALL_SSE2(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))
#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_SSE3
# define CV_TRY_SSE3 1
# define CV_CPU_FORCE_SSE3 1
# define CV_CPU_HAS_SUPPORT_SSE3 1
# define CV_CPU_CALL_SSE3(fn, args) return (cpu_baseline::fn args)
# define CV_CPU_CALL_SSE3_(fn, args) return (opt_SSE3::fn args)
#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_SSE3
# define CV_TRY_SSE3 1
# define CV_CPU_FORCE_SSE3 0
# define CV_CPU_HAS_SUPPORT_SSE3 (cv::checkHardwareSupport(CV_CPU_SSE3))
# define CV_CPU_CALL_SSE3(fn, args) if (CV_CPU_HAS_SUPPORT_SSE3) return (opt_SSE3::fn args)
# define CV_CPU_CALL_SSE3_(fn, args) if (CV_CPU_HAS_SUPPORT_SSE3) return (opt_SSE3::fn args)
#else
# define CV_TRY_SSE3 0
# define CV_CPU_FORCE_SSE3 0
# define CV_CPU_HAS_SUPPORT_SSE3 0
# define CV_CPU_CALL_SSE3(fn, args)
# define CV_CPU_CALL_SSE3_(fn, args)
#endif
#define __CV_CPU_DISPATCH_CHAIN_SSE3(fn, args, mode, ...) CV_CPU_CALL_SSE3(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))
#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_SSSE3
# define CV_TRY_SSSE3 1
# define CV_CPU_FORCE_SSSE3 1
# define CV_CPU_HAS_SUPPORT_SSSE3 1
# define CV_CPU_CALL_SSSE3(fn, args) return (cpu_baseline::fn args)
# define CV_CPU_CALL_SSSE3_(fn, args) return (opt_SSSE3::fn args)
#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_SSSE3
# define CV_TRY_SSSE3 1
# define CV_CPU_FORCE_SSSE3 0
# define CV_CPU_HAS_SUPPORT_SSSE3 (cv::checkHardwareSupport(CV_CPU_SSSE3))
# define CV_CPU_CALL_SSSE3(fn, args) if (CV_CPU_HAS_SUPPORT_SSSE3) return (opt_SSSE3::fn args)
# define CV_CPU_CALL_SSSE3_(fn, args) if (CV_CPU_HAS_SUPPORT_SSSE3) return (opt_SSSE3::fn args)
#else
# define CV_TRY_SSSE3 0
# define CV_CPU_FORCE_SSSE3 0
# define CV_CPU_HAS_SUPPORT_SSSE3 0
# define CV_CPU_CALL_SSSE3(fn, args)
# define CV_CPU_CALL_SSSE3_(fn, args)
#endif
#define __CV_CPU_DISPATCH_CHAIN_SSSE3(fn, args, mode, ...) CV_CPU_CALL_SSSE3(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))
#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_SSE4_1
# define CV_TRY_SSE4_1 1
# define CV_CPU_FORCE_SSE4_1 1
# define CV_CPU_HAS_SUPPORT_SSE4_1 1
# define CV_CPU_CALL_SSE4_1(fn, args) return (cpu_baseline::fn args)
# define CV_CPU_CALL_SSE4_1_(fn, args) return (opt_SSE4_1::fn args)
#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_SSE4_1
# define CV_TRY_SSE4_1 1
# define CV_CPU_FORCE_SSE4_1 0
# define CV_CPU_HAS_SUPPORT_SSE4_1 (cv::checkHardwareSupport(CV_CPU_SSE4_1))
# define CV_CPU_CALL_SSE4_1(fn, args) if (CV_CPU_HAS_SUPPORT_SSE4_1) return (opt_SSE4_1::fn args)
# define CV_CPU_CALL_SSE4_1_(fn, args) if (CV_CPU_HAS_SUPPORT_SSE4_1) return (opt_SSE4_1::fn args)
#else
# define CV_TRY_SSE4_1 0
# define CV_CPU_FORCE_SSE4_1 0
# define CV_CPU_HAS_SUPPORT_SSE4_1 0
# define CV_CPU_CALL_SSE4_1(fn, args)
# define CV_CPU_CALL_SSE4_1_(fn, args)
#endif
#define __CV_CPU_DISPATCH_CHAIN_SSE4_1(fn, args, mode, ...) CV_CPU_CALL_SSE4_1(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))
#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_SSE4_2
# define CV_TRY_SSE4_2 1
# define CV_CPU_FORCE_SSE4_2 1
# define CV_CPU_HAS_SUPPORT_SSE4_2 1
# define CV_CPU_CALL_SSE4_2(fn, args) return (cpu_baseline::fn args)
# define CV_CPU_CALL_SSE4_2_(fn, args) return (opt_SSE4_2::fn args)
#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_SSE4_2
# define CV_TRY_SSE4_2 1
# define CV_CPU_FORCE_SSE4_2 0
# define CV_CPU_HAS_SUPPORT_SSE4_2 (cv::checkHardwareSupport(CV_CPU_SSE4_2))
# define CV_CPU_CALL_SSE4_2(fn, args) if (CV_CPU_HAS_SUPPORT_SSE4_2) return (opt_SSE4_2::fn args)
# define CV_CPU_CALL_SSE4_2_(fn, args) if (CV_CPU_HAS_SUPPORT_SSE4_2) return (opt_SSE4_2::fn args)
#else
# define CV_TRY_SSE4_2 0
# define CV_CPU_FORCE_SSE4_2 0
# define CV_CPU_HAS_SUPPORT_SSE4_2 0
# define CV_CPU_CALL_SSE4_2(fn, args)
# define CV_CPU_CALL_SSE4_2_(fn, args)
#endif
#define __CV_CPU_DISPATCH_CHAIN_SSE4_2(fn, args, mode, ...) CV_CPU_CALL_SSE4_2(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))
#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_POPCNT
# define CV_TRY_POPCNT 1
# define CV_CPU_FORCE_POPCNT 1
# define CV_CPU_HAS_SUPPORT_POPCNT 1
# define CV_CPU_CALL_POPCNT(fn, args) return (cpu_baseline::fn args)
# define CV_CPU_CALL_POPCNT_(fn, args) return (opt_POPCNT::fn args)
#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_POPCNT
# define CV_TRY_POPCNT 1
# define CV_CPU_FORCE_POPCNT 0
# define CV_CPU_HAS_SUPPORT_POPCNT (cv::checkHardwareSupport(CV_CPU_POPCNT))
# define CV_CPU_CALL_POPCNT(fn, args) if (CV_CPU_HAS_SUPPORT_POPCNT) return (opt_POPCNT::fn args)
# define CV_CPU_CALL_POPCNT_(fn, args) if (CV_CPU_HAS_SUPPORT_POPCNT) return (opt_POPCNT::fn args)
#else
# define CV_TRY_POPCNT 0
# define CV_CPU_FORCE_POPCNT 0
# define CV_CPU_HAS_SUPPORT_POPCNT 0
# define CV_CPU_CALL_POPCNT(fn, args)
# define CV_CPU_CALL_POPCNT_(fn, args)
#endif
#define __CV_CPU_DISPATCH_CHAIN_POPCNT(fn, args, mode, ...) CV_CPU_CALL_POPCNT(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))
#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX
# define CV_TRY_AVX 1
# define CV_CPU_FORCE_AVX 1
# define CV_CPU_HAS_SUPPORT_AVX 1
# define CV_CPU_CALL_AVX(fn, args) return (cpu_baseline::fn args)
# define CV_CPU_CALL_AVX_(fn, args) return (opt_AVX::fn args)
#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX
# define CV_TRY_AVX 1
# define CV_CPU_FORCE_AVX 0
# define CV_CPU_HAS_SUPPORT_AVX (cv::checkHardwareSupport(CV_CPU_AVX))
# define CV_CPU_CALL_AVX(fn, args) if (CV_CPU_HAS_SUPPORT_AVX) return (opt_AVX::fn args)
# define CV_CPU_CALL_AVX_(fn, args) if (CV_CPU_HAS_SUPPORT_AVX) return (opt_AVX::fn args)
#else
# define CV_TRY_AVX 0
# define CV_CPU_FORCE_AVX 0
# define CV_CPU_HAS_SUPPORT_AVX 0
# define CV_CPU_CALL_AVX(fn, args)
# define CV_CPU_CALL_AVX_(fn, args)
#endif
#define __CV_CPU_DISPATCH_CHAIN_AVX(fn, args, mode, ...) CV_CPU_CALL_AVX(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))
#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_FP16
# define CV_TRY_FP16 1
# define CV_CPU_FORCE_FP16 1
# define CV_CPU_HAS_SUPPORT_FP16 1
# define CV_CPU_CALL_FP16(fn, args) return (cpu_baseline::fn args)
# define CV_CPU_CALL_FP16_(fn, args) return (opt_FP16::fn args)
#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_FP16
# define CV_TRY_FP16 1
# define CV_CPU_FORCE_FP16 0
# define CV_CPU_HAS_SUPPORT_FP16 (cv::checkHardwareSupport(CV_CPU_FP16))
# define CV_CPU_CALL_FP16(fn, args) if (CV_CPU_HAS_SUPPORT_FP16) return (opt_FP16::fn args)
# define CV_CPU_CALL_FP16_(fn, args) if (CV_CPU_HAS_SUPPORT_FP16) return (opt_FP16::fn args)
#else
# define CV_TRY_FP16 0
# define CV_CPU_FORCE_FP16 0
# define CV_CPU_HAS_SUPPORT_FP16 0
# define CV_CPU_CALL_FP16(fn, args)
# define CV_CPU_CALL_FP16_(fn, args)
#endif
#define __CV_CPU_DISPATCH_CHAIN_FP16(fn, args, mode, ...) CV_CPU_CALL_FP16(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))
#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX2
# define CV_TRY_AVX2 1
# define CV_CPU_FORCE_AVX2 1
# define CV_CPU_HAS_SUPPORT_AVX2 1
# define CV_CPU_CALL_AVX2(fn, args) return (cpu_baseline::fn args)
# define CV_CPU_CALL_AVX2_(fn, args) return (opt_AVX2::fn args)
#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX2
# define CV_TRY_AVX2 1
# define CV_CPU_FORCE_AVX2 0
# define CV_CPU_HAS_SUPPORT_AVX2 (cv::checkHardwareSupport(CV_CPU_AVX2))
# define CV_CPU_CALL_AVX2(fn, args) if (CV_CPU_HAS_SUPPORT_AVX2) return (opt_AVX2::fn args)
# define CV_CPU_CALL_AVX2_(fn, args) if (CV_CPU_HAS_SUPPORT_AVX2) return (opt_AVX2::fn args)
#else
# define CV_TRY_AVX2 0
# define CV_CPU_FORCE_AVX2 0
# define CV_CPU_HAS_SUPPORT_AVX2 0
# define CV_CPU_CALL_AVX2(fn, args)
# define CV_CPU_CALL_AVX2_(fn, args)
#endif
#define __CV_CPU_DISPATCH_CHAIN_AVX2(fn, args, mode, ...) CV_CPU_CALL_AVX2(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))
#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_FMA3
# define CV_TRY_FMA3 1
# define CV_CPU_FORCE_FMA3 1
# define CV_CPU_HAS_SUPPORT_FMA3 1
# define CV_CPU_CALL_FMA3(fn, args) return (cpu_baseline::fn args)
# define CV_CPU_CALL_FMA3_(fn, args) return (opt_FMA3::fn args)
#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_FMA3
# define CV_TRY_FMA3 1
# define CV_CPU_FORCE_FMA3 0
# define CV_CPU_HAS_SUPPORT_FMA3 (cv::checkHardwareSupport(CV_CPU_FMA3))
# define CV_CPU_CALL_FMA3(fn, args) if (CV_CPU_HAS_SUPPORT_FMA3) return (opt_FMA3::fn args)
# define CV_CPU_CALL_FMA3_(fn, args) if (CV_CPU_HAS_SUPPORT_FMA3) return (opt_FMA3::fn args)
#else
# define CV_TRY_FMA3 0
# define CV_CPU_FORCE_FMA3 0
# define CV_CPU_HAS_SUPPORT_FMA3 0
# define CV_CPU_CALL_FMA3(fn, args)
# define CV_CPU_CALL_FMA3_(fn, args)
#endif
#define __CV_CPU_DISPATCH_CHAIN_FMA3(fn, args, mode, ...) CV_CPU_CALL_FMA3(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))
#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX_512F
# define CV_TRY_AVX_512F 1
# define CV_CPU_FORCE_AVX_512F 1
# define CV_CPU_HAS_SUPPORT_AVX_512F 1
# define CV_CPU_CALL_AVX_512F(fn, args) return (cpu_baseline::fn args)
# define CV_CPU_CALL_AVX_512F_(fn, args) return (opt_AVX_512F::fn args)
#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX_512F
# define CV_TRY_AVX_512F 1
# define CV_CPU_FORCE_AVX_512F 0
# define CV_CPU_HAS_SUPPORT_AVX_512F (cv::checkHardwareSupport(CV_CPU_AVX_512F))
# define CV_CPU_CALL_AVX_512F(fn, args) if (CV_CPU_HAS_SUPPORT_AVX_512F) return (opt_AVX_512F::fn args)
# define CV_CPU_CALL_AVX_512F_(fn, args) if (CV_CPU_HAS_SUPPORT_AVX_512F) return (opt_AVX_512F::fn args)
#else
# define CV_TRY_AVX_512F 0
# define CV_CPU_FORCE_AVX_512F 0
# define CV_CPU_HAS_SUPPORT_AVX_512F 0
# define CV_CPU_CALL_AVX_512F(fn, args)
# define CV_CPU_CALL_AVX_512F_(fn, args)
#endif
#define __CV_CPU_DISPATCH_CHAIN_AVX_512F(fn, args, mode, ...) CV_CPU_CALL_AVX_512F(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))
#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX512_SKX
# define CV_TRY_AVX512_SKX 1
# define CV_CPU_FORCE_AVX512_SKX 1
# define CV_CPU_HAS_SUPPORT_AVX512_SKX 1
# define CV_CPU_CALL_AVX512_SKX(fn, args) return (cpu_baseline::fn args)
# define CV_CPU_CALL_AVX512_SKX_(fn, args) return (opt_AVX512_SKX::fn args)
#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX512_SKX
# define CV_TRY_AVX512_SKX 1
# define CV_CPU_FORCE_AVX512_SKX 0
# define CV_CPU_HAS_SUPPORT_AVX512_SKX (cv::checkHardwareSupport(CV_CPU_AVX512_SKX))
# define CV_CPU_CALL_AVX512_SKX(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_SKX) return (opt_AVX512_SKX::fn args)
# define CV_CPU_CALL_AVX512_SKX_(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_SKX) return (opt_AVX512_SKX::fn args)
#else
# define CV_TRY_AVX512_SKX 0
# define CV_CPU_FORCE_AVX512_SKX 0
# define CV_CPU_HAS_SUPPORT_AVX512_SKX 0
# define CV_CPU_CALL_AVX512_SKX(fn, args)
# define CV_CPU_CALL_AVX512_SKX_(fn, args)
#endif
#define __CV_CPU_DISPATCH_CHAIN_AVX512_SKX(fn, args, mode, ...) CV_CPU_CALL_AVX512_SKX(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))
#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_NEON
# define CV_TRY_NEON 1
# define CV_CPU_FORCE_NEON 1
# define CV_CPU_HAS_SUPPORT_NEON 1
# define CV_CPU_CALL_NEON(fn, args) return (cpu_baseline::fn args)
# define CV_CPU_CALL_NEON_(fn, args) return (opt_NEON::fn args)
#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_NEON
# define CV_TRY_NEON 1
# define CV_CPU_FORCE_NEON 0
# define CV_CPU_HAS_SUPPORT_NEON (cv::checkHardwareSupport(CV_CPU_NEON))
# define CV_CPU_CALL_NEON(fn, args) if (CV_CPU_HAS_SUPPORT_NEON) return (opt_NEON::fn args)
# define CV_CPU_CALL_NEON_(fn, args) if (CV_CPU_HAS_SUPPORT_NEON) return (opt_NEON::fn args)
#else
# define CV_TRY_NEON 0
# define CV_CPU_FORCE_NEON 0
# define CV_CPU_HAS_SUPPORT_NEON 0
# define CV_CPU_CALL_NEON(fn, args)
# define CV_CPU_CALL_NEON_(fn, args)
#endif
#define __CV_CPU_DISPATCH_CHAIN_NEON(fn, args, mode, ...) CV_CPU_CALL_NEON(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))
#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_VSX
# define CV_TRY_VSX 1
# define CV_CPU_FORCE_VSX 1
# define CV_CPU_HAS_SUPPORT_VSX 1
# define CV_CPU_CALL_VSX(fn, args) return (cpu_baseline::fn args)
# define CV_CPU_CALL_VSX_(fn, args) return (opt_VSX::fn args)
#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_VSX
# define CV_TRY_VSX 1
# define CV_CPU_FORCE_VSX 0
# define CV_CPU_HAS_SUPPORT_VSX (cv::checkHardwareSupport(CV_CPU_VSX))
# define CV_CPU_CALL_VSX(fn, args) if (CV_CPU_HAS_SUPPORT_VSX) return (opt_VSX::fn args)
# define CV_CPU_CALL_VSX_(fn, args) if (CV_CPU_HAS_SUPPORT_VSX) return (opt_VSX::fn args)
#else
# define CV_TRY_VSX 0
# define CV_CPU_FORCE_VSX 0
# define CV_CPU_HAS_SUPPORT_VSX 0
# define CV_CPU_CALL_VSX(fn, args)
# define CV_CPU_CALL_VSX_(fn, args)
#endif
#define __CV_CPU_DISPATCH_CHAIN_VSX(fn, args, mode, ...) CV_CPU_CALL_VSX(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))
#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_VSX3
# define CV_TRY_VSX3 1
# define CV_CPU_FORCE_VSX3 1
# define CV_CPU_HAS_SUPPORT_VSX3 1
# define CV_CPU_CALL_VSX3(fn, args) return (cpu_baseline::fn args)
# define CV_CPU_CALL_VSX3_(fn, args) return (opt_VSX3::fn args)
#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_VSX3
# define CV_TRY_VSX3 1
# define CV_CPU_FORCE_VSX3 0
# define CV_CPU_HAS_SUPPORT_VSX3 (cv::checkHardwareSupport(CV_CPU_VSX3))
# define CV_CPU_CALL_VSX3(fn, args) if (CV_CPU_HAS_SUPPORT_VSX3) return (opt_VSX3::fn args)
# define CV_CPU_CALL_VSX3_(fn, args) if (CV_CPU_HAS_SUPPORT_VSX3) return (opt_VSX3::fn args)
#else
# define CV_TRY_VSX3 0
# define CV_CPU_FORCE_VSX3 0
# define CV_CPU_HAS_SUPPORT_VSX3 0
# define CV_CPU_CALL_VSX3(fn, args)
# define CV_CPU_CALL_VSX3_(fn, args)
#endif
#define __CV_CPU_DISPATCH_CHAIN_VSX3(fn, args, mode, ...) CV_CPU_CALL_VSX3(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))
#define CV_CPU_CALL_BASELINE(fn, args) return (cpu_baseline::fn args)
#define __CV_CPU_DISPATCH_CHAIN_BASELINE(fn, args, mode, ...) CV_CPU_CALL_BASELINE(fn, args) /* last in sequence */
```
|
Kafubu (or Kafuvu) is a small village on the eastern tip of the Caprivi Strip, across from Kasane, Botswana on the Chobe River in Namibia. With a population of between 200 and 300, Kafubu villagers are mostly Subiya cultivators and fishermen. The village can only be reached by boat, with a small Namibian customs office located nearby. Several large baobab trees dot the area. Most homes in Kafubu are made of reeds and dirt. Tourists visiting Kafubu from nearby Kasane and Chobe National Park can tour the village and buy crafts.
References
North-West District (Botswana)
Populated places in Botswana
Botswana–Namibia border crossings
|
```ruby
# encoding: UTF-8
module Asciidoctor
# Public: Methods for retrieving lines from AsciiDoc source files
class Reader
class Cursor
attr_accessor :file
attr_accessor :dir
attr_accessor :path
attr_accessor :lineno
def initialize file, dir = nil, path = nil, lineno = nil
@file = file
@dir = dir
@path = path
@lineno = lineno
end
def line_info
%(#{path}: line #{lineno})
end
alias :to_s :line_info
end
attr_reader :file
attr_reader :dir
attr_reader :path
# Public: Get the 1-based offset of the current line.
attr_reader :lineno
# Public: Get the document source as a String Array of lines.
attr_reader :source_lines
# Public: Control whether lines are processed using Reader#process_line on first visit (default: true)
attr_accessor :process_lines
# Public: Initialize the Reader object
def initialize data = nil, cursor = nil, opts = {:normalize => false}
if !cursor
@file = @dir = nil
@path = '<stdin>'
@lineno = 1 # IMPORTANT lineno assignment must proceed prepare_lines call!
elsif cursor.is_a? ::String
@file = cursor
@dir, @path = ::File.split @file
@lineno = 1 # IMPORTANT lineno assignment must proceed prepare_lines call!
else
@file = cursor.file
@dir = cursor.dir
@path = cursor.path || '<stdin>'
if @file
unless @dir
# REVIEW might to look at this assignment closer
@dir = ::File.dirname @file
@dir = nil if @dir == '.' # right?
end
unless cursor.path
@path = ::File.basename @file
end
end
@lineno = cursor.lineno || 1 # IMPORTANT lineno assignment must proceed prepare_lines call!
end
@lines = data ? (prepare_lines data, opts) : []
@source_lines = @lines.dup
@eof = @lines.empty?
@look_ahead = 0
@process_lines = true
@unescape_next_line = false
end
# Internal: Prepare the lines from the provided data
#
# This method strips whitespace from the end of every line of
# the source data and appends a LF (i.e., Unix endline). This
# whitespace substitution is very important to how Asciidoctor
# works.
#
# Any leading or trailing blank lines are also removed.
#
# data - A String Array of input data to be normalized
# opts - A Hash of options to control what cleansing is done
#
# Returns The String lines extracted from the data
def prepare_lines data, opts = {}
if data.is_a? ::String
if opts[:normalize]
Helpers.normalize_lines_from_string data
else
data.split EOL
end
else
if opts[:normalize]
Helpers.normalize_lines_array data
else
data.dup
end
end
end
# Internal: Processes a previously unvisited line
#
# By default, this method marks the line as processed
# by incrementing the look_ahead counter and returns
# the line unmodified.
#
# Returns The String line the Reader should make available to the next
# invocation of Reader#read_line or nil if the Reader should drop the line,
# advance to the next line and process it.
def process_line line
@look_ahead += 1 if @process_lines
line
end
# Public: Check whether there are any lines left to read.
#
# If a previous call to this method resulted in a value of false,
# immediately returned the cached value. Otherwise, delegate to
# peek_line to determine if there is a next line available.
#
# Returns True if there are more lines, False if there are not.
def has_more_lines?
!(@eof || (@eof = peek_line.nil?))
end
# Public: Peek at the next line and check if it's empty (i.e., whitespace only)
#
# This method Does not consume the line from the stack.
#
# Returns True if the there are no more lines or if the next line is empty
def next_line_empty?
peek_line.nil_or_empty?
end
# Public: Peek at the next line of source data. Processes the line, if not
# already marked as processed, but does not consume it.
#
# This method will probe the reader for more lines. If there is a next line
# that has not previously been visited, the line is passed to the
# Reader#process_line method to be initialized. This call gives
# sub-classess the opportunity to do preprocessing. If the return value of
# the Reader#process_line is nil, the data is assumed to be changed and
# Reader#peek_line is invoked again to perform further processing.
#
# direct - A Boolean flag to bypasses the check for more lines and immediately
# returns the first element of the internal @lines Array. (default: false)
#
# Returns the next line of the source data as a String if there are lines remaining.
# Returns nothing if there is no more data.
def peek_line direct = false
if direct || @look_ahead > 0
@unescape_next_line ? @lines[0][1..-1] : @lines[0]
elsif @eof || @lines.empty?
@eof = true
@look_ahead = 0
nil
else
# FIXME the problem with this approach is that we aren't
# retaining the modified line (hence the @unescape_next_line tweak)
# perhaps we need a stack of proxy lines
if !(line = process_line @lines[0])
peek_line
else
line
end
end
end
# Public: Peek at the next multiple lines of source data. Processes the lines, if not
# already marked as processed, but does not consume them.
#
# This method delegates to Reader#read_line to process and collect the line, then
# restores the lines to the stack before returning them. This allows the lines to
# be processed and marked as such so that subsequent reads will not need to process
# the lines again.
#
# num - The Integer number of lines to peek.
# direct - A Boolean indicating whether processing should be disabled when reading lines
#
# Returns A String Array of the next multiple lines of source data, or an empty Array
# if there are no more lines in this Reader.
def peek_lines num = 1, direct = true
old_look_ahead = @look_ahead
result = []
num.times do
if (line = read_line direct)
result << line
else
break
end
end
unless result.empty?
result.reverse_each {|line| unshift line }
@look_ahead = old_look_ahead if direct
end
result
end
# Public: Get the next line of source data. Consumes the line returned.
#
# direct - A Boolean flag to bypasses the check for more lines and immediately
# returns the first element of the internal @lines Array. (default: false)
#
# Returns the String of the next line of the source data if data is present.
# Returns nothing if there is no more data.
def read_line direct = false
if direct || @look_ahead > 0 || has_more_lines?
shift
else
nil
end
end
# Public: Get the remaining lines of source data.
#
# This method calls Reader#read_line repeatedly until all lines are consumed
# and returns the lines as a String Array. This method differs from
# Reader#lines in that it processes each line in turn, hence triggering
# any preprocessors implemented in sub-classes.
#
# Returns the lines read as a String Array
def read_lines
lines = []
while has_more_lines?
lines << shift
end
lines
end
alias :readlines :read_lines
# Public: Get the remaining lines of source data joined as a String.
#
# Delegates to Reader#read_lines, then joins the result.
#
# Returns the lines read joined as a String
def read
read_lines * EOL
end
# Public: Advance to the next line by discarding the line at the front of the stack
#
# direct - A Boolean flag to bypasses the check for more lines and immediately
# returns the first element of the internal @lines Array. (default: true)
#
# Returns a Boolean indicating whether there was a line to discard.
def advance direct = true
!!read_line(direct)
end
# Public: Push the String line onto the beginning of the Array of source data.
#
# Since this line was (assumed to be) previously retrieved through the
# reader, it is marked as seen.
#
# line_to_restore - the line to restore onto the stack
#
# Returns nothing.
def unshift_line line_to_restore
unshift line_to_restore
nil
end
alias :restore_line :unshift_line
# Public: Push an Array of lines onto the front of the Array of source data.
#
# Since these lines were (assumed to be) previously retrieved through the
# reader, they are marked as seen.
#
# Returns nothing.
def unshift_lines lines_to_restore
# QUESTION is it faster to use unshift(*lines_to_restore)?
lines_to_restore.reverse_each {|line| unshift line }
nil
end
alias :restore_lines :unshift_lines
# Public: Replace the next line with the specified line.
#
# Calls Reader#advance to consume the current line, then calls
# Reader#unshift to push the replacement onto the top of the
# line stack.
#
# replacement - The String line to put in place of the next line (i.e., the line at the cursor).
#
# Returns nothing.
def replace_next_line replacement
advance
unshift replacement
nil
end
# deprecated
alias :replace_line :replace_next_line
# Public: Strip off leading blank lines in the Array of lines.
#
# Examples
#
# @lines
# => ["", "", "Foo", "Bar", ""]
#
# skip_blank_lines
# => 2
#
# @lines
# => ["Foo", "Bar", ""]
#
# Returns an Integer of the number of lines skipped
def skip_blank_lines
return 0 if eof?
num_skipped = 0
# optimized code for shortest execution path
while (next_line = peek_line)
if next_line.empty?
advance
num_skipped += 1
else
return num_skipped
end
end
num_skipped
end
# Public: Skip consecutive lines containing line comments and return them.
#
# Examples
# @lines
# => ["// foo", "bar"]
#
# comment_lines = skip_comment_lines
# => ["// foo"]
#
# @lines
# => ["bar"]
#
# Returns the Array of lines that were skipped
def skip_comment_lines opts = {}
return [] if eof?
comment_lines = []
include_blank_lines = opts[:include_blank_lines]
while (next_line = peek_line)
if include_blank_lines && next_line.empty?
comment_lines << shift
elsif (commentish = next_line.start_with?('//')) && (match = CommentBlockRx.match(next_line))
comment_lines << shift
comment_lines.push(*(read_lines_until(:terminator => match[0], :read_last_line => true, :skip_processing => true)))
elsif commentish && CommentLineRx =~ next_line
comment_lines << shift
else
break
end
end
comment_lines
end
# Public: Skip consecutive lines that are line comments and return them.
def skip_line_comments
return [] if eof?
comment_lines = []
# optimized code for shortest execution path
while (next_line = peek_line)
if CommentLineRx =~ next_line
comment_lines << shift
else
break
end
end
comment_lines
end
# Public: Advance to the end of the reader, consuming all remaining lines
#
# Returns nothing.
def terminate
@lineno += @lines.size
@lines.clear
@eof = true
@look_ahead = 0
nil
end
# Public: Check whether this reader is empty (contains no lines)
#
# Returns true if there are no more lines to peek, otherwise false.
def eof?
!has_more_lines?
end
alias :empty? :eof?
# Public: Return all the lines from `@lines` until we (1) run out them,
# (2) find a blank line with :break_on_blank_lines => true, or (3) find
# a line for which the given block evals to true.
#
# options - an optional Hash of processing options:
# * :break_on_blank_lines may be used to specify to break on
# blank lines
# * :skip_first_line may be used to tell the reader to advance
# beyond the first line before beginning the scan
# * :preserve_last_line may be used to specify that the String
# causing the method to stop processing lines should be
# pushed back onto the `lines` Array.
# * :read_last_line may be used to specify that the String
# causing the method to stop processing lines should be
# included in the lines being returned
#
# Returns the Array of lines forming the next segment.
#
# Examples
#
# data = [
# "First line\n",
# "Second line\n",
# "\n",
# "Third line\n",
# ]
# reader = Reader.new data, nil, :normalize => true
#
# reader.read_lines_until
# => ["First line", "Second line"]
def read_lines_until options = {}
result = []
advance if options[:skip_first_line]
if @process_lines && options[:skip_processing]
@process_lines = false
restore_process_lines = true
else
restore_process_lines = false
end
if (terminator = options[:terminator])
break_on_blank_lines = false
break_on_list_continuation = false
else
break_on_blank_lines = options[:break_on_blank_lines]
break_on_list_continuation = options[:break_on_list_continuation]
end
skip_comments = options[:skip_line_comments]
line_read = false
line_restored = false
complete = false
while !complete && (line = read_line)
complete = while true
break true if terminator && line == terminator
# QUESTION: can we get away with line.empty? here?
break true if break_on_blank_lines && line.empty?
if break_on_list_continuation && line_read && line == LIST_CONTINUATION
options[:preserve_last_line] = true
break true
end
break true if block_given? && (yield line)
break false
end
if complete
if options[:read_last_line]
result << line
line_read = true
end
if options[:preserve_last_line]
unshift line
line_restored = true
end
else
unless skip_comments && line.start_with?('//') && CommentLineRx =~ line
result << line
line_read = true
end
end
end
if restore_process_lines
@process_lines = true
@look_ahead -= 1 if line_restored && !terminator
end
result
end
# Internal: Shift the line off the stack and increment the lineno
#
# This method can be used directly when you've already called peek_line
# and determined that you do, in fact, want to pluck that line off the stack.
#
# Returns The String line at the top of the stack
def shift
@lineno += 1
@look_ahead -= 1 unless @look_ahead == 0
@lines.shift
end
# Internal: Restore the line to the stack and decrement the lineno
def unshift line
@lineno -= 1
@look_ahead += 1
@eof = false
@lines.unshift line
end
def cursor
Cursor.new @file, @dir, @path, @lineno
end
# Public: Get information about the last line read, including file name and line number.
#
# Returns A String summary of the last line read
def line_info
%(#{@path}: line #{@lineno})
end
alias :next_line_info :line_info
def prev_line_info
%(#{@path}: line #{@lineno - 1})
end
# Public: Get a copy of the remaining Array of String lines managed by this Reader
#
# Returns A copy of the String Array of lines remaining in this Reader
def lines
@lines.dup
end
# Public: Get a copy of the remaining lines managed by this Reader joined as a String
def string
@lines * EOL
end
# Public: Get the source lines for this Reader joined as a String
def source
@source_lines * EOL
end
# Public: Get a summary of this Reader.
#
#
# Returns A string summary of this reader, which contains the path and line information
def to_s
line_info
end
end
# Public: Methods for retrieving lines from AsciiDoc source files, evaluating preprocessor
# directives as each line is read off the Array of lines.
class PreprocessorReader < Reader
attr_reader :include_stack
attr_reader :includes
# Public: Initialize the PreprocessorReader object
def initialize document, data = nil, cursor = nil
@document = document
super data, cursor, :normalize => true
include_depth_default = document.attributes.fetch('max-include-depth', 64).to_i
include_depth_default = 0 if include_depth_default < 0
# track both absolute depth for comparing to size of include stack and relative depth for reporting
@maxdepth = {:abs => include_depth_default, :rel => include_depth_default}
@include_stack = []
@includes = (document.references[:includes] ||= [])
@skipping = false
@conditional_stack = []
@include_processor_extensions = nil
end
def prepare_lines data, opts = {}
result = super
# QUESTION should this work for AsciiDoc table cell content? Currently it does not.
if @document && (@document.attributes.has_key? 'skip-front-matter')
if (front_matter = skip_front_matter! result)
@document.attributes['front-matter'] = front_matter * EOL
end
end
if opts.fetch :condense, true
result.shift && @lineno += 1 while (first = result[0]) && first.empty?
result.pop while (last = result[-1]) && last.empty?
end
if opts[:indent]
Parser.adjust_indentation! result, opts[:indent], (@document.attr 'tabsize')
end
result
end
def process_line line
return line unless @process_lines
if line.empty?
@look_ahead += 1
return ''
end
# NOTE highly optimized
if line.end_with?(']') && !line.start_with?('[') && line.include?('::')
if line.include?('if') && (match = ConditionalDirectiveRx.match(line))
# if escaped, mark as processed and return line unescaped
if line.start_with?('\\')
@unescape_next_line = true
@look_ahead += 1
line[1..-1]
else
if preprocess_conditional_inclusion(*match.captures)
# move the pointer past the conditional line
advance
# treat next line as uncharted territory
nil
else
# the line was not a valid conditional line
# mark it as visited and return it
@look_ahead += 1
line
end
end
elsif @skipping
advance
nil
elsif ((escaped = line.start_with?('\\include::')) || line.start_with?('include::')) && (match = IncludeDirectiveRx.match(line))
# if escaped, mark as processed and return line unescaped
if escaped
@unescape_next_line = true
@look_ahead += 1
line[1..-1]
else
# QUESTION should we strip whitespace from raw attributes in Substitutors#parse_attributes? (check perf)
if preprocess_include match[1], match[2].strip
# peek again since the content has changed
nil
else
# the line was not a valid include line and is unchanged
# mark it as visited and return it
@look_ahead += 1
line
end
end
else
# NOTE optimization to inline super
@look_ahead += 1
line
end
elsif @skipping
advance
nil
else
# NOTE optimization to inline super
@look_ahead += 1
line
end
end
# Public: Override the Reader#peek_line method to pop the include
# stack if the last line has been reached and there's at least
# one include on the stack.
#
# Returns the next line of the source data as a String if there are lines remaining
# in the current include context or a parent include context.
# Returns nothing if there are no more lines remaining and the include stack is empty.
def peek_line direct = false
if (line = super)
line
elsif @include_stack.empty?
nil
else
pop_include
peek_line direct
end
end
# Internal: Preprocess the directive (macro) to conditionally include content.
#
# Preprocess the conditional inclusion directive (ifdef, ifndef, ifeval,
# endif) under the cursor. If the Reader is currently skipping content, then
# simply track the open and close delimiters of any nested conditional
# blocks. If the Reader is not skipping, mark whether the condition is
# satisfied and continue preprocessing recursively until the next line of
# available content is found.
#
# directive - The conditional inclusion directive (ifdef, ifndef, ifeval, endif)
# target - The target, which is the name of one or more attributes that are
# used in the condition (blank in the case of the ifeval directive)
# delimiter - The conditional delimiter for multiple attributes ('+' means all
# attributes must be defined or undefined, ',' means any of the attributes
# can be defined or undefined.
# text - The text associated with this directive (occurring between the square brackets)
# Used for a single-line conditional block in the case of the ifdef or
# ifndef directives, and for the conditional expression for the ifeval directive.
#
# Returns a Boolean indicating whether the cursor should be advanced
def preprocess_conditional_inclusion directive, target, delimiter, text
# must have a target before brackets if ifdef or ifndef
# must not have text between brackets if endif
# don't honor match if it doesn't meet this criteria
# QUESTION should we warn for these bogus declarations?
if ((directive == 'ifdef' || directive == 'ifndef') && target.empty?) ||
(directive == 'endif' && text)
return false
end
# attributes are case insensitive
target = target.downcase
if directive == 'endif'
stack_size = @conditional_stack.size
if stack_size > 0
pair = @conditional_stack[-1]
if target.empty? || target == pair[:target]
@conditional_stack.pop
@skipping = @conditional_stack.empty? ? false : @conditional_stack[-1][:skipping]
else
warn %(asciidoctor: ERROR: #{line_info}: mismatched macro: endif::#{target}[], expected endif::#{pair[:target]}[])
end
else
warn %(asciidoctor: ERROR: #{line_info}: unmatched macro: endif::#{target}[])
end
return true
end
skip = false
unless @skipping
# QUESTION any way to wrap ifdef & ifndef logic up together?
case directive
when 'ifdef'
case delimiter
when nil
# if the attribute is undefined, then skip
skip = !@document.attributes.has_key?(target)
when ','
# if any attribute is defined, then don't skip
skip = target.split(',').none? {|name| @document.attributes.has_key? name }
when '+'
# if any attribute is undefined, then skip
skip = target.split('+').any? {|name| !@document.attributes.has_key? name }
end
when 'ifndef'
case delimiter
when nil
# if the attribute is defined, then skip
skip = @document.attributes.has_key?(target)
when ','
# if any attribute is undefined, then don't skip
skip = target.split(',').none? {|name| !@document.attributes.has_key? name }
when '+'
# if any attribute is defined, then skip
skip = target.split('+').any? {|name| @document.attributes.has_key? name }
end
when 'ifeval'
# the text in brackets must match an expression
# don't honor match if it doesn't meet this criteria
if !target.empty? || !(expr_match = EvalExpressionRx.match(text.strip))
return false
end
lhs = resolve_expr_val expr_match[1]
rhs = resolve_expr_val expr_match[3]
# regex enforces a restricted set of math-related operations
if (op = expr_match[2]) == '!='
skip = lhs.send :==, rhs
else
skip = !(lhs.send op.to_sym, rhs)
end
end
end
# conditional inclusion block
if directive == 'ifeval' || !text
@skipping = true if skip
@conditional_stack << {:target => target, :skip => skip, :skipping => @skipping}
# single line conditional inclusion
else
unless @skipping || skip
# FIXME slight hack to skip past conditional line
# but keep our synthetic line marked as processed
# QUESTION can we use read_line true and unshift twice instead?
conditional_line = peek_line true
replace_next_line text.rstrip
unshift conditional_line
return true
end
end
true
end
# Internal: Preprocess the directive (macro) to include the target document.
#
# Preprocess the directive to include the target document. The scenarios
# are as follows:
#
# If SafeMode is SECURE or greater, the directive is ignore and the include
# directive line is emitted verbatim.
#
# Otherwise, if an include processor is specified pass the target and
# attributes to that processor and expect an Array of String lines in return.
#
# Otherwise, if the max depth is greater than 0, and is not exceeded by the
# stack size, normalize the target path and read the lines onto the beginning
# of the Array of source data.
#
# If none of the above apply, emit the include directive line verbatim.
#
# target - The name of the source document to include as specified in the
# target slot of the include::[] macro
#
# Returns a Boolean indicating whether the line under the cursor has changed.
def preprocess_include raw_target, raw_attributes
if (target = @document.sub_attributes raw_target, :attribute_missing => 'drop-line').empty?
advance
if @document.attributes.fetch('attribute-missing', Compliance.attribute_missing) == 'skip'
unshift %(Unresolved directive in #{@path} - include::#{raw_target}[#{raw_attributes}])
end
true
# assume that if an include processor is given, the developer wants
# to handle when and how to process the include
elsif include_processors? &&
(extension = @include_processor_extensions.find {|candidate| candidate.instance.handles? target })
advance
# FIXME parse attributes if requested by extension
extension.process_method[@document, self, target, AttributeList.new(raw_attributes).parse]
true
# if running in SafeMode::SECURE or greater, don't process this directive
# however, be friendly and at least make it a link to the source document
elsif @document.safe >= SafeMode::SECURE
# FIXME we don't want to use a link macro if we are in a verbatim context
replace_next_line %(link:#{target}[])
true
elsif (abs_maxdepth = @maxdepth[:abs]) > 0 && @include_stack.size >= abs_maxdepth
warn %(asciidoctor: ERROR: #{line_info}: maximum include depth of #{@maxdepth[:rel]} exceeded)
false
elsif abs_maxdepth > 0
if ::RUBY_ENGINE_OPAL
# NOTE resolves uri relative to currently loaded document
# NOTE we defer checking if file exists and catch the 404 error if it does not
# TODO only use this logic if env-browser is set
target_type = :file
include_file = path = if @include_stack.empty?
::Dir.pwd == @document.base_dir ? target : (::File.join @dir, target)
else
::File.join @dir, target
end
elsif Helpers.uriish? target
unless @document.attributes.has_key? 'allow-uri-read'
replace_next_line %(link:#{target}[])
return true
end
target_type = :uri
include_file = path = target
if @document.attributes.has_key? 'cache-uri'
# caching requires the open-uri-cached gem to be installed
# processing will be automatically aborted if these libraries can't be opened
Helpers.require_library 'open-uri/cached', 'open-uri-cached' unless defined? ::OpenURI::Cache
elsif !::RUBY_ENGINE_OPAL
# autoload open-uri
::OpenURI
end
else
target_type = :file
# include file is resolved relative to dir of current include, or base_dir if within original docfile
include_file = @document.normalize_system_path(target, @dir, nil, :target_name => 'include file')
unless ::File.file? include_file
warn %(asciidoctor: WARNING: #{line_info}: include file not found: #{include_file})
replace_next_line %(Unresolved directive in #{@path} - include::#{target}[#{raw_attributes}])
return true
end
#path = @document.relative_path include_file
path = PathResolver.new.relative_path include_file, @document.base_dir
end
inc_lines = nil
tags = nil
attributes = {}
if !raw_attributes.empty?
# QUESTION should we use @document.parse_attribues?
attributes = AttributeList.new(raw_attributes).parse
if attributes.has_key? 'lines'
inc_lines = []
attributes['lines'].split(DataDelimiterRx).each do |linedef|
if linedef.include?('..')
from, to = linedef.split('..', 2).map(&:to_i)
if to == -1
inc_lines << from
inc_lines << 1.0/0.0
else
inc_lines.concat ::Range.new(from, to).to_a
end
else
inc_lines << linedef.to_i
end
end
inc_lines = inc_lines.sort.uniq
elsif attributes.has_key? 'tag'
tags = [attributes['tag']].to_set
elsif attributes.has_key? 'tags'
tags = attributes['tags'].split(DataDelimiterRx).to_set
end
end
if inc_lines
unless inc_lines.empty?
selected = []
inc_line_offset = 0
inc_lineno = 0
begin
open(include_file, 'r') do |f|
f.each_line do |l|
inc_lineno += 1
take = inc_lines[0]
if take.is_a?(::Float) && take.infinite?
selected.push l
inc_line_offset = inc_lineno if inc_line_offset == 0
else
if f.lineno == take
selected.push l
inc_line_offset = inc_lineno if inc_line_offset == 0
inc_lines.shift
end
break if inc_lines.empty?
end
end
end
rescue
warn %(asciidoctor: WARNING: #{line_info}: include #{target_type} not readable: #{include_file})
replace_next_line %(Unresolved directive in #{@path} - include::#{target}[#{raw_attributes}])
return true
end
advance
# FIXME not accounting for skipped lines in reader line numbering
push_include selected, include_file, path, inc_line_offset, attributes
end
elsif tags
unless tags.empty?
selected = []
inc_line_offset = 0
inc_lineno = 0
active_tag = nil
tags_found = ::Set.new
begin
open(include_file, 'r') do |f|
f.each_line do |l|
inc_lineno += 1
# must force encoding here since we're performing String operations on line
l.force_encoding(::Encoding::UTF_8) if FORCE_ENCODING
l = l.rstrip
# tagged lines in XML may end with '-->'
tl = l.chomp('-->').rstrip
if active_tag
if tl.end_with?(%(end::#{active_tag}[]))
active_tag = nil
else
selected.push l unless tl.end_with?('[]') && TagDirectiveRx =~ tl
inc_line_offset = inc_lineno if inc_line_offset == 0
end
else
tags.each do |tag|
if tl.end_with?(%(tag::#{tag}[]))
active_tag = tag
tags_found << tag
break
end
end if tl.end_with?('[]') && TagDirectiveRx =~ tl
end
end
end
rescue
warn %(asciidoctor: WARNING: #{line_info}: include #{target_type} not readable: #{include_file})
replace_next_line %(Unresolved directive in #{@path} - include::#{target}[#{raw_attributes}])
return true
end
unless (missing_tags = tags.to_a - tags_found.to_a).empty?
warn %(asciidoctor: WARNING: #{line_info}: tag#{missing_tags.size > 1 ? 's' : nil} '#{missing_tags * ','}' not found in include #{target_type}: #{include_file})
end
advance
# FIXME not accounting for skipped lines in reader line numbering
push_include selected, include_file, path, inc_line_offset, attributes
end
else
begin
# NOTE read content first so that we only advance cursor if IO operation succeeds
include_content = open(include_file, 'r') {|f| f.read }
advance
push_include include_content, include_file, path, 1, attributes
rescue
warn %(asciidoctor: WARNING: #{line_info}: include #{target_type} not readable: #{include_file})
replace_next_line %(Unresolved directive in #{@path} - include::#{target}[#{raw_attributes}])
return true
end
end
true
else
false
end
end
# Public: Push source onto the front of the reader and switch the context
# based on the file, document-relative path and line information given.
#
# This method is typically used in an IncludeProcessor to add source
# read from the target specified.
#
# Examples
#
# path = 'partial.adoc'
# file = File.expand_path path
# data = IO.read file
# reader.push_include data, file, path
#
# Returns nothing.
def push_include data, file = nil, path = nil, lineno = 1, attributes = {}
@include_stack << [@lines, @file, @dir, @path, @lineno, @maxdepth, @process_lines]
if file
@file = file
@dir = File.dirname file
# only process lines in AsciiDoc files
@process_lines = ASCIIDOC_EXTENSIONS[::File.extname(file)]
else
@file = nil
@dir = '.' # right?
# we don't know what file type we have, so assume AsciiDoc
@process_lines = true
end
@path = if path
@includes << Helpers.rootname(path)
path
else
'<stdin>'
end
@lineno = lineno
if attributes.has_key? 'depth'
depth = attributes['depth'].to_i
depth = 1 if depth <= 0
@maxdepth = {:abs => (@include_stack.size - 1) + depth, :rel => depth}
end
# effectively fill the buffer
if (@lines = prepare_lines data, :normalize => true, :condense => false, :indent => attributes['indent']).empty?
pop_include
else
# FIXME we eventually want to handle leveloffset without affecting the lines
if attributes.has_key? 'leveloffset'
@lines.unshift ''
@lines.unshift %(:leveloffset: #{attributes['leveloffset']})
@lines.push ''
if (old_leveloffset = @document.attr 'leveloffset')
@lines.push %(:leveloffset: #{old_leveloffset})
else
@lines.push ':leveloffset!:'
end
# compensate for these extra lines
@lineno -= 2
end
# FIXME kind of a hack
#Document::AttributeEntry.new('infile', @file).save_to_next_block @document
#Document::AttributeEntry.new('indir', @dir).save_to_next_block @document
@eof = false
@look_ahead = 0
end
nil
end
def pop_include
if @include_stack.size > 0
@lines, @file, @dir, @path, @lineno, @maxdepth, @process_lines = @include_stack.pop
# FIXME kind of a hack
#Document::AttributeEntry.new('infile', @file).save_to_next_block @document
#Document::AttributeEntry.new('indir', ::File.dirname(@file)).save_to_next_block @document
@eof = @lines.empty?
@look_ahead = 0
end
nil
end
def include_depth
@include_stack.size
end
def exceeded_max_depth?
if (abs_maxdepth = @maxdepth[:abs]) > 0 && @include_stack.size >= abs_maxdepth
@maxdepth[:rel]
else
false
end
end
# TODO Document this override
# also, we now have the field in the super class, so perhaps
# just implement the logic there?
def shift
if @unescape_next_line
@unescape_next_line = false
super[1..-1]
else
super
end
end
# Private: Ignore front-matter, commonly used in static site generators
def skip_front_matter! data, increment_linenos = true
front_matter = nil
if data[0] == '---'
original_data = data.dup
front_matter = []
data.shift
@lineno += 1 if increment_linenos
while !data.empty? && data[0] != '---'
front_matter.push data.shift
@lineno += 1 if increment_linenos
end
if data.empty?
data.unshift(*original_data)
@lineno = 0 if increment_linenos
front_matter = nil
else
data.shift
@lineno += 1 if increment_linenos
end
end
front_matter
end
# Private: Resolve the value of one side of the expression
#
# Examples
#
# expr = '"value"'
# resolve_expr_val expr
# # => "value"
#
# expr = '"value'
# resolve_expr_val expr
# # => "\"value"
#
# expr = '"{undefined}"'
# resolve_expr_val expr
# # => ""
#
# expr = '{undefined}'
# resolve_expr_val expr
# # => nil
#
# expr = '2'
# resolve_expr_val expr
# # => 2
#
# @document.attributes['name'] = 'value'
# expr = '"{name}"'
# resolve_expr_val expr
# # => "value"
#
# Returns The value of the expression, coerced to the appropriate type
def resolve_expr_val val
if ((val.start_with? '"') && (val.end_with? '"')) ||
((val.start_with? '\'') && (val.end_with? '\''))
quoted = true
val = val[1...-1]
else
quoted = false
end
# QUESTION should we substitute first?
# QUESTION should we also require string to be single quoted (like block attribute values?)
if val.include? '{'
val = @document.sub_attributes val, :attribute_missing => 'drop'
end
if quoted
val
else
if val.empty?
nil
elsif val == 'true'
true
elsif val == 'false'
false
elsif val.rstrip.empty?
' '
elsif val.include? '.'
val.to_f
else
# fallback to coercing to integer, since we
# require string values to be explicitly quoted
val.to_i
end
end
end
def include_processors?
if @include_processor_extensions.nil?
if @document.extensions? && @document.extensions.include_processors?
!!(@include_processor_extensions = @document.extensions.include_processors)
else
@include_processor_extensions = false
end
else
@include_processor_extensions != false
end
end
def to_s
%(#<#{self.class}@#{object_id} {path: #{@path.inspect}, line #: #{@lineno}, include depth: #{@include_stack.size}, include stack: [#{@include_stack.map {|inc| inc.to_s}.join ', '}]}>)
end
end
end
```
|
```objective-c
--- qcppdialogimpl.h.orig 2009-06-23 15:35:06.000000000 -0500
+++ qcppdialogimpl.h 2011-09-14 03:18:04.000000000 -0500
@@ -105,4 +105,21 @@
};
+#if defined(__FreeBSD__)
+
+#define DEVLIST "/dev/cuaU0"<<"/dev/cuaU1"<<"/dev/cuad0"<<"/dev/cuad1";
+#define DEFAULT_DEV "/dev/cuaU0"
+
+#elif defined(__APPLE__)
+
+#define DEVLIST "/dev/cu.usbserial"<<"/dev/cu.KeySerial1";
+#define DEFAULT_DEV "/dev/cu.usbserial"
+
+#else // Default to Linux devices.
+
+#define DEVLIST "/dev/ttyS0"<<"/dev/ttyS1"<<"/dev/ttyS2"<<"/dev/ttyS3";
+#define DEFAULT_DEV "/dev/ttyS0"
+
+#endif
+
#endif
```
|
```smalltalk
// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// ==========================================================================
using Microsoft.AspNetCore.Mvc.Filters;
using Squidex.Domain.Apps.Entities;
namespace Squidex.Web.Pipeline;
public sealed class ContextFilter : IAsyncActionFilter
{
public Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
{
var httpContext = context.HttpContext;
var requestContext =
new Context(httpContext.User, null!).Clone(builder =>
{
foreach (var (key, value) in httpContext.Request.Headers)
{
if (key.StartsWith("X-", StringComparison.OrdinalIgnoreCase))
{
builder.SetHeader(key, value.ToString());
}
}
});
httpContext.Features.Set(requestContext);
return next();
}
}
```
|
Hrvatsko slovo was a weekly culture magazine from Zagreb. It was founded in 1995 by prominent Croatian writers Mile Pešorda, Dubravko Horvatić, Nedjeljko Fabrio, Stjepan Šešelj and Mile Maslać.
At the founding meeting in Zagreb, held on March 28, 1995, the concept of the new weekly magazine, presented by Dubravko Horvatić, was accepted, as well as Milo Pešorda's proposal that the magazine bears the name Hrvatsko slovo. The first issue of Hrvasko Slovo was published in Zagreb on April 28, 1995 by its founders, writer Dubravko Horvatić, editor-in-chief, Stjepan Šešelj, director, Mile Pešorda, deputy editor-in-chief and editor for literature, and DHK president Nedjeljko Fabrio. One of the co-creators was the Croatian poet Mile Maslać, later deputy editor-in-chief of the newspaper. The magazine published works of Hrvoje Hitrec, Zoran Tadić, Sven Lasta, Mirko Marjanović, Ljubica Štefan and many others.
Hrvatsko slovo has been discontinued on 11 February 2022, citing lack of financial support requested from the Ministry of Culture and Media.
Notable contributors
Many prominent Croatians have contributed to the magazine.
Notable contributors from various fields, such writers, artists, scientists, as well as experts in various fields, include Vlado Andrilović, Ivan Aralica, Ivan Babić, Stjepan Sulek (editor-in-chief), Franjo Brkic, Emil Čić, Tomislav Dretar, Malkica Dugeč, Nela Eržišnik, Dubravko Horvatić, Marijan Krmpotić, Krešimir Mišak, Javor Novak, Mladen Pavković, Mile Pešorda, Zlatko Tomičić, Marijan Horvat-Mileković, Tomislav Sunić, Tin Kolumbić, Nevenka Nekic, Zvonimir Magdić, Ivan Sionić, Ivan Biondić, Branimir Souček, Zoran Vukman, Branka Hlevnjak, Igor Mrduljaš, Nenad Piskac, Esad Jogić, Lidija Bajuk, Zeljko Sabol, Ivan Boždar (alias Satir or wild man), Damir Pesord, Benjamin Tolić, Davor Dijanović, Ivica Luetić, Sanja Nikčević, Ati Salvaro and others.
Publishing
Hrvatsko Slovo published by its own Library of Hrvasko Slovo, has published the works of these Croatian and other distinguished writers: Veljko Barbieri, Mirko Marjanović, Đurđica Ivanišević, Hrvoje Hitrec, Stjepan Šešelj, Igor Mrduljaš, Ljubica Štefan, Sven Lasta, Maja Freundlich, Dubravko Horvatić, Benjamin Tolić, Milan Vuković, Zoran Tadic, Mladen Rojnica, Mate Kovacevic, Pero Pavlović and others.
Awards created
The magazine established two prizes: Dubravko Horvatić Prize (for prose and poetry) and Ljubica Štefan Prize (for historical and scientific contributions).
References
External links
Official pages
Hrvatsko slovo at the pages of Croatian Cultural Found
1995 establishments in Croatia
Magazines established in 1995
Magazines disestablished in 2022
Defunct magazines published in Croatia
Mass media in Zagreb
Cultural magazines
Weekly magazines
Croatian-language magazines
2018 disestablishments in Croatia
|
```java
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.graal.compiler.core.match;
import static jdk.graal.compiler.debug.DebugOptions.LogVerbose;
import jdk.graal.compiler.core.gen.NodeLIRBuilder;
import jdk.graal.compiler.core.match.MatchPattern.MatchResultCode;
import jdk.graal.compiler.core.match.MatchPattern.Result;
import jdk.graal.compiler.debug.Assertions;
import jdk.graal.compiler.debug.CounterKey;
import jdk.graal.compiler.debug.DebugContext;
import jdk.graal.compiler.graph.GraalGraphError;
import jdk.graal.compiler.graph.Node;
import jdk.graal.compiler.nodeinfo.Verbosity;
import jdk.graal.compiler.nodes.StructuredGraph;
import jdk.graal.compiler.nodes.cfg.HIRBlock;
import jdk.vm.ci.meta.Value;
/**
* A named {@link MatchPattern} along with a {@link MatchGenerator} that can be evaluated to replace
* one or more {@link Node}s with a single {@link Value}.
*/
public class MatchStatement {
private static final CounterKey MatchStatementSuccess = DebugContext.counter("MatchStatementSuccess");
/**
* A printable name for this statement. Usually it's just the name of the method doing the
* emission.
*/
private final String name;
/**
* The actual match pattern.
*/
private final MatchPattern pattern;
/**
* The method in the {@link NodeLIRBuilder} subclass that will actually do the code emission.
*/
private MatchGenerator generatorMethod;
/**
* The name of arguments in the order they are expected to be passed to the generator method.
*/
private String[] arguments;
public MatchStatement(String name, MatchPattern pattern, MatchGenerator generator, String[] arguments) {
this.name = name;
this.pattern = pattern;
this.generatorMethod = generator;
this.arguments = arguments;
}
/**
* Attempt to match the current statement against a Node.
*
* @param builder the current builder instance.
* @param node the node to be matched
* @param block the current block
* @param schedule the schedule that's being used
* @return true if the statement matched something and set a {@link ComplexMatchResult} to be
* evaluated by the NodeLIRBuilder.
*/
public boolean generate(NodeLIRBuilder builder, int index, Node node, HIRBlock block, StructuredGraph.ScheduleResult schedule) {
DebugContext debug = node.getDebug();
assert index == schedule.getBlockToNodesMap().get(block).indexOf(node) : Assertions.errorMessage(index, block, node, schedule);
// Check that the basic shape matches
Result result = pattern.matchShape(node, this);
if (result != Result.OK) {
return false;
}
// Now ensure that the other safety constraints are matched.
MatchContext context = new MatchContext(builder, this, index, node, block, schedule);
result = pattern.matchUsage(node, context);
if (result == Result.OK) {
// Invoke the generator method and set the result if it's non null.
ComplexMatchResult value = generatorMethod.match(builder.getNodeMatchRules(), buildArgList(context));
if (value != null) {
context.setResult(value);
MatchStatementSuccess.increment(debug);
DebugContext.counter("MatchStatement[%s]", getName()).increment(debug);
return true;
}
// The pattern matched but some other code generation constraint disallowed code
// generation for the pattern.
if (LogVerbose.getValue(node.getOptions())) {
debug.log("while matching %s|%s %s %s returned null", context.getRoot().toString(Verbosity.Id), context.getRoot().getClass().getSimpleName(), getName(), generatorMethod.getName());
debug.log("with nodes %s", formatMatch(node));
}
} else {
if (LogVerbose.getValue(node.getOptions()) && result.code != MatchResultCode.WRONG_CLASS) {
debug.log("while matching %s|%s %s %s", context.getRoot().toString(Verbosity.Id), context.getRoot().getClass().getSimpleName(), getName(), result);
}
}
return false;
}
/**
* @param context
* @return the Nodes captured by the match rule in the order expected by the generatorMethod
*/
private Object[] buildArgList(MatchContext context) {
Object[] result = new Object[arguments.length];
for (int i = 0; i < arguments.length; i++) {
if ("root".equals(arguments[i])) {
result[i] = context.getRoot();
} else {
result[i] = context.namedNode(arguments[i]);
if (result[i] == null) {
throw new GraalGraphError("Can't find named node %s", arguments[i]);
}
}
}
return result;
}
public String formatMatch(Node root) {
return pattern.formatMatch(root);
}
public MatchPattern getPattern() {
return pattern;
}
public String getName() {
return name;
}
@Override
public String toString() {
return pattern.toString();
}
}
```
|
The Gandhi Murder is a 2019 historical political thriller film directed by Karim Traïdia and Pankaj Sehgal. It examines the events leading to the assassination of Mahatma Gandhi. It stars Stephen Lang, Luke Pasqualino, Om Puri and Vinnie Jones.
Plot
Set in the fraught aftermath of India’s independence from Britain and the partition of British India into India and Pakistan, the film follows the conflicted — and failed — efforts of three disparate Indian police officers (Stephen Lang, Luke Pasqualino and Om Puri) to act upon intel suggesting that Hindu militants were planning to kill Gandhi (Jesus Sans) for his tolerance of Muslims.
Cast
Stephen Lang as D.I.G Sunil Raina
Luke Pasqualino as DCP Jimmy
Om Puri as T.G.
Vinnie Jones as Sir Norman Smith
Vikas Shrivastav as Nathuram Godse
Jesus Sans as Gandhi
Bobbie Phillips as Elizabeth
Mark Moses as Sir Percy Sillitoe
Rajit Kapur as Jawaharlal Nehru
Elissar as Edwina – Seductress
Nassar as SSP Ashok
Vivaan Tiwari as Inspector Onkar
Raajpal Yadav as DSP Singh
Gregory Schwabe as Lord Mountbatten
Colton Tapp as John Booth
Anant Mahadevan as Professor Jain
Avtar Gill as Sardar Patel
Govind Namdeo as Morarji Desai; D.S. Parchure
Joseph K. Bevilacqua as Abraham Lincoln
Behzad Khan as Vishnu Karkare
Sachin Nikam as DSP Doel
Lisa Holsappel-Marrs as Edwina Mountbatten
Ravi Gossain as Nana
Gaurav Mohindra as Sub Inspector Deshmukh
Vishal Om Prakash as Inspector (CID) Raj
Alessa Novelli as Emily
Alen Thomson as Madan Lal
Amit Verma as Samsher
Pankaj Sehgal as Sam
Chetan Arora as ACP Rao Saheb Gurtu
Reception
The Guardian panned the film, awarding it one star and criticizing the strange casting choices (such as Lang as an Indian character) and poor production values. The New York Times was equally critical, questioning the basis of the film and calling the production 'shoddy'. The Los Angeles Times called the script 'clunky' and said 'Its timely messages become muted amid a kaleidoscope of settings, characters, brusque action scenes, blunt speechifying and wan romance.'
See also
List of artistic depictions of Mahatma Gandhi
References
External links
2019 films
2010s historical thriller films
British historical thriller films
British Indian films
Cultural depictions of Mahatma Gandhi
English-language Indian films
Films about Mahatma Gandhi
Films set in India
Films set in the 1940s
Films set in the partition of India
Films set in the Indian independence movement
Works about the Mahatma Gandhi assassination
Cultural depictions of Jawaharlal Nehru
Cultural depictions of Vallabhbhai Patel
Morarji Desai
2010s English-language films
2010s British films
|
was a Japanese athlete. He competed in the men's pole vault at the 1932 Summer Olympics.
References
External links
1909 births
Year of death missing
Athletes (track and field) at the 1932 Summer Olympics
Japanese male pole vaulters
Olympic athletes for Japan
Place of birth missing
|
```javascript
import styled from 'styled-components';
const Test = styled.div.withConfig({
displayName: "Test"
})`width:100%;`;
const Test2 = styled('div').withConfig({
displayName: "Test2"
})``;
const Test3 = true ? styled.div.withConfig({
displayName: "Test3"
})`` : styled.div.withConfig({
displayName: "Test3"
})``;
const styles = {
One: styled.div.withConfig({
displayName: "One"
})``
};
let Component;
Component = styled.div.withConfig({
displayName: "Component"
})``;
const WrappedComponent = styled(Inner).withConfig({
displayName: "WrappedComponent"
})``;
class ClassComponent {}
ClassComponent.Child = styled.div.withConfig({
displayName: "Child"
})``;
var GoodName = BadName = styled.div.withConfig({
displayName: "GoodName"
})``;
```
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.