text:
namespace Microsoft.AzureStack.Management.Backup.Admin
{
    using Microsoft.Rest;
    using Microsoft.Rest.Azure;
    using Models;
    using System.Collections;
    using System.Collections.Generic;
    using System.Threading;
    using System.Threading.Tasks;

    /// <summary>
    /// BackupLocationsOperations operations.
    /// </summary>
    public partial interface IBackupLocationsOperations
    {
        /// <summary>
        /// Returns the list of backup locations.
        /// </summary>
        /// <param name='resourceGroupName'>
        /// Name of the resource group.
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="Microsoft.Rest.Azure.CloudException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="Microsoft.Rest.SerializationException">
        /// Thrown when unable to deserialize the response
        /// </exception>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        Task<AzureOperationResponse<IPage<BackupLocation>>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
        /// <summary>
        /// Returns a specific backup location based on name.
        /// </summary>
        /// <param name='resourceGroupName'>
        /// Name of the resource group.
        /// </param>
        /// <param name='location'>
        /// Name of the backup location.
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="Microsoft.Rest.Azure.CloudException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="Microsoft.Rest.SerializationException">
        /// Thrown when unable to deserialize the response
        /// </exception>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        Task<AzureOperationResponse<BackupLocation>> GetWithHttpMessagesAsync(string resourceGroupName, string location, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
        /// <summary>
        /// Update a backup location.
        /// </summary>
        /// <param name='resourceGroupName'>
        /// Name of the resource group.
        /// </param>
        /// <param name='location'>
        /// Name of the backup location.
        /// </param>
        /// <param name='backup'>
        /// Backup location object.
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="Microsoft.Rest.Azure.CloudException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="Microsoft.Rest.SerializationException">
        /// Thrown when unable to deserialize the response
        /// </exception>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        Task<AzureOperationResponse<BackupLocation>> UpdateWithHttpMessagesAsync(string resourceGroupName, string location, BackupLocation backup, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
        /// <summary>
        /// Back up a specific location.
        /// </summary>
        /// <param name='resourceGroupName'>
        /// Name of the resource group.
        /// </param>
        /// <param name='location'>
        /// Name of the backup location.
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="Microsoft.Rest.Azure.CloudException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="Microsoft.Rest.SerializationException">
        /// Thrown when unable to deserialize the response
        /// </exception>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        Task<AzureOperationResponse<Backup>> CreateBackupWithHttpMessagesAsync(string resourceGroupName, string location, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
        /// <summary>
        /// Update a backup location.
        /// </summary>
        /// <param name='resourceGroupName'>
        /// Name of the resource group.
        /// </param>
        /// <param name='location'>
        /// Name of the backup location.
        /// </param>
        /// <param name='backup'>
        /// Backup location object.
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="Microsoft.Rest.Azure.CloudException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="Microsoft.Rest.SerializationException">
        /// Thrown when unable to deserialize the response
        /// </exception>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        Task<AzureOperationResponse<BackupLocation>> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string location, BackupLocation backup, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
        /// <summary>
        /// Back up a specific location.
        /// </summary>
        /// <param name='resourceGroupName'>
        /// Name of the resource group.
        /// </param>
        /// <param name='location'>
        /// Name of the backup location.
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="Microsoft.Rest.Azure.CloudException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="Microsoft.Rest.SerializationException">
        /// Thrown when unable to deserialize the response
        /// </exception>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        Task<AzureOperationResponse<Backup>> BeginCreateBackupWithHttpMessagesAsync(string resourceGroupName, string location, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
        /// <summary>
        /// Returns the list of backup locations.
        /// </summary>
        /// <param name='nextPageLink'>
        /// The NextLink from the previous successful call to List operation.
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="Microsoft.Rest.Azure.CloudException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="Microsoft.Rest.SerializationException">
        /// Thrown when unable to deserialize the response
        /// </exception>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        Task<AzureOperationResponse<IPage<BackupLocation>>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php
namespace Earls\LeaseBundle\Form\Model;

use Earls\LeaseBundle\Entity\Restaurants;
use Symfony\Component\Validator\Constraints as Assert;
use Earls\LeaseBundle\Entity\Areas;

class DropDownModel {

    protected $area1;

    protected $area2;

    protected $area3;

    protected $storefilenumber;

    public function setArea1(Areas $area1){
        $this->area1 = $area1;
    }

    public function getArea1(){
        return $this->area1;
    }

    public function setArea2(Areas $area2){
        $this->area2 = $area2;
    }

    public function getArea2(){
        return $this->area2;
    }

    public function setArea3(Areas $area3){
        $this->area3 = $area3;
    }

