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

<TITLE>
atg.search.routing.command.search (ATG Java API)
</TITLE>

<META NAME="date" CONTENT="2013-04-01">

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

      Overview
    Package
      Class
      Tree
      Deprecated
      Index
      Help

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Package atg.search.routing.command.search

Interface Summary

Groupable
Groupable results can be grouped by property or by document.

PagedRequest
Implemented by pageable request types.

PagedResponse
Interface for responses from PagedRequests.

RankingExpressionGroup
Interface for ranking expression groups, used by the Ranking, the custom
 ranking algorithm.

RankingGroup
Ranking group interface

Class Summary

ActiveSentenceZoneValidation
Validation type for active sentence zones

ActiveSolutionZoneValidation
Validation type for active solution zones

AnswerGroup
The engine returns a list of answer groups.

AppendixRule
A referenced rule and its source format (syntax)

BaseConstraint
Base class for creating different type of constraint implementations.

BaseValidation
validation type

BooleanExpressionType
Types of boolean expressions

BooleanExpressionType.BooleanExpressionTypeEditor

BooleanLogic
Application of boolean logic at the item level

BooleanMode
Boolean mode enum

BooleanMode.BooleanModeEditor

BooleanQuoteStatus
Boolean quote status indicator for boolean logic

BooleanQuoteStatus.BooleanQuoteStatusEditor

Bottom
A move to the bottom rule

BrowseRequest
The Browse request is returns the elements of a browsed document set or topic.

BrowseRequest.AncestryType
A value of direct means that the parent and
 direct ancestors of the starting item set will be returned.

BrowseRequest.AncestryType.AncestryTypeEditor

BrowseRequest.RecurseDocumentsType
A mode value of on means that index items may be collected from child item sets.

BrowseRequest.RecurseDocumentsType.RecurseDocumentsTypeEditor

BrowseRequest.Response
Response type for BrowseRequest

BrowseRequest.SetSort
The sort value deterimes the sort order of the descendent sets.

BrowseRequest.SetSort.SetSortEditor

BrowseRequest.Sorting
Sorting (grouping) for results.

BrowseRequest.Sorting.SortingEditor

Calculation
Raw relevancy calculation details

Candidates
List of retrieved statements from this item

Case
An enum that indicates how case was constrained for the QueryTerm.

Case.CaseEditor

Categorization
Categorization result for a CategorizeRequest.

CategorizeRequest
The Categorize request contains text content to categorize using the same categorization
 algorithm as indexed content and queries.

CategorizeRequest.CategorizeInputMode
The mode value can be one of four values.

CategorizeRequest.CategorizeInputMode.CategorizeInputModeEditor

CategorizeRequest.Response
Response type for CategorizeRequest

Category
A Category is part of the browse response BrowseRequest.Response.

CategoryDocument
A category document is a Document with a few extra properties unique
 to the browse response.

CategoryRuleMatch
A category rule match result

CollectionConstraint
Collection constraint is used to constraint the result on a directory path of the indexed documents.

ConstraintDiagnostic
Diagnostic for a single constraint (which might be an expression composed of multiple constraints)

ConstraintDiagnostics
Represents a list of ConstraintDiagnostics.

ConstraintsGroup
Represents multiple DocumentSetConstraint or ConstraintGroup instances
 with an operation definition.

ContextValidation
A validation type for context.

Control
A result list control and its result

CustomReportData
Report data results showing terms in query that are in adaptors (including termtool)

DateConstraint
Allows a constraint to a specific date or a date range.

Diagnostics
Search diagnostic tracing and inspection output

DiagnosticStatus
Diagnostic status enumeration

DiagnosticStatus.DiagnosticStatusEditor

DocSortPropVal
When sorting by property value, this parameter determines how the value of the
 property is selected when the property has multiple values.

DocSortPropVal.DocSortPropValEditor

DocSortPropValidation
Validation type for doc sort property

Document
The result document.

DocumentSetConstraint
A generic constraint that either holds raw XML, or else constructs a specific constraint via valueOf(String).

ExcludedDocument
A document listed in the rule exclusions

ExpansionEntry
A term expansion entry.

Expansions
Represents a loist of expansion entries.

ExpansionType
Enumeration for types of query term expansions

ExpansionType.ExpansionTypeEditor

FeedbackReport
Feedback report for QueryRequests and
 StructuredQueryRequests.

Field
Field input for TreeQueryRequest.

Field.Op
Field operations.

Field.Op.OpEditor

FieldResponse
Echoed field input for a TreeQueryRequest, with additional information
 about the associated results.

FileExtensionConstraint
Constraints the results based on the file extension of the indexed file.

fNValidation
fN validation type

Group
A result group containing the item (may be more than one group) for diagnostic trace grouping

Grouping
Result grouping activity

GroupingMode
grouping mode for diagnostic trace's result collection.

GroupingMode.GroupingModeEditor

HDoc
Agiven document only appears in a single partition, and within that partition
 it has a handle, or id.

IndexedItemProperty
Indexed property value, in the form name==value

InputPositionType
Input position enumeration

InputPositionType.InputPositionTypeEditor

InputType
Input type enumeration

InputType.InputTypeEditor

Inspect
Traced item inspection details

Item
Search trace for an item

ItemFormatConstraint
Used to constraint the result based on the indexed item type.

ItemInspect
An item's details in an inspection

ItemProperty
Metadata for an inspected item

ItemRetrieval
Step 1: Term look up of items, plus application of boolean logic and other limits

ItemSet
Category Browse item set result

ItemSummary
Summary status of search phases

ItemTrace
Search trace for an item

ItemType
Enumeration of item types

ItemType.ItemTypeEditor

KeywordConstraint
This constraint is used for keyword constraints on the query.

KeywordType
Enumeration for keyword constraint types

KeywordType.KeywordTypeEditor

LanguageConstraint
Document language constraint.

Limit
item retrieval limit

Limits
List of item retrieval limits.

LogicNode
Custom logic node

LogicTree
custom query logic tree

Movement
An application of a movement (positional) rule on a statement, with resulting value

Movements
List of result movements, or positional rules, applied to statements, if any

Multiplier
An application of a result multipler on a statement, with resulting value

Multipliers
List of result multipliers, applied to statements, if any

NumericConstraint
Numeric value constraint on the query.

NumOp
Enumeration for numeric operators.

NumOp.NumOpEditor

oNsNfNValidation
oNsNfN validation type

oNValidation
oN validation type.

OpType
Operaption type enum for RankingGroupOp.

OpType.OpTypeEditor

ParserOptions
Text processing options for requests.

Pool
The appplication of the minimum relevancy threshold

PoolNValidation
PoolN validation type

ProcessedResponse
A processed response from a single partition.

ProcessedSearchResult
A single processed result from a single partition, part of a processed response.

PropConstraint
A property constraint.

PropType
Enumeration of property types for constraints

PropType.PropTypeEditor

PropValidation
Property validation type

QueryAction
list of query action items

QueryActionItem
Represents a query rule action item.

QueryRequest
The query request is the most widely used search request type.

QueryRequest.DocSetSort
Enumeration for docset sorting.

QueryRequest.DocSetSort.DocSetSortEditor

QueryRequest.Mode
Query mode enumeration.

QueryRequest.Mode.ModeEditor

QueryRequest.RequestMode
Reuqest mode enumeration type.

QueryRequest.RequestMode.RequestModeEditor

QueryRequest.Response
Query Response type

QueryRequest.RuleMode
Rule mode enumeration type.

QueryRequest.RuleMode.RuleModeEditor

QueryRequest.Sorting
Enumeration type for answer sorting or grouping.

QueryRequest.Sorting.SortingEditor

QueryRequest.Strategy
Search strategy type.

QueryRequest.Strategy.StrategyEditor

QueryRule
A query rule is a list of query rule operations.

QueryRuleOperation
This is a query rule operation, part of a QueryRule.

QueryTerm
Represents a query term.

QueryTerms
A collection of QueryTerms and various stats.

QueryTermsMode
Query term mode enumeration.

QueryTermsMode.QueryTermsModeEditor

RankConfigCalculation
Ranking (search) config calculation details.

RankConfigValidation
Rank config validation type.

RankFormulaValidation
Ranking formula validation type.

Ranking
Custom ranking algorithm.

RankingExpressionGroupBoolean
Boolean ranking expression group

RankingExpressionGroupContains
A "contains" group for a group.

RankingExpressionGroupDate
Ranking expression group for dates.

RankingExpressionGroupDocUrl
Ranking expression group for document URLs.

RankingExpressionGroupField
Ranking expression group for fields

RankingExpressionGroupFileType
Ranking expression for file types, using the extension.

RankingExpressionGroupFormat
Ranking expression group for file formats.

RankingExpressionGroupLanguage
Ranking expression group for a language (as defined by Language).

RankingExpressionGroupNumProp
Ranking expression group for a number property.

RankingExpressionGroupProp
Ranking expression group for properties, where the type is a string value from PropType.

RankingExpressionGroupRelevance
Ranking expression group for relevance.

RankingExpressionGroupSet
Ranking expression group for a document set.

RankingExpressionGroupStrProp
Ranking expression group for string properties.

RankingExpressionGroupText
Ranking expression group for text

RankingExpressionGroupTitle
Ranking expression group for titles.

RankingGroupBlock
Ranking group block containing arbitrary expressions.

RankingGroupIfElse
Ranking group if-else control structure

RankingGroupLoop
Ranking expression group for a loop structure

RankingGroupOp
Ranking group operation.

RankProperty
One ranking property score and associated details

RefineConfigValidation
Refinement configuration validation type.

RefineCountType
Modes for counting refinement values

RefineCountType.RefineCountTypeEditor

RefineElementValidation
Refinement element validation type

Refinement
Refinement result value object.

Refinements
Search Refinements value object, a list of Refinements and some
 other info.

RefinementSortOrder
Refinement sort order enumeration

RefinementSortOrder.RefinementSortOrderEditor

RefinementValue
An individual refinement value

RelatedDocset
A related document set, sometimes included in a Document.

RelatedDocumentSet
Related document set, used by FeedbackReport.

RelatedDocumentSets
A list of RelatedDocumentSets.

RelatedPhraseTerm
A related phrase term

