text:
package registry

import (
	"bytes"
	"crypto/tls"
	"crypto/x509"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"time"

	bosherr "github.com/cloudfoundry/bosh-utils/errors"
	boshlog "github.com/cloudfoundry/bosh-utils/logger"
)

const httpClientLogTag = "RegistryHTTPClient"
const httpClientMaxAttemps = 5
const httpClientRetryDelay = 5

// HTTPClient represents a BOSH Registry Client.
type HTTPClient struct {
	options ClientOptions
	logger  boshlog.Logger
}

// NewHTTPClient creates a new BOSH Registry Client.
func NewHTTPClient(
	options ClientOptions,
	logger boshlog.Logger,
) HTTPClient {
	return HTTPClient{
		options: options,
		logger:  logger,
	}
}

// Delete deletes the instance settings for a given instance ID.
func (c HTTPClient) Delete(instanceID string) error {
	var endpoint string
	if len(c.options.Endpoint) > 0 {
		endpoint = fmt.Sprintf("%s/instances/%s/settings", c.options.Endpoint, instanceID)
	} else {
		endpoint = fmt.Sprintf("%s/instances/%s/settings", c.options.EndpointWithCredentials(), instanceID)
	}
	c.logger.Debug(httpClientLogTag, "Deleting agent settings from registry endpoint '%s'", endpoint)

	request, err := http.NewRequest("DELETE", endpoint, nil)
	if err != nil {
		return bosherr.WrapErrorf(err, "Creating DELETE request for registry endpoint '%s'", endpoint)
	}

	httpResponse, err := c.doRequest(request)
	if err != nil {
		return bosherr.WrapErrorf(err, "Deleting agent settings from registry endpoint '%s'", endpoint)
	}

	defer httpResponse.Body.Close()

	if httpResponse.StatusCode != http.StatusOK {
		return bosherr.Errorf("Received status code '%d' when deleting agent settings from registry endpoint '%s'", httpResponse.StatusCode, endpoint)
	}

	c.logger.Debug(httpClientLogTag, "Deleted agent settings from registry endpoint '%s'", endpoint)
	return nil
}

// Fetch gets the agent settings for a given instance ID.
func (c HTTPClient) Fetch(instanceID string) (AgentSettings, error) {
	var endpoint string
	if len(c.options.Endpoint) > 0 {
		endpoint = fmt.Sprintf("%s/instances/%s/settings", c.options.Endpoint, instanceID)
	} else {
		endpoint = fmt.Sprintf("%s/instances/%s/settings", c.options.EndpointWithCredentials(), instanceID)
	}
	c.logger.Debug(httpClientLogTag, "Fetching agent settings from registry endpoint '%s'", endpoint)

	request, err := http.NewRequest("GET", endpoint, nil)
	if err != nil {
		return AgentSettings{}, bosherr.WrapErrorf(err, "Creating GET request for registry endpoint '%s'", endpoint)
	}

	httpResponse, err := c.doRequest(request)
	if err != nil {
		return AgentSettings{}, bosherr.WrapErrorf(err, "Fetching agent settings from registry endpoint '%s'", endpoint)
	}

	defer httpResponse.Body.Close()

	if httpResponse.StatusCode != http.StatusOK {
		return AgentSettings{}, bosherr.Errorf("Received status code '%d' when fetching agent settings from registry endpoint '%s'", httpResponse.StatusCode, endpoint)
	}

	httpBody, err := ioutil.ReadAll(httpResponse.Body)
	if err != nil {
		return AgentSettings{}, bosherr.WrapErrorf(err, "Reading agent settings response from registry endpoint '%s'", endpoint)
	}

	var settingsResponse agentSettingsResponse
	if err = json.Unmarshal(httpBody, &settingsResponse); err != nil {
		return AgentSettings{}, bosherr.WrapErrorf(err, "Unmarshalling agent settings response from registry endpoint '%s', contents: '%s'", endpoint, httpBody)
	}

	var agentSettings AgentSettings
	if err = json.Unmarshal([]byte(settingsResponse.Settings), &agentSettings); err != nil {
		return AgentSettings{}, bosherr.WrapErrorf(err, "Unmarshalling agent settings response from registry endpoint '%s', contents: '%s'", endpoint, httpBody)
	}

	c.logger.Debug(httpClientLogTag, "Received agent settings from registry endpoint '%s', contents: '%s'", endpoint, httpBody)
	return agentSettings, nil
}

// Update updates the agent settings for a given instance ID. If there are not already agent settings for the instance, it will create ones.
func (c HTTPClient) Update(instanceID string, agentSettings AgentSettings) error {
	settingsJSON, err := json.Marshal(agentSettings)
	if err != nil {
		return bosherr.WrapErrorf(err, "Marshalling agent settings, contents: '%#v", agentSettings)
	}

	var endpoint string
	if len(c.options.Endpoint) > 0 {
		endpoint = fmt.Sprintf("%s/instances/%s/settings", c.options.Endpoint, instanceID)
	} else {
		endpoint = fmt.Sprintf("%s/instances/%s/settings", c.options.EndpointWithCredentials(), instanceID)
	}
	c.logger.Debug(httpClientLogTag, "Updating registry endpoint '%s' with agent settings '%s'", endpoint, settingsJSON)

	putPayload := bytes.NewReader(settingsJSON)
	request, err := http.NewRequest("PUT", endpoint, putPayload)
	if err != nil {
		return bosherr.WrapErrorf(err, "Creating PUT request for registry endpoint '%s' with agent settings '%s'", endpoint, settingsJSON)
	}

	httpResponse, err := c.doRequest(request)
	if err != nil {
		return bosherr.WrapErrorf(err, "Updating registry endpoint '%s' with agent settings: '%s'", endpoint, settingsJSON)
	}

	defer httpResponse.Body.Close()

	if httpResponse.StatusCode != http.StatusOK && httpResponse.StatusCode != http.StatusCreated {
		return bosherr.Errorf("Received status code '%d' when updating registry endpoint '%s' with agent settings: '%s'", httpResponse.StatusCode, endpoint, settingsJSON)
	}

	c.logger.Debug(httpClientLogTag, "Updated registry endpoint '%s' with agent settings '%s'", endpoint, settingsJSON)
	return nil
}

func (c HTTPClient) doRequest(request *http.Request) (httpResponse *http.Response, err error) {
	httpClient, err := c.httpClient()
	if err != nil {
		return nil, bosherr.WrapErrorf(err, "Creating HTTP Client")
	}

	retryDelay := time.Duration(httpClientRetryDelay) * time.Second
	for attempt := 0; attempt < httpClientMaxAttemps; attempt++ {
		httpResponse, err = httpClient.Do(request)
		if err == nil {
			return httpResponse, nil
		}
		c.logger.Debug(httpClientLogTag, "Performing registry HTTP call #%d got error '%v'", attempt, err)
		time.Sleep(retryDelay)
	}

	return nil, err
}

func (c HTTPClient) httpClient() (http.Client, error) {
	httpClient := http.Client{}

	if c.options.Protocol == "https" {
		certificates, err := tls.LoadX509KeyPair(c.options.TLS.CertFile, c.options.TLS.KeyFile)
		if err != nil {
			return httpClient, bosherr.WrapError(err, "Loading X509 Key Pair")
		}

		certPool := x509.NewCertPool()
		if c.options.TLS.CACertFile != "" {
			caCert, err := ioutil.ReadFile(c.options.TLS.CACertFile)
			if err != nil {
				return httpClient, bosherr.WrapError(err, "Loading CA certificate")
			}

			if !certPool.AppendCertsFromPEM(caCert) {
				return httpClient, bosherr.WrapError(err, "Invalid CA Certificate")
			}
		}

		tlsConfig := &tls.Config{
			Certificates:       []tls.Certificate{certificates},
			InsecureSkipVerify: c.options.TLS.InsecureSkipVerify,
			RootCAs:            certPool,
		}

		httpClient.Transport = &http.Transport{TLSClientConfig: tlsConfig}
	}

	return httpClient, nil
}


text:
package org.spongepowered.api.event.entity.player;

import org.spongepowered.api.entity.player.Player;
import org.spongepowered.api.event.Cancellable;
import org.spongepowered.api.world.World;

/**
 * Called when the {@link Player} changes {@link World}.
 */
public interface PlayerChangeWorldEvent extends PlayerEvent, Cancellable {

    /**
     * Gets the {@link World} the player is leaving.
     *
     * @return The from world.
     */
    World getFromWorld();

    /**
     * Gets the {@link World} the player is entering.
     *
     * @return The to world.
     */
    World getToWorld();
}

redpajama_set_name: RedPajamaGithub


text:
package ch.hoene.perzist.source.relational;

import ch.hoene.perzist.access.filter.FieldFilter;
import ch.hoene.perzist.access.filter.Filter;
import ch.hoene.perzist.access.filter.FilterSet;
import ch.hoene.perzist.access.filter.FilterVisitorGenerified;
import ch.hoene.perzist.access.filter.NotFilter;
import ch.hoene.perzist.access.filter.Operator;
import ch.hoene.perzist.access.mapping.Mapping;
import ch.hoene.perzist.access.query.Query;
import ch.hoene.perzist.access.sort.FieldOrder;
import ch.hoene.perzist.access.sort.Order;
import ch.hoene.perzist.access.sort.OrderSet;
import ch.hoene.perzist.access.sort.RandomOrder;
import ch.hoene.perzist.source.sql.query.BoolOperator;
import ch.hoene.perzist.source.sql.query.OrderClause;
import ch.hoene.perzist.source.sql.query.OrderClauseFields;
import ch.hoene.perzist.source.sql.query.OrderClausePartField;
import ch.hoene.perzist.source.sql.query.OrderClauseRandom;
import ch.hoene.perzist.source.sql.query.Select;
import ch.hoene.perzist.source.sql.query.SqlOperator;
import ch.hoene.perzist.source.sql.query.WhereClause;
import ch.hoene.perzist.source.sql.query.WhereClauseField;

public class QueryRelational<PROJECTION, TARGET, RESULT, CURSOR> extends Query<Select, WhereClause, OrderClause, RESULT, CURSOR, TARGET, PROJECTION>
{
     private final Mapping<Select, RESULT, CURSOR> mapping;

     public QueryRelational(Mapping<Select, RESULT, CURSOR> mapping)
     {
          this.mapping = mapping;
     }

     public QueryRelational(Filter<? super PROJECTION> filter, Mapping<Select, RESULT, CURSOR> mapping)
     {
          super(filter);
          this.mapping = mapping;
     }

     public QueryRelational(Order<? super PROJECTION> order, Mapping<Select, RESULT, CURSOR> mapping)
     {
          super(order);
          this.mapping = mapping;
     }

     public QueryRelational(Filter<? super PROJECTION> filter, Order<? super PROJECTION> order, Mapping<Select, RESULT, CURSOR> mapping)
    {
        super(filter, order);

          this.mapping = mapping;
    }

    public Select get()
    {
        Select sql = mapping.get();

        if(getFilter() != null){
            sql.setWhereClause(getFilter().accept(this));
        }

      if(getOrder() != null){
            sql.setOrderClause(getOrder().accept(this));
      }

        return sql;
    }

    @Override
    public RESULT create(CURSOR queryResult) {
        return mapping.create(queryResult);
    }

