text:
define([
	"dojo/_base/declare", "dojo/_base/lang", "dojo/_base/Deferred",
	"dojo/request", "dojo/when", "dojo/Stateful", "dojo/topic", "dojo/promise/all",
	"dojo/store/Memory", "dojo/store/util/QueryResults",
	"./HeatmapDataTypes"
], function(declare, lang, Deferred,
			request, when, Stateful, Topic, All,
			Memory, QueryResults){

	var pmState = {
		heatmapAxis: 'Transposed',
		genomeIds: [],
		genomeFilterStatus: {},
		clusterRowOrder: [],
		clusterColumnOrder: []
	};

	return declare([Memory, Stateful], {
		baseQuery: {},
		apiServer: window.App.dataServiceURL,
		idProperty: "ec_number",
		state: null,
		pmState: pmState,

		constructor: function(options){
			this._loaded = false;
			if(options.apiServer){
				this.apiServer = options.apiServer;
			}

			var self = this;

			Topic.subscribe("PathwayMap", function(){
				// console.log("PathwayMapMemStore received:", arguments);
				var key = arguments[0], value = arguments[1];

				switch(key){
					case "requestHeatmapData":
						// console.log("requestHeatmapData with ", value.genomeIds);
						self.currentData = self.getHeatmapData(value);
						Topic.publish("PathwayMap", "updateHeatmapData", self.currentData);
						break;
					default:
						break;
				}
			});
		},

		reload: function(){
			var self = this;
			delete self._loadingDeferred;
			self._loaded = false;
			self.loadData();
			self.set("refresh");
		},

		query: function(query, opts){
			query = query || {};
			if(this._loaded){
				return this.inherited(arguments);
			}
			else{
				var _self = this;
				var results;
				var qr = QueryResults(when(this.loadData(), function(){
					results = _self.query(query, opts);
					qr.total = when(results, function(results){
						return results.total || results.length
					});
					return results;
				}));

				return qr;
			}
		},

		get: function(id, opts){
			if(this._loaded){
				return this.inherited(arguments);
			}else{
				var _self = this;
				return when(this.loadData(), function(){
					return _self.get(id, options)
				})
			}
		},

		loadData: function(){
			if(this._loadingDeferred){
				return this._loadingDeferred;
			}

			var _self = this;

			// console.warn(this.state, this.state.genome_ids, !this.state.genome_ids);
			if(!this.state.genome_ids){
				// console.log("No Genome IDS, use empty data set for initial store");

				//this is done as a deferred instead of returning an empty array
				//in order to make it happen on the next tick.  Otherwise it
				//in the query() function above, the callback happens before qr exists
				var def = new Deferred();
				setTimeout(lang.hitch(_self, function(){
					this.setData([]);
					this._loaded = true;
					// def.resolve(true);
				}), 0);
				return def.promise;
			}

			(this.state.pathway_id) ? _self.pmState.pathway_id = this.state.pathway_id : {};
			(this.state.ec_number) ? _self.pmState.ec_number = this.state.ec_number : {};
			(this.state.feature_id) ? _self.pmState.feature_id = this.state.feature_id : {};
			(this.state.taxon_id) ? _self.pmState.taxon_id = this.state.taxon_id : {};
			(this.state.annotation) ? _self.pmState.annotation = this.state.annotation : {};

			this._loadingDeferred = when(request.post(_self.apiServer + '/genome/', {
				handleAs: 'json',
				headers: {
					'Accept': "application/json",
					'Content-Type': "application/solrquery+x-www-form-urlencoded",
					'X-Requested-With': null,
					'Authorization': _self.token ? _self.token : (window.App.authorizationToken || "")
				},
				data: {
					q: "genome_id:(" + _self.state.genome_ids.join(" OR ") + ")",
					rows: _self.state.genome_ids.length,
					sort: "genome_name asc"
				}
			}), function(genomes){

				genomes.forEach(function(genome, idx){
					var gfs = new FilterStatus();
					gfs.init(idx, genome.genome_name);
					_self.pmState.genomeFilterStatus[genome.genome_id] = gfs;
					// _self.pmState.genomeIds.push(genome.genome_id);
				});
				_self.pmState.genomeIds = Object.keys(_self.pmState.genomeFilterStatus);
				// publish pmState & update filter panel
				Topic.publish("PathwayMap", "updatePmState", _self.pmState);

				// sub query - genome distribution
				var query = {
					q: "genome_id:(" + _self.pmState.genomeIds.join(' OR ') + ") AND pathway_id:" + _self.pmState.pathway_id,
					fq: "annotation:" + _self.pmState.annotation,
					rows: 0,
					facet: true,
					'json.facet': '{stat:{type:field,field:ec_number,limit:-1,sort:{index:asc},facet:{families:{type:field,field:genome_id,limit:-1}}}}'
				};

				var q = Object.keys(query).map(function(p){
					return p + "=" + query[p]
				}).join("&");

				return when(request.post(_self.apiServer + '/pathway/', {
					handleAs: 'json',
					headers: {
						'Accept': "application/solr+json",
						'Content-Type': "application/solrquery+x-www-form-urlencoded",
						'X-Requested-With': null,
						'Authorization': _self.token ? _self.token : (window.App.authorizationToken || "")
					},
					data: q
				}), function(response){

					var ecGenomeDist = response.facets.stat.buckets;
					var ecNumbers = [];

					ecGenomeDist.forEach(function(el){
						if(el.val != ""){
							ecNumbers.push(el.val);
						}
					});

					// var ecGenomeCount = {};
					var ecGenomeIdCountMap = {};
					var ecGenomeIdSet = {};
					var genomePosMap = {};
					var genome_ids = _self.pmState.genomeIds;
					genome_ids.forEach(function(genomeId, idx){
						genomePosMap[genomeId] = idx;
					});

					ecGenomeDist.forEach(function(el){
						var ec = el.val;
						var buckets = el.families.buckets;

						buckets.forEach(function(bucket){
							var genomeId = bucket.val;

							var genomeCount = bucket.count.toString(16);
							if(genomeCount.length < 2) genomeCount = '0' + genomeCount;

							if(ec in ecGenomeIdCountMap){
								ecGenomeIdCountMap[ec][genomePosMap[genomeId]] = genomeCount;
							}
							else{
								var genomeIdCount = new Array(genome_ids.length).fill('00');
								genomeIdCount[genomePosMap[genomeId]] = genomeCount;
								ecGenomeIdCountMap[ec] = genomeIdCount;
							}

							if(ec in ecGenomeIdSet){
								ecGenomeIdSet[ec].push(genomeId);
							}
							else{
								var genomeIds = [];
								genomeIds.push(genomeId);
								ecGenomeIdSet[ec] = genomeIds;
							}
						});
					});

					return when(request.post(_self.apiServer + '/pathway_ref/', {
						handleAs: 'json',
						headers: {
							'Accept': "application/json",
							'Content-Type': "application/solrquery+x-www-form-urlencoded",
							'X-Requested-With': null,
							'Authorization': _self.token ? _self.token : (window.App.authorizationToken || "")
						},
						data: {
							q: 'pathway_id:' + _self.pmState.pathway_id + ' AND ec_number:(' + ecNumbers.join(' OR ') + ')',
							fl: 'ec_number,ec_description,occurrence',
							sort: 'ec_number asc',
							rows: ecNumbers.length
						}
					}), function(res){

						var ecRefHash = {};
						var ecOccurrenceHash = {};
						res.forEach(function(el){
							ecRefHash[el['ec_number']] = el['ec_description'];
							ecOccurrenceHash[el['ec_number']] = el['occurrence'];
						});

						var data = [];
						ecGenomeDist.forEach(function(element){
							var ec = element.val;
							if(ec != ""){
								var featureCount = element.count;

								var row = {
									ec_number: ec,
									feature_count: featureCount,
									genome_count: ecGenomeIdSet[ec].length,
									genome_missing: (genome_ids.length - ecGenomeIdSet[ec].length),
									description: ecRefHash[ec],
									occurrence: ecOccurrenceHash[ec],
									genomes: ecGenomeIdCountMap[ec].join("")
								};
								data.push(row);
							}
						});
						// console.log(data);

						_self.setData(data);
						_self._loaded = true;
						// Topic.publish("PathwayMap", "hideLoadingMask");
						return true;
					})
				});
			});
			return this._loadingDeferred;
		},

		getHeatmapData: function(pmState){

			var rows = [];
			var cols = [];
			var maxIntensity = 0; // global and will be modified inside createColumn function
			var keeps = []; // global and will be referenced inside createColumn function
			var colorStop = [];

			var isTransposed = (pmState.heatmapAxis === 'Transposed');
			// var start = window.performance.now();

			// assumes axises are corrected
			var familyOrder = pmState.clusterColumnOrder;
			var genomeOrder = pmState.clusterRowOrder;

			var createColumn = function(order, colId, label, distribution, meta){
				// this reads global variable keeps, and update global variable maxIntensity
				var filtered = [], isEven = (order % 2) === 0;

				keeps.forEach(function(idx, i){ // idx is a start position of distribution. 2 * gfs.getIndex();
					filtered[i] = distribution.substr(idx, 2);
					var val = parseInt(filtered[i], 16);

					if(maxIntensity < val){
						maxIntensity = val;
					}
				});

				return new Column(order, colId, label, filtered.join(''),
					((isEven) ? 0x000066 : null) /* label color */,
					((isEven) ? 0xF4F4F4 : 0xd6e4f4) /*bg color */,
					meta);
			};

			// rows - genomes
			// if genome order is changed, then needs to or-organize distribution in columns.
			var genomeOrderChangeMap = [];

			if(genomeOrder !== [] && genomeOrder.length > 0){
				pmState.genomeIds = genomeOrder;
				genomeOrder.forEach(function(genomeId, idx){
					// console.log(genomeId, pmState.genomeFilterStatus[genomeId], idx);
					genomeOrderChangeMap.push(pmState.genomeFilterStatus[genomeId].getIndex()); // keep the original position
					pmState.genomeFilterStatus[genomeId].setIndex(idx);
				});
			}

			pmState.genomeIds.forEach(function(genomeId, idx){
				var gfs = pmState.genomeFilterStatus[genomeId];
				if(gfs.getStatus() != '1'){
					keeps.push(2 * gfs.getIndex());
					var labelColor = ((idx % 2) == 0) ? 0x000066 : null;
					var rowColor = ((idx % 2) == 0) ? 0xF4F4F4 : 0xd6e4f4;

					//console.log("row: ", gfs.getIndex(), genomeId, gfs.getGenomeName(), labelColor, rowColor);
					rows.push(new Row(gfs.getIndex(), genomeId, gfs.getLabel(), labelColor, rowColor));
				}
			});

			// cols - families
			//console.warn(this);
			var opts = {};
			if(this.sort && this.sort.length > 0){
				opts.sort = this.sort;
			}
			var data = this.query("", opts);

			var familyOrderMap = {};
			if(familyOrder !== [] && familyOrder.length > 0){
				familyOrder.forEach(function(familyId, idx){
					familyOrderMap[familyId] = idx;
				});
			}else{
				data.forEach(function(family, idx){
					familyOrderMap[family.ec_number] = idx;
				})
			}

			data.forEach(function(family){
				var meta = {
					'instances': family.feature_count,
					'members': family.genome_count
				};
				if(genomeOrderChangeMap.length > 0){
					family.genomes = distributionTransformer(family.genomes, genomeOrderChangeMap);
				}
				var order = familyOrderMap[family.ec_number];
				cols[order] = createColumn(order, family.ec_number, family.ec_number + ' - ' + family.description, family.genomes, meta);
			});

			// colorStop
			if(maxIntensity == 1){
				colorStop = [new ColorStop(1, 0xfadb4e)];
			}else if(maxIntensity == 2){
				colorStop = [new ColorStop(0.5, 0xfadb4e), new ColorStop(1, 0xf6b437)];
			}else if(maxIntensity >= 3){
				colorStop = [new ColorStop(1 / maxIntensity, 0xfadb4e), new ColorStop(2 / maxIntensity, 0xf6b437), new ColorStop(3 / maxIntensity, 0xff6633), new ColorStop(maxIntensity / maxIntensity, 0xff6633)];
			}

			//console.log(rows, cols, colorStop);

			var currentData = {
				'rows': rows,
				'columns': cols,
				'colorStops': colorStop,
				'rowLabel': 'Genomes',
				'colLabel': 'Protein Families',
				'rowTrunc': 'mid',
				'colTrunc': 'end',
				'offset': 1,
				'digits': 2,
				'countLabel': 'Members',
				'negativeBit': false,
				'cellLabelField': '',
				'cellLabelsOverrideCount': false,
				'beforeCellLabel': '',
				'afterCellLabel': ''
			};

			if(isTransposed){

				var flippedDistribution = []; // new Array(currentData.rows.length);
				currentData.rows.forEach(function(row, rowIdx){
					var distribution = [];
					currentData.columns.forEach(function(col){
						distribution.push(col.distribution.substr(rowIdx * 2, 2));
					});
					flippedDistribution[rowIdx] = distribution.join("");
				});

				// create new rows
				var newRows = [];
				currentData.columns.forEach(function(col, colID){
					newRows.push(new Row(colID, col.colID, col.colLabel, col.labelColor, col.bgColor, col.meta));
				});
				// create new columns
				var newColumns = [];
				currentData.rows.forEach(function(row, rowID){
					newColumns.push(new Column(rowID, row.rowID, row.rowLabel, flippedDistribution[rowID], row.labelColor, row.bgColor, row.meta))
				});

				currentData = lang.mixin(currentData, {
					'rows': newRows,
					'columns': newColumns,
					'rowLabel': 'Protein Families',
					'colLabel': 'Genomes',
					'rowTrunc': 'end',
					'colTrunc': 'mid'
				});
			}

			// var end = window.performance.now();
			// console.log('getHeatmapData() took: ', (end - start), "ms");

			return currentData;
		}
	});
});


