text:
<?php

class PaginationService extends BaseService {

	protected $serviceName = "PaginationService";

	function __construct($serviceManager) {
		parent::__construct($serviceManager);
	}

	function __destruct(){
		parent::__destruct();
	}

	protected function getServiceName(){
		return $this->serviceName;
	}

	// $limit is the same as "maxItemsPerPage"
	public function getPagination($total, $limit, $offset, $limitPagesPerGroup){

		$pagination = new Pagination($total, $limit, $offset, $limitPagesPerGroup);

		$page = $this->getPage($limit, $offset);
		$pagination->setCurrentPage($page);

		$firstItemInPage = $this->getFirstItemInPage($total, $offset);
		$pagination->setFirstItemInCurrentPage($firstItemInPage);

		$lastItemInPage = $this->getLastItemInPage($total, $limit, $offset);
		$pagination->setLastItemInCurrentPage($lastItemInPage);

		$maxItemsPerGroup = $this->getMaxItemsPerGroup($limitPagesPerGroup, $limit);
		$group = $this->getGroup($firstItemInPage, $maxItemsPerGroup);
		$pagination->setCurrentGroup($group);

		$hasPreviousGroup = $this->getHasPreviousGroup($group);
		$pagination->setHasPreviousGroup($hasPreviousGroup);

		$maxGroup = $this->getMaxGroup($total, $maxItemsPerGroup);
		$hasNextGroup = $this->getHasNextGroup($group, $maxGroup);
		$pagination->setHasNextGroup($hasNextGroup);

		$minItemInGroup = $this->getMinItemInGroup($group, $maxItemsPerGroup);
		$pagination->setMinItemInCurrentGroup($minItemInGroup);

		$maxItemInGroup = $this->getMaxItemInGroup($group, $maxItemsPerGroup);
		$pagination->setMaxItemInCurrentGroup($maxItemInGroup);

		$minPageInGroup = $this->getMinPageInGroup($minItemInGroup, $limit);
		$pagination->setMinPageInCurrentGroup($minPageInGroup);

		$maxPageInGroup = $this->getMaxPageInGroup($maxItemInGroup, $limit);
		$pagination->setMaxPageInCurrentGroup($maxPageInGroup);

		$lastItemInGroup = $this->getLastItemInGroup($maxItemInGroup, $total);
		$pagination->setLastItemInCurrentGroup($lastItemInGroup);

		$lastPage = $this->getLastPage($total, $limit);
		$pagination->setLastPage($lastPage);

		$lastPageInGroup = $this->getLastPageInGroup($maxPageInGroup, $lastPage);
		$pagination->setLastPageInCurrentGroup($lastPageInGroup);

		$hasPreviousPage = $this->getHasPreviousPage($page);
		$pagination->setHasPreviousPage($hasPreviousPage);

		$hasNextPage = $this->getHasNextPage($page, $lastPage);
		$pagination->setHasNextPage($hasNextPage);

		$lastGroup = $this->getLastGroup($total, $maxItemsPerGroup);
		$pagination->setLastGroup($lastGroup);

		$pages = $this->getPages($minPageInGroup, $lastPageInGroup, $page, $total, $limit, $offset);
		$pagination->setPages($pages);

		$previousGroupOffset = $this->getPreviousGroupOffset($hasPreviousGroup, $group, $maxItemsPerGroup);
		$pagination->setPreviousGroupOffset($previousGroupOffset);

		$nextGroupOffset = $this->getNextGroupOffset($hasNextGroup, $group, $maxItemsPerGroup);
		$pagination->setNextGroupOffset($nextGroupOffset);

		return $pagination;

	}

/*
    [lastPage:Pagination:private] => 8
    [currentPage:Pagination:private] => 8
    [hasPreviousPage:Pagination:private] => 1
    [hasNextPage:Pagination:private] =>
    [firstItemInCurrentPage:Pagination:private] => 106
    [lastItemInCurrentPage:Pagination:private] => 113
    [groups:Pagination:private] =>
    [lastGroup:Pagination:private] => 1
    [currentGroup:Pagination:private] => 1
    [hasPreviousGroup:Pagination:private] =>
    [hasNextGroup:Pagination:private] =>
    [minItemInCurrentGroup:Pagination:private] => 1
    [maxItemInCurrentGroup:Pagination:private] => 225
    [lastItemInCurrentGroup:Pagination:private] => 113
    [minPageInCurrentGroup:Pagination:private] => 1
    [maxPageInCurrentGroup:Pagination:private] => 15
    [lastPageInCurrentGroup:Pagination:private] => 8
*/

	public function getPaginationAsArray($total, $limit, $offset, $limitPagesPerGroup){
		$pagination = $this->getPagination($total, $limit, $offset, $limitPagesPerGroup);
		$paginationArray = array(
			"total"=>$pagination->getTotal(),
			"hasPreviousGroup"=>$pagination->hasPreviousGroup(),
			"previousGroupOffset"=>$pagination->getPreviousGroupOffset(),
			"hasNextGroup"=>$pagination->hasNextGroup(),
			"nextGroupOffset"=>$pagination->getNextGroupOffset(),
			"currentGroup"=>$pagination->getCurrentGroup(),
			"pages"=>$pagination->getPages(),
			"currentPage"=>$pagination->getCurrentPage(),
			"firstItemInCurrentPage"=>$pagination->getFirstItemInCurrentPage(),
			"lastItemInCurrentPage"=>$pagination->getLastItemInCurrentPage()
		);
		return $paginationArray;
	}

	public function getPages($minPageInGroup, $lastPageInGroup, $currentPage, $total, $limit, $offset){
		$pages = array();
		$lastPage = $this->getLastPage($total, $limit);
		for($pageNumber = $minPageInGroup; $pageNumber <= $lastPageInGroup; $pageNumber++){
			$pageOffset = $this->getOffset($pageNumber, $limit);
			array_push($pages,
				array(
					"limit"=>$limit,
					"offset"=>$pageOffset,
					"pageNumber"=>$pageNumber,
					"currentPage"=>($pageNumber == $currentPage),
					"firstItem"=>$this->getFirstItemInPage($total, $pageOffset),
					"lastItem"=>$this->getLastItemInPage($total, $limit, $pageOffset),
					"hasPreviousPage"=>$this->getHasPreviousPage($pageNumber),
					"hasNextPage"=>$this->getHasNextPage($pageNumber, $lastPage)
					)
				);

		}
		return $pages;
	}

	public function getPreviousGroupOffset($hasPreviousGroup, $group, $maxItemsPerGroup){
		if ($hasPreviousGroup){
			return $maxItemsPerGroup * ($group - 2);
		} else {
			return null; // not possible
		}
	}

	public function getNextGroupOffset($hasNextGroup, $group, $maxItemsPerGroup){
		if ($hasNextGroup){
			return $maxItemsPerGroup * $group;
		} else {
			return null; // not possible
		}
	}

	public function getOffset($page, $limit){
		return ($page-1)*$limit;
	}

	public function getPage($limit, $offset){
		return ($offset / $limit) + 1;
	}

	public function getFirstItemInPage($total, $offset){
		if ($offset + 1  < $total){
			return $offset + 1;
		} else {
			//return null; // not possible
			return 1;
		}
	}

	public function getLastItemInPage($total, $limit, $offset){
		if ($offset + $limit < $total){
			return $offset + $limit;
		} else {
			if ($offset < $total){
				return $total;
			} else {
				return null; // not possible
			}
		}
	}

	public function getMaxItemsPerGroup($limitPagesPerGroup, $limit){
		return $limitPagesPerGroup * $limit;
	}

	public function getGroup($firstItemInPage, $maxItemsPerGroup){
		return ceil($firstItemInPage / $maxItemsPerGroup);
	}

	public function getMaxGroup($total, $maxItemsPerGroup){
		return ceil($total / $maxItemsPerGroup);
	}

	public function getHasPreviousGroup($group){
		return ($group > 1);
	}

	public function getHasNextGroup($group, $maxGroup){
		return ($group < $maxGroup);
	}

	public function getMinItemInGroup($group, $maxItemsPerGroup){
		return ($group * $maxItemsPerGroup - $maxItemsPerGroup + 1);
	}

	public function getMaxItemInGroup($group, $maxItemsPerGroup){
		return ($group * $maxItemsPerGroup);
	}

	public function getMinPageInGroup($minItemInGroup, $limit){
		$minItemInGroup = ($minItemInGroup < 1) ? 1 : $minItemInGroup;
		return ceil($minItemInGroup / $limit);
	}

	public function getMaxPageInGroup($maxItemInGroup, $limit){
		return ($maxItemInGroup / $limit);
	}

	public function getLastItemInGroup($maxItemInGroup, $total){
		if ($maxItemInGroup < $total){
			return $maxItemInGroup;
		} else {
			return $total;
		}
	}

	public function getLastPage($total, $limit){
		return ceil($total / $limit);
	}

	public function getLastPageInGroup($maxPageInGroup, $lastPage){
		if ($maxPageInGroup < $lastPage){
			return $maxPageInGroup;
		} else {
			return $lastPage;
		}
	}

	public function getHasPreviousPage($page){
		return ($page > 1);
	}

	public function getHasNextPage($page, $lastPage){
		return ($page < $lastPage);
	}

	public function getLastGroup($total, $maxItemsPerGroup){
		return ceil($total / $maxItemsPerGroup);
	}

}

class Pagination {

	private $total;
	private $limit;
	private $offset;

	private $limitPagesPerGroup;

	private $pages;
	private $lastPage; // first page is 1

	private $currentPage;
	private $hasPreviousPage;
	private $hasNextPage;

	private $firstItemInCurrentPage;
	private $lastItemInCurrentPage; // actual last item

	private $groups;
	private $lastGroup; // first group is 1

	private $currentGroup;
	private $hasPreviousGroup;
	private $hasNextGroup;

	private $previousGroupOffset;
	private $nextGroupOffset;

	private $minItemInCurrentGroup;
	private $maxItemInCurrentGroup; // maximum last item (not the actual last item, which could be less if $total is taken into account -- see $lastItemInCurrentGroup)
	private $lastItemInCurrentGroup;

	private $minPageInCurrentGroup;
	private $maxPageInCurrentGroup; // maxium last page (not the actual last page, which could be less if $total is taken into account -- see $lastPageInCurrentGroup)
	private $lastPageInCurrentGroup;

	public function __construct($total, $limit, $offset, $limitPagesPerGroup){
		$this->total = $total;
		$this->limit = $limit;
		$this->offset = $offset;
		$this->limitPagesPerGroup = $limitPagesPerGroup;
	}

	public function getTotal(){
		return $this->total;
	}

	public function getLimit(){
		return $this->limit;
	}

	public function getOffset(){
		return $this->offset;
	}

	public function getLimitPagesPerGroup(){
		return $this->limitPagesPerGroup;
	}

	public function setHasPreviousGroup($hasPreviousGroup){
		$this->hasPreviousGroup = $hasPreviousGroup;
	}

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

	public function setHasNextGroup($hasNextGroup){
		$this->hasNextGroup = $hasNextGroup;
	}

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

	public function setPreviousGroupOffset($previousGroupOffset){
		$this->previousGroupOffset = $previousGroupOffset;
	}

	public function getPreviousGroupOffset(){
		return $this->previousGroupOffset;
	}

	public function setNextGroupOffset($nextGroupOffset){
		$this->nextGroupOffset = $nextGroupOffset;
	}

	public function getNextGroupOffset(){
		return $this->nextGroupOffset;
	}

	public function setPages($pages){
		$this->pages = $pages;
	}

	public function getPages(){
		return $this->pages;
	}

	public function setCurrentPage($currentPage){
		$this->currentPage = $currentPage;
	}

	public function getCurrentPage(){
		return $this->currentPage;
	}

	public function setLastPage($lastPage){
		$this->lastPage = $lastPage;
	}

	public function getLastPage(){
		return $this->lastPage;
	}

