text:
namespace extensions {
class ExtensionRegistry;
}

// Chrome OS implementation of a delegate that provides UI code in ash with
// access to the VPN providers enabled in the primary user's profile.
class VPNDelegateChromeOS : public ash::VPNDelegate,
                            public extensions::ExtensionRegistryObserver,
                            public content::NotificationObserver {
 public:
  VPNDelegateChromeOS();
  ~VPNDelegateChromeOS() override;

  // ash::VPNDelegate:
  bool HaveThirdPartyVPNProviders() const override;
  const std::vector<ash::VPNProvider>& GetVPNProviders() const override;
  void ShowAddPage(const ash::VPNProvider::Key& key) override;

  // extensions::ExtensionRegistryObserver:
  void OnExtensionLoaded(content::BrowserContext* browser_context,
                         const extensions::Extension* extension) override;
  void OnExtensionUnloaded(
      content::BrowserContext* browser_context,
      const extensions::Extension* extension,
      extensions::UnloadedExtensionInfo::Reason reason) override;
  void OnShutdown(extensions::ExtensionRegistry* registry) override;

  // content::NotificationObserver:
  void Observe(int type,
               const content::NotificationSource& source,
               const content::NotificationDetails& details) override;

 private:
  // Retrieves the current list of VPN providers enabled in the primary user's
  // profile and notifies observers that it has changed. Must only be called
  // when a user is logged in and the primary user's extension registry is being
  // observed.
  void UpdateVPNProviders();

  // Starts observing the primary user's extension registry to detect changes to
  // the list of VPN providers enabled in the user's profile and caches the
  // initial list. Must only be called when a user is logged in.
  void AttachToPrimaryUserExtensionRegistry();

  // The primary user's extension registry, if a user is logged in.
  extensions::ExtensionRegistry* extension_registry_ = nullptr;

  // A cache of the VPN providers enabled in the primary user's profile.
  std::vector<ash::VPNProvider> vpn_providers_;

  content::NotificationRegistrar registrar_;

  base::WeakPtrFactory<VPNDelegateChromeOS> weak_factory_;

  DISALLOW_COPY_AND_ASSIGN(VPNDelegateChromeOS);
};

#endif  // CHROME_BROWSER_UI_ASH_VPN_DELEGATE_CHROMEOS_H_


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Code Coverage for /home/pedro/Code/Todos/TodosBackend/app/Repositories/Contracts</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="../../css/bootstrap.min.css" rel="stylesheet">
  <link href="../../css/style.css" rel="stylesheet">

/home/pedro/Code/Todos/TodosBackend/app

Repositories

Contracts

(Dashboard)

Code Coverage

Lines

Functions and Methods

Classes and Traits

      Total

n/a

0 / 0

n/a

0 / 0

n/a

0 / 0

       Repository.php

n/a

0 / 0

n/a

0 / 0

n/a

0 / 0

Legend

     Low: 0% to 50%
     Medium: 50% to 90%
     High: 90% to 100%

     Generated by php-code-coverage 4.0.5 using PHP 7.0.15-0ubuntu0.16.04.2 with Xdebug 2.5.0rc1 and PHPUnit 5.7.8 at Fri Mar 3 15:05:43 UTC 2017.

redpajama_set_name: RedPajamaGithub


text: ALTER TABLE packages DROP COLUMN max_version;


text:
/**
 */
package gluemodel.CIM.IEC61968.Customers;

import gluemodel.CIM.IEC61968.Common.Document;

import gluemodel.CIM.IEC61968.Metering.ServiceDeliveryPoint;

import gluemodel.CIM.IEC61968.PaymentMetering.Transaction;

import gluemodel.CIM.IEC61970.Informative.InfCustomers.PowerQualityPricing;
import gluemodel.CIM.IEC61970.Informative.InfCustomers.SubscribePowerCurve;

import org.eclipse.emf.common.util.EList;

/**
 *
 * A representation of the model object 'Pricing Structure'.
 *
 *
 *

 * The following features are supported:
 *

 *

 *
{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#getCode Code}

 *
{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#isTaxExemption Tax Exemption}

 *
{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#getServiceCategory Service Category}

 *
{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#getCustomerAgreements Customer Agreements}

 *
{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#getDailyFloorUsage Daily Floor Usage}

 *
{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#getRevenueKind Revenue Kind}

 *
{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#getPowerQualityPricings Power Quality Pricings}

 *
{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#getTariffs Tariffs}

 *
{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#getServiceDeliveryPoints Service Delivery Points}

 *
{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#getDailyCeilingUsage Daily Ceiling Usage}

 *
{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#getSubscribePowerCurve Subscribe Power Curve}

 *
{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#getDailyEstimatedUsage Daily Estimated Usage}

 *
{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#getTransactions Transactions}

 *

 *
 * @see gluemodel.CIM.IEC61968.Customers.CustomersPackage#getPricingStructure()
 * @model annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='Grouping of pricing components and prices used in the creation of customer charges and the eligibility criteria under which these terms may be offered to a customer. The reasons for grouping include state, customer classification, site characteristics, classification (i.e. fee price structure, deposit price structure, electric service price structure, etc.) and accounting requirements.'"
 *        annotation="http://langdale.com.au/2005/UML Profile\040documentation='Grouping of pricing components and prices used in the creation of customer charges and the eligibility criteria under which these terms may be offered to a customer. The reasons for grouping include state, customer classification, site characteristics, classification (i.e. fee price structure, deposit price structure, electric service price structure, etc.) and accounting requirements.'"
 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='Grouping of pricing components and prices used in the creation of customer charges and the eligibility criteria under which these terms may be offered to a customer. The reasons for grouping include state, customer classification, site characteristics, classification (i.e. fee price structure, deposit price structure, electric service price structure, etc.) and accounting requirements.' Profile\040documentation='Grouping of pricing components and prices used in the creation of customer charges and the eligibility criteria under which these terms may be offered to a customer. The reasons for grouping include state, customer classification, site characteristics, classification (i.e. fee price structure, deposit price structure, electric service price structure, etc.) and accounting requirements.'"
 * @generated
 */
public interface PricingStructure extends Document {
	/**
	 * Returns the value of the 'Code' attribute.
	 *
	 *

	 * If the meaning of the 'Code' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Code' attribute.
	 * @see #setCode(String)
	 * @see gluemodel.CIM.IEC61968.Customers.CustomersPackage#getPricingStructure_Code()
	 * @model required="true"
	 *        annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='Unique user-allocated key for this pricing structure, used by company representatives to identify the correct price structure for allocating to a customer. For rate schedules it is often prefixed by a state code.'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='Unique user-allocated key for this pricing structure, used by company representatives to identify the correct price structure for allocating to a customer. For rate schedules it is often prefixed by a state code.'"
	 * @generated
	 */
	String getCode();

	/**
	 * Sets the value of the '{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#getCode Code}' attribute.
	 *
	 *
	 * @param value the new value of the 'Code' attribute.
	 * @see #getCode()
	 * @generated
	 */
	void setCode(String value);

	/**
	 * Returns the value of the 'Tax Exemption' attribute.
	 *
	 *

	 * If the meaning of the 'Tax Exemption' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Tax Exemption' attribute.
	 * @see #setTaxExemption(boolean)
	 * @see gluemodel.CIM.IEC61968.Customers.CustomersPackage#getPricingStructure_TaxExemption()
	 * @model required="true"
	 *        annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='True if this pricing structure is not taxable.'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='True if this pricing structure is not taxable.'"
	 * @generated
	 */
	boolean isTaxExemption();

	/**
	 * Sets the value of the '{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#isTaxExemption Tax Exemption}' attribute.
	 *
	 *
	 * @param value the new value of the 'Tax Exemption' attribute.
	 * @see #isTaxExemption()
	 * @generated
	 */
	void setTaxExemption(boolean value);

	/**
	 * Returns the value of the 'Service Category' reference.
	 * It is bidirectional and its opposite is '{@link gluemodel.CIM.IEC61968.Customers.ServiceCategory#getPricingStructures Pricing Structures}'.
	 *
	 *

	 * If the meaning of the 'Service Category' reference isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Service Category' reference.
	 * @see #setServiceCategory(ServiceCategory)
	 * @see gluemodel.CIM.IEC61968.Customers.CustomersPackage#getPricingStructure_ServiceCategory()
	 * @see gluemodel.CIM.IEC61968.Customers.ServiceCategory#getPricingStructures
	 * @model opposite="PricingStructures"
	 *        annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='Service category to which this pricing structure applies.'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='Service category to which this pricing structure applies.'"
	 * @generated
	 */
	ServiceCategory getServiceCategory();

	/**
	 * Sets the value of the '{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#getServiceCategory Service Category}' reference.
	 *
	 *
	 * @param value the new value of the 'Service Category' reference.
	 * @see #getServiceCategory()
	 * @generated
	 */
	void setServiceCategory(ServiceCategory value);

	/**
	 * Returns the value of the 'Customer Agreements' reference list.
	 * The list contents are of type {@link gluemodel.CIM.IEC61968.Customers.CustomerAgreement}.
	 * It is bidirectional and its opposite is '{@link gluemodel.CIM.IEC61968.Customers.CustomerAgreement#getPricingStructures Pricing Structures}'.
	 *
	 *

	 * If the meaning of the 'Customer Agreements' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Customer Agreements' reference list.
	 * @see gluemodel.CIM.IEC61968.Customers.CustomersPackage#getPricingStructure_CustomerAgreements()
	 * @see gluemodel.CIM.IEC61968.Customers.CustomerAgreement#getPricingStructures
	 * @model opposite="PricingStructures"
	 *        annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='All customer agreements with this pricing structure.'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='All customer agreements with this pricing structure.'"
	 * @generated
	 */
	EList<CustomerAgreement> getCustomerAgreements();

	/**
	 * Returns the value of the 'Daily Floor Usage' attribute.
	 *
	 *

	 * If the meaning of the 'Daily Floor Usage' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Daily Floor Usage' attribute.
	 * @see #setDailyFloorUsage(int)
	 * @see gluemodel.CIM.IEC61968.Customers.CustomersPackage#getPricingStructure_DailyFloorUsage()
	 * @model required="true"
	 *        annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='Absolute minimum valid non-demand usage quantity used in validating a customer\'s billed non-demand usage.'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='Absolute minimum valid non-demand usage quantity used in validating a customer\'s billed non-demand usage.'"
	 * @generated
	 */
	int getDailyFloorUsage();

	/**
	 * Sets the value of the '{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#getDailyFloorUsage Daily Floor Usage}' attribute.
	 *
	 *
	 * @param value the new value of the 'Daily Floor Usage' attribute.
	 * @see #getDailyFloorUsage()
	 * @generated
	 */
	void setDailyFloorUsage(int value);

