text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">

<title>Lightstreamer.DotNet.Client Namespace</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="generator" content="Doc-O-Matic" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <link rel="STYLESHEET" href="default.css" type="text/css" />

Collapse All

Lightstreamer Silverlight Client 1.3

Lightstreamer.DotNet.Client Namespace

Legend  Topics  Classes  Interfaces

SILVERLIGHT_20

Topics

Name

Description

Classes

The following table lists classes in this documentation.

Interfaces

The following table lists interfaces in this documentation.

Classes

Name

Description

ClientException

Base class for all exceptions directly thrown by library methods.

ConnectionConstraints

Collects the constraints to be applied on the overall data flow from the Connection. They can only be used in order to restrict the constraints set by Lightstreamer Server Metadata Adapter.
Currently, only a constraint on the bandwidth is supported.

ConnectionInfo

Collects the parameters related to a connection request to Lightstreamer server.

ExtendedTableInfo

Contains the specification of a table to be subscribed to Lightstreamer Server. All the items and fields in the table are supplied. Group and Schema names to be sent to the Server are made by space separated concatenations of item and field names. This name convention is suitable for a Metadata Adapter derived from LiteralBasedProvider or equivalent to it.

LSClient

Encapsulates a single connector to Lightstreamer Server.

MessageInfo

A message object that will be sent to a Lightstreamer Server through a call to LSClient.SendMessage The class contains the message string, the sequence to which such message is associated and a timeout to wait before the server declares lost the previous message in sequence.

PushConnException

Thrown when the connection to Lightstreamer Server cannot be established or in case of abnormal connection termination. It can be received both in a synchronous and an asynchronous way.

PushServerException

Thrown in case of an unexpected answer or error condition received from Lightstreamer Server. A detailed error code is supplied, to support automatic recovery actions. It can be received both in a synchronous and an asynchronous way. In normal operation, this exception should never be received.

PushUserException

Thrown in case the Server refuses to satisfy a request because of the constraints imposed by the Metadata Adapter or by Server configuration. A detailed error code is supplied. Both the error code and the message are received from the Server. In particular:
- A positive error code is issued by the Server after checking the request against the constraints imposed by the Metadata Adapter or by its own configuration. See the text protocol documentation for a reference of the error codes that can be issued in response to stream/poll requests.
- A zero or negative error code is issued... more

SimpleTableInfo

Contains the specification of a table to be subscribed to Lightstreamer Server.

SubscrException

Thrown if a subscription or unsubscription specification is not correct or the request cannot be executed for some reason.

SubscribedTableKey

Key object to be used to unsubscribe tables.

Interfaces

Name

Description

IConnectionListener

Receives notifications of connection activity and errors.
The notification sequence follows the pattern:
[CE [SS (NB | DE | AW(true) AW(false) )* [AW(true)] [E | F1 | F2] C] ]
where F1 and F2 represent the two versions of OnFailure().
A distinct listener must be used for any distinct connection opened.
All notifications are sent in sequence on a dedicated thread.

IHandyTableListener

A fully-featured listener interface, which receives notification of data updates and subscription termination for a table.
Upon update of each item, the current and previous state of all fields is provided. If the subscription configuration enables the "COMMAND logic", then the special "key" and "command" fields are determined and the updates are meant as ADD, UPDATE and DELETE commands on the rows of an underlying table, identified by a key value. In this case, the old field values related with an update are referred to the same key.
Both names and positional information are available to identify specific items and... more

ISendMessageListener

Receives notifications of server responses to sent messages. All notifications are sent in sequence on a dedicated thread.

IUpdateInfo

Implemented by Lightstreamer to provide information about an update for a subscribed item. The new and previous values for the subscribed fields are reported.
If the table subscription configuration enables the "COMMAND logic", then the old field values are referred to the same key.
Both names and positional information can be used to identify the specific fields, unless a SimpleTableInfo was used to describe the related table; in that case, only positional information can be used.

Links

Legend, Topics, Classes, Interfaces

Copyright (C) 2004-2011 Weswit s.r.l.

Contents | Index | Home


text:
<?php

namespace DBTiny\QueryBuilder\Traits;

trait JoinTrait
{
    private $joins = [];

    private function addJoin($type, $left, $table, $alias, $condition = null)
    {
        if (!isset($this->joins[ $left ])) {
            $this->joins[ $left ] = [];
        }
        $this->joins[ $left ][] = [
            $type,
            $table,
            $alias,
            $condition
        ];

        return $this;
    }

    public function join($left, $table, $alias = null, $condition = null)
    {
        return $this->addJoin(' INNER JOIN ', $left, $table, $alias, $condition);
    }

    public function leftJoin($left, $table, $alias = null, $condition = null)
    {
        return $this->addJoin(' LEFT JOIN ', $left, $table, $alias, $condition);
    }

    public function rightJoin($left, $table, $alias = null, $condition = null)
    {
        return $this->addJoin(' RIGHT JOIN ', $left, $table, $alias, $condition);
    }

    public function fullJoin($left, $table, $alias = null, $condition = null)
    {
        return $this->addJoin(' FULL JOIN ', $left, $table, $alias, $condition);
    }

    public function getJoinPart($alias)
    {
        if (!isset($this->joins[ $alias ])) {
            return '';
        }

        $query = '';
        foreach ($this->joins[ $alias ] as $join) {
            list($type, $table, $alias, $condition) = $join;

            $query .= $type . $table;

            if ($alias && $alias !== $table) {
                $query .= ' ' . $alias;
            } else {
                $alias = $table;
            }

            if ($condition) {
                $query .= ' ON ' . $condition;
            }

            $query .= $this->getJoinPart($alias);
        }

        return $query;
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.openehealth.ipf.commons.ihe.xds.core.validate.requests;

import org.openehealth.ipf.commons.core.modules.api.Validator;
import org.openehealth.ipf.commons.ihe.xds.core.ebxml.EbXMLRetrieveImagingDocumentSetRequest;
import org.openehealth.ipf.commons.ihe.xds.core.requests.RetrieveDocument;
import org.openehealth.ipf.commons.ihe.xds.core.requests.RetrieveSeries;
import org.openehealth.ipf.commons.ihe.xds.core.requests.RetrieveStudy;
import org.openehealth.ipf.commons.ihe.xds.core.validate.HomeCommunityIdValidator;
import org.openehealth.ipf.commons.ihe.xds.core.validate.ValidationProfile;

import static org.apache.commons.lang3.Validate.notNull;
import static org.openehealth.ipf.commons.ihe.xds.core.validate.ValidationMessage.*;
import static org.openehealth.ipf.commons.ihe.xds.core.validate.ValidatorAssertions.metaDataAssert;

/**
 * Validates a {@link EbXMLRetrieveImagingDocumentSetRequest}.
 *
 * @author Clay Sebourn
 */
public class RetrieveImagingDocumentSetRequestValidator implements Validator<EbXMLRetrieveImagingDocumentSetRequest, ValidationProfile> {
    private final HomeCommunityIdValidator hcValidator = new HomeCommunityIdValidator(true);

    @Override
    public void validate(EbXMLRetrieveImagingDocumentSetRequest request, ValidationProfile profile) {
        notNull(request, "request cannot be null");

        for (RetrieveStudy retrieveStudy : request.getRetrieveStudies()) {
            String studyInstanceUID = retrieveStudy.getStudyInstanceUID();
            metaDataAssert(studyInstanceUID != null && !studyInstanceUID.isEmpty(), STUDY_INSTANCE_UID_MUST_BE_SPECIFIED);

            for (RetrieveSeries retrieveSeries : retrieveStudy.getRetrieveSerieses()) {
                String seriesInstanceUID = retrieveSeries.getSeriesInstanceUID();
                metaDataAssert(seriesInstanceUID != null && !seriesInstanceUID.isEmpty(), SERIES_INSTANCE_UID_MUST_BE_SPECIFIED);

                for (RetrieveDocument document : retrieveSeries.getDocuments()) {
                    //todo: Eliminate this duplicate code from DocumentRequest?
                    String repoId = document.getRepositoryUniqueId();
                    metaDataAssert(repoId != null && !repoId.isEmpty(), REPO_ID_MUST_BE_SPECIFIED);

                    String docId = document.getDocumentUniqueId();
                    metaDataAssert(docId != null && !docId.isEmpty(), DOC_ID_MUST_BE_SPECIFIED);

                    if (profile.getProfile() == ValidationProfile.InteractionProfile.XCA) {
                        hcValidator.validate(document.getHomeCommunityId());
                    }
                }
            }
        }
    }
}


text:
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
info: The "throws" token can be used as identifier
es5id: 7.6.1.2_A1.29
description: Checking if execution of "throws=1" succeeds
---*/

var throws = 1;


text:
package nl.tudelft.watchdog.exceptions;

@SuppressWarnings("serial")
public class ContentReaderException extends Exception {
	public ContentReaderException(){
		super();
	}
	public ContentReaderException(String message){
		super(message);
	}
}


text:
/**
* Package for calculate task.
*
* @author Denis Popov (mailto:d.popov93@mail.ru)
* @version $Id$
* @since 0.1
*/
package ru.job4j;


text:
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.surface_construction_elements import WindowThermalModelParams

log = logging.getLogger(__name__)

class TestWindowThermalModelParams(unittest.TestCase):

    def setUp(self):
        self.fd, self.path = tempfile.mkstemp()

    def tearDown(self):
        os.remove(self.path)

    def test_create_windowthermalmodelparams(self):

        pyidf.validation_level = ValidationLevel.error

        obj = WindowThermalModelParams()
        # alpha
        var_name = "Name"
        obj.name = var_name
        # alpha
        var_standard = "ISO15099"
        obj.standard = var_standard
        # alpha
        var_thermal_model = "ISO15099"
        obj.thermal_model = var_thermal_model
        # real
        var_sdscalar = 0.5
        obj.sdscalar = var_sdscalar
        # alpha
        var_deflection_model = "NoDeflection"
        obj.deflection_model = var_deflection_model
        # real
        var_vacuum_pressure_limit = 0.0001
        obj.vacuum_pressure_limit = var_vacuum_pressure_limit
        # real
        var_initial_temperature = 0.0001
        obj.initial_temperature = var_initial_temperature
        # real
        var_initial_pressure = 0.0001
        obj.initial_pressure = var_initial_pressure

        idf = IDF()
        idf.add(obj)
        idf.save(self.path, check=False)

        with open(self.path, mode='r') as f:
            for line in f:
                log.debug(line.strip())

        idf2 = IDF(self.path)
        self.assertEqual(idf2.windowthermalmodelparamss[0].name, var_name)
        self.assertEqual(idf2.windowthermalmodelparamss[0].standard, var_standard)
        self.assertEqual(idf2.windowthermalmodelparamss[0].thermal_model, var_thermal_model)
        self.assertAlmostEqual(idf2.windowthermalmodelparamss[0].sdscalar, var_sdscalar)
        self.assertEqual(idf2.windowthermalmodelparamss[0].deflection_model, var_deflection_model)
        self.assertAlmostEqual(idf2.windowthermalmodelparamss[0].vacuum_pressure_limit, var_vacuum_pressure_limit)
        self.assertAlmostEqual(idf2.windowthermalmodelparamss[0].initial_temperature, var_initial_temperature)
        self.assertAlmostEqual(idf2.windowthermalmodelparamss[0].initial_pressure, var_initial_pressure)


text:
require 'spec_helper'

describe Walle do
  describe Walle::SDK do

    describe "#parse_available_platforms" do
      it "return an array of plaform" do
        input = "android-24 \n android-22"
        sdk = Walle::SDK.new
        platforms = sdk.parse_available_platforms(input)
        expect(platforms).to eql ['android-24', 'android-22']
      end
    end

  end
end


text:
/**
 * SharingOwnerRule.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */

package com.sforce.soap._2006._04.metadata;

public class SharingOwnerRule  extends com.sforce.soap._2006._04.metadata.SharingBaseRule  implements java.io.Serializable {
    private com.sforce.soap._2006._04.metadata.SharedTo sharedFrom;

    public SharingOwnerRule() {
    }

    public SharingOwnerRule(
           java.lang.String fullName,
           java.lang.String accessLevel,
           com.sforce.soap._2006._04.metadata.AccountSharingRuleSettings accountSettings,
           java.lang.String description,
           java.lang.String label,
           com.sforce.soap._2006._04.metadata.SharedTo sharedTo,
           com.sforce.soap._2006._04.metadata.SharedTo sharedFrom) {
        super(
            fullName,
            accessLevel,
            accountSettings,
            description,
            label,
            sharedTo);
        this.sharedFrom = sharedFrom;
    }

    /**
     * Gets the sharedFrom value for this SharingOwnerRule.
     *
     * @return sharedFrom
     */
    public com.sforce.soap._2006._04.metadata.SharedTo getSharedFrom() {
        return sharedFrom;
    }

    /**
     * Sets the sharedFrom value for this SharingOwnerRule.
     *
     * @param sharedFrom
     */
    public void setSharedFrom(com.sforce.soap._2006._04.metadata.SharedTo sharedFrom) {
        this.sharedFrom = sharedFrom;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof SharingOwnerRule)) return false;
        SharingOwnerRule other = (SharingOwnerRule) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = super.equals(obj) &&
            ((this.sharedFrom==null && other.getSharedFrom()==null) ||
             (this.sharedFrom!=null &&
              this.sharedFrom.equals(other.getSharedFrom())));
        __equalsCalc = null;
        return _equals;
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = super.hashCode();
        if (getSharedFrom() != null) {
            _hashCode += getSharedFrom().hashCode();
        }
        __hashCodeCalc = false;
        return _hashCode;
    }

    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(SharingOwnerRule.class, true);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("http://soap.sforce.com/2006/04/metadata", "SharingOwnerRule"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("sharedFrom");
        elemField.setXmlName(new javax.xml.namespace.QName("http://soap.sforce.com/2006/04/metadata", "sharedFrom"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://soap.sforce.com/2006/04/metadata", "SharedTo"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }

    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }

    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }

    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }

}