	public function setFirstItemInCurrentPage($firstItemInCurrentPage){
		$this->firstItemInCurrentPage = $firstItemInCurrentPage;
	}

	public function getFirstItemInCurrentPage(){
		return $this->firstItemInCurrentPage;
	}

	public function setLastItemInCurrentPage($lastItemInCurrentPage){
		$this->lastItemInCurrentPage = $lastItemInCurrentPage;
	}

	public function getLastItemInCurrentPage(){
		return $this->lastItemInCurrentPage;
	}

	public function setCurrentGroup($currentGroup){
		$this->currentGroup = $currentGroup;
	}

	public function getCurrentGroup(){
		return $this->currentGroup;
	}

	public function setLastGroup($lastGroup){
		$this->lastGroup = $lastGroup;
	}

	public function getLastGroup(){
		return $this->lastGroup;
	}

	public function setMinItemInCurrentGroup($minItemInCurrentGroup){
		$this->minItemInCurrentGroup = $minItemInCurrentGroup;
	}

	public function getMinItemInCurrentGroup(){
		return $this->minItemInCurrentGroup;
	}

	public function setMaxItemInCurrentGroup($maxItemInCurrentGroup){
		$this->maxItemInCurrentGroup = $maxItemInCurrentGroup;
	}

	public function getMaxItemInCurrentGroup(){
		return $this->maxItemInCurrentGroup;
	}

	public function setMinPageInCurrentGroup($minPageInCurrentGroup){
		$this->minPageInCurrentGroup = $minPageInCurrentGroup;
	}

	public function getMinPageInCurrentGroup(){
		return $this->minPageInCurrentGroup;
	}

	public function setMaxPageInCurrentGroup($maxPageInCurrentGroup){
		$this->maxPageInCurrentGroup = $maxPageInCurrentGroup;
	}

	public function getMaxPageInCurrentGroup(){
		return $this->maxPageInCurrentGroup;
	}

	public function setLastItemInCurrentGroup($lastItemInCurrentGroup){
		$this->lastItemInCurrentGroup = $lastItemInCurrentGroup;
	}

	public function getLastItemInCurrentGroup(){
		return $this->lastItemInCurrentGroup;
	}

	public function setLastPageInCurrentGroup($lastPageInCurrentGroup){
		$this->lastPageInCurrentGroup = $lastPageInCurrentGroup;
	}

	public function getLastPageInCurrentGroup(){
		return $this->lastPageInCurrentGroup;
	}

	public function setHasPreviousPage($hasPreviousPage){
		$this->hasPreviousPage = $hasPreviousPage;
	}

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

	public function setHasNextPage($hasNextPage){
		$this->hasNextPage = $hasNextPage;
	}

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

}

// // $limit is the same as "maxItemsPerPage"
//	public function getPagination($total, $limit, $offset, $limitPagesPerGroup){
/*

	public function getPaginationAsArray($total, $limit, $offset, $limitPagesPerGroup){
		$pagination = $this->getPagination($total, $limit, $offset, $limitPagesPerGroup);
		$paginationArray = array(
			"total"=>$pagination->getTotal(),
			"hasPreviousGroup"=>$pagination->hasPreviousGroup(),
			"previousGroupOffset"=>$pagination->getPreviousGroupOffset(),
			"hasNextGroup"=>$pagination->hasNextGroup(),
			"nextGroupOffset"=>$pagination->getNextGroupOffset(),
			"currentGroup"=>$pagination->getCurrentGroup(),
			"pages"=>$pagination->getPages(),
			"currentPage"=>$pagination->getCurrentPage(),
			"firstItemInCurrentPage"=>$pagination->getFirstItemInCurrentPage(),
			"lastItemInCurrentPage"=>$pagination->getLastItemInCurrentPage()
		);
		return $paginationArray;
	}
	*/
/*
$paginationService = new PaginationService();
$total = 1;
$limit = 15;
$offset = 0;
$limitPagesPerGroup = 1;
#$pagination = $paginationService->getPagination($total, $limit, $offset, $limitPagesPerGroup);
$paginationAsArray = $paginationService->getPaginationAsArray($total, $limit, $offset, $limitPagesPerGroup);
print_r($paginationAsArray);
*/

?>


text:
//
//  MAMapServices.h
//  MapKit_static
//
//  Created by AutoNavi.
//  Copyright (c) 2013年 AutoNavi. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface MAMapServices : NSObject

+ (MAMapServices *)sharedServices;

/*!
 @brief API Key, 在创建MAMapView之前需要先绑定key.
 */
@property (nonatomic, copy) NSString *apiKey;

/*!
 @brief SDK 版本号.
 */
@property (nonatomic, readonly) NSString *SDKVersion;

@end

redpajama_set_name: RedPajamaGithub


text:
/*
 * Platform device support for OC I2C-master for Leon SoC systems.
 * Based on: FSL SoC setup code, maintained by Kumar Gala
 * Modified by: Jan Andersson <jan@gaisler.com>
 *
 * This program is free software; you can redistribute  it and/or modify it
 * under  the terms of  the GNU General  Public License as published by the
 * Free Software Foundation;  either version 2 of the  License, or (at your
 * option) any later version.
 */

#include <linux/platform_device.h>
#include <linux/i2c-ocores.h>

#include <asm/oplib.h>

#include <asm/leon.h>

#ifdef CONFIG_LEON

#define I2C_APB_SPACE_LENGTH 256

static struct ocores_i2c_platform_data gri2c_pdata;

static int __init gri2c_platform_init(void)
{
	int node;
	unsigned int i;
	unsigned int devcnt;
	struct platform_device *i2cdev = NULL;
	amba_apb_device ai2c;
	int retval = 0;
	struct resource ri2c[2];

	devcnt = amba_get_number_apbslv_devices(VENDOR_GAISLER, GAISLER_I2CMST);

	node = prom_getchild(prom_root_node);
	gri2c_pdata.clock_khz = prom_getint(node, "clock-frequency");
	gri2c_pdata.regstep = 4;

	for (i = 0; i < devcnt; i++) {
		memset(&ri2c,0,sizeof(ri2c));
		if (!amba_get_free_apbslv_devices(
			    VENDOR_GAISLER,GAISLER_I2CMST, &ai2c, 1)) {
			retval = -ENODEV;
			break;
		}

		ri2c[0].start = ai2c.start;
		ri2c[0].end = ai2c.start + I2C_APB_SPACE_LENGTH - 1;
		ri2c[0].flags = IORESOURCE_MEM;

		ri2c[1].start = ri2c[1].end = ai2c.irq;
		ri2c[1].flags = IORESOURCE_IRQ;

		i2cdev = platform_device_register_simple(
			"ocores-i2c",i,ri2c,2);
		i2cdev->dev.platform_data = &gri2c_pdata;
	}

	if (devcnt == 0) {
	  retval = -ENODEV;
	};

	return retval;
}

arch_initcall(gri2c_platform_init);

#endif


text:
package com.microsoft.azure.management.advisor.v2017_04_19.implementation;

import com.microsoft.azure.management.advisor.v2017_04_19.Category;
import com.microsoft.azure.management.advisor.v2017_04_19.Impact;
import org.joda.time.DateTime;
import java.util.Map;
import com.microsoft.azure.management.advisor.v2017_04_19.Risk;
import com.microsoft.azure.management.advisor.v2017_04_19.ShortDescription;
import java.util.List;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.microsoft.rest.serializer.JsonFlatten;
import com.microsoft.azure.ProxyResource;

/**
 * Advisor Recommendation.
 */
@JsonFlatten
public class ResourceRecommendationBaseInner extends ProxyResource {
    /**
     * The category of the recommendation. Possible values include:
     * 'HighAvailability', 'Security', 'Performance', 'Cost',
     * 'OperationalExcellence'.
     */
    @JsonProperty(value = "properties.category")
    private Category category;

    /**
     * The business impact of the recommendation. Possible values include:
     * 'High', 'Medium', 'Low'.
     */
    @JsonProperty(value = "properties.impact")
    private Impact impact;

    /**
     * The resource type identified by Advisor.
     */
    @JsonProperty(value = "properties.impactedField")
    private String impactedField;

    /**
     * The resource identified by Advisor.
     */
    @JsonProperty(value = "properties.impactedValue")
    private String impactedValue;

    /**
     * The most recent time that Advisor checked the validity of the
     * recommendation.
     */
    @JsonProperty(value = "properties.lastUpdated")
    private DateTime lastUpdated;

    /**
     * The recommendation metadata.
     */
    @JsonProperty(value = "properties.metadata")
    private Map<String, Object> metadata;

    /**
     * The recommendation-type GUID.
     */
    @JsonProperty(value = "properties.recommendationTypeId")
    private String recommendationTypeId;

    /**
     * The potential risk of not implementing the recommendation. Possible
     * values include: 'Error', 'Warning', 'None'.
     */
    @JsonProperty(value = "properties.risk")
    private Risk risk;

    /**
     * A summary of the recommendation.
     */
    @JsonProperty(value = "properties.shortDescription")
    private ShortDescription shortDescription;

    /**
     * The list of snoozed and dismissed rules for the recommendation.
     */
    @JsonProperty(value = "properties.suppressionIds")
    private List<UUID> suppressionIds;

    /**
     * Extended properties.
     */
    @JsonProperty(value = "properties.extendedProperties")
    private Map<String, String> extendedProperties;

    /**
     * Get the category of the recommendation. Possible values include: 'HighAvailability', 'Security', 'Performance', 'Cost', 'OperationalExcellence'.
     *
     * @return the category value
     */
    public Category category() {
        return this.category;
    }

    /**
     * Set the category of the recommendation. Possible values include: 'HighAvailability', 'Security', 'Performance', 'Cost', 'OperationalExcellence'.
     *
     * @param category the category value to set
     * @return the ResourceRecommendationBaseInner object itself.
     */
    public ResourceRecommendationBaseInner withCategory(Category category) {
        this.category = category;
        return this;
    }

    /**
     * Get the business impact of the recommendation. Possible values include: 'High', 'Medium', 'Low'.
     *
     * @return the impact value
     */
    public Impact impact() {
        return this.impact;
    }

    /**
     * Set the business impact of the recommendation. Possible values include: 'High', 'Medium', 'Low'.
     *
     * @param impact the impact value to set
     * @return the ResourceRecommendationBaseInner object itself.
     */
    public ResourceRecommendationBaseInner withImpact(Impact impact) {
        this.impact = impact;
        return this;
    }

    /**
     * Get the resource type identified by Advisor.
     *
     * @return the impactedField value
     */
    public String impactedField() {
        return this.impactedField;
    }

    /**
     * Set the resource type identified by Advisor.
     *
     * @param impactedField the impactedField value to set
     * @return the ResourceRecommendationBaseInner object itself.
     */
    public ResourceRecommendationBaseInner withImpactedField(String impactedField) {
        this.impactedField = impactedField;
        return this;
    }

    /**
     * Get the resource identified by Advisor.
     *
     * @return the impactedValue value
     */
    public String impactedValue() {
        return this.impactedValue;
    }

    /**
     * Set the resource identified by Advisor.
     *
     * @param impactedValue the impactedValue value to set
     * @return the ResourceRecommendationBaseInner object itself.
     */
    public ResourceRecommendationBaseInner withImpactedValue(String impactedValue) {
        this.impactedValue = impactedValue;
        return this;
    }

    /**
     * Get the most recent time that Advisor checked the validity of the recommendation.
     *
     * @return the lastUpdated value
     */
    public DateTime lastUpdated() {
        return this.lastUpdated;
    }

    /**
     * Set the most recent time that Advisor checked the validity of the recommendation.
     *
     * @param lastUpdated the lastUpdated value to set
     * @return the ResourceRecommendationBaseInner object itself.
     */
    public ResourceRecommendationBaseInner withLastUpdated(DateTime lastUpdated) {
        this.lastUpdated = lastUpdated;
        return this;
    }