RelatedPhraseTerms
A list of RelatedPhraseTerms.

RelatedResponseObjects
Related response object.

RelatedSentenceTerm
Related sentence term

RelatedSentenceTerms
A list of RelatedSentenceTerms

RelatedStatement
related statement result.

RelevanceType
Relevance type enumeration.

RelevanceType.RelevanceTypeEditor

Relevancy
Relevancy portion of an ItemTrace.

ReportDataControl
Controls the generation of NLP reportings data that's passed into the search reporting events to generate NLP-related search reports.

 Controls the following reports:
 Length Report,
 Number Report,
 Unknown Report,
 Null Term Report,
 Nulx Term Report,
 Finder Term Report,
 Custom Term Report,
 Type Report,
 Topic Report,
 Top N Report.

ReportDataResults
Report data results, from ReportDataControl.

RequestVariable
Represents a request variable used by a rank config.

RequestVariables
Represents a list of RequestVariables used in rank configs.

ResponseFormat
Controls the response format.

ResponseFormat.DocSortPropValEditor

ResponseGroup
A Response group is part of the ResponseTree.

ResponseTree
The response tree appears in QueryRequest.Response,
 SimilarDocsRequest.Response,
 and StructuredQueryRequest.Response.

Result
A single result (answer) in QueryRequest.Response,
 SimilarDocsRequest.Response,
 or StructuredQueryRequest.Response.

ResultCollection
The result collection step of the ItemTrace.

ResultCountType
Result count type enum

ResultCountType.ResultCountTypeEditor

ResultListControls
Result list controls component of ResultCollection.

Rule
an exclusion or positioning rule

RuleAppendix
Source format (syntax) of any rules referred to in the response

RuleExclusions
Query rules that would have excluded documents if enabled (debugExclusion="true")

RuleModeValidation
Rule mode validation type

RuleMove
A move rule

RulePositioning
Query rules that re-positioned results

SearchRequest
All search requests extend this.

SearchResponse
A SearchEngineCommandResponse that also provides search-command-specific information.

SearchResultsResponse
A SearchEngineCommandResponse that also provides search result specific information.

SelectConfig
If refineDebug is true, and $map is passed as the refineConfig, this element
 shows what configurations were considered and the one that was selected

SelectConfigMapping
Select config mapping, used by SelectConfig.

SelectedTopic
A topic from the engine comprising a topic ID and path.

Sentence
An inspected sentence.

SetConstraint
Set constraint is used to constraint the result on a directory path of the indexed documents.

SetValidation
Set validation type

SimilarDocsRequest
Similar docs request.

SimilarDocsRequest.DocSetSort
ATG Search can return categorization feedback about the returned results in the form of a tree.

SimilarDocsRequest.DocSetSort.DocSetSortEditor

SimilarDocsRequest.Mode
Mode enumeration type.

SimilarDocsRequest.Mode.InputTypeEditor

SimilarDocsRequest.Response
Response type for SimilarDocsRequest.

sNValidation
Validation type for sN.

SortPropValidation
Sort property validation type

Source
Source information about how the configuration was constructed

SourceTerm
A source term.

SpellingTerm
Spelling term value object.

SpellingType
Enumeration of spell-correction types

SpellingType.SpellingTypeEditor

StatementCandidate
A retrieved statement's text and other information

StatementRetrieval
Second step of ItemTrace.

StemLookup
A stem or synonym of a term for diagnostics

StringConstraint
String value constraint on the query

StringOp

StringOp.StringOpEditor

StructuredQueryRequest
Structured query request, also called 'fielded search.'

StructuredQueryRequest.DocSetSort
Doc set sort enumeration.

StructuredQueryRequest.DocSetSort.DocSetSortEditor

StructuredQueryRequest.Response
Response type for StructuredQueryRequest.

StructuredStatement
Structured statement used in creating structured request

StructuredStatement.Mode
ATG Search handles natural language and Boolean queries.

StructuredStatement.Mode.ModeEditor

StructuredStatement.Operator
The Structured Query request must aggregate the results of the individual queries into a final results list, using
 the retrieved index items.

StructuredStatement.Operator.OperatorEditor

StructuredStatement.Strategy
ATG Search has a large number of search parameters that control the generic search algorithm.

StructuredStatement.Strategy.StrategyEditor

SuggestedCategory
A Suggested category or topic for a document

Suggestion
a spelling suggestion and its frequency in the index.

Summary
Diagnostic search summary

TargetLanguageValidation
Validation type for target language

Term
A term.

TermCountType
Enumeration for term counts.

TermCountType.TermCountTypeEditor

TermLookup
Term lookup of an item

TermLookupOp
Boolean operator of a lookup term

TermLookupOp.TermOpEditor

TermOp
Simple operator of term

TermOp.TermOpEditor

TextMatch
A text match result.

Threshold
The appplication of the minimum relevancy threshold

tNValidation
tN validation type.

Top
A move to the top rule

Topic
A topic from the engine comprising a topic ID and path.

Trace
A list of ItemTraces.

TraceExpression
An expression that determines which items should be traced.

TreeQueryRequest
Tree query request.

TreeQueryRequest.Response
TreeQueryRequest Response type

Type
Type of control

TypeAheadRequest
This class is used to issue Type Ahead requests to the engine.

TypeAheadRequest.Response
Response class for the TypeAheadRequest class

TypeAheadSortType
An Enum class for the sort order types for the TypeAheadRequest class

TypeAheadSortType.TypeAheadSortTypeEditor

URLConstraint
Constraints the results to the given URL string of the indexed document.

Validation
Various checks on the validity of the request given the content

ViewDocumentRequest
The ViewDocument request retrieves a document, document information, or a full item inspection using DocumentContextInfo String,
 the doc's URL, or a property-value pair.

ViewDocumentRequest.Response
Response type for the ViewDocumentRequest

ViewDocumentRequest.Return
The Return type determines what the ViewDocument request returns.

ViewDocumentRequest.Return.ReturnEditor

ViewDocumentRequest.Section
HTML section type enumeration.

ViewDocumentRequest.Section.SectionEditor

ViewedDocument
A viewed document, returned by ViewDocumentRequest.

      Overview
    Package
      Class
      Tree
      Deprecated
      Index
      Help

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes


text:
/*****  The Memory Manager Header File  *****/
#ifndef M_H
#define M_H

/**********************************
 **********************************
 *****  Imported Interfaces  ******
 **********************************
 **********************************/

/************************
 *****  Components  *****
 ************************/

/**************************
 *****  Declarations  *****
 **************************/

#include "M_CPD.h"

/********************************
 ********************************
 *****  Callable Interface  *****
 ********************************
 ********************************/

PublicFnDecl void M_AccumulateAllocationStatistics (
    double *pAllocationTotal, double *pMappingTotal
);

PublicFnDecl bool M_DisposeOfSessionGarbage ();

PublicFnDecl void M_FlushCachedResources ();

PublicFnDecl unsigned int M_ReclaimSegments ();

PublicFnDecl unsigned int M_ReclaimAllSegments ();

PublicFnDecl void M_ProcessGRMRequests ();

PublicFnDecl char const* M_UpdateStatusDescription (
    PS_UpdateStatus updateStatus, char const *alternateSuccessText
);

PublicFnDecl void __cdecl M_LogError (char const* pFormat, ...);

/**********************************************************
 *****  Representation Type Description Declarations  *****
 **********************************************************/

PublicVarDecl M_RTD M_RTDDB [];

/*****  RTD Array Access  *****/
#define M_RTDPtr(rtype) (M_RTDDB + (int)(rtype))

#endif

/************************************************************************
  m.h 2 replace /users/mjc/system
  860321 17:53:34 mjc Release 1 of new memory architecture

 ************************************************************************/
/************************************************************************
  m.h 3 replace /users/mjc/system
  860408 23:09:49 mjc Added standard CPD allocation capability

 ************************************************************************/
/************************************************************************
  m.h 4 replace /users/mjc/system
  860410 19:17:30 mjc Added standard CPDs, POP testing, and default printer

 ************************************************************************/
/************************************************************************
  m.h 5 replace /users/mjc/system
  860414 12:44:08 mjc Release 'M_ShiftContainerTail', delete 'M_Browser' calls

 ************************************************************************/
/************************************************************************
  m.h 6 replace /users/hjb/system
  860423 00:41:13 hjb added 'M_AttacheCPDPointers'

 ************************************************************************/
/************************************************************************
  m.h 7 replace /users/hjb/system
  860517 19:00:21 hjb added User Space Functions

 ************************************************************************/
/************************************************************************
  m.h 8 replace /users/jck/system
  860711 16:55:32 jck Release Object Saver

 ************************************************************************/
/************************************************************************
  m.h 9 replace /users/jad/system
  860731 17:47:13 jad added DBUPDATE utilities

 ************************************************************************/
/************************************************************************
  m.h 10 replace /users/mjc/rsystem
  860813 18:23:08 mjc Implemented statistics query/display, simple optimization of CPD allocator

 ************************************************************************/
/************************************************************************
  m.h 11 replace /users/mjc/system
  860817 20:18:00 mjc New, improved CPD allocators

 ************************************************************************/
/************************************************************************
  m.h 12 replace /users/mjc/system
  860819 12:32:04 mjc Added experimental fast preamble pointer access routine

 ************************************************************************/
/************************************************************************
  m.h 13 replace /users/jad/system
  860914 11:15:18 mjc Release split version of 'M' and 'SAVER'

 ************************************************************************/
/************************************************************************
  m.h 14 replace /users/mjc/system
  861002 18:03:11 mjc Release of modules updated in support of the new list architecture

 ************************************************************************/
/************************************************************************
  m.h 15 replace /users/mjc/system
  870215 23:05:08 lcn Release of new memory manager

 ************************************************************************/
/************************************************************************
  m.h 16 replace /users/mjc/system
  870326 19:27:57 mjc Implemented restricted update capability

 ************************************************************************/
/************************************************************************
  m.h 17 replace /users/jck/system
  870415 09:54:52 jck Release of M_SwapContainers, including changes to
all rtype's 'InitStdCPD' functions. Instead of being void, they now return
a cpd

 ************************************************************************/
