text:
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * DNS Library for handling lookups and updates.
 *
 * PHP Version 5
 *
 * Copyright (c) 2010, Mike Pultz <mike@mikepultz.com>.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *   * Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *
 *   * Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in
 *     the documentation and/or other materials provided with the
 *     distribution.
 *
 *   * Neither the name of Mike Pultz nor the names of his contributors
 *     may be used to endorse or promote products derived from this
 *     software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRIC
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 * @category  Networking
 * @package   Net_DNS2
 * @author    Mike Pultz <mike@mikepultz.com>
 * @copyright 2010 Mike Pultz <mike@mikepultz.com>
 * @license   http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version   SVN: $Id: RRSIG.php 127 2011-12-03 03:29:39Z mike.pultz $
 * @link      http://pear.php.net/package/Net_DNS2
 * @since     File available since Release 0.6.0
 *
 * This file contains code based off the Net::DNS::SEC Perl module by
 * Olaf M. Kolkman
 *
 * This is the copyright notice from the PERL Net::DNS::SEC module:
 *
 * Copyright (c) 2001 - 2005  RIPE NCC.  Author Olaf M. Kolkman
 * Copyright (c) 2007 - 2008  NLnet Labs.  Author Olaf M. Kolkman
 * <olaf@net-dns.org>
 *
 * All Rights Reserved
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose and without fee is hereby granted,
 * provided that the above copyright notice appear in all copies and that
 * both that copyright notice and this permission notice appear in
 * supporting documentation, and that the name of the author not be
 * used in advertising or publicity pertaining to distribution of the
 * software without specific, written prior permission.
 *
 * THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
 * AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
 */

/**
 * RRSIG Resource Record - RFC4034 sction 3.1
 *
 *    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *   |        Type Covered           |  Algorithm    |     Labels    |
 *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *   |                         Original TTL                          |
 *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *   |                      Signature Expiration                     |
 *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *   |                      Signature Inception                      |
 *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *   |            Key Tag            |                               /
 *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+         Signer's Name         /
 *   /                                                               /
 *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *   /                                                               /
 *   /                            Signature                          /
 *   /                                                               /
 *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *
 * @category Networking
 * @package  Net_DNS2
 * @author   Mike Pultz <mike@mikepultz.com>
 * @license  http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @link     http://pear.php.net/package/Net_DNS2
 * @see      Net_DNS2_RR
 *
 */
class Net_DNS2_RR_RRSIG extends Net_DNS2_RR
{
    /*
     * the RR type covered by this signature
     */
    public $typecovered;

    /*
     * the algorithm used for the signature
     */
    public $algorithm;

    /*
     * the number of labels in the name
     */
    public $labels;

    /*
     * the original TTL
     */
    public $origttl;

    /*
     * the signature expiration
     */
    public $sigexp;

    /*
     * the inception of the signature
    */
    public $sigincep;

    /*
     * the keytag used
     */
    public $keytag;

    /*
     * the signer's name
     */
    public $signname;

    /*
     * the signature
     */
    public $signature;

    /**
     * method to return the rdata portion of the packet as a string
     *
     * @return  string
     * @access  protected
     *
     */
    protected function rrToString()
    {
        return $this->typecovered . ' ' . $this->algorithm . ' ' .
            $this->labels . ' ' . $this->origttl . ' ' .
            $this->sigexp . ' ' . $this->sigincep . ' ' .
            $this->keytag . ' ' . $this->cleanString($this->signname) . '. ' .
            $this->signature;
    }

    /**
     * parses the rdata portion from a standard DNS config line
     *
     * @param array $rdata a string split line of values for the rdata
     *
     * @return boolean
     * @access protected
     *
     */
    protected function rrFromString(array $rdata)
    {
        $this->typecovered  = strtoupper(array_shift($rdata));
        $this->algorithm    = array_shift($rdata);
        $this->labels       = array_shift($rdata);
        $this->origttl      = array_shift($rdata);
        $this->sigexp       = array_shift($rdata);
        $this->sigincep     = array_shift($rdata);
        $this->keytag       = array_shift($rdata);
        $this->signname     = $this->cleanString(array_shift($rdata));

        foreach ($rdata as $line) {

            $this->signature .= $line;
        }

        $this->signature = trim($this->signature);

        return true;
    }

    /**
     * parses the rdata of the Net_DNS2_Packet object
     *
     * @param Net_DNS2_Packet &$packet a Net_DNS2_Packet packet to parse the RR from
     *
     * @return boolean
     * @access protected
     *
     */
    protected function rrSet(Net_DNS2_Packet &$packet)
    {
        if ($this->rdlength > 0) {

            //
            // unpack
            //
            $x = unpack(
                'ntc/Calgorithm/Clabels/Norigttl/Nsigexp/Nsigincep/nkeytag',
                $this->rdata
            );

            $this->typecovered  = Net_DNS2_Lookups::$rr_types_by_id[$x['tc']];
            $this->algorithm    = $x['algorithm'];
            $this->labels       = $x['labels'];
            $this->origttl      = $x['origttl'];

            //
            // the dates are in GM time
            //
            $this->sigexp       = gmdate('YmdHis', $x['sigexp']);
            $this->sigincep     = gmdate('YmdHis', $x['sigincep']);

            //
            // get the keytag
            //
            $this->keytag       = $x['keytag'];

            //
            // get teh signers name and signature
            //
            $offset             = $packet->offset + 18;
            $sigoffset          = $offset;

            $this->signname     = strtolower(
                Net_DNS2_Packet::expand($packet, $sigoffset)
            );
            $this->signature    = base64_encode(
                substr($this->rdata, 18 + ($sigoffset - $offset))
            );

            return true;
        }

        return false;
    }

    /**
     * returns the rdata portion of the DNS packet
     *
     * @param Net_DNS2_Packet &$packet a Net_DNS2_Packet packet use for
     *                                 compressed names
     *
     * @return mixed                   either returns a binary packed
     *                                 string or null on failure
     * @access protected
     *
     */
    protected function rrGet(Net_DNS2_Packet &$packet)
    {
        if (strlen($this->signature) > 0) {

            //
            // parse the values out of the dates
            //
            preg_match(
                '/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/', $this->sigexp, $e
            );
            preg_match(
                '/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/', $this->sigincep, $i
            );

            //
            // pack the value
            //
            $data = pack(
                'nCCNNNn',
                Net_DNS2_Lookups::$rr_types_by_name[$this->typecovered],
                $this->algorithm,
                $this->labels,
                $this->origttl,
                gmmktime($e[4], $e[5], $e[6], $e[2], $e[3], $e[1]),
                gmmktime($i[4], $i[5], $i[6], $i[2], $i[3], $i[1]),
                $this->keytag
            );

            //
            // the signer name is special; it's not allowed to be compressed
            // (see section 3.1.7)
            //
            $names = explode('.', strtolower($this->signname));
            foreach ($names as $name) {

                $data .= chr(strlen($name));
                $data .= $name;
            }
            $data .= "\0";

            //
            // add the signature
            //
            $data .= base64_decode($this->signature);

            return $data;
        }

        return null;
    }
}

/*
 * Local variables:
 * tab-width: 4
 * c-basic-offset: 4
 * c-hanging-comment-ender-p: nil
 * End:
 */
?>


text:
package com.google.cloud.videointelligence.v1p2beta1;

import com.google.common.base.Preconditions;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.Test;

@javax.annotation.Generated("by GAPIC")
public class VideoIntelligenceServiceSmokeTest {
  private static final String PROJECT_ENV_NAME = "GOOGLE_CLOUD_PROJECT";
  private static final String LEGACY_PROJECT_ENV_NAME = "GCLOUD_PROJECT";

  @Test
  public void run() {
    main(null);
  }

  public static void main(String args[]) {
    Logger.getLogger("").setLevel(Level.WARNING);
    try {
      executeNoCatch();
      System.out.println("OK");
    } catch (Exception e) {
      System.err.println("Failed with exception:");
      e.printStackTrace(System.err);
      System.exit(1);
    }
  }

  public static void executeNoCatch() throws Exception {
    try (VideoIntelligenceServiceClient client = VideoIntelligenceServiceClient.create()) {
      String inputUri = "gs://demomaker/cat.mp4";
      Feature featuresElement = Feature.LABEL_DETECTION;
      List<Feature> features = Arrays.asList(featuresElement);

      AnnotateVideoResponse response = client.annotateVideoAsync(inputUri, features).get();
    }
  }

  private static String getProjectId() {
    String projectId = System.getProperty(PROJECT_ENV_NAME, System.getenv(PROJECT_ENV_NAME));
    if (projectId == null) {
      projectId =
          System.getProperty(LEGACY_PROJECT_ENV_NAME, System.getenv(LEGACY_PROJECT_ENV_NAME));
    }
    Preconditions.checkArgument(projectId != null, "A project ID is required.");
    return projectId;
  }
}

redpajama_set_name: RedPajamaGithub


text:
<?php
App::uses('UsersController', 'Controller');

class TestUsersController extends UsersController
{
    public $autoRender = false;

    public function redirect($url, $status = null, $exit = true)
    {
        $this->redirectUrl = $url;
    }
}

class UsersControllerTestCase extends ControllerTestCase
{

    public $fixtures = array('app.user', 'app.group', 'app.program');

    public function setUp()
    {
        parent::setUp();

        $this->Users = new TestUsersController();
        $this->Users->constructClasses();
    }

    public function tearDown()
    {
        unset($this->Users);

        parent::tearDown();
    }

    protected function _mockUserAccess()
    {
        $users = $this->generate('Users', array(
            'components' => array(
                'Acl' => array('check'),
                'Session' => array('read'),
                'Auth' => array('user'),
                )));

        $users->Acl
        ->expects($this->any())
        ->method('check')
        ->will($this->returnValue('true'));

        $users->Session
        ->expects($this->any())
        ->method('read')
        ->will($this->returnValue('User'));

        return $users;
    }

    public function testIndex()
    {

    }

    public function testView()
    {

    }

    public function testAdd()
    {

    }

    public function testExport()
    {
        $expects = array(
            array(
                'User' => array(
                    'username' => 'oliv',
                    'email' => 'oliv@there.com'
                    ),
                'Group' => array(
                    'name' => 'Program Manager Group'
                    ),
                'InvitedBy' => array(
                    'username' => 'gerald'
                    )
                ),
            array(
                'User' => array(
                    'username' => 'mark',
                    'email' => 'mark@there.com'
                    ),
                'Group' => array(
                    'name' => 'Program Manager Group'
                    ),
                'InvitedBy' => array(
                    'username' => 'gerald'
                    )
                )
            );

        $users = $this->_mockUserAccess();
        $users->Auth
        ->staticExpects($this->at(1))
        ->method('user')
        ->with('group_id')
        ->will($this->returnValue(2));

        $users->Auth
        ->staticExpects($this->at(2))
        ->method('user')
        ->with('id')
        ->will($this->returnValue(1));
        $this->testAction("/users/export?filter_operator=any&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=o&filter_param%5B2%5D%5B1%5D=group_id&filter_param%5B2%5D%5B2%5D=is&filter_param%5B2%5D%5B3%5D=2");

        $this->vars['users'];

        $this->assertEqual(count($this->vars['users']), 2);
        $this->assertEqual($this->vars['users'], $expects);
    }

