text:
package gov.nasa.ensemble.core.plan.editor.search;

import gov.nasa.ensemble.common.CommonUtils;
import gov.nasa.ensemble.common.logging.LogUtil;
import gov.nasa.ensemble.core.activityDictionary.ActivityDictionary;
import gov.nasa.ensemble.core.plan.PlanSearchConstants;
import gov.nasa.ensemble.dictionary.EActivityDef;

import java.util.List;
import java.util.StringTokenizer;

import org.apache.lucene.index.Term;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.WildcardQuery;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;

/**
 * This class is where we create a unique search input area for the user to
 * create a specific query depending on which attribute was selected in the
 * PlanSearchDialogQuery.
 *
 * @author Alonzo Benavides
 * @bug need to add date search input, this means allowing a search on duration.
 * 		In PlanIndexer, the indexAttributes method must be changed to allow
 * 		duration.
 */
public class PlanSearchInput {
	/* SWT objects for input area */
	public Composite inputComposite = null;
	private Combo options = null;
	private MBox searchText = null;

	/* Attribute which we are searching, and the query label depending on input */
	private String fieldName = "";
	private String queryLabel = "";
	private String displayName;

	/* The inputID defines what kind of input area is required */
	private int inputID;
	public static final int STRING = 0;
	public static final int BOOLEAN = 1;
	public static final int DATE = 2;
	public static final int MATCH = 3;

	/*
	 * The booleanID defines how this query will be appended to the overall
	 * BooleanQuery used in PlanSearcher when zearch is called.
	 */
	private int booleanID;
	private int defaultBooleanID = AND;
	public static final int AND = 0;
	public static final int OR = 1;
	public static final int NOT = 2;

	/* indexes for STRING_OPTIONS */
	public static final int CONTAIN_WORD = 0;
	public static final int CONTAIN_STRING = 1;
	public static final int NOT_CONTAIN_WORD = 2;
	public static final int NOT_CONTAIN_STRING = 3;

	/* indexes for BOOLEAN_OPTIONS */
	public static final int IS_TRUE = 0;
	public static final int NOT_IS_TRUE = 1;

	/* indexes for DATE_OPTIONS */
	public static final int IS_BETWEEN = 0;
	public static final int IS_BEFORE = 1;
	public static final int IS_AFTER = 2;

	/* indexes for MATCH_OPTIONS */
	public static final int IS = 0;
	public static final int NOT_IS = 1;

	/*
	 * The search options for each kind of inputID. These arrays populate the
	 * options combo depending on inputID.
	 */
	public static final String[] STRING_OPTIONS = { "contains word(s)",
			"contains the string of letters", "does not contain word(s)",
			"does not contain the string of letters" };
	public static final String[] BOOLEAN_OPTIONS = { "is true", "is false" };
	public static final String[] DATE_OPTIONS = { "is between", "is before",
			"is after" };
	public static final String[] MATCH_OPTIONS = { "is", "is not" };

	/**
	 * The entire search area has its own composite because we will want to
	 * update only the search area when the user decides to change which type of
	 * search they want for the specific line in question.
	 *
	 * @param inputComposite
	 */
	public PlanSearchInput(Composite inputComposite, int inputID, String fieldName, String displayName) {
		this.fieldName = fieldName;
		this.displayName = displayName;
		this.inputComposite = inputComposite;
		this.inputID = inputID;
		booleanID = defaultBooleanID;
		createInputPattern();
	}

	/**
	 * This method will create the SWT objects necessary for the search input
	 * area. This is called in the constructor for PlanSearchInput.
	 */
	public void createInputPattern() {
		options = new Combo(inputComposite, SWT.FILL | SWT.READ_ONLY);

		switch (inputID) {
		case STRING:
			for (String tag : STRING_OPTIONS) {
				options.add(tag);
			}
			break;

		case BOOLEAN:
			for (String tag : BOOLEAN_OPTIONS) {
				options.add(tag);
			}
			break;

		case DATE:
			for (String tag : DATE_OPTIONS) {
				options.add(tag);
			}
			break;

		case MATCH:
			for (String tag : MATCH_OPTIONS) {
				options.add(tag);
			}
			break;
		}

		options.setFont(inputComposite.getFont());
		options.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true,
				1, 1));
		options.addModifyListener(new ModifyListener() {
			@Override
			public void modifyText(ModifyEvent e) {
				updateBooleanID();
				refresh();
			}
		});

		if (inputID == MATCH) {
			searchText = new MBox(inputComposite, true);
		} else {
			searchText = new MBox(inputComposite, false);
		}

		searchText.setFont(inputComposite.getFont());
		searchText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true,
				1, 1));

		if (inputID == BOOLEAN) {
			searchText.setVisible(false);
		}

		if (inputID == MATCH) {
			List<EActivityDef> defs = ActivityDictionary.getInstance()
					.getActivityDefs();
			if (defs != null) {
				if (fieldName.equals(PlanSearchPage.TYPE_STRING)) {
					outer: for (EActivityDef def : defs) {
						String name = def.getName();
						if (name != null) {
							for (String item : searchText.getItems()) {
								if (name.equals(item)) {
									continue outer;
								}
							}
							searchText.add(name);
						} else {
							LogUtil.warnOnce(def.getName()
									+ " has 'null' Name in the AD.");
						}
					}
				}
				if (fieldName.equals(PlanSearchPage.CATEGORY_STRING)) {
					outer: for (EActivityDef def : defs) {
						String cat = def.getCategory();
						if (cat != null) {
							for (String item : searchText.getItems()) {
								if (cat.equals(item)) {
									continue outer;
								}
							}
							searchText.add(cat);
						} else {
							LogUtil.warnOnce(def.getName()
									+ " has 'null' Category in the AD.");
						}
					}
				}
				if (fieldName.equals(PlanSearchPage.SCHEDULED_STRING)) {
					searchText.setText("true");
					searchText.setEditable(false);
				}
			}
		}

		options.select(inputID == STRING ? 1 : 0);
	}

	/**
	 * Updates the booleanID by checking the type of input and the selected
	 * option.
	 */
	public void updateBooleanID() {
		int index = options.getSelectionIndex();

		switch (inputID) {
		case STRING:
			switch (index) {
			case CONTAIN_WORD:
				booleanID = defaultBooleanID;
				break;
			case CONTAIN_STRING:
				booleanID = defaultBooleanID;
				break;
			case NOT_CONTAIN_WORD:
				booleanID = NOT;
				break;
			case NOT_CONTAIN_STRING:
				booleanID = NOT;
				break;
			}
			break;

		case BOOLEAN:
			booleanID = AND;
			break;

		case DATE:
			break;

		case MATCH:
			switch (index) {
			case IS:
				booleanID = defaultBooleanID;
				break;
			case NOT_IS:
				booleanID = NOT;
				break;
			}
			break;
		}
	}

	/**
	 * Constructs queries represented by this PlanSearchInput. Those queries are
	 * stored in the given PlanSearcher for future searching.
	 *
	 * @param searcher
	 *            the PlanSearcher which needs to accumulate all queries
	 */
	public void addQueries(PlanSearcher searcher) {
		int index = options.getSelectionIndex();
		String searchString = searchText.getText();
		Query query = null;
		switch (inputID) {
		case STRING:
			String lowerCase = searchString.toLowerCase();
			switch (index) {
			case CONTAIN_WORD:
			case NOT_CONTAIN_WORD:
				StringTokenizer tokenizer = new StringTokenizer(lowerCase,
						PlanSearchConstants.DELIMITERS);
				while (tokenizer.hasMoreTokens()) {
					String text = tokenizer.nextToken();
					query = new TermQuery(new Term(fieldName, text));
					searcher.addQuery(query, booleanID);
				}
				return;
			case CONTAIN_STRING:
			case NOT_CONTAIN_STRING:
				query = new WildcardQuery(new Term(fieldName
						+ PlanIndexer.FIELDNAME_NOT_ANALYZED_SUFFIX, "*"
						+ lowerCase + "*"));
			}
			break;
		case BOOLEAN:
			switch (index) {
			case IS_TRUE:
				query = new TermQuery(new Term(fieldName, "true"));
				break;
			case NOT_IS_TRUE:
				query = new TermQuery(new Term(fieldName, "false"));
				break;
			}
			break;
		case MATCH:
			query = new TermQuery(new Term(fieldName, searchString));
			break;
		case DATE:
			// not yet handled?
			break;
		}
		searcher.addQuery(query, booleanID);
	}

	/**
	 * This method disposes of all the elements created for this search area.
	 */
	public void destroy() {
		options.dispose();
		searchText.dispose();
	}

	/**
	 * This method will return the string queryLabel that the user could see
	 * after conducting the search. The queryLabel will also be used as an ID in
	 * the search history section of the search view.
	 *
	 * @return queryLabel for the search term
	 */
	public String getSearchLabel() {
		int index = options.getSelectionIndex();
		String featureName = (!CommonUtils.isNullOrEmpty(displayName) ? displayName : fieldName);
		if (inputID == BOOLEAN) {
			queryLabel = featureName + " " + options.getItem(index);
		} else {
			queryLabel = featureName + " " + options.getItem(index) + ": "
					+ searchText.getText();
		}
		return queryLabel;
	}

	/**
	 * This method clears all the necessary fields and drop downs. This will be
	 * called when the user attempts to "reset" the search criteria that may
	 * have been populated by the user or by previous search criteria.
	 */
	public void clear() {
		searchText.setText("");
		options.select(0);
		updateBooleanID();
		refresh();
	}

	/**
	 * This method refreshes the search input area composite.
	 */
	public void refresh() {
		if (inputComposite != null) {
			inputComposite.layout();
		}
	}

	/**
	 * Returns the inputID of the input area.
	 *
	 * @return inputID
	 */
	public int getInputID() {
		return inputID;
	}

	/**
	 * Getter for the text in the searchText MBox.
	 *
	 * @return the search input text
	 */
	public String getSearchInput() {
		return searchText.getText();
	}

	/**
	 * Getter for the field name for which the search input was created.
	 *
	 * @return field name which represents selected attribute
	 */
	public String getFieldName() {
		return fieldName;
	}

	/**
	 * Getter for options combo selection index
	 *
	 * @return options selection index
	 */
	public int getOptionID() {
		return options.getSelectionIndex();
	}

	/**
	 * Returns the booleanID for the input.
	 *
	 * @return booleanID
	 */
	public int getBooleanID() {
		return booleanID;
	}

	/**
	 * Sets a new inputID. All SWT objects of the input area are destroyed and a
	 * new input area is created based on the new inputID.
	 *
	 * @param inputID
	 *            the type of search input
	 */
	public void setInputID(int inputID) {
		this.inputID = inputID;
		destroy();
		createInputPattern();
		refresh();
	}

	/**
	 * Sets the new index for the options combo.
	 *
	 * @param optionID
	 *            new option index
	 */
	public void setOptionID(int optionID) {
		options.select(optionID);
		updateBooleanID();
		refresh();
	}

	/**
	 * Sets the text for the user input area, the MBox. This is used when the
	 * previous search criteria is loaded in PlanSearchPage.
	 *
	 * @param text
	 *            textual user input
	 */
	public void setInputText(String text) {
		searchText.setText(text);
	}

	/**
	 * Sets the default booleanID which describes whether or not the queries
	 * created by the input is appended with an && or an ||.
	 *
	 * @param newBooleanID
	 *            the new default booleanID for queries
	 */
	public void setDefaultBooleanID(int newBooleanID) {
		defaultBooleanID = newBooleanID;
		updateBooleanID();
	}
}


text:
import {Inject, Injectable, OpaqueToken} from '@angular/core';
import {Http, Response} from '@angular/http';
import {Observable} from 'rxjs/Observable';
import 'rxjs/add/operator/filter';
import 'rxjs/add/operator/map';

export const WEATHER_URL_BASE = new OpaqueToken('WeatherUrlBase');
export const WEATHER_URL_SUFFIX = new OpaqueToken('WeatherUrlSuffix');

