text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>8</source>
                    <target>8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <parent>
    <groupId>io.github.crabzilla</groupId>
    <artifactId>crabzilla</artifactId>
    <version>v0.5.6</version>
  </parent>

    <artifactId>crabzilla-stack</artifactId>
  <packaging>jar</packaging>

  <dependencies>

    <dependency>
      <groupId>io.github.crabzilla</groupId>
      <artifactId>crabzilla-core</artifactId>
    </dependency>

    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-core</artifactId>
    </dependency>

    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-pg-client</artifactId>
    </dependency>

    <!-- test -->

  </dependencies>

</project>

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Erythea 5: 6 (1897)

#### Original name
Puccinia transformans Ellis & Everh.

### Remarks
null


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

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

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

    /**
     *

     * The token that specifies the next page of results to return. To request the first page, leave NextToken empty.
     * The token will expire in 24 hours, and cannot be shared with other accounts.
     *

     */
    private String nextToken;
    /**
     *

     * An array of schema version summaries.
     *

     */
    private java.util.List<SchemaVersionSummary> schemaVersions;

    /**
     *

     * The token that specifies the next page of results to return. To request the first page, leave NextToken empty.
     * The token will expire in 24 hours, and cannot be shared with other accounts.
     *

     *
     * @param nextToken
     *        The token that specifies the next page of results to return. To request the first page, leave NextToken
     *        empty. The token will expire in 24 hours, and cannot be shared with other accounts.
     */

    public void setNextToken(String nextToken) {
        this.nextToken = nextToken;
    }

    /**
     *

     * The token that specifies the next page of results to return. To request the first page, leave NextToken empty.
     * The token will expire in 24 hours, and cannot be shared with other accounts.
     *

     *
     * @return The token that specifies the next page of results to return. To request the first page, leave NextToken
     *         empty. The token will expire in 24 hours, and cannot be shared with other accounts.
     */

    public String getNextToken() {
        return this.nextToken;
    }

    /**
     *

     * The token that specifies the next page of results to return. To request the first page, leave NextToken empty.
     * The token will expire in 24 hours, and cannot be shared with other accounts.
     *

     *
     * @param nextToken
     *        The token that specifies the next page of results to return. To request the first page, leave NextToken
     *        empty. The token will expire in 24 hours, and cannot be shared with other accounts.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListSchemaVersionsResult withNextToken(String nextToken) {
        setNextToken(nextToken);
        return this;
    }

    /**
     *

     * An array of schema version summaries.
     *

     *
     * @return An array of schema version summaries.
     */

    public java.util.List<SchemaVersionSummary> getSchemaVersions() {
        return schemaVersions;
    }

    /**
     *

     * An array of schema version summaries.
     *

     *
     * @param schemaVersions
     *        An array of schema version summaries.
     */

    public void setSchemaVersions(java.util.Collection<SchemaVersionSummary> schemaVersions) {
        if (schemaVersions == null) {
            this.schemaVersions = null;
            return;
        }

        this.schemaVersions = new java.util.ArrayList<SchemaVersionSummary>(schemaVersions);
    }

    /**
     *

     * An array of schema version summaries.
     *

     *

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

     *
     * @param schemaVersions
     *        An array of schema version summaries.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListSchemaVersionsResult withSchemaVersions(SchemaVersionSummary... schemaVersions) {
        if (this.schemaVersions == null) {
            setSchemaVersions(new java.util.ArrayList<SchemaVersionSummary>(schemaVersions.length));
        }
        for (SchemaVersionSummary ele : schemaVersions) {
            this.schemaVersions.add(ele);
        }
        return this;
    }

    /**
     *

     * An array of schema version summaries.
     *

     *
     * @param schemaVersions
     *        An array of schema version summaries.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListSchemaVersionsResult withSchemaVersions(java.util.Collection<SchemaVersionSummary> schemaVersions) {
        setSchemaVersions(schemaVersions);
        return this;
    }

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

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

        if (obj instanceof ListSchemaVersionsResult == false)
            return false;
        ListSchemaVersionsResult other = (ListSchemaVersionsResult) obj;
        if (other.getNextToken() == null ^ this.getNextToken() == null)
            return false;
        if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
            return false;
        if (other.getSchemaVersions() == null ^ this.getSchemaVersions() == null)
            return false;
        if (other.getSchemaVersions() != null && other.getSchemaVersions().equals(this.getSchemaVersions()) == false)
            return false;
        return true;
    }

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

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

    @Override
    public ListSchemaVersionsResult clone() {
        try {
            return (ListSchemaVersionsResult) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

}


text:
/**
 * \file
 *         border-router
 * \author
 *         Niclas Finne <nfi@sics.se>
 *         Joakim Eriksson <joakime@sics.se>
 *         Nicolas Tsiftes <nvt@sics.se>
 */

#include "contiki.h"
#include "contiki-lib.h"
#include "contiki-net.h"
#include "net/ip/uip.h"
#include "net/ipv6/uip-ds6.h"
#include "ip64.h"
#include "net/rpl/rpl.h"
#include "enc28j60.h"
#include "enc28j60-ip64-driver.h"
#include "net/netstack.h"
#include "dev/button-sensor.h"
#include "dev/slip.h"
#include "dev/leds.h"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

#define DEBUG DEBUG_PRINT
#include "net/ip/uip-debug.h"

static uip_ipaddr_t prefix;
static uint8_t prefix_set;

PROCESS(border_router_process, "Border router process");

#if WEBSERVER==0
/* No webserver */
AUTOSTART_PROCESSES(&border_router_process);
#elif WEBSERVER>1
/* Use an external webserver application */
#include "webserver-nogui.h"
AUTOSTART_PROCESSES(&border_router_process,&webserver_nogui_process);
#else
/* Use simple webserver with only one page for minimum footprint.
 * Multiple connections can result in interleaved tcp segments since
 * a single static buffer is used for all segments.
 */
#include "httpd-simple.h"
/* The internal webserver can provide additional information if
 * enough program flash is available.
 */
#define WEBSERVER_CONF_LOADTIME 1
#define WEBSERVER_CONF_FILESTATS 1
#define WEBSERVER_CONF_NEIGHBOR_STATUS 1
/* Adding links requires a larger RAM buffer. To avoid static allocation
 * the stack can be used for formatting; however tcp retransmissions
 * and multiple connections can result in garbled segments.
 * TODO:use PSOCk_GENERATOR_SEND and tcp state storage to fix this.
 */
#define WEBSERVER_CONF_ROUTE_LINKS 1
#if WEBSERVER_CONF_ROUTE_LINKS
#define BUF_USES_STACK 1
#endif

PROCESS(webserver_nogui_process, "Web server");
PROCESS_THREAD(webserver_nogui_process, ev, data)
{
  PROCESS_BEGIN();

  httpd_init();

  while(1) {
    PROCESS_WAIT_EVENT_UNTIL(ev == tcpip_event);
    httpd_appcall(data);
  }

  PROCESS_END();
}
AUTOSTART_PROCESSES(&border_router_process,&webserver_nogui_process);

static const char *TOP = "<title>ContikiRPL</title>\n";
static const char *BOTTOM = "\n";
#if BUF_USES_STACK
static char *bufptr, *bufend;
#define ADD(...) do {                                                   \
    bufptr += snprintf(bufptr, bufend - bufptr, __VA_ARGS__);      \
  } while(0)
#else
static char buf[256];
static int blen;
#define ADD(...) do {                                                   \
    blen += snprintf(&buf[blen], sizeof(buf) - blen, __VA_ARGS__);      \
  } while(0)
#endif