    public <T, Z> WhereClause visit(FieldFilter<? super PROJECTION, Z, T> fieldFilter)
    {
        final SqlOperator sqlOperator;
        switch (fieldFilter.getOperator()){
            case EQ:
                sqlOperator = SqlOperator.EQ;
                break;
            case NEQ:
                sqlOperator = SqlOperator.NEQ;
                break;
            case GE:
                sqlOperator = SqlOperator.GE;
                break;
            case GT:
                sqlOperator = SqlOperator.GT;
                break;
            case LE:
                sqlOperator = SqlOperator.LE;
                break;
            case LIKE:
                sqlOperator = SqlOperator.LIKE;
                break;
            case NOT_LIKE:
                sqlOperator = SqlOperator.NOT_LIKE;
                break;
            case LT:
                sqlOperator = SqlOperator.LT;
                break;
            default:
                throw new IllegalArgumentException();
        }

        return new WhereClause(new WhereClauseField(fieldFilter.getField(), fieldFilter.getValue(), sqlOperator));
    }

    public OrderClause visit(RandomOrder<? super PROJECTION> orderFilter)
    {
        return new OrderClauseRandom();
    }

    public WhereClause visit(FilterSet<? super PROJECTION> filterSet)
    {
        WhereClause whereClause = null;
        for(Filter<? super PROJECTION> filter : filterSet.getFilters()){
            if(whereClause == null)
            {
                whereClause = filter.accept(this);
            }
            else
            {
                whereClause = whereClause.apply(BoolOperator.AND, filter.accept(this));
            }
        }
        return whereClause;
    }

    public WhereClause visit(NotFilter<? super PROJECTION> notFilter)
    {
        Filter<? super PROJECTION> inversedFilter = notFilter.getFilter().accept(new FilterVisitorGenerified<PROJECTION, RESULT,Object,Filter<? super PROJECTION>>()
        {

            @Override
            public Filter<? super PROJECTION> visit(FieldFilter<PROJECTION, RESULT, Object> fieldFilter,
                                                      FieldPersistable<RESULT, Object> field)
            {
                final Operator inversedOp;
                switch (fieldFilter.getOperator())
                {
                    case NEQ:
                        inversedOp = Operator.EQ;
                        break;
                    case EQ:
                        inversedOp = Operator.NEQ;
                        break;
                    case  GE:
                        inversedOp = Operator.LT;
                        break;
                    case  GT:
                        inversedOp = Operator.LE;
                        break;
                    case  LE:
                        inversedOp = Operator.GT;
                        break;
                    case  LIKE:
                        inversedOp = Operator.NOT_LIKE;
                        break;
                    case  NOT_LIKE:
                        inversedOp = Operator.LIKE;
                        break;
                    case  LT:
                        inversedOp = Operator.GE;
                        break;
                    default:
                        throw new RuntimeException("Not supported SqlOperator");
                }
                return new FieldFilter<PROJECTION, RESULT, Object>(fieldFilter.getField(), inversedOp, fieldFilter.getValue());
            }

            public Filter<? super PROJECTION> visit(FilterSet<? super PROJECTION> filterSet)
            {
                for(Filter<? super PROJECTION> f : filterSet.getFilters())
                {
                    f.accept(this);
                }
                return null;
            }

            public Filter<? super PROJECTION> visit(NotFilter<? super PROJECTION> notFilter)
            {
                return notFilter.getFilter();
            }
        });
        return inversedFilter.accept(this);
    }

    public <T, Z> OrderClause visit(FieldOrder<? super PROJECTION, Z, T> fieldOrder)
     {
          return new OrderClauseFields(new OrderClausePartField(fieldOrder.getField(), fieldOrder.getOrder()));
     }

     public OrderClause visit(OrderSet<? super PROJECTION> clauseSet)
     {
          OrderClause orderClause = null;
          for(Order<? super PROJECTION> order : clauseSet.getOrders()){
                if(orderClause == null)
                {
                    orderClause = order.accept(this);
                }
                else
                {
                     orderClause = orderClause.apply(order.accept(this));
                }
          }
          return orderClause;
     }
}


text:
package gobblin.qualitychecker.row;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.testng.Assert;
import org.testng.annotations.Test;

public class FrontLoadedSamplerTest {

  @Test
  public void test() {
    RowLevelPolicyChecker.FrontLoadedSampler sampler =
        new RowLevelPolicyChecker.FrontLoadedSampler(10, 2);

    List<Integer> sampled = Stream.iterate(0, i -> i++).limit(1000).filter(i -> sampler.acceptNext()).collect(Collectors.toList());
    Assert.assertTrue(sampled.size() >= 10);
    Assert.assertTrue(sampled.size() < 30);
    // check the first 10 values are the integers from 1 to 9
    Assert.assertEquals(sampled.subList(0, 10), Stream.iterate(0, i -> i++).limit(10).collect(Collectors.toList()));

    // with a very large decay factor, should have very few additional samples
    RowLevelPolicyChecker.FrontLoadedSampler sampler2 =
        new RowLevelPolicyChecker.FrontLoadedSampler(10, 10);
    sampled = Stream.iterate(0, i -> i++).limit(1000).filter(i -> sampler2.acceptNext()).collect(Collectors.toList());
    Assert.assertTrue(sampled.size() >= 10);
    Assert.assertTrue(sampled.size() < 15);
    // check the first 10 values are the integers from 1 to 9
    Assert.assertEquals(sampled.subList(0, 10), Stream.iterate(0, i -> i++).limit(10).collect(Collectors.toList()));

    // with a low decay factor, should have many additional samples
    RowLevelPolicyChecker.FrontLoadedSampler sampler3 =
        new RowLevelPolicyChecker.FrontLoadedSampler(10, 1.2);
    sampled = Stream.iterate(0, i -> i++).limit(1000).filter(i -> sampler3.acceptNext()).collect(Collectors.toList());
    Assert.assertTrue(sampled.size() >= 30);
    Assert.assertTrue(sampled.size() < 100);
    // check the first 10 values are the integers from 1 to 9
    Assert.assertEquals(sampled.subList(0, 10), Stream.iterate(0, i -> i++).limit(10).collect(Collectors.toList()));

  }

}


text:
namespace MassTransit.Azure.ServiceBus.Core.Tests
{
    using System;
    using System.Threading.Tasks;
    using DependencyInjection;
    using Microsoft.Extensions.DependencyInjection;
    using Microsoft.Extensions.Logging;
    using NUnit.Framework;
    using TestFramework;
    using TestFramework.Messages;
    using Testing;

    [TestFixture]
    public class Connector_Specs :
        BusTestFixture
    {
        [Test]
        public async Task Should_connect_subscription_endpoint()
        {
            ServiceBusTokenProviderSettings settings = new TestAzureServiceBusAccountSettings();

            var serviceUri = AzureServiceBusEndpointUriCreator.Create(Configuration.ServiceNamespace);

            var provider = new ServiceCollection()
                .AddSingleton<ILoggerFactory>(LoggerFactory)
                .AddSingleton(typeof(ILogger<>), typeof(Logger<>))
                .AddMassTransit(x =>
                {
                    x.UsingAzureServiceBus((context, cfg) =>
                    {
                        cfg.Host(serviceUri, h =>
                        {
                            h.NamedKey(s =>
                            {
                                s.NamedKeyCredential = settings.NamedKeyCredential;
                            });
                        });
                    });
                }).BuildServiceProvider(true);

            var depot = provider.GetRequiredService<IBusDepot>();

            await depot.Start(TestCancellationToken);
            try
            {
                var bus = provider.GetRequiredService<IBus>();

                var connector = provider.GetRequiredService<ISubscriptionEndpointConnector>();

                Task<ConsumeContext<PingMessage>> handled = null;
                var handle = connector.ConnectSubscriptionEndpoint<PingMessage>("my-sub", e =>
                {
                    handled = Handled<PingMessage>(e);
                });

                await handle.Ready;

                await bus.Publish(new PingMessage());

                await handled;
            }
            finally
            {
                await depot.Stop(TimeSpan.FromSeconds(30));
            }
        }

        [Test]
        public async Task Should_connect_subscription_endpoint_on_the_second_bus()
        {
            ServiceBusTokenProviderSettings settings = new TestAzureServiceBusAccountSettings();

            var serviceUri = AzureServiceBusEndpointUriCreator.Create(Configuration.ServiceNamespace);

            var provider = new ServiceCollection()
                .AddSingleton<ILoggerFactory>(LoggerFactory)
                .AddSingleton(typeof(ILogger<>), typeof(Logger<>))
                .AddMassTransit(x => x.UsingInMemory())
                .AddMassTransit<IDeuceBus>(x =>
                {
                    x.UsingAzureServiceBus((context, cfg) =>
                    {
                        cfg.Host(serviceUri, h =>
                        {
                            h.NamedKey(s =>
                            {
                                s.NamedKeyCredential = settings.NamedKeyCredential;
                            });
                        });
                    });
                }).BuildServiceProvider(true);

            var depot = provider.GetRequiredService<IBusDepot>();

            await depot.Start(TestCancellationToken);
            try
            {
                var bus = provider.GetRequiredService<IDeuceBus>();

                var connector = provider.GetRequiredService<ISubscriptionEndpointConnector>();

                Task<ConsumeContext<PingMessage>> handled = null;
                var handle = connector.ConnectSubscriptionEndpoint<PingMessage>("my-sub", e =>
                {
                    handled = Handled<PingMessage>(e);
                });

                await handle.Ready;

                await bus.Publish(new PingMessage());

                await handled;
            }
            finally
            {
                await depot.Stop(TimeSpan.FromSeconds(30));
            }
        }

        [Test]
        public async Task Should_connect_subscription_endpoint_on_the_second_bus_explicitly()
        {
            ServiceBusTokenProviderSettings settings = new TestAzureServiceBusAccountSettings();

            var serviceUri = AzureServiceBusEndpointUriCreator.Create(Configuration.ServiceNamespace);

            var provider = new ServiceCollection()
                .AddSingleton<ILoggerFactory>(LoggerFactory)
                .AddSingleton(typeof(ILogger<>), typeof(Logger<>))
                .AddMassTransit(x => x.UsingInMemory())
                .AddMassTransit<IDeuceBus>(x =>
                {
                    x.UsingAzureServiceBus((context, cfg) =>
                    {
                        cfg.Host(serviceUri, h =>
                        {
                            h.NamedKey(s =>
                            {
                                s.NamedKeyCredential = settings.NamedKeyCredential;
                            });
                        });
                    });
                }).BuildServiceProvider(true);

            var depot = provider.GetRequiredService<IBusDepot>();

            await depot.Start(TestCancellationToken);
            try
            {
                var bus = provider.GetRequiredService<IDeuceBus>();

                var connector = provider.GetRequiredService<Bind<IDeuceBus, ISubscriptionEndpointConnector>>().Value;

                Task<ConsumeContext<PingMessage>> handled = null;
                var handle = connector.ConnectSubscriptionEndpoint<PingMessage>("my-sub", e =>
                {
                    handled = Handled<PingMessage>(e);
                });

                await handle.Ready;

                await bus.Publish(new PingMessage());

                await handled;
            }
            finally
            {
                await depot.Stop(TimeSpan.FromSeconds(30));
            }
        }

        public interface IDeuceBus :
            IBus
        {
        }

        public Connector_Specs()
            : base(new InMemoryTestHarness())
        {
        }
    }
}


