text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="description" content="">
	<meta name="author" content="">

	<title>Starter Template for Bootstrap</title>

	<link href="css/bootstrap.css" rel="stylesheet">

	<link href="css/simple-sidebar.css" rel="stylesheet">
	<link href="css/view-place-pictures.css" rel="stylesheet">
	<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet">

Start Bootstrap

Dashboard

Shortcuts

Overview

Events

About

Services

Contact

					Praça do corguin

						<input type="button" class="btn btn-gray col-md-1" value="<">

						<input type="button" class="btn btn-info  col-md-2 col-sm-6 col-xs-6" value="Fotos">

						<input type="button" class="btn btn-info col-md-2 col-sm-6 col-xs-6" value="Videos">


text:
PROG=RabbitAsyncEventListener.jar
JC = javac
IP = 172.16.81.133
PWD = $(shell pwd)
JAVAC_OPTS = -Xlint:deprecation

all: jar/$(PROG)

jar/$(PROG): build/$(PROG:%.jar=%.class)
	cd $(PWD)/build; \
	jar cvfe $(PWD)/jar/RabbitAsyncEventListener.jar $(PROG:%.jar=%) sqlfire/callbacks/*.class

build/$(PROG:%.jar=%.class):
	cd $(PWD)/src/main/java; \
	javac $(JAVAC_OPTS) sqlfire/callbacks/RabbitAsyncEventListener.java -d $(PWD)/build/

install:
	test -f jar/$(PROG)
	sqlf run -client-bind-address=$(IP) -file=sql/install.sql

uninstall:
	sqlf run -client-bind-address=$(IP) -file=sql/uninstall.sql

clean: uninstall
	rm -rf jar/*
	rm -rf build/*

redpajama_set_name: RedPajamaGithub


text:
namespace NLog.Internal
{
    /// <summary>
    /// Controls a single allocated char[]-buffer for reuse (only one active user)
    /// </summary>
    internal class ReusableBufferCreator : ReusableObjectCreator<char[]>
    {
        public ReusableBufferCreator(int capacity)
            :base(capacity, cap => new char[cap], (b) => { })
        {
        }
    }
}


text:
package fr.opensagres.xdocreport.webapp;

import java.io.IOException;
import java.util.Calendar;
import java.util.List;

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

import fr.opensagres.xdocreport.converter.MimeMapping;
import fr.opensagres.xdocreport.core.XDocReportException;
import fr.opensagres.xdocreport.core.io.IOUtils;
import fr.opensagres.xdocreport.core.utils.StringUtils;
import fr.opensagres.xdocreport.document.IXDocReport;
import fr.opensagres.xdocreport.document.registry.XDocReportRegistry;
import fr.opensagres.xdocreport.document.web.UploadXDocReportServlet;
import fr.opensagres.xdocreport.template.ITemplateEngine;
import fr.opensagres.xdocreport.webapp.datamodel.MetaDataModel;
import fr.opensagres.xdocreport.webapp.datamodel.MetaDataModelField;
import fr.opensagres.xdocreport.webapp.defaultreport.DefaultReportController;
import fr.opensagres.xdocreport.webapp.defaultreport.DefaultReportRegistry;

public class LoadXDocReportServlet
    extends UploadXDocReportServlet
    implements WebAppXDocReportConstants
{

    private static final long serialVersionUID = 9102651291455406387L;

    private static final String LOAD_DISPATCH = "load";

    private static final String SAVE_DISPATCH = "save";

    private static final String DOWNLOAD_DISPATCH = "download";

    @Override
    protected void processRequest( HttpServletRequest request, HttpServletResponse response )
        throws ServletException, IOException
    {
        String dispatch = getDispatchParameter( request );
        if ( LOAD_DISPATCH.equals( dispatch ) )
        {
            doLoad( request, response );
        }
        else if ( SAVE_DISPATCH.equals( dispatch ) )
        {
            doSave( request, response );
        }
        else if ( DOWNLOAD_DISPATCH.equals( dispatch ) )
        {
            doDownload( request, response );
        }
        else
        {
            // Clear registry from HTTP session
            super.clearRegistryFromHTTPSession( request );
            // Upload
            super.processRequest( request, response );
        }
    }

    private void doLoad( HttpServletRequest request, HttpServletResponse response )
        throws ServletException, IOException
    {
        ITemplateEngine templateEngine = null;
        String reportId = getReportId( request );
        IXDocReport report = getRegistryFromHTTPSession( request ).getReport( reportId );
        if ( report != null )
        {
            templateEngine = getTemplateEngine( report, request );
            if ( templateEngine != null )
            {
                MetaDataModel extractor = new MetaDataModel();
                try
                {
                    report.setCacheOriginalDocument( true );
                    report.setTemplateEngine( templateEngine );
                    report.preprocess();
                    report.extractFields( extractor );
                    report.setData( DATA_MODEL_REPORT_KEY, extractor );
                }
                catch ( XDocReportException e )
                {
                    throw new ServletException( e );
                }
            }
        }
        super.doForward( report, request, response );
    }

    private void doSave( HttpServletRequest request, HttpServletResponse response )
        throws IOException, ServletException
    {
        ITemplateEngine templateEngine = null;
        String reportId = getReportId( request );
        IXDocReport report = getRegistryFromHTTPSession( request ).getReport( reportId );
        boolean reportTmp = report != null;
        if ( report == null )
        {
            report = getRegistry( request ).getReport( reportId );
        }
        if ( report != null )
        {
            templateEngine = getTemplateEngine( report, request );
            if ( templateEngine != null )
            {
                report.setTemplateEngine( templateEngine );
                updateMetaDataModel( report, request );
                if ( reportTmp )
                {
                    // Clear registry from HTTP session
                    super.clearRegistryFromHTTPSession( request );
                    // Mark as saved report
                    report.setData( SAVED_REPORT_KEY, true );
                    report.setData( LOADED_REPORT_DATE_KEY, Calendar.getInstance().getTime() );
                    try
                    {
                        // Register the report in global registry
                        getRegistry( request ).registerReport( report );
                    }
                    catch ( XDocReportException e )
                    {
                        throw new ServletException( e );
                    }
                }
            }
        }
        super.doForward( report, request, response );
    }

    private void doDownload( HttpServletRequest request, HttpServletResponse response )
        throws IOException, ServletException
    {
        String reportId = getReportId( request );
        if ( StringUtils.isNotEmpty( reportId ) )
        {
            DefaultReportController defaultReport = DefaultReportRegistry.INSTANCE.getReportController( reportId );
            if ( defaultReport != null )
            {
                // Get mime mapping
                MimeMapping mimeMapping = null;
                try
                {
                    mimeMapping = XDocReportRegistry.getRegistry().getMimeMapping( defaultReport.getFileExtension() );
                }
                catch ( XDocReportException e )
                {
                }
                prepareHTTPResponse( reportId, mimeMapping, request, response );
                IOUtils.copy( defaultReport.getSourceStream(), response.getOutputStream() );
            }
        }
    }

    private void updateMetaDataModel( IXDocReport report, HttpServletRequest request )
    {
        MetaDataModel extractor = report.getData( DATA_MODEL_REPORT_KEY );
        if ( extractor != null )
        {
            List<MetaDataModelField> fields = extractor.getFields();
            for ( MetaDataModelField field : fields )
            {
                String name = field.getName();
                String defaultValue = request.getParameter( name );
                field.setDefaultValue( defaultValue );
            }
        }
    }

    @Override
    protected XDocReportRegistry getRegistryForUpload( HttpServletRequest request )
    {
        return super.getRegistryFromHTTPSession( request );
    }

    @Override
    protected void reportLoaded( IXDocReport report, HttpServletRequest request )
    {
        super.reportLoaded( report, request );
        report.setData( DEFAULT_REPORT_KEY, false );
        // Clone and store original XDocArchive because when template engine
        // change, preprocessing must be redone.
        // report.setData(LOADED_REPORT_DATE_KEY,
        // report.getDocumentArchive().createCopy());
    }
}


text:
#ifndef _VKDEVICEUTIL_HPP
#define _VKDEVICEUTIL_HPP
/*!
 * \file
 * \brief Instance and device initialization utilities.
 *//*--------------------------------------------------------------------*/

#include "vkDefs.hpp"
#include "vkRef.hpp"

#include <vector>
#include <string>

namespace tcu
{
class CommandLine;
}

namespace vk
{

Move<VkInstance>	createDefaultInstance	(const PlatformInterface&			vkPlatform,
											 deUint32							apiVersion);

Move<VkInstance>	createDefaultInstance	(const PlatformInterface&			vkPlatform,
											 deUint32							apiVersion,
											 const std::vector<std::string>&	enabledLayers,
											 const std::vector<std::string>&	enabledExtensions,
											 const VkAllocationCallbacks*		pAllocator	= DE_NULL);

Move<VkInstance>	createInstanceWithExtensions (const PlatformInterface&			vkp,
												  const deUint32					version,
												  const std::vector<std::string>	requiredExtensions);

Move<VkInstance>	createInstanceWithExtension (const PlatformInterface&	vkp,
												 const deUint32				version,
												 const std::string			requiredExtension);

deUint32			chooseDeviceIndex		(const InstanceInterface&			vkInstance,
											 const VkInstance					instance,
											 const tcu::CommandLine&			cmdLine);

VkPhysicalDevice	chooseDevice			(const InstanceInterface&			vkInstance,
											 const VkInstance					instance,
											 const tcu::CommandLine&			cmdLine);

} // vk

#endif // _VKDEVICEUTIL_HPP


text:
package com.google.cloud.asset.v1.stub;

import static com.google.cloud.asset.v1.AssetServiceClient.ListAssetsPagedResponse;
import static com.google.cloud.asset.v1.AssetServiceClient.ListSavedQueriesPagedResponse;
import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllIamPoliciesPagedResponse;
import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllResourcesPagedResponse;

import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata;
import com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest;
import com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse;
import com.google.cloud.asset.v1.AnalyzeIamPolicyRequest;
import com.google.cloud.asset.v1.AnalyzeIamPolicyResponse;
import com.google.cloud.asset.v1.AnalyzeMoveRequest;
import com.google.cloud.asset.v1.AnalyzeMoveResponse;
import com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest;
import com.google.cloud.asset.v1.BatchGetAssetsHistoryResponse;
import com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest;
import com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse;
import com.google.cloud.asset.v1.CreateFeedRequest;
import com.google.cloud.asset.v1.CreateSavedQueryRequest;
import com.google.cloud.asset.v1.DeleteFeedRequest;
import com.google.cloud.asset.v1.DeleteSavedQueryRequest;
import com.google.cloud.asset.v1.ExportAssetsRequest;
import com.google.cloud.asset.v1.ExportAssetsResponse;
import com.google.cloud.asset.v1.Feed;
import com.google.cloud.asset.v1.GetFeedRequest;
import com.google.cloud.asset.v1.GetSavedQueryRequest;
import com.google.cloud.asset.v1.ListAssetsRequest;
import com.google.cloud.asset.v1.ListAssetsResponse;
import com.google.cloud.asset.v1.ListFeedsRequest;
import com.google.cloud.asset.v1.ListFeedsResponse;
import com.google.cloud.asset.v1.ListSavedQueriesRequest;
import com.google.cloud.asset.v1.ListSavedQueriesResponse;
import com.google.cloud.asset.v1.QueryAssetsRequest;
import com.google.cloud.asset.v1.QueryAssetsResponse;
import com.google.cloud.asset.v1.SavedQuery;
import com.google.cloud.asset.v1.SearchAllIamPoliciesRequest;
import com.google.cloud.asset.v1.SearchAllIamPoliciesResponse;
import com.google.cloud.asset.v1.SearchAllResourcesRequest;
import com.google.cloud.asset.v1.SearchAllResourcesResponse;
import com.google.cloud.asset.v1.UpdateFeedRequest;
import com.google.cloud.asset.v1.UpdateSavedQueryRequest;
import com.google.longrunning.Operation;
import com.google.longrunning.stub.OperationsStub;
import com.google.protobuf.Empty;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
 * Base stub class for the AssetService service API.
 *
 * <p>This class is for advanced usage and reflects the underlying API directly.
 */
