text:
// JavaScript Document

  /***********************************************
        * Disable Text Selection script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
        * This notice MUST stay intact for legal use
        * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
        ***********************************************/

        function disableSelection(target)
        {
        if (typeof target.onselectstart!="undefined") //IE route
	        target.onselectstart=function(){return false}
        else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
	        target.style.MozUserSelect="none"
        else //All other route (ie: Opera)
	        target.onmousedown=function(){return false}
        target.style.cursor = "default"
        }
        //Sample usages
        // phan nay phai nam cuoi trang or cuoi div
        //disableSelection(document.getElementById("mydiv")) //Disable text selection on entire body
        //disableSelection(document.getElementById("mydiv")) //Disable text selection on element with id="mydiv"

      function disableRightClick(e)
        {
            if(!document.rightClickDisabled) // initialize
            {
                if(document.layers)
                {
                    document.captureEvents(Event.MOUSEDOWN);
                    document.onmousedown = disableRightClick;
                }
                else document.oncontextmenu = disableRightClick;
                return document.rightClickDisabled = true;
            }
            if(document.layers || (document.getElementById && !document.all))
            {
                if (e.which==2||e.which==3)
                {
                    return false;
                }
            }
            else
            {
                return false;
            }
        }
        disableRightClick();

redpajama_set_name: RedPajamaGithub


text:
"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.