export interface WeatherResult {
  place: string;
  temperature: number;
  humidity: number;
}

@Injectable()
export class WeatherService {
  constructor(
      private http: Http,
      @Inject(WEATHER_URL_BASE) private urlBase: string,
      @Inject(WEATHER_URL_SUFFIX) private urlSuffix: string) {
  }

  getWeather(city: string): Observable<WeatherResult> {
    return this.http
        .get(this.urlBase + city + this.urlSuffix)
        .map((response: Response) => response.json())
        .filter(this._hasResult)
        .map(this._parseData);
  }

  private _hasResult(data): boolean {
    return data['cod'] !== '404' && data.main;
  }

  private _parseData(data): WeatherResult {
    return {
      place: data.name || 'unknown',
      temperature: data.main.temp,
      humidity: data.main.humidity
    };
  }

}

redpajama_set_name: RedPajamaGithub


text:
<?php

use Hubzero\Content\Migration\Base;

// No direct access
defined('_HZEXEC_') or die();

/**
 * Migration script for adding Answers - Tools plugin
 **/
class Migration20170831000000PlgAnswersTools extends Base
{
	/**
	 * Up
	 **/
	public function up()
	{
		$this->addPluginEntry('answers', 'tools');
	}

	/**
	 * Down
	 **/
	public function down()
	{
		$this->deletePluginEntry('answers', 'tools');
	}
}


text:
/*
 * The Plaid API
 *
 * The Plaid REST API. Please see https://plaid.com/docs/api for more details.
 *
 * API version: 2020-09-14_1.205.3
 */

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package plaid

import (
	"encoding/json"
)

// Service A collection of details related to a fulfillment service or product in terms of request, process and result.
type Service struct {
	VERIFICATION_OF_ASSET VerificationOfAsset `json:"VERIFICATION_OF_ASSET"`
	STATUSES Statuses `json:"STATUSES"`
	AdditionalProperties map[string]interface{}
}

type _Service Service

// NewService instantiates a new Service object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewService(vERIFICATIONOFASSET VerificationOfAsset, sTATUSES Statuses) *Service {
	this := Service{}
	this.VERIFICATION_OF_ASSET = vERIFICATIONOFASSET
	this.STATUSES = sTATUSES
	return &this
}

// NewServiceWithDefaults instantiates a new Service object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewServiceWithDefaults() *Service {
	this := Service{}
	return &this
}

// GetVERIFICATION_OF_ASSET returns the VERIFICATION_OF_ASSET field value
func (o *Service) GetVERIFICATION_OF_ASSET() VerificationOfAsset {
	if o == nil {
		var ret VerificationOfAsset
		return ret
	}

	return o.VERIFICATION_OF_ASSET
}

// GetVERIFICATION_OF_ASSETOk returns a tuple with the VERIFICATION_OF_ASSET field value
// and a boolean to check if the value has been set.
func (o *Service) GetVERIFICATION_OF_ASSETOk() (*VerificationOfAsset, bool) {
	if o == nil  {
		return nil, false
	}
	return &o.VERIFICATION_OF_ASSET, true
}

// SetVERIFICATION_OF_ASSET sets field value
func (o *Service) SetVERIFICATION_OF_ASSET(v VerificationOfAsset) {
	o.VERIFICATION_OF_ASSET = v
}

// GetSTATUSES returns the STATUSES field value
func (o *Service) GetSTATUSES() Statuses {
	if o == nil {
		var ret Statuses
		return ret
	}

	return o.STATUSES
}

// GetSTATUSESOk returns a tuple with the STATUSES field value
// and a boolean to check if the value has been set.
func (o *Service) GetSTATUSESOk() (*Statuses, bool) {
	if o == nil  {
		return nil, false
	}
	return &o.STATUSES, true
}

// SetSTATUSES sets field value
func (o *Service) SetSTATUSES(v Statuses) {
	o.STATUSES = v
}

func (o Service) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if true {
		toSerialize["VERIFICATION_OF_ASSET"] = o.VERIFICATION_OF_ASSET
	}
	if true {
		toSerialize["STATUSES"] = o.STATUSES
	}

	for key, value := range o.AdditionalProperties {
		toSerialize[key] = value
	}

	return json.Marshal(toSerialize)
}