text:
<?php

class Squareup_Omni_Model_Resource_Transaction extends Mage_Core_Model_Resource_Db_Abstract
{
    /**
     * Initialize resource model
     */
    protected function _construct()
    {
        $this->_init('squareup_omni/transaction', 'id');
    }

    public function emptyTransactions()
    {
        $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
        Mage::getConfig()->saveConfig('squareup_omni/transactions/begin_time', null);
        Mage::app()->getConfig()->reinit();
        return $connection->truncateTable(
            Mage::getSingleton('core/resource')->getTableName('squareup_omni/transaction')
        );
    }

    public function transactionExists($locationId, $transactionId)
    {
        $coreResource = Mage::getSingleton('core/resource');
        $conn = $coreResource->getConnection('core_read');
        $select = $conn->select('id')
            ->from(
                array(
                    'p' => Mage::getSingleton('core/resource')->getTableName('squareup_omni/transaction')
                ),
                new Zend_Db_Expr('id')
            )
            ->where('square_id = ?', $transactionId)
            ->where('location_id = ?', $locationId);
        $id = $conn->fetchOne($select);

        return $id;
    }

    public function loadNoteBySquareId($squareId)
    {
        $coreResource = Mage::getSingleton('core/resource');
        $conn = $coreResource->getConnection('core_read');
        $select = $conn->select('note')
            ->from(
                array(
                    'p' => Mage::getSingleton('core/resource')->getTableName('squareup_omni/transaction')
                ),
                new Zend_Db_Expr('note')
            )
            ->where('square_id = ?', $squareId);
        $id = $conn->fetchOne($select);

        return $id;
    }
}


text:
(function() {
  function config($locationProvider, $stateProvider) {
     $locationProvider
         .html5Mode({
             enabled: true,
             requireBase: false
          });

     $stateProvider
         .state('home', {
             url: '/',
             controller: 'HomeCtrl as home',
             templateUrl: '/templates/home.html'
         })
         .state('history', {
             url: '/history',
             controller: 'HistCtrl as history',
             templateUrl: '/templates/history.html'
         });
 }

  angular
    .module('blocitoff', ['ui.router', 'firebase'])
    .config(config);
})();


text:
import {RouteGenerator, Test} from "kamboja"
import * as Sinon from "sinon"

export function delay(millisecond = 5){
    return new Promise((resolve, reject)=>{
        setTimeout(()=> {
            resolve()
        }, millisecond)
    })
}

export function spy<T>(obj:T) {
    return Test.mock(obj, Sinon.spy);
}

export function stub<T>(obj:T) {
    return Test.mock(obj, Sinon.stub)
}


text:
using SMSServices.Helper;
using SMSServices.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace SMSServices.Controllers
{
    public class CodingFormatsController : ApiController
    {
        private SMSEntities entities = new SMSEntities();

        // GET api/<controller>
        public IEnumerable<CodingFormats> Get()
        {
            entities.Configuration.ProxyCreationEnabled = false;
            return entities.CodingFormats.ToList();
        }

        // GET api/<controller>/5
        public CodingFormats Get(string TableName)
        {
            return entities.CodingFormats.Where(n => n.TableName == TableName).FirstOrDefault();
        }

        // POST api/<controller>
        public void Post([FromBody]string value)
        {
        }

        // PUT api/<controller>/5
        public void Put(int id, [FromBody]string value)
        {
        }

        // DELETE api/<controller>/5
        public void Delete(int id)
        {
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                entities.Dispose();
            }
            base.Dispose(disposing);
        }

    }
}


text:
from typing import List, TYPE_CHECKING, Tuple, Any, Optional

from ..parser.SystemRDLParser import SystemRDLParser

from .BaseVisitor import BaseVisitor
from .ExprVisitor import ExprVisitor
from .helpers import get_ID_text
from . import helpers

from ..ast import AssignmentCast
from ..source_ref import src_ref_from_antlr
from .. import rdltypes

if TYPE_CHECKING:
    from antlr4.Token import CommonToken
    from ..source_ref import SourceRefBase
    from ..compiler import RDLCompiler
    from .. import component as comp
    from typing import Type

class EnumVisitor(BaseVisitor):

    def __init__(self, compiler: 'RDLCompiler', parent_component: 'comp.Component') -> None:
        super().__init__(compiler)
        self.parent_component = parent_component

    def visitEnum_def(self, ctx):
        # type: (SystemRDLParser.Enum_defContext) -> Tuple[Type[rdltypes.UserEnum], str, SourceRefBase]
        self.compiler.namespace.enter_scope()

        # Allowing enum definitions to access Parameters from the parent scope
        # opens a whole can of worms since there is no clear way for me to ensure
        # they are elaborated accurately (deepcopying a python Enum is a pain)
        # Since this is an extreme corner case, simply disallow it.
        self.compiler.namespace.parent_parameters_visible = False

        enum_name = get_ID_text(ctx.ID())

        # Collect members
        entry_values = [] # type: List[int]
        entry_names = [] # type: List[str]
        members = [] # type: List[rdltypes.UserEnumMemberContainer]
        for enum_entry_ctx in ctx.getTypedRuleContexts(SystemRDLParser.Enum_entryContext):
            name_token, value_expr_ctx, rdl_name, rdl_desc = self.visit(enum_entry_ctx)

            entry_name = get_ID_text(name_token)
            if entry_name in entry_names:
                self.msg.fatal(
                    "Entry '%s' has already been defined in this enum" % entry_name,
                    src_ref_from_antlr(name_token)
                )
            entry_names.append(entry_name)

            if value_expr_ctx is not None:
                # explicit enumerator assignment

                visitor = ExprVisitor(self.compiler)
                expr = visitor.visit(value_expr_ctx)
                expr = AssignmentCast(self.compiler.env, value_expr_ctx, expr, int)
                expr.predict_type()

                # OK to immediately evaluate the expression since there is no way that it
                # can depend on any external references
                entry_value = expr.get_value()
            else:
                # automatic enumerator assignment
                if not entry_values:
                    entry_value = 0
                else:
                    entry_value = entry_values[-1] + 1

            if entry_value in entry_values:
                # Value was already assigned
                self.msg.fatal(
                    "Enumeration encoding values must be unique",
                    src_ref_from_antlr(name_token)
                )

            entry_values.append(entry_value)

            members.append(
                rdltypes.UserEnumMemberContainer(
                    entry_name, entry_value, rdl_name, rdl_desc
                )
            )

        # Create Enum type
        enum_type = rdltypes.UserEnum.define_new(enum_name, members, self.parent_component)

        self.compiler.namespace.exit_scope()
        self.compiler.namespace.parent_parameters_visible = True # restore parameter behavior
        return enum_type, get_ID_text(ctx.ID()), src_ref_from_antlr(ctx.ID())

    def visitEnum_entry(self, ctx: SystemRDLParser.Enum_entryContext) -> Tuple['CommonToken', SystemRDLParser.ExprContext, Optional[str], Optional[str]]:
        name_token = ctx.ID()
        value_expr_ctx = ctx.expr()

        rdl_name = None # type: Optional[str]
        rdl_desc = None # type: Optional[str]

        for pa_ctx in ctx.getTypedRuleContexts(SystemRDLParser.Enum_prop_assignContext):
            prop_token, prop_value = self.visit(pa_ctx)
            prop_name = get_ID_text(prop_token)

            if prop_name == "desc":
                if rdl_desc is not None:
                    self.msg.error(
                        "Property 'desc' was already assigned in this scope",
                        src_ref_from_antlr(prop_token)
                    )
                    continue
                if self.compiler.env.dedent_desc:
                    rdl_desc = helpers.dedent_text(prop_value)
                else:
                    rdl_desc = prop_value
            elif prop_name == "name":
                if rdl_name is not None:
                    self.msg.error(
                        "Property 'name' was already assigned in this scope",
                        src_ref_from_antlr(prop_token)
                    )
                    continue
                rdl_name = prop_value
            else:
                self.msg.fatal(
                    "Illegal enum property assignment '%s'" % prop_name,
                    src_ref_from_antlr(prop_token)
                )

        return name_token, value_expr_ctx, rdl_name, rdl_desc

    def visitEnum_prop_assign(self, ctx: SystemRDLParser.Enum_prop_assignContext) -> Tuple['CommonToken', Any]:
        prop_token = ctx.ID()

        visitor = ExprVisitor(self.compiler)
        prop_expr = visitor.visit(ctx.expr())
        prop_expr = AssignmentCast(self.compiler.env, ctx.expr(), prop_expr, str)
        prop_expr.predict_type()

        # OK to immediately evaluate the expression since there is no way that it
        # can depend on any external references
        prop_value = prop_expr.get_value()

        return prop_token, prop_value


