text:
external help file: Microsoft.WindowsAzure.Commands.Storage.dll-Help.xml
ms.assetid: 383402B2-6B7C-41AB-AFF9-36C86156B0A9
online version:
schema: 2.0.0
---

# New-AzureStorageContext

## SYNOPSIS
Creates an Azure Storage context.

## SYNTAX

### AccountNameAndKey (Default)
```
New-AzureStorageContext [-StorageAccountName] <String> [-StorageAccountKey] <String> [-Protocol <String>]
 [-Endpoint <String>] [-InformationAction <ActionPreference>] [-InformationVariable <String>]
 [-PipelineVariable <String>] [<CommonParameters>]
```

### SasToken
```
New-AzureStorageContext [-StorageAccountName] <String> -SasToken <String> [-Protocol <String>]
 [-Endpoint <String>] [-InformationAction <ActionPreference>] [-InformationVariable <String>]
 [-PipelineVariable <String>] [<CommonParameters>]
```

### SasTokenWithAzureEnvironment
```
New-AzureStorageContext [-StorageAccountName] <String> -SasToken <String> -Environment <String>
 [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>]
 [<CommonParameters>]
```

### AccountNameAndKeyEnvironment
```
New-AzureStorageContext [-StorageAccountName] <String> [-StorageAccountKey] <String> [-Protocol <String>]
 -Environment <String> [-InformationAction <ActionPreference>] [-InformationVariable <String>]
 [-PipelineVariable <String>] [<CommonParameters>]
```

### AnonymousAccount
```
New-AzureStorageContext [-StorageAccountName] <String> [-Anonymous] [-Protocol <String>] [-Endpoint <String>]
 [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>]
 [<CommonParameters>]
```

### AnonymousAccountEnvironment
```
New-AzureStorageContext [-StorageAccountName] <String> [-Anonymous] [-Protocol <String>] -Environment <String>
 [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>]
 [<CommonParameters>]
```

### ConnectionString
```
New-AzureStorageContext -ConnectionString <String> [-InformationAction <ActionPreference>]
 [-InformationVariable <String>] [-PipelineVariable <String>] [<CommonParameters>]
```

### LocalDevelopment
```
New-AzureStorageContext [-Local] [-InformationAction <ActionPreference>] [-InformationVariable <String>]
 [-PipelineVariable <String>] [<CommonParameters>]
```

## DESCRIPTION
The **New-AzureStorageContext** cmdlet creates an Azure Storage context.

## EXAMPLES

### Example 1: Create a context by specifying a storage account name and key
```
C:\PS>New-AzureStorageContext -StorageAccountName "ContosoGeneral" -StorageAccountKey "< Storage Key for ContosoGeneral ends with == >"
```

This command creates a context for the account named ContosoGeneral that uses the specified key.

### Example 2: Create a context by specifying a connection string
```
C:\PS>New-AzureStorageContext -ConnectionString "DefaultEndpointsProtocol=https;AccountName=ContosoGeneral;AccountKey=< Storage Key for ContosoGeneral ends with == >;"
```

This command creates a context based on the specified connection string for the account ContosoGeneral.

### Example 3: Create a context for an anonymous storage account
```
C:\PS>New-AzureStorageContext -StorageAccountName "ContosoGeneral" -Anonymous -Protocol "http"
```

This command creates a context for anonymous use for the account named ContosoGeneral.
The command specifies HTTP as a connection protocol.

### Example 4: Create a context by using the local development storage account
```
C:\PS>New-AzureStorageContext -Local
```

This command creates a context by using the local development storage account.
The command specifies the *Local* parameter.

### Example 5: Get the container for the local developer storage account
```
C:\PS>New-AzureStorageContext -Local | Get-AzureStorageContainer
```

This command creates a context by using the local development storage account, and then passes the new context to the **Get-AzureStorageContainer** cmdlet by using the pipeline operator.
The command gets the Azure Storage container for the local developer storage account.

### Example 6: Get multiple containers
```
C:\PS>$Context01 = New-AzureStorageContext -Local
PS C:\> $Context02 = New-AzureStorageContext -StorageAccountName "ContosoGeneral" -StorageAccountKey "< Storage Key for ContosoGeneral ends with == >"
PS C:\> ($Context01, $Context02) | Get-AzureStorageContainer
```

The first command creates a context by using the local development storage account, and then stores that context in the $Context01 variable.

The second command creates a context for the account named ContosoGeneral that uses the specified key, and then stores that context in the $Context02 variable.

The final command gets the containers for the contexts stored in $Context01 and $Context02 by using **Get-AzureStorageContainer**.

### Example 7: Create a context with an endpoint
```
C:\PS>New-AzureStorageContext -StorageAccountName "ContosoGeneral" -StorageAccountKey "< Storage Key for ContosoGeneral ends with == >" -Endpoint "contosoaccount.core.windows.net"
```

This command creates an Azure Storage context that has the specified storage endpoint.
The command creates the context for the account named ContosoGeneral that uses the specified key.

### Example 8: Create a context with a specified environment
```
C:\PS>New-AzureStorageContext -StorageAccountName "ContosoGeneral" -StorageAccountKey "< Storage Key for ContosoGeneral ends with == >" -Environment "AzureChinaCloud"
```

This command creates an Azure storage context that has the specified Azure environment.
The command creates the context for the account named ContosoGeneral that uses the specified key.

### Example 9: Create a context by using an SAS token
```
C:\PS>$SasToken = New-AzureStorageContainerSASToken -Name "ContosoMain" -Permission "raud"
PS C:\> $Context = New-AzureStorageContext -StorageAccountName "ContosoGeneral" -SasToken $SasToken
PS C:\> $Context | Get-AzureStorageBlob -Container "ContosoMain"
```

The first command generates an SAS token by using the **New-AzureStorageContainerSASToken** cmdlet for the container named ContosoMain, and then stores that token in the $SasToken variable.
That token is for read, add, update, and delete permissions.

The second command creates a context for the account named ContosoGeneral that uses the SAS token stored in $SasToken, and then stores that context in the $Context variable.

The final command lists all the blobs associated with the container named ContosoMain by using the context stored in $Context.

## PARAMETERS

### -StorageAccountName
Specifies an Azure Storage account name.
This cmdlet creates a context for the account that this parameter specifies.

```yaml
Type: String
Parameter Sets: AccountNameAndKey, SasToken, SasTokenWithAzureEnvironment, AccountNameAndKeyEnvironment, AnonymousAccount, AnonymousAccountEnvironment
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -StorageAccountKey
Specifies an Azure Storage account key.
This cmdlet creates a context for the key that this parameter specifies.

```yaml
Type: String
Parameter Sets: AccountNameAndKey, AccountNameAndKeyEnvironment
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Protocol
Specifies the protocol permitted for a request made with the account SAS.
The acceptable values for this parameter are:

- HttpsOnly
- HttpsOrHttp

The default value is HttpsOrHttp.

```yaml
Type: String
Parameter Sets: AccountNameAndKey, SasToken, AccountNameAndKeyEnvironment, AnonymousAccount, AnonymousAccountEnvironment
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Endpoint
Specifies the endpoint for the Azure Storage context.

```yaml
Type: String
Parameter Sets: AccountNameAndKey, SasToken, AnonymousAccount
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -InformationAction
Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

- Continue
- Ignore
- Inquire
- SilentlyContinue
- Stop
- Suspend

```yaml
Type: ActionPreference
Parameter Sets: (All)
Aliases: infa

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -InformationVariable
Specifies an information variable.

```yaml
Type: String
Parameter Sets: (All)
Aliases: iv

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -SasToken
Specifies a Shared Access Signature (SAS) token for the context.

```yaml
Type: String
Parameter Sets: SasToken, SasTokenWithAzureEnvironment
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Environment
Specifies the Azure environment.
The acceptable values for this parameter are: AzureCloud and AzureChinaCloud.
For more information, type `Get-Help Get-AzureEnvironment`.

```yaml
Type: String
Parameter Sets: SasTokenWithAzureEnvironment
Aliases: Name, EnvironmentName

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

```yaml
Type: String
Parameter Sets: AccountNameAndKeyEnvironment, AnonymousAccountEnvironment
Aliases: Name, EnvironmentName

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Anonymous
Indicates that this cmdlet creates an Azure Storage context for anonymous logon.

```yaml
Type: SwitchParameter
Parameter Sets: AnonymousAccount, AnonymousAccountEnvironment
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ConnectionString
Specifies a connection string for the Azure Storage context.

```yaml
Type: String
Parameter Sets: ConnectionString
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Local
Indicates that this cmdlet creates a context by using the local development storage account.

```yaml
Type: SwitchParameter
Parameter Sets: LocalDevelopment
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -PipelineVariable
Stores the value of the current pipeline element as a variable, for any named command as it flows through the pipeline.

