text:
"""
Parse a PDF file and print some information about it.

Usage:
    python parse_page_contents.py inputfile ...
"""
from Quartz import *
import objc
import sys
import array

import Quartz

class MyDataScan (object):
    def __init__(self):
        self.numImagesWithColorThisPage = 0
        self.numImageMasksThisPage = 0
        self.numImagesMaskedWithMaskThisPage = 0
        self.numImagesMaskedWithColorsThisPage = 0

def printPageResults(outFile, myData, pageNum):
    if myData.numImagesWithColorThisPage:
        print >>outFile, "Found %d images with intrinsic color on page %d."%(
                myData.numImagesWithColorThisPage, pageNum)

    if myData.numImageMasksThisPage:
        print >>outFile, "Found %d image masks on page %d."%(
                    myData.numImageMasksThisPage,
                    pageNum)

    if myData.numImagesMaskedWithMaskThisPage:
        print >>outFile, "Found %d images masked with masks on page %d."%(
                    myData.numImagesMaskedWithMaskThisPage,
                    pageNum)

    if myData.numImagesMaskedWithColorsThisPage:
        print >>outFile, "Found %d images masked with colors on page %d."%(
                    myData.numImagesMaskedWithColorsThisPage,
                    pageNum)

def printDocResults(outFile, totPages, totImages):
    print >>outFile
    print >>outFile, "Summary: %d page document contains %d images."%(
                        totPages, totImages)
    print >>outFile

def checkImageType(imageDict, myScanData):
    hasMaskKey, isMask = CGPDFDictionaryGetBoolean(imageDict, "ImageMask", None);
    if not hasMaskKey:
        hasMaskKey, isMask = CGPDFDictionaryGetBoolean(imageDict, "IM", None);

    if hasMaskKey and isMask:
        myScanData.numImageMasksThisPage += 1
        return

    # If image is masked with an alpha image it has an SMask entry.
    hasSMaskKey, object = CGPDFDictionaryGetObject(imageDict, "SMask", None)
    if hasSMaskKey:
        # This object must be an XObject that is an image.
        # This code assumes the PDF is well formed in this regard.
        myScanData.numImagesMaskedWithMaskThisPage += 1
        return

    # If this image is masked with an image or with colors it has
    # a Mask entry.
    hasMask, object = CGPDFDictionaryGetObject(imageDict, "Mask", None)
    if hasMask:
        # If the object is an XObject then the mask is an image.
        # If it is an array, the mask is an array of colors.
        type = CGPDFObjectGetType(object)
        # Check if it is a stream type which it must be to be an XObject.
        if type == kCGPDFObjectTypeStream:
            myScanData.numImagesMaskedWithMaskThisPage += 1
        elif type == kCGPDFObjectTypeArray:
            myScanData.numImagesMaskedWithColorsThisPage += 1
        else:
            print >>sys.stderr, "Mask entry in Image object is not well formed!"

        return

    # This image is not a mask, is not masked with another image or
    # color so it must be an image with intrinsic color with no mask.
    myScanData.numImagesWithColorThisPage += 1

#       The "Do" operator consumes one value off the stack, the name of
#       the object to execute. The name is a resource in the resource
#       dictionary of the page and the object corresponding to that name
#       is an XObject. The most common types of XObjects are either
#       Form objects or Image objects. This code only counts images.
#
#       Note that forms, patterns, and potentially other resources contain
#       images. This code only counts the top level images in a PDF document,
#       not images embedded in other resources.
@objc.callbackFor(CGPDFOperatorTableSetCallback)
def myOperator_Do(s, info):
    # Check to see if this is an image or not.
    cs = CGPDFScannerGetContentStream(s)

    # The Do operator takes a name. Pop the name off the
    # stack. If this fails then the argument to the
    # Do operator is not a name and is therefore invalid!
    res, name = CGPDFScannerPopName(s, None)
    if not res:
        print >>sys.stderr, "Couldn't pop name off stack!"
        return

    # Get the resource with type "XObject" and the name
    # obtained from the stack.
    xobject = CGPDFContentStreamGetResource(cs, "XObject", name);
    if xobject is None:
        print >>sys.stderr, "Couldn't get XObject with name %s"%(name,)
        return

    # An XObject must be a stream so obtain the value from the xobject
    # as if it were a stream. If this fails, the PDF is malformed.
    res, stream = CGPDFObjectGetValue(xobject, kCGPDFObjectTypeStream, None)
    if not res:
        print >>sys.stderr, "XObject '%s' is not a stream"%(name,)
        return

    print stream

    # Streams consist of a dictionary and the data associated
    # with the stream. This code only cares about the dictionary.
    dict = CGPDFStreamGetDictionary(stream);
    if dict is None:
        print >>sys.stderr, "Couldn't obtain dictionary from stream %s!"%(name,)
        return

    # An XObject dict has a Subtype that indicates what kind it is.
    res, name = CGPDFDictionaryGetName(dict, "Subtype", None)
    if not res:
        print >>sys.stderr, "Couldn't get SubType of dictionary object!"
        return

    # This code is interested in the "Image" Subtype of an XObject.
    # Check whether this object has Subtype of "Image".
    if name != "Image":
        # The Subtype is not "Image" so this must be a form
        # or other type of XObject.
        return

    # This is an Image so figure out what variety of image it is.
    checkImageType(dict, info)

# This callback handles inline images. Inline images end with the
# "EI" operator.
@objc.callbackFor(CGPDFOperatorTableSetCallback)
def myOperator_EI(s, info):
    print "EI"
    # When the scanner encounters the EI operator, it has a
    # stream corresponding to the image on the operand stack.
    # This code pops the stream off the stack in order to
    # examine it.
    res, stream = CGPDFScannerPopStream(s, None)
    if not res:
        print >>sys.stderr, "Couldn't create stream from inline image"
        return

    # Get the image dictionary from the stream.
    dict = CGPDFStreamGetDictionary(stream);
    if dict is None:
        print >>sys.stderr, "Couldn't get dict from inline image stream!"
        return

    # By definition the stream passed to EI is an image so
    # pass it to the code to check the type of image.
    checkImageType(dict, info)

def createMyOperatorTable():
    myTable = CGPDFOperatorTableCreate()
    CGPDFOperatorTableSetCallback(myTable, "Do", myOperator_Do)
    CGPDFOperatorTableSetCallback(myTable, "EI", myOperator_EI)
    return myTable

def dumpPageStreams(url, outFile):
    # Create a CGPDFDocumentRef from the input PDF file.
    pdfDoc = CGPDFDocumentCreateWithURL(url);
    if pdfDoc is None:
        print >>sys.stderr, "Couldn't open PDF document!"
        return

    # Create the operator table with the needed callbacks.
    table = createMyOperatorTable();
    if table is None:
        print >>sys.stderr, "Couldn't create operator table!"
        return

    # Initialize the count of the images.
    totalImages = 0

    # Obtain the total number of pages for the document.
    totPages = CGPDFDocumentGetNumberOfPages(pdfDoc)

    # Loop over all the pages in the document, scanning the
    # content stream of each one.
    for i in range(1, totPages+1):
        # Get the PDF page for this page in the document.
        p = CGPDFDocumentGetPage(pdfDoc, i)

        # Create a reference to the content stream for this page.
        cs = CGPDFContentStreamCreateWithPage(p)

        if cs is None:
            print >>sys.stderr, "Couldn't create content stream for page #%d"%(i,)
            return

        # Initialize the counters of images for this page.
        myData = MyDataScan()

        # Create a scanner for this PDF document page.
        scanner = CGPDFScannerCreate(cs, table, 0);
        if scanner is None:
            print >>sys.stderr, "Couldn't create scanner for page #%d!"%(i,)
            return

        # CGPDFScannerScan causes Quartz to scan the content stream,
        # calling the callbacks in the table when the corresponding
        # operator is encountered. Once the content stream for the
        # page has been consumed or Quartz detects a malformed
        # content stream, CGPDFScannerScan returns.
        if not CGPDFScannerScan(scanner):
            print >>sys.stderr, "Scanner couldn't scan all of page #%d!"%(i,)

        # Print the results for this page.
        printPageResults(outFile, myData, i);

        # Update the total count of images with the count of the
        # images on this page.
        totalImages += (
                myData.numImagesWithColorThisPage +
                myData.numImageMasksThisPage +
                myData.numImagesMaskedWithMaskThisPage +
                myData.numImagesMaskedWithColorsThisPage)

        # Once the page has been scanned, release the
        # scanner for this page.
        CGPDFScannerRelease(scanner)
        # Release the content stream for this page.
        CGPDFContentStreamRelease(cs)
        # Done with this page; loop to next page.

    printDocResults(outFile, totPages, totalImages)

def main(args = None):
    if args is None:
        args = sys.argv

    if len(args) < 2:
        print >>sys.stderr, "Usage: %s inputfile ... "%(args[0],)
        return 1

    for inputFileName in args[1:]:
        print "Beginning Document %r"%(inputFileName,)

        print CFURLCreateFromFileSystemRepresentation.__metadata__()
        inURL = CFURLCreateFromFileSystemRepresentation(None, inputFileName,
                                len(inputFileName), False)
        if inURL is None:
            print >>sys.stderr, "Couldn't create URL for input file!"
            return 1

        dumpPageStreams(inURL, sys.stdout)
        #CFRelease(inURL)

    return 0