    /**
     * Get the recommendation metadata.
     *
     * @return the metadata value
     */
    public Map<String, Object> metadata() {
        return this.metadata;
    }

    /**
     * Set the recommendation metadata.
     *
     * @param metadata the metadata value to set
     * @return the ResourceRecommendationBaseInner object itself.
     */
    public ResourceRecommendationBaseInner withMetadata(Map<String, Object> metadata) {
        this.metadata = metadata;
        return this;
    }

    /**
     * Get the recommendation-type GUID.
     *
     * @return the recommendationTypeId value
     */
    public String recommendationTypeId() {
        return this.recommendationTypeId;
    }

    /**
     * Set the recommendation-type GUID.
     *
     * @param recommendationTypeId the recommendationTypeId value to set
     * @return the ResourceRecommendationBaseInner object itself.
     */
    public ResourceRecommendationBaseInner withRecommendationTypeId(String recommendationTypeId) {
        this.recommendationTypeId = recommendationTypeId;
        return this;
    }

    /**
     * Get the potential risk of not implementing the recommendation. Possible values include: 'Error', 'Warning', 'None'.
     *
     * @return the risk value
     */
    public Risk risk() {
        return this.risk;
    }

    /**
     * Set the potential risk of not implementing the recommendation. Possible values include: 'Error', 'Warning', 'None'.
     *
     * @param risk the risk value to set
     * @return the ResourceRecommendationBaseInner object itself.
     */
    public ResourceRecommendationBaseInner withRisk(Risk risk) {
        this.risk = risk;
        return this;
    }

    /**
     * Get a summary of the recommendation.
     *
     * @return the shortDescription value
     */
    public ShortDescription shortDescription() {
        return this.shortDescription;
    }

    /**
     * Set a summary of the recommendation.
     *
     * @param shortDescription the shortDescription value to set
     * @return the ResourceRecommendationBaseInner object itself.
     */
    public ResourceRecommendationBaseInner withShortDescription(ShortDescription shortDescription) {
        this.shortDescription = shortDescription;
        return this;
    }

    /**
     * Get the list of snoozed and dismissed rules for the recommendation.
     *
     * @return the suppressionIds value
     */
    public List<UUID> suppressionIds() {
        return this.suppressionIds;
    }

    /**
     * Set the list of snoozed and dismissed rules for the recommendation.
     *
     * @param suppressionIds the suppressionIds value to set
     * @return the ResourceRecommendationBaseInner object itself.
     */
    public ResourceRecommendationBaseInner withSuppressionIds(List<UUID> suppressionIds) {
        this.suppressionIds = suppressionIds;
        return this;
    }

    /**
     * Get extended properties.
     *
     * @return the extendedProperties value
     */
    public Map<String, String> extendedProperties() {
        return this.extendedProperties;
    }

    /**
     * Set extended properties.
     *
     * @param extendedProperties the extendedProperties value to set
     * @return the ResourceRecommendationBaseInner object itself.
     */
    public ResourceRecommendationBaseInner withExtendedProperties(Map<String, String> extendedProperties) {
        this.extendedProperties = extendedProperties;
        return this;
    }

}


text:
#include "tensorflow/lite/c/builtin_op_data.h"
#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/micro/debug_log.h"
#include "tensorflow/lite/micro/kernels/kernel_runner.h"
#include "tensorflow/lite/micro/test_helpers.h"
#include "tensorflow/lite/micro/testing/micro_test.h"

namespace tflite {
namespace testing {

template <typename T>
void ValidatePackGoldens(TfLiteTensor* tensors, int tensors_size,
                         TfLitePackParams params, TfLiteIntArray* inputs_array,
                         TfLiteIntArray* outputs_array, const T* golden,
                         int output_len, float tolerance, T* output) {
  // Place a unique value in the uninitialized output buffer.
  for (int i = 0; i < output_len; ++i) {
    output[i] = 23;
  }

  const TfLiteRegistration registration = tflite::ops::micro::Register_PACK();
  micro::KernelRunner runner(registration, tensors, tensors_size, inputs_array,
                             outputs_array, reinterpret_cast<void*>(&params));

  TF_LITE_MICRO_EXPECT_EQ(kTfLiteOk, runner.InitAndPrepare());
  TF_LITE_MICRO_EXPECT_EQ(kTfLiteOk, runner.Invoke());

  for (int i = 0; i < output_len; ++i) {
    TF_LITE_MICRO_EXPECT_NEAR(golden[i], output[i], tolerance);
  }
}

void TestPackTwoInputsFloat(int* input1_dims_data, const float* input1_data,
                            int* input2_dims_data, const float* input2_data,
                            int axis, int* output_dims_data,
                            const float* expected_output_data,
                            float* output_data) {
  TfLiteIntArray* input1_dims = IntArrayFromInts(input1_dims_data);
  TfLiteIntArray* input2_dims = IntArrayFromInts(input2_dims_data);
  TfLiteIntArray* output_dims = IntArrayFromInts(output_dims_data);
  const int output_dims_count = ElementCount(*output_dims);

  constexpr int input_size = 2;
  constexpr int output_size = 1;
  constexpr int tensors_size = input_size + output_size;
  TfLiteTensor tensors[tensors_size] = {CreateTensor(input1_data, input1_dims),
                                        CreateTensor(input2_data, input2_dims),
                                        CreateTensor(output_data, output_dims)};

  TfLitePackParams builtin_data = {
      .values_count = 2,
      .axis = axis,
  };
  int inputs_array_data[] = {2, 0, 1};
  TfLiteIntArray* inputs_array = IntArrayFromInts(inputs_array_data);
  int outputs_array_data[] = {1, 2};
  TfLiteIntArray* outputs_array = IntArrayFromInts(outputs_array_data);

  ValidatePackGoldens(tensors, tensors_size, builtin_data, inputs_array,
                      outputs_array, expected_output_data, output_dims_count,
                      1e-5f, output_data);
}

void TestPackThreeInputsFloat(int* input1_dims_data, const float* input1_data,
                              int* input2_dims_data, const float* input2_data,
                              int* input3_dims_data, const float* input3_data,
                              int axis, int* output_dims_data,
                              const float* expected_output_data,
                              float* output_data) {
  TfLiteIntArray* input1_dims = IntArrayFromInts(input1_dims_data);
  TfLiteIntArray* input2_dims = IntArrayFromInts(input2_dims_data);
  TfLiteIntArray* input3_dims = IntArrayFromInts(input3_dims_data);
  TfLiteIntArray* output_dims = IntArrayFromInts(output_dims_data);
  const int output_dims_count = ElementCount(*output_dims);

  constexpr int input_size = 3;
  constexpr int output_size = 1;
  constexpr int tensors_size = input_size + output_size;
  TfLiteTensor tensors[tensors_size] = {CreateTensor(input1_data, input1_dims),
                                        CreateTensor(input2_data, input2_dims),
                                        CreateTensor(input3_data, input3_dims),
                                        CreateTensor(output_data, output_dims)};

  TfLitePackParams builtin_data = {
      .values_count = 3,
      .axis = axis,
  };
  int inputs_array_data[] = {3, 0, 1, 2};
  TfLiteIntArray* inputs_array = IntArrayFromInts(inputs_array_data);
  int outputs_array_data[] = {1, 3};
  TfLiteIntArray* outputs_array = IntArrayFromInts(outputs_array_data);

  ValidatePackGoldens(tensors, tensors_size, builtin_data, inputs_array,
                      outputs_array, expected_output_data, output_dims_count,
                      1e-5f, output_data);
}

void TestPackTwoInputsQuantized(
    int* input1_dims_data, const uint8_t* input1_data, int* input2_dims_data,
    const uint8_t* input2_data, int axis, int* output_dims_data,
    const uint8_t* expected_output_data, uint8_t* output_data) {
  TfLiteIntArray* input1_dims = IntArrayFromInts(input1_dims_data);
  TfLiteIntArray* input2_dims = IntArrayFromInts(input2_dims_data);
  TfLiteIntArray* output_dims = IntArrayFromInts(output_dims_data);
  const int output_dims_count = ElementCount(*output_dims);

  constexpr int input_size = 2;
  constexpr int output_size = 1;
  constexpr int tensors_size = input_size + output_size;
  TfLiteTensor tensors[tensors_size] = {
      // CreateQuantizedTensor needs scale/zero_point values as input, but these
      // values don't matter as to the functionality of PACK, so just set as 1.0
      // and 128.
      CreateQuantizedTensor(input1_data, input1_dims, 1.0, 128),
      CreateQuantizedTensor(input2_data, input2_dims, 1.0, 128),
      CreateQuantizedTensor(output_data, output_dims, 1.0, 128)};

  TfLitePackParams builtin_data = {
      .values_count = 2,
      .axis = axis,
  };
  int inputs_array_data[] = {2, 0, 1};
  TfLiteIntArray* inputs_array = IntArrayFromInts(inputs_array_data);
  int outputs_array_data[] = {1, 2};
  TfLiteIntArray* outputs_array = IntArrayFromInts(outputs_array_data);

  ValidatePackGoldens(tensors, tensors_size, builtin_data, inputs_array,
                      outputs_array, expected_output_data, output_dims_count,
                      1e-5f, output_data);
}

void TestPackTwoInputsQuantized32(
    int* input1_dims_data, const int32_t* input1_data, int* input2_dims_data,
    const int32_t* input2_data, int axis, int* output_dims_data,
    const int32_t* expected_output_data, int32_t* output_data) {
  TfLiteIntArray* input1_dims = IntArrayFromInts(input1_dims_data);
  TfLiteIntArray* input2_dims = IntArrayFromInts(input2_dims_data);
  TfLiteIntArray* output_dims = IntArrayFromInts(output_dims_data);
  const int output_dims_count = ElementCount(*output_dims);

  constexpr int input_size = 2;
  constexpr int output_size = 1;
  constexpr int tensors_size = input_size + output_size;
  TfLiteTensor tensors[tensors_size] = {CreateTensor(input1_data, input1_dims),
                                        CreateTensor(input2_data, input2_dims),
                                        CreateTensor(output_data, output_dims)};

  TfLitePackParams builtin_data = {
      .values_count = 2,
      .axis = axis,
  };
  int inputs_array_data[] = {2, 0, 1};
  TfLiteIntArray* inputs_array = IntArrayFromInts(inputs_array_data);
  int outputs_array_data[] = {1, 2};
  TfLiteIntArray* outputs_array = IntArrayFromInts(outputs_array_data);

  ValidatePackGoldens(tensors, tensors_size, builtin_data, inputs_array,
                      outputs_array, expected_output_data, output_dims_count,
                      1e-5f, output_data);
}

}  // namespace testing
}  // namespace tflite

TF_LITE_MICRO_TESTS_BEGIN

TF_LITE_MICRO_TEST(PackFloatThreeInputs) {
  int input_shape[] = {1, 2};
  int output_shape[] = {2, 3, 2};
  const float input1_values[] = {1, 4};
  const float input2_values[] = {2, 5};
  const float input3_values[] = {3, 6};
  const float golden[] = {1, 4, 2, 5, 3, 6};
  const int axis = 0;
  constexpr int output_dims_count = 6;
  float output_data[output_dims_count];

  tflite::testing::TestPackThreeInputsFloat(
      input_shape, input1_values, input_shape, input2_values, input_shape,
      input3_values, axis, output_shape, golden, output_data);
}

TF_LITE_MICRO_TEST(PackFloatThreeInputsDifferentAxis) {
  int input_shape[] = {1, 2};
  int output_shape[] = {2, 2, 3};
  const float input1_values[] = {1, 4};
  const float input2_values[] = {2, 5};
  const float input3_values[] = {3, 6};
  const float golden[] = {1, 2, 3, 4, 5, 6};
  const int axis = 1;
  constexpr int output_dims_count = 6;
  float output_data[output_dims_count];

  tflite::testing::TestPackThreeInputsFloat(
      input_shape, input1_values, input_shape, input2_values, input_shape,
      input3_values, axis, output_shape, golden, output_data);
}