    public function getArea3(){
        return $this->area3;
    }

    public function setStorefileNumber(Restaurants $storefilenumber){
        $this->storefilenumber = $storefilenumber;
    }

    public function getStorefileNumber(){
        return $this->storefilenumber;
    }

}


text:
package co.cask.cdap.etl.common;

import co.cask.cdap.api.common.Bytes;
import co.cask.cdap.api.data.format.StructuredRecord;
import co.cask.cdap.api.data.schema.Schema;
import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import com.google.gson.stream.JsonWriter;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;

/**
 * Utility class for converting {@link StructuredRecord} to and from json.
 */
public final class StructuredRecordStringConverter {

  // Known Java type to schema type mapping
  // Doesn't have map and array as those need to use instanceof to check
  private static final Map<Class<?>, Schema.Type> TYPE_TO_SCHEMA = new IdentityHashMap<>(
    ImmutableMap.<Class<?>, Schema.Type>builder()
      .put(Boolean.class, Schema.Type.BOOLEAN)
      .put(Byte.class, Schema.Type.INT)
      .put(Short.class, Schema.Type.INT)
      .put(Integer.class, Schema.Type.INT)
      .put(Long.class, Schema.Type.LONG)
      .put(Float.class, Schema.Type.FLOAT)
      .put(Double.class, Schema.Type.DOUBLE)
      .put(String.class, Schema.Type.STRING)
      .put(ByteBuffer.class, Schema.Type.BYTES)
      .put(byte[].class, Schema.Type.BYTES)
      .put(StructuredRecord.class, Schema.Type.RECORD)
      .build()
  );

  private static final EnumMap<Schema.Type, JsonToken> SCHEMA_TO_JSON_TYPE = new EnumMap<>(
    ImmutableMap.<Schema.Type, JsonToken>builder()
      .put(Schema.Type.NULL, JsonToken.NULL)
      .put(Schema.Type.BOOLEAN, JsonToken.BOOLEAN)
      .put(Schema.Type.INT, JsonToken.NUMBER)
      .put(Schema.Type.LONG, JsonToken.NUMBER)
      .put(Schema.Type.FLOAT, JsonToken.NUMBER)
      .put(Schema.Type.DOUBLE, JsonToken.NUMBER)
      .put(Schema.Type.STRING, JsonToken.STRING)
      .put(Schema.Type.BYTES, JsonToken.BEGIN_ARRAY)
      .put(Schema.Type.ARRAY, JsonToken.BEGIN_ARRAY)
      .put(Schema.Type.MAP, JsonToken.BEGIN_OBJECT)
      .put(Schema.Type.RECORD, JsonToken.BEGIN_OBJECT)
      .build()
  );

  /**
   * Converts a {@link StructuredRecord} to a json string.
   */
  public static String toJsonString(StructuredRecord record) throws IOException {
    StringWriter strWriter = new StringWriter();
    JsonWriter writer = new JsonWriter(strWriter);
    try {
      writeJson(writer, record.getSchema(), record);
      return strWriter.toString();
    } finally {
      writer.close();
    }
  }

  /**
   * Converts a json string to a {@link StructuredRecord} based on the schema.
   */
  public static StructuredRecord fromJsonString(String json, Schema schema) throws IOException {
    JsonReader reader = new JsonReader(new StringReader(json));
    try {
      return (StructuredRecord) readJson(reader, schema);
    } finally {
      reader.close();
    }
  }

  /**
   * Converts a {@link StructuredRecord} to a delimited string.
   */
  public static String toDelimitedString(final StructuredRecord record, String delimiter) {
    return Joiner.on(delimiter).join(
      Iterables.transform(record.getSchema().getFields(), new Function<Schema.Field, String>() {
        @Override
        public String apply(Schema.Field field) {
          return record.get(field.getName()).toString();
        }
      }));
  }

  /**
   * Converts a delimited string to a {@link StructuredRecord} based on the schema.
   */
  public static StructuredRecord fromDelimitedString(String delimitedString, String delimiter, Schema schema) {
    StructuredRecord.Builder builder = StructuredRecord.builder(schema);
    Iterator<Schema.Field> fields = schema.getFields().iterator();

    for (String part : Splitter.on(delimiter).split(delimitedString)) {
      if (!part.isEmpty()) {
        builder.convertAndSet(fields.next().getName(), part);
      }
    }

    return builder.build();
  }

