text:
<TITLE>Review for Thin Red Line, The (1998)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Thin Red Line, The (1998)

reviewed by
Berge Garabedian

THE THIN RED LINE
RATING:  6.5 / 10 --> So-so

For more reviews and movie trivia, visit http://www.joblo.com/

This film could also have been titled "Deep Thoughts" by Terrence Malick.
The recluse director, who actually beats fellow recluse director Stanley
Kubrick in the number of years elapsed between movies (Malick's last film
was 20 years ago, while Kubrick's only dates back 13), returns to Hollywood
with a solid cast of names, and an attempt to recapture his brilliance from
BADLANDS and DAYS OF HEAVEN.

PLOT:
This film takes place in the Second World War during the Battle of
Guadalcanal. We specifically follow a set of soldiers as they attempt to
break the Japanese stronghold on a giant hill, while listening to their
words of wisdom, and breathing in the lush scenery.

CRITIQUE:
This film may just be the best-looking movie of the year. It may also
contain a solid cast of actors, effective tension when required, and a
life-like feel of being in the bush with the boys. Unfortunately for this
170-minute, overdone, ode to philosophical poetry, this movie just doesn't
muster up enough real interest, plot development or character attachment,
for anyone to give too much of a crap about its existential insights.
There is a reoccurring narration that permeates the entire movie as the
supposed thoughts of the soldiers, which is supposed to make us ponder life,
death and everything in between. All it did for me was tinker the strings of
boredom, as the long pauses between the words had me losing track of most of
what was said, and feel like I was at a poetry hearing, instead of a movie
theater. The last third of the film is especially guilty of this offense, as
the director seemed to have overdosed on his own indulgences, and simply
shot exquisite sceneries, and inserted scattered scenes of the boys and
their apres-winning shenanigans. "Too many vague queries, and not enough
developed thoughts make JoBlo a very uninterested boy."

Acting-wise, this movie is rock-solid, with the lesser named actors pulling
off the best gigs, as Jim Caviezel, Adrien Brody, Ben Chaplin and Elias
Koteas stole the show from the rest of the big names. Within the better
known clique, Nick Nolte jerked off an effective Colonel Tall, with his
grimy impression of a man who lived to bark out orders and thrived on
adversity. And if you're actually thinking of checking into this movie, in
the hopes of seeing your favorite actor, John Travolta or George Clooney, in
action, then I suggest you think thrice about your move, cause they
respectively carry five and one minute screen times in this ocular
air-wafer. All in all, I would say that this film is a visual pearl caught
up in a masturbatory web of overly-profound drivel, which is meant to
stimulate the mind, but ultimately stretches itself too long, and into
indifference. Having said that, the first couple of hours are pretty good,
notably the tense-filled "battle for the hill", and actors solid. So if
you're in the mood for Kierkegaard, I guess this movie might be your
prescribed trip, as long as you don't forget to bring your weed, beret and
"thinker" glasses :)

Little Known Facts about this film and its stars:
Actors Lukas Haas and Bill Pullman respectively played the roles of
"Newcomer" and Supply Sgt. MacTae in this film, before their scenes were
deleted by the director during the editing process.
After 1978's DAYS OF HEAVEN, director Terrence Malick apparently split his
time between Paris and Texas, supporting himself with lucrative, although
uncredited, screenwriting assignments. One such assignment had him helping
out the "wonder twins", Matt Damon and Ben Affleck, on their Oscar-winning
script for GOOD WILL HUNTING (7.5/10). Malick went to St. Stephen's high
school in Austin, Texas, where he played football, and then to Harvard. He
was a Rhodes Scholar. In his contract for directing this film, he stated
that no current pictures of him could be published or shown anywhere.
It took the producers ten years to get this story to film. The story rights
were bought from the author's (James Jones) wife in 1988.
Actor Nicolas Cage might also have starred in this film, were it not for a
little mix-up in telephone messages between him and Terrence Malick. The
misunderstanding ultimately left Malick feeling slighted by Cage for not
returning his call, and Cage feeling sorry because he never got the message.
There was a film in 1998 called A SOLDIER'S DAUGHTER NEVER CRIES, which was
a biopic on the life of "A Thin Red Line" novelist James Jones, written by
his daughter, Kaylie.
Although some shooting for this film was actually done in the Guadalcanal
Island, most of the film was shot around Port Douglas in Queensland,
Australia.
The script for this movie was apparently 213 pages long, shot over 123 days,
and held a budget of $50Million.
Actor Elias Koteas was born in my hometown of Montreal, Quebec, Canada.
Actor Jim Caviezel's feature film debut was as an airline clerk in Gus Van
Sant's 1991 film MY OWN PRIVATE IDAHO (7.5/10).

Review Date:       February 4, 1999
Director:               Terrence Malick
Writer:                  Terrence Malick (based on novel by James Jones)
Producers:           Robert Michael Geisler, Grant Hill and John Roberdeau
Actors:                  Nick Nolte as Lieutenant Colonel Gordon Tall, Sean
Penn as First Sergeant Edward Welsh, Elias Koteas as Captain
James Staros, Jim Caviezel as Private Witt, Ben Chaplin as Private Jack
Bell, Adrien Brody as Cpl. Fife
Genre:                   Drama
Year of Release:  1998
---------------------------------------
JoBlo's Movie Emporium
http://www.joblo.com
---------------------------------------
(c) 1999 Berge Garabedian

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
package com.marklogic.client.test.example.extension;

import static org.junit.Assert.assertTrue;

import java.io.IOException;

import org.junit.Test;

import com.marklogic.client.test.Common;
import com.marklogic.client.example.extension.GraphSPARQLExample;

public class GraphSPARQLExampleTest {

  @Test
  public void testMain() {
    boolean succeeded = false;
    try {
      GraphSPARQLExample.run(Common.newClient(), Common.newAdminClient());
      succeeded = true;
    } catch (IOException e) {
      e.printStackTrace();
    }
    assertTrue("GraphSPARQLExample failed", succeeded);
  }

}

redpajama_set_name: RedPajamaGithub


text:
from __future__ import absolute_import, print_function, division
from future.utils import with_metaclass
import abc

from opsimsummary import Tiling, HealpixTiles
from analyzeSN import LightCurve
from .universe import Universe
from .paramDistribution import SimpleSALTDist
import os
import numpy as np
import pandas as pd
from lsst.sims.photUtils import BandpassDict
from lsst.sims.catUtils.supernovae import SNObject

__all__ = ['SimulationTile', 'EntireSimulation', 'TiledSimulation']

simBandNameDict = dict((x, 'lsst' + x) for x in 'ugrizy')
class Photometry(object):
    """
    Temporary class standing in for the Photometry class in AnalyzeSN which is
    currently in a branch
    """
    def __init__(self):
        pass

    @staticmethod
    def  pair_method(obsHistID, snid, maxObsHistID):
        return snid * maxObsHistID + obsHistID
class EntireSimulation(Universe):
    """
    Simulation of a set of SN from a set of telescope pointings
    and a set of SN. The simulation is perfectly reproducible if
    both the pointings, paramsDF are the same (in terms of ordering)

    Parameters
    -----------
    rng : instance of `numpy.random.RandomState`
    pointings: instance of `pd.DataFrame`
        dataFrame with a minimal set of columns
        [`expMJD`, `filter`, `fiveSigmaDepth`]
    paramsDF : `pd.DataFrame`
        the minimal set of columns are
        [`snid`, `x0`, `t0`, `x1` , `c` , `snra`, `sndec`]

    Attributes
    ----------
    randomState : `numpy.random.RandomState`
    snParams : `pd.DataFrame`

    """
    def __init__(self, rng, pointings, paramsDF, angularUnits='degrees',
                 maxObsHistID=None):
        self.pointings = pointings
        self._paramsDf = paramsDF
        self._rng = rng
        self.angularUnits = angularUnits
        self.bandPasses = BandpassDict.loadTotalBandpassesFromFiles()
        self.maxObsHistID = maxObsHistID

    @property
    def randomState(self):
        return self._rng

    @property
    def snParams(self):
        return self._paramsDf

    @staticmethod
    def getSNCosmoParamDict(odict, SNCosmoModel):
        mydict = dict()
        param_names = SNCosmoModel.param_names

        for param in odict.index.values:
            if param in param_names:
                mydict[param] = odict[param]
        return mydict

    def SN(self, snid, timeRange='model'):
        mySNParams = self.snParams.ix[snid]
        if self.angularUnits == 'radians':
            myra = np.degees(mySNParams.snra)
            mydec = np.degrees(mySNParams.sndec)
        elif self.angularUnits == 'degrees':
            myra = mySNParams.snra
            mydec = mySNParams.sndec
        sn = SNObject(ra=myra, dec=mydec)
        sncosmo_params = self.getSNCosmoParamDict(mySNParams, sn)
        sn.set(**sncosmo_params)
        return sn

    def lc(self, snid, maxObsHistID=None):
        if maxObsHistID is None:
            maxObsHistID = self.maxObsHistID
        sn = self.SN(snid, timeRange='model')
        lcMinTime = sn.mintime()
        lcMaxTime = sn.maxtime()
        # lcMinTime = self.SN(snid, timeRange='model').mintime()
        # lcMaxTime = self.SN(snid, timeRange='model').maxtime()
        if lcMinTime is None or lcMaxTime is None:
            df = self.pointings.copy()
        else:
            df = self.pointings.query('expMJD < @lcMaxTime and expMJD > @lcMinTime').copy().reset_index()
            if maxObsHistID is None or ('obsHistID' in df.columns):
                pass
            else:
                raise ValueError('Cannot index if obsHistID column not provided')
        if maxObsHistID is not None:
            idx = Photometry.pair_method(df.obsHistID.values,
                                         snid,
                                         maxObsHistID)
        else:
            idx = np.ones(len(df))
        fluxerr = np.zeros(len(df))
        modelFlux = np.zeros(len(df))
        for i, rowtuple in enumerate(df.iterrows()):
            row = rowtuple[1]
            # print(row['expMJD'], row['filter'], row['fiveSigmaDepth'])
            bp = self.bandPasses[row['filter']]
            modelFlux[i] = self.staticModelFlux(sn, row['expMJD'],
                                                bandpassobject=bp)
            fluxerr[i] = sn.catsimBandFluxError(time=row['expMJD'],
                                                bandpassobject=bp,
                                                fluxinMaggies=modelFlux[i],
                                                m5=row['fiveSigmaDepth'])

        rng = self.randomState
        df['fluxerr'] = fluxerr
        deviations = rng.normal(size=len(df))
        df['deviations'] = deviations
        df['zp'] = 0.
        df['ModelFlux'] = modelFlux
        df['snid'] = snid
        df['flux'] = df['ModelFlux'] + df['deviations'] * df['fluxerr']
        df['zpsys']= 'ab'
        df['diaID']  = idx

        lc = df[['diaID', 'snid', 'expMJD', 'filter', 'ModelFlux', 'flux', 'fluxerr',
                 'zp', 'zpsys', 'fieldID']]
        return LightCurve(lc)

    @staticmethod
    def staticModelFlux(sn, time, bandpassobject):
        return sn.catsimBandFlux(bandpassobject=bandpassobject,
                                 time=time)
    def modelFlux(self, snid, time, bandpassobject):
        # assert len(times) == len(bands)
        # flux = np.zeros(len(times))
        sn = self.SN(snid)
        return self.staticModelFlux(sn, time=time, bandpassobject=bandpassobject)
        # return self.SN(snid).catsimBandFlux(bandpassobject=bandpassobject,
        #                                    time=time)

    def writeSNParams(self, paramFileName, IDVal=0):
        """
        Write the dataframe `self.snParams` to a file

        Parameters
        ----------
        paramFileName : Instance of string
            paramFileName
        IDVal : integer
            used as a key to write a group
        """

        if paramFileName.endswith('.hdf'):
            self.snParams.to_hdf(paramFileName, key='{}'.format(IDVal))
        else:
            raise NotImplementedError('Only methods to write to hdf files'
                                      'implemented')

    def writeSN(self, snid, fileName, IDVal=0, timeRange='model'):
        """
        Write light curve of SN to disc

        Parameters
        ----------
        snid : int/string
            SN id of SN
        fileName : string, mandatory

        timeRange : string, optional, defaults to model
            time range over which the light curve is written to disk

        """
        lc = self.lc(snid)
        df = lc.lightCurve
        df['band'] = df['band'].astype(str)
        with pd.get_store(fileName) as store:
            store.append('tile_{}'.format(IDVal), df)

