text:
\section{Introduction}
There has been recent interest in using retrieved neighbors within text generation systems~\citep[\textit{inter alia}]{song2016two,weston2018retrieve,guu2018generating,zhang2018guiding,peng2019text}. The use of neighbors --- retrieved examples of good text (perhaps paired with the source information on which they condition) --- is motivated by assuming that generation is easier in the presence of relevant neighbors, or that neighbors allow for more interpretable or controllable generation.

Whereas most work along these lines has adopted a conventional encoder-decoder framework, conditioning on the retrieved neighbors and then autoregressively generating text token-by-token from left to right (see Section~\ref{sec:related} for related work), we instead propose to generate text by directly splicing together segments of text from retrieved neighbors. We believe this makes generation even more interpretable, and that it moreover aligns with the intuition that in settings where we must generate formulaic text, such as in table-to-text generation, it ought to be sufficient to retrieve a sentence similar to the one that must be generated, and then merely change some details, such as names or dates; see Figure~\ref{fig:example}.

We further believe that generation techniques that make clear the provenance of each and every segment appearing in a generation (e.g., by tying each segment to a particular neighbor) will be valuable for preventing text generation systems from emitting harmful or biased text~\citep[\textit{inter alia}]{sheng2019woman,wallace2019universal,gehman2020realtoxicityprompts}; that is, we might imagine preventing generation systems from emitting harmful or biased text by only allowing them to piece together text from approved neighbor examples.

We accordingly propose to generate text by training a policy to directly insert or replace spans of neighbor text at arbitrary positions within a partially constructed generation, and we define a generalized $\ginsert$ function capable of such manipulations in Section~\ref{sec:splicing}. We further propose to train this policy in a fairly simple way, with ``teacher forcing''~\citep{williams1989learning}, which requires having, for each training example, an oracle sequence of $\ginsert$ manipulations (or ``actions'' in imitation learning parlance) that derive it. We define a shortest sequence of actions deriving a training example from its neighbors to be an oracle one, and we prove that, given some neighbors, this oracle sequence of actions can be obtained by parsing under a particular weighted context-free grammar, introduced in Section~\ref{sec:WCFG}.

