text:
import { hooks } from 'bigcommerce/stencil-utils';
import CatalogPage from './catalog';
import $ from 'jquery';
import FacetedSearch from './common/faceted-search';
import urlUtils from './common/url-utils';
import Url from 'url';
import collapsibleFactory from './common/collapsible';
import 'vakata/jstree';
import nod from './common/nod';

export default class Search extends CatalogPage {
    formatCategoryTreeForJSTree(node) {
        const nodeData = {
            text: node.data,
            id: node.metadata.id,
            state: {
                selected: node.selected,
            },
        };

        if (node.state) {
            nodeData.state.opened = node.state === 'open';
            nodeData.children = true;
        }

        if (node.children) {
            nodeData.children = [];
            node.children.forEach((childNode) => {
                nodeData.children.push(this.formatCategoryTreeForJSTree(childNode));
            });
        }

        return nodeData;
    }

    showProducts() {
        const url = urlUtils.replaceParams(location.href, {
            section: 'product',
        });

        this.$productListingContainer.removeClass('u-hiddenVisually');
        this.$facetedSearchContainer.removeClass('u-hiddenVisually');
        this.$contentResultsContainer.addClass('u-hiddenVisually');

        urlUtils.goToUrl(url);
    }

    showContent() {
        const url = urlUtils.replaceParams(location.href, {
            section: 'content',
        });

        this.$contentResultsContainer.removeClass('u-hiddenVisually');
        this.$productListingContainer.addClass('u-hiddenVisually');
        this.$facetedSearchContainer.addClass('u-hiddenVisually');

        urlUtils.goToUrl(url);
    }

    loaded() {
        const $searchForm = $('[data-advanced-search-form]');
        const $categoryTreeContainer = $searchForm.find('[data-search-category-tree]');
        const url = Url.parse(location.href, true);
        const treeData = [];
        this.$productListingContainer = $('#product-listing-container');
        this.$facetedSearchContainer = $('#faceted-search-container');
        this.$contentResultsContainer = $('#search-results-content');

        // Init faceted search
        if ($('#facetedSearch').length > 0) {
            this.initFacetedSearch();
        } else {
            this.onSortBySubmit = this.onSortBySubmit.bind(this);
            hooks.on('sortBy-submitted', this.onSortBySubmit);
        }

        // Init collapsibles
        collapsibleFactory();

        $('[data-product-results-toggle]').click((event) => {
            event.preventDefault();
            this.showProducts();
        });

        $('[data-content-results-toggle]').click((event) => {
            event.preventDefault();
            this.showContent();
        });

        if (this.$productListingContainer.find('li.product').length === 0 || url.query.section === 'content') {
            this.showContent();
        } else {
            this.showProducts();
        }

        const validator = this.initValidation($searchForm)
            .bindValidation($searchForm.find('#search_query_adv'));

        this.context.categoryTree.forEach((node) => {
            treeData.push(this.formatCategoryTreeForJSTree(node));
        });

        this.categoryTreeData = treeData;
        this.createCategoryTree($categoryTreeContainer);

        $searchForm.submit((event) => {
            const selectedCategoryIds = $categoryTreeContainer.jstree().get_selected();

            if (!validator.check()) {
                return event.preventDefault();
            }

            $searchForm.find('input[name="category\[\]"]').remove();

            for (const categoryId of selectedCategoryIds) {
                const input = $('<input>', {
                    type: 'hidden',
                    name: 'category[]',
                    value: categoryId,
                });

                $searchForm.append(input);
            }
        });
    }

    loadTreeNodes(node, cb) {
        $.ajax({
            url: '/remote/v1/category-tree',
            data: {
                selectedCategoryId: node.id,
                prefix: 'category',
            },
            success: (data) => {
                const formattedResults = [];

                data.forEach((dataNode) => {
                    formattedResults.push(this.formatCategoryTreeForJSTree(dataNode));
                });

                cb(formattedResults);
            },
        });
    }

    createCategoryTree($container) {
        const treeOptions = {
            core: {
                data: (node, cb) => {
                    // Root node
                    if (node.id === '#') {
                        cb(this.categoryTreeData);
                    } else {
                        // Lazy loaded children
                        this.loadTreeNodes(node, cb);
                    }
                },
                themes: {
                    icons: true,
                },
            },
            checkbox: {
                three_state: false,
            },
            plugins: [
                'checkbox',
            ],
        };

        $container.jstree(treeOptions);
    }

    initFacetedSearch() {
        const $productListingContainer = $('#product-listing-container');
        const $facetedSearchContainer = $('#faceted-search-container');
        const $searchHeading = $('#search-results-heading');
        const $searchCount = $('#search-results-product-count');
        const productsPerPage = this.context.searchProductsPerPage;
        const requestOptions = {
            template: {
                productListing: 'search/product-listing',
                sidebar: 'search/sidebar',
                heading: 'search/heading',
                productCount: 'search/product-count',
            },
            config: {
                product_results: {
                    limit: productsPerPage,
                },
            },
        };

        this.facetedSearch = new FacetedSearch(requestOptions, (content) => {
            $productListingContainer.html(content.productListing);
            $facetedSearchContainer.html(content.sidebar);
            $searchHeading.html(content.heading);
            $searchCount.html(content.productCount);

            $('html, body').animate({
                scrollTop: 0,
            }, 100);
        });
    }

    initValidation($form) {
        this.$form = $form;
        this.validator = nod({
            submit: $form,
        });

        return this;
    }

    bindValidation($element) {
        if (this.validator) {
            this.validator.add({
                selector: $element,
                validate: 'presence',
                errorMessage: $element.data('error-message'),
            });
        }

        return this;
    }

    check() {
        if (this.validator) {
            this.validator.performCheck();
            return this.validator.areAll('valid');
        }

        return false;
    }
}


text:
R package includes useful R codes create by members of the biostatistics group at OUCRU (room 306)

Still under development

redpajama_set_name: RedPajamaGithub


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

package com.google.gerrit.extensions.events;

import com.google.gerrit.extensions.annotations.ExtensionPoint;
import com.google.gerrit.extensions.common.AccountInfo;
import java.util.List;

/** Notified whenever one or more Reviewers are added to a change. */
@ExtensionPoint
public interface ReviewerAddedListener {
  interface Event extends ChangeEvent {
    List<AccountInfo> getReviewers();
  }

  void onReviewersAdded(Event event);
}


text:
import { IFileItem } from "../../../model/IFileItem";

export interface IFileLabelProps {
    file: IFileItem;
}


text:
var process = require("../process/process"),
	add = require("./add"),
	assert = require("assert");

describe("documentjs/lib/tags/add", function(){

	it("basic",function(){

		var docMap = {Foo: {name: "Foo",type: "constructor"}};

		process.comment({
			comment: "@add Foo",
			docMap: docMap,
			docObject: {},
			tags: {add: add}
		}, function(newDoc, newScope){
			assert.equal(newScope, docMap.Foo);
		});
	});

});


text:
#include "mitkVtkRepresentationProperty.h"
#include <vtkProperty.h>

mitk::VtkRepresentationProperty::VtkRepresentationProperty()
{
  AddRepresentationTypes();
  SetValue(static_cast<IdType>(VTK_SURFACE));
}

mitk::VtkRepresentationProperty::VtkRepresentationProperty(const IdType &value)
{
  AddRepresentationTypes();
  if (IsValidEnumerationValue(value))
  {
    SetValue(value);
  }
  else
  {
    SetValue(static_cast<IdType>(VTK_SURFACE));
  }
}

mitk::VtkRepresentationProperty::VtkRepresentationProperty(const std::string &value)
{
  AddRepresentationTypes();
  if (IsValidEnumerationValue(value))
  {
    SetValue(value);
  }
  else
  {
    SetValue(static_cast<IdType>(VTK_SURFACE));
  }
}

int mitk::VtkRepresentationProperty::GetVtkRepresentation()
{
  return static_cast<int>(GetValueAsId());
}

void mitk::VtkRepresentationProperty::SetRepresentationToPoints()
{
  SetValue(static_cast<IdType>(VTK_POINTS));
}

void mitk::VtkRepresentationProperty::SetRepresentationToWireframe()
{
  SetValue(static_cast<IdType>(VTK_WIREFRAME));
}

void mitk::VtkRepresentationProperty::SetRepresentationToSurface()
{
  SetValue(static_cast<IdType>(VTK_SURFACE));
}

void mitk::VtkRepresentationProperty::AddRepresentationTypes()
{
  AddEnum("Points", static_cast<IdType>(VTK_POINTS));
  AddEnum("Wireframe", static_cast<IdType>(VTK_WIREFRAME));
  AddEnum("Surface", static_cast<IdType>(VTK_SURFACE));
}

bool mitk::VtkRepresentationProperty::AddEnum(const std::string &name, const IdType &id)
{
  return Superclass::AddEnum(name, id);
}

itk::LightObject::Pointer mitk::VtkRepresentationProperty::InternalClone() const
{
  itk::LightObject::Pointer result(new Self(*this));
  result->UnRegister();
  return result;
}


text:
package simulator.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class CustomUtils {

    public static final String dateFormat = "dd-MM-yyyy hh:mm:ss";

    public static SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat);

    public static String ConvertMilliSecondsToFormattedDate(long milliSeconds) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(milliSeconds);
        return simpleDateFormat.format(calendar.getTime());
    }
}


text:
layout: single
title: "The @fraser_lab Method of Following the Scientific Literature"
categories: news
excerpt:
tags:
  - embeds
  - twitter
---

The @fraser_lab Method of Following the Scientific Literature https://t.co/v3elgqSeF3: For the au courant literateur. pic.twitter.com/7aYFzGFIVQ
— Keiser Lab (@keiser_lab) September 7, 2017


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

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;

import org.junit.Assert;
import org.junit.Test;

import com.opentable.lifecycle.LifecycleStage;

public class TestLifecycleStage
{
    @Test
    public void testEquality()
    {
        LifecycleStage l1 = LifecycleStage.START_STAGE;
        LifecycleStage l2 = new LifecycleStage("start");

        Assert.assertEquals(l1, l2);
    }

    @Test
    public void testEqualityIgnoreCase()
    {
        LifecycleStage l1 = new LifecycleStage("START");
        LifecycleStage l2 = new LifecycleStage("start");

        Assert.assertEquals(l1, l2);
    }

    @Test
    public void testNonEquality()
    {
        LifecycleStage l1 = new LifecycleStage("START-1");
        LifecycleStage l2 = new LifecycleStage("START-2");

        Assert.assertThat(l1, is(not(l2)));
    }
}


text:
package org.nd4j.linalg.api.ndarray;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.LineIterator;
import org.nd4j.linalg.factory.Nd4j;

import java.io.File;
import java.io.IOException;

/**
 * Created by susaneraly on 6/16/16.
 */
public class NdArrayJSONReader {

    public INDArray read(File jsonFile) {
        INDArray result = this.loadNative(jsonFile);
        if (result == null) {
            //Must write support for parsing/normal json parsing - which will be inefficient
            this.loadNonNative(jsonFile);
        }
        return result;
    }

