text:
package it.lisik.springutils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken;
import org.springframework.security.oauth2.common.DefaultOAuth2RefreshToken;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;
import java.util.Map;
import java.util.Optional;

@RestController
public class RevokeTokenEndpoint {
    private final TokenStore tokenStore;

    @Autowired
    public RevokeTokenEndpoint(TokenStore tokenStore) {
        this.tokenStore = tokenStore;
    }

    @RequestMapping(value = "/oauth/revoke", method = RequestMethod.POST)
    public ResponseEntity postRevokeAccessToken(Principal principal, @RequestParam Map<String, String> parameters) {
        final Optional<String> tokenTypeHint = Optional.ofNullable(parameters.get("token_type_hint"));
        final String token = parameters.get("token");

        final TokenType tokenType = tokenTypeHint.map(type -> TokenType.valueOf(type.toUpperCase()))
                .orElseGet(() -> TokenType.ACCESS_TOKEN);

        switch (tokenType) {
            default:
            case ACCESS_TOKEN:
                final DefaultOAuth2AccessToken accessToken = new DefaultOAuth2AccessToken(token);
                tokenStore.removeAccessToken(accessToken);
                break;

            case REFRESH_TOKEN:
                final DefaultOAuth2RefreshToken refreshToken = new DefaultOAuth2RefreshToken(token);
                tokenStore.removeAccessTokenUsingRefreshToken(refreshToken);
        }

        return new ResponseEntity(HttpStatus.OK);
    }
}


text:
class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  if Settings.enable_user_registration
    devise :database_authenticatable, :registerable, :confirmable,
           :recoverable, :rememberable, :trackable, :validatable,
           :omniauthable, :timeoutable, :timeout_in => 90.minutes,
           :omniauth_providers => Concord::AuthPortal.all_strategy_names

    validates :username, uniqueness: true, presence: true
  else
    devise :database_authenticatable, :rememberable, :trackable,
           :omniauthable, :timeoutable, :timeout_in => 90.minutes,
           :omniauth_providers => Concord::AuthPortal.all_strategy_names
  end

  has_many :documents, inverse_of: :owner, foreign_key: 'owner_id'
  has_many :authentications, dependent: :delete_all

  def self.find_for_concord_portal_oauth(auth, signed_in_resource=nil)
    authentication = Authentication.find_by_provider_and_uid auth.provider, auth.uid
    if authentication
      # update the authentication token for this user to make sure it stays fresh
      authentication.update_attribute(:token, auth.credentials.token)
      return authentication.user
    end

    # there is no authentication for this provider and uid
    # see if we should create a new authentication for an existing user
    # or make a whole new user
    email = auth.info.email || "#{Devise.friendly_token[0,20]}@example.com"

    # the devise validatable model enforces unique emails, so no need find_all
    existing_user_by_email = User.find_by(email: email)

    if existing_user_by_email
      if existing_user_by_email.authentications.find_by_provider auth.provider
        raise "Can't have duplicate email addresses: #{email}. " +
              "There is an user with an authentication for this provider #{auth.provider} " +
              "and the same email already."
      end
      # There is no authentication for this provider and user
      user = existing_user_by_email
    else
      if Settings.enable_user_registration && User.find_by(username: auth.extra.username)
        raise "Can't have duplicate usernames: #{auth.extra.username}. " +
              "There is a user with the same username already."
      end
      # no user with this email or username, so make a new user with a random password
      user = User.new(
        email:    email,
        username: auth.extra.username,
        name:     auth.extra.name,
        password: Devise.friendly_token[0,20]
      )
      user.skip_confirmation! if Settings.enable_user_registration # This isn't defined if local registrations aren't enabled
      user.save!
    end
    # create new authentication for this user that we found or created
    user.authentications.create(
      provider: auth.provider,
      uid:      auth.uid,
      token:    auth.credentials.token
    )
    user
  end

end

redpajama_set_name: RedPajamaGithub


text:
'use strict';

module.exports = {
  up: function (migration, DataTypes, done) {
    migration
      .addColumn('User', 'isAdmin', {
        type: DataTypes.BOOLEAN,
        defaultValue: false,
        allowNull: false
      })
      .done(function (err) {
        if (err) {
          done(err);
        } else {
          migration
            .addColumn('User', 'signature', DataTypes.TEXT)
            .done(function (err) {
              if (err) {
                done(err);
              } else {
                migration.addColumn('User', 'shopId', {
                  type: DataTypes.INTEGER,
                  allowNull: true
                }).done(function () {
                  done();
                });
              }
            });
        }
      });
  },

  down: function (migration, DataTypes, done) {
    migration.removeColumn('User', 'signature').done(function (err) {
      if (err) {
        done(err);
      } else {
        migration.removeColumn('User', 'shopId').done(function (err) {
          if (err) {
            done(err);
          } else {
            migration.removeColumn('User', 'isAdmin').done(function () {
              done();
            });
          }
        });
      }
    });
  }
};


text:
/**
 *
 */
package chapter1AdvancedClassDesign.chapter1_1RewievingOCAConcepts.accessModifiers.hiearchy.species;

import chapter1AdvancedClassDesign.chapter1_1RewievingOCAConcepts.accessModifiers.hiearchy.Fish;

/**
 * @author tkurt
 * Date: Mar 27, 2016 7:10:36 PM
 *
 */
public class Shark extends Fish {

	public int teethNumber;
	protected String fishName;
	boolean isDangerous;
	private float measurements;

	public Shark(int teethNumber, String fishName,boolean isDangerous ,float measurements ) {
		this.teethNumber = teethNumber;
		this.fishName = fishName;
		this.isDangerous = isDangerous;
		this.measurements = measurements;
	}
}


text:
module.exports = function(grunt) {
  return {

    options: {
      files: ['package.json', 'bower.json', 'Ascensor.js.jquery.json'],
      updateConfigs: ['pkg'],
      commitFiles: ['-a'],
      pushTo: 'origin',
      commitMessage: 'Release v%VERSION%'
    }

  };
};


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >
    <ImageView
        android:id="@+id/list_image"
        android:layout_width="50dip"
        android:layout_height="50dip"
        />
    <LinearLayout android:id="@+id/thumbnail"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="3dip"
        android:layout_alignParentLeft="true"
        android:layout_marginRight="5dip"
        android:orientation="vertical">
    <TextView
        android:id="@+id/convoShy"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignTop="@+id/thumbnail"
        android:layout_toRightOf="@+id/thumbnail"
        android:text="Shy1"
        android:textColor="#040404"
        android:typeface="sans"
        android:textSize="15dip"
        android:textStyle="bold"/>
    <TextView
        android:id="@+id/recentMsg"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/title"
        android:textColor="#343434"
        android:textSize="10dip"
        android:layout_marginTop="1dip"
        android:layout_toRightOf="@+id/thumbnail"
        android:text="Oh hi, how bout the weather today" />
</LinearLayout>
</LinearLayout>


text:
using System;

namespace SharpCompress.Common.SevenZip
{
    internal class CFileItem
    {
        public long Size { get; internal set; }
        public uint? Attrib { get; internal set; }
        public uint? Crc { get; internal set; }
        public string Name { get; internal set; }

        public bool HasStream { get; internal set; }
        public bool IsDir { get; internal set; }

        public bool CrcDefined
        {
            get { return Crc != null; }
        }

        public bool AttribDefined
        {
            get { return Attrib != null; }
        }

        public void SetAttrib(uint attrib)
        {
            this.Attrib = attrib;
        }

        public DateTime? CTime { get; internal set; }
        public DateTime? ATime { get; internal set; }
        public DateTime? MTime { get; internal set; }

        public long? StartPos { get; internal set; }
        public bool IsAnti { get; internal set; }

        internal CFileItem()
        {
            HasStream = true;
        }
    }
}


text:
/*********************************************************************
 *                                                                   *
 * Configfemtoanalysis.C - configuration macro for the femtoscopic   *
 * analysis, meant as a QA process for two-particle effects          *
 *                                                                   *
 * Author: Adam Kisiel (Adam.Kisiel@cern.ch)                         *
 *                                                                   *
 *********************************************************************/

#if !defined(__CINT__) || defined(__MAKECINT_)
#include "AliFemtoManager.h"
#include "AliFemtoEventReaderESDChain.h"
#include "AliFemtoEventReaderESDChainKine.h"
#include "AliFemtoEventReaderAODChain.h"
#include "AliFemtoSimpleAnalysis.h"
#include "AliFemtoBasicEventCut.h"
#include "AliFemtoESDTrackCut.h"
#include "AliFemtoCorrFctn.h"
#include "AliFemtoCutMonitorParticleYPt.h"
#include "AliFemtoCutMonitorParticleVertPos.h"
#include "AliFemtoCutMonitorParticleMomRes.h"
#include "AliFemtoCutMonitorParticlePID.h"
#include "AliFemtoCutMonitorEventMult.h"
#include "AliFemtoCutMonitorEventVertex.h"
#include "AliFemtoShareQualityTPCEntranceSepPairCut.h"
#include "AliFemtoPairCutAntiGamma.h"
#include "AliFemtoPairCutRadialDistance.h"
#include "AliFemtoQinvCorrFctn.h"
#include "AliFemtoCorrFctnNonIdDR.h"
#include "AliFemtoShareQualityCorrFctn.h"
#include "AliFemtoTPCInnerCorrFctn.h"
#include "AliFemtoVertexMultAnalysis.h"
#include "AliFemtoCorrFctn3DSpherical.h"
#include "AliFemtoChi2CorrFctn.h"
#include "AliFemtoCorrFctnTPCNcls.h"
#include "AliFemtoBPLCMS3DCorrFctn.h"
#include "AliFemtoCorrFctn3DLCMSSym.h"
#include "AliFemtoModelBPLCMSCorrFctn.h"
#include "AliFemtoModelCorrFctn3DSpherical.h"
#include "AliFemtoModelGausLCMSFreezeOutGenerator.h"
#include "AliFemtoModelGausRinvFreezeOutGenerator.h"
#include "AliFemtoModelManager.h"
#include "AliFemtoModelWeightGeneratorBasic.h"
#include "AliFemtoModelWeightGeneratorLednicky.h"
#include "AliFemtoCorrFctnDirectYlm.h"
#include "AliFemtoModelCorrFctnDirectYlm.h"
#include "AliFemtoModelCorrFctnSource.h"
#include "AliFemtoCutMonitorParticlePtPDG.h"
#include "AliFemtoKTPairCut.h"
#endif

