text:
package com.eheiker.appdirect.client;

import java.io.IOException;

import javax.xml.bind.JAXBException;

import oauth.signpost.exception.OAuthCommunicationException;
import oauth.signpost.exception.OAuthExpectationFailedException;
import oauth.signpost.exception.OAuthMessageSignerException;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

import com.eheiker.appdirect.client.action.ActionResult;
import com.eheiker.appdirect.client.action.GetEventAction;

import static org.mockito.Mockito.*;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.*;

@RunWith(MockitoJUnitRunner.class)
public class GetEventActionTests {

    @InjectMocks
    GetEventAction action;

    @Mock
    AppDirectClient client;

    @Test
    public void testEntitySetOnResult() throws JAXBException, OAuthExpectationFailedException, OAuthCommunicationException, OAuthMessageSignerException, IOException {
        String resultEntity = "MY_RESULT";

        when(client.signAndGet(anyString(), eq(String.class))).thenReturn(resultEntity);

        ActionResult<String> result = action.execute(String.class);
        assertThat(result.getEntity(), equalTo(resultEntity));
    }

    @Test
    public void testSuccessTrue() {
        ActionResult<String> result = action.execute(String.class);
        assertThat(result.isSuccess(), equalTo(Boolean.TRUE));
    }

    @Test
    public void testSuccessFalseOnException() throws JAXBException, OAuthExpectationFailedException, OAuthCommunicationException, OAuthMessageSignerException, IOException {
        when(client.signAndGet(anyString(), eq(String.class))).thenThrow(new IOException());
        ActionResult<String> result = action.execute(String.class);
        assertThat(result.isSuccess(), equalTo(Boolean.FALSE));
    }

    @Test
    public void testErrorMessageOnException() throws JAXBException, OAuthExpectationFailedException, OAuthCommunicationException, OAuthMessageSignerException, IOException {
        String errorMsg = "OH NOES";
        when(client.signAndGet(anyString(), eq(String.class))).thenThrow(new IOException(errorMsg));
        ActionResult<String> result = action.execute(String.class);
        assertThat(result.getErrorMessage(), equalTo(errorMsg));
    }

}


text:
package server

import (
	"net"

	"github.com/mholt/caddy/middleware"
)

// Config configuration for a single server.
type Config struct {
	// The hostname or IP on which to serve
	Host string

	// The host address to bind on - defaults to (virtual) Host if empty
	BindHost string

	// The port to listen on
	Port string

	// The directory from which to serve files
	Root string

	// HTTPS configuration
	TLS TLSConfig

	// Middleware stack; map of path scope to middleware -- TODO: Support path scope?
	Middleware map[string][]middleware.Middleware

	// Functions (or methods) to execute at server start; these
	// are executed before any parts of the server are configured,
	// and the functions are blocking
	Startup []func() error

	// Functions (or methods) to execute when the server quits;
	// these are executed in response to SIGINT and are blocking
	Shutdown []func() error

	// The path to the configuration file from which this was loaded
	ConfigFile string

	// The name of the application
	AppName string

	// The application's version
	AppVersion string
}

// Address returns the host:port of c as a string.
func (c Config) Address() string {
	return net.JoinHostPort(c.Host, c.Port)
}

// TLSConfig describes how TLS should be configured and used,
// if at all. A certificate and key are both required.
// The rest is optional.
type TLSConfig struct {
	Enabled                  bool
	Certificate              string
	Key                      string
	Ciphers                  []uint16
	ProtocolMinVersion       uint16
	ProtocolMaxVersion       uint16
	PreferServerCipherSuites bool
	ClientCerts              []string
}

redpajama_set_name: RedPajamaGithub


text:
/* First created by JCasGen Fri Jan 03 13:40:16 CST 2014 */
package org.apache.ctakes.typesystem.type.syntax;

import org.apache.uima.jcas.JCas;
import org.apache.uima.jcas.JCasRegistry;
import org.apache.uima.cas.impl.CASImpl;
import org.apache.uima.cas.impl.FSGenerator;
import org.apache.uima.cas.FeatureStructure;
import org.apache.uima.cas.impl.TypeImpl;
import org.apache.uima.cas.Type;

/** An adverb phrase
				Equivalent to cTAKES:
				edu.mayo.bmi.uima.chunker.type.ADVP
 * Updated by JCasGen Fri Jan 03 13:40:16 CST 2014
 * @generated */
public class ADVP_Type extends Chunk_Type {
  /** @generated */
  @Override
  protected FSGenerator getFSGenerator() {return fsGenerator;}
  /** @generated */
  private final FSGenerator fsGenerator =
    new FSGenerator() {
      public FeatureStructure createFS(int addr, CASImpl cas) {
  			 if (ADVP_Type.this.useExistingInstance) {
  			   // Return eq fs instance if already created
  		     FeatureStructure fs = ADVP_Type.this.jcas.getJfsFromCaddr(addr);
  		     if (null == fs) {
  		       fs = new ADVP(addr, ADVP_Type.this);
  			   ADVP_Type.this.jcas.putJfsFromCaddr(addr, fs);
  			   return fs;
  		     }
  		     return fs;
        } else return new ADVP(addr, ADVP_Type.this);
  	  }
    };
  /** @generated */
  @SuppressWarnings ("hiding")
  public final static int typeIndexID = ADVP.typeIndexID;
  /** @generated
     @modifiable */
  @SuppressWarnings ("hiding")
  public final static boolean featOkTst = JCasRegistry.getFeatOkTst("org.apache.ctakes.typesystem.type.syntax.ADVP");

  /** initialize variables to correspond with Cas Type and Features
	* @generated */
  public ADVP_Type(JCas jcas, Type casType) {
    super(jcas, casType);
    casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());

  }
}


text:
drop view test;
create view test(score int,score1 char(2)) as
(
    select NULL,'aaab'
    UNION ALL
    select NULL,'aabb'
    UNION ALL
    select NULL,NULL
    UNION ALL
    select NULL,'aaac'
    UNION ALL
    select 10,'aadb'
    UNION ALL
    select 40,'aaeb'
    UNION ALL
    select 40,'aadc'
    UNION ALL
    select 40,'aadc'
    UNION ALL
    select 50,'aaec'
    UNION ALL
    select 50,'aadb'
    UNION ALL
    select 60,'aaeb'
    UNION ALL
    select 90,'aadc'
);

select * from test;

select score,score1,PERCENT_RANK() over(order by score,score1) "per_rnk" from test;
select score,score1,PERCENT_RANK() over(order by score,score1) as per_rnk from test;
select score,score1,PERCENT_RANK() over(partition by score order by score,score1) as per_rnk from test;
select score,score1,PERCENT_RANK() over(partition by score1 order by score,score1) as per_rnk from test;
select score,score1,PERCENT_RANK() over(order by score nulls first,score1 nulls first) as per_rnk from test;
select score,score1,PERCENT_RANK() over(order by score nulls last,score1 nulls last) as per_rnk from test;
select score,score1,PERCENT_RANK() over(order by score desc nulls first,score1 desc nulls first) as per_rnk from test;
select score,score1,PERCENT_RANK() over(order by score asc nulls first,score1 asc nulls first) as per_rnk from test;
select score,score1,PERCENT_RANK() over(order by score asc nulls last,score1 asc nulls last) as per_rnk from test;
select score,score1,PERCENT_RANK() over(order by score desc nulls last,score1 desc nulls last) as per_rnk from test;
select score,score1,PERCENT_RANK() over(order by score asc nulls last,score1 asc nulls first) as per_rnk from test;

select score,score1,PERCENT_RANK() over(order by score desc,score1 desc) as per_rnk from test;
select score,score1,PERCENT_RANK() over(order by score asc,score1 asc) as per_rnk from test;

select score,score1,PERCENT_RANK() over(partition by score order by score nulls first,score1 nulls first) as per_rnk from test;
select score,score1,PERCENT_RANK() over(partition by score order by score nulls last,score1 nulls last) as per_rnk from test;
select score,score1,PERCENT_RANK() over(partition by score order by score desc nulls first,score1 desc nulls first) as per_rnk from test;
select score,score1,PERCENT_RANK() over(partition by score order by score asc nulls first,score1 asc nulls first) as per_rnk from test;
select score,score1,PERCENT_RANK() over(partition by score order by score asc nulls last,score1 asc nulls last) as per_rnk from test;
select score,score1,PERCENT_RANK() over(partition by score order by score desc nulls last,score1 desc nulls last) as per_rnk from test;

select score,score1,PERCENT_RANK() over(partition by score order by score desc,score1 desc) as per_rnk from test;
select score,score1,PERCENT_RANK() over(partition by score order by score asc,score1 asc) as per_rnk from test;

select PERCENT_RANK(40,1) within group (order by score,score1) as "per_rnk" from test;
select PERCENT_RANK(null,null) within group (order by score,score1) as "per_rnk" from test;
select PERCENT_RANK(null,10) within group (order by score,score1) as "per_rnk" from test;
select PERCENT_RANK(null,2147483647) within group (order by score,score1) as "per_rnk" from test;

select PERCENT_RANK(40,1) within group (partition by score order by score,score1) as "per_rnk" from test;
select PERCENT_RANK(null,null) within group (partition by score order by score,score1) as "per_rnk" from test;
select PERCENT_RANK(null,10) within group (partition by score order by score,score1) as "per_rnk" from test;
select PERCENT_RANK(null,2147483647) within group (partition by score order by score,score1) as "per_rnk" from test;

select PERCENT_RANK(40,1) within group (order by score,score1) as "per_rnk" from test;
select PERCENT_RANK(null,null) within group (order by score,score1) as "per_rnk" from test;
select PERCENT_RANK(null,10) within group (order by score,score1) as "per_rnk" from test;
select PERCENT_RANK(null,2147483647) within group (order by score,score1) as "per_rnk" from test;
select PERCENT_RANK(null,0x3) within group (order by score,score1) as "per_rnk" from test;
select PERCENT_RANK(null,'0x3') within group (order by score,score1) as "per_rnk" from test;

select PERCENT_RANK(null,1000000000000000000000000000000000000000000000000000000000000000000000) within group (order by score,score1) as "per_rnk" from test;
select PERCENT_RANK(null,'1000000000000000000000000000000000000000000000000000000000000000000000') within group (order by score,score1) as "per_rnk" from test;

select PERCENT_RANK(40,1) within group (order by score nulls first,score1 nulls first) as "per_rnk" from test;
select PERCENT_RANK(null,null) within group (order by score nulls first,score1 nulls first) as "per_rnk" from test;
select PERCENT_RANK(null,10) within group (order by score nulls first,score1 nulls first) as "per_rnk" from test;
select PERCENT_RANK(null,2147483647) within group (order by score nulls first,score1 nulls first) as "per_rnk" from test;