    private INDArray loadNative(File jsonFile) {
        /*
          We could dump an ndarray to a file with the tostring (since that is valid json) and use put/get to parse it as json

          But here we leverage our information of the tostring method to be more efficient
          With our current toString format we use tads along dimension (rank-1,rank-2) to write to the array in two dimensional chunks at a time.
          This is more efficient than setting each value at a time with putScalar.
          This also means we can read the file one line at a time instead of loading the whole thing into memory

          Future work involves enhancing the write json method to provide more features to make the load more efficient
         */
        int lineNum = 0;
        int rowNum = 0;
        int tensorNum = 0;
        char theOrder = 'c';
        int[] theShape = {1, 1};
        int rank = 0;
        double[][] subsetArr = {{0.0, 0.0}, {0.0, 0.0}};
        INDArray newArr = Nd4j.zeros(2, 2);
        try {
            LineIterator it = FileUtils.lineIterator(jsonFile);
            try {
                while (it.hasNext()) {
                    String line = it.nextLine();
                    lineNum++;
                    line = line.replaceAll("\\s", "");
                    if (line.equals("") || line.equals("}"))
                        continue;
                    // is it from dl4j?
                    if (lineNum == 2) {
                        String[] lineArr = line.split(":");
                        String fileSource = lineArr[1].replaceAll("\\W", "");
                        if (!fileSource.equals("dl4j"))
                            return null;
                    }
                    // parse ordering
                    if (lineNum == 3) {
                        String[] lineArr = line.split(":");
                        theOrder = lineArr[1].replace("\\W", "").charAt(0);
                        continue;
                    }
                    // parse shape
                    if (lineNum == 4) {
                        String[] lineArr = line.split(":");
                        String dropJsonComma = lineArr[1].split("]")[0];
                        String[] shapeString = dropJsonComma.replace("[", "").split(",");
                        rank = shapeString.length;
                        theShape = new int[rank];
                        for (int i = 0; i < rank; i++) {
                            try {
                                theShape[i] = Integer.parseInt(shapeString[i]);
                            } catch (NumberFormatException nfe) {
                            } ;
                        }
                        subsetArr = new double[theShape[rank - 2]][theShape[rank - 1]];
                        newArr = Nd4j.zeros(theShape, theOrder);
                        continue;
                    }
                    //parse data
                    if (lineNum > 5) {
                        String[] entries =
                                        line.replace("\\],", "").replaceAll("\\[", "").replaceAll("\\]", "").split(",");
                        for (int i = 0; i < theShape[rank - 1]; i++) {
                            try {
                                subsetArr[rowNum][i] = Double.parseDouble(entries[i]);
                            } catch (NumberFormatException nfe) {
                            }
                        }
                        rowNum++;
                        if (rowNum == theShape[rank - 2]) {
                            INDArray subTensor = Nd4j.create(subsetArr);
                            newArr.tensorAlongDimension(tensorNum, rank - 1, rank - 2).addi(subTensor);
                            rowNum = 0;
                            tensorNum++;
                        }
                    }
                }
            } finally {
                LineIterator.closeQuietly(it);
            }
        } catch (IOException e) {
            throw new RuntimeException("Error reading input", e);
        }
        return newArr;
    }

    private INDArray loadNonNative(File jsonFile) {
        /* WIP
        JSONTokener tokener = new JSONTokener(new FileReader("test.json"));
        JSONObject obj = new JSONObject(tokener);
        JSONArray objArr = obj.optJSONArray("shape");
        int rank = objArr.length();
        int[] theShape = new int[rank];
        int rows = 1;
        for (int i = 0; i < rank; ++i) {
            theShape[i] = objArr.optInt(i);
            if (i != objArr.length() - 1)
                rows *= theShape[i];
        }
        */
        System.out.println("API_Error: Current support only for files written from dl4j");
        return null;
    }
}


text:
include NetApp::Api

action :create do

  # validations.
  raise ArgumentError, "Attribute home_node is required to create network interface" unless new_resource.home_node
  raise ArgumentError, "Attribute home_port is required to create network interface" unless new_resource.home_port
  raise ArgumentError, "Attribute role is required to create network interface" unless new_resource.role

  # Create API Request.
  netapp_lif_api = netapp_hash

  netapp_lif_api[:api_name] = "net-interface-create"
  netapp_lif_api[:resource] = "lif"
  netapp_lif_api[:action] = "create"
  netapp_lif_api[:api_attribute]["vserver"] = new_resource.svm
  netapp_lif_api[:api_attribute]["home-node"] = new_resource.home_node
  netapp_lif_api[:api_attribute]["home-port"] = new_resource.home_port
  netapp_lif_api[:api_attribute]["interface-name"] = new_resource.name
  netapp_lif_api[:api_attribute]["role"] = new_resource.role
  netapp_lif_api[:api_attribute]["address"] = new_resource.address unless new_resource.address.nil?
  netapp_lif_api[:api_attribute]["administrative-status"] = new_resource.administrative_status unless new_resource.administrative_status.nil?
  netapp_lif_api[:api_attribute]["comment"] = new_resource.comment unless new_resource.comment.nil?
  #Todo- verify
  if new_resource.data_protocols
    new_resource.data_protocols.each do |protocol|
      raise ArgumentError, "Invalid protocol \"#{protocol}\". It must be nfs/cifs/iscsi/fcp/fcache/none" unless ["nfs", "cifs", "iscsi", "fcp", "fcache", "none"].include? protocol
    end
    if new_resource.data_protocols.length >= 2
      if new_resource.data_protocols.include?('none') || new_resource.data_protocols.include?('iscsi') || new_resource.data_protocols.include?('fcp')
        raise ArgumentError, "Invalid data_protocols; 'none', 'iscsi', or 'fcp' must be specified as the only protocol on the LIF."
      end
    end
    netapp_lif_api[:api_attribute]["data-protocols"]["data-protocol"] = new_resource.data_protocols
  end
  netapp_lif_api[:api_attribute]["failover-group"] = new_resource.failover_group unless new_resource.failover_group.nil?
  netapp_lif_api[:api_attribute]["failover-policy"] = new_resource.failover_policy unless new_resource.failover_policy.nil?
  netapp_lif_api[:api_attribute]["firewall-policy"] = new_resource.firewall_policy unless new_resource.firewall_policy.nil?
  netapp_lif_api[:api_attribute]["is-auto-revert"] = new_resource.is_auto_revert unless new_resource.is_auto_revert.nil?
  netapp_lif_api[:api_attribute]["is-ipv4-link-local"] = new_resource.is_ipv4_link_local unless new_resource.is_ipv4_link_local.nil?
  netapp_lif_api[:api_attribute]["listen-for-dns-query"] = new_resource.listen_for_dns_query unless new_resource.listen_for_dns_query.nil?
  netapp_lif_api[:api_attribute]["netmask"] = new_resource.netmask unless new_resource.netmask.nil?
  netapp_lif_api[:api_attribute]["netmask-length"] = new_resource.netmask_length unless new_resource.netmask_length.nil?
  netapp_lif_api[:api_attribute]["return-record"] = new_resource.return_record unless new_resource.return_record.nil?
  netapp_lif_api[:api_attribute]["routing-group"] = new_resource.routing_group unless new_resource.routing_group_name.nil?
  netapp_lif_api[:api_attribute]["use-failover-group"] = new_resource.use_failover_group unless new_resource.use_failover_group.nil?

  # Invoke NetApp API.
  resource_update = invoke(netapp_lif_api)
  new_resource.updated_by_last_action(true) if resource_update
end

action :delete do

  # Create API Request.
  netapp_lif_api = netapp_hash

  netapp_lif_api[:api_name] = "net-interface-delete"
  netapp_lif_api[:resource] = "lif"
  netapp_lif_api[:action] = "delete"
  netapp_lif_api[:api_attribute]["vserver"] = new_resource.svm
  netapp_lif_api[:api_attribute]["interface-name"] = new_resource.name

  # Invoke NetApp API.
  resource_update = invoke(netapp_lif_api)
  new_resource.updated_by_last_action(true) if resource_update
end


text:
/**
 * Tests for health indicators.
 *
 * @author tgianos
 * @since 3.0.0
 */
package com.netflix.genie.web.health;


text:
package org.apache.samza.operators.stream;

import org.apache.samza.application.descriptors.StreamApplicationDescriptorImpl;
import org.apache.samza.operators.MessageStreamImpl;
import org.apache.samza.operators.OutputStream;
import org.apache.samza.operators.spec.InputOperatorSpec;
import org.apache.samza.operators.spec.OperatorSpec;
import org.apache.samza.operators.spec.OutputStreamImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * An intermediate stream is both an input and an output stream (e.g. a repartitioned stream).
 * <p>
 * This implementation accepts a pair of {@link InputOperatorSpec} and {@link OutputStreamImpl} associated
 * with the same logical {@code streamId}. It provides access to its {@link OutputStreamImpl} for
 * the partitionBy operator to send messages out to. It's also a {@link MessageStreamImpl} with
 * {@link InputOperatorSpec} as its operator spec, so that further operations can be chained on the
 * {@link InputOperatorSpec}.
 *
 * @param <M> the type of message in the output {@link MessageStreamImpl}
 */
public class IntermediateMessageStreamImpl<M> extends MessageStreamImpl<M> implements OutputStream<M> {

  private static final Logger LOGGER = LoggerFactory.getLogger(IntermediateMessageStreamImpl.class);
  private final OutputStreamImpl<M> outputStream;
  private final boolean isKeyed;

  public IntermediateMessageStreamImpl(StreamApplicationDescriptorImpl appDesc, InputOperatorSpec inputOperatorSpec,
      OutputStreamImpl<M> outputStream) {
    super(appDesc, (OperatorSpec<?, M>) inputOperatorSpec);
    this.outputStream = outputStream;
    if (inputOperatorSpec.isKeyed() != outputStream.isKeyed()) {
      LOGGER.error("Input and output streams for intermediate stream {} aren't keyed consistently. Input: {}, Output: {}",
          new Object[]{inputOperatorSpec.getStreamId(), inputOperatorSpec.isKeyed(), outputStream.isKeyed()});
    }
    this.isKeyed = inputOperatorSpec.isKeyed() && outputStream.isKeyed();
  }

  public String getStreamId() {
    return this.outputStream.getStreamId();
  }

  public OutputStreamImpl<M> getOutputStream() {
    return this.outputStream;
  }

  public boolean isKeyed() {
    return isKeyed;
  }
}


