text:
package org.apache.beam.runners.core;

import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.apache.beam.sdk.coders.Coder;
import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
import org.apache.beam.sdk.util.WindowedValue;
import org.apache.beam.sdk.values.TupleTag;

/**
 * Base class for implementations of {@link ExecutionContext}.
 *
 *
A concrete subclass should implement {@link #createStepContext} to create the appropriate
 * {@link StepContext} implementation. Any {@code StepContext} created will
 * be cached for the lifetime of this {@link ExecutionContext}.
 *
 *
BaseExecutionContext is generic to allow implementing subclasses to return a concrete subclass
 * of {@link StepContext} from {@link #getOrCreateStepContext(String, String)} and
 * {@link #getAllStepContexts()} without forcing each subclass to override the method, e.g.
 *
{@code
 * {@literal @}Override
 * StreamingModeExecutionContext.StepContext getOrCreateStepContext(...) {
 *   return (StreamingModeExecutionContext.StepContext) super.getOrCreateStepContext(...);
 * }
 * }

 *
 *
When a subclass of {@code BaseExecutionContext} has been downcast, the return types of
 * {@link #createStepContext(String, String)},
 * {@link #getOrCreateStepContext(String, String)}, and {@link #getAllStepContexts()}
 * will be appropriately specialized.
 */
public abstract class BaseExecutionContext<T extends ExecutionContext.StepContext>
    implements ExecutionContext {

  private Map<String, T> cachedStepContexts = new HashMap<>();

  /**
   * Implementations should override this to create the specific type
   * of {@link StepContext} they need.
   */
  protected abstract T createStepContext(String stepName, String transformName);

  /**
   * Returns the {@link StepContext} associated with the given step.
   */
  @Override
  public T getOrCreateStepContext(String stepName, String transformName) {
    final String finalStepName = stepName;
    final String finalTransformName = transformName;
    return getOrCreateStepContext(
        stepName,
        new CreateStepContextFunction<T>() {
          @Override
          public T create() {
            return createStepContext(finalStepName, finalTransformName);
          }
        });
  }

  /**
   * Factory method interface to create an execution context if none exists during
   * {@link #getOrCreateStepContext(String, CreateStepContextFunction)}.
   */
  protected interface CreateStepContextFunction<T extends ExecutionContext.StepContext> {
    T create();
  }

  protected final T getOrCreateStepContext(String stepName,
      CreateStepContextFunction<T> createContextFunc) {
    T context = cachedStepContexts.get(stepName);
    if (context == null) {
      context = createContextFunc.create();
      cachedStepContexts.put(stepName, context);
    }

    return context;
  }

  /**
   * Returns a collection view of all of the {@link StepContext}s.
   */
  @Override
  public Collection<? extends T> getAllStepContexts() {
    return Collections.unmodifiableCollection(cachedStepContexts.values());
  }

  /**
   * Hook for subclasses to implement that will be called whenever
   * {@code DoFn.Context#output}
   * is called.
   */
  @Override
  public void noteOutput(WindowedValue<?> output) {}

  /**
   * Hook for subclasses to implement that will be called whenever
   * {@code DoFn.Context#sideOutput}
   * is called.
   */
  @Override
  public void noteSideOutput(TupleTag<?> tag, WindowedValue<?> output) {}

  /**
   * Base class for implementations of {@link ExecutionContext.StepContext}.
   *
   *
To complete a concrete subclass, implement {@link #timerInternals} and
   * {@link #stateInternals}.
   */
  public abstract static class StepContext implements ExecutionContext.StepContext {
    private final ExecutionContext executionContext;
    private final String stepName;
    private final String transformName;

    public StepContext(ExecutionContext executionContext, String stepName, String transformName) {
      this.executionContext = executionContext;
      this.stepName = stepName;
      this.transformName = transformName;
    }

    @Override
    public String getStepName() {
      return stepName;
    }

    @Override
    public String getTransformName() {
      return transformName;
    }

    @Override
    public void noteOutput(WindowedValue<?> output) {
      executionContext.noteOutput(output);
    }

    @Override
    public void noteSideOutput(TupleTag<?> tag, WindowedValue<?> output) {
      executionContext.noteSideOutput(tag, output);
    }

    @Override
    public <T, W extends BoundedWindow> void writePCollectionViewData(
        TupleTag<?> tag,
        Iterable<WindowedValue<T>> data, Coder<Iterable<WindowedValue<T>>> dataCoder,
        W window, Coder<W> windowCoder) throws IOException {
      throw new UnsupportedOperationException("Not implemented.");
    }

    @Override
    public abstract StateInternals<?> stateInternals();

    @Override
    public abstract TimerInternals timerInternals();
  }
}


text:
<?php

namespace portal;

use Illuminate\Database\Eloquent\Model;

class FileTransparencia extends Model
{
    protected $table = 'arquivo';

    public $timestamps = false;

 	protected $fillable = ['nome'];

 	public function transparencias() {
		return $this->hasMany('portal\Transparencia');
	}
}

redpajama_set_name: RedPajamaGithub


text:
/// Copyright (c) 2012 Ecma International.  All rights reserved.
/// Ecma International makes this code available under the terms and conditions set
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
/// "Use Terms").   Any redistribution of this code must retain the above
/// copyright and this notice and otherwise comply with the Use Terms.
/**
 * @path ch11/11.8/11.8.3/11.8.3-3.js
 * @description 11.8.3 Less-than-or-equal Operator - Partial left to right order enforced when using Less-than-or-equal operator: toString <= valueOf
 */

function testcase() {
        var accessed = false;
        var obj1 = {
            toString: function () {
                accessed = true;
                return 3;
            }
        };
        var obj2 = {
            valueOf: function () {
                if (accessed === true) {
                    return 4;
                } else {
                    return 2;
                }
            }
        };
        return (obj1 <= obj2);
    }
runTestCase(testcase);


text:
Sample code for Chapter 9 - "Pythonic objects"