@Generated("by gapic-generator-java")
public abstract class AssetServiceStub implements BackgroundResource {

  public OperationsStub getOperationsStub() {
    return null;
  }

  public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
    return null;
  }

  public OperationCallable<ExportAssetsRequest, ExportAssetsResponse, ExportAssetsRequest>
      exportAssetsOperationCallable() {
    throw new UnsupportedOperationException("Not implemented: exportAssetsOperationCallable()");
  }

  public UnaryCallable<ExportAssetsRequest, Operation> exportAssetsCallable() {
    throw new UnsupportedOperationException("Not implemented: exportAssetsCallable()");
  }

  public UnaryCallable<ListAssetsRequest, ListAssetsPagedResponse> listAssetsPagedCallable() {
    throw new UnsupportedOperationException("Not implemented: listAssetsPagedCallable()");
  }

  public UnaryCallable<ListAssetsRequest, ListAssetsResponse> listAssetsCallable() {
    throw new UnsupportedOperationException("Not implemented: listAssetsCallable()");
  }

  public UnaryCallable<BatchGetAssetsHistoryRequest, BatchGetAssetsHistoryResponse>
      batchGetAssetsHistoryCallable() {
    throw new UnsupportedOperationException("Not implemented: batchGetAssetsHistoryCallable()");
  }

  public UnaryCallable<CreateFeedRequest, Feed> createFeedCallable() {
    throw new UnsupportedOperationException("Not implemented: createFeedCallable()");
  }

  public UnaryCallable<GetFeedRequest, Feed> getFeedCallable() {
    throw new UnsupportedOperationException("Not implemented: getFeedCallable()");
  }

  public UnaryCallable<ListFeedsRequest, ListFeedsResponse> listFeedsCallable() {
    throw new UnsupportedOperationException("Not implemented: listFeedsCallable()");
  }

  public UnaryCallable<UpdateFeedRequest, Feed> updateFeedCallable() {
    throw new UnsupportedOperationException("Not implemented: updateFeedCallable()");
  }

  public UnaryCallable<DeleteFeedRequest, Empty> deleteFeedCallable() {
    throw new UnsupportedOperationException("Not implemented: deleteFeedCallable()");
  }

  public UnaryCallable<SearchAllResourcesRequest, SearchAllResourcesPagedResponse>
      searchAllResourcesPagedCallable() {
    throw new UnsupportedOperationException("Not implemented: searchAllResourcesPagedCallable()");
  }

  public UnaryCallable<SearchAllResourcesRequest, SearchAllResourcesResponse>
      searchAllResourcesCallable() {
    throw new UnsupportedOperationException("Not implemented: searchAllResourcesCallable()");
  }

  public UnaryCallable<SearchAllIamPoliciesRequest, SearchAllIamPoliciesPagedResponse>
      searchAllIamPoliciesPagedCallable() {
    throw new UnsupportedOperationException("Not implemented: searchAllIamPoliciesPagedCallable()");
  }

  public UnaryCallable<SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse>
      searchAllIamPoliciesCallable() {
    throw new UnsupportedOperationException("Not implemented: searchAllIamPoliciesCallable()");
  }

  public UnaryCallable<AnalyzeIamPolicyRequest, AnalyzeIamPolicyResponse>
      analyzeIamPolicyCallable() {
    throw new UnsupportedOperationException("Not implemented: analyzeIamPolicyCallable()");
  }

  public OperationCallable<
          AnalyzeIamPolicyLongrunningRequest,
          AnalyzeIamPolicyLongrunningResponse,
          AnalyzeIamPolicyLongrunningMetadata>
      analyzeIamPolicyLongrunningOperationCallable() {
    throw new UnsupportedOperationException(
        "Not implemented: analyzeIamPolicyLongrunningOperationCallable()");
  }

  public UnaryCallable<AnalyzeIamPolicyLongrunningRequest, Operation>
      analyzeIamPolicyLongrunningCallable() {
    throw new UnsupportedOperationException(
        "Not implemented: analyzeIamPolicyLongrunningCallable()");
  }

  public UnaryCallable<AnalyzeMoveRequest, AnalyzeMoveResponse> analyzeMoveCallable() {
    throw new UnsupportedOperationException("Not implemented: analyzeMoveCallable()");
  }

  public UnaryCallable<QueryAssetsRequest, QueryAssetsResponse> queryAssetsCallable() {
    throw new UnsupportedOperationException("Not implemented: queryAssetsCallable()");
  }

  public UnaryCallable<CreateSavedQueryRequest, SavedQuery> createSavedQueryCallable() {
    throw new UnsupportedOperationException("Not implemented: createSavedQueryCallable()");
  }

  public UnaryCallable<GetSavedQueryRequest, SavedQuery> getSavedQueryCallable() {
    throw new UnsupportedOperationException("Not implemented: getSavedQueryCallable()");
  }

  public UnaryCallable<ListSavedQueriesRequest, ListSavedQueriesPagedResponse>
      listSavedQueriesPagedCallable() {
    throw new UnsupportedOperationException("Not implemented: listSavedQueriesPagedCallable()");
  }

  public UnaryCallable<ListSavedQueriesRequest, ListSavedQueriesResponse>
      listSavedQueriesCallable() {
    throw new UnsupportedOperationException("Not implemented: listSavedQueriesCallable()");
  }

  public UnaryCallable<UpdateSavedQueryRequest, SavedQuery> updateSavedQueryCallable() {
    throw new UnsupportedOperationException("Not implemented: updateSavedQueryCallable()");
  }

  public UnaryCallable<DeleteSavedQueryRequest, Empty> deleteSavedQueryCallable() {
    throw new UnsupportedOperationException("Not implemented: deleteSavedQueryCallable()");
  }

  public UnaryCallable<BatchGetEffectiveIamPoliciesRequest, BatchGetEffectiveIamPoliciesResponse>
      batchGetEffectiveIamPoliciesCallable() {
    throw new UnsupportedOperationException(
        "Not implemented: batchGetEffectiveIamPoliciesCallable()");
  }

  @Override
  public abstract void close();
}


text:
package org.rioproject.impl.event;

import java.net.MalformedURLException;
import java.rmi.server.RMIClassLoader;
import java.rmi.server.RMIClassLoaderSpi;

/**
 *
 */
public class EventResolver extends RMIClassLoaderSpi {
    private static final RMIClassLoaderSpi loader = RMIClassLoader.getDefaultProviderInstance();

    public Class<?> loadClass(String s, String s1, ClassLoader classLoader) throws MalformedURLException, ClassNotFoundException {
        return loader.loadClass(s, s1, classLoader);
    }

    public Class<?> loadProxyClass(String s, String[] strings, ClassLoader classLoader) throws MalformedURLException, ClassNotFoundException {
        return loader.loadProxyClass(s, strings, classLoader);
    }

    public ClassLoader getClassLoader(String s) throws MalformedURLException {
        return loader.getClassLoader(s);
    }

    public String getClassAnnotation(Class<?> aClass) {
        return loader.getClassAnnotation(aClass);
    }
}


text:
extern "C"
{
#endif

// This logic was borrowed (then namespaced) from the examples on the gcc wiki:
//     https://gcc.gnu.org/wiki/Visibility

#if defined _WIN32 || defined __CYGWIN__
  #ifdef __GNUC__
    #define CV_BRIDGE_EXPORT __attribute__ ((dllexport))
    #define CV_BRIDGE_IMPORT __attribute__ ((dllimport))
  #else
    #define CV_BRIDGE_EXPORT __declspec(dllexport)
    #define CV_BRIDGE_IMPORT __declspec(dllimport)
  #endif
  #ifdef CV_BRIDGE_BUILDING_DLL
    #define CV_BRIDGE_PUBLIC CV_BRIDGE_EXPORT
  #else
    #define CV_BRIDGE_PUBLIC CV_BRIDGE_IMPORT
  #endif
  #define CV_BRIDGE_PUBLIC_TYPE CV_BRIDGE_PUBLIC
  #define CV_BRIDGE_LOCAL
#else
  #define CV_BRIDGE_EXPORT __attribute__ ((visibility("default")))
  #define CV_BRIDGE_IMPORT
  #if __GNUC__ >= 4
    #define CV_BRIDGE_PUBLIC __attribute__ ((visibility("default")))
    #define CV_BRIDGE_LOCAL  __attribute__ ((visibility("hidden")))
  #else
    #define CV_BRIDGE_PUBLIC
    #define CV_BRIDGE_LOCAL
  #endif
  #define CV_BRIDGE_PUBLIC_TYPE
#endif

#ifdef __cplusplus
}
#endif

#endif  // CV_BRIDGE__VISIBILITY_CONTROL_H_


text:
layout: page
title: Trevino Chemical Seminar
date: 2016-05-24
author: Bryan Bowman
tags: weekly links, java
status: published
summary: Sed tincidunt risus ligula, nec sollicitudin.
banner: images/banner/leisure-02.jpg
booking:
  startDate: 06/21/2019
  endDate: 06/24/2019
  ctyhocn: GATBGHX
  groupCode: TCS
published: true
---
Donec luctus metus in vulputate finibus. In euismod purus ac magna placerat congue. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam tempus malesuada nisi sit amet suscipit. Pellentesque aliquet nulla ac enim sodales aliquam. Nam vestibulum ipsum at lorem mattis interdum quis non leo. Praesent sed sapien dui. Mauris hendrerit nulla vitae pharetra tristique. In ante enim, convallis id metus vel, fringilla luctus dolor. Nam lacinia, elit imperdiet fermentum interdum, augue augue faucibus nisl, a vulputate libero tellus vitae magna.

* Maecenas ac arcu bibendum, eleifend massa id, tempus velit
* Vivamus aliquet dolor eu justo efficitur consectetur
* Suspendisse mattis enim ut sapien sagittis iaculis
* Ut rhoncus elit eu pharetra efficitur
* Aliquam in eros eu dui hendrerit ultricies.