    public function testEdit_grant_unmatchable_reply_access()
    {
        $users = $this->generate('Users', array(
            'components' => array(
                'Acl' => array('check', 'allow', 'deny'),
                'Session' => array('read')
                ),
            'models' => array(
                'User' => array('exists', 'save'),
                )
            ));

        $mockedUser = array(
            'User' =>array(
                'id' => 1,
                'username' => 'jared'
                )
            );

        $users->Session
        ->expects($this->any())
        ->method('read')
        ->will($this->returnValue('User'));

        $users->User
        ->expects($this->once())
        ->method('exists')
        ->will($this->returnValue('true'));

        $users->User
        ->expects($this->once())
        ->method('save')
        ->with($mockedUser)
        ->will($this->returnValue($mockedUser));

        $users->Acl
        ->expects($this->once())
        ->method('allow')
        ->with($mockedUser,
            "controllers/UnmatchableReply")
        ->will($this->returnValue('true'));

        $users->Acl
        ->expects($this->once())
        ->method('check')
        ->will($this->returnValue('true'));

        $formUser = $mockedUser;
        $formUser['User']['unmatchable_reply_access'] = true;
        $formUser['User']['can_invite_users'] = false;

        $this->testAction("/users/edit/".$formUser['User']['id'],array(
            'method' => 'post',
            'data' => $formUser
            ));

        $this->assertContains('/users/index', $this->headers['Location']);
    }

    public function testEdit_deny_unmatchable_reply_access()
    {
        $users = $this->generate('Users', array(
            'components' => array(
                'Acl' => array('check', 'allow', 'deny'),
                'Session' => array('read')
                ),
            'models' => array(
                'User' => array('exists', 'save'),
                )
            ));

        $mockedUser = array(
            'User' =>array(
                'id' => 1,
                'username' => 'jared'
                )
            );

        $users->Session
        ->expects($this->any())
        ->method('read')
        ->will($this->returnValue('User'));

        $users->User
        ->expects($this->once())
        ->method('exists')
        ->will($this->returnValue('true'));

        $users->User
        ->expects($this->once())
        ->method('save')
        ->with($mockedUser)
        ->will($this->returnValue($mockedUser));

        $users->Acl
        ->expects($this->at(0))
        ->method('deny')
        ->with($mockedUser,
            "controllers/UnmatchableReply")
        ->will($this->returnValue('true'));

        $users->Acl
        ->expects($this->at(1))
        ->method('deny')
        ->with($mockedUser,
            "controllers/Users/index")
        ->will($this->returnValue('true'));

        $users->Acl
        ->expects($this->once())
        ->method('check')
        ->will($this->returnValue('true'));

        $formUser = $mockedUser;
        $formUser['User']['unmatchable_reply_access'] = false;
        $formUser['User']['can_invite_users'] = false;

        $this->testAction("/users/edit/".$formUser['User']['id'],array(
            'method' => 'post',
            'data' => $formUser
            ));

        $this->assertContains('/users/index', $this->headers['Location']);
    }

    public function testDelete()
    {

    }

    public function testChangePassword()
    {
        $hash = Configure::read('Security.salt');

        $users = $this->generate('Users', array(
            'components' => array(
                'Acl' => array('check'),
                'Session' => array('read')
                ),
            'models' => array(
                'User' => array('exists', 'read', 'save')
                )
            ));

        $users->Acl
        ->expects($this->any())
        ->method('check')
        ->will($this->returnValue('true'));

        $users->Session
        ->expects($this->any())
        ->method('read')
        ->will($this->returnValue('User'));

        $users->User
        ->expects($this->once())
        ->method('exists')
        ->will($this->returnValue('true'));

        $user = array(
            'User'=> array(
                'id' => 1,
                'password' => Security::hash($hash.'gerald')
                )
            );

        $users->User
        ->expects($this->once())
        ->method('read')
        ->will($this->returnValue($user));

        $users->User
        ->expects($this->once())
        ->method('save')
        ->with(array(
            'User' =>array(
                'id' => 1,
                'password' => 'jared'
                )
            ))
        ->will($this->returnValue('true'));

        $this->testAction("/users/changePassword/".$user['User']['id'],array(
            'method' => 'post',
            'data' => array(
                'id' => $user['User']['id'],
                'oldPassword' => 'gerald',
                'newPassword' => 'jared',
                'confirmNewPassword' => 'jared'
                )
            ));

        $this->assertContains('/users/view/', $this->headers['Location']);
    }

    public function testFilters_noResults()
    {
        // filter by username only
        $users = $this->_mockUserAccess();
        $users->Auth
        ->staticExpects($this->at(1))
        ->method('user')
        ->with('group_id')
        ->will($this->returnValue(2));

        $users->Auth
        ->staticExpects($this->at(2))
        ->method('user')
        ->with('id')
        ->will($this->returnValue(2));
        $this->testAction("/users/index?filter_operator=all&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=o");
        $this->assertEquals($this->vars['users'], array());
    }

     public function testFilters_notAdminAccess()
    {
        $expected = array(
            'id' => 3,
            'username' => 'mark',
            'password' => 'markpassword',
            'email' => 'mark@there.com',
            'group_id' => 2,
            'invited_by' => 'gerald', #the id is replace for display
            'created' => '2012-01-24 15:34:07',
            'modified' => '2012-01-24 15:34:07');

        // filter by username only not ADMIN access
        $users = $this->_mockUserAccess();
        $users->Auth
        ->staticExpects($this->at(1))
        ->method('user')
        ->with('group_id')
        ->will($this->returnValue(1));
        $this->testAction("/users/index?filter_operator=all&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=m");
        $this->assertEquals($this->vars['users'][0]['User'], $expected);
    }

    public function testFilters_onlyAdminAccess()
    {
        $expected = array(
            'id' => 2,
            'username' => 'oliv',
            'password' => 'olivpassword',
            'email' => 'oliv@there.com',
            'group_id' => 2,
            'invited_by' => 'gerald', #the id is replace for display
            'created' => '2012-01-24 15:34:07',
            'modified' => '2012-01-24 15:34:07');

        // filter by username only ADMIN access
        $users = $this->_mockUserAccess();
        $users->Auth
        ->staticExpects($this->at(1))
        ->method('user')
        ->with('group_id')
        ->will($this->returnValue(1));
        $this->testAction("/users/index?filter_operator=all&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=o");
        $this->assertEquals($this->vars['users'][0]['User'], $expected);
    }

    public function testFilters_byGroupId()
    {
        $expected = array(
            'id' => 1,
            'username' => 'gerald',
            'password' => 'geraldpassword',
            'email' => 'gerald@here.com',
            'group_id' => 1,
            'invited_by' => 'admin',   #the id is replace for display
            'created' => '2012-01-24 15:34:07',
            'modified' => '2012-01-24 15:34:07');

        //filter by group_id only
        $users = $this->_mockUserAccess();
        $users->Auth
        ->staticExpects($this->at(1))
        ->method('user')
        ->with('group_id')
        ->will($this->returnValue(1));

        $this->testAction("/users/index?filter_operator=all&filter_param%5B1%5D%5B1%5D=group_id&filter_param%5B1%5D%5B2%5D=is&filter_param%5B1%5D%5B3%5D=1");
        $this->assertEquals($this->vars['users'][0]['User'], $expected);
    }

    public function testFilters_byUserNameAndGroupId()
    {
        // filter by username AND group_id
        $this->testAction("/users/index?filter_operator=all&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=o&filter_param%5B2%5D%5B1%5D=group_id&filter_param%5B2%5D%5B2%5D=is&filter_param%5B2%5D%5B3%5D=1");
        $this->assertEqual(count($this->vars['users']), 0);

        $users = $this->_mockUserAccess();
        $users->Auth
        ->staticExpects($this->at(1))
        ->method('user')
        ->with('group_id')
        ->will($this->returnValue(1));
        $this->testAction("/users/index?filter_operator=all&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=m&filter_param%5B2%5D%5B1%5D=group_id&filter_param%5B2%5D%5B2%5D=is&filter_param%5B2%5D%5B3%5D=2");
        $this->assertEqual(count($this->vars['users']), 1);
    }

    public function testFilters_byUserNameOrGroupId()
    {
        // filter by username OR group_id
        $users = $this->_mockUserAccess();
        $users->Auth
        ->staticExpects($this->at(1))
        ->method('user')
        ->with('group_id')
        ->will($this->returnValue(1));
        $this->testAction("/users/index?filter_operator=any&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=o&filter_param%5B2%5D%5B1%5D=group_id&filter_param%5B2%5D%5B2%5D=is&filter_param%5B2%5D%5B3%5D=1");
        $this->assertEqual(count($this->vars['users']), 2);
    }

    public function testRequestPasswordReset_fail_invalidEmail()
    {
        $users = $this->generate('Users', array(
            'components' => array(
                'Acl' => array('check'),
                'Session' => array('setFlash')
                ),
            'models' => array(
                'User' => array('find')
                )
            ));

        $users->Acl
            ->expects($this->any())
            ->method('check')
            ->will($this->returnValue('true'));

        $user = array(
            'User'=> array(
                'id' => 1,
                'email' => 'vusion@ttc.com'
                )
            );

        $users->Session
            ->expects($this->once())
            ->method('setFlash')
            ->with('Invalid Email : vusion@ttc2.com');

        $this->testAction('/users/requestPasswordReset', array(
            'method' => 'post',
            'data' => array(
                'emailEnter' => 'vusion@ttc2.com',
                'captchaField' => '452fGH'
                )
            ));
    }

    public function testNewPassWord_reset_ok()
    {
        $hash = Configure::read('Security.salt');
        $users = $this->generate('Users', array(
            'components' => array(
                'Acl' => array('check'),
                'Session' => array('read', 'setFlash')
                ),
            'models' => array(
                'User' => array('read', 'save')
                )
            ));

        $users->Acl
            ->expects($this->any())
            ->method('check')
            ->will($this->returnValue('true'));

        $user = array(
            'User'=> array(
                'id' => 1,
                'password' => Security::hash($hash.'maxmass')
                )
            );

        $users->Session
            ->expects($this->any())
            ->method('read')
            ->will($this->returnValue('User'));

        $users->User
            ->expects($this->once())
            ->method('read')
            ->will($this->returnValue($user));

        $users->User
            ->expects($this->once())
            ->method('save')
            ->with(array(
            'User' =>array(
                'id' => 1,
                'password' => 'mark'
                )
            ))
            ->will($this->returnValue('true'));

        $users->Session
            ->expects($this->once())
            ->method('setFlash')
            ->with('Password changed successfully.');

        $this->testAction('/users/newPassword',array(
            'method' => 'post',
            'data' => array(
                'newPassword' => 'mark',
                'confirmPassword' => 'mark'
                )
            ));
    }

