text:
'use strict';

const { yup, validateYupSchemaSync } = require('@strapi/utils');

const MAX_IMAGE_WIDTH = 750;
const MAX_IMAGE_HEIGHT = MAX_IMAGE_WIDTH;
const MAX_IMAGE_FILE_SIZE = 1024 * 1024; // 1Mo
const ALLOWED_IMAGE_FILE_TYPES = ['image/jpeg', 'image/png', 'image/svg+xml'];

const updateProjectSettings = yup
  .object({
    menuLogo: yup.string(),
  })
  .noUnknown();

const updateProjectSettingsFiles = yup
  .object({
    menuLogo: yup.object({
      name: yup.string(),
      type: yup.string().oneOf(ALLOWED_IMAGE_FILE_TYPES),
      size: yup.number().max(MAX_IMAGE_FILE_SIZE),
    }),
  })
  .noUnknown();

const updateProjectSettingsImagesDimensions = yup.object({
  menuLogo: yup.object({
    width: yup.number().max(MAX_IMAGE_WIDTH),
    height: yup.number().max(MAX_IMAGE_HEIGHT),
  }),
});

module.exports = {
  validateUpdateProjectSettings: validateYupSchemaSync(updateProjectSettings),
  validateUpdateProjectSettingsFiles: validateYupSchemaSync(updateProjectSettingsFiles),
  validateUpdateProjectSettingsImagesDimensions: validateYupSchemaSync(
    updateProjectSettingsImagesDimensions
  ),
};


text:
import Data.Char
import Data.List
import Primes

-- 2,5 gets removed due to even removal, so re-add at end
euler35 = length $ [2,5] ++ (concat $ map (filter isCircularPrime) reduced)
    where reduced = map (filter (\n -> not (containsEven n || contains5 n))) primeDigits

isCircularPrime n =
    case find (not . isPrime) (map (digitsToInt) $ rotations n) of
        Just _  -> False
        Nothing -> True

digitsToInt :: [Int] -> Int
digitsToInt xs = sum $ map (\(x,y) -> x * 10^y) $ zip (reverse xs) [0..]

rotations n = init (zipWith (++) (tails xs) (inits xs))
    where xs = noToDigit n

containsEven n =
    case find (\x -> x `mod` 2 == 0) (noToDigit n) of
        Just _ -> True
        Nothing -> False

contains5 n = case find (5 ==) (noToDigit n) of
        Just _ -> True
        Nothing -> False

noToDigit n = map (digitToInt) (show n)

-- Split ordered list of ints
-- into lists containing the same no of digits
-- e.g. [1,2,10,100] -> [[1,2],[10],[100]]
primeDigits =
    let primes = getPrimesUpTo 999999 in
    primeDigits' 1 primes []

primeDigits' _ [] ys = ys
primeDigits' n xs ys = primeDigits' (n + 1) right (ys ++ [left])
    where (left,right) = (takeWhile (<10^n) xs, dropWhile(<10^n) xs)

redpajama_set_name: RedPajamaGithub


text:
package main

import (
	"fmt"
	"regexp"
	"strings"
)

func analysisLogin(line, node string) reportLogin {
	var a reportLogin
	var l string
	a.Ldate, a.Ltime, l = extract(line)
	a.Stu = analysisStu(l)
	a.UID = analysisUID(l)
	a.Address = analysisAddress(l)
	a.IPAddr = ipToAddr(ipParse(a.Address))
	a.Version = analysisVersion(l)
	a.Platform = analysisPlatform(l)
	a.Device = analysisDevice(l)
	a.ExpectPayload = analysisExpectPayload(l)
	a.Os = analysisOS(l)
	a.Imsi = analysisImsi(l)
	a.System = analysisSystem(l)
	a.Esn = analysisEsn(l)
	a.Meid = analysisMeid(l)
	a.SerialNumber = analysisSerialNumber(l)
	a.Context = analysisContext(l)
	a.ServerNode = node
	a.PerOfTime = period(a.Ldate, a.Ltime)
	return a
}
func analysisOffline(line, node string) onAndOff {
	var b onAndOff
	var l string
	b.Ldate, b.Ltime, l = extract(line)
	b.UID = analysisUID(l)
	b.PerOfTime = period(b.Ldate, b.Ltime)
	b.Stu = analysisStu(l)
	b.ServerNode = node
	return b
}
func analysisUID(l string) string {
	uidt0 := regexp.MustCompile(`uid=\(\d+\)`)
	uidt1 := uidt0.FindString(l)
	uidt2 := regexp.MustCompile(`\d+`)
	uid := uidt2.FindString(uidt1)
	return uid
}
func analysisGid(l string) string {
	gidt0 := regexp.MustCompile(`gid=\(\d+\)`)
	gidt1 := gidt0.FindString(l)
	gidt2 := regexp.MustCompile(`\d+`)
	gid := gidt2.FindString(gidt1)
	return gid
}

func analysisStu(l string) string {
	var stu string = "others"
	if strings.Contains(l, "account"){
		j := strings.Index(l, "account")
			if j >= 2 {
				stu = l[:j-1]
			}
		} else {
			j := strings.Index(l, "uid")
			if j >= 2 {
				stu = l[:j-1]
			}
		}
		return stu
}

func analysisAddress(l string) string {
	address := regexp.MustCompile(`\((?P<ip>[\d.]*):\d+\)`).FindString(l)
	return address
}
func analysisVersion(l string) string {
	version1 := regexp.MustCompile(`(?U)version=.*\)`)
	version2 := version1.FindString(l)
	version := trimf(version2)
	return version
}
func analysisVersion2(l string) string {
	version2a := regexp.MustCompile(`(?U)version2=.*\)`)
	version2b := version2a.FindString(l)
	version2 := trimf(version2b)
	return version2
}
func analysisPlatform(l string) string {
	platform1 := regexp.MustCompile(`(?U)platform=.*\)`)
	platform2 := platform1.FindString(l)
	platform := trimf(platform2)
	return platform
}
func analysisDevice(l string) string {
	device1 := regexp.MustCompile(`(?U)device=.*\)\s`)
	device2 := device1.FindString(l)
	device := trimf(device2)
	return device
}
func analysisExpectPayload(l string) string {
	expectPayload1 := regexp.MustCompile(`(?U)expect_payload=.*\)`)
	expectPayload := expectPayload1.FindString(l)
	return expectPayload
}
func analysisOS(l string) string {
	OS1 := regexp.MustCompile(`(?U)os=.*\)`)
	OS2 := OS1.FindString(l)
	OS := trimf(OS2)
	return OS
}
func analysisSystem(l string) string {
	sys1 := regexp.MustCompile(`(?U)system=.*\)`)
	sys2 := sys1.FindString(l)
	sys := trimf(sys2)
	return sys
}
func analysisEsn(l string) string {
	esn1 := regexp.MustCompile(`(?U)esn=.*\)`)
	esn2 := esn1.FindString(l)
	esn := trimf(esn2)
	return esn
}
func analysisImsi(l string) string {
	imsi1 := regexp.MustCompile(`(?U)imsi=.*\)`)
	imsi2 := imsi1.FindString(l)
	imsi := trimf(imsi2)
	return imsi
}
func analysisSerialNumber(l string) string {
	serial := regexp.MustCompile(`(?U)serial_number=.*\)`)
	serial1 := serial.FindString(l)
	serial2 := trimf(serial1)
	return serial2
}
func analysisContext(l string) string {
	context1 := regexp.MustCompile(`(?U)Context=.*\)`)
	context2 := context1.FindString(l)
	context := trimf(context2)
	return context
}
func analysisMeid(l string) string {
	meid1 := regexp.MustCompile(`(?U)meid=.*\)`)
	meid2 := meid1.FindString(l)
	meid := trimf(meid2)
	return meid
}


text:
package org.icechamps.lava.callback;

/**
 * User: Robert.Diaz
 * Date: 3/2/13
 * Time: 10:46 AM
 *
 * @param <A> The type of the object that is passed to the callback function
 * @param <B> The type of the object that is passed to the callback function
 * @param <T> The type of the object that is returned from the callback function
 */
public interface Func2<A, B, T> {

    /**
     * Generic callback function that takes two arguments
     *
     * @param a The object to operate on
     * @param b The object to operate on
     * @return The result of the operation
     */
    public T callback(A a, B b);
}


text:
<?php

namespace Oro\Bundle\ThemeBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class OroThemeBundle extends Bundle
{
}


text:
(function() {
  'use strict';

  angular
    .module('getterSetterExample')
    .controller('RangeNumberController', RangeNumberController);

  function RangeNumberController() {
    var vm = this;

    vm.newRangeNumber = newRangeNumber;
    vm._rangeNumber = 5;
    vm.user = {
      newRangeNumber: newRangeNumber
    };

    //////////////////////

    function newRangeNumber(newRangeNumber) {
      // console.log("newRangeNumber : ", newRangeNumber, " vm._rangeNumber  :",
      //   vm._rangeNumber);
      // console.log("typeof(newRangeNumber) : ", typeof(newRangeNumber),
      //   " typeof(vm._rangeNumber)  :", typeof(vm._rangeNumber));

      if (typeof(newRangeNumber === 'string')) {
        newRangeNumber = parseInt(newRangeNumber, 10);
      }
      // Note that newName can be undefined for two reasons:
      // 1. Because it is called as a getter and thus called with no arguments
      // 2. Because the property should actually be set to undefined.
      // This happens e.g. if the input is invalid
      return arguments.length ? (vm._rangeNumber = newRangeNumber) : vm._rangeNumber;
    }

  }
})();


text:
package in.ac.iitm.students.complaint_box.adapters;

import android.content.Context;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import java.util.ArrayList;

import in.ac.iitm.students.R;
import in.ac.iitm.students.complaint_box.objects.CommentObj;

/**
 * Created by harshitha on 11/7/17.
 */

public class h_CommentsAdapter extends RecyclerView.Adapter<h_CommentsAdapter.ViewHolder> {
    private ArrayList<CommentObj> mDataset;
    private Context context;

    public h_CommentsAdapter(ArrayList<CommentObj> dataset, Context c) {
        mDataset = dataset;
        context = c;
    }

    public void addComment(CommentObj cmnt) {

        if (mDataset.get(0).getName().equals("Institute MobOps")) {
            mDataset.add(0, cmnt);
            mDataset.remove(1);
            notifyDataSetChanged();
        } else {
            mDataset.add(0, cmnt);
            notifyItemInserted(0);
        }
    }

    @Override
    public h_CommentsAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View v = LayoutInflater.from(parent.getContext())
                .inflate(R.layout.h_comment_item, parent, false);

        h_CommentsAdapter.ViewHolder vh = new h_CommentsAdapter.ViewHolder(v);
        return vh;
    }

    @Override
    public void onBindViewHolder(h_CommentsAdapter.ViewHolder holder, int position) {
        TextView name = (TextView) holder.view.findViewById(R.id.ci_name);
        TextView roomNo = (TextView) holder.view.findViewById(R.id.ci_roomNo);
        TextView date = (TextView) holder.view.findViewById(R.id.ci_date);
        TextView comStr = (TextView) holder.view.findViewById(R.id.ci_comStr);
        LinearLayout linearLayout=(LinearLayout)holder.view.findViewById(R.id.comment_item);

        final CommentObj hCommentObj = mDataset.get(position);

        name.setText(hCommentObj.getName());
        roomNo.setText(hCommentObj.getRoomNo());
        date.setText(hCommentObj.getDate());
        comStr.setText(hCommentObj.getCommentStr());

        if (hCommentObj.getRollNo().equalsIgnoreCase(context.getString(R.string.resaf_roll)) ||
                hCommentObj.getRollNo().equalsIgnoreCase(context.getString(R.string.sgs_roll)) ||
                hCommentObj.getRollNo().equalsIgnoreCase(context.getString(R.string.cocas_roll)) ||
                hCommentObj.getRollNo().equalsIgnoreCase(context.getString(R.string.has_roll)) ||
                hCommentObj.getRollNo().equalsIgnoreCase(context.getString(R.string.culsec_lit_roll)) ||
                hCommentObj.getRollNo().equalsIgnoreCase(context.getString(R.string.culsec_arts_roll)) ||
                hCommentObj.getRollNo().equalsIgnoreCase(context.getString(R.string.iar_roll)) ||
                hCommentObj.getRollNo().equalsIgnoreCase(context.getString(R.string.speaker_roll)) ||
                hCommentObj.getRollNo().equalsIgnoreCase(context.getString(R.string.sports_roll)) ||
                hCommentObj.getRollNo().equalsIgnoreCase(context.getString(R.string.mitr_roll)) ||
                hCommentObj.getRollNo().equalsIgnoreCase(context.getString(R.string.cfi_roll))) {

            linearLayout.setBackgroundColor(ContextCompat.getColor(context, R.color.colorLightGreen));
        }

    }

    @Override
    public int getItemCount() {
        return mDataset.size();
    }

    public static class ViewHolder extends RecyclerView.ViewHolder {
        public View view;

        public ViewHolder(View v) {
            super(v);
            view = v;

        }
    }
}


