text:
package io.grpc.netty;

import com.google.common.base.Preconditions;

import io.grpc.AbstractChannelBuilder;
import io.grpc.internal.ClientTransport;
import io.grpc.internal.ClientTransportFactory;
import io.grpc.internal.SharedResourceHolder;
import io.netty.channel.Channel;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.ssl.SslContext;

import java.net.InetSocketAddress;
import java.net.SocketAddress;

import javax.net.ssl.SSLException;

/**
 * A builder to help simplify construction of channels using the Netty transport.
 */
public final class NettyChannelBuilder extends AbstractChannelBuilder<NettyChannelBuilder> {
  public static final int DEFAULT_FLOW_CONTROL_WINDOW = 1048576; // 1MiB

  private final SocketAddress serverAddress;
  private NegotiationType negotiationType = NegotiationType.TLS;
  private Class<? extends Channel> channelType = NioSocketChannel.class;
  private EventLoopGroup userEventLoopGroup;
  private SslContext sslContext;
  private int flowControlWindow = DEFAULT_FLOW_CONTROL_WINDOW;

  /**
   * Creates a new builder with the given server address.
   */
  public static NettyChannelBuilder forAddress(SocketAddress serverAddress) {
    return new NettyChannelBuilder(serverAddress);
  }

  /**
   * Creates a new builder with the given host and port.
   */
  public static NettyChannelBuilder forAddress(String host, int port) {
    return forAddress(new InetSocketAddress(host, port));
  }

  private NettyChannelBuilder(SocketAddress serverAddress) {
    this.serverAddress = serverAddress;
  }

  /**
   * Specify the channel type to use, by default we use {@link NioSocketChannel}.
   */
  public NettyChannelBuilder channelType(Class<? extends Channel> channelType) {
    this.channelType = Preconditions.checkNotNull(channelType);
    return this;
  }

  /**
   * Sets the negotiation type for the HTTP/2 connection.
   *
   *
Default: TLS
   */
  public NettyChannelBuilder negotiationType(NegotiationType type) {
    negotiationType = type;
    return this;
  }

  /**
   * Provides an EventGroupLoop to be used by the netty transport.
   *
   *
It's an optional parameter. If the user has not provided an EventGroupLoop when the channel
   * is built, the builder will use the default one which is static.
   *
   *
The channel won't take ownership of the given EventLoopGroup. It's caller's responsibility
   * to shut it down when it's desired.
   */
  public NettyChannelBuilder eventLoopGroup(EventLoopGroup group) {
    userEventLoopGroup = group;
    return this;
  }

  /**
   * SSL/TLS context to use instead of the system default. It must have been configured with {@link
   * GrpcSslContexts}, but options could have been overridden.
   */
  public NettyChannelBuilder sslContext(SslContext sslContext) {
    this.sslContext = sslContext;
    return this;
  }

  /**
   * Sets the flow control window in bytes. If not called, the default value
   * is {@link #DEFAULT_FLOW_CONTROL_WINDOW}).
   */
  public NettyChannelBuilder flowControlWindow(int flowControlWindow) {
    Preconditions.checkArgument(flowControlWindow > 0, "flowControlWindow must be positive");
    this.flowControlWindow = flowControlWindow;
    return this;
  }

  @Override
  protected ChannelEssentials buildEssentials() {
    final EventLoopGroup group = (userEventLoopGroup == null)
        ? SharedResourceHolder.get(Utils.DEFAULT_WORKER_EVENT_LOOP_GROUP) : userEventLoopGroup;
    final NegotiationType negotiationType = this.negotiationType;
    final Class<? extends Channel> channelType = this.channelType;
    final int flowControlWindow = this.flowControlWindow;
    final ProtocolNegotiator negotiator;
    switch (negotiationType) {
      case PLAINTEXT:
        negotiator = ProtocolNegotiators.plaintext();
        break;
      case PLAINTEXT_UPGRADE:
        negotiator = ProtocolNegotiators.plaintextUpgrade();
        break;
      case TLS:
        if (!(serverAddress instanceof InetSocketAddress)) {
          throw new IllegalStateException("TLS not supported for non-internet socket types");
        }
        if (sslContext == null) {
          try {
            sslContext = GrpcSslContexts.forClient().build();
          } catch (SSLException ex) {
            throw new RuntimeException(ex);
          }
        }
        negotiator = ProtocolNegotiators.tls(sslContext, (InetSocketAddress) serverAddress);
        break;
      default:
        throw new IllegalArgumentException("Unsupported negotiationType: " + negotiationType);
    }

    ClientTransportFactory transportFactory = new ClientTransportFactory() {
      @Override
      public ClientTransport newClientTransport() {
        return new NettyClientTransport(serverAddress, channelType, group,
            negotiator, flowControlWindow);
      }
    };
    Runnable terminationRunnable = null;
    if (userEventLoopGroup == null) {
      terminationRunnable = new Runnable() {
        @Override
        public void run() {
          SharedResourceHolder.release(Utils.DEFAULT_WORKER_EVENT_LOOP_GROUP, group);
        }
      };
    }
    return new ChannelEssentials(transportFactory, terminationRunnable);
  }
}


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

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="up" title="FatFs" href="../00index_e.html">
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/error.html">
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
<title>FatFs - f_error</title>

f_error

The f_error tests for an error on a file.

int f_error (
  FIL* FileObject   /* File object */
);

Parameters

FileObject

Pointer to the open file object structure.

Return Values

Returns a non-zero value if an error has occured; otherwise it returns a zero.

Description

In this revision, the f_error function is implemented as a macro.

#define f_error(fp) (((fp)->flag & FA__ERROR) ? 1 : 0)

QuickInfo

Always available.

See Also

<tt>f_open, FIL</tt>

Return

redpajama_set_name: RedPajamaGithub


text:
package x509

// Possible certificate files; stop after finding one.
var certFiles = []string{
	"/var/ssl/certs/ca-bundle.crt",
}


text:
package org.apache.hadoop.hive.common.auth;

import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import java.security.KeyStore;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;

import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLServerSocket;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.TrustManagerFactory;

import com.google.common.base.Splitter;
import com.google.common.collect.Sets;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.thrift.TConfiguration;
import org.apache.thrift.transport.TSSLTransportFactory;
import org.apache.thrift.transport.TServerSocket;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * This class helps in some aspects of authentication. It creates the proper Thrift classes for the
 * given configuration as well as helps with authenticating requests.
 */
public class HiveAuthUtils {
  private static final Logger LOG = LoggerFactory.getLogger(HiveAuthUtils.class);

  public static TTransport getSocketTransport(String host, int port, int loginTimeout) throws TTransportException {
    return new TSocket(new TConfiguration(),host, port, loginTimeout);
  }

  public static TTransport getSSLSocket(String host, int port, int loginTimeout)
    throws TTransportException {
    // The underlying SSLSocket object is bound to host:port with the given SO_TIMEOUT
    TSocket tSSLSocket = TSSLTransportFactory.getClientSocket(host, port, loginTimeout);
    return getSSLSocketWithHttps(tSSLSocket);
  }

  public static TTransport getSSLSocket(String host, int port, int loginTimeout,
      String trustStorePath, String trustStorePassWord, String trustStoreType,
      String trustStoreAlgorithm) throws TTransportException {
    TSSLTransportFactory.TSSLTransportParameters params =
      new TSSLTransportFactory.TSSLTransportParameters();
    String tStoreType = trustStoreType.isEmpty()? KeyStore.getDefaultType() : trustStoreType;
    String tStoreAlgorithm = trustStoreAlgorithm.isEmpty()?
            TrustManagerFactory.getDefaultAlgorithm() : trustStoreAlgorithm;
    params.setTrustStore(trustStorePath, trustStorePassWord, tStoreAlgorithm, tStoreType);
    params.requireClientAuth(true);
    // The underlying SSLSocket object is bound to host:port with the given SO_TIMEOUT and
    // SSLContext created with the given params
    TSocket tSSLSocket = TSSLTransportFactory.getClientSocket(host, port, loginTimeout, params);
    return getSSLSocketWithHttps(tSSLSocket);
  }

  // Using endpoint identification algorithm as HTTPS enables us to do
  // CNAMEs/subjectAltName verification
  private static TSocket getSSLSocketWithHttps(TSocket tSSLSocket) throws TTransportException {
    SSLSocket sslSocket = (SSLSocket) tSSLSocket.getSocket();
    SSLParameters sslParams = sslSocket.getSSLParameters();
    sslParams.setEndpointIdentificationAlgorithm("HTTPS");
    sslSocket.setSSLParameters(sslParams);
    return new TSocket(sslSocket);
  }

  public static TServerSocket getServerSocket(String hiveHost, int portNum)
    throws TTransportException {
    InetSocketAddress serverAddress;
    if (hiveHost == null || hiveHost.isEmpty()) {
      // Wildcard bind
      serverAddress = new InetSocketAddress(portNum);
    } else {
      serverAddress = new InetSocketAddress(hiveHost, portNum);
    }
    return new TServerSocket(serverAddress);
  }