From the book "Fluent Python" by Luciano Ramalho (O'Reilly, 2015)
http://shop.oreilly.com/product/0636920032519.do


text:
import React from 'react';

import BaseAvatar from 'app/components/avatar/baseAvatar';
import SentryTypes from 'app/sentryTypes';
import {Team} from 'app/types';
import {explodeSlug} from 'app/utils';

type Props = {
  team: Team | null;
} & Omit<BaseAvatar['props'], 'uploadPath' | 'uploadId'>;

class TeamAvatar extends React.Component<Props> {
  static propTypes = {
    team: SentryTypes.Team,
    ...BaseAvatar.propTypes,
  };

  render() {
    const {team, ...props} = this.props;
    if (!team) {
      return null;
    }
    const slug = (team && team.slug) || '';
    const title = explodeSlug(slug);
    const tooltip = `#${title}`;

    return (
      <BaseAvatar
        {...props}
        type={(team.avatar && team.avatar.avatarType) || 'letter_avatar'}
        uploadPath="team-avatar"
        uploadId={team.avatar && team.avatar.avatarUuid}
        letterId={slug}
        tooltip={tooltip}
        title={title}
      />
    );
  }
}
export default TeamAvatar;


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Uses of Package org.apache.hadoop.hbase.regionserver.compactions (HBase 0.94.8 API)
</TITLE>

<META NAME="date" CONTENT="2013-05-22">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Package
org.apache.hadoop.hbase.regionserver.compactions

Packages that use org.apache.hadoop.hbase.regionserver.compactions

org.apache.hadoop.hbase.client
Provides HBase Client

org.apache.hadoop.hbase.coprocessor
Table of Contents

org.apache.hadoop.hbase.regionserver

org.apache.hadoop.hbase.regionserver.compactions

Classes in org.apache.hadoop.hbase.regionserver.compactions used by org.apache.hadoop.hbase.client

CompactionRequest.CompactionState

          An enum for the region compaction state

Classes in org.apache.hadoop.hbase.regionserver.compactions used by org.apache.hadoop.hbase.coprocessor

CompactionRequest

          This class holds all details necessary to run a compaction.

Classes in org.apache.hadoop.hbase.regionserver.compactions used by org.apache.hadoop.hbase.regionserver

CompactionProgress

          This class holds information relevant for tracking the progress of a
 compaction.

CompactionRequest

          This class holds all details necessary to run a compaction.

Classes in org.apache.hadoop.hbase.regionserver.compactions used by org.apache.hadoop.hbase.regionserver.compactions

CompactionRequest

          This class holds all details necessary to run a compaction.

CompactionRequest.CompactionState

          An enum for the region compaction state

CompactSelection

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2013 The Apache Software Foundation. All Rights Reserved.


text:
Install PhantomJS
-----------------
1. Obtain PhantomJS:
https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2
2. Untar and normall install
3. Create a Symbolic link to the executable
4. Check that it works by issuing "phantomjs --version" in console

Install CasperJS
-----------------
1. git clone git://github.com/n1k0/casperjs.git
2. Create a Symbolic link to the executable
3. Check that it works by issuing "casperjs --version" in console

To start testing
-----------------
casperjs test Filename


text:
import netaddr
from oslo_log import log as logging
import six
from tempest_lib import exceptions as lib_exc

from tempest import clients
from tempest.common import cred_client
from tempest.common import cred_provider
from tempest.common.utils import data_utils
from tempest import config
from tempest import exceptions

CONF = config.CONF
LOG = logging.getLogger(__name__)

class DynamicCredentialProvider(cred_provider.CredentialProvider):

    def __init__(self, identity_version, name=None, network_resources=None,
                 credentials_domain=None, admin_role=None):
        super(DynamicCredentialProvider, self).__init__(
            identity_version=identity_version, name=name,
            network_resources=network_resources,
            credentials_domain=credentials_domain, admin_role=admin_role)
        self._creds = {}
        self.ports = []
        self.default_admin_creds = cred_provider.get_configured_credentials(
            'identity_admin', fill_in=True,
            identity_version=self.identity_version)
        (self.identity_admin_client, self.network_admin_client,
         self.networks_admin_client,
         self.subnets_admin_client) = self._get_admin_clients()
        # Domain where isolated credentials are provisioned (v3 only).
        # Use that of the admin account is None is configured.
        self.creds_domain_name = None
        if self.identity_version == 'v3':
            self.creds_domain_name = (
                self.default_admin_creds.project_domain_name or
                self.credentials_domain)
        self.creds_client = cred_client.get_creds_client(
            self.identity_admin_client, self.creds_domain_name)

    def _get_admin_clients(self):
        """
        Returns a tuple with instances of the following admin clients (in this
        order):
            identity
            network
        """
        os = clients.Manager(self.default_admin_creds)
        if self.identity_version == 'v2':
            return (os.identity_client, os.network_client, os.networks_client,
                    os.subnets_client)
        else:
            return (os.identity_v3_client, os.network_client,
                    os.networks_client, os.subnets_client)

    def _create_creds(self, suffix="", admin=False, roles=None):
        """Create random credentials under the following schema.

        If the name contains a '.' is the full class path of something, and
        we don't really care. If it isn't, it's probably a meaningful name,
        so use it.

        For logging purposes, -user and -tenant are long and redundant,
        don't use them. The user# will be sufficient to figure it out.
        """
        if '.' in self.name:
            root = ""
        else:
            root = self.name

        project_name = data_utils.rand_name(root) + suffix
        project_desc = project_name + "-desc"
        project = self.creds_client.create_project(
            name=project_name, description=project_desc)

        username = data_utils.rand_name(root) + suffix
        user_password = data_utils.rand_password()
        email = data_utils.rand_name(root) + suffix + "@example.com"
        user = self.creds_client.create_user(
            username, user_password, project, email)
        if 'user' in user:
            user = user['user']
        role_assigned = False
        if admin:
            self.creds_client.assign_user_role(user, project,
                                               self.admin_role)
            role_assigned = True
        # Add roles specified in config file
        for conf_role in CONF.auth.tempest_roles:
            self.creds_client.assign_user_role(user, project, conf_role)
            role_assigned = True
        # Add roles requested by caller
        if roles:
            for role in roles:
                self.creds_client.assign_user_role(user, project, role)
                role_assigned = True
        # NOTE(mtreinish) For a user to have access to a project with v3 auth
        # it must beassigned a role on the project. So we need to ensure that
        # our newly created user has a role on the newly created project.
        if self.identity_version == 'v3' and not role_assigned:
            self.creds_client.create_user_role('Member')
            self.creds_client.assign_user_role(user, project, 'Member')

        creds = self.creds_client.get_credentials(user, project, user_password)
        return cred_provider.TestResources(creds)

    def _create_network_resources(self, tenant_id):
        network = None
        subnet = None
        router = None
        # Make sure settings
        if self.network_resources:
            if self.network_resources['router']:
                if (not self.network_resources['subnet'] or
                    not self.network_resources['network']):
                    raise exceptions.InvalidConfiguration(
                        'A router requires a subnet and network')
            elif self.network_resources['subnet']:
                if not self.network_resources['network']:
                    raise exceptions.InvalidConfiguration(
                        'A subnet requires a network')
            elif self.network_resources['dhcp']:
                raise exceptions.InvalidConfiguration('DHCP requires a subnet')

        data_utils.rand_name_root = data_utils.rand_name(self.name)
        if not self.network_resources or self.network_resources['network']:
            network_name = data_utils.rand_name_root + "-network"
            network = self._create_network(network_name, tenant_id)
        try:
            if not self.network_resources or self.network_resources['subnet']:
                subnet_name = data_utils.rand_name_root + "-subnet"
                subnet = self._create_subnet(subnet_name, tenant_id,
                                             network['id'])
            if not self.network_resources or self.network_resources['router']:
                router_name = data_utils.rand_name_root + "-router"
                router = self._create_router(router_name, tenant_id)
                self._add_router_interface(router['id'], subnet['id'])
        except Exception:
            if router:
                self._clear_isolated_router(router['id'], router['name'])
            if subnet:
                self._clear_isolated_subnet(subnet['id'], subnet['name'])
            if network:
                self._clear_isolated_network(network['id'], network['name'])
            raise
        return network, subnet, router

    def _create_network(self, name, tenant_id):
        resp_body = self.networks_admin_client.create_network(
            name=name, tenant_id=tenant_id)
        return resp_body['network']

    def _create_subnet(self, subnet_name, tenant_id, network_id):
        base_cidr = netaddr.IPNetwork(CONF.network.tenant_network_cidr)
        mask_bits = CONF.network.tenant_network_mask_bits
        for subnet_cidr in base_cidr.subnet(mask_bits):
            try:
                if self.network_resources:
                    resp_body = self.subnets_admin_client.\
                        create_subnet(
                            network_id=network_id, cidr=str(subnet_cidr),
                            name=subnet_name,
                            tenant_id=tenant_id,
                            enable_dhcp=self.network_resources['dhcp'],
                            ip_version=4)
                else:
                    resp_body = self.subnets_admin_client.\
                        create_subnet(network_id=network_id,
                                      cidr=str(subnet_cidr),
                                      name=subnet_name,
                                      tenant_id=tenant_id,
                                      ip_version=4)
                break
            except lib_exc.BadRequest as e:
                if 'overlaps with another subnet' not in str(e):
                    raise
        else:
            message = 'Available CIDR for subnet creation could not be found'
            raise Exception(message)
        return resp_body['subnet']

    def _create_router(self, router_name, tenant_id):
        external_net_id = dict(
            network_id=CONF.network.public_network_id)
        resp_body = self.network_admin_client.create_router(
            router_name,
            external_gateway_info=external_net_id,
            tenant_id=tenant_id)
        return resp_body['router']

    def _add_router_interface(self, router_id, subnet_id):
        self.network_admin_client.add_router_interface_with_subnet_id(
            router_id, subnet_id)

    def get_credentials(self, credential_type):
        if self._creds.get(str(credential_type)):
            credentials = self._creds[str(credential_type)]
        else:
            if credential_type in ['primary', 'alt', 'admin']:
                is_admin = (credential_type == 'admin')
                credentials = self._create_creds(admin=is_admin)
            else:
                credentials = self._create_creds(roles=credential_type)
            self._creds[str(credential_type)] = credentials
            # Maintained until tests are ported
            LOG.info("Acquired dynamic creds:\n credentials: %s"
                     % credentials)
            if (CONF.service_available.neutron and
                not CONF.baremetal.driver_enabled and
                CONF.auth.create_isolated_networks):
                network, subnet, router = self._create_network_resources(
                    credentials.tenant_id)
                credentials.set_resources(network=network, subnet=subnet,
                                          router=router)
                LOG.info("Created isolated network resources for : \n"
                         + " credentials: %s" % credentials)
        return credentials

    def get_primary_creds(self):
        return self.get_credentials('primary')

    def get_admin_creds(self):
        return self.get_credentials('admin')

    def get_alt_creds(self):
        return self.get_credentials('alt')

    def get_creds_by_roles(self, roles, force_new=False):
        roles = list(set(roles))
        # The roles list as a str will become the index as the dict key for
        # the created credentials set in the dynamic_creds dict.
        exist_creds = self._creds.get(str(roles))
        # If force_new flag is True 2 cred sets with the same roles are needed
        # handle this by creating a separate index for old one to store it
        # separately for cleanup
        if exist_creds and force_new:
            new_index = str(roles) + '-' + str(len(self._creds))
            self._creds[new_index] = exist_creds
            del self._creds[str(roles)]
        return self.get_credentials(roles)

    def _clear_isolated_router(self, router_id, router_name):
        net_client = self.network_admin_client
        try:
            net_client.delete_router(router_id)
        except lib_exc.NotFound:
            LOG.warn('router with name: %s not found for delete' %
                     router_name)

    def _clear_isolated_subnet(self, subnet_id, subnet_name):
        client = self.subnets_admin_client
        try:
            client.delete_subnet(subnet_id)
        except lib_exc.NotFound:
            LOG.warn('subnet with name: %s not found for delete' %
                     subnet_name)

    def _clear_isolated_network(self, network_id, network_name):
        net_client = self.networks_admin_client
        try:
            net_client.delete_network(network_id)
        except lib_exc.NotFound:
            LOG.warn('network with name: %s not found for delete' %
                     network_name)

    def _cleanup_default_secgroup(self, tenant):
        net_client = self.network_admin_client
        resp_body = net_client.list_security_groups(tenant_id=tenant,
                                                    name="default")
        secgroups_to_delete = resp_body['security_groups']
        for secgroup in secgroups_to_delete:
            try:
                net_client.delete_security_group(secgroup['id'])
            except lib_exc.NotFound:
                LOG.warn('Security group %s, id %s not found for clean-up' %
                         (secgroup['name'], secgroup['id']))

    def _clear_isolated_net_resources(self):
        net_client = self.network_admin_client
        for cred in self._creds:
            creds = self._creds.get(cred)
            if (not creds or not any([creds.router, creds.network,
                                      creds.subnet])):
                continue
            LOG.debug("Clearing network: %(network)s, "
                      "subnet: %(subnet)s, router: %(router)s",
                      {'network': creds.network, 'subnet': creds.subnet,
                       'router': creds.router})
            if (not self.network_resources or
                    (self.network_resources.get('router') and creds.subnet)):
                try:
                    net_client.remove_router_interface_with_subnet_id(
                        creds.router['id'], creds.subnet['id'])
                except lib_exc.NotFound:
                    LOG.warn('router with name: %s not found for delete' %
                             creds.router['name'])
                self._clear_isolated_router(creds.router['id'],
                                            creds.router['name'])
            if (not self.network_resources or
                self.network_resources.get('subnet')):
                self._clear_isolated_subnet(creds.subnet['id'],
                                            creds.subnet['name'])
            if (not self.network_resources or
                self.network_resources.get('network')):
                self._clear_isolated_network(creds.network['id'],
                                             creds.network['name'])

    def clear_creds(self):
        if not self._creds:
            return
        self._clear_isolated_net_resources()
        for creds in six.itervalues(self._creds):
            try:
                self.creds_client.delete_user(creds.user_id)
            except lib_exc.NotFound:
                LOG.warn("user with name: %s not found for delete" %
                         creds.username)
            try:
                if CONF.service_available.neutron:
                    self._cleanup_default_secgroup(creds.tenant_id)
                self.creds_client.delete_project(creds.tenant_id)
            except lib_exc.NotFound:
                LOG.warn("tenant with name: %s not found for delete" %
                         creds.tenant_name)
        self._creds = {}

    def is_multi_user(self):
        return True

    def is_multi_tenant(self):
        return True

    def is_role_available(self, role):
        return True


text:
package fr.adrienbrault.idea.symfony2plugin.ui.dict;

import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.util.xmlb.annotations.Attribute;
import org.jetbrains.annotations.NotNull;

import java.io.File;

/**
 * @author Daniel Espendiller <daniel@espendiller.net>
 */
public abstract class AbstractUiFilePath implements UiFilePathInterface {

    protected String path;

    public boolean exists(@NotNull Project project) {
        if (!FileUtil.isAbsolute(this.path)) {
            return VfsUtil.findRelativeFile(this.path, project.getBaseDir()) != null;
        }

        return new File(this.path).exists();
    }

    @Attribute("path")
    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    @Override
    public boolean isRemote() {
        return this.path != null && this.path.startsWith("remote://");
    }
}


text:
.class Landroid/accounts/ChooseAccountTypeActivity$1;
.super Ljava/lang/Object;
.source "ChooseAccountTypeActivity.java"

# interfaces
.implements Landroid/widget/AdapterView$OnItemClickListener;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Landroid/accounts/ChooseAccountTypeActivity;->onCreate(Landroid/os/Bundle;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Landroid/accounts/ChooseAccountTypeActivity;

# direct methods
.method constructor <init>(Landroid/accounts/ChooseAccountTypeActivity;)V
    .locals 0

    .prologue
    .line 108
    iput-object p1, p0, Landroid/accounts/ChooseAccountTypeActivity$1;->this$0:Landroid/accounts/ChooseAccountTypeActivity;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public onItemClick(Landroid/widget/AdapterView;Landroid/view/View;IJ)V
    .locals 2
    .param p2, "v"    # Landroid/view/View;
    .param p3, "position"    # I
    .param p4, "id"    # J
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/widget/AdapterView",
            "<*>;",
            "Landroid/view/View;",
            "IJ)V"
        }
    .end annotation

    .prologue
    .line 110
    .local p1, "parent":Landroid/widget/AdapterView;, "Landroid/widget/AdapterView<*>;"
    iget-object v1, p0, Landroid/accounts/ChooseAccountTypeActivity$1;->this$0:Landroid/accounts/ChooseAccountTypeActivity;

    iget-object v0, p0, Landroid/accounts/ChooseAccountTypeActivity$1;->this$0:Landroid/accounts/ChooseAccountTypeActivity;

    # getter for: Landroid/accounts/ChooseAccountTypeActivity;->mAuthenticatorInfosToDisplay:Ljava/util/ArrayList;
    invoke-static {v0}, Landroid/accounts/ChooseAccountTypeActivity;->access$000(Landroid/accounts/ChooseAccountTypeActivity;)Ljava/util/ArrayList;

    move-result-object v0

    invoke-virtual {v0, p3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/accounts/ChooseAccountTypeActivity$AuthInfo;

    iget-object v0, v0, Landroid/accounts/ChooseAccountTypeActivity$AuthInfo;->desc:Landroid/accounts/AuthenticatorDescription;

    iget-object v0, v0, Landroid/accounts/AuthenticatorDescription;->type:Ljava/lang/String;

    # invokes: Landroid/accounts/ChooseAccountTypeActivity;->setResultAndFinish(Ljava/lang/String;)V
    invoke-static {v1, v0}, Landroid/accounts/ChooseAccountTypeActivity;->access$100(Landroid/accounts/ChooseAccountTypeActivity;Ljava/lang/String;)V

    .line 111
    return-void
.end method


text:
if (location.protocol === 'about:') {
  chrome.runtime.sendMessage('message from ' + location.href);
} else if (frameElement && !frameElement.getAttribute('src')) {
  chrome.runtime.sendMessage('message from about:blank');
}

chrome.runtime.onMessage.addListener(function(message) {
  if (message === 'open about:blank popup')
    window.open('about:blank');
});


text:
const fs = require('fs');
const parse = require('csv-parse');
const stringify = require('csv-stringify');
const transform = require('stream-transform');
const PNG = require('node-png').PNG;

var input = fs.createReadStream('../workshop/long-cadence.csv');
var output = fs.createWriteStream('out.csv');
var parser = parse();
var stringifier = stringify();
var transformer = transform(function(data){
    return data;
});

var image_index = 0;
transformer.on('readable', function(){
    var row;
    while (row = transformer.read()) {
        var png = new PNG({
            width: 11,
            height: 11,
            filter: -1
        });

        var data = row.slice(1);
        var max = Math.max(...data);
        data.forEach(function(value, index){
            var gray = value/max * 255;
            png.data[4*index + 0] = gray;
            png.data[4*index + 1] = gray;
            png.data[4*index + 2] = gray;
            png.data[4*index + 3] = 0xff;
        });

        png.pack().pipe(fs.createWriteStream('resources/image-' + pad(image_index, 4) + '.png'));
        image_index++;
    }
});

input
    .pipe(parser)
    .pipe(transformer)
    .pipe(stringifier)
    .pipe(output);

function pad(number, width, padding) {
    padding = padding || '0';
    number = number + '';
    return number.length >= width ? number : new Array(width - number.length + 1).join(padding) + number;
}


text:
pref("general.config.filename", "firefox.cfg");
pref("general.config.obscure_value", 0);


text:
FROM ruby:2.2-onbuild
MAINTAINER Felix Seidel <felix@seidel.me>

ENV RACK_ENV production
RUN useradd -u 500 core
USER core
CMD ["bundle", "exec", "ruby", "calculator.rb"]
EXPOSE 4567


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Uses of Class com.aleozlx.pacswitch.test.ModernFrame</title>
<meta name="date" content="2014-07-14">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
com.aleozlx.pacswitch.test.ModernFrame

Packages that use ModernFrame

Package
Description

com.aleozlx.pacswitch.test

Uses of ModernFrame in com.aleozlx.pacswitch.test

Subclasses of ModernFrame in com.aleozlx.pacswitch.test

Modifier and Type
Class and Description

class
CommWindow

class
LoginWindow

class
TextViewWindow

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
export function formToJSON(form: any): any
export function getFormFields(form: any): any
export function getInvalidFormFields(form: any): any
export function resetForm(form: any): any


text:
import * as constants from './constants'

import { addNote } from './actions'
import { editNote } from './actions'

import { forOwnRight } from 'lodash'

const initialState = {
  notes: [],
  foundUsers: []

  /*
    notes model:
      id,
      title,
      text,
      isInTrash,
      isArchived,
      googleDriveId
  */
}

export default function notesApp(state = initialState, action) {
  switch (action.type) {

    case constants.LOAD_NOTES_SUCCESS: {
      let notes = [];
      forOwnRight(action.notes, function(value, id) {
        notes.push((<any>Object).assign({}, value, {}));
      });
      return (<any>Object).assign({}, state, {
        notes: notes
      })
    }

    case constants.ADD_NOTE: {
      return (<any>Object).assign({}, state, {
        notes: [(<any>Object).assign({}, [], action.note),
        ...state.notes]
      })
    }

    case constants.EDIT_NOTE: {
      return (<any>Object).assign({}, state, {
        notes: state.notes.map(note =>
        note.id === action.note.id
          ? (<any>Object).assign({}, note, {title: action.note.title, text: action.note.text}) : note
        )
      })
    }

    case constants.MOVE_NOTE_TO_TRASH: {
      return (<any>Object).assign({}, state, {
        notes: state.notes.map(note =>
        note.id === action.id
          ? (<any>Object).assign({}, note, {isInTrash: true}) : note
        )
      })
    }

    case constants.DISCARD_NOTE: {
      return (<any>Object).assign({}, state, {
        notes: state.notes.filter(note =>
         note.id !== action.id
        )
      })
    }

    case constants.SEARCH_USER_IN_FIREBASE_SUCCESS: {
      return (<any>Object).assign({}, state, {
        foundUsers: action.users
      })
    }

    case constants.UPDATE_USER_NOTE_COLLABORATORS_SUCCESS: {
      const isShared = !!(Object.keys(action.collaborators).length > 1);
      return (<any>Object).assign({}, state, {
        notes: state.notes.map(note =>
        note.id === action.note.id
          ? (<any>Object).assign({}, note, {
            collaborators: action.collaborators,
            isShared
          }) : note
        )
      })
    }

    default:
      return state
  }
}


text:
//
//  GTLAnalyticsProfileRef.m
//

// ----------------------------------------------------------------------------
// NOTE: This file is generated from Google APIs Discovery Service.
// Service:
//   Google Analytics API (analytics/v3)
// Description:
//   View and manage your Google Analytics data
// Documentation:
//   https://developers.google.com/analytics/
// Classes:
//   GTLAnalyticsProfileRef (0 custom class methods, 7 custom properties)

#import "GTLAnalyticsProfileRef.h"

// ----------------------------------------------------------------------------
//
//   GTLAnalyticsProfileRef
//

@implementation GTLAnalyticsProfileRef
@dynamic accountId, href, identifier, internalWebPropertyId, kind, name,
         webPropertyId;

+ (NSDictionary *)propertyToJSONKeyMap {
  NSDictionary *map = @{
    @"identifier" : @"id"
  };
  return map;
}

+ (void)load {
  [self registerObjectClassForKind:@"analytics#profileRef"];
}

@end


text:
import os
import sys
import time
import tempfile
import zipfile
import error
import transfer as tfr

def _prepare_remote_dep_file(ssh):
    stdin, stdout, stderr = ssh.exec_command("mktemp --tmpdir 'pyscpXXXXXX.zip'")
    while (not stdout.channel.exit_status_ready()):
        time.sleep(.1)  # 100ms
    if (stdout.channel.recv_exit_status() != 0):
        sys.stderr.write(stderr.read(-1))
        return None
    tempfile = stdout.readline().strip()
    ssh.exec_command("chmod 0666 '{}'".format(tempfile))
    return tempfile

def deploy(ssh):
    sys.stdout.write("Deploying pyscp on remote\n")

    stdin, stdout, stderr = ssh.exec_command("uname")
    while (not stdout.channel.exit_status_ready()):
        time.sleep(5. / 60.)  # 5s
    if (stdout.channel.recv_exit_status() != 0):
        sys.stderr.write(stderr.read(-1))
        return None
    # TODO: add MacOS and other Unix systems
    if ("Linux" not in stdout.read(-1)):
        sys.stderr.write("Deployment is supported only on Linux\n")
        return None

    tf = tempfile.NamedTemporaryFile(mode="wb", suffix=".zip", delete=True)
    pzf = zipfile.PyZipFile(tf, mode="w")
    pzf.writepy(os.path.dirname(sys.argv[0]))
    pzf.close()

    remote_tempfile = _prepare_remote_dep_file(ssh)
    if (not remote_tempfile):
        return None

    stdin, stdout, stderr = \
        ssh.exec_command("scp -t '{}'".format(remote_tempfile))

    ret = tfr.send(stdin, stdout, sys.stderr, sys.stdout, [tf.name], False, False)
    if ret == error.E_OK or ret == error.E_END:
        return remote_tempfile
    else:
        sys.stderr.write(stderr.readline())
        return None


text:
import React from 'react'

export class App extends React.Component {
  render() {
    return (

Your React App goes here!

    )
  }
}


text:
package com.intellij.openapi.fileTypes;

import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.TokenSet;

import java.util.Map;

public abstract class SyntaxHighlighterBase implements SyntaxHighlighter {
  protected static final TextAttributesKey[] EMPTY = new TextAttributesKey[0];

  public static TextAttributesKey[] pack(TextAttributesKey key) {
    if (key == null) return EMPTY;
    return new TextAttributesKey[] {key};
  }

  public static TextAttributesKey[] pack(TextAttributesKey key1, TextAttributesKey key2) {
    if (key1 == null) return pack(key2);
    if (key2 == null) return pack(key1);
    return new TextAttributesKey[] {key1, key2};
  }

  public static TextAttributesKey[] pack(TextAttributesKey[] base, TextAttributesKey key) {
    if (key == null) return base;
    TextAttributesKey[] result = new TextAttributesKey[base.length + 1];
    System.arraycopy(base, 0, result, 0, base.length);
    result[base.length] = key;
    return result;
  }
  public static TextAttributesKey[] pack(TextAttributesKey key, TextAttributesKey[] base) {
    if (key == null) return base;
    TextAttributesKey[] result = new TextAttributesKey[base.length + 1];
    System.arraycopy(base, 0, result, 1, base.length);
    result[0] = key;
    return result;
  }

  protected static void fillMap(Map<IElementType, TextAttributesKey> map, TokenSet keys, TextAttributesKey value) {
    IElementType[] types = keys.getTypes();
    fillMap(map, value, types);
  }

  protected static void fillMap(final Map<IElementType, TextAttributesKey> map, final TextAttributesKey value, final IElementType... types) {
    for (int i = 0; i < types.length; i++) {
      map.put(types[i], value);
    }
  }

  public static TextAttributesKey[] pack(TextAttributesKey[] base, TextAttributesKey t1, TextAttributesKey t2) {
    int add = 0;
    if (t1 != null) add++;
    if (t2 != null) add++;
    if (add == 0) return base;
    TextAttributesKey[] result = new TextAttributesKey[base.length + add];
    add = base.length;
    System.arraycopy(base, 0, result, 0, base.length);
    if (t1 != null) result[add++] = t1;
    if (t2 != null) result[add++] = t2;
    return result;
  }
}


text:
.class public final Landroid/telecom/InCallAdapter;
.super Ljava/lang/Object;
.source "InCallAdapter.java"

# instance fields
.field private final mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

# direct methods
.method public constructor <init>(Lcom/android/internal/telecom/IInCallAdapter;)V
    .locals 0
    .param p1, "adapter"    # Lcom/android/internal/telecom/IInCallAdapter;

    .prologue
    .line 49
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 50
    iput-object p1, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    .line 51
    return-void
.end method

# virtual methods
.method public answerCall(Ljava/lang/String;I)V
    .locals 1
    .param p1, "callId"    # Ljava/lang/String;
    .param p2, "videoState"    # I

    .prologue
    .line 61
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1, p2}, Lcom/android/internal/telecom/IInCallAdapter;->answerCall(Ljava/lang/String;I)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 64
    :goto_0
    return-void

    .line 62
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public conference(Ljava/lang/String;Ljava/lang/String;)V
    .locals 1
    .param p1, "callId"    # Ljava/lang/String;
    .param p2, "otherCallId"    # Ljava/lang/String;

    .prologue
    .line 221
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1, p2}, Lcom/android/internal/telecom/IInCallAdapter;->conference(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 224
    :goto_0
    return-void

    .line 222
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public disconnectCall(Ljava/lang/String;)V
    .locals 1
    .param p1, "callId"    # Ljava/lang/String;

    .prologue
    .line 87
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1}, Lcom/android/internal/telecom/IInCallAdapter;->disconnectCall(Ljava/lang/String;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 90
    :goto_0
    return-void

    .line 88
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public explicitCallTransfer(Ljava/lang/String;)V
    .locals 1
    .param p1, "callId"    # Ljava/lang/String;

    .prologue
    .line 336
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1}, Lcom/android/internal/telecom/IInCallAdapter;->explicitCallTransfer(Ljava/lang/String;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 339
    :goto_0
    return-void

    .line 337
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public hangupActiveAndAnswerWaiting()V
    .locals 1

    .prologue
    .line 369
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0}, Lcom/android/internal/telecom/IInCallAdapter;->hangupActiveAndAnswerWaiting()V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 372
    :goto_0
    return-void

    .line 370
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public hangupAll()V
    .locals 1

    .prologue
    .line 347
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0}, Lcom/android/internal/telecom/IInCallAdapter;->hangupAll()V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 350
    :goto_0
    return-void

    .line 348
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public hangupAllHoldCalls()V
    .locals 1

    .prologue
    .line 358
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0}, Lcom/android/internal/telecom/IInCallAdapter;->hangupAllHoldCalls()V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 361
    :goto_0
    return-void

    .line 359
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public holdCall(Ljava/lang/String;)V
    .locals 1
    .param p1, "callId"    # Ljava/lang/String;

    .prologue
    .line 99
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1}, Lcom/android/internal/telecom/IInCallAdapter;->holdCall(Ljava/lang/String;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 102
    :goto_0
    return-void

    .line 100
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public inviteConferenceParticipants(Ljava/lang/String;Ljava/util/List;)V
    .locals 1
    .param p1, "conferenceCallId"    # Ljava/lang/String;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/util/List",
            "<",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 394
    .local p2, "numbers":Ljava/util/List;, "Ljava/util/List<Ljava/lang/String;>;"
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1, p2}, Lcom/android/internal/telecom/IInCallAdapter;->inviteConferenceParticipants(Ljava/lang/String;Ljava/util/List;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 397
    :goto_0
    return-void

    .line 395
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public mergeConference(Ljava/lang/String;)V
    .locals 1
    .param p1, "callId"    # Ljava/lang/String;

    .prologue
    .line 245
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1}, Lcom/android/internal/telecom/IInCallAdapter;->mergeConference(Ljava/lang/String;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 248
    :goto_0
    return-void

    .line 246
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public mute(Z)V
    .locals 1
    .param p1, "shouldMute"    # Z

    .prologue
    .line 123
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1}, Lcom/android/internal/telecom/IInCallAdapter;->mute(Z)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 126
    :goto_0
    return-void

    .line 124
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public phoneAccountSelected(Ljava/lang/String;Landroid/telecom/PhoneAccountHandle;Z)V
    .locals 1
    .param p1, "callId"    # Ljava/lang/String;
    .param p2, "accountHandle"    # Landroid/telecom/PhoneAccountHandle;
    .param p3, "setDefault"    # Z

    .prologue
    .line 208
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1, p2, p3}, Lcom/android/internal/telecom/IInCallAdapter;->phoneAccountSelected(Ljava/lang/String;Landroid/telecom/PhoneAccountHandle;Z)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 211
    :goto_0
    return-void

    .line 209
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public playDtmfTone(Ljava/lang/String;C)V
    .locals 1
    .param p1, "callId"    # Ljava/lang/String;
    .param p2, "digit"    # C

    .prologue
    .line 151
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1, p2}, Lcom/android/internal/telecom/IInCallAdapter;->playDtmfTone(Ljava/lang/String;C)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 154
    :goto_0
    return-void

    .line 152
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public postDialContinue(Ljava/lang/String;Z)V
    .locals 1
    .param p1, "callId"    # Ljava/lang/String;
    .param p2, "proceed"    # Z

    .prologue
    .line 193
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1, p2}, Lcom/android/internal/telecom/IInCallAdapter;->postDialContinue(Ljava/lang/String;Z)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 196
    :goto_0
    return-void

    .line 194
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public rejectCall(Ljava/lang/String;ZLjava/lang/String;)V
    .locals 1
    .param p1, "callId"    # Ljava/lang/String;
    .param p2, "rejectWithMessage"    # Z
    .param p3, "textMessage"    # Ljava/lang/String;

    .prologue
    .line 75
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1, p2, p3}, Lcom/android/internal/telecom/IInCallAdapter;->rejectCall(Ljava/lang/String;ZLjava/lang/String;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 78
    :goto_0
    return-void

    .line 76
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public setAudioRoute(I)V
    .locals 1
    .param p1, "route"    # I

    .prologue
    .line 135
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1}, Lcom/android/internal/telecom/IInCallAdapter;->setAudioRoute(I)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 138
    :goto_0
    return-void

    .line 136
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public setSortedBackgroudCallList(Ljava/util/List;)V
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 313
    .local p1, "list":Ljava/util/List;, "Ljava/util/List<Ljava/lang/String;>;"
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1}, Lcom/android/internal/telecom/IInCallAdapter;->setSortedBackgroudCallList(Ljava/util/List;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 316
    :goto_0
    return-void

    .line 314
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public setSortedIncomingCallList(Ljava/util/List;)V
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 326
    .local p1, "list":Ljava/util/List;, "Ljava/util/List<Ljava/lang/String;>;"
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1}, Lcom/android/internal/telecom/IInCallAdapter;->setSortedIncomingCallList(Ljava/util/List;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 329
    :goto_0
    return-void

    .line 327
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public splitFromConference(Ljava/lang/String;)V
    .locals 1
    .param p1, "callId"    # Ljava/lang/String;

    .prologue
    .line 235
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1}, Lcom/android/internal/telecom/IInCallAdapter;->splitFromConference(Ljava/lang/String;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 238
    :goto_0
    return-void

    .line 236
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public startVoiceRecording()V
    .locals 1

    .prologue
    .line 289
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0}, Lcom/android/internal/telecom/IInCallAdapter;->startVoiceRecording()V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 292
    :goto_0
    return-void

    .line 290
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public stopDtmfTone(Ljava/lang/String;)V
    .locals 1
    .param p1, "callId"    # Ljava/lang/String;

    .prologue
    .line 167
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1}, Lcom/android/internal/telecom/IInCallAdapter;->stopDtmfTone(Ljava/lang/String;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 170
    :goto_0
    return-void

    .line 168
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public stopVoiceRecording()V
    .locals 1

    .prologue
    .line 301
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0}, Lcom/android/internal/telecom/IInCallAdapter;->stopVoiceRecording()V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 304
    :goto_0
    return-void

    .line 302
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public swapConference(Ljava/lang/String;)V
    .locals 1
    .param p1, "callId"    # Ljava/lang/String;

    .prologue
    .line 255
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1}, Lcom/android/internal/telecom/IInCallAdapter;->swapConference(Ljava/lang/String;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 258
    :goto_0
    return-void

    .line 256
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public switchToOtherActiveSub(Ljava/lang/String;Z)V
    .locals 1
    .param p1, "sub"    # Ljava/lang/String;
    .param p2, "retainLch"    # Z

    .prologue
    .line 403
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1, p2}, Lcom/android/internal/telecom/IInCallAdapter;->switchToOtherActiveSub(Ljava/lang/String;Z)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 406
    :goto_0
    return-void

    .line 404
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public turnProximitySensorOff(Z)V
    .locals 1
    .param p1, "screenOnImmediately"    # Z

    .prologue
    .line 279
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1}, Lcom/android/internal/telecom/IInCallAdapter;->turnOffProximitySensor(Z)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 282
    :goto_0
    return-void

    .line 280
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public turnProximitySensorOn()V
    .locals 1

    .prologue
    .line 265
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0}, Lcom/android/internal/telecom/IInCallAdapter;->turnOnProximitySensor()V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 268
    :goto_0
    return-void

    .line 266
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public unholdCall(Ljava/lang/String;)V
    .locals 1
    .param p1, "callId"    # Ljava/lang/String;

    .prologue
    .line 111
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1}, Lcom/android/internal/telecom/IInCallAdapter;->unholdCall(Ljava/lang/String;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 114
    :goto_0
    return-void

    .line 112
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public updatePowerForSmartBook(Z)V
    .locals 1
    .param p1, "onOff"    # Z

    .prologue
    .line 379
    :try_start_0
    iget-object v0, p0, Landroid/telecom/InCallAdapter;->mAdapter:Lcom/android/internal/telecom/IInCallAdapter;

    invoke-interface {v0, p1}, Lcom/android/internal/telecom/IInCallAdapter;->updatePowerForSmartBook(Z)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 382
    :goto_0
    return-void

    .line 380
    :catch_0
    move-exception v0

    goto :goto_0
.end method


text:
import React from 'react';
import { RaisedButton, FlatButton, Dialog, Styles } from 'material-ui/lib';

import debugging from 'debug';
let	debug = debugging('epg:app:common:components:dialog');

export default class Dialog2 extends React.Component {
	constructor(props) {
		super(props);

		this.handleNo = this.handleNo.bind(this);
	}

	handleNo() {
		if(typeof this.props.answer == 'function') {
			this.props.answer(false);
		}
	}

	render() {
		const actions = [
			<FlatButton
				label={this.props.closeText}
				secondary={true}
				onTouchTap={this.handleNo}
				style={{ color: Styles.Colors.blueGrey500}}
			/>,

		];

		return (

				<Dialog
					title={this.props.title}
					actions={actions}
					modal={false}
					open={this.props.open}
					onRequestClose={this.handleNo}
				>

				</Dialog>

		);
	}
}

Dialog2.defaultProps = {
	closeText: 'Close',
	open: false,
	html: 'Placeholder Text',
	title: 'Dialog',
};


text:
//
//  BAHYouTubeOAuthViewController.m
//  Pods
//
//  Created by BHughes on 2/11/15.
//
//

#import "BAHYouTubeOAuthViewController.h"

@interface BAHYouTubeOAuthViewController ()

@end

@implementation BAHYouTubeOAuthViewController

static NSString *youTubeTokenURL = @"https://accounts.google.com/o/oauth2/token";

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    [self.navigationController.navigationBar setTranslucent:NO];

    [self.navigationController.navigationBar setBarTintColor:[UIColor colorWithRed:229.0f/255 green:45.0f/255 blue:39.0f/255 alpha:1.0f]];

    UIImageView *logo = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 200, 80)];
    [logo setTintColor:[UIColor whiteColor]];
    [logo setContentMode:UIViewContentModeScaleAspectFit];
    [logo setImage:[[UIImage imageNamed:@"YouTube.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]];
    [self.navigationItem setTitleView:logo];

    NSLog(@"image: %@", logo.image);

    self.oAuthWebView = [[UIWebView alloc]initWithFrame:self.view.frame];
    [self.oAuthWebView setDelegate:self];

    [self.view addSubview:self.oAuthWebView];

}

-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{

    NSString *URLString = [[request URL] absoluteString];

    NSString *callBackString = [NSString stringWithFormat:@"%@?", self.uriCallBack];

    if ([URLString rangeOfString:callBackString].location != NSNotFound) {

        NSArray *codeArray = [URLString componentsSeparatedByString:@"code="];

        NSString *code = [codeArray lastObject];

        NSString *post = [NSString stringWithFormat:@"code=%@&client_id=%@&client_secret=%@&redirect_uri=%@&grant_type=authorization_code", code, self.youtubeClientID, self.youtubeClientSecret, self.uriCallBack];

        NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
        NSString *postLength = [NSString stringWithFormat:@"%lu", (unsigned long)[post length]];

        NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:youTubeTokenURL]];

        [request setHTTPMethod:@"POST"];
        [request setValue:postLength forHTTPHeaderField:@"Content-Length"];
        [request setHTTPBody:postData];

        NSOperationQueue *queue = [[NSOperationQueue alloc] init];

        [NSURLConnection sendAsynchronousRequest:request queue:queue completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {

            NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
            NSData *jsonData = [responseString dataUsingEncoding:NSUTF8StringEncoding];
            id json = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:nil];

            NSString *token = [json objectForKey:@"access_token"];
            NSString *refreshToken = [json objectForKey:@"refresh_token"];
            if (token && refreshToken) {

                BAHYouTubeOAuth *youTubeOAuth = (BAHYouTubeOAuth*)self.youTubeSender;
                youTubeOAuth.completelion(YES, token, refreshToken);
                [self dismissViewControllerAnimated:YES completion:nil];

            }else{
                //TODO: Handle Error
            }

        }];

        return NO;
    }

    return YES;

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
package com.google.testing.i18n.sanitycheck.parser;