text:
Twig view renderer
==================

This extension allows you to use [Twig](http://twig.sensiolabs.org) templates in Yii.

###Resources
* [This extension](https://github.com/yiiext/twig-renderer)
* [Twig](https://github.com/fabpot/twig)
* [Discuss](http://www.yiiframework.com/forum/index.php?/topic/4919-twig-view-renderer/)
* [Report a bug](https://github.com/yiiext/twig-renderer/issues)

###Requirements
* Yii 1.0 or above

###Installation

####Installing manually

* Extract the release file under `protected/extensions`.
* [Download](http://twig.sensiolabs.org/installation) and extract all Twig files from `fabpot-Twig-______.zip\fabpot-Twig-______\lib\Twig\` under `protected/vendor/Twig`.
* Add the following to your config file 'components' section:

```php
<?php

  'viewRenderer' => array(
      'class' => 'ext.ETwigViewRenderer',

      // All parameters below are optional, change them to your needs
      'fileExtension' => '.twig',
      'options' => array(
          'autoescape' => true,
      ),
      'extensions' => array(
          'My_Twig_Extension',
      ),
      'globals' => array(
          'html' => 'CHtml'
      ),
      'functions' => array(
          'rot13' => 'str_rot13',
      ),
      'filters' => array(
          'jencode' => 'CJSON::encode',
      ),
      // Change template syntax to Smarty-like (not recommended)
      'lexerOptions' => array(
          'tag_comment'  => array('{*', '*}'),
          'tag_block'    => array('{', '}'),
          'tag_variable' => array('{$', '}')
      ),
  ),
```

####Installing via Composer

* Get [Composer](http://getcomposer.org/)
* Create file protected/composer.json if absent:

```json
{
  "repositories":[
      {
          "type":"package",
          "package":{
              "name":"yiiext/twig-renderer",
              "version":"1.1.4",
              "source":{
                  "type":"git",
                  "url":"https://github.com/yiiext/twig-renderer",
                  "reference":"v1.1.4"
              }
          }
      }
  ],
  "require":{
      "php":">=5.3.0",
      "yiisoft/yii": "dev-master",
      "twig/twig": "1.*",
      "yiiext/twig-renderer":"1.1.*"
  }
}
```

* Run `composer update` in the protected folder of your app.
* Add the following to your config file 'components' section:

```php
<?php

  'viewRenderer' => array(
      'class' => 'application.vendor.yiiext.twig-renderer.ETwigViewRenderer',
      'twigPathAlias' => 'application.vendor.twig.twig.lib.Twig',

      // All parameters below are optional, change them to your needs
      'fileExtension' => '.twig',
      'options' => array(
          'autoescape' => true,
      ),
      'extensions' => array(
          'My_Twig_Extension',
      ),
      'globals' => array(
          'html' => 'CHtml'
      ),
      'functions' => array(
          'rot13' => 'str_rot13',
      ),
      'filters' => array(
          'jencode' => 'CJSON::encode',
      ),
      // Change template syntax to Smarty-like (not recommended)
      'lexerOptions' => array(
          'tag_comment'  => array('{*', '*}'),
          'tag_block'    => array('{', '}'),
          'tag_variable' => array('{$', '}')
      ),
  ),
```

###Usage
* See [Twig syntax](http://twig.sensiolabs.org/doc/templates.html).
* Current controller properties are accessible via {{this.pageTitle}}.
* Yii::app() object is accessible via {{App}}.
* Yii's core static classes (for example, CHtml) are accessible via {{C.ClassNameWithoutFirstC.Method}} (example: {{C.Html.textField(name,'value')}})
* To call functions or methods which return non-string result wrap these calls with 'void' function: {{void(App.clientScript.registerScriptFile(...))}}

###Widgets usage example
```html
<div id="mainmenu">
    {{ this.widget('zii.widgets.CMenu',{
        'items':[
            {'label':'Home', 'url':['/site/index']},
            {'label':'About', 'url':{0:'/site/page', 'view':'about'} },
            {'label':'Contact', 'url':['/site/contact']},
            {'label':'Login', 'url':['/site/login'], 'visible':App.user.isGuest},
            {'label':'Logout ('~App.user.name~')', 'url':['/site/logout'], 'visible':not App.user.isGuest}
        ]
    }, true) }}
</div><!-- mainmenu -->
```


text:
/**
 * @class Navy.Notify
 */
Navy.Class('Navy.Notify', {
  _count: null,
  _callback: null,

  initialize: function(count, callback) {
    if (arguments.length === 2) {
      this.set(count, callback);
    }
  },

  pass: function(){
    this._count--;

    if (this._count === 0) {
      this._execCallback();
    }
  },

  set: function(count, callback) {
    this._count = count;
    this._callback = callback;

    if (count === 0) {
      this._execCallback();
    }
  },

  _execCallback: function(){
    setTimeout(this._callback, 0);
  }
});


text:
<?php

final class DiffusionPreCommitContentCommitterProjectsHeraldField
  extends DiffusionPreCommitContentHeraldField {

  const FIELDCONST = 'diffusion.pre.commit.committer.projects';

  public function getHeraldFieldName() {
    return pht("Committer's projects");
  }

  public function getHeraldFieldValue($object) {
    $adapter = $this->getAdapter();
    $viewer = $adapter->getViewer();

    $committer_phid = $adapter->getCommitterPHID();
    if (!$committer_phid) {
      return array();
    }

    $projects = id(new PhabricatorProjectQuery())
      ->setViewer($viewer)
      ->withMemberPHIDs(array($committer_phid))
      ->execute();

    return mpull($projects, 'getPHID');
  }

  protected function getHeraldFieldStandardType() {
    return self::STANDARD_PHID_LIST;
  }

  protected function getDatasource() {
    return new PhabricatorProjectDatasource();
  }

}


text:
package bank;

import interfaces.Building;
import interfaces.Person;
import bank.interfaces.*;
import global.BusinessAgent;
import global.actions.Action;
import global.roles.Role;
import global.test.mock.LoggedEvent;

public class BankPatronRole extends Role implements BankPatron {

	//**********Data************//
	private Bank bank;  // bank = buildings.get(bank). person agent should have this
	private BankTeller myTeller;
	public enum State {
		none, goingToBank, arrivedAtBank, givingAccountInfo, beingHelped, leaving, fleeing
	};
	private State state;

	// already in Role
	//private List<Action> actions;

	// float money; person agent has this
	private float myBalance;
	private float myDebt;
	private int accountNumber;

	private Building company;
	private int companyAccount;
	private float companyBalance;
	private float companyDebt;

	private Action currentService;

	// bank patrons here on behalf of a company
	public BankPatronRole(Building company){
		super();
		this.company = company;
		this.companyAccount = ((BusinessAgent)company).getBankAccount();
		bank = null;
		myBalance = 0f;
		myDebt = 0f;
		companyBalance = 0f;
		companyDebt = 0f;
		state = State.none;
	}

	// normal bank patrons
	public BankPatronRole(){
		super();
		bank = null;
		myBalance = 0f;
		myDebt = 0f;
		this.company = null;
		this.companyAccount = 0;
		companyBalance = 0f;
		companyDebt = 0f;
		state = State.none;
	}

	//**********Messages************//

	@Override
	public void msgAtBuilding(Building bank){
		log.add(new LoggedEvent("Received msgAtBuilding"));
		state = State.arrivedAtBank;
		this.bank = (Bank) bank;
		stateChanged();
	}

	@Override
	public void msgBankIsClosed(){
		log.add(new LoggedEvent("Received msgBankIsClosed"));
		state = State.leaving;
		stateChanged();
	}

	@Override
	public void msgWhatIsYourAccountNumber(BankTeller teller){
		log.add(new LoggedEvent("Received msgWhatIsYourAccountNumber"));
		state = State.givingAccountInfo;
		myTeller = teller;
		stateChanged();
	}

	@Override
	public void msgHowMayIHelpYou(){
		log.add(new LoggedEvent("Received msgHowMayIHelpYou"));
		state = State.beingHelped;
		stateChanged();
	}

	@Override
	public void msgAccountClosed(float payout){
		log.add(new LoggedEvent("Received msgAccountClosed"));
		state = State.beingHelped;
		person.ChangeMoney(payout);
		setAccountNumber(0);
		myBalance = 0;
		myDebt = 0;
		actions.remove(currentService);
		stateChanged();
	}

	@Override
	public void msgWontCloseAccountYouStillOweUs(float debt){
		log.add(new LoggedEvent("Received msgWontCloseAccountYouStillOweUs"));
		state = State.beingHelped;
		actions.remove(currentService);
		stateChanged();
	}

	@Override
	public void msgGrantedLoanFor(float loanAmount){
		log.add(new LoggedEvent("Received msgGrantedLoanFor"));
		state = State.beingHelped;
		person.ChangeMoney(loanAmount);
		actions.remove(currentService);
		stateChanged();
	}

	@Override
	public void msgDeniedLoan(){
		log.add(new LoggedEvent("Received msgDeniedLoan"));
		state = State.beingHelped;
		actions.remove(currentService);
		stateChanged();
	}

	@Override
	public void msgLoanPaymentReceived(float paymentAccepted){
		log.add(new LoggedEvent("Received msgLoanPaymentReceived"));
		state = State.beingHelped;
		person.ChangeMoney(-paymentAccepted);
		actions.remove(currentService);
		stateChanged();
	}

	@Override
	public void msgDepositSuccessful(float transactionAmount){
		log.add(new LoggedEvent("Received msgDepositSuccessful"));
		state = State.beingHelped;
		person.ChangeMoney(-transactionAmount);
		actions.remove(currentService);
		stateChanged();
	}

	@Override
	public void msgWithdrawalSuccessful(float transactionAmount){
		log.add(new LoggedEvent("Received msgWithdrawalSuccessful"));
		state = State.beingHelped;
		person.ChangeMoney(transactionAmount);
		actions.remove(currentService);
		stateChanged();
	}

	@Override
	public void msgWithdrawalDenied(){
		log.add(new LoggedEvent("Received msgWithdrawalDenied"));
		state = State.beingHelped;
		actions.remove(currentService);
		stateChanged();
	}

	@Override
	public void msgAccountSummary(int accountNum, float balance, float loans){
		log.add(new LoggedEvent("Received msgAccountSummary"));
		state = State.beingHelped;
		if (accountNum == companyAccount && company != null){
			companyBalance = balance;
			companyDebt = loans;
		}
		else{
			setAccountNumber(accountNum);
			setMyBalance(balance);
			setMyDebt(loans);
		}
		if (currentService.getTask() == "getsummary"){
			actions.remove(currentService);
		}
		stateChanged();
	}

	@Override
	public void msgTakeTheMoney(float bankBalance){ // from the bank, for a successful robber
		log.add(new LoggedEvent("Received msgTakeTheMoney"));
		state = State.fleeing;
		person.ChangeMoney(bankBalance);
		actions.remove(currentService);
		stateChanged();
	}

	@Override
	public void msgYoureUnderArrest(){ // from security, for a failed robber
		log.add(new LoggedEvent("Received msgYoureUnderArrest"));
		state = State.leaving;
		actions.remove(currentService);
		stateChanged();
	}

	//**********Scheduler************//

	@Override
	public boolean pickAndExecuteAnAction(){
		if (state == State.fleeing){
			runAway();
			return true;
		}
		else if (!actions.isEmpty()){
			setCurrentService(actions.get(0));
			if (state == State.arrivedAtBank){
				if (currentService.getTask() == "robBank"){
					robBank();
				}
				else {
					waitInLine();
				}
				return true;
			}
			else if (state == State.givingAccountInfo){
				giveTellerAccount();
				return true;
			}
			else if (state == State.beingHelped){
				String[] action = currentService.getTask().split("\\$");
				String service = action[0];
				float amount = 0;
				if (action.length > 1){
					amount = (Float.valueOf(action[1]));
				}

				if (service.equals("deposit")){
					depositMoney(amount);
				}
				else if (service.equals("withdraw")){
					withdrawMoney(amount);
				}
				else if (service.equals("borrow")){
					askForLoan(amount);
				}
				else if (service.equals("pay")){
					makeLoanPayment(amount);
				}
				else if (service.equals("getsummary")){
					getAccountSummary();
				}
				else if (service.equals("closeaccount")){
					closeAccount();
				}
				return true;
			}
			return false;
		}
		else {
			leaveBank();
		}
		return false;
	}

	//**********Actions************//

	void robBank(){
		Do("robbing you");
		state = State.none;
		bank.msgThisIsAHoldUp(this);
	}

	void waitInLine(){
		Do("Waiting in line yay");
		state = State.none;
		bank.msgAtLocation(person, this, null); // person, role, List of actions
	}

	void giveTellerAccount(){
		state = State.none;
		if (company != null){
			Do("Here on behalf of " + company.getName() + ", account number is " + companyAccount);
			myTeller.msgMyAccountNumberIs(companyAccount);
		}
		else if (accountNumber != 0){
			Do("my account is " + accountNumber);
			myTeller.msgMyAccountNumberIs(accountNumber);
		}
		else {
			Do("Need to open account");
			myTeller.msgNeedToOpenAccount();
		}
	}

	void getAccountSummary(){
		Do("Give me account summary");
		state = State.none;
		myTeller.msgGetAccountSummary();
	}

	void askForLoan(Float amountOfLoan){
		Do("Give me a loan for $" + amountOfLoan);
		state = State.none;
		myTeller.msgAskingForLoan(amountOfLoan);
	}

	void makeLoanPayment(Float payment){
		Do("Paying back $" + payment);
		state = State.none;
		myTeller.msgRepayingLoan(payment);
	}

	void depositMoney(Float amountToDeposit){
		Do("Depositing $" + amountToDeposit);
		state = State.none;
		myTeller.msgMakingDeposit(amountToDeposit);
	}

	void withdrawMoney(Float amountToWithdraw){
		Do("Withdrawing $" + amountToWithdraw);
		state = State.none;
		myTeller.msgMakingWithdrawal(amountToWithdraw);
	}

	void closeAccount(){
		Do("Closing account");
		state = State.none;
		myTeller.msgClosingAccount();
	}

	void leaveBank(){
		Do("bye now I have $" + person.getMoney());
		state = State.none;
		if (getMyTeller() != null){ // exists for normal bank patrons but is null for robbers
			myTeller.msgNoMoreServicesNeeded();
			myTeller = null;
		}
		if (company != null){
			company = null;
			companyAccount = 0;
		}
		bank.msgLeavingAsCustomer(this);
		//gui.DoLeaveBuilding();
		person.msgLeavingLocation(this); // inactivate BankPatronRole
	}

	private void runAway() {
		Do("just robbed u o yea now I have $" + person.getMoney());
		state = State.none;
		bank.msgokThanksBye();
	}

	//**********Accessors************//

	@Override
	public void setPerson(Person person){
		this.person = person;
		this.bank = (Bank) person.getBuilding("bank");
	}
	public String getName(){ return person.getName(); }
	@Override public boolean hasIncome(){ return !(person.getJobs().isEmpty()); }
	// for unit testing...
	public Bank getBank() {	return bank;}
	public void setBank(Bank bank) {this.bank = bank;}
	public BankTeller getMyTeller() {return myTeller;}
	public void setMyTeller(BankTeller myTeller) {this.myTeller = myTeller;}

	public Building getCompany() {	return company;}
	public int getCompanyAccountNum(){ return companyAccount;}
	public void setCompany(Building company, int acc) {this.company = company; this.companyAccount = acc;}
	public float getCompanyBalance() {return companyBalance;}
	public void setCompanyBalance(float companyBalance) { this.companyBalance = companyBalance;}
	public float getCompanyDebt() {return companyDebt;}
	public void setCompanyDebt(float companyDebt) {this.companyDebt = companyDebt;}

	public int getAccountNumber() {	return accountNumber;}
	public void setAccountNumber(int accountNumber) {this.accountNumber = accountNumber;}
	public float getMyBalance() {return myBalance;}
	public void setMyBalance(float myBalance) {	this.myBalance = myBalance;}
	public float getMyDebt() {return myDebt;}
	public void setMyDebt(float myDebt) {this.myDebt = myDebt;}

	public Action getCurrentService() {return currentService;}
	public void setCurrentService(Action currentService) {this.currentService = currentService;}
	public State getState() {return state;}
	public void setState(State state) {this.state = state;}

}


text:
/* Options Framework Admin Styles */

#optionsframework {
	max-width: 840px;
	background: #fff;
}
#optionsframework h3 {
	cursor: default;
	background-color: #f1f1f1;
	border-bottom: 1px solid #ddd;
}
#optionsframework p {
	margin-bottom: 0;
	padding-bottom: 10px;
}
#optionsframework .section {
	padding: 10px 10px 0;
}
#optionsframework .group {
	padding-bottom: 40px;
}
#optionsframework .section .controls {
	float: left;
	min-width: 350px;
	width: 100%;
	padding-right: 2%;
}
#optionsframework .section .explain {
	max-width: 38%;
	float: left;
	font-size: 12px;
	line-height: 16px;
	color: #777;
}
#optionsframework .section-checkbox .controls {
	width: 98%;
}
#optionsframework .section-checkbox .explain {
	max-width: 94%;
}
#optionsframework .controls input[type=text] {
	width: 100%;
}
#optionsframework .controls input[type=text].wp-color-picker {
	width: 65px;
}
#optionsframework .controls select, #optionsframework .controls textarea {
	margin-bottom: 10px;
	width: 100%;
}
#optionsframework .section-radio label, #optionsframework .section-multicheck label {
	float: left;
	max-width: 90%;
	line-height: 16px;
	margin-bottom: 5px;
}
#optionsframework input.checkbox, #optionsframework input.of-radio {
	margin: 0 10px 5px 0;
	float: left;
	clear: both;
}
#optionsframework .section-typography .controls {
	float: none;
	width: auto;
}
#optionsframework .section-typography .explain {
	float: none;
	width: auto;
}
#optionsframework .controls .of-typography-size {
	width: 80px;
	float: left
}
#optionsframework .controls .of-typography-unit {
	width: 50px;
	margin-left: 5px;
	float: left
}
#optionsframework .controls .of-typography-face {
	width: 100px;
	margin-left: 5px;
	float: left
}
#optionsframework .controls .of-typography-style {
	width: 80px;
	margin-left: 5px;
	margin-right: 5px;
	float: left
}
#optionsframework .section-typography .wp-picker-container {
	margin-top: 2px;
}
#optionsframework .of-background-properties {
	clear: both;
	margin-top: 18px;
}
#optionsframework .controls .of-background-repeat {
	width: 125px;
	margin-right: 5px;
	float: left
}
#optionsframework .controls .of-background-position {
	width: 125px;
	margin-right: 5px;
	float: left
}
#optionsframework .controls .of-background-attachment {
	width: 125px;
	margin-right: 5px;
	float: left
}
#optionsframework .section-background .wp-picker-container {
	margin-bottom: 10px;
}
#optionsframework .controls .of-radio-img-img {
	border: 3px solid #efefef;
	margin: 0 5px 10px 0;
	display: none;
	cursor: pointer;
	float: left;
}
#optionsframework .controls .of-radio-img-selected {
	border: 3px solid #c5c5c5;
}
#optionsframework .controls .of-radio-img-img:hover {
	opacity: .8;
}
#optionsframework .controls .of-border-width {
	width: 80px;
	float: left
}
#optionsframework .controls .of-border-style {
	width: 120px;
	float: left
}
#optionsframework .hide {
	display: none;
}
#optionsframework .of-option-image {
	max-width: 340px;
	margin: 3px 0 18px 0;
}
#optionsframework .mini .controls select, #optionsframework .section .mini .controls {
	width: 140px;
}
#optionsframework .mini .controls input, #optionsframework .mini .controls {
	min-width: 140px;
	width: 140px;
}
#optionsframework .mini .explain {
	max-width: 74%;
}
/* Editor */