We experiment with two table-to-text datasets and one headline generation dataset, and we find that policies trained on these oracle derivations are competitive with more standard autoregressive policies that generate by copying neighbor tokens from left to right, though in all but one case neighbor-based policies are slightly inferior to a strong neighborless baseline. However, because our policies attempt to minimize the number of $\ginsert$ actions used in generating text, they generate in many fewer actions than conventional autoregressive token-by-token policies, and are faster. Our code is available at \url{https://github.com/swiseman/neighbor-splicing}.

\begin{figure*}[t!]
    \centering

    \includegraphics[scale=0.63]{cropped_nuneighborfigure}
    \caption{Generating a target sentence from the WikiBio dataset, ``Ayelet Nahmias-Verbin (born 19 June 1970) is an Israeli lawyer and politician.'' Top right: neighbor sequences $\nu^{(0)}, \nu^{(1)}, \nu^{(2)}$ to be used in generation; $\nu^{(0)}$ is from the corresponding table. Bottom right: a sequence of $\ginsert$ operations (see Equation~\eqref{eq:insert}) deriving the target sentence from the neighbors above. Left: the parse of the target sentence under the grammar in Section~\ref{sec:WCFG} corresponding to the derivation on the bottom right.}
    \label{fig:example}
\end{figure*}

\section{Background and Notation}
Conditional text generation tasks involve generating a sequence of tokens $\hat{y}_1, \ldots, \hat{y}_T \,{=}\, \hat{y}_{1:T}$ conditioned on some $x \,{\in}\, \mathcal{X}$, where each generated token $\hat{y}_t$ is from a vocabulary $\mathcal{V}$. We will consider in particular the tasks of table-to-text generation, where $x$ is some tabular data and $\hat{y}_{1:T}$ is a natural language description of it, and headline generation, where $x$ is a news article or a selection from a news article, and $\hat{y}_{1:T}$ is a headline for the article. These tasks, which require the generation of relatively formulaic text, appear to be the best candidates for being tackled with nearest neighbor-based methods.

In terms of supervision, we will assume we have access to a dataset, which pairs an input $x$ with a \textit{true} corresponding reference text $y_{1:T_x} \,{\in}\, \mathcal{V}^{T_x}$ consisting of $T_x$ tokens. Since we are interested in nearest neighbor-based generation, we will also assume that along with each input $x$ we have a set $\mathcal{N} \,{=}\, \{\nu^{(n)}_{1:T_n}\}_{n=1}^N$ of $N$ neighbor sequences, with each $\nu^{(n)}_t \,{\in}\, \mathcal{V}$. We will be interested in learning to form $y_{1:T_x}$ from its corresponding $x$ and neighbor set $\mathcal{N}$ in a way that will be made more precise below. We note that finding an appropriate set of neighbor sequences to allow for successful generation with respect to an input $x$ is an interesting and challenging problem (see, e.g., \citet{hashimoto2018retrieve}), but for the purposes of our exposition we will assume these neighbor sequences are easy to obtain given only $x$ (and without knowledge of $y$).

\subsection{Imitation Learning for Text Generation}
\label{sec:ilbackground}
Much recent work views conditional text generation as implementing a policy $\pi : \mathcal{X} \times \mathcal{V}^* \rightarrow \mathcal{A} \cup \{\langle\text{stop}\rangle\}$~\citep{bengio2015scheduled,ranzato2016sequence}; see~\citet{welleck2019non}
for a recent review. That is, we view a generation algorithm as implementing a policy that consumes an input $x \,{\in}\, \mathcal{X}$ as well as a partially constructed output in the Kleene closure of $\mathcal{V}$, which we will refer to as a ``canvas'' \citep{stern2019insertion}, and which outputs either an action $a \,{\in}\, \mathcal{A}$ or a decision to stop. Taking action $a$ leads (deterministically in a text generation setting) to a new canvas, and so generation is accomplished by following $\pi$ from some distinguished start canvas until a $\langle\text{stop}\rangle$ decision is made, and returning the resulting canvas. For example, standard sequence-to-sequence style generation~\citep{sutskever2014sequence,cho2014on} can be viewed as implementing a special case of such a policy, where $\pi$ consumes $x$ and a canvas $\hat{y}_{1:M} \,{\in}\, \mathcal{V}^{M}$ representing a prefix, and produces either an action $a \,{\in}\, \mathcal{A} \,{=}\, \mathcal{V}$, or else produces a $\langle\text{stop}\rangle$ action and generation terminates. When an action $a \,{\in}\, \mathcal{V}$ is chosen, this leads to the formation of a new prefix canvas $\hat{y}_{1:M} \cdot a$, where $\cdot$ is the concatenation operator.

Imitation learning of text generation policies conventionally proceeds by ``rolling in'' to a canvas $\hat{y}_{1:M}$ using a roll-in policy, and then training a parameterized policy $\pi_{\boldsymbol{\theta}}$ to mimic the actions of an oracle policy $\pi^*$ run from $\hat{y}_{1:M}$. The most common form of such training in the context of neural text generation is known as ``teacher forcing''~\citep{williams1989learning}, which simply amounts to using $\pi^*$ to roll-in to some (oracle) canvas $y_{1:M}$, viewing $\pi_{\boldsymbol{\theta}}$ as a probabilistic classifier, and training $\pi_{\boldsymbol{\theta}}$ using the action $\pi^*(x, y_{1:M})$ as its target. Though training with teacher forcing (known as ``behavioral cloning'' in the imitation learning literature~\citep{pomerleau1989alvinn,bain1995framework}), can result in certain pathologies~\citep{daume09search,ross11a,chang2015learning}, it is often effective in practice, and we adopt it to train all our policies.

In the remainder of the paper we will adopt the policy-based perspective on conditional text generation just described, and we will attempt to learn a policy that generates text by splicing together text from retrieved neighbors. In order to do this, we will make use of a more general form of policy than that implemented by standard sequence-to-sequence models. In particular, we will make use of policies that allow for both inserting an arbitrary span of neighbor text (rather than a single token) anywhere in a canvas, as well as for \textit{replacing} an arbitrary span of text in a canvas with a span of neighbor text, as we make more precise in the next section. Before doing so we note that there has been much recent interest in generalizing the forms of policy used in generating text, including to allow for various forms of span insertion; see Section~\ref{sec:related} for references and a discussion.

\section{Splicing Nearest Neighbors}
\label{sec:splicing}
 Given a canvas $\hat{y}_{1:M} \,{\in}\, \mathcal{V}^M$ and a set of neighbor sequences $\mathcal{N} \,{=}\, \{\nu^{(n)}_{1:T_n}\}_{n=1}^N$, we define a generalized insertion function, which forms a new canvas from $\hat{y}_{1:M}$. This generalized insertion function implements the following mapping

\vspace*{-0.5cm}
\begin{align}\label{eq:insert}
   \small
    \ginsert(\hat{y}_{1:M}, i, j, n, k, l) \mapsto \hat{y}_{1:i} \cdot \nu^{(n)}_{k:l} \cdot \hat{y}_{j:M},
\end{align}

\vspace*{-0.3cm}
\noindent where $\cdot$ is again the concatenation operator, the slice indexing is inclusive, $ 0 \leq i < j \leq M+1$,\footnote{We take $\hat{y}_{1:0}$ and $\hat{y}_{M+1:M}$ to be empty sequences.} and $1 \leq k \leq l \leq T_n$. Note that this generalized insertion function allows for multi-token (i.e., span) insertion into any position in the canvas (i.e., when $j \,{=}\, i+1$), as well as for multi-token replacement of any multi-token span in the canvas (i.e., when $j > i+1$). It does not, however, allow for mere deletion of tokens. Intuitively, this generalized insertion function attempts to capture a generation scheme where text is generated by making only minor insertions or replacements in some existing text. For example, we might imagine generating a new sentence by copying a neighbor sentence to our canvas, and then simply replacing the names or dates in this neighbor sentence to form a new sentence; see Figure~\ref{fig:example} for an example.

Having defined this insertion function, we can generate text with a policy that consumes an input $x$, a set of neighbors, and a canvas,\footnote{To conform with our general definition of a text generation policy $\pi$ above, we will view $\mathcal{X}$ as consisting of pairs of inputs $x$ and neighbor sets.} and outputs the arguments of the $\ginsert$ function, or else the $\langle\text{stop}\rangle$ action to terminate generation. That is, for a given canvas and neighbor set, we take our policy to produce actions in

\vspace*{-0.5cm}
{\small
\begin{align*}
\mathcal{A}_{\mathrm{ins}}(\hat{y}_{1:M}) \,{=}\, \{&(i, j, n, k, l) \,{\in}\, \mathbb{N}^5 \mid 0 \leq i < j \leq M{+}1, \\
&1 \leq n \leq N, 1 \leq k \leq l \leq T_n \}
\end{align*}
}

\vspace*{-0.6cm}
\noindent or else the $\langle\text{stop}\rangle$ action. We show an example of generating with such a policy in Figure~\ref{fig:example}.

\subsection{An Oracle Policy}
\label{sec:oraclepolicy}
As described in Section~\ref{sec:ilbackground}, we are interested in learning a parameterized text generation policy $\pi_{\boldsymbol{\theta}}$. In particular, since we would like to generate using the generalized $\ginsert$ function in Equation~\eqref{eq:insert}, we will attempt to learn a parameterized distribution $\pi_{\boldsymbol{\theta}}(\cdot \,|\, x, \hat{y}_{1:M}, \mathcal{N})$ over the arguments to this $\ginsert$ function given input $x$, canvas $\hat{y}_{1:M}$, and neighbor set $\mathcal{N}$, by training it with the one-hot action distribution $\pi^*(x, y_{1:M}, \mathcal{N})$ as its target. In order to do so, however, we must first obtain an oracle policy $\pi^*$. That is, for each true output $y_{1:T_x}$ in our dataset, we require an oracle sequence of canvases paired with corresponding oracle actions in $\mathcal{A}_{\mathrm{ins}}$, which derive $y_{1:T_x}$ from $x$ and $\mathcal{N}$. In this section we suggest an efficient approach to obtaining these.

In what follows, we will assume that each word type represented in $y_{1:T_x}$ is also represented among the neighbor sequences; in practice, we can always ensure this is the case by taking our expanded neighbor set to be $\mathcal{N}' \,{=}\, \{\nu^{(n)}_{1:T_n}\}_{n=1}^N \cup \mathcal{V} \setminus \bigcup_{n,t} \{\nu^{(n)}_t\}$.
Furthermore, because $x$ itself will often also contain spans of words that might be used in forming $y_{1:T_x}$, going forward we will assume $\mathcal{N}'$ also includes the relevant spans from $x$.

In arriving at an oracle policy, we first note that given $\mathcal{N}'$ there will often be many sequences of actions in $\mathcal{A}_{\mathrm{ins}}$ that derive the reference text $y_{1:T_x}$ from an empty canvas. For instance, we can simulate standard left-to-right, token-by-token generation with a sequence of actions $((i, i+1, n_i, k_i, k_i))_{i=0}^{T-1}$ such that $\nu^{(n_i)}_{k_i} \,{=}\, y_i$. However, many other derivations, which insert or replace spans at arbitrary canvas locations, will often be available. We posit that derivations with fewer actions will be more interpretable, all else equal, and so we define our oracle policy to be that which derives $y_{1:T_x}$ from $\mathcal{N}'$ (starting from an empty canvas) in as few actions as possible. While it may not be obvious how to obtain a shortest derivation, we show this optimization problem can be reduced to finding the lowest-cost parse of $y_{1:T_x}$ using a particular weighted context free grammar (WCFG)~\citep{salomaa1969probabilistic}, which can be done in polynomial time with, for instance, the CKY algorithm~\citep{kasami1966efficient,younger1967recognition,baker1979trainable}.

\subsubsection{Reduction to WCFG Parsing} \label{sec:WCFG}
Consider the following WCFG in CNF~\citep{chomsky1959certain}:
\begin{alignat*}{3}
    [1] \quad &S &&\rightarrow Y^{(n)}_{k:l} \quad &&\forall n, k \leq l \\
    [0] \quad&S &&\rightarrow S \, S \quad && \\

    [1] \quad&S &&\rightarrow Y^{(n)}_{k:l} \, C^{(n)}_s \quad &&\forall n, l < s\\
    [0] \quad&C^{(n)}_s &&\rightarrow S \, R^{(n)}_s \quad &&\forall n, s \\
    [0] \quad&R^{(n)}_s &&\rightarrow Y^{(n)}_{s:t} \quad &&\forall n, s \leq t \\

    [0] \quad &R^{(n)}_s &&\rightarrow Y^{(n)}_{s:t} \, C^{(n)}_{u} \quad &&\forall n, s \leq t < u,
\end{alignat*}
where $S$ is the start non-terminal, the non-terminal $Y^{(n)}_{k:l}$ yields $\nu^{(n)}_{k:l}$, and where the bracketed number in the leftmost column gives the cost of the rule application.\footnote{Without the CNF requirement we can obtain a smaller grammar by replacing the 3rd and 4th rules with $S \rightarrow Y^{(n)}_{k:l} \, S \, R^{(n)}_s$ and the last rule with $R^{(n)}_s \rightarrow Y^{(n)}_{s:t} \, S \, R^{(n)}_{u}$.} We can see that there is a cost (of 1) for introducing a new neighbor span with an $S$ non-terminal, but no cost for continuing one we have already introduced.

\begin{claim} \label{claim1}
Given neighbors $\{\nu^{(n)}_{1:T_n}\}_{n=1}^N$, the length of the shortest derivation of a sequence $y$ using actions in $\mathcal{A}_{\mathrm{ins}}$ is equal to the lowest cost derivation of $y$ under the WCFG above.
\end{claim}

\noindent We prove the above claim in \cref{sec:proof}.
The proof proceeds by two simulation arguments.
First, we show that, given a derivation of the sequence $y$ with a certain weight according to the WCFG, we can simulate a subset of the derivations with a number of $\ginsert$ operations equal to the total weight of the derivations and still obtain the sequence $y$. This means that the cost of the \emph{optimal} derivation according to the WCFG is at least the cost of the \emph{optimal} number of $\ginsert$ operations. This simulation is straightforward.
Second, we show that, given a derivation of the sequence $y$ with a certain number of $\ginsert$ operations, we can simulate a subset of the $\ginsert$ operations with a cost-$1$ derivation of the grammar per $\ginsert$ operation. This means that the optimal number of $\ginsert$ operations is at least the cost of the \emph{optimal} derivation according to the WCFG. This simulation is slightly more complicated and involves determining which $\ginsert$ operations are necessary to simulate with the grammar. The two simulations arguments together imply that the optimal WCFG cost and the minimum number of $\ginsert$ operations are equal.

\paragraph{Complexity} If $T$ is the maximum length of any $y$ or $\nu^{(n)}$ sequence, and there are $N$ neighbors, then parsing under the above WCFG with the CKY algorithm is $O(NT^6)$. The runtime is dominated by matching the $S \rightarrow Y^{(n)}_{k:l} \, C^{(n)}_s$ rule; there are $O(NT^3)$ sequences that match the right-hand side (all $k \leq l < s$ for all $\nu^{(n)}$), and we must consider this rule for each span in $y$ and each split-point.

\paragraph{Obtaining the policy} With Claim~\ref{claim1} in hand, we obtain an oracle action sequence deriving $y_{1:T_x}$ from its neighbors by first computing the minimum-cost parse tree, and then doing a depth-first left-to-right traversal of the tree.\footnote{While we can obtain multiple derivations, each corresponding to a different depth-first traversal, we found using only the left-to-right traversal to be most effective.} We can obtain all the arguments for an $\ginsert$ operation after seeing all the children of its corresponding $S$ non-terminal. For example, in Figure~\ref{fig:example}, the insert operations on the bottom right follow the order in which $S$ non-terminals are encountered in a left-to-right, depth-first traversal of the tree on the left; the arguments of the operation that introduces $\nu^{(2)}$, for example, are determined by keeping track of the corresponding $S$'s distance from the left sentence-boundary and the length of the span it yields.

To train our models, we precompute these oracle derivations for each $(x, y_{1:T_x}, \mathcal{N}')$ triplet in our training corpus, and train with teacher forcing; we elaborate further in Section~\ref{sec:training}.

\subsection{Additional Oracle Policies}
We will refer to policies derived as above as ``\textsc{Full}{}'' policies. While \textsc{Full}{} policies minimize the number of $\ginsert$ operations used in deriving $y_{1:T_x}$, there are at least two other reasonable oracle policies to consider.

\paragraph{Left-to-right, span-level policies (\textsc{L2RS}):} We consider the oracle policy which minimizes the number of insert actions under the constraint that $y_{1:T_x}$ is formed by concatenating neighbor spans $\nu^{(n)}_{k:l}$ from left to right. These policies give rise to action sequences of the form $((i_m, i_m+l_m - k_m+1, n_m, k_m, l_m))_{m=1}^M$ such that $\nu^{(n_m)}_{k_m:l_m} \,{=}\, y_{i_m:i_m + l_m - k_m- 1}$ and $i_{m+1} = i_m + l_m - k_m$. Unlike \textsc{Full}{} policies, an oracle \textsc{L2RS}{} policy can be obtained by greedily selecting spans in $\mathcal{N}'$ that agree with $y_{1:T_x}$ from left to right. To see this (informally): suppose an L2RS action sequence $s$ with a non-greedy $m$th action is shorter than any greedy action sequence. A sequence that replaces this $m$th action with a greedy one and then updates the left boundary of a subsequent action to account for the greed is at least as short as $s$, contradicting its optimality.

\paragraph{Left-to-right, token-level policies (\textsc{L2RT}):} We consider the oracle policy which derives $y_{1:T_x}$ from left to right, one token at a time. As noted above, this corresponds to a sequence of actions $((i, i+1, n_i, k_i, k_i))_{i=0}^{T-1}$ such that $\nu^{(n_i)}_{k_i} \,{=}\, y_i$. This policy is identical to that typically used in training sequence-to-sequence generation models, except each token comes from an element of $\mathcal{N}'$. Thus, in particular, a generated token is always copied from a neighbor sequence if it can be, rather than being purely generated as in standard sequence-to-sequence generation.

\section{Models and Training}
While we might prefer to learn a distribution directly over arguments to the $\ginsert$ function, this would require directly parameterizing a distribution over an impractically large number of combinations, even for moderate values of $N$ and the neighbor lengths $T_n$. As such, we factorize the distribution over arguments as

\vspace*{-0.3cm}

\begin{align} \label{eq:factorization}
\pi_{\boldsymbol{\theta}}(i, j, n, k, l) &= \pi_{\boldsymbol{\theta}}(j, l \,|\, i, n, k) \times \pi_{\boldsymbol{\theta}}(i, n, k),
\end{align}
}

\vspace*{-0.3cm}
\noindent where we have left out the explicit conditioning on $x$, $\hat{y}_{1:M}$, and $\mathcal{N}'$ for brevity. Thus, our policy first predicts an insertion of token $\nu^{(n)}_k$ after the canvas token $\hat{y}_i$. Conditioned on this, the policy then predicts the final token $\nu^{(n)}_l$ of the inserted span, and which canvas token $\hat{y}_j$ immediately follows it.

More concretely, we obtain token-level representations $\mathbf{x}_1, \ldots, \mathbf{x}_S$ and $\hat{\mathbf{y}}_0, \ldots, \hat{\mathbf{y}}_{M+1}$, all in $\mathbb{R}^d$, of source sequence $x \,{=}\, x_{1:S}$ and of canvas sequence $\hat{y}_{1:M}$, padded on each side with a special token, by feeding them to an encoder-decoder style transformer~\citep{vaswani2017attention} with no causal masking. We obtain neighbor token representations $\boldsymbol{\nu}^{(n)}_k$ by feeding neighbor sequences through the same encoder transformer that consumes $x$. We provide additional architectural details in the appendix. Viewing the source sequence $x$ as the $0$th neighbor, we then define

{\small
\begin{align*}
    \pi_{\boldsymbol{\theta}}(i, n, k) \propto \begin{cases} \exp(\hat{\mathbf{y}}_{i-1}^{\top} \mathbf{W}_1 \mathbf{W}_0 \, \mathbf{x}_k) &\text{if $n \,{=}\, 0$} \\
                                                 \exp(\hat{\mathbf{y}}_{i-1}^{\top} \mathbf{W}_1 \mathbf{W}_2 \, \boldsymbol{\nu}^{(n)}_k) &\text{otherwise,}
                                    \end{cases}
\end{align*}
}

\noindent where the normalization is over all pairings of a canvas token with either a neighbor or source token, and where $\mathbf{W}_0$, $\mathbf{W}_1$, and $\mathbf{W}_2$, all in $\mathbb{R}^{d\times d}$, are learnable transformations. Similarly, we define
{\small
\begin{align*}
    \pi_{\boldsymbol{\theta}}(j, l \,|\, i, n, k) \propto \begin{cases} \exp(\hat{\mathbf{y}}_{j+1}^{\top} \mathbf{W}_4 \mathbf{W}_3 \, \mathbf{x}_l) &\text{if $n \,{=}\, 0$} \\
                                                 \exp(\hat{\mathbf{y}}_{j+1}^{\top} \mathbf{W}_4 \mathbf{W}_5 \, \boldsymbol{\nu}^{(n)}_l) &\text{otherwise,}
                                    \end{cases}
\end{align*}
}

\noindent where now the normalization only considers pairings of the $j$th canvas token with the $l$th neighbor or source token, where $j > i, l \geq k$. $\mathbf{W}_3$, $\mathbf{W}_4$, and $\mathbf{W}_5$ are again learnable transformations in $\mathbb{R}^{d\times d}$.

While the above parameterizations are appropriate for \textsc{Full}{} policies, \textsc{L2RS}{} and \textsc{L2RT}{} policies always insert after the most recently inserted span or token (respectively). As such, for \textsc{L2RS}{} we only require the policies $\pi_{\boldsymbol{\theta}}(l \,|\, i, n, k) \times \pi_{\boldsymbol{\theta}}(n, k \,|\, i)$, which are computed as above, using just the current $\hat{\mathbf{y}}_{i-1}$ in the equations above, and normalizing only over the applicable token options. \textsc{L2RT}{} requires only a single $\pi_{\boldsymbol{\theta}}(n, k \,|\, i)$ policy.

\subsection{Training}
\label{sec:training}
As noted in Section~\ref{sec:oraclepolicy}, we propose to train our policies to imitate the oracle derivations obtained by the CKY parse, using teacher-forcing. Suppose that, for a given (oracle) canvas $y_{1:M}$ and set of neighbors $\mathcal{N}'$, the oracle next-action obtained from the parse is $(i^*, j^*, n^*, k^*, l^*)$. Since there may be multiple spans in $\mathcal{N}'$ that are identical to $\nu^{(n^*)}_{k^*:l^*}$, we train the $\pi_{\boldsymbol{\theta}}(i, n, k)$ policy to minimize

\vspace*{-0.3cm}
{\small
\begin{align} \label{eq:loss1}
    - \log \sum_{\{(n, k, l) \mid \nu^{(n)}_{k:l} = \nu^{(n^*)}_{k^*:l^*} \}} \pi_{\boldsymbol{\theta}}(i^*, n, k),
\end{align}
}

\vspace*{-0.3cm}
\noindent which is similar to a ``coaching''-style oracle~\citep{he2012imitation}, where the best oracle action under the learner's current policy is selected as the target.
The $\pi_{\boldsymbol{\theta}}(j, l \,|\, i, n, k)$ policy is simply trained to minimize

\vspace*{-0.4cm}
{\small
\begin{align} \label{eq:loss2}
    - \log \pi_{\boldsymbol{\theta}}(j^*, l^* \,|\, i^*, n^*, k^*),
\end{align}
}

\vspace*{-0.4cm}
\noindent since there is only one correct target given $i^*, n^*, k^*$.

Training proceeds by sampling a mini-batch of examples and their corresponding derivations, and minimizing the sums of the losses~\eqref{eq:loss1} and~\eqref{eq:loss2} over each action in each derivation, divided by the mini-batch size. To minimize memory consumption, for each action in each derivation we form the policy distributions above by randomly sampling only $R$ of the $N$ neighbor sequences in $\mathcal{N}'$, in addition to the oracle one.

\section{Experiments}
\paragraph{Datasets} We expect the nearest neighbor-based generation approaches we have presented to work best for tasks where it is common for different generations to have similar surface characteristics. Table-to-text generation and headline generation tasks both meet this requirement, and are accordingly often used to evaluate generation that makes use of retrieved neighbors~\citep{peng2019text,lin2020record} or induced templates~\citep{wiseman2018learning,li2020posterior}. Thus, following recent work, we evaluate on the E2E~\citep{novikova2017e2e} and WikiBio~\citep{lebret2016neural} table-to-text generation datasets, and the Gigaword~\citep{graff2003english} headline generation dataset of \citet{rush2015a}. A priori, we might expect the Gigaword dataset to be the most challenging, since neighbors must be retrieved based on article text (rather than tables), and because it exhibits more variability than the table-to-text datasets due to its size ($\approx$ 3.8 million examples). Our results confirm this hypothesis.

\paragraph{Preprocessing}
We whitespace-tokenize the text, and heuristically mask spans in neighbor sequences that appear to be copied from their corresponding sources; this discourages derivations from copying content words from retrieved neighbors. See the appendix for details. We pad each $y$ and $\nu^{(n)}$ sequence with beginning- and end-of-sequence tokens, which encourages derivations that insert into the middle of sequences, rather than merely concatenating. For the Gigaword training set, we filter duplicate source-target pairs, leaving about 3.4 million examples.

\paragraph{Obtaining Neighbors} We precompute neighbors for each training example, taking the closest 100 neighbors to each example in the training data (excluding itself) under a simple, task-specific semimetric $d(\cdot, \cdot)$ defined over pairs of inputs in $\mathcal{X}$. For the E2E and WikiBio datasets, we have $d(x, x') \,{=}\, 1.1 - F_1(\mathrm{fields}(x), \mathrm{fields}(x')) - 0.1 F_1(\mathrm{values}(x),\mathrm{values}(x'))$, where $\mathrm{fields}$ extracts the field-types (e.g., ``name'') from the table $x$,   $\mathrm{values}$ extracts the unigrams that appear as values in $x$, and $F_1$ is the $F_1$-score. For headline generation, we use the cosine distance between article embeddings computed using the \texttt{roberta-base-nli-mean-tokens} model of \citet{reimers2019sentence}. For just the Gigaword headline generation experiments, we augmented the 100 closest neighbors for each training example with 100 prototype headlines extracted from the training dataset by running the FAISS~\citep{JDH17} implementation of K-Means~\citep{lloyd1982least} on the embeddings of each headline under the above embedding model of \citet{reimers2019sentence}, and selecting the headlines closest to each centroid.

\paragraph{Model and Training Details} We compare \textsc{Full}{} policies to \textsc{L2RS}{} and \textsc{L2RT}{} policies, to a more standard transformer-based sequence-to-sequence policy that uses no retrieved neighbors, and to recent models from the literature (see below). The baseline sequence-to-sequence policy is a simple word-based model, with a generation vocabulary limited to the 30000 most frequent target words. The neighbor-based policies, on the other hand, are limited to generating (rather than copying) only from a much smaller vocabulary consisting of target words that occur at least 50 times in the training set and which also cannot be obtained from the target's corresponding neighbors.

All policies are implemented using 6-layer transformer encoders and decoders, with model dimension 420, 7 attention heads, and feed-forward dimension 650. We use the \texttt{huggingface}~\citep{wolf2020transformers} implementation of the BART~\citep{lewis2020bart} architecture, but with no pretraining. For the E2E and Gigaword datasets we sample $R \,{=}\, 50$ neighbor sequences during training, and for WikiBio we sample $R \,{=}\, 45$. We train with Adam~\citep{kingma2015adam,loshchilov2018decoupled}, using linear learning-rate warm-up and square-root decay as in \citet{devlin2019bert}, until validation loss stops decreasing.

\paragraph{Generation}
We generate by beam searching over partial hypotheses constructed first by predicting the $i, n, k$ arguments to the $\ginsert$ function (or just the $n, k$ arguments in the case of \textsc{L2RS}{}), and then the remaining $j, l$ arguments (or just $l$ in the case of \textsc{L2RS}{}), as in Equation~\ref{eq:factorization}. We search up to a maximum number of actions, and in computing the final score of a hypothesis, we average the $\pi_{\boldsymbol{\theta}}$ log probabilities over all the actions taken to construct the hypothesis (rather than summing). We found the \textsc{Full}{} and \textsc{L2RS}{} policies to be sensitive to the number of neighbors included at generation time, and we tune this number as an additional hyperparameter; see Table~\ref{tab:parentresults}. See the appendix for additional hyperparameter details.

\begin{table}[t!]
\small
\centering
\begin{tabular}{@{}lccccc@{}}
\toprule
\textbf{E2E} & BLEU & NIST & RG & CID & MET  \\
\midrule
\textsc{Full} & 68.9 & 9.33 & 72.9 & 2.07 & 45.4 \\
\textsc{L2RS} & 57.3 & 7.99 & 63.0 & 1.79 & 41.7 \\
\textsc{L2RT} & 64.1 & 8.38 & 68.5 & 2.11 & 43.3 \\
\midrule
S2S (ours) & 64.7 & 8.26 & 69.1 & 2.22 & 43.7 \\
L\&R & 67.1 & 8.52 & 68.7 & 2.24 & 45.4 \\
\toprule
\textbf{WB} & BLEU & NIST & RG-4 & & \\
\midrule
\textsc{Full} & 42.7 & 9.31 & 40.7 &  &  \\
\textsc{L2RS} & 40.5 & 9.49 & 35.7 &  &  \\
\textsc{L2RT} & 44.6 & 9.77 & 42.8 &  &  \\
\midrule
S2S (ours)  & 45.4 & 9.72 & 44.6 & & \\
Peng et al. & 44.1 & - & 41.1 &  &  \\
L\&R   & 44.7 & 9.92 & 43.3 & \\
\toprule
\textbf{GW} & RG-1 & RG-2 & RG-L & & \\
\midrule
\textsc{Full} & 34.7 & 15.8 & 32.0 &  &  \\
\textsc{L2RS} & 35.8 & 16.5 & 33.0 &  &  \\
\textsc{L2RT} & 36.0 & 17.5 & 33.5 &  &  \\
\midrule
S2S (ours) & 37.0 &  18.2 & 34.4 &  & \\
Peng et al. & 37.3 & 18.5 & 34.7 &  &  \\
\bottomrule
\end{tabular}
\caption{From top-to-bottom, BLEU~\citep{papineni02bleu}, NIST, ROUGE~\citep{lin2004rouge}, CIDEr~\citep{vedantam2015cider} and METEOR~\citep{banerjee2005meteor} performance on the E2E dataset, BLEU, NIST, ROUGE-4 performance on the WikiBio dataset, and ROUGE-1, ROUGE-2, and ROUGE-L performance on the Gigaword dataset. We compare neighbor-based policies with a sequence-to-sequence transformer-based baseline (``S2S''), and with models from \citet{li2020posterior} (``L\&R'') and \citet{peng2019text}.}
\label{tab:autoresults}
\end{table}

\begin{table}[t!]
\small
\centering
\begin{tabular}{lcc}
\toprule
\textbf{E2E} & Par-P & Par-R \\
\midrule
\textsc{Full} & 64.4 & 58.4 \\
\textsc{L2RS} & 53.4 & 57.3 \\
\textsc{L2RT} & 61.0 & 61.5 \\
S2S (ours) & 57.3 & 60.9 \\
\toprule
\textbf{WB} &  & \\
\midrule
\textsc{Full} & 75.8 & 42.6  \\
\textsc{L2RS} & 73.3 & 42.2  \\
\textsc{L2RT} & 77.4 & 43.8  \\
S2S (ours) & 78.1 & 43.7 \\
\toprule
\textbf{GW} & & \\
\midrule
\textsc{Full} & N/A & N/A \\
\textsc{L2RS} & N/A & N/A  \\
\textsc{L2RT} & N/A & N/A  \\
S2S (ours) & N/A & N/A \\
\bottomrule
\end{tabular}
\hspace*{0.3cm}
\begin{tabular}{rrr}
\toprule
\# ins & s/gen & \# ne\\
\midrule
8.7 & 0.294 & 5\\
13.6 & 0.673 & 100\\
23.7 & 0.986 & 100\\
24.6 & 0.359 & 0 \\
\toprule
& \\
\midrule
6.9 & 0.625 & 30 \\
12.0 & 1.003 & 5 \\
21.6 & 2.149 & 100 \\
20.7 & 0.788 & 0 \\
\toprule
& \\
\midrule
4.2 & 0.151 & 110 \\
5.6 & 0.220 & 110 \\
9.2 &  0.571  &  200\\
7.5 & 0.210 & 0 \\
\bottomrule
\end{tabular}
\caption{Left sub-table: PARENT~\citep{dhingra2019handling} precision and recall results on E2E and WikiBio test datasets. For WikiBio, we randomly select 5000 examples to evaluate with PARENT. Right sub-table: average number of insertions per generation, seconds per generation, and number of test-time neighbors used, for each dataset and each type of policy. Results average over 200 generations on the same RTX 2080 Ti GPU.}
\label{tab:parentresults}
\end{table}

\subsection{Evaluation}
In Table~\ref{tab:autoresults} we evaluate models learned under the three oracle policies, using the standard automatic metrics associated with each dataset. There we also compare with a neighborless transformer-based sequence-to-sequence baseline (``S2S'' in tables), as well as with recent results. We consider in particular recent results that we take to be close to the state-of-the-art (for non-pretrained models), and which are also comparable in that they either make use of retrieved neighbors in generation~\citep{peng2019text} or allow for interpretable segments within the generation~\citep{li2020posterior}, but do not make use of any components pretrained on large, external corpora.

In terms of neighbor-based policies, we find in general that the \textsc{Full}{} policies slightly underperform the \textsc{L2RT}{} policies, though are competitive, and that both are roughly on par with previous work in the table-to-text setting. The \textsc{L2RS}{} policies, on the other hand, appear to be inferior. We also find that all neighbor-based policies are slightly outperformed by the S2S baseline, except on the E2E dataset. Indeed, on the E2E dataset (perhaps because of the ease of retrieving similar neighbors), the \textsc{Full}{} policies are best, and outperform, we believe, the state of the art. On the Gigaword dataset, again perhaps due to the difficulty of obtaining good neighbors, the three neighbor-based policies are least competitive with prior work.

In the left sub-table of Table~\ref{tab:parentresults} we further evaluate the table-to-text policies using the PARENT metric~\citep{dhingra2019handling}, which has been shown to correlate well with human judgments of factualness. We find that \textsc{L2RT}{} and S2S policies outperform \textsc{Full}{} ones slightly on the WikiBio data, whereas on the E2E data the \textsc{Full}{} policies are more precise, but have worse recall.

\paragraph{Generation speed} One argument for generating with \textsc{Full}{} or \textsc{L2RS}{} policies, in addition to their interpretability, is that they may allow for generating text in fewer steps, and thus decrease generation time overall. In the right sub-table of Table~\ref{tab:parentresults} we show the average number of insertion operations made by each policy, the average time in seconds per generation, and the number of retrieved neighbors used at test time by each policy (a hyperparameter that is tuned on the development sets; see Appendix~\ref{sec:hypers}). These averages were obtained by averaging over 200 generations (without batching), on the same RTX 2080 Ti GPU.

Unsurprisingly, the \textsc{Full}{} policies make the fewest insertions at test time, followed by \textsc{L2RS}{} and \textsc{L2RT}{}. Furthermore, these differences in numbers of insertion carry over to wall-clock time. Indeed, while each individual insertion under the \textsc{Full}{} policy is more expensive than a \textsc{L2RT}{}, \textsc{L2RS}{}, or S2S insertion (since it requires predicting the insertion in two steps, as in Equation~\ref{eq:factorization}), many fewer insertions are required, and furthermore many fewer retrieved neighbors are required at test time to achieve good performance.\footnote{The results in Table~\ref{tab:parentresults} use the beam sizes reported in Appendix~\ref{sec:hypers}. On the E2E and WikiBio datasets the \textsc{Full}{} policies are faster despite using a \textit{bigger} beam size than the \textsc{L2RT}{} policies. On Gigaword, \textsc{L2RT}{} uses a beam of size 10 while the other policies use a beam of size 5.} We note that one reason \textsc{Full}{} policies may be faster than S2S policies is that the total number of neighbor tokens at prediction time may be smaller or comparable to the S2S policy's output vocabulary.

\section{Related Work}
\label{sec:related}
Structured prediction with nearest neighbors has a long history in NLP, with early work focusing on machine translation~\citep{sumita1991experiments}, syntactic disambiguation~\citep{cardie1994domain}, and tagging~\citep{daelemans1993memory,daelemans1996mbt}. Recent work in neighbor-based structured prediction for tasks other than generation has focused on deriving POS or NER taggings from neighbors in a discrete, interpretable way~\citep{wiseman2019label}, which has a similar motivation to the current work, and on the use of neighbors to audit multi-label text classification predictions~\citep{schmaltz2020exemplar}.

There has been particular recent interest, however, in conditioning a text generation model on one or more retrieved neighbors. This conditioning is variously accomplished using a conventional encoder in an encoder-decoder setup~\citep{song2016two,weston2018retrieve,gu2018search,cao2018encoding,bapna2019non}, by allowing the parameters of the decoder to depend on the retrieved neighbor~\citep{peng2019text}, or by viewing the unknown neighbor as a latent variable~\citep{hashimoto2018retrieve,guu2018generating,chen2019controllable,he2020learning}. Similarly, recent work~\citep{zhang2018guiding,khandelwal2019generalization,khandelwal2020nearest} has used retrieved neighbors at decoding time to modify the next-token distribution of an MT decoder. Our work differs from these approaches in that we explicitly parameterize the splicing operations that form a generation from neighbors, rather than conditioning or otherwise modifying a left-to-right token generation model using retrieved neighbors.

The motivation for parameterizing splicing operations directly is to increase the interpretability of the generation process, which also motivates recent work that makes explicit the template or plan being followed by a neural generator~\citep[\textit{inter alia}]{iyyer2018adversarial,wiseman2018learning,puduppully2019data,chen2019controllable,li2020posterior}.

Our approach is also related to work in non-left-to-right text generation, including tree-based~\citep{welleck2019non,akoury2019syntactically}, non-autoregressive~\citep[\textit{inter alia}]{gu2018non,lee2018deterministic}, masked language model-based~\citep[\textit{inter alia}]{ghazvininejad2019mask}, and, most closely, insertion-based~\citep[\textit{inter alia}]{stern2019insertion,gu2019levenshtein,gu2019insertion} approaches. Despite some similarities, our approach is, to our knowledge, the first that allows for arbitrary span insertion or replacement (from neighbors) during generation.

Our work is also related to generation models that copy spans from left to right~\citep{panthaplackel2021copy} and especially to recent work on sentence-level transduction tasks, like grammatical error correction (GEC), which allows for directly predicting certain span-level edits~\citep{stahlberg2020seq2edits}. These edits are different from our insertion operations, requiring token-level operations except when copying from the source sentence, and are obtained, following a long line of work in GEC~\citep{swanson2012correction,xue2014improved,felice2016automatic,bryant2017automatic}, by heuristically merging token-level alignments obtained with a Damerau-Levenshtein-style algorithm~\citep{brill2000improved}.

\section{Limitations and Future Work}
We conclude by highlighting some limitations of the current work, which we hope to address in the future. While we believe our approach offers an interpretable way of quickly generating formulaic text of competitive quality, it is not clear how this approach might generalize to less formulaic text generation tasks, like machine translation or story generation. Such tasks would presumably require, at a minimum, considering significantly more neighbors, which in turn likely requires more sophisticated retrieval techniques. Recent successes in retrieval-based pretraining~\citep{lewis2020pre,guu2020realm} and translation~\citep{khandelwal2020nearest}, however, suggest this direction may be fruitful.

Relatedly, we emphasize that the current work has left rather unexplored the question of how best to retrieve neighbors for the policies we learn: we use the same number of neighbors per example, and we retrieve these neighbors before training begins in a simple, heuristic way. In future work, we hope to dispense with these simplifications.

In terms of modeling, we note that, by necessity, our models are fairly small and trained from scratch; we hope that larger models, perhaps pretrained, will offer additional performance benefits. We also note that our policies represent the current state using only the current canvas $\hat{y}_{1:M}$ itself; a more sophisticated (and expensive) model would represent the history of actions taken with, for instance, an RNN or transformer.

Finally, in terms of training, we note that oracle derivations are calculated offline. A more sophisticated training scheme would involve searching under the current policy while training, and thus calculating (approximately) optimal next-actions during training as well.

\bibliographystyle{acl_natbib}

redpajama_set_name: RedPajamaArXiv


text:
Grumpy Iowa sports reporter moans his way through hours of live blizzard coverage [VIDEO]
'Can I go back to my regular job?': Grumpy Iowa sports reporter moans his way through live blizzard coverage in hilarious video after being reassigned to morning weather duty
Mark Woodley was forced to cover a blizzard in Waterloo, Iowa, on Thursday
He was forced to do coverage as temperatures were between -0.4F and -5.8F
Plunging temperatures and freezing temperatures have swept the United States
By Eleanor Dye For Mailonline
Published: 10:40 GMT, 23 December 2022 | Updated: 10:56 GMT, 23 December 2022
A grumpy Iowa sports reporter moaned his way through hours of live blizzard coverage after being reassigned to early morning weather duty – as a once-in-a-generation bomb cyclone swept across the US.
Mark Woodley, a sports reporter for KWWL in Waterloo, Iowa, was clearly disgruntled when he was given a live broadcast slot from 4.30am to 8am on Thursday morning.
A hilarious compilation of video clips from his coverage shows the journalist make witty remarks about the cold as he is wrapped up in the sub-freezing weather.
According to Local Conditions, Mark would have been outside at -0.4F (-18C) at the start of his shift, which dropped to -5.8F (-21C) by the end.
The Twitter clip, which now has almost 3 million views, begins with his co-presenter asking: 'Mark, how you feeling out there?' The sports reporter responds: 'The same as I felt eight minutes ago when you asked me that same question.'
Plunging temperatures are wreaking havoc across the United States – with flights cancelled and experts warning that frostbite could affect bare skin within five to ten minutes.
The Twitter clip, which now has almost 3 million views, begins with his co-presenter asking: 'Mark, how you feeling out there?'
The sports reporter responds: 'The same as I felt eight minutes ago when you asked me that same question. I normally do sports.
'Everything is cancelled here for the next couple of days so what better time to ask the sports guy to come in, about five hours earlier than he would normally wake up, go stand out in the wind and the snow and the cold and tell other people not to do the same.'
As the show progresses – and the weather gets even colder – Mark becomes increasingly impatient with the task at hand.
Dressed in a thick black puffer jacket as snow falls in the background, he goes on: 'I didn't realise there was a 3.30 also in the morning – until today.'
A hilarious compilation of video clips from his coverage shows the journalist make witty remarks about the cold as he is wrapped up in the sub-freezing weather. Mark said: 'I didn't realise there was a 3.30 also in the morning – until today'
Plunging temperatures are wreaking havoc across the United States – with flights cancelled and experts warning that frostbite could affect bare skin within five to ten minutes. Pictured: A resident shovels snow off a driveway in Urbandale, Iowa
Mark was outside as temperatures were between -0.4F (-18C) and -5.8F (-21C) in Waterloo, Iowa. Pictured: Cars in Des Moines, Iowa
Mark said he hoped his coverage would encourage people to pay attention and to take the weather seriously. Pictured: Vehicles drive on Interstate 380 as snow falls in North Liberty, Iowa
'I'm used to these evening shows that are only 30 minutes long and generally on those shows I am inside. So this is a really long show. Tune in for the next couple of hours to watch me progressively get crankier and crankier.'
Mark told Insider that filming took place next to KWWL's main news station, so he could warm up between takes.
Even so, the incredibly cold conditions made the few minutes he was outside extremely uncomfortable.
He continued: 'I've got good news and I've got bad news. The good news is that I can still feel my face right now. The bad news is that I kind of wish I couldn't.'
Then looking even more disgruntled, he said: 'Can I go back to my regular job? I'm pretty sure that you guys added an extra hour to this show just because somebody likes torturing me.'
The reluctant weather broadcaster said later on that he hoped adding a few witty remarks would make the report more interesting and would encourage people watching to listen in and to take it seriously.
At the end of his shift, as it began to lighten outside, Mark appears considerably more cheery at the prospect of going home.
'Live in Waterloo for the last time this morning. Thankfully!' he said, as he finished his shift.

redpajama_set_name: RedPajamaCommonCrawl


text:
Q: How do I handle errors that are already handled by another error? I am connecting to a website using Jsoup. I have inserted a .timeout to check if the website times out.
Because I already handle IOException, my IDE is not allowing me to put another catch for SocketTimeOutException, which is fair, I guess.
Is there a way to tell from IOException what is the error?
I'd like to have specific debugging output for different errors, so that I can keep the code clean and efficient.
Here is my code (yes, some variables are missing, they are pretty simple though and not really necessary):
Document doc = null;

try
    {
        doc = Jsoup.connect(Url).proxy(proxy).userAgent(userAgent).timeout(10000).get();
    }
catch (IOException e)
    {
        if (...)
            {
                if(specificThread.running == false) {
                    System.out.println("Thread got interrupted! Link visited -> "+ Url);
                    Thread.currentThread().interrupt();
                }

                try
                    {
                        System.out.println("Localhost detected! If this happens, you're stupid");
                        doc = Jsoup.connect(Url).userAgent(userAgent).get();
                    }
                catch (IOException e1)
                    {
                        System.out.println("Couldn't connect to " + Url + " , localhost was detected.");
                        e1.printStackTrace();
                        System.exit(-1);
                    }
                catch (java.lang.IllegalArgumentException error)
                    {
                        System.out.println("Malformed URL detected ->  " + Url) ;
                    }
            }
        else
            {
                System.out.println("Couldn't connect to " + Url);
                e.printStackTrace();
            }
    }
catch (java.lang.IllegalArgumentException error)
    {
        System.out.println("Malformed URL detected ->  " + Url);
    }
catch (java.net.SocketTimeoutException error) //IDE Is blocking this
    {
        //Handle error here
    }

Is it possible to do this?

A: Put the catch for the SocketTimeoutException before the catch for the IOException.
Exception handling works by looking through a table until a matching exception type is found. As such, more specific exceptions have to come before more general exceptions, in order that they can be matched.

This is described in JLS Sec 14.21, "Unreachable Statements":

It is a compile-time error if a statement cannot be executed because it is unreachable.
...

*

*A catch block C is reachable iff both of the following are true:

*

*...

*There is no earlier catch block A in the try statement such that the type of C's parameter is the same as or a subclass of the type of A's parameter.

So, you just need to make sure there is no earlier catch block catching a superclass parameter.

redpajama_set_name: RedPajamaStackExchange


text:
Ду́глас Мак-Гре́гор () (1906, Детройт — , Массачусетс) — американський соціальний психолог. Дуглас Мак-Грегор створив Теорії мотивації «Х» та «У».

Біографія

Народився Дуглас Мак-Грегор в Детройті (США) в 1906 році.

Ступінь доктора філософії отримав в Гарвардському університеті в 1935, де згодом працював викладачем.

У 1937 перейшов до Массачусетського технологічного інституту (МТІ), де став одним з організаторів відділення виробничих відносин.

У 1948 став ректором Антіохського коледжу.

З 1954 — перший професор-стипендіат Слоуна в Массачусетському технологічному інституті, працював там до самої смерті в 1964 році.

Внесок у теорію менеджменту

На початку 50-х років Мак-Грегор вперше сформулював свої ідеї про управління, які в 1960 році були опубліковані в його головній праці «The Human Side of Enterprise» («Людська сторона підприємства»). Д. Мак-Грегор стверджував, що існує два концептуальні підходи до менеджменту персоналу, перший з яких ґрунтується на «теорії X», а другий — на «теорії Y».

«Теорія X»

Основна теза: середньостатистична людина лінива, не любить працювати і за першої нагоди уникає роботи. Отже, менеджер змушений вдаватися до жорстких (тотальний контроль і система покарань) і м'яких (переконання і заохочення) форм примусу. Але обидва ці методи помилкові, тому що не беруть до уваги причину небажання працювати: справа в тому, що людині мало гідної винагороди за працю, їй необхідна можливість самореалізації, а будь-яка форма примусу цьому перешкоджає.

«Теорія Y»

Діаметрально протилежну тезу обстоює Теорія Y. Людині властиво витрачати моральні і фізичні сили на роботу так само, як відпочивати або грати. Це означає, що людину можна стимулювати до праці, якщо дати їй можливість повністю розкритися, брати на себе відповідальність, відчувати свою значимість для організації. На жаль, зазначає Мак-Грегор, в умовах сучасного індустріального суспільства інтелектуальний потенціал людини використовується не повністю.

Мак-Грегор стверджував, що в одних ситуаціях (наприклад, масове виробництво) годиться тільки теорія X, а в інших — тільки теорія Y. Розуміючи, що повністю реалізувати його теорії на практиці неможливо, Мак-Грегор намагався донести до менеджерів думку про те, що службовці можуть зробити для організації набагато більше, якщо з ними поводитися як з цінними і відповідальними співробітниками.

«Теорія Z»

До своєї смерті в 1964 р. Мак-Грегор працював над теорією Z, в якій намагався поєднати запити і прагнення корпорації і окремої людини. Цю незакінчену роботу продовжив , який взяв її як назву своєї книги, де постарався сформулювати уроки японського менеджменту. В теорії організацій Z, запропонованой Оучи, центральними положеннями є довічна зайнятість працівників, турбота про працівників, в тому числі про їх соціальне життя. Рішення, що приймаються на основі консенсусу, повільне кар'єрне просування, відмінна передача інформації, відданість компанії та активна турбота про досягнення високої якості. Якщо Мак-Грегор прожив би довше і зумів завершити теорію Z, можливо, він прийшов би до варіанту, що містить аналогічні складові.

Бібліографія
 «The Human Side of Enterprise», (1960) («Людська сторона підприємства»)
 «Leadership and Motivation», (1966) («Лідерство та мотивація»)
 «The Professional Manager», (1967) («Професійний менеджер»)

Інше
 Теорія мотивації Дугласа Мак-Грегора

Примітки

Джерела
 Дуглас Мак-Грегор и человеческая сторона предприятия l

Примітки

Детройт
Массачусетс
Гарвардський університет
Массачусетський технологічний інститут
Японський менеджмент
Макгрегори
Психологи США
Теорії мотивації
Соціальні психологи
Випускники Гарвардського університету

redpajama_set_name: RedPajamaWikipedia


While I was in the States last month, in-between attending OSCON in Portland, SciFoo in Mountain View and my flying visit to New York, I headed up to Spreckles Theatre in Rohnert Park, CA, to film an O'Reilly Masterclass in "Making use of iPhone and iPad Location Sensors."
The class guides you through developing applications for the iPhone and iPad platforms that make use of the onboard sensors: the three-axis accelerometer, the magnetometer (digital compass), the gyroscope, the camera and the global positioning system. During the four and a half hour class, amongst various other topics, I talked about face detection on the iPhone and walked through building an Augmented Reality toolkit.
The class is now available for US$99.99 from the O'Reilly Media website.
Included in the price is the full four and half hours of video, a copy of the slides I used on the day with added commentary, fully working Xcode projects allowing you to build and follow along with all the code we built during the class, and two preview chapters from my upcoming book "Programming iPhone Sensors" covering some of the material I talked about during the class.
If you want to see the sort of content you'll get you can view a free preview of the section of the course where I introduce the iPhone accelerometer, and if you're still wavering O'Reilly is running a "Buy 1 video, get 1 free. Buy 2 videos, get 2 free..." promotion all through September. Just enter code "BVGVF" in the O'Reilly shopping cart.


text:
Barcelona Bus Turístic
Catalunya Bus turístic
What to see at Montjuïc
The cable car route
TMB-OCI
Timetables and seasons
Fares and prices
Montjuïc Cable Car will be closed for annual technical inspection from 27 January to 16 February. Sorry for the inconveniences.
A journey through Spain in a single day
Hola Barcelona, your travel solution
Parc Montjuïc Stop
Poble Espanyol, located on Montjuïc Mountain, is an open-air architectural museum that is home to replicas of more than a hundred buildings that are characteristic of various regions of Spain. There are also works of contemporary art on display and you can enjoy Spain's craftwork and gastronomy.
Why visit Poble Espanyol?
Located on Montjuïc Mountain, it was built for the 1929 Universal Exposition. Even though Josep Puig i Cadafalch was behind the initial idea, the project was undertaken by the architects Francesc Folguera and Ramon Reventós, and the artists Xavier Nogués and Miquel Utrillo. This foursome made numerous trips throughout Spain and took photographs, made notes and drew sketches to gather all the information necessary to undertake the project upon their return. The idea was to demolish the enclosure at the end of the Universal Exposition, but it proved so popular that it was maintained.
To get the best out of your visit to Poble Espanyol we recommend you use the audio guides available at the entrance. Visitors can see a typical Andalusian district, part of the Camino de Santiago (Way of Saint James) and examples of Romanesque architecture, among other features. Together they make up a town with streets, houses, squares, theatres, restaurants and craft workshops.
In fact, the replicas of the buildings are so true to life that Poble Espanyol has been used as a movie set. The last scene of the film Perfume: "The Story of a Murderer", directed by Tom Tykwer, based on Patrick Süskind's novel, was shot at Poble Espanyol, which doubled as the main square of the town of Grasse.
At Poble Espanyol you can also visit Fundació Fran Daurel, which has a private collection of contemporary art that includes works by Miró, Dalí and Picasso.
For the most curious of you
Did you know? Poble Espanyol covers a surface area of 49,000 m² and contains 117 full-size buildings.
Local's tip: It also has nightclubs, a theatre and "tablaos" (flamenco venues).
A must: To see emblematic buildings not located in Barcelona.
https://www.poble-espanyol.com
How to get to: Poble Espanyol
Av Francesc Ferrer i Guardia, 13, 08038 Barcelona
41.3688085, 2.1482731999999
10% discount on your online purchase
See more places of interest
National Art Museum of Catalonia
Fundació Fran Daurel
Blue Route: Gaudí· Red Route: Barri Gòtic & Montjuïc · Green Route: Olímpic Harbour & Beach
Premium Montserrat & Gaudí · Easy Montserrat · Dalí's Figueres & Girona · Wine & Cava · La Roca Village Shopping Express® · Pyrenees - Vall de Núria · Pyrenees Snow Experience
Montjuïc cable car
© 2017 Projectes i Serveis de Mobilitat, SA - All rights reserved
This website uses cookies to improve your user experience. You can accept or disable them, by adjusting your browser settings. Browsing our website implies that you accept the use of cookies.


text:
Q: jquery slideshow-tabs and html I have been doing a course online on web-development, the instructor showed us an implementation of slideshow using jquery. I followed every step as instructed, but when I open my browser the images seem to not appear on the slideshow and I don't know if the slideshow box is working.
Here's the link to the jquery tool for the tabs-slideshow:
http://jquerytools.github.io/demos/tabs/slideshow.html
My Questions are:
1.Where have I gone wrong in the code which is preventing the proper working display of the slideshow images and the slideshow box?
2.What is br class="clearing" and .clearing {
    clear:both;} (css file 2) doing exactly?
Thank you in advance.
This is my HTML code:
<!DOCTYPE HTML>

    <meta charset=utf-8>
    <title>Killersites CSS layout Example</title>
    <link href="css/style.css" rel="stylesheet" type="text/css">
    <link href="css/slideshow.css" rel="stylesheet" type="text/css">

    <content>

            Home

Killersites Training

Creating Killersites Since 1998

Home

About

News

Products

Services

Clients

Employment

Contact

Lorem ipsum

dolor sit amet consectetur adipiscing elit. Nulla id nulla risus, vitae consequat dui. Quisque vehicula tellus sed nisl feugiat adipiscing ut in neque. Nullam id sapien eget diam ullamcorper tempus a pharetra enim. Nam at ligula ligula. Maecenas turpis nunc, suscipit et viverra in, cursus eget tortor. Aenean mollis adipiscing est. Cras elementum blandit tincidunt. Aliquam at semper lacus. Etiam hendrerit lacinia mauris, vel fermentum risus venenatis ultrices. Aenean fringilla est interdum metus tempor facilisis ultrices a metus. Sed sit amet tortor sit amet nulla molestie vestibulum. Praesent id sem a libero fermentum volutpat. Maecenas pharetra neque eu leo interdum hendrerit. Morbi diam ipsum, gravida sed scelerisque quis, imperdiet vitae quam. Donec sollicitudin, nunc sit amet convallis sagittis, libero ipsum sollicitudin elit, ac vestibulum ante turpis faucibus tellus. Integer molestie turpis id est ultricies vel commodo magna viverra. Nunc gravida fermentum placerat. Duis lorem augue, tincidunt blandit vehicula quis, aliquam nec tellus.

A Sub Headline

dolor sit amet consectetur adipiscing elit. Nulla id nulla risus, vitae consequat dui. Quisque vehicula tellus sed nisl feugiat adipiscing ut in neque. Nullam id sapien eget diam ullamcorper tempus a pharetra enim. Nam at ligula ligula. Maecenas turpis nunc, suscipit et viverra in, cursus eget tortor. Aenean mollis adipiscing est. Cras elementum blandit tincidunt. Aliquam at semper lacus. Etiam hendrerit lacinia mauris, vel fermentum risus venenatis ultrices.

Another Sub Headline

dolor sit amet consectetur adipiscing elit. Nulla id nulla risus, vitae consequat dui. Quisque vehicula tellus sed nisl feugiat adipiscing ut in neque. Nullam id sapien eget diam ullamcorper tempus a pharetra enim. Nam at ligula ligula. Maecenas turpis nunc, suscipit et viverra in, cursus eget tortor. Aenean mollis adipiscing est. Cras elementum blandit tincidunt. Aliquam at semper lacus. Etiam hendrerit lacinia mauris, vel fermentum risus venenatis ultrices.Sed sit amet tortor sit amet nulla molestie vestibulum. Praesent id sem a libero fermentum volutpat. Maecenas pharetra neque eu leo interdum hendrerit. Morbi diam ipsum, gravida sed scelerisque quis, imperdiet vitae quam. Donec sollicitudin, nunc sit amet convallis sagittis, libero ipsum sollicitudin elit, ac vestibulum ante turpis faucibus tellus. Integer molestie turpis id est ultricies vel commodo magna viverra. Nunc gravida fermentum placerat. Duis lorem augue, tincidunt blandit vehicula quis, aliquam nec tellus.

nested left section

Morbi diam ipsum, gravida sed scelerisque quis, imperdiet vitae quam. Donec sollicitudin, nunc sit amet convallis sagittis, libero ipsum sollicitudin elit, ac vestibulum ante turpis faucibus tellus. Integer molestie turpis id est ultricies vel commodo magna viverra. Nunc gravida fermentum placerat. Duis lorem augue, tincidunt blandit vehicula quis, aliquam nec tellus.

nested right section

Morbi diam ipsum, gravida sed scelerisque quis, imperdiet vitae quam. Donec sollicitudin, nunc sit amet convallis sagittis, libero ipsum sollicitudin elit, ac vestibulum ante turpis faucibus tellus. Integer molestie turpis id est ultricies vel commodo magna viverra. Nunc gravida fermentum placerat. Duis lorem augue, tincidunt blandit vehicula quis, aliquam nec tellus.

Another Sub Headline

dolor sit amet consectetur adipiscing elit. Nulla id nulla risus, vitae consequat dui. Quisque vehicula tellus sed nisl feugiat adipiscing ut in neque. Nullam id sapien eget diam ullamcorper tempus a pharetra enim. Nam at ligula ligula. Maecenas turpis nunc, suscipit et viverra in, cursus eget tortor. Aenean mollis adipiscing est. Cras elementum blandit tincidunt. Aliquam at semper lacus. Etiam hendrerit lacinia mauris, vel fermentum risus venenatis ultrices.Sed sit amet tortor sit amet nulla molestie vestibulum. Praesent id sem a libero fermentum volutpat. Maecenas pharetra neque eu leo interdum hendrerit. Morbi diam ipsum, gravida sed scelerisque quis, imperdiet vitae quam. Donec sollicitudin, nunc sit amet convallis sagittis, libero ipsum sollicitudin elit, ac vestibulum ante turpis faucibus tellus. Integer molestie turpis id est ultricies vel commodo magna viverra. Nunc gravida fermentum placerat. Duis lorem augue, tincidunt blandit vehicula quis, aliquam nec tellus.

©2011 killersites Corp

nested footer section

Morbi diam ipsum, gravida sed scelerisque quis, imperdiet vitae quam. Donec sollicitudin, nunc sit amet convallis sagittis, libero ipsum sollicitudin elit, ac vestibulum ante turpis faucibus tellus.

nested footer section

Morbi diam ipsum, gravida sed scelerisque quis, imperdiet vitae quam. Donec sollicitudin, nunc sit amet convallis sagittis, libero ipsum sollicitudin elit, ac vestibulum ante turpis faucibus tellus.

nested footer section

Morbi diam ipsum, gravida sed scelerisque quis, imperdiet vitae quam. Donec sollicitudin, nunc sit amet convallis sagittis, libero ipsum sollicitudin elit, ac vestibulum ante turpis faucibus tellus.

    </content>

The css file1:
    @charset "UTF-8";
    /* slideshow css */

/* container for slides */
.images {
        background:#fff url(../images/h300.png) repeat-x;
        position:relative;
        height:250px;
        width:940px;
        float:left;
        cursor:pointer;

        }

/* single slide */
.images div {

        display:none;
        position:absolute;
        top:0;
        left:0;
        height:250px;
        font-size:12px;
    }

/* header */
.images h3 {
        font-size:22px;
        font-weight:normal;
        margin:0 0 20px 0;
        color:#456;
    }

/* tabs (those little circles below slides) */
.slidetabs {
        position:absolute;
        top:365px;
        right:20px;
        /*clear:both;
        margin-left:330px;*/
}

/* single tab */
.slidetabs a {
        width:8px;
        height:8px;
        float:left;
        margin:3px;
        background:url(../images/navigator.png) 0 0 no-repeat;
        display:block;
        font-size:1px;
}

/* mouseover state */
.slidetabs a:hover {
        background-position:0 -8px;
}

/* active state (current page state) */
.slidetabs a.current {
        background-position:0 -16px;
}

The CSS File 2:
@charset "UTF-8";
*{
    margin:0px;
    padding:0px;
}

/*html5 display rule */
address, article, aside, canvas, content, details, figcaption, figure, footer, header, hgroup, nav, menu, section, summary {
    display:block;
}

@font-face {
    font-family: 'ChunkFiveRoman';
    src: url('../fonts/chunkfive-webfont.eot');
    src: url('../fonts/chunkfive-webfont.eot?#iefix') format('embedded-opentype'),
         url('../fonts/chunkfive-webfont.woff') format('woff'),
         url('../fonts/chunkfive-webfont.ttf') format('truetype'),
         url('../fonts/chunkfive-webfont.svg#ChunkFiveRoman') format('svg');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'sinkin_sans400_regular';
    src: url('../fonts/sinkinsans-400regular-webfont.woff2') format('woff2'),
         url('../fonts/sinkinsans-400regular-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;

}

body {
    background-color: #353535;
    font-family:Verdana, Geneva, sans-serif;
    font-size:12px;
    background-image: url(../images/dots.png);
}

h1, h2, h3 {
    font-family: 'sinkin_sans400_regular','ChunkFiveRoman', Georgia, "Times New Roman", Times, serif;
    }

content{
    width:940px;
    margin-top:20px;
    margin-right:auto;
    margin-bottom:20px;
    margin-left:auto;
    position:relative;
    background-color:#f2f3ed;
    border-radius:25px;
    -moz-border-radius:25px; /* Firefox 3.6 and earlier */
}

header {
    border-bottom-color: #CCC;
    border-bottom-width: 1px;
    border-bottom-style: solid;
}

header h1 {
    padding:20px 20px 20px 97px;
    color:#353535;
    font-size:42px;

    /* css3 transition */
    -webkit-transition:all .5s;
    -o-transition-property:all;
    -o-transition-duration:.5s;
    -moz-transition-property:all;
    -moz-transition-duration:.5s;
    transition-property:all;
    transition-duration:.5s;
    }

    header h1:hover{
        text-shadow: 2px 2px 2px #888;
        -webkit-text-shadow:2px 2px 2px #888; /* safari */

    }

header p {
    color:#353535;
    font-family:Georgia, "Times New Roman", Times, serif;
    font-size:14px;
    position: absolute;
    right: 0px;
    top: 33px;
    background-color:#f2f3ed;
    padding:10px;

    /* rounded corners */
    border-radius:25px;
    -moz-border-radius:25px; /* Firefox 3.6 and earlier */

    /* 2d skew trasnform */
    transform:skew(-20deg,0deg);
    -ms-transform:skew(-20deg,0deg); /* IE 9 */
    -moz-transform:skew(-20deg,0deg); /* Firefox */
    -webkit-transform:skew(-20deg,0deg); /* Safari and Chrome */
    -o-transform:skew(-20deg,0deg); /* Opera */

    /* css3 transition */
    -webkit-transition:all .5s;
    -o-transition-property:all;
    -o-transition-duration:.5s;
    -moz-transition-property:all;
    -moz-transition-duration:.5s;
    transition-property:all;
    transition-duration:.5s;
    }

header p:hover {
    color:#f2f3ed;
    background-color:#353535;
    background-image: url(../images/dots.png);

    }

#logo {
    position: absolute;
    top: 12px;
    left: 20px;
    background: url(../images/logo_small.png) no-repeat;
    width: 61px;
    height: 62px;
    text-indent:-9999px;

    /* css3 transition */
    -webkit-transition:all 1s;
    -o-transition-property:all;
    -o-transition-duration:1s;
    -moz-transition-property:all;
    -moz-transition-duration:1s;
    transition-property:all;
    transition-duration:1s;
    }
#logo:hover {
    transform:rotate(360deg);
    -moz-transform:rotate(360deg);
    -webkit-transform:rotate(360deg);
    -o-transform:rotate(360deg);
    }

header#anim {
    height:250px;
    }

