text:
package com.boztalay.geigercounter;

import jssc.SerialPort;
import jssc.SerialPortEvent;
import jssc.SerialPortEventListener;
import jssc.SerialPortException;

public class ZapReader implements SerialPortEventListener {
    private static final String SERIAL_PORT_NAME = "/dev/ttyUSB0";

    private static final byte GEIGER_COUNTER_SPEAK_FOR_0 = 48;
    private static final byte GEIGER_COUNTER_SPEAK_FOR_1 = 49;

    private SerialPort serialPort;

    private ZapListener zapListener;

    public ZapReader(ZapListener zapListener) {
        this.zapListener = zapListener;
    }

    public void startReadingZaps() {
        serialPort = new SerialPort(SERIAL_PORT_NAME);

        try {
            serialPort.openPort();
            serialPort.setParams(9600, 8, 1, 0);
            serialPort.setEventsMask(SerialPort.MASK_RXCHAR);
            serialPort.addEventListener(this);
        } catch (SerialPortException e) {
            System.out.println(e);
        }
    }

    //Called whenever something comes over the serial line
    public void serialEvent(SerialPortEvent event) {
        if (doesEventHaveDataReady(event)) {
            processDataFromEvent(event);
        }
    }

    private boolean doesEventHaveDataReady(SerialPortEvent event) {
        return (event.isRXCHAR() && event.getEventValue() > 0);
    }

    private void processDataFromEvent(SerialPortEvent event) {
        try {
            byte[] geigerCounterData = serialPort.readBytes(event.getEventValue());
            for(byte dataValue : geigerCounterData) {
                if(isValueValidGeigerCounterData(dataValue)) {
                    zapListener.zapOccurred();
                }
            }
        } catch (SerialPortException e) {
            System.out.println(e);
        }
    }

    private boolean isValueValidGeigerCounterData(byte value) {
        return (value == GEIGER_COUNTER_SPEAK_FOR_0 || value == GEIGER_COUNTER_SPEAK_FOR_1);
    }

    public interface ZapListener {
        public abstract void zapOccurred();
    }
}


text:
package org.springframework.jndi;

import javax.naming.NamingException;

import org.springframework.aop.TargetSource;

/**
 * TargetSource which performs a fresh JNDI lookup for each call.
 *
 *
Can be used as alternative to JndiObjectFactoryBean, to allow for
 * relocating a JNDI object for each operation. This is particularly useful
 * during development, as it allows for hot restarting of the JMS server.
 *
 *
Example:
 *
 *

 * <bean id="queueConnectionFactoryTarget" class="org.springframework.jndi.JndiObjectTargetSource">
 *   <property name="jndiName"><value>JmsQueueConnectionFactory</value></property>
 * </bean>
 *
 * <bean id="queueConnectionFactory" class="org.springframework.aop.framework.ProxyFactoryBean">
 *   <property name="proxyInterfaces"><value>javax.jms.QueueConnectionFactory</value></property>
 *   <property name="targetSource"><ref bean="queueConnectionFactoryTarget"/></property>
 * </bean>

 *
 * A createQueueConnection call on the "queueConnectionFactory" proxy will
 * cause a JNDI lookup for "JmsQueueConnectionFactory" and a subsequent delegating call
 * to the retrieved QueueConnectionFactory's createQueueConnection.
 *
 * @author Juergen Hoeller
 * @since 1.1
 * @see JndiObjectFactoryBean
 * @see org.springframework.aop.framework.ProxyFactoryBean#setTargetSource(TargetSource)
 */
public class JndiObjectTargetSource extends JndiObjectLocator implements TargetSource {

	private boolean lookupOnStartup = true;

	private boolean cache = true;

	private Object cachedObject;

	private Class targetClass;

	/**
	 * Set whether to look up the JNDI object on startup. Default is true.
	 *
Can be turned off to allow for late availability of the JNDI object.
	 * In this case, the JNDI object will be fetched on first access.
	 * @see #setCache
	 */
	public void setLookupOnStartup(boolean lookupOnStartup) {
		this.lookupOnStartup = lookupOnStartup;
	}

	/**
	 * Set whether to cache the JNDI object once it has been located.
	 * Default is true.
	 *
Can be turned off to allow for hot redeployment of JNDI objects.
	 * In this case, the JNDI object will be fetched for each invocation.
	 * @see #setLookupOnStartup
	 */
	public void setCache(boolean cache) {
		this.cache = cache;
	}

	public void afterPropertiesSet() throws NamingException {
		super.afterPropertiesSet();
		if (this.lookupOnStartup) {
			Object object = lookup();
			if (this.cache) {
				this.cachedObject = object;
			}
			else {
				this.targetClass = object.getClass();
			}
		}
	}

	public Class getTargetClass() {
		return (this.cachedObject != null ? this.cachedObject.getClass() : this.targetClass);
	}

	public boolean isStatic() {
		return (this.cachedObject != null);
	}

	public Object getTarget() throws NamingException {
		if (this.lookupOnStartup || !this.cache) {
			return (this.cachedObject != null ? this.cachedObject : lookup());
		}
		else {
			synchronized (this) {
				if (this.cachedObject == null) {
					this.cachedObject = lookup();
				}
				return this.cachedObject;
			}
		}
	}

	public void releaseTarget(Object target) {
	}

}

redpajama_set_name: RedPajamaGithub


text:
package org.pocketserver.world;

import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;
import org.pocketserver.api.block.Block;
import org.pocketserver.api.block.Material;
import org.pocketserver.api.world.Chunk;
import org.pocketserver.api.world.World;
import org.pocketserver.api.world.locale.Location;
import org.pocketserver.block.PocketBlock;

import java.util.Arrays;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Function;

public class PocketChunk implements Chunk {

    private final int x;
    private final int z;
    private final PocketWorld world;
    private final PocketBlock[] blocks = new PocketBlock[128 * 16 * 16];
    private final AtomicBoolean updated = new AtomicBoolean(true);
    private byte[] cache;
    private boolean dirty;

    public PocketChunk(Location loc) {
        this((PocketWorld) loc.getWorld(), loc.getBlockX() >> 4, loc.getBlockZ() >> 4);
    }

    public PocketChunk(PocketWorld world, int x, int z) {
        this.world = world;
        this.x = x;
        this.z = z;

        for (int dx = 0; dx < 16; dx++) {
            for (int dy = 0; dy < 128; dy++) {
                for (int dz = 0; dz < 16; dz++) {
                    Location loc = new Location(world, x * 16 + dx, dy, z * 16 + dz);
                    PocketBlock b = new PocketBlock(Material.AIR, loc);
                    if (dy < 2) {
                        b.setType(Material.BEDROCK);
                    }
                    blocks[getBlockIndex(dx, dy, dz)] = b;
                }
            }
        }
    }

    private int getBlockIndex(int x, int y, int z) {
        return ((x << 11) | (z << 7) | y);
    }

    @Override
    public World getWorld() {
        return world;
    }

    @Override
    public int getX() {
        return x;
    }

    @Override
    public int getZ() {
        return z;
    }

    @Override
    public Block getBlock(Location loc) {
        int dx = loc.getBlockX(), dz = loc.getBlockZ();
        if (dx >> 4 != x || dz >> 4 != z) {
            throw new IllegalArgumentException("Location is not inside this Chunk.");
        }
        return getBlock(dx & 0xF, loc.getBlockY(), dz & 0xF);
    }

    @Override
    public Block getBlock(int x, int y, int z) {
        if (0 <= x && x < 16 && 0 <= y && y < 256 && 0 <= z && z < 16) {
            return blocks[getBlockIndex(x, y, z)];
        }
        return null;
    }

    @Override
    public boolean isInChunk(Location location) {
        int dx = location.getBlockX(), dz = location.getBlockZ();
        return dx >> 4 == x && dz >> 4 == z;
    }

    @Override
    public boolean isInChunk(int x, int y, int z) {
        return isInChunk(new Location(world, x, y, z));
    }

    @Override
    public void queueUpdate(int x, int y, int z, Material material) {
        this.updated.set(true);

        blocks[getBlockIndex(x, y, z)].setType(material);
    }

    @Override
    public void proposeUpdates() {
        //TODO: Send all the new blocks to client.
    }

    @Override
    public byte[] getBytes() throws Exception {
        if (cache == null || dirty) {
            ByteArrayDataOutput output = ByteStreams.newDataOutput();
            output.write(toByteArray(blocks, pocketBlock -> pocketBlock.getType().getByte())); //Block IDs
            output.write(toByteArray(new Object[16*16*64], block -> (byte) 0)); //Data
            output.write(toByteArray(new Object[16*16*64], block -> (byte) -1)); //TODO
            output.write(toByteArray(new Object[16*16*64], block -> (byte) 0));
            for (int i = 0; i < 16 * 16; i++) {
                //Height map TODO
                output.writeByte(2 & 0xff);
            }

            int[] biomeColors = new int[256];
            Arrays.fill(biomeColors, readInt(new byte[]{(byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00}));
            for (int color : biomeColors) {
                System.out.println(color);
                output.writeInt(color);
            }

            output.write(writeLInt(0));
            output.write(new byte[0]);
            cache = output.toByteArray();
            dirty = false;
        }
        return cache;
    }

    //Copied from nukkit to test
    public static int readInt(byte[] bytes) {
        return ((bytes[0] & 0xff) << 24) +
                ((bytes[1] & 0xff) << 16) +
                ((bytes[2] & 0xff) << 8) +
                (bytes[3] & 0xff);
    }

    //^
    private byte[] writeLInt(int i) {
        return new byte[]{
                (byte) (i & 0xFF),
                (byte) ((i >>> 8) & 0xFF),
                (byte) ((i >>> 16) & 0xFF),
                (byte) ((i >>> 24) & 0xFF)
        };
    }

    private <T> byte[] toByteArray(T[] array, Function<? super T, ? extends Byte> mapper) {
        byte[] bytes = new byte[array.length];
        for (int i = 0; i < array.length; i++) {
            bytes[i] = mapper.apply(array[i]);
        }
        return bytes;
    }

    public void setBlock() {

    }
}


text:
<?php

namespace OzdemirBurak\SkyScanner\Localisation;

use OzdemirBurak\SkyScanner\LocalisationService;

class Currency extends LocalisationService
{
    /**
     * @var string
     */
    protected $property = 'Currencies';

    /**
     * @return string
     */
    public function getUri(): string
    {
        return 'reference/v1.0/currencies';
    }
}


text:
"""
For now this just calls the three modules. Once I learn how to process command line arguments I'll augment this to handle those as well.
"""
__author__ = 'Nate Dickson'
#import sys
from cpuglow import CpuGlow
from memglow import MemGlow
from ssdglow import SSDGlow
from time import sleep

def main():
    try:
        cg = CpuGlow()
        mg = MemGlow()
        sg = SSDGlow()
        while True:
            sg.equalizer()
            mg.one_pulse()
            cg.snake()
            #sleep(0.2)
    except KeyboardInterrupt:
        CpuGlow.pg.all(0)

if __name__ == '__main__':
    main()


text:
<!DOCTYPE html>

<title>HTML5 Beautifier | Jari Jokinen</title>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="viewport" content="width=device-width"/>

<link rel="stylesheet" type="text/css" href="/stylesheets/jarijokinen.css"/>

Hello World.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.


text:
package br.com.yanaga.samples.academico.infrastructure.jsf;

import br.com.yanaga.samples.academico.domain.Identificacao;

import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import javax.faces.convert.FacesConverter;

@FacesConverter(forClass = Identificacao.class)
public class IdentificacaoConverter implements Converter {