//________________________________________________________________________
AliFemtoManager* ConfigFemtoAnalysis() {

  double PionMass = 0.13956995;
  double KaonMass = 0.493677;
  double ProtonMass = 0.938272013;

  int runmults[10] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
  int multbins[11] = {0.001, 50, 100, 200, 300, 400, 500, 600, 700, 800, 900};

  int runch[3] = {1, 1, 1};
  const char *chrgs[3] = { "pip", "pim", "pimpip" };

  int runktdep = 1;
  double ktrng[3] = {0.01, 0.7, 100.0};
  //  double ktrng[8] = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 1.0};

  int numOfMultBins = 10;
  int numOfChTypes = 3;
  int numOfkTbins = 2;

  int runqinv = 1;
  int runshlcms = 1;// 0:PRF(PAP), 1:LCMS(PP,APAP)

  int runtype = 2; // Types 0 - global, 1 - ITS only, 2 - TPC Inner
  int isrealdata = 1;

  int gammacut = 1;

  double shqmax = 1.2;
  int nbinssh = 100;

  AliFemtoEventReaderAODChain *Reader = new AliFemtoEventReaderAODChain();
  Reader->SetFilterBit(7);
  Reader->SetCentralityPreSelection(0.001, 910);

  AliFemtoManager* Manager = new AliFemtoManager();
  Manager->SetEventReader(Reader);

  AliFemtoVertexMultAnalysis    *anetaphitpc[10*3];
  AliFemtoBasicEventCut         *mecetaphitpc[10*3];
  AliFemtoCutMonitorEventMult   *cutPassEvMetaphitpc[10*3];
  AliFemtoCutMonitorEventMult   *cutFailEvMetaphitpc[10*3];
  AliFemtoCutMonitorEventVertex *cutPassEvVetaphitpc[10*3];
  AliFemtoCutMonitorEventVertex *cutFailEvVetaphitpc[10*3];
  AliFemtoESDTrackCut           *dtc1etaphitpc[10*3];
  AliFemtoESDTrackCut           *dtc2etaphitpc[10*3];
  AliFemtoCutMonitorParticleYPt *cutPass1YPtetaphitpc[10*3];
  AliFemtoCutMonitorParticleYPt *cutFail1YPtetaphitpc[10*3];
  AliFemtoCutMonitorParticlePID *cutPass1PIDetaphitpc[10*3];
  AliFemtoCutMonitorParticlePID *cutFail1PIDetaphitpc[10*3];
  AliFemtoCutMonitorParticleYPt *cutPass2YPtetaphitpc[10*3];
  AliFemtoCutMonitorParticleYPt *cutFail2YPtetaphitpc[10*3];
  AliFemtoCutMonitorParticlePID *cutPass2PIDetaphitpc[10*3];
  AliFemtoCutMonitorParticlePID *cutFail2PIDetaphitpc[10*3];
  //   AliFemtoPairCutAntiGamma      *sqpcetaphitpcdiff[10*3];
  //   AliFemtoShareQualityTPCEntranceSepPairCut      *sqpcetaphitpcsame[10*3];
  AliFemtoPairCutAntiGamma      *sqpcetaphitpc[10*3];
  //  AliFemtoPairCutRadialDistance      *sqpcetaphitpc[10*3];
  //  AliFemtoChi2CorrFctn          *cchiqinvetaphitpc[20*2];
  AliFemtoKTPairCut             *ktpcuts[10*3*2];
  AliFemtoCorrFctnDirectYlm     *cylmkttpc[10*3];
  //AliFemtoCorrFctnDirectYlm     *cylmetaphitpc[10*3];
  AliFemtoQinvCorrFctn          *cqinvkttpc[10*3*2];
  AliFemtoQinvCorrFctn          *cqinvtpc[10*3];
  AliFemtoCorrFctnNonIdDR       *ckstartpc[10*3];
  AliFemtoCorrFctnDEtaDPhi      *cdedpetaphi[10*3];

  //   AliFemtoCorrFctn3DLCMSSym     *cq3dlcmskttpc[20*2];
  //   AliFemtoCorrFctnTPCNcls       *cqinvnclstpc[20];
  //   AliFemtoShareQualityCorrFctn  *cqinvsqtpc[20*10];
  //   AliFemtoChi2CorrFctn          *cqinvchi2tpc[20];
  //   AliFemtoTPCInnerCorrFctn      *cqinvinnertpc[20*10];

  // *** Third QA task - HBT analysis with all pair cuts off, TPC only ***
  // *** Begin pion-pion (positive) analysis ***
  int aniter = 0;

  for (int imult = 0; imult < numOfMultBins; imult++) {
    if (runmults[imult]) {

      for (int ichg = 0; ichg < numOfChTypes; ichg++) {
	if (runch[ichg]) {

	  aniter = ichg * numOfMultBins + imult;
	  anetaphitpc[aniter] = new AliFemtoVertexMultAnalysis(8, -8.0, 8.0, 4, multbins[imult], multbins[imult+1]);
	  anetaphitpc[aniter]->SetNumEventsToMix(10);
	  anetaphitpc[aniter]->SetMinSizePartCollection(1);

	  mecetaphitpc[aniter] = new AliFemtoBasicEventCut();
	  mecetaphitpc[aniter]->SetEventMult(0.001,100000);
	  mecetaphitpc[aniter]->SetVertZPos(-8,8);

	  if (isrealdata)
	    mecetaphitpc[aniter]->SetAcceptOnlyPhysics(kTRUE);

	  cutPassEvMetaphitpc[aniter] = new AliFemtoCutMonitorEventMult(Form("cutPass%stpcM%i", chrgs[ichg], imult));
	  cutFailEvMetaphitpc[aniter] = new AliFemtoCutMonitorEventMult(Form("cutFail%stpcM%i", chrgs[ichg], imult));
	  mecetaphitpc[aniter]->AddCutMonitor(cutPassEvMetaphitpc[aniter], cutFailEvMetaphitpc[aniter]);

	  cutPassEvVetaphitpc[aniter] = new AliFemtoCutMonitorEventVertex(Form("cutPass%stpcM%i", chrgs[ichg], imult));
	  cutFailEvVetaphitpc[aniter] = new AliFemtoCutMonitorEventVertex(Form("cutFail%stpcM%i", chrgs[ichg], imult));
	  mecetaphitpc[aniter]->AddCutMonitor(cutPassEvVetaphitpc[aniter], cutFailEvVetaphitpc[aniter]);

	  dtc1etaphitpc[aniter] = new AliFemtoESDTrackCut();
	  dtc2etaphitpc[aniter] = new AliFemtoESDTrackCut();

	  if (ichg == 0)
	    dtc1etaphitpc[aniter]->SetCharge(1.0);
	  else if (ichg == 1)
	    dtc1etaphitpc[aniter]->SetCharge(-1.0);
	  else if (ichg == 2) {
    	    dtc1etaphitpc[aniter]->SetCharge(-1.0);
	    dtc2etaphitpc[aniter]->SetCharge(1.0);
	  }

	  dtc1etaphitpc[aniter]->SetEta(-0.8,0.8);
	  dtc1etaphitpc[aniter]->SetMass(PionMass);
	  dtc1etaphitpc[aniter]->SetMostProbablePion();

	  if (ichg == 2) {
	    dtc2etaphitpc[aniter]->SetEta(-0.8,0.8);
	    dtc2etaphitpc[aniter]->SetMass(PionMass);
	    dtc2etaphitpc[aniter]->SetMostProbablePion();
	  }

	  // Track quality cuts

	  if (runtype == 0) {
	    dtc1etaphitpc[aniter]->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
	    //	    dtc1etaphitpc[aniter]->SetStatus(AliESDtrack::kTPCrefit);
	    //    dtc1etaphitpc[aniter]->SetStatus(AliESDtrack::kITSrefit);
	    dtc1etaphitpc[aniter]->SetminTPCncls(80);
	    dtc1etaphitpc[aniter]->SetRemoveKinks(kTRUE);
	    dtc1etaphitpc[aniter]->SetLabel(kFALSE);
	    //    dtc1etaphitpc[aniter]->SetMaxITSChiNdof(6.0);
	    dtc1etaphitpc[aniter]->SetMaxTPCChiNdof(4.0);
	    dtc1etaphitpc[aniter]->SetMaxImpactXY(0.2);
	    //            dtc1etaphitpc[aniter]->SetMaxImpactXYPtDep(0.0182, 0.0350, -1.01);
	    dtc1etaphitpc[aniter]->SetMaxImpactZ(0.15);
	    //      dtc1etaphitpc[aniter]->SetMaxSigmaToVertex(6.0);
	  }
	  else if (runtype == 1) {
	    //      dtc1etaphitpc[aniter]->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
	    //    dtc1etaphitpc[aniter]->SetStatus(AliESDtrack::kTPCrefit);
	    //	    dtc1etaphitpc[aniter]->SetStatus(AliESDtrack::kITSrefit|AliESDtrack::kITSpureSA);
	    //      dtc1etaphitpc[aniter]->SetminTPCncls(70);
	    dtc1etaphitpc[aniter]->SetStatus(AliESDtrack::kITSrefit);
	    dtc1etaphitpc[aniter]->SetRemoveKinks(kTRUE);
	    dtc1etaphitpc[aniter]->SetLabel(kFALSE);
	    //    dtc1etaphitpc[aniter]->SetMaxITSChiNdof(6.0);
	    //      dtc1etaphitpc[aniter]->SetMaxTPCChiNdof(6.0);
	    dtc1etaphitpc[aniter]->SetMaxImpactXY(0.2);
	    dtc1etaphitpc[aniter]->SetMaxImpactZ(0.25);
	    //      dtc1etaphitpc[aniter]->SetMaxSigmaToVertex(6.0);
	  }
	  else if (runtype == 2) {
	    dtc1etaphitpc[aniter]->SetStatus(AliESDtrack::kTPCin);
	    dtc1etaphitpc[aniter]->SetminTPCncls(80);
	    dtc1etaphitpc[aniter]->SetRemoveKinks(kTRUE);
	    dtc1etaphitpc[aniter]->SetLabel(kFALSE);
	    dtc1etaphitpc[aniter]->SetMaxTPCChiNdof(4.0);
	    dtc1etaphitpc[aniter]->SetMaxImpactXY(2.4);
	    dtc1etaphitpc[aniter]->SetMaxImpactZ(3.0);

	    if (ichg == 2) {
	      dtc2etaphitpc[aniter]->SetStatus(AliESDtrack::kTPCin);
	      dtc2etaphitpc[aniter]->SetminTPCncls(80);
	      dtc2etaphitpc[aniter]->SetRemoveKinks(kTRUE);
	      dtc2etaphitpc[aniter]->SetLabel(kFALSE);
	      dtc2etaphitpc[aniter]->SetMaxTPCChiNdof(4.0);
	      dtc2etaphitpc[aniter]->SetMaxImpactXY(0.25);
	      dtc2etaphitpc[aniter]->SetMaxImpactZ(0.15);
	    }

	  }

	  cutPass1YPtetaphitpc[aniter] = new AliFemtoCutMonitorParticleYPt(Form("cutPass1%stpcM%i", chrgs[ichg], imult),PionMass);
	  cutFail1YPtetaphitpc[aniter] = new AliFemtoCutMonitorParticleYPt(Form("cutFail1%stpcM%i", chrgs[ichg], imult),PionMass);
	  dtc1etaphitpc[aniter]->AddCutMonitor(cutPass1YPtetaphitpc[aniter], cutFail1YPtetaphitpc[aniter]);

	  cutPass1PIDetaphitpc[aniter] = new AliFemtoCutMonitorParticlePID(Form("cutPass1%stpcM%i", chrgs[ichg], imult),2);//0-pion,1-kaon,2-proton
	  cutFail1PIDetaphitpc[aniter] = new AliFemtoCutMonitorParticlePID(Form("cutFail1%stpcM%i", chrgs[ichg], imult),2);
	  dtc1etaphitpc[aniter]->AddCutMonitor(cutPass1PIDetaphitpc[aniter], cutFail1PIDetaphitpc[aniter]);

	  if (ichg == 2){
	    cutPass2PIDetaphitpc[aniter] = new AliFemtoCutMonitorParticlePID(Form("cutPass2%stpcM%i", chrgs[ichg], imult),2);//0-pion,1-kaon,2-proton
	    cutFail2PIDetaphitpc[aniter] = new AliFemtoCutMonitorParticlePID(Form("cutFail2%stpcM%i", chrgs[ichg], imult),2);
	    dtc2etaphitpc[aniter]->AddCutMonitor(cutPass2PIDetaphitpc[aniter], cutFail2PIDetaphitpc[aniter]);
	  }

	  sqpcetaphitpc[aniter] = new AliFemtoPairCutAntiGamma();

	  if (runtype == 0) {
	    sqpcetaphitpc[aniter]->SetShareQualityMax(1.0);
	    sqpcetaphitpc[aniter]->SetShareFractionMax(0.05);
	    sqpcetaphitpc[aniter]->SetRemoveSameLabel(kFALSE);
	    // sqpcetaphitpc[aniter]->SetMaxEEMinv(0.0);
	    // sqpcetaphitpc[aniter]->SetMaxThetaDiff(0.0);
	    //	    sqpcetaphitpc[aniter]->SetTPCEntranceSepMinimum(1.5);
	    //sqpcetaphitpc[aniter]->SetRadialDistanceMinimum(0.12, 0.03);
	    //	    sqpcetaphitpc[aniter]->SetEtaDifferenceMinimum(0.02);
	  }
	  else if (runtype == 1) {
	    sqpcetaphitpc[aniter]->SetShareQualityMax(1.0);
	    sqpcetaphitpc[aniter]->SetShareFractionMax(1.05);
	    sqpcetaphitpc[aniter]->SetRemoveSameLabel(kFALSE);
	    // sqpcetaphitpc[aniter]->SetMaxEEMinv(0.002);
	    // sqpcetaphitpc[aniter]->SetMaxThetaDiff(0.008);
	    //	    sqpcetaphitpc[aniter]->SetTPCEntranceSepMinimum(5.0);
	    //sqpcetaphitpc[aniter]->SetRadialDistanceMinimum(1.2, 0.03);
	    //	    sqpcetaphitpc[aniter]->SetEtaDifferenceMinimum(0.02);
	  }
	  else if (runtype == 2) {
	    sqpcetaphitpc[aniter]->SetUseAOD(kTRUE);
	    sqpcetaphitpc[aniter]->SetShareQualityMax(1.0);
	    sqpcetaphitpc[aniter]->SetShareFractionMax(0.05);
	    sqpcetaphitpc[aniter]->SetRemoveSameLabel(kFALSE);

	    if (gammacut == 0) {
	      sqpcetaphitpc[aniter]->SetMaxEEMinv(0.0);
	      sqpcetaphitpc[aniter]->SetMaxThetaDiff(0.0);
	    }
	    else if (gammacut == 1) {
	      sqpcetaphitpc[aniter]->SetMaxEEMinv(0.002);
	      sqpcetaphitpc[aniter]->SetMaxThetaDiff(0.008);
	    }

	    //phi-star cut - values from Johana
	    // 	    sqpcetaphitpc[aniter]->SetPhiStarDifferenceMinimum(0.012);
	    // 	    sqpcetaphitpc[aniter]->SetEtaDifferenceMinimum(0.017);

	  }

	  anetaphitpc[aniter]->SetEventCut(mecetaphitpc[aniter]);

	  if (ichg == 2) {
	    anetaphitpc[aniter]->SetFirstParticleCut(dtc1etaphitpc[aniter]);
	    anetaphitpc[aniter]->SetSecondParticleCut(dtc2etaphitpc[aniter]);
	  }
	  else {
	    anetaphitpc[aniter]->SetFirstParticleCut(dtc1etaphitpc[aniter]);
	    anetaphitpc[aniter]->SetSecondParticleCut(dtc1etaphitpc[aniter]);
	  }

	  anetaphitpc[aniter]->SetPairCut(sqpcetaphitpc[aniter]);

	  if (ichg == 2) {
	    ckstartpc[aniter] = new AliFemtoCorrFctnNonIdDR(Form("ckstar%stpcM%i", chrgs[ichg], imult),nbinssh,0.0,shqmax);
	    anetaphitpc[aniter]->AddCorrFctn(ckstartpc[aniter]);
	  }
	  else {
	    cqinvtpc[aniter] = new AliFemtoQinvCorrFctn(Form("cqinv%stpcM%i", chrgs[ichg], imult),nbinssh,0.0,shqmax);
	    anetaphitpc[aniter]->AddCorrFctn(cqinvtpc[aniter]);
	  }

          cylmkttpc[aniter] = new AliFemtoCorrFctnDirectYlm(Form("cylm%stpcM%i", chrgs[ichg], imult),3,nbinssh, 0.0,shqmax,runshlcms);
          anetaphitpc[aniter]->AddCorrFctn(cylmkttpc[aniter]);

	  if (runktdep) {
	    int ktm;
	    for (int ikt=0; ikt<numOfkTbins; ikt++) {

	      ktm = aniter * numOfkTbins + ikt;
	      ktpcuts[ktm] = new AliFemtoKTPairCut(ktrng[ikt], ktrng[ikt+1]);

	      cylmkttpc[ktm] = new AliFemtoCorrFctnDirectYlm(Form("cylm%stpcM%ikT%i", chrgs[ichg], imult, ikt),3,nbinssh,0.0,shqmax,0);
	      cylmkttpc[ktm]->SetPairSelectionCut(ktpcuts[ktm]);
	      anetaphitpc[aniter]->AddCorrFctn(cylmkttpc[ktm]);

	      cqinvkttpc[ktm] = new AliFemtoQinvCorrFctn(Form("cqinv%stpcM%ikT%i", chrgs[ichg], imult, ikt),nbinssh,0.0,(imult>6)?shqmax*2.5:shqmax);
	      cqinvkttpc[ktm]->SetPairSelectionCut(ktpcuts[ktm]);
	      anetaphitpc[aniter]->AddCorrFctn(cqinvkttpc[ktm]);

	      // 	      cqinvsqtpc[ktm] = new AliFemtoShareQualityCorrFctn(Form("cqinvsq%stpcM%ikT%i", chrgs[ichg], imult, ikt),nbinssh,0.0,shqmax);
	      // 	      cqinvsqtpc[ktm]->SetPairSelectionCut(ktpcuts[ktm]);
	      // 	      anetaphitpc[aniter]->AddCorrFctn(cqinvsqtpc[ktm]);

	      // 	      cqinvinnertpc[ktm] = new AliFemtoTPCInnerCorrFctn(Form("cqinvinner%stpcM%ikT%i", chrgs[ichg], imult, ikt),nbinssh,0.0,shqmax);
	      // 	      cqinvinnertpc[ktm]->SetPairSelectionCut(ktpcuts[ktm]);
	      // 	      cqinvinnertpc[ktm]->SetRadius(1.2);
	      // 	      anetaphitpc[aniter]->AddCorrFctn(cqinvinnertpc[ktm]);

	      // 	      if (run3d) {
	      // 		cq3dlcmskttpc[ktm] = new AliFemtoCorrFctn3DLCMSSym(Form("cq3d%stpcM%ikT%i", chrgs[ichg], imult, ikt),60,(imult>3)?((imult>6)?((imult>7)?0.6:0.4):0.25):0.15);
	      // 		cq3dlcmskttpc[ktm]->SetPairSelectionCut(ktpcuts[ktm]);
	      // 		anetaphitpc[aniter]->AddCorrFctn(cq3dlcmskttpc[ktm]);
	      // 	      }
	    }
	  }

	 // cdedpetaphi[aniter] = new AliFemtoCorrFctnDEtaDPhi(Form("cdedp%stpcM%i", chrgs[ichg], imult),24, 24);
	 // anetaphitpc[aniter]->AddCorrFctn(cdedpetaphi[aniter]);

	  Manager->AddAnalysis(anetaphitpc[aniter]);
	}
      }
    }
  }
  // *** End pion-pion (positive) analysis

  return Manager;
}