text:
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace CustomControlResources.Converter
{
    public class EqualiencyConverter : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (values == null || values.Length < 1 || values[0] == null) return false;
            bool isEqual;
            if (values.Length == 1 && parameter != null)
                isEqual = values[0].ToString() == parameter.ToString();
            else
                isEqual = values[0].Equals(values[1]);
            return isEqual;
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

    //public class SubtractionEquationConverter : IMultiValueConverter
    //{
    //    public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    //    {
    //        if (values == null || values.Length != 2 || parameter == null) return false;
    //        int val;
    //        int.TryParse(parameter.ToString(), out val);
    //        if (values[0] is int && values[1] is int)
    //            return ((int)values[0]) - ((int)values[1]) == (int)parameter;
    //        return false;
    //    }

    //    public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
    //    {
    //        throw new NotImplementedException();
    //    }
    //}
}

redpajama_set_name: RedPajamaGithub


text:
package com.r_mades.todolist.data;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

/**
 * Info about this file here.
 * Project: ToDoList
 * Created: veloc1
 * Date: 8/8/16
 */
@DatabaseTable
public class TaskItem {

    @DatabaseField(generatedId = true)
    public int     id;
    @DatabaseField
    public String  title;
    @DatabaseField
    public int done;

}

/*
public class TaskItem {

    public int     id;
    public String  title;
    public int done;

}*/


text:
class AddCitingPaperId < ActiveRecord::Migration
  def change
    add_index(:citation_groups, :citing_paper_id)
  end
end


text:
template: example.html
title: Animation example
shortdesc: Demonstrates animated pan, zoom, and rotation.
docs: >
  This example shows how to use the beforeRender function on the Map to run one
  or more animations.
tags: "animation"
---

    <button id="rotate-left" title="Rotate clockwise">↻</button>
    <button id="rotate-right" title="Rotate counterclockwise">↺</button>
    <button id="rotate-around-rome">Rotate around Rome</button>
    <button id="pan-to-london">Pan to London</button>
    <button id="elastic-to-moscow">Elastic to Moscow</button>
    <button id="bounce-to-istanbul">Bounce to Istanbul</button>
    <button id="spin-to-rome">Spin to Rome</button>
    <button id="fly-to-bern">Fly to Bern</button>
    <button id="spiral-to-madrid">Spiral to Madrid</button>


text:
require 'finacle_api/common/serializable_object'
module FinacleApi
  module LoanAcctInq
    module ResponseEntity
      class AcctType < SerializableObject
        attr_accessor :schm_code, :schm_type

      end
    end
  end
end


text:
package it.unibz.inf.ontop.identifiers;

import it.unibz.inf.ontop.io.ModelIOManager;
import it.unibz.inf.ontop.model.OBDADataFactory;
import it.unibz.inf.ontop.model.OBDAModel;
import it.unibz.inf.ontop.model.impl.OBDADataFactoryImpl;
import it.unibz.inf.ontop.owlrefplatform.core.QuestConstants;
import it.unibz.inf.ontop.owlrefplatform.core.QuestPreferences;
import it.unibz.inf.ontop.owlrefplatform.owlapi.*;
import junit.framework.TestCase;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.OWLIndividual;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.OWLOntologyManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;

/***
 * Tests that oracle identifiers for tables and columns are treated
 * correctly. Especially, that the unquoted identifers are treated as uppercase, and
 * that the case of quoted identifiers is not changed
 */
public class PostgresIdentifierTest extends TestCase {

	private OBDADataFactory fac;
	private QuestOWLConnection conn;

	Logger log = LoggerFactory.getLogger(this.getClass());
	private OBDAModel obdaModel;
	private OWLOntology ontology;

	final String owlfile = "resources/identifiers/identifiers.owl";
	final String obdafile = "resources/identifiers/identifiers-postgres.obda";
	private QuestOWL reasoner;

	@Override
	public void setUp() throws Exception {

		// Loading the OWL file
		OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
		ontology = manager.loadOntologyFromOntologyDocument((new File(owlfile)));

		// Loading the OBDA data
		fac = OBDADataFactoryImpl.getInstance();
		obdaModel = fac.getOBDAModel();

		ModelIOManager ioManager = new ModelIOManager(obdaModel);
		ioManager.load(obdafile);

		QuestPreferences p = new QuestPreferences();
		p.setCurrentValueOf(QuestPreferences.ABOX_MODE, QuestConstants.VIRTUAL);
		p.setCurrentValueOf(QuestPreferences.OBTAIN_FULL_METADATA, QuestConstants.FALSE);
		// Creating a new instance of the reasoner
        QuestOWLFactory factory = new QuestOWLFactory();
        QuestOWLConfiguration config = QuestOWLConfiguration.builder().obdaModel(obdaModel).preferences(p).build();
        reasoner = factory.createReasoner(ontology, config);

		// Now we are ready for querying
		conn = reasoner.getConnection();

	}

	public void tearDown() throws Exception{
		conn.close();
		reasoner.dispose();
	}

	private String runTests(String query) throws Exception {
		QuestOWLStatement st = conn.createStatement();
		String retval;
		try {
			QuestOWLResultSet rs = st.executeTuple(query);
			assertTrue(rs.nextRow());
			OWLIndividual ind1 =	rs.getOWLIndividual("x")	 ;
			retval = ind1.toString();
		} catch (Exception e) {
			throw e;
		} finally {
			try {

			} catch (Exception e) {
				st.close();
				assertTrue(false);
			}
			conn.close();
			reasoner.dispose();
		}
		return retval;
	}

	/**
	 * Test use of quoted mixed case table name
	 * @throws Exception
	 */
	public void testLowercaseUnquoted() throws Exception {
		String query = "PREFIX : <http://www.semanticweb.org/ontologies/2013/7/untitled-ontology-150#> SELECT ?x WHERE {?x a :Country} ORDER BY ?x";
		String val = runTests(query);
		assertEquals("<http://www.semanticweb.org/ontologies/2013/7/untitled-ontology-150#Country-a>", val);
	}

	public void testUppercaseAlias() throws Exception {
		String query = "PREFIX : <http://www.semanticweb.org/ontologies/2013/7/untitled-ontology-150#> SELECT ?x WHERE {?x a :Country4} ORDER BY ?x";
		String val = runTests(query);
		assertEquals("<http://www.semanticweb.org/ontologies/2013/7/untitled-ontology-150#Country4-a>", val);
	}