	@Override
	public Object getAsObject(FacesContext context, UIComponent component, String value) {
		if (value != null) {
			try {
				return Identificacao.of(value);
			}
			catch (Exception e) {
				throw new ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(), null));
			}
		}
		return null;
	}

	@Override
	public String getAsString(FacesContext context, UIComponent component, Object value) {
		if (value != null) {
			if ("true".equals(component.getAttributes().get("formatado"))) {
				return String.format("%s", value);
			}
			return value.toString();
		}
		return null;
	}

}


text:
ES5Harness.registerTest({

    id: "15.4.4.21-2-9",

    path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-2-9.js",

    description: "Array.prototype.reduce applied to Array-like object, 'length' is an own accessor property that overrides an inherited accessor property",

    test: function testcase() {

        function callbackfn(prevVal, curVal, idx, obj) {
            return (obj.length === 2);
        }

        var proto = {};

        Object.defineProperty(proto, "length", {
            get: function () {
                return 3;
            },
            configurable: true
        });

        var Con = function () { };
        Con.prototype = proto;

        var child = new Con();

        Object.defineProperty(child, "length", {
            get: function () {
                return 2;
            },
            configurable: true
        });

        child[0] = 12;
        child[1] = 11;
        child[2] = 9;

        return Array.prototype.reduce.call(child, callbackfn, 1) === true;
    },

    precondition: function prereq() {
        return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty);
    }

});


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/dark_blue"
    >
	<ImageView
	    android:layout_width="wrap_content"
        android:layout_height="48dp"
        android:layout_centerInParent="true"
        android:src="@drawable/logo19196"
	    />
	<RelativeLayout
	    android:id="@+id/payment_layout_close"
	    android:layout_width="50dp"
	    android:layout_height="match_parent"
	    android:layout_alignParentRight="true"
	    android:gravity="center"
	    >
		<ImageButton
	        android:id="@+id/payment_btn_close"
	        android:layout_width="wrap_content"
	        android:layout_height="wrap_content"
	        android:contentDescription="关闭"
	        android:layout_centerInParent="true"
	        android:background="@drawable/btn_close"
	        />
	</RelativeLayout>
</RelativeLayout>


text:
package com.thedevbridge.rest;

import java.util.List;

import javax.inject.Inject;

import org.springframework.data.domain.Page;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.thedevbridge.model.Patient;
import com.thedevbridge.service.PatientService;

/**
 * Created by dassiorleando on 3/24/16.
 */
@RestController
@RequestMapping(value = "/api/patients")
public class PatientResource {

    @Inject
    private PatientService patientService;

    @RequestMapping(method = RequestMethod.POST, produces= MediaType.APPLICATION_JSON_VALUE)
    public Patient savePatient(@RequestBody Patient patient) {
        return patientService.save(patient);
    }

    @RequestMapping(value = "/{page}", method = RequestMethod.GET, produces= MediaType.APPLICATION_JSON_VALUE)
    public Page<Patient> getPatients(@PathVariable int page) {
    	return patientService.getPatients(page);
    }

    @RequestMapping(value = "/all", method = RequestMethod.GET, produces= MediaType.APPLICATION_JSON_VALUE)
    public List<Patient> getAllPatients() {
    	return patientService.getAllPatients();
    }

    @RequestMapping(method = RequestMethod.PUT, produces= MediaType.APPLICATION_JSON_VALUE)
    public Patient updatePatient(@RequestBody Patient patient) {
        return patientService.save(patient);
    }

    @RequestMapping(value="/{id}", method = RequestMethod.DELETE, produces= MediaType.APPLICATION_JSON_VALUE)
    public void removePatient(@PathVariable String id) {
        patientService.remove(id);
    }
}


text:
package org.apache.hadoop.hbase.namequeues;

import com.lmax.disruptor.EventHandler;
import com.lmax.disruptor.RingBuffer;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Map;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.namequeues.request.NamedQueueGetRequest;
import org.apache.hadoop.hbase.namequeues.response.NamedQueueGetResponse;
import org.apache.yetus.audience.InterfaceAudience;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Event Handler run by disruptor ringbuffer consumer. Although this is generic implementation for
 * namedQueue, it can have individual queue specific logic.
 */
@InterfaceAudience.Private
class LogEventHandler implements EventHandler<RingBufferEnvelope> {

  private static final Logger LOG = LoggerFactory.getLogger(LogEventHandler.class);

  // Map that binds namedQueues to corresponding queue service implementation.
  // If NamedQueue of specific type is enabled, corresponding service will be used to
  // insert and retrieve records.
  // Individual queue sizes should be determined based on their individual configs within
  // each service.
  private final Map<NamedQueuePayload.NamedQueueEvent, NamedQueueService> namedQueueServices =
    new HashMap<>();

  private static final String NAMED_QUEUE_PROVIDER_CLASSES = "hbase.namedqueue.provider.classes";

  LogEventHandler(final Configuration conf) {
    for (String implName : conf.getStringCollection(NAMED_QUEUE_PROVIDER_CLASSES)) {
      Class<?> clz;
      try {
        clz = Class.forName(implName);
      } catch (ClassNotFoundException e) {
        LOG.warn("Failed to find NamedQueueService implementor class {}", implName, e);
        continue;
      }

      if (!NamedQueueService.class.isAssignableFrom(clz)) {
        LOG.warn("Class {} is not implementor of NamedQueueService.", clz);
        continue;
      }

      // add all service mappings here
      try {
        NamedQueueService namedQueueService =
          (NamedQueueService) clz.getConstructor(Configuration.class).newInstance(conf);
        namedQueueServices.put(namedQueueService.getEvent(), namedQueueService);
      } catch (InstantiationException | IllegalAccessException | NoSuchMethodException
        | InvocationTargetException e) {
        LOG.warn("Unable to instantiate/add NamedQueueService implementor {} to service map.", clz);
      }
    }
  }

  /**
   * Called when a publisher has published an event to the {@link RingBuffer}. This is generic
   * consumer of disruptor ringbuffer and for each new namedQueue that we add, we should also
   * provide specific consumer logic here.
   * @param event      published to the {@link RingBuffer}
   * @param sequence   of the event being processed
   * @param endOfBatch flag to indicate if this is the last event in a batch from the
   *                   {@link RingBuffer}
   */
  @Override
  public void onEvent(RingBufferEnvelope event, long sequence, boolean endOfBatch) {
    final NamedQueuePayload namedQueuePayload = event.getPayload();
    // consume ringbuffer payload based on event type
    namedQueueServices.get(namedQueuePayload.getNamedQueueEvent())
      .consumeEventFromDisruptor(namedQueuePayload);
  }

  /**
   * Cleans up queues maintained by services.
   * @param namedQueueEvent type of queue to clear
   * @return true if queue is cleaned up, false otherwise
   */
  boolean clearNamedQueue(NamedQueuePayload.NamedQueueEvent namedQueueEvent) {
    return namedQueueServices.get(namedQueueEvent).clearNamedQueue();
  }

  /**
   * Add all in memory queue records to system table. The implementors can use system table or
   * direct HDFS file or ZK as persistence system.
   */
  void persistAll(NamedQueuePayload.NamedQueueEvent namedQueueEvent) {
    namedQueueServices.get(namedQueueEvent).persistAll();
  }

  /**
   * Retrieve in memory queue records from ringbuffer
   * @param request namedQueue request with event type
   * @return queue records from ringbuffer after filter (if applied)
   */
  NamedQueueGetResponse getNamedQueueRecords(NamedQueueGetRequest request) {
    return namedQueueServices.get(request.getNamedQueueEvent()).getNamedQueueRecords(request);
  }

}


text:
#ifndef _DESOCKET_H
#define _DESOCKET_H
/*!
 * \file
 * \brief Socket abstraction.
 *
 * Socket API is thread-safe except to:
 *  - listen()
 *  - connect()
 *  - destroy()
 *//*--------------------------------------------------------------------*/

#include "deDefs.h"

DE_BEGIN_EXTERN_C

/* Socket types. */
typedef struct deSocket_s			deSocket;
typedef struct deSocketAddress_s	deSocketAddress;

typedef enum deSocketFamily_e
{
	DE_SOCKETFAMILY_INET4 = 0,
	DE_SOCKETFAMILY_INET6,

	DE_SOCKETFAMILY_LAST
} deSocketFamily;

typedef enum deSocketType_e
{
	DE_SOCKETTYPE_STREAM	= 0,
	DE_SOCKETTYPE_DATAGRAM,

	DE_SOCKETTYPE_LAST
} deSocketType;

typedef enum deSocketProtocol_e
{
	DE_SOCKETPROTOCOL_TCP = 0,
	DE_SOCKETPROTOCOL_UDP,

	DE_SOCKETPROTOCOL_LAST
} deSocketProtocol;

typedef enum deSocketFlag_e
{
	DE_SOCKET_KEEPALIVE		= (1<<0),
	DE_SOCKET_NODELAY		= (1<<1),
	DE_SOCKET_NONBLOCKING	= (1<<2),
	DE_SOCKET_CLOSE_ON_EXEC	= (1<<3)
} deSocketFlag;

/* \todo [2012-07-09 pyry] Separate closed bits for send and receive channels. */

typedef enum deSocketState_e
{
	DE_SOCKETSTATE_CLOSED					= 0,
	DE_SOCKETSTATE_CONNECTED				= 1,
	DE_SOCKETSTATE_LISTENING				= 2,
	DE_SOCKETSTATE_DISCONNECTED				= 3,

	DE_SOCKETSTATE_LAST
} deSocketState;

typedef enum deSocketResult_e
{
	DE_SOCKETRESULT_SUCCESS					= 0,
	DE_SOCKETRESULT_WOULD_BLOCK				= 1,
	DE_SOCKETRESULT_CONNECTION_CLOSED		= 2,
	DE_SOCKETRESULT_CONNECTION_TERMINATED	= 3,
	DE_SOCKETRESULT_ERROR					= 4,

	DE_SOCKETRESULT_LAST
} deSocketResult;

typedef enum deSocketChannel_e
{
	DE_SOCKETCHANNEL_RECEIVE	= (1<<0),
	DE_SOCKETCHANNEL_SEND		= (1<<1),

	DE_SOCKETCHANNEL_BOTH		= DE_SOCKETCHANNEL_RECEIVE|DE_SOCKETCHANNEL_SEND
} deSocketChannel;

/* Socket API, similar to Berkeley sockets. */

deSocketAddress*	deSocketAddress_create		(void);
void				deSocketAddress_destroy		(deSocketAddress* address);

deBool				deSocketAddress_setFamily	(deSocketAddress* address, deSocketFamily family);
deSocketFamily		deSocketAddress_getFamily	(const deSocketAddress* address);
deBool				deSocketAddress_setType		(deSocketAddress* address, deSocketType type);
deSocketType		deSocketAddress_getType		(const deSocketAddress* address);
deBool				deSocketAddress_setProtocol	(deSocketAddress* address, deSocketProtocol protocol);
deSocketProtocol	deSocketAddress_getProtocol	(const deSocketAddress* address);
deBool				deSocketAddress_setPort		(deSocketAddress* address, int port);
int					deSocketAddress_getPort		(const deSocketAddress* address);
deBool				deSocketAddress_setHost		(deSocketAddress* address, const char* host);
const char*			deSocketAddress_getHost		(const deSocketAddress* address);