text:
'use strict';
//dependencies
const express = require('express');
const router = express.Router();
const mongoose = require("mongoose");

//required service modules
const Scraper = require('../services/Scraper.js');
const Parser = require('../services/Parser.js');

//models
const Article = require('../models/Article.js');
const Comment = require('../models/Comment.js');

/*Database configuration with mongoose begin----------*/
const MONGODB_URI = 'mongodb://heroku_rq20k72c:lq7h15c1ius5rbq2457ldv5fm4@ds133368.mlab.com:33368/heroku_rq20k72c';

mongoose.connect(MONGODB_URI);

var db = mongoose.connection;
//configuring mongoose to use native promises due to mpromise deprecation
mongoose.promise = global.Promise;

// Show any mongoose errors
db.on('error',(err)=>{
  console.log("Mongoose Error: ", err);
});

// Once logged in to the db through mongoose, log a success message
db.once('open',_=> {
  console.log('Mongoose connection successful.');
});
/*end configuration------------------------------------*/

/*routes-*/
//main route to render the index handlebars template
router.get('/' , (req, res)=>{
	res.render('index');
});

//route to return all articles from the db
router.get('/articles' , (req, res)=>{
	Article.find()
				.sort({'postDate':-1})
					.populate('comments')
						.exec((err, articles)=>{
							if(err){
								res.send(err);
							} else {
								res.json(articles);
							}
						});
});
//route to return the last 50 articles in the db
router.get('/latest' , (req, res)=>{
	Article.find()
				.sort({'postDate':-1})
					.limit(50)
						.populate('comments')
							.exec((err, articles)=>{
								if(err){
									res.send(err);
								} else {
									res.json(articles);
								}
							})
});
//route to scrape , parse, and insert information into the db
router.get('/scrape', (req, res)=> {
	Scraper()
		.then((html)=>{
			Parser(html)
				.then((news)=>{
					//parser returns an array obj with an items aray that will be iterated over
					news.items.forEach((item)=>{
						//creating a link variable for comparison purposes
						let link = item.link;
						//query to the database to compare entries
						Article.findOne({'link':link})
									.exec((err, article)=>{
										//if there is no article found then save it to the db
										if(!article){
											let entry = new Article(item);
											entry.save((err, saved)=>{
												if(err){
													console.error(err)
												} else {
													console.log('SUCCESS: Insert complete Article {',saved.title,'} saved to the db.');
												}
											});
										} else {
											console.error('ERROR: Insert failed. Article {',article.title,'} already exists in the db. **');
										}
									});

					});
					res.send({msg:'scrape complete: db updated'});

				}).catch((err)=>{
					res.send(err);
				})

		})

});
//route to add a new comment
router.post('/comment/add' , (req, res)=>{
	//creating a new comment from out Comment model with the req body
	const newComment = new Comment(req.body);

	newComment.save((err, saved)=>{
		if(err){
			//sends errors to the client
			res.send(err);
		} else {
			// Find our Article and push the new comment id into the Articles comments array
		      Article.findOneAndUpdate({'_id':saved.articleRef}, { $push: { 'comments': saved._id } }, { new: true })
		      	.populate('comments')
			      	.exec((err, newdoc)=> {
				        if (err) {
				          res.send(err);
				        }
				        // Or send the newdoc to the client
				        else {
				          res.send(newdoc);
				        }
			      })
		}
	})

});
//route to remove a comment
router.delete('/comment/delete' , (req, res)=>{
	//assigns req body values for querying
	const articleRef = req.body.articleRef;
	const commentId = req.body._id;
	//removes the comment based on its unique id
	Comment.remove({'_id':commentId})
		.exec((err, removed)=>{
			if(err){
				res.send(err)
			} else {
				//removes comment id reference from the Atricle's comments array
				Article.findOneAndUpdate({'_id':articleRef}, { $pull: { 'comments':commentId } }, { new: true })
		      		.populate('comments')
				      	.exec((err, newdoc)=> {
					        if (err) {
					          res.send(err);
					        }
					        // Or send the newdoc to the client
					        else {
					          res.send(newdoc);
					        }
				      })
			}
		})

});
//exports the module as router
module.exports = router ;


text:
package aQute.maven.dto;

import aQute.bnd.util.dto.DTO;

/**
 * This is the file specification used to activate the profile. The
 * missing value is the location of a file that needs to exist, and
 * if it doesn't, the profile will be activated. On the other hand,
 * exists will test for the existence of the file and if it is
 * there, the profile will be activated.

 * Variable interpolation for these file specifications is limited to
 * ${basedir}, System properties and request properties.
 *
 */
public class ActivationFileDTO extends DTO {
	/**
	 * The name of the file that must be missing to activate the profile.
	 */
	public String missing;

	/**
	 * The name of the file that must exist to activate the profile.
	 */

	public String exists;
}


text:
package com.bazaarvoice.emodb.sor.core;

import com.google.inject.PrivateModule;

public class DataStoreAsyncModule extends PrivateModule{
    @Override
    protected void configure() {
        bind(DataStoreAsync.class).to(DefaultDataStoreAsync.class).asEagerSingleton();
        expose(DataStoreAsync.class);
    }
}


text:
require 'optparse'

module Huia
  module Commands
    class Huia

      def initialize argv
        @argv    = argv
        @options = {}

        parse_options

        print_version_string if @options[:version]
        print_help_string    if @options[:help]

        @filename = argv.pop

        unless @filename || @options[:evaluate]
          STDERR.puts "Required parameter, <filename.huia> missing."
          exit(1)
        end

        script = if @options[:evaluate]
                   ::Huia.eval(@options[:evaluate])
                 else
                   ::Huia.load(@filename, Dir.getwd)
                 end

        if @options[:bytecode_debug]
          script.dump_bytecode
        else
          script.invoke
        end
      end

      private

      def print_version_string
        puts ::Huia::DESCRIPTION
        exit(0)
      end

      def print_help_string
        puts option_parser
        exit(0)
      end

      def parse_options
        option_parser.parse! @argv
      end

      def option_parser
        OptionParser.new do |opts|
          opts.banner = "Usage: huia [options] <filename.huia>"

          opts.on('-e', '--evaluate SCRIPT', "Evaluate the passed argument as a script, then exit.") do |script|
            @options[:evaluate] = script
          end

          opts.on_tail('-b', '--bytecode', "Print compiler bytecode output for the given file, then exit.") do
            @options[:bytecode_debug] = true
          end

          opts.on_tail('-v', '--version', "Print version, and exit.") do
            @options[:version] = true
          end

          opts.on_tail('-h', '--help', "Show this message.") do
            @options[:help] = true
          end
        end
      end

    end
  end
end


text:
@class ComGoogleCommonCacheCacheStats;
@class ComGoogleCommonCollectImmutableMap;
@protocol JavaLangIterable;
@protocol JavaUtilConcurrentCallable;
@protocol JavaUtilConcurrentConcurrentMap;
@protocol JavaUtilMap;

#define ComGoogleCommonCollectForwardingObject_RESTRICT 1
#define ComGoogleCommonCollectForwardingObject_INCLUDE 1
#include "com/google/common/collect/ForwardingObject.h"

#define ComGoogleCommonCacheCache_RESTRICT 1
#define ComGoogleCommonCacheCache_INCLUDE 1
#include "com/google/common/cache/Cache.h"

@interface ComGoogleCommonCacheForwardingCache : ComGoogleCommonCollectForwardingObject < ComGoogleCommonCacheCache > {
}

- (instancetype)init;

- (id<ComGoogleCommonCacheCache>)delegate;

- (id)getIfPresentWithId:(id)key;

- (id)getWithId:(id)key
withJavaUtilConcurrentCallable:(id<JavaUtilConcurrentCallable>)valueLoader;

- (ComGoogleCommonCollectImmutableMap *)getAllPresentWithJavaLangIterable:(id<JavaLangIterable>)keys;

- (void)putWithId:(id)key
           withId:(id)value;

- (void)putAllWithJavaUtilMap:(id<JavaUtilMap>)m;

- (void)invalidateWithId:(id)key;

- (void)invalidateAllWithJavaLangIterable:(id<JavaLangIterable>)keys;

- (void)invalidateAll;

- (jlong)size;

- (ComGoogleCommonCacheCacheStats *)stats;

- (id<JavaUtilConcurrentConcurrentMap>)asMap;

- (void)cleanUp;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonCacheForwardingCache)

CF_EXTERN_C_BEGIN
CF_EXTERN_C_END
#endif

