text:
package com.google.common.collect;

import static java.util.Arrays.asList;
import static java.util.Comparator.comparing;

import com.google.common.collect.testing.Helpers;
import com.google.common.testing.CollectorTester;
import com.google.common.testing.EqualsTester;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Optional;
import junit.framework.TestCase;

/**
 * Tests for {@code Comparators}.
 *
 * @author Louis Wasserman
 */
public class ComparatorsTest extends TestCase {
  @SuppressWarnings("unchecked") // dang varargs
  public void testLexicographical() {
    Comparator<String> comparator = Ordering.natural();
    Comparator<Iterable<String>> lexy = Comparators.lexicographical(comparator);

    ImmutableList<String> empty = ImmutableList.of();
    ImmutableList<String> a = ImmutableList.of("a");
    ImmutableList<String> aa = ImmutableList.of("a", "a");
    ImmutableList<String> ab = ImmutableList.of("a", "b");
    ImmutableList<String> b = ImmutableList.of("b");

    Helpers.testComparator(lexy, empty, a, aa, ab, b);

    new EqualsTester()
        .addEqualityGroup(lexy, Comparators.lexicographical(comparator))
        .addEqualityGroup(Comparators.lexicographical(String.CASE_INSENSITIVE_ORDER))
        .addEqualityGroup(Ordering.natural())
        .testEquals();
  }

  public void testIsInOrder() {
    assertFalse(Comparators.isInOrder(asList(5, 3, 0, 9), Ordering.natural()));
    assertFalse(Comparators.isInOrder(asList(0, 5, 3, 9), Ordering.natural()));
    assertTrue(Comparators.isInOrder(asList(0, 3, 5, 9), Ordering.natural()));
    assertTrue(Comparators.isInOrder(asList(0, 0, 3, 3), Ordering.natural()));
    assertTrue(Comparators.isInOrder(asList(0, 3), Ordering.natural()));
    assertTrue(Comparators.isInOrder(Collections.singleton(1), Ordering.natural()));
    assertTrue(Comparators.isInOrder(Collections.<Integer>emptyList(), Ordering.natural()));
  }

  public void testIsInStrictOrder() {
    assertFalse(Comparators.isInStrictOrder(asList(5, 3, 0, 9), Ordering.natural()));
    assertFalse(Comparators.isInStrictOrder(asList(0, 5, 3, 9), Ordering.natural()));
    assertTrue(Comparators.isInStrictOrder(asList(0, 3, 5, 9), Ordering.natural()));
    assertFalse(Comparators.isInStrictOrder(asList(0, 0, 3, 3), Ordering.natural()));
    assertTrue(Comparators.isInStrictOrder(asList(0, 3), Ordering.natural()));
    assertTrue(Comparators.isInStrictOrder(Collections.singleton(1), Ordering.natural()));
    assertTrue(Comparators.isInStrictOrder(Collections.<Integer>emptyList(), Ordering.natural()));
  }

  public void testLeastCollector() {
    CollectorTester.of(Comparators.<Integer>least(2, Comparator.naturalOrder()))
        .expectCollects(Arrays.asList(1, 2), 1, 2, 3, 4, 5, 6)
        .expectCollects(Arrays.asList(1), 1)
        .expectCollects(Collections.emptyList());
  }

  public void testGreatestCollector() {
    CollectorTester.of(Comparators.<Integer>greatest(2, Comparator.naturalOrder()))
        .expectCollects(Arrays.asList(6, 5), 1, 2, 3, 4, 5, 6)
        .expectCollects(Arrays.asList(1), 1)
        .expectCollects(Collections.emptyList());
  }

  public void testEmptiesFirst() {
    Optional<String> empty = Optional.empty();
    Optional<String> abc = Optional.of("abc");
    Optional<String> z = Optional.of("z");

    Comparator<Optional<String>> comparator = Comparators.emptiesFirst(comparing(String::length));
    Helpers.testComparator(comparator, empty, z, abc);
  }
}


text:
# vim-svelte-plugin [![Build Status][12]](https://travis-ci.com/leafOfTree/vim-svelte-plugin)

Vim syntax and indent plugin for `.svelte` files. Forked from [vim-vue-plugin][3].

## Installation

How to install

- [VundleVim][2]

        Plugin 'leafOfTree/vim-svelte-plugin'

- [vim-pathogen][5]

        cd ~/.vim/bundle && \
        git clone https://github.com/leafOfTree/vim-svelte-plugin --depth 1

- [vim-plug][7]

        Plug 'leafOfTree/vim-svelte-plugin'
        :PlugInstall

- Or manually, clone this plugin to `path/to/this_plugin`, and add it to `rtp` in vimrc

        set rtp+=path/to/this_plugin

This plugin works if it has set `filetype` to `svelte`. Please stay up to date. Feel free to open an issue or pull request.

## How it works

It combines HTML, CSS and JavaScript syntax and indent in one file.

Supports

- Svelte directives.
- Less/Sass/Scss, Pug with [vim-pug][4], Coffee with [vim-coffee-script][6], TypeScript with [typescript-vim][14] or [yats.vim][15].^

    Relative plugins need to be installed.

- A builtin `foldexpr` foldmethod.^
- [emmet-vim][10] HTML/CSS/JavaScript filetype detection.

^: see Configuration for details.

## Configuration

Set global variable to `1` to enable or `0` to disable. Ex:

    let g:vim_svelte_plugin_load_full_syntax = 1

| variable                              | description                                                                                | default                    |
|---------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|----------------------------|
| `g:vim_svelte_plugin_load_full_syntax`\* | Enable: load all syntax files in `runtimepath` to enable related syntax plugins.
 Disable: only in `$VIMRUNTIME/syntax`, `~/.vim/syntax` and `$VIM/vimfiles/syntax` | 0 |
| `g:vim_svelte_plugin_use_pug`\*             | Enable pug syntax for `<template lang="pug">`.                                                         | 0 |
| `g:vim_svelte_plugin_use_coffee`            | Enable coffee syntax for `<script lang="coffee">`.                                                     | 0 |
| `g:vim_svelte_plugin_use_typescript`        | Enable typescript syntax for `<script lang="ts">`.                                                     | 0 |
| `g:vim_svelte_plugin_use_less`              | Enable less syntax for `<style lang="less">`.                                                          | 0 |
| `g:vim_svelte_plugin_use_sass`              | Enable scss syntax for `<style lang="scss">`(or sass for `lang="sass"`).                               | 0 |
| `g:vim_svelte_plugin_has_init_indent`       | Initially indent one tab inside `style/script` tags.                                                   | 1 |
| `g:vim_svelte_plugin_use_foldexpr`          | Enable builtin `foldexpr` foldmethod.                                                                  | 0 |
| `g:vim_svelte_plugin_debug`                 | Echo debug messages in `messages` list. Useful to debug if unexpected indents occur.                   | 0 |

\*: Vim may be slow if the feature is enabled. Find a balance between syntax highlight and speed. By the way, custom syntax can be added in `~/.vim/syntax` or `$VIM/vimfiles/syntax`.

**Note**

- `filetype` is set to `svelte` so autocmds and other custom settings for `javascript` have to be manually enabled for `svelte`.
- `g:vim_svelte_plugin_load_full_syntax` applies to `HTML/Sass/Less`.
- See <https://svelte.dev/docs#svelte_preprocess> for how to use `Less/Sass/Pug`... in svelte.

## Context based behavior

As there are more than one language in `.svelte` file, the different behaviors like mapping, completion, and local options may be expected according to tags or subtypes(current language type).

This plugin provides functions to get the tag/subtype where the cursor is in.

- `GetSvelteTag() => String` Return value is one of `'template', 'script', 'style'`.

  ```vim
  " Example
  autocmd FileType svelte inoremap <buffer><expr> : InsertColon()

  function! InsertColon()
    let tag = GetSvelteTag()
    return tag == 'template' ? ':' : ': '
  endfunction
  ```

- `GetSvelteSubtype() => String` Return value is one of `'html', 'javascript', 'css', 'scss', ...`.

- `OnChangeSvelteSubtype(subtype)` An event listener that is called when subtype changes.

    You can also define an event listener function `OnChangeSvelteSubtype(subtype)` in your `vimrc` to get the subtype and set its local options whenever it changes.

    ```vim
    " Example: set local options based on subtype
    function! OnChangeSvelteSubtype(subtype)
      echom 'Subtype is '.a:subtype
      if empty(a:subtype) || a:subtype == 'html'
        setlocal commentstring=<!--%s-->
        setlocal comments=s:<!--,m:\ \ \ \ ,e:-->
      elseif a:subtype =~ 'css'
        setlocal comments=s1:/*,mb:*,ex:*/ commentstring&
      else
        setlocal commentstring=//%s
        setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
      endif
    endfunction
    ```

### emmet-vim

Currently emmet-vim works regarding your HTML/CSS/JavaScript emmet settings, but it depends on how emmet-vim gets `filetype` and may change in the future. Feel free to report an issue if any problem appears.

## Avoid overload

Since there are many sub languages included, most delays come from syntax files overload. A variable named `b:current_loading_main_syntax` is set to `svelte` which can be used as loading condition if you'd like to manually find and modify the syntax files causing overload.

For example, the builtin syntax `sass.vim` and `less.vim` in vim8.1 runtime always load `css.vim` which this plugin already loads. It can be optimized like

```diff
- runtime! syntax/css.vim
+ if !exists("b:current_loading_main_syntax")
+   runtime! syntax/css.vim
+ endif
```

## See also

- [vim-svelte-theme][11] svelte syntax color
- [vim-vue-plugin][3]
- [mxw/vim-jsx][1]

## License

This plugin is under [The Unlicense][8]. Other than this, `lib/indent/*` files are extracted from vim runtime.

[1]: https://github.com/mxw/vim-jsx "mxw: vim-jsx"
[2]: https://github.com/VundleVim/Vundle.vim
[3]: https://github.com/leafOfTree/vim-vue-plugin
[4]: https://github.com/digitaltoad/vim-pug
[5]: https://github.com/tpope/vim-pathogen
[6]: https://github.com/kchmck/vim-coffee-script
[7]: https://github.com/junegunn/vim-plug
[8]: https://choosealicense.com/licenses/unlicense/
[10]: https://github.com/mattn/emmet-vim
[11]: https://github.com/leafOfTree/vim-svelte-theme
[12]: https://travis-ci.com/leafOfTree/vim-svelte-plugin.svg?branch=master
[14]: https://github.com/leafgarland/typescript-vim
[15]: https://github.com/HerringtonDarkholme/yats.vim

redpajama_set_name: RedPajamaGithub


text:
/*
 */
package com.compomics.pride_asa_pipeline.core.model;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.HashMap;
import java.util.Iterator;