  public static TServerSocket getServerSSLSocket(String hiveHost, int portNum, String keyStorePath,
      String keyStorePassWord, String keyStoreType, String keyStoreAlgorithm,
      List<String> sslVersionBlacklist, String includeCipherSuites) throws TTransportException,
      UnknownHostException {

    TSSLTransportFactory.TSSLTransportParameters params = null;
    if (!includeCipherSuites.trim().isEmpty()) {
      Set<String> includeCS = Sets.newHashSet(
              Splitter.on(":").trimResults().omitEmptyStrings().split(includeCipherSuites.trim()));
      int eSize = includeCS.size();
      if (eSize > 0) {
        params = new TSSLTransportFactory.TSSLTransportParameters("TLS", includeCS.toArray(new String[eSize]));
      }
    }
    if (params == null) {
      params = new TSSLTransportFactory.TSSLTransportParameters();
    }
    String kStoreType = keyStoreType.isEmpty()? KeyStore.getDefaultType() : keyStoreType;
    String kStoreAlgorithm = keyStoreAlgorithm.isEmpty()?
            KeyManagerFactory.getDefaultAlgorithm() : keyStoreAlgorithm;
    params.setKeyStore(keyStorePath, keyStorePassWord,
        kStoreAlgorithm, kStoreType);
    InetSocketAddress serverAddress;
    if (hiveHost == null || hiveHost.isEmpty()) {
      // Wildcard bind
      serverAddress = new InetSocketAddress(portNum);
    } else {
      serverAddress = new InetSocketAddress(hiveHost, portNum);
    }
    TServerSocket thriftServerSocket =
        TSSLTransportFactory.getServerSocket(portNum, 0, serverAddress.getAddress(), params);
    if (thriftServerSocket.getServerSocket() instanceof SSLServerSocket) {
      List<String> sslVersionBlacklistLocal = new ArrayList<String>();
      for (String sslVersion : sslVersionBlacklist) {
        sslVersionBlacklistLocal.add(sslVersion.trim().toLowerCase());
      }
      SSLServerSocket sslServerSocket = (SSLServerSocket) thriftServerSocket.getServerSocket();
      List<String> enabledProtocols = new ArrayList<String>();
      for (String protocol : sslServerSocket.getEnabledProtocols()) {
        if (sslVersionBlacklistLocal.contains(protocol.toLowerCase())) {
          LOG.debug("Disabling SSL Protocol: " + protocol);
        } else {
          enabledProtocols.add(protocol);
        }
      }
      sslServerSocket.setEnabledProtocols(enabledProtocols.toArray(new String[0]));
      LOG.info("SSL Server Socket Enabled Protocols: "
          + Arrays.toString(sslServerSocket.getEnabledProtocols()));
    }
    return thriftServerSocket;
  }
}


text:
import com.arm4j.core.DefaultURLParam;

public class TestParam {

    public static void main(String[] args) {
        DefaultURLParam.Builder builder = new DefaultURLParam.Builder().add("key", "123").add("value", "321");
        System.out.println();

        DefaultURLParam.Builder builder1 = new DefaultURLParam.Builder().add("key1", "123").add("value1", "321");
        System.out.println();
    }

}


text: circus spring based webapp


text:
#ifndef _CXCORE_TYPES_H_
#define _CXCORE_TYPES_H_

#include <assert.h>
#include <stdlib.h>
#include <string.h>

typedef struct IplImage
{
    int  nSize;         /* sizeof(IplImage) */
    int  ID;            /* version (=0)*/
    int  nChannels;     /* Most of OpenCV functions support 1,2,3 or 4 channels */
    int  alphaChannel;  /* ignored by OpenCV */
    int  depth;         /* pixel depth in bits: IPL_DEPTH_8U, IPL_DEPTH_8S, IPL_DEPTH_16S,
                           IPL_DEPTH_32S, IPL_DEPTH_32F and IPL_DEPTH_64F are supported */
    char colorModel[4]; /* ignored by OpenCV */
    char channelSeq[4]; /* ditto */
    int  dataOrder;     /* 0 - interleaved color channels, 1 - separate color channels.
                           cvCreateImage can only create interleaved images */
    int  origin;        /* 0 - top-left origin,
                           1 - bottom-left origin (Windows bitmaps style) */
    int  align;         /* Alignment of image rows (4 or 8).
                           OpenCV ignores it and uses widthStep instead */
    int  width;         /* image width in pixels */
    int  height;        /* image height in pixels */
    struct _IplROI *roi;/* image ROI. if NULL, the whole image is selected */
    struct _IplImage *maskROI; /* must be NULL */
    void  *imageId;     /* ditto */
    struct _IplTileInfo *tileInfo; /* ditto */
    int  imageSize;     /* image data size in bytes
                           (==image->height*image->widthStep
                           in case of interleaved data)*/
    char *imageData;  /* pointer to aligned image data */
    int  widthStep;   /* size of aligned image row in bytes */
    int  BorderMode[4]; /* ignored by OpenCV */
    int  BorderConst[4]; /* ditto */
    char *imageDataOrigin; /* pointer to very origin of image data
                              (not necessarily aligned) -
                              needed for correct deallocation */
} IplImage;

struct IplROI
{
    int  coi; /* 0 - no COI (all channels are selected), 1 - 0th channel is selected ...*/
    int  xOffset;
    int  yOffset;
    int  width;
    int  height;
};

typedef struct CvRect
{
    int x;
    int y;
    int width;
    int height;
}
CvRect;

struct CvMemBlock;
struct CvMemStorage;
struct CvSeq;
struct CvSize;
struct CvArr;

//Python stub

#endif


text:
TARGET=${THOR_HOME}/lib/libthorkernel.so
include ${THOR_HOME}/src/makefile.in

INCLUDES+=-I${THOR_HOME}/add-ons
INCLUDES+=-I../common
INCLUDES+=-I../sql

LIBS+=


text:
package org.springframework.cloud.consul.discovery;

import java.io.IOException;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.Enumeration;

import lombok.SneakyThrows;
import lombok.extern.apachecommons.CommonsLog;

import org.springframework.util.StringUtils;

import com.ecwid.consul.v1.catalog.model.CatalogService;

/**
 * @author Spencer Gibb
 */
@CommonsLog
public class IpAddressUtils {

	public static String getCatalogServiceHost(CatalogService service, boolean preferAddress) {
		if (preferAddress) {
			if (StringUtils.hasText(service.getServiceAddress())) {
				return service.getServiceAddress();
			} else {
				return service.getAddress();
			}
		}
		return service.getNode();
	}

	@SneakyThrows
	public static InetAddress getFirstNonLoopbackAddress() {
		try {
			for (Enumeration<NetworkInterface> enumNic = NetworkInterface.getNetworkInterfaces();
				 enumNic.hasMoreElements(); ) {
				NetworkInterface ifc = enumNic.nextElement();
				if (ifc.isUp()) {
					for (Enumeration<InetAddress> enumAddr = ifc.getInetAddresses();
						 enumAddr.hasMoreElements(); ) {
						InetAddress address = enumAddr.nextElement();
						if (address instanceof Inet4Address && !address.isLoopbackAddress()) {
							return address;
						}
					}
				}
			}
		}
		catch (IOException ex) {
			log.error("Cannot get host info", ex);
		}
		return InetAddress.getLocalHost();
	}
}


text:
layout: post
title: I can't plant a chuch!
published: false
---

>"I'd love to be a missionary, but I'm not sure I'm gifted enough to be able to plant a church or start a DMM... that's all pretty intimidating!"

Woah, hang on a second. Who said you had to do all of that? :-)

We actually don't read anything about Christ commanding his disciples to plant churches or set up elaborate movements. So why burden ourselves with worrying about how we will accomplish all that?

Just start by being a witness. Take lots of time to get to know the people, their language and culture, and all the while speak lots about Christ. Work to know God, know the people, and get the word out. Tell them the good news. And then pray to make disciples. When someone believes, baptize them, befriend them, and teach, pray, and encourage them into maturity in Christ. As people believe, a lovely local family will form, and grow, and reproduce.

We plant the Gospel. Christ builds his church.

>"Like a father with his children, we exhorted each one of you and charged you to walk in a manner worthy of God, who calls you into his own kingdom and glory." (1 Thess. 1:12)

<!-- -----   possible cutoff --- this for another thing

I would say, concentrate on the people in front of you. Don't burden yourself trying to worry about how you can make a big church happen. I mean, really, is that even our job?

Local believers in these places don't need foreign experts to organize them, control them, employ them, or lead their churches. That's just difficult and awkward for everyone involved.

They don't need us to implant our complex church models, or (spend piles of money to) replicate our cultural forms of gathering and worship on their soil. They don't need our structures, legal umbrellas, or financial conduits. I also don't think they need our latest strategies for how we think the perfect house-gatherings might work. (Who are we to figure out what church for their culture should be?)

They need friends and fathers who will lay down their lives to give them an example of faith, and encourage them in Christ. They just need to be given the good news that reconciles them with the head of the body, and then to be loved, prayed, and taught into full trust and obedience to Christ.

Let them be the local, indigenous, natural body of Christ.

(CP? You don't have to do it. Phew! That's be a load off our shoulders, and theirs.)

Jesus brought something simple, so let's carry something simple forward.   -->


text:
package models;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * Representa una nota relacionada a una incidencia.
 *
 * @author Herman
 * @since 22/07/2015
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Entity
@Table(name = "nota")
public class XNota extends ModeloBase implements Serializable {