J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCacheForwardingCache)
#if !defined (_ComGoogleCommonCacheForwardingCache_SimpleForwardingCache_) && (ComGoogleCommonCacheForwardingCache_INCLUDE_ALL || ComGoogleCommonCacheForwardingCache_SimpleForwardingCache_INCLUDE)
#define _ComGoogleCommonCacheForwardingCache_SimpleForwardingCache_

@protocol ComGoogleCommonCacheCache;

@interface ComGoogleCommonCacheForwardingCache_SimpleForwardingCache : ComGoogleCommonCacheForwardingCache {
}

- (instancetype)initWithComGoogleCommonCacheCache:(id<ComGoogleCommonCacheCache>)delegate;

- (id<ComGoogleCommonCacheCache>)delegate;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonCacheForwardingCache_SimpleForwardingCache)

CF_EXTERN_C_BEGIN
CF_EXTERN_C_END
#endif

J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCacheForwardingCache_SimpleForwardingCache)


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Demo_1
{
    public partial class frmMain : Form
    {
        //We can do custom private member variables
        private int clickCount = 0;

        public frmMain()
        {
            InitializeComponent();
        }

        private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResult dr = MessageBox.Show("Are you sure you want to close this application?", "Closing",
                MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (dr == DialogResult.No)
                e.Cancel = true;
        }

        private void frmMain_MouseClick(object sender, MouseEventArgs e)
        {
            Console.WriteLine("That Tickles! (" + e.X + "," + e.Y + ")");
        }

        private void frmMain_HelpButtonClicked(object sender, CancelEventArgs e)
        {
            MessageBox.Show("There's no help for someone like you.");
        }

        private void frmMain_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            MessageBox.Show("Stop it!  That hurts!");
        }

        private void frmMain_MouseEnter(object sender, EventArgs e)
        {
            this.BackColor = Color.Red; //"this" is the object.  In this case the form.
            //Short for.
        }

        private void frmMain_MouseLeave(object sender, EventArgs e)
        {
            this.BackColor = Color.Green;
        }

        private void button_Click(object sender, EventArgs e)
        {
            label.Text = incrementClickCount().ToString();
        }

        //We can also creater our own private methods.
        private int incrementClickCount()
        {
            return ++clickCount; //Increment then return the incremented value
        }

        private void button_MouseEnter(object sender, EventArgs e)
        {
            this.BackColor = Color.Yellow;
        }

    }
}


text:
set -e

sbt coordinator/assembly
JARFILE="$(ls -t coordinator/target/scala-2.12/coordinator-assembly*.jar | head -1)"
cp "$JARFILE" "coordinator/docker/coordinator-assembly.jar"
docker build --pull=true -t data-coordinator coordinator/docker


text:
@interface HHSwipeButton(Private)
@property (nonatomic, assign) HHSwipeTableViewCellState swipeState;
@property (nonatomic, assign) NSUInteger indexInContainer;
@end

@interface HHSwipeTableView (Private)
@property (nonatomic, strong) NSMutableDictionary* swipeStates;
@end

@interface HHSwipeTableViewCell () <UIScrollViewDelegate>
// @property (nonatomic, weak) UITableView * tableView;
@property (nonatomic, weak) HHSwipeTableView * swipeTableView;
@property (nonatomic, strong) NSArray* buttonsOnLeft;
@property (nonatomic, strong) NSArray* buttonsOnRight;
@property (nonatomic, assign) CGFloat buttonWidth;
@property (nonatomic, assign) BOOL subviewsBelowScrollViewLaidOut;

@property (nonatomic, assign, readonly) NSUInteger numberOfButtonsOnLeft;
@property (nonatomic, assign, readonly) NSUInteger numberOfButtonsOnRight;
@property (nonatomic, strong) HHSwipeTableViewCellScrollView * scrollView;
@property (nonatomic, strong) UIView * scrollContentView;
@property (nonatomic, strong) UIView * rightButtonContainerView;
@property (nonatomic, strong) UIView * leftButtonContainerView;
@property (nonatomic, strong) UIButton * moreButton;
@property (nonatomic, strong) UIButton * deleteButton;
@property (nonatomic, strong) UIButton * leftButton;
@property (nonatomic, strong) HHTapGestureRecognizer * singleTapGestureRecognizer;

@end

@implementation HHSwipeTableViewCell

- (NSUInteger)numberOfButtonsOnLeft
{
    return self.buttonsOnLeft.count;
}

- (NSUInteger)numberOfButtonsOnRight
{
    return self.buttonsOnRight.count;
}

- (CGFloat)contentOffsetXForLeft
{
    return 0;
}

- (CGFloat)contentOffsetXForCenter
{
    return [self contentOffsetXForLeft] + self.buttonWidth * [self numberOfButtonsOnLeft];
}

- (CGFloat)contentOffsetXForRight
{
    return [self contentOffsetXForCenter] + self.buttonWidth * [self numberOfButtonsOnRight];
}

- (void)setContentOffsetXForState:(HHSwipeTableViewCellState)swipeState
{
    switch (swipeState) {
        case HHSwipeTableViewCellState_Left:
            if (self.scrollView.contentOffset.x != [self contentOffsetXForLeft]) {
                self.scrollView.contentOffset = CGPointMake([self contentOffsetXForLeft], 0);
            }
            break;
        case HHSwipeTableViewCellState_Center:
            if (self.scrollView.contentOffset.x != [self contentOffsetXForCenter]) {
                self.scrollView.contentOffset = CGPointMake([self contentOffsetXForCenter], 0);
            }
            break;
        case HHSwipeTableViewCellState_Right:
            if (self.scrollView.contentOffset.x != [self contentOffsetXForRight]) {
                self.scrollView.contentOffset = CGPointMake([self contentOffsetXForRight], 0);
            }
            break;
        default:
            NSAssert(NO, @"Invalid swipe state: %u", swipeState);
            break;
    }
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString*)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.scrollView = [HHSwipeTableViewCellScrollView new];
        self.scrollView.showsHorizontalScrollIndicator = NO;
        self.scrollView.showsVerticalScrollIndicator = NO;
        self.scrollView.bounces = YES;
        self.scrollView.scrollEnabled = YES;
        self.scrollView.delegate = self;
        self.scrollView.scrollsToTop = NO;

        [self.contentView addSubview:self.scrollView];

        self.scrollContentView = [UIView new];

        self.scrollView.scrollContentView = self.scrollContentView;
        [self.scrollView addSubview:self.scrollContentView];

        [[NSNotificationCenter defaultCenter] addObserver: self
                                                 selector: @selector(onOpen:)
                                                     name: HHSwipeTableViewCellDidOpenNotification
                                                   object: nil];

        [[NSNotificationCenter defaultCenter] addObserver: self
                                                 selector: @selector(onClose:)
                                                     name: HHSwipeTableViewCellNeedsToCloseNotification
                                                   object: nil];

        _singleTapGestureRecognizer = [[HHTapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)];
        _singleTapGestureRecognizer.delegate = self;
        [_scrollContentView addGestureRecognizer:_singleTapGestureRecognizer];

        [_scrollContentView setUserInteractionEnabled:YES];
        _swipeState = HHSwipeTableViewCellState_Center;

        // Note: workaround for iOS7. If this is not set the cell's separator mysteriously disappear
        // and scrollContentView and some other views turns transparent.
        // Subclasses can overwrite this behavior
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

- (void)dealloc
{
    self.singleTapGestureRecognizer.delegate = nil;
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (void)setTableView:(UITableView *)tableView
{
    _tableView = tableView;

    if ([tableView isKindOfClass:[HHSwipeTableView class]]) {
        _swipeTableView = (HHSwipeTableView *)tableView;
    } else {
        _swipeTableView = nil;
    }
}

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRequireFailureOfGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
    if (gestureRecognizer == self.singleTapGestureRecognizer) {
        if (otherGestureRecognizer == self.tableView.panGestureRecognizer) {
            return YES;
        } else if (otherGestureRecognizer == self.scrollView.panGestureRecognizer) {
            return YES;
        }
    }

    return NO;
}

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
    if (otherGestureRecognizer == self.scrollView.panGestureRecognizer ||
        otherGestureRecognizer == self.singleTapGestureRecognizer) {
        NSMutableArray *allButtons = [NSMutableArray array];
        if (self.buttonsOnLeft) {
            [allButtons addObjectsFromArray:self.buttonsOnLeft];
        }

        if (self.buttonsOnRight) {
            [allButtons addObjectsFromArray:self.buttonsOnRight];
        }

        for (HHSwipeButton *button in allButtons) {
            if (gestureRecognizer == button.tapGestureRecognizer) {
                return YES;
            }
        }
    }

    return NO;
}

- (void)onOpen:(NSNotification*)notification
{
    if (![[notification.object swipeId] isEqual:self.swipeId]) {
        if (self.swipeState != HHSwipeTableViewCellState_Center) {
            [self setSwipeState:HHSwipeTableViewCellState_Center animated:YES];
        }
    }
}

- (void)onClose:(NSNotification*)notification
{
    [self setSwipeState:HHSwipeTableViewCellState_Center animated:YES];
}

- (void)setSwipeState:(HHSwipeTableViewCellState)swipeState
{
    if (_swipeState == swipeState) {
        return;
    }

    HHTrace(@"Swipe from state: %u to state: %u", _swipeState, swipeState);

    _swipeState = swipeState;
    if (self.swipeId) {
        self.swipeTableView.swipeStates[self.swipeId] = @(swipeState);
    }
}

- (void)setSwipeState:(HHSwipeTableViewCellState)swipeState animated:(BOOL)animated
{
    HHTrace(@"Animate swipe from state: %u to state: %u", _swipeState, swipeState);

    if (!animated) {
        [self setContentOffsetXForState:swipeState];
        self.swipeState = swipeState;
        return;
    }

    dispatch_async(dispatch_get_main_queue(), ^{
        [UIView animateWithDuration:0.25
                         animations:^{
                             [self setContentOffsetXForState:swipeState];
                             self.swipeState = swipeState;
                         }
                         completion:^(BOOL finished) {

                         }];
    });
}

- (void)prepareForReuse
{
    [super prepareForReuse];
}

- (void)layoutSubviews
{
    [super layoutSubviews];

    //  Reset the flag as the subviews beneath the scroll view will need to be laid out again.
    self.subviewsBelowScrollViewLaidOut = NO;

    [self.leftButtonContainerView removeFromSuperview];
    [self.rightButtonContainerView removeFromSuperview];self.leftButtonContainerView = [[UIView alloc] initWithFrame:CGRectZero];
    self.rightButtonContainerView = [[UIView alloc] initWithFrame:CGRectZero];

    self.contentView.frame = self.bounds;
    self.scrollView.frame = self.contentView.frame;
    self.scrollView.contentSize = CGSizeMake(self.contentView.frame.size.width + [self contentOffsetXForRight], self.scrollView.frame.size.height);
    self.scrollContentView.frame = CGRectMake([self contentOffsetXForCenter], 0, self.scrollView.frame.size.width, self.scrollView.frame.size.height);

    //  Ensure that cell doesn't appear as swiped (and there is nothing underneath it yet anyway)
    //  See comments on STIT-4870 below for more info.
    if (self.swipeId) {
        HHSwipeTableViewCellState swipeState = [self.swipeTableView.swipeStates[self.swipeId] unsignedIntegerValue];
        if (swipeState == HHSwipeTableViewCellState_None) {
            [self setSwipeState:HHSwipeTableViewCellState_Center animated:NO];
        } else {
            [self setSwipeState:swipeState animated:NO];
        }

    } else {
        [self setSwipeState:HHSwipeTableViewCellState_Center animated:NO];
    }

    [self setButtonFrameWithContentOffsetX:self.scrollView.contentOffset.x];
}

- (void)buttonPressed:(UITapGestureRecognizer *)tapGestureRecognizer
{
    HHSwipeButton *button = (HHSwipeButton *)tapGestureRecognizer.view;

    NSIndexPath *indexPath = [self.tableView indexPathForCell:self];
    if (indexPath != nil) { // this can happen if the cell is no longer visible by the time we get here (rare)
        [self.swipeTableView.swipeDelegate swipeTableView:self.swipeTableView didTapButton:button atIndex:button.indexInContainer inState:button.swipeState forRowAtIndexPath:indexPath];
    }
}

#pragma mark - UIScrollViewDelegate
- (void)setButtonFrameWithContentOffsetX:(CGFloat)x
{
    // Hide the opposite buttons to remove defect while bouncing, and also when the length of left/right buttons overlap
    if (x < [self contentOffsetXForCenter]) {
        self.leftButtonContainerView.hidden = NO;
        self.rightButtonContainerView.hidden = YES;
    } else if (x > [self contentOffsetXForCenter]) {
        self.leftButtonContainerView.hidden = YES;
        self.rightButtonContainerView.hidden = NO;
    }

    CGRect leftFrame = self.leftButtonContainerView.frame;
    leftFrame.origin.x = self.scrollContentView.frame.origin.x - leftFrame.size.width + x;
    HHTrace(@"Left frame: %f", leftFrame.origin.x);
    self.leftButtonContainerView.frame = leftFrame;

    CGRect rightFrame = self.rightButtonContainerView.frame;
    rightFrame.origin.x = self.scrollContentView.frame.size.width - rightFrame.size.width + x;
    HHTrace(@"Right frame: %f", rightFrame.origin.x);
    self.rightButtonContainerView.frame = rightFrame;
}

- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
{
    //  STIT-4870: Profiling shows that the inbox scrolling bottleneck is setup of the
    //      horizontal scroll view that isn't even visible during the vertical (inbox)
    //      scrolling. Thus we layout the buttons beneath the horizontal scroll view
    //      only once the said scroll view begins dragging.

    //  Skip laying out every time a swipe begins.
    if (self.subviewsBelowScrollViewLaidOut) {
        return;
    }
    self.subviewsBelowScrollViewLaidOut = YES;

    [self.scrollView insertSubview:self.leftButtonContainerView belowSubview:self.scrollContentView];

    [self.scrollView insertSubview:self.rightButtonContainerView belowSubview:self.scrollContentView];

    CGFloat buttonHeight = self.frame.size.height; // use the cell height as the button width and height

    [self.buttonsOnLeft enumerateObjectsUsingBlock:^(HHSwipeButton *button, NSUInteger idx, BOOL *stop) {
        NSAssert([button isKindOfClass:[HHSwipeButton class]], @"Button should be of class HHSwipeButton");

        button.frame = CGRectMake(idx * self.buttonWidth, 0, self.buttonWidth, buttonHeight);
        button.indexInContainer = idx;
        button.swipeState = HHSwipeTableViewCellState_Left;
        [button.tapGestureRecognizer addTarget:self action:@selector(buttonPressed:)];
        button.tapGestureRecognizer.delegate = self;
        [self.leftButtonContainerView addSubview:button];
    }];

    self.leftButtonContainerView.frame = CGRectMake(0, 0, self.buttonsOnLeft.count * self.buttonWidth, buttonHeight);

    [self.buttonsOnRight enumerateObjectsUsingBlock:^(HHSwipeButton *button, NSUInteger idx, BOOL *stop) {
        NSAssert([button isKindOfClass:[HHSwipeButton class]], @"Button should be of class HHSwipeButton");

        button.frame = CGRectMake(idx * self.buttonWidth, 0, self.buttonWidth, buttonHeight);
        button.indexInContainer = idx;
        button.swipeState = HHSwipeTableViewCellState_Right;
        [button.tapGestureRecognizer addTarget:self action:@selector(buttonPressed:)];
        button.tapGestureRecognizer.delegate = self;
        [self.rightButtonContainerView addSubview:button];
    }];

    self.rightButtonContainerView.frame = CGRectMake(self.frame.size.width - self.buttonsOnRight.count * self.buttonWidth, 0, self.buttonsOnRight.count * self.buttonWidth, buttonHeight);
}

- (void)scrollViewDidScroll:(UIScrollView*)scrollView
{
    if (scrollView != self.scrollView) {
        return;
    }

    HHTrace(@"currentState: %u, scrollViewDidScroll: scrollView.contentOffset: %f", self.swipeState, scrollView.contentOffset.x);

    [self setHighlighted:NO animated:NO];
    [self setSelected:NO animated:NO];

    [self setButtonFrameWithContentOffsetX:scrollView.contentOffset.x];

    if (scrollView.isTracking) {
        [[NSNotificationCenter defaultCenter] postNotificationName:HHSwipeTableViewCellDidOpenNotification object:self];
    }
    // Prevent pan gesture to go over the current intended end state
    CGPoint contentOffset = scrollView.contentOffset;

    if (self.swipeState == HHSwipeTableViewCellState_Right && (contentOffset.x < [self contentOffsetXForCenter])) {
        contentOffset.x = [self contentOffsetXForCenter];
    } else if (self.swipeState == HHSwipeTableViewCellState_Left && contentOffset.x > [self contentOffsetXForCenter]) {
        contentOffset.x = [self contentOffsetXForCenter];
    }

    scrollView.contentOffset = contentOffset;
}

- (void)scrollViewWillEndDragging:(UIScrollView*)scrollView
                     withVelocity:(CGPoint)velocity
              targetContentOffset:(inout CGPoint*)targetContentOffset
{
    if (scrollView != self.scrollView) {
        return;
    }

    HHTrace(@"currentState: %u, scrollView.contentOffset: %f, velocity: %f, targetContentOffset: %f", self.swipeState, scrollView.contentOffset.x, velocity.x, targetContentOffset->x);

    switch (self.swipeState) {
        case HHSwipeTableViewCellState_Left:
        {
            if (targetContentOffset->x >= [self contentOffsetXForCenter] ||
                (velocity.x == 0 && targetContentOffset->x <= [self contentOffsetXForCenter])) {
                targetContentOffset->x = [self contentOffsetXForCenter];
                self.swipeState = HHSwipeTableViewCellState_Center;
            } else {
                targetContentOffset->x = [self contentOffsetXForLeft];
            }
            break;
        }
        case HHSwipeTableViewCellState_Center:
        {
            if ((targetContentOffset->x < [self contentOffsetXForCenter]) ||
                (velocity.x == 0 && targetContentOffset->x < [self contentOffsetXForCenter])) {
                targetContentOffset->x = [self contentOffsetXForLeft];
                self.swipeState = HHSwipeTableViewCellState_Left;
            } else if ((targetContentOffset->x > [self contentOffsetXForCenter]) ||
                       (velocity.x == 0 && targetContentOffset->x > [self contentOffsetXForCenter])) {
                targetContentOffset->x = [self contentOffsetXForRight];
                self.swipeState = HHSwipeTableViewCellState_Right;
            } else {
                targetContentOffset->x = [self contentOffsetXForCenter];
                self.swipeState = HHSwipeTableViewCellState_Center;
            }
            break;
        }
        case HHSwipeTableViewCellState_Right:
        {
            if ((targetContentOffset->x < [self contentOffsetXForRight]) ||
                (velocity.x == 0 && targetContentOffset->x >= [self contentOffsetXForCenter])) {
                targetContentOffset->x = [self contentOffsetXForCenter];
                self.swipeState = HHSwipeTableViewCellState_Center;
            } else {
                targetContentOffset->x = [self contentOffsetXForRight];
            }
            break;
        }
        default:
            NSAssert(NO, @"Current statue is not supported: %u", self.swipeState);
            break;
    }
}