nav {
    float:left;
    width:200px;
}

nav li{
    list-style-type:none;
}

nav li a{
    font-family:Georgia, "Times New Roman", Times, serif;
    text-decoration:none;
    display:block;
    padding-top:10px;
    padding-right:20px;
    padding-bottom:10px;
    padding-left:20px;
    font-size:18px;
    /* css3 transition */
    -webkit-transition:all .5s;
    -o-transition-property:all;
    -o-transition-duration:.5s;
    -moz-transition-property:all;
    -moz-transition-duration:.5s;
    transition-property:all;
    transition-duration:.5s;
}

nav li a:link{
    color:#333;

}
nav li a:visited{
    color:#333;
}
nav li a:hover{
    font-family:Georgia, "Times New Roman", Times, serif;
    color:#FFF;
    background-color:#353535;
    box-shadow: 0px 0px 5px #888;
    -webkit-box-shadow:0px 0px 5px #888; /* safari */
    background-image: url(../images/dots.png);
}
nav li a:active{
    color:#333;
    background-color:#666;
}

article {
    width:739px;
    float:right;
    border-left-color: #CCC;
    border-left-width: 1px;
    border-left-style: solid;
    box-shadow: 0px 0px 5px #888;
    -webkit-box-shadow:0px 0px 5px #888; /* safari */
    }

