text:
package org.apache.lens.server.scheduler;

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

import org.apache.lens.api.LensConf;
import org.apache.lens.api.LensSessionHandle;
import org.apache.lens.api.error.InvalidStateTransitionException;
import org.apache.lens.api.query.QueryHandle;
import org.apache.lens.api.scheduler.*;
import org.apache.lens.server.LensServices;
import org.apache.lens.server.api.LensConfConstants;
import org.apache.lens.server.api.error.LensException;
import org.apache.lens.server.api.events.AsyncEventListener;
import org.apache.lens.server.api.events.SchedulerAlarmEvent;
import org.apache.lens.server.api.metastore.CubeMetastoreService;
import org.apache.lens.server.api.query.QueryExecutionService;
import org.apache.lens.server.api.scheduler.SchedulerService;
import org.apache.lens.server.api.session.SessionService;
import org.apache.lens.server.util.UtilityMethods;

import org.joda.time.DateTime;

import com.google.common.annotations.VisibleForTesting;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class SchedulerEventListener extends AsyncEventListener<SchedulerAlarmEvent> {
  private static final int CORE_POOL_SIZE = 10;
  private static final String JOB_INSTANCE_ID_KEY = "job_instance_key";
  @Getter
  @Setter
  @VisibleForTesting
  protected QueryExecutionService queryService;
  private SchedulerDAO schedulerDAO;
  private SchedulerService schedulerService;
  private SessionService sessionService;
  private CubeMetastoreService cubeMetastoreService;

  public SchedulerEventListener(SchedulerDAO schedulerDAO) {
    super(CORE_POOL_SIZE);
    this.queryService = LensServices.get().getService(QueryExecutionService.NAME);
    this.schedulerService = LensServices.get().getService(SchedulerService.NAME);
    this.sessionService = LensServices.get().getService(SessionService.NAME);
    this.cubeMetastoreService = LensServices.get().getService(CubeMetastoreService.NAME);
    this.schedulerDAO = schedulerDAO;
  }

  private LensSessionHandle getSessionHandle(String user) throws LensException {
    return schedulerService.openSessionAsUser(user);
  }

  private void setSessionConf(LensSessionHandle sessionHandle, XJob job) throws LensException {
    XExecution execution = job.getExecution();
    XSessionType executionSession = execution.getSession();
    cubeMetastoreService.setCurrentDatabase(sessionHandle, executionSession.getDb());
    List<MapType> sessionConfList = executionSession.getConf();
    for (MapType element : sessionConfList) {
      sessionService.setSessionParameter(sessionHandle, element.getKey(), element.getValue());
    }
    List<ResourcePath> resourceList = executionSession.getResourcePath();
    for (ResourcePath path : resourceList) {
      sessionService.addResource(sessionHandle, path.getType(), path.getPath());
    }
  }

  private LensConf getLensConf(XJob job, SchedulerJobInstanceHandle instanceHandle, DateTime scheduledTime) {
    List<MapType> jobConf = job.getExecution().getQuery().getConf();
    LensConf queryConf = new LensConf();
    for (MapType element : jobConf) {
      queryConf.addProperty(element.getKey(), element.getValue());
    }
    queryConf.addProperty(JOB_INSTANCE_ID_KEY, instanceHandle.getHandleId());
    // Current time is used for resolving date.
    queryConf.addProperty(LensConfConstants.QUERY_CURRENT_TIME_IN_MILLIS, scheduledTime.getMillis());
    return queryConf;
  }

  /**
   * @param event the event
   */
  @Override
  public void process(SchedulerAlarmEvent event) {
    DateTime scheduledTime = event.getNominalTime();
    SchedulerJobHandle jobHandle = event.getJobHandle();
    /*
     * Get the job from the store.
     * Create an instance.
     * Store the instance.
     * Try to run the instance.
     * If successfully submitted change the status to running.
     * Otherwise update the status to killed.
     */
    XJob job = schedulerDAO.getJob(jobHandle);
    String user = schedulerDAO.getUser(jobHandle);
    SchedulerJobInstanceHandle instanceHandle = event.getPreviousInstance() == null
                                                ? UtilityMethods.generateSchedulerJobInstanceHandle()
                                                : event.getPreviousInstance();
    SchedulerJobInstanceInfo instance = null;
    SchedulerJobInstanceRun run = null;
    LensSessionHandle sessionHandle = null;

    try {
      sessionHandle = getSessionHandle(user);
      setSessionConf(sessionHandle, job);
      if (event.getType() == SchedulerAlarmEvent.EventType.EXPIRE) {
        try {
          log.info("Expiring job with handle {}", jobHandle);
          schedulerService.expireJob(sessionHandle, jobHandle);
        } catch (LensException e) {
          log.error("Error while expiring the job", e);
        }
        return;
      }
      long scheduledTimeMillis = scheduledTime.getMillis();
      // If the instance is new then create otherwise get from the store
      if (event.getPreviousInstance() == null) {
        instance = new SchedulerJobInstanceInfo(instanceHandle, jobHandle, scheduledTimeMillis,
          new ArrayList<SchedulerJobInstanceRun>());
        // Store the instance
        if (schedulerDAO.storeJobInstance(instance) != 1) {
          log.error("Store was unsuccessful for instance {} of job {} ", instanceHandle, jobHandle);
          return;
        }
      } else {
        instance = schedulerDAO.getSchedulerJobInstanceInfo(instanceHandle);
      }
      // Next run of the instance
      long currentTime = System.currentTimeMillis();
      run = new SchedulerJobInstanceRun(instanceHandle, instance.getInstanceRunList().size() + 1, null, currentTime, 0,
        "N/A", null, SchedulerJobInstanceState.WAITING);
      instance.getInstanceRunList().add(run);
      if (schedulerDAO.storeJobInstanceRun(run) != 1) {
        log.error("Exception occurred while storing the instance run for instance handle {} of job {}", instance,
          jobHandle);
        return;
      }
      run.setSessionHandle(sessionHandle);
      LensConf queryConf = getLensConf(job, instanceHandle, scheduledTime);
      // Query Launch
      String query = job.getExecution().getQuery().getQuery();
      String queryName = job.getName();
      queryName += "-" + scheduledTimeMillis;
      QueryHandle handle = queryService.executeAsync(sessionHandle, query, queryConf, queryName);
      log.info("Running instance {} of job {} with run {} with query handle {}", instanceHandle, jobHandle,
        run.getRunId(), handle);
      run.setQueryHandle(handle);
      run.setInstanceState(run.getInstanceState().nextTransition(SchedulerJobInstanceEvent.ON_RUN));
      run.setEndTime(System.currentTimeMillis());
      // Update run
      schedulerDAO.updateJobInstanceRun(run);
      log.info("Successfully updated instance run with instance {} of job {}", instanceHandle, jobHandle);
    } catch (LensException | InvalidStateTransitionException e) {
      log.error(
        "Exception occurred while launching the job instance for " + jobHandle + " for nominal time " + scheduledTime
          .getMillis(), e);
      try {
        run.setInstanceState(run.getInstanceState().nextTransition(SchedulerJobInstanceEvent.ON_FAILURE));
        run.setEndTime(System.currentTimeMillis());
        schedulerDAO.updateJobInstanceRun(run);
      } catch (InvalidStateTransitionException e1) {
        log.error("Can't make transition for instance " + instance.getId() + " of job " + instance.getJobId(), e);
      }
    } finally {
      // Session needs to be closed after the launch.
      try {
        sessionService.closeSession(sessionHandle);
      } catch (LensException e) {
        log.error("Error closing session ", e);
      }
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE122_Heap_Based_Buffer_Overflow__cpp_src_wchar_t_cat_84_goodG2B.cpp
Label Definition File: CWE122_Heap_Based_Buffer_Overflow__cpp_src.label.xml
Template File: sources-sink-84_goodG2B.tmpl.cpp
*/
/*
 * @description
 * CWE: 122 Heap Based Buffer Overflow
 * BadSource:  Initialize data as a large string
 * GoodSource: Initialize data as a small string
 * Sinks: cat
 *    BadSink : Copy data to string using wcscat
 * Flow Variant: 84 Data flow: data passed to class constructor and destructor by declaring the class object on the heap and deleting it after use
 *
 * */
#ifndef OMITGOOD

#include "std_testcase.h"
#include "CWE122_Heap_Based_Buffer_Overflow__cpp_src_wchar_t_cat_84.h"

namespace CWE122_Heap_Based_Buffer_Overflow__cpp_src_wchar_t_cat_84
{
CWE122_Heap_Based_Buffer_Overflow__cpp_src_wchar_t_cat_84_goodG2B::CWE122_Heap_Based_Buffer_Overflow__cpp_src_wchar_t_cat_84_goodG2B(wchar_t * dataCopy)
{
    data = dataCopy;
    /* FIX: Initialize data as a small buffer that as small or smaller than the small buffer used in the sink */
    wmemset(data, L'A', 50-1); /* fill with L'A's */
    data[50-1] = L'\0'; /* null terminate */
}

CWE122_Heap_Based_Buffer_Overflow__cpp_src_wchar_t_cat_84_goodG2B::~CWE122_Heap_Based_Buffer_Overflow__cpp_src_wchar_t_cat_84_goodG2B()
{
    {
        wchar_t dest[50] = L"";
        /* POTENTIAL FLAW: Possible buffer overflow if data is larger than sizeof(dest)-wcslen(dest)*/
        wcscat(dest, data);
        printWLine(data);
        delete [] data;
    }
}
}
#endif /* OMITGOOD */


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for NhanXetController
/// </summary>
public class NhanXetController : LinqProvider
{
	public NhanXetController()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public DAL.NhanXet GetByMaDotVaMaCB(string maDotDG, string maCanBo)
    {
        return dataContext.NhanXets.SingleOrDefault(t => t.MaDotDG == maDotDG && t.MaCB == maCanBo);
    }

    public void Update(DAL.NhanXet nxet)
    {
        DAL.NhanXet temp = dataContext.NhanXets.SingleOrDefault(t => t.MaCB == nxet.MaCB && t.MaDotDG == nxet.MaDotDG);
        if (temp != null)
        {
            // cập nhật nhận xét
            temp.MaCB = nxet.MaCB;
            temp.MaDotDG = nxet.MaDotDG;
            temp.TuNhanXet = nxet.TuNhanXet;
            temp.BanLQNhanXet = nxet.BanLQNhanXet;
            temp.QuanLyNhanXet = nxet.QuanLyNhanXet;
            temp.DeXuat = nxet.DeXuat;
            temp.NhanXet1 = nxet.NhanXet1;
            temp.NhanXet2 = nxet.NhanXet2;
            Save();
        }
        else
        {
            // thêm mới nhận xét
            if (nxet != null)
            {
                dataContext.NhanXets.InsertOnSubmit(nxet);
                Save();
            }
        }
    }

    public void DeleteByMaDotDG(string maDotDG)
    {
        List<DAL.NhanXet> lists = dataContext.NhanXets.Where(t => t.MaDotDG == maDotDG).ToList();
        if (lists.Count() > 0)
        {
            dataContext.NhanXets.DeleteAllOnSubmit(lists);
            Save();
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZaibatsuPass.TransitCard.ORCA
{
    class ORCATransitEvent : TransitEvent
    {
        long mCoach;
        long mEventCost;
        long mNewBalance;

        ORCA.ORCACard.CardActionType mActionType;
        ORCA.ORCACard.AgencyType mTransitAgency;

        public override string EventTitle
        {
            get
            {
                String fAgency = "(unknown) ";
                if (ORCACard.ORCATransitAgenciesShort.ContainsKey(mTransitAgency))
                    fAgency = ORCACard.ORCATransitAgenciesShort[mTransitAgency];
                return string.Format("{0}{1}",fAgency, mCoach);
            }
        }

        public override string EventDetailsShort
        {
            get
            {
                string lightrailEvent = "";
                switch(mActionType)
                {
                    /*   Various rail-based systems */
                    case ORCACard.CardActionType.TAP_IN:
                        lightrailEvent = "Entered";
                        goto lightrail;
                    case ORCACard.CardActionType.TAP_OUT:
                        lightrailEvent = "Exited";
                        goto lightrail;
                    lightrail:
                        string lightrailAuthority = "Unknown";
                        if (EventType == TransitEventType.Metro) lightrailAuthority = "ST Link";
                        if (EventType == TransitEventType.Train) lightrailAuthority = "Sounder";
                        return lightrailEvent + ": " + lightrailAuthority;

                    /* The "TRIP CANCEL" event -- ?? */
                    case ORCACard.CardActionType.CANCEL_TRIP:
                        return "Trip cancel event?";
                    /* Use of E-Purse: Fare was worked against E-purse */
                    case ORCACard.CardActionType.USE_PURSE:
                        if (mEventCost > 0)
                            return "Fare deducted";
                        else
                            return "Transfer?";
                    default:
                        return String.Format( "Unknown event type {0} (0x{0:X})",mActionType );
                }
            }

        }

        public override TransitEventType EventType
        {
            get
            {
                switch(mTransitAgency)
                {
                    case ORCACard.AgencyType.SOUND_TRANSIT:
                        if (isSounder) return TransitEventType.Train;
                        if (isLink) return TransitEventType.Metro;
                        else return TransitEventType.Bus;
                    case ORCACard.AgencyType.WASHINGTON_STATE_FERRIES:
                        return TransitEventType.Ferry;
                    case ORCACard.AgencyType.KING_COUNTY_METRO:
                    case ORCACard.AgencyType.EVERETT_TRANSIT:
                    case ORCACard.AgencyType.PIERCE_TRANSIT:
                        return TransitEventType.Bus;
                    default: return TransitEventType.Other;

                }
            }
        }

        public override string LocalCost
        {
            get
            {

                switch(mActionType)
                {
                    case ORCACard.CardActionType.TAP_OUT:
                        if (mEventCost < 1) return "";
                        else goto default;
                    case ORCACard.CardActionType.USE_PASS:
                        return "PASS";
                    default:
                        return String.Format(new System.Globalization.CultureInfo("en-US"), "{0:C}", (float)mEventCost / 100.0);

                }
            }
        }

        private Boolean isLink { get { return mTransitAgency == ORCACard.AgencyType.SOUND_TRANSIT && mCoach > 10000; } }
        private Boolean isSounder {  get { return mTransitAgency == ORCACard.AgencyType.SOUND_TRANSIT && mCoach < 20; } }
        private Boolean isRapidRide { get { return mTransitAgency == ORCACard.AgencyType.KING_COUNTY_METRO && mCoach > 6000 && mCoach < 7000; } }

        public static ORCATransitEvent parseRecrd(PhysicalCard.Desfire.DesfireRecord record)
        {
            ORCATransitEvent _event = new ORCATransitEvent();

            byte[] d = record.Data;

            long tStamp = ((0x0F & d[3]) << 28)
                | (d[4] << 20)
                | (d[5] << 12)
                | (d[6] << 4)
                | (d[7] >> 4);

            _event.eventTime = DateTimeOffset.FromUnixTimeSeconds(tStamp).DateTime.ToLocalTime();

            _event.mCoach = ((d[9] & 0xf) << 12) | (d[10] << 4) | ((d[11] & 0xf0) >> 4);

            if (d[15] == 0xFF || d[15] == 0x00)
            {
                // According to FareBot, this is a strange edge-case that has not yet been figured out.
                _event.mEventCost = 0;
            }
            else
            {
                _event.mEventCost = (d[15] << 7) | (d[16] >> 1);
            }

            _event.mNewBalance = (d[34] << 8) | d[35];
            _event.mTransitAgency = (ORCA.ORCACard.AgencyType)( (byte)( ( d[3] & 0xF0 ) >> 4));
            _event.mActionType = (ORCA.ORCACard.CardActionType)((byte)(d[17]));

            System.Diagnostics.Debug.WriteLine("DATA: " + Convert.ToBase64String(d));

            return _event;
        }
    }
}


text:
// .NAME vtkExtractStructuredGridHelper - helper for extracting/sub-sampling
//  structured datasets.
//
// .SECTION Description
// vtkExtractStructuredGridHelper provides some common functionality that is
// used by filters that extract and sub-sample structured data. Specifically,
// it provides functionality for calculating the mapping from the input extent
// of each process to the output extent.
//
// .SECTION See Also
// vtkExtractGrid vtkExtractVOI vtkExtractRectilinearGrid

#ifndef __vtkExtractStructuredGridHelper_h
#define __vtkExtractStructuredGridHelper_h

#include "vtkCommonDataModelModule.h" // For export macro
#include "vtkObject.h"

// Forward declarations
class vtkCellData;
class vtkPointData;
class vtkPoints;

namespace vtk
{
namespace detail
{

struct vtkIndexMap;

} // END namespace detail
} // END namespace vtk

class VTKCOMMONDATAMODEL_EXPORT vtkExtractStructuredGridHelper :
  public vtkObject
{
public:
  static vtkExtractStructuredGridHelper *New();
  vtkTypeMacro(vtkExtractStructuredGridHelper,vtkObject);
  void PrintSelf(ostream& os, vtkIndent indent);

  // Get & Set Macros
  vtkGetVector6Macro(OutputWholeExtent,int);

  // Description:
  // \brief Initializes the index map.
  // \param voi the extent of the volume of interest
  // \param wholeExt the whole extent of the domain
  // \param smapleRate the sampling rate
  // \param includeBoundary indicates whether to include the boundary or not.
  void Initialize(int voi[6], int wholeExt[6], int sampleRate[3],
                  bool includeBoundary);

  // Description:
  // \brief Returns the size along a given dimension
  // \param dim the dimension in query
  // \pre dim >= 0 && dim < 3
  int GetSize(const int dim);

  // Description
  // \brief Returns the ith index along the given dimension
  // \param dim the dimension in query
  // \param i the index of the point in query
  // \pre dim >= 0 && dim < 3
  // \pre i > = 0 && i < this->GetSize( dim )
  int GetMapping(const int dim, const int i);

  // Description:
  // \brief Returns the begin & end extent that intersects with the VOI
  // \param inExt the input extent
  // \param voi the volume of interest
  // \param begin the begin extent
  // \param end the end extent
  void ComputeBeginAndEnd(int inExt[6], int voi[6], int begin[3], int end[3]);

  // Description:
  // \brief Copies the points & point data to the output.
  // \param inExt the input grid extent.
  // \param outExt the output grid extent.
  // \param pd pointer to the input point data.
  // \param inpnts pointer to the input points, or NULL if uniform grid.
  // \param outPD point to the output point data.
  // \param outpnts pointer to the output points, or NULL if uniform grid.
  // \param useMapping indicates whether to use the index mapping or not.
  // \pre pd != NULL.
  // \pre outPD != NULL.
  void CopyPointsAndPointData( int inExt[6], int outExt[6],
                    vtkPointData* pd, vtkPoints* inpnts,
                    vtkPointData* outPD, vtkPoints* outpnts,
                    bool useMapping=true);

  // Description:
  // \brief Copies the cell data to the output.
  // \param inExt the input grid extent.
  // \param outExt the output grid extent.
  // \param cd the input cell data.
  // \param outCD the output cell data.
  // \param useMapping indicates whether to use the index mapping or not.
  // \pre cd != NULL.
  // \pre outCD != NULL.
  void CopyCellData( int inExt[6], int outExt[6],
               vtkCellData* cd, vtkCellData* outCD,
               bool useMapping=true);

protected:
  vtkExtractStructuredGridHelper();
  ~vtkExtractStructuredGridHelper();

  int OutputWholeExtent[6];
  vtk::detail::vtkIndexMap* IndexMap;

  // Description:
  // \brief Invalidates the output extent.
  void Invalidate();

private:
  vtkExtractStructuredGridHelper(const vtkExtractStructuredGridHelper&); // Not implemented.
  void operator=(const vtkExtractStructuredGridHelper&); // Not implemented.
};

#endif /* VTKEXTRACTSTRUCTUREDGRIDHELPER_H_ */


text:
package org.jbb.permissions.impl.role.model;

import org.jbb.lib.test.PojoTest;

public class AclRoleEntryEntityTest extends PojoTest {

    @Override
    public Class getClassUnderTest() {
        return AclRoleEntryEntity.class;
    }

}


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model frontend\models\AcademicRecordsSearch */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
    ]); ?>

    <?= $form->field($model, 'academic_id') ?>

    <?= $form->field($model, 'application_id') ?>

    <?= $form->field($model, 'subject') ?>

    <?= $form->field($model, 'passing_year') ?>

    <?= $form->field($model, 'total_marks') ?>

    <?php // echo $form->field($model, 'marks_obtained') ?>

    <?php // echo $form->field($model, 'percentage') ?>

    <?php // echo $form->field($model, 'uni_board') ?>

    <?php // echo $form->field($model, 'attemps') ?>

    <?php // echo $form->field($model, 'enable_flag') ?>

    <?php // echo $form->field($model, 'last_update_date') ?>

    <?php // echo $form->field($model, 'last_updated_by') ?>

    <?php // echo $form->field($model, 'creation_date') ?>

    <?php // echo $form->field($model, 'created_by') ?>

    <?php // echo $form->field($model, 'last_update_login') ?>

        <?= Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary']) ?>
        <?= Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn btn-default']) ?>

    <?php ActiveForm::end(); ?>


text:
module Phaser.Particles.Initializers {

    export class Mass extends Initialize {

        constructor(a,b,c) {
            super();
            this.massPan = ParticleUtils.setSpanValue(a, b, c);
        }

        massPan: Phaser.Particles.Span;

        initialize(target) {
            target.mass = this.massPan.getValue();
        }

    }

}


text:
package org.apache.synapse.transport.utils.conn.logging;

import org.apache.commons.logging.Log;
import org.apache.http.HttpException;
import org.apache.http.HttpRequest;
import org.apache.http.HttpResponse;
import org.apache.http.config.MessageConstraints;
import org.apache.http.entity.ContentLengthStrategy;
import org.apache.http.nio.NHttpClientEventHandler;
import org.apache.http.nio.NHttpMessageParserFactory;
import org.apache.http.nio.NHttpMessageWriterFactory;
import org.apache.http.nio.reactor.IOSession;
import org.apache.http.nio.util.ByteBufferAllocator;
import org.apache.synapse.transport.utils.conn.SynapseNHttpClientConnection;

import java.io.IOException;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;

/**
 * An extension of the DefaultNHttpClientConnection class, that provides some
 * additional logging features. This implementation enhances the default connection
 * class by logging all the major events that occur on the connection instance.
 */
public class LoggingNHttpClientConnection extends SynapseNHttpClientConnection {

    private final Log log;

    public LoggingNHttpClientConnection(IOSession session,
                                        int bufferSize,
                                        int fragmentSizeHint,
                                        ByteBufferAllocator allocator,
                                        CharsetDecoder charDecoder,
                                        CharsetEncoder charEncoder,
                                        MessageConstraints constraints,
                                        ContentLengthStrategy incomingContentStrategy,
                                        ContentLengthStrategy outgoingContentStrategy,
                                        NHttpMessageWriterFactory<HttpRequest> requestWriterFactory,
                                        NHttpMessageParserFactory<HttpResponse> responseParserFactory,
                                        Log log) {
        super(session, bufferSize, fragmentSizeHint, allocator,
                charDecoder, charEncoder, constraints, incomingContentStrategy,
                outgoingContentStrategy, requestWriterFactory, responseParserFactory);
        this.log = log;
    }

    @Override
    public void close() throws IOException {
        this.log.debug("Close connection");
        super.close();
    }

    @Override
    public void shutdown() throws IOException {
        this.log.debug("Shutdown connection");
        super.shutdown();
    }

    @Override
    public void submitRequest(final HttpRequest request) throws IOException, HttpException {
        if (this.log.isDebugEnabled()) {
            this.log.debug("HTTP connection " + this + ": "  + request.getRequestLine().toString());
        }
        super.submitRequest(request);
    }

    @Override
    public void consumeInput(final NHttpClientEventHandler handler) {
        this.log.debug("Consume input");
        super.consumeInput(handler);
    }

    @Override
    public void produceOutput(final NHttpClientEventHandler handler) {
        this.log.debug("Produce output");
        super.produceOutput(handler);
    }
}


text:
"""
This module contains operator for copying
data from Cassandra to Google Cloud Storage in JSON format.
"""

import json
import warnings
from base64 import b64encode
from datetime import datetime
from decimal import Decimal
from tempfile import NamedTemporaryFile
from typing import TYPE_CHECKING, Any, Dict, Iterable, List, NewType, Optional, Sequence, Tuple, Union
from uuid import UUID

from cassandra.util import Date, OrderedMapSerializedKey, SortedSet, Time

from airflow.exceptions import AirflowException
from airflow.models import BaseOperator
from airflow.providers.apache.cassandra.hooks.cassandra import CassandraHook
from airflow.providers.google.cloud.hooks.gcs import GCSHook

if TYPE_CHECKING:
    from airflow.utils.context import Context

NotSetType = NewType('NotSetType', object)
NOT_SET = NotSetType(object())

class CassandraToGCSOperator(BaseOperator):
    """
    Copy data from Cassandra to Google Cloud Storage in JSON format

    Note: Arrays of arrays are not supported.

    :param cql: The CQL to execute on the Cassandra table.
    :type cql: str
    :param bucket: The bucket to upload to.
    :type bucket: str
    :param filename: The filename to use as the object name when uploading
        to Google Cloud Storage. A {} should be specified in the filename
        to allow the operator to inject file numbers in cases where the
        file is split due to size.
    :type filename: str
    :param schema_filename: If set, the filename to use as the object name
        when uploading a .json file containing the BigQuery schema fields
        for the table that was dumped from MySQL.
    :type schema_filename: str
    :param approx_max_file_size_bytes: This operator supports the ability
        to split large table dumps into multiple files (see notes in the
        filename param docs above). This param allows developers to specify the
        file size of the splits. Check https://cloud.google.com/storage/quotas
        to see the maximum allowed file size for a single object.
    :type approx_max_file_size_bytes: long
    :param cassandra_conn_id: Reference to a specific Cassandra hook.
    :type cassandra_conn_id: str
    :param gzip: Option to compress file for upload
    :type gzip: bool
    :param gcp_conn_id: (Optional) The connection ID used to connect to Google Cloud.
    :type gcp_conn_id: str
    :param google_cloud_storage_conn_id: (Deprecated) The connection ID used to connect to Google Cloud.
        This parameter has been deprecated. You should pass the gcp_conn_id parameter instead.
    :type google_cloud_storage_conn_id: str
    :param delegate_to: The account to impersonate using domain-wide delegation of authority,
        if any. For this to work, the service account making the request must have
        domain-wide delegation enabled.
    :type delegate_to: str
    :param impersonation_chain: Optional service account to impersonate using short-term
        credentials, or chained list of accounts required to get the access_token
        of the last account in the list, which will be impersonated in the request.
        If set as a string, the account must grant the originating account
        the Service Account Token Creator IAM role.
        If set as a sequence, the identities from the list must grant
        Service Account Token Creator IAM role to the directly preceding identity, with first
        account from the list granting this role to the originating account (templated).
    :type impersonation_chain: Union[str, Sequence[str]]
    :param query_timeout: (Optional) The amount of time, in seconds, used to execute the Cassandra query.
        If not set, the timeout value will be set in Session.execute() by Cassandra driver.
        If set to None, there is no timeout.
    :type query_timeout: float | None
    """

    template_fields: Sequence[str] = (
        'cql',
        'bucket',
        'filename',
        'schema_filename',
        'impersonation_chain',
    )
    template_ext: Sequence[str] = ('.cql',)
    ui_color = '#a0e08c'

    def __init__(
        self,
        *,
        cql: str,
        bucket: str,
        filename: str,
        schema_filename: Optional[str] = None,
        approx_max_file_size_bytes: int = 1900000000,
        gzip: bool = False,
        cassandra_conn_id: str = 'cassandra_default',
        gcp_conn_id: str = 'google_cloud_default',
        google_cloud_storage_conn_id: Optional[str] = None,
        delegate_to: Optional[str] = None,
        impersonation_chain: Optional[Union[str, Sequence[str]]] = None,
        query_timeout: Union[float, None, NotSetType] = NOT_SET,
        **kwargs,
    ) -> None:
        super().__init__(**kwargs)

        if google_cloud_storage_conn_id:
            warnings.warn(
                "The google_cloud_storage_conn_id parameter has been deprecated. You should pass "
                "the gcp_conn_id parameter.",
                DeprecationWarning,
                stacklevel=3,
            )
            gcp_conn_id = google_cloud_storage_conn_id

        self.cql = cql
        self.bucket = bucket
        self.filename = filename
        self.schema_filename = schema_filename
        self.approx_max_file_size_bytes = approx_max_file_size_bytes
        self.cassandra_conn_id = cassandra_conn_id
        self.gcp_conn_id = gcp_conn_id
        self.delegate_to = delegate_to
        self.gzip = gzip
        self.impersonation_chain = impersonation_chain
        self.query_timeout = query_timeout

    # Default Cassandra to BigQuery type mapping
    CQL_TYPE_MAP = {
        'BytesType': 'STRING',
        'DecimalType': 'FLOAT',
        'UUIDType': 'STRING',
        'BooleanType': 'BOOL',
        'ByteType': 'INTEGER',
        'AsciiType': 'STRING',
        'FloatType': 'FLOAT',
        'DoubleType': 'FLOAT',
        'LongType': 'INTEGER',
        'Int32Type': 'INTEGER',
        'IntegerType': 'INTEGER',
        'InetAddressType': 'STRING',
        'CounterColumnType': 'INTEGER',
        'DateType': 'TIMESTAMP',
        'SimpleDateType': 'DATE',
        'TimestampType': 'TIMESTAMP',
        'TimeUUIDType': 'STRING',
        'ShortType': 'INTEGER',
        'TimeType': 'TIME',
        'DurationType': 'INTEGER',
        'UTF8Type': 'STRING',
        'VarcharType': 'STRING',
    }

    def execute(self, context: 'Context'):
        hook = CassandraHook(cassandra_conn_id=self.cassandra_conn_id)

        query_extra = {}
        if self.query_timeout is not NOT_SET:
            query_extra['timeout'] = self.query_timeout

        cursor = hook.get_conn().execute(self.cql, **query_extra)

        files_to_upload = self._write_local_data_files(cursor)

        # If a schema is set, create a BQ schema JSON file.
        if self.schema_filename:
            files_to_upload.update(self._write_local_schema_file(cursor))

        # Flush all files before uploading
        for file_handle in files_to_upload.values():
            file_handle.flush()

        self._upload_to_gcs(files_to_upload)

        # Close all temp file handles.
        for file_handle in files_to_upload.values():
            file_handle.close()

        # Close all sessions and connection associated with this Cassandra cluster
        hook.shutdown_cluster()

    def _write_local_data_files(self, cursor):
        """
        Takes a cursor, and writes results to a local file.

        :return: A dictionary where keys are filenames to be used as object
            names in GCS, and values are file handles to local files that
            contain the data for the GCS objects.
        """
        file_no = 0
        tmp_file_handle = NamedTemporaryFile(delete=True)
        tmp_file_handles = {self.filename.format(file_no): tmp_file_handle}
        for row in cursor:
            row_dict = self.generate_data_dict(row._fields, row)
            content = json.dumps(row_dict).encode('utf-8')
            tmp_file_handle.write(content)

            # Append newline to make dumps BigQuery compatible.
            tmp_file_handle.write(b'\n')

            if tmp_file_handle.tell() >= self.approx_max_file_size_bytes:
                file_no += 1
                tmp_file_handle = NamedTemporaryFile(delete=True)
                tmp_file_handles[self.filename.format(file_no)] = tmp_file_handle

        return tmp_file_handles

    def _write_local_schema_file(self, cursor):
        """
        Takes a cursor, and writes the BigQuery schema for the results to a
        local file system.

        :return: A dictionary where key is a filename to be used as an object
            name in GCS, and values are file handles to local files that
            contains the BigQuery schema fields in .json format.
        """
        schema = []
        tmp_schema_file_handle = NamedTemporaryFile(delete=True)

        for name, type_ in zip(cursor.column_names, cursor.column_types):
            schema.append(self.generate_schema_dict(name, type_))
        json_serialized_schema = json.dumps(schema).encode('utf-8')

        tmp_schema_file_handle.write(json_serialized_schema)
        return {self.schema_filename: tmp_schema_file_handle}

    def _upload_to_gcs(self, files_to_upload: Dict[str, Any]):
        hook = GCSHook(
            gcp_conn_id=self.gcp_conn_id,
            delegate_to=self.delegate_to,
            impersonation_chain=self.impersonation_chain,
        )
        for obj, tmp_file_handle in files_to_upload.items():
            hook.upload(
                bucket_name=self.bucket,
                object_name=obj,
                filename=tmp_file_handle.name,
                mime_type='application/json',
                gzip=self.gzip,
            )

    @classmethod
    def generate_data_dict(cls, names: Iterable[str], values: Any) -> Dict[str, Any]:
        """Generates data structure that will be stored as file in GCS."""
        return {n: cls.convert_value(v) for n, v in zip(names, values)}

    @classmethod
    def convert_value(cls, value: Optional[Any]) -> Optional[Any]:
        """Convert value to BQ type."""
        if not value:
            return value
        elif isinstance(value, (str, int, float, bool, dict)):
            return value
        elif isinstance(value, bytes):
            return b64encode(value).decode('ascii')
        elif isinstance(value, UUID):
            return b64encode(value.bytes).decode('ascii')
        elif isinstance(value, (datetime, Date)):
            return str(value)
        elif isinstance(value, Decimal):
            return float(value)
        elif isinstance(value, Time):
            return str(value).split('.')[0]
        elif isinstance(value, (list, SortedSet)):
            return cls.convert_array_types(value)
        elif hasattr(value, '_fields'):
            return cls.convert_user_type(value)
        elif isinstance(value, tuple):
            return cls.convert_tuple_type(value)
        elif isinstance(value, OrderedMapSerializedKey):
            return cls.convert_map_type(value)
        else:
            raise AirflowException('Unexpected value: ' + str(value))

    @classmethod
    def convert_array_types(cls, value: Union[List[Any], SortedSet]) -> List[Any]:
        """Maps convert_value over array."""
        return [cls.convert_value(nested_value) for nested_value in value]

    @classmethod
    def convert_user_type(cls, value: Any) -> Dict[str, Any]:
        """
        Converts a user type to RECORD that contains n fields, where n is the
        number of attributes. Each element in the user type class will be converted to its
        corresponding data type in BQ.
        """
        names = value._fields
        values = [cls.convert_value(getattr(value, name)) for name in names]
        return cls.generate_data_dict(names, values)

    @classmethod
    def convert_tuple_type(cls, values: Tuple[Any]) -> Dict[str, Any]:
        """
        Converts a tuple to RECORD that contains n fields, each will be converted
        to its corresponding data type in bq and will be named 'field_<index>', where
        index is determined by the order of the tuple elements defined in cassandra.
        """
        names = ['field_' + str(i) for i in range(len(values))]
        return cls.generate_data_dict(names, values)

    @classmethod
    def convert_map_type(cls, value: OrderedMapSerializedKey) -> List[Dict[str, Any]]:
        """
        Converts a map to a repeated RECORD that contains two fields: 'key' and 'value',
        each will be converted to its corresponding data type in BQ.
        """
        converted_map = []
        for k, v in zip(value.keys(), value.values()):
            converted_map.append({'key': cls.convert_value(k), 'value': cls.convert_value(v)})
        return converted_map

    @classmethod
    def generate_schema_dict(cls, name: str, type_: Any) -> Dict[str, Any]:
        """Generates BQ schema."""
        field_schema: Dict[str, Any] = {}
        field_schema.update({'name': name})
        field_schema.update({'type_': cls.get_bq_type(type_)})
        field_schema.update({'mode': cls.get_bq_mode(type_)})
        fields = cls.get_bq_fields(type_)
        if fields:
            field_schema.update({'fields': fields})
        return field_schema

    @classmethod
    def get_bq_fields(cls, type_: Any) -> List[Dict[str, Any]]:
        """Converts non simple type value to BQ representation."""
        if cls.is_simple_type(type_):
            return []

        # In case of not simple type
        names: List[str] = []
        types: List[Any] = []
        if cls.is_array_type(type_) and cls.is_record_type(type_.subtypes[0]):
            names = type_.subtypes[0].fieldnames
            types = type_.subtypes[0].subtypes
        elif cls.is_record_type(type_):
            names = type_.fieldnames
            types = type_.subtypes

        if types and not names and type_.cassname == 'TupleType':
            names = ['field_' + str(i) for i in range(len(types))]
        elif types and not names and type_.cassname == 'MapType':
            names = ['key', 'value']

        return [cls.generate_schema_dict(n, t) for n, t in zip(names, types)]

    @staticmethod
    def is_simple_type(type_: Any) -> bool:
        """Check if type is a simple type."""
        return type_.cassname in CassandraToGCSOperator.CQL_TYPE_MAP

    @staticmethod
    def is_array_type(type_: Any) -> bool:
        """Check if type is an array type."""
        return type_.cassname in ['ListType', 'SetType']

    @staticmethod
    def is_record_type(type_: Any) -> bool:
        """Checks the record type."""
        return type_.cassname in ['UserType', 'TupleType', 'MapType']

    @classmethod
    def get_bq_type(cls, type_: Any) -> str:
        """Converts type to equivalent BQ type."""
        if cls.is_simple_type(type_):
            return CassandraToGCSOperator.CQL_TYPE_MAP[type_.cassname]
        elif cls.is_record_type(type_):
            return 'RECORD'
        elif cls.is_array_type(type_):
            return cls.get_bq_type(type_.subtypes[0])
        else:
            raise AirflowException('Not a supported type_: ' + type_.cassname)

    @classmethod
    def get_bq_mode(cls, type_: Any) -> str:
        """Converts type to equivalent BQ mode."""
        if cls.is_array_type(type_) or type_.cassname == 'MapType':
            return 'REPEATED'
        elif cls.is_record_type(type_) or cls.is_simple_type(type_):
            return 'NULLABLE'
        else:
            raise AirflowException('Not a supported type_: ' + type_.cassname)


text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Revision: 2972 $ -->
<!-- EN-Revision: 1.2 Maintainer: yannick Status: ready -->
<sect1 id="plugins.howto">
 <title>Comment fonctionnent les plugins</title>
 <para>
  Les plugins sont toujours chargés à la demande. Seuls les modificateurs
  de variables, les ressources, etc invoqués dans les scripts de templates
  seront chargés. De plus, chaque plugin n'est chargé qu'une fois, et ce
  même si vous avez plusieurs instances de Smarty qui tournent dans
  la même requête.
 </para>
 <para>
  Les filtres de post/pré-compilation et les filtres de sortie sont des cas
  un peu spéciaux.
  Comme ils ne sont pas mentionnés dans les templates, ils doivent être déclarés
  ou chargés explicitement via les fonctions de l'API avant que le template
  ne soit exécuté. L'ordre dans lequel les filtres multiples d'un même type
  sont exécutés dépend de l'ordre dans lequel ils sont enregistrés ou chargés.
 </para>
 <para>
  Le <link linkend="variable.plugins.dir">répertoire de plugin</link> peut
  être une chaîne de caractères contenant un chemin ou un tableau contenant
  de multiples chemins. Pour installer un plugin, placez-le simplement
  dans un de ces dossiers et Smarty l'utilisera automatiquement.
 </para>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->


text:
'use strict';

import Module from '../Module';
import extend from '../../core/extend';
import * as router from '../../client/router';
import hash from '../../client/hash';
import clientConfig from '../config';

class HashRouter extends Module {
	getProvides (name: string) {
		if (name === 'router') {
			return router;
		}
	}
	init (name: string, config: any) {
		super.init(name, config);
		var p: string, action: (evt: any) => any;
		if (name === 'router') {
			for (p in config) {
				if (config.hasOwnProperty(p)) {
					if (typeof(config[p]) === 'string') {
						action = require(config[p]);
						router.register(p, action);
					}
				}
			}
		}
	}
	constructor () {
		super();
		this.consumes = [
			{
				id: 'ninejs'
			}
		];
		this.provides = [
			{
				id: 'router'
			}
		];
	}

}
var result: Module = new HashRouter();
result.on('modulesEnabled', function() {
	router.startup();
	var start: any;
	start = hash() || clientConfig.boot;
	setTimeout(function() {
		if (start) {
			if (typeof(start) === 'function') {
				start();
			}
			else if (typeof(start) === 'string') {
				router.go(start, true);
			}
		}
		else {
			router.go('/', true);
		}
	});
});

export default result;


text:
/*
Author: Start Bootstrap - http://startbootstrap.com
'SB Admin' HTML Template by Start Bootstrap

All Start Bootstrap themes are licensed under Apache 2.0.
For more info and more free Bootstrap 3 HTML themes, visit http://startbootstrap.com!
*/

/* ATTN: This is mobile first CSS - to update 786px and up screen width use the media query near the bottom of the document! */

/* Global Styles */

body {
    margin-top: 50px;
}

#wrapper {
    padding-left: 0;
}

#page-wrapper {
    width: 100%;
    padding: 5px 15px;
}

/* Nav Messages */

.messages-dropdown .dropdown-menu .message-preview .avatar,
.messages-dropdown .dropdown-menu .message-preview .name,
.messages-dropdown .dropdown-menu .message-preview .message,
.messages-dropdown .dropdown-menu .message-preview .time {
    display: block;
}

.messages-dropdown .dropdown-menu .message-preview .avatar {
    float: left;
    margin-right: 15px;
}

.messages-dropdown .dropdown-menu .message-preview .name {
    font-weight: bold;
}

.messages-dropdown .dropdown-menu .message-preview .message {
    font-size: 12px;
}

.messages-dropdown .dropdown-menu .message-preview .time {
    font-size: 12px;
}

/* Nav Announcements */

.announcement-heading {
    font-size: 50px;
    margin: 0;
}

.announcement-text {
    margin: 0;
}

/* Table Headers */

table.tablesorter thead {
    cursor: pointer;
}

table.tablesorter thead tr th:hover {
    background-color: #f5f5f5;
}

.td-center td{ text-align:center;}
/*.table-design tr th{ background:#3dc490; color:#fff; border:0px !important; text-transform:uppercase;}
.table-design tr th:hover{ background-color:#009966 !important;}*/
.table-design .fa-check{ color:#3dc490 !important;}
.table-design td .fa{ font-size:16px; color:#777777;}
.table-design td{ vertical-align:middle !important;}
.table-design td a:hover .fa{ color:#3dc490;}
.table-design .small{ font-size:11px !important;}
table .fa-user{color:#42c874 !important;}
table .fa-user.inactive{ color:#dbdbdb !important;}
.mt-10{ margin-top:10px;}
.ml-10{ margin-left:10px;}
.panel-sub-heading{ border-bottom:1px solid #ccc; padding-bottom:10px; margin-bottom:20px}
.tooltip *{ text-align:left !important;}
.dataTables_filter{ text-align:right;}
.dashboard-panel h3{ font-size:14px; text-transform:uppercase; color:#555; font-weight:bold;}
.dashboard-panel h3 a{ color:#555;}
.dashboard-panel a{ color:#999;}
th.edit-category .fa{ display:none;}
th.edit-category:hover .fa{ display:inline-block;}
.add-dropdown{ float:right; margin-right:100px; margin-top:33px}
a:hover{ text-decoration:none;}

.fixed-header thead, .fixed-header tbody, .fixed-header tr, .fixed-header td, .fixed-header th { display: block; }
.fixed-header tr:after {content: ' '; display: block; visibility: hidden; clear: both;}
.fixed-header thead th {height: 30px;}
.fixed-header tbody {height: 300px;overflow-y: auto;}
.fixed-header tbody td, .fixed-header thead th {width: 19.5%;float: left; box-sizing:padding-box !important; text-overflow:ellipsis; white-space:nowrap; overflow:hidden;}
.fixed-header thead th { width:19.2% !important;}

/* Flot Chart Containers */

.flot-chart {
    display: block;
    height: 400px;
}

.flot-chart-content {
    width: 100%;
    height: 100%;
}

.jqstooltip{ width:auto !important; height:auto !important;}

/* Edit Below to Customize Widths > 768px */
@media (min-width:768px) {

    /* Wrappers */

    #wrapper {
        padding-left: 250px;
        padding-top:50px;
    }

    #page-wrapper {
        padding: 15px 25px;
    }

    /* Side Nav */

    .side-nav {
        margin-left: -250px;
        left: 250px;
        width: 250px;
        position: fixed;
        top: 100px;
        height: 100%;
        border-radius: 0;
        border: none;
        background-color: #30323f !important;
        overflow-y: auto;
    }

    /* Bootstrap Default Overrides - Customized Dropdowns for the Side Nav */

    .side-nav>li.dropdown>ul.dropdown-menu {
        position: relative;
        min-width: 225px;
        margin: 0;
        padding: 0;
        border: none;
        border-radius: 0;
        background-color: transparent;
        box-shadow: none;
        -webkit-box-shadow: none;
    }

    .side-nav>li.dropdown>ul.dropdown-menu>li>a {
        color: #999999;
        padding: 15px 15px 15px 25px;
    }

    .side-nav>li.dropdown>ul.dropdown-menu>li>a:hover,
    .side-nav>li.dropdown>ul.dropdown-menu>li>a.active,
    .side-nav>li.dropdown>ul.dropdown-menu>li>a:focus {
        color: #fff;
        background-color: #080808;
    }

    .side-nav>li>a {
        width: 250px;
        text-transform:uppercase;
        font-weight:bold;  -webkit-transition: all .3s ease-in-out;
        transition: all .3s ease-in-out;
    }
    .side-nav>li>a .fa{ font-size:16px; margin-right:10px;}

    .navbar-inverse .navbar-nav>li>a:hover,
    .navbar-inverse .navbar-nav>li>a:focus {
        background-color: #080808;
    }
    .navbar .search{float:left; width:428px; margin:34px 0px 0px 25px;}
    @-moz-document url-prefix() {
        .navbar .search{
            width:427px;
        }
    }
    .navbar .search .btn-group{ float:left;}
    .navbar .search .btn-group .btn-default{ height:46px;}
    .navbar .search .btn-group .dropdown-toggle{ border-radius:0px 0px 0px 0px; border-width:1px 0px;}
    .navbar .search .search-btn{background-color:#428bca; color:#fff; font-size:24px; border:0px;}
    .navbar .search .input{ width:295px; float:left; height:46px;}

    /* Nav Messages */

    .messages-dropdown .dropdown-menu {
        min-width: 300px;
    }

    .messages-dropdown .dropdown-menu li a {
        white-space: normal;
    }

    .navbar-collapse {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Background colors */
    .bg-red,
    .bg-yellow,
    .bg-aqua,
    .bg-blue,
    .bg-light-blue,
    .bg-green,
    .bg-navy,
    .bg-teal,
    .bg-olive,
    .bg-lime,
    .bg-orange,
    .bg-fuchsia,
    .bg-purple,
    .bg-maroon,
    .bg-black {
        color: #f9f9f9 !important;
    }
    .bg-gray {
        background-color: #eaeaec !important;
    }
    .bg-black {
        background-color: #222222 !important;
    }
    .bg-red {
        background-color: #f56954 !important;
    }
    .bg-yellow {
        background-color: #f39c12 !important;
    }
    .bg-aqua {
        background-color: #00c0ef !important;
    }
    .bg-blue {
        background-color: #0073b7 !important;
    }
    .bg-light-blue {
        background-color: #3c8dbc !important;
    }
    .bg-green {
        background-color: #00a65a !important;
    }
    .bg-navy {
        background-color: #001f3f !important;
    }
    .bg-teal {
        background-color: #39cccc !important;
    }
    .bg-olive {
        background-color: #3d9970 !important;
    }
    .bg-lime {
        background-color: #01ff70 !important;
    }
    .bg-orange {
        background-color: #ff851b !important;
    }
    .bg-fuchsia {
        background-color: #f012be !important;
    }
    .bg-purple {
        background-color: #932ab6 !important;
    }
    .bg-maroon {
        background-color: #85144b !important;
    }
    /* Text colors */
    .text-red {
        color: #f56954 !important;
    }
    .text-yellow {
        color: #f39c12 !important;
    }
    .text-aqua {
        color: #00c0ef !important;
    }
    .text-blue {
        color: #0073b7 !important;
    }
    .text-light-blue {
        color: #3c8dbc !important;
    }
    .text-green {
        color: #00a65a !important;
    }
    .text-navy {
        color: #001f3f !important;
    }
    .text-teal {
        color: #39cccc !important;
    }
    .text-olive {
        color: #3d9970 !important;
    }
    .text-lime {
        color: #01ff70 !important;
    }
    .text-orange {
        color: #ff851b !important;
    }
    .text-fuchsia {
        color: #f012be !important;
    }
    .text-purple {
        color: #932ab6 !important;
    }
    .text-maroon {
        color: #85144b !important;
    }

}


text:
package com.parse.starter;

import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.location.Location;
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.provider.ContactsContract;
import android.support.v7.app.AppCompatActivity;
import android.telephony.SmsManager;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

import com.genband.kandy.api.Kandy;
import com.genband.kandy.api.access.KandyLoginResponseListener;
import com.genband.kandy.api.services.calls.KandyRecord;
import com.genband.kandy.api.services.chats.IKandyLocationItem;
import com.genband.kandy.api.services.chats.IKandyTransferProgress;
import com.genband.kandy.api.services.chats.KandyChatMessage;
import com.genband.kandy.api.services.chats.KandyMessageBuilder;
import com.genband.kandy.api.services.chats.KandySMSMessage;
import com.genband.kandy.api.services.common.KandyResponseListener;
import com.genband.kandy.api.services.common.KandyUploadProgressListener;
import com.genband.kandy.api.services.location.KandyCurrentLocationListener;
import com.genband.kandy.api.utils.KandyIllegalArgumentException;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.PendingResult;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.location.FusedLocationProviderApi;
import com.google.android.gms.location.LocationListener;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;
import com.parse.ParseAnalytics;
import com.parse.ParseException;
import com.parse.ParsePush;
import com.parse.SaveCallback;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class MainActivity extends AppCompatActivity implements
        LocationListener,
        GoogleApiClient.ConnectionCallbacks,
        GoogleApiClient.OnConnectionFailedListener {

  private GoogleApiClient googleApiClient;

  private FusedLocationProviderApi fusedLocationProviderApi = LocationServices.FusedLocationApi;
    private static String TAG="MainActivity";
    private static final long INTERVAL = 1000 * 10;
    private static final long FASTEST_INTERVAL = 1000 * 5;

    TextView mainText;
    LocationRequest mLocationRequest;
    GoogleApiClient mGoogleApiClient;
    Location mCurrentLocation;
    SharedPreferences.Editor fd;
    SharedPreferences pref;
    ArrayAdapter<String> adapter;
    ListView listView;
    List<String> arrayList = new ArrayList<String>();

    protected void createLocationRequest() {
        mLocationRequest = new LocationRequest();
        mLocationRequest.setInterval(INTERVAL);
        mLocationRequest.setFastestInterval(FASTEST_INTERVAL);
        mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ((StarterApplication)getApplication()).setMainActivity(this);

        ParseAnalytics.trackAppOpenedInBackground(getIntent());
        ParsePush.subscribeInBackground("IRSensor", new SaveCallback() {
            @Override
            public void done(ParseException e) {

            }
        });

        if (!isGooglePlayServicesAvailable()) {
            finish();
        }
        createLocationRequest();
        googleApiClient = new GoogleApiClient.Builder(this)
            .addApi(LocationServices.API)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .build();

        // init Kandy SDK!!
        Kandy.initialize(getApplicationContext(), "DAK35a030f39497484593f5d5372a195704", "DAS4f7751f0b9a04a9383acd3e6954edd5c");

        //mainText = (TextView)findViewById(R.id.maintext);

        listView = (ListView) findViewById(R.id.list);

        pref = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
        //fd= pref.edit();
        Set<String> values = new HashSet<String>();
        values = pref.getStringSet("numbers", values);
        arrayList = new ArrayList<String>(values);
        adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, android.R.id.text1, arrayList);
        listView.setAdapter(adapter);
        listView.setDividerHeight(3);
        listView.setOnItemLongClickListener(new OnItemLongClickListener() {
            @Override
            public boolean onItemLongClick(AdapterView<?> parent, View view, int arg2, long arg3) {
                arrayList.remove(arg2);
                adapter.notifyDataSetChanged();
                //TODO: persist
                return false;
            }
        });
    }

    @Override
    public void onStart() {
        super.onStart();
        Log.d(TAG, "onStart fired ..............");
        if(mGoogleApiClient!=null) {
            mGoogleApiClient.connect();
        }
    }

    @Override
    public void onStop() {
        super.onStop();
        Log.d(TAG, "onStop fired ..............");
        if(mGoogleApiClient!=null) {
            mGoogleApiClient.disconnect();
            Log.d(TAG, "isConnected ...............: " + mGoogleApiClient.isConnected());
        }
    }

  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.menu_main, menu);
    return true;
  }

  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    //noinspection SimplifiableIfStatement

    if (id == R.id.action_settings) {

            selectContact();

        return true;
    }

    return super.onOptionsItemSelected(item);
  }

    private boolean isGooglePlayServicesAvailable() {
        int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
        if (ConnectionResult.SUCCESS == status) {
            return true;
        } else {
            GooglePlayServicesUtil.getErrorDialog(status, this, 0).show();
            return false;
        }
    }

    private void selectContact() {
        Intent intent = new Intent(Intent.ACTION_PICK);
        intent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_TYPE);
        startActivityForResult(intent, 1);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (data != null) {
            Uri uri = data.getData();

            if (uri != null) {
                Cursor c = null;
                try {
                    c = getContentResolver().query(uri, new String[]{
                                    ContactsContract.CommonDataKinds.Phone.NUMBER,
                                    ContactsContract.CommonDataKinds.Phone.TYPE },
                            null, null, null);

                    if (c != null && c.moveToFirst()) {
                        String number = c.getString(0);
                        int type = c.getInt(1);
                        //mainText.setText(number);
                        Log.d(TAG,"add("+number+")");
                        arrayList.add(number);
                        adapter.notifyDataSetChanged();
                        pref =PreferenceManager.getDefaultSharedPreferences(getBaseContext());
                        fd= pref.edit();
                        fd.putStringSet("numbers",new HashSet<String>(arrayList));
                        fd.apply();

                        //TEST ONLY
//                        sendMessages();;

                    }
                } finally {
                    if (c != null) {
                        c.close();
                    }
                }
            }
        }
    }

    @Override
    public void onConnected(Bundle bundle) {
        Log.d(TAG, "onConnected - isConnected ...............: " + mGoogleApiClient.isConnected());
//        startLocationUpdates();
    }

    protected void startLocationUpdates() {
        PendingResult<Status> pendingResult = LocationServices.FusedLocationApi.requestLocationUpdates(
                mGoogleApiClient, mLocationRequest, this);
        Log.d(TAG, "Location update started ..............: ");
    }

    @Override
    public void onConnectionSuspended(int i) {

    }

    @Override
    public void onConnectionFailed(ConnectionResult connectionResult) {
        Log.d(TAG, "Connection failed: " + connectionResult.toString());
    }

    @Override
    public void onLocationChanged(Location location) {
        Log.d(TAG, "Firing onLocationChanged..............................................");
        mCurrentLocation = location;
        String lat = "", lng = "";
        if (null != mCurrentLocation) {
            lat = String.valueOf(mCurrentLocation.getLatitude());
            lng = String.valueOf(mCurrentLocation.getLongitude());
//            login("user1@hack2016padls.gmail.com"); // TODO:....
//            sendSMSMessage("URGENT HELP! I'm here: http://maps.google.com/maps?q=" + lat + "," + lng);
        } else {
            Log.d(TAG, "location is null ...............");
        }

    }

    private void login(String username) {
/*
        Kandy.getAccess().registerNotificationListener(new KandyConnectServiceNotificationListener() {

            @Override
            public void onSocketFailedWithError(String error) {
                Log.i(TAG, "onSocketFailedWithError "+error);
            }

            @Override
            public void onSocketDisconnected() {
                Log.i(TAG, "onSocketDisconnected");
            }

            @Override
            public void onSocketConnecting() {
                Log.i(TAG, "onSocketConnecting");
            }

            @Override
            public void onSocketConnected() {
                Log.i(TAG, "onSocketConnected");
            }

            @Override
            public void onConnectionStateChanged(KandyConnectionState state) {
                Log.i(TAG, "KandyConnectionState "+state.name());
            }

            @Override
            public void onInvalidUser(String error) {
                Log.i(TAG, "onInvalidUser "+error);
            }

            @Override
            public void onSessionExpired(String error) {
                Log.i(TAG, "onSessionExpired "+error);
            }

            @Override
            public void onSDKNotSupported(String error) {
                Log.i(TAG, "onSDKNotSupported "+error);
            }
        });
*/
        KandyRecord kandyRecord = null;
        try {
            kandyRecord = new KandyRecord(username);
        } catch (KandyIllegalArgumentException e) {
            //TODO insert your code here
            return;
        }
        String password = "1harumsitvoluptat1";

        Kandy.getAccess().login(kandyRecord, password, new KandyLoginResponseListener() {

            @Override
            public void onRequestFailed(int responseCode, String err) {
                //TODO insert your code here
            }

            @Override
            public void onLoginSucceeded() {
                //TODO insert your code here
            }
        });
    }
/*
    private void sendMessage(String msg, String destination) {
        KandyRecord recipient = null;

        try {
            recipient = new KandyRecord("recipient","domain", KandyRecordType.CONTACT);
        } catch (KandyIllegalArgumentException ex) {
            //TODO insert your code here
        }

        final KandyChatMessage message = new KandyChatMessage(recipient, "message body");
        Kandy.getServices().getChatService().sendChat(message, new KandyResponseListener() {

            @Override
            public void onRequestFailed(int responseCode, String err) {
                //TODO insert your code here
            }

            @Override
            public void onRequestSucceded() {
                //TODO insert your code here
            }
        });
    }

    private void sendGroupMessage(String msg) {
        KandyRecord recipient = null;
        try {
            recipient = new KandyRecord("groupUserName@domain", KandyRecordType.GROUP);
        } catch (KandyIllegalArgumentException ex) {
            //TODO insert your code here
        }

        final KandyChatMessage message = new KandyChatMessage(recipient, "message body");
        Kandy.getServices().getChatService().sendChat(message, new KandyResponseListener() {
            @Override
            public void onRequestFailed(int responseCode, String err) {
                //TODO insert your code here
            }

            @Override
            public void onRequestSucceded() {
                //TODO insert your code here
            }
        });
    }
*/
    boolean smsfailed=true;

    private void sendSMSMessage(final String text) {

        if(arrayList.size()<1) {
            return;
        }

        for (String destination : arrayList) {
            destination = destination.replaceAll( "[^\\d]", "" );
            if(!destination.startsWith("+")) {
                destination = "+1"+destination;
            }
            sendSMSMessage(text, destination);
        }

    }

    private void sendSMSMessage(final String text, final String destination) {

        Log.d(TAG,"sending SMS to "+destination);

        KandySMSMessage message = null;

        try {
            message = new KandySMSMessage(destination, "Kandy SMS", text);
        } catch (KandyIllegalArgumentException e) {
            Log.d(TAG,e.getMessage());
        }

        // Sending message
        Kandy.getServices().getChatService().sendSMS(message, new KandyResponseListener() {
            @Override
            public void onRequestFailed(int responseCode, String err) {
                Log.d(TAG, "SMS FAILED! " + err);
                SmsManager smsManager = SmsManager.getDefault();
                smsManager.sendTextMessage(destination, null, text, null, null);
                Log.d(TAG, "SMS sent via SmsManager");
            }

            @Override
            public void onRequestSucceded() {
                Log.d(TAG,"SUCCESS - SMS sent via Kandy!");
            }
        });

    }

    public void sendMessages() {

        login("user1@hack2016padls.gmail.com");

        try {
            sendCurrentLocation();
        } catch(KandyIllegalArgumentException k) {
            Log.e(TAG,k.getLocalizedMessage());
        }

    }

    /**
     * Retrives and send current device location via KandySDk - to SMS list!
     */
    private void sendCurrentLocation() throws KandyIllegalArgumentException {
        Kandy.getServices().getLocationService().getCurrentLocation(new  KandyCurrentLocationListener() {
            @Override
            public void onCurrentLocationReceived(Location location) {

//                sendLocation(location); //TODO: send SMS instead

Log.i(TAG,"URGENT HELP! I'm here: http://maps.google.com/maps?q=" + location.getLatitude() + "," + location.getLongitude());

                sendSMSMessage("URGENT HELP! I'm here: http://maps.google.com/maps?q=" + location.getLatitude() + "," + location.getLongitude());

            }

            @Override
            public void onCurrentLocationFailed(int errorCode, String error) {
                //TODO insert your code here
            }
        });
    }

    /**
    * Send location
    * @param location location to be sent
    */
    private void sendLocation(Location location) {
        IKandyLocationItem kandyLocation = KandyMessageBuilder.createLocation("location", location);
        KandyRecord recipient = null;
        try {
            recipient = new KandyRecord("user@domain.com");
        } catch (KandyIllegalArgumentException e) {
            //TODO insert your code here
        }

        if (recipient == null)
            return;

        final KandyChatMessage message = new KandyChatMessage(recipient, kandyLocation);
        Kandy.getServices().getChatService().sendChat(message, new KandyUploadProgressListener() {
            @Override
            public void onRequestFailed(int responseCode, String err) {
                //TODO insert your code here
            }

            @Override
            public void onProgressUpdate(IKandyTransferProgress progress) {
                //TODO insert your code here
            }

            @Override
            public void onRequestSucceded() {
                //TODO insert your code here
            }
        });
    }

}


text:
var glob = require("glob");
var options = {
		 cwd: "/Users/tomaszlelek/apps/projects_analysis/tests/"
};

describe('test for glob module', function(){
	it('should : ' , function(done){
		glob("*.js",options,function(err,files){
			console.log("file : " + files);
			done();
		});

	})
})


text:
/*
These CSS selectors address common layout styles.
*/
div.ws-menu-page
	{
		min-width: 800px;
		margin-bottom: 20px;
		background: url('<?php echo $i; ?>/brand-bg.png') no-repeat top right;
	}
div.ws-menu-page a.ws-dotted-link
	{
		text-decoration: none;
		border-bottom: 1px dotted;
	}
div.ws-menu-page > h2
	{
		margin-bottom: 15px;
	}
div.ws-menu-page .ws-menu-page-right
	{
		float: right;
		margin-left: 25px;
	}
div.ws-menu-page .ws-menu-page-left
	{
		float: left;
		margin-right: 25px;
	}
div.ws-menu-page .ws-menu-page-center
	{
		display: block;
		margin-left: auto;
		margin-right: auto;
	}
div.ws-menu-page div.ws-menu-page-hr
	{
		height: 1px;
		line-height: 1px;
		background: #DDDDDD;
		margin: 20px 0 20px 0;
	}
div.ws-menu-page .ws-menu-page-hilite
	{
		font-size: 102%;
		background: #FFFEEB;
	}
div.ws-menu-page .ws-menu-page-error
	{
		color: #CC0000;
	}
div.ws-menu-page .ws-menu-page-error-hilite
	{
		color: #FFFFFF;
		background: #FF0000;
	}
div.ws-menu-page img.ws-menu-page-img-16
	{
		border: 0;
		width: 16px;
		height: 16px;
	}
div.ws-menu-page img.ws-menu-page-img-24
	{
		border: 0;
		width: 24px;
		height: 24px;
	}
div.ws-menu-page img.ws-menu-page-img-32
	{
		border: 0;
		width: 32px;
		height: 32px;
	}
div.ws-menu-page img.ws-menu-page-img-48
	{
		border: 0;
		width: 48px;
		height: 48px;
	}
div.ws-menu-page img.ws-menu-page-img-64
	{
		border: 0;
		width: 64px;
		height: 64px;
	}
div.ws-menu-page img.ws-menu-page-img-128
	{
		border: 0;
		width: 128px;
		height: 128px;
	}
div.ws-menu-page img.ws-menu-page-img-200
	{
		border: 0;
		width: 200px;
		height: 200px;
	}
div.ws-menu-page img.ws-menu-page-img-256
	{
		border: 0;
		width: 256px;
		height: 256px;
	}
div.ws-menu-page img.ws-menu-page-img-200-auto
	{
		border: 0;
		width: 200px;
		height: auto;
	}
div.ws-menu-page img.ws-menu-page-img-256-auto
	{
		border: 0;
		width: 256px;
		height: auto;
	}
/*
Specifically for the main layout table.
These CSS selectors address common layout styles.
*/
table.ws-menu-page-table
	{
		border: 0;
		width: 100%;
	}
table.ws-menu-page-table > tbody > tr
	{
		vertical-align: top;
	}
/*
Specifically for the main content area on the left side.
These CSS selectors address common layout styles.
*/
table.ws-menu-page-table td.ws-menu-page-table-l
	{
		padding: 0;
		width: 100%;
	}
table.ws-menu-page-table td.ws-menu-page-table-l img.ws-menu-page-brand-icon
	{
		border: 0px;
		float: right;
		width: 128px;
		height: 128px;
		margin: 0 0 0 25px;
		vertical-align: middle;
	}
table.ws-menu-page-table td.ws-menu-page-table-l img.ws-menu-page-brand-updates
	{
		border: 0px;
		float: right;
		width: 155px;
		height: 40px;
		margin: 0 -153px 0 25px;
		vertical-align: middle;
	}
table.ws-menu-page-table td.ws-menu-page-table-l p.submit
	{
		margin: 0;
		padding: 0;
	}
table.ws-menu-page-table td.ws-menu-page-table-l a[rel ~= "external"]
	{
		padding-right: 18px;
		background: url('<?php echo $i; ?>/brand-xlink.png') no-repeat center right;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-groups-show,
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-groups-hide
	{
		float: right;
		color: #333333;
		padding: 10px;
		font-size: 220%;
		cursor: pointer;
		font-weight: bold;
		background: #FFFFFF;
		margin: 0 0 0 30px;
		font-family: monospace;
		border: 1px solid #666666;
		-moz-border-radius: 5px;
		-webkit-border-radius: 5px;
		border-radius: 5px;
		-moz-user-select: none;
		-webkit-user-select: none;
		user-select: none;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-groups-hide
	{
		color: #999999;
		border-color: #999999;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-group-header
	{
		color: #666666;
		padding: 10px;
		font-size: 145%;
		cursor: pointer;
		position: relative;
		background: #FFFFFF;
		margin: 30px 0 30px 0;
		border: 1px solid #CCCCCC;
		-moz-border-radius: 5px;
		-webkit-border-radius: 5px;
		border-radius: 5px;
		font-family: 'Georgia', serif;
		vertical-align: middle;
		-moz-user-select: none;
		-webkit-user-select: none;
		user-select: none;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-group-header > ins
	{
		width: 22px;
		height: 22px;
		color: #CCCCCC;
		font-size: 17px;
		line-height: 22px;
		font-weight: bold;
		text-align: center;
		margin: -2px 10px 0 0;
		background: #666666;
		text-decoration: none;
		font-family: monospace;
		vertical-align: middle;
		border: 1px solid transparent;
		-moz-border-radius: 5px;
		-webkit-border-radius: 5px;
		border-radius: 5px;
		display: inline-block;
		zoom: 1 !ie<8;
		display: inline !ie<8;
		margin-top: 0 !ie<8;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-group-header:hover,
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-group-header.open
	{
		color: #164A61;
		border-color: #666666;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-group-header:hover > ins,
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-group-header.open > ins
	{
		color: #FFFFFF;
		background: #164A61;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-group
	{
		display: none;
		margin: -35px 5px 0 5px;
		padding: 20px 10px 10px 10px;
		border: 1px solid #CCCCCC;
		-moz-border-radius: 5px;
		-webkit-border-radius: 5px;
		border-radius: 5px;
		background: #FFFFFF url('<?php echo $i; ?>/brand-gradient-bg.png') repeat-x;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-group > div.ws-menu-page-hr
	{
		background: #666666;
		margin: 15px 0 15px 0;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-section table.form-table > tbody > tr
	{
		vertical-align: top;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-section table.form-table > tbody > tr > th
	{
		width: auto;
		color: #164A61;
		padding-bottom: 0;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-group > div.ws-menu-page-section table.form-table > tbody > tr > th
	{
		padding-left: 0;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-section table.form-table > tbody > tr > th.ws-menu-page-th-side
	{
		width: 200px;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-section table.form-table > tbody > tr > td
	{
		width: auto;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-group > div.ws-menu-page-section table.form-table > tbody > tr > td
	{
		padding-left: 0;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-section table.form-table > tbody > tr > td > input[type = "text"],
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-section table.form-table > tbody > tr > td > input[type = "password"],
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-section table.form-table > tbody > tr > td > textarea,
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-section table.form-table > tbody > tr > td > select
	{
		width: 100%; /* 100% does not work across all browsers. */
		width: 98% !ie<8; /* 100% does not work in IE browsers < 8. */
		box-sizing: border-box; /* Make all fields behave the same. */
		-ms-box-sizing: border-box;
		-moz-box-sizing: border-box;
		-webkit-box-sizing: border-box;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-section table.form-table > tbody > tr > td > input[type = "checkbox"],
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-section table.form-table > tbody > tr > td > input[type = "radio"]
	{
		margin-right: 3px;
		vertical-align: middle;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-section table.form-table > tbody > tr > td > input[type = "button"].ws-menu-page-media-btn
	{
		float: left;
		margin: 5px 25px 0 0;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-section table.form-table > tbody > tr > td > textarea
	{
		font-family: 'Courier New', monospace;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-section table.form-table > tbody > tr > td > select
	{
		width: 99.5% !ie<8; /* Required in IE < 8. */
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-section table.form-table > tbody > tr > td > ol
	{
		margin: 10px 0 10px 20px;
		list-style: decimal outside;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-section table.form-table > tbody > tr > td > ul
	{
		margin: 10px 0 10px 20px;
		list-style: disc outside;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-section table.form-table > tbody > tr > td > div.ws-menu-page-scrollbox
	{
		margin: 1px;
		padding: 5px;
		height: 150px;
		overflow-y: scroll;
		overflow-x: visible;
		background: #FFFFFF;
		border: 1px solid #CCCCCC;
		-moz-border-radius: 4px;
		-webkit-border-radius: 4px;
		border-radius: 4px;
	}
/*
Specifically for the main content area on the left side.
- Specifically for info pages with readme files.
These CSS selectors address common layout styles.
*/
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-readme > div.readme > div.section
	{
		margin: 0 0 20px 0;
		padding: 0 0 20px 0;
		border: 0 solid #DDDDDD;
		border-width: 0 0 1px 0;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-readme > div.readme > div.section > h2
	{
		margin-top: 0;
		padding-top: 0;
		font-size: 150%;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-readme > div.readme > div.section > div.content ul
	{
		padding: 0;
		margin: 10px 0 0 25px;
		list-style: disc outside;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.ws-menu-page-readme > div.readme > div.section > div.content ol
	{
		padding: 0;
		margin: 10px 0 0 25px;
		list-style: decimal outside;
	}
/*
Specifically for the main content area on the left side.
- Specifically for pages with a FeedBurner block.
These CSS selectors address common layout styles.
*/
table.ws-menu-page-table td.ws-menu-page-table-l div.feedburnerFeedBlock
	{
		margin: 0 0 20px 0;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.feedburnerFeedBlock > ul > li
	{
		margin: 25px 0 0 0;
		padding: 0 0 20px 0;
		border: 0 solid #DDDDDD;
		border-width: 0 0 1px 0;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.feedburnerFeedBlock > ul > li:first-child
	{
		margin-top: 0;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.feedburnerFeedBlock > ul > li > span.headline
	{
		font-size: 150%;
		font-family: 'Georgia', serif;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.feedburnerFeedBlock > ul > li > p.date
	{
		font-size: 130%;
		font-family: 'Georgia', serif;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.feedburnerFeedBlock > ul > li > div > div.feedflare
	{
		margin: 10px 0 0 0;
	}
table.ws-menu-page-table td.ws-menu-page-table-l div.feedburnerFeedBlock > p.fbsubscribelink
	{
		margin: 25px 0 0 0;
	}
/*
Specifically for the right sidebar panel.
These CSS selectors address common layout styles.
*/
table.ws-menu-page-table td.ws-menu-page-table-r
	{
		padding: 0;
		text-align: right;
	}
table.ws-menu-page-table td.ws-menu-page-table-r a[rel ~= "external"]
	{
		padding-right: 18px;
		background: url('<?php echo $i; ?>/brand-xlink.png') no-repeat center right;
	}
table.ws-menu-page-table td.ws-menu-page-table-r div.ws-menu-page-mlist,
table.ws-menu-page-table td.ws-menu-page-table-r div.ws-menu-page-installation,
table.ws-menu-page-table td.ws-menu-page-table-r div.ws-menu-page-tools,
table.ws-menu-page-table td.ws-menu-page-table-r div.ws-menu-page-videos,
table.ws-menu-page-table td.ws-menu-page-table-r div.ws-menu-page-support,
table.ws-menu-page-table td.ws-menu-page-table-r div.ws-menu-page-donations,
table.ws-menu-page-table td.ws-menu-page-table-r div.ws-menu-page-others
	{
		margin: 0 0 25px 25px;
	}
table.ws-menu-page-table td.ws-menu-page-table-r div.ws-menu-page-installation img,
table.ws-menu-page-table td.ws-menu-page-table-r div.ws-menu-page-tools img,
table.ws-menu-page-table td.ws-menu-page-table-r div.ws-menu-page-videos img,
table.ws-menu-page-table td.ws-menu-page-table-r div.ws-menu-page-support img,
table.ws-menu-page-table td.ws-menu-page-table-r div.ws-menu-page-donations img,
table.ws-menu-page-table td.ws-menu-page-table-r div.ws-menu-page-others img
	{
		border: 0;
		width: 200px;
		height: auto;
	}
/*
Specifically for the right sidebar panel.
- Specifically for the mailing list box.
These CSS selectors address common layout styles.
*/
td.ws-menu-page-table-r div.ws-menu-page-mlist
	{
		text-align: left;
	}
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-feed-animator,
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-header,
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container
	{
		background: #FFFFFF;
		margin: 0 auto 0 auto;
		border: 1px solid #CCCCCC;
		-moz-border-radius: 5px;
		-webkit-border-radius: 5px;
		border-radius: 5px;
	}
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-feed-animator,
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-header
	{
		padding: 10px;
		color: #666666;
		cursor: pointer;
		font-size: 145%;
		margin-bottom: -7px;
		position: relative;
		font-family: 'Georgia', serif;
		vertical-align: middle;
		-moz-user-select: none;
		-webkit-user-select: none;
		user-select: none;
	}
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-feed-animator
	{
		margin: 0 0 15px 0;
	}
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-header > ins
	{
		width: 22px;
		height: 22px;
		color: #CCCCCC;
		font-size: 17px;
		line-height: 22px;
		font-weight: bold;
		text-align: center;
		margin: -2px 13px 0 0;
		background: #666666;
		text-decoration: none;
		font-family: monospace;
		vertical-align: middle;
		border: 1px solid transparent;
		-moz-border-radius: 5px;
		-webkit-border-radius: 5px;
		border-radius: 5px;
		display: inline-block;
		zoom: 1 !ie<8;
		display: inline !ie<8;
		margin-top: 0 !ie<8;
	}
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-header:hover,
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-header.open
	{
		color: #164A61;
		border-color: #666666;
	}
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-header:hover > ins,
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-header.open > ins
	{
		color: #FFFFFF;
		background: #164A61;
	}
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container
	{
		width: 178px;
		display: none;
		margin: 0 auto 0 auto;
		padding: 20px 10px 10px 10px;
		background: #FFFFFF url('<?php echo $i; ?>/brand-gradient-bg.png') repeat-x;
	}
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container div#ws-mlist-div-fname,
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container div#ws-mlist-div-lname,
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container div#ws-mlist-div-email,
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container div#ws-mlist-div-groups,
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container div#ws-mlist-div-subs
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container div#ws-mlist-div-priv
	{
		margin: 0 0 10px 0;
	}
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container div#ws-mlist-div-subs
	{
		margin: 15px 0 0 0;
	}
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container input[type = "text"],
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container input[type = "password"],
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container input[type = "submit"],
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container textarea,
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container select
	{
		width: 100%; /* 100% does not work across all browsers. */
		width: 98% !ie<8; /* 100% does not work in IE browsers < 8. */
		box-sizing: border-box; /* Make all fields behave the same. */
		-ms-box-sizing: border-box;
		-moz-box-sizing: border-box;
		-webkit-box-sizing: border-box;
	}
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container input[type = "checkbox"],
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container input[type = "radio"]
	{
		margin-right: 3px;
		vertical-align: middle;
	}
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container input[type = "submit"]
	{
		width: 100% !ie<8; /* This width required in IE < 8. */
	}
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container select
	{
		width: 99.5% !ie<8; /* Required in IE < 8. */
	}
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container div#ws-mlist-div-groups > ul > li
	{
		margin: 0;
		font-size: 90%;
		-moz-user-select: none;
		-webkit-user-select: none;
		user-select: none;
	}
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container div#ws-mlist-div-subs > ul
	{
		margin: 0 auto 0 auto;
	}
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-container div#ws-mlist-div-priv
	{
		font-size: 80%;
		margin: 0 0 5px 0;
	}


text:
<?php
/**
 * Controlleur Joueur
 *
 * @see     Controlleur
 * @author  Panpan76
 * @version 1.0
 */
class ControlleurJoueur extends Controlleur{

  ################
  ### Méthodes ###
  ################

  /**
   * Voir
   *
   * @return void
   */
  public function voir($id){
    $ge = GestionnaireEntite::getInstance();
    $joueur = $ge->select('Joueur', array('id' => $id), 0b0111)->getOne();

    $this->render('joueur/voir.php', $joueur->pseudo, array(
      'joueur' => $joueur
    ));
  }

  public function login(){
    $ge = GestionnaireEntite::getInstance();

    $message = '';

    if($data = $this->aDonnees()){
      $joueur = $ge->select('Joueur', array(
        'pseudo'      => $data['pseudo'],
        'motDePasse'  => md5($data['mdp'])
      ), $ge::ENFANTS+$ge::PARENTS)->getOne();

      if(is_object($joueur)){
        $this->connexion($joueur);
      }
      else{
        $message = "Identifiants incorrect";
      }
    }

    $this->render('joueur/login.php', 'Connexion', array(
      'message' => $message
    ));
  }

  public function inscription(){
    $ge = GestionnaireEntite::getInstance();
    $races = $ge->select('Race')->getAll();

    $joueur = new Joueur();
    $message = '';

    if($data = $this->aDonnees()){
      $joueur->pseudo           = $data['pseudo'];
      $joueur->motDePasse       = md5($data['mdp']);
      $joueur->race             = $ge->select('Race', array('id' => $data['race']))->getOne();

      if($ge->persist($joueur)){
        // On récupère de-nouveau notre joueur pour avoir toutes les relations qui ont été ajouté par le SGBD
        $joueur = $ge->select('Joueur', array(
          'pseudo'      => $data['pseudo']
        ), $ge::ENFANTS+$ge::PARENTS)->getOne();

        $this->connexion($joueur);
      }
      else{
        $message = "Une erreur est survenue";
      }
    }

    $this->render('joueur/inscription.php', 'Inscription', array(
      'races'   => $races,
      'joueur'  => $joueur,
      'message' => $message
    ));
  }

  public function deconnexion(){
    unset($_SESSION['joueur']);
    Routeur::redirect('');
  }

  /**
   * Permet de gérer la connexion d'un joueur
   *
   * @param Joueur $joueur Joueur devant être connecté
   *
   * @return boolean
   */
  private function connexion($joueur){
    $_SESSION['joueur']   = $joueur->id;
    $_SESSION['planete']  = $joueur->planetes[0]->id;
    Routeur::redirect('');
  }

  /**
   * Permet de gérer la menu pour le joueur connecté
   *
   * @return boolean
   */
  public static function menuHeader(){
    $ge = GestionnaireEntite::getInstance();
    $joueur   = $ge->select('Joueur', array('id' => $_SESSION['joueur']), $ge::PARENTS)->getOne();
    $planete  = $ge->select('Planete', array('id' => $_SESSION['planete']), $ge::PARENTS+$ge::ENFANTS)->getOne();
    $controlleur = new Controlleur();

    $controlleur->render('joueur/menu_header.php', '', array(
      'joueur'  => $joueur,
      'planete' => $planete
    ));
  }

}

?>


text:
/// Copyright (c) 2012 Ecma International.  All rights reserved.
/// Ecma International makes this code available under the terms and conditions set
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
/// "Use Terms").   Any redistribution of this code must retain the above
/// copyright and this notice and otherwise comply with the Use Terms.
/**
 * @path ch15/15.2/15.2.3/15.2.3.6/15.2.3.6-3-236.js
 * @description Object.defineProperty - 'set' property in 'Attributes' is not present (8.10.5 step 8)
 */

function testcase() {
        var obj = {};

        Object.defineProperty(obj, "property", {
            get: function () {
                return 11;
            }
        });

        obj.property = 14;
        var desc = Object.getOwnPropertyDescriptor(obj, "property");
        return obj.hasOwnProperty("property") && obj.property === 11 && typeof desc.set === "undefined";
    }
runTestCase(testcase);


text:
FROM hence/go:latest

WORKDIR /app

# this will ideally be built by the ONBUILD below ;)
CMD ["go-wrapper", "run"]

ONBUILD COPY . /app
ONBUILD RUN go-wrapper download
ONBUILD RUN go-wrapper install


text:
module Kernel

  # Returns the object's singleton class (exists in Ruby 1.9.2)
  def singleton_class
    class << self
      self
    end
  end unless method_defined?(:singleton_class)

end


text:
package vazkii.emotes.client.emote;

import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.player.EntityPlayer;
import vazkii.emotes.client.emote.base.EmoteBase;
import vazkii.emotes.client.emote.base.ModelAccessor;
import aurelienribon.tweenengine.Timeline;
import aurelienribon.tweenengine.Tween;

public class EmoteFacepalm extends EmoteBase {

	public EmoteFacepalm(EntityPlayer player, ModelBiped model, ModelBiped armorModel, ModelBiped armorLegsModel) {
		super(player, model, armorModel, armorLegsModel);
	}

	@Override
	public Timeline getTimeline(EntityPlayer player, ModelBiped model) {
		Timeline timeline = Timeline.createSequence()
				.beginParallel()
					.push(Tween.to(model, ModelAccessor.HEAD_X, 1000F).target(0.2F))
					.push(Tween.to(model, ModelAccessor.HEAD_Y, 1000F).target(0F))
					.push(Tween.to(model, ModelAccessor.HEAD_Z, 1000F).target(0F))
					.push(Tween.to(model, ModelAccessor.LEFT_ARM_X, 400F).target(-pi + 0.8F))
					.push(Tween.to(model, ModelAccessor.LEFT_ARM_Z, 400F).target(-1F))
				.end()
				.push(Tween.to(model, ModelAccessor.HEAD_Y, 300F).target(0.05F))
				.push(Tween.to(model, ModelAccessor.HEAD_Y, 300F).target(-0.05F).repeatYoyo(4, 0F))
				.push(Tween.to(model, ModelAccessor.HEAD_Y, 300F).target(0F))
				.beginParallel()
					.push(Tween.to(model, ModelAccessor.HEAD_X, 500F).target(0F))
					.push(Tween.to(model, ModelAccessor.LEFT_ARM_X, 600F).target(0F))
					.push(Tween.to(model, ModelAccessor.LEFT_ARM_Z, 600F).target(0F))
				.end();

		return timeline;
	}

	@Override
	public boolean usesBodyPart(int part) {
		return part == ModelAccessor.HEAD || part == ModelAccessor.LEFT_ARM;
	}

}


text:
<?php
/** @type EE_Transaction $transaction */
/** @type boolean $is_primary */
/** @type string $reg_url_link */
/** @type string $SPCO_attendee_information_url */
?>

<?php _e('Registration Details', 'event_espresso'); ?>

<?php do_action('AHEE__thank_you_page_registration_details_template__after_heading'); ?>

    <?php
    $registrations = $transaction->registrations();
    $registrations = is_array($registrations) ? $registrations : array();
    $reg_count = count($registrations);
    $reg_cntr = 0;
    $event_name = '';
    $wait_list = false;
    foreach ($registrations as $registration) {
        if ($registration instanceof EE_Registration) {
            if ($event_name != $registration->event_name() && ! empty($event_name)) { ?>

                <?php
            }
            $reg_cntr++;
            if ($event_name != $registration->event_name()) {
                ?>

                    <?php _e('for', 'event_espresso'); ?>
                        :  <?php echo htmlentities($registration->event_name(), ENT_QUOTES, 'UTF-8'); ?>

                        <?php _e("Registrant Name", 'event_espresso') ?>

                        <?php _e("REG Code", 'event_espresso'); ?>

                        <?php _e("REG Status", 'event_espresso'); ?>

                <?php
            }
            if ($is_primary || (! $is_primary && $reg_url_link == $registration->reg_url_link())) { ?>

                        <?php
                        if ($registration->attendee() instanceof EE_Attendee) {
                            echo $registration->attendee()->full_name(true);
                        }
                        ?>

                            <?php
                            if ($registration->count_question_groups()) {
                                ?>
                                <a class="ee-icon-only-lnk"
                                   href="<?php echo $registration->edit_attendee_information_url(); ?>"
                                   title="<?php
                                               esc_attr_e(
                                                   'Click here to edit Attendee Information',
                                                   'event_espresso'
                                               ); ?>">
                                    <?php
                                    _e(
                                        'edit info',
                                        'event_espresso'
                                    ); ?>
                            <?php } ?>
                            <a class="ee-resend-reg-confirmation-email ee-icon-only-lnk"
                               href="<?php
                                        echo add_query_arg(
                                            array('token' => $registration->reg_url_link(), 'resend_reg_confirmation' => 'true'),
                                            EE_Registry::instance()->CFG->core->thank_you_page_url()
                                        ); ?>" title="<?php
                                                        esc_attr_e(
                                                            'Click here to resend the Registration Confirmation email',
                                                            'event_espresso'
                                                        ); ?>" rel="<?php echo $registration->reg_url_link(); ?>">
                                <?php
                                _e(
                                    'resend email',
                                    'event_espresso'
                                ); ?>

                        <?php $registration->e('REG_code') ?>

                        <?php $registration->e_pretty_status(true) ?>
                        <?php
                        if ($registration->status_ID() === EEM_Registration::status_id_wait_list) {
                            $wait_list = true;
                        }
                        ?>

                <?php do_action(
                    'AHEE__thank_you_page_registration_details_template__after_registration_table_row',
                    $registration
                ); ?>
                <?php
                $event_name = $registration->event_name();
            }
            if ($reg_cntr >= $reg_count) {
                ?>

                <?php
            }
        }
    }
    ?>
    <?php if ($is_primary && $SPCO_attendee_information_url) { ?>

            <a href='<?php echo $SPCO_attendee_information_url ?>'>
                <?php
                _e(
                    "Click here to edit All Attendee Information",
                    'event_espresso'
                ); ?>

    <?php } ?>
    <?php if ($wait_list) { ?>
        <?php
        echo apply_filters(
            'AFEE__thank_you_page_registration_details_template__wait_list_notice',
            sprintf(
                __(
                    '%1$sre: Wait List Registrations%2$sPlease note that the total cost listed below in the Transaction Details is for ALL registrations, including those that are on the wait list, even though they can not be currently paid for. If any spaces become available however, you may be notified by the Event admin and have the opportunity to secure the remaining tickets by making a payment for them.%3$s',
                    'event_espresso'
                ),
                '
',
                '

',
                '

'
            )
        );
        ?>
    <?php } ?>

    <?php do_action('AHEE__thank_you_page_registration_details_template__after_registration_details'); ?>