text:
import React from 'react';
import {connect} from 'react-redux';
import {Form, Input, Button, Select} from 'antd';
import {action, selector} from './redux';
import {action as authAction, AUTH_USER_STATUS} from '../../util/auth/';
import style from './UserFilter.module.scss';

class UserFilter extends React.Component {
  constructor(props) {
    super(props);

    this.state = {
      mobilePhoneNumber: {
        hasFeedback: false,
        validateStatus: undefined,
        valid: true,
      },
    };
  }

  componentWillReceiveProps(nextProps) {
    const {form, needResetFilter} = nextProps;

    if (this.props.needResetFilter !== needResetFilter) {
      form.resetFields();
      this.setState((prevState, props) => {
        return {
          ...prevState,
          mobilePhoneNumber: {
            hasFeedback: false,
            validateStatus: 'success',
            valid: true,
          },
        };
      });
    }
  }

  handleSubmit = (e) => {
    e.preventDefault();
    this.props.form.validateFields((err, values) => {
      if (err) {
        return;
      }

      const {valid: mobilePhoneNumberValid} = this.state.mobilePhoneNumber;
      if (!mobilePhoneNumberValid) {
        return;
      }

      const {nickname, mobilePhoneNumber, status} = values;
      this.props.listAdminUsers({
        limit: 1000,
        skipMyself: true,
        nickname,
        mobilePhoneNumber,
        status: status && parseInt(status),
        onStart: () => {
          this.props.changeLoading({loading: true});
        },
        onComplete: () => {
          this.props.changeLoading({loading: false});
        },
      });
    });
  };

  render() {
    const {getFieldDecorator} = this.props.form;

    const validateMobilePhoneNumber = (rule, value, callback) => {
      let hasFeedback = false;
      let validateStatus = undefined;
      let valid = true;

      if (value) {
        const reMobilePhoneNumber = /^1\d{10}$/;
        if (!reMobilePhoneNumber.test(value)) {
          hasFeedback = true;
          validateStatus = 'error';
          valid = false;
        }
      }

      this.setState((prevState, props) => {
        return {
          ...prevState,
          mobilePhoneNumber: {
            hasFeedback,
            validateStatus,
            valid,
          },
        };
      });

      callback();
    };

    return (
      <Form layout="inline" onSubmit={this.handleSubmit} className={style.UserFilter}>
        <Form.Item className={style.nickname}>
          {getFieldDecorator('nickname', {})(
            <Input placeholder="用户名" />
          )}
        </Form.Item>
        <Form.Item className={style.mobilePhoneNumber}
                   hasFeedback={this.state.mobilePhoneNumber.hasFeedback}
                   validateStatus={this.state.mobilePhoneNumber.validateStatus}
        >
          {getFieldDecorator('mobilePhoneNumber', {
            rules: [{
              validator: validateMobilePhoneNumber,
            },]
          })(
            <Input placeholder="手机号码"/>
          )}
        </Form.Item>
        <Form.Item className={style.status}>
          {getFieldDecorator("status", {})(
            <Select placeholder="选择状态">
              <Select.Option value={AUTH_USER_STATUS.ADMIN_ALL.toString()}>全部</Select.Option>
              <Select.Option value={AUTH_USER_STATUS.ADMIN_NORMAL.toString()}>正常</Select.Option>
              <Select.Option value={AUTH_USER_STATUS.ADMIN_DISABLED.toString()}>禁用</Select.Option>
            </Select>
          )}
        </Form.Item>
        <Form.Item>
          <Button.Group>
            <Button
              onClick={() => {
                this.props.form.resetFields();
                this.setState((prevState, props) => {
                  return {
                    ...prevState,
                    mobilePhoneNumber: {
                      hasFeedback: false,
                      validateStatus: 'success',
                      valid: true,
                    },
                  };
                });
              }}
            >
              重置
            </Button>
            <Button
              type='primary'
              htmlType='submit'
            >
              查询
            </Button>
          </Button.Group>
        </Form.Item>
      </Form>
    );
  }
}

const mapStateToProps = (appState, ownProps) => {
  const needResetFilter = selector.selectNeedResetFilter(appState);

  return {
    needResetFilter,
  };
};

const mapDispatchToProps = {
  ...action,
  ...authAction,
};

export default connect(mapStateToProps, mapDispatchToProps)(Form.create()(UserFilter));


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/xhtml;charset=UTF-8"/>
<title>sfmt-extstate.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css"/>

Main Page

Data Structures

Files

        <input type="text" id="MSearchField" value="Search" accesskey="S"
             onfocus="searchBox.OnSearchFieldFocus(true)"
             onblur="searchBox.OnSearchFieldFocus(false)"
             onkeyup="searchBox.OnSearchFieldChange(event)"/>

File List

Globals

sfmt-extstate.h
Go to the documentation of this file.

00001 /* This file is a part of sfmt-extstate */
00002
00035 #ifndef SFMT_EXTSTATE_H
00036 #define SFMT_EXTSTATE_H
00037
00038 #include <stdio.h>
00039 #include "sfmt-params-M19937.h"
00040
00041 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
00042   #include <inttypes.h>
00043 #elif defined(_MSC_VER) || defined(__BORLANDC__)
00044   typedef unsigned int uint32_t;
00045   typedef unsigned __int64 uint64_t;
00046   #define inline __inline
00047 #else
00048   #include <inttypes.h>
00049   #if defined(__GNUC__)
00050     #define inline __inline__
00051   #endif
00052 #endif
00053
00054 #ifndef PRIu64
00055   #if defined(_MSC_VER) || defined(__BORLANDC__)
00056     #define PRIu64 "I64u"
00057     #define PRIx64 "I64x"
00058   #else
00059     #define PRIu64 "llu"
00060     #define PRIx64 "llx"
00061   #endif
00062 #endif
00063
00064 #if defined(__GNUC__)
00065 #define ALWAYSINLINE __attribute__((always_inline))
00066 #else
00067 #define ALWAYSINLINE
00068 #endif
00069
00070 #if defined(_MSC_VER)
00071   #if _MSC_VER >= 1200
00072     #define PRE_ALWAYS __forceinline
00073   #else
00074     #define PRE_ALWAYS inline
00075   #endif
00076 #else
00077   #define PRE_ALWAYS inline
00078 #endif
00079
00080 /*------------------------------------------------------
00081   128-bit SIMD data type for SSE2 or standard C
00082   ------------------------------------------------------*/
00083 #if defined(HAVE_SSE2)
00084   #include <emmintrin.h>
00085
00087 union W128_T {
00088     __m128i si;
00089     uint32_t u[4];
00090 };
00092 typedef union W128_T w128_t;
00093
00094 #else /* HAVE_SSE2 */
00095
00097 struct W128_T {
00098     uint32_t u[4];
00099 };
00101 typedef struct W128_T w128_t;
00102
00103 #endif /* HAVE_SSE2 */
00104
00105 /* public functions for the state tables */
00106 void gen_rand_all(w128_t *intstate);
00107 void gen_rand_array(w128_t *array, int size, w128_t *intstate);
00108 void period_certification(w128_t *intstate);
00109 const char *get_idstring(void);
00110 int get_min_array_size32(void);
00111 void init_gen_rand(uint32_t seed, w128_t *intstate);
00112 void init_by_array(uint32_t *init_key, int key_length, w128_t *intstate);
00113
00114 #endif /* SFMT_EXTSTATE_H */

 All Data Structures Files Functions Variables Typedefs Defines