/*---------------------------------------------------------------------------*/
static void
ipaddr_add(const uip_ipaddr_t *addr)
{
  uint16_t a;
  int i, f;
  for(i = 0, f = 0; i < sizeof(uip_ipaddr_t); i += 2) {
    a = (addr->u8[i] << 8) + addr->u8[i + 1];
    if(a == 0 && f >= 0) {
      if(f++ == 0) ADD("::");
    } else {
      if(f > 0) {
        f = -1;
      } else if(i > 0) {
        ADD(":");
      }
      ADD("%x", a);
    }
  }
}
/*---------------------------------------------------------------------------*/
static
PT_THREAD(generate_routes(struct httpd_state *s))
{
  static uip_ds6_route_t *r;
  static uip_ds6_nbr_t *nbr;
#if BUF_USES_STACK
  char buf[256];
#endif
#if WEBSERVER_CONF_LOADTIME
  static clock_time_t numticks;
  numticks = clock_time();
#endif

  PSOCK_BEGIN(&s->sout);

  SEND_STRING(&s->sout, TOP);
#if BUF_USES_STACK
  bufptr = buf;bufend=bufptr+sizeof(buf);
#else
  blen = 0;
#endif
  ADD("Neighbors
");

  for(nbr = nbr_table_head(ds6_neighbors);
      nbr != NULL;
      nbr = nbr_table_next(ds6_neighbors, nbr)) {

#if WEBSERVER_CONF_NEIGHBOR_STATUS
#if BUF_USES_STACK
{char* j=bufptr+25;
      ipaddr_add(&nbr->ipaddr);
      while (bufptr < j) ADD(" ");
      switch (nbr->state) {
      case NBR_INCOMPLETE: ADD(" INCOMPLETE");break;
      case NBR_REACHABLE: ADD(" REACHABLE");break;
      case NBR_STALE: ADD(" STALE");break;
      case NBR_DELAY: ADD(" DELAY");break;
      case NBR_PROBE: ADD(" NBR_PROBE");break;
      }
}
#else
{uint8_t j=blen+25;
      ipaddr_add(&nbr->ipaddr);
      while (blen < j) ADD(" ");
      switch (nbr->state) {
      case NBR_INCOMPLETE: ADD(" INCOMPLETE");break;
      case NBR_REACHABLE: ADD(" REACHABLE");break;
      case NBR_STALE: ADD(" STALE");break;
      case NBR_DELAY: ADD(" DELAY");break;
      case NBR_PROBE: ADD(" NBR_PROBE");break;
      }
}
#endif
#else
      ipaddr_add(&nbr->ipaddr);
#endif

      ADD("\n");
#if BUF_USES_STACK
      if(bufptr > bufend - 45) {
        SEND_STRING(&s->sout, buf);
        bufptr = buf; bufend = bufptr + sizeof(buf);
      }
#else
      if(blen > sizeof(buf) - 45) {
        SEND_STRING(&s->sout, buf);
        blen = 0;
      }
#endif
  }
  ADD("
Routes
");
  SEND_STRING(&s->sout, buf);
#if BUF_USES_STACK
  bufptr = buf; bufend = bufptr + sizeof(buf);
#else
  blen = 0;
#endif

  for(r = uip_ds6_route_head(); r != NULL; r = uip_ds6_route_next(r)) {

#if BUF_USES_STACK
#if WEBSERVER_CONF_ROUTE_LINKS
    ADD("ipaddr);
    ADD("]/status.shtml>");
    ipaddr_add(&r->ipaddr);
    ADD("");
#else
    ipaddr_add(&r->ipaddr);
#endif
#else
#if WEBSERVER_CONF_ROUTE_LINKS
    ADD("ipaddr);
    ADD("]/status.shtml>");
    SEND_STRING(&s->sout, buf); //TODO: why tunslip6 needs an output here, wpcapslip does not
    blen = 0;
    ipaddr_add(&r->ipaddr);
    ADD("");
#else
    ipaddr_add(&r->ipaddr);
#endif
#endif
    ADD("/%u (via ", r->length);
    ipaddr_add(uip_ds6_route_nexthop(r));
    if(1 || (r->state.lifetime < 600)) {
      ADD(") %lus\n", (unsigned long)r->state.lifetime);
    } else {
      ADD(")\n");
    }
    SEND_STRING(&s->sout, buf);
#if BUF_USES_STACK
    bufptr = buf; bufend = bufptr + sizeof(buf);
#else
    blen = 0;
#endif
  }
  ADD("
");

#if WEBSERVER_CONF_FILESTATS
  static uint16_t numtimes;
  ADD("
This page sent %u times",++numtimes);
#endif

#if WEBSERVER_CONF_LOADTIME
  numticks = clock_time() - numticks + 1;
  ADD(" (%lu.%02lu sec)",numticks/CLOCK_SECOND,((100*(numticks%CLOCK_SECOND))/CLOCK_SECOND));
#endif

  SEND_STRING(&s->sout, buf);
  SEND_STRING(&s->sout, BOTTOM);

  PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
httpd_simple_script_t
httpd_simple_get_script(const char *name)
{
  return generate_routes;
}

#endif /* WEBSERVER */

/*---------------------------------------------------------------------------*/
static void
print_local_addresses(void)
{
  int i;
  uint8_t state;

  PRINTA("Server IPv6 addresses:\n");
  for(i = 0; i < UIP_DS6_ADDR_NB; i++) {
    state = uip_ds6_if.addr_list[i].state;
    if(uip_ds6_if.addr_list[i].isused &&
       (state == ADDR_TENTATIVE || state == ADDR_PREFERRED)) {
      PRINTA(" ");
      uip_debug_ipaddr_print(&uip_ds6_if.addr_list[i].ipaddr);
      PRINTA("\n");
    }
  }
}
/*---------------------------------------------------------------------------*/
void
request_prefix(void)
{
  /* mess up uip_buf with a dirty request... */
  uip_buf[0] = '?';
  uip_buf[1] = 'P';
  uip_len = 2;
  //slip_send();
  uip_clear_buf();
}
/*---------------------------------------------------------------------------*/
void
set_prefix_64(uip_ipaddr_t *prefix_64)
{
  rpl_dag_t *dag;
  uip_ipaddr_t ipaddr;
  memcpy(&prefix, prefix_64, 16);
  memcpy(&ipaddr, prefix_64, 16);
  prefix_set = 1;
  uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr);
  uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF);

  dag = rpl_set_root(RPL_DEFAULT_INSTANCE, &ipaddr);
  if(dag != NULL) {
    rpl_set_prefix(dag, &prefix, 64);
    PRINTF("created a new RPL dag\n");
  }
}

/*---------------------------------------------------------------------------*/
PROCESS_THREAD(border_router_process, ev, data)
{
  PROCESS_BEGIN();
  uip_ipaddr_t ipaddr;

/* While waiting for the prefix to be sent through the SLIP connection, the future
 * border router can join an existing DAG as a parent or child, or acquire a default
 * router that will later take precedence over the SLIP fallback interface.
 * Prevent that by turning the radio off until we are initialized as a DAG root.
 */
  prefix_set = 0;
  NETSTACK_MAC.off(0);

  PROCESS_PAUSE();

  SENSORS_ACTIVATE(button_sensor);
  leds_init();
  ip64_init();

  PRINTF("RPL-Border router started\n");
#if 0
   /* The border router runs with a 100% duty cycle in order to ensure high
     packet reception rates.
     Note if the MAC RDC is not turned off now, aggressive power management of the
     cpu will interfere with establishing the SLIP connection */
  NETSTACK_MAC.off(1);
#endif

  /* Now turn the radio on, but disable radio duty cycling.
   * Since we are the DAG root, reception delays would constrain mesh throughbut.
   */
  NETSTACK_MAC.off(1);

/* Derived from link local (MAC) address */
  uip_ip6addr(&ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 0);
  set_prefix_64(&ipaddr);
  print_local_addresses();

  while(1) {
    PROCESS_YIELD();
    leds_on(LEDS_YELLOW);
    if (ev == sensors_event && data == &button_sensor) {
      PRINTF("Initiating global repair\n");
      rpl_repair_root(RPL_DEFAULT_INSTANCE);
    }
  }

  PROCESS_END();
}
/*---------------------------------------------------------------------------*/


text:
package com.graphhopper.jsprit.core.algorithm.state;

import com.graphhopper.jsprit.core.algorithm.listener.IterationStartsListener;
import com.graphhopper.jsprit.core.algorithm.recreate.listener.*;
import com.graphhopper.jsprit.core.algorithm.ruin.listener.RuinListener;
import com.graphhopper.jsprit.core.algorithm.ruin.listener.RuinListeners;
import com.graphhopper.jsprit.core.problem.VehicleRoutingProblem;
import com.graphhopper.jsprit.core.problem.job.Job;
import com.graphhopper.jsprit.core.problem.solution.VehicleRoutingProblemSolution;
import com.graphhopper.jsprit.core.problem.solution.route.ReverseRouteActivityVisitor;
import com.graphhopper.jsprit.core.problem.solution.route.RouteActivityVisitor;
import com.graphhopper.jsprit.core.problem.solution.route.RouteVisitor;
import com.graphhopper.jsprit.core.problem.solution.route.VehicleRoute;
import com.graphhopper.jsprit.core.problem.solution.route.activity.ActivityVisitor;
import com.graphhopper.jsprit.core.problem.solution.route.activity.ReverseActivityVisitor;
import com.graphhopper.jsprit.core.problem.solution.route.activity.TourActivity;
import com.graphhopper.jsprit.core.problem.solution.route.state.RouteAndActivityStateGetter;
import com.graphhopper.jsprit.core.problem.vehicle.Vehicle;

import java.util.*;

/**
 * Manages states.
 *

 *
Some condition, rules or constraints are stateful. This StateManager manages these states, i.e. it offers
 * methods to add, store and retrieve states based on the problem, vehicle-routes and tour-activities.
 *
 * @author schroeder
 */
public class StateManager implements RouteAndActivityStateGetter, IterationStartsListener, RuinListener, InsertionStartsListener, JobInsertedListener, InsertionEndsListener {

    private RouteActivityVisitor routeActivityVisitor = new RouteActivityVisitor();

    private ReverseRouteActivityVisitor revRouteActivityVisitor = new ReverseRouteActivityVisitor();

    private Collection<RouteVisitor> routeVisitors = new ArrayList<RouteVisitor>();

    private RuinListeners ruinListeners = new RuinListeners();

    private InsertionListeners insertionListeners = new InsertionListeners();

    private Collection<StateUpdater> updaters = new ArrayList<StateUpdater>();

    private boolean updateLoad = false;

    private boolean updateTWs = false;

    private final int initialNoStates = 21;

    private int stateIndexCounter;

    private Map<String, StateId> createdStateIds = new HashMap<String, StateId>();

    private int nuActivities;

    private int nuVehicleTypeKeys;

    private Object[] problemStates;

    private Object[][] activityStates;

    private Object[][][] vehicleDependentActivityStates;

    private Map<VehicleRoute, Object[]> routeStateMap;

    private Map<VehicleRoute, Object[][]> vehicleDependentRouteStateMap;

    private Object[][] routeStatesArr;

    private Object[][][] vehicleDependentRouteStatesArr;

    private VehicleRoutingProblem vrp;

    private final boolean isIndexedBased;

    int getMaxIndexOfVehicleTypeIdentifiers() {
        return nuVehicleTypeKeys;
    }

    /**
     * Create and returns a stateId with the specified state-name.
     *

     *
If a stateId with the specified name has already been created, it returns the created stateId.

     *
If the specified is equal to a name that is already used internally, it throws an IllegalStateException

     *
     * @param name the specified name of the state
     * @return the stateId with which a state can be identified, no matter if it is a problem, route or activity state.
     * @throws java.lang.IllegalStateException if name of state is already used internally
     */
    public StateId createStateId(String name) {
        if (createdStateIds.containsKey(name)) return createdStateIds.get(name);
        if (stateIndexCounter >= activityStates[0].length) {
            activityStates = new Object[nuActivities][stateIndexCounter + 1];
            vehicleDependentActivityStates = new Object[nuActivities][nuVehicleTypeKeys][stateIndexCounter + 1];
            routeStatesArr = new Object[vrp.getVehicles().size() + 2][stateIndexCounter+1];
            vehicleDependentRouteStatesArr = new Object[vrp.getVehicles().size() + 2][nuVehicleTypeKeys][stateIndexCounter+1];
            problemStates = new Object[stateIndexCounter+1];
        }
        StateId id = StateFactory.createId(name, stateIndexCounter);
        incStateIndexCounter();
        createdStateIds.put(name, id);
        return id;
    }

    private void incStateIndexCounter() {
        stateIndexCounter++;
    }

    /**
     * Constructs the stateManager with the specified VehicleRoutingProblem.
     *
     * @param vehicleRoutingProblem the corresponding VehicleRoutingProblem
     */
    public StateManager(VehicleRoutingProblem vehicleRoutingProblem) {
        stateIndexCounter = initialNoStates;
        int initialStateArrayLength = 30;
        this.vrp = vehicleRoutingProblem;
        nuActivities = Math.max(10, vrp.getNuActivities() + 1);
        nuVehicleTypeKeys = Math.max(3, getNuVehicleTypes(vrp) + 2);
        activityStates = new Object[nuActivities][initialStateArrayLength];
        vehicleDependentActivityStates = new Object[nuActivities][nuVehicleTypeKeys][initialStateArrayLength];
//        if(vehicleRoutingProblem.getFleetSize().equals(VehicleRoutingProblem.FleetSize.FINITE)){
//            isIndexedBased = true;
//            routeStatesArr = new Object[vrp.getVehicles().size() + 2][initialStateArrayLength];
//            vehicleDependentRouteStatesArr = new Object[vrp.getVehicles().size() + 2][nuVehicleTypeKeys][initialStateArrayLength];
//        }
//        else {
            isIndexedBased = false;
            routeStateMap = new HashMap<VehicleRoute, Object[]>();
            vehicleDependentRouteStateMap = new HashMap<VehicleRoute, Object[][]>();
//        }
        problemStates = new Object[initialStateArrayLength];
    }

    private int getNuVehicleTypes(VehicleRoutingProblem vrp) {
        int maxIndex = 0;
        for (Vehicle v : vrp.getVehicles()) {
            maxIndex = Math.max(maxIndex, v.getVehicleTypeIdentifier().getIndex());
        }
        return maxIndex;
    }

    /**
     * Associates the specified state to the stateId. If there already exists a state value for the stateId, this old
     * value is replaced by the new value.
     *
     * @param stateId the stateId which is the associated key to the problem state
     * @param type    the type of the problem state
     * @param state   the actual state value
     * @param <T>     the type of the state value
     */
    public <T> void putProblemState(StateId stateId, Class<T> type, T state) {
        problemStates[stateId.getIndex()] = state;
//         problemStates.putState(stateId, type, state);
    }

    /**
     * Returns mapped state value that is associated to the specified stateId, or null if no value is associated to
     * the specified stateId.
     *
     * @param stateId the stateId which is the associated key to the problem state
     * @param type    the type class of the state value
     * @param <T>     the type
     * @return the state value that is associated to the specified stateId or null if no value is associated
     */
    public <T> T getProblemState(StateId stateId, Class<T> type) {
        return type.cast(problemStates[stateId.getIndex()]);
    }

    /**
     * Clears all states, i.e. set all value to null.
     */
    public void clear() {
        fill_twoDimArr(activityStates, null);
        fill_threeDimArr(vehicleDependentActivityStates, null);
        if(isIndexedBased) {
            fill_twoDimArr(routeStatesArr, null);
            fill_threeDimArr(vehicleDependentRouteStatesArr, null);
        }
        else{
            routeStateMap.clear();
            vehicleDependentRouteStateMap.clear();
        }
        Arrays.fill(problemStates,null);
    }

    private void fill_threeDimArr(Object[][][] states, Object o) {
        for (Object[][] twoDimArr : states) {
            for (Object[] oneDimArr : twoDimArr) {
                Arrays.fill(oneDimArr, o);
            }
        }
    }

    private void fill_twoDimArr(Object[][] states, Object o) {
        for (Object[] rows : states) {
            Arrays.fill(rows, o);
        }
    }

    /**
     * Returns associated state for the specified activity and stateId, or it returns null if no value is associated.
     *
If type class is not equal to the associated type class of the requested state value, it throws a ClassCastException.

     *
     * @param act     the activity for which a state value is associated to
     * @param stateId the stateId for which a state value is associated to
     * @param type    the type of class of the associated state value
     * @param <T>     the type
     * @return the state value that is associated to the specified activity and stateId, or null if no value is associated.
     * @throws java.lang.ClassCastException    if type class is not equal to the associated type class of the requested state value
     * @throws java.lang.IllegalStateException if act.getIndex()==0 since this suggests that act has no index at all
     */
    @Override
    public <T> T getActivityState(TourActivity act, StateId stateId, Class<T> type) {
        if (act.getIndex() == 0) throw new IllegalStateException("activity index is 0. this should not be.");
        if (act.getIndex() < 0) return null;
        T state;
        try {
            state = type.cast(activityStates[act.getIndex()][stateId.getIndex()]);
        } catch (ClassCastException e) {
            throw getClassCastException(e, stateId, type.toString(), activityStates[act.getIndex()][stateId.getIndex()].getClass().toString());
        }
        return state;
    }

    /**
     * Returns true if a state value is associated to the specified activity, vehicle and stateId.
     *
     * @param act     the activity for which a state value is associated to
     * @param vehicle the vehicle for which a state value is associated to
     * @param stateId the stateId which is the associated key to the problem state
     * @return true if a state value is associated otherwise false
     * @throws java.lang.IllegalStateException if act.getIndex()==0 since this suggests that act has no index at all
     */
    public boolean hasActivityState(TourActivity act, Vehicle vehicle, StateId stateId) {
        if (act.getIndex() == 0) throw new IllegalStateException("activity index is 0. this should not be.");
        return vehicleDependentActivityStates[act.getIndex()][vehicle.getVehicleTypeIdentifier().getIndex()][stateId.getIndex()] != null;
    }

    /**
     * Returns the associated state value to the specified activity, vehicle and stateId, or null if no state value is
     * associated.
     *
If type class is not equal to the associated type class of the requested state value, it throws a ClassCastException.

     *
     * @param act     the activity for which a state value is associated to
     * @param vehicle the vehicle for which a state value is associated to
     * @param stateId the stateId which is the associated key to the problem state
     * @param type    the class of the associated state value
     * @param <T>     the type of the class
     * @return the associated state value to the specified activity, vehicle and stateId, or null if no state value is
     * associated.
     * @throws java.lang.ClassCastException    if type class is not equal to the associated type class of the requested state value
     * @throws java.lang.IllegalStateException if act.getIndex()==0 since this suggests that act has no index at all
     */
    public <T> T getActivityState(TourActivity act, Vehicle vehicle, StateId stateId, Class<T> type) {
        if (act.getIndex() == 0) throw new IllegalStateException("activity index is 0. this should not be.");
        if (act.getIndex() < 0) return null; //act.getIndex() < 0 indicates that act is either Start (-1) or End (-2)
        T state;
        try {
            state = type.cast(vehicleDependentActivityStates[act.getIndex()][vehicle.getVehicleTypeIdentifier().getIndex()][stateId.getIndex()]);
        } catch (ClassCastException e) {
            Object state_class = vehicleDependentActivityStates[act.getIndex()][vehicle.getVehicleTypeIdentifier().getIndex()][stateId.getIndex()];
            throw getClassCastException(e, stateId, type.toString(), state_class.getClass().toString());
        }
        return state;
    }

    private ClassCastException getClassCastException(ClassCastException e, StateId stateId, String requestedTypeClass, String memorizedTypeClass) {
        return new ClassCastException(e + "\n" + "state with stateId '" + stateId.toString() + "' is of " + memorizedTypeClass + ". cannot cast it to " + requestedTypeClass + ".");
    }

    /**
     * Returns the route state that is associated to the route and stateId, or null if no state is associated.
     *
If type class is not equal to the associated type class of the requested state value, it throws a ClassCastException.

     *
     * @param route   the route which the associated route key to the route state
     * @param stateId the stateId which is the associated key to the route state
     * @param type    the class of the associated state value
     * @param <T>     the type of the class
     * @return the route state that is associated to the route and stateId, or null if no state is associated.
     * @throws java.lang.ClassCastException    if type class is not equal to the associated type class of the requested state value
     * @throws java.lang.IllegalStateException if !route.isEmpty() and act(0).getIndex()==0 since this suggests that act has no index at all
     */
    @Override
    public <T> T getRouteState(VehicleRoute route, StateId stateId, Class<T> type) {
        if (route.isEmpty()) return null;
        T state = null;
        if(isIndexedBased){
            try {
                state = type.cast(routeStatesArr[route.getVehicle().getIndex()][stateId.getIndex()]);
            } catch (ClassCastException e) {
                throw getClassCastException(e,stateId,type.toString(),routeStatesArr[route.getVehicle().getIndex()][stateId.getIndex()].getClass().toString());
            }
        }
        else {
            try {
                if (routeStateMap.containsKey(route)) {
                    state = type.cast(routeStateMap.get(route)[stateId.getIndex()]);
                }
            } catch (ClassCastException e) {
                throw getClassCastException(e, stateId, type.toString(), routeStateMap.get(route)[stateId.getIndex()].getClass().toString());
            }
        }
        return state;
    }

    /**
     * Returns true if a state is assigned to the specified route, vehicle and stateId. Otherwise it returns false.
     *
     * @param route   the route for which the state is requested
     * @param vehicle the vehicle for which the state is requested
     * @param stateId the stateId(entifier) for the state that is requested
     * @return true if state exists and false otherwise
     */
    @SuppressWarnings("UnusedDeclaration")
    public boolean hasRouteState(VehicleRoute route, Vehicle vehicle, StateId stateId) {
        if (!vehicleDependentRouteStateMap.containsKey(route)) return false;
        return vehicleDependentRouteStateMap.get(route)[vehicle.getVehicleTypeIdentifier().getIndex()][stateId.getIndex()] != null;
//        return vehicle_dependent_route_states[route.getActivities().get(0).getIndex()][vehicle.getVehicleTypeIdentifier().getIndex()][stateId.getIndex()] != null;
    }

    /**
     * Returns the route state that is assigned to the specified route, vehicle and stateId.
     *
Returns null if no state can be found

     *
     * @param route   the route for which the state is requested
     * @param vehicle the vehicle for which the state is requested
     * @param stateId the stateId(entifier) for the state that is requested
     * @param type    the type class of the requested state
     * @param <T>     the type of the class
     * @return the actual route state that is assigned to the route, vehicle and stateId
     * @throws java.lang.ClassCastException    if specified type is not equal to the memorized type
     * @throws java.lang.IllegalStateException if !route.isEmpty() and act(0).getIndex()==0 since this suggests that act has no index at all
     */
    public <T> T getRouteState(VehicleRoute route, Vehicle vehicle, StateId stateId, Class<T> type) {
        if (route.isEmpty()) return null;
        T state = null;
        if(isIndexedBased){
            try {
                state = type.cast(vehicleDependentRouteStatesArr[route.getVehicle().getIndex()][vehicle.getVehicleTypeIdentifier().getIndex()][stateId.getIndex()]);
            } catch (ClassCastException e) {
                throw getClassCastException(e, stateId, type.toString(), vehicleDependentRouteStatesArr[route.getVehicle().getIndex()][vehicle.getVehicleTypeIdentifier().getIndex()][stateId.getIndex()].getClass().toString());
            }
        }
        else {
            try {
                if (vehicleDependentRouteStateMap.containsKey(route)) {
                    state = type.cast(vehicleDependentRouteStateMap.get(route)[vehicle.getVehicleTypeIdentifier().getIndex()][stateId.getIndex()]);
                }
            } catch (ClassCastException e) {
                throw getClassCastException(e, stateId, type.toString(), vehicleDependentRouteStateMap.get(route)[vehicle.getVehicleTypeIdentifier().getIndex()][stateId.getIndex()].getClass().toString());
            }
        }
        return state;
    }

    /**
     * Associates the specified activity and stateId to the state value. If a state value is already associated to the
     * specified activity and stateId, it is replaced by the new state value.
     *
     * @param act     the activity for which a state value is associated to
     * @param stateId the stateId which is the associated key to the activity state
     * @param state   the state that is associated to the activity and stateId
     * @param <T>     the type of the state
     * @throws java.lang.IllegalStateException if act.getIndex() == 0
     *                                         || stateId.getIndex < noInternalStates
     */
    public <T> void putActivityState(TourActivity act, StateId stateId, T state) {
        if (act.getIndex() == 0) throw new IllegalStateException("activity index is 0. this should not be.");
        if (stateId.getIndex() < initialNoStates)
            throw new IllegalStateException("either you use a reserved stateId that is applied\n" +
                "internally or your stateId has been created without index, e.g. StateFactory.createId(stateName)\n" +
                " does not assign indeces thus do not use it anymore, but use\n " +
                "stateManager.createStateId(name)\n" +
                " instead.\n");
        putInternalTypedActivityState(act, stateId, state);
    }

    /**
     * Associates the specified activity, vehicle and stateId to the state value. If a state value is already associated to the
     * specified activity and stateId, it is replaced by the new state value.
     *
     * @param act     the activity for which a state value is associated to
     * @param vehicle the vehicle for which a state value is associated to
     * @param stateId the stateId which is the associated key to the activity state
     * @param state   the state that is associated to the activity and stateId
     * @param <T>     the type of the state
     * @throws java.lang.IllegalStateException if act.getIndex() == 0
     *                                         || stateId.getIndex < noInternalStates
     */
    public <T> void putActivityState(TourActivity act, Vehicle vehicle, StateId stateId, T state) {
        if (act.getIndex() == 0) throw new IllegalStateException("activity index is 0. this should not be.");
        if (stateId.getIndex() < initialNoStates)
            throw new IllegalStateException("either you use a reserved stateId that is applied\n" +
                "internally or your stateId has been created without index, e.g. StateFactory.createId(stateName)\n" +
                " does not assign indeces thus do not use it anymore, but use\n " +
                "stateManager.createStateId(name)\n" +
                " instead.\n");
        putInternalTypedActivityState(act, vehicle, stateId, state);
    }

    <T> void putInternalTypedActivityState(TourActivity act, StateId stateId, T state) {
        activityStates[act.getIndex()][stateId.getIndex()] = state;
    }

    <T> void putInternalTypedActivityState(TourActivity act, Vehicle vehicle, StateId stateId, T state) {
        vehicleDependentActivityStates[act.getIndex()][vehicle.getVehicleTypeIdentifier().getIndex()][stateId.getIndex()] = state;
    }

    /**
     * Associates the specified route, vehicle and stateId to the state value. If a state value is already associated to the
     * specified activity and stateId, it is replaced by the new state value.
     *
     * @param route   the route for which a state value is associated to
     * @param stateId the stateId which is the associated key to the activity state
     * @param state   the state that is associated to the activity and stateId
     * @param <T>     the type of the state
     * @throws java.lang.IllegalStateException if stateId is equal to a stateId that is already used internally.
     */
    public <T> void putRouteState(VehicleRoute route, StateId stateId, T state) {
        if (stateId.getIndex() < initialNoStates) StateFactory.throwReservedIdException(stateId.toString());
        putTypedInternalRouteState(route, stateId, state);
    }

    /**
     * Associates the specified route, vehicle and stateId to the state value. If a state value is already associated to the
     * specified activity and stateId, it is replaced by the new state value.
     *
     * @param route   the route for which a state value is associated to
     * @param vehicle the vehicle for which a state value is associated to
     * @param stateId the stateId which is the associated key to the activity state
     * @param state   the state that is associated to the activity and stateId
     * @param <T>     the type of the state
     * @throws java.lang.IllegalStateException if vehicle.getIndex() == 0 || stateId.getIndex() < noInternalStates
     */
    public <T> void putRouteState(VehicleRoute route, Vehicle vehicle, StateId stateId, T state) {
        if (vehicle.getIndex() == 0) throw new IllegalStateException("vehicle index is 0. this should not be.");
        if (stateId.getIndex() < initialNoStates) StateFactory.throwReservedIdException(stateId.toString());
        putTypedInternalRouteState(route, vehicle, stateId, state);
    }

    <T> void putTypedInternalRouteState(VehicleRoute route, StateId stateId, T state) {
        if (route.isEmpty()) return;
        if(isIndexedBased){
            routeStatesArr[route.getVehicle().getIndex()][stateId.getIndex()] = state;
        }
        else {
            if (!routeStateMap.containsKey(route)) {
                routeStateMap.put(route, new Object[stateIndexCounter]);
            }
            routeStateMap.get(route)[stateId.getIndex()] = state;
        }
    }

    <T> void putTypedInternalRouteState(VehicleRoute route, Vehicle vehicle, StateId stateId, T state) {
        if (route.isEmpty()) return;
        if(isIndexedBased){
            vehicleDependentRouteStatesArr[route.getVehicle().getIndex()][vehicle.getVehicleTypeIdentifier().getIndex()][stateId.getIndex()] = state;
        }
        else {
            if (!vehicleDependentRouteStateMap.containsKey(route)) {
                vehicleDependentRouteStateMap.put(route, new Object[nuVehicleTypeKeys][stateIndexCounter]);
            }
            vehicleDependentRouteStateMap.get(route)[vehicle.getVehicleTypeIdentifier().getIndex()][stateId.getIndex()] = state;
        }

    }

    /**
     * Adds state updater.
     *

     *
Note that a state update occurs if route and/or activity states have changed, i.e. if jobs are removed
     * or inserted into a route. Thus here, it is assumed that a state updater is either of type InsertionListener,
     * RuinListener, ActivityVisitor, ReverseActivityVisitor, RouteVisitor, ReverseRouteVisitor.
     *

     *
The following rule pertain for activity/route visitors:These visitors visits all activities/route in a route subsequently in two cases. First, if insertionStart (after ruinStrategies have removed activities from routes)
     * and, second, if a job has been inserted and thus if a route has changed.
     *
     * @param updater the update to be added
     */
    public void addStateUpdater(StateUpdater updater) {
        if (updater instanceof ActivityVisitor) addActivityVisitor((ActivityVisitor) updater);
        if (updater instanceof ReverseActivityVisitor) addActivityVisitor((ReverseActivityVisitor) updater);
        if (updater instanceof RouteVisitor) addRouteVisitor((RouteVisitor) updater);
        if (updater instanceof InsertionListener) addListener((InsertionListener) updater);
        if (updater instanceof RuinListener) addListener((RuinListener) updater);
        updaters.add(updater);
    }

    public void addAllStateUpdater(Collection<StateUpdater> updaters) {
        for (StateUpdater u : updaters) addStateUpdater(u);
    }

    /**
     * Returns an unmodifiable collections of stateUpdaters that have been added to this stateManager.
     *
     * @return an unmodifiable collections of stateUpdaters that have been added to this stateManager.
     */
    @SuppressWarnings("UnusedDeclaration")
    Collection<StateUpdater> getStateUpdaters() {
        return Collections.unmodifiableCollection(updaters);
    }

    /**
     * Adds an activityVisitor.
     *
This visitor visits all activities in a route subsequently in two cases. First, if insertionStart (after ruinStrategies have removed activities from routes)
     * and, second, if a job has been inserted and thus if a route has changed.
     *
     * @param activityVistor the activity-visitor to be added
     */
    void addActivityVisitor(ActivityVisitor activityVistor) {
        routeActivityVisitor.addActivityVisitor(activityVistor);
    }

    /**
     * Adds an reverseActivityVisitor.
     *
This reverseVisitor visits all activities in a route subsequently (starting from the end of the route) in two cases. First, if insertionStart (after ruinStrategies have removed activities from routes)
     * and, second, if a job has been inserted and thus if a route has changed.
     *
     * @param activityVistor activityVisitor to add
     */
    void addActivityVisitor(ReverseActivityVisitor activityVistor) {
        revRouteActivityVisitor.addActivityVisitor(activityVistor);
    }

    void addRouteVisitor(RouteVisitor routeVisitor) {
        routeVisitors.add(routeVisitor);
    }

    void addListener(RuinListener ruinListener) {
        ruinListeners.addListener(ruinListener);
    }

    void addListener(InsertionListener insertionListener) {
        insertionListeners.addListener(insertionListener);
    }

    @Override
    public void informJobInserted(Job job2insert, VehicleRoute inRoute, double additionalCosts, double additionalTime) {
//		log.debug("insert " + job2insert + " in " + inRoute);
        insertionListeners.informJobInserted(job2insert, inRoute, additionalCosts, additionalTime);
        for (RouteVisitor v : routeVisitors) {
            v.visit(inRoute);
        }
        routeActivityVisitor.visit(inRoute);
        revRouteActivityVisitor.visit(inRoute);
    }

    @Override
    public void informInsertionStarts(Collection<VehicleRoute> vehicleRoutes, Collection<Job> unassignedJobs) {
        insertionListeners.informInsertionStarts(vehicleRoutes, unassignedJobs);
        for (VehicleRoute route : vehicleRoutes) {
            for (RouteVisitor v : routeVisitors) {
                v.visit(route);
            }
            routeActivityVisitor.visit(route);
            revRouteActivityVisitor.visit(route);
        }
    }

    public void reCalculateStates(VehicleRoute route){
        informInsertionStarts(Arrays.asList(route),Collections.<Job>emptyList());
    }

    @Override
    public void informIterationStarts(int i, VehicleRoutingProblem problem, Collection<VehicleRoutingProblemSolution> solutions) {
        clear();
    }

    @Override
    public void ruinStarts(Collection<VehicleRoute> routes) {
        ruinListeners.ruinStarts(routes);
    }

    @Override
    public void ruinEnds(Collection<VehicleRoute> routes, Collection<Job> unassignedJobs) {
//		log.debug("ruin ends");
        ruinListeners.ruinEnds(routes, unassignedJobs);
    }

    @Override
    public void removed(Job job, VehicleRoute fromRoute) {
        ruinListeners.removed(job, fromRoute);
    }

    @Override
    public void informInsertionEnds(Collection<VehicleRoute> vehicleRoutes) {
        insertionListeners.informInsertionEndsListeners(vehicleRoutes);
    }

    /**
     * Updates load states.
     */
    public void updateLoadStates() {
        if (!updateLoad) {
            updateLoad = true;
            UpdateLoads updateLoads = new UpdateLoads(this);
            addActivityVisitor(updateLoads);
            addListener(updateLoads);
            addActivityVisitor(new UpdateMaxCapacityUtilisationAtActivitiesByLookingBackwardInRoute(this));
            addActivityVisitor(new UpdateMaxCapacityUtilisationAtActivitiesByLookingForwardInRoute(this));
            addActivityVisitor(new UpdateMaxCapacityUtilisationAtRoute(this));
        }
    }

    /**
     * Updates time-window states.
     */
    public void updateTimeWindowStates() {
        updateTWs = true;
    }

    public boolean timeWindowUpdateIsActivated() {
        return updateTWs;
    }

    /**
     * Updates skill states.
     */
    public void updateSkillStates() {
        addActivityVisitor(new UpdateSkills(this));
    }

}


text:
#include <boost/python.hpp>
#include <Eigen/Core>

#include "eigenpy/decompositions/decompositions.hpp"

#include "eigenpy/decompositions/EigenSolver.hpp"
#include "eigenpy/decompositions/SelfAdjointEigenSolver.hpp"
#include "eigenpy/decompositions/LLT.hpp"
#include "eigenpy/decompositions/LDLT.hpp"

namespace eigenpy
{
  void exposeDecompositions()
  {
    using namespace Eigen;
    namespace bp = boost::python;

    EigenSolverVisitor<MatrixXd>::expose("EigenSolver");
    SelfAdjointEigenSolverVisitor<MatrixXd>::expose("SelfAdjointEigenSolver");
    LLTSolverVisitor<MatrixXd>::expose("LLT");
    LDLTSolverVisitor<MatrixXd>::expose("LDLT");

    {
      bp::enum_<DecompositionOptions>("DecompositionOptions")
      .value("ComputeFullU",ComputeFullU)
      .value("ComputeThinU",ComputeThinU)
      .value("ComputeFullV",ComputeFullV)
      .value("ComputeThinV",ComputeThinV)
      .value("EigenvaluesOnly",EigenvaluesOnly)
      .value("ComputeEigenvectors",ComputeEigenvectors)
      .value("Ax_lBx",Ax_lBx)
      .value("ABx_lx",ABx_lx)
      .value("BAx_lx",BAx_lx)
      ;
    }

  }
} // namespace eigenpy


text:
export = IQuery;
declare function IQuery(): void;
declare class IQuery {
    _joinManager: IJoinManager;
    _checkPermission: boolean;
    iClauseWhereManager_: IClauseWhereManager;
    private _leftJoinIQuery;
    private _permissionJoins;
    private userKey;
    column(field: IClauseSelect | Record<any, any>, ...args: any[]): IClauseSelect;
    from(classKey: number, alias: any): IQuery;
    _iClauseFrom: IClauseFrom;
    innerJoin(iQueryJoin: any): IClauseJoin;
    leftOuterJoin(iQueryJoin: any): IClauseJoin;
    where(where: any): IQuery;
    validatePermission: number;
    uncheckPermission(): IQuery;
    checkPermission(): IQuery;
    joinManager: IJoinManager;
    getLeftJoinIQuery(): IClauseJoin;
    getWhereSql(join?: boolean): string;
    clauseFrom: IClauseFrom;
    whereClauseCount: number;
    toSql(): string;
}
declare namespace IQuery {
    export { defaultCheckPermission, from, DBKey, IClauseJoin };
}
import IJoinManager = require('./IJoinManager.js');
import IClauseWhereManager = require('./IClauseWhereManager.js');
import IClauseSelect = require('./IClauseSelect.js');
import IClauseFrom = require('./IClauseFrom.js');
type IClauseJoin = import('./IClauseJoin');
declare var defaultCheckPermission: boolean;
declare var from: any;
type DBKey = import('@nginstack/engine/lib/dbkey/DBKey');


text:
package main

import (
	"os"
	"os/signal"

	"github.com/opencontainers/runc/libcontainer"
	"github.com/opencontainers/runc/libcontainer/system"
	"github.com/opencontainers/runc/libcontainer/utils"

	"github.com/sirupsen/logrus"
	"golang.org/x/sys/unix"
)

const signalBufferSize = 2048

// newSignalHandler returns a signal handler for processing SIGCHLD and SIGWINCH signals
// while still forwarding all other signals to the process.
// If notifySocket is present, use it to read systemd notifications from the container and
// forward them to notifySocketHost.
func newSignalHandler(enableSubreaper bool, notifySocket *notifySocket) *signalHandler {
	if enableSubreaper {
		// set us as the subreaper before registering the signal handler for the container
		if err := system.SetSubreaper(1); err != nil {
			logrus.Warn(err)
		}
	}
	// ensure that we have a large buffer size so that we do not miss any signals
	// in case we are not processing them fast enough.
	s := make(chan os.Signal, signalBufferSize)
	// handle all signals for the process.
	signal.Notify(s)
	return &signalHandler{
		signals:      s,
		notifySocket: notifySocket,
	}
}

// exit models a process exit status with the pid and
// exit status.
type exit struct {
	pid    int
	status int
}

type signalHandler struct {
	signals      chan os.Signal
	notifySocket *notifySocket
}

// forward handles the main signal event loop forwarding, resizing, or reaping depending
// on the signal received.
func (h *signalHandler) forward(process *libcontainer.Process, tty *tty, detach bool) (int, error) {
	// make sure we know the pid of our main process so that we can return
	// after it dies.
	if detach && h.notifySocket == nil {
		return 0, nil
	}

	pid1, err := process.Pid()
	if err != nil {
		return -1, err
	}

	if h.notifySocket != nil {
		if detach {
			_ = h.notifySocket.run(pid1)
			return 0, nil
		}
		_ = h.notifySocket.run(os.Getpid())
		go func() { _ = h.notifySocket.run(0) }()
	}

	// Perform the initial tty resize. Always ignore errors resizing because
	// stdout might have disappeared (due to races with when SIGHUP is sent).
	_ = tty.resize()
	// Handle and forward signals.
	for s := range h.signals {
		switch s {
		case unix.SIGWINCH:
			// Ignore errors resizing, as above.
			_ = tty.resize()
		case unix.SIGCHLD:
			exits, err := h.reap()
			if err != nil {
				logrus.Error(err)
			}
			for _, e := range exits {
				logrus.WithFields(logrus.Fields{
					"pid":    e.pid,
					"status": e.status,
				}).Debug("process exited")
				if e.pid == pid1 {
					// call Wait() on the process even though we already have the exit
					// status because we must ensure that any of the go specific process
					// fun such as flushing pipes are complete before we return.
					_, _ = process.Wait()
					return e.status, nil
				}
			}
		case unix.SIGURG:
			// SIGURG is used by go runtime for async preemptive
			// scheduling, so runc receives it from time to time,
			// and it should not be forwarded to the container.
			// Do nothing.
		default:
			us := s.(unix.Signal)
			logrus.Debugf("forwarding signal %d (%s) to %d", int(us), unix.SignalName(us), pid1)
			if err := unix.Kill(pid1, us); err != nil {
				logrus.Error(err)
			}
		}
	}
	return -1, nil
}

// reap runs wait4 in a loop until we have finished processing any existing exits
// then returns all exits to the main event loop for further processing.
func (h *signalHandler) reap() (exits []exit, err error) {
	var (
		ws  unix.WaitStatus
		rus unix.Rusage
	)
	for {
		pid, err := unix.Wait4(-1, &ws, unix.WNOHANG, &rus)
		if err != nil {
			if err == unix.ECHILD { //nolint:errorlint // unix errors are bare
				return exits, nil
			}
			return nil, err
		}
		if pid <= 0 {
			return exits, nil
		}
		exits = append(exits, exit{
			pid:    pid,
			status: utils.ExitStatus(ws),
		})
	}
}


text:
public @interface A {
  Class value();
}


text:
<?php
namespace app\controllers;

use app\models\Barang;
use Yii;
use app\models\BarangMutasiStock;
use app\models\BarangMutasiStockSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;

/**
 * BarangMutasiStockController implements the CRUD actions for BarangMutasiStock model.
 */
class BarangMutasiStockController extends Controller
{

    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            'verbs' => [
                'class'   => VerbFilter::className(),
                'actions' => [
                    'delete' => ['POST'],
                ],
            ],
        ];
    }

    /**
     * Lists all BarangMutasiStock models.
     *
     * @return mixed
     */
    public function actionIndex()
    {
        $searchModel = new BarangMutasiStockSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
        return $this->render(
            'index',
            [
                'searchModel'  => $searchModel,
                'dataProvider' => $dataProvider,
            ]
        );
    }

    /**
     * Displays a single BarangMutasiStock model.
     *
     * @param integer $id
     *
     * @return mixed
     */
    public function actionView($id)
    {
        return $this->render(
            'view',
            [
                'model' => $this->findModel($id),
            ]
        );
    }

    /**
     * Creates a new BarangMutasiStock model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     *
     * @return mixed
     */
    public function actionCreate()
    {
        $model = new BarangMutasiStock();
        $modelBarang = new Barang();
        $record = $modelBarang->findOne(['id' => Yii::$app->request->post('BarangMutasiStock')['id_barang']]);
        if ($record !== null) {
            if ($record['stock'] !== null) {
                $record->stock += Yii::$app->request->post('BarangMutasiStock')['stock'];
            } else {
                $record->stock = Yii::$app->request->post('BarangMutasiStock')['stock'];
            }
            $model->stock_awal = $record->stock;
        } else {
            $model->stock_awal = 0;
        }
        $model->user_id = Yii::$app->user->identity->id;
        if ($model->load(Yii::$app->request->post()) && $model->save() && $record->save(false)) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render(
                'create',
                [
                    'model' => $model,
                ]
            );
        }
    }

    /**
     * Updates an existing BarangMutasiStock model.
     * If update is successful, the browser will be redirected to the 'view' page.
     *
     * @param integer $id
     *
     * @return mixed
     */
    public function actionUpdate($id)
    {
        $model = $this->findModel($id);
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render(
                'update',
                [
                    'model' => $model,
                ]
            );
        }
    }

    /**
     * Deletes an existing BarangMutasiStock model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     *
     * @param integer $id
     *
     * @return mixed
     */
    public function actionDelete($id)
    {
        $this->findModel($id)->delete();
        return $this->redirect(['index']);
    }

    /**
     * Finds the BarangMutasiStock model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     *
     * @param integer $id
     *
     * @return BarangMutasiStock the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = BarangMutasiStock::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}


text:
import {
  Component,
  Input,
  trigger,
  state,
  style,
  animate,
  transition,
  OnInit
} from '@angular/core';
import { Router } from '@angular/router';

import { AuthService } from '../auth/auth.service';
import { UserAuthService } from '../auth/user-auth.service';

import { Credentials } from '../auth/credentials.model';

@Component({
  selector: 'login',
  templateUrl: 'login.component.html',
  styleUrls: ['login.component.scss'],
  animations: [
    trigger('flyIn', [
      state('in', style({transform: 'translateY(0)'})),
      transition('void => *', [
        style({transform: 'translateY(-100%)', opacity: 0}),
        animate('900ms 200ms ease-in-out')
      ])
    ])
  ]
})
export class LoginComponent implements OnInit {

  @Input()
  public credentials = new Credentials();

  private loginFailed = false;
  private queryInProgress = false;

  constructor(
    private auth: AuthService,
    private userAuth: UserAuthService,
    private router: Router) { }

  login() {
    this.loginFailed = false;
    this.queryInProgress = true;
    this.userAuth.login(this.credentials)
      .then(data => {
        this.queryInProgress = false;
        // if we've se redirect url
        if (this.auth.redirectUrl) {
          const url = this.auth.redirectUrl;
          this.auth.redirectUrl = null;
          this.router.navigate([url]);
          // if not - default redirect
        } else {
          this.router.navigate(['/dashboard']);
        }
      })
      .catch(res => {
        this.queryInProgress = false;
        console.log(res);
        if (res.status === 401) {
          this.loginFailed = true;
        }
      });
    // setTimeout(() => {this.auth.isAuth = true; this.router.navigate(['/dashboard'])}, 2000);
  }

  ngOnInit() { }
}


text:
<!DOCTYPE html>

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

    <title>Cover Template for Bootstrap</title>

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

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

Home

Team

Features

Contact

Lane Fujikado

Lane Fujikado is a senior at NAU double majoring in Computer Science and Modern Languages. He currently works for the Center of International Education and for the College of Engineering as a web developer and a teacher's assistant, respectively.
                   After graduation his goal is to work both in the United States and abroad for a leader in the industry of software development and related technologies.

Novice Level Pug Trainer

Mark Thompson

Mark Thompson is a senior at NAU Computer Science major at NAU.  He currently works as a Math private tutor and can be found most of the time at the university library.  He has been passionate about coding since he was a second year in high school.  His favorite class is Calculus II.  He hopes to own a laptop one day.

Cow Master

Mohammad Al-Otaibi

Mohammad is a computer science major at NAU. He finished his associate degree in Saudi Arabia as a computer programmer. His goal was to continue his education in computer science abroad. Mohammad, enjoys to spend his free time with friends and playing first shooter video games.

Sarah Kehoe

Sarah Kehoe is a senior Applied Computer Science major at NAU.  She currently works at the College of Engineering's IT help desk and can be found around the engineering building doing general PC and AV support.  This is her first experience with full-stack web development.  Her post-grad plans are to hopefully return to the Pacific Northwest, where her family lives.

CU Then, by Team Pug.


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="zxing_app_name">Barkod Tarayıcısı</string>
    <string name="zxing_button_ok">Tamam</string>
    <string name="zxing_msg_camera_framework_bug">Üzgünüz, Android kamera bir sorunla karşılaştı. Cihazı yeniden başlatmanız gerekebilir.</string>
    <string name="zxing_msg_default_status">Barkodu taramak için vizördeki dikdörtgenin içerisine yerleştirin.</string>
</resources>


text:
package org.devgateway.ocvn.persistence.mongo.reader;

import java.text.ParseException;

import org.devgateway.ocds.persistence.mongo.reader.ImportWarningRuntimeException;
import org.devgateway.ocds.persistence.mongo.reader.RowImporter;
import org.devgateway.ocds.persistence.mongo.spring.ImportService;
import org.devgateway.ocvn.persistence.mongo.dao.City;
import org.devgateway.ocvn.persistence.mongo.repository.main.CityRepository;

/**
 * @author mpostelnicu Specific {@link RowImporter} Cities. Organization#address
 */
public class CityRowImporter extends RowImporter<City, Integer, CityRepository> {

    public CityRowImporter(final CityRepository repository, final ImportService importService,
            final int skipRows) {
        super(repository, importService, skipRows);
    }

    @Override
    public void importRow(final String[] row) throws ParseException {
        if (getRowCell(row, 1) == null) {
            throw new RuntimeException("Main identifier empty!");
        }
        City city = repository.findOne(getInteger(getRowCell(row, 1)));

        if (city != null) {
            throw new ImportWarningRuntimeException("Duplicate identifer for city " + city);
        }
        city = new City();

        city.setId(getInteger(getRowCell(row, 1)));
        city.setName(getRowCell(row, 2));

        repository.insert(city);

    }

}


text:
package org.apache.jackrabbit.test.api.query;

import javax.jcr.query.Query;

/**
 * This test searches for all nodes of a specific node type and orders them by
 * the property with name configured as {@link #propertyName1}.
 *

 * The default workspace must at least contain two nodes of type {@link #testNodeType}
 * with String properties named {@link #propertyName1} containing
 * distinct values.
 *
 * @test
 * @sources XPathOrderByTest.java
 * @executeClass org.apache.jackrabbit.test.api.query.XPathOrderByTest
 * @keywords level1
 */
public class XPathOrderByTest extends AbstractQueryTest {

    /**
     * Statement without order by modifier.
     */
    private String baseStatement;

    /**
     * Prepare a statement without order by modifier to be used for the tests
     */
    protected void setUp() throws Exception {
        isReadOnly = true;
        super.setUp();
        StringBuffer tmp = new StringBuffer("/");
        tmp.append(jcrRoot).append(testRoot);
        tmp.append("/*[@");
        tmp.append(propertyName1);
        tmp.append("] order by @");
        tmp.append(propertyName1);
        baseStatement = tmp.toString();
    }

    /**
     * Test if sort order ascending is respected.
     *

     * For configuration description see {@link XPathOrderByTest}.
     */
    public void testOrderByAscending() throws Exception {
        Statement stmt = new Statement(baseStatement + " ascending", Query.XPATH);
        evaluateResultOrder(execute(stmt), propertyName1, false);
    }

    /**
     * Test if sort order descending is respected.
     *

     * For configuration description see {@link XPathOrderByTest}.
     */
    public void testOrderByDescending() throws Exception {
        Statement stmt = new Statement(baseStatement + " descending", Query.XPATH);
        evaluateResultOrder(execute(stmt), propertyName1, true);
    }

    /**
     * Test if default sort order is ascending
     *

     * For configuration description see {@link XPathOrderByTest}.
     */
    public void testOrderBy() throws Exception {
        Statement stmt = new Statement(baseStatement, Query.XPATH);
        evaluateResultOrder(execute(stmt), propertyName1, false);
    }

}


text:
layout: post
title: "gdpr-consent-companion-banner-gpt-events"
excerpt: "gdpr-consent-companion-banner-gpt-events"
categories: puppeteer
---

### Companion-prod


text:
package com.jelgh.smoothimageloader.library;

import android.widget.AbsListView;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListAdapter;

public abstract class SmoothLoadingTestAdapter extends WrapperListAdapterImpl implements SmoothLoadingAdapter {

	private SmoothImageLoader mImageLoader;
	private ScrollListener mScrollListener;
	private int mDefaultImgResource = -1;

	public SmoothLoadingTestAdapter(ListAdapter adapter, ScrollListener scrollListener, IBitmapStorageApi api) {
		super(adapter);
		construct(scrollListener, api);
	}

	private final  void construct(ScrollListener scrollListener, IBitmapStorageApi api) {
		mScrollListener = scrollListener;
		mScrollListener.setAdapter(this);
		mImageLoader = new SmoothImageLoader(api);
	}

	@Override
	public final void setDefaultImgResource(int resource) {
		mDefaultImgResource = resource;
		mImageLoader.setDefaultImgResource(mDefaultImgResource);
	}

	@Override
	public final void loadImage(ImageView imageView, String uri) {

		if (mImageLoader.isImageInMemoryCache(uri) || !mScrollListener.isScrolling()) {
			mImageLoader.loadImage(uri, imageView);
		} else {
			if (mDefaultImgResource != -1) {
				imageView.setImageResource(mDefaultImgResource);
			} else {
				imageView.setImageDrawable(null);
			}
		}
	}

	@Override
	public abstract void reloadImage(final Object viewHolder);

	@Override
	public final void reloadImages(AbsListView view) {
		for (int i = 0; i < view.getChildCount(); i++) {
			final Object rowItem = view.getChildAt(i).getTag();
			if (rowItem != null) {
				reloadImage(rowItem);
			}
		}
	}

	@Override
	public final void clearMemoryCache() {
		mImageLoader.clearCache();
	}
}


text:
package org.apache.click.extras.control;

import java.text.NumberFormat;
import java.text.ParseException;

/**
 * Provides a Double Field control:   <input type='text'>.
 *
 *

 *

 * Double Field
 * <input type='text' value='3.541' title='DoubleField Control'/>
 *

 *

 *
 * DoubleField will validate the number when the control is processed and invoke
 * the control listener if defined.
 *

 * The DoubleField uses a JavaScript onkeypress() doubleFilter() method to prevent
 * users from entering invalid characters. To enable number key filtering
 * reference the {@link org.apache.click.util.PageImports} object in your page
 * header section. For example:
 *
 *

 * <html>
 *  <head>
 *   $imports
 *  </head>
 *  <body>
 *   $form
 *  </body>
 * </html>

 *
 * The DoubleField has left justified horizontal text alignment,
 * {@link #setTextAlign(String)}.
 *

 *
 * See also W3C HTML reference
 * INPUT
 */
public class DoubleField extends NumberField {

    private static final long serialVersionUID = 1L;

    // ----------------------------------------------------------- Constructors

    /**
     * Construct a DoubleField with the given name.
     *
     * @param name the name of the field
     */
    public DoubleField(String name) {
        super(name);
        setAttribute("onkeypress", "javascript:return doubleFilter(event);");
        setTextAlign("left");
    }

    /**
     * Construct a DoubleField with the given name and label.
     *
     * @param name the name of the field
     * @param label the label of the field
     */
    public DoubleField(String name, String label) {
        super(name, label);
        setAttribute("onkeypress", "javascript:return doubleFilter(event);");
        setTextAlign("left");
    }

    /**
     * Construct a DoubleField with the given name and required status.
     *
     * @param name the name of the field
     * @param required the field required status
     */
    public DoubleField(String name, boolean required) {
        this(name);
        setRequired(required);
    }

    /**
     * Construct a DoubleField with the given name, label and required status.
     *
     * @param name the name of the field
     * @param label the label of the field
     * @param required the field required status
     */
    public DoubleField(String name, String label, boolean required) {
        this(name, label);
        setRequired(required);
    }

    /**
     * Construct the DoubleField with the given name, label and size.
     *
     * @param name the name of the field
     * @param label the label of the field
     * @param size the size of the field
     */
    public DoubleField(String name, String label, int size) {
        this(name, label);
        setSize(size);
    }

    /**
     * Construct the DoubleField with the given name, label, size and
     * required status.
     *
     * @param name the name of the field
     * @param label the label of the field
     * @param size the size of the field
     * @param required the field required status
     */
    public DoubleField(String name, String label, int size, boolean required) {
        this(name, label, required);
        setSize(size);
    }

    /**
     * Create a DoubleField with no name defined.
     *

     * Please note the control's name must be defined before it is valid.
     */
    public DoubleField() {
        setAttribute("onkeypress", "javascript:return doubleFilter(event);");
        setTextAlign("left");
    }

    // ------------------------------------------------------ Public Attributes

    /**
     * Return the field Double value, or null if value was empty or a parsing
     * error occurred.
     *
     * @return the field Double value
     */
    public Double getDouble() {
        Number number = getNumber();

        if (number != null) {
            return new Double(number.doubleValue());

        } else {
            return null;
        }
    }

    /**
     * Set the Double value of the field.
     *
     * @param doubleValue the double value to set
     */
    public void setDouble(Double doubleValue) {
        setValueObject(doubleValue);
    }

    /**
     * Return the field Float value, or null if value was empty or a parsing
     * error occurred.
     *
     * @return the field Float value
     */
    public Float getFloat() {
        Double value = getDouble();
        if (value != null) {
            return new Float(value.floatValue());
        } else {
            return null;
        }
    }

    /**
     * Return the field Double value, or null if value was empty or a parsing
     * error occurred.
     *
     * @return the Double object representation of the Field value
     */
    public Object getValueObject() {
        return getDouble();
    }

    /**
     * Validates the NumberField request submission. If the value entered
     * by the user can be parsed by the NumberFormat the string value
     * of this Field ({@link org.apache.click.control.Field#getValue()}) is
     * set to the formatted value of the user input.
     *

     * A field error message is displayed if a validation error occurs.
     * These messages are defined in the resource bundle:
     *

     *

     *
/click-control.properties
     *

     *
field-required-error

     *
number-format-error

     *
number-maxvalue-error

     *
number-minvalue-error

     *

     *

     *

     *

     */
    public void validate() {
        setError(null);

        String value = getValue();

        int length = value.length();
        if (length > 0) {
            try {
                NumberFormat format = getNumberFormat();
                Number number = format.parse(value);

                double doubleValue = number.doubleValue();

                if (doubleValue > maxvalue) {
                    setErrorMessage("number-maxvalue-error",
                                    getNumberFormat().format(maxvalue));

                } else if (doubleValue < minvalue) {
                    setErrorMessage("number-minvalue-error",
                                    getNumberFormat().format(minvalue));
                }

            } catch (ParseException pe) {
                setError(getMessage("number-format-error", getErrorLabel()));
            }
        } else {
            if (isRequired()) {
                setErrorMessage("field-required-error");
            }
        }
    }

}


text:
package com.carporange.cloudmusic.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.widget.AbsListView;
import android.widget.ListView;
import android.widget.Scroller;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

/**
 * Author: lwh
 * Date: 1/23/17 14:08.
 */

public class DetailListView extends ListView implements /*View.OnTouchListener,*/ AbsListView.OnScrollListener {

    private static final String TAG = "DetailListView";
    private int listViewTouchAction;
    private static final int MAXIMUM_LIST_ITEMS_VIEWABLE = 10000;
    private Scroller mScroller;
    //private ViewGroup mParentView;

    public DetailListView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mScroller = new Scroller(context);
        listViewTouchAction = -1;
        setOnScrollListener(this);
        initFlingRunable();
        //setOnTouchListener(this);
    }

    @Override
    public void onScroll(AbsListView view, int firstVisibleItem,
                         int visibleItemCount, int totalItemCount) {
        if (getAdapter() != null && getAdapter().getCount() > MAXIMUM_LIST_ITEMS_VIEWABLE) {
            if (listViewTouchAction == MotionEvent.ACTION_MOVE) {
                scrollBy(0, -1);
            }
        }
    }

    @Override
    public void onScrollStateChanged(AbsListView view, int scrollState) {
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    }

    private float fLastRawY,fMoveRawY;
    private boolean isMoving =false;
    private VelocityTracker mVelocityTracker;
    @Override
    public boolean onTouchEvent(MotionEvent ev) {
        try{
            //Log.d(TAG,"------->onTouchEvent MotionEvent:" + ev.getAction());
            if (mVelocityTracker == null) {
                //检查速度测量器,如果为null,获得一个
                mVelocityTracker = VelocityTracker.obtain();
            }
            switch (ev.getAction()) {
                case MotionEvent.ACTION_DOWN: {
                    Log.d(TAG,"------->onTouchEvent ACTION_DOWN->y:" + ev.getRawY());
                    fLastRawY = ev.getRawY();
                    isMoving = false;
                    if (!mScroller.isFinished()) { //fling
                        mScroller.abortAnimation();
                    }
                    mVelocityTracker.clear();
                    mVelocityTracker.addMovement(ev);
                    //break;
                    return super.onTouchEvent(ev);//为了列表项可以点击
                }
                case MotionEvent.ACTION_MOVE: {
                    mVelocityTracker.addMovement(ev);
                    fMoveRawY = ev.getRawY();
                    float fCount = fMoveRawY - fLastRawY;
                    if(getMoveListener()!=null){
                        getMoveListener().onMove(fCount);
                        isMoving = true;
                        fLastRawY = fMoveRawY;
                    }
                    Log.d(TAG,"------->onTouchEvent ACTION_MOVE  滑动距离:" + fCount+"==>getChildAt(0).getTop():"+getChildAt(0).getTop());

                    break;
                }

                case MotionEvent.ACTION_UP: {
                    Log.d(TAG,"------->onTouchEvent ACTION_UP");
                    //mVelocityTracker.addMovement(ev);
                    final VelocityTracker velocityTracker = mVelocityTracker;
                    velocityTracker.computeCurrentVelocity(1000);
                    int initialVelocity = (int)velocityTracker.getYVelocity(0);
                    Log.d(TAG,"------->速度是:"+initialVelocity);
                    if(mMoveListener!=null && isMoving){
                        mMoveListener.onUp(initialVelocity);
                        isMoving = false;
                    }
                    //break;
                    return super.onTouchEvent(ev);//为了让按下效果可以消失
                }
                //为了让按下效果可以消失
                case MotionEvent.ACTION_CANCEL: {
                    Log.d(TAG,"------->onTouchEvent ACTION_CANCEL");
                    return super.onTouchEvent(ev);
                }
            }

        }catch (Exception ex){
            ex.printStackTrace();
        }

        //不处理事件了
        if(!isHandleTouchEvent()){
            return false;
        }
        return super.onTouchEvent(ev);
    }

    private void doFling(int speed) {
        if (mScroller == null) {
            return;
        }
        mScroller.fling(0,getScrollY(),0,speed,0,0,-500,10000);
        invalidate();
    }

    @Override
    public void computeScroll() {
        if (mScroller.computeScrollOffset()) {
            scrollTo(mScroller.getCurrX(),mScroller.getCurrY());
            postInvalidate();
        }
    }
    /**
     * 滑动监听器
     */
    private onMoveListener mMoveListener;
    public interface onMoveListener{
        public void onMove(float distance);
        public void onUp(int velocityY);
    }
    public onMoveListener getMoveListener() {
        return mMoveListener;
    }
    public void setMoveListener(onMoveListener moveListener) {
        mMoveListener = moveListener;
    }

    private boolean isHandleTouchEvent=false;
    public boolean isHandleTouchEvent() {
        return isHandleTouchEvent;
    }
    public void setHandleTouchEvent(boolean handleTouchEvent) {
        isHandleTouchEvent = handleTouchEvent;
    }

    private Field mFlingRunnableField = null;
    private Method mFlingStart = null;
    private Method mFlingEnd = null;
    private Method reportScrollStateChange;
    private Method mFling;

    //放于初始化方法中被调用
    public void initFlingRunable() {
        try {
            //if(mFlingEndField==null){
            mFlingRunnableField = AbsListView.class.getDeclaredField("mFlingRunnable");
            mFlingRunnableField.setAccessible(true);
            mFlingStart = mFlingRunnableField.getType().getDeclaredMethod("start", int.class);//mFlingEndField.getType().getDeclaredMethod("start");
            mFlingStart.setAccessible(true);

            mFlingEnd = mFlingRunnableField.getType().getDeclaredMethod("endFling");//mFlingEndField.getType().getDeclaredMethod("start");
            mFlingEnd.setAccessible(true);

            reportScrollStateChange = AbsListView.class.getDeclaredMethod("reportScrollStateChange", int.class);
            reportScrollStateChange.setAccessible(true);

            mFling = AbsListView.class.getDeclaredMethod("fling", int.class);
            mFling.setAccessible(true);
            //}
        } catch (NoSuchFieldException e) {
            e.printStackTrace();
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void startFling(int y) {
        try {
            smoothScrollBy(10,10);
            //mFlingStart.invoke(mFlingRunnableField.get(this));
            reportScrollStateChange.invoke(this, OnScrollListener.SCROLL_STATE_FLING);
            mFlingStart.invoke(mFlingRunnableField.get(this), y);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        /*try {
            if(mFling!=null){
                mFling.invoke(this,y);
            }
        }catch (Exception ex){
            ex.printStackTrace();
        }*/

    }

    public void stopFling(){
        try {
            if(mFlingEnd!=null)
                mFlingEnd.invoke(mFlingRunnableField.get(this));
        }catch (Exception ex){
            ex.printStackTrace();
        }
    }

}/*extends ListView {

    public MyListView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    public MyListView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyListView(Context context) {
        super(context);
    }
    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
      *//*  //设置为Integer.MAX_VALUE>>2 是listview全部展开
        int measureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE>>2, MeasureSpec.AT_MOST);
//设置为400是设置listview的高度只能有400 不全部展开   实现可以滑动的效果
        int measureSpec1 = MeasureSpec.makeMeasureSpec(400, MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, measureSpec1);*//*
        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >>2,
                MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expandSpec);
    }
}*/


text:
package com.lamcreations.scaffold.common.utils;

import android.content.Context;
import android.content.res.TypedArray;

import com.lamcreations.scaffold.R;

public class ScaffoldThemeUtils {

    private static final int[] SCAFFOLD_CHECK_ATTRS = {
            R.attr.scaffoldTheme
    };

    public static void checkScaffoldTheme(Context context) {
        TypedArray a = context.obtainStyledAttributes(SCAFFOLD_CHECK_ATTRS);
        boolean failed = true;
        if (a != null) {
            failed = !a.hasValue(0);
            a.recycle();
        }
        if (failed) {
            throw new IllegalArgumentException("You need to use a Theme.Scaffold.Base theme "
                    + "(or descendant) with the Scaffold library.");
        }
    }
}


text:
title: "AAA新会员折扣计划"
---

## WELCOME TO AAA OREGON/IDAHO FOR OREGON CHINESE COALITION

AAA is pleased to offer a special discount for your group with Promo Code 8055

Create a New membership with a $10 Enrollment Fee Waiver and 1/2 Price New Associates (Regular Associate Renewal is $36.00).

Step 1. Review the offer details and coverage level listed below

Step 2. Click "Join AAA" to create you new membership or call us 888-422-2503 and mention your group's Promo Code.

请使用专门为我们社区设立的[landing page](https://www.oregon.aaa.com/oregon-chinese-coalition/),里面有各种packages可供选择。

[https://www.oregon.aaa.com/oregon-chinese-coalition/](https://www.oregon.aaa.com/oregon-chinese-coalition/)


text:
<?php

namespace Application\Controller;

use Zend\Mvc\Controller\AbstractActionController;
//use Zend\View\Model\ViewModel;
use Application\Model\Db;

class InstallController extends AbstractActionController {

    public function indexAction() {

        $db = new Db();

        # Création de la table
        $sql ="CREATE DATABASE IF NOT EXISTS zend2;";

        $sql .="create table if not exists account (
               account_id int primary key AUTO_INCREMENT,
               login varchar(12),
               password varchar(255),
               firstname varchar(64) not null,
               lastname varchar(64) not null,
               email varchar(64),
               tel varchar(10)
               );";

         $sql .="create table if not exists post (
               post_id int primary key AUTO_INCREMENT,
               account_id int,
               title varchar(62),
               text text,
               FOREIGN KEY (account_id) REFERENCES account(account_id)
               );";
        $db->getAdapter()->query($sql)->execute();
        die('ok');
    }

}


text:
class CreateTables < ActiveRecord::Migration[6.0]
  def change
    ##
    # Genres
    #
    create_table :genres, id: :uuid do |t|
      t.string :name, null: false

      t.timestamps
    end

    add_index :genres, :name, unique: true

    ##
    # Themes
    #
    create_table :themes, id: :uuid do |t|
      t.string :name

      t.timestamps
    end

    add_index :themes, :name, unique: true

    ##
    # Artists
    #
    create_table :artists, id: :uuid do |t|
      t.string :name, null: false
      t.jsonb :alt_names, null: false, default: []
      t.string :country, null: false
      t.string :description
      t.string :gender
      t.date :born_at
      t.date :died_at

      t.string :metal_archives_key
      t.string :musicbrainz_key

      t.timestamps
    end

    add_index :artists, :metal_archives_key, unique: true
    add_index :artists, :musicbrainz_key, unique: true

    ##
    # Groups
    #
    create_table :groups, id: :uuid do |t|
      t.string :name, null: false
      t.jsonb :alt_names, null: false, default: []
      t.string :status, null: false
      t.string :country, null: false
      t.string :description
      t.date :formed_at

      t.string :metal_archives_key
      t.string :musicbrainz_key

      t.timestamps
    end

    add_index :groups, :metal_archives_key, unique: true
    add_index :groups, :musicbrainz_key, unique: true

    ##
    # Releases
    #
    create_table :releases, id: :uuid do |t|
      t.string :name, null: false
      t.date :released_at

      t.string :metal_archives_key
      t.string :musicbrainz_key

      t.timestamps
    end

    add_index :releases, :metal_archives_key, unique: true
    add_index :releases, :musicbrainz_key, unique: true

    # Genres - Genres
    create_table :genres_genres, id: false do |t|
      t.references :supergenre, null: false, type: :uuid, foreign_key: { to_table: :genres, on_delete: :cascade }
      t.references :subgenre, null: false, type: :uuid, foreign_key: { to_table: :genres, on_delete: :cascade }
    end

    # Artists - Groups
    create_table :artists_groups, id: false do |t|
      t.references :artist, null: false, type: :uuid, foreign_key: { on_delete: :cascade }
      t.references :group, null: false, type: :uuid, foreign_key: { on_delete: :cascade }
    end

    add_index :artists_groups, [:artist_id, :group_id], unique: true

    # Artists - Releases
    create_table :artists_releases, id: false do |t|
      t.references :artist, null: false, type: :uuid, foreign_key: { on_delete: :cascade }
      t.references :release, null: false, type: :uuid, foreign_key: { on_delete: :cascade }
    end

    add_index :artists_releases, [:artist_id, :release_id], unique: true

    # Groups - Releases
    create_table :groups_releases, id: false do |t|
      t.references :group, null: false, type: :uuid, foreign_key: { on_delete: :cascade }
      t.references :release, null: false, type: :uuid, foreign_key: { on_delete: :cascade }
    end

    add_index :groups_releases, [:group_id, :release_id], unique: true

    # Groups - Themes
    create_table :groups_themes, id: false do |t|
      t.references :group, null: false, type: :uuid, foreign_key: { on_delete: :cascade }
      t.references :theme, null: false, type: :uuid, foreign_key: { on_delete: :cascade }
    end

    add_index :groups_themes, [:group_id, :theme_id], unique: true

    # Groups - Genres
    create_table :groups_genres, id: false do |t|
      t.references :group, null: false, type: :uuid, foreign_key: { on_delete: :cascade }
      t.references :genre, null: false, type: :uuid, foreign_key: { on_delete: :cascade }
    end

    add_index :groups_genres, [:group_id, :genre_id], unique: true

    ##
    # Users
    #
    create_table :users, id: :uuid do |t|
      t.string :name, null: false
      t.string :email, null: false
      t.string :country, null: false

      t.timestamps
    end

    ##
    # Ratings
    #
    create_table :ratings, id: :uuid do |t|
      t.references :user, null: false, type: :uuid, foreign_key: { on_delete: :cascade }
      t.references :rateable, null: false, type: :uuid, polymorphic: true
      t.string :rating, null: false

      t.timestamps
    end

    add_index :ratings, [:user_id, :rateable_id, :rateable_type], unique: true
  end
end
# rubocop:enable Rails/CreateTableWithTimestamps


text:
package org.elasticsearch.index.gateway;

import org.elasticsearch.index.shard.ShardId;

/**
 *
 */
public class IndexShardGatewaySnapshotNotAllowedException extends IndexShardGatewayException {

    public IndexShardGatewaySnapshotNotAllowedException(ShardId shardId, String msg) {
        super(shardId, msg);
    }
}


text:
@implementation MOBProjectionEPSG4919
- (id)init
{
    if (self = [super initWithEPSG:4919 withDefinition:@"+proj=geocent +ellps=GRS80 +units=m +no_defs"]) {
        ;
    }
    return self;
}

@end