/**
 * This class presents an abstract ancestor for all standard SpectrumFile
 * implementations.
 *
 * @author Lennart Martens
 * @version $Id: SpectrumFileAncestor.java,v 1.4 2009/11/06 11:47:15 kenny Exp $
 */
public abstract class SpectrumFileAncestor {

    /**
     * This variable holds the filename for the spectrum file.
     */
    protected String iFilename = null;
    /**
     * This HashMap holds all the peaks in the spectrum file.
     */
    protected HashMap iPeaks = new HashMap();
    /**
     * This variable holds the precursor M/Z
     */
    protected double iPrecursorMz = -1.0;
    /**
     * This variable holds the charge state.
     */
    protected int iCharge = 0;
    /**
     * The precursor intensity.
     */
    protected double iIntensity = -1.0;

    /**
     * This method reports on the charge of the precursor ion. Note that when
     * the charge could not be determined, this method will return '0'.
     *
     * @return int with the charge of the precursor, or '0' if no charge state
     * is known.
     */
    public int getCharge() {
        return iCharge;
    }

    /**
     * This method reports on the filename for the file.
     *
     * @return String with the filename for the file.
     */
    public String getFilename() {
        return iFilename;
    }

    /**
     * This method reports on the intensity of the precursor ion.
     *
     * @return double with the intensity of the precursor ion.
     */
    public double getIntensity() {
        return iIntensity;
    }

    /**
     * This method reports on the peaks in the spectrum, with the Doubles for
     * the masses as keys in the HashMap, and the intensities for each peak as
     * Double value for that mass key.
     *
     * @return HashMap with Doubles as keys (the masses) and Doubles as values
     * (the intensities).
     */
    public HashMap getPeaks() {
        return iPeaks;
    }

    /**
     * This method reports on the precursor M/Z
     *
     * @return double with the precursor M/Z
     */
    public double getPrecursorMZ() {
        return iPrecursorMz;
    }

    /**
     * This method sets the charge of the precursor ion. When the charge is not
     * known, it should be set to '0'.
     *
     * @param aCharge int with the charge of the precursor ion.
     */
    public void setCharge(int aCharge) {
        this.iCharge = aCharge;
    }

    /**
     * This method sets the filename for the file.
     *
     * @param aFilename String with the filename for the file.
     */
    public void setFilename(String aFilename) {
        this.iFilename = aFilename;
    }

    /**
     * This method sets the intensity of the precursor ion.
     *
     * @param aIntensity double with the intensity of the precursor ion.
     */
    public void setIntensity(double aIntensity) {
        this.iIntensity = aIntensity;
    }

    /**
     * This method sets the peaks on the spectrum. Doubles for the masses as
     * keys in the HashMap, and the intensities for each peak as Double value
     * for that mass key.
     *
     * @param aPeaks HashMap with Doubles as keys (the masses) and Doubles as
     * values (the intensities).
     */
    public void setPeaks(HashMap aPeaks) {
        this.iPeaks = aPeaks;
    }

    /**
     * This method sets the precursor M/Z on the file.
     *
     * @param aPrecursorMZ double with the precursor M/Z
     */
    public void setPrecursorMZ(double aPrecursorMZ) {
        this.iPrecursorMz = aPrecursorMZ;
    }

    public double getTotalIntensity() {
        Iterator iter = this.iPeaks.values().iterator();
        double totalIntensity = 0.0;
        while (iter.hasNext()) {
            totalIntensity += (Double) iter.next();
        }
        return round(totalIntensity);
    }

    public double getHighestIntensity() {
        Iterator iter = this.iPeaks.values().iterator();
        double highestIntensity = -1.0;
        while (iter.hasNext()) {
            double temp = (Double) iter.next();
            if (temp > highestIntensity) {
                highestIntensity = temp;
            }
        }
        return round(highestIntensity);
    }

    private double round(final double aTotalIntensity) {
        BigDecimal bd = new BigDecimal(aTotalIntensity).setScale(2, RoundingMode.UP);
        return bd.doubleValue();
    }
}


text:
Node module to help with the handling of github repo information

## _IMPORTANT! Requires Node.js 4.2.1 or higher_

# Usage
```js
const repoHelper = require('repoHelper');
return repoHelper.createGithubAuthentication('Demands', 'token', ['repo'])
  .then((credentials) => {
    const limit = 0;
    const debug = false;
    return repoHelper.getRepos(credentials, limit, debug)
      .then((repos) => {
        return Promise.all(repos.map((repo) => {
          return repoHelper.getOpenPRs(credentials, repo, debug);
        }))
      });
  });
```


text:
/**
 * Display that an error has occurred making the video unplayable
 * @param {vjs.Player|Object} player
 * @param {Object=} options
 * @constructor
 */
vjs.ErrorDisplay = vjs.Component.extend({
  init: function(player, options){
    vjs.Component.call(this, player, options);

    this.update();
    player.on('error', vjs.bind(this, this.update));
  }
});

vjs.ErrorDisplay.prototype.createEl = function(){
  var el = vjs.Component.prototype.createEl.call(this, 'div', {
    className: 'vjs-error-display'
  });

  this.contentEl_ = vjs.createEl('div');
  el.appendChild(this.contentEl_);

  return el;
};

vjs.ErrorDisplay.prototype.update = function(){
  if (this.player().error()) {
    this.contentEl_.innerHTML = this.player().error().message;
  }
};


text:
core.controller('CoreAdminController', function ($controller, $injector, $route, $scope, AssumedControl, AuthService, StorageService, UserService, WsApi) {

    angular.extend(this, $controller('AbstractController', {
        $scope: $scope
    }));

    $scope.assumedControl = AssumedControl.get();

    AssumedControl.set({
        'netid': '',
        'button': $scope.isAssuming() == 'true' ? 'Unassume User' : 'Assume User',
        'status': $scope.isAssuming() == 'true' ? 'assumed' : '',
    });

    $scope.user = UserService.getCurrentUser();

    $scope.$watch('user.role', function () {
        if ($scope.user.role) {
            StorageService.set('role', $scope.user.role);
        }
    });

    $scope.assumeUser = function (user) {

        if ($scope.isAssuming() == 'false') {

            if ((typeof user !== 'undefined') && user.netid) {

                AssumedControl.assume(user).then(function (assumed) {
                    if (assumed) {
                        $scope.closeModal();
                        $route.reload();
                    }
                });

            } else {
                logger.log("User to assume undefined!");
            }

        } else {

            AssumedControl.unassume(user, $scope.user.role).then(function (unassumed) {
                $route.reload();
            });

        }

    };

    $scope.cancelAssumeUser = function () {
        $scope.closeModal();
        AssumedControl.cancel();
    };

    $scope.isMocking = function () {
        if (appConfig.mockRole) {
            return true;
        } else {
            return false;
        }
    };

    $scope.logout = function (url) {
        StorageService.delete('token');
        StorageService.delete('role');
        window.open(url, "_self");
    };

});


text:
<?php

namespace afoozle\GithubWebhook\EntityMapper;

use afoozle\GithubWebhook\Entity\Payload;

class EntityMapperTest extends \PHPUnit_Framework_TestCase {

    private function getTestJson()
    {
        $testData = <<<ENDJSON
{
   "after":"1481a2de7b2a7d02428ad93446ab166be7793fbb",
   "before":"17c497ccc7cca9c2f735aa07e9e3813060ce9a6a",
   "commits":[
      {
         "added":[

         ],
         "author":{
            "email":"lolwut@noway.biz",
            "name":"Garen Torikian",
            "username":"octokitty"
         },
         "committer":{
            "email":"lolwut@noway.biz",
            "name":"Garen Torikian",
            "username":"octokitty"
         },
         "distinct":true,
         "id":"c441029cf673f84c8b7db52d0a5944ee5c52ff89",
         "message":"Test",
         "modified":[
            "README.md"
         ],
         "removed":[

         ],
         "timestamp":"2013-02-22T13:50:07-08:00",
         "url":"https://github.com/octokitty/testing/commit/c441029cf673f84c8b7db52d0a5944ee5c52ff89"
      },
      {
         "added":[

         ],
         "author":{
            "email":"lolwut@noway.biz",
            "name":"Garen Torikian",
            "username":"octokitty"
         },
         "committer":{
            "email":"lolwut@noway.biz",
            "name":"Garen Torikian",
            "username":"octokitty"
         },
         "distinct":true,
         "id":"36c5f2243ed24de58284a96f2a643bed8c028658",
         "message":"This is me testing the windows client.",
         "modified":[
            "README.md"
         ],
         "removed":[

         ],
         "timestamp":"2013-02-22T14:07:13-08:00",
         "url":"https://github.com/octokitty/testing/commit/36c5f2243ed24de58284a96f2a643bed8c028658"
      },
      {
         "added":[
            "words/madame-bovary.txt"
         ],
         "author":{
            "email":"lolwut@noway.biz",
            "name":"Garen Torikian",
            "username":"octokitty"
         },
         "committer":{
            "email":"lolwut@noway.biz",
            "name":"Garen Torikian",
            "username":"octokitty"
         },
         "distinct":true,
         "id":"1481a2de7b2a7d02428ad93446ab166be7793fbb",
         "message":"Rename madame-bovary.txt to words/madame-bovary.txt",
         "modified":[

         ],
         "removed":[
            "madame-bovary.txt"
         ],
         "timestamp":"2013-03-12T08:14:29-07:00",
         "url":"https://github.com/octokitty/testing/commit/1481a2de7b2a7d02428ad93446ab166be7793fbb"
      }
   ],
   "compare":"https://github.com/octokitty/testing/compare/17c497ccc7cc...1481a2de7b2a",
   "created":false,
   "deleted":true,
   "forced":false,
   "head_commit":{
      "added":[
         "words/madame-bovary.txt"
      ],
      "author":{
         "email":"lolwut@noway.biz",
         "name":"Garen Torikian",
         "username":"octokitty"
      },
      "committer":{
         "email":"lolwut@noway.biz",
         "name":"Garen Torikian",
         "username":"octokitty"
      },
      "distinct":true,
      "id":"1481a2de7b2a7d02428ad93446ab166be7793fbb",
      "message":"Rename madame-bovary.txt to words/madame-bovary.txt",
      "modified":[

      ],
      "removed":[
         "madame-bovary.txt"
      ],
      "timestamp":"2013-03-12T08:14:29-07:00",
      "url":"https://github.com/octokitty/testing/commit/1481a2de7b2a7d02428ad93446ab166be7793fbb"
   },
   "pusher":{
      "name":"none"
   },
   "ref":"refs/heads/master",
   "repository":{
      "created_at":1332977768,
      "description":"",
      "fork":false,
      "forks":0,
      "has_downloads":true,
      "has_issues":true,
      "has_wiki":true,
      "homepage":"",
      "id":3860742,
      "language":"Ruby",
      "master_branch":"master",
      "name":"testing",
      "open_issues":2,
      "owner":{
         "email":"lolwut@noway.biz",
         "name":"octokitty"
      },
      "private":false,
      "pushed_at":1363295520,
      "size":2156,
      "stargazers":1,
      "url":"https://github.com/octokitty/testing",
      "watchers":1
   }
}
ENDJSON;
        return $testData;
    }