  private static Object readJson(JsonReader reader, Schema schema) throws IOException {
    switch (schema.getType()) {
      case NULL:
        reader.nextNull();
        return null;
      case BOOLEAN:
        return reader.nextBoolean();
      case INT:
        return reader.nextInt();
      case LONG:
        return reader.nextLong();
      case FLOAT:
        // Force down cast
        return (float) reader.nextDouble();
      case DOUBLE:
        return reader.nextDouble();
      case BYTES:
        return readBytes(reader);
      case STRING:
        return reader.nextString();
      case ENUM:
        // Currently there is no standard container to represent enum type
        return reader.nextString();
      case ARRAY:
        return readArray(reader, schema.getComponentSchema());
      case MAP:
        return readMap(reader, schema.getMapSchema());
      case RECORD:
        return readRecord(reader, schema);
      case UNION:
        return readUnion(reader, schema);
    }

    throw new IOException("Unsupported schema: " + schema);
  }

  private static byte[] readBytes(JsonReader reader) throws IOException {
    ByteArrayOutputStream os = new ByteArrayOutputStream(128);
    reader.beginArray();
    while (reader.peek() != JsonToken.END_ARRAY) {
      os.write(reader.nextInt());
    }
    reader.endArray();
    return os.toByteArray();
  }

  private static List<Object> readArray(JsonReader reader, Schema elementSchema) throws IOException {
    List<Object> result = new ArrayList<>();
    reader.beginArray();
    while (reader.peek() != JsonToken.END_ARRAY) {
      result.add(readJson(reader, elementSchema));
    }
    reader.endArray();
    return result;
  }

  private static Map<Object, Object> readMap(JsonReader reader,
                                             Map.Entry<Schema, Schema> mapSchema) throws IOException {
    Schema keySchema = mapSchema.getKey();
    if (!keySchema.isCompatible(Schema.of(Schema.Type.STRING))) {
      throw new IOException("Complex key type not supported: " + keySchema);
    }

    Schema valueSchema = mapSchema.getValue();
    Map<Object, Object> result = new HashMap<>();

    reader.beginObject();
    while (reader.peek() != JsonToken.END_OBJECT) {
      Object key = convertKey(reader.nextName(), keySchema.getType());
      result.put(key, readJson(reader, valueSchema));
    }
    reader.endObject();

    return result;
  }

  private static Object convertKey(String key, Schema.Type type) throws IOException {
    switch (type) {
      case STRING:
        return key;
      case BOOLEAN:
        return Boolean.valueOf(key);
      case INT:
        return Integer.valueOf(key);
      case LONG:
        return Long.valueOf(key);
      case FLOAT:
        return Float.valueOf(key);
      case DOUBLE:
        return Double.valueOf(key);
    }
    throw new IOException("Unable to convert string to type " + type);
  }

  private static StructuredRecord readRecord(JsonReader reader, Schema schema) throws IOException {
    StructuredRecord.Builder builder = StructuredRecord.builder(schema);

    reader.beginObject();
    while (reader.peek() != JsonToken.END_OBJECT) {
      Schema.Field field = schema.getField(reader.nextName());
      if (field == null) {
        // Ignore unrecognized fields
        reader.skipValue();
        continue;
      }

      builder.set(field.getName(), readJson(reader, field.getSchema()));
    }
    reader.endObject();

    return builder.build();
  }

  private static Object readUnion(JsonReader reader, Schema unionSchema) throws IOException {
    JsonToken token = reader.peek();
    // Based on the token to guess the schema
    for (Schema schema : unionSchema.getUnionSchemas()) {
      if (SCHEMA_TO_JSON_TYPE.get(schema.getType()) == token) {
        return readJson(reader, schema);
      }
    }

    throw new IOException("No matching schema found for union type: " + unionSchema);
  }

  private static void writeJson(JsonWriter writer, Schema schema, Object value) throws IOException {
    switch (schema.getType()) {
      case NULL:
        writer.nullValue();
        break;
      case BOOLEAN:
        writer.value((Boolean) value);
        break;
      case INT:
      case LONG:
      case FLOAT:
      case DOUBLE:
        writer.value((Number) value);
        break;
      case BYTES:
        writeBytes(writer, value);
        break;
      case STRING:
        writer.value((String) value);
        break;
      case ENUM:
        writer.value(((Enum) value).name());
        break;
      case ARRAY:
        writeArray(writer, schema.getComponentSchema(), value);
        break;
      case MAP:
        writeMap(writer, schema.getMapSchema(), value);
        break;
      case RECORD:
        writeRecord(writer, schema, value);
        break;
      case UNION:
        writeJson(writer, findUnionSchema(schema, value), value);
        break;
    }
  }