TF_LITE_MICRO_TEST(PackFloatThreeInputsNegativeAxis) {
  int input_shape[] = {1, 2};
  int output_shape[] = {2, 2, 3};
  const float input1_values[] = {1, 4};
  const float input2_values[] = {2, 5};
  const float input3_values[] = {3, 6};
  const float golden[] = {1, 2, 3, 4, 5, 6};
  const int axis = -1;
  constexpr int output_dims_count = 6;
  float output_data[output_dims_count];

  tflite::testing::TestPackThreeInputsFloat(
      input_shape, input1_values, input_shape, input2_values, input_shape,
      input3_values, axis, output_shape, golden, output_data);
}

TF_LITE_MICRO_TEST(PackFloatMultilDimensions) {
  int input_shape[] = {2, 2, 3};
  int output_shape[] = {3, 2, 2, 3};
  const float input1_values[] = {1, 2, 3, 4, 5, 6};
  const float input2_values[] = {7, 8, 9, 10, 11, 12};
  const float golden[] = {1, 2, 3, 7, 8, 9, 4, 5, 6, 10, 11, 12};
  const int axis = 1;
  constexpr int output_dims_count = 12;
  float output_data[output_dims_count];

  tflite::testing::TestPackTwoInputsFloat(input_shape, input1_values,
                                          input_shape, input2_values, axis,
                                          output_shape, golden, output_data);
}

TF_LITE_MICRO_TEST(PackQuantizedMultilDimensions) {
  int input_shape[] = {2, 2, 3};
  int output_shape[] = {3, 2, 2, 3};
  const uint8_t input1_values[] = {1, 2, 3, 4, 5, 6};
  const uint8_t input2_values[] = {7, 8, 9, 10, 11, 12};
  const uint8_t golden[] = {1, 2, 3, 7, 8, 9, 4, 5, 6, 10, 11, 12};
  const int axis = 1;
  constexpr int output_dims_count = 12;
  uint8_t output_data[output_dims_count];

  tflite::testing::TestPackTwoInputsQuantized(
      input_shape, input1_values, input_shape, input2_values, axis,
      output_shape, golden, output_data);
}

TF_LITE_MICRO_TEST(PackQuantized32MultilDimensions) {
  int input_shape[] = {2, 2, 3};
  int output_shape[] = {3, 2, 2, 3};
  const int32_t input1_values[] = {1, 2, 3, 4, 5, 6};
  const int32_t input2_values[] = {7, 8, 9, 10, 11, 12};
  const int32_t golden[] = {1, 2, 3, 7, 8, 9, 4, 5, 6, 10, 11, 12};
  const int axis = 1;
  constexpr int output_dims_count = 12;
  int32_t output_data[output_dims_count];

  tflite::testing::TestPackTwoInputsQuantized32(
      input_shape, input1_values, input_shape, input2_values, axis,
      output_shape, golden, output_data);
}

TF_LITE_MICRO_TESTS_END


text:
<!DOCTYPE html>

	<meta name="generator" content="Hugo 0.38.1" />

<title>Jesús López de la Cruz - Curriculum Vitae (Jesús LC)</title>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="favicon.ico">

<meta name="description" content="Jesús L.C. Curriculum Vitae. I am a computer engineer and passionate about programming. I like traveling, miss walking through the city and I enjoy fooding. I am Test Driven Development advocate and I love Refactoring too.  I like designing architectures and thinking about how to improve development workflows, but I enjoy getting my hands dirty. I am a friendly guy, always searching for new experiencies and meeting new people.">

<meta name="author" content="Jesús LC">
<meta property="og:title" content="Jesús López de la Cruz - Curriculum Vitae (Jesús LC)" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://cv.jesuslc.com/" />
<meta property="og:image" content="http://cv.jesuslc.com/assets/images/jesuslc.png" />
<meta property="og:description" content="Jesús L.C. Curriculum Vitae. I am a computer engineer and passionate about programming. I like traveling, miss walking through the city and I enjoy fooding. I am Test Driven Development advocate and I love Refactoring too.  I like designing architectures and thinking about how to improve development workflows, but I enjoy getting my hands dirty. I am a friendly guy, always searching for new experiencies and meeting new people." />
<meta property="og:site_name" content="Jesús López de la Cruz - Curriculum Vitae (Jesús LC)" />
<meta property="og:locale:alternate" content="en_US" />

<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@jeslopcru">
<meta name="twitter:title" content="Jesús López de la Cruz - Curriculum Vitae (Jesús LC)">
<meta name="twitter:description" content="Jesús L.C. Curriculum Vitae. I am a computer engineer and passionate about programming. I like traveling, miss walking through the city and I enjoy fooding. I am Test Driven Development advocate and I love Refactoring too.  I like designing architectures and thinking about how to improve development workflows, but I enjoy getting my hands dirty. I am a friendly guy, always searching for new experiencies and meeting new people.">
<meta name="twitter:creator" content="@jeslopcru">
<meta name="twitter:image" content="http://cv.jesuslc.com/assets/images/jesuslc.png">

<meta name="description" content="Jesús L.C. Curriculum Vitae. I am a computer engineer and passionate about programming. I like traveling, miss walking through the city and I enjoy fooding. I am Test Driven Development advocate and I love Refactoring too.  I like designing architectures and thinking about how to improve development workflows, but I enjoy getting my hands dirty. I am a friendly guy, always searching for new experiencies and meeting new people."/>
<meta name="googlebot" content="index, follow"/>
<meta name="robots" content="index, follow"/>
<link rel="canonical" href="http://cv.jesuslc.com/"/>

<link href='https://fonts.googleapis.com/css?family=Roboto:400,500,400italic,300italic,300,500italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>

<link rel="stylesheet" href="http://cv.jesuslc.com/assets/plugins/bootstrap/css/bootstrap.min.css">

<link rel="stylesheet" href="http://cv.jesuslc.com/assets/plugins/font-awesome/css/font-awesome.css">

<link id="theme-style" rel="stylesheet" href="http://cv.jesuslc.com/assets/css/styles.css">

Jesús López de la Cruz

Software Engineer - Scrum Master & ITIL Certified

jeslopcru@gmail.com

jesuslc.com

linkedin.com/in/jesuslc

github.com/jeslopcru

@jeslopcru

Education

Professional Scrum Master I

Scrum.org

2017

ITIL Foundation V3

Tecnofor

2015

Master Degree in Software Engineering

University of Seville

Interests

Cooking

Family

Travelling

Blogging

Coding

Agile

Career Profile

I am a computer engineer and passionate about programming. I like traveling, miss walking through the city and I enjoy fooding. I am Test Driven Development advocate and I love Refactoring too.  I like designing architectures and thinking about how to improve development workflows, but I enjoy getting my hands dirty. I am a friendly guy, always searching for new experiences and meeting new people.

    Experiences

Agile Software Engineer

February 2015 - Present

                Coches.com - Madrid

Development and continuous improvement to the company’s products and services focus on the final users. Technology changes and devolopment methods for improve the process, products.

Agile Management using Jira, Jira Service Desk, Confluence and Scrum.

PHP Development using Yii, Yii2, Doctrine, Boostrap and JQuery.

Using Varnish for A/B Test
. - Development using Wordpress.

Management: Agile using Scrum, Test Driven Development(TDD), Pair Programming and Code Review.

Technology and tools: Jira, Confluence, Bitbucket, Jenkins, Git (Gitflow) for management. PHP, HTML. CSS, JQuery, Bootstrap, gulp, Yii, Yii2, Wordpress, Doctrine,PHPUnit, Varnish, Docker, MariaDB for development.

Lecturer

October 2016

                geekshubsacademy.com - Online

                Online refactoring course for PHP developers at geekshubsacademy.com.The purpose of this course is to improve the PHP code of our applications without fear of breaking functionality and improving code maintenance.

Software Developer

September 2013 - February 2015

                Genexies Mobile, Madrid

Genexies business is selling digital content (music, games,…) over the Internet for mobile devices and PC.
 Develop our own platform for management content:

Implementing modules and components using PHP and Symfony.

Integration with third party services (OAuth, ZED-MSCP, telecommunications billing).

Integration with broadband and telecommunications providers.

Testing and quality.

Generation and automation of reports.

Layout on mobile devices.

Tools: Jira, Confluence, Fisheye Using agile methodology like Scrum and Kanban.

Techonology: PHP (Symfony), PHPUnit, Wordpress, MySQL, Java (Spring framework), Maven, Apache, Memcached, Jenkins, Selenium, ActiveMQ, Mercurial, Capistrano, Varnish,Vagrant, Graylog.

Software Developer

June 2012 - January 2013

                Zinetic, Madrid

Management and development web applications, corporate portals and online stores based on Joomla platform.
 - Develop modules and custom component.
 - Development payment gateway (ClearOne, Paypal).
 - Portal Integration with other systems

Development Aurgi ecommerce web site.

Technology: PHP, ISS, Joomla, MySQL, HTML, CSS and JQuery.

    Certifications and Education

Curso Online de Cloud Computing con Amazon Web Services (AWS)

September 2018

                UPV, Online

                Course covers the principles of Cloud Computing using Amazon Web Services: Cloud Computing, Amazon Web Services. Application Architecture,. Deploy and automatic provision. Docker. Big Data. Serverless.

Professional Scrum Master I

February 2017

                Scrum.org, Madrid

                Course covers the principles and (empirical) process theory underpinning the Scrum framework, and the role of the Scrum Master in it. The Professional Scrum Master™ level I (PSM I) assessment validate his depth of knowledge of the Scrum framework and its application.

Refactoring to Patterns

April 2016

                Geekshubs Academy, Online

                When we have learned the ‘Wax on, Wax off’ of refactoring and our functions are no longer than 20 lines, our code is semantic and clean, then we begin to see that our structure, our design, also needs attention. Therefore we will apply refactoring mechanics converging to well known patterns.

ITIL Foundation V3

March 2015

                Peoplecert, Madrid

                ITIL Foundation is suitable for individuals who require a basic understanding of the ITIL framework and how it may be used to enhance the quality of IT service management within an organization. The ITIL Foundation Certification also applies to IT professionals who work within an organization that has adopted ITIL and so need to be aware of and contribute to the overall service improvement programme.

Master Degree in Software Engineering

March 2015

                University of Seville

    Projects

I love Open Source and I share code. I enjoy getting my hands dirty coding and learning about software.

            VarnishAdmin

Varnish is an HTTP accelerator designed for content-heavy dynamic web sites as well as heavily consumed APIs. Using VarnishAdmin can connect to varnishadm using PHP and sockets to interact with Varnish. Sending purges url, seeing the state of Varnish,…

            Git-Score

git-score is a script to compute some ‘scores’ for committers in a git repo. Use it for fun or to brag about your involvement in the development of a project.

            Mac-Automatic-install

Ansible playbook for installing Mac OS X to my development needs.

            Legacy Code

As a developer, we often work with old code without tests and sometimes with a somewhat confusing organization. To learn and practice different techniques I began the Legacy Code project also blog you can see a series of posts where this application completely refactor legacy written in PHP.

    Talks

            Git y Personas - CommitConf

November 2018

Talk about branching strategies at CommitConf. A comparative about diferents branching strategies for teams

            Test Driven Development - Kata - PHPSevilla

November 2017

Meetup about Test Driven Development at PHPSevilla Meetup. A little introduction to TDD with a kata to finish. The slides were made using Keynote.

            Testing 'A dormir tranquilos'

October 2017

Internal talk about testing The content is about what is testing, the different types of test that exist and the basic concepts of this process. Some tips and anti pattern

            Refactoring Introduction

June 2017