    /**
     * Incidencia a la que esta relacionada la nota.
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "incidencia_id")
    private Incidencia incidencia;
    /**
     * Usuario que creó la nota.
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "usuario_id")
    private Usuario usuario;
    /**
     * Fecha en que fue creada la nota.
     */
    @Column(name = "fecha")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecha;
    /**
     * Contenido de la nota.
     */
    @Column(name = "nota")
    private String nota;
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Folia geobot. phytotax. 1: 274 (1966)

#### Original name
Albatrellus similis Pouzar

### Remarks
null


text:
package org.springframework.ldap.query;

import org.springframework.ldap.filter.EqualsFilter;
import org.springframework.ldap.filter.Filter;
import org.springframework.ldap.filter.GreaterThanOrEqualsFilter;
import org.springframework.ldap.filter.LessThanOrEqualsFilter;
import org.springframework.ldap.filter.LikeFilter;
import org.springframework.ldap.filter.NotFilter;
import org.springframework.ldap.filter.PresentFilter;
import org.springframework.ldap.filter.WhitespaceWildcardsFilter;

/**
 * @author Mattias Hellborg Arthursson
 * @since 2.0
 */
class DefaultConditionCriteria implements ConditionCriteria {
    private final AppendableContainerCriteria parent;
    private final String attribute;
    private boolean negated = false;

    DefaultConditionCriteria(AppendableContainerCriteria parent, String attribute) {
        this.parent = parent;
        this.attribute = attribute;
    }

    @Override
    public ContainerCriteria is(String value) {
        return appendToParent(new EqualsFilter(attribute, value));
    }

    @Override
    public ContainerCriteria gte(String value) {
        return appendToParent(new GreaterThanOrEqualsFilter(attribute, value));
    }

    @Override
    public ContainerCriteria lte(String value) {
        return appendToParent(new LessThanOrEqualsFilter(attribute, value));
    }

    @Override
    public ContainerCriteria like(String value) {
        return appendToParent(new LikeFilter(attribute, value));
    }

    @Override
    public ContainerCriteria whitespaceWildcardsLike(String value) {
        return appendToParent(new WhitespaceWildcardsFilter(attribute, value));
    }

    @Override
    public ContainerCriteria isPresent() {
        return appendToParent(new PresentFilter(attribute));
    }

    private ContainerCriteria appendToParent(Filter filter) {
        return parent.append(negateIfApplicable(filter));
    }

    private Filter negateIfApplicable(Filter myFilter) {
        if (negated) {
            return new NotFilter(myFilter);
        }

        return myFilter;
    }

    @Override
    public DefaultConditionCriteria not() {
        negated = !negated;
        return this;
    }
}


text:
::Chef::Recipe.send(:include, Opscode::OpenSSL::Password)

include_recipe 'java'

tomcat_pkgs = value_for_platform(
  ['smartos'] => {
    'default' => ['apache-tomcat'],
  },
  'default' => ["tomcat#{node['tomcat']['base_version']}"]
  )
if node['tomcat']['deploy_manager_apps']
  tomcat_pkgs << value_for_platform(
    %w{ debian  ubuntu } => {
      'default' => "tomcat#{node['tomcat']['base_version']}-admin",
    },
    %w{ centos redhat fedora amazon } => {
      'default' => "tomcat#{node['tomcat']['base_version']}-admin-webapps",
    }
    )
end

tomcat_pkgs.compact!

tomcat_pkgs.each do |pkg|
  package pkg do
    action :install
    version node['tomcat']['base_version'].to_s if platform_family?('smartos')
  end
end

directory node['tomcat']['endorsed_dir'] do
  mode '0755'
  recursive true
end

unless node['tomcat']['deploy_manager_apps']
  directory "#{node['tomcat']['webapp_dir']}/manager" do
    action :delete
    recursive true
  end
  file "#{node['tomcat']['config_dir']}/Catalina/localhost/manager.xml" do
    action :delete
  end
  directory "#{node['tomcat']['webapp_dir']}/host-manager" do
    action :delete
    recursive true
  end
  file "#{node['tomcat']['config_dir']}/Catalina/localhost/host-manager.xml" do
    action :delete
  end
end

node.set_unless['tomcat']['keystore_password'] = secure_password
node.set_unless['tomcat']['truststore_password'] = secure_password

unless node['tomcat']['truststore_file'].nil?
  java_options = node['tomcat']['java_options'].to_s
  java_options << " -Djavax.net.ssl.trustStore=#{node['tomcat']['config_dir']}/#{node['tomcat']['truststore_file']}"
  java_options << " -Djavax.net.ssl.trustStorePassword=#{node['tomcat']['truststore_password']}"

  node.set['tomcat']['java_options'] = java_options
end

case node['platform']
when 'centos', 'redhat', 'fedora', 'amazon'
  template "/etc/sysconfig/tomcat#{node['tomcat']['base_version']}" do
    source 'sysconfig_tomcat6.erb'
    owner 'root'
    group 'root'
    mode '0644'
    notifies :restart, 'service[tomcat]'
  end
when 'smartos'
  template "#{node['tomcat']['base']}/bin/setenv.sh" do
    source 'setenv.sh.erb'
    owner 'root'
    group 'root'
    mode '0644'
    notifies :restart, 'service[tomcat]'
  end
else
  template "/etc/default/tomcat#{node['tomcat']['base_version']}" do
    source 'default_tomcat6.erb'
    owner 'root'
    group 'root'
    mode '0644'
    notifies :restart, 'service[tomcat]'
  end
end

template "#{node['tomcat']['config_dir']}/server.xml" do
  source 'server.xml.erb'
  owner 'root'
  group 'root'
  mode '0644'
  notifies :restart, 'service[tomcat]'
end

template "#{node['tomcat']['config_dir']}/logging.properties" do
  source 'logging.properties.erb'
  owner 'root'
  group 'root'
  mode '0644'
  notifies :restart, 'service[tomcat]'
end

if node['tomcat']['ssl_cert_file'].nil?
  execute 'Create Tomcat SSL certificate' do
    group node['tomcat']['group']
    command "#{node['tomcat']['keytool']} -genkeypair -keystore \"#{node['tomcat']['config_dir']}/#{node['tomcat']['keystore_file']}\" -storepass \"#{node['tomcat']['keystore_password']}\" -keypass \"#{node['tomcat']['keystore_password']}\" -dname \"#{node['tomcat']['certificate_dn']}\""
    umask 0007
    creates "#{node['tomcat']['config_dir']}/#{node['tomcat']['keystore_file']}"
    action :run
    notifies :restart, 'service[tomcat]'
  end
else
  script 'create_tomcat_keystore' do
    interpreter 'bash'
    action :nothing
    cwd node['tomcat']['config_dir']
    code <<-EOH
      cat #{node['tomcat']['ssl_chain_files'].join(' ')} > cacerts.pem
      openssl pkcs12 -export \
       -inkey #{node['tomcat']['ssl_key_file']} \
       -in #{node['tomcat']['ssl_cert_file']} \
       -chain \
       -CAfile cacerts.pem \
       -password pass:#{node['tomcat']['keystore_password']} \
       -out #{node['tomcat']['keystore_file']}
    EOH
    notifies :restart, 'service[tomcat]'
  end

  cookbook_file "#{node['tomcat']['config_dir']}/#{node['tomcat']['ssl_cert_file']}" do
    mode '0644'
    notifies :run, 'script[create_tomcat_keystore]'
  end

  cookbook_file "#{node['tomcat']['config_dir']}/#{node['tomcat']['ssl_key_file']}" do
    mode '0644'
    notifies :run, 'script[create_tomcat_keystore]'
  end

  node['tomcat']['ssl_chain_files'].each do |cert|
    cookbook_file "#{node['tomcat']['config_dir']}/#{cert}" do
      mode '0644'
      notifies :run, 'script[create_tomcat_keystore]'
    end
  end
end

unless node['tomcat']['truststore_file'].nil?
  cookbook_file "#{node['tomcat']['config_dir']}/#{node['tomcat']['truststore_file']}" do
    mode '0644'
  end
end

service 'tomcat' do
  case node['platform']
  when 'centos', 'redhat', 'fedora', 'amazon'
    service_name "tomcat#{node['tomcat']['base_version']}"
    supports :restart => true, :status => true
  when 'debian', 'ubuntu'
    service_name "tomcat#{node['tomcat']['base_version']}"
    supports :restart => true, :reload => false, :status => true
  when 'smartos'
    service_name 'tomcat'
    supports :restart => false, :reload => false, :status => true
  else
    service_name "tomcat#{node['tomcat']['base_version']}"
  end
  action [:start, :enable]
  notifies :run, 'execute[wait for tomcat]', :immediately
  retries 4
  retry_delay 30
end

execute 'wait for tomcat' do
  command 'sleep 5'
  action :nothing
end


text:
import datetime
import logging
import re

import google.appengine.ext.ndb as ndb

import models

XREF_RE = re.compile(r'k8s-gubernator.appspot.com/build(/[^])\s]+/\d+)')
APPROVERS_RE = re.compile(r'<!-- META={"?approvers"?:\[([^]]*)\]} -->')

class Deduper(object):
    ''' A memory-saving string deduplicator for Python datastructures.

    This is somewhat like the built-in intern() function, but without pinning memory
    permanently.

    Tries to reduce memory usage by making equivalent strings point at the same object.
    This reduces memory usage for large, repetitive JSON structures by >2x.
    '''

