Robust optimization is a branch of optimization which attempts to deal with uncertainty in models. This is a very relevant problem, since in any real world scenario we always have uncertainty in various forms, e.g. modeling error, measurement noise, or even adversarially generated data. Robust optimization addresses these issues by asking the user to specify bounds on the worst case, and then optimizing with the worst case in mind. This is a very rich field and the interested reader is definitely encouraged to check out the numerous references available (e.g. this survey by Bertsimas et al.). This post mainly will focus on robustness in the case of risk minimization for regression. $ \newcommand{\norm}[1]{\lVert #1 \rVert} \newcommand{\abs}[1]{| #1 |} \newcommand{\R}{\mathbb{R}} \newcommand{\E}{\mathbb{E}} \newcommand{\ind}{\mathbf{1}} \newcommand{\ip}[2]{\langle #1, #2 \rangle} \DeclareMathOperator*{\argmax}{arg\,max} $
Motivation
Julia Evans has an exciting article coming out soon in Recurse Center's codewords publication about tricking neural networks into falsely classifying images of dogs as say, paper towels and shower caps, via small perturbations of the input image. The interesting thing about this is that the perturbations appear to be quite negligible; indeed they are not even visually noticable. Intuitively, we might expect that a model which does not overfit is not susceptible to these kind of small perturbations; ideally some pixel noise (e.g. from say compression or an Instagram filter) should not be the difference between the correct label versus the incorrect label. This got me thinking how we could train our models to be robust against these sorts of perturbations.
Setup
To understand the difference between robust and non-robust estimation, we need to first understand the classical setting of regression in learning theory. Fix some family of real valued functions $\mathcal{F}$ mapping $\R^d$ to $\R$ , and suppose we are given pairs $\{(x_i, y_i)\}_{i=1}^{n} \subset \R^d \times \R$ such that the following relation holds $$ \begin{equation} y_i = f^*(x_i) + \varepsilon_i, \;\; x_i \stackrel{\mathrm{i.i.d.}}{\sim} \mathbb{P}, \; (\varepsilon_i)_{i=1}^{n} \sim N(0, \sigma^2 I_n) \:, \label{eq:modela} \end{equation} $$ where $f^* \in \mathcal{F}$ is fixed but unknown and $\mathbb{P}$ is a measure on $\R^d$ which is also unknown. Now fixing some loss function $\ell : \R \times \R \rightarrow \R$, a reasonable thing is strive for is finding a $f \in \mathcal{F}$ which minimizes $$ \min_{f \in \mathcal{F}} \; \E_{x \sim \mathbb{P}} \ell(f(x), f^*(x)) \:. $$ Since we do not have direct access to the functional $f \mapsto \E_{x \sim \mathbb{P}} \ell(f(x), f^*(x))$, we typically minimize a proxy for this functional based on the empirical measure $\mathbb{P}_n$ and on our observed values $\{y_i\}$, $$ \begin{equation} \min_{f \in \mathcal{F}} \; \frac{1}{n} \sum_{i=1}^{n} \ell(f(x), y_i) + \lambda \norm{f}^2 \:. \label{eq:erma} \end{equation} $$ Here, we added a regularization term $\lambda > 0$, which helps us trade off between the bias and variance of our estimator. This setup is reviewed and analyzed extensively in the Hsu, Kakade, and Zhang paper on ridge regression.
The standard model here makes a critical assumption here that the noise inherent in each observation is independent of the data. Can we really expect this in real scenarios? It depends on the situation, but certainly we can imagine cases where it does not. Julia's blog post is exactly a situation where this does not hold; she is adversarially finding perturbations of $x_i$ to get a desired $y_i$. What do we do in these situations? We could try to introduce new parameters which describe the correlation between the noise and the data, but this could get quite unwieldy. An alternative approach, one frequently taken up by the robust optimization community, is to not attempt to intricately model the noise and instead assume it is adversarial, but with limited power.
Robust regression
Let us now assume, as before we have access to points $\{(x_i, y_i)\}_{i=1}^{n}$, but now we have that $$ \begin{equation} y_i = f^*(x_i) + \varepsilon_i, \;\; x_i \stackrel{\mathrm{i.i.d.}}{\sim} \mathbb{P}, \; \abs{\varepsilon_i} \leq \gamma_i \:. \label{eq:modelb} \end{equation} $$ That is, we assume nothing about the $\{\varepsilon_i\}$ other than they are bounded by some constant. The $\{\varepsilon_i\}$ could be deterministic, white noise, or coupled with the data; we do not know nor care, other than this process is bounded. How might we learn $f$ now? To be sure we can deal with completely adversarial noise, we play a game with an adversary (this is often called a minimax game, as will become clear in a moment). The game works as follows. We first pick some $f \in \mathcal{F}$, and then we give $f$ to the adversary. The adversary then chooses a sequence $\{\varepsilon_i\}$ (knowing our $f$) as she pleases subject to the constraint that the noise process is bounded. Our risk is then evaluated with respect to this (adversarially) chosen sequence of noise. Mathematically, we model this as $$ \min_{f \in \mathcal{F}} \; \frac{1}{n} \sum_{i=1}^{n} \sup_{\varepsilon_i : \abs{\varepsilon_i} \leq \gamma_i} \ell(f(x_i), y_i + \varepsilon_i) + \lambda \norm{f}^2 \:. $$ We can extend this model even further, for the $\{x_i\}$'s, as follows $$ y_i = f(x_i + \delta_i) + \varepsilon_i, \;\; x_i \stackrel{\mathrm{i.i.d.}}{\sim} \mathbb{P}, \; \norm{\delta_i}_2 \leq \eta_i, \abs{\varepsilon_i} \leq \gamma_i \:. $$ Notice that we still left the $x_i \stackrel{\mathrm{i.i.d.}}{\sim} \mathbb{P}$ assumption in. This assumption is more fundamental, in justifying the use of the empirical risk as a proxy for the population risk. The adversarial framework now looks like $$ \begin{equation} \min_{f \in \mathcal{F}} \; \frac{1}{n} \sum_{i=1}^{n} \sup_{\delta_i : \norm{\delta_i}_2 \leq \eta_i} \sup_{\varepsilon_i : \abs{\varepsilon_i} \leq \gamma_i} \ell(f(x_i + \delta_i), y_i + \varepsilon_i) + \lambda \norm{f}^2 \:. \label{eq:a} \end{equation} $$ Let us reflect briefly on how this model attempts to capture robustness. Instead of asking our model to predict well on our given dataset, we are asking it to predict well over all datasets which are consistent with our observed data, even when this dataset is chosen adversarially with knowledge of our model! This is actually a very strong notion of robustness. I leave it open for now to come up with weaker notions of robustness that are still stronger than the classic regression setting.
Algorithms
The framework presented above is not useful if we cannot optimize in it. In presenting algorithms, we specialize for clarity to the case where $\mathcal{F} = \{ x \mapsto \ip{x}{w} : w \in \R^d \}$ and $\ell(x, y) = (x - y)^2$. We will first show that the problem described in $\eqref{eq:a}$ is actually convex. We will then show how to compute a (sub-)gradient, and hence one can use existing gradient based methods to optimize $\eqref{eq:a}$.
To start, under least squares, $\eqref{eq:a}$ now reduces to $$ \begin{equation} \min_{w \in \R^d} \; \frac{1}{n} \sum_{i=1}^{n} \sup_{\delta_i : \norm{\delta_i}_2 \leq \eta_i} \sup_{\varepsilon_i : \abs{\varepsilon_i} \leq \gamma_i} (\ip{x_i+\delta_i}{w} - y_i - \varepsilon_i)^2 + \lambda \norm{w}_2^2 \:. \label{eq:b} \end{equation} $$ Now, define the function $s(\cdot; x_i, y_i, \delta_i, \varepsilon_i)$ as $$ s(w; x_i, y_i, \delta_i, \varepsilon_i) = (\ip{x_i+\delta_i}{w} - y_i - \varepsilon_i)^2 \:. $$ It is not hard to see that this is a convex function in $w$ (take the Hessian to convince yourself). Now recall that if $\{s_\alpha(\cdot)\}_{\alpha \in I}$ is a family of convex functions, then $w \mapsto \sup_{\alpha \in I} s_\alpha(w)$ is also convex. Hence, we immediately have $$ h_i(w) := \sup_{\delta_i : \norm{\delta_i}_2 \leq \eta_i} \sup_{\varepsilon_i : \abs{\varepsilon_i} \leq \gamma_i} s(w; x_i, y_i, \delta_i, \varepsilon_i) $$ is a convex function. Thus, $\eqref{eq:b}$ is a sum of convex functions, and hence is a convex program.
To compute the subgradient, we recall the following fact about subgradients of supremum of functions indexed on compact sets. In what follows, let $\mathrm{cl}(A)$ denote the closure of a set $A \subset \R$. See Boyd and Vandenberghe's notes on subgradients for more details.
Lemma: Let $\{ f_\alpha(\cdot) \}_{\alpha \in I}$ be a family of convex functions such that $I$ is a compact subset of a metric space, and $\alpha \mapsto f_\alpha(x)$ is continuous for each $x$. Then $$ \partial \sup_{\alpha \in I} f_\alpha(x) = \mathrm{cl}(\bigcup \{ \partial f_\alpha(x) : f_\alpha(x) = \sup_{\alpha \in I} f_\alpha(x) \}) \:. $$
To run subgradient descent on $\eqref{eq:b}$, we simply need to compute at every step $k=1,...,T$, for each $i=1,...,n$, $g_i^k \in \partial h_i(w_k)$. The preceding Lemma provides a recipe for doing this. To compute $g_i^k$, we simply figure out the values of $\delta_i, \epsilon_i$ which maximize $s(w_k; x_i, y_i, \delta_i, \epsilon_i)$ and then for each maximizer differentiate w.r.t. $w_k$. Let $(\widehat{\delta_i}, \widehat{\varepsilon_i})$ be $$ \begin{align*} (\widehat{\delta_i}, \widehat{\varepsilon_i}) :=& \argmax_{\norm{\delta_i}_2 \leq \eta_i, \abs{\epsilon_i} \leq \gamma_i} (\ip{x_i}{w_k} - y_i + \ip{\delta_i}{w_k} - \varepsilon_i)^2 \\ =& \begin{cases} (\eta_i \frac{w_k}{\norm{w_k}_2}, -\gamma_i) &\text{if } \ip{x_i}{w_k} \geq y_i \\ (-\eta_i \frac{w_k}{\norm{w_k}_2}, +\gamma_i) &\text{if } \ip{x_i}{w_k} < y_i \:. \end{cases} \end{align*} $$ Note if $w_k = 0$, then set $w_k/\norm{w_k}_2 = 0$. From this calculation, we immediately have $g_i^k \in \partial h_i(w_k)$, with $$ g_i^k = \begin{cases} 2(\ip{x_i}{w_k} - y_i + \eta_i\norm{w_k}_2 + \gamma_i)(x_i + \eta_i \frac{w_k}{\norm{w_k}_2}) &\text{if } \ip{x_i}{w_k} \geq y_i \\ 2(\ip{x_i}{w_k} - y_i - \eta_i\norm{w_k}_2 - \gamma_i)(x_i - \eta_i \frac{w_k}{\norm{w_k}_2}) &\text{if } \ip{x_i}{w_k} < y_i \:. \end{cases} $$ Therefore, a full subgradient of $\eqref{eq:b}$ at the $k$-th step is simply $$ \frac{1}{n} \sum_{i=1}^{n} g_i^k + 2 \lambda w_k \:. $$ Notice that if we set $\eta_i = \gamma_i = 0$, we recover a full gradient of vanilla regularized least squares, as we should expect.
Parting thoughts
Some caveats: I did not run any experiments here, so I cannot comment on whether or not this approach actually works in practice. I also did not really look into the literature to see if something similar has already been proposed (it would not surprise me).
There are some future directions I could see this going in. The first is to ask how pessimistic we can be and still learn something reasonable assuming the model described by $\eqref{eq:modela}$ actually holds. In other words, how much robustness can we get for free? Another is to assume only that the model described by $\eqref{eq:modelb}$ holds, and exhibit a worst case sequence of noise such that solving $\eqref{eq:erma}$ performs substantially worse than solving $\eqref{eq:a}$.


{% load staticfiles %}
Represent Minnesota is an implementation of Open North’s Represent Boundaries API populated with Minnesota geographic data sets.
Represent Minnesota is maintained by MinnPost. Code and further information can be found in this project’s GitHub repo.


Toggle navigation
Home
About Us
Products
Contact
Sign in
Previous
Next
Popular LAN Parties
Munix
Quava
Legion
Xxumber
Biztown
W.L.L.P.
Hellduck
DiabloDab
AlienBlv


|
Elektra
0.8.15
|
Might be added to, changed or removed from future Elektra releases. More...
Modules | |
| API Proposals for Elektra | |
| for kdb.h. | |
| Meta Data proposal+compatibility | |
| Meta data proposal+compatibility methods. | |
Enumerations | |
| enum | elektraLockOptions |
| Lock options. | |
| enum | elektraLookupOptions { KDB_O_SPEC =1<<15, KDB_O_CREATE =1<<16, KDB_O_NOCASCADING =1<<17, KDB_O_NOSPEC =1<<18, KDB_O_NODEFAULT =1<<19, KDB_O_CALLBACK =1<<20 } |
| More lookup options. More... | |
Might be added to, changed or removed from future Elektra releases.
| enum elektraLookupOptions |
More lookup options.
| Enumerator | |
|---|---|
| KDB_O_SPEC |
Use the passed key as specification, instead of looking up the specification first. |
| KDB_O_CREATE |
Create the key if it was not found. |
| KDB_O_NOCASCADING |
Disable cascading search for keys starting with /. |
| KDB_O_NOSPEC |
Do not use specification for cascading keys (internal) |
| KDB_O_NODEFAULT |
Do not honor the default spec (internal) |
| KDB_O_CALLBACK |
For spec/ lookups that traverse deeper into hierarchy (callback in ksLookup()) |


getting rid of repetition in array
sorting an array in the ascending order
Find slope for the given points
write the program
concat two strings


source: https://www.christianity.com/wiki/prayer/prayers-for-protection-pray-for-safety.html
- "St. Patrick's Breastplate" Protective Prayer
The hymn version of St. Patrick's Breastplate consists of several stanzas, though the last two stanzas are particularly memorable and powerful:
Christ be with me, Christ within me, Christ behind me, Christ before me, Christ beside me, Christ to win me, Christ to comfort and restore me. Christ beneath me, Christ above me, Christ in quiet, Christ in danger, Christ in hearts of all that love me, Christ in mouth of friend and stranger. I bind unto myself the Name, The strong Name of the Trinity; By invocation of the same. The Three in One, and One in Three, Of Whom all nature hath creation, Eternal Father, Spirit, Word: Praise to the Lord of my salvation, Salvation is of Christ the Lord.
- Grant me Protection
Grant, O Lord, Thy protection And in protection, strength And in strength, understanding And in understanding, knowledge And in knowledge, the knowledge of justice And in the knowledge of justice, the love of it And in the love of it, the love of all existences And in that love, the love of spirit and all creation. Amen.
- Be with Me Christ
The cross of Christ be with me; The cross of Christ overcomes all water and every fire; The cross of Christ overcomes all weapons; The cross of Christ is a perfect sign and blessing to my soul. May Christ be with me and my body during all my life At day and at night.  Amen.
- Prayer for the Protection of Family
Lord, I pray Your emotional, physical, and spiritual protection over my kids (grandkids). Keep evil far from them, and help them to trust You as their refuge and strength. I pray You will guard their minds from harmful instruction, and grant them discernment to recognize truth. I pray You will make them strong and courageous in the presence of danger, recognizing that You have overcome and will set right all injustice and wrong one day. Help them to find rest in Your shadow, as they live in the spiritual shelter You provide for them. Let them know that the only safe place is in Jesus, and that their home on earth is only temporary. - by Rebecca Barlow Jordan
- For Protection in Safe Travel
God’s Angels guard and keep you All the way that you must travel Till earth’s days are past When blossoms fade and Time is fleeting fast In times of purest joy Or pain and fear God’s Angels guard And keep you safe. Amen.
- The Light of God
The light of God surrounds us, The love of God enfolds us, The power of God protects us, The presence of God watches over us, Wherever we are, God is, And where God is, all is well. St. Matthew, St. Mark, St. Luke, St. John, Like unto the prophet Jonas, as a type of Christ, Who was guarded for three days and Three nights in the belly of a whale, Thus shall the Almighty God, As a Father, guard and protect me from all evil. Amen.
- Prayer for Protection from Wrongdoing
You thieves, I implore you to be obedient like Jesus Christ, Who obeyed his heavenly Father unto the cross, And to stand without moving out of my sight, In the name of the Trinity. I command you by the power of God And the incarnation of Jesus Christ Not to move out of my sight, like Jesus Christ Stood on Jordan’s stormy banks to be baptized by John. And furthermore, I implore you, horse and rider, To stand still and not to move out of my sight, Like Jesus Christ did stand when he was about To be nailed to the cross to release the Fathers of the church from the bonds of hell. Thieves, I bind you with the same bonds with which Jesus Our Lord has bound hell; and thus ye shall be bound; And the same Words that bind you shall also release you.
- Prayer for Children's Protection
Lord, I pray that my kids (grandkids) will develop an eternal perspective and purpose, not an earthly one. Help them to see life–and every challenge–through Your eyes, eager and unafraid to share with others the good news of Jesus wherever they go. I pray that they will set their minds on things above, not just what’s going on here, and that they will be rooted and grounded in Your love. I pray they will come to understand the extent of Your own love for them – that it surpasses all the head knowledge they will acquire in school.  – Rebecca Barlow Jordan
- Prayer for Strength and Protection
Lord God, heavenly Father, you know that we are set in the midst of so many and great dangers, that by reason of the frailty of our nature we cannot always stand upright: Grant us such strength and protection, to support us in all danger, and carry us through all temptations; through your Son, Jesus Christ our Lord. Amen.
- Protect from Temptation
O Christ, Son of God, for our sake you fasted forty days and allowed yourself to be tempted. Protect us so that we may not be led astray by any temptation. Since man does not live by bread alone, nourish our souls with the heavenly food of your Word; through your mercy, O our God, you are blessed, and live and govern all things, now and forever. Amen.


Dining & Events
|
7,000 Miles Café Amore Bistro $50 Gift Card - Edmonton |
7,000 Miles Crave $50CAD Gift Card - Regina |
7,000 Miles Cut Steakhouse $50CAD Gift Card - Halifax |
|||
|
Cafe Amore Bistro is not your usual Italian restaurant, |
Fulfil your yearnings at the place known for its delectable combinations. |
Devour the highest quality cuisine in an opulent setting. |
|||
|
7,000 Miles Mill Street Brew Pub Calgary $50 e-Gift Card |
7,000 Miles Niagara Falls Illumination Cruise |
7,000 Miles Redwater Rustic Grille $50CAD Gift Card - Calgary |
|||
|
For a great craft beer experience. |
See the Falls in a whole new light! |
Enjoy regional, rustic cuisine in an exceptional setting. |
|||
|
7,000 Miles Vintage Chophouse $50 CAD Gift Card - Calgary |
7,000 Miles WOW! Hospitality $50 Gift Card - Winnipeg |
9,500 Miles Wine and Tour Experience |
|||
|
Dig into some of the finest cuts of meat at the Vintage Chophouse. |
Your restaurant choice! |
Samba Days…Indulge your love of wine! |
|||
|
14,000 Miles 17th Ave Retail & Entertainment District $100 e-Gift Card |
14,000 Miles Carnaval Brazilian BBQ $100 e-Gift Card |
14,000 Miles F'Amelia $100 e-Gift Card |
|||
|
Perfect spot to meet up with friends and family. |
Welcome to an authentic Brazilian “Churrascaria” steakhouse in Winnipeg |
F'Amelia offers authentic Northern Italian food. |
|||


.//developer~[designer]
~ music producer
soundcloud
repo
store
about
add repo to:
cydia
Sileo
zebra
Installer
or visit the repository:
repo page
contact
Instagram
Twitter
GitHub
soundcloud


1 Kings 1:28
Then king David answered and said, Call me Bathsheba. And she came into the king's presence, and stood before the king.


PCMDI has conducted exploratory studies of the potential usefulness of various linear and nonlinear statistical methods for model/model and model/data intercomparisons.
Sengupta and Boyle (1993) applied the technique of common principal components (CPCs) to identify similar modes among vertically averaged atmospheric temperature fields as observed by the Microwave Sounding Unit (MSU) on satellites, as simulated by the ECMWF global atmospheric model, and as represented by ECMWF analyses (a combination of data and model). They concluded that the use of CPC is a potentially promising approach for rigorously identifying model/data and model/model similarities, especially when the analysis is restricted to regions (e.g., the equatorial Pacific) where a dominant mode of variability (e.g. the ENSO) is likely to occur.
Sengupta and Boyle (1995) considered the relative merits of applying nonlinear principal component analysis (NLPCA) based on auto-associative neural networks vs the more traditional linear analysis (PCA) to identify the dominant modes of precipitation variability over the U.S. They found that NLPCA effected somewhat greater data reduction and that the leading nonlinear mode captured the seasonal cycle of precipitation more clearly than the leading linear mode. They concluded that use of NLPCA should be considered especially when linear PCA fails to uncover physically meaningful patterns in climatological data analysis.
References
Sengupta, S.K., and J. S. Boyle, 1993: Statistical intercomparison of global climate models: A common principal component approach. PCMDI Report No. 13, 41 pp.Abstract
Sengupta, S.K., and J. S. Boyle, 1995: Nonlinear principal component analysis of climate data. PCMDI Report No. 29, 21 pp. Abstract
UCRL-MI-119847


This page includes listings of All Smart properties Rentals OR Sales, which are of course approved by The Governement Of Pakistan


Kodiak is a major fishing port as well as a tourist centre in Alaska. It is located on a very scenic island of the same name, and forms a natural stopover on the way east or west. It is an ideal starting point for watching bears and all types of marine mammals.
Position 57°47N, 152°25W.
This is not a Port of Entry.
On approach call the Harbour Master on VHF channel 16 for advice on berth availability.
See this Useful view of the port.
The best place is in St. Paul Small Boat Harbour, which is in the middle of town. The harbour mainly caters for the fishing fleet and other professional services, but there are also a few sailing boats. The atmosphere is very friendly.
Rates are approx. $20 per day for a 40’ boat with a similar charge for electricity. A day is defined as midnight to midnight.(Aug 2015).
An alternative marina is St. Herman Harbour on Near Island, also within walking distance of the town. Also operated by the city.
Note that there are no toilets or showers at the harbour.
Anchorage
There are ample opportunities in the vicinity, but restrictions apply in the inner Boat Harbour.
Last updated April 2016.


#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
"""
This file contains metric cell classes. A metric cell is used to accumulate
in-memory changes to a metric. It represents a specific metric in a single
context.
Cells depend on a 'dirty-bit' in the CellCommitState class that tracks whether
a cell's updates have been committed.
"""
import threading
from apache_beam.metrics.metricbase import Counter
from apache_beam.metrics.metricbase import Distribution
__all__ = ['DistributionResult']
class CellCommitState(object):
"""For internal use only; no backwards-compatibility guarantees.
Atomically tracks a cell's dirty/clean commit status.
Reporting a metric update works in a two-step process: First, updates to the
metric are received, and the metric is marked as 'dirty'. Later, updates are
committed, and then the cell may be marked as 'clean'.
The tracking of a cell's state is done conservatively: A metric may be
reported DIRTY even if updates have not occurred.
This class is thread-safe.
"""
# Indicates that there have been changes to the cell since the last commit.
DIRTY = 0
# Indicates that there have NOT been changes to the cell since last commit.
CLEAN = 1
# Indicates that a commit of the current value is in progress.
COMMITTING = 2
def __init__(self):
"""Initializes ``CellCommitState``.
A cell is initialized as dirty.
"""
self._lock = threading.Lock()
self._state = CellCommitState.DIRTY
@property
def state(self):
with self._lock:
return self._state
def after_modification(self):
"""Indicate that changes have been made to the metric being tracked.
Should be called after modification of the metric value.
"""
with self._lock:
self._state = CellCommitState.DIRTY
def after_commit(self):
"""Mark changes made up to the last call to ``before_commit`` as committed.
The next call to ``before_commit`` will return ``False`` unless there have
been changes made.
"""
with self._lock:
if self._state == CellCommitState.COMMITTING:
self._state = CellCommitState.CLEAN
def before_commit(self):
"""Check the dirty state, and mark the metric as committing.
After this call, the state is either CLEAN, or COMMITTING. If the state
was already CLEAN, then we simply return. If it was either DIRTY or
COMMITTING, then we set the cell as COMMITTING (e.g. in the middle of
a commit).
After a commit is successful, ``after_commit`` should be called.
Returns:
A boolean, which is false if the cell is CLEAN, and true otherwise.
"""
with self._lock:
if self._state == CellCommitState.CLEAN:
return False
self._state = CellCommitState.COMMITTING
return True
class MetricCell(object):
"""For internal use only; no backwards-compatibility guarantees.
Accumulates in-memory changes to a metric.
A MetricCell represents a specific metric in a single context and bundle.
All subclasses must be thread safe, as these are used in the pipeline runners,
and may be subject to parallel/concurrent updates. Cells should only be used
directly within a runner.
"""
def __init__(self):
self.commit = CellCommitState()
self._lock = threading.Lock()
def get_cumulative(self):
raise NotImplementedError
class CounterCell(Counter, MetricCell):
"""For internal use only; no backwards-compatibility guarantees.
Tracks the current value and delta of a counter metric.
Each cell tracks the state of a metric independently per context per bundle.
Therefore, each metric has a different cell in each bundle, cells are
aggregated by the runner.
This class is thread safe.
"""
def __init__(self, *args):
super(CounterCell, self).__init__(*args)
self.value = 0
def combine(self, other):
result = CounterCell()
result.inc(self.value + other.value)
return result
def inc(self, n=1):
with self._lock:
self.value += n
self.commit.after_modification()
def get_cumulative(self):
with self._lock:
return self.value
class DistributionCell(Distribution, MetricCell):
"""For internal use only; no backwards-compatibility guarantees.
Tracks the current value and delta for a distribution metric.
Each cell tracks the state of a metric independently per context per bundle.
Therefore, each metric has a different cell in each bundle, that is later
aggregated.
This class is thread safe.
"""
def __init__(self, *args):
super(DistributionCell, self).__init__(*args)
self.data = DistributionData(0, 0, None, None)
def combine(self, other):
result = DistributionCell()
result.data = self.data.combine(other.data)
return result
def update(self, value):
with self._lock:
self.commit.after_modification()
self._update(value)
def _update(self, value):
value = int(value)
self.data.count += 1
self.data.sum += value
self.data.min = (value
if self.data.min is None or self.data.min > value
else self.data.min)
self.data.max = (value
if self.data.max is None or self.data.max < value
else self.data.max)
def get_cumulative(self):
with self._lock:
return self.data.get_cumulative()
[docs]class DistributionResult(object):
"""The result of a Distribution metric.
"""
def __init__(self, data):
self.data = data
def __eq__(self, other):
return self.data == other.data
def __repr__(self):
return '<DistributionResult(sum={}, count={}, min={}, max={})>'.format(
self.sum,
self.count,
self.min,
self.max)
@property
def max(self):
return self.data.max
@property
def min(self):
return self.data.min
@property
def count(self):
return self.data.count
@property
def sum(self):
return self.data.sum
@property
def mean(self):
"""Returns the float mean of the distribution.
If the distribution contains no elements, it returns None.
"""
if self.data.count == 0:
return None
return float(self.data.sum)/self.data.count
class DistributionData(object):
"""For internal use only; no backwards-compatibility guarantees.
The data structure that holds data about a distribution metric.
Distribution metrics are restricted to distributions of integers only.
This object is not thread safe, so it's not supposed to be modified
by other than the DistributionCell that contains it.
"""
def __init__(self, sum, count, min, max):
self.sum = sum
self.count = count
self.min = min
self.max = max
def __eq__(self, other):
return (self.sum == other.sum and
self.count == other.count and
self.min == other.min and
self.max == other.max)
def __neq__(self, other):
return not self.__eq__(other)
def __repr__(self):
return '<DistributionData(sum={}, count={}, min={}, max={})>'.format(
self.sum,
self.count,
self.min,
self.max)
def get_cumulative(self):
return DistributionData(self.sum, self.count, self.min, self.max)
def combine(self, other):
if other is None:
return self
new_min = (None if self.min is None and other.min is None else
min(x for x in (self.min, other.min) if x is not None))
new_max = (None if self.max is None and other.max is None else
max(x for x in (self.max, other.max) if x is not None))
return DistributionData(
self.sum + other.sum,
self.count + other.count,
new_min,
new_max)
@classmethod
def singleton(cls, value):
return DistributionData(value, 1, value, value)
class MetricAggregator(object):
"""For internal use only; no backwards-compatibility guarantees.
Base interface for aggregating metric data during pipeline execution."""
def zero(self):
raise NotImplementedError
def combine(self, updates):
raise NotImplementedError
def result(self, x):
raise NotImplementedError
class CounterAggregator(MetricAggregator):
"""For internal use only; no backwards-compatibility guarantees.
Aggregator for Counter metric data during pipeline execution.
Values aggregated should be ``int`` objects.
"""
def zero(self):
return 0
def combine(self, x, y):
return int(x) + int(y)
def result(self, x):
return int(x)
class DistributionAggregator(MetricAggregator):
"""For internal use only; no backwards-compatibility guarantees.
Aggregator for Distribution metric data during pipeline execution.
Values aggregated should be ``DistributionData`` objects.
"""
def zero(self):
return DistributionData(0, 0, None, None)
def combine(self, x, y):
return x.combine(y)
def result(self, x):
return DistributionResult(x.get_cumulative())


Movies and their Posters
This is a Star Wars movie poster app that will generate a movie poster based on which movie title you select.
If you're a movie fan, Star Wars fan, of just like movie posters, then this app is for you. . . .


JpdfUnit is a framework for testing a generated pdf document with the JUnit test framework so JPdfUnit is a high level api. The
framework is designed for an easy access to the PDFBox library. This functionality provides the user a lot of
possibilities in pdf document handling. For instance you can test the meta data of the pdf document like the author or the
creation date or search for content via Strings, fragments of words or even regular expressions. Different simple ready-to-use
assertions allow the user to compare the expected data to the concrete data of the pdf document. JPdfUnit is developed to test
one pdf document. You have got three different kinds of using the framework i.e. you can inherit our DocumentTestCase
shown in the example or you can work with our DocumentTester class to avoid inheritance from our framework.
Here is a small example :
public class OioTest extends DocumentTestCase {
public OioTest(String name) {
super(name);
}
protected DocumentDataSource getDataSource() {
DocumentDataSource datasource = new PdfDataSource("etc/testing-pdfs/DocumentInformationTest.pdf");
return datasource;
}
public void testAssertAuthorsNameEquals() {
assertAuthorsNameEquals("Benjamin Bratkus");
}
}


Nate Swanson
05.28.20
With a new year on the horizon, The Post wanted to take a look back at a handful of the best moments in Ohio athletics from the last year. In no particular order, here are five highlights from 2019-2020:
If there’s one thing Frank Solich can do for Ohio, it’s win bowl games.
After a shaky 6-6 regular season, the Bobcats were still able to make a bowl appearance in Boise, Idaho in the Famous Idaho Potato Bowl.
Although not having played a game in over a month, the Bobcats showed they still had gas in the tank by taking an early 11 point lead. Even when Nevada managed a rally in the fourth quarter, Ohio held on for the 30-21 victory. Quarterback Nathan Rourke, who was voted MVP in the Potato Bowl, finished 9-for-17 with 144 passing yards and 87 yards on 10 carries.
Ohio’s win in the Potato Bowl marked its third consecutive bowl win, a first in program history.
Anthony Warner | FOR THE POST
Ohio University football coach Frank Solich enters the field with the Ohio football team before the game versus Miami on Wednesday, November 6, 2019, at Peden Stadium.
Ohio had plenty of growing pains last season with a new head coach and a young roster that needed to mature quickly. As the Bobcats prepared for their final game of the regular season against Miami, their hopes for a home game in the first round of the Mid-American Conference Tournament hung in the balance.
Ohio got their game in the Convo. A stellar fourth-quarter performance by Jason Preston lifted the Bobcats enough to tie the game with less than two minutes left. Freshman Miles Brown set the Bobcats victory in stone with a putback.
Ohio’s victory over Miami encapsulated the young team’s growth from the beginning of the year to the MAC Tournament
Anthony Warner | FOR THE POST
Ohio’s Ben Vander Plas drives past Miami’s Nike Sibande during the Ohio versus Miami match in The Convocation Center on Saturday, Feb. 8, 2020. The Bobcats won the game 77-46.
Stephens’ ace secured not only the Bobcats’ victory over the Zips, but also earned Ohio the No. 5 seed in the MAC Tournament and a winning conference record.
Stephens was absent from the roster for over a month, but her dominance returned as soon as she did. She has the sixth-most service aces in program history and led the MAC in service aces per set leading up to the match against Akron.
Nate Swanson | FOR THE POST
Ohio's outside hitter Lizzie Stephens (No. 3) reaches for the ball in a match against Akron held at The Convo on Nov. 16, 2019.
Koster was strictly a backup goalie for much of last season until he was thrust into a starting position.
Midway through the season, starter Jimmy Thomas was temporarily suspended due to a fight with a player from Calvin. Koster had to start during one of the most important series of Ohio’s season, an away series against Lindenwood
The second game in the series proved to be one of Koster's best performances of his career. Koster made 47 saves on 49 shots against a Lindenwood offense that was considered among the best in the American Collegiate Hockey Association.
Jesse Jarrold-Grapes | FOR THE POST
Ohio goalie Mason Koster (31) makes a stop against Calvin. Koster got some ice time after Sr. Jimmy Thomas was ejected from the 4-3 loss against Calvin in Bird Arena on Saturday, Jan. 18, 2020.
In her second season as head coach Ali Johnstone breathed new life into a program that hadn’t had a winning season since 2011.
Perhaps the Bobcats most memorable win in 2019 came thanks to a 6-5 comeback against Appalachian State on September 20. Down 5-2 with less than three minutes left in regulation, the Bobcats rallied three quick goals to force the game into overtime at the very least.
That was until Ohio drew a penalty corner and a set up by Emma Spinetto gave Leah Warren the opening she needed to seal the win for the Bobcats. It was an early season win for the Bobcats, but easily their most memorable match of the 2019 season.
Hannah Ruhoff | FOR THE POST
Ohio's Emma Spinetto maneuvers the ball away from Longwood's Caroline Verhappen during the game against Longwood on Oct. 5, 2019 at Pruitt Field.


Action Mailer allows you to send email from your application using a mailer model and views.
Mailer Models
To use Action Mailer, you need to create a mailer model.
$ script/generate mailer Notifier
The generated model inherits from ActionMailer::Base. Emails are defined by creating methods within the model which are then used to set variables to be used in the mail template, to change options on the mail, or to add attachments.
Examples:
class Notifier < ActionMailer::Base def signup_notification(recipient) recipients recipient.email_address_with_name bcc<EMAIL_ADDRESS>"Order Watcher<EMAIL_ADDRESS>from<EMAIL_ADDRESS>subject "New account information" body :account => recipient end end
Mailer methods have the following configuration methods available.
- recipients - Takes one or more email addresses. These addresses are where your email will be delivered to. Sets the To: header.
- subject - The subject of your email. Sets the Subject: header.
- from - Who the email you are sending is from. Sets the From: header.
- cc - Takes one or more email addresses. These addresses will receive a carbon copy of your email. Sets the Cc: header.
- bcc - Takes one or more email addresses. These addresses will receive a blind carbon copy of your email. Sets the Bcc: header.
- reply_to - Takes one or more email addresses. These addresses will be listed as the default recipients when replying to your email. Sets the Reply-To: header.
- sent_on - The date on which the message was sent. If not set, the header wil be set by the delivery agent.
- content_type - Specify the content type of the message. Defaults to text/plain.
- headers - Specify additional headers to be set for the message, e.g. headers ‘X-Mail-Count’ => 107370.
When a headers ‘return-path‘ is specified, that value will be used as the ‘envelope from’ address. Setting this is useful when you want delivery notifications sent to a different address than the one in from.
The body method has special behavior. It takes a hash which generates an instance variable named after each key in the hash containing the value that that key points to.
So, for example, body :account => recipient would result in an instance variable @account with the value of recipient being accessible in the view.
Mailer views
Like Action Controller, each mailer class has a corresponding view directory in which each method of the class looks for a template with its name. To define a template to be used with a mailing, create an .erb file with the same name as the method in your mailer model. For example, in the mailer defined above, the template at app/views/notifier/signup_notification.erb would be used to generate the email.
Variables defined in the model are accessible as instance variables in the view.
Emails by default are sent in plain text, so a sample view for our model example might look like this:
Hi <%= @account.name %>, Thanks for joining our service! Please check back often.
You can even use Action Pack helpers in these views. For example:
You got a new note! <%= truncate(note.body, 25) %>
Generating URLs
URLs can be generated in mailer views using url_for or named routes. Unlike controllers from Action Pack, the mailer instance doesn‘t have any context about the incoming request, so you‘ll need to provide all of the details needed to generate a URL.
When using url_for you‘ll need to provide the :host, :controller, and :action:
<%= url_for(:host => "example.com", :controller => "welcome", :action => "greeting") %>
When using named routes you only need to supply the :host:
<%= users_url(:host => "example.com") %>
You will want to avoid using the name_of_route_path form of named routes because it doesn‘t make sense to generate relative URLs in email messages.
It is also possible to set a default host that will be used in all mailers by setting the :host option in the ActionMailer::Base.default_url_options hash as follows:
ActionMailer::Base.default_url_options[:host] = "example.com"
This can also be set as a configuration option in config/environment.rb:
config.action_mailer.default_url_options = { :host => "example.com" }
If you do decide to set a default :host for your mailers you will want to use the :only_path => false option when using url_for. This will ensure that absolute URLs are generated because the url_for view helper will, by default, generate relative URLs when a :host option isn‘t explicitly provided.
Sending mail
Once a mailer action and template are defined, you can deliver your message or create it and save it for delivery later:
Notifier.deliver_signup_notification(david) # sends the email mail = Notifier.create_signup_notification(david) # => a tmail object Notifier.deliver(mail)
You never instantiate your mailer class. Rather, your delivery instance methods are automatically wrapped in class methods that start with the word deliver_ followed by the name of the mailer method that you would like to deliver. The signup_notification method defined above is delivered by invoking Notifier.deliver_signup_notification.
HTML email
To send mail as HTML, make sure your view (the .erb file) generates HTML and set the content type to html.
class MyMailer < ActionMailer::Base def signup_notification(recipient) recipients recipient.email_address_with_name subject "New account information" from<EMAIL_ADDRESS>body :account => recipient content_type "text/html" end end
Multipart email
You can explicitly specify multipart messages:
class ApplicationMailer < ActionMailer::Base def signup_notification(recipient) recipients recipient.email_address_with_name subject "New account information" from<EMAIL_ADDRESS>content_type "multipart/alternative" part :content_type => "text/html", :body => render_message("signup-as-html", :account => recipient) part "text/plain" do |p| p.body = render_message("signup-as-plain", :account => recipient) p.transfer_encoding = "base64" end end end
Multipart messages can also be used implicitly because Action Mailer will automatically detect and use multipart templates, where each template is named after the name of the action, followed by the content type. Each such detected template will be added as separate part to the message.
For example, if the following templates existed:
- signup_notification.text.plain.erb
- signup_notification.text.html.erb
- signup_notification.text.xml.builder
- signup_notification.text.x-yaml.erb
Each would be rendered and added as a separate part to the message, with the corresponding content type. The content type for the entire message is automatically set to multipart/alternative, which indicates that the email contains multiple different representations of the same email body. The same body hash is passed to each template.
Implicit template rendering is not performed if any attachments or parts have been added to the email. This means that you‘ll have to manually add each part to the email and set the content type of the email to multipart/alternative.
Attachments
Attachments can be added by using the attachment method.
Example:
class ApplicationMailer < ActionMailer::Base # attachments def signup_notification(recipient) recipients recipient.email_address_with_name subject "New account information" from<EMAIL_ADDRESS>attachment :content_type => "image/jpeg", :body => File.read("an-image.jpg") attachment "application/pdf" do |a| a.body = generate_your_pdf_here() end end end
Configuration options
These options are specified on the class level, like ActionMailer::Base.template_root = "/my/templates"
- template_root - Determines the base from which template references will be made.
- logger - the logger is used for generating information on the mailing run if available. Can be set to nil for no logging. Compatible with both Ruby‘s own Logger and Log4r loggers.
- smtp_settings - Allows detailed configuration for :smtp
delivery method:
- :address - Allows you to use a remote mail server. Just change it from its default "localhost" setting.
- :port - On the off chance that your mail server doesn‘t run on port 25, you can change it.
- :domain - If you need to specify a HELO domain, you can do it here.
- :user_name - If your mail server requires authentication, set the username in this setting.
- :password - If your mail server requires authentication, set the password in this setting.
- :authentication - If your mail server requires authentication, you need to specify the authentication type here. This is a symbol and one of :plain, :login, :cram_md5.
- :enable_starttls_auto - When set to true, detects if STARTTLS is enabled in your SMTP server and starts to use it. It works only on Ruby >= 1.8.7 and Ruby >= 1.9. Default is true.
- sendmail_settings - Allows you to override options for the
:sendmail delivery method.
- :location - The location of the sendmail executable. Defaults to /usr/sbin/sendmail.
- :arguments - The command line arguments. Defaults to -i -t.
- raise_delivery_errors - Whether or not errors should be raised if the email fails to be delivered.
- delivery_method - Defines a delivery method. Possible values are :smtp (default), :sendmail, and :test.
- perform_deliveries - Determines whether deliver_* methods are actually carried out. By default they are, but this can be turned off to help functional testing.
- deliveries - Keeps an array of all the emails sent out through the Action Mailer with delivery_method :test. Most useful for unit and functional testing.
- default_charset - The default charset used for the body and to encode the subject. Defaults to UTF-8. You can also pick a different charset from inside a method with charset.
- default_content_type - The default content type used for the main part of the message. Defaults to "text/plain". You can also pick a different content type from inside a method with content_type.
- default_mime_version - The default mime version used for the message. Defaults to 1.0. You can also pick a different value from inside a method with mime_version.
- default_implicit_parts_order - When a message is built implicitly (i.e. multiple parts are assembled from templates which specify the content type in their filenames) this variable controls how the parts are ordered. Defaults to ["text/html", "text/enriched", "text/plain"]. Items that appear first in the array have higher priority in the mail client and appear last in the mime encoded message. You can also pick a different order from inside a method with implicit_parts_order.
- controller_name
- controller_path
- deliver
- deliver!
- mailer_name
- mailer_name
- mailer_name=
- receive
- template_root
- template_root=
- AdvAttrAccessor
- PartContainer
- Quoting
- Utils
- ActionController::UrlWriter
- ActionController::Layout
| [R] | action_name | |
| [R] | default_template_name | |
| [R] | The mail object instance referenced by this mailer. | |
| [W] | mailer_name | |
| [R] | template_name |
Deliver the given mail object directly. This can be used to deliver a preconstructed mail object, like:
email = MyMailer.create_some_mail(parameters) email.set_some_obscure_header "frobnicate" MyMailer.deliver(email)
[ show source ]
# File vendor/rails/actionmailer/lib/action_mailer/base.rb, line 428 428: def deliver(mail) 429: new.deliver!(mail) 430: end
[ show source ]
# File vendor/rails/actionmailer/lib/action_mailer/base.rb, line 379 379: def mailer_name 380: @mailer_name ||= name.underscore 381: end
Receives a raw email, parses it into an email object, decodes it, instantiates a new mailer, and passes the email object to the mailer object‘s receive method. If you want your mailer to be able to process incoming messages, you‘ll need to implement a receive method that accepts the email object as a parameter:
class MyMailer < ActionMailer::Base def receive(mail) ... end end
[ show source ]
# File vendor/rails/actionmailer/lib/action_mailer/base.rb, line 415 415: def receive(raw_email) 416: logger.info "Received mail:\n #{raw_email}" unless logger.nil? 417: mail = TMail::Mail.parse(raw_email) 418: mail.base64_decode 419: new.receive(mail) 420: end
[ show source ]
# File vendor/rails/actionmailer/lib/action_mailer/base.rb, line 432 432: def template_root 433: self.view_paths && self.view_paths.first 434: end
[ show source ]
# File vendor/rails/actionmailer/lib/action_mailer/base.rb, line 436 436: def template_root=(root) 437: self.view_paths = ActionView::Base.process_view_paths(root) 438: end
Alias for mailer_name
Alias for mailer_name
Delivers a TMail::Mail object. By default, it delivers the cached mail object (from the create! method). If no cached mail object exists, and no alternate has been given as the parameter, this will fail.
[ show source ]
# File vendor/rails/actionmailer/lib/action_mailer/base.rb, line 515 515: def deliver!(mail = @mail) 516: raise "no mail object available for delivery!" unless mail 517: unless logger.nil? 518: logger.info "Sent mail to #{Array(recipients).join(', ')}" 519: logger.debug "\n#{mail.encoded}" 520: end 521: 522: begin 523: __send__("perform_delivery_#{delivery_method}", mail) if perform_deliveries 524: rescue Exception => e # Net::SMTP errors or sendmail pipe errors 525: raise e if raise_delivery_errors 526: end 527: 528: return mail 529: end
Override the mailer name, which defaults to an inflected version of the mailer‘s class name. If you want to use a template in a non-standard location, you can use this to specify that location.
[ show source ]
# File vendor/rails/actionmailer/lib/action_mailer/base.rb, line 360 360: def mailer_name(value = nil) 361: if value 362: self.mailer_name = value 363: else 364: self.class.mailer_name 365: end 366: end
[ show source ]
# File vendor/rails/actionmailer/lib/action_mailer/base.rb, line 368 368: def mailer_name=(value) 369: self.class.mailer_name = value 370: end


Spain confirm return of Luis Enrique as coach to Qatar World Cup
by The Eagle OnlineThe president of the Spanish Football Federation, Luis Rubiales, on Tuesday said that Luis Enrique would return to his job as Spain coach including the Qatar World Cup in 2022.
In a news conference Rubiales said “Luis Enrique wants to, and I am grateful that he does, take charge of Spain until the 2022 World Cup in Qatar.
“We sat here in June to say that (Robert) Moreno was taking over (from Luis Enrique) but we have always been very transparent that the door was open for Luis Enrique if he wanted to come back.’’
Moreno was an assistant coach with Spain but he took charge in June when Luis Enrique resigned to care for his nine-year-old daughter before she died of bone cancer in August.
Previous Post
Buhari, APC governors, others to attend policy synergy parley in Jos – PGF DG


--- layout: stats title: Sara Quashnie Statistics permalink: "/stats/players/sara-quashnie.html" ---
| Year | Team | Finish | G | 10 | -5 | Pts | PPG |
|---|---|---|---|---|---|---|---|
| 2015 | Notre Dame A | 33 | 17.5 | 11 | 3 | 95 | 5.43 |
| Year | Round | Player | Team | Opponent | Result | 10 | -5 | Pts | Packet |
|---|---|---|---|---|---|---|---|---|---|
| 2015 | 1 (Prelims) | Sara Quashnie | Notre Dame A | Northwestern | Loss | 0 | 0 | 0 | MIT A + Alberta |
| 2015 | 2 (Prelims) | Sara Quashnie | Notre Dame A | Alberta | Loss | 0 | 0 | 0 | Minnesota + Washington |
| 2015 | 4 (Prelims) | Sara Quashnie | Notre Dame A | RIT | Win | 1 | 0 | 10 | Virginia and Yale |
| 2015 | 5 (Prelims) | Sara Quashnie | Notre Dame A | Michigan A | Loss | 0 | 0 | 0 | Rice + Illinois + W+M |
| 2015 | 6 (Prelims) | Sara Quashnie | Notre Dame A | MIT B | Win | 1 | 0 | 10 | Michigan + Toronto |
| 2015 | 7 (Prelims) | Sara Quashnie | Notre Dame A | Chicago A | Loss | 0 | 0 | 0 | Stanford B + Columbia |
| 2015 | 8 (Prelims) | Sara Quashnie | Notre Dame A | Minnesota A | Loss | 1 | 0 | 10 | Maryland + NYU |
| 2015 | 9 (Prelims) | Sara Quashnie | Notre Dame A | McMaster A | Loss | 1 | 0 | 10 | McGill + WUSTL |
| 2015 | 10 (Prelims) | Sara Quashnie | Notre Dame A | Rutgers | Win | 2 | 0 | 20 | Stanford A |
| 2015 | 11 (Prelims) | Sara Quashnie | Notre Dame A | Rice | Win | 0 | 0 | 0 | Ottawa + Harvard |
| 2015 | 12 (Prelims) | Sara Quashnie | Notre Dame A | Penn B | Loss | 1 | 0 | 10 | UCSD A |
| 2015 | 13 (Tiebreaker) | Sara Quashnie | Notre Dame A | McMaster A | Loss | 1 | 0 | 10 | Penn A |
| 2015 | 14 (Playoffs) | Sara Quashnie | Notre Dame A | UCLA | Win | 0 | 0 | 0 | Editors 1 |
| 2015 | 15 (Playoffs) | Sara Quashnie | Notre Dame A | VCU A | Loss | 0 | 1 | -5 | Editors 2 |
| 2015 | 16 (Playoffs) | Sara Quashnie | Notre Dame A | Central Florida | Win | 0 | 0 | 0 | Editors 3 |
| 2015 | 17 (Playoffs) | Sara Quashnie | Notre Dame A | Ottawa | Loss | 2 | 0 | 20 | Dartmouth |
| 2015 | 18 (Playoffs) | Sara Quashnie | Notre Dame A | South Carolina | Win | 1 | 1 | 5 | Editors 4 |
| 2015 | 19 (Playoffs) | Sara Quashnie | Notre Dame A | Liberty | Win | 0 | 1 | -5 | Editors 5 |


The top-level read-only state object glacier maintains
The channels reducer state
The fields reducer state
The marks reducer state
The sources reducer state
The transforms reducer state
Generated using TypeDoc
The top-level read-only state object glacier maintains


Health Care Project Team
Our web project to make things easier for patients and doctors , clinics as well.
hafiz Zaheer
I am student of PUCIT. Health Care is our project which will help the patients finding doctors/specialists for them.
If you are five-star doctor then you can attract and engage new patients ,build and strengthen your online reputation deliver
a premium experience patients love and list your patients on Health Care.
if patients are losing patience when trying to access your care. See here why we're the perfect partner for health systems.
Health Care is our project which will help the patients finding doctors/specialists for them.If you
are five-star doctor then you can attract and engage new patients ,build and strengthen
your online reputation deliver a premium experience patients love and list your patients on Health Care.
if patients are losing patience when trying to access your care. See here why we're the perfect partner for health systems.
Vj Hamza
I am student of PUCIT. Health Care is our project which will help the patients finding doctors/specialists for them.
If you are five-star doctor then you can attract and engage new patients ,build and strengthen your online reputation deliver
a premium experience patients love and list your patients on Health Care.
if patients are losing patience when trying to access your care. See here why we're the perfect partner for health systems.
Health Care is our project which will help the patients finding doctors/specialists for them.If you
are five-star doctor then you can attract and engage new patients ,build and strengthen
your online reputation deliver a premium experience patients love and list your patients on Health Care.
if patients are losing patience when trying to access your care. See here why we're the perfect partner for health systems.


Rhestr
– your offline datastore
Data Viewer
Tutorials
Enter Inspection
Reload Database
GitHub
sadf
Find Project
Workorder Inspection
SWPPP Full Inspection
SWPPP Short Inspection
Enter New Project
Find Project
Oversight Inspection Form
Project
Project number
Inspection Date
Weather
Is follow-up required?
Yes
No
Final Type
Inspection Log
Submit
Cancel
SWPPP Quality Assurance Inspection
General Information
Project
Project number
Project Phase
Inspection Date
SWPPP (Paperwork) Information
SWPPP Sign Visible
Yes
No
Does SWPPP book reflect current progress of the project?
Yes
No
List changes needed
SWPPP (Paperwork) Inspection
SWPPP Inspection Frequency
At least once every 7 calendar days
At least every 14 calendar days and within 24 hours of the end of a storm event of 0.25 inches or greater
Are inspections performed and documented at the above frequency
Yes
No
Are inspections reports in SWPPP
Yes
No
Are borrow and waste areas inspected as part of project?
Yes
No
Do borrow and waste areas have necessary BMPs in place?
Yes
No
Are inspections signed by Signatory Official (Tab 4 of SWPPP)
Yes
No
BMPs on the Ground Actually Effecting Water Quality
Are perimeter controls established outside of all work areas
Yes
No
Are permament and temporary control practices properly installed and maintained?
Erosion controls
Yes
No
Sediment controls
Yes
No
If NO to above questions, what corrective action is recommended
Are BMPs being selected, installed , implemented, and maintained as stated in the SWPPP?
Yes
No
Is the SWPPP being updated as needed to address problems and construction activities?
Yes
No
Are the BMPs adequate for water quality measures?
Yes
No
Describe issue and recommended actions
Is follow-up required?
Yes
No
Rate concern of item
Submit
Cancel
SWPPP Quick Inspection Form
Project
Project number
Inspection Date
Is follow-up required?
Yes
No
Rate concern of item
Describe issue and recommended actions
Submit
Cancel
Enter New Project Form
Project
Project number
Type of Project
EPA NOI
Contractor
Consultant Inspector
Latitude
Longitude
Inspector
Submit
Cancel


Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,.
when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.


Configuring Logging
There are three approaches you can take to implementing logging using the GNSDK:
- Enable GNSDK logging - This creates log file(s) that you and Gracenote can use to evaluate and debug any problems your application might encounter when using the SDK.
- Enable GNSDK logging and add to it - Use the *_logging_write() APIs to add your application's log entries to the GNSDK logs.
- Implement your own logging mechanism (via the logging callback).
The most typical use case for GNSDK logging is to configure a single log file to capture all logged messages and errors from both your application and the SDK.
Enabling GNSDK Logging
To enable Gracenote SDK logging, use the gnsdk_manager_logging_enable() function. For example:
/* * Enable SDK logging */ gnsdk_manager_logging_enable( "sample.log", // File path GNSDK_LOG_PKG_GNSDK, // Include all GNSDK package IDs, including your app's ID GNSDK_LOG_LEVEL_ALL, // Include all level entries (warning, info, debug and error) GNSDK_LOG_OPTION_ALL, // All logging options 0, // Max size of log in bytes: 0 means a new log file will be created each run GNSDK_FALSE // GNSDK_TRUE = old logs will be renamed and saved );
The GNSDK_LOG_OPTION_ALL define encompasses all logging options which include category (info, debug, warning and error), timestamp, source information (file and line number), package ID, thread ID, and if logging should be done asychronously. See the API reference for more information.
The GNSDK_LOG_PKG_GNSDK define means that all GNSDK package IDs will be logged. Use the GNSDK_LOG_PKG_GCSL if you just want all low-level Gracenote Client Standard Library (GCSL) package IDs. Use GNSDK_LOG_PKG_ALL for both GNSDK and GCSL package IDs. In most cases, GNSDK_LOG_PKG_GNSDK should be sufficient.
The GNSDK_LOG_LEVEL_ALL options means that all levels (error, warning, info, and debug) will be logged. There are options available if you just want messages for specific levels.
The GNSDK logging system can manage multiple logs simultaneously. Each call to the enable API can enable a new log, if the provided log file name is unique. Additionally, each log can have its own filters and options.
Adding to GNSDK Logs
Your application can write to the GNSDK logs using the gnsdk_manager_logging_write() and gnsdk_manager_logging_vwrite() functions. Use the latter function to pass a variable number of parameters - see the API reference for more information.
The SDK allows an application to register one or more of its own package IDs into the GNSDK logging system with the gnsdk_manager_logging_register_package() call. The application can then enable, disable or filter its own logging messages based on the registered package IDs. For example:
/* * Log entries are identified by the 'package' that logs them. Here we generate * a package ID for our application to allow us to log entries of our own in the GNSDK log * The package ID must be in the range GNSDKPKG_ID_APP_START to MAX_GNSDK_PKG_ID */ #define MYAPP_PACKAGE_ID GNSDKPKG_ID_APP_START+0x01 /* * Register our package ID with the logging system - this will make our logging * entries show up with the package description of "Sample App" */ gnsdk_manager_logging_register_package(MYAPP_PACKAGE_ID, "Sample App"); /* * Sample write to log file */ gnsdk_manager_logging_write( 150, // Source line number(optional) "main.c", // Source file (optional) MYAPP_PACKAGE_ID, // Package ID of application making call GNSDK_LOG_LEVEL_ERROR, // Error mask for this logging message "Error info: %s", // Error message format info // Error message format argument );
The logging system determines the applicability of a log message for each enabled log, and, if appropriate, writes a log message to multiple enabled logs.
Implementing Callback Logging
You also have the option to direct GNSDK to allow a logging callback, where you can determine how best to capture and disseminate specific logged messages. For example, your callback function could write to its own log files or pass the messages to an external logging framework, such as the Unix Syslog or the Windows Event Log.
Enabling callback is done with the gnsdk_manager_logging_enable_callback() API. The logging callback can be enabled alongside, or instead of, file logging. Your application can call this API multiple times with different Package IDs to enable multiple Package IDs. The package and filter will apply only to the logging message sent to the callback. To disable the logging callback, call gnsdk_manager_logging_enable_callback with the callback parameter set to GNSDK_NULL for each enabled PackageID.
For example:
/* * Register our callback with the GNSDK Manager */ gnsdk_manager_logging_enable_callback( _logging_callback_fn, GNSDK_NULL, // Optional data passed to the callback GNSDK_LOG_PKG_ALL, // Messages from all libraries GNSDK_LOG_LEVEL_ALL, // Message of all levels GNSDK_LOG_OPTION_ALL // All logging options: timestamps, thread IDs, etc ); ... static gnsdk_void_t GNSDK_CALLBACK_API _logging_callback_fn( gnsdk_void_t* user_data, gnsdk_uint16_t package_id, gnsdk_uint32_t mask, gnsdk_cstr_t format, va_list argptr ) { /* * Map the GNSDK level to the Syslog level and pass along the message */ if (mask & GNSDK_LOG_LEVEL_ERROR) { vsyslog(LOG_ERR, format, argptr); } else if (mask & GNSDK_LOG_LEVEL_WARNING) { vsyslog(LOG_WARNING, format, argptr); } else if (mask & GNSDK_LOG_LEVEL_INFO) { vsyslog(LOG_INFO, format, argptr); } else if (mask & GNSDK_LOG_LEVEL_DEBUG) { vsyslog(LOG_DEBUG, format, argptr); } } /* _logging_callback_fn() */


001package org.springframework.data.marklogic.core; 002 003import com.marklogic.client.document.DocumentPage; 004import com.marklogic.client.document.DocumentRecord; 005import com.marklogic.client.document.ServerTransform; 006import com.marklogic.client.pojo.PojoQueryBuilder; 007import com.marklogic.client.query.StructuredQueryBuilder; 008import com.marklogic.client.query.StructuredQueryDefinition; 009import org.springframework.core.io.Resource; 010import org.springframework.data.domain.Page; 011import org.springframework.data.domain.Sort; 012import org.springframework.data.marklogic.core.convert.MarkLogicConverter; 013import org.springframework.data.marklogic.repository.query.convert.QueryConversionService; 014 015import java.io.IOException; 016import java.io.InputStream; 017import java.util.List; 018 019/** 020 * The central interface between you and the MarkLogic database. Helper methods have been created for basic CRUD 021 * operations as well as for building some common query constructs. Additional methods allow you direct access to the 022 * different query and document managers, as well as direct access to the database client, so that you can write logic 023 * against the database using the full power of the MarkLogic Java Client Library. 024 * 025 * The main implementation of this is {@link MarkLogicTemplate}, so you will create an instance of that 026 * in order to use this interface. 027 */ 028public interface MarkLogicOperations { 029 030 // ========== Query Building =========== // 031 032 /** 033 * Get an instance of a {@link com.marklogic.client.pojo.PojoQueryBuilder} for the specified entity class. This is a simplified interface for 034 * building structured queries against JSON objects in the database. For full control of all query options use 035 * the {@link com.marklogic.client.query.StructuredQueryBuilder} instead. 036 * 037 * @param entityClass Type of Java entity being stored in the database. 038 * @param <T> The type of the entity. 039 * @return 040 */ 041 <T> PojoQueryBuilder<T> qb(Class<T> entityClass); 042 043 /** 044 * Adds sorting configuration to the specified query. 045 * 046 * @see MarkLogicOperations#sortQuery(Sort, StructuredQueryDefinition, Class) 047 */ 048 StructuredQueryDefinition sortQuery(Sort sort, StructuredQueryDefinition query); 049 050 /** 051 * Add sorting configuration to the specified query. The default sort algorithm will expect to use a path range 052 * index with specified sort properties, i.e. if sorting on "name" then a path index of "/name" should exist. 053 * 054 * Through use of the {@link org.springframework.data.marklogic.core.mapping.Indexed} annotation you can indicate 055 * use of a different type of range index for the property sorting, or specify the full path that should be used in 056 * creation of the sort options. This requires that the entity type is specified. 057 * 058 * @param sort Sort information for the query, i.e. which properties and which orders. 059 * @param query The structured query to "enhance". 060 * @param entityClass The entity type. 061 * 062 * @return The "enhanced" query definition for use in continued building. 063 */ 064 <T> StructuredQueryDefinition sortQuery(Sort sort, StructuredQueryDefinition query, Class<T> entityClass); 065 066 /** 067 * Add a search term to the specified query. This is used for word searches across your entire document. For more 068 * fine-grained control use {@link com.marklogic.client.query.StructuredQueryBuilder#word(StructuredQueryBuilder.TextIndex, String...)} 069 * to specify specific properties or fields into which to scope the word search. 070 * 071 * @param term A search phrase. 072 * @param query The structured query to "enhance". 073 * 074 * @return The "enhanced" query definition for use in continued building. 075 */ 076 StructuredQueryDefinition termQuery(String term, StructuredQueryDefinition query); 077 078 // ========== Database Configuration =========== // 079 080 /** 081 * Configures the connected database using the specified JSON information. The format of the JSON is outlined at 082 * http://docs.marklogic.com/REST/PUT/manage/v2/databases/[id-or-name]/properties. This requires that the client 083 * was created with a user that has "admin" privileges. 084 * 085 * @param configuration Resource pointing to a JSON document containing database configuration information. 086 * @throws IOException 087 */ 088 void configure(Resource configuration) throws IOException; 089 090 // ========== Database Operation Execution =========== // 091 092 /** 093 * Executes the specified action using a {@link com.marklogic.client.document.GenericDocumentManager} interface. For 094 * all the basic operations this is sufficient. 095 * 096 * @param action A function to execute using the document manager. The active transaction is also provided so that 097 * the function can add additional operations to it. 098 * @param <T> The result type of the function. 099 * 100 * @return The results of the document manager interactions (results of a query, etc.). 101 */ 102 <T> T execute(DocumentCallback<T> action); 103 104 /** 105 * Executes the specified action using the full {@link com.marklogic.client.DatabaseClient}. This gives you full 106 * control of your interactions with the database with the full power of the MarkLogic Java Client Library, but it 107 * also requires you to do a lot of the busy work yourself. Should mainly be used for operations not supported 108 * currently in this template interface either through the helper methods, a {@link com.marklogic.client.document.GenericDocumentManager}, 109 * or a {@link com.marklogic.client.query.QueryManager}. 110 * 111 * @param action A function to execute using the database client and active transaction. 112 * @param <T> The result type of the function. 113 * 114 * @return The results of the function. 115 */ 116 <T> T executeWithClient(ClientCallback<T> action); 117 118 /** 119 * Executes the specified action using a {@link com.marklogic.client.query.QueryManager}. 120 * 121 * @param action A function to execute using the query manager and active transaction. 122 * @param <T> The result type of the function. 123 * 124 * @return The results from the query manager. 125 */ 126 <T> T executeQuery(QueryCallback<T> action); 127 128 // ========== Database Writes =========== // 129 130 /** 131 * Write a single entity to the database into the default entity collection without any transforms. 132 * 133 * @see MarkLogicOperations#write(List, ServerTransform, String...) 134 */ 135 <T> T write(T entity); 136 137 /** 138 * Write a single entity to the database into the specified collections, without any transforms. 139 * 140 * @see MarkLogicOperations#write(List, ServerTransform, String...) 141 */ 142 <T> T write(T entity, String... collections); 143 144 /** 145 * Write the specified entity to the database into the default entity collection using the specified transform. 146 * 147 * @see MarkLogicOperations#write(List, ServerTransform, String...) 148 */ 149 <T> T write(T entity, ServerTransform transform); 150 151 /** 152 * Write the specified entity to the database into the specified collections with the specified transform. 153 * 154 * @see MarkLogicOperations#write(List, ServerTransform, String...) 155 */ 156 <T> T write(T entity, ServerTransform transform, String... collections); 157 158 /** 159 * Write the specified entities to the database into the default entity collection, without any transforms 160 * 161 * @see MarkLogicOperations#write(List, ServerTransform, String...) 162 */ 163 <T> List<T> write(List<T> entities); 164 165 /** 166 * Write the specified entities to the database into the specified collections, without any transforms. 167 * 168 * @see MarkLogicOperations#write(List, ServerTransform, String...) 169 */ 170 <T> List<T> write(List<T> entities, String... collections); 171 172 /** 173 * Write the specified entities to the database into the default entity collection using the specified transform. 174 * 175 * @see MarkLogicOperations#write(List, ServerTransform, String...) 176 */ 177 <T> List<T> write(List<T> entities, ServerTransform transform); 178 179 /** 180 * Write the specified list of entities to the database. Using the {@link org.springframework.data.marklogic.core.mapping.Document} 181 * annotation you can specify some information as to how it is persisted (i.e. whether or not to store it in a "type" 182 * collection, what path, etc.). 183 * 184 * If a transform is specified then before the entity is saved into the database they transform will be run against 185 * each entity. For more information see http://docs.marklogic.com/guide/java/transforms. 186 * 187 * @param entities A list of POJO entities you wish to save into the database. 188 * @param transform The transform to use before finally persisting to the database. 189 * @param collections Additional collections to which you want the document to be a part of inside the database. 190 * @param <T> The type of entity 191 * 192 * @return The list of entities that were saved to the database. This is mainly for convenience as they are not 193 * modified through this process. 194 */ 195 <T> List<T> write(List<T> entities, ServerTransform transform, String... collections); 196 197 // ========== Database Reads =========== // 198 199 /** 200 * Reads a list of documents from the database by their URIs instead of ids. Since type information is not know a 201 * "raw" {@link com.marklogic.client.document.DocumentRecord} is returned, and can be handled as desired. 202 * 203 * @param uris A list of database URIs of documents. 204 * 205 * @return A list of {@link com.marklogic.client.document.DocumentRecord} objects from the database. 206 */ 207 List<DocumentRecord> read(List<?> uris); 208 209 /** 210 * Read a document with the specified ID from the database. 211 * 212 * @see MarkLogicOperations#read(List, Class) 213 */ 214 <T> T read(Object id, Class<T> entityClass); 215 216 /** 217 * Reads a set of documents that have the specified IDs. The documents must match the specified type or they will 218 * not be included in the result set. 219 * 220 * @param ids A list of IDs of entities. 221 * @param entityClass The Java type of the entity. 222 * @param <T> The type of the entity. 223 * 224 * @return A list of all the entities that matched the specified IDs. 225 */ 226 <T> List<T> read(List<?> ids, Class<T> entityClass); 227 228 // ========== Database Queries without Entity =========== // 229 230 /** 231 * Query for a list of documents using the specified structured query. 232 * 233 * @see MarkLogicOperations#search(StructuredQueryDefinition, int, int) 234 */ 235 List<DocumentRecord> search(StructuredQueryDefinition query); 236 237 /** 238 * Query for a page of documents using the specified structured query, starting at the specified item in the 239 * result set. 240 * 241 * @see MarkLogicOperations#search(StructuredQueryDefinition, int, int) 242 */ 243 DocumentPage search(StructuredQueryDefinition query, int start); 244 245 /** 246 * Query for a page of documents using the specified structured query. Specify a start and length to get different 247 * "chunks" of data in the result set from the database. You seldom want to return all results, as this could be a 248 * very large number and will degrade the performance of your application. You instead should query out "pages" of 249 * data as needed. 250 * 251 * @param query A structured query defining the constraints to use to match the desired documents. 252 * @param start The start index within the result set that acts as the start of the "page". 253 * @param length The number of items to include in the "page" 254 * 255 * @return A {@link com.marklogic.client.document.DocumentPage} containing the records for this "chunk" of the result 256 * set. 257 */ 258 DocumentPage search(StructuredQueryDefinition query, int start, int length); 259 260 // ========== Database Queries with Entity =========== // 261 262 /** 263 * Query for a single entity using the specified structured query. If for some reason multiple results are matched 264 * then only the first is returned. 265 * 266 * This is a convenience method to get a single item when you "know" that is all there is. 267 * 268 * @see MarkLogicOperations#search(StructuredQueryDefinition, int, int, Class) 269 */ 270 <T> T searchOne(StructuredQueryDefinition query, Class<T> entityClass); 271 272 /** 273 * Query for a list of of documents of the specified type using the specified structured query. Only the first 274 * {@link com.marklogic.client.impl.DocumentManagerImpl#DEFAULT_PAGE_LENGTH} documents are returned. 275 * 276 * @see MarkLogicOperations#search(StructuredQueryDefinition, int, int, Class) 277 */ 278 <T> List<T> search(StructuredQueryDefinition query, Class<T> entityClass); 279 280 /** 281 * Query for a page of of documents of the specified type using the specified structured query. Only a page of 282 * documents is returned, starting from the specified start index and containing 283 * {@link com.marklogic.client.impl.DocumentManagerImpl#DEFAULT_PAGE_LENGTH} entities. 284 * 285 * @see MarkLogicOperations#search(StructuredQueryDefinition, int, int, Class) 286 */ 287 <T> Page<T> search(StructuredQueryDefinition query, int start, Class<T> entityClass); 288 289 /** 290 * Queries for a page of documents of the specified type, using the specified structured query to constrain which 291 * documents are returned. Only a page is returned, starting from the specified index and containing the specified 292 * number of entries. 293 * 294 * @param query The structured query to use to match documents in the database. 295 * @param start The starting index within the result set of matches. 296 * @param limit The number of documents to return. 297 * @param entityClass The entity type class. 298 * @param <T> The type of entity. 299 * 300 * @return A page of documents matching the specified parameters. 301 */ 302 <T> Page<T> search(StructuredQueryDefinition query, int start, int limit, Class<T> entityClass); 303 304 // ========== Database Queries Streaming Results =========== // 305 306 /** 307 * @see MarkLogicOperations#stream(StructuredQueryDefinition, int, int, Class) 308 */ 309 InputStream stream(StructuredQueryDefinition query); 310 311 /** 312 * @see MarkLogicOperations#stream(StructuredQueryDefinition, int, int, Class) 313 */ 314 <T> InputStream stream(StructuredQueryDefinition query, Class<T> entityClass); 315 316 /** 317 * @see MarkLogicOperations#stream(StructuredQueryDefinition, int, int, Class) 318 */ 319 InputStream stream(StructuredQueryDefinition query, int start); 320 321 /** 322 * @see MarkLogicOperations#stream(StructuredQueryDefinition, int, int, Class) 323 */ 324 <T> InputStream stream(StructuredQueryDefinition query, int start, Class<T> entityClass); 325 326 /** 327 * @see MarkLogicOperations#stream(StructuredQueryDefinition, int, int, Class) 328 */ 329 InputStream stream(StructuredQueryDefinition query, int start, int length); 330 331 /** 332 * Queries just like the {@link MarkLogicOperations#search(StructuredQueryDefinition, int, int, Class)} method does, 333 * but instead of a page/list of documents it returns an input stream straight from the results of the REST call 334 * against the database. The purpose of these methods is to skip the serialization/deserialization process of 335 * your application layer and just return raw data. 336 * 337 * If you don't need to access any parts of the document and just need to return the raw 338 * JSON/XML then it is easier/faster to just copy the stream from the database into the HTTP response directly. 339 * 340 * Extractions or server-side transforms can still be used to change how the data is returned in cases where there 341 * are properties you don't want returned through a public API, etc. 342 * 343 * @return An input stream of all the documents that matched the specified parameters. 344 */ 345 <T> InputStream stream(StructuredQueryDefinition query, int start, int length, Class<T> entityClass); 346 347 // ========== Database Existence Checks =========== // 348 349 /** 350 * Check for existence of a document by using the full URI under which the document is stored. 351 * 352 * @param uri The full URI of the document, i.e. "/Person/my-id.json" 353 * 354 * @return True if a document with the specified URI exists. 355 */ 356 boolean exists(String uri); 357 358 /** 359 * Check for existence of an entity in the database by using it's ID. 360 * 361 * @param id The ID value of an entity. 362 * @param entityClass The type class of an entity. 363 * @param <T> The type of an entity. 364 * 365 * @return True if an entity with the specified ID exists. 366 */ 367 <T> boolean exists(Object id, Class<T> entityClass); 368 369 /** 370 * Check for existence of entities matching the specified structured query. This will not show which ones match, 371 * but is a way to do a quick estimate on whether or not any exist in the first place. 372 * 373 * @param query The structured query to use to match documents in the database. 374 * @param entityClass The type class of an entity. 375 * @param <T> The type of an entity. 376 * 377 * @return True if there are any entities that match the query. 378 */ 379 <T> boolean exists(StructuredQueryDefinition query, Class<T> entityClass); 380 381 // ========== Database Counts =========== // 382 383 /** 384 * Count the number of documents that exist in the database under the specified collections. 385 * 386 * @param collections Collection URIs to which to scope the count. 387 * 388 * @return The number of documents contained under the specified collections. 389 */ 390 long count(String... collections); 391 392 /** 393 * Count the number of the specified entity that exist in the database. 394 * 395 * @param entityClass The type class of an entity. 396 * @param <T> The type of an entity. 397 * 398 * @return The number of the specified entity contained in the database. 399 */ 400 <T> long count(Class<T> entityClass); 401 402 /** 403 * Gives a count of the number of documents that would match the specified query. 404 * 405 * @see MarkLogicOperations#count(StructuredQueryDefinition, Class) 406 */ 407 long count(StructuredQueryDefinition query); 408 409 /** 410 * Count the number of entities that would match the specified query. 411 * 412 * @param query The structured query to use to match documents in the database. 413 * @param entityClass The type class of an entity. 414 * @param <T> The type of an entity. 415 * 416 * @return The count of entities that are in the database. 417 */ 418 <T> long count(StructuredQueryDefinition query, Class<T> entityClass); 419 420 // ========== Database Deletion =========== // 421 422 /** 423 * Delete a document from the database that is stored under the specified uris 424 * 425 * @param uris The uris to delete, i.e. "/Person/my-id.json" 426 */ 427 void deleteByUri(String... uris); 428 429 /** 430 * Delete a set of documents from the database that are stored under one of the specified URIs 431 * 432 * @param uris A list of uris to delete. 433 */ 434 void deleteByUris(List<String> uris); 435 436 /** 437 * Deletes the entity with the specified ID. 438 * 439 * @see MarkLogicOperations#deleteByIds(List, Class) 440 */ 441 <T> void deleteById(Object id, Class<T> entityClass); 442 443 /** 444 * Deletes the entities which have one of the specified IDs. 445 * 446 * @param ids A list of entity IDs. 447 * 448 * @param entityClass The type class of an entity. 449 * @param <T> The type of an entity. 450 */ 451 <T> void deleteByIds(List<?> ids, Class<T> entityClass); 452 453 /** 454 * Deletes all the entities of the specified type. 455 * 456 * @param entityClass The type class of an entity. 457 * @param <T> The type of an entity. 458 */ 459 <T> void dropCollection(Class<T> entityClass); 460 461 /** 462 * Deletes all the entities of the specified types. 463 * 464 * @param entityClasses The type classes of entities. 465 * @param <T> The type of an entity. 466 */ 467 <T> void dropCollections(Class<T>... entityClasses); 468 469 /** 470 * Delete documents that are under the specified collection URIs. 471 * 472 * @param collections Collection URIs containing documents to delete. 473 */ 474 void dropCollections(String... collections); 475 476 /** 477 * Delete the specified entities from the database. 478 * 479 * @param entities A list of entities. 480 * @param <T> The type of an entity. 481 */ 482 <T> void delete(List<T> entities); 483 484 /** 485 * Delete entities of the specified type that match the specified query. 486 * 487 * @param query The structured query to use to match documents in the database. 488 * @param entityClass The type class of an entity. 489 * @param <T> The type of an entity. 490 */ 491 <T> void delete(StructuredQueryDefinition query, Class<T> entityClass); 492 493 // ========== Utility Methods =========== // 494 495 /** 496 * Get the entity converter that is used to convert Java POJOs into a form with which they can be stored in the 497 * database. 498 * 499 * @return The converter object. 500 */ 501 MarkLogicConverter getConverter(); 502 503 /** 504 * Get the query object convert service that is used to convert various Java types into their "correct" form for 505 * querying in MarkLogic. 506 * 507 * @return The service object. 508 */ 509 QueryConversionService getQueryConversionService(); 510}


TIC TAC TOE
Start game
Classic Tic Tac Toe/Naughts and Crosses game.
Try to beat the computer...
Select your symbol:
X
O