text:
namespace ustl {

class error_code;
class error_condition;

template <typename T> struct is_error_code_enum : public false_type { };
template <typename T> struct is_error_condition_enum : public false_type {};

//{{{ errc enum of error codes for error_code and error_condition ------

enum class errc {
    address_family_not_supported	= EAFNOSUPPORT,
    address_in_use			= EADDRINUSE,
    address_not_available		= EADDRNOTAVAIL,
    already_connected			= EISCONN,
    argument_list_too_long		= E2BIG,
    argument_out_of_domain		= EDOM,
    bad_address				= EFAULT,
    bad_file_descriptor			= EBADF,
    bad_message				= EBADMSG,
    broken_pipe				= EPIPE,
    connection_aborted			= ECONNABORTED,
    connection_already_in_progress	= EALREADY,
    connection_refused			= ECONNREFUSED,
    connection_reset			= ECONNRESET,
    cross_device_link			= EXDEV,
    destination_address_required	= EDESTADDRREQ,
    device_or_resource_busy		= EBUSY,
    directory_not_empty			= ENOTEMPTY,
    executable_format_error		= ENOEXEC,
    file_exists				= EEXIST,
    file_too_large			= EFBIG,
    filename_too_long			= ENAMETOOLONG,
    function_not_supported		= ENOSYS,
    host_unreachable			= EHOSTUNREACH,
    identifier_removed			= EIDRM,
    illegal_byte_sequence		= EILSEQ,
    inappropriate_io_control_operation	= ENOTTY,
    interrupted				= EINTR,
    invalid_argument			= EINVAL,
    invalid_seek			= ESPIPE,
    io_error				= EIO,
    is_a_directory			= EISDIR,
    message_size			= EMSGSIZE,
    network_down			= ENETDOWN,
    network_reset			= ENETRESET,
    network_unreachable			= ENETUNREACH,
    no_buffer_space			= ENOBUFS,
    no_child_process			= ECHILD,
    no_link				= ENOLINK,
    no_lock_available			= ENOLCK,
    no_message_available		= ENODATA,
    no_message				= ENOMSG,
    no_protocol_option			= ENOPROTOOPT,
    no_space_on_device			= ENOSPC,
    no_stream_resources			= ENOSR,
    no_such_device_or_address		= ENXIO,
    no_such_device			= ENODEV,
    no_such_file_or_directory		= ENOENT,
    no_such_process			= ESRCH,
    not_a_directory			= ENOTDIR,
    not_a_socket			= ENOTSOCK,
    not_a_stream			= ENOSTR,
    not_connected			= ENOTCONN,
    not_enough_memory			= ENOMEM,
    not_supported			= EINVAL,
    operation_canceled			= ECANCELED,
    operation_in_progress		= EINPROGRESS,
    operation_not_permitted		= EPERM,
    operation_not_supported		= EOPNOTSUPP,
    operation_would_block		= EAGAIN,
    owner_dead				= EOWNERDEAD,
    permission_denied			= EACCES,
    protocol_error			= EPROTO,
    protocol_not_supported		= EPROTONOSUPPORT,
    read_only_file_system		= EROFS,
    resource_deadlock_would_occur	= EDEADLK,
    resource_unavailable_try_again	= EAGAIN,
    result_out_of_range			= ERANGE,
    state_not_recoverable		= ENOTRECOVERABLE,
    stream_timeout			= ETIME,
    text_file_busy			= ETXTBSY,
    timed_out				= ETIMEDOUT,
    too_many_files_open_in_system	= ENFILE,
    too_many_files_open			= EMFILE,
    too_many_links			= EMLINK,
    too_many_symbolic_link_levels	= ELOOP,
    value_too_large			= EOVERFLOW,
    wrong_protocol_type			= EPROTOTYPE
};

template<> struct is_error_code_enum<errc> : public true_type {};
template<> struct is_error_condition_enum<errc> : public true_type {};

error_code make_error_code (errc) noexcept;
error_condition make_error_condition (errc) noexcept;

//}}}-------------------------------------------------------------------
//{{{ error_category

class error_category {
public:
    constexpr			error_category (void) noexcept = default;
    error_category&		operator= (const error_category&) = delete;
    inline constexpr auto	name (void) const	{ return "system"; }
    inline auto			message (int ec) const	{ return strerror(ec); }
    inline error_condition	default_error_condition (int ec) const noexcept;
    inline constexpr bool	equivalent (int ec, const error_condition& cond) const noexcept;
    inline constexpr bool	equivalent (const error_code& ec, int c) const noexcept;
    inline constexpr bool	operator== (const error_category&) const { return true; }
    inline constexpr bool	operator!= (const error_category&) const { return false; }
};

inline constexpr auto system_category (void)	{ return error_category(); }
inline constexpr auto generic_category (void)	{ return error_category(); }

//}}}-------------------------------------------------------------------
//{{{ error_code

class error_code {
public:
    inline constexpr		error_code (void) : _ec(0) { }
    inline constexpr		error_code (int ec, const error_category&) : _ec(ec) {}
    template <typename ErrorCodeEnum,
		typename = typename enable_if<is_error_code_enum<ErrorCodeEnum>::value>::type>
    inline constexpr		error_code (ErrorCodeEnum e) : error_code (make_error_code(e)) {}
    inline void			assign (int ec, const error_category&) noexcept	{ _ec = ec; }
    template <typename ErrorCodeEnum>
    inline typename enable_if<is_error_code_enum<ErrorCodeEnum>::value, error_code&>::type
				operator= (ErrorCodeEnum e)	{ return *this = make_error_code(e); }
    inline void			clear (void)			{ assign (0, system_category()); }
    inline constexpr auto	value (void) const		{ return _ec; }
    inline constexpr auto	category (void) const		{ return system_category(); }
    inline error_condition	default_error_condition (void) const noexcept;
    inline auto			message (void) const		{ return category().message (value()); }
    inline constexpr explicit		operator bool (void) const	{ return _ec; }
    inline void			read (istream& is);
    inline void			write (ostream& os) const;
    inline constexpr bool	operator== (const error_code& v) const	{ return category() == v.category() && value() == v.value(); }
    inline constexpr bool	operator== (const error_condition& v) const noexcept;
private:
    int				_ec;
};

inline error_code make_error_code (errc e) noexcept
    { return error_code (static_cast<int>(e), system_category()); }

//}}}-------------------------------------------------------------------
//{{{ error_condition

class error_condition {
public:
    inline constexpr		error_condition (void) : _ec(0) { }
    inline constexpr		error_condition (int ec, const error_category&) : _ec(ec) {}
    template <typename ErrorConditionEnum,
		typename = typename enable_if<is_error_condition_enum<ErrorConditionEnum>::value>::type>
    inline constexpr		error_condition (ErrorConditionEnum e) : error_condition (make_error_condition(e)) {}
    inline void			assign (int ec, const error_category&) noexcept	{ _ec = ec; }
    template <typename ErrorConditionEnum>
    inline typename enable_if<is_error_condition_enum<ErrorConditionEnum>::value, error_condition&>::type
				operator=(ErrorConditionEnum e)	{ return *this = make_error_condition(e); }
    inline void			clear (void)			{ assign (0, generic_category()); }
    inline constexpr auto	value (void) const		{ return _ec; }
    inline constexpr auto	category (void) const		{ return generic_category(); }
    inline auto			message (void) const		{ return category().message (value()); }
    inline constexpr explicit	operator bool (void) const	{ return value(); }
    inline void			read (istream& is);
    inline void			write (ostream& os) const;
    inline constexpr bool	operator== (const error_condition& v) const
				    { return category() == v.category() && value() == v.value(); }
    inline constexpr bool	operator== (const error_code& v) const
				    { return category() == v.category() && value() == v.value(); }
private:
    int				_ec;
};

inline error_condition make_error_condition (errc e) noexcept
    { return error_condition (static_cast<int>(e), generic_category()); }

error_condition	error_category::default_error_condition (int ec) const noexcept
    { return error_condition (ec, *this); }
constexpr bool error_category::equivalent (int ec, const error_condition& cond) const noexcept
    { return *this == cond.category() && ec == cond.value(); }
constexpr bool error_category::equivalent (const error_code& ec, int c) const noexcept
    { return *this == ec.category() && c == ec.value(); }

error_condition	error_code::default_error_condition (void) const noexcept
    { return error_condition (value(), category()); }
constexpr bool error_code::operator== (const error_condition& v) const noexcept
    { return category() == v.category() && value() == v.value(); }

//}}}-------------------------------------------------------------------
} // namespace ustl
#endif // HAVE_CPP14


text:
<?php

define("WSF_WSDL", "wsdl");
define("WSF_HTTP_AUTH_USERNAME","httpAuthUsername");
define ("WSF_HTTP_AUTH_PASSWORD","httpAuthPassword");
define ("WSF_HTTP_AUTH_DIGEST","Digest");
define ("WSF_HTTP_AUTH_BASIC","Basic");
define ("WSF_HTTP_AUTH_TYPE","httpAuthType");
/* used when an https endpoint with client autentication is defined for the given wsdl */
define ("WSF_WSDL_CA_CERT","CACert");
define ("WSF_WSDL_CLIENT_CERT","clientCert");
define ("WSF_WSDL_PASSPHRASE","passphrase");
define("WSF_ENDPOINT", "endpoint");
define("WSF_INVOKE_FUNCTION", "invoke_function");
define("WSF_ARG_COUNT", "arg_count");
define("WSF_ARG_ARRAY", "arg_array");
define("WSF_SIGNATURE", "signature");
define("WSF_METHOD", "method");
define("WSF_INFERENCE", "inference");
define("WSF_RPC", "rpc");
define("WSF_RPC_ENCODED", "rpc-enc");
define("WSF_DOCLIT", "doclit");
define("WSF_ENDPOINT_URI", "endpoint_uri");
define("WSF_BINDING_DETAILS", "binding_details");
define("WSF_W2P_BINDING_DETAILS", "binding-details");
define("WSF_REQUEST_PAYLOAD", "request_payload");
define("WSF_POLICY_NODE", "policy_node");
define("WSF_POLICIES", "policies");
define("WSF_SERVICE_NAME", "serviceName");
define("WSF_PORT_NAME", "portName");
define("WSF_USE_MTOM", "useMTOM");

define("WSF_DEFINITION", "definitions");
define("WSF_DESCRIPTION", "description");
define("WSF_OPERATIONS", "operations");
define("WSF_OPERATION" , "operation");
define("WSF_ADDRESS", "address");
define("WSF_NAME" , "name");
define("WSF_TYPE", "type");
define("WSF_MAX_OCCURS", "maxOccurs");
define("WSF_MIN_OCCURS", "minOccurs");
define("WSF_TYPE_REP", "type_rep");
define("WSF_ID", "Id");
define("WSF_SERVICE", "service");
define("WSF_CLIENT", "client");
define("WSF_BINDING", "binding");
define("WSF_POLICY_REFERENCE", "PolicyReference");
define("WSF_POLICY", "Policy");
define("WSF_REF", "ref");
define("WSF_URI", "URI");
define("WSF_PARAMS", "params");
define("WSF_PARAM" , "param");
define("WSF_WRAPPER_ELEMENT", "wrapper-element");
define("WSF_WRAPPER_ELEMENT_NS", "wrapper-element-ns");
define("WSF_TARGETNAMESPACE", "targetNamespace");
define("WSF_BINDINDG_DETAILS", "binding-details");
define("WSF_WSAWAACTION", "wsawaction");
define("WSF_SOAPACTION", "soapaction");
define("WSF_HTTPMETHOD", "httpmethod");
define("WSF_USE_SOAP", "usesoap");
define("WSF_WSA", "wsa");
define("WSF_SOAP", "soap");
define("WSF_SOAP11", "SOAP11");
define("WSF_SOAP12", "SOAP12");
define("WSF_SOAP_VERSION", "soap_version");
define("WSF_RETURNS", "returns");
define("WSF_RESPONSE_SIG_MODEL", "response_sig_model");
define("WSF_IS_MULTI_INTERFACES", "is_multiple_interfaces");
define("WSF_SIG_MODEL_STRING", "sig_model_string");
define("WSF_IS_WSDL_11", "is_wsdl_11");
define("WSF_PAYLOAD_STRING", "payload_string");
define("WSF_OPERATION_NAME", "operation_name");
define("WSF_FUNCTION_NAME", "function_name");
define("WSF_CLASS_NAME", "class_name");
define("WSF_CLASS_ARGS", "class_args");
define("WSF_ATTACHMENTS", "attachments");
define("WSF_CID2CONTENT_TYPE", "cid2contentType");
define("WSF_ENVELOPE", "envelope");
define("WSF_BODY", "body");
define("WSF_TYPE_NAMESPACE", "type-namespace");
define("WSF_CLASSMAP", "classmap");
define("WSF_NS", "ns");
define("WSF_TYPE_NS", "type_ns");
define("WSF_TNS", "tns");
define("WSF_PORT", "port");
define("WSF_LOCATION", "location");
define("WSF_XSLT_LOCATION", "xslt_location");
define("WSF_TYPES", "types");
define("WSF_SCHEMA", "schema");
define("WSF_ELEMENT", "element");
define("WSF_LIST", "list");
define("WSF_UNION", "union");
define("WSF_WSDL_DOM", "wsdl_dom");
define("WSF_WSDL_SIMPLE", "simple");
define("WSF_WSDL_COMPLEX_TYPE", "complexType");
define("WSF_WSDL_PORT_TYPE", "portType");
define("WSF_WSDL_MESSAGE", "message");
define("WSF_WSDL_INPUT", "input");
define("WSF_WSDL_OUTPUT", "output");
define("WSF_WSDL_PART", "part");