    private function getAndMapEntity()
    {
        $mapper = new PayloadMapper();
        $payloadObject = $mapper->mapFromJson($this->getTestJson());
        return $payloadObject;
    }

    public function testMapWithInvalidJson()
    {
        $mapper = new PayloadMapper();

        try {
            $mapper->mapFromJson('this is not json');
            $this->fail("An expected InvalidArgumentException was not thrown");
        }
        catch (\InvalidArgumentException $expected){
            return;
        }
    }

    public function testMapAfter()
    {
        $payloadObject = $this->getAndMapEntity();
        $this->assertEquals('1481a2de7b2a7d02428ad93446ab166be7793fbb', $payloadObject->getAfter(), "After was mapped incorrectly");
    }

    public function testMapBefore()
    {
        $payloadObject = $this->getAndMapEntity();
        $this->assertEquals('17c497ccc7cca9c2f735aa07e9e3813060ce9a6a', $payloadObject->getBefore(), "Before was mapped incorrectly");
    }

    public function testMapCommits()
    {
        $payloadObject = $this->getAndMapEntity();
        $this->assertEquals(3, count($payloadObject->getCommits()), "Number of commits is incorrect");
        foreach($payloadObject->getCommits() as $commit) {
            $this->assertInstanceOf('\\afoozle\\GithubWebhook\\Entity\\Commit', $commit, "Commit is of incorrect type");
        }
    }

    public function testMapCompare()
    {
        $payloadObject = $this->getAndMapEntity();
        $this->assertEquals('https://github.com/octokitty/testing/compare/17c497ccc7cc...1481a2de7b2a', $payloadObject->getCompare(), "Compare mapped incorrectly");
    }

    public function testMapCreated()
    {
        $payloadObject = $this->getAndMapEntity();
        $this->assertEquals(false, $payloadObject->getCreated(), "Created mapped incorrectly");
    }

    public function testMapDeleted()
    {
        $payloadObject = $this->getAndMapEntity();
        $this->assertEquals(true, $payloadObject->getDeleted(), "Deleted mapped incorrectly");
    }

    public function testMapForced()
    {
        $payloadObject = $this->getAndMapEntity();
        $this->assertEquals(false, $payloadObject->getForced(), "Forced mapped incorrectly");
    }

    public function testMapHeadCommit()
    {
        $payloadObject = $this->getAndMapEntity();
        $this->assertInstanceOf('\\afoozle\\GithubWebhook\\Entity\\Commit', $payloadObject->getHeadCommit(), "Head commit is not the correct type");
    }

    public function testMapPusher()
    {
        $payloadObject = $this->getAndMapEntity();
        $this->assertInstanceOf("\\afoozle\\GithubWebHook\\Entity\\Person", $payloadObject->getPusher(), "Pusher mapped incorrectly");
        $this->assertEquals("none", $payloadObject->getPusher()->getName(), "Pusher mapped incorrectly");
    }

    public function testMapRef()
    {
        $payloadObject = $this->getAndMapEntity();
        $this->assertEquals('refs/heads/master', $payloadObject->getRef(), "Ref mapped incorrectly");
    }

    public function testMapRepository()
    {
        $payloadObject = $this->getAndMapEntity();
        $this->assertInstanceOf('\\afoozle\\GithubWebhook\\Entity\\Repository', $payloadObject->getRepository(), "Repository is not the correct type");
    }
}


text:
package org.wso2.siddhi.core.util.collection.queue;

import org.wso2.siddhi.core.event.StreamEvent;

import java.util.Collection;
import java.util.Iterator;
import java.util.concurrent.LinkedBlockingQueue;

import org.wso2.siddhi.core.event.remove.RemoveEvent;
import org.wso2.siddhi.core.util.collection.Pair;
import org.wso2.siddhi.core.util.collection.queue.scheduler.timestamp.ISchedulerTimestampSiddhiQueue;
import org.wso2.siddhi.core.util.collection.queue.scheduler.timestamp.TimestampQueueIterator;

/**
 * This class implements a sliding window which slides once in every given constant time.
 * @param <T>
 */
public class TimeStampSiddhiQueue<T extends StreamEvent> extends SiddhiQueue<T> implements  ISchedulerTimestampSiddhiQueue<T> {
    private LinkedBlockingQueue<Pair<Long, LinkedBlockingQueue<T>>> pairQueue = new LinkedBlockingQueue<Pair<Long, LinkedBlockingQueue<T>>>();
    private Pair<Long, LinkedBlockingQueue<T>> lastPair;
    private long pollInterval = 0;
    private Long nextPollTime = 0l;

    public TimeStampSiddhiQueue(long pollInterval) {
        this.pollInterval = pollInterval;
        updateNextPollTime(System.currentTimeMillis());
    }

    private void updateNextPollTime(long lastPollTime){
        nextPollTime = (lastPollTime + pollInterval);
    }

    /**
     * Every event that expires before next polling time will be put into a single group.
     * If an event receives which expires after the next polling time, a new group will be
     * created and subsequent messages will be put into that group and update next polling
     * time. In this way separate groups will be created for messages which expires before
     * a particular polling time. And since this is a FIFO queue the group that has to be
     * pop-ed out in the next pol will always at the peek of the queue
     * @param streamEvent
     */
    @Override
    public synchronized void put(T streamEvent) {
       long expiryTime = ((RemoveEvent)streamEvent).getExpiryTime();

        if (!pairQueue.isEmpty() && nextPollTime >= expiryTime) {
            lastPair.getTwo().add(streamEvent);
        } else {
            LinkedBlockingQueue<T> eventsList = new LinkedBlockingQueue<T>();
            eventsList.add(streamEvent);
            Pair<Long, LinkedBlockingQueue<T>> eventPair = new Pair<Long, LinkedBlockingQueue<T>>(nextPollTime, eventsList);
            pairQueue.add(eventPair);
            lastPair = eventPair;

            updateNextPollTime(nextPollTime);
        }
    }

    @Override
    public synchronized T poll() {
        T t = null;
        if (pairQueue.size() > 0) {
            LinkedBlockingQueue<T> streamEvents = pairQueue.peek().getTwo();
            t = streamEvents.poll();
        }
        return t;
    }

    @Override
    public synchronized T peek() {
        T t = null;
        if (pairQueue.size() > 0) {
            t = pairQueue.peek().getTwo().peek();
        }

        return t;
    }

    @Override
    public Iterator<T> iterator() {
        return (Iterator<T>) new TimestampQueueIterator(pairQueue.iterator());
    }

    /**
     * Pops up the the peek of the message group queue. And it contains messages
     * which have an expiry time less than the expiryTime argument. Messages are
     * grouped in put() method in a way such that, all messages that are expiring
     * before a given polling time are put into a single queue. And the group that
     * has to be pop-ed in the next poll is always kept in the peek of the queue
     * @param expiryTime current epoch time in mili seconds
     * @return Messages that are expiring before the expiryTime
     */
    @Override
    public Collection<T> poll(long expiryTime) {
        LinkedBlockingQueue<T> returnValue = null;
        if (!pairQueue.isEmpty()) {
            Pair<Long, LinkedBlockingQueue<T>> pair = pairQueue.peek();
            if (!pair.getTwo().isEmpty() && (pair.getOne() <= expiryTime)) {
                returnValue = pairQueue.poll().getTwo();
            }
        }
        return returnValue;
    }

    @Override
    public Object[] currentState() {
        return new Object[]{pairQueue};
    }

    @Override
    public void restoreState(Object[] objects) {
        pairQueue = (LinkedBlockingQueue<Pair<Long, LinkedBlockingQueue<T>>>) objects[0];
    }

    @Override
    public int size() {
        int size = 0;
        for (Pair<Long, LinkedBlockingQueue<T>> pair : pairQueue) {
            size += pair.getTwo().size();
        }
        return size;
    }

    @Override
    public void reSchedule() {
    }

    @Override
    public void schedule() {
    }

}


text:
<?php

namespace Symfony\Bridge\Propel1\Tests\Fixtures;

class ReadOnlyItem extends \BaseObject
{
    public function getName()
    {
        return 'Marvin';
    }

    public function getPrimaryKey()
    {
        return 42;
    }
}


text:
FROM ubuntu

MAINTAINER Dan MARIAN

RUN apt-get update


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:background="#FF3F454E"
   >

    <LinearLayout
        android:layout_alignParentLeft="true"
        android:id="@+id/ll_title_back"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_marginLeft="16dp"
        android:orientation="horizontal">

        <TextView
            android:id="@+id/tv_title_back_arror"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:background="@mipmap/title_back" />

        <TextView
            android:id="@+id/tv_title_back_desc"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:text="返回"
            android:textColor="#FFFFFF"
            android:textSize="19sp" />

    </LinearLayout>

    <TextView
        android:id="@+id/tv_title_content"
        android:layout_centerInParent="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text=""
        android:textColor="#FFFFFF"
        android:textSize="19sp" />

    <TextView
        android:id="@+id/tv_title_right"
        android:layout_marginRight="16dp"
        android:layout_centerVertical="true"
        android:textColor="#FFFFFF"
        android:textSize="19sp"
        android:layout_alignParentRight="true"
        android:text=""
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
</RelativeLayout>