#optionsframework .section-editor .explain {
	max-width: 98%;
	float: none;
	margin-bottom: 5px;
}
/* Image Uploader */

#optionsframework .controls input.upload {
	width: 80%;
}
#optionsframework .screenshot {
	float: left;
	margin-left: 1px;
	position: relative;
	width: 344px;
	margin-top: 3px;
}
#optionsframework .screenshot img {
	background: #fafafa;
	border-color: #ccc #eee #eee #ccc;
	border-style: solid;
	border-width: 1px;
	float: left;
	max-width: 334px;
	padding: 4px;
	margin-bottom: 10px;
}
#optionsframework .screenshot .remove-image {
	background: url("../images/ico-delete.png") no-repeat;
	border: medium none;
	bottom: 4px;
	display: block;
	float: left;
	height: 16px;
	padding: 0;
	position: absolute;
	left: -4px;
	text-indent: -9999px;
	width: 16px;
}
#optionsframework .screenshot .no_image .file_link {
	margin-left: 20px;
}
#optionsframework .screenshot .no_image .remove-button {
	bottom: 0px;
}
#optionsframework .reset-button {
	float: left;
	cursor: pointer;
}
/* Bottom Section */

#optionsframework-submit {
	padding: 7px 10px;
	border-top: 1px solid #ddd;
	background-color: #f1f1f1;
}
#optionsframework .button-primary {
	float: right;
}
#optionsframework .section:after {
	content: "";
	display: table;
}
#optionsframework .section:after {
	clear: both;
}
#optionsframework .group .section h4, #optionsframework .group .section .option {
	float: left;
	padding: 5px;
	min-width: 170px;
}
#optionsframework .group .section {
	border-bottom: solid 1px #ccc;
}


text:
[Week 1 Home](../)

# Computer Set-Up Instructions - Linux

## Learning Competencies
By the end of this lesson, you should be able to:
- Install technologies from the command line
- Use package managment tools

## Summary
You will need to have your computer set up with the following tools for Phase 0 of Dev Bootcamp. Make sure to go through this guide step-by-step. You'll need to have each of these technologies installed to have a smooth start to Phase 0 and your future career!

## Releases
(i.e. directions - each release is necessary for the next release, so be sure to do everything in the order specified for all challenges)

## Release 0: Download Sublime Text
Download and follow instructions from [their site](http://www.sublimetext.com).
You can choose to download either Sublime Text 2 or 3.

After you download, create a symlink so you can open Sublime using `subl "filename"`

Enter this command into your terminal:
```shell
mkdir ~/bin && echo 'export "$HOME/bin:$PATH"' >> ~/.bash_profile' && ln -s /opt/SublimeText2/sublime_text ~/bin/subl
```
*NOTE:* If you are using Ubuntu or Ubuntu-derived distribution, use `~/.bash_rc` instead of `~/.bash_profile`/

Test it out by typing `subl .`. It should open all files in your current directory!

You don't have to purchase your license right away, you can "cancel" out of the dialog box as many times as you would like, but it is good practice to buy a license after you decide you like it. (Since eventually you're hoping to get paid for writing programs, you want to pay it forward in advance.)

## Release 1: Your Operating System
These instructions are optimized for use with Ubuntu. If you are using a different version of Linux you may have to translate as needed to your particular OS.

## Release 2: Get ready for install

The first step is to update our package manager apt-get. This will be done using this command:

```shell
sudo apt-get update
```

If that went without error you can now get curl:

```shell
sudo apt-get curl
```
Now we are ready to install Rbenv

## Release 3: get Rbenv

Rbenv will be your Ruby version manager. Gems will get installed there and will use its copies of Ruby over the system Ruby. Yay!

Digital Ocean wrote a great how-to on getting Rbenv and Ruby running on Ubuntu. Follow the instructions [here](https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-with-rbenv--2). This will also handle installing nodejs. Make sure that you install Ruby 2.0.0-p353 instead of 1.9.3-p392.

