text:
mbed SDK
========

[![Build Status](https://travis-ci.org/mbedmicro/mbed.png)](https://travis-ci.org/mbedmicro/mbed/builds)

The mbed Software Development Kit (SDK) is a C/C++ microcontroller software platform relied upon by tens of thousands of
developers to build projects fast.

The SDK is licensed under the permissive Apache 2.0 licence, so you can use it in both commercial and personal projects
with confidence.

The mbed SDK has been designed to provide enough hardware abstraction to be intuitive and concise, yet powerful enough
to build complex projects. It is built on the low-level ARM CMSIS APIs, allowing you to code down to the metal if needed.
In addition to RTOS, USB and Networking libraries, a cookbook of hundreds of reusable peripheral and module libraries
have been built on top of the SDK by the mbed Developer Community.

Documentation
-------------
* [Tools](http://developer.mbed.org/handbook/mbed-tools): how to setup and use the build system.
* [mbed library internals](http://developer.mbed.org/handbook/mbed-library-internals)
* [Adding a new target microcontroller](http://developer.mbed.org/handbook/mbed-SDK-porting)

Supported Microcontrollers and Boards
-------------------------------------
View all on the [mbed Platforms](https://developer.mbed.org/platforms/) page.

NXP:
* [mbed LPC1768](http://developer.mbed.org/platforms/mbed-LPC1768/) (Cortex-M3)
* [u-blox C027 LPC1768](http://developer.mbed.org/platforms/u-blox-C027/) (Cortex-M3)
* [mbed LPC11U24](http://developer.mbed.org/platforms/mbed-LPC11U24/) (Cortex-M0)
* [EA LPC11U35](http://developer.mbed.org/platforms/EA-LPC11U35/) (Cortex-M0)
* mbed LPC2368 (ARM7TDMI-S)
* LPC2460 (ARM7TDMI-S)
* LPC810 (Cortex-M0+)
* [LPC812](http://developer.mbed.org/platforms/NXP-LPC800-MAX/) (Cortex-M0+)
* [EA LPC4088](http://developer.mbed.org/platforms/EA-LPC4088/) (Cortex-M4F)
* [EA LPC4088 DM](http://developer.mbed.org/platforms/EA-LPC4088-Display-Module/) (Cortex-M4F)
* LPC4330 (Cortex-M4F + Cortex-M0)
* [LPC1347](http://developer.mbed.org/platforms/DipCortex-M3/) (Cortex-M3)
* [LPC1114](http://developer.mbed.org/platforms/LPC1114FN28/) (Cortex-M0)
* LPC11C24 (Cortex-M0)
* [LPC1549](https://developer.mbed.org/platforms/LPCXpresso1549/) (Cortex-M3)
* [LPC800-MAX](https://developer.mbed.org/platforms/NXP-LPC800-MAX/) (Cortex-M0+)
* [DipCortex-M0](https://developer.mbed.org/platforms/DipCortex-M0/) (Cortex-M0)
* [DipCortex-M3](https://developer.mbed.org/platforms/DipCortex-M3/) (Cortex-M3)
* [BlueBoard-LPC11U24](https://developer.mbed.org/platforms/BlueBoard-LPC11U24/) (Cortex-M0)
* LPCCAPPUCCINO (Cortex-M0)
* [Arch](https://developer.mbed.org/platforms/Seeeduino-Arch/) (Cortex-M0)
* [Arch GPRS](https://developer.mbed.org/platforms/Seeed-Arch-GPRS/) (Cortex-M0)
* [Arch Pro](https://developer.mbed.org/platforms/Seeeduino-Arch-Pro/) (Cortex-M3)

Freescale:
* [FRDM-KL05Z](https://developer.mbed.org/platforms/FRDM-KL05Z/) (Cortex-M0+)
* [FRDM-KL25Z](http://developer.mbed.org/platforms/KL25Z/) (Cortex-M0+)
* FRDM-KL43Z (Cortex-M0+)
* [FRDM-KL46Z](https://developer.mbed.org/platforms/FRDM-KL46Z/) (Cortex-M0+)
* [FRDM-K20D50M](https://developer.mbed.org/platforms/FRDM-K20D50M/) (Cortex-M4)
* [FRDM-K22F](https://developer.mbed.org/platforms/FRDM-K22F/) (Cortex-M4F)
* [FRDM-K64F](https://developer.mbed.org/platforms/FRDM-K64F/) (Cortex-M4F)

STMicroelectronics:
* [Nucleo-F030R8](https://developer.mbed.org/platforms/ST-Nucleo-F030R8/) (Cortex-M0)
* [Nucleo-F072RB](https://developer.mbed.org/platforms/ST-Nucleo-F072RB/) (Cortex-M0)
* [Nucleo-L053R8](https://developer.mbed.org/platforms/ST-Nucleo-L053R8/) (Cortex-M0+)
* [Nucleo-F103RB](https://developer.mbed.org/platforms/ST-Nucleo-F103RB/) (Cortex-M3)
* [Nucleo-L152RE](https://developer.mbed.org/platforms/ST-Nucleo-L152RE/) (Cortex-M3)
* [Nucleo-F302R8](https://developer.mbed.org/platforms/ST-Nucleo-F302R8/) (Cortex-M4F)
* [Nucleo-F334R8](https://developer.mbed.org/platforms/ST-Nucleo-F334R8/) (Cortex-M4F)
* [Nucleo-F401RE](https://developer.mbed.org/platforms/ST-Nucleo-F401RE/) (Cortex-M4F)
* [Nucleo-F411RE](https://developer.mbed.org/platforms/ST-Nucleo-F411RE/) (Cortex-M4F)
* [Nucleo-L476RG](https://developer.mbed.org/platforms/ST-Nucleo-L476RG/) (Cortex-M4F)
* STM32F4XX (Cortex-M4F)
* STM32F3XX (Cortex-M4F)
* STM32F0-Discovery (Cortex-M0)
* STM32VL-Discovery (Cortex-M3)
* STM32F3-Discovery (Cortex-M4F)
* STM32F4-Discovery (Cortex-M4F)
* STM32F429-Discovery (Cortex-M4F)
* STM32L0-Discovery (Cortex-M0+)
* [STM32L4-Discovery](https://developer.mbed.org/platforms/ST-Discovery-L476VG/) (Cortex-M4F)
* [Arch Max](https://developer.mbed.org/platforms/Seeed-Arch-Max/) (Cortex-M4F)

Nordic:
* [nRF51822-mKIT](https://developer.mbed.org/platforms/Nordic-nRF51822/) (Cortex-M0)
* [Arch BLE](https://developer.mbed.org/platforms/Seeed-Arch-BLE/) (Cortex-M0)

Renesas:
* [RZ-A1H](http://developer.mbed.org/platforms/Renesas-GR-PEACH/) (Cortex-A9)

Silicon Labs:
* [EFM32 Zero Gecko] (https://developer.mbed.org/platforms/EFM32-Zero-Gecko/) (Cortex-M0+)
* [EFM32 Happy Gecko] (https://developer.mbed.org/platforms/EFM32-Happy-Gecko/) (Cortex-M0+)
* [EFM32 Leopard Gecko] (https://developer.mbed.org/platforms/EFM32-Leopard-Gecko/) (Cortex-M3)
* [EFM32 Giant Gecko] (https://developer.mbed.org/platforms/EFM32-Giant-Gecko/) (Cortex-M3)
* [EFM32 Wonder Gecko] (https://developer.mbed.org/platforms/EFM32-Wonder-Gecko/) (Cortex-M4)

Supported Toolchains and IDEs
-----------------------------
* GCC ARM: [GNU Tools for ARM Embedded Processors](https://launchpad.net/gcc-arm-embedded/4.7/4.7-2012-q4-major)
* ARMCC (standard library and MicroLib): [uVision](http://www.keil.com/uvision/)
* IAR: [IAR Embedded Workbench](http://www.iar.com/en/Products/IAR-Embedded-Workbench/ARM/)
* GCC code_red: [Red Suite](http://www.code-red-tech.com/)
* GCC CodeSourcery: [Sourcery CodeBench](http://www.mentor.com/embedded-software/codesourcery)
* GCC ARM: [Em::Blocks](http://www.emblocks.org/web/)
* GCC ARM: [CooCox CoIDE](http://www.coocox.org/)

API Documentation
-----------------
* [RTOS API](http://developer.mbed.org/handbook/RTOS)
* [TCP/IP Socket API](http://developer.mbed.org/handbook/Socket) (Transports: Ethernet, WiFi, 3G)
* [USB Device API](http://developer.mbed.org/handbook/USBDevice)
* [USB Host API](http://developer.mbed.org/handbook/USBHost)
* [DSP API](http://developer.mbed.org/users/mbed_official/code/mbed-dsp/docs/tip/)
* Flash File Systems: [SD](http://developer.mbed.org/handbook/SDFileSystem), [USB MSD](http://developer.mbed.org/handbook/USBHostMSD), [semihosted](http://developer.mbed.org/handbook/LocalFileSystem)
* [Peripheral Drivers API](http://developer.mbed.org/handbook/Homepage)

Community
---------
For discussing the development of the mbed SDK itself (Addition/support of microcontrollers/toolchains, build and test system, Hardware Abstraction Layer API, etc) please join our [mbed-devel mailing list](https://groups.google.com/forum/?fromgroups#!forum/mbed-devel).

For every topic regarding the use of the mbed SDK, rather than its development, please post on the [mbed.org forum](http://mbed.org/forum/), or the [mbed.org Q&A](http://mbed.org/questions/).

For reporting issues in the mbed libraries please open a ticket on the issue tracker of the relevant [mbed official library](http://mbed.org/users/mbed_official/code/).


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="http://download-codeplex.sec.s-msft.com/css/v21050/i2036743/StyleSheet.ashx" id="MasterCss" rel="stylesheet" type="text/css" />
<title>Database Task Parallel Foundation - dbParallel for Oracle & SQL Server</title>

DataBooster - Extension to ADO.NET Data Provider

Project Description

Less Code, Less Configuration, Less Time.

The DataBooster library is a high-performance extension to ADO.NET Data Provider, includes two aspects:

A slimmed down API encapsulation which simplified the most common data access operations (DbConnection -> DbCommand -> DbParameter -> DbDataReader) into a single class
DbAccess, to help application with a clean DAL, avoid over-packing and redundant-copy of data transfer. DbAccess also provides an object-relational mapping (OR/M) one-way implementation
(from database to .NET Framework classes) that maximizes the use of inference approach rather than lots of configurations or mechanical designs for redundant metadata. The whole class library comes as a very lightweight NuGet package. Using the library
 is seamless with your existing database developments, please consider using this for your application development if Entity Framework can not meet your performance requirement or Stored-Procedure-Based development is adopted as part of the back-end development
 if your architecture recognizes that "it is far more efficient to process data as close to where the data physically resides as possible".

A booster for writing tremendous amount of data into database. Base on a rational utilization of database concurrency and a effective utilization of network bandwidth, the booster implements a transmitting pipeline of dataflow like a Multiple Launch Rocket
 System, The speed of writing data into database can be improved about 5 times faster than an ordinary bulk insert/copy, or up to 700+ times faster than a row-by-row insert.

The detail implement closely depends on the specific database. For the moment, the class
OracleLauncher and SqlLauncher are ready for Oracle and SQL Server. They handle the throughput control and other low-level synchronization details. They
 are thread-safe which avoid locks. By using the Launcher, you can maximize the performance of your code while filling data row-by-row simply.

Table of Contents

Project Description

Quick Starts

DbAccess

Simple Parameters

Table-Valued Parameters & PL/SQL Associative Array Parameters

Table-Valued Parameters (SQL Server 2008+)

PL/SQL Associative Array Parameters (Oracle)

ExecuteMultiReader

Column-->Property Mapping

Manual Mapping

Automatic Mapping

Data Type Mapping

ExecuteStoredProcedure

OracleLauncher

API Reference

DbAccess

Constructors

Static Global

Methods

ExecuteReader

ExecuteMultiReader

ExecuteNonQuery

DbParameterBuilder

DbFieldMap

DbMultiResultSet

OracleLauncher

Constructors

Methods

Post

SqlLauncher

Constructors

Methods

Post

NuGet Packages

Debugging Symbols/Sources

Requirements

Contributions

Support

Quick Starts

DbAccess:

The following examples code shows its 4 different fine-grained user control of usages.

using System;
using System.Collections.Generic;
using DbParallel.DataAccess;

namespace DbAccessExamples
{
    class Program
    {
        static void Main(string[] args)
        {
            decimal sumAmount = 0m;
            long sumHoldings = 0;

            // Example of constructor overload1
            using (DbAccess db = new DbAccess(MyConfigMgr.DbProviderFactory,
                MyConfigMgr.ConnectionString))
            {
                //=======================================================================
                // Example1: single result set
                db.ExecuteReader(GetProcedure("READ_TEST_DATA1"),
                    parameters =>
                    {
                        parameters.Add("inDate", DateTime.Today);
                        parameters.Add("inCount", 300000);
                    },
                    row =>
                    {
                        sumAmount += row.Field<decimal>("TEST_AMOUNT");
                    });

                sumAmount = 0m;

                //=======================================================================
                // Example2: multiple result sets
                db.ExecuteReader(GetProcedure("READ_TEST_DATA2"),
                    parameters =>
                    {
                        parameters.Add("inMarket", "NYSE");
                        parameters.Add("inDate", DateTime.Today);
                    },
                    (row, resultSet) =>
                    {
                        switch (resultSet)
                        {
                            case 0:     // First result set
                                sumAmount += row.Field<decimal>("MARKET_VALUE");
                                break;
                            case 1:     // Second result set
                                sumHoldings += row.Field<long>("HOLDINGS");
                                break;
                        }
                    });
            }

            // Example of constructor overload4
            using (DbAccess db = new DbAccess("MyDbConnKey"))
            {
                List<MyBusiness1> myBusiness1List = new List<MyBusiness1>();
                List<MyBusiness2> myBusiness2List = new List<MyBusiness2>();

                //=======================================================================
                // Example3: map every result row to a business class by specified column-property mappings
                db.ExecuteReader<MyBusiness1>(GetProcedure("READ_TEST_DATA3"),
                    parameters =>
                    {
                        parameters.Add("inAs_Of_Date", DateTime.Today);
                    },
                    map =>
                    {
                        map.Add("SEC_ID", t => t.Id);
                        map.Add("MARKET_VALUE", t => t.MarketValue);
                        map.Add("CLOSE_DATE", t => t.CloseDate);
                    },
                    myBusiness1 =>
                    {
                        myBusiness1List.Add(myBusiness1);
                    });

                //=======================================================================
                // Example4: auto map every result row to a business class by matching database column names with the same name of class properties, ignore mismatched columns.
                db.ExecuteReader<MyBusiness2>(GetProcedure("READ_TEST_DATA4"),
                    parameters =>
                    {
                        parameters.Add("inAs_Of_Date", DateTime.Today);
                        parameters.Add("inDept_Code", "LOCAL_SALES");
                    },
                    myBusiness2 =>
                    {
                        myBusiness2List.Add(myBusiness2);
                    });
            }
        }

        // Get stored procedure full name [schema.package.sp]
        static string GetProcedure(string sp)
        {
            return MyConfigMgr.DatabasePackage + sp;
        }
    }

    public class MyBusiness1
    {
        public int Id { get; set; }
        public decimal MarketValue { get; set; }
        public DateTime? CloseDate { get; set; }
    }

    public class MyBusiness2
    {
        public string Prod_Code { get; set; }
        public int Stock { get; set; }
        public float? Discount_Rate { get; set; }
    }
}

Table-Valued Parameters &

PL/SQL Associative Array Parameters

Table-Valued Parameters (SQL Server 2008+):

The following example demonstrates how to pass table-valued parameter data to a stored procedure, the tvpValue can be a DataTable, a DbDataReader or a IEnumerable<SqlDataRecord>. In addition, the ToDataTable extension method can convert an IEnumerable<IDictionary<string,
 object>> or a IEnumerable<object> (anonymous type instances or named type instances) into a DataTable.

....
dbAccess.Execute....(GetProcedure(sp), parameters =>
    {
        parameters.Add("inDate", date);              // Simple Parameter
        parameters.AddTableValue("inTvp", tvpValue); // Table-Valued Parameter
    },
    ....
);
....

PL/SQL Associative Array Parameters (Oracle):

The following example demonstrates how to pass PL/SQL Associative Array to a stored procedure, the assocArrayValue must be an array simple data (e.g. int[], decimal[], string[], etc) or an IEnumerable<IConvertible>.

....
dbAccess.Execute....(GetProcedure(sp), parameters =>
    {
        parameters.Add("inDate", date); // Simple Parameter
        parameters.AddAssociativeArray("inAssocArray", OracleDbType.Decimal,
                      assocArrayValue); // Associative Array Parameter
    },
    ....
);
....

ExecuteMultiReader:

Multi-ResultSet is a common scenario in package based (Oracle) or stored procedure based (SQL Server) database development, using the ExecuteMultiReader Method can minimize your DAL code to process multiple results.

internal static Tuple<List<MyBusiness1>, List<MyBusiness2>, List<MyBusiness3>> ViewReport(this DbAccess dbAccess, DateTime date, int sessionId)
{
    const string sp = "VIEW_REPORT";

    var resultTuple = Tuple.Create(new List<MyBusiness1>(), new List<MyBusiness2>(), new List<MyBusiness3>());

    dbAccess.ExecuteMultiReader(GetProcedure(sp), parameters =>
        {
            parameters.Add("inDate",    date);
            parameters.Add("inSession", sessionId);
        }, resultSets =>
            {
                // Specified fields mapping example
                resultSets.Add(resultTuple.Item1, colMap =>  // 1st ResultSet
                    {
                        colMap.Add("SEC_ID",        t => t.Id);
                        colMap.Add("MARKET_VALUE",  t => t.MarketValue);
                        colMap.Add("CLOSE_DATE",    t => t.CloseDate);
                    });

                // Full-automatic (case-insensitive) fields mapping examples
                resultSets.Add(resultTuple.Item2);   // 2nd ResultSet
                resultSets.Add(resultTuple.Item3);   // 3rd ResultSet
            }
    );

    return resultTuple;
}

Normally, all these method calls and their parameters should be wrapped in your DAL.

Further, the user class (e.g. above MyBusiness2 class) can be auto generated by the utility under UtilityScripts folder.

Column-->Property Mapping

You can explicitly specify which database column map to which property or field of your strongly typed class. E.g.

....
colMap.Add("BUY_AMOUNT",  t => t.Cost);
colMap.Add("ISSUER_REGION",  t =>
           t.NestedProperty.DeeperField.Issuer.Region.IsoCode);
....

To allow map a database column to a deep Properties or Fields in .Net, please make sure that,

All nested properties or fields (above e.g. NestedProperty, DeeperField, Issuer and Region) run through in middle levels must be:

Class only. Struct is not supported;

The class has public parameterless constructor (or by default);

The nested propertie/field has both read and write accessibility.

The end property or field (above e.g. Cost and IsoCode) must be:

A value type or string type; (Implement IConvertible interface)

With both read and write accessibility.

There is no limit to the number of how many levels through the path from the root class object to the end property or field.

If you don't explicitly specify mapping (omit the whole parameter at all), the full-auto-mapping mechanism will be activated to match database columns with .Net one level properties/fields as more as possible. Following
 is the matching precedence:

Match the names of database columns with the names of .Net properties/fields in a case-sensitive manner;

Match the rest in a case-insensitive manner;

De-underscore(compact) the rest of database column names (as we know, most Oracle users adopt underscores naming convention), then match the rest names with rest .Net properties/fields in a case-insensitive manner. - v1.7.6.2+

E.g. A database column named "USER_FIRST_NAME" will auto-map to a .Net property named UserFirstName (or userFirstName).

Data Type Mapping

Supported mapping of Database Engine Data Types to .NET Common Language Runtime Types relies on two levels conversion:

ADO.NET Provider converts database data type into inferred .NET Framework data type;

If level 1 conversion has not yet reached business target type, an appropriate

IConvertible method of the inferred .NET Framework type will be called automatically to convert further into the target type.

ExecuteStoredProcedure:

In data-driven application developments, there are also a large number of scenarios without substantial logic in data access web services, however they wasted a lot of our efforts on very boring data moving coding or configuration. The
ExecuteStoredProcedure provides you an accessibility to implement an entirely generic ASP.NET Web API (RESTful). Please refer to the following example:

public class DbWebApiController : ApiController
{
    [DbWebApiAuthorize]
    [AcceptVerbs("GET", "POST", "PUT", "DELETE")]
    public StoredProcedureResponse Execute(string sp,
                                           IDictionary<string, object> parameters)
    {
        StoredProcedureRequest spRequest = new StoredProcedureRequest(sp,parameters);

        using (DbAccess dbAccess = DbPackage.CreateConnection())
        {
            return dbAccess.ExecuteStoredProcedure(spRequest);
        }
    }
}

Http clients can use Stored Procedure Name or Database Function Name as endpoint (e.g. http://BaseURL/YourStoredProcedureName) without programming effort, no special configuration is required to expose a stored procedure or function. Just put required parameters
 in JSON format request body (Content-Type: "application/json"). The response JSON (Accept: application/json) or XML (Accept: application/xml) will have all Result Sets, Output Parameters and Return Value.

Please visit
https://github.com/DataBooster/DbWebApi/wiki for more information about
DbWebApi.

If you are building an entirely generic ASP.NET SignalR application, this ExecuteStoredProcedure method can also be used directly.

StoredProcedureResponse ExecuteStoredProcedure(StoredProcedureRequest request);

OracleLauncher:

A quick example:

using System;
using System.Threading.Tasks;
using DbParallel.DataAccess.Booster.Oracle;
using DDTek.Oracle;

namespace OracleLauncherExamples
{
    class Program
    {
        static void Main(string[] args)
        {
            using (OracleLauncher launcher = new OracleLauncher(ConfigurationManager.ConnectionStrings["MyDbConnKey"].ConnectionString,
                "SCHEMA.PACKAGE.WRITE_BULK_DATA"/* stored procedure */,
                parameters =>
                {
                    parameters.Add("inGroup_ID", 1001);     // Ordinary parameter
                    parameters.AddAssociativeArray("inItem_IDs",
                        OracleDbType.Int32);
                    parameters.AddAssociativeArray("inItem_Values",
                        OracleDbType.Double);
                }))
            {
                Parallel.For(0, 100, i =>   // Just simulating multiple(100) producers
                {
                    for (int j = 0; j < 200000; j++)
                    {
                        AddRow(launcher, i * 200000 + j, (double)j * 0.618);
                    }
                });

                // launcher.Complete(); // This is not necessary because here creates the instance with a using statement, the Complete method will be called by Dispose method automatically.
            }
        }

        static void AddRow(OracleLauncher launcher, int itemId, double itemValue)
        {
            launcher.Post(itemId, itemValue);
        }
    }
}

The database side stored procedure is like following:

TYPE NUMBER_ARRAY IS TABLE OF NUMBER INDEX BY PLS_INTEGER;
TYPE DOUBLE_ARRAY IS TABLE OF BINARY_DOUBLE INDEX BY PLS_INTEGER;

PROCEDURE WRITE_BULK_DATA
(
    inGroup_ID      NUMBER,
    inItem_IDs      NUMBER_ARRAY,
    inItem_Values   DOUBLE_ARRAY
)   AS
BEGIN
    FORALL i IN inItem_IDs.FIRST .. inItem_IDs.LAST
    INSERT /*+ APPEND_VALUES */ INTO XYZ.TEST_WRITE_DATA
    (
        GROUP_ID,
        ITEM_ID,
        ITEM_VALUE
    )
    VALUES
    (
        inGroup_ID,
        inItem_IDs(i),
        inItem_Values(i)
    );
    COMMIT;
END WRITE_BULK_DATA;

API Reference

DbAccess

(Namespace: DbParallel.DataAccess)

Constructors
(4 overloads):

public DbAccess(DbProviderFactory dbProviderFactory, string connectionString);
public DbAccess(string providerName, string connectionString);
public DbAccess(ConnectionStringSettings connSetting);
public DbAccess(string connectionStringKey);

Static Global

public static CommandType DefaultCommandType {
get; set; }

    The default is StoredProcedure.

Methods

- ExecuteReader
(9 overloads):

void ExecuteReader(string commandText, Action<DbParameterBuilder> parametersBuilder, Action<DbDataReader> dataReader);

void ExecuteReader(string commandText, int commandTimeout, CommandType commandType, Action<DbParameterBuilder> parametersBuilder, Action<DbDataReader> dataReader);

IEnumerable<T> ExecuteReader<T>(string commandText, Action<DbParameterBuilder> parametersBuilder, Action<DbFieldMap<T>> resultMap = null) where T : new();

IEnumerable<T> ExecuteReader<T>(string commandText, int commandTimeout, CommandType commandType, Action<DbParameterBuilder> parametersBuilder, Action<DbFieldMap<T>> resultMap = null) where T : new();

void ExecuteReader<T>(string commandText, Action<DbParameterBuilder> parametersBuilder, Action<DbFieldMap<T>> resultMap, Action<T> readEntity) where T : new();

void ExecuteReader<T>(string commandText, Action<DbParameterBuilder> parametersBuilder, Action<T> readEntity) where T : new();

void ExecuteReader<T>(string commandText, int commandTimeout, CommandType commandType, Action<DbParameterBuilder> parametersBuilder, Action<DbFieldMap<T>> resultMap, Action<T> readEntity) where T : new();

void ExecuteReader(string commandText, Action<DbParameterBuilder> parametersBuilder, Action<DbDataReader, int/*resultSet*/> dataReaders); // For multiple result set

void ExecuteReader(string commandText, int commandTimeout, CommandType commandType, Action<DbParameterBuilder> parametersBuilder, Action<DbDataReader, int/*resultSet*/> dataReaders); // For multiple result set

- DbParameterBuilder

public DbParameter DbParameterBuilder.Add(string parameterName, object oValue, int nSize = 0); // Direction defaults to ParameterDirection.Input

public DbParameter DbParameterBuilder.AddReturn(string parameterName = "RETURN_VALUE", DbType dbType = DbType.Int32, int nSize = 0);

public DbParameter DbParameterBuilder.AddOutput(string parameterName, DbType dbType, int nSize = 0);

- DbFieldMap

public DbFieldMap<T> DbFieldMap<T>.Add(string columnName, Expression<Func<T, object>> fieldExpr);

- ExecuteMultiReader
(2 overloads):

public void ExecuteMultiReader(string commandText, Action<DbParameterBuilder> parametersBuilder, Action<DbMultiResultSet> multiResultSetMap);

public void ExecuteMultiReader(string commandText, int commandTimeout, CommandType commandType, Action<DbParameterBuilder> parametersBuilder, Action<DbMultiResultSet> multiResultSetMap);

- DbMultiResultSet

public void DbMultiResultSet.Add<T>(ICollection<T> resultSet, Action<DbFieldMap<T>> resultMap = null) where T : new();

- ExecuteNonQuery
(2 overloads):

int ExecuteNonQuery(string commandText, Action<DbParameterBuilder> parametersBuilder = null);

int ExecuteNonQuery(string commandText, int commandTimeout, CommandType commandType, Action<DbParameterBuilder> parametersBuilder);

OracleLauncher

(Namespace: DbParallel.DataAccess.Booster.Oracle)

Constructors:

OracleLauncher(string connectionString, string storedProcedure, Action<DbParameterBuilder> parametersBuilder, int multipleRockets = _DefaultMultipleRockets, int bulkSize = _DefaultBulkSize, int commandTimeout = _CommandTimeout);

The _DefaultMultipleRockets is 6:

Methods

- Post:

void Post(params object[] values);

Your application DAL should wrap this method as strong type parameters, like following example:

public void AddQuote(int id, DateTime time, int level, decimal price)
{
    _launcher.Post(id, time, level, price);
}

SqlLauncher

(Namespace: DbParallel.DataAccess.Booster.SqlServer)

Constructors:

SqlLauncher(string connectionString, string destinationTableName, Action<SqlBulkCopyColumnMappingCollection> columnMappings = null, int multipleRockets = _DefaultMultipleRockets, int bulkSize = _DefaultBulkSize, int commandTimeout = _CommandTimeout);

Detail for destinationTableName and SqlBulkCopyColumnMappingCollection, please refer to

SqlBulkCopy.DestinationTableName,
SqlBulkCopy.ColumnMappings and
SqlBulkCopyColumnMappingCollection on MSDN.

Methods

- Post: The same as
OracleLauncher

NuGet Packages

It is strongly recommended to use this library through NuGet Library Package Manager right in Visual Studio. NuGet Packages can also generate some scaffolding, sample code and configuration into your project for a very quick start
 from the ground.

Package
Package ID

DataBooster for SQL Server
DataBooster.SqlServer

DataBooster for SQL Server + Oracle (use ODP.NET Provider)
DataBooster.Oracle.ODP

DataBooster for SQL Server + Oracle (use ODP.NET Managed Driver)
DataBooster.Oracle.Managed

DataBooster for SQL Server + Oracle (use DataDirect Provider)
DataBooster.Oracle.DataDirect

All sample code is only available in DEBUG mode, you can even turn off sample code in DEBUG mode easily, just add NO_SAMPLE into your project Conditional Compilation Symbols (Visual Studio Project Properties Dialog -> Build -> General -> Conditional
 Compilation Symbols).

Debugging Symbols/Sources

Associated Symbol Packages with above NuGet Packages are also available in http://srv.symbolsource.org/pdb/Public.

To source step during debugging into the code of DataBooster library, please see
SymbolSource.org for detailed instructions.

Requirements

.NET Framework 4.0 or later.

Oracle ADO.NET Provider (Optional):

- ODP.NET 4 (Reference: Oracle.DataAccess.dll; Conditional Compilation Symbols: "ORACLE;ODP_NET")

or

- ODP.NET Managed Driver (Reference: Oracle.ManagedDataAccess.dll; Conditional Compilation Symbols: "ORACLE;ODP_NET_MANAGED")

or

- DataDirect Connect for ADO.NET (Reference: DDTek.Oracle.dll; Conditional Compilation Symbols: "ORACLE;DATADIRECT")

or

(the provider can be easily replaced by other provider for Oracle)

Contributions

Welcome all feedback through the CodePlex project (through comments, patches, or items in the Issue Tracker);

Needs to add support for other databases;

Looking for Clean-Style Developers, Testers and Editors.

Support

Feel free to use the source or binaries in your apps, and products.

This project is developed in personal time, the source code support can be available only at night -

Easten Time.

redpajama_set_name: RedPajamaGithub


text:
layout:     post
title:      This is what my dad wrote in the envelope of the Mother's Day card for my mom. He's never been good at spelling...
date:       2014-06-11 15:31:19
summary:
categories: jekyll pixyll
---

Tweet


text:
from test_batoto import *
from test_cli import *
from test_dynastyscans import *
from test_madokami import *
import sys
import unittest
import warnings

if __name__ == '__main__':
    sys.stdout = open(os.devnull, 'w')
    with warnings.catch_warnings():
        warnings.simplefilter('ignore')
        unittest.main(verbosity=2)
        sys.stdout.close()


text:
"""
Baxter RSDK Joint Position Example: file playback
"""
import argparse
import sys

import roslib
roslib.load_manifest('joint_position')
import rospy

import baxter_interface
import iodevices

def try_float(x):
    try:
        return float(x)
    except ValueError:
        return None

def clean_line(line, names):
    """ Cleans a single line of recorded joint positions
    @param line - the line described in a list to process
    @param names - joint name keys
    """
    #convert the line of strings to a float or None
    line = [try_float(x) for x in line.rstrip().split(',')]
    #zip the values with the joint names
    combined = zip(names[1:], line[1:])
    #take out any tuples that have a none value
    cleaned = [x for x in combined if x[1] is not None]
    #convert it to a dictionary with only valid commands
    command = dict(cleaned)
    left_command = dict((key, command[key]) for key in command.keys() \
        if key[:-2] == 'left_')
    right_command = dict((key, command[key]) for key in command.keys() \
        if key[:-2] == 'right_')
    return (command, left_command, right_command, line)

def map_file(filename, loops=1):
    """ Loops through csv file
    Does not loop indefinitely, but only until the file is read
    and processed. Reads each line, split up in columns and
    formats each line into a controller command in the form of
    name/value pairs. Names come from the column headers
    first column is the time stamp
    @param filename - the file to play
    @param loops - number of times to loop
        values < 0 mean 'infinite'
    """
    left = baxter_interface.Limb('left')
    right = baxter_interface.Limb('right')
    grip_left = baxter_interface.Gripper('left')
    grip_right = baxter_interface.Gripper('right')
    rate = rospy.Rate(1000)
    start_time = rospy.get_time()
    print("Playing back: %s" % (filename,))
    with open(filename, 'r') as f:
        lines = f.readlines()
    keys = lines[0].rstrip().split(',')
    i = 0
    l = 0
    # If specified, repeat the file playback 'loops' number of times
    while loops < 1 or l < loops:
        l = l+1
        print("Moving to start position...")
        cmd_start, lcmd_start, rcmd_start, raw_start = clean_line(lines[1], keys)
        left.move_to_joint_positions(lcmd_start)
        right.move_to_joint_positions(rcmd_start)
        for values in lines[1:]:
            i = i +1
            loopstr = str(loops) if loops > 0 else "forever"
            sys.stdout.write("\r Record %d of %d, loop %d of %s" \
                % (i, len(lines)-1,l,loopstr))
            sys.stdout.flush()

            cmd, lcmd, rcmd, values = clean_line(values, keys)
            #command this set of commands until the next frame
            while (rospy.get_time() - start_time) < values[0]:
                if rospy.is_shutdown():
                    print("\n ROS shutdown")
                    return False
                if iodevices.getch():
                    print("\n stopped")
                    return False
                if len(lcmd):
                    left.set_joint_positions(lcmd)
                if len(rcmd):
                    right.set_joint_positions(rcmd)
                if 'left_gripper' in cmd:
                    grip_left.set_position(cmd['left_gripper'])
                if 'left_gripper' in cmd:
                    grip_right.set_position(cmd['right_gripper'])
                rate.sleep()
    print
    return True

if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument("file", help="input file")
    parser.add_argument("-l", "--loops", type=int, default=1, \
        help="number of times to loop the input file. 0=infinite.")
    args = parser.parse_args()

    print("Initializing node... ")
    rospy.init_node("rethink_rsdk_joint_position_file_playback")
    print("Getting robot state... ")
    rs = baxter_interface.RobotEnable()
    print("Enabling robot... ")
    rs.enable()

    map_file(args.file, args.loops)


text:
void type()
{
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<int>, int>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const int>, int>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<volatile int>, int>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const volatile int>, int>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<int &>, int>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const int &>, int>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<volatile int &>, int>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const volatile int &>, int>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<int &&>, int>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const int &&>, int>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<volatile int &&>, int>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const volatile int &&>, int>::value));

    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<int *>, int *>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const int *>, int *>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<volatile int *>, int *>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const volatile int *>, int *>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<int *&>, int *>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const int *&>, int *>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<volatile int *&>, int *>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const volatile int *&>, int *>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<int *&&>, int *>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const int *&&>, int *>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<volatile int *&&>, int *>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const volatile int *&&>, int *>::value));

    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<int **>, int **>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const int **>, int **>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<volatile int **>, int **>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const volatile int **>, int **>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<int **&>, int **>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const int **&>, int **>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<volatile int **&>, int **>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const volatile int **&>, int **>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<int **&&>, int **>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const int **&&>, int **>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<volatile int **&&>, int **>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const volatile int **&&>, int **>::value));

    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<int[1][2]>, int[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const int[1][2]>, int[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<volatile int[1][2]>, int[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const volatile int[1][2]>, int[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<int (&)[1][2]>, int[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const int (&)[1][2]>, int[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<volatile int (&)[1][2]>, int[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const volatile int (&)[1][2]>, int[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<int (&&)[1][2]>, int[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const int (&&)[1][2]>, int[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<volatile int (&&)[1][2]>, int[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const volatile int (&&)[1][2]>, int[1][2]>::value));

    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<int *[1][2]>, int *[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const int *[1][2]>, int *[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<volatile int *[1][2]>, int *[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const volatile int *[1][2]>, int *[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<int *(&)[1][2]>, int *[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const int *(&)[1][2]>, int *[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<volatile int *(&)[1][2]>, int *[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const volatile int *(&)[1][2]>, int *[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<int *(&&)[1][2]>, int *[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const int *(&&)[1][2]>, int *[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<volatile int *(&&)[1][2]>, int *[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const volatile int *(&&)[1][2]>, int *[1][2]>::value));

    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<int (*)[1][2]>, int (*)[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const int (*)[1][2]>, int (*)[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<volatile int (*)[1][2]>, int (*)[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const volatile int (*)[1][2]>, int (*)[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<int (*&)[1][2]>, int (*)[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const int (*&)[1][2]>, int (*)[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<volatile int (*&)[1][2]>, int (*)[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const volatile int (*&)[1][2]>, int (*)[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<int (*&&)[1][2]>, int (*)[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const int (*&&)[1][2]>, int (*)[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<volatile int (*&&)[1][2]>, int (*)[1][2]>::value));
    TEST_ASSERT((std::is_same<m3ta::RemoveQualifiersT<const volatile int (*&&)[1][2]>, int (*)[1][2]>::value));
}

//      Main procedure.
//
//   O-(''Q)
// -----------------------------------------------------------------------------

int main(int argc, char **argv)
{
    type();
    return 0;
}


text: select * from hbase.`non_existent_tbl`;


text:
define([
    "controller-basedir/reports/qe/ui/js/views/ControllerQEView"
], function(ControllerQEView) {
    var ControllerQEPageLoader = function() {
        this.load = function (paramObject) {
            var hashParams = paramObject.hashParams,
                renderFn = paramObject.function,
                loadingStartedDefObj = paramObject.loadingStartedDefObj;

            this.controllerQEView = new ControllerQEView();
            this.renderView(renderFn, hashParams);
            if(contrail.checkIfExist(loadingStartedDefObj)) {
                loadingStartedDefObj.resolve();
            }
        };

        this.renderView = function(renderFn, hashParams) {
            $(window.contentContainer).empty();
            switch (renderFn) {
                case "renderFlowSeries":
                    this.controllerQEView.renderFlowSeries({ hashParams: hashParams });
                    break;

                case "renderFlowRecord":
                    this.controllerQEView.renderFlowRecord({ hashParams: hashParams });
                    break;

                case "renderFlowQueue":
                    this.controllerQEView.renderFlowQueue({ hashParams: hashParams });
                    break;
            }
        };

        this.updateViewByHash = function(currPageQueryStr) {
            var renderFn;

            //TODO: The renderFunction should be passed from ContentHandler
            if (currPageQueryStr.type === "flow") {
                renderFn = "renderFlows";
            }

            this.load({ hashParams: currPageQueryStr, "function": renderFn });
        };

        this.destroy = function() {};
    };

    return ControllerQEPageLoader;
});


text:
package org.mockserver.collections.multimap.nottablematched;

import org.junit.Test;
import org.mockserver.collections.CaseInsensitiveRegexMultiMap;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
import static org.mockserver.collections.CaseInsensitiveRegexMultiMap.multiMap;
import static org.mockserver.model.NottableString.not;
import static org.mockserver.model.NottableString.string;

/**
 * @author jamesdbloom
 */
public class CaseInsensitiveRegexMultiMapTestNottableRemove {

    @Test
    public void shouldRemoveSingleValueEntry() {
        // given
        CaseInsensitiveRegexMultiMap multiMap = multiMap(
            true, new String[]{"keyOne", "keyOne_valueOne"},
                new String[]{"keyTwo", "keyTwo_valueOne", "keyTwo_valueTwo"},
                new String[]{"keyThree", "keyThree_valueOne", "keyThree_valueTwo", "keyThree_valueThree"}
        );

        // when
        multiMap.remove(not("keyT.*"));

        // then
        assertThat(multiMap.size(), is(2));
        assertThat(multiMap.getAll("keyOne"), empty());
        assertThat(multiMap.getAll("keyTwo"), containsInAnyOrder(string("keyTwo_valueOne"), string("keyTwo_valueTwo")));
        assertThat(multiMap.getAll("keyThree"), containsInAnyOrder(string("keyThree_valueOne"), string("keyThree_valueTwo"), string("keyThree_valueThree")));
    }

    @Test
    public void shouldRemoveMultiValueEntry() {
        // given
        CaseInsensitiveRegexMultiMap multiMap = multiMap(
            true, new String[]{"keyOne", "keyOne_valueOne"},
                new String[]{"keyTwo", "keyTwo_valueOne", "keyTwo_valueTwo"},
                new String[]{"keyThree", "keyThree_valueOne", "keyThree_valueTwo", "keyThree_valueThree"}
        );

        // when
        multiMap.remove(not("keyOne"));

        // then
        assertThat(multiMap.size(), is(3));
        assertThat(multiMap.getAll("keyOne"), containsInAnyOrder(string("keyOne_valueOne")));
        assertThat(multiMap.getAll("keyTwo"), containsInAnyOrder(string("keyTwo_valueTwo")));
        assertThat(multiMap.getAll("keyThree"), containsInAnyOrder(string("keyThree_valueOne"), string("keyThree_valueTwo"), string("keyThree_valueThree")));
    }

    @Test
    public void shouldRemoveNoMatchingEntry() {
        // given
        CaseInsensitiveRegexMultiMap multiMap = multiMap(
            true, new String[]{"keyOne", "keyOne_valueOne"},
                new String[]{"keyTwo", "keyTwo_valueOne", "keyTwo_valueTwo"},
                new String[]{"keyThree", "keyThree_valueOne", "keyThree_valueTwo", "keyThree_valueThree"}
        );

        // when
        multiMap.remove(not("key.*"));

        // then
        assertThat(multiMap.size(), is(3));
        assertThat(multiMap.getAll("keyOne"), containsInAnyOrder(string("keyOne_valueOne")));
        assertThat(multiMap.getAll("keyTwo"), containsInAnyOrder(string("keyTwo_valueOne"), string("keyTwo_valueTwo")));
        assertThat(multiMap.getAll("keyThree"), containsInAnyOrder(string("keyThree_valueOne"), string("keyThree_valueTwo"), string("keyThree_valueThree")));
    }

    @Test
    public void shouldRemoveAllSingleValueEntry() {
        // given
        CaseInsensitiveRegexMultiMap multiMap = multiMap(
            true, new String[]{"keyOne", "keyOne_valueOne"},
                new String[]{"keyTwo", "keyTwo_valueOne", "keyTwo_valueTwo"},
                new String[]{"keyThree", "keyThree_valueOne", "keyThree_valueTwo", "keyThree_valueThree"}
        );

        // when
        multiMap.removeAll(not("keyT.*"));

        // then
        assertThat(multiMap.size(), is(2));
        assertThat(multiMap.getAll("keyOne"), empty());
        assertThat(multiMap.getAll("keyTwo"), containsInAnyOrder(string("keyTwo_valueOne"), string("keyTwo_valueTwo")));
        assertThat(multiMap.getAll("keyThree"), containsInAnyOrder(string("keyThree_valueOne"), string("keyThree_valueTwo"), string("keyThree_valueThree")));
    }

    @Test
    public void shouldRemoveAllMultiValueEntry() {
        // given
        CaseInsensitiveRegexMultiMap multiMap = multiMap(
            true, new String[]{"keyOne", "keyOne_valueOne"},
                new String[]{"keyTwo", "keyTwo_valueOne", "keyTwo_valueTwo"},
                new String[]{"keyThree", "keyThree_valueOne", "keyThree_valueTwo", "keyThree_valueThree"}
        );

        // when
        multiMap.removeAll(not("keyOne"));

        // then
        assertThat(multiMap.size(), is(1));
        assertThat(multiMap.getAll("keyOne"), containsInAnyOrder(string("keyOne_valueOne")));
        assertThat(multiMap.getAll("keyTwo"), empty());
        assertThat(multiMap.getAll("keyThree"), empty());
    }

    @Test
    public void shouldRemoveAllNoMatchingEntry() {
        // given
        CaseInsensitiveRegexMultiMap multiMap = multiMap(
            true, new String[]{"keyOne", "keyOne_valueOne"},
                new String[]{"keyTwo", "keyTwo_valueOne", "keyTwo_valueTwo"},
                new String[]{"keyThree", "keyThree_valueOne", "keyThree_valueTwo", "keyThree_valueThree"}
        );

        // when
        multiMap.removeAll(not("key.*"));

        // then
        assertThat(multiMap.size(), is(3));
        assertThat(multiMap.getAll("keyOne"), containsInAnyOrder(string("keyOne_valueOne")));
        assertThat(multiMap.getAll("keyTwo"), containsInAnyOrder(string("keyTwo_valueOne"), string("keyTwo_valueTwo")));
        assertThat(multiMap.getAll("keyThree"), containsInAnyOrder(string("keyThree_valueOne"), string("keyThree_valueTwo"), string("keyThree_valueThree")));
    }
}


text:
set -eu

cd "$(dirname "$0")/.."

# build counterfeiter itself
counterfeiter='/tmp/counterfeiter_test'
# shellcheck disable=SC2064
# we want to use the current value
trap "rm $counterfeiter" EXIT
go build -o $counterfeiter

# counterfeit all the interfaces we can find
egrep --recursive --include '*.go' 'type [^ ]* interface {' . \
      --exclude 'fake_*.go' --exclude '*_test.go' \
  | sed 's#^./\(.*\)/[^/]*.go:type \([^ ]*\) interface {#\1 \2#' \
  | grep -v 'vendor/' \
  | while read -r PACKAGE INTERFACE; do $counterfeiter "$PACKAGE" "$INTERFACE"; done

# fix an import oddity in the UI fake
sed -i.bak '/"golang.org\/x\/crypto\/ssh\/terminal"/d' terminal/terminalfakes/fake_ui.go


text:
package org.apache.drill.exec.physical.impl.scan.v3.schema;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import org.apache.drill.test.BaseTest;
import org.apache.drill.categories.EvfTest;
import org.apache.drill.common.exceptions.CustomErrorContext;
import org.apache.drill.common.exceptions.EmptyErrorContext;
import org.apache.drill.common.expression.SchemaPath;
import org.apache.drill.common.types.TypeProtos.MinorType;
import org.apache.drill.exec.physical.impl.scan.v3.schema.ScanSchemaTracker.ProjectionType;
import org.apache.drill.exec.physical.resultSet.impl.ProjectionFilter;
import org.apache.drill.exec.physical.rowSet.RowSetTestUtils;
import org.apache.drill.exec.record.metadata.ColumnMetadata;
import org.apache.drill.exec.record.metadata.SchemaBuilder;
import org.apache.drill.exec.record.metadata.TupleMetadata;
import org.apache.drill.exec.record.metadata.TupleSchema;
import org.junit.Test;
import org.junit.experimental.categories.Category;

@Category(EvfTest.class)
public class TestSchemaTrackerDefined extends BaseTest{
  private static final CustomErrorContext ERROR_CONTEXT = EmptyErrorContext.INSTANCE;

  private boolean isProjected(ProjectionFilter filter, ColumnMetadata col) {
    return filter.projection(col).isProjected;
  }

  /**
   * If a schema is defined, then the planner has combined the projection
   * list with schema information to produce the final output schema
   * at plan time.
   */
  @Test
  public void testDefinedSchema() {

    // Simulate SELECT a, b, c ...
    // With a plan-provided defined schema
    final ScanSchemaConfigBuilder builder = new ScanSchemaConfigBuilder()
        .projection(RowSetTestUtils.projectList("a", "b", "c"));

    final TupleMetadata definedSchema = new SchemaBuilder()
        .add("a", MinorType.INT)
        .add("b", MinorType.BIGINT)
        .add("c", MinorType.VARCHAR)
       .buildSchema();
    builder.definedSchema(definedSchema);

    final ScanSchemaTracker schemaTracker = builder.build();
    assertTrue(schemaTracker instanceof SchemaBasedTracker);
    assertTrue(schemaTracker.isResolved());
    assertSame(ProjectionType.SOME, schemaTracker.projectionType());

    // Reader input schema is fully defined
    TupleMetadata readerInputSchema = schemaTracker.readerInputSchema();
    assertEquals(definedSchema, readerInputSchema);

    // Pretend the reader dutifully provided two of the columns
    TupleMetadata readerOutputSchema = new SchemaBuilder()
        .add("a", MinorType.INT)
        .add("b", MinorType.BIGINT)
        .buildSchema();

    // Projection filter is schema-based
    ProjectionFilter filter = schemaTracker.projectionFilter(ERROR_CONTEXT);
    assertTrue(filter instanceof DynamicSchemaFilter);
    assertTrue(isProjected(filter, readerOutputSchema.metadata("a")));
    assertTrue(isProjected(filter, readerOutputSchema.metadata("b")));
    assertTrue(filter.isProjected("c"));
    assertFalse(filter.isProjected("d"));

    schemaTracker.applyReaderSchema(readerOutputSchema, ERROR_CONTEXT);

    // Reader schema is still fully resolved
    assertTrue(schemaTracker.isResolved());
    assertEquals(definedSchema, readerInputSchema);

    // Pretend a class fills in the the missing columns
    TupleMetadata missingColSchema = new SchemaBuilder()
        .add("c", MinorType.VARCHAR)
        .buildSchema();
    schemaTracker.applyReaderSchema(missingColSchema, ERROR_CONTEXT);
    assertEquals(definedSchema, readerInputSchema);

    // Final schema sent downstream
    final TupleMetadata outputSchema = schemaTracker.outputSchema();
    assertEquals(definedSchema, outputSchema);
  }

  /**
   * If a schema is defined, then the planner has combined the projection
   * list with schema information to produce the final output schema
   * at plan time. The planner might leave some columns as dynamic type:
   * the schema (like projection) says which columns are wanted. But, like
   * a full dynamic schema, the types may not be known.
   */
  @Test
  public void testDynamicDefinedSchema() {

    // Simulate SELECT a, b, c ...
    // With a plan-provided defined schema
    final ScanSchemaConfigBuilder builder = new ScanSchemaConfigBuilder()
        .projection(RowSetTestUtils.projectList("a", "b", "c"));

    final TupleMetadata definedSchema = new SchemaBuilder()
        .addDynamic("a")
        .add("b", MinorType.BIGINT)
        .add("c", MinorType.VARCHAR)
       .buildSchema();
    builder.definedSchema(definedSchema);

    final ScanSchemaTracker schemaTracker = builder.build();
    assertTrue(schemaTracker instanceof ProjectionSchemaTracker);
    assertSame(ProjectionType.SOME, schemaTracker.projectionType());
    assertFalse(schemaTracker.isResolved());

    // Reader input schema is partially defined
    final TupleMetadata reader1InputSchema = schemaTracker.readerInputSchema();
    assertEquals(definedSchema, reader1InputSchema);

    ProjectionFilter filter = schemaTracker.projectionFilter(ERROR_CONTEXT);
    assertTrue(filter instanceof DynamicSchemaFilter);

    // Pretend the reader dutifully provided two of the columns
    TupleMetadata readerOutputSchema = new SchemaBuilder()
        .add("a", MinorType.INT)
        .add("b", MinorType.BIGINT)
        .buildSchema();
    schemaTracker.applyReaderSchema(readerOutputSchema, ERROR_CONTEXT);

    // Reader schema is now fully resolved
    assertTrue(schemaTracker.isResolved());
    final TupleMetadata reader2InputSchema = schemaTracker.readerInputSchema();
    TupleMetadata expected = new SchemaBuilder()
        .addAll(readerOutputSchema)
        .add("c", MinorType.VARCHAR)
        .build();
    assertEquals(expected, reader2InputSchema);

    // Pretend an class fills in the the missing columns
    TupleMetadata missingColSchema = new SchemaBuilder()
        .add("c", MinorType.VARCHAR)
        .buildSchema();
    schemaTracker.applyReaderSchema(missingColSchema, ERROR_CONTEXT);

    // Final schema sent downstream
    final TupleMetadata outputSchema = schemaTracker.outputSchema();
    assertEquals(expected, outputSchema);
  }

  /**
   * It is an error if the provided schema does not match the projection
   * list. (Actually, the projection list is redundant in this case. But,
   * since Drill does not actually support a defined schema yet, we have
   * to be a bit vague.
   */
  @Test
  public void testTooShortProjection() {

    // Simulate SELECT a, b ...
    // With a plan-provided defined schema
    final ScanSchemaConfigBuilder builder = new ScanSchemaConfigBuilder()
        .projection(RowSetTestUtils.projectList("a", "b"));

    final TupleMetadata definedSchema = new SchemaBuilder()
        .add("a", MinorType.INT)
        .add("b", MinorType.BIGINT)
        .add("c", MinorType.VARCHAR)
       .buildSchema();
    builder.definedSchema(definedSchema);

    try {
      builder.build();
      fail();
    } catch (Exception e) {
      // Expected
    }
  }

  @Test
  public void testTooLongProjection() {

    // Simulate SELECT a, b, c, d ...
    // With a plan-provided defined schema
    final ScanSchemaConfigBuilder builder = new ScanSchemaConfigBuilder()
        .projection(RowSetTestUtils.projectList("a", "b", "c", "d"));

    final TupleMetadata definedSchema = new SchemaBuilder()
        .add("a", MinorType.INT)
        .add("b", MinorType.BIGINT)
        .add("c", MinorType.VARCHAR)
       .buildSchema();
    builder.definedSchema(definedSchema);

    try {
      builder.build();
      fail();
    } catch (Exception e) {
      // Expected
    }
  }

  @Test
  public void testDisjointProjection() {

    // Simulate SELECT a, c, d ...
    // With a plan-provided defined schema
    final ScanSchemaConfigBuilder builder = new ScanSchemaConfigBuilder()
        .projection(RowSetTestUtils.projectList("a", "c", "d"));

    final TupleMetadata definedSchema = new SchemaBuilder()
        .add("a", MinorType.INT)
        .add("b", MinorType.BIGINT)
        .add("c", MinorType.VARCHAR)
       .buildSchema();
    builder.definedSchema(definedSchema);

    try {
      builder.build();
      fail();
    } catch (Exception e) {
      // Expected
    }
  }

  @Test
  public void testDefinedSchemaWildcard() {

    // Simulate SELECT * ...
    final ScanSchemaConfigBuilder builder = new ScanSchemaConfigBuilder();

    final TupleMetadata definedSchema = new SchemaBuilder()
        .addDynamic(SchemaPath.DYNAMIC_STAR)
       .buildSchema();
    builder.definedSchema(definedSchema);
    final ScanSchemaTracker schemaTracker = builder.build();
    assertTrue(schemaTracker instanceof ProjectionSchemaTracker);

    // At this point, the tracker acts just like a non-defined
    // schema.
  }

  @Test
  public void testEmptyProjectWithDefinedSchema() {

    // Simulate SELECT ...
    // That is, project nothing, as for COUNT(*)
    final ScanSchemaConfigBuilder builder = new ScanSchemaConfigBuilder()
        .projection(RowSetTestUtils.projectNone());
    builder.definedSchema(new TupleSchema());
    final ScanSchemaTracker schemaTracker = builder.build();
    assertTrue(schemaTracker instanceof SchemaBasedTracker);
    assertTrue(schemaTracker.isResolved());
    assertSame(ProjectionType.NONE, schemaTracker.projectionType());
  }
}


text:
drop external table if exists ext_nation;
-- end_ignore
CREATE EXTERNAL TABLE EXT_NATION  ( N_NATIONKEY  INTEGER ,
                            N_NAME       CHAR(25) ,
                            N_REGIONKEY  INTEGER ,
                            N_COMMENT    VARCHAR(152))
location ('file://@hostname@@gpfdist_datadir@/nation.tbl' )
FORMAT 'text' (delimiter '|');

-- start_ignore
drop external table if exists ext_region;
-- end_ignore
CREATE EXTERNAL TABLE EXT_REGION  ( R_REGIONKEY  INTEGER ,
                            R_NAME       CHAR(25) ,
                            R_COMMENT    VARCHAR(152))
location ('file://@hostname@@gpfdist_datadir@/region.tbl' )
FORMAT 'text' (delimiter '|');

-- start_ignore
drop external table if exists ext_part;
-- end_ignore
CREATE EXTERNAL TABLE EXT_PART  ( P_PARTKEY     INTEGER ,
                          P_NAME        VARCHAR(55) ,
                          P_MFGR        CHAR(25) ,
                          P_BRAND       CHAR(10) ,
                          P_TYPE        VARCHAR(25) ,
                          P_SIZE        INTEGER ,
                          P_CONTAINER   CHAR(10) ,
                          P_RETAILPRICE DECIMAL(15,2) ,
                          P_COMMENT     VARCHAR(23)  )
location ('file://@hostname@@gpfdist_datadir@/part.tbl' )
FORMAT 'text' (delimiter '|');

-- start_ignore
drop external table if exists ext_supplier;
-- end_ignore
CREATE EXTERNAL TABLE EXT_SUPPLIER ( S_SUPPKEY     INTEGER ,
                             S_NAME        CHAR(25) ,
                             S_ADDRESS     VARCHAR(40) ,
                             S_NATIONKEY   INTEGER ,
                             S_PHONE       CHAR(15) ,
                             S_ACCTBAL     DECIMAL(15,2) ,
                             S_COMMENT     VARCHAR(101) )
location ('file://@hostname@@gpfdist_datadir@/supplier.tbl' )
FORMAT 'text' (delimiter '|');

-- start_ignore
drop external table if exists ext_partsupp;
-- end_ignore
CREATE EXTERNAL TABLE EXT_PARTSUPP ( PS_PARTKEY     INTEGER ,
                             PS_SUPPKEY     INTEGER ,
                             PS_AVAILQTY    INTEGER ,
                             PS_SUPPLYCOST  DECIMAL(15,2)  ,
                             PS_COMMENT     VARCHAR(199)  )
location ('file://@hostname@@gpfdist_datadir@/partsupp.tbl' )
FORMAT 'text' (delimiter '|');

-- start_ignore
drop external table if exists ext_customer;
-- end_ignore
CREATE EXTERNAL TABLE EXT_CUSTOMER ( C_CUSTKEY     INTEGER ,
                             C_NAME        VARCHAR(25) ,
                             C_ADDRESS     VARCHAR(40) ,
                             C_NATIONKEY   INTEGER ,
                             C_PHONE       CHAR(15) ,
                             C_ACCTBAL     DECIMAL(15,2)   ,
                             C_MKTSEGMENT  CHAR(10) ,
                             C_COMMENT     VARCHAR(117) )
location ('file://@hostname@@gpfdist_datadir@/customer.tbl' )
FORMAT 'text' (delimiter '|');

-- start_ignore
drop external table if exists ext_orders;
-- end_ignore
CREATE EXTERNAL TABLE EXT_ORDERS  ( O_ORDERKEY       INTEGER ,
                           O_CUSTKEY        INTEGER ,
                           O_ORDERSTATUS    CHAR(1) ,
                           O_TOTALPRICE     DECIMAL(15,2) ,
                           O_ORDERDATE      DATE ,
                           O_ORDERPRIORITY  CHAR(15) ,
                           O_CLERK          CHAR(15) ,
                           O_SHIPPRIORITY   INTEGER ,
                           O_COMMENT        VARCHAR(79) )
location ('file://@hostname@@gpfdist_datadir@/orders.tbl' )
FORMAT 'text' (delimiter '|');

-- start_ignore
drop external table if exists ext_lineitem;
-- end_ignore
CREATE EXTERNAL TABLE EXT_LINEITEM ( L_ORDERKEY    INTEGER ,
                             L_PARTKEY     INTEGER ,
                             L_SUPPKEY     INTEGER ,
                             L_LINENUMBER  INTEGER ,
                             L_QUANTITY    DECIMAL(15,2) ,
                             L_EXTENDEDPRICE  DECIMAL(15,2) ,
                             L_DISCOUNT    DECIMAL(15,2) ,
                             L_TAX         DECIMAL(15,2) ,
                             L_RETURNFLAG  CHAR(1) ,
                             L_LINESTATUS  CHAR(1) ,
                             L_SHIPDATE    DATE ,
                             L_COMMITDATE  DATE ,
                             L_RECEIPTDATE DATE ,
                             L_SHIPINSTRUCT CHAR(25) ,
                             L_SHIPMODE     CHAR(10) ,
                             L_COMMENT      VARCHAR(44) )
location ('file://@hostname@@gpfdist_datadir@/lineitem.tbl' )
FORMAT 'text' (delimiter '|');

SELECT * FROM EXT_NATION;

SELECT * FROM EXT_REGION;

SELECT count(*) FROM EXT_PART;

SELECT * FROM EXT_SUPPLIER;

SELECT count(*) FROM EXT_PARTSUPP;

SELECT count(*) FROM EXT_CUSTOMER;

SELECT count(*) FROM EXT_ORDERS;

SELECT count(*) FROM EXT_LINEITEM;

SELECT
l_orderkey, sum(l_extendedprice*(1-l_discount)) as revenue,o_orderdate, o_shippriority
FROM
ext_customer, ext_orders, ext_lineitem
WHERE
c_mktsegment = 'BUILDING' and
c_custkey = o_custkey and
l_orderkey = o_orderkey and
o_orderdate < date '15-mar-1995' and l_shipdate > date '15-mar-1995'
GROUP BY l_orderkey, o_orderdate, o_shippriority
ORDER BY revenue desc, o_orderdate limit 10;

select n_name,
sum(l_extendedprice * (1 - l_discount)) as revenue
from
ext_customer,   ext_orders,  ext_lineitem,  ext_supplier,  ext_nation,  ext_region
where
c_custkey = o_custkey and l_orderkey = o_orderkey and
l_suppkey = s_suppkey and c_nationkey = s_nationkey and
s_nationkey = n_nationkey and n_regionkey = r_regionkey and
r_name = 'ASIA' and o_orderdate >= date '1-jan-1994' and
o_orderdate < date '1-jan-1994' + interval '1 year'
group by n_name order by revenue desc;

select supp_nation,cust_nation,l_year,
sum(volume) as revenue
from (
    select n1.n_name as supp_nation,n2.n_name as cust_nation,
    extract(year from l_shipdate) as l_year,
    l_extendedprice * (1 - l_discount) as volume
    from
    ext_supplier,  ext_lineitem, ext_orders, ext_customer, ext_nation n1, ext_nation n2
    where
    s_suppkey = l_suppkey and o_orderkey = l_orderkey and
    c_custkey = o_custkey and s_nationkey = n1.n_nationkey and
    c_nationkey = n2.n_nationkey and
    ( (n1.n_name = 'FRANCE' and n2.n_name = 'GERMANY') or
    (n1.n_name = 'GERMANY' and n2.n_name = 'FRANCE')) and
    l_shipdate between date '1995-01-01' and
    date '1996-12-31') as shipping
    group by supp_nation,cust_nation,l_year
    order by supp_nation,cust_nation,l_year;

select nation,o_year,sum(amount) as sum_profit
from (
    select n_name as nation, extract(year from o_orderdate) as o_year,
    l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount
    from
    ext_part,  ext_supplier, ext_lineitem, ext_partsupp, ext_orders, ext_nation
    where
    s_suppkey = l_suppkey and ps_suppkey = l_suppkey and
    ps_partkey = l_partkey and p_partkey = l_partkey and
    o_orderkey = l_orderkey and s_nationkey = n_nationkey and
    p_name like '%green%') as profit
    group by nation,o_year
    order by nation,o_year desc;


text:
package chandu0101.scalajs.react.components.materialui

import japgolly.scalajs.react._
import materialui.Mui

import scala.scalajs.js
import scala.scalajs.js.{UndefOr, undefined}

/**
 * key: PropTypes.string,
   ref: PropTypes.String,
   route: React.PropTypes.string,
   onActive: React.PropTypes.ReactElement => Unit,
   label: React.PropTypes.string

 * @param label
 * @param onActive
 * @param ref
 * @param key
 * @param route
 */

case class MuiTab(label: UndefOr[String] = undefined,
                   onActive: UndefOr[ReactElement => Unit] = undefined,
                   ref: UndefOr[String] = undefined,
                   key: UndefOr[String] = undefined,
                   route: UndefOr[String] = undefined) {
  def toJS = {
    val p = js.Dynamic.literal()
    label.foreach(v => p.updateDynamic("label")(v))
    onActive.foreach(v => p.updateDynamic("onActive")(v))
    ref.foreach(v => p.updateDynamic("ref")(v))
    key.foreach(v => p.updateDynamic("key")(v))
    route.foreach(v => p.updateDynamic("route")(v))
    p
  }

  def apply(children: ReactNode*) = {
    val f = React.asInstanceOf[js.Dynamic].createFactory(Mui.Tab)
    f(toJS, children.toJsArray).asInstanceOf[ReactComponentU_]
  }
}


text:
package com.github.robtimus.filesystems.ftp;

/**
 * The base class of option combinations that support file transfers.
 *
 * @author Rob Spoor
 */
abstract class TransferOptions {

    public final FileType fileType;
    public final FileStructure fileStructure;
    public final FileTransferMode fileTransferMode;

    TransferOptions(FileType fileType, FileStructure fileStructure, FileTransferMode fileTransferMode) {
        this.fileType = fileType;
        this.fileStructure = fileStructure;
        this.fileTransferMode = fileTransferMode;
    }
}


text:
package si.majeric.android.ui;

import si.majeric.smarthouse.R;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.Button;

public class TriToggleButton extends Button {
	private static final int DEFAULT_STATE = -1;

	// Keeps track of the current state, 0, 1, or 2
	private int _state;

	// Get the attributes created in attrs.xml
	private static final int[] STATE_ONE_SET = { R.attr.state_one };

	private static final int[] STATE_TWO_SET = { R.attr.state_two };

	private static final int[] STATE_THREE_SET = { R.attr.state_three };

	// Constructors
	public TriToggleButton(Context context) {
		super(context);
		_state = DEFAULT_STATE;
		this.setButtonText();
	}

	public TriToggleButton(Context context, AttributeSet attrs) {
		super(context, attrs);
		_state = DEFAULT_STATE;
		this.setButtonText();
	}

	public TriToggleButton(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		_state = DEFAULT_STATE;
		this.setButtonText();
	}

	@Override
	public boolean performClick() {
		// Move to the next state
		// nextState();
		return super.performClick();
	}

	// Generate the drawable needed for the current state
	@Override
	public int[] onCreateDrawableState(int extraSpace) {
		// Add the number of states you have
		final int[] drawableState = super.onCreateDrawableState(extraSpace + 3);

		if (_state == -1) {
			mergeDrawableStates(drawableState, STATE_ONE_SET);
		} else if (_state == 0) {
			mergeDrawableStates(drawableState, STATE_TWO_SET);
		} else if (_state == 1) {
			mergeDrawableStates(drawableState, STATE_THREE_SET);
		}

		return drawableState;
	}

	// Set current state, 0-2
	public void setState(int state) {
		if ((state > -1) && (state < 3)) {
			_state = state;
			setButtonText();
		}
	}

	public int getState() {
		return _state;
	}

	// Set the text displayed on the button
	private void setButtonText() {
		switch (_state) {
		case -1:
			this.setBackgroundResource(R.drawable.icon_switch);
			break;
		case 0:
			this.setBackgroundResource(R.drawable.icon_off);
			break;
		case 1:
			this.setBackgroundResource(R.drawable.icon_on);
			break;
		default:
			this.setBackgroundResource(R.drawable.icon_switch); // Should never happen, but just in case
			break;
		}
	}
}


text:
package org.gradoop.flink.io.impl.graph;

import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.api.java.tuple.Tuple3;
import org.apache.flink.api.java.typeutils.TupleTypeInfo;
import org.gradoop.common.model.impl.id.GradoopId;
import org.gradoop.common.model.impl.pojo.Edge;
import org.gradoop.common.model.impl.pojo.Vertex;
import org.gradoop.flink.io.api.DataSource;
import org.gradoop.flink.io.impl.graph.functions.InitEdge;
import org.gradoop.flink.io.impl.graph.functions.InitVertex;
import org.gradoop.flink.io.impl.graph.functions.UpdateEdge;
import org.gradoop.flink.io.impl.graph.tuples.ImportEdge;
import org.gradoop.flink.io.impl.graph.tuples.ImportVertex;
import org.gradoop.flink.model.api.epgm.GraphCollection;
import org.gradoop.flink.model.api.epgm.LogicalGraph;
import org.gradoop.flink.model.impl.functions.tuple.Project3To0And1;
import org.gradoop.flink.model.impl.functions.tuple.Value2Of3;
import org.gradoop.flink.util.GradoopFlinkConfig;

import java.io.IOException;

import static com.google.common.base.Preconditions.checkNotNull;

/**
 * Transforms an external graph into an EPGM database. The external graph needs
 * to be represented by a data set of {@link ImportVertex} and a data set of
 * {@link ImportEdge}. This class transforms the external graph into an EPGM
 * {@link LogicalGraph}.
 *
 * @param <K> External vertex/edge identifier type
 */
public class GraphDataSource<K extends Comparable<K>> implements DataSource {

  /**
   * Vertices to import.
   */
  private final DataSet<ImportVertex<K>> importVertices;

  /**
   * Edges to import.
   */
  private final DataSet<ImportEdge<K>> importEdges;

  /**
   * Used to store the lineage information at the resulting EPGM element.
   */
  private final String lineagePropertyKey;

  /**
   * Gradoop config
   */
  private final GradoopFlinkConfig config;

  /**
   * Creates a new graph reader with no lineage information stored at the
   * resulting EPGM graph.
   *
   * @param importVertices  vertices to import
   * @param importEdges     edges to import
   * @param config          gradoop config
   */
  public GraphDataSource(DataSet<ImportVertex<K>> importVertices,
    DataSet<ImportEdge<K>> importEdges, GradoopFlinkConfig config) {
    this(importVertices, importEdges, null, config);
  }

  /**
   * Creates a new graph reader.
   *
   * If the given {@code lineagePropertyKey} is {@code null}, no lineage info
   * is stored.
   *
   * @param importVertices      vertices to import
   * @param importEdges         edges to import
   * @param lineagePropertyKey  property key to store import identifiers
   *                            (can be {@code null})
   * @param config              gradoop config
   */
  public GraphDataSource(DataSet<ImportVertex<K>> importVertices,
    DataSet<ImportEdge<K>> importEdges, String lineagePropertyKey,
    GradoopFlinkConfig config) {
    this.importVertices     = checkNotNull(importVertices);
    this.importEdges        = checkNotNull(importEdges);
    this.lineagePropertyKey = lineagePropertyKey;
    this.config             = checkNotNull(config);
  }

  /**
   * Transforms the import graph into a logical graph.
   *
   * @return logical graph
   */
  @Override
  public LogicalGraph getLogicalGraph() {

    TypeInformation<K> externalIdType = ((TupleTypeInfo<?>) importVertices
      .getType()).getTypeAt(0);

    DataSet<Tuple3<K, GradoopId, Vertex>> vertexTriples = importVertices
      .map(new InitVertex<K>(
        config.getVertexFactory(), lineagePropertyKey, externalIdType));

    DataSet<Vertex> epgmVertices = vertexTriples
      .map(new Value2Of3<K, GradoopId, Vertex>());

    DataSet<Tuple2<K, GradoopId>> vertexIdPair = vertexTriples
      .map(new Project3To0And1<K, GradoopId, Vertex>());

    DataSet<Edge> epgmEdges = importEdges
      .join(vertexIdPair)
      .where(1).equalTo(0)
      .with(new InitEdge<K>(
        config.getEdgeFactory(), lineagePropertyKey, externalIdType))
      .join(vertexIdPair)
      .where(0).equalTo(0)
      .with(new UpdateEdge<Edge, K>());

    return config.getLogicalGraphFactory().fromDataSets(epgmVertices, epgmEdges);
  }

  @Override
  public GraphCollection getGraphCollection() throws IOException {
    return config.getGraphCollectionFactory().fromGraph(getLogicalGraph());
  }
}


text:
[![Build Status](https://travis-ci.com/litespeedtech/ls-hpack.svg?branch=master)](https://travis-ci.com/litespeedtech/ls-hpack)
[![Build Status](https://api.cirrus-ci.com/github/litespeedtech/ls-hpack.svg)](https://cirrus-ci.com/github/litespeedtech/ls-hpack)
[![Build status](https://ci.appveyor.com/api/projects/status/6ev71ecmm3j2u9o5?svg=true)](https://ci.appveyor.com/project/litespeedtech/ls-hpack)

LS-HPACK: LiteSpeed HPACK Library
=================================

Description
-----------

LS-HPACK provides functionality to encode and decode HTTP headers using
HPACK compression mechanism specified in RFC 7541.

Documentation
-------------

The API is documented in include/lshpack.h.  To see usage examples,
see the unit tests.

Requirements
------------

To build LS-HPACK, you need CMake.  The library uses XXHASH at runtime.

Platforms
---------

The library has been tested on the following platforms:
- Linux
- FreeBSD
- Windows

Copyright (c) 2018 - 2020 LiteSpeed Technologies Inc


text:
import six
from abc import ABCMeta, abstractmethod

from .baserequest import BaseRequest
from oandapyV20.types import PriceValue
import oandapyV20.definitions.orders as OD

@six.add_metaclass(ABCMeta)
class OnFill(BaseRequest):
    """baseclass for onFill requests."""

    @abstractmethod
    def __init__(self,
                 timeInForce=OD.TimeInForce.GTC,
                 gtdTime=None,
                 clientExtensions=None):
        super(OnFill, self).__init__()

        if timeInForce not in [OD.TimeInForce.GTC,
                               OD.TimeInForce.GTD,
                               OD.TimeInForce.GFD]:
            raise ValueError("timeInForce: {} invalid".format(timeInForce))

        self._data.update({"timeInForce": timeInForce})

        # optional, but required if
        if timeInForce == OD.TimeInForce.GTD and not gtdTime:
            raise ValueError("gtdTime: value required when timeInForce is GTD")
        self._data.update({"gtdTime": gtdTime})
        self._data.update({"clientExtensions": clientExtensions})

class TakeProfitDetails(OnFill):
    """Representation of the specification for a TakeProfitOrder.

    It is typically used to specify 'take profit details' for the
    'takeProfitOnFill' parameter of an OrderRequest. This way one
    can create the Take Profit Order as a dependency when an order
    gets filled.

    The other way to create a TakeProfitOrder is to create it afterwards
    on an existing trade. In that case you use TakeProfitOrderRequest on
    the trade.
    """

    def __init__(self,
                 price,
                 timeInForce=OD.TimeInForce.GTC,
                 gtdTime=None,
                 clientExtensions=None):
        """Instantiate TakeProfitDetails.

        Parameters
        ----------

        price : float or string (required)
            the price to trigger take profit order

        timeInForce : TimeInForce (required), default TimeInForce.GTC
            the time in force

        gtdTime : DateTime (optional)
            gtdTime is required in case timeInForce == TimeInForce.GTD

        Example
        -------

        >>> import json
        >>> from oandapyV20 import API
        >>> import oandapyV20.endpoints.orders as orders
        >>> from oandapyV20.contrib.requests import (
        >>>     MarketOrderRequest, TakeProfitDetails)
        >>>
        >>> accountID = "..."
        >>> client = API(access_token=...)
        >>> # at time of writing EUR_USD = 1.0740
        >>> # let us take profit at 1.10, GoodTillCancel (default)
        >>> takeProfitOnFillOrder = TakeProfitDetails(price=1.10)
        >>> print(takeProfitOnFillOrder.data)
        {
            "timeInForce": "GTC",
            "price": "1.10000"
        }
        >>> ordr = MarketOrderRequest(
        >>>     instrument="EUR_USD",
        >>>     units=10000,
        >>>     takeProfitOnFill=takeProfitOnFillOrder.data
        >>> )
        >>> # or as shortcut ...
        >>> #   takeProfitOnFill=TakeProfitDetails(price=1.10).data
        >>> print(json.dumps(ordr.data, indent=4))
        {
            "order": {
                "timeInForce": "FOK",
                "instrument": "EUR_USD",
                "units": "10000",
                "positionFill": "DEFAULT",
                "type": "MARKET",
                "takeProfitOnFill": {
                    "timeInForce": "GTC",
                    "price": "1.10000"
                }
            }
        }
        >>> r = orders.OrderCreate(accountID, data=ordr.data)
        >>> rv = client.request(r)
        >>> ...
        """
        super(TakeProfitDetails, self).__init__(
            timeInForce=timeInForce,
            gtdTime=gtdTime,
            clientExtensions=clientExtensions)
        self._data.update({"price": PriceValue(price).value})

class StopLossDetails(OnFill):
    """Representation of the specification for a StopLossOrder.

    It is typically used to specify 'stop loss details' for the
    'stopLossOnFill' parameter of an OrderRequest. This way one
    can create the Stop Loss Order as a dependency when an order
    gets filled.

    The other way to create a StopLossOrder is to create it afterwards
    on an existing trade. In that case you use StopLossOrderRequest on
    the trade.
    """

    def __init__(self,
                 price,
                 timeInForce=OD.TimeInForce.GTC,
                 gtdTime=None,
                 clientExtensions=None):
        """Instantiate StopLossDetails.

        Parameters
        ----------

        price : float or string (required)
            the price to trigger take profit order

        timeInForce : TimeInForce (required), default TimeInForce.GTC
            the time in force

        gtdTime : DateTime (optional)
            gtdTime is required in case timeInForce == TimeInForce.GTD

        clientExtensions : ClientExtensions (optional)

        Example
        -------

            >>> import json
            >>> from oandapyV20 import API
            >>> import oandapyV20.endpoints.orders as orders
            >>> from oandapyV20.contrib.requests import (
            >>>     MarketOrderRequest, StopLossDetails)
            >>>
            >>> accountID = "..."
            >>> client = API(access_token=...)
            >>> # at time of writing EUR_USD = 1.0740
            >>> # let us take profit at 1.10, GoodTillCancel (default)
            >>> stopLossOnFill = StopLossDetails(price=1.06)
            >>> print(stopLossOnFill)
            {
                "timeInForce": "GTC",
                "price": "1.10000"
            }
            >>> ordr = MarketOrderRequest(
            >>>     instrument="EUR_USD",
            >>>     units=10000,
            >>>     stopLossOnFill=stopLossOnFill.data
            >>> )
            >>> # or as shortcut ...
            >>> #   stopLossOnFill=StopLossDetails(price=1.06).data
            >>> print(json.dumps(ordr.data, indent=4))
            >>> r = orders.OrderCreate(accountID, data=ordr.data)
            >>> rv = client.request(r)
            >>> ...
        """
        super(StopLossDetails, self).__init__(
            timeInForce=timeInForce,
            gtdTime=gtdTime,
            clientExtensions=clientExtensions)
        self._data.update({"price": PriceValue(price).value})

class TrailingStopLossDetails(OnFill):
    """Representation of the specification for a TrailingStopLossOrder.

    It is typically used to specify 'trailing stop loss details' for the
    'trailingStopLossOnFill' parameter of an OrderRequest. This way one
    can create the Trailing Stop Loss Order as a dependency when an order
    gets filled.

    The other way to create a TrailingStopLossOrder is to create it afterwards
    on an existing trade. In that case you use TrailingStopLossOrderRequest on
    the trade.
    """

    def __init__(self,
                 distance,
                 timeInForce=OD.TimeInForce.GTC,
                 gtdTime=None,
                 clientExtensions=None):
        """Instantiate TrailingStopLossDetails.

        Parameters
        ----------

        distance : float or string (required)
            the price to trigger trailing stop loss order

        timeInForce : TimeInForce (required), default TimeInForce.GTC
            the time in force

        gtdTime : DateTime (optional)
            gtdTime is required in case timeInForce == TimeInForce.GTD

        clientExtensions : ClientExtensions (optional)

        Example
        -------

            >>> import json
            >>> from oandapyV20 import API
            >>> import oandapyV20.endpoints.orders as orders
            >>> from oandapyV20.contrib.requests import (
            >>>     MarketOrderRequest, TrailingStopLossDetails)
            >>>
            >>> accountID = "..."
            >>> client = API(access_token=...)
            >>> # at time of writing EUR_USD = 1.0740
            >>> # add a trailing stoploss, at 50 pips GoodTillCancel (default)
            >>> sld = 1.0740 - 1.0690
            >>> trailingStopLossOnFill = TrailingStopLossDetails(distance=sld)
            >>> print(trailingStopLossOnFill)
            {
                "timeInForce": "GTC",
                "distance": "0.00500"
            }
            >>> ordr = MarketOrderRequest(
            >>>     instrument="EUR_USD",
            >>>     units=10000,
            >>>     trailingStopLossOnFill=trailingStopLossOnFill.data
            >>> )
            >>> print(json.dumps(ordr.data, indent=4))
            >>> r = orders.OrderCreate(accountID, data=ordr.data)
            >>> rv = client.request(r)
            >>> ...
        """
        super(TrailingStopLossDetails, self).__init__(
            timeInForce=timeInForce,
            gtdTime=gtdTime,
            clientExtensions=clientExtensions)
        self._data.update({"distance": PriceValue(distance).value})


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using Xunit;

namespace System.Security.Cryptography.Rsa.Tests
{
    //
    // These tests currently do not work against CNG and thus are split off so we can exclude them.
    //
    public partial class ImportExport
    {
        [Fact]
        public static void PaddedExport()
        {
            // OpenSSL's numeric type for the storage of RSA key parts disregards zero-valued
            // prefix bytes.
            //
            // The .NET 4.5 RSACryptoServiceProvider type verifies that all of the D breakdown
            // values (P, DP, Q, DQ, InverseQ) are exactly half the size of D (which is itself
            // the same size as Modulus).
            //
            // These two things, in combination, suggest that we ensure that all .NET
            // implementations of RSA export their keys to the fixed array size suggested by their
            // KeySize property.
            RSAParameters diminishedDPParamaters = TestData.DiminishedDPParamaters;
            RSAParameters exported;

            using (RSA rsa = RSAFactory.Create())
            {
                rsa.ImportParameters(diminishedDPParamaters);
                exported = rsa.ExportParameters(true);
            }

            // DP is the most likely to fail, the rest just otherwise ensure that Export
            // isn't losing data.
            AssertKeyEquals(ref diminishedDPParamaters, ref exported);
        }

        [Fact]
        public static void UnusualExponentImportExport()
        {
            // Most choices for the Exponent value in an RSA key use a Fermat prime.
            // Since a Fermat prime is 2^(2^m) + 1, it always only has two bits set, and
            // frequently has the form { 0x01, [some number of 0x00s], 0x01 }, which has the same
            // representation in both big- and little-endian.
            //
            // The only real requirement for an Exponent value is that it be coprime to (p-1)(q-1).
            // So here we'll use the (non-Fermat) prime value 433 (0x01B1) to ensure big-endian export.
            RSAParameters unusualExponentParameters = TestData.UnusualExponentParameters;
            RSAParameters exported;

            using (RSA rsa = RSAFactory.Create())
            {
                rsa.ImportParameters(unusualExponentParameters);
                exported = rsa.ExportParameters(true);
            }

            // Exponent is the most likely to fail, the rest just otherwise ensure that Export
            // isn't losing data.
            AssertKeyEquals(ref unusualExponentParameters, ref exported);
        }
    }
}


text:
// This is a host config that's used for the `react-reconciler` package on npm.
// It is only used by third-party renderers.
//
// Its API lets you pass the host config as an argument.
// However, inside the `react-reconciler` we treat host config as a module.
// This file is a shim between two worlds.
//
// It works because the `react-reconciler` bundle is wrapped in something like:
//
// module.exports = function ($$$config) {
//   /* reconciler code */
// }
//
// So `$$$config` looks like a global variable, but it's
// really an argument to a top-level wrapping function.

declare var $$$hostConfig: any;
export opaque type Type = mixed; // eslint-disable-line no-undef
export opaque type Props = mixed; // eslint-disable-line no-undef
export opaque type Container = mixed; // eslint-disable-line no-undef
export opaque type Instance = mixed; // eslint-disable-line no-undef
export opaque type TextInstance = mixed; // eslint-disable-line no-undef
export opaque type SuspenseInstance = mixed; // eslint-disable-line no-undef
export opaque type HydratableInstance = mixed; // eslint-disable-line no-undef
export opaque type PublicInstance = mixed; // eslint-disable-line no-undef
export opaque type HostContext = mixed; // eslint-disable-line no-undef
export opaque type UpdatePayload = mixed; // eslint-disable-line no-undef
export opaque type ChildSet = mixed; // eslint-disable-line no-undef
export opaque type TimeoutHandle = mixed; // eslint-disable-line no-undef
export opaque type NoTimeout = mixed; // eslint-disable-line no-undef
export opaque type RendererInspectionConfig = mixed; // eslint-disable-line no-undef
export type EventResponder = any;

export const getPublicInstance = $$$hostConfig.getPublicInstance;
export const getRootHostContext = $$$hostConfig.getRootHostContext;
export const getChildHostContext = $$$hostConfig.getChildHostContext;
export const prepareForCommit = $$$hostConfig.prepareForCommit;
export const resetAfterCommit = $$$hostConfig.resetAfterCommit;
export const createInstance = $$$hostConfig.createInstance;
export const appendInitialChild = $$$hostConfig.appendInitialChild;
export const finalizeInitialChildren = $$$hostConfig.finalizeInitialChildren;
export const prepareUpdate = $$$hostConfig.prepareUpdate;
export const shouldSetTextContent = $$$hostConfig.shouldSetTextContent;
export const createTextInstance = $$$hostConfig.createTextInstance;
export const scheduleTimeout = $$$hostConfig.scheduleTimeout;
export const cancelTimeout = $$$hostConfig.cancelTimeout;
export const noTimeout = $$$hostConfig.noTimeout;
export const isPrimaryRenderer = $$$hostConfig.isPrimaryRenderer;
export const warnsIfNotActing = $$$hostConfig.warnsIfNotActing;
export const supportsMutation = $$$hostConfig.supportsMutation;
export const supportsPersistence = $$$hostConfig.supportsPersistence;
export const supportsHydration = $$$hostConfig.supportsHydration;
export const getInstanceFromNode = $$$hostConfig.getInstanceFromNode;
export const beforeActiveInstanceBlur = $$$hostConfig.beforeActiveInstanceBlur;
export const afterActiveInstanceBlur = $$$hostConfig.afterActiveInstanceBlur;
export const preparePortalMount = $$$hostConfig.preparePortalMount;
export const prepareScopeUpdate = $$$hostConfig.prepareScopeUpdate;
export const getInstanceFromScope = $$$hostConfig.getInstanceFromScope;
export const getCurrentEventPriority = $$$hostConfig.getCurrentEventPriority;
export const detachDeletedInstance = $$$hostConfig.detachDeletedInstance;
export const requestPostPaintCallback = $$$hostConfig.requestPostPaintCallback;
export const prepareRendererToRender = $$$hostConfig.prepareRendererToRender;
export const resetRendererAfterRender = $$$hostConfig.resetRendererAfterRender;

// -------------------
//      Microtasks
//     (optional)
// -------------------
export const supportsMicrotasks = $$$hostConfig.supportsMicrotasks;
export const scheduleMicrotask = $$$hostConfig.scheduleMicrotask;

// -------------------
//      Test selectors
//     (optional)
// -------------------
export const supportsTestSelectors = $$$hostConfig.supportsTestSelectors;
export const findFiberRoot = $$$hostConfig.findFiberRoot;
export const getBoundingRect = $$$hostConfig.getBoundingRect;
export const getTextContent = $$$hostConfig.getTextContent;
export const isHiddenSubtree = $$$hostConfig.isHiddenSubtree;
export const matchAccessibilityRole = $$$hostConfig.matchAccessibilityRole;
export const setFocusIfFocusable = $$$hostConfig.setFocusIfFocusable;
export const setupIntersectionObserver =
  $$$hostConfig.setupIntersectionObserver;

// -------------------
//      Mutation
//     (optional)
// -------------------
export const appendChild = $$$hostConfig.appendChild;
export const appendChildToContainer = $$$hostConfig.appendChildToContainer;
export const commitTextUpdate = $$$hostConfig.commitTextUpdate;
export const commitMount = $$$hostConfig.commitMount;
export const commitUpdate = $$$hostConfig.commitUpdate;
export const insertBefore = $$$hostConfig.insertBefore;
export const insertInContainerBefore = $$$hostConfig.insertInContainerBefore;
export const removeChild = $$$hostConfig.removeChild;
export const removeChildFromContainer = $$$hostConfig.removeChildFromContainer;
export const resetTextContent = $$$hostConfig.resetTextContent;
export const hideInstance = $$$hostConfig.hideInstance;
export const hideTextInstance = $$$hostConfig.hideTextInstance;
export const unhideInstance = $$$hostConfig.unhideInstance;
export const unhideTextInstance = $$$hostConfig.unhideTextInstance;
export const clearContainer = $$$hostConfig.clearContainer;

// -------------------
//     Persistence
//     (optional)
// -------------------
export const cloneInstance = $$$hostConfig.cloneInstance;
export const createContainerChildSet = $$$hostConfig.createContainerChildSet;
export const appendChildToContainerChildSet =
  $$$hostConfig.appendChildToContainerChildSet;
export const finalizeContainerChildren =
  $$$hostConfig.finalizeContainerChildren;
export const replaceContainerChildren = $$$hostConfig.replaceContainerChildren;
export const cloneHiddenInstance = $$$hostConfig.cloneHiddenInstance;
export const cloneHiddenTextInstance = $$$hostConfig.cloneHiddenTextInstance;

// -------------------
//     Hydration
//     (optional)
// -------------------
export const canHydrateInstance = $$$hostConfig.canHydrateInstance;
export const canHydrateTextInstance = $$$hostConfig.canHydrateTextInstance;
export const canHydrateSuspenseInstance =
  $$$hostConfig.canHydrateSuspenseInstance;
export const isSuspenseInstancePending =
  $$$hostConfig.isSuspenseInstancePending;
export const isSuspenseInstanceFallback =
  $$$hostConfig.isSuspenseInstanceFallback;
export const getSuspenseInstanceFallbackErrorDetails =
  $$$hostConfig.getSuspenseInstanceFallbackErrorDetails;
export const registerSuspenseInstanceRetry =
  $$$hostConfig.registerSuspenseInstanceRetry;
export const getNextHydratableSibling = $$$hostConfig.getNextHydratableSibling;
export const getFirstHydratableChild = $$$hostConfig.getFirstHydratableChild;
export const getFirstHydratableChildWithinContainer =
  $$$hostConfig.getFirstHydratableChildWithinContainer;
export const getFirstHydratableChildWithinSuspenseInstance =
  $$$hostConfig.getFirstHydratableChildWithinSuspenseInstance;
export const hydrateInstance = $$$hostConfig.hydrateInstance;
export const hydrateTextInstance = $$$hostConfig.hydrateTextInstance;
export const hydrateSuspenseInstance = $$$hostConfig.hydrateSuspenseInstance;
export const getNextHydratableInstanceAfterSuspenseInstance =
  $$$hostConfig.getNextHydratableInstanceAfterSuspenseInstance;
export const commitHydratedContainer = $$$hostConfig.commitHydratedContainer;
export const commitHydratedSuspenseInstance =
  $$$hostConfig.commitHydratedSuspenseInstance;
export const clearSuspenseBoundary = $$$hostConfig.clearSuspenseBoundary;
export const clearSuspenseBoundaryFromContainer =
  $$$hostConfig.clearSuspenseBoundaryFromContainer;
export const shouldDeleteUnhydratedTailInstances =
  $$$hostConfig.shouldDeleteUnhydratedTailInstances;
export const didNotMatchHydratedContainerTextInstance =
  $$$hostConfig.didNotMatchHydratedContainerTextInstance;
export const didNotMatchHydratedTextInstance =
  $$$hostConfig.didNotMatchHydratedTextInstance;
export const didNotHydrateInstanceWithinContainer =
  $$$hostConfig.didNotHydrateInstanceWithinContainer;
export const didNotHydrateInstanceWithinSuspenseInstance =
  $$$hostConfig.didNotHydrateInstanceWithinSuspenseInstance;
export const didNotHydrateInstance = $$$hostConfig.didNotHydrateInstance;
export const didNotFindHydratableInstanceWithinContainer =
  $$$hostConfig.didNotFindHydratableInstanceWithinContainer;
export const didNotFindHydratableTextInstanceWithinContainer =
  $$$hostConfig.didNotFindHydratableTextInstanceWithinContainer;
export const didNotFindHydratableSuspenseInstanceWithinContainer =
  $$$hostConfig.didNotFindHydratableSuspenseInstanceWithinContainer;
export const didNotFindHydratableInstanceWithinSuspenseInstance =
  $$$hostConfig.didNotFindHydratableInstanceWithinSuspenseInstance;
export const didNotFindHydratableTextInstanceWithinSuspenseInstance =
  $$$hostConfig.didNotFindHydratableTextInstanceWithinSuspenseInstance;
export const didNotFindHydratableSuspenseInstanceWithinSuspenseInstance =
  $$$hostConfig.didNotFindHydratableSuspenseInstanceWithinSuspenseInstance;
export const didNotFindHydratableInstance =
  $$$hostConfig.didNotFindHydratableInstance;
export const didNotFindHydratableTextInstance =
  $$$hostConfig.didNotFindHydratableTextInstance;
export const didNotFindHydratableSuspenseInstance =
  $$$hostConfig.didNotFindHydratableSuspenseInstance;
export const errorHydratingContainer = $$$hostConfig.errorHydratingContainer;

// -------------------
//     Resources
//     (optional)
// -------------------
export const supportsResources = $$$hostConfig.supportsResources;
export const isHostResourceType = $$$hostConfig.isHostResourceType;
export const getResource = $$$hostConfig.getResource;
export const acquireResource = $$$hostConfig.acquireResource;
export const releaseResource = $$$hostConfig.releaseResource;


text:
[Home](./index.md) > [sip.js](./sip.js.md) > [SessionDelegate](./sip.js.sessiondelegate.md) > [onBye](./sip.js.sessiondelegate.onbye.md)

## SessionDelegate.onBye() method

Called upon receiving an incoming in dialog BYE request.

Signature:

```typescript
onBye?(bye: Bye): void;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  bye | [Bye](./sip.js.bye.md) | The bye. |

Returns:

void


text:
{% extends '_base.html' %}

{% block body %}

    {% block navigation %}{% include 'nav_utility.html' %}{% endblock navigation %}

            {% block sidebar %}

                    {% if not user.user_is_historian %}

Hosts

                                 Add Host

                        {% if user.user_is_admin %}

Users

                                     Add User

                        {% endif %}

                    {% endif %}

            {% endblock sidebar %}

            {% block wrapper %}

                    {% block breadcrumb %}
                    {% endblock breadcrumb %}

                    {% block messages %}
                        {% for message in messages %}

                                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                {{ message }}

                        {% endfor %}
                    {% endblock messages %}

                    {% block content %}{% endblock content %}

            {% endblock  %}

            Created by Alex Ruiz

            Icons by Glyphicons | Themes by Bootswatch | Thanks for playing

{% endblock body %}