/************************************************************************
  m.h 18 replace /users/mjc/translation
  870524 09:39:45 mjc Shortened all identifiers to <= 31 characters

 ************************************************************************/
/************************************************************************
  m.h 19 replace /users/jck/system
  871007 13:39:51 jck Release implementation of Global Persistent Garbage Collector

 ************************************************************************/
/************************************************************************
  m.h 20 replace /users/mjc/Software/system
  871123 20:10:44 mjc Added experimental CPCC allocation routine and '#M displayMappingInfo' debug method

 ************************************************************************/

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Tests\Behat\Mink\Selector;

use Behat\Mink\Selector\SelectorsHandler;

class SelectorsHandlerTest extends \PHPUnit_Framework_TestCase
{
    public function testRegisterSelector()
    {
        $selector   = $this->getMockBuilder('Behat\Mink\Selector\SelectorInterface')->getMock();
        $handler    = new SelectorsHandler();

        $this->assertFalse($handler->isSelectorRegistered('custom'));

        $handler->registerSelector('custom', $selector);

        $this->assertTrue($handler->isSelectorRegistered('custom'));
        $this->assertSame($selector, $handler->getSelector('custom'));
    }

    public function testSelectorToXpath()
    {
        $selector   = $this->getMockBuilder('Behat\Mink\Selector\SelectorInterface')->getMock();
        $handler    = new SelectorsHandler();

        $handler->registerSelector('custom_selector', $selector);

        $selector
            ->expects($this->once())
            ->method('translateToXPath')
            ->with($locator = 'some[locator]')
            ->will($this->returnValue($ret = '[]some[]locator'));

        $this->assertEquals($ret, $handler->selectorToXpath('custom_selector', $locator));

        $this->setExpectedException('InvalidArgumentException');
        $handler->selectorToXpath('undefined', 'asd');
    }

    public function testXpathLiteral()
    {
        $handler = new SelectorsHandler();

        $this->assertEquals("'some simple string'", $handler->xpathLiteral('some simple string'));
        $this->assertEquals(
            "'some \"d-brackets\" string'", $handler->xpathLiteral('some "d-brackets" string')
        );
        $this->assertEquals(
            "\"some 's-brackets' string\"", $handler->xpathLiteral('some \'s-brackets\' string')
        );
        $this->assertEquals(
            'concat(\'some \',"\'",\'s-brackets\',"\'",\' and "d-brackets" string\')',
            $handler->xpathLiteral('some \'s-brackets\' and "d-brackets" string')
        );
    }
}


text:
package com.blazebit.persistence.impl.function.every;

import com.blazebit.persistence.spi.FunctionRenderContext;
import com.blazebit.persistence.spi.JpqlFunction;

/**
 *
 * @author Jan-Willem Gmelig Meyling
 * @author Sayra Ranjha
 * @since 1.4.0
 */
public class EveryFunction implements JpqlFunction {

    public static final String FUNCTION_NAME = "EVERY";
    public static final EveryFunction INSTANCE = new EveryFunction();

    protected EveryFunction() {
    }

    @Override
    public boolean hasArguments() {
        return true;
    }

    @Override
    public boolean hasParenthesesIfNoArguments() {
        return true;
    }

    @Override
    public Class<?> getReturnType(Class<?> firstArgumentType) {
        return Boolean.class;
    }

    @Override
    public void render(FunctionRenderContext context) {
        context.addChunk("EVERY(");
        context.addArgument(0);
        context.addChunk(")");
    }

}


text:
<?php

/**
 * Handles the writing, maintenance and display of log files
 *
 * @package iThemes-Security
 * @since   4.0
 */
final class ITSEC_Logger {

	private
		$log_file,
		$logger_displays,
		$logger_modules,
		$module_path;

	function __construct() {

		global $itsec_globals;

		//make sure the log file info is there or generate it. This should only affect beta users.
		if ( ! isset( $itsec_globals['settings']['log_info'] ) ) {

			$itsec_globals['settings']['log_info'] = substr( sanitize_title( get_bloginfo( 'name' ) ), 0, 20 ) . '-' . ITSEC_Lib::get_random( mt_rand( 0, 10 ) );

			update_site_option( 'itsec_global', $itsec_globals['settings'] );

		}

		//Make sure the logs directory was created
		if ( ! is_dir( $itsec_globals['ithemes_log_dir'] ) ) {
			@mkdir( trailingslashit( $itsec_globals['ithemes_dir'] ) . 'logs' );
		}

		//don't create a log file if we don't need it.
		if ( isset( $itsec_globals['settings']['log_type'] ) && $itsec_globals['settings']['log_type'] !== 0 ) {

			$this->log_file = $itsec_globals['ithemes_log_dir'] . '/event-log-' . $itsec_globals['settings']['log_info'] . '.log';
			$this->start_log(); //create a log file if we don't have one

		}

		$this->logger_modules  = array(); //array to hold information on modules using this feature
		$this->logger_displays = array(); //array to hold metabox information
		$this->module_path     = ITSEC_Lib::get_module_path( __FILE__ );

		add_action( 'plugins_loaded', array( $this, 'register_modules' ) );

		add_action( 'admin_enqueue_scripts', array( $this, 'admin_script' ) ); //enqueue scripts for admin page

		//Run database cleanup daily with cron
		if ( ! wp_next_scheduled( 'itsec_purge_logs' ) ) {
			wp_schedule_event( time(), 'daily', 'itsec_purge_logs' );
		}

		add_action( 'itsec_purge_logs', array( $this, 'purge_logs' ) );

		if ( is_admin() ) {

			require( trailingslashit( $itsec_globals['plugin_dir'] ) . 'core/lib/class-itsec-wp-list-table.php' ); //used for generating log tables

			add_action( 'itsec_add_admin_meta_boxes', array( $this, 'add_admin_meta_boxes' ) ); //add log meta boxes

		}

		if ( isset( $_POST['itsec_clear_logs'] ) && $_POST['itsec_clear_logs'] === 'clear_logs' ) {

			global $itsec_clear_all_logs;

			$itsec_clear_all_logs = true;

			add_action( 'plugins_loaded', array( $this, 'purge_logs' ) );

		}

	}

	/**
	 * Adds a log meta box only if logging is active. Overrides WP Core add_meta_box
	 *
	 * @since 4.0
	 *
	 * @return void
	 */
	public function add_admin_meta_boxes() {

		global $itsec_globals;

		if ( isset( $itsec_globals['settings']['log_type'] ) && ( $itsec_globals['settings']['log_type'] === 0 || $itsec_globals['settings']['log_type'] === 2 ) ) {

			add_meta_box(
				'itsec_log_header',
				__( 'Security Log Information', 'it-l10n-better-wp-security' ),
				array( $this, 'metabox_logs_header' ),
				'security_page_toplevel_page_itsec_logs',
				'top',
				'core'
			);

			add_meta_box(
				'itsec_log_all',
				__( 'Security Log Data', 'it-l10n-better-wp-security' ),
				array( $this, 'metabox_all_logs' ),
				'security_page_toplevel_page_itsec_logs',
				'normal',
				'core'
			);

		} else {

			add_meta_box(
				'itsec_log_header',
				__( 'Security Log Information', 'it-l10n-better-wp-security' ),
				array( $this, 'metabox_logs_header_no_logs' ),
				'security_page_toplevel_page_itsec_logs',
				'top',
				'core'
			);

		}

	}

	/**
	 * Add Logger Admin Javascript
	 *
	 * @since 4.3
	 *
	 * @return void
	 */
	public function admin_script() {

		global $itsec_globals;

		if ( isset( get_current_screen()->id ) && strpos( get_current_screen()->id, 'toplevel_page_itsec_logs' ) !== false ) {

			wp_enqueue_script( 'itsec_logger', $itsec_globals['plugin_url'] . 'core/js/admin-logs.js', array( 'jquery' ), $itsec_globals['plugin_build'], true );
			wp_enqueue_script( 'itsec_url_js', $itsec_globals['plugin_url'] . 'core/js/url.js', array(), $itsec_globals['plugin_build'], true );

		}

	}

	/**
	 * Displays all logs content
	 *
	 * @since 4.3
	 *
	 * @return void
	 */
	public function all_logs_content() {

		global $wpdb;

		require( dirname( __FILE__ ) . '/class-itsec-logger-all-logs.php' );

		$log_display = new ITSEC_Logger_All_Logs();
		$log_display->prepare_items();
		$log_display->display();

		$log_count = $wpdb->get_var( "SELECT COUNT(*) FROM `" . $wpdb->base_prefix . "itsec_log`;" );

		?>
		<form method="post" action="">
			<?php wp_nonce_field( 'itsec_clear_logs', 'wp_nonce' ); ?>
			<input type="hidden" name="itsec_clear_logs" value="clear_logs"/>

						<?php _e( 'Log Summary', 'it-l10n-better-wp-security' ); ?>

<?php _e( 'Your database contains', 'it-l10n-better-wp-security' ); ?>
							<?php echo $log_count; ?> <?php _e( 'log entries.', 'it-l10n-better-wp-security' ); ?>

<?php _e( 'Use the button below to purge the log table in your database. Please note this will purge all log entries in the database including 404s.', 'it-l10n-better-wp-security' ); ?>

<input type="submit" class="button-primary"
						                         value="<?php _e( 'Clear Logs', 'it-l10n-better-wp-security' ); ?>"/>

		</form>
	<?php

	}