Also the step to open the .bashrc and fix the path is done in Release 4 so no need to complete those steps during this release.

## Release 4: Set up your Path
First you need to clone this GitHub repository into your computer and install the files. Type each line separately:

```shell
git clone https://github.com/supertopher/dotfiles.git
cd dotfiles
./install
```
Installing these files will configure your bash profile, enable auto complete, and make RSpec display with color. Note: this will replace your current bash profile.

Restart your terminal to have these changes take place.

## Release 5: Install Git

This should have been installed if you followed the digital ocean tutorial in release 3. Check by typing:

```shell
git --version
```

## Release 6: Configure Git
You then need to overwrite .gitconfig to your own username and password in GitHub. Use your name and your GitHub email address in the following format:

```shell
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
```

Now make Sublime text your preferred editor for git:
```shell
git config --global core.editor "subl -w"
```

## Release 7: Set up Sublime
Follow [these instructions](https://github.com/Devbootcamp/phase-0-handbook/blob/master/text-editor-setup.md) in the Phase 0 Handbook to make Sublime your default text editor.

## Release 8: Install Node
Node allows you to run Javascript in your terminal.

You should have installed this when installing Rbenv if yo used the digital ocean guide.

Test by typing:

```shell
node -v
```

You'll use this later in Phase 0.

## Release 9: Install Rspec
Type ```gem install rspec```

This will install RSpec, a Ruby testing framework.

## Release 10: Install SQLite
Install sqlite3 using apt-get

```shell
sudo apt-get install sqlite3 libsqlite3-dev

gem install sqlite3-ruby
```
type sqlite3 -version to test.

## Release 11: Install Postgres
Type the following commands one at a time:

NOTE: If you have trouble installing postgres, don't worry about it. You won't need it until Phase 2. We wanted to have it set up in advance when your path was all sqeakly clean and wonderful, but if you have trouble, just move on.

```shell
sudo apt-get install postgresql
```

follow the instructions during the install and you will be set. Check your install by typing:

```shell
psql -V
```
make sure it's a capital V, this prints the version and exits. If you get into psql command line hit CTRL + D to exit.

## Thats all

You now have a set up environment for development! If you are interested in this kind of thing, there is a whole job created around automating server and terminal set up. It is called DevOps, they do lots of things to make software development more efficient. Check it out! [devopsreactions](http://devopsreactions.tumblr.com/)


text:
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
	<application>ikai-blobstore</application>
	<version>1</version>

	<!-- Configure java.util.logging -->
	<system-properties>
		<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
	</system-properties>

</appengine-web-app>


text:
import {PressureService, PressureServiceReceiver, PressureStatus, SetQuantizationStatus} from '/gen/third_party/blink/public/mojom/compute_pressure/pressure_service.mojom.m.js'

class MockPressureService {
  constructor() {
    this.receiver_ = new PressureServiceReceiver(this);
    this.interceptor_ =
        new MojoInterfaceInterceptor(PressureService.$interfaceName);
    this.interceptor_.oninterfacerequest = e => {
      this.receiver_.$.bindHandle(e.handle);
    };
    this.reset();
  }

  start() {
    this.interceptor_.start();
  }

  stop() {
    this.receiver_.$.close();
    this.interceptor_.stop();

    // Wait for an event loop iteration to let any pending mojo commands in
    // the pressure service finish.
    return new Promise(resolve => setTimeout(resolve, 0));
  }

  reset() {
    this.observer_ = null;
    this.pressureState_ = null;
    this.quantization_ = null;
    this.pressureStatus_ = PressureStatus.kOk;
  }

  async bindObserver(observer) {
    if (this.observer_ !== null)
      throw new Error('BindObserver() has already been called');

    this.observer_ = observer;

    return {status: this.pressureStatus_};
  }

  isSameQuantization(quantization) {
    if (this.quantization_ === null)
      return false;

    if (quantization.cpuUtilizationThresholds.length !=
        this.quantization_.cpuUtilizationThresholds.length) {
      return false;
    }

    for (let i = 0; i < quantization.cpuUtilizationThresholds.length; i++) {
      if (quantization.cpuUtilizationThresholds[i] !=
          this.quantization_.cpuUtilizationThresholds[i]) {
        return false;
      }
    }

    return true;
  }

  async setQuantization(quantization) {
    if (this.isSameQuantization(quantization)) {
      return {status: SetQuantizationStatus.kUnchanged};
    } else {
      this.quantization_ = quantization;
      return {status: SetQuantizationStatus.kChanged};
    }
  }

  sendUpdate() {
    if (this.pressureState_ === null || this.observer_ === null)
      return;
    this.observer_.onUpdate(this.pressureState_);
  }

  setPressureState(value) {
    this.pressureState_ = value;
  }

  setExpectedFailure(expectedException) {
    assert_true(
        expectedException instanceof DOMException,
        'setExpectedFailure() expects a DOMException instance');
    if (expectedException.name === 'SecurityError') {
      this.pressureStatus_ = PressureStatus.kSecurityError;
    } else if (expectedException.name === 'NotSupportedError') {
      this.pressureStatus_ = PressureStatus.kNotSupported;
    } else {
      throw new TypeError(
          `Unexpected DOMException '${expectedException.name}'`);
    }
  }
}

export const mockPressureService = new MockPressureService();


text:
namespace map2 {
    CDSUNIT_DEFINE_RefinableMap(cc::striped_set::implementation_tag, Map_InsDelFind)

    CPPUNIT_TEST_SUITE_PART( Map_InsDelFind, run_RefinableMap )
        CDSUNIT_TEST_RefinableMap
    CPPUNIT_TEST_SUITE_END_PART()
} // namespace map2


text:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Threading;
using ArcGIS.Core.CIM;
using ArcGIS.Core.Data;
using ArcGIS.Core.Geometry;
using ArcGIS.Desktop.Catalog;
using ArcGIS.Desktop.Core;
using ArcGIS.Desktop.Core.Events;
using ArcGIS.Desktop.Editing;
using ArcGIS.Desktop.Extensions;
using ArcGIS.Desktop.Framework;
using ArcGIS.Desktop.Framework.Contracts;
using ArcGIS.Desktop.Framework.Dialogs;
using ArcGIS.Desktop.Framework.Threading.Tasks;
using ArcGIS.Desktop.Layouts;
using ArcGIS.Desktop.Layouts.Events;
using ArcGIS.Desktop.Mapping;
using ArcGIS.Desktop.Mapping.Controls;
using ArcGIS.Desktop.Mapping.Events;

namespace SymbolControls
{
  internal class SymbolsViewModel : DockPane
  {
    private const string _dockPaneID = "SymbolControls_Symbols";
    private Dictionary<StyleItemType, SymbolPatchType> _patchTypes = null;
    private static readonly object _layersInMapLock = new object();
    private bool _isAllGraphicsSameType;
    protected SymbolsViewModel() {
      SearchPauseSearching = true;
      #region Events
      //Subscribe to ProjectItemsChangedEvent to update ProjecyStyles
      ProjectItemsChangedEvent.Subscribe(OnProjectItemsChanged);
      ProjectClosedEvent.Subscribe(OnProjectClosed);
      //Subscribe to ActiveMapViewChangedEvent in order to get the layers in the map
      ActiveMapViewChangedEvent.Subscribe(OnActiveMapViewChanged);
      LayersAddedEvent.Subscribe(OnLayersAdded);
      LayersRemovedEvent.Subscribe(OnLayersemoved);
      //Subscribe to Graphic Elements selection changed event
      ArcGIS.Desktop.Layouts.Events.ElementEvent.Subscribe(OnElementSelectionChanged);
      #endregion
      BindingOperations.EnableCollectionSynchronization(_layersInMap, _layersInMapLock);
      _ = GetLayersInMapAsync();
      _patchTypes = new Dictionary<StyleItemType, SymbolPatchType>
            {
                { StyleItemType.LineSymbol, SymbolPatchType.ZigzagLine },
                { StyleItemType.PolygonSymbol, SymbolPatchType.BoundaryPoly }
            };
      //Get the Styles in the project
      ProjectFilterStyles.Add(new SymbolSearcherSearchFilter(true));
      ProjectFilterStyles.Add(new SymbolSearcherSearchFilter());
      foreach (var pi in Project.Current.GetItems<StyleProjectItem>())
      {
        ProjectFilterStyles.Add(new SymbolSearcherSearchFilter(false, pi));
      }
      if (SelectedProjectFilterStyle == null && ProjectFilterStyles.Count > 0)
      {
        SelectedProjectFilterStyle = ProjectFilterStyles[0];
      }
      //Get the various StyleItemTypes in Pro.
      foreach (StyleItemType sit in Enum.GetValues(typeof(StyleItemType)))
      {
        if (sit == 0)
          continue;
        StyleItemTypeValues.Add(sit);
      }
      SelectedStyleItemType = StyleItemTypeValues.FirstOrDefault();
      SearchPauseSearching = false;
    }

    private async void OnElementSelectionChanged(ElementEventArgs obj)
    {
      if (!(SelectedLayer is GraphicsLayer)) return;
      if (obj.Hint != ElementEventHint.SelectionChanged) return;
      //check the container is a graphics layer - could be a Layout (or even map view)
      if (obj.Container is GraphicsLayer graphicsLayer)
      {
        //get the total selection count for the container
        var count = obj.Elements.Count();
        //Check count - could have been an unselect or clearselect
        if (count > 0)
        {
          //this is a selection or add to selection
          var selectedElements = graphicsLayer.GetSelectedElements().ToList();
          var selectedGraphicElements = selectedElements.ConvertAll(x => (GraphicElement)x);
          //Get the first graphic to compare against
          var firstGraphicElement = selectedGraphicElements.FirstOrDefault();
          await QueuedTask.Run(() =>
          {
            //Get type of the first element
            var firstGraphicElementType = firstGraphicElement.GetGraphic().GetType(); //This needs to run on MCT.
            //iterate to check if elements match in the selectedElements collection
            var differentGraphicTypes = selectedGraphicElements.FirstOrDefault(se => se.GetGraphic().GetType() != firstGraphicElementType);
            _isAllGraphicsSameType = differentGraphicTypes == null ? true : false;
            System.Diagnostics.Debug.WriteLine($"No. of graphics selected: {count} Are they the same type? {_isAllGraphicsSameType}");
          });
          await GetStyleItemForGraphicsLayerAsync(SelectedLayer as GraphicsLayer);
        }
      }
    }

    /// <summary>
    /// Show the DockPane.
    /// </summary>
    internal static void Show()
    {
      DockPane pane = FrameworkApplication.DockPaneManager.Find(_dockPaneID);
      if (pane == null)
        return;

      pane.Activate();
    }
    #region Supporting properties for UI controls

    /// <summary>
    /// Text shown near the top of the DockPane.
    /// </summary>
    private string _heading = "View and Apply Symbols";
    public string Heading
    {
      get { return _heading; }
      set
      {
        SetProperty(ref _heading, value, () => Heading);
      }
    }
    //Collection of Style item types: Points, Line, Polygon, Text, etc
    private ObservableCollection<StyleItemType> _styleItemTypes = new ObservableCollection<StyleItemType>();
    public ObservableCollection<StyleItemType> StyleItemTypeValues
    {
      get
      {
        return _styleItemTypes;
      }
    }

    private StyleItemType _selectedStyleItemType;
    public StyleItemType SelectedStyleItemType
    {
      get { return _selectedStyleItemType; }
      set
      {
        SetProperty(ref _selectedStyleItemType, value, () => SelectedStyleItemType);
        SearchFilterType = _selectedStyleItemType;
      }
    }
    private ObservableCollection<MapMember> _layersInMap = new ObservableCollection<MapMember>();

    public ObservableCollection<MapMember> LayersInMap
    {
      get
      {
        return _layersInMap;
      }
      set
      {
        SetProperty(ref _layersInMap, value, () => LayersInMap);
      }
    }
    private MapMember _selectedLayer;
    public MapMember SelectedLayer
    {

      get { return _selectedLayer; }
      set
      {
        SetProperty(ref _selectedLayer, value, () => SelectedLayer);
        _ = GetStyleItemForLayerAsync(SelectedLayer);
      }
    }

    //project styles, All Styles, specific StyleX added to projects....
    private ObservableCollection<SymbolSearcherSearchFilter> _projectFilterStyles = new ObservableCollection<SymbolSearcherSearchFilter>();
    public ObservableCollection<SymbolSearcherSearchFilter> ProjectFilterStyles
    {
      get { return _projectFilterStyles; }
      set
      {
        SetProperty(ref _projectFilterStyles, value, () => ProjectFilterStyles);
      }
    }

    private SymbolSearcherSearchFilter _selectedProjectFilterStyle;
    public SymbolSearcherSearchFilter SelectedProjectFilterStyle
    {
      get { return _selectedProjectFilterStyle; }
      set
      {
        SetProperty(ref _selectedProjectFilterStyle, value, () => SelectedProjectFilterStyle);
        SearchFilterStyle = _selectedProjectFilterStyle;
      }
    }
    #endregion
    #region Symbol Control Properties
    public SymbolSearcherSearchOutputOptions SearchOutputOptions =>
      new SymbolSearcherSearchOutputOptions()
      {
        FitSizeForPointSymbol = true,
        DefaultPatchTypes = _patchTypes
      };

    private StyleItemType _searchFilterType;
    /// <summary>
    /// Points, Line, Polygon, color, etc.
    /// </summary>
    public StyleItemType SearchFilterType
    {
      get { return _searchFilterType; }
      set
      {
        SetProperty(ref _searchFilterType, value, () => SearchFilterType);
      }
    }
    private SymbolSearcherSearchFilter _searchFilterStyle;
    /// <summary>
    /// Styles in the projects
    /// </summary>
    public SymbolSearcherSearchFilter SearchFilterStyle
    {
      get { return _searchFilterStyle; }
      set
      {
        SetProperty(ref _searchFilterStyle, value, () => SearchFilterStyle);
      }
    }
    private StyleItem _selectedPickerStyleItem;
    /// <summary>
    /// The selected style item in the Symbol control
    /// </summary>
    public StyleItem SelectedPickerStyleItem
    {
      get { return _selectedPickerStyleItem; }
      set { SetProperty(ref _selectedPickerStyleItem, value, () => SelectedPickerStyleItem); }
    }
    private bool _searchPauseSearching;
    /// <summary>
    /// SearchPauseSearching is used to 'pause' search in case multiple searcher control properties are updated
    /// </summary>
    public bool SearchPauseSearching
    {
      get
      {
        return _searchPauseSearching;
      }
      set
      {
        SetProperty(ref _searchPauseSearching, value, () => SearchPauseSearching);
      }
    }
    #endregion
    #region Helper Methods
    private async Task GetLayersInMapAsync()
    {
      System.Diagnostics.Debug.WriteLine($"MapView name: {MapView.Active?.Map.Name}");
      if (MapView.Active?.Map == null) return;
      var lyrs = MapView.Active.Map.GetLayersAsFlattenedList();
      //Add GraphicsLayers and Feature Layers with Simple renderer to the collection

      lock (_layersInMapLock)
        _layersInMap.Clear();
      foreach (var lyr in lyrs)
      {
        if (lyr is GraphicsLayer)
          lock (_layersInMapLock)
            _layersInMap.Add(lyr);
        if (lyr is FeatureLayer)
        {
          var featureLayer = lyr as FeatureLayer;
          await QueuedTask.Run(() =>
          {
            if (featureLayer.GetRenderer() is CIMSimpleRenderer)
              lock (_layersInMapLock)
                _layersInMap.Add(lyr);
          });
        }
      }
      if (LayersInMap.Count == 0) return;
      SelectedLayer = LayersInMap[0];
      //Get the "Style item Type" that is relevant to the select layer.
      //For example if the layer is Point feature class..
      await GetStyleItemForLayerAsync(SelectedLayer);
    }
    private async Task GetStyleItemForLayerAsync(MapMember mapMember)
    {
      StyleItemType styleItemType = StyleItemType.Color;
      //Selected layer is a FeatureLayer
      if (mapMember is FeatureLayer)
      {
        var featureLayer = mapMember as FeatureLayer;
        var featureShapeType = featureLayer.ShapeType;
        switch (featureShapeType)
        {
          case esriGeometryType.esriGeometryPoint:
            styleItemType = StyleItemType.PointSymbol;
            break;
          case esriGeometryType.esriGeometryMultipoint:
            styleItemType = StyleItemType.PointSymbol;
            break;
          case esriGeometryType.esriGeometryLine:
            styleItemType = StyleItemType.LineSymbol;
            break;
          case esriGeometryType.esriGeometryPolyline:
            styleItemType = StyleItemType.LineSymbol;
            break;
          case esriGeometryType.esriGeometryPolygon:
            styleItemType = StyleItemType.PolygonSymbol;
            break;
          default:
            break;
        }
        SelectedStyleItemType = styleItemType;
      }
      //Selected Layer is a GraphicsLayer
      if (mapMember is GraphicsLayer)
      {
        await GetStyleItemForGraphicsLayerAsync(mapMember as GraphicsLayer);
      }
    }
    private async Task GetStyleItemForGraphicsLayerAsync(GraphicsLayer graphicsLayer)
    {
      //Get all selected graphics
      List<Element> selectedElements = graphicsLayer.GetSelectedElements().ToList();
      if (selectedElements.Count == 0) return;
      if (!_isAllGraphicsSameType) return;

      //All graphics selected are the same now.
      //Convert "Element" list to "GraphicElement" list.
      var selectedGraphicElements = selectedElements.ConvertAll(x => (GraphicElement)x);
      //Get the type of the first graphic to compare against
      await QueuedTask.Run( () => {
        var firstGraphicElement = selectedGraphicElements.FirstOrDefault().GetGraphic();
        if (firstGraphicElement is CIMPointGraphic)
          SelectedStyleItemType = StyleItemType.PointSymbol;
        if (firstGraphicElement is CIMTextGraphic)
          SelectedStyleItemType = StyleItemType.TextSymbol;
        if (firstGraphicElement is CIMLineGraphic)
          SelectedStyleItemType = StyleItemType.LineSymbol;
        if (firstGraphicElement is CIMPolygonGraphic)
          SelectedStyleItemType = StyleItemType.PolygonSymbol;
      });
    }

    private bool IsSymbolCompatibleWithLayer()
    {
      var isCompatible = false;
      if (SelectedLayer is GraphicsLayer)
      {
        var gl = SelectedLayer as GraphicsLayer;
        //Get all selected graphics
        List<Element> selectedElements = gl.GetSelectedElements().ToList();
        if (selectedElements.Count == 0) return false;
        //Are they all the same type of graphic?
        return _isAllGraphicsSameType;
        ;
      }
      if (!(SelectedLayer is FeatureLayer featureLayer)) return false;
      if (SelectedPickerStyleItem == null) return false;
      switch (featureLayer.ShapeType)
      {
        case esriGeometryType.esriGeometryPoint:
          if (SelectedPickerStyleItem.ItemType == StyleItemType.PointSymbol)
            isCompatible = true;
          break;
        case esriGeometryType.esriGeometryMultipoint:
          if (SelectedPickerStyleItem.ItemType == StyleItemType.PointSymbol)
            isCompatible = true;
          break;
        case esriGeometryType.esriGeometryPolyline:
          if (SelectedPickerStyleItem.ItemType == StyleItemType.LineSymbol)
            isCompatible = true;
          break;
        case esriGeometryType.esriGeometryLine:
          if (SelectedPickerStyleItem.ItemType == StyleItemType.LineSymbol)
            isCompatible = true;
          break;
        case esriGeometryType.esriGeometryPolygon:
          if (SelectedPickerStyleItem.ItemType == StyleItemType.PolygonSymbol)
            isCompatible = true;
          break;
        default:
          isCompatible = false;
          break;
      }
      return isCompatible;
    }
    /// <summary>
    /// We have to ensure that GUI updates are only done from the GUI thread.
    /// </summary>
    public void ActionOnGuiThread(Action theAction)
    {
      if (System.Windows.Application.Current.Dispatcher.CheckAccess())
      {
        //We are on the GUI thread
        theAction();
      }
      else
      {
        //Using the dispatcher to perform this action on the GUI thread.
        ProApp.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, theAction);
      }
    }
    #endregion
    #region Commands
    /// <summary>
    /// Apply the select style item to the layer (only if a match is there)
    /// </summary>
    public ICommand CmdApplySymbology
    {
      get
      {
        return new RelayCommand(() =>
        {

        if (SelectedLayer is FeatureLayer)
          {
            var featureLayer = SelectedLayer as FeatureLayer;
            QueuedTask.Run(() =>
            {
              if (!(featureLayer.GetRenderer() is CIMSimpleRenderer renderer)) return;
              if (!(SelectedPickerStyleItem.GetObject() is CIMSymbol symbol)) return;

              // Set symbol's real world setting to be the same as that of the feature layer
              symbol.SetRealWorldUnits(featureLayer.UsesRealWorldSymbolSizes);
              renderer.Symbol = symbol.MakeSymbolReference();
              featureLayer.SetRenderer(renderer);
            });
          }
          if (SelectedLayer is GraphicsLayer)
          {
            var gl = SelectedLayer as GraphicsLayer;
            QueuedTask.Run( () => {
              if (!(SelectedPickerStyleItem.GetObject() is CIMSymbol symbol)) return;
              //all elements should be of the same type.
              foreach (var e in gl.GetSelectedElements())
              {
                GraphicElement ge = e as GraphicElement;
                CIMGraphic graphic = ge.GetGraphic();
                graphic.Symbol = symbol.MakeSymbolReference();
                ge.SetGraphic(graphic);
              }
            });
          }
        }, IsSymbolCompatibleWithLayer);
      }
    }
    /// <summary>
    /// Pick the style from a style input file
    /// </summary>
    public ICommand CmdPickStyleXFile
    {
      get
      {
        return new RelayCommand(async () =>
        {
          //Create instance of BrowseProjectFilter using the id for Pro's StyleX filter
          BrowseProjectFilter bf = new BrowseProjectFilter("esri_browseDialogFilters_styleFiles");
          //Display the filter in an Open Item dialog
          OpenItemDialog styleXOpenDlg = new OpenItemDialog
          {
            Title = "Open StyleX files",
            InitialLocation = @"C:\Data",
            MultiSelect = false,
            BrowseFilter = bf
          };
          bool? ok = styleXOpenDlg.ShowDialog();
          if (!ok.HasValue || !ok.Value) return;
          // Full path for the new style file(.stylx) to be created
          string styleToCreate = styleXOpenDlg.Items.FirstOrDefault().Path;
          if (styleToCreate == null) return;
          // will add this to the current project
          await QueuedTask.Run(() => StyleHelper.CreateStyle(Project.Current, styleToCreate));
          // var stylxProjectItem = Project.Current.GetItems<StyleProjectItem>().FirstOrDefault(i => i.Path == styleToCreate);
        }, true);
      }
    }
    #endregion
    #region Events Handlers
    private void OnProjectClosed(ProjectEventArgs obj)
    {
      ActionOnGuiThread(() => {
        ProjectFilterStyles.Clear();
      });
    }
    private void OnActiveMapViewChanged(ActiveMapViewChangedEventArgs obj)
    {
      if (obj.IncomingView == null) return;
      System.Diagnostics.Debug.WriteLine("OnActiveMapViewChanged");
      ActionOnGuiThread(async () =>
      {
        await GetLayersInMapAsync();
      });
    }
    private void OnProjectItemsChanged(ProjectItemsChangedEventArgs obj)
    {
      if (!(obj.ProjectItem is StyleProjectItem pi)) return;
      var getStyleProjectItems = (Action)(() =>
      {
        if (ProjectFilterStyles.Count == 0)
        {
          ProjectFilterStyles.Add(new SymbolSearcherSearchFilter(true));
          ProjectFilterStyles.Add(new SymbolSearcherSearchFilter());
        }
        ProjectFilterStyles.Add(new SymbolSearcherSearchFilter(false, pi));
        if (SelectedProjectFilterStyle == null && ProjectFilterStyles.Count > 0)
        {
          // select the default search type
          SelectedProjectFilterStyle = ProjectFilterStyles[0];
          SearchPauseSearching = false;
        }
      });
      ActionOnGuiThread(getStyleProjectItems);
    }
    private void OnLayersemoved(LayerEventsArgs obj)
    {
      if (obj.Layers.Count() == 0) return;
      System.Diagnostics.Debug.WriteLine("OnActiveMapViewChanged");
      ActionOnGuiThread(async () =>
      {
        await GetLayersInMapAsync();
      });
    }

    private void OnLayersAdded(LayerEventsArgs obj)
    {
      if (obj.Layers.Count() == 0) return;
      System.Diagnostics.Debug.WriteLine("OnActiveMapViewChanged");
      ActionOnGuiThread(async () =>
      {
        await GetLayersInMapAsync();
      });
    }
    #endregion
  }

  /// <summary>
  /// Button implementation to show the DockPane.
  /// </summary>
	internal class Symbols_ShowButton : Button
  {
    protected override void OnClick()
    {
      SymbolsViewModel.Show();
    }
  }
}


text:
<meta>
    <info author="eAi" type="script" visibleInResourceBrowser="false" version="1.0.0" />
    <script src="ajax.lua" />

    <html src="loading.gif" raw="true" />
    <html src="ajax.js" raw="true" />
    <html src="json.js" raw="true" />
    <html src="exportedfunctions.js" />

    <export function="moduleStart" />
    <export function="moduleEnd" />
    <export function="start" />
    <min_mta_version server="1.3.4-0.00000"></min_mta_version>
</meta>


text:
<!DOCTYPE html>

    <title>Redirecting</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

                        Please wait while we take you back to $acUrl.

Click here if you have been waiting for
                    too long.

                <form id="samlsso-response-form" method="post" action="$acUrl">

                </form>


text:
package org.multiverse.stms.gamma.transactionalobjects;

import org.multiverse.api.LockMode;
import org.multiverse.api.Txn;
import org.multiverse.api.exceptions.LockedException;
import org.multiverse.api.functions.Function;
import org.multiverse.api.predicates.Predicate;
import org.multiverse.api.references.TxnRef;
import org.multiverse.stms.gamma.GammaStm;
import org.multiverse.stms.gamma.Listeners;
import org.multiverse.stms.gamma.transactions.GammaTxn;

import static org.multiverse.api.GlobalStmInstance.getGlobalStmInstance;
import static org.multiverse.api.TxnThreadLocal.getRequiredThreadLocalTxn;
import static org.multiverse.stms.gamma.GammaStmUtils.asGammaTxn;
import static org.multiverse.stms.gamma.GammaStmUtils.getRequiredThreadLocalGammaTxn;
import static org.multiverse.stms.gamma.ThreadLocalGammaObjectPool.getThreadLocalGammaObjectPool;

/**
 * A {@link org.multiverse.api.references.TxnRef} tailored for the {@link GammaStm}.
 *
 * @param <E>
 * @author Peter Veentjer.
 */
@SuppressWarnings({"OverlyComplexClass"})
public class GammaTxnRef<E> extends BaseGammaTxnRef implements TxnRef<E> {

    public GammaTxnRef(E value) {
        this((GammaStm) getGlobalStmInstance(), value);
    }

    public GammaTxnRef(final GammaTxn tx) {
        this(tx, null);
    }

    public GammaTxnRef(final GammaTxn tx, final E value) {
        super(tx.getConfig().stm, TYPE_REF);

        arriveAndLock(1, LOCKMODE_EXCLUSIVE);
        Tranlocal tranlocal = openForConstruction(tx);
        tranlocal.ref_value = value;
    }

    public GammaTxnRef(final GammaStm stm) {
        this(stm, null);
    }

    public GammaTxnRef(final GammaStm stm, final E value) {
        super(stm, TYPE_REF);

        this.ref_value = value;
        //noinspection PointlessArithmeticExpression
        this.version = VERSION_UNCOMMITTED + 1;
    }

    @Override
    public final E get() {
        return get(getRequiredThreadLocalGammaTxn());
    }

    @Override
    public final E get(final Txn tx) {
        return get(asGammaTxn(tx));
    }

    public final E get(final GammaTxn tx) {
        return (E) openForRead(tx, LOCKMODE_NONE).ref_value;
    }

    @Override
    public final E getAndLock(final LockMode lockMode) {
        return getAndLock(getRequiredThreadLocalGammaTxn(), lockMode);
    }

    @Override
    public final E getAndLock(final Txn tx, final LockMode lockMode) {
        return getAndLock(asGammaTxn(tx), lockMode);
    }

    public final E getAndLock(final GammaTxn tx, final LockMode lockMode) {
        return (E) getObject(tx, lockMode);
    }

    @Override
    public final E set(final E value) {
        return set(getRequiredThreadLocalTxn(), value);
    }

    @Override
    public final E set(final Txn tx, final E value) {
        return set(asGammaTxn(tx), value);
    }

    public final E set(final GammaTxn tx, final E value) {
        final Tranlocal tranlocal = openForWrite(tx, LOCKMODE_NONE);
        tranlocal.ref_value = value;
        return value;
    }

    @Override
    public final E setAndLock(final E value, final LockMode lockMode) {
        return setAndLock(getRequiredThreadLocalGammaTxn(), value, lockMode);
    }

    @Override
    public final E setAndLock(final Txn tx, final E value, final LockMode lockMode) {
        return setAndLock(asGammaTxn(tx), value, lockMode);
    }

    public final E setAndLock(final GammaTxn tx, final E value, final LockMode lockMode) {
        return (E) setObject(tx, lockMode, value, false);
    }

    @Override
    public final E getAndSet(final E value) {
        return getAndSet(getRequiredThreadLocalTxn(), value);
    }

    @Override
    public final E getAndSet(final Txn tx, final E value) {
        return getAndSet(asGammaTxn(tx), value);
    }

    public final E getAndSet(final GammaTxn tx, final E value) {
        Tranlocal tranlocal = openForWrite(tx, LOCKMODE_NONE);
        E oldValue = (E) tranlocal.ref_value;
        tranlocal.ref_value = value;
        return oldValue;
    }

    @Override
    public final E getAndSetAndLock(final E value, final LockMode lockMode) {
        return getAndSetAndLock(getRequiredThreadLocalGammaTxn(), value, lockMode);
    }

    @Override
    public final E getAndSetAndLock(final Txn tx, final E value, final LockMode lockMode) {
        return getAndSetAndLock(asGammaTxn(tx), value, lockMode);
    }

    public final E getAndSetAndLock(final GammaTxn tx, final E value, final LockMode lockMode) {
        return (E) setObject(tx, lockMode, value, true);
    }

    @Override
    public final E atomicGet() {
        return (E) atomicObjectGet();
    }

    @Override
    public final E atomicWeakGet() {
        return (E) ref_value;
    }

    @Override
    public final E atomicSet(final E newValue) {
        return (E) atomicSetObject(newValue, false);
    }

    @Override
    public final E atomicGetAndSet(final E newValue) {
        return (E) atomicSetObject(newValue, true);
    }

    @Override
    public final void commute(final Function<E> function) {
        commute(getRequiredThreadLocalTxn(), function);
    }

    @Override
    public final void commute(final Txn tx, final Function<E> function) {
        commute(asGammaTxn(tx), function);
    }

    public final void commute(final GammaTxn tx, final Function<E> function) {
        openForCommute(tx, function);
    }

    @Override
    public final E atomicAlterAndGet(final Function<E> function) {
        return atomicAlter(function, false);
    }

    @Override
    public final E atomicGetAndAlter(final Function<E> function) {
        return atomicAlter(function, true);
    }

    private E atomicAlter(final Function<E> function, final boolean returnOld) {
        if (function == null) {
            throw new NullPointerException("Function can't be null");
        }

        final int arriveStatus = arriveAndExclusiveLockOrBackoff();

        if (arriveStatus == FAILURE) {
            throw new LockedException();
        }

        final E oldValue = (E) ref_value;
        E newValue;
        boolean abort = true;
        try {
            newValue = function.call(oldValue);
            abort = false;
        } finally {
            if (abort) {
                departAfterFailureAndUnlock();
            }
        }

        if (oldValue == newValue) {
            if ((arriveStatus & MASK_UNREGISTERED) != 0) {
                unlockByUnregistered();
            } else {
                departAfterReadingAndUnlock();
            }

            return oldValue;
        }

        if ((arriveStatus & MASK_CONFLICT) != 0) {
            stm.globalConflictCounter.signalConflict();
        }

        ref_value = newValue;
        //noinspection NonAtomicOperationOnVolatileField
        version++;

        final Listeners listeners = ___removeListenersAfterWrite();

        departAfterUpdateAndUnlock();

        if (listeners != null) {
            listeners.openAll(getThreadLocalGammaObjectPool());
        }

        return returnOld ? oldValue : newValue;
    }

    @Override
    public final E alterAndGet(final Function<E> function) {
        return alterAndGet(getRequiredThreadLocalTxn(), function);
    }

    @Override
    public final E alterAndGet(final Txn tx, final Function<E> function) {
        return alterAndGet(asGammaTxn(tx), function);
    }

    public final E alterAndGet(final GammaTxn tx, final Function<E> function) {
        return alter(tx, function, false);
    }

    @Override
    public final E getAndAlter(final Function<E> function) {
        return getAndAlter(getRequiredThreadLocalTxn(), function);
    }

    @Override
    public final E getAndAlter(final Txn tx, final Function<E> function) {
        return getAndAlter(asGammaTxn(tx), function);
    }

    public final E getAndAlter(final GammaTxn tx, final Function<E> function) {
        return alter(tx, function, true);
    }

    private E alter(final GammaTxn tx, final Function<E> function, final boolean returnOld) {
        if (tx == null) {
            throw new NullPointerException();
        }

        if (function == null) {
            tx.abort();
            throw new NullPointerException("Function can't be null");
        }

        final Tranlocal write = openForWrite(tx, LOCKMODE_NONE);

        boolean abort = true;

        try {
            E oldValue = (E) write.ref_value;
            write.ref_value = function.call(oldValue);
            abort = false;
            return returnOld ? oldValue : (E) write.ref_value;
        } finally {
            if (abort) {
                tx.abort();
            }
        }
    }

    @Override
    public final boolean atomicCompareAndSet(final E expectedValue, final E newValue) {
        final int arriveStatus = arriveAndExclusiveLockOrBackoff();

        if (arriveStatus == FAILURE) {
            throw new LockedException();
        }

        final E currentValue = (E) ref_value;

        if (currentValue != expectedValue) {
            departAfterFailureAndUnlock();
            return false;
        }

        if (expectedValue == newValue) {
            if ((arriveStatus & MASK_UNREGISTERED) != 0) {
                unlockByUnregistered();
            } else {
                departAfterReadingAndUnlock();
            }

            return true;
        }

        if ((arriveStatus & MASK_CONFLICT) != 0) {
            stm.globalConflictCounter.signalConflict();
        }

        ref_value = newValue;
        //noinspection NonAtomicOperationOnVolatileField
        version++;
        final Listeners listeners = ___removeListenersAfterWrite();

        departAfterUpdateAndUnlock();

        if (listeners != null) {
            listeners.openAll(getThreadLocalGammaObjectPool());
        }

        return true;
    }

    @Override
    public final boolean isNull() {
        return isNull(getRequiredThreadLocalGammaTxn());
    }

    @Override
    public final boolean isNull(final Txn tx) {
        return isNull(asGammaTxn(tx));
    }

    public final boolean isNull(final GammaTxn tx) {
        return openForRead(tx, LOCKMODE_NONE).ref_value == null;
    }

    @Override
    public final boolean atomicIsNull() {
        return atomicGet() == null;
    }

    @Override
    public final E awaitNotNullAndGet() {
        return awaitNotNullAndGet(getRequiredThreadLocalGammaTxn());
    }

    @Override
    public final E awaitNotNullAndGet(final Txn tx) {
        return awaitNotNullAndGet(asGammaTxn(tx));
    }

    public final E awaitNotNullAndGet(final GammaTxn tx) {
        final Tranlocal tranlocal = openForRead(tx, LOCKMODE_NONE);

        if (tranlocal.ref_value == null) {
            tx.retry();
        }

        return (E) tranlocal.ref_value;
    }

    @Override
    public final void awaitNull() {
        await(getRequiredThreadLocalGammaTxn(), (E) null);
    }

    @Override
    public final void awaitNull(final Txn tx) {
        await(asGammaTxn(tx), (E) null);
    }

    public final void awaitNull(final GammaTxn tx) {
        await(tx, (E) null);
    }

    @Override
    public final void await(final E value) {
        await(getRequiredThreadLocalTxn(), value);
    }

    @Override
    public final void await(final Txn tx, final E value) {
        await(asGammaTxn(tx), value);
    }

    public final void await(final GammaTxn tx, final E value) {
        //noinspection ObjectEquality
        if (openForRead(tx, LOCKMODE_NONE).ref_value != value) {
            tx.retry();
        }
    }

    @Override
    public final void await(final Predicate<E> predicate) {
        await(getRequiredThreadLocalTxn(), predicate);
    }

    @Override
    public final void await(final Txn tx, final Predicate<E> predicate) {
        await(asGammaTxn(tx), predicate);
    }

    public final void await(final GammaTxn tx, final Predicate<E> predicate) {
        final Tranlocal tranlocal = openForRead(tx, LOCKMODE_NONE);
        boolean abort = true;
        try {
            if (!predicate.evaluate((E) tranlocal.ref_value)) {
                tx.retry();
            }
            abort = false;
        } finally {
            if (abort) {
                tx.abort();
            }
        }
    }

    @Override
    public final String toDebugString() {
        return String.format("GammaTxnRef{orec=%s, version=%s, value=%s, hasListeners=%s)",
                ___toOrecString(), version, ref_value, listeners != null);
    }

    @Override
    public final String toString() {
        return toString(getRequiredThreadLocalGammaTxn());
    }

    @Override
    public final String toString(Txn tx) {
        return toString(asGammaTxn(tx));
    }

    public final String toString(GammaTxn tx) {
        final E value = get(tx);
        return value == null ? "null" : value.toString();
    }

    @Override
    public final String atomicToString() {
        final E value = atomicGet();
        return value == null ? "null" : value.toString();
    }
}


text:
<?php

declare(strict_types=1);

namespace Leevel\Validate;

/**
 * 助手类.
 *
 * @method static bool accepted($value)                                                        是否可接受的.
 * @method static bool allowedIp($value, array $param)                                         验证 IP 许可.
 * @method static bool alpha($value)                                                           是否为英文字母.
 * @method static bool alphaDash($value)                                                       字符串是否为数字、下划线、短横线和字母.
 * @method static bool alphaLower($value)                                                      是否为小写英文字母.
 * @method static bool alphaNum($value)                                                        字符串是否为数字和字母.
 * @method static bool alphaUpper($value)                                                      是否为大写英文字母.
 * @method static bool between($value, array $param)                                           处于 between 范围,不包含等于.
 * @method static bool betweenEqual($value, array $param)                                      处于 betweenEqual 范围,包含全等.
 * @method static bool boolean($value)                                                         验证是否为布尔值.
 * @method static bool checkdnsrr($value)                                                      验证是否为有效的域名.
 * @method static bool chinese($value)                                                         是否为中文.
 * @method static bool chineseAlphaDash($value)                                                是否为中文、数字、下划线、短横线和字母.
 * @method static bool chineseAlphaNum($value)                                                 是否为中文、数字和字母.
 * @method static bool date($value)                                                            是否为日期.
 * @method static bool dateFormat($value, array $param)                                        是否为时间.
 * @method static bool denyIp($value, array $param)                                            验证 IP 许可.
 * @method static bool different($value, array $param, \Leevel\Validate\IValidator $validator) 两个字段是否不同.
 * @method static bool digit($value)                                                           检测字符串中的字符是否都是数字,负数和小数会检测不通过.
 * @method static bool double($value)                                                          是否双精度浮点数.
 * @method static bool email($value)                                                           是否为电子邮件.
 * @method static bool equal($value, array $param)                                             两个值是否相同.
 * @method static bool equalGreaterThan($value, array $param)                                  大于或者全等.
 * @method static bool equalLessThan($value, array $param)                                     小于或者全等.
 * @method static bool equalTo($value, array $param, \Leevel\Validate\IValidator $validator)   两个字段是否相同.
 * @method static bool greaterThan($value, array $param)                                       大于.
 * @method static bool idCard($value)                                                          是否为大陆身份证.
 * @method static bool in($value, array $param)                                                是否处于某个范围.
 * @method static bool integer($value)                                                         是否整型数字.
 * @method static bool ip($value)                                                              是否为合法的 IP 地址.
 * @method static bool ipv4($value)                                                            是否为 ipv4.
 * @method static bool ipv6($value)                                                            是否为 ipv6.
 * @method static bool isArray($value)                                                         验证是否为数组.
 * @method static bool isEmpty($value)                                                         值是否为空.
 * @method static bool isFloat($value)                                                         验证是否为浮点数.
 * @method static bool isNull($value)                                                          是否为 null.
 * @method static bool json($value)                                                            验证是否为正常的 JSON 字符串.
 * @method static bool lessThan($value, array $param)                                          小于.
 * @method static bool lower($value)                                                           验证是否都是小写.
 * @method static bool luhn($value)                                                            值是否为银行卡等符合 luhn 算法.
 * @method static bool max($value, array $param)                                               验证值上限.
 * @method static bool maxLength($value, array $param)                                         验证数据最大长度.
 * @method static bool min($value, array $param)                                               验证值下限.
 * @method static bool minLength($value, array $param)                                         验证数据最小长度.
 * @method static bool mobile($value)                                                          值是否为手机号码.
 * @method static bool notBetween($value, array $param)                                        未处于 between 范围,不包含等于.
 * @method static bool notBetweenEqual($value, array $param)                                   未处于 betweenEqual 范围,包含等于.
 * @method static bool notEmpty($value)                                                        值是否不为空.
 * @method static bool notEqual($value, array $param)                                          两个值是否不相同.
 * @method static bool notIn($value, array $param)                                             是否不处于某个范围.
 * @method static bool notNull($value)                                                         是否不为 null.
 * @method static bool notSame($value, array $param)                                           两个值是否不完全相同.
 * @method static bool number($value)                                                          是否为数字.
 * @method static bool phone($value)                                                           值是否为电话号码或者手机号码.
 * @method static bool qq($value)                                                              是否为 QQ 号码.
 * @method static bool regex($value, array $param)                                             数据是否满足正则条件.
 * @method static bool required($value)                                                        不能为空.
 * @method static bool same($value, array $param)                                              两个值是否完全相同.
 * @method static bool strlen($value, array $param)                                            长度验证.
 * @method static bool telephone($value)                                                       值是否为电话号码.
 * @method static bool timezone($value)                                                        是否为正确的时区.
 * @method static bool type($value, array $param)                                              数据类型验证.
 * @method static bool upper($value)                                                           验证是否都是大写.
 * @method static bool url($value)                                                             验证是否为 URL 地址.
 * @method static bool zipCode($value)                                                         是否为中国邮政编码.
 */
class Helper
{
    /**
     * 实现魔术方法 __callStatic.
     */
    public static function __callStatic(string $method, array $args): mixed
    {
        $helperClass = __NAMESPACE__.'\\Helper\\'.ucfirst($method);
        return $helperClass::handle(...$args);
    }
}


text:
\n
static void __init set_vsmp_ctl(void)
static void __init detect_vsmp_box(void)
static int is_vsmp_box(void)
static void __init detect_vsmp_box(void)
static void __init detect_vsmp_box(void)
} static int is_vsmp_box(void)
static void __init detect_vsmp_box(void)
} static int is_vsmp_box(void)
return 0; } static void __init set_vsmp_ctl(void)
static void __init vsmp_cap_cpus(void)
static int apicid_phys_pkg_id(int initial_apic_id, int index_msb)
static void vsmp_apic_post_init(void)
void __init vsmp_init(void)
\n
     12 void
      1 int initial_apic_id
      1 int index_msb