text:
    {$form[type].title|htmlspecialchars}

            {notempty name="form[type].value"}

 {$form[type].value|get_file_name}

            {/notempty}

        <input type="hidden" name="{$form[type].name}" data-multiple="false" data-size="{$form[type]['size']|default=0}" data-ext='{$form[type]["ext"]|default=""}' id="{$form[type].name}" value="{$form[type].value|default=''}">

上传单个文件

        {notempty name="form[type].tips"}

{$form[type].tips|clear_js}

        {/notempty}


text:
class RenameSenderReceiverFkeys < ActiveRecord::Migration[4.2]
  def change
    rename_column :transactions, :from_id, :sender_id
    rename_column :transactions, :to_id, :receiver_id
  end
end


text:
/* back-spin - monitors the filesystem and updates on changes */

#include <stdio.h>
#include "back.h"

int back_spin(UNUSED int argc, UNUSED char** argv) {
  BACK_ERR("subcommand 'spin' not yet implemented");
  return -1;
}


text:
<!DOCTYPE html>

		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">

		<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">

		<link rel="stylesheet" href="style.css">

					XYZ's Photos

About

Gallery

Contact

 Login

ABOUT

TODO: Some content about the author of photos etc.

GALLERY

TODO: automated system for easy pic upload and managment.

CONTACT

TODO: contact information simple is enough.

LOGIN

TODO: Form for login -> control panel if true


text:
/*global runtime, process, require, console*/

var exitCode = 0;

function Main(cmakeListPath) {
    "use strict";
    var pathModule = require("path"),
        fs = require("fs"),
        buildDir = pathModule.dirname(cmakeListPath),
        // these files are not compiled into webodf.js
        ignoredFiles = [
            "odf/CommandLineTools.js",
            "xmldom/RelaxNG.js",
            "xmldom/RelaxNG2.js",
            "xmldom/RelaxNGParser.js"
        ],
        jslintconfig;

    function className(path) {
        return path.substr(0, path.length - 3).replace(pathModule.sep, '.');
    }

    function add(occs, key, value) {
        var a = occs[key] || [];
        occs[key] = a;
        if (a.indexOf(value) === -1) {
            a.push(value);
        }
    }

    /**
     * Scan javascript source for the given symbols.
     * @param {string} source
     * @param {!Array.<string>} symbols
     * @param {!Object.<string,string> files
     * @param {!Object.<string,!Array.<string,>>
     */
    function findOccurances(source, symbols, files, occs) {
        symbols = symbols.join("|").split(".").join("\\.");
        var classname,
            content,
            regex = new RegExp("\\b(" + symbols + ")\\b");
        for (classname in files) {
            if (files.hasOwnProperty(classname)) {
                content = files[classname];
                if (source !== classname && regex.test(content)) {
                    add(occs, classname, source);
                }
            }
        }
    }

    /**
     * Determine if the javascript source defines an ops.Operation.
     */
    function isOperation(fileContent) {
        return (/ \* @implements ops\.Operation\b/).test(fileContent);
    }

    function getStyle(path, content, colors) {
        var constructor = content.indexOf("@constructor") !== -1,
            iface = content.indexOf("@interface") !== -1,
            style = (iface && !constructor) ? "\"\"" : "filled",
            group = path.split("/"),
            color;
        group = group.length > 1 ? group[0] : "";
        color = colors.indexOf(group);
        if (color === -1) {
            color = colors.length;
            colors.push(group);
        }
        return " [color=" + (color + 1) + ", style=" + style + "];\n";
    }

    /**
     * Create a dot file.
     * This function returns a string that can be saved to a .dot file.
     */
    function createDotFile(occs, files) {
        var i, j, m, n, done = {}, out, content, colors = [];
        out = "# This is a graphviz file.\n";
        out += "# dot -Tsvg dependencies.dot > dependencies.svg\n";
        out += "# dot -Tpng dependencies.dot > dependencies.png\n";
        out += "digraph webodf {\n";
        out += "node [colorscheme=pastel19]\n"; // pastel19, set312 or accent8
        for (i in occs) {
            if (occs.hasOwnProperty(i)) {
                m = occs[i];
                for (j = 0; j < m.length; j += 1) {
                    content = files[pathModule.join("lib", i)];
                    i = isOperation(content) ? "{Operation}" : i;
                    if (!done[i]) {
                        done[i] = {};
                        out += '"' + i + '"' + getStyle(i, content, colors);
                    }
                    n = m[j];
                    content = files[pathModule.join("lib", n)];
                    // omit leaf nodes unless they are interfaces
                    if (occs[n].length || content.indexOf("@interface") !== -1) {
                        n = isOperation(content) ? "{Operation}" : n;
                        if (!done[i].hasOwnProperty(n)) {
                            if (!done[n]) {
                                done[n] = {};
                                out += '"' + n + '"' + getStyle(n, content, colors);
                            }
                            out += '"' + i + '" -> "' + n + '";\n';
                            done[i][n] = 1;
                        }
                    }
                }
            }
        }
        out += "}\n";
        return out;
    }

    /**
     * @param {string} path
     * @param {string} content
     * @return {!Array.<string>}
     */
    function getTopLevelDefines(path, content) {
        var names = path.split(pathModule.sep),
            re,
            defines = {},
            match,
            m;
        re = new RegExp("^\\s*(" + names[1] + "\\.[\\w.]+) = ", "gm");
        if (names.length !== 3) {
            throw path + " Only two levels are supported.";
        }
        match = re.exec(content);
        while (match !== null) {
            m = match[1];
            defines[m] = 1;
            match = re.exec(content);
        }
        if (Object.keys(defines).length === 0) {
            throw "No defines found in " + path;
        }
        return Object.keys(defines);
    }

    /**
     * Save data to a file if the contents is different then it currently is.
     * If the file is written anew, saveCallback is called.
     */
    function saveIfDifferent(path, content, saveCallback) {
        fs.readFile(path, "utf8", function (err, data) {
            if (err || data !== content) {
                if (!err && data.length !== content.length) {
                    console.log("Different file length for " + path
                        + ": " + data.length + " " + content.length);
                }
                fs.writeFile(path, content, function (err2) {
                    if (err2) {
                        throw err2;
                    }
                    if (saveCallback) {
                        saveCallback();
                    }
                });
            }
        });
    }

    /**
     * @param {!Array.<string>} list
     * @param {!Object.<string,!Array.<string>>} deps
     * @param {!Object.<string,boolean>} defined
     * @return {!Array.<string>} list
     */
    function createOrderedList(list, deps, defined) {
        var sorted = [],
            stack = {};
        /**
         * @param {string} n
         * @param {string} parent
         */
        function visit(n, parent) {
            if (defined[n]) {
                return;
            }
            if (stack[n]) {
                throw "Circular dependency caused by " + n + " and " + parent;
            }
            stack[n] = true;
            var d = deps[n], i, l = d.length;
            for (i = 0; i < l; i += 1) {
                visit(d[i], n);
            }
            stack[n] = false;
            defined[n] = true;
            sorted.push(n);
        }
        list.forEach(visit);
        return sorted;
    }

    function createCMakeLists(typed) {
        var path = cmakeListPath, content;
        content = "set(LIBJSFILES\n" +
                // include webodfversion.js before runtime.js, latter uses var from the first
                "    ${CMAKE_BINARY_DIR}/webodf/webodfversion.js\n" +
                "    lib/runtime.js\n    lib/" +
                typed.join("\n    lib/") + "\n)\n";
        saveIfDifferent(path, content, function () {
            console.log("JS file dependencies were updated.");
            exitCode = 1;
        });
    }

    /**
     * Replace the platform-specific file separator with forward slash '/'
     * @param {!string} path
     * @return {!string}
     */
    function deNormalizePath(path) {
        return path.replace(pathModule.sep, "/");
    }

    function updateCMakeLists(deps) {
        var lib = deps.lib,
            sortedTyped,
            compiledFiles;
        compiledFiles = Object.keys(lib).filter(function (path) {
            return ignoredFiles.indexOf(deNormalizePath(path)) === -1;
        }).sort();
        sortedTyped = createOrderedList(compiledFiles, lib, {});
        createCMakeLists(sortedTyped.map(deNormalizePath));
    }

    function updateKarmaConfig(deps) {
        var path = "tools/karma.conf.js",
            lib = deps.lib,
            modules = createOrderedList(Object.keys(deps.lib).sort(), lib, {});
        fs.readFile(path, "utf8", function (err, content) {
            if (err) {
                throw err;
            }
            var re = new RegExp("// MODULES\r?\n[^!]+!");
            content = content.replace(re,
                "// MODULES\n            'lib/" +
                modules.map(deNormalizePath)
                        .join("',\n            'lib/") + "', // !");
            saveIfDifferent(path, content, function () {
                console.log("karma.conf.js was updated. Rerun the build.");
            });
        });
    }

    /**
     * Deterministic serialization of manifest.
     * JSON.stringify does not order objects by key.
     */
    function serializeManifest(manifest) {
        var out = "{\n",
            list = Object.keys(manifest).sort(),
            a,
            i,
            j;
        for (j = 0; j < list.length; j += 1) {
            a = manifest[list[j]];
            out += '    "' + className(list[j]) + '": [\n';
            for (i = 0; i < a.length; i += 1) {
                out += '        "' + className(a[i]);
                out += i === a.length - 1 ? '"\n' : '",\n';
            }
            out += j === list.length - 1 ? '    ]\n' : '    ],\n';
        }
        out += "}";
        return out;
    }

    /**
     * Remove dependencies that depend on other dependencies.
     * @param {!Object.<string,!Array.<string>>} deps
     */
    function reduce(deps) {
        // return true if a depends on b
        function dependsOn(a, b) {
            return a === b || deps[b].some(function (c) {
                return dependsOn(a, c);
            });
        }
        Object.keys(deps).forEach(function (key) {
            var d = deps[key],
                i = 0,
                dep,
                redundant;
            function f(a) {
                return dep !== a && dependsOn(dep, a);
            }
            while (i < d.length) {
                dep = d[i];
                redundant = d.some(f);
                if (redundant) {
                    d.splice(i, 1);
                } else {
                    i += 1;
                }
            }
        });
    }

    /**
     * @param {!Object.<string,string>}
     * @param {!Array.<string>}
     * @return {!Object.<string,!Array.<string>>}
     */
    this.createManifestsAndCMakeLists = function (files, dirs) {
        var list = Object.keys(files),
            classes = {},
            paths = {},
            defines = {},
            occs = {},
            deps = {},
            classname,
            d,
            i,
            j;
        list.sort();
        // make map with classname as key and file content as value
        list.forEach(function (path) {
            var k, dir, name;
            for (k = 0; k < dirs.length; k += 1) {
                dir = dirs[k];
                if (path.indexOf(dir) === 0) {
                    name = className(path.substr(dir.length));
                    if (classes.hasOwnProperty(name)) {
                        throw name + " occurs more than once.";
                    }
                    classes[name] = files[path];
                    defines[name] = getTopLevelDefines(path, files[path]);
                    paths[name] = path;
                }
            }
        });
        list = Object.keys(classes);
        for (i = 0; i < list.length; i += 1) {
            occs[list[i]] = [];
        }
        for (i = 0; i < list.length; i += 1) {
            classname = list[i];
            d = defines[classname];
            findOccurances(classname, d, classes, occs);
        }
        function prefixDir(cn) {
            var p = paths[cn],
                n = p.indexOf(pathModule.sep);
            return p.substr(n + 1);
        }
        for (classname in occs) {
            if (occs.hasOwnProperty(classname)) {
                d = paths[classname];
                i = d.indexOf(pathModule.sep);
                j = d.substr(i + 1);
                i = d.substr(0, i);
                d = deps[i] = deps[i] || {};
                d[j] = occs[classname].map(prefixDir).sort();
            }
        }
        saveIfDifferent(pathModule.join(buildDir, "dependencies-full.dot"),
                createDotFile(deps.lib, files));
        reduce(deps.lib);
        saveIfDifferent(pathModule.join(buildDir, "dependencies.dot"),
                createDotFile(deps.lib, files));
        for (i = 0; i < dirs.length; i += 1) {
            d = dirs[i];
            j = deps[d.split(pathModule.sep)[0]];
            saveIfDifferent(d + "/manifest.json", serializeManifest(j));
        }
        updateCMakeLists(deps);
        updateKarmaConfig(deps);
    };

    /**
     * Load content of a directory recursively.
     * Directories are listed as Objects and files are read as text and stored
     * as strings.
     * The filter allows loading only a subset of files based on file or
     * directory name.
     * @param {!Array.<string>} dirs
     * @param {function(string,boolean):boolean} filter
     * @param {function(!Object}:undefined} callback
     * @return {undefined}
     */
    this.readFiles = function (dirs, filter, callback) {
        var contents = {},
            read;
        function readMore() {
            var done = true,
                p,
                content;
            for (p in contents) {
                if (contents.hasOwnProperty(p)) {
                    content = contents[p];
                    if (content === undefined) {
                        contents[p] = null; // null means it's loading
                        read(p);
                    }
                    if (content === null || content === undefined) {
                        done = false;
                    }
                }
            }
            if (done) {
                callback(contents);
            }
        }
        function readFile(filepath) {
            fs.readFile(filepath, "utf8", function (err, data) {
                if (err) {
                    throw err;
                }
                contents[filepath] = data;
                readMore();
            });
        }
        function readDirectory(dirpath) {
            fs.readdir(dirpath, function (err, files) {
                if (err) {
                    throw err;
                }
                var i;
                files.sort();
                for (i = 0; i < files.length; i += 1) {
                    contents[pathModule.join(dirpath, files[i])] = undefined;
                }
                contents[dirpath] = files;
                readMore();
            });
        }
        read = function (p) {
            fs.stat(p, function (err, stats) {
                if (err) {
                    throw err;
                }
                var ok = filter(p, stats.isFile());
                if (ok && stats.isFile()) {
                    readFile(p);
                } else if (ok && stats.isDirectory()) {
                    readDirectory(p);
                } else {
                    contents[p] = -1;
                    readMore();
                }
            });
        };
        dirs.forEach(function (dir) {
            contents[dir] = undefined;
        });
        readMore();
    };

    jslintconfig = {
        ass:        false, // if assignment expressions should be allowed
        bitwise:    false, // if bitwise operators should be allowed
        browser:    false, // if the standard browser globals should be predefined
        closure:    true,  // if Google Closure idioms should be tolerated
        'continue': false, // if the continuation statement should be tolerated
        debug:      false, // if debugger statements should be allowed
        defined:    false, // if already defined variables are allowed
        devel:      false, // if logging should be allowed (console, alert, etc.)
        emptyblock: false, // if empty blocks should be allowed
        eqeq:       false, // if == should be allowed
        evil:       false, // if eval should be allowed
        forin:      false, // if for in statements need not filter
        indent:     4, //the indentation factor
        maxerr:     20, //the maximum number of errors to allow
        //maxlen:   300  the maximum length of a source line
        newcap:     false, // if constructor names capitalization is ignored
        node:       false, // if Node.js globals should be predefined
        nomen:      false, // if names may have dangling _
        passfail:   false, // if the scan should stop on first error
        plusplus:   false, // if increment/decrement should be allowed
        properties: false, // if all property names must be declared with /*properties*/
        regexp:     false, // if the . should be allowed in regexp literals
        rhino:      false, // if the Rhino environment globals should be predefined
        unparam:    false, // if unused parameters should be tolerated
        sloppy:     false, // if the 'use strict'; pragma is optional
        stupid:     true,  // if really stupid practices are tolerated
        sub:        false, // if all forms of subscript notation are tolerated
        todo:       true,  // if TODO comments are tolerated
        unvar:      false, // if unused variables should be tolerated
        vars:       false, // if multiple var statements per function should be allowed
        white:      true   // if sloppy whitespace is tolerated
    };

    function mkdir(path) {
        if (fs.existsSync(path)) {
            return;
        }
        var parent = pathModule.dirname(path);
        mkdir(parent);
        fs.mkdirSync(path);
    }

    function runJSLint(jslint, path, contents) {
        var lpath = pathModule.join(buildDir, "jslint", path);
        // checking jslint is quite slow, so only do it if the file content is
        // different from the file content at the previous successful run.
        fs.readFile(lpath, "utf8", function (err, data) {
            if (data === contents) {
                return;
            }
            var result, i, errors;
            result = jslint(contents, jslintconfig);
            if (result) {
                // The file has no errors, save it so it will be skipped at the
                // next run.
                mkdir(pathModule.dirname(lpath));
                fs.writeFile(lpath, contents);
            } else {
                errors = jslint.errors;
                for (i = 0; i < errors.length && errors[i]; i += 1) {
                    err = errors[i];
                    console.log(path + ":" + err.line + ":" + err.character +
                          ": error: " + err.reason);
                }
                exitCode = 1;
            }
        });
    }

    /**
     * @param {!string} path
     * @param {!string} content
     * @return {!string}
     */
    function getLicense(path, content) {
        var re = new RegExp("^(/[^]*?)(Copyright.*?>)+([^]*?) \\*/", "m"),
            lic,
            match;
        match = re.exec(content);
        if (match === null) {
            console.log("No license was found for " + path);
            process.exit(1);
        }
        lic = match[1] + match[3];
        return lic;
    }

    /**
     * @param {!Object.<!string,!string>} contents
     * @return {undefined}
     */
    this.checkJSFiles = function (contents) {
        var core = {},
            jslint,
            path,
            license,
            licenses = {},
            // files for which jslint is not run
            jslintExceptions = ["lib/core/RawInflate.js"].map(pathModule.normalize),
            // files for which the license is not checked
            licenseExceptions = [
                "lib/HeaderCompiled.js",
                "lib/core/JSLint.js",
                "lib/core/RawInflate.js"].map(pathModule.normalize),
            commonLicense;
        // load JSLint
        /*jslint evil: true*/
        eval(contents[pathModule.normalize("lib/core/JSLint.js")]);
        /*jslint evil: false*/
        jslint = new core.JSLint().JSLINT;
        for (path in contents) {
            if (contents.hasOwnProperty(path)
                    && typeof contents[path] === "string") {
                // run jslint of the content of a file
                if (jslintExceptions.indexOf(path) === -1) {
                    runJSLint(jslint, path, contents[path]);
                }
                // collect the license from the file
                if (licenseExceptions.indexOf(path) === -1) {
                    license = getLicense(path, contents[path]);
                    if (licenses.hasOwnProperty(license)) {
                        licenses[license].push(path);
                    } else {
                        licenses[license] = [path];
                    }
                }
            }
        }
        // determine which license is used most often
        commonLicense = Object.keys(licenses).reduce(function (prev, current) {
            var value = licenses[current];
            if (value.length > prev.count) {
                prev = {license: current, count: value.length, path: value};
            }
            return prev;
        }, {license: "", count: 0});
        // report any license that is different from the most common license
        for (license in licenses) {
            if (licenses.hasOwnProperty(license) && license !== commonLicense.license) {
                console.log(licenses[license] + " has an uncommon license.");
                process.exit(1);
            }
        }
    };
}