Meetup about Refacting in PHP at PHPSevilla Meetup. The idea was to show how with patience and baby steps we can greatly improve our code. Making a special emphasis on readability and making what we program is easy to understand. The slides was made using Keynote with the PHPSevilla template.

            Test Driven Development in PHP

January 2017

Internal talk about Test Driven Development(TDD) in PHP at coches.com. A little introduction to TDD with a kata to finish. The slides were made using Keynote.

            Refactoring in PHP

October 2016

Online refactoring in PHP course at geekshubsacademy.com.The purpose of this course is to improve the PHP code of our applications without fear of breaking functionality and improving code maintenance. The idea is to learn techniques to improve our abilities as programmers and to be able to face modifications in a legacy code avoiding the common problems. The slides were made using Keynote.

            Mocks

May 2015

Internal talk about Testing at coches.com. Little introduction about mocks. The slides make using shower

Skills & Proficiency

Web Development: PHP, Javascript, HTML, Go

Testing, Refactoring, Quality assurance

TDD, BDD, Continuous Integration, eXtreme Programing, Code Review

Agile: Scrum, Kanban, Lean

Devops: Docker, Vangrant, Ansible, Linux

                Designed with  by Xiaoying Riley for developers

				2019 © Development by Jesús LC using Hugo and customized Orbit template - Curriculum Vitae


text:
require 'spec_helper'

describe 'Integration with Rio II' do

  before :all do
    wsdl_url  = 'http://193.155.1.72/MyCentral-RioII-Services/SecurityService.svc?wsdl'
    wsdl0_url = 'http://193.155.1.72/MyCentral-RioII-Services/SecurityService.svc?wsdl=wsdl0'

    # mock wsdl imports
    http_mock.fake_request(wsdl_url,  'wsdl/rio2/rio2.wsdl')
    http_mock.fake_request(wsdl0_url, 'wsdl/rio2/rio2_0.wsdl')

    # mock schema imports
    schema_import_base = 'http://193.155.1.72/MyCentral-RioII-Services/SecurityService.svc?xsd=xsd%d'
    (0..3).each do |i|
      url = schema_import_base % i
      http_mock.fake_request(url, "wsdl/rio2/rio2_#{i}.xsd")
    end

    @client = Savon.new(wsdl_url)
  end

  it 'only downloads WSDL and XML Schema imports once per location' do
    expect(@client.services).to eq(
      'SecurityService' => {
        ports: {
          'BasicHttpBinding_ISecurityService' => {
            type: 'http://schemas.xmlsoap.org/wsdl/soap/',
            location: 'http://193.155.1.72/MyCentral-RioII-Services/SecurityService.svc/soap'
          }
        }
      }
    )
  end

  it 'knows the GetSessionState operation' do
    service, port = :SecurityService, :BasicHttpBinding_ISecurityService
    operation = @client.operation(service, port, :GetSessionState)

    expect(operation.input_style).to eq('document/literal')

    expect(operation.example_body).to eq(
      GetSessionState: {
        session: {
          ApplicationId: 'string',
          CultureCode: 'string',
          SessionId: 'string'
        },
        request: {
          Context: 'string'
        }
      }
    )
  end

end


text:
/*** CONFIG ***/

var IS_ALL_LOCAL = true; // a hack to switch all operations to local simulations of network services

/*** LOCAL VARIABLES ***/

var LOCAL_ACCOUNT = null;

/*** LOGIN ***/

function login_process() {
    var email = $('#email').val();

    // qqLGW: validate email as an email address

    if (IS_ALL_LOCAL) {
        local_login(email);
    } else {
        remote_login(email);
    }
}

function logout_process() {
    // always local logout
    local_logout();
}

/*** PAGE TRANSITIONS ***/

function visit_my_detox() { jQuery.mobile.changePage('my-detox.html', { transition: 'slide' }); }
function visit_menu() { jQuery.mobile.changePage('menu.html', { transition: 'slide' }); }
function visit_settings() { jQuery.mobile.changePage('settings.html', { transition: 'flip' }); }
function visit_rewards() { jQuery.mobile.changePage('rewards.html', { transition: 'slide' }); }
function visit_posts() { jQuery.mobile.changePage('posts-list.html', { transition: 'slide' }); }
function visit_stats() { jQuery.mobile.changePage('stats.html', { transition: 'slide' }); }
function visit_campaign() { jQuery.mobile.changePage('campaign.html', { transition: 'slide' }); }
function visit_offers() { jQuery.mobile.changePage('offers.html', { transition: 'slide' }); }

/*** PAGE LOAD EVENTS ***/

$(document).delegate('#posts-list', 'pageshow', load_post_list);

function load_post_list() {
    if (IS_ALL_LOCAL) {
        local_retrieve_posts();
    } else {
        remote_retrieve_posts();
    }
}

/*** REMOTE SERVICE ACCESS ***/

var REMOTE_SERVER = 'http://54.247.76.95';
var PATH_REMOTE_LOGIN = '/account';
var PATH_RETRIEVE_ALL_POSTS = '/post/pending';
var PATH_CREATE_POST = '/post/create';

function remote_login(email) {

    // FYI: email is currently ignored

    $.ajax({ type: "GET",
        contenttype: "application/json; charset=utf-8",
        data: "{null}",
        url: REMOTE_SERVER + PATH_REMOTE_LOGIN,
        dataType:"json",
        success: function(res) {
            var obj = JSON.parse(res);
            $("#welcome-name").html(obj.Name);
            $('#login-prompt').fadeOut('fast', function() { $('#logged-in-prompt').fadeIn('slow'); });
        },
        error: function(err,status,statusTxt) {
            alert('An error occurred logging in to Digital Detox: ' + statusTxt);
        }
    });
}

function remote_retrieve_posts() {

    $.ajax({ type: "GET",
        contenttype: "application/json; charset=utf-8",
        data: "{null}",
        url: REMOTE_SERVER + PATH_RETRIEVE_ALL_POSTS,
        dataType:"json",
        success: function(res) {
            var obj = JSON.parse(res);
            populate_post_list(obj);
        },
        error: function(err,status,statusTxt) {
            alert('An error occurred retrieving your held posts: ' + statusTxt);
        }
    });
}

function remote_submit_post(postText) {
    var out = { Content: postText, SendLater: true };

    $.ajax({ type: "POST",
        contenttype: "application/json; charset=utf-8",
        data: out,
        url: REMOTE_SERVER + PATH_CREATE_POST,
        dataType:"json",
        success: function(res) {
            jQuery.mobile.changePage('posts-list.html');
        },
        error: function(err,status,statusTxt) {
            alert('An error occurred storing your post: ' + statusTxt);
        }
    });
}

/*** LOCAL SERVICE SIMULATION ACCESS ***/

function local_login(email) {
    // var name = substr(); // qqLGW split string by '@' if present

    LOCAL_ACCOUNT = {
        Account: email,
        Name: 'Demo User'
    };

    $("#welcome-name").html(LOCAL_ACCOUNT.Name);
    $('#login-prompt').fadeOut('fast', function() { $('#logged-in-prompt').fadeIn('slow'); });
}

function local_logout() {
    LOCAL_ACCOUNT = null;
    $('#logged-in-prompt').fadeOut('fast', function() { $('#login-prompt').fadeIn('slow'); });
}

var LOCAL_POSTS = null;
function local_retrieve_posts() {

    if (LOCAL_POSTS == null) {
        LOCAL_POSTS = new Array(); // fake_posts_data();
    }

    populate_post_list(LOCAL_POSTS);
}

function local_submit_post(postText) {
    LOCAL_POSTS.push({
            UID: LOCAL_POSTS.length,
            Timestamp: new Date().getTime(),
            Content: postText,
            Network: 'twitter',
            AccountID: LOCAL_ACCOUNT.Account
        });
    jQuery.mobile.changePage('posts-list.html');
}

/*** POSTING ***/

function post_paid() { alert('Paid posting is not yet implemented.'); }

function post_submit() {
    var postText = $('#new-post').val();

    if (IS_ALL_LOCAL) {
        local_submit_post(postText);
    } else {
        remote_submit_post(postText);
    }
}

/*** LIST POPULATION ***/

/**
 * posts - { posts[ { UID, timestamp, text, network, accountID } ] }
 * UID: number
 * Timestamp: number
 * Content: string
 * Network: string (facebook|twitter|other)
 * AccountID: string
 **/
function populate_post_list(posts) {
    var ul = '';
    for (var i = 0; i < posts.length; i++) {
        var post = posts[i];

        networkImg = 'icons/64x64/twitter.png';
        //if (post.network == 'facebook') { networkImg = 'icons/64x64/facebook.png'; }
        //if (post.network == 'twitter') { networkImg = 'icons/64x64/twitter.png'; }

        var li =
                '
' +
                    '' +
                        '' +
                        '
' + post.Content + '
' +
                        '
twitter
' +
                    '' +
                    '' +
                '
';

        ul += li;
    }

    //ul = '
' + ul + '
';
    //alert(ul);
    if (posts.length == 0) {
        $('#posts-list-ul').hide();
        $('#no-posts-div').show();
    } else {
        $('#no-posts-div').hide();
        $('#posts-list-ul').show();

        $('#posts-list-ul').html(ul);
        $('#posts-list-ul').attr('data-split-icon', 'delete');
        $('#posts-list-ul').listview();
    }
}


text:
<?php

declare(strict_types=1);

namespace Pusher\Tests\Laravel;

use InvalidArgumentException;
use Pusher\Laravel\PusherFactory;
use Pusher\Pusher;

/**
 * This is the Pusher factory test class.
 *
 * @author Vincent Klaiber <hello@vinkla.com>
 */
class PusherFactoryTest extends AbstractTestCase
{
    public function testMakeStandard()
    {
        $factory = $this->getPusherFactory();

        $return = $factory->make([
            'auth_key' => 'your-auth-key',
            'secret' => 'your-secret',
            'app_id' => 'your-app-id',
            'options' => [],
            'host' => null,
            'port' => null,
            'timeout' => null,
        ]);

        $this->assertInstanceOf(Pusher::class, $return);
    }

    public function testMakeWithoutAuthKey()
    {
        $factory = $this->getPusherFactory();

        $this->expectException(InvalidArgumentException::class);

        $factory->make([
            'secret' => 'your-secret',
            'app_id' => 'your-app-id',
            'options' => [],
            'host' => null,
            'port' => null,
            'timeout' => null,
        ]);
    }

    public function testMakeWithoutAppId()
    {
        $factory = $this->getPusherFactory();

        $this->expectException(InvalidArgumentException::class);

        $factory->make([
            'auth_key' => 'your-auth-key',
            'secret' => 'your-secret',
            'options' => [],
            'host' => null,
            'port' => null,
            'timeout' => null,
        ]);
    }

    public function testMakeWithoutSecret()
    {
        $factory = $this->getPusherFactory();

        $this->expectException(InvalidArgumentException::class);

        $factory->make([
            'auth_key' => 'your-auth-key',
            'app_id' => 'your-app-id',
            'options' => [],
            'host' => null,
            'port' => null,
            'timeout' => null,
        ]);
    }

    protected function getPusherFactory()
    {
        return new PusherFactory();
    }
}


text:
FROM ubuntu:18.04

ENV LC_ALL=C.UTF-8
ENV LANG C.UTF-8

# update os
RUN apt-get -y update --fix-missing
RUN apt-get install -y --no-install-recommends net-tools curl software-properties-common gnupg-agent

# install dependencies
RUN apt-get install -y --no-install-recommends osm2pgsql osmctools

# install python3
RUN apt-get install -q -y --no-install-recommends \
    python3.6 python3.6-dev python3-pip python3-setuptools python3-wheel gcc build-essential

# install nodejs, npm
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash
RUN apt-get install -y nodejs

RUN apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# init app
RUN mkdir /app
WORKDIR /app

# common
COPY osm_validator/ /app/osm_validator/
COPY main.py /app/main.py
COPY schedule.py /app/schedule.py
COPY Pipfile /app/Pipfile
COPY Pipfile.lock /app/Pipfile.lock
COPY osm2pgslq.style /app/osm2pgslq.style