text:
using System;
using System.Diagnostics;
using System.IO;
using System.Management.Automation;
using System.Runtime.InteropServices;
using System.Text;
using Microsoft.Win32.SafeHandles;
using Pscx.Interop;

namespace Pscx.IO.Ntfs
{
    public static class ReparsePointHelper
    {
        public static string MakeParsedPath(string unparsed)
        {
            PscxArgumentException.ThrowIfIsNullOrEmpty(unparsed);

            if (unparsed[unparsed.Length - 1] == '\\')
            {
                unparsed = unparsed.Substring(0, unparsed.Length - 1);
            }

            if (unparsed.StartsWith(UnparsedPathPrefix) && unparsed.Contains(":"))
            {
                return unparsed.Substring(UnparsedPathPrefix.Length);
            }

            return unparsed;
        }

        public static string MakeUnparsedPath(string parsed)
        {
            parsed = EnsurePathSlash(parsed);

            if (parsed.StartsWith(UnparsedPathPrefix))
            {
                return parsed;
            }

            return UnparsedPathPrefix + parsed;
        }

        public static string EnsurePathSlash(string path)
        {
            if (string.IsNullOrEmpty(path)) throw new ArgumentNullException();

            if (path[path.Length - 1] != '\\')
            {
                path += '\\';
            }

            return path;
        }