	/**
	 * Tests use of quoted uppercase alias in view definition (unsupported sql function in mapping source)
	 * @throws Exception
	 */
	public void testUppercaseUnquotedView() throws Exception {
		String query = "PREFIX : <http://www.semanticweb.org/ontologies/2013/7/untitled-ontology-150#> SELECT ?x WHERE {?x a :Country2} ORDER BY ?x";
		String val = runTests(query);
		assertEquals("<http://www.semanticweb.org/ontologies/2013/7/untitled-ontology-150#Country2-a>", val);
	}

	/**
	 * Tests use of quoted uppercase alias in view definition (unsupported sql function in mapping source)
	 * @throws Exception
	 */
	public void testUppercaseQuotedView() throws Exception {
		String query = "PREFIX : <http://www.semanticweb.org/ontologies/2013/7/untitled-ontology-150#> SELECT ?x WHERE {?x a :Country3} ORDER BY ?x";
		String val = runTests(query);
		assertEquals("<http://www.semanticweb.org/ontologies/2013/7/untitled-ontology-150#Country3-a>", val);
	}

}


text:
Project website of the Ringo web framework.

This website is based on [Freelancer](http://startbootstrap.com/template-overviews/freelancer/).


text:
export declare class Cidr {
    constructor(x: string, y?: string);
    isInCIDR(x: any): boolean;
}

export declare class Valve {
    constructor(schema: IValveSchema, baton?: any);
    setSchema(schema: IValveSchema): Valve;
    addFinalValidator(func: (obj: any, callback: (err: Error, cleaned: any) => void) => void): Valve;
    addChainValidator(name: string, description: string, func: (value: any, callback: (err: Error, cleaned: any) => void) => void): void;
    check(obj: any, options: ICheckOptions, callback: (err: any, cleaned: any) => void): void;
    check(obj: any, callback: (err: any, cleaned: any) => void): void;
    checkUpdate(existing: any, obj: any, callback: (err: any, cleaned: any) => void): void;
    help(schema: IValveSchema): any;
}

export interface ICheckOptions {
    strict?: boolean;
}

export interface IValveSchema {
    [index: string]: IValveSchemaMember;
}

export interface IValveSchemaMember { }

export interface IValveSchemaMemberArray extends IValveSchemaMember {
    [index: string]: IValveSchemaMember;
}

export declare function Chain(): IChain;

export declare function chain(): IChain;

export interface IChain extends IValveSchemaMember {
    getValidatorPos(name: string): number;
    hasValidator(name: string): number;
    getValidatorAtPos(pos: number): IValidator;
    isUnique(): IChain;
    toUnique(): IChain;
    notIPBlacklisted(): IChain;
    isCIDR(): IChain;
    isEmail(): IChain;
    isUrl(): IChain;
    isAddressPair(): IChain;
    isIP(): IChain;
    isIPv4(): IChain;
    isIPv6(): IChain;
    isHostnameOrIp(): IChain;
    isAllowedFQDNOrIP(blacklist?: string[]): IChain;
    isHostname(): IChain;
    isAlpha(): IChain;
    isAlphanumeric(): IChain;
    isNumeric(): IChain;
    isInt(): IChain;
    isLowercase(): IChain;
    isUppercase(): IChain;
    isDecimal(): IChain;
    isFloat(): IChain;
    notNull(): IChain;
    isNull(): IChain;
    notEmpty(): IChain;
    equals(arg: any): IChain;
    contains(arg: any): IChain;
    notContains(arg: any): IChain;
    notIn(values: any[], caseSensitive?: boolean): IChain;
    regex(pattern: RegExp): IChain;
    regex(pattern: string, modifiers?: string): IChain;
    is(pattern: string, modifiers?: string): IChain;
    notRegex(pattern: RegExp): IChain;
    notRegex(pattern: string, modifiers?: string): IChain;
    not(pattern: string, modifiers: string): IChain;
    len(min: number, max?: number): IChain;
    numItems(min: number, max: number): IChain;
    toFloat(): IChain;
    toInt(): IChain;
    toBoolean(): IChain;
    toBooleanStrict(): IChain;
    entityDecode(): IChain;
    entityEncode(): IChain;
    trim(chars?: string): IChain;
    ltrim(chars?: string): IChain;
    rtrim(chars: string): IChain;
    ifNull(replace: string): IChain;
    xss(is_image?: boolean): IChain;
    enumerated(map: any): IChain;
    inArray(array: any[]): IChain;
    isString(): IChain;
    isBoolean(): IChain;
    range(min: any, max: any): IChain;
    optional(): IChain;
    isPort(): IChain;
    isV1UUID(): IChain;
    immutable(): IChain;
    updateRequired(): IChain;
    isArray(chain: IChain): IChain;
    isHash(keyChain: IChain, valueChain: IChain): IChain;
    rename(target: string): IChain;
    custom(name: string): IChain;
}

export declare function defToValve(def: struct.IObj[]): IValveSchema[];

export declare class Swiz {
    constructor(defs: struct.IObj[], options?: ISwizOptions);
    buildObject(obj: any, callback: (err: any, result: any) => void): void;
    buildObjectSync(obj: any): any;
    serializeJson(obj: any): string;
    serializeXml(obj: any): string;
    deserializeXml(xml: string): any;
    serialize(mode: SERIALIZATION, version: number, obj: ISerializable, callback: (err: any, result: string) => void): void;
    serializeForPagination(mode: SERIALIZATION, array: any[], metadata: any, callback: (err: any, result: string) => void): void;
    deserialize(mode: SERIALIZATION, version: number, raw: string, callback: (err: any, result: any) => void): void;
    getFieldDefinition(stype: string, name: string): struct.IField;
}

export interface ISerializable {
    getSerializerType(): string;
}

export interface ISwizOptions {
    stripNulls?: boolean;
    stripSerializerType?: boolean;
    for?: string;
}

interface IValidator {
    name: string;
    func(value: any, baton: any, callback: Function): void;
    help: string;
}

export declare function stripSerializerTypes(obj: any): any;

export declare module struct {
    export function Obj(name: string, options?: IObjOptions): IObj;
    export function Field(name: string, options?: IFieldOptions): IField;
    export function coerce(value: any, coerceTo: string): any;

    export interface IObj {
        name: string;
        options: IObjOptions;
        singular: string;
        plural: string;
        fields: IField[];
    }

    export interface IField {
        name: string;
        options: IFieldOptions;
        src: string;
        singular: string;
        plural: string;
        desc?: string;
        val?: IChain;
        attribute: boolean;
        enumerated: boolean;
        ignorePublic: boolean;
        filterFrom: string[];
        coerceTo: any;
    }

    export interface IObjOptions {
        singular?: string;
        plural?: string;
        fields?: IField[];
    }

    export interface IFieldOptions {
        src?: string;
        singular?: string;
        plural?: string;
        desc?: string;
        val?: IChain;
        attribute?: boolean;
        enumerated?: any;
        ignorePublic?: boolean;
        filterFrom?: string[];
        coerceTo?: string;
    }
}

export declare enum SERIALIZATION {
    SERIALIZATION_JSON,
    SERIALIZATION_XML
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Send a FrontBase query</title>

fbsql_database

fbsql_db_status

FrontBase Functions

PHP Manual

fbsql_db_query

(PHP 4 >= 4.0.6, PHP 5)

fbsql_db_query — Send a FrontBase query

Description

   resource fbsql_db_query
    ( string $database
   , string $query
   [, resource $link_identifier
  ] )

   Selects a database and executes a query on it.

Parameters

database

       The database to be selected.

query

       The SQL query to be executed.

Note:

        The query string shall always end with a semicolon.

link_identifier

A FrontBase link identifier
returned by fbsql_connect() or
fbsql_pconnect().

If optional and not specified,
the function will try to find an open link to the FrontBase server and if no
such link is found it will try to create one as if
fbsql_connect() was called with no arguments.

Return Values

   Returns a positive FrontBase result identifier to the query result, or
   FALSE on error.

See Also

fbsql_query() - Send a FrontBase query

fbsql_connect() - Open a connection to a FrontBase Server

fbsql_database

fbsql_db_status

FrontBase Functions

PHP Manual


text:
using System.Collections.Generic;
using System.Composition;
using Microsoft.CodeAnalysis.GenerateType;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.LanguageServices;
using Microsoft.CodeAnalysis.Notification;
using Microsoft.CodeAnalysis.ProjectManagement;

namespace Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics.GenerateType
{
    [ExportWorkspaceService(typeof(IGenerateTypeOptionsService), ServiceLayer.Default), Shared]
    internal class TestGenerateTypeOptionsService : IGenerateTypeOptionsService
    {
        public Accessibility Accessibility = Accessibility.NotApplicable;
        public TypeKind TypeKind = TypeKind.Class;
        public string TypeName = null;
        public Project Project = null;
        public bool IsNewFile = false;
        public string NewFileName = null;
        public IList<string> Folders = null;
        public string FullFilePath = null;
        public Document ExistingDocument = null;
        public bool AreFoldersValidIdentifiers = true;
        public bool IsCancelled = false;

        // Actual input
        public string ClassName { get; private set; }
        public GenerateTypeDialogOptions GenerateTypeDialogOptions { get; private set; }

        public GenerateTypeOptionsResult GetGenerateTypeOptions(
            string className,
            GenerateTypeDialogOptions generateTypeDialogOptions,
            Document document,
            INotificationService notificationService,
            IProjectManagementService projectManagementService,
            ISyntaxFactsService syntaxFactsService)
        {
            // Storing the actual values
            ClassName = className;
            GenerateTypeDialogOptions = generateTypeDialogOptions;

            return new GenerateTypeOptionsResult(
                accessibility: Accessibility,
                typeKind: TypeKind,
                typeName: TypeName,
                project: Project,
                isNewFile: IsNewFile,
                newFileName: NewFileName,
                folders: Folders,
                fullFilePath: FullFilePath,
                existingDocument: ExistingDocument,
                areFoldersValidIdentifiers: AreFoldersValidIdentifiers,
                isCancelled: IsCancelled);
        }

        public void SetGenerateTypeOptions(
            Accessibility accessibility = Accessibility.NotApplicable,
            TypeKind typeKind = TypeKind.Class,
            string typeName = null,
            Project project = null,
            bool isNewFile = false,
            string newFileName = null,
            IList<string> folders = null,
            string fullFilePath = null,
            Document existingDocument = null,
            bool areFoldersValidIdentifiers = true,
            bool isCancelled = false)
        {
            Accessibility = accessibility;
            TypeKind = typeKind;
            TypeName = typeName;
            Project = project;
            IsNewFile = isNewFile;
            NewFileName = newFileName;
            Folders = folders;
            FullFilePath = fullFilePath;
            ExistingDocument = existingDocument;
            AreFoldersValidIdentifiers = areFoldersValidIdentifiers;
            IsCancelled = isCancelled;
        }
    }
}


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

namespace SystemUtils.Tools
{
    public class ToolArgsTokenizer
	{

		bool InString;
		StringBuilder CurrentToken;
		List<string> Tokens;

		StringBuilder Processed = new StringBuilder();
		public string[] Tokenize(string text)
		{
			Tokens = new List<string>();
			CurrentToken = new StringBuilder();
			InString = false;
			foreach (char ch in text)
			{
				if (ch == '\"')
				{
					if (InString)
					{
						InString = false;
						ContinueToken(ch);
					}
					else
					{
						InString = true;
						BeginOrContinueToken(ch);
					}
				}
				else if (ch == ' ')
				{
					if (InString)
						ContinueToken(ch);
					else
						EndTokenIfExists();
				}
				else
				{
					BeginOrContinueToken(ch);
				}
				Processed.Append(ch);
			}
			EndTokenIfExists();
			return Tokens.ToArray();
		}

		private void BeginToken(char ch)
		{
			BeginToken();
			CurrentToken.Append(ch);
		}
		private void BeginToken()
		{
			if (CurrentToken != null)
				throw new Exception("cannot begin word in the middle of another word");
			CurrentToken = new StringBuilder();
		}
		private void BeginOrContinueToken(char ch)
		{
			if (CurrentToken == null)
				CurrentToken = new StringBuilder();
			CurrentToken.Append(ch);
		}
		private void ContinueToken(char ch)
		{
			CurrentToken.Append(ch);
		}
		void EndToken()
		{
			var s = CurrentToken.ToString();
			if(s.IsNotNullOrEmpty())
				Tokens.Add(s);
			CurrentToken = null;
		}
		private void EndTokenIfExists()
		{
			if (CurrentToken != null)
				Tokens.Add(CurrentToken.ToString());
			CurrentToken = null;
		}

	}
}


text:
<ion-view title="Financial Assistance">
   <ion-nav-buttons side="left">
    <button menu-toggle="left" class="button button-icon icon ion-navicon"></button>
  </ion-nav-buttons>
  <ion-nav-buttons side="right">
    <button menu-toggle="right" class="button button-icon icon ion-navicon"></button>
  </ion-nav-buttons>
  <ion-content class="has-header">

Financial Assistance

  </ion-content>
</ion-view>


text:
<?php

namespace NilPortugues\SchemaOrg\Properties;

use NilPortugues\SchemaOrg\SchemaProperty;

/**
 * A diagnostic test that can identify this sign.
 */
class IdentifyingTestProperty extends SchemaProperty
{
    const SCHEMA_URL = 'http://schema.org/identifyingTest';
    const PROPERTY_NAME = 'identifyingTest';

    /**
     * A list of schemas allowed to use this property.
     *
     * @var array
     */
    protected static $allowedSchemas = [
        'http://schema.org/MedicalSign',
    ];
}


text:
package org.pingaj.app.util.dozer;

import org.apache.commons.lang3.StringUtils;
import org.dozer.DozerConverter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Creator: JimmyLin
 * DateTime: 14-4-18 下午12:02
 * Summary: timemillis <=> formatted string
 */
public class SimpleDateConverter extends DozerConverter<Date, String> {

    private static final Logger LOG = LoggerFactory.getLogger(SimpleDateConverter.class);

    private SimpleDateFormat dateFormater;

    public SimpleDateConverter(String pattern) {
        super(Date.class, String.class);
        dateFormater = new SimpleDateFormat(pattern);
    }

    @Override
    public String convertTo(Date source, String destination) {
        if (source == null) return "";
        return dateFormater.format(source);
    }

    @Override
    public Date convertFrom(String source, Date destination) {
        if (StringUtils.isEmpty(source)) return null;
        try {
            return dateFormater.parse(source);
        } catch (ParseException e) {
            LOG.error(e.getMessage());
        }
        return null;
    }
}


text:
package org.camunda.bpm.engine.impl.jobexecutor;

import java.util.Collection;

import org.camunda.bpm.engine.OptimisticLockingException;
import org.camunda.bpm.engine.ProcessEngineException;
import org.camunda.bpm.engine.impl.ProcessEngineLogger;
import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity;
import org.camunda.bpm.engine.impl.persistence.entity.JobEntity;
import org.camunda.bpm.engine.repository.ProcessDefinition;

/**
 * @author Daniel Meyer
 *
 */
public class JobExecutorLogger extends ProcessEngineLogger {

  public void debugAcquiredJobNotFound(String jobId) {
    logDebug(
        "001", "Acquired job with id '{}' not found.", jobId);
  }

  public void exceptionWhileExecutingJob(JobEntity job, Throwable exception) {
    logWarn(
        "002", "Exception while executing job {}: ", job, exception);
  }

  public void debugFallbackToDefaultRetryStrategy() {
    logDebug(
        "003", "Falling back to default retry strategy");
  }

  public void debugDecrementingRetriesForJob(String id) {
    logDebug(
        "004", "Decrementing retries of job {}", id);
  }

  public void debugInitiallyAppyingRetryCycleForJob(String id, int times) {
    logDebug(
        "005", "Applying job retry time cycle for the first time for job {}, retires {}", id, times);
  }

  public void exceptionWhileExecutingJob(String nextJobId, Throwable t) {
    if(t instanceof OptimisticLockingException && !isDebugEnabled()) {
      logWarn(
          "006",
          "Exception while executing job {}: {}. To see the full stacktrace set logging level to DEBUG.",
          nextJobId, t.getClass().getSimpleName());
    } else {
      logWarn(
          "006", "Exception while executing job {}: ", nextJobId, t);
    }
  }

  public void couldNotDeterminePriority(ExecutionEntity execution, Object value, ProcessEngineException e) {
    logWarn(
        "007",
        "Could not determine priority for job created in context of execution {}. Using default priority {}",
        execution, value, e);
  }

  public void debugAddingNewExclusiveJobToJobExecutorCOntext(String jobId) {
    logDebug(
        "008",
        "Adding new exclusive job to job executor context. Job Id='{}'", jobId);
  }

  public void timeoutDuringShutdown() {
    logWarn(
        "009",
        "Timeout during shutdown of job executor. The current running jobs could not end within 60 seconds after shutdown operation");
  }

  public void interruptedWhileShuttingDownjobExecutor(InterruptedException e) {
    logWarn(
        "010",
        "Interrupted while shutting down the job executor", e);
  }

  public void debugJobAcquisitionThreadSleeping(long millis) {
    logDebug("011", "Job acquisition thread sleeping for {} millis", millis);
  }

  public void jobExecutorThreadWokeUp() {
    logDebug("012", "Job acquisition thread woke up");
  }

  public void jobExecutionWaitInterrupted() {
    logDebug("013", "Job Execution wait interrupted");
  }

  public void startingUpJobExecutor(String name) {
    logInfo(
        "014", "Starting up the JobExecutor[{}].", name);
  }

  public void shuttingDownTheJobExecutor(String name) {
    logInfo(
        "015", "Shutting down the JobExecutor[{}]", name);
  }

  public void ignoringSuspendedJob(ProcessDefinition processDefinition) {
    logDebug(
        "016",
        "Ignoring job of suspended {}", processDefinition);
  }

  public void debugNotifyingJobExecutor(String string) {
    logDebug(
        "017", "Notifying Job Executor of new job {}", string);
  }

  public void startingToAcquireJobs(String name) {
    logInfo(
        "018", "{} starting to acquire jobs", name);
  }

  public void exceptionDuringJobAcquisition(Exception e) {
    logError(
        "019", "Exception during job acquisition {}", e.getMessage(), e);
  }

  public void stoppedJobAcquisition(String name) {
    logInfo(
        "020", "{} stopped job acquisition", name);
  }

  public void exceptionWhileUnlockingJob(String jobId, Throwable t) {
    logWarn(
        "021",
        "Exception while unaquiring job {}: ", jobId, t);
  }

  public void acquiredJobs(String processEngine, AcquiredJobs acquiredJobs) {
    logDebug(
        "022",
        "Acquired {} jobs for process engine '{}': {}", acquiredJobs.size(), processEngine, acquiredJobs.getJobIdBatches());
  }

  public void executeJobs(String processEngine, Collection<String> jobs) {
    logDebug(
        "023",
        "Execute jobs for process engine '{}': {}", processEngine, jobs);
  }

  public void debugFailedJobNotFound(String jobId) {
    logDebug(
        "024", "Failed job with id '{}' not found.", jobId);
  }

  public ProcessEngineException wrapJobExecutionFailure(JobFailureCollector jobFailureCollector, Throwable cause) {
    JobEntity job = jobFailureCollector.getJob();
    if (job != null) {
      return new ProcessEngineException(exceptionMessage(
        "025", "Exception while executing job {}: ", jobFailureCollector.getJob()), cause);
    }
    else {
      return new ProcessEngineException(exceptionMessage(
         "025", "Exception while executing job {}: ", jobFailureCollector.getJobId()), cause);
    }
  }

  public ProcessEngineException jobNotFoundException(String jobId) {
    return new ProcessEngineException(exceptionMessage(
        "026", "No job found with id '{}'", jobId));
  }

  public void exceptionWhileParsingExpression(String jobId, String exceptionMessage) {
    logWarn(
        "027", "Falling back to default retry strategy. Exception while executing job {}: {}", jobId, exceptionMessage);
  }

  public void warnHistoryCleanupBatchWindowNotFound() {
    logWarn(
      "028",
      "Batch window for history cleanup was not calculated. History cleanup job(s) will be suspended.");
  }

  public void infoJobExecutorDoesNotHandleHistoryCleanupJobs(ProcessEngineConfigurationImpl config) {
    Long jobExecutorPriorityRangeMin = config.getJobExecutorPriorityRangeMin();
    Long jobExecutorPriorityRangeMax = config.getJobExecutorPriorityRangeMax();
    logInfo("029",
        "JobExecutor is configured for priority range {}-{}. History cleanup jobs will not be handled, because they are outside the priority range ({}).",
        jobExecutorPriorityRangeMin == null ? 0 : jobExecutorPriorityRangeMin,
        jobExecutorPriorityRangeMax == null ? Long.MAX_VALUE : jobExecutorPriorityRangeMax,
        config.getHistoryCleanupJobPriority());
  }

  public void infoJobExecutorDoesNotHandleBatchJobs(ProcessEngineConfigurationImpl config) {
    Long jobExecutorPriorityRangeMin = config.getJobExecutorPriorityRangeMin();
    Long jobExecutorPriorityRangeMax = config.getJobExecutorPriorityRangeMax();
    logInfo("030",
        "JobExecutor is configured for priority range {}-{}. Batch jobs will not be handled, because they are outside the priority range ({}).",
        jobExecutorPriorityRangeMin == null ? 0 : jobExecutorPriorityRangeMin,
        jobExecutorPriorityRangeMax == null ? Long.MAX_VALUE : jobExecutorPriorityRangeMax,
        config.getBatchJobPriority());
  }

  public void debugFailedJobListenerSkipped(String jobId) {
    logDebug("031", "Failed job listener skipped for job {} because it's been already re-acquired", jobId);
  }

  public ProcessEngineException jobExecutorPriorityRangeException(String reason) {
    return new ProcessEngineException(exceptionMessage("031", "Invalid configuration for job executor priority range. Reason: {}", reason));
  }

}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.18444
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace IIS.CDLIB
{
    using System;
    using System.Xml;
    using ICSSoft.STORMNET;

    // *** Start programmer edit section *** (Using statements)

    // *** End programmer edit section *** (Using statements)

    /// <summary>
    /// D331.
    /// </summary>
    // *** Start programmer edit section *** (D331 CustomAttributes)

    // *** End programmer edit section *** (D331 CustomAttributes)
    [AutoAltered()]
    [ICSSoft.STORMNET.NotStored(false)]
    [AccessType(ICSSoft.STORMNET.AccessType.none)]
    public class D331 : IIS.CDLIB.D
    {

        private IIS.CDLIB.D33 fD33;

        // *** Start programmer edit section *** (D331 CustomMembers)

        // *** End programmer edit section *** (D331 CustomMembers)

        /// <summary>
        /// мастеровая ссылка на шапку IIS.CDLIB.D33.
        /// </summary>
        // *** Start programmer edit section *** (D331.D33 CustomAttributes)

        // *** End programmer edit section *** (D331.D33 CustomAttributes)
        [Agregator()]
        [NotNull()]
        [PropertyStorage(new string[] {
                "D33"})]
        public virtual IIS.CDLIB.D33 D33
        {
            get
            {
                // *** Start programmer edit section *** (D331.D33 Get start)

                // *** End programmer edit section *** (D331.D33 Get start)
                IIS.CDLIB.D33 result = this.fD33;
                // *** Start programmer edit section *** (D331.D33 Get end)

                // *** End programmer edit section *** (D331.D33 Get end)
                return result;
            }
            set
            {
                // *** Start programmer edit section *** (D331.D33 Set start)

                // *** End programmer edit section *** (D331.D33 Set start)
                this.fD33 = value;
                // *** Start programmer edit section *** (D331.D33 Set end)

                // *** End programmer edit section *** (D331.D33 Set end)
            }
        }
    }

    /// <summary>
    /// Detail array of D331.
    /// </summary>
    // *** Start programmer edit section *** (DetailArrayDetailArrayOfD331 CustomAttributes)

    // *** End programmer edit section *** (DetailArrayDetailArrayOfD331 CustomAttributes)
    public class DetailArrayOfD331 : ICSSoft.STORMNET.DetailArray
    {

        // *** Start programmer edit section *** (IIS.CDLIB.DetailArrayOfD331 members)

        // *** End programmer edit section *** (IIS.CDLIB.DetailArrayOfD331 members)

        /// <summary>
        /// Construct detail array.
        /// </summary>
        /// <summary>
        /// Returns object with type D331 by index.
        /// </summary>
        /// <summary>
        /// Adds object with type D331.
        /// </summary>
        public DetailArrayOfD331(IIS.CDLIB.D33 fD33) :
                base(typeof(D331), ((ICSSoft.STORMNET.DataObject)(fD33)))
        {
        }

        public IIS.CDLIB.D331 this[int index]
        {
            get
            {
                return ((IIS.CDLIB.D331)(this.ItemByIndex(index)));
            }
        }

        public virtual void Add(IIS.CDLIB.D331 dataobject)
        {
            this.AddObject(((ICSSoft.STORMNET.DataObject)(dataobject)));
        }
    }
}


text:
import Data.Char (ord)
import Data.List (sort)

import qualified Data.Text.IO as T
import qualified Data.Text as T

main :: IO()
main = do
  contents <- T.readFile "022.in"
  let names = map (T.dropAround (== '"')) . T.splitOn (T.pack ",") $ contents
  let sortedNames = sort names
  let nameScores = map (sum . map (subtract 64 . ord) . T.unpack) sortedNames
  let totalScore = sum $ zipWith (*) nameScores [1..(length nameScores)]
  print totalScore


text:
namespace stratum {
namespace hal {
namespace phal {

// This is the basic interface for attribute database adapters.
// TODO(max): extend if necessary.
class Adapter {
 public:
  // Construct a new Adapter to the database given.
  explicit Adapter(AttributeDatabaseInterface* attribute_db_interface)
      : database_(attribute_db_interface) {}

  virtual ~Adapter() = default;

  // Convenience function to Get values from the database.
  ::util::StatusOr<std::unique_ptr<PhalDB>> Get(const std::vector<Path>& paths);

  // Convenience function to Subscribe to the database.
  ::util::StatusOr<std::unique_ptr<Query>> Subscribe(
      const std::vector<Path>& paths,
      std::unique_ptr<ChannelWriter<PhalDB>> writer, absl::Duration poll_time);

  // Convenience function to Set values in the database.
  ::util::Status Set(const AttributeValueMap& values);

 private:
  // Handle to the database. Not owned by this class.
  AttributeDatabaseInterface* database_;
};

}  // namespace phal
}  // namespace hal
}  // namespace stratum

#endif  // STRATUM_HAL_LIB_PHAL_ADAPTER_H_


text:
+++
title = "Content"
weight = 2
sort_by = "weight"
redirect_to = "documentation/content/overview"
insert_anchor_links = "left"
+++


text:
<?php
/* Development */
define('SAVEQUERIES', true);
define('WP_DEBUG', true);
define('SCRIPT_DEBUG', true);

define('FORCE_SSL_ADMIN', false);
define( 'JETPACK_DEV_DEBUG', true);


text:
using System;

namespace ReMi.DataAccess.Exceptions
{
    public class QueryNotFoundException : EntityNotFoundException
    {
        public QueryNotFoundException(int queryId)
            : base("Query", queryId)
        {
        }

        public QueryNotFoundException(int queryId, Exception innerException)
            : base("Query", queryId, innerException)
        {
        }
    }
}


text:
//
//  WHNetworkRequest.m
//  禽病网
//
//  Created by WangHui on 2016/12/12.
//  Copyright © 2016年 wanghui. All rights reserved.
//

#import "WHNetworkRequest.h"

#import "WHNetworkActivityIndicator.h"
#import "Reachability.h"
#import <AFNetworking/AFNetworking.h>

typedef NS_ENUM(NSInteger, NetworkRequestType)
{
    NetworkRequestType_GET,    //GET请求
    NetworkRequestType_POST    //POST请求
};

@interface WHNetworkRequest()

@property (nonatomic, strong) AFHTTPSessionManager *sessionManager;
@property (nonatomic, strong) NSMutableSet<NSURLSessionTask *> *operationTask;

@end

@implementation WHNetworkRequest

SHARE_INSTANCE_M(NetworkRequest, WHNetworkRequest)

- (instancetype)init
{
    self = [super init];
    if (self)
    {
        _sessionManager = [AFHTTPSessionManager manager];
        _sessionManager.requestSerializer.timeoutInterval = 15.0f;
        _sessionManager.responseSerializer = [AFHTTPResponseSerializer serializer];
        _sessionManager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", @"text/html", @"text/plain", @"image/png",nil];

        _operationTask = [NSMutableSet set];

#if TARGET_OS_IOS
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(backgroundNotification) name:UIApplicationDidEnterBackgroundNotification object:nil];
#endif
    }

    return self;
}

#pragma mark -
#pragma mark requestMethod
/**
 发起请求

 @param requestType 请求类型
 @param urlStr url
 @param parameters 参数
 @param success 请求成功的回调
 @param failure 请求失败的回调
 */
- (void)requestWithNetworkType:(NetworkRequestType)requestType
                       withUrl:(NSString *)urlStr
                withParameters:(NSDictionary *)parameters
                       success:(void (^)(id responseObject))success
                       failure:(void (^)(NSError *error))failure
{
    BOOL isReachable = [[Reachability reachabilityForInternetConnection] isReachable];
    if (!isReachable)
    {
        if (failure) failure(nil);
        return;
    }

    [[WHNetworkActivityIndicator sharedActivityIndicator] startActivity];

    __weak typeof(self) weakSelf = self;
    //请求成功的回调
    void (^successBlock)(NSURLSessionTask *task, id responseObject) = ^(NSURLSessionTask *task, id responseObject){

        [weakSelf.operationTask removeObject:task];
        [[WHNetworkActivityIndicator sharedActivityIndicator] stopActivity];

        WHLog(@"%@", [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding]);

        if (success)
        {
            success(responseObject);
        }
    };

    //请求失败的回调
    void (^failureBlock)(NSURLSessionTask *task, NSError *error) = ^(NSURLSessionTask *task, NSError *error){

        [weakSelf.operationTask removeObject:task];
        [[WHNetworkActivityIndicator sharedActivityIndicator] stopActivity];

        WHLog(@"%@", error);

        if (failure)
        {
            failure(error);
        }
    };

    NSURLSessionTask *task = nil;
    urlStr = [ServerUrl stringByAppendingPathComponent:urlStr];

    switch (requestType)
    {
        case NetworkRequestType_GET:
        {
            task = [_sessionManager GET:urlStr parameters:parameters progress:nil success:successBlock failure:failureBlock];
        }
            break;

        case NetworkRequestType_POST:
        {
            task = [_sessionManager POST:urlStr parameters:parameters progress:nil success:successBlock failure:failureBlock];
        }
            break;

        default:
            break;
    }
    [_operationTask addObject:task];
}

/**
 GET请求

 @param urlStr URL
 @param success 请求成功的回调
 @param failure 请求失败的回调
 */
- (void)GETWithUrl:(NSString *)urlStr success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure
{
    [self requestWithNetworkType:NetworkRequestType_GET withUrl:urlStr withParameters:nil success:success failure:failure];
}

/**
 POST请求

 @param urlStr URL
 @param parameters 参数
 @param success 请求成功的回调
 @param failure 请求失败的回调
 */
- (void)POSTWithUrl:(NSString *)urlStr withParameters:(NSDictionary *)parameters success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure
{
    [self requestWithNetworkType:NetworkRequestType_POST withUrl:urlStr withParameters:parameters success:success failure:failure];
}

#pragma mark -
#pragma mark Notification
/**
 进入后台通知
 */
- (void)backgroundNotification
{
    [self cancelAllTask];
    [[WHNetworkActivityIndicator sharedActivityIndicator] stopAllActivity];
}

/**
 取消全部task
 */
- (void)cancelAllTask
{
    for (NSURLSessionTask *task in _operationTask)
    {
        [task cancel];
    }
    [_operationTask removeAllObjects];
}

- (void)dealloc
{
    [self backgroundNotification];
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

@end


text:
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.api.ads.admanager.jaxws.v202211;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for GenericTargetingError.Reason.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <simpleType name="GenericTargetingError.Reason">
 *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *     <enumeration value="CONFLICTING_INCLUSION_OR_EXCLUSION_OF_SIBLINGS"/>
 *     <enumeration value="INCLUDING_DESCENDANTS_OF_EXCLUDED_CRITERIA"/>
 *     <enumeration value="UNKNOWN"/>
 *   </restriction>
 * </simpleType>
 *

 *
 */
@XmlType(name = "GenericTargetingError.Reason")
@XmlEnum
public enum GenericTargetingErrorReason {

    /**
     *
     *                 Both including and excluding sibling criteria is disallowed.
     *
     *
     */
    CONFLICTING_INCLUSION_OR_EXCLUSION_OF_SIBLINGS,

    /**
     *
     *                 Including descendants of excluded criteria is disallowed.
     *
     *
     */
    INCLUDING_DESCENDANTS_OF_EXCLUDED_CRITERIA,

    /**
     *
     *                 The value returned if the actual value is not exposed by the requested API version.
     *
     *
     */
    UNKNOWN;

    public String value() {
        return name();
    }

    public static GenericTargetingErrorReason fromValue(String v) {
        return valueOf(v);
    }

}


text:
#ifndef LCB_VIEWS_API_H
#define LCB_VIEWS_API_H
#include <libcouchbase/couchbase.h>
#include <libcouchbase/api3.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @ingroup lcb-public-api
 * @defgroup lcb-view-api Views (Map-Reduce)
 * @brief Higher level API which splits view results into rows
 */

/**
 * @addtogroup lcb-view-api
 * @{
 */
#ifdef __cplusplus
namespace lcb { namespace views { struct ViewRequest; } }
typedef lcb::views::ViewRequest* lcb_VIEWHANDLE;
#else
typedef struct lcbview_REQUEST_st *lcb_VIEWHANDLE;
#endif

typedef struct lcb_RESPVIEW_st lcb_RESPVIEWQUERY;

/**
 * Callback function invoked for each row returned from the view
 * @param instance the library handle
 * @param cbtype the callback type. This is set to @ref LCB_CALLBACK_VIEWQUERY
 * @param row Information about the current row
 *
 * Note that this callback's `row->rflags` will contain the @ref LCB_RESP_F_FINAL
 * flag set after all rows have been returned. Applications should check for
 * the presence of this flag. If this flag is present, the row itself will
 * contain the raw response metadata in its lcb_RESPVIEWQUERY::value field.
 */
typedef void (*lcb_VIEWQUERYCALLBACK)(lcb_t instance,
        int cbtype, const lcb_RESPVIEWQUERY *row);

/** Set this flag to execute an actual get with each response */
#define LCB_CMDVIEWQUERY_F_INCLUDE_DOCS (1 << 16)

/**Set this flag to only parse the top level row, and not its constituent
 * parts. Note this is incompatible with `F_INCLUDE_DOCS`*/
#define LCB_CMDVIEWQUERY_F_NOROWPARSE (1 << 17)

/**This view is spatial. Modifies how the final view path will be constructed */
#define LCB_CMDVIEWQUERY_F_SPATIAL (1 << 18)

/** Command structure for querying a view */
typedef struct {
    /** Common command flags; e.g. @ref LCB_CMDVIEWQUERY_F_INCLUDE_DOCS */
    lcb_U32 cmdflags;

    /** The design document as a string; e.g. `"beer"` */
    const char *ddoc;
    /** Length of design document name */
    size_t nddoc;

    /** The name of the view as a string; e.g. `"brewery_beers"` */
    const char *view;
    /** Length of the view name */
    size_t nview;

    /**Any URL parameters to be passed to the view should be specified here.
     * The library will internally insert a `?` character before the options
     * (if specified), so do not place one yourself.
     *
     * The format of the options follows the standard for passing parameters
     * via HTTP requests; thus e.g. `key1=value1&key2=value2`. This string
     * is itself not parsed by the library but simply appended to the URL. */
    const char *optstr;

    /** Length of the option string */
    size_t noptstr;

    /**Some query parameters (in particular; 'keys') may be send via a POST
     * request within the request body, since it might be too long for the
     * URI itself. If you have such data, place it here. */
    const char *postdata;
    size_t npostdata;

    /**
     * The maximum number of internal get requests to issue concurrently for
     * @c F_INCLUDE_DOCS. This is useful for large view responses where
     * there is a potential for a large number of responses resulting in a large
     * number of get requests; increasing memory usage.
     *
     * Setting this value will attempt to throttle the number of get requests,
     * so that no more than this number of requests will be in progress at any
     * given time.
     */
    unsigned docs_concurrent_max;

    /**Callback to invoke for each row. If not provided, @ref LCB_EINVAL will
     * be returned from lcb_view_query() */
    lcb_VIEWQUERYCALLBACK callback;

    /**If not NULL, this will be set to a handle which may be passed to
     * lcb_view_cancel(). See that function for more details */
    lcb_VIEWHANDLE *handle;
} lcb_CMDVIEWQUERY;

/**@brief Response structure representing a row.
 *
 * This is provided for each invocation of the
 * lcb_CMDVIEWQUERY::callback invocation. The `key` and `nkey` fields here
 * refer to the first argument passed to the `emit` function by the
 * `map` function.
 *
 * This response structure may be used as-is, in case the values are simple,
 * or may be relayed over to a more advanced JSON parser to decode the
 * individual key and value properties.
 *
 * @note
 * The #key and #value fields are JSON encoded. This means that if they are
 * bare strings, they will be surrounded by quotes. On the other hand, the
 * #docid is _not_ JSON encoded and is provided with any surrounding quotes
 * stripped out (this is because the document ID is always a string). Please
 * take note of this if doing any form of string comparison/processing.
 *
 * @note
 * If the @ref LCB_CMDVIEWQUERY_F_NOROWPARSE flag has been set, the #value
 * field will contain the raw row contents, rather than the constituent
 * elements.
 *
 */
struct lcb_RESPVIEW_st {
    #ifndef __LCB_DOXYGEN__ /* Doxygen fails to substitute the base fields for some reason */
    LCB_RESP_BASE
    #else
    void *cookie; /**< User data associated with request */
    const void *key; /**< Emitted key */
    lcb_SIZE nkey; /**< Length of emitted key */
    lcb_cas_t cas; /**< unused */
    lcb_error_t rc; /**< Status code */
    lcb_U16 version; /**< unused */
    lcb_U16 rflags; /**< Response specific flags. see lcb_RESPFLAGS */
    #endif

    const char *docid; /**< Document ID (i.e. memcached key) associated with this row */
    size_t ndocid; /**< Length of document ID */

    /**Emitted value. If `rflags & LCB_RESP_F_FINAL` is true then this will
     * contain the _metadata_ of the view response itself. This includes the
     * `total_rows` field among other things, and should be parsed as JSON */
    const char *value;

    size_t nvalue; /**< Length of emitted value */

    /**If this is a spatial view, the GeoJSON geometry fields will be here */
    const char *geometry;
    size_t ngeometry;

    /**If the request failed, this will contain the raw underlying request.
     * You may inspect this request and perform some other processing on
     * the underlying HTTP data. Note that this may not necessarily contain
     * the entire response body; just the chunk at which processing failed.*/
    const lcb_RESPHTTP *htresp;

    /**If @ref LCB_CMDVIEWQUERY_F_INCLUDE_DOCS was specified in the request,
     * this will contain the response for the _GET_ command. This is the same
     * response as would be received in the `LCB_CALLBACK_GET` for
     * lcb_get3().
     *
     * Note that this field should be checked for various errors as well, as it
     * is remotely possible the get request did not succeed.
     *
     * If the @ref LCB_CMDVIEWQUERY_F_INCLUDE_DOCS flag was not specified, this
     * field will be `NULL`.
     */
    const lcb_RESPGET *docresp;
};

/**
 * @volatile
 *
 * Initiate a view query. This will execute a view (MapReduce) request against
 * a view endpoint within the cluster. For each row emitted by the view
 * functions (i.e. the `map`, and possibly `reduce` functions) the
 * callback specified in the lcb_CMDVIEWQUERY::callback field will be invoked.
 *
 * Here is a functional example:
 *
 * @code{.c}
 * static void rowCallback(lcb_t instance, int ignoreme, const lcb_RESPVIEWQUERY *response) {
 *   if (response->rflags & LCB_RESP_F_FINAL) {
 *     printf("View is done!\n");
 *     if (response->nvalue) {
 *       printf("Raw JSON metadata: %.*s\n", (int)response->nvalue, response->value);
 *     }
 *     if (response->rc != LCB_SUCCESS) {
 *       printf("Query failed: %s\n", lcb_sterror(instance, response->rc));
 *     }
 *     return;
 *   }
 *
 *   // Key and value always exist:
 *   printf("Emitted key: %.*s\n", (int)resp->nkey, resp-key);
 *   printf("Emitted value: %s.*s\n", (int)resp->nvalue, resp->value);
 *
 *   // Document IDs are only present for non-reduce queries
 *   if (resp->docid) {
 *     printf("Document ID: %.*s\n", (int)resp->docid, resp->ndocid);
 *     // If LCB_CMDVIEWQUERY_F_INCLUDE_DOCS was specified, this might
 *     // contain the actual document value
 *     if (resp->docresp) {
 *       const lcb_RESPGET *rg = resp->docresp;
 *       if (rg->rc == LCB_SUCCESS) {
 *         printf("Document contents: %.*s\n", (int)rg->value, rg->nvalue);
 *         printf("CAS: 0x%lx\n", rg->cas);
 *       } else {
 *         printf("Couldn't fetch document: %s\n", lcb_strerror(instance, rg->rc));
 *       }
 *     }
 *   }
 * }
 *
 * static void doViewRequest(lcb_t instance) {
 *   lcb_CMDVIEWQUERY cmd = { 0 };
 *   vq.ddoc = "beer";
 *   vq.nddoc = strlen(vq.ddoc);
 *   vq.view = "brewery_beers";
 *   vq.nview = strlen(vq.view);
 *   vq.optstr = "limit=10&descending=true";
 *   vq.noptstr = strlen(vq.optstr);
 *   vq.callback = rowCallback;
 *
 *   // If you want to perform an implicit lcb_get3() on each row's `docid`
 *   if (includeDocs) {
 *     vq.cmdflags |= LCB_CMDVIEWQUERY_F_INCLUDE_DOCS;
 *   }
 *
 *   lcb_error_t rc = lcb_view_query(instance, NULL, &cmd);
 *   // handle error
 *   lcb_wait(instance);
 * }
 * @endcode
 *
 * @param instance The library handle
 * @param cookie user pointer included in every response
 * @param cmd the command detailing the type of query to perform
 * @return LCB_SUCCESS on scheduling success, or an error code on scheduling
 * failure.
 */
LIBCOUCHBASE_API
lcb_error_t
lcb_view_query(lcb_t instance, const void *cookie, const lcb_CMDVIEWQUERY *cmd);

/**
 * @volatile
 *
 * Initialize a command object. This is a convenience function.
 * @param vq the command to initialize
 * @param design the name of the design. Required and should be NUL-terminated
 * @param view the name of the view. Required and should be NUL-terminated
 * @param options a string of options. Optional. If provided, should be
 * NUL-terminated
 * @param callback the callback to invoke. Required
 */
LIBCOUCHBASE_API
void
lcb_view_query_initcmd(lcb_CMDVIEWQUERY *vq,
    const char *design, const char *view, const char *options,
    lcb_VIEWQUERYCALLBACK callback);

/**
 * @volatile
 *
 * Cancels the ongoing request. This ensures the callback will never be invoked.
 * This should be used only in situations where the lcb_t itself may be
 * destroyed to avoid leaking any application allocated memory. This does not
 * guarantee the view internals will not leak, however.
 */
LIBCOUCHBASE_API
void
lcb_view_cancel(lcb_t instance, lcb_VIEWHANDLE handle);

/**@}*/

#ifdef __cplusplus
}
#endif

#endif


text:
To make it easier to diagnose your issue, please fill out the following:

## Summary

A simple summary of the problems you're having.

## Code to reproduce

If possible, please include a brief piece of code (or ideally, a link to an example project) demonstrating the problem you're having.

## iOS version

What version of iOS are you observing the problem on?

## Installation method

How did you install our SDK?

## SDK version

What version of our SDK are you using? You can find this by either looking at your `Podfile.lock` (if you're using Cocoapods), your `Cartfile.resolved` (if you're using Carthage), or by looking at the value of `STPSDKVersion` in `STPAPIClient.h`.

## Other information

Anything else you can include that'll make it easier for us to help you!


text:
"""
Allows the creation of a sensor that breaks out state_attributes.

For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.template/
"""
import asyncio
import logging

import voluptuous as vol

from homeassistant.core import callback
from homeassistant.components.sensor import ENTITY_ID_FORMAT, PLATFORM_SCHEMA
from homeassistant.const import (
    ATTR_FRIENDLY_NAME, ATTR_UNIT_OF_MEASUREMENT, CONF_VALUE_TEMPLATE,
    CONF_ICON_TEMPLATE, CONF_ENTITY_PICTURE_TEMPLATE, ATTR_ENTITY_ID,
    CONF_SENSORS, EVENT_HOMEASSISTANT_START)
from homeassistant.exceptions import TemplateError
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity, async_generate_entity_id
from homeassistant.helpers.event import async_track_state_change

_LOGGER = logging.getLogger(__name__)

SENSOR_SCHEMA = vol.Schema({
    vol.Required(CONF_VALUE_TEMPLATE): cv.template,
    vol.Optional(CONF_ICON_TEMPLATE): cv.template,
    vol.Optional(CONF_ENTITY_PICTURE_TEMPLATE): cv.template,
    vol.Optional(ATTR_FRIENDLY_NAME): cv.string,
    vol.Optional(ATTR_UNIT_OF_MEASUREMENT): cv.string,
    vol.Optional(ATTR_ENTITY_ID): cv.entity_ids
})

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Required(CONF_SENSORS): vol.Schema({cv.slug: SENSOR_SCHEMA}),
})