# migrations
COPY migrations /app/migrations/
COPY alembic.ini /app/alembic.ini

# python test
COPY tox.ini /app/tox.ini
COPY setup.cfg /app/setup.cfg
COPY empty.osm /app/empty.osm

# static
COPY osm_validator_front/ /app/osm_validator_front/
COPY static/ /app/static/
COPY package.json /app/package.json
COPY package-lock.json /app/package-lock.json
COPY webpack.config.js /app/webpack.config.js
COPY .babelrc /app/.babelrc
COPY .eslintrc /app/.eslintrc

# install python requirements
RUN pip3 install pipenv --upgrade
RUN pipenv install --python python3.6

# # install js requirements
RUN npm install

# build js app
RUN node_modules/.bin/webpack

CMD ["/bin/bash"]


text:
class RuminFile
  attr_reader :file_name, :last_modified

  def initialize(file_name)
    @file_name = File.expand_path(file_name)
    if FileTest.exist?(file_name) then
      stat = File::Stat.new(@file_name)
      @last_modified = Time.at(stat.mtime.to_f)
    end
  end

  def write(content='')
    file = File.open(@file_name, "w")
    file.write(content)
    stat = File::Stat.new(@file_name)
    @last_modified = Time.at(stat.mtime.to_f)
    file.close
  end

  def read
    file = File.open(@file_name, "r")
    content = file.readlines
    file.close
    if content == nil then
      return ''
    else
      content
    end
  end

  def is_changed?
    stat = File::Stat.new(@file_name)
    current_modified = Time.at(stat.mtime.to_f)
    if @last_modified.to_s == current_modified.to_s then
      return false
    else
      return true
    end
  end
end


text:
/********************************************************/
/*                                                      */
/*  Copley Motion Libraries                             */
/*                                                      */
/*  Copyright (c) 2010 Copley Controls Corp.            */
/*                     http://www.copleycontrols.com    */
/*                                                      */
/********************************************************/

/***************************************************************************/
/** \file
  This file contains code used to parse CME-2 type files.
  */
/***************************************************************************/

#include "CML.h"

#ifdef CML_FILE_ACCESS_OK
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#endif

CML_NAMESPACE_START()

#ifdef CML_FILE_ACCESS_OK
/***************************************************************************/
/**
  Read a string from the passed file.  The string is read until the EOF or end
  of line is encountered.  If the line is too long to fit in the passed buffer,
  the line will be clipped, but the fill will be read until the EOL and any
  extra data will be lost.
  @param ptr The file pointer of an open file
  @param buff The buffer where the data will be returned
  @param max The size of the buffer.
  @return A pointer to an error object, or NULL on success.
  */
/***************************************************************************/
const Error *ReadLine( void *ptr, char *buff, int max )
{
   FILE *fp = (FILE *)ptr;

   for( int i=0; ; )
   {
      int c = getc(fp);

      if( c == EOF || c == '\n' )
      {
         buff[i] = 0;
         return 0;
      }

      if( i < (max-1) )
         buff[i++] = c;
   }
}

/***************************************************************************/
/**
  Split the passed string into segments delimited by a character.
  This also strips white space at the start and end of each segment.
  @param buff The string to split.  This should end with a terminating zero.
  @param seg An array of character pointers which will point to the split
  line segments on return
  @param max The maximum number of segments to split the line into.
  @param delim The delimiter (comma by default)
  @return The number of segments the line was split into
  */
/***************************************************************************/
int SplitLine( char *buff, char **seg, int max, char delim )
{
   int i;
   for( i=0; i<max && *buff; i++ )
   {
      // Skip leading white space
      while( isspace(*buff) )
         buff++;

      if( i==0 && *buff==0 )
         break;

      // Grab start of next segment
      seg[i] = buff;

      // Find end
      while( *buff && *buff != delim )
         buff++;

      // Strip trailing white space
      for( char *ptr = buff-1; ptr >= seg[i] && isspace(*ptr); *ptr-- = 0 ){}

      // End segment
      if( *buff == delim )
         *buff++ = 0;
   }
   return i;
}

/***************************************************************************/
/**
  Convert an ASCII string into a 32-bit integer value.
  @param str The string to convert
  @param i The integer value will be returned here
  @param base The base to use during the conversion
  @return An error pointer or NULL on success
  */
/***************************************************************************/
const Error *StrToInt32( char *str, int32 &i, int base )
{
   char *end;
   i = (int32)strtol( str, &end, base );

   if( *end )
      return &AmpFileError::format;
   return 0;
}

/***************************************************************************/
/**
  Convert an ASCII string into a 32-bit unsigned integer value.
  @param str The string to convert
  @param i The integer value will be returned here
  @param base The base to use during the conversion
  @return An error pointer or NULL on success
  */
/***************************************************************************/
const Error *StrToUInt32( char *str, uint32 &i, int base )
{
   char *end;
   i = (int32)strtoul( str, &end, base );

   if( *end )
      return &AmpFileError::format;
   return 0;
}

/***************************************************************************/
/**
  Convert an ASCII string into a 16-bit integer value.
  @param str The string to convert
  @param i The integer value will be returned here
  @param base The base to use during the conversion
  @return An error pointer or NULL on success
  */
/***************************************************************************/
const Error *StrToInt16( char *str, int16 &i, int base )
{
   int32 l;
   const Error *err = StrToInt32( str, l, base );
   if( err ) return err;

   if( (l < -32768) || (l>32767) )
      return &AmpFileError::range;

   i = (int16)l;
   return 0;
}

/***************************************************************************/
/**
  Convert an ASCII string into a 16-bit unsigned integer value.
  @param str The string to convert
  @param i The integer value will be returned here
  @param base The base to use during the conversion
  @return An error pointer or NULL on success
  */
/***************************************************************************/
const Error *StrToUInt16( char *str, uint16 &i, int base )
{
   uint32 l;
   const Error *err = StrToUInt32( str, l, base );
   if( err ) return err;

   if( (l>65535) )
      return &AmpFileError::range;

   i = (uint16)l;
   return 0;
}

/***************************************************************************/
/**
  Convert an ASCII string (as read from a .ccx file) into an output pin
  configuration & mask value.
  @param str The string to decode
  @param cfg The configuration will be returned here
  @param mask1 The first output pin mask value will be returned here.
  @param mask2 The second output pin mask value will be returned here.
  @return An error pointer or NULL on success
  */
/***************************************************************************/
const Error *StrToOutCfg( char *str, OUTPUT_PIN_CONFIG &cfg, uint32 &mask1, uint32 &mask2 )
{
   const Error *err = 0;
   char *seg[4];
   int16 c;

   // The second mask is optional.  If it's not in the
   // file then it defaults to zero.
   mask2 = 0;

   switch( SplitLine( str, seg, 4, ':' ) )
   {
      case 3:
         err = StrToUInt32( seg[2], mask2, 16 );

      case 2:
         if( !err ) err = StrToInt16( seg[0], c, 16 );
         if( !err ) err = StrToUInt32( seg[1], mask1, 16 );
         cfg = (OUTPUT_PIN_CONFIG)c;
         break;

      default:
         return &AmpFileError::format;
   }

   return err;
}
/***************************************************************************/
/**
  Convert an ASCII string (as read from a .ccx file) into a set of filter
  coefficients.
  @param str The string to decode
  @param flt The filter structure to be filled
  @return An error pointer or NULL on success
  */
/***************************************************************************/
const Error *StrToFilter( char *str, Filter &flt )
{
   char *seg[10];

   int ct = SplitLine( str, seg, 10, ':' );

   if( (ct!=7) && (ct!=9) )
      return &AmpFileError::format;

   int32 coef[9];

   const Error *err = 0;
   for( int i=0; i<ct; i++ )
   {
      if( !err )
         err = StrToInt32( seg[i], coef[i] );
   }

   if( !err )
      err = flt.LoadFromCCX( coef, ct );

   return err;
}

/***************************************************************************/
/**
  Convert an ASCII string (as read from a .ccx file) into a set of input
  shaper impulses.
  @param str The string to decode
  @param inShape The filter structure to be filled
  @return An error pointer or NULL on success
  */
/***************************************************************************/
const Error *StrToInputShaper( char *str, InputShaper &inShape )
{
   char *seg[20];
   int32 impulse[20];

   int ct = SplitLine( str, seg, 20, ':' );
   if( ct != 20 )
      return &AmpFileError::format;

   const Error *err = 0;

   // Copy all 20 paramters from the string and convert them to integers
   for( int i=0; i<ct; i++ )
   {
      err = StrToInt32( seg[i], impulse[i] );
   }

   if( !err )
      err = inShape.LoadFromCCX( impulse, ct );

   return err;
}

const Error *StrToHostCfg( char *str, char *hostCfg )
{
   char *seg[20];

   if( SplitLine( str, seg, 20, ':' ) != 20 )
      return &AmpFileError::format;

   const Error *err = 0;
   for( int i=0; i<20; i++ )
   {
      int16 c;
      err = StrToInt16( seg[i], c );
      if( err ) return err;

      hostCfg[2*i  ] = (char)(c>>8);
      hostCfg[2*i+1] = (char)(c);
   }

   return 0;
}

#endif

CML_NAMESPACE_END()


text:
namespace dtk {

    inline void assert_yes(bool cond, const char *msg) {
        if(!cond) std::cerr << msg << std::endl;
        assert(cond);
    }

    inline void assert_no(bool, const char *) {}
}

#ifndef NDEBUG
#define DTK_ASSERT(cond, msg) dtk::assert_yes(cond, msg); assert(cond);
#else
#define DTK_ASSERT(cond, msg) dtk::assert_no(cond, msg);
#endif

//
// dtkAssert.h ends here


text:
/**
    Embryo version 0.1.6
    Author:
        Tierry Danquin
    Github:
        https://github.com/oOthkOo/embryo.js
    Description:
        The most simple, customizable and easy to use
        JavaScript standard inheritance library
**/

var embryo_options = {
    cstrName: 'init',
    cstrArrayName: '_types',
    forceCstr: true,
    nameType: '_type',
    forceTyping: true,
    typeDefault: 'Embryo',
    nameProperties: 'properties',
    nameBlacklist: '_blacklist',
    deleteBlacklist: true
}

var embryo_plugins = []
var embryo_types = []

var debugPlugin = function( name, step, o ) {
    console.log( '[' + name + '] - ' + step )
    console.log( "\ttype: ", o._type )
    var o = o.prototype || o
    for (var name in o) {
        if (o.hasOwnProperty(name)) {
            var value = o[name]
            var text = typeof(value)
            switch (text) {
                case 'function':
                    text = value.toString().replace(/\n/g,'')
                    text = text.replace(/\s+/g,' ')
                    break
                case 'object':
                    text = JSON.stringify(value)
                    break
                default:
                    text = value
                    break
            }
            console.log( "\tproperty: [" + name + "]:\t\t[" + text + "] -> (" + typeof(value) + ")" )
        }
    }
}

var isTypeExist = function ( types, name ) {
    for (var t=0; t<types.length; t++) {
        var type = types[t]
        if (type.name == name) {
            return true
        }
    }
    return false
}

var Embryo = function() {

    //console.log('---START---')

    // Select all matched types
    var types = []
    for (var i=0; i<embryo_types.length; i++) {
        var type = embryo_types[i]
        if (this instanceof type.child) {
            types.push(type)
        }
    }

    // Extend types properties from last to first
    for (var i=types.length-1; i>-1; i--) {
        var type = types[i]
        var props = type.props
        if (props) {
            for (var n in props) {
                if (props.hasOwnProperty(n)) {
                    if (typeof this[n] == 'undefined') {
                        this[n] = props[n]
                        //console.log('['+n+']=['+props[n]+']')
                    }
                }
            }
        }
    }

    // Call each types constructors
    for (var i=0; i<types.length; i++) {
        var type = types[i]
        //var name = type.name
        var init = type.init
        if (init) {
            init.apply(this, arguments)
        }
    }

    //console.log('---END---')
}