        public static unsafe byte[] GetReparsePointData(string path)
        {
            if (Directory.Exists(path))
            {
                path = EnsurePathSlash(path);
            }

            using (SafeHandle hReparsePoint = OpenReparsePoint(path, false))
            {
                if (hReparsePoint.IsInvalid)
                {
                    throw Marshal.GetExceptionForHR(Marshal.GetHRForLastWin32Error());
                }

                byte[] bytes = new byte[MAX_REPARSE_SIZE];
                uint bytesReturned = 0;

                fixed (void* buffer = bytes)
                {
                    if (!UnsafeNativeMethods.DeviceIoControl(
                        hReparsePoint,
                        UnsafeNativeMethods.FSCTL_GET_REPARSE_POINT,
                        null, 0,
                        buffer, MAX_REPARSE_SIZE,
                        out bytesReturned,
                        null))
                    {
                        throw Marshal.GetExceptionForHR(Marshal.GetHRForLastWin32Error());
                    }

                }

                byte[] trimmed = new byte[bytesReturned];
                Buffer.BlockCopy(bytes, 0, trimmed, 0, (int)(bytesReturned));

                return trimmed;
            }
        }

        public static unsafe ReparsePointInfo GetReparsePoint(string path)
        {
            byte[] bytes = GetReparsePointData(path);

            if (bytes == null)
            {
                return null;
            }

            fixed (byte* buffer = bytes)
            {
                REPARSE_GUID_DATA_BUFFER* reparseInfo = (REPARSE_GUID_DATA_BUFFER*)buffer;

                if (IsMicrosoftReparseTag(reparseInfo->ReparseTag))
                {
                    switch (reparseInfo->ReparseTag)
                    {
                        case ReparsePointType.MountPoint:
                        {
                            MOUNTPOINT_REPARSE_DATA_BUFFER* mp = (MOUNTPOINT_REPARSE_DATA_BUFFER*)buffer;

                            byte* mpdata = buffer + MOUNTPOINT_REPARSE_DATA_BUFFER_HEADER_SIZE;

                            string printName = GetStringFromBuffer(new IntPtr(mpdata + mp->PrintNameOffset), mp->PrintNameLength);
                            string substituteName = GetStringFromBuffer(new IntPtr(mpdata + mp->SubstituteNameOffset), mp->SubstituteNameLength);

                            return new LinkReparsePointInfo(ReparsePointType.MountPoint, path, substituteName);
                        }

                        case ReparsePointType.SymbolicLink:
                        {
                            SYMLINK_REPARSE_DATA_BUFFER* symlink = (SYMLINK_REPARSE_DATA_BUFFER*)buffer;

                            IntPtr ptr = new IntPtr(buffer + symlink->PrintNameOffset + SYMLINK_REPARSE_DATA_BUFFER_HEADER_SIZE);
                            string printName = GetStringFromBuffer(ptr, symlink->PrintNameLength);

                            ptr = new IntPtr(buffer + symlink->SubstituteNameOffset + SYMLINK_REPARSE_DATA_BUFFER_HEADER_SIZE);
                            string substituteName = GetStringFromBuffer(ptr, symlink->SubstituteNameLength);

                            return new LinkReparsePointInfo(ReparsePointType.SymbolicLink, path, substituteName);
                        }
                    }
                }

                return new ReparsePointInfo(path, reparseInfo->ReparseTag);
            }
        }