    def __init__(self):
        self.strings = {}

    def dedup(self, obj):
        if isinstance(obj, basestring):
            return self.strings.setdefault(obj, obj)
        elif isinstance(obj, dict):
            return {self.dedup(k): self.dedup(v) for k, v in obj.iteritems()}
        elif isinstance(obj, tuple):
            return tuple(self.dedup(x) for x in obj)
        elif isinstance(obj, list):
            return [self.dedup(x) for x in obj]
        return obj

def classify_issue(repo, number):
    '''
    Classify an issue in a repo based on events in Datastore.

    Args:
        repo: string
        number: int
    Returns:
        is_pr: bool
        is_open: bool
        involved: list of strings representing usernames involved
        payload: a dict, see full description for classify below.
        last_event_timestamp: the timestamp of the most recent event.
    '''
    ancestor = models.GithubResource.make_key(repo, number)
    logging.debug('finding webhooks for %s %s', repo, number)
    event_keys = list(models.GithubWebhookRaw.query(ancestor=ancestor).fetch(keys_only=True))

    logging.debug('classifying %s %s (%d events)', repo, number, len(event_keys))
    event_tuples = []
    last_event_timestamp = datetime.datetime(2000, 1, 1)

    if len(event_keys) > 800:
        logging.warning('too many events. blackholing.')
        return False, False, [], {'num_events': len(event_keys)}, last_event_timestamp

    deduper = Deduper()

    for x in xrange(0, len(event_keys), 100):
        events = ndb.get_multi(event_keys[x:x+100])
        last_event_timestamp = max(last_event_timestamp, max(e.timestamp for e in events))
        event_tuples.extend([deduper.dedup(event.to_tuple()) for event in events])

    event_tuples.sort(key=lambda x: x[2])  # sort by timestamp

    del deduper  # attempt to save memory
    del events

    merged = get_merged(event_tuples)
    statuses = None
    if 'head' in merged:
        statuses = {}
        for status in models.GHStatus.query_for_sha(repo, merged['head']['sha']):
            last_event_timestamp = max(last_event_timestamp, status.updated_at)
            statuses[status.context] = [
                status.state, status.target_url, status.description]

    return list(classify(event_tuples, statuses)) + [last_event_timestamp]

def get_merged(events):
    '''
    Determine the most up-to-date view of the issue given its inclusion
    in a series of events.

    Note that different events have different levels of detail-- comments
    don't include head SHA information, pull request events don't have label
    information, etc.

    Args:
        events: a list of (event_type str, event_body dict, timestamp).
    Returns:
        body: a dict representing the issue's latest state.
    '''
    merged = {}
    for _event, body, _timestamp in events:
        if 'issue' in body:
            merged.update(body['issue'])
        if 'pull_request' in body:
            merged.update(body['pull_request'])
    return merged

def get_labels(events):
    '''
    Determine the labels applied to an issue.

    Args:
        events: a list of (event_type str, event_body dict, timestamp).
    Returns:
        labels: the currently applied labels as {label_name: label_color}
    '''
    labels = []
    for event, body, _timestamp in events:
        if 'issue' in body:
            # issues come with labels, so we can update here
            labels = body['issue']['labels']
        # pull_requests don't include their full labels :(
        action = body.get('action')
        if event == 'pull_request':
            # Pull request label events don't come with a full label set.
            # Track them explicitly here.
            try:
                if action in ('labeled', 'unlabeled') and 'label' not in body:
                    logging.warning('label event with no labels (multiple changes?)')
                elif action == 'labeled':
                    label = body['label']
                    if label not in labels:
                        labels.append(label)
                elif action == 'unlabeled':
                    label = body['label']
                    if label in labels:
                        labels.remove(label)
            except:
                logging.exception('??? %r', body)
                raise
    return {label['name']: label['color'] for label in labels}

def get_skip_comments(events, skip_users=None):
    '''
    Determine comment ids that should be ignored, either because of
        deletion or because the user should be skipped.

    Args:
        events: a list of (event_type str, event_body dict, timestamp).
    Returns:
        comment_ids: a set of comment ids that were deleted or made by
            users that should be skiped.
    '''
    if skip_users is None:
        skip_users = []

    skip_comments = set()
    for event, body, _timestamp in events:
        action = body.get('action')
        if event in ('issue_comment', 'pull_request_review_comment'):
            comment_id = body['comment']['id']
            if action == 'deleted' or body['sender']['login'] in skip_users:
                skip_comments.add(comment_id)
    return skip_comments

def classify(events, statuses=None):
    '''
    Given an event-stream for an issue and status-getter, process
    the events and determine what action should be taken, if any.

    Args:
        events: a list of (event_type str, event_body dict, timestamp).
    Returns:
        is_pr: bool
        is_open: bool
        involved: list of strings representing usernames involved
        payload: a dictionary of additional information, including:
            {
                'author': str author_name,
                'title': str issue title,
                'labels': {label_name: label_color},
                'attn': {user_name: reason},
                'mergeable': bool,
                'comments': [{'user': str name, 'comment': comment, 'timestamp': str iso8601}],
                'xrefs': list of builds referenced (by GCS path),
            }
    '''
    merged = get_merged(events)
    labels = get_labels(events)
    comments = get_comments(events)
    xrefs = get_xrefs(comments, merged)
    approvers = get_approvers(comments)
    reviewers = get_reviewers(events)

    is_pr = 'head' in merged or 'pull_request' in merged
    is_open = merged['state'] != 'closed'
    author = merged['user']['login']
    assignees = sorted({assignee['login'] for assignee in merged['assignees']} | reviewers)
    involved = sorted(set([author] + assignees + approvers))

    payload = {
        'author': author,
        'assignees': assignees,
        'title': merged['title'],
        'labels': labels,
        'xrefs': xrefs,
    }

    if is_pr:
        if is_open:
            payload['needs_rebase'] = 'needs-rebase' in labels or merged.get('mergeable') == 'false'
        payload['additions'] = merged.get('additions', 0)
        payload['deletions'] = merged.get('deletions', 0)
        if 'head' in merged:
            payload['head'] = merged['head']['sha']

    if statuses:
        payload['status'] = statuses

    if approvers:
        payload['approvers'] = approvers

    payload['attn'] = calculate_attention(distill_events(events), payload)

    return is_pr, is_open, involved, payload

def get_xrefs(comments, merged):
    xrefs = set(XREF_RE.findall(merged.get('body') or ''))
    for c in comments:
        xrefs.update(XREF_RE.findall(c['comment']))
    return sorted(xrefs)

def get_comments(events):
    '''
    Pick comments and pull-request review comments out of a list of events.
    Args:
        events: a list of (event_type str, event_body dict, timestamp).
    Returns:
        comments: a list of dict(author=..., comment=..., timestamp=...),
                  ordered with the earliest comment first.
    '''
    comments = {}  # comment_id : comment
    for event, body, _timestamp in events:
        action = body.get('action')
        if event in ('issue_comment', 'pull_request_review_comment'):
            comment_id = body['comment']['id']
            if action == 'deleted':
                comments.pop(comment_id, None)
            else:
                comments[comment_id] = body['comment']
    return [
            {
                'author': c['user']['login'],
                'comment': c['body'],
                'timestamp': c['created_at']
            }
            for c in sorted(comments.values(), key=lambda c: c['created_at'])
    ]

def get_reviewers(events):
    '''
    Return the set of users that have a code review requested or completed.
    '''
    reviewers = set()
    for event, body, _timestamp in events:
        action = body.get('action')
        if event == 'pull_request':
            if action == 'review_requested':
                if 'requested_reviewer' not in body:
                    logging.warning('no reviewer present -- self-review?')
                    continue
                reviewers.add(body['requested_reviewer']['login'])
            elif action == 'review_request_removed':
                reviewers -= {body['requested_reviewer']['login']}
    return reviewers

def get_approvers(comments):
    '''
    Return approvers requested in comments.

    This MUST be kept in sync with mungegithub's getGubernatorMetadata().
    '''
    approvers = []
    for comment in comments:
        if comment['author'] == 'k8s-merge-robot':
            m = APPROVERS_RE.search(comment['comment'])
            if m:
                approvers = m.group(1).replace('"', '').split(',')
    return approvers

def distill_events(events):
    '''
    Given a sequence of events, return a series of user-action tuples
    relevant to determining user state.
    '''
    bots = [
        'k8s-bot',
        'k8s-ci-robot',
        'k8s-merge-robot',
        'k8s-oncall',
        'k8s-reviewable',
    ]
    skip_comments = get_skip_comments(events, bots)