article h2, h3, p {
    margin-left:20px;
    margin-right:20px;
    padding-top:10px;

    }

article p {
    padding-top:4px;
    padding-bottom:20px;
    line-height:18px;
    }

article h2{
    color:#353535;
    font-size:28px;
    text-transform: capitalize;
}

article h3{
    color:#353535;
    font-size:20px;
    text-transform: capitalize;
}

article .leftfloat{
    width:50%;
    float:left;
    }

article .rightfloat{
    width:50%;
    float:right;
    }

footer {
    border-top-color: #CCC;
    border-top-width: 1px;
    border-top-style: solid;
    clear:both;
    background-color: #407a01;
    background-image: url(../images/bg_gradient.png);
    border-bottom-right-radius:25px;
    border-bottom-left-radius:25px;
    -moz-border-bottom-right-radius:25px;
    -moz-border-bottom-left-radius:25px;

    }

footer section.first {
    float:left;
    width:200px;
    padding-top:10px;
    padding-bottom:20px;
    }

footer section.first p {
    color:#f2f3ed;
    }

footer section {
    float:left;
    width:246px;
    padding-top:10px;
    padding-bottom:20px;
    color:#96C;
    }

footer section h3 {
    font-family:Georgia, "Times New Roman", Times, serif;
    color:#f2f3ed;
    font-size:16px;
    border-bottom-width: 1px;
    border-bottom-style: dotted;
    border-bottom-color: #F2F3ED;
    padding-bottom: 0px;
    text-transform: capitalize;
    font-weight:normal;

    }