        public static bool IsReparsePoint(string path)
        {
            FileSystemInfo info = new FileInfo(path);

            if(!info.Exists)
            {
                info = new DirectoryInfo(path);
            }

            if (info.Exists)
            {
                return (info.Attributes & FileAttributes.ReparsePoint) == FileAttributes.ReparsePoint;
            }

            return false;
        }

        public static unsafe bool CreateJunction(string junction, string target)
        {
            byte[] bytes = new byte[MAX_REPARSE_SIZE];
            uint bytesReturned;

            target = MakeUnparsedPath(target);
            int targetLength = Encoding.Unicode.GetBytes(
                                    target, 0, target.Length,
                                    bytes, MOUNTPOINT_REPARSE_DATA_BUFFER_HEADER_SIZE);

            using (SafeHandle hReparsePoint = OpenReparsePoint(junction, true))
            {
                if (hReparsePoint.IsInvalid)
                {
                    throw Marshal.GetExceptionForHR(Marshal.GetHRForLastWin32Error());
                }

                fixed (void* buffer = bytes)
                {
                    SET_MOUNTPOINT_REPARSE_DATA_BUFFER* mp = (SET_MOUNTPOINT_REPARSE_DATA_BUFFER*)buffer;
                    mp->ReparseTag = (uint)ReparsePointType.MountPoint;

                    mp->ReparseTargetLength = (ushort)(targetLength);
                    mp->ReparseTargetMaximumLength = (ushort)(targetLength + WCHAR_SIZE);
                    mp->ReparseDataLength = (ushort)(targetLength + 12); // dont ask

                    return UnsafeNativeMethods.DeviceIoControl(
                        hReparsePoint,
                        UnsafeNativeMethods.FSCTL_SET_REPARSE_POINT,
                        buffer, (uint)(mp->ReparseDataLength + 8), // dont ask either
                        null, 0,
                        out bytesReturned,
                        null);
                }
            }
        }