  private static void writeBytes(JsonWriter writer, Object value) throws IOException {
    if (value instanceof ByteBuffer) {
      writeBytes(writer, (ByteBuffer) value);
    } else if (value.getClass().isArray() && value.getClass().getComponentType().equals(byte.class)) {
      byte[] bytes = (byte[]) value;
      writeBytes(writer, bytes, 0, bytes.length);
    } else {
      throw new IOException("Expects either ByteBuffer or byte[]. Got " + value.getClass());
    }
  }

  private static void writeBytes(JsonWriter writer, ByteBuffer buffer) throws IOException {
    if (buffer.hasArray()) {
      writeBytes(writer, buffer.array(), buffer.arrayOffset() + buffer.position(), buffer.remaining());
    } else {
      byte[] buf = Bytes.getBytes(buffer);
      buffer.mark();
      buffer.get(buf);
      buffer.reset();
      writeBytes(writer, buf, 0, buf.length);
    }
  }

  private static void writeBytes(JsonWriter writer, byte[] bytes, int off, int len) throws IOException {
    writer.beginArray();
    for (int i = off; i < off + len; i++) {
      writer.value(bytes[i]);
    }
    writer.endArray();
  }

  private static void writeArray(JsonWriter writer, Schema elementSchema, Object value) throws IOException {
    if (!(value instanceof Collection) && !value.getClass().isArray()) {
      throw new IOException("Expects either Collection or array. Got: " + value.getClass());
    }

    writer.beginArray();
    if (value instanceof Collection) {
      for (Object element : (Collection) value) {
        writeJson(writer, elementSchema, element);
      }
    } else {
      Object[] array = (Object[]) value;
      for (Object anArray : array) {
        writeJson(writer, elementSchema, anArray);
      }
    }
    writer.endArray();
  }

  private static void writeMap(JsonWriter writer,
                               Map.Entry<Schema, Schema> entrySchema, Object value) throws IOException {
    if (!(value instanceof Map)) {
      throw new IOException("Expects Map. Got: " + value.getClass());
    }

    Schema keySchema = entrySchema.getKey();
    if (!keySchema.isCompatible(Schema.of(Schema.Type.STRING))) {
      throw new IOException("Complex key type not supported: " + keySchema);
    }

    Schema valueSchema = entrySchema.getValue();

    writer.beginObject();
    for (Map.Entry<?, ?> entry : ((Map<?, ?>) value).entrySet()) {
      writer.name(entry.getKey().toString());
      writeJson(writer, valueSchema, entry.getValue());
    }
    writer.endObject();
  }

  private static void writeRecord(JsonWriter writer, Schema schema, Object value) throws IOException {
    if (!(value instanceof StructuredRecord)) {
      throw new IOException("Expects StructuredRecord. Got: " + value.getClass());
    }

    StructuredRecord record = (StructuredRecord) value;
    writer.beginObject();
    for (Schema.Field field : schema.getFields()) {
      Object fieldValue = record.get(field.getName());
      if (fieldValue != null) {
        writer.name(field.getName());
        writeJson(writer, field.getSchema(), fieldValue);
      }
    }
    writer.endObject();
  }

  private static Schema findUnionSchema(Schema unionSchema, @Nullable Object value) throws IOException {
    Schema.Type type = getSchemaType(value);

    for (Schema schema : unionSchema.getUnionSchemas()) {
      // Just match the type, not matching the detail schema as it'd be too expensive.
      if (schema.getType() == type) {
        return schema;
      }
    }
    throw new IOException("Value type " + type + " not valid in union: " + unionSchema);
  }

  private static Schema.Type getSchemaType(@Nullable Object value) throws IOException {
    if (value == null) {
      return Schema.Type.NULL;
    }

    Class<?> cls = value.getClass();
    Schema.Type type = TYPE_TO_SCHEMA.get(cls);
    if (type != null) {
      return type;
    }

    if (Collection.class.isAssignableFrom(cls) || cls.isArray()) {
      return Schema.Type.ARRAY;
    }

    if (Map.class.isAssignableFrom(cls)) {
      return Schema.Type.MAP;
    }

    throw new IOException("Unsupported type found in StructuredRecord: " + cls);
  }

  private StructuredRecordStringConverter() {
    //inaccessible constructor for static class
  }
}


text:
<?php

namespace Core\Router;

use Core\Instantiable;

class Route extends Instantiable
{
    private $path;
    private $callable;
    private $matches = [];
    private $params = [];

    public function __construct($path, $callable)
    {
        $this->path = trim($path, '/');  // On retire les / inutils
        $this->callable = $callable;
    }