	/**
	 * Gets events from the logs for a specified module
	 *
	 * @param string $module    module or type of events to fetch
	 * @param array  $params    array of extra query parameters
	 * @param int    $limit     the maximum number of rows to retrieve
	 * @param int    $offset    the offset of the data
	 * @param string $order     order by column
	 * @param bool   $direction false for descending or true for ascending
	 *
	 * @return bool|mixed false on error, null if no events or array of events
	 */
	public function get_events( $module, $params = array(), $limit = null, $offset = null, $order = null, $direction = false ) {

		global $wpdb;

		if ( isset( $module ) !== true || strlen( $module ) < 1 ) {
			return false;
		}

		if ( sizeof( $params ) > 0 || $module != 'all' ) {
			$where = " WHERE ";
		} else {
			$where = '';
		}

		$param_search = '';

		if ( $module == 'all' ) {

			$module_sql = '';
			$and        = '';

		} else {

			$module_sql = "`log_type` = '" . esc_sql( $module ) . "'";
			$and        = ' AND ';

		}

		if ( $direction === false ) {

			$order_direction = ' DESC';

		} else {

			$order_direction = ' ASC';

		}

		if ( $order !== null ) {

			$order_statement = ' ORDER BY `' . esc_sql( $order ) . '`';

		} else {

			$order_statement = ' ORDER BY `log_id`';

		}

		if ( $limit !== null ) {

			if ( $offset !== null ) {

				$result_limit = ' LIMIT ' . absint( $offset ) . ', ' . absint( $limit );

			} else {

				$result_limit = ' LIMIT ' . absint( $limit );

			}

		} else {

			$result_limit = '';

		}

		if ( sizeof( $params ) > 0 ) {

			foreach ( $params as $field => $value ) {

				if ( gettype( $value ) != 'integer' ) {
					$param_search .= $and . "`" . esc_sql( $field ) . "`='" . esc_sql( $value ) . "'";
				} else {
					$param_search .= $and . "`" . esc_sql( $field ) . "`=" . esc_sql( $value ) . "";
				}

			}

		}

		$items = $wpdb->get_results( "SELECT * FROM `" . $wpdb->base_prefix . "itsec_log`" . $where . $module_sql . $param_search . $order_statement . $order_direction . $result_limit . ";", ARRAY_A );

		return $items;

	}

	/**
	 * Logs events sent by other modules or systems
	 *
	 * @param string $module   the module requesting the log entry
	 * @param int    $priority the priority of the log entry (1-10)
	 * @param array  $data     extra data to log (non-indexed data would be good here)
	 * @param string $host     the remote host triggering the event
	 * @param string $username the username triggering the event
	 * @param string $user     the user id triggering the event
	 * @param string $url      the url triggering the event
	 * @param string $referrer the referrer to the url (if applicable)
	 *
	 * @return void
	 */
	public function log_event( $module, $priority = 5, $data = array(), $host = '', $username = '', $user = '', $url = '', $referrer = '' ) {

		global $wpdb, $itsec_globals;

		if ( isset( $this->logger_modules[ $module ] ) ) {

			$options = $this->logger_modules[ $module ];

			$file_data = $this->sanitize_array( $data, true );

			$sanitized_data = $this->sanitize_array( $data ); //array of sanitized data

			if ( ! isset( $itsec_globals['settings']['log_type'] ) || $itsec_globals['settings']['log_type'] === 0 || $itsec_globals['settings']['log_type'] == 2 ) {

				$wpdb->hide_errors(); //Don't show error if table isn't present. Instead we'll just try to reconstruct the tables.

				$wpdb->insert(
					$wpdb->base_prefix . 'itsec_log',
					array(
						'log_type'     => $options['type'],
						'log_priority' => intval( $priority ),
						'log_function' => $options['function'],
						'log_date'     => date( 'Y-m-d H:i:s', $itsec_globals['current_time'] ),
						'log_date_gmt' => date( 'Y-m-d H:i:s', $itsec_globals['current_time_gmt'] ),
						'log_host'     => sanitize_text_field( $host ),
						'log_username' => sanitize_text_field( $username ),
						'log_user'     => intval( $user ),
						'log_url'      => esc_sql( $url ),
						'log_referrer' => esc_sql( $referrer ),
						'log_data'     => serialize( $sanitized_data ),
					)
				);

				$error = $wpdb->last_error;

				if ( strlen( trim( $error ) ) > 0 ) {
					ITSEC_Lib::create_database_tables();
				}

			}

			if ( isset( $itsec_globals['settings']['log_type'] ) && ( $itsec_globals['settings']['log_type'] === 1 || $itsec_globals['settings']['log_type'] == 2 ) ) {

				$message =
					$options['type'] . ',' .
					intval( $priority ) . ',' .
					$options['function'] . ',' .
					date( 'Y-m-d H:i:s', $itsec_globals['current_time'] ) . ',' .
					date( 'Y-m-d H:i:s', $itsec_globals['current_time_gmt'] ) . ',' .
					sanitize_text_field( $host ) . ',' .
					sanitize_text_field( $username ) . ',' .
					( intval( $user ) === 0 ? '' : intval( $user ) ) . ',' .
					esc_sql( $url ) . ',' .
					esc_sql( $referrer ) . ',' .
					$file_data;

				error_log( $message . PHP_EOL, 3, $this->log_file );

			}

		}

	}

	/**
	 * Displays into box for logs page
	 *
	 * @since 4.0
	 *
	 * @return void
	 */
	public function metabox_logs_header() {

		global $itsec_globals;

		printf(
			'
%s %s. %s
',
			__( 'Below are various logs of information collected by', 'it-l10n-better-wp-security' ),
			$itsec_globals['plugin_name'],
			__( 'This information can help you get a picture of what is happening with your site and the level of success you have achieved in your security efforts.', 'it-l10n-better-wp-security' )
		);

	}

	/**
	 * Displays into box for logs page when only file logging is enabled
	 *
	 * @since 4.0
	 *
	 * @return void
	 */
	public function metabox_logs_header_no_logs() {

		global $itsec_globals;

		printf(
			'
%s
',
			__( 'To view logs within the plugin you must enable database logging in the plugin settings. File logging is not available for access within the plugin itself.', 'it-l10n-better-wp-security' )
		);

	}

	/**
	 * Displays into box for logs page
	 *
	 * @since 4.0
	 *
	 * @return void
	 */
	public function metabox_all_logs() {

		$log_filter = isset( $_GET['itsec_log_filter'] ) ? sanitize_text_field( $_GET['itsec_log_filter'] ) : 'all-log-data';
		$callback   = null;

		echo '
' . __( 'To adjust logging options visit the global settings page.', 'it-l10n-better-wp-security' ) . '
';

		echo '' . __( 'Select Filter: ', 'it-l10n-better-wp-security' ) . '';
		echo '<select id="itsec_log_filter" name="itsec_log_filter">';
		echo '<option value="all-log-data" ' . selected( $log_filter, 'all-log-data' ) . '>' . __( 'All Log Data', 'it-l10n-better-wp-security' ) . '</option>';

		$this->logger_displays = apply_filters( 'itsec_logger_displays', $this->logger_displays );

		if ( sizeof( $this->logger_displays ) > 0 ) {

			foreach ( $this->logger_displays as $display ) {

				if ( $display['module'] === $log_filter ) {
					$callback = $display['callback'];
				}

				echo '<option value="' . $display['module'] . '" ' . selected( $log_filter, $display['module'] ) . '>' . $display['title'] . '</option>';

			}

		}

		echo '</select>';

		if ( $log_filter === 'all-log-data' || $callback === null ) {

			$this->all_logs_content();

		} else {

			call_user_func_array( $callback, array() );

		}

	}

	/**
	 * A better print array function to display array data in the logs
	 *
	 * @since 4.2
	 *
	 * @param array $array_items array to print or return
	 * @param bool  $return      true to return the data false to echo it
	 */
	public function print_array( $array_items, $return = true ) {

		$items = '';

		//make sure we're working with an array
		if ( ! is_array( $array_items ) ) {
			return false;
		}

		if ( sizeof( $array_items ) > 0 ) {

			$items .= '
';

			foreach ( $array_items as $key => $item ) {

				if ( is_array( $item ) ) {

					$items .= '
';

					if ( ! is_numeric( $key ) ) {
						$items .= '
' . $key . '
';
					}

					$items .= $this->print_array( $item, true ) . PHP_EOL;

					$items .= '
';

				} else {

					if ( strlen( trim( $item ) ) > 0 ) {
						$items .= '

' . $key . ' = ' . $item . '

' . PHP_EOL;
					}

				}

			}

			$items .= '
';

		}

		return $items;

	}

	/**
	 * Purges database logs and rotates file logs (when needed)
	 *
	 * @return void
	 */
	public function purge_logs() {

		global $wpdb, $itsec_globals, $itsec_clear_all_logs;

		if ( isset( $itsec_clear_all_logs ) && $itsec_clear_all_logs === true ) {

			if ( ! wp_verify_nonce( $_POST['wp_nonce'], 'itsec_clear_logs' ) ) {
				return;
			}

			$wpdb->query( "DELETE FROM `" . $wpdb->base_prefix . "itsec_log`;" );

		} else {

			//Clean up the database log first
			if ( $itsec_globals['settings']['log_type'] === 0 || $itsec_globals['settings']['log_type'] == 2 ) {

				$wpdb->query( "DELETE FROM `" . $wpdb->base_prefix . "itsec_log` WHERE `log_date_gmt` < '" . date( 'Y-m-d H:i:s', $itsec_globals['current_time_gmt'] - ( $itsec_globals['settings']['log_rotation'] * 24 * 60 * 60 ) ) . "';" );

			} else {

				$wpdb->query( "DELETE FROM `" . $wpdb->base_prefix . "itsec_log`;" );

			}

			if ( ( @file_exists( $this->log_file ) && @filesize( $this->log_file ) >= 10485760 ) ) {
				$this->rotate_log();
			}

		}

	}

	/**
	 * Register modules that will use the logger service
	 *
	 * @return void
	 */
	public function register_modules() {

		$this->logger_modules  = apply_filters( 'itsec_logger_modules', $this->logger_modules );
		$this->logger_displays = apply_filters( 'itsec_logger_displays', $this->logger_displays );

	}

	/**
	 * Rotates the event-log.log file when called
	 *
	 * Adapted from http://www.phpclasses.org/browse/file/49471.html
	 *
	 * @return void
	 */
	private function rotate_log() {

		// rotate
		$path_info      = pathinfo( $this->log_file );
		$base_directory = $path_info['dirname'];
		$base_name      = $path_info['basename'];
		$num_map        = array();

		foreach ( new DirectoryIterator( $base_directory ) as $fInfo ) {

			if ( $fInfo->isDot() || ! $fInfo->isFile() ) {
				continue;
			}

			if ( preg_match( '/^' . $base_name . '\.?([0-9]*)$/', $fInfo->getFilename(), $matches ) ) {

				$num      = $matches[1];
				$old_file = $fInfo->getFilename();

				if ( $num == '' ) {
					$num = - 1;
				}

				$num_map[ $num ] = $old_file;

			}

		}

		krsort( $num_map );

		foreach ( $num_map as $num => $old_file ) {

			$new_file = $num + 1;
			@rename( $base_directory . DIRECTORY_SEPARATOR . $old_file, $this->log_file . '.' . $new_file );

		}

		$this->start_log();

	}