	/**
	 * Returns the value of the 'Revenue Kind' attribute.
	 * The literals are from the enumeration {@link gluemodel.CIM.IEC61968.Customers.RevenueKind}.
	 *
	 *

	 * If the meaning of the 'Revenue Kind' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Revenue Kind' attribute.
	 * @see gluemodel.CIM.IEC61968.Customers.RevenueKind
	 * @see #setRevenueKind(RevenueKind)
	 * @see gluemodel.CIM.IEC61968.Customers.CustomersPackage#getPricingStructure_RevenueKind()
	 * @model annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='(Accounting) Kind of revenue, often used to determine the grace period allowed, before collection actions are taken on a customer (grace periods vary between revenue classes).'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='(Accounting) Kind of revenue, often used to determine the grace period allowed, before collection actions are taken on a customer (grace periods vary between revenue classes).'"
	 * @generated
	 */
	RevenueKind getRevenueKind();

	/**
	 * Sets the value of the '{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#getRevenueKind Revenue Kind}' attribute.
	 *
	 *
	 * @param value the new value of the 'Revenue Kind' attribute.
	 * @see gluemodel.CIM.IEC61968.Customers.RevenueKind
	 * @see #getRevenueKind()
	 * @generated
	 */
	void setRevenueKind(RevenueKind value);

	/**
	 * Returns the value of the 'Power Quality Pricings' reference list.
	 * The list contents are of type {@link gluemodel.CIM.IEC61970.Informative.InfCustomers.PowerQualityPricing}.
	 * It is bidirectional and its opposite is '{@link gluemodel.CIM.IEC61970.Informative.InfCustomers.PowerQualityPricing#getPricingStructure Pricing Structure}'.
	 *
	 *

	 * If the meaning of the 'Power Quality Pricings' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Power Quality Pricings' reference list.
	 * @see gluemodel.CIM.IEC61968.Customers.CustomersPackage#getPricingStructure_PowerQualityPricings()
	 * @see gluemodel.CIM.IEC61970.Informative.InfCustomers.PowerQualityPricing#getPricingStructure
	 * @model opposite="PricingStructure"
	 * @generated
	 */
	EList<PowerQualityPricing> getPowerQualityPricings();

	/**
	 * Returns the value of the 'Tariffs' reference list.
	 * The list contents are of type {@link gluemodel.CIM.IEC61968.Customers.Tariff}.
	 * It is bidirectional and its opposite is '{@link gluemodel.CIM.IEC61968.Customers.Tariff#getPricingStructures Pricing Structures}'.
	 *
	 *

	 * If the meaning of the 'Tariffs' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Tariffs' reference list.
	 * @see gluemodel.CIM.IEC61968.Customers.CustomersPackage#getPricingStructure_Tariffs()
	 * @see gluemodel.CIM.IEC61968.Customers.Tariff#getPricingStructures
	 * @model opposite="PricingStructures"
	 *        annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='All tariffs used by this pricing structure.'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='All tariffs used by this pricing structure.'"
	 * @generated
	 */
	EList<Tariff> getTariffs();

	/**
	 * Returns the value of the 'Service Delivery Points' reference list.
	 * The list contents are of type {@link gluemodel.CIM.IEC61968.Metering.ServiceDeliveryPoint}.
	 * It is bidirectional and its opposite is '{@link gluemodel.CIM.IEC61968.Metering.ServiceDeliveryPoint#getPricingStructures Pricing Structures}'.
	 *
	 *

	 * If the meaning of the 'Service Delivery Points' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Service Delivery Points' reference list.
	 * @see gluemodel.CIM.IEC61968.Customers.CustomersPackage#getPricingStructure_ServiceDeliveryPoints()
	 * @see gluemodel.CIM.IEC61968.Metering.ServiceDeliveryPoint#getPricingStructures
	 * @model opposite="PricingStructures"
	 *        annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='All service delivery points (with prepayment meter running as a stand-alone device, with no CustomerAgreement or Customer) to which this pricing structure applies.'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='All service delivery points (with prepayment meter running as a stand-alone device, with no CustomerAgreement or Customer) to which this pricing structure applies.'"
	 * @generated
	 */
	EList<ServiceDeliveryPoint> getServiceDeliveryPoints();

	/**
	 * Returns the value of the 'Daily Ceiling Usage' attribute.
	 *
	 *

	 * If the meaning of the 'Daily Ceiling Usage' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Daily Ceiling Usage' attribute.
	 * @see #setDailyCeilingUsage(int)
	 * @see gluemodel.CIM.IEC61968.Customers.CustomersPackage#getPricingStructure_DailyCeilingUsage()
	 * @model required="true"
	 *        annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='Absolute maximum valid non-demand usage quantity used in validating a customer\'s billed non-demand usage.'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='Absolute maximum valid non-demand usage quantity used in validating a customer\'s billed non-demand usage.'"
	 * @generated
	 */
	int getDailyCeilingUsage();

	/**
	 * Sets the value of the '{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#getDailyCeilingUsage Daily Ceiling Usage}' attribute.
	 *
	 *
	 * @param value the new value of the 'Daily Ceiling Usage' attribute.
	 * @see #getDailyCeilingUsage()
	 * @generated
	 */
	void setDailyCeilingUsage(int value);

	/**
	 * Returns the value of the 'Subscribe Power Curve' reference.
	 * It is bidirectional and its opposite is '{@link gluemodel.CIM.IEC61970.Informative.InfCustomers.SubscribePowerCurve#getPricingStructure Pricing Structure}'.
	 *
	 *

	 * If the meaning of the 'Subscribe Power Curve' reference isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Subscribe Power Curve' reference.
	 * @see #setSubscribePowerCurve(SubscribePowerCurve)
	 * @see gluemodel.CIM.IEC61968.Customers.CustomersPackage#getPricingStructure_SubscribePowerCurve()
	 * @see gluemodel.CIM.IEC61970.Informative.InfCustomers.SubscribePowerCurve#getPricingStructure
	 * @model opposite="PricingStructure"
	 *        annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='SubscribePowerCurve specifies the cost according to a prcing structure.'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='SubscribePowerCurve specifies the cost according to a prcing structure.'"
	 * @generated
	 */
	SubscribePowerCurve getSubscribePowerCurve();

	/**
	 * Sets the value of the '{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#getSubscribePowerCurve Subscribe Power Curve}' reference.
	 *
	 *
	 * @param value the new value of the 'Subscribe Power Curve' reference.
	 * @see #getSubscribePowerCurve()
	 * @generated
	 */
	void setSubscribePowerCurve(SubscribePowerCurve value);

	/**
	 * Returns the value of the 'Daily Estimated Usage' attribute.
	 *
	 *

	 * If the meaning of the 'Daily Estimated Usage' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Daily Estimated Usage' attribute.
	 * @see #setDailyEstimatedUsage(int)
	 * @see gluemodel.CIM.IEC61968.Customers.CustomersPackage#getPricingStructure_DailyEstimatedUsage()
	 * @model required="true"
	 *        annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='Used in place of actual computed estimated average when history of usage is not available, and typically manually entered by customer accounting.'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='Used in place of actual computed estimated average when history of usage is not available, and typically manually entered by customer accounting.'"
	 * @generated
	 */
	int getDailyEstimatedUsage();

	/**
	 * Sets the value of the '{@link gluemodel.CIM.IEC61968.Customers.PricingStructure#getDailyEstimatedUsage Daily Estimated Usage}' attribute.
	 *
	 *
	 * @param value the new value of the 'Daily Estimated Usage' attribute.
	 * @see #getDailyEstimatedUsage()
	 * @generated
	 */
	void setDailyEstimatedUsage(int value);

	/**
	 * Returns the value of the 'Transactions' reference list.
	 * The list contents are of type {@link gluemodel.CIM.IEC61968.PaymentMetering.Transaction}.
	 * It is bidirectional and its opposite is '{@link gluemodel.CIM.IEC61968.PaymentMetering.Transaction#getPricingStructure Pricing Structure}'.
	 *
	 *

	 * If the meaning of the 'Transactions' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Transactions' reference list.
	 * @see gluemodel.CIM.IEC61968.Customers.CustomersPackage#getPricingStructure_Transactions()
	 * @see gluemodel.CIM.IEC61968.PaymentMetering.Transaction#getPricingStructure
	 * @model opposite="PricingStructure"
	 *        annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='All transactions applying this pricing structure.'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='All transactions applying this pricing structure.'"
	 * @generated
	 */
	EList<Transaction> getTransactions();

} // PricingStructure


text:
/*
 * ====================================================================
 * Configuration information for httpd.conf:
 * ====================================================================
	<Location /xslt>
			AddHandler mod_xslt .html
			AddHandler mod_xslt .txt
	</Location>
 * ====================================================================
*/
#include "httpd.h"
#include "http_config.h"
#include "http_protocol.h"
#include "http_log.h"
#include "util_script.h"
#include "http_main.h"
#include "http_request.h"

#include <xalanc/XalanTransformer/XalanCAPI.h>

static void xslt_init(server_rec *s, pool *p)
{
	ap_add_version_component("mod_xslt/Xalan/1.0");
}

static void xslt_child_init(server_rec *s, pool *p)
{
	XalanInitialize();
}

static void xslt_child_exit(server_rec *s, pool *p)
{
	XalanTerminate(1);
}

typedef struct CONTROL_STRUCT_TAG
{
	request_rec*	r;
	int				fHeaderSent;
} CONTROL_STRUCT;

static CallbackSizeType xalan_output_handler(const char *data, CallbackSizeType length, void *handle)
{
	CONTROL_STRUCT* c = (CONTROL_STRUCT*)handle;

	if (c->fHeaderSent == 0)
	{
		c->fHeaderSent = 1;

		ap_send_http_header(c->r);
	}

	return ap_rwrite(data, length, c->r);
}

static void xalan_flush_handler(void *handle)
{
	CONTROL_STRUCT* c = (CONTROL_STRUCT*)handle;

	ap_rflush(c->r);
}

static int xslt_handler(request_rec *r)
{
	char * mimetype		= NULL;
	char * filename		= NULL;
	char * xmlfilename	= NULL;
	char * xslfilename	= NULL;

	XalanHandle xalan = NULL;

	int i;
	int dot_point;

	int	error = DECLINED;

	CONTROL_STRUCT	control_struct =
	{
		0,
		0
	};

	control_struct.r = r;

	mimetype = ap_pstrcat(r->pool, r->filename, NULL);

    /* Find the extension without any assumptions on string.h */

    dot_point = 0;
	i = 0;

    while (mimetype[i] != '\0') {
        if (mimetype[i] == '.')
             dot_point = i;
        ++i;
    }

    if (dot_point == 0) {

        fprintf(stderr, "Unable to find extension of : %s\n", mimetype);
        r->uri = mimetype;

        return DECLINED;
    }

    filename = ap_pstrndup(r->pool, r->filename,dot_point);

	xmlfilename = ap_pstrcat(r->pool,filename,".xml",NULL);

	xslfilename = ap_pstrcat(r->pool,filename,".xsl",NULL);

	xalan = CreateXalanTransformer();

	error = XalanTransformToHandler(xmlfilename, xslfilename, xalan, &control_struct, xalan_output_handler, xalan_flush_handler);

	if(error)
	{
	    const char* const	msg = XalanGetLastError(xalan);

	    fprintf(stderr,"mod_xslt: %s: %s\n", r->filename, msg);

		r->uri = filename;

		return DECLINED;
	}

	DeleteXalanTransformer(xalan);

	return OK;
}