func (o *Service) UnmarshalJSON(bytes []byte) (err error) {
	varService := _Service{}

	if err = json.Unmarshal(bytes, &varService); err == nil {
		*o = Service(varService)
	} else {
		return err
	}

	additionalProperties := make(map[string]interface{})

	if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
		delete(additionalProperties, "VERIFICATION_OF_ASSET")
		delete(additionalProperties, "STATUSES")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableService struct {
	value *Service
	isSet bool
}

func (v NullableService) Get() *Service {
	return v.value
}

func (v *NullableService) Set(val *Service) {
	v.value = val
	v.isSet = true
}

func (v NullableService) IsSet() bool {
	return v.isSet
}

func (v *NullableService) Unset() {
	v.value = nil
	v.isSet = false
}

func NewNullableService(val *Service) *NullableService {
	return &NullableService{value: val, isSet: true}
}

func (v NullableService) MarshalJSON() ([]byte, error) {
	return json.Marshal(v.value)
}

func (v *NullableService) UnmarshalJSON(src []byte) error {
	v.isSet = true
	return json.Unmarshal(src, &v.value)
}


text:
<?php
namespace Chamilo\Application\Portfolio\Integration\Chamilo\Core\Menu\Package;

class Activator extends \Chamilo\Configuration\Package\Action\Activator
{
}


text:
package me.lucko.luckperms.api.implementation.internal;

import lombok.AllArgsConstructor;
import me.lucko.luckperms.api.UuidCache;

import java.util.UUID;

/**
 * Provides a link between {@link UuidCache} and {@link me.lucko.luckperms.core.UuidCache}
 */
@AllArgsConstructor
public class UuidCacheLink implements UuidCache {
    private final me.lucko.luckperms.core.UuidCache master;

    @Override
    public UUID getUUID(UUID external) {
        return master.getUUID(external);
    }

    @Override
    public UUID getExternalUUID(UUID internal) {
        return master.getExternalUUID(internal);
    }
}


text:
layout: page
title: Testing Triangles
subtitle: A classic testing exercise
css:
  - "/css/triangle.css"
js:
  - "/js/raphael-2.2.0.min.js"
  - "/js/purl-2.3.1.min.js"
  - "/js/json2-20150503.min.js"
  - "/js/jstorage-0.4.12.min.js"
  - "/js/triangle.js"
---

		<form id="form" method="get" action="">
			Please enter sizes for the sides:

					Side 2

					<input id="side2" name="side2" size="5" type="text" />

					Side 3

					<input id="side3" name="side3" size="5" type="text" />

					Side 1

					<input id="side1" name="side1" size="5" type="text" />

			Web: <select id="web" name="web" onchange="setBehavior(this.value)">
				<option value="1" selected="selected">1.0</option>
				<option value="2">2.0</option>
				<option value="3">3.0</option>
			</select><input type="submit" class="submit" tabindex="-1" value="Draw Triangle">
		</form>

Inspired on the work done by Elisabeth Hendrickson available here.

		Test Data History (reset test session)

Side 1

Side 2

Side 3

Category

Coordinates


text:
<?php

namespace AvalancheDevelopment\SwaggerRouterMiddleware\Parser;

use Psr\Http\Message\RequestInterface as Request;

class Body implements ParserInterface
{

    /** @var Request */
    protected $request;

    /**
     * @param Request $request
     */
    public function __construct(Request $request)
    {
        $this->request = $request;
    }

    /**
     * @return mixed
     */
    public function getValue()
    {
        $body = (string) $this->request->getBody();
        if (empty($body)) {
            return;
        }

        $headers = $this->request->getHeader('Content-Type');
        $jsonHeaders = array_filter($headers, [ $this, 'checkJsonHeader' ]);
        if (count($jsonHeaders) > 0) {
            return $this->parseJson($body);
        }

        return $body;
    }

    /**
     * @param string $header
     * @return boolean
     */
    protected function checkJsonHeader($header)
    {
        return preg_match('/application\/json/i', $header) > 0;
    }

    /**
     * @param string $body
     * @return mixed
     */
    protected function parseJson($body)
    {
        $parsedBody = json_decode($body, true);
        if (json_last_error() !== JSON_ERROR_NONE) {
            return;
        }

        return $parsedBody;
    }
}


text:
maintainer        "Opscode, Inc."
maintainer_email  "cookbooks@opscode.com"
license           "Apache 2.0"
description       "Installs and configures openvpn"
long_description  IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
version           "0.7"

%w{ redhat centos fedora ubuntu debian }.each do |os|
  supports os
end

attribute "openvpn/local",
  :display_name => "OpenVPN Local",
  :description => "Local interface (ip) to listen on",
  :default => "ipaddress"

attribute "openvpn/proto",
  :display_name => "OpenVPN Protocol",
  :description => "UDP or TCP",
  :default => "udp"

attribute "openvpn/type",
  :display_name => "OpenVPN Type",
  :description => "Server or server-bridge",
  :default => "server"

attribute "openvpn/subnet",
  :display_name => "OpenVPN Subnet",
  :description => "Subnet to hand out to clients",
  :default => "10.8.0.0"

attribute "openvpn/netmask",
  :display_name => "OpenVPN Netmask",
  :description => "Netmask for clients",
  :default => "255.255.0.0"


text:
package com.ccsi.app.service;

import java.util.List;

import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;

import com.ccsi.app.entity.Variable;
import com.ccsi.app.service.custom.VariableServiceCustom;

/**
 * @author mbmartinez
 */
public interface VariableService extends VariableServiceCustom, JpaRepository<Variable, Long> {

    @Deprecated
    List<Variable> findByTenant_id(Long tenantId, Sort sort);

    /**
     * To find a variable "templates" (one associated with a tenant but not with a tenant record), set
     * recordId to null.
     */
    List<Variable> findByTenant_idAndRecord_id(Long tenantId, Long recordId, Sort sort);

}


text:
      <button class="btn btn-success" data-target="#quote" data-toggle="modal">Add a quote</button>
      <button class="btn btn-warning" data-target="#random-quote" data-toggle="modal" data-ng-click="randomQuoteGenerator()">Random Quote</button>
      <button class="btn btn-danger clear-search" data-ng-click="search=''">See All</button>
      <input type="text" data-ng-model="search.author">

{{quote.text}}

{{quote.author}}

          What is the quote?

          <form action="" class="form-horizontal">

              Quote:

                <textarea type="text" class="form-control" id="quote-text" placeholder="What we do in life echos in eternity." data-ng-model="newQuote.text"></textarea>

              Author:

                <input type="text" class="form-control" id="quote-author" placeholder="Maximus Decimus Maridius" data-ng-model="newQuote.author">

          </form>

          <button class="btn btn-default" data-dismiss="modal">Cancel</button>
          <button class="btn btn-success" type="submit" data-dismiss="modal" data-ng-click="addQuote(newQuote)">Submit</button>

          Random Quote:

{{quote.text}}

{{quote.author}}

          <button class="btn btn-default" data-dismiss="modal">Cancel</button>


text:
#ifndef _ASM_X86_IA32_H
#define _ASM_X86_IA32_H

#ifdef CONFIG_IA32_EMULATION

#include <linux/compat.h>

/*
 * 32 bit structures for IA32 support.
 */

#include <uapi/asm/sigcontext.h>

/* signal.h */

struct ucontext_ia32 {
	unsigned int	  uc_flags;
	unsigned int 	  uc_link;
	compat_stack_t	  uc_stack;
	struct sigcontext_32 uc_mcontext;
	compat_sigset_t	  uc_sigmask;	/* mask last for extensibility */
};

/* This matches struct stat64 in glibc2.2, hence the absolutely
 * insane amounts of padding around dev_t's.
 */
struct stat64 {
	unsigned long long	st_dev;
	unsigned char		__pad0[4];

#define STAT64_HAS_BROKEN_ST_INO	1
	unsigned int		__st_ino;

	unsigned int		st_mode;
	unsigned int		st_nlink;

	unsigned int		st_uid;
	unsigned int		st_gid;

	unsigned long long	st_rdev;
	unsigned char		__pad3[4];

	long long		st_size;
	unsigned int		st_blksize;

	long long		st_blocks;/* Number 512-byte blocks allocated */

	unsigned 		st_atime;
	unsigned 		st_atime_nsec;
	unsigned 		st_mtime;
	unsigned 		st_mtime_nsec;
	unsigned 		st_ctime;
	unsigned 		st_ctime_nsec;

	unsigned long long	st_ino;
} __attribute__((packed));

#define IA32_STACK_TOP IA32_PAGE_OFFSET

#ifdef __KERNEL__
struct linux_binprm;
extern int ia32_setup_arg_pages(struct linux_binprm *bprm,
				unsigned long stack_top, int exec_stack);
struct mm_struct;
extern void ia32_pick_mmap_layout(struct mm_struct *mm);

#endif

#endif /* !CONFIG_IA32_SUPPORT */

#endif /* _ASM_X86_IA32_H */


text:
Simple wrapper for persistent detecting something until get the truth.

## Usage

### Installation

`npm install true-detective`

### Example

```js
import detective from 'true-detective'
import fetch from 'node-fetch'

detective.take('job', {
  interval: () => {
    return 2
  }
})(() => {
  // step one
  // detect something
  return fetch('http://somesite.com')
    .then((res) => {
      return res.json()
    })
})((res) => {
  // step two
  // check the result
  if (res.evidence) {
    return true
  }
})((res) => {
  // step three
  // execution
  // tigger something here
})
```

Or with `forever` run this job in the background.

`forever start -c 'babel-node' -m 1 job.js`

## API

### detective.take(jobName, [options])(detectFn)(judgeFn)(executeFn)

This is the only method of detective, with 3 steps to do its job.

#### options

* interval[Number|Function] the interval of the running job, default to be 2s

#### detectFn

DetectFn as the first step, should be a function and must return a `Promise`.

#### judgeFn(result)

JudgeFn is the second step, it receives just on param, the result from detectFn, this Function is for user to check if this detective got the truth, if so, return true. The job will be completed after that.

#### executeFn(result)

ExecuteFn is the last step of the Job, will be triggered when judgeFn return true.


text:
package io.corbel.iam.exception;

public class UnauthorizedTimeException extends UnauthorizedException {

    private static final long serialVersionUID = -822589169427171311L;

    public UnauthorizedTimeException(String originalExceptionMessage) {
        super("Invalid provided time, please check your system\'s clock. \nOriginal message raised: " + originalExceptionMessage);
    }
}


text:
Connect-VIServer "resvc9001"
$outputFile = "Output csv file, eg : c:\temp\DiskRep.csv"
$cltName = "BCP Cluster 2 for Corp 465 G7"

new-variable -Name clusterName -Scope global -Value $cltName -Force
new-variable -Name LUNDetails -Scope global -Value @() -Force
new-variable -Name LUNDetTemp -Scope global -Value @() -Force
new-variable -Name LUNDetFinal -Scope global -Value @() -Force

####################################################
#Function to create objects and insert into array.#
####################################################
function insert-obj(){
[CmdletBinding()]
param(
[PSObject]$esxHost,
[PSObject]$vmName,
[PSObject]$dsName,
[PSObject]$cnName,
[PSObject]$rnName,
[PSObject]$Type,
[PSObject]$CapacityGB,
[PSObject]$ArrayName
)
$object = New-Object -TypeName PSObject
$object | Add-Member -Name 'Cluster' -MemberType Noteproperty -Value $global:clusterName
$object | Add-Member -Name 'Host' -MemberType Noteproperty -Value $esxHost
$object | Add-Member -Name 'DatastoreName' -MemberType Noteproperty -Value $dsName
$object | Add-Member -Name 'VMName' -MemberType Noteproperty -Value $vmName
$object | Add-Member -Name 'CanonicalNames' -MemberType Noteproperty -Value $cnName
$object | Add-Member -Name 'LUN' -MemberType Noteproperty -Value $rnName[0].Substring($rnName[0].LastIndexof("L")+1)
$object | Add-Member -Name 'Type' -MemberType Noteproperty -Value $Type
$object | Add-Member -Name 'CapacityGB' -MemberType Noteproperty -Value $CapacityGB
if ($ArrayName -eq "LUNDetails"){
$global:LUNDetails += $object
}
elseif($ArrayName -eq "LUNDetTemp"){
$global:LUNDetTemp += $object
}
}
######################################
#Collect the hostnames in the cluster#
######################################
$Hosts = Get-Cluster $clusterName | Get-VMHost | select -ExpandProperty Name
#############################################
#Collecting datastore, RDM and LUN Details.#
#############################################
foreach($vmHost in $Hosts) {
Write-Host "Collecting Datastore details from host $vmHost ...."
get-vmhost -Name $vmHost | Get-Datastore | % {
$naaid = $_.ExtensionData.Info.Vmfs.Extent | select -ExpandProperty DiskName
$RuntimeName = Get-ScsiLun -vmhost $vmHost -CanonicalName $naaid | Select -ExpandProperty RuntimeName
insert-obj -esxHost $vmHost -dsName $_.Name -cnName $naaid -rnName $RuntimeName -Type $_.Type -CapacityGB $_.CapacityGB -ArrayName LUNDetails
}
Write-Host "Collecting RDM Disk details from host $vmHost ...."
get-vmhost -Name $vmHost | Get-VM | Get-HardDisk -DiskType "RawPhysical","RawVirtual" | % {
$naaid = $_.SCSICanonicalName
$RuntimeName = Get-ScsiLun -vmhost $vmHost -CanonicalName $naaid | Select -ExpandProperty RuntimeName
insert-obj -esxHost $vmHost -vmName $_.Parent -cnName $naaid -rnName $RuntimeName -Type RDM -CapacityGB $_.CapacityGB -ArrayName LUNDetails
}
Write-Host "Collecting Free SCSI LUN(Non-RDM/VMFS) details from host $vmHost ...."
(get-view (get-vmhost -name $vmHost | Get-View ).ConfigManager.DatastoreSystem).QueryAvailableDisksForVmfs($null) | %{
$naaid = $_.CanonicalName
$DiskTemp = Get-ScsiLun -vmhost $vmHost -CanonicalName $naaid
insert-obj -esxHost $vmHost -cnName $naaid -rnName $DiskTemp.RuntimeName -Type FREE -CapacityGB $DiskTemp.CapacityGB -ArrayName LUNDetails
}
Write-Host "Collecting details of Unallocated LUNs from host $vmHost ...."
Get-ScsiLun -VmHost $vmHost | %{
$naaid = $_.CanonicalName
$naaidTemp = $LUNDetails | select -ExpandProperty CanonicalNames
If ($naaidTemp -notcontains $naaid){
insert-obj -esxHost $vmHost -cnName $naaid -rnName $_.RuntimeName -Type UNKNOWN -CapacityGB $_.CapacityGB -ArrayName LUNDetTemp
}
}
$global:LUNDetails += $global:LUNDetTemp
$global:LUNDetFinal += $global:LUNDetails
$global:LUNDetails.Clear()
$global:LUNDetTemp.Clear()
}
############################
#Export output to CSV file #
############################
$global:LUNDetFinal | Sort-Object Host,{[int]$_.LUN} |
select Cluster,Host,CanonicalNames,Type,LUN,DatastoreName,VMName,CapacityGB  | Export-Csv -NoTypeInformation  $outputFile
$global:LUNDetFinal.Clear()


text:
from __future__ import division
from pySDC.Hooks import hooks
from pySDC.Stats import stats

import matplotlib.pyplot as plt
import numpy as np

from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter

class plot_solution(hooks):

    def __init__(self):
        """
        Initialization of output
        """
        super(plot_solution,self).__init__()

        # add figure object for further use
        #        self.fig = plt.figure(figsize=(18,6))
        self.fig = plt.figure(figsize=(9,9))

    def dump_step(self,status):
        """
        Overwrite standard dump per step

        Args:
            status: status object per step
        """
        super(plot_solution,self).dump_step(status)

        #yplot = self.level.uend.values
        #xx    = self.level.prob.xx
        #zz    = self.level.prob.zz
        #self.fig.clear()
        #plt.plot( xx[:,0], yplot[2,:,0])
        #plt.ylim([-1.1, 1.1])
        #plt.show(block=False)
        #plt.pause(0.00001)

        if True:
          yplot = self.level.uend.values
          xx    = self.level.prob.xx
          zz    = self.level.prob.zz
          self.fig.clear()
          levels = [-5e-3, -4e-3, -3e-3, -2e-3, -1e3, 1e-3, 2e-3, 3e-3, 4e-3, 5e-3]
          CS = plt.contourf(xx, zz, yplot[2,:,:], rstride=1, cstride=1, cmap=cm.coolwarm, linewidth=0, antialiased=False)
#          CS = plt.contour(xx, zz, yplot[2,:,:], rstride=1, cstride=1, linewidth=0, antialiased=False)
          cbar = plt.colorbar(CS)
          plt.axes().set_xlim(xmin = self.level.prob.x_bounds[0], xmax = self.level.prob.x_bounds[1])
          plt.axes().set_ylim(ymin = self.level.prob.z_bounds[0], ymax = self.level.prob.z_bounds[1])
          #plt.axes().set_aspect('equal')
          plt.xlabel('x')
          plt.ylabel('z')
          #plt.tight_layout()
          plt.show(block=False)
          plt.pause(0.00001)

        return None


text:
// Copyright (c) 2015 Titanium I.T. LLC. All rights reserved. For license, see "README" or "LICENSE" file.

/* Convert JSHint error object to human-readable strings (one string per line) */

(function() {
	"use strict";

	exports.translate = function translate(errors) {
		var result = [];

		errors.forEach(function(error) {
			if (error === null) return;
			var evidence = (error.evidence !== undefined) ? ": " + error.evidence.trim() : "";
			var code = (error.code !== undefined) ? " (" + error.code + ")" : "";

			result.push(error.line + evidence);
			result.push("   " + error.reason + code);
		});

		return result;
	};

})();


text:
<?php
declare(strict_types=1);

namespace Application\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
 * Auto-generated Migration: Please modify to your needs!
 */
class Version20170829152810 extends AbstractMigration
{
    public function up(Schema $schema): void
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');

        $this->addSql('ALTER TABLE user DROP locked, DROP expires_at, DROP credentials_expire_at, CHANGE salt salt VARCHAR(255) DEFAULT NULL');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');

        $this->addSql('ALTER TABLE user ADD locked TINYINT(1) NOT NULL, ADD expires_at DATETIME DEFAULT NULL, ADD credentials_expire_at DATETIME DEFAULT NULL, CHANGE salt salt VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
    }
}


text:
namespace chromeos {
namespace default_app_order {

// ExternalLoader checks FILE_DEFAULT_APP_ORDER and loads it if the file
// exists. Otherwise, it uses the default built-in order. The file loading runs
// asynchronously on start up except for the browser restart path, in which
// case, start up will wait for the file check to finish because user profile
// might need to access the ordinals data.
class ExternalLoader {
 public:
  // Constructs an ExternalLoader and starts file loading. |async| is true to
  // load the file asynchronously on the blocking pool.
  explicit ExternalLoader(bool async);

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

  ~ExternalLoader();

  const std::vector<std::string>& GetAppIds();
  const std::string& GetOemAppsFolderName();

 private:
  void Load();

  // A vector of app id strings that defines the default order of apps.
  std::vector<std::string> app_ids_;

  std::string oem_apps_folder_name_;

  base::WaitableEvent loaded_;
};

// Gets the ordered list of app ids.
void Get(std::vector<std::string>* app_ids);

// Get the name of OEM apps folder in app launcher.
std::string GetOemAppsFolderName();

// Number of apps in hard-coded apps order.
size_t DefaultAppCount();

}  // namespace default_app_order
}  // namespace chromeos

#endif  // CHROME_BROWSER_ASH_EXTENSIONS_DEFAULT_APP_ORDER_H_


text:
from optparse import OptionParser
import sys
import os
import netsnmp
import pickle
import socket
import struct
import time

os.environ['MIBS'] = 'all' # install F5 mibs in net-snmp mibs directory
                           # usually /usr/share/snmp/mibs

package = ([])

def fetchOID(host, community, graphiteroot, virtualserver, verbose):
    if verbose:
        print >> sys.stderr, 'connecting to host: %s using community: %s' % ( host, community )

    statsTable = {
        'gtmWideipStatRequests': '1.3.6.1.4.1.3375.2.3.12.2.3.1.2',
        'gtmWideipStatResolutions': '1.3.6.1.4.1.3375.2.3.12.2.3.1.3',
        'gtmWideipStatPersisted': '1.3.6.1.4.1.3375.2.3.12.2.3.1.4',
        'gtmWideipStatPreferred': '1.3.6.1.4.1.3375.2.3.12.2.3.1.5',
        'gtmWideipStatFallback': '1.3.6.1.4.1.3375.2.3.12.2.3.1.6',
        'gtmWideipStatDropped': '1.3.6.1.4.1.3375.2.3.12.2.3.1.7',
        'gtmWideipStatExplicitIp': '1.3.6.1.4.1.3375.2.3.12.2.3.1.8',
        'gtmWideipStatReturnToDns': '1.3.6.1.4.1.3375.2.3.12.2.3.1.9'

        }
    snmp = netsnmp.Session(DestHost=host, Version=2, Community=community)

    # connect and fetch the list of virtual servers
    gtmWideipStatList = '.1.3.6.1.4.1.3375.2.3.12.2.3.1.1'
    Var = netsnmp.Varbind(gtmWideipStatList)
    Vars = netsnmp.VarList(Var)
    snmp.walk(Vars)
    currentTime = time.time()
    for vs in Vars:
        # vs.iid = the index of the virtualserver
        # vs.tag = leaf identifier e.g. 'ltmVirtualServName'
        # vs.val = name of virtual server
        # vs.type = snmp data type, e.g. counter, integer, etc

        # if we specified a list of virtualservers
        # make sure we filter on those
        if virtualserver:
            if vs.val not in virtualserver:
                continue
        for type in statsTable:
            try:
                oid = statsTable[type] + "." + vs.iid
                head, tail = oid.rsplit('.', 1)
                vars = netsnmp.VarList(netsnmp.Varbind(head, tail))
                result = [x[0] for x in snmp.get(vars)]
                result = float(x)
                if verbose:
                    print >> sys.stderr, '%s %s = %s' % (vs.val, type, result)
                #currentTime = time.time()
                datapoint = '%s.%s.%s' % (graphiteroot, vs.val, type)
                package.append((datapoint, (currentTime, result)))
            except Exception as uhoh:
                print >> sys.stderr, "could not get oid: %s" % uhoh
                #sys.exit(1)

    return package, currentTime, result

def makePickle(datapoint, currentTime, data, verbose, debug):
    if debug:
        print >> sys.stderr, 'storing pickle in \'data.p\''
        fh = open('data.p', 'wb')
        pickle.dump(package, fh)
        sys.exit()
    shippingPackage = pickle.dumps(package, 1)
    return shippingPackage

def sendPickle(carbonServer, carbonPort, shippingPackage, verbose):
    packageSize = struct.pack('!L', len(shippingPackage))
    if verbose:
        print >> sys.stderr, 'connecting to carbon server: %s on port: %s' % ( carbonServer, carbonPort )
    try:
        s = socket.socket()
        s.connect((carbonServer, carbonPort))
        s.sendall(packageSize)
        s.sendall(shippingPackage)
        if verbose:
            print >> sys.stderr, 'sending pickle...'
    except Exception as uhoh:
        print "Could not connect to carbon server: %s" % uhoh
        sys.exit(1)

def main():
    parser = OptionParser()
    parser.add_option('-H', '--host', dest='host',
        help='Hostname/IP of the network device')
    parser.add_option('-c', '--community', dest='community',
        help='SNMP v2c community string to use')
    parser.add_option('-s', '--virtualserver', dest='virtualserver',
        action='append',
        help='LTM virtual server(s) to fetch stats for. Can be used more than once or left out to just fetch all virtual servers.')
    parser.add_option('-G', '--graphite-root', dest='graphiteroot',
        help='root of the tree to use in Graphite')
    parser.add_option('-S', '--carbon-server', dest='carbonserver',
        default='127.0.0.1',
        help='set the server to send the pickle to. Default: 127.0.0.1')
    parser.add_option('-p', '--carbon-port', dest='carbonport',
        default='2004',
        type='int',
        help='carbon port. Default: 2004')
    parser.add_option('-v', '--verbose', dest='verbose',
        action='store_true',
        help='enable verbose output')
    parser.add_option('-d', '--debug', dest='debug',
        action='store_true',
        help='do not submit to carbon. Output the pickle as file \'data.p\' in current directory')
    options, args = parser.parse_args()

    if not options.host or not options.community:
        parser.print_help()
        sys.exit()

    #party time
    package, currentTime, result = fetchOID(options.host, options.community, options.graphiteroot, options.virtualserver, options.verbose)
    shippingPackage = makePickle(package, currentTime, result, options.verbose, options.debug)
    sendPickle(options.carbonserver, options.carbonport, shippingPackage, options.verbose)

if __name__ == '__main__':
    main()


text:
package tfo.junit.matcher.file;

import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.StringDescription;
import org.hamcrest.TypeSafeDiagnosingMatcher;
import org.jetbrains.annotations.NotNull;

import java.io.File;
import java.util.Objects;

import static tfo.junit.matcher.file.Functions.toFile;

public class ContainsNumberOfFilesMatcher<T> extends TypeSafeDiagnosingMatcher<T> {

    private final Matcher<? super Integer> numberMatcher;

    public ContainsNumberOfFilesMatcher(@NotNull Matcher<? super Integer> numberMatcher) {
        this.numberMatcher = Objects.requireNonNull(numberMatcher);
    }

    @Override
    protected boolean matchesSafely(@NotNull T item, @NotNull Description mismatchDescription) {
        final File f = toFile(item);

        if (!f.exists()) {
            mismatchDescription.appendValue(item);
            mismatchDescription.appendText(" does not exist.");
            return false;
        }

        if (!f.isDirectory()) {
            mismatchDescription.appendValue(item);
            mismatchDescription.appendText(" is not a directory.");
            return false;
        }

        final File[] files = f.listFiles();
        if (files == null) {
            mismatchDescription.appendValue(item);
            mismatchDescription.appendText(" did not return any files on listFiles()");
            return false;
        }

        int fileCount = 0;
        int dirCount = 0;
        for (File file : files) {
            if (file.isFile()) {
                fileCount++;
            } else if (file.isDirectory()) {
                dirCount++;
            }
        }

        if (numberMatcher.matches(fileCount)) {
            return true;
        }

        mismatchDescription.appendText("a directory containing ");
        if (fileCount == 0) {
            mismatchDescription.appendText("no files");
        } else {
            mismatchDescription.appendValue(fileCount);
            mismatchDescription.appendText(" files");
        }
        if (dirCount == 0) {
            mismatchDescription.appendText(" and no directories");
        } else if (dirCount == 1) {
            mismatchDescription.appendText(" and one directory");
        } else {
            mismatchDescription.appendText(" and ");
            mismatchDescription.appendValue(dirCount);
            mismatchDescription.appendText(" directories");
        }
        return false;
    }

    @Override
    public void describeTo(@NotNull Description description) {
        description.appendText("a directory with the number of files ");
        final StringDescription tmp = new StringDescription();
        numberMatcher.describeTo(tmp);
        if (tmp.toString().startsWith("a value ")) {
            // yeah, well: a directory containing a value greater than <3> files doesn't sound to good in Englisch...
            description.appendText(tmp.toString().substring(8));
        } else {
            description.appendText(tmp.toString());
        }
    }
}


text:
IMPLEMENT_CO_CLIENTEVENT_V1(SimDataBlockEvent);
IMPLEMENT_CO_CLIENTEVENT_V1(Sim2DAudioEvent);
IMPLEMENT_CO_CLIENTEVENT_V1(Sim3DAudioEvent);
IMPLEMENT_CO_CLIENTEVENT_V1(SetMissionCRCEvent);

ConsoleDocClass( SimDataBlockEvent,
				"@brief Use by GameConnection to process incoming datablocks.\n\n"
				"Not intended for game development, internal use only, but does expose onDataBlockObjectReceived.\n\n "
				"@internal");

ConsoleDocClass( Sim2DAudioEvent,
				"@brief Use by GameConnection to send a 2D sound event over the network.\n\n"
				"Not intended for game development, internal use only, but does expose GameConnection::play2D.\n\n "
				"@internal");

ConsoleDocClass( Sim3DAudioEvent,
				"@brief Use by GameConnection to send a 3D sound event over the network.\n\n"
				"Not intended for game development, internal use only, but does expose GameConnection::play3D.\n\n "
				"@internal");

ConsoleDocClass( SetMissionCRCEvent,
				"@brief Use by GameConnection to send a 3D sound event over the network.\n\n"
				"Not intended for game development, internal use only, but does expose GameConnection::setMissionCRC.\n\n "
				"@internal");

//----------------------------------------------------------------------------

SimDataBlockEvent::SimDataBlockEvent(SimDataBlock* obj, U32 index, U32 total, U32 missionSequence)
{
   mObj = NULL;
   mIndex = index;
   mTotal = total;
   mMissionSequence = missionSequence;
   mProcess = false;

   if(obj)
   {
      id = obj->getId();
      AssertFatal(id >= DataBlockObjectIdFirst && id <= DataBlockObjectIdLast,
                  "Out of range event data block id... check simBase.h");

      #ifdef DEBUG_SPEW
      Con::printf("queuing data block: %d", mIndex);
      #endif
   }
}

SimDataBlockEvent::~SimDataBlockEvent()
{
   if( mObj )
      delete mObj;
}

#ifdef TORQUE_DEBUG_NET
const char *SimDataBlockEvent::getDebugName()
{
   SimObject *obj = Sim::findObject(id);
   static char buffer[256];
   dSprintf(buffer, sizeof(buffer), "%s [%s - %s]",
            getClassName(),
            obj ? obj->getName() : "",
            obj ? obj->getClassName() : "NONE");
   return buffer;
}
#endif // TORQUE_DEBUG_NET

void SimDataBlockEvent::notifyDelivered(NetConnection *conn, bool )
{
   // if the modified key for this event is not the current one,
   // we've already resorted and resent some blocks, so fall out.
   if(conn->isRemoved())
      return;

   GameConnection *gc = (GameConnection *) conn;
   if(gc->getDataBlockSequence() != mMissionSequence)
      return;

   U32 nextIndex = mIndex + DataBlockQueueCount;
   SimDataBlockGroup *g = Sim::getDataBlockGroup();

   if(mIndex == g->size() - 1)
   {
      gc->setDataBlockModifiedKey(gc->getMaxDataBlockModifiedKey());
      gc->sendConnectionMessage(GameConnection::DataBlocksDone, mMissionSequence);
   }

   if(g->size() <= nextIndex)
      return;

   SimDataBlock *blk = (SimDataBlock *) (*g)[nextIndex];
   gc->postNetEvent(new SimDataBlockEvent(blk, nextIndex, g->size(), mMissionSequence));
}

void SimDataBlockEvent::pack(NetConnection *conn, BitStream *bstream)
{
   SimDataBlock* obj;
   Sim::findObject(id,obj);
   GameConnection *gc = (GameConnection *) conn;
   if(bstream->writeFlag(gc->getDataBlockModifiedKey() < obj->getModifiedKey()))
   {
      if(obj->getModifiedKey() > gc->getMaxDataBlockModifiedKey())
         gc->setMaxDataBlockModifiedKey(obj->getModifiedKey());

      AssertFatal(obj,
                  "SimDataBlockEvent:: Data blocks cannot be deleted");
      bstream->writeInt(id - DataBlockObjectIdFirst,DataBlockObjectIdBitSize);

      S32 classId = obj->getClassId(conn->getNetClassGroup());
      bstream->writeClassId(classId, NetClassTypeDataBlock, conn->getNetClassGroup());
      bstream->writeInt(mIndex, DataBlockObjectIdBitSize);
      bstream->writeInt(mTotal, DataBlockObjectIdBitSize + 1);
      obj->packData(bstream);
#ifdef TORQUE_DEBUG_NET
      bstream->writeInt(classId ^ DebugChecksum, 32);
#endif
   }
}

void SimDataBlockEvent::unpack(NetConnection *cptr, BitStream *bstream)
{
   if(bstream->readFlag())
   {
      mProcess = true;
      id = bstream->readInt(DataBlockObjectIdBitSize) + DataBlockObjectIdFirst;
      S32 classId = bstream->readClassId(NetClassTypeDataBlock, cptr->getNetClassGroup());
      mIndex = bstream->readInt(DataBlockObjectIdBitSize);
      mTotal = bstream->readInt(DataBlockObjectIdBitSize + 1);

      SimObject* ptr;
      if( Sim::findObject( id, ptr ) )
      {
         // An object with the given ID already exists.  Make sure it has the right class.

         AbstractClassRep* classRep = AbstractClassRep::findClassRep( cptr->getNetClassGroup(), NetClassTypeDataBlock, classId );
         if( classRep && dStrcmp( classRep->getClassName(), ptr->getClassName() ) != 0 )
         {
            Con::warnf( "A '%s' datablock with id: %d already existed. "
                        "Clobbering it with new '%s' datablock from server.",
                        ptr->getClassName(), id, classRep->getClassName() );
            ptr->deleteObject();
            ptr = NULL;
         }
      }

      if( !ptr )
         ptr = ( SimObject* ) ConsoleObject::create( cptr->getNetClassGroup(), NetClassTypeDataBlock, classId );

      mObj = dynamic_cast< SimDataBlock* >( ptr );
      if( mObj != NULL )
      {
         #ifdef DEBUG_SPEW
         Con::printf(" - SimDataBlockEvent: unpacking event of type: %s", mObj->getClassName());
         #endif

         mObj->unpackData( bstream );
      }
      else
      {
         #ifdef DEBUG_SPEW
         Con::printf(" - SimDataBlockEvent: INVALID PACKET!  Could not create class with classID: %d", classId);
         #endif

         delete ptr;
         cptr->setLastError("Invalid packet in SimDataBlockEvent::unpack()");
      }

#ifdef TORQUE_DEBUG_NET
      U32 checksum = bstream->readInt(32);
      AssertISV( (checksum ^ DebugChecksum) == (U32)classId,
         avar("unpack did not match pack for event of class %s.",
            mObj->getClassName()) );
#endif

   }
}

void SimDataBlockEvent::write(NetConnection *cptr, BitStream *bstream)
{
   if(bstream->writeFlag(mProcess))
   {
      bstream->writeInt(id - DataBlockObjectIdFirst,DataBlockObjectIdBitSize);
      S32 classId = mObj->getClassId(cptr->getNetClassGroup());
      bstream->writeClassId(classId, NetClassTypeDataBlock, cptr->getNetClassGroup());
      bstream->writeInt(mIndex, DataBlockObjectIdBitSize);
      bstream->writeInt(mTotal, DataBlockObjectIdBitSize + 1);
      mObj->packData(bstream);
   }
}

void SimDataBlockEvent::process(NetConnection *cptr)
{
   if(mProcess)
   {
      //call the console function to set the number of blocks to be sent
      Con::executef("onDataBlockObjectReceived", mIndex, mTotal);

      String &errorBuffer = NetConnection::getErrorBuffer();

      // Register the datablock object if this is a new DB
      // and not for a modified datablock event.

      if( !mObj->isProperlyAdded() )
      {
         // This is a fresh datablock object.
         // Perform preload on datablock and register
         // the object.

         GameConnection* conn = dynamic_cast< GameConnection* >( cptr );
         if( conn )
            conn->preloadDataBlock( mObj );

         if( mObj->registerObject(id) )
         {
            cptr->addObject( mObj );
            mObj = NULL;
         }
      }
      else
      {
         // This is an update to an existing datablock.  Preload
         // to finish this.

         mObj->preload( false, errorBuffer );
         mObj = NULL;
      }
   }
}

//----------------------------------------------------------------------------

Sim2DAudioEvent::Sim2DAudioEvent(SFXProfile *profile)
{
   mProfile = profile;
}

void Sim2DAudioEvent::pack(NetConnection *, BitStream *bstream)
{
   bstream->writeInt( mProfile->getId() - DataBlockObjectIdFirst, DataBlockObjectIdBitSize);
}

void Sim2DAudioEvent::write(NetConnection *, BitStream *bstream)
{
   bstream->writeInt( mProfile->getId() - DataBlockObjectIdFirst, DataBlockObjectIdBitSize);
}

void Sim2DAudioEvent::unpack(NetConnection *, BitStream *bstream)
{
   SimObjectId id = bstream->readInt(DataBlockObjectIdBitSize) + DataBlockObjectIdFirst;
   Sim::findObject(id, mProfile);
}

void Sim2DAudioEvent::process(NetConnection *)
{
   if (mProfile)
      SFX->playOnce( mProfile );
}

//----------------------------------------------------------------------------

static F32 SoundPosAccuracy = 0.5;
static S32 SoundRotBits = 8;

Sim3DAudioEvent::Sim3DAudioEvent(SFXProfile *profile,const MatrixF* mat)
{
   mProfile = profile;
   if (mat)
      mTransform = *mat;
}

void Sim3DAudioEvent::pack(NetConnection *con, BitStream *bstream)
{
   bstream->writeInt(mProfile->getId() - DataBlockObjectIdFirst, DataBlockObjectIdBitSize);

   // If the sound has cone parameters, the orientation is
   // transmitted as well.
   SFXDescription* ad = mProfile->getDescription();
   if ( bstream->writeFlag( ad->mConeInsideAngle || ad->mConeOutsideAngle ) )
   {
      QuatF q(mTransform);
      q.normalize();

      // LH - we can get a valid quat that's very slightly over 1 in and so
      // this fails (barely) check against zero.  So use some error-
      AssertFatal((1.0 - ((q.x * q.x) + (q.y * q.y) + (q.z * q.z))) >= (0.0 - 0.001),
                  "QuatF::normalize() is broken in Sim3DAudioEvent");

      bstream->writeSignedFloat(q.x,SoundRotBits);
      bstream->writeSignedFloat(q.y,SoundRotBits);
      bstream->writeSignedFloat(q.z,SoundRotBits);
      bstream->writeFlag(q.w < 0.0);
   }

   Point3F pos;
   mTransform.getColumn(3,&pos);
   bstream->writeCompressedPoint(pos,SoundPosAccuracy);
}

void Sim3DAudioEvent::write(NetConnection *con, BitStream *bstream)
{
   // Just do the normal pack...
   pack(con,bstream);
}

void Sim3DAudioEvent::unpack(NetConnection *con, BitStream *bstream)
{
   SimObjectId id = bstream->readInt(DataBlockObjectIdBitSize) + DataBlockObjectIdFirst;
   Sim::findObject(id, mProfile);

   if (bstream->readFlag()) {
      QuatF q;
      q.x = bstream->readSignedFloat(SoundRotBits);
      q.y = bstream->readSignedFloat(SoundRotBits);
      q.z = bstream->readSignedFloat(SoundRotBits);
      F32 value = ((q.x * q.x) + (q.y * q.y) + (q.z * q.z));
// #ifdef __linux
      // Hmm, this should never happen, but it does...
      if ( value > 1.f )
         value = 1.f;
// #endif
      q.w = mSqrt(1.f - value);
      if (bstream->readFlag())
         q.w = -q.w;
      q.setMatrix(&mTransform);
   }
   else
      mTransform.identity();

   Point3F pos;
   bstream->readCompressedPoint(&pos,SoundPosAccuracy);
   mTransform.setColumn(3, pos);
}

void Sim3DAudioEvent::process(NetConnection *)
{
   if (mProfile)
      SFX->playOnce( mProfile, &mTransform );
}


text:
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/projector/projector_ui_controller.h"

#include <memory>
#include <string>

#include "ash/constants/ash_features.h"
#include "ash/constants/ash_pref_names.h"
#include "ash/projector/projector_annotation_tray.h"
#include "ash/projector/projector_controller_impl.h"
#include "ash/projector/projector_metrics.h"
#include "ash/public/cpp/test/mock_projector_client.h"
#include "ash/root_window_controller.h"
#include "ash/session/session_controller_impl.h"
#include "ash/shell.h"
#include "ash/strings/grit/ash_strings.h"
#include "ash/test/ash_test_base.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "projector_ui_controller.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/events/test/event_generator.h"
#include "ui/message_center/message_center.h"
#include "ui/message_center/message_center_observer.h"
#include "ui/message_center/message_center_types.h"
#include "ui/message_center/notification_list.h"

namespace ash {

namespace {

constexpr char kProjectorCreationFlowErrorHistogramName[] =
    "Ash.Projector.CreationFlowError.ClamshellMode";
constexpr char kProjectorMarkerColorHistogramName[] =
    "Ash.Projector.MarkerColor.ClamshellMode";
constexpr char kProjectorToolbarHistogramName[] =
    "Ash.Projector.Toolbar.ClamshellMode";

}  // namespace

class MockMessageCenterObserver : public message_center::MessageCenterObserver {
 public:
  MockMessageCenterObserver() = default;
  MockMessageCenterObserver(const MockMessageCenterObserver&) = delete;
  MockMessageCenterObserver& operator=(const MockMessageCenterObserver&) =
      delete;
  ~MockMessageCenterObserver() override = default;

  MOCK_METHOD1(OnNotificationAdded, void(const std::string& notification_id));
  MOCK_METHOD2(OnNotificationRemoved,
               void(const std::string& notification_id, bool by_user));
  MOCK_METHOD2(OnNotificationDisplayed,
               void(const std::string& notification_id,
                    const message_center::DisplaySource source));
};

class ProjectorUiControllerTest : public AshTestBase {
 public:
  ProjectorUiControllerTest() {
    scoped_feature_list_.InitWithFeatures(
        {features::kProjector, features::kProjectorAnnotator}, {});
  }

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

  // AshTestBase:
  void SetUp() override {
    AshTestBase::SetUp();

    auto* projector_controller = Shell::Get()->projector_controller();
    projector_controller->SetClient(&projector_client_);
    controller_ = projector_controller->ui_controller();
  }

 protected:
  ProjectorUiController* controller_;
  MockProjectorClient projector_client_;

 private:
  base::test::ScopedFeatureList scoped_feature_list_;
};

TEST_F(ProjectorUiControllerTest, ShowAndHideTray) {
  auto* projector_annotation_tray = Shell::GetPrimaryRootWindowController()
                                        ->GetStatusAreaWidget()
                                        ->projector_annotation_tray();
  controller_->ShowAnnotationTray(Shell::GetPrimaryRootWindow());
  EXPECT_TRUE(projector_annotation_tray->visible_preferred());
  controller_->HideAnnotationTray();
  EXPECT_FALSE(projector_annotation_tray->visible_preferred());
}

TEST_F(ProjectorUiControllerTest, ShowAndHideTrayMultipleDisplays) {
  UpdateDisplay("800x700,801+0-800x700");
  aura::Window::Windows roots = Shell::GetAllRootWindows();
  ASSERT_EQ(2u, roots.size());
  auto* primary_display_tray = Shell::GetPrimaryRootWindowController()
                                   ->GetStatusAreaWidget()
                                   ->projector_annotation_tray();
  auto* external_display_tray = RootWindowController::ForWindow(roots[1])
                                    ->GetStatusAreaWidget()
                                    ->projector_annotation_tray();

  // Show tray on primary root window.
  controller_->ShowAnnotationTray(Shell::GetPrimaryRootWindow());
  EXPECT_TRUE(primary_display_tray->visible_preferred());
  EXPECT_FALSE(external_display_tray->visible_preferred());

  // Change the root window of the recorded window.
  controller_->OnRecordedWindowChangingRoot(roots[1]);
  EXPECT_FALSE(primary_display_tray->visible_preferred());
  EXPECT_TRUE(external_display_tray->visible_preferred());

  controller_->HideAnnotationTray();
  EXPECT_FALSE(primary_display_tray->visible_preferred());
  EXPECT_FALSE(external_display_tray->visible_preferred());
}

TEST_F(ProjectorUiControllerTest, HideTrayWhenAnnotatorIsEnabled) {
  base::HistogramTester histogram_tester;

  auto* projector_annotation_tray = Shell::GetPrimaryRootWindowController()
                                        ->GetStatusAreaWidget()
                                        ->projector_annotation_tray();
  controller_->ShowAnnotationTray(Shell::GetPrimaryRootWindow());
  EXPECT_TRUE(projector_annotation_tray->visible_preferred());

  controller_->EnableAnnotatorTool();
  EXPECT_TRUE(controller_->is_annotator_enabled());

  controller_->HideAnnotationTray();
  EXPECT_FALSE(projector_annotation_tray->visible_preferred());
  EXPECT_FALSE(controller_->is_annotator_enabled());

  histogram_tester.ExpectUniqueSample(kProjectorToolbarHistogramName,
                                      ProjectorToolbar::kMarkerTool,
                                      /*count=*/1);
}

// Verifies that toggling on the marker on Projector tools enables the
// annotator.
TEST_F(ProjectorUiControllerTest, EnablingDisablingMarker) {
  base::HistogramTester histogram_tester;

  // Enable marker.
  controller_->EnableAnnotatorTool();
  EXPECT_TRUE(controller_->is_annotator_enabled());

  EXPECT_CALL(projector_client_, Clear());
  controller_->ResetTools();
  EXPECT_FALSE(controller_->is_annotator_enabled());

  histogram_tester.ExpectUniqueSample(kProjectorToolbarHistogramName,
                                      ProjectorToolbar::kMarkerTool,
                                      /*count=*/1);
}

TEST_F(ProjectorUiControllerTest, ToggleMarkerWithKeyboardShortcut) {
  controller_->ShowAnnotationTray(Shell::GetPrimaryRootWindow());
  controller_->OnCanvasInitialized(true);

  auto* event_generator = GetEventGenerator();
  event_generator->PressAndReleaseKey(ui::VKEY_OEM_3, ui::EF_COMMAND_DOWN);
  EXPECT_TRUE(controller_->is_annotator_enabled());

  event_generator->PressAndReleaseKey(ui::VKEY_OEM_3, ui::EF_COMMAND_DOWN);
  EXPECT_FALSE(controller_->is_annotator_enabled());
}

TEST_F(ProjectorUiControllerTest, SetAnnotatorTool) {
  auto* projector_annotation_tray = Shell::GetPrimaryRootWindowController()
                                        ->GetStatusAreaWidget()
                                        ->projector_annotation_tray();
  base::HistogramTester histogram_tester;
  AnnotatorTool tool;
  tool.color = kProjectorDefaultPenColor;
  EXPECT_CALL(projector_client_, SetTool(tool));

  // Assert that the initial pref is unset.
  PrefService* pref_service =
      Shell::Get()->session_controller()->GetActivePrefService();
  EXPECT_EQ(
      pref_service->GetUint64(prefs::kProjectorAnnotatorLastUsedMarkerColor),
      0u);

  controller_->ShowAnnotationTray(Shell::GetPrimaryRootWindow());
  controller_->OnCanvasInitialized(true);
  LeftClickOn(projector_annotation_tray);
  EXPECT_TRUE(controller_->is_annotator_enabled());

  controller_->HideAnnotationTray();
  EXPECT_FALSE(controller_->is_annotator_enabled());
  // Check that the last used color is stored in the pref.
  EXPECT_EQ(
      pref_service->GetUint64(prefs::kProjectorAnnotatorLastUsedMarkerColor),
      kProjectorDefaultPenColor);
  histogram_tester.ExpectUniqueSample(kProjectorMarkerColorHistogramName,
                                      ProjectorMarkerColor::kMagenta,
                                      /*count=*/1);
}

TEST_F(ProjectorUiControllerTest, ShowFailureNotification) {
  base::HistogramTester histogram_tester;

  MockMessageCenterObserver mock_message_center_observer;
  message_center::MessageCenter::Get()->AddObserver(
      &mock_message_center_observer);

  EXPECT_CALL(
      mock_message_center_observer,
      OnNotificationAdded(/*notification_id=*/"projector_error_notification"))
      .Times(2);
  EXPECT_CALL(mock_message_center_observer,
              OnNotificationDisplayed(
                  /*notification_id=*/"projector_error_notification",
                  message_center::DisplaySource::DISPLAY_SOURCE_POPUP));

  ProjectorUiController::ShowFailureNotification(
      IDS_ASH_PROJECTOR_SAVE_FAILURE_TEXT);

  EXPECT_CALL(
      mock_message_center_observer,
      OnNotificationRemoved(/*notification_id=*/"projector_error_notification",
                            /*by_user=*/false));

  ProjectorUiController::ShowFailureNotification(
      IDS_ASH_PROJECTOR_FAILURE_MESSAGE_TRANSCRIPTION);

  const message_center::NotificationList::Notifications& notifications =
      message_center::MessageCenter::Get()->GetVisibleNotifications();
  EXPECT_EQ(notifications.size(), 1u);
  EXPECT_EQ((*notifications.begin())->id(), "projector_error_notification");
  EXPECT_EQ((*notifications.begin())->message(),
            l10n_util::GetStringUTF16(
                IDS_ASH_PROJECTOR_FAILURE_MESSAGE_TRANSCRIPTION));

  histogram_tester.ExpectBucketCount(kProjectorCreationFlowErrorHistogramName,
                                     ProjectorCreationFlowError::kSaveError,
                                     /*count=*/1);
  histogram_tester.ExpectBucketCount(
      kProjectorCreationFlowErrorHistogramName,
      ProjectorCreationFlowError::kTranscriptionError,
      /*count=*/1);
  histogram_tester.ExpectTotalCount(kProjectorCreationFlowErrorHistogramName,
                                    /*count=*/2);
}

TEST_F(ProjectorUiControllerTest, ShowSaveFailureNotification) {
  base::HistogramTester histogram_tester;

  MockMessageCenterObserver mock_message_center_observer;
  message_center::MessageCenter::Get()->AddObserver(
      &mock_message_center_observer);

  EXPECT_CALL(mock_message_center_observer,
              OnNotificationAdded(
                  /*notification_id=*/"projector_save_error_notification"))
      .Times(2);
  EXPECT_CALL(mock_message_center_observer,
              OnNotificationDisplayed(
                  /*notification_id=*/"projector_save_error_notification",
                  message_center::DisplaySource::DISPLAY_SOURCE_POPUP));

  ProjectorUiController::ShowSaveFailureNotification();

  EXPECT_CALL(mock_message_center_observer,
              OnNotificationRemoved(
                  /*notification_id=*/"projector_save_error_notification",
                  /*by_user=*/false));

  ProjectorUiController::ShowSaveFailureNotification();

  const message_center::NotificationList::Notifications& notifications =
      message_center::MessageCenter::Get()->GetVisibleNotifications();
  EXPECT_EQ(notifications.size(), 1u);
  EXPECT_EQ((*notifications.begin())->id(),
            "projector_save_error_notification");
  EXPECT_EQ((*notifications.begin())->message(),
            l10n_util::GetStringUTF16(IDS_ASH_PROJECTOR_SAVE_FAILURE_TEXT));

  histogram_tester.ExpectUniqueSample(kProjectorCreationFlowErrorHistogramName,
                                      ProjectorCreationFlowError::kSaveError,
                                      /*count=*/2);
}

TEST_F(ProjectorUiControllerTest, OnCanvasInitialized) {
  auto* projector_annotation_tray = Shell::GetPrimaryRootWindowController()
                                        ->GetStatusAreaWidget()
                                        ->projector_annotation_tray();
  controller_->ShowAnnotationTray(Shell::GetPrimaryRootWindow());

  EXPECT_FALSE(projector_annotation_tray->GetEnabled());

  controller_->OnCanvasInitialized(/*success=*/true);
  EXPECT_TRUE(projector_annotation_tray->GetEnabled());

  controller_->OnCanvasInitialized(/*success=*/false);
  EXPECT_FALSE(projector_annotation_tray->GetEnabled());
}

}  // namespace ash


text:
description: How to enable and use push notifications for Guardian.
---

## Guardian Push Notifications

To enable Push Notifications for Guardian for your users, go to the [Multifactor Auth](${manage_url}/#/guardian) section of the Auth0 dashboard. Then toggle the **Push Notification** slider to enable it.

![](/media/articles/mfa/guardian-dashboard.png)

New users signing up will be prompted to download the Guardian app from either the App Store or Google Play. Once they indicate that they downloaded the app, a code will appear. They will have five minutes to scan the code with the app before it expires. After the code has been successfully scanned, users will see a confirmation screen which includes a recovery code. They need to have this recovery code to login without their mobile device. If they lose both the recovery code and their mobile device, you will need to [reset their MFA](#reset-an-mfa-for-a-user). Then they will receive a push notification to their device and they will be logged in.

Users that were previously registered before you enabled MFA will need to complete the same process as new users on their next login.


text:
import argparse

import pyalpm
from pycman import config

import os, shutil
import datetime

import pygit2

__version__ = '1.0.3'

"""
This module is a part of PacBackup. It backs up the package list along with a scipt
allowing easy recovery.
"""

def sanitize_path(path):
  return os.path.abspath(os.path.expanduser(path))

def pkg_info_str(pkg):
  return str(pkg.name)

class PacBackup:
  def __init__(self, options):
    self.handle = config.init_with_config_and_options(options)
    self.backup_file_path = sanitize_path(options.backup_config)
    self.container = os.path.abspath(os.path.join(self.backup_file_path, os.pardir))
    self.verbosity = options.verbose

  def retrieve_pkg_lists(self):
    available_pkgs = {}
    for db in self.handle.get_syncdbs():
      for pkg in db.pkgcache:
        available_pkgs[pkg.name] = db.name

    db = self.handle.get_localdb()

    self.pkg_lists = {}

    for pkg in db.pkgcache:
      if pkg.reason == pyalpm.PKG_REASON_EXPLICIT:
        try :
          if available_pkgs[pkg.name] not in self.pkg_lists:
            self.pkg_lists[available_pkgs[pkg.name]] = []
          self.pkg_lists[available_pkgs[pkg.name]].append(pkg)
        except KeyError:
          if "AUR" not in self.pkg_lists:
            self.pkg_lists["AUR"] = []
          self.pkg_lists["AUR"].append(pkg)

    if self.verbosity :
      for k in self.pkg_lists:
        print(k)
        for v in self.pkg_lists[k]:
          print("\t" + pkg_info_str(v))

  def prepare_backup_folder(self):
    print("Preparing backup folder : ", self.container)
    os.mkdir(self.container)
    pygit2.init_repository(self.container, False)

    # look for the restore script in the default install dir first
    try:
      shutil.copy2("/usr/share/pacbackup/pacrestore.sh", self.container)
    except FileNotFoundError:
      try:
        shutil.copy2(os.path.join(os.path.dirname(os.path.realpath(__file__)),
          "pacrestore.sh"), self.container)
      except FileNotFoundError:
        print("Couldn't find the restore script anywhere, try reinstalling", file=stderr)
        shutil.rmtree(self.container)
        exit()

    repo = pygit2.Repository(self.container)
    index = repo.index

    index.read()
    index.add_all()
    index.write()
    tree = index.write_tree()

    message = "Initial Commit - Automated Package List Backup"
    comitter = pygit2.Signature('PacBackup '+__version__, '')
    sha = repo.create_commit('HEAD',
      comitter, comitter, message,
      tree,
      [])

  def backup_pkg_lists(self):
    if not os.path.exists(self.container):
      self.prepare_backup_folder()

    with open(self.backup_file_path, 'w+') as backup:
      backup.write("# Generated by PacBackup "+__version__+"\n")
      for db in self.handle.get_syncdbs():
        backup.write("["+db.name+"]\n")
        for pkg in self.pkg_lists[db.name]:
          backup.write(pkg_info_str(pkg) + "\n")
        backup.write("\n")
        self.pkg_lists.pop(db.name, None)
      for k in self.pkg_lists:
        backup.write("["+k+"]\n")
        for pkg in self.pkg_lists[k]:
          backup.write(pkg_info_str(pkg) + "\n")
        backup.write("\n")

  def add_to_git(self):
    local_path = os.path.relpath(self.backup_file_path, self.container)
    repo = pygit2.Repository(self.container)
    st = repo.status()

    if st:
      index = repo.index
      index.read()
      index.add(local_path)

      index.write()
      tree = index.write_tree()

      today = datetime.date.today().strftime("%B %d, %Y")
      message = today + " - Automated Package List Backup"
      comitter = pygit2.Signature('PacBackup '+__version__, 'pacbackup@dummy.org')

      parents = [repo.head.get_object().hex]

      sha = repo.create_commit('refs/heads/master',
       comitter, comitter, message,
       tree,
       parents)
    else:
      print("No local changes to commit")

def main():
  parser = config.make_parser(description='Backs-up the list of pacman-installed packages on the system.',
    prog = 'pacbackup')

  group = parser.add_argument_group("Backup options")
  group.add_argument('--backup-config', metavar='<path>', default='~/.pacbackup/pkglist',
    help = "specifies the backup file location, default : ~/.pacbackup/pkglist")

  backup = PacBackup(parser.parse_args())
  print("Retriving current package list")
  backup.retrieve_pkg_lists()
  print("Backing package list up")
  backup.backup_pkg_lists()
  print("Committing the backup to the local git tree")
  backup.add_to_git()

if __name__ == '__main__':
  main()


text:
#pragma once

#include "texture1d.hpp"

namespace gli
{
	/// 1d array texture
	class texture1DArray : public texture
	{
	public:
		typedef ivec1 texelcoord_type;

	public:
		/// Create an empty texture 1D array
		texture1DArray();

		/// Create a texture1DArray and allocate a new storage
		explicit texture1DArray(
			format_type Format,
			texelcoord_type const & Dimensions,
			size_type Layers,
			size_type Levels);

		/// Create a texture1DArray and allocate a new storage with a complete mipmap chain
		explicit texture1DArray(
			format_type Format,
			texelcoord_type const & Dimensions,
			size_type Layers);

		/// Create a texture1DArray view with an existing storage
		explicit texture1DArray(
			texture const & Texture);

		/// Create a texture1DArray view with an existing storage
		explicit texture1DArray(
			texture const & Texture,
			format_type Format,
			size_type BaseLayer, size_type MaxLayer,
			size_type BaseFace, size_type MaxFace,
			size_type BaseLevel, size_type MaxLevel);

		/// Create a texture view, reference a subset of an exiting storage
		explicit texture1DArray(
			texture1DArray const & Texture,
			size_type BaseLayer, size_type MaxLayer,
			size_type BaseLevel, size_type MaxLevel);

		/// Create a view of the texture identified by Layer in the texture array
		texture1D operator[](size_type Layer) const;

		/// Return the width of a texture instance
		texelcoord_type dimensions(size_type Level = 0) const;

		/// Fetch a texel from a texture. The texture format must be uncompressed.
		template <typename genType>
		genType load(texelcoord_type const & TexelCoord, size_type Layer, size_type Level) const;

		/// Write a texel to a texture. The texture format must be uncompressed.
		template <typename genType>
		void store(texelcoord_type const & TexelCoord, size_type Layer, size_type Level, genType const & Texel);

		/// Clear the entire texture storage with zeros
		void clear();

		/// Clear the entire texture storage with Texel which type must match the texture storage format block size
		/// If the type of genType doesn't match the type of the texture format, no conversion is performed and the data will be reinterpreted as if is was of the texture format.
		template <typename genType>
		void clear(genType const & Texel);

		/// Clear a specific image of a texture.
		template <typename genType>
		void clear(size_type Layer, size_type Level, genType const & Texel);

	private:
		struct cache
		{
			std::uint8_t* Data;
			texelcoord_type Dim;
#			ifndef NDEBUG
				size_type Size;
#			endif
		};

		void build_cache();
		size_type index_cache(size_type Layer, size_type Level) const;

		std::vector<cache> Caches;
	};
}//namespace gli

#include "./core/texture1d_array.inl"


text:
namespace feature_engagement {

TEST(ConditionValidatorResultTest, TestAllOK) {
  EXPECT_TRUE(ConditionValidator::Result(true).NoErrors());
}

TEST(ConditionValidatorResultTest, TestAllErrors) {
  EXPECT_FALSE(ConditionValidator::Result(false).NoErrors());
}

TEST(ConditionValidatorResultTest, TestModelNotReady) {
  ConditionValidator::Result result(true);
  result.event_model_ready_ok = false;
  EXPECT_FALSE(result.NoErrors());
}

TEST(ConditionValidatorResultTest, TestCurrentlyShowing) {
  ConditionValidator::Result result(true);
  result.currently_showing_ok = false;
  EXPECT_FALSE(result.NoErrors());
}

TEST(ConditionValidatorResultTest, TestFeatureEnabled) {
  ConditionValidator::Result result(true);
  result.feature_enabled_ok = false;
  EXPECT_FALSE(result.NoErrors());
}

TEST(ConditionValidatorResultTest, TestInvalidConfig) {
  ConditionValidator::Result result(true);
  result.config_ok = false;
  EXPECT_FALSE(result.NoErrors());
}

TEST(ConditionValidatorResultTest, TestUsedFailed) {
  ConditionValidator::Result result(true);
  result.used_ok = false;
  EXPECT_FALSE(result.NoErrors());
}

TEST(ConditionValidatorResultTest, TestTriggerFailed) {
  ConditionValidator::Result result(true);
  result.trigger_ok = false;
  EXPECT_FALSE(result.NoErrors());
}

TEST(ConditionValidatorResultTest, TestPreconditionsFailed) {
  ConditionValidator::Result result(true);
  result.preconditions_ok = false;
  EXPECT_FALSE(result.NoErrors());
}

TEST(ConditionValidatorResultTest, TestSessionRateFailed) {
  ConditionValidator::Result result(true);
  result.session_rate_ok = false;
  EXPECT_FALSE(result.NoErrors());
}

TEST(ConditionValidatorResultTest, TestAvailabilityModelNotReady) {
  ConditionValidator::Result result(true);
  result.availability_model_ready_ok = false;
  EXPECT_FALSE(result.NoErrors());
}

TEST(ConditionValidatorResultTest, TestAvailabilityFailed) {
  ConditionValidator::Result result(true);
  result.availability_ok = false;
  EXPECT_FALSE(result.NoErrors());
}

TEST(ConditionValidatorResultTest, TestDisplayLockFailed) {
  ConditionValidator::Result result(true);
  result.display_lock_ok = false;
  EXPECT_FALSE(result.NoErrors());
}

TEST(ConditionValidatorResultTest, TestMultipleErrors) {
  ConditionValidator::Result result(true);
  result.preconditions_ok = false;
  result.session_rate_ok = false;
  EXPECT_FALSE(result.NoErrors());
}

}  // namespace feature_engagement


text:
<!-- the google_analytics_id gets auto inserted from the config file -->

{% if site.google_analytics %}

<!--Old Config
<script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create','{{site.google_analytics}}','auto');ga('require','displayfeatures');ga('send','pageview');</script>
-->

<!-- New config given by Chloe Jackson-->
<!-- Google Tag Manager -->
<script>
  function setGTM(w,d,s,l,i){ w[l]=w[l]||[]; w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'}); var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:''; j.async=true; j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); }
  if (document.cookie.indexOf('OptanonConsent') > -1 && document.cookie.indexOf('groups=') > -1) { setGTM(window,document,'script','dataLayer','GTM-N868W74'); } else{ waitForOnetrustActiveGroups(); } var timer; function waitForOnetrustActiveGroups() { if (document.cookie.indexOf('OptanonConsent') > -1 && document.cookie.indexOf('groups=') > -1) { clearTimeout(timer); setGTM(window,document,'script','dataLayer','GTM-N868W74'); } else{ timer=setTimeout(waitForOnetrustActiveGroups, 250); } }
</script>
<!-- New config end -->

{% endif %}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Telegram.Bot.Types;
using ChecklistBot.Services;

namespace ChecklistBot.Webhook.Controllers
{
    public class UpdateController : Controller
    {
        private readonly ChecklistBotService _checkListBot;
        private readonly BotConfig _botConfig;
        public UpdateController(ChecklistBotService checklistBot, BotConfig botConfig)
        {
            _botConfig = botConfig;
            _checkListBot = checklistBot;
        }
        // POST api/values
        [HttpPost]
        public void Update([FromBody] Update update)
        {
            _checkListBot.HandleUpdate(update);
        }
        [HttpGet]
        [Route("api/update/status")]
        public String Status()
        {
            return _checkListBot.GetStatus();
        }
    }
}


text:
NSString * const TMCacheTestName = @"TMCacheTest";
NSTimeInterval TMCacheTestBlockTimeout = 5.0;

@interface TMCacheTests ()
@property (strong, nonatomic) TMCache *cache;
@end

@implementation TMCacheTests

#pragma mark - SenTestCase -

- (void)setUp
{
    [super setUp];

    self.cache = [[TMCache alloc] initWithName:TMCacheTestName];

    STAssertNotNil(self.cache, @"test cache does not exist");
}

- (void)tearDown
{
    [self.cache removeAllObjects];

    self.cache = nil;

    STAssertNil(self.cache, @"test cache did not deallocate");

    [super tearDown];
}

#pragma mark - Private Methods

- (UIImage *)image
{
    static UIImage *image = nil;

    if (!image) {
        NSError *error = nil;
        NSURL *imageURL = [[NSBundle mainBundle] URLForResource:@"Default-568h@2x" withExtension:@"png"];
        NSData *imageData = [[NSData alloc] initWithContentsOfURL:imageURL
                                                          options:NSDataReadingUncached
                                                            error:&error];
        image = [[UIImage alloc] initWithData:imageData scale:2.f];
    }

    NSAssert(image, @"test image does not exist");

    return image;
}

- (dispatch_time_t)timeout
{
    return dispatch_time(DISPATCH_TIME_NOW, (int64_t)(TMCacheTestBlockTimeout * NSEC_PER_SEC));
}

#pragma mark - Tests -

- (void)testCoreProperties
{
    STAssertTrue([self.cache.name isEqualToString:TMCacheTestName], @"wrong name");
    STAssertNotNil(self.cache.memoryCache, @"memory cache does not exist");
    STAssertNotNil(self.cache.diskCache, @"disk cache doe not exist");
}

- (void)testDiskCacheURL
{
    BOOL isDir = NO;
    BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:[self.cache.diskCache.cacheURL path] isDirectory:&isDir];

    STAssertTrue(exists, @"disk cache directory does not exist");
    STAssertTrue(isDir, @"disk cache url is not a directory");
}

- (void)testObjectSet
{
    NSString *key = @"key";
    __block UIImage *image = nil;
    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

    [self.cache setObject:[self image] forKey:key block:^(TMCache *cache, NSString *key, id object) {
        image = (UIImage *)object;
        dispatch_semaphore_signal(semaphore);
    }];

    dispatch_semaphore_wait(semaphore, [self timeout]);

    STAssertNotNil(image, @"object was not set");
}

- (void)testObjectGet
{
    NSString *key = @"key";
    __block UIImage *image = nil;
    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

    [self.cache setObject:[self image] forKey:key];

    [self.cache objectForKey:key block:^(TMCache *cache, NSString *key, id object) {
        image = (UIImage *)object;
        dispatch_semaphore_signal(semaphore);
    }];

    dispatch_semaphore_wait(semaphore, [self timeout]);

    STAssertNotNil(image, @"object was not got");
}

- (void)testObjectRemove
{
    NSString *key = @"key";
    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

    [self.cache setObject:[self image] forKey:key];

    [self.cache removeObjectForKey:key block:^(TMCache *cache, NSString *key, id object) {
        dispatch_semaphore_signal(semaphore);
    }];

    dispatch_semaphore_wait(semaphore, [self timeout]);

    id object = [self.cache objectForKey:key];

    STAssertNil(object, @"object was not removed");
}

- (void)testMemoryCost
{
    NSString *key1 = @"key1";
    NSString *key2 = @"key2";

    [self.cache.memoryCache setObject:key1 forKey:key1 withCost:1];
    [self.cache.memoryCache setObject:key2 forKey:key2 withCost:2];

    STAssertTrue(self.cache.memoryCache.totalCost == 3, @"memory cache total cost was incorrect");

    [self.cache.memoryCache trimToCost:1];

    id object1 = [self.cache.memoryCache objectForKey:key1];
    id object2 = [self.cache.memoryCache objectForKey:key2];

    STAssertNotNil(object1, @"object did not survive memory cache trim to cost");
    STAssertNil(object2, @"object was not trimmed despite exceeding cost");
    STAssertTrue(self.cache.memoryCache.totalCost == 1, @"cache had an unexpected total cost");
}

- (void)testMemoryCostByDate
{
    NSString *key1 = @"key1";
    NSString *key2 = @"key2";

    [self.cache.memoryCache setObject:key1 forKey:key1 withCost:1];
    [self.cache.memoryCache setObject:key2 forKey:key2 withCost:2];

    [self.cache.memoryCache trimToCostByDate:1];

    id object1 = [self.cache.memoryCache objectForKey:key1];
    id object2 = [self.cache.memoryCache objectForKey:key2];

    STAssertNil(object1, @"object was not trimmed despite exceeding cost");
    STAssertNil(object2, @"object was not trimmed despite exceeding cost");
    STAssertTrue(self.cache.memoryCache.totalCost == 0, @"cache had an unexpected total cost");
}

- (void)testDiskByteCount
{
    [self.cache setObject:[self image] forKey:@"image"];

    STAssertTrue(self.cache.diskByteCount > 0, @"disk cache byte count was not greater than zero");
}

- (void)testOneThousandAndOneWrites
{
    NSUInteger max = 1001;
    __block NSInteger count = max;

    dispatch_queue_t queue = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL);
    dispatch_group_t group = dispatch_group_create();

    for (NSUInteger i = 0; i < max; i++) {
        NSString *key = [[NSString alloc] initWithFormat:@"key %d", i];
        NSString *obj = [[NSString alloc] initWithFormat:@"obj %d", i];

        [self.cache setObject:obj forKey:key block:nil];

        dispatch_group_enter(group);
    }

    for (NSUInteger i = 0; i < max; i++) {
        NSString *key = [[NSString alloc] initWithFormat:@"key %d", i];

        [self.cache objectForKey:key block:^(TMCache *cache, NSString *key, id object) {
            dispatch_async(queue, ^{
                count -= 1;
                dispatch_group_leave(group);
            });
        }];
    }

    dispatch_group_wait(group, [self timeout]);

    STAssertTrue(count == 0, @"one or more object blocks failed to execute, possible queue deadlock");
}

- (void)testMemoryWarningBlock
{
    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

    __block BOOL blockDidExecute = NO;

    self.cache.memoryCache.didReceiveMemoryWarningBlock = ^(TMMemoryCache *cache) {
        blockDidExecute = YES;
        dispatch_semaphore_signal(semaphore);
    };

    [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidReceiveMemoryWarningNotification
                                                        object:[UIApplication sharedApplication]];

    dispatch_semaphore_wait(semaphore, [self timeout]);

    STAssertTrue(blockDidExecute, @"memory warning block did not execute");
}

- (void)testBackgroundBlock
{
    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

    __block BOOL blockDidExecute = NO;

    self.cache.memoryCache.didEnterBackgroundBlock = ^(TMMemoryCache *cache) {
        blockDidExecute = YES;
        dispatch_semaphore_signal(semaphore);
    };

    [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidEnterBackgroundNotification
                                                        object:[UIApplication sharedApplication]];

    dispatch_semaphore_wait(semaphore, [self timeout]);

    STAssertTrue(blockDidExecute, @"app background block did not execute");
}

- (void)testMemoryWarningProperty
{
    [self.cache.memoryCache setObject:@"object" forKey:@"object" block:nil];

    self.cache.memoryCache.removeAllObjectsOnMemoryWarning = NO;

    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

    __block id object = nil;

    self.cache.memoryCache.didReceiveMemoryWarningBlock = ^(TMMemoryCache *cache) {
        object = [cache objectForKey:@"object"];
        dispatch_semaphore_signal(semaphore);
    };

    [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidReceiveMemoryWarningNotification
                                                        object:[UIApplication sharedApplication]];

    dispatch_semaphore_wait(semaphore, [self timeout]);

    STAssertNotNil(object, @"object was removed from the cache");
}

- (void)testMemoryCacheEnumerationWithWarning
{
    NSUInteger objectCount = 3;

    dispatch_apply(objectCount, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(size_t index) {
        NSString *key = [[NSString alloc] initWithFormat:@"key %zd", index];
        NSString *obj = [[NSString alloc] initWithFormat:@"obj %zd", index];
        [self.cache.memoryCache setObject:obj forKey:key block:nil];
    });

    self.cache.memoryCache.removeAllObjectsOnMemoryWarning = NO;

    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

    __block NSUInteger enumCount = 0;

    self.cache.memoryCache.didReceiveMemoryWarningBlock = ^(TMMemoryCache *cache) {
        [cache enumerateObjectsWithBlock:^(TMMemoryCache *cache, NSString *key, id object) {
            enumCount++;
        } completionBlock:^(TMMemoryCache *cache) {
            dispatch_semaphore_signal(semaphore);
        }];
    };

    [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidReceiveMemoryWarningNotification
                                                        object:[UIApplication sharedApplication]];

    dispatch_semaphore_wait(semaphore, [self timeout]);

    STAssertTrue(objectCount == enumCount, @"some objects were not enumerated");
}

- (void)testDiskCacheEnumeration
{
    NSUInteger objectCount = 3;

    dispatch_apply(objectCount, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(size_t index) {
        NSString *key = [[NSString alloc] initWithFormat:@"key %zd", index];
        NSString *obj = [[NSString alloc] initWithFormat:@"obj %zd", index];
        [self.cache.diskCache setObject:obj forKey:key block:nil];
    });

    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

    __block NSUInteger enumCount = 0;

    [self.cache.diskCache enumerateObjectsWithBlock:^(TMDiskCache *cache, NSString *key, id <NSCoding> object, NSURL *fileURL) {
        enumCount++;
    } completionBlock:^(TMDiskCache *cache) {
        dispatch_semaphore_signal(semaphore);
    }];

    [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidReceiveMemoryWarningNotification
                                                        object:[UIApplication sharedApplication]];

    dispatch_semaphore_wait(semaphore, [self timeout]);

    STAssertTrue(objectCount == enumCount, @"some objects were not enumerated");
}

- (void)testMemoryCacheObjectLifetimeExpiration
{
    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

    dispatch_queue_t queue = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL);

    dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue);

    dispatch_source_set_timer(timer, DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC), 0);

    __block int secondPassed = -1;
    dispatch_source_set_event_handler(timer, ^{
        secondPassed ++;
        NSLog(@"second passed: %ld", secondPassed);

        NSLog(@"key1 : %@", [self.cache.memoryCache objectForKey:@"key1"]);
        NSLog(@"key2 : %@", [self.cache.memoryCache objectForKey:@"key2"]);

        if(secondPassed == 0){
            STAssertTrue([self.cache.memoryCache objectForKey:@"key1"] != nil, @"object related to key1 is unexpected expired");
            STAssertTrue([self.cache.memoryCache objectForKey:@"key2"] != nil, @"object related to key2 is unexpected expired");
        }
        else if(secondPassed == 1){
            STAssertTrue([self.cache.memoryCache objectForKey:@"key1"] == nil, @"object related to key1 should be expired");
            STAssertTrue([self.cache.memoryCache objectForKey:@"key2"] != nil, @"object related to key2 is unexpected expired");
        }
        else if(secondPassed == 2){
            STAssertTrue([self.cache.memoryCache objectForKey:@"key1"] == nil, @"object related to key1 should be expired");
            STAssertTrue([self.cache.memoryCache objectForKey:@"key2"] == nil, @"object related to key2 should be expired");
            dispatch_semaphore_signal(semaphore);
        }
    });

    [self.cache.memoryCache setObject:@"obj1" forKey:@"key1" withCost:0 lifetime:1];
    [self.cache.memoryCache setObject:@"obj2" forKey:@"key2" withCost:0 lifetime:2];

    dispatch_resume(timer);

    dispatch_semaphore_wait(semaphore, [self timeout]);
}