if __name__ == "__main__":
    sys.exit(main())

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<entities>
  <entity name="mail-record" table="mailRecord" alias="m">
    <member name="id" field="id" value-type="int" length="10" nullable="false" key="true" auto-increment="true" />
    <member name="type" field="type" value-type="int" length="10" nullable="false" />
    <member name="rule-id" field="rule_id" value-type="int" length="10" nullable="false" />
    <member name="receivers" field="receivers" value-type="String" length="500" nullable="false" />
    <member name="title" field="title" value-type="String" length="200" nullable="false" />
    <member name="content" field="content" value-type="String" length="65535" nullable="false" />
    <member name="status" field="status" value-type="int" length="10" nullable="false" />
    <member name="creation-date" field="creation_date" value-type="Date" nullable="false" />
    <var name="key-id" value-type="int" key-member="id" />
    <primary-key name="PRIMARY" members="id" />
    <readsets>
      <readset name="FULL" all="true" />
    </readsets>
    <updatesets>
      <updateset name="FULL" all="true" />
    </updatesets>
    <query-defs>
      <query name="find-by-PK" type="SELECT">
        <param name="key-id" />
        <statement><![CDATA[SELECT <FIELDS/>
        FROM

        WHERE <FIELD name='id'/> = ${key-id}]]></statement>
      </query>
      <query name="insert" type="INSERT">
        <statement><![CDATA[INSERT INTO
(<FIELDS/>)
        VALUES(<VALUES/>)]]></statement>
      </query>
      <query name="update-by-PK" type="UPDATE">
        <param name="key-id" />
        <statement><![CDATA[UPDATE

        SET <FIELDS/>
        WHERE <FIELD name='id'/> = ${key-id}]]></statement>
      </query>
      <query name="delete-by-PK" type="DELETE">
        <param name="key-id" />
        <statement><![CDATA[DELETE FROM

        WHERE <FIELD name='id'/> = ${key-id}]]></statement>
      </query>
    </query-defs>
  </entity>
  <entity name="scheduled-report" table="scheduledReport" alias="s">
    <member name="id" field="id" value-type="int" length="10" nullable="false" key="true" auto-increment="true" />
    <member name="domain" field="domain" value-type="String" length="64" />
    <member name="names" field="names" value-type="String" length="200" />
    <member name="creation-date" field="creation_date" value-type="Date" />
    <member name="modify-date" field="modify_date" value-type="Date" />
    <var name="key-id" value-type="int" key-member="id" />
    <primary-key name="PRIMARY" members="id" />
    <readsets>
      <readset name="FULL" all="true" />
    </readsets>
    <updatesets>
      <updateset name="FULL" all="true" />
    </updatesets>
    <query-defs>
      <query name="find-by-PK" type="SELECT">
        <param name="key-id" />
        <statement><![CDATA[SELECT <FIELDS/>
        FROM

        WHERE <FIELD name='id'/> = ${key-id}]]></statement>
      </query>
      <query name="insert" type="INSERT">
        <statement><![CDATA[INSERT INTO
(<FIELDS/>)
        VALUES(<VALUES/>)]]></statement>
      </query>
      <query name="update-by-PK" type="UPDATE">
        <param name="key-id" />
        <statement><![CDATA[UPDATE

        SET <FIELDS/>
        WHERE <FIELD name='id'/> = ${key-id}]]></statement>
      </query>
      <query name="delete-by-PK" type="DELETE">
        <param name="key-id" />
        <statement><![CDATA[DELETE FROM

        WHERE <FIELD name='id'/> = ${key-id}]]></statement>
      </query>
    </query-defs>
  </entity>
  <entity name="scheduled-report-subscription" table="scheduledReportSubscription" alias="s2">
    <member name="scheduled-report-id" field="scheduled_report_id" value-type="int" length="10" nullable="false" key="true" />
    <member name="user-id" field="user_id" value-type="int" length="10" nullable="false" key="true" />
    <member name="creation-date" field="creation_date" value-type="Date" />
    <var name="key-scheduled-report-id" value-type="int" key-member="scheduled-report-id" />
    <var name="key-user-id" value-type="int" key-member="user-id" />
    <primary-key name="PRIMARY" members="scheduled_report_id, user_id" />
    <readsets>
      <readset name="FULL" all="true" />
    </readsets>
    <updatesets>
      <updateset name="FULL" all="true" />
    </updatesets>
    <query-defs>
      <query name="find-by-PK" type="SELECT">
        <param name="key-scheduled-report-id" />
        <param name="key-user-id" />
        <statement><![CDATA[SELECT <FIELDS/>
        FROM

        WHERE <FIELD name='scheduled-report-id'/> = ${key-scheduled-report-id} AND <FIELD name='user-id'/> = ${key-user-id}]]></statement>
      </query>
      <query name="insert" type="INSERT">
        <statement><![CDATA[INSERT INTO
(<FIELDS/>)
        VALUES(<VALUES/>)]]></statement>
      </query>
      <query name="update-by-PK" type="UPDATE">
        <param name="key-scheduled-report-id" />
        <param name="key-user-id" />
        <statement><![CDATA[UPDATE

        SET <FIELDS/>
        WHERE <FIELD name='scheduled-report-id'/> = ${key-scheduled-report-id} AND <FIELD name='user-id'/> = ${key-user-id}]]></statement>
      </query>
      <query name="delete-by-PK" type="DELETE">
        <param name="key-scheduled-report-id" />
        <param name="key-user-id" />
        <statement><![CDATA[DELETE FROM

        WHERE <FIELD name='scheduled-report-id'/> = ${key-scheduled-report-id} AND <FIELD name='user-id'/> = ${key-user-id}]]></statement>
      </query>
    </query-defs>
  </entity>
  <entity name="scheduled-subscription" table="scheduledSubscription" alias="s3">
    <member name="scheduled-report-id" field="scheduled_report_id" value-type="int" length="10" nullable="false" key="true" />
    <member name="user-name" field="user_name" value-type="String" length="20" nullable="false" key="true" />
    <member name="creation-date" field="creation_date" value-type="Date" />
    <var name="key-scheduled-report-id" value-type="int" key-member="scheduled-report-id" />
    <var name="key-user-name" value-type="String" key-member="user-name" />
    <primary-key name="PRIMARY" members="scheduled_report_id, user_name" />
    <readsets>
      <readset name="FULL" all="true" />
    </readsets>
    <updatesets>
      <updateset name="FULL" all="true" />
    </updatesets>
    <query-defs>
      <query name="find-by-PK" type="SELECT">
        <param name="key-scheduled-report-id" />
        <param name="key-user-name" />
        <statement><![CDATA[SELECT <FIELDS/>
        FROM

        WHERE <FIELD name='scheduled-report-id'/> = ${key-scheduled-report-id} AND <FIELD name='user-name'/> = ${key-user-name}]]></statement>
      </query>
      <query name="insert" type="INSERT">
        <statement><![CDATA[INSERT INTO
(<FIELDS/>)
        VALUES(<VALUES/>)]]></statement>
      </query>
      <query name="update-by-PK" type="UPDATE">
        <param name="key-scheduled-report-id" />
        <param name="key-user-name" />
        <statement><![CDATA[UPDATE

        SET <FIELDS/>
        WHERE <FIELD name='scheduled-report-id'/> = ${key-scheduled-report-id} AND <FIELD name='user-name'/> = ${key-user-name}]]></statement>
      </query>
      <query name="delete-by-PK" type="DELETE">
        <param name="key-scheduled-report-id" />
        <param name="key-user-name" />
        <statement><![CDATA[DELETE FROM

        WHERE <FIELD name='scheduled-report-id'/> = ${key-scheduled-report-id} AND <FIELD name='user-name'/> = ${key-user-name}]]></statement>
      </query>
    </query-defs>
  </entity>
</entities>


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<servico xsi:schemaLocation="http://servicos.gov.br/v3/schema.../servico.xsd" xmlns="http://servicos.gov.br/v3/schema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <id>consultar-banco-de-dados-de-bens-culturais-tombados</id>
    <dbId>4207</dbId>
    <nome>Consultar Banco de Dados de Bens Culturais Tombados</nome>
    <sigla></sigla>
    <nomes-populares>
        <item id="3195">Bens culturais tombados</item>
    </nomes-populares>
    <descricao>Todo acervo de bens culturais tombados é composto por rica documentação sobre bens culturais preservados e protegidos legalmente: documentos que se diversificam entre fotografias, mapas, plantas, negativos, slides, fichas e pareceres técnicos, tendo grande destaque os Processos de Tombamento.