deSocket*			deSocket_create				(void);
void				deSocket_destroy			(deSocket* socket);

deSocketState		deSocket_getState			(const deSocket* socket);
deUint32			deSocket_getOpenChannels	(const deSocket* socket);

deBool				deSocket_setFlags			(deSocket* socket, deUint32 flags);

deBool				deSocket_listen				(deSocket* socket, const deSocketAddress* address);
deSocket*			deSocket_accept				(deSocket* socket, deSocketAddress* clientAddress);

deBool				deSocket_connect			(deSocket* socket, const deSocketAddress* address);

deBool				deSocket_shutdown			(deSocket* socket, deUint32 channels);
deBool				deSocket_close				(deSocket* socket);

deSocketResult		deSocket_send				(deSocket* socket, const void* buf, size_t bufSize, size_t* numSent);
deSocketResult		deSocket_receive			(deSocket* socket, void* buf, size_t bufSize, size_t* numReceived);

/* Utilities. */

const char*			deGetSocketFamilyName		(deSocketFamily family);
const char*			deGetSocketResultName		(deSocketResult result);

DE_END_EXTERN_C

#endif /* _DESOCKET_H */


text:
package org.apereo.cas.authentication;

import lombok.val;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.springframework.core.io.ClassPathResource;

import java.util.Optional;

import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;

/**
 * This is {@link GroovyAuthenticationPostProcessorTests}.
 *
 * @author Misagh Moayyed
 * @since 6.1.0
 */
@Tag("Groovy")
public class GroovyAuthenticationPostProcessorTests {
    @Test
    public void verifyAction() {
        val g = new GroovyAuthenticationPostProcessor(new ClassPathResource("GroovyPostProcessor.groovy"));
        val transaction = mock(AuthenticationTransaction.class);
        val creds = CoreAuthenticationTestUtils.getCredentialsWithSameUsernameAndPassword();
        when(transaction.getPrimaryCredential()).thenReturn(Optional.of(creds));
        assertTrue(g.supports(creds));
        val authenticationBuilder = CoreAuthenticationTestUtils.getAuthenticationBuilder();
        g.process(authenticationBuilder, transaction);
        val successes = authenticationBuilder.getSuccesses();
        assertFalse(successes.isEmpty());
        assertFalse(successes.get("SimpleTestUsernamePasswordAuthenticationHandler").getWarnings().isEmpty());
    }
}


text:
The password reset failed

	Request a new password reset


text:
package club.zhcs.thunder.ext.shiro.aop;

import org.apache.shiro.aop.AnnotationResolver;
import org.apache.shiro.authz.aop.RoleAnnotationMethodInterceptor;

/**
 *
 * @author kerbores@gmail.com
 *
 */
public class SINORoleAnnotationMethodInterceptor extends RoleAnnotationMethodInterceptor {

	public SINORoleAnnotationMethodInterceptor() {
		setHandler(new SINORoleAnnotationHandler());
	}

	public SINORoleAnnotationMethodInterceptor(AnnotationResolver resolver) {
		setHandler(new SINORoleAnnotationHandler());
		setResolver(resolver);
	}
}


text:
/*
Author : Shivakkumar K R
File name : AVL.cs
*/
using System;
using System.Collections;
using System.Linq;
using System.Text;
public class AVL {
	class Node {
		public int Data, Height;
		public Node Left, Right;
	}
	Node root;
	private void Swap<T>(ref T val1, ref T val2) {
		T temp = val2;
		val2 = val1;
		val1 = temp;
	}
	private Node NewNode(int data) {
		return new Node {
			Data = data, Left = null, Right = null, Height = 1
		};
	}

	private int GetHeight(Node temp) {
		if (temp == null)
			return 0;
		int lh = temp.Left == null ? 0 : temp.Left.Height;
		int rh = temp.Right == null ? 0 : temp.Right.Height;
		return lh + rh;
	}

	private int GetBalanceFactor(Node temp) {
		if (temp == null)
			return 0;
		return GetHeight(temp.Left) - GetHeight(temp.Right);
	}

	private Node LeftRotate(Node temp, Node right) {
		var rightLeft = right.Left;
		right.Left = temp;
		temp.Right = rightLeft;
		return right;
	}

	private Node RightRotate(Node temp, Node left) {
		var leftRight = left.Right;
		left.Right = temp;
		temp.Left = leftRight;
		return left;
	}
	private void Insert(ref Node temp, int data) {
		if (temp == null)
			temp = NewNode(data);
		else if (data < temp.Data)
			Insert(ref temp.Left, data);
		else if (data >= temp.Data)
			Insert(ref temp.Right, data);

		temp.Height = GetHeight(temp) + 1;

		if (GetBalanceFactor(temp) < -1 && GetBalanceFactor(temp.Right) < 0)
			temp = LeftRotate(temp, temp.Right);
		if (GetBalanceFactor(temp) > 1 && GetBalanceFactor(temp.Left) > 0)
			temp = RightRotate(temp, temp.Left);
		if (GetBalanceFactor(temp) < -1 && GetBalanceFactor(temp.Right) > 0) {
			temp.Right = RightRotate(temp.Right, temp.Right.Left);
			temp = LeftRotate(temp, temp.Right);
		}
		if (GetBalanceFactor(temp) > 1 && GetBalanceFactor(temp.Left) < 0) {
			temp.Left = LeftRotate(temp.Left, temp.Left.Right);
			temp = RightRotate(temp, temp.Left);
		}
	}
	private void Delete(ref Node temp, int data) {
		if (temp == null)
			return;
		if (data < temp.Data)
			Delete(ref temp.Left, data);
		else if (data > temp.Data)
			Delete(ref temp.Right, data);
		else {
			if (temp.Left == null && temp.Right == null) {
				temp = null;
			} else if (temp.Left != null && temp.Right == null) {
				var deleting = temp;
				temp = temp.Left; deleting = null;
			} else if (temp.Left == null && temp.Right != null) {
				var deleting = temp;
				temp = temp.Right; deleting = null;
			} else {
				var right = temp.Right;
				while (right.Left != null)
					right = right.Left;
				Swap(ref right.Data, ref temp.Data);
				Delete(ref temp.Right, data);
			}
		}
		if (temp == null)
			return;

		temp.Height = Math.Max(GetHeight(temp.Left), GetHeight(temp.Right)) + 1;

		if (GetBalanceFactor(temp) < -1 && GetBalanceFactor(temp.Right) < 0)
			temp = LeftRotate(temp, temp.Right);
		if (GetBalanceFactor(temp) > 1 && GetBalanceFactor(temp.Left) > 0)
			temp = RightRotate(temp, temp.Left);
		if (GetBalanceFactor(temp) < -1 && GetBalanceFactor(temp.Right) > 0) {
			temp.Right = RightRotate(temp.Right, temp.Right.Left);
			temp = LeftRotate(temp, temp.Right);
		}
		if (GetBalanceFactor(temp) > 1 && GetBalanceFactor(temp.Left) < 0) {
			temp.Left = LeftRotate(temp.Left, temp.Left.Right);
			temp = RightRotate(temp, temp.Left);
		}
	}
	private void InOrder(Node temp) {
		if (temp == null)
			return;
		InOrder(temp.Left); Console.WriteLine(temp.Data); InOrder(temp.Right);
	}
	private int Height(Node temp) {
		if (temp == null)
			return 0;
		return Math.Max(Height(temp.Left), Height(temp.Right)) + 1;
	}
	public void InsertHelper(int data) {
		Insert(ref root, data);
	}

	public void InOrderHelper() {
		InOrder(root);
	}
	public void DeleteHelper(int data) {
		Delete(ref root, data);
	}
	public int HeightHelper() {
		return Height(root);
	}
	static void Main(string [] args) {
		int [] a = {3, 6, 1, 7, 2, 8, 4, 9, 10};
		var avlTree = new AVL();
		int n = 100;
		var random = new Random();

		for (int i = 0; i < n; i++)
			avlTree.InsertHelper(random.Next(0, n));
		 avlTree.InOrderHelper();
		Console.WriteLine("Height:{0}", avlTree.HeightHelper());
		for (int i = 0; i < n; i++) {
			avlTree.DeleteHelper(random.Next(0, n));
		}
		avlTree.InOrderHelper();
	}
}


text:
#include <string.h>

#include "fdebug.h"

#include "fusb_private.h"

#define FUSB_DEBUG_TAG "FUSB-DEV"
#define FUSB_ERROR(format, ...) FT_DEBUG_PRINT_E(FUSB_DEBUG_TAG, format, ##__VA_ARGS__)
#define FUSB_WARN(format, ...)  FT_DEBUG_PRINT_W(FUSB_DEBUG_TAG, format, ##__VA_ARGS__)
#define FUSB_INFO(format, ...)  FT_DEBUG_PRINT_I(FUSB_DEBUG_TAG, format, ##__VA_ARGS__)
#define FUSB_DEBUG(format, ...) FT_DEBUG_PRINT_D(FUSB_DEBUG_TAG, format, ##__VA_ARGS__)

#define FUSB_DR_DESC FUsbGenerateReqType(FUSB_REQ_DEVICE_TO_HOST, FUSB_REQ_TYPE_STANDARD, FUSB_REQ_RECP_DEV)

#define FUSB_SKIP_BYTES(desc, bytes)    ((FUsbDescriptor *) ((u8 *) (desc) + (bytes)))
#define FUSB_CONFIG_DESC_SIZE           512     /* best guess */

static void FUsbNopDevDestory(FUsbDev *dev)
{
    FUsbNopDevInit(dev);
    dev->address = FUSB_NO_DEV_ADDR;
    dev->hub = FUSB_NO_HUB;
    dev->port = FUSB_NO_PORT;
}

static void FUsbNopDevPoll(FUsbDev *dev)
{
    return;
}

/**
 * @name: FUsbNopDevInit
 * @msg: 默认的USB设备初始化函数
 * @return {*}
 * @param {FUsbDev} *dev, USB设备实例
 */
void FUsbNopDevInit(FUsbDev *dev)
{
    dev->descriptor = NULL;
    dev->configuration = NULL;
    dev->destroy = FUsbNopDevDestory;
    dev->poll = FUsbNopDevPoll;
}

static inline boolean FUsbParserIsValid(const FUsbConfigParser *parser)
{
    FASSERT(parser);
    return parser->is_valid;
}