```yaml
Type: String
Parameter Sets: (All)
Aliases: pv

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

### AzureStorageContext

## NOTES

## RELATED LINKS

[Get-AzureStorageBlob](./Get-AzureStorageBlob.md)

[New-AzureStorageContainerSASToken](./New-AzureStorageContainerSASToken.md)


text:
package com.krux.hyperion.datanode

/**
 * The data node that can be used as input and output in CopyActivity
 */
trait Copyable extends DataNode

redpajama_set_name: RedPajamaGithub


text:
import sys
sys.path.append('../..')
import unittest

import numpy as np
import pandas as pd
from sklearn import linear_model

from ramp.estimators import (Probabilities,
                             BinaryProbabilities,
                             wrap_sklearn_like_estimator)
from ramp import shortcuts
from ramp.tests.test_features import make_data

class DummyProbEstimator(object):
    def __init__(self, n_clses):
        self.n_clses = n_clses
        self._coefs = "coefs"

    def fit(self, x, y):
        pass

    def predict_proba(self, x):
        return np.zeros((len(x), self.n_clses))

class TestEstimators(unittest.TestCase):
    def setUp(self):
        self.data = make_data(10)

    def test_probabilities(self):
        inner_est = DummyProbEstimator(3)
        est = wrap_sklearn_like_estimator(inner_est)

        # test attr wrap
        self.assertEqual(est._coefs, inner_est._coefs)
        self.assertRaises(AttributeError, getattr, est, 'nope_not_attr')

        preds = est.predict(self.data.values)
        self.assertEqual(preds.shape, (10, 3))

    def test_binary_probabilities(self):
        inner_est = DummyProbEstimator(2)
        est = wrap_sklearn_like_estimator(inner_est)

        # test attr wrap
        self.assertEqual(est._coefs, inner_est._coefs)

        preds = est.predict(self.data.values)
        self.assertEqual(preds.shape, (10, ))

    def test_sklearn_probabilities(self):
        # test multi-class
        self.data['target'] = [0] * 5 + [1] * 3 + [2] * 2
        inner_est = linear_model.LogisticRegression()
        est = wrap_sklearn_like_estimator(inner_est)
        x = self.data[['a', 'b']]
        est.fit(x, self.data.target)
        preds = est.predict(x)
        self.assertEqual(preds.shape, (10, 3))

        # test binary, single output
        self.data['target'] = [0] * 5 + [1] * 5
        est = BinaryProbabilities(inner_est)
        x = self.data[['a', 'b']]
        est.fit(x, self.data.target)
        preds = est.predict(x)
        self.assertEqual(preds.shape, (10, ))

if __name__ == '__main__':
    unittest.main()


text:
CKEDITOR.plugins.setLang( 'table', 'et', {
	border: 'Joone suurus',
	caption: 'Tabeli tiitel',
	cell: {
		menu: 'Lahter',
		insertBefore: 'Sisesta lahter enne',
		insertAfter: 'Sisesta lahter peale',
		deleteCell: 'Eemalda lahtrid',
		merge: 'Ühenda lahtrid',
		mergeRight: 'Ühenda paremale',
		mergeDown: 'Ühenda alla',
		splitHorizontal: 'Poolita lahter horisontaalselt',
		splitVertical: 'Poolita lahter vertikaalselt',
		title: 'Lahtri omadused',
		cellType: 'Lahtri liik',
		rowSpan: 'Ridade vahe',
		colSpan: 'Tulpade vahe',
		wordWrap: 'Sõnade murdmine',
		hAlign: 'Horisontaalne joondus',
		vAlign: 'Vertikaalne joondus',
		alignBaseline: 'Baasjoon',
		bgColor: 'Tausta värv',
		borderColor: 'Äärise värv',
		data: 'Andmed',
		header: 'Päis',
		yes: 'Jah',
		no: 'Ei',
		invalidWidth: 'Lahtri laius peab olema number.',
		invalidHeight: 'Lahtri kõrgus peab olema number.',
		invalidRowSpan: 'Ridade vahe peab olema täisarv.',
		invalidColSpan: 'Tulpade vahe peab olema täisarv.',
		chooseColor: 'Vali'
	},
	cellPad: 'Lahtri täidis',
	cellSpace: 'Lahtri vahe',
	column: {
		menu: 'Veerg',
		insertBefore: 'Sisesta veerg enne',
		insertAfter: 'Sisesta veerg peale',
		deleteColumn: 'Eemalda veerud'
	},
	columns: 'Veerud',
	deleteTable: 'Kustuta tabel',
	headers: 'Päised',
	headersBoth: 'Mõlemad',
	headersColumn: 'Esimene tulp',
	headersNone: 'Puudub',
	headersRow: 'Esimene rida',
	invalidBorder: 'Äärise suurus peab olema number.',
	invalidCellPadding: 'Lahtrite polsterdus (padding) peab olema positiivne arv.',
	invalidCellSpacing: 'Lahtrite vahe peab olema positiivne arv.',
	invalidCols: 'Tulpade arv peab olema nullist suurem.',
	invalidHeight: 'Tabeli kõrgus peab olema number.',
	invalidRows: 'Ridade arv peab olema nullist suurem.',
	invalidWidth: 'Tabeli laius peab olema number.',
	menu: 'Tabeli omadused',
	row: {
		menu: 'Rida',
		insertBefore: 'Sisesta rida enne',
		insertAfter: 'Sisesta rida peale',
		deleteRow: 'Eemalda read'
	},
	rows: 'Read',
	summary: 'Kokkuvõte',
	title: 'Tabeli omadused',
	toolbar: 'Tabel',
	widthPc: 'protsenti',
	widthPx: 'pikslit',
	widthUnit: 'laiuse ühik'
});


text:
<?php

namespace BankId\Merchant\Library\Schemas\saml\assertion;

/**
 * Class representing AuthnContext
 */
class AuthnContext extends AuthnContextType
{

}


text:
__author__ = """Chris Tabor (dxdstudio@gmail.com)"""

if __name__ == '__main__':
    from os import getcwd
    from os import sys
    sys.path.append(getcwd())

from MOAL.helpers.display import Section
from pprint import pprint as ppr

DEBUG = True if __name__ == '__main__' else False

class WingedEdgeFace:

    def __init__(self, orient, data={}):
        self.name = orient
        self.data = data

class WingedEdgeEdge:

    def __init__(self, edge, data={}):
        self.name = edge
        self.data = data

class WingedEdgeVertex:

    def __init__(self, start, end, data={}):
        self.vertices = start, end
        self.data = data

class WingedEdgeTraversal:

    def __init__(self, pred, succ):
        self.data = pred, succ

class WingedEdge:

    def __init__(self, *args, **kwargs):
        self.faces = []
        self.edges = []
        self.vertices = []
        self.left_trav = []
        self.right_trav = []

    def add_traversal(self, *args, **kwargs):
        orient = kwargs.get('orient')
        if orient is 'left':
            self.left_trav.append(WingedEdgeTraversal(*args))
        else:
            self.right_trav.append(WingedEdgeTraversal(*args))

    def add_vertices(self, start, end):
        self.vertices.append(WingedEdgeVertex(start, end))

    def add_face(self, left, right):
        self.faces.append((WingedEdgeFace(left), WingedEdgeFace(right)))

    def add_edge(self, edge_name):
        self.edges.append(WingedEdgeEdge(edge_name))

    def __str__(self):
        ppr(self.faces)
        ppr(self.edges)
        ppr(self.vertices)
        ppr(self.left_trav)
        ppr(self.right_trav)
        return ''

if DEBUG:
    with Section('Data structure - winged edge'):
        # Information from:
        # http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/model/winged-e.html

        we = WingedEdge()
        map(we.add_edge, ['a', 'b', 'c', 'd', 'e', 'f'])
        we.add_vertices('A', 'D')
        we.add_vertices('A', 'B')
        we.add_vertices('B', 'D')
        we.add_vertices('B', 'C')
        we.add_vertices('C', 'D')
        we.add_vertices('A', 'C')

        we.add_face(3, 1)
        we.add_face(1, 4)
        we.add_face(1, 2)
        we.add_face(2, 4)
        we.add_face(2, 3)
        we.add_face(4, 3)

        we.add_traversal('e', 'f')
        we.add_traversal('c', 'a'),
        we.add_traversal('a', 'b')
        we.add_traversal('e', 'c'),
        we.add_traversal('c', 'd')
        we.add_traversal('d', 'b')

        we.add_traversal('b', 'c', orient='right')
        we.add_traversal('f', 'd', orient='right')
        we.add_traversal('d', 'e', orient='right')
        we.add_traversal('d', 'f', orient='right')
        we.add_traversal('b', 'a', orient='right')

        print(we)


text:
// SPDX-License-Identifier: BSD-3-Clause
package org.xbill.DNS;

import java.io.IOException;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Base64;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.function.Supplier;
import java.util.stream.Collectors;

/**
 * Implements common functionality for SVCB and HTTPS records
 *
 * @see <a
 *     href="https://tools.ietf.org/html/draft-ietf-dnsop-svcb-https-06">draft-ietf-dnsop-svcb-https</a>
 * @since 3.3
 */
public abstract class SVCBBase extends Record {
  protected int svcPriority;
  protected Name targetName;
  protected final Map<Integer, ParameterBase> svcParams;

  public static final int MANDATORY = 0;
  public static final int ALPN = 1;
  public static final int NO_DEFAULT_ALPN = 2;
  public static final int PORT = 3;
  public static final int IPV4HINT = 4;
  public static final int ECH = 5;
  public static final int IPV6HINT = 6;
  /** @deprecated use {@link #ECH} */
  @Deprecated public static final int ECHCONFIG = 5;

  protected SVCBBase() {
    svcParams = new TreeMap<>();
  }

  protected SVCBBase(Name name, int type, int dclass, long ttl) {
    super(name, type, dclass, ttl);
    svcParams = new TreeMap<>();
  }

  protected SVCBBase(
      Name name,
      int type,
      int dclass,
      long ttl,
      int priority,
      Name domain,
      List<ParameterBase> params) {
    super(name, type, dclass, ttl);
    svcPriority = priority;
    targetName = domain;
    svcParams = new TreeMap<>();
    for (ParameterBase param : params) {
      if (svcParams.containsKey(param.getKey())) {
        throw new IllegalArgumentException("Duplicate SvcParam for key " + param.getKey());
      }
      svcParams.put(param.getKey(), param);
    }
  }

  public int getSvcPriority() {
    return svcPriority;
  }

  public Name getTargetName() {
    return targetName;
  }

  public Set<Integer> getSvcParamKeys() {
    return svcParams.keySet();
  }

  public ParameterBase getSvcParamValue(int key) {
    return svcParams.get(key);
  }

  private static class ParameterMnemonic extends Mnemonic {
    private final HashMap<Integer, Supplier<ParameterBase>> factories;

    public ParameterMnemonic() {
      super("SVCB/HTTPS Parameters", Mnemonic.CASE_LOWER);
      setPrefix("key");
      setNumericAllowed(true);
      setMaximum(0xFFFF);
      factories = new HashMap<>();
    }

    public void add(int val, String str, Supplier<ParameterBase> factory) {
      super.add(val, str);
      factories.put(val, factory);
    }

    public Supplier<ParameterBase> getFactory(int val) {
      return factories.get(val);
    }
  }

  private static final ParameterMnemonic parameters = new ParameterMnemonic();

  static {
    parameters.add(MANDATORY, "mandatory", ParameterMandatory::new);
    parameters.add(ALPN, "alpn", ParameterAlpn::new);
    parameters.add(NO_DEFAULT_ALPN, "no-default-alpn", ParameterNoDefaultAlpn::new);
    parameters.add(PORT, "port", ParameterPort::new);
    parameters.add(IPV4HINT, "ipv4hint", ParameterIpv4Hint::new);
    parameters.add(ECH, "ech", ParameterEch::new);
    parameters.add(IPV6HINT, "ipv6hint", ParameterIpv6Hint::new);
    /* Support obsolete echconfig name as an alias for ech */
    parameters.addAlias(ECH, "echconfig");
  }

  public abstract static class ParameterBase {
    public ParameterBase() {}

    public abstract int getKey();

    public abstract void fromWire(byte[] bytes) throws IOException;

    public abstract void fromString(String string) throws IOException;

    public abstract byte[] toWire();

    @Override
    public abstract String toString();

    // Split string on commas, but not if comma is escaped with a '\'
    public static String[] splitStringWithEscapedCommas(String string) {
      return string.split("(?<!\\\\),");
    }
  }

  public static class ParameterMandatory extends ParameterBase {
    private final List<Integer> values;

    public ParameterMandatory() {
      super();
      values = new ArrayList<>();
    }

    public ParameterMandatory(List<Integer> values) {
      super();
      this.values = values;
    }

    public List<Integer> getValues() {
      return values;
    }

    @Override
    public int getKey() {
      return MANDATORY;
    }

    @Override
    public void fromWire(byte[] bytes) throws IOException {
      values.clear();
      DNSInput in = new DNSInput(bytes);
      while (in.remaining() >= 2) {
        int key = in.readU16();
        values.add(key);
      }
      if (in.remaining() > 0) {
        throw new WireParseException("Unexpected number of bytes in mandatory parameter");
      }
    }

    @Override
    public void fromString(String string) throws TextParseException {
      values.clear();
      if (string == null || string.isEmpty()) {
        throw new TextParseException("Non-empty list must be specified for mandatory");
      }
      for (String str : splitStringWithEscapedCommas(string)) {
        int key = parameters.getValue(str);
        if (key == MANDATORY) {
          throw new TextParseException("Key mandatory must not appear in its own list");
        }
        if (values.contains(key)) {
          throw new TextParseException("Duplicate key " + str + " not allowed in mandatory list");
        }
        values.add(key);
      }
    }

    @Override
    public byte[] toWire() {
      DNSOutput out = new DNSOutput();
      for (Integer val : values) {
        out.writeU16(val);
      }
      return out.toByteArray();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      for (Integer val : values) {
        if (sb.length() > 0) {
          sb.append(",");
        }
        sb.append(parameters.getText(val));
      }
      return sb.toString();
    }
  }

  public static class ParameterAlpn extends ParameterBase {
    private final List<byte[]> values;

    public ParameterAlpn() {
      super();
      values = new ArrayList<>();
    }

    public ParameterAlpn(List<String> values) throws TextParseException {
      super();
      this.values = new ArrayList<>();
      for (String str : values) {
        this.values.add(byteArrayFromString(str));
      }
    }

    public List<String> getValues() {
      List<String> values = new ArrayList<>();
      for (byte[] b : this.values) {
        values.add(byteArrayToString(b, false));
      }
      return values;
    }

    @Override
    public int getKey() {
      return ALPN;
    }

    @Override
    public void fromWire(byte[] bytes) throws IOException {
      values.clear();
      DNSInput in = new DNSInput(bytes);
      while (in.remaining() > 0) {
        byte[] b = in.readCountedString();
        values.add(b);
      }
    }

    @Override
    public void fromString(String string) throws TextParseException {
      values.clear();
      if (string == null || string.isEmpty()) {
        throw new TextParseException("Non-empty list must be specified for alpn");
      }
      for (String str : splitStringWithEscapedCommas(string)) {
        values.add(byteArrayFromString(str));
      }
    }

    @Override
    public byte[] toWire() {
      DNSOutput out = new DNSOutput();
      for (byte[] b : values) {
        out.writeCountedString(b);
      }
      return out.toByteArray();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      for (byte[] b : values) {
        if (sb.length() > 0) {
          sb.append(",");
        }
        String str = byteArrayToString(b, false);
        str = str.replace(",", "\\,");
        sb.append(str);
      }
      return sb.toString();
    }
  }

  public static class ParameterNoDefaultAlpn extends ParameterBase {
    public ParameterNoDefaultAlpn() {
      super();
    }

    @Override
    public int getKey() {
      return NO_DEFAULT_ALPN;
    }

    @Override
    public void fromWire(byte[] bytes) throws WireParseException {
      if (bytes.length > 0) {
        throw new WireParseException("No value can be specified for no-default-alpn");
      }
    }

    @Override
    public void fromString(String string) throws TextParseException {
      if (string != null && !string.isEmpty()) {
        throw new TextParseException("No value can be specified for no-default-alpn");
      }
    }

    @Override
    public byte[] toWire() {
      return new byte[0];
    }

    @Override
    public String toString() {
      return "";
    }
  }

  public static class ParameterPort extends ParameterBase {
    private int port;

    public ParameterPort() {
      super();
    }

    public ParameterPort(int port) {
      super();
      this.port = port;
    }

    public int getPort() {
      return port;
    }

    @Override
    public int getKey() {
      return PORT;
    }

    @Override
    public void fromWire(byte[] bytes) throws IOException {
      DNSInput in = new DNSInput(bytes);
      port = in.readU16();
      if (in.remaining() > 0) {
        throw new WireParseException("Unexpected number of bytes in port parameter");
      }
    }

    @Override
    public void fromString(String string) throws TextParseException {
      if (string == null || string.isEmpty()) {
        throw new TextParseException("Integer value must be specified for port");
      }
      port = Integer.parseInt(string);
    }

    @Override
    public byte[] toWire() {
      DNSOutput out = new DNSOutput();
      out.writeU16(port);
      return out.toByteArray();
    }

    @Override
    public String toString() {
      return Integer.toString(port);
    }
  }

  public static class ParameterIpv4Hint extends ParameterBase {
    private final List<byte[]> addresses;

    public ParameterIpv4Hint() {
      super();
      addresses = new ArrayList<>();
    }

    public ParameterIpv4Hint(List<Inet4Address> addresses) {
      super();
      this.addresses =
          addresses.stream().map(Inet4Address::getAddress).collect(Collectors.toList());
    }

    public List<Inet4Address> getAddresses() throws UnknownHostException {
      List<Inet4Address> addresses = new LinkedList<>();
      for (byte[] bytes : this.addresses) {
        InetAddress address = InetAddress.getByAddress(bytes);
        if (address instanceof Inet4Address) {
          addresses.add((Inet4Address) address);
        }
      }
      return addresses;
    }

    @Override
    public int getKey() {
      return IPV4HINT;
    }

    @Override
    public void fromWire(byte[] bytes) throws IOException {
      addresses.clear();
      DNSInput in = new DNSInput(bytes);
      while (in.remaining() >= 4) {
        addresses.add(in.readByteArray(4));
      }
      if (in.remaining() > 0) {
        throw new WireParseException("Unexpected number of bytes in ipv4hint parameter");
      }
    }

    @Override
    public void fromString(String string) throws IOException {
      addresses.clear();
      if (string == null || string.isEmpty()) {
        throw new TextParseException("Non-empty IPv4 list must be specified for ipv4hint");
      }
      for (String str : string.split(",")) {
        byte[] address = Address.toByteArray(str, Address.IPv4);
        if (address == null) {
          throw new TextParseException("Invalid ipv4hint value '" + str + "'");
        }
        addresses.add(address);
      }
    }

    @Override
    public byte[] toWire() {
      DNSOutput out = new DNSOutput();
      for (byte[] b : addresses) {
        out.writeByteArray(b);
      }
      return out.toByteArray();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      for (byte[] b : addresses) {
        if (sb.length() > 0) {
          sb.append(",");
        }
        sb.append(Address.toDottedQuad(b));
      }
      return sb.toString();
    }
  }

  public static class ParameterEch extends ParameterBase {
    private byte[] data;

    public ParameterEch() {
      super();
    }

    public ParameterEch(byte[] data) {
      super();
      this.data = data;
    }

    public byte[] getData() {
      return data;
    }

    @Override
    public int getKey() {
      return ECH;
    }

    @Override
    public void fromWire(byte[] bytes) {
      data = bytes;
    }

    @Override
    public void fromString(String string) throws TextParseException {
      if (string == null || string.isEmpty()) {
        throw new TextParseException("Non-empty base64 value must be specified for ech");
      }
      data = Base64.getDecoder().decode(string);
    }

    @Override
    public byte[] toWire() {
      return data;
    }

    @Override
    public String toString() {
      return Base64.getEncoder().encodeToString(data);
    }
  }

  /** @deprecated use {@link ParameterEch} */
  @Deprecated
  public static class ParameterEchConfig extends ParameterBase {
    private byte[] data;

    public ParameterEchConfig() {
      super();
    }

    public ParameterEchConfig(byte[] data) {
      super();
      this.data = data;
    }

    public byte[] getData() {
      return data;
    }

    @Override
    public int getKey() {
      return ECHCONFIG;
    }

    @Override
    public void fromWire(byte[] bytes) {
      data = bytes;
    }

    @Override
    public void fromString(String string) throws TextParseException {
      if (string == null || string.isEmpty()) {
        throw new TextParseException("Non-empty base64 value must be specified for echconfig");
      }
      data = Base64.getDecoder().decode(string);
    }

    @Override
    public byte[] toWire() {
      return data;
    }

    @Override
    public String toString() {
      return Base64.getEncoder().encodeToString(data);
    }
  }

  public static class ParameterIpv6Hint extends ParameterBase {
    private final List<byte[]> addresses;

    public ParameterIpv6Hint() {
      super();
      addresses = new ArrayList<>();
    }

    public ParameterIpv6Hint(List<Inet6Address> addresses) {
      super();
      this.addresses =
          addresses.stream().map(Inet6Address::getAddress).collect(Collectors.toList());
    }

    public List<Inet6Address> getAddresses() throws UnknownHostException {
      List<Inet6Address> addresses = new LinkedList<>();
      for (byte[] bytes : this.addresses) {
        InetAddress address = InetAddress.getByAddress(bytes);
        if (address instanceof Inet6Address) {
          addresses.add((Inet6Address) address);
        }
      }
      return addresses;
    }

    @Override
    public int getKey() {
      return IPV6HINT;
    }

    @Override
    public void fromWire(byte[] bytes) throws IOException {
      addresses.clear();
      DNSInput in = new DNSInput(bytes);
      while (in.remaining() >= 16) {
        addresses.add(in.readByteArray(16));
      }
      if (in.remaining() > 0) {
        throw new WireParseException("Unexpected number of bytes in ipv6hint parameter");
      }
    }

    @Override
    public void fromString(String string) throws IOException {
      addresses.clear();
      if (string == null || string.isEmpty()) {
        throw new TextParseException("Non-empty IPv6 list must be specified for ipv6hint");
      }
      for (String str : string.split(",")) {
        byte[] address = Address.toByteArray(str, Address.IPv6);
        if (address == null) {
          throw new TextParseException("Invalid ipv6hint value '" + str + "'");
        }
        addresses.add(address);
      }
    }

    @Override
    public byte[] toWire() {
      DNSOutput out = new DNSOutput();
      for (byte[] b : addresses) {
        out.writeByteArray(b);
      }
      return out.toByteArray();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      for (byte[] b : addresses) {
        if (sb.length() > 0) {
          sb.append(",");
        }
        try {
          InetAddress addr = InetAddress.getByAddress(null, b);
          sb.append(addr.getHostAddress());
        } catch (UnknownHostException e) {
          // should not happen, but returning null and throwing is bad
          return e.getMessage();
        }
      }
      return sb.toString();
    }
  }

  public static class ParameterUnknown extends ParameterBase {
    private final int key;
    private byte[] value;

    public ParameterUnknown(int key) {
      super();
      this.key = key;
      this.value = new byte[0];
    }

    public ParameterUnknown(int key, byte[] value) {
      super();
      this.key = key;
      this.value = value;
    }

    public byte[] getValue() {
      return value;
    }

    @Override
    public int getKey() {
      return key;
    }

    @Override
    public void fromWire(byte[] bytes) {
      value = bytes;
    }

    @Override
    public void fromString(String string) throws IOException {
      if (string == null || string.isEmpty()) {
        value = new byte[0];
      } else {
        value = byteArrayFromString(string);
      }
    }

    @Override
    public byte[] toWire() {
      return value;
    }

    @Override
    public String toString() {
      return byteArrayToString(value, false);
    }
  }

  protected boolean checkMandatoryParams() {
    ParameterMandatory param = (ParameterMandatory) getSvcParamValue(MANDATORY);
    if (param != null) {
      for (int key : param.values) {
        if (getSvcParamValue(key) == null) {
          return false;
        }
      }
    }
    return true;
  }

  @Override
  protected void rrFromWire(DNSInput in) throws IOException {
    svcPriority = in.readU16();
    targetName = new Name(in);
    svcParams.clear();
    while (in.remaining() >= 4) {
      int key = in.readU16();
      int length = in.readU16();
      byte[] value = in.readByteArray(length);
      ParameterBase param;
      Supplier<ParameterBase> factory = parameters.getFactory(key);
      if (factory != null) {
        param = factory.get();
      } else {
        param = new ParameterUnknown(key);
      }
      param.fromWire(value);
      svcParams.put(key, param);
    }
    if (in.remaining() > 0) {
      throw new WireParseException("Record had unexpected number of bytes");
    }
    if (!checkMandatoryParams()) {
      throw new WireParseException("Not all mandatory SvcParams are specified");
    }
  }

  @Override
  protected String rrToString() {
    StringBuilder sb = new StringBuilder();
    sb.append(svcPriority);
    sb.append(" ");
    sb.append(targetName);
    for (Map.Entry<Integer, ParameterBase> entry : svcParams.entrySet()) {
      sb.append(" ");
      sb.append(parameters.getText(entry.getKey()));
      ParameterBase param = entry.getValue();
      String value = param.toString();
      if (value != null && !value.isEmpty()) {
        sb.append("=");
        sb.append(value);
      }
    }
    return sb.toString();
  }

  @Override
  protected void rdataFromString(Tokenizer st, Name origin) throws IOException {
    svcPriority = st.getUInt16();
    targetName = st.getName(origin);
    svcParams.clear();
    while (true) {
      String keyStr = null;
      String valueStr = null;
      Tokenizer.Token t = st.get();
      if (!t.isString()) {
        break;
      }
      int indexOfEquals = t.value().indexOf('=');
      if (indexOfEquals == -1) {
        // No "=" is key with no value case, leave value string as null
        keyStr = t.value();
      } else if (indexOfEquals == t.value().length() - 1) {
        // Ends with "=" means the next token is quoted string with the value
        keyStr = t.value().substring(0, indexOfEquals);
        Tokenizer.Token valueToken = st.get();
        if (!valueToken.isString()) {
          throw new TextParseException("Expected value for parameter key '" + keyStr + "'");
        }
        valueStr = valueToken.value();
      } else if (indexOfEquals > 0) {
        // If "=" is in the middle then need to split the key and value from this token
        keyStr = t.value().substring(0, indexOfEquals);
        valueStr = t.value().substring(indexOfEquals + 1);
      } else {
        throw new TextParseException("Expected valid parameter key=value for '" + t.value() + "'");
      }

      ParameterBase param;
      int key = parameters.getValue(keyStr);
      if (key == -1) {
        throw new TextParseException("Expected a valid parameter key for '" + keyStr + "'");
      }
      if (svcParams.containsKey(key)) {
        throw new TextParseException("Duplicate parameter key for '" + keyStr + "'");
      }
      Supplier<ParameterBase> factory = parameters.getFactory(key);
      if (factory != null) {
        param = factory.get();
      } else {
        param = new ParameterUnknown(key);
      }
      param.fromString(valueStr);
      svcParams.put(key, param);
    }
    st.unget();

    if (svcPriority == 0 && !svcParams.isEmpty()) {
      throw new TextParseException("No parameter values allowed for AliasMode");
    }
    if (!checkMandatoryParams()) {
      throw new TextParseException("Not all mandatory SvcParams are specified");
    }
  }

  @Override
  protected void rrToWire(DNSOutput out, Compression c, boolean canonical) {
    out.writeU16(svcPriority);
    targetName.toWire(out, null, canonical);
    for (Map.Entry<Integer, ParameterBase> entry : svcParams.entrySet()) {
      out.writeU16(entry.getKey());
      ParameterBase param = entry.getValue();
      byte[] value = param.toWire();
      out.writeU16(value.length);
      out.writeByteArray(value);
    }
  }
}


text:
<!DOCTYPE HTML>

	<meta charset="utf-8">
	<title>Twilio Contact Center</title>

	<link rel="stylesheet" href="/styles/bootstrap.min.css" type="text/css" />
	<link rel="stylesheet" href="/styles/default.css" type="text/css" />
	<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css"
	type="text/css" rel="stylesheet" />

Twilio Contact Center

					Well done!
You sucessfully setup the demo.

					Oh snap!

					The environment variable TWILIO_ACCOUNT_SID is not set or incorrect. If you are on Heroku please update your application settings.

					The environment variable TWILIO_AUTH_TOKEN is not set or incorrect. If you are on Heroku please update your application settings.

					The environment variable TWILIO_WORKSPACE_SID is not set or incorrect. If you are on Heroku please update your application settings.

					The application could not access the Twilio API with the provided credentials. Please verify Account Sid and Auth Token.

					The application could not access the your Twilio Taskrouter workspace please verify the Workspace Sid.

					The TwiML Applications SID is not set, please complete http://<your_application>/setup first

					The application could not access the TwiML Application.

Call Center Administration

				A basic administration interface to create and delete new call centre agents.

Open

Call Agent Login

				The working environment for agents. Agents need to open this page and log in.

Open

Company's Website

				Page for customers who want to talk to an agent. Users can request a callback, call the agents via phone, request video support or chat with an agent

					Inbound & Callback Request
					Web Chat
					Video Call


text:
declare namespace PIXI.filters {
    class RGBSplitFilter extends PIXI.Filter<{}> {
        constructor(red?:PIXI.Point, green?:PIXI.Point, blue?:PIXI.Point);
        red:PIXI.Point;
        green:PIXI.Point;
        blue:PIXI.Point;
    }
}

declare module "@pixi/filter-rgb-split" {
    export = PIXI.filters;
}


text:
package jp.co.recruit.mtl.osharetenki.multilinemarqueelibrary;

import android.animation.Animator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.Rect;
import android.os.Handler;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.Display;
import android.view.View;
import android.view.WindowManager;
import android.view.animation.LinearInterpolator;

import java.util.ArrayList;

/**
 * display text view.
 * - automatically start marquee if this view is on screen.
 * - display text of two lines if view's height is enough.
 */
public class MultiLineMarqueeTextView extends View {

	private static final int DEFAULT_TEXT_SIZE_DIPS = 14;
	private static final int INTERVAL_SECOND_TEXT_DIPS = 80;
	private static final long DURATION_TRANSLATE = 3000;
	private static final long DURATION_SUSPEND = 2000;

	private static final String RETURN_CODE = "\n";

	private Paint paint = new Paint();
	private Rect clipping = new Rect();
	private ValueAnimator translateAnimator;
	private ValueAnimator suspendAnimator;
	private String originalText;
	private String[] splitText;

	private int displayWidth;
	private int displayHeight;
	private float textWidth;
	private float textHeight;
	private float adjustTextBaseline;
	private int intervalSecondText;
	private int positionSecondText;

	private boolean needMarquee = false;
	private boolean stoppedMarquee = false;
	private ObserverThread observer;

	private boolean validTapReset = false;

	private Handler handler = new Handler();

	public MultiLineMarqueeTextView(Context context, AttributeSet attrs) {
		super(context, attrs);

		// get display size and density.
		WindowManager windowManager = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
		Display display = windowManager.getDefaultDisplay();
		Point point = new Point();
		display.getSize(point);
		displayWidth = point.x;
		displayHeight = point.y;
		final float density = getResources().getDisplayMetrics().density;

		// load XML settings
		parseXmlSettings(context, attrs, density);

		paint.setAntiAlias(true);

		adjustTextBaseline = paint.descent() + paint.ascent();
		textHeight = Math.abs(paint.getFontMetrics().top) + paint.getFontMetrics().bottom;
		intervalSecondText = (int)(INTERVAL_SECOND_TEXT_DIPS * density);

		LinearInterpolator linearInterpolator = new LinearInterpolator();
		translateAnimator = ValueAnimator.ofFloat(0.0f, -1.0f);
		translateAnimator.setInterpolator(linearInterpolator);
		translateAnimator.removeAllUpdateListeners();
		translateAnimator.addUpdateListener(animatorUpdateListener);
		translateAnimator.removeAllListeners();
		translateAnimator.addListener(animatorListener);
		translateAnimator.setDuration(DURATION_TRANSLATE);

		suspendAnimator = ValueAnimator.ofFloat(0.0f, 0.0f);
		suspendAnimator.setInterpolator(linearInterpolator);
		suspendAnimator.removeAllUpdateListeners();
		suspendAnimator.addUpdateListener(animatorUpdateListener);
		suspendAnimator.removeAllListeners();
		suspendAnimator.addListener(animatorListener);
		suspendAnimator.setDuration(DURATION_SUSPEND);

		changeTapReset();
	}

	public MultiLineMarqueeTextView setText(CharSequence s) {
		if (null != s && 0 < s.length()) {
			originalText = s.toString();
			createDisplayText();
			if (0 < getMeasuredWidth() && 0 < getMeasuredWidth())
				invalidate();
		}
		return this;
	}

	public MultiLineMarqueeTextView setText(int resId) {
		if (0 < resId) {
			originalText = getContext().getString(resId);
			createDisplayText();
			if (0 < getMeasuredWidth() && 0 < getMeasuredWidth())
				invalidate();
		}
		return this;
	}

	public MultiLineMarqueeTextView setTextSize(float textSize) {
		paint.setTextSize(textSize);
		adjustTextBaseline = paint.descent() + paint.ascent();
		textHeight = Math.abs(paint.getFontMetrics().top) + paint.getFontMetrics().bottom;
		return this;
	}

	public MultiLineMarqueeTextView setTextColor(int textColor) {
		paint.setColor(textColor);
		return this;
	}

	public void setTapReset(boolean isValid) {
		validTapReset = isValid;
		changeTapReset();
	}

	public void startMarquee() {
		stoppedMarquee = false;
		if (!translateAnimator.isRunning() && !suspendAnimator.isRunning()) {
			handler.post(new Runnable() {
				@Override
				public void run() {
					suspendAnimator.start();
				}
			});
		}
	}

	public void stopMarquee() {
		if (!stoppedMarquee)
			resetMarquee();
		if (null != observer) {
			observer.finish();
			observer = null;
		}
	}

	public void autoMarquee() {
		if (null == observer) {
			observer = new ObserverThread();
			observer.start();
		} else {
			observer.interrupt();
		}
	}

	private void resetMarquee() {
		stoppedMarquee = true;
		handler.post(new Runnable() {
			@Override
			public void run() {
				suspendAnimator.cancel();
				suspendAnimator.end();
				translateAnimator.cancel();
				translateAnimator.end();
				invalidate();
			}
		});
	}

	private void checkMarquee() {
		// start marquee if needed and this view is on screen. otherwise, stop marquee.
		if (needMarquee) {
			// start if a part of this view is on screen.
			if (hasWindowFocus() && isOnScreen()) {
				startMarquee();
			} else if (!stoppedMarquee) {
				resetMarquee();
			}
		}
	}

	private void changeTapReset() {
		if (validTapReset) {
			setOnClickListener(onClickListener);
		} else {
			setOnClickListener(null);
		}
	}

	@Override
	public void onLayout(boolean changed, int left, int top, int right, int bottom) {
		super.onLayout(changed, left, top, right, bottom);
		if (changed) {
			clipping = new Rect(getPaddingLeft(), getPaddingTop(), getWidth() - getPaddingRight(), getHeight() - getPaddingBottom());
			createDisplayText();
		}
		autoMarquee();
	}

	@Override
	public void onWindowFocusChanged(boolean hasWindowFocus) {
		super.onWindowFocusChanged(hasWindowFocus);
		if (hasWindowFocus && isOnScreen() && isEnabled())
			autoMarquee();
		else
			stopMarquee();
	}

	@Override
	public void onDetachedFromWindow() {
		stopMarquee();
		setText("");
		super.onDetachedFromWindow();
	}

	@Override
	public void onDraw(Canvas canvas) {
		ValueAnimator animator = translateAnimator.isRunning() ? translateAnimator : suspendAnimator;
		int xPos = (int) (positionSecondText * (Float) animator.getAnimatedValue()) + getPaddingLeft();
		int yPos = (int) ((canvas.getHeight() / 2) - (adjustTextBaseline / 2));

		canvas.save();
		canvas.clipRect(clipping);
		if (null != splitText && 0 < splitText.length) {
			Integer[] offsets = createVerticalOffsetsFromBaseline(splitText.length);
			for (int i = 0; i < splitText.length; ++i) {
				canvas.drawText(splitText[i], xPos, yPos + offsets[i], paint);
				canvas.drawText(splitText[i], xPos + positionSecondText, yPos + offsets[i], paint);
			}
		}
		canvas.restore();
	}

	private void parseXmlSettings(Context context, AttributeSet attrs, float density) {
		// parse "android:text"
		String textValue = attrs.getAttributeValue("http://schemas.android.com/apk/res/android", "text");
		if (null == textValue) {
			originalText = "";
		} else {
			if (textValue.startsWith("@")) {
				originalText = context.getString(Integer.valueOf(textValue.replace("@", "")));
			} else {
				originalText = textValue;
			}
		}

		// parse "android:textSize"
		String textSizeValue = attrs.getAttributeValue("http://schemas.android.com/apk/res/android", "textSize");
		float defaultTextSize = DEFAULT_TEXT_SIZE_DIPS * density;
		if (null == textSizeValue) {
			setTextSize(defaultTextSize);
		} else {
			if (textSizeValue.endsWith("dip")) {
				setTextSize(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, Float.valueOf(textSizeValue.replace("dip", "")), getResources().getDisplayMetrics()));
			} else if (textSizeValue.endsWith("sp")) {
				setTextSize(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, Float.valueOf(textSizeValue.replace("sp", "")), getResources().getDisplayMetrics()));
			}
		}

		// parse "android:textColor"
		String textColorValue = attrs.getAttributeValue("http://schemas.android.com/apk/res/android", "textColor");
		if (null != textColorValue) {
			if (textColorValue.startsWith("@")) {
				setTextColor(context.getResources().getColor(Integer.valueOf(textColorValue.replace("@", ""))));
			} else if (textColorValue.startsWith("#")) {
				setTextColor(Color.parseColor(textColorValue));
			}
		}
	}

	private void createDisplayText() {
		if (translateAnimator.isRunning() || suspendAnimator.isRunning()) {
			resetMarquee();
		}
		// if not measured yet, skip without creating text.
		if (0 == getMeasuredWidth() || 0 == getMeasuredHeight()) {
			return;
		}
		int allowedLineCount = (int)((getMeasuredHeight() - getPaddingTop() - getPaddingBottom()) / textHeight);
		if (1 < allowedLineCount) {
			// display text of two lines if view's height is enough.
			String[] temp = originalText.split(RETURN_CODE);
			int lineCount = temp.length;
			if (lineCount > allowedLineCount) {
				splitText = adjustLineText(temp, allowedLineCount);
			} else {
				splitText = temp;
			}
		} else {
			// display text on one line.
			splitText = originalText.replaceAll(RETURN_CODE, "").split(RETURN_CODE);
		}
		textWidth = 0.0f;
		for (String message : splitText) {
			float width = paint.measureText(message);
			if (width > textWidth)
				textWidth = width;
		}
		needMarquee = textWidth > (getMeasuredWidth() - getPaddingLeft() - getPaddingRight());
		if ((textWidth + intervalSecondText) > getMeasuredWidth()) {
			positionSecondText = (int) (textWidth + intervalSecondText);
			// change translate animation duration along the length of text.
			translateAnimator.setDuration(DURATION_TRANSLATE * positionSecondText / getMeasuredWidth());
		} else {
			positionSecondText = getMeasuredWidth();
			// change translate animation duration into default.
			translateAnimator.setDuration(DURATION_TRANSLATE);
		}
	}

	private String[] adjustLineText(String[] text, int adjustLineCount) {
		if (text.length <= adjustLineCount)
			return text;
		float minLength = 0.0f;
		int minIndex = 0;
		// check shortest width which lines when combined any two lines.
		for (int i = 0; i < text.length - 1; ++i) {
			float length = paint.measureText(text[i]) + paint.measureText(" ") + paint.measureText(text[i + 1]);
			if (0.0f == minLength || length < minLength) {
				minLength = length;
				minIndex = i;
			}
		}
		ArrayList<String> combinedText = new ArrayList<String>();
		for (int i = 0; i < text.length; ++i) {
			if (i == minIndex) {
				// shortest width, combine next line.
				combinedText.add(text[i]+" "+text[i + 1]);
			} else if (i == minIndex + 1) {
				// combined line, do nothing.
				continue;
			} else {
				// ordinary
				combinedText.add(text[i]);
			}
		}
		return adjustLineText(combinedText.toArray(new String[0]), adjustLineCount);
	}

	private Integer[] createVerticalOffsetsFromBaseline(int lineCount) {
		ArrayList<Integer> offsets = new ArrayList<Integer>();

		int coefficient = lineCount - 1;
		for (int i = 0; i < lineCount; ++i, coefficient-=2) {
			offsets.add(new Integer((int) (adjustTextBaseline * coefficient)));
		}

		return offsets.toArray(new Integer[0]);
	}

	private boolean isOnScreen() {
		int[] location = new int[2];
		getLocationOnScreen(location);

		if (-getMeasuredWidth() <= location[0] && location[0] < displayWidth && -getMeasuredHeight() <= location[1] && location[1] < displayHeight) {
			return true;
		} else {
			return false;
		}
	}

	private Animator.AnimatorListener animatorListener = new Animator.AnimatorListener() {
		@Override
		public void onAnimationStart(Animator animation) {
		}

		@Override
		public void onAnimationEnd(Animator animation) {
			if (stoppedMarquee || !isEnabled())
				return;
			// run alternately.
			if (animation.equals(translateAnimator)) {
				// start suspend when finished translation.
				suspendAnimator.start();
			}
			if (animation.equals(suspendAnimator)) {
				// start translate animation when finished suspension.
				translateAnimator.start();
			}
		}

		@Override
		public void onAnimationCancel(Animator animation) {
		}

		@Override
		public void onAnimationRepeat(Animator animation) {
		}
	};

	private ValueAnimator.AnimatorUpdateListener animatorUpdateListener = new ValueAnimator.AnimatorUpdateListener() {
		@Override
		public void onAnimationUpdate(ValueAnimator animation) {
			invalidate();
		}
	};

	private OnClickListener onClickListener = new OnClickListener() {
		@Override
		public void onClick(View v) {
			resetMarquee();
		}
	};

	private class ObserverThread extends Thread {
		private boolean requestedFinish = false;

		@Override
		public void run() {
			while (true) {
				if (requestedFinish)
					break;
				checkMarquee();
				try {
					Thread.sleep(100);
				} catch (InterruptedException e) {
				}
			}
		}

		public void finish() {
			requestedFinish = true;
		}
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL.Mapper;
using System.Text;

namespace HRM.HR_Managment.Definition.FunctionalLevel
{
    public partial class List : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["FunctionalLevelId"] != null && Request.QueryString["action"] == "delete")
            {
                try
                {
                new FunctionalLevelMapper().Delete(new Entities.FunctionalLevelEntity() { Id = Convert.ToInt32(Request.QueryString["FunctionalLevelId"]) });
                }
                catch (Exception)
                {

                    StringBuilder sb = new StringBuilder();
                    sb.Append("<script language='javascript'>displayNoty('This Functional Level is being used by other entities and it cannot be deleted. Maybe you should change the status of the Functional Level to Pasive.');</script>");

                    // if the script is not already registered
                    if (!Page.ClientScript.IsClientScriptBlockRegistered(Page.GetType(), "HeyPopup"))
                        ClientScript.RegisterClientScriptBlock(Page.GetType(), "HeyPopup", sb.ToString());
                }
            }
        }
    }
}


text:
                     // http://audiere.sourceforge.net/ or comment
                     // the 'define USE_AUDIERE' above.
using namespace audiere;
#pragma comment (lib, "audiere.lib")
#endif

using namespace irr;
const int CAMERA_COUNT = 7;

class CDemo : public IEventReceiver
{
public:

	CDemo(bool fullscreen, bool music, bool shadows, bool additive, bool vsync, video::E_DRIVER_TYPE driver);

	~CDemo();

	void run();

	virtual bool OnEvent(SEvent event);

private:

	void createLoadingScreen();
	void loadSceneData();
	void switchToNextScene();
	void shoot();
	void createParticleImpacts();

	bool fullscreen;
	bool music;
	bool shadows;
	bool additive;
	bool vsync;
	video::E_DRIVER_TYPE driverType;
	IrrlichtDevice *device;

#ifdef USE_AUDIERE
	void startAudiere();
	AudioDevicePtr audiereDevice;
	OutputStreamPtr stream;
	OutputStreamPtr ballSound;
	OutputStreamPtr impactSound;
#endif

	struct SParticleImpact
	{
		u32 when;
		core::vector3df pos;
		core::vector3df outVector;
	};

	int currentScene;
	video::SColor backColor;

	gui::IGUIStaticText* statusText;
	gui::IGUIInOutFader* inOutFader;

	scene::IAnimatedMesh* quakeLevelMesh;
	scene::ISceneNode* quakeLevelNode;
	scene::ISceneNode* skyboxNode;
	scene::IAnimatedMeshSceneNode* model1;
	scene::IAnimatedMeshSceneNode* model2;
	scene::IParticleSystemSceneNode* campFire;

	scene::IMetaTriangleSelector* metaSelector;
	scene::ITriangleSelector* mapSelector;

	u32 sceneStartTime;
	u32 timeForThisScene;

	core::array<SParticleImpact> Impacts;
};

#endif


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="d105cb1d-a475-45db-906d-79624f5de7d5" name="Default" comment="" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="FileEditorManager">
    <leaf>
      <file leaf-file-name="__init__.py" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/accounts/user/__init__.py">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="440">
              <caret line="31" column="135" lean-forward="false" selection-start-line="31" selection-start-column="135" selection-end-line="31" selection-end-column="135" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="FindInProjectRecents">
    <findStrings>
      <find>search_username</find>
    </findStrings>
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/accounts/urls.py" />
        <option value="$PROJECT_DIR$/templates/user/userlist.html" />
        <option value="$PROJECT_DIR$/accounts/user/__init__.py" />
      </list>
    </option>
  </component>
  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsGulpfileManager">
    <detection-done>true</detection-done>
    <sorting>DEFINITION_ORDER</sorting>
  </component>
  <component name="ProjectFrameBounds" extendedState="6">
    <option name="x" value="63" />
    <option name="y" value="110" />
    <option name="width" value="1619" />
    <option name="height" value="920" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
      <manualOrder />
      <foldersAlwaysOnTop value="true" />
    </navigator>
    <panes>
      <pane id="ProjectPane">
        <subPane>
          <expand>
            <path>
              <item name="opsweb" type="b2602c69:ProjectViewProjectNode" />
              <item name="opsweb" type="462c0819:PsiDirectoryNode" />
            </path>
          </expand>
          <select />
        </subPane>
      </pane>
      <pane id="Scratches" />
      <pane id="Scope" />
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
    <property name="WebServerToolWindowFactoryState" value="false" />
  </component>
  <component name="RunDashboard">
    <option name="ruleStates">
      <list>
        <RuleState>
          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
        </RuleState>
        <RuleState>
          <option name="name" value="StatusDashboardGroupingRule" />
        </RuleState>
      </list>
    </option>
  </component>
  <component name="RunManager">
    <configuration name="opsweb" type="Python.DjangoServer" factoryName="Django server">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="PARENT_ENVS" value="true" />
      <envs>
        <env name="DJANGO_SETTINGS_MODULE" value="opsweb.settings" />
        <env name="PYTHONUNBUFFERED" value="1" />
      </envs>
      <option name="SDK_HOME" value="ssh://root@192.168.8.114:22/home/django-demo/env/bin/python2.7" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="IS_MODULE_SDK" value="false" />
      <option name="ADD_CONTENT_ROOTS" value="true" />
      <option name="ADD_SOURCE_ROOTS" value="true" />
      <module name="opsweb" />
      <option name="launchJavascriptDebuger" value="false" />
      <option name="port" value="8000" />
      <option name="host" value="0.0.0.0" />
      <option name="additionalOptions" value="" />
      <option name="browserUrl" value="" />
      <option name="runTestServer" value="false" />
      <option name="runNoReload" value="false" />
      <option name="useCustomRunCommand" value="false" />
      <option name="customRunCommand" value="" />
    </configuration>
  </component>
  <component name="ShelveChangesManager" show_recycled="false">
    <option name="remove_strategy" value="false" />
  </component>
  <component name="SvnConfiguration">
    <configuration />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="d105cb1d-a475-45db-906d-79624f5de7d5" name="Default" comment="" />
      <created>1516777309774</created>
      <option name="number" value="Default" />
      <option name="presentableId" value="Default" />
      <updated>1516777309774</updated>
    </task>
    <servers />
  </component>
  <component name="ToolWindowManager">
    <frame x="-8" y="-8" width="1616" height="876" extended-state="6" />
    <editor active="true" />
    <layout>
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
      <window_info id="File Transfer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.34952766" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.3360324" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.13753213" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="Docker" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="SciView" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="TypeScriptGeneratedFilesManager">
    <option name="version" value="1" />
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager />
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/accounts/urls.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="462">
          <caret line="23" column="41" lean-forward="true" selection-start-line="23" selection-start-column="41" selection-end-line="23" selection-end-column="41" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/templates/user/userlist.html">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="132">
          <caret line="33" column="37" lean-forward="false" selection-start-line="33" selection-start-column="37" selection-end-line="33" selection-end-column="37" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/accounts/user/__init__.py">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="440">
          <caret line="31" column="135" lean-forward="false" selection-start-line="31" selection-start-column="135" selection-end-line="31" selection-end-column="135" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
namespace Devbridge.AzureMessaging.Interfaces
{
    public interface IAzureQueueClientFactory
    {
        IAzureQueueClient Create(string queueName, bool checkIfExists = false);
    }
}


text:
package org.jkiss.dbeaver.ui.editors.internal;

import org.eclipse.osgi.util.NLS;

public class EditorsMessages extends NLS {
	static final String BUNDLE_NAME = "org.jkiss.dbeaver.ui.editors.internal.EditorsResources"; //$NON-NLS-1$

	public static String dialog_struct_columns_select_error_load_columns_message;
	public static String dialog_struct_columns_select_error_load_columns_title;
	public static String dialog_struct_columns_select_group_columns;
	public static String dialog_struct_columns_select_label_table;
	public static String dialog_struct_columns_select_title;
	public static String dialog_struct_create_entity_group_name;
	public static String dialog_struct_create_entity_title;
	public static String dialog_struct_create_procedure_combo_type;
	public static String dialog_struct_create_procedure_label_name;
	public static String dialog_struct_create_procedure_title;
	public static String dialog_struct_create_procedure_container;
	public static String dialog_struct_create_sequence_title;
	public static String dialog_struct_create_sequence_name;
	public static String dialog_struct_create_sequence_container;
	public static String dialog_struct_edit_constrain_label_type;
	public static String dialog_struct_edit_fk_column_col_type;
	public static String dialog_struct_edit_fk_column_column;
	public static String dialog_struct_edit_fk_column_ref_col;
	public static String dialog_struct_edit_fk_column_ref_col_type;
	public static String dialog_struct_edit_fk_combo_on_delete;
	public static String dialog_struct_edit_fk_combo_on_update;
	public static String dialog_struct_edit_fk_combo_unik;
	public static String dialog_struct_edit_fk_name;
	public static String dialog_struct_edit_fk_error_load_constraint_columns_message;
	public static String dialog_struct_edit_fk_error_load_constraint_columns_title;
	public static String dialog_struct_edit_fk_error_load_constraints_message;
	public static String dialog_struct_edit_fk_error_load_constraints_title;
	public static String dialog_struct_edit_fk_label_columns;
	public static String dialog_struct_edit_fk_label_ref_table;
	public static String dialog_struct_edit_fk_label_table;
	public static String dialog_struct_edit_fk_title;
	public static String dialog_struct_edit_index_label_type;

	public static String dialog_struct_columns_select_column;
	public static String dialog_struct_columns_type;

	static {
		// initialize resource bundle
		NLS.initializeMessages(BUNDLE_NAME, EditorsMessages.class);
	}

	private EditorsMessages() {
	}
}


text:
package net.sourceforge.jaad.aac;

/**
 * The SampleBuffer holds the decoded AAC frame. It contains the raw PCM data
 * and its format.
 * @author in-somnia
 */
public class SampleBuffer {

	private int sampleRate, channels, bitsPerSample;
	private double length, bitrate, encodedBitrate;
	private byte[] data;
	private boolean bigEndian;

	public SampleBuffer() {
		data = new byte[0];
		sampleRate = 0;
		channels = 0;
		bitsPerSample = 0;
		bigEndian = true;
	}

	/**
	 * Returns the buffer's PCM data.
	 * @return the audio data
	 */
	public byte[] getData() {
		return data;
	}

	/**
	 * Returns the data's sample rate.
	 * @return the sample rate
	 */
	public int getSampleRate() {
		return sampleRate;
	}

	/**
	 * Returns the number of channels stored in the data buffer.
	 * @return the number of channels
	 */
	public int getChannels() {
		return channels;
	}

	/**
	 * Returns the number of bits per sample. Usually this is 16, meaning a
	 * sample is stored in two bytes.
	 * @return the number of bits per sample
	 */
	public int getBitsPerSample() {
		return bitsPerSample;
	}

	/**
	 * Returns the length of the current frame in seconds.
	 * length = samplesPerChannel / sampleRate
	 * @return the length in seconds
	 */
	public double getLength() {
		return length;
	}

	/**
	 * Returns the bitrate of the decoded PCM data.
	 * bitrate = (samplesPerChannel * bitsPerSample) / length
	 * @return the bitrate
	 */
	public double getBitrate() {
		return bitrate;
	}

	/**
	 * Returns the AAC bitrate of the current frame.
	 * @return the AAC bitrate
	 */
	public double getEncodedBitrate() {
		return encodedBitrate;
	}

	/**
	 * Indicates the endianness for the data.
	 *
	 * @return true if the data is in big endian, false if it is in little endian
	 */
	public boolean isBigEndian() {
		return bigEndian;
	}

	/**
	 * Sets the endianness for the data.
	 *
	 * @param bigEndian if true the data will be in big endian, else in little
	 * endian
	 */
	public void setBigEndian(boolean bigEndian) {
		if(bigEndian!=this.bigEndian) {
			byte tmp;
			for(int i = 0; i<data.length; i += 2) {
				tmp = data[i];
				data[i] = data[i+1];
				data[i+1] = tmp;
			}
			this.bigEndian = bigEndian;
		}
	}

	public void setData(byte[] data, int sampleRate, int channels, int bitsPerSample, int bitsRead) {
		this.data = data;
		this.sampleRate = sampleRate;
		this.channels = channels;
		this.bitsPerSample = bitsPerSample;

		if(sampleRate==0) {
			length = 0;
			bitrate = 0;
			encodedBitrate = 0;
		}
		else {
			final int bytesPerSample = bitsPerSample/8; //usually 2
			final int samplesPerChannel = data.length/(bytesPerSample*channels); //=1024
			length = (double) samplesPerChannel/(double) sampleRate;
			bitrate = (double) (samplesPerChannel*bitsPerSample*channels)/length;
			encodedBitrate = (double) bitsRead/length;
		}
	}
}


text:
'use strict';

var calculateUpdate = require('./index'),
    range = require('./index').range;

var expect = require('chai').expect;

var expectUpdate = function(desc, oldString, newString) {
  createTest(it, desc, oldString, newString);
};

expectUpdate.only = function(desc, oldString, newString) {
  createTest(it.only, desc, oldString, newString);
};

describe('selection-update', function() {

  describe('should handle select ALL', function() {

    expectUpdate('content removed from middle', '|AABBC|', 'AA|C');

    expectUpdate('content added in middle', '|AABBC|', 'AAVV|BBC');

  });

  describe('should handle same string update', function() {

    expectUpdate('keep mid selection', 'AABB|CCC', 'AABB|CCC');

    expectUpdate('keep start selection', '|AABBCCC', '|AABBCCC');

    expectUpdate('keep end selection', 'AABBCCC|', 'AABBCCC|');

  });

  describe('should handle empty string', function() {

    expectUpdate('content added', '|', 'AAA|');

  });

  describe('should modify cursor adding content', function() {

    expectUpdate('after cursor', 'AA|BBC', 'AABBCVV|');

    expectUpdate('directly after cursor', 'AA|BBC', 'AAVV|BBC');

    expectUpdate('before cursor', 'AA|BBC', 'VV|AABBC');

    expectUpdate('directly before cursor', 'AA|BBC', 'AAVV|BBC');

    expectUpdate('same string add', 'AA|', 'AAAA|');

    expectUpdate('same string add in middle', 'AAAT|F', 'AAATTT|F');

    expectUpdate('same string add in middle (2)', 'AAAT|TF', 'AAATTT|TF');

  });

  describe('should modify cursor removing content', function() {

    expectUpdate('after cursor', 'AA|BBVVC', 'AABB|C');

    expectUpdate('directly after cursor', 'AABB|VVC', 'AA|VVC');

    expectUpdate('before cursor', 'AAVVBB|C', 'AA|BBC');

    expectUpdate('directly before cursor', 'AABB|VVC', 'AA|VVC');

    expectUpdate('same string remove', 'AAAA|', 'AA|');

    expectUpdate('same string remove from middle', 'AAATTT|F', 'AAAT|F');

    expectUpdate('same string remove from middle (2)', 'AAATTT|TF', 'AAAT|TF');
  });

  describe('should handle replace', function() {

    expectUpdate('longer text', 'AA|BB', 'XXFFOOLL|');

    expectUpdate('shorter text', 'XXFFOO|LL', 'XX|AABB');

    expectUpdate('same length text, end selection', 'FOO|', 'BAR|');

  });

});

function createTest(it, desc, oldString, newString) {

  it('(' + oldString + ') => (' + newString + ') - ' + desc, function() {

    var oldStart, oldEnd;

    oldStart = oldString.indexOf('|');

    if (oldStart === -1) {
      throw new Error('no start cursor (|) in old string');
    }

    oldEnd = oldString.indexOf('|', oldStart + 1);

    if (oldEnd === -1) {
      oldEnd = oldStart;
    } else {
      oldEnd = oldEnd - 1;
    }

    oldString = oldString.replace(/\|/g, '');

    var newStart, newEnd;

    newStart = newString.indexOf('|');

    if (newStart === -1) {
      throw new Error('no start cursor (|) in new string');
    }

    newEnd = newString.indexOf('|', newStart + 1);

    if (newEnd === -1) {
      newEnd = newStart;
    } else {
      newEnd = newEnd - 1;
    }

    newString = newString.replace(/\|/g, '');

    // when
    var oldSelection = range(oldStart, oldEnd);
    var newSelection = calculateUpdate(oldSelection, oldString, newString);

    // then
    expect(newSelection).to.eql(range(newStart, newEnd));

  });
}


text:
package game.gamescreens;

import com.googlecode.lanterna.input.KeyStroke;
import com.googlecode.lanterna.input.KeyType;
import game.Window;
import game.graphics.AsciiArt;

public class SplashScreen implements GameScreen {

    private static final String ASCII_FILE_PATH = "/asciiart.xml";
    private static final String ASCII_ART_MAIN_TITLE = "splashscreen";
    private static final String ASCII_ART_EXTRA_TITLE = "splashscreenExtra";
    private static final int ASCII_ART_EXTRA_TOP_MARGIN = 12; /* rows between top of
                                                          artMain and top of artExtra*/
    private AsciiArt artMain;
    private AsciiArt artExtra;
    private int state; /* Keeps track of state of the screen.
     0 = displaying artMain, 1 = displaying artExtra, 2 = next screen */

    public SplashScreen() {
        artMain = new AsciiArt(ASCII_FILE_PATH, ASCII_ART_MAIN_TITLE);
        artExtra = new AsciiArt(ASCII_FILE_PATH, ASCII_ART_EXTRA_TITLE);
        state = 0;
    }

    public boolean canDisplayScreen(int width, int height) {
        return width >= artMain.getWidth() && height >= artMain.getHeight();
    }

    public GameScreen.ScreenType handleInput(KeyStroke ks, long delta) {
        KeyType kt = ks.getKeyType();
        if (kt == KeyType.Enter) { state++; }
        // process return
        if(state >= 2) { return ScreenType.MAIN_MENU; }
        else { return ScreenType.CURRENT; }
    }

    public void render(Window window) {
        int row = (window.getScreenHeight() - artMain.getHeight()) / 2;
        int col = (window.getScreenWidth() - artMain.getWidth()) / 2;
        artMain.render(window, col, row);
        if(state >= 1) {
            artExtra.render(window, col, row + ASCII_ART_EXTRA_TOP_MARGIN);
        }
    }

}


text:
require 'spec_helper'

describe RuboCop::Cop::Style::Documentation do

  subject(:cop) { described_class.new(config) }
  let(:config) do
    RuboCop::Config.new('Style/CommentAnnotation' => {
                          'Keywords' => %w(TODO FIXME OPTIMIZE HACK REVIEW)
                        })
  end

  it 'registers an offense for non-empty class' do
    inspect_source(cop,
                   ['class My_Class',
                    '  TEST = 20',
                    'end'
                   ])
    expect(cop.offenses.size).to eq(1)
  end

  it 'does not consider comment followed by empty line to be class ' \
     'documentation' do
    inspect_source(cop,
                   ['# Copyright 2014',
                    '# Some company',
                    '',
                    'class My_Class',
                    '  TEST = 20',
                    'end'
                   ])
    expect(cop.offenses.size).to eq(1)
  end

  it 'registers an offense for non-namespace' do
    inspect_source(cop,
                   ['module My_Class',
                    '  TEST = 20',
                    'end'
                   ])
    expect(cop.offenses.size).to eq(1)
  end

  it 'registers an offense for empty module without documentation' do
    # Because why would you have an empty module? It requires some
    # explanation.
    inspect_source(cop,
                   ['module Test',
                    'end'
                   ])
    expect(cop.offenses.size).to eq(1)
  end

  it 'accepts non-empty class with documentation' do
    inspect_source(cop,
                   ['# class comment',
                    'class My_Class',
                    '  TEST = 20',
                    'end'
                   ])
    expect(cop.offenses).to be_empty
  end

  it 'registers an offense for non-empty class with annotation comment' do
    inspect_source(cop,
                   ['# OPTIMIZE: Make this faster.',
                    'class My_Class',
                    '  TEST = 20',
                    'end'
                   ])
    expect(cop.offenses.size).to eq(1)
  end

  it 'accepts non-empty class with annotation comment followed by other ' \
     'comment' do
    inspect_source(cop,
                   ['# OPTIMIZE: Make this faster.',
                    '# Class comment.',
                    'class My_Class',
                    '  TEST = 20',
                    'end'
                   ])
    expect(cop.offenses).to be_empty
  end

  it 'accepts non-empty class with comment that ends with an annotation' do
    inspect_source(cop,
                   ['# Does fooing.',
                    '# FIXME: Not yet implemented.',
                    'class Foo',
                    '  def initialize',
                    '  end',
                    'end'
                   ])
    expect(cop.offenses).to be_empty
  end

  it 'accepts non-empty module with documentation' do
    inspect_source(cop,
                   ['# class comment',
                    'module My_Class',
                    '  TEST = 20',
                    'end'
                   ])
    expect(cop.offenses).to be_empty
  end

  it 'accepts empty class without documentation' do
    inspect_source(cop,
                   ['class My_Class',
                    'end'
                   ])
    expect(cop.offenses).to be_empty
  end

  it 'accepts namespace module without documentation' do
    inspect_source(cop,
                   ['module Test',
                    '  class A; end',
                    '  class B; end',
                    'end'
                   ])
    expect(cop.offenses).to be_empty
  end

  it 'accepts namespace class without documentation' do
    inspect_source(cop,
                   ['class Test',
                    '  class A; end',
                    '  class B; end',
                    'end'
                   ])
    expect(cop.offenses).to be_empty
  end

  it 'does not raise an error for an implicit match conditional' do
    expect do
      inspect_source(cop,
                     ['class Test',
                      '  if //',
                      '  end',
                      'end'
                     ])
    end.to_not raise_error
  end
end


text:
layout: basic
category: CFGOnesToWatch2016
---

                    CF:G Introduction by Charalotte Fereday

Community Programmes Manager @codefirstgirls / Tech & education/ Social enterprise/Researcher of Spanish & digital cultures

Code First Girls are a social enterprise, and raise our revenues through a combination of sponsorship and corporate services. All profits we make get plugged back in to running the community activities we do with smart young women who want to build careers in tech and entrepreneurship.

Each year we run classes  that teach 1500+ women how to code, for free. Over the past 3 years we've delivered £1.5+ million of free coding courses, and helped companies to recruit better tech talent into their firms.

Our community is now 3500+ strong, and is doing amazing things. Find out more by looking through our website and social communities, or just drop us a line at info@codefirstgirls.org.uk.

{% for post in site.posts %}
    {% if post.category == 'CFGOnesToWatch2016' %}
        {% include episode.html %}
    {% endif %}
{% endfor %}


text:
require 'spec_helper'

describe NetSuite::Records::SalesOrderItem do
  let(:item) { NetSuite::Records::SalesOrderItem.new }

  it 'has all the right fields' do
    [
     :amount, :bin_numbers, :cost_estimate, :cost_estimate_type,
     :defer_rev_rec, :description, :expand_item_group,
     :gift_cert_from, :gift_cert_message, :gift_cert_number,
     :gift_cert_recipient_email, :gift_cert_recipient_name,
     :gross_amt, :is_taxable, :line, :order_line, :po_currency,
     :quantity, :quantity_back_ordered, :quantity_billed,
     :quantity_committed, :quantity_fulfilled,
     :rate, :rev_rec_end_date, :rev_rec_start_date,
     :rev_rec_term_in_months, :serial_numbers, :ship_group,
     :tax1_amt, :tax_rate1, :tax_rate2,
     :vsoe_allocation, :vsoe_amount, :vsoe_deferral,
     :vsoe_delivered, :vsoe_permit_discount, :vsoe_price,
    ].each do |field|
      expect(item).to have_field(field)
    end
  end

  it 'has all the right record refs' do
    [
      :department, :item, :job, :klass, :location, :price, :rev_rec_schedule, :tax_code, :units
    ].each do |record_ref|
      expect(item).to have_record_ref(record_ref)
    end
  end

  describe '#options' do
    it 'can be set from attributes'
    it 'can be set from a CustomFieldList object'
  end

  describe '#inventory_detail' do
    it 'can be set from attributes'
    it 'can be set from an InventoryDetail object'
  end

  describe '#custom_field_list' do
    it 'can be set from attributes'
    it 'can be set from a CustomFieldList object'
  end

end


text:
const smash = require("../../../../smash.js");
const errorUtil = smash.errorUtil();

class Event {
	constructor(rawEvent, context, terminate) {
		if (typeof rawEvent !== 'object') {
			throw new Error("First parameter of Event() must be an object, " + errorUtil.typeOf(rawEvent));
		}
		if (typeof rawEvent.EventSource !== 'string') {
			throw new Error("Invalid raw event, invalid property EventSource, " + errorUtil.typeOf(rawEvent.EventSource));
		}
		if (typeof rawEvent.Route !== 'string') {
			throw new Error("Invalid raw event, invalid property eventSourceARN, " + errorUtil.typeOf(rawEvent.Route));
		}
		this.name = rawEvent.Route;
		this._rawEvent = rawEvent;
		Object.assign(this, rawEvent);
		this.context = context;
		if (typeof terminate !== 'object') {
			throw new Error("Third parameter of Event() must be a object, " + errorUtil.typeOf(terminate));
		}
		if (typeof terminate.terminate !== 'function') {
			throw new Error("Third parameter of Event() must be an object with a function called terminate, " + errorUtil.typeOf(terminate.terminate));
		}
		if (terminate.terminate.length !== 2) {
			throw new Error("Third parameter of Event() must be an object with a function called terminate witch takes 2 parameters: error, data, " + terminate.terminate.length + " given");
		}
		this._terminate = terminate;
	}

	terminate(error, data) {
		this._terminate.terminate(error, data);
		return this;
	}

	success(data) {
		this.terminate(null, data);
		return this;
	}

	failure(error) {
		this.terminate(error, null);
		return this;
	}

	handleError(error) {
		if (errorUtil.isSmashError(error) === false) {
			error = errorUtil.internalServerError("First argument of handleError(error) must be a SmashError, " + errorUtil.typeOf(error), error);
		}
		error.printError();
		return this.failure(error);
	}
}

module.exports = Event;


text:
@interface RKGitHubExampleTests : SenTestCase

@end


text:
require 'cocoapods/app_group/hook'
require 'cocoapods/app_group/setup'
require 'cocoapods/app_group/setup_xcconfig'
require 'cocoapods/app_group/store'
require 'cocoapods/app_group/template'
require 'cocoapods/app_group/version'
require 'pod/command/app_group'


text:
<?php

/**
 * This is the model class for table "book".
 *
 * The followings are the available columns in table 'book':
 * @property integer $id
 * @property string $title
 * @property string $title_vn
 * @property string $content
 * @property string $created_time
 * @property string $original_url
 * @property string $author
 * @property string $thumbnail
 */
class Book extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Book the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'book';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('title, title_vn, author, thumbnail, original_url', 'length', 'max'=>255),
			array('content, created_time', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id, title, title_vn, content, created_time, original_url', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'title' => 'Title',
			'title_vn' => 'Title Vn',
			'content' => 'Content',
			'created_time' => 'Created Time',
			'original_url' => 'Original Url',
			'author' => 'Original Url',
			'thumbnail' => 'Original Url',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('id',$this->id);
		$criteria->compare('title',$this->title,true);
		$criteria->compare('title_vn',$this->title_vn,true);
		$criteria->compare('content',$this->content,true);
		$criteria->compare('created_time',$this->created_time,true);
		$criteria->compare('original_url',$this->original_url,true);
		$criteria->compare('author',$this->author,true);
		$criteria->compare('thumbnail',$this->thumbnail,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>Abstract Objects Layer — Python v3.2.3 documentation</title>
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />

    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within Python v3.2.3 documentation"
          href="../_static/opensearch.xml"/>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="copyright" title="Copyright" href="../copyright.html" />
    <link rel="top" title="Python v3.2.3 documentation" href="../index.html" />
    <link rel="up" title="Python/C API Reference Manual" href="index.html" />
    <link rel="next" title="Object Protocol" href="object.html" />
    <link rel="prev" title="Codec registry and support functions" href="codec.html" />
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />

Navigation

          index

          modules |

          next |

          previous |

Python v3.2.3 documentation »

Python/C API Reference Manual »

Abstract Objects Layer¶

The functions in this chapter interact with Python objects regardless of their
type, or with wide classes of object types (e.g. all numerical types, or all
sequence types).  When used on object types for which they do not apply, they
will raise a Python exception.

It is not possible to use these functions on objects that are not properly
initialized, such as a list object that has been created by <tt class="xref c c-func docutils literal">PyList_New()</tt>,
but whose items have not been set to some non-<tt class="docutils literal">NULL</tt> value yet.

Object Protocol

Number Protocol

Sequence Protocol

Mapping Protocol

Iterator Protocol

Buffer Protocol

The buffer structure

Buffer-related functions

Old Buffer Protocol

Previous topic

Codec registry and support functions

Next topic

Object Protocol

This Page

Report a Bug

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

    Enter search terms or a module, class or function name.

Navigation

          index

          modules |

          next |

          previous |

Python v3.2.3 documentation »

Python/C API Reference Manual »

    © Copyright 1990-2012, Python Software Foundation.

    The Python Software Foundation is a non-profit corporation.
    Please donate.

    Last updated on Apr 11, 2012.
    Found a bug?

    Created using Sphinx 1.0.7.