	/**
	 * Sanitizes strings in a given array recursively
	 *
	 * @param  array $array     array to sanitize
	 * @param  bool  $to_string true if output should be string or false for array output
	 *
	 * @return mixed             sanitized array or string
	 */
	private function sanitize_array( $array, $to_string = false ) {

		$sanitized_array = array();
		$string          = '';

		//Loop to sanitize each piece of data
		foreach ( $array as $key => $value ) {

			if ( is_array( $value ) ) {

				if ( $to_string === false ) {
					$sanitized_array[ esc_sql( $key ) ] = $this->sanitize_array( $value );
				} else {
					$string .= esc_sql( $key ) . '=' . $this->sanitize_array( $value, true );
				}

			} else {

				$sanitized_array[ esc_sql( $key ) ] = esc_sql( $value );

				$string .= esc_sql( $key ) . '=' . esc_sql( $value );

			}

		}

		if ( $to_string === false ) {
			return $sanitized_array;
		} else {
			return $string;
		}

	}

	/**
	 * Creates a new log file and adds header information (if needed)
	 *
	 * @return void
	 */
	private function start_log() {

		if ( file_exists( $this->log_file ) !== true ) { //only if current log file doesn't exist

			$header = 'log_type,log_priority,log_function,log_date,log_date_gmt,log_host,log_username,log_user,log_url,log_referrer,log_data' . PHP_EOL;

			@error_log( $header, 3, $this->log_file );

		}

	}

}


text:
/* eslint-env mocha */
// The following two rules are disabled so that we can use anonymous functions with mocha
// This allows the test instance to be properly referenced with `this`
/* eslint prefer-arrow-callback: "off", func-names: "off" */

const Vue = require('vue-test');
const downloadButton = require('../src/vue/content-renderer/download-button.vue');

const DownloadButtonComponent = Vue.extend(downloadButton);
const assert = require('assert');
const simulant = require('simulant');

describe('download-button Component', function () {
  const samplesFiles = [{
    file_size: 100000,
    preset: 'High Resolution',
    download_url: '/downloadcontent/3893fd801427402ad07487c5d2d35119.mp4/Math_Low_Resolution.mp4',
  }, {
    file_size: 500,
    preset: 'Thumbnail',
    download_url: '/downloadcontent/187598e1f4596bf4492f5a205922b633.jpg/Math_Thumbnail.jpg',
  }];

  describe('computed property', function () {
    describe('dropdownItems', function () {
      beforeEach(function () {
        this.vm = new DownloadButtonComponent({
          propsData: {
            files: samplesFiles,
          },
        }).$mount();
      });
      it('should return an array of length equal to number of files', function () {
        assert.equal(this.vm.dropdownItems.length, samplesFiles.length);
      });
    });

    describe('focusableItems', function () {
      beforeEach(function () {
        this.vm = new DownloadButtonComponent({
          propsData: {
            files: samplesFiles,
          },
        }).$mount();
      });
      it('should return an array of length equal to number of files + 1', function () {
        assert.equal(this.vm.focusableItems.length, this.vm.dropdownItems.length + 1);
      });
    });
  });

  describe('method', function () {
    describe('toggleDropdown', function () {
      beforeEach(function () {
        this.vm = new DownloadButtonComponent({
          propsData: {
            files: samplesFiles,
          },
        }).$mount();
      });
      it('should mark menu as open if called once', function () {
        this.vm.toggleDropdown();
        assert.equal(this.vm.dropdownOpen, true);
        assert.equal(this.vm.focusedItemIndex, 0);
      });
      it('should mark menu as closed if called twice', function () {
        this.vm.toggleDropdown();
        this.vm.toggleDropdown();
        assert.equal(this.vm.dropdownOpen, false);
        assert.equal(this.vm.focusedItemIndex, 0);
      });
    });

    describe('handleKeys', function () {
      beforeEach(function () {
        this.vm = new DownloadButtonComponent({
          propsData: {
            files: samplesFiles,
          },
        }).$mount();
      });
      it('should ignore key input if dropdown is closed', function () {
        const downKey = simulant('keydown', { keyCode: 40 });
        simulant.fire(this.vm.$el, downKey);
        assert.equal(this.vm.focusedItemIndex, 0);
      });
      it('should ignore unrecognized key input', function () {
        const clickEvent = simulant('click');
        simulant.fire(this.vm.$refs.dropdownbutton, clickEvent);
        const zKey = simulant('keydown', { keyCode: 90 });
        simulant.fire(this.vm.$el, zKey);
        assert.equal(this.vm.focusedItemIndex, 0);
      });
      it('should handle the down key', function () {
        const clickEvent = simulant('click');
        simulant.fire(this.vm.$refs.dropdownbutton, clickEvent);
        const downKeyEvent = simulant('keydown', { keyCode: 40 });
        simulant.fire(document, downKeyEvent);
        assert.equal(this.vm.focusedItemIndex, 1);
      });
      it('should handle the up key', function () {
        const clickEvent = simulant('click');
        simulant.fire(this.vm.$refs.dropdownbutton, clickEvent);
        const downKeyEvent = simulant('keydown', { keyCode: 40 });
        const upKeyEvent = simulant('keydown', { keyCode: 38 });
        simulant.fire(document, downKeyEvent);
        simulant.fire(document, upKeyEvent);
        assert.equal(this.vm.focusedItemIndex, 0);
      });
      it('should handle the tab key', function () {
        const clickEvent = simulant('click');
        simulant.fire(this.vm.$refs.dropdownbutton, clickEvent);
        const tabKeyEvent = simulant('keydown', { keyCode: 9 });
        simulant.fire(document, tabKeyEvent);
        assert.equal(this.vm.focusedItemIndex, 1);
      });
      it('should handle the esc key', function () {
        const clickEvent = simulant('click');
        simulant.fire(this.vm.$refs.dropdownbutton, clickEvent);
        const escKeyEvent = simulant('keydown', { keyCode: 27 });
        simulant.fire(document, escKeyEvent);
        assert.equal(this.vm.dropdownOpen, false);
      });
    });

    describe('focusOnItem', function () {
      beforeEach(function () {
        this.vm = new DownloadButtonComponent({
          propsData: {
            files: samplesFiles,
          },
        }).$mount();
      });
      it('should focus on the correct item even if out of bounds', function () {
        this.vm.focusOnItem(100);
        assert.equal(this.vm.focusedItemIndex, 2);
      });
    });
  });
});


text:
(function () {
    MeController.$inject = ['$scope', '$filter', '$window', '$timeout', '$httpParamSerializer', 'MeService', 'Resources', 'ProfileService', 'Utils'];

    angular
        .module('myApp.components.me', [])
        .component('kudosMe', {
            templateUrl: 'app/components/kudos-me/me.html'
        })
        .controller('MeController', MeController);

    function MeController($scope, $filter, $window, $timeout, $httpParamSerializer, MeService, Resources, ProfileService, Utils) {
        var self = this;
        var requestDateFormat = 'yyyy-MM-dd HH:mm:ss,sss';
        var currentDate = $filter('date')(new Date(), requestDateFormat);
        var user,
            requestData,
            checkUser,
            birthday,
            startedToWork;
        var fade = 4500;

        activate();

        self.followersCount = 0;
        self.followingCount = 0;
        self.isMeActive = true;
        self.isFriendsActive = false;
        self.showLoader = true;

        self.lengthLimit = Utils.lengthLimit;
        self.symbolsLeft = Utils.symbolsLeft;
        self.edit = edit;
        self.splitDate = splitDate;
        self.checkIsCompleted = checkIsCompleted;
        self.editAsView = editAsView;
        self.checkInputs = checkInputs;
        self.checkPattern = checkPattern;
        self.setValuesView = setValuesView;
        self.setValuesEdit = setValuesEdit;

        function activate() {
            isLoggedIn();

            MeService.followers().then(function (val) {
                self.followersCount = val.data.length;
            });

            MeService.following().then(function (val) {
                self.followingCount = val.data.length;
                self.showLoader = false;
            });
        }

        function isLoggedIn() {
            ProfileService.checkUser().then(function (val) {
                val.logged ? $window.location.href = "#/me" : $window.location.href = "#/login";
            });
        }

        function edit() {
            self.showLoader = true;
            birthday = $filter('date')(self.birthdayEdit, requestDateFormat);
            startedToWork = $filter('date')(self.startedToWorkEdit, requestDateFormat);
            self.birthdayView = $filter('date')(self.birthdayEdit, requestDateFormat);
            self.startedToWorkView = $filter('date')(self.startedToWorkEdit, requestDateFormat);

            if (birthday == 'Invalid Date') {
                birthday = null;
                self.birthdayView = null;
            }

            if (startedToWork == 'Invalid Date') {
                startedToWork = null;
                self.startedToWorkView = null;
            }

            requestData = $httpParamSerializer({
                email: self.email,
                firstName: self.firstNameEdit,
                lastName: self.lastNameEdit,
                birthday: birthday,
                startedToWorkDate: startedToWork
            });

            if (!checkInputs()) {
                MeService.edit(requestData).then(function (val) {
                    self.editMode = false;
                    toastr.success("You have successfully edited your profile");
                    setValuesView(val);
                    user = Resources.getCurrentUser();
                    checkIsCompleted(birthday, startedToWork, user);
                    self.showLoader = false;
                });
            } else {
                self.meErrorMessage = checkInputs();
                self.startFade = false;
                $timeout(function () {
                    self.startFade = true;
                    $timeout(function () {
                        self.meErrorMessage = "";
                        self.startFade = false;
                    }, 1000)
                }, fade);
                self.showLoader = false;
            }
        }

        function checkInputs() {
            if (self.firstNameEdit){
                if (checkPattern(self.firstNameEdit)) return "In first name field only letters are allowed";
            } else return "First name can't be empty";

            if (self.lastNameEdit){
                if (checkPattern(self.lastNameEdit)) return "In last name field only letters are allowed";
            } else return "Last name can't be empty";

            if (birthday)
                if (birthday > currentDate) return "Your birthday cannot be in the future...";

            if (startedToWork)
                if (startedToWork > currentDate) return "You are already working here. Please change your started to work date";

            return false;
        }

        function checkPattern(val) {
            var reg = /[^ąčęėįšųūžĄČĘĖĮŠŲŪŽåäöÅÄÖĀĒĢĪĶĻŅēīāņļķģüÜÕõa-z A-Z]/;
            return !!reg.test(val);
        }

        function userInformation(){
            user = Resources.getCurrentUser();
            if (user && !checkUser){
                checkUser = true;
                setValuesEdit(user);
                setValuesView(user);
                self.email = user.email;
            }
        }

        function setValuesView(val) {
            self.firstName = val.firstName;
            self.lastName = val.lastName;
            self.birthday = val.birthday;
            self.startedToWork = val.startedToWorkDate;
        }

        function setValuesEdit(val) {
            self.firstNameEdit = val.firstName;
            self.lastNameEdit = val.lastName;
            self.birthdayEdit = new Date(splitDate(val.birthday));
            self.startedToWorkEdit = new Date(splitDate(val.startedToWorkDate));
        }

        function editAsView() {
            self.firstNameEdit = self.firstName;
            self.lastNameEdit = self.lastName;
            self.birthdayEdit = new Date(splitDate(self.birthday));
            self.startedToWorkEdit = new Date(splitDate(self.startedToWork));
        }

        function checkIsCompleted(val1, val2, val) {
            if (val1 && val2) {
                val.completed = true;
                Resources.setCurrentUser(user);
            }
        }

        function splitDate(val){
            if (val) {
                val = val.split(" ");
                return val[0];
            }
        }

        $scope.$watch(function () {
            userInformation();
        });
    }
})();