static FError FUsbParserDescriptor(FUsbConfigParser *parser)
{
    FASSERT(parser && parser->buf);
    const FUsbDescriptor *cur_pos = parser->buf;
    const FUsbDescriptor *desc_end;
    FUsbDescriptorType last_desc_type = FUSB_DESC_TYPE_NONE;
    FUsbDescriptorType desc_type;
    u8 desc_len, exp_len, alt_len;
    FError ret = FUSB_SUCCESS;

    while (FUSB_SKIP_BYTES(cur_pos, FUSB_DESCRIPTOR_HEADER_SIZE) < parser->end_pos)
    {
        /* get length and type of descriptor */
        desc_len = cur_pos->header.len;
        desc_type = cur_pos->header.type;

        desc_end = FUSB_SKIP_BYTES(cur_pos, desc_len);
        if (desc_end > parser->end_pos)
        {
            FUSB_ERROR("Parse descriptor out of boundary !!!");
            parser->err_pos = cur_pos;
            ret = FUSB_ERR_DESC_PARSE_ERR;
            goto err_handle;
        }

        exp_len = 0;
        alt_len = 0;
        switch (desc_type)
        {
        case FUSB_DESC_TYPE_CONFIG:
            if (FUSB_DESC_TYPE_NONE != last_desc_type)
            {
                FUSB_ERROR("Configuration descriptor must be the first !!!");
                parser->err_pos = cur_pos;
                ret = FUSB_ERR_DESC_PARSE_ERR;
                goto err_handle;
            }
            exp_len = sizeof(FUsbConfigurationDescriptor);
            break;
        case FUSB_DESC_TYPE_INTERFACE:
            if (FUSB_DESC_TYPE_NONE == last_desc_type)
            {
                FUSB_ERROR("Interface descriptor must not be the first !!!");
                parser->err_pos = cur_pos;
                ret = FUSB_ERR_DESC_PARSE_ERR;
                goto err_handle;
            }
            exp_len = sizeof(FUsbInterfaceDescriptor);
            break;
        case FUSB_DESC_TYPE_ENDPOINT:
            if ((FUSB_DESC_TYPE_NONE == last_desc_type) ||
                    (FUSB_DESC_TYPE_CONFIG == last_desc_type))
            {
                FUSB_ERROR("Endpoint descriptor must follow interface descriptor !!!");
                parser->err_pos = cur_pos;
                ret = FUSB_ERR_DESC_PARSE_ERR;
                goto err_handle;
            }
            break;
        default:
            FUSB_DEBUG("Descriptor %d not handled !!!", desc_type);
            break;
        }

        if (((exp_len != 0) && (desc_len != exp_len)) &&
                ((alt_len == 0) || (desc_len != alt_len)))
        {
            FUSB_ERROR("Descriptor %d invalid !!!", desc_type);
            parser->err_pos = cur_pos;
            ret = FUSB_ERR_DESC_PARSE_ERR;
            goto err_handle;
        }

        last_desc_type = desc_type;
        cur_pos = desc_end;
    }

    if (cur_pos != parser->end_pos)
    {
        parser->err_pos = cur_pos;
        ret = FUSB_ERR_DESC_PARSE_ERR;
        goto err_handle;
    }

err_handle:
    if (FUSB_SUCCESS == ret)
    {
        parser->is_valid = TRUE;
    }

    return ret;
}

/**
 * @name: FUsbSetupConfigParser
 * @msg: 配置USB配置描述符解析器
 * @return {*}
 * @param {FUsbDev} *dev, USB设备实例
 * @param {void} *buf, 配置描述符缓冲区
 * @param {u32} buf_len, 配置描述符缓冲区长度
 */
FError FUsbSetupConfigParser(FUsbDev *dev, const void *buf, u32 buf_len)
{
    FASSERT(dev && buf && (buf_len > 0));
    const FUsbConfigurationDescriptor *config_desc;
    FUsbConfigParser *parser = &dev->config_parser;

    memset(parser, 0, sizeof(*parser));

    parser->buf = buf;
    parser->buf_len = buf_len;
    parser->is_valid = FALSE;
    parser->end_pos = FUSB_SKIP_BYTES(parser->buf, parser->buf_len);
    parser->next_pos = parser->buf;
    parser->cur_desc = NULL;
    parser->err_pos = parser->buf;

    if ((parser->buf_len < sizeof(u32)) || (parser->buf_len > FUSB_CONFIG_DESC_SIZE))
    {
        FUSB_ERROR("Invalid buffer length !!!");
        return FUSB_ERR_INVALID_DATA;
    }

    /* input buffer must start with config desc */
    config_desc = (FUsbConfigurationDescriptor *)parser->buf;
    if ((config_desc->bLength != sizeof(FUsbConfigurationDescriptor)) ||
            (config_desc->bDescriptorType != FUSB_DESC_TYPE_CONFIG) ||
            (config_desc->wTotalLength > parser->buf_len))
    {
        FUSB_ERROR("Invalid configuration descriptor !!!");
        return FUSB_ERR_INVALID_DATA;
    }

    /* adjust end position */
    if (config_desc->wTotalLength < parser->buf_len)
    {
        parser->end_pos = FUSB_SKIP_BYTES(parser->buf, config_desc->wTotalLength);
    }

    return FUsbParserDescriptor(parser);
}

/**
 * @name: FUsbRevokeConfigParser
 * @msg: 去初始化USB配置描述符解析器
 * @return {*}
 * @param {FUsbDev} *dev, USB设备实例
 */
void FUsbRevokeConfigParser(FUsbDev *dev)
{
    FASSERT(dev);
    memset(&dev->config_parser, 0, sizeof(dev->config_parser));
    return;
}

/**
 * @name: FUsbGetDescriptorFromParser
 * @msg: 从配置描述符解析器中获取指定类型的描述符(端点描述符/接口描述符)
 * @return {const FUsbDescriptor *} 获取的描述符
 * @param {FUsbConfigParser} *parser, 配置描述符解析器
 * @param {FUsbDescriptorType} type, 获取描述符的类型
 */
const FUsbDescriptor *FUsbGetDescriptorFromParser(FUsbConfigParser *parser, FUsbDescriptorType type)
{
    FASSERT(parser);
    if (!FUsbParserIsValid(parser))
    {
        FUSB_ERROR("Config parse is not valid !!!");
        return NULL;
    }

    const FUsbDescriptor *result = NULL;
    FUsbDescriptorType desc_type;
    u8 desc_len;
    const FUsbDescriptor *desc_end;

    /* travesal all descriptors */
    while (parser->next_pos < parser->end_pos)
    {
        desc_len = parser->next_pos->header.len;
        desc_type = parser->next_pos->header.type;

        desc_end = FUSB_SKIP_BYTES(parser->next_pos, desc_len);
        if (desc_end > parser->end_pos)
            break;

        if ((FUSB_DESC_TYPE_ENDPOINT == type) &&
                (FUSB_DESC_TYPE_INTERFACE == desc_type))
            break; /* there is no chance to find endpoint desc after interface desc */

        if (type == desc_type)
        {
            /* target desc found !!! */
            result = parser->next_pos;
            parser->next_pos = desc_end;
            break;
        }

        parser->next_pos = desc_end;/* check next one */
    }

    if (NULL != result)
    {
        parser->err_pos = result;
    }

    parser->cur_desc = result;
    return result;
}

/**
 * @name: FUsbSetupStringParser
 * @msg: 初始化字符串描述符解析器
 * @return {*}
 * @param {FUsbDev} *dev, USB设备实例
 */
void FUsbSetupStringParser(FUsbDev *dev)
{
    FASSERT(dev);
    FUsbStringParser *parser = &dev->string_parser;

    if (NULL != parser->usb_str)
    {
        FUSB_WARN("String descriptor exists, might cause memory leakage !!!");
    }

    parser->usb_str = NULL;
    memset(parser->str_buf, 0, sizeof(parser->str_buf));

    return;
}

/**
 * @name: FUsbRevokeStringParser
 * @msg: 去初始化字符串描述符解析器
 * @return {*}
 * @param {FUsbDev} *dev, USB设备实例
 */
void FUsbRevokeStringParser(FUsbDev *dev)
{
    FASSERT(dev);
    FUsbStringParser *parser = &dev->string_parser;
    FASSERT(dev->controller && dev->controller->usb);
    FUsb *instance = dev->controller->usb;

    if (NULL != parser->usb_str)
    {
        FUSB_FREE(instance, parser->usb_str);
        parser->usb_str = NULL;
    }

    return;
}

/**
 * @name: FUsbSearchStringDescriptor
 * @msg: 检索字符串描述符,保存在FUsbStringParser结构中
 * @return {*}
 * @param {FUsb} *instance, USB实例
 * @param {FUsbDev} *dev, USB设备实例
 * @param {u8} id, 要获取字符串描述符的ID
 */
FError FUsbSearchStringDescriptor(FUsb *instance, FUsbDev *dev, u8 id)
{
    FASSERT(instance && dev);
    FUsbStringParser *parser = &dev->string_parser;
    const FUsbStringDescriptor *usb_str = NULL;
    u8 total_len;
    u8 char_num;
    u16 character;

    /* re-malloc usb string desc buffer with length 4 */
    if (NULL != parser->usb_str)
    {
        FUSB_FREE(instance, parser->usb_str);
        parser->usb_str = NULL;
    }

    parser->usb_str = FUSB_ALLOCATE(instance, FUSB_USBSTR_MIN_LEN, FUSB_DEFAULT_ALIGN);
    if (NULL == parser->usb_str)
        return FUSB_ERR_ALLOCATE_FAIL;

    /* get header of string for the full length */
    if (FUsbGetStringDescriptor(dev, FUSB_DR_DESC, FUSB_DESC_TYPE_STRING, id, FUSB_DEFAULT_LANG_ID,
                                parser->usb_str, FUSB_USBSTR_MIN_LEN) < 0)
    {
        FUSB_ERROR("Parse string descriptor failed (len: %d) !!!", FUSB_USBSTR_MIN_LEN);
        return FUSB_ERR_DESC_PARSE_ERR;
    }

    /* check if string descriptor header is valid */
    total_len = parser->usb_str->len;
    if ((total_len < FUSB_DESCRIPTOR_HEADER_SIZE) ||
            ((total_len & 1) != 0) ||
            (parser->usb_str->type != FUSB_DESC_TYPE_STRING))
    {
        FUSB_ERROR("Get invalid string descriptor (len: %d) !!!", FUSB_USBSTR_MIN_LEN);
        return FUSB_ERR_DESC_PARSE_ERR;
    }

    /* return if no need to get more */
    if (total_len <= FUSB_USBSTR_MIN_LEN)
        return FUSB_SUCCESS;

    /* re-malloc usb string desc buffer with full length */
    FASSERT(parser->usb_str);
    FUSB_FREE(instance, parser->usb_str);
    parser->usb_str = NULL;

    parser->usb_str = FUSB_ALLOCATE(instance, total_len, FUSB_DEFAULT_ALIGN);
    if (NULL == parser->usb_str)
        return FUSB_ERR_ALLOCATE_FAIL;

    /* get the whole string descriptor */
    if (FUsbGetStringDescriptor(dev, FUSB_DR_DESC, FUSB_DESC_TYPE_STRING, id,  FUSB_DEFAULT_LANG_ID,
                                parser->usb_str, total_len) < 0)
    {
        FUSB_ERROR("Parse string descriptor failed (len: %d)!!!", total_len);
        return FUSB_ERR_DESC_PARSE_ERR;
    }

    if ((parser->usb_str->len < FUSB_DESCRIPTOR_HEADER_SIZE) ||
            ((parser->usb_str->len & 1) != 0) ||
            (parser->usb_str->type != FUSB_DESC_TYPE_STRING))
    {
        FUSB_ERROR("Get invalid string descriptor (len: %d) !!!", total_len);
        return FUSB_ERR_DESC_PARSE_ERR;
    }

    /* convert into ASCII string */
    usb_str = parser->usb_str;
    char_num = (usb_str->len - FUSB_DESCRIPTOR_HEADER_SIZE) / 2; /* in 16-bit way */

    if (char_num >= FUSB_STRDESC_BUF_MAX - 1)
    {
        return FUSB_ERR_NOT_SUPPORT;
    }

    for (u8 i = 0; i < char_num; i++)
    {
        character = usb_str->string[i];
        if (character < ' '     /* 0x20 */
                || character > '~') /* 0x7E */
        {
            character = '_';
        }

        parser->str_buf[i] = (char)character;
    }

    parser->str_buf[char_num] = '\0';
    return FUSB_SUCCESS;
}