<address style="text-align: right;">Generated on Tue Jun 29 14:00:07 2010 by

 1.6.3 </address>

redpajama_set_name: RedPajamaGithub


text:
@interface BMWheelControlTests : SenTestCase

@end


text:
package io.crate.analyze;

import io.crate.analyze.relations.AnalyzedRelation;

public class AnalyzedStatementVisitor<C, R> {

    protected R visitAnalyzedStatement(AnalyzedStatement analyzedStatement, C context) {
        return null;
    }

    protected R visitCopyFromStatement(AnalyzedCopyFrom analysis, C context) {
        return visitAnalyzedStatement(analysis, context);
    }

    protected R visitCopyToStatement(AnalyzedCopyTo analysis, C context) {
        return visitAnalyzedStatement(analysis, context);
    }

    protected R visitCreateRepositoryAnalyzedStatement(AnalyzedCreateRepository analysis, C context) {
        return visitDDLStatement(analysis, context);
    }

    protected R visitAnalyzedInsertStatement(AnalyzedInsertStatement analysis, C context) {
        return visitAnalyzedStatement(analysis, context);
    }

    public R visitSelectStatement(AnalyzedRelation relation, C context) {
        return visitAnalyzedStatement(relation, context);
    }

    protected R visitCreateFunction(AnalyzedCreateFunction analysis, C context) {
        return visitDDLStatement(analysis, context);
    }

    public R visitDropFunction(AnalyzedDropFunction analysis, C context) {
        return visitAnalyzedStatement(analysis, context);
    }

    protected R visitAnalyzedCreateUser(AnalyzedCreateUser analysis, C context) {
        return visitAnalyzedStatement(analysis, context);
    }

    protected R visitDropUser(AnalyzedDropUser analysis, C context) {
        return visitAnalyzedStatement(analysis, context);
    }

    protected R visitCreateAnalyzerStatement(AnalyzedCreateAnalyzer analysis, C context) {
        return visitDDLStatement(analysis, context);
    }

    protected R visitDropAnalyzerStatement(AnalyzedDropAnalyzer analysis, C context) {
        return visitDDLStatement(analysis, context);
    }

    protected R visitDDLStatement(DDLStatement analysis, C context) {
        return visitAnalyzedStatement(analysis, context);
    }

    public R visitAnalyzedCreateBlobTable(AnalyzedCreateBlobTable analysis, C context) {
        return visitAnalyzedStatement(analysis, context);
    }

    public R visitOptimizeTableStatement(AnalyzedOptimizeTable analysis, C context) {
        return visitDDLStatement(analysis, context);
    }

    public R visitRefreshTableStatement(AnalyzedRefreshTable analysis, C context) {
        return visitDDLStatement(analysis, context);
    }

    public R visitAnalyzedAlterTableRename(AnalyzedAlterTableRename analysis, C context) {
        return visitDDLStatement(analysis, context);
    }

    public R visitRerouteRetryFailedStatement(AnalyzedRerouteRetryFailed analysis, C context) {
        return visitDDLStatement(analysis, context);
    }

    public R visitAnalyzedAlterBlobTable(AnalyzedAlterBlobTable analysis, C context) {
        return visitDDLStatement(analysis, context);
    }

    public R visitAnalyzedAlterUser(AnalyzedAlterUser analysis, C context) {
        return visitAnalyzedStatement(analysis, context);
    }

    public R visitSetStatement(AnalyzedSetStatement analysis, C context) {
        return visitAnalyzedStatement(analysis, context);
    }

    public R visitSetLicenseStatement(AnalyzedSetLicenseStatement analysis, C context) {
        return visitAnalyzedStatement(analysis, context);
    }

    public R visitSetSessionAuthorizationStatement(AnalyzedSetSessionAuthorizationStatement analysis,
                                                   C context) {
        return visitAnalyzedStatement(analysis, context);
    }

    public R visitAnalyzedAlterTableOpenClose(AnalyzedAlterTableOpenClose analysis, C context) {
        return visitDDLStatement(analysis, context);
    }

    public R visitKillAnalyzedStatement(AnalyzedKill analysis, C context) {
        return visitAnalyzedStatement(analysis, context);
    }

    public R visitDeallocateAnalyzedStatement(AnalyzedDeallocate analysis, C context) {
        return visitAnalyzedStatement(analysis, context);
    }

    public R visitShowCreateTableAnalyzedStatement(AnalyzedShowCreateTable analysis, C context) {
        return visitAnalyzedStatement(analysis, context);
    }

    public R visitDropRepositoryAnalyzedStatement(AnalyzedDropRepository analysis, C context) {
        return visitDDLStatement(analysis, context);
    }

    public R visitDropSnapshotAnalyzedStatement(AnalyzedDropSnapshot analysis, C context) {
        return visitDDLStatement(analysis, context);
    }

    public R visitCreateSnapshotAnalyzedStatement(AnalyzedCreateSnapshot analysis, C context) {
        return visitDDLStatement(analysis, context);
    }

    public R visitRestoreSnapshotAnalyzedStatement(AnalyzedRestoreSnapshot analysis, C context) {
        return visitDDLStatement(analysis, context);
    }

    public R visitResetAnalyzedStatement(AnalyzedResetStatement resetAnalyzedStatement, C context) {
        return visitAnalyzedStatement(resetAnalyzedStatement, context);
    }

    public R visitExplainStatement(ExplainAnalyzedStatement explainAnalyzedStatement, C context) {
        return visitAnalyzedStatement(explainAnalyzedStatement, context);
    }

    public R visitBegin(AnalyzedBegin analyzedBegin, C context) {
        return visitAnalyzedStatement(analyzedBegin, context);
    }

    public R visitCommit(AnalyzedCommit analyzedCommit, C context) {
        return visitAnalyzedStatement(analyzedCommit, context);
    }

    public R visitPrivilegesStatement(AnalyzedPrivileges analysis, C context) {
        return visitDCLStatement(analysis, context);
    }

    public R visitDCLStatement(DCLStatement analysis, C context) {
        return visitAnalyzedStatement(analysis, context);
    }