@asyncio.coroutine
# pylint: disable=unused-argument
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
    """Set up the template sensors."""
    sensors = []

    for device, device_config in config[CONF_SENSORS].items():
        state_template = device_config[CONF_VALUE_TEMPLATE]
        icon_template = device_config.get(CONF_ICON_TEMPLATE)
        entity_picture_template = device_config.get(
            CONF_ENTITY_PICTURE_TEMPLATE)
        entity_ids = (device_config.get(ATTR_ENTITY_ID) or
                      state_template.extract_entities())
        friendly_name = device_config.get(ATTR_FRIENDLY_NAME, device)
        unit_of_measurement = device_config.get(ATTR_UNIT_OF_MEASUREMENT)

        state_template.hass = hass

        if icon_template is not None:
            icon_template.hass = hass

        if entity_picture_template is not None:
            entity_picture_template.hass = hass

        sensors.append(
            SensorTemplate(
                hass,
                device,
                friendly_name,
                unit_of_measurement,
                state_template,
                icon_template,
                entity_picture_template,
                entity_ids)
            )
    if not sensors:
        _LOGGER.error("No sensors added")
        return False

    async_add_devices(sensors)
    return True

class SensorTemplate(Entity):
    """Representation of a Template Sensor."""

    def __init__(self, hass, device_id, friendly_name,
                 unit_of_measurement, state_template, icon_template,
                 entity_picture_template, entity_ids):
        """Initialize the sensor."""
        self.hass = hass
        self.entity_id = async_generate_entity_id(ENTITY_ID_FORMAT, device_id,
                                                  hass=hass)
        self._name = friendly_name
        self._unit_of_measurement = unit_of_measurement
        self._template = state_template
        self._state = None
        self._icon_template = icon_template
        self._entity_picture_template = entity_picture_template
        self._icon = None
        self._entity_picture = None
        self._entities = entity_ids

    @asyncio.coroutine
    def async_added_to_hass(self):
        """Register callbacks."""
        @callback
        def template_sensor_state_listener(entity, old_state, new_state):
            """Handle device state changes."""
            self.async_schedule_update_ha_state(True)

        @callback
        def template_sensor_startup(event):
            """Update template on startup."""
            async_track_state_change(
                self.hass, self._entities, template_sensor_state_listener)

            self.async_schedule_update_ha_state(True)

        self.hass.bus.async_listen_once(
            EVENT_HOMEASSISTANT_START, template_sensor_startup)

    @property
    def name(self):
        """Return the name of the sensor."""
        return self._name

    @property
    def state(self):
        """Return the state of the sensor."""
        return self._state

    @property
    def icon(self):
        """Return the icon to use in the frontend, if any."""
        return self._icon

    @property
    def entity_picture(self):
        """Return the entity_picture to use in the frontend, if any."""
        return self._entity_picture

    @property
    def unit_of_measurement(self):
        """Return the unit_of_measurement of the device."""
        return self._unit_of_measurement

    @property
    def should_poll(self):
        """No polling needed."""
        return False

    @asyncio.coroutine
    def async_update(self):
        """Update the state from the template."""
        try:
            self._state = self._template.async_render()
        except TemplateError as ex:
            if ex.args and ex.args[0].startswith(
                    "UndefinedError: 'None' has no attribute"):
                # Common during HA startup - so just a warning
                _LOGGER.warning('Could not render template %s,'
                                ' the state is unknown.', self._name)
                return
            self._state = None
            _LOGGER.error('Could not render template %s: %s', self._name, ex)

        for property_name, template in (
                ('_icon', self._icon_template),
                ('_entity_picture', self._entity_picture_template)):
            if template is None:
                continue

            try:
                setattr(self, property_name, template.async_render())
            except TemplateError as ex:
                friendly_property_name = property_name[1:].replace('_', ' ')
                if ex.args and ex.args[0].startswith(
                        "UndefinedError: 'None' has no attribute"):
                    # Common during HA startup - so just a warning
                    _LOGGER.warning('Could not render %s template %s,'
                                    ' the state is unknown.',
                                    friendly_property_name, self._name)
                    return

                try:
                    setattr(self, property_name,
                            getattr(super(), property_name))
                except AttributeError:
                    _LOGGER.error('Could not render %s template %s: %s',
                                  friendly_property_name, self._name, ex)