O acervo está disponível para consulta por meio do Sistema Integrado de Conhecimento e Gestão [SICG](http://sicg.iphan.gov.br/sicg/login "SICG").</descricao>
    <contato>Instituto do Patrimônio Histórico e Artístico Nacional
Centro Nacional de Arqueologia
Endereço: Quadra SEPS 713/913 Sul, 3° Andar, Brasília/DF, CEP 70.390-135
E-mail: cna@iphan.gov.br
Site: [www.iphan.gov.br/cna](http://www.iphan.gov.br/cna "www.iphan.gov.br/cna")</contato>
    <gratuito>true</gratuito>
    <porcentagem-manual>false</porcentagem-manual>
    <servico-digital>false</servico-digital>
    <link-servico-digital></link-servico-digital>
    <solicitantes>
        <solicitante id="5214">
            <tipo>Cidadão</tipo>
            <requisitos>Criar uma conta de acesso por meio do cadastro no serviço [Brasil Cidadão](https://scp.brasilcidadao.gov.br/ "Brasil Cidadão") e, em seguida, acessar o sistema [SICG](http://sicg.iphan.gov.br/sicg/login "SICG").</requisitos>
        </solicitante>
    </solicitantes>
    <tempo-total-estimado>
        <atendimento-imediato/>
        <descricao></descricao>
    </tempo-total-estimado>
    <validade-documento>
        <descricao></descricao>
    </validade-documento>
    <etapas>
        <etapa id="9342">
            <titulo>Efetuar cadastro na plataforma Brasil Cidadão</titulo>
            <descricao>O cidadão interessado no serviço deve possuir uma conta de acesso cadastrada na Plataforma Brasil Cidadão.</descricao>
            <documentos>
                <default/>
            </documentos>
            <custos>
                <default/>
            </custos>
            <tempo-total-estimado>
                <atendimento-imediato/>
            </tempo-total-estimado>
            <canais-de-prestacao>
                <default>
                    <canal-de-prestacao id="10243" tipo="web">
                        <descricao>**[Acesse a plataforma e efetue o cadastro](https://scp.brasilcidadao.gov.br/ "Brasil Cidadão")**</descricao>
                    </canal-de-prestacao>
                </default>
            </canais-de-prestacao>
        </etapa>
        <etapa id="9343">
            <titulo>Acessar o SICG</titulo>
            <descricao>Para obter as informações o usuário deve acessar o Sistema Integrado de Conhecimento e Gestão (SICG).</descricao>
            <documentos>
                <default/>
            </documentos>
            <custos>
                <default/>
            </custos>
            <tempo-total-estimado>
                <atendimento-imediato/>
            </tempo-total-estimado>
            <canais-de-prestacao>
                <default>
                    <canal-de-prestacao id="10244" tipo="web">
                        <descricao>[Acesse o sistema](http://sicg.iphan.gov.br/sicg/login "SICG")</descricao>
                    </canal-de-prestacao>
                </default>
            </canais-de-prestacao>
        </etapa>
    </etapas>
    <orgao id="http://estruturaorganizacional.dados.gov.br/id/unidade-organizacional/2045" dbId="37065">
        <nomeOrgao>Instituto do Patrimônio Histórico e Artístico Nacional (IPHAN)</nomeOrgao>
    </orgao>
    <segmentos-da-sociedade>
        <item idSegmento="1" idServicoSegmento="9041">Cidadãos</item>
        <item idSegmento="4" idServicoSegmento="9042">Demais segmentos (ONGs, organizações sociais, etc)</item>
    </segmentos-da-sociedade>
    <areas-de-interesse>
        <item>Cultura</item>
        <item>Patrimônio Cultural</item>
        <item>Patrimônio</item>
    </areas-de-interesse>
    <palavras-chave>
        <item id="17230">bens culturais tombados</item>
        <item id="17231">sicg</item>
        <item id="17232">banco de dados de bens tombados</item>
        <item id="17233">tombamento</item>
    </palavras-chave>
    <servicos-relacionados>
        <item>848</item>
        <item>3046</item>
        <item>3230</item>
        <item>866</item>
    </servicos-relacionados>
    <condicoes-acessibilidade>-</condicoes-acessibilidade>
    <tratamento-prioritario>-</tratamento-prioritario>
    <tratamento-dispensado-atendimento>-</tratamento-dispensado-atendimento>
</servico>


text:
package org.apache.isis.core.metamodel.interactions;

import org.apache.isis.applib.events.UsabilityEvent;
import org.apache.isis.core.metamodel.facetapi.FacetAbstract.Disabling;

/**
 * Mix-in interface for facets that can advise as to whether a member should be
 * disabled.
 *
 * @see ValidatingInteractionAdvisor
 * @see HidingInteractionAdvisor
 */
public interface DisablingInteractionAdvisor extends InteractionAdvisorFacet, Disabling {

    /**
     * Whether the rule represented by this facet disables the member to which
     * it applies.
     *
     * <p>
     * Implementations should use the provided {@link InteractionContext} to
     * determine whether they disable the member from being modified or used.
     * They must however guard against a <tt>null</tt>
     * {@link InteractionContext#getTarget() target} and
     * {@link InteractionContext#getSession() session} - neither are guaranteed
     * to be populated.
     */
    String disables(final UsabilityContext<? extends UsabilityEvent> ic);

}


text:
package user

import (
	"fmt"

	"k8s.io/apimachinery/pkg/fields"
	runtime "k8s.io/apimachinery/pkg/runtime"
)

func IdentityFieldSelector(obj runtime.Object, fieldSet fields.Set) error {
	identity, ok := obj.(*Identity)
	if !ok {
		return fmt.Errorf("%T not an Identity", obj)
	}
	fieldSet["providerName"] = identity.ProviderName
	fieldSet["providerUserName"] = identity.ProviderUserName
	fieldSet["user.name"] = identity.User.Name
	fieldSet["user.uid"] = string(identity.User.UID)
	return nil
}


text:
import ExternalLink from 'aeonvera/components/links/external-link';

export default ExternalLink.extend({
  layoutName: 'components/links/external-link',
  href: 'https://www.facebook.com/aeonvera',
  icon: 'facebook-official'
});


text:
- [JsBattle Engine Tutorial](./jsbattle_engine_tutorial.md)
- [API Reference](./jsbattle_engine_api.md)


text:
#ifndef EPISODE_GAME_H
#define EPISODE_GAME_H

#include <vector>
#include <map>
#include <string>
#include <iostream>
#include <memory>

#include "gl_helper.h"
#include "episode.h"
#include "asset_helper.h"
#include "defs.h"
#include "messaging.h"
#include "observer.h"
#include "background_game.h"
#include "character.h"
#include "bullet.h"
#include "enemy.h"
#include "explosion.h"
#include "bomb.h"
#include "energy.h"
#include "collision_system.h"

using namespace std;

class episode_game : public episode, public observer
{

private:

	typedef shared_ptr<bullet> bullet_ptr;
	typedef shared_ptr<character> character_ptr;
	typedef shared_ptr<enemy> enemy_ptr;
	typedef shared_ptr<entity> entity_ptr;

	background_game _background;

	character_ptr _character;
	vector <bullet_ptr> _bullets;
	vector <enemy_ptr> _enemies;
	vector <explosion *> _explosions;
	explosion *_character_explosion;
	bomb *_bomb;
	energy *_energy;

	bool _add_bomb;
	bool _kill_all_enemies;
	bool _kill_all_enemies_enable;

	unsigned int _add_bullets;

	collision_system _collision_system;

	// Draws the main character.
	void draw_main_character();

	// Draw all enemies.
	void draw_enemies();

	// Draws all bullets.
	void draw_bullets();

	// Adds enemies, as many as indicated.
	// Params:
	//	batch: Number of enemies to add.
	void add_enemies(int batch);

public:

	episode_game();
	~episode_game();

	virtual void start();
	virtual void stop();
	virtual void pause();
	virtual void update();
	virtual void draw();

	virtual void update(const observable_data &param);

};

#endif /* EPISODE_GAME_H */


text:
source "$(dirname $0)"/../vendor/knative.dev/test-infra/scripts/e2e-tests.sh

export PATH=$PWD:$PATH

dir=$(dirname "${BASH_SOURCE[0]}")
base=$(cd "$dir/.." && pwd)

# Strimzi installation config template used for starting up Kafka clusters.
readonly LOCAL_STRIMZI_INSTALLATION_CONFIG_TEMPLATE="test/config/100-strimzi-cluster-operator-0.20.0.yaml"
# Strimzi installation config.
readonly LOCAL_STRIMZI_INSTALLATION_CONFIG="$(mktemp)"
# Kafka cluster CR config file.
readonly LOCAL_KAFKA_INSTALLATION_CONFIG="test/config/100-kafka-ephemeral-triple-2.6.0.yaml"
readonly LOCAL_KAFKA_TOPIC_INSTALLATION_CONFIG="test/config/100-kafka-topic.yaml"
# Kafka cluster URL for our installation
readonly LOCAL_KAFKA_CLUSTER_URL="my-cluster-kafka-bootstrap.kafka:9092"
# Kafka channel CRD config template directory.
readonly LOCAL_KAFKA_CRD_CONFIG_TEMPLATE_DIR="kafka/channel/config"
# Kafka channel CRD config template file. It needs to be modified to be the real config file.
readonly LOCAL_KAFKA_CRD_CONFIG_TEMPLATE="400-kafka-config.yaml"
# Real Kafka channel CRD config , generated from the template directory and modified template file.
readonly LOCAL_KAFKA_CRD_CONFIG_DIR="$(mktemp -d)"
# Kafka channel CRD config template directory.
readonly LOCAL_KAFKA_SOURCE_CRD_YAML="https://github.com/knative-sandbox/eventing-kafka/releases/download/v0.20.0/source.yaml"

function local_kafka_setup() {
  echo "Installing Kafka cluster"
  kubectl create namespace kafka || return 1
  sed 's/namespace: .*/namespace: kafka/' ${LOCAL_STRIMZI_INSTALLATION_CONFIG_TEMPLATE} > ${LOCAL_STRIMZI_INSTALLATION_CONFIG}
  kubectl apply -f "${LOCAL_STRIMZI_INSTALLATION_CONFIG}" -n kafka
  kubectl apply -f ${LOCAL_KAFKA_INSTALLATION_CONFIG} -n kafka
  kubectl apply -f ${LOCAL_KAFKA_TOPIC_INSTALLATION_CONFIG} -n kafka
  wait_until_pods_running kafka || fail_test "Failed to start up a Kafka cluster"
  return 0
}

function local_kafka_teardown() {
  echo "Uninstalling Kafka cluster"
  kubectl delete -f ${LOCAL_KAFKA_TOPIC_INSTALLATION_CONFIG} -n kafka
  kubectl delete -f ${LOCAL_KAFKA_INSTALLATION_CONFIG} -n kafka
  kubectl delete -f "${LOCAL_STRIMZI_INSTALLATION_CONFIG}" -n kafka
  kubectl delete namespace kafka
}

function local_plugin_test_setup() {
  local_kafka_setup || return 1
  local_install_sources_crds || return 1
  return 0
}

function local_plugin_test_teardown() {
  local_kafka_teardown
  local_uninstall_sources_crds
}

function local_install_sources_crds() {
  echo "Installing Kafka Source CRD"
  kubectl apply -f ${LOCAL_KAFKA_SOURCE_CRD_YAML}

  wait_until_pods_running knative-eventing || fail_test "Failed to install the Kafka Source CRD"
}

function local_uninstall_sources_crds() {
  echo "Uninstalling Kafka Source CRD"
  kubectl delete -f ${LOCAL_KAFKA_SOURCE_CRD_YAML}
}

# Will create and delete this namespace (used for all tests, modify if you want a different one used)
export KN_E2E_NAMESPACE=kne2etests

echo "🧪  Setup"
local_plugin_test_setup
echo "🧪  Testing"
go test ${base}/test/e2e/ -timeout=45m -test.v -tags "e2e ${E2E_TAGS}" "$@"
echo "🧪  Teardown"
local_plugin_test_teardown


text:
<?php
class ControllerModuleAmazonLogin extends Controller {
	public function index() {
		$this->load->model('payment/amazon_login_pay');

		if ($this->config->get('amazon_login_pay_status') && $this->config->get('amazon_login_status') && !$this->customer->isLogged() && !empty($this->request->server['HTTPS'])) {
			// capital L in Amazon cookie name is required, do not alter for coding standards
			if (isset($this->request->cookie['amazon_Login_state_cache'])) {
				setcookie('amazon_Login_state_cache', '', time() - 4815162342);
			}

			$amazon_payment_js = $this->model_payment_amazon_login_pay->getWidgetJs();
			$this->document->addScript($amazon_payment_js);

			$data['amazon_login_pay_client_id'] = $this->config->get('amazon_login_pay_client_id');
			$data['amazon_login_return_url'] = $this->url->link('module/amazon_login/login', '', 'SSL');
			if ($this->config->get('amazon_login_pay_test') == 'sandbox') {
				$data['amazon_login_pay_test'] = true;
			}

			if ($this->config->get('amazon_login_button_type')) {
				$data['amazon_login_button_type'] = $this->config->get('amazon_login_button_type');
			} else {
				$data['amazon_login_button_type'] = 'lwa';
			}

			if ($this->config->get('amazon_login_button_colour')) {
				$data['amazon_login_button_colour'] = $this->config->get('amazon_login_button_colour');
			} else {
				$data['amazon_login_button_colour'] = 'gold';
			}

			if ($this->config->get('amazon_login_button_size')) {
				$data['amazon_login_button_size'] = $this->config->get('amazon_login_button_size');
			} else {
				$data['amazon_login_button_size'] = 'medium';
			}

			if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/amazon_login.tpl')) {
				return $this->load->view($this->config->get('config_template') . '/template/module/amazon_login.tpl', $data);
			} else {
				return $this->load->view('default/template/module/amazon_login.tpl', $data);
			}
		}
	}

	public function login() {
		$this->load->model('payment/amazon_login_pay');
		$this->load->model('account/customer');
		$this->load->model('account/customer_group');
		$this->load->language('payment/amazon_login_pay');

		unset($this->session->data['lpa']);
		unset($this->session->data['access_token']);

		if (isset($this->request->get['access_token'])) {
			$this->session->data['access_token'] = $this->request->get['access_token'];
			$user = $this->model_payment_amazon_login_pay->getUserInfo($this->request->get['access_token']);
		}

		if ((array)$user) {
			if (isset($user->error)) {
				$this->model_payment_amazon_login_pay->logger($user->error . ': ' . $user->error_description);
				$this->session->data['lpa']['error'] = $this->language->get('error_login');
				$this->response->redirect($this->url->link('payment/amazon_login_pay/loginFailure', '', 'SSL'));
			}

			$customer_info = $this->model_account_customer->getCustomerByEmail($user->email);
			$this->model_payment_amazon_login_pay->logger($user);

			if ($customer_info) {
				if ($this->validate($user->email)) {
					unset($this->session->data['guest']);

					$this->load->model('account/address');

					if ($this->config->get('config_tax_customer') == 'payment') {
						$this->session->data['payment_address'] = $this->model_account_address->getAddress($this->customer->getAddressId());
					}

					if ($this->config->get('config_tax_customer') == 'shipping') {
						$this->session->data['shipping_address'] = $this->model_account_address->getAddress($this->customer->getAddressId());
					}

					$this->load->model('account/activity');

					$activity_data = array(
						'customer_id' => $this->customer->getId(),
						'name' => $this->customer->getFirstName() . ' ' . $this->customer->getLastName()
					);

					$this->model_account_activity->addActivity('login', $activity_data);
					$this->model_payment_amazon_login_pay->logger('Customer logged in - ID: ' . $customer_info['customer_id'] . ', Email: ' . $customer_info['email']);
				} else {
					$this->model_payment_amazon_login_pay->logger('Could not login to - ID: ' . $customer_info['customer_id'] . ', Email: ' . $customer_info['email']);
					$this->session->data['lpa']['error'] = $this->language->get('error_login');
					$this->response->redirect($this->url->link('payment/amazon_login_pay/loginFailure', '', 'SSL'));
				}
				$this->response->redirect($this->url->link('account/account', '', 'SSL'));
			} else {
				$country_id = 0;
				$zone_id = 0;

				$full_name = explode(' ', $user->name);
				$last_name = array_pop($full_name);
				$first_name = implode(' ', $full_name);

				$data = array(
					'customer_group_id' => (int)$this->config->get('config_customer_group_id'),
					'firstname' => $first_name,
					'lastname' => $last_name,
					'email' => $user->email,
					'telephone' => '',
					'fax' => '',
					'password' => uniqid(rand(), true),
					'company' => '',
					'address_1' => '',
					'address_2' => '',
					'city' => '',
					'postcode' => '',
					'country_id' => (int)$country_id,
					'zone_id' => (int)$zone_id,
				);

				$customer_id = $this->model_account_customer->addCustomer($data);

				$this->model_payment_amazon_login_pay->logger('Customer ID created: ' . $customer_id);

				if ($this->validate($user->email)) {
					unset($this->session->data['guest']);

					$this->load->model('account/address');

					if ($this->config->get('config_tax_customer') == 'payment') {
						$this->session->data['payment_address'] = $this->model_account_address->getAddress($this->customer->getAddressId());
					}

					if ($this->config->get('config_tax_customer') == 'shipping') {
						$this->session->data['shipping_address'] = $this->model_account_address->getAddress($this->customer->getAddressId());
					}

					$this->load->model('account/activity');

					$activity_data = array(
						'customer_id' => $this->customer->getId(),
						'name' => $this->customer->getFirstName() . ' ' . $this->customer->getLastName()
					);

					$this->model_account_activity->addActivity('login', $activity_data);

					$this->model_payment_amazon_login_pay->logger('Customer logged in - ID: ' . $customer_id . ', Email: ' . $user->email);

					$this->response->redirect($this->url->link('account/account', '', 'SSL'));
				} else {
					$this->model_payment_amazon_login_pay->logger('Could not login to - ID: ' . $customer_id . ', Email: ' . $user->email);

					$this->session->data['lpa']['error'] = $this->language->get('error_login');
					$this->response->redirect($this->url->link('payment/amazon_login_pay/loginFailure', '', 'SSL'));
				}
			}
		} else {
			$this->session->data['lpa']['error'] = $this->language->get('error_login');
			$this->response->redirect($this->url->link('payment/amazon_login_pay/loginFailure', '', 'SSL'));
		}
	}

	public function logout() {
		unset($this->session->data['lpa']);
		unset($this->session->data['access_token']);

		// capital L in Amazon cookie name is required, do not alter for coding standards
		if (isset($this->request->cookie['amazon_Login_state_cache'])) {
			setcookie('amazon_Login_state_cache', '', time() - 4815162342);
		}
	}

	protected function validate($email) {
		if (!$this->customer->login($email, '', true)) {
			$this->error['warning'] = $this->language->get('error_login');
		}

		$customer_info = $this->model_account_customer->getCustomerByEmail($email);

		if ($customer_info && !$customer_info['approved']) {
			$this->error['warning'] = $this->language->get('error_approved');
		}

		if (!$this->error) {
			return true;
		} else {
			return false;
		}
	}
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.search.documents.indexes.models;

import java.util.Objects;

/**
 * This model represents a property bag containing all options for creating or updating a {@link SearchIndexerSkillset
 * skillset}.
 */
public final class CreateOrUpdateSkillsetOptions {
    private final SearchIndexerSkillset skillset;

    private boolean onlyIfUnchanged;
    private Boolean cacheReprocessingChangeDetectionDisabled;
    private Boolean cacheResetRequirementsIgnored;

    /**
     * Creates the property bag used to create or update a {@link SearchIndexerSkillset skillset}.
     *
     * @param skillset The {@link SearchIndexerSkillset skillset} being created or updated.
     * @throws NullPointerException If {@code skillset} is null.
     */
    public CreateOrUpdateSkillsetOptions(SearchIndexerSkillset skillset) {
        this.skillset = Objects.requireNonNull(skillset, "'skillset' cannot be null.");
    }

    /**
     * Gets the {@link SearchIndexerSkillset skillset} that will be created or updated.
     *
     * @return The {@link SearchIndexerSkillset skillset} that will be created or updated.
     */
    public SearchIndexerSkillset getSkillset() {
        return skillset;
    }

    /**
     * Sets the flag that determines whether an update will only occur if the {@link SearchIndexerSkillset skillset} has
     * not been changed since the update has been triggered.
     *
     * @param onlyIfUnchanged Flag that determines whether an update will only occur if the {@link SearchIndexerSkillset
     * skillset} has not been changed since the update has been triggered.
     * @return The updated CreateOrUpdateSkillsetOptions object.
     */
    public CreateOrUpdateSkillsetOptions setOnlyIfUnchanged(boolean onlyIfUnchanged) {
        this.onlyIfUnchanged = onlyIfUnchanged;
        return this;
    }

    /**
     * Gets the flag that determines whether an update will only occur if the {@link SearchIndexerSkillset skillset} has
     * not been changed since the update has been triggered.
     *
     * @return Whether an update will only occur if the {@link SearchIndexerSkillset skillset} has not been changed
     * since the update has been triggered.
     */
    public boolean isOnlyIfUnchanged() {
        return onlyIfUnchanged;
    }

    /**
     * Sets an optional flag that determines whether the created or updated {@link SearchIndexerSkillset skillset}
     * disables cache reprocessing change detection.
     *
     * @param cacheReprocessingChangeDetectionDisabled An optional flag that determines whether the created or updated
     * {@link SearchIndexerSkillset skillset} disables cache reprocessing change detection.
     * @return The updated CreateOrUpdateSkillsetOptions object.
     */
    public CreateOrUpdateSkillsetOptions setCacheReprocessingChangeDetectionDisabled(
        Boolean cacheReprocessingChangeDetectionDisabled) {
        this.cacheReprocessingChangeDetectionDisabled = cacheReprocessingChangeDetectionDisabled;
        return this;
    }

    /**
     * Gets an optional flag that determines whether the created or updated {@link SearchIndexerSkillset skillset}
     * disables cache reprocessing change detection.
     *
     * @return Whether the created or updated {@link SearchIndexerSkillset skillset} disables cache reprocessing change
     * detection.
     */
    public Boolean isCacheReprocessingChangeDetectionDisabled() {
        return cacheReprocessingChangeDetectionDisabled;
    }

    /**
     * Sets an optional flag that determines whether the created or updated {@link SearchIndexerSkillset skillset}
     * ignores cache reset requirements.
     *
     * @param cacheResetRequirementsIgnored An optional flag that determines whether the created or updated {@link
     * SearchIndexerSkillset skillset} ignores cache reset requirements.
     * @return The updated CreateOrUpdateSkillsetOptions object.
     */
    public CreateOrUpdateSkillsetOptions setCacheResetRequirementsIgnored(Boolean cacheResetRequirementsIgnored) {
        this.cacheResetRequirementsIgnored = cacheResetRequirementsIgnored;
        return this;
    }

    /**
     * Gets an optional flag that determines whether the created or updated {@link SearchIndexerSkillset skillset}
     * ignores cache reset requirements.
     *
     * @return Whether the created or updated {@link SearchIndexerSkillset skillset} ignores cache reset requirements.
     */
    public Boolean isCacheResetRequirementsIgnored() {
        return cacheResetRequirementsIgnored;
    }
}


text:
    //
//  CronTableViewController.m
//  heroku
//
//  Created by Aaron Brethorst on 7/26/10.
//  Copyright 2010 Structlab LLC. All rights reserved.
//

#import "CronTableViewController.h"
#import "LogsViewController.h"

@interface CronTableViewController ()
- (void)populateTable;
@end

@implementation CronTableViewController

- (void)viewDidLoad
{
	[super viewDidLoad];
	[self populateTable];
}

- (void)populateTable
{
	if (nil == self.app.cronNextRun && nil == self.app.cronFinishedAt)
	{
		HKTableSection* section = [HKTableSection sectionWithTitle:@"Cron is not configured."];
		[self.appDetails addObject:section];
	}
	else
	{
		HKTableSection* section = [HKTableSection sectionWithTitle:@"Cron"];

		NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
		[formatter setDateStyle:NSDateFormatterShortStyle];
		[formatter setTimeStyle:NSDateFormatterShortStyle];

		if (self.app.cronNextRun)
		{
			[section.rows addObject:[HKTableRow rowWithTitle:@"Next run" value:[formatter stringFromDate:self.app.cronNextRun] target:nil action:nil]];
		}
		if (self.app.cronFinishedAt)
		{
			[section.rows addObject:[HKTableRow rowWithTitle:@"Last finished" value:[formatter stringFromDate:self.app.cronFinishedAt] target:nil action:nil]];
		}

		[section.rows addObject:[HKTableRow rowWithTitle:@"Logs" value:nil target:self action:@selector(cronLogs:)]];
		[self.appDetails addObject:section];
	}

	[self.tableView reloadData];
}

- (IBAction)cronLogs:(id)sender
{
	LogsViewController *logs = [[LogsViewController alloc] init];
	logs.herokuSelector = @selector(cronLogs:);
	logs.app = self.app;
	logs.title = NSLocalizedString(@"Cron Logs",@"");
	[self.parent.navigationController pushViewController:logs animated:YES];
}

@end


text:
/**
 * Тулбар для редактора тела книги.
 *
 * @author dew1983@mail.ru <Suvorov Andrey M.>
 */

Ext.define(
	'FBEditor.view.panel.main.editor.toolbar.Toolbar',
	{
		extend: 'FBEditor.editor.view.toolbar.Toolbar',
		requires: [
			'FBEditor.view.panel.main.editor.button.a.A',
			'FBEditor.view.panel.main.editor.button.annotation.Annotation',
			'FBEditor.view.panel.main.editor.button.blockquote.Blockquote',
			'FBEditor.view.panel.main.editor.button.code.Code',
			'FBEditor.view.panel.main.editor.button.div.Div',
			'FBEditor.view.panel.main.editor.button.em.Em',
			'FBEditor.view.panel.main.editor.button.epigraph.Epigraph',
			'FBEditor.view.panel.main.editor.button.img.Img',
			'FBEditor.view.panel.main.editor.button.note.Note',
			'FBEditor.view.panel.main.editor.button.notebody.Notebody',
			'FBEditor.view.panel.main.editor.button.notes.Notes',
			'FBEditor.view.panel.main.editor.button.ol.Ol',
			'FBEditor.view.panel.main.editor.button.poem.Poem',
			'FBEditor.view.panel.main.editor.button.pre.Pre',
			'FBEditor.view.panel.main.editor.button.section.Section',
            'FBEditor.view.panel.main.editor.button.smallcaps.Smallcaps',
			'FBEditor.view.panel.main.editor.button.spacing.Spacing',
			'FBEditor.view.panel.main.editor.button.span.Span',
            'FBEditor.view.panel.main.editor.button.splitsection.SplitSection',
            'FBEditor.view.panel.main.editor.button.splitelement.SplitElement',
			'FBEditor.view.panel.main.editor.button.strikethrough.Strikethrough',
			'FBEditor.view.panel.main.editor.button.strong.Strong',
			'FBEditor.view.panel.main.editor.button.sub.Sub',
			'FBEditor.view.panel.main.editor.button.subscription.Subscription',
			'FBEditor.view.panel.main.editor.button.subtitle.Subtitle',
			'FBEditor.view.panel.main.editor.button.sup.Sup',
			'FBEditor.view.panel.main.editor.button.table.Table',
			'FBEditor.view.panel.main.editor.button.title.Title',
			'FBEditor.view.panel.main.editor.button.titlebody.TitleBody',
			'FBEditor.view.panel.main.editor.button.ul.Ul',
			'FBEditor.view.panel.main.editor.button.underline.Underline',
            'FBEditor.view.panel.main.editor.button.unstyle.Unstyle',
			'FBEditor.view.panel.main.editor.toolbar.responsive.button.Button',
			'FBEditor.view.panel.main.editor.toolbar.ToolbarController'
		],

		xtype: 'main-editor-toolbar',
		controller: 'main.editor.toolbar',

		listeners: {
			resize: 'onResize',
			syncHiddenButtons: 'onSyncHiddenButtons'
		},

		/**
		 * @property {Object} Адаптивные размеры, в зависимости от которых, отображается нужное количество кнопок на
		 * панели.
		 * Каждый размер предсталвяет собой минимальную ширину панели, при которой на ней помещается определенная
		 * группа кнопок.
		 */
		responsiveSizes: {
			group1: 480, // помещается только первая группа кнопок (деление на группы условно)
			group2: 780, // помещается первая и вторая группа кнопок
			group3: 1010, // и т.д.
			fit: 1390 // все кнопки помещаются
		},

		/**
		 * @private
		 * @property {FBEditor.view.panel.main.editor.toolbar.responsive.button.Button} Адаптивная кнопка.
		 */
		responsiveBtn: null,

		/**
		 * @private
		 * @property {Number} Текущий адаптивный размер из #responsiveSizes
		 * Используется для определения необходимости обновления кнопок на панели.
		 */
		currentResponsiveSize: null,

		/**
		 * @private
		 * @property {Object[]} Список видимых кнопок.
		 */
		visibleButtons: null,

		createSyncButtons: function ()
		{
			var me = this;

			me.syncButtons = [
				'main-editor-button-notes',
				'main-editor-button-notebody',
				'main-editor-button-titlebody',
				'main-editor-button-section',
                'main-editor-button-splitsection',
                'main-editor-button-splitelement',
				'main-editor-button-title',
				'main-editor-button-epigraph',
				'main-editor-button-annotation',
				'main-editor-button-subscription',
				'main-editor-button-div',
				'main-editor-button-subtitle',
				/*{
					sequence: [
						'main-editor-button-div',
						'main-editor-button-subtitle'
					]
				},*/
				'main-editor-button-blockquote',
				'main-editor-button-pre',
				'main-editor-button-poem',
				'main-editor-button-ul',
				'main-editor-button-ol',
				'main-editor-button-table',
				'main-editor-button-img',
				'main-editor-button-a',
				'main-editor-button-note',
				'main-editor-button-strong',
				'main-editor-button-em',
				'main-editor-button-underline',
				'main-editor-button-strikethrough',
				'main-editor-button-spacing',
				'main-editor-button-sub',
				'main-editor-button-sup',
				'main-editor-button-code',
                'main-editor-button-span',
                'main-editor-button-smallcaps',
                'main-editor-button-unstyle'
			];
		},

        linkHotkeys: function ()
        {
            var me = this;

            me.hotkeys = [
				{
					xtype: 'main-editor-button-notes',
                    numberSlot: 1
                },
				{
                    xtype: 'main-editor-button-notebody',
                    numberSlot: 2
                },
				{
                    xtype: 'main-editor-button-titlebody',
                    numberSlot: 3
                },
				{
                    xtype: 'main-editor-button-section',
                    numberSlot: 4
                },
				{
                    xtype: 'main-editor-button-title',
                    numberSlot: 5
                },
				{
                    xtype: 'main-editor-button-epigraph',
                    numberSlot: 6
                },
				{
                    xtype: 'main-editor-button-annotation',
                    numberSlot: 7
                },
				{
                    xtype: 'main-editor-button-subscription',
                    numberSlot: 8
                },
				{
                    xtype: 'main-editor-button-div',
                    numberSlot: 9
                },
				{
                    xtype: 'main-editor-button-subtitle',
                    numberSlot: 10
                },
				{
                    xtype: 'main-editor-button-blockquote',
                    numberSlot: 11
                },
				{
                    xtype: 'main-editor-button-pre',
                    numberSlot: 12
                },
				{
                    xtype: 'main-editor-button-poem',
                    numberSlot: 13
                },
				{
                    xtype: 'main-editor-button-ul',
                    numberSlot: 14
                },
				{
                    xtype: 'main-editor-button-ol',
                    numberSlot: 15
                },
				{
                    xtype: 'main-editor-button-img',
                    numberSlot: 16
                },
				{
                    xtype: 'main-editor-button-a',
                    numberSlot: 17
                },
				{
                    xtype: 'main-editor-button-note',
                    numberSlot: 18
                },
				{
                    xtype: 'main-editor-button-strong',
                    numberSlot: 19
                },
				{
                    xtype: 'main-editor-button-em',
                    numberSlot: 20
                },
				{
                    xtype: 'main-editor-button-underline',
                    numberSlot: 21
                },
				{
                    xtype: 'main-editor-button-strikethrough',
                    numberSlot: 22
                },
				{
                    xtype: 'main-editor-button-spacing',
                    numberSlot: 23
                },
				{
                    xtype: 'main-editor-button-sub',
                    numberSlot: 24
                },
				{
                    xtype: 'main-editor-button-sup',
                    numberSlot: 25
                },
				{
                    xtype: 'main-editor-button-code',
                    numberSlot: 26
                },
				{
                    xtype: 'main-editor-button-span',
                    numberSlot: 27
                },
				{
                    xtype: 'main-editor-button-unstyle',
                    numberSlot: 28
                },
                {
                    xtype: 'main-editor-button-smallcaps',
                    numberSlot: 29
                },
                {
                    xtype: 'main-editor-button-splitsection',
                    numberSlot: 30
                },
                {
                    xtype: 'main-editor-button-splitelement',
                    numberSlot: 31
                }
            ];
        },

		getButton: function (name)
		{
			var me = this,
				btn,
				xtype;

			xtype = 'main-editor-button-' + name;
			btn = Ext.ComponentQuery.query(xtype)[0];

			return btn;
		},

		/**
		 * Обновляет кнопки на панели.
		 * При необходимости формирует их положение адаптивно, скрывая непомещающиеся кнопки в адаптивной кнопке.
		 */
		updateButtons: function ()
		{
			var me = this,
				visibleButtons;

			if (me.needUpdateButtons())
			{
				// получаем кнопки, которые будут отображены на панели
				visibleButtons = me.getVisibleButtons();

				// удаляем кнопки (в старом расположении)
				me.removeAll();

				// добавляем кнопки (в новом расположении)
				me.add(visibleButtons);
			}
		},

		/**
		 * Возвращает скрытые кнопки, которые не поместились на панели.
		 * @return {Object[]}
		 */
		getHiddenButtons: function ()
		{
			var me = this,
				buttons = me.getSyncButtons(),
				hiddenButtons = [];

			// если кнопка из общего списка не доступна, то значит она сркыта
			Ext.each(
				buttons,
				function (item)
				{
					var btn;

					if (Ext.isObject(item) && item.sequence)
					{
						Ext.each(
							item.sequence,
							function (itemSeq)
							{
								btn = Ext.ComponentQuery.query(itemSeq)[0];

								if (!btn || btn.hidden)
								{
									if (!btn)
									{
										btn = Ext.widget(itemSeq);
										btn.setToolbar(me);
									}

									hiddenButtons.push(btn);
								}
							}
						);
					}
					else
					{
						btn = Ext.ComponentQuery.query(item)[0];

						//console.log('hiddenbtn', Ext.ComponentQuery.query(item));

						if (!btn || btn.hidden)
						{
							if (!btn)
							{
								btn = Ext.widget(item);
								btn.setToolbar(me);
							}

							hiddenButtons.push(btn);
						}
					}
				}
			);

			hiddenButtons = hiddenButtons.length ? hiddenButtons : null;

			return hiddenButtons;
		},

		/**
		 * Устанавливает связь с адаптивной кнопкой.
		 * @param {FBEditor.view.panel.main.editor.toolbar.responsive.button.Button} btn
		 */
		setResponsiveButton: function (btn)
		{
			var me = this;

			me.responsiveBtn = btn;
		},

		/**
		 * Возвращает адаптивную кнпоку.
		 * @return {FBEditor.view.panel.main.editor.toolbar.responsive.button.Button}
		 */
		getResponsiveButton: function ()
		{
			var me = this,
				btn;

			btn = me.responsiveBtn || Ext.widget('main-editor-toolbar-responsive-button');
			me.responsiveBtn = btn;

			// устанавливаем связб
			btn.setToolbar(me);

			return btn;
		},

		/**
		 * @private
		 * Возвращает кнопки, которые помещаются на панели.
		 * @return {Object[]}
		 */
		getVisibleButtons: function ()
		{
			var me = this,
				responsiveSizes = me.responsiveSizes,
				bodyWidth = Ext.getBody().getWidth(),
				responsiveBtn,
				spacer,
				buttons;

			// сбрасываем текущий сохраненный адаптивный размер
			me.currentResponsiveSize = null;

			// отступ между группами кнопок на панели
			spacer = me.getSpacer();

			// кнопки, которые всегда помещаются на панели
			buttons = [
				{
					xtype: 'main-editor-button-notes'
				},
				{
					xtype: 'main-editor-button-notebody'
				},
				spacer,
				{
					xtype: 'main-editor-button-titlebody'
				},
				{
					xtype: 'main-editor-button-section'
				},
                {
                    xtype: 'main-editor-button-splitsection'
                },
                {
                    xtype: 'main-editor-button-splitelement'
                },
				spacer
			];

			if (bodyWidth >= responsiveSizes.group1)
			{
				// сохраняем текущий адаптивный размер
				me.currentResponsiveSize = responsiveSizes.group1;

				Ext.Array.push(
					buttons,
					[
						spacer,
						{
							xtype: 'main-editor-button-title'
						},
						{
							xtype: 'main-editor-button-epigraph'
						},
						{
							xtype: 'main-editor-button-annotation'
						},
						{
							xtype: 'main-editor-button-subscription'
						}
					]
				);
			}

			if (bodyWidth >= responsiveSizes.group2)
			{
				me.currentResponsiveSize = responsiveSizes.group2;

				Ext.Array.push(
					buttons,
				    [
					    spacer,
					    {
						    xtype: 'main-editor-button-div'
					    },
					    {
						    xtype: 'main-editor-button-subtitle'
					    },
					    {
						    xtype: 'main-editor-button-blockquote'
					    },
					    {
						    xtype: 'main-editor-button-pre'
					    },
					    {
						    xtype: 'main-editor-button-poem'
					    },
					    {
						    xtype: 'main-editor-button-ul'
					    },
					    {
						    xtype: 'main-editor-button-ol'
					    }
				    ]
				);
			}

			if (bodyWidth >= responsiveSizes.group3)
			{
				me.currentResponsiveSize = responsiveSizes.group3;

				Ext.Array.push(
					buttons,
					[
						spacer,
						{
							xtype: 'main-editor-button-table'
						},
						spacer,
						{
							xtype: 'main-editor-button-img'
						},
						{
							xtype: 'main-editor-button-a'
						},
						{
							xtype: 'main-editor-button-note'
						}
					]
				);
			}

			if (bodyWidth >= responsiveSizes.fit)
			{
				me.currentResponsiveSize = responsiveSizes.fit;

				Ext.Array.push(
					buttons,
					[
						spacer,
						{
							xtype: 'main-editor-button-strong'
						},
						{
							xtype: 'main-editor-button-em'
						},
						{
							xtype: 'main-editor-button-underline'
						},
						{
							xtype: 'main-editor-button-strikethrough'
						},
						{
							xtype: 'main-editor-button-spacing'
						},
						{
							xtype: 'main-editor-button-sub'
						},
						{
							xtype: 'main-editor-button-sup'
						},
						{
							xtype: 'main-editor-button-code'
						},
						{
							xtype: 'main-editor-button-span'
						},
                        {
                            xtype: 'main-editor-button-smallcaps'
                        },
                        {
                            xtype: 'main-editor-button-unstyle'
                        }
					]
				);
			}
			else
			{
				// адаптивная кнопка
				me.setResponsiveButton(null);
				responsiveBtn = me.getResponsiveButton();

				// последний разделитель делаем растягивающимся, чтобы адаптивная кнопка поместилась в конец панели
				buttons.push(
					{
						xtype: 'tbspacer',
						flex: 1
					}
				);

				// добавляем кнопку
				buttons.push(responsiveBtn);
			}

			// сохраняем список видимых кнопок, чтобы в дальнейшем определить списко невидимых
			me.visibleButtons = buttons;

			return buttons;
		},

		/**
		 * @private
		 * Возвращает отступ между кнопками на панели.
		 * @return {Object}
		 */
		getSpacer: function ()
		{
			var me = this,
				spacer;

			spacer = {
				xtype: 'tbspacer',
				width: 20
			};

			return spacer;
		},

		/**
		 * @private
		 * Определяет нужно ли обновлять кнопки на панели.
		 * @return {Boolean}
		 */
		needUpdateButtons: function ()
		{
			var me = this,
				responsiveSizes = me.responsiveSizes,
				bodyWidth = Ext.getBody().getWidth(),
				currentResponsiveSize = me.currentResponsiveSize,
				responsiveSize = null,
				need;

			responsiveSize = bodyWidth >= responsiveSizes.group1 ? responsiveSizes.group1 : responsiveSize;
			responsiveSize = bodyWidth >= responsiveSizes.group2 ? responsiveSizes.group2 : responsiveSize;
			responsiveSize = bodyWidth >= responsiveSizes.group3 ? responsiveSizes.group3 : responsiveSize;
			responsiveSize = bodyWidth >= responsiveSizes.fit ? responsiveSizes.fit : responsiveSize;

			need = responsiveSize !== currentResponsiveSize;

			return need;
		}
	}
);


text:
// import Promise from 'bluebird';
const mongoose = require('mongoose');
const httpStatus = require('http-status');
const APIError = require('../helpers/APIError');

const Schema = mongoose.Schema;

/**
 * Group Schema
 */
const GroupSchema = new Schema({
  host_id: {
    type: Schema.Types.ObjectId,
    ref: 'User'
	},
  memberCounter: {
    type: Number
  },
  followerCounter: {
    type: Number
  },
	invitations_id: [{
		type: Schema.Types.ObjectId,
		ref: 'User'
	}],
  invitationCounter: {
    type: Number
  },
	name: {
		type: String
	},
  icon: {
    type: Schema.Types.ObjectId,
    ref: 'FsFile',
    default: null
  },
	isPublic: Boolean,
	authentication: {
		isAuthenticated: Boolean,
		identity: {
			type: Schema.Types.ObjectId
		}
	}
	// mute: {
	// 	start: Date,
	// 	duration: Number
	// }
});

/**
 * @typedef Group
 */
module.exports = mongoose.model('Group', GroupSchema, 'groups');


text:
({
    paths: {
        mascherl: '${project.build.outputDirectory}/META-INF/resources/mascherl/1.0.0/js/mascherl',
        jquery: '${project.build.directory}/webjars/META-INF/resources/webjars/jquery/2.1.3/jquery.min',
        history: '${project.build.directory}/webjars/META-INF/resources/webjars/historyjs/1.8.0/scripts/bundled/html5/jquery.history'
    },
    shim: {
        history: {
            deps: ['jquery'],
            exports: 'History'
        }
    },
    baseUrl: '${project.build.sourceDirectory}/../resources/META-INF/resources/mascherl/1.0.0/js',
    deps: ['mascherl'],
    wrapShim: false,
    optimize: 'uglify2'
})


text:
<?php

namespace Formativ\Embedded;

use Evenement\EventEmitter;
use Illuminate\Support\ServiceProvider;

class EmbeddedServiceProvider
extends ServiceProvider
{
  protected $defer = true;

  public function register()
  {
    $this->app->bind("formativ.embedded.emitter", function()
    {
      return new EventEmitter();
    });

    $this->app->bind("formativ.embedded.command.serve", function()
    {
      return new Command\Serve(
        $this->app->make("formativ.embedded.socket")
      );
    });

    $this->app->bind("formativ.embedded.socket", function()
    {
      return new Socket(
        $this->app->make("formativ.embedded.emitter")
      );
    });

    $this->commands(
      "formativ.embedded.command.serve"
    );
  }

  public function provides()
  {
    return [
      "formativ.embedded.emitter",
      "formativ.embedded.command.serve",
      "formativ.embedded.socket"
    ];
  }
}


text:
namespace content {

class CONTENT_EXPORT AudioInputMessageFilter
    : public IPC::ChannelProxy::MessageFilter,
      public NON_EXPORTED_BASE(media::AudioInputIPC) {
 public:
  AudioInputMessageFilter();

  // Getter for the one AudioInputMessageFilter object.
  static AudioInputMessageFilter* Get();

  // Implementation of AudioInputIPC.
  virtual int AddDelegate(
      media::AudioInputIPCDelegate* delegate) OVERRIDE;
  virtual void RemoveDelegate(int id) OVERRIDE;
  virtual void CreateStream(int stream_id, const media::AudioParameters& params,
      const std::string& device_id, bool automatic_gain_control) OVERRIDE;
  virtual void StartDevice(int stream_id, int session_id) OVERRIDE;
  virtual void RecordStream(int stream_id) OVERRIDE;
  virtual void CloseStream(int stream_id) OVERRIDE;
  virtual void SetVolume(int stream_id, double volume) OVERRIDE;

 private:
  virtual ~AudioInputMessageFilter();

  // Sends an IPC message using |channel_|.
  bool Send(IPC::Message* message);

  // IPC::ChannelProxy::MessageFilter override. Called on IO thread.
  virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
  virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE;
  virtual void OnFilterRemoved() OVERRIDE;
  virtual void OnChannelClosing() OVERRIDE;

  // Received when browser process has created an audio input stream.
  void OnStreamCreated(int stream_id, base::SharedMemoryHandle handle,
#if defined(OS_WIN)
                       base::SyncSocket::Handle socket_handle,
#else
                       base::FileDescriptor socket_descriptor,
#endif
                       uint32 length);

  // Notification of volume property of an audio input stream.
  void OnStreamVolume(int stream_id, double volume);

  // Received when internal state of browser process' audio input stream has
  // changed.
  void OnStreamStateChanged(int stream_id,
                            media::AudioInputIPCDelegate::State state);

  // Notification of the opened device of an audio session.
  void OnDeviceStarted(int stream_id, const std::string& device_id);

  // A map of stream ids to delegates.
  IDMap<media::AudioInputIPCDelegate> delegates_;

  IPC::Channel* channel_;

  // The singleton instance for this filter.
  static AudioInputMessageFilter* filter_;

  DISALLOW_COPY_AND_ASSIGN(AudioInputMessageFilter);
};

}  // namespace content

#endif  // CONTENT_RENDERER_MEDIA_AUDIO_INPUT_MESSAGE_FILTER_H_


text:
aCarousel = {
	config: {
		defaults: {
			view: 'normal',
			max: 10
		},
		paginate: false
	},
	$: {},
	instances: {},
	last_id: 0,
	widgetize: function(jcont,opts){
		var z = this;
		var id = z.last_id++;
		z.instances[id] = {
			$:{cont:jcont},
			opts: $.extend({},z.config.defaults,opts)
		};
		z.insertWidget(id);
	},
	insertWidget: function(id) {
		var z = this;

		var instance = z.instances[id];
		instance.id = id;

		var itemsHTML = instance.$.cont.clone(true);

		var myHTML = '
'
			+ (instance.opts.title ? '
'+instance.opts.title+'
' : '')
			+ '
'
				+ ''
					+ '
'
						+ '
'
						+ '
'
					+ '
'
				+ ''
			+ '
'
		+ '
';

		instance.$.cont.html(myHTML);
		instance.$.cont.attr('x-data-id',id).addClass('aCarousel aCarousel-id-'+instance.opts.cid);
		instance.$.cont.current_item = 0;

		instance.$.cont.find('.cItems-content').append(itemsHTML);

		z.renderView(instance);

		/*if (instance.opts.expanded == true) {
			instance.$.cont.find('.cItems-inner').css('display','block');
			instance._visible = false;
			Trends.getTrends(id,instance);
		}
		else {
			instance.$.cont.find('.cItems-inner').css('display','none');
			instance._visible = true;
		}

		instance.$.cont.find('a.cTitle').bind('click',function(e){
			e.preventDefault();
			if (instance.opts.collapseable) {
				var t = $(this).parent().parent();
				if (instance._visible == true) {
					t.find('.cItems-inner').slideDown();
					instance._visible = false;
					if (instance.opts.expanded == false) {
						instance.opts.expanded = true;
						Trends.getTrends(id,instance);
					}
				} else {
					t.find('.cItems-inner').slideUp();
					instance._visible = true;
				}
			}
		});	*/
	},
	renderView: function(instance) {
		var z = this,
		item_dimensions,
		item_spacing,
		scale_amount,
		positionX,
		positionY,
		itemWidth,
		itemHeight,
		itemCenterHTML,
		itemContainer,
		sliderWidth,
		last_item,
		slide_distance,
		itemNumber,
		itemInfo = {};

		itemContainer = instance.$.cont.find('.cItems-content');
		instance.isAnimating = false;
		myZ = 100;
		itemNumber = 0;
		instance.$.cont.find('.cItem').each(function(index) {

			item_dimensions = z.getElementRealDims($(this));
			itemNumber++;

			switch(instance.opts.view) {
				case '3d':
					//instance.item_spacing = 50;
					instance.scale_amount = 0.2;
					slide_distance = 1;
					if (index == 0) {
						instance.first_item = instance.$.cont.find(".cItem:eq(0)");
						instance.first_item_dimensions = z.getElementRealDims(instance.first_item);
						instance.first_itemX = instance.first_item.position().top + (instance.first_item_dimensions.w/2);
						instance.first_itemY = instance.first_item.position().left + (instance.first_item_dimensions.h/2);
					}
					itemInfo = z.getItem(instance,index);
					if (itemNumber > 1) {
						$(this).addClass("cItem2");
						$(this).find('.cItemName').addClass("cItemName2");
						$(this).find('.cItemRank').addClass("cItemRank2");
						$(this).find('.cItemButton').addClass("cItemButton2");
					}
				break;
				case 'normal':
					item_spacing = instance.opts.item_spacing;
					slide_distance = instance.opts.slide_distance;
					itemInfo.width = item_dimensions.w;
					itemInfo.height = item_dimensions.h;
					itemInfo.x = (itemInfo.width/2) + (index * itemInfo.width) + (index * item_spacing);
					itemInfo.y = itemInfo.height/2;
					//instance.$.cont.find('.prev').css('visibility','hidden');
				break;
				default:
				break;
			}

			//For Testing
			/*itemCenterHTML = '
x
';
			itemContainer.append(itemCenterHTML);
			itemContainer.find('.itemCenter-'+index).css('position','absolute');
			itemContainer.find('.itemCenter-'+index).css('left',itemInfo.x+'px');
			itemContainer.find('.itemCenter-'+index).css('top',itemInfo.y+'px');*/
			//End For Testing

			z.renderItem($(this),itemInfo);
			myZ--;
			if (instance.opts.view == '3d') {
				$(this).css('z-index',myZ);
			}
		});

		//SET WIDTH OF ITEMS CONTENT HOLDER
		sliderWidth = positionX + (itemWidth/2) + item_spacing;
		instance.$.cont.find('.cItems-content').css('width',sliderWidth);

		//SLIDE FORWARD
		instance.$.cont.find('.next').bind('click',function(e) {
			e.preventDefault();

			var scroll_forward = function() {
				if (((instance.$.cont.current_item + slide_distance) < (instance.opts.max)) && instance.isAnimating == false)	{
					z.slide(instance,'forward',slide_distance);
				}
			}

			if (z.config.paginate) {
				if (instance.opts.view == '3d') {
					if (((instance.$.cont.current_item) < (instance.opts.max-10)) && instance.isAnimating == false)	{
						z.slide(instance,'forward',slide_distance);
					} else {
						//alert('get more items');
						var options = {
							option_id: instance.opts.option_id,
							offset: instance.opts.max
						}
						Trends.getMoreTrends(options,instance.$.cont,instance.id);
						z.slide(instance,'forward',slide_distance);
					}
				} else {
					scroll_forward();
				}
			} else {
				scroll_forward();
			}

		});

		//SLIDE BACKWARD
		instance.$.cont.find('.prev').bind('click',function(e) {
			e.preventDefault();
			if (((instance.$.cont.current_item - slide_distance) > -1) && instance.isAnimating == false) {
				z.slide(instance,'backward',slide_distance);
			}

		});
	},
	addNewItems: function(id) {
		var z = this, new_item, move_item, item_info;

		//console.log('addNewItems');

		var myZ = 100;

		var instance = z.instances[id];

		instance.$.cont.find('.cItem').each(function(index) {

			myZ--;

			if (index > (instance.opts.max-1)) {

				move_item = instance.$.cont.find('.cItem:eq('+(index)+')');

				new_item = move_item.clone(true);
				move_item.remove();

				instance.$.cont.find('.cItems-content').append(new_item);

				new_item.addClass("cItem2");
				new_item.find('.cItemName').addClass("cItemName2");
				new_item.find('.cItemRank').addClass("cItemRank2");
				new_item.find('.cItemButton').addClass("cItemButton2");

				new_item.find('.cItemRank').html(index+1);

				item_info = z.getItem(instance,index-1);
				z.renderItem(new_item,item_info);

				if (instance.opts.view == '3d') {
					new_item.css('z-index',myZ);
				}

			} else {
				if (instance.opts.view == '3d') {
					instance.$.cont.find('.cItem:eq('+(index)+')').css('z-index',myZ);
				}
			}

		});

		instance.opts.max+= 10;
	},
	renderItem: function(item,itemInfo) {
		var z = this;
		itemInfo.x = itemInfo.x - (itemInfo.width/2);
		itemInfo.y = itemInfo.y - (itemInfo.height/2);
		item.css('width',itemInfo.width+'px');
		item.css('height',itemInfo.height+'px');
		item.css('left',itemInfo.x+'px');
		item.css('top',itemInfo.y+'px');
	},
	slideTo: function(id) {
		var z = this;
		var instance = z.instances[z.last_id-1];
		var slide_distance = id - instance.$.cont.current_item;

		//alert(slide_distance);

		z.slide(instance,'forward',slide_distance);
	},
	getItem: function(instance,index) {
		var z = this, ItemInfo = {}, scaleAmount;
		switch(instance.opts.view) {
			case '3d':
				scaleAmount = 1+(index*instance.scale_amount);
				ItemInfo.width  = instance.first_item_dimensions.w / scaleAmount;
				ItemInfo.height = instance.first_item_dimensions.h / scaleAmount;
				ItemInfo.x = (instance.first_item_dimensions.w/2) + (ItemInfo.width * index);
				ItemInfo.y = instance.first_itemY;
			break;
		}
		return ItemInfo;
	},
	slide: function(instance,direction,slide_distance) {
		var z = this,
		okToSlide,
		animateItem,
		animIndex,
		slideIndex,
		last_item,
		ItemInfo = {};

		/*if (instance.$.cont.current_item + slide_distance == instance.opts.max) {
			instance.$.cont.find('.next').css('visibility','hidden');
		} else {
			instance.$.cont.find('.next').css('visibility','visible');
		}
		if (instance.$.cont.current_item - slide_distance < 0) {
			instance.$.cont.find('.prev').css('visibility','hidden');
		} else {
			instance.$.cont.find('.prev').css('visibility','visible');
		}*/

		if (direction == 'backward') {
			slide_distance = -(slide_distance);
		}

		if (instance.opts.view == 'normal') {

			okToSlide = true;

			var SlideMe = instance.$.cont.find('.cItems-content');
			var slideToItem = instance.$.cont.find('.cItem:eq('+(instance.$.cont.current_item + slide_distance)+')');

			var visibleAreaWidth = z.getElementRealDims(instance.$.cont.find('.cItems-content-outer')).w;
			visibleAreaWidth -= z.getElementRealDims(slideToItem).w;

			var maxSlide = parseInt(SlideMe.css('width')) - visibleAreaWidth;

			last_item = instance.$.cont.find('.cItem:eq('+(instance.$.cont.numberItems-2)+')');

			if (slideToItem.length > 0) {
				var SlideToX = parseInt(slideToItem.css('left'),10);
				/*if (SlideToX < maxSlide) {
					okToSlide = true;
				}
				if (direction == 'forward') {
					if ((parseInt(last_item.css('left'),10)-parseInt(last_item.css('width'),10)) < visibleAreaWidth)	{
						okToSlide = false;
					}
				}*/
			}
			else {
				okToSlide = false;
			}

			//console.log('okToSlide:'+okToSlide);
		}
		else {
			okToSlide = true;
		}

		if (okToSlide) {
			switch(instance.opts.view) {
				case '3d':
					//console.log('CurrentItem:'+instance.$.cont.current_item);
					instance.$.cont.find('.cItem').each(function(index) {
						animateItem = instance.$.cont.find('.cItem:eq('+(index)+')');
						animateItem.addClass("cItem2");
						animateItem.find('.cItemName').addClass("cItemName2");
						animateItem.find('.cItemRank').addClass("cItemRank2");
						animateItem.find('.cItemButton').addClass("cItemButton2");
						animIndex = index + -(slide_distance);
						slideIndex = -(instance.$.cont.current_item) + index + -(slide_distance);
						ItemInfo = z.getItem(instance,slideIndex);
						if ((slideIndex > -1)) {
							instance.isAnimating = true;
							animateItem.animate({
						    	width: ItemInfo.width,
						    	height: ItemInfo.height,
						    	left: ItemInfo.x - (ItemInfo.width/2),
						    	top: ItemInfo.y - (ItemInfo.height/2)
						    },instance.opts.animSpeed,function() {
						    	instance.isAnimating = false;
						    });
						}
						if (slideIndex < 0) {
							//animateItem.css('visibility','hidden');
							animateItem.animate({
						    	left: -(instance.first_item_dimensions.w+(instance.first_item_dimensions.w/2)),
						    },instance.opts.animSpeed);
						}
						if (animIndex == instance.$.cont.current_item) {
							animateItem.removeClass("cItem2");
							animateItem.find('.cItemName').removeClass("cItemName2");
							animateItem.find('.cItemRank').removeClass("cItemRank2");
							animateItem.find('.cItemButton').removeClass("cItemButton2");
						}
					});
				break;
				case 'normal':
					SlideMe.animate({
				    	left: -(SlideToX)
				    },500);
				break;
				default:
				break;
			}
			instance.$.cont.current_item+= slide_distance;
		}
	},
	getElementRealDims: function(elm,include_margin) {
		var z = this;
		var e,
			h = elm.height(),
			w = elm.width(),
			hc = ['padding-top','padding-bottom','border-top-width','border-bottom-width'],
			wc = ['padding-left','padding-right','border-left-width','border-right-width'],
			re = /[^0-9.]/g;
		if (include_margin) {
			hc = hc.concat(['margin-top','margin-bottom']);
			wc = wc.concat(['margin-left','margin-right']);
		}
		for (var i=0,c=hc.length;i<c;i++) {
			if (e = (elm.css(hc[i]) || '').replace(re,'')) h += +e;
		}
		for (var i=0,c=wc.length;i<c;i++) {
			if (e = (elm.css(wc[i]) || '').replace(re,'')) w += +e;
		}
		return {h:h,w:w};
	}
};


text:
<?php

namespace Market\Form;

use Zend\InputFilter\InputFilter;
use Zend\InputFilter\Input;
use Zend\Validator\InArray;
use Zend\Filter\StripTags;
use Zend\Filter\StringTrim;
use Zend\Filter\StringToLower;

class PostFormFilter extends InputFilter
{
    private $categories;
    private $dateExpires;
    private $cities;
    /**
     * @param mixed $categories
     */
    public function setCategories($categories)
    {
        $this->categories = $categories;
    }

    /**
     * @param mixed $dateExpires
     */
    public function setDateExpires($dateExpires)
    {
        $this->dateExpires = $dateExpires;
    }

    /**
     * @param mixed $cities
     */
    public function setCities($cities)
    {
        $this->cities = $cities;
    }

    public function buildFilter()
    {
        $category = new Input('category');
        $category->getFilterChain()
            ->attach(new StripTags())
            ->attach(new StringTrim())
            ->attach(new StringToLower());
        $category->getValidatorChain()
            ->attach(new InArray(array('haystack' => $this->categories)));

        $title = new Input('title');
        $title->getFilterChain()
            ->attach(new StripTags())
            ->attach(new StringTrim());
        $title->getValidatorChain()
            ->attachByName('Alnum', array('allowWhiteSpace' => TRUE))
            ->attachByName('StringLength', array('options' => array('min' => 6, 'max' => 128)));

        $price = new Input('price');
        $price->getFilterChain()
            ->attach(new StripTags())
            ->attach(new StringTrim());

        $priceRegex = new \Zend\Validator\Regex(array('pattern' => '/^[0-9]{1,10}+(\.[0-9]{1,2})?$/'));
        $priceRegex->setMessage('Preço deve ter no máximo 12 caracteres, incluindo opcionalmente 2 casas decimais separadas por ".".');

        $price->getValidatorChain()
            ->attach($priceRegex);

        $dateExpires = new Input('date_expires');
        $dateExpires->setAllowEmpty(TRUE);
        $dateExpires->getValidatorChain()
            ->attach(new InArray(array('haystack' => $this->dateExpires)));

        $description = new Input('description');
        $description->setAllowEmpty(TRUE);
        $description->getFilterChain()
            ->attach(new StripTags())
            ->attach(new StringTrim());
        $description->getValidatorChain()
            ->attachByName('StringLength', array('options' => array('max' => 4096)));

        $photoFilename = new Input('photo_filename');
        $photoFilename->setAllowEmpty(TRUE);
        $photoFilename->getValidatorChain()
            ->attachByName('Regex', array('pattern' => '!^(http://)?[a-z0-9./_-]+(jp(e)?g|png)$!i'));
        $photoFilename->setErrorMessage('Photo must be a URL or a valid filename ending with jpg or png');

        $contactName = new Input('contact_name');
        $contactName->getFilterChain()
            ->attach(new StripTags())
            ->attach(new StringTrim());
        $contactName->getValidatorChain()
            ->attachByName('Regex', array('pattern' => '/^[a-z0-9., -]{1,255}$/i'));
        $contactName->setErrorMessage('Name should only contain letters, numbers, and some punctuation.');

        $contactEmail = new Input('contact_email');
        $contactEmail->setAllowEmpty(TRUE);
        $contactEmail->getFilterChain()
            ->attach(new StripTags())
            ->attach(new StringTrim());
        $contactEmail->getValidatorChain()
            ->attachByName('EmailAddress');

        $contactPhone = new Input('contact_phone');
        $contactPhone->setAllowEmpty(TRUE);
        $contactPhone->getFilterChain()
            ->attach(new StripTags())
            ->attach(new StringTrim());
        $contactPhone->getValidatorChain()
            ->attachByName('Regex', array('pattern' => '/^(\([0-9]{2}\))\s([9]{1})?([0-9]{4})-([0-9]{4})$/'));
        $contactPhone->setErrorMessage('Contato deve ter o seguinte formato:(99) 9999-9999 ou (99) 99999-9999');

        $cityCode = new Input('cityCode');
        $cityCode->setAllowEmpty(TRUE);
        $cityCode->getFilterChain()
            ->attach(new StripTags())
            ->attach(new StringTrim());
        $cityCode->getValidatorChain()
            ->attach(new InArray(array('haystack' => array_keys($this->cities))));

        $deleteCode = new Input('delete_code');
        $deleteCode->setAllowEmpty(TRUE);
        $deleteCode->getFilterChain()
            ->attach(new StripTags())
            ->attach(new StringTrim());
        $deleteCode->getValidatorChain()
            ->attachByName('Alnum', array('allowWhiteSpace' => TRUE));

        $this->add($category)
            ->add($title)
            ->add($price)
            ->add($dateExpires)
            ->add($description)
            ->add($photoFilename)
            ->add($contactName)
            ->add($contactEmail)
            ->add($contactPhone)
            ->add($cityCode)
            ->add($deleteCode);
    }
}


text:
//// [tests/cases/compiler/reexportDefaultIsCallable.ts] ////

//// [schema.d.ts]
export default class Schema {}
//// [reexporter.d.ts]
export { default } from "./schema";
//// [usage.ts]
import Base from "./reexporter";
export default class Mine extends Base {}

//// [usage.js]
"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
exports.__esModule = true;
var reexporter_1 = __importDefault(require("./reexporter"));
var Mine = /** @class */ (function (_super) {
    __extends(Mine, _super);
    function Mine() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return Mine;
}(reexporter_1["default"]));
exports["default"] = Mine;


text:
package me.wener.commons.patterns.behavioral.Mediator;

//Concrete mediator
class Mediator implements IMediator
{

    BtnView btnView;
    BtnSearch btnSearch;
    BtnBook btnBook;
    LblDisplay show;

    //....
    public void registerView(BtnView v)
    {
        btnView = v;
    }

    public void registerSearch(BtnSearch s)
    {
        btnSearch = s;
    }

    public void registerBook(BtnBook b)
    {
        btnBook = b;
    }

    public void registerDisplay(LblDisplay d)
    {
        show = d;
    }

    public void book()
    {
        btnBook.setEnabled(false);
        btnView.setEnabled(true);
        btnSearch.setEnabled(true);
        show.setText("booking...");
    }

    public void view()
    {
        btnView.setEnabled(false);
        btnSearch.setEnabled(true);
        btnBook.setEnabled(true);
        show.setText("viewing...");
    }

    public void search()
    {
        btnSearch.setEnabled(false);
        btnView.setEnabled(true);
        btnBook.setEnabled(true);
        show.setText("searching...");
    }

}


text:
an easy to use tool kit for python, function include: email, time, csv, xls, zip...

### defore use

1. python version 2.7x required

2. you should install packages in file `dependence`

	pip install -r dependence

Note that some packages is not easy to install, eg lxml, pillow.
you should google for method

### imgetter

function: a function to download img using url

	imgetter(url)

### filesplitter(*args, **kwargs)

function: split file(s) into small size

	splited_file_names = filesplitter(filename1, filename2, size=10)

### func_monitor

function: a decorator to show runnig time of func

	@func_monitor()
	def func():
		pass

### time_builder

function: a function to build time

	time_builder()
	>>> '2016-02-15'

	time_builder('20160215')
	>>> '2016-02-15'

	time_builder('2016-02-15', 1)
	>>> '2016-02-16'

	time_builder('2016-02-15', -1)
	>>> '2016-02-14'

### lister

function: convert *args to one list

	lister(1,2,(3,4))
	>>>[1,2,3,4]

	lister(1,2,(3,4.1), target_type=int)
	>>>[1,2,3,4]

	lister(1,2,(3,4),[[5,6],7])
	>>>[1,2,3,4,5,6,7]

### distinct

function; delete all duplicate items in *args and return list

	distinct(1,2,2,3,(4,4,5,6))
	>>>[1,2,3,4,5,6]

### filer

function: create filedir and return abspath of file

	filer('name.txt', './')
	>>> '/root/rabbit/name.txt'

### logger

function: use logging easily

	lg = logger('file', 'logname.log', '/your/log/dir')
	lg.error('error')
	lg.info('running well')

### tree

functions: a good function to create default dict

	a = tree()
	a['a']['b']['c'] = 1
	print a['a']['b']['c']

### csv2xls

function: change csv file to xls

warning: lines of csv file must<=65535

### CsvManager

class: create csv file

	csvapp = CsvManager('csvname.csv')
	csvapp.writerow(1,2,3,(4,5))

### MySQLManager

class: connect to mysql

api is same as MySQLdb

### XlsManager

class: create xls file

### ZipManager

class: create zip file from files or from dir

### EmailSender

class: send email

	eapp = EmailSender()
	eapp.to = 'test@example.com'
	eapp.sugject = 'hello'
	eapp.body = 'world'
	eapp.send()

### EmailGetter

class: get email

in developing...