class TiledSimulation(EntireSimulation):

    def __init__(self,
                 paramDF,
                 NSIDE,
                 tileID,
                 hpOpSim,
                 rng=None,
                 allPointings=None,
                 timeRange=None):
        """
        Parameters
        ----------
        paramDF
        """
        self.tileID = tileID
        self._randomState = rng
        if self._randomState is None:
            self._randomState = np.random.RandomState(self.tileID)
        self.Tiling = HealpixTiles(nside=NSIDE, preComputedMap=hpOpSim)
        self.fieldArea = self.Tiling.area(self.tileID)
        self.columns = ('expMJD', 'filter', 'fieldID', 'fiveSigmaDepth')
        self.tilePointings = self.Tiling.pointingSequenceForTile(self.tileID,
                                                                 allPointings=allPointings,
                                                                 columns=self.columns)
        super(TiledSimulation, self).__init__(rng=self._randomState,
                                              pointings=self.tilePointings,
                                              paramsDF=paramDF)

class SimulationTile(Universe):
    def __init__(self,
                 paramDist,
                 rate,
                 NSIDE,
                 tileID,
                 hpOpSim,
                 allPointings=None,
                 timeRange=None,
                 angularUnits='radians'):

        self.Tiling = HealpixTiles(nside=NSIDE, preComputedMap=hpOpSim)
        self.tileID = tileID
        self._randomState = np.random.RandomState(self.tileID)
        self.fieldArea = self.Tiling.area(tileID)
        self.zdist = rate(rng=self.randomState, fieldArea=self.fieldArea)
        self.zsamples = self.zdist.zSamples
        self.numSN = len(self.zsamples)
        self.positions = self.Tiling.positions(self.tileID, self.numSN,
                                               rng=self.randomState)
        self._snParamTable = None
        self.columns = ('expMJD', 'filter', 'fieldID', 'fiveSigmaDepth')
        self.tilePointings = self.Tiling.pointingSequenceForTile(self.tileID,
                                                                 allPointings=allPointings,
                                                                 columns=self.columns)
        self._timeRange = timeRange
        self.bandPasses = BandpassDict.loadTotalBandpassesFromFiles()

    @property
    def minPeakTime(self):
        if  self._timeRange is None:
            minTime = self.tilePointings.expMJD.min()
        else:
            minTime = self._timeRange[0]
        return minTime

    @property
    def maxPeakTime(self):
        if  self._timeRange is None:
            maxTime = self.tilePointings.expMJD.max()
        else:
            maxTime = self._timeRange[1]
        return maxTime

    @property
    def snParamTable(self):
        if self._snParamTable is None:
            self.snParams()
        return self._snParamTable

    @property
    def randomState(self):
        if self._randomState is None:
            self._randomState = np.random.RandomState(self.tileID)
        return self._randomState

    def snParams(self):
        zsamples = self.zdist.zSamples
        numSN = len(zsamples)
        positions = self.Tiling.positions(self.tileID, numSN,
                                          rng=self.randomState)
        ra = self.positions[0]
        dec = - self.positions[1] + 45.0
        # Why do we need numSN
        sp = SimpleSALTDist(numSN=numSN, rng=self.randomState,
                            mjdmin=self.minPeakTime,
                            zSamples=self.zsamples).paramSamples
        sp['ra'] = self.positions[0]
        sp['dec'] = self.positions[1]
        sp['snid'] = self.tileID * 500.0 + np.arange(numSN)
        sp.set_index('snid', inplace=True)
        self._snParamTable = sp
        # if self.minPeakTime is None or self.maxPeakTime is None:
        #    pass
        # else:
        #    sp['t0'] = self.minPeakTime + \
        #               (self.maxPeakTime - self.minPeakTime) * sp['t0']
        return sp

    @staticmethod
    def getSNCosmoParamDict(odict, SNCosmoModel):
        mydict = dict()
        param_names = SNCosmoModel.param_names

        for param in odict.index.values:
            if param in param_names:
                mydict[param] = odict[param]
        return mydict

    def SN(self, snid, timeRange='model'):
        mySNParams = self.snParamTable.ix[snid]
        sn = SNObject(ra=mySNParams.ra, dec=mySNParams.dec)
        sncosmo_params = self.getSNCosmoParamDict(mySNParams, sn)
        sn.set(**sncosmo_params)
        z = sn.get('z')
        t0 = sn.get('t0')
        # lcMinTime = t0 - 20. * (1.0 + z)
        # lcMaxTime = t0 + 50. * (1.0 + z )
        return sn

    @staticmethod
    def staticModelFlux(sn, time, bandpassobject):

        return sn.catsimBandFlux(bandpassobject=bandpassobject,
                                 time=time)

    def modelFlux(self, snid, time, bandpassobject):

        # assert len(times) == len(bands)
        # flux = np.zeros(len(times))

        # flux = np.asarray(list(self.SN(snid).catsimBandFlux(bandpassobject=self.bandPasses[bands[i]],
        # time=times[i]) for i in range(len(times))))
        #for i, band in enumerate(bands):
        #    bp = self.bandPasses[band]
        #    flux[i] = self.SN(snid).catsimBandFlux(bandpassobject=bp, time=times[i])
        # print(len(flux), len(times))
        return self.SN(snid).catsimBandFlux(bandpassobject=bandpassobject,
                                                        time=time)

    def lc(self, snid):
        sn = self.SN(snid, timeRange='model')
        lcMinTime = sn.mintime()
        lcMaxTime = sn.maxtime()
        # lcMinTime = self.SN(snid, timeRange='model').mintime()
        # lcMaxTime = self.SN(snid, timeRange='model').maxtime()
        if lcMinTime is None or lcMaxTime is None:
            df = self.tilePointings.copy()
        else:
            df = self.tilePointings.query('expMJD < @lcMaxTime and expMJD > @lcMinTime').copy()
        df['snid'] = snid
        fluxerr = np.zeros(len(df))
        modelFlux = np.zeros(len(df))
        for i, rowtuple in enumerate(df.iterrows()):
            row = rowtuple[1]
            # print(row['expMJD'], row['filter'], row['fiveSigmaDepth'])
            bp = self.bandPasses[row['filter']]
            modelFlux[i] = self.staticModelFlux(sn, row['expMJD'],
                                                bandpassobject=bp)
            fluxerr[i] = sn.catsimBandFluxError(time=row['expMJD'],
                                                bandpassobject=bp,
                                                # fluxinMaggies=row['ModelFlux'],
                                                fluxinMaggies=modelFlux[i],
                                                m5=row['fiveSigmaDepth'])

        rng = self.randomState
        df['fluxerr'] = fluxerr
        deviations = rng.normal(size=len(df))
        df['deviations'] = deviations
        df['zp'] = 0.
        df['ModelFlux'] = modelFlux
        df['flux'] = df['ModelFlux'] + df['deviations'] * df['fluxerr']
        df['zpsys']= 'ab'
        lc = df[['snid', 'expMJD', 'filter', 'ModelFlux', 'flux', 'fluxerr',
                 'zp', 'zpsys', 'fieldID']]
        return LightCurve(lc, bandNameDict=simBandNameDict)

    def writeTile(self, fileName, timeRange='model', paramFileName=None):
        """
        """
        count = 0
        for snid in self.snParamTable.index.values:
            self.writeSN(snid, fileName, timeRange=timeRange)
            if count % 50 == 0:
                if count == 0:
                    pass
                print('another 50', snid)
            count += 1
        if paramFileName is None:
            filename_parts = fileName.split('.')
            filename_parts[-2] += '_params'
            paramFileName = '.'.join(filename_parts)
        self.writeSNParams(paramFileName)

    def writeSNParams(self, paramFileName):
        if paramFileName.endswith('.hdf'):
            self.snParamTable.to_hdf(paramFileName, key='{}'.format(self.tileID))
        else:
            raise NotImplementedError('Only methods to write to hdf files'
                                      'implemented')

    def writeSN(self, snid, fileName, timeRange='model'):
        """
        Write light curve of SN to disc

        Parameters
        ----------
        snid : int/string
            SN id of SN
        fileName : string, mandatory

        timeRange : string, optional, defaults to model
            time range over which the light curve is written to disk

        """
        lc = self.lc(snid)
        df = lc.lightCurve
        df['band'] = df['band'].astype(str)
        with pd.get_store(fileName) as store:
            store.append('tile_{}'.format(self.tileID), df)