static const handler_rec xslt_handlers[] =
{
    {"mod_xslt", xslt_handler},
    {NULL, NULL}
};

module MODULE_VAR_EXPORT xslt_module =
{
    STANDARD_MODULE_STUFF,
    xslt_init,		/* initializer */
    NULL,			/* create per-directory config structure */
    NULL,			/* merge per-directory config structures */
    NULL,			/* create per-server config structure */
    NULL,			/* merge per-server config structures */
    NULL,			/* command table */
    xslt_handlers,	/* handlers */
    NULL,			/* translate_handler */
    NULL,			/* check_user_id */
    NULL,			/* check auth */
    NULL,			/* check access */
    NULL,			/* type_checker */
    NULL,			/* pre-run fixups */
    NULL,			/* logger */
    NULL,			/* header parser */
    xslt_child_init,/* child_init */
    xslt_child_exit,/* child_exit */
    NULL			/* post read-request */
};


text:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import time

import ray
from ray.tests.cluster_utils import Cluster
from ray.tests.utils import run_string_as_driver

num_redis_shards = 5
redis_max_memory = 10**8
object_store_memory = 10**8
num_nodes = 4

message = ("Make sure there is enough memory on this machine to run this "
           "workload. We divide the system memory by 2 to provide a buffer.")
assert (num_nodes * object_store_memory + num_redis_shards * redis_max_memory <
        ray.utils.get_system_memory() / 2)

# Simulate a cluster on one machine.

cluster = Cluster()
for i in range(num_nodes):
    cluster.add_node(
        redis_port=6379 if i == 0 else None,
        num_redis_shards=num_redis_shards if i == 0 else None,
        num_cpus=4,
        num_gpus=0,
        resources={str(i): 5},
        object_store_memory=object_store_memory,
        redis_max_memory=redis_max_memory)
ray.init(redis_address=cluster.redis_address)

# Run the workload.

# Define a driver script that runs a few tasks and actors on each node in the
# cluster.
driver_script = """
import ray

ray.init(redis_address="{}")

num_nodes = {}

@ray.remote
def f():
    return 1

@ray.remote
class Actor(object):
    def method(self):
        return 1

for _ in range(5):
    for i in range(num_nodes):
        assert (ray.get(
            f._remote(args=[], kwargs={{}}, resources={{str(i): 1}})) == 1)
        actor = Actor._remote(args=[], kwargs={{}}, resources={{str(i): 1}})
        assert ray.get(actor.method.remote()) == 1

print("success")
""".format(cluster.redis_address, num_nodes)

@ray.remote
def run_driver():
    output = run_string_as_driver(driver_script)
    assert "success" in output

iteration = 0
running_ids = [
    run_driver._remote(
        args=[], kwargs={}, num_cpus=0, resources={str(i): 0.01})
    for i in range(num_nodes)
]
start_time = time.time()
previous_time = start_time
while True:
    # Wait for a driver to finish and start a new driver.
    [ready_id], running_ids = ray.wait(running_ids, num_returns=1)
    ray.get(ready_id)

    running_ids.append(
        run_driver._remote(
            args=[],
            kwargs={},
            num_cpus=0,
            resources={str(iteration % num_nodes): 0.01}))

    new_time = time.time()
    print("Iteration {}:\n"
          "  - Iteration time: {}.\n"
          "  - Absolute time: {}.\n"
          "  - Total elapsed time: {}.".format(
              iteration, new_time - previous_time, new_time,
              new_time - start_time))
    previous_time = new_time
    iteration += 1


text:
import unittest
from odf import draw, svg

from odf.element import IllegalChild

class TestDrawElements(unittest.TestCase):

    def testNoName(self):
        """ Check that 'name' is required """
        self.assertRaises(AttributeError, draw.FillImage, href="y")

    def testFloatingPoints(self):
        """ Points that are floating point are not allowed """
        self.assertRaises(ValueError, draw.Polygon, points='0.0000,0.0000 -30.9017,95.1057', viewbox="-1000 -1000 1000 1000")
        self.assertRaises(ValueError, draw.Polygon, points='0.0000,0.0000 -30,95.7', viewbox="-1000 -1000 1000 1000")

    def testViewbox(self):
        """ ViewBox can only have four integer values """
        self.assertRaises(ValueError, draw.Polygon, points='0,0 -30,957', viewbox="-1000.0 -1000.0 1000 1000")
        self.assertRaises(ValueError, draw.Polygon, points='0,0 -30,957', viewbox="-1000 -1000 1000 1000.1")
        self.assertRaises(ValueError, draw.Polygon, points='0,0 -30,957', viewbox="-1000 -1000 1000")

    def testIntPoints(self):
        """ Points can only be integers """
        draw.Polygon(points='0,0 -31,95', viewbox="-1000 -1000 1000 1000")

    def testCalls(self):
        """ Simple calls """
        self.assertRaises(TypeError, draw.FillImage, "x", href="y")
        draw.FillImage(name="x", href="y", type="simple")
        self.assertRaises(TypeError, draw.Gradient, "x", style="y")
        self.assertRaises(TypeError, draw.Hatch, "x", style="y")
        self.assertRaises(TypeError, draw.Marker, "x",d="y",viewbox="0 0 100 100")
        self.assertRaises(TypeError, draw.Opacity, "x", style="y")
        self.assertRaises(TypeError, draw.StrokeDash, "x")
        self.assertRaises(TypeError, svg.Lineargradient, "x")
        self.assertRaises(TypeError, svg.Radialgradient, "x")

if __name__ == '__main__':
    unittest.main()


text:
from random import randint

def partition(unsorted, start, end):
    """Return final resting place of pivot; RIP sweet pivot."""
    pivot_index = choose_pivot(start, end)
    pivot = unsorted[pivot_index]

    # move pivot to beginning for logic
    unsorted[start], unsorted[pivot_index] = unsorted[pivot_index], unsorted[start]
    i = start + 1
    j = start + 1

    # move elements less than pivot to the left so the pivot can be swapped later
    while j < end:
        if unsorted[j] < pivot:
            unsorted[j], unsorted[i] = unsorted[i], unsorted[j]
            i = i + 1
        j = j + 1

    # swat pivot and last number < it; pivot is now in it's proper place
    unsorted[start], unsorted[i - 1] = unsorted[i - 1], unsorted[start]
    return i - 1

def choose_pivot(start, end):
    """Input start and end locations of list and return a random number between the 2."""
    pivot = randint(start, end)
    return pivot

def quicksort(unsorted, start=0, end=None):
    """Return sorted list."""
    if end == None:
        end = len(unsorted) - 1

    # return sorted list
    if end - start < 1:
        return unsorted

    pivot_index = partition(unsorted, start, end)

    # recursively sort everything and return it
    quicksort(unsorted, start, pivot_index - 1)
    quicksort(unsorted, pivot_index + 1, end)


text:
Full DOM rendering is ideal for use cases where you have components that may interact with DOM apis,
or may require the full lifecycle in order to fully test the component (ie, `componentDidMount`
etc.)