    output = []
    for event, body, timestamp in events:
        action = body.get('action')
        user = body.get('sender', {}).get('login')
        if event in ('issue_comment', 'pull_request_review_comment'):
            if body['comment']['id'] in skip_comments:
                continue
            if action == 'created':
                output.append(('comment', user, timestamp))
        if event == 'pull_request_review':
            if action == 'submitted':
                # this is morally equivalent to a comment
                output.append(('comment', user, timestamp))
        if event == 'pull_request':
            if action in ('opened', 'reopened', 'synchronize'):
                output.append(('push', user, timestamp))
            if action == 'labeled' and 'label' in body:
                output.append(('label ' + body['label']['name'].lower(), user, timestamp))
    return output

def evaluate_fsm(events, start, transitions):
    '''
    Given a series of event tuples and a start state, execute the list of transitions
    and return the resulting state, the time it entered that state, and the last time
    the state would be entered (self-transitions are allowed).

    transitions is a list of tuples
    (state_before str, state_after str, condition str or callable)

    The transition occurs if condition equals the action (as a str), or if
    condition(action, user) is True.
    '''
    state = start
    state_start = 0 # time that we entered this state
    state_last = 0  # time of last transition into this state
    for action, user, timestamp in events:
        for state_before, state_after, condition in transitions:
            if state_before is None or state_before == state:
                if condition == action or (callable(condition) and condition(action, user)):
                    if state_after != state:
                        state_start = timestamp
                    state = state_after
                    state_last = timestamp
                    break
    return state, state_start, state_last

def get_author_state(author, distilled_events):
    '''
    Determine the state of the author given a series of distilled events.
    '''
    return evaluate_fsm(distilled_events, start='waiting', transitions=[
        # before, after, condition
        (None, 'address comments', lambda a, u: a == 'comment' and u != author),
        ('address comments', 'waiting', 'push'),
        ('address comments', 'waiting', lambda a, u: a == 'comment' and u == author),
    ])

def get_assignee_state(assignee, author, distilled_events):
    '''
    Determine the state of an assignee given a series of distilled events.
    '''
    return evaluate_fsm(distilled_events, start='needs review', transitions=[
        # before, after, condition
        ('needs review', 'waiting', lambda a, u: u == assignee and a in ('comment', 'label lgtm')),
        (None, 'needs review', 'push'),
        (None, 'needs review', lambda a, u: a == 'comment' and u == author),
    ])

def calculate_attention(distilled_events, payload):
    '''
    Given information about an issue, determine who should look at it.

    It can include start and last update time for various states --
    "address comments#123#456" means that something has been in 'address comments' since
    123, and there was some other event that put it in 'address comments' at 456.
    '''
    author = payload['author']
    assignees = payload['assignees']

    attn = {}
    def notify(to, reason):
        attn[to] = reason

    if any(state == 'failure' for state, _url, _desc
           in payload.get('status', {}).values()):
        notify(author, 'fix tests')

    for approver in payload.get('approvers', []):
        notify(approver, 'needs approval')

    for assignee in assignees:
        assignee_state, first, last = get_assignee_state(assignee, author, distilled_events)
        if assignee_state != 'waiting':
            notify(assignee, '%s#%s#%s' % (assignee_state, first, last))

    author_state, first, last = get_author_state(author, distilled_events)
    if author_state != 'waiting':
        notify(author, '%s#%s#%s' % (author_state, first, last))

    if payload.get('needs_rebase'):
        notify(author, 'needs rebase')
    if 'release-note-label-needed' in payload['labels']:
        notify(author, 'needs release-note label')

    return attn


text:
<!doctype html>

<meta charset="utf-8">

<title>Portfolio item number 2 - Earle Wilson</title>

<meta property="og:locale" content="en-US">
<meta property="og:site_name" content="Earle Wilson">
<meta property="og:title" content="Portfolio item number 2">

  <link rel="canonical" href="http://localhost:4000/portfolio/portfolio-2/">
  <meta property="og:url" content="http://localhost:4000/portfolio/portfolio-2/">

  <meta property="og:description" content="Short description of portfolio item number 2 ">

<link href="http://localhost:4000/feed.xml" type="application/atom+xml" rel="alternate" title="Earle Wilson Feed">

<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="stylesheet" href="http://localhost:4000/assets/css/main.css">

<meta http-equiv="cleartype" content="on">

<link rel="apple-touch-icon" sizes="57x57" href="http://localhost:4000/images/apple-touch-icon-57x57.png?v=M44lzPylqQ">
<link rel="apple-touch-icon" sizes="60x60" href="http://localhost:4000/images/apple-touch-icon-60x60.png?v=M44lzPylqQ">
<link rel="apple-touch-icon" sizes="72x72" href="http://localhost:4000/images/apple-touch-icon-72x72.png?v=M44lzPylqQ">
<link rel="apple-touch-icon" sizes="76x76" href="http://localhost:4000/images/apple-touch-icon-76x76.png?v=M44lzPylqQ">
<link rel="apple-touch-icon" sizes="114x114" href="http://localhost:4000/images/apple-touch-icon-114x114.png?v=M44lzPylqQ">
<link rel="apple-touch-icon" sizes="120x120" href="http://localhost:4000/images/apple-touch-icon-120x120.png?v=M44lzPylqQ">
<link rel="apple-touch-icon" sizes="144x144" href="http://localhost:4000/images/apple-touch-icon-144x144.png?v=M44lzPylqQ">
<link rel="apple-touch-icon" sizes="152x152" href="http://localhost:4000/images/apple-touch-icon-152x152.png?v=M44lzPylqQ">
<link rel="apple-touch-icon" sizes="180x180" href="http://localhost:4000/images/apple-touch-icon-180x180.png?v=M44lzPylqQ">
<link rel="icon" type="image/png" href="http://localhost:4000/images/favicon-32x32.png?v=M44lzPylqQ" sizes="32x32">
<link rel="icon" type="image/png" href="http://localhost:4000/images/android-chrome-192x192.png?v=M44lzPylqQ" sizes="192x192">
<link rel="icon" type="image/png" href="http://localhost:4000/images/favicon-96x96.png?v=M44lzPylqQ" sizes="96x96">
<link rel="icon" type="image/png" href="http://localhost:4000/images/favicon-16x16.png?v=M44lzPylqQ" sizes="16x16">
<link rel="manifest" href="http://localhost:4000/images/manifest.json?v=M44lzPylqQ">
<link rel="mask-icon" href="http://localhost:4000/images/safari-pinned-tab.svg?v=M44lzPylqQ" color="#000000">
<link rel="shortcut icon" href="/images/favicon.ico?v=M44lzPylqQ">
<meta name="msapplication-TileColor" content="#000000">
<meta name="msapplication-TileImage" content="http://localhost:4000/images/mstile-144x144.png?v=M44lzPylqQ">
<meta name="msapplication-config" content="http://localhost:4000/images/browserconfig.xml?v=M44lzPylqQ">
<meta name="theme-color" content="#ffffff">
<link rel="stylesheet" href="http://localhost:4000/assets/css/academicons.css"/>

        <button>

</button>

Earle Wilson

CV

Research

Earle Wilson

Oceanographer/Postdoctoral Scholar

    <button class="btn btn--inverse">Follow</button>

 California Institute of Technology

 Email

 Twitter

 Github

 Google Scholar

    <meta itemprop="headline" content="Portfolio item number 2">
    <meta itemprop="description" content="Short description of portfolio item number 2 ">

Portfolio item number 2

        This is an item in your portfolio. It can be have images or nice text. If you name the file .md, it will be parsed as markdown. If you name the file .html, it will be parsed as HTML.

Share on

   Twitter

   Facebook

   LinkedIn

      Previous

      Next

Sitemap

Follow:

 GitHub