    /**
     * Permettra de capturer l'url avec les paramètre
     * get('/posts/:slug-:id') par exemple
     **/
    public function match($url)
    {
        $url = trim($url, '/');
        $path = preg_replace_callback('#:([\w]+)#', [$this, 'paramMatch'], $this->path);
        $path = str_replace('/', '\/', $path);
        $regex = "#^$path$#i";
        if (!preg_match($regex, $url, $matches)) {
            return false;
        }
        array_shift($matches);
        $this->matches = $matches;
        return true;
    }

    private function paramMatch($match)
    {
        if (isset($this->params[$match[1]])) {
            return '(' . $this->params[$match[1]] . ')';
        }
        return '([^/]+)';
    }

    public function getUrl($params)
    {
        $path = $this->path;
        foreach ($params as $k => $v) {
            $path = str_replace(":$k", $v, $path);
        }
        return $path;
    }

    public function with($param, $regex)
    {
        $this->params[$param] = str_replace('(', '(?:', $regex);
        return $this; // On retourne tjrs l'objet pour enchainer les arguments
    }

    public function call()
    {
        if (is_string($this->callable)) {
            $params = explode('->', $this->callable);
            $controller = $params[0];
            $controller = new $controller();
            return call_user_func([$controller, $params[1]], $this->matches);
        } else {
            return call_user_func($this->callable, $this->matches);
        }
    }

}


text:
Multiples of 3 and 5
--------------------

If we list all the natural numbers below 10 that are multiples of 3 or 5, we
get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.

Even Fibonacci numbers
----------------------

Each new term in the Fibonacci sequence is generated by adding the previous two
terms. By starting with 1 and 2, the first 10 terms will be:

1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...

By considering the terms in the Fibonacci sequence whose values do not exceed
four million, find the sum of the even-valued terms.

Largest palindrome product
--------------------------

A palindromic number reads the same both ways. The largest palindrome made from
the product of two 2-digit numbers is 9009 = 91 99.

Find the largest palindrome made from the product of two 3-digit numbers.

Smallest multiple
-----------------

2520 is the smallest number that can be divided by each of the numbers from 1
to 10 without any remainder.

What is the smallest positive number that is evenly divisible by all of the
numbers from 1 to 20?

Game of Life
------------

The game of life simulates something like bacterial life. It is modeled as a
two dimentional grid. Each cell within the grid may be alive or dead. Whether a
cell is alive or dead will depend only on the state of itself and it's
neighbours in the last iteration of the game.

1. Any live cell with fewer than two live neighbours dies, as if caused by
   under-population.
2. Any live cell with two or three live neighbours lives on to the next
   generation.
3. Any live cell with more than three live neighbours dies, as if by
   overcrowding.
4. Any dead cell with exactly three live neighbours becomes a live cell, as if
   by reproduction.

To illustrate:

    |-----|           |-----|
    |     |           |  X  |
    | XXX |  BECOMES  |  X  |
    |     |           |  X  |
    |-----|           |-----|

The center cell will experience rule 2. The cells to it's right and left will
die from rule 1. But the cells above and below it will come to life with rule
4.

Implement a function that will take a sequence of coordinates of live cells and
return a sequence of coordinates of cells that will be be alive next time. For
instance our above example would be:

    (game-of-life [[1 2] [2 2] [3 2]])
      => [[2 1] [2 2] [2 3]]

For animations and further information see the [wikipedia
page](http://en.wikipedia.org/wiki/Conway's_Game_of_Life).


text:
% [daqData,headCt] = FetchLatestIm( myObj, scan_ct, channel_subset, downsample_ratio )
%
%     Get MxN matrix of the most recent stream data.
%     M = scan_ct = max samples to fetch.
%     N = channel count...
%         If channel_subset is not specified, N = current
%         SpikeGLX save-channel subset.
%
%     downsample_ratio is an integer (default = 1).
%
function [mat,headCt] = FetchLatestIm( s, scan_ct, varargin )

    if( nargin >= 3 )
        subset = varargin{1};
    else
        subset = GetSaveChansIm( s );
    end

    dwnsmp = 1;

    if( nargin >= 4 )

        dwnsmp = varargin{2};

        if ( ~isnumeric( dwnsmp ) || length( dwnsmp ) > 1 )
            error( 'Downsample factor must be a single numeric value' );
        end
    end

    max_ct = GetScanCountIm( s );

    if( scan_ct > max_ct )
        scan_ct = max_ct;
    end

    [mat,headCt] = FetchIm( s, max_ct-scan_ct, scan_ct, subset, dwnsmp );
end


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Ejercicio1b;

/**
 *
 * @author joseangel
 */
public class Persona {
    Cola q;
    boolean barrera;

    Persona(Cola q)
    {
        this.q=q;
    }

}