text:
from behave import *
from urlparse import urlparse
import time
import datetime
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait # available since 2.4.0
from selenium.webdriver.support import expected_conditions as EC # available since 2.26.0

## The basic and critical "go to page".
@given('I go to page "{page}"')
def step_impl(context, page):
    #print(context.browser.title)
    context.browser.get(context.target + page)
    # time.sleep(10)
    # from selenium.webdriver.support import expected_conditions as EC
    # wait = WebDriverWait(driver, 10)
    # element = wait.until(EC.element_to_be_clickable((By.ID,'someid')))

@given('I go to slow page "{page}" and wait for id "{id}"')
def step_impl(context, page, id):
    #print(context.browser.title)
    context.browser.get(context.target + page)
    time.sleep(5)
    element = WebDriverWait(context.browser, 200).until(EC.presence_of_element_located((By.ID, id)))
    # try:
    #     print(id)
    #     element = WebDriverWait(context.browser, 30).until(EC.presence_of_element_located((By.ID, id)))
    # finally:
    #     print("FINALLY")
    #     #context.browser.quit()

@given('I go to slow page "{page}" and wait for class "{cls}"')
def step_impl(context, page, cls):
    #print(context.browser.title)
    context.browser.get(context.target + page)
    element = WebDriverWait(context.browser, 200).until(EC.presence_of_element_located((By.CLASS_NAME, cls)))
    # try:
    #     print(id)
    #     element = WebDriverWait(context.browser, 30).until(EC.presence_of_element_located((By.ID, id)))
    # finally:
    #     print("FINALLY")
    #     #context.browser.quit()

@when('I wait for id "{id}"')
def step_impl(context, id):
    element = WebDriverWait(context.browser, 200).until(EC.presence_of_element_located((By.ID, id)))

## URL Check
@then('the url will be "{url}"')
def step_impl(context, url):
    full_url = context.target + url
    assert context.browser.current_url == full_url

## Title check.
@then('the title should be "{title}"')
def step_impl(context, title):
    print(context.browser.title)
    print(title)
    assert context.browser.title == title

## The empty title check, a bit of a special case for known "bad" page
## titles.
@then('the title should be ""')
def step_impl(context):
    assert( context.browser.title == "" or context.browser.title == None )

## The document body should contain a certain piece of text.
@then('the document should contain "{text}"')
def step_impl(context, text):
    print(context.browser.title)
    webelt = context.browser.find_element_by_tag_name('html')
    # print("###### text: %s" % text)
    # print("###### webelt.text: %s" % webelt.text)
    # print("###### webelt.innerHTML: %s" % webelt.get_attribute('innerHTML'))
    # print("###### rfind: %d" % webelt.text.rfind(text))
    assert webelt.text.rfind(text) != -1
    # webelt = context.browser.find_element_by_tag_name('body')
    # print(webelt.get_attribute('innerHTML'))
    # assert webelt.get_attribute('innerHTML').rfind(text) != -1

## The document body should contain a certain piece of text.
@then("the document should contain '{text}'")
def step_impl(context, text):
    print(context.browser.title)
    webelt = context.browser.find_element_by_tag_name('html')
    print(webelt.text)
    assert webelt.text.rfind(text) != -1

## The document body should not contain a hyperlink with text.
@then('the document should not contain link with "{text}"')
def step_impl(context, text):
    from selenium.common.exceptions import NoSuchElementException
    isNotFound = False
    try:
        context.browser.find_element_by_link_text(text)
    except NoSuchElementException:
        isNotFound = True
    assert isNotFound

## The document body should not contain an internal hyperlink to {link}
@then('the document should not contain an internal link to "{link}"')
def step_impl(context, link):
    webelts = context.browser.find_elements_by_tag_name('a')
    isNotFound = True
    for elt in webelts:
        href = elt.get_attribute("href")
        if href.rfind(context.target+link) != -1:
            isNotFound = False
    assert isNotFound == True

## A given class should contain a given piece of text/content. Not
## generably usable by non-dev test writers.
@then('the class "{clss}" should contain "{text}"')
def step_impl(context, clss, text):
    #print(context.browser.title)
    #print(title)
    webelt = context.browser.find_element_by_class_name(clss)
    assert webelt.text.rfind(text) != -1

## A given tab should contain a given piece of text/content.
@then('the "{tabname}" tab should contain "{text}"')
def step_impl(context, tabname, text):
    # print(context.browser.title)
    webelts = context.browser.find_elements_by_class_name("tab")
    found_tab = False
    for w in webelts:
        if w.text.rfind(tabname) != -1:
            found_tab = True
            parent = w.find_element_by_xpath("..")
            tab_href = parent.get_attribute("href")
            url = urlparse(tab_href)
            tab_id = url.fragment
            # print(tab_id)
            tab_area_elt = context.browser.find_element_by_id(tab_id)
            # print(tab_area_elt.text)
            assert tab_area_elt and tab_area_elt.text.rfind(text) != -1
    assert found_tab


text:
/**
 * Browser for the Nominal Response Library at the IRIS DMC
 * Philip Crotwell
 * 2014
 */

/**
 * AMD style define, see https://github.com/amdjs/amdjs-api/wiki/AMD
 */

requirejs.config({
    // By default load any module IDs from javascript subdir
    baseUrl : 'javascript',
});