Full DOM rendering requires that a full DOM API be available at the global scope. This means that
it must be run in an environment that at least "looks like" a browser environment. If you do not
want to run your tests inside of a browser, the recommended approach to using `mount` is to depend
on a library called [jsdom](https://github.com/tmpvar/jsdom) which is essentially a headless browser
implemented completely in JS.

```jsx
import { mount } from 'enzyme';

describe('<Foo />', () => {

  it('calls componentDidMount', () => {
    spy(Foo.prototype, 'componentDidMount');
    const wrapper = mount(<Foo />);
    expect(Foo.prototype.componentDidMount.calledOnce).to.equal(true);
  });

  it('allows us to set props', () => {
    const wrapper = mount(<Foo bar="baz" />);
    expect(wrapper.props().bar).to.equal("baz");
    wrapper.setProps({ bar: "foo" });
    expect(wrapper.props().bar).to.equal("foo");
  });

  it('simulates click events', () => {
    const onButtonClick = spy();
    const wrapper = mount(
      <Foo onButtonClick={onButtonClick} />
    );
    wrapper.find('button').simulate('click');
    expect(onButtonClick.calledOnce).to.equal(true);
  });

});
```

## `mount(node[, options]) => ReactWrapper`

#### Arguments

1. `node` (`ReactElement`): The node to render
2. `options` (`Object` [optional]):
- `options.context`: (`Object` [optional]): Context to be passed into the component
- `options.attachTo`: (`DOMElement` [optional]): DOM Element to attach the component to.
- `options.childContextTypes`: (`Object` [optional]): Merged contextTypes for all children of the wrapper.

#### Returns

`ReactWrapper`: The wrapper instance around the rendered output.

## ReactWrapper API

#### [`.find(selector) => ReactWrapper`](ReactWrapper/find.md)
Find every node in the render tree that matches the provided selector.

#### [`.findWhere(predicate) => ReactWrapper`](ReactWrapper/findWhere.md)
Find every node in the render tree that return true for the provided predicate function.

#### [`.filter(selector) => ReactWrapper`](ReactWrapper/filter.md)
Remove nodes in the current wrapper that do not match the provided selector.

#### [`.filterWhere(predicate) => ReactWrapper`](ReactWrapper/filterWhere.md)
Remove nodes in the current wrapper that do not return true for the provided predicate function.

#### [`.contains(nodeOrNodes) => Boolean`](ReactWrapper/contains.md)
Returns whether or not a given node or array of nodes is somewhere in the render tree.

#### [`.containsMatchingElement(node) => Boolean`](ReactWrapper/containsMatchingElement.md)
Returns whether or not a given react element is somewhere in the render tree.

#### [`.containsAllMatchingElements(nodes) => Boolean`](ReactWrapper/containsAllMatchingElements.md)
Returns whether or not all the given react elements are somewhere in the render tree.

#### [`.containsAnyMatchingElements(nodes) => Boolean`](ReactWrapper/containsAnyMatchingElements.md)
Returns whether or not one of the given react elements is somewhere in the render tree.

#### [`.hasClass(className) => Boolean`](ReactWrapper/hasClass.md)
Returns whether or not the current root node has the given class name or not.

#### [`.is(selector) => Boolean`](ReactWrapper/is.md)
Returns whether or not the current node matches a provided selector.

#### [`.isEmpty() => Boolean`](ReactWrapper/isEmpty.md)
Returns whether or not the current node is empty.

#### [`.not(selector) => ReactWrapper`](ReactWrapper/not.md)
Remove nodes in the current wrapper that match the provided selector. (inverse of `.filter()`)

#### [`.children() => ReactWrapper`](ReactWrapper/children.md)
Get a wrapper with all of the children nodes of the current wrapper.

#### [`.childAt() => ReactWrapper`](ReactWrapper/childAt.md)
Returns a new wrapper with child at the specified index.

#### [`.parents() => ReactWrapper`](ReactWrapper/parents.md)
Get a wrapper with all of the parents (ancestors) of the current node.

#### [`.parent() => ReactWrapper`](ReactWrapper/parent.md)
Get a wrapper with the direct parent of the current node.

#### [`.closest(selector) => ReactWrapper`](ReactWrapper/closest.md)
Get a wrapper with the first ancestor of the current node to match the provided selector.

#### [`.render() => CheerioWrapper`](ReactWrapper/render.md)
Returns a CheerioWrapper of the current node's subtree.

#### [`.text() => String`](ReactWrapper/text.md)
Returns a string representation of the text nodes in the current render tree.

#### [`.html() => String`](ReactWrapper/html.md)
Returns a static HTML rendering of the current node.

#### [`.get(index) => ReactElement`](ReactWrapper/get.md)
Returns the node at the provided index of the current wrapper.

#### [`.at(index) => ReactWrapper`](ReactWrapper/at.md)
Returns a wrapper of the node at the provided index of the current wrapper.

#### [`.first() => ReactWrapper`](ReactWrapper/first.md)
Returns a wrapper of the first node of the current wrapper.

#### [`.last() => ReactWrapper`](ReactWrapper/last.md)
Returns a wrapper of the last node of the current wrapper.

#### [`.state([key]) => Any`](ReactWrapper/state.md)
Returns the state of the root component.

#### [`.context([key]) => Any`](ReactWrapper/context.md)
Returns the context of the root component.

#### [`.props() => Object`](ReactWrapper/props.md)
Returns the props of the root component.

#### [`.prop(key) => Any`](ReactWrapper/prop.md)
Returns the named prop of the root component.

#### [`.key() => String`](ReactWrapper/key.md)
Returns the key of the root component.

#### [`.simulate(event[, mock]) => ReactWrapper`](ReactWrapper/simulate.md)
Simulates an event on the current node.

#### [`.setState(nextState) => ReactWrapper`](ReactWrapper/setState.md)
Manually sets state of the root component.

#### [`.setProps(nextProps) => ReactWrapper`](ReactWrapper/setProps.md)
Manually sets props of the root component.

#### [`.setContext(context) => ReactWrapper`](ReactWrapper/setContext.md)
Manually sets context of the root component.

#### [`.instance() => ReactComponent`](ReactWrapper/instance.md)
Returns the instance of the root component.

#### [`.unmount() => ReactWrapper`](ReactWrapper/unmount.md)
A method that un-mounts the component.

#### [`.mount() => ReactWrapper`](ReactWrapper/mount.md)
A method that re-mounts the component.

#### [`.update() => ReactWrapper`](ReactWrapper/update.md)
Calls `.forceUpdate()` on the root component instance.

#### [`.debug() => String`](ReactWrapper/debug.md)
Returns a string representation of the current render tree for debugging purposes.

#### [`.type() => String|Function`](ReactWrapper/type.md)
Returns the type of the current node of the wrapper.

#### [`.name() => String`](ReactWrapper/name.md)
Returns the name of the current node of the wrapper.

#### [`.forEach(fn) => ReactWrapper`](ReactWrapper/forEach.md)
Iterates through each node of the current wrapper and executes the provided function

#### [`.map(fn) => Array`](ReactWrapper/map.md)
Maps the current array of nodes to another array.

#### [`.matchesElement(node) => Boolean`](ReactWrapper/matchesElement.md)
Returns whether or not a given react element matches the current render tree.

#### [`.reduce(fn[, initialValue]) => Any`](/docs/api/ReactWrapper/reduce.md)
Reduces the current array of nodes to a value

#### [`.reduceRight(fn[, initialValue]) => Any`](/docs/api/ReactWrapper/reduceRight.md)
Reduces the current array of nodes to a value, from right to left.

#### [`.tap(intercepter) => Self`](ReactWrapper/tap.md)
Taps into the wrapper method chain. Helpful for debugging.

#### [`.some(selector) => Boolean`](/docs/api/ReactWrapper/some.md)
Returns whether or not any of the nodes in the wrapper match the provided selector.

#### [`.someWhere(predicate) => Boolean`](/docs/api/ReactWrapper/someWHere.md)
Returns whether or not any of the nodes in the wrapper pass the provided predicate function.

#### [`.every(selector) => Boolean`](/docs/api/ReactWrapper/every.md)
Returns whether or not all of the nodes in the wrapper match the provided selector.

#### [`.everyWhere(predicate) => Boolean`](/docs/api/ReactWrapper/everyWhere.md)
Returns whether or not all of the nodes in the wrapper pass the provided predicate function.

#### [`.ref(refName) => ReactWrapper`](/docs/api/ReactWrapper/ref.md)
Returns a wrapper of the node that matches the provided reference name.

#### [`.detach() => void`](ReactWrapper/detach.md)
Unmount the component from the DOM node it's attached to.


text:
<?php namespace Altenia\Ecofy\CoreService;

use Altenia\Ecofy\Service\BaseDataService;
use Altenia\Ecofy\Service\ValidationException;

/**
 * Service class that provides business logic for role
 */
class RoleService extends BaseDataService {

    /**
     * Constructor
     */
    public function __construct($dao, $id = 'role')
    {
        parent::__construct($dao, $id);
    }

	/**
	 * Returns list of the records.
	 *
	 * @param array $criteria     Parameters used for querying
	 * @param int   $offset       The starting record
	 * @param int   $limit        Maximum number of records to retrieve
	 * @return Response
	 */
	public function listRoles($criteria, $sortParams = array(), $offset = 0, $limit=100)
	{
		return $this->dao->query($criteria, $sortParams, $offset, $limit);
	}

	/**
	 * Returns paginated list of the records.
	 *
	 * @param array $queryParams  Parameters used for querying
	 * @param int   $page_size    The max number of entries shown per page
	 * @return Response
	 */
	public function paginateRoles($queryParams, $page_size = 20)
	{
	    // @TODO: pending
		$query = Role::query();
		$query = $this->parseQueryParams($query, $queryParams);
        $records = $query->paginate($page_size);
		return $records;
	}

    /**
	 * Returns the count of records satisfying the critieria.
	 *
	 * @param array $criteria  Parameters used for querying
	 * @return int number of records that satisfied the criteria
	 */
	public function countRoles($criteria)
	{
		return $this->dao->count($criteria);
	}

	/**
	 * Creates a new records.
	 * Mostly wrapper around insert with pre and post processing.
	 *
	 * @param array $data  Parameters used for creating a new record
	 * @return mixed  null if successful, validation object validation fails
	 */
	public function createRole($data)
	{
		$validator = Role::validator($data);
        if ($validator->passes()) {
            $record = new Role();
            $record->fill($data);

            return $this->dao->insert($record);
        } else {
            throw new ValidationException($validator);
        }
	}

	/**
	 * Retrieves a single record.
	 *
	 * @param  array $criteria  The criteria to retrieve a single record
	 * @return Role
	 */
	public function findRole($criteria)
	{
        return $dao->find($criteria);
	}

	/**
	 * Retrieves a single record.
	 *
	 * @param  int $pk  The primary key for the search
	 * @return Role
	 */
	public function findRoleByPK($pk)
	{
		return $this->dao->findByPK($pk);
	}

	/**
	 * Update the specified resource in storage.
	 *
	 * @param  int   $pk    The primary key of the record to update
	 * @param  array $data  The data of the update
	 * @return mixed null if successful, validation if validation error
	 */
	public function updateRole($pk, $data)
	{
		$validator = Role::validator($data);
        if ($validator->passes()) {

            return $this->dao->updateFields( $pk, $data );
        } else {
            throw new ValidationException($validator);
        }
	}

	/**
	 * Remove the specified resource from storage.
	 *
	 * @param  int  $pk
	 * @return Object the object that was deleted, null if not found
	 */
	public function destroyRole($pk)
	{
		return $this->dao->delete($pk);
	}

}


text:
#ifdef __linux__
#include <features.h>
#ifdef __GLIBC__
#include <malloc.h>
#endif
#endif

#include <sstream>
#include "tiledb/common/logger_public.h"

namespace tiledb {
namespace common {
void tdb_malloc_trim() {
  std::stringstream ss;
#if defined(__linux__) && defined(__GLIBC__)
  int ret = malloc_trim(0);
  ss << "malloc_trim ";
  if (ret == 0)
    ss << "did not unmap memory";
  else
    ss << "did unmap memory";
  LOG_TRACE(ss.str());
#endif
}
}  // namespace common
}  // namespace tiledb


text:
import Lib
main = basicTest $ defaultConfig { message = "Basic Test Version 2.0" }


text:
<?php

/**
 * Definition of a field.
 *
 * Children of this class must be instantiated exclusively through a factory class inherited from WPCF_Field_Definition_Factory.
 *
 * Note about field definition identification: For historical reasons, there are several, possibly equal, values available:
 * The field key (key in the associative array of field definitions), slug, id and meta_key. While the meta_key's role
 * is clear - it determines how field's data are stored in postmeta -, the first three values seem to be completely
 * identical. Since the slug is used to organize fields into groups, we will use that as the main unique identifier
 * from now on.
 *
 * @since 1.9
 */
abstract class WPCF_Field_Definition extends WPCF_Field_Definition_Abstract {

	/**
	 * For a Types field, this is a default prefix to it's slug that defines the meta_key for storing this field's values.
	 * Note that other custom fields that are brought under Types control additionally don't have to use this prefix
	 * and can have completely arbitrary meta_keys.
	 */
	const FIELD_META_KEY_PREFIX = 'wpcf-';

	const TYPE_CHECKBOXES = 'checkboxes';

	const TYPE_CHECKBOX = 'checkbox';

	/**
	 * @var WPCF_Field_Type_Definition Type definition.
	 */
	private $type;

	/**
	 * @var array The underlying array with complete information about this field.
	 * @todo We need a specification of everything that can be in it.
	 */
	/*

	Example of an field definition:

	array (
		'id' => 'field-1',
		'slug' => 'field-1',
		'type' => 'textfield',
		'name' => 'Field 1',
		'description' => '',
		'data' => array
		(
			'placeholder' => '',
			'user_default_value' => '',
			'repetitive' => '0',
			'is_new' => '1',
			'conditional_display' => array
			(
				'custom_use' => '0',
				'relation' => 'AND',
				'custom' => '',
			),
			'submit-key' => 'textfield-1955088717',
			'disabled_by_type' => 0,
			'set_value' => ... (optional, presence is relevant)
		),
		'meta_key' => 'wpcf-field-1',
		'meta_type' => 'postmeta',
		),
	); */
	private $definition_array;

	/**
	 * @var string Field slug.
	 */
	private $slug;

	/**
	 * @var string Name of the field that can be displayed to the user.
	 */
	private $name;

	/**
	 * WPCF_Field_Definition constructor.
	 *
	 * @param WPCF_Field_Type_Definition $type Field type definition.
	 * @param array $definition_array The underlying array with complete information about this field.
	 */
	public function __construct( $type, $definition_array ) {
		$this->type = $type;
		$this->definition_array = $definition_array;

		$this->slug = wpcf_getarr( $definition_array, 'slug' );
		if( sanitize_title( $this->slug ) != $this->slug ) {
			throw new InvalidArgumentException( 'Invalid slug.' );
		}

		$this->name = sanitize_text_field( wpcf_getarr( $definition_array, 'name', $this->get_slug() ) );
	}

	public function get_slug() { return $this->slug; }

	public function get_name() { return $this->name; }

	/**
	 * @return string Proper display name suitable for direct displaying to the user.
	 *
	 * Handles string translation and adds an asterisk if the field is required.
	 *
	 * @since 1.9
	 */
	public function get_display_name() {

		// Try to translate through standard toolset-forms method
		$string_name = sprintf( 'field %s name', $this->get_slug() );
		$display_name = WPToolset_Types::translate( $string_name, $this->get_name() );

		// Add an asterisk if the field is required
		if( $this->get_is_required() && !empty( $display_name ) ) {
			$display_name .= '*';
		}
		return $display_name;
	}

	/**
	 * @return string Field description as provided by the user. Sanitized.
	 */
	public function get_description() { return sanitize_text_field( wpcf_getarr( $this->definition_array, 'description' ) ); }

	/**
	 * Determine whether the field is currently under Types control.
	 *
	 * If it's not, we are only holding on to this definition in case user decides to return it to Types control in the
	 * future. In all other regards, such field definition should be handled as a generic one.
	 *
	 * @return bool
	 */
	public function is_under_types_control() {
		$is_disabled = (bool) wpcf_getnest( $this->definition_array, array( 'data', 'disabled' ), false );
		return !$is_disabled;
	}

	private $meta_key = null;

	/**
	 * @return string Meta_key use to store this field's values. Defaults to wpcf-$slug.
	 */
	public function get_meta_key() {
		if( null == $this->meta_key ) {
			$this->meta_key = sanitize_title(
				wpcf_getarr( $this->definition_array, 'meta_key', self::FIELD_META_KEY_PREFIX . $this->get_slug() )
			);
		}
		return $this->meta_key;
	}

	private $is_repetitive = null;

	/**
	 * @return bool True if the field is repetitive, false otherwise.
	 */
	public function get_is_repetitive() {
		if( null === $this->is_repetitive ) {
			$this->is_repetitive = ( wpcf_getnest( $this->definition_array, array( 'data', 'repetitive' ), 0 ) != 0 );
		}
		return $this->is_repetitive;
	}

	/**
	 * Get the underlying field definition array.
	 *
	 * Usage of this method is strongly discouraged, consider writing a custom (and safe) getter instead.
	 *
	 * @return array
	 */
	public function get_definition_array() { return $this->definition_array; }

	public function get_type() { return $this->type; }

	/**
	 * For binary fields (like checkbox), it is possible to specify a value that will be saved to the database
	 * if the field is checked/selected/whatever.
	 *
	 * Stored in $cf['data']['set_save'].
	 *
	 * @return mixed|null The value or null if none is defined (make sure to compare with ===).
	 */
	public function get_forced_value() {
		return wpcf_getnest( $this->definition_array, array( 'data', 'set_value' ), null );
	}

	public function has_forced_value() {
		return ( null !== $this->get_forced_value() );
	}

	public function get_should_save_empty_value() {
		return ( 'yes' == wpcf_getnest( $this->definition_array, array( 'data', 'save_empty' ), 'no' ) );
	}

	public function get_is_required() {
		return ( 1 == wpcf_getnest( $this->definition_array, array( 'data', 'validate', 'required', 'active' ), 0 ) );
	}

	/**
	 * @return array An option_id => option_data array.
	 */
	public function get_field_options() {
		return wpcf_ensarr( wpcf_getnest( $this->definition_array, array( 'data', 'options' ) ) );
	}

	/**
	 * Get an accessor for a specific field instance.
	 *
	 * @param WPCF_Field_Instance $field_instance Instance of the field the accessor should access.
	 * @return WPCF_Field_Accessor_Abstract
	 */
	public abstract function get_accessor( $field_instance );

	/**
	 * Get a mapper object that helps translating field data between database and rest of Types.
	 *
	 * Note: This happens here and not in field type definition because the information about field type might not
	 * be enough in the future.
	 *
	 * @todo This should probably be provided by type definition, no switch should be here.
	 *
	 * @return WPCF_Field_DataMapper_Abstract
	 */
	public function get_data_mapper() {
		switch( $this->get_type()->get_slug() ) {
			case self::TYPE_CHECKBOXES:
				return new WPCF_Field_DataMapper_Checkboxes( $this );
			case self::TYPE_CHECKBOX:
				return new WPCF_Field_DataMapper_Checkbox( $this );
			default:
				return new WPCF_Field_DataMapper_Identity( $this );
		}
	}

	/**
	 * Delete all field values!
	 *
	 * @return bool
	 */
	public abstract function delete_all_fields();

}


text:
package org.traccar.protocol;

import org.junit.Test;
import org.traccar.ProtocolTest;
import org.traccar.model.Command;

public class TeltonikaProtocolEncoderTest extends ProtocolTest {

    @Test
    public void testEncode() throws Exception {

        TeltonikaProtocolEncoder encoder = new TeltonikaProtocolEncoder(null);

        Command command = new Command();
        command.setDeviceId(1);
        command.setType(Command.TYPE_CUSTOM);

        command.set(Command.KEY_DATA, "setdigout 11");
        verifyCommand(encoder, command, binary("00000000000000160C01050000000E7365746469676F75742031310D0A010000E258"));

        command.set(Command.KEY_DATA, "03030000000185E8");
        verifyCommand(encoder, command, binary("00000000000000100c01050000000803030000000185e8010000da8b"));

    }

}


text:
<?php
class Kwc_Basic_Download_Trl_Component extends Kwc_Abstract_Composite_Trl_Component
{
    public static function getSettings($masterComponentClass)
    {
        $ret = parent::getSettings($masterComponentClass);
        $ret['ownModel'] = 'Kwf_Component_FieldModel';
        return $ret;
    }
    public function getTemplateVars()
    {
        $return = parent::getTemplateVars();

        /*
        $fileRow = $this->_getFileRow();
        $parentRow = $fileRow->getParentRow('File');
        if ($this->_getSetting('showFilesize') && $parentRow) {
            $return['filesize'] = $parentRow->getFileSize();
        } else {
            $return['filesize'] = null;
        }
        */
        $return['infotext'] = $this->_getRow()->infotext;
        /*
        if ($return['infotext'] == '' && $parentRow)
            $return['infotext'] = $parentRow->filename;

        if ($this->_getSetting('showIcon')) {
            $return['icon'] = $this->getIcon();
        } else {
            $return['icon'] = null;
        }
        */
        return $return;
    }
}


text:
<?php
/**
 * Created by PhpStorm.
 *
 * Duc-Anh LE (ducanh.ke@gmail.com)
 *
 * User: ducanh-ki
 * Date: 5/5/17
 * Time: 3:52 PM
 */

namespace CreativeDelta\User\Google;

use CreativeDelta\User\Core\Domain\AbstractOAuthAuthenticationAdapter;
use CreativeDelta\User\Core\Domain\Entity\Identity;
use Google_Client;
use Google_Service_Oauth2;
use Zend\Db\Adapter\AdapterInterface;

class GoogleAuthenticationAdapter extends AbstractOAuthAuthenticationAdapter
{
    const METHOD_NAME = "google";

    /** @var Google_Client $oauthClient */
    protected $oauthClient;

    /** @var  GoogleTable $localTable */
    protected $localTable;

    public function __construct(array $config, AdapterInterface $dbAdapter, Identity $identity = null)
    {
        parent::__construct($config, $dbAdapter, $identity);

        $this->localTable = new GoogleTable($this->dbAdapter);

        $this->oauthClient = new Google_Client();
        $this->oauthClient->setClientId($this->config[GoogleMethod::METHOD_CONFIG_APP_ID]);
        $this->oauthClient->setClientSecret($this->config[GoogleMethod::METHOD_CONFIG_APP_SECRET]);
        $this->oauthClient->setDeveloperKey($this->config[GoogleMethod::METHOD_CONFIG_API_KEY]);
        $this->oauthClient->setScopes(explode(' ', $this->config[GoogleMethod::METHOD_CONFIG_APP_SCOPE]));

        if ($identity) {

            $this->_loadLocalProfile();
            $profile = $identity->getProfile();

            if ($profile && isset($profile[GoogleTable::COLUMN_ACCESS_TOKEN])) {
                $this->oauthClient->setAccessToken($profile[GoogleTable::COLUMN_ACCESS_TOKEN]);
            }
        }
    }

    function pokeIdentity()
    {
        $token = $this->oauthClient->getAccessToken();

        $profileData     = $this->identity->getProfile();
        $profileInstance = GoogleProfile::newFromArray($this->dbAdapter, $profileData, true);
        $profileInstance->setAccessToken($token[GoogleMethod::TOKEN_ACCESS_TOKEN]);
        $profileInstance->save();
    }

    public function verifyIdentity()
    {
        $service = new Google_Service_Oauth2($this->oauthClient);

        if (!$service)
            throw new GoogleException(GoogleException::ERROR_CODE_VERIFY_IDENTITY_FAILED_TO_INITIATE_GOOGLE_OAUTH2);

        $oauthId = $service->userinfo->get()->getId();

        if (!$oauthId)
            return false;

        $profile = $this->identity->getProfile();

        if (!$profile)
            return false;

        $localUserId = $profile[GoogleTable::COLUMN_GOOGLE_ID];

        return $oauthId == $localUserId;
    }

    function setAccessToken($token)
    {
        $this->oauthClient->setAccessToken($token);
    }

    function getAccessToken()
    {
        return $this->oauthClient->getAccessToken();
    }

    private function _loadLocalProfile()
    {
        $result = $this->localTable->getByIdentityId($this->identity->getId());
        $this->identity->setProfile($result->getArrayCopy());
    }
}


text:
#ifndef __GroundPlane_h__
#define __GroundPlane_h__

#include "BodyNode.h"

class GroundPlane : public BodyNode
{
	public :

		static GroundPlane*		create ( b2World* pWorld, const CCPoint& tLocation, const KDchar* szSpriteFileName );

	protected :

		virtual KDbool		InitWithWorld ( b2World* pWorld, const CCPoint& tLocation, const KDchar* szSpriteFileName );

	private :

		KDvoid				createGround ( KDvoid );

	protected :

		b2World*			m_pTheWorld;
		std::string			m_sSpriteImageName;
		CCPoint				m_tInitialLocation;
};

#endif	// __GroundPlane_h__


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.apache.syncope</groupId>
    <artifactId>syncope-fit</artifactId>
    <version>3.0.1-SNAPSHOT</version>
  </parent>

  <name>Apache Syncope FIT Console Reference</name>
  <description>Apache Syncope FIT Console Reference</description>
  <groupId>org.apache.syncope.fit</groupId>
  <artifactId>syncope-fit-console-reference</artifactId>
  <packaging>war</packaging>

  <properties>
    <ianal.phase>none</ianal.phase>

    <rootpom.basedir>${basedir}/../..</rootpom.basedir>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.apache.syncope.client.idm</groupId>
      <artifactId>syncope-client-idm-console</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.syncope.client.am</groupId>
      <artifactId>syncope-client-am-console</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.syncope.common.keymaster.self</groupId>
      <artifactId>syncope-common-keymaster-client-self</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.syncope.ext.flowable</groupId>
      <artifactId>syncope-ext-flowable-client-console</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.syncope.ext.saml2sp4ui</groupId>
      <artifactId>syncope-ext-saml2sp4ui-client-console</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.syncope.ext.scimv2</groupId>
      <artifactId>syncope-ext-scimv2-client-console</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.syncope.ext.oidcc4ui</groupId>
      <artifactId>syncope-ext-oidcc4ui-client-console</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- TEST -->
    <dependency>
      <groupId>org.apache.syncope.fit</groupId>
      <artifactId>syncope-fit-build-tools</artifactId>
      <version>${project.version}</version>
      <type>war</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.syncope.fit</groupId>
      <artifactId>syncope-fit-core-reference</artifactId>
      <version>${project.version}</version>
      <type>war</type>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven3-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <container>
            <containerId>tomcat9x</containerId>
            <zipUrlInstaller>
              <url>https://repo1.maven.org/maven2/org/apache/tomcat/tomcat/${tomcat.version}/tomcat-${tomcat.version}.zip</url>
              <downloadDir>${settings.localRepository}/org/codehaus/cargo/cargo-container-archives</downloadDir>
              <extractDir>${project.build.directory}/cargo/extract</extractDir>
            </zipUrlInstaller>
            <timeout>300000</timeout>
            <log>${cargo.log}</log>
            <output>${cargo.output}</output>

            <systemProperties>
              <java.security.egd>file:/dev/./urandom</java.security.egd>
              <java.util.secureRandomSeed>true</java.util.secureRandomSeed>

              <h2.returnOffsetDateTime>true</h2.returnOffsetDateTime>
            </systemProperties>
          </container>
          <configuration>
            <properties>
              <cargo.jvmargs>
                -Dspring.profiles.active=embedded,all
                -Dwicket.ioc.useByteBuddy=true
                -Xmx1024m -Xms512m</cargo.jvmargs>
            </properties>
          </configuration>
          <deployables>
            <deployable>
              <groupId>org.apache.syncope.fit</groupId>
              <artifactId>syncope-fit-build-tools</artifactId>
              <type>war</type>
              <properties>
                <context>syncope-fit-build-tools</context>
              </properties>
            </deployable>
            <deployable>
              <location>${basedir}/../core-reference/target/syncope-fit-core-reference-${project.version}</location>
              <pingURL>http://localhost:${cargo.servlet.port}/syncope/index.html</pingURL>
              <pingTimeout>${cargo.deployable.ping.timeout}</pingTimeout>
              <properties>
                <context>syncope</context>
              </properties>
            </deployable>
            <deployable>
              <location>${project.build.directory}/${project.build.finalName}</location>
              <properties>
                <context>syncope-console</context>
              </properties>
            </deployable>
          </deployables>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <configuration>
          <resourceIncludes>src/main/resources/**/*.properties</resourceIncludes>
        </configuration>
      </plugin>
    </plugins>

    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>true</filtering>
      </testResource>
    </testResources>
  </build>

  <profiles>
    <profile>
      <id>skipTests</id>
    </profile>

    <profile>
      <id>debug</id>

      <properties>
        <skipTests>true</skipTests>
      </properties>

      <build>
        <defaultGoal>clean verify cargo:run</defaultGoal>

        <plugins>
          <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven3-plugin</artifactId>
            <inherited>true</inherited>
            <configuration>
              <configuration>
                <properties>
                  <cargo.jvmargs>
                    -Dspring.profiles.active=embedded,all
                    -Dwicket.core.settings.general.configuration-type=development
                    -Dwicket.ioc.useByteBuddy=true
                    -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
                    -XX:+UseG1GC -Xmx1024m -Xms512m</cargo.jvmargs>
                </properties>
              </configuration>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- requires JAVA_HOME set to the latest JDK from https://github.com/TravaOpenJDK/trava-jdk-11-dcevm -->
    <profile>
      <id>hotswap</id>

      <dependencies>
        <!-- wicket-ioc depends on cglib, need to exclude it for hotswap to work -->
        <dependency>
          <groupId>org.apache.syncope.client.idm</groupId>
          <artifactId>syncope-client-idm-console</artifactId>
          <version>${project.version}</version>
          <exclusions>
            <exclusion>
              <groupId>cglib</groupId>
              <artifactId>cglib</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>cglib</groupId>
          <artifactId>cglib-nodep</artifactId>
        </dependency>
      </dependencies>

      <build>
        <defaultGoal>clean verify cargo:run</defaultGoal>

        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <inherited>true</inherited>
            <executions>
              <execution>
                <id>enableHotSwapForCore</id>
                <phase>package</phase>
                <configuration>
                  <target>
                    <copy file="${basedir}/../core-reference/target/test-classes/hotswap-agent.properties"
                          tofile="${basedir}/../core-reference/target/syncope-fit-core-reference-${project.version}/WEB-INF/classes/hotswap-agent.properties"
                          overwrite="true"/>
                  </target>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven3-plugin</artifactId>
            <inherited>true</inherited>
            <configuration>
              <configuration>
                <properties>
                  <cargo.jvmargs>
                    -Dspring.profiles.active=embedded,all
                    -Dwicket.core.settings.general.configuration-type=development
                    -Dwicket.ioc.useByteBuddy=true
                    -javaagent:${java.home}/lib/hotswap/hotswap-agent.jar=autoHotswap=true,disablePlugin=Spring,disablePlugin=Hibernate,disablePlugin=CxfJAXRS
                    -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000
                    -XX:+UseConcMarkSweepGC -Xmx1024m -Xms512m</cargo.jvmargs>
                </properties>
              </configuration>
            </configuration>
          </plugin>
        </plugins>

        <resources>
          <resource>
            <directory>src/test/resources</directory>
            <filtering>true</filtering>
            <includes>
              <include>hotswap-agent.properties</include>
            </includes>
          </resource>
        </resources>
      </build>
    </profile>

    <profile>
      <id>apache-release</id>

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <inherited>false</inherited>
            <configuration>
              <skipSource>true</skipSource>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>
</project>


text:
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using DTcms.DBUtility;
using DTcms.Common;

namespace DTcms.DAL
{
    /// <summary>
    /// 数据访问类:用户地址簿
    /// </summary>
    public partial class user_addr_book
    {
        private string databaseprefix; //数据库表名前缀
        public user_addr_book(string _databaseprefix)
        {
            databaseprefix = _databaseprefix;
        }

        #region 基本方法============================
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int id)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) from " + databaseprefix + "user_addr_book");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters = {
					new SqlParameter("@id", SqlDbType.Int,4)};
            parameters[0].Value = id;

            return DbHelperSQL.Exists(strSql.ToString(), parameters);
        }

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int id,string user_name)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) from " + databaseprefix + "user_addr_book");
            strSql.Append(" where id=@id and user_name=@user_name");
            SqlParameter[] parameters = {
					new SqlParameter("@id", SqlDbType.Int,4),
                    new SqlParameter("@user_name", SqlDbType.NVarChar,100)};
            parameters[0].Value = id;
            parameters[1].Value = user_name;

            return DbHelperSQL.Exists(strSql.ToString(), parameters);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Model.user_addr_book model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into " + databaseprefix + "user_addr_book(");
            strSql.Append("user_id,user_name,accept_name,area,address,mobile,telphone,email,post_code,is_default,add_time)");
            strSql.Append(" values (");
            strSql.Append("@user_id,@user_name,@accept_name,@area,@address,@mobile,@telphone,@email,@post_code,@is_default,@add_time)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
					new SqlParameter("@user_id", SqlDbType.Int,4),
					new SqlParameter("@user_name", SqlDbType.NVarChar,100),
					new SqlParameter("@accept_name", SqlDbType.NVarChar,100),
					new SqlParameter("@area", SqlDbType.NVarChar,100),
					new SqlParameter("@address", SqlDbType.NVarChar,500),
					new SqlParameter("@mobile", SqlDbType.NVarChar,20),
					new SqlParameter("@telphone", SqlDbType.NVarChar,30),
					new SqlParameter("@email", SqlDbType.NVarChar,50),
					new SqlParameter("@post_code", SqlDbType.NVarChar,20),
					new SqlParameter("@is_default", SqlDbType.TinyInt,1),
					new SqlParameter("@add_time", SqlDbType.DateTime)};
            parameters[0].Value = model.user_id;
            parameters[1].Value = model.user_name;
            parameters[2].Value = model.accept_name;
            parameters[3].Value = model.area;
            parameters[4].Value = model.address;
            parameters[5].Value = model.mobile;
            parameters[6].Value = model.telphone;
            parameters[7].Value = model.email;
            parameters[8].Value = model.post_code;
            parameters[9].Value = model.is_default;
            parameters[10].Value = model.add_time;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
            {
                return 0;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Model.user_addr_book model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update " + databaseprefix + "user_addr_book set ");
            strSql.Append("user_id=@user_id,");
            strSql.Append("user_name=@user_name,");
            strSql.Append("accept_name=@accept_name,");
            strSql.Append("area=@area,");
            strSql.Append("address=@address,");
            strSql.Append("mobile=@mobile,");
            strSql.Append("telphone=@telphone,");
            strSql.Append("email=@email,");
            strSql.Append("post_code=@post_code,");
            strSql.Append("is_default=@is_default,");
            strSql.Append("add_time=@add_time");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters = {
					new SqlParameter("@user_id", SqlDbType.Int,4),
					new SqlParameter("@user_name", SqlDbType.NVarChar,100),
					new SqlParameter("@accept_name", SqlDbType.NVarChar,100),
					new SqlParameter("@area", SqlDbType.NVarChar,100),
					new SqlParameter("@address", SqlDbType.NVarChar,500),
					new SqlParameter("@mobile", SqlDbType.NVarChar,20),
					new SqlParameter("@telphone", SqlDbType.NVarChar,30),
					new SqlParameter("@email", SqlDbType.NVarChar,50),
					new SqlParameter("@post_code", SqlDbType.NVarChar,20),
					new SqlParameter("@is_default", SqlDbType.TinyInt,1),
					new SqlParameter("@add_time", SqlDbType.DateTime),
					new SqlParameter("@id", SqlDbType.Int,4)};
            parameters[0].Value = model.user_id;
            parameters[1].Value = model.user_name;
            parameters[2].Value = model.accept_name;
            parameters[3].Value = model.area;
            parameters[4].Value = model.address;
            parameters[5].Value = model.mobile;
            parameters[6].Value = model.telphone;
            parameters[7].Value = model.email;
            parameters[8].Value = model.post_code;
            parameters[9].Value = model.is_default;
            parameters[10].Value = model.add_time;
            parameters[11].Value = model.id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int id)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from " + databaseprefix + "user_addr_book ");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters = {
					new SqlParameter("@id", SqlDbType.Int,4)};
            parameters[0].Value = id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        /// <summary>
        /// 根据用户名删除一条数据
        /// </summary>
        public bool Delete(int id, string user_name)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from " + databaseprefix + "user_addr_book ");
            strSql.Append(" where id=@id and user_name=@user_name");
            SqlParameter[] parameters = {
					new SqlParameter("@id", SqlDbType.Int,4),
                    new SqlParameter("@user_name", SqlDbType.NVarChar,100)};
            parameters[0].Value = id;
            parameters[1].Value = user_name;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.user_addr_book GetModel(int id)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select top 1 id,user_id,user_name,accept_name,area,address,mobile,telphone,email,post_code,is_default,add_time");
            strSql.Append(" from " + databaseprefix + "user_addr_book ");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters = {
					new SqlParameter("@id", SqlDbType.Int,4)};
            parameters[0].Value = id;

            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select id,user_id,user_name,accept_name,area,address,mobile,telphone,email,post_code,is_default,add_time ");
            strSql.Append(" FROM " + databaseprefix + "user_addr_book ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            strSql.Append(" order by add_time asc,id asc");
            return DbHelperSQL.Query(strSql.ToString());
        }

        /// <summary>
        /// 获得前几行数据
        /// </summary>
        public DataSet GetList(int Top, string strWhere, string filedOrder)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select ");
            if (Top > 0)
            {
                strSql.Append(" top " + Top.ToString());
            }
            strSql.Append(" id,user_id,user_name,accept_name,area,address,mobile,telphone,email,post_code,is_default,add_time ");
            strSql.Append(" FROM " + databaseprefix + "user_addr_book ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            strSql.Append(" order by " + filedOrder);
            return DbHelperSQL.Query(strSql.ToString());
        }

        /// <summary>
        /// 获得查询分页数据
        /// </summary>
        public DataSet GetList(int pageSize, int pageIndex, string strWhere, string filedOrder, out int recordCount)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select * FROM " + databaseprefix + "user_addr_book");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            recordCount = Convert.ToInt32(DbHelperSQL.GetSingle(PagingHelper.CreateCountingSql(strSql.ToString())));
            return DbHelperSQL.Query(PagingHelper.CreatePagingSql(recordCount, pageSize, pageIndex, strSql.ToString(), filedOrder));
        }
        #endregion

        #region 扩展方法============================
        /// <summary>
        /// 返回默认的地址
        /// </summary>
        public Model.user_addr_book GetDefault(string user_name)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select top 1 id,user_id,user_name,accept_name,area,address,mobile,telphone,email,post_code,is_default,add_time");
            strSql.Append(" from " + databaseprefix + "user_addr_book ");
            strSql.Append(" where user_name=@user_name");
            SqlParameter[] parameters = {
					new SqlParameter("@user_name", SqlDbType.NVarChar,100)};
            parameters[0].Value = user_name;

            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }

        /// <summary>
        /// 设置为默认的收货地址
        /// </summary>
        public void SetDefault(int id, string user_name)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update " + databaseprefix + "user_addr_book set is_default=0");
            strSql.Append(" where user_name=@user_name");
            SqlParameter[] parameters = {
					new SqlParameter("@user_name", SqlDbType.NVarChar,100)};
            parameters[0].Value = user_name;
            List<CommandInfo> sqllist = new List<CommandInfo>();
            CommandInfo cmd = new CommandInfo(strSql.ToString(), parameters);
            sqllist.Add(cmd);

            StringBuilder strSql2 = new StringBuilder();
            strSql2.Append("update " + databaseprefix + "user_addr_book set is_default=1");
            strSql2.Append(" where id=@id and user_name=@user_name");
            SqlParameter[] parameters2 = {
                    new SqlParameter("@id", SqlDbType.Int,4),
					new SqlParameter("@user_name", SqlDbType.NVarChar,100)};
            parameters2[0].Value = id;
            parameters2[1].Value = user_name;
            cmd = new CommandInfo(strSql2.ToString(), parameters2);
            sqllist.Add(cmd);

            DbHelperSQL.ExecuteSqlTranWithIndentity(sqllist);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.user_addr_book DataRowToModel(DataRow row)
        {
            Model.user_addr_book model = new Model.user_addr_book();
            if (row != null)
            {
                if (row["id"] != null && row["id"].ToString() != "")
                {
                    model.id = int.Parse(row["id"].ToString());
                }
                if (row["user_id"] != null && row["user_id"].ToString() != "")
                {
                    model.user_id = int.Parse(row["user_id"].ToString());
                }
                if (row["user_name"] != null)
                {
                    model.user_name = row["user_name"].ToString();
                }
                if (row["accept_name"] != null)
                {
                    model.accept_name = row["accept_name"].ToString();
                }
                if (row["area"] != null)
                {
                    model.area = row["area"].ToString();
                }
                if (row["address"] != null)
                {
                    model.address = row["address"].ToString();
                }
                if (row["mobile"] != null)
                {
                    model.mobile = row["mobile"].ToString();
                }
                if (row["telphone"] != null)
                {
                    model.telphone = row["telphone"].ToString();
                }
                if (row["email"] != null)
                {
                    model.email = row["email"].ToString();
                }
                if (row["post_code"] != null)
                {
                    model.post_code = row["post_code"].ToString();
                }
                if (row["is_default"] != null && row["is_default"].ToString() != "")
                {
                    model.is_default = int.Parse(row["is_default"].ToString());
                }
                if (row["add_time"] != null && row["add_time"].ToString() != "")
                {
                    model.add_time = DateTime.Parse(row["add_time"].ToString());
                }
            }
            return model;
        }
        #endregion
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ModernUI.App.Content
{
    /// <summary>
    /// Interaction logic for ControlsStylesText.xaml
    /// </summary>
    public partial class ControlsStylesText : UserControl
    {
        public ControlsStylesText()
        {
            InitializeComponent();
        }
    }
}