text:
// CodeGear C++Builder
// Copyright (c) 1995, 2016 by Embarcadero Technologies, Inc.
// All rights reserved

// (DO NOT EDIT: machine generated header) 'AbZipper.pas' rev: 32.00 (Android)

#ifndef AbzipperHPP
#define AbzipperHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member
#pragma pack(push,8)
#include <System.hpp>
#include <SysInit.hpp>
#include <System.Classes.hpp>
#include <AbBrowse.hpp>
#include <AbZBrows.hpp>
#include <AbArcTyp.hpp>
#include <AbZipTyp.hpp>
#include <AbBase.hpp>

//-- user supplied -----------------------------------------------------------

namespace Abzipper
{
//-- forward type declarations -----------------------------------------------
class DELPHICLASS TAbCustomZipper;
class DELPHICLASS TAbZipper;
//-- type declarations -------------------------------------------------------
#pragma pack(push,4)
class PASCALIMPLEMENTATION TAbCustomZipper : public Abzbrows::TAbCustomZipBrowser
{
	typedef Abzbrows::TAbCustomZipBrowser inherited;

protected:
	bool FAutoSave;
	Abziptyp::TAbZipSupportedMethod FCompressionMethodToUse;
	Abziptyp::TAbZipDeflationOption FDeflationOption;
	bool FDOSMode;
	Abarctyp::TAbArchiveConfirmEvent FOnConfirmSave;
	Abarctyp::TAbArchiveEvent FOnSave;
	Abarctyp::TAbArchiveProgressEvent FOnArchiveSaveProgress;
	Abbrowse::_di_IAbProgressMeter FArchiveSaveProgressMeter;
	Abarctyp::TAbStoreOptions FStoreOptions;
	virtual void __fastcall DoConfirmSave(System::TObject* Sender, bool &Confirm);
	virtual void __fastcall DoSave(System::TObject* Sender);
	void __fastcall DoArchiveSaveProgress(System::TObject* Sender, System::Byte Progress, bool &Abort);
	virtual void __fastcall InitArchive(void);
	void __fastcall SetAutoSave(bool Value);
	void __fastcall SetCompressionMethodToUse(Abziptyp::TAbZipSupportedMethod Value);
	void __fastcall SetDeflationOption(Abziptyp::TAbZipDeflationOption Value);
	void __fastcall SetDOSMode(bool Value);
	virtual void __fastcall SetFileName(const System::UnicodeString aFileName);
	void __fastcall SetStoreOptions(Abarctyp::TAbStoreOptions Value);
	void __fastcall SetArchiveSaveProgressMeter(const Abbrowse::_di_IAbProgressMeter Value);
	virtual void __fastcall SetZipfileComment(const System::UnicodeString Value);
	void __fastcall ZipProc(System::TObject* Sender, Abarctyp::TAbArchiveItem* Item, System::Classes::TStream* OutStream);
	void __fastcall ZipFromStreamProc(System::TObject* Sender, Abarctyp::TAbArchiveItem* Item, System::Classes::TStream* OutStream, System::Classes::TStream* InStream);
	virtual void __fastcall Notification(System::Classes::TComponent* Component, System::Classes::TOperation Operation);
	virtual void __fastcall ResetMeters(void);
	__property bool AutoSave = {read=FAutoSave, write=SetAutoSave, nodefault};
	__property Abziptyp::TAbZipSupportedMethod CompressionMethodToUse = {read=FCompressionMethodToUse, write=SetCompressionMethodToUse, default=2};
	__property Abziptyp::TAbZipDeflationOption DeflationOption = {read=FDeflationOption, write=SetDeflationOption, default=1};
	__property bool DOSMode = {read=FDOSMode, write=SetDOSMode, nodefault};
	__property Abarctyp::TAbStoreOptions StoreOptions = {read=FStoreOptions, write=SetStoreOptions, default=5};
	__property Abbrowse::_di_IAbProgressMeter ArchiveSaveProgressMeter = {read=FArchiveSaveProgressMeter, write=SetArchiveSaveProgressMeter};
	__property Abarctyp::TAbArchiveConfirmEvent OnConfirmSave = {read=FOnConfirmSave, write=FOnConfirmSave};
	__property Abarctyp::TAbArchiveEvent OnSave = {read=FOnSave, write=FOnSave};
	__property Abarctyp::TAbArchiveProgressEvent OnArchiveSaveProgress = {read=FOnArchiveSaveProgress, write=FOnArchiveSaveProgress};

public:
	__fastcall virtual TAbCustomZipper(System::Classes::TComponent* AOwner);
	__fastcall virtual ~TAbCustomZipper(void);
	void __fastcall AddFiles(const System::UnicodeString FileMask, int SearchAttr);
	void __fastcall AddFilesEx(const System::UnicodeString FileMask, const System::UnicodeString ExclusionMask, int SearchAttr);
	void __fastcall AddFromStream(const System::UnicodeString NewName, System::Classes::TStream* FromStream);
	void __fastcall DeleteAt(int Index);
	void __fastcall DeleteFiles(const System::UnicodeString FileMask);
	void __fastcall DeleteFilesEx(const System::UnicodeString FileMask, const System::UnicodeString ExclusionMask);
	void __fastcall DeleteTaggedItems(void);
	void __fastcall FreshenFiles(const System::UnicodeString FileMask);
	void __fastcall FreshenFilesEx(const System::UnicodeString FileMask, const System::UnicodeString ExclusionMask);
	void __fastcall FreshenTaggedItems(void);
	void __fastcall Move(Abarctyp::TAbArchiveItem* aItem, const System::UnicodeString NewStoredPath);
	void __fastcall Save(void);
	void __fastcall Replace(Abarctyp::TAbArchiveItem* aItem);
};

#pragma pack(pop)

#pragma pack(push,4)
class PASCALIMPLEMENTATION TAbZipper : public TAbCustomZipper
{
	typedef TAbCustomZipper inherited;

__published:
	__property ArchiveProgressMeter;
	__property ArchiveSaveProgressMeter;
	__property ItemProgressMeter;
	__property AutoSave;
	__property BaseDirectory = {default=0};
	__property CompressionMethodToUse = {default=2};
	__property DeflationOption = {default=1};
	__property DOSMode;
	__property SpanningThreshold = {default=0};
	__property LogFile = {default=0};
	__property Logging = {default=0};
	__property OnArchiveProgress;
	__property OnArchiveSaveProgress;
	__property OnArchiveItemProgress;
	__property OnChange;
	__property OnConfirmProcessItem;
	__property OnConfirmSave;
	__property OnLoad;
	__property OnProcessItemFailure;
	__property OnRequestBlankDisk;
	__property OnRequestImage;
	__property OnRequestLastDisk;
	__property OnRequestNthDisk;
	__property OnSave;
	__property Password = {default=0};
	__property StoreOptions = {default=5};
	__property TempDirectory = {default=0};
	__property Version = {default=0};
	__property FileName = {default=0};
public:
	/* TAbCustomZipper.Create */ inline __fastcall virtual TAbZipper(System::Classes::TComponent* AOwner) : TAbCustomZipper(AOwner) { }
	/* TAbCustomZipper.Destroy */ inline __fastcall virtual ~TAbZipper(void) { }

};

#pragma pack(pop)

//-- var, const, procedure ---------------------------------------------------
}	/* namespace Abzipper */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_ABZIPPER)
using namespace Abzipper;
#endif
#pragma pack(pop)
#pragma option pop

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// AbzipperHPP


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
org.apache.hadoop.hbase.generated.rest (HBase 0.94.8 API)
</TITLE>