text:
NGApp.factory( 'ReferralService', function( $http, $rootScope, $location, AccountService ){

	var service = { invite_url : null, value : 0, invites : 0, limit : 0, invitedUsers: false };

	service.check = function(){
		var param = $location.search();
		if( param.invite ){
			$.totalStorage( 'referral', param.invite );
			// Remove the invite from url
			$location.url( $location.path() );
		}
	}

	service.newReferredUsersByUser = function(){
		if( App.config.new_referral_users ){
			service.invitedUsers = App.config.new_referral_users;
			$rootScope.$broadcast( 'ReferralInvitedUsers', true );
		}
	}

	service.getInviteCode = function(){
		var url = App.service + 'referral/code';
		$http( {
				url: url,
				method : 'POST',
				headers: {'Content-Type': 'application/x-www-form-urlencoded' }
			} ).success( function( data ) {
				service.invite_url = data.invite_url;
				AccountService.user.invite_code = data.invite_code;
				$rootScope.$broadcast( 'referralCodeLoaded', true );
			}	).error(function( data, status ) {
				console.log( { error : data } );
			} );
	}

	service.sms = function(){
		var text = App.AB.get('share-text-referral').replace('%c', service.invite_code);
		if( App.iOS() ){
			return 'sms:&body=' + text + ' ' + service.invite_url;
		} else {
			// this appears to be the standard and should work for other non droid phones
			return 'sms:?body=' + text + ' ' + service.invite_url;
		}
	}

	service.getValue = function(){
		var url = App.service + 'referral/value';
		$http( {
				url: url,
				method : 'POST',
				headers: {'Content-Type': 'application/x-www-form-urlencoded' }
			} ).success( function( data ) {
				service.value = data.value;
				$rootScope.$broadcast( 'referralValueLoaded', true );
			}	).error(function( data, status ) {
				console.log( { error : data } );
			} );
	}

	service.getStatus = function(){
		if( App.config.referral ){
			service.enabled = App.config.referral.enabled;
			service.invites = App.config.referral.invites;
			service.value = App.config.referral.value;
			service.limit = App.config.referral.limit;
			service.invite_code = App.config.referral.invite_code;
			service.invite_url = App.config.referral.invite_url;
			$rootScope.$broadcast( 'referralStatusLoaded', true );
		} else {
			var url = App.service + 'referral/status';
			$http( {
					url: url,
					method : 'POST',
					headers: {'Content-Type': 'application/x-www-form-urlencoded' }
				} ).success( function( data ) {
					service.enabled = data.enabled;
					service.invites = data.invites;
					service.value = data.value;
					service.limit = data.limit;
					service.invite_code = data.invite_code;
					service.invite_url = data.invite_url;
					$rootScope.$broadcast( 'referralStatusLoaded', true );
				}	).error(function( data, status ) {
					console.log( { error : data } );
				} );
		}
	}

	service.cleaned_url = function(){
		return service.invite_url && service.invite_url.replace('http://','');
	}

	$rootScope.$on( 'userAuth', function(e, data) {
		service.invite_url = null;
		service.value = 0;
		service.invites = 0;
		service.limit = 0;
	});

	return service;

} );


text:
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring3-3.dtd">

            <form id="form-horizontal" class="form-horizontal bs-docs-example" enctype='multipart/form-data' action="" th:attr="action=@{/admin/report/action/save}" method="POST">

                    Report name

                        <input type="text" id="reportName" class="validate[required]" name="reportName" placeholder="Report name" th:value="${report}? ${report.reportName} : ''"/>

                    Description

                        <input type="text" id="reportDescription" class="validate[required]" name="reportDescription" placeholder="Report desciption" th:value="${report}? ${report.reportDescription}: ''"/>

                    <input type="hidden" name='reportId' th:value="${report}?${report.reportId}:''"/>
                    Report file

                        <input type='file' id='reportFile' accept="" th:class="${report}?'':'validate[required]'" name='reportFile'/>

                        <button type="submit" class="btn btn-primary">Add/Update report settings</button>
                        Cancel

            </form>


text:
/* YOUTUBE */