- (void)handleSingleTap:(UITapGestureRecognizer *)gestureRecognizer
{
    if (gestureRecognizer.state == UIGestureRecognizerStateBegan) {
        HHTrace(@"Setting highlighted...");
        if (self.swipeState == HHSwipeTableViewCellState_Center) {
            [self setHighlighted:YES animated:NO];
        }
    } else if (gestureRecognizer.state == UIGestureRecognizerStateCancelled) {

        HHTrace(@"Setting normal...");
        [self setHighlighted:NO animated:NO];
    } else if (gestureRecognizer.state == UIGestureRecognizerStateEnded) {

        if (self.swipeState != HHSwipeTableViewCellState_Center) {
            [self setSwipeState:HHSwipeTableViewCellState_Center animated:YES];
            return;
        }

        HHTrace(@"did select....");
        NSIndexPath* indexPath = [self.tableView indexPathForCell:self];
        [self setHighlighted:NO animated:NO];

        BOOL newSelectState = !self.isSelected;
        if (newSelectState) {
            if ([self.tableView.delegate respondsToSelector:@selector(tableView:willSelectRowAtIndexPath:)]) {
                [self.tableView.delegate tableView:self.tableView willSelectRowAtIndexPath:indexPath];
            }
        } else {
            if ([self.tableView.delegate respondsToSelector:@selector(tableView:willDeselectRowAtIndexPath:)]) {
                [self.tableView.delegate tableView:self.tableView willDeselectRowAtIndexPath:indexPath];
            }
        }

        self.selected = newSelectState;

        if (newSelectState) {
            [self.tableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
            if ([self.tableView.delegate respondsToSelector:@selector(tableView:didSelectRowAtIndexPath:)]) {
                [self.tableView.delegate tableView:self.tableView didSelectRowAtIndexPath:indexPath];
            }
        } else {
            [self.tableView deselectRowAtIndexPath:indexPath animated:NO];
            if ([self.tableView.delegate respondsToSelector:@selector(tableView:didDeselectRowAtIndexPath:)]) {
                [self.tableView.delegate tableView:self.tableView didDeselectRowAtIndexPath:indexPath];
            }
        }
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
}

@end


text:
<?php

declare(strict_types=1);

namespace Nette\Utils;

use Nette;
use function is_array, is_object, strlen;

/**
 * String tools library.
 */
class Strings
{
	use Nette\StaticClass;

	public const TRIM_CHARACTERS = " \t\n\r\0\x0B\u{A0}";

	/**
	 * Checks if the string is valid in UTF-8 encoding.
	 */
	public static function checkEncoding(string $s): bool
	{
		return $s === self::fixEncoding($s);
	}

	/**
	 * Removes all invalid UTF-8 characters from a string.
	 */
	public static function fixEncoding(string $s): string
	{
		// removes xD800-xDFFF, x110000 and higher
		return htmlspecialchars_decode(htmlspecialchars($s, ENT_NOQUOTES | ENT_IGNORE, 'UTF-8'), ENT_NOQUOTES);
	}

	/**
	 * Returns a specific character in UTF-8 from code point (number in range 0x0000..D7FF or 0xE000..10FFFF).
	 * @throws Nette\InvalidArgumentException if code point is not in valid range
	 */
	public static function chr(int $code): string
	{
		if ($code < 0 || ($code >= 0xD800 && $code <= 0xDFFF) || $code > 0x10FFFF) {
			throw new Nette\InvalidArgumentException('Code point must be in range 0x0 to 0xD7FF or 0xE000 to 0x10FFFF.');
		} elseif (!extension_loaded('iconv')) {
			throw new Nette\NotSupportedException(__METHOD__ . '() requires ICONV extension that is not loaded.');
		}
		return iconv('UTF-32BE', 'UTF-8//IGNORE', pack('N', $code));
	}

	/**
	 * Starts the $haystack string with the prefix $needle?
	 */
	public static function startsWith(string $haystack, string $needle): bool
	{
		return strncmp($haystack, $needle, strlen($needle)) === 0;
	}

	/**
	 * Ends the $haystack string with the suffix $needle?
	 */
	public static function endsWith(string $haystack, string $needle): bool
	{
		return $needle === '' || substr($haystack, -strlen($needle)) === $needle;
	}

	/**
	 * Does $haystack contain $needle?
	 */
	public static function contains(string $haystack, string $needle): bool
	{
		return strpos($haystack, $needle) !== false;
	}

	/**
	 * Returns a part of UTF-8 string specified by starting position and length. If start is negative,
	 * the returned string will start at the start'th character from the end of string.
	 */
	public static function substring(string $s, int $start, int $length = null): string
	{
		if (function_exists('mb_substr')) {
			return mb_substr($s, $start, $length, 'UTF-8'); // MB is much faster
		} elseif (!extension_loaded('iconv')) {
			throw new Nette\NotSupportedException(__METHOD__ . '() requires extension ICONV or MBSTRING, neither is loaded.');
		} elseif ($length === null) {
			$length = self::length($s);
		} elseif ($start < 0 && $length < 0) {
			$start += self::length($s); // unifies iconv_substr behavior with mb_substr
		}
		return iconv_substr($s, $start, $length, 'UTF-8');
	}

	/**
	 * Removes control characters, normalizes line breaks to `\n`, removes leading and trailing blank lines,
	 * trims end spaces on lines, normalizes UTF-8 to the normal form of NFC.
	 */
	public static function normalize(string $s): string
	{
		// convert to compressed normal form (NFC)
		if (class_exists('Normalizer', false) && ($n = \Normalizer::normalize($s, \Normalizer::FORM_C)) !== false) {
			$s = $n;
		}

		$s = self::normalizeNewLines($s);

		// remove control characters; leave \t + \n
		$s = self::pcre('preg_replace', ['#[\x00-\x08\x0B-\x1F\x7F-\x9F]+#u', '', $s]);

		// right trim
		$s = self::pcre('preg_replace', ['#[\t ]+$#m', '', $s]);

		// leading and trailing blank lines
		$s = trim($s, "\n");

		return $s;
	}

	/**
	 * Standardize line endings to unix-like.
	 */
	public static function normalizeNewLines(string $s): string
	{
		return str_replace(["\r\n", "\r"], "\n", $s);
	}

	/**
	 * Converts UTF-8 string to ASCII, ie removes diacritics etc.
	 */
	public static function toAscii(string $s): string
	{
		$iconv = defined('ICONV_IMPL') ? trim(ICONV_IMPL, '"\'') : null;
		static $transliterator = null;
		if ($transliterator === null) {
			if (class_exists('Transliterator', false)) {
				$transliterator = \Transliterator::create('Any-Latin; Latin-ASCII');
			} else {
				trigger_error(__METHOD__ . "(): it is recommended to enable PHP extensions 'intl'.", E_USER_NOTICE);
				$transliterator = false;
			}
		}

		// remove control characters and check UTF-8 validity
		$s = self::pcre('preg_replace', ['#[^\x09\x0A\x0D\x20-\x7E\xA0-\x{2FF}\x{370}-\x{10FFFF}]#u', '', $s]);

		// transliteration (by Transliterator and iconv) is not optimal, replace some characters directly
		$s = strtr($s, ["\u{201E}" => '"', "\u{201C}" => '"', "\u{201D}" => '"', "\u{201A}" => "'", "\u{2018}" => "'", "\u{2019}" => "'", "\u{B0}" => '^', "\u{42F}" => 'Ya', "\u{44F}" => 'ya', "\u{42E}" => 'Yu', "\u{44E}" => 'yu', "\u{c4}" => 'Ae', "\u{d6}" => 'Oe', "\u{dc}" => 'Ue', "\u{1e9e}" => 'Ss', "\u{e4}" => 'ae', "\u{f6}" => 'oe', "\u{fc}" => 'ue', "\u{df}" => 'ss']); // " " " ' ' ' ° Я я Ю ю Ä Ö Ü ẞ ä ö ü ß
		if ($iconv !== 'libiconv') {
			$s = strtr($s, ["\u{AE}" => '(R)', "\u{A9}" => '(c)', "\u{2026}" => '...', "\u{AB}" => '<<', "\u{BB}" => '>>', "\u{A3}" => 'lb', "\u{A5}" => 'yen', "\u{B2}" => '^2', "\u{B3}" => '^3', "\u{B5}" => 'u', "\u{B9}" => '^1', "\u{BA}" => 'o', "\u{BF}" => '?', "\u{2CA}" => "'", "\u{2CD}" => '_', "\u{2DD}" => '"', "\u{1FEF}" => '', "\u{20AC}" => 'EUR', "\u{2122}" => 'TM', "\u{212E}" => 'e', "\u{2190}" => '<-', "\u{2191}" => '^', "\u{2192}" => '->', "\u{2193}" => 'V', "\u{2194}" => '<->']); // ® © … « » £ ¥ ² ³ µ ¹ º ¿ ˊ ˍ ˝ ` € ™ ℮ ← ↑ → ↓ ↔
		}

		if ($transliterator) {
			$s = $transliterator->transliterate($s);
			// use iconv because The transliterator leaves some characters out of ASCII, eg → ʾ
			if ($iconv === 'glibc') {
				$s = strtr($s, '?', "\x01"); // temporarily hide ? to distinguish them from the garbage that iconv creates
				$s = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $s);
				$s = str_replace(['?', "\x01"], ['', '?'], $s); // remove garbage and restore ? characters
			} elseif ($iconv === 'libiconv') {
				$s = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $s);
			} else { // null or 'unknown' (#216)
				$s = self::pcre('preg_replace', ['#[^\x00-\x7F]++#', '', $s]); // remove non-ascii chars
			}
		} elseif ($iconv === 'glibc' || $iconv === 'libiconv') {
			// temporarily hide these characters to distinguish them from the garbage that iconv creates
			$s = strtr($s, '`\'"^~?', "\x01\x02\x03\x04\x05\x06");
			if ($iconv === 'glibc') {
				// glibc implementation is very limited. transliterate into Windows-1250 and then into ASCII, so most Eastern European characters are preserved
				$s = iconv('UTF-8', 'WINDOWS-1250//TRANSLIT//IGNORE', $s);
				$s = strtr(
					$s,
					"\xa5\xa3\xbc\x8c\xa7\x8a\xaa\x8d\x8f\x8e\xaf\xb9\xb3\xbe\x9c\x9a\xba\x9d\x9f\x9e\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\x96\xa0\x8b\x97\x9b\xa6\xad\xb7",
					'ALLSSSSTZZZallssstzzzRAAAALCCCEEEEIIDDNNOOOOxRUUUUYTsraaaalccceeeeiiddnnooooruuuuyt- <->|-.'
				);
				$s = self::pcre('preg_replace', ['#[^\x00-\x7F]++#', '', $s]);
			} else {
				$s = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $s);
			}
			// remove garbage that iconv creates during transliteration (eg Ý -> Y')
			$s = str_replace(['`', "'", '"', '^', '~', '?'], '', $s);
			// restore temporarily hidden characters
			$s = strtr($s, "\x01\x02\x03\x04\x05\x06", '`\'"^~?');
		} else {
			$s = self::pcre('preg_replace', ['#[^\x00-\x7F]++#', '', $s]); // remove non-ascii chars
		}

		return $s;
	}

	/**
	 * Modifies the UTF-8 string to the form used in the URL, ie removes diacritics and replaces all characters
	 * except letters of the English alphabet and numbers with a hyphens.
	 */
	public static function webalize(string $s, string $charlist = null, bool $lower = true): string
	{
		$s = self::toAscii($s);
		if ($lower) {
			$s = strtolower($s);
		}
		$s = self::pcre('preg_replace', ['#[^a-z0-9' . ($charlist !== null ? preg_quote($charlist, '#') : '') . ']+#i', '-', $s]);
		$s = trim($s, '-');
		return $s;
	}

	/**
	 * Truncates a UTF-8 string to given maximal length, while trying not to split whole words. Only if the string is truncated,
	 * an ellipsis (or something else set with third argument) is appended to the string.
	 */
	public static function truncate(string $s, int $maxLen, string $append = "\u{2026}"): string
	{
		if (self::length($s) > $maxLen) {
			$maxLen -= self::length($append);
			if ($maxLen < 1) {
				return $append;

			} elseif ($matches = self::match($s, '#^.{1,' . $maxLen . '}(?=[\s\x00-/:-@\[-`{-~])#us')) {
				return $matches[0] . $append;

			} else {
				return self::substring($s, 0, $maxLen) . $append;
			}
		}
		return $s;
	}

	/**
	 * Indents a multiline text from the left. Second argument sets how many indentation chars should be used,
	 * while the indent itself is the third argument (*tab* by default).
	 */
	public static function indent(string $s, int $level = 1, string $chars = "\t"): string
	{
		if ($level > 0) {
			$s = self::replace($s, '#(?:^|[\r\n]+)(?=[^\r\n])#', '$0' . str_repeat($chars, $level));
		}
		return $s;
	}

	/**
	 * Converts all characters of UTF-8 string to lower case.
	 */
	public static function lower(string $s): string
	{
		return mb_strtolower($s, 'UTF-8');
	}

	/**
	 * Converts the first character of a UTF-8 string to lower case and leaves the other characters unchanged.
	 */
	public static function firstLower(string $s): string
	{
		return self::lower(self::substring($s, 0, 1)) . self::substring($s, 1);
	}

	/**
	 * Converts all characters of a UTF-8 string to upper case.
	 */
	public static function upper(string $s): string
	{
		return mb_strtoupper($s, 'UTF-8');
	}

	/**
	 * Converts the first character of a UTF-8 string to upper case and leaves the other characters unchanged.
	 */
	public static function firstUpper(string $s): string
	{
		return self::upper(self::substring($s, 0, 1)) . self::substring($s, 1);
	}

	/**
	 * Converts the first character of every word of a UTF-8 string to upper case and the others to lower case.
	 */
	public static function capitalize(string $s): string
	{
		return mb_convert_case($s, MB_CASE_TITLE, 'UTF-8');
	}

	/**
	 * Compares two UTF-8 strings or their parts, without taking character case into account. If length is null, whole strings are compared,
	 * if it is negative, the corresponding number of characters from the end of the strings is compared,
	 * otherwise the appropriate number of characters from the beginning is compared.
	 */
	public static function compare(string $left, string $right, int $length = null): bool
	{
		if (class_exists('Normalizer', false)) {
			$left = \Normalizer::normalize($left, \Normalizer::FORM_D); // form NFD is faster
			$right = \Normalizer::normalize($right, \Normalizer::FORM_D); // form NFD is faster
		}

		if ($length < 0) {
			$left = self::substring($left, $length, -$length);
			$right = self::substring($right, $length, -$length);
		} elseif ($length !== null) {
			$left = self::substring($left, 0, $length);
			$right = self::substring($right, 0, $length);
		}
		return self::lower($left) === self::lower($right);
	}

	/**
	 * Finds the common prefix of strings or returns empty string if the prefix was not found.
	 * @param  string[]  $strings
	 */
	public static function findPrefix(array $strings): string
	{
		$first = array_shift($strings);
		for ($i = 0; $i < strlen($first); $i++) {
			foreach ($strings as $s) {
				if (!isset($s[$i]) || $first[$i] !== $s[$i]) {
					while ($i && $first[$i - 1] >= "\x80" && $first[$i] >= "\x80" && $first[$i] < "\xC0") {
						$i--;
					}
					return substr($first, 0, $i);
				}
			}
		}
		return $first;
	}

	/**
	 * Returns number of characters (not bytes) in UTF-8 string.
	 * That is the number of Unicode code points which may differ from the number of graphemes.
	 */
	public static function length(string $s): int
	{
		return function_exists('mb_strlen')
			? mb_strlen($s, 'UTF-8')
			: strlen(utf8_decode($s));
	}

	/**
	 * Removes all left and right side spaces (or the characters passed as second argument) from a UTF-8 encoded string.
	 */
	public static function trim(string $s, string $charlist = self::TRIM_CHARACTERS): string
	{
		$charlist = preg_quote($charlist, '#');
		return self::replace($s, '#^[' . $charlist . ']+|[' . $charlist . ']+$#Du', '');
	}

	/**
	 * Pads a UTF-8 string to given length by prepending the $pad string to the beginning.
	 */
	public static function padLeft(string $s, int $length, string $pad = ' '): string
	{
		$length = max(0, $length - self::length($s));
		$padLen = self::length($pad);
		return str_repeat($pad, (int) ($length / $padLen)) . self::substring($pad, 0, $length % $padLen) . $s;
	}

	/**
	 * Pads UTF-8 string to given length by appending the $pad string to the end.
	 */
	public static function padRight(string $s, int $length, string $pad = ' '): string
	{
		$length = max(0, $length - self::length($s));
		$padLen = self::length($pad);
		return $s . str_repeat($pad, (int) ($length / $padLen)) . self::substring($pad, 0, $length % $padLen);
	}

	/**
	 * Reverses UTF-8 string.
	 */
	public static function reverse(string $s): string
	{
		if (!extension_loaded('iconv')) {
			throw new Nette\NotSupportedException(__METHOD__ . '() requires ICONV extension that is not loaded.');
		}
		return iconv('UTF-32LE', 'UTF-8', strrev(iconv('UTF-8', 'UTF-32BE', $s)));
	}

	/**
	 * Returns part of $haystack before $nth occurence of $needle or returns null if the needle was not found.
	 * Negative value means searching from the end.
	 */
	public static function before(string $haystack, string $needle, int $nth = 1): ?string
	{
		$pos = self::pos($haystack, $needle, $nth);
		return $pos === null
			? null
			: substr($haystack, 0, $pos);
	}

	/**
	 * Returns part of $haystack after $nth occurence of $needle or returns null if the needle was not found.
	 * Negative value means searching from the end.
	 */
	public static function after(string $haystack, string $needle, int $nth = 1): ?string
	{
		$pos = self::pos($haystack, $needle, $nth);
		return $pos === null
			? null
			: substr($haystack, $pos + strlen($needle));
	}

	/**
	 * Returns position in bytes of $nth occurence of $needle in $haystack or null if the $needle was not found.
	 * Negative value of `$nth` means searching from the end.
	 */
	public static function indexOf(string $haystack, string $needle, int $nth = 1): ?int
	{
		$pos = self::pos($haystack, $needle, $nth);
		return $pos === null
			? null
			: self::length(substr($haystack, 0, $pos));
	}

	/**
	 * Returns position in bytes of $nth occurence of $needle in $haystack or null if the needle was not found.
	 */
	private static function pos(string $haystack, string $needle, int $nth = 1): ?int
	{
		if (!$nth) {
			return null;
		} elseif ($nth > 0) {
			if ($needle === '') {
				return 0;
			}
			$pos = 0;
			while (($pos = strpos($haystack, $needle, $pos)) !== false && --$nth) {
				$pos++;
			}
		} else {
			$len = strlen($haystack);
			if ($needle === '') {
				return $len;
			}
			$pos = $len - 1;
			while (($pos = strrpos($haystack, $needle, $pos - $len)) !== false && ++$nth) {
				$pos--;
			}
		}
		return Helpers::falseToNull($pos);
	}

	/**
	 * Splits a string into array by the regular expression.
	 * Argument $flag takes same arguments as preg_split(), but PREG_SPLIT_DELIM_CAPTURE is set by default.
	 */
	public static function split(string $subject, string $pattern, int $flags = 0): array
	{
		return self::pcre('preg_split', [$pattern, $subject, -1, $flags | PREG_SPLIT_DELIM_CAPTURE]);
	}

	/**
	 * Checks if given string matches a regular expression pattern and returns an array with first found match and each subpattern.
	 * Argument $flag takes same arguments as function preg_match().
	 */
	public static function match(string $subject, string $pattern, int $flags = 0, int $offset = 0): ?array
	{
		if ($offset > strlen($subject)) {
			return null;
		}
		return self::pcre('preg_match', [$pattern, $subject, &$m, $flags, $offset])
			? $m
			: null;
	}

	/**
	 * Finds all occurrences matching regular expression pattern and returns a two-dimensional array.
	 * Argument $flag takes same arguments as function preg_match_all(), but PREG_SET_ORDER is set by default.
	 */
	public static function matchAll(string $subject, string $pattern, int $flags = 0, int $offset = 0): array
	{
		if ($offset > strlen($subject)) {
			return [];
		}
		self::pcre('preg_match_all', [
			$pattern, $subject, &$m,
			($flags & PREG_PATTERN_ORDER) ? $flags : ($flags | PREG_SET_ORDER),
			$offset,
		]);
		return $m;
	}

	/**
	 * Replaces all occurrences matching regular expression $pattern which can be string or array in the form `pattern => replacement`.
	 * @param  string|array  $pattern
	 * @param  string|callable  $replacement
	 */
	public static function replace(string $subject, $pattern, $replacement = '', int $limit = -1): string
	{
		if (is_object($replacement) || is_array($replacement)) {
			if (!is_callable($replacement, false, $textual)) {
				throw new Nette\InvalidStateException("Callback '$textual' is not callable.");
			}
			return self::pcre('preg_replace_callback', [$pattern, $replacement, $subject, $limit]);

		} elseif (is_array($pattern) && is_string(key($pattern))) {
			$replacement = array_values($pattern);
			$pattern = array_keys($pattern);
		}

		return self::pcre('preg_replace', [$pattern, $replacement, $subject, $limit]);
	}

	/** @internal */
	public static function pcre(string $func, array $args)
	{
		$res = Callback::invokeSafe($func, $args, function (string $message) use ($args): void {
			// compile-time error, not detectable by preg_last_error
			throw new RegexpException($message . ' in pattern: ' . implode(' or ', (array) $args[0]));
		});

		if (($code = preg_last_error()) // run-time error, but preg_last_error & return code are liars
			&& ($res === null || !in_array($func, ['preg_filter', 'preg_replace_callback', 'preg_replace'], true))
		) {
			throw new RegexpException((RegexpException::MESSAGES[$code] ?? 'Unknown error')
				. ' (pattern: ' . implode(' or ', (array) $args[0]) . ')', $code);
		}
		return $res;
	}
}