text:
<?xml version="1.0" encoding="utf-8"?>

<selector xmlns:android="http://schemas.android.com/apk/res/android"
    android:enterFadeDuration="@android:integer/config_shortAnimTime"
    android:exitFadeDuration="@android:integer/config_shortAnimTime">
    <item android:state_pressed="true" android:drawable="@drawable/ic_navigation_down_pressed"/>
    <item android:drawable="@drawable/ic_keyboard_arrow_down"/>
</selector>


text:
<?php

namespace AlphaLemon\BootstrapBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class AlphaLemonBootstrapBundle extends Bundle
{
}


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

package com.google.collide.client.code.lang;

import com.google.collide.client.editor.input.ActionExecutor;
import com.google.collide.client.editor.input.InputScheme;

import org.waveprotocol.wave.client.common.util.SignalEvent;

/**
 * Implementation that do not do anything language specific.
 *
 */
class NoneLanguageHelper implements LanguageHelper, ActionExecutor {

  @Override
  public boolean execute(String actionName, InputScheme scheme, SignalEvent event) {
    return false;
  }

  @Override
  public ActionExecutor getActionExecutor() {
    return this;
  }
}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>

	<meta charset="utf-8">
	<title><?php echo $title;?></title>

ID - Title - Text - Slug

<?php echo $news_item['id'];?> - <?php echo $news_item['title'];?> - <?php echo $news_item['text'];?> - <?php echo $news_item['slug'];?>


text:
using System.ComponentModel;

namespace tcpTrigger
{
    [RunInstaller(true)]
    public partial class ProjectInstaller : System.Configuration.Install.Installer
    {
        public ProjectInstaller()
        {
            InitializeComponent();
        }
    }
}


text:
@class SSSplit;

@interface SSMatchedSplit : NSObject

@property (strong) SSSplit *split;
@property NSUInteger splitIndex; // 0-based.
@property (readonly, nonatomic) NSNumber *splitNumber; // 1-based.

@property (strong) SSSplit *referenceSplit;
@property NSUInteger referenceSplitIndex; // 0-based.
@property (readonly, nonatomic) NSNumber *referenceSplitNumber; // 1-based.

@property (readonly, nonatomic) NSNumber *durationDifference;

@end


text:
module Transmission
  def self.custom_slots
    File.read(File.expand_path('../../../skills_config/custom_slots.txt', __FILE__))
  end
end


text:
/*
 * Written by Doug Lea with assistance from members of JCP JSR-166
 * Expert Group and released to the public domain, as explained at
 * http://creativecommons.org/publicdomain/zero/1.0/
 */

package jsr166e;
import jsr166e.LongAdder;
import java.util.Map;
import java.util.Set;
import java.io.Serializable;

/**
 * A keyed table of adders, that may be useful in computing frequency
 * counts and histograms, or may be used as a form of multiset.  A
 * {@link LongAdder} is associated with each key. Keys are added to
 * the table implicitly upon any attempt to update, or may be added
 * explicitly using method {@link #install}.
 *
 *
jsr166e note: This class is targeted to be placed in
 * java.util.concurrent.atomic.
 *
 * @since 1.8
 * @author Doug Lea
 */
public class LongAdderTable<K> implements Serializable {
    /** Relies on default serialization */
    private static final long serialVersionUID = 7249369246863182397L;

    /** The underlying map */
    private final ConcurrentHashMapV8<K, LongAdder> map;

    static final class CreateAdder
        implements ConcurrentHashMapV8.Fun<Object, LongAdder> {
        public LongAdder apply(Object unused) { return new LongAdder(); }
    }

    private static final CreateAdder createAdder = new CreateAdder();

    /**
     * Creates a new empty table.
     */
    public LongAdderTable() {
        map = new ConcurrentHashMapV8<K, LongAdder>();
    }

    /**
     * If the given key does not already exist in the table, inserts
     * the key with initial sum of zero; in either case returning the
     * adder associated with this key.
     *
     * @param key the key
     * @return the adder associated with the key
     */
    public LongAdder install(K key) {
        return map.computeIfAbsent(key, createAdder);
    }

    /**
     * Adds the given value to the sum associated with the given
     * key.  If the key does not already exist in the table, it is
     * inserted.
     *
     * @param key the key
     * @param x the value to add
     */
    public void add(K key, long x) {
        map.computeIfAbsent(key, createAdder).add(x);
    }

    /**
     * Increments the sum associated with the given key.  If the key
     * does not already exist in the table, it is inserted.
     *
     * @param key the key
     */
    public void increment(K key) { add(key, 1L); }

    /**
     * Decrements the sum associated with the given key.  If the key
     * does not already exist in the table, it is inserted.
     *
     * @param key the key
     */
    public void decrement(K key) { add(key, -1L); }

    /**
     * Returns the sum associated with the given key, or zero if the
     * key does not currently exist in the table.
     *
     * @param key the key
     * @return the sum associated with the key, or zero if the key is
     * not in the table
     */
    public long sum(K key) {
        LongAdder a = map.get(key);
        return a == null ? 0L : a.sum();
    }

    /**
     * Resets the sum associated with the given key to zero if the key
     * exists in the table.  This method does NOT add or
     * remove the key from the table (see {@link #remove}).
     *
     * @param key the key
     */
    public void reset(K key) {
        LongAdder a = map.get(key);
        if (a != null)
            a.reset();
    }

    /**
     * Resets the sum associated with the given key to zero if the key
     * exists in the table.  This method does NOT add or
     * remove the key from the table (see {@link #remove}).
     *
     * @param key the key
     * @return the previous sum, or zero if the key is not
     * in the table
     */
    public long sumThenReset(K key) {
        LongAdder a = map.get(key);
        return a == null ? 0L : a.sumThenReset();
    }

    /**
     * Returns the sum totalled across all keys.
     *
     * @return the sum totalled across all keys
     */
    public long sumAll() {
        long sum = 0L;
        for (LongAdder a : map.values())
            sum += a.sum();
        return sum;
    }

    /**
     * Resets the sum associated with each key to zero.
     */
    public void resetAll() {
        for (LongAdder a : map.values())
            a.reset();
    }

    /**
     * Totals, then resets, the sums associated with all keys.
     *
     * @return the sum totalled across all keys
     */
    public long sumThenResetAll() {
        long sum = 0L;
        for (LongAdder a : map.values())
            sum += a.sumThenReset();
        return sum;
    }

    /**
     * Removes the given key from the table.
     *
     * @param key the key
     */
    public void remove(K key) { map.remove(key); }

    /**
     * Removes all keys from the table.
     */
    public void removeAll() { map.clear(); }

    /**
     * Returns the current set of keys.
     *
     * @return the current set of keys
     */
    public Set<K> keySet() {
        return map.keySet();
    }

    /**
     * Returns the current set of key-value mappings.
     *
     * @return the current set of key-value mappings
     */
    public Set<Map.Entry<K,LongAdder>> entrySet() {
        return map.entrySet();
    }

}


text:
import should = require('should');
import Twitch from '../index';
import * as Routes from '../routes';

const Client = new Twitch();
const TestUser = {
  id: 23161357,
  name: 'lirik'
};

const TestUser2 = {
  id: 27446517,
  name: 'Monstercat'
}

const TestUser3 = {
  id: 46375210,
  name: 'nocopyrightsounds'
}

describe('Automation', function() {
  it('Should login', function(done) {
    this.timeout(15000);
      const TwitchClient = new Twitch({
        Oauth: {
            url: 'http://localhost:3156/token',
            scope: 'user_read',
            automated: {
                verify: true
            }
        }
      });

       TwitchClient.Client.AutoAuthenticate().then((data) => {
         should(data).have.properties(['access_token', 'refresh_token', 'scope']);
         done();
       }).catch((err) => {
         should(err).be.type('string');
         done();
       });
  });

});

describe('Core', function() {
  describe('#RawApi()', function() {
    it('should return an object', function(done) {
        Client.Client.RawApi('').then((data: any) => {
          data.should.be.type('object');

          done();
        });
      });
  });
});

describe('Channels', function() {
  describe('#GetChannelsByUsername()', function() {
      it('should return an array of users', function(done) {
        Client.Channel.GetChannelsByUsername([TestUser.name, TestUser2.name]).then((data: Routes.UsersInterface) => {
          should(data.users[0]).have.properties(['display_name', '_id', 'name', 'type', 'bio', 'created_at', 'updated_at', 'logo'])
          data._total.should.equal(2);
          data.users.should.be.type('object');

          done();
        });
      });
  });

  describe('#GetChannelById()', function() {
      it('should return an user object', function(done) {
        Client.Channel.GetChannelById(TestUser.id).then((data: Routes.IChannel) => {
          data.should.have.properties(
            ['mature', 'status', 'broadcaster_language', 'display_name', 'game', 'language',
            'name', 'created_at', 'updated_at', '_id', 'logo', 'video_banner', 'profile_banner',
            'profile_banner_background_color', 'partner', 'url', 'views', 'followers']);
          data.name.should.equal(TestUser.name);
          data._id.should.equal(TestUser.id.toString());

          done();
        });
      });
  });

  describe('#GetChannelFollowers()', function() {
      it('should return a list of users following a user', function(done) {
        Client.Channel.GetChannelFollowers(TestUser.id).then((data: Routes.FollowersInterface) => {
          should(data.follows).be.type('object');
          data.should.have.properties(['_cursor', '_total', 'follows'])
          data.follows[0].should.have.properties(['created_at', 'notifications', 'user']);

          done();
        });
      });
  });

  describe('#GetChannelTeams()', function() {
      it('should return a list of teams of a user', function(done) {
        Client.Channel.GetChannelTeams(TestUser.id).then((data: Array<Routes.ITeams>) => {
          data.should.be.type('object');
          should(data[0]).have.properties(['_id', 'background', 'banner', 'created_at',
            'display_name', 'info', 'logo', 'name', 'updated_at']);

          done();
        });
      });
  });

  describe('#GetChannelCommunity()', function() {
      it('should return the community of a user', function(done) {
        Client.Channel.GetChannelCommunity(TestUser.id).then((data: Routes.ICommunity) => {
          data.should.be.type('object');
          should(data).have.properties(['_id', 'avatar_image_url', 'cover_image_url', 'description',
          'description_html', 'language', 'name', 'owner_id', 'rules', 'rules_html', 'summary']);

          done();
        });
      });
  });

  describe('#GetChannelVideos()', function() {
      it('should return a list of videos of a user', function(done) {
        Client.Channel.GetChannelVideos(TestUser.id).then((data: Routes.IVideos) => {
          data.videos.should.be.type('object');
          should(data.videos[0]).have.properties(['_id', 'broadcast_id', 'broadcast_type', 'created_at',
          'description', 'description_html', 'game', 'language', 'length', 'published_at', 'status',
          'tag_list', 'title', 'url', 'viewable', 'viewable_at', 'views', 'fps', 'resolutions']);
          should(data.videos[0]).have.property('channel').have.properties(['_id', 'display_name', 'name']);
          should(data.videos[0]).have.property('preview').have.properties(['large', 'medium', 'small', 'template']);
          should(data.videos[0]).have.property('thumbnails').have.properties(['large', 'medium', 'small', 'template']);

          done();
        });
      });
  });
});