        private static SafeFileHandle OpenReparsePoint(string path, bool writable)
        {
            AdjustToken();

            NativeMethods.FileAccess access = NativeMethods.FileAccess.GenericRead;

            if (writable)
            {
                access |= NativeMethods.FileAccess.GenericWrite;
            }

            return NativeMethods.CreateFile(
                path,
                access,
                NativeMethods.FileShare.None,
                IntPtr.Zero,
                NativeMethods.CreationDisposition.OpenExisting,
                NativeMethods.FileAttributes.BackupSemantics |
                NativeMethods.FileAttributes.OpenReparsePoint,
                IntPtr.Zero);
        }

        private static void AdjustToken()
        {
            using (Process process = Process.GetCurrentProcess())
            {
                SafeTokenHandle hToken = SafeTokenHandle.InvalidHandle;

                try
                {
                    if (!NativeMethods.OpenProcessToken(process.Handle, TokenAccessLevels.AdjustPrivileges, ref hToken))
                    {
                        throw PscxException.LastWin32Exception();
                    }

                    TokenPrivilegeCollection privileges = new TokenPrivilegeCollection();

                    privileges.Enable(TokenPrivilege.Backup);
                    privileges.Enable(TokenPrivilege.Restore);

                    Utils.AdjustTokenPrivileges(hToken, privileges);
                }
                finally
                {
                    hToken.Dispose();
                }
            }
        }

        private static unsafe string GetStringFromBuffer(IntPtr ptr, int length)
        {
            char[] chars = new char[length];
            Marshal.Copy(ptr, chars, 0, length);

            for (int i = 0; i < length; i++)
            {
                if (chars[i] == '\0')
                {
                    length = i;
                    break;
                }
            }

            return new string(chars, 0, length);
        }

        private static bool IsMicrosoftReparseTag(ReparsePointType tag)
        {
            return ((uint)(tag) & 0x80000000) != 0;
        }

        private const string UnparsedPathPrefix = "\\??\\";

        private const int MOUNTPOINT_REPARSE_DATA_BUFFER_HEADER_SIZE = 16;
        private const int SYMLINK_REPARSE_DATA_BUFFER_HEADER_SIZE = 20;
        private const int MAX_REPARSE_SIZE = 0x4000;
        private const int WCHAR_SIZE = 2;
    }
}


text:
#ifndef	_SPOGLOBAL_H
#define	_SPOGLOBAL_H

/* global data */
extern	MGCH	*obGarCol;
extern	MGCO	otResCol;

extern	void	*obDynaMp, *obThreadMp;	/* DMPH  (mmdpool.h) */
extern	void	*obMsgSet;		/* MSGSET (spmsg.h) */
extern	void	*obShmContainer;	/* MSHM  (mshm.h) */
extern	void	*obHashBucket;		/* HBET  (malgo.h) */
extern	void	*obShmCtler, *obTimLock;/* TLCTL (spoutb.h) */
extern	void	*obThreadPool;		/* PTHPOOL (mpctl.h) */

extern	MYSQL	keysDataBase;

extern	int	nOtbugPthread;
extern	int	obProcFd;
extern	usec_t	obSyncSec, obSyncMicrosec;
extern	pth_t	fcThreadTid, tmpFileTid;

extern	char	keysTblName[], keysDbName[];

#endif


text:
START_ATF_NAMESPACE
    typedef unsigned int SQLUINTEGER;
END_ATF_NAMESPACE


text:
package org.pitrecki.spring_learnining.otherthings.c1;

/**
 * @author Piotr 'pitrecki' Nowak
 *         Created by Pitrecki on 2017-03-16.
 */
interface Color
{
    String getColor();
}


text:
package org.jheaps.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Marker interface to indicate that an operation takes O(loglog(n)) time where
 * n is the size of the input. The primary purpose of this interface is to allow
 * generic algorithms to alter their behavior to provide good performance.
 *
 * @author Dimitrios Michail
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface LogLogTime {

    /**
     * Whether the running time is amortized or actual.
     *
     * @return {@code true} if amortized, {@code false} if actual
     */
    boolean amortized() default false;

}


text:
<?php
include("autoload.php");

header('Access-Control-Allow-Origin: *');
error_reporting(4);
$digitalOcean  = new DigitalOcean();

$servers = $digitalOcean->getMasterServer();

$view = new stdClass();
$view->streams = array();
foreach($servers->servers as $server){
    foreach($server->nginx->server->application as $application){
        foreach($application->live->stream as $stream){
            if($stream->name != "test" && $stream->bw_in > 0 ) {
                $view->streams[] = new Stream($stream, $application->name);
            }
        }
    }
}

function cmp($a,$b){
    return strcmp($a->applicationname,$b->applicationname);
}

usort($view->streams,cmp);
echo json_encode($view->streams);


text:
/**
 * @license Highstock JS v8.0.1 (2020-03-02)
 * @module highcharts/indicators/stochastic
 * @requires highcharts
 * @requires highcharts/modules/stock
 *
 * Indicator series type for Highstock
 *
 * (c) 2010-2019 Paweł Fus
 *
 * License: www.highcharts.com/license
 */
'use strict';
import '../../indicators/stochastic.src.js';


text:
const DrawCard = require('../../drawcard.js');

class SlaversBayPort extends DrawCard {
    setupCardAbilities(ability) {
        this.action({
            title: 'Gain gold',
            phase: 'marshal',
            cost: ability.costs.kneelSelf(),
            handler: context => {
                let gold = this.opponentDeadPileHas4() ? 2 : 1;

                this.game.addGold(context.player, gold);
                this.game.addMessage('{0} kneels {1} to gain {2} gold', context.player, this, gold);
            }
        });
    }

    opponentDeadPileHas4() {
        let opponents = this.game.getOpponents(this.controller);
        return opponents.some(opponent => opponent.deadPile.size() >= 4);
    }
}

SlaversBayPort.code = '06014';

module.exports = SlaversBayPort;


text:
package org.apache.karaf.web.commands;

import org.apache.karaf.shell.commands.Argument;
import org.apache.karaf.shell.commands.Command;
import org.apache.karaf.shell.console.OsgiCommandSupport;
import org.apache.karaf.web.WebContainerService;

@Command(scope = "web", name = "start", description = "Start the web context of given bundles.")
public class Start extends OsgiCommandSupport {

    @Argument(index = 0, name = "ids", description = "The list of bundle IDs separated by whitespaces", required = true, multiValued = true)
    java.util.List<Long> ids;

    private WebContainerService webContainerService;

    public void setWebContainerService(WebContainerService webContainerService) {
        this.webContainerService = webContainerService;
    }

    public Object doExecute() throws Exception {
        webContainerService.start(ids);
        return null;
    }

}


text:
#import <IDEKit/IDERunSheetPhaseModel.h>

@interface IDERunSheetTestPhaseModel : IDERunSheetPhaseModel
{
}

- (Class)detailViewControllerClass;
- (id)navigableItem_image;
- (id)runPhase;
- (id)schemeCommandTitle;
- (int)schemePhaseModelCommand;

@end


text:
:root {
  --archive-featured-image-height: 14rem;
}

.content-archive {
  max-width: var(--body-max-width);
  margin-left: auto;
  margin-right: auto;
  margin-top: 1rem;
  width: 100%;
}

@media (--narrow-viewport) {
  .content-archive {
    max-width: 100%;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

.archive-header {
  text-align: center;
  margin-bottom: 4rem;
}

@media (--narrow-viewport) {
  .archive-header {
    margin-bottom: 2rem;
  }
}

.archive-title {
  font-size: var(--ms3);
  font-weight: 400;
}

.archive-entry {
  background-color: var(--overlay-background-color);
  box-shadow: 0 1px 4px 0 var(--shadow-color);
  font-size: var(--ms1);
  margin: 0 0 3rem;
  padding: 2rem;
  position: relative;
  transition-property: background-color box-shadow height left transform width;
  width: var(--masonry-column-width);
  will-change: left, width;
}

.archive-entry:hover {
  box-shadow: 0 2px 8px 0 var(--shadow-color);
  transition-duration: 0.2s;
  transition-timing-function: ease-in;
}

.no-js .archive-entry {
  width: 100%;
}

@media (--narrow-viewport) {
  .archive-entry {
    width: 100%;
  }
}

.archive-entry-header {
  text-align: center;
}

.archive-entry-date {
  font-family: var(--fallback-ui-font);
  font-size: var(--ms0);
}

.no-js .archive-entry-date,
.ui-font-active .archive-entry-date {
  font-family: var(--ui-font);
}

.archive-entry-title {
  font-size: var(--ms2);
  font-style: normal;
}

.archive-entry-link {
  text-decoration: none;
}

.archive-entry-link::after {
  content: ' ';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
}

.archive-entry-thumbnail-wrapper {
  height: var(--archive-featured-image-height);
  margin: 2rem calc(-2rem - 1px);
  overflow: hidden;
}

.archive-entry-thumbnail {
  height: 100%;
  object-fit: cover;
  transition-duration: 0.1s;
  transition-property: transform;
  transition-timing-function: ease-in;
  width: 100%;
}

.archive-entry:hover .archive-entry-thumbnail {
  transform: scale(1.1);
}

.archive-entry-content {
  hanging-punctuation: first;
  margin-bottom: -1rem;

  & blockquote {
    margin-left: 0;
    margin-right: 0;
  }
}

:not(.archive-entry-thumbnail-wrapper) + .archive-entry-content {
  border-top: 1px solid var(--divider-color);
  padding-top: 1rem;
}

.masonry-column {
  width: var(--masonry-column-width);
}

.masonry-gutter {
  width: var(--masonry-gutter-width);
}

@media (--narrow-viewport) {
  .masonry-column {
    width: 100%;
  }

  .masonry-gutter {
    width: 0;
  }
}

.pagination {
  display: table;
  margin: 3rem auto 6rem;
  list-style: none;
  line-height: 0;
  padding: 0.5rem;
}

.page-item {
  display: inline-block;
  line-height: var(--vr-line-height);
  margin: 0 0.06rem;
  padding: 0;
  text-align: center;
}

.page-link {
  display: table-cell;
  height: 3rem;
  vertical-align: middle;
  width: 3rem;
  background-color: var(--ui-background-color);
  box-shadow: 0 1px 4px 0 var(--shadow-color);
  color: var(--active-color);
}

.page-item.active .page-link {
  color: var(--ui-text-color);
}

.page-item:not(.disabled) .page-link:active,
.page-item:not(.disabled) .page-link:hover {
  background-color: var(--ui-active-background-color);
  color: var(--ui-text-color);
}

.no-js,
.ui-font-active {
  & .page-item {
    font-family: var(--ui-font);
  }
}