text:
package edu.stevens.cs549.hadoop.socialrank;

import java.io.IOException;

import org.apache.hadoop.mapreduce.*;
import org.apache.hadoop.io.*;

public class IterMapper extends Mapper<LongWritable, Text, Text, Text> {

	/* TODO: Your mapper code here */
	public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException,
			IllegalArgumentException {
		String line = value.toString(); // Converts Line to a String
		String[] sections = line.split("\t"); // Splits it into two parts. Part 1: node;rank | Part 2:
												// friend1,friend2...,friendn
		if (sections.length > 2) // Checks if the data is in the incorrect format
		{
			throw new IOException("Incorrect data format");
		}
		if (sections.length != 2) {
			return;
		}
		String[] nodes = sections[1].split(","); // Splits the friend1,friend2...,friendn into each individual friend
													// and stores it in an array
		String[] host_rank = sections[0].split(";"); // Splits the node;rank part and stores it in an array
		double rank = Double.parseDouble(host_rank[1]); // Stores the rank as a double
		int number = nodes.length; // Number of friends

		double weight = (rank / number); // Weight as per SocialRank algorithm

		String val = weight + ""; // Stores "weight" in a string
		for (int i = 0; i < number; i++) // Emits each friend and the weight couple: key: friendx value: node;weight
		{
			context.write(new Text(nodes[i]), new Text(val));
		}

		context.write(new Text(host_rank[0]), new Text("!" + sections[1])); // Writes out key: node Value:
																			// friend1,friend2,...,friendn

	}

}


text:
<?php

class Google_Service_Slides_Table extends Google_Collection
{
  protected $collection_key = 'verticalBorderRows';
  public $columns;
  protected $horizontalBorderRowsType = 'Google_Service_Slides_TableBorderRow';
  protected $horizontalBorderRowsDataType = 'array';
  public $rows;
  protected $tableColumnsType = 'Google_Service_Slides_TableColumnProperties';
  protected $tableColumnsDataType = 'array';
  protected $tableRowsType = 'Google_Service_Slides_TableRow';
  protected $tableRowsDataType = 'array';
  protected $verticalBorderRowsType = 'Google_Service_Slides_TableBorderRow';
  protected $verticalBorderRowsDataType = 'array';

  public function setColumns($columns)
  {
    $this->columns = $columns;
  }
  public function getColumns()
  {
    return $this->columns;
  }
  /**
   * @param Google_Service_Slides_TableBorderRow[]
   */
  public function setHorizontalBorderRows($horizontalBorderRows)
  {
    $this->horizontalBorderRows = $horizontalBorderRows;
  }
  /**
   * @return Google_Service_Slides_TableBorderRow[]
   */
  public function getHorizontalBorderRows()
  {
    return $this->horizontalBorderRows;
  }
  public function setRows($rows)
  {
    $this->rows = $rows;
  }
  public function getRows()
  {
    return $this->rows;
  }
  /**
   * @param Google_Service_Slides_TableColumnProperties[]
   */
  public function setTableColumns($tableColumns)
  {
    $this->tableColumns = $tableColumns;
  }
  /**
   * @return Google_Service_Slides_TableColumnProperties[]
   */
  public function getTableColumns()
  {
    return $this->tableColumns;
  }
  /**
   * @param Google_Service_Slides_TableRow[]
   */
  public function setTableRows($tableRows)
  {
    $this->tableRows = $tableRows;
  }
  /**
   * @return Google_Service_Slides_TableRow[]
   */
  public function getTableRows()
  {
    return $this->tableRows;
  }
  /**
   * @param Google_Service_Slides_TableBorderRow[]
   */
  public function setVerticalBorderRows($verticalBorderRows)
  {
    $this->verticalBorderRows = $verticalBorderRows;
  }
  /**
   * @return Google_Service_Slides_TableBorderRow[]
   */
  public function getVerticalBorderRows()
  {
    return $this->verticalBorderRows;
  }
}


text:
/**
 * @class Oskari.mapframework.bundle.coordinatedisplay.plugin.CoordinatesPlugin
 * Provides a coordinate display for map
 */