/**
 * An object that represents an exception that would be thrown by {@link Parser} object if parsing
 * error happened.
 */
public class ParserException extends Exception {

  public ParserException(String message) {
    super(message);
  }

  public ParserException(String message, Throwable cause) {
    super(message, cause);
  }

}


text:
package java.util.stream;

import org.testng.annotations.Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.EnumSet;
import java.util.List;
import java.util.Spliterator;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.ToDoubleFunction;
import java.util.function.ToIntFunction;
import java.util.function.ToLongFunction;

import static java.util.stream.Collectors.toList;
import static java.util.stream.StreamOpFlag.*;
import static org.testng.Assert.*;
import static org.testng.Assert.assertEquals;

@Test
public class StreamOpFlagsTest {

    public void testNullCombine() {
        int sourceFlags = StreamOpFlag.IS_SIZED;

        assertEquals(sourceFlags, toStreamFlags(combineOpFlags(sourceFlags, StreamOpFlag.INITIAL_OPS_VALUE)));
    }

    public void testInitialOpFlagsFromSourceFlags() {
        List<StreamOpFlag> flags = new ArrayList<>(StreamOpFlagTestHelper.allStreamFlags());
        for (int i = 0; i < (1 << flags.size()); i++)  {
            int sourceFlags = 0;
            for (int f = 0; f < flags.size(); f++) {
                if ((i & (1 << f)) != 0)  {
                    sourceFlags |= flags.get(f).set();
                }
            }

            int opsFlags = combineOpFlags(sourceFlags, StreamOpFlag.INITIAL_OPS_VALUE);
            assertEquals(opsFlags, (~(sourceFlags << 1)) & StreamOpFlag.INITIAL_OPS_VALUE);
        }
    }