text:
namespace net {

class NET_EXPORT_PRIVATE HeaderCoalescer : public SpdyHeadersHandlerInterface {
 public:
  HeaderCoalescer() {}

  void OnHeaderBlockStart() override {}

  void OnHeader(base::StringPiece key, base::StringPiece value) override;

  void OnHeaderBlockEnd(size_t uncompressed_header_bytes) override {}
  void OnHeaderBlockEnd(size_t uncompressed_header_bytes,
                        size_t compressed_header_bytes) override {}

  SpdyHeaderBlock release_headers();
  bool error_seen() const { return error_seen_; }

 private:
  SpdyHeaderBlock headers_;
  bool headers_valid_ = true;
  size_t header_list_size_ = 0;
  bool error_seen_ = false;
  bool regular_header_seen_ = false;
};

}  // namespace net

#endif  // NET_SPDY_HEADER_COALESCER_H_


text:
package com.yang.young.common.sso.config;

import java.util.ArrayList;
import java.util.List;

import org.jasig.cas.client.validation.Cas20ServiceTicketValidator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.security.cas.ServiceProperties;
import org.springframework.security.cas.authentication.CasAssertionAuthenticationToken;
import org.springframework.security.cas.authentication.CasAuthenticationProvider;
import org.springframework.security.cas.web.CasAuthenticationEntryPoint;
import org.springframework.security.cas.web.CasAuthenticationFilter;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.AuthenticationUserDetailsService;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

@Configuration
@Profile("CasAuthentication")
@EnableWebSecurity
public class CasSecurityConfig {

	@Configuration
	@Profile("CASAuthentication")
	@EnableWebSecurity(debug = true)
	@Order(Ordered.LOWEST_PRECEDENCE - 100)
	protected static class SigninAuthenticationConfig extends
			WebSecurityConfigurerAdapter {

		@Bean
		public ServiceProperties serviceProperties() {
			ServiceProperties serviceProperties = new ServiceProperties();
			serviceProperties.setService("http://localhost:8080/login/cas");
			serviceProperties.setSendRenew(false);
			return serviceProperties;
		}

		@Bean
		public CasAuthenticationEntryPoint casAuthenticationEntryPoint() {
			CasAuthenticationEntryPoint casAuthenticationEntryPoint = new CasAuthenticationEntryPoint();
			casAuthenticationEntryPoint
					.setLoginUrl("https://localhost:8443/cas/login");
			casAuthenticationEntryPoint
					.setServiceProperties(serviceProperties());
			return casAuthenticationEntryPoint;
		}

		@Bean
		public CasAuthenticationFilter casAuthenticationFilter()
				throws Exception {
			CasAuthenticationFilter casAuthenticationFilter = new CasAuthenticationFilter();
			casAuthenticationFilter
					.setAuthenticationManager(authenticationManager());
			return casAuthenticationFilter;
		}

		@Bean
		public CasAuthenticationProvider casAuthenticationProvider() {
			CasAuthenticationProvider casAuthenticationProvider = new CasAuthenticationProvider();
			casAuthenticationProvider.setAuthenticationUserDetailsService(authenticationUserDetailsService());
			casAuthenticationProvider.setServiceProperties(serviceProperties());
			casAuthenticationProvider.setTicketValidator(cas20ServiceTicketValidator());
			casAuthenticationProvider.setKey("an_id_for_this_auth_provider_only");

			return casAuthenticationProvider;
		}

		@Bean
	    public AuthenticationUserDetailsService<CasAssertionAuthenticationToken> authenticationUserDetailsService() {
	        return new TestCasAuthenticationUserDetailsService();
	    }

		@Bean
	    public Cas20ServiceTicketValidator cas20ServiceTicketValidator() {
	        return new Cas20ServiceTicketValidator("https://localhost:8443/cas");
	    }

		@Override
		protected void configure(HttpSecurity http) throws Exception {

			http.csrf().disable().formLogin().disable()
					.addFilter(casAuthenticationFilter()).exceptionHandling()
					.authenticationEntryPoint(casAuthenticationEntryPoint())
					.and()
					.authorizeRequests()
					.antMatchers("/rest/register").anonymous()
		        	.antMatchers("/rest/account/**").authenticated()
		        	.antMatchers("/rest/admin/**").authenticated()
        	;
		}

		@Override
		protected void configure(AuthenticationManagerBuilder auth)
				throws Exception {
			auth.authenticationProvider(casAuthenticationProvider());
		}

	}

	public static class TestCasAuthenticationUserDetailsService implements AuthenticationUserDetailsService<CasAssertionAuthenticationToken> {

		@Override
		public UserDetails loadUserDetails(CasAssertionAuthenticationToken token) throws UsernameNotFoundException {
			List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
			authorities.add(new SimpleGrantedAuthority("ROLE_USER"));
			return new User(token.getAssertion().getPrincipal().getName(), "", authorities);
		}

	}

}


text:
"""
Z-Wave platform that handles simple door locks.

For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/lock.zwave/
"""
# Because we do not compile openzwave on CI
# pylint: disable=import-error
import asyncio
import logging
from os import path

import voluptuous as vol

from homeassistant.components.lock import DOMAIN, LockDevice
from homeassistant.components import zwave
from homeassistant.config import load_yaml_config_file
import homeassistant.helpers.config_validation as cv

_LOGGER = logging.getLogger(__name__)

ATTR_NOTIFICATION = 'notification'
ATTR_LOCK_STATUS = 'lock_status'
ATTR_CODE_SLOT = 'code_slot'
ATTR_USERCODE = 'usercode'
CONFIG_ADVANCED = 'Advanced'

SERVICE_SET_USERCODE = 'set_usercode'
SERVICE_GET_USERCODE = 'get_usercode'
SERVICE_CLEAR_USERCODE = 'clear_usercode'

POLYCONTROL = 0x10E
DANALOCK_V2_BTZE = 0x2
POLYCONTROL_DANALOCK_V2_BTZE_LOCK = (POLYCONTROL, DANALOCK_V2_BTZE)
WORKAROUND_V2BTZE = 'v2btze'

DEVICE_MAPPINGS = {
    POLYCONTROL_DANALOCK_V2_BTZE_LOCK: WORKAROUND_V2BTZE
}

LOCK_NOTIFICATION = {
    '1': 'Manual Lock',
    '2': 'Manual Unlock',
    '3': 'RF Lock',
    '4': 'RF Unlock',
    '5': 'Keypad Lock',
    '6': 'Keypad Unlock',
    '11': 'Lock Jammed',
    '254': 'Unknown Event'
}

LOCK_ALARM_TYPE = {
    '9': 'Deadbolt Jammed',
    '18': 'Locked with Keypad by user ',
    '19': 'Unlocked with Keypad by user ',
    '21': 'Manually Locked ',
    '22': 'Manually Unlocked ',
    '24': 'Locked by RF',
    '25': 'Unlocked by RF',
    '27': 'Auto re-lock',
    '33': 'User deleted: ',
    '112': 'Master code changed or User added: ',
    '113': 'Duplicate Pin-code: ',
    '130': 'RF module, power restored',
    '161': 'Tamper Alarm: ',
    '167': 'Low Battery',
    '168': 'Critical Battery Level',
    '169': 'Battery too low to operate'
}

MANUAL_LOCK_ALARM_LEVEL = {
    '1': 'by Key Cylinder or Inside thumb turn',
    '2': 'by Touch function (lock and leave)'
}

TAMPER_ALARM_LEVEL = {
    '1': 'Too many keypresses',
    '2': 'Cover removed'
}

LOCK_STATUS = {
    '1': True,
    '2': False,
    '3': True,
    '4': False,
    '5': True,
    '6': False,
    '9': False,
    '18': True,
    '19': False,
    '21': True,
    '22': False,
    '24': True,
    '25': False,
    '27': True
}

ALARM_TYPE_STD = [
    '18',
    '19',
    '33',
    '112',
    '113'
]

SET_USERCODE_SCHEMA = vol.Schema({
    vol.Required(zwave.const.ATTR_NODE_ID): vol.Coerce(int),
    vol.Required(ATTR_CODE_SLOT): vol.Coerce(int),
    vol.Required(ATTR_USERCODE): cv.string,
})

GET_USERCODE_SCHEMA = vol.Schema({
    vol.Required(zwave.const.ATTR_NODE_ID): vol.Coerce(int),
    vol.Required(ATTR_CODE_SLOT): vol.Coerce(int),
})