 Feed

© 2019 Earle Wilson. Powered by Jekyll & AcademicPages, a fork of Minimal Mistakes.


text:
require.config({
    /**
    *  All of the libraries in the paths below will be packaged by RJS Optimizer
    *  in to the modules/includes/js directory
    *  Note: paths are relative to the compiling cwd - see Gruntfile.js
    **/
    paths:{
        require:'../../node_modules/requirejs/require'
        ,underscore:'../../bower_components/underscore/underscore-min'
        ,jquery:'../../bower_components/jquery/dist/jquery.min'
        ,Backbone:'../../bower_components/backbone/backbone-min'
        ,bootstrap:'../../bower_components/bootstrap-sass/assets/javascripts/bootstrap.min'
        ,html5shiv: '../../bower_components/html5shiv/dist/html5shiv.min'
        ,fastclick: '../../bower_components/fastclick/lib/fastclick'
        ,iCheck: '../../bower_components/iCheck/icheck.min'
        ,jsonlint: '../../bower_components/jsonlint/lib/jsonlint'
        ,modernizr: '../../bower_components/modernizr/lib/build'
        ,respond: '../../bower_components/respond/dest/respond.min'
        ,switchery: '../../bower_components/switchery/dist/switchery.min'
        ,scrollify: '../../bower_components/Scrollify/jquery.scrollify.min'
        ,navgoco: '../../bower_components/navgoco/src/jquery.navgoco.min'
        ,"es6-shim": '../../bower_components/es6-shim/es6-shim.min'
        ,prism: '../../bower_components/prism/prism'
        ,clipboard: '../../bower_components/clipboard/dist/clipboard.min'
        ,messenger: '../../modules/relax/includes/plugins/messenger/js/messenger.min'
        ,messengerTheme: '../../modules/relax/includes/plugins/messenger/js/messenger-theme-flat'
    }

    /**
    * Shim config for window globals
    * Specify any upstream dependencies and the global variables exported
    **/
    ,shim:{
        underscore:{exports:'_'}
        ,jquery:{exports:['jQuery','$']}
        ,Backbone:{exports:'Backbone', deps:['jquery', 'underscore'] }
        ,bootstrap:{ exports:'Bootstrap', deps:['jquery'] }
        ,html5shiv:{exports:'html5shiv'}
        ,navgoco:{exports:'navgoco',deps:['jquery']}
        ,"es6-shim":{exports:'es6-shim'}
        ,jsonlint:{exports:'jsonlint'}
        ,clipboard:{exports:'Clipboard'}
        ,messenger:{exports:'Messenger'}
        ,messengerTheme:{deps: [ 'messenger' ]}
        ,scrollify:{deps: [ 'jquery' ]}
    }

    /**
    * Any items in the deps array will be pre-compiled in to the Relax module includes/js/globals.js file and will be available immediately on every request
    **/
    ,deps:['jquery','bootstrap','underscore','Backbone','respond','switchery','navgoco','html5shiv','iCheck','fastclick','messenger','messengerTheme','scrollify']
});


text:
import { promisify } from 'util';
import { finished as finishedCallback, PassThrough } from 'stream';
import ms from 'ms';
import { AccumulateStream } from '../lib/AccumulateStream';

const finished = promisify(finishedCallback);

describe('AccumulateStream', () => {
  const DATA = 'data';

  test('isEmpty method', () => {
    const as = new AccumulateStream();
    expect(as.isEmpty()).toBe(true);
    as.write(DATA);
    expect(as.isEmpty()).toBe(false);
  });

  test('getBuffer method', () => {
    const as = new AccumulateStream();
    as.write(DATA);
    expect(as.getBuffer()).toBeInstanceOf(Buffer);
    expect(Buffer.compare(Buffer.from(DATA), as.getBuffer())).toBe(0);
  });

  test('emitFlush option', async () => {
    const pass = new PassThrough();
    const as = new AccumulateStream({ emitFlush: true });
    const dataEventHandler = jest.fn();
    as.on('data', dataEventHandler);

    pass.pipe(as);
    pass.write(DATA);
    pass.write(DATA);
    pass.end(DATA);
    await finished(pass);

    expect(dataEventHandler).toHaveBeenCalledTimes(1);
    expect(dataEventHandler).toHaveBeenCalledWith(Buffer.from(`${DATA}${DATA}${DATA}`));
  });

  test('chunk event', async () => {
    const pass = new PassThrough();
    const as = new AccumulateStream();
    const chunkEventHandler = jest.fn();
    as.on('chunk', chunkEventHandler);

    pass.pipe(as);
    pass.write(DATA);
    pass.write(DATA);
    pass.end();
    await finished(pass);

    expect(chunkEventHandler).toHaveBeenCalledTimes(2);
    expect(chunkEventHandler).toHaveBeenNthCalledWith(1, {
      buffer: Buffer.from(DATA),
      chunk: Buffer.from(DATA),
    });
    expect(chunkEventHandler).toHaveBeenNthCalledWith(2, {
      buffer: Buffer.from(`${DATA}${DATA}`),
      chunk: Buffer.from(DATA),
    });
  });

  test('count option', async () => {
    const pass = new PassThrough();
    const as = new AccumulateStream({ count: 2 });
    const dataEventHandler = jest.fn();
    as.on('data', dataEventHandler);
    const countEventHandler = jest.fn();
    as.on('count', countEventHandler);

    pass.pipe(as);
    pass.write(DATA);
    pass.write(DATA);
    pass.write(DATA);
    pass.write(DATA);
    pass.end();
    await finished(pass);

    expect(dataEventHandler).toHaveBeenCalledTimes(2);
    expect(dataEventHandler).toHaveBeenCalledWith(Buffer.from(`${DATA}${DATA}`));
    expect(countEventHandler).toHaveBeenCalledTimes(2);
    expect(countEventHandler).toHaveBeenCalledWith({ buffer: Buffer.from(`${DATA}${DATA}`) });
  });

  test('size option', async () => {
    const pass = new PassThrough();
    const as = new AccumulateStream({ size: '8b' });
    const dataEventHandler = jest.fn();
    as.on('data', dataEventHandler);
    const sizeEventHandler = jest.fn();
    as.on('size', sizeEventHandler);

    pass.pipe(as);
    pass.write(DATA);
    pass.write(DATA);
    pass.write(DATA);
    pass.write(DATA);
    pass.end();
    await finished(pass);

    expect(dataEventHandler).toHaveBeenCalledTimes(2);
    expect(dataEventHandler).toHaveBeenCalledWith(Buffer.from(`${DATA}${DATA}`));
    expect(sizeEventHandler).toHaveBeenCalledTimes(2);
    expect(sizeEventHandler).toHaveBeenCalledWith({
      buffer: Buffer.from(`${DATA}${DATA}`),
      size: 8,
    });
  });

  test('interval option', async () => {
    const pass = new PassThrough();
    const as = new AccumulateStream({ interval: '1s' });
    const dataEventHandler = jest.fn();
    as.on('data', dataEventHandler);
    const intervalEventHandler = jest.fn();
    as.on('interval', intervalEventHandler);

    pass.pipe(as);
    pass.write(DATA);
    pass.write(DATA);
    setTimeout(() => {
      pass.write(DATA);
      pass.write(DATA);
    }, ms('1s'));
    setTimeout(() => {
      pass.end();
    }, ms('3s'));
    await finished(pass);

    expect(dataEventHandler).toHaveBeenCalledTimes(2);
    expect(dataEventHandler).toHaveBeenCalledWith(Buffer.from(`${DATA}${DATA}`));
    expect(intervalEventHandler).toHaveBeenCalledTimes(2);
    expect(intervalEventHandler).toHaveBeenCalledWith({ buffer: Buffer.from(`${DATA}${DATA}`) });
  });

  test('phrase option', async () => {
    const pass = new PassThrough();
    const as = new AccumulateStream({ phrase: `${DATA}${DATA}` });
    const dataEventHandler = jest.fn();
    as.on('data', dataEventHandler);
    const phraseEventHandler = jest.fn();
    as.on('phrase', phraseEventHandler);

    pass.pipe(as);
    pass.write(DATA);
    pass.write(DATA);
    pass.write(DATA);
    pass.write(DATA);
    pass.end();
    await finished(pass);

    expect(dataEventHandler).toHaveBeenCalledTimes(2);
    expect(dataEventHandler).toHaveBeenCalledWith(Buffer.from(`${DATA}${DATA}`));
    expect(phraseEventHandler).toHaveBeenCalledTimes(2);
    expect(phraseEventHandler).toHaveBeenCalledWith({ buffer: Buffer.from(`${DATA}${DATA}`) });
  });

  test('custom option', async () => {
    const EVENT_NAME = 'even-chunk';
    let i = 0;
    const pass = new PassThrough();
    const as = new AccumulateStream({
      custom: {
        event: EVENT_NAME,
        isDone: (): boolean => {
          i += 1;
          return i % 2 === 0;
        },
      },
    });
    const dataEventHandler = jest.fn();
    as.on('data', dataEventHandler);
    const accumulatorEventHandler = jest.fn();
    as.on(EVENT_NAME, accumulatorEventHandler);

    pass.pipe(as);
    pass.write(DATA);
    pass.write(DATA);
    pass.write(DATA);
    pass.write(DATA);
    pass.end();
    await finished(pass);

    expect(dataEventHandler).toHaveBeenCalledTimes(2);
    expect(dataEventHandler).toHaveBeenCalledWith(Buffer.from(`${DATA}${DATA}`));
    expect(accumulatorEventHandler).toHaveBeenCalledTimes(2);
    expect(accumulatorEventHandler).toHaveBeenCalledWith({ buffer: Buffer.from(`${DATA}${DATA}`) });
  });
});


text:
package com.connectsdk.smarthomesampler.scene;

import android.content.Context;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;

import fi.iki.elonen.NanoHTTPD;

class MediaServer extends NanoHTTPD {

    private final Context context;
    private final String filename;

    public MediaServer(Context context, String file, int port) {
        super(port);
        this.context = context;
        this.filename = file;
    }

    @Override
    public synchronized Response serve(IHTTPSession session) {
        File file = new File(context.getFilesDir() + "/" + filename);
        return serveFile(session.getHeaders(), file, "audio/mp3");
    }

    private Response createResponse(Response.Status status, String mimeType,
            InputStream message) {
        Response res = new Response(status, mimeType, message);
        res.addHeader("Accept-Ranges", "bytes");
        return res;
    }

    // Announce that the file server accepts partial content requests
    private Response createResponse(Response.Status status, String mimeType,
            String message) {
        Response res = new Response(status, mimeType, message);
        res.addHeader("Accept-Ranges", "bytes");
        return res;
    }