footer section p {
    color:#333;
    font-size:10px;
    line-height:16px;
    }

.clearing {
    clear:both;
}

A: Here is an example of a working slideshow.
I'm getting this from this example at w3schools. There are surely better examples out there than the one at w3schools, but this at least works.
Note the only change I made was to the images, which are now using "https://via.placeholder.com/350x150" as their source.

var slideIndex = 1;
showSlides(slideIndex);

// Next/previous controls
function plusSlides(n) {
  showSlides(slideIndex += n);
}

// Thumbnail image controls
function currentSlide(n) {
  showSlides(slideIndex = n);
}

function showSlides(n) {
  var i;
  var slides = document.getElementsByClassName("mySlides");
  var dots = document.getElementsByClassName("dot");
  if (n > slides.length) {slideIndex = 1}
  if (n < 1) {slideIndex = slides.length}
  for (i = 0; i < slides.length; i++) {
      slides[i].style.display = "none";
  }
  for (i = 0; i < dots.length; i++) {
      dots[i].className = dots[i].className.replace(" active", "");
  }
  slides[slideIndex-1].style.display = "block";
  dots[slideIndex-1].className += " active";
}
* {box-sizing:border-box}

/* Slideshow container */
.slideshow-container {
  max-width: 1000px;
  position: relative;
  margin: auto;
}