/**
 * @name: FUsbGetString
 * @msg: 获取刚刚检索到的字符串描述符内容
 * @return {const char *}, 字符串描述符中的内容
 * @param {FUsbDev} *dev, USB设备实例
 */
const char *FUsbGetString(const FUsbDev *const dev)
{
    FASSERT(dev);
    return (const char *)dev->string_parser.str_buf;
}


text:
<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>

  <parent>
    <groupId>org.camunda.bpm.qa.upgrade</groupId>
    <artifactId>camunda-qa-db-instance-migration</artifactId>
    <version>7.19.0-SNAPSHOT</version>
  </parent>

  <artifactId>camunda-qa-upgrade-test-fixture-716</artifactId>
  <packaging>jar</packaging>
  <name>camunda BPM - QA - upgrade - instance migration - test fixture - 7.16.0</name>

  <properties>
    <camunda.version.previous>7.15.0</camunda.version.previous>

    <version.h2>${version.h2-v1}</version.h2>
  </properties>

  <!-- uncomment when 7.16 is released -->
   <dependencyManagement>
     <dependencies>
       <dependency>
         <groupId>org.camunda.bpm</groupId>
         <artifactId>camunda-bom</artifactId>
         <version>7.16.0</version>
         <scope>import</scope>
         <type>pom</type>
       </dependency>
     </dependencies>
   </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.camunda.bpm</groupId>
      <artifactId>camunda-engine</artifactId>
    </dependency>

    <dependency>
      <groupId>org.camunda.spin</groupId>
      <artifactId>camunda-spin-dataformat-json-jackson</artifactId>
    </dependency>

    <dependency>
      <groupId>org.camunda.bpm</groupId>
      <artifactId>camunda-engine-plugin-spin</artifactId>
    </dependency>

    <dependency>
      <groupId>org.camunda.bpm.qa.upgrade</groupId>
      <artifactId>camunda-qa-upgrade-scenario-util</artifactId>
      <version>${project.version}</version>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>true</filtering>
      </testResource>
    </testResources>
  </build>

  <profiles>
    <profile>
      <id>instance-migration</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>create-sql-script-stubs</id>
                <phase>generate-test-sources</phase>
                <configuration>
                  <target>
                    <property name="current.minor.version" value="${camunda.current.majorVersion}.${camunda.current.minorVersion}" />
                    <property name="previous.minor.version" value="${camunda.previous.majorVersion}.${camunda.previous.minorVersion}" />
                    <property name="current.sql.upgrade.dir" value="${project.build.directory}/scripts-current/sql/upgrade" />
                    <property name="minor.version.upgrade.script.previous.to.current.engine" value="${database.type}_engine_${previous.minor.version}_to_${current.minor.version}.sql" />
                    <property name="minor.version.upgrade.script.previous.to.current.identity" value="${database.type}_identity_${previous.minor.version}_to_${current.minor.version}.sql" />
                    <property name="patch.version.upgrade.script.previous.engine.prefix" value="${database.type}_engine_${previous.minor.version}_patch_${previous.minor.version}" />

                    <!-- create the SQL scripts so that the files exist even if they do not exist in the distribution. (this can be the case if there are no db
                      upgrades (yet) for a particular release ) -->

                    <mkdir dir="${current.sql.upgrade.dir}/" />

                    <!-- concatenated patches for last minor version -->
                    <!-- 7.16.0 is on a clean state so we can again use the concatenated patches -->
                    <touch file="${project.build.directory}/scripts-current/sql/upgrade/${database.type}_engine_${camunda.previous.majorVersion}.${camunda.previous.minorVersion}_patch.sql" />
                    <touch file="${project.build.directory}/scripts-current/sql/upgrade/${database.type}_identity_${camunda.previous.majorVersion}.${camunda.previous.minorVersion}_patch.sql" />

                    <!-- minor version upgrade from previous to current version -->
                    <touch file="${current.sql.upgrade.dir}/${minor.version.upgrade.script.previous.to.current.engine}" />
                    <touch file="${current.sql.upgrade.dir}/${minor.version.upgrade.script.previous.to.current.identity}" />
                  </target>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- provide sql scripts -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>unpack-current-sql-scripts</id>
                <phase>generate-test-sources</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.camunda.bpm.distro</groupId>
                      <artifactId>camunda-sql-scripts</artifactId>
                      <version>7.16.0</version>
                      <type>test-jar</type>
                      <outputDirectory>${project.build.directory}/scripts-current</outputDirectory>
                      <overWrite>true</overWrite>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <!-- parse version properties from qa/pom.xml -->
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>parse-current-version</id>
                <goals>
                  <goal>parse-version</goal>
                </goals>
                <configuration>
                  <propertyPrefix>camunda.current</propertyPrefix>
                  <versionString>7.16.0</versionString>
                </configuration>
              </execution>
              <execution>
                <id>parse-old-version</id>
                <goals>
                  <goal>parse-version</goal>
                </goals>
                <configuration>
                  <propertyPrefix>camunda.previous</propertyPrefix>
                  <versionString>${camunda.version.previous}</versionString>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>sql-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>patch-previous-schema</id>
                <phase>test-compile</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <srcFiles>
                    <!-- now patch old version of the schema -->
                    <!--<srcFile>${project.build.directory}/scripts-current/sql/upgrade/${database.type}_engine_${camunda.previous.majorVersion}.${camunda.previous.minorVersion}_patch_${camunda.previous.majorVersion}.${camunda.previous.minorVersion}.x_to_${camunda.previous.majorVersion}.${camunda.previous.minorVersion}.y.sql</srcFile>-->
                    <srcFile>${project.build.directory}/scripts-current/sql/upgrade/${database.type}_engine_${camunda.previous.majorVersion}.${camunda.previous.minorVersion}_patch.sql</srcFile>
                    <srcFile>${project.build.directory}/scripts-current/sql/upgrade/${database.type}_identity_${camunda.previous.majorVersion}.${camunda.previous.minorVersion}_patch.sql</srcFile>
                  </srcFiles>
                </configuration>
              </execution>
              <execution>
                <id>upgrade-db</id>
                <phase>test-compile</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <srcFiles>
                    <!-- now perform the schema migrations -->
                    <srcFile>${project.build.directory}/scripts-current/sql/upgrade/${database.type}_engine_${camunda.previous.majorVersion}.${camunda.previous.minorVersion}_to_${camunda.current.majorVersion}.${camunda.current.minorVersion}.sql</srcFile>
                    <srcFile>${project.build.directory}/scripts-current/sql/upgrade/${database.type}_identity_${camunda.previous.majorVersion}.${camunda.previous.minorVersion}_to_${camunda.current.majorVersion}.${camunda.current.minorVersion}.sql</srcFile>
                  </srcFiles>
                </configuration>
              </execution>
              <!-- example: patch-current-schema
              <execution>
                <id>patch-current-schema</id>
                <phase>test-compile</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <srcFiles>
                    // now patch current version of the schema
                    // example for aggregate patching of current version
                    <srcFile>${project.build.directory}/scripts-current/sql/upgrade/${database.type}_engine_${camunda.current.majorVersion}.${camunda.current.minorVersion}_patch.sql</srcFile>
                    <srcFile>${project.build.directory}/scripts-current/sql/upgrade/${database.type}_identity_${camunda.current.majorVersion}.${camunda.current.minorVersion}_patch.sql</srcFile>
                  </srcFiles>
                </configuration>
              </execution>
              -->
            </executions>
          </plugin>

          <!-- Initialize Liquibase so that we can make updates to higher
            versions in following test fixtures -->
          <plugin>
            <groupId>org.liquibase</groupId>
            <artifactId>liquibase-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>initialize-liquibase</id>
                <phase>test-compile</phase>
                <goals>
                  <goal>changelogSyncToTag</goal>
                </goals>
                <configuration>
                  <toTag>7.16.0</toTag>
                  <changeLogFile>camunda-changelog.xml</changeLogFile>
                  <changeLogDirectory>${project.build.directory}/scripts-current/sql/liquibase/</changeLogDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <configuration>
              <cleanupDaemonThreads>false</cleanupDaemonThreads>
              <includeProjectDependencies>true</includeProjectDependencies>
              <includePluginDependencies>false</includePluginDependencies>
              <classpathScope>test</classpathScope>
            </configuration>
            <executions>
              <execution>
                <id>create-test-fixture</id>
                <goals>
                  <goal>java</goal>
                </goals>
                <phase>process-test-classes</phase>
                <configuration>
                  <mainClass>org.camunda.bpm.qa.upgrade.TestFixture</mainClass>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>h2</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>sql-maven-plugin</artifactId>
            <executions>
              <!-- In order to migrate from H2 1.4 to 2.x, we
                must make a backup of our data and import it
                with the new version (see 717 fixture) -->
              <execution>
                <id>export-database-h2-14</id>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <sqlCommand>SCRIPT TO '${database.host}changelog.h2.sql' CHARSET 'UTF-8'</sqlCommand>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>


text:
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd" version="3.3" ID="P0b002ee1813532a5">
<name type="corporate">
 <namePart>United States Government Printing Office</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">printer</roleTerm>
  <roleTerm type="code" authority="marcrelator">prt</roleTerm>
</role>
 <role>
  <roleTerm type="text" authority="marcrelator">distributor</roleTerm>
  <roleTerm type="code" authority="marcrelator">dst</roleTerm>
</role>
</name>
<name type="corporate">
 <namePart>United States</namePart>
 <namePart>United States District Court Eastern District of Pennsylvania</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">author</roleTerm>
  <roleTerm type="code" authority="marcrelator">aut</roleTerm>
</role>
 <description>Government Organization</description>
</name>
<typeOfResource>text</typeOfResource>
<genre authority="marcgt">government publication</genre>
<language>
 <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<extension>
 <collectionCode>USCOURTS</collectionCode>
 <category>Judicial Publications</category>
 <branch>judicial</branch>
 <dateIngested>2011-12-21</dateIngested>
</extension>
<originInfo>
 <publisher>Administrative Office of the United States Courts</publisher>
 <dateIssued encoding="w3cdtf">2009-01-06</dateIssued>
 <issuance>monographic</issuance>
</originInfo>
<physicalDescription>
 <note type="source content type">deposited</note>
 <digitalOrigin>born digital</digitalOrigin>
</physicalDescription>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="uri">http://www.gpo.gov/fdsys/pkg/USCOURTS-paed-2_04-cr-00097</identifier>
<identifier type="local">P0b002ee1813532a5</identifier>
<recordInfo>
 <recordContentSource authority="marcorg">DGPO</recordContentSource>
 <recordCreationDate encoding="w3cdtf">2011-12-21</recordCreationDate>
 <recordChangeDate encoding="w3cdtf">2011-12-21</recordChangeDate>
 <recordIdentifier source="DGPO">USCOURTS-paed-2_04-cr-00097</recordIdentifier>
 <recordOrigin>machine generated</recordOrigin>
 <languageOfCataloging>
  <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</languageOfCataloging>
</recordInfo>
<accessCondition type="GPO scope determination">fdlp</accessCondition>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-paed-2_04-cr-00097</accessId>
 <courtType>District</courtType>
 <courtCode>paed</courtCode>
 <courtCircuit>3rd</courtCircuit>
 <courtState>Pennsylvania</courtState>
 <courtSortOrder>2421</courtSortOrder>
 <caseNumber>2:04-cr-00097</caseNumber>
 <caseOffice>Philadelphia</caseOffice>
 <caseType>criminal</caseType>
 <party fullName="CITY OF PHILADELPHIA" lastName="CITY OF PHILADELPHIA" role="Interested Party"></party>
 <party firstName="EDWARD" fullName="EDWARD COLEMAN" lastName="COLEMAN" role="Defendant"></party>
 <party firstName="JOHN" fullName="JOHN LONG" lastName="LONG" role="Defendant"></party>
 <party fullName="USA" lastName="USA" role="Plaintiff"></party>