CLEAR_USERCODE_SCHEMA = vol.Schema({
    vol.Required(zwave.const.ATTR_NODE_ID): vol.Coerce(int),
    vol.Required(ATTR_CODE_SLOT): vol.Coerce(int),
})

@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
    """Set up the Z-Wave Lock platform."""
    yield from zwave.async_setup_platform(
        hass, config, async_add_devices, discovery_info)

    descriptions = load_yaml_config_file(
        path.join(path.dirname(__file__), 'services.yaml'))
    network = hass.data[zwave.ZWAVE_NETWORK]

    def set_usercode(service):
        """Set the usercode to index X on the lock."""
        node_id = service.data.get(zwave.const.ATTR_NODE_ID)
        lock_node = network.nodes[node_id]
        code_slot = service.data.get(ATTR_CODE_SLOT)
        usercode = service.data.get(ATTR_USERCODE)

        for value in lock_node.get_values(
                class_id=zwave.const.COMMAND_CLASS_USER_CODE).values():
            if value.index != code_slot:
                continue
            if len(str(usercode)) > 4:
                _LOGGER.error("Invalid code provided: (%s) "
                              "usercode must %s or less digits",
                              usercode, len(value.data))
                break
            value.data = str(usercode)
            break

    def get_usercode(service):
        """Get a usercode at index X on the lock."""
        node_id = service.data.get(zwave.const.ATTR_NODE_ID)
        lock_node = network.nodes[node_id]
        code_slot = service.data.get(ATTR_CODE_SLOT)

        for value in lock_node.get_values(
                class_id=zwave.const.COMMAND_CLASS_USER_CODE).values():
            if value.index != code_slot:
                continue
            _LOGGER.info("Usercode at slot %s is: %s", value.index, value.data)
            break

    def clear_usercode(service):
        """Set usercode to slot X on the lock."""
        node_id = service.data.get(zwave.const.ATTR_NODE_ID)
        lock_node = network.nodes[node_id]
        code_slot = service.data.get(ATTR_CODE_SLOT)
        data = ''

        for value in lock_node.get_values(
                class_id=zwave.const.COMMAND_CLASS_USER_CODE).values():
            if value.index != code_slot:
                continue
            for i in range(len(value.data)):
                data += '\0'
                i += 1
            _LOGGER.debug('Data to clear lock: %s', data)
            value.data = data
            _LOGGER.info("Usercode at slot %s is cleared", value.index)
            break

    hass.services.async_register(
        DOMAIN, SERVICE_SET_USERCODE, set_usercode,
        descriptions.get(SERVICE_SET_USERCODE), schema=SET_USERCODE_SCHEMA)
    hass.services.async_register(
        DOMAIN, SERVICE_GET_USERCODE, get_usercode,
        descriptions.get(SERVICE_GET_USERCODE), schema=GET_USERCODE_SCHEMA)
    hass.services.async_register(
        DOMAIN, SERVICE_CLEAR_USERCODE, clear_usercode,
        descriptions.get(SERVICE_CLEAR_USERCODE), schema=CLEAR_USERCODE_SCHEMA)

def get_device(node, values, **kwargs):
    """Create Z-Wave entity device."""
    return ZwaveLock(values)

class ZwaveLock(zwave.ZWaveDeviceEntity, LockDevice):
    """Representation of a Z-Wave Lock."""

    def __init__(self, values):
        """Initialize the Z-Wave lock device."""
        zwave.ZWaveDeviceEntity.__init__(self, values, DOMAIN)
        self._state = None
        self._notification = None
        self._lock_status = None
        self._v2btze = None

        # Enable appropriate workaround flags for our device
        # Make sure that we have values for the key before converting to int
        if (self.node.manufacturer_id.strip() and
                self.node.product_id.strip()):
            specific_sensor_key = (int(self.node.manufacturer_id, 16),
                                   int(self.node.product_id, 16))
            if specific_sensor_key in DEVICE_MAPPINGS:
                if DEVICE_MAPPINGS[specific_sensor_key] == WORKAROUND_V2BTZE:
                    self._v2btze = 1
                    _LOGGER.debug("Polycontrol Danalock v2 BTZE "
                                  "workaround enabled")
        self.update_properties()

    def update_properties(self):
        """Callback on data changes for node values."""
        self._state = self.values.primary.data
        _LOGGER.debug("Lock state set from Bool value and is %s", self._state)
        if self.values.access_control:
            notification_data = self.values.access_control.data
            self._notification = LOCK_NOTIFICATION.get(str(notification_data))

            if self._v2btze:
                if self.values.v2btze_advanced and \
                        self.values.v2btze_advanced.data == CONFIG_ADVANCED:
                    self._state = LOCK_STATUS.get(str(notification_data))
                    _LOGGER.debug(
                        "Lock state set from Access Control value and is %s, "
                        "get=%s", str(notification_data), self.state)

        if not self.values.alarm_type:
            return

        alarm_type = self.values.alarm_type.data
        _LOGGER.debug("Lock alarm_type is %s", str(alarm_type))
        if self.values.alarm_level:
            alarm_level = self.values.alarm_level.data
        else:
            alarm_level = None
        _LOGGER.debug("Lock alarm_level is %s", str(alarm_level))

        if not alarm_type:
            return
        if alarm_type is 21:
            self._lock_status = '{}{}'.format(
                LOCK_ALARM_TYPE.get(str(alarm_type)),
                MANUAL_LOCK_ALARM_LEVEL.get(str(alarm_level)))
            return
        if str(alarm_type) in ALARM_TYPE_STD:
            self._lock_status = '{}{}'.format(
                LOCK_ALARM_TYPE.get(str(alarm_type)), str(alarm_level))
            return
        if alarm_type is 161:
            self._lock_status = '{}{}'.format(
                LOCK_ALARM_TYPE.get(str(alarm_type)),
                TAMPER_ALARM_LEVEL.get(str(alarm_level)))
            return
        if alarm_type != 0:
            self._lock_status = LOCK_ALARM_TYPE.get(str(alarm_type))
            return

    @property
    def is_locked(self):
        """Return true if device is locked."""
        return self._state

    def lock(self, **kwargs):
        """Lock the device."""
        self.values.primary.data = True

    def unlock(self, **kwargs):
        """Unlock the device."""
        self.values.primary.data = False

    @property
    def device_state_attributes(self):
        """Return the device specific state attributes."""
        data = super().device_state_attributes
        if self._notification:
            data[ATTR_NOTIFICATION] = self._notification
        if self._lock_status:
            data[ATTR_LOCK_STATUS] = self._lock_status
        return data


text:
<?php
$sitename = "PortCTL";
$adminemail = "admin@localhost";
$adminmsg = "
Welcome to the administrator dashboard.
";
$netissuecount = 0;
$baseurl = "http://localhost/";
$paypal_address = "email@address.com";
?>


text:
#ifndef LLVM_CODEGEN_MACHINECODEEMITTER_H
#define LLVM_CODEGEN_MACHINECODEEMITTER_H

#include "llvm/Support/DataTypes.h"
#include "llvm/Support/DebugLoc.h"

#include <string>

namespace llvm {

class MachineBasicBlock;
class MachineConstantPool;
class MachineJumpTableInfo;
class MachineFunction;
class MachineModuleInfo;
class MachineRelocation;
class Value;
class GlobalValue;
class Function;
class MCSymbol;

/// MachineCodeEmitter - This class defines two sorts of methods: those for
/// emitting the actual bytes of machine code, and those for emitting auxiliary
/// structures, such as jump tables, relocations, etc.
///
/// Emission of machine code is complicated by the fact that we don't (in
/// general) know the size of the machine code that we're about to emit before
/// we emit it.  As such, we preallocate a certain amount of memory, and set the
/// BufferBegin/BufferEnd pointers to the start and end of the buffer.  As we
/// emit machine instructions, we advance the CurBufferPtr to indicate the
/// location of the next byte to emit.  In the case of a buffer overflow (we
/// need to emit more machine code than we have allocated space for), the
/// CurBufferPtr will saturate to BufferEnd and ignore stores.  Once the entire
/// function has been emitted, the overflow condition is checked, and if it has
/// occurred, more memory is allocated, and we reemit the code into it.
///
class MachineCodeEmitter {
  virtual void anchor();
protected:
  /// BufferBegin/BufferEnd - Pointers to the start and end of the memory
  /// allocated for this code buffer.
  uint8_t *BufferBegin, *BufferEnd;
  /// CurBufferPtr - Pointer to the next byte of memory to fill when emitting
  /// code.  This is guaranteed to be in the range [BufferBegin,BufferEnd].  If
  /// this pointer is at BufferEnd, it will never move due to code emission, and
  /// all code emission requests will be ignored (this is the buffer overflow
  /// condition).
  uint8_t *CurBufferPtr;

public:
  virtual ~MachineCodeEmitter() {}

  /// startFunction - This callback is invoked when the specified function is
  /// about to be code generated.  This initializes the BufferBegin/End/Ptr
  /// fields.
  ///
  virtual void startFunction(MachineFunction &F) = 0;

  /// finishFunction - This callback is invoked when the specified function has
  /// finished code generation.  If a buffer overflow has occurred, this method
  /// returns true (the callee is required to try again), otherwise it returns
  /// false.
  ///
  virtual bool finishFunction(MachineFunction &F) = 0;

  /// emitByte - This callback is invoked when a byte needs to be written to the
  /// output stream.
  ///
  void emitByte(uint8_t B) {
    if (CurBufferPtr != BufferEnd)
      *CurBufferPtr++ = B;
  }

  /// emitWordLE - This callback is invoked when a 32-bit word needs to be
  /// written to the output stream in little-endian format.
  ///
  void emitWordLE(uint32_t W) {
    if (4 <= BufferEnd-CurBufferPtr) {
      emitWordLEInto(CurBufferPtr, W);
    } else {
      CurBufferPtr = BufferEnd;
    }
  }