select PERCENT_RANK(40,1) within group (order by score nulls last,score1 nulls last) as "per_rnk" from test;
select PERCENT_RANK(null,null) within group (order by score nulls last,score1 nulls last) as "per_rnk" from test;
select PERCENT_RANK(null,10) within group (order by score nulls last,score1 nulls last) as "per_rnk" from test;
select PERCENT_RANK(null,2147483647) within group (order by score nulls last,score1 nulls last) as "per_rnk" from test;

select PERCENT_RANK(40,1) within group (order by score desc nulls first,score1 desc nulls first) as "per_rnk" from test;
select PERCENT_RANK(null,null) within group (order by score desc nulls first,score1 desc nulls first) as "per_rnk" from test;
select PERCENT_RANK(null,10) within group (order by score desc nulls first,score1 desc nulls first) as "per_rnk" from test;
select PERCENT_RANK(null,2147483647) within group (order by score desc nulls first,score1 desc nulls first) as "per_rnk" from test;

select PERCENT_RANK(40,1) within group (order by score asc nulls first,score1 asc nulls first) as "per_rnk" from test;
select PERCENT_RANK(null,null) within group (order by score asc nulls first,score1 asc nulls first) as "per_rnk" from test;
select PERCENT_RANK(null,10) within group (order by score asc nulls first,score1 asc nulls first) as "per_rnk" from test;
select PERCENT_RANK(null,2147483647) within group (order by score asc nulls first,score1 asc nulls first) as "per_rnk" from test;

select PERCENT_RANK(40,1) within group (order by score asc nulls last,score1 asc nulls last) as "per_rnk" from test;
select PERCENT_RANK(null,null) within group (order by score asc nulls last,score1 asc nulls last) as "per_rnk" from test;
select PERCENT_RANK(null,10) within group (order by score asc nulls last,score1 asc nulls last) as "per_rnk" from test;
select PERCENT_RANK(null,2147483647) within group (order by score asc nulls last,score1 asc nulls last) as "per_rnk" from test;

select PERCENT_RANK(40,1) within group (order by score desc nulls last,score1 desc nulls last) as "per_rnk" from test;
select PERCENT_RANK(null,null) within group (order by score desc nulls last,score1 desc nulls last) as "per_rnk" from test;
select PERCENT_RANK(null,10) within group (order by score desc nulls last,score1 desc nulls last) as "per_rnk" from test;
select PERCENT_RANK(null,2147483647) within group (order by score desc nulls last,score1 desc nulls last) as "per_rnk" from test;

select PERCENT_RANK(40,1) within group (order by score desc,score1 desc) as "per_rnk" from test;
select PERCENT_RANK(null,null) within group (order by score desc,score1 desc) as "per_rnk" from test;
select PERCENT_RANK(null,10) within group (order by score desc,score1 desc) as "per_rnk" from test;
select PERCENT_RANK(null,2147483647) within group (order by score desc,score1 desc) as "per_rnk" from test;

select PERCENT_RANK(40,1) within group (order by score asc,score1 asc) as "per_rnk" from test;
select PERCENT_RANK(null,null) within group (order by score asc,score1 asc) as "per_rnk" from test;
select PERCENT_RANK(null,10) within group (order by score asc,score1 asc) as "per_rnk" from test;
select PERCENT_RANK(null,2147483647) within group (order by score asc,score1 asc) as "per_rnk" from test;

drop view test;


text:
using Nexmo.Api.Request;

namespace Nexmo.Api.Verify
{
    public interface IVerifyClient
    {
        /// <summary>
        /// Use Verify request to generate and send a PIN to your user
        /// </summary>
        /// <param name="request"></param>
        /// <param name="creds"></param>
        /// <returns></returns>
        VerifyResponse VerifyRequest(VerifyRequest request, Credentials creds = null);

        /// <summary>
        /// Use Verify check to confirm that the PIN you received from your user matches the one sent by Nexmo in your Verify request
        /// </summary>
        /// <param name="request"></param>
        /// <param name="creds"></param>
        /// <returns></returns>
        VerifyCheckResponse VerifyCheck(VerifyCheckRequest request, Credentials creds = null);

        /// <summary>
        /// Use Verify search to check the status of past or current verification requests
        /// </summary>
        /// <param name="request"></param>
        /// <param name="creds"></param>
        /// <returns></returns>
        VerifySearchResponse VerifySearch(VerifySearchRequest request, Credentials creds = null);

        /// <summary>
        /// Control the progress of your Verify requests. To cancel an existing Verify request, or to trigger the next verification event
        /// </summary>
        /// <param name="request"></param>
        /// <param name="creds"></param>
        /// <returns></returns>
        VerifyControlResponse VerifyControl(VerifyControlRequest request, Credentials creds = null);

        /// <summary>
        /// Use Verify request to generate and send a PIN to your user to authorize a payment:
        /// 1. Create a request to send a verification code to your user.
        /// 2. Check the status field in the response to ensure that your request was successful (zero is success).
        /// 3. Use the request_id field in the response for the Verify check.
        /// </summary>
        /// <param name="request"></param>
        /// <param name="creds"></param>
        /// <returns></returns>
        VerifyResponse VerifyRequestWithPSD2(Psd2Request request, Credentials creds = null);
    }
}


text:
<?php

final class PhabricatorPackagesPublisherTransaction
  extends PhabricatorModularTransaction {

  public function getApplicationName() {
    return 'packages';
  }

  public function getApplicationTransactionType() {
    return PhabricatorPackagesPublisherPHIDType::TYPECONST;
  }

  public function getBaseTransactionClass() {
    return 'PhabricatorPackagesPublisherTransactionType';
  }

}


text:
#home {
  width: 100%;
  height: 100vh;
  background-image: url("assets/images/funding1.jpg");
  background-size: cover;
  background-position: 50% 50%;
  background-repeat: no-repeat;
  color: #FFF;
  text-align: center; }
  #home h1 {
    font-family: 'Righteous', cursive;
    color: #bd9438;
    font-size: 100;
    text-align: center; }
  #home a, #home a:hover {
    background-color: #bd9438;
    color: #FFF;
    text-decoration: none;
    padding: 1em 1em;
    border-radius: 0.5em;
    font-weight: 700;
    display: inline-block;
    margin: 2em 0; }

/*# sourceMappingURL=home.css.map */


text:
//
//  Accept for iOS
//
//  Created by Radoslav Danko and Francisco Fortes
//  Copyright (c) 2016 Wirecard. All rights reserved.
//

#import <Foundation/Foundation.h>

/** typedef enum AcceptTransactionsQueryOrder
 */
typedef enum {
    ///Ascending order
    AcceptTransactionsQueryOrderAscending=0,
    /// Descending order
    AcceptTransactionsQueryOrderDescending
} AcceptTransactionsQueryOrder;

/** typedef enum AcceptTransactionsQueryOrderBy
 */
typedef enum {
    /// Ordered by creation date
    AcceptTransactionsQueryOrderByCreatedAt=0,
    /// Order by amount
    AcceptTransactionsQueryOrderByAmount,
    /// Order by name
    AcceptTransactionsQueryOrderByName
} AcceptTransactionsQueryOrderBy;

/**
 *  @class AcceptTransactionsQuery
 *  @discussion Transaction query class used in payment searches
 **/
@interface AcceptTransactionsQuery : NSObject
/// Page
@property (nonatomic) NSUInteger page;
/// Page size
@property (nonatomic) NSUInteger pageSize;
/// Query phrase
@property (nonatomic, strong) NSString * queryPhrase;
/// Statuses
@property (nonatomic, strong) NSSet * statuses;
/// Sort order
@property (nonatomic) AcceptTransactionsQueryOrder orderSort;
/// Order by
@property (nonatomic) AcceptTransactionsQueryOrderBy orderBy;
@end


text:
https://github.com/mitsuhiko/flask

#### 1. 成功连接数据库
#### 2. 试用模板
#### 3. cookie session
#### 4. 实现登陆
#### 5.

### 网址
http://flask.pocoo.org/
http://docs.jinkan.org/docs/flask/

### 安装
http://docs.jinkan.org/docs/flask/installation.html#installation

```
$ mkdir myproject
$ cd myproject
$ virtualenv venv
New python executable in venv/bin/python
Installing distribute............done.
```

```
. venv/bin/activate
```

### Flask 与数据库
官方教程用的是 SQLite = = ....

### __name__

### @app.route('/') 装饰器

## Flask 总结

http://code.tutsplus.com/tutorials/creating-a-web-app-from-scratch-using-python-flask-and-mysql--cms-22972

Flask-SQLAlchemy

Flask-MySQL
https://flask-mysql.readthedocs.org/en/latest/#

MySQLdb

Flask-MySQL
https://flask-mysql.readthedocs.org/en/latest/
http://codehandbook.org/python-web-application-development-using-flask-and-mysql/
http://code.tutsplus.com/tutorials/creating-a-web-app-from-scratch-using-python-flask-and-mysql--cms-22972


text:
<!DOCTYPE html>
<meta charset='UTF-8'><meta name="robots" content="noindex"><link rel="shortcut icon" type="image/x-icon" href="//production-assets.codepen.io/assets/favicon/favicon-8ea04875e70c4b0bb41da869e81236e54394d63638a1ef12fa558a4a835f1164.ico" /><link rel="mask-icon" type="" href="//production-assets.codepen.io/assets/favicon/logo-pin-f2d2b6d2c61838f7e76325261b7195c27224080bc099486ddd6dccb469b8e8e6.svg" color="#111" /><link rel="canonical" href="https://codepen.io/jamesgarrett/pen/ZaqJLE" />

<link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta.2/css/bootstrap.css'>

A bootstrap compatible slider that rotates gracefully in three dimensions

A bootstrap compatible slider that rotates gracefully in three dimensions

A bootstrap compatible slider that rotates gracefully in three dimensions

A bootstrap compatible slider that rotates gracefully in three dimensions

  <button class="previous">Previous</button>
  <button class="next">Next</button>


text:
<?php

/**
 * @file
 * Stub file for "block" theme hook [pre]process functions.
 */

/**
 * Pre-processes variables for the "block" theme hook.
 *
 * See template for list of available variables.
 *
 * @param array $variables
 *   An associative array of variables, passed by reference.
 *
 * @see block.tpl.php
 *
 * @ingroup theme_preprocess
 */