    public void testSameCombine() {
        for (StreamOpFlag f : StreamOpFlagTestHelper.allStreamFlags()) {
            int sourceFlags = f.set();
            int opsFlags;

            opsFlags = combineOpFlags(sourceFlags, StreamOpFlag.INITIAL_OPS_VALUE);
            opsFlags = combineOpFlags(f.set(), opsFlags);
            assertEquals(sourceFlags, toStreamFlags(opsFlags));
        }
    }

    public void testOpClear() {
        for (StreamOpFlag f : StreamOpFlagTestHelper.allStreamFlags()) {
            // Clear when source not set
            int sourceFlags = 0;
            int opsFlags;

            opsFlags = combineOpFlags(sourceFlags, StreamOpFlag.INITIAL_OPS_VALUE);
            opsFlags = combineOpFlags(f.clear(), opsFlags);
            assertEquals(sourceFlags, toStreamFlags(opsFlags));

            // Clear when source set
            sourceFlags = f.set();

            opsFlags = combineOpFlags(sourceFlags, StreamOpFlag.INITIAL_OPS_VALUE);
            opsFlags = combineOpFlags(f.clear(), opsFlags);
            assertEquals(0, toStreamFlags(opsFlags));
        }
    }

    public void testOpInject() {
        for (StreamOpFlag f : StreamOpFlagTestHelper.allStreamFlags()) {
            // Set when source not set
            int sourceFlags = 0;
            int opsFlags;

            opsFlags = combineOpFlags(sourceFlags, StreamOpFlag.INITIAL_OPS_VALUE);
            opsFlags = combineOpFlags(f.set(), opsFlags);
            assertEquals(f.set(), toStreamFlags(opsFlags));

            // Set when source set
            sourceFlags = f.set();

            opsFlags = combineOpFlags(sourceFlags, StreamOpFlag.INITIAL_OPS_VALUE);
            opsFlags = combineOpFlags(f.set(), opsFlags);
            assertEquals(sourceFlags, toStreamFlags(opsFlags));
        }
    }