describe('streams', function() {

  describe('#GetStreamByUser()', function() {
      it('should return a stream object', function(done) {
        Client.Stream.GetStreamByUser(TestUser2.id).then((data: Routes.IStream) => {
          data.should.be.Object();
          should(data).have.properties(['_id', 'game', 'community_id', 'viewers',
          'video_height', 'average_fps', 'delay', 'created_at', 'is_playlist', 'preview', 'channel']);

          done();
        });
      });
  });

  describe('#GetStreamsByUser()', function() {
      it('should return an array stream objects', function(done) {
        Client.Stream.GetStreamsByUser([TestUser3.id, TestUser2.id]).then((data: Routes.IStreamResponse) => {
          data.streams.should.be.Array();
          should(data.streams[0]).have.properties(['_id', 'game', 'community_id', 'viewers',
          'video_height', 'average_fps', 'delay', 'created_at', 'is_playlist', 'preview', 'channel']);

          done();
        });
      });
  });

  describe('#GetStreams()', function() {
      it('should return an array stream objects', function(done) {
        Client.Stream.GetStreams({language: 'en', stream_type: 'live'}).then((data: Routes.IStreamResponse) => {
          data.streams.should.be.Array();
          should(data.streams[0]).have.properties(['_id', 'game', 'community_id', 'viewers',
          'video_height', 'average_fps', 'delay', 'created_at', 'is_playlist', 'preview', 'channel']);

          done();
        });
      });
  });

  describe('#GetFeaturedStreams()', function() {
      it('should return an array stream objects', function(done) {
        Client.Stream.GetFeaturedStreams().then((data: Array<Routes.IGetFeaturedStreams>) => {
          data.should.be.Array();
          should(data[0]).have.properties(['image', 'priority', 'scheduled',
          'sponsored', 'text', 'title']);
          should(data[0]).have.property('stream').have.property('channel');

          done();
        });
      });
  });

  describe('#GetStreamSummary()', function() {
      it('should return an object', function(done) {
        Client.Stream.GetStreamSummary().then((data: Routes.IGetStreamSummary) => {
          data.should.be.Object();
          should(data).have.property('channels').be.Number
          should(data).have.property('viewers').be.Number

          done();
        });
      });
  });

});


text:
Scripts that disable/enable windows update service (wuauserv) for Windows 10 Home.

Please run these script as administrator.

## Files

+ enable-win-update.bat
    - Enables windows update service and turn on start up loading.
+ disable-win-update.bat
    - Disables windows update service and turn off start up loading.


text:
/*
 * SObjectizer-5
 */

/*!
 * \file
 * \since v.5.5.1
 * \brief Implementation of free functions send/send_delayed.
 */

#pragma once

#include <so_5/rt/h/mbox.hpp>
#include <so_5/rt/h/environment.hpp>

namespace so_5
{

namespace rt
{

namespace impl
{

	/*
	 * This is helpers for so_5::send implementation.
	 */

	template< class MESSAGE, bool IS_SIGNAL >
	struct instantiator_and_sender_t
		{
			void
			send( const so_5::rt::mbox_t & to )
				{
					std::unique_ptr< MESSAGE > msg( new MESSAGE() );

					to->deliver_message( std::move( msg ) );
				}

			void
			send_delayed(
				so_5::rt::environment_t & env,
				const so_5::rt::mbox_t & to,
				std::chrono::steady_clock::duration pause )
				{
					std::unique_ptr< MESSAGE > msg( new MESSAGE() );

					env.single_timer( std::move( msg ), to, pause );
				}

			timer_id_t
			send_periodic(
				so_5::rt::environment_t & env,
				const so_5::rt::mbox_t & to,
				std::chrono::steady_clock::duration pause,
				std::chrono::steady_clock::duration period )
				{
					std::unique_ptr< MESSAGE > msg( new MESSAGE() );

					return env.schedule_timer(
							std::move( msg ), to, pause, period );
				}
		};

	template< class MESSAGE >
	struct instantiator_and_sender_t< MESSAGE, true >
		{
			void
			send( const so_5::rt::mbox_t & to )
				{
					to->deliver_signal< MESSAGE >();
				}

			void
			send_delayed(
				so_5::rt::environment_t & env,
				const so_5::rt::mbox_t & to,
				std::chrono::steady_clock::duration pause )
				{
					env.single_timer< MESSAGE >( to, pause );
				}

			timer_id_t
			send_periodic(
				so_5::rt::environment_t & env,
				const so_5::rt::mbox_t & to,
				std::chrono::steady_clock::duration pause,
				std::chrono::steady_clock::duration period )
				{
					return env.schedule_timer< MESSAGE >( to, pause, period );
				}
		};

} /* namespace impl */

} /* namespace rt */

/*!
 * \since v.5.5.1
 * \brief A utility function for creating and delivering a message.
 */
template< typename MESSAGE, typename... ARGS >
void
send( const so_5::rt::mbox_t & to, ARGS&&... args )
	{
		std::unique_ptr< MESSAGE > msg(
				new MESSAGE( std::forward<ARGS>(args)... ) );

		to->deliver_message( std::move( msg ) );
	}

/*!
 * \since v.5.5.1
 * \brief A utility function for sending a signal.
 */
template< typename MESSAGE >
void
send( const so_5::rt::mbox_t & to )
	{
		so_5::rt::impl::instantiator_and_sender_t<
				MESSAGE,
				std::is_base_of< so_5::rt::signal_t, MESSAGE >::value > helper;

		helper.send( to );
	}

/*!
 * \since v.5.5.1
 * \brief A utility function for creating and delivering a message to
 * the agent's direct mbox.
 */
template< typename MESSAGE, typename... ARGS >
void
send_to_agent( const so_5::rt::agent_t & receiver, ARGS&&... args )
	{
		send< MESSAGE >( receiver.so_direct_mbox(), std::forward<ARGS>(args)... );
	}

/*!
 * \since v.5.5.1
 * \brief A utility function for sending a signal to the agent's direct mbox.
 */
template< typename MESSAGE >
void
send_to_agent( const so_5::rt::agent_t & receiver )
	{
		send< MESSAGE >( receiver.so_direct_mbox() );
	}

/*!
 * \since v.5.5.1
 * \brief A utility function for creating and delivering a delayed message.
 */
template< typename MESSAGE, typename... ARGS >
void
send_delayed(
	//! An environment to be used for timer.
	so_5::rt::environment_t & env,
	//! Mbox for the message to be sent to.
	const so_5::rt::mbox_t & to,
	//! Pause for message delaying.
	std::chrono::steady_clock::duration pause,
	//! Message constructor parameters.
	ARGS&&... args )
	{
		std::unique_ptr< MESSAGE > msg(
				new MESSAGE( std::forward<ARGS>(args)... ) );

		env.single_timer( std::move( msg ), to, pause );
	}

/*!
 * \since v.5.5.1
 * \brief A utility function for creating and delivering a delayed message.
 *
 * Gets the Environment from the agent specified.
 */
template< typename MESSAGE, typename... ARGS >
void
send_delayed(
	//! An agent whos environment must be used.
	so_5::rt::agent_t & agent,
	//! Mbox for the message to be sent to.
	const so_5::rt::mbox_t & to,
	//! Pause for message delaying.
	std::chrono::steady_clock::duration pause,
	//! Message constructor parameters.
	ARGS&&... args )
	{
		send_delayed< MESSAGE >( agent.so_environment(), to, pause,
				std::forward< ARGS >(args)... );
	}

/*!
 * \since v.5.5.1
 * \brief A utility function for creating and delivering a delayed message
 * to the agent's direct mbox.
 *
 * Gets the Environment from the agent specified.
 */
template< typename MESSAGE, typename... ARGS >
void
send_delayed_to_agent(
	//! An agent whos environment must be used.
	so_5::rt::agent_t & agent,
	//! Pause for message delaying.
	std::chrono::steady_clock::duration pause,
	//! Message constructor parameters.
	ARGS&&... args )
	{
		send_delayed< MESSAGE >(
				agent.so_environment(),
				agent.so_direct_mbox(),
				pause,
				std::forward< ARGS >(args)... );
	}

/*!
 * \since v.5.5.1
 * \brief A utility function for delivering a delayed signal.
 */
template< typename MESSAGE >
void
send_delayed(
	//! An environment to be used for timer.
	so_5::rt::environment_t & env,
	//! Mbox for the message to be sent to.
	const so_5::rt::mbox_t & to,
	//! Pause for message delaying.
	std::chrono::steady_clock::duration pause )
	{
		so_5::rt::impl::instantiator_and_sender_t<
				MESSAGE,
				std::is_base_of< so_5::rt::signal_t, MESSAGE >::value > helper;

		helper.send_delayed( env, to, pause );
	}

/*!
 * \since v.5.5.1
 * \brief A utility function for delivering a delayed signal.
 *
 * Gets the Environment from the agent specified.
 */
template< typename MESSAGE >
void
send_delayed(
	//! An agent whos environment must be used.
	so_5::rt::agent_t & agent,
	//! Mbox for the message to be sent to.
	const so_5::rt::mbox_t & to,
	//! Pause for message delaying.
	std::chrono::steady_clock::duration pause )
	{
		send_delayed< MESSAGE >( agent.so_environment(), to, pause );
	}

/*!
 * \since v.5.5.1
 * \brief A utility function for delivering a delayed signal to
 * the agent's direct mbox.
 *
 * Gets the Environment from the agent specified.
 */
template< typename MESSAGE >
void
send_delayed_to_agent(
	//! An agent whos environment must be used.
	so_5::rt::agent_t & agent,
	//! Pause for message delaying.
	std::chrono::steady_clock::duration pause )
	{
		send_delayed< MESSAGE >(
				agent.so_environment(),
				agent.so_direct_mbox(),
				pause );
	}

/*!
 * \since v.5.5.1
 * \brief A utility function for creating and delivering a periodic message.
 */
template< typename MESSAGE, typename... ARGS >
timer_id_t
send_periodic(
	//! An environment to be used for timer.
	so_5::rt::environment_t & env,
	//! Mbox for the message to be sent to.
	const so_5::rt::mbox_t & to,
	//! Pause for message delaying.
	std::chrono::steady_clock::duration pause,
	//! Period of message repetitions.
	std::chrono::steady_clock::duration period,
	//! Message constructor parameters.
	ARGS&&... args )
	{
		std::unique_ptr< MESSAGE > msg(
				new MESSAGE( std::forward<ARGS>(args)... ) );

		return env.schedule_timer( std::move( msg ), to, pause, period );
	}

/*!
 * \since v.5.5.1
 * \brief A utility function for creating and delivering a periodic message.
 *
 * Gets the Environment from the agent specified.
 */
template< typename MESSAGE, typename... ARGS >
timer_id_t
send_periodic(
	//! An agent whos environment must be used.
	so_5::rt::agent_t & agent,
	//! Mbox for the message to be sent to.
	const so_5::rt::mbox_t & to,
	//! Pause for message delaying.
	std::chrono::steady_clock::duration pause,
	//! Period of message repetitions.
	std::chrono::steady_clock::duration period,
	//! Message constructor parameters.
	ARGS&&... args )
	{
		return send_periodic< MESSAGE >(
				agent.so_environment(),
				to,
				pause,
				period,
				std::forward< ARGS >(args)... );
	}

/*!
 * \since v.5.5.1
 * \brief A utility function for creating and delivering a periodic message
 * to the agent's direct mbox.
 *
 * Gets the Environment from the agent specified.
 */
template< typename MESSAGE, typename... ARGS >
timer_id_t
send_periodic_to_agent(
	//! An agent whos environment must be used.
	so_5::rt::agent_t & agent,
	//! Pause for message delaying.
	std::chrono::steady_clock::duration pause,
	//! Period of message repetitions.
	std::chrono::steady_clock::duration period,
	//! Message constructor parameters.
	ARGS&&... args )
	{
		return send_periodic< MESSAGE >(
				agent.so_environment(),
				agent.so_direct_mbox(),
				pause,
				period,
				std::forward< ARGS >(args)... );
	}

/*!
 * \since v.5.5.1
 * \brief A utility function for delivering a periodic signal.
 */
template< typename MESSAGE >
timer_id_t
send_periodic(
	//! An environment to be used for timer.
	so_5::rt::environment_t & env,
	//! Mbox for the message to be sent to.
	const so_5::rt::mbox_t & to,
	//! Pause for message delaying.
	std::chrono::steady_clock::duration pause,
	//! Period of message repetitions.
	std::chrono::steady_clock::duration period )
	{
		so_5::rt::impl::instantiator_and_sender_t<
				MESSAGE,
				std::is_base_of< so_5::rt::signal_t, MESSAGE >::value > helper;

		return helper.send_periodic( env, to, pause, period );
	}

/*!
 * \since v.5.5.1
 * \brief A utility function for delivering a periodic signal.
 *
 * Gets the Environment from the agent specified.
 */
template< typename MESSAGE >
timer_id_t
send_periodic(
	//! An agent whos environment must be used.
	so_5::rt::agent_t & agent,
	//! Mbox for the message to be sent to.
	const so_5::rt::mbox_t & to,
	//! Pause for message delaying.
	std::chrono::steady_clock::duration pause,
	//! Period of message repetitions.
	std::chrono::steady_clock::duration period )
	{
		return send_periodic< MESSAGE >(
				agent.so_environment(),
				to,
				pause,
				period );
	}

/*!
 * \since v.5.5.1
 * \brief A utility function for delivering a periodic signal to
 * the agent's direct mbox.
 *
 * Gets the Environment from the agent specified.
 */
template< typename MESSAGE >
timer_id_t
send_periodic_to_agent(
	//! An agent whos environment must be used.
	so_5::rt::agent_t & agent,
	//! Pause for message delaying.
	std::chrono::steady_clock::duration pause,
	//! Period of message repetitions.
	std::chrono::steady_clock::duration period )
	{
		return send_periodic< MESSAGE >(
				agent.so_environment(),
				agent.so_direct_mbox(),
				pause,
				period );
	}

} /* namespace so_5 */