// Start the main app logic.
require([ 'https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js' ], function(d3) {

    var nrl2html = {
        version : "0.0.1"

    };

    nrl2html.nrl_base_url = "NRL";
     //nrl2html.nrl_base_url = "http://www.iris.edu/NRL";

    nrl2html.questionToJson = function(url, callback) {
        console.log("try: " + url);
        d3.text(url, "text/plain", function(error, data) {
            if (error) {
                console.log("Oops, error: "+url);
                console.log(error);
            } else {
                var initial = {
                    root : {
                        name : "NRL",
                        path : url,
                        question : null,
                        detail : null,
                        resp : null,
                        showChildren : false,
                        answers : []
                    },
                    currAnswer : {}
                };

                var parentPath = "";
                if (url.indexOf('/')) {
                    parentPath = url.substring(0, url.lastIndexOf('/')+1);
                }
                lines = data.split("\n");
                lines.reduce(function(accum, curr, i, array) {
                    var sline;
                    var es;
                    curr = curr.trim();
                    if (curr.indexOf("[") == 0) {
                        if (curr.indexOf("[Main]") == 0) {
                        } else if (curr.indexOf("[") == 0) {
                            // answer
                            accum.currAnswer = {
                                value : curr.substring(1, curr.length - 1),
                                loaded : false,
                                showChildren : false
                            };
                            accum.currAnswer.name = accum.currAnswer.value;
                            accum.root.answers.push(accum.currAnswer);
                        }
                    } else if (curr.indexOf("path") == 0) {
                        accum.currAnswer.path = parentPath
                                + dequote(pullParam(curr));
                      //  accum.currAnswer.id = accum.currAnswer.path;
                    } else if (curr.indexOf("resp") == 0) {
                        accum.currAnswer.resp = parentPath
                                + dequote(pullParam(curr));
                    } else if (curr.indexOf("description") == 0) {
                        accum.currAnswer.description = dequote(pullParam(curr));
                        accum.currAnswer.name = accum.currAnswer.name+"  "+accum.currAnswer.description;
                    } else if (curr.indexOf("question") == 0) {
                        accum.root.question = dequote(pullParam(curr));
                    } else if (curr.indexOf("detail") == 0) {
                        accum.root.detail = parentPath
                                + dequote(pullParam(curr));
                    } else if (curr.length == 0) {
                        // nothing
                    } else {
                        console.log("Don't understand: " + curr);
                    }
                    return accum;
                }, initial);
                //console.log("Done with reduce");
                //console.log(JSON.stringify(initial.root, undefined, 2));

                if(callback) {
                    callback(initial.root);
                }
            }
        });
    }

    nrl2html.treeGraph = function(json) {
        var m = [ 20, 120, 20, 120 ], w = 1280 - m[1] - m[3], h = 600 - m[0]
                - m[2], i = 0, root;

        var maxDepth = 2;
        var clickDepth = 1;

        var tree = d3.layout.tree().size([ h, w ]);
        tree.children(function(d) {
            if(typeof d === "string") {return null;}
            if ( ! d.showChildren) {return null;}
            if(d.answers && d.answers.length > 0) {
                // load next level
                d.answers.forEach(function(ans, index, array) {
                    if (ans.path && ! ans.loaded) {
                        nrl2html.questionToJson(ans.path, function(curAns) {
                            if(curAns.question) {
                                ans.question = curAns.question;
                            }
                            if(curAns.answers) {
                                ans.answers = curAns.answers;
                            }
                            if(curAns.description) {
                                ans.description = curAns.description;
                            }
                            if(curAns.detail) {
                                ans.detail = curAns.detail;
                            }
                            if(curAns.resp) {
                                ans.resp = curAns.resp;
                            }
                            ans.loaded = true;
                            d3.select("#"+makePathId(ans)).select("circle").select("title").text(ans.question);
                        });
                    }
                });
                return d.answers;
            }
            return null;
        });

        var diagonal = d3.svg.diagonal().projection(function(d) {
            return [ d.y, d.x ];
        });

        var vis = d3.select("#nrltree").append("svg:svg").attr("width",
                w + m[1] + m[3]).attr("height", h + m[0] + m[2])
                .append("svg:g").attr("transform",
                        "translate(" + m[3] + "," + m[0] + ")");

        root = json;
        root.x0 = h / 2;
        root.y0 = 0;

        function toggleAll(d) {
            if (d.answers) {
                d.answers.forEach(toggleAll);
                toggle(d);
            }
        }

        // Initialize the display to show a few nodes.
        //root.answers.forEach(toggle);
        toggle(root);

        update(root);

        function update(source) {
            var duration = d3.event && d3.event.altKey ? 5000 : 500;

            // Compute the new tree layout.
            var nodes = tree.nodes(root).reverse();

            // Normalize for fixed-depth.
            // This sets the horizontal position (why as y???) based on depth
            // use atan so that things near the most recent click are spread out
            // and things far away from the click are squished together
            nodes.forEach(function(d) {
                var scale = (0.5 + Math.atan(6*(d.depth-clickDepth)/maxDepth)/Math.PI);
                d.y = scale * w;
                console.log("calc from depth "+d.y+" "+clickDepth+" "+maxDepth+ " "+scale);
                if (d != source && ! d.answers) {
                    d.showChildren = false;
                }
            });

            // Update the nodes
            var node = vis.selectAll("g.node").data(nodes, function(d) {
                return d.id || (d.id = ++i);
            });

            // Enter any new nodes at the parent's previous position.
            var nodeEnter = node.enter().append("svg:g").attr("class", "node").attr("id", makePathId)
                    .attr(
                            "transform",
                            function(d) {
                                return "translate(" + source.y0 + ","
                                        + source.x0 + ")";
                            }).on("click", function(d) {
                                d3.select("#nrlResp")
                                .selectAll("div").remove();
                                d3.select("#nrlDetail")
                                .selectAll("div").remove();
                                d3.selectAll(".talkBubble").remove();
                                toggle(d);
                                update(d);

                                // cookie crumb table below plot
                                d3.select("#nrlquestiontable").selectAll("table").remove();
                                var tableOut = d3.select("#nrlquestiontable")
                                var table = tableOut.append("table");
                                table.classed("pathTable", true);
                                var parentText = function(x) {
                                    if (x) {
                                        parentText(x.parent);
                                        var tr = table.append("tr");
                                        if (x.parent) {
                                            tr.append("td").text(x.parent.question);
                                        } else {
                                            tr.append("td").text("");
                                        }
                                        tr.append("td").text(x.name);
                                    }
                                }
                                parentText(d);

                                if (d.showChildren && d.question) {
                                    var circleG = d3.select("#"+makePathId(d));

                                    var innerG = circleG.append("g").classed("talkBubble", true);
                                    var text = innerG.append("text")
                                    .attr("x", 0)
                                    .attr("y", 25)
                                    .text(d.question);
                                    console.log("before bbox");
                                    var bbox = text.node().getBBox();
                                    var textPadding = 2;

                                    var rect = innerG.insert("rect", "text");
                                    console.log("after rect");
                                    rect.attr("x", bbox.x - textPadding)
                                    .attr("y", bbox.y - textPadding)
                                    .attr("width", bbox.width + (textPadding*2))
                                    .attr("height", bbox.height + (textPadding*2))
                                    .style("fill", "white");

                                }
                                if (d.detail) {
                                    d3.html(d.detail, function(error, data) {
                                        if (error) {
                                            console.log("Oops, error: "+d.resp);
                                            console.log(error);
                                        } else {
                                            var detailOut = d3.select("#nrlDetail")
                                            .selectAll("div")
                                            .data([data]);
                                            var detailEnter = detailOut
                                            .enter()
                                            .append("div");
                                            detailEnter.append("h3").text("Detail:");
                                            detailEnter.node().appendChild(data);
                                        }
                                    });
                                }
                                if (d.resp) {
                                    d3.text(d.resp, "text/plain", function(error, data) {
                                        if (error) {
                                            console.log("Oops, error: "+d.resp);
                                            console.log(error);
                                        } else {
                                            var respOut = d3.select("#nrlResp")
                                            .selectAll("div")
                                            .data([data]);
                                            var respEnter = respOut
                                            .enter()
                                            .append("div");
                                            var p = respEnter.append("p");
                                            p.text("Response: ");
                                            p.text(d.description);
                                            p.append("a").attr("href", d.resp)
                                            .text(" Download");
                                            respEnter
                                            .append("textarea")
                                            .attr("readonly", "true")
                                            .attr("cols", 120)
                                            .attr("rows", 25)
                                            .text(data);
                                            respOut.exit().remove();
                                        }
                                    });
                                }
                            });

            nodeEnter.append("svg:circle").attr("r", 1e-6).style("fill",
                    function(d) {
                        return d.showChildren ? "lightsteelblue" : "#fff";
                    })
                    .append("svg:title")
                    .text(function(d) {
                        if(d.question) { return d.question; }
                        if (d.resp) { return d.resp; }
                        return null;
                        });

            nodeEnter.append("svg:text").attr("x", function(d) {
                return (d.showChildren && d.answers) ? -10 : 10;
            }).attr("dy", ".35em").attr("text-anchor", function(d) {
                return (d.showChildren && d.answers) ? "end" : "start";
            }).text(function(d) {
                return d.name;
            }).style("fill-opacity", 1e-6)
            .style("font-weight", function(d) {
                return d.showChildren ? "bold" : "normal";
            });

            // Transition nodes to their new position.
            var nodeUpdate = node.transition().duration(duration).attr(
                    "transform", function(d) {
                        return "translate(" + d.y + "," + d.x + ")";
                    });

            nodeUpdate.select("circle").attr("r", 4.5).style("fill",
                    function(d) {
                        return d.showChildren ? "lightsteelblue" : "#fff";
                    });

            nodeUpdate.select("text").attr("x", function(d) {
                return (d.showChildren && d.answers) ? -10 : 10;
            }).attr("dy", ".35em").attr("text-anchor", function(d) {
                return (d.showChildren && d.answers) ? "end" : "start";
            }).style("fill-opacity", 1)
            .style("font-weight", function(d) {
                return d.showChildren ? "bold" : "normal";
            });

            // Transition exiting nodes to the parent's new position.
            var nodeExit = node.exit().transition().duration(duration).attr(
                    "transform", function(d) {
                        return "translate(" + source.y + "," + source.x + ")";
                    }).remove();

            nodeExit.select("circle").attr("r", 1e-6);

            nodeExit.select("text").attr("x", function(d) {
                return (d.showChildren && d.answers) ? -10 : 10;
            }).attr("dy", ".35em").attr("text-anchor", function(d) {
                return (d.showChildren && d.answers) ? "end" : "start";
            }).style("fill-opacity", 1e-6)
            .style("font-weight",  "normal");

            // Update the links
            var link = vis.selectAll("path.link").data(tree.links(nodes),
                    function(d) {
                        return d.target.id;
                    });

            // Enter any new links at the parent's previous position.
            link.enter().insert("svg:path", "g").attr("class", "link").attr(
                    "d", function(d) {
                        var o = {
                            x : source.x0,
                            y : source.y0
                        };
                        return diagonal({
                            source : o,
                            target : o
                        });
                    }).transition().duration(duration).attr("d", diagonal);

            // Transition links to their new position.
            link.transition().duration(duration).attr("d", diagonal);

            // Transition exiting nodes to the parent's new position.
            link.exit().transition().duration(duration).attr("d", function(d) {
                var o = {
                    x : source.x,
                    y : source.y
                };
                return diagonal({
                    source : o,
                    target : o
                });
            }).remove();

            // Stash the old positions for transition.
            nodes.forEach(function(d) {
                d.x0 = d.x;
                d.y0 = d.y;
            });
        }

        // Toggle children.
        function toggle(d) {
            d.showChildren = ! d.showChildren;
            if (d.depth) {
                if (d.answers) {
                    // only update clickDepth if not a leaf
                    clickDepth = d.depth;
                }
                if (d.showChildren && d.depth >= maxDepth) {
                    maxDepth = d.depth+1;
                } else {console.log(d.showChildren +" "+ d.depth +" "+ maxDepth)}
            }
        }

        function makePathId(x) {
            if (x) {
                var pId = makePathId(x.parent);
                return pId+"__"+x.name.replace(/\W+/g, "_");
            }
            return "ID";
        }
    }

    nrl2html.questionToJson(nrl2html.nrl_base_url+"/index.txt", nrl2html.treeGraph);

    function pullParam(val) {
        var es = val.indexOf("=");
        return val.substring(es+1).trim();
    }

    function dequote(val) {
        var out = val.trim();
        if (out.charAt(0) == '"') {
            out = out.substring(1, out.length);
        } else {
            console.log("missing start quote: '"+out.charAt(0)+"' "+out);
        }
        if (out.charAt(out.length - 1) == '"') {
            out = out.substring(0, out.length - 1);
        } else {
            console.log("missing end quote: '"+out.charAt(out.length - 1)+"' "+out);
        }
        return out;
    }

});


text:
<?php

declare(strict_types=1);

namespace Doctrine\ODM\MongoDB\Tests\Functional\Ticket;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
use Doctrine\ODM\MongoDB\Tests\BaseTest;

class GH1346Test extends BaseTest
{
    /**
     * @group GH1346Test
     */
    public function testPublicProperty()
    {
        $referenced1    = new GH1346ReferencedDocument();
        $referenced2    = new GH1346ReferencedDocument();
        $gH1346Document = new GH1346Document();
        $gH1346Document->addReference($referenced1);

        $this->dm->persist($referenced2);
        $this->dm->persist($referenced1);
        $this->dm->persist($gH1346Document);
        $this->dm->flush();
        $this->dm->clear();

        $gH1346Document = $this->dm->getRepository(GH1346Document::class)->find($gH1346Document->getId());
        $referenced2    = $this->dm->getRepository(GH1346ReferencedDocument::class)->find($referenced2->getId());

        $gH1346Document->addReference($referenced2);

        $this->dm->persist($gH1346Document);
        $this->dm->flush();

        $this->assertEquals(2, $gH1346Document->getReferences()->count());

        $this->dm->flush();
    }
}

/**
 * @ODM\Document
 */
class GH1346Document
{
    /** @ODM\Id */
    protected $id;

    /** @ODM\ReferenceMany(targetDocument=GH1346ReferencedDocument::class) */
    protected $references;

    public function __construct()
    {
        $this->references = new ArrayCollection();
    }

    public function getId()
    {
        return $this->id;
    }

    public function addReference($otherReference)
    {
        $this->references->add($otherReference);
    }

    public function getReferences()
    {
        return $this->references;
    }
}

/**
 * @ODM\Document
 */
class GH1346ReferencedDocument
{
    /** @ODM\Field(type="string") */
    public $test;

    /** @ODM\Id */
    protected $id;

    public function setTest($test)
    {
        $this->test = $test;
    }

