text:
import { messageSW } from './messageSW.js';
import { Workbox } from './Workbox.js';
import './_version.js';
/**
 * @module workbox-window
 */
export { messageSW, Workbox };
export * from './utils/WorkboxEvent.js';


text:
FactoryBot.define do
  factory :season do
    sequence(:name, '2030')
  end

  trait :past do
    name '1999'
  end
end

redpajama_set_name: RedPajamaGithub


text:
dart-polymer-countdowntimer
===========================

Dart Polymer Countdowntimer


text:
from sqlalchemy.orm import exc as s_exc

from networking_cisco.plugins.ml2.drivers.cisco.n1kv import (
    exceptions as c_exc)
from networking_cisco.plugins.ml2.drivers.cisco.n1kv import (
    n1kv_db)
from networking_cisco.plugins.ml2.drivers.cisco.n1kv import (
    policy_profile_service)

import neutron.db.api as db
from neutron.plugins.common import constants as p_const
from neutron.plugins.ml2.drivers.cisco.n1kv import n1kv_models
from neutron.tests.unit.db import test_db_base_plugin_v2
from neutron.tests.unit import testlib_api

TEST_NETWORK_ID = 'abcdefghijklmnopqrstuvwxyz'
TEST_NETWORK_ID2 = 'abcdefghijklmnopqrstuvwxy2'
TEST_NETWORK_PROFILE = {'name': 'test_profile',
                        'segment_type': 'vlan'}
TEST_NETWORK_PROFILE_VXLAN = {'name': 'test_profile2',
                              'segment_type': 'vxlan'}
TEST_POLICY_PROFILE = {'id': '4a417990-76fb-11e2-bcfd-0800200c9a66',
                       'name': 'test_policy_profile',
                       'vsm_ip': '127.0.0.1'}
pprofile_mixin = policy_profile_service.PolicyProfile_db_mixin()

def _create_test_vxlan_network_profile_if_not_there(session,
                                           profile=TEST_NETWORK_PROFILE_VXLAN):
    try:
        _profile = session.query(n1kv_models.NetworkProfile).filter_by(
            name=profile['name']).one()
    except s_exc.NoResultFound:
        _profile = n1kv_db.add_network_profile(profile['name'],
                                          profile['segment_type'])
    return _profile

def _create_test_network_profile_if_not_there(session,
                                              profile=TEST_NETWORK_PROFILE):
    try:
        _profile = session.query(n1kv_models.NetworkProfile).filter_by(
            name=profile['name']).one()
    except s_exc.NoResultFound:
        _profile = n1kv_db.add_network_profile(profile['name'],
                                          profile['segment_type'])
    return _profile

def _create_test_policy_profile_if_not_there(session,
                                             profile=TEST_POLICY_PROFILE):
    try:
        _profile = session.query(n1kv_models.PolicyProfile).filter_by(
            name=profile['name']).one()
    except s_exc.NoResultFound:
        _profile = pprofile_mixin._create_policy_profile(
            profile['id'],
            profile['name'],
            profile['vsm_ip'])
    return _profile

class NetworkProfileTests(testlib_api.SqlTestCase):

    def setUp(self):
        super(NetworkProfileTests, self).setUp()
        self.session = db.get_session()

    def test_create_network_profile(self):
        _db_profile = n1kv_db.add_network_profile(TEST_NETWORK_PROFILE['name'],
                                             p_const.TYPE_VLAN)
        self.assertIsNotNone(_db_profile)
        db_profile = (self.session.query(n1kv_models.NetworkProfile).
                      filter_by(name=TEST_NETWORK_PROFILE['name']).one())
        self.assertIsNotNone(db_profile)
        self.assertEqual(_db_profile.id, db_profile.id)
        self.assertEqual(_db_profile.name, db_profile.name)
        self.assertEqual(_db_profile.segment_type, db_profile.segment_type)

    def test_get_network_profiles_by_type(self):
        test_profiles = [{'name': 'test_profile1',
                          'segment_type': p_const.TYPE_VLAN},
                         {'name': 'test_profile2',
                          'segment_type': p_const.TYPE_VXLAN}]
        for p in test_profiles:
            n1kv_db.add_network_profile(p['name'], p['segment_type'])
        profile = n1kv_db.get_network_profile_by_type(p_const.TYPE_VLAN)
        self.assertEqual(test_profiles[0]['name'], profile['name'])
        self.assertEqual(test_profiles[0]['segment_type'],
                         profile['segment_type'])

    def test_remove_network_profile(self):
        _db_profile = n1kv_db.add_network_profile(TEST_NETWORK_PROFILE['name'],
                                             p_const.TYPE_VLAN)
        db_profile = n1kv_db.get_network_profile_by_type(
                                            p_const.TYPE_VLAN)
        self.assertIsNotNone(db_profile)
        self.assertEqual(_db_profile.id, db_profile.id)
        n1kv_db.remove_network_profile(_db_profile.id)
        self.assertRaises(c_exc.NetworkProfileNotFound,
                          n1kv_db.get_network_profile_by_type,
                          p_const.TYPE_VLAN)

class PolicyProfileTests(testlib_api.SqlTestCase):

    def setUp(self):
        super(PolicyProfileTests, self).setUp()
        self.session = db.get_session()

    def test_create_policy_profile(self):
        _db_profile = pprofile_mixin._create_policy_profile(
            TEST_POLICY_PROFILE['id'],
            TEST_POLICY_PROFILE['name'],
            TEST_POLICY_PROFILE['vsm_ip'])
        self.assertIsNotNone(_db_profile)
        db_profile = (self.session.query(n1kv_models.PolicyProfile).
                      filter_by(name=TEST_POLICY_PROFILE['name']).one)()
        self.assertIsNotNone(db_profile)
        self.assertEqual(_db_profile.id, db_profile.id)
        self.assertEqual(_db_profile.name, db_profile.name)

    def test_delete_policy_profile(self):
        profile = _create_test_policy_profile_if_not_there(self.session)
        pprofile_mixin._remove_policy_profile(profile.id, profile.vsm_ip)
        try:
            self.session.query(n1kv_models.PolicyProfile).filter_by(
                name=TEST_POLICY_PROFILE['name']).one()
        except s_exc.NoResultFound:
            pass
        else:
            self.fail("Policy Profile (%s) was not deleted" %
                      TEST_POLICY_PROFILE['name'])

    def test_get_policy_profile_by_name(self):
        profile = _create_test_policy_profile_if_not_there(self.session)
        got_profile = n1kv_db.get_policy_profile_by_name(
                                            TEST_POLICY_PROFILE['name'])
        self.assertEqual(profile.id, got_profile.id)
        self.assertEqual(profile.name, got_profile.name)

class NetworkBindingsTest(test_db_base_plugin_v2.NeutronDbPluginV2TestCase):

    def setUp(self):
        super(NetworkBindingsTest, self).setUp()
        self.session = db.get_session()

    def test_add_and_get_network_binding(self):
        with self.network() as network:
            TEST_NETWORK_ID = network['network']['id']
            self.assertRaises(c_exc.NetworkBindingNotFound,
                              n1kv_db.get_network_binding,
                              TEST_NETWORK_ID)

            p = _create_test_network_profile_if_not_there(self.session)
            n1kv_db.add_network_binding(TEST_NETWORK_ID,
                                        p_const.TYPE_VLAN,
                                        1234, p.id)
            binding = n1kv_db.get_network_binding(TEST_NETWORK_ID)
            self.assertIsNotNone(binding)
            self.assertEqual(TEST_NETWORK_ID, binding.network_id)
            self.assertEqual(p_const.TYPE_VLAN, binding.network_type)
            self.assertEqual(1234, binding.segmentation_id)

    def test_add_and_get_multiple_network_bindings(self):
        with self.network() as network1:
            with self.network() as network2:
                TEST_NETWORK_ID1 = network1['network']['id']
                TEST_NETWORK_ID2 = network2['network']['id']
                self.assertRaises(c_exc.NetworkBindingNotFound,
                                  n1kv_db.get_network_binding,
                                  TEST_NETWORK_ID1)
                self.assertRaises(c_exc.NetworkBindingNotFound,
                                  n1kv_db.get_network_binding,
                                  TEST_NETWORK_ID2)
                p = _create_test_network_profile_if_not_there(self.session)
                n1kv_db.add_network_binding(
                    TEST_NETWORK_ID1, p_const.TYPE_VLAN,
                    1234, p.id)
                binding = n1kv_db.get_network_binding(TEST_NETWORK_ID1)
                self.assertIsNotNone(binding)
                self.assertEqual(TEST_NETWORK_ID1, binding.network_id)
                self.assertEqual(p_const.TYPE_VLAN,
                                 binding.network_type)
                n1kv_db.add_network_binding(
                    TEST_NETWORK_ID2, p_const.TYPE_VLAN,
                    1235, p.id)
                binding = n1kv_db.get_network_binding(TEST_NETWORK_ID2)
                self.assertIsNotNone(binding)
                self.assertEqual(TEST_NETWORK_ID2, binding.network_id)
                self.assertEqual(p_const.TYPE_VLAN,
                                 binding.network_type)
                self.assertEqual(1235, binding.segmentation_id)

    def test_add_and_get_network_binding_vxlan(self):
        with self.network() as network:
            TEST_NETWORK_ID = network['network']['id']
            self.assertRaises(c_exc.NetworkBindingNotFound,
                              n1kv_db.get_network_binding,
                              TEST_NETWORK_ID)

            p = _create_test_vxlan_network_profile_if_not_there(self.session)
            n1kv_db.add_network_binding(
                TEST_NETWORK_ID, p_const.TYPE_VXLAN,
                1234, p.id)
            binding = n1kv_db.get_network_binding(TEST_NETWORK_ID)
            self.assertIsNotNone(binding)
            self.assertEqual(TEST_NETWORK_ID, binding.network_id)
            self.assertEqual(p_const.TYPE_VXLAN, binding.network_type)
            self.assertEqual(1234, binding.segmentation_id)

    def test_add_and_get_multiple_network_bindings_vxlan(self):
        with self.network() as network1:
            with self.network() as network2:
                TEST_NETWORK_ID1 = network1['network']['id']
                TEST_NETWORK_ID2 = network2['network']['id']
                self.assertRaises(c_exc.NetworkBindingNotFound,
                                  n1kv_db.get_network_binding,
                                  TEST_NETWORK_ID1)
                self.assertRaises(c_exc.NetworkBindingNotFound,
                                  n1kv_db.get_network_binding,
                                  TEST_NETWORK_ID2)
                p = _create_test_vxlan_network_profile_if_not_there(
                    self.session)
                n1kv_db.add_network_binding(
                    TEST_NETWORK_ID1, p_const.TYPE_VXLAN,
                    1234, p.id)
                binding = n1kv_db.get_network_binding(TEST_NETWORK_ID1)
                self.assertIsNotNone(binding)
                self.assertEqual(TEST_NETWORK_ID1, binding.network_id)
                self.assertEqual(p_const.TYPE_VXLAN,
                                 binding.network_type)
                n1kv_db.add_network_binding(
                    TEST_NETWORK_ID2, p_const.TYPE_VXLAN,
                    1235, p.id)
                binding = n1kv_db.get_network_binding(TEST_NETWORK_ID2)
                self.assertIsNotNone(binding)
                self.assertEqual(TEST_NETWORK_ID2, binding.network_id)
                self.assertEqual(p_const.TYPE_VXLAN,
                                 binding.network_type)
                self.assertEqual(1235, binding.segmentation_id)

    def test_add_and_get_multiple_network_bindings_mix(self):
        with self.network() as network1:
            with self.network() as network2:
                TEST_NETWORK_ID1 = network1['network']['id']
                TEST_NETWORK_ID2 = network2['network']['id']
                self.assertRaises(c_exc.NetworkBindingNotFound,
                                  n1kv_db.get_network_binding,
                                  TEST_NETWORK_ID1)
                self.assertRaises(c_exc.NetworkBindingNotFound,
                                  n1kv_db.get_network_binding,
                                  TEST_NETWORK_ID2)
                p = _create_test_network_profile_if_not_there(self.session)
                p2 = _create_test_vxlan_network_profile_if_not_there(
                    self.session)
                n1kv_db.add_network_binding(
                    TEST_NETWORK_ID1, p_const.TYPE_VXLAN,
                    1234, p2.id)
                binding = n1kv_db.get_network_binding(TEST_NETWORK_ID1)
                self.assertIsNotNone(binding)
                self.assertEqual(binding.network_id, TEST_NETWORK_ID1)
                self.assertEqual(binding.network_type,
                                 p_const.TYPE_VXLAN)
                n1kv_db.add_network_binding(
                    TEST_NETWORK_ID2, p_const.TYPE_VLAN,
                    1235, p.id)
                binding = n1kv_db.get_network_binding(TEST_NETWORK_ID2)
                self.assertIsNotNone(binding)
                self.assertEqual(TEST_NETWORK_ID2, binding.network_id)
                self.assertEqual(p_const.TYPE_VLAN,
                                 binding.network_type)
                self.assertEqual(1235, binding.segmentation_id)