text:
export default {
  abort: 'onAbort',
  animationend: 'onAnimationEnd',
  blur: 'onBlur',
  canplay: 'onCanPlay',
  canplaythrough: 'onCanPlayThrough',
  change: 'onChange',
  click: 'onClick',
  contextmenu: 'onContextMenu',
  copy: 'onCopy',
  cut: 'onCut',
  dblclick: 'onDoubleClick',
  drag: 'onDrag',
  dragend: 'onDragEnd',
  dragenter: 'onDragEnter',
  dragleave: 'onDragLeave',
  dragover: 'onDragOver',
  dragstart: 'onDragStart',
  drop: 'onDrop',
  durationchange: 'onDurationChange',
  emptied: 'onEmptied',
  ended: 'onEnded',
  error: 'onError',
  focus: 'onFocus',
  input: 'onInput',
  keydown: 'onKeyDown',
  keypress: 'onKeyPress',
  keyup: 'onKeyUp',
  load: 'onLoad',
  loadeddata: 'onLoadedData',
  loadedmetadata: 'onLoadedMetadata',
  loadstart: 'onLoadStart',
  mousedown: 'onMouseDown',
  mouseenter: 'onMouseEnter',
  mouseleave: 'onMouseLeave',
  mousemove: 'onMouseMove',
  mouseout: 'onMouseOut',
  mouseover: 'onMouseOver',
  mouseup: 'onMouseUp',
  mousewheel: 'onWheel',
  paste: 'onPaste',
  pause: 'onPause',
  play: 'onPlay',
  playing: 'onPlaying',
  progress: 'onProgress',
  ratechange: 'onRateChange',
  reset: 'onReset',
  scroll: 'onScroll',
  seekend: 'onSeeked',
  seeking: 'onSeeking',
  select: 'onSelect',
  stalled: 'onStalled',
  submit: 'onSubmit',
  suspend: 'onSuspend',
  timeupdate: 'onTimeUpdate',
  touchcancel: 'onTouchCancel',
  touchend: 'onTouchEnd',
  touchmove: 'onTouchMove',
  touchstart: 'onTouchStart',
  transitionend: 'onTransitionEnd',
  volumechange: 'onVolumeChange',
  waiting: 'onWaiting',
  wheel: 'onWheel',
}