    public function testReportIssue_fail_fieldsEmpty()
    {
        $users = $this->generate('Users', array(
            'components' => array(
                'Acl' => array('check'),
                'Session' => array('read')
                ),
            'models' => array(
                'User' => array('exists', 'read', 'save')
                )
            ));

        $users->Acl
        ->expects($this->any())
        ->method('check')
        ->will($this->returnValue('true'));

        $this->testAction('/users/reportIssue', array(
            'method' => 'post',
            'data' => array('ReportIssue' => array(
                'issueUrl' => '',
                'subject' => '',
                'message' => '',
                'screenshot'=> array(
                    'name' => 'hi.gif' ,
                    'error'=>0)
                ))
            ));

        $this->assertEqual($this->vars['validationErrors']['subject'][0],
            'Please describe the expect vs current behavior.');
        $this->assertEqual($this->vars['validationErrors']['message'][0],
            'Please explain us how to reproduce the issue on our computers.');
        $this->assertEqual($this->vars['validationErrors']['screenshot'][0],
            'The file format ".gif" is not supported. Please upload an image .jpg or .png.');

    }

    public function testReportIssue_ok()
    {
        $users = $this->generate('Users', array(
            'components' => array(
                'Acl' => array('check'),
                'Session' => array('read', 'setFlash', 'write'),
                'Auth' => array('user', 'startup')
                ),
            'models' => array(
                'User' => array('read', 'save')
                )
            ));

        $users->Acl
        ->expects($this->any())
        ->method('check')
        ->will($this->returnValue('true'));

        $users->Session
        ->expects($this->at(0))
        ->method('read')
        ->with('Auth.User.username')
        ->will($this->returnValue('maxmass'));

        $users->Session
        ->expects($this->at(1))
        ->method('read')
        ->with('Auth.User.email')
        ->will($this->returnValue('vusion@ttc.com'));

        $CakeEmail = $this->getMock('CakeEmail', array(
            'from',
            'send'));

        $CakeEmail
        ->expects($this->any())
        ->method('send')
        ->will($this->returnValue('true'));

        $CakeEmail
        ->expects($this->any())
        ->method('from')
        ->with($this->equalTo('vusion@ttc.com'));

        $users->CakeEmail = $CakeEmail;

        $users->Session
        ->expects($this->any())
        ->method('setFlash')
        ->with('The tech team will contact you in the next 2 days by Email. Thank you.');

        $this->testAction('/users/reportIssue', array(
            'method' => 'post',
            'data' => array('ReportIssue' => array(
                'issueurl' => 'testing Url',
                'subject' => 'testing email subject',
                'message' => 'testing email message',
                'screenshot'=> array(
                    'name' => 'hi.jpg',
                    'error'=>0,
                    'tmp_name'=> TESTS . 'files/reportIssue_test_image.png')
                ))
            ));
    }

    public function testReportIssue_fail_connectionRefused()
    {
        $users = $this->generate('Users', array(
            'components' => array(
                'Acl' => array('check'),
                'Session' => array('read', 'setFlash', 'write'),
                'Auth' => array('user', 'startup')
                ),
            'models' => array(
                'User' => array('read', 'save')
                )
            ));

        $users->Acl
        ->expects($this->any())
        ->method('check')
        ->will($this->returnValue('true'));

        $users->Session
        ->expects($this->at(0))
        ->method('read')
        ->with('Auth.User.username')
        ->will($this->returnValue('maxmass'));

        $users->Session
        ->expects($this->at(1))
        ->method('read')
        ->with('Auth.User.email')
        ->will($this->returnValue('vusion@ttc.com'));

        $CakeEmail = $this->getMock('CakeEmail', array('send'));

        $CakeEmail
        ->expects($this->any())
        ->method('send')
        ->will($this->throwException(new SocketException('Email server connection is down. Please send report to vusion-issue@texttochange.com')));

        $users->CakeEmail = $CakeEmail;

        $users->Session
        ->expects($this->any())
        ->method('setFlash')
        ->with('Email server connection is down. Please send report to vusion-issues@texttochange.com');

        $this->testAction('/users/reportIssue', array(
            'method' => 'post',
            'data' => array('ReportIssue' => array(
                'issueurl' => 'testing URL',
                'subject' => 'testing email subject',
                'message' => 'testing email message',
                'screenshot'=> array(
                    'name' => 'hi.jpg',
                    'error'=>0,
                    'tmp_name'=> TESTS . 'files/reportIssue_test_image.png')
                ))
            ));
    }

    public function testReportIssue_fail_otherExceptions()
    {
        $users = $this->generate('Users', array(
            'components' => array(
                'Acl' => array('check'),
                'Session' => array('read', 'setFlash', 'write'),
                'Auth' => array('user', 'startup')
                ),
            'models' => array(
                'User' => array('read', 'save')
                )
            ));

        $users->Acl
        ->expects($this->any())
        ->method('check')
        ->will($this->returnValue('true'));

        $users->Session
        ->expects($this->at(0))
        ->method('read')
        ->with('Auth.User.username')
        ->will($this->returnValue('maxmass'));

        $users->Session
        ->expects($this->at(1))
        ->method('read')
        ->with('Auth.User.email')
        ->will($this->returnValue('vusion@ttc.com'));

        $CakeEmail = $this->getMock('CakeEmail', array('send'));

        $CakeEmail
        ->expects($this->any())
        ->method('send')
        ->will($this->throwException(new Exception('Email server is down')));

        $users->CakeEmail = $CakeEmail;

        $users->Session
        ->expects($this->any())
        ->method('setFlash')
        ->with('"Email server is down". Please send report to vusion-issues@texttochange.com');

        $this->testAction('/users/reportIssue', array(
            'method' => 'post',
            'data' => array('ReportIssue' => array(
                'issueurl' => 'testing URL',
                'subject' => 'testing email subject',
                'message' => 'testing email message',
                'screenshot'=> array(
                    'name' => 'hi.jpg',
                    'error'=>0,
                    'tmp_name'=> TESTS . 'files/reportIssue_test_image.png')
                ))
            ));
    }

    public function testEdit_grant_can_invite_users()
    {
        $users = $this->generate('Users', array(
            'components' => array(
                'Acl' => array('check', 'allow', 'deny'),
                'Session' => array('read')
                ),
            'models' => array(
                'User' => array('exists', 'save'),
                )
            ));

        $mockedUser = array(
            'User' =>array(
                'id' => 1,
                'username' => 'jared'
                )
            );

        $users->Session
        ->expects($this->any())
        ->method('read')
        ->will($this->returnValue('User'));

        $users->User
        ->expects($this->once())
        ->method('exists')
        ->will($this->returnValue('true'));

        $users->User
        ->expects($this->once())
        ->method('save')
        ->with($mockedUser)
        ->will($this->returnValue($mockedUser));

        $users->Acl
        ->expects($this->at(0))
        ->method('deny')
        ->with($mockedUser,
            "controllers/UnmatchableReply")
        ->will($this->returnValue('true'));

        $users->Acl
        ->expects($this->at(1))
        ->method('allow')
        ->with($mockedUser,
            "controllers/Users/inviteUser")
        ->will($this->returnValue('true'));

        $users->Acl
        ->expects($this->at(2))
        ->method('allow')
        ->with($mockedUser,
            "controllers/Users/index")
        ->will($this->returnValue('true'));

        $users->Acl
        ->expects($this->at(3))
        ->method('allow')
        ->with($mockedUser,
            "controllers/Users/delete")
        ->will($this->returnValue('true'));

        $users->Acl
        ->expects($this->once())
        ->method('check')
        ->will($this->returnValue('true'));

        $formUser = $mockedUser;
        $formUser['User']['unmatchable_reply_access'] = false;
        $formUser['User']['can_invite_users'] = true;

        $this->testAction("/users/edit/".$formUser['User']['id'],array(
            'method' => 'post',
            'data' => $formUser
            ));

        $this->assertContains('/users/index', $this->headers['Location']);
    }

    public function testEdit_deny_can_invite_users()
    {
        $users = $this->generate('Users', array(
            'components' => array(
                'Acl' => array('check', 'allow', 'deny'),
                'Session' => array('read')
                ),
            'models' => array(
                'User' => array('exists', 'save'),
                )
            ));

        $mockedUser = array(
            'User' =>array(
                'id' => 1,
                'username' => 'jared'
                )
            );

        $users->Session
        ->expects($this->any())
        ->method('read')
        ->will($this->returnValue('User'));

        $users->User
        ->expects($this->once())
        ->method('exists')
        ->will($this->returnValue('true'));

        $users->User
        ->expects($this->once())
        ->method('save')
        ->with($mockedUser)
        ->will($this->returnValue($mockedUser));

        $users->Acl
        ->expects($this->at(0))
        ->method('deny')
        ->with($mockedUser,
            "controllers/UnmatchableReply")
        ->will($this->returnValue('true'));

        $users->Acl
        ->expects($this->at(1))
        ->method('deny')
        ->with($mockedUser,
            "controllers/Users/index")
        ->will($this->returnValue('true'));

        $users->Acl
        ->expects($this->once())
        ->method('check')
        ->will($this->returnValue('true'));

        $formUser = $mockedUser;
        $formUser['User']['unmatchable_reply_access'] = false;
        $formUser['User']['can_invite_users'] = false;

        $this->testAction("/users/edit/".$formUser['User']['id'],array(
            'method' => 'post',
            'data' => $formUser
            ));

        $this->assertContains('/users/index', $this->headers['Location']);
    }

}


text:
export OPENMANO_HOST=localhost
export OPENMANO_PORT=9090
export OPENMANO_TENANT=bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb     #Use here the appropriate tenant id provided by openmano after creating the tenant
#Uncomment the following line in case that there are several datacenters and use the appropriate id
#export OPENMANO_DATACENTER=dddddddd-dddd-dddd-dddd-dddddddddddd