class ProfileBindingsTest(test_db_base_plugin_v2.NeutronDbPluginV2TestCase):

    def setUp(self):
        super(ProfileBindingsTest, self).setUp()
        self.session = db.get_session()

    def test_add_and_get_profile_binding(self):
        with self.port() as port:
            TEST_PORT_ID = port['port']['id']
            self.assertRaises(c_exc.PortBindingNotFound,
                              n1kv_db.get_policy_binding,
                              TEST_PORT_ID)

            p = _create_test_policy_profile_if_not_there(self.session)
            n1kv_db.add_policy_binding(TEST_PORT_ID, p.id)
            binding = n1kv_db.get_policy_binding(TEST_PORT_ID)
            self.assertIsNotNone(binding)
            self.assertEqual(TEST_PORT_ID, binding.port_id)
            self.assertEqual(p.id, binding.profile_id)

    def test_add_and_get_multiple_profile_bindings(self):
        with self.subnet() as subnet:
            with self.port(subnet=subnet) as port1:
                with self.port(subnet=subnet) as port2:
                    TEST_PORT_ID1 = port1['port']['id']
                    TEST_PORT_ID2 = port2['port']['id']
                    self.assertRaises(c_exc.PortBindingNotFound,
                                      n1kv_db.get_policy_binding,
                                      TEST_PORT_ID1)
                    self.assertRaises(c_exc.PortBindingNotFound,
                                      n1kv_db.get_policy_binding,
                                      TEST_PORT_ID2)

                    p = _create_test_policy_profile_if_not_there(self.session)
                    n1kv_db.add_policy_binding(TEST_PORT_ID1, p.id)
                    binding = n1kv_db.get_policy_binding(TEST_PORT_ID1)
                    self.assertIsNotNone(binding)
                    self.assertEqual(TEST_PORT_ID1, binding.port_id)
                    self.assertEqual(p.id, binding.profile_id)
                    n1kv_db.add_policy_binding(TEST_PORT_ID2, p.id)
                    binding = n1kv_db.get_policy_binding(TEST_PORT_ID2)
                    self.assertIsNotNone(binding)
                    self.assertEqual(TEST_PORT_ID2, binding.port_id)
                    self.assertEqual(p.id, binding.profile_id)


text:
<?php
/**
 * Created by PhpStorm.
 * User: mgz
 * Date: 7/14/14
 * Time: 10:29 AM
 */

namespace MeetPHP\CoreBundle\DataFixtures\ORM\Defaults;

use MeetPHP\CoreBundle\DataFixtures\ORM\YamlFixtures;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;

class LoadUser extends YamlFixtures implements OrderedFixtureInterface, ContainerAwareInterface
{
    public function load(ObjectManager $manager)
    {
        $data = $this->getModelFixtures();
        $userManager = $this->container->get('fos_user.user_manager');

        foreach ($data as $reference => $item) {
            $user = $userManager->createUser();
            $this->fromArray($user, $item);
            $userManager->updateUser($user, false);

            $this->addReference($reference, $user);
        }
        $manager->flush();
    }

    public function getOrder()
    {
        return 10;
    }

    public function getModelFile()
    {
        return 'user';
    }
}


text:
<resources>
    <string name="app_name">li天气</string>
</resources>


text:
#include <aws/cognito-idp/model/ResendConfirmationCodeRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::CognitoIdentityProvider::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;

ResendConfirmationCodeRequest::ResendConfirmationCodeRequest() :
    m_clientIdHasBeenSet(false),
    m_secretHashHasBeenSet(false),
    m_usernameHasBeenSet(false)
{
}

Aws::String ResendConfirmationCodeRequest::SerializePayload() const
{
  JsonValue payload;

  if(m_clientIdHasBeenSet)
  {
   payload.WithString("ClientId", m_clientId);

  }

  if(m_secretHashHasBeenSet)
  {
   payload.WithString("SecretHash", m_secretHash);

  }

  if(m_usernameHasBeenSet)
  {
   payload.WithString("Username", m_username);

  }

  return payload.WriteReadable();
}

Aws::Http::HeaderValueCollection ResendConfirmationCodeRequest::GetRequestSpecificHeaders() const
{
  Aws::Http::HeaderValueCollection headers;
  headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSCognitoIdentityProviderService.ResendConfirmationCode"));
  return headers;

}


text:
namespace mixal_parse {

class Index
{
public:
	Index();
	Index(const Expression& expr);

	bool empty() const;

	const Expression& expression() const;

private:
	Expression expr_;
};

} // namespace mixal_parse

namespace mixal_parse {

inline Index::Index()
	: expr_{}
{
}

inline Index::Index(const Expression& expr)
	: expr_{expr}
{
}

inline bool Index::empty() const
{
	return !expr_.is_valid();
}

inline const Expression& Index::expression() const
{
	return expr_;
}

} // namespace mixal_parse


text:
/* jshint -W079 */ /* Ignores Redefinition of plastic */

/**
 * plastic.js Namespace
 *
 * @namespace
 */
var plastic = {

    /**
     * Version Number
     * @type String
     */
    version: '0.0.5',

    /**
     * Array which holds all the plastic.js Elements
     *
     * @type Array
     */
    elements: [],

    /**
     * Module Namespace
     *
     * This includes module and depencency handling and of course all available modules
     *
     *
     * @namespace
     */
    modules: {

        /**
         * Query Parser Modules Namespace
         * @namespace
         * @ignore
         */
        query: {},

        /**
         * API Parser Modules Namespace
         * @namespace
         * @ignore
         */
        api: {},

        /**
         * Data Parser Modules Namespace
         * @namespace
         * @ignore
         */
        data: {},

        /**
         * Display Modules Namespace
         * @namespace
         * @ignore
         */
        display: {}

    },

    /**
     * Namespace for helper functions
     * @namespace
     * @ignore
     */
    helper: {}

};

/**
 * Executes plastic.js
 *
 * This is done automatically on the DOM Ready Event
 */
plastic.execute = function() {
    "use strict";

    if (this.options.debug) {
        plastic.msg.log('[MAIN] plastic.js version v' + plastic.version + ' INIT');
    }

    /**
     * Global plastic events
     *
     * PubSub Pattern
     *
     * @type {plastic.helper.Events}
     */
    plastic.events = new plastic.helper.Events();

    // Get all <plastic> elements on the page and store them as jQuery DOM Objects
    var $plasticElements = $('plastic, .plastic-js');

    // Create new plastic.Elements
    $plasticElements.each(function() {

        var el = $(this);

        // If Debug Mode is activated: Do not use Exception handling (let it crash)
        if (plastic.options.debug) {
            plastic.elements.push(new plastic.Element(el));
        } else {
            if (plastic.options.debug) {
                plastic.elements.push(new plastic.Element(el));
            } else {
                try {
                    plastic.elements.push(new plastic.Element(el));
                } catch(e) {
                    plastic.msg.error('plastic element crashed while init', 'error', el);
                }
            }

        }

    });

    // Fetch all registered Dependencies
    plastic.modules.dependencyManager.fetch();

    $.each(plastic.elements, function(i, el ) {
        if (el.options.debug) {
            el.execute();
        } else {
            try {
                el.execute();
            } catch(e) {
                plastic.message.error('plastic.js Element Crash on init');
            }
        }

    });

};

// Execute plastic.js on DOM Ready
$(document).ready(function() {
    plastic.execute();
});

plastic.options = {

    /**
     * Debug Mode
     *
     * This enables logging of some informations to the console
     * This also ignores Exception handiling. If an error occurs it will crash hard and precice.
     *
     * @type {boolean}
     */
    debug: true,

    /**
     *
     * If true, plastic.js will keep a log object
     *
     * It is stored in plastic.msg._logs and can be JSON Dumped via plastic.msg.dumpLog();
     *
     */
    log: true,

    /**
     * Logs Benchmark Infos to the console
     *
     * @type {boolean}
     */
    benchmark: false,

    /**
     * Width of Canvas, if not given
     * @type {string}
     */
    width: '100%',

    /**
     * Height of Canvas, if not given
     * @type {string}
     */
    height: 'auto',

    /**
     * Default AJAX Timeout (in ms)
     * @type {number}
     */
    timeout: 3000
};

/**
LazyLoad makes it easy and painless to lazily load one or more external
JavaScript or CSS files on demand either during or after the rendering of a web
page.

Supported browsers include Firefox 2+, IE6+, Safari 3+ (including Mobile
Safari), Google Chrome, and Opera 9+. Other browsers may or may not work and
are not officially supported.

Visit https://github.com/rgrove/lazyload/ for more info.

Copyright (c) 2011 Ryan Grove <ryan@wonko.com>
All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the 'Software'), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission 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.

@module lazyload
@class LazyLoad
@static
*/