define("WSF_WSDL1TO2_XSL_LOCATION", "dynamic_invocation/xslt/wsdl11to20.xsl10.xsl");
define("WSF_SIG_XSL_LOCATION", "dynamic_invocation/xslt/wsdl2sig.xslt");

define("WSF_WSDL2_NAMESPACE", "http://www.w3.org/ns/wsdl");
define("WSF_WSDL_NAMESPACE", "http://schemas.xmlsoap.org/wsdl/");
define("WSF_POLICY_REFERENCE_NAMESPACE_URI", "http://schemas.xmlsoap.org/ws/2004/09/policy");
define("WSF_POLICY_NAMESPACE_URI", "http://www.w3.org/ns/ws-policy");
define("WSF_POLICY_ID_NAMESPACE_URI", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");

// constants involves in sig model data

define("WSF_SIG_META_DATA", "__sig_meta_data"); // doesn't support elements with this name in schemas

define("WSF_SIG_CHILDS", "childs"); // doesn't support elements with this name in schemas
define("WSF_HAS_SIG_CHILDS", "has_childs");

define("WSF_CLASSMAP_NAME", "classmap_name");
define("WSF_XSD_NILLABLE", "nillable");
define("WSF_CONTENT_MODEL", "contentModel");
define("WSF_INNER_CONTENT", "inner-content");
define("WSF_INHERITED_CONTENT", "inherited-content");
define("WSF_INHERITING_TYPE", "inheriting-type");
define("WSF_XSI_TYPE", "xsi-type");
define("WSF_XSI_TYPE_NS", "xsi-type-ns");
define("WSF_XSI_NAMESPACE", "http://www.w3.org/2001/XMLSchema-instance");
define("WSF_XSD_NAMESPACE", "http://www.w3.org/2001/XMLSchema");
define("WSF_EXTENSION", "extension");
define("WSF_ATTRIBUTE", "attribute");

define("WSF_STARTING_NS_PREFIX", "ns1");
define("WSF_SOAP_BODY", "Body");

define("WSF_WSDL_SEQUENCE", "sequence");
define("WSF_WSDL_CHOICE", "choice");
define("WSF_WSDL_ALL", "all");

define("WSF_SIMPLE_CONTENT_VALUE", "value");
define("WSF_SIMPLE_CONTENT", "simpleContent");

define("WSF_XSD_ANYTYPE", "anyType");
define("WSF_ANY_ELEMENT", "any#");
define("WSF_VALUE", "value");

define("WSF_XSD_BASE64", "base64Binary");
define("WSF_POSTFIX_BASE64", "_encoded");
define("WSF_CONTENT_TYPE", "contentType");

define("WSF_DEFAULT_CONTENT_TYPE", "application/octet-stream");
define("WSF_MIME_NAMESPACE_PREFIX", "xmlmime");
define("WSF_MIME_NAMESPACE_URI", "http://www.w3.org/2004/06/xmlmime");
define("WSF_XOP_NAMESPACE_PREFIX", "xop");
define("WSF_XOP_NAMESPACE_URI", "http://www.w3.org/2004/08/xop/include");
define("WSF_MTOM_INCLUDE_TAG", "Include");
define("WSF_HREF_PREFIX", "cid:");
define("WSF_HREF", "href");
define("WSF_ATTACHMENT_MAP", "attachment_map");
define("WSF_RESPONSE_PAYLOAD", "response_payload");

define("WSF_SOAPHEADER", "soapheader");
define("WSF_HEADER_FOR_ATTRIBUTE", "for");
define("WSF_INPUT_HEADERS", "input_headers");
define("WSF_OUTPUT_HEADERS", "output_headers");
define("WSF_HEADER_STRING", "header_string");
define("WSF_REQUIRED", "required");
define("WSF_RESPONSE_PAYLOAD_PARAM", "response_payload_param");
define("WSF_RESPONSE_HEADER_PARAM", "response_header_param");

// log level definition

define("WSF_LOG_CRITICAL", 0);
define("WSF_LOG_ERROR", 1);
define("WSF_LOG_WARNING", 2);
define("WSF_LOG_INFO", 3);
define("WSF_LOG_DEBUG", 4);
define("WSF_LOG_USER", 5);
define("WSF_LOG_TRACE", 6);

?>


text:
BOARD ?= qemu_x86
CONF_FILE ?= prj_$(BOARD).conf

include $(ZEPHYR_BASE)/Makefile.inc

include $(ZEPHYR_BASE)/samples/net/common/Makefile.ipstack


text:
Instructions for building and uploading Vienna binaries to Github and Sourceforge.

## One time setup step: ##

### Build settings
In Xcode->File->Project settings…, you should have :

- Build System : New Build System
- Derived Data : Project-relative Location
	- DerivedData
- Advanced… : Build Location : Custom : Relative to Workspace
	- Products : Build/Products
	- Intermediates : Build/Intermediates.noindex

### CS-ID.xcconfig

To ensure that Deployment releases are properly codesigned, Xcode needs the `Scripts/Resources/CS-ID.xcconfig` file.

This file has been deliberately set to be ignored in our git repository, because its content should be personal to each developer. So you will have to create it, in order to define at least two environment variables:

`CODE_SIGN_IDENTITY`
should be exactly the name of your certificate as it is stored in Keychain.

`PRIVATE_EDDSA_KEY_PATH`
should be the location of the private EdDSA (ed25519) key used by Sparkle 2, which for obvious security reasons should not be located in the source directory !

`PRIVATE_KEY_PATH`
should be the location of the (legacy) private DSA key used by Sparkle, which for obvious security reasons should not be located in the source directory !

If you want to go further in automation of package building, you will have to define three additional environment variables in the `CS-ID.xcconfig` file. These ones are used to automate the use of the `notarytool` command line tool as described in [this page of Apple's documentation](https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow).

`APP_STORE_ID`
is the Apple ID used to connect to App Store Connect

`KEYCHAIN_PROFILE`
is the key to an app-specific password created for `notarytool` and stored through `xcrun notarytool store-credentials …`

`TEAM_ID`
is the appropriate developer team identifier. It is generally a 10-character code. You can look-up the teams you are part of in the "Membership" area of [Apple's developer portal](https://developer.apple.com/account/).

For instance, the content of my `Scripts/Resources/CS-ID.xcconfig` file looks like this :

    CODE_SIGN_IDENTITY = Developer ID Application: Barijaona Ramaholimihaso
    PRIVATE_EDDSA_KEY_PATH = $(SRCROOT)/../secrets/vienna_private_eddsa_key.pem
    PRIVATE_KEY_PATH = $(SRCROOT)/../secrets/vienna_private_key.pem
    APP_STORE_ID = barijaona@mac.com
    KEYCHAIN_PROFILE = AC_PASSWORD
    TEAM_ID = KUU2LM7U9K

__Note:__ Vienna maintainers can [contact me](https://github.com/barijaona "Github") to get provisioning profiles for the above mentioned Team ID, in order to decentralize the distribution of Vienna's official builds.

## Tag Formatting ##

Tags should be in one of the following formats:

 -	Normal release: (3.0.0)

		v/3.0.0

 -	Beta release (Second beta for 3.0.0)

		v/3.0.0_beta2

 -	Release candidate (first for 3.0.0)

		v/3.0.0_rc1

## Steps before releasing Vienna: ##

 1.	Review all recent code changes and make sure you should not change `MACOSX_DEPLOYMENT_TARGET` in the project configuration in order to protect users whose machines do not match minimum macOS requirements from a counter-productive "upgrade".
 2.	Make sure that the "CHANGES" file is up to date.
 3.	Copy the most recent part of "CHANGES" in a new text document and process it with Markdown to get a new "notes.html".
 4.	Commit anything unstaged (on `master` branch if you are releasing a beta or on `stable` branch if you are doing a normal release).
 5.	Make a new tag using `git tag -s` _tagname_, respecting the above mentioned convention (if you do not have a gpg key, you can use `git tag -a` instead).

## Steps for preparing the package to be uploaded: ##

There are two distinct ways to get the different files needed to publish an update: a semi-automated way with Xcode, a fully automated way through the command line.

### Building with Xcode

- Make sure the "Vienna" scheme is selected at the top of Xcode's main window,
- Select the "Product->Archive" menu item,
- The Organizer window should open after a while,
- Select the latest archive, click the "Distribute App" button,
- Select "Developer ID" as method of distribution,
- Accept the values proposed in the following prompts,
- Wait for the upload to finish, then a mail notification from Apple informing you that the software was successfully notarized,
- Close the organizer, select scheme "Deployment" at the top of Xcode's main window,
- Run the Deployment scheme,
- The Uploads window should open in the Finder after a while.

### Building through the command line

- If you have multiple versions of Xcode installed on your machine, ensure that an adequate version is selected. For instance, you might have to type `sudo xcode-select --switch /Applications/Xcode-beta.app` at the command line
- At the command line, run `make release`
- You will have enough time to take a tea, walk the dog or read your mails…
- At the end of the process, the Uploads window should open in the Finder,
- Check the last messages in the terminal. You should have something like `** EXPORT SUCCEEDED **` and `** BUILD SUCCEEDED **`.

## Steps to upload the release to the web ##

 1.	Push the tag to ViennaRSS' repository at Github (`git push --tags ViennaRSS master` or `git push --tags ViennaRSS stable`, accordingly).
 2.	Upload the contents of `build/Uploads` using the following steps.
  (Note: I'm using Vienna 3.3.0_beta4, 3.3.0_rc1 and 3.3.0 as examples here.)

### On Github:

   1. Go to Vienna's releases page on Github : <https://github.com/ViennaRSS/vienna-rss/releases>
   2. Choose "Draft a new release", type the tag name (`v/3.3.0_beta4`), a description ("Vienna 3.3.0 Beta 4").
   3. Upload the `Vienna3.3.0_beta4.tar.gz` file.
   4. Upload also the compressed dSYM file (whose nome should be something similar to `Vienna3.3.0_beta4.5b272a6-dSYM.tar.gz`)
   5. For beta and release candidates, check the "This is a prerelease" box.
   6. Click the "Publish" button.
   7. Verify the uploaded app: download it, uncompress it and check that it runs OK.

### On Sourceforge.net:

   12. Check that the SourceForge Downloads page for Vienna at <https://sourceforge.net/projects/vienna-rss/files/> got the new files.
   13. For stable releases only : from the Sourceforge site, choose the ℹ button ("View details") of "Vienna3.3.0.tar.gz" (be careful to select the binary and not the code source file or the dSYM file!) and set the file as default download for Mac OS X. Don't do this for beta releases!

### On viennarss.github.io

   14. Upload `changelog_beta.xml` (or `changelog_rc.xml` or `changelog.xml` accordingly) and the `noteson3.3.0_beta4.html` file in the sparkle_files directory
   15. If you upload a release candidate, change `changelog_beta.xml` to be a copy of the new `changelog_rc.xml` ; and if you upload a release, change `changelog_rc.xml` to be a copy of the new `changelog.xml`
   16. Run the previous version of Vienna, and make sure that the Sparkle update mechanism works correctly to display and download the latest version. After updating, check again to make sure Sparkle is showing that you have the latest version.

### On Brew Cask

17. __For stable releases only :__ follow the steps listed below, adapted from the [Brew Cask Wiki](https://github.com/caskroom/homebrew-cask/blob/master/CONTRIBUTING.md#updating-a-cask):

>We have a [script](https://github.com/vitorgalvao/tiny-scripts/blob/master/cask-repair) that will ask for the new version number, and take care of updating the Cask file and submitting a pull request to homebrew-cask:

```bash
# install and setup script - only needed once
brew install vitorgalvao/tiny-scripts/cask-repair
cask-repair --help

# from time to time (especially on major macOS updates)
brew upgrade cask-repair

# use to update <outdated_cask>
cask-repair vienna
```

Finally, consider posting an announcement of the new release on the CocoaForge Vienna forum at <http://forums.cocoaforge.com/viewforum.php?f=18> and/or <http://vienna-rss.com>.


text:
package org.toobsframework.pres.chart.controller;

import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Date;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.jfree.chart.ChartRenderingInfo;
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.imagemap.ImageMapUtilities;
import org.jfree.chart.imagemap.StandardURLTagFragmentGenerator;
import org.jfree.chart.imagemap.URLTagFragmentGenerator;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.util.WebUtils;

import org.toobsframework.pres.base.HandlerBase;
import org.toobsframework.pres.chart.ChartBuilder;
import org.toobsframework.pres.chart.ChartDefinition;
import org.toobsframework.pres.chart.ChartException;
import org.toobsframework.pres.chart.ChartNotFoundException;
import org.toobsframework.pres.chart.manager.IChartManager;
import org.toobsframework.pres.url.UrlDispatchInfo;
import org.toobsframework.pres.util.ComponentRequestManager;
import org.toobsframework.util.Configuration;
import org.toobsframework.util.IRequest;

public class ChartHandler extends HandlerBase implements IChartHandler, BeanFactoryAware {

  private IChartManager chartManager = null;
  private ChartBuilder chartBuilder = null;
  private ComponentRequestManager componentRequestManager = null;
  private BeanFactory beanFactory;

  /**
   *
   * Retrieves the URL path to use for lookup and delegates to
   * getViewNameForUrlPath.
   *
   * @throws Exception Exception fetching or rendering component.
   * @see #getViewNameForUrlPath
   *
   */
  @Override
  protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response, UrlDispatchInfo dispatchInfo) throws Exception {

    String chartId = dispatchInfo.getResourceId();
    if (log.isDebugEnabled()) {
      log.debug("Rendering chart '" + chartId + "' for lookup path: " + dispatchInfo.getOriginalPath());
    }

    IRequest componentRequest = this.setupComponentRequest(dispatchInfo, request, response, true);

    Date startTime = null;
    if (log.isDebugEnabled()) {
      startTime = new Date();
    }

    JFreeChart chart = null;
    int height = 400;
    int width = 600;
    ChartDefinition chartDef = null;
    if(null != chartId && !chartId.equals("")) {
      try {
        request.setAttribute("chartId", chartId);
        chartDef = this.chartManager.getChartDefinition(chartId);
      } catch (ChartNotFoundException cnfe) {
        log.warn("Chart " + chartId + " not found.");
        throw cnfe;
      }
      try {

        chart = chartBuilder.build(chartDef, componentRequest);
        width = chartDef.getChartWidth();
        height = chartDef.getChartHeight();

      } catch (ChartException e) {
        Throwable t = e.rootCause();
        log.info("Root cause " + t.getClass().getName() + " " + t.getMessage());
        throw e;
      } catch (Exception e) {
        throw e;
      } finally {
        this.componentRequestManager.unset();
      }

    } else {
      throw new Exception ("No chartId specified");
    }

    //Write out to the response.
    response.setHeader("Pragma",        "no-cache");                   // HTTP 1.0
    response.setHeader("Cache-Control", "max-age=0, must-revalidate"); // HTTP 1.1
    ChartRenderingInfo chartRenderingInfo = new ChartRenderingInfo();
    if (chartDef.doImageWithMap()) {
      response.setContentType("text/html; charset=UTF-8");
      String genFileName = chartDef.getId() + "-" + new Date().getTime() + ".png";
      String imageOutputFileName = configuration.getUploadDir() + genFileName;
      File imageOutputFile = new File(imageOutputFileName);
      OutputStream os = null;
      try {
        os = new FileOutputStream(imageOutputFile);
        ChartUtilities.writeChartAsPNG(os, chart, width, height, chartRenderingInfo);
      } finally {
        if (os != null) {
          os.close();
        }
      }
      PrintWriter writer = response.getWriter();
      StringBuffer sb = new StringBuffer();

      // TODO BUGBUG Chart location needs to fixed
      sb.append("");
      URLTagFragmentGenerator urlGenerator;
      if (chartDef.getUrlFragmentBean() != null) {
        urlGenerator = (URLTagFragmentGenerator)beanFactory.getBean(chartDef.getUrlFragmentBean());
      } else {
        urlGenerator = new StandardURLTagFragmentGenerator();
      }
      sb.append(ImageMapUtilities.getImageMap(chartDef.getId() + "Map", chartRenderingInfo, null, urlGenerator));
      writer.print(sb.toString());
      writer.flush();

    } else {
      response.setContentType("image/png");

      ChartUtilities.writeChartAsPNG(response.getOutputStream(), chart, width, height, chartRenderingInfo);

    }

    if (log.isDebugEnabled()) {
      Date endTime = new Date();
      log.debug("Time [" + chartId + "] - " + (endTime.getTime() - startTime.getTime()));
    }
    return null;

  }

  /**
   * Extract the URL filename from the given request URI.
   * Delegates to WebUtils.extractViewNameFromUrlPath(String).
   * @param uri the request URI (e.g. "/index.html")
   * @return the extracted URI filename (e.g. "index")
   * @see org.springframework.web.util.WebUtils#extractFilenameFromUrlPath
   */
  protected String extractViewNameFromUrlPath(String uri) {
    return WebUtils.extractFilenameFromUrlPath(uri);
  }

  public IChartManager getChartManager() {
    return chartManager;
  }

  public void setChartManager(
      IChartManager chartManager) {
    this.chartManager = chartManager;
  }

  public ComponentRequestManager getComponentRequestManager() {
    return componentRequestManager;
  }

  public void setComponentRequestManager(
      ComponentRequestManager componentRequestManager) {
    this.componentRequestManager = componentRequestManager;
  }

  public ChartBuilder getChartBuilder() {
    return chartBuilder;
  }

  public void setChartBuilder(ChartBuilder chartBuilder) {
    this.chartBuilder = chartBuilder;
  }

  public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
    this.beanFactory = beanFactory;
  }

}


text:
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="20dp"
    android:height="20dp"
    android:viewportWidth="20"
    android:viewportHeight="20"
    android:tint="?attr/colorControlNormal">
  <path
      android:fillColor="@android:color/white"
      android:pathData="M4.375,17.417 L3.708,16.729 10,2.542 16.292,16.729 15.625,17.417 10,15.042Z"/>
</vector>


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

		<title>Testing repeat dojox.io.scriptFrame calls</title>

This page tests repeat usage of dojo.io.script.get() with the dojox.io.scriptFrame extensions.

Inspect the iframe created by dojox.io.scriptFrame to see if it is performing correctly.


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

package com.google.api.ads.adwords.jaxws.v201809.cm;

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

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

 *

 * <simpleType name="AgeRange.AgeRangeType">
 *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *     <enumeration value="AGE_RANGE_18_24"/>
 *     <enumeration value="AGE_RANGE_25_34"/>
 *     <enumeration value="AGE_RANGE_35_44"/>
 *     <enumeration value="AGE_RANGE_45_54"/>
 *     <enumeration value="AGE_RANGE_55_64"/>
 *     <enumeration value="AGE_RANGE_65_UP"/>
 *     <enumeration value="AGE_RANGE_UNDETERMINED"/>
 *     <enumeration value="UNKNOWN"/>
 *   </restriction>
 * </simpleType>
 *

 *
 */
@XmlType(name = "AgeRange.AgeRangeType")
@XmlEnum
public enum AgeRangeAgeRangeType {

    AGE_RANGE_18_24,
    AGE_RANGE_25_34,
    AGE_RANGE_35_44,
    AGE_RANGE_45_54,
    AGE_RANGE_55_64,
    AGE_RANGE_65_UP,
    AGE_RANGE_UNDETERMINED,

    /**
     *
     *                 Used for return value only. An enumeration could not be processed, typically due to incompatibility with your WSDL version.
     *
     *
     */
    UNKNOWN;

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

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

}


text:
package centaur.test.submit

import cats.data.Validated._
import cats.implicits._
import com.typesafe.config.Config
import configs.Result
import configs.syntax._
import lenthall.validation.ErrorOr.ErrorOr

case class SubmitResponse(statusCode: Int, message: String)

object SubmitResponse {

  def fromConfig(conf: Config): ErrorOr[Option[SubmitResponse]] = {
    conf.get[Config]("submit") match {
      case Result.Failure(_) => Valid(None)
      case Result.Success(submitConf) =>
        val errorOrStatusCode: ErrorOr[Int] = toErrorOr(submitConf.get[Int]("statusCode"))
        val errorOrMessage: ErrorOr[String] = toErrorOr(submitConf.get[String]("message"))
        errorOrStatusCode |@| errorOrMessage map {
          SubmitResponse(_, _)
        } map {
          Option(_)
        }
    }
  }

  private def toErrorOr[A](result: Result[A]): ErrorOr[A] = {
    result match {
      case Result.Success(value) => Valid(value)
      case Result.Failure(error) =>
        error.messages
          .toList
          .toNel
          .getOrElse(throw new RuntimeException("Paranoia... error.messages is a Nel exposed as a Seq."))
          .invalid
    }
  }
}


text:
/*
 * lcp.h - Link Control Protocol definitions.
 *
 * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The name "Carnegie Mellon University" must not be used to
 *    endorse or promote products derived from this software without
 *    prior written permission. For permission or any legal
 *    details, please contact
 *      Office of Technology Transfer
 *      Carnegie Mellon University
 *      5000 Forbes Avenue
 *      Pittsburgh, PA  15213-3890
 *      (412) 268-4387, fax: (412) 268-7395
 *      tech-transfer@andrew.cmu.edu
 *
 * 4. Redistributions of any form whatsoever must retain the following
 *    acknowledgment:
 *    "This product includes software developed by Computing Services
 *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
 *
 * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
 * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
 * $Id: lcp.h,v 1.20 2004/11/14 22:53:42 carlsonj Exp $
 */

#include "lwip/netif/ppp/ppp_opts.h"
#if PPP_SUPPORT					/* don't build if not configured for use in lwipopts.h */

#ifndef LCP_H
#define	LCP_H

#include "ppp.h"

/*
 * Options.
 */
#define CI_VENDOR	0			/* Vendor Specific */
#define CI_MRU		1			/* Maximum Receive Unit */
#define CI_ASYNCMAP	2			/* Async Control Character Map */
#define CI_AUTHTYPE	3			/* Authentication Type */
#define CI_QUALITY	4			/* Quality Protocol */
#define CI_MAGICNUMBER	5		/* Magic Number */
#define CI_PCOMPRESSION	7		/* Protocol Field Compression */
#define CI_ACCOMPRESSION 8		/* Address/Control Field Compression */
#define CI_FCSALTERN	9		/* FCS-Alternatives */
#define CI_SDP		10			/* Self-Describing-Pad */
#define CI_NUMBERED	11			/* Numbered-Mode */
#define CI_CALLBACK	13			/* callback */
#define CI_MRRU		17			/* max reconstructed receive unit; multilink */
#define CI_SSNHF	18			/* short sequence numbers for multilink */
#define CI_EPDISC	19			/* endpoint discriminator */
#define CI_MPPLUS	22			/* Multi-Link-Plus-Procedure */
#define CI_LDISC	23			/* Link-Discriminator */
#define CI_LCPAUTH	24			/* LCP Authentication */
#define CI_COBS		25			/* Consistent Overhead Byte Stuffing */
#define CI_PREFELIS	26			/* Prefix Elision */
#define CI_MPHDRFMT	27			/* MP Header Format */
#define CI_I18N		28			/* Internationalization */
#define CI_SDL		29			/* Simple Data Link */

/*
 * LCP-specific packet types (code numbers).
 */
#define PROTREJ		8			/* Protocol Reject */
#define ECHOREQ		9			/* Echo Request */
#define ECHOREP		10			/* Echo Reply */
#define DISCREQ		11			/* Discard Request */
#define IDENTIF		12			/* Identification */
#define TIMEREM		13			/* Time Remaining */

/* Value used as data for CI_CALLBACK option */
#define CBCP_OPT	6			/* Use callback control protocol */

#if 0							/* moved to ppp_opts.h */
#define DEFMRU	1500			/* Try for this */
#define MINMRU	128				/* No MRUs below this */
#define MAXMRU	16384			/* Normally limit MRU to this */
#endif							/* moved to ppp_opts.h */

/* An endpoint discriminator, used with multilink. */
#define MAX_ENDP_LEN	20		/* maximum length of discriminator value */
struct epdisc {
	unsigned char class_;		/* -- The word "class" is reserved in C++. */
	unsigned char length;
	unsigned char value[MAX_ENDP_LEN];
};

/*
 * The state of options is described by an lcp_options structure.
 */
typedef struct lcp_options {
	unsigned int passive:1;		/* Don't die if we don't get a response */
	unsigned int silent:1;		/* Wait for the other end to start first */
#if 0							/* UNUSED */
	unsigned int restart:1;		/* Restart vs. exit after close */
#endif							/* UNUSED */
	unsigned int neg_mru:1;		/* Negotiate the MRU? */
	unsigned int neg_asyncmap:1;	/* Negotiate the async map? */
#if PAP_SUPPORT
	unsigned int neg_upap:1;	/* Ask for UPAP authentication? */
#endif							/* PAP_SUPPORT */
#if CHAP_SUPPORT
	unsigned int neg_chap:1;	/* Ask for CHAP authentication? */
#endif							/* CHAP_SUPPORT */
#if EAP_SUPPORT
	unsigned int neg_eap:1;		/* Ask for EAP authentication? */
#endif							/* EAP_SUPPORT */
	unsigned int neg_magicnumber:1;	/* Ask for magic number? */
	unsigned int neg_pcompression:1;	/* HDLC Protocol Field Compression? */
	unsigned int neg_accompression:1;	/* HDLC Address/Control Field Compression? */
#if LQR_SUPPORT
	unsigned int neg_lqr:1;		/* Negotiate use of Link Quality Reports */
#endif							/* LQR_SUPPORT */
	unsigned int neg_cbcp:1;	/* Negotiate use of CBCP */
#ifdef HAVE_MULTILINK
	unsigned int neg_mrru:1;	/* negotiate multilink MRRU */
#endif							/* HAVE_MULTILINK */
	unsigned int neg_ssnhf:1;	/* negotiate short sequence numbers */
	unsigned int neg_endpoint:1;	/* negotiate endpoint discriminator */

	u16_t mru;					/* Value of MRU */
#ifdef HAVE_MULTILINK
	u16_t mrru;					/* Value of MRRU, and multilink enable */
#endif							/* MULTILINK */
#if CHAP_SUPPORT
	u8_t chap_mdtype;			/* which MD types (hashing algorithm) */
#endif							/* CHAP_SUPPORT */
	u32_t asyncmap;				/* Value of async map */
	u32_t magicnumber;
	u8_t numloops;				/* Number of loops during magic number neg. */
#if LQR_SUPPORT
	u32_t lqr_period;			/* Reporting period for LQR 1/100ths second */
#endif							/* LQR_SUPPORT */
	struct epdisc endpoint;		/* endpoint discriminator */
} lcp_options;

void lcp_open(ppp_pcb * pcb);
void lcp_close(ppp_pcb * pcb, const char *reason);
void lcp_lowerup(ppp_pcb * pcb);
void lcp_lowerdown(ppp_pcb * pcb);
void lcp_sprotrej(ppp_pcb * pcb, u_char * p, int len);	/* send protocol reject */

extern const struct protent lcp_protent;

#if 0							/* moved to ppp_opts.h */
/* Default number of times we receive our magic number from the peer
   before deciding the link is looped-back. */
#define DEFLOOPBACKFAIL	10
#endif							/* moved to ppp_opts.h */

#endif							/* LCP_H */
#endif							/* PPP_SUPPORT */


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = cloneNode;

var _definitions = require("../definitions");

const has = Function.call.bind(Object.prototype.hasOwnProperty);

function cloneIfNode(obj, deep) {
  if (obj && typeof obj.type === "string" && obj.type !== "CommentLine" && obj.type !== "CommentBlock") {
    return cloneNode(obj, deep);
  }

  return obj;
}

function cloneIfNodeOrArray(obj, deep) {
  if (Array.isArray(obj)) {
    return obj.map(node => cloneIfNode(node, deep));
  }

  return cloneIfNode(obj, deep);
}

function cloneNode(node, deep = true) {
  if (!node) return node;
  const {
    type
  } = node;
  const newNode = {
    type
  };

  if (type === "Identifier") {
    newNode.name = node.name;
  } else if (!has(_definitions.NODE_FIELDS, type)) {
    throw new Error(`Unknown node type: "${type}"`);
  } else {
    for (const field of Object.keys(_definitions.NODE_FIELDS[type])) {
      if (has(node, field)) {
        newNode[field] = deep ? cloneIfNodeOrArray(node[field], true) : node[field];
      }
    }
  }

  if (has(node, "loc")) {
    newNode.loc = node.loc;
  }

  if (has(node, "leadingComments")) {
    newNode.leadingComments = node.leadingComments;
  }

  if (has(node, "innerComments")) {
    newNode.innerComments = node.innerCmments;
  }

  if (has(node, "trailingComments")) {
    newNode.trailingComments = node.trailingComments;
  }

  if (has(node, "extra")) {
    newNode.extra = Object.assign({}, node.extra);
  }

  return newNode;
}


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>
LifeCycleCallbackCollection (Jetty Server Project 6.1.26 API)
</TITLE>

<META NAME="date" CONTENT="2010-11-11">

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

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.mortbay.jetty.plus.annotation

Class LifeCycleCallbackCollection

java.lang.Object
  org.mortbay.jetty.plus.annotation.LifeCycleCallbackCollection

public class LifeCycleCallbackCollection
extends java.lang.Object

LifeCycleCallbackCollection

Constructor Summary

LifeCycleCallbackCollection()

Method Summary

 void
add(LifeCycleCallback callback)

          Add a Callback to the list of callbacks.

 void
callPostConstructCallback(java.lang.Object o)

          Call the method, if one exists, that is annotated with PostConstruct
 or with <post-construct> in web.xml

 void
callPreDestroyCallback(java.lang.Object o)

          Call the method, if one exists, that is annotated with PreDestroy
 or with <pre-destroy> in web.xml

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LifeCycleCallbackCollection

public LifeCycleCallbackCollection()

Method Detail

add

public void add(LifeCycleCallback callback)

Add a Callback to the list of callbacks.

Parameters:
callback -

callPostConstructCallback

public void callPostConstructCallback(java.lang.Object o)
                               throws java.lang.Exception

Call the method, if one exists, that is annotated with PostConstruct
 or with <post-construct> in web.xml

Parameters:
o - the object on which to attempt the callback

Throws:

java.lang.Exception

callPreDestroyCallback

public void callPreDestroyCallback(java.lang.Object o)
                            throws java.lang.Exception

Call the method, if one exists, that is annotated with PreDestroy
 or with <pre-destroy> in web.xml

Parameters:
o - the object on which to attempt the callback

Throws:

java.lang.Exception

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.


text:
#ifndef CONFIG_MATHUTIL_H
#define CONFIG_MATHUTIL_H

#include "pandabase.h"
#include "notifyCategoryProxy.h"
#include "configVariableDouble.h"
#include "configVariableEnum.h"
#include "boundingVolume.h"

NotifyCategoryDecl(mathutil, EXPCL_PANDA_MATHUTIL, EXPTP_PANDA_MATHUTIL);

extern ConfigVariableDouble fft_offset;
extern ConfigVariableDouble fft_factor;
extern ConfigVariableDouble fft_exponent;
extern ConfigVariableDouble fft_error_threshold;
extern EXPCL_PANDA_MATHUTIL ConfigVariableEnum<BoundingVolume::BoundsType> bounds_type;

extern EXPCL_PANDA_MATHUTIL void init_libmathutil();

#endif


text:
package com.amazonaws.services.identitymanagement.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.Request;
import com.amazonaws.DefaultRequest;
import com.amazonaws.http.HttpMethodName;
import com.amazonaws.services.identitymanagement.model.*;
import com.amazonaws.transform.Marshaller;
import com.amazonaws.util.StringUtils;

/**
 * CreateOpenIDConnectProviderRequest Marshaller
 */

@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateOpenIDConnectProviderRequestMarshaller implements
        Marshaller<Request<CreateOpenIDConnectProviderRequest>, CreateOpenIDConnectProviderRequest> {

    public Request<CreateOpenIDConnectProviderRequest> marshall(CreateOpenIDConnectProviderRequest createOpenIDConnectProviderRequest) {

        if (createOpenIDConnectProviderRequest == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        Request<CreateOpenIDConnectProviderRequest> request = new DefaultRequest<CreateOpenIDConnectProviderRequest>(createOpenIDConnectProviderRequest,
                "AmazonIdentityManagement");
        request.addParameter("Action", "CreateOpenIDConnectProvider");
        request.addParameter("Version", "2010-05-08");
        request.setHttpMethod(HttpMethodName.POST);

        if (createOpenIDConnectProviderRequest.getUrl() != null) {
            request.addParameter("Url", StringUtils.fromString(createOpenIDConnectProviderRequest.getUrl()));
        }

        if (!createOpenIDConnectProviderRequest.getClientIDList().isEmpty()
                || !((com.amazonaws.internal.SdkInternalList<String>) createOpenIDConnectProviderRequest.getClientIDList()).isAutoConstruct()) {
            com.amazonaws.internal.SdkInternalList<String> clientIDListList = (com.amazonaws.internal.SdkInternalList<String>) createOpenIDConnectProviderRequest
                    .getClientIDList();
            int clientIDListListIndex = 1;

            for (String clientIDListListValue : clientIDListList) {
                if (clientIDListListValue != null) {
                    request.addParameter("ClientIDList.member." + clientIDListListIndex, StringUtils.fromString(clientIDListListValue));
                }
                clientIDListListIndex++;
            }
        }

        if (!createOpenIDConnectProviderRequest.getThumbprintList().isEmpty()
                || !((com.amazonaws.internal.SdkInternalList<String>) createOpenIDConnectProviderRequest.getThumbprintList()).isAutoConstruct()) {
            com.amazonaws.internal.SdkInternalList<String> thumbprintListList = (com.amazonaws.internal.SdkInternalList<String>) createOpenIDConnectProviderRequest
                    .getThumbprintList();
            int thumbprintListListIndex = 1;

            for (String thumbprintListListValue : thumbprintListList) {
                if (thumbprintListListValue != null) {
                    request.addParameter("ThumbprintList.member." + thumbprintListListIndex, StringUtils.fromString(thumbprintListListValue));
                }
                thumbprintListListIndex++;
            }
        }

        return request;
    }

}


text:
<?xml version="1.0"?>

<document>
  <properties>
    <title>Basic JCS Configuration</title>
    <author email="ASmuts@therealm.com">Aaron Smuts</author>
  </properties>

        The following document illustrates several basic JCS
        configurations.  As you'll see, using JCS can be as simple as
        creating a single memory cache for you application.  However,
        with a few configuration changes, you can quickly enable some
        distributed caching features that can scale your application
        even further.

      <subsection name="Building a cache.ccf file">

          Configuring the JCS can be as simple as your needs.  The most
          basic configuration would be a pure memory cache where every
          region takes the default values.  The complete configuration
          file (cache.ccf) could look like this:

        <source><![CDATA[
# DEFAULT CACHE REGION

jcs.default=
jcs.default.cacheattributes=
    org.apache.commons.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=1000
jcs.default.cacheattributes.MemoryCacheName=
    org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache
        ]]></source>

          If you want to add memory shrinking then you can add these
          lines:

        <source><![CDATA[
jcs.default.cacheattributes.UseMemoryShrinker=true
jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600
jcs.default.cacheattributes.ShrinkerIntervalSeconds=60
jcs.default.cacheattributes.MaxSpoolPerRun=500
jcs.default.elementattributes=org.apache.commons.jcs.engine.ElementAttributes
jcs.default.elementattributes.IsEternal=false
        ]]></source>

          Adding a disk cache is
          as simple as telling it what folder to use.  It is recommended
          that you add a disk cache.  If you want to add a disk cache to
          your default parameters, then (1) add this to the bottom of
          the file to create the auxiliary:

        <source><![CDATA[
jcs.auxiliary.DC=
    org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
jcs.auxiliary.DC.attributes=
    org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
jcs.auxiliary.DC.attributes.DiskPath=g:/dev/jcs/raf
        ]]></source>

          and (2) change the first line to:

        <source><![CDATA[
jcs.default=DC
        ]]></source>

          If you want to predefine a specific region, say called
          testCache1, then add these lines:

        <source><![CDATA[
jcs.region.testCache1=DC
jcs.region.testCache1.cacheattributes=
    org.apache.commons.jcs.engine.CompositeCacheAttributes
jcs.region.testCache1.cacheattributes.MaxObjects=1000
jcs.region.testCache1.cacheattributes.MemoryCacheName=
    org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache
jcs.region.testCache1.cacheattributes.UseMemoryShrinker=true
jcs.region.testCache1.cacheattributes.MaxMemoryIdleTimeSeconds=3600
jcs.region.testCache1.cacheattributes.ShrinkerIntervalSeconds=60
jcs.region.testCache1.cacheattributes.MaxSpoolPerRun=500
jcs.region.testCache1.elementattributes=org.apache.commons.jcs.engine.ElementAttributes
jcs.region.testCache1.elementattributes.IsEternal=false

        ]]></source>

          If you want to add a lateral cache for distribution (the TCP Lateral Auxiliary is
          recommended), then add these lines to the bottom of the file
          to define the auxiliary:

        <source><![CDATA[
jcs.auxiliary.LTCP=
    org.apache.commons.jcs.auxiliary.lateral.LateralCacheFactory
jcs.auxiliary.LTCP.attributes=
    org.apache.commons.jcs.auxiliary.lateral.LateralCacheAttributes
jcs.auxiliary.LTCP.attributes.TransmissionTypeName=TCP
jcs.auxiliary.LTCP.attributes.TcpServers=localhost:1111
jcs.auxiliary.LTCP.attributes.TcpListenerPort=1110
jcs.auxiliary.LTCP.attributes.PutOnlyMode=false
        ]]></source>

          See the TCP Lateral documentation for more information.  If you
          want to set up testCache1 to use this, then change
          the definition to:

        <source><![CDATA[
jcs.region.testCache1=DC,LTCP
        ]]></source>
      </subsection>
      <subsection name="A few comments on configuration">

          Auxiliary definitions are like log4j appenders, they are defined
          and then associated with a region like a log4j category.

          The order of configuration file is unimportant, though you
          should try to keep it organized for your own sake.

          Configuration is being refactored and is subject to change.  It
          should only become easier.

      </subsection>
      <subsection name="The complete file">

          The complete file from above would look like this:

        <source><![CDATA[
# DEFAULT CACHE REGION

jcs.default=DC,LTCP
jcs.default.cacheattributes=
    org.apache.commons.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=1000
jcs.default.cacheattributes.MemoryCacheName=
    org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache

# PRE-DEFINED CACHE REGIONS

jcs.region.testCache1=DC,LTCP
jcs.region.testCache1.cacheattributes=
    org.apache.commons.jcs.engine.CompositeCacheAttributes
jcs.region.testCache1.cacheattributes.MaxObjects=1000
jcs.region.testCache1.cacheattributes.MemoryCacheName=
    org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache
jcs.region.testCache1.cacheattributes.UseMemoryShrinker=true
jcs.region.testCache1.cacheattributes.MaxMemoryIdleTimeSeconds=3600
jcs.region.testCache1.cacheattributes.ShrinkerIntervalSeconds=60
jcs.region.testCache1.cacheattributes.MaxSpoolPerRun=500
jcs.region.testCache1.elementattributes=org.apache.commons.jcs.engine.ElementAttributes
jcs.region.testCache1.elementattributes.IsEternal=false

# AVAILABLE AUXILIARY CACHES
jcs.auxiliary.DC=
    org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
jcs.auxiliary.DC.attributes=
    org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
jcs.auxiliary.DC.attributes.DiskPath=g:/dev/jcs/raf
jcs.auxiliary.DC.attributes.maxKeySize=100000

jcs.auxiliary.LTCP=
    org.apache.commons.jcs.auxiliary.lateral.LateralCacheFactory
jcs.auxiliary.LTCP.attributes=
    org.apache.commons.jcs.auxiliary.lateral.LateralCacheAttributes
jcs.auxiliary.LTCP.attributes.TransmissionTypeName=TCP
jcs.auxiliary.LTCP.attributes.TcpServers=localhost:1111
jcs.auxiliary.LTCP.attributes.TcpListenerPort=1110
jcs.auxiliary.LTCP.attributes.PutOnlyMode=false
        ]]></source>
      </subsection>

</document>


text:
package com.timgroup.karg.keywords;

import org.junit.Test;

import com.timgroup.karg.keywords.Keyword;
import com.timgroup.karg.keywords.KeywordArgument;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;

public class KeywordArgumentTest {

    @SuppressWarnings("unchecked")
    @Test public void
    bindsAKeywordToAValue() {
        Keyword<String> name = Keywords.newKeyword();
        KeywordArgument bound = KeywordArgument.value(name, "Hello");
        assertThat((Keyword<String>) bound.keyword(), is(name));
        assertThat((String) bound.value(), is("Hello"));
    }

}


text:
#import "TWTRPlayerCardEntity.h"
#import <TwitterCore/TWTRDictUtil.h>
#import "TWTRCardEntity+Subclasses.h"
#import "TWTRImages.h"
#import "TWTRJSONKeyRequirement.h"
#import "TWTRJSONValidator.h"
#import "TWTRMediaEntityDisplayConfiguration.h"
#import "TWTRNSCodingUtil.h"
#import "TWTRValueTransformers.h"
#import "TWTRViewUtil.h"

static NSString *const TWTRVineUserIDString = @"586671909";

static NSString *const TWTRPlayerCardSiteBindingValueKey = @"site";
static NSString *const TWTRPlayerCardAppNameBindingValueKey = @"app_name";
static NSString *const TWTRPlayerCardPlayerStreamURLBindingValueKey = @"player_stream_url";
static NSString *const TWTRPlayerCardPlayerURLBindingValueKey = @"card_url";
static NSString *const TWTRPlayerCardPlayerImageBindingValueKey = @"player_image";
static NSString *const TWTRPlayerCardDescriptionBindingValueKey = @"description";

static NSString *const TWTRPlayerCardURLKey = @"url";
static NSString *const TWTRPlayerCardBindingValuesKey = @"binding_values";
static NSString *const TWTRPlayerCardNameKey = @"name";
static NSString *const TWTRPlayerCardPlayerTypeName = @"player";

@interface TWTRPlayerCardEntityBindingValues ()

@property (nonatomic, readonly) NSString *IDString;
@property (nonatomic, copy) NSDictionary<NSString *, id> *validatedDictionary;

@end

@implementation TWTRPlayerCardEntityBindingValues

- (nullable instancetype)initWithJSONDictionary:(NSDictionary *)dictionary
{
    NSDictionary<NSString *, id> *validatedDictionary = [[self class] validateJSONDictionary:dictionary];
    if (validatedDictionary == nil) {
        return nil;
    }

    return [self initWithValidatedDictionary:validatedDictionary];
}

- (instancetype)initWithValidatedDictionary:(NSDictionary<NSString *, id> *)validatedDictionary
{
    self = [super init];

    if (self) {
        _validatedDictionary = validatedDictionary;
        [self setPropertiesFromValidatedDictionary:validatedDictionary];
    }

    return self;
}

- (instancetype)initWithCoder:(NSCoder *)decoder
{
    NSDictionary *validatedDictionary = [decoder decodeObjectOfClass:[NSDictionary class] forKey:TWTRValidatedDictionaryEncoderKey];

    if (validatedDictionary) {
        return [self initWithValidatedDictionary:validatedDictionary];
    } else {
        return nil;
    }
}

- (void)encodeWithCoder:(NSCoder *)encoder
{
    [encoder encodeObject:self.validatedDictionary forKey:TWTRValidatedDictionaryEncoderKey];
}

- (id)copyWithZone:(NSZone *)zone
{
    return self;
}

- (NSUInteger)hash
{
    return [self.validatedDictionary hash];
}

- (BOOL)isEqual:(id)object
{
    if ([object isKindOfClass:[TWTRPlayerCardEntityBindingValues class]]) {
        return [self isEqualToPlayerCardEntityBindingValues:object];
    } else {
        return NO;
    }
}

- (BOOL)isEqualToPlayerCardEntityBindingValues:(TWTRPlayerCardEntityBindingValues *)other
{
    return [self.validatedDictionary isEqualToDictionary:other.validatedDictionary];
}

- (void)setPropertiesFromValidatedDictionary:(NSDictionary *)dict
{
    _IDString = [dict[TWTRPlayerCardSiteBindingValueKey] copy];
    _appName = [dict[TWTRPlayerCardAppNameBindingValueKey] copy];
    _playerStreamURL = [dict[TWTRPlayerCardPlayerStreamURLBindingValueKey] copy];
    _playerURL = [dict[TWTRPlayerCardPlayerURLBindingValueKey] copy];
    _cardDescription = [dict[TWTRPlayerCardDescriptionBindingValueKey] copy];

    TWTRCardEntityImageValue *imageValue = dict[TWTRPlayerCardPlayerImageBindingValueKey];
    _playerImageURL = [imageValue.imageURLString copy];
    _playerImageSize = imageValue.imageSize;
}

+ (TWTRJSONValidator *)JSONValidator
{
    static TWTRJSONValidator *validator = nil;
    static dispatch_once_t onceToken;

    dispatch_once(&onceToken, ^{
        NSDictionary *transformers = @{
            TWTRPlayerCardSiteBindingValueKey: [NSValueTransformer valueTransformerForName:TWTRCardSiteValueToUserIDStringTransformerName],
            TWTRPlayerCardAppNameBindingValueKey: [NSValueTransformer valueTransformerForName:TWTRCardEntityBindingValueStringTransformerName],
            TWTRPlayerCardPlayerStreamURLBindingValueKey: [NSValueTransformer valueTransformerForName:TWTRCardEntityBindingValueStringTransformerName],
            TWTRPlayerCardPlayerURLBindingValueKey: [NSValueTransformer valueTransformerForName:TWTRCardEntityBindingValueStringTransformerName],
            TWTRPlayerCardDescriptionBindingValueKey: [NSValueTransformer valueTransformerForName:TWTRCardEntityBindingValueStringTransformerName],
            TWTRPlayerCardPlayerImageBindingValueKey: [NSValueTransformer valueTransformerForName:TWTRCardEntityBindingValueImageTransformerName],
        };

        NSDictionary *outputValues = @{
            TWTRPlayerCardSiteBindingValueKey: [TWTRJSONKeyRequirement requiredString],
            TWTRPlayerCardAppNameBindingValueKey: [TWTRJSONKeyRequirement requiredString],
            TWTRPlayerCardPlayerStreamURLBindingValueKey: [TWTRJSONKeyRequirement requiredString],
            TWTRPlayerCardPlayerURLBindingValueKey: [TWTRJSONKeyRequirement requiredString],
            TWTRPlayerCardDescriptionBindingValueKey: [TWTRJSONKeyRequirement requiredString],
            TWTRPlayerCardPlayerImageBindingValueKey: [TWTRJSONKeyRequirement requiredKeyOfClass:[TWTRCardEntityImageValue class]],
        };

        validator = [[TWTRJSONValidator alloc] initWithValueTransformers:transformers outputValues:outputValues];
    });

    return validator;
}

+ (NSDictionary<NSString *, id> *)validateJSONDictionary:(NSDictionary<NSString *, id> *)JSON
{
    return [[self JSONValidator] validatedDictionaryFromJSON:JSON];
}

@end

#pragma mark - TWTRPlayerCardEntity

@interface TWTRPlayerCardEntity ()

@property (nonatomic, copy) NSDictionary<NSString *, id> *validatedDictionary;

@end

@implementation TWTRPlayerCardEntity

+ (BOOL)canInitWithJSONDictionary:(NSDictionary<NSString *, id> *)JSONDictionary
{
    NSString *name = [TWTRDictUtil twtr_stringForKey:TWTRPlayerCardNameKey inDict:JSONDictionary];
    return [name isEqualToString:TWTRPlayerCardPlayerTypeName];
}

- (nullable instancetype)initWithJSONDictionary:(NSDictionary *)dictionary
{
    NSDictionary<NSString *, id> *validatedDictionary = [[self class] validateJSONDictionary:dictionary];
    if (validatedDictionary == nil) {
        return nil;
    }

    return [self initWithValidatedDictionary:validatedDictionary];
}

- (instancetype)initWithValidatedDictionary:(NSDictionary<NSString *, id> *)validatedDictionary
{
    self = [super initWithURLString:validatedDictionary[TWTRPlayerCardURLKey]];

    if (self) {
        _validatedDictionary = [validatedDictionary copy];
        [self setPropertiesFromValidatedDictionary:validatedDictionary];
    }

    return self;
}

#pragma mark - Init Helpers

- (void)setPropertiesFromValidatedDictionary:(NSDictionary *)dict
{
    _bindingValues = dict[TWTRPlayerCardBindingValuesKey];

    // The card schema doesn't have a good way of defining what type of player card
    // this is. We are copying what bluebird is doing by looking at the user id of
    // the owning application. The card schema will be changing shortly to give a better
    // indication of the type of card, when that is released we will update this logic.
    if ([self.bindingValues.IDString isEqualToString:TWTRVineUserIDString]) {
        _playerCardType = TWTRPlayerCardTypeVine;
    } else {
        _playerCardType = TWTRPlayerCardTypeUnknown;
    }
}

- (instancetype)initWithCoder:(NSCoder *)decoder
{
    NSDictionary *validatedDictionary = [decoder decodeObjectOfClass:[NSDictionary class] forKey:TWTRValidatedDictionaryEncoderKey];

    if (validatedDictionary) {
        return [self initWithValidatedDictionary:validatedDictionary];
    } else {
        return nil;
    }
}

- (void)encodeWithCoder:(NSCoder *)encoder
{
    [encoder encodeObject:self.validatedDictionary forKey:TWTRValidatedDictionaryEncoderKey];
}

- (id)copyWithZone:(NSZone *)zone
{
    return self;
}

- (NSUInteger)hash
{
    return [self.validatedDictionary hash];
}

- (BOOL)isEqual:(id)object
{
    if ([object isKindOfClass:[TWTRPlayerCardEntity class]]) {
        return [self isEqualToPlayerCardEntity:object];
    } else {
        return NO;
    }
}

- (BOOL)isEqualToPlayerCardEntity:(TWTRPlayerCardEntity *)other
{
    return [self.validatedDictionary isEqualToDictionary:other.validatedDictionary];
}

#pragma mark - JSON Validation
+ (TWTRJSONValidator *)JSONValidator
{
    static TWTRJSONValidator *validator = nil;
    static dispatch_once_t onceToken;

    dispatch_once(&onceToken, ^{
        NSDictionary *transformers = @{
            TWTRPlayerCardBindingValuesKey: [TWTRJSONConvertibleTransformer transformerWithTargetClass:[TWTRPlayerCardEntityBindingValues class]],
        };

        NSDictionary *outputValues = @{TWTRPlayerCardURLKey: [TWTRJSONKeyRequirement requiredKeyOfClass:[NSString class]], TWTRPlayerCardBindingValuesKey: [TWTRJSONKeyRequirement requiredKeyOfClass:[TWTRPlayerCardEntityBindingValues class]]};

        validator = [[TWTRJSONValidator alloc] initWithValueTransformers:transformers outputValues:outputValues];
    });

    return validator;
}

+ (NSDictionary<NSString *, id> *)validateJSONDictionary:(NSDictionary<NSString *, id> *)JSON
{
    return [[self JSONValidator] validatedDictionaryFromJSON:JSON];
}

@end


text:
package prompt

import (
	"context"
	"errors"
	"sync"
)

type FakeReplyFunc func(context.Context) (string, error)

type FakeReader struct {
	mu      sync.Mutex
	replies []FakeReplyFunc
}

// NewFakeReader returns a fake that can be used in place of a ContextReader.
// Call Add functions in the desired order to configure responses. Each call
// represents a read reply, in order.
func NewFakeReader() *FakeReader {
	return &FakeReader{}
}

func (r *FakeReader) AddReply(fn FakeReplyFunc) *FakeReader {
	r.mu.Lock()
	defer r.mu.Unlock()
	r.replies = append(r.replies, fn)
	return r
}

func (r *FakeReader) AddString(s string) *FakeReader {
	return r.AddReply(func(context.Context) (string, error) {
		return s, nil
	})
}

func (r *FakeReader) AddError(err error) *FakeReader {
	return r.AddReply(func(context.Context) (string, error) {
		return "", err
	})
}

func (r *FakeReader) ReadContext(ctx context.Context) ([]byte, error) {
	r.mu.Lock()
	if len(r.replies) == 0 {
		r.mu.Unlock()
		return nil, errors.New("no fake replies available")
	}

	// Pop first reply.
	fn := r.replies[0]
	r.replies = r.replies[1:]
	r.mu.Unlock()

	val, err := fn(ctx)
	return []byte(val), err
}

func (r *FakeReader) ReadPassword(ctx context.Context) ([]byte, error) {
	return r.ReadContext(ctx)
}


text:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      tools:context="com.aarnam.softwares.spotifystreamer.android.player.MusicPlayer">
    <item android:id="@+id/action_settings"
          android:title="@string/action_settings"
          android:orderInCategory="100"
          app:showAsAction="never"/>
</menu>


text:
package logging

import "testing"

func TestMultiLogger(t *testing.T) {
	log1 := NewMemoryBackend(8)
	log2 := NewMemoryBackend(8)
	SetBackend(MultiLogger(log1, log2))

	log := MustGetLogger("test")
	log.Debugf("log")

	if "log" != MemoryRecordN(log1, 0).Formatted(0) {
		t.Errorf("log1: %v", MemoryRecordN(log1, 0).Formatted(0))
	}
	if "log" != MemoryRecordN(log2, 0).Formatted(0) {
		t.Errorf("log2: %v", MemoryRecordN(log2, 0).Formatted(0))
	}
}

func TestMultiLoggerLevel(t *testing.T) {
	log1 := NewMemoryBackend(8)
	log2 := NewMemoryBackend(8)

	leveled1 := AddModuleLevel(log1)
	leveled2 := AddModuleLevel(log2)

	multi := MultiLogger(leveled1, leveled2)
	multi.SetLevel(ERROR, "test")
	SetBackend(multi)

	log := MustGetLogger("test")
	log.Noticef("log")

	if nil != MemoryRecordN(log1, 0) || nil != MemoryRecordN(log2, 0) {
		t.Errorf("unexpected log record")
	}

	leveled1.SetLevel(DEBUG, "test")
	log.Noticef("log")
	if "log" != MemoryRecordN(log1, 0).Formatted(0) {
		t.Errorf("log1 not received")
	}
	if nil != MemoryRecordN(log2, 0) {
		t.Errorf("log2 received")
	}
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<getMetricsResponse xmlns:ns2="http://www.ebayopensource.org/turmeric/monitoring/v1/services" xmlns:ns3="http://www.ebayopensource.org/turmeric/common/v1/types">

   <ns2:returnData>
               <ns2:criteriaInfo>
                  <ns2:consumerName>ShippingEngineServiceClient</ns2:consumerName>
               </ns2:criteriaInfo>
               <ns2:diff>-1.3</ns2:diff>
               <ns2:count2>1.4401125E7</ns2:count2>
               <ns2:count1>1.421355E7</ns2:count1>
            </ns2:returnData>

</getMetricsResponse>


text:
using System.Text.Json;
using Azure.Core;

namespace Azure.ResourceManager.DevTestLabs.Models
{
    public partial class DevTestLabArmTemplateParameter : IUtf8JsonSerializable
    {
        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
        {
            writer.WriteStartObject();
            if (Optional.IsDefined(Name))
            {
                writer.WritePropertyName("name");
                writer.WriteStringValue(Name);
            }
            if (Optional.IsDefined(Value))
            {
                writer.WritePropertyName("value");
                writer.WriteStringValue(Value);
            }
            writer.WriteEndObject();
        }

        internal static DevTestLabArmTemplateParameter DeserializeDevTestLabArmTemplateParameter(JsonElement element)
        {
            Optional<string> name = default;
            Optional<string> value = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("value"))
                {
                    value = property.Value.GetString();
                    continue;
                }
            }
            return new DevTestLabArmTemplateParameter(name.Value, value.Value);
        }
    }
}