// fairly liberal regexp that will accept things like
// https://m.youtube.com/watch/?v=abcdefghijk&t=2m
// youtube.com/watch/?foo=bar&v=abcdefghijk#t=5h2s
// >>>youtu.be/abcdefghijk
const youtube_url_re = /(?:>>>*?)?(?:https?:\/\/)?(?:www\.|m\.|music\.)?(?:youtu\.be\/|youtube\.com\/watch\/?\?((?:[^\s#&=]+=[^\s#&]*&)*)?v=)([\w-]{11})((?:&[^\s#&=]+=[^\s#&]*)*)&?([#\?]t=[\dhms]{1,9})?/;
const youtube_time_re = /^[#\?]t=(?:(\d\d?)h)?(?:(\d{1,3})m)?(?:(\d{1,3})s?)?$/;

(function () {

function make_video(id, params, start) {
	if (!params)
		params = {allowFullScreen: 'true'};
	params.allowScriptAccess = 'always';
	const query = {
		autohide: 1,
		fs: 1,
		modestbranding: 1,
		origin: document.location.origin,
		rel: 0,
		showinfo: 0,
	};
	if (start)
		query.start = start;
	if (params.autoplay)
		query.autoplay = params.autoplay;
	if (params.loop) {
		query.loop = '1';
		query.playlist = id;
	}

	const src = encodeURI(`https://www.youtube.com/embed/${id}`) + '?' + $.param(query);
	return $('', {
		type: 'text/html',
		src,
		frameborder: '0',
		attr: video_dims(),
		"class": 'youtube-player',
	});
}
window.make_video = make_video;

function video_dims() {
	if (window.screen && screen.width <= 700) {
		// shrink to fit smol screens
		const width = Math.round(screen.width * 0.8);
		const height = Math.round(width / 1.6);
		return {width, height};
	}
	else
		return {width: 560, height: 340};
}

$DOC.on('click', '.watch', e => {
	if (e.which > 1 || e.metaKey || e.ctrlKey || e.altKey || e.shiftKey)
		return;
	const $target = $(e.target);

	/* maybe squash that double-play bug? ugh, really */
	if (!$target.is('a'))
		return;

	const $video = $target.find('iframe');
	if ($video.length) {
		$video.siblings('br').andSelf().remove();
		$target.css('width', 'auto');
		return false;
	}
	if ($target.data('noembed'))
		return;
	const m = $target.attr('href').match(youtube_url_re);
	if (!m) {
		/* Shouldn't happen, but degrade to normal click action */
		return;
	}
	let start = 0;
	if (m[4]) {
		const t = m[4].match(youtube_time_re);
		if (t) {
			if (t[1])
				start += parseInt(t[1], 10) * 3600;
			if (t[2])
				start += parseInt(t[2], 10) * 60;
			if (t[3])
				start += parseInt(t[3], 10);
		}
	}

	const $obj = make_video(m[2], null, start);
	with_dom(() => {
		$target.css('width', video_dims().width).append('
', $obj);
	});
	return false;
});

$DOC.on('mouseenter', '.watch', event => {
	const $target = $(event.target);
	if ($target.data('requestedTitle'))
		return;
	$target.data('requestedTitle', true);
	/* Edit textNode in place so that we don't mess with the embed */
	const node = text_child($target);
	if (!node)
		return;
	const orig = node.textContent;
	with_dom(() => {
		node.textContent = `${orig}...`;
	});
	const m = $target.attr('href').match(youtube_url_re);
	if (!m)
		return;

	$.ajax({
		url: 'https://www.googleapis.com/youtube/v3/videos',
		data: {id: m[2],
		       key: config.GOOGLE_API_KEY,
		       part: 'snippet,status',
		       fields: 'items(snippet(title),status(embeddable))',
		},
		dataType: 'json',
		success: data => with_dom(() => gotInfo(data)),
		error: () => with_dom(() => {node.textContent = `${orig}???`;}),
	});

	function gotInfo(data) {
		const title = data && data.items && data.items[0].snippet && data.items[0].snippet.title;
		if (title) {
			node.textContent = `${orig}: ${title}`;
			$target.css({color: 'black'});
		}
		else
			node.textContent = `${orig} (gone?)`;

		if (data && data.items && data.items[0].status && data.items[0].status.embeddable == false) {
			node.textContent += ' (EMBEDDING DISABLED)';
			$target.data('noembed', true);
		}
	}
});

function text_child($target) {
	return $target.contents().filter(function () {
		return this.nodeType === 3;
	})[0];
}

/* SOUNDCLOUD */

window.soundcloud_url_re = /(?:>>>*?)?(?:https?:\/\/)?(?:www\.)?soundcloud\.com\/([\w-]{1,40}\/[\w-]{1,80})\/?/;

function make_soundcloud(path, dims) {
	const query = {
		url: `http://soundcloud.com/${path}`,
		color: 'ffaa66',
		auto_play: false,
		show_user: false,
		show_comments: false,
	};
	const src = 'https://w.soundcloud.com/player/?' + $.param(query);
	return $('', {
		src, width: dims.width, height: dims.height,
		scrolling: 'no', frameborder: 'no',
	});
}

$DOC.on('click', '.soundcloud', e => {
	if (e.which > 1 || e.ctrlKey || e.altKey || e.shiftKey || e.metaKey)
		return;
	const $target = $(e.target);

	const $frame = $target.find('iframe');
	if ($frame.length) {
		$frame.siblings('br').andSelf().remove();
		$target.css('width', 'auto');
		return false;
	}
	const m = $target.attr('href').match(soundcloud_url_re);
	if (!m) {
		/* Shouldn't happen, but degrade to normal click action */
		return;
	}
	const width = Math.round($(window).innerWidth() * 0.75);
	const $obj = make_soundcloud(m[1], {width, height: 166});
	with_dom(() => {
		$target.css('width', width).append('
', $obj);
	});
	return false;
});

/* lol copy pasta */
$DOC.on('mouseenter', '.soundcloud', event => {
	const $target = $(event.target);
	if ($target.data('requestedTitle'))
		return;
	$target.data('requestedTitle', true);
	/* Edit textNode in place so that we don't mess with the embed */
	const node = text_child($target);
	if (!node)
		return;
	const orig = node.textContent;
	with_dom(() => {
		node.textContent = `${orig}...`;
	});
	const m = $target.attr('href').match(soundcloud_url_re);
	if (!m)
		return;

	$.ajax({
		url: '//soundcloud.com/oembed',
		data: {format: 'json', url: 'http://soundcloud.com/' + m[1]},
		dataType: 'json',
		success: data => with_dom(() => gotInfo(data)),
		error: () => with_dom(() => {node.textContent = `${orig}???`;}),
	});

	function gotInfo(data) {
		const title = data && data.title;
		if (title) {
			node.textContent = `${orig}: ${title}`;
			$target.css({color: 'black'});
		}
		else
			node.textContent = `${orig} (gone?)`;
	}
});

/* TWITTER */

window.twitter_url_re = /(?:>>>*?)?(?:https?:\/\/)?(?:www\.|mobile\.|m\.)?twitter\.com\/(\w{1,15})\/status\/(\d{4,20})\/?(?:\?[st]=[\w-]+)?&?(?:[st]=[\w-]+)?/;

$DOC.on('click', '.tweet', function (e) {
	if (e.which > 1 || e.metaKey || e.ctrlKey || e.altKey || e.shiftKey)
		return;
	var $target = $(e.target);
	if (!$target.is('a.tweet') || $target.data('tweet') == 'error')
		return;
	setup_tweet($target);

	var $tweet = $target.find('.twitter-tweet');
	if ($tweet.length) {
		$tweet.siblings('br').andSelf().remove();
		$target.css('width', 'auto');
		text_child($target).textContent = $target.data('tweet-expanded');
		return false;
	}
	fetch_tweet($target, function (err, info) {
		var orig = $target.data('tweet-ref');
		if (err) {
			$target.data('tweet', 'error');
			if (info && info.node) {
				with_dom(function () {
					info.node.textContent = orig + ' (error: ' + err + ')';
				});
			}
			return;
		}
		$target.data('tweet', info.tweet);
		var w = 500;
		if (window.screen && screen.width && screen.width < w)
			w = screen.width - 20;

		var $tweet = $($.parseHTML(info.tweet.html)[0]);
		with_tweet_widget(function () {
			$target.append('
', $tweet);
			$target.css('width', w);
			info.node.textContent = orig;
		});
	});
	return false;
});

$DOC.on('mouseenter', '.tweet', function (event) {
	var $target = $(event.target);
	if (!$target.is('a.tweet') || $target.data('tweet'))
		return;
	setup_tweet($target);

	fetch_tweet($target, function (err, info) {
		if (err) {
			if (info && info.node) {
				$target.data('tweet', 'error');
				with_dom(function () {
					info.node.textContent += ' (error: ' + err + ')';
				});
			}
			else
				console.warn(err);
			return;
		}

		var node = info.node;
		var orig = $target.data('tweet-ref') || node.textContent;
		var html = info.tweet && info.tweet.html;
		if (!html) {
			$target.data('tweet', 'error');
			node.textContent = orig + ' (broken?)';
			return;
		}
		$target.data('tweet', info.tweet);
		// twitter sends us HTML of the tweet; scrape it a little
		var $tweet = $($.parseHTML(html)[0]);
		var $p = $tweet.find('p');
		if ($p.length) {
			// chop the long ID number off our ref
			var prefix = orig;
			var m = /^(.+)\/\d{4,20}(?:s=\d+)?$/.exec(prefix);
			if (m)
				prefix = m[1];

			var text = scrape_tweet_p($p);
			with_dom(function () {
				var expanded = prefix + ' \u00b7 ' + text;
				$target.data('tweet-expanded', expanded);
				node.textContent = expanded;
				$target.css({color: 'black'});
			});
		}
		else {
			with_dom(function () {
				node.textContent = orig + ' (could not scrape)';
			});
		}
	});
});

/// call this before fetch_tweet or any DOM modification of the ref
function setup_tweet($target) {
	setup_tweet_widgets_script();
	if ($target.data('tweet-ref'))
		return;
	var node = text_child($target);
	if (!node)
		return;
	$target.data('tweet-ref', node.textContent);
}

/// fetch & cache the json about the tweet referred to by >>>/@ref $target
function fetch_tweet($target, cb) {
	var node = text_child($target);
	if (!node)
		return cb("ref's text node not found");

	var cached = $target.data('tweet');
	if (cached == 'error')
		return cb('could not contact twitter', {node: node});
	if (cached && cached.inflight) {
		var queue = TW_CB[cached.inflight];
		if (queue)
			queue.callbacks.push(cb);
		else
			cb('gone', {node: node});
		return;
	}
	if (cached)
		return cb(null, {tweet: cached, node: node});

	var tweet_url = $target.attr('href');
	var m = tweet_url.match(twitter_url_re);
	if (!m)
		return cb('invalid tweet ref', {node: node});
	var handle = m[1];
	var id = m[2];

	// if this request is already in-flight, just wait on the result
	var flight = TW_CB[id];
	if (flight) {
		flight.node = node;
		flight.callbacks.push(cb);
		return;
	}

	// chop the prefix off the url and add our own
	var chop = tweet_url.indexOf(handle);
	if (chop < 0)
		return;
	var our_url = '../outbound/tweet/' + tweet_url.substr(chop);

	// we're ready, make the call
	TW_CB[id] = {node: node, callbacks: [cb]};
	$target.data('tweet', {inflight: id});

	var theme = 'light'; // TODO tie into current theme
	$.ajax({
		url: our_url,
		data: {theme: theme},
		dataType: 'json',
		success: function (json) {
			got_tweet(json, id);
		},
		error: function (xhr, stat, error) {
			failed_tweet(error, id);
		},
	});

	var orig = $target.data('tweet-ref') || node.textContent;
	with_dom(function () {
		node.textContent = orig + '...';
	});
}

function scrape_tweet_p($p) {
	var bits = $p.contents();
	var text = "";
	var i;
	for (i = 0; i < bits.length; i++) {
		var node = bits[i];
		if (node.nodeType == 3)
			text += node.textContent;
		else if (node.nodeType == 1) {
			if (node.tagName == 'A')
				text += node.textContent;
			else
				break;
		}
		else
			break;
	}
	if (i < bits.length)
		text += ' \u2026';
	if (!text)
		text = $p.text();
	return text;
}

var TW_CB = {};

function failed_tweet(err, id) {
	var req = TW_CB[id];
	if (!req)
		return;
	delete TW_CB[id];
	var node = req.node;
	if (node) {
		req.node = null;
		var payload = {node: node};
		while (req.callbacks.length)
			req.callbacks.shift()(err || 'offline?', payload);
	}
	req.callbacks = [];
}

function got_tweet(tweet, id) {
	var saved = TW_CB[id];
	if (!saved) {
		console.warn('tweet callback for non-pending tweet', tweet);
		return;
	}
	delete TW_CB[id];

	var payload = {node: saved.node, tweet: tweet};
	saved.node = null;
	while (saved.callbacks.length)
		saved.callbacks.shift()(null, payload);
}

var TW_WG_SCRIPT;

function setup_tweet_widgets_script() {
	TW_WG_SCRIPT = $.getScript('https://platform.twitter.com/widgets.js').done(function () {
		TW_WG_SCRIPT = {done: twttr.ready};
		twttr.ready(function () {
			TW_WG_SCRIPT = true;
		});
	});
	setup_tweet_widgets_script = function () {};
}

/// when creating a tweet widget, wrap the DOM insertion with this
function with_tweet_widget(func) {
	function go() {
		func();
		if (window.twttr)
			twttr.widgets.load();
	}
	if (TW_WG_SCRIPT && TW_WG_SCRIPT.done) {
		TW_WG_SCRIPT.done(function () {
			with_dom(go);
		});
	}
	else
		with_dom(go);
}

})();


text: UPDATE `sys_objects_cmts` SET `ClassName`='BxTemplCmtsNotes' WHERE `Name`='bx_spaces_notes';


text:
<?php

namespace Baleen\Migrations\Service\Runner\Factory;

use Baleen\Migrations\Service\Runner\CollectionRunner;
use Baleen\Migrations\Common\Collection\CollectionInterface;

/**
 * Trait CreatesCollectionRunnerTrait
 *
 * @author Gabriel Somoza <gabriel@strategery.io>
 */
trait CreatesCollectionRunnerTrait
{
    /** @var CollectionRunnerFactoryInterface */
    private $factory;

    final protected function setFactory(CollectionRunnerFactoryInterface $factory) {
        $this->factory = $factory;
    }

    /**
     * createRunnerFor
     *
     * @param CollectionInterface $collection
     *
     * @return CollectionRunner
     */
    final protected function createRunnerFor(CollectionInterface $collection) {
        return $this->factory->create($collection);
    }
}


text:
var connection = require('./db.js');
var uuid = require('node-uuid');

/*
 * 集合`users`的文档`User`构造函数
 * @param {Object} user: 包含用户信息的一个对象
 */
function User(user) {
	this.id=user.id;
	this.name = user.name;
	this.password = user.password;
}

User.getUserByName = function (username, callback) {
	var selectSql = 'select * from user where user_name = ?';
	connection.query(selectSql, [username], function (err, result) {
		if (err) {
			console.log('getUserbyUsername err:' + err);
			return;
		}

		console.log('Get name success'+result);
		var data=result[0];
		//console.log(data.id);
		callback(err, data);
	});
};
User.addUser= function (user, callback) {
	var id=uuid.v1();
	var selectSql = 'insert into user (id,user_name,password)  values (?,?,?)';

	connection.query(selectSql, [id,user.name,user.password], function (err, result) {
		if (err) {
			console.dir(err);
			console.log('addUser err:' + err);
			return;
		}
		console.log('Add User success');
		callback(err, result);
	});
};

module.exports = User;


text:
package org.springframework.richclient.form.binding.swing;

import java.util.Collections;

import javax.swing.JComboBox;
import javax.swing.event.ListDataEvent;

import org.springframework.binding.support.TestLabeledEnum;

public class LabeledEnumComboBoxBindingAbstractTests extends BindingAbstractTests {

    private LabeledEnumComboBoxBinding cbb;

    private JComboBox cb;

    protected String setUpBinding() {
        cbb = (LabeledEnumComboBoxBinding) new LabeledEnumComboBoxBinder().bind(fm, "enumProperty", Collections.EMPTY_MAP);
        cb = (JComboBox) cbb.getControl();
        return "enumProperty";
    }

    public void testValueModelUpdatesComponent() {
        TestListDataListener tldl = new TestListDataListener();
        cb.getModel().addListDataListener(tldl);

        assertEquals(null, cb.getSelectedItem());
        assertEquals(-1, cb.getSelectedIndex());
        tldl.assertCalls(0);

        vm.setValue(TestLabeledEnum.ONE);
        assertEquals(TestLabeledEnum.ONE, cb.getSelectedItem());
        assertEquals(1, cb.getSelectedIndex());
        tldl.assertEvent(1, ListDataEvent.CONTENTS_CHANGED, -1, -1);

        vm.setValue(TestLabeledEnum.TWO);
        assertEquals(TestLabeledEnum.TWO, cb.getSelectedItem());
        assertEquals(2, cb.getSelectedIndex());
        tldl.assertEvent(2, ListDataEvent.CONTENTS_CHANGED, -1, -1);

        vm.setValue(null);
        assertEquals(null, cb.getSelectedItem());
        assertEquals(-1, cb.getSelectedIndex());
        tldl.assertEvent(3, ListDataEvent.CONTENTS_CHANGED, -1, -1);

        vm.setValue(null);
        tldl.assertCalls(3);
    }

    public void testComponentUpdatesValueModel() {
        cb.setSelectedIndex(1);
        assertEquals(TestLabeledEnum.ONE, vm.getValue());

        cb.setSelectedItem(TestLabeledEnum.TWO);
        assertEquals(TestLabeledEnum.TWO, vm.getValue());

        cb.setSelectedIndex(-1);
        assertEquals(null, vm.getValue());
    }

    public void testComponentTracksEnabledChanges() {
        assertTrue(cb.isEnabled());

        fm.getFieldMetadata("enumProperty").setEnabled(false);
        assertFalse(cb.isEnabled());

        fm.getFieldMetadata("enumProperty").setEnabled(true);
        assertTrue(cb.isEnabled());
    }

    public void testComponentTracksReadOnlyChanges() {
        assertTrue(cb.isEnabled());

        fm.getFieldMetadata("enumProperty").setReadOnly(true);
        assertFalse(cb.isEnabled());

        fm.getFieldMetadata("enumProperty").setReadOnly(false);
        assertTrue(cb.isEnabled());
    }
}


text:
<?php

namespace spec\PhpSpec\Specification;

use PhpSpec\Specification;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;

class ErrorSpecificationSpec extends ObjectBehavior
{
    function it_is_a_specification()
    {
        $this->shouldHaveType(Specification::class);
    }
}


text:
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W28544_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans41.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">STATEMENT

    <p class="styleSans11.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">This statement is being sent in order to comply with NDAC 43-02-03-16 (Application for permit to drill and recomplete) which states (in part that) "confirmation that a legal street address has been requested for the well site, and well facility if separate from the well site, and the proposed road access to the nearest existing public road". On the date noted below a legal street address was requested from the appropriate county office.

    <p class="styleSans11.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Dunn County Denise Brew. Dunn County Emergency Manager / 911 Coordinator
Schettler l4X-9A, E. B. F. C. G. D Sec. 9-147N~96W

    <p class="styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Latitude: 47.560814 Longitude: 103.927833
May 13. 2014

    <p class="styleSans9.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans2.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">, _
Lisa Moore Permitting Analyst XTO Energy Inc.

    <p class="styleSans5.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">YTn Fnarnu Im-

    <p class="styleSans5.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">0 Dn an R'nl

    <p class="styleSans5.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">O anlmnmnrl r'n anl

    <p class="styleSans5.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">O (lfl'h 107-1600

    <p class="styleSans4.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans5.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Fav- WHY" 107-1900

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">


text:
<?php

include_once(plugin_dir_path(__FILE__) . 'model/partyRepository.php');

/**
 * Class Wp_Pirate_Parties
 */
class Wp_Pirate_Parties_List_Widget extends WP_Widget {
    private $linkTexts = [];

    private $links = [];

    function Wp_Pirate_Parties_List_Widget() {
        parent::__construct(false, $name = __('Pirate Parties List', 'wp-pirate-parties'));

        $this->linkTexts = array(
            'en' => __('Party name in english', 'wp-pirate-parties'),
            'native' => __('Party name in native languages', 'wp-pirate-parties'),
            'code' => __('Party Code', 'wp-pirate-parties'),
            'country' => __('Country Name', 'wp-pirate-parties'),
            'country_code' => __('Country Code', 'wp-pirate-parties'),
            'link' => __('Link dependent', 'wp-pirate-parties')
        );

        $this->links = array(
            'website' => __('Website', 'wp-pirate-parties'),
            'papi' => 'Papi',
            'no' => __('No Link', 'wp-pirate-parties'),
            'facebook' => 'Facebook',
            'twitter' => 'Twitter',
            'googlePlus' => 'Google+',
            'youtube' => 'Youtube',
            'irc' => 'IRC',
            'wiki' => 'Wiki',
            'forum' => 'Forum',
            'liquidfeedback' => 'LiquidFeedback',
            'contactGeneralEmail' => __('Contact generel E-Mail', 'wp-pirate-parties')
        );
    }

    /**
     * @param array $instance
     * @return bool
     */
    function form($instance) {
        // todo: use wp_parse_args?
        $title = '';
        $text = '';
        $showFlags = '';
        $linkText = '';
        $link = '';
        $displayOption = '';
        $hideNoLink = '';
        $ppiFilter = '';
        $ppeuFilter = '';
        if($instance) {
            $title = esc_attr($instance['title']);
            $text = esc_attr($instance['text']);
            $showFlags = esc_attr($instance['showFlags']);
            $linkText = esc_attr($instance['linkText']);
            $link = esc_attr($instance['link']);
            $displayOption = esc_attr($instance['displayOption']);
            $hideNoLink = esc_attr($instance['hideNoLink']);
            $ppiFilter = esc_attr($instance['ppiFilter']);
            $ppeuFilter = esc_attr($instance['ppeuFilter']);
        }

        ob_start();
        include(plugin_dir_path(__FILE__) . 'view/listWidgetForm.php');
        $output = ob_get_clean();
        echo $output;

        return true;
    }

    /**
     * @param array $new_instance
     * @param array $old_instance
     * @return array
     */
    function update($new_instance, $old_instance) {
        $instance = $old_instance;
        $instance['title'] = strip_tags($new_instance['title']);
        $instance['text'] = $new_instance['text'];
        $instance['showFlags'] = strip_tags($new_instance['showFlags']);
        $instance['linkText'] = strip_tags($new_instance['linkText']);
        $instance['link'] = strip_tags($new_instance['link']);
        $instance['displayOption'] = strip_tags($new_instance['displayOption']);
        $instance['hideNoLink'] = strip_tags($new_instance['hideNoLink']);
        $instance['ppiFilter'] = strip_tags($new_instance['ppiFilter']);
        $instance['ppeuFilter'] = strip_tags($new_instance['ppeuFilter']);
        return $instance;
    }

    /**
     * @param array $args
     * @param array $instance
     */
    function widget($args, $instance) {
        /**
         * @var $before_title
         * @var $after_title
         * @var $before_widget
         * @var $after_widget
         */
        extract($args);

        $title = apply_filters('widget_title', $instance['title']);
        $text = $instance['text'];
        $showFlags = $instance['showFlags'];
        $linkText = $instance['linkText'];
        $link = $instance['link'];
        $displayOption = $instance['displayOption'];
        $hideNoLink = $instance['hideNoLink'];
        $ppiFilter = $instance['ppiFilter'];
        $ppeuFilter = $instance['ppeuFilter'];

        $partyRepository = new PartyRepository();
        $parties = $partyRepository->getParties($ppiFilter, $ppeuFilter, $linkText);

        ob_start();
        include(plugin_dir_path(__FILE__) . 'view/listWidget.php');
        $output = ob_get_clean();
        echo $output;
    }

}

// register widget
add_action('widgets_init', function() {
    register_widget('Wp_Pirate_Parties_List_Widget');
});


text:
<?php

namespace PHPUnit\Runner;

use File_Iterator_Facade;
use PHPUnit\Framework\Exception;
use PHPUnit\Framework\TestSuite;
use PHPUnit\Framework\Test;
use ReflectionClass;
use ReflectionException;

/**
 * Base class for all test runners.
 */
abstract class BaseTestRunner
{
    const STATUS_PASSED     = 0;
    const STATUS_SKIPPED    = 1;
    const STATUS_INCOMPLETE = 2;
    const STATUS_FAILURE    = 3;
    const STATUS_ERROR      = 4;
    const STATUS_RISKY      = 5;
    const STATUS_WARNING    = 6;
    const SUITE_METHODNAME  = 'suite';

    /**
     * Returns the loader to be used.
     *
     * @return TestSuiteLoader
     */
    public function getLoader()
    {
        return new StandardTestSuiteLoader;
    }

    /**
     * Returns the Test corresponding to the given suite.
     * This is a template method, subclasses override
     * the runFailed() and clearStatus() methods.
     *
     * @param string $suiteClassName
     * @param string $suiteClassFile
     * @param mixed  $suffixes
     *
     * @return Test
     */
    public function getTest($suiteClassName, $suiteClassFile = '', $suffixes = '')
    {
        if (is_dir($suiteClassName) &&
            !is_file($suiteClassName . '.php') && empty($suiteClassFile)) {
            $facade = new File_Iterator_Facade;
            $files  = $facade->getFilesAsArray(
                $suiteClassName,
                $suffixes
            );

            $suite = new TestSuite($suiteClassName);
            $suite->addTestFiles($files);

            return $suite;
        }

        try {
            $testClass = $this->loadSuiteClass(
                $suiteClassName,
                $suiteClassFile
            );
        } catch (Exception $e) {
            $this->runFailed($e->getMessage());

            return;
        }

        try {
            $suiteMethod = $testClass->getMethod(self::SUITE_METHODNAME);

            if (!$suiteMethod->isStatic()) {
                $this->runFailed(
                    'suite() method must be static.'
                );

                return;
            }

            try {
                $test = $suiteMethod->invoke(null, $testClass->getName());
            } catch (ReflectionException $e) {
                $this->runFailed(
                    sprintf(
                        "Failed to invoke suite() method.\n%s",
                        $e->getMessage()
                    )
                );

                return;
            }
        } catch (ReflectionException $e) {
            try {
                $test = new TestSuite($testClass);
            } catch (Exception $e) {
                $test = new TestSuite;
                $test->setName($suiteClassName);
            }
        }

        $this->clearStatus();

        return $test;
    }

    /**
     * Returns the loaded ReflectionClass for a suite name.
     *
     * @param string $suiteClassName
     * @param string $suiteClassFile
     *
     * @return ReflectionClass
     */
    protected function loadSuiteClass($suiteClassName, $suiteClassFile = '')
    {
        $loader = $this->getLoader();

        return $loader->load($suiteClassName, $suiteClassFile);
    }

    /**
     * Clears the status message.
     */
    protected function clearStatus()
    {
    }

    /**
     * Override to define how to handle a failed loading of
     * a test suite.
     *
     * @param string $message
     */
    abstract protected function runFailed($message);
}


text:
namespace REST {

namespace Dispatchers {

int Uniform::next_worker_id() {
  return distribution(engine);
}

}

}


text:
require('babel-register')();

import gulp from 'gulp';
import {exec} from 'child_process';
import fs from 'fs';
import path from 'path';

import gulpLoadPlugins from 'gulp-load-plugins';
import browserify from 'browserify';
import babelify from 'babelify';
import del from 'del';
import Promise from 'bluebird';
import srcStream from 'vinyl-source-stream';
const $ = gulpLoadPlugins();
const pkg = JSON.parse(fs.readFileSync('./package.json'));

function lint(files, options) {
    return () => {
        return gulp.src(files)
      .pipe($.eslint(options))
      .pipe($.eslint.format());
    };
}

gulp.task('clean', del.bind(null, ['build', `${pkg.name}-*.tgz`]));

gulp.task('lint', lint(['src/{,*/}*.js{,x}']));

gulp.task('npmpack', ['build'], () => {
    return new Promise((resolve, reject) => {
        exec('npm pack', (err, stdout) => {
            if (err) {
                reject(err);
            } else {
                resolve(stdout.toString());
            }
        });
    });
});

gulp.task('demoInstall', ['npmpack'], () => {
    return new Promise((resolve, reject) => {
        exec(`npm install ../${pkg.name}-${pkg.version}.tgz`, {
            cwd: path.join(__dirname, 'example')
        }, (err, stdout) => {
            if (err) {
                reject(err);
            } else {
                resolve(stdout.toString());
            }
        });
    });
});

gulp.task('demoBuild', ['demoInstall'], () => {
    return browserify({
        entries: 'example/demo.jsx',
        debug: true,
        transform: [babelify]
    }).bundle()
    .pipe(srcStream('demo.bundle.js'))
    .pipe(gulp.dest('example'));

});

gulp.task('demo', ['demoBuild', 'watch'], () => {
    return $.connect.server({
        root: 'example',
        livereload: true
    });
});

gulp.task('watch', () => {
    return gulp.watch(['example/*.html', 'src/{,*/}*.js{,x}', 'example/demo.jsx'], ['demoBuild']);
});

gulp.task('build', ['clean', 'lint'], () => {

    return gulp.src('src/{,*/}*.js{,x}')
        .pipe($.plumber())
        .pipe($.babel())
        .pipe(gulp.dest('build/'));
});


text:
@interface NSDictionary (STAControls)

// Returns nil instead of [NSNull null].
- (id)objectForKeyNotNull:(id)key;

// Returnes BOOL value denoting if key is present.
- (BOOL)containsKey:(id)key;

@end


text:
/*
 * 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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.notebooks.v1.model;

/**
 * The definition of a schedule.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Notebooks API. For a detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class Schedule extends com.google.api.client.json.GenericJson {

  /**
   * Output only. Time the schedule was created.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String createTime;

  /**
   * Cron-tab formatted schedule by which the job will execute. Format: minute, hour, day of month,
   * month, day of week, e.g. 0 0 * * WED = every Wednesday More examples:
   * https://crontab.guru/examples.html
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String cronSchedule;

  /**
   * A brief description of this environment.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String description;

  /**
   * Output only. Display name used for UI purposes. Name can only contain alphanumeric characters,
   * hyphens '-', and underscores '_'.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String displayName;

  /**
   * Notebook Execution Template corresponding to this schedule.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private ExecutionTemplate executionTemplate;

  /**
   * Output only. The name of this schedule. Format:
   * `projects/{project_id}/locations/{location}/schedules/{schedule_id}`
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String name;

  /**
   * Output only. The most recent execution names triggered from this schedule and their
   * corresponding states.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<Execution> recentExecutions;

  static {
    // hack to force ProGuard to consider Execution used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(Execution.class);
  }

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String state;

  /**
   * Timezone on which the cron_schedule. The value of this field must be a time zone name from the
   * tz database. TZ Database: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones Note
   * that some time zones include a provision for daylight savings time. The rules for daylight
   * saving time are determined by the chosen tz. For UTC use the string "utc". If a time zone is
   * not specified, the default will be in UTC (also known as GMT).
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String timeZone;

  /**
   * Output only. Time the schedule was last updated.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String updateTime;

  /**
   * Output only. Time the schedule was created.
   * @return value or {@code null} for none
   */
  public String getCreateTime() {
    return createTime;
  }

  /**
   * Output only. Time the schedule was created.
   * @param createTime createTime or {@code null} for none
   */
  public Schedule setCreateTime(String createTime) {
    this.createTime = createTime;
    return this;
  }

  /**
   * Cron-tab formatted schedule by which the job will execute. Format: minute, hour, day of month,
   * month, day of week, e.g. 0 0 * * WED = every Wednesday More examples:
   * https://crontab.guru/examples.html
   * @return value or {@code null} for none
   */
  public java.lang.String getCronSchedule() {
    return cronSchedule;
  }

  /**
   * Cron-tab formatted schedule by which the job will execute. Format: minute, hour, day of month,
   * month, day of week, e.g. 0 0 * * WED = every Wednesday More examples:
   * https://crontab.guru/examples.html
   * @param cronSchedule cronSchedule or {@code null} for none
   */
  public Schedule setCronSchedule(java.lang.String cronSchedule) {
    this.cronSchedule = cronSchedule;
    return this;
  }

  /**
   * A brief description of this environment.
   * @return value or {@code null} for none
   */
  public java.lang.String getDescription() {
    return description;
  }

  /**
   * A brief description of this environment.
   * @param description description or {@code null} for none
   */
  public Schedule setDescription(java.lang.String description) {
    this.description = description;
    return this;
  }

  /**
   * Output only. Display name used for UI purposes. Name can only contain alphanumeric characters,
   * hyphens '-', and underscores '_'.
   * @return value or {@code null} for none
   */
  public java.lang.String getDisplayName() {
    return displayName;
  }

  /**
   * Output only. Display name used for UI purposes. Name can only contain alphanumeric characters,
   * hyphens '-', and underscores '_'.
   * @param displayName displayName or {@code null} for none
   */
  public Schedule setDisplayName(java.lang.String displayName) {
    this.displayName = displayName;
    return this;
  }

  /**
   * Notebook Execution Template corresponding to this schedule.
   * @return value or {@code null} for none
   */
  public ExecutionTemplate getExecutionTemplate() {
    return executionTemplate;
  }

  /**
   * Notebook Execution Template corresponding to this schedule.
   * @param executionTemplate executionTemplate or {@code null} for none
   */
  public Schedule setExecutionTemplate(ExecutionTemplate executionTemplate) {
    this.executionTemplate = executionTemplate;
    return this;
  }

  /**
   * Output only. The name of this schedule. Format:
   * `projects/{project_id}/locations/{location}/schedules/{schedule_id}`
   * @return value or {@code null} for none
   */
  public java.lang.String getName() {
    return name;
  }

  /**
   * Output only. The name of this schedule. Format:
   * `projects/{project_id}/locations/{location}/schedules/{schedule_id}`
   * @param name name or {@code null} for none
   */
  public Schedule setName(java.lang.String name) {
    this.name = name;
    return this;
  }

  /**
   * Output only. The most recent execution names triggered from this schedule and their
   * corresponding states.
   * @return value or {@code null} for none
   */
  public java.util.List<Execution> getRecentExecutions() {
    return recentExecutions;
  }

  /**
   * Output only. The most recent execution names triggered from this schedule and their
   * corresponding states.
   * @param recentExecutions recentExecutions or {@code null} for none
   */
  public Schedule setRecentExecutions(java.util.List<Execution> recentExecutions) {
    this.recentExecutions = recentExecutions;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public java.lang.String getState() {
    return state;
  }

  /**
   * @param state state or {@code null} for none
   */
  public Schedule setState(java.lang.String state) {
    this.state = state;
    return this;
  }

  /**
   * Timezone on which the cron_schedule. The value of this field must be a time zone name from the
   * tz database. TZ Database: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones Note
   * that some time zones include a provision for daylight savings time. The rules for daylight
   * saving time are determined by the chosen tz. For UTC use the string "utc". If a time zone is
   * not specified, the default will be in UTC (also known as GMT).
   * @return value or {@code null} for none
   */
  public java.lang.String getTimeZone() {
    return timeZone;
  }

  /**
   * Timezone on which the cron_schedule. The value of this field must be a time zone name from the
   * tz database. TZ Database: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones Note
   * that some time zones include a provision for daylight savings time. The rules for daylight
   * saving time are determined by the chosen tz. For UTC use the string "utc". If a time zone is
   * not specified, the default will be in UTC (also known as GMT).
   * @param timeZone timeZone or {@code null} for none
   */
  public Schedule setTimeZone(java.lang.String timeZone) {
    this.timeZone = timeZone;
    return this;
  }

  /**
   * Output only. Time the schedule was last updated.
   * @return value or {@code null} for none
   */
  public String getUpdateTime() {
    return updateTime;
  }

  /**
   * Output only. Time the schedule was last updated.
   * @param updateTime updateTime or {@code null} for none
   */
  public Schedule setUpdateTime(String updateTime) {
    this.updateTime = updateTime;
    return this;
  }

  @Override
  public Schedule set(String fieldName, Object value) {
    return (Schedule) super.set(fieldName, value);
  }

  @Override
  public Schedule clone() {
    return (Schedule) super.clone();
  }

}


text:
#include "tensorflow/lite/testing/kernel_test/input_generator.h"

#include <cstdio>
#include <fstream>
#include <limits>
#include <random>
#include <string>
#include <unordered_map>
#include <utility>

#include "tensorflow/lite/core/c/c_api_types.h"
#include "tensorflow/lite/core/c/common.h"
#include "tensorflow/lite/kernels/register.h"
#include "tensorflow/lite/testing/join.h"
#include "tensorflow/lite/testing/split.h"

namespace tflite {
namespace testing {

namespace {
static constexpr char kDefaultServingSignatureDefKey[] = "serving_default";

template <typename T>
std::vector<T> GenerateRandomTensor(TfLiteIntArray* dims,
                                    const std::function<T(int)>& random_func) {
  int64_t num_elements = 1;
  for (int i = 0; i < dims->size; i++) {
    num_elements *= dims->data[i];
  }

  std::vector<T> result(num_elements);
  for (int i = 0; i < num_elements; i++) {
    result[i] = random_func(i);
  }
  return result;
}

template <typename T>
std::vector<T> GenerateUniform(TfLiteIntArray* dims, float min, float max) {
  auto random_float = [](float min, float max) {
    // TODO(yunluli): Change seed for each invocation if needed.
    // Used rand() instead of rand_r() here to make it runnable on android.
    return min + (max - min) * static_cast<float>(rand()) / RAND_MAX;
  };

  std::function<T(int)> random_t = [&](int) {
    return static_cast<T>(random_float(min, max));
  };
  std::vector<T> data = GenerateRandomTensor(dims, random_t);
  return data;
}

template <typename T>
std::vector<T> GenerateGaussian(TfLiteIntArray* dims, float min, float max) {
  auto random_float = [](float min, float max) {
    static std::default_random_engine generator;
    // We generate a float number within [0, 1) following a mormal distribution
    // with mean = 0.5 and stddev = 1/3, and use it to scale the final random
    // number into the desired range.
    static std::normal_distribution<double> distribution(0.5, 1.0 / 3);
    auto rand_n = distribution(generator);
    while (rand_n < 0 || rand_n >= 1) {
      rand_n = distribution(generator);
    }

    return min + (max - min) * static_cast<float>(rand_n);
  };

  std::function<T(int)> random_t = [&](int) {
    return static_cast<T>(random_float(min, max));
  };
  std::vector<T> data = GenerateRandomTensor(dims, random_t);
  return data;
}

}  // namespace

TfLiteStatus InputGenerator::LoadModel(const string& model_dir) {
  return LoadModel(model_dir, kDefaultServingSignatureDefKey);
}

TfLiteStatus InputGenerator::LoadModel(const string& model_dir,
                                       const string& signature) {
  model_ = FlatBufferModel::BuildFromFile(model_dir.c_str());
  if (!model_) {
    fprintf(stderr, "Cannot load model %s", model_dir.c_str());
    return kTfLiteError;
  }

  ::tflite::ops::builtin::BuiltinOpResolver builtin_ops;
  InterpreterBuilder(*model_, builtin_ops)(&interpreter_);
  if (!interpreter_) {
    fprintf(stderr, "Failed to build interpreter.");
    return kTfLiteError;
  }
  signature_runner_ = interpreter_->GetSignatureRunner(signature.c_str());
  if (!signature_runner_) {
    fprintf(stderr, "Failed to get SignatureRunner.\n");
    return kTfLiteError;
  }

  return kTfLiteOk;
}

TfLiteStatus InputGenerator::ReadInputsFromFile(const string& filename) {
  if (filename.empty()) {
    fprintf(stderr, "Empty input file name.");
    return kTfLiteError;
  }

  std::ifstream input_file(filename);
  string input;
  while (std::getline(input_file, input, '\n')) {
    std::vector<string> parts = Split<string>(input, ":");
    if (parts.size() != 2) {
      fprintf(stderr, "Expected <name>:<value>, got %s", input.c_str());
      return kTfLiteError;
    }
    inputs_.push_back(std::make_pair(parts[0], parts[1]));
  }
  input_file.close();
  return kTfLiteOk;
}

TfLiteStatus InputGenerator::WriteInputsToFile(const string& filename) {
  if (filename.empty()) {
    fprintf(stderr, "Empty input file name.");
    return kTfLiteError;
  }

  std::ofstream output_file;
  output_file.open(filename, std::fstream::out | std::fstream::trunc);
  if (!output_file) {
    fprintf(stderr, "Failed to open output file %s.", filename.c_str());
    return kTfLiteError;
  }

  for (const auto& input : inputs_) {
    output_file << input.first << ":" << input.second << "\n";
  }
  output_file.close();

  return kTfLiteOk;
}

// TODO(yunluli): Support more tensor types when needed.
TfLiteStatus InputGenerator::GenerateInput(const string& distribution) {
  auto input_tensor_names = signature_runner_->input_names();
  for (const char* name : input_tensor_names) {
    auto* tensor = signature_runner_->input_tensor(name);
    if (distribution == "UNIFORM") {
      switch (tensor->type) {
        case kTfLiteInt8: {
          auto data = GenerateUniform<int8_t>(
              tensor->dims, std::numeric_limits<int8_t>::min(),
              std::numeric_limits<int8_t>::max());
          inputs_.push_back(
              std::make_pair(name, Join(data.data(), data.size(), ",")));
          break;
        }
        case kTfLiteUInt8: {
          auto data = GenerateUniform<uint8_t>(
              tensor->dims, std::numeric_limits<uint8_t>::min(),
              std::numeric_limits<uint8_t>::max());
          inputs_.push_back(
              std::make_pair(name, Join(data.data(), data.size(), ",")));
          break;
        }
        case kTfLiteFloat32: {
          auto data = GenerateUniform<float>(tensor->dims, -1, 1);
          inputs_.push_back(
              std::make_pair(name, Join(data.data(), data.size(), ",")));
          break;
        }
        default:
          fprintf(stderr, "Unsupported input tensor type %s.",
                  TfLiteTypeGetName(tensor->type));
          break;
      }
    } else if (distribution == "GAUSSIAN") {
      switch (tensor->type) {
        case kTfLiteInt8: {
          auto data = GenerateGaussian<int8_t>(
              tensor->dims, std::numeric_limits<int8_t>::min(),
              std::numeric_limits<int8_t>::max());
          inputs_.push_back(
              std::make_pair(name, Join(data.data(), data.size(), ",")));
          break;
        }
        case kTfLiteUInt8: {
          auto data = GenerateGaussian<uint8_t>(
              tensor->dims, std::numeric_limits<uint8_t>::min(),
              std::numeric_limits<uint8_t>::max());
          inputs_.push_back(
              std::make_pair(name, Join(data.data(), data.size(), ",")));
          break;
        }
        case kTfLiteFloat32: {
          auto data = GenerateGaussian<float>(tensor->dims, -1, 1);
          inputs_.push_back(
              std::make_pair(name, Join(data.data(), data.size(), ",")));
          break;
        }
        default:
          fprintf(stderr, "Unsupported input tensor type %s.",
                  TfLiteTypeGetName(tensor->type));
          break;
      }
    } else {
      fprintf(stderr, "Unsupported distribution %s.", distribution.c_str());
      return kTfLiteError;
    }
  }

  return kTfLiteOk;
}

}  // namespace testing
}  // namespace tflite


text:
status: publish
tags:
- gmail
- imap
- mozilla
- tech
- websights
published: true
title: GMail introduces IMAP
type: post
meta:
  tags: ""
layout: post
---
Oh, how long have I waited for this! Almost three years ago, I blogged about the then newly-introduced POP access for GMail (German) and, to summarize it for you, my conclusion was that POP does not sufficiently support GMail's specialities, in particular the big storage capacity (downloading tons of mail is no fun) and tagging (which could easily be replicated in IMAP folders).

Now, three years later, GMail implements IMAP and with that, in my opinion, GMail has become a global player in email that now actually deserves the name.

IMAP features are mapped to GMail features reasonably, for example tags to folders as I suggested, or IMAP flags to GMail "stars".

To test, I connected to my account with Thunderbird, and as far as I can tell now, it works nice and quickly. Good job, Google!

According to Jean Pierre, IMAP is not enabled for all users yet, but I assume everybody will get the feature soon. Once you do, make sure to check it out!


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
org.springframework.beans.support (Spring Framework)
</TITLE>

<META NAME="keywords" CONTENT="org.springframework.beans.support package">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Package org.springframework.beans.support

Classes supporting the org.springframework.beans package,
such as utility classes for sorting and holding lists of beans.

See:

          Description

Interface Summary

PagedListSourceProvider
Callback that provides the source for a reloadable List.

SortDefinition
Definition for sorting bean instances by a property.

Class Summary

ArgumentConvertingMethodInvoker
Subclass of MethodInvoker that tries to convert the given arguments
 for the actual target method via BeanWrapperImpl.

MutableSortDefinition
Mutable implementation of SortDefinition.

PagedListHolder
PagedListHolder is a simple state holder for handling lists of objects,
 separating them into pages.

PropertyComparator
PropertyComparator performs a comparison of two beans,
 using the specified bean property via a BeanWrapper.

RefreshablePagedListHolder
RefreshablePagedListHolder is a PagedListHolder subclass with reloading capabilities.

Package org.springframework.beans.support Description

Classes supporting the org.springframework.beans package,
such as utility classes for sorting and holding lists of beans.

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Copyright (C) 2003-2004 The Spring Framework Project.


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <title>Corona Docs: guide > graphics > changes</title>
  <meta name="revised" content="14-Nov-2013" />
  <meta name="description" content="Whether you're new to Corona or want to take your app to the next level, we've got a wealth of resources for you including extensive documentation, API reference, sample code, and videos.  guide > graphics > changes" />
  <link rel="stylesheet" href="../../css/style.css" type="text/css" />

SDK APIs

Enterprise APIs

Plugins

Guides

Tutorials

Corona Resources ▹

  <form action="http://www.google.com/cse" id="cse-search-box">
  <input type="hidden" name="cx" value="009283852522218786394:g40gqt2m6rq" />
  <input type="hidden" name="ie" value="UTF-8" />
  <input type="text" name="q" id="q" autocomplete="off" size="40" style="width:150px;float:left" />
  <input type="submit" name="sa" value="Search" style="float:right; font-size: 13px;" />
  </form>

Changes since the previous release

Many shaders were moved out of "filters" and into "composite" and "generator".

"filter.colorChannelOffset" has changed parameters.

Ξ  ▸  guide  ▸  [graphics][guide.graphics]  ▸  changes

Changes since the previous release

Many shaders were moved out of "filters" and into "composite" and "generator".

For example, you should change: "filter.saturation" to "composite.saturation".

Here's the complete list of shaders:

filter

bloom

blur

blurGaussian

blurHorizontal

blurVertical

brightness

bulge

chromaKey

colorChannelOffset

contrast

crosshatch

crystallize

desaturate

dissolve

duotone

emboss

exposure

frostedGlass

grayscale

hue

invert

iris

levels

linearWipe

median

monotone

opTile

pixelate

polkaDots

posterize

radialWipe

saturate

scatter

sepia

sharpenLuminance

sobel

straighten

swirl

vignette

wobble

woodCut

zoomBlur

generator

checkerboard

lenticularHalo

linearGradient

marchingAnts

perlinNoise

radialGradient

random

stripes

sunbeams

composite

add

average

color

colorBurn

colorDodge

darken

difference

exclusion

glow

hardLight

hardMix

hue

lighten

linearLight

luminosity

multiply

negation

normalMapWith1DirLight

normalMapWith1PointLight

overlay

phoenix

pinLight

reflect

saturation

screen

softLight

subtract

vividLight

yuv420f

"filter.colorChannelOffset" has changed parameters.

The "xDirection" and "yDirection" parameters were renamed to "xTexels" and "yTexels".

© 2013 Corona Labs Inc. All Rights Reserved. (Last updated: 14-Nov-2013)

Help us help you! Give us feedback on this page:

Love it

Like it, but...

Hate it


text:
OC.L10N.register(
    "comments",
    {
    "Type in a new comment..." : "Digita un nuovo commento...",
    "Delete comment" : "Elimina commento",
    "Post" : "Commento",
    "Cancel" : "Annulla",
    "Edit comment" : "Modifica commento",
    "[Deleted user]" : "[Utente eliminato]",
    "Comments" : "Commenti",
    "No other comments available" : "Non sono disponibili altri commenti",
    "More comments..." : "Altri commenti...",
    "Save" : "Salva",
    "Allowed characters {count} of {max}" : "Caratteri consentiti {count} di {max}",
    "Error occurred while retrieving comment with id {id}" : "Si è verificato un errore durante il tentativo di recupero del commento con id {id}",
    "Error occurred while updating comment with id {id}" : "Si è verificato un errore durante il tentativo di aggiornamento del commento con id {id}",
    "Error occurred while posting comment" : "Si è verificato un errore durante la pubblicazione del commento.",
    "{count} unread comments" : "{count} commenti non letti",
    "Comment" : "Commento",
    "Comments for files (always listed in stream)" : "Commenti sui file (elencati sempre nel flusso)",
    "You commented" : "Hai commentato",
    "%1$s commented" : "%1$s ha commentato",
    "You commented on %2$s" : "Hai commentato su %2$s",
    "%1$s commented on %2$s" : "%1$s ha commentato %2$s"
},
"nplurals=2; plural=(n != 1);");


text:
import { WatsonHealthWindowPreset32 } from "../../../";

export = WatsonHealthWindowPreset32;