    public void testPairSet() {
        List<Integer> sourceFlagsList
                = StreamOpFlagTestHelper.allStreamFlags().stream().map(StreamOpFlag::set).collect(toList());
        sourceFlagsList.add(0, 0);

        for (int sourceFlags : sourceFlagsList) {
            for (StreamOpFlag f1 : StreamOpFlagTestHelper.allStreamFlags()) {
                for (StreamOpFlag f2 : StreamOpFlagTestHelper.allStreamFlags()) {
                    int opsFlags;

                    opsFlags = combineOpFlags(sourceFlags, StreamOpFlag.INITIAL_OPS_VALUE);
                    opsFlags = combineOpFlags(f1.set(), opsFlags);
                    opsFlags = combineOpFlags(f2.set(), opsFlags);
                    assertEquals(sourceFlags | f1.set() | f2.set(), toStreamFlags(opsFlags));
                }
            }
        }
    }

    public void testPairSetAndClear() {
        List<Integer> sourceFlagsList
                = StreamOpFlagTestHelper.allStreamFlags().stream().map(StreamOpFlag::set).collect(toList());
        sourceFlagsList.add(0, 0);

        for (int sourceFlags : sourceFlagsList) {
            for (StreamOpFlag f1 : StreamOpFlagTestHelper.allStreamFlags())  {
                for (StreamOpFlag f2 : StreamOpFlagTestHelper.allStreamFlags()) {
                    int opsFlags;

                    opsFlags = combineOpFlags(sourceFlags, StreamOpFlag.INITIAL_OPS_VALUE);
                    opsFlags = combineOpFlags(f1.set(), opsFlags);
                    opsFlags = combineOpFlags(f2.clear(), opsFlags);
                    if (f1 == f2)
                        assertEquals((f2.set() == sourceFlags) ? 0 : sourceFlags, toStreamFlags(opsFlags));
                    else
                        assertEquals((f2.set() == sourceFlags) ? f1.set() : sourceFlags | f1.set(), toStreamFlags(opsFlags));
                }
            }
        }
    }