Oskari.clazz.define('Oskari.mapframework.bundle.coordinatedisplay.plugin.CoordinatesPlugin',
    /**
     * @method create called automatically on construction
     * @static
     * @param {Object} config
     *      JSON config with params needed to run the plugin
     */
    function (config, locale) {
        // FIXME see if the inherited ._loc would work...
        this._locale = locale;
        this._clazz =
            'Oskari.mapframework.bundle.coordinatedisplay.plugin.CoordinatesPlugin';
        this._defaultLocation = 'top right';
        this._index = 4;
        this._name = 'CoordinatesPlugin';
    }, {
        /**
         * @private @method _createControlElement
         * Creates UI for coordinate display and places it on the maps
         * div where this plugin registered.
         *
         *
         * @return {jQuery}
         */
        _createControlElement: function () {
            var me = this,
                loc = me._locale,
                crs = me.getMapModule().getProjection(),
                crsText = loc.crs[crs] || crs,
                el = jQuery(
                    '
' +
                    '
' + crsText + '
' +
                    '
' +
                    '
' + loc.compass.N + '
' +
                    '

' +
                    '
' +
                    '
' +
                    '
' + loc.compass.E + '
' +
                    '

' +
                    '
' +
                    '
');

            el.mousedown(function (event) {
                event.stopPropagation();
            });
            // Store coordinate value elements so we can update them fast
            me._latEl = el.find('div > div:last-child')[0];
            me._lonEl = el.find('div > div:last-child')[1];
            return el;
        },

        /**
         * @method _refresh
         * @param {Object} data contains lat/lon information to show on UI
         * Updates the given coordinates to the UI
         */
        refresh: function (data) {
            var me = this;
            if (!data || !data.latlon) {
                // update with map coordinates if coordinates not given
                var map = me.getSandbox().getMap();
                data = {
                    'latlon': {
                        'lat': Math.floor(map.getY()),
                        'lon': Math.floor(map.getX())
                    }
                };
            }
            if (me._latEl && me._lonEl) {
                me._latEl.innerHTML = Math.floor(data.latlon.lat);
                me._lonEl.innerHTML = Math.floor(data.latlon.lon);
            }
        },

        _createEventHandlers: function () {
            return {
                /**
                 * @method MouseHoverEvent
                 * See PorttiMouse.notifyHover
                 */
                MouseHoverEvent: function (event) {
                    this.refresh({
                        'latlon': {
                            'lat': Math.floor(event.getLat()),
                            'lon': Math.floor(event.getLon())
                        }
                    });
                },
                /**
                 * @method AfterMapMoveEvent
                 * Shows map center coordinates after map move
                 */
                AfterMapMoveEvent: function (event) {
                    this.refresh();
                }
            };
        }
    }, {
        'extend': ['Oskari.mapping.mapmodule.plugin.BasicMapModulePlugin'],
        /**
         * @static @property {string[]} protocol array of superclasses
         */
        'protocol': [
            "Oskari.mapframework.module.Module",
            "Oskari.mapframework.ui.module.common.mapmodule.Plugin"
        ]
    });


text:
package org.openo.nfvo.vnfmadapter.test;

import java.io.File;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openo.baseservice.remoteservice.exception.ServiceException;
import org.openo.nfvo.vnfmadapter.mocoserver.VnfmAdapterSuccessServer;
import org.openo.nfvo.vnfmadapter.util.AddSuccessChecker;
import org.openo.nfvo.vnfmadapter.util.GetSuccessChecker;
import org.openo.nfvo.vnfmadapter.util.MyTestManager;

/**
 *

 *

 *

 *
 * @author
 * @version NFVO 0.5 Sep 20, 2016
 */
public class ITAuthRoaSuccess extends MyTestManager {

    private static final String POST_PATH = "src/integration-test/resources/vnfmadapter/testcase/authroa/addauthinfosuccess.json";

    private VnfmAdapterSuccessServer vnfmAdapterServer = new VnfmAdapterSuccessServer();

    @Before
    public void setup() throws ServiceException, InterruptedException {
    	vnfmAdapterServer.start();
//    	Thread.sleep(1000*30);
    }

    @After
    public void tearDown() throws ServiceException {
    	vnfmAdapterServer.stop();
    }

    @Test
    public void testOperateSuccess1() throws ServiceException {
        execTestCase(new File(POST_PATH));
    }
}


text:
package dockertools

import (
	"strconv"

	"github.com/golang/glog"
	"k8s.io/kubernetes/pkg/api"
	kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
	"k8s.io/kubernetes/pkg/types"
)

// This file contains all docker label related constants and functions, including:
//  * label setters and getters
//  * label filters (maybe in the future)

const (
	kubernetesPodNameLabel      = "io.kubernetes.pod.name"
	kubernetesPodNamespaceLabel = "io.kubernetes.pod.namespace"
	kubernetesPodUIDLabel       = "io.kubernetes.pod.uid"

	kubernetesContainerNameLabel                   = "io.kubernetes.container.name"
	kubernetesContainerHashLabel                   = "io.kubernetes.container.hash"
	kubernetesContainerRestartCountLabel           = "io.kubernetes.container.restartCount"
	kubernetesContainerTerminationMessagePathLabel = "io.kubernetes.container.terminationMessagePath"

	kubernetesPodLabel                    = "io.kubernetes.pod.data"
	kubernetesTerminationGracePeriodLabel = "io.kubernetes.pod.terminationGracePeriod"
	kubernetesContainerLabel              = "io.kubernetes.container.name"
)

// Container information which has been labelled on each docker container
type labelledContainerInfo struct {
	PodName                string
	PodNamespace           string
	PodUID                 types.UID
	Name                   string
	Hash                   string
	RestartCount           int
	TerminationMessagePath string
}

func newLabels(container *api.Container, pod *api.Pod, restartCount int) map[string]string {
	// TODO(random-liu): Move more label initialization here
	labels := map[string]string{}
	labels[kubernetesPodNameLabel] = pod.Name
	labels[kubernetesPodNamespaceLabel] = pod.Namespace
	labels[kubernetesPodUIDLabel] = string(pod.UID)

	labels[kubernetesContainerNameLabel] = container.Name
	labels[kubernetesContainerHashLabel] = strconv.FormatUint(kubecontainer.HashContainer(container), 16)
	labels[kubernetesContainerRestartCountLabel] = strconv.Itoa(restartCount)
	labels[kubernetesContainerTerminationMessagePathLabel] = container.TerminationMessagePath

	return labels
}

func getContainerInfoFromLabel(labels map[string]string) (*labelledContainerInfo, error) {
	var err error
	containerInfo := labelledContainerInfo{
		PodName:      getStringValueFromLabel(labels, kubernetesPodNameLabel),
		PodNamespace: getStringValueFromLabel(labels, kubernetesPodNamespaceLabel),
		PodUID:       types.UID(getStringValueFromLabel(labels, kubernetesPodUIDLabel)),
		Name:         getStringValueFromLabel(labels, kubernetesContainerNameLabel),
		Hash:         getStringValueFromLabel(labels, kubernetesContainerHashLabel),
		TerminationMessagePath: getStringValueFromLabel(labels, kubernetesContainerTerminationMessagePathLabel),
	}
	containerInfo.RestartCount, err = getIntValueFromLabel(labels, kubernetesContainerRestartCountLabel)
	return &containerInfo, err
}

func getStringValueFromLabel(labels map[string]string, label string) string {
	if value, found := labels[label]; found {
		return value
	}
	// Do not report error, because there should be many old containers without label now.
	glog.V(3).Infof("Container doesn't have label %s, it may be an old or invalid container", label)
	// Return empty string "" for these containers, the caller will get value by other ways.
	return ""
}

func getIntValueFromLabel(labels map[string]string, label string) (int, error) {
	if strValue, found := labels[label]; found {
		intValue, err := strconv.Atoi(strValue)
		if err != nil {
			// This really should not happen. Just set value to 0 to handle this abnormal case
			return 0, err
		}
		return intValue, nil
	}
	// Do not report error, because there should be many old containers without label now.
	glog.V(3).Infof("Container doesn't have label %s, it may be an old or invalid container", label)
	// Just set the value to 0
	return 0, nil
}


text:
#ifndef _IMCIO_H
#define	_IMCIO_H

#include <string>
#include <list>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/symmetric.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <votca/tools/rangeparser.h>

namespace votca { namespace csg {
using namespace votca::tools;

using namespace std;

void imcio_write_dS(const string &file, ub::vector<double> &r, ub::vector<double> &dS, std::list<int> *list=NULL);
void imcio_write_matrix(const string &file, ub::matrix<double> &gmc, std::list<int> *list=NULL);
void imcio_write_index(const string &file, vector<string> &names, vector<RangeParser> &ranges);

void imcio_read_dS(const string &file, ub::vector<double> &r, ub::vector<double> &dS);
void imcio_read_matrix(const string &file, ub::matrix<double> &gmc);
void imcio_read_index(const string &file, vector<string> &names, vector<RangeParser> &ranges);

}}

#endif	/* _IMCIO_H */


text:
package dmillerw.lore.common.network.packet;

import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import dmillerw.lore.common.lore.LoreLoader;
import io.netty.buffer.ByteBuf;

/**
 * @author dmillerw
 */
public class PacketReloadLore implements IMessage {

    @Override
    public void toBytes(ByteBuf buf) {

    }

    @Override
    public void fromBytes(ByteBuf buf) {

    }

    public static class Handler implements IMessageHandler<PacketReloadLore, IMessage> {

        @Override
        public IMessage onMessage(PacketReloadLore message, MessageContext ctx) {
            LoreLoader.clear();
            LoreLoader.initialize();
            return null;
        }
    }
}


text:
<?php

/**
 * @category   Payment Gateway
 * @package    Adyen_Payment
 * @author     Adyen
 * @property   Adyen B.V
 * @copyright  Copyright (c) 2014 Adyen BV (http://www.adyen.com)
 */
class Adyen_Payment_Block_Adminhtml_System_Config_TestWebserverConfiguration extends Mage_Adminhtml_Block_System_Config_Form_Field
{

    /**
     * @var string
     */
    protected $_wizardTemplate = 'adyen/system/config/test_webserver_configuration.phtml';

    /**
     * Set template to itself
     */
    protected function _prepareLayout()
    {
        parent::_prepareLayout();
        if (!$this->getTemplate()) {
            $this->setTemplate($this->_wizardTemplate);
        }
        return $this;
    }

    /**
     * Unset some non-related element parameters
     *
     * @param Varien_Data_Form_Element_Abstract $element
     * @return string
     */
    public function render(Varien_Data_Form_Element_Abstract $element)
    {
        $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
        return parent::render($element);
    }

    /**
     * Get the button and scripts contents
     *
     * @param Varien_Data_Form_Element_Abstract $element
     * @return string
     */
    protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
    {
        $originalData = $element->getOriginalData();
        $elementHtmlId = $element->getHtmlId();
        $this->addData(array_merge(
            $this->_getButtonData($elementHtmlId, $originalData)
        ));
        return $this->_toHtml();
    }

    /**
     * Prepare button data
     *
     * @param string $elementHtmlId
     * @param array $originalData
     * @return array
     */
    protected function _getButtonData($elementHtmlId, $originalData)
    {
        return array(
            'button_label' => Mage::helper('adyen')->__($originalData['button_label']),
            'modus' => $originalData['modus'],
            'html_id' => $elementHtmlId,
            'url_webserver_validation' => Mage::helper('adminhtml')->getUrl('adminhtml/ValidateWebserverSettings')
        );
    }

}


text:
@interface REDSignUpViewController : PopoverViewController

@end


text:
"""
This example show you how to use the PyOuytlineTreeWidget to show the structure
of a python document.

The widget works in combination with a DocumentAnalyserMode. Such a mode must
be installed on the editor widget otherwise no data will be displayed.
"""
import sys
from pyqode.qt import QtCore, QtWidgets
from pyqode.core.api import code_edit
from pyqode.core.widgets import OutlineTreeWidget
from pyqode.python.widgets import PyCodeEdit

app = QtWidgets.QApplication(sys.argv)
window = QtWidgets.QMainWindow()
editor = PyCodeEdit()
editor.file.open(code_edit.__file__)
window.setCentralWidget(editor)
window.resize(800, 600)
outline = OutlineTreeWidget()
outline.set_editor(editor)
dock_outline = QtWidgets.QDockWidget('Outline')
dock_outline.setWidget(outline)
window.addDockWidget(QtCore.Qt.RightDockWidgetArea, dock_outline)
window.show()
app.exec_()


text:
namespace media {

class AlsaWrapper;

class MEDIA_EXPORT AudioManagerAlsa : public AudioManagerBase {
 public:
  AudioManagerAlsa(std::unique_ptr<AudioThread> audio_thread,
                   AudioLogFactory* audio_log_factory);

  AudioManagerAlsa(const AudioManagerAlsa&) = delete;
  AudioManagerAlsa& operator=(const AudioManagerAlsa&) = delete;

  ~AudioManagerAlsa() override;

  // Implementation of AudioManager.
  bool HasAudioOutputDevices() override;
  bool HasAudioInputDevices() override;
  void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override;
  void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) override;
  AudioParameters GetInputStreamParameters(
      const std::string& device_id) override;
  const char* GetName() override;

  // Implementation of AudioManagerBase.
  AudioOutputStream* MakeLinearOutputStream(
      const AudioParameters& params,
      const LogCallback& log_callback) override;
  AudioOutputStream* MakeLowLatencyOutputStream(
      const AudioParameters& params,
      const std::string& device_id,
      const LogCallback& log_callback) override;
  AudioInputStream* MakeLinearInputStream(
      const AudioParameters& params,
      const std::string& device_id,
      const LogCallback& log_callback) override;
  AudioInputStream* MakeLowLatencyInputStream(
      const AudioParameters& params,
      const std::string& device_id,
      const LogCallback& log_callback) override;

 protected:
  AudioParameters GetPreferredOutputStreamParameters(
      const std::string& output_device_id,
      const AudioParameters& input_params) override;

 private:
  enum StreamType {
    kStreamPlayback = 0,
    kStreamCapture,
  };

  // Gets a list of available ALSA devices.
  void GetAlsaAudioDevices(StreamType type, AudioDeviceNames* device_names);

  // Gets the ALSA devices' names and ids that support streams of the
  // given type.
  void GetAlsaDevicesInfo(StreamType type,
                          void** hint,
                          AudioDeviceNames* device_names);

  // Checks if the specific ALSA device is available.
  static bool IsAlsaDeviceAvailable(StreamType type,
                                    const char* device_name);

  static const char* UnwantedDeviceTypeWhenEnumerating(
      StreamType wanted_type);

  // Returns true if a device is present for the given stream type.
  bool HasAnyAlsaAudioDevice(StreamType stream);

  // Called by MakeLinearOutputStream and MakeLowLatencyOutputStream.
  AudioOutputStream* MakeOutputStream(const AudioParameters& params);

  // Called by MakeLinearInputStream and MakeLowLatencyInputStream.
  AudioInputStream* MakeInputStream(const AudioParameters& params,
                                    const std::string& device_id);

  std::unique_ptr<AlsaWrapper> wrapper_;
};

}  // namespace media

#endif  // MEDIA_AUDIO_ALSA_AUDIO_MANAGER_ALSA_H_


text:
<?php

namespace spec\Algorithms;

use PhpSpec\ObjectBehavior;
use Prophecy\Argument;

class FrogJumpSpec extends ObjectBehavior
{
    function it_is_initializable()
    {
        $this->shouldHaveType('Algorithms\FrogJump');
    }

    function it_should_calculate_when_no_jumps_are_needed()
    {
        $this->calculate(10, 10, 30)->shouldReturn(0);
    }

    function it_calculates_jumps_if_distance_is_1()
    {
        $this->calculate(10, 100, 1)->shouldReturn(90);
    }

    function it_calculates_if_distance_is_size_is_more_than_distance()
    {
        $this->calculate(10, 100, 91)->shouldReturn(1);
    }

    function it_calculates_the_number_of_jumps()
    {
        $this->calculate(3, 104, 5)->shouldReturn(21);
        $this->calculate(3, 1000000000, 5)->shouldReturn(200000000);
    }
}


text:
#import "HYDBase.h"
#import "HYDMapper.h"
#import "HYDConstants.h"

/*! Returns a mapper that converts NSDates to numbers.
 *  The number will be a seconds relative to a given date.
 */
HYD_EXTERN_OVERLOADED
id<HYDMapper> HYDMapDateToNumberSince1970(void);

/*! Returns a mapper that converts NSDates to numbers.
 *  The number will be a value relative to a given date.
 *
 *  @param unit The time unit the resulting number is in.
 */
HYD_EXTERN_OVERLOADED
id<HYDMapper> HYDMapDateToNumberSince1970(HYDDateTimeUnit unit);

/*! Returns a mapper that converts NSDates to numbers.
 *  The number will be seconds relative to a given date.
 *
 *  @param sinceDate The date the numeric value is relative to.
 */
HYD_EXTERN_OVERLOADED
id<HYDMapper> HYDMapDateToNumberSince(NSDate *sinceDate);

/*! Returns a mapper that converts NSDates to numbers.
 *  The number will be a value relative to a given date.
 *
 *  @param unit The time unit the resulting number is in.
 *  @param sinceDate The date the numeric value is relative to.
 */
HYD_EXTERN_OVERLOADED
id<HYDMapper> HYDMapDateToNumberSince(HYDDateTimeUnit unit, NSDate *sinceDate);

/*! Returns a mapper that converts NSDates to numbers.
 *  The number will be a seconds relative to a given date.
 *
 *  @param innerMapper The mapper that processes the source value before this mapper.
 */
HYD_EXTERN_OVERLOADED
id<HYDMapper> HYDMapDateToNumberSince1970(id<HYDMapper> innerMapper)
HYD_REQUIRE_NON_NIL(1);

/*! Returns a mapper that converts NSDates to numbers.
 *  The number will be a value relative to a given date.
 *
 *  @param innerMapper The mapper that processes the source value before this mapper.
 *  @param unit The time unit the resulting number is in.
 */
HYD_EXTERN_OVERLOADED
id<HYDMapper> HYDMapDateToNumberSince1970(id<HYDMapper> innerMapper, HYDDateTimeUnit unit)
HYD_REQUIRE_NON_NIL(1);

/*! Returns a mapper that converts NSDates to numbers.
 *  The number will be seconds relative to a given date.
 *
 *  @param innerMapper The mapper that processes the source value before this mapper.
 *  @param sinceDate The date the numeric value is relative to.
 */
HYD_EXTERN_OVERLOADED
id<HYDMapper> HYDMapDateToNumberSince(id<HYDMapper> innerMapper, NSDate *sinceDate)
HYD_REQUIRE_NON_NIL(1,2);

/*! Returns a mapper that converts NSDates to numbers.
 *  The number will be a value relative to a given date.
 *
 *  @param innerMapper The mapper that processes the source value before this mapper.
 *  @param unit The time unit the resulting number is in.
 *  @param sinceDate The date the numeric value is relative to.
 */
HYD_EXTERN_OVERLOADED
id<HYDMapper> HYDMapDateToNumberSince(id<HYDMapper> innerMapper, HYDDateTimeUnit unit, NSDate *sinceDate)
HYD_REQUIRE_NON_NIL(1,3);


text:
<archimate:Folder
    xmlns:archimate="http://www.archimatetool.com/archimate"
    name="Mapping of Risk and Security Elements to the ArchiMate Language"
    id="c83cf64d-6080-430e-aac9-0fa3d008cd98"/>