function bootstrap_preprocess_block(array &$variables) {
  // Use a bare template for the page's main content.
  if ($variables['block_html_id'] == 'block-system-main') {
    $variables['theme_hook_suggestions'][] = 'block__no_wrapper';
  }
  $variables['title_attributes_array']['class'][] = 'block-title';
}

/**
 * Processes variables for the "block" theme hook.
 *
 * See template for list of available variables.
 *
 * @param array $variables
 *   An associative array of variables, passed by reference.
 *
 * @see block.tpl.php
 *
 * @ingroup theme_process
 */
function bootstrap_process_block(array &$variables) {
  // Drupal 7 should use a $title variable instead of $block->subject.
  // Don't override an existing "title" variable, some modules may already it.
  if (!isset($variables['title'])) {
    $variables['title'] = $variables['block']->subject;
  }
  $variables['title'] = filter_xss_admin($variables['title']);
}


text:
FOUNDATION_EXPORT double Pods_ZDOpenSourceSwiftDemoTestsVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_ZDOpenSourceSwiftDemoTestsVersionString[];


text:
import pyodbc
import pandas as pd
from enviropy import Enviropy

__all__ = ["read_manages3", "read_manages4"]

def read_manages3(mdb_path):
    """
    Function to read a MANAGES 3.x database and return
    the data in a pandas DataFrame for analysis.

    Parameters
    ----------
    mdb_path : str
        The path to the MANAGES 3.x Site.mdb file.

    Returns
    -------
    DataFrame :  pandas DataFrame
        returns a pandas DataFrame.

    Examples
    --------
    >>> from enviropy.io import read_manages3
    >>> data = read_manages3('C:\Path\to\Site.mdb')
    """

    driver = "{Microsoft Access Driver (*.mdb, *.accdb)}"
    database = mdb_path

    con = pyodbc.connect("DRIVER={0};DBQ={1}".format(driver, database))

    query = """
    SELECT sample_results.location_id,
    sample_results.sample_date, site_parameters.param_name,
    sample_results.lt_measure, sample_results.analysis_result,
    site_parameters.default_unit
    FROM sample_results LEFT JOIN site_parameters
    ON sample_results.storet_code = site_parameters.storet_code
    """

    df = pd.read_sql(query, con)

    con.close()

    return Enviropy(df)

def read_manages4(sql, con):
    """
    Function to read a MANAGES 4.x database and return
    the data in a pandas DataFrame for analysis.

    Parameters
    ----------
    sql : str
        SQL query to execute.
    con : DB connection or SQAlchemy engine
        Active connection to teh databse to query

    Returns
    -------
    Enviropy DataFrame

    Examples
    --------
    >>> sql =  "
    SELECT sample_results.location_id,
    sample_results.sample_date, site_parameters.param_name,
    sample_results.lt_measure, sample_results.analysis_result,
    sample_results.detection_limit, sample_results.RL,
    sample_results.flags, site_parameters.default_unit
    FROM sample_results
        LEFT JOIN site_parameters
            ON sample_results.storet_code = site_parameters.storet_code AND sample_results.site_id = site_parameters.site_id
            LEFT JOIN locations
            ON locations.site_id = sample_results.site_id AND locations.location_id = sample_results.location_id
        LEFT JOIN site
            ON site.site_id = locations.site_id
    "
    >>> from enviropy.io import read_manages_4
    >>>
    """

    df = pandas.read_sql(sql, con)

    return Enviropy(df)


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

<title>LauncherMessage</title>
<meta name="date" content="2016-12-12">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Enum Constants |

Field |

Method

Detail:

Enum Constants |

Field |

Method

org.plexian.grumy.launcher

Enum LauncherMessage

java.lang.Object

java.lang.Enum<LauncherMessage>

org.plexian.grumy.launcher.LauncherMessage

All Implemented Interfaces:

java.io.Serializable, java.lang.Comparable<LauncherMessage>

public enum LauncherMessage
extends java.lang.Enum<LauncherMessage>

Enum Constant Summary

Enum Constants

Enum Constant and Description

ERROR

INVALID_LOGIN

SERVER_ERROR

VALID_LOGIN

Method Summary

All Methods Static Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

java.lang.String
getMessage()

static LauncherMessage
valueOf(java.lang.String name)

Returns the enum constant of this type with the specified name.

static LauncherMessage[]
values()

Returns an array containing the constants of this enum type, in
the order they are declared.

Methods inherited from class java.lang.Enum

compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

ERROR

public static final LauncherMessage ERROR

SERVER_ERROR

public static final LauncherMessage SERVER_ERROR

INVALID_LOGIN

public static final LauncherMessage INVALID_LOGIN

VALID_LOGIN

public static final LauncherMessage VALID_LOGIN

Method Detail

values

public static LauncherMessage[] values()

Returns an array containing the constants of this enum type, in
the order they are declared.  This method may be used to iterate
over the constants as follows:

for (LauncherMessage c : LauncherMessage.values())
    System.out.println(c);

Returns:

an array containing the constants of this enum type, in the order they are declared

valueOf

public static LauncherMessage valueOf(java.lang.String name)

Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type.  (Extraneous whitespace characters are
not permitted.)

Parameters:

name - the name of the enum constant to be returned.

Returns:

the enum constant with the specified name

Throws:

java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

java.lang.NullPointerException - if the argument is null

getMessage

public java.lang.String getMessage()

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Enum Constants |

Field |

Method

Detail:

Enum Constants |

Field |

Method


text:
Card-Backend
============

Data Backend and API for Card-Readers, originally built for iOrchestra


text:
<!DOCTYPE html>

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

<meta name="viewport" content="width=device-width, initial-scale=1">

<title>Regular expressions</title>

Regular expressions

Regular expressions are a concise and flexible tool for describing patterns in strings. This vignette describes the key features of stringr's regular expressions, as implemented by stringi. It is not a tutorial, so if you're unfamiliar regular expressions, I'd recommend starting at http://r4ds.had.co.nz/strings.html. If you want to master the details, I'd recommend reading the classic Mastering Regular Expressions by Jeffrey E. F. Fried.

Regular expressions are the default pattern engine in stringr. That means when you use a pattern matching function with a bare string, it's equivalent to wrapping it in a call to regex():

# The regular call:
str_extract(fruit, "nana")
# Is shorthand for
str_extract(fruit, regex("nana"))

You will need to use regex() explicitly if you want to override the default options, as you'll see in examples below.

Basic matches

The simplest patterns match exact strings:

x <- c("apple", "banana", "pear")
str_extract(x, "an")
#> [1] NA   "an" NA

You can perform a case-insensitive match using ignore_case = TRUE:

bananas <- c("banana", "Banana", "BANANA")
str_detect(bananas, "banana")
#> [1]  TRUE FALSE FALSE
str_detect(bananas, regex("banana", ignore_case = TRUE))
#> [1] TRUE TRUE TRUE

The next step up in complexity is ., which matches any character except a newline:

str_extract(x, ".a.")
#> [1] NA    "ban" "ear"

You can allow . to match everything, including \n, by setting dotall = TRUE:

str_detect("\nX\n", ".X.")
#> [1] FALSE
str_detect("\nX\n", regex(".X.", dotall = TRUE))
#> [1] TRUE

Escaping

If "." matches any character, how do you match a literal "."? You need to use an "escape" to tell the regular expression you want to match it exactly, not use its special behaviour. Like strings, regexps use the backslash, \, to escape special behaviour. So to match an ., you need the regexp \.. Unfortunately this creates a problem. We use strings to represent regular expressions, and \ is also used as an escape symbol in strings. So to create the regular expression \. we need the string "\\.".

# To create the regular expression, we need \\
dot <- "\\."

# But the expression itself only contains one:
writeLines(dot)
#> \.

# And this tells R to look for an explicit .
str_extract(c("abc", "a.c", "bef"), "a\\.c")
#> [1] NA    "a.c" NA

If \ is used as an escape character in regular expressions, how do you match a literal \? Well you need to escape it, creating the regular expression \\. To create that regular expression, you need to use a string, which also needs to escape \. That means to match a literal \ you need to write "\\\\" — you need four backslashes to match one!

x <- "a\\b"
writeLines(x)
#> a\b

str_extract(x, "\\\\")
#> [1] "\\"

In this vignette, I use \. to denote the regular expression, and "\\." to denote the string that represents the regular expression.

An alternative quoting mechanism is \Q...\E: all the characters in ... are treated as exact matches. This is useful if you want to exactly match user input as part of a regular expression.

x <- c("a.b.c.d", "aeb")
starts_with <- "a.b"

str_detect(x, paste0("^", starts_with))
#> [1] TRUE TRUE
str_detect(x, paste0("^\\Q", starts_with, "\\E"))
#> [1]  TRUE FALSE

Special characters

Escapes also allow you to specify individual characters that are otherwise hard to type. You can specify individual unicode characters in five ways, either as a variable number of hex digits (four is most common), or by name:

\xhh: 2 hex digits.

\x{hhhh}: 1-6 hex digits.

\uhhhh: 4 hex digits.

\Uhhhhhhhh: 8 hex digits.

\N{name}, e.g. \N{grinning face} matches the basic smiling emoji.

Similarly, you can specify many common control characters:

\a: bell.

\cX: match a control-X character.

\e: escape (\u001B).

\f: form feed (\u000C).

\n: line feed (\u000A).

\r: carriage return (\u000D).

\t: horizontal tabulation (\u0009).

\0ooo match an octal character. 'ooo' is from one to three octal digits, from 000 to 0377. The leading zero is required.

(Many of these are only of historical interest and are only included here for the sake of completeness.)

Matching multiple characters

There are a number of patterns that match more than one character. You've already seen ., which matches any character (except a newline). A closely related operator is \X, which matches a grapheme cluster, a set of individual elements that form a single symbol. For example, one way of representing "á" is as the letter "a" plus an accent: . will match the component "a", while \X will match the complete symbol:

x <- "a\u0301"
str_extract(x, ".")
#> [1] "a"
str_extract(x, "\\X")
#> [1] "á"

There are five other escaped pairs that match narrower classes of characters:

\d: matches any digit. The complement, \D, matches any character that is not a decimal digit.

str_extract_all("1 + 2 = 3", "\\d+")[[1]]
#> [1] "1" "2" "3"

Technically, \d includes any character in the Unicode Category of Nd ("Number, Decimal Digit"), which also includes numeric symbols from other languages:

# Some Laotian numbers
str_detect("១២៣", "\\d")
#> [1] TRUE

\s: matches any whitespace. This includes tabs, newlines, form feeds, and any character in the Unicode Z Category (which includes a variety of space characters and other separators.). The complement, \S, matches any non-whitespace character.