- (void)testMemoryCacheObjectLifetimeActiveExpiration
{
    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

    dispatch_queue_t queue = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL);

    dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue);

    dispatch_source_set_timer(timer, DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC), 0);

    __block int secondPassed = -1;
    dispatch_source_set_event_handler(timer, ^{
        secondPassed ++;
        //NSLog(@"second passed: %ld", secondPassed);

        //NSLog(@"key1 : %@", [self.cache.memoryCache objectForKey:@"key1"]);
        //NSLog(@"cache total cost : %d", self.cache.memoryCache.totalCost);

        if(secondPassed == 0){
            STAssertTrue(self.cache.memoryCache.totalCost == 100, @"No objects should be expired now");
        }
        else if(secondPassed == 2){
            STAssertTrue(self.cache.memoryCache.totalCost == 90, @"10 objects should be expired now");
            dispatch_semaphore_signal(semaphore);
        }
        else if(secondPassed == 10){
            STAssertTrue(self.cache.memoryCache.totalCost == 60, @"All objects should be expired now");
            dispatch_semaphore_signal(semaphore);
        }
    });

    int objectCount = 100;
    for(int i=0;i< objectCount; i++){
        NSString *key = [[NSString alloc] initWithFormat:@"key%d", i];
        NSString *obj = [[NSString alloc] initWithFormat:@"obj%d", i];
        [self.cache.memoryCache setObject:obj forKey:key withCost:1 lifetime:i / 10];
    }

    dispatch_resume(timer);

    dispatch_semaphore_wait(semaphore, [self timeout]);
}

@end


text:
using System.Threading.Tasks;
using DocaLabs.Http.Client.Binding.Serialization;

namespace DocaLabs.Http.Client.Remote.Integration.Tests._Contract._Post
{
    [SerializeAsJson]
    public interface IPostData
    {
        PostDataResponse Post(PostDataRequest data);
    }

    [SerializeAsJson]
    public interface IPostDataAsync
    {
        Task<PostDataResponse> Post(PostDataRequest data);
    }
}