This program and the accompanying materials are made available under
the terms of the 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.
"""

from mpp.models import SQLTestCase
'''
Test functions with EXCEPTIONs
'''

class ExceptionBlockTestCase(SQLTestCase):
    """
    @optimizer_mode off
    @tags ORCA
    """

    """
    Collection of various combinations
    """
    sql_dir = 'sql/'
    ans_dir = 'expected/'
    out_dir = 'output/'


text:
SUBDIR=		boot0 boot0.5 pc98boot btx boot2 cdboot kgzldr libpc98 loader

.include <bsd.subdir.mk>


text:
define(function(){
    var mediator;

    return {
        init: function() {
            mediator = window.app.mediator;
            console.log('world component initialised');

            if (mediator) {
                mediator.subscribe('contacts:updated', function(data) {
                    console.log('No idea why the "world" component needs to know about the contacts component, but meh here it is:', data);
                });

                console.log('app.mediator', app.mediator); // will be undefined for bootstrap-index.js
            }
        }
    };
});


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

<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
          android:horizontalGap="@fraction/password_keyboard_number_key_horizontal_gap"
          android:verticalGap="1dp"
          android:keyHeight="50dp"
          android:keyWidth="@fraction/password_keyboard_number_key_width">
    <Row android:rowEdgeFlags="top">
        <Key
            android:codes="49"
            android:keyEdgeFlags="left"
            android:keyLabel="1"/>
        <Key
            android:codes="50"
            android:keyLabel="2"/>
        <Key
            android:codes="51"
            android:keyLabel="3"/>
        <Key
            android:codes="-5"
            android:keyIcon="@drawable/sym_keyboard_delete_holo_dark"
            android:isRepeatable="true"
            android:keyEdgeFlags="right"
            android:keyHeight="101dp"/>
    </Row>
    <Row>
        <Key
            android:keyEdgeFlags="left"
            android:codes="52"
            android:keyLabel="4"/>
        <Key
            android:codes="53"
            android:keyLabel="5"/>
        <Key
            android:codes="54"
            android:keyLabel="6"/>
    </Row>
    <Row>
        <Key
            android:keyEdgeFlags="left"
            android:codes="55"
            android:keyLabel="7"/>
        <Key
            android:codes="56"
            android:keyLabel="8"/>
        <Key
            android:codes="57"
            android:keyLabel="9"/>
        <Key
            android:codes="10"
            android:keyLabel="@string/password_keyboard_done"
            android:keyEdgeFlags="right"
            android:keyHeight="101dp"/>
    </Row>
    <Row>
        <Key
            android:keyEdgeFlags="left"
            android:codes="46"
            android:keyLabel="."/>
        <Key
            android:codes="48"
            android:keyLabel="0"/>
        <Key
            android:codes="-3"
            android:keyIcon="@drawable/sym_keyboard_hide_dark"/>
    </Row>
</Keyboard>


text:
1. Star the project.
2. Open or find an issue [here](https://github.com/marceloboeira/prezzo/issues).
3. Fork it (https://github.com/marceloboeira/prezzo/fork)
4. Create your feature branch (git checkout -b my-awesome-new-feature)
5. Commit your changes (**follwing our [commit policy](#commit-policy) and [style guide](#style-guide)**)
6. Push to the branch (git push origin my-new-feature)
7. Create a new Pull Request

---------

## Style Guide

Currently, we are using [Thoughtbot's Style Guide](https://github.com/thoughtbot/guides/blob/master/style/ruby/README.md) for Ruby Code.

## Commit Policy

We have a very rigid **commit policy**, to contribute please follow these rules:

```
feature: Add hat wobble
 ^--^  ^------------^
 |     |
 |     +-> Summary in present tense
 |
 +-------> Type: chore, doc, feature, fix, refactor, style, or test
```

### Available tags:

 * **chore**: Add oyster build script
 * **doc**: Explain hat wobble
 * **feature**: Add beta sequence
 * **fix**: Remove broken confirmation message
 * **refactor**: Share logic between 4d3d3d3 and flarhgunnstow
 * **style**: Convert tabs to spaces
 * **test**: Ensure Tayne retains clothing

> Based on [this](http://seesparkbox.com/foundry/semantic_commit_messages).


text:
// Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// 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.

#ifndef _FASTDDS_MOCKSHAREDMEM_GLOBAL_H_
#define _FASTDDS_MOCKSHAREDMEM_GLOBAL_H_

#include <rtps/transport/shared_mem/SharedMemGlobal.hpp>

namespace eprosima{
namespace fastdds{
namespace rtps{

class MockPortSharedMemGlobal
{
public:

    static void remove_port_mutex(const std::string& domain_name, uint32_t port_id)
    {
        auto port_segment_name = domain_name + "_port" + std::to_string(port_id);

        SharedMemSegment::named_mutex::remove(port_segment_name.c_str());
    }

    static std::unique_ptr<SharedMemSegment::named_mutex> get_port_mutex(const std::string& domain_name, uint32_t port_id)
    {
        auto port_segment_name = domain_name + "_port" + std::to_string(port_id);

        std::unique_ptr<SharedMemSegment::named_mutex> port_mutex =
                SharedMemSegment::open_named_mutex(port_segment_name + "_mutex");

        return std::unique_ptr<SharedMemSegment::named_mutex>(SharedMemSegment::open_named_mutex(port_segment_name + "_mutex"));
    }

    static bool lock_empty_cv_mutex(SharedMemGlobal::Port& port)
    {
        return port.node_->empty_cv_mutex.try_lock();
    }

    /**
     * Simulates a deadlocked wait_pop.
     * Deadlock until is_listener_closed is true
     */
    static void wait_pop_deadlock(
            SharedMemGlobal::Port& port,
            SharedMemGlobal::Listener& listener,
            const std::atomic<bool>& is_listener_closed,
            uint32_t listener_index)
    {
        (void)listener;

        std::unique_lock<SharedMemSegment::mutex> lock(port.node_->empty_cv_mutex);

        port.node_->waiting_count++;
        auto& status = port.node_->listeners_status[listener_index];
        status.is_waiting = 1;

        port.node_->empty_cv.wait(lock, [&] {
                return is_listener_closed.load();
            });

        status.is_waiting = 0;
        port.node_->waiting_count--;
    }

    static void unblock_wait_pop(
        SharedMemGlobal::Port& port,
        std::atomic<bool>& is_listener_closed)
    {
        is_listener_closed.exchange(true);
        port.node_->empty_cv.notify_all();
    }

    static void set_port_not_ok(SharedMemGlobal::Port& port)
    {
        port.node_->is_port_ok = false;
    }

    static void forze_listener_leak(SharedMemGlobal::Port& port)
    {
        port.node_->ref_counter.fetch_add(1);
        auto listener = port.buffer_->register_listener();
        listener.release();
        port.node_->num_listeners++;
    }
};

} // namespace rtps
} // namespace fastdds
} // namespace eprosima

#endif // _FASTDDS_MOCKSHAREDMEM_GLOBAL_H_


text:
Copyright © {{ site.year }} Matthew Grey

    Made by Matt ∞


text:
package hu.karsany.veloxi;

import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;

import java.io.File;
import java.io.StringWriter;

/**
 * User: fkarsany
 * Date: 2013.01.03.
 * Time: 14:42
 */
public class VelocityOutput {

    private VelocityEngine velocityEngine = new VelocityEngine();
    private VelocityContext context = new VelocityContext();
    private Template template;

    public VelocityOutput(File templateFile) {
        velocityEngine.setProperty("runtime.log.logsystem.class", "org.apache.velocity.runtime.log.NullLogSystem");
        try {
            velocityEngine.setProperty("resource.loader", "file");
            velocityEngine.setProperty("file.resource.loader.path", "");
            velocityEngine.setProperty("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader");
            velocityEngine.init();
            template = velocityEngine.getTemplate(templateFile.getPath());
        } catch (Exception ex) {
            ex.printStackTrace();
            System.err.println("------------\n" + ex.getLocalizedMessage() + "\n-------------\n");
            System.exit(1);
        }
    }

    public void put(String k, Object v) {
        context.put(k, v);
    }

    public String generate() {
        StringWriter writer = new StringWriter();
        try {
            template.merge(context, writer);
        } catch (Exception ex) {
            ex.printStackTrace();
            System.err.println("------------\n" + ex.getLocalizedMessage() + "-------------\n");
            System.exit(1);
        }

        return writer.toString();
    }

}


text:
/*
 * $Id$
 */

/*

Copyright (c) 2000-2015 Board of Trustees of Leland Stanford Jr. University,
all rights reserved.

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

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
STANFORD UNIVERSITY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of Stanford University shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Stanford University.

*/

package org.lockss.crawler;

import java.io.IOException;
import java.util.List;

import org.apache.commons.collections.ListUtils;
import org.lockss.daemon.PluginException;
import org.lockss.daemon.PluginException.InvalidDefinition;
import org.lockss.plugin.*;
import org.lockss.plugin.ArchivalUnit.ConfigurationException;
import org.lockss.test.LockssTestCase;
import org.lockss.test.MockArchivalUnit;
import org.lockss.test.MockAuState;
import org.lockss.test.MockCrawlRule;
import org.lockss.test.MockLinkExtractor;
import org.lockss.test.MockLockssDaemon;
import org.lockss.test.MockPlugin;
import org.lockss.util.ListUtil;

public class TestBaseCrawlSeed extends LockssTestCase {

  protected MockLockssDaemon theDaemon;
  protected MockArchivalUnit mau = null;
  protected MockAuState aus = new MockAuState();
  protected MockCrawlRule crawlRule = null;
  protected String startUrl = "http://www.example.com/index.html";
  protected String permissionUrl = "http://www.example.com/permission.html";
  protected List<String> startUrls;
  protected List<String> permissionUrls;
  protected MockLinkExtractor extractor = new MockLinkExtractor();
  protected BaseCrawlSeed bcs;

  public void setUp() throws Exception {
    super.setUp();

    theDaemon = getMockLockssDaemon();

    mau = new MockArchivalUnit();
    mau.setPlugin(new MockPlugin(theDaemon));
    mau.setAuId("MyMockTestAu");
    startUrls = ListUtil.list(startUrl);
    permissionUrls = ListUtil.list(permissionUrl);
    mau.setStartUrls(startUrls);
    mau.setPermissionUrls(permissionUrls);

    bcs = new BaseCrawlSeed(mau);

  }

  public void testNullAu() {
    try {
      bcs = new BaseCrawlSeed((ArchivalUnit)null);
    } catch(Exception e) {
      fail("Should not throw it is conceivable"
          + " for a crawlseed to not need the au");
    }
  }

  public void testBadUrlListThrows()
      throws ConfigurationException, PluginException, IOException {
    mau.setStartUrls(null);
    try {
      bcs.getStartUrls();
      fail("null start url list should have thrown");
    } catch(InvalidDefinition e) {
      assertMatchesRE("non-null start URL list", e.getMessage());
    }

    mau.setPermissionUrls(null);
    try {
      bcs.getPermissionUrls();
      fail("null permission url list should have thrown");
    } catch(InvalidDefinition e) {
      assertMatchesRE("non-null permission URL list", e.getMessage());
    }

    mau.setStartUrls(ListUtils.EMPTY_LIST);
    try {
      bcs.getStartUrls();
      fail("empty start url list should have thrown");
    } catch(InvalidDefinition e) {
      assertMatchesRE("non-null start URL list", e.getMessage());
    }

    mau.setPermissionUrls(ListUtils.EMPTY_LIST);
    try {
      bcs.getPermissionUrls();
      fail("empty permission url list should have thrown");
    } catch(InvalidDefinition e) {
      assertMatchesRE("non-null permission URL list", e.getMessage());
    }
  }

  public void testSingleUrl()
      throws ConfigurationException, PluginException, IOException {
    assertEquals(startUrls, bcs.getStartUrls());
    assertEquals(permissionUrls, bcs.getPermissionUrls());
  }

  public void testMultipleUrls()
      throws ConfigurationException, PluginException, IOException {
    //Adding to urls to mock AU lists
    startUrls.add("http://www.example2.com/index2.html");
    startUrls.add("http://www.example3.com/index3.html");
    permissionUrls.add("http://www.exampletwo.com/permissiontwo.html");
    permissionUrls.add("http://www.exampleother.com/somethingElse.html");

    assertEquals(startUrls, bcs.getStartUrls());
    assertEquals(permissionUrls, bcs.getPermissionUrls());
  }

  public void testIsFailOnStartUrl() {
    assertTrue(bcs.isFailOnStartUrlError());
  }

}


text:
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// 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.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.CognitiveServices;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Management.CognitiveServices
{
    /// <summary>
    /// Get Account Types for Cognitive Services Account Type(s)
    /// </summary>
    [Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "CognitiveServicesAccountType", DefaultParameterSetName = GetAccountTypesParamSetName), OutputType(typeof(string[]), typeof(string))]
    public class GetAzureCognitiveServicesAccountTypeCommand : CognitiveServicesAccountBaseCmdlet
    {
        protected const string GetAccountTypeWithNameParamSetName = "GetAccountTypeWithName";
        protected const string GetAccountTypesParamSetName = "GetAccountTypes";

        [Parameter(
            ParameterSetName = GetAccountTypeWithNameParamSetName,
            Mandatory = true,
            ValueFromPipelineByPropertyName = true,
            HelpMessage = "Cognitive Services Account Type Name.")]
        [Alias(CognitiveServicesAccountTypeNameAlias, AccountTypeNameAlias, KindNameAlias)]
        public string TypeName { get; set; }

        [Parameter(
            ParameterSetName = GetAccountTypesParamSetName,
            Mandatory = false,
            ValueFromPipelineByPropertyName = true,
            HelpMessage = "Cognitive Services Account Location.")]
        [LocationCompleter("Microsoft.CognitiveServices/accounts")]
        public string Location { get; set; }

        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();
            RunCmdLet(() =>
            {
                switch (ParameterSetName)
                {
                    case GetAccountTypeWithNameParamSetName:

                        if (GetAccountKinds(this.CognitiveServicesClient).Contains(TypeName))
                        {
                            WriteObject(TypeName);
                        }
                        else
                        {
                            WriteObject(null);
                        }
                        break;
                    case GetAccountTypesParamSetName:
                        var resourceSkuKinds = GetAccountKinds(this.CognitiveServicesClient, this.Location).OrderBy(x => x).ToArray();
                        WriteObject(resourceSkuKinds, true);
                        break;
                }
            });
        }

        /// <summary>
        /// Get Cognitive Services Account Kinds.
        /// </summary>
        /// <param name="client">The ICognitiveServicesManagementClient instance.</param>
        /// <param name="location">The location as filter, set to null to ignore.</param>
        /// <returns>A set of available Kinds.</returns>
        private static HashSet<string> GetAccountKinds(ICognitiveServicesManagementClient client, string location = null)
        {
            var resourceSkuKindList = client.ResourceSkus.List().Where(resourceSku => (string.IsNullOrWhiteSpace(location) || resourceSku.Locations.Any(x => string.Compare(x, location, StringComparison.OrdinalIgnoreCase) == 0))).Select(x => x.Kind).ToList();
            return new HashSet<string>(resourceSkuKindList);
        }
    }
}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     此代码由工具生成。
//     运行时版本:4.0.30319.18408
//
//     对此文件的更改可能会导致不正确的行为,并且如果
//     重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------

namespace Sofire.Jint {
    using System;

    /// <summary>
    ///   一个强类型的资源类,用于查找本地化的字符串等。
    /// </summary>
    // 此类是由 StronglyTypedResourceBuilder
    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
    // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
    // (以 /str 作为命令选项),或重新生成 VS 项目。
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class StringInfoResource {

        private static global::System.Resources.ResourceManager resourceMan;

        private static global::System.Globalization.CultureInfo resourceCulture;

        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal StringInfoResource() {
        }

        /// <summary>
        ///   返回此类使用的缓存的 ResourceManager 实例。
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sofire.Extends.Jint.StringInfoResource", typeof(StringInfoResource).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

        /// <summary>
        ///   使用此强类型资源类,为所有资源查找
        ///   重写当前线程的 CurrentUICulture 属性。
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }

        /// <summary>
        ///   查找类似 无效的表达式声明。 的本地化字符串。
        /// </summary>
        internal static string ErrorInvalidExpressionStatement {
            get {
                return ResourceManager.GetString("ErrorInvalidExpressionStatement", resourceCulture);
            }
        }

        /// <summary>
        ///   查找类似 脚本嵌套超出最大前套数(500)。 的本地化字符串。
        /// </summary>
        internal static string ErrorManyRecursions {
            get {
                return ResourceManager.GetString("ErrorManyRecursions", resourceCulture);
            }
        }

        /// <summary>
        ///   查找类似 无法找到函数 [ {0} ]。 的本地化字符串。
        /// </summary>
        internal static string ErrorNotFoundFunction {
            get {
                return ResourceManager.GetString("ErrorNotFoundFunction", resourceCulture);
            }
        }

        /// <summary>
        ///   查找类似 在循环中只允许声明变量。 的本地化字符串。
        /// </summary>
        internal static string ErrorOnlyVariableInLoop {
            get {
                return ResourceManager.GetString("ErrorOnlyVariableInLoop", resourceCulture);
            }
        }

        /// <summary>
        ///   查找类似 无法枚举 [ {0} ] 属性。 的本地化字符串。
        /// </summary>
        internal static string ErrorPropertyCanNotBeEnumerated {
            get {
                return ResourceManager.GetString("ErrorPropertyCanNotBeEnumerated", resourceCulture);
            }
        }

        /// <summary>
        ///   查找类似 参数 [ {0} ] 是不合法的命名规则(不能为关键字或关键函数)。 的本地化字符串。
        /// </summary>
        internal static string ErrorRespectStrictParameters {
            get {
                return ResourceManager.GetString("ErrorRespectStrictParameters", resourceCulture);
            }
        }

        /// <summary>
        ///   查找类似 第 {0} 行的第 {1} 个字符。 的本地化字符串。
        /// </summary>
        internal static string SourceCodeLine {
            get {
                return ResourceManager.GetString("SourceCodeLine", resourceCulture);
            }
        }
    }
}


text:
angular.module('orderCloud')
    .controller('CatalogProductsCtrl', CatalogProductsController)
;

function CatalogProductsController($state, $stateParams, toastr, OrderCloudSDK, ocCatalog, ocParameters, Parameters, CurrentAssignments, ProductList) {
    var vm = this;
    vm.list = ProductList;
    //Set parameters
    vm.parameters = Parameters;
    //Sort by is a filter on mobile devices
    vm.sortSelection = Parameters.sortBy ? (Parameters.sortBy.indexOf('!') == 0 ? Parameters.sortBy.split('!')[1] : Parameters.sortBy) : null;
    //Check if search was used
    vm.searchResults = Parameters.search && Parameters.search.length > 0;

    vm.filter = function(resetPage) {
        $state.go('.', ocParameters.Create(vm.parameters, resetPage));
    };

    vm.search = function() {
        vm.filter(true);
    };

    vm.clearSearch = function() {
        vm.parameters.search = null;
        vm.filter(true);
    };

    vm.updateSort = function(value) {
        value ? angular.noop() : value = vm.sortSelection;
        switch(vm.parameters.sortBy) {
            case value:
                vm.parameters.sortBy = '!' + value;
                break;
            case '!' + value:
                vm.parameters.sortBy = null;
                break;
            default:
                vm.parameters.sortBy = value;
        }
        vm.filter(false);
    };

    vm.pageChanged = function() {
        $state.go('.', {page:vm.list.Meta.Page});
    };

    vm.loadMore = function() {
        var parameters = angular.extend(Parameters, {page:vm.list.Meta.Page + 1});
        return OrderCloudSDK.Products.List(parameters)
            .then(function(data) {
                var mappedData = ocCatalog.Products.MapAssignments(CurrentAssignments, data);
                vm.list.Items = vm.list.Items.concat(mappedData.Items);
                vm.list.Meta = mappedData.Meta;

                selectedCheck();
            });
    };

    function selectedCheck() {
        vm.allItemsSelected = (_.filter(vm.list.Items, {Assigned:true}).length == vm.list.Items.length);
    }

    function changedCheck() {
        vm.changedAssignments = ocCatalog.Products.CompareAssignments(CurrentAssignments, vm.list, $stateParams.categoryid);
    }

    selectedCheck();

    vm.selectAllItems = function() {
        vm.allItemsSelected = !vm.allItemsSelected;
        _.map(vm.list.Items, function(i) { i.Assigned = vm.allItemsSelected; });

        changedCheck();
    };

    vm.selectItem = function(scope) {
        if (!scope.product.Assigned) vm.allItemsSelected = false;
        vm.selectedCount = _.filter(vm.list.Items, {Assigned:true}).length;

        changedCheck();
    };

    vm.resetAssignments = function() {
        vm.list = ocCatalog.Products.MapAssignments(CurrentAssignments, vm.list);
        vm.changedAssignments = [];

        selectedCheck();
    };

    vm.updateAssignments = function() {
        vm.searchLoading = ocCatalog.Products.UpdateAssignments(CurrentAssignments, vm.changedAssignments, $stateParams.catalogid)
            .then(function(data) {
                angular.forEach(data.Errors, function(ex) {
                    $exceptionHandler(ex);
                });
                CurrentAssignments = data.UpdatedAssignments;

                changedCheck();
                selectedCheck();

                toastr.success('Product assignments updated.');
            });
    };
}


text:
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

/*

Ld is the portable code for a modified version of the Plan 9 linker.  The original is documented at

	http://plan9.bell-labs.com/magic/man2html/1/2l

It reads object files (.5, .6, or .8 files) and writes a binary named for the
architecture (5.out, 6.out, 8.out) by default (if $GOOS is windows, a .exe suffix
will be appended).

Major changes include:
	- support for ELF, Mach-O and PE binary files
	- support for segmented stacks (this feature is implemented here, not in the compilers).

Original options are listed on the manual page linked above.

Usage:
	go tool 6l [flags] mainObj
Substitute 6l with 8l or 5l as appropriate.

Options new in this version:

	-d
		Elide the dynamic linking header.  With this option, the binary
		is statically linked and does not refer to a dynamic linker.  Without this option
		(the default), the binary's contents are identical but it is loaded with a dynamic
		linker. This flag cannot be used when $GOOS is windows.
	-Hdarwin     (only in 6l/8l)
		Write Apple Mach-O binaries (default when $GOOS is darwin)
	-Hlinux
		Write Linux ELF binaries (default when $GOOS is linux)
	-Hfreebsd
		Write FreeBSD ELF binaries (default when $GOOS is freebsd)
	-Hnetbsd     (only in 6l/8l)
		Write NetBSD ELF binaries (default when $GOOS is netbsd)
	-Hopenbsd    (only in 6l/8l)
		Write OpenBSD ELF binaries (default when $GOOS is openbsd)
	-Hwindows    (only in 6l/8l)
		Write Windows PE32+ Console binaries (default when $GOOS is windows)
	-Hwindowsgui (only in 6l/8l)
		Write Windows PE32+ GUI binaries
	-I interpreter
		Set the ELF dynamic linker to use.
	-L dir1 -L dir2
		Search for libraries (package files) in dir1, dir2, etc.
		The default is the single location $GOROOT/pkg/$GOOS_$GOARCH.
	-r dir1:dir2:...
		Set the dynamic linker search path when using ELF.
	-V
		Print the linker version.
	-X symbol value
		Set the value of an otherwise uninitialized string variable.
		The symbol name should be of the form importpath.name,
		as displayed in the symbol table printed by "go tool nm".
	-b
		Link with race detection libraries.
	-B value
		Add a NT_GNU_BUILD_ID note when using ELF.  The value
		should start with 0x and be an even number of hex digits.
*/
package documentation


text:
/*	$NetBSD: smb_dev.c,v 1.6 2002/01/08 19:52:16 deberg Exp $	*/

/*
 * Copyright (c) 2000-2001 Boris Popov
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *    This product includes software developed by Boris Popov.
 * 4. Neither the name of the author nor the names of any co-contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * FreeBSD: src/sys/netsmb/smb_dev.c,v 1.4 2001/12/02 08:47:29 bp Exp
 */
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/fcntl.h>
#include <sys/filedesc.h>
#include <sys/ioccom.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/file.h>		/* Must come after sys/malloc.h */
#include <sys/mbuf.h>
#include <sys/poll.h>
#include <sys/proc.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/sysctl.h>
#include <sys/uio.h>
#include <sys/vnode.h>

#include <miscfs/specfs/specdev.h> /* XXX */

#include <net/if.h>

#include <netsmb/smb.h>
#include <netsmb/smb_conn.h>
#include <netsmb/smb_subr.h>
#include <netsmb/smb_dev.h>

#ifdef __NetBSD__
#include "netsmb.h"
static struct smb_dev * smb_devtbl[NNETSMB]; /* indexed by minor */
#define SMB_GETDEV(dev) (smb_devtbl[minor(dev)])
#else
#define SMB_GETDEV(dev)		((struct smb_dev*)(dev)->si_drv1)
#endif

#define	SMB_CHECKMINOR(dev)	do { \
				    sdp = SMB_GETDEV(dev); \
				    if (sdp == NULL) return ENXIO; \
				} while(0)

#ifndef __NetBSD__
static d_open_t	 nsmb_dev_open;
static d_close_t nsmb_dev_close;
static d_read_t	 nsmb_dev_read;
static d_write_t nsmb_dev_write;
static d_ioctl_t nsmb_dev_ioctl;
static d_poll_t	 nsmb_dev_poll;

MODULE_DEPEND(netsmb, libiconv, 1, 1, 1);
MODULE_VERSION(netsmb, NSMB_VERSION);

static int smb_version = NSMB_VERSION;

SYSCTL_DECL(_net_smb);
SYSCTL_INT(_net_smb, OID_AUTO, version, CTLFLAG_RD, &smb_version, 0, "");

static MALLOC_DEFINE(M_NSMBDEV, "NETSMBDEV", "NET/SMB device");
#endif

/*
int smb_dev_queue(struct smb_dev *ndp, struct smb_rq *rqp, int prio);
*/

#ifdef __NetBSD__
cdev_decl(nsmb_dev_);
#else
static struct cdevsw nsmb_cdevsw = {
	/* open */	nsmb_dev_open,
	/* close */	nsmb_dev_close,
	/* read */	nsmb_dev_read,
	/* write */	nsmb_dev_write,
	/* ioctl */ 	nsmb_dev_ioctl,
	/* poll */	nsmb_dev_poll,
	/* mmap */	nommap,
	/* strategy */	nostrategy,
	/* name */	NSMB_NAME,
	/* maj */	NSMB_MAJOR,
	/* dump */	nodump,
	/* psize */	nopsize,
	/* flags */	0,
#ifndef FB_CURRENT
	/* bmaj */	-1
#endif
};
#endif /* !__NetBSD__ */

#ifndef __NetBSD__
static eventhandler_tag nsmb_dev_tag;

static void
nsmb_dev_clone(void *arg, char *name, int namelen, dev_t *dev)
{
	int min;

	if (*dev != NODEV)
		return;
	if (dev_stdclone(name, NULL, NSMB_NAME, &min) != 1)
		return;
	*dev = make_dev(&nsmb_cdevsw, min, 0, 0, 0600, NSMB_NAME"%d", min);
}

#else /* __NetBSD__ */

void netsmbattach(int);

void
netsmbattach(int num)
{

	if (num <= 0) {
#ifdef DIAGNOSTIC
		panic("netsmbattach: cound <= 0");
#endif
		return;
	}

	if (smb_sm_init()) {
#ifdef DIAGNOSTIC
		panic("netsmbattach: smb_sm_init failed");
#endif
		return;
	}

	if (smb_iod_init()) {
#ifdef DIAGNOSTIC
		panic("netsmbattach: smb_iod_init failed");
#endif
		smb_sm_done();
		return;
	}
}
#endif /* __NetBSD__ */

int
nsmb_dev_open(dev_t dev, int oflags, int devtype, struct proc *p)
{
	struct smb_dev *sdp;
	int s;

	sdp = SMB_GETDEV(dev);
	if (sdp && (sdp->sd_flags & NSMBFL_OPEN))
		return EBUSY;
	if (sdp == NULL) {
		sdp = malloc(sizeof(*sdp), M_SMBDATA, M_WAITOK);
		smb_devtbl[minor(dev)] = (void*)sdp;
	}

#ifndef __NetBSD__
	/*
	 * XXX: this is just crazy - make a device for an already passed device...
	 * someone should take care of it.
	 */
	if ((dev->si_flags & SI_NAMED) == 0)
		make_dev(&nsmb_cdevsw, minor(dev), cred->cr_uid, cred->cr_gid, 0700,
		    NSMB_NAME"%d", dev2unit(dev));
#endif /* !__NetBSD__ */

	bzero(sdp, sizeof(*sdp));
/*
	STAILQ_INIT(&sdp->sd_rqlist);
	STAILQ_INIT(&sdp->sd_rplist);
	bzero(&sdp->sd_pollinfo, sizeof(struct selinfo));
*/
	s = splnet();
	sdp->sd_level = -1;
	sdp->sd_flags |= NSMBFL_OPEN;
	splx(s);
	return 0;
}

int
nsmb_dev_close(dev_t dev, int flag, int fmt, struct proc *p)
{
	struct smb_dev *sdp;
	struct smb_vc *vcp;
	struct smb_share *ssp;
	struct smb_cred scred;
	int s;

	SMB_CHECKMINOR(dev);
	s = splnet();
	if ((sdp->sd_flags & NSMBFL_OPEN) == 0) {
		splx(s);
		return EBADF;
	}
	smb_makescred(&scred, p, NULL);
	ssp = sdp->sd_share;
	if (ssp != NULL)
		smb_share_rele(ssp, &scred);
	vcp = sdp->sd_vc;
	if (vcp != NULL)
		smb_vc_rele(vcp, &scred);
/*
	smb_flushq(&sdp->sd_rqlist);
	smb_flushq(&sdp->sd_rplist);
*/
	smb_devtbl[minor(dev)] = NULL;
	free(sdp, M_SMBDATA);
#ifndef __NetBSD__
	destroy_dev(dev);
#endif
	splx(s);
	return 0;
}

int
nsmb_dev_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
{
	struct smb_dev *sdp;
	struct smb_vc *vcp;
	struct smb_share *ssp;
	struct smb_cred scred;
	int error = 0;

	SMB_CHECKMINOR(dev);
	if ((sdp->sd_flags & NSMBFL_OPEN) == 0)
		return EBADF;

	smb_makescred(&scred, p, NULL);
	switch (cmd) {
	    case SMBIOC_OPENSESSION:
		if (sdp->sd_vc)
			return EISCONN;
		error = smb_usr_opensession((struct smbioc_ossn*)data,
		    &scred, &vcp);
		if (error)
			break;
		sdp->sd_vc = vcp;
		smb_vc_unlock(vcp, 0);
		sdp->sd_level = SMBL_VC;
		break;
	    case SMBIOC_OPENSHARE:
		if (sdp->sd_share)
			return EISCONN;
		if (sdp->sd_vc == NULL)
			return ENOTCONN;
		error = smb_usr_openshare(sdp->sd_vc,
		    (struct smbioc_oshare*)data, &scred, &ssp);
		if (error)
			break;
		sdp->sd_share = ssp;
		smb_share_unlock(ssp, 0);
		sdp->sd_level = SMBL_SHARE;
		break;
	    case SMBIOC_REQUEST:
		if (sdp->sd_share == NULL)
			return ENOTCONN;
		error = smb_usr_simplerequest(sdp->sd_share,
		    (struct smbioc_rq*)data, &scred);
		break;
	    case SMBIOC_T2RQ:
		if (sdp->sd_share == NULL)
			return ENOTCONN;
		error = smb_usr_t2request(sdp->sd_share,
		    (struct smbioc_t2rq*)data, &scred);
		break;
	    case SMBIOC_SETFLAGS: {
		struct smbioc_flags *fl = (struct smbioc_flags*)data;
		int on;

		if (fl->ioc_level == SMBL_VC) {
			if (fl->ioc_mask & SMBV_PERMANENT) {
				on = fl->ioc_flags & SMBV_PERMANENT;
				if ((vcp = sdp->sd_vc) == NULL)
					return ENOTCONN;
				error = smb_vc_get(vcp, LK_EXCLUSIVE, &scred);
				if (error)
					break;
				if (on && (vcp->obj.co_flags & SMBV_PERMANENT) == 0) {
					vcp->obj.co_flags |= SMBV_PERMANENT;
					smb_vc_ref(vcp);
				} else if (!on && (vcp->obj.co_flags & SMBV_PERMANENT)) {
					vcp->obj.co_flags &= ~SMBV_PERMANENT;
					smb_vc_rele(vcp, &scred);
				}
				smb_vc_put(vcp, &scred);
			} else
				error = EINVAL;
		} else if (fl->ioc_level == SMBL_SHARE) {
			if (fl->ioc_mask & SMBS_PERMANENT) {
				on = fl->ioc_flags & SMBS_PERMANENT;
				if ((ssp = sdp->sd_share) == NULL)
					return ENOTCONN;
				error = smb_share_get(ssp, LK_EXCLUSIVE, &scred);
				if (error)
					break;
				if (on && (ssp->obj.co_flags & SMBS_PERMANENT) == 0) {
					ssp->obj.co_flags |= SMBS_PERMANENT;
					smb_share_ref(ssp);
				} else if (!on && (ssp->obj.co_flags & SMBS_PERMANENT)) {
					ssp->obj.co_flags &= ~SMBS_PERMANENT;
					smb_share_rele(ssp, &scred);
				}
				smb_share_put(ssp, &scred);
			} else
				error = EINVAL;
			break;
		} else
			error = EINVAL;
		break;
	    }
	    case SMBIOC_LOOKUP:
		if (sdp->sd_vc || sdp->sd_share)
			return EISCONN;
		vcp = NULL;
		ssp = NULL;
		error = smb_usr_lookup((struct smbioc_lookup*)data, &scred, &vcp, &ssp);
		if (error)
			break;
		if (vcp) {
			sdp->sd_vc = vcp;
			smb_vc_unlock(vcp, 0);
			sdp->sd_level = SMBL_VC;
		}
		if (ssp) {
			sdp->sd_share = ssp;
			smb_share_unlock(ssp, 0);
			sdp->sd_level = SMBL_SHARE;
		}
		break;
	    case SMBIOC_READ: case SMBIOC_WRITE: {
		struct smbioc_rw *rwrq = (struct smbioc_rw*)data;
		struct uio auio;
		struct iovec iov;

		if ((ssp = sdp->sd_share) == NULL)
			return ENOTCONN;
		iov.iov_base = rwrq->ioc_base;
		iov.iov_len = rwrq->ioc_cnt;
		auio.uio_iov = &iov;
		auio.uio_iovcnt = 1;
		auio.uio_offset = rwrq->ioc_offset;
		auio.uio_resid = rwrq->ioc_cnt;
		auio.uio_segflg = UIO_USERSPACE;
		auio.uio_rw = (cmd == SMBIOC_READ) ? UIO_READ : UIO_WRITE;
		auio.uio_procp = p;
		if (cmd == SMBIOC_READ)
			error = smb_read(ssp, rwrq->ioc_fh, &auio, &scred);
		else
			error = smb_write(ssp, rwrq->ioc_fh, &auio, &scred);
		rwrq->ioc_cnt -= auio.uio_resid;
		break;
	    }
	    default:
		error = ENODEV;
	}
	return error;
}

int
nsmb_dev_read(dev_t dev, struct uio *uio, int flag)
{
	return EACCES;
}

int
nsmb_dev_write(dev_t dev, struct uio *uio, int flag)
{
	return EACCES;
}

int
nsmb_dev_poll(dev_t dev, int events, struct proc *p)
{
	return ENODEV;
}

#ifndef __NetBSD__
static int
nsmb_dev_load(module_t mod, int cmd, void *arg)
{
	int error = 0;

	switch (cmd) {
	    case MOD_LOAD:
		error = smb_sm_init();
		if (error)
			break;
		error = smb_iod_init();
		if (error) {
			smb_sm_done();
			break;
		}
		cdevsw_add(&nsmb_cdevsw);
		nsmb_dev_tag = EVENTHANDLER_REGISTER(dev_clone, nsmb_dev_clone, 0, 1000);
		printf("netsmb_dev: loaded\n");
		break;
	    case MOD_UNLOAD:
		smb_iod_done();
		error = smb_sm_done();
		error = 0;
		EVENTHANDLER_DEREGISTER(dev_clone, nsmb_dev_tag);
		cdevsw_remove(&nsmb_cdevsw);
		printf("netsmb_dev: unloaded\n");
		break;
	    default:
		error = EINVAL;
		break;
	}
	return error;
}

DEV_MODULE (dev_netsmb, nsmb_dev_load, 0);
#endif /* !__NetBSD__ */

/*
 * Convert a file descriptor to appropriate smb_share pointer
 */
static struct file*
nsmb_getfp(struct filedesc* fdp, int fd, int flag)
{
	struct file* fp;

	fp = fd_getfile(fdp, fd);

	if ((fp->f_flag & flag) == 0)
		return (NULL);

	return (fp);
}

int
smb_dev2share(int fd, int mode, struct smb_cred *scred,
	struct smb_share **sspp)
{
	struct file *fp;
	struct vnode *vp;
	struct smb_dev *sdp;
	struct smb_share *ssp;
	dev_t dev;
	int error;

	fp = nsmb_getfp(scred->scr_p->p_fd, fd, FREAD | FWRITE);
	if (fp == NULL)
		return EBADF;
	vp = (struct vnode*)fp->f_data;
	if (vp == NULL)
		return EBADF;
	dev = vp->v_rdev;
	if (dev == NODEV)
		return EBADF;
	SMB_CHECKMINOR(dev);
	ssp = sdp->sd_share;
	if (ssp == NULL)
		return ENOTCONN;
	error = smb_share_get(ssp, LK_EXCLUSIVE, scred);
	if (error)
		return error;
	*sspp = ssp;
	return 0;
}


text:
package me.warriorg.design.structural.proxy.jdk;

public class RealSubject implements Subject {

    @Override
    public int sellBooks() {
        System.out.println("卖书");
        return 1 ;
    }

    @Override
    public String speak() {
        System.out.println("说话");
        return "张三";
    }
}


text:
// Copyright 2022 Google LLC
//
// 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.api.ads.admanager.jaxws.v202202;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
 *             Gets a {@link MobileApplicationPage mobileApplicationPage} of
 *             {@link MobileApplication mobile applications} that satisfy the given {@link Statement}.
 *             The following fields are supported for
 *             filtering:
 *
 *

 *

 *             PQL Property
 *             Object Property
 *

 *

 *             {@code id}
 *             {@link MobileApplication#id}
 *

 *

 *             {@code displayName}
 *             {@link MobileApplication#displayName}
 *

 *

 *             {@code appStore}
 *             {@link MobileApplication#appStore}
 *

 *

 *             {@code appStoreId}
 *             {@link MobileApplication#appStoreId}
 *

 *

 *             {@code isArchived}
 *             {@link MobileApplication#isArchived}
 *

 *

 *
 *
 *
Java class for getMobileApplicationsByStatement element declaration.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <element name="getMobileApplicationsByStatement">
 *   <complexType>
 *     <complexContent>
 *       <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *         <sequence>
 *           <element name="filterStatement" type="{https://www.google.com/apis/ads/publisher/v202202}Statement" minOccurs="0"/>
 *         </sequence>
 *       </restriction>
 *     </complexContent>
 *   </complexType>
 * </element>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "filterStatement"
})
@XmlRootElement(name = "getMobileApplicationsByStatement")
public class MobileApplicationServiceInterfacegetMobileApplicationsByStatement {

    protected Statement filterStatement;

    /**
     * Gets the value of the filterStatement property.
     *
     * @return
     *     possible object is
     *     {@link Statement }
     *
     */
    public Statement getFilterStatement() {
        return filterStatement;
    }

    /**
     * Sets the value of the filterStatement property.
     *
     * @param value
     *     allowed object is
     *     {@link Statement }
     *
     */
    public void setFilterStatement(Statement value) {
        this.filterStatement = value;
    }

}


text:
using std::vector;

#include <fst/float-weight.h>
#include <fst/product-weight.h>
#include <fst/string-weight.h>
#include <fst/lexicographic-weight.h>
#include <fst/power-weight.h>
#include <fst/signed-log-weight.h>
#include <fst/sparse-power-weight.h>

namespace fst {

// The boolean 'allow_zero' below determines whether Zero() and zero
// divisors should be returned in the random weight generation.

// This function object returns TropicalWeightTpl<T>'s that are random integers
// chosen from [0, kNumRandomWeights).
template <class T>
class TropicalWeightGenerator_ {
 public:
  typedef TropicalWeightTpl<T> Weight;

  TropicalWeightGenerator_(int seed = time(0), bool allow_zero = true)
      : allow_zero_(allow_zero) {
    srand(seed);
  }

  Weight operator() () const {
    int n = rand() % (kNumRandomWeights + allow_zero_);
    if (allow_zero_ && n == kNumRandomWeights)
      return Weight::Zero();

    return Weight(static_cast<T>(n));
  }

 private:
  // The number of alternative random weights.
  static const int kNumRandomWeights = 5;

  bool allow_zero_;  // permit Zero() and zero divisors
};

template <class T> const int TropicalWeightGenerator_<T>::kNumRandomWeights;

typedef TropicalWeightGenerator_<float> TropicalWeightGenerator;

// This function object returns LogWeightTpl<T>'s that are random integers
// chosen from [0, kNumRandomWeights).
template <class T>
class LogWeightGenerator_ {
 public:
  typedef LogWeightTpl<T> Weight;

  LogWeightGenerator_(int seed = time(0), bool allow_zero = true)
      : allow_zero_(allow_zero) {
    srand(seed);
  }

  Weight operator() () const {
    int n = rand() % (kNumRandomWeights + allow_zero_);
    if (allow_zero_ && n == kNumRandomWeights)
      return Weight::Zero();

    return Weight(static_cast<T>(n));
  }

 private:
  // Number of alternative random weights.
  static const int kNumRandomWeights = 5;

  bool allow_zero_;  // permit Zero() and zero divisors
};

template <class T> const int LogWeightGenerator_<T>::kNumRandomWeights;

typedef LogWeightGenerator_<float> LogWeightGenerator;

// This function object returns MinMaxWeightTpl<T>'s that are random integers
// chosen from (-kNumRandomWeights, kNumRandomWeights) in addition to
// One(), and Zero() if zero is allowed.
template <class T>
class MinMaxWeightGenerator_ {
 public:
  typedef MinMaxWeightTpl<T> Weight;

  MinMaxWeightGenerator_(int seed = time(0), bool allow_zero = true)
      : allow_zero_(allow_zero) {
    srand(seed);
  }

  Weight operator() () const {
    int n = (rand() % (2*kNumRandomWeights + allow_zero_)) - kNumRandomWeights;
    if (allow_zero_ && n == kNumRandomWeights)
      return Weight::Zero();
    else if (n == -kNumRandomWeights)
      return Weight::One();

    return Weight(static_cast<T>(n));
  }

 private:
  // Parameters controlling the number of alternative random weights.
  static const int kNumRandomWeights = 5;

  bool allow_zero_;  // permit Zero() and zero divisors
};

template <class T> const int MinMaxWeightGenerator_<T>::kNumRandomWeights;

typedef MinMaxWeightGenerator_<float> MinMaxWeightGenerator;

// This function object returns StringWeights that are random integer
// strings chosen from {1,...,kAlphabetSize}^{0,kMaxStringLength} U { Zero }
template <typename L, StringType S = STRING_LEFT>
class StringWeightGenerator {
 public:
  typedef StringWeight<L, S> Weight;

  StringWeightGenerator(int seed = time(0), bool allow_zero = true)
      : allow_zero_(allow_zero) {
     srand(seed);
  }

  Weight operator() () const {
    int n = rand() % (kMaxStringLength + allow_zero_);
    if (allow_zero_ && n == kMaxStringLength)
      return Weight::Zero();

    vector<L> v;
    for (int i = 0; i < n; ++i)
      v.push_back(rand() % kAlphabetSize + 1);
    return Weight(v.begin(), v.end());
  }

 private:
  // Alphabet size for random weights.
  static const int kAlphabetSize = 5;
  // Number of alternative random weights.
  static const int kMaxStringLength = 5;

  bool allow_zero_;  // permit Zero() and zero
};

template <typename L, StringType S>
const int StringWeightGenerator<L, S>::kAlphabetSize;
template <typename L, StringType S>
const int StringWeightGenerator<L, S>::kMaxStringLength;

// This function object returns a weight generator over the product of the
// weights (by default) for the generators G1 and G2.
template <class G1, class G2,
  class W = ProductWeight<typename G1::Weight, typename G2::Weight> >
class ProductWeightGenerator {
 public:
  typedef typename G1::Weight W1;
  typedef typename G2::Weight W2;
  typedef W Weight;

  ProductWeightGenerator(int seed = time(0), bool allow_zero = true)
      : generator1_(seed, allow_zero), generator2_(seed, allow_zero) {}

  Weight operator() () const {
    W1 w1 = generator1_();
    W2 w2 = generator2_();
    return Weight(w1, w2);
  }

 private:
  G1 generator1_;
  G2 generator2_;
};

// This function object returns a weight generator for a lexicographic weight
// composed out of weights for the generators G1 and G2. For lexicographic
// weights, we cannot generate zeroes for the two subweights separately:
// weights are members iff both members are zero or both members are non-zero.
template <class G1, class G2>
class LexicographicWeightGenerator {
 public:
  typedef typename G1::Weight W1;
  typedef typename G2::Weight W2;
  typedef LexicographicWeight<W1, W2> Weight;

  LexicographicWeightGenerator(int seed = time(0), bool allow_zero = true)
      : generator1_(seed, false), generator2_(seed, false),
        allow_zero_(allow_zero) {}

  Weight operator() () const {
    if (allow_zero_) {
      int n = rand() % (kNumRandomWeights + allow_zero_);
      if (n == kNumRandomWeights)
        return Weight(W1::Zero(), W2::Zero());
    }
    W1 w1 = generator1_();
    W2 w2 = generator2_();
    return Weight(w1, w2);
  }

 private:
  G1 generator1_;
  G2 generator2_;
  static const int kNumRandomWeights = 5;
  bool allow_zero_;
};

template <class G1, class G2>
const int LexicographicWeightGenerator<G1, G2>::kNumRandomWeights;

// Product generator of a string weight generator and an
// arbitrary weight generator.
template <class L, class G, GallicType T = GALLIC_LEFT>
class GallicWeightGenerator
    : public ProductWeightGenerator<
               StringWeightGenerator<L, GALLIC_STRING_TYPE(T)>, G> {
 public:
  typedef ProductWeightGenerator<
               StringWeightGenerator<L, GALLIC_STRING_TYPE(T)>, G> PG;
  typedef typename G::Weight W;
  typedef GallicWeight<L, W, T> Weight;

  GallicWeightGenerator(int seed = time(0), bool allow_zero = true)
      : PG(seed, allow_zero) {}

  GallicWeightGenerator(const PG &pg) : PG(pg) {}
};

// This function object returms a weight generator over the catersian power
// of rank n of the weights for the generator G.
template <class G, unsigned int n>
class PowerWeightGenerator {
 public:
  typedef typename G::Weight W;
  typedef PowerWeight<W, n> Weight;

  PowerWeightGenerator(int seed = time(0), bool allow_zero = true)
      : generator_(seed, allow_zero) {}

  Weight operator()() const {
    Weight w;
    for (size_t i = 0; i < n; ++i) {
      W r = generator_();
      w.SetValue(i, r);
    }
    return w;
  }

 private:
  G generator_;
};

// This function object returns SignedLogWeightTpl<T>'s that are
// random integers chosen from [0, kNumRandomWeights).
// The sign is randomly chosen as well.
template <class T>
class SignedLogWeightGenerator_ {
 public:
  typedef SignedLogWeightTpl<T> Weight;

  SignedLogWeightGenerator_(int seed = time(0), bool allow_zero = true)
  : allow_zero_(allow_zero) {
    srand(seed);
  }

  Weight operator() () const {
    int m = rand() % 2;
    int n = rand() % (kNumRandomWeights + allow_zero_);

    return SignedLogWeightTpl<T>(
      (m == 0) ?
        TropicalWeight(-1.0) :
        TropicalWeight(1.0),
      (allow_zero_ && n == kNumRandomWeights) ?
        LogWeightTpl<T>::Zero() :
        LogWeightTpl<T>(static_cast<T>(n)));
  }

 private:
  // Number of alternative random weights.
  static const int kNumRandomWeights = 5;
  bool allow_zero_;  // permit Zero() and zero divisors
};

template <class T> const int SignedLogWeightGenerator_<T>::kNumRandomWeights;

typedef SignedLogWeightGenerator_<float> SignedLogWeightGenerator;

// This function object returms a weight generator over the catersian power
// of rank n of the weights for the generator G.
template <class G, class K, unsigned int n>
class SparsePowerWeightGenerator {
 public:
  typedef typename G::Weight W;
  typedef SparsePowerWeight<W, K> Weight;

  SparsePowerWeightGenerator(int seed = time(0), bool allow_zero = true)
      : generator_(seed, allow_zero) {}

  Weight operator()() const {
    Weight w;
    for (size_t i = 1; i <= n; ++i) {
      W r = generator_();
      K p = i;
      w.Push(p, r, true);
    }
    return w;
  }

 private:
  G generator_;
};

}  // namespace fst

#endif  // FST_LIB_RANDOM_WEIGHT_H__


text:
class Receipt < ActiveRecord::Base
  belongs_to :notification, :validate => true, :autosave => true
  belongs_to :receiver, :polymorphic => :true
  belongs_to :message, :foreign_key => "notification_id"

  validates_presence_of :receiver

  scope :recipient, lambda { |recipient|
    where(:receiver_id => recipient.id,:receiver_type => recipient.class.to_s)
  }
  #Notifications Scope checks type to be nil, not Notification because of STI behaviour
  #with the primary class (no type is saved)
  scope :notifications_receipts, joins(:notification).where('notifications.type' => nil)
  scope :messages_receipts, joins(:notification).where('notifications.type' => Message.to_s)
  scope :notification, lambda { |notification|
    where(:notification_id => notification.id)
  }
  scope :conversation, lambda { |conversation|
    joins(:message).where('notifications.conversation_id' => conversation.id)
  }
  scope :sentbox, where(:mailbox_type => "sentbox")
  scope :inbox, where(:mailbox_type => "inbox")
  scope :trash, where(:trashed => true)
  scope :not_trash, where(:trashed => false)
  scope :is_read, where(:is_read => true)
  scope :is_unread, where(:is_read => false)

  after_validation :remove_duplicate_errors
  class << self
    #Marks all the receipts from the relation as read
    def mark_as_read(options={})
      update_receipts({:is_read => true}, options)
    end

    #Marks all the receipts from the relation as unread
    def mark_as_unread(options={})
      update_receipts({:is_read => false}, options)
    end

    #Marks all the receipts from the relation as trashed
    def move_to_trash(options={})
      update_receipts({:trashed => true}, options)
    end

    #Marks all the receipts from the relation as not trashed
    def untrash(options={})
      update_receipts({:trashed => false}, options)
    end

    #Moves all the receipts from the relation to inbox
    def move_to_inbox(options={})
      update_receipts({:mailbox_type => :inbox, :trashed => false}, options)
    end

    #Moves all the receipts from the relation to sentbox
    def move_to_sentbox(options={})
      update_receipts({:mailbox_type => :sentbox, :trashed => false}, options)
    end

    #This methods helps to do a update_all with table joins, not currently supported by rails.
    #Acording to the github ticket https://github.com/rails/rails/issues/522 it should be
    #supported with 3.2.
    def update_receipts(updates,options={})
      ids = Array.new
      where(options).each do |rcp|
        ids << rcp.id
      end
      return if ids.empty?
      conditions = [""].concat(ids)
      condition = "id = ? "
      ids.drop(1).each do
        condition << "OR id = ? "
      end
      conditions[0] = condition
      Receipt.except(:where).except(:joins).where(conditions).update_all(updates)
    end
  end

  #Marks the receipt as read
  def mark_as_read
    update_attributes(:is_read => true)
  end

  #Marks the receipt as unread
  def mark_as_unread
    update_attributes(:is_read => false)
  end

  #Marks the receipt as trashed
  def move_to_trash
    update_attributes(:trashed => true)
  end

  #Marks the receipt as not trashed
  def untrash
    update_attributes(:trashed => false)
  end

  #Moves the receipt to inbox
  def move_to_inbox
    update_attributes(:mailbox_type => :inbox, :trashed => false)
  end

  #Moves the receipt to sentbox
  def move_to_sentbox
    update_attributes(:mailbox_type => :sentbox, :trashed => false)
  end

  #Returns the conversation associated to the receipt if the notification is a Message
  def conversation
    return message.conversation if message.is_a? Message
    return nil
  end

  #Returns if the participant have read the Notification
  def is_unread?
    return !self.is_read
  end

  #Returns if the participant have trashed the Notification
  def is_trashed?
    return self.trashed
  end

  protected

  #Removes the duplicate error about not present subject from Conversation if it has been already
  #raised by Message
  def remove_duplicate_errors
    if self.errors["notification.conversation.subject"].present? and self.errors["notification.subject"].present?
      self.errors["notification.conversation.subject"].each do |msg|
        self.errors["notification.conversation.subject"].delete(msg)
      end
    end
  end

  if Mailboxer.search_enabled
    searchable do
      text :subject, :boost => 5 do
        message.subject if message
      end
      text :body do
        message.body if message
      end
      integer :receiver_id
    end
  end

end


text:
{% extends "layout.html" %}
{% block title %}hello {{ name }}!{% endblock %}
{% block body %}

hello {{ name }}!

{% endblock %}


text:
package ssa

// TODO: use go/types instead?

// A type interface used to import cmd/internal/gc:Type
// Type instances are not guaranteed to be canonical.
type Type interface {
	Size() int64 // return the size in bytes
	Alignment() int64

	IsBoolean() bool // is a named or unnamed boolean type
	IsInteger() bool //  ... ditto for the others
	IsSigned() bool
	IsFloat() bool
	IsComplex() bool
	IsPtrShaped() bool
	IsString() bool
	IsSlice() bool
	IsArray() bool
	IsStruct() bool
	IsInterface() bool

	IsMemory() bool // special ssa-package-only types
	IsFlags() bool
	IsVoid() bool

	ElemType() Type // given []T or *T or [n]T, return T
	PtrTo() Type    // given T, return *T

	NumFields() int         // # of fields of a struct
	FieldType(i int) Type   // type of ith field of the struct
	FieldOff(i int) int64   // offset of ith field of the struct
	FieldName(i int) string // name of ith field of the struct

	NumElem() int64 // # of elements of an array

	String() string
	SimpleString() string // a coarser generic description of T, e.g. T's underlying type
	Equal(Type) bool
	Compare(Type) Cmp // compare types, returning one of CMPlt, CMPeq, CMPgt.
}

// Special compiler-only types.
type CompilerType struct {
	Name   string
	size   int64
	Memory bool
	Flags  bool
	Void   bool
	Int128 bool
}

func (t *CompilerType) Size() int64            { return t.size } // Size in bytes
func (t *CompilerType) Alignment() int64       { return 0 }
func (t *CompilerType) IsBoolean() bool        { return false }
func (t *CompilerType) IsInteger() bool        { return false }
func (t *CompilerType) IsSigned() bool         { return false }
func (t *CompilerType) IsFloat() bool          { return false }
func (t *CompilerType) IsComplex() bool        { return false }
func (t *CompilerType) IsPtrShaped() bool      { return false }
func (t *CompilerType) IsString() bool         { return false }
func (t *CompilerType) IsSlice() bool          { return false }
func (t *CompilerType) IsArray() bool          { return false }
func (t *CompilerType) IsStruct() bool         { return false }
func (t *CompilerType) IsInterface() bool      { return false }
func (t *CompilerType) IsMemory() bool         { return t.Memory }
func (t *CompilerType) IsFlags() bool          { return t.Flags }
func (t *CompilerType) IsVoid() bool           { return t.Void }
func (t *CompilerType) String() string         { return t.Name }
func (t *CompilerType) SimpleString() string   { return t.Name }
func (t *CompilerType) ElemType() Type         { panic("not implemented") }
func (t *CompilerType) PtrTo() Type            { panic("not implemented") }
func (t *CompilerType) NumFields() int         { panic("not implemented") }
func (t *CompilerType) FieldType(i int) Type   { panic("not implemented") }
func (t *CompilerType) FieldOff(i int) int64   { panic("not implemented") }
func (t *CompilerType) FieldName(i int) string { panic("not implemented") }
func (t *CompilerType) NumElem() int64         { panic("not implemented") }

// Cmp is a comparison between values a and b.
// -1 if a < b
//  0 if a == b
//  1 if a > b
type Cmp int8

const (
	CMPlt = Cmp(-1)
	CMPeq = Cmp(0)
	CMPgt = Cmp(1)
)

func (t *CompilerType) Compare(u Type) Cmp {
	x, ok := u.(*CompilerType)
	// ssa.CompilerType is smaller than any other type
	if !ok {
		return CMPlt
	}
	if t == x {
		return CMPeq
	}
	// desire fast sorting, not pretty sorting.
	if len(t.Name) == len(x.Name) {
		if t.Name == x.Name {
			return CMPeq
		}
		if t.Name < x.Name {
			return CMPlt
		}
		return CMPgt
	}
	if len(t.Name) > len(x.Name) {
		return CMPgt
	}
	return CMPlt
}

func (t *CompilerType) Equal(u Type) bool {
	x, ok := u.(*CompilerType)
	if !ok {
		return false
	}
	return x == t
}

var (
	TypeInvalid = &CompilerType{Name: "invalid"}
	TypeMem     = &CompilerType{Name: "mem", Memory: true}
	TypeFlags   = &CompilerType{Name: "flags", Flags: true}
	TypeVoid    = &CompilerType{Name: "void", Void: true}
	TypeInt128  = &CompilerType{Name: "int128", size: 16, Int128: true}
)


text:
package org.jbpm.dashboard.renderer.client;

import java.util.Date;

import org.dashbuilder.dataset.RawDataSet;

import static org.jbpm.dashboard.renderer.model.DashboardData.*;

public class ProcessDashboardData extends RawDataSet {

    /**
     * Status:
     * 0: pending
     * 1: active
     * 2: completed
     * 3: aborted
     * 4: suspended
     */
    public static final ProcessDashboardData INSTANCE = new ProcessDashboardData(
            new String[] {
                    // Ensure the tests also works with columns in a different case,
                    // which is actually the case when working with some DBs
                    COLUMN_PROCESS_ID.toUpperCase(),
                    COLUMN_PROCESS_INSTANCE_ID.toUpperCase(),
                    COLUMN_PROCESS_EXTERNAL_ID.toUpperCase(),
                    COLUMN_PROCESS_NAME.toUpperCase(),
                    COLUMN_PROCESS_USER_ID.toUpperCase(),
                    COLUMN_PROCESS_START_DATE.toUpperCase(),
                    COLUMN_PROCESS_END_DATE.toUpperCase(),
                    COLUMN_PROCESS_STATUS.toUpperCase(),
                    COLUMN_PROCESS_VERSION.toUpperCase(),
                    COLUMN_PROCESS_DURATION.toUpperCase()},
            new Class[] {
                    String.class,
                    Integer.class,
                    String.class,
                    String.class,
                    String.class,
                    Date.class,
                    Date.class,
                    Integer.class,
                    String.class,
                    Integer.class},
            new String[][] {
                    {"1", "1", "org.jbpm.test", "Process A", "user1", "01/01/19 12:00", null, "1", "1", null},
                    {"1", "2", "org.jbpm.test", "Process A", "user2", "01/01/19 12:00", null, "1", "1", null},
                    {"1", "3", "org.jbpm.test", "Process B", "user1", "01/01/19 12:00", null, "1", "1", null},
                    {"1", "4", "org.jbpm.test", "Process B", "user2", "01/01/19 12:00", "01/02/19 10:00", "2", "1", "100000"}
            });

    public ProcessDashboardData(String[] columnIds, Class[] types, String[][] data) {
        super(columnIds, types, data);
    }

}


text:
var callStats = null;

function initCallback (err, msg) {
    console.log("Initializing Status: err="+err+" msg="+msg);
}

var CallStats = {
    init: function (jingleSession) {

        if(!config.callStatsID || !config.callStatsSecret || callStats !== null)
            return;

        callStats = new callstats($,io,jsSHA);

        this.session = jingleSession;
        this.peerconnection = jingleSession.peerconnection.peerconnection;

        this.userID =  APP.xmpp.myResource();

        var location = window.location;
        this.confID = location.protocol + "//" +
            location.hostname + location.pathname;

        //userID is generated or given by the origin server
        callStats.initialize(config.callStatsID,
            config.callStatsSecret,
            this.userID,
            initCallback);

        var usage = callStats.fabricUsage.unbundled;
        if(config.useBundle)
            usage = callStats.fabricUsage.multiplex;

        callStats.addNewFabric(this.peerconnection,
            Strophe.getResourceFromJid(jingleSession.peerjid),
            usage,
            this.confID,
            this.pcCallback.bind(this));
    },
    pcCallback: function (err, msg) {
        if(!callStats)
            return;
        console.log("Monitoring status: "+ err + " msg: " + msg);
        callStats.sendFabricEvent(this.peerconnection,
            callStats.fabricEvent.fabricSetup, this.confID);
    },
    sendMuteEvent: function (mute, type) {
        if(!callStats)
            return;
        var event = null;
        if(type === "video")
        {
            event = (mute? callStats.fabricEvent.videoPause :
                callStats.fabricEvent.videoResume);
        }
        else
        {
            event = (mute? callStats.fabricEvent.audioMute :
                callStats.fabricEvent.audioUnmute);
        }
        callStats.sendFabricEvent(this.peerconnection, event, this.confID);
    },
    sendTerminateEvent: function () {
        if(!callStats)
            return;
        callStats.sendFabricEvent(this.peerconnection,
            callStats.fabricEvent.fabricTerminated, this.confID);
    },
    sendSetupFailedEvent: function () {
        if(!callStats)
            return;
        callStats.sendFabricEvent(this.peerconnection,
            callStats.fabricEvent.fabricSetupFailed, this.confID);
    }

};
module.exports = CallStats;


text:
import requests

def geocode(address):
    parameters = {'address': address, 'sensor': 'false'}
    base = 'http://maps.googleapis.com/maps/api/geocode/json'
    response = requests.get(base, params=parameters)
    answer = response.json()
    print(answer['results'][0]['geometry']['location'])

if __name__ == '__main__':
    #address = '207 N. Defiance St, Archbold, OH'
    address = '15th cross, Maleshwaram,Banglore'
    geocode(address)


text:
<?php

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */

use yii\helpers\Html;
//use yii\bootstrap\ActiveForm;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;

$this->title = 'Login';
$this->params['breadcrumbs'][] = $this->title;

\frontend\assets\CommonAsset::register($this);
?>

<?= Html::encode($this->title) ?>

Please fill out the following fields to login:

            <?php $form = ActiveForm::begin(['id' => 'login-form']); ?>

                <?= $form->field($model, 'server')->dropDownList(ArrayHelper::map($server_list,"ID",'ServerName')) ?>

                <?= $form->field($model, 'username')->textInput(['autofocus' => true]) ?>

                <?= $form->field($model, 'password')->passwordInput() ?>

                <?= $form->field($model, 'rememberMe')->checkbox() ?>

                    If you forgot your password you can <?= Html::a('忘记密码', ['site/request-password-reset']) ?>.

                    <?= Html::submitButton('Login', ['class' => 'btn btn-primary', 'name' => 'login-button']) ?>

            <?php ActiveForm::end(); ?>


text:
<!DOCTYPE html>
<meta charset=utf-8>
<title>Redirecting...</title>
<link rel=canonical href="../昆/index.html">
<meta http-equiv=refresh content="0; url='../昆/index.html'">

Redirecting...

Click here if you are not redirected.


text:
.. module:: twilio.rest.resources

=================
Phone Numbers
=================

With Twilio you can search and buy real phone numbers using the API.

For more information, see the
`IncomingPhoneNumbers REST Resource
<http://www.twilio.com/docs/api/rest/incoming-phone-numbers>`_ documentation.

Searching and Buying a Number
--------------------------------

Finding numbers to buy couldn't be easier.
The example below searches for a number with US area code '530'.
Once we find one, we'll purchase it for our account.

.. code-block:: python

    from twilio.rest import TwilioRestClient

    # To find these visit https://www.twilio.com/user/account
    ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXX"
    AUTH_TOKEN = "YYYYYYYYYYYYYYYYYY"

    client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
    numbers = client.phone_numbers.search(area_code=530)

    if numbers:
        numbers[0].purchase()
    else:
        print "No numbers in 530 available"

Local, Toll Free, and Mobile Numbers
------------------------------------

By default, :meth:`PhoneNumbers.search` looks for local phone numbers. To
search for numbers for a given type, include the desired type in the
:attr:`type` paramter.

Available types are:
- `local`
- `tollfree`
- `mobile`

.. code-block:: python

    # Local
    numbers = client.phone_numbers.search(type="local")

    # Toll Free
    numbers = client.phone_numbers.search(type="tollfree")

    # Mobile
    numbers = client.phone_numbers.search(type="mobile")

Similarly, you can purchase numbers of a given type. You must still include
the :attr:`phone_number` or :attr:`area_code` parameters.

.. code-block:: python

    # Local
    numbers = client.phone_numbers.purchase(type='local', phone_number'(919) 123-4567')

    # Toll Free
    numbers = client.phone_numbers.purchase(type='tollfree', phone_number'(919) 123-4567')

    # Mobile
    numbers = client.phone_numbers.purchase(type='mobile', phone_number'(919) 123-4567')

Numbers Containing Words
^^^^^^^^^^^^^^^^^^^^^^^^^^

Phone number search also supports looking for words inside phone numbers.
The following example will find any phone number with "FOO" in it.

.. code-block:: python

    numbers = client.phone_numbers.search(contains="FOO")

You can use the ''*'' wildcard to match any character. The following example finds any phone number that matches the pattern ''D*D''.

.. code-block:: python

    numbers = client.phone_numbers.search(contains="D*D")

International Numbers
^^^^^^^^^^^^^^^^^^^^^^^^^^

By default, the client library will look for US numbers. Set the
:data:`country` keyword to a country code of your choice to search for
international numbers.

.. code-block:: python

    numbers = client.phone_numbers.search(country="FR")

:meth:`PhoneNumbers.search` method has plenty of other options to augment your search :

- :data:`region`: When searching the US, show numbers in this state
- :data:`postal_code`: Only show numbers in this area code
- :data:`rate_center`: US only.
- :data:`near_lat_long`: Find numbers near this latitude and longitude.
- :data:`distance`: Search radius for a Near- query in miles.

The `AvailablePhoneNumbers REST Resource
<http://www.twilio.com/docs/api/rest/available-phone-numbers>`_ documentation
has more information on the various search options.

Buying a Number
---------------

If you've found a phone number you want, you can purchase the number.

.. code-block:: python

    from twilio.rest import TwilioRestClient

    # To find these visit https://www.twilio.com/user/account
    ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXX"
    AUTH_TOKEN = "YYYYYYYYYYYYYYYYYY"

    client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
    number = client.phone_numbers.purchase(phone_number="+15305431234")

However, it's easier to purchase numbers after finding them using search (as
shown in the first example).

Updating Properties on a Number
-------------------------------

To update the properties on a phone number, such as the Voice URL, call :meth:`update`
on the phone number object, with any of the parameters
listed in the `IncomingPhoneNumbers Resource documentation
<http://www.twilio.com/docs/api/rest/incoming-phone-numbers>`_

.. code-block:: python

    from twilio.rest import TwilioRestClient

    # To find these visit https://www.twilio.com/user/account
    ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXX"
    AUTH_TOKEN = "YYYYYYYYYYYYYYYYYY"

    client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
    for number in client.phone_numbers.list(api_version="2010-04-01"):
        number.update(voice_url="http://twimlets.com/holdmusic?" +
            "Bucket=com.twilio.music.ambient",
            status_callback="http://example.com/callback")

Changing Applications
----------------------

An :class:`Application` encapsulates all necessary URLs for use with phone numbers. Update an application on a phone number using :meth:`update`.

.. code-block:: python

    from twilio.rest import TwilioRestClient

    phone_sid = "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

    # To find these visit https://www.twilio.com/user/account
    ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXX"
    AUTH_TOKEN = "YYYYYYYYYYYYYYYYYY"

    client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
    number = client.phone_numbers.update(phone_sid, sms_application_sid="AP123")

See :doc:`/usage/applications` for instructions on updating and maintaining Applications.

Validate a Phone Number
-----------------------

See validation instructions here: :doc:`/usage/caller-ids`:


text:
using System;
using System.Threading;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Remote;

namespace FileManager.Test.Base {
    public abstract class CommonBase {
        public RemoteWebDriver Driver { get; set; }

        public void ClearAndType(IWebElement element, string value) {
            element.Clear();
            element.SendKeys(value);
        }

        public void WaitUpTo(int milliseconds, Func<bool> condition, string description) {
            int timeElapsed = 0;
            while (!condition() && timeElapsed < milliseconds) {
                Thread.Sleep(100);
                timeElapsed += 100;
            }

            if (timeElapsed >= milliseconds || !condition()) {
                throw new AssertionException("Timed out while waiting for: " + description);
            }
        }

        public static void AssertIsEqual(string expectedValue, string actualValue, string elementDescription) {
            if (expectedValue != actualValue) {
                throw new AssertionException(String.Format("AssertIsEqual Failed: '{0}' didn't match expectations. Expected [{1}], Actual [{2}]", elementDescription, expectedValue, actualValue));
            }
        }

        public static bool IsElementPresent(IWebElement element) {
            try {
                var b = element.Displayed;
                return true;
            }
            catch {
                return false;
            }
        }

        public static void AssertElementPresent(IWebElement element, string elementDescription) {
            if (!IsElementPresent(element))
                throw new AssertionException(String.Format("AssertElementPresent Failed: Could not find '{0}'", elementDescription));
        }

        public static bool IsElementPresent(ISearchContext context, By searchBy) {
            try {
                var b = context.FindElement(searchBy).Displayed;
                return true;
            }
            catch {
                return false;
            }
        }

        public static void AssertElementPresent(ISearchContext context, By searchBy, string elementDescription) {
            if (!IsElementPresent(context, searchBy))
                throw new AssertionException(String.Format("AssertElementPresent Failed: Could not find '{0}'", elementDescription));
        }

        public static void AssertElementsPresent(IWebElement[] elements, string elementDescription) {
            if (elements.Length == 0)
                throw new AssertionException(String.Format("AssertElementsPresent Failed: Could not find '{0}'", elementDescription));
        }

        public static void AssertElementText(IWebElement element, string expectedValue, string elementDescription) {
            AssertElementPresent(element, elementDescription);
            string actualtext = element.Text;
            if (actualtext != expectedValue) {
                throw new AssertionException(String.Format("AssertElementText Failed: Value for '{0}' did not match expectations. Expected: [{1}], Actual: [{2}]", elementDescription, expectedValue, actualtext));
            }
        }

    }
}


text:
/** @jsx React.DOM */

var View = React.createClass({displayName: 'View',

    getInitialState: function() {
        var state = {
            data: this.props.data,
            bindings: this.props.bindings,
            activeChapterLabel: '',
        }
        var chapters = this.props.data.chapters;
        if (_.size(chapters) > 0) {
            state.activeChapterLabel = chapters[0].label;
        }
        state.visibility = _.reduce(chapters, function(v, chapter) {
            v[chapter.label] = false;
            return v;
        }, {});

        return state;
    },

    setBinding: function(key, val) {
        var bindings = this.state.bindings;
        bindings.set(key, val);
        this.setState({
            bindings: bindings,
        });
    },

    update: function(data) {
        this.setState({ data: data, });
    },

    selectChapter: function(chapterLabel) {
        var visibility = _.clone(this.state.visibility);
        var activeChapterLabel = this.state.activeChapterLabel;

        visibility[chapterLabel] = true;
        if (chapterLabel != activeChapterLabel)
            visibility[activeChapterLabel] = false;

        this.setState({
            visibility: visibility,
            activeChapterLabel: chapterLabel,
        });

        return false;
    },

    render: function() {
        var self = this;
        var data = this.state.data;
        var visibility = this.state.visibility;
        var chapters = data.chapters.map(function(chapter) {
            var visible = visibility[chapter.label];
            return (
                Chapter(
                    {data:chapter,
                    visible:visible,
                    setBinding:self.setBinding,
                    bindings:self.state.bindings,
                    defaultBindings:data.defaultBindings,
                    onChapterSelect:self.selectChapter}
                )
            );
        });

        return (
            React.DOM.div(null,
                React.DOM.h1(null, data.storyTitle),
                React.DOM.p(null, data.synopsis),
                React.DOM.hr(null ),
                ChapterList(
                    {data:data.chapters,
                    onChapterSelect:this.selectChapter} ),
                React.DOM.hr(null ),
                ChapterContainer( {ref:"chapters"}, chapters)
            )
        );
    }
});

var ChapterContainer = React.createClass({displayName: 'ChapterContainer',
    render: function() {
        return (
            React.DOM.div(null, this.props.children)
        );
    }
});

var ChapterList = React.createClass({displayName: 'ChapterList',

    render: function() {
        var self = this;
        var contents = self.props.data.map(function(chapter) {
            var handler = self.props.onChapterSelect.bind(null, chapter.label);
            return (
                React.DOM.li(null,
                    React.DOM.a( {href:"", onClick:handler},
                        chapter.title
                    )
                )
            )
        });
        return (
            React.DOM.ul(null, contents)
        );
    }
});

var Chapter = React.createClass({displayName: 'Chapter',

    getInitialState: function() {
        var scenes = this.props.data.scenes || [];
        var state = {
            activeScene: {},
        };
        if (_.size(scenes) > 0) {
            state.activeScene = scenes[0];
        }
        state.visibility = _.reduce(scenes, function(v, scene) {
            v[scene.label] = false;
            return v;
        }, {});
        return state;
    },

    selectScene: function(scene) {
        var visibility = _.clone(this.state.visibility);
        var activeScene = this.state.activeScene;

        visibility[scene.label] = true;
        if (scene.label != activeScene.label)
            visibility[activeScene.label] = false;

        this.setState({
            visibility: visibility,
            activeScene: scene,
        });

        //return false;
    },

    componentWillReceiveProps: function() {
        var scenes = this.props.data.scenes || [];
        var activeScene = this.state.activeScene;
        var updatedScene = _.find(scenes, function(scene) {
            if (scene.label == activeScene.label)
                return true;
        });
        if (updatedScene) {
            this.selectScene(updatedScene);
        }
    },

    render: function() {
        var self = this;
        var data = this.props.data;
        var visibility = this.state.visibility;
        var scenes = _.map(data.scenes, function(scene) {
            return (
                Scene(
                    {onChapterSelect:self.props.onChapterSelect,
                    setBinding:self.props.setBinding,
                    bindings:self.props.bindings,
                    defaultBindings:self.props.defaultBindings,
                    otherScenes:data.scenes,
                    visible:visibility[scene.label],
                    data:scene} )
            );
        });

        var sceneLinks = _.map(data.scenes, function(scene) {
            return (
                React.DOM.li(null,
                    React.DOM.a( {href:"#"+scene.label, onClick:self.selectScene.bind(null, scene)},
                        scene.title
                    )
                )
            );
        });

        var style = toDisplayStyle(this.props.visible);
        return (
            React.DOM.div( {style:style},
                React.DOM.h2(null, data.title),
                React.DOM.p(null, "Scenes:"),
                React.DOM.ul(null, sceneLinks),
                React.DOM.hr(null ),
                React.DOM.div( {ref:"scenes", className:"scenes"}, scenes)
                /*<Scene ref='scene' otherScenes={scenes} data={this.state.activeScene} /> */
            )
        );
    }
});

var Scene = React.createClass({displayName: 'Scene',

    getInitialState: function() {
        return {
            subsceneLabel: '',
        }
    },

    componentWillReceiveProps: function() {
        var subscene = this.state.subscene;
        if (subscene && subscene.props.data)
            this.showSubScene(subscene.props.data.label);
    },

    setSubscene: function(label) {
        this.setState({ subsceneLabel: label });
        //return false;
    },

    getSubscene: function() {
        var subsceneLabel = this.state.subsceneLabel;
        var data = _.find(this.props.otherScenes, function(scene) {
            return scene.label == subsceneLabel;
        });
        var subscene;
        var key = this.props.data.label + "->" + subsceneLabel;
        if (data) {
            subscene = (
                Scene(
                    {setBinding:this.props.setBinding,
                    bindings:this.props.bindings,
                    defaultBindings:this.props.defaultBindings,
                    onChapterSelect:this.props.onChapterSelect,
                    key:key,
                    visible:true,
                    otherScenes:this.props.otherScenes,
                    data:data} )
            );
        } else {
            subscene = React.DOM.p(null)
        }
        return subscene;
    },

    createSceneLink: function(elem, mappings) {
        var label = elem.label;
        var toScene = mappings[label] || "";
        return (
            React.DOM.a( {className:"scene-link",
               href:"#"+toScene,
               onClick:this.setSubscene.bind(null, toScene)},
               elem.text
            )
        );
    },

    createChapterLink: function(elem, mappings) {
        var label = elem.label;
        var toChapter = mappings[label] || "nope";
        var handler = this.props.onChapterSelect;
        return (
            React.DOM.a( {className:"chapter-link",
                href:"#"+toChapter,
                onClick:handler.bind(null, toChapter)},
                elem.text
            )
        );
    },

    createImage: function(elem, mappings) {
        var label = elem.label;
        var url = mappings[label] || "";
        return React.DOM.img( {src:url} )
    },

    createInput: function(elem, mappings) {
        var self = this;
        var label = elem.label;
        var toScene = mappings[label] || "";
        var key = elem.text;
        return (
            React.DOM.span( {className:"game-input"},
                React.DOM.input(
                    {ref:"input",
                    defaultValue:self.props.bindings.get(key),
                    onKeyUp:onKeyUp} ),
                React.DOM.a( {ref:"link", href:"#"+toScene,
                    onClick:handler},
                    "[",elem.buttonVal,"]"
                )
            )
        );

        function handler() {
            self.setSubscene(toScene);
            var input = self.refs.input.getDOMNode();
            input.value = input.value ||
                self.props.defaultBindings[key];
            self.props.setBinding(key, input.value);
        }

        function onKeyUp(e) {
            if (e.keyCode == 13)  {
                self.refs.link.getDOMNode().click();
            }
        }
    },

    br: function() {
        return React.DOM.br(null );
    },

    render: function() {
        var data = this.props.data;
        var mappings = data.mappings;

        var self = this;
        var contents = _.map(data.contents, function(elem) {
            if (typeof elem === "string") {
                return intercalate(elem.split("\n"), self.br);
            }

            switch (elem.name) {
                case "LINK":
                    return self.createSceneLink(elem, mappings);
                case "CHAP":
                    return self.createChapterLink(elem, mappings);
                case "IMG":
                    return self.createImage(elem, mappings);
                case "INPUT":
                    return self.createInput(elem, mappings);
                case "VAR":
                    return (
                        React.DOM.b( {className:"game-var"},

                                self.props.bindings.get(elem.text) ||
                                self.props.defaultBindings[elem.text]

                        )
                );
            }

        });

        var style = toDisplayStyle(this.props.visible);
        var subscene = this.getSubscene();
        return (
            React.DOM.div( {style:style},
                React.DOM.h3( {className:"scene-title"}, data.title,
                    React.DOM.a( {href:"#"+data.label, name:data.label},  " # " )
                ),
                React.DOM.p(null, contents),
                subscene
            )
        );
    }
});

function toDisplayStyle(visible) {
    return {
        display: visible ? "inherit" : "none",
    }
}

function scrollViewTo(container, node, step) {
    var d = node.offsetTop - container.scrollTop;
    step = step || d;
    if (d != 0) { // normalize
        d = Math.abs(d)/d;
    }

    var x = 20, lastOffset;
    var timerId = setInterval(function() {
        container.scrollTop += d*(step - container.offsetTop);
        if (lastOffset == container.scrollTop ||
            Math.abs(container.scrollTop - node.offsetTop) < x)
            clearInterval(timerId);
        lastOffset = container.scrollTop;
    }, 10);
}


text:
package com.owolp.debug;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;

import java.util.EventListener;

public class MainActivity extends AppCompatActivity implements EventListener{

    EditText mEdiText;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // проверява въвеждането на даден текст
        mEdiText.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                // тук може да става филтриране на input
            }

            @Override
            public void afterTextChanged(Editable s) {

            }
        });
    }
}


text:
<readable><title>462198798_89e2df0358</title><content>
A big , black dog is walking along the water 's edge .
A black dog and its reflection are seen near a pond ringed by dry foliage .
A black dog is walking beside water in the woods .
A black dog walks along a marsh 's edge .
A dog is walking near a body of water .
</content></readable>


text:
package com.xinxin.wotplus.util.mapper;

import android.text.TextUtils;

import com.google.gson.Gson;
import com.xinxin.wotplus.model.XvmTankTopSingleVO;
import com.xinxin.wotplus.model.XvmTankTopVO;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import okhttp3.ResponseBody;
import rx.functions.Func1;

/**
 * Created by xinxin on 2016/6/21.
 * 坦克榜单数据转换为相应实体类
 */
public class XvmTankTopToVoMapper implements Func1<ResponseBody,List<XvmTankTopVO>> {

    private static XvmTankTopToVoMapper INSTANCE = new XvmTankTopToVoMapper();

    public XvmTankTopToVoMapper() {
    }

    public static XvmTankTopToVoMapper getInstance() {
        return INSTANCE;
    }

    @Override
    public List<XvmTankTopVO> call(ResponseBody responseBody) {
        List<XvmTankTopVO> topList = new ArrayList<>();

        if (responseBody != null) {
            try {
                String tankTopSourse = responseBody.string();

                String subSourse = tankTopSourse.substring(1, tankTopSourse.length() - 1);

                if (!TextUtils.isEmpty(subSourse)) {
                    String x = "\\},";
                    String[] tankTopArray = subSourse.split(x);

                    // 组装tanktop列表
                    for (int i = 0; i < tankTopArray.length; i++) {

                        Gson gson = new Gson();
                        XvmTankTopVO xvmTankTopVO = new XvmTankTopVO();
                        XvmTankTopSingleVO top = new XvmTankTopSingleVO();

                        // 最后一个的末尾不用补"}"需特殊处理
                        if (i == tankTopArray.length - 1) {
                            String tankTopStr = tankTopArray[i];
                            String tankId = tankTopStr.trim().substring(1, tankTopStr.lastIndexOf("{") - 2);
                            String tankTopInfoStr = tankTopStr.substring(tankTopStr.lastIndexOf("{")).trim();

                            top = gson.fromJson(tankTopInfoStr, XvmTankTopSingleVO.class);

                            xvmTankTopVO.setTankid(Integer.parseInt(tankId));
                            xvmTankTopVO.setSingleVO(top);
                            topList.add(xvmTankTopVO);

                        } else {
                            String tankDictStr = tankTopArray[i] + "}";

                            String tankId = tankDictStr.trim().substring(1, tankDictStr.lastIndexOf("{") - 2);
                            String tankInfoStr = tankDictStr.substring(tankDictStr.lastIndexOf("{")).trim();

                            top = gson.fromJson(tankInfoStr, XvmTankTopSingleVO.class);
                            xvmTankTopVO.setTankid(Integer.parseInt(tankId));
                            xvmTankTopVO.setSingleVO(top);
                            topList.add(xvmTankTopVO);
                        }

                    }

                    // 列表排序
                    // 需要tank.js,在XvmTankTopSortMapper中完成

                }

            } catch (IOException e) {
                e.printStackTrace();
            }

        }

        return topList;
    }
}


text:
package org.apache.camel.test.infra.xmpp.services;

import org.apache.camel.test.infra.xmpp.common.XmppProperties;

public class XmppRemoteService implements XmppService {

    @Override
    public void registerProperties() {
        // NO-OP
    }

    @Override
    public void initialize() {
        registerProperties();
    }

    @Override
    public void shutdown() {
        // NO-OP
    }

    @Override
    public String getUrl() {
        return System.getProperty(XmppProperties.XMPP_URL);
    }

    @Override
    public String host() {
        return System.getProperty(XmppProperties.XMPP_HOST);
    }

    @Override
    public int port() {
        String port = System.getProperty(XmppProperties.XMPP_PORT);

        if (port == null) {
            return XmppProperties.PORT_DEFAULT;
        }

        return Integer.valueOf(port);
    }
}


text:
package checkers

import (
	"go/ast"
	"go/token"

	"github.com/go-lintpack/lintpack"
	"github.com/go-lintpack/lintpack/astwalk"
	"github.com/go-toolsmith/astequal"
	"github.com/go-toolsmith/typep"
)

func init() {
	var info lintpack.CheckerInfo
	info.Name = "nilValReturn"
	info.Tags = []string{"diagnostic", "experimental"}
	info.Summary = "Detects return statements those results evaluate to nil"
	info.Before = `
if err == nil {
	return err
}`
	info.After = `
// (A) - return nil explicitly
if err == nil {
	return nil
}
// (B) - typo in "==", change to "!="
if err != nil {
	return err
}`

	collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker {
		return astwalk.WalkerForStmt(&nilValReturnChecker{ctx: ctx})
	})
}

type nilValReturnChecker struct {
	astwalk.WalkHandler
	ctx *lintpack.CheckerContext
}

func (c *nilValReturnChecker) VisitStmt(stmt ast.Stmt) {
	ifStmt, ok := stmt.(*ast.IfStmt)
	if !ok || len(ifStmt.Body.List) != 1 {
		return
	}
	ret, ok := ifStmt.Body.List[0].(*ast.ReturnStmt)
	if !ok || len(ret.Results) != 1 {
		return
	}
	expr, ok := ifStmt.Cond.(*ast.BinaryExpr)
	cond := ok &&
		expr.Op == token.EQL &&
		typep.SideEffectFree(c.ctx.TypesInfo, expr.X) &&
		qualifiedName(expr.Y) == "nil" &&
		astequal.Expr(expr.X, ret.Results[0])
	if cond {
		c.warn(ret, expr.X)
	}
}

func (c *nilValReturnChecker) warn(cause, val ast.Node) {
	c.ctx.Warn(cause, "returned expr is always nil; replace %s with nil", val)
}