text:
{% extends "base.html" %}

{% block header %}500{% endblock %}

{% block content %}

Server error!

{% endblock %}


text:
__author__ = 'Jamie Diprose'

import rospy
from sensor_msgs.msg import JointState
from threading import Thread
from ros_pololu_servo.srv import pololu_state

class EinsteinSensors(Thread):
    def __init__(self):
        rospy.init_node('einstein_sensors')

        Thread.__init__(self)
        self.rate = rospy.Rate(rospy.get_param('~sensor_rate', 15.0))
        self.base_frame_id = rospy.get_param('~base_frame_id', "base_link")

        self.joint_state = JointState()
        self.joint_state.name = ['neck_yaw', 'neck_roll', 'neck_pitch']
        self.joint_state_pub = rospy.Publisher("joint_states", JointState)

        rospy.loginfo("Waiting for pololu_status service...")
        self.pololu_status_srv = rospy.ServiceProxy('pololu_status', pololu_state)
        self.pololu_status_srv.wait_for_service()
        rospy.loginfo("pololu_status service found")

    def run(self):
        while not rospy.is_shutdown():
            timestamp = rospy.Time.now()

            self.joint_state.position[0] = self.pololu_status_srv(23)
            self.joint_state.position[1] = self.pololu_status_srv(2)
            self.joint_state.position[2] = self.pololu_status_srv(3)

            self.joint_state.header.stamp = timestamp
            self.joint_state.header.frame_id = self.base_frame_id
            self.joint_state_pub.publish(self.joint_state)

            self.rate.sleep()