function main(f) {
    "use strict";
    var pathModule = require("path");
    // recursively read all the files in the lib and tests directories
    f.readFiles(["lib", "tests"], function (name, isfile) {
        // only read directories and js files
        return !isfile || name.indexOf(".js") === name.length - 3;
    }, function (contents) {
        var files = {};
        f.checkJSFiles(contents);
        // remove files that should not go in the manifest.json files
        delete contents[pathModule.normalize("lib/HeaderCompiled.js")];
        delete contents[pathModule.normalize("lib/runtime.js")];
        delete contents[pathModule.normalize("lib/core/JSLint.js")];
        delete contents[pathModule.normalize("tests/tests.js")];
        Object.keys(contents).forEach(function (name) {
            if (typeof contents[name] === "string") {
                files[name] = contents[name];
            }
        });
        f.createManifestsAndCMakeLists(files, ["lib" + pathModule.sep, "tests" + pathModule.sep]);
    });
    process.on("uncaughtException", function (err) {
        console.log(err);
        throw err;
    });
    process.on('exit', function () {
        process.exit(exitCode);
    });
}

main(new Main(process.argv[3]));


text:
require 'spec_helper'

describe Rackdis::API do
  include Rack::Test::Methods

  subject(:response) { j2o last_response.body }
  let(:r)            { redis_connection }
  let(:key)          { "test:hello" }
  after(:each)       { r.del key }

  describe "Key operations" do

    describe "GET" do
      it "should give null for unset values" do
        get "/v1/get/#{key}"
        expect(response.result).to eq nil
      end

      it "should get a value that is set" do
        r.set(key, "world")
        # pry
        get "/v1/get/#{key}"
        expect(response.result).to eq "world"
      end

    end

    describe "SET" do
      it "should set a value" do
        get "/v1/set/#{key}/world"
        expect(r.get(key)).to eq "world"
      end

      it "should override a key" do
        get "/v1/set/#{key}/world"
        get "/v1/set/#{key}/bob"
        expect(r.get(key)).to eq "bob"
      end
    end

    describe "INCR" do
      it "should increment a value" do
        get "/v1/incr/#{key}"
        get "/v1/incr/#{key}"
        get "/v1/incr/#{key}"
        expect(r.get key).to eq "3"
      end

      it "should return the incremented value" do
        get "/v1/incr/#{key}"
        get "/v1/incr/#{key}"
        get "/v1/incr/#{key}"
        expect(response.result).to eq 3
      end
    end
  end

  describe "Sets operations" do

    describe "SMEMBERS" do

      context "when there are no memebers" do
        it "should return an empty array" do
          get "/v1/smembers/#{key}"
          expect(response.result).to eq []
        end
      end

      context "when there are members" do
        it "should return them" do
          r.sadd key, "world"
          get "/v1/smembers/#{key}"
          expect(response.result).to eq ["world"]
        end
      end

    end

    describe "SADD" do

      it "should add single member" do
        expect { get "/v1/sadd/#{key}/world" }.to change { r.scard key }.by(1)
      end

      it "should add multiple members" do
        expect { get "/v1/sadd/#{key}/tom/dick/harry" }.to change { r.scard key }.by(3)
      end

    end
  end
end


text:
title: "Built-in Filters"
product: "Sensu Enterprise"
version: "2.7"
weight: 8
menu: "sensu-enterprise-2.7"
---
**ENTERPRISE: Built-in filters are available for [Sensu Enterprise][0]
users only.**

## Reference documentation