Donec in mi nisl. Aliquam laoreet nisi urna, ac porttitor nunc ultricies at. Curabitur non pretium turpis. Mauris sollicitudin blandit velit, at condimentum enim interdum id. Quisque eget metus quis ipsum elementum efficitur. Donec consequat ut dolor sed suscipit. Donec sagittis pretium nisl nec iaculis. Phasellus id tincidunt enim. Integer finibus eleifend leo, eu viverra mauris venenatis ut. Nunc tempor tortor sit amet tempor scelerisque. Ut pharetra ut urna et convallis.
Etiam a mattis nibh, vitae consequat ipsum. Donec quis nibh eget diam eleifend fermentum eget in turpis. Praesent maximus elit eu tortor vestibulum accumsan. Cras et dignissim urna. Mauris turpis nisl, placerat sit amet pellentesque quis, hendrerit sodales velit. In id fermentum lorem, ut malesuada leo. Sed aliquet orci eget nibh posuere ultrices. Sed non urna placerat, placerat ligula et, blandit dui. Etiam sed ex at neque dignissim congue a et justo. Praesent ac maximus ante. Quisque eget egestas sapien. Donec tempor placerat tortor, condimentum lacinia augue ultricies ut. Pellentesque nec lorem porta, dictum justo bibendum, accumsan tortor. Praesent in condimentum urna.