</extension>
<titleInfo>
 <title>USA v. COLEMAN</title>
 <partNumber>2:04-cr-00097</partNumber>
</titleInfo>
<location>
 <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/pkg/USCOURTS-paed-2_04-cr-00097/content-detail.html</url>
</location>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="preferred citation">2:04-cr-00097;04-097</identifier>
<name type="corporate">
 <namePart>United States District Court Eastern District of Pennsylvania</namePart>
 <namePart>3rd Circuit</namePart>
 <namePart>Philadelphia</namePart>
 <affiliation>U.S. Courts</affiliation>
 <role>
  <roleTerm authority="marcrelator" type="text">author</roleTerm>
  <roleTerm authority="marcrelator" type="code">aut</roleTerm>
</role>
</name>
<name type="personal">
 <displayForm>CITY OF PHILADELPHIA</displayForm>
 <namePart type="family">CITY OF PHILADELPHIA</namePart>
 <namePart type="given"></namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Interested Party</description>
</name>
<name type="personal">
 <displayForm>EDWARD COLEMAN</displayForm>
 <namePart type="family">COLEMAN</namePart>
 <namePart type="given">EDWARD</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<name type="personal">
 <displayForm>JOHN LONG</displayForm>
 <namePart type="family">LONG</namePart>
 <namePart type="given">JOHN</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<name type="personal">
 <displayForm>USA</displayForm>
 <namePart type="family">USA</namePart>
 <namePart type="given"></namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-paed-2_04-cr-00097</accessId>
 <courtType>District</courtType>
 <courtCode>paed</courtCode>
 <courtCircuit>3rd</courtCircuit>
 <courtState>Pennsylvania</courtState>
 <courtSortOrder>2421</courtSortOrder>
 <caseNumber>2:04-cr-00097</caseNumber>
 <caseOffice>Philadelphia</caseOffice>
 <caseType>criminal</caseType>
 <party fullName="CITY OF PHILADELPHIA" lastName="CITY OF PHILADELPHIA" role="Interested Party"></party>
 <party firstName="EDWARD" fullName="EDWARD COLEMAN" lastName="COLEMAN" role="Defendant"></party>
 <party firstName="JOHN" fullName="JOHN LONG" lastName="LONG" role="Defendant"></party>
 <party fullName="USA" lastName="USA" role="Plaintiff"></party>
 <state>Pennsylvania</state>