    Response serveFile(Map<String, String> header, File file, String mime) {
        Response res;
        try {
            // Calculate etag
            String etag = Integer.toHexString((file.getAbsolutePath() + file.lastModified() + "" + file.length()).hashCode());

            // Support (simple) skipping:
            long startFrom = 0;
            long endAt = -1;
            String range = header.get("range");
            if (range != null) {
                if (range.startsWith("bytes=")) {
                    range = range.substring("bytes=".length());
                    int minus = range.indexOf('-');
                    try {
                        if (minus > 0) {
                            startFrom = Long.parseLong(range.substring(0, minus));
                            endAt = Long.parseLong(range.substring(minus + 1));
                        }
                    } catch (NumberFormatException ignored) {
                    }
                }
            }

            // Change return code and add Content-Range header when skipping is requested
            long fileLen = file.length();
            if (range != null && startFrom >= 0) {
                if (startFrom >= fileLen) {
                    res = createResponse(Response.Status.RANGE_NOT_SATISFIABLE, NanoHTTPD.MIME_PLAINTEXT, "");
                    res.addHeader("Content-Range", "bytes 0-0/" + fileLen);
                    res.addHeader("ETag", etag);
                } else {
                    if (endAt < 0) {
                        endAt = fileLen - 1;
                    }
                    long newLen = endAt - startFrom + 1;
                    if (newLen < 0) {
                        newLen = 0;
                    }

                    final long dataLen = newLen;
                    FileInputStream fis = new FileInputStream(file) {
                        @Override
                        public int available() throws IOException {
                            return (int) dataLen;
                        }
                    };
                    //noinspection ResultOfMethodCallIgnored
                    fis.skip(startFrom);

                    res = createResponse(Response.Status.PARTIAL_CONTENT, mime, fis);
                    res.addHeader("Content-Length", "" + dataLen);
                    res.addHeader("Content-Range", "bytes " + startFrom + "-" + endAt + "/" + fileLen);
                    res.addHeader("ETag", etag);
                }
            } else {
                if (etag.equals(header.get("if-none-match")))
                    res = createResponse(Response.Status.NOT_MODIFIED, mime, "");
                else {
                    res = createResponse(Response.Status.OK, mime, new FileInputStream(file));
                    res.addHeader("Content-Length", "" + fileLen);
                    res.addHeader("ETag", etag);
                }
            }
        } catch (IOException ioe) {
            res = new Response(Response.Status.FORBIDDEN, "text/plain", "Reading file failed.");
        }

        return res;
    }

}


text:
package com.AppointmentSystem.exception;

/**
 * Created by Ruzal on 9/17/2017.
 */
public class ValidationException extends ServiceException {
    public ValidationException(String message) {
        super(message);
    }
}


text:
import * as React from 'react';
import RangeSlider from 'react-bootstrap-range-slider';

// Valid examples

const ref = React.createRef<HTMLInputElement>();
const validStringTooltip = (
    <RangeSlider
        value={5}
        onChange={(_, n) => {}}
        onAfterChange={(_, n) => {}}
        min={-5}
        max={5}
        step={1}
        disabled={false}
        size="lg"
        variant="primary"
        tooltip="auto"
        tooltipPlacement="top"
        tooltipLabel={n => `Value is ${n}`}
        tooltipStyle={{ fontSize: '1.5rem' }}
        tooltipProps={{ className: 'text-center' }}
        inputProps={{ onMouseEnter: () => {} }}
        ref={ref}
        bsPrefix="custom-prefix-"
    />
);

const validCustomTooltip = <RangeSlider tooltipLabel={n =>
Value is {n}
} />;

// Invalid examples

// $ExpectError
const invalidVariant = <RangeSlider variant="large" />;

// $ExpectError
const invalidTooltipPlacement = <RangeSlider tooltipPlacement="left" />;

const providingChildren = (
    // $ExpectError
    <RangeSlider>
        I'm a child
    </RangeSlider>
);

// $ExpectError
const stringValue = <RangeSlider value="5" />;

// $ExpectError
const invalidTooltipStyle = <RangeSlider tooltipStyle={{ textSize: 'big' }} />;

// $ExpectError
const invalidInputProps = <RangeSlider inputProps={{ someInvalidProp: 'value' }} />;

// $ExpectError
const invalidTooltipProps = <RangeSlider tooltipProps={{ someInvalidProp: 'value' }} />;


text:
namespace gfx {
class Size;
}  // namespace gfx

namespace viz {

class CopyOutputResult;
class FrameSinkVideoCapturerManager;

// Captures the frames of a CompositorFrameSink's surface as a video stream. See
// mojom for usage details.
//
// FrameSinkVideoCapturerImpl is owned by FrameSinkManagerImpl. An instance is
// destroyed either: 1) just after the Mojo binding has closed; or 2) when the
// FrameSinkManagerImpl is shutting down.
//
// The capturer also works with FrameSinkManagerImpl to resolve the capture
// target, a CapturableFrameSink, from a given FrameSinkId. Since there is a
// possible race between when the capturer learns of a new FrameSinkId and when
// FrameSinkManagerImpl learns of it (e.g., because Mojo method invocations can
// be out-of-order), the capturer allows for the possibility that a requested
// target will resolve at a later point. In this case, it is the responsibility
// of FrameSinkManagerImpl to call SetResolvedTarget() once the target becomes
// known to it.
//
// Once the target is resolved, this capturer attaches to it to receive events
// of interest regarding the frame flow, display timiming, and changes to the
// frame sink's surface. For some subset of frames, decided by
// media::VideoCaptureOracle, this capturer will make a CopyOutputRequest on the
// surface. Successful CopyOutputResults are then copied into pooled shared
// memory for efficient transport to the consumer.
class VIZ_SERVICE_EXPORT FrameSinkVideoCapturerImpl final
    : public CapturableFrameSink::Client,
      public VideoCaptureOverlay::FrameSource,
      public mojom::FrameSinkVideoCapturer {
 public:
  // |frame_sink_manager| must outlive this instance. Binds this instance to the
  // Mojo message pipe endpoint in |receiver|, but |receiver| may be empty for
  // unit testing.
  FrameSinkVideoCapturerImpl(
      FrameSinkVideoCapturerManager* frame_sink_manager,
      mojo::PendingReceiver<mojom::FrameSinkVideoCapturer> receiver,
      std::unique_ptr<media::VideoCaptureOracle> oracle,
      bool log_to_webrtc);

  ~FrameSinkVideoCapturerImpl() final;

  // The currently-requested frame sink for capture. The frame sink manager
  // calls this when it learns of a new CapturableFrameSink to see if the target
  // can be resolved.
  const FrameSinkId& requested_target() const { return requested_target_; }

  // Sets the resolved target, detaching this capturer from the previous target
  // (if any), and attaching to the new target. This is called by the frame sink
  // manager. If |target| is null, the capturer goes idle and expects this
  // method to be called again in the near future, once the target becomes known
  // to the frame sink manager.
  void SetResolvedTarget(CapturableFrameSink* target);

  // Notifies this capturer that the current target will be destroyed, and the
  // FrameSinkId associated with it has become invalid. This is called by the
  // frame sink manager.
  void OnTargetWillGoAway();

  // mojom::FrameSinkVideoCapturer implementation:
  void SetFormat(media::VideoPixelFormat format,
                 const gfx::ColorSpace& color_space) final;
  void SetMinCapturePeriod(base::TimeDelta min_capture_period) final;
  void SetMinSizeChangePeriod(base::TimeDelta min_period) final;
  void SetResolutionConstraints(const gfx::Size& min_size,
                                const gfx::Size& max_size,
                                bool use_fixed_aspect_ratio) final;
  void SetAutoThrottlingEnabled(bool enabled) final;
  void ChangeTarget(const base::Optional<FrameSinkId>& frame_sink_id) final;
  void Start(mojo::PendingRemote<mojom::FrameSinkVideoConsumer> consumer) final;
  void Stop() final;
  void RequestRefreshFrame() final;
  void CreateOverlay(int32_t stacking_index,
                     mojo::PendingReceiver<mojom::FrameSinkVideoCaptureOverlay>
                         receiver) final;

  // Default configuration.
  static constexpr media::VideoPixelFormat kDefaultPixelFormat =
      media::PIXEL_FORMAT_I420;
  static constexpr gfx::ColorSpace kDefaultColorSpace =
      gfx::ColorSpace::CreateREC709();

  // The maximum number of frames in-flight in the capture pipeline, reflecting
  // the storage capacity dedicated for this purpose. Example numbers, for a
  // frame pool that is fully-allocated with 10 frames of size 1920x1080, using
  // the I420 pixel format (12 bits per pixel). Then:
  //
  //   storage_bytes_for_all_ten_frames = 10 * (1920 * 1080 * 12/8)
  //     --> ~29.7 MB
  //
  // In practice, only 0-3 frames will be in-flight at a time, depending on the
  // content change rate and system performance.
  static constexpr int kDesignLimitMaxFrames = 10;

  // A safe, sustainable maximum number of frames in-flight. In other words,
  // exceeding 60% of the design limit is considered "red line" operation.
  static constexpr float kTargetPipelineUtilization = 0.6f;

 private:
  friend class FrameSinkVideoCapturerTest;

  using OracleFrameNumber =
      decltype(std::declval<media::VideoCaptureOracle>().next_frame_number());

  // Starts the refresh frame timer to guarantee a frame representing the most
  // up-to-date content will be sent to the consumer in the near future. This
  // refresh operation will be canceled if a compositing event triggers a frame
  // capture in the meantime.
  void ScheduleRefreshFrame();

  // Returns the delay that should be used when setting the refresh timer. This
  // is based on the current oracle prediction for frame duration.
  base::TimeDelta GetDelayBeforeNextRefreshAttempt() const;

  // Called whenever a major damage event, such as a capture parameter change, a
  // resolved target change, etc., occurs. This marks the entire source as dirty
  // and ensures the consumer will receive a refresh frame with up-to-date
  // content.
  void RefreshEntireSourceSoon();

  // Executes a refresh capture, if conditions permit. Otherwise, schedules a
  // later retry. Note that the retry "polling" should be a short-term state,
  // since it only occurs until the oracle allows the next frame capture to take
  // place. If a refresh was already pending, it is canceled in favor of this
  // new refresh.
  void RefreshSoon();

  // CapturableFrameSink::Client implementation:
  void OnFrameDamaged(const gfx::Size& frame_size,
                      const gfx::Rect& damage_rect,
                      base::TimeTicks target_display_time,
                      const CompositorFrameMetadata& frame_metadata) final;

  // VideoCaptureOverlay::FrameSource implementation:
  gfx::Size GetSourceSize() final;
  void InvalidateRect(const gfx::Rect& rect) final;
  void OnOverlayConnectionLost(VideoCaptureOverlay* overlay) final;

  void InvalidateEntireSource();

  // Returns a list of the overlays in rendering order.
  std::vector<VideoCaptureOverlay*> GetOverlaysInOrder() const;

  // Consults the VideoCaptureOracle to decide whether to capture a frame,
  // then ensures prerequisites are met before initiating the capture: that
  // there is a consumer present and that the pipeline is not already full.
  void MaybeCaptureFrame(media::VideoCaptureOracle::Event event,
                         const gfx::Rect& damage_rect,
                         base::TimeTicks event_time,
                         const CompositorFrameMetadata& frame_metadata);

  // Extracts the image data from the copy output |result|, populating the
  // |content_rect| region of a [possibly letterboxed] video |frame|.
  void DidCopyFrame(int64_t capture_frame_number,
                    OracleFrameNumber oracle_frame_number,
                    int64_t content_version,
                    const gfx::Rect& content_rect,
                    VideoCaptureOverlay::OnceRenderer overlay_renderer,
                    scoped_refptr<media::VideoFrame> frame,
                    base::TimeTicks request_time,
                    std::unique_ptr<CopyOutputResult> result);

  // Places the frame in the |delivery_queue_| and calls MaybeDeliverFrame(),
  // one frame at a time, in-order. |frame| may be null to indicate a
  // completed, but unsuccessful capture.
  void OnFrameReadyForDelivery(int64_t capture_frame_number,
                               OracleFrameNumber oracle_frame_number,
                               const gfx::Rect& content_rect,
                               scoped_refptr<media::VideoFrame> frame);

  // Delivers a |frame| to the consumer, if the VideoCaptureOracle allows
  // it. |frame| can be null to indicate a completed, but unsuccessful capture.
  // In this case, some state will be updated, but nothing will be sent to the
  // consumer.
  void MaybeDeliverFrame(OracleFrameNumber oracle_frame_number,
                         const gfx::Rect& content_rect,
                         scoped_refptr<media::VideoFrame> frame);

  // For ARGB format, ensures that every dimension of |size| is positive. For
  // I420 format, ensures that every dimension is even and at least 2.
  gfx::Size AdjustSizeForPixelFormat(const gfx::Size& size);

  // Expands |rect| such that its x, y, right, and bottom values are even
  // numbers.
  static gfx::Rect ExpandRectToI420SubsampleBoundaries(const gfx::Rect& rect);

  void OnLog(const std::string& message);

  // Owner/Manager of this instance.
  FrameSinkVideoCapturerManager* const frame_sink_manager_;

  // Mojo receiver for this instance.
  mojo::Receiver<mojom::FrameSinkVideoCapturer> receiver_{this};

  // Represents this instance as an issuer of CopyOutputRequests. The Surface
  // uses this to auto-cancel stale requests (i.e., prior requests that did not
  // execute). Also, the implementations that execute CopyOutputRequests use
  // this as a hint to cache objects for a huge performance improvement.
  const base::UnguessableToken copy_request_source_;

  // Use the default base::TimeTicks clock; but allow unit tests to provide a
  // replacement.
  const base::TickClock* clock_;

  // Current image format.
  media::VideoPixelFormat pixel_format_ = kDefaultPixelFormat;
  gfx::ColorSpace color_space_ = kDefaultColorSpace;

  // Models current content change/draw behavior and proposes when to capture
  // frames, and at what size and frame rate.
  const std::unique_ptr<media::VideoCaptureOracle> oracle_;

  // The target requested by the client, as provided in the last call to
  // ChangeTarget().
  FrameSinkId requested_target_;

  // The resolved target of video capture, or null if the requested target does
  // not yet exist (or no longer exists).
  CapturableFrameSink* resolved_target_ = nullptr;

  // The current video frame consumer. This is set when Start() is called and
  // cleared when Stop() is called.
  mojo::Remote<mojom::FrameSinkVideoConsumer> consumer_;

  // The portion of the source content that has changed, but has not yet been
  // captured.
  gfx::Rect dirty_rect_;

  // Allows determining whether or not the frame size has changed since the last
  // captured frame.
  gfx::Rect last_frame_visible_rect_;

  // These are sequence counters used to ensure that the frames are being
  // delivered in the same order they are captured.
  int64_t next_capture_frame_number_ = 0;
  int64_t next_delivery_frame_number_ = 0;

  // This timer is started whenever the consumer needs another frame delivered.
  // This might be because: 1) the consumer was just started and needs an
  // initial frame; 2) the capture target changed; 3) the oracle rejected
  // an event for timing reasons; 4) to satisfy explicit requests for a refresh
  // frame, when RequestRefreshFrame() has been called.
  //
  // Note: This is always set, but the instance is overridden for unit testing.
  base::Optional<base::OneShotTimer> refresh_frame_retry_timer_;

  // Provides a pool of VideoFrames that can be efficiently delivered across
  // processes. The size of this pool is used to limit the maximum number of
  // frames in-flight at any one time.
  InterprocessFramePool frame_pool_;

  // Increased every time the source content changes or a forced refresh is
  // requested.
  int64_t content_version_ = 0;

  int64_t content_version_in_marked_frame_ = -1;

  gfx::Size marked_frame_size_;

  // A queue of captured frames pending delivery. This queue is used to re-order
  // frames, if they should happen to be captured out-of-order.
  struct CapturedFrame {
    int64_t capture_frame_number;
    OracleFrameNumber oracle_frame_number;
    gfx::Rect content_rect;
    scoped_refptr<media::VideoFrame> frame;
    CapturedFrame(int64_t capture_frame_number,
                  OracleFrameNumber oracle_frame_number,
                  const gfx::Rect& content_rect,
                  scoped_refptr<media::VideoFrame> frame);
    CapturedFrame(const CapturedFrame& other);
    ~CapturedFrame();
    bool operator<(const CapturedFrame& other) const;
  };
  std::priority_queue<CapturedFrame> delivery_queue_;

  // The Oracle-provided media timestamp of the first frame. This is used to
  // compute the relative media stream timestamps for each successive frame.
  base::Optional<base::TimeTicks> first_frame_media_ticks_;

  // Zero or more overlays to be rendered over each captured video frame. The
  // order of the entries in this map determines the order in which each overlay
  // is rendered. This is important because alpha blending between overlays can
  // make a difference in the overall results.
  base::flat_map<int32_t, std::unique_ptr<VideoCaptureOverlay>> overlays_;

  // The visible height of the top-controls in the last CompositorFrameMetadata
  // received.
  double last_top_controls_visible_height_ = 0.f;

  // This class assumes its control operations and async callbacks won't execute
  // simultaneously.
  SEQUENCE_CHECKER(sequence_checker_);

  // A weak pointer factory used for cancelling consumer feedback from any
  // in-flight frame deliveries.
  base::WeakPtrFactory<media::VideoCaptureOracle> feedback_weak_factory_;

  // Enables debug log messages to be sent to webrtc native log.
  const bool log_to_webrtc_;

  // A weak pointer factory used for cancelling the results from any in-flight
  // copy output requests.
  base::WeakPtrFactory<FrameSinkVideoCapturerImpl> capture_weak_factory_{this};

  DISALLOW_COPY_AND_ASSIGN(FrameSinkVideoCapturerImpl);
};

}  // namespace viz

#endif  // COMPONENTS_VIZ_SERVICE_FRAME_SINKS_VIDEO_CAPTURE_FRAME_SINK_VIDEO_CAPTURER_IMPL_H_


text:
@interface QBRGameModeParameterValueQuery : QBQuery

@end


text:
@collection__item([
    'classList' => ['c-collection__phone'],
    'icon' => $icon ?? false,
    'link' => 'tel:' . $phone['number'],
    'attributeList' => [
        'itemprop'  => 'telephone',
    ]
])
    {{ $phone['number'] }}
@endcollection__item


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

<title>Uses of Interface jade.core.sam.Provider (JADE v4.3.1 API)</title>
<meta name="date" content="2013-12-04">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Interface
jade.core.sam.Provider

Packages that use Provider

Package
Description

jade.core.sam

Uses of Provider in jade.core.sam

Subinterfaces of Provider in jade.core.sam

Modifier and Type
Interface and Description

interface
AverageMeasureProvider

A Provider of average measures for a given entity

interface
CounterValueProvider

A provider of values for a given counter.

interface
MeasureProvider

A Provider of "one-shot" measures for a given entity

Classes in jade.core.sam that implement Provider

Modifier and Type
Class and Description

class
AverageMeasure

The class used by the System Activity Monitoring (SAM) Service to represent an average measure

class
AverageMeasureProviderImpl

A default ready-made implementation of the AverageMeasureProvider interface that offers
 methods to add measure samples and automatically computes an  AverageMeasure
 when the getValue() method is called.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

These are the official JADE API. For these API backward compatibility is guaranteed accross JADE versions