<META NAME="date" CONTENT="2013-05-22">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

org.apache.hadoop.hbase.generated.rest

Classes

rest_jsp


text:
<?php

use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\Route;

$collection = new RouteCollection();

$collection->add('us_cook_book_homepage', new Route('/hello/{name}', array(
    '_controller' => 'USCookBookBundle:Default:index',
)));

return $collection;


text:
<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "rankings".
 *
 * @property integer $rankingId
 * @property integer $teamId
 * @property string $gamesWon
 * @property string $gamesLost
 * @property string $gamesDraw
 * @property string $goalsAgainst
 * @property string $goalsMade
 * @property integer $seasonId
 */
class Ranking extends \yii\db\ActiveRecord
{
	/**
	 * @inheritdoc
	 */
	public static function tableName()
	{
		return 'rankings';
	}

	/**
	 * @inheritdoc
	 */
	public function rules()
	{
		return [
			[['teamId', 'seasonId'], 'integer'],
			[['gamesWon', 'gamesLost', 'gamesDraw', 'goalsAgainst', 'goalsMade'], 'string', 'max' => 45]
		];
	}

	/**
	 * @inheritdoc
	 */
	public function attributeLabels()
	{
		return [
			'rankingId' => 'Ranking ID',
			'teamId' => 'Team ID',
			'gamesWon' => 'Games Won',
			'gamesLost' => 'Games Lost',
			'gamesDraw' => 'Games Draw',
			'goalsAgainst' => 'Goals Against',
			'goalsMade' => 'Goals Made',
			'seasonId' => 'Season ID',
		];
	}

	/**
	 * @relations
	 */

	public function getSeason()
	{
		return $this->hasOne(Season::className(), ['seasonId' => 'seasonId']);
	}

	public function getTeam()
	{
		return $this->hasOne(Team::className(), ['teamId' => 'teamId']);
	}

	public function calculatePoints()
	{
		$iPoints = 0;
		$iPoints += $this->gamesWon*3;
		$iPoints += $this->gamesDraw;

		return $iPoints;
	}
    public function calculateMatchPlayed()
    {
        $iMatchPlayed = 0;
        $iMatchPlayed += $this->gamesWon;
        $iMatchPlayed += $this->gamesDraw;
        $iMatchPlayed += $this->gamesLost;

        return $iMatchPlayed;
    }

}