    protected R visitRerouteMoveShard(AnalyzedRerouteMoveShard analysis, C context) {
        return visitDDLStatement(analysis, context);
    }

    protected R visitRerouteAllocateReplicaShard(AnalyzedRerouteAllocateReplicaShard analysis, C context) {
        return visitDDLStatement(analysis, context);
    }

    protected R visitRerouteCancelShard(AnalyzedRerouteCancelShard analysis, C context) {
        return visitDDLStatement(analysis, context);
    }

    protected R visitAnalyzedDeleteStatement(AnalyzedDeleteStatement statement, C context) {
        return visitAnalyzedStatement(statement, context);
    }

    public R visitAnalyzedUpdateStatement(AnalyzedUpdateStatement statement, C context) {
        return visitAnalyzedStatement(statement, context);
    }

    public R visitCreateViewStmt(CreateViewStmt createViewStmt, C context) {
        return visitAnalyzedStatement(createViewStmt, context);
    }

    public R visitDropView(AnalyzedDropView dropView, C context) {
        return visitAnalyzedStatement(dropView, context);
    }

    public R visitSwapTable(AnalyzedSwapTable swapTable, C context) {
        return visitAnalyzedStatement(swapTable, context);
    }

    public R visitGCDanglingArtifacts(AnalyzedGCDanglingArtifacts gcDanglingIndices, C context) {
        return visitAnalyzedStatement(gcDanglingIndices, context);
    }

    public R visitDecommissionNode(AnalyzedDecommissionNode decommissionNode, C context) {
        return visitAnalyzedStatement(decommissionNode, context);
    }

    public R visitReroutePromoteReplica(AnalyzedPromoteReplica promoteReplicaStatement, C context) {
        return visitDDLStatement(promoteReplicaStatement, context);
    }

    public R visitDropTable(AnalyzedDropTable<?> dropTable, C context) {
        return visitDDLStatement(dropTable, context);
    }

    public R visitCreateTable(AnalyzedCreateTable createTable, C context) {
        return visitDDLStatement(createTable, context);
    }

    public R visitAlterTableAddColumn(AnalyzedAlterTableAddColumn alterTableAddColumn, C context) {
        return visitDDLStatement(alterTableAddColumn, context);
    }

    public R visitAlterTableDropCheckConstraint(AnalyzedAlterTableDropCheckConstraint dropCheckConstraint, C context) {
        return visitDDLStatement(dropCheckConstraint, context);
    }

    public R visitAlterTable(AnalyzedAlterTable alterTable, C context) {
        return visitDDLStatement(alterTable, context);
    }

    public R visitAnalyze(AnalyzedAnalyze analyzedAnalyze, C context) {
        return visitDDLStatement(analyzedAnalyze, context);
    }

    public R visitDiscard(AnalyzedDiscard discard, C context) {
        return visitAnalyzedStatement(discard, context);
    }

    public R visitSetTransaction(AnalyzedSetTransaction setTransaction, C context) {
        return visitAnalyzedStatement(setTransaction, context);
    }
}


text:
package test.listeners;

import org.testng.Assert;
import org.testng.IConfigurationListener;
import org.testng.ITestResult;
import org.testng.TestNG;
import org.testng.annotations.Test;
import test.SimpleBaseTest;

public class ConfigurationListenerTest extends SimpleBaseTest {

  public static class CL implements IConfigurationListener {

    private static int m_status = 0;

    @Override
    public void beforeConfiguration(ITestResult tr) {
      m_status += 1;
    }

    @Override
    public void onConfigurationSuccess(ITestResult itr) {
      m_status += 3;
    }

    @Override
    public void onConfigurationFailure(ITestResult itr) {
      m_status += 5;
    }

    @Override
    public void onConfigurationSkip(ITestResult itr) {
      m_status += 7;
    }
  }

  private void runTest(Class<?> cls, int expected) {
    TestNG tng = create(cls);
    CL listener = new CL();
    CL.m_status = 0;
    tng.addListener(listener);
    tng.run();

    Assert.assertEquals(CL.m_status, expected);
  }

  @Test
  public void shouldSucceed() {
    runTest(ConfigurationListenerSucceedSampleTest.class, 1 + 3);
  }

  @Test
  public void shouldFail() {
    runTest(ConfigurationListenerFailSampleTest.class, 1 + 5);
  }

  @Test
  public void shouldSkip() {
    runTest(ConfigurationListenerSkipSampleTest.class, 1 + 1 + 5 + 7); // fail + skip
  }
}


text:
// Authors:
// 		Thomas Wiest (twiest@novell.com)
//		Rusty Howell  (rhowell@novell.com)
//
// (C)  Novell Inc.

using System;
using System.Collections.Generic;
using System.Text;

namespace System.Management.Internal
{
    /// <summary>
    /// A reference parameter to a CimMethod
    /// </summary>
    internal class CimParameterReference : CimParameter
    {
        /* <!ELEMENT PARAMETER.REFERENCE (QUALIFIER*)>
         * <!ATTLIST PARAMETER.REFERENCE
         *      %CIMName;
         *      %ReferenceClass;>
         * */
        private CimName _referenceClass = null;

        #region Constructors
        /// <summary>
        /// Creates a new CimParameter object with the given name
        /// </summary>
        /// <param name="name"></param>
        public CimParameterReference(string name) : base(CimType.CIMNULL, name)
        {
        }
        #endregion

        #region Properties
        /// <summary>
        /// Gets or sets the reference class
        /// </summary>
        public CimName ReferenceClass
        {
            get
            {
                if (_referenceClass == null)
                    _referenceClass = new CimName(null);
                return _referenceClass;
            }
            set { _referenceClass = value; }
        }

        /// <summary>
        /// Returns true if the ReferenceClass is set
        /// </summary>
        public bool IsSet
        {
            get { return ReferenceClass.IsSet; }
        }
        #endregion

        #region Methods

        #endregion

    }
}


text:
{% extends "wheelcms_axle/base_form.html" %}

{% block form_actions %}

    <input class="btn btn-primary canleave" type="submit" value="Add">
    Cancel

{% endblock %}


text:
DataShape Grammar
=================

The datashape language is a DSL which describes the structure of data, abstracted from
a particular implementation in a language or file format. Compared to the Python
library NumPy, it combines `shape` and `dtype` together, and introduces a
syntax for describing structured data.

Some of the basic features include:

* Dimensions are separated by asterisks.
* Lists of types are separated by commas.
* Types and Typevars are distinguished by the capitalization of the leading
  character. Lowercase for types, and uppercase for typevars.
* Type constructors operate using square brackets.
* Type constructors accept positional and keyword arguments,
  and their arguments may be:
  * datashape, string, integer, list of datashape, list of string,
    list of integer