text:
package com.twosigma.beakerx.chart.serializer;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.twosigma.beakerx.chart.Color;
import com.twosigma.beakerx.chart.treemap.TreeMap;
import com.twosigma.beakerx.chart.treemap.util.IToolTipBuilder;
import net.sf.jtreemap.swing.TreeMapNode;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import static com.twosigma.beakerx.chart.serializer.AbstractChartSerializer.NUMBER_OF_POINTS_TO_DISPLAY;
import static com.twosigma.beakerx.chart.serializer.AbstractChartSerializer.ROWS_LIMIT_ITEMS;
import static com.twosigma.beakerx.chart.serializer.AbstractChartSerializer.TOO_MANY_ROWS;
import static com.twosigma.beakerx.chart.serializer.AbstractChartSerializer.TOTAL_NUMBER_OF_POINTS;
import static com.twosigma.beakerx.chart.treemap.TreeMap.ROWS_LIMIT;

public class TreeMapSerializer extends ChartSerializer<TreeMap> {

  public static final String TOOLTIP = "tooltip";
  public static final String GRAPHICS_LIST = "graphics_list";
  public static final String MODE = "mode";
  public static final String STICKY = "sticky";
  public static final String RATIO = "ratio";
  public static final String ROUND = "round";
  public static final String VALUE_ACCESSOR = "valueAccessor";
  public static final String LEAVES = " leaves";

  private final TreeMapReducer treeMapReducer = new TreeMapReducer(ROWS_LIMIT);

  protected String toHex(Color col) {
    return "#" + Integer.toHexString(col.getRGB()).substring(2);
  }

  @Override
  public void serialize(final TreeMap treeMap,
                        JsonGenerator jgen,
                        SerializerProvider provider) throws IOException {

    TreeMapNode root = treeMap.getRoot();
    process(root, node -> setUserObject(treeMap, node));

    jgen.writeStartObject();
    int numberOfNodes = TreeMapNodeCounter.countAllNodes(root);
    jgen.writeObjectField(TOTAL_NUMBER_OF_POINTS, numberOfNodes);
    boolean tooManyRows = numberOfNodes > ROWS_LIMIT;
    jgen.writeBooleanField(TOO_MANY_ROWS, tooManyRows);
    if (tooManyRows) {
      root = treeMapReducer.limitTreeMap(root);
      jgen.writeObjectField(ROWS_LIMIT_ITEMS, ROWS_LIMIT);
      jgen.writeObjectField(NUMBER_OF_POINTS_TO_DISPLAY, TreeMapNodeCounter.countReducedLeaves(root) + LEAVES);
    }

    serialize(treeMap, jgen);

    if (root != null)
      jgen.writeObjectField(GRAPHICS_LIST, root);

    if (treeMap.getMode() != null)
      jgen.writeObjectField(MODE, treeMap.getMode().getJsName());
    if (treeMap.getSticky() != null)
      jgen.writeObjectField(STICKY, treeMap.getSticky());
    if (treeMap.getRatio() != null)
      jgen.writeObjectField(RATIO, treeMap.getRatio());
    if (treeMap.getRound() != null)
      jgen.writeObjectField(ROUND, treeMap.getRound());

    jgen.writeObjectField(VALUE_ACCESSOR, treeMap.getValueAccessor());

    jgen.writeEndObject();
  }

  private void setUserObject(TreeMap treeMap, TreeMapNode node) {
    Object userObject = node.getUserObject();
    Map<String, Object> values;
    if (userObject instanceof Map) {
      values = (Map<String, Object>) userObject;
      if (node.isLeaf()) {
        Color color = treeMap.getColorProvider().getColor(node);
        values.put("color", toHex(color));
        IToolTipBuilder toolTipBuilder = treeMap.getToolTipBuilder();
        if (toolTipBuilder != null) {
          values.put(TOOLTIP, toolTipBuilder.getToolTip(node));
        } else {
          values.put(TOOLTIP, values.get("label"));
        }
      }
      node.setUserObject(values);
    } else {
      values = new HashMap<>();
      values.put("label", userObject);
      IToolTipBuilder toolTipBuilder = treeMap.getToolTipBuilder();
      if (toolTipBuilder != null) {
        values.put(TOOLTIP, toolTipBuilder.getToolTip(node));
      } else {
        values.put(TOOLTIP, userObject);
      }
    }
    if (node.isLeaf()) {
      Color color = treeMap.getColorProvider().getColor(node);
      values.put("color", toHex(color));
    }
    values.put(TreeMapNodeCounter.IS_LEAF,node.isLeaf());

    node.setUserObject(values);
  }

  private void process(TreeMapNode node, Visitor<TreeMapNode> visitor) {
    visitor.visit(node);
    Iterable<TreeMapNode> children = node.getChildren();
    if (children != null) {
      for (TreeMapNode child : children) {
        process(child, visitor);
      }
    }
  }

  interface Visitor<T> {
    void visit(T object);
  }
}