- [What are built-in filters?](#what-are-built-in-filters)
- [Using built-in filters](#using-built-in-filters)
- [Using multiple built-in filters](#using-multiple-built-in-filters)

## What are built-in filters?

Sensu Enterprise has several built-in event filters, used by many of the
third-party integrations, and made available to standard Sensu event handlers.
These enterprise filters can be used to combat alert fatigue.

## Built-in filters {#using-built-in-filters}

Please refer to the reference documentation for each of the following built-in
filters for more information on how to use them:

- [`handle_when`](../filters/handle-when)
- [`silence_stashes`](../filters/silence-stashes)
- [`check_dependencies`](../filters/check-dependencies)

### Using multiple built-in filters

Multiple enterprise filters can be applied to standard Sensu event handlers. The
following example event handler uses the `handle_when` and `silence_stashes`
event filters.

{{< code json >}}
{
  "handlers": {
    "custom_mailer": {
      "type": "pipe",
      "command": "custom_mailer.rb",
      "filters": [
        "handle_when",
        "silence_stashes"
      ]
    }
  }
}
{{< /code >}}

[0]:  /sensu-enterprise


text:
package com.github.games647.scoreboardstats.pvp;

import com.zaxxer.hikari.HikariConfig;

import java.nio.file.Files;
import java.nio.file.Path;

import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;

/**
 * Configuration for the SQL database.
 *
 * @see Database
 */
class DatabaseConfiguration {

    private final Plugin plugin;

    private HikariConfig serverConfig;
    private String tablePrefix;

    DatabaseConfiguration(Plugin instance) {
        plugin = instance;
    }

    /**
     * Get the SQL configuration
     *
     * @return the server configuration
     */
    public HikariConfig getServerConfig() {
        return serverConfig;
    }

    public String getTablePrefix() {
        return tablePrefix;
    }

    /**
     * Loads the configuration
     */
    public void loadConfiguration() {
        serverConfig = new HikariConfig();

        Path file = plugin.getDataFolder().toPath().resolve("sql.yml");
        //Check if the file exists. If so load the settings form there
        if (Files.notExists(file)) {
            //Create a new configuration based on the default settings form bukkit.yml
            plugin.saveResource("sql.yml", false);
        }

        FileConfiguration sqlConfig = YamlConfiguration.loadConfiguration(file.toFile());

        ConfigurationSection sqlSettingSection = sqlConfig.getConfigurationSection("SQL-Settings");
        serverConfig.setUsername(sqlSettingSection.getString("Username"));
        serverConfig.setPassword(sqlSettingSection.getString("Password"));
        serverConfig.setDriverClassName(sqlSettingSection.getString("Driver"));
        serverConfig.setJdbcUrl(replaceUrlString(sqlSettingSection.getString("Url")));
        if (serverConfig.getDriverClassName().contains("sqlite")) {
            serverConfig.setConnectionTestQuery("SELECT 1");
        }

        tablePrefix = sqlSettingSection.getString("tablePrefix", "");
    }

    private String replaceUrlString(String input) {
        //Replace the windows separators ('\') with a '/'; \\ escape regEx --> \\\\ escape java
        String result = input.replaceAll("\\{DIR\\}", plugin.getDataFolder().getPath().replaceAll("\\\\", "/") + '/');
        result = result.replaceAll("\\{NAME\\}", plugin.getDescription().getName().replaceAll("[^\\w-]", ""));

        return result;
    }
}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.6
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2013.12.25 at 12:17:54 PM CST
//

package ca.ieso.reports.schema.trapreauctionhzmcpmonthly;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for anonymous complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence maxOccurs="unbounded">
 *         <element ref="{http://www.ieso.ca/schema}DocHeader"/>
 *         <element ref="{http://www.ieso.ca/schema}DocBody"/>
 *       </sequence>
 *       <attribute name="docID" type="{http://www.ieso.ca/schema}docID" />
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "docHeaderAndDocBody"
})
@XmlRootElement(name = "Document")
public class Document {

    @XmlElements({
        @XmlElement(name = "DocHeader", required = true, type = DocHeader.class),
        @XmlElement(name = "DocBody", required = true, type = DocBody.class)
    })
    protected List<Object> docHeaderAndDocBody;
    @XmlAttribute(name = "docID")
    protected String docID;

    /**
     * Gets the value of the docHeaderAndDocBody property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the docHeaderAndDocBody property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getDocHeaderAndDocBody().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link DocHeader }
     * {@link DocBody }
     *
     *
     */
    public List<Object> getDocHeaderAndDocBody() {
        if (docHeaderAndDocBody == null) {
            docHeaderAndDocBody = new ArrayList<Object>();
        }
        return this.docHeaderAndDocBody;
    }

    /**
     * Gets the value of the docID property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDocID() {
        return docID;
    }

    /**
     * Sets the value of the docID property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDocID(String value) {
        this.docID = value;
    }

}


text:
package com.showka.web.u11;

import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

import com.showka.web.FormBase;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@NoArgsConstructor
@Getter
@Setter
public class U11G001Form extends FormBase {
	/** SID. */
	private static final long serialVersionUID = -8203759953854456473L;
	/** 部署コード. */
	private String bushoCode;
	/** 商品移動日. */
	@DateTimeFormat(pattern = "yyyy/MM/dd")
	private Date date;
}


text:
package com.limemobile.app.blog.weibo.tencent.api.lbs;

import android.view.ViewGroup;

import com.limemobile.app.blog.weibo.TencentWeibo;
import com.limemobile.app.blog.weibo.tencent.api.ILoadListener;
import com.limemobile.app.blog.weibo.tencent.api.IResultListener;
import com.limemobile.app.blog.weibo.tencent.api.Result;
import com.limemobile.app.blog.weibo.tencent.api.TAsyncTask;
import com.limemobile.app.blog.weibo.tencent.entity.Entity;
import com.limemobile.app.blog.weibo.tencent.entity.TObject;
import com.limemobile.app.blog.weibo.tencent.entity.lbs.AroundPeople;
import com.loopj.android.http.JSONObjectProxy;
import com.tencent.weibo.api.LBSAPI;

/**
 * 获取身边的人
 *
 * @param longitude String 经度,例如:22.541321
 * @param latitude String 纬度,例如:13.935558
 * @param pageinfo String 翻页参数,由上次请求返回(第一次请求时请填空)
 * @param pagesize Integer 请求的每页个数(1-25个)
 * @param gender Integer 性别,0-全部,1-男,2-女
 */
public class GetAroundPeopleTask extends TAsyncTask<AroundPeople> {
    public GetAroundPeopleTask(ILoadListener loadListener, IResultListener successListener) {
        this(null, loadListener, successListener);
    }

    public GetAroundPeopleTask(ViewGroup container, ILoadListener loadListener,
            IResultListener successListener) {
        super(container, loadListener, successListener);
    }

    @Override
    public String callAPI(Object... params) {
        assert (params.length == 5);
        String longitude = (String) params[0];
        String latitude = (String) params[1];
        String pageinfo = (String) params[2];
        String pagesize = Integer.toString((Integer) params[3]);
        String gender = Integer.toString((Integer) params[4]);

        LBSAPI lbsAPI = new LBSAPI(TencentWeibo.getInstance().getOauthVersion());
        String response = null;
        try {
            response = lbsAPI.get_around_people(TencentWeibo.getInstance(), TencentWeibo.JSON, longitude,
                    latitude, pageinfo, pagesize, gender);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            lbsAPI.shutdownConnection();
        }
        return response;
    }

    @Override
    public boolean parse(Entity<TObject> data, JSONObjectProxy object) {
        JSONObjectProxy dataObject = object.getJSONObjectOrNull(Result.DATA_KEY);
        if (dataObject != null) {
            data.data = new AroundPeople();
            data.data.parse(dataObject);

            return true;
        }
        return false;
    }
}


text:
package org.mosspaper.objects;

import android.util.Log;

import org.mosspaper.Env;
import org.mosspaper.ParseException;

import java.util.IllegalFormatException;

public class Printf extends AbsMossObject implements MossObject {

    static final String TAG = "Printf";

    /**
     * Accepts a format string and other text objects.
     *
     * @param format a format string as describe in...
     * @param objects a variable list of text objects
     */
    public Printf(String format, Object... objects) throws ParseException {
        this.format = format;
        this.objects = objects;
        for (Object o : objects) {
            if (o instanceof MossObject
                    && !(o instanceof AbsMossObject)) {
                throw new ParseException("Incorrect type");
            }
        }
    }

    public DataProvider getDataProvider() {
        /* XXX: this only works for one */
        for (Object o : objects) {
            if (o instanceof MossObject) {
                MossObject ms = (MossObject)o;
                if (ms.getDataProvider() != null) {
                    return ms.getDataProvider();
                }
            }
        }
        return null;
    }

    public void preDraw(Env env) {
        for (Object o : objects) {
            if (o instanceof MossObject) {
                ((MossObject) o).preDraw(env);
            }
        }
    }

    public void postDraw(Env env) {
        for (Object o : objects) {
            if (o instanceof MossObject) {
                ((MossObject) o).postDraw(env);
            }
        }
    }

    @Override
    public String toString() {
        String[] strs = new String[objects.length];
        for (int i = 0; i < objects.length; i++) {
            if (null != objects[i]) {
                strs[i] = nvl(objects[i].toString(), "");
            } else {
                strs[i] = "";
            }
        }
        try {
            return String.format(format, (Object[]) strs);
        } catch (IllegalFormatException e) {
            Log.e(TAG, "", e);
        } catch (NullPointerException e) {
            Log.e(TAG, "", e);
        }
        return "";
    }

    private String nvl(String s1, String s2) {
        if (null == s1) {
            return s2;
        } else {
            return s1;
        }
    }

    private String format;
    private Object[] objects;
}


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

<title>R.drawable</title>
<meta name="date" content="2017-04-03">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

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.psychic_engine.cmput301w17t10.feelsappman

Class R.drawable

java.lang.Object

com.psychic_engine.cmput301w17t10.feelsappman.R.drawable

Enclosing class:

R

public static final class R.drawable
extends java.lang.Object

Field Summary

Fields

Modifier and Type
Field and Description

static int
abc_ab_share_pack_mtrl_alpha

static int
abc_action_bar_item_background_material

static int
abc_btn_borderless_material

static int
abc_btn_check_material

static int
abc_btn_check_to_on_mtrl_000

static int
abc_btn_check_to_on_mtrl_015

static int
abc_btn_colored_material

static int
abc_btn_default_mtrl_shape

static int
abc_btn_radio_material

static int
abc_btn_radio_to_on_mtrl_000

static int
abc_btn_radio_to_on_mtrl_015

static int
abc_btn_switch_to_on_mtrl_00001

static int
abc_btn_switch_to_on_mtrl_00012

static int
abc_cab_background_internal_bg

static int
abc_cab_background_top_material

static int
abc_cab_background_top_mtrl_alpha

static int
abc_control_background_material

static int
abc_dialog_material_background

static int
abc_edit_text_material

static int
abc_ic_ab_back_material

static int
abc_ic_arrow_drop_right_black_24dp

static int
abc_ic_clear_material

static int
abc_ic_commit_search_api_mtrl_alpha

static int
abc_ic_go_search_api_material

static int
abc_ic_menu_copy_mtrl_am_alpha

static int
abc_ic_menu_cut_mtrl_alpha

static int
abc_ic_menu_overflow_material

static int
abc_ic_menu_paste_mtrl_am_alpha

static int
abc_ic_menu_selectall_mtrl_alpha

static int
abc_ic_menu_share_mtrl_alpha

static int
abc_ic_search_api_material

static int
abc_ic_star_black_16dp

static int
abc_ic_star_black_36dp

static int
abc_ic_star_black_48dp

static int
abc_ic_star_half_black_16dp

static int
abc_ic_star_half_black_36dp

static int
abc_ic_star_half_black_48dp

static int
abc_ic_voice_search_api_material

static int
abc_item_background_holo_dark

static int
abc_item_background_holo_light

static int
abc_list_divider_mtrl_alpha

static int
abc_list_focused_holo

static int
abc_list_longpressed_holo

static int
abc_list_pressed_holo_dark

static int
abc_list_pressed_holo_light

static int
abc_list_selector_background_transition_holo_dark

static int
abc_list_selector_background_transition_holo_light

static int
abc_list_selector_disabled_holo_dark

static int
abc_list_selector_disabled_holo_light

static int
abc_list_selector_holo_dark

static int
abc_list_selector_holo_light

static int
abc_menu_hardkey_panel_mtrl_mult

static int
abc_popup_background_mtrl_mult

static int
abc_ratingbar_indicator_material

static int
abc_ratingbar_material

static int
abc_ratingbar_small_material

static int
abc_scrubber_control_off_mtrl_alpha

static int
abc_scrubber_control_to_pressed_mtrl_000

static int
abc_scrubber_control_to_pressed_mtrl_005

static int
abc_scrubber_primary_mtrl_alpha

static int
abc_scrubber_track_mtrl_alpha

static int
abc_seekbar_thumb_material

static int
abc_seekbar_tick_mark_material

static int
abc_seekbar_track_material

static int
abc_spinner_mtrl_am_alpha

static int
abc_spinner_textfield_background_material

static int
abc_switch_thumb_material

static int
abc_switch_track_mtrl_alpha

static int
abc_tab_indicator_material

static int
abc_tab_indicator_mtrl_alpha

static int
abc_text_cursor_material

static int
abc_text_select_handle_left_mtrl_dark

static int
abc_text_select_handle_left_mtrl_light

static int
abc_text_select_handle_middle_mtrl_dark

static int
abc_text_select_handle_middle_mtrl_light

static int
abc_text_select_handle_right_mtrl_dark

static int
abc_text_select_handle_right_mtrl_light

static int
abc_textfield_activated_mtrl_alpha

static int
abc_textfield_default_mtrl_alpha

static int
abc_textfield_search_activated_mtrl_alpha

static int
abc_textfield_search_default_mtrl_alpha

static int
abc_textfield_search_material

static int
abc_vector_test

static int
anger

static int
angermarker

static int
avd_hide_password

static int
avd_hide_password_1

static int
avd_hide_password_2

static int
avd_hide_password_3

static int
avd_show_password

static int
avd_show_password_1

static int
avd_show_password_2

static int
avd_show_password_3

static int
bonuspack_bubble

static int
btn_moreinfo

static int
center

static int
common_full_open_on_phone

static int
common_google_signin_btn_icon_dark

static int
common_google_signin_btn_icon_dark_focused

static int
common_google_signin_btn_icon_dark_normal

static int
common_google_signin_btn_icon_dark_normal_background

static int
common_google_signin_btn_icon_disabled

static int
common_google_signin_btn_icon_light

static int
common_google_signin_btn_icon_light_focused

static int
common_google_signin_btn_icon_light_normal

static int
common_google_signin_btn_icon_light_normal_background

static int
common_google_signin_btn_text_dark

static int
common_google_signin_btn_text_dark_focused

static int
common_google_signin_btn_text_dark_normal

static int
common_google_signin_btn_text_dark_normal_background

static int
common_google_signin_btn_text_disabled

static int
common_google_signin_btn_text_light

static int
common_google_signin_btn_text_light_focused

static int
common_google_signin_btn_text_light_normal

static int
common_google_signin_btn_text_light_normal_background

static int
confused

static int
confusedmarker

static int
design_bottom_navigation_item_background

static int
design_fab_background

static int
design_ic_visibility

static int
design_ic_visibility_off

static int
design_password_eye

static int
design_snackbar_background

static int
direction_arrow

static int
disgusted

static int
disgustmarker

static int
fear

static int
fearmarker

static int
googleg_disabled_color_18

static int
googleg_standard_color_18

static int
happy

static int
happymarker

static int
ic_add_black_24dp

static int
ic_add_white_24dp

static int
ic_menu_compass

static int
ic_menu_mapmode

static int
ic_menu_mylocation

static int
ic_menu_offline

static int
marker_default

static int
marker_default_focused_base

static int
moreinfo_arrow

static int
moreinfo_arrow_pressed

static int
navigation_empty_icon

static int
navto_small

static int
next

static int
notification_action_background

static int
notification_bg

static int
notification_bg_low

static int
notification_bg_low_normal

static int
notification_bg_low_pressed

static int
notification_bg_normal

static int
notification_bg_normal_pressed

static int
notification_icon_background

static int
notification_template_icon_bg

static int
notification_template_icon_low_bg

static int
notification_tile_bg

static int
notify_panel_notification_icon_bg

static int
person

static int
previous

static int
returnbutton1

static int
rounded_button

static int
sad

static int
sadmarker

static int
shame

static int
shamemarker

static int
ss_alone

static int
ss_crowd

static int
ss_oneother

static int
ss_two_to_several

static int
surprised

static int
surprisedmarker

static int
zoom_in

static int
zoom_out

Constructor Summary

Constructors

Constructor and Description

drawable()

Method Summary

Methods inherited from class java.lang.Object

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

Field Detail

abc_ab_share_pack_mtrl_alpha

public static final int abc_ab_share_pack_mtrl_alpha

See Also:

Constant Field Values

abc_action_bar_item_background_material

public static final int abc_action_bar_item_background_material

See Also:

Constant Field Values

abc_btn_borderless_material

public static final int abc_btn_borderless_material

See Also:

Constant Field Values

abc_btn_check_material

public static final int abc_btn_check_material

See Also:

Constant Field Values

abc_btn_check_to_on_mtrl_000

public static final int abc_btn_check_to_on_mtrl_000

See Also:

Constant Field Values

abc_btn_check_to_on_mtrl_015

public static final int abc_btn_check_to_on_mtrl_015

See Also:

Constant Field Values

abc_btn_colored_material

public static final int abc_btn_colored_material

See Also:

Constant Field Values

abc_btn_default_mtrl_shape

public static final int abc_btn_default_mtrl_shape

See Also:

Constant Field Values

abc_btn_radio_material

public static final int abc_btn_radio_material

See Also:

Constant Field Values

abc_btn_radio_to_on_mtrl_000

public static final int abc_btn_radio_to_on_mtrl_000

See Also:

Constant Field Values

abc_btn_radio_to_on_mtrl_015

public static final int abc_btn_radio_to_on_mtrl_015

See Also:

Constant Field Values

abc_btn_switch_to_on_mtrl_00001

public static final int abc_btn_switch_to_on_mtrl_00001

See Also:

Constant Field Values

abc_btn_switch_to_on_mtrl_00012

public static final int abc_btn_switch_to_on_mtrl_00012

See Also:

Constant Field Values

abc_cab_background_internal_bg

public static final int abc_cab_background_internal_bg

See Also:

Constant Field Values

abc_cab_background_top_material

public static final int abc_cab_background_top_material

See Also:

Constant Field Values

abc_cab_background_top_mtrl_alpha

public static final int abc_cab_background_top_mtrl_alpha

See Also:

Constant Field Values

abc_control_background_material

public static final int abc_control_background_material

See Also:

Constant Field Values

abc_dialog_material_background

public static final int abc_dialog_material_background

See Also:

Constant Field Values

abc_edit_text_material

public static final int abc_edit_text_material

See Also:

Constant Field Values

abc_ic_ab_back_material

public static final int abc_ic_ab_back_material

See Also:

Constant Field Values

abc_ic_arrow_drop_right_black_24dp

public static final int abc_ic_arrow_drop_right_black_24dp

See Also:

Constant Field Values

abc_ic_clear_material

public static final int abc_ic_clear_material

See Also:

Constant Field Values

abc_ic_commit_search_api_mtrl_alpha

public static final int abc_ic_commit_search_api_mtrl_alpha

See Also:

Constant Field Values

abc_ic_go_search_api_material

public static final int abc_ic_go_search_api_material

See Also:

Constant Field Values

abc_ic_menu_copy_mtrl_am_alpha

public static final int abc_ic_menu_copy_mtrl_am_alpha

See Also:

Constant Field Values

abc_ic_menu_cut_mtrl_alpha

public static final int abc_ic_menu_cut_mtrl_alpha

See Also:

Constant Field Values

abc_ic_menu_overflow_material

public static final int abc_ic_menu_overflow_material

See Also:

Constant Field Values

abc_ic_menu_paste_mtrl_am_alpha

public static final int abc_ic_menu_paste_mtrl_am_alpha

See Also:

Constant Field Values

abc_ic_menu_selectall_mtrl_alpha

public static final int abc_ic_menu_selectall_mtrl_alpha

See Also:

Constant Field Values

abc_ic_menu_share_mtrl_alpha

public static final int abc_ic_menu_share_mtrl_alpha

See Also:

Constant Field Values

abc_ic_search_api_material

public static final int abc_ic_search_api_material

See Also:

Constant Field Values

abc_ic_star_black_16dp

public static final int abc_ic_star_black_16dp

See Also:

Constant Field Values

abc_ic_star_black_36dp

public static final int abc_ic_star_black_36dp

See Also:

Constant Field Values

abc_ic_star_black_48dp

public static final int abc_ic_star_black_48dp

See Also:

Constant Field Values

abc_ic_star_half_black_16dp

public static final int abc_ic_star_half_black_16dp

See Also:

Constant Field Values

abc_ic_star_half_black_36dp

public static final int abc_ic_star_half_black_36dp

See Also:

Constant Field Values

abc_ic_star_half_black_48dp

public static final int abc_ic_star_half_black_48dp

See Also:

Constant Field Values

abc_ic_voice_search_api_material

public static final int abc_ic_voice_search_api_material

See Also:

Constant Field Values

abc_item_background_holo_dark

public static final int abc_item_background_holo_dark

See Also:

Constant Field Values

abc_item_background_holo_light

public static final int abc_item_background_holo_light

See Also:

Constant Field Values

abc_list_divider_mtrl_alpha

public static final int abc_list_divider_mtrl_alpha

See Also:

Constant Field Values

abc_list_focused_holo

public static final int abc_list_focused_holo

See Also:

Constant Field Values

abc_list_longpressed_holo

public static final int abc_list_longpressed_holo

See Also:

Constant Field Values

abc_list_pressed_holo_dark

public static final int abc_list_pressed_holo_dark

See Also:

Constant Field Values

abc_list_pressed_holo_light

public static final int abc_list_pressed_holo_light

See Also:

Constant Field Values

abc_list_selector_background_transition_holo_dark

public static final int abc_list_selector_background_transition_holo_dark

See Also:

Constant Field Values

abc_list_selector_background_transition_holo_light

public static final int abc_list_selector_background_transition_holo_light

See Also:

Constant Field Values

abc_list_selector_disabled_holo_dark

public static final int abc_list_selector_disabled_holo_dark

See Also:

Constant Field Values

abc_list_selector_disabled_holo_light

public static final int abc_list_selector_disabled_holo_light

See Also:

Constant Field Values

abc_list_selector_holo_dark

public static final int abc_list_selector_holo_dark

See Also:

Constant Field Values

abc_list_selector_holo_light

public static final int abc_list_selector_holo_light

See Also:

Constant Field Values

abc_menu_hardkey_panel_mtrl_mult

public static final int abc_menu_hardkey_panel_mtrl_mult

See Also:

Constant Field Values

abc_popup_background_mtrl_mult

public static final int abc_popup_background_mtrl_mult

See Also:

Constant Field Values

abc_ratingbar_indicator_material

public static final int abc_ratingbar_indicator_material

See Also:

Constant Field Values

abc_ratingbar_material

public static final int abc_ratingbar_material

See Also:

Constant Field Values

abc_ratingbar_small_material

public static final int abc_ratingbar_small_material

See Also:

Constant Field Values

abc_scrubber_control_off_mtrl_alpha

public static final int abc_scrubber_control_off_mtrl_alpha

See Also:

Constant Field Values

abc_scrubber_control_to_pressed_mtrl_000

public static final int abc_scrubber_control_to_pressed_mtrl_000

See Also:

Constant Field Values

abc_scrubber_control_to_pressed_mtrl_005

public static final int abc_scrubber_control_to_pressed_mtrl_005

See Also:

Constant Field Values

abc_scrubber_primary_mtrl_alpha

public static final int abc_scrubber_primary_mtrl_alpha

See Also:

Constant Field Values

abc_scrubber_track_mtrl_alpha

public static final int abc_scrubber_track_mtrl_alpha

See Also:

Constant Field Values

abc_seekbar_thumb_material

public static final int abc_seekbar_thumb_material

See Also:

Constant Field Values

abc_seekbar_tick_mark_material

public static final int abc_seekbar_tick_mark_material

See Also:

Constant Field Values

abc_seekbar_track_material

public static final int abc_seekbar_track_material

See Also:

Constant Field Values

abc_spinner_mtrl_am_alpha

public static final int abc_spinner_mtrl_am_alpha

See Also:

Constant Field Values

abc_spinner_textfield_background_material

public static final int abc_spinner_textfield_background_material

See Also:

Constant Field Values

abc_switch_thumb_material

public static final int abc_switch_thumb_material

See Also:

Constant Field Values

abc_switch_track_mtrl_alpha

public static final int abc_switch_track_mtrl_alpha

See Also:

Constant Field Values

abc_tab_indicator_material

public static final int abc_tab_indicator_material

See Also:

Constant Field Values

abc_tab_indicator_mtrl_alpha

public static final int abc_tab_indicator_mtrl_alpha

See Also:

Constant Field Values

abc_text_cursor_material

public static final int abc_text_cursor_material

See Also:

Constant Field Values

abc_text_select_handle_left_mtrl_dark

public static final int abc_text_select_handle_left_mtrl_dark

See Also:

Constant Field Values

abc_text_select_handle_left_mtrl_light

public static final int abc_text_select_handle_left_mtrl_light

See Also:

Constant Field Values

abc_text_select_handle_middle_mtrl_dark

public static final int abc_text_select_handle_middle_mtrl_dark

See Also:

Constant Field Values

abc_text_select_handle_middle_mtrl_light

public static final int abc_text_select_handle_middle_mtrl_light

See Also:

Constant Field Values

abc_text_select_handle_right_mtrl_dark

public static final int abc_text_select_handle_right_mtrl_dark

See Also:

Constant Field Values

abc_text_select_handle_right_mtrl_light

public static final int abc_text_select_handle_right_mtrl_light

See Also:

Constant Field Values

abc_textfield_activated_mtrl_alpha

public static final int abc_textfield_activated_mtrl_alpha

See Also:

Constant Field Values

abc_textfield_default_mtrl_alpha

public static final int abc_textfield_default_mtrl_alpha

See Also:

Constant Field Values

abc_textfield_search_activated_mtrl_alpha

public static final int abc_textfield_search_activated_mtrl_alpha

See Also:

Constant Field Values

abc_textfield_search_default_mtrl_alpha

public static final int abc_textfield_search_default_mtrl_alpha

See Also:

Constant Field Values

abc_textfield_search_material

public static final int abc_textfield_search_material

See Also:

Constant Field Values

abc_vector_test

public static final int abc_vector_test

See Also:

Constant Field Values

anger

public static final int anger

See Also:

Constant Field Values

angermarker

public static final int angermarker

See Also:

Constant Field Values

avd_hide_password

public static final int avd_hide_password

See Also:

Constant Field Values

avd_hide_password_1

public static final int avd_hide_password_1

See Also:

Constant Field Values

avd_hide_password_2

public static final int avd_hide_password_2

See Also:

Constant Field Values

avd_hide_password_3

public static final int avd_hide_password_3

See Also:

Constant Field Values

avd_show_password

public static final int avd_show_password

See Also:

Constant Field Values

avd_show_password_1

public static final int avd_show_password_1

See Also:

Constant Field Values

avd_show_password_2

public static final int avd_show_password_2

See Also:

Constant Field Values

avd_show_password_3

public static final int avd_show_password_3

See Also:

Constant Field Values

bonuspack_bubble

public static final int bonuspack_bubble

See Also:

Constant Field Values

btn_moreinfo

public static final int btn_moreinfo

See Also:

Constant Field Values

center

public static final int center

See Also:

Constant Field Values

common_full_open_on_phone

public static final int common_full_open_on_phone

See Also:

Constant Field Values

common_google_signin_btn_icon_dark

public static final int common_google_signin_btn_icon_dark

See Also:

Constant Field Values

common_google_signin_btn_icon_dark_focused

public static final int common_google_signin_btn_icon_dark_focused

See Also:

Constant Field Values

common_google_signin_btn_icon_dark_normal

public static final int common_google_signin_btn_icon_dark_normal

See Also:

Constant Field Values

common_google_signin_btn_icon_dark_normal_background

public static final int common_google_signin_btn_icon_dark_normal_background

See Also:

Constant Field Values

common_google_signin_btn_icon_disabled

public static final int common_google_signin_btn_icon_disabled

See Also:

Constant Field Values

common_google_signin_btn_icon_light

public static final int common_google_signin_btn_icon_light

See Also:

Constant Field Values

common_google_signin_btn_icon_light_focused

public static final int common_google_signin_btn_icon_light_focused

See Also:

Constant Field Values

common_google_signin_btn_icon_light_normal

public static final int common_google_signin_btn_icon_light_normal

See Also:

Constant Field Values

common_google_signin_btn_icon_light_normal_background

public static final int common_google_signin_btn_icon_light_normal_background

See Also:

Constant Field Values

common_google_signin_btn_text_dark

public static final int common_google_signin_btn_text_dark

See Also:

Constant Field Values

common_google_signin_btn_text_dark_focused

public static final int common_google_signin_btn_text_dark_focused

See Also:

Constant Field Values

common_google_signin_btn_text_dark_normal

public static final int common_google_signin_btn_text_dark_normal

See Also:

Constant Field Values

common_google_signin_btn_text_dark_normal_background

public static final int common_google_signin_btn_text_dark_normal_background

See Also:

Constant Field Values

common_google_signin_btn_text_disabled

public static final int common_google_signin_btn_text_disabled

See Also:

Constant Field Values

common_google_signin_btn_text_light

public static final int common_google_signin_btn_text_light

See Also:

Constant Field Values

common_google_signin_btn_text_light_focused

public static final int common_google_signin_btn_text_light_focused

See Also:

Constant Field Values

common_google_signin_btn_text_light_normal

public static final int common_google_signin_btn_text_light_normal

See Also:

Constant Field Values

common_google_signin_btn_text_light_normal_background

public static final int common_google_signin_btn_text_light_normal_background

See Also:

Constant Field Values

confused

public static final int confused

See Also:

Constant Field Values

confusedmarker

public static final int confusedmarker

See Also:

Constant Field Values

design_bottom_navigation_item_background

public static final int design_bottom_navigation_item_background

See Also:

Constant Field Values

design_fab_background

public static final int design_fab_background

See Also:

Constant Field Values

design_ic_visibility

public static final int design_ic_visibility

See Also:

Constant Field Values

design_ic_visibility_off

public static final int design_ic_visibility_off

See Also:

Constant Field Values

design_password_eye

public static final int design_password_eye

See Also:

Constant Field Values

design_snackbar_background

public static final int design_snackbar_background

See Also:

Constant Field Values

direction_arrow

public static final int direction_arrow

See Also:

Constant Field Values

disgusted

public static final int disgusted

See Also:

Constant Field Values

disgustmarker

public static final int disgustmarker

See Also:

Constant Field Values

fear

public static final int fear

See Also:

Constant Field Values

fearmarker

public static final int fearmarker

See Also:

Constant Field Values

googleg_disabled_color_18

public static final int googleg_disabled_color_18

See Also:

Constant Field Values

googleg_standard_color_18

public static final int googleg_standard_color_18

See Also:

Constant Field Values

happy

public static final int happy

See Also:

Constant Field Values

happymarker

public static final int happymarker

See Also:

Constant Field Values

ic_add_black_24dp

public static final int ic_add_black_24dp

See Also:

Constant Field Values

ic_add_white_24dp

public static final int ic_add_white_24dp

See Also:

Constant Field Values

ic_menu_compass

public static final int ic_menu_compass

See Also:

Constant Field Values

ic_menu_mapmode

public static final int ic_menu_mapmode

See Also:

Constant Field Values

ic_menu_mylocation

public static final int ic_menu_mylocation

See Also:

Constant Field Values

ic_menu_offline

public static final int ic_menu_offline

See Also:

Constant Field Values

marker_default

public static final int marker_default

See Also:

Constant Field Values

marker_default_focused_base

public static final int marker_default_focused_base

See Also:

Constant Field Values

moreinfo_arrow

public static final int moreinfo_arrow

See Also:

Constant Field Values

moreinfo_arrow_pressed

public static final int moreinfo_arrow_pressed

See Also:

Constant Field Values

navigation_empty_icon

public static final int navigation_empty_icon

See Also:

Constant Field Values

navto_small

public static final int navto_small

See Also:

Constant Field Values

next

public static final int next

See Also:

Constant Field Values

notification_action_background

public static final int notification_action_background

See Also:

Constant Field Values

notification_bg

public static final int notification_bg

See Also:

Constant Field Values

notification_bg_low

public static final int notification_bg_low

See Also:

Constant Field Values

notification_bg_low_normal

public static final int notification_bg_low_normal

See Also:

Constant Field Values

notification_bg_low_pressed

public static final int notification_bg_low_pressed

See Also:

Constant Field Values

notification_bg_normal

public static final int notification_bg_normal

See Also:

Constant Field Values

notification_bg_normal_pressed

public static final int notification_bg_normal_pressed

See Also:

Constant Field Values

notification_icon_background

public static final int notification_icon_background

See Also:

Constant Field Values

notification_template_icon_bg

public static final int notification_template_icon_bg

See Also:

Constant Field Values

notification_template_icon_low_bg

public static final int notification_template_icon_low_bg

See Also:

Constant Field Values

notification_tile_bg

public static final int notification_tile_bg

See Also:

Constant Field Values

notify_panel_notification_icon_bg

public static final int notify_panel_notification_icon_bg

See Also:

Constant Field Values

person

public static final int person

See Also:

Constant Field Values

previous

public static final int previous

See Also:

Constant Field Values

returnbutton1

public static final int returnbutton1

See Also:

Constant Field Values

rounded_button

public static final int rounded_button

See Also:

Constant Field Values

sad

public static final int sad

See Also:

Constant Field Values

sadmarker

public static final int sadmarker

See Also:

Constant Field Values

shame

public static final int shame

See Also:

Constant Field Values

shamemarker

public static final int shamemarker

See Also:

Constant Field Values

ss_alone

public static final int ss_alone

See Also:

Constant Field Values

ss_crowd

public static final int ss_crowd

See Also:

Constant Field Values

ss_oneother

public static final int ss_oneother

See Also:

Constant Field Values

ss_two_to_several

public static final int ss_two_to_several

See Also:

Constant Field Values

surprised

public static final int surprised

See Also:

Constant Field Values

surprisedmarker

public static final int surprisedmarker

See Also:

Constant Field Values

zoom_in

public static final int zoom_in

See Also:

Constant Field Values

zoom_out

public static final int zoom_out

See Also:

Constant Field Values

Constructor Detail

drawable

public drawable()

Skip navigation links

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


text:
package com.google.javascript.jscomp.deps;

import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.HashMultiset;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multimaps;
import com.google.common.collect.Multiset;
import com.google.common.collect.Sets;

import java.util.ArrayDeque;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Deque;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Set;

/**
 * A sorted list of inputs with dependency information. Uses a stable
 * topological sort to make sure that an input always comes after its
 * dependencies.
 *
 * Also exposes other information about the inputs, like which inputs
 * do not provide symbols.
 *
 * @author nicksantos@google.com (Nick Santos)
 */
public class SortedDependencies<INPUT extends DependencyInfo> {

  private final List<INPUT> inputs;

  // A topologically sorted list of the inputs.
  private final List<INPUT> sortedList;

  // A list of all the inputs that do not have provides.
  private final List<INPUT> noProvides;

  private final Map<String, INPUT> provideMap = Maps.newHashMap();

  public SortedDependencies(List<INPUT> inputs)
      throws CircularDependencyException {
    this.inputs = Lists.newArrayList(inputs);
    noProvides = Lists.newArrayList();

    // Collect all symbols provided in these files.
    for (INPUT input : inputs) {
      Collection<String> currentProvides = input.getProvides();
      if (currentProvides.isEmpty()) {
        noProvides.add(input);
      }

      for (String provide : currentProvides) {
        provideMap.put(provide, input);
      }
    }

    // Get the direct dependencies.
    final Multimap<INPUT, INPUT> deps = HashMultimap.create();
    for (INPUT input : inputs) {
      for (String req : input.getRequires()) {
        INPUT dep = provideMap.get(req);
        if (dep != null) {
          deps.put(input, dep);
        }
      }
    }

    // Sort the inputs by sucking in 0-in-degree nodes until we're done.
    sortedList = topologicalStableSort(inputs, deps);

    // The dependency graph of inputs has a cycle iff sortedList is a proper
    // subset of inputs. Also, it has a cycle iff the subgraph
    // (inputs - sortedList) has a cycle. It's fairly easy to prove this
    // by the lemma that a graph has a cycle iff it has a subgraph where
    // no nodes have out-degree 0. I'll leave the proof of this as an exercise
    // to the reader.
    if (sortedList.size() < inputs.size()) {
      List<INPUT> subGraph = Lists.newArrayList(inputs);
      subGraph.removeAll(sortedList);

      throw new CircularDependencyException(
          cycleToString(findCycle(subGraph, deps)));
    }
  }

  /**
   * Return the input that gives us the given symbol.
   * @throws MissingProvideException An exception if there is no
   *     input for this symbol.
   */
  public INPUT getInputProviding(String symbol)
      throws MissingProvideException {
    if (provideMap.containsKey(symbol)) {
      return provideMap.get(symbol);
    }
    throw new MissingProvideException(symbol);
  }

  /**
   * Returns the first circular dependency found. Expressed as a list of
   * items in reverse dependency order (the second element depends on the
   * first, etc.).
   */
  private List<INPUT> findCycle(
      List<INPUT> subGraph, Multimap<INPUT, INPUT> deps) {
    return findCycle(subGraph.get(0), Sets.<INPUT>newHashSet(subGraph),
        deps, Sets.<INPUT>newHashSet());
  }

  private List<INPUT> findCycle(
      INPUT current, Set<INPUT> subGraph, Multimap<INPUT, INPUT> deps,
      Set<INPUT> covered) {
    if (covered.add(current)) {
      List<INPUT> cycle = findCycle(
          findRequireInSubGraphOrFail(current, subGraph),
          subGraph, deps, covered);

      // Don't add the input to the list if the cycle has closed already.
      if (cycle.get(0) != cycle.get(cycle.size() - 1)) {
        cycle.add(current);
      }

      return cycle;
    } else {
      // Explicitly use the add() method, to prevent a generics constructor
      // warning that is dumb. The condition it's protecting is
      // obscure, and I think people have proposed that it be removed.
      List<INPUT> cycle = Lists.<INPUT>newArrayList();
      cycle.add(current);
      return cycle;
    }
  }

  private INPUT findRequireInSubGraphOrFail(INPUT input, Set<INPUT> subGraph) {
    for (String symbol : input.getRequires()) {
      INPUT candidate = provideMap.get(symbol);
      if (subGraph.contains(candidate)) {
        return candidate;
      }
    }
    throw new IllegalStateException("no require found in subgraph");
  }

  /**
   * @param cycle A cycle in reverse-dependency order.
   */
  private String cycleToString(List<INPUT> cycle) {
    List<String> symbols = Lists.newArrayList();
    for (int i = cycle.size() - 1; i >= 0; i--) {
      symbols.add(cycle.get(i).getProvides().iterator().next());
    }
    symbols.add(symbols.get(0));
    return Joiner.on(" -> ").join(symbols);
  }

  public List<INPUT> getSortedList() {
    return Collections.<INPUT>unmodifiableList(sortedList);
  }

  /**
   * Gets all the dependencies of the given roots. The inputs must be returned
   * in a stable order. In other words, if A comes before B, and A does not
   * transitively depend on B, then A must also come before B in the returned
   * list.
   */
  public List<INPUT> getSortedDependenciesOf(List<INPUT> roots) {
    Preconditions.checkArgument(inputs.containsAll(roots));
    Set<INPUT> included = Sets.newHashSet();
    Deque<INPUT> worklist = new ArrayDeque<INPUT>(roots);
    while (!worklist.isEmpty()) {
      INPUT current = worklist.pop();
      if (included.add(current)) {
        for (String req : current.getRequires()) {
          INPUT dep = provideMap.get(req);
          if (dep != null) {
            worklist.add(dep);
          }
        }
      }
    }

    ImmutableList.Builder<INPUT> builder = ImmutableList.builder();
    for (INPUT current : sortedList) {
      if (included.contains(current)) {
        builder.add(current);
      }
    }
    return builder.build();
  }

  public List<INPUT> getInputsWithoutProvides() {
    return Collections.<INPUT>unmodifiableList(noProvides);
  }

  private static <T> List<T> topologicalStableSort(
      List<T> items, Multimap<T, T> deps) {
    final Map<T, Integer> originalIndex = Maps.newHashMap();
    for (int i = 0; i < items.size(); i++) {
      originalIndex.put(items.get(i), i);
    }

    PriorityQueue<T> inDegreeZero = new PriorityQueue<T>(items.size(),
        new Comparator<T>() {
      @Override
      public int compare(T a, T b) {
        return originalIndex.get(a).intValue() -
            originalIndex.get(b).intValue();
      }
    });
    List<T> result = Lists.newArrayList();

    Multiset<T> inDegree = HashMultiset.create();
    Multimap<T, T> reverseDeps = ArrayListMultimap.create();
    Multimaps.invertFrom(deps, reverseDeps);

    // First, add all the inputs with in-degree 0.
    for (T item : items) {
      Collection<T> itemDeps = deps.get(item);
      inDegree.add(item, itemDeps.size());
      if (itemDeps.isEmpty()) {
        inDegreeZero.add(item);
      }
    }

    // Then, iterate to a fixed point over the reverse dependency graph.
    while (!inDegreeZero.isEmpty()) {
      T item = inDegreeZero.remove();
      result.add(item);
      for (T inWaiting : reverseDeps.get(item)) {
        inDegree.remove(inWaiting, 1);
        if (inDegree.count(inWaiting) == 0) {
          inDegreeZero.add(inWaiting);
        }
      }
    }

    return result;
  }

  public static class CircularDependencyException extends Exception {
    CircularDependencyException(String message) {
      super(message);
    }
  }

  public static class MissingProvideException extends Exception {
    MissingProvideException(String provide) {
      super(provide);
    }
  }
}


text:
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class com_op_activity_JSSurfaceView */

#ifndef _Included_com_op_activity_JSSurfaceView
#define _Included_com_op_activity_JSSurfaceView
#ifdef __cplusplus
extern "C" {
#endif

/*
 * Class:     com_op_activity_JSSurfaceView
 * Method:    jsPause
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_com_op_activity_JSSurfaceView_jsPause
  (JNIEnv *, jclass);

/*
 * Class:     com_op_activity_JSSurfaceView
 * Method:    jsResume
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_com_op_activity_JSSurfaceView_jsResume
  (JNIEnv *, jclass);

/*
 * Class:     com_op_activity_JSSurfaceView
 * Method:    jsTouchClick
 * Signature: (IIII)V
 */
JNIEXPORT void JNICALL Java_com_op_activity_JSSurfaceView_jsTouchClick
  (JNIEnv *, jclass, jint, jint, jint, jint);

/*
 * Class:     com_op_activity_JSSurfaceView
 * Method:    jsTouchMove
 * Signature: (II)V
 */
JNIEXPORT void JNICALL Java_com_op_activity_JSSurfaceView_jsTouchMove
  (JNIEnv *, jclass, jint, jint);

/*
 * Class:     com_op_activity_JSSurfaceView
 * Method:    jsKeyBackPress
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_com_op_activity_JSSurfaceView_jsKeyBackPress
  (JNIEnv *, jclass);

/*
 * Class:     com_op_activity_JSSurfaceView
 * Method:    jsKeyMenuPress
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_com_op_activity_JSSurfaceView_jsKeyMenuPress
  (JNIEnv *, jclass);

#ifdef __cplusplus
}
#endif
#endif


text:
import {bootstrap, Component, View} from 'angular2/bootstrap';
import {MdProgressLinear} from 'angular2_material/src/components/progress-linear/progress_linear';
import {UrlResolver} from 'angular2/src/services/url_resolver';
import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
import {bind} from 'angular2/di';

@Component({selector: 'demo-app'})
@View({templateUrl: './demo_app.html', directives: [MdProgressLinear]})
class DemoApp {
  progress: number;

  constructor() {
    this.progress = 40;
  }

  step(s: number) {
    this.progress += s;
  }
}

export function main() {
  commonDemoSetup();
  bootstrap(DemoApp, [bind(UrlResolver).toClass(DemoUrlResolver)]);
}