(text <- "Some  \t badly\n\t\tspaced \f text")
#> [1] "Some  \t badly\n\t\tspaced \f text"
str_replace_all(text, "\\s+", " ")
#> [1] "Some badly spaced text"

\p{property name} matches any character with specific unicode property, like \p{Uppercase} or \p{Diacritic}. The complement, \P{property name}, matches all characters without the property. A complete list of unicode properties can be found at http://www.unicode.org/reports/tr44/#Property_Index.

(text <- c('"Double quotes"', "«Guillemet»", ""Fancy quotes""))
#> [1] "\"Double quotes\"" "«Guillemet»"       ""Fancy quotes""
str_replace_all(text, "\\p{quotation mark}", "'")
#> [1] "'Double quotes'" "'Guillemet'"     "'Fancy quotes'"

\w matches any "word" character, which includes alphabetic characters, marks and decimal numbers. The complement, \W, matches any non-word character.

str_extract_all("Don't eat that!", "\\w+")[[1]]
#> [1] "Don"  "t"    "eat"  "that"
str_split("Don't eat that!", "\\W")[[1]]
#> [1] "Don"  "t"    "eat"  "that" ""

Technically, \w also matches connector punctuation, \u200c (zero width connector), and \u200d (zero width joiner), but these are rarely seen in the wild.

\b matches word boundaries, the transition between word and non-word characters. \B matches the opposite: boundaries that have either both word or non-word characters on either side.

str_replace_all("The quick brown fox", "\\b", "_")
#> [1] "_The_ _quick_ _brown_ _fox_"
str_replace_all("The quick brown fox", "\\B", "_")
#> [1] "T_h_e q_u_i_c_k b_r_o_w_n f_o_x"

You can also create your own character classes using []:

[abc]: matches a, b, or c.

[a-z]: matches every character between a and z (in Unicode code point order).

[^abc]: matches anything except a, b, or c.

[\^\-]: matches ^ or -.

There are a number of pre-built classes that you can use inside []:

[:punct:]: punctuation.

[:alpha:]: letters.

[:lower:]: lowercase letters.

[:upper:]: upperclass letters.

[:digit:]: digits.

[:xdigit:]: hex digits.

[:alnum:]: letters and numbers.

[:cntrl:]: control characters.

[:graph:]: letters, numbers, and punctuation.

[:print:]: letters, numbers, punctuation, and whitespace.

[:space:]: space characters (basically equivalent to \s).

[:blank:]: space and tab.

These all go inside the [] for character classes, i.e. [[:digit:]AX] matches all digits, A, and X.

You can also using Unicode properties, like [\p{Letter}], and various set operations, like [\p{Letter}--\p{script=latin}]. See ?"stringi-search-charclass" for details.

Alternation

| is the alternation operator, which will pick between one or more possible matches. For example, abc|def will match abc or def.

str_detect(c("abc", "def", "ghi"), "abc|def")
#> [1]  TRUE  TRUE FALSE

Note that the precedence for | is low, so that abc|def matches abc or def not abcyz or abxyz.

Grouping

You can use parentheses to override the default precedence rules:

str_extract(c("grey", "gray"), "gre|ay")
#> [1] "gre" "ay"
str_extract(c("grey", "gray"), "gr(e|a)y")
#> [1] "grey" "gray"

Parenthesis also define "groups" that you can refer to with backreferences, like \1, \2 etc, and can be extracted with str_match(). For example, the following regular expression finds all fruits that have a repeated pair of letters:

pattern <- "(..)\\1"
fruit %>%
  str_subset(pattern)
#> [1] "banana"      "coconut"     "cucumber"    "jujube"      "papaya"
#> [6] "salal berry"

fruit %>%
  str_subset(pattern) %>%
  str_match(pattern)
#>      [,1]   [,2]
#> [1,] "anan" "an"
#> [2,] "coco" "co"
#> [3,] "cucu" "cu"
#> [4,] "juju" "ju"
#> [5,] "papa" "pa"
#> [6,] "alal" "al"

You can use (?:...), the non-grouping parentheses, to control precedence but not capture the match in a group. This is slightly more efficient than capturing parentheses.

str_match(c("grey", "gray"), "gr(e|a)y")
#>      [,1]   [,2]
#> [1,] "grey" "e"
#> [2,] "gray" "a"
str_match(c("grey", "gray"), "gr(?:e|a)y")
#>      [,1]
#> [1,] "grey"
#> [2,] "gray"

This is most useful for more complex cases where you need to capture matches and control precedence independently.

Anchors

By default, regular expressions will match any part of a string. It's often useful to anchor the regular expression so that it matches from the start or end of the string:

^ matches the start of string.

$ matches the end of the string.

x <- c("apple", "banana", "pear")
str_extract(x, "^a")
#> [1] "a" NA  NA
str_extract(x, "a$")
#> [1] NA  "a" NA

To match a literal "$" or "^", you need to escape them, \$, and \^.

For multiline strings, you can use regex(multiline = TRUE). This changes the behaviour of ^ and $, and introduces three new operators:

^ now matches the start of each line.

$ now matches the end of each line.

\A matches the start of the input.

\z matches the end of the input.

\Z matches the end of the input, but before the final line terminator, if it exists.

x <- "Line 1\nLine 2\nLine 3\n"
str_extract_all(x, "^Line..")[[1]]
#> [1] "Line 1"
str_extract_all(x, regex("^Line..", multiline = TRUE))[[1]]
#> [1] "Line 1" "Line 2" "Line 3"
str_extract_all(x, regex("\\ALine..", multiline = TRUE))[[1]]
#> [1] "Line 1"

Repetition

You can control how many times a pattern matches with the repetition operators:

?: 0 or 1.

+: 1 or more.

*: 0 or more.

x <- "1888 is the longest year in Roman numerals: MDCCCLXXXVIII"
str_extract(x, "CC?")
#> [1] "CC"
str_extract(x, "CC+")
#> [1] "CCC"
str_extract(x, 'C[LX]+')
#> [1] "CLXXX"

Note that the precedence of these operators is high, so you can write: colou?r to match either American or British spellings. That means most uses will need parentheses, like bana(na)+.

You can also specify the number of matches precisely:

{n}: exactly n

{n,}: n or more

{n,m}: between n and m

str_extract(x, "C{2}")
#> [1] "CC"
str_extract(x, "C{2,}")
#> [1] "CCC"
str_extract(x, "C{2,3}")
#> [1] "CCC"

By default these matches are "greedy": they will match the longest string possible. You can make them "lazy", matching the shortest string possible by putting a ? after them:

??: 0 or 1, prefer 0.

+?: 1 or more, match as few times as possible.

*?: 0 or more, match as few times as possible.

{n,}?: n or more, match as few times as possible.

{n,m}?: between n and m, , match as few times as possible, but at least n.

str_extract(x, c("C{2,3}", "C{2,3}?"))
#> [1] "CCC" "CC"
str_extract(x, c("C[LX]+", "C[LX]+?"))
#> [1] "CLXXX" "CL"

You can also make the matches possessive by putting a + after them, which means that if later parts of the match fail, the repetition will not be re-tried with a smaller number of characters. This is an advanced feature used to improve performance in worst-case scenarios (called "catastrophic backtracking").

?+: 0 or 1, possessive.

++: 1 or more, possessive.

*+: 0 or more, possessive.

{n}+: exactly n, possessive.

{n,}+: n or more, possessive.

{n,m}+: between n and m, possessive.

A related concept is the atomic-match parenthesis, (?>...). If a later match fails and the engine needs to back-track, an atomic match is kept as is: it succeeds or fails as a whole. Compare the following two regular expressions:

str_detect("ABC", "(?>A|.B)C")
#> [1] FALSE
str_detect("ABC", "(?:A|.B)C")
#> [1] TRUE

The atomic match fails because it matches A, and then the next character is a C so it fails. The regular match succeeds because it matches A, but then C doesn't match, so it back-tracks and tries B instead.

Look arounds

These assertions look ahead or behind the current match without "consuming" any characters (i.e. changing the input position).

(?=...): positive look-ahead assertion. Matches if ... matches at the current input.

(?!...): negative look-ahead assertion. Matches if ... does not match at the current input.

(?<=...): positive look-behind assertion. Matches if ... matches text preceding the current position, with the last character of the match being the character just before the current position. Length must be bounded

(i.e. no * or +).

(?<!...): negative look-behind assertion. Matches if ... does not match text preceding the current position. Length must be bounded

(i.e. no * or +).

These are useful when you want to check that a pattern exists, but you don't want to include it in the result:

x <- c("1 piece", "2 pieces", "3")
str_extract(x, "\\d+(?= pieces?)")
#> [1] "1" "2" NA

y <- c("100", "$400")
str_extract(y, "(?<=\\$)\\d+")
#> [1] NA    "400"

Comments