</extension>
<relatedItem type="constituent" ID="id-USCOURTS-paed-2_04-cr-00097-0" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-paed-2_04-cr-00097/USCOURTS-paed-2_04-cr-00097-0/mods.xml">
 <titleInfo>
  <title>USA v. COLEMAN</title>
  <subTitle>MEMORANDUM AND ORDER AS TO EDWARD COLEMAN THAT 82 (PRO SE) MOTION TO VACATE/SET ASIDE/CORRECT SENTENCE (2255) UNDER 28 U.S.C. 2255 (CIVIL ACTION 07-4785) FILED BY EDWARD COLEMAN IS DENIED AND DISMISSED. IT IS FURTHER ORDERED THAT A CERTIFICATE OF APPEALABILITY, PURSUANT TO 28 U.S.C. SEC. 2253, IS NOT GRANTED AND THAT THE CLERK SHALL MARK THIS CASE CLOSED. Signed by HONORABLE PETRESE B. TUCKER on 1/6/09.(Attachments: #(1) ORDER)1/6/09 Entered and Copies Mailed, E-Mailed. (ke)</subTitle>
  <partNumber>0</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2009-01-06</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-paed-2_04-cr-00097-0.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee18137fb06</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-paed-2_04-cr-00097/USCOURTS-paed-2_04-cr-00097-0</identifier>
 <identifier type="former granule identifier">paed-2_04-cr-00097_0.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-paed-2_04-cr-00097/USCOURTS-paed-2_04-cr-00097-0/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-paed-2_04-cr-00097/pdf/USCOURTS-paed-2_04-cr-00097-0.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 2:04-cr-00097; USA v. COLEMAN; </searchTitle>
  <courtName>United States District Court Eastern District of Pennsylvania</courtName>
  <state>Pennsylvania</state>
  <accessId>USCOURTS-paed-2_04-cr-00097-0</accessId>
  <sequenceNumber>0</sequenceNumber>
  <dateIssued>2009-01-06</dateIssued>
  <docketText>MEMORANDUM AND ORDER AS TO EDWARD COLEMAN THAT 82 (PRO SE) MOTION TO VACATE/SET ASIDE/CORRECT SENTENCE (2255) UNDER 28 U.S.C. 2255 (CIVIL ACTION 07-4785) FILED BY EDWARD COLEMAN IS DENIED AND DISMISSED. IT IS FURTHER ORDERED THAT A CERTIFICATE OF APPEALABILITY, PURSUANT TO 28 U.S.C. SEC. 2253, IS NOT GRANTED AND THAT THE CLERK SHALL MARK THIS CASE CLOSED. Signed by HONORABLE PETRESE B. TUCKER on 1/6/09.(Attachments: #(1) ORDER)1/6/09 Entered and Copies Mailed, E-Mailed. (ke)</docketText>
</extension>
</relatedItem>
</mods>


text:
#ifndef WEBRTC_COMMON_AUDIO_WAV_HEADER_H_
#define WEBRTC_COMMON_AUDIO_WAV_HEADER_H_

#include <stddef.h>
#include <stdint.h>

namespace webrtc {

static const size_t kWavHeaderSize = 44;

class ReadableWav {
 public:
  // Returns the number of bytes read.
  size_t virtual Read(void* buf, size_t num_bytes) = 0;
  virtual ~ReadableWav() {}
};

enum WavFormat {
  kWavFormatPcm   = 1,  // PCM, each sample of size bytes_per_sample
  kWavFormatALaw  = 6,  // 8-bit ITU-T G.711 A-law
  kWavFormatMuLaw = 7,  // 8-bit ITU-T G.711 mu-law
};

// Return true if the given parameters will make a well-formed WAV header.
bool CheckWavParameters(size_t num_channels,
                        int sample_rate,
                        WavFormat format,
                        size_t bytes_per_sample,
                        size_t num_samples);

// Write a kWavHeaderSize bytes long WAV header to buf. The payload that
// follows the header is supposed to have the specified number of interleaved
// channels and contain the specified total number of samples of the specified
// type. CHECKs the input parameters for validity.
void WriteWavHeader(uint8_t* buf,
                    size_t num_channels,
                    int sample_rate,
                    WavFormat format,
                    size_t bytes_per_sample,
                    size_t num_samples);

// Read a WAV header from an implemented ReadableWav and parse the values into
// the provided output parameters. ReadableWav is used because the header can
// be variably sized. Returns false if the header is invalid.
bool ReadWavHeader(ReadableWav* readable,
                   size_t* num_channels,
                   int* sample_rate,
                   WavFormat* format,
                   size_t* bytes_per_sample,
                   size_t* num_samples);

}  // namespace webrtc

#endif  // WEBRTC_COMMON_AUDIO_WAV_HEADER_H_


text:
        <ng-include src='"/modules/instructors/views/instructor.sidebar.html"'></ng-include>

                <form class="black-grey" data-ng-submit="updateAssessment()">
                    <fieldset>

                            Assessment Name

                                <input type="text" data-ng-model="assessment.assessment_name" id="assessment_name" class="form-control" placeholder="" required>

                            {{dt | date:'fullDate'}}

                                  <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="dt" is-open="opened" datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true" close-text="Close" />

                                    <button type="button" class="btn btn-default" ng-click="open($event)"></button>

                            Score

                                <input type="text" data-ng-model="assessment.score" id="score" class="form-control" placeholder="" required>

                            <input type="submit" class="btn btn-large btn-success myButton">

                    </fieldset>
                </form>

                ×

You are not permitted to view this page


text:
var path = require('path')
var fs = require('fs')

if (!fs.existsSync(path.join(__dirname, '/node_modules'))) {
  console.error('ERROR: Node module folder missing. Try running `npm install`')
  process.exit(0)
}

// run gulp

var spawn = require('cross-spawn')

process.env['FORCE_COLOR'] = 1
var gulp = spawn('gulp')
gulp.stdout.pipe(process.stdout)
gulp.stderr.pipe(process.stderr)
process.stdin.pipe(gulp.stdin)

gulp.on('exit', function (code) {
  console.log('gulp exited with code ' + code.toString())
})


text:
.. _config_http_filters_grpc_http1_reverse_bridge:

gRPC HTTP/1.1 reverse bridge
============================

* gRPC :ref:`architecture overview <arch_overview_grpc>`
* :ref:`v3 API reference <envoy_v3_api_msg_extensions.filters.http.grpc_http1_reverse_bridge.v3.FilterConfig>`
* This filter should be configured with the name *envoy.filters.http.grpc_http1_reverse_bridge*.

This is a filter that enables converting an incoming gRPC request into a HTTP/1.1 request to allow
a server that does not understand HTTP/2 or gRPC semantics to handle the request.

The filter works by:

* Checking the content type of the incoming request. If it's a gRPC request, the filter is enabled.
* The content type is modified to a configurable value. This can be a noop by configuring
  ``application/grpc``.
* The gRPC frame header is optionally stripped from the request body. The content length header
  will be adjusted if so.
* On receiving a response, the content type of the response is validated and the status code is
  mapped to a grpc-status which is inserted into the response trailers.
* The response body is optionally prefixed by the gRPC frame header, again adjusting the content
  length header if necessary.

Due to being mapped to HTTP/1.1, this filter will only work with unary gRPC calls.

gRPC frame header management
----------------------------

By setting the withhold_grpc_frame option, the filter will assume that the upstream does not
understand any gRPC semantics and will convert the request body into a simple binary encoding
of the request body and perform the reverse conversion on the response body. This ends up
simplifying the server side handling of these requests, as they no longer need to be concerned
with parsing and generating gRPC formatted data.

This works by stripping the gRPC frame header from the request body, while injecting a gRPC
frame header in the response.

If this feature is not used, the upstream must be ready to receive HTTP/1.1 requests prefixed
with the gRPC frame header and respond with gRPC formatted responses.

How to disable HTTP/1.1 reverse bridge filter per route
-------------------------------------------------------

.. code-block:: yaml

  admin:
    access_log_path: /dev/stdout
    address:
      socket_address:
        address: 0.0.0.0
        port_value: 9901
  static_resources:
    listeners:
    - name: listener_0
      address:
        socket_address:
          address: 0.0.0.0
          port_value: 80
      filter_chains:
      - filters:
        - name: envoy.filters.network.http_connection_manager
          typed_config:
            "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
            access_log:
            - name: envoy.access_loggers.file
              typed_config:
                "@type": type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog
                path: /dev/stdout
            stat_prefix: ingress_http
            route_config:
              name: local_route
              virtual_hosts:
              - name: local_service
                domains: ["*"]
                routes:
                - match:
                    prefix: "/route-with-filter-disabled"
                  route:
                    host_rewrite: localhost
                    cluster: grpc
                    timeout: 5.00s
                  # per_filter_config disables the filter for this route
                  typed_per_filter_config:
                    envoy.filters.http.grpc_http1_reverse_bridge:
                      "@type": type.googleapis.com/envoy.extensions.filters.http.grpc_http1_reverse_bridge.v3.FilterConfigPerRoute
                      disabled: true
                - match:
                    prefix: "/route-with-filter-enabled"
                  route:
                    host_rewrite: localhost
                    cluster: other
                    timeout: 5.00s
            http_filters:
            - name: envoy.filters.http.grpc_http1_reverse_bridge
              typed_config:
                "@type": type.googleapis.com/envoy.extensions.filters.http.grpc_http1_reverse_bridge.v3.FilterConfig
                content_type: application/grpc+proto
                withhold_grpc_frames: true
            - name: envoy.filters.http.router
              typed_config: {}
    clusters:
    - name: other
      connect_timeout: 5.00s
      type: LOGICAL_DNS
      dns_lookup_family: V4_ONLY
      lb_policy: ROUND_ROBIN
      load_assignment:
        cluster_name: some_service
        endpoints:
          - lb_endpoints:
            - endpoint:
                address:
                  socket_address:
                    address: localhost
                    port_value: 4630
    - name: grpc
      connect_timeout: 5.00s
      type: strict_dns
      lb_policy: round_robin
      http2_protocol_options: {}
      load_assignment:
        cluster_name: grpc
        endpoints:
          - lb_endpoints:
              - endpoint:
                  address:
                    socket_address:
                      address: localhost
                      port_value: 10005


text:
<!DOCTYPE html>

	<title>Angular NG Enter Test</title>

		<input type="text" name'testinput' on-enter='shoutOut()' />

		when you press enter, the shout method in the test controller will be executed


text:
JAVA=java
JAVAC=javac
CLASSPATH=bin/:.:sqlite-jdbc-3.7.2.jar

VIEW_SRC=$(wildcard view/*.java)
VIEW_CLASS=$(VIEW_SRC:.java=.class)
BIN_VIEW_CLASS=$(addprefix bin/,$(VIEW_CLASS))
MODEL_SRC=$(wildcard model/*.java)
MODEL_CLASS=$(MODEL_SRC:.java=.class)
BIN_MODEL_CLASS=$(addprefix bin/,$(MODEL_CLASS))

all: bin/imgVwr.class bin/controller/Controller.class $(BIN_MODEL_CLASS) $(BIN_VIEW_CLASS)

bin/%.class: %.java
	$(JAVAC) $^ -d bin

.PHONY: all clean run

clean:
	rm -rf bin/*

run: all
	$(JAVA) -classpath $(CLASSPATH) imgVwr


text:
<?php

namespace Luxifer\DQL\Datetime;

use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;

/**
 * DateFunction ::= "QUARTER" "(" ArithmeticPrimary ")"
 */
class Quarter extends FunctionNode
{
    public $dateExpression;

    public function parse(Parser $parser)
    {
        $parser->match(Lexer::T_IDENTIFIER);
        $parser->match(Lexer::T_OPEN_PARENTHESIS);
        $this->dateExpression = $parser->ArithmeticPrimary();
        $parser->match(Lexer::T_CLOSE_PARENTHESIS);
    }

    public function getSql(SqlWalker $sqlWalker)
    {
        return 'QUARTER(' .
            $this->dateExpression->dispatch($sqlWalker) .
        ')';
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">

    <title>

        Work •

      Research to Publication
    </title>
    <meta name="description" content="A small selection of things I've designed, illustrated, or developed.">

    <link rel="canonical" href="http://localhost:4000/work/">
    <link rel="sitemap" type="application/xml" title="Sitemap" href="http://localhost:4000/sitemap.xml">

    <link rel="stylesheet" href="/assets/global-f70bdd2fc174a7378070bc3d11193dc8.css">

    <link rel="apple-touch-icon" sizes="57x57" href="http://localhost:4000/apple-touch-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="http://localhost:4000/apple-touch-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="http://localhost:4000/apple-touch-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="http://localhost:4000/apple-touch-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="http://localhost:4000/apple-touch-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="http://localhost:4000/apple-touch-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="http://localhost:4000/apple-touch-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="http://localhost:4000/apple-touch-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="http://localhost:4000/apple-touch-icon-180x180.png">
    <link rel="icon" type="image/png" href="http://localhost:4000/favicon-32x32.png" sizes="32x32">
    <link rel="icon" type="image/png" href="http://localhost:4000/android-chrome-192x192.png" sizes="192x192">
    <link rel="icon" type="image/png" href="http://localhost:4000/favicon-96x96.png" sizes="96x96">
    <link rel="icon" type="image/png" href="http://localhost:4000/favicon-16x16.png" sizes="16x16">
    <link rel="manifest" href="http://localhost:4000/android-chrome-manifest.json">
    <meta name="msapplication-TileColor" content="#000000">
    <meta name="msapplication-TileImage" content="http://localhost:4000/mstile-144x144.png">
    <meta name="theme-color" content="#dfdddf">

About

Courses

Enrol

Sign In

Research to Publication Table of Contents

About

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque.

Courses

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque.

Enrol

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque.

Sign In

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque.

<button type="button" id="js-menu-trigger" class="sliding-menu-button lines-button x2" role="button" aria-label="Toggle Navigation">

</button>

Work

A small selection of things I've designed, illustrated, or developed.

Home

About

Courses

© 2015. Research to Publication & The BMJ


text:
package com.esri.mapreduce;

import com.esri.dbf.DBFField;
import com.esri.dbf.DBFReader;
import com.esri.dbf.DBFType;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.MapWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.RecordReader;
import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.mapreduce.lib.input.FileSplit;

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

/**
 */
public class DBFRecordReader
        extends RecordReader<LongWritable, MapWritable>
{
    protected final LongWritable m_recordNumber = new LongWritable();
    protected final MapWritable m_mapWritable = new MapWritable();
    protected long m_length;
    protected FSDataInputStream m_dbfStream;
    protected DBFReader m_dbfReader;
    protected long m_recno;
    private ArrayList<Text> m_keys;

    public DBFRecordReader(
            final InputSplit inputSplit,
            final TaskAttemptContext taskAttemptContext) throws IOException, InterruptedException
    {
        initialize(inputSplit, taskAttemptContext);
    }

    @Override
    public void initialize(
            final InputSplit inputSplit,
            final TaskAttemptContext taskAttemptContext) throws IOException, InterruptedException
    {
        if (inputSplit instanceof FileSplit)
        {
            final FileSplit fileSplit = (FileSplit) inputSplit;
            m_length = fileSplit.getLength();
            final Path path = fileSplit.getPath();
            final FileSystem fileSystem = path.getFileSystem(taskAttemptContext.getConfiguration());
            m_dbfStream = fileSystem.open(path);
            m_dbfReader = new DBFReader(m_dbfStream);

            final List<DBFField> fields = m_dbfReader.getFields();
            m_keys = new ArrayList<Text>(fields.size());
            for (final DBFField field : fields)
            {
                m_keys.add(new Text(field.fieldName));
            }
        }
        else
        {
            throw new IOException("Input split is not an instance of FileSplit");
        }
    }

    @Override
    public LongWritable getCurrentKey() throws IOException, InterruptedException
    {
        return m_recordNumber;
    }

    @Override
    public MapWritable getCurrentValue() throws IOException, InterruptedException
    {
        return m_mapWritable;
    }

    @Override
    public boolean nextKeyValue() throws IOException, InterruptedException
    {
        final boolean hasNext = m_dbfReader.nextDataType() != DBFType.END;
        if (hasNext)
        {
            m_recordNumber.set(m_recno++);
            final int numFields = m_dbfReader.getNumberOfFields();
            for (int i = 0; i < numFields; i++)
            {
                m_mapWritable.put(m_keys.get(i), m_dbfReader.readFieldWritable(i));
            }
        }
        return hasNext;
    }

    @Override
    public float getProgress() throws IOException, InterruptedException
    {
        return m_dbfStream.getPos() / m_length;
    }

    @Override
    public void close() throws IOException
    {
        if (m_dbfStream != null)
        {
            m_dbfStream.close();
            m_dbfStream = null;
        }
    }
}


text:
@class GameEngineLayer;

@interface GameObject : CCSprite {
    BOOL active,do_render;
    CCSprite *img;
}

@property(readwrite,assign) BOOL active,do_render;
@property(readwrite,assign) CCSprite *img;

-(void)update:(Player*)player g:(GameEngineLayer *)g;
-(HitRect) get_hit_rect;
-(void)set_active:(BOOL)t_active;
-(int)get_render_ord;
-(void)reset;

-(void)check_should_render:(GameEngineLayer *)g;

-(Island*)get_connecting_island:(NSMutableArray*)islands;

@end


text:
@interface PodsDummy_Pods_TrackingSimulatorTests : NSObject
@end
@implementation PodsDummy_Pods_TrackingSimulatorTests
@end


text:
package org.apache.nifi.cluster.lifecycle;

import org.apache.nifi.cluster.coordination.ClusterCoordinator;
import org.apache.nifi.cluster.coordination.node.DisconnectionCode;
import org.apache.nifi.cluster.coordination.node.NodeConnectionState;
import org.apache.nifi.cluster.coordination.node.NodeConnectionStatus;
import org.apache.nifi.cluster.coordination.node.OffloadCode;
import org.apache.nifi.cluster.protocol.NodeIdentifier;
import org.apache.nifi.controller.DecommissionTask;
import org.apache.nifi.controller.FlowController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;

public class ClusterDecommissionTask implements DecommissionTask {
    private static final Logger logger = LoggerFactory.getLogger(ClusterDecommissionTask.class);
    private static final int delaySeconds = 3;

    private final ClusterCoordinator clusterCoordinator;
    private final FlowController flowController;
    private NodeIdentifier localNodeIdentifier;

    public ClusterDecommissionTask(final ClusterCoordinator clusterCoordinator, final FlowController flowController) {
        this.clusterCoordinator = clusterCoordinator;
        this.flowController = flowController;
    }

    @Override
    public synchronized void decommission() throws InterruptedException {
        if (clusterCoordinator == null) {
            throw new IllegalStateException("Cannot decommission Node because it is not part of a cluster");
        }

        logger.info("Decommissioning Node...");
        localNodeIdentifier = clusterCoordinator.getLocalNodeIdentifier();
        if (localNodeIdentifier == null) {
            throw new IllegalStateException("Node has not yet connected to the cluster");
        }

        flowController.stopHeartbeating();
        flowController.setClustered(false, null);
        logger.info("Instructed FlowController to stop sending heartbeats to Cluster Coordinator and take Cluster Disconnect actions");

        disconnectNode();
        logger.info("Requested that node be disconnected from cluster");

        waitForDisconnection();
        logger.info("Successfully disconnected node from cluster");

        offloadNode();
        logger.info("Successfully triggered Node Offload. Will wait for offload to complete");

        waitForOffloadToFinish();
        logger.info("Offload has successfully completed.");

        removeFromCluster();
        logger.info("Requested that node be removed from cluster.");

        waitForRemoval();
        logger.info("Node successfully removed from cluster. Decommission is complete.");
    }

    private void disconnectNode() throws InterruptedException {
        logger.info("Requesting that Node disconnect from cluster");

        while (true) {
            final Future<Void> future = clusterCoordinator.requestNodeDisconnect(localNodeIdentifier, DisconnectionCode.USER_DISCONNECTED, "Node is being decommissioned");
            try {
                future.get();
                return;
            } catch (final ExecutionException e) {
                final Throwable cause = e.getCause();
                logger.error("Failed when attempting to disconnect node from cluster", cause);
            }
        }
    }

    private void waitForDisconnection() throws InterruptedException {
        logger.info("Waiting for Node to be completely disconnected from cluster");
        waitForState(Collections.singleton(NodeConnectionState.DISCONNECTED));
    }

    private void offloadNode() throws InterruptedException {
        logger.info("Requesting that Node be offloaded");

        while (true) {
            final Future<Void> future = clusterCoordinator.requestNodeOffload(localNodeIdentifier, OffloadCode.OFFLOADED, "Node is being decommissioned");
            try {
                future.get();
                break;
            } catch (final ExecutionException e) {
                final Throwable cause = e.getCause();
                logger.error("Failed when attempting to disconnect node from cluster", cause);
            }
        }

        // Wait until status changes to either OFFLOADING or OFFLOADED.
        waitForState(new HashSet<>(Arrays.asList(NodeConnectionState.OFFLOADING, NodeConnectionState.OFFLOADED)));
    }

    private void waitForState(final Set<NodeConnectionState> acceptableStates) throws InterruptedException {
        while (true) {
            final NodeConnectionStatus status = clusterCoordinator.getConnectionStatus(localNodeIdentifier);
            final NodeConnectionState state = status.getState();
            logger.debug("Node state is {}", state);

            if (acceptableStates.contains(state)) {
                return;
            }

            TimeUnit.SECONDS.sleep(delaySeconds);
        }
    }

    private void waitForOffloadToFinish() throws InterruptedException {
        logger.info("Waiting for Node to finish offloading");

        while (true) {
            final NodeConnectionStatus status = clusterCoordinator.getConnectionStatus(localNodeIdentifier);
            final NodeConnectionState state = status.getState();
            if (state == NodeConnectionState.OFFLOADED) {
                return;
            }

            if (state != NodeConnectionState.OFFLOADING) {
                throw new IllegalStateException("Expected state of Node to be OFFLOADING but Node is now in a state of " + state);
            }

            logger.debug("Node state is OFFLOADING. Will wait {} seconds and check again", delaySeconds);
            TimeUnit.SECONDS.sleep(delaySeconds);
        }
    }

    private void removeFromCluster() {
        clusterCoordinator.removeNode(localNodeIdentifier, "<Local Decommission>");
    }

    private void waitForRemoval() throws InterruptedException {
        logger.info("Waiting for Node to be completely removed from cluster");

        while (true) {
            final NodeConnectionStatus status = clusterCoordinator.getConnectionStatus(localNodeIdentifier);
            if (status == null) {
                return;
            }

            final NodeConnectionState state = status.getState();
            if (state == NodeConnectionState.REMOVED) {
                return;
            }

            logger.debug("Node state is {}. Will wait {} seconds and check again", state, delaySeconds);
            TimeUnit.SECONDS.sleep(delaySeconds);
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="JavaScriptLibraryMappings">
    <file url="file://$PROJECT_DIR$/AudioPlayerES2015" libraries="{ExamPreparation/AudioPlayerES2015/node_modules}" />
    <includedPredefinedLibrary name="ECMAScript 6" />
  </component>
</project>


text:
namespace IO
{
    class SAXDelegator
    {
    public:
        virtual ~SAXDelegator() {}

        virtual void startElement(void *ctx, const char *name, const char **atts) = 0;
        virtual void endElement(void *ctx, const char *name) = 0;
        virtual void textHandler(void *ctx, const char *s, int len) = 0;
    };

    class SAXParser
    {
    public:
        SAXParser();
        ~SAXParser(void);
        bool parse(const HBYTE* xmlData, uint64 dataLength);
        bool parse(const std::string& filename);
        void setDelegator(SAXDelegator* delegator);
        static void startElement(void *ctx, const char *name, const char **atts);
        static void endElement(void *ctx, const char *name);
        static void textHandler(void *ctx, const char *name, int len);

    private:
        SAXDelegator*  delegator_;
    };

    typedef enum
    {
        SAX_NONE = 0,
        SAX_KEY,
        SAX_DICT,
        SAX_INT,
        SAX_REAL,
        SAX_STRING,
        SAX_ARRAY
    }SAXState;

    typedef enum
    {
        SAX_RESULT_NONE = 0,
        SAX_RESULT_DICT,
        SAX_RESULT_ARRAY
    }SAXResult;

    class DictMaker final : public SAXDelegator
    {
    public:
        SAXResult resultType_;
        ValueMap rootDict_;
        ValueVector rootArray_;

        std::string curKey_;   ///< parsed key
        std::string curValue_; // parsed value
        SAXState state_;

        ValueMap*  curDict_;
        ValueVector* curArray_;

        std::stack<ValueMap*> dictStack_;
        std::stack<ValueVector*> arrayStack_;
        std::stack<SAXState>  stateStack_;

    public:
        DictMaker();
        ~DictMaker();

        ValueMap dictionaryWithContentsOfFile(const std::string& fileName);
        ValueMap dictionaryWithDataOfFile(const HBYTE* filedata, int filesize);
        ValueVector arrayWithContentsOfFile(const std::string& fileName);

        void startElement(void *, const char *name, const char **);
        void endElement(void *, const char *name);

        void textHandler(void *, const char *ch, int len);
    };
}

#endif // DICTMAKER_H


text:
int main(int argc, char *argv[])
{
	BoundingBox	bbox(vcg::Point3i(-20, -20, -20), vcg::Point3i(20, 20, 20));
	vcg::Point3i			resolution(40, 40, 40);

	Volume	volume;
	Walker	walker(bbox, resolution);

	typedef vcg::tri::MarchingCubes<Mesh, Walker>					MarchingCubes;
	typedef vcg::tri::ExtendedMarchingCubes<Mesh, Walker> ExtendedMarchingCubes;

	// MARCHING CUBES
	Mesh		mc_mesh;
	printf("[MARCHING CUBES] Building mesh...");
	MarchingCubes					mc(mc_mesh, walker);
	walker.BuildMesh<MarchingCubes>(mc_mesh, volume, mc);
	vcg::tri::io::ExporterPLY<Mesh>::Save( mc_mesh, "marching_cubes.ply");
	printf("OK!\n");

	// EXTENDED MARCHING CUBES
	Mesh		emc_mesh;
	printf("[EXTENDED MARCHING CUBES] Building mesh...");
	ExtendedMarchingCubes emc(emc_mesh, walker, 30);
	walker.BuildMesh<ExtendedMarchingCubes>(emc_mesh, volume, emc);
	vcg::tri::io::ExporterPLY<Mesh>::Save( emc_mesh, "extended_marching_cubes.ply");
	printf("OK!\n");
};


text:
<form class="form-horizontal"
      role="form">

Do you approve this invoice?

    Invoice Document

    Creditor

      <input cam-variable-name="creditor"
             type="text"
             name="creditor"
             readonly="true"
             class="form-control" />

    Amount

      <input cam-variable-name="amount"
             type="text"
             name="amount"
             readonly="true"
             class="form-control" />

    Invoice Category

      <input cam-variable-name="invoiceCategory"
             type="text"
             name="amount"
             readonly="true"
             class="form-control" />

    Invoice Number

      <input cam-variable-name="invoiceNumber"
             type="text"
             name="invoiceNumber"
             readonly="true"
             class="form-control" />

          <input cam-variable-name="approved"
                 cam-variable-type="Boolean"
                 type="checkbox"
                 name="approved"
                 class="form-control" />
          Do you approve?

</form>


text:
Parcurgere în adâncime

        <md-input-container>
            Rădăcina
            <input ng-model="dft.root" type="number">
        </md-input-container>
        <md-button class="md-raised" ng-click="playDFT()">Parcurge</md-button>

        <md-button class="md-raised md-accent">L</md-button>
        <md-button class="md-raised md-primary"
                   ng-repeat="i in dft.list">{{::i}}
        </md-button>


text:
package com.intel.analytics.zoo.pipeline.api.keras.layers

import com.intel.analytics.bigdl.nn.keras.{Cropping1D => BigDLCropping1D}
import com.intel.analytics.bigdl.tensor.TensorNumericMath.TensorNumeric
import com.intel.analytics.bigdl.utils.Shape
import com.intel.analytics.zoo.pipeline.api.Net

import scala.reflect.ClassTag

/**
 * Cropping layer for 1D input (e.g. temporal sequence).
 * The input of this layer should be 3D.
 *
 * When you use this layer as the first layer of a model, you need to provide the argument
 * inputShape (a Single Shape, does not include the batch dimension).
 *
 * @param cropping Int array of length 2. How many units should be trimmed off
 *                 at the beginning and end of the cropping dimension. Default is (1, 1).
 * @param inputShape A Single Shape, does not include the batch dimension.
 * @tparam T Numeric type of parameter(e.g. weight, bias). Only support float/double now.
 */
class Cropping1D[T: ClassTag](
    override val cropping: Array[Int] = Array(1, 1),
    override val inputShape: Shape = null)(implicit ev: TensorNumeric[T])
  extends BigDLCropping1D[T](
    cropping, inputShape) with Net {
}

object Cropping1D {
  def apply[@specialized(Float, Double) T: ClassTag](
    cropping: (Int, Int) = (1, 1),
    inputShape: Shape = null)(implicit ev: TensorNumeric[T]): Cropping1D[T] = {
    val croppingArray = cropping match {
      case null => throw new IllegalArgumentException("For Cropping1D, " +
        "cropping can not be null, please input int tuple of length 2")
      case _ => Array(cropping._1, cropping._2)
    }
    new Cropping1D[T](croppingArray, inputShape)
  }
}


text:
title: Reivindicativos incoherentes
date: 2012-03-22 00:00:00 Z
layout: post
categories: [ Analisis, Universidad ]
type: text
---

Algunos estudiantes **se quejan de Bolonia** (dicen que ese plan "vende" la Universidad al capitalismo porque convierte las carreras en canteras de trabajadores precarios) pero luego critican que los títulos no les valen para comer o para llegar a fin de mes.


text:
{{majorGroupEdit.mode}} {{majorGroupEdit.mainName}}

    <form name="form.frmMajorGroupsEdit" novalidate>

        Name:
        <input type="text" name="majorGroupName" ng-model="majorGroupEdit.name" value="{{majorGroupEdit.name}}" required />

        <input id="chkActive" type="checkbox" ng-model="majorGroupEdit.active" ng-checked="majorGroupEdit.active === '1'" ng-true-value="1" ng-false-value="0" />
        Active

    </form>

    <button class="btn btn-primary" ng-click="ok()">OK</button>
    <button class="btn btn-warning" ng-click="cancel()">Cancel</button>


text:
<?php

$this->load->view('template/entete');
$this->load->view($view);
$this->load->view('template/footer');
?>


text:
import Router from 'viewModels/router'

import body from 'viewModels/middlewares/body'
import bodyMultipart from 'viewModels/middlewares/bodyMultipart'
import token from 'viewModels/middlewares/token'
import admin from 'viewModels/middlewares/admin'

import id from './middlewares/id'

import index from './index'
import read from './read'
import create from './create'
import del from './delete'
import restore from './restore'

const router = new Router;

router.get('storage/index', '/', admin, index);
router.get('storage/read', '/:id', admin, id, read);

router.use(token)
router.use(admin)

router.post('/create', bodyMultipart, create);

router.del('/:id', id, del);
router.post('/:id/delete', id, del);

router.post('/:id/restore', id, restore);

export default router