text:
\documentclass[runningheads,a4paper]{llncs}
%
\usepackage{natbib} % bibliography stuff
%
\usepackage{graphicx} % allows for working with images
\DeclareGraphicsExtensions{.pdf,.png,.jpeg,.jpg,.gif} % configures latex to look for the following image extensions
%
\usepackage{setspace} % allows for configuring the linespacing in the document
%\singlespacing
\onehalfspacing
%\doublespacing
%
\usepackage{listings}
%
\usepackage{amsmath}
%
\usepackage{appendix}
%
\usepackage{multirow}
%
\usepackage{booktabs,array,dcolumn}
%
\usepackage{float}
%
\usepackage{eurosym}
%
\usepackage{caption}
\captionsetup[table]{skip=10pt}
\captionsetup{compatibility=false}
\usepackage{subcaption}
%
\usepackage[toc]{glossaries}
\makeglossaries
%
\usepackage{amssymb}
\setcounter{tocdepth}{4}
%
\usepackage{url}
\urldef{\mailsa}\path|info@southeastmakerspace.org|
\newcommand{\keywords}[1]{\par\addvspace\baselineskip
\noindent\keywordname\enspace\ignorespaces#1}

%Optional Package to add PDF bookmarks and hypertext links
\usepackage[pdftex,hypertexnames=false,linktocpage=true]{hyperref}
\hypersetup{colorlinks=true,linkcolor=black,anchorcolor=black,citecolor=black,filecolor=black,urlcolor=black,bookmarksnumbered=true,pdfview=FitB}

\begin{document}
\mainmatter  % start of an individual contribution

% first the title is needed
\title{An Introduction to Arduino \\a low cost digital prototyping platform}

% a short form should be given in case it is too long for the running head
\titlerunning{Introduction to Arduino}
%

% the name(s) of the author(s) follow(s) next
%
% Chinese authors should write their first names(s) in front of
% their surnames. This ensures that the names appear correctly in
% the running heads and the author index.
%
\author{Clive Barry%
%\thanks{Please note that the LNCS Editorial assumes that all authors have used
%the western naming convention, with given names preceding surnames. This determines
%the structure of the names in the running heads and the author index.}%
\and Mogue Carpenter \and Aileen Drohan \and David Kirwan \and Anton Krug \and Martin Walshe}
%
\authorrunning{Introduction to Arduino}
% (feature abused for this document to repeat the title also on left hand pages)

% the affiliations are given next; don't give your e-mail address
% unless you accept that it will be published
\institute{South East Makerspace,\\Old Printworks, Thomas Hill,\\Waterford City, X91 TW63\\
\mailsa\\
\url{https://www.southeastmakerspace.org}}
%

%
% a more complex sample for affiliations and the mapping to the
% corresponding authors can be found in the file "llncs.dem"
% (search for the string "\mainmatter" where a contribution starts).
% "llncs.dem" accompanies the document class "llncs.cls".
%
%\toctitle{Thesis Proposal}
\tocauthor{SEMS}
\maketitle

%
\begin{abstract}
\begin{figure}
	\centering
	\includegraphics[width=8cm]{images/sems}
\end{figure}
This workshop offers an introduction to the Arduino prototyping platform, useful for artists, hobbiests and the wider maker community. Each participant receives a pack containing an Arduino Uno and components to perform each of 5 simple experiments. No prior coding experience is needed as all code will be provided. The only requirement is the Arduino IDE, and a packed lunch!
\keywords{arduino, digital electronics, prototyping, introduction}
\end{abstract}
%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Acknowledgements
%\newpage
%\include{preface/acknowledgements}
%

%
\tableofcontents
%

%
%\newpage
%\listoffigures
%\addcontentsline{toc}{chapter}{List of Figures}
%

%
%\newpage
%\listoftables
%\addcontentsline{toc}{chapter}{List of Tables}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%

%
\include{body/introduction}
\include{body/experiment1}
\include{body/experiment2}
\include{body/experiment3}
\include{body/experiment4}
\include{body/experiment5}
\include{body/conclusions}
%

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\include{glossary/glossary}
\renewcommand*{\glsclearpage}{}
\printglossaries
%

%
%\appendix
%\include{apendices/appendix}
%

%
\bibliographystyle{plainnat}
\bibliography{bibliography/bibtex}
\addcontentsline{toc}{chapter}{Bibliography}
%

\end{document}


text:
/**
 *
 */
package org.collectionspace.services;
import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;

/**
 * @author pschmitz
 *
 */
public interface LocationJAXBSchema extends AuthorityItemJAXBSchema {
	final static String LOCATIONS_COMMON = "locations_common";
	final static String NAME = "name";
	final static String CONDITION_GROUP_LIST = "conditionGroupList";
	final static String CONDITION_GROUP = "conditionGroup";
	final static String CONDITION_NOTE = "conditionNote";
	final static String CONDITION_NOTE_DATE = "conditionNoteDate";
	final static String SECURITY_NOTE = "securityNote";
	final static String ACCESS_NOTE = "accessNote";
	final static String ADDRESS = "address";
	final static String LOCATION_TYPE = "locationType";
}


text:
// Copyright 2004-present Facebook. All Rights Reserved.
//
// You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
// copy, modify, and distribute this software in source code or binary form for use
// in connection with the web services and APIs provided by Facebook.
//
// As with any software that integrates with the Facebook platform, your use of
// this software is subject to the Facebook Developer Principles and Policies
// [http://developers.facebook.com/policy/]. This copyright notice shall be
// included in all copies or substantial portions of the software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#import <AVFoundation/AVFoundation.h>
#import <UIKit/UIKit.h>

#import <FBAudienceNetwork/FBAdDefines.h>

NS_ASSUME_NONNULL_BEGIN

/**
 The FBMediaViewVideoRenderer class allows for customization of the user experience for video ads in FBMediaView. This
 class should be subclassed, and an instance of that subclass should be passed to the videoRenderer property of an
 FBMediaView instance.
 */
FB_CLASS_EXPORT
@interface FBMediaViewVideoRenderer : UIView

/**
 The aspect ratio of the video content. Returns a positive CGFloat, or 0.0 if no ad is currently loaded.
 */
@property (nonatomic, assign, readonly) CGFloat aspectRatio;

/**
 The current video playback time, as a CMTime value.
 */
@property (nonatomic, assign, readonly) CMTime currentTime;

/**
 The duration of the video, as a CMTime value.  Returns kCMTimeIndefinite if no video is loaded.
 */
@property (nonatomic, assign, readonly) CMTime duration;

/**
 Indicates whether the video is currently playing.
 */
@property (nonatomic, assign, readonly, getter=isPlaying) BOOL playing;

/**
 The current volume of the video, ranging from 0.0 through 1.0.
 */
@property (nonatomic, assign) float volume;

/**
 Starts or resumes video playback.
 */
- (void)playVideo;

/**
 Pauses video playback.
 */
- (void)pauseVideo;

/**
 Used to put the video into seek mode.  Video playback halts, and one or more calls to seekVideoToTime: can be made
 before calling disengageVideoSeek.
 */
- (void)engageVideoSeek;

/**
 Take the video out of seek mode.
 */
- (void)disengageVideoSeek;

/**
 Seeks the video to a particular time location.  Only works after calling `engageVideoSeek`.
 @param time The requested time location, expressed as a CMTime value.
 */
- (void)seekVideoToTime:(CMTime)time;

/**
 Requests the periodic invocation of a given block during playback to report changing time.
 @param interval The time interval at which the block should be invoked during normal playback, according to progress of
 the player's current time.
 @param queue A serial dispatch queue onto which block should be enqueued.
 @param block The block to be invoked periodically.
 */
- (nullable id)addPeriodicTimeObserverForInterval:(CMTime)interval
                                            queue:(dispatch_queue_t)queue
                                       usingBlock:(void (^)(CMTime time))block;

/**
 Cancels a previously registered periodic time observer.
 */
- (void)removeTimeObserver:(id)observer;

/**
 Called when the video volume has changed.
 */
- (void)videoDidChangeVolume;

/**
 Called when video content has loaded.
 */
- (void)videoDidLoad;

/**
 Called when video playback was paused.
 */
- (void)videoDidPause;

/**
 Called when video playback has begun or was resumed.
 */
- (void)videoDidPlay;

/**
 Called when seek mode was engaged.
 */
- (void)videoDidEngageSeek;

/**
 Called when a video seek was performed.
 */
- (void)videoDidSeek;

/**
 Called when seek mode was disengaged.
 */
- (void)videoDidDisengageSeek;

/**
 Called when video playback ends.
 */
- (void)videoDidEnd;

/**
 Called when video playback encounters an error.
 */
- (void)videoDidFailWithError:(NSError *)error;

@end

NS_ASSUME_NONNULL_END


text:
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
import visualizer from 'rollup-plugin-visualizer';
import {getBrowserBundleConfigOptions} from '../rollup.config.helpers';

const PREAMBLE = `/**
 * @license
 * Copyright ${(new Date).getFullYear()} Google LLC. All Rights Reserved.
 * 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.
 * =============================================================================
 */`;

function config({
  plugins = [],
  output = {},
  external = [],
  visualize = false,
  tsCompilerOptions = {}
}) {
  if (visualize) {
    const filename = output.file + '.html';
    plugins.push(visualizer(
        {sourcemap: true, filename, template: 'sunburst', gzipSize: true}));
    console.log(`Will output a bundle visualization in ${filename}`);
  }

  const defaultTsOptions = {
    include: ['src/**/*.ts'],
    module: 'ES2015',
  };
  const tsoptions = Object.assign({}, defaultTsOptions, tsCompilerOptions);

  return {
    input: 'src/index.ts',
    plugins: [
      typescript(tsoptions), resolve(),
      // Polyfill require() from dependencies.
      commonjs({
        ignore: ['crypto'],
        include: 'node_modules/**',
      }),
      ...plugins
    ],
    output: {
      banner: PREAMBLE,
      sourcemap: true,
      globals: {'@tensorflow/tfjs-core': 'tf'},
      ...output,
    },
    external: ['@tensorflow/tfjs-core'],
    onwarn: warning => {
      let {code} = warning;
      if (code === 'CIRCULAR_DEPENDENCY' || code === 'CIRCULAR' ||
          code === 'THIS_IS_UNDEFINED') {
        return;
      }
      console.warn('WARNING: ', warning.toString());
    }
  };
}

module.exports = cmdOptions => {
  const bundles = [];
  const name = 'tf';
  const extend = true;
  const fileName = 'tf-backend-webgpu';

  // Node
  bundles.push(config({
    output: {
      format: 'cjs',
      name,
      extend,
      file: `dist/${fileName}.node.js`,
      freeze: false
    },
    tsCompilerOptions: {target: 'es5'}
  }));

  if (cmdOptions.ci) {
    const browserBundles = getBrowserBundleConfigOptions(
        config, name, fileName, PREAMBLE, cmdOptions.visualize, true /* CI */);
    bundles.push(...browserBundles);
  }

  if (cmdOptions.npm) {
    const browserBundles = getBrowserBundleConfigOptions(
        config, name, fileName, PREAMBLE, cmdOptions.visualize, false /* CI */);
    bundles.push(...browserBundles);
  }

  return bundles;
};


text:
.broadcast_box,.pppcast_box{
	padding-top: 20px;
	padding-left: 20px;
	border: 1px dotted green;
}


text:
require_relative '../../api500/c7000/internal_link_set'

module OneviewSDK
  module API600
    module C7000
      # Internal Link Set resource implementation for API500 C7000
      class InternalLinkSet < OneviewSDK::API500::C7000::InternalLinkSet
      end
    end
  end
end


text:
package generic

import (
	"context"
	"fmt"
	"runtime"
	"strings"
	"time"

	"github.com/circonus-labs/circonus-agent/internal/builtins/collector"
	"github.com/circonus-labs/circonus-agent/internal/config"
	"github.com/circonus-labs/circonus-agent/internal/tags"
	cgm "github.com/circonus-labs/circonus-gometrics/v3"
	"github.com/rs/zerolog"
	"github.com/shirou/gopsutil/v3/net"
)

// Proto metrics.
type Proto struct {
	protocols []string
	gencommon
}

// protoOptions defines what elements can be overridden in a config file.
type protoOptions struct {
	// common
	ID     string `json:"id" toml:"id" yaml:"id"`
	RunTTL string `json:"run_ttl" toml:"run_ttl" yaml:"run_ttl"`

	// collector specific
	Protocols []string `json:"protocols" toml:"protocols" yaml:"protocols"` // default: empty (equates to all: ip,icmp,icmpmsg,tcp,udp,udplite)
}

var (
	errNoProtoMetrics = fmt.Errorf("no network protocol metrics available")
)

// NewNetProtoCollector creates new psutils collector.
func NewNetProtoCollector(cfgBaseName string, parentLogger zerolog.Logger) (collector.Collector, error) {
	c := Proto{}
	c.id = NameProto
	c.pkgID = PackageName + "." + c.id
	c.logger = parentLogger.With().Str("id", c.id).Logger()
	c.baseTags = tags.FromList(tags.GetBaseTags())

	var opts protoOptions
	err := config.LoadConfigFile(cfgBaseName, &opts)
	if err != nil {
		if strings.Contains(err.Error(), "no config found matching") {
			return &c, nil
		}
		c.logger.Warn().Err(err).Str("file", cfgBaseName).Msg("loading config file")
		return nil, fmt.Errorf("%s config: %w", c.pkgID, err)
	}

	c.logger.Debug().Str("base", cfgBaseName).Interface("config", opts).Msg("loaded config")

	if len(opts.Protocols) > 0 {
		c.protocols = opts.Protocols
	}

	if opts.ID != "" {
		c.id = opts.ID
	}

	if opts.RunTTL != "" {
		dur, err := time.ParseDuration(opts.RunTTL)
		if err != nil {
			return nil, fmt.Errorf("%s parsing run_ttl: %w", c.pkgID, err)
		}
		c.runTTL = dur
	}

	return &c, nil
}

// Collect metrics.
func (c *Proto) Collect(ctx context.Context) error {
	c.Lock()
	if c.runTTL > time.Duration(0) {
		if time.Since(c.lastEnd) < c.runTTL {
			c.logger.Warn().Msg(collector.ErrTTLNotExpired.Error())
			c.Unlock()
			return collector.ErrTTLNotExpired
		}
	}
	if c.running {
		c.logger.Warn().Msg(collector.ErrAlreadyRunning.Error())
		c.Unlock()
		return collector.ErrAlreadyRunning
	}

	c.running = true
	c.lastStart = time.Now()
	c.Unlock()

	//
	// NOTE: gopsutil does not currently offer IPv6 metrics
	//       it only pulls from /proc/net/snmp not /proc/net/snmp6
	//

	metrics := cgm.Metrics{}
	counters, err := net.ProtoCountersWithContext(ctx, c.protocols)
	if err != nil {
		c.logger.Warn().Err(err).Msg("collecting network protocol metrics")
		c.setStatus(metrics, nil)
		return nil
	}

	if len(counters) == 0 {
		return errNoProtoMetrics
	}

	if runtime.GOOS == "linux" {
		for _, counter := range counters {
			protoTags := tags.Tags{tags.Tag{Category: "protocol", Value: counter.Protocol}}
			for name, val := range counter.Stats {
				switch counter.Protocol {
				case "ip":
					c.emitIPMetric(&metrics, counter.Protocol, name, val, protoTags)
				case "icmp":
					c.emitICMPMetric(&metrics, counter.Protocol, name, val, protoTags)
				case "icmpmsg":
					c.emitICMPMsgMetric(&metrics, counter.Protocol, name, val, protoTags)
				case "tcp":
					c.emitTCPMetric(&metrics, counter.Protocol, name, val, protoTags)
				case "udp":
					c.emitUDPMetric(&metrics, counter.Protocol, name, val, protoTags)
				case "udplite":
					c.emitUDPLiteMetric(&metrics, counter.Protocol, name, val, protoTags)
				default:
					// NOTE: output msg for each metric, so support can be added without having to
					//       set up an environment that can produce the metric(s)
					c.logger.Warn().Str("protocol", counter.Protocol).Str("metric", name).Msg("unknown protocol, missing units info")
					_ = c.addMetric(&metrics, name, "L", val, protoTags)
				}
			}
		}

		c.setStatus(metrics, nil)
		return nil
	}

	for _, counter := range counters {
		protoTags := tags.Tags{tags.Tag{Category: "protocol", Value: counter.Protocol}}
		for name, val := range counter.Stats {
			// NOTE: output msg for EACH proto/metric so a log can be supplied.
			//       support can then be added from the log vs having to run the OS itself.
			c.logger.Warn().
				Str("os_type", runtime.GOOS).
				Str("protocol", counter.Protocol).
				Str("metric", name).
				Msg("unknown os type supported, missing units info")
			_ = c.addMetric(&metrics, name, "L", val, protoTags)
		}
	}

	c.setStatus(metrics, nil)
	return nil
}

const (
	// repeated metric names.
	metricInCsumErrors = "InCsumErrors"
	metricInErrors     = "InErrors"
	metricOutDatagrams = "OutDatagrams"
	metricInDatagrams  = "InDatagrams"
	metricSndbufErrors = "SndbufErrors"
	metricRcvbufErrors = "RcvbufErrors"
	metricNoPorts      = "NoPorts"
	defaultMetricType  = "l"
)

func (c *Proto) emitIPMetric(metrics *cgm.Metrics, proto, name string, val int64, protoTags tags.Tags) {
	// https://sourceforge.net/p/net-tools/code/ci/master/tree/statistics.c#l56
	// https://tools.ietf.org/html/rfc1213

	tagUnitsSeconds := tags.Tag{Category: "units", Value: "seconds"}
	tagUnitsDatagrams := tags.Tag{Category: "units", Value: "datagrams"}
	tagUnitsFragments := tags.Tag{Category: "units", Value: "fragments"}
	tagUnitsPackets := tags.Tag{Category: "units", Value: "packets"}
	tagUnitsRequests := tags.Tag{Category: "units", Value: "requests"}

	var tagList tags.Tags
	tagList = append(tagList, protoTags...)

	switch name {
	case "ReasmTimeout":
		tagList = append(tagList, tagUnitsSeconds)
	case "DefaultTTL":
		tagList = append(tagList, tagUnitsSeconds)
	case "ForwDatagrams":
		tagList = append(tagList, tagUnitsDatagrams)
	case "Forwarding":
		// it's a setting, not really a metric, no units.
		// 1 - acting as gateway
		// 2 - NOT acting as gateway
	case "FragCreates":
		tagList = append(tagList, tagUnitsFragments)
	case "FragFails":
		tagList = append(tagList, tagUnitsFragments)
	case "FragOKs":
		tagList = append(tagList, tagUnitsFragments)
	case "InAddrErrors":
		// no units
	case "InDelivers":
		tagList = append(tagList, tagUnitsPackets)
	case "InDiscards":
		tagList = append(tagList, tagUnitsPackets)
	case "InHdrErrors":
		tagList = append(tagList, tagUnitsPackets)
	case "InReceives":
		tagList = append(tagList, tagUnitsPackets)
	case "InUnknownProtos":
		tagList = append(tagList, tagUnitsPackets)
	case "OutDiscards":
		tagList = append(tagList, tagUnitsPackets)
	case "OutNoRoutes":
		tagList = append(tagList, tagUnitsPackets)
	case "ReasmFails":
		tagList = append(tagList, tagUnitsPackets)
	case "ReasmOKs":
		tagList = append(tagList, tagUnitsPackets)
	case "ReasmReqds":
		tagList = append(tagList, tagUnitsPackets)
	case "OutRequests":
		tagList = append(tagList, tagUnitsRequests)
	default:
		c.logger.Warn().Str("protocol", proto).Str("metric", name).Msg("unrecognized metric, no units")
	}

	_ = c.addMetric(metrics, name, defaultMetricType, val, tagList)
}

func (c *Proto) emitICMPMetric(metrics *cgm.Metrics, proto, name string, val int64, protoTags tags.Tags) {
	// https://sourceforge.net/p/net-tools/code/ci/master/tree/statistics.c#l105
	// https://tools.ietf.org/html/rfc1213

	tagUnitsResponses := tags.Tag{Category: "units", Value: "responses"}
	tagUnitsRequests := tags.Tag{Category: "units", Value: "requests"}
	tagUnitsMessages := tags.Tag{Category: "units", Value: "messages"}
	tagUnitsRedirects := tags.Tag{Category: "units", Value: "redirects"}

	var tagList tags.Tags
	tagList = append(tagList, protoTags...)
	switch name {
	case "OutTimestampReps":
		tagList = append(tagList, tagUnitsResponses)
	case "OutEchoReps":
		tagList = append(tagList, tagUnitsResponses)
	case "OutAddrMaskReps":
		tagList = append(tagList, tagUnitsResponses)
	case "InTimestampReps":
		tagList = append(tagList, tagUnitsResponses)
	case "InEchoReps":
		tagList = append(tagList, tagUnitsResponses)
	case "InAddrMaskReps":
		tagList = append(tagList, tagUnitsResponses)
	case "OutTimestamps":
		tagList = append(tagList, tagUnitsRequests)
	case "OutEchos":
		tagList = append(tagList, tagUnitsRequests)
	case "OutAddrMasks":
		tagList = append(tagList, tagUnitsRequests)
	case "InTimestamps":
		tagList = append(tagList, tagUnitsRequests)
	case "InEchos":
		tagList = append(tagList, tagUnitsRequests)
	case "InAddrMasks":
		tagList = append(tagList, tagUnitsRequests)
	case "OutDestUnreachs":
		// no units
	case "InDestUnreachs":
		// no units
	case "OutParmProbs":
		// no units
	case "InParmProbs":
		// no units
	case "OutErrors":
		// no units
	case metricInCsumErrors:
		// no units
	case metricInErrors:
		// no units
	case "OutMsgs":
		tagList = append(tagList, tagUnitsMessages)
	case "InMsgs":
		tagList = append(tagList, tagUnitsMessages)
	case "OutRedirects":
		tagList = append(tagList, tagUnitsRedirects)
	case "InRedirects":
		tagList = append(tagList, tagUnitsRedirects)
	case "OutSrcQuenchs":
		// no units
	case "InSrcQuenchs":
		// no units
	case "OutTimeExcds":
		// no units
	case "InTimeExcds":
		// no units
	default:
		c.logger.Warn().Str("protocol", proto).Str("metric", name).Msg("unrecognized metric, no units")
	}
	_ = c.addMetric(metrics, name, defaultMetricType, val, tagList)
}

func (c *Proto) emitICMPMsgMetric(metrics *cgm.Metrics, proto, name string, val int64, protoTags tags.Tags) {
	_ = proto // just so it's used and the func call signatures stay consistent

	// possible message types:
	// https://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml

	tagList := tags.Tags{tags.Tag{Category: "units", Value: "messages"}}
	tagList = append(tagList, protoTags...)

	_ = c.addMetric(metrics, name, defaultMetricType, val, tagList)
}

func (c *Proto) emitTCPMetric(metrics *cgm.Metrics, proto, name string, val int64, protoTags tags.Tags) {
	// https://sourceforge.net/p/net-tools/code/ci/master/tree/statistics.c#l170
	// https://tools.ietf.org/html/rfc1213

	tagUnitsConnections := tags.Tag{Category: "units", Value: "connections"}
	tagUnitsSegments := tags.Tag{Category: "units", Value: "segments"}
	tagUnitsResets := tags.Tag{Category: "units", Value: "resets"}
	tagUnitsMilliseconds := tags.Tag{Category: "units", Value: "milliseconds"}

	var tagList tags.Tags
	tagList = append(tagList, protoTags...)
	switch name {
	case "AttemptFails":
		tagList = append(tagList, tagUnitsConnections)
	case "MaxConn":
		tagList = append(tagList, tagUnitsConnections)
	case "PassiveOpens":
		tagList = append(tagList, tagUnitsConnections)
	case "CurrEstab":
		tagList = append(tagList, tagUnitsConnections)
	case "ActiveOpens":
		tagList = append(tagList, tagUnitsConnections)
	case "OutSegs":
		tagList = append(tagList, tagUnitsSegments)
	case "InSegs":
		tagList = append(tagList, tagUnitsSegments)
	case "RetransSegs":
		tagList = append(tagList, tagUnitsSegments)
	case metricInCsumErrors:
		// no units
	case "InErrs":
		// no units
	case "EstabResets":
		tagList = append(tagList, tagUnitsResets)
	case "OutRsts":
		tagList = append(tagList, tagUnitsResets)
	case "RtoAlgorithm":
		// it's a setting, not a metric, no units
		// 1 none of the following
		// 2 constant rto
		// 3 mil-std-1778
		// 4 van jacobson's algorithm
	case "RtoMax":
		tagList = append(tagList, tagUnitsMilliseconds)
	case "RtoMin":
		tagList = append(tagList, tagUnitsMilliseconds)
	default:
		c.logger.Warn().Str("protocol", proto).Str("metric", name).Msg("unrecognized metric, no units")
	}
	_ = c.addMetric(metrics, name, defaultMetricType, val, tagList)
}

func (c *Proto) emitUDPMetric(metrics *cgm.Metrics, proto, name string, val int64, protoTags tags.Tags) {
	// https://sourceforge.net/p/net-tools/code/ci/master/tree/statistics.c#l188
	// https://tools.ietf.org/html/rfc1213

	tagUnitsDatagrams := tags.Tag{Category: "units", Value: "datagrams"}

	var tagList tags.Tags
	tagList = append(tagList, protoTags...)
	switch name {
	case metricOutDatagrams:
		tagList = append(tagList, tagUnitsDatagrams)
	case metricInDatagrams:
		tagList = append(tagList, tagUnitsDatagrams)
	case metricInCsumErrors:
		// no units
	case metricSndbufErrors:
		// no units
	case metricRcvbufErrors:
		// no units
	case metricNoPorts:
		// no units
	case metricInErrors:
		// no units
	default:
		c.logger.Warn().Str("protocol", proto).Str("metric", name).Msg("unrecognized metric, no units")
	}
	_ = c.addMetric(metrics, name, defaultMetricType, val, tagList)
}

func (c *Proto) emitUDPLiteMetric(metrics *cgm.Metrics, proto, name string, val int64, protoTags tags.Tags) {
	// same names as UDP...

	tagUnitsDatagrams := tags.Tag{Category: "units", Value: "datagrams"}

	var tagList tags.Tags
	tagList = append(tagList, protoTags...)
	switch name {
	case metricOutDatagrams:
		tagList = append(tagList, tagUnitsDatagrams)
	case metricInDatagrams:
		tagList = append(tagList, tagUnitsDatagrams)
	case metricInCsumErrors:
		// no units
	case metricSndbufErrors:
		// no units
	case metricRcvbufErrors:
		// no units
	case metricNoPorts:
		// no units
	case metricInErrors:
		// no units
	default:
		c.logger.Warn().Str("protocol", proto).Str("metric", name).Msg("unrecognized metric, no units")
	}
	_ = c.addMetric(metrics, name, defaultMetricType, val, tagList)
}


text:
package com.google.openrtb.json;

import static com.google.openrtb.json.OpenRtbJsonUtils.endArray;
import static com.google.openrtb.json.OpenRtbJsonUtils.endObject;
import static com.google.openrtb.json.OpenRtbJsonUtils.getCurrentName;
import static com.google.openrtb.json.OpenRtbJsonUtils.getIntBoolValue;
import static com.google.openrtb.json.OpenRtbJsonUtils.startArray;
import static com.google.openrtb.json.OpenRtbJsonUtils.startObject;

import com.google.common.io.CharSource;
import com.google.common.io.Closeables;
import com.google.openrtb.OpenRtb.NativeRequest;
import com.google.openrtb.OpenRtb.NativeRequest.AdUnitId;
import com.google.openrtb.OpenRtb.NativeRequest.Asset.Data.DataAssetType;
import com.google.openrtb.OpenRtb.NativeRequest.Asset.Image.ImageAssetType;
import com.google.openrtb.OpenRtb.NativeRequest.LayoutId;
import com.google.openrtb.OpenRtb.NativeResponse;
import com.google.protobuf.ByteString;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;

import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;

/**
 * Desserializes OpenRTB {@link NativeRequest}/{@link NativeResponse} messages from JSON.
 * <p>
 * This class is threadsafe.
 */
public class OpenRtbNativeJsonReader extends AbstractOpenRtbJsonReader {
  private OpenRtbJsonReader coreReader;

  protected OpenRtbNativeJsonReader(OpenRtbJsonFactory factory) {
    super(factory);
  }

  /**
   * Desserializes a {@link NativeRequest} from a JSON string, provided as a {@link ByteString}.
   */
  public NativeRequest readNativeRequest(ByteString bs) throws IOException {
    return readNativeRequest(bs.newInput());
  }

  /**
   * Desserializes a {@link NativeRequest} from a JSON string, provided as a {@link CharSequence}.
   */
  public NativeRequest readNativeRequest(CharSequence chars) throws IOException {
    return readNativeRequest(CharSource.wrap(chars).openStream());
  }

  /**
   * Desserializes a {@link NativeRequest} from JSON, streamed from a {@link Reader}.
   */
  public NativeRequest readNativeRequest(Reader reader) throws IOException {
    return readNativeRequest(factory().getJsonFactory().createParser(reader)).build();
  }

  /**
   * Desserializes a {@link NativeRequest} from JSON, streamed from an {@link InputStream}.
   */
  public NativeRequest readNativeRequest(InputStream is) throws IOException {
    try {
      return readNativeRequest(factory().getJsonFactory().createParser(is)).build();
    } finally {
      Closeables.closeQuietly(is);
    }
  }

  /**
   * Desserializes a {@link NativeRequest} from JSON, with a provided {@link JsonParser}
   * which allows several choices of input and encoding.
   */
  public final NativeRequest.Builder readNativeRequest(JsonParser par) throws IOException {
    NativeRequest.Builder req = NativeRequest.newBuilder();
    for (startObject(par); endObject(par); par.nextToken()) {
      String fieldName = getCurrentName(par);
      if (par.nextToken() != JsonToken.VALUE_NULL && "native".equals(fieldName)) {
        for (startObject(par); endObject(par); par.nextToken()) {
          fieldName = getCurrentName(par);
          if (par.nextToken() != JsonToken.VALUE_NULL) {
            readNativeRequestField(par, req, fieldName);
          }
        }
      } else {
        par.skipChildren();
      }
    }
    return req;
  }

  protected void readNativeRequestField(JsonParser par, NativeRequest.Builder req, String fieldName)
      throws IOException {
    switch (fieldName) {
      case "ver":
        req.setVer(par.getText());
        break;
      case "layout": {
          LayoutId value = LayoutId.valueOf(par.getIntValue());
          if (checkEnum(value)) {
            req.setLayout(value);
          }
        }
        break;
      case "adunit": {
          AdUnitId value = AdUnitId.valueOf(par.getIntValue());
          if (checkEnum(value)) {
            req.setAdunit(value);
          }
        }
        break;
      case "plcmtcnt":
        req.setPlcmtcnt(par.getIntValue());
        break;
      case "seq":
        req.setSeq(par.getIntValue());
        break;
      case "assets":
        for (startArray(par); endArray(par); par.nextToken()) {
          req.addAssets(readReqAsset(par));
        }
        break;
      default:
        readOther(req, par, fieldName);
    }
  }

  public final NativeRequest.Asset.Builder readReqAsset(JsonParser par) throws IOException {
    NativeRequest.Asset.Builder asset = NativeRequest.Asset.newBuilder();
    for (startObject(par); endObject(par); par.nextToken()) {
      String fieldName = getCurrentName(par);
      if (par.nextToken() != JsonToken.VALUE_NULL) {
        readReqAssetField(par, asset, fieldName);
      }
    }
    return asset;
  }

  protected void readReqAssetField(
      JsonParser par, NativeRequest.Asset.Builder asset, String fieldName) throws IOException {
    switch (fieldName) {
      case "id":
        asset.setId(par.getIntValue());
        break;
      case "required":
        asset.setRequired(getIntBoolValue(par));
        break;
      case "title":
        asset.setTitle(readReqTitle(par));
        break;
      case "img":
        asset.setImg(readReqImage(par));
        break;
      case "video":
        asset.setVideo(coreReader().readVideo(par));
        break;
      case "data":
        asset.setData(readReqData(par));
        break;
      default:
        readOther(asset, par, fieldName);
    }
  }

  public final NativeRequest.Asset.Title.Builder readReqTitle(JsonParser par)
      throws IOException {
    NativeRequest.Asset.Title.Builder title = NativeRequest.Asset.Title.newBuilder();
    for (startObject(par); endObject(par); par.nextToken()) {
      String fieldName = getCurrentName(par);
      if (par.nextToken() != JsonToken.VALUE_NULL) {
        readReqTitleField(par, title, fieldName);
      }
    }
    return title;
  }

  protected void readReqTitleField(
      JsonParser par, NativeRequest.Asset.Title.Builder title, String fieldName)
      throws IOException {
    switch (fieldName) {
      case "len":
        title.setLen(par.getIntValue());
        break;
      default:
        readOther(title, par, fieldName);
    }
  }

  public final NativeRequest.Asset.Image.Builder readReqImage(JsonParser par)
      throws IOException {
    NativeRequest.Asset.Image.Builder req = NativeRequest.Asset.Image.newBuilder();
    for (startObject(par); endObject(par); par.nextToken()) {
      String fieldName = getCurrentName(par);
      if (par.nextToken() != JsonToken.VALUE_NULL) {
        readReqImageField(par, req, fieldName);
      }
    }
    return req;
  }

  protected void readReqImageField(
      JsonParser par, NativeRequest.Asset.Image.Builder image, String fieldName)
      throws IOException {
    switch (fieldName) {
      case "type": {
          ImageAssetType value = ImageAssetType.valueOf(par.getIntValue());
          if (checkEnum(value)) {
            image.setType(value);
          }
        }
        break;
      case "w":
        image.setW(par.getIntValue());
        break;
      case "h":
        image.setH(par.getIntValue());
        break;
      case "wmin":
        image.setWmin(par.getIntValue());
        break;
      case "hmin":
        image.setHmin(par.getIntValue());
        break;
      case "mimes":
        for (startArray(par); endArray(par); par.nextToken()) {
          image.addMimes(par.getText());
        }
        break;
      default:
        readOther(image, par, fieldName);
    }
  }

  public final NativeRequest.Asset.Data.Builder readReqData(JsonParser par) throws IOException {
    NativeRequest.Asset.Data.Builder data = NativeRequest.Asset.Data.newBuilder();
    for (startObject(par); endObject(par); par.nextToken()) {
      String fieldName = getCurrentName(par);
      if (par.nextToken() != JsonToken.VALUE_NULL) {
        readReqDataField(par, data, fieldName);
      }
    }
    return data;
  }

  protected void readReqDataField(
      JsonParser par, NativeRequest.Asset.Data.Builder data, String fieldName) throws IOException {
    switch (fieldName) {
      case "type": {
          DataAssetType value = DataAssetType.valueOf(par.getIntValue());
          if (checkEnum(value)) {
            data.setType(value);
          }
        }
        break;
      case "len":
        data.setLen(par.getIntValue());
        break;
      default:
        readOther(data, par, fieldName);
    }
  }

  /**
   * Desserializes a {@link NativeResponse} from a JSON string, provided as a {@link ByteString}.
   */
  public NativeResponse readNativeResponse(ByteString bs) throws IOException {
    return readNativeResponse(bs.newInput());
  }

  /**
   * Desserializes a {@link NativeResponse} from a JSON string, provided as a {@link CharSequence}.
   */
  public NativeResponse readNativeResponse(CharSequence chars) throws IOException {
    return readNativeResponse(CharSource.wrap(chars).openStream());
  }

  /**
   * Desserializes a {@link NativeResponse} from JSON, streamed from a {@link Reader}.
   */
  public NativeResponse readNativeResponse(Reader reader) throws IOException {
    return readNativeResponse(factory().getJsonFactory().createParser(reader)).build();
  }

  /**
   * Desserializes a {@link NativeResponse} from JSON, streamed from an {@link InputStream}.
   */
  public NativeResponse readNativeResponse(InputStream is) throws IOException {
    try {
      return readNativeResponse(factory().getJsonFactory().createParser(is)).build();
    } finally {
      Closeables.closeQuietly(is);
    }
  }

  /**
   * Desserializes a {@link NativeResponse} from JSON, with a provided {@link JsonParser}
   * which allows several choices of input and encoding.
   */
  public final NativeResponse.Builder readNativeResponse(JsonParser par) throws IOException {
    NativeResponse.Builder resp = NativeResponse.newBuilder();
    for (startObject(par); endObject(par); par.nextToken()) {
      String fieldName = getCurrentName(par);
      if (par.nextToken() != JsonToken.VALUE_NULL && "native".equals(fieldName)) {
        for (startObject(par); endObject(par); par.nextToken()) {
          fieldName = getCurrentName(par);
          if (par.nextToken() != JsonToken.VALUE_NULL) {
            readNativeResponseField(par, resp, fieldName);
          }
        }
      } else {
        par.skipChildren();
      }
    }
    return resp;
  }

  protected void readNativeResponseField(
      JsonParser par, NativeResponse.Builder resp, String fieldName) throws IOException {
    switch (fieldName) {
      case "ver":
        resp.setVer(par.getText());
        break;
      case "assets":
        for (startArray(par); endArray(par); par.nextToken()) {
          resp.addAssets(readRespAsset(par));
        }
        break;
      case "link":
        resp.setLink(readRespLink(par));
        break;
      case "imptrackers":
        for (startArray(par); endArray(par); par.nextToken()) {
          resp.addImptrackers(par.getText());
        }
        break;
      case "jstracker":
        resp.setJstracker(par.getText());
        break;
      default:
        readOther(resp, par, fieldName);
    }
  }

  public final NativeResponse.Asset.Builder readRespAsset(JsonParser par) throws IOException {
    NativeResponse.Asset.Builder asset = NativeResponse.Asset.newBuilder();
    for (startObject(par); endObject(par); par.nextToken()) {
      String fieldName = getCurrentName(par);
      if (par.nextToken() != JsonToken.VALUE_NULL) {
        readRespAssetField(par, asset, fieldName);
      }
    }
    return asset;
  }

  protected void readRespAssetField(
      JsonParser par, NativeResponse.Asset.Builder asset, String fieldName) throws IOException {
    switch (fieldName) {
      case "id":
        asset.setId(par.getIntValue());
        break;
      case "required":
        asset.setRequired(getIntBoolValue(par));
        break;
      case "title":
        asset.setTitle(readRespTitle(par));
        break;
      case "img":
        asset.setImg(readRespImage(par));
        break;
      case "video":
        asset.setVideo(readRespVideo(par));
        break;
      case "data":
        asset.setData(readRespData(par));
        break;
      case "link":
        asset.setLink(readRespLink(par));
        break;
      default:
        readOther(asset, par, fieldName);
    }
  }

  public final NativeResponse.Asset.Title.Builder readRespTitle(JsonParser par)
      throws IOException {
    NativeResponse.Asset.Title.Builder title = NativeResponse.Asset.Title.newBuilder();
    for (startObject(par); endObject(par); par.nextToken()) {
      String fieldName = getCurrentName(par);
      if (par.nextToken() != JsonToken.VALUE_NULL) {
        readRespTitleField(par, title, fieldName);
      }
    }
    return title;
  }

  protected void readRespTitleField(
      JsonParser par, NativeResponse.Asset.Title.Builder title, String fieldName)
      throws IOException {
    switch (fieldName) {
      case "text":
        title.setText(par.getText());
        break;
      default:
        readOther(title, par, fieldName);
    }
  }

  public final NativeResponse.Asset.Image.Builder readRespImage(JsonParser par)
      throws IOException {
    NativeResponse.Asset.Image.Builder image = NativeResponse.Asset.Image.newBuilder();
    for (startObject(par); endObject(par); par.nextToken()) {
      String fieldName = getCurrentName(par);
      if (par.nextToken() != JsonToken.VALUE_NULL) {
        readRespImageField(par, image, fieldName);
      }
    }
    return image;
  }

  protected void readRespImageField(
      JsonParser par, NativeResponse.Asset.Image.Builder image, String fieldName)
      throws IOException {
    switch (fieldName) {
      case "url":
        image.setUrl(par.getText());
        break;
      case "w":
        image.setW(par.getIntValue());
        break;
      case "h":
        image.setH(par.getIntValue());
        break;
      default:
        readOther(image, par, fieldName);
    }
  }

  public final NativeResponse.Asset.Video.Builder readRespVideo(JsonParser par)
      throws IOException {
    NativeResponse.Asset.Video.Builder video = NativeResponse.Asset.Video.newBuilder();
    for (startObject(par); endObject(par); par.nextToken()) {
      String fieldName = getCurrentName(par);
      if (par.nextToken() != JsonToken.VALUE_NULL) {
        readRespVideoField(par, video, fieldName);
      }
    }
    return video;
  }

  protected void readRespVideoField(
      JsonParser par, NativeResponse.Asset.Video.Builder video, String fieldName)
      throws IOException {
    switch (fieldName) {
      case "vasttag":
        for (startArray(par); endArray(par); par.nextToken()) {
          video.addVasttag(par.getText());
        }
        break;
      default:
        readOther(video, par, fieldName);
    }
  }

  public final NativeResponse.Asset.Data.Builder readRespData(JsonParser par) throws IOException {
    NativeResponse.Asset.Data.Builder data = NativeResponse.Asset.Data.newBuilder();
    for (startObject(par); endObject(par); par.nextToken()) {
      String fieldName = getCurrentName(par);
      if (par.nextToken() != JsonToken.VALUE_NULL) {
        readRespDataField(par, data, fieldName);
      }
    }
    return data;
  }

  protected void readRespDataField(
      JsonParser par, NativeResponse.Asset.Data.Builder data, String fieldName) throws IOException {
    switch (fieldName) {
      case "label":
        data.setLabel(par.getText());
        break;
      case "value":
        data.setValue(par.getText());
        break;
      default:
        readOther(data, par, fieldName);
    }
  }

  public final NativeResponse.Link.Builder readRespLink(JsonParser par) throws IOException {
    NativeResponse.Link.Builder link = NativeResponse.Link.newBuilder();
    for (startObject(par); endObject(par); par.nextToken()) {
      String fieldName = getCurrentName(par);
      if (par.nextToken() != JsonToken.VALUE_NULL) {
        readRespLinkField(par, link, fieldName);
      }
    }
    return link;
  }

  protected void readRespLinkField(
      JsonParser par, NativeResponse.Link.Builder link, String fieldName) throws IOException {
    switch (fieldName) {
      case "url":
        link.setUrl(par.getText());
        break;
      case "clicktrackers":
        for (startArray(par); endArray(par); par.nextToken()) {
          link.addClicktrackers(par.getText());
        }
        break;
      case "fallback":
        link.setFallback(par.getText());
        break;
      default:
        readOther(link, par, fieldName);
    }
  }

  protected final OpenRtbJsonReader coreReader() {
    if (coreReader == null) {
      coreReader = factory().newReader();
    }
    return coreReader;
  }
}


text:
function Role(config, info) {
	this._config = config;
	this._info = info;
};

Object.defineProperty(Role.prototype, 'info', {
	get: function() { return this._info; }
});

Role.prototype.hasPrivilege = function(priv, cb) {
	this._config.roleHasPrivilege(this._info, priv, cb);
};

module.exports = Role;


text:
package ch.alv.components.web;

/**
 * Constants used in the components-web module
 *
 * @since 1.0.0
 */
public interface WebConstant {

    String PARAM_NAME_PAGE = "page";
    String PARAM_NAME_PAGE_SIZE = "pageSize";
    String PARAM_NAME_QUERY = "query";

}


text:
(function() {
    var method;
    var noop = function () {};
    var methods = [
        'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
        'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
        'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
        'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn'
    ];
    var length = methods.length;
    var console = (window.console = window.console || {});

    while (length--) {
        method = methods[length];

        // Only stub undefined methods.
        if (!console[method]) {
            console[method] = noop;
        }
    }
}());

// Place any jQuery/helper plugins in here.

// to top right away
if ( window.location.hash ) scroll(0,0);
// void some browsers issue
setTimeout( function() { scroll(0,0); }, 1);

$(function() {
	var navHeight = $('#nav').height();
    // your current click function
    $('.scroll').on('click', function(e) {
        e.preventDefault();
        $('html, body').animate({
            scrollTop: $($(this).attr('href')).offset().top -(navHeight)
        }, 1000, 'swing');
    });

    // *only* if we have anchor on the url
    if(window.location.hash) {

        // smooth scroll to the anchor id
        $('html, body').animate({
            scrollTop: $(window.location.hash).offset().top -(navHeight)
        }, 1000, 'swing');
    }

});


text:
"""
    binder
    ~~~~~~

    binder is a learning social network. It helps you find and learn with
    other students. Give it a whirl. Sign up today!

    binder is also open source software and available under the MIT license.

    :copyright: (c) 2015 by Ananth Bhaskararaman
    :license: MIT, see LICENSE for more details

"""
import sys

if sys.version < '3.2.0':
    raise RuntimeError("You need at least python 3.4 for binder to work.")

from setuptools import setup

install_requires = [
    'Flask==0.10.1',
    'Flask-Bootstrap==3.3.5.6',
    'Flask-Menu==0.4.0',
    'Flask-Script==2.0.5',
    'Flask-SQLAlchemy==2.0',
    'SQLAlchemy==1.0.8',
    'Flask-Login==0.2.11',
    'rq==0.5.5',
    'Flask-Dance==0.7.0',
    'blinker==1.4',
    'flask-log==0.1.0'
]

if '3.2.0' < sys.version < '3.4.0':
    install_requires.append('enum34==1.0.4')

setup(
    name='binder',
    version='0.0.4',
    description='Brings students closer.',
    license='MIT',
    long_description=__doc__,
    packages=['binder', 'binder.pages'],
    author='Ananth Bhaskararaman',
    author_email='antsub@gmail.com',
    url='http://github.com/ananthb/binder',
    platforms='any',
    install_requires=install_requires,
    entry_points={
        'console_scripts': [
            'binder = binder:binder_app'
        ],
    },
    zip_safe=True,
)


text:
<?php

namespace FSB\ASTT\CoreBundle\Repository;

use Doctrine\ORM\EntityRepository;

class EventRepository extends EntityRepository
{
    public function findAllDisplayedSorteredByDate($queryBuilderOnly = false, $limit = 1000)
    {
        $qb = $this->_em->createQueryBuilder();

        $qb->select('e')
            ->from('FSB\ASTT\CoreBundle\Entity\Event', 'e')
            ->where('e.deleted = :deleted')
            ->setParameter('deleted', false)
            ->orderBy('e.date', 'DESC')
            ->setMaxResults($limit)
        ;

        if ($queryBuilderOnly) {
            return $qb;
        } else {
            return $qb->getQuery()->getResult();
        }
    }

    public function findAllNext($nbResults = 10)
    {
        $today = new \DateTime();
        $today->setTime(0, 0, 0);

        $qb = $this->_em->createQueryBuilder();

        $qb->select('e')
            ->from('FSB\ASTT\CoreBundle\Entity\Event', 'e')
            ->where('e.deleted = :deleted')
            ->andWhere('e.date > :date')
            ->setParameter('deleted', false)
            ->setParameter('date', $today)
            ->orderBy('e.date', 'ASC')
            ->setMaxResults($nbResults)
        ;

        return $qb->getQuery()->getResult();
    }

    public function find($id)
    {
        $qb = $this->_em->createQueryBuilder();

        $qb->select('e')
            ->from('FSB\ASTT\CoreBundle\Entity\Event', 'e')
            ->where('e.deleted = :deleted')
            ->andWhere('e.id = :id')
            ->setParameter('deleted', false)
            ->setParameter('id', $id)
        ;

        try {
            $result = $qb->getQuery()->getSingleResult();
        }
        catch (\Doctrine\Orm\NoResultException $NRE) {
            $result = NULL;
        }

        return $result;
    }

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

    public function findDisplayedEventsForTimeInterval($starttime, $endtime)
    {
        $qb = $this->_em->createQueryBuilder();

        $qb->select('e')
            ->from('FSB\ASTT\CoreBundle\Entity\Event', 'e')
            ->where('e.deleted = :deleted')
            ->andWhere('e.date >= :starttime')
            ->andWhere('e.date <= :endtime')
            ->setParameter('deleted', false)
            ->setParameter('starttime', $starttime)
            ->setParameter('endtime', $endtime)
        ;

        return $qb->getQuery()->getResult();
    }

    public function findNationalTropheeInTimeInterval($starttime, $endtime)
    {
        $qb = $this->_em->createQueryBuilder();

        $qb->select('e')
            ->from('FSB\ASTT\CoreBundle\Entity\Event', 'e')
            ->where('e.deleted = :deleted')
            ->andWhere('e.date >= :starttime')
            ->andWhere('e.date <= :endtime')
            ->andWhere('e.isTournament = :isTournament')
            ->setParameter('deleted', false)
            ->setParameter('starttime', $starttime)
            ->setParameter('endtime', $endtime)
            ->setParameter('isTournament', true)
        ;

        return $qb->getQuery()->getResult();
    }

    public function findAll()
    {
        $qb = $this->_em->createQueryBuilder();

        $qb->select('e')
            ->from('FSB\ASTT\CoreBundle\Entity\Event', 'e')
            ->where('e.deleted = :deleted')
            ->setParameter('deleted', false)
        ;

        return $qb->getQuery()->getResult();
    }
}


text:
asyncTaskDemo
=============

Android Async Task Demo


text:
layout: post
title: "My Hello World for you"
category: presentation
tags: [presentation]
---

Hello World! My name is Matheus and I am a developer, love code, love to see the user
happy when it is using something that I created, that's me, that's who I am.

And now I created this blog cause I always felt like I need to tell everybody about my
new discoveries on programming world. On these days I was loving to play and mix with
mobile development, creating apps and everything about it. It's great when you see your
app working on your mobile device (smartphone, tablet, whatever) gives you a great
feeling. And I think this will be my path for a long time from now.

So I started this blog to help everyone that's starting on this world and need some help.
Now I am coding a lot with hybrid development for mobile using cordova and some frameworks
basically Ionic now, and here I will try to write some tutorials, tips and other interesting
things about the hybrid mobile development.

Hope I can always bring new stuffs for you guys (and ladies) and we can exchange experiencies.

Seeya!


text:
classifier = 'ann';

% train_data = load('train_32x32.mat');
% test_data = load('test_32x32.mat');
%
% [train_data_pp] = mrf_preprocess(train_data,classifier,'train');
% save('train_mrf.mat','train_data_pp');
% [test_data_pp] = mrf_preprocess(test_data,classifier,'test');
% save('test_mrf.mat','test_data_pp');

% Define Parameters
% For ANN

%train_data_pp = load('train_mrf.mat');
%test_data_pp = load('test_mrf.mat');

lr = 0.01;
tr_ratio = 0.8;
v_ratio = 0.2;
numEpoch = 1000;

pca_num = 0;

if pca_num ~= 0
    train_data_pp.X = pca_analysis(train_data_pp.X,pca_num);
    test_data_pp.X = pca_analysis(test_data_pp.X,pca_num);
end

numFvDim = size(train_data_pp.X,2);

numHidden = [100 20];
[net,tr] = ann_train(train_data_pp,test_data_pp,numHidden,numFvDim,lr,numEpoch,tr_ratio,v_ratio);
ann_model=struct();
ann_model.net = net;
ann_model.tr = tr;
save(char(strcat( 'ann',array2str(numHidden),'.mat')), 'ann_model');

numHidden = [100 40];
[net,tr] = ann_train(train_data_pp,test_data_pp,numHidden,numFvDim,lr,numEpoch,tr_ratio,v_ratio);
ann_model=struct();
ann_model.net = net;
ann_model.tr = tr;
save(char(strcat( 'ann',array2str(numHidden),'.mat')), 'ann_model');

numHidden = [100 60];
[net,tr] = ann_train(train_data_pp,test_data_pp,numHidden,numFvDim,lr,numEpoch,tr_ratio,v_ratio);
ann_model=struct();
ann_model.net = net;
ann_model.tr = tr;
save(char(strcat( 'ann',array2str(numHidden),'.mat')), 'ann_model');

numHidden = [100 80];
[net,tr] = ann_train(train_data_pp,test_data_pp,numHidden,numFvDim,lr,numEpoch,tr_ratio,v_ratio);
ann_model=struct();
ann_model.net = net;
ann_model.tr = tr;
save(char(strcat( 'ann',array2str(numHidden),'.mat')), 'ann_model');

numHidden = [100 100];
[net,tr] = ann_train(train_data_pp,test_data_pp,numHidden,numFvDim,lr,numEpoch,tr_ratio,v_ratio);
ann_model=struct();
ann_model.net = net;
ann_model.tr = tr;
save(char(strcat( 'ann',array2str(numHidden),'.mat')), 'ann_model');


text:
require './pages/account'
When(/^I click on option icon$/) do
  @account = Account.new
  logger.debug "Click on account options icon"
  @account.click_on_options_icon
end

Then(/^I will click on account setting link from drop down menu$/) do
  logger.debug "Click on option icon within the top navigator"
  @account.click_on_account_setting_from_drop_down_menu
end

Then(/^I will fill the location field$/) do
  @account = Account.new
  logger.debug "Fill location field with value London"
  @account.fill_location_field
end

Then(/^I will select a gender from the drop down list$/) do
   logger.debug "Select Male gender from Gender drop down list"
   @account.select_gender_from_drop_down_list

end

Then(/^I will fill my DOB$/) do
  logger.debug "Fill birthday fields with 24 10 1986"
  @account.fill_bithday_fields

end


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.css">

Angular

          #
          name
          last name
          phone

          {{user.id}}
          {{user.name}}
          {{user.lastName}}
          {{user.phone}}
          x


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#nullable disable

namespace Microsoft.CodeAnalysis.Symbols
{
    internal interface INamespaceOrTypeSymbolInternal : ISymbolInternal
    {
    }
}