There are two ways to include comments in a regular expression. The first is with (?#...):

str_detect("xyz", "x(?#this is a comment)")
#> [1] TRUE

The second is to use regex(comments = TRUE). This form ignores spaces and newlines, and anything everything after #. To match a literal space, you'll need to escape it: "\\ ". This is a useful way of describing complex regular expressions:

phone <- regex("
  \\(?     # optional opening parens
  (\\d{3}) # area code
  [)- ]?   # optional closing parens, dash, or space
  (\\d{3}) # another three numbers
  [ -]?    # optional space or dash
  (\\d{3}) # three more numbers
  ", comments = TRUE)

str_match("514-791-8141", phone)
#>      [,1]          [,2]  [,3]  [,4]
#> [1,] "514-791-814" "514" "791" "814"


text:
<!DOCTYPE html>

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

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Designomate Admin </title>

    <link href="<?php echo base_url();?>/backassets/vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">

    <link href="<?php echo base_url();?>backassets/vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">

    <link href="<?php echo base_url();?>backassets/vendors/nprogress/nprogress.css" rel="stylesheet">

    <link href="<?php echo base_url();?>backassets/vendors/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">

    <link href="<?php echo base_url();?>backassets/build/css/custom.min.css" rel="stylesheet">

               Designomate

                Welcome,

<?php print_r($this->session->userdata('name')); ?>

General

 Home

Plans

<a href="<?php echo base_url();?>plans">Upgrade

<a href="<?php echo base_url();?>plans/plans_list">Plans List

 Themes

<a href="<?php echo base_url();?>themes/themes_list">Themes List

Addons

<a href="<?php echo base_url();?>themes/addons">Add New

<a href="<?php echo base_url();?>daddons/addons_list">Addons List

                    <?php print_r($this->session->userdata('name')); ?>

Help

<a href="<?php echo base_url();?>login/logout"> Log Out

                    6

                          John Smith
                          3 mins ago

                          Film festivals used to be do-or-die moments for movie makers. They were where...

                          John Smith
                          3 mins ago

                          Film festivals used to be do-or-die moments for movie makers. They were where...

                          John Smith
                          3 mins ago

                          Film festivals used to be do-or-die moments for movie makers. They were where...

                          John Smith
                          3 mins ago

                          Film festivals used to be do-or-die moments for movie makers. They were where...

                          See All Alerts


text:
import {Map} from '../Map';
import {Handler} from '../../core/Handler';

/*
 * L.Handler.DoubleClickZoom is used to handle double-click zoom on the map, enabled by default.
 */

// @namespace Map
// @section Interaction Options

Map.mergeOptions({
	// @option doubleClickZoom: Boolean|String = true
	// Whether the map can be zoomed in by double clicking on it and
	// zoomed out by double clicking while holding shift. If passed
	// `'center'`, double-click zoom will zoom to the center of the
	//  view regardless of where the mouse was.
	doubleClickZoom: 'center'
});

export var DoubleClickZoom = Handler.extend({
	addHooks: function () {
		this._map.on('dblclick', this._onDoubleClick, this);
	},

	removeHooks: function () {
		this._map.off('dblclick', this._onDoubleClick, this);
	},

	_onDoubleClick: function (e) {
		var map = this._map,
		    oldZoom = map.getZoom(),
		    delta = map.options.zoomDelta,
		    zoom = e.originalEvent.shiftKey ? oldZoom - delta : oldZoom + delta;

		if (map.options.doubleClickZoom === 'center') {
			map.setZoom(zoom);
		} else {
			map.setZoomAround(e.containerPoint, zoom);
		}
	}
});

// @section Handlers
//
// Map properties include interaction handlers that allow you to control
// interaction behavior in runtime, enabling or disabling certain features such
// as dragging or touch zoom (see `Handler` methods). For example:
//
// ```js
// map.doubleClickZoom.disable();
// ```
//
// @property doubleClickZoom: Handler
// Double click zoom handler.
Map.addInitHook('addHandler', 'doubleClickZoom', DoubleClickZoom);


text:
package net.iskandar.examples.chat.app.client.mvp.activities;

import java.util.List;

import net.iskandar.examples.chat.app.client.ChatFacadeException;
import net.iskandar.examples.chat.app.client.mvp.ChatApplicationInternal;
import net.iskandar.examples.chat.app.client.mvp.ChatMessageRenderer;
import net.iskandar.examples.chat.app.client.mvp.model.ChatModel;
import net.iskandar.examples.chat.app.client.mvp.places.ChatPlace;
import net.iskandar.examples.chat.app.client.mvp.presenters.ChatPresenter;
import net.iskandar.examples.chat.app.client.mvp.views.ChatView;
import net.iskandar.examples.chat.app.client.to.ChatMessageTo;

import com.google.gwt.activity.shared.Activity;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.ui.AcceptsOneWidget;

public class ChatActivity implements Activity, ChatPresenter, ChatModel.Listener {

	private ChatApplicationInternal chatApplication;
	private ChatPlace place;
	private ChatModel chatModel;
	private ChatView chatView;

	public ChatActivity(ChatPlace place, ChatApplicationInternal chatApplication) {
		super();
		this.chatApplication = chatApplication;
		this.place = place;
	}

	@Override
	public void start(AcceptsOneWidget panel, EventBus eventBus) {
		String chatIdStr = place.getChatId();
		try {
			Integer chatId = Integer.parseInt(chatIdStr);
			chatView = chatApplication.getChatView();
			chatView.clearMessages();
			chatView.asWidget().setVisible(true);
			panel.setWidget(chatView);
			chatView.setChatPresenter(this);
			chatModel = chatApplication.getChatModel();
			chatModel.addListener(this);
			chatModel.init(chatId, 0);
		} catch(NumberFormatException nfe){
			;
		}
	}

	@Override
	public String mayStop() {
		return null;
	}

	@Override
	public void onCancel() {
		// TODO Auto-generated method stub
	}

	@Override
	public void onStop() {
		chatModel.removeListener(this);
	}

	@Override
	public void chatError(ChatFacadeException error) {
		// TODO Auto-generated method stub
	}

	@Override
	public void newMessages(ChatModel sender, List<ChatMessageTo> messages) {
		ChatMessageRenderer renderer = chatApplication.getChatMessageRenderer();
		for(ChatMessageTo chatMessage : messages)
			chatApplication.getChatView().addMessage(renderer.renderChatMessage(chatMessage));
	}

	@Override
	public void postMessage(String message) {
		chatModel.postMessage(message);
	}

}


text:
import config from './config'
import coinbase from 'coinbase-pro'

const cbProAuthenticated = new coinbase.AuthenticatedClient(config.key, config.secret, config.passphrase, config.url)
const cbProPublic = ()=>{
    return new coinbase.PublicClient()
}
const cbProSocket = () =>{
    return new coinbase.WebsocketClient(['BTC-EUR'])
}

export {
    cbProAuthenticated,
    cbProPublic,
    cbProSocket
}


text:
local GUIToggled = false
local mouseX, mouseY = ScrW() / 2, ScrH() / 2
function GM:ShowSpare1()
	GUIToggled = not GUIToggled

	if GUIToggled then
		gui.SetMousePos(mouseX, mouseY);
	else
		mouseX, mouseY = gui.MousePos();
	end
	gui.EnableScreenClicker(GUIToggled);
end

function GM:PlayerStartVoice(ply)
	if ply == LocalPlayer() then
		ply.DRPIsTalking = true
		return -- Not the original rectangle for yourself! ugh!
	end
	self.BaseClass:PlayerStartVoice(ply);
end

function GM:PlayerEndVoice(ply)
	if ply == LocalPlayer() then
		ply.DRPIsTalking = false
		return
	end

	self.BaseClass:PlayerEndVoice(ply);
end

function GM:OnPlayerChat()
end

local FKeyBinds = {
	["gm_showhelp"] = "ShowHelp",
	["gm_showteam"] = "ShowTeam",
	["gm_showspare1"] = "ShowSpare1",
	["gm_showspare2"] = "ShowSpare2"
}

function GM:PlayerBindPress(ply, bind, pressed)
	self.BaseClass:PlayerBindPress(ply, bind, pressed);

	local bnd = string.match(string.lower(bind), "gm_[a-z]+[12]?");
	if bnd and FKeyBinds[bnd] then
		hook.Call(FKeyBinds[bnd], GAMEMODE);
	end
end

function GM:PlayerNoClip(ply)
	-- Default action for noclip is to disallow it
	return false
end

function GM:InitPostEntity()
	hook.Call("teamChanged", GAMEMODE, GAMEMODE.DefaultTeam, GAMEMODE.DefaultTeam);
end

function GM:teamChanged(before, after)
end

local function OnChangedTeam(um)
	local oldTeam, newTeam = um:ReadShort(), um:ReadShort();
	hook.Call("teamChanged", GAMEMODE, oldTeam, newTeam) -- backwards compatibility
	hook.Call("OnPlayerChangedTeam", GAMEMODE, LocalPlayer(), oldTeam, newTeam);
end
usermessage.Hook("OnChangedTeam", OnChangedTeam);

timer.Simple(0, function() GAMEMODE.ShowTeam = fprp.openKeysMenu end)


text:
package com.iluwatar.intercepting.filter;

/**
 * Filter Chain carries multiple filters and help to execute them in defined order on target.
 *
 * @author joshzambales
 */
public class FilterChain {

  private Filter chain;

  /**
   * Adds filter.
   */
  public void addFilter(Filter filter) {
    if (chain == null) {
      chain = filter;
    } else {
      chain.getLast().setNext(filter);
    }
  }

  /**
   * Execute filter chain.
   */
  public String execute(Order order) {
    if (chain != null) {
      return chain.execute(order);
    } else {
      return "RUNNING...";
    }
  }
}


text:
from django.conf import settings
from django.contrib.auth.signals import user_logged_in
from django.core import signing
from django.utils.crypto import constant_time_compare
from django.utils.encoding import force_text, smart_text
from django.utils.translation import ugettext

import jwt

from rest_framework import exceptions
from rest_framework.authentication import (
    BaseAuthentication, get_authorization_header)
from rest_framework_jwt.authentication import JSONWebTokenAuthentication

import olympia.core.logger

from olympia import core
from olympia.api import jwt_auth
from olympia.api.models import APIKey
from olympia.users.models import UserProfile
from olympia.users.utils import UnsubscribeCode

log = olympia.core.logger.getLogger('z.api.authentication')

class WebTokenAuthentication(BaseAuthentication):
    """
    DRF authentication class for our internal auth API tokens (i.e. not
    external clients using API keys - see JWTKeyAuthentication for that).

    Clients should authenticate by passing the token key in the "Authorization"
    HTTP header, prepended with the "Bearer" prefix. For example:

        Authorization: Bearer eyJhbGciOiAiSFMyNTYiLCAidHlwIj
    """
    www_authenticate_realm = 'api'
    auth_header_prefix = 'Bearer'
    salt = 'olympia.api.auth'

    def authenticate_header(self, request):
        """
        Return a string to be used as the value of the `WWW-Authenticate`
        header in a `401 Unauthenticated` response, or `None` if the
        authentication scheme should return `403 Permission Denied` responses.
        """
        return '{0} realm="{1}"'.format(
            self.auth_header_prefix.lower(), self.www_authenticate_realm)

    def get_token_value(self, request):
        auth_header = get_authorization_header(request).split()
        expected_header_prefix = self.auth_header_prefix.lower()

        if not auth_header or (
                smart_text(auth_header[0].lower()) != expected_header_prefix):
            return None

        if len(auth_header) == 1:
            msg = {
                'detail': ugettext('Invalid Authorization header. '
                                   'No credentials provided.'),
                'code': 'ERROR_INVALID_HEADER'
            }
            raise exceptions.AuthenticationFailed(msg)
        elif len(auth_header) > 2:
            msg = {
                'detail': ugettext('Invalid Authorization header. Credentials '
                                   'string should not contain spaces.'),
                'code': 'ERROR_INVALID_HEADER',
            }
            raise exceptions.AuthenticationFailed(msg)

        return auth_header[1]

    def authenticate(self, request):
        """
        Returns a two-tuple of `User` and token if a valid tolen has been
        supplied. Otherwise returns `None`.

        Raises AuthenticationFailed if a token was specified but it's invalid
        in some way (expired signature, invalid token, etc.)
        """
        token = self.get_token_value(request)
        if token is None:
            # No token specified, skip this authentication method.
            return None
        # Proceed.
        return self.authenticate_token(token)

    def authenticate_token(self, token):
        try:
            payload = signing.loads(
                force_text(token), salt=self.salt,
                max_age=settings.SESSION_COOKIE_AGE or None)
        except signing.SignatureExpired:
            msg = {
                'detail': ugettext('Signature has expired.'),
                'code': 'ERROR_SIGNATURE_EXPIRED',
            }
            raise exceptions.AuthenticationFailed(msg)
        except signing.BadSignature:
            msg = {
                'detail': ugettext('Error decoding signature.'),
                'code': 'ERROR_DECODING_SIGNATURE'
            }
            raise exceptions.AuthenticationFailed(msg)

        # We have a valid token, try to find the corresponding user.
        user = self.authenticate_credentials(payload)

        return (user, token)

    def authenticate_credentials(self, payload):
        """
        Return a non-deleted user that matches the payload's user id.

        Mimic what our UserAndAddrMiddleware and django's get_user() do when
        authenticating, because otherwise that behaviour would be missing in
        the API since API auth happens after the middleware process request
        phase.
        """
        if 'user_id' not in payload:
            log.info('No user_id in token payload {}'.format(payload))
            raise exceptions.AuthenticationFailed()
        try:
            user = UserProfile.objects.filter(deleted=False).get(
                pk=payload['user_id'])
        except UserProfile.DoesNotExist:
            log.info('User not found from token payload {}'.format(payload))
            raise exceptions.AuthenticationFailed()

        # Check get_session_auth_hash like django's get_user() does.
        session_auth_hash = user.get_session_auth_hash()
        payload_auth_hash = payload.get('auth_hash', '')
        if not constant_time_compare(payload_auth_hash, session_auth_hash):
            log.info('User tried to authenticate with invalid auth hash in'
                     'payload {}'.format(payload))
            raise exceptions.AuthenticationFailed()

        # Set user in thread like UserAndAddrMiddleware does.
        core.set_user(user)
        return user

class JWTKeyAuthentication(JSONWebTokenAuthentication):
    """
    DRF authentication class for JWT header auth with API keys.

    This extends the django-rest-framework-jwt auth class to get the
    shared JWT secret from our APIKey database model. Each user (an add-on
    developer) can have one or more API keys. The JWT is issued with their
    public ID and is signed with their secret.

    **IMPORTANT**

    Please note that unlike typical JWT usage, this authenticator only
    signs and verifies that the user is who they say they are. It does
    not sign and verify the *entire request*. In other words, when you use
    this authentication method you cannot prove that the request was made
    by the authenticated user.
    """

    def authenticate(self, request):
        """
        Returns a two-tuple of `User` and token if a valid signature has been
        supplied using JWT-based authentication.  Otherwise returns `None`.

        Copied from rest_framework_jwt BaseJSONWebTokenAuthentication, with
        the decode_handler changed to our own - because we don't want that
        decoder to be the default one in settings - and logging added.
        """
        jwt_value = self.get_jwt_value(request)
        if jwt_value is None:
            return None

        try:
            payload = jwt_auth.jwt_decode_handler(jwt_value)
        except Exception as exc:
            try:
                # Log all exceptions
                log.info('JWTKeyAuthentication failed; '
                         'it raised %s (%s)', exc.__class__.__name__, exc)
                # Re-raise to deal with them properly.
                raise exc
            except TypeError:
                msg = ugettext('Wrong type for one or more keys in payload')
                raise exceptions.AuthenticationFailed(msg)
            except jwt.ExpiredSignature:
                msg = ugettext('Signature has expired.')
                raise exceptions.AuthenticationFailed(msg)
            except jwt.DecodeError:
                msg = ugettext('Error decoding signature.')
                raise exceptions.AuthenticationFailed(msg)
            except jwt.InvalidTokenError:
                msg = ugettext('Invalid JWT Token.')
                raise exceptions.AuthenticationFailed(msg)
            # Note: AuthenticationFailed can also be raised directly from our
            # jwt_decode_handler.

        user = self.authenticate_credentials(payload)
        # Send user_logged_in signal when JWT is used to authenticate an user.
        # Otherwise, we'd never update the last_login information for users
        # who never visit the site but do use the API to upload new add-ons.
        user_logged_in.send(sender=self.__class__, request=request, user=user)
        return (user, jwt_value)

    def authenticate_credentials(self, payload):
        """
        Returns a verified AMO user who is active and allowed to make API
        requests.
        """
        if 'orig_iat' in payload:
            msg = ("API key based tokens are not refreshable, don't include "
                   "`orig_iat` in their payload.")
            raise exceptions.AuthenticationFailed(msg)
        try:
            api_key = APIKey.get_jwt_key(key=payload['iss'])
        except APIKey.DoesNotExist:
            msg = 'Invalid API Key.'
            raise exceptions.AuthenticationFailed(msg)

        if api_key.user.deleted:
            msg = 'User account is disabled.'
            raise exceptions.AuthenticationFailed(msg)
        if not api_key.user.read_dev_agreement:
            msg = 'User has not read developer agreement.'
            raise exceptions.AuthenticationFailed(msg)

        core.set_user(api_key.user)
        return api_key.user

    def get_jwt_value(self, request):
        """
        Get the JWT token from the authorization header.

        Copied from upstream's implementation but uses a hardcoded 'JWT'
        prefix in order to be isolated from JWT_AUTH_HEADER_PREFIX setting
        which is used for the non-api key auth above.
        """
        auth = get_authorization_header(request).split()
        auth_header_prefix = 'jwt'  # JWT_AUTH_HEADER_PREFIX.lower()

        if not auth or smart_text(auth[0].lower()) != auth_header_prefix:
            return None

        if len(auth) == 1:
            msg = ugettext('Invalid Authorization header. '
                           'No credentials provided.')
            raise exceptions.AuthenticationFailed(msg)
        elif len(auth) > 2:
            msg = ugettext('Invalid Authorization header. Credentials string '
                           'should not contain spaces.')
            raise exceptions.AuthenticationFailed(msg)

        return auth[1]

class UnsubscribeTokenAuthentication(BaseAuthentication):
    """
    DRF authentication class for email unsubscribe notifications - token and
    hash should be provided in the POST data.  ONLY use this authentication for
    account notifications.
    """

    def authenticate(self, request):
        try:
            email = UnsubscribeCode.parse(
                request.data.get('token'), request.data.get('hash'))
            user = UserProfile.objects.get(email=email)
        except ValueError:
            raise exceptions.AuthenticationFailed(
                ugettext('Invalid token or hash.'))
        except UserProfile.DoesNotExist:
            raise exceptions.AuthenticationFailed(
                ugettext('Email address not found.'))
        return (user, None)


text:
Settings = {
  indicatorName: 'Average connection speed (kbps)',
  indicatorId: 'speedkbps',
  gaugeWidth: 292,
  defaultData: { name: 'United States', code: 'usa', byYear: false, chosenYear: ''}
};

ConnectionSpeedWidget = function(doc) {
  Widget.call(this, doc);

  _.defaults(this.data, { country: Settings.defaultData });
};

ConnectionSpeedWidget.prototype = Object.create(Widget.prototype);
ConnectionSpeedWidget.prototype.constructor = ConnectionSpeedWidget;

_.extend(ConnectionSpeedWidget.prototype, {
  setCountry: function(countryCode) {
    var widget = this;
    CountryInfo.byCode(countryCode, function(country) {
      var code = country.alpha3.toLowerCase();
      country = IMonCountries.findOne({ code: code });
      if (country) {
        widget.data.set({ country: country });
      }
    });
  },
  getIndicator: function() {
    var countryData = IMonCountryData.findOne({ code: this.data.country.code });
    return _.findWhere(countryData.indicators, { name: Settings.indicatorName });
  }
});

ConnectionSpeed = {
  widget: {
    name: 'Connection Speed',
    description: "Shows how quickly (in kilobits per second) data can be transferred from the Internet to a local computer",
    url: 'https://thenetmonitor.org/sources#akamai',
    dimensions: { width: 2, height: 2 },
    category: 'access',
    typeIcon: 'tachometer',
    constructor: ConnectionSpeedWidget,
    indicators: [ Settings.indicatorId ],
    country: 'single',
    countries: 'all'
  },
  org: {
    name: 'Akamai Technologies, Inc.',
    shortName: 'Akamai',
    url: 'http://www.akamai.com/'
  }
};


text:
package com.zavtech.morpheus.reference;

import java.io.IOException;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Arrays;
import java.util.Optional;
import java.util.stream.Stream;

import com.zavtech.morpheus.frame.DataFrame;
import com.zavtech.morpheus.frame.DataFrameColumn;
import com.zavtech.morpheus.frame.DataFrameRow;
import com.zavtech.morpheus.index.Index;
import com.zavtech.morpheus.index.IndexException;
import com.zavtech.morpheus.range.Range;
import org.testng.Assert;
import org.testng.annotations.Test;

/**
 * A test of the various DataFrameAccess methods
 *
 * @author  Xavier Witdouck
 *
 *
This is open source software released under the Apache 2.0 License

 */
public class DimensionTests {

    private final LocalDate start = LocalDate.of(2007, 1, 3);
    private final LocalDate end = start.plusDays(20);
    private final Index<LocalDate> rowKeys = Range.of(start, end).toIndex(LocalDate.class);
    private final Index<String> colKeys = Index.of("C1", "C2", "C3", "C4", "C5");
    private final DataFrame<LocalDate,String> frame = DataFrame.ofDoubles(rowKeys, colKeys);

    @Test()
    public void testIndexOf() {
        Assert.assertEquals(frame.rows().ordinalOf(rowKeys.getKey(2)), 2);
        Assert.assertEquals(frame.cols().ordinalOf(colKeys.getKey(4)), 4);
    }

    @Test(expectedExceptions = { IndexException.class })
    public void testIndexOfFailsForRow() {
        Assert.assertEquals(frame.rows().ordinalOf(LocalDate.now(), true), -1);
    }

    @Test(expectedExceptions = { IndexException.class })
    public void testIndexOfFailsForColumn() {
        Assert.assertEquals(frame.cols().ordinalOf("C88", true), -1);
    }

    @Test()
    public void testRowKeyMapping() {
        final DataFrame<String,String> result = frame.rows().mapKeys(row -> row.key().toString());
        rowKeys.forEach(date -> colKeys.forEach(column -> {
            final double value1 = frame.data().getDouble(date, column);
            final double value2 = result.data().getDouble(date.toString(), column);
            Assert.assertEquals(value1, value2, "Values match for " + date + " and " + column);
        }));
    }

    @Test()
    public void testColKeyMapping() {
        final DataFrame<LocalDate,String> result = frame.cols().mapKeys(column -> "Column:" + column.key());
        rowKeys.forEach(date -> colKeys.forEach(column -> {
            final double value1 = frame.data().getDouble(date, column);
            final double value2 = result.data().getDouble(date, "Column:" + column);
            Assert.assertEquals(value1, value2, "Values match for " + date + " and " + column);
        }));
    }

    @Test()
    public void testFirstKey() {
        final DataFrame<LocalDate,String> frame1 = DataFrame.of(rowKeys, colKeys, Double.class);
        final DataFrame<LocalDate,String> frame2 = frame1.copy().select(r -> true, c -> true);
        final DataFrame<LocalDate,String> frame3 = frame1.copy().rows().select(k -> true);
        final DataFrame<LocalDate,String> frame4 = frame1.copy().cols().select(k -> true);
        Stream.of(frame1, frame2, frame3, frame4).forEach(frame -> {
            Assert.assertTrue(frame.rows().firstKey().isPresent());
            Assert.assertTrue(frame.cols().firstKey().isPresent());
            Assert.assertEquals(frame.rows().firstKey().get(), rowKeys.getKey(0));
            Assert.assertEquals(frame.cols().firstKey().get(), colKeys.getKey(0));
        });
        final DataFrame<LocalDate,String> emptyFrame = DataFrame.of(LocalDate.class, String.class);
        Assert.assertTrue(!emptyFrame.rows().firstKey().isPresent());
        Assert.assertTrue(!emptyFrame.cols().firstKey().isPresent());
    }

    @Test()
    public void testLastKey() {
        final DataFrame<LocalDate,String> frame1 = DataFrame.of(rowKeys, colKeys, Double.class);
        final DataFrame<LocalDate,String> frame2 = frame1.copy().select(r -> true, c -> true);
        final DataFrame<LocalDate,String> frame3 = frame1.copy().rows().select(k -> true);
        final DataFrame<LocalDate,String> frame4 = frame1.copy().cols().select(k -> true);
        Stream.of(frame1, frame2, frame3, frame4).forEach(frame -> {
            Assert.assertTrue(frame.rows().lastKey().isPresent());
            Assert.assertTrue(frame.cols().lastKey().isPresent());
            Assert.assertEquals(frame.rows().lastKey().get(), rowKeys.getKey(rowKeys.size() - 1));
            Assert.assertEquals(frame.cols().lastKey().get(), colKeys.getKey(colKeys.size() - 1));
        });
        final DataFrame<LocalDate,String> emptyFrame = DataFrame.of(LocalDate.class, String.class);
        Assert.assertTrue(!emptyFrame.rows().lastKey().isPresent());
        Assert.assertTrue(!emptyFrame.cols().lastKey().isPresent());
    }

    @Test()
    public void testFirstRecordAccess() {
        final DataFrame<String,String> frame1 = TestDataFrames.random(double.class, 20, 30);
        final DataFrame<String,String> frame2 = frame1.copy().select(r -> true, c -> true);
        final DataFrame<String,String> frame3 = frame1.copy().rows().select(k -> true);
        final DataFrame<String,String> frame4 = frame1.copy().cols().select(k -> true);
        Stream.of(frame1, frame2, frame3, frame4).forEach(frame -> {
            Assert.assertTrue(frame.rows().first().isPresent());
            Assert.assertTrue(frame.cols().first().isPresent());
            frame.rows().first().get().forEachValue(v -> Assert.assertEquals(v.getDouble(), frame.data().getDouble(v.rowOrdinal(), v.colOrdinal())));
            frame.cols().first().get().forEachValue(v -> Assert.assertEquals(v.getDouble(), frame.data().getDouble(v.rowOrdinal(), v.colOrdinal())));
        });
    }

    @Test()
    public void testLastRecordAccess() {
        final DataFrame<String,String> frame1 = TestDataFrames.random(double.class, 20, 30);
        final DataFrame<String,String> frame2 = frame1.copy().select(r -> true, c -> true);
        final DataFrame<String,String> frame3 = frame1.copy().rows().select(k -> true);
        final DataFrame<String,String> frame4 = frame1.copy().cols().select(k -> true);
        Stream.of(frame1, frame2, frame3, frame4).forEach(frame -> {
            Assert.assertTrue(frame.rows().last().isPresent());
            Assert.assertTrue(frame.cols().last().isPresent());
            frame.rows().last().get().forEachValue(v -> Assert.assertEquals(v.getDouble(), frame.data().getDouble(v.rowOrdinal(), v.colOrdinal())));
            frame.cols().last().get().forEachValue(v -> Assert.assertEquals(v.getDouble(), frame.data().getDouble(v.rowOrdinal(), v.colOrdinal())));
        });
    }

    @Test()
    public void testFindFirstRow() {
        final DataFrame<String,String> frame1 = TestDataFrames.random(double.class, 10, 30);
        final DataFrame<String,String> frame2 = frame1.copy().select(r -> true, c -> true);
        final DataFrame<String,String> frame3 = frame1.copy().rows().select(k -> true);
        final DataFrame<String,String> frame4 = frame1.copy().cols().select(k -> true);
        Stream.of(frame1, frame2, frame3, frame4).forEach(frame -> {
            frame.applyDoubles(v -> Math.random() * 100d);
            frame.row("R7").applyDoubles(v -> 1000d * v.colOrdinal());
            frame.row("R9").applyDoubles(v -> 1000d * v.colOrdinal());
            final Optional<DataFrameRow<String, String>> rowOption = frame.rows().first(row -> row.getDouble(3) == 1000d * 3);
            Assert.assertTrue(rowOption.isPresent(), "A row was found");
            Assert.assertEquals(rowOption.get().key(), "R7", "The row key matches");
        });
    }

    @Test()
    public void testFindFirstColumn() throws IOException {
        final DataFrame<String,String> frame1 = TestDataFrames.random(double.class, 10, 30);
        final DataFrame<String,String> frame2 = frame1.copy().select(r -> true, c -> true);
        final DataFrame<String,String> frame3 = frame1.copy().rows().select(k -> true);
        final DataFrame<String,String> frame4 = frame1.copy().cols().select(k -> true);
        Stream.of(frame1, frame2, frame3, frame4).forEach(frame -> {
            frame.applyDoubles(v -> Math.random() * 100d);
            frame.col("C15").applyDoubles(v -> 1000d * v.rowOrdinal());
            frame.col("C22").applyDoubles(v -> 1000d * v.rowOrdinal());
            final Optional<DataFrameColumn<String, String>> colOption = frame.cols().first(column -> column.getDouble(3) == 1000d * 3);
            Assert.assertTrue(colOption.isPresent(), "A column was found");
            Assert.assertEquals(colOption.get().key(), "C15", "The column key matches");
        });
    }

    @Test()
    public void testFindLastRow() {
        final DataFrame<String,String> frame1 = TestDataFrames.random(double.class, 10, 30);
        final DataFrame<String,String> frame2 = frame1.select(r -> true, c -> true);
        Stream.of(frame1, frame2).forEach(frame -> {
            frame.applyDoubles(v -> Math.random() * 100d);
            frame.row("R7").applyDoubles(v -> 1000d * v.colOrdinal());
            frame.row("R9").applyDoubles(v -> 1000d * v.colOrdinal());
            final Optional<DataFrameRow<String, String>> rowOption = frame.rows().last(row -> row.getDouble(3) == 1000d * 3);
            Assert.assertTrue(rowOption.isPresent(), "A row was found");
            Assert.assertEquals(rowOption.get().key(), "R9", "The row key matches");
        });
    }

    @Test()
    public void testFindLastColumn() throws IOException {
        final DataFrame<String,String> frame1 = TestDataFrames.random(double.class, 10, 30);
        final DataFrame<String,String> frame2 = frame1.select(r -> true, c -> true);
        Stream.of(frame1, frame2).forEach(frame -> {
            frame.applyDoubles(v -> Math.random() * 100d);
            frame.col("C15").applyDoubles(v -> 1000d * v.rowOrdinal());
            frame.col("C22").applyDoubles(v -> 1000d * v.rowOrdinal());
            final Optional<DataFrameColumn<String, String>> colOption = frame.cols().last(column -> column.getDouble(3) == 1000d * 3);
            Assert.assertTrue(colOption.isPresent(), "A column was found");
            Assert.assertEquals(colOption.get().key(), "C22", "The column key matches");
        });
    }

    @Test()
    public void testLowerKeyAccess() {
        final Index<Integer> rowKeys = Range.of(0, 50).map(i -> i * 2).toIndex(Integer.class);
        final Index<Integer> colKeys = Range.of(0, 50).map(i -> i * 2).toIndex(Integer.class);
        final DataFrame<Integer,Integer> frame1 = DataFrame.ofDoubles(rowKeys, colKeys);
        final DataFrame<Integer,Integer> frame2 = frame1.select(r -> true, c -> true);
        Stream.of(frame1, frame2).forEach(frame -> {
            frame.applyDoubles(value -> Math.random());
            Assert.assertTrue(frame.rows().lowerKey(25).isPresent());
            Assert.assertTrue(frame.cols().lowerKey(12).isPresent());
            Assert.assertEquals(frame.rows().lowerKey(25).get().intValue(), 24);
            Assert.assertEquals(frame.cols().lowerKey(12).get().intValue(), 10);
            Assert.assertTrue(!frame.rows().lowerKey(-1).isPresent());
            Assert.assertTrue(!frame.cols().lowerKey(0).isPresent());
        });
    }

    @Test()
    public void testHigherKeyAccess() {
        final Range<Integer> rowKeys = Range.of(0, 50).map(i -> i * 2);
        final Range<Integer> colKeys = Range.of(0, 50).map(i -> i * 2);
        final DataFrame<Integer,Integer> frame1 = DataFrame.ofDoubles(rowKeys, colKeys);
        final DataFrame<Integer,Integer> frame2 = frame1.select(r -> true, c -> true);
        Stream.of(frame1, frame2).forEach(frame -> {
            frame.applyDoubles(value -> Math.random());
            Assert.assertTrue(frame.rows().higherKey(72).isPresent());
            Assert.assertTrue(frame.cols().higherKey(8).isPresent());
            Assert.assertEquals(frame.rows().higherKey(72).get().intValue(), 74);
            Assert.assertEquals(frame.cols().higherKey(8).get().intValue(), 10);
            Assert.assertTrue(!frame.rows().higherKey(102).isPresent());
            Assert.assertTrue(!frame.cols().higherKey(49 * 2).isPresent());
        });
    }

    @Test()
    public void testLowerDateAccess() {
        final ZoneId gmt = ZoneId.of("GMT");
        final Index<ZonedDateTime> dates = Index.of(Arrays.asList(
                ZonedDateTime.of(2014, 5, 2, 9, 30, 0, 0, gmt),
                ZonedDateTime.of(2014, 5, 2, 10, 30, 0, 0, gmt),
                ZonedDateTime.of(2014, 5, 2, 11, 30, 0, 0, gmt),
                ZonedDateTime.of(2014, 5, 2, 12, 30, 0, 0, gmt),
                ZonedDateTime.of(2014, 5, 2, 13, 30, 0, 0, gmt),
                ZonedDateTime.of(2014, 5, 2, 14, 30, 0, 0, gmt),
                ZonedDateTime.of(2014, 5, 2, 15, 30, 0, 0, gmt),
                ZonedDateTime.of(2014, 5, 2, 16, 30, 0, 0, gmt)
        ));
        final DataFrame<ZonedDateTime,ZonedDateTime> frame1 = DataFrame.ofDoubles(dates, dates);
        final DataFrame<ZonedDateTime,ZonedDateTime> frame2 = frame1.select(r -> true, c -> true);
        Stream.of(frame1, frame2).forEach(frame -> {
            frame1.applyDoubles(value -> Math.random());
            Assert.assertTrue(frame.rows().lowerKey(dates.getKey(3)).isPresent());
            Assert.assertTrue(frame.cols().lowerKey(dates.getKey(3)).isPresent());
            Assert.assertEquals(frame.rows().lowerKey(dates.getKey(3)).get(), dates.getKey(2));
            Assert.assertEquals(frame.cols().lowerKey(dates.getKey(6)).get(), dates.getKey(5));
            Assert.assertTrue(!frame.rows().lowerKey(dates.getKey(0).minusDays(1)).isPresent());
            Assert.assertTrue(!frame.cols().lowerKey(dates.getKey(0).minusDays(1)).isPresent());
        });
    }

    @Test()
    public void testHigherDateAccess() {
        final ZoneId gmt = ZoneId.of("GMT");
        final Index<ZonedDateTime> dates = Index.of(Arrays.asList(
                ZonedDateTime.of(2014, 5, 2, 9, 30, 0, 0, gmt),
                ZonedDateTime.of(2014, 5, 2, 10, 30, 0, 0, gmt),
                ZonedDateTime.of(2014, 5, 2, 11, 30, 0, 0, gmt),
                ZonedDateTime.of(2014, 5, 2, 12, 30, 0, 0, gmt),
                ZonedDateTime.of(2014, 5, 2, 13, 30, 0, 0, gmt),
                ZonedDateTime.of(2014, 5, 2, 14, 30, 0, 0, gmt),
                ZonedDateTime.of(2014, 5, 2, 15, 30, 0, 0, gmt),
                ZonedDateTime.of(2014, 5, 2, 16, 30, 0, 0, gmt)
        ));
        final DataFrame<ZonedDateTime,ZonedDateTime> frame1 = DataFrame.ofDoubles(dates, dates);
        final DataFrame<ZonedDateTime,ZonedDateTime> frame2 = frame1.select(r -> true, c -> true);
        Stream.of(frame1, frame2).forEach(frame -> {
            frame.applyDoubles(value -> Math.random());
            Assert.assertTrue(frame.rows().higherKey(dates.getKey(3)).isPresent());
            Assert.assertTrue(frame.cols().higherKey(dates.getKey(3)).isPresent());
            Assert.assertEquals(frame.rows().higherKey(dates.getKey(3)).get(), dates.getKey(4));
            Assert.assertEquals(frame.cols().higherKey(dates.getKey(6)).get(), dates.getKey(7));
            Assert.assertTrue(!frame.rows().higherKey(dates.getKey(7).plusDays(1)).isPresent());
            Assert.assertTrue(!frame.cols().higherKey(dates.getKey(7).plusDays(1)).isPresent());
        });
    }
}


text:
package slackbot

// SlackCommand is a command sent to slack
type SlackCommand struct {
	Token       string `param:"token"`
	TeamID      string `param:"team_id"`
	TeamDomain  string `param:"team_domain"`
	ChannelID   string `param:"channel_id"`
	ChannelName string `param:"channel_name"`
	UserID      string `param:"user_id"`
	UserName    string `param:"user_name"`
	Command     string `param:"command"`
	Text        string `param:"text"`
	ResponseURL string `param:"response_url"`
	TriggerID   string `param:"trigger_id"`
}

// SlackResponse is a response to a slack command
type SlackResponse struct {
	ResponseType string            `json:"response_type"`
	Text         string            `json:"text"`
	Attachments  []SlackAttachment `json:"attachments"`
}

// SlackAttachment is an attachment in a response to a slack command
type SlackAttachment struct {
	Title          string                  `json:"title"`
	Text           string                  `json:"text"`
	MarkdownIn     []string                `json:"mrkdwn_in"`
	Fallback       string                  `json:"fallback"`
	Color          string                  `json:"color"`
	AttachmentType string                  `json:"attachment_type"`
	Actions        []SlackAttachmentAction `json:"actions"`
	CallbackID     string                  `json:"callback_id"`
}

// SlackAttachmentAction is an action button on a slack message
type SlackAttachmentAction struct {
	Name  string `json:"name"`
	Text  string `json:"text"`
	Style string `json:"style"`
	Type  string `json:"type"`
	Value string `json:"value"`
	// Confirm SlackAttachmentConfirm `json:"confirm"`
}

// SlackAttachmentConfirm is a confirmation prompt on a SlackAttachmentAction
type SlackAttachmentConfirm struct {
	Title       string `json:"title"`
	Text        string `json:"text"`
	OkText      string `json:"ok_text"`
	DismissText string `json:"dismiss_text"`
}

type slackActionPayload struct {
	Actions    []SlackAttachmentAction `json:"actions"`
	CallbackID string                  `json:"callback_id"`
	Team       slackTeam               `json:"team"`
	User       slackUser               `json:"user"`
	Channel    slackChannel            `json:"channel"`
	// ActionTs string `json:"action_ts"`
	// MessageTs string `json:"message_ts"`
	// AttachmentID string `json:"attachment_id"`
	// Token string `json:"token"`
	// OriginalMessage slackMessage `json:"original_message"`
	// .. "text":"How about Somewhere",
	// .. "bot_id":"B3M7BQ0A0",
	// ... the message we sent
	//..  "ts":"1483532908.000012"
	// ResponseURL string `json:"response_url"`
}

type slackTeam struct {
	ID     string `json:"id"`
	Domain string `json:"domain"`
}

type slackUser struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type slackChannel {
	ID string `json:"id"`
	Name string `json:"name"`
}


text:
Cypress.Commands.add('navigate', (url, options = {}) => {
  return cy.window().then($win => {
    // No page loaded, visit
    if (options.forceReload || !$win.location.href.startsWith(Cypress.config('baseUrl'))) {
      cy.log('Visit');
      cy.visit(url, options);
      return cy.get('.page-loader').should('not.exist', { timeout: 20000 });
    }

    if (!url || url === '') {
      cy.log('Reload');
      cy.reload();
      return cy.get('.page-loader').should('not.exist', { timeout: 20000 });
    }

    // Already on this page, navigate away then back, fater than visit or reload
    if ($win.location.href === Cypress.config('baseUrl') + url) {
      cy.log('Refresh');
      return navByLink('/').then(() => {
        return navByLink(url);
      });
    }

    return navByLink(url);

    // Equivalent to navigating by link
    function navByLink(href: string) {
      cy.log('navByLink');
      return cy.document().then($doc => {
        const a = $doc.createElement('a');
        a.href = href;
        $doc.body.appendChild(a);
        a.click();
        $doc.body.removeChild(a);
      });
    }
  });
});

Cypress.Commands.add('dataCy', value => {
  return cy.get(`[data-cy=${value}]`);
});

Cypress.Commands.add('asAllDataCy', () =>
  cy.get('[data-cy]').then(list => {
    list.each((i, { dataset: { cy: name } }) => {
      cy.dataCy(name).as(name);
    });
  })
);

Cypress.Commands.add('findPseudoBefore', { prevSubject: 'element' }, el => {
  const win = el[0].ownerDocument.defaultView;
  return win.getComputedStyle(el[0], 'before');
});

Cypress.Commands.add('findPseudoAfter', { prevSubject: 'element' }, el => {
  const win = el[0].ownerDocument.defaultView;
  return win.getComputedStyle(el[0], 'after');
});


text:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
<div style="width:1em; -moz-hyphens:auto;" lang="hu">
Minden emberi lény szabadon születik és egyenlő méltósága és joga van.
</div>
</body>
</html>


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="
			http://www.springframework.org/schema/beans
				http://www.springframework.org/schema/beans/spring-beans.xsd
			http://www.springframework.org/schema/context
				http://www.springframework.org/schema/context/spring-context.xsd">

	<bean id="TempAsgnService" scope="singleton" lazy-init="true"
		class="seava.j4e.business.impl.service.TempAsgnService"/>

	<bean id="TempAsgnLineService" scope="singleton" lazy-init="true"
		class="seava.j4e.business.impl.service.TempAsgnLineService"/>

	<bean id="AbstractEntityService" scope="singleton" lazy-init="true"
		class="seava.j4e.business.impl.service.AbstractEntityService"/>

	<bean id="AbstractBaseNTService" scope="singleton" lazy-init="true"
		class="seava.j4e.business.impl.service.AbstractBaseNTService"/>

	<bean id="AbstractAuditableNTService" scope="singleton" lazy-init="true"
		class="seava.j4e.business.impl.service.AbstractAuditableNTService"/>

	<bean id="AbstractTypeNTService" scope="singleton" lazy-init="true"
		class="seava.j4e.business.impl.service.AbstractTypeNTService"/>

	<bean id="AbstractTypeWithCodeNTService" scope="singleton" lazy-init="true"
		class="seava.j4e.business.impl.service.AbstractTypeWithCodeNTService"/>

	<bean id="AbstractBaseService" scope="singleton" lazy-init="true"
		class="seava.j4e.business.impl.service.AbstractBaseService"/>

	<bean id="AbstractAuditableService" scope="singleton" lazy-init="true"
		class="seava.j4e.business.impl.service.AbstractAuditableService"/>

	<bean id="AbstractTypeService" scope="singleton" lazy-init="true"
		class="seava.j4e.business.impl.service.AbstractTypeService"/>

	<bean id="AbstractTypeWithCodeService" scope="singleton" lazy-init="true"
		class="seava.j4e.business.impl.service.AbstractTypeWithCodeService"/>
</beans>