Embryo.version = '0.1.6'

Embryo.extend = function( o ) {

    var c = o[embryo_options.cstrName] || null
    if (embryo_options.forceCstr && !c) {
        if (!c) {
            throw Error( 'No constructor function found.')
        }
    }
    if (c && typeof(c) !== 'function') {
        throw Error( 'Constructor function invalid.')
    }

    var parent = this
    var child = function() {
        return parent.apply(this, arguments)
    }
    child.extend = parent.extend

    var Surrogate = function() {}
    Surrogate.prototype = this.prototype
    child.prototype = new Surrogate

    if (embryo_options.forceTyping && !o[embryo_options.nameType]) {
        o[embryo_options.nameType] = embryo_options.typeDefault
    }
    var type = o[embryo_options.nameType]

    for (var p=0; p<embryo_plugins.length; p++) {
        var plugin = embryo_plugins[p]
        //console.log('plugin ' + plugin.name + ' -> ' + o._type)
        var debug = plugin.isDebug() ? debugPlugin : null
        o = plugin.exec( o, debug, child )
    }

    for (var key in o) {
        if (key == embryo_options.nameBlacklist &&
            embryo_options.deleteBlacklist) {
            continue
        }
        if (key == embryo_options.nameProperties) {
            continue
        }
        if (key == embryo_options.cstrName) {
            if (!isTypeExist( embryo_types, type )) {
                embryo_types.push({
                    name: type,
                    init: o[key] || null,
                    props: o[embryo_options.nameProperties],
                    child: child
                })
            }
        }
        child.prototype[key] = o[key]
    }

    return child
}

Embryo.configure = function ( o ) {
    for (var n in o) {
        if (o.hasOwnProperty(n)) {
            embryo_options[n] = o[n]
        }
    }
}

Embryo.use = function ( plugin, debug ) {
    plugin.configure( embryo_options )
    plugin.setDebug( debug )
    embryo_plugins.push(plugin)
}

Embryo.plugins = function( name ) {
    for (var p=0; p<embryo_plugins.length; p++) {
        var plugin = embryo_plugins[p]
        if (plugin.name == name) {
            return plugin
        }
    }
    return null
}

Embryo.configure()

Embryo.Plugin = Embryo.extend({
    '_type': 'Plugin',
    name: 'Plugin',
    options: null,
    init: function( debug ) {
        this.setDebug( debug )
    },
    configure: function( o ) {
        for (var n in o) {
            if (o.hasOwnProperty(n)) {
                this.options[n] = o[n]
            }
        }
    },
    isBlacklisted: function( o ) {
        var pl = o['_blacklist'] || false
        if (!pl) {
            return false
        }
        //console.log('pl', pl)
        for (var p=0; p<pl.length; p++) {
            var plugin = pl[p]
            //console.log('plugin', plugin)
            if (plugin == this.name ||
                plugin == '*') {
                return true
            }
        }
        return false
    },
    isDebug: function() {
        return this.debug
    },
    setDebug: function( debug ) {
        this.debug = debug || false
    },
    getName: function() {
        return this.name
    }
})

var Attribute = Embryo.Plugin.extend({
    '_type': 'Attribute',
    name: 'Attribute',
    options: {
        getPrefix: 'get',
        setPrefix: 'set',
        camelize: false
    },
    init: function() {

    },
    exec: function( o, debug, child ) {

        if (this.isBlacklisted( o )) {
            debug && console.log( '[' + this.name + '] - SKIPPED' )
            return o
        }

        debug && debug( this.name, 'BEFORE', o )

        var props = o[this.options.nameProperties] || {}

        for (var n in props) {
            if (props.hasOwnProperty(n)) {
                var value = props[n]
                if (typeof(value) !== 'function') {
                    var name = this.options.camelize ? this.camelize( n ) : n
                    var fname = this.options.getPrefix + name
                    this.defineGetter( o, fname, n )
                    name = this.options.camelize ? this.camelize( n ) : n
                    fname = this.options.setPrefix + name
                    this.defineSetter( o, fname, n )
                }
            }
        }

        debug && debug( this.name, 'AFTER', o )

        return o
    },
    defineGetter: function( o, name, property ) {
        o[name] = function () {
            return this[property]
        }
    },
    defineSetter: function( o, name, property ) {
        o[name] = function ( v ) {
            this[property] = v
        }
    },
    camelize: function( text ) {
        text = text.toLowerCase()
        text = text.charAt(0).toUpperCase() + text.slice(1);
        return text
    }
})

var BeforeAfter = Embryo.Plugin.extend({
    name: 'BeforeAfter',
    options: {
        beforePrefix: '-',
        afterPrefix: '+',
        hiddenPrefix: '_pm_'
    },
    init: function() {

    },
    exec: function( o, debug, child ) {

        if (this.isBlacklisted( o )) {
            debug && console.log( '[' + this.name + '] - SKIPPED' )
            return o
        }

        debug && debug( this.name, 'BEFORE', o )

        var methods = {}
        var bp = this.options.beforePrefix
        var ap = this.options.afterPrefix

        for (var n in o) {
            if (o.hasOwnProperty(n)) {
                var value = o[n]
                var name = ''
                var method = null
                if (typeof(value) == 'function') {
                    if (n.indexOf(ap) > -1) {
                        name = n.replace(ap,'')
                        method = methods[name]
                        if (!method) {
                            method = methods[name] = {
                                before: false,
                                after: false
                            }
                        }
                        method.after = true
                    }
                    else if (n.indexOf(bp) > -1) {
                        name = n.replace(bp,'')
                        method = methods[name]
                        if (!method) {
                            method = methods[name] = {
                                before: false,
                                after: false
                            }
                        }
                        method.before = true
                    }
                }
            }
        }

        for (var m in methods) {
            if (methods.hasOwnProperty(m)) {
                //console.log(m,)
                var options = methods[m]
                this.defineMethod( o, m, options.before, options.after )
            }
        }

        debug && debug( this.name, 'AFTER', o )

        return o
    },
    defineMethod: function( o, name, before, after ) {
        if (!o[name]) {
            throw new Error( 'method ' + name + ' not found.' )
        }
        var method = this.options.hiddenPrefix + name
        var beforeMethod = this.options.beforePrefix + name
        var afterMethod = this.options.afterPrefix + name
        o[method] = o[name]
        if (before && after) {
            o[name] = function () {
                this[beforeMethod].apply(this, arguments)
                this[method].apply(this, arguments)
                this[afterMethod].apply(this, arguments)
            }
        }
        else if (before) {
            o[name] = function () {
                this[beforeMethod].apply(this, arguments)
                this[method].apply(this, arguments)
            }
        }
        else {
            o[name] = function () {
                this[method].apply(this, arguments)
                this[afterMethod].apply(this, arguments)
            }
        }
    }
})

var Surcharge = Embryo.Plugin.extend({
    name: 'Surcharge',
    options: {
        suffix: '|',
        hiddenPrefix: '_pm_'
    },
    methods: [],
    init: function() {

    },
    exec: function( o, debug, child ) {

        if (this.isBlacklisted( o )) {
            debug && console.log( '[' + this.name + '] - SKIPPED' )
            return o
        }

        debug && debug( this.name, 'BEFORE', o )

        var suffix = this.options.suffix
        this.methods = []

        //console.log('suffix', suffix)

        for (var n in o) {
            if (o.hasOwnProperty(n)) {
                if (typeof(o[n]) == 'function') {
                    //console.log('n', n)
                    if (n.indexOf(suffix) > -1) {
                        parts = n.split(suffix)
                        //console.log('parts', parts)
                        var name = parts[0]
                        if (name) {
                            if (!this.isMethodExist(name)) {
                                this.methods.push(name)
                            }
                        }
                    }
                }
            }
        }

        for (var m=0; m<this.methods.length; m++) {
            this.defineMethod( o, this.methods[m] )
        }

        debug && debug( this.name, 'AFTER', o )

        return o
    },
    isMethodExist: function( name ) {
        for (var m=0; m<this.methods.length; m++) {
            if (this.methods[m] == name) {
                return true
            }
        }
        return false
    },
    defineMethod: function( o, name ) {
        var hiddenPrefix = this.options.hiddenPrefix
        var method = hiddenPrefix + name
        var suffix = this.options.suffix
        //console.log('method', method)
        o[method] = o[name]
        o[name] = function () {
            var fname = name + suffix + arguments.length
            //console.log('fname', fname)
            if (!this[fname]) {
                fname = hiddenPrefix + name
                if (!this[fname]) {
                    throw new Error( 'method "' + fname + '" not defined.' )
                }
            }
            this[fname].apply(this, arguments)
        }
    }
})

var Memory = Embryo.Plugin.extend({
    name: 'Memory',
    options: {
        nameInstanceArray: 'instances',
        nameNewMethod: 'new',
        nameStatsMethod: 'stats',
        nameDestroyMethod: 'destroy'
    },
    methods: [],
    init: function() {

    },
    exec: function( o, debug, child ) {

        if (this.isBlacklisted( o )) {
            debug && console.log( '[' + this.name + '] - SKIPPED' )
            return o
        }

        debug && debug( this.name, 'BEFORE', o )

        o[this.options.nameInstanceArray] = []
        o[this.options.nameNewMethod] = function( oclass, args ) {
            var instance = args ? new oclass( args ) : new oclass()
            this.instances.push( instance )
            return instance
        }
        o[this.options.nameStatsMethod] = function() {
            /*for (var i=0; i<this.instances.length; i++) {
                //console.log('instance ' + i, this.instances[i])
            }*/
        }
        o[this.options.nameDestroyMethod] = function() {
            for (var i=0; i<this.instances.length; i++) {
                /*var instance = this.instances[i]
                var fdestroy = instance.destroy || null
                if (fdestroy) {
                    fdestroy()
                }*/
                delete this.instances[i]
            }
            this.instances = []
            //console.log('destroy')
        }

        debug && debug( this.name, 'AFTER', o )

        return o
    }
})

var Static = Embryo.Plugin.extend({
    name: 'Static',
    options: {
        prefix: '$'
    },
    init: function () {

    },
    exec: function ( o, debug, child ) {

        if (this.isBlacklisted( o )) {
            debug && console.log( '[' + this.name + '] - SKIPPED' )
            return o
        }

        debug && debug( this.name, 'BEFORE', o )

        var prefix = this.options.prefix

        for (var n in o) {
            if (o.hasOwnProperty(n)) {
                var func = o[n]
                if (typeof(func) == 'function') {
                    if (n.indexOf(prefix) > -1) {
                        parts = n.split(prefix)
                        var name = parts[1]
                        if (name) {
                            this.defineStaticMethod(child, name, func)
                        }
                    }
                }
            }
        }

        debug && debug( this.name, 'AFTER', o )

        return o
    },
    defineStaticMethod: function (child, name, func) {
        child[name] = function () {
            return func.apply(this, arguments)
        }
    }
})

var attributePlugin = new Attribute()
attributePlugin.configure({
    getPrefix: 'get',
    setPrefix: 'set',
    camelize: true
})

var beforeAfterPlugin = new BeforeAfter()
beforeAfterPlugin.configure({
    beforePrefix: '-',
    afterPrefix: '+',
    hiddenPrefix: '_bah_'
})

var surchargePlugin = new Surcharge()
surchargePlugin.configure({
    suffix: '|',
    hiddenPrefix: '_pm_'
})

var memoryPlugin = new Memory()
memoryPlugin.configure({
    nameInstanceArray: 'instances',
    nameNewMethod: 'new',
    nameStatsMethod: 'stats',
    nameDestroyMethod: 'destroy'
})

var staticPlugin = new Static()
staticPlugin.configure({
    prefix: '$'
})