if __name__ == '__main__':
    rospy.loginfo("Starting einstein_sensors...")
    sensors = EinsteinSensors()
    sensors.start()
    rospy.loginfo("einstein_sensors started")

    rospy.spin()

    rospy.loginfo("Stopping einstein_sensors...")
    sensors.join()
    rospy.loginfo("einstein_sensors stopped.")


text:
<title>dlib C++ Library - svm_rank_ex.cpp</title>

// The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt
/*

    This is an example illustrating the use of the SVM-Rank tool from the dlib
    C++ Library.  This is a tool useful for learning to rank objects.  For
    example, you might use it to learn to rank web pages in response to a
    user's query.  The idea being to rank the most relevant pages higher than
    non-relevant pages.

    In this example, we will create a simple test dataset and show how to learn
    a ranking function from it.  The purpose of the function will be to give
    "relevant" objects higher scores than "non-relevant" objects.  The idea is
    that you use this score to order the objects so that the most relevant
    objects come to the top of the ranked list.

    Note that we use dense vectors (i.e. dlib::matrix objects) in this example,
    however, the ranking tools can also use sparse vectors as well.  See
    svm_sparse_ex.cpp for an example.
*/

#include <dlib/svm.h>
#include <iostream>

using namespace std;
using namespace dlib;