text:
package com.amazonaws.services.simpleemail.model;

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *

 * Represents a request to return the notification attributes for a list of identities you verified with Amazon SES. For
 * information about Amazon SES notifications, see the Amazon SES Developer Guide.
 *

 *
 * @see AWS API Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetIdentityNotificationAttributesRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * A list of one or more identities. You can specify an identity by using its name or by using its Amazon Resource
     * Name (ARN). Examples: user@example.com, example.com,
     * arn:aws:ses:us-east-1:123456789012:identity/example.com.
     *

     */
    private com.amazonaws.internal.SdkInternalList<String> identities;

    /**
     *

     * A list of one or more identities. You can specify an identity by using its name or by using its Amazon Resource
     * Name (ARN). Examples: user@example.com, example.com,
     * arn:aws:ses:us-east-1:123456789012:identity/example.com.
     *

     *
     * @return A list of one or more identities. You can specify an identity by using its name or by using its Amazon
     *         Resource Name (ARN). Examples: user@example.com, example.com,
     *         arn:aws:ses:us-east-1:123456789012:identity/example.com.
     */

    public java.util.List<String> getIdentities() {
        if (identities == null) {
            identities = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return identities;
    }

    /**
     *

     * A list of one or more identities. You can specify an identity by using its name or by using its Amazon Resource
     * Name (ARN). Examples: user@example.com, example.com,
     * arn:aws:ses:us-east-1:123456789012:identity/example.com.
     *

     *
     * @param identities
     *        A list of one or more identities. You can specify an identity by using its name or by using its Amazon
     *        Resource Name (ARN). Examples: user@example.com, example.com,
     *        arn:aws:ses:us-east-1:123456789012:identity/example.com.
     */

    public void setIdentities(java.util.Collection<String> identities) {
        if (identities == null) {
            this.identities = null;
            return;
        }

        this.identities = new com.amazonaws.internal.SdkInternalList<String>(identities);
    }

    /**
     *

     * A list of one or more identities. You can specify an identity by using its name or by using its Amazon Resource
     * Name (ARN). Examples: user@example.com, example.com,
     * arn:aws:ses:us-east-1:123456789012:identity/example.com.
     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setIdentities(java.util.Collection)} or {@link #withIdentities(java.util.Collection)} if you want to
     * override the existing values.
     *

     *
     * @param identities
     *        A list of one or more identities. You can specify an identity by using its name or by using its Amazon
     *        Resource Name (ARN). Examples: user@example.com, example.com,
     *        arn:aws:ses:us-east-1:123456789012:identity/example.com.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public GetIdentityNotificationAttributesRequest withIdentities(String... identities) {
        if (this.identities == null) {
            setIdentities(new com.amazonaws.internal.SdkInternalList<String>(identities.length));
        }
        for (String ele : identities) {
            this.identities.add(ele);
        }
        return this;
    }

    /**
     *

     * A list of one or more identities. You can specify an identity by using its name or by using its Amazon Resource
     * Name (ARN). Examples: user@example.com, example.com,
     * arn:aws:ses:us-east-1:123456789012:identity/example.com.
     *

     *
     * @param identities
     *        A list of one or more identities. You can specify an identity by using its name or by using its Amazon
     *        Resource Name (ARN). Examples: user@example.com, example.com,
     *        arn:aws:ses:us-east-1:123456789012:identity/example.com.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public GetIdentityNotificationAttributesRequest withIdentities(java.util.Collection<String> identities) {
        setIdentities(identities);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getIdentities() != null)
            sb.append("Identities: ").append(getIdentities());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof GetIdentityNotificationAttributesRequest == false)
            return false;
        GetIdentityNotificationAttributesRequest other = (GetIdentityNotificationAttributesRequest) obj;
        if (other.getIdentities() == null ^ this.getIdentities() == null)
            return false;
        if (other.getIdentities() != null && other.getIdentities().equals(this.getIdentities()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getIdentities() == null) ? 0 : getIdentities().hashCode());
        return hashCode;
    }

    @Override
    public GetIdentityNotificationAttributesRequest clone() {
        return (GetIdentityNotificationAttributesRequest) super.clone();
    }

}


text:
@interface MARObjCMethod : MARMethod
{
    Method _method;
}
@end

@implementation MARObjCMethod

- (id)initWithObjCMethod:(Method)method
{
    self = [super init];
    if (self) {
        _method = method;
    }
    return self;
}

- (SEL)selector
{
    return method_getName(_method);
}

- (IMP)implementation
{
    return method_getImplementation(_method);
}

- (NSString *)signature
{
    return [NSString stringWithUTF8String:method_getTypeEncoding(_method)];
}

- (void)setImplementation:(IMP)newImp
{
    method_setImplementation(_method, newImp);
}

@end

@interface MARComponentsMethod : MARMethod
{
    SEL _sel;
    IMP _imp;
    NSString *_signature;
}
@end

@implementation MARComponentsMethod

- (id)initWithSelector:(SEL)sel implementation:(IMP)imp signature:(NSString *)signature
{
    self = [super init];
    if (self) {
        _sel = sel;
        _imp = imp;
        _signature = signature;
    }
    return self;
}

- (SEL)selector
{
    return _sel;
}

- (IMP)implementation
{
    return _imp;
}

- (NSString *)signature
{
    return _signature;
}

- (void)setImplementation:(IMP)newImp
{
    _imp = newImp;
}

@end

@implementation MARMethod

+ (id)methodWithObjCMethod:(Method)method
{
    return [[self alloc] initWithObjCMethod:method];
}

+ (id)methodWithSelector:(SEL)sel implementation:(IMP)imp signature:(NSString *)signature
{
    return [[self alloc] initWithSelector:sel implementation:imp signature:signature];
}

- (id)initWithObjCMethod:(Method)method
{
    return [[MARObjCMethod alloc] initWithObjCMethod:method];
}

- (id)initWithSelector:(SEL)sel implementation:(IMP)imp signature:(NSString *)signature
{
    return [[MARComponentsMethod alloc] initWithSelector:sel implementation:imp signature:signature];
}

- (NSString *)description
{
    return [NSString stringWithFormat:@"<%@ %p: [sel:%@] [imp'p:%p] [sig:%@]>", [self class], self, NSStringFromSelector([self selector]), [self implementation], [self signature]];
}

- (BOOL)isEqual:(id)object
{
    return  [object isKindOfClass:[MARMethod class]] &&
            [self selector] == [object selector] &&
            [self implementation] == [object implementation] &&
            [[self signature] isEqual:[object signature]];
}

- (NSUInteger)hash
{
    return (NSUInteger)(void *)[self selector] ^ (NSUInteger)[self implementation] ^ [[self signature] hash];
}

- (SEL)selector
{
    [self doesNotRecognizeSelector: _cmd];
    return NULL;
}

- (NSString *)selectorName
{
    return NSStringFromSelector([self selector]);
}

- (IMP)implementation
{
    [self doesNotRecognizeSelector: _cmd];
    return NULL;
}

- (NSString *)signature
{
    [self doesNotRecognizeSelector: _cmd];
    return NULL;
}

- (void)setImplementation: (IMP)newImp
{
    [self doesNotRecognizeSelector: _cmd];
}

- (id)sendToTarget:(id)target, ...
{
    id retVal = nil;

    va_list args;
    va_start(args, target);
    [self p_returnValue:&retVal sendToArget:target arguments:args];
    va_end(args);

    return retVal;
}

- (void)p_returnValue:(void *)retPtr sendToArget:(id)target arguments:(va_list)args
{
    NSMethodSignature *signature = [target methodSignatureForSelector:[self selector]];
    NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
    NSUInteger argumentCount = [signature numberOfArguments];

    [invocation setTarget:target];
    [invocation setSelector:[self selector]];

    for (NSUInteger i = 2; i < argumentCount; i++) {
        int magicNumber = va_arg(args, int);
        if (magicNumber != MAR_ARG_MAGIC_NUMBER) {
            NSLog(@"%s: incorrect magic number %08x; did you forget to use MARRTARG() around your arguments?", __func__, magicNumber);
            abort();
        }
        const char *argTypeStr = va_arg(args, char *);
        void *argPtr = va_arg(args, void *);

        NSUInteger argTypeSize;
        NSGetSizeAndAlignment(argTypeStr, &argTypeSize, NULL);
        NSUInteger sigTypeSize;
        NSGetSizeAndAlignment([signature getArgumentTypeAtIndex:i], &sigTypeSize, NULL);

        if (argTypeSize != sigTypeSize) {
            NSLog(@"%s: size mismatch between passed-in argument and required argument; in type: %s (%lu) requested: %s (%lu)", __func__, argTypeStr, (long)argTypeSize, [signature getArgumentTypeAtIndex:i], (long)sigTypeSize);
            abort();
        }

        [invocation setArgument:argPtr atIndex:i];
    }

    [invocation invoke];
    if ([signature methodReturnLength] && retPtr) {
        [invocation getReturnValue:retPtr];
    }
}

@end


text:
class LogsController < ApplicationController
  before_action :set_log, only: [:show, :edit, :update, :destroy]

# Right now, don't manage logs from the logs controller (web)
# Logs are only managed through the API. And viewed from the
# teams#show controller, where access is authorized.

  has_scope :from_team
  has_scope :from_regatta
  has_scope :updated_after
  has_scope :has_type
  has_scope :not_client
  has_scope :not_team

  def index
    @logs = apply_scopes(Log).all.order(team_id: :asc, time: :asc)

#    if params[:team_id].present?
#      @logs = Log.where("team_id = ?", params[:team_id]).order(time: :asc)
#    else
#      @logs = Log.all.order(team_id: :asc, time: :asc)
#    end
  end

  # GET /logs/1
  # GET /logs/1.json
  def show
  end

  # GET /logs/new
  def new
    @log = Log.new
  end

  # GET /logs/1/edit
  def edit
  end

  # POST /logs
  # POST /logs.json
  def create
    @log = Log.new(log_params)

    respond_to do |format|
      if @log.save
        format.html { redirect_to @log, notice: 'Loggen har lagts till.' }
        format.json { render :show, status: :created, location: @log }
      else
        format.html { render :new }
        format.json { render json: @log.errors, status: :unprocessable_entity }
      end
    end
  end

  # PATCH/PUT /logs/1
  # PATCH/PUT /logs/1.json
  def update
    respond_to do |format|
      if @log.update(log_params)
        format.html { redirect_to @log,
                      notice: 'Uppgifterna om loggen är uppdaterade.' }
        format.json { render :show, status: :ok, location: @log }
      else
        format.html { render :edit }
        format.json { render json: @log.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /logs/1
  # DELETE /logs/1.json
  def destroy
    @log.destroy
    respond_to do |format|
      format.html { redirect_to logs_url, notice: 'Loggen raderad.' }
      format.json { head :no_content }
    end
  end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_log
      @log = Log.find(params[:id])
    end

    # Never trust parameters from the scary internet, only allow the white list through.
    def log_params
      params.require(:log).permit(:team_id, :time, :user_id, :client, :log_type, :point, :data, :deleted, :gen)
    end

end


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>TestBufferedDataBlockEncoder xref</title>
<link type="text/css" rel="stylesheet" href="../../../../../../stylesheet.css" />

View Javadoc

1
17  package org.apache.hadoop.hbase.io.encoding;
18
19  import static org.junit.Assert.assertEquals;
20
21  import org.apache.hadoop.hbase.MediumTests;
22  import org.junit.Test;
23  import org.junit.experimental.categories.Category;
24
25  @Category(MediumTests.class)
26  public class TestBufferedDataBlockEncoder {
27
28    @Test
29    public void testEnsureSpaceForKey() {
30      BufferedDataBlockEncoder.SeekerState state =
31          new BufferedDataBlockEncoder.SeekerState();
32      for (int i = 1; i <= 65536; ++i) {
33        state.keyLength = i;
34        state.ensureSpaceForKey();
35        state.keyBuffer[state.keyLength - 1] = (byte) ((i - 1) % 0xff);
36        for (int j = 0; j < i - 1; ++j) {
37          // Check that earlier bytes were preserved as the buffer grew.
38          assertEquals((byte) (j % 0xff), state.keyBuffer[j]);
39        }
40      }
41    }
42
43  }

This page was automatically generated by Maven


text:
import riot from 'riot';
import template from './template';
import dispatcher from '../../utils/dispatcher';

import store from './store';
import EVENTS from './events';

export default riot.tag('list-item', template, (opts) => {
  this.on('mount', () => {});
  this.on('update', () => {});

  this.data = opts.data;

  dispatcher.on(EVENTS.EXAMPLE_STORE_UPDATED, () => {
    this.data = store.data;
  });
});


text:
post_title: CLI
nav_title: CLI
menu_order: 050
---

You can use the DC/OS command-line interface (CLI) to manage cluster nodes, install and manage packages, inspect the cluster state, and manage services and tasks.

DC/OS 1.10.0 requires the DC/OS CLI 0.5.x.

After you [install](/docs/1.11/cli/install) DC/OS CLI, to list available commands, either run `dcos` with no parameters or run `dcos help`:

```bash
Command line utility for the Mesosphere Datacenter Operating
System (DC/OS). The Mesosphere DC/OS is a distributed operating
system built around Apache Mesos. This utility provides tools
for easy management of a DC/OS installation.

Available DC/OS commands:

	auth           	Authenticate to DC/OS cluster
	cluster        	Manage connections to DC/OS clusters
	config         	Manage the DC/OS configuration file
	experimental   	Experimental commands. These commands are under development and are subject to change
	help           	Display help information about DC/OS
	job            	Deploy and manage jobs in DC/OS
	marathon       	Deploy and manage applications to DC/OS
	node           	Administer and manage DC/OS cluster nodes
	package        	Install and manage DC/OS software packages
	service        	Manage DC/OS services
	task           	Manage DC/OS tasks

Get detailed command description with `dcos <command> --help`.
```

# Displaying the DC/OS CLI version

To display the DC/OS CLI version, run:

`dcos --version`

# DC/OS CLI versions and configuration files

DC/OS CLI 0.4.x and 0.5.x use a different structure for the location of configuration files.

DC/OS CLI 0.4.x has a single configuration file, which by default is stored in `~/.dcos/dcos.toml`. In DC/OS CLI 0.4.x you can optionally change the location of the configuration file using the [`DCOS_CONFIG`](#dcos_config) environment variable.

DC/OS CLI 0.5.x has a configuration file for each connected cluster, which by default are stored in `~/.dcos/clusters/<cluster_id>/dcos.toml`. In DC/OS CLI 0.5.x you can optionally change the base portion (`~/.dcos`) of the configuration directory using the [`DCOS_DIR`](#dcos_dir) environment variable.

**Note:**
- Updating to the DC/OS CLI 0.5.x and running any CLI command triggers conversion from the old to the new configuration structure.
- After you call `dcos cluster setup`, (or after conversion has occurred), if you attempt to update the cluster configuration using a `dcos config set` command, the command prints a warning message saying the command is deprecated and cluster configuration state may now be corrupted.

# Environment variables

The DC/OS CLI supports the following environment variables, which can be set dynamically.

#### `DCOS_CLUSTER` (DC/OS CLI O.5.x only)

The [attached](/docs/1.11/cli/command-reference/dcos-cluster/dcos-cluster-attach/) cluster. To set the attached cluster, set the variable with the command:

```bash
export DCOS_CLUSTER=<cluster_name>
```

#### `DCOS_CONFIG` (DC/OS CLI O.4.x only)

The path to a DC/OS configuration file. If you put the DC/OS configuration file in `/home/jdoe/config/dcos.toml`, set the variable with the command:

```bash
export DCOS_CONFIG=/home/jdoe/config/dcos.toml
```

If you have the `DCOS_CONFIG` environment variable configured:

 - After conversion to the [new configuration structure](#dcos-cli-version-and-configuration), `DCOS_CONFIG` is no longer honored.
 - Before you call `dcos cluster setup`, you can change the configuration pointed to by `DCOS_CONFIG` using `dcos config set`. This command prints a warning message saying the command is deprecated and recommends using `dcos cluster setup`.

#### `DCOS_DIR` (DC/OS CLI O.5.x only)

The path to a DC/OS configuration directory. If you want the DC/OS configuration directory to be `/home/jdoe/config`, set the variable with the command:

```bash
export DCOS_DIR=/home/jdoe/config
```

1. Optionally set `DCOS_DIR` and run `dcos cluster setup` command.

    ```
    export DCOS_DIR=<path/to/config_dir> (optional, default when not set is ~/.dcos)
    dcos cluster setup <url>
    ```

   This setting generates and updates per cluster configuration under `$DCOS_DIR/clusters/<cluster_id>`. Sets newly set up cluster as the attached one.

#### `DCOS_SSL_VERIFY`
Indicates whether to verify SSL certificates or set the path to the SSL certificates. You must set this variable manually. Setting this environment variable is equivalent to setting the `dcos config set core.ssl_verify` option in the DC/OS configuration [file](#configuration-files). For example, to indicate that you want to set the path to SSL certificates:

```bash
export DCOS_SSL_VERIFY=false
```

#### `DCOS_LOG_LEVEL`
Prints log messages to stderr at or above the level indicated. This is equivalent to the `--log-level` command-line option. The severity levels are:

*   **debug** Prints all messages to stderr, including informational, warning, error, and critical.
*   **info** Prints informational, warning, error, and critical messages to stderr.
*   **warning** Prints warning, error, and critical messages to stderr.
*   **error** Prints error and critical messages to stderr.
*   **critical** Prints only critical messages to stderr.

For example, to set the log level to warning:

```bash
export DCOS_LOG_LEVEL=warning
```

#### `DCOS_DEBUG`
Indicates whether to print additional debug messages to `stdout`. By default this is set to `false`. For example:

```bash
export DCOS_DEBUG=true
```


text:
export default function addOptionsToScale(scale, domain, range, hash) {
  scale.domain(domain || []);

  // Add the range
  if ('round' in hash && hash.round) {
    scale.rangeRound(range || []);
  } else {
    scale.range(range || []);
  }

  // Add Clamping
  if ('clamp' in hash) {
    scale.clamp(!!hash.clamp);
  }

  // Add niceness
  if ('nice' in hash) {
    scale.nice(hash.nice);
  }

  return scale;
}


text:
TitaniumAnalytics Module

A full implementation of the Google Analytics SDK. As of this writing the SDK is at v2.0b4 and is not compatible with the legacy application analytics profiles. This implementation supports multiple trackers at the same time so long as all trackers adhere to Google Analytics quotas and limitations on aggregate tracking.

Usage

var Analytics = require("com.animecyc.analytics"),
    tracker = Analytics.getTracker('UA-XXXXXXX-X');

Analytics.setDebug(true);
tracker.trackScreen('Home');

Module Reference

Analytics.getTracker(uaCode);

Get an instance of a tracker and creates it if it does not exist. Calling getTracker on the same UA code will return a reference to the tracker.

uaCode (String):

The tracker identifier from a compatible google analytics profile.

Analytics.getDefaultTracker();

Get the default (if not set the first) tracker reference.

This method takes no paramters.

Analytics.createTransaction(transactionId, transactionOptions);

Create a transaction (ECommerce) to be sent via a tracker.

transactionId (String):

A unique string identifiing the transaction.

transactionOptions (Object):

An object containing the following:

affiliation (String)

tax (Float)

shipping (Float)

revenue (Float)

Analytics.setDebug(debug);

Set the debug flag, will result in messages being logged to the console. Ensure you don't leave this enabled for production.

debug (Boolean):

Debug status flag

Analytics.setDispatchInterval(dispatchInterval);

Set the dispatch interval; All hits are queued and will be sent on an interval firing on the interval set by this method. By default queues are dispatched every 120 seconds.

dispatchInterval (Float):

Interval at which hits are dispatched automatically.

Analytics.setTrackUncaughtExceptions(trackUncaught);

Track exceptions not caught from the application. Exceptions caught by means of this flag being set to true are always reported as fatal.

trackUncaught (Boolean):

Boolean flag to catch uncaught exceptions.

Analytics.setOptOut(optOut);

If set to true, all trackers will cease to dispatch anything tracked.

optOut (Boolean):

Boolean flag to globally opt-out of all analytics tracking.

Tracker Reference

Tracker.trackScreen(screenName);

Track an individual screen, optionally send a screen name with the hit.

screenName (String):

String containing the name of the screen being hit.

Tracker.trackEvent(eventOptions);

eventOptions (Object):

An object containing the following:

category (String)

action (String)

label (String)

value (Float)

Tracker.trackException(exceptionOptions);

exceptionOptions (Object):

An object containing the following:

fatal (Boolean)

description (String)

Tracker.trackSocial(socialOptions);

socialOptions (Object):

An object containing the following:

social (String)

action (String)

target (String)

Tracker.trackTime(timingOptions);

timingOptions (Object):

An object containing the following:

category (String)

interval (Integer)

name (String)

label (String)

Tracker.setAnonymize(anonymize);

anonymize (Boolean):

If set to true the tracker will anonymize the users session. Typically this will scramble the last octets of a users IP address.

Tracker.setUseHttps(useHttps);

useHttps (Boolean):

If set to true hits will be sent over the HTTPS protocol. This defaults to true.

Tracker.setSampleRate(sampleRate);

sampleRate (Float):

This will limit the number of hits sent to Google Analytics. It can range from 0 to 100. This is useful if your application has a large number of users.

Tracker.setSessionTimeout(sessionTimeout);

sessionTimeout (Integer):

An integer used to set the length of time a session will persist.

Tracker.setCampaignUrl(campaignUrl);

campaignUrl (String):

A string containing the URL used in analytics campaigns.

Tracker.setReferrerUrl(referrerUrl);

referrerUrl (String):

A string containing the URL used as a referrer, typically used in a campaign to track where people are coming from.

Transaction Reference

setTax(tax)

tax (Float):

The tax-rate for the transaction.

setShipping(shipping)

shipping (Float):

The amount of shipping for the transaction.

setRevenue(revenue)

revenue (Float):

The total revenue for the transaction. This must be updated manually as adding items will not automatically increment this value.

addItem(itemOptions)

itemOptions (Object):

An object containing the following:

sku (String)

name (String)

category (String)

price (Float)

quantity (Integer)


text:
<?php

namespace himiklab\yii2\recaptcha;

use Yii;
use yii\base\Exception;
use yii\base\InvalidConfigException;
use yii\helpers\Json;
use yii\validators\Validator;

/**
 * ReCaptcha widget validator.
 *
 * @author HimikLab
 * @package himiklab\yii2\recaptcha
 */
class ReCaptchaValidator extends Validator
{
    const GRABBER_PHP = 1; // file_get_contents
    const GRABBER_CURL = 2; // CURL, because sometimes file_get_contents is deprecated

    const SITE_VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify';
    const CAPTCHA_RESPONSE_FIELD = 'g-recaptcha-response';

    /** @var boolean Whether to skip this validator if the input is empty. */
    public $skipOnEmpty = false;

    /** @var string The shared key between your site and ReCAPTCHA. */
    public $secret;

    /**
     * @var int Choose your grabber for getting JSON,
     * self::GRABBER_PHP = file_get_contents, self::GRABBER_CURL = CURL
     */
    public $grabberType = self::GRABBER_PHP;

    /** @var string */
    public $uncheckedMessage;

    public function init()
    {
        parent::init();
        if (empty($this->secret)) {
            /** @var ReCaptcha $reCaptcha */
            $reCaptcha = Yii::$app->reCaptcha;
            if (!empty($reCaptcha->secret)) {
                $this->secret = $reCaptcha->secret;
            } else {
                throw new InvalidConfigException('Required `secret` param isn\'t set.');
            }
        }

        if ($this->message === null) {
            $this->message = Yii::t('yii', 'The verification code is incorrect.');
        }
    }

    /**
     * @param \yii\base\Model $model
     * @param string $attribute
     * @param \yii\web\View $view
     * @return string
     */
    public function clientValidateAttribute($model, $attribute, $view)
    {
        $message = $this->uncheckedMessage ?: Yii::t(
            'yii',
            '{attribute} cannot be blank.',
            ['attribute' => $model->getAttributeLabel($attribute)]
        );

        return "(function(messages){if(!grecaptcha.getResponse()){messages.push('{$message}');}})(messages);";
    }

    /**
     * @param string $value
     * @return array|null
     * @throws Exception
     * @throws \yii\base\InvalidParamException
     */
    protected function validateValue($value)
    {
        if (empty($value)) {
            if (!($value = Yii::$app->request->post(self::CAPTCHA_RESPONSE_FIELD))) {
                return [$this->message, []];
            }
        }

        $request = self::SITE_VERIFY_URL . '?' . http_build_query([
                'secret' => $this->secret,
                'response' => $value,
                'remoteip' => Yii::$app->request->userIP
            ]);
        $response = $this->getResponse($request);
        if (!isset($response['success'])) {
            throw new Exception('Invalid recaptcha verify response.');
        }
        return $response['success'] ? null : [$this->message, []];
    }

    /**
     * @param string $request
     * @return mixed
     * @throws Exception
     * @throws \yii\base\InvalidParamException
     */
    protected function getResponse($request)
    {
        if ($this->grabberType === self::GRABBER_PHP) {
            $response = @file_get_contents($request);

            if ($response === false) {
                throw new Exception('Unable connection to the captcha server.');
            }
        } else {
            $options = array(
                CURLOPT_CUSTOMREQUEST => 'GET',     //set request type post or get
                CURLOPT_POST => false,              //set to GET
                CURLOPT_RETURNTRANSFER => true,     // return web page
                CURLOPT_HEADER => false,            // don't return headers
                CURLOPT_FOLLOWLOCATION => true,     // follow redirects
                CURLOPT_ENCODING => '',             // handle all encodings
                CURLOPT_AUTOREFERER => true,        // set referer on redirect
                CURLOPT_CONNECTTIMEOUT => 120,      // timeout on connect
                CURLOPT_TIMEOUT => 120,             // timeout on response
                CURLOPT_MAXREDIRS => 10,            // stop after 10 redirects
            );

            $ch = curl_init($request);
            curl_setopt_array($ch, $options);
            $content = curl_exec($ch);
            $errno = curl_errno($ch);
            $errmsg = curl_error($ch);
            $header = curl_getinfo($ch);
            curl_close($ch);

            $header['errno'] = $errno;
            $header['errmsg'] = $errmsg;
            $response = $content;

            if ($header['errno'] !== 0) {
                throw new Exception(
                    'Unable connection to the captcha server. Curl error #' . $header['errno'] . ' ' . $header['errmsg']
                );
            }
        }

        return Json::decode($response, true);
    }
}


text:
import configureMockStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import * as t from '../actionTypes';
import { changeLayout, toggleModal, toggleCollapse, toggleDrawer } from './actions';
import uiReducer from './reducer';

describe('UI Reducer', () => {
  it('Should return the initial state', () => {
    expect(uiReducer(undefined, {})).toEqual({
      layout: 'grid',
      background: 'light',
      theme: 'boldr',
      isExpanded: false,
      isMobile: false,
      isDrawerOpen: false,
      isModalVisible: false,
    });
  });
  it('should open the modal', () => {
    const initialState = {
      layout: 'grid',
      background: 'light',
      theme: 'boldr',
      isExpanded: false,
      isMobile: false,
      isDrawerOpen: false,
      isModalVisible: false,
    };
    const stateAfter = {
      layout: 'grid',
      background: 'light',
      theme: 'boldr',
      isExpanded: false,
      isMobile: false,
      isDrawerOpen: false,
      isModalVisible: true,
    };
    expect(
      uiReducer(initialState, {
        type: t.TOGGLE_MODAL,
      }),
    ).toEqual(stateAfter);
  });
  it('should close the modal', () => {
    const initialState = {
      layout: 'grid',
      background: 'light',
      theme: 'boldr',
      isExpanded: false,
      isMobile: false,
      isDrawerOpen: false,
      isModalVisible: true,
    };
    const stateAfter = {
      layout: 'grid',
      background: 'light',
      theme: 'boldr',
      isExpanded: false,
      isMobile: false,
      isDrawerOpen: false,
      isModalVisible: false,
    };
    expect(
      uiReducer(initialState, {
        type: t.TOGGLE_MODAL,
      }),
    ).toEqual(stateAfter);
  });
  it('should change the layout', () => {
    const action = {
      type: t.CHANGE_LAYOUT,
      layout: 'list',
    };
    const state = {
      layout: 'grid',
      background: 'light',
      theme: 'boldr',
      isExpanded: false,
      isMobile: false,
      isDrawerOpen: false,
      isModalVisible: false,
    };

    expect(uiReducer(state, action)).toEqual({
      layout: 'list',
      background: 'light',
      theme: 'boldr',
      isExpanded: false,
      isMobile: false,
      isDrawerOpen: false,
      isModalVisible: false,
    });
  });
  it('should open the drawer', () => {
    const initialState = {
      layout: 'grid',
      background: 'light',
      theme: 'boldr',
      isExpanded: false,
      isMobile: false,
      isDrawerOpen: false,
      isModalVisible: false,
    };
    const stateAfter = {
      layout: 'grid',
      background: 'light',
      theme: 'boldr',
      isExpanded: false,
      isMobile: false,
      isDrawerOpen: true,
      isModalVisible: false,
    };
    expect(
      uiReducer(initialState, {
        type: t.TOGGLE_DRAWER,
      }),
    ).toEqual(stateAfter);
  });
  it('should close the drawer', () => {
    const initialState = {
      layout: 'grid',
      background: 'light',
      theme: 'boldr',
      isExpanded: false,
      isMobile: false,
      isDrawerOpen: true,
      isModalVisible: false,
    };
    const stateAfter = {
      layout: 'grid',
      background: 'light',
      theme: 'boldr',
      isExpanded: false,
      isMobile: false,
      isDrawerOpen: false,
      isModalVisible: false,
    };
    expect(
      uiReducer(initialState, {
        type: t.TOGGLE_DRAWER,
      }),
    ).toEqual(stateAfter);
  });
  it('should expand the element', () => {
    const initialState = {
      layout: 'grid',
      background: 'light',
      theme: 'boldr',
      isExpanded: false,
      isMobile: false,
      isDrawerOpen: false,
      isModalVisible: false,
    };
    const stateAfter = {
      layout: 'grid',
      background: 'light',
      theme: 'boldr',
      isExpanded: true,
      isMobile: false,
      isDrawerOpen: false,
      isModalVisible: false,
    };
    expect(
      uiReducer(initialState, {
        type: t.TOGGLE_COLLAPSE,
      }),
    ).toEqual(stateAfter);
  });
  it('should collapse', () => {
    const initialState = {
      layout: 'grid',
      background: 'light',
      theme: 'boldr',
      isExpanded: true,
      isMobile: false,
      isDrawerOpen: false,
      isModalVisible: false,
    };
    const stateAfter = {
      layout: 'grid',
      background: 'light',
      theme: 'boldr',
      isExpanded: false,
      isMobile: false,
      isDrawerOpen: false,
      isModalVisible: false,
    };
    expect(
      uiReducer(initialState, {
        type: t.TOGGLE_COLLAPSE,
      }),
    ).toEqual(stateAfter);
  });
});

test('changeLayout', () => {
  const mockStore = configureMockStore([thunk]);
  const store = mockStore({
    ui: {
      layout: 'grid',
      background: 'light',
      theme: 'boldr',
      isExpanded: false,
      isMobile: false,
      isDrawerOpen: false,
      isModalVisible: false,
    },
  });
  store.dispatch(changeLayout('list'));
  const action = store.getActions()[0];
  expect(action).toEqual({
    type: '@boldr/ui/CHANGE_LAYOUT',
    layout: 'list',
  });
});

test('openModal', () => {
  const mockStore = configureMockStore([thunk]);
  const store = mockStore({
    ui: {
      layout: 'grid',
      background: 'light',
      theme: 'boldr',
      isExpanded: false,
      isMobile: false,
      isDrawerOpen: false,
      isModalVisible: false,
    },
  });
  store.dispatch(toggleModal());
  const action = store.getActions()[0];
  expect(action).toEqual({
    type: '@boldr/ui/TOGGLE_MODAL',
  });
});

test('closeModal', () => {
  const mockStore = configureMockStore([thunk]);
  const store = mockStore({
    ui: {
      layout: 'grid',
      background: 'light',
      theme: 'boldr',
      isExpanded: false,
      isMobile: false,
      isDrawerOpen: false,
      isModalVisible: true,
    },
  });
  store.dispatch(toggleModal());
  const action = store.getActions()[0];
  expect(action).toEqual({
    type: '@boldr/ui/TOGGLE_MODAL',
  });
});


text:
package com.alibaba.json.test.performance.case1;

import java.io.InputStream;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;

import junit.framework.TestCase;

import org.apache.commons.io.IOUtils;

import com.alibaba.json.test.codec.Codec;
import com.alibaba.json.test.codec.FastjsonCodec;
import com.alibaba.json.test.codec.JacksonCodec;
import com.alibaba.json.test.entity.case1.LongObject_100_Entity;

public class IntObjectDecodePerformanceTest extends TestCase {

    private String    text;
    private final int COUNT = 1000 * 100;

    protected void setUp() throws Exception {
        String resource = "json/object_f_int_1000.json";
        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
        text = IOUtils.toString(is);
        is.close();
    }

    public void test_decodeObject() throws Exception {
        List<Codec> decoders = new ArrayList<Codec>();
        decoders.add(new FastjsonCodec());
        decoders.add(new JacksonCodec());

        for (int i = 0; i < 10; ++i) {
            for (Codec decoder : decoders) {
                decodeToJavaBean(text, decoder);
            }
            System.out.println();
        }
        System.out.println();
        System.out.println(text);
    }

    public void decodeToJavaBean(String text, Codec decoder) throws Exception {
        long startNano = System.nanoTime();
        for (int i = 0; i < COUNT; ++i) {
            decoder.decodeObject(text, LongObject_100_Entity.class);
            // decoder.decode(text);
        }
        long nano = System.nanoTime() - startNano;
        System.out.println(decoder.getName() + " : \t" + NumberFormat.getInstance().format(nano));
    }
}


text:
using System.Threading.Tasks;
using EmployeeDirectory.Example.Domain;
using EmployeeDirectory.Example.Domain.Models;

namespace EmployeeDirectory.Example.BLL.Contracts
{
    public interface IEmployeeUpdateService
    {
        Task<Employee> UpdateAsync(EmployeeUpdateModel employee);
    }
}


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

<TITLE>
AdjacencyGraph (Compiler)
</TITLE>

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

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

com.google.javascript.jscomp.graph

Interface AdjacencyGraph<N,E>

Type Parameters:
N - Value type that the graph node stores.
E - Value type that the graph edge stores.

All Known Implementing Classes:
DiGraph, Graph, LinkedDirectedGraph, LinkedUndirectedGraph, UndiGraph

public interface AdjacencyGraph<N,E>

A minimal graph interface.  Provided is add nodes to the graph, adjacency
 calculation between a SubGraph and a GraphNode, and adding node annotations.

For a more extensive interface, see Graph.

See Also:
Graph

Method Summary

 void
clearNodeAnnotations()

          Makes each node's annotation null.

 GraphNode<N,E>
getNode(N value)

          Gets a node from the graph given a value.

 Collection<GraphNode<N,E>>
getNodes()

          Gets an immutable list of all nodes.

 int
getWeight(N value)

          Returns a weight for the given value to be used in ordering nodes, e.g.

 SubGraph<N,E>
newSubGraph()

          Returns an empty SubGraph for this Graph.

Method Detail

getNodes

Collection<GraphNode<N,E>> getNodes()

Gets an immutable list of all nodes.

getNode

GraphNode<N,E> getNode(N value)

Gets a node from the graph given a value. Values equality are compared
 using Object.equals.

Parameters:
value - The node's value.

Returns:
The corresponding node in the graph, null if there value has no
         corresponding node.

newSubGraph

SubGraph<N,E> newSubGraph()

Returns an empty SubGraph for this Graph.

clearNodeAnnotations

void clearNodeAnnotations()

Makes each node's annotation null.

getWeight

int getWeight(N value)

Returns a weight for the given value to be used in ordering nodes, e.g.
 in GraphColoring.

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

© 2009 Google -
            Privacy Policy -
            Terms and Conditions -
            About Google


text:
package handler

import (
	"testing"

	pb_broker "github.com/TheThingsNetwork/ttn/api/broker"
	pb_protocol "github.com/TheThingsNetwork/ttn/api/protocol"
	pb_lorawan "github.com/TheThingsNetwork/ttn/api/protocol/lorawan"
	"github.com/TheThingsNetwork/ttn/core/types"
	. "github.com/smartystreets/assertions"
)

type payloadMarshalerUnmarshaler interface {
	UnmarshalPayload() error
	MarshalPayload() error
}

func TestMarshalUnmarshalPayload(t *testing.T) {
	a := New(t)

	var subjects []payloadMarshalerUnmarshaler

	// Do nothing when message and payload are nil
	subjects = []payloadMarshalerUnmarshaler{
		&DeviceActivationResponse{},
	}

	for _, sub := range subjects {
		a.So(sub.MarshalPayload(), ShouldEqual, nil)
		a.So(sub.UnmarshalPayload(), ShouldEqual, nil)
	}

	txConf := &pb_protocol.TxConfiguration{Protocol: &pb_protocol.TxConfiguration_Lorawan{Lorawan: &pb_lorawan.TxConfiguration{}}}

	joinAccMsg := &pb_protocol.Message{Protocol: &pb_protocol.Message_Lorawan{Lorawan: &pb_lorawan.Message{
		MHDR: pb_lorawan.MHDR{
			Major: 1,
			MType: pb_lorawan.MType_JOIN_ACCEPT,
		},
		Payload: &pb_lorawan.Message_JoinAcceptPayload{JoinAcceptPayload: &pb_lorawan.JoinAcceptPayload{
			AppNonce: types.AppNonce([3]byte{1, 2, 3}),
			NetId:    types.NetID([3]byte{1, 2, 3}),
			DevAddr:  types.DevAddr([4]byte{1, 2, 3, 4}),
			DLSettings: pb_lorawan.DLSettings{
				Rx2Dr: 3,
			},
		}},
		Mic: []byte{1, 2, 3, 4},
	}}}
	joinAccBin := []byte{33, 3, 2, 1, 3, 2, 1, 4, 3, 2, 1, 3, 0, 1, 2, 3, 4}

	// Only Marshal
	subjects = []payloadMarshalerUnmarshaler{
		&DeviceActivationResponse{
			DownlinkOption: &pb_broker.DownlinkOption{ProtocolConfig: txConf},
			Message:        joinAccMsg,
		},
	}

	for _, sub := range subjects {
		a.So(sub.UnmarshalPayload(), ShouldEqual, nil)
		a.So(sub.MarshalPayload(), ShouldEqual, nil)
	}

	// Only Unmarshal
	subjects = []payloadMarshalerUnmarshaler{
		&DeviceActivationResponse{
			DownlinkOption: &pb_broker.DownlinkOption{ProtocolConfig: txConf},
			Payload:        joinAccBin,
		},
	}

	for _, sub := range subjects {
		a.So(sub.MarshalPayload(), ShouldEqual, nil)
		a.So(sub.UnmarshalPayload(), ShouldEqual, nil)
	}

}


text:
Strategy to authenticate with Colorgy via OAuth2 in OmniAuth.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'omniauth-colorgy-oauth2'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install omniauth-colorgy-oauth2

## Usage

The OmniAuth strategy can be used just like many of the other strategies, like omniauth-facebook, omniauth-google-oauth2... etc. Here are some few examples:

### Rails middleware

An example for adding the middleware to a Rails app in `config/initializers/omniauth.rb`:

```ruby
Rails.application.config.middleware.use OmniAuth::Builder do
  provider :colorgy, ENV['APP_ID'], ENV['APP_SECRET'],
                     scope: 'public email identity offline_access',
                     fields: [:id, :uuid, :email, :avatar_url, :primary_identity],
                     includes: [:primary_identity],
                     client_options: { site: 'https://colorgy.io' }
end
```

> The configurations used in the above example are introduced in the `Configuration` section below.

### Devise

First define your **application id** and **secret** in `config/initializers/devise.rb`:

```ruby
config.omniauth :colorgy, "COLORGY_APP_ID", "COLORGY_APP_SECRET"
```

Then add the following to `config/routes.rb` so the callback routes are defined:

```ruby
# This controller will be setup later in `app/controllers/users/omniauth_callbacks_controller.rb`
devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }
```

Make sure your model is omniauthable. Generally this is `app/models/user.rb`:

```ruby
devise :omniauthable, :omniauth_providers => [:colorgy]
```

Then make sure your callbacks controller is setup:

```ruby
# app/controllers/users/omniauth_callbacks_controller.rb

class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
  def colorgy
    auth = request.env['omniauth.auth']

    # This method will be implement later in your model (e.g. app/models/user.rb)
    @user = User.from_colorgy(auth, current_user)

    if @user.persisted?
      set_flash_message(:notice, :success, kind: 'Colorgy') if is_navigational_format?
      sign_in_and_redirect @user, event: :authentication
    else
      session['devise.colorgy_data'] = auth
      redirect_to new_user_registration_path
    end
  end
end
```

Finally, implement the `from_colorgy` method for the User model in `app/models/user.rb`

```ruby
def self.from_colorgy(auth, signed_in_resource=nil)
  user = where(:email => auth.info.email).first_or_create! do |user|
    user.password = Devise.friendly_token[0,20]
  end

  return user
end
```

Now you can add an login link in your view using:

```ruby
<%= link_to "Sign in with Colorgy", user_omniauth_authorize_path(:colorgy) %>
```

## Configuration

You can configure several options, which you pass into the provider method: `scope`, `fields`, `includes` and `client_options`.

An example using devise in `config/initializers/devise.rb` is like:

```ruby
config.omniauth :colorgy, ENV['APP_ID'], ENV['APP_SECRET'],
                          scope: 'public email identity offline_access',
                          fields: [:id, :uuid, :email, :avatar_url, :primary_identity],
                          includes: [:primary_identity],
                          client_options: { site: 'https://colorgy.io' }
```

- `scope`: A space-separated list of permissions you want to request from the user. defaults to `public`, which only provides the user's `id`, `uuid`, `username`, `name` and profile pictures (`avatar_url` and `cover_photo_url`)
- `fields`: An array selecting the fields of user's infomation to be returned. This is really useful for making your API calls more efficient and fast.
- `includes`: An array to select includable related data (e.g. `primary_identity`, `organizations`) to be included with the user's infomation. It will be convenient that you won't have to make another API call to get the data.
- `client_options`: A hash to specify the client configurations. Set this to `{ site: 'https://server.url' }` to change the API server that you want to use.

## Single-Sign On/Off (SSO) Support

_(Optional, only if you want a single sing in/out status synced with Colorgy core.)_

The Colorgy SSO system is implemented using **OAuth 2.0** as the authorization protocol and **Sign-on Status Tokens (SST)** as credential of the sign-on status of the user, achieving sign in and out seamlessly controlled by a central server.

The **Sign-on Status Token (SST)** is stored in an cross-domain cookie (`_sst`) to represent the sign on status of the current user. **SST**s are trully [JSON Web Tokens (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token) containing identification information, signed by a RSA private key. Clients (other services under this SSO system) will be able to decode and verify the infomation using a corresponding RSA public key, and make reasonable reactions (signs in or out the user, reauthorize from the server... etc.) according to the infomation it provided.

This gem has implemented some solutions to cover certain use cases.

### Using Devise With Rails: `ColorgyDeviseSSOManager`

_An `ActiveSupport::Concern` to drop into your `ActionController` directly without any configurations to enable SSO support, if you're using devise and omniauth already._

> Limitations: since this tactic relys on sharing a cookie accross Colorgy core and your app, your app should be running on a subdomain of Colorgy core to make this work.

First, make sure Devise is setup properly to OmniAuth with Colorgy - clicking the 'Sign in with Colorgy' link will sign you in with no doubts.

Then confirm that you have at least copy down the **`uuid`** (and accessable via `User#uuid`) or `id` (accessable via `User#sid` or `User#cid`) property of a user when they are signing in from Colorgy Core. A sample is as below:

```ruby
# /app/models/user.rb

# ...

  def self.from_colorgy(auth, signed_in_resource=nil)
    # The uuid is copied down during creation!
    user = where(:uuid => auth.info.uuid).first_or_create! do |user|
      user.email = auth.info.email
    end
  end

# ...
```

You might want your local user data to be updated automatically when the core data is. If so, add a **`refreshed_at`** column to your User model and let your application be able to determine whether a refresh is needed (comparing the `update_at` in SST and this column):

```bash
rails g migration add_refreshed_at_to_users refreshed_at:datetime
rake db:migrate
```

Make sure it is updated while each core sign in, usually in `app/models/user.rb`:

```ruby
def self.from_colorgy(auth)
  # ...

  user.refreshed_at = Time.now
  user.save!

  # ...
end
```

Then just include `ColorgyDeviseSSOManager` in your ApplicationController and all the rest is done:

```ruby
# app/controllers/application_controller.rb

class ApplicationController < ActionController::Base
  include ColorgyDeviseSSOManager
  include FlashMessageReporter
end
```

_`FlashMessageReporter` is optional, include it if you want to relay flash messages from core to your app ._

> This `ActiveSupport::Concern` is zero-configured since we can guess the URL of Core SSO by OmniAuth and Devise configurations, get the RSA public key automatically from the server, and use the User model's `uuid` (or `cid`, `sid`) and `refreshed_at` (or `synced_at`) by convention to perform certain actions like checking the user's identity or last refresh date.

> You can also manually specify the RSA public key used to verify SSTs. Just pass it in using an environment variable called **`CORE_RSA_PUBLIC_KEY`**. Put it in your `.env` or export it like this: `export CORE_RSA_PUBLIC_KEY='-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3D ... P2QIDAQAB\n-----END PUBLIC KEY-----\n'`. Make sure it's accessible via `ENV['CORE_RSA_PUBLIC_KEY']` in your app.

Now that users on your app will be signing in/out synchronizedly with Colorgy core, and is automatically reauthorized to get user's new data from core when updated.

`ColorgyDeviseSSOManager` also provide two URL helper methods: `sign_out_url`, `logout_url` pointed to the core sign out URL. You can replace your orginal logout link (maybe `destroy_user_session_path`) with these. (Since it's an SSO, signing out of the core server means to sign out of your application too.)

```ruby
<%= link_to("Log Out", sign_out_url, method: :delete) %>
```

If SSO functionality needs to be turned off temporary, call the `sso_off!` method at `before_filter` like this:

```ruby
class ApplicationController < ActionController::Base
  # ...

  before_filter :sso_off!

  # ...
end
```

The SSO functionality will be disabled automatically in testing environment (`Rails.env.test?`) by the way.

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.

The test suite can be run by executing `bundle exec rake`.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

1. Fork it.
2. Create your feature branch (`git checkout -b my-new-feature`).
3. Commit your changes (`git commit -am 'Add some feature'`).
4. Push to the branch (`git push origin my-new-feature`).
5. Create a new Pull Request.


text:
"""
Invoke development tasks.
"""
import argparse
import os
from pathlib import Path
from subprocess import call
from subprocess import check_call
from subprocess import check_output

from colorama import Fore
from colorama import init

def announce(version):
    """Generates a new release announcement entry in the docs."""
    # Get our list of authors
    stdout = check_output(["git", "describe", "--abbrev=0", "--tags"])
    stdout = stdout.decode("utf-8")
    last_version = stdout.strip()

    stdout = check_output(
        ["git", "log", "{}..HEAD".format(last_version), "--format=%aN"]
    )
    stdout = stdout.decode("utf-8")

    contributors = set(stdout.splitlines())

    template_name = (
        "release.minor.rst" if version.endswith(".0") else "release.patch.rst"
    )
    template_text = (
        Path(__file__).parent.joinpath(template_name).read_text(encoding="UTF-8")
    )

    contributors_text = (
        "\n".join("* {}".format(name) for name in sorted(contributors)) + "\n"
    )
    text = template_text.format(version=version, contributors=contributors_text)

    target = Path(__file__).parent.joinpath(
        "../doc/en/announce/release-{}.rst".format(version)
    )
    target.write_text(text, encoding="UTF-8")
    print(f"{Fore.CYAN}[generate.announce] {Fore.RESET}Generated {target.name}")

    # Update index with the new release entry
    index_path = Path(__file__).parent.joinpath("../doc/en/announce/index.rst")
    lines = index_path.read_text(encoding="UTF-8").splitlines()
    indent = "   "
    for index, line in enumerate(lines):
        if line.startswith("{}release-".format(indent)):
            new_line = indent + target.stem
            if line != new_line:
                lines.insert(index, new_line)
                index_path.write_text("\n".join(lines) + "\n", encoding="UTF-8")
                print(
                    f"{Fore.CYAN}[generate.announce] {Fore.RESET}Updated {index_path.name}"
                )
            else:
                print(
                    f"{Fore.CYAN}[generate.announce] {Fore.RESET}Skip {index_path.name} (already contains release)"
                )
            break

    check_call(["git", "add", str(target)])

def regen(version):
    """Call regendoc tool to update examples and pytest output in the docs."""
    print(f"{Fore.CYAN}[generate.regen] {Fore.RESET}Updating docs")
    check_call(
        ["tox", "-e", "regen"],
        env={**os.environ, "SETUPTOOLS_SCM_PRETEND_VERSION": version},
    )

def fix_formatting():
    """Runs pre-commit in all files to ensure they are formatted correctly"""
    print(
        f"{Fore.CYAN}[generate.fix linting] {Fore.RESET}Fixing formatting using pre-commit"
    )
    call(["pre-commit", "run", "--all-files"])

def check_links():
    """Runs sphinx-build to check links"""
    print(f"{Fore.CYAN}[generate.check_links] {Fore.RESET}Checking links")
    check_call(["tox", "-e", "docs-checklinks"])

def pre_release(version, *, skip_check_links):
    """Generates new docs, release announcements and creates a local tag."""
    announce(version)
    regen(version)
    changelog(version, write_out=True)
    fix_formatting()
    if not skip_check_links:
        check_links()

    msg = "Prepare release version {}".format(version)
    check_call(["git", "commit", "-a", "-m", msg])

    print()
    print(f"{Fore.CYAN}[generate.pre_release] {Fore.GREEN}All done!")
    print()
    print("Please push your branch and open a PR.")

def changelog(version, write_out=False):
    if write_out:
        addopts = []
    else:
        addopts = ["--draft"]
    check_call(["towncrier", "--yes", "--version", version] + addopts)

def main():
    init(autoreset=True)
    parser = argparse.ArgumentParser()
    parser.add_argument("version", help="Release version")
    parser.add_argument("--skip-check-links", action="store_true", default=False)
    options = parser.parse_args()
    pre_release(options.version, skip_check_links=options.skip_check_links)

if __name__ == "__main__":
    main()


text:
<?xml version="1.0" encoding="utf-8"?>
<ImageView android:id="@+id/thumbnail_large"
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@color/image_normal"
  android:contentDescription="@string/icon"
  android:scaleType="centerInside" />


text:
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (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.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is JavaScript Engine testing utilities.
 *
 * The Initial Developer of the Original Code is
 * Netscape Communications Corp.
 * Portions created by the Initial Developer are Copyright (C) 2002
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *   rogerl@netscape.com, pschwartau@netscape.com
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

/*
 *
 * Date:    15 July 2002
 * SUMMARY: Testing identifiers with double-byte names
 * See http://bugzilla.mozilla.org/show_bug.cgi?id=58274
 *
 * Here is a sample of the problem:
 *
 *    js> function f\u02B1 () {}
 *
 *    js> f\u02B1.toSource();
 *    function f¦() {}
 *
 *    js> f\u02B1.toSource().toSource();
 *    (new String("function f\xB1() {}"))
 *
 *
 * See how the high-byte information (the 02) has been lost?
 * The same thing was happening with the toString() method:
 *
 *    js> f\u02B1.toString();
 *
 *    function f¦() {
 *    }
 *
 *    js> f\u02B1.toString().toSource();
 *    (new String("\nfunction f\xB1() {\n}\n"))
 *
 */
//-----------------------------------------------------------------------------
var gTestfile = 'uc-005.js';
var UBound = 0;
var BUGNUMBER = 58274;
var summary = 'Testing identifiers with double-byte names';
var status = '';
var statusitems = [];
var actual = '';
var actualvalues = [];
var expect= '';
var expectedvalues = [];

/*
 * Define a function that uses double-byte identifiers in
 * "every possible way"
 *
 * Then recover each double-byte identifier via f.toString().
 * To make this easier, put a 'Z' token before every one.
 *
 * Our eval string will be:
 *
 * sEval = "function Z\u02b1(Z\u02b2, b) {
 *          try { Z\u02b3 : var Z\u02b4 = Z\u02b1; }
 *          catch (Z\u02b5) { for (var Z\u02b6 in Z\u02b5)
 *          {for (1; 1<0; Z\u02b7++) {new Array()[Z\u02b6] = 1;} };} }";
 *
 * It will be helpful to build this string in stages:
 */
var s0 =  'function Z';
var s1 =  '\u02b1(Z';
var s2 =  '\u02b2, b) {try { Z';
var s3 =  '\u02b3 : var Z';
var s4 =  '\u02b4 = Z';
var s5 =  '\u02b1; } catch (Z'
  var s6 =  '\u02b5) { for (var Z';
var s7 =  '\u02b6 in Z';
var s8 =  '\u02b5){for (1; 1<0; Z';
var s9 =  '\u02b7++) {new Array()[Z';
var s10 = '\u02b6] = 1;} };} }';

/*
 * Concatenate these and eval() to create the function Z\u02b1
 */
var sEval = s0 + s1 + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9 + s10;
eval(sEval);

/*
 * Recover all the double-byte identifiers via Z\u02b1.toString().
 * We'll recover the 1st one as arrID[1], the 2nd one as arrID[2],
 * and so on ...
 */
var arrID = getIdentifiers(Z\u02b1);

/*
 * Now check that we got back what we put in -
 */
status = inSection(1);
actual = arrID[1];
expect = s1.charAt(0);
addThis();

status = inSection(2);
actual = arrID[2];
expect = s2.charAt(0);
addThis();

status = inSection(3);
actual = arrID[3];
expect = s3.charAt(0);
addThis();

status = inSection(4);
actual = arrID[4];
expect = s4.charAt(0);
addThis();

status = inSection(5);
actual = arrID[5];
expect = s5.charAt(0);
addThis();

status = inSection(6);
actual = arrID[6];
expect = s6.charAt(0);
addThis();

status = inSection(7);
actual = arrID[7];
expect = s7.charAt(0);
addThis();

status = inSection(8);
actual = arrID[8];
expect = s8.charAt(0);
addThis();

status = inSection(9);
actual = arrID[9];
expect = s9.charAt(0);
addThis();

status = inSection(10);
actual = arrID[10];
expect = s10.charAt(0);
addThis();

//-----------------------------------------------------------------------------
test();
//-----------------------------------------------------------------------------

/*
 * Goal: recover the double-byte identifiers from f.toString()
 * by getting the very next character after each 'Z' token.
 *
 * The return value will be an array |arr| indexed such that
 * |arr[1]| is the 1st identifier, |arr[2]| the 2nd, and so on.
 *
 * Note, however, f.toString() is implementation-independent.
 * For example, it may begin with '\nfunction' instead of 'function'.
 *
 * Rhino uses a Unicode representation for f.toString(); whereas
 * SpiderMonkey uses an ASCII representation, putting escape sequences
 * for non-ASCII characters. For example, if a function is called f\u02B1,
 * then in Rhino the toString() method will present a 2-character Unicode
 * string for its name, whereas SpiderMonkey will present a 7-character
 * ASCII string for its name: the string literal 'f\u02B1'.
 *
 * So we force the lexer to condense the string before we use it.
 * This will give uniform results in Rhino and SpiderMonkey.
 */
function getIdentifiers(f)
{
  var str = condenseStr(f.toString());
  var arr = str.split('Z');

  /*
   * The identifiers are the 1st char of each split substring
   * EXCEPT the first one, which is just ('\n' +) 'function '.
   *
   * Thus note the 1st identifier will be stored in |arr[1]|,
   * the 2nd one in |arr[2]|, etc., making the indexing easy -
   */
  for (i in arr)
    arr[i] = arr[i].charAt(0);
  return arr;
}

/*
 * This function is the opposite of a functions like escape(), which take
 * Unicode characters and return escape sequences for them. Here, we force
 * the lexer to turn escape sequences back into single characters.
 *
 * Note we can't simply do |eval(str)|, since in practice |str| will be an
 * identifier somewhere in the program (e.g. a function name); thus |eval(str)|
 * would return the object that the identifier represents: not what we want.
 *
 * So we surround |str| lexicographically with quotes to force the lexer to
 * evaluate it as a string. Have to strip out any linefeeds first, however -
 */
function condenseStr(str)
{
  /*
   * You won't be able to do the next step if |str| has
   * any carriage returns or linefeeds in it. For example:
   *
   *  js> eval("'" + '\nHello' + "'");
   *  1: SyntaxError: unterminated string literal:
   *  1: '
   *  1: ^
   *
   * So replace them with the empty string -
   */
  str = str.replace(/[\r\n]/g, '')
    return eval("'" + str + "'")
    }

function addThis()
{
  statusitems[UBound] = status;
  actualvalues[UBound] = actual;
  expectedvalues[UBound] = expect;
  UBound++;
}

function test()
{
  enterFunc('test');
  printBugNumber(BUGNUMBER);
  printStatus(summary);

  for (var i=0; i<UBound; i++)
  {
    reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
  }

  exitFunc ('test');
}


text:
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ForumDEG.Helpers {
    public class CoordinatorParser {
        public static Models.Coordinator GetCoordinatorParser(string content, string registration) {
            var obj = JObject.Parse(content);

            string name = obj["name"].ToString();
            string email = obj["email"].ToString();
            string course = obj["course"].ToString();
            string password = obj["password"].ToString();

            Debug.WriteLine("[Coordinator API]: Coord name: " + name);
            Debug.WriteLine("[Coordinator API]: Coord email: " + email);
            Debug.WriteLine("[Coordinator API]: Coord course: " + course);
            Debug.WriteLine("[Coordinator API]: Coord password: " + password);

            Models.Coordinator coordinator = new Models.Coordinator {
                Name = name,
                Email = email,
                Course = course,
                Password = password,
                Registration = registration
            };

            return coordinator;
        }

        public static List<Models.Coordinator> GetCoordinatorsParser(string content) {
            List<Models.Coordinator> coordinators = new List<Models.Coordinator>();
            var objArray = JArray.Parse(content);

            foreach (JObject obj in objArray) {
                string name = obj["name"].ToString();
                string email = obj["email"].ToString();
                string course = obj["course"].ToString();
                string password = obj["password"].ToString();
                string registration = obj["registration"].ToString();

                Debug.WriteLine("[Coordinator API]: Coord name: " + name);
                Debug.WriteLine("[Coordinator API]: Coord email: " + email);
                Debug.WriteLine("[Coordinator API]: Coord course: " + course);
                Debug.WriteLine("[Coordinator API]: Coord password: " + password);
                Debug.WriteLine("[Coordinator API]: Coord registration: " + registration);

                coordinators.Add(new Models.Coordinator {
                    Name = name,
                    Email = email,
                    Course = course,
                    Password = password,
                    Registration = registration
                });
            }

            return coordinators;
        }

        public static JObject PostCoordinatorBuilder(Models.Coordinator coordinator) {
            var name = coordinator.Name;
            var email = coordinator.Email;
            var password = coordinator.Password;
            var registration = coordinator.Registration;
            var course = coordinator.Course;

            var coordinatorData = new JObject();
            coordinatorData.Add("name", name);
            coordinatorData.Add("email", email);
            coordinatorData.Add("password", password);
            coordinatorData.Add("registration", registration);
            coordinatorData.Add("course", course);

            var body = new JObject();
            body.Add("coordinator", coordinatorData);

            return body;
        }

        public static JObject PutCoordinatorBuilder(Models.Coordinator oldCoordinator, Models.Coordinator coordinator) {
            var coordinatorData = new JObject();

            if (oldCoordinator.Name != coordinator.Name && !String.IsNullOrEmpty(coordinator.Name)) {
                var name = coordinator.Name;
                coordinatorData.Add("name", name);
            }

            if (oldCoordinator.Email != coordinator.Email && !String.IsNullOrEmpty(coordinator.Email)) {
                var email = coordinator.Email;
                coordinatorData.Add("email", email);
            }

            if (oldCoordinator.Password != coordinator.Password && !String.IsNullOrEmpty(coordinator.Password)) {
                var password = coordinator.Password;
                coordinatorData.Add("password", password);
            }

            if (oldCoordinator.Registration != coordinator.Registration && !String.IsNullOrEmpty(coordinator.Registration)) {
                var newRegistration = coordinator.Registration;
                coordinatorData.Add("registration", newRegistration);
            }

            if (oldCoordinator.Course != coordinator.Course && !String.IsNullOrEmpty(coordinator.Course)) {
                var course = coordinator.Course;
                coordinatorData.Add("course", course);
            }

            var body = new JObject();
            body.Add("coordinator", coordinatorData);

            return body;
        }
    }
}


text:
namespace Apache.Ignite.Core.Cache.Query
{
    using System;
    using System.Diagnostics.CodeAnalysis;
    using Apache.Ignite.Core.Impl.Binary;
    using Apache.Ignite.Core.Impl.Cache;
    using Apache.Ignite.Core.Impl.Common;

    /// <summary>
    /// SQL Query.
    /// </summary>
    public class SqlQuery : QueryBase
    {
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="queryType">Type.</param>
        /// <param name="sql">SQL.</param>
        /// <param name="args">Arguments.</param>
        public SqlQuery(Type queryType, string sql, params object[] args) : this(queryType, sql, false, args)
        {
            // No-op.
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="queryType">Type.</param>
        /// <param name="sql">SQL.</param>
        /// <param name="local">Whether query should be executed locally.</param>
        /// <param name="args">Arguments.</param>
        public SqlQuery(Type queryType, string sql, bool local, params object[] args)
            : this(queryType == null ? null : queryType.Name, sql, local, args)
        {
            // No-op.
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="queryType">Type.</param>
        /// <param name="sql">SQL.</param>
        /// <param name="args">Arguments.</param>
        public SqlQuery(string queryType, string sql, params object[] args) : this(queryType, sql, false, args)
        {
            // No-op.
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="queryType">Type.</param>
        /// <param name="sql">SQL.</param>
        /// <param name="local">Whether query should be executed locally.</param>
        /// <param name="args">Arguments.</param>
        public SqlQuery(string queryType, string sql, bool local, params object[] args)
        {
            IgniteArgumentCheck.NotNullOrEmpty("queryType", queryType);
            IgniteArgumentCheck.NotNullOrEmpty("sql", sql);

            QueryType = queryType;
            Sql = sql;
            Local = local;
            Arguments = args;
        }

        /// <summary>
        /// Type.
        /// </summary>
        public string QueryType { get; set; }

        /// <summary>
        /// SQL.
        /// </summary>
        public string Sql { get; set; }

        /// <summary>
        /// Arguments.
        /// </summary>
        [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
        public object[] Arguments { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether distributed joins should be enabled for this query.
        /// <para />
        /// When disabled, join results will only contain colocated data (joins work locally).
        /// When enabled, joins work as expected, no matter how the data is distributed.
        /// </summary>
        /// <value>
        /// <c>true</c> if enable distributed joins should be enabled; otherwise, <c>false</c>.
        /// </value>
        public bool EnableDistributedJoins { get; set; }

        /** <inheritDoc /> */
        internal override void Write(BinaryWriter writer, bool keepBinary)
        {
            if (string.IsNullOrEmpty(Sql))
                throw new ArgumentException("Sql cannot be null or empty");

            if (string.IsNullOrEmpty(QueryType))
                throw new ArgumentException("QueryType cannot be null or empty");

            // 2. Prepare.
            writer.WriteBoolean(Local);
            writer.WriteString(Sql);
            writer.WriteString(QueryType);
            writer.WriteInt(PageSize);

            WriteQueryArgs(writer, Arguments);

            writer.WriteBoolean(EnableDistributedJoins);
        }

        /** <inheritDoc /> */
        internal override CacheOp OpId
        {
            get { return CacheOp.QrySql; }
        }
    }
}