* In multi-line datashape strings or files, comments start from
  # characters to the end of the line.

Some Simple Examples
--------------------

Here are some simple examples to motivate the idea::

    # Scalar types
    bool
    int32
    float64

    # Arrays
    3 * 4 * int32
    3 * 4 * int32
    10 * var * float64
    3 * complex[float64]

    # Array of Structures
    100 * {
        name: string,
        birthday: date,
        address: {
            street: string,
            city: string,
            postalcode: string,
            country: string
        }
    }

    # Structure of Arrays
    {
        x: 100 * 100 * float32,
        y: 100 * 100 * float32,
        u: 100 * 100 * float32,
        v: 100 * 100 * float32,
    }

    # List of Tuples
    20 * (int32, float64)

    # Function prototype
    (3 * int32, float64) -> 3 * float64

    # Function prototype with broadcasting dimensions
    (A... * int32, A... * int32) -> A... * int32

Syntactic Sugar
---------------

Many syntax elements in datashape are syntax sugar for particular
type constructors. For dtypes, this is::

    {x : int32, y : int16}    =>   struct[['x', 'y'], [int32, int16]]
    (int64, float32)          =>   tuple[[int64, float32]]
    (int64, float32) -> bool  =>   funcproto[[int64, float32], bool]
    DTypeVar                  =>   typevar['DTypeVar']

For dims, this is::

    3 * int32                 =>   fixed[3] * int32
    DimVar * int32            =>   typevar['DimVar'] * int32
    ... * int32               =>   ellipsis * int32
    DimVar... * int32         =>   ellipsis['DimVar'] * int32

The DataShape Grammar
---------------------

Dimension Type Symbol Table::

    # Variable-sized dimension
    var

Data Type Symbol Table::

    # Numeric
    bool
    # Two's complement binary integers
    int8
    int16
    int32
    int64
    int128
    # Unsigned binary integers
    uint8
    uint16
    uint32
    uint64
    uint128
    # IEEE 754-2008 binary### floating point binary numbers
    float16
    float32
    float64
    float128
    # IEEE 754-2008 decimal### floating point decimal numbers
    decimal32
    decimal64
    decimal128
    # Arbitrary precision integer
    bignum
    # Alias for int32
    int
    # Alias for float64
    real
    # Alias for complex[float64]
    complex
    # Alias for int32 or int64 depending on platform
    intptr
    # Alias for uint32 or uint64 depending on platform
    uintptr

    # A unicode string
    string
    # A single unicode code point
    char
    # A blob of bytes
    bytes
    # A date
    date
    # A string containing JSON
    json
    # No data
    void

Data Type Constructor Symbol Table::

    # complex[float32], complex[type=float64]
    complex
    # string['ascii'], string[enc='cp949']
    string
    # bytes[size=4,align=2]
    bytes
    # datetime[unit='minutes',tz='CST']
    datetime
    # categorical[type=string, values=['low', 'medium', 'high']]
    categorical
    # option[float64]
    option
    # pointer[target=2 * 3 * int32]
    pointer

Tokens::

    NAME_LOWER : [a-z][a-zA-Z0-9_]*
    NAME_UPPER : [A-Z][a-zA-Z0-9_]*
    NAME_OTHER : _[a-zA-Z0-9_]*
    ASTERISK : \*
    COMMA : ,
    EQUAL : =
    COLON : :
    LBRACKET : \[
    RBRACKET : \]
    LBRACE : \{
    RBRACE : \}
    LPAREN : \(
    RPAREN : \)
    ELLIPSIS : \.\.\.
    RARROW : ->
    INTEGER : 0(?![0-9])|[1-9][0-9]*
    STRING : (?:"(?:[^"\n\r\\]|(?:\\u[0-9a-fA-F]{4})|(?:\\["bfnrt]))*")|(?:\'(?:[^\'\n\r\\]|(?:\\u[0-9a-fA-F]{4})|(?:\\['bfnrt]))*"))*\')

Grammar::

    # Comma-separated list of dimensions, followed by data type
    datashape : dim ASTERISK datashape
              | dtype

    # Dimension Type (from the dimension type symbol table)
    dim : typevar
        | ellipsis_typevar
        | type
        | type_constr
        | INTEGER
        | ELLIPSIS

    # Data Type (from the data type symbol table)
    dtype : typevar
          | type
          | type_constr
          | struct_type
          | funcproto_or_tuple_type

    # A type variable
    typevar : NAME_UPPER

    # A type variable with ellipsis
    ellipsis_typevar : NAME_UPPER ELLIPSIS

    # A bare type (from the data type symbol table)
    type : NAME_LOWER

    # Type Constructor (from the data type constructor symbol table)
    type_constr : NAME_LOWER LBRACKET type_arg_list RBRACKET

    # Type Constructor: list of arguments
    type_arg_list : type_arg COMMA type_arg_list
                  | type_kwarg_list
                  | type_arg

    # Type Constructor: list of arguments
    type_kwarg_list : type_kwarg COMMA type_kwarg_list
                    | type_kwarg

    # Type Constructor : single argument
    type_arg : datashape
             | INTEGER
             | STRING
             | list_type_arg

    # Type Constructor : single keyword argument
    type_kwarg : NAME_LOWER EQUAL type_arg

    # Type Constructor : single list argument
    list_type_arg : LBRACKET RBRACKET
                  | LBRACKET datashape_list RBRACKET
                  | LBRACKET integer_list RBRACKET
                  | LBRACKET string_list RBRACKET

    datashape_list : datashape COMMA datashape_list
                   | datashape

    integer_list : INTEGER COMMA integer_list
                 | INTEGER

    string_list : STRING COMMA string_list
                | STRING

    # Struct/Record type (allowing for a trailing comma)
    struct_type : LBRACE struct_field_list RBRACE
                | LBRACE struct_field_list COMMA RBRACE

    struct_field_list : struct_field COMMA struct_field_list
                      | struct_field

    struct_field : struct_field_name COLON datashape

    struct_field_name : NAME_LOWER
                      | NAME_UPPER
                      | NAME_OTHER

    # Function prototype is a tuple with an arrow to the output type
    funcproto_or_tuple_type : tuple_type RARROW datashape
                            | tuple_type

    # Tuple type (allowing for a trailing comma)
    tuple_type : LPAREN tuple_item_list RPAREN
               | LPAREN tuple_item_list COMMA RPAREN

    tuple_item_list : datashape COMMA tuple_item_list
                    | datashape


text:
.class public Landroid/security/Credentials;
.super Ljava/lang/Object;
.source "Credentials.java"

# static fields
.field public static final CA_CERTIFICATE:Ljava/lang/String; = "CACERT_"

.field public static final EXTENSION_CER:Ljava/lang/String; = ".cer"