/* Hide the images by default */
.mySlides {
    display: none;
}

/* Next & previous buttons */
.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  margin-top: -22px;
  padding: 16px;
  color: white;
  font-weight: bold;
  font-size: 18px;
  transition: 0.6s ease;
  border-radius: 0 3px 3px 0;
}

/* Position the "next button" to the right */
.next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

/* On hover, add a black background color with a little bit see-through */
.prev:hover, .next:hover {
  background-color: rgba(0,0,0,0.8);
}

/* Caption text */
.text {
  color: #f2f2f2;
  font-size: 15px;
  padding: 8px 12px;
  position: absolute;
  bottom: 8px;
  width: 100%;
  text-align: center;
}

/* Number text (1/3 etc) */
.numbertext {
  color: #f2f2f2;
  font-size: 12px;
  padding: 8px 12px;
  position: absolute;
  top: 0;
}

/* The dots/bullets/indicators */
.dot {
  cursor: pointer;
  height: 15px;
  width: 15px;
  margin: 0 2px;
  background-color: #bbb;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.6s ease;
}

.active, .dot:hover {
  background-color: #717171;
}

/* Fading animation */
.fade {
  -webkit-animation-name: fade;
  -webkit-animation-duration: 1.5s;
  animation-name: fade;
  animation-duration: 1.5s;
}

