text:
Client library for Wordnik

## Installation and Usage
```bash
npm install --save @datafire/wordnik
```
```js
let wordnik = require('@datafire/wordnik').create({
  api_key: ""
});

.then(data => {
  console.log(data);
});
```

## Description

Wordnik is the world's biggest online English dictionary, by number of words

## Actions

### getApiTokenStatus
Returns usage statistics for the API account.

```js
wordnik.getApiTokenStatus({}, context)
```

#### Input
* input `object`
  * api_key `string`: Wordnik authentication token

#### Output
* output [ApiTokenStatus](#apitokenstatus)

### authenticate
Authenticates a User

```js
wordnik.authenticate({
  "username": "",
  "password": ""
}, context)
```

#### Input
* input `object`
  * username **required** `string`: A confirmed Wordnik username
  * password **required** `string`: The user's password

#### Output
* output [AuthenticationToken](#authenticationtoken)

### authenticatePost
Authenticates a user

```js
wordnik.authenticatePost({
  "username": "",
  "body": ""
}, context)
```

#### Input
* input `object`
  * username **required** `string`: A confirmed Wordnik username
  * body **required** `string`

#### Output
* output [AuthenticationToken](#authenticationtoken)

### getLoggedInUser
Requires a valid auth_token to be set.

```js
wordnik.getLoggedInUser({
  "auth_token": ""
}, context)
```

#### Input
* input `object`
  * auth_token **required** `string`: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)

#### Output
* output [User](#user)

### getWordListsForLoggedInUser
Fetches WordList objects for the logged-in user.

```js
wordnik.getWordListsForLoggedInUser({
  "auth_token": ""
}, context)
```

#### Input
* input `object`
  * auth_token **required** `string`: auth_token of logged-in user
  * skip `integer`: Results to skip
  * limit `integer`: Maximum number of results to return

#### Output
* output `array`
  * items [WordList](#wordlist)

### getWord
Given a word as a string, returns the WordObject that represents it

```js
wordnik.getWord({
  "word": ""
}, context)
```

#### Input
* input `object`
  * word **required** `string`: String value of WordObject to return
  * useCanonical `string`: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.
  * includeSuggestions `string`: Return suggestions (for correct spelling, case variants, etc.)

#### Output
* output [WordObject](#wordobject)

### getAudio
The metadata includes a time-expiring fileUrl which allows reading the audio file directly from the API.  Currently only audio pronunciations from the American Heritage Dictionary in mp3 format are supported.

```js
wordnik.getAudio({
  "word": ""
}, context)
```

#### Input
* input `object`
  * word **required** `string`: Word to get audio for.
  * useCanonical `string`: Use the canonical form of the word
  * limit `integer`: Maximum number of results to return

#### Output
* output `array`
  * items [AudioFile](#audiofile)

### getDefinitions
Return definitions for a word

```js
wordnik.getDefinitions({
  "word": ""
}, context)
```

#### Input
* input `object`
  * word **required** `string`: Word to return definitions for
  * limit `integer`: Maximum number of results to return
  * partOfSpeech `string`: CSV list of part-of-speech types
  * includeRelated `string`: Return related words with definitions
  * sourceDictionaries `array`: Source dictionary to return definitions from.  If 'all' is received, results are returned from all sources. If multiple values are received (e.g. 'century,wiktionary'), results are returned from the first specified dictionary that has definitions. If left blank, results are returned from the first dictionary that has definitions. By default, dictionaries are searched in this order: ahd, wiktionary, webster, century, wordnet
  * useCanonical `string`: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.
  * includeTags `string`: Return a closed set of XML tags in response

#### Output
* output `array`
  * items [Definition](#definition)

### getEtymologies
Fetches etymology data

```js
wordnik.getEtymologies({
  "word": ""
}, context)
```

#### Input
* input `object`
  * word **required** `string`: Word to return
  * useCanonical `string`: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.

#### Output
* output `array`
  * items `string`

### getExamples
Returns examples for a word

```js
wordnik.getExamples({
  "word": ""
}, context)
```

#### Input
* input `object`
  * word **required** `string`: Word to return examples for
  * includeDuplicates `string`: Show duplicate examples from different sources
  * useCanonical `string`: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.
  * skip `integer`: Results to skip
  * limit `integer`: Maximum number of results to return

#### Output
* output [ExampleSearchResults](#examplesearchresults)

### getWordFrequency
Returns word usage over time

```js
wordnik.getWordFrequency({
  "word": ""
}, context)
```

#### Input
* input `object`
  * word **required** `string`: Word to return
  * useCanonical `string`: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.
  * startYear `integer`: Starting Year
  * endYear `integer`: Ending Year

#### Output
* output [FrequencySummary](#frequencysummary)

### getHyphenation
Returns syllable information for a word

```js
wordnik.getHyphenation({
  "word": ""
}, context)
```

#### Input
* input `object`
  * word **required** `string`: Word to get syllables for
  * useCanonical `string`: If true will try to return a correct word root ('cats' -> 'cat'). If false returns exactly what was requested.
  * sourceDictionary `string`: Get from a single dictionary. Valid options: ahd, century, wiktionary, webster, and wordnet.
  * limit `integer`: Maximum number of results to return

#### Output
* output `array`
  * items [Syllable](#syllable)

### getPhrases
Fetches bi-gram phrases for a word

```js
wordnik.getPhrases({
  "word": ""
}, context)
```

#### Input
* input `object`
  * word **required** `string`: Word to fetch phrases for
  * limit `integer`: Maximum number of results to return
  * wlmi `integer`: Minimum WLMI for the phrase
  * useCanonical `string`: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.

#### Output
* output `array`
  * items [Bigram](#bigram)

### getTextPronunciations
Returns text pronunciations for a given word

```js
wordnik.getTextPronunciations({
  "word": ""
}, context)
```

#### Input
* input `object`
  * word **required** `string`: Word to get pronunciations for
  * useCanonical `string`: If true will try to return a correct word root ('cats' -> 'cat'). If false returns exactly what was requested.
  * sourceDictionary `string`: Get from a single dictionary
  * typeFormat `string`: Text pronunciation type
  * limit `integer`: Maximum number of results to return

#### Output
* output `array`
  * items [TextPron](#textpron)

### getRelatedWords
Given a word as a string, returns relationships from the Word Graph

```js
wordnik.getRelatedWords({
  "word": ""
}, context)
```

#### Input
* input `object`
  * word **required** `string`: Word to fetch relationships for
  * useCanonical `string`: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.
  * relationshipTypes `string`: Limits the total results per type of relationship type
  * limitPerRelationshipType `integer`: Restrict to the supplied relationship types

#### Output
* output `array`
  * items [Related](#related)

### getTopExample
Returns a top example for a word

```js
wordnik.getTopExample({
  "word": ""
}, context)
```

#### Input
* input `object`
  * word **required** `string`: Word to fetch examples for
  * useCanonical `string`: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.

#### Output
* output [Example](#example)

### deleteWordList
Deletes an existing WordList

```js
wordnik.deleteWordList({
  "permalink": "",
  "auth_token": ""
}, context)
```

#### Input
* input `object`
  * permalink **required** `string`: ID of WordList to delete
  * auth_token **required** `string`: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)

#### Output
*Output schema unknown*

### getWordListByPermalink
Fetches a WordList by ID

```js
wordnik.getWordListByPermalink({
  "permalink": "",
  "auth_token": ""
}, context)
```

#### Input
* input `object`
  * permalink **required** `string`: permalink of WordList to fetch
  * auth_token **required** `string`: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)

#### Output
* output [WordList](#wordlist)

### updateWordList
Updates an existing WordList

```js
wordnik.updateWordList({
  "permalink": "",
  "auth_token": ""
}, context)
```

#### Input
* input `object`
  * permalink **required** `string`: permalink of WordList to update
  * body [WordList](#wordlist)
  * auth_token **required** `string`: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)

#### Output
*Output schema unknown*

### deleteWordsFromWordList
Removes words from a WordList

```js
wordnik.deleteWordsFromWordList({
  "permalink": "",
  "auth_token": ""
}, context)
```

#### Input
* input `object`
  * permalink **required** `string`: permalink of WordList to use
  * body `array`
    * items [StringValue](#stringvalue)
  * auth_token **required** `string`: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)

#### Output
*Output schema unknown*

### getWordListWords
Fetches words in a WordList

```js
wordnik.getWordListWords({
  "permalink": "",
  "auth_token": ""
}, context)
```

#### Input
* input `object`
  * permalink **required** `string`: ID of WordList to use
  * sortBy `string`: Field to sort by
  * sortOrder `string`: Direction to sort
  * skip `integer`: Results to skip
  * limit `integer`: Maximum number of results to return
  * auth_token **required** `string`: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)

#### Output
* output `array`
  * items [WordListWord](#wordlistword)

### addWordsToWordList
Adds words to a WordList

```js
wordnik.addWordsToWordList({
  "permalink": "",
  "auth_token": ""
}, context)
```

#### Input
* input `object`
  * permalink **required** `string`: permalink of WordList to user
  * body `array`
    * items [StringValue](#stringvalue)
  * auth_token **required** `string`: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)

#### Output
*Output schema unknown*

### createWordList
Creates a WordList.

```js
wordnik.createWordList({
  "auth_token": ""
}, context)
```

#### Input
* input `object`
  * body [WordList](#wordlist)
  * auth_token **required** `string`: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)

#### Output
* output [WordList](#wordlist)

### getRandomWord
Returns a single random WordObject

```js
wordnik.getRandomWord({}, context)
```

#### Input
* input `object`
  * hasDictionaryDef `string`: Only return words with dictionary definitions
  * includePartOfSpeech `string`: CSV part-of-speech values to include
  * excludePartOfSpeech `string`: CSV part-of-speech values to exclude
  * minCorpusCount `integer`: Minimum corpus frequency for terms
  * maxCorpusCount `integer`: Maximum corpus frequency for terms
  * minDictionaryCount `integer`: Minimum dictionary count
  * maxDictionaryCount `integer`: Maximum dictionary count
  * minLength `integer`: Minimum word length
  * maxLength `integer`: Maximum word length

#### Output
* output [WordObject](#wordobject)

### getRandomWords
Returns an array of random WordObjects

```js
wordnik.getRandomWords({}, context)
```

#### Input
* input `object`
  * hasDictionaryDef `string`: Only return words with dictionary definitions
  * includePartOfSpeech `string`: CSV part-of-speech values to include
  * excludePartOfSpeech `string`: CSV part-of-speech values to exclude
  * minCorpusCount `integer`: Minimum corpus frequency for terms
  * maxCorpusCount `integer`: Maximum corpus frequency for terms
  * minDictionaryCount `integer`: Minimum dictionary count
  * maxDictionaryCount `integer`: Maximum dictionary count
  * minLength `integer`: Minimum word length
  * maxLength `integer`: Maximum word length
  * sortBy `string`: Attribute to sort by
  * sortOrder `string`: Sort direction
  * limit `integer`: Maximum number of results to return

#### Output
* output `array`
  * items [WordObject](#wordobject)

### reverseDictionary
Reverse dictionary search

```js
wordnik.reverseDictionary({
  "query": ""
}, context)
```

#### Input
* input `object`
  * query **required** `string`: Search term
  * findSenseForWord `string`: Restricts words and finds closest sense
  * includeSourceDictionaries `string`: Only include these comma-delimited source dictionaries
  * excludeSourceDictionaries `string`: Exclude these comma-delimited source dictionaries
  * includePartOfSpeech `string`: Only include these comma-delimited parts of speech
  * excludePartOfSpeech `string`: Exclude these comma-delimited parts of speech
  * minCorpusCount `integer`: Minimum corpus frequency for terms
  * maxCorpusCount `integer`: Maximum corpus frequency for terms
  * minLength `integer`: Minimum word length
  * maxLength `integer`: Maximum word length
  * expandTerms `string`: Expand terms
  * includeTags `string`: Return a closed set of XML tags in response
  * sortBy `string`: Attribute to sort by
  * sortOrder `string`: Sort direction
  * skip `string`: Results to skip
  * limit `integer`: Maximum number of results to return

#### Output
* output [DefinitionSearchResults](#definitionsearchresults)

### searchWords
Searches words

```js
wordnik.searchWords({
  "query": ""
}, context)
```

#### Input
* input `object`
  * query **required** `string`: Search query
  * caseSensitive `string`: Search case sensitive
  * includePartOfSpeech `string`: Only include these comma-delimited parts of speech
  * excludePartOfSpeech `string`: Exclude these comma-delimited parts of speech
  * minCorpusCount `integer`: Minimum corpus frequency for terms
  * maxCorpusCount `integer`: Maximum corpus frequency for terms
  * minDictionaryCount `integer`: Minimum number of dictionary entries for words returned
  * maxDictionaryCount `integer`: Maximum dictionary definition count
  * minLength `integer`: Minimum word length
  * maxLength `integer`: Maximum word length
  * skip `integer`: Results to skip
  * limit `integer`: Maximum number of results to return

#### Output
* output [WordSearchResults](#wordsearchresults)

### getWordOfTheDay
Returns a specific WordOfTheDay

```js
wordnik.getWordOfTheDay({}, context)
```

#### Input
* input `object`
  * date `string`: Fetches by date in yyyy-MM-dd

#### Output
* output [WordOfTheDay](#wordoftheday)

## Definitions

### ApiTokenStatus
* ApiTokenStatus `object`
  * expiresInMillis `integer`
  * remainingCalls `integer`
  * resetsInMillis `integer`
  * token `string`
  * totalRequests `integer`
  * valid `boolean`

### AudioFile
* AudioFile `object`
  * attributionText `string`
  * attributionUrl `string`
  * audioType `string`
  * commentCount `integer`
  * createdAt `string`
  * createdBy `string`
  * description `string`
  * duration `number`
  * fileUrl `string`
  * id **required** `integer`
  * voteAverage `number`
  * voteCount `integer`
  * voteWeightedAverage `number`
  * word `string`

### AudioType
* AudioType `object`
  * id `integer`
  * name `string`

### AuthenticationToken
* AuthenticationToken `object`
  * token `string`
  * userId `integer`
  * userSignature `string`

### Bigram
* Bigram `object`
  * count `integer`
  * gram1 `string`
  * gram2 `string`
  * mi `number`
  * wlmi `number`

### Category
* Category `object`
  * id **required** `integer`
  * name `string`

### Citation
* Citation `object`
  * cite `string`
  * source `string`

### ContentProvider
* ContentProvider `object`
  * id `integer`
  * name `string`

### Definition
* Definition `object`
  * attributionText `string`
  * attributionUrl `string`
  * citations `array`
    * items [Citation](#citation)
  * exampleUses `array`
    * items [ExampleUsage](#exampleusage)
  * extendedText `string`
  * labels `array`
    * items [Label](#label)
  * notes `array`
    * items [Note](#note)
  * partOfSpeech `string`
  * relatedWords `array`
    * items [Related](#related)
  * score `number`
  * seqString `string`
  * sequence `string`
  * sourceDictionary `string`
  * text `string`
  * textProns `array`
    * items [TextPron](#textpron)
  * word `string`

### DefinitionSearchResults
* DefinitionSearchResults `object`
  * results `array`
    * items [Definition](#definition)
  * totalResults `integer`

### Example
* Example `object`
  * documentId `integer`
  * exampleId `integer`
  * id `integer`
  * provider [ContentProvider](#contentprovider)
  * rating `number`
  * score [ScoredWord](#scoredword)
  * sentence [Sentence](#sentence)
  * text `string`
  * title `string`
  * url `string`
  * word `string`
  * year `integer`

### ExampleSearchResults
* ExampleSearchResults `object`
  * examples `array`
    * items [Example](#example)
  * facets `array`
    * items [Facet](#facet)

### ExampleUsage
* ExampleUsage `object`
  * text `string`

### Facet
* Facet `object`
  * facetValues `array`
    * items [FacetValue](#facetvalue)
  * name `string`

### FacetValue
* FacetValue `object`
  * count `integer`
  * value `string`

### Frequency
* Frequency `object`
  * count `integer`
  * year `integer`

### FrequencySummary
* FrequencySummary `object`
  * frequency `array`
    * items [Frequency](#frequency)
  * frequencyString `string`
  * totalCount `integer`
  * unknownYearCount `integer`
  * word `string`

### Label
* Label `object`
  * text `string`
  * type `string`

### Note
* Note `object`
  * appliesTo `array`
    * items `string`
  * noteType `string`
  * pos `integer`
  * value `string`

### PartOfSpeech
* PartOfSpeech `object`
  * allCategories `array`
    * items [Category](#category)
  * roots `array`
    * items [Root](#root)
  * storageAbbr `array`
    * items `string`

### Related
* Related `object`
  * gram `string`
  * label1 `string`
  * label2 `string`
  * label3 `string`
  * label4 `string`
  * relationshipType `string`
  * words `array`
    * items `string`

### Root
* Root `object`
  * categories `array`
    * items [Category](#category)
  * id **required** `integer`
  * name `string`

### ScoredWord
* ScoredWord `object`
  * baseWordScore `number`
  * docTermCount `integer`
  * id `integer`
  * lemma `string`
  * partOfSpeech `string`
  * position `integer`
  * score `number`
  * sentenceId `integer`
  * stopword `boolean`
  * word `string`
  * wordType `string`

### Sentence
* Sentence `object`
  * display `string`
  * documentMetadataId `integer`
  * hasScoredWords `boolean`
  * id `integer`
  * rating `integer`
  * scoredWords `array`
    * items [ScoredWord](#scoredword)

### SimpleDefinition
* SimpleDefinition `object`
  * note `string`
  * partOfSpeech `string`
  * source `string`
  * text `string`

### SimpleExample
* SimpleExample `object`
  * id `integer`
  * text `string`
  * title `string`
  * url `string`

### StringValue
* StringValue `object`
  * word `string`

### Syllable
* Syllable `object`
  * seq `integer`
  * text `string`
  * type `string`

### TextPron
* TextPron `object`
  * raw `string`
  * rawType `string`
  * seq `integer`

### User
* User `object`
  * displayName `string`
  * email `string`
  * faceBookId `string`
  * id `integer`
  * password `string`
  * status `integer`
  * userName `string`
  * username `string`

### WordList
* WordList `object`
  * createdAt `string`
  * description `string`
  * id `integer`
  * lastActivityAt `string`
  * name `string`
  * numberWordsInList `integer`
  * permalink `string`
  * type `string`
  * updatedAt `string`
  * userId `integer`
  * username `string`

### WordListWord
* WordListWord `object`
  * createdAt `string`
  * id **required** `integer`
  * numberCommentsOnWord `integer`
  * numberLists `integer`
  * userId `integer`
  * username `string`
  * word `string`

### WordObject
* WordObject `object`
  * canonicalForm `string`
  * id **required** `integer`
  * originalWord `string`
  * suggestions `array`
    * items `string`
  * vulgar `string`
  * word `string`

### WordOfTheDay
* WordOfTheDay `object`
  * category `string`
  * contentProvider [ContentProvider](#contentprovider)
  * createdAt `string`
  * createdBy `string`
  * definitions `array`
    * items [SimpleDefinition](#simpledefinition)
  * examples `array`
    * items [SimpleExample](#simpleexample)
  * htmlExtra `string`
  * id **required** `integer`
  * note `string`
  * parentId `string`
  * publishDate `string`
  * word `string`

### WordSearchResult
* WordSearchResult `object`
  * count `integer`
  * lexicality `number`
  * word `string`

### WordSearchResults
* WordSearchResults `object`
  * searchResults `array`
    * items [WordSearchResult](#wordsearchresult)
  * totalResults `integer`


text:
<?php

?>

<?php if($form->getObject()->isNew()) $form->setDefault('users_id',$sf_user->getAttribute('id')) ?>

<form class="form-horizontal" role="form"  id="ticketsReports" action="<?php echo url_for('ticketsReports/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>

<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<?php endif; ?>

<?php echo $form->renderHiddenFields(false) ?>
<?php echo input_hidden_tag('redirect_to',$sf_request->getParameter('redirect_to')) ?>

<?php echo $form->renderGlobalErrors() ?>

  	* <?php echo $form['name']->renderLabel() ?>

  		<?php echo $form['name'] ?>

    	<?php echo $form['display_on_home']->renderLabel() ?>

<?php echo $form['display_on_home'] ?>

    <?php echo __('Tickets Filters') ?>

    <?php echo __('Projects Filters') ?>

    <?php echo app::getReportFormFilterByTable('Department','tickets_reports[departments_id]','Departments',$form['departments_id']->getValue()) ?>
    <?php echo app::getReportFormFilterByTable('Status','tickets_reports[tickets_status_id]','TicketsStatus',$form['tickets_status_id']->getValue()) ?>
    <?php echo app::getReportFormFilterByTable('Type','tickets_reports[tickets_types_id]','TicketsTypes',$form['tickets_types_id']->getValue()) ?>

    <?php echo app::getReportFormFilterByTable('Status','tickets_reports[projects_status_id]','ProjectsStatus',$form['projects_status_id']->getValue()) ?>
    <?php echo app::getReportFormFilterByTable('Type','tickets_reports[projects_type_id]','ProjectsTypes',$form['projects_type_id']->getValue()) ?>

    <?php
      if(count($choices = app::getProjectChoicesByUser($sf_user,true,'tickets'))>0)
      {
        if(!is_string($v = $form['projects_id']->getValue())) $v = '';

        echo  '

        	' . __('Projects') . '

            ' . select_tag('tickets_reports[projects_id]',explode(',',$v),array('choices'=>$choices,'multiple'=>true),array('class'=>'form-control  multiple-select-tag','style'=>''))  . '

      ';

      }
    ?>

<?php echo ajax_modal_template_footer() ?>

</form>

<?php include_partial('global/formValidator',array('form_id'=>'ticketsReports')); ?>

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Tdphillipsjr\Validator;

/**
 * Determine if $data is a valid phone number.
 */
class PhoneValidator extends BaseValidator
{
    public function __construct($data)
    {
        parent::__construct($data, array());
    }

    /**
     * Currently only matching American format phone numbers of ten digits.  Also validates the
     * first number is not 1 or 0 and the second number is not 9.  This is NOT validating
     * generally accepted formats and expects any non-numeric characters and a leading 1
     * to have been stripped out.
     *
     * @return boolean
     * @throws Validator\ValidationException
     */
    public function validate()
    {
        $pattern = '/^[2-9][0-9]{9}$/';

        if (!preg_match($pattern, $this->_data)) {
            $this->addError('Phone number did not match an expected format: 10 digits, not starting with 1 or 0.');
        }

        return !sizeof($this->_errors);
    }
}


text:
RTTI_DEF1(ossimHistogramMatchFilter, "ossimHistogramMatchFilter", ossimImageSourceFilter);
ossimHistogramMatchFilter::ossimHistogramMatchFilter()
   :ossimImageSourceFilter(),
    theAutoLoadInputHistogramFlag(false)
{
   theInputHistogramEqualizer = new ossimHistogramEqualization;
   theTargetHistogramEqualizer = new ossimHistogramEqualization;

   theInputHistogramEqualizer->setInverseFlag(false);
   theTargetHistogramEqualizer->setInverseFlag(true);
   theTargetHistogramEqualizer->connectMyInputTo(0, theInputHistogramEqualizer.get());
}

ossimRefPtr<ossimImageData> ossimHistogramMatchFilter::getTile(const ossimIrect& tileRect,
                                                               ossim_uint32 resLevel)
{
   if(isSourceEnabled())
   {
      return theTargetHistogramEqualizer->getTile(tileRect, resLevel);
   }
   if(theAutoLoadInputHistogramFlag&&
      (theInputHistogramFilename==""))
   {
      autoLoadInputHistogram();
   }
   if(theInputConnection)
   {
      return theInputConnection->getTile(tileRect, resLevel);
   }

   return 0;
}

void ossimHistogramMatchFilter::setInputHistogram(const ossimFilename& inputHistogram)
{
   theInputHistogramFilename = inputHistogram;
   theInputHistogramEqualizer->setHistogram(inputHistogram);
   theInputHistogramEqualizer->initialize();
}

void ossimHistogramMatchFilter::setTargetHistogram(const ossimFilename& targetHistogram)
{
   theTargetHistogramFilename = targetHistogram;
   theTargetHistogramEqualizer->setHistogram(targetHistogram);
   theTargetHistogramEqualizer->initialize();
}

void ossimHistogramMatchFilter::connectInputEvent(ossimConnectionEvent& event)
{
   ossimImageSourceFilter::connectInputEvent(event);
   if(getInput())
   {
      theInputHistogramEqualizer->connectMyInputTo(0, getInput());
      theInputHistogramEqualizer->initialize();
      theTargetHistogramEqualizer->initialize();
   }
   else
   {
      theInputHistogramEqualizer->disconnectMyInput(0, false, false);
      theInputHistogramEqualizer->initialize();
      theTargetHistogramEqualizer->initialize();
   }
}

void ossimHistogramMatchFilter::disconnectInputEvent(ossimConnectionEvent& event)
{
   ossimImageSourceFilter::disconnectInputEvent(event);
   if(getInput())
   {
      theInputHistogramEqualizer->connectMyInputTo(0, getInput());
      theInputHistogramEqualizer->initialize();
      theTargetHistogramEqualizer->initialize();
   }
   else
   {
      theInputHistogramEqualizer->disconnectMyInput(0, false, false);
      theInputHistogramEqualizer->initialize();
      theTargetHistogramEqualizer->initialize();
   }
}

void ossimHistogramMatchFilter::initialize()
{
   ossimImageSourceFilter::initialize();
   if(theAutoLoadInputHistogramFlag)
   {
      if(theInputHistogramFilename == "")
      {
         autoLoadInputHistogram();
      }
   }

   theInputHistogramEqualizer->initialize();
   theTargetHistogramEqualizer->initialize();
}

void ossimHistogramMatchFilter::setProperty(ossimRefPtr<ossimProperty> property)
{
   if(!property.valid()) return;

   ossimString name = property->getName();
   if(name == "input_histogram_filename")
   {
      setInputHistogram(ossimFilename(property->valueToString()));
      return;
   }
   else if(name == "target_histogram_filename")
   {
      setTargetHistogram(ossimFilename(property->valueToString()));
      return;
   }
   else if(name == "auto_load_input_histogram_flag")
   {
      theAutoLoadInputHistogramFlag = property->valueToString().toBool();
      if(theAutoLoadInputHistogramFlag)
      {
         initialize();
      }
      return;
   }
   ossimImageSourceFilter::setProperty(property);
}

ossimRefPtr<ossimProperty> ossimHistogramMatchFilter::getProperty(const ossimString& name)const
{
   if(name == "input_histogram_filename")
   {
      ossimFilenameProperty* filenameProp =
         new ossimFilenameProperty(name, theInputHistogramFilename);

      filenameProp->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
      filenameProp->setCacheRefreshBit();
      return filenameProp;
   }
   else if(name == "target_histogram_filename")
   {
      ossimFilenameProperty* filenameProp =
         new ossimFilenameProperty(name, theTargetHistogramFilename);

      filenameProp->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
      filenameProp->setCacheRefreshBit();

      return filenameProp;
   }
   if(name == "auto_load_input_histogram_flag")
   {
      ossimBooleanProperty* boolProp = new ossimBooleanProperty(name,
                                                                theAutoLoadInputHistogramFlag);
      boolProp->setCacheRefreshBit();
      return boolProp;
   }
   return ossimImageSourceFilter::getProperty(name);
}

void ossimHistogramMatchFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
{
   ossimImageSourceFilter::getPropertyNames(propertyNames);

   propertyNames.push_back("auto_load_input_histogram_flag");
   propertyNames.push_back("input_histogram_filename");
   propertyNames.push_back("target_histogram_filename");
}

bool ossimHistogramMatchFilter::loadState(const ossimKeywordlist& kwl,
                                          const char* prefix)
{
   const char* inputFilename     = kwl.find(prefix, "input_histogram_filename");
   const char* targetFilename    = kwl.find(prefix, "target_histogram_filename");
   const char* autoLoadInputFlag = kwl.find(prefix, "auto_load_input_histogram_flag");

   if(autoLoadInputFlag)
   {
      theAutoLoadInputHistogramFlag = ossimString(autoLoadInputFlag).toBool();
   }

   if(inputFilename&&!theAutoLoadInputHistogramFlag)
   {
      setInputHistogram(ossimFilename(inputFilename));
   }
   else
   {
      setInputHistogram(ossimFilename(""));
   }

   if(targetFilename)
   {
      setTargetHistogram(ossimFilename(targetFilename));
   }
   else
   {
      setTargetHistogram(ossimFilename(""));
   }

   return ossimImageSourceFilter::loadState(kwl, prefix);
}

bool ossimHistogramMatchFilter::saveState(ossimKeywordlist& kwl,
                                          const char* prefix)const
{
   if(theAutoLoadInputHistogramFlag)
   {
      kwl.add(prefix,
              "input_histogram_filename",
              "",
              true);
   }
   else
   {
      kwl.add(prefix,
              "input_histogram_filename",
              theInputHistogramFilename.c_str(),
              true);
   }
   kwl.add(prefix,
           "target_histogram_filename",
           theTargetHistogramFilename.c_str(),
           true);
   kwl.add(prefix,
           "auto_load_input_histogram_flag",
           theAutoLoadInputHistogramFlag,
           true);

   return ossimImageSourceFilter::saveState(kwl, prefix);
}

void ossimHistogramMatchFilter::autoLoadInputHistogram()
{
   ossimTypeNameVisitor visitor(ossimString("ossimImageHandler"),
                                true,
                                ossimVisitor::VISIT_CHILDREN|ossimVisitor::VISIT_INPUTS);
   accept(visitor);

   if ( visitor.getObjects().size() )
   {
      ossimRefPtr<ossimImageHandler> ih = visitor.getObjectAs<ossimImageHandler>( 0 );
      if ( ih.valid() )
      {
         ossimRefPtr<ossimProperty> prop = ih->getProperty("histogram_filename");
         if( prop.valid() )
         {
            ossimFilename inputHisto = ossimFilename(prop->valueToString());
            if( inputHisto.exists() )
            {
               setInputHistogram(inputHisto);
            }
         }
      }
   }
}


text:
/* ------------------------------------------------------------------
 * Copyright (C) 1998-2009 PacketVideo
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 * -------------------------------------------------------------------
 */
/*

 Pathname: e_ProgConfigConst.h

------------------------------------------------------------------------------
 REVISION HISTORY

 Who:                       Date:
 Description:

------------------------------------------------------------------------------
 INCLUDE DESCRIPTION

 enum for ProgConfig related constants

------------------------------------------------------------------------------
*/

/*----------------------------------------------------------------------------
; CONTINUE ONLY IF NOT ALREADY DEFINED
----------------------------------------------------------------------------*/
#ifndef E_PROG_CONFIG_CONST_H
#define E_PROG_CONFIG_CONST_H

/*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; MACROS
; Define module specific macros here
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; DEFINES
; Include all pre-processor statements here.
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; EXTERNAL VARIABLES REFERENCES
; Declare variables used in this module but defined elsewhere
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; SIMPLE TYPEDEF'S
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; ENUMERATED TYPEDEF'S
----------------------------------------------------------------------------*/
typedef enum
{
    /*
     * Program Configuration
     */
    Main_Profile    = 0,
    LC_Profile      = 1,

    Fs_48       = 3,
    Fs_44       = 4,
    Fs_32       = 5,

    LEN_PROFILE     = 2,
    LEN_SAMP_IDX    = 4,
    LEN_NUM_ELE     = 4,
    LEN_NUM_LFE     = 2,
    LEN_NUM_DAT     = 3,
    LEN_NUM_CCE     = 4,
    LEN_MIX_PRES    = 1,
    LEN_MMIX_IDX    = 2,
    LEN_PSUR_ENAB   = 1,
    LEN_ELE_IS_CPE  = 1,
    LEN_IND_SW_CCE  = 1,
    LEN_COMMENT_BYTES   = 8

} eProgConfigConst;

/*----------------------------------------------------------------------------
; STRUCTURES TYPEDEF'S
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; GLOBAL FUNCTION DEFINITIONS
; Function Prototype declaration
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; END
----------------------------------------------------------------------------*/
#endif


text:
package org.fcrepo.http.commons.api.rdf;

import javax.jcr.RepositoryException;
import javax.ws.rs.core.UriInfo;

import org.fcrepo.kernel.FedoraResource;
import org.fcrepo.kernel.rdf.GraphSubjects;

import com.hp.hpl.jena.rdf.model.Model;

/**
 * Helper to generate an RDF model for a FedoraResource that (likely) creates
 * relations from our resource to other HTTP components
 */
public interface UriAwareResourceModelFactory {

    /**
     * Given a resource, the UriInfo and a way to generate graph subjects,
     * create a model with triples to inject into an RDF response for the
     * resource (e.g. to add HATEOAS links)
     *
     * @param resource
     * @param uriInfo
     * @param graphSubjects
     * @return
     * @throws RepositoryException
     */
    Model createModelForResource(final FedoraResource resource,
            final UriInfo uriInfo, GraphSubjects graphSubjects)
        throws RepositoryException;
}


text:
#if NETCOREAPP3_1 || NETCOREAPP1_0 || NETCOREAPP2_0 || NET451 || NET5_0

namespace Audit.Mvc.UnitTest
{
    public class MockMethodInfo
    {
        public void Method1(string test1, AuditAttribute x, string extra)
        {

        }
        [AuditIgnore]
        public void Method1_Ignored(string test1, AuditAttribute x, string extra)
        {

        }

        public void Method1_IgnoredParam([AuditIgnore]string test1, AuditAttribute x, [AuditIgnore]string extra)
        {

        }
    }
}
#endif


text:
"""Handle the interface to GGRC models for all login methods.
"""

from ggrc import db
from ggrc.models.context import Context
from ggrc.models.person import Person
from ggrc.fulltext import get_indexer
from ggrc.fulltext.recordbuilder import fts_record_for
from ggrc.services.common import log_event

def _base_user_query():
  from sqlalchemy import orm
  return Person.query.options(
      orm.undefer_group('Person_complete'))

def find_user_by_id(id):
  """Find Person object by some ``id``.
  Note that ``id`` need not be Person().id, but should match the value
  returned by ``Person().get_id()``.
  """
  return _base_user_query().filter(Person.id==int(id)).first()

def find_user_by_email(email):
  return _base_user_query().filter(Person.email==email).first()

def create_user(email, **kwargs):
  user = Person(email=email, **kwargs)
  db.session.add(user)
  db.session.flush()
  log_event(db.session, user, user.id)
  user_context = Context(
      name='Personal Context for {0}'.format(email),
      description='',
      related_object=user,
      context_id=1,
      )
  db.session.add(user_context)
  db.session.commit()
  get_indexer().create_record(fts_record_for(user))
  return user

def find_or_create_user_by_email(email, **kwargs):
  user = find_user_by_email(email)
  if not user:
    user = create_user(email, **kwargs)
  return user

def get_next_url(request, default_url):
  if 'next' in request.args:
    next_url = request.args['next']
    return next_url
  else:
    return default_url


text:
using biz.dfch.CS.Appclusive.UI.Models;
using System;
using System.Collections.Generic;
using System.Data.Services.Client;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace biz.dfch.CS.Appclusive.UI.Controllers
{
    public abstract class GenericControllerBase<T, M, I> : ControllerBase
    {
        public GenericControllerBase() : base(typeof(I)) { }

        protected abstract DataServiceQuery<T> BaseQuery { get; }

        // GET: Endpoints
        public virtual ActionResult Index(int pageNr = 1, int skip = 0, string searchTerm = null, string orderBy = null, int d = 0)
        {
            return base.Index<T, M>(BaseQuery, pageNr, skip, searchTerm, orderBy, d);
        }

        public ActionResult Search(string term)
        {
            return base.Search(BaseQuery, term);
        }

        public ActionResult Select(string term)
        {
            return base.Select(BaseQuery, term);
        }

        //// GET: Endpoints/Details/5
        //public ActionResult Details(long id)
        //{
        //    try
        //    {
        //        var item = BaseQuery.Expand("CreatedBy").Expand("ModifiedBy").Where(c => c.Id == id).FirstOrDefault();
        //        return View(AutoMapper.Mapper.Map<M>(item));
        //    }
        //    catch (Exception ex)
        //    {
        //        ((List<AjaxNotificationViewModel>)ViewBag.Notifications).AddRange(ExceptionHelper.GetAjaxNotifications(ex));
        //        return View(new Models.Diagnostics.Endpoint());
        //    }
        //}
    }
}


text:
#include <setjmp.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>

#include "native_client/src/include/nacl_assert.h"

static jmp_buf g_jmp_buf;

static void return_from_signal_handler(int signo) {
  ASSERT_EQ(signo, SIGSEGV);
  longjmp(g_jmp_buf, 42);
}

int main(int argc, char *argv[]) {
  sighandler_t prev_handler = signal(SIGSEGV, SIG_IGN);
  ASSERT_EQ(prev_handler, SIG_DFL);

  prev_handler = signal(SIGSEGV, return_from_signal_handler);
  ASSERT_EQ(prev_handler, SIG_IGN);

  int rc = setjmp(g_jmp_buf);
  if (rc == 0) {
    /* Crash. */
    *(volatile int *) 0 = 0;
    _exit(1); /* Shouldn't reach here. */
  }

  ASSERT_EQ(rc, 42);
  puts("PASSED");
  return 0;
}


text:
<!DOCTYPE html>
<html lang="en">
  <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">

      <title>Decision Maker 3000</title>
      <!-- CSS -->

      <!-- Angular Material style sheet -->
      <link rel="stylesheet" href="./css/main.css">
      <link rel="stylesheet" href="./css/animate.css">

      <!-- Fonts -->
      <link href="https://fonts.googleapis.com/css?family=Raleway|Roboto:400,700" rel="stylesheet">
  </head>

  <body>
    <dram class="wrapper"></dram>

    <!-- 1. LOAD -->
    <script src="dist/polyfills.js"></script>
    <script src="dist/vendor.js"></script>
    <script src="dist/d3_bundle.js"></script>
    <script src="dist/app.js"></script>
  </body>
</html>


text:
module ActiveZuora
  module Generate

    # This is meant to be included onto an Invoice class.
    # Returns true/false on success.
    # Result hash is stored in #result.
    # If success, the id will be set in the object.
    # If failure, errors will be present on object.

    extend ActiveSupport::Concern

    included do
      include Base
      attr_accessor :result
    end

    def generate
      self.result = self.class.connection.request(:generate) do |soap|
        soap.body do |xml|
          build_xml(xml, soap,
            :namespace => soap.namespace,
            :element_name => :zObjects,
            :force_type => true)
        end
      end[:generate_response][:result]

      if result[:success]
        self.id = result[:id]
        self.status = 'Draft'
        clear_changed_attributes
        true
      else
        add_zuora_errors(result[:errors])
        false
      end
    end

    def generate!
      raise "Could not generate: #{errors.full_messages.join ', '}" unless generate
    end

  end
end


text:
class Level < ActiveRecord::Base
  acts_as_duplicable
  default_scope { order("level ASC") }

  include Rails.application.routes.url_helpers
  include ActivityObject

  attr_accessible :exp_threshold, :level

  belongs_to :course

  has_many :user_courses

  def get_title
    "Level #{level}"
  end

  def get_path
    course_levels_path(course)
  end

  def next_level
    course.levels.find_by_level(level + 1) || self
  end

  def satisfied?(user_course)
    #user_course.level only get the Level object, same type as self object
    user_course.level && user_course.level.level >= self.level
  end

  def title
    get_title
  end
end


text:
layout: post
theme: IBMPlexSerif
series:
  url: tensorflow2
  title: TensorFlow 2
title: "quickstart for beginners"
excerpt: "Start our journey with TensorFlow"
modified: 2020-03-18T11:51:25-04:00
categories: articles
tags: [TensorFlow, Deep Learning, Python]
image:
  vendor: gstatic
  feature: /prettyearth/assets/full/6311.jpg
  credit: Google Earth
  creditlink: https://earthview.withgoogle.com/nouadhibou-mauritania-6311
comments: true
share: true
mathjax: true
---

* TOC
{:toc}

This short introduction uses `Keras` to:

下面是一个完整的数字图片识别的程序

```python
import tensorflow as tf

mnist = tf.keras.datasets.mnist

(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0

print(x_test.shape)

model = tf.keras.models.Sequential([
  tf.keras.layers.Flatten(input_shape=(28, 28)),
  tf.keras.layers.Dense(128, activation='relu'),
  tf.keras.layers.Dropout(0.2),
  tf.keras.layers.Dense(10)
])

loss_fn = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True)

model.compile(optimizer='adam',
              loss=loss_fn,
              metrics=['accuracy'])
model.fit(x_train, y_train, epochs=5)

probability_model = tf.keras.Sequential([
  model,
  tf.keras.layers.Softmax()
])

probability_model(x_test[:5])
```

对我来说重点是理解 [The Sequential model](https://www.tensorflow.org/guide/keras/sequential_model) 是干什么的?

[layers.Dense]()

https://keras.io/zh/getting-started/sequential-model-guide/


text:
<!DOCTYPE html>

    <title>Meith - Team Grid Page</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" type="text/css" href="assets/css/style.css" />

          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#meith-navigation">

          </button>

            Meith
            Wave of Pixels

Home

Portfolio

Blog

              The Team

Grid Style

List Style

List Style With Departments

Road Map

              Shop

Style Grid

Style List

Single Product

Single Product Left Sidebar

Single Product Right Sidebar

Cart

Checkout

List Style Left Sidebar

List Style Right Sidebar

              Account

Login

Register

Recover Password

Favorite Products

Contact

        anteposuerit
        ullamcorper

Our Team

        blandit praesent

 div > .item > .contain-details">

Dean J. Nelson

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

<span class="fa fa-twitter"

Mary J. Bridges

Dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

<span class="fa fa-twitter"

James H. Gaarrett

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

<span class="fa fa-twitter"

Rosa P. Maynard

Psum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

<span class="fa fa-twitter"

Gregory M. Pappas

Psum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

<span class="fa fa-twitter"

Susan T. Estrada

Dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

<span class="fa fa-twitter"

Felix E. Watson

Dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

<span class="fa fa-twitter"

Nicole D. Riding

Psum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

<span class="fa fa-twitter"

Dean J. Nelson

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

<span class="fa fa-twitter"

Mary J. Bridges

Dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

<span class="fa fa-twitter"

James H. Gaarrett

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

<span class="fa fa-twitter"

Rosa P. Maynard

Psum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

<span class="fa fa-twitter"

Gregory M. Pappas

Psum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

<span class="fa fa-twitter"

Susan T. Estrada

Dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

<span class="fa fa-twitter"

Felix E. Watson

Dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

<span class="fa fa-twitter"

Nicole D. Riding

Psum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

<span class="fa fa-twitter"

Dean J. Nelson

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

<span class="fa fa-twitter"

Mary J. Bridges

Dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

<span class="fa fa-twitter"

James H. Gaarrett

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

<span class="fa fa-twitter"

Rosa P. Maynard

Psum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

<span class="fa fa-twitter"

    Meith
    website

    Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat,
    vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim
    qui blandit erdiet doming id quod mazim placerat facer possim assum.

  LEAR MORE

    Tags

Uumatis

Sollemnes

Commodo

Mutatione

Placat

Humani

Claritas

Anteposuerit

Consuetudium

Molest

    Recent Posts

Fusce gravida tortor felis, ac dictum risus sagittis

May 9, 2014

Fusce gravida tortor felis, ac dictum risus sagittis

May 15, 2014

Fusce gravida tortor felis, ac dictum risus sagittis

May 18, 2014

    NewsLetter

    Lorem ipsum dolor sit amet, sed diam nonummy nibh euismod tincidunt ut laore.

  <form action="send">
    <input type="email" class="form-control" placeholder="Enter your email adress">
    <button class="btn btn-primary col-sm-6 col-xs-12" type="button">Subscribe</button>

  </form>

Copyright © 2014 - Designed by EasyDevelopment


text:
package org.vaadin.presentation.views;

import com.vaadin.ui.*;
import com.vaadin.ui.themes.ValoTheme;
import backend.EmployeeService;
import model.Employee;
import org.vaadin.backend.domain.Gender;
import org.vaadin.viritin.fields.MTextField;
import org.vaadin.viritin.fields.TypedSelect;
import org.vaadin.viritin.form.AbstractForm;
import org.vaadin.viritin.label.Header;
import org.vaadin.viritin.layouts.MFormLayout;
import org.vaadin.viritin.layouts.MVerticalLayout;

import javax.annotation.PostConstruct;
import javax.ejb.EJBException;
import javax.inject.Inject;

/**
 * A UI component built to modify Employee entities. The used superclass
 * provides binding to the entity object and e.g. Save/Cancel buttons by
 * default. In larger apps, you'll most likely have your own customized super
 * class for your forms.
 * <p>
 * Note, that the advanced bean binding technology in Vaadin is able to take
 * advantage also from Bean Validation annotations that are used also by e.g.
 * JPA implementation. Check out annotations in Employee objects email field and
 * how they automatically reflect to the configuration of related fields in UI.
 * </p>
 */
public class EmployeeForm extends AbstractForm<Employee> {

    @Inject
    EmployeeService service;

    // Prepare some basic field components that our bound to entity property
    // by naming convetion, you can also use PropertyId annotation
    TextField firstName = new MTextField("First name").withFullWidth();
    TextField lastName = new MTextField("Last name").withFullWidth();
    DateField birthDate = new DateField("Birth day");

    OptionGroup gender = new OptionGroup("Gender");
    TextField email = new MTextField("Email").withFullWidth();

    @Override
    protected Component createContent() {

        setStyleName(ValoTheme.LAYOUT_CARD);

        return new MVerticalLayout(
                new Header("Edit customer").setHeaderLevel(3),
                new MFormLayout(
                        firstName,
                        lastName,
                        email,
                        birthDate,
                        gender
                ).withFullWidth(),
                getToolbar()
        ).withStyleName(ValoTheme.LAYOUT_CARD);
    }

    @PostConstruct
    void init() {
        setEagerValidation(true);

        gender.addItems((Object[]) Gender.values());
        gender.setStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
        setSavedHandler(new SavedHandler<Employee>() {

            @Override
            public void onSave(Employee entity) {
                try {
                    // make EJB call to save the entity
                    service.saveOrPersist(entity);
                    // fire save event to let other UI components know about
                    // the change
                    saveEvent.fire(entity);
                } catch (EJBException e) {
                    /*
                     * The Employee object uses optimitic locking with the
                     * version field. Notify user the editing didn't succeed.
                     */
                    Notification.show("The customer was concurrently edited "
                            + "by someone else. Your changes were discarded.",
                            Notification.Type.ERROR_MESSAGE);
                    refrehsEvent.fire(entity);
                }
            }
        });
        setResetHandler(new ResetHandler<Employee>() {

            @Override
            public void onReset(Employee entity) {
                refrehsEvent.fire(entity);
            }
        });
        setDeleteHandler(new DeleteHandler<Employee>() {
            @Override
            public void onDelete(Employee entity) {
                service.deleteEntity(getEntity());
                deleteEvent.fire(getEntity());
            }
        });
    }

    @Override
    protected void adjustResetButtonState() {
        // always enabled in this form
        getResetButton().setEnabled(true);
        getDeleteButton().setEnabled(getEntity() != null && getEntity().isPersisted());
    }

    /* "CDI interface" to notify decoupled components. Using traditional API to
     * other componets would probably be easier in small apps, but just
     * demonstrating here how all CDI stuff is available for Vaadin apps.
     */
    @Inject
    @EmployeeEvent(EmployeeEvent.Type.SAVE)
    javax.enterprise.event.Event<Employee> saveEvent;

    @Inject
    @EmployeeEvent(EmployeeEvent.Type.REFRESH)
    javax.enterprise.event.Event<Employee> refrehsEvent;

    @Inject
    @EmployeeEvent(EmployeeEvent.Type.DELETE)
    javax.enterprise.event.Event<Employee> deleteEvent;
}


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

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

/**
 *

 * Information about an invalid parameter.
 *

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

    /**
     *

     * The reason the parameter is invalid.
     *

     */
    private String problem;

    /**
     *

     * The reason the parameter is invalid.
     *

     *
     * @param problem
     *        The reason the parameter is invalid.
     * @see InvalidParameterProblem
     */

    public void setProblem(String problem) {
        this.problem = problem;
    }

    /**
     *

     * The reason the parameter is invalid.
     *

     *
     * @return The reason the parameter is invalid.
     * @see InvalidParameterProblem
     */

    public String getProblem() {
        return this.problem;
    }

    /**
     *

     * The reason the parameter is invalid.
     *

     *
     * @param problem
     *        The reason the parameter is invalid.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see InvalidParameterProblem
     */

    public InvalidParameterDetail withProblem(String problem) {
        setProblem(problem);
        return this;
    }

    /**
     *

     * The reason the parameter is invalid.
     *

     *
     * @param problem
     *        The reason the parameter is invalid.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see InvalidParameterProblem
     */

    public InvalidParameterDetail withProblem(InvalidParameterProblem problem) {
        this.problem = problem.toString();
        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 (getProblem() != null)
            sb.append("Problem: ").append(getProblem());
        sb.append("}");
        return sb.toString();
    }

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

        if (obj instanceof InvalidParameterDetail == false)
            return false;
        InvalidParameterDetail other = (InvalidParameterDetail) obj;
        if (other.getProblem() == null ^ this.getProblem() == null)
            return false;
        if (other.getProblem() != null && other.getProblem().equals(this.getProblem()) == false)
            return false;
        return true;
    }

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

        hashCode = prime * hashCode + ((getProblem() == null) ? 0 : getProblem().hashCode());
        return hashCode;
    }

    @Override
    public InvalidParameterDetail clone() {
        try {
            return (InvalidParameterDetail) 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.appconfigdata.model.transform.InvalidParameterDetailMarshaller.getInstance().marshall(this, protocolMarshaller);
    }
}


text:
def test_ifeq__parentheses__whitespaces_between_args_not_matter(shell):
    makefile =  """
    VAR = value

    target:
    	$(info VAR = [$(VAR)])
    ifeq ($(VAR)%(arg2)s)
    	@echo -n '[$(VAR)] == [value]'
    else
    	@echo -n '[$(VAR)] != [ value]'
    endif
    """

    # preferred, to be consistent with quoted edition and function calls
    shell.src('Makefile', makefile % {'arg2': ',value'})
    assert shell.run('make').out == 'VAR = [value]\n[value] == [value]'

    shell.src('Makefile', makefile % {'arg2': ' , value'})
    assert shell.run('make').out == 'VAR = [value]\n[value] == [value]'

def test_ifeq__quotes__whitespaces_in_quotes_matter(shell):
    makefile = """
    VAR = value

    target:
    	$(info VAR = [$(VAR)])
    ifeq '$(VAR)'%(arg2)s
    	@echo -n '[$(VAR)] == [value]'
    else
    	@echo -n '[$(VAR)] != [ value]'
    endif
    """

    # whitespaces outside of arguments do not matter
    shell.src('Makefile', makefile % {'arg2': "  'value'"})
    assert shell.run('make').out == 'VAR = [value]\n[value] == [value]'

    # whitespaces in arguemnts do matter
    shell.src('Makefile', makefile % {'arg2': "  ' value'"})
    assert shell.run('make').out == 'VAR = [value]\n[value] != [ value]'

def test_ifndef(shell):
    shell.src('Makefile', """
    ifndef WHO
    WHO = World
    endif

    target:
    	@echo -n 'Hello, $(WHO)!'
    """)

    assert shell.run('make').out == 'Hello, World!'
    assert shell.run('WHO=Make make').out == 'Hello, Make!'

def test_ifdef(shell):
    shell.src('Makefile', """
    ifndef WHO
    WHO = World
    endif

    target:
    ifdef DEBUG
    	@echo '[DEBUG] WHO = $(WHO)'
    endif
    	@echo -n 'Hello, $(WHO)!'
    """)

    assert shell.run('make').out == 'Hello, World!'
    assert shell.run('DEBUG=1 WHO=Make make').out == '[DEBUG] WHO = Make\nHello, Make!'


text:
'use strict';

// Users controller
angular.module('users').controller('UsersController', ['$scope', '$stateParams', '$location', 'Authentication', 'Users',
	function($scope, $stateParams, $location, Authentication, Users) {
		$scope.authentication = Authentication;

		// Create new User
		$scope.create = function() {
			// Create new User object
			var user = new Users ($scope.user);

			// Redirect after save
			user.$save(function(response) {
				$location.path('users/' + response._id);

				// Clear form fields
				$scope.user.firstName = '';
				$scope.user.lastName = '';
				$scope.user.displayName = '';
				$scope.user.email = '';
				$scope.user.username = '';
				$scope.user.password = '';
			}, function(errorResponse) {
				$scope.error = errorResponse.data.message;
			});
		};

		// Remove existing User
		$scope.remove = function(user) {
			if ( user ) {
				user.$remove();

				for (var i in $scope.users) {
					if ($scope.users [i] === user) {
						$scope.users.splice(i, 1);
					}
				}
			} else {
				$scope.user.$remove(function() {
					$location.path('users');
				});
			}
		};

		// Update existing User
		$scope.update = function() {
			var user = $scope.user;

			user.$update(function() {
				$location.path('users/' + user._id);
			}, function(errorResponse) {
				$scope.error = errorResponse.data.message;
			});
		};

		// Find a list of Users
		$scope.find = function() {
			$scope.users = Users.query();
		};

		// Find existing User
		$scope.findOne = function() {
			$scope.user = Users.get({
				userId: $stateParams.userId
			});
		};
	}
]);


text:
chsh -s bash vagrant

# This doesn't get created automatically for freebsd since virtualbox
# shared folders don't work.
ln -snf /tornado/maint/vm/freebsd /vagrant

PORTS="
lang/python27
devel/py-pip
devel/py-virtualenv
ftp/curl
"

PIP_PACKAGES="
futures
pycurl
tox
"

cd /usr/ports

for port in $PORTS; do
    make -C $port -DBATCH install
done

pip install $PIP_PACKAGES

/tornado/maint/vm/shared-setup.sh


text:
package com.ibm.wala.util.graph.traverse;

import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.Stack;

import com.ibm.wala.util.collections.EmptyIterator;
import com.ibm.wala.util.debug.UnimplementedError;
import com.ibm.wala.util.graph.Graph;

/**
 * This class implements depth-first search over a {@link Graph}, return an enumeration of the nodes of the graph in order of increasing
 * finishing time. This class follows the outNodes of the graph nodes to define the graph, but this behavior can be changed by
 * overriding the getConnected method.
 */
public abstract class DFSFinishTimeIterator<T> extends Stack<T> implements Iterator<T> {

  /**
   * the current next element in finishing time order
   */
  private T theNextElement;

  /**
   * an enumeration of all nodes to search from
   */
  private Iterator<? extends T> roots;

  /**
   * The governing graph.
   */
  private Graph<T> G;

  /**
   * Subclasses must call this in the constructor!
   *
   * @param G
   * @param nodes
   */
  protected void init(Graph<T> G, Iterator<? extends T> nodes) {
    this.G = G;
    roots = nodes;
    if (roots.hasNext())
      theNextElement = roots.next();
  }

  /**
   * Return whether there are any more nodes left to enumerate.
   *
   * @return true if there nodes left to enumerate.
   */
  @Override
  public boolean hasNext() {
    return (!empty() || (theNextElement != null && getPendingChildren(theNextElement) == null));
  }

  abstract Iterator<T> getPendingChildren(T n);

  abstract void setPendingChildren(T v, Iterator<T> iterator);

  /**
   * Find the next graph node in finishing time order.
   *
   * @return the next graph node in finishing time order.
   */
  @Override
  @SuppressWarnings("unchecked")
  public T next() throws NoSuchElementException {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    if (empty()) {
      T v = theNextElement;
      setPendingChildren(v, getConnected(v));
      push(v);
    }
    recurse: while (!empty()) {
      T v = peek();
      Iterator<? extends T> pc = getPendingChildren(v);
      for (Iterator<? extends T> e = pc; e.hasNext();) {
        T n = e.next();
        assert n != null : "null node in pc";
        Iterator<T> nChildren = getPendingChildren(n);
        if (nChildren == null) {
          // found a new child: recurse to it.
          setPendingChildren(n, getConnected(n));
          push(n);
          continue recurse;
        }
      }
      // the following saves space by allowing the original iterator to be GCed
      setPendingChildren(v, (Iterator<T>) EmptyIterator.instance());

      // no more children to visit: finished this vertex
      while (getPendingChildren(theNextElement) != null && roots.hasNext()) {
        theNextElement = roots.next();
      }

      return pop();
    }
    return null;
  }

  /**
   * get the out edges of a given node
   *
   * @param n the node of which to get the out edges
   * @return the out edges
   *
   */
  protected Iterator<T> getConnected(T n) {
    return G.getSuccNodes(n);
  }

  /**
   * @see java.util.Iterator#remove()
   */
  @Override
  public void remove() throws UnimplementedError {
    throw new UnimplementedError();
  }

}


text:
package org.elasticsearch.xpack.ml.datafeed;

import org.elasticsearch.action.ActionFuture;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.DocWriteRequest;
import org.elasticsearch.action.bulk.BulkAction;
import org.elasticsearch.action.bulk.BulkItemResponse;
import org.elasticsearch.action.bulk.BulkRequest;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.OriginSettingClient;
import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentElasticsearchExtension;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.mock.orig.Mockito;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.xpack.core.ClientHelper;
import org.elasticsearch.xpack.core.ml.action.FlushJobAction;
import org.elasticsearch.xpack.core.ml.action.PersistJobAction;
import org.elasticsearch.xpack.core.ml.action.PostDataAction;
import org.elasticsearch.xpack.core.ml.annotations.Annotation;
import org.elasticsearch.xpack.core.ml.annotations.AnnotationIndex;
import org.elasticsearch.xpack.core.ml.datafeed.extractor.DataExtractor;
import org.elasticsearch.xpack.core.ml.job.config.DataDescription;
import org.elasticsearch.xpack.core.ml.job.messages.Messages;
import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.DataCounts;
import org.elasticsearch.xpack.core.ml.job.results.Bucket;
import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
import org.elasticsearch.xpack.core.security.user.XPackUser;
import org.elasticsearch.xpack.ml.annotations.AnnotationPersister;
import org.elasticsearch.xpack.ml.datafeed.delayeddatacheck.DelayedDataDetector;
import org.elasticsearch.xpack.ml.datafeed.delayeddatacheck.DelayedDataDetectorFactory.BucketWithMissingData;
import org.elasticsearch.xpack.ml.datafeed.extractor.DataExtractorFactory;
import org.elasticsearch.xpack.ml.notifications.AnomalyDetectionAuditor;
import org.elasticsearch.xpack.ml.utils.persistence.ResultsPersisterService;
import org.elasticsearch.xpack.ml.utils.persistence.ResultsPersisterServiceTests;
import org.junit.Before;
import org.mockito.ArgumentCaptor;
import org.mockito.stubbing.Answer;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.function.Supplier;

import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyLong;
import static org.mockito.Matchers.eq;
import static org.mockito.Matchers.same;
import static org.mockito.Mockito.atMost;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

public class DatafeedJobTests extends ESTestCase {

    private static final String jobId = "_job_id";

    private AnomalyDetectionAuditor auditor;
    private DataExtractorFactory dataExtractorFactory;
    private DataExtractor dataExtractor;
    private DatafeedTimingStatsReporter timingStatsReporter;
    private Client client;
    private ResultsPersisterService resultsPersisterService;
    private DelayedDataDetector delayedDataDetector;
    private DataDescription.Builder dataDescription;
    private ActionFuture<PostDataAction.Response> postDataFuture;
    private ActionFuture<FlushJobAction.Response> flushJobFuture;
    private ArgumentCaptor<FlushJobAction.Request> flushJobRequests;
    private FlushJobAction.Response flushJobResponse;
    private String annotationDocId;

    private long currentTime;
    private XContentType xContentType;

    @Before
    @SuppressWarnings("unchecked")
    public void setup() throws Exception {
        auditor = mock(AnomalyDetectionAuditor.class);
        dataExtractorFactory = mock(DataExtractorFactory.class);
        dataExtractor = mock(DataExtractor.class);
        when(dataExtractorFactory.newExtractor(anyLong(), anyLong())).thenReturn(dataExtractor);
        timingStatsReporter = mock(DatafeedTimingStatsReporter.class);
        client = mock(Client.class);
        ThreadPool threadPool = mock(ThreadPool.class);
        when(client.threadPool()).thenReturn(threadPool);
        when(threadPool.getThreadContext()).thenReturn(new ThreadContext(Settings.EMPTY));
        resultsPersisterService =
            ResultsPersisterServiceTests.buildResultsPersisterService(new OriginSettingClient(client, ClientHelper.ML_ORIGIN));
        dataDescription = new DataDescription.Builder();
        dataDescription.setFormat(DataDescription.DataFormat.XCONTENT);
        postDataFuture = mock(ActionFuture.class);
        flushJobFuture = mock(ActionFuture.class);
        annotationDocId = "AnnotationDocId";
        flushJobResponse = new FlushJobAction.Response(true, new Date());
        delayedDataDetector = mock(DelayedDataDetector.class);
        when(delayedDataDetector.getWindow()).thenReturn(DatafeedJob.MISSING_DATA_CHECK_INTERVAL_MS);
        currentTime = 0;
        xContentType = XContentType.JSON;

        when(dataExtractor.hasNext()).thenReturn(true).thenReturn(false);
        byte[] contentBytes = "content".getBytes(StandardCharsets.UTF_8);
        InputStream inputStream = new ByteArrayInputStream(contentBytes);
        when(dataExtractor.next()).thenReturn(Optional.of(inputStream));
        DataCounts dataCounts = new DataCounts(jobId, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, new Date(0), new Date(0),
                new Date(0), new Date(0), new Date(0));

        PostDataAction.Request expectedRequest = new PostDataAction.Request(jobId);
        expectedRequest.setDataDescription(dataDescription.build());
        expectedRequest.setContent(new BytesArray(contentBytes), xContentType);
        when(client.execute(same(PostDataAction.INSTANCE), eq(expectedRequest))).thenReturn(postDataFuture);
        when(postDataFuture.actionGet()).thenReturn(new PostDataAction.Response(dataCounts));

        flushJobRequests = ArgumentCaptor.forClass(FlushJobAction.Request.class);
        when(flushJobFuture.actionGet()).thenReturn(flushJobResponse);
        when(client.execute(same(FlushJobAction.INSTANCE), flushJobRequests.capture())).thenReturn(flushJobFuture);

        doAnswer(withResponse(new BulkResponse(new BulkItemResponse[]{ bulkItemSuccess(annotationDocId) }, 0L)))
            .when(client).execute(eq(BulkAction.INSTANCE), any(), any());
    }

    public void testLookBackRunWithEndTime() throws Exception {
        DatafeedJob datafeedJob = createDatafeedJob(1000, 500, -1, -1, randomBoolean());
        assertNull(datafeedJob.runLookBack(0L, 1000L));

        verify(dataExtractorFactory).newExtractor(0L, 1000L);
        FlushJobAction.Request flushRequest = new FlushJobAction.Request(jobId);
        flushRequest.setCalcInterim(true);
        verify(client).execute(same(FlushJobAction.INSTANCE), eq(flushRequest));
        verify(client, never()).execute(same(PersistJobAction.INSTANCE), any());
    }

    public void testSetIsolated() throws Exception {
        currentTime = 2000L;
        DatafeedJob datafeedJob = createDatafeedJob(1000, 500, -1, -1, randomBoolean());
        datafeedJob.isolate();
        assertNull(datafeedJob.runLookBack(0L, null));

        verify(dataExtractorFactory).newExtractor(0L, 1500L);
        verify(client, never()).execute(same(FlushJobAction.INSTANCE), any());
        verify(client, never()).execute(same(PersistJobAction.INSTANCE), any());
    }

    public void testLookBackRunWithNoEndTime() throws Exception {
        currentTime = 2000L;
        long frequencyMs = 1000;
        long queryDelayMs = 500;
        DatafeedJob datafeedJob = createDatafeedJob(frequencyMs, queryDelayMs, -1, -1, randomBoolean());
        long next = datafeedJob.runLookBack(0L, null);
        assertEquals(2000 + frequencyMs + queryDelayMs + 100, next);

        verify(dataExtractorFactory).newExtractor(0L, 1500L);
        FlushJobAction.Request flushRequest = new FlushJobAction.Request(jobId);
        flushRequest.setCalcInterim(true);
        verify(client).execute(same(FlushJobAction.INSTANCE), eq(flushRequest));
        verify(client).execute(same(PersistJobAction.INSTANCE), eq(new PersistJobAction.Request(jobId)));
    }

    public void testLookBackRunWithStartTimeEarlierThanResumePoint() throws Exception {
        currentTime = 10000L;
        long latestFinalBucketEndTimeMs = -1;
        long latestRecordTimeMs = -1;
        if (randomBoolean()) {
            latestFinalBucketEndTimeMs = 5000;
        } else {
            latestRecordTimeMs = 5000;
        }

        long frequencyMs = 1000;
        long queryDelayMs = 500;
        DatafeedJob datafeedJob = createDatafeedJob(frequencyMs, queryDelayMs, latestFinalBucketEndTimeMs, latestRecordTimeMs, true);
        long next = datafeedJob.runLookBack(0L, null);
        assertEquals(10000 + frequencyMs + queryDelayMs + 100, next);

        verify(dataExtractorFactory).newExtractor(5000 + 1L, currentTime - queryDelayMs);
        assertThat(flushJobRequests.getAllValues().size(), equalTo(1));
        FlushJobAction.Request flushRequest = new FlushJobAction.Request(jobId);
        flushRequest.setCalcInterim(true);
        verify(client).execute(same(FlushJobAction.INSTANCE), eq(flushRequest));
        verify(client).execute(same(PersistJobAction.INSTANCE), eq(new PersistJobAction.Request(jobId)));
    }

    public void testContinueFromNow() throws Exception {
        // We need to return empty counts so that the lookback doesn't update the last end time
        when(postDataFuture.actionGet()).thenReturn(new PostDataAction.Response(new DataCounts(jobId)));

        currentTime = 9999L;
        long latestFinalBucketEndTimeMs = 5000;
        long latestRecordTimeMs = 5000;

        FlushJobAction.Response skipTimeResponse = new FlushJobAction.Response(true, new Date(10000L));
        when(flushJobFuture.actionGet()).thenReturn(skipTimeResponse);

        long frequencyMs = 1000;
        long queryDelayMs = 500;
        DatafeedJob datafeedJob = createDatafeedJob(frequencyMs, queryDelayMs, latestFinalBucketEndTimeMs, latestRecordTimeMs, true);
        datafeedJob.runLookBack(currentTime, null);

        // advance time
        currentTime = 12000L;

        expectThrows(DatafeedJob.EmptyDataCountException.class, () -> datafeedJob.runRealtime());

        verify(dataExtractorFactory, times(1)).newExtractor(10000L, 11000L);
        List<FlushJobAction.Request> capturedFlushJobRequests = flushJobRequests.getAllValues();
        assertThat(capturedFlushJobRequests.size(), equalTo(2));
        assertThat(capturedFlushJobRequests.get(0).getCalcInterim(), is(false));
        assertThat(capturedFlushJobRequests.get(0).getSkipTime(), equalTo("9999"));
        assertThat(capturedFlushJobRequests.get(1).getCalcInterim(), is(true));
        assertThat(capturedFlushJobRequests.get(1).getSkipTime(), is(nullValue()));
        assertThat(capturedFlushJobRequests.get(1).getAdvanceTime(), equalTo("11000"));
        Mockito.verifyNoMoreInteractions(dataExtractorFactory);
    }

    public void testRealtimeRun() throws Exception {
        flushJobResponse = new FlushJobAction.Response(true, new Date(2000));
        Bucket bucket = mock(Bucket.class);
        when(bucket.getTimestamp()).thenReturn(new Date(2000));
        when(bucket.getEpoch()).thenReturn(2L);
        when(bucket.getBucketSpan()).thenReturn(4L);
        when(flushJobFuture.actionGet()).thenReturn(flushJobResponse);
        when(client.execute(same(FlushJobAction.INSTANCE), flushJobRequests.capture())).thenReturn(flushJobFuture);
        when(delayedDataDetector.detectMissingData(2000))
            .thenReturn(Collections.singletonList(BucketWithMissingData.fromMissingAndBucket(10, bucket)));
        currentTime = 60000L;
        long frequencyMs = 100;
        long queryDelayMs = 1000;
        DatafeedJob datafeedJob = createDatafeedJob(frequencyMs, queryDelayMs, 1000, -1, false);
        long next = datafeedJob.runRealtime();
        assertEquals(currentTime + frequencyMs + 100, next);

        verify(dataExtractorFactory).newExtractor(1000L + 1L, currentTime - queryDelayMs);
        FlushJobAction.Request flushRequest = new FlushJobAction.Request(jobId);
        flushRequest.setCalcInterim(true);
        flushRequest.setAdvanceTime("59000");
        verify(client).execute(same(FlushJobAction.INSTANCE), eq(flushRequest));
        verify(client, never()).execute(same(PersistJobAction.INSTANCE), any());

        // Execute a second valid time, but do so in a smaller window than the interval
        currentTime = 62000L;
        byte[] contentBytes = "content".getBytes(StandardCharsets.UTF_8);
        InputStream inputStream = new ByteArrayInputStream(contentBytes);
        when(dataExtractor.hasNext()).thenReturn(true).thenReturn(false);
        when(dataExtractor.next()).thenReturn(Optional.of(inputStream));
        when(dataExtractorFactory.newExtractor(anyLong(), anyLong())).thenReturn(dataExtractor);
        datafeedJob.runRealtime();

        // Execute a third time, but this time make sure we exceed the data check interval, but keep the delayedDataDetector response
        // the same
        currentTime = 62000L + DatafeedJob.MISSING_DATA_CHECK_INTERVAL_MS + 1;
        inputStream = new ByteArrayInputStream(contentBytes);
        when(dataExtractor.hasNext()).thenReturn(true).thenReturn(false);
        when(dataExtractor.next()).thenReturn(Optional.of(inputStream));
        when(dataExtractorFactory.newExtractor(anyLong(), anyLong())).thenReturn(dataExtractor);
        datafeedJob.runRealtime();

        String msg = Messages.getMessage(Messages.JOB_AUDIT_DATAFEED_MISSING_DATA,
            10,
            XContentElasticsearchExtension.DEFAULT_DATE_PRINTER.print(2000));

        long annotationCreateTime = currentTime;
        {  // What we expect the created annotation to be indexed as
            Annotation expectedAnnotation = new Annotation.Builder()
                .setAnnotation(msg)
                .setCreateTime(new Date(annotationCreateTime))
                .setCreateUsername(XPackUser.NAME)
                .setTimestamp(bucket.getTimestamp())
                .setEndTimestamp(new Date((bucket.getEpoch() + bucket.getBucketSpan()) * 1000))
                .setJobId(jobId)
                .setModifiedTime(new Date(annotationCreateTime))
                .setModifiedUsername(XPackUser.NAME)
                .setType(Annotation.Type.ANNOTATION)
                .setEvent(Annotation.Event.DELAYED_DATA)
                .build();
            BytesReference expectedSource =
                BytesReference.bytes(expectedAnnotation.toXContent(XContentFactory.jsonBuilder(), ToXContent.EMPTY_PARAMS));

            ArgumentCaptor<BulkRequest> bulkRequestArgumentCaptor = ArgumentCaptor.forClass(BulkRequest.class);
            verify(client, atMost(2)).execute(eq(BulkAction.INSTANCE), bulkRequestArgumentCaptor.capture(), any());
            BulkRequest bulkRequest = bulkRequestArgumentCaptor.getValue();
            assertThat(bulkRequest.requests(), hasSize(1));
            IndexRequest indexRequest = (IndexRequest) bulkRequest.requests().get(0);
            assertThat(indexRequest.index(), equalTo(AnnotationIndex.WRITE_ALIAS_NAME));
            assertThat(indexRequest.id(), nullValue());
            assertThat(indexRequest.source(), equalTo(expectedSource));
            assertThat(indexRequest.opType(), equalTo(DocWriteRequest.OpType.INDEX));
        }

        // Execute a fourth time, this time we return a new delayedDataDetector response to verify annotation gets updated
        Bucket bucket2 = mock(Bucket.class);
        when(bucket2.getTimestamp()).thenReturn(new Date(6000));
        when(bucket2.getEpoch()).thenReturn(6L);
        when(bucket2.getBucketSpan()).thenReturn(4L);
        when(delayedDataDetector.detectMissingData(2000))
            .thenReturn(Arrays.asList(BucketWithMissingData.fromMissingAndBucket(10, bucket),
                BucketWithMissingData.fromMissingAndBucket(5, bucket2)));
        currentTime = currentTime + DatafeedJob.MISSING_DATA_CHECK_INTERVAL_MS + 1;
        inputStream = new ByteArrayInputStream(contentBytes);
        when(dataExtractor.hasNext()).thenReturn(true).thenReturn(false);
        when(dataExtractor.next()).thenReturn(Optional.of(inputStream));
        when(dataExtractorFactory.newExtractor(anyLong(), anyLong())).thenReturn(dataExtractor);
        datafeedJob.runRealtime();

        msg = Messages.getMessage(Messages.JOB_AUDIT_DATAFEED_MISSING_DATA,
            15,
            XContentElasticsearchExtension.DEFAULT_DATE_PRINTER.print(6000));

        long annotationUpdateTime = currentTime;
        {  // What we expect the updated annotation to be indexed as
            Annotation expectedUpdatedAnnotation = new Annotation.Builder()
                .setAnnotation(msg)
                .setCreateTime(new Date(annotationCreateTime))
                .setCreateUsername(XPackUser.NAME)
                .setTimestamp(bucket.getTimestamp())
                .setEndTimestamp(new Date((bucket2.getEpoch() + bucket2.getBucketSpan()) * 1000))
                .setJobId(jobId)
                .setModifiedTime(new Date(annotationUpdateTime))
                .setModifiedUsername(XPackUser.NAME)
                .setType(Annotation.Type.ANNOTATION)
                .setEvent(Annotation.Event.DELAYED_DATA)
                .build();
            BytesReference expectedSource =
                BytesReference.bytes(expectedUpdatedAnnotation.toXContent(XContentFactory.jsonBuilder(), ToXContent.EMPTY_PARAMS));

            ArgumentCaptor<BulkRequest> bulkRequestArgumentCaptor = ArgumentCaptor.forClass(BulkRequest.class);
            verify(client, atMost(2)).execute(eq(BulkAction.INSTANCE), bulkRequestArgumentCaptor.capture(), any());
            BulkRequest bulkRequest = bulkRequestArgumentCaptor.getValue();
            assertThat(bulkRequest.requests(), hasSize(1));
            IndexRequest indexRequest = (IndexRequest) bulkRequest.requests().get(0);
            assertThat(indexRequest.index(), equalTo(AnnotationIndex.WRITE_ALIAS_NAME));
            assertThat(indexRequest.id(), equalTo(annotationDocId));
            assertThat(indexRequest.source(), equalTo(expectedSource));
            assertThat(indexRequest.opType(), equalTo(DocWriteRequest.OpType.INDEX));
        }

        // Execute a fifth time, no changes should occur as annotation is the same
        currentTime = currentTime + DatafeedJob.MISSING_DATA_CHECK_INTERVAL_MS + 1;
        inputStream = new ByteArrayInputStream(contentBytes);
        when(dataExtractor.hasNext()).thenReturn(true).thenReturn(false);
        when(dataExtractor.next()).thenReturn(Optional.of(inputStream));
        when(dataExtractorFactory.newExtractor(anyLong(), anyLong())).thenReturn(dataExtractor);
        datafeedJob.runRealtime();

        // We should not get 3 index requests for the annotations
        verify(client, atMost(2)).index(any());
    }

    public void testEmptyDataCountGivenlookback() throws Exception {
        when(dataExtractor.hasNext()).thenReturn(false);

        DatafeedJob datafeedJob = createDatafeedJob(1000, 500, -1, -1, false);
        expectThrows(DatafeedJob.EmptyDataCountException.class, () -> datafeedJob.runLookBack(0L, 1000L));
        verify(client, times(1)).execute(same(FlushJobAction.INSTANCE), any());
        verify(client, never()).execute(same(PersistJobAction.INSTANCE), any());
        assertThat(flushJobRequests.getValue().getAdvanceTime(), is(nullValue()));
    }

    public void testExtractionProblem() throws Exception {
        when(dataExtractor.hasNext()).thenReturn(true);
        when(dataExtractor.next()).thenThrow(new IOException());

        DatafeedJob datafeedJob = createDatafeedJob(1000, 500, -1, -1, randomBoolean());
        expectThrows(DatafeedJob.ExtractionProblemException.class, () -> datafeedJob.runLookBack(0L, 1000L));

        currentTime = 3001;
        expectThrows(DatafeedJob.ExtractionProblemException.class, datafeedJob::runRealtime);

        ArgumentCaptor<Long> startTimeCaptor = ArgumentCaptor.forClass(Long.class);
        ArgumentCaptor<Long> endTimeCaptor = ArgumentCaptor.forClass(Long.class);
        verify(dataExtractorFactory, times(2)).newExtractor(startTimeCaptor.capture(), endTimeCaptor.capture());
        assertEquals(0L, startTimeCaptor.getAllValues().get(0).longValue());
        assertEquals(0L, startTimeCaptor.getAllValues().get(1).longValue());
        assertEquals(1000L, endTimeCaptor.getAllValues().get(0).longValue());
        assertEquals(2000L, endTimeCaptor.getAllValues().get(1).longValue());
        assertThat(flushJobRequests.getAllValues().isEmpty(), is(true));
        verify(client, never()).execute(same(PersistJobAction.INSTANCE), any());
    }

    public void testPostAnalysisProblem() {
        client = mock(Client.class);
        ThreadPool threadPool = mock(ThreadPool.class);
        when(client.threadPool()).thenReturn(threadPool);
        when(threadPool.getThreadContext()).thenReturn(new ThreadContext(Settings.EMPTY));
        when(client.execute(same(FlushJobAction.INSTANCE), any())).thenReturn(flushJobFuture);
        when(client.execute(same(PostDataAction.INSTANCE), any())).thenThrow(new RuntimeException());

        when(dataExtractor.getEndTime()).thenReturn(1000L);

        DatafeedJob datafeedJob = createDatafeedJob(1000, 500, -1, -1, randomBoolean());
        DatafeedJob.AnalysisProblemException analysisProblemException =
                expectThrows(DatafeedJob.AnalysisProblemException.class, () -> datafeedJob.runLookBack(0L, 1000L));
        assertThat(analysisProblemException.shouldStop, is(false));

        currentTime = 3001;
        expectThrows(DatafeedJob.EmptyDataCountException.class, datafeedJob::runRealtime);

        ArgumentCaptor<Long> startTimeCaptor = ArgumentCaptor.forClass(Long.class);
        ArgumentCaptor<Long> endTimeCaptor = ArgumentCaptor.forClass(Long.class);
        verify(dataExtractorFactory, times(2)).newExtractor(startTimeCaptor.capture(), endTimeCaptor.capture());
        assertEquals(0L, startTimeCaptor.getAllValues().get(0).longValue());
        assertEquals(1000L, startTimeCaptor.getAllValues().get(1).longValue());
        assertEquals(1000L, endTimeCaptor.getAllValues().get(0).longValue());
        assertEquals(2000L, endTimeCaptor.getAllValues().get(1).longValue());
        verify(client, times(1)).execute(same(FlushJobAction.INSTANCE), any());
        verify(client, never()).execute(same(PersistJobAction.INSTANCE), any());
    }

    public void testPostAnalysisProblemIsConflict() {
        client = mock(Client.class);
        ThreadPool threadPool = mock(ThreadPool.class);
        when(client.threadPool()).thenReturn(threadPool);
        when(threadPool.getThreadContext()).thenReturn(new ThreadContext(Settings.EMPTY));
        when(client.execute(same(FlushJobAction.INSTANCE), any())).thenReturn(flushJobFuture);
        when(client.execute(same(PostDataAction.INSTANCE), any())).thenThrow(ExceptionsHelper.conflictStatusException("conflict"));

        when(dataExtractor.getEndTime()).thenReturn(1000L);

        DatafeedJob datafeedJob = createDatafeedJob(1000, 500, -1, -1, randomBoolean());
        DatafeedJob.AnalysisProblemException analysisProblemException =
                expectThrows(DatafeedJob.AnalysisProblemException.class, () -> datafeedJob.runLookBack(0L, 1000L));
        assertThat(analysisProblemException.shouldStop, is(true));

        currentTime = 3001;
        expectThrows(DatafeedJob.EmptyDataCountException.class, datafeedJob::runRealtime);

        ArgumentCaptor<Long> startTimeCaptor = ArgumentCaptor.forClass(Long.class);
        ArgumentCaptor<Long> endTimeCaptor = ArgumentCaptor.forClass(Long.class);
        verify(dataExtractorFactory, times(2)).newExtractor(startTimeCaptor.capture(), endTimeCaptor.capture());
        assertEquals(0L, startTimeCaptor.getAllValues().get(0).longValue());
        assertEquals(1000L, startTimeCaptor.getAllValues().get(1).longValue());
        assertEquals(1000L, endTimeCaptor.getAllValues().get(0).longValue());
        assertEquals(2000L, endTimeCaptor.getAllValues().get(1).longValue());
        verify(client, times(1)).execute(same(FlushJobAction.INSTANCE), any());
        verify(client, never()).execute(same(PersistJobAction.INSTANCE), any());
    }

    public void testFlushAnalysisProblem() {
        when(client.execute(same(FlushJobAction.INSTANCE), any())).thenThrow(new RuntimeException());

        currentTime = 60000L;
        long frequencyMs = 100;
        long queryDelayMs = 1000;
        DatafeedJob datafeedJob = createDatafeedJob(frequencyMs, queryDelayMs, 1000, -1, randomBoolean());
        DatafeedJob.AnalysisProblemException analysisProblemException =
                expectThrows(DatafeedJob.AnalysisProblemException.class, () -> datafeedJob.runRealtime());
        assertThat(analysisProblemException.shouldStop, is(false));
    }

    public void testFlushAnalysisProblemIsConflict() {
        when(client.execute(same(FlushJobAction.INSTANCE), any())).thenThrow(ExceptionsHelper.conflictStatusException("conflict"));

        currentTime = 60000L;
        long frequencyMs = 100;
        long queryDelayMs = 1000;
        DatafeedJob datafeedJob = createDatafeedJob(frequencyMs, queryDelayMs, 1000, -1, randomBoolean());
        DatafeedJob.AnalysisProblemException analysisProblemException =
                expectThrows(DatafeedJob.AnalysisProblemException.class, () -> datafeedJob.runRealtime());
        assertThat(analysisProblemException.shouldStop, is(true));
    }

    private DatafeedJob createDatafeedJob(long frequencyMs, long queryDelayMs, long latestFinalBucketEndTimeMs,
                                          long latestRecordTimeMs, boolean haveSeenDataPreviously) {
        Supplier<Long> currentTimeSupplier = () -> currentTime;
        return new DatafeedJob(jobId, dataDescription.build(), frequencyMs, queryDelayMs, dataExtractorFactory, timingStatsReporter,
            client, auditor, new AnnotationPersister(resultsPersisterService, auditor), currentTimeSupplier,
            delayedDataDetector, null, latestFinalBucketEndTimeMs, latestRecordTimeMs, haveSeenDataPreviously);
    }

    @SuppressWarnings("unchecked")
    private static <Response> Answer<Response> withResponse(Response response) {
        return invocationOnMock -> {
            ActionListener<Response> listener = (ActionListener<Response>) invocationOnMock.getArguments()[2];
            listener.onResponse(response);
            return null;
        };
    }

    private static BulkItemResponse bulkItemSuccess(String docId) {
        return new BulkItemResponse(
            1,
            DocWriteRequest.OpType.INDEX,
            new IndexResponse(new ShardId(AnnotationIndex.WRITE_ALIAS_NAME, "uuid", 1), docId, 0, 0, 1, true));
    }
}


text:
package executor

import (
	// load the packages
	_ "github.com/codedellemc/rexray/libstorage/drivers/os/linux"
)


text:
package com.refinedmods.refinedstorage.network.craftingmonitor;

import com.refinedmods.refinedstorage.container.CraftingMonitorContainerMenu;
import com.refinedmods.refinedstorage.blockentity.craftingmonitor.WirelessCraftingMonitor;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer;
import net.minecraftforge.network.NetworkEvent;

import java.util.Optional;
import java.util.UUID;
import java.util.function.Supplier;

public class WirelessCraftingMonitorSettingsUpdateMessage {
    private final Optional<UUID> tabSelected;
    private final int tabPage;

    public WirelessCraftingMonitorSettingsUpdateMessage(Optional<UUID> tabSelected, int tabPage) {
        this.tabSelected = tabSelected;
        this.tabPage = tabPage;
    }

    public static WirelessCraftingMonitorSettingsUpdateMessage decode(FriendlyByteBuf buf) {
        Optional<UUID> tabSelected = Optional.empty();

        if (buf.readBoolean()) {
            tabSelected = Optional.of(buf.readUUID());
        }

        int tabPage = buf.readInt();

        return new WirelessCraftingMonitorSettingsUpdateMessage(tabSelected, tabPage);
    }

    public static void encode(WirelessCraftingMonitorSettingsUpdateMessage message, FriendlyByteBuf buf) {
        buf.writeBoolean(message.tabSelected.isPresent());

        message.tabSelected.ifPresent(buf::writeUUID);

        buf.writeInt(message.tabPage);
    }

    public static void handle(WirelessCraftingMonitorSettingsUpdateMessage message, Supplier<NetworkEvent.Context> ctx) {
        ServerPlayer player = ctx.get().getSender();

        if (player != null) {
            ctx.get().enqueueWork(() -> {
                if (player.containerMenu instanceof CraftingMonitorContainerMenu) {
                    ((WirelessCraftingMonitor) ((CraftingMonitorContainerMenu) player.containerMenu).getCraftingMonitor()).setSettings(message.tabSelected, message.tabPage);
                }
            });
        }

        ctx.get().setPacketHandled(true);
    }
}


text:
/**
 * Subsets II
 *
 * Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set).
 *
 * Note: The solution set must not contain duplicate subsets.
 *
 * For example,
 * If nums = [1,2,2], a solution is:
 *
 * [
 *   [2],
 *   [1],
 *   [1,2,2],
 *   [2,2],
 *   [1,2],
 *   []
 * ]
 */

/**
 * @param {number[]} nums
 * @return {number[][]}
 */
const subsetsWithDup = nums => {
  const results = [];
  nums.sort((a, b) => a - b);
  backtracking(nums, 0, [], results);
  return results;
};

const backtracking = (nums, start, solution, results) => {
  results.push(solution.slice());

  for (let i = start; i < nums.length; i++) {
    if (i > start && nums[i] === nums[i - 1]) {
      continue; // avoid duplicates
    }

    solution.push(nums[i]);
    backtracking(nums, i + 1, solution, results);
    solution.pop();
  }
};

export default subsetsWithDup;


text:
<!DOCTYPE html>

    <link rel="shortcut icon" href="imgs/favicon_green.ico" >
    <title>cgardens: DBC App</title>
    <link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" />

home

about

projects

resume

blog

contact

programmer of things to come.

DBC App

          I am enrolled in the DBC Cohort that began Phase 0 On October 6th. We begin On-Site on December 8th! Throughout the course I will keeping a blog that will include tutorials, updates on what we've learned, and posts about how DBC is going.

          As my final project for DBC, I will be working with a team to develop a new app. I will be posting updates about the app and its release on this page.

          Make sure to check back soon!

home

about

projects

resume

blog

contact

      © cgardens 2014

      cgardens.dev@gmail.com


text:
'use strict';

Object.defineProperty(exports, '__esModule', {
  value: true
});
exports.default = jestExpect;

var _expect = _interopRequireDefault(require('expect'));

var _jestSnapshot = require('jest-snapshot');

function _interopRequireDefault(obj) {
  return obj && obj.__esModule ? obj : {default: obj};
}

function jestExpect(config) {
  _expect.default.setState({
    expand: config.expand
  });

  _expect.default.extend({
    toMatchInlineSnapshot: _jestSnapshot.toMatchInlineSnapshot,
    toMatchSnapshot: _jestSnapshot.toMatchSnapshot,
    toThrowErrorMatchingInlineSnapshot:
      _jestSnapshot.toThrowErrorMatchingInlineSnapshot,
    toThrowErrorMatchingSnapshot: _jestSnapshot.toThrowErrorMatchingSnapshot
  });

  _expect.default.addSnapshotSerializer = _jestSnapshot.addSerializer;
  return _expect.default;
}


text: angular.module('providers', ['core']);