.field public static final EXTENSION_CRT:Ljava/lang/String; = ".crt"

.field public static final EXTENSION_P12:Ljava/lang/String; = ".p12"

.field public static final EXTENSION_PFX:Ljava/lang/String; = ".pfx"

.field public static final EXTRA_CA_CERTIFICATES_DATA:Ljava/lang/String; = "ca_certificates_data"

.field public static final EXTRA_CA_CERTIFICATES_NAME:Ljava/lang/String; = "ca_certificates_name"

.field public static final EXTRA_INSTALL_AS_UID:Ljava/lang/String; = "install_as_uid"

.field public static final EXTRA_PRIVATE_KEY:Ljava/lang/String; = "PKEY"

.field public static final EXTRA_PUBLIC_KEY:Ljava/lang/String; = "KEY"

.field public static final EXTRA_USER_CERTIFICATE_DATA:Ljava/lang/String; = "user_certificate_data"

.field public static final EXTRA_USER_CERTIFICATE_NAME:Ljava/lang/String; = "user_certificate_name"

.field public static final EXTRA_USER_PRIVATE_KEY_DATA:Ljava/lang/String; = "user_private_key_data"

.field public static final EXTRA_USER_PRIVATE_KEY_NAME:Ljava/lang/String; = "user_private_key_name"

.field public static final INSTALL_ACTION:Ljava/lang/String; = "android.credentials.INSTALL"

.field public static final INSTALL_AS_USER_ACTION:Ljava/lang/String; = "android.credentials.INSTALL_AS_USER"

.field public static final LOCKDOWN_VPN:Ljava/lang/String; = "LOCKDOWN_VPN"

.field private static final LOGTAG:Ljava/lang/String; = "Credentials"

.field public static final UNLOCK_ACTION:Ljava/lang/String; = "com.android.credentials.UNLOCK"

.field public static final USER_CERTIFICATE:Ljava/lang/String; = "USRCERT_"

.field public static final USER_PRIVATE_KEY:Ljava/lang/String; = "USRPKEY_"

.field public static final USER_SECRET_KEY:Ljava/lang/String; = "USRSKEY_"

.field public static final VPN:Ljava/lang/String; = "VPN_"

.field public static final WIFI:Ljava/lang/String; = "WIFI_"

.field private static singleton:Landroid/security/Credentials;

# direct methods
.method public constructor <init>()V
    .locals 0

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

    return-void
.end method