  /// emitWordLEInto - This callback is invoked when a 32-bit word needs to be
  /// written to an arbitrary buffer in little-endian format.  Buf must have at
  /// least 4 bytes of available space.
  ///
  static void emitWordLEInto(uint8_t *&Buf, uint32_t W) {
    *Buf++ = (uint8_t)(W >>  0);
    *Buf++ = (uint8_t)(W >>  8);
    *Buf++ = (uint8_t)(W >> 16);
    *Buf++ = (uint8_t)(W >> 24);
  }

  /// emitWordBE - This callback is invoked when a 32-bit word needs to be
  /// written to the output stream in big-endian format.
  ///
  void emitWordBE(uint32_t W) {
    if (4 <= BufferEnd-CurBufferPtr) {
      *CurBufferPtr++ = (uint8_t)(W >> 24);
      *CurBufferPtr++ = (uint8_t)(W >> 16);
      *CurBufferPtr++ = (uint8_t)(W >>  8);
      *CurBufferPtr++ = (uint8_t)(W >>  0);
    } else {
      CurBufferPtr = BufferEnd;
    }
  }

  /// emitDWordLE - This callback is invoked when a 64-bit word needs to be
  /// written to the output stream in little-endian format.
  ///
  void emitDWordLE(uint64_t W) {
    if (8 <= BufferEnd-CurBufferPtr) {
      *CurBufferPtr++ = (uint8_t)(W >>  0);
      *CurBufferPtr++ = (uint8_t)(W >>  8);
      *CurBufferPtr++ = (uint8_t)(W >> 16);
      *CurBufferPtr++ = (uint8_t)(W >> 24);
      *CurBufferPtr++ = (uint8_t)(W >> 32);
      *CurBufferPtr++ = (uint8_t)(W >> 40);
      *CurBufferPtr++ = (uint8_t)(W >> 48);
      *CurBufferPtr++ = (uint8_t)(W >> 56);
    } else {
      CurBufferPtr = BufferEnd;
    }
  }

  /// emitDWordBE - This callback is invoked when a 64-bit word needs to be
  /// written to the output stream in big-endian format.
  ///
  void emitDWordBE(uint64_t W) {
    if (8 <= BufferEnd-CurBufferPtr) {
      *CurBufferPtr++ = (uint8_t)(W >> 56);
      *CurBufferPtr++ = (uint8_t)(W >> 48);
      *CurBufferPtr++ = (uint8_t)(W >> 40);
      *CurBufferPtr++ = (uint8_t)(W >> 32);
      *CurBufferPtr++ = (uint8_t)(W >> 24);
      *CurBufferPtr++ = (uint8_t)(W >> 16);
      *CurBufferPtr++ = (uint8_t)(W >>  8);
      *CurBufferPtr++ = (uint8_t)(W >>  0);
    } else {
      CurBufferPtr = BufferEnd;
    }
  }

  /// emitAlignment - Move the CurBufferPtr pointer up to the specified
  /// alignment (saturated to BufferEnd of course).
  void emitAlignment(unsigned Alignment) {
    if (Alignment == 0) Alignment = 1;

    if(Alignment <= (uintptr_t)(BufferEnd-CurBufferPtr)) {
      // Move the current buffer ptr up to the specified alignment.
      CurBufferPtr =
        (uint8_t*)(((uintptr_t)CurBufferPtr+Alignment-1) &
                   ~(uintptr_t)(Alignment-1));
    } else {
      CurBufferPtr = BufferEnd;
    }
  }

  /// emitULEB128Bytes - This callback is invoked when a ULEB128 needs to be
  /// written to the output stream.
  void emitULEB128Bytes(uint64_t Value) {
    do {
      uint8_t Byte = Value & 0x7f;
      Value >>= 7;
      if (Value) Byte |= 0x80;
      emitByte(Byte);
    } while (Value);
  }

  /// emitSLEB128Bytes - This callback is invoked when a SLEB128 needs to be
  /// written to the output stream.
  void emitSLEB128Bytes(uint64_t Value) {
    uint64_t Sign = Value >> (8 * sizeof(Value) - 1);
    bool IsMore;

    do {
      uint8_t Byte = Value & 0x7f;
      Value >>= 7;
      IsMore = Value != Sign || ((Byte ^ Sign) & 0x40) != 0;
      if (IsMore) Byte |= 0x80;
      emitByte(Byte);
    } while (IsMore);
  }

  /// emitString - This callback is invoked when a String needs to be
  /// written to the output stream.
  void emitString(const std::string &String) {
    for (unsigned i = 0, N = static_cast<unsigned>(String.size());
         i < N; ++i) {
      uint8_t C = String[i];
      emitByte(C);
    }
    emitByte(0);
  }

  /// emitInt32 - Emit a int32 directive.
  void emitInt32(int32_t Value) {
    if (4 <= BufferEnd-CurBufferPtr) {
      *((uint32_t*)CurBufferPtr) = Value;
      CurBufferPtr += 4;
    } else {
      CurBufferPtr = BufferEnd;
    }
  }

  /// emitInt64 - Emit a int64 directive.
  void emitInt64(uint64_t Value) {
    if (8 <= BufferEnd-CurBufferPtr) {
      *((uint64_t*)CurBufferPtr) = Value;
      CurBufferPtr += 8;
    } else {
      CurBufferPtr = BufferEnd;
    }
  }

  /// emitInt32At - Emit the Int32 Value in Addr.
  void emitInt32At(uintptr_t *Addr, uintptr_t Value) {
    if (Addr >= (uintptr_t*)BufferBegin && Addr < (uintptr_t*)BufferEnd)
      (*(uint32_t*)Addr) = (uint32_t)Value;
  }

  /// emitInt64At - Emit the Int64 Value in Addr.
  void emitInt64At(uintptr_t *Addr, uintptr_t Value) {
    if (Addr >= (uintptr_t*)BufferBegin && Addr < (uintptr_t*)BufferEnd)
      (*(uint64_t*)Addr) = (uint64_t)Value;
  }

  /// processDebugLoc - Records debug location information about a
  /// MachineInstruction.  This is called before emitting any bytes associated
  /// with the instruction.  Even if successive instructions have the same debug
  /// location, this method will be called for each one.
  virtual void processDebugLoc(DebugLoc DL, bool BeforePrintintInsn) {}

  /// emitLabel - Emits a label
  virtual void emitLabel(MCSymbol *Label) = 0;

  /// allocateSpace - Allocate a block of space in the current output buffer,
  /// returning null (and setting conditions to indicate buffer overflow) on
  /// failure.  Alignment is the alignment in bytes of the buffer desired.
  virtual void *allocateSpace(uintptr_t Size, unsigned Alignment) {
    emitAlignment(Alignment);
    void *Result;

    // Check for buffer overflow.
    if (Size >= (uintptr_t)(BufferEnd-CurBufferPtr)) {
      CurBufferPtr = BufferEnd;
      Result = 0;
    } else {
      // Allocate the space.
      Result = CurBufferPtr;
      CurBufferPtr += Size;
    }

    return Result;
  }

  /// StartMachineBasicBlock - This should be called by the target when a new
  /// basic block is about to be emitted.  This way the MCE knows where the
  /// start of the block is, and can implement getMachineBasicBlockAddress.
  virtual void StartMachineBasicBlock(MachineBasicBlock *MBB) = 0;

  /// getCurrentPCValue - This returns the address that the next emitted byte
  /// will be output to.
  ///
  virtual uintptr_t getCurrentPCValue() const {
    return (uintptr_t)CurBufferPtr;
  }

  /// getCurrentPCOffset - Return the offset from the start of the emitted
  /// buffer that we are currently writing to.
  virtual uintptr_t getCurrentPCOffset() const {
    return CurBufferPtr-BufferBegin;
  }

  /// earlyResolveAddresses - True if the code emitter can use symbol addresses
  /// during code emission time. The JIT is capable of doing this because it
  /// creates jump tables or constant pools in memory on the fly while the
  /// object code emitters rely on a linker to have real addresses and should
  /// use relocations instead.
  virtual bool earlyResolveAddresses() const = 0;

  /// addRelocation - Whenever a relocatable address is needed, it should be
  /// noted with this interface.
  virtual void addRelocation(const MachineRelocation &MR) = 0;

  /// FIXME: These should all be handled with relocations!

  /// getConstantPoolEntryAddress - Return the address of the 'Index' entry in
  /// the constant pool that was last emitted with the emitConstantPool method.
  ///
  virtual uintptr_t getConstantPoolEntryAddress(unsigned Index) const = 0;

  /// getJumpTableEntryAddress - Return the address of the jump table with index
  /// 'Index' in the function that last called initJumpTableInfo.
  ///
  virtual uintptr_t getJumpTableEntryAddress(unsigned Index) const = 0;

  /// getMachineBasicBlockAddress - Return the address of the specified
  /// MachineBasicBlock, only usable after the label for the MBB has been
  /// emitted.
  ///
  virtual uintptr_t getMachineBasicBlockAddress(MachineBasicBlock *MBB) const= 0;

  /// getLabelAddress - Return the address of the specified Label, only usable
  /// after the LabelID has been emitted.
  ///
  virtual uintptr_t getLabelAddress(MCSymbol *Label) const = 0;

  /// Specifies the MachineModuleInfo object. This is used for exception handling
  /// purposes.
  virtual void setModuleInfo(MachineModuleInfo* Info) = 0;
};

} // End llvm namespace

#endif


text:
This example assumes you have a configured Twitter REST `client`. Instructions
on how to configure a client can be found in [examples/Configuration.md][cfg].

[cfg]: https://github.com/sferik/twitter/blob/master/examples/Configuration.md

You can fetch up to 3,200 tweets for a user, 200 at a time.

Here is an example of recursively getting pages of 200 Tweets until you receive
an empty response.

**Note: This may result in [rate limiting][].**

[rate limiting]: https://github.com/sferik/twitter/blob/master/examples/RateLimiting.md

```ruby
def collect_with_max_id(collection=[], max_id=nil, &block)
  response = yield(max_id)
  collection += response
  response.empty? ? collection.flatten : collect_with_max_id(collection, response.last.id - 1, &block)
end

def client.get_all_tweets(user)
  collect_with_max_id do |max_id|
    options = {count: 200, include_rts: true}
    options[:max_id] = max_id unless max_id.nil?
    user_timeline(user, options)
  end
end

client.get_all_tweets("sferik")
```