    public void testShortCircuit() {
        int opsFlags = combineOpFlags(0, StreamOpFlag.INITIAL_OPS_VALUE);
        assertFalse(StreamOpFlag.SHORT_CIRCUIT.isKnown(opsFlags));

        opsFlags = combineOpFlags(StreamOpFlag.IS_SHORT_CIRCUIT, opsFlags);
        assertTrue(StreamOpFlag.SHORT_CIRCUIT.isKnown(opsFlags));

        opsFlags = combineOpFlags(0, opsFlags);
        assertTrue(StreamOpFlag.SHORT_CIRCUIT.isKnown(opsFlags));
    }

    public void testApplySourceFlags() {
        int sourceFlags = StreamOpFlag.IS_SIZED | StreamOpFlag.IS_DISTINCT;

        List<Integer> ops = Arrays.asList(StreamOpFlag.NOT_SIZED, StreamOpFlag.IS_ORDERED | StreamOpFlag.IS_SORTED);

        int opsFlags = StreamOpFlag.combineOpFlags(sourceFlags, StreamOpFlag.INITIAL_OPS_VALUE);
        for (int opFlags : ops) {
            opsFlags = combineOpFlags(opFlags, opsFlags);
        }
        assertFalse(StreamOpFlag.SIZED.isKnown(opsFlags));
        assertTrue(StreamOpFlag.SIZED.isCleared(opsFlags));
        assertFalse(StreamOpFlag.SIZED.isPreserved(opsFlags));
        assertTrue(StreamOpFlag.DISTINCT.isKnown(opsFlags));
        assertFalse(StreamOpFlag.DISTINCT.isCleared(opsFlags));
        assertFalse(StreamOpFlag.DISTINCT.isPreserved(opsFlags));
        assertTrue(StreamOpFlag.SORTED.isKnown(opsFlags));
        assertFalse(StreamOpFlag.SORTED.isCleared(opsFlags));
        assertFalse(StreamOpFlag.SORTED.isPreserved(opsFlags));
        assertTrue(StreamOpFlag.ORDERED.isKnown(opsFlags));
        assertFalse(StreamOpFlag.ORDERED.isCleared(opsFlags));
        assertFalse(StreamOpFlag.ORDERED.isPreserved(opsFlags));

        int streamFlags = toStreamFlags(opsFlags);
        assertFalse(StreamOpFlag.SIZED.isKnown(streamFlags));
        assertTrue(StreamOpFlag.DISTINCT.isKnown(streamFlags));
        assertTrue(StreamOpFlag.SORTED.isKnown(streamFlags));
        assertTrue(StreamOpFlag.ORDERED.isKnown(streamFlags));
    }