    public function getId()
    {
        return $this->id;
    }
}


text:
package com.amazonaws.services.appflow.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 *

 * The OAuth 2.0 properties required for OAuth 2.0 authentication.
 *

 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class OAuth2Properties implements Serializable, Cloneable, StructuredPojo {

    /**
     *

     * The token URL required for OAuth 2.0 authentication.
     *

     */
    private String tokenUrl;
    /**
     *

     * The OAuth 2.0 grant type used by connector for OAuth 2.0 authentication.
     *

     */
    private String oAuth2GrantType;
    /**
     *

     * Associates your token URL with a map of properties that you define. Use this parameter to provide any additional
     * details that the connector requires to authenticate your request.
     *

     */
    private java.util.Map<String, String> tokenUrlCustomProperties;

    /**
     *

     * The token URL required for OAuth 2.0 authentication.
     *

     *
     * @param tokenUrl
     *        The token URL required for OAuth 2.0 authentication.
     */

    public void setTokenUrl(String tokenUrl) {
        this.tokenUrl = tokenUrl;
    }

    /**
     *

     * The token URL required for OAuth 2.0 authentication.
     *

     *
     * @return The token URL required for OAuth 2.0 authentication.
     */

    public String getTokenUrl() {
        return this.tokenUrl;
    }

    /**
     *

     * The token URL required for OAuth 2.0 authentication.
     *

     *
     * @param tokenUrl
     *        The token URL required for OAuth 2.0 authentication.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public OAuth2Properties withTokenUrl(String tokenUrl) {
        setTokenUrl(tokenUrl);
        return this;
    }

    /**
     *

     * The OAuth 2.0 grant type used by connector for OAuth 2.0 authentication.
     *

     *
     * @param oAuth2GrantType
     *        The OAuth 2.0 grant type used by connector for OAuth 2.0 authentication.
     * @see OAuth2GrantType
     */

    public void setOAuth2GrantType(String oAuth2GrantType) {
        this.oAuth2GrantType = oAuth2GrantType;
    }

    /**
     *

     * The OAuth 2.0 grant type used by connector for OAuth 2.0 authentication.
     *

     *
     * @return The OAuth 2.0 grant type used by connector for OAuth 2.0 authentication.
     * @see OAuth2GrantType
     */

    public String getOAuth2GrantType() {
        return this.oAuth2GrantType;
    }

    /**
     *

     * The OAuth 2.0 grant type used by connector for OAuth 2.0 authentication.
     *

     *
     * @param oAuth2GrantType
     *        The OAuth 2.0 grant type used by connector for OAuth 2.0 authentication.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see OAuth2GrantType
     */

    public OAuth2Properties withOAuth2GrantType(String oAuth2GrantType) {
        setOAuth2GrantType(oAuth2GrantType);
        return this;
    }

    /**
     *

     * The OAuth 2.0 grant type used by connector for OAuth 2.0 authentication.
     *

     *
     * @param oAuth2GrantType
     *        The OAuth 2.0 grant type used by connector for OAuth 2.0 authentication.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see OAuth2GrantType
     */

    public OAuth2Properties withOAuth2GrantType(OAuth2GrantType oAuth2GrantType) {
        this.oAuth2GrantType = oAuth2GrantType.toString();
        return this;
    }

    /**
     *

     * Associates your token URL with a map of properties that you define. Use this parameter to provide any additional
     * details that the connector requires to authenticate your request.
     *

     *
     * @return Associates your token URL with a map of properties that you define. Use this parameter to provide any
     *         additional details that the connector requires to authenticate your request.
     */

    public java.util.Map<String, String> getTokenUrlCustomProperties() {
        return tokenUrlCustomProperties;
    }

    /**
     *

     * Associates your token URL with a map of properties that you define. Use this parameter to provide any additional
     * details that the connector requires to authenticate your request.
     *

     *
     * @param tokenUrlCustomProperties
     *        Associates your token URL with a map of properties that you define. Use this parameter to provide any
     *        additional details that the connector requires to authenticate your request.
     */

    public void setTokenUrlCustomProperties(java.util.Map<String, String> tokenUrlCustomProperties) {
        this.tokenUrlCustomProperties = tokenUrlCustomProperties;
    }

    /**
     *

     * Associates your token URL with a map of properties that you define. Use this parameter to provide any additional
     * details that the connector requires to authenticate your request.
     *

     *
     * @param tokenUrlCustomProperties
     *        Associates your token URL with a map of properties that you define. Use this parameter to provide any
     *        additional details that the connector requires to authenticate your request.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public OAuth2Properties withTokenUrlCustomProperties(java.util.Map<String, String> tokenUrlCustomProperties) {
        setTokenUrlCustomProperties(tokenUrlCustomProperties);
        return this;
    }

    /**
     * Add a single TokenUrlCustomProperties entry
     *
     * @see OAuth2Properties#withTokenUrlCustomProperties
     * @returns a reference to this object so that method calls can be chained together.
     */

    public OAuth2Properties addTokenUrlCustomPropertiesEntry(String key, String value) {
        if (null == this.tokenUrlCustomProperties) {
            this.tokenUrlCustomProperties = new java.util.HashMap<String, String>();
        }
        if (this.tokenUrlCustomProperties.containsKey(key))
            throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
        this.tokenUrlCustomProperties.put(key, value);
        return this;
    }

    /**
     * Removes all the entries added into TokenUrlCustomProperties.
     *
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public OAuth2Properties clearTokenUrlCustomPropertiesEntries() {
        this.tokenUrlCustomProperties = null;
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getTokenUrl() != null)
            sb.append("TokenUrl: ").append(getTokenUrl()).append(",");
        if (getOAuth2GrantType() != null)
            sb.append("OAuth2GrantType: ").append(getOAuth2GrantType()).append(",");
        if (getTokenUrlCustomProperties() != null)
            sb.append("TokenUrlCustomProperties: ").append(getTokenUrlCustomProperties());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof OAuth2Properties == false)
            return false;
        OAuth2Properties other = (OAuth2Properties) obj;
        if (other.getTokenUrl() == null ^ this.getTokenUrl() == null)
            return false;
        if (other.getTokenUrl() != null && other.getTokenUrl().equals(this.getTokenUrl()) == false)
            return false;
        if (other.getOAuth2GrantType() == null ^ this.getOAuth2GrantType() == null)
            return false;
        if (other.getOAuth2GrantType() != null && other.getOAuth2GrantType().equals(this.getOAuth2GrantType()) == false)
            return false;
        if (other.getTokenUrlCustomProperties() == null ^ this.getTokenUrlCustomProperties() == null)
            return false;
        if (other.getTokenUrlCustomProperties() != null && other.getTokenUrlCustomProperties().equals(this.getTokenUrlCustomProperties()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getTokenUrl() == null) ? 0 : getTokenUrl().hashCode());
        hashCode = prime * hashCode + ((getOAuth2GrantType() == null) ? 0 : getOAuth2GrantType().hashCode());
        hashCode = prime * hashCode + ((getTokenUrlCustomProperties() == null) ? 0 : getTokenUrlCustomProperties().hashCode());
        return hashCode;
    }

    @Override
    public OAuth2Properties clone() {
        try {
            return (OAuth2Properties) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

    @com.amazonaws.annotation.SdkInternalApi
    @Override
    public void marshall(ProtocolMarshaller protocolMarshaller) {
        com.amazonaws.services.appflow.model.transform.OAuth2PropertiesMarshaller.getInstance().marshall(this, protocolMarshaller);
    }
}


text:
            <button class="btn btn-success pull-right" id="export" data-toggle="tooltip" title="Excel">  Excel </button>
            <button id="pdf" class="btn btn-danger pull-right" >  PDF</button>

                    <?php
                        $this->load->view('reportHead/buttonDate');
                        $this->load->view('reportHead/selectAlm');
                        $this->load->view('reportHead/selectTipo');
                        $this->load->view('reportHead/buttonRefresh');
                    ?>

REPORTE EGRESOS -


text:
const express = require('express')
// import express from 'express'
const bodyParser = require('body-parser')
const cookieParser = require('cookie-parser')
const model = require('./model')
const Chat = model.getModel('chat')
const path =  require('path')
// import {renderToString,renderToStaticMarkup} from 'react-dom/server'

const app = express()
// work with express
const server = require('http').Server(app)
const io = require('socket.io')(server)

io.on('connection',function(socket){
	// console.log('user login')
	socket.on('sendmsg',function(data){
		const {from, to, msg} = data
		const chatid = [from,to].sort().join('_')
		Chat.create({chatid,from,to,content:msg},function(err,doc){
			io.emit('recvmsg', Object.assign({},doc._doc))
		})
		// console.log(data)
		// io.emit('recvmsg',data)
	})
})

const userRouter = require('./user')

app.use(cookieParser())
app.use(bodyParser.json())
app.use('/user',userRouter)
app.use(function(req, res, next){
	if(req.url.startsWith('/user/')||req.url.startsWith('/static/')){
		return next()
	}
	return res.sendFile(path.resolve('build/index.html'))
})
app.use('/',express.static(path.resolve('build')))
server.listen(9093,function(){
	console.log('Node app start at port 9093')
})


text:
package com.fasterxml.jackson.databind.deser;

import com.fasterxml.jackson.core.JsonLocation;
import com.fasterxml.jackson.databind.util.ClassUtil;

/**
 * Helper class for {@link UnresolvedForwardReference}, to contain information about unresolved ids.
 *
 * @author pgelinas
 */
public class UnresolvedId {
    private final Object _id;
    private final JsonLocation _location;
    private final Class<?> _type;

    public UnresolvedId(Object id, Class<?> type, JsonLocation where) {
        _id = id;
        _type = type;
        _location = where;
    }

    /**
     * The id which is unresolved.
     */
    public Object getId() { return _id; }

    /**
     * The type of object which was expected.
     */
    public Class<?> getType() { return _type; }
    public JsonLocation getLocation() { return _location; }

    @Override
    public String toString() {
        return String.format("Object id [%s] (for %s) at %s", _id,
                ClassUtil.nameOf(_type), _location);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="16.5dp"
    android:layout_marginTop="16.5dp"
    android:background="#E0EEE0"
    android:gravity="center"
    android:orientation="horizontal">

    <TextView
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="16.5dp"
        android:layout_weight="1"
        android:gravity="center_vertical"
        android:text="运费"
        android:textSize="12sp" />

    <TextView
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:gravity="center"
        android:paddingRight="6dp"
        android:text="¥800.00"
        android:textSize="12sp" />
</LinearLayout>


text:
using System.Web.UI;
using DotNetNuke.Services.Installer.MsBuild;

namespace XCESS.DNN.AuthenticationProvider
{
    [DnnAuthenticationControl(DnnAuthenticationControlType.Login)]
    public partial class Login : UserControl
    {
    }
}


text:
var Session = require("express-session");
var MongoStore = require("connect-mongo")(Session);
var passport = require("passport");
var GoogleStrategy = require("passport-google-oauth20").Strategy;
var GooglePlusStrategy = require("passport-google-plus");
var LocalStrategy = require("passport-local").Strategy;

//var GoogleStrategy = require('passport-google-oauth').OAuth2Strategy;

var config = require("./config");
var userService = require("./../services/userService");
var User = require("./../models/User");

var auth = module.exports;

auth.init = function(app) {
	var session = (auth.session = Session({
		secret: "64ec1dff67add7c8ff0b08e0b518e43c",
		resave: false,
		saveUninitialized: true,
		collection: "bunker_sessions",
		store: new MongoStore({
			url: "mongodb://" + config.db.host + ":" + config.db.port + "/" + config.db.session
		})
	}));

	app.use(session);

	app.use(passport.initialize());
	app.use(passport.session());

	// what is this doing
	passport.serializeUser(function(user, done) {
		done(null, user._id.toString());
	});

	passport.deserializeUser(function(id, done) {
		User.findById(id).exec(done);
	});

	// Google Plus login (Default)
	passport.use(
		new GooglePlusStrategy(
			{
				clientId: config.google.clientID,
				clientSecret: config.google.clientSecret
			},
			loginCallback
		)
	);

	function loginCallback(tokens, profile, done) {
		userService.findOrCreateBunkerUser(profile).nodeify(done);
	}

	app.post("/auth/googleCallback", passport.authenticate("google"), function(req, res) {
		req.session.googleCredentials = req.authInfo;
		res.json({});
	});

	// Google OAuth Login - Secondary
	passport.use(
		new GoogleStrategy(
			{
				clientID: config.google.clientID,
				clientSecret: config.google.clientSecret,
				callbackURL: config.url + "/auth/googleReturn",
				scope: "https://www.googleapis.com/auth/userinfo.email"
			},
			function(accessToken, refreshToken, profile, cb) {
				userService.findOrCreateBunkerUser(profile).nodeify(cb);
			}
		)
	);

	app.get("/login/google", function(req, res) {
		req.session.directTo = req.query.directTo;
		passport.authenticate("google")(req, res);
	});

	app.get("/auth/googleReturn", passport.authenticate("google"), function(req, res) {
		req.session.googleCredentials = req.authInfo;
		res.redirect(req.session.directTo ? req.session.directTo : "/");
	});

	// Local login - In Progress
	passport.use(
		new LocalStrategy(function(username, password, done) {
			User.findOne({ email: username }, function(err, user) {
				if (err) {
					return done(err);
				}
				if (!user) {
					console.log("failed login - no user", { message: "Incorrect username.", username, password });
					return done(null, false, { message: "Incorrect username." });
				}
				if (user._doc.plaintextpassword != password) {
					console.log("failed login - bad password", { message: "Incorrect username.", username, password });
					return done(null, false, { message: "Incorrect password." });
				}
				return done(null, user);
			});
		})
	);

	auth.authenicateLocal = passport.authenticate("local", {
		successRedirect: "/",
		failureRedirect: "/loginBasic"
	});

	return session;
};


text:
title: Expense Reports List v1.1
layout: reference

redirect_from:
  - /api-reference-deprecated/version-one-one/expense-report/get-list-of-reports.html
---

{% include deprecation-alert.html %}

## Get list of expense reports

Retrieves a list of reports. This endpoint can be used to view reports for one user, or to view recent reports for the entire company. If you get reports for one user, you can view reports owned by the user specified in the OAuth access token. If you choose to get all the reports for the company, you must use the LastModified date query string to view reports for a 24 hour period. You can provide an optional View to target search results. If no view or date string is provided, the web service will return all Recent reports for the specified user. If the `LastModified` query string is provided, the results do not filter based on the specified user. This endpoint can support frequent requests, where the developer tracks the previous date/time that the endpoint was called, and uses that as the date/time for the next request.

### Request

#### URI

```
GET https://www.concursolutions.com/api/expense/expensereport/v1.1/ReportsList/{_View_}
```

#### Parameters

This URI can be appended with the following optional report View values:

Value|Description
---|---
`RECENT`|Returns all reports that have been modified in the last 31 days for the specified user.
`ACTIVE`|Returns all unsubmitted and unpaid (payment status is not Paid) reports for the specified user.
`UNSUBMITTED`|Returns all unsubmitted reports for the specified user.
`PENDING`|Returns all pending reports for the specified user.
`APPROVED`|Returns all approved reports for the specified user.
`PROCESSED`|Returns all processed reports for the specified user.
`PAID`|Returns all paid reports for the specified user.
`PAYMENTCONFIRMED`|Returns all paid reports for the specified user.
`FORTHISMONTH`|Returns all reports with a create date in this month by the specified user.
`FORLASTMONTH`|Returns all reports with a create date in the previous month by the specified user.
`FORTHISQUARTER`|Returns all reports with a create date in this calendar quarter by the specified user.
`FORLASTQUARTER`|Returns all reports with a create date in the previous calendar quarter by the specified user.
`FORTHISYEAR`|Returns all reports with a create date in this year by the specified user.
`FORLASTYEAR`|Returns all reports with a create date in in the past year by the specified user.
`TOAPPROVE`|Returns all reports pending approval from the specified user.
`APPROVEDTHISMONTH`|Returns all reports approved or pending approval from the specified user in the current month.
`APPROVEDLASTMONTH`|Returns all reports approved by the specified user in the current month.
`APPROVEDTHISQUARTER`|Returns all reports approved or pending approval from the specified user in the current calendar quarter.
`APPROVEDLASTQUARTER`|Returns all reports approved by the specified user in the previous calendar quarter.
`APPROVEDTHISYEAR`|Returns all reports approved or pending approval from the specified user in the current calendar year.
`APPROVEDLASTYEAR`|Returns all reports approved by the specified user in the previous calendar year.

This request can include an optional query string specifying the last modified date (in [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), aka UTC) of the reports. This query string will return the reports modified within 24 hours after the supplied date. You can provide the time in UTC, and the query will return the reports with a last modified date that is greater (up to 24 hours after the time) or equal to the supplied time. The provided date/time can be any time between now and the first date of expense report creation in the database. The format is either the date or the date and time combined:

```
/api/expense/expensereport/v1.1/reportslist/UNSUBMITTED/LastModified?date=2011-07-06T12:23:00
```

or

```
/api/expense/expensereport/v1.1/reportslist/UNSUBMITTED/LastModified?date=2011-07-06
```

The LastModified query string is supported only with the following statuses: ALL, ACTIVE, UNSUBMITTED, APPROVED, PENDING, PROCESSED, PAID, PAYMENTCONFIRMED, RECENT, TOAPPROVE

**NOTES**:

* The LastModified query string returns reports for all users, ignoring the user account specified in the OAuth access token.
* The ApprovalURL element does not appear when using the LastModified query.

#### Headers

* Content-Type - application/xml

### Response

#### Headers

* Content-Type - application/xml

#### Payload

This request will return a `ReportsList` parent element with an xmlns version attribute and a `ReportSummary` child element for each report. The `ReportSummary` elements will have the following child elements:

Value|Description
---|---
`ApprovalURL`|The URL the user can use to log in to Concur to approve the report. This element appears when requesting the TOAPPROVE status, and does not appear when using the DateModified query. This URL works only when the company does not use Concur SSO with the Enforce option.
`ReportName`|The name of the report.
`ReportId`|The unique identifier for the report, which appears in the Concur Expense UI.
`ReportTotal`|The total amount of the report.
`ReportCurrency`|The [3-letter ISO 4217 currency code](https://en.wikipedia.org/wiki/ISO_4217) for the expense report currency.
`ReportDate`|The create date of the report.
`LastComment`|The text of the most recent comment on the report.
`Report-Details-Url`|The URL to access the report summary details.
`Report-Full-Details-Url`|The URL to access the full report details.
`ExpenseUserXUserID`|The User ID of the user this report belongs to.
`ApproverXUserID`|The User ID of the user's expense approver.
`EmployeeName`|The name of the expense report owner. Format: Firstname Lastname

**Notes**:

The `ApprovalURL` provides a link to Expense that can be used with SSO in most circumstances. The link can be put into a browser window, then the approver is automatically logged into Expense **_and_** the expense report opens **_if_**:

* The company uses a Concur-supported SSO platform (and does **not** use the Enforce option) **_and_**...
* The approver is currently on the company network or is using VPN

Otherwise, when the approver clicks the link, the Expense login page appears. The approver logs in and follows the normal steps for approving reports.


text:
'use strict';

import passport from 'passport';
import LocalStrategy from 'passport-local';
import { ObjectID } from 'mongodb';
import debug from 'debug';

import { passwordMatch } from './util/hash';

const logger = debug('app:passport');

export default function createPassport(app) {
  let db = app.get('db');
  let User = db.collection('User');

  passport.use(new LocalStrategy({
      usernameField: 'phoneNumber',
      passwordField: 'code'
    },

    // called when a user logs in
    function(phoneNumber, code, done) {
      checkLogin(phoneNumber, code, done).catch((e) => { console.error(`Error verifying login ${e}`) })
    }
  ));

  passport.serializeUser((user, done) => {
    return done(null, user._id);
  });

  passport.deserializeUser(async function(_id, done) {
    async function deserialize(_id) {
      let user = await User.find({ _id: ObjectID(_id) }).limit(1).next();
      return user;
    }

    try {
      let user = await deserialize(_id);
      done(null, user);
    } catch(e) {
      done(e, false);
    }
  });

  async function checkLogin(phoneNumber, code, done) {
    let user = await User.find({ phoneNumber }).limit(1).next();
    if (!user || !passwordMatch(code, user.code)) {
      return done(null, false);
    }
    return done(null, user);
  }

  return passport;
}


text:
// .NAME vtkSimpleElevationFilter - generate scalars along a specified direction
// .SECTION Description
// vtkSimpleElevationFilter is a filter to generate scalar values from a
// dataset.  The scalar values are generated by dotting a user-specified
// vector against a vector defined from the input dataset points to the
// origin.

// .SECTION Caveats
// This class has been threaded with vtkSMPTools. Using TBB or other
// non-sequential type (set in the CMake variable
// VTK_SMP_IMPLEMENTATION_TYPE) may improve performance significantly.  Note
// however that the associated threading/templating implements a fast path,
// which will only kick in when the input has explicit point representation
// (e.g. a vtkPointSet).
//
// See also vtkElevationFilter provides more control over the operation,
// including clamping the output scalars within a range.

// .SECTION See Also
// vtkElevationFilter

#ifndef vtkSimpleElevationFilter_h
#define vtkSimpleElevationFilter_h

#include "vtkFiltersCoreModule.h" // For export macro
#include "vtkDataSetAlgorithm.h"

class VTKFILTERSCORE_EXPORT vtkSimpleElevationFilter : public vtkDataSetAlgorithm
{
public:
  vtkTypeMacro(vtkSimpleElevationFilter,vtkDataSetAlgorithm);
  void PrintSelf(ostream& os, vtkIndent indent);

  // Description:
  // Construct object with Vector=(0,0,1).
  static vtkSimpleElevationFilter *New();

  // Description:
  // Define the vector with which to dot against.
  vtkSetVector3Macro(Vector,double);
  vtkGetVectorMacro(Vector,double,3);

protected:
  vtkSimpleElevationFilter();
  ~vtkSimpleElevationFilter() {}

  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
  double Vector[3];
private:
  vtkSimpleElevationFilter(const vtkSimpleElevationFilter&);  // Not implemented.
  void operator=(const vtkSimpleElevationFilter&);  // Not implemented.
};

#endif


text:
@interface AppDelegate ()

@end

@implementation AppDelegate

//  在APPDelegate.m文件中增加方法,控制全部不支持横屏
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
    if (_isAllowRotation) {
        return UIInterfaceOrientationMaskLandscapeRight;
    }
    return UIInterfaceOrientationMaskPortrait;
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.window.backgroundColor = [UIColor whiteColor];

    TrainTableViewController *trainTableVC = [[TrainTableViewController alloc] init];
    UITabBarItem *trainItem = [[UITabBarItem alloc] initWithTitle:@"训练" image:[[UIImage imageNamed:@"trainGray"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"trainBlack"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    trainTableVC.tabBarItem = trainItem;
    UINavigationController *trainNaVC = [[UINavigationController alloc] initWithRootViewController:trainTableVC];

    //    SelectionViewController *seletionVC = [[SelectionViewController alloc] init];
    //    UITabBarItem *selectionItem = [[UITabBarItem alloc] initWithTitle:@"发现" image:[[UIImage imageNamed:@"findGary"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"findBlack"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    //    seletionVC.tabBarItem = selectionItem;
    //    UINavigationController *selectionNaVC = [[UINavigationController alloc] initWithRootViewController:seletionVC];

    NewViewController *newsVC = [[NewViewController alloc] init];
    UITabBarItem *newsItem = [[UITabBarItem alloc] initWithTitle:@"动态" image:[[UIImage imageNamed:@"newsGray"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"newsBlack"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    newsVC.tabBarItem = newsItem;
    UINavigationController *newsNaVC = [[UINavigationController alloc] initWithRootViewController:newsVC];

    PersonCenterViewController *personVC = [[PersonCenterViewController alloc] init];
    UITabBarItem *personItem = [[UITabBarItem alloc] initWithTitle:@"我" image:[[UIImage imageNamed:@"personCenterGray"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"personCenterBlack"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    personVC.tabBarItem = personItem;
    UINavigationController *personNaVC = [[UINavigationController alloc] initWithRootViewController:personVC];

    UITabBarController *tabBarController = [[UITabBarController alloc] init];
    // 设置标签视图控制器需要管理的子视图控制器
    tabBarController.viewControllers = @[trainNaVC, newsNaVC, personNaVC];
    // 设定标签栏选中的标签下标
    tabBarController.selectedIndex = 0;
    tabBarController.tabBar.tintColor = [UIColor blackColor];

    self.window.rootViewController = tabBarController;

    //    LoginViewController *loginVC = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil];
    //    [trainTableVC presentViewController:loginVC animated:YES completion:nil];
//    NSString *documentPatn = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
//    NSLog(@"%@",documentPatn);

//    LoginAndRegistView *loginV = [[LoginAndRegistView alloc] initWithFrame:[UIScreen mainScreen].bounds];

    [self.window makeKeyAndVisible];
    return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application {
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application {
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end


text:
<?php

namespace Enhavo\Bundle\AppBundle\Config;

use Enhavo\Bundle\AppBundle\Form\Config\WysiwygConfig;
use Enhavo\Bundle\AppBundle\Form\Config\WysiwygOption;

class WysiwygConfigTest extends \PHPUnit_Framework_TestCase
{
    public function testInitialize()
    {
        $config = new WysiwygConfig();
        $this->assertInstanceOf('Enhavo\Bundle\AppBundle\Form\Config\WysiwygConfig', $config);
    }

    public function testGetData()
    {
        $config = new WysiwygConfig();
        $option = new WysiwygOption();
        $data = $config->getData($option);
        $this->assertJson($data);

        $data = json_decode($data, true);
        $this->assertArrayHasKey('formats', $data);
        $this->assertArrayHasKey('toolbar1', $data);
        $this->assertArrayHasKey('toolbar2', $data);
        $this->assertArrayHasKey('height', $data);
        $this->assertArrayHasKey('style_formats', $data);
        $this->assertArrayHasKey('content_css', $data);
    }
}


text:
namespace disk_cache {

using base::BucketRanges;
using base::Histogram;
using base::HistogramSamples;
using base::SampleVector;
using base::StatisticsRecorder;

StatsHistogram::StatsHistogram(const std::string& name,
                               Sample minimum,
                               Sample maximum,
                               const BucketRanges* ranges,
                               const Stats* stats)
    : Histogram(name, minimum, maximum, ranges),
      stats_(stats) {}

StatsHistogram::~StatsHistogram() {}

// static
void StatsHistogram::InitializeBucketRanges(const Stats* stats,
                                            BucketRanges* ranges) {
  for (size_t i = 0; i < ranges->size(); ++i) {
    ranges->set_range(i, stats->GetBucketRange(i));
  }
  ranges->ResetChecksum();
}

StatsHistogram* StatsHistogram::FactoryGet(const std::string& name,
                                           const Stats* stats) {
  Sample minimum = 1;
  Sample maximum = disk_cache::Stats::kDataSizesLength - 1;
  size_t bucket_count = disk_cache::Stats::kDataSizesLength;
  HistogramBase* histogram = StatisticsRecorder::FindHistogram(name);
  if (!histogram) {
    DCHECK(stats);

    // To avoid racy destruction at shutdown, the following will be leaked.
    BucketRanges* ranges = new BucketRanges(bucket_count + 1);
    InitializeBucketRanges(stats, ranges);
    const BucketRanges* registered_ranges =
        StatisticsRecorder::RegisterOrDeleteDuplicateRanges(ranges);

    // To avoid racy destruction at shutdown, the following will be leaked.
    StatsHistogram* stats_histogram =
        new StatsHistogram(name, minimum, maximum, registered_ranges, stats);
    stats_histogram->SetFlags(kUmaTargetedHistogramFlag);
    histogram = StatisticsRecorder::RegisterOrDeleteDuplicate(stats_histogram);
  }

  DCHECK(base::HISTOGRAM == histogram->GetHistogramType());
  DCHECK(histogram->HasConstructionArguments(minimum, maximum, bucket_count));

  // We're preparing for an otherwise unsafe upcast by ensuring we have the
  // proper class type.
  StatsHistogram* return_histogram = static_cast<StatsHistogram*>(histogram);
  return return_histogram;
}

void StatsHistogram::Disable() {
  stats_ = NULL;
}

scoped_ptr<HistogramSamples> StatsHistogram::SnapshotSamples() const {
  scoped_ptr<SampleVector> samples(new SampleVector(bucket_ranges()));
  if (stats_)
     stats_->Snapshot(samples.get());

  // Only report UMA data once.
  StatsHistogram* mutable_me = const_cast<StatsHistogram*>(this);
  mutable_me->ClearFlags(kUmaTargetedHistogramFlag);

  return samples.PassAs<HistogramSamples>();
}

int StatsHistogram::FindCorruption(const HistogramSamples& samples) const {
  // This class won't monitor inconsistencies.
  return HistogramBase::NO_INCONSISTENCIES;
}

}  // namespace disk_cache


text:
/* n_24_3_run.c:    # operator in macro definition. */

#include    <string.h>
#include    <stdlib.h>
#include    <assert.h>

#define str( a)     # a

int main( void)
{
/* 24.3:    \ is inserted before \ and " in or surrounding literals and no
        other character is inserted to anywhere.    */
    assert( strcmp( str( '"' + "' \""), "'\"' + \"' \\\"\"") == 0);

/* 24.4:    Line splicing by <backslash><newline> is done prior to token
        parsing.   */
    assert( strcmp( str( "ab\
c"), "\"abc\"") == 0);

    return  0;
}

/* { dg-do run }
 * { dg-options "-ansi -no-integrated-cpp -w" }
 */

/*
 * Note: DejaGnu cannot handle the preprocessor output which contains a
 *  doubly stringized string literal.
 *  So, we test this testcase with strcmp().
 * Note: -no-integrated-cpp is necessary for MCPP on GCC 3.  GCC 2, however,
 *  does not recognize this option.  Remove this option on GCC 2.
 */


text:
@implementation IQMoreCell

@end


text:
import global from "./global.js";

const camelToDashMap = new Map();
export function camelToDash(str) {
  let result = camelToDashMap.get(str);
  if (result === undefined) {
    result = str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
    camelToDashMap.set(str, result);
  }
  return result;
}

export function dispatch(host, eventType, options = {}) {
  return host.dispatchEvent(
    new global.CustomEvent(eventType, { bubbles: false, ...options }),
  );
}

export function stringifyElement(target) {
  return `<${String(target.tagName).toLowerCase()}>`;
}

export function walkInShadow(target, cb) {
  if (target.nodeType === global.Node.ELEMENT_NODE) {
    cb(target);

    if (target.shadowRoot) {
      walkInShadow(target.shadowRoot, cb);
    }
  }

  const walker = global.document.createTreeWalker(
    target,
    global.NodeFilter.SHOW_ELEMENT,
    null,
    false,
  );

  while (walker.nextNode()) {
    const el = walker.currentNode;
    cb(el);
    if (el.shadowRoot) {
      walkInShadow(el.shadowRoot, cb);
    }
  }
}

export const deferred = Promise.resolve();
export const storePointer = new WeakMap();
export const probablyDevMode = walkInShadow.name === "walkInShadow";


text:
package javax.cache.event;

import java.util.EventListener;

/**
 * Tagging interface for cache entry listeners.
 *

 * Sub-interfaces exist for the various cache events allowing a listener to be created which implements only those listeners
 * it is interested in.
 *

 * The motivation for this design is to allow efficient implementation of network based listeners.
 *

 * Listeners should be implemented with care. In particular it is important to consider the impact on performance
 * and latency.
 *

 * A listener is a user supplied object instance and therefore can only be registered programmatically.
 *

 * The listeners are fired:
 *

 *
in order in which they were registered

 *
after the entry is mutated in the cache

 *
the calling thread blocks until the listener returns if the listener was registered as synchronous

 *
asynchronous listeners iterating through multiple events have undefined ordering

 *

 * A synchronous listener is not permitted to mutate the cache it is listening on.
 *

 * A listener on a transactional cache is executed orthogonally to the transaction. If synchronous it is executed after the mutation
 * and not after the transaction commits, and if asynchronous the timing is undefined. A listener which throws an exception will not affect
 * the transaction. A transaction which is rolled back will not unfire a listener.
 *
 * @param <K> the type of keys maintained by the associated cache
 * @param <V> the type of values maintained by the associated cache
 * @author Yannis Cosmadopoulos
 * @author Greg Luck
 * @see CacheEntryCreatedListener
 * @see javax.cache.event.CacheEntryUpdatedListener
 * @see javax.cache.event.CacheEntryReadListener
 * @see javax.cache.event.CacheEntryRemovedListener
 * @see CacheEntryExpiredListener
 * @since 1.0
 */
public interface CacheEntryListener<K, V> extends EventListener {

}


text:
Unlock device

      Are you sure you want to unlock the device {{deviceId}}?
      You should only do this if you've confirmed it's in the user's possession.

    <button mat-button color="primary"
            (click)="unlock()"
            id="yes"
            class="action-button">
      Yes
    </button>
    <button mat-button
            (click)="closeDialog()"
            id="cancel"
            class="action-button"
            matTooltip="This will take you back to the management screen.">
      Cancel
    </button>

  <loaner-loader></loaner-loader>

Success!

 Device {{deviceId}} has been successfully unlocked.

    <button mat-button
            (click)="closeDialog()"
            id="close"
            class="action-button"
            matTooltip="This will take you back to the management screen.">
      Close
    </button>


text:
#region License

// Copyright (c) 2017, Vira
// All rights reserved.
// Solution: CSharp_Example
// Project: Printer
// Filename: OutputableFactory.cs
// Date - created:2017.04.15 - 09:52
// Date - current: 2017.04.15 - 11:12

#endregion

#region Usings

using System.IO;
using System.Xaml;
using System.Xml;

#endregion

namespace Printer
{
    /// <summary>
    ///     Represents a factory, which is also able to load and save IConsoleOutputable.
    /// </summary>
    public static class OutputableFactory
    {
        /// <summary>
        ///     Generates a new instance of the type T.
        /// </summary>
        /// <typeparam name="T">T has to implament IConsoleOutputable.</typeparam>
        /// <returns>Returns a new instance of the wanted type.</returns>
        public static IConsoleOutputable Factorise<T>() where T : IConsoleOutputable, new() => new T();

        /// <summary>
        ///     Loads the IConsoleOutputable from a xaml file.
        /// </summary>
        /// <param name="file">The xaml file, which contains the inforamtion for a IConsoleOutputable.</param>
        /// <returns>Returns the loaded IConsoleOutputable.</returns>
        public static IConsoleOutputable Load(string file)
        {
            using (TextReader reader = File.OpenText(file))
            {
                return (IConsoleOutputable) XamlServices.Load(XmlReader.Create(reader, new XmlReaderSettings
                {
                    DtdProcessing = DtdProcessing.Parse,
                    MaxCharactersFromEntities = 1024,

                }));
            }
        }

        /// <summary>
        ///     Serialises the IConsoleOutputable into xaml file.
        /// </summary>
        /// <param name="toSave">The IConsoleOutputable, which has to get saveed.</param>
        /// <param name="file">The file, which is going to contain the serialised code.</param>
        public static void Save(this IConsoleOutputable toSave, string file)
        {
            using (TextWriter writer = File.CreateText(file))
            {
                XamlServices.Save(writer, toSave);
            }
        }
    }
}


text:
<?php

namespace app\modules\administrator\controllers;

use Yii;
use app\models\Spa;
use app\models\SpaSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;

use yii\web\UploadedFile;

/**
 * SpaController implements the CRUD actions for Spa model.
 */
class SpaController extends Controller
{
    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                'rules' => [
                    [
                        'allow' => true,
                        'roles' => ['administrator'],
                    ],
                ],
            ],
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['POST'],
                ],
            ],
        ];
    }

    /**
     * Lists all Spa models.
     * @return mixed
     */
    public function actionIndex()
    {
        $searchModel = new SpaSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }

    /**
     * Creates a new Spa model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate()
    {
        $model = new Spa();
        $model->scenario = Spa::SCENARIO_ADD;

        if ($model->load(Yii::$app->request->post())) {
            $model->photo_file = UploadedFile::getInstance($model, 'photo_file');
            if ($model->add()) {
                return $this->redirect(['index']);
            }
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Updates an existing Spa model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
    public function actionUpdate($id)
    {
        $model = $this->findModel($id);
        $model->scenario = Spa::SCENARIO_EDIT;

        if ($model->load(Yii::$app->request->post())) {
            $model->photo_file = UploadedFile::getInstance($model, 'photo_file');
            if ($model->add()) {
                return $this->redirect(['index']);
            }
        } else {
            return $this->render('update', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Deletes an existing Spa model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
    public function actionDelete($id)
    {
        $model = $this->findModel($id);
        $model->scenario = Spa::SCENARIO_TOGGLE_STATUS;
        $model->setAttribute('status', Spa::STATUS_DELETE);
        $model->save();

        return $this->redirect(['index']);
    }

    /**
     * Finds the Spa model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return Spa the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = Spa::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}


text:
<?php

class Thumbnailcreator_AppModel extends MIDASModel
{

}
?>


text:
package stresso.trie;

import java.io.File;

import org.apache.fluo.api.client.FluoClient;
import org.apache.fluo.api.client.FluoFactory;
import org.apache.fluo.api.client.Snapshot;
import org.apache.fluo.api.client.scanner.ColumnScanner;
import org.apache.fluo.api.client.scanner.RowScanner;
import org.apache.fluo.api.config.FluoConfiguration;
import org.apache.fluo.api.config.SimpleConfiguration;
import org.apache.fluo.api.data.ColumnValue;
import org.apache.fluo.api.data.Span;

public class Print {

  public static class Stats {
    public long totalWait = 0;
    public long totalSeen = 0;
    public long nodes;
    public boolean sawOtherNodes = false;

    public Stats() {

    }

    public Stats(long tw, long ts, boolean son) {
      this.totalWait = tw;
      this.totalSeen = ts;
      this.sawOtherNodes = son;
    }

    public Stats(long tw, long ts, long nodes, boolean son) {
      this.totalWait = tw;
      this.totalSeen = ts;
      this.nodes = nodes;
      this.sawOtherNodes = son;
    }

    @Override
    public boolean equals(Object o) {
      if (o instanceof Stats) {
        Stats os = (Stats) o;

        return totalWait == os.totalWait && totalSeen == os.totalSeen
            && sawOtherNodes == os.sawOtherNodes;
      }

      return false;
    }
  }

  public static Stats getStats(SimpleConfiguration config) throws Exception {

    try (FluoClient client = FluoFactory.newClient(config); Snapshot snap = client.newSnapshot()) {

      int level = client.getAppConfiguration().getInt(Constants.STOP_LEVEL_PROP);
      int nodeSize = client.getAppConfiguration().getInt(Constants.NODE_SIZE_PROP);

      RowScanner rows = snap.scanner().over(Span.prefix(String.format("%02d:", level)))
          .fetch(Constants.COUNT_SEEN_COL, Constants.COUNT_WAIT_COL).byRow().build();

      long totalSeen = 0;
      long totalWait = 0;

      int otherNodeSizes = 0;

      long nodes = 0;

      for (ColumnScanner columns : rows) {
        String row = columns.getsRow();
        Node node = new Node(row);

        if (node.getNodeSize() == nodeSize) {
          for (ColumnValue cv : columns) {
            if (cv.getColumn().equals(Constants.COUNT_SEEN_COL)) {
              totalSeen += Long.parseLong(cv.getsValue());
            } else {
              totalWait += Long.parseLong(cv.getsValue());
            }
          }

          nodes++;
        } else {
          otherNodeSizes++;
        }
      }

      return new Stats(totalWait, totalSeen, nodes, otherNodeSizes != 0);
    }

  }

  public static void main(String[] args) throws Exception {

    if (args.length != 1) {
      System.err.println("Usage: " + Print.class.getSimpleName() + " <fluo props>");
      System.exit(-1);
    }

    Stats stats = getStats(new FluoConfiguration(new File(args[0])));

    System.out.println("Total at root : " + (stats.totalSeen + stats.totalWait));
    System.out.println("Nodes Scanned : " + stats.nodes);

    if (stats.sawOtherNodes) {
      System.err.println("WARN : Other node sizes were seen and ignored.");
    }
  }
}