int main()
{
    try
    {
        // Make a typedef for the kind of object we will be ranking.  In this
        // example, we are ranking 2-dimensional vectors.
        typedef matrix<double,2,1> sample_type;

        // Now lets make some testing data.  To make it really simple, lets
        // suppose that vectors with positive values in the first dimension
        // should rank higher than other vectors.  So what we do is make
        // examples of relevant (i.e. high ranking) and non-relevant (i.e. low
        // ranking) vectors and store them into a ranking_pair object like so:
        ranking_pair<sample_type> data;
        sample_type samp;

        // Make one relevant example.
        samp = 1, 0;
        data.relevant.push_back(samp);

        // Now make a non-relevant example.
        samp = 0, 1;
        data.nonrelevant.push_back(samp);

        // Now that we have some data, we can use a machine learning method to
        // learn a function that will give high scores to the relevant vectors
        // and low scores to the non-relevant vectors.

        // The first thing we do is select the kernel we want to use.  For the
        // svm_rank_trainer there are only two options.  The linear_kernel and
        // sparse_linear_kernel.  The later is used if you want to use sparse
        // vectors to represent your objects.  Since we are using dense vectors
        // (i.e. dlib::matrix objects to represent the vectors) we use the
        // linear_kernel.
        typedef linear_kernel<sample_type> kernel_type;

        // Now make a trainer and tell it to learn a ranking function based on
        // our data.
        svm_rank_trainer<kernel_type> trainer;
        decision_function<kernel_type> rank = trainer.train(data);

        // Now if you call rank on a vector it will output a ranking score.  In
        // particular, the ranking score for relevant vectors should be larger
        // than the score for non-relevant vectors.
        cout << "ranking score for a relevant vector:     " << rank(data.relevant[0]) << endl;
        cout << "ranking score for a non-relevant vector: " << rank(data.nonrelevant[0]) << endl;
        // These output the following:
        /*
            ranking score for a relevant vector:     0.5
            ranking score for a non-relevant vector: -0.5
        */

        // If we want an overall measure of ranking accuracy we can compute the
        // ordering accuracy and mean average precision values by calling
        // test_ranking_function().  In this case, the ordering accuracy tells
        // us how often a non-relevant vector was ranked ahead of a relevant
        // vector.  This function will return a 1 by 2 matrix containing these
        // measures.  In this case, it returns 1 1 indicating that the rank
        // function outputs a perfect ranking.
        cout << "testing (ordering accuracy, mean average precision): " << test_ranking_function(rank, data) << endl;

        // We can also see the ranking weights:
        cout << "learned ranking weights: \n" << rank.basis_vectors(0) << endl;
        // In this case they are:
        //  0.5
        // -0.5

        // In the above example, our data contains just two sets of objects.
        // The relevant set and non-relevant set.  The trainer is attempting to
        // find a ranking function that gives every relevant vector a higher
        // score than every non-relevant vector.  Sometimes what you want to do
        // is a little more complex than this.
        //
        // For example, in the web page ranking example we have to rank pages
        // based on a user's query.  In this case, each query will have its own
        // set of relevant and non-relevant documents.  What might be relevant
        // to one query may well be non-relevant to another.  So in this case
        // we don't have a single global set of relevant web pages and another
        // set of non-relevant web pages.
        //
        // To handle cases like this, we can simply give multiple ranking_pair
        // instances to the trainer.  Therefore, each ranking_pair would
        // represent the relevant/non-relevant sets for a particular query.  An
        // example is shown below (for simplicity, we reuse our data from above
        // to make 4 identical "queries").

        std::vector<ranking_pair<sample_type> > queries;
        queries.push_back(data);
        queries.push_back(data);
        queries.push_back(data);
        queries.push_back(data);

        // We train just as before.
        rank = trainer.train(queries);

        // Now that we have multiple ranking_pair instances, we can also use
        // cross_validate_ranking_trainer().  This performs cross-validation by
        // splitting the queries up into folds.  That is, it lets the trainer
        // train on a subset of ranking_pair instances and tests on the rest.
        // It does this over 4 different splits and returns the overall ranking
        // accuracy based on the held out data.  Just like test_ranking_function(),
        // it reports both the ordering accuracy and mean average precision.
        cout << "cross-validation (ordering accuracy, mean average precision): "
             << cross_validate_ranking_trainer(trainer, queries, 4) << endl;

    }
    catch (std::exception& e)
    {
        cout << e.what() << endl;
    }
}


text:
  Maisoncelles-Pelvey est
       un village
       situé dans le département des Calvados en Basse-Normandie. Elle totalisait 247 habitants en 2008.

Si vous envisagez de venir habiter à Maisoncelles-Pelvey, vous pourrez aisément trouver une maison à vendre.

Le parc de logements, à Maisoncelles-Pelvey, se décomposait en 2011 en zero appartements et 108 maisons soit
 un marché plutôt équilibré.

À proximité de Maisoncelles-Pelvey sont localisées les villes de
Épinay-sur-Odon localisée à 4 km, 571 habitants,
Saint-Georges-d'Aunay localisée à 2 km, 696 habitants,
Aunay-sur-Odon à 4 km, 2 939 habitants,
Villy-Bocage située à 4 km, 715 habitants,
Bauquay localisée à 4 km, 210 habitants,
Tracy-Bocage localisée à 2 km, 337 habitants,
 entre autres. De plus, Maisoncelles-Pelvey est située à seulement 26 km de Caen.

La ville compte quelques  équipements sportifs, elle dispose, entre autres, de un terrain de tennis.


text:
<?php

namespace Configula\Loader;

/**
 * Class IniFileLoaderTest
 *
 * @author Casey McLaughlin <caseyamcl@gmail.com>
 */
class IniFileLoaderTest extends AbstractFileLoaderTest
{
    /**
     * Get extension without the dot (.)
     *
     * @return string
     */
    protected function getExt(): string
    {
        return 'ini';
    }

    public function testMultiSectionFile()
    {
        $loader = new IniFileLoader($this->getTestFilePath('sections'), true);
        $values = $loader->load();

        $this->assertTrue($values->has('no_section_value'));
        $this->assertTrue($values->has('another_no_section_value'));
        $this->assertTrue($values->has('section_a'));
        $this->assertTrue($values->has('section_a.section_a_item'));
        $this->assertTrue($values->has('section_b'));
        $this->assertTrue($values->has('section_b.section_b_item'));
    }

    /**
     * @param  string $filename
     * @return FileLoaderInterface
     */
    protected function getObject(string $filename): FileLoaderInterface
    {
        return new IniFileLoader($filename);
    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Grevillea 16(no. 77): 15 (1887)

#### Original name
Lentinus cameroensis Cooke & Massee, 1887

### Remarks
null


text:
<?php

namespace PHPExiftool\Driver\Tag\VCard;

use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;

/**
 * @ExclusionPolicy("all")
 */
class Nickname extends AbstractTag
{

    protected $Id = 'Nickname';

    protected $Name = 'Nickname';

    protected $FullName = 'VCard::Main';

    protected $GroupName = 'VCard';

    protected $g0 = 'VCard';

    protected $g1 = 'VCard';

    protected $g2 = 'Document';

    protected $Type = '?';

    protected $Writable = false;

    protected $Description = 'Nickname';

}


text:
/*h1 {font:24px Georgia,Verdana; margin:0}*/
/*h2 {font-size:12px; font-weight:normal; font-style:italic; margin:0 0 20px}*/
/*p {margin-top:0}*/
/*ul {margin:0; padding-left:20px}*/

#testdiv {width:600px; margin:0 auto; border:1px solid #ccc; padding:20px 25px; background:#fff}

#tinybox {position:absolute; display:none; padding:10px; background:#fff url(images/preload.gif) no-repeat 50% 50%; border:10px solid #e3e3e3; z-index:2000}
#tinymask {position:absolute; display:none; top:0; left:0; height:100%; width:100%; background:#000; z-index:1500}
#tinycontent {background:#fff}

.button {font:14px Georgia,Verdana; margin-bottom:10px; padding:8px 10px 9px; border:1px solid #ccc; background:#eee; cursor:pointer}
.button:hover {border:1px solid #bbb; background:#e3e3e3}


text:
const userData = require('./users');

module.exports = {
    users: userData
}


text:
var acOptions = {
    minChars: 3,
    max: 10,
    dataType: 'json', // this parameter is currently unused

    parse: function(data) {
        var parsed = [];

        for (var i = 0; i < data.length; i++) {
            parsed[parsed.length] = {
                data: data[i],
                value: data[i].id,
                result: data[i].term
            };
        }

        return parsed;
    },
    formatItem: function(item) {
        return item.term;
    }
};

jQuery(document).ready(function($) {
		$('#objecttype')
        .autocomplete('/ajax/objectterm/', acOptions)
        .attr('name', 'objecttype')
        .result(function(e, data) {$('#objecttype').val(data.term);
		});
		$('#old_findID')
        .autocomplete('/ajax/oldfindid/', acOptions)
        .attr('name', 'old_findID')
        .result(function(e, data) {$('#old_findID').val(data.term);
		});
});