// Configure Embryo ;-)
Embryo.configure({
    cstrName: 'init',
    cstrArrayName: '_types',
    forceCstr: true,
    nameType: '_type',
    forceTyping: true,
    typeDefault: 'Embryo',
    nameProperties: 'properties',
    nameBlacklist: '_blacklist',
    deleteBlacklist: true
})
Embryo.use( attributePlugin, false )
Embryo.use( beforeAfterPlugin, false )
Embryo.use( surchargePlugin, false )
Embryo.use( memoryPlugin, false )
Embryo.use( staticPlugin, false )


text:
from __future__ import absolute_import

import logging
import os

from pip._vendor.six.moves import configparser

from pip._internal.download import path_to_url
from pip._internal.utils.misc import display_path, make_vcs_requirement_url
from pip._internal.utils.temp_dir import TempDirectory
from pip._internal.vcs import VersionControl, vcs

logger = logging.getLogger(__name__)

class Mercurial(VersionControl):
    name = 'hg'
    dirname = '.hg'
    repo_name = 'clone'
    schemes = ('hg', 'hg+http', 'hg+https', 'hg+ssh', 'hg+static-http')

    def get_base_rev_args(self, rev):
        return [rev]

    def export(self, location):
        """Export the Hg repository at the url to the destination location"""
        with TempDirectory(kind="export") as temp_dir:
            self.unpack(temp_dir.path)

            self.run_command(
                ['archive', location], show_stdout=False, cwd=temp_dir.path
            )

    def fetch_new(self, dest, url, rev_options):
        rev_display = rev_options.to_display()
        logger.info(
            'Cloning hg %s%s to %s',
            url,
            rev_display,
            display_path(dest),
        )
        self.run_command(['clone', '--noupdate', '-q', url, dest])
        cmd_args = ['update', '-q'] + rev_options.to_args()
        self.run_command(cmd_args, cwd=dest)

    def switch(self, dest, url, rev_options):
        repo_config = os.path.join(dest, self.dirname, 'hgrc')
        config = configparser.SafeConfigParser()
        try:
            config.read(repo_config)
            config.set('paths', 'default', url)
            with open(repo_config, 'w') as config_file:
                config.write(config_file)
        except (OSError, configparser.NoSectionError) as exc:
            logger.warning(
                'Could not switch Mercurial repository to %s: %s', url, exc,
            )
        else:
            cmd_args = ['update', '-q'] + rev_options.to_args()
            self.run_command(cmd_args, cwd=dest)

    def update(self, dest, url, rev_options):
        self.run_command(['pull', '-q'], cwd=dest)
        cmd_args = ['update', '-q'] + rev_options.to_args()
        self.run_command(cmd_args, cwd=dest)

    def get_url(self, location):
        url = self.run_command(
            ['showconfig', 'paths.default'],
            show_stdout=False, cwd=location).strip()
        if self._is_local_repository(url):
            url = path_to_url(url)
        return url.strip()

    def get_revision(self, location):
        current_revision = self.run_command(
            ['parents', '--template={rev}'],
            show_stdout=False, cwd=location).strip()
        return current_revision

    def get_revision_hash(self, location):
        current_rev_hash = self.run_command(
            ['parents', '--template={node}'],
            show_stdout=False, cwd=location).strip()
        return current_rev_hash

    def get_src_requirement(self, dist, location):
        repo = self.get_url(location)
        if not repo.lower().startswith('hg:'):
            repo = 'hg+' + repo
        current_rev_hash = self.get_revision_hash(location)
        egg_project_name = dist.egg_name().split('-', 1)[0]
        return make_vcs_requirement_url(repo, current_rev_hash,
                                        egg_project_name)

    def is_commit_id_equal(self, dest, name):
        """Always assume the versions don't match"""
        return False

vcs.register(Mercurial)


text:
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict'

const tap = require('tap')

const silentConsole = {
  log() {},

  error() {}
}
const common = require('../common')

const { Readable, Writable } = require('../../lib/ours/index')

const assert = require('assert')

function toArray(callback) {
  const stream = new Writable({
    objectMode: true
  })
  const list = []

  stream.write = function (chunk) {
    list.push(chunk)
  }

  stream.end = common.mustCall(function () {
    callback(list)
  })
  return stream
}

function fromArray(list) {
  const r = new Readable({
    objectMode: true
  })
  r._read = common.mustNotCall()
  list.forEach(function (chunk) {
    r.push(chunk)
  })
  r.push(null)
  return r
}

{
  // Verify that objects can be read from the stream
  const r = fromArray([
    {
      one: '1'
    },
    {
      two: '2'
    }
  ])
  const v1 = r.read()
  const v2 = r.read()
  const v3 = r.read()
  assert.deepStrictEqual(v1, {
    one: '1'
  })
  assert.deepStrictEqual(v2, {
    two: '2'
  })
  assert.strictEqual(v3, null)
}
{
  // Verify that objects can be piped into the stream
  const r = fromArray([
    {
      one: '1'
    },
    {
      two: '2'
    }
  ])
  r.pipe(
    toArray(
      common.mustCall(function (list) {
        assert.deepStrictEqual(list, [
          {
            one: '1'
          },
          {
            two: '2'
          }
        ])
      })
    )
  )
}
{
  // Verify that read(n) is ignored
  const r = fromArray([
    {
      one: '1'
    },
    {
      two: '2'
    }
  ])
  const value = r.read(2)
  assert.deepStrictEqual(value, {
    one: '1'
  })
}
{
  // Verify that objects can be synchronously read
  const r = new Readable({
    objectMode: true
  })
  const list = [
    {
      one: '1'
    },
    {
      two: '2'
    }
  ]

  r._read = function (n) {
    const item = list.shift()
    r.push(item || null)
  }

  r.pipe(
    toArray(
      common.mustCall(function (list) {
        assert.deepStrictEqual(list, [
          {
            one: '1'
          },
          {
            two: '2'
          }
        ])
      })
    )
  )
}
{
  // Verify that objects can be asynchronously read
  const r = new Readable({
    objectMode: true
  })
  const list = [
    {
      one: '1'
    },
    {
      two: '2'
    }
  ]

  r._read = function (n) {
    const item = list.shift()
    process.nextTick(function () {
      r.push(item || null)
    })
  }

  r.pipe(
    toArray(
      common.mustCall(function (list) {
        assert.deepStrictEqual(list, [
          {
            one: '1'
          },
          {
            two: '2'
          }
        ])
      })
    )
  )
}
{
  // Verify that strings can be read as objects
  const r = new Readable({
    objectMode: true
  })
  r._read = common.mustNotCall()
  const list = ['one', 'two', 'three']
  list.forEach(function (str) {
    r.push(str)
  })
  r.push(null)
  r.pipe(
    toArray(
      common.mustCall(function (array) {
        assert.deepStrictEqual(array, list)
      })
    )
  )
}
{
  // Verify read(0) behavior for object streams
  const r = new Readable({
    objectMode: true
  })
  r._read = common.mustNotCall()
  r.push('foobar')
  r.push(null)
  r.pipe(
    toArray(
      common.mustCall(function (array) {
        assert.deepStrictEqual(array, ['foobar'])
      })
    )
  )
}
{
  // Verify the behavior of pushing falsey values
  const r = new Readable({
    objectMode: true
  })
  r._read = common.mustNotCall()
  r.push(false)
  r.push(0)
  r.push('')
  r.push(null)
  r.pipe(
    toArray(
      common.mustCall(function (array) {
        assert.deepStrictEqual(array, [false, 0, ''])
      })
    )
  )
}
{
  // Verify high watermark _read() behavior
  const r = new Readable({
    highWaterMark: 6,
    objectMode: true
  })
  let calls = 0
  const list = ['1', '2', '3', '4', '5', '6', '7', '8']

  r._read = function (n) {
    calls++
  }

  list.forEach(function (c) {
    r.push(c)
  })
  const v = r.read()
  assert.strictEqual(calls, 0)
  assert.strictEqual(v, '1')
  const v2 = r.read()
  assert.strictEqual(v2, '2')
  const v3 = r.read()
  assert.strictEqual(v3, '3')
  assert.strictEqual(calls, 1)
}
{
  // Verify high watermark push behavior
  const r = new Readable({
    highWaterMark: 6,
    objectMode: true
  })
  r._read = common.mustNotCall()

  for (let i = 0; i < 6; i++) {
    const bool = r.push(i)
    assert.strictEqual(bool, i !== 5)
  }
}
{
  // Verify that objects can be written to stream
  const w = new Writable({
    objectMode: true
  })

  w._write = function (chunk, encoding, cb) {
    assert.deepStrictEqual(chunk, {
      foo: 'bar'
    })
    cb()
  }

  w.on('finish', common.mustCall())
  w.write({
    foo: 'bar'
  })
  w.end()
}
{
  // Verify that multiple objects can be written to stream
  const w = new Writable({
    objectMode: true
  })
  const list = []

  w._write = function (chunk, encoding, cb) {
    list.push(chunk)
    cb()
  }

  w.on(
    'finish',
    common.mustCall(function () {
      assert.deepStrictEqual(list, [0, 1, 2, 3, 4])
    })
  )
  w.write(0)
  w.write(1)
  w.write(2)
  w.write(3)
  w.write(4)
  w.end()
}
{
  // Verify that strings can be written as objects
  const w = new Writable({
    objectMode: true
  })
  const list = []

  w._write = function (chunk, encoding, cb) {
    list.push(chunk)
    process.nextTick(cb)
  }

  w.on(
    'finish',
    common.mustCall(function () {
      assert.deepStrictEqual(list, ['0', '1', '2', '3', '4'])
    })
  )
  w.write('0')
  w.write('1')
  w.write('2')
  w.write('3')
  w.write('4')
  w.end()
}
{
  // Verify that stream buffers finish until callback is called
  const w = new Writable({
    objectMode: true
  })
  let called = false

  w._write = function (chunk, encoding, cb) {
    assert.strictEqual(chunk, 'foo')
    process.nextTick(function () {
      called = true
      cb()
    })
  }

  w.on(
    'finish',
    common.mustCall(function () {
      assert.strictEqual(called, true)
    })
  )
  w.write('foo')
  w.end()
}
/* replacement start */

process.on('beforeExit', (code) => {
  if (code === 0) {
    tap.pass('test succeeded')
  } else {
    tap.fail(`test failed - exited code ${code}`)
  }
})
/* replacement end */


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

<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>SegmentReader.CoreClosedListener (Lucene 4.6.1 API)</title>
<meta name="date" content="2014-01-23">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD

org.apache.lucene.index

Interface SegmentReader.CoreClosedListener

Enclosing class:

SegmentReader

public static interface SegmentReader.CoreClosedListener

Called when the shared core for this SegmentReader
 is closed.

 This listener is called only once all SegmentReaders
 sharing the same core are closed.  At this point it
 is safe for apps to evict this reader from any caches
 keyed on SegmentReader.getCoreCacheKey().  This is the same
 interface that FieldCache uses, internally,
 to evict entries.

WARNING: This API is experimental and might change in incompatible ways in the next release.

Method Summary

Methods

Modifier and Type
Method and Description

void
onClose(Object ownerCoreCacheKey)

Invoked when the shared core of the original SegmentReader has closed.

Method Detail

onClose

void onClose(Object ownerCoreCacheKey)

Invoked when the shared core of the original SegmentReader has closed.

Overview

Package

Class

Use

Tree

Deprecated

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD

          Copyright © 2000-2014 Apache Software Foundation.  All Rights Reserved.


text:
require "rspec"

RSpec.describe "Google::Apis::GenomicsV1alpha2" do
  # Minimal test just to ensure no syntax errors in generated code
  it "should load" do
    expect do
      require "google/apis/genomics_v1alpha2"
    end.not_to raise_error
    expect do
      Google::Apis::GenomicsV1alpha2::GenomicsService.new
    end.not_to raise_error
  end
end