@-webkit-keyframes fade {
  from {opacity: .4}
  to {opacity: 1}
}

@keyframes fade {
  from {opacity: .4}
  to {opacity: 1}
}

1 / 3

Caption Text #One

2 / 3

Caption #Two

3 / 3

Caption #Three

  ❮
  ❯

Regarding your question about what the CSS clear attribute does:
The clear CSS property specifies whether an element can be next to floating elements that precede it or must be moved down (cleared) below them. The clear property applies to both floating and non-floating elements.
via: https://developer.mozilla.org/en-US/docs/Web/CSS/clear
Note the clear:both; example in the above link, and compare it to other clear options, like left, right, and none.


A wedding is one of those life events that many do not mind splurging on. For most couples, the belief that their wedding is a once in a lifetime experience automatically makes it worthy of spending a huge chunk of their savings.
It's no wonder the array luxurious wedding concepts continues to grow every year.
And when it comes to grand "I dos," a lot of well-to-do couples choose to have a destination wedding. They have family and friends travel with them to a beautiful, thoughtfully picked location where special activities and other arrangements have been prepared to make the wedding the truest definition of a celebration.
And when it comes to destination weddings, among the most popular location options is a private island. Many opt for a private island to make the wedding as exclusive as possible, yet abundant with fun possibilities.
Also, a lot of couples simply love the romantic ambiance provided by a gorgeous and serene beachscape.
If you are getting married soon and you have decided on a destination wedding at a private beach, one provision that is definitely worth considering is an island resort everyone is raving about in the tropical paradise of Seychelles.
This resort has a collection of stunning villas and each of the villas comes with its own pool and other private services.
But what makes this island resort truly an ideal venue for a destination wedding is you can rent the entire island for your wedding. For €10,000.00 a night, you and your guests can have the island and all that it has to offer for yourselves. You do not have to worry about the activities of people you do not know interfering with your plans.
If you want to spend as much quality time as you can with the people who consider you and your partner worth traveling overseas for, you have the liberty of planning activities that all of you can enjoy.
The private island is your personal playground.
You get to call the shots. You can get such personal satisfaction from being able to do what you want to do, and when you want to do things. There's no standing in line for you and your guests when you want to use any of the amenities of the venue, so any stress on your big day can be kept to a minimum.
With you in control of the activities, plus, the fact that it's only you, your guests, and the resort staff on the island, you do not have to worry about the safety of your valuable possessions.
Leaving your pricey gadgets at the beach as you take a dip in the ocean is never going to be an issue. Ditto with keeping the doors and windows of your villa unlocked.
It is important to mention too that a well-established private island resort also comes with its own security features such as surveillance cameras and security personnel. If you want to be carefree during your stay, you are properly covered by the island's own security system.
This is a top benefit for famous folks and if you are a celebrity or you are marrying one, you can keep prying eyes out easily if your wedding is held in a private island. Access will be denied to those who are not part of your guest list and the resort staff.
If you want a really quiet wedding with just the people who matter to you, taking it to a private island is certainly an effective strategy to use.
So, if your finances allow for such extravagant arrangements for your wedding, don't think twice about it. Having the wedding of your dreams is a gift of priceless loving moments and special memories for yourself, your partner, and the people who care about you, which you will forever treasure.
3 Things to do to Make your Destination Wedding in the Philippines Memorable!