text:
(function() {

    var AjaxifySearch = window.AjaxifySearch = function(element, options) {
        this.element = element
        this.options = options
        this.total = 0
        this.currentPage = 1

        this.data = {
            entity: options.entity,
            perpage: options.perpage,
            search: '',
        }

        for(var option in options) {
            if (AjaxifySearch.OPTIONS.indexOf(option) == -1) {
                this.data[option] = options[option]
            }
        }

        this.$paginationContainer = this.createPaginationContainer()
        this.$itemContainer = this.element.find(this.options.itemContainer)

        this.createFilterContainer()
        this.createLoader()
        this.init()
    }

    AjaxifySearch.OPTIONS = ['request', 'entity', 'perpage', 'itemContainer', 'onload']

    AjaxifySearch.prototype = {

        init: function() {
            var _self = this

            if (typeof this.request != 'undefined') {
                this.request.abort()
            }

            this.request = $.ajax({
                url: AjaxifySearch.URL.count,
                type: 'GET',
                data: this.data
            })
            .done(function(count) {
                _self.total = count
                _self.showPagination()
                _self.request = void 0
            })
        },

        showPagination: function() {

            var nbPage = Math.ceil(this.total / this.options.perpage)
            var currentPage3 = this.currentPage + 3
            var end3 = nbPage - 3

            this.$paginationContainer.html('')

            this.$paginationContainer.append(this.createPreviousLink(this.currentPage, nbPage))
            this.$paginationContainer.append(this.createPaginationLink(1))

            if (this.currentPage < 5) {
                for (var i = 2; i <= this.currentPage; i++) {
                    this.$paginationContainer.append(this.createPaginationLink(i))
                }
            } else {

                this.$paginationContainer.append(this.createEllipsis())

                for (var i = this.currentPage - 3; i <= this.currentPage; i++) {
                    this.$paginationContainer.append(this.createPaginationLink(i))
                }
            }

            for (var i = this.currentPage + 1; i <= currentPage3 && i <= nbPage; i++) {
                this.$paginationContainer.append(this.createPaginationLink(i))
            }

            if (this.currentPage <= end3) {
                this.$paginationContainer.append(this.createEllipsis())
                this.$paginationContainer.append(this.createPaginationLink(nbPage))
            }

            this.$paginationContainer.append(this.createNextLink(this.currentPage, nbPage))
        },

        createFilterContainer: function() {

            var _self = this
            var $row = $('

').css('margin-bottom', '20px')
            var $filterCol = $('

')
            var $searchCol = $('

')
            var $inputGroup = $('

')

            var $input = $('<input class="form-control">')
            $input.on('keyup', function(e) {
                var search = $(this).val()

                _self.search(search)
            })

            var $perpage = $('<select class="form-control"></select>')
            $perpage.append('<option value="0">Par page</option>')
            $perpage.append('<option value="5">5</option>')
            $perpage.append('<option value="10">10</option>')
            $perpage.append('<option value="20">20</option>')
            $perpage.append('<option value="50">50</option>')
            $perpage.append('<option value="100">100</option>')
            $perpage.append('<option value="200">200</option>')

            $perpage.on('change', function(e) {
                var perpage = parseInt($(this).val())

                if (perpage != 0 && perpage != _self.options.perpage) {
                    _self.options.perpage = perpage
                    _self.data.perpage = perpage
                    _self.search(_self.data['search'])
                }
            })

            $inputGroup.append('')
            $inputGroup.append($input)
            $searchCol.append($inputGroup)
            $filterCol.append($perpage)
            $row.append($filterCol)
            $row.append($searchCol)
            this.element.parent().prepend($row)
        },

        createPaginationContainer: function() {
            var $row = $('

')
            var $div = $('

')
            var $ul = $('

')

            $div.append($ul)
            $row.append($div)

            this.element.parent().append($row)

            return $ul
        },

        createLoader: function() {
            var $loader = $('
  Chargement...
')

            this.element.parent().css('position', 'relative')

            $loader.css({
                position: 'absolute',
                width: '100%',
                padding: '20px',
                textAlign: 'center',
                top: '50%',
                transform: 'translateY(-50%)',
                backgroundColor: '#fff',
            }).hide()

            this.$loader = $loader
            this.element.parent().prepend($loader)
        },

        createPaginationLink: function(page) {
            var _self = this
            var $link = $('
'+ page +'
')

            if (page == this.currentPage) {
                $link.addClass('active')
                $link.find('a').on('click', function(e) {
                    e.preventDefault()
                })
            } else {
                $link.find('a').on('click', function(e) {
                    e.preventDefault()

                    _self.loadMore(page)
                })
            }

            return $link
        },

        createPreviousLink: function(page, nbPage) {

            var $link = this.createPaginationLink(page - 1)

            $link.find('a').text('<').on('click', function(e) {
                e.preventDefault()
            })

            if (page == 1) {
                $link.find('a').off('click')
                $link.addClass('disabled')
            }

            return $link
        },

        createNextLink: function(page, nbPage) {
            var $link = this.createPaginationLink(page + 1)

            $link.find('a').text('>').on('click', function(e) {
                e.preventDefault()
            })

            if (page == nbPage) {
                $link.find('a').off('click')
                $link.addClass('disabled')
            }

            return $link
        },

        createEllipsis: function() {
            var $link = this.createPaginationLink(0)

            $link.find('a').off('click').text('...').on('click', function(e) {
                e.preventDefault()
            })

            $link.addClass('disabled')

            return $link
        },

        search: function(search) {
            var _self = this
            this.data['search'] = search

            if (typeof this.request != 'undefined') {
                this.request.abort()
            }

            this.showLoader()

            this.request = $.ajax({
                url: AjaxifySearch.URL.search,
                type: 'GET',
                data: this.data,
                dataType: 'json'
            })
            .done(function(data) {
                _self.request = void 0

                _self.total = data.total
                _self.currentPage = 1

                _self.replaceContent(data.views)
            })
        },

        loadMore: function(page) {
            var _self = this
            var data = this.data

            data['page'] = page

            if (typeof this.request != 'undefined') {
                this.request.abort()
            }

            this.showLoader()

            this.request = $.ajax({
                url: AjaxifySearch.URL.search,
                type: 'GET',
                data: data,
                dataType: 'json'
            })
            .done(function(data) {
                _self.request = void 0
                _self.currentPage = page

                _self.replaceContent(data.views)
            })
        },

        replaceContent: function(view) {

            this.hideLoader()
            this.$itemContainer.html('')
            this.$itemContainer.append(view)

            if (typeof window[this.options.onload] === 'function') {
                window[this.options.onload]()
            }

            this.showPagination()
        },

        showLoader: function() {
            this.$loader.css({
                top: '50%',
                transform: 'translateY(-50%)',
            })

            this.$loader.show()
        },

        hideLoader: function() {
            this.$loader.hide()
        },
    }

    $.fn.ajaxifySearch = function() {

        return this.each(function() {
            var $el = $(this)
            var data = $el.data()

            if (typeof data.itemContainer == 'undefined') {
                data.itemContainer = 'tbody'
            }

            if (typeof data.onload === 'undefined') {
                data.onload = 'onContentLoaded'
            }

            $el.data('ajaxify-search', new AjaxifySearch($el, data))
        })
    }

    $(document).ready(function() {
        $('[data-request="ajaxify-search"]').each(function() {
            $(this).ajaxifySearch()
        })
    })
})()


text:
/**
*
* MomentCard
*
*/

import React, { PropTypes } from 'react';
import styled from 'styled-components';
import Media from 'react-media';
import { browserHistory } from 'react-router';
import date from 'utils/date';
import FlexRowCenter from 'components/FlexRowCenter';

import PhotoSwipe from 'photoswipe';
import PhotoSwipeUIdefault from 'photoswipe/dist/photoswipe-ui-default';

import { Card, CardHeader, CardActions } from 'material-ui/Card';
import FlatButton from 'material-ui/FlatButton';

import AudioPlayer from 'components/AudioPlayer';
import ViedoPlayer from 'components/VideoPlayer';

const PicWrapper = styled.div`
  display: flex;
  flex-wrap: wrap;
  paddingLeft: 16px;
  paddingRight: 16px;
  paddingBottom: 16px;
`;

class MomentCard extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function
  handleView = (e, i) => {
    e.preventDefault();
    e.stopPropagation();
    const { moment } = this.props;
    const eTarget = e.target || e.srcElement;
    const pswpElement = document.querySelectorAll('.pswp')[0];
    const length = document.body.clientWidth;

    const items = moment.pictures.split(',').map((p) => ({
      src: p,
      w: length,
      h: length,
      doGetSlideDimensions: true,
    }));

    const options = {
      index: i,
      shareEl: false,
      bgOpacity: 0.5,
      // getThumbBoundsFn: () => {
      //   const thumbnail = eTarget;
      //   const pageYScroll = window.pageYOffset || document.documentElement.scrollTop;
      //   const rect = thumbnail.getBoundingClientRect();

      //   return {
      //     x: rect.left,
      //     y: rect.top + pageYScroll,
      //     w: rect.width,
      //   };
      // },
    };

    const gallery = new PhotoSwipe(pswpElement, PhotoSwipeUIdefault, items, options);

    function getSlideDimensions(slide) {

      if (!slide.doGetSlideDimensions)
          return;    // make sure we don't keep requesting the image if it doesn't exist etc.

      let img = new Image();

      img.onerror = () => {
        slide.doGetSlideDimensions = false;
      };

      img.onload = () => {
        slide.doGetSlideDimensions = false;

        slide.w = img.naturalWidth;
        slide.h = img.naturalHeight;

        gallery.invalidateCurrItems();
        gallery.updateSize(true);
      }

      img.src = slide.src;
    }

    gallery.listen("gettingData", function(index, slide){
      if (slide.doGetSlideDimensions) {
        setTimeout(
          // use setTimeout so that it runs in the event loop
          function(){ getSlideDimensions(slide); }
          ,300
        );
      }
    });

    gallery.listen("imageLoadComplete", function(index, slide){
      if (slide.doGetSlideDimensions) {
        getSlideDimensions(slide);
      }
    });

    gallery.init();
  }

  render() {
    const { moment, isPhone } = this.props;

    const pics = moment.pictures.split(',');
    const picLength = isPhone ? (pics.length === 1 ? '325px' : ((pics.length > 1 && pics.length < 4) ? '100px' : '72px'))
                      : (pics.length === 1 ? '325px' : ((pics.length > 1 && pics.length < 4) ? '288px' : '200px'));
    const picsView = pics.length > 0 ? pics.map((pic, i) => (

 this.handleView(e, i)}
        style={{
          backgroundImage: `url(${pic})`,
          backgroundPosition: 'center center',
          backgroundSize: 'cover',
          width: (pics.length === 1 ? '100%' : picLength),
          height: picLength,
          marginBottom: (pics.length > 1 ? (isPhone ? '8px' : '16px') : 0),
          marginRight: (pics.length > 1 ? (isPhone ? '8px' : '16px') : 0),
        }}
      />
    )) : null;

    return (
      <Card style={{ marginBottom: '8px' }}>
        <CardHeader
          title={moment.content}
          subtitle={date.format(moment.createdAt, 'YYYY-MM-DD')}
          textStyle={{
            paddingRight: 0,
          }}
        />

          {pics.length > 0 && <PicWrapper>{picsView}</PicWrapper>}
          {moment.type === 'audio' &&
            <AudioPlayer
              url={moment.audio}
              isPhone={isPhone}
              style={{
                marginLeft: '16px',
                marginRight: '16px',
                marginBottom: '16px',
              }}
            />}
          {moment.type === 'vedio' &&
            <ViedoPlayer
              url={moment.vedio}
              pic={pics[0]}
              isPhone={isPhone}
              style={{
                marginLeft: '16px',
                marginRight: '16px',
                marginBottom: '16px',
              }}
            />
          }

          {moment.type === 'article' &&
            <CardActions>
              <FlatButton label="查看详情" onTouchTap={() => {
                browserHistory.push({
                  pathname: '/momentDetail',
                  query: {
                    id: moment.id,
                  },
                });
              }}/>
            </CardActions>
          }

      </Card>
    );
  }
}

MomentCard.propTypes = {
  moment: PropTypes.object,
  isPhone: PropTypes.bool,
};

export default MomentCard;


text:
package org.apache.eagle.datastream.core

import com.typesafe.config.Config

trait StreamContextAdapter{
  def submit(context:StreamContext):Unit = {
    execute(context.build)
  }
  def execute(dag: StreamDAG)
}

/**
 * TODO: Decouple execution environment with stream context
 *
 * @since 0.3.0
 */
abstract class ExecutionEnvironment(private val conf:Config)
  extends StreamContext(conf) with StreamContextAdapter     // Continue to support old API
  with StreamSourceBuilder
{
  /**
   * Start to execute
   */
  def execute():Unit = {
    submit(this)
  }
}


text:
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Reflection;
using Jint.Native;
using Jint.Runtime.Interop;

namespace Jint
{
    public class Options
    {
        private bool _discardGlobal;
        private bool _strict;
        private bool _allowDebuggerStatement;
        private bool _debugMode;
        private bool _allowClr;
        private readonly List<IObjectConverter> _objectConverters = new List<IObjectConverter>();
        private int _maxStatements;
        private int _maxRecursionDepth = -1;
        private TimeSpan _timeoutInterval;
        private CultureInfo _culture = CultureInfo.CurrentCulture;
        private TimeZoneInfo _localTimeZone = TimeZoneInfo.Local;
        private List<Assembly> _lookupAssemblies = new List<Assembly>();

        ///
        /// When called, doesn't initialize the global scope.
        /// Can be useful in lightweight scripts for performance reason.
        ///
        public Options DiscardGlobal(bool discard = true)
        {
            _discardGlobal = discard;
            return this;
        }

        ///
        /// Run the script in strict mode.
        ///
        public Options Strict(bool strict = true)
        {
            _strict = strict;
            return this;
        }

        ///
        /// Allow the debugger statement to be called in a script.
        ///
        /// <remarks>
        /// Because the debugger statement can start the
        /// Visual Studio debugger, is it disabled by default
        /// </remarks>
        public Options AllowDebuggerStatement(bool allowDebuggerStatement = true)
        {
            _allowDebuggerStatement = allowDebuggerStatement;
            return this;
        }

        ///
        /// Allow to run the script in debug mode.
        ///
        public Options DebugMode(bool debugMode = true)
        {
            _debugMode = debugMode;
            return this;
        }

        ///
         /// Adds a <see cref="IObjectConverter"/> instance to convert CLR types to <see cref="JsValue"/>
        ///
        public Options AddObjectConverter(IObjectConverter objectConverter)
        {
            _objectConverters.Add(objectConverter);
            return this;
        }

        ///
        /// Allows scripts to call CLR types directly like <example>System.IO.File</example>
        ///
        public Options AllowClr(params Assembly[] assemblies)
        {
            _allowClr = true;
            _lookupAssemblies.AddRange(assemblies);
            _lookupAssemblies = _lookupAssemblies.Distinct().ToList();
            return this;
        }

        public Options MaxStatements(int maxStatements = 0)
        {
            _maxStatements = maxStatements;
            return this;
        }

        public Options TimeoutInterval(TimeSpan timeoutInterval)
        {
            _timeoutInterval = timeoutInterval;
            return this;
        }

        ///
        /// Sets maximum allowed depth of recursion.
        ///
        /// <param name="maxRecursionDepth">
        /// The allowed depth.
        /// a) In case max depth is zero no recursion is allowed.
        /// b) In case max depth is equal to n it means that in one scope function can be called no more than n times.
        /// </param>
        /// <returns>Options instance for fluent syntax</returns>
        public Options LimitRecursion(int maxRecursionDepth = 0)
        {
            _maxRecursionDepth = maxRecursionDepth;
            return this;
        }

        public Options Culture(CultureInfo cultureInfo)
        {
            _culture = cultureInfo;
            return this;
        }

        public Options LocalTimeZone(TimeZoneInfo timeZoneInfo)
        {
            _localTimeZone = timeZoneInfo;
            return this;
        }

        internal bool GetDiscardGlobal()
        {
            return _discardGlobal;
        }

        internal bool IsStrict()
        {
            return _strict;
        }

        internal bool IsDebuggerStatementAllowed()
        {
            return _allowDebuggerStatement;
        }

        internal bool IsDebugMode()
        {
            return _debugMode;
        }

        internal bool IsClrAllowed()
        {
            return _allowClr;
        }

        internal IList<Assembly> GetLookupAssemblies()
        {
            return _lookupAssemblies;
        }

        internal IEnumerable<IObjectConverter> GetObjectConverters()
        {
            return _objectConverters;
        }

        internal int GetMaxStatements()
        {
            return _maxStatements;
        }

        internal int GetMaxRecursionDepth()
        {
            return _maxRecursionDepth;
        }

        internal TimeSpan GetTimeoutInterval()
        {
            return _timeoutInterval;
        }

        internal CultureInfo GetCulture()
        {
            return _culture;
        }

        internal TimeZoneInfo GetLocalTimeZone()
        {
            return _localTimeZone;
        }
    }
}


text:
package com.google.code.validationframework.base.validator;

import com.google.code.validationframework.base.transform.AndBooleanAggregator;

/**
 * Simple validator using boolean results and aggregating all results from the rules into a single result using the AND
 * operation.
 *

 * Use {@link com.google.code.validationframework.base.validator.generalvalidator.GeneralValidator} or
 * {@link com.google.code.validationframework.base.validator.generalvalidator.dsl.GeneralValidatorBuilder} instead.
 *
 * @param <RI> Type of data to be validated.
It can be, for instance, the type of data handled by a component, or the
 *             type of the component itself.
 *
 * @see ResultAggregationValidator
 * @see AndBooleanAggregator
 * @see OrSimpleValidator
 */
public class AndSimpleValidator<RI> extends ResultAggregationValidator<RI, Boolean, Boolean> {

    /**
     * Default constructor using the default constructor of {@link AndBooleanAggregator}.
     *
     * @see AndBooleanAggregator
     */
    public AndSimpleValidator() {
        super(new AndBooleanAggregator());
    }

    /**
     * Constructor specifying the boolean values for empty and null collections, and null elements, to be used when
     * aggregating the results from all the rules.
     *
     * @param emptyCollectionValue Value for empty and null collections of results.
     * @param nullElementValue     Value for null elements in the transformed collections of results.
     *
     * @see AndBooleanAggregator
     */
    public AndSimpleValidator(boolean emptyCollectionValue, boolean nullElementValue) {
        super(new AndBooleanAggregator(emptyCollectionValue, nullElementValue));
    }
}


text:
create class coo(
        col1 nchar(30),
        col2 nchar(30),
        col3 nchar(30),
        col4 nchar(30),
	col5 nchar(30),
	col6 nchar(100)
);

insert into coo
 values(n'8237923123', n'123242347439281078412122', n'-748293021134255847533', n'187349232.3456', n'abc', n'lsakdjfjjdkjsldfjkdkdksllaieywieuriwue78236423746iuyuisjkfhskdjfhwkehkwehfkwefhw');

show columns in coo;
select * from coo order by 1;

--nchar() -> bigint, number format -> number, no loss of data
alter table coo change col1 col1 bigint;
select col1 from coo order by 1;

--nchar() -> bigint, number format -> number, nchar() > max(bigint)
set system parameters 'alter_table_change_type_strict=yes';
alter table coo change col2 col2 bigint;
set system parameters 'alter_table_change_type_strict=no';
alter table coo change col2 col2 bigint;
select col2 from coo order by 1;

--nchar() -> bigint, number format -> number, nchar() < min(bigint)
set system parameters 'alter_table_change_type_strict=yes';
alter table coo change col3 col3 bigint;
set system parameters 'alter_table_change_type_strict=no';
alter table coo change col3 col3 bigint;
select col3 from coo order by 1;

--nchar() -> bigint, number format -> number, loss of data
set system parameters 'alter_table_change_type_strict=yes';
alter table coo change col4 col4 bigint;
set system parameters 'alter_table_change_type_strict=no';
alter table coo change col4 col4 bigint;
select col4 from coo order by 1;

--nchar() -> bigint, string -> number, loss of data
set system parameters 'alter_table_change_type_strict=yes';
alter table coo change col5 col5 bigint;
set system parameters 'alter_table_change_type_strict=no';
alter table coo change col5 col5 bigint;
select col5 from coo order by 1;

--nchar() -> bigint, long string -> number, loss of data
set system parameters 'alter_table_change_type_strict=yes';
alter table coo change col6 col6 bigint;
set system parameters 'alter_table_change_type_strict=no';
alter table coo change col6 col6 bigint;
select col6 from coo order by 1;

show columns in coo;

drop table coo;

commit;
--+ holdcas off;


text:
package org.nd4j.linalg.api.ops.impl.layers.recurrent.config;

import lombok.Builder;
import lombok.Data;
import org.nd4j.autodiff.samediff.SDVariable;
import org.nd4j.linalg.util.ArrayUtil;

import java.util.LinkedHashMap;
import java.util.Map;

@Builder
@Data
public class LSTMCellConfiguration {
    /**
     *   NDArray<T>* xt   = INPUT_VARIABLE(0);                   // input [batchSize x inSize]
     NDArray<T>* ht_1 = INPUT_VARIABLE(1);                   // previous cell output [batchSize x numProj],  that is at previous time step t-1, in case of projection=false -> numProj=numUnits!!!
     NDArray<T>* ct_1 = INPUT_VARIABLE(2);                   // previous cell state  [batchSize x numUnits], that is at previous time step t-1

     NDArray<T>* Wx   = INPUT_VARIABLE(3);                   // input-to-hidden  weights, [inSize  x 4*numUnits]
     NDArray<T>* Wh   = INPUT_VARIABLE(4);                   // hidden-to-hidden weights, [numProj x 4*numUnits]
     NDArray<T>* Wc   = INPUT_VARIABLE(5);                   // diagonal weights for peephole connections [1 x 3*numUnits]
     NDArray<T>* Wp   = INPUT_VARIABLE(6);                   // projection weights [numUnits x numProj]
     NDArray<T>* b    = INPUT_VARIABLE(7);                   // biases, [1 x 4*numUnits]

     NDArray<T>* ht   =  OUTPUT_VARIABLE(0);                  // current cell output [batchSize x numProj], that is at current time step t
     NDArray<T>* ct   =  OUTPUT_VARIABLE(1);                  // current cell state  [batchSize x numUnits], that is at current time step t

     const bool peephole   = (bool)INT_ARG(0);               // if true, provide peephole connections
     const bool projection = (bool)INT_ARG(1);               // if true, then projection is performed, if false then numProj==numUnits is mandatory!!!!
     T clippingCellValue   = T_ARG(0);                       // clipping value for ct, if it is not equal to zero, then cell state is clipped
     T clippingProjValue   = T_ARG(1);                       // clipping value for projected ht, if it is not equal to zero, then projected cell output is clipped
     const T forgetBias    = T_ARG(2);

     */

    private boolean peepHole;
    private boolean projection;
    private double clippingCellValue;
    private double clippingProjValue;
    private double forgetBias;
    //input variables
    private SDVariable xt,ht_1,ct_1,Wx,Wh,Wc,Wp,b;

    public Map<String,Object> toProperties()  {
        Map<String,Object> ret = new LinkedHashMap<>();
        ret.put("peepHole",peepHole);
        ret.put("projection",projection);
        ret.put("clippingCellValue",clippingCellValue);
        ret.put("clippingProjValue",clippingProjValue);
        ret.put("forgetBias",forgetBias);
        return ret;
    }

    public SDVariable[] args()  {
        return new SDVariable[] {xt,ht_1,ct_1,Wx,Wh,Wc,Wp,b};
    }

    public int[] iArgs() {
        return new int[] {ArrayUtil.fromBoolean(peepHole),ArrayUtil.fromBoolean(projection)};
    }

    public double[] tArgs() {
        return new double[] {clippingCellValue,clippingProjValue,forgetBias};
    }

}


text:
sway-connect is [Connect][connect] middleware for [Swagger][swagger] integrations.

**More to come**

[connect]: https://github.com/senchalabs/connect
[swagger]: http://swagger.io/


text:
/*
 * Inline Functions as globals for users using the public interface
 *
 */

#if !(defined(darwin) && defined(__aarch64__))
#define TS_INLINE
#include "P_DNS.h"
#endif


text:
@implementation EyeMediaAccessModel

@end


text: navigation forms with c# WUA


text:
goog.setTestOnly();
goog.require('goog.testing.AsyncTestCase');
goog.require('goog.testing.jsunit');
goog.require('hr.db');
goog.require('lf.schema.DataStoreType');
goog.require('lf.testing.Capability');
goog.require('lf.testing.SmokeTester');

/** @type {!goog.testing.AsyncTestCase} */
var asyncTestCase = goog.testing.AsyncTestCase.createAndInstall('CRUDTest');

/** @type {!lf.testing.SmokeTester} */
var tester;

/** @type {!lf.testing.Capability} */
var capability;

/** @type {!lf.Database} */
var db;

function setUp() {
  capability = lf.testing.Capability.get();

  asyncTestCase.waitForAsync('setUp');
  var options = {
    'storeType': !capability.indexedDb ? lf.schema.DataStoreType.MEMORY :
        lf.schema.DataStoreType.INDEXED_DB
  };
  hr.db.connect(options).then(function(database) {
    db = database;
    tester = new lf.testing.SmokeTester(hr.db.getGlobal(), database);
    // Delete any left-overs from previous tests.
    return tester.clearDb();
  }).then(function() {
    asyncTestCase.continueTesting();
  }, fail);
}

function testCRUD() {
  asyncTestCase.waitForAsync('testCRUD');
  tester.testCRUD().then(function() {
    asyncTestCase.continueTesting();
  }, fail);
}

function testOverlappingScope_MultipleInserts() {
  asyncTestCase.waitForAsync('testOverlappingScope_MultipleInserts');
  tester.testOverlappingScope_MultipleInserts().then(function() {
    asyncTestCase.continueTesting();
  }, fail);
}

function testTransaction() {
  asyncTestCase.waitForAsync('testTransaction');
  tester.testTransaction().then(function() {
    asyncTestCase.continueTesting();
  }, fail);
}

function testSerialization() {
  var dummy = db.getSchema().table('DummyTable');
  var row = dummy.createRow({
    arraybuffer: null,
    boolean: false,
    integer: 1,
    number: 2,
    string: 'A',
    string2: 'B'
  });

  var expected = {
    arraybuffer: null,
    boolean: false,
    datetime: null,
    integer: 1,
    number: 2,
    string: 'A',
    string2: 'B',
    proto: null
  };
  assertObjectEquals(expected, row.toDbPayload());
  assertObjectEquals(expected, dummy.deserializeRow(row.serialize()).payload());
}


text:
//
//  BeanLocator.h
//  Bean OSX Library
//
//  Created by Raymond Kampmeier on 2/18/14.
//  Copyright (c) 2014 Punch Through Design. All rights reserved.
//

#import <Foundation/Foundation.h>
#if TARGET_OS_IPHONE
#import <CoreBluetooth/CoreBluetooth.h>
#else
#import <IOBluetooth/IOBluetooth.h>
#endif
#import "PTDBean.h"

/**
 *  The state of the BeanManager bluetooth connection
 */
typedef NS_ENUM(NSUInteger, BeanManagerState) {
    /**
     *  Initializing or an unknown error has occured
     */
    BeanManagerState_Unknown = 0,
    /**
     *  The bluetooth connection is resetting
     */
    BeanManagerState_Resetting,
    /**
     *  An unsupport request has been made
     */
    BeanManagerState_Unsupported,
    /**
     *  Unauthorized access has been attempted
     */
    BeanManagerState_Unauthorized,
    /**
     *  The BeanManager is off
     */
    BeanManagerState_PoweredOff,
    /**
     *  The BeanManager is on
     */
    BeanManagerState_PoweredOn,
};

@protocol PTDBeanManagerDelegate;

/**
 Manages discovery and connection of Beans

     Example:

     //Put the following code in your class initialization
     {
        PTDBeanManager* beanManager;
        // create the Bean Manager and assign ourselves as the delegate
        beanManager = [[PTDBeanManager alloc] initWithDelegate:self];
     }

     // check to make sure we're on
     - (void)beanManagerDidUpdateState:(PTDBeanManager *)manager{
       if(beanManager.state == BeanManagerState_PoweredOn){
         // if we're on, scan for advertisting beans
         NSError* scanError;
         [beanManager startScanningForBeans_error:&scanError];
         if (scanError) {
            NSLog(@"%@", [scanError localizedDescription]);
         }
       }
       else if (beanManager.state == BeanManagerState_PoweredOff) {
         // do something else
       }
     }
     // bean discovered
     - (void)BeanManager:(PTDBeanManager*)beanManager didDiscoverBean:(PTDBean*)bean error:(NSError*)error{
       if (error) {
         NSLog(@"%@", [error localizedDescription]);
         return;
       }
       NSError* connectError;
       [beanManager connectToBean:bean error:&connectError];
       if (connectError) {
         NSLog(@"%@", [connectError localizedDescription]);
       }
     }
     // bean connected
     - (void)BeanManager:(PTDBeanManager*)beanManager didConnectToBean:(PTDBean*)bean error:(NSError*)error{
       if (error) {
         NSLog(@"%@", [error localizedDescription]);
         return;
       }
       // do stuff with your Bean
     }

 @see PTDBeanManagerDelegate
 */
@interface PTDBeanManager : NSObject

/// @name Monitoring Properties
/**
 *  The delegate object for the BeanManager. Assign your class as this delegate to receive delegate messages.
 @see PTDBeanManagerDelegate
 */
@property (nonatomic, weak) id<PTDBeanManagerDelegate> delegate;
/**
 The <BeanManagerState> state of the BeanManager. Tells you if the Bluetooth Adapter is of, off, unknown, etc.
 */
@property (nonatomic, assign, readonly) BeanManagerState state;

/// @name Initializing a Bean Manager
/**
 *  Initializes the BeanManager with a delegate that implements the PTDBeanManagerDelegate protocol.
 *
 *  @param delegate the <delegate> for this object
 *
 *  @return an instance of the BeanManager
 */
-(id)initWithDelegate:(id<PTDBeanManagerDelegate>)delegate;

/// @name Scanning or Stopping Scans for Beans
/**
 *  Begins scanning for Beans
 *
 *  @param error Nil if successful. See <BeanErrors> for error codes.
 */
-(void)startScanningForBeans_error:(NSError**)error;
/**
 *  Stops scanning for Beans
 *
 *  @param error Nil if successful. See <BeanErrors> for error codes.
 */
-(void)stopScanningForBeans_error:(NSError**)error;

/// @name Establishing or Canceling Connections with Beans
/**
 *  Connects to a Bean
 *
 *  @param bean  The Bean to connect to
 *  @param error Nil if successful. See <BeanErrors> for error codes.
 */
-(void)connectToBean:(PTDBean*)bean error:(NSError**)error;
/**
 *  Disconnects from a Bean
 *
 *  @param bean  The Bean to disconnect from
 *  @param error Nil if successful. See <BeanErrors> for error codes.
 */
-(void)disconnectBean:(PTDBean*)bean error:(NSError**)error;
@end

/**
 Delegates of a <PTDBeanManager> object should implement this protocol. See [BeanXcodeWorkspace](http://www.punchthrough.com) for more examples.
 */
@protocol PTDBeanManagerDelegate <NSObject>
@optional
/**
 The BeanManager's <BeanManagerState> has been updated. This method will also be called when Bluetooth is enabled or disabled.

     Example:
     - (void)beanManagerDidUpdateState:(PTDBeanManager *)manager{
       // if manager is powered on, start scanning
       if(self.beanManager.state == BeanManagerState_PoweredOn){
         [self.beanManager startScanningForBeans_error:nil];
       }
       else if (self.beanManager.state == BeanManagerState_PoweredOff) {
         // do something else
       }
     }

 @param beanManager the BeanManager whose state was updated
 */
- (void)beanManagerDidUpdateState:(PTDBeanManager *)beanManager;
/**
 An advertising Bean was discovered.

    Example:
    // Manager letting us know a Bean was discovered
    - (void)BeanManager:(PTDBeanManager*)beanManager didDiscoverBean:(PTDBean*)bean error:(NSError*)error{
        NSError* connectError;
        [self.beanManager connectToBean:bean error:&connectError];
        if (connectError) {
          NSLog(@"%@", [connectError localizedDescription]);
        }
    }

 @param beanManager The BeanManager scanning for advertising beans
 @param bean        The Bean that was discovered
 @param error       Not implemented yet
 */
- (void)beanManager:(PTDBeanManager*)beanManager didDiscoverBean:(PTDBean*)bean error:(NSError*)error;
/**
 This method is deprecated. Use <[PTDBeanManager beanManager:didDiscoverBean:error:]> instead.
 @deprecated v0.3.2
 */
- (void)BeanManager:(PTDBeanManager*)beanManager didDiscoverBean:(PTDBean*)bean error:(NSError*)error __attribute__((deprecated("use setScratchBank:data:")));
/**
 *  A Bean was connected
 *
 *  @param beanManager The BeanManager that connected to an advertising beans
 *  @param bean        The Bean that was connected
 *  @param error       This error is passed through from [centralManager:didFailToConnectPeripheral:error:](https://developer.apple.com/library/mac/documentation/CoreBluetooth/Reference/CBCentralManagerDelegate_Protocol/translated_content/CBCentralManagerDelegate.html#//apple_ref/occ/intfm/CBCentralManagerDelegate/centralManager:didDisconnectPeripheral:error:)
 */
- (void)beanManager:(PTDBeanManager*)beanManager didConnectBean:(PTDBean*)bean error:(NSError*)error;
/**
 This method is deprecated. Use <[PTDBeanManager beanManager:didConnectToBean:error:]> instead.
 @deprecated v0.3.2
 */
- (void)BeanManager:(PTDBeanManager*)beanManager didConnectToBean:(PTDBean*)bean error:(NSError*)error __attribute__((deprecated("use setScratchBank:data:")));
/**
 *  A Bean was disconnected
 *
 *  @param beanManager The BeanManager that lost connection with the Bean
 *  @param bean        The Bean that was disconnect
 *  @param error       This error is passed through from [centralManager:didDisconnectPeripheral:error:](https://developer.apple.com/library/mac/documentation/CoreBluetooth/Reference/CBCentralManagerDelegate_Protocol/translated_content/CBCentralManagerDelegate.html#//apple_ref/occ/intfm/CBCentralManagerDelegate/centralManager:didDisconnectPeripheral:error:)
 */
- (void)beanManager:(PTDBeanManager*)beanManager didDisconnectBean:(PTDBean*)bean error:(NSError*)error;
/**
 This method is deprecated. Use <[PTDBeanManager beanManager:didDisconnectBean:error:]> instead.
 @deprecated v0.3.2
 */
- (void)BeanManager:(PTDBeanManager*)beanManager didDisconnectBean:(PTDBean*)bean error:(NSError*)error __attribute__((deprecated("use setScratchBank:data:")));

@end


text:
package com.springapp.mvc.inherited;

/**
 * @author windpuller
 */
public class ParentClass {

    private String value = "I am parent class";

    public String play() {
        return value;
    }

    public void setValue(String str) {
        this.value = str;
    }
}


text:
Run `dotnet build /t:GenerateCode` to generate code.

``` yaml

azure-arm: true
csharp: true
library-name: RecoveryServices
namespace: Azure.ResourceManager.RecoveryServices
require: https://github.com/Azure/azure-rest-api-specs/blob/34ba022add0034e30462b76e1548ce5a7e053e33/specification/recoveryservices/resource-manager/readme.md
output-folder: $(this-folder)/Generated
clear-output-folder: true
skip-csproj: true
modelerfour:
  flatten-payloads: false

format-by-name-rules:
  'tenantId': 'uuid'
  'ETag': 'etag'
  'location': 'azure-location'
  '*Uri': 'Uri'
  '*Uris': 'Uri'

rename-rules:
  CPU: Cpu
  CPUs: Cpus
  Os: OS
  Ip: IP
  Ips: IPs|ips
  ID: Id
  IDs: Ids
  VM: Vm
  VMs: Vms
  Vmos: VmOS
  VMScaleSet: VmScaleSet
  DNS: Dns
  VPN: Vpn
  NAT: Nat
  WAN: Wan
  Ipv4: IPv4|ipv4
  Ipv6: IPv6|ipv6
  Ipsec: IPsec|ipsec
  SSO: Sso
  URI: Uri
  Etag: ETag|etag

directive:
  - remove-operation: GetOperationStatus
  - remove-operation: GetOperationResult

```