    public void testSpliteratorMask() {
        assertSpliteratorMask(StreamOpFlag.DISTINCT.set(), StreamOpFlag.IS_DISTINCT);
        assertSpliteratorMask(StreamOpFlag.DISTINCT.clear(), 0);

        assertSpliteratorMask(StreamOpFlag.SORTED.set(), StreamOpFlag.IS_SORTED);
        assertSpliteratorMask(StreamOpFlag.SORTED.clear(), 0);

        assertSpliteratorMask(StreamOpFlag.ORDERED.set(), StreamOpFlag.IS_ORDERED);
        assertSpliteratorMask(StreamOpFlag.ORDERED.clear(), 0);

        assertSpliteratorMask(StreamOpFlag.SIZED.set(), StreamOpFlag.IS_SIZED);
        assertSpliteratorMask(StreamOpFlag.SIZED.clear(), 0);

        assertSpliteratorMask(StreamOpFlag.SHORT_CIRCUIT.set(), 0);
        assertSpliteratorMask(StreamOpFlag.SHORT_CIRCUIT.clear(), 0);
    }

    private void assertSpliteratorMask(int actual, int expected) {
        assertEquals(actual & StreamOpFlag.SPLITERATOR_CHARACTERISTICS_MASK, expected);
    }

    public void testStreamMask() {
        assertStreamMask(StreamOpFlag.DISTINCT.set(), StreamOpFlag.IS_DISTINCT);
        assertStreamMask(StreamOpFlag.DISTINCT.clear(), 0);

        assertStreamMask(StreamOpFlag.SORTED.set(), StreamOpFlag.IS_SORTED);
        assertStreamMask(StreamOpFlag.SORTED.clear(), 0);

        assertStreamMask(StreamOpFlag.ORDERED.set(), StreamOpFlag.IS_ORDERED);
        assertStreamMask(StreamOpFlag.ORDERED.clear(), 0);

        assertStreamMask(StreamOpFlag.SIZED.set(), StreamOpFlag.IS_SIZED);
        assertStreamMask(StreamOpFlag.SIZED.clear(), 0);

        assertStreamMask(StreamOpFlag.SHORT_CIRCUIT.set(), 0);
        assertStreamMask(StreamOpFlag.SHORT_CIRCUIT.clear(), 0);
    }