.method public static convertFromPem([B)Ljava/util/List;
    .locals 10
    .param p0, "bytes"    # [B
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "([B)",
            "Ljava/util/List",
            "<",
            "Ljava/security/cert/X509Certificate;",
            ">;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;,
            Ljava/security/cert/CertificateException;
        }
    .end annotation

    .prologue
    .line 146
    new-instance v0, Ljava/io/ByteArrayInputStream;

    invoke-direct {v0, p0}, Ljava/io/ByteArrayInputStream;-><init>([B)V

    .line 147
    .local v0, "bai":Ljava/io/ByteArrayInputStream;
    new-instance v5, Ljava/io/InputStreamReader;

    sget-object v7, Ljava/nio/charset/StandardCharsets;->US_ASCII:Ljava/nio/charset/Charset;

    invoke-direct {v5, v0, v7}, Ljava/io/InputStreamReader;-><init>(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V

    .line 148
    .local v5, "reader":Ljava/io/Reader;
    new-instance v4, Lcom/android/org/bouncycastle/util/io/pem/PemReader;

    invoke-direct {v4, v5}, Lcom/android/org/bouncycastle/util/io/pem/PemReader;-><init>(Ljava/io/Reader;)V

    .line 150
    .local v4, "pr":Lcom/android/org/bouncycastle/util/io/pem/PemReader;
    const-string/jumbo v7, "X509"

    invoke-static {v7}, Ljava/security/cert/CertificateFactory;->getInstance(Ljava/lang/String;)Ljava/security/cert/CertificateFactory;

    move-result-object v2

    .line 152
    .local v2, "cf":Ljava/security/cert/CertificateFactory;
    new-instance v6, Ljava/util/ArrayList;

    invoke-direct {v6}, Ljava/util/ArrayList;-><init>()V

    .line 154
    .local v6, "result":Ljava/util/List;, "Ljava/util/List<Ljava/security/cert/X509Certificate;>;"
    :goto_0
    invoke-virtual {v4}, Lcom/android/org/bouncycastle/util/io/pem/PemReader;->readPemObject()Lcom/android/org/bouncycastle/util/io/pem/PemObject;

    move-result-object v3

    .local v3, "o":Lcom/android/org/bouncycastle/util/io/pem/PemObject;
    if-eqz v3, :cond_1

    .line 155
    invoke-virtual {v3}, Lcom/android/org/bouncycastle/util/io/pem/PemObject;->getType()Ljava/lang/String;

    move-result-object v7

    const-string/jumbo v8, "CERTIFICATE"

    invoke-virtual {v7, v8}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v7

    if-eqz v7, :cond_0

    .line 156
    new-instance v7, Ljava/io/ByteArrayInputStream;

    invoke-virtual {v3}, Lcom/android/org/bouncycastle/util/io/pem/PemObject;->getContent()[B

    move-result-object v8

    invoke-direct {v7, v8}, Ljava/io/ByteArrayInputStream;-><init>([B)V

    invoke-virtual {v2, v7}, Ljava/security/cert/CertificateFactory;->generateCertificate(Ljava/io/InputStream;)Ljava/security/cert/Certificate;

    move-result-object v1

    .line 157
    .local v1, "c":Ljava/security/cert/Certificate;
    check-cast v1, Ljava/security/cert/X509Certificate;

    .end local v1    # "c":Ljava/security/cert/Certificate;
    invoke-interface {v6, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_0

    .line 159
    :cond_0
    new-instance v7, Ljava/lang/IllegalArgumentException;

    new-instance v8, Ljava/lang/StringBuilder;

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

    const-string/jumbo v9, "Unknown type "

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    invoke-virtual {v3}, Lcom/android/org/bouncycastle/util/io/pem/PemObject;->getType()Ljava/lang/String;

    move-result-object v9

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-direct {v7, v8}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v7

    .line 162
    :cond_1
    invoke-virtual {v4}, Lcom/android/org/bouncycastle/util/io/pem/PemReader;->close()V

    .line 163
    return-object v6
.end method

.method public static varargs convertToPem([Ljava/security/cert/Certificate;)[B
    .locals 9
    .param p0, "objects"    # [Ljava/security/cert/Certificate;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;,
            Ljava/security/cert/CertificateEncodingException;
        }
    .end annotation

    .prologue
    .line 131
    new-instance v0, Ljava/io/ByteArrayOutputStream;

    invoke-direct {v0}, Ljava/io/ByteArrayOutputStream;-><init>()V

    .line 132
    .local v0, "bao":Ljava/io/ByteArrayOutputStream;
    new-instance v3, Ljava/io/OutputStreamWriter;

    sget-object v4, Ljava/nio/charset/StandardCharsets;->US_ASCII:Ljava/nio/charset/Charset;

    invoke-direct {v3, v0, v4}, Ljava/io/OutputStreamWriter;-><init>(Ljava/io/OutputStream;Ljava/nio/charset/Charset;)V

    .line 133
    .local v3, "writer":Ljava/io/Writer;
    new-instance v2, Lcom/android/org/bouncycastle/util/io/pem/PemWriter;

    invoke-direct {v2, v3}, Lcom/android/org/bouncycastle/util/io/pem/PemWriter;-><init>(Ljava/io/Writer;)V

    .line 134
    .local v2, "pw":Lcom/android/org/bouncycastle/util/io/pem/PemWriter;
    const/4 v4, 0x0

    array-length v5, p0

    :goto_0
    if-ge v4, v5, :cond_0

    aget-object v1, p0, v4

    .line 135
    .local v1, "o":Ljava/security/cert/Certificate;
    new-instance v6, Lcom/android/org/bouncycastle/util/io/pem/PemObject;

    const-string/jumbo v7, "CERTIFICATE"

    invoke-virtual {v1}, Ljava/security/cert/Certificate;->getEncoded()[B

    move-result-object v8

    invoke-direct {v6, v7, v8}, Lcom/android/org/bouncycastle/util/io/pem/PemObject;-><init>(Ljava/lang/String;[B)V

    invoke-virtual {v2, v6}, Lcom/android/org/bouncycastle/util/io/pem/PemWriter;->writeObject(Lcom/android/org/bouncycastle/util/io/pem/PemObjectGenerator;)V

    .line 134
    add-int/lit8 v4, v4, 0x1

    goto :goto_0

    .line 137
    .end local v1    # "o":Ljava/security/cert/Certificate;
    :cond_0
    invoke-virtual {v2}, Lcom/android/org/bouncycastle/util/io/pem/PemWriter;->close()V

    .line 138
    invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B

    move-result-object v4

    return-object v4
.end method

.method public static deleteAllTypesForAlias(Landroid/security/KeyStore;Ljava/lang/String;)Z
    .locals 3
    .param p0, "keystore"    # Landroid/security/KeyStore;
    .param p1, "alias"    # Ljava/lang/String;

    .prologue
    .line 224
    new-instance v0, Ljava/lang/StringBuilder;

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

    const-string/jumbo v1, "USRPKEY_"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, v0}, Landroid/security/KeyStore;->delete(Ljava/lang/String;)Z

    move-result v0

    .line 225
    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string/jumbo v2, "USRSKEY_"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p0, v1}, Landroid/security/KeyStore;->delete(Ljava/lang/String;)Z

    move-result v1

    .line 224
    or-int/2addr v0, v1

    .line 226
    invoke-static {p0, p1}, Landroid/security/Credentials;->deleteCertificateTypesForAlias(Landroid/security/KeyStore;Ljava/lang/String;)Z

    move-result v1

    .line 224
    or-int/2addr v0, v1

    return v0
.end method

.method public static deleteCertificateTypesForAlias(Landroid/security/KeyStore;Ljava/lang/String;)Z
    .locals 3
    .param p0, "keystore"    # Landroid/security/KeyStore;
    .param p1, "alias"    # Ljava/lang/String;

    .prologue
    .line 239
    new-instance v0, Ljava/lang/StringBuilder;

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

    const-string/jumbo v1, "USRCERT_"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, v0}, Landroid/security/KeyStore;->delete(Ljava/lang/String;)Z

    move-result v0

    .line 240
    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string/jumbo v2, "CACERT_"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p0, v1}, Landroid/security/KeyStore;->delete(Ljava/lang/String;)Z

    move-result v1

    .line 239
    or-int/2addr v0, v1

    return v0
.end method

.method static deletePrivateKeyTypeForAlias(Landroid/security/KeyStore;Ljava/lang/String;)Z
    .locals 2
    .param p0, "keystore"    # Landroid/security/KeyStore;
    .param p1, "alias"    # Ljava/lang/String;

    .prologue
    .line 248
    new-instance v0, Ljava/lang/StringBuilder;

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

    const-string/jumbo v1, "USRPKEY_"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, v0}, Landroid/security/KeyStore;->delete(Ljava/lang/String;)Z

    move-result v0

    return v0
.end method

.method public static deleteSecretKeyTypeForAlias(Landroid/security/KeyStore;Ljava/lang/String;)Z
    .locals 2
    .param p0, "keystore"    # Landroid/security/KeyStore;
    .param p1, "alias"    # Ljava/lang/String;

    .prologue
    .line 256
    new-instance v0, Ljava/lang/StringBuilder;

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

    const-string/jumbo v1, "USRSKEY_"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, v0}, Landroid/security/KeyStore;->delete(Ljava/lang/String;)Z

    move-result v0

    return v0
.end method

.method public static getInstance()Landroid/security/Credentials;
    .locals 1

    .prologue
    .line 169
    sget-object v0, Landroid/security/Credentials;->singleton:Landroid/security/Credentials;

    if-nez v0, :cond_0

    .line 170
    new-instance v0, Landroid/security/Credentials;

    invoke-direct {v0}, Landroid/security/Credentials;-><init>()V

    sput-object v0, Landroid/security/Credentials;->singleton:Landroid/security/Credentials;

    .line 172
    :cond_0
    sget-object v0, Landroid/security/Credentials;->singleton:Landroid/security/Credentials;

    return-object v0
.end method

# virtual methods
.method public install(Landroid/content/Context;)V
    .locals 4
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    .line 186
    :try_start_0
    invoke-static {}, Landroid/security/KeyChain;->createInstallIntent()Landroid/content/Intent;

    move-result-object v1

    .line 187
    .local v1, "intent":Landroid/content/Intent;
    invoke-virtual {p1, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
    :try_end_0
    .catch Landroid/content/ActivityNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    .line 184
    .end local v1    # "intent":Landroid/content/Intent;
    :goto_0
    return-void

    .line 188
    :catch_0
    move-exception v0

    .line 189
    .local v0, "e":Landroid/content/ActivityNotFoundException;
    const-string/jumbo v2, "Credentials"

    invoke-virtual {v0}, Landroid/content/ActivityNotFoundException;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0
.end method

.method public install(Landroid/content/Context;Ljava/lang/String;[B)V
    .locals 4
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "type"    # Ljava/lang/String;
    .param p3, "value"    # [B

    .prologue
    .line 206
    :try_start_0
    invoke-static {}, Landroid/security/KeyChain;->createInstallIntent()Landroid/content/Intent;

    move-result-object v1

    .line 207
    .local v1, "intent":Landroid/content/Intent;
    invoke-virtual {v1, p2, p3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;[B)Landroid/content/Intent;

    .line 208
    invoke-virtual {p1, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
    :try_end_0
    .catch Landroid/content/ActivityNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    .line 204
    .end local v1    # "intent":Landroid/content/Intent;
    :goto_0
    return-void

    .line 209
    :catch_0
    move-exception v0

    .line 210
    .local v0, "e":Landroid/content/ActivityNotFoundException;
    const-string/jumbo v2, "Credentials"

    invoke-virtual {v0}, Landroid/content/ActivityNotFoundException;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0
.end method

.method public install(Landroid/content/Context;Ljava/security/KeyPair;)V
    .locals 4
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "pair"    # Ljava/security/KeyPair;

    .prologue
    .line 195
    :try_start_0
    invoke-static {}, Landroid/security/KeyChain;->createInstallIntent()Landroid/content/Intent;

    move-result-object v1

    .line 196
    .local v1, "intent":Landroid/content/Intent;
    const-string/jumbo v2, "PKEY"

    invoke-virtual {p2}, Ljava/security/KeyPair;->getPrivate()Ljava/security/PrivateKey;

    move-result-object v3

    invoke-interface {v3}, Ljava/security/PrivateKey;->getEncoded()[B

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;[B)Landroid/content/Intent;

    .line 197
    const-string/jumbo v2, "KEY"

    invoke-virtual {p2}, Ljava/security/KeyPair;->getPublic()Ljava/security/PublicKey;

    move-result-object v3

    invoke-interface {v3}, Ljava/security/PublicKey;->getEncoded()[B

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;[B)Landroid/content/Intent;

    .line 198
    invoke-virtual {p1, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
    :try_end_0
    .catch Landroid/content/ActivityNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    .line 193
    .end local v1    # "intent":Landroid/content/Intent;
    :goto_0
    return-void

    .line 199
    :catch_0
    move-exception v0

    .line 200
    .local v0, "e":Landroid/content/ActivityNotFoundException;
    const-string/jumbo v2, "Credentials"

    invoke-virtual {v0}, Landroid/content/ActivityNotFoundException;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0
.end method

.method public unlock(Landroid/content/Context;)V
    .locals 4
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    .line 177
    :try_start_0
    new-instance v1, Landroid/content/Intent;

    const-string/jumbo v2, "com.android.credentials.UNLOCK"

    invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 178
    .local v1, "intent":Landroid/content/Intent;
    invoke-virtual {p1, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
    :try_end_0
    .catch Landroid/content/ActivityNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    .line 175
    .end local v1    # "intent":Landroid/content/Intent;
    :goto_0
    return-void

    .line 179
    :catch_0
    move-exception v0

    .line 180
    .local v0, "e":Landroid/content/ActivityNotFoundException;
    const-string/jumbo v2, "Credentials"

    invoke-virtual {v0}, Landroid/content/ActivityNotFoundException;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0
.end method


text:
package com.intellij.openapi.wm.impl;

import com.intellij.ide.ActiveWindowsWatcher;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.wm.ex.WindowManagerEx;
import com.intellij.ui.AppUIUtil;
import com.intellij.ui.ComponentUtil;
import com.intellij.util.Function;
import org.jetbrains.annotations.NotNull;

import java.awt.*;

public abstract class AbstractTraverseWindowAction extends AnAction {

  protected void doPerform(@NotNull Function<? super Window, ? extends Window> mapWindow) {
    Window w = WindowManagerEx.getInstanceEx().getMostRecentFocusedWindow();
    if (!w.isVisible() || ComponentUtil.isMinimized(w) || AppUIUtil.isInFullscreen(w)) return;
    if (!ActiveWindowsWatcher.isTheCurrentWindowOnTheActivatedList(w)) return;
    Window window = mapWindow.fun(w);
    Component recentFocusOwner = window.getMostRecentFocusOwner();

    (recentFocusOwner == null || !recentFocusOwner.isFocusable() ? window : recentFocusOwner).requestFocus();
  }

  @Override
  public void update(@NotNull AnActionEvent e) {
    e.getPresentation().setEnabled(true);
  }
}


text:
package ch.softappeal.yass.serialize.test;

import ch.softappeal.yass.serialize.FastReflector;
import ch.softappeal.yass.serialize.Reflector;
import ch.softappeal.yass.serialize.SlowReflector;
import ch.softappeal.yass.serialize.contract.nested.AllTypes;
import ch.softappeal.yass.util.PerformanceTask;
import org.junit.Assert;
import org.junit.Test;

import java.util.Map;
import java.util.concurrent.TimeUnit;

public class ReflectorPerformanceTest {

    private static void test(final Reflector.Factory reflectorFactory) throws Exception {
        new PerformanceTask() {
            @Override protected void run(final int count) throws Exception {
                final Reflector reflector = reflectorFactory.create(AllTypes.class);
                final Map<String, Reflector.Accessor> name2accessor = ReflectorTest.name2accessor(reflectorFactory, AllTypes.class);
                final Reflector.Accessor intField = name2accessor.get("intField");
                final Reflector.Accessor stringField = name2accessor.get("stringField");
                int counter = count;
                while (counter-- > 0) {
                    final AllTypes allTypes = (AllTypes)reflector.newInstance();
                    intField.set(allTypes, 123);
                    stringField.set(allTypes, "xyz");
                    Assert.assertTrue((Integer)intField.get(allTypes) == 123);
                    Assert.assertEquals("xyz", stringField.get(allTypes));
                }
            }
        }.run(1, TimeUnit.NANOSECONDS);
    }

    @Test public void fast() throws Exception {
        test(FastReflector.FACTORY);
    }

    @Test public void slow() throws Exception {
        test(SlowReflector.FACTORY);
    }

    @Test public void java() {
        new PerformanceTask() {
            @Override protected void run(final int count) {
                int counter = count;
                while (counter-- > 0) {
                    final AllTypes allTypes = new AllTypes();
                    allTypes.intField = 123;
                    allTypes.stringField = "xyz";
                    Assert.assertTrue(allTypes.intField == 123);
                    Assert.assertEquals("xyz", allTypes.stringField);
                }
            }
        }.run(1, TimeUnit.NANOSECONDS);
    }

}


text:
.cesium-svgPath-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.cesium-button {
    display: inline-block;
    position: relative;
    background: #303336;
    border: 1px solid #444;
    color: #edffff;  /* For text buttons */
    fill: #edffff;   /* For SVG buttons */
    border-radius: 4px;
    padding: 5px 12px;
    margin: 2px 3px;
    cursor: pointer;
    overflow: hidden;
    -moz-user-select: none;
    -webkit-user-select: none;
    user-select: none;
}

.cesium-button:focus {
    color: #fff;  /* For text buttons */
    fill: #fff;   /* For SVG buttons */
    border-color: #ea4;
    outline: none;
}

.cesium-button:hover {
    color: #fff;  /* For text buttons */
    fill: #fff;   /* For SVG buttons */
    background: #48b;
    border-color: #aef;
    box-shadow: 0 0 8px #fff;
}

.cesium-button:active {
    color: #000;  /* For text buttons */
    fill: #000;   /* For SVG buttons */
    background: #adf;
    border-color: #fff;
    box-shadow: 0 0 8px #fff;
}

.cesium-button:disabled,
.cesium-button-disabled,
.cesium-button-disabled:focus,
.cesium-button-disabled:hover,
.cesium-button-disabled:active {
    background: #303336;
    border-color: #444;
    color: #646464;  /* For text buttons */
    fill: #646464;   /* For SVG buttons */
    box-shadow: none;
    cursor: default;
}

.cesium-button option {
    background-color: #000;
    color: #eee;
}

.cesium-button option:disabled {
    color: #777;
}

.cesium-toolbar-button {
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    width: 32px;
    height: 32px;
    border-radius: 14%;
    padding: 0;
    vertical-align: middle;
    z-index: 0;  /* Workaround for rounded raster image corners in Chrome */
}


text:
layout: post
title: Second Blog Post
---

This is a second blog post.  Not only does it say 'hello world',
it contains several other words.  Words seem to be useful in blog posts,
so this post contains several of them.

Donec ullamcorper nulla non metus auctor fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Curabitur blandit tempus porttitor. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Donec sed odio dui. Maecenas sed diam eget risus varius blandit sit amet non magna. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

Cras justo odio, dapibus ac facilisis in, egestas eget quam. Aenean lacinia bibendum nulla sed consectetur. Maecenas faucibus mollis interdum. Maecenas sed diam eget risus varius blandit sit amet non magna.


text:
namespace boost {
namespace asio {

class executor;

namespace detail {

inline bool is_native_io_executor(const io_context::executor_type&)
{
  return true;
}

template <typename Executor>
inline bool is_native_io_executor(const Executor&,
    typename enable_if<!is_same<Executor, executor>::value>::type* = 0)
{
  return false;
}

template <typename Executor>
inline bool is_native_io_executor(const Executor& ex,
    typename enable_if<is_same<Executor, executor>::value>::type* = 0)
{
#if !defined (BOOST_ASIO_NO_TYPEID)
  return ex.target_type() == typeid(io_context::executor_type);
#else // !defined (BOOST_ASIO_NO_TYPEID)
  return false;
#endif // !defined (BOOST_ASIO_NO_TYPEID)
}

template <typename IoObjectService,
    typename Executor = io_context::executor_type>
class io_object_impl
{
public:
  // The type of the service that will be used to provide I/O operations.
  typedef IoObjectService service_type;

  // The underlying implementation type of I/O object.
  typedef typename service_type::implementation_type implementation_type;

  // The type of the executor associated with the object.
  typedef Executor executor_type;

  // The type of executor to be used when implementing asynchronous operations.
  typedef io_object_executor<Executor> implementation_executor_type;

  // Construct an I/O object using an executor.
  explicit io_object_impl(const executor_type& ex)
    : service_(&boost::asio::use_service<IoObjectService>(ex.context())),
      implementation_executor_(ex, (is_native_io_executor)(ex))
  {
    service_->construct(implementation_);
  }

  // Construct an I/O object using an execution context.
  template <typename ExecutionContext>
  explicit io_object_impl(ExecutionContext& context,
      typename enable_if<is_convertible<
        ExecutionContext&, execution_context&>::value>::type* = 0)
    : service_(&boost::asio::use_service<IoObjectService>(context)),
      implementation_executor_(context.get_executor(),
        is_same<ExecutionContext, io_context>::value)
  {
    service_->construct(implementation_);
  }

#if defined(BOOST_ASIO_HAS_MOVE)
  // Move-construct an I/O object.
  io_object_impl(io_object_impl&& other)
    : service_(&other.get_service()),
      implementation_executor_(other.get_implementation_executor())
  {
    service_->move_construct(implementation_, other.implementation_);
  }

  // Perform a converting move-construction of an I/O object.
  template <typename IoObjectService1, typename Executor1>
  io_object_impl(io_object_impl<IoObjectService1, Executor1>&& other)
    : service_(&boost::asio::use_service<IoObjectService>(
            other.get_implementation_executor().context())),
      implementation_executor_(other.get_implementation_executor())
  {
    service_->converting_move_construct(implementation_,
        other.get_service(), other.get_implementation());
  }
#endif // defined(BOOST_ASIO_HAS_MOVE)

  // Destructor.
  ~io_object_impl()
  {
    service_->destroy(implementation_);
  }

#if defined(BOOST_ASIO_HAS_MOVE)
  // Move-assign an I/O object.
  io_object_impl& operator=(io_object_impl&& other)
  {
    if (this != &other)
    {
      service_->move_assign(implementation_,
          *other.service_, other.implementation_);
      implementation_executor_.~implementation_executor_type();
      new (&implementation_executor_) implementation_executor_type(
          std::move(other.implementation_executor_));
      service_ = other.service_;
    }
    return *this;
  }
#endif // defined(BOOST_ASIO_HAS_MOVE)

  // Get the executor associated with the object.
  executor_type get_executor() BOOST_ASIO_NOEXCEPT
  {
    return implementation_executor_.inner_executor();
  }

  // Get the executor to be used when implementing asynchronous operations.
  const implementation_executor_type& get_implementation_executor()
    BOOST_ASIO_NOEXCEPT
  {
    return implementation_executor_;
  }

  // Get the service associated with the I/O object.
  service_type& get_service()
  {
    return *service_;
  }

  // Get the service associated with the I/O object.
  const service_type& get_service() const
  {
    return *service_;
  }

  // Get the underlying implementation of the I/O object.
  implementation_type& get_implementation()
  {
    return implementation_;
  }

  // Get the underlying implementation of the I/O object.
  const implementation_type& get_implementation() const
  {
    return implementation_;
  }

private:
  // Disallow copying and copy assignment.
  io_object_impl(const io_object_impl&);
  io_object_impl& operator=(const io_object_impl&);

  // The service associated with the I/O object.
  service_type* service_;

  // The underlying implementation of the I/O object.
  implementation_type implementation_;

  // The associated executor.
  implementation_executor_type implementation_executor_;
};

} // namespace detail
} // namespace asio
} // namespace boost

#include <boost/asio/detail/pop_options.hpp>

#endif // BOOST_ASIO_DETAIL_IO_OBJECT_IMPL_HPP