We're looking forward to teaching attorneys about the newest techniques in video, audio, and still image forensics. All examples and material taken from our actual cases.
I expect a great crowd tomorrow, so join us!


I had to move the board to forum.hazardx.com . The domain change may render direct links invalid and cookies aren't valid anymore. Please mail me if you find any error. You should be forwarded automatically to the new location in most cases.


Have you ever tried to lose weight on a particular diet and failed?
If you answered yes to that question, all it means is that you are approaching weight loss in an unhelpful way.
Don't Let Age Stop You From Becoming A Positive Change Agent!
I learnt a long time ago that one will only be as old as one thinks s/he is. That knowledge makes me very comfortable relating with people of all ages and across social strata, without bothering about their age, color, income class or educational level.
The corn industry and their paid advertisers, the American Dietetics Association, would like people to think that high-fructose corn syrup, or HFCS is natural and is just like any other form of fructose. This is simply not true.
Just like many other things today funeral costs have grown. That is why so many people today are now choosing to take out funeral insurance. This will help to cover the costs for their funeral service and so ensure that those they leave behind have one less thing to worry about.
There are plenty of things that are going to go wrong in your home over the years, and the effects from these things will be measured on very different scales. Some issues that you may have around your home may be found to be quite tolerable, while other things are will not be. When it comes to water damage, especially in the basement, there should be no room for tolerance. If you have water damage in your basement, it can begin to deteriorate the very foundation of your home. It can also cause health issues related to mold issues if the water is allowed to remain for a period of time. This best thing to do is remove the water from your basement and address the issue once and for all.
Essential oils are popular for their mesmerizing aroma and healing properties which make them alluring to various health care centers, aromatherapy centers, and spas. These oils are good for skin as they improve the skin texture, tackle acne, and enhance the glow of the skin. Some other benefits include their commercial perfumery value, owing to their enchanting aroma. You can use these Natural Oils as per your purpose, but be careful with the purity percentage inclusive of aroma and other contents. With this write-up, we give you a clear picture of the Essential Oils, their types, and availability in the market.
If you are struggling with back pain you may be pleased to learn you can use natural remedies and vitamins to help you to overcome it. Herbs have been used for many thousands of years for their medicinal value and if you find the right combination of herbs you will be surprised at how fast you will find relief from your back pain.
When it comes to setting up a romantic evening at home with your special someone, there are still a few people who need help in this specific department. Gone are the days of just having a DVD night or just a simple dinner for two with cheap wine bought online. More is expected when it comes to wooing your woman. It takes a lot of creativity, resourcefulness and a lot of planning to come up with a successful evening that both you and your mate will enjoy.
Green Innovation – Time To Be Eco Green!
In this millennium, green innovation is a magnificent approach to set in ecological traits in your business practices, services, or products. It is a fundamental approach to develop new green markets based on new concepts. Nevertheless, it is a procedure to find chance and recognize the way to capitalize business by making it smarter. To get involved in the eco green race, you first need to understand the market and find unmet requirements. Look for rising trends and identifying solutions for issues by testing it in the market. For best result, enhancing and refining it to make it ready for advancement. Implementing traditional methods can yield astounding results. Creativity and cutting edge ways can bring great opportunities, if you carefully study the market. Check out in what and which way your services and products are used in a different way in the market. Glance at various industries and the way they tackle issues.


text:
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'a1548sy_yamamoto'

redpajama_set_name: RedPajamaGithub