    private void assertStreamMask(int actual, int expected) {
        assertEquals(actual & StreamOpFlag.STREAM_MASK, expected);
    }

    public void testOpMask() {
        assertOpMask(StreamOpFlag.DISTINCT.set(), StreamOpFlag.IS_DISTINCT);
        assertOpMask(StreamOpFlag.DISTINCT.clear(), StreamOpFlag.NOT_DISTINCT);

        assertOpMask(StreamOpFlag.SORTED.set(), StreamOpFlag.IS_SORTED);
        assertOpMask(StreamOpFlag.SORTED.clear(), StreamOpFlag.NOT_SORTED);

        assertOpMask(StreamOpFlag.ORDERED.set(), StreamOpFlag.IS_ORDERED);
        assertOpMask(StreamOpFlag.ORDERED.clear(), StreamOpFlag.NOT_ORDERED);

        assertOpMask(StreamOpFlag.SIZED.set(), 0);
        assertOpMask(StreamOpFlag.SIZED.clear(), StreamOpFlag.NOT_SIZED);

        assertOpMask(StreamOpFlag.SHORT_CIRCUIT.set(), StreamOpFlag.IS_SHORT_CIRCUIT);
        assertOpMask(StreamOpFlag.SHORT_CIRCUIT.clear(), 0);
    }

    private void assertOpMask(int actual, int expected) {
        assertEquals(actual & StreamOpFlag.OP_MASK, expected);
    }

    public void testTerminalOpMask() {
        assertTerminalOpMask(StreamOpFlag.DISTINCT.set(), 0);
        assertTerminalOpMask(StreamOpFlag.DISTINCT.clear(), 0);

        assertTerminalOpMask(StreamOpFlag.SORTED.set(), 0);
        assertTerminalOpMask(StreamOpFlag.SORTED.clear(), 0);

        assertTerminalOpMask(StreamOpFlag.ORDERED.set(), 0);
        assertTerminalOpMask(StreamOpFlag.ORDERED.clear(), StreamOpFlag.NOT_ORDERED);

        assertTerminalOpMask(StreamOpFlag.SIZED.set(), 0);
        assertTerminalOpMask(StreamOpFlag.SIZED.clear(), 0);

        assertTerminalOpMask(StreamOpFlag.SHORT_CIRCUIT.set(), StreamOpFlag.IS_SHORT_CIRCUIT);
        assertTerminalOpMask(StreamOpFlag.SHORT_CIRCUIT.clear(), 0);
    }

    private void assertTerminalOpMask(int actual, int expected) {
        assertEquals(actual & StreamOpFlag.TERMINAL_OP_MASK, expected);
    }

    public void testUpstreamTerminalOpMask() {
        assertUpstreamTerminalOpMask(StreamOpFlag.DISTINCT.set(), 0);
        assertUpstreamTerminalOpMask(StreamOpFlag.DISTINCT.clear(), 0);

        assertUpstreamTerminalOpMask(StreamOpFlag.SORTED.set(), 0);
        assertUpstreamTerminalOpMask(StreamOpFlag.SORTED.clear(), 0);

        assertUpstreamTerminalOpMask(StreamOpFlag.ORDERED.set(), 0);
        assertUpstreamTerminalOpMask(StreamOpFlag.ORDERED.clear(), StreamOpFlag.NOT_ORDERED);

        assertUpstreamTerminalOpMask(StreamOpFlag.SIZED.set(), 0);
        assertUpstreamTerminalOpMask(StreamOpFlag.SIZED.clear(), 0);

        assertUpstreamTerminalOpMask(StreamOpFlag.SHORT_CIRCUIT.set(), 0);
        assertUpstreamTerminalOpMask(StreamOpFlag.SHORT_CIRCUIT.clear(), 0);
    }

    private void assertUpstreamTerminalOpMask(int actual, int expected) {
        assertEquals(actual & StreamOpFlag.UPSTREAM_TERMINAL_OP_MASK, expected);
    }

    public void testSpliteratorCharacteristics() {
        assertEquals(Spliterator.DISTINCT, StreamOpFlag.IS_DISTINCT);
        assertEquals(Spliterator.SORTED, StreamOpFlag.IS_SORTED);
        assertEquals(Spliterator.ORDERED, StreamOpFlag.IS_ORDERED);
        assertEquals(Spliterator.SIZED, StreamOpFlag.IS_SIZED);

        List<Integer> others = Arrays.asList(Spliterator.NONNULL, Spliterator.IMMUTABLE,
                                             Spliterator.CONCURRENT, Spliterator.SUBSIZED);
        for (int c : others) {
            assertNotEquals(c, StreamOpFlag.IS_SHORT_CIRCUIT);
        }
    }

    public void testSpliteratorCharacteristicsMask() {
        assertSpliteratorCharacteristicsMask(StreamOpFlag.DISTINCT.set(), StreamOpFlag.IS_DISTINCT);
        assertSpliteratorCharacteristicsMask(StreamOpFlag.DISTINCT.clear(), 0);

        assertSpliteratorCharacteristicsMask(StreamOpFlag.SORTED.set(), StreamOpFlag.IS_SORTED);
        assertSpliteratorCharacteristicsMask(StreamOpFlag.SORTED.clear(), 0);

        assertSpliteratorCharacteristicsMask(StreamOpFlag.ORDERED.set(), StreamOpFlag.IS_ORDERED);
        assertSpliteratorCharacteristicsMask(StreamOpFlag.ORDERED.clear(), 0);

        assertSpliteratorCharacteristicsMask(StreamOpFlag.SIZED.set(), StreamOpFlag.IS_SIZED);
        assertSpliteratorCharacteristicsMask(StreamOpFlag.SIZED.clear(), 0);

        assertSpliteratorCharacteristicsMask(StreamOpFlag.SHORT_CIRCUIT.set(), 0);
        assertSpliteratorCharacteristicsMask(StreamOpFlag.SHORT_CIRCUIT.clear(), 0);
    }

    private void assertSpliteratorCharacteristicsMask(int actual, int expected) {
        assertEquals(StreamOpFlag.fromCharacteristics(actual), expected);
    }

    public void testSpliteratorSorted() {
        class SortedEmptySpliterator implements Spliterator<Object> {
            final Comparator<Object> c;

            SortedEmptySpliterator(Comparator<Object> c) {
                this.c = c;
            }

            @Override
            public Spliterator<Object> trySplit() {
                return null;
            }

            @Override
            public boolean tryAdvance(Consumer<? super Object> action) {
                return false;
            }

            @Override
            public long estimateSize() {
                return Long.MAX_VALUE;
            }

            @Override
            public int characteristics() {
                return Spliterator.SORTED;
            }

            @Override
            public Comparator<? super Object> getComparator() {
                return c;
            }
        };

        {
            int flags = StreamOpFlag.fromCharacteristics(new SortedEmptySpliterator(null));
            assertEquals(flags, StreamOpFlag.IS_SORTED);
        }

        {
            int flags = StreamOpFlag.fromCharacteristics(new SortedEmptySpliterator((a, b) -> 0));
            assertEquals(flags, 0);
        }
    }
}