LazyLoad = (function (doc) {
  // -- Private Variables ------------------------------------------------------

  // User agent and feature test information.
  var env,

  // Reference to the  element (populated lazily).
  head,

  // Requests currently in progress, if any.
  pending = {},

  // Number of times we've polled to check whether a pending stylesheet has
  // finished loading. If this gets too high, we're probably stalled.
  pollCount = 0,

  // Queued requests.
  queue = {css: [], js: []},

  // Reference to the browser's list of stylesheets.
  styleSheets = doc.styleSheets;

  // -- Private Methods --------------------------------------------------------

  /**
  Creates and returns an HTML element with the specified name and attributes.

  @method createNode
  @param {String} name element name
  @param {Object} attrs name/value mapping of element attributes
  @return {HTMLElement}
  @private
  */
  function createNode(name, attrs) {
    var node = doc.createElement(name), attr;

    for (attr in attrs) {
      if (attrs.hasOwnProperty(attr)) {
        node.setAttribute(attr, attrs[attr]);
      }
    }

    return node;
  }

  /**
  Called when the current pending resource of the specified type has finished
  loading. Executes the associated callback (if any) and loads the next
  resource in the queue.

  @method finish
  @param {String} type resource type ('css' or 'js')
  @private
  */
  function finish(type) {
    var p = pending[type],
        callback,
        urls;

    if (p) {
      callback = p.callback;
      urls     = p.urls;

      urls.shift();
      pollCount = 0;

      // If this is the last of the pending URLs, execute the callback and
      // start the next request in the queue (if any).
      if (!urls.length) {
        callback && callback.call(p.context, p.obj);
        pending[type] = null;
        queue[type].length && load(type);
      }
    }
  }

  /**
  Populates the env variable with user agent and feature test
  information.

  @method getEnv
  @private
  */
  function getEnv() {
    var ua = navigator.userAgent;

    env = {
      // True if this browser supports disabling async mode on dynamically
      // created script nodes. See
      // http://wiki.whatwg.org/wiki/Dynamic_Script_Execution_Order
      async: doc.createElement('script').async === true
    };

    (env.webkit = /AppleWebKit\//.test(ua))
      || (env.ie = /MSIE|Trident/.test(ua))
      || (env.opera = /Opera/.test(ua))
      || (env.gecko = /Gecko\//.test(ua))
      || (env.unknown = true);
  }

  /**
  Loads the specified resources, or the next resource of the specified type
  in the queue if no resources are specified. If a resource of the specified
  type is already being loaded, the new request will be queued until the
  first request has been finished.

  When an array of resource URLs is specified, those URLs will be loaded in
  parallel if it is possible to do so while preserving execution order. All
  browsers support parallel loading of CSS, but only Firefox and Opera
  support parallel loading of scripts. In other browsers, scripts will be
  queued and loaded one at a time to ensure correct execution order.

  @method load
  @param {String} type resource type ('css' or 'js')
  @param {String|Array} urls (optional) URL or array of URLs to load
  @param {Function} callback (optional) callback function to execute when the
    resource is loaded
  @param {Object} obj (optional) object to pass to the callback function
  @param {Object} context (optional) if provided, the callback function will
    be executed in this object's context
  @private
  */
  function load(type, urls, callback, obj, context) {
    var _finish = function () { finish(type); },
        isCSS   = type === 'css',
        nodes   = [],
        i, len, node, p, pendingUrls, url;

    env || getEnv();

    if (urls) {
      // If urls is a string, wrap it in an array. Otherwise assume it's an
      // array and create a copy of it so modifications won't be made to the
      // original.
      urls = typeof urls === 'string' ? [urls] : urls.concat();

      // Create a request object for each URL. If multiple URLs are specified,
      // the callback will only be executed after all URLs have been loaded.
      //
      // Sadly, Firefox and Opera are the only browsers capable of loading
      // scripts in parallel while preserving execution order. In all other
      // browsers, scripts must be loaded sequentially.
      //
      // All browsers respect CSS specificity based on the order of the link
      // elements in the DOM, regardless of the order in which the stylesheets
      // are actually downloaded.
      if (isCSS || env.async || env.gecko || env.opera) {
        // Load in parallel.
        queue[type].push({
          urls    : urls,
          callback: callback,
          obj     : obj,
          context : context
        });
      } else {
        // Load sequentially.
        for (i = 0, len = urls.length; i < len; ++i) {
          queue[type].push({
            urls    : [urls[i]],
            callback: i === len - 1 ? callback : null, // callback is only added to the last URL
            obj     : obj,
            context : context
          });
        }
      }
    }

    // If a previous load request of this type is currently in progress, we'll
    // wait our turn. Otherwise, grab the next item in the queue.
    if (pending[type] || !(p = pending[type] = queue[type].shift())) {
      return;
    }

    head || (head = doc.head || doc.getElementsByTagName('head')[0]);
    pendingUrls = p.urls.concat();

    for (i = 0, len = pendingUrls.length; i < len; ++i) {
      url = pendingUrls[i];

      if (isCSS) {
          node = env.gecko ? createNode('style') : createNode('link', {
            href: url,
            rel : 'stylesheet'
          });
      } else {
        node = createNode('script', {src: url});
        node.async = false;
      }

      node.className = 'lazyload';
      node.setAttribute('charset', 'utf-8');

      if (env.ie && !isCSS && 'onreadystatechange' in node && !('draggable' in node)) {
        node.onreadystatechange = function () {
          if (/loaded|complete/.test(node.readyState)) {
            node.onreadystatechange = null;
            _finish();
          }
        };
      } else if (isCSS && (env.gecko || env.webkit)) {
        // Gecko and WebKit don't support the onload event on link nodes.
        if (env.webkit) {
          // In WebKit, we can poll for changes to document.styleSheets to
          // figure out when stylesheets have loaded.
          p.urls[i] = node.href; // resolve relative URLs (or polling won't work)
          pollWebKit();
        } else {
          // In Gecko, we can import the requested URL into a


text:
u"""
Fixer for:
(a,)* *b (,c)* [,] = s
for (a,)* *b (,c)* [,] in d: ...
"""

from lib2to3 import fixer_base
from itertools import count
from ..fixer_util import Assign, Comma, Call, Newline, Name, Number, indentation, suitify, commatize, token, syms, Node, Leaf

def assignment_source(num_pre, num_post, LISTNAME, ITERNAME):
    u"""
    Accepts num_pre and num_post, which are counts of values
    before and after the starg (not including the starg)
    Returns a source fit for Assign() from fixer_util
    """
    children = []
    pre = unicode(num_pre)
    post = unicode(num_post)
    # This code builds the assignment source from lib2to3 tree primitives.
    # It's not very readable, but it seems like the most correct way to do it.
    if num_pre > 0:
        pre_part = Node(syms.power, [Name(LISTNAME), Node(syms.trailer, [Leaf(token.LSQB, u"["), Node(
            syms.subscript, [Leaf(token.COLON, u":"), Number(pre)]), Leaf(token.RSQB, u"]")])])
        children.append(pre_part)
        children.append(Leaf(token.PLUS, u"+", prefix=u" "))
    main_part = Node(syms.power, [Leaf(token.LSQB, u"[", prefix=u" "), Name(LISTNAME), Node(syms.trailer, [Leaf(token.LSQB, u"["), Node(syms.subscript, [Number(pre) if num_pre > 0 else Leaf(
        1, u""), Leaf(token.COLON, u":"), Node(syms.factor, [Leaf(token.MINUS, u"-"), Number(post)]) if num_post > 0 else Leaf(1, u"")]), Leaf(token.RSQB, u"]"), Leaf(token.RSQB, u"]")])])
    children.append(main_part)
    if num_post > 0:
        children.append(Leaf(token.PLUS, u"+", prefix=u" "))
        post_part = Node(syms.power, [Name(LISTNAME, prefix=u" "), Node(syms.trailer, [Leaf(token.LSQB, u"["), Node(
            syms.subscript, [Node(syms.factor, [Leaf(token.MINUS, u"-"), Number(post)]), Leaf(token.COLON, u":")]), Leaf(token.RSQB, u"]")])])
        children.append(post_part)
    source = Node(syms.arith_expr, children)
    return source

class FixUnpacking(fixer_base.BaseFix):

    PATTERN = u"""
    expl=expr_stmt< testlist_star_expr<
        pre=(any ',')*
            star_expr< '*' name=NAME >
        post=(',' any)* [','] > '=' source=any > |
    impl=for_stmt< 'for' lst=exprlist<
        pre=(any ',')*
            star_expr< '*' name=NAME >
        post=(',' any)* [','] > 'in' it=any ':' suite=any>"""

    def fix_explicit_context(self, node, results):
        pre, name, post, source = (results.get(n)
                                   for n in (u"pre", u"name", u"post", u"source"))
        pre = [n.clone() for n in pre if n.type == token.NAME]
        name.prefix = u" "
        post = [n.clone() for n in post if n.type == token.NAME]
        target = [n.clone() for n in commatize(pre + [name.clone()] + post)]
        # to make the special-case fix for "*z, = ..." correct with the least
        # amount of modification, make the left-side into a guaranteed tuple
        target.append(Comma())
        source.prefix = u""
        setup_line = Assign(
            Name(self.LISTNAME), Call(Name(u"list"), [source.clone()]))
        power_line = Assign(
            target, assignment_source(len(pre), len(post), self.LISTNAME, self.ITERNAME))
        return setup_line, power_line

    def fix_implicit_context(self, node, results):
        u"""
        Only example of the implicit context is
        a for loop, so only fix that.
        """
        pre, name, post, it = (results.get(n)
                               for n in (u"pre", u"name", u"post", u"it"))
        pre = [n.clone() for n in pre if n.type == token.NAME]
        name.prefix = u" "
        post = [n.clone() for n in post if n.type == token.NAME]
        target = [n.clone() for n in commatize(pre + [name.clone()] + post)]
        # to make the special-case fix for "*z, = ..." correct with the least
        # amount of modification, make the left-side into a guaranteed tuple
        target.append(Comma())
        source = it.clone()
        source.prefix = u""
        setup_line = Assign(
            Name(self.LISTNAME), Call(Name(u"list"), [Name(self.ITERNAME)]))
        power_line = Assign(
            target, assignment_source(len(pre), len(post), self.LISTNAME, self.ITERNAME))
        return setup_line, power_line

    def transform(self, node, results):
        u"""
        a,b,c,d,e,f,*g,h,i = range(100) changes to
        _3to2list = list(range(100))
        a,b,c,d,e,f,g,h,i, = _3to2list[:6] + [_3to2list[6:-2]] + _3to2list[-2:]

        and

        for a,b,*c,d,e in iter_of_iters: do_stuff changes to
        for _3to2iter in iter_of_iters:
            _3to2list = list(_3to2iter)
            a,b,c,d,e, = _3to2list[:2] + [_3to2list[2:-2]] + _3to2list[-2:]
            do_stuff
        """
        self.LISTNAME = self.new_name(u"_3to2list")
        self.ITERNAME = self.new_name(u"_3to2iter")
        expl, impl = results.get(u"expl"), results.get(u"impl")
        if expl is not None:
            setup_line, power_line = self.fix_explicit_context(node, results)
            setup_line.prefix = expl.prefix
            power_line.prefix = indentation(expl.parent)
            setup_line.append_child(Newline())
            parent = node.parent
            i = node.remove()
            parent.insert_child(i, power_line)
            parent.insert_child(i, setup_line)
        elif impl is not None:
            setup_line, power_line = self.fix_implicit_context(node, results)
            suitify(node)
            suite = [k for k in node.children if k.type == syms.suite][0]
            setup_line.prefix = u""
            power_line.prefix = suite.children[1].value
            suite.children[2].prefix = indentation(suite.children[2])
            suite.insert_child(2, Newline())
            suite.insert_child(2, power_line)
            suite.insert_child(2, Newline())
            suite.insert_child(2, setup_line)
            results.get(u"lst").replace(Name(self.ITERNAME, prefix=u" "))


text:
layout: "aws"
page_title: "AWS: sns_topic_subscription"
sidebar_current: "docs-aws-resource-sns-topic-subscription"
description: |-
  Provides a resource for subscribing to SNS topics.
---

# aws\_sns\_topic\_subscription

  Provides a resource for subscribing to SNS topics. Requires that an SNS topic exist for the subscription to attach to.
This resource allows you to automatically place messages sent to SNS topics in SQS queues, send them as HTTP(S) POST requests
to a given endpoint, send SMS messages, or notify devices / applications. The most likely use case for Terraform users will
probably be SQS queues.

## Example Usage

You can directly supply a topic and ARN by hand in the `topic_arn` property along with the queue ARN:

```
resource "aws_sns_topic_subscription" "user_updates_sqs_target" {
    topic_arn = "arn:aws:sns:us-west-2:432981146916:user-updates-topic"
    protocol = "sqs"
    endpoint = "arn:aws:sqs:us-west-2:432981146916:terraform-queue-too"
}
```

Alternatively you can use the ARN properties of a managed SNS topic and SQS queue:

```
resource "aws_sns_topic" "user_updates" {
  name = "user-updates-topic"
}

resource "aws_sqs_queue" "user_updates_queue" {
	name = "user-updates-queue"
}

resource "aws_sns_topic_subscription" "user_updates_sqs_target" {
    topic_arn = "${aws_sns_topic.user_updates.arn}"
    protocol  = "sqs"
    endpoint  = "${aws_sqs_queue.user_updates_queue.arn}"
}
```

## Argument Reference

The following arguments are supported:

* `topic_arn` - (Required) The ARN of the SNS topic to subscribe to
* `protocol` - (Required) The protocol to use. The possible values for this are: `sqs`,  `lambda`, `application`. (`http` or `https` are partially supported, see below) (`email`, `sms`, are options but unsupported, see below).
* `endpoint` - (Required) The endpoint to send data to, the contents will vary with the protocol. (see below for more information)
* `endpoint_auto_confirms` - (Optional) Boolean indicating whether the end point is capable of [auto confirming subscription](http://docs.aws.amazon.com/sns/latest/dg/SendMessageToHttp.html#SendMessageToHttp.prepare) e.g., PagerDuty (default is false)
* `confirmation_timeout_in_minutes` - (Optional) Integer indicating number of minutes to wait in retying mode for fetching subscription arn before marking it as failure. Only applicable for http and https protocols (default is 1 minute).
* `raw_message_delivery` - (Optional) Boolean indicating whether or not to enable raw message delivery (the original message is directly passed, not wrapped in JSON with the original message in the message property).

### Protocols supported

Supported SNS protocols include:

* `lambda` -- delivery of JSON-encoded message to a lambda function
* `sqs` -- delivery of JSON-encoded message to an Amazon SQS queue
* `application` -- delivery of JSON-encoded message to an EndpointArn for a mobile app and device

Partially supported SNS protocols include:

* `http` -- delivery of JSON-encoded messages via HTTP. Supported only for the end points that auto confirms the subscription.
* `https` -- delivery of JSON-encoded messages via HTTPS. Supported only for the end points that auto confirms the subscription.

Unsupported protocols include the following:

* `email` -- delivery of message via SMTP
* `email-json` -- delivery of JSON-encoded message via SMTP
* `sms` -- delivery text message

These are unsupported because the endpoint needs to be authorized and does not
generate an ARN until the target email address has been validated. This breaks
the Terraform model and as a result are not currently supported.

### Specifying endpoints

Endpoints have different format requirements according to the protocol that is chosen.

* SQS endpoints come in the form of the SQS queue's ARN (not the URL of the queue) e.g: `arn:aws:sqs:us-west-2:432981146916:terraform-queue-too`
* Application endpoints are also the endpoint ARN for the mobile app and device.

## Attributes Reference

The following attributes are exported:

* `id` - The ARN of the subscription
* `topic_arn` - The ARN of the topic the subscription belongs to
* `protocol` - The protocol being used
* `endpoint` - The full endpoint to send data to (SQS ARN, HTTP(S) URL, Application ARN, SMS number, etc.)
* `arn` - The ARN of the subscription stored as a more user-friendly property


text:
#ifndef COMBINEDSOUNDSOURCE_H
#define COMBINEDSOUNDSOURCE_H

#include "soundsource.h"

class CombinedSoundSource : public SoundSource
{
public:
    CombinedSoundSource();

    void addSource(const SoundSourcePtr& source);
    std::vector<SoundSourcePtr> getSources() { return m_sources; }

    void play();
    void stop();

    bool isBuffering();
    bool isPlaying();

    void setLooping(bool looping);
    void setRelative(bool relative);
    void setReferenceDistance(float distance);
    void setGain(float gain);
    void setPitch(float pitch);
    void setPosition(const Point& pos);
    void setVelocity(const Point& velocity);
    void setFading(FadeState state, float fadetime);

protected:
    virtual void update();

private:
    std::vector<SoundSourcePtr> m_sources;
};

#endif


text:
package com.micmiu.framework.utils;

/**
 * 反射工具类
 *
 * @author Michael Sun
 */
public class RefTools {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
	}
}


text:
Test invalid args for callback
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php

try {
	$socket = new ZMQSocket(new ZMQContext(), ZMQ::SOCKET_REQ, 'my persistent 1', 'this_function_does_not_exist');
	echo "Fail\n";
} catch (ZMQSocketException $e) {
	echo "OK\n";
}

try {
	$ctx = new ZMQContext();
	$socket = $ctx->getSocket(ZMQ::SOCKET_REQ, 'my persistent 2', 'this_function_does_not_exist');
	echo "Fail\n";
} catch (ZMQSocketException $e) {
	echo "OK\n";
}

--EXPECT--
OK
OK


text:
/*
 * Channel.h
 *
 *  Created on: Jun 25, 2015
 *      Author: jiabin
 */

#ifndef TUSST_CHANNEL_H_
#define TUSST_CHANNEL_H_

#include <stdint.h>
#include <time.h>
#include <iostream>

namespace gwc {
namespace tusst {

const int MAX_RECV_BUF_SIZE = 0X100000; //1M
const int MAX_SEND_BUF_SIZE = 0X100000; //1M

enum {
	CHANNEL_TYPE_NONE = 0,
	CHANNEL_TYPE_TCP_LONG_CONN_SERVICE = 1,
	CHANNEL_TYPE_TCP_LONG_CONN_CLIENT = 2,
	CHANNEL_TYPE_TCP_SHORT_CONN_SERVICE = 3,
	CHANNEL_TYPE_TCP_SHORT_CONN_CLIENT = 4,
	CHANNEL_TYPE_TCP_INTERFACE = 5,
	CHANNEL_TYPE_UDP_SERVICE = 6,
	CHANNEL_TYPE_UDP_INTERFACE = 7,
};

enum {
	CHANNEL_STAT_NONE = 0,
	CHANNEL_STAT_USED = 1,
	CHANNEL_STAT_CONNECTING = 2,
	CHANNEL_STAT_CONNECTED = 3,
};

class Channel {
public:
	void Init(int fd, uint8_t type, uint8_t svcIfId);
	void Free();

	inline void SetLastAccessTime(const timeval &tv) { lastAccessTime = tv; }

	union {
		uint8_t ifId;
		uint8_t svcId;
	};
	int sock;
	uint8_t type;
	uint8_t stat;
	timeval lastAccessTime;
	std::string recvBuf;
	std::string sendBuf;

private:
	friend class ChannelQueue;
	Channel *pre;
	Channel *next;

};

class ChannelQueue {
public:
	ChannelQueue();
	virtual ~ChannelQueue();

	int Push(Channel *c);
	Channel *Pop();
	int Remove(Channel *c);
	int Access(Channel *c);

	inline const Channel *Top() { return head; };
	inline const char *GetLastErr() { return lastErr; }

private:
	Channel *head;
	Channel *tail;
	char lastErr[128];
};

} /* namespace utss */
} /* namespace gwc */

#endif /* TUSST_CHANNEL_H_ */


text:
package org.redisson.api;

import org.redisson.codec.JsonCodec;
import reactor.core.publisher.Mono;

import java.util.List;

/**
 * Redis JSON datatype holder. Data is stored as JSON object in Redis
 *
 * @author Nikita Koksharov
 * @param <V> the type of object
 */
public interface RJsonBucketReactive<V> extends RBucketReactive<V> {

    /**
     * Get Json object/objects by JSONPath
     *
     * @param codec object codec
     * @param paths JSON paths
     * @return object
     *
     * @param <T> the type of object
     */
    <T> Mono<T> get(JsonCodec<T> codec, String... paths);

    /**
     * Sets Json object by JSONPath only if previous value is empty
     *
     * @param path JSON path
     * @param value object
     * @return {@code true} if successful, or {@code false} if
     *         value was already set
     */
    Mono<Boolean> setIfAbsent(String path, Object value);

    /**
     * Use {@link #setIfAbsent(String, Object)} instead
     *
     * @param path JSON path
     * @param value object
     * @return {@code true} if successful, or {@code false} if
     *         value was already set
     */
    @Deprecated
    Mono<Boolean> trySet(String path, Object value);

    /**
     * Sets Json object by JSONPath only if previous value is non-empty
     *
     * @param path JSON path
     * @param value object
     * @return {@code true} if successful, or {@code false} if
     *         element wasn't set
     */
    Mono<Boolean> setIfExists(String path, Object value);

    /**
     * Atomically sets the value to the given updated value
     * by given JSONPath, only if serialized state of
     * the current value equals to serialized state of the expected value.
     *
     * @param path JSON path
     * @param expect the expected value
     * @param update the new value
     * @return {@code true} if successful; or {@code false} if the actual value
     *         was not equal to the expected value.
     */
    Mono<Boolean> compareAndSet(String path, Object expect, Object update);

    /**
     * Retrieves current value of element specified by JSONPath
     * and replaces it with newValue.
     *
     * @param codec object codec
     * @param path JSON path
     * @param newValue value to set
     * @return previous value
     */
    <T> Mono<T> getAndSet(JsonCodec<T> codec, String path, Object newValue);

    /**
     * Stores object into element by specified JSONPath.
     *
     * @param path JSON path
     * @param value value to set
     * @return void
     */
    Mono<Void> set(String path, Object value);

    /**
     * Returns size of string data by JSONPath
     *
     * @param path JSON path
     * @return size of string
     */
    Mono<Long> stringSize(String path);

    /**
     * Returns list of string data size by JSONPath.
     * Compatible only with enhanced syntax starting with '$' character.
     *
     * @param path JSON path
     * @return list of string data sizes
     */
    Mono<List<Long>> stringSizeMulti(String path);

    /**
     * Appends string data to element specified by JSONPath.
     * Returns new size of string data.
     *
     * @param path JSON path
     * @param value data
     * @return size of string data
     */
    Mono<Long> stringAppend(String path, Object value);

    /**
     * Appends string data to elements specified by JSONPath.
     * Returns new size of string data.
     * Compatible only with enhanced syntax starting with '$' character.
     *
     * @param path JSON path
     * @param value data
     * @return list of string data sizes
     */
    Mono<List<Long>> stringAppendMulti(String path, Object value);

    /**
     * Appends values to array specified by JSONPath.
     * Returns new size of array.
     *
     * @param path JSON path
     * @param values values to append
     * @return size of array
     */
    Mono<Long> arrayAppend(String path, Object... values);

    /**
     * Appends values to arrays specified by JSONPath.
     * Returns new size of arrays.
     * Compatible only with enhanced syntax starting with '$' character.
     *
     * @param path JSON path
     * @param values values to append
     * @return list of arrays size
     */
    Mono<List<Long>> arrayAppendMulti(String path, Object... values);

    /**
     * Returns index of object in array specified by JSONPath.
     * -1 means object not found.
     *
     * @param path JSON path
     * @param value value to search
     * @return index in array
     */
    Mono<Long> arrayIndex(String path, Object value);

    /**
     * Returns index of object in arrays specified by JSONPath.
     * -1 means object not found.
     * Compatible only with enhanced syntax starting with '$' character.
     *
     * @param path JSON path
     * @param value value to search
     * @return list of index in arrays
     */
    Mono<List<Long>> arrayIndexMulti(String path, Object value);

    /**
     * Returns index of object in array specified by JSONPath
     * in range between start (inclusive) and end (exclusive) indexes.
     * -1 means object not found.
     *
     * @param path JSON path
     * @param value value to search
     * @param start start index, inclusive
     * @param end end index, exclusive
     * @return index in array
     */
    Mono<Long> arrayIndex(String path, Object value, Mono<Long> start, Mono<Long> end);

    /**
     * Returns index of object in arrays specified by JSONPath
     * in range between start (inclusive) and end (exclusive) indexes.
     * -1 means object not found.
     * Compatible only with enhanced syntax starting with '$' character.
     *
     * @param path JSON path
     * @param value value to search
     * @param start start index, inclusive
     * @param end end index, exclusive
     * @return list of index in arrays
     */
    Mono<List<Long>> arrayIndexMulti(String path, Object value, Mono<Long> start, Mono<Long> end);

    /**
     * Inserts values into array specified by JSONPath.
     * Values are inserted at defined index.
     *
     * @param path JSON path
     * @param index array index at which values are inserted
     * @param values values to insert
     * @return size of array
     */
    Mono<Long> arrayInsert(String path, Mono<Long> index, Object... values);

    /**
     * Inserts values into arrays specified by JSONPath.
     * Values are inserted at defined index.
     * Compatible only with enhanced syntax starting with '$' character.
     *
     * @param path JSON path
     * @param index array index at which values are inserted
     * @param values values to insert
     * @return list of arrays size
     */
    Mono<List<Long>> arrayInsertMulti(String path, Mono<Long> index, Object... values);

    /**
     * Returns size of array specified by JSONPath.
     *
     * @param path JSON path
     * @return size of array
     */
    Mono<Long> arraySize(String path);

    /**
     * Returns size of arrays specified by JSONPath.
     * Compatible only with enhanced syntax starting with '$' character.
     *
     * @param path JSON path
     * @return list of arrays size
     */
    Mono<List<Long>> arraySizeMulti(String path);

    /**
     * Polls last element of array specified by JSONPath.
     *
     * @param codec object codec
     * @param path JSON path
     * @return last element
     *
     * @param <T> the type of object
     */
    <T> Mono<T> arrayPollLast(JsonCodec<T> codec, String path);

    /**
     * Polls last element of arrays specified by JSONPath.
     * Compatible only with enhanced syntax starting with '$' character.
     *
     * @param codec object codec
     * @param path JSON path
     * @return list of last elements
     *
     * @param <T> the type of object
     */
    <T> Mono<List<T>> arrayPollLastMulti(JsonCodec<T> codec, String path);

    /**
     * Polls first element of array specified by JSONPath.
     *
     * @param codec object codec
     * @param path JSON path
     * @return first element
     *
     * @param <T> the type of object
     */
    <T> Mono<T> arrayPollFirst(JsonCodec<T> codec, String path);

    /**
     * Polls first element of arrays specified by JSONPath.
     * Compatible only with enhanced syntax starting with '$' character.
     *
     * @param codec object codec
     * @param path JSON path
     * @return list of first elements
     *
     * @param <T> the type of object
     */
    <T> Mono<List<T>> arrayPollFirstMulti(JsonCodec<T> codec, String path);

    /**
     * Pops element located at index of array specified by JSONPath.
     *
     * @param codec object codec
     * @param path JSON path
     * @param index array index
     * @return element
     *
     * @param <T> the type of object
     */
    <T> Mono<T> arrayPop(JsonCodec<T> codec, String path, Mono<Long> index);

    /**
     * Pops elements located at index of arrays specified by JSONPath.
     * Compatible only with enhanced syntax starting with '$' character.
     *
     * @param codec object codec
     * @param path JSON path
     * @param index array index
     * @return list of elements
     *
     * @param <T> the type of object
     */
    <T> Mono<List<T>> arrayPopMulti(JsonCodec<T> codec, String path, Mono<Long> index);

    /**
     * Trims array specified by JSONPath in range
     * between start (inclusive) and end (inclusive) indexes.
     *
     * @param path JSON path
     * @param start start index, inclusive
     * @param end end index, inclusive
     * @return length of array
     */
    Mono<Long> arrayTrim(String path, Mono<Long> start, Mono<Long> end);

    /**
     * Trims arrays specified by JSONPath in range
     * between start (inclusive) and end (inclusive) indexes.
     * Compatible only with enhanced syntax starting with '$' character.
     *
     * @param path JSON path
     * @param start start index, inclusive
     * @param end end index, inclusive
     * @return length of array
     */
    Mono<List<Long>> arrayTrimMulti(String path, Mono<Long> start, Mono<Long> end);

    /**
     * Clears json container.
     *
     * @return number of cleared containers
     */
    Mono<Long> clear();

    /**
     * Clears json container specified by JSONPath.
     * Compatible only with enhanced syntax starting with '$' character.
     *
     * @param path JSON path
     * @return number of cleared containers
     */
    Mono<Long> clear(String path);

    /**
     * Increments the current value specified by JSONPath by delta.
     *
     * @param path JSON path
     * @param delta increment value
     * @return the updated value
     */
    <T extends Number> Mono<T> incrementAndGet(String path, Mono<T> delta);

    /**
     * Increments the current values specified by JSONPath by delta.
     * Compatible only with enhanced syntax starting with '$' character.
     *
     * @param path JSON path
     * @param delta increment value
     * @return list of updated value
     */
    <T extends Number> Mono<List<T>> incrementAndGetMulti(String path, Mono<T> delta);

    /**
     * Returns keys amount in JSON container
     *
     * @return keys amount
     */
    Mono<Long> countKeys();

    /**
     * Returns keys amount in JSON container specified by JSONPath
     *
     * @param path JSON path
     * @return keys amount
     */
    Mono<Long> countKeys(String path);

    /**
     * Returns list of keys amount in JSON containers specified by JSONPath
     *
     * @param path JSON path
     * @return list of keys amount
     */
    Mono<List<Long>> countKeysMulti(String path);

    /**
     * Returns list of keys in JSON container
     *
     * @return list of keys
     */
    Mono<List<String>> getKeys();

    /**
     * Returns list of keys in JSON container specified by JSONPath
     *
     * @param path JSON path
     * @return list of keys
     */
    Mono<List<String>> getKeys(String path);

    /**
     * Returns list of keys in JSON containers specified by JSONPath
     *
     * @param path JSON path
     * @return list of keys
     */
    Mono<List<List<String>>> getKeysMulti(String path);

    /**
     * Toggle Mono<Boolean> value specified by JSONPath
     *
     * @param path JSON path
     * @return new Mono<Boolean> value
     */
    Mono<Boolean> toggle(String path);

    /**
     * Toggle Mono<Boolean> values specified by JSONPath
     *
     * @param path JSON path
     * @return list of Mono<Boolean> values
     */
    Mono<List<Boolean>> toggleMulti(String path);

    /**
     * Returns type of element
     *
     * @return type of element
     */
    Mono<JsonType> getType();

    /**
     * Returns type of element specified by JSONPath
     *
     * @param path JSON path
     * @return type of element
     */
    Mono<JsonType> getType(String path);

    /**
     * Deletes JSON elements specified by JSONPath
     *
     * @param path JSON path
     * @return number of deleted elements
     */
    Mono<Long> delete(String path);

}


text:
namespace mclib::abl {

//***************************************************************************

enum class UseType : uint32_t
{
	USE_EXPR,
	USE_TARGET,
	USE_REFPARAM
} UseType;

enum class BlockType : uint32_t
{
	BLOCK_MODULE,
	BLOCK_ROUTINE
} BlockType;

//***************************************************************************

//----------
// FUNCTIONS
const std::unique_ptr<Type>&
expression(void);
const std::unique_ptr<Type>&
variable(const std::unique_ptr<SymTableNode>& variableIdPtr);
const std::unique_ptr<Type>&
arraySubscriptList(const std::unique_ptr<Type>& ptype);
// const std::unique_ptr<Type>& routineCall (const std::unique_ptr<SymTableNode>& routineIdPtr, BOOL parmCheckFlag);
void
checkRelationalOpTypes(const std::unique_ptr<Type>& type1, const std::unique_ptr<Type>& type2);
int32_t
isAssignTypeCompatible(const std::unique_ptr<Type>& type1, const std::unique_ptr<Type>& type2);
void
ifTokenGet(TokenCodeType tokenCode);
void
ifTokenGetElseError(TokenCodeType tokenCode, SyntaxErrorType errCode);

// DECL routines
void
declarations(const std::unique_ptr<SymTableNode>& routineIdPtr, bool allowFunctions);
void
constDefinitions(void);
void
doConst(const std::unique_ptr<SymTableNode>& constantIdPtr);
void
varDeclarations(const std::unique_ptr<SymTableNode>& routineIdPtr);
void
varOrFieldDeclarations(const std::unique_ptr<SymTableNode>& routineIdPtr, int32_t offset);
void
typeDefinitions(void);
const std::unique_ptr<Type>&
doType(void);
const std::unique_ptr<Type>&
identifierType(const std::unique_ptr<SymTableNode>& idPtr);
const std::unique_ptr<Type>&
enumerationType(void);
const std::unique_ptr<Type>&
subrangeType(void);
const std::unique_ptr<Type>&
arrayType(void);
int32_t
arraySize(const std::unique_ptr<Type>& ptype);
const std::unique_ptr<Type>&
makeStringType(int32_t length);

// ROUTINE functions
void
module(void);
const std::unique_ptr<SymTableNode>&
moduleHeader(void);
void
routine(void);
const std::unique_ptr<SymTableNode>&
functionHeader(void);
const std::unique_ptr<SymTableNode>&
formalParamList(int32_t* count, int32_t* totalSize);
const std::unique_ptr<Type>&
routineCall(const std::unique_ptr<SymTableNode>& routineIdPtr, int32_t paramCheckFlag);
const std::unique_ptr<Type>&
declaredRoutineCall(const std::unique_ptr<SymTableNode>& routineIdPtr, int32_t paramCheckFlag);
void
actualParamList(const std::unique_ptr<SymTableNode>& routineIdPtr, int32_t paramCheckFlag);
void
block(const std::unique_ptr<SymTableNode>& routineIdPtr);

// STATEMNT routines
void
compoundStatement(void);
void
assignmentStatement(const std::unique_ptr<SymTableNode>& varIdPtr);
void
repeatStatement(void);
void
whileStatement(void);
void
ifStatement(void);
void
forStatement(void);
void
switchStatement(void);
void
transStatement(void);
void
statement(void);

// STANDARD routines
void
stdPrint(void);
const std::unique_ptr<Type>&
stdAbs(void);
const std::unique_ptr<Type>&
stdRound(void);
const std::unique_ptr<Type>&
stdTrunc(void);
const std::unique_ptr<Type>&
stdSqrt(void);
const std::unique_ptr<Type>&
stdRandom(void);
const std::unique_ptr<Type>&
standardRoutineCall(const std::unique_ptr<SymTableNode>& routineIdPtr);

// FILE routines
int32_t
openSourceFile(const std::wstring_view& sourceFileName);
int32_t
closeSourceFile(void);

#if !ANALYZE_ON
#define analyzeConstDefn(idPtr)
#define analyzeVarDecl(idPtr)
#define analyzeTypeDefn(idPtr)
#define analyzeRoutineHeader(idPtr)
#define analyzeBlock(idPtr)
#endif

//***************************************************************************

} // namespace mclib::abl

#endif


text:
cd $( dirname "${BASH_SOURCE[0]}" )
cp -rf npvr.plugin ~/Library/Internet\ Plug-Ins/


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="rustdoc">
    <meta name="description" content="API documentation for the Rust `num` mod in crate `std`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, num">

    <title>std::num - Rust</title>

    <link rel="stylesheet" type="text/css" href="../../rustdoc.css">
    <link rel="stylesheet" type="text/css" href="../../main.css">

    <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico">

std

        <form class="search-form js-only">

                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press 'S' to search, '?' for more options…"
                       type="search">

        </form>

Module std::<wbr>num1.0.0

                       [−]

               [src]

Additional functionality for numerics.

This module provides some extra types that are useful when doing numerical
work. See the individual documentation for each piece for more information.

Structs

                           ParseFloatError

An error which can be returned when parsing a float.

                           ParseIntError

An error which can be returned when parsing an integer.

                           Wrapping

Provides intentionally-wrapped arithmetic on T.

                           TryFromIntError

                               [Unstable]
The error type returned when a checked integral type conversion fails.

Enums

                           FpCategory

A classification of floating point numbers.

Traits

                           One

                               [Deprecated] [Unstable]
Types that have a "one" value.

                           Zero

                               [Deprecated] [Unstable]
Types that have a "zero" value.

Help

Keyboard Shortcuts

?

Show this help dialog

S

Focus the search field

⇤

Move up in search results

⇥

Move down in search results

⏎

Go to active search result

+

Collapse/expand all sections

Search Tricks

                    Prefix searches with a type followed by a colon (e.g.
                    fn:) to restrict the search to a given type.

                    Accepted types are: fn, mod,
                    struct, enum,
                    trait, type, macro,
                    and const.

                    Search functions by type signature (e.g.
                    vec -> usize or * -> vec)


text:
namespace GSMTest
{
    using System;

    public class Battery
    {
        private const int InitialNumber = 0;
        private const string InitialString = null;

        private int hoursIdle;
        private int hoursTalk;
        private BatteryType model;

        public Battery(BatteryType newModel, int hoursIdle, int hoursTalk)
        {
            this.Model = newModel;
            this.HoursTalk = hoursTalk;
            this.HoursIdle = hoursIdle;
        }

        public Battery()
        {
            this.Model = BatteryType.None;
            this.HoursTalk = InitialNumber;
            this.HoursIdle = InitialNumber;
        }
        public BatteryType Model
        {
            get
            {
                return this.model;
            }
            set
            {
                if (value != BatteryType.LiIon && value != BatteryType.NiCd && value != BatteryType.NiMH)
                {
                    throw new ArgumentException("Invalid name of model!");
                }
                this.model = value;
            }
        }

        public int HoursIdle
        {
            get
            {
                return this.hoursIdle;
            }
            set
            {

                if (value < 1)
                {
                    throw new ArgumentOutOfRangeException("Invalid number!");
                }
                this.hoursIdle = value;

            }
        }

        public int HoursTalk
        {
            get
            {
                return this.hoursTalk;
            }
            set
            {
                if (value < 1)
                {
                    throw new ArgumentOutOfRangeException("Invalid number!");
                }
                this.hoursTalk = value;
            }
        }
    }
}


text:
/*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * License: Apache License, Version 2.0
 * See the LICENSE file in the root directory or visit http://www.apache.org/licenses/LICENSE-2.0
 */
package org.hibernate.sqm.domain;

/**
 * Descriptor for a Hibernate ANY mapping
 *
 * @author Steve Ebersole
 */
public interface AnyType extends Type {
	BasicType getDiscriminatorType();
	Type getIdentifierType();
}


text:
/**
 * Created by dllo on 17/8/23.
 */
const path = require('path')
const webpack = require('webpack')
// 引入文件夹config,require回去读取文件夹中的index.js文件
const config = require('../config')
// 引入公用工具类 utils
const utils = require('./utils')
function resolve (dir) {
  return path.join(__dirname, '..', dir)
}

module.exports = {
  entry: utils.getEntries('./src/modules/**/index.js'),

  output: {
    path: config.build.assetsRoot,
    filename: '[name].[hash:7].js',
    publicPath: process.env.NODE_ENV === 'production'
            ? config.build.assetsPublicPath
            : config.dev.assetsPublicPath
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: 'eslint-loader',
        enforce: 'pre', // 在编译之前
        include: [resolve('src'), resolve('test')],
        options: {
          formatter: require('eslint-friendly-formatter')
        }
      },
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: 'babel-loader'
      },
      {
        test: /\.styl$/,
        use: [
          'style-loader',
          'css-loader',
          'stylus-loader'
        ]
      },
      {
        test: /\.(png|jpe?g|gif|svg)$/,
                // loader配合options使用
        loader: 'url-loader',

        options: {
          limit: 10000,
          name: utils.assetsPath('img/[name].[hash:7].[ext]')
        }
      }

    ]
  }

}


text:
oauth2client\.file module
=========================

.. automodule:: oauth2client.file
    :members:
    :undoc-members:
    :show-inheritance:


text:
#include <algorithm>
#include <string>

#include "paddle/fluid/operators/beam_search_decode_op.h"
#include "paddle/fluid/platform/device_context.h"

namespace paddle {
namespace operators {

struct BeamSearchDecodeFunctor {
  BeamSearchDecodeFunctor(const LoDTensorArray& step_ids,
                          const LoDTensorArray& step_scores,
                          LoDTensor* id_tensor, LoDTensor* score_tensor,
                          size_t beam_size, int end_id)
      : beam_size_(beam_size),
        end_id_(end_id),
        step_ids_origin_(step_ids),
        step_scores_origin_(step_scores),
        id_tensor_(id_tensor),
        score_tensor_(score_tensor) {
    tensor_on_gpu_ = false;
    // First make a copy of GPU data on CPU
    if (platform::is_gpu_place(step_ids_origin_[0].place())) {
      tensor_on_gpu_ = true;
      platform::DeviceContextPool& pool =
          platform::DeviceContextPool::Instance();
      auto* dev_ctx = pool.Get(step_ids_origin_[0].place());
      // Copy all tensors in the input tensor array
      for (auto& step_id : step_ids_origin_) {
        framework::LoDTensor out;
        if (step_id.numel() > 0) {
          dev_ctx->Wait();
          framework::TensorCopy(step_id, platform::CPUPlace(), *dev_ctx, &out);
          dev_ctx->Wait();
        }

        out.set_lod(step_id.lod());
        step_ids_.push_back(out);
      }
    }
    if (platform::is_gpu_place(step_scores_origin_[0].place())) {
      tensor_on_gpu_ = true;
      platform::DeviceContextPool& pool =
          platform::DeviceContextPool::Instance();
      auto* dev_ctx = pool.Get(step_scores_origin_[0].place());
      // Copy all tensors in the input tensor array
      for (auto& step_score : step_scores_origin_) {
        framework::LoDTensor out;
        if (step_score.numel() > 0) {
          dev_ctx->Wait();
          framework::TensorCopy(step_score, platform::CPUPlace(), *dev_ctx,
                                &out);
          dev_ctx->Wait();
        }

        out.set_lod(step_score.lod());
        step_scores_.push_back(out);
      }
    }
  }

  template <typename T>
  void apply() const;

  bool tensor_on_gpu_;
  size_t beam_size_;
  int end_id_;
  // TODO(Superjomn) Here might result serious performance issue in the
  // concurrency
  // scenarios.
  const LoDTensorArray& step_ids_origin_;
  const LoDTensorArray& step_scores_origin_;
  LoDTensorArray step_ids_ = LoDTensorArray();
  LoDTensorArray step_scores_ = LoDTensorArray();
  LoDTensor* id_tensor_;
  LoDTensor* score_tensor_;
};

template <typename T>
void BeamSearchDecodeFunctor::apply() const {
  BeamSearchDecoder<T> beam_search_decoder(beam_size_, end_id_);
  // Check if the tensor is on GPU. If so, use the CPU copy instead
  if (tensor_on_gpu_) {
    beam_search_decoder.Backtrace(step_ids_, step_scores_, id_tensor_,
                                  score_tensor_);
  } else {
    beam_search_decoder.Backtrace(step_ids_origin_, step_scores_origin_,
                                  id_tensor_, score_tensor_);
  }
}

template <>
void BeamSearchDecodeFunctor::apply<bool>() const {
  PADDLE_THROW("beam search decode op does not support bool!");
}

class BeamSearchDecodeOp : public framework::OperatorBase {
 public:
  BeamSearchDecodeOp(const std::string& type,
                     const framework::VariableNameMap& inputs,
                     const framework::VariableNameMap& outputs,
                     const framework::AttributeMap& attrs)
      : OperatorBase(type, inputs, outputs, attrs) {}

 private:
  void RunImpl(const framework::Scope& scope,
               const platform::Place& dev_place) const override {
    platform::DeviceContextPool& pool = platform::DeviceContextPool::Instance();
    auto& dev_ctx = *pool.Get(dev_place);

    framework::RuntimeContext run_ctx(Inputs(), Outputs(), scope);
    framework::ExecutionContext ctx(*this, scope, dev_ctx, run_ctx, nullptr);

    const LoDTensorArray* ids = ctx.Input<LoDTensorArray>("Ids");
    const LoDTensorArray* scores = ctx.Input<LoDTensorArray>("Scores");
    const size_t step_num = ids->size();
    PADDLE_ENFORCE_GT(step_num, 0UL,
                      "beam search steps should be larger than 0");
    const size_t source_num = ids->at(0).lod().at(0).size() - 1;
    PADDLE_ENFORCE_GT(source_num, 0UL, "source num should be larger than 0");

    for (size_t i = 0; i < step_num; ++i) {
      PADDLE_ENFORCE_EQ(ids->at(i).lod().size(), 2UL,
                        "Level of LodTensor should be 2");
    }

    size_t beam_size = ctx.Attr<int>("beam_size");
    int end_id = ctx.Attr<int>("end_id");

    // prepare output
    LoDTensor* sentenceIds = ctx.Output<LoDTensor>("SentenceIds");
    LoDTensor* sentenceScores = ctx.Output<LoDTensor>("SentenceScores");

    framework::VisitDataType(
        scores->at(0).type(),
        BeamSearchDecodeFunctor(*ids, *scores, sentenceIds, sentenceScores,
                                beam_size, end_id));
  }
};

class BeamSearchDecodeOpProtoMaker : public framework::OpProtoAndCheckerMaker {
 public:
  void Make() override {
    AddInput("Ids",
             "(LodTensorArray)"
             "The LodTensorArray containing the selected ids of all steps");
    AddInput("Scores",
             "(LodTensorArray)"
             "The LodTensorArray containing the selected scores of all steps");
    AddOutput(
        "SentenceIds",
        "(LodTensor)"
        "An LodTensor containing all generated id sequences for all source "
        "sentences");
    AddOutput(
        "SentenceScores",
        "(LodTensor)"
        "An LodTensor containing scores corresponding to Output(SentenceIds)");
    AddAttr<int>("beam_size", "beam size for beam search");
    AddAttr<int>("end_id",
                 "the token id which indicates the end of a sequence");
    AddComment(R"DOC(
Beam Search Decode Operator. This Operator constructs the full hypotheses for
each source sentence by walking back along the LoDTensorArray Input(ids)
whose lods can be used to restore the path in the beam search tree.

The Output(SentenceIds) and Output(SentenceScores) separately contain the
generated id sequences and the corresponding scores. The shapes and lods of the
two LodTensor are same. The lod level is 2 and the two levels separately
indicate how many hypotheses each source sentence has and how many ids each
hypothesis has.
)DOC");
  }
};

class BeamSearchDecodeInferShape : public framework::InferShapeBase {
 public:
  void operator()(framework::InferShapeContext* context) const override {
    PADDLE_ENFORCE(context->HasInput("Ids"),
                   "BeamSearchDecodeOp must has input Ids");
    PADDLE_ENFORCE(context->HasInput("Scores"),
                   "BeamSearchDecodeOp must has input Scores");
    PADDLE_ENFORCE(context->HasOutput("SentenceIds"),
                   "BeamSearchDecodeOp must has output SentenceIds");
    PADDLE_ENFORCE(context->HasOutput("SentenceScores"),
                   "BeamSearchDecodeOp must has output SentenceScores");
  }
};

class BeamSearchDecodeInferVarType : public framework::VarTypeInference {
 public:
  void operator()(framework::InferVarTypeContext* ctx) const override {
    for (auto& o : ctx->Output("SentenceIds")) {
      ctx->SetType(o, framework::proto::VarType::LOD_TENSOR);
    }
    for (auto& o : ctx->Output("SentenceScores")) {
      ctx->SetType(o, framework::proto::VarType::LOD_TENSOR);
    }
  }
};

}  // namespace operators
}  // namespace paddle

REGISTER_OPERATOR(beam_search_decode, paddle::operators::BeamSearchDecodeOp,
                  paddle::operators::BeamSearchDecodeOpProtoMaker,
                  paddle::operators::BeamSearchDecodeInferShape,
                  paddle::operators::BeamSearchDecodeInferVarType,
                  paddle::framework::EmptyGradOpMaker);


text:
<!DOCTYPE html>

    <title>Category</title>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="keywords" content="Category,   RainyAlley" />
    <meta name="description" content="Category,   Developer" />
    <meta name="theme-color" content="#2CA6CB"/>
    <link rel="shortcut icon" type="image/x-icon" media="screen" href="/favicon.ico" />
    <link rel="canonical" href="/category/" />
    <link rel="alternate" type="application/rss+xml" title="RainyAlley" href="/feed.xml"  />

    <link rel="stylesheet" type="text/css" href="http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="/static/octicons/octicons.css" />
    <link rel="stylesheet" type="text/css" href="/static/css/style.css" />

Rainy  Alley

Category

                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">

                    </button>
                    RainyAlley

Developer

                          Blog

                              Archive

                              Category

                              Tag

        <link rel="stylesheet" type="text/css" href="/static/css/article-list.css" />
<link rel="stylesheet" type="text/css" href="/static/css/category.css" />

            <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                 Categories

            </button>

                        All  1

                        性能测试 1

                         2016-03-14

                            我的第一篇blog

记录工作,学习和生活当中的点点滴滴

                        Read More

                             性能测试

                           Comment
                           Share

                         2016-03-14

                            我的第一篇blog

记录工作,学习和生活当中的点点滴滴

                        Read More

                             性能测试

                               Comment
                               Share

                © RainyAlley


text:
table.clsFlexGrid {
  border-collapse:collapse;
  border-width:1px;
  border-style:solid;
  border-color:#aca899;
}

table.clsFlexGrid th {
  border-width:1px;
  border-style:solid;
  border-color:#aca899;
  background-color:#ece9d8;
 color:black;
  font-weight:bold;
  text-align:center;
  padding-left:8px;
  padding-right:8px;
}

table.clsFlexGrid td {
 border:solid 1px #aca899;
}

table.clsFlexGrid tr {
  vertical-align:top;
}

table.clsFlexGrid tfoot {
  font-weight:bold;
}

table.clsFlexGrid thead th.clsSorted {
 background:#FFFFE9;
}

span.clsSort {
 color:blue;
 cursor:hand;
}

div.clsSortMenu {
 background:white;
 border:solid 1px #aca899;
 padding-top:2px;
 padding-bottom:2px;
 padding-left:15px;
 padding-right:15px;
}

table.clsFlexGrid col {
  padding-left:2px;
  padding-right:15px;

}

table.clsFlexGrid col.clsNumber {
  text-align:right;
  padding-left:15px;
  padding-right:2px;
}
table.clsFlexGrid col.clsMoney {
  text-align:right;
  padding-left:15px;
  padding-right:2px;
}
table.clsFlexGrid col.clsCenter {
  text-align:center;
}
table.clsFlexGrid col.clsRight {
  text-align:right;
  padding-left:15px;
  padding-right:2px;
}
table.clsFlexGrid col.clsInteger {
  text-align:right;
  padding-left:15px;
  padding-right:2px;
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<site>
   <feature url="features/nl.vu_compmedchem.klifs.feature-1.1.1.jar" id="nl.vu_compmedchem.klifs.feature" version="1.1.2.qualifier">
      <category name="nl.vu_compmedchem.klifs"/>
   </feature>
   <category-def name="nl.vu_compmedchem.klifs" label="KNIME 3D-e-Chem Contributions"/>
</site>


text:
function run() {
    LaunchBar.execute("/usr/bin/pmset", "displaysleepnow");
}


text:
<?php

namespace Sylius\Bundle\InstallerBundle\Command;

use RuntimeException;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class InstallCommand extends ContainerAwareCommand
{
    protected function configure()
    {
        $this
            ->setName('sylius:install')
            ->setDescription('Sylius installer.')
        ;
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('<info>Installing Sylius.</info>');
        $output->writeln('');

        $this
            ->checkStep($output)
            ->setupStep($input, $output)
        ;

        $output->writeln('<info>Sylius has been successfully installed.</info>');
    }

    protected function checkStep(OutputInterface $output)
    {
        $output->writeln('<info>Checking system requirements.</info>');

        $fulfilled = true;

        foreach ($this->getContainer()->get('sylius.requirements') as $collection) {
            $output->writeln(sprintf('<comment>%s</comment>', $collection->getLabel()));
            foreach ($collection as $requirement) {
                $output->write($requirement->getLabel());
                if ($requirement->isFulfilled()) {
                    $output->writeln(' <info>OK</info>');
                } else {
                    if ($requirement->isRequired()) {
                        $fulfilled = false;
                        $output->writeln(' <error>ERROR</error>');
                        $output->writeln(sprintf('<comment>%s</comment>', $requirement->getHelp()));
                    } else {
                        $output->writeln(' <comment>WARNING</comment>');
                    }
                }
            }
        }

        if (!$fulfilled) {
            throw new RuntimeException('Some system requirements are not fulfilled. Please check output messages and fix them.');
        }

        $output->writeln('');

        return $this;
    }

    protected function setupStep(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('<info>Setting up database.</info>');

        $this->setupDatabase($input, $output);

        if ($this->getHelperSet()->get('dialog')->askConfirmation($output, '<question>Load fixtures (Y/N)?</question>', false)) {
            $this->setupFixtures($input, $output);
        }

        $output->writeln('');
        $output->writeln('<info>Administration setup.</info>');

        $this->setupAdmin($output);

        $output->writeln('');

        return $this;
    }

    protected function setupDatabase(InputInterface $input, OutputInterface $output)
    {
        $this
            ->runCommand('doctrine:database:create', $input, $output)
            ->runCommand('doctrine:schema:create', $input, $output)
            ->runCommand('cache:clear', $input, $output)
            ->runCommand('doctrine:phpcr:repository:init', $input, $output)
            ->runCommand('sylius:search:index', $input, $output)
            ->runCommand('assets:install', $input, $output)
            ->runCommand('assetic:dump', $input, $output)
        ;
    }

    protected function setupFixtures(InputInterface $input, OutputInterface $output)
    {
        $doctrineConfig = $this->getContainer()->get('doctrine.orm.entity_manager')->getConnection()->getConfiguration();
        $logger = $doctrineConfig->getSQLLogger();
        $doctrineConfig->setSQLLogger(null);
        $this
            ->runCommand('doctrine:fixtures:load', $input, $output)
            ->runCommand('doctrine:phpcr:fixtures:load', $input, $output)
        ;
        $doctrineConfig->setSQLLogger($logger);
    }

    protected function setupAdmin(OutputInterface $output)
    {
        $dialog = $this->getHelperSet()->get('dialog');

        $userClass = $this->getContainer()->getParameter('sylius.model.user.class');
        $user = new $userClass;

        $user->setUsername($dialog->ask($output, '<question>Username:</question>'));
        $user->setPlainPassword($dialog->ask($output, '<question>Password:</question>'));
        $user->setEmail($dialog->ask($output, '<question>Email:</question>'));
        $user->setEnabled(true);
        $user->setRoles(array('ROLE_SYLIUS_ADMIN'));

        $em = $this->getContainer()->get('doctrine.orm.entity_manager');
        $em->persist($user);
        $em->flush();
    }

    protected function runCommand($command, InputInterface $input, OutputInterface $output)
    {
        $this
            ->getApplication()
            ->find($command)
            ->run($input, $output)
        ;

        return $this;
    }
}


text:
'use strict';

var _ = require('lodash');

module.exports = exports = toFunction;

function toFunction(fn){
 return _.isFunction(fn) ? fn :
    _.isUndefined(fn) ? _.identity :
    constantly(fn);
}

function constantly(c){
  return function(){
    return c;
  };
}


text:
const fs = require('fs');
const path = require('path');
const glob = require('glob');
const { consolePrinter } = require('./printer');

module.exports = {
  configureCompileWatchlist,
  compileWatchlistFor: configureCompileWatchlist.bind(null, consolePrinter),
};

function configureCompileWatchlist(printer, environments) {
  const locationsToWatch = [];

  environments.forEach(environment => {
    const { testNameSuffix, extension } = environment;

    if (!fs.existsSync(path.normalize(environment.testDir))) {
      printer.error(`Test directory ${path.normalize(environment.testDir)} was not found`);
    }

    const testsToWatch = glob.sync(
      `${path.normalize(environment.testDir)}/**/*${testNameSuffix}.${extension}`,
    );
    testsToWatch.forEach(filepath => {
      const sourceFilePath = getSourcePathFromTestPath(filepath, environment);

      if (!fs.existsSync(sourceFilePath)) {
        printer.notice(`Source file not found for test: "${filepath}"`);
      } else {
        locationsToWatch.push(sourceFilePath);
      }

      locationsToWatch.push(path.join(filepath));
    });
  });

  return removeDuplicates(locationsToWatch);
}

function getSourcePathFromTestPath(testPath, environment) {
  return path.join(
    './',
    path
      .normalize(testPath)
      .replace(path.normalize(environment.testDir), path.normalize(`/${environment.sourceDir}`))
      .replace(
        `${environment.testNameSuffix}.${environment.extension}`,
        `.${environment.extension}`,
      ),
  );
}

function removeDuplicates(array) {
  return [...new Set(array)];
}


text:
function gX = multiKernDiagGradX(kern, X)

% MULTIKERNDIAGGRADX Gradient of MULTI kernel's diagonal with respect to X.
%
%	Description:
%
%	GX = MULTIKERNDIAGGRADX(KERN, X) computes the gradient of the
%	diagonal of the multiple output block kernel matrix with respect to
%	the elements of the design matrix given in X.
%	 Returns:
%	  GX - the gradients of the diagonal with respect to each element of
%	   X. The returned matrix has the same dimensions as X.
%	 Arguments:
%	  KERN - the kernel structure for which gradients are being
%	   computed.
%	  X - the input data in the form of a design matrix.
%
%	See also
%	MULTIKERNPARAMINIT, KERNDIAGGRADX, MULTIKERNGRADX


text:
import sys
import argparse
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

from utils import delete_ds_store, canonize, exists
from sys_cfg import static_sys_cfgs, best_static_cfgs
from matplotlib import rcParams

# Set style
plt.style.use('classic')
rcParams['pdf.fonttype'] = 42
rcParams['ps.fonttype'] = 42

def barplot(objective, sys_cfgs, pcfg):

    ax = plt.figure(figsize=(10, 6)).add_subplot(111)

    data = []
    for cfg in sys_cfgs:
        cfg_dict = best_static_cfgs(objective, cfg)
        data.append(cfg_dict[objective])

    df = pd.DataFrame.from_records(data)
    df['Size'] = pd.to_numeric(df['Size'])

    sns.barplot(x=df['Size'].values, y=canonize(objective), ax=ax, hue='Implementation', data=df,
                ci=None, palette='muted')

    # Style the plot
    ax.set_title(pcfg['title'], fontsize=12, fontweight='bold')
    ax.grid(False)
    ax.set_facecolor('w')
    ax.legend(loc='upper center', ncol=len(df['Implementation'].unique()), fancybox=True, shadow=True)
    ax.set_xticklabels(df['Size'].unique(), horizontalalignment='right', rotation=40)
    ax.set_xlabel(pcfg['xlabel'], fontweight='bold')
    ax.set_ylabel(pcfg['ylabel'], fontweight='bold')
    ax.set_ylim(0, 140)

    plt.savefig('figures/optewe'+pcfg['filename']+'.pdf', format='PDF', bbox_inches='tight', dpi=1200)
#    plt.show()

def lineplot(objective, sys_cfgs, pcfg):

    ax = plt.figure().add_subplot(111)

    for df in sys_cfgs:
        size = pd.to_numeric(df['Size'])
        x = pd.to_numeric(df['Threads'])
        y = pd.to_numeric(df[canonize(objective)])
        ax.plot(x.sort_values(), y.sort_values(), label=r'${}^3$'.format(size.unique()[0]), linewidth=1.5)
        ax.xaxis.set_ticks(x)
        ax.set_xticklabels(x, color='black')

    # Style the plot
    ax.set_title(pcfg['title'], fontsize=12, fontweight='bold')
    ax.grid(False)
    ax.set_facecolor('w')
    ax.legend(loc='upper center', ncol=len(sys_cfgs), fancybox=True, shadow=True)
    ax.set_xlabel(pcfg['xlabel'], fontweight='bold')
    ax.set_ylabel(pcfg['ylabel'], fontweight='bold')
    ax.set_ylim(0, 140)

    filename_postfix = ''
    if df['Implementation'].unique() == 'AVX2':
        filename_postfix = '_avx'

    plt.savefig('figures/optewe'+pcfg['filename']+filename_postfix+'.pdf', format='PDF', bbox_inches='tight', dpi=1200)
#    plt.show()

def plot_cfg(objective, objectives, plot_type):

    title_dict = dict.fromkeys(objectives, 'OptEWE: Performance Comparision')
    ylabel_dict = {'mlups': 'Mega Lattice Update Per Second [MLUPs]', 'runtime': 'Milliseconds (ms)',
                   'edp': 'Energy Delay Product [EDP]', 'ed2p': r'Energy Delay Product Squared [$ED^{2}P$]'}

    xlabel_dict = {'line': 'Number of Threads', 'bar': 'Model Size'}

    cfg = {'title': title_dict[objective], 'ylabel': ylabel_dict[objective], 'xlabel': xlabel_dict[plot_type],
           'ylim': 140, 'filename': '_'+objective+'_'+plot_type}

    return cfg

def main():

    parser = argparse.ArgumentParser(description='A Simple Plot Generator')
    parser.add_argument('-t', '--type', help='Type of plot. Valid types are: [line | bar]', required=True)
    parser.add_argument('-o', '--objective', help='Tuning function objective.'
                                                  'Valid objectives are: [runtime | energy | edp | ed2p | mlups]',
                        required=True)
    parser.add_argument('-d', '--directories', nargs='*', help='Result directories', required=True)
    args = vars(parser.parse_args())

    objectives = {'runtime', 'energy', 'edp', 'ed2p', 'mlups'}
    plot_types = {'line': lineplot, 'bar': barplot}

    objective_exist = exists(args.values(), objectives)
    plot_type_exist = exists(args.values(), plot_types)

    if not objective_exist:
        print 'Valid objectives are: [runtime | energy | edp | ed2p | mlups]'
        sys.exit(2)

    if not plot_type_exist:
        print 'Valid plot types are: [line | bar]'
        sys.exit(2)

    # Get the sys cfg for the input directories
    sys_cfgs = []
    for directory in args['directories']:
        delete_ds_store(directory)
        sys_cfgs.append(static_sys_cfgs(directory))

    # Plot cfg
    pcfg = plot_cfg(args['objective'].lower(), objectives, args['type'])

    # Plot
    plot_types[args['type']](args['objective'].lower(), sys_cfgs, pcfg)

if __name__ == '__main__':
    main()


text:
module Import
    ( module Prelude
    , module Yesod
    , module Foundation
    , module Settings.StaticFiles
    , module Settings.Development
    , module Data.Monoid
    , module Control.Applicative
    , Text
    , cassiusFile
    , juliusFile
    , Haskellers
#if __GLASGOW_HASKELL__ < 704
    , (<>)
#endif
    ) where

import Prelude hiding (writeFile, readFile, head, tail, init, last)
import Yesod   hiding (Route(..))
import Foundation
import Data.Monoid (Monoid (mappend, mempty, mconcat))
import Control.Applicative ((<$>), (<*>), pure)
import Data.Text (Text)
import Settings
import Settings.StaticFiles
import Settings.Development

type Haskellers = App

#if __GLASGOW_HASKELL__ < 704
infixr 5 <>
(<>) :: Monoid m => m -> m -> m
(<>) = mappend
#endif


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="MarkLight is a framework for Unity that offers XUML a design language similar to HTML but instead of creating webpages it is used to design scenes in Unity.">
<meta name="keywords" content="marklight, markux, mvvm, unity, unity3d, mvm, mvp, mvc, ux, ui, user interface, user experience, interfaces, game, games, controls, widgets, xml, markup, framework, design, create, share, dream, build, play, dynamic, responsive, fluid, intuitive, easy, simple, powerful, sleek, elegant, structured, flow, creative">
<meta name="author" content="Ex Makina">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Introduction | MarkLight</title>

<link href="../css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="../css/bootstrap.icon-large.min.css" rel="stylesheet">
<link href="../css/style-documentation.css" rel="stylesheet" type="text/css" media="all" id="styleChange" />
<link href="../css/lightbox.css" type="text/css" rel="stylesheet" />
<link href="../css/responsive.css" type="text/css" rel="stylesheet" />
<link href="../css/vs.css" type="text/css" rel="stylesheet" />

        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-3">
          Toggle navigation

        </button>

Introduction

Tutorials

API docs

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">

                </button>

Home

Download

Documentation

What is MarkLight?

            MarkLight is a markup extension framework for Unity that offers XUML a markup language (like HTML/XAML) used to create views in your scene (UI, meshes, lights, cameras, etc) and connect them to the underlying game logic. The views you create can then easily be combined, extended, styled, shared and customized to your wants.

Getting Started

            I recommend you start by following the Getting Started with MarkLight where you can learn the fundamentals through the process of creating a main game menu. Be sure to check out the tutorials and API docs.

Conversation & Support

            If you want to connect, converse and ask for help:

Join MarkLight chat on Slack:

Subscribe to the MarkLight Subreddit for announcements and discussions

Leave a rating/review on the Asset Store page

Latest Announcements

            MarkLight 2.7.0 Released! Jan 10, 2017

            MarkLight 2.6.0 Released! Sep 9, 2016

            MarkLight 2.5.0 Released! Aug 23, 2016

            MarkLight 2.4.1 Released! Jul 1, 2016

            MarkLight 2.3.0 Released! May 25, 2016

            MarkLight 2.2.0 Released! May 10, 2016

            Added Resource Dictionary tutorial May 9, 2016

            Added State Management tutorial May 1, 2016

            Added Creating Animations tutorial April 30, 2016

            Added Themes and Styles tutorial April 30, 2016

            MarkLight 2.1.0 Released! April 27, 2016

Join the Announcement List

Be notified when new themes, views, tutorials and updates are available

            <form method="post" name="subscribeForm" id="subscribeForm" action="http://scripts.dreamhost.com/add_list.cgi">
                <input type="hidden" name="list" value="news" />
                <input type="hidden" name="domain" value="markux.com" />
                <input type="text" name="email" id="emailInput" placeholder="your email here" />
                <input type="submit" name="submit" id="subscribeButton" value="Subscribe" />
            </form>

 contact@marklightforunity.com


text:
import xhtml2pdf.pisa as pisa
import StringIO

import logging
log = logging.getLogger("xhtml2pdf.wsgi")

class Filter(object):

    def __init__(self, app):
        self.app = app

    def __call__(self, environ, start_response):
        script_name = environ.get('SCRIPT_NAME', '')
        path_info = environ.get('PATH_INFO', '')
        sent = []
        written_response = StringIO.StringIO()
        def replacement_start_response(status, headers, exc_info=None):
            if not self.should_filter(status, headers):
                return start_response(status, headers, exc_info)
            else:
                sent[:] = [status, headers, exc_info]
                return written_response.write
        app_iter = self.app(environ, replacement_start_response)
        if not sent:
            return app_iter
        status, headers, exc_info = sent
        try:
            for chunk in app_iter:
                written_response.write(chunk)
        finally:
            if hasattr(app_iter, 'close'):
                app_iter.close()
        body = written_response.getvalue()
        status, headers, body = self.filter(
            script_name, path_info, environ, status, headers, body)
        start_response(status, headers, exc_info)
        return [body]

    def should_filter(self, status, headers):
        print headers

    def filter(self, status, headers, body):
        raise NotImplementedError

class HTMLFilter(Filter):

    def should_filter(self, status, headers):
        if not status.startswith('200'):
            return False
        for name, value in headers:
            if name.lower() == 'content-type':
                return value.startswith('text/html')
        return False

class PisaMiddleware(HTMLFilter):

    def filter(self,
            script_name,
            path_info,
            environ,
            status,
            headers,
            body):
        topdf = environ.get("pisa.topdf", "")
        if topdf:
            dst = StringIO.StringIO()
            result = pisa.CreatePDF(
                body,
                dst,
                show_error_as_pdf=True,
                )
            headers = [
                ("content-type", "application/pdf"),
                ("content-disposition", "attachment; filename=" + topdf)
                ]
            body = dst.getvalue()
        return status, headers, body