text:
package com.cocina.ordenes.estructuras;

import java.util.ArrayList;
import java.util.Arrays;

import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
import org.json.JSONArray;
import org.json.JSONObject;

import com.google.gson.Gson;

import android.os.StrictMode;
import android.util.Log;

public class ListadeOrdenes {

	public ListadeOrdenes(){
		//LlenadoListaOrden();
		CreaListaOrdenes();
		if(!ListaconOrdenes.isEmpty()){
		CreaListadePlatillos(ListaconOrdenes.get(0).getmKeyValue());
		}
	}

	public ArrayList<Orden> ListaconOrdenes= new ArrayList<Orden>();
	public ArrayList<DetalleOrden> ListaconPlatillos= new ArrayList<DetalleOrden>();

	/**********************ListaconOrdenes*******************************************************/

HttpClient httpClient = new DefaultHttpClient();
	HttpGet _getOrden,_getMesa;
	Orden ElementoOrden=new Orden();;
	JSONObject respOrden_JSON;
	JSONArray resp_arrayOrden_JSON;

	public void CreaListaOrdenes(){

		ListaconOrdenes= new ArrayList<Orden>();
		StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
	    StrictMode.setThreadPolicy(policy);
		//_getOrden = new HttpGet("http://infra-oath-557.appspot.com/?EXECOP=SOD&MOD=GO");
	    _getOrden = new HttpGet("http://infra-oath-557.appspot.com/?EXECOP=SOD&MOD=GO");
	    _getOrden.setHeader("content-type", "application/json");

	    try
		{
		    HttpResponse resp = httpClient.execute(_getOrden);
		    String respStr = EntityUtils.toString(resp.getEntity());
		    Log.v("ServicioRestOrden",respStr);

		    respOrden_JSON = new JSONObject(respStr);
		    resp_arrayOrden_JSON = respOrden_JSON.getJSONArray("RETURNVALUE");

	       /* ElementoOrden = new Gson().fromJson(resp_arrayOrden_JSON.getString(1), Orden.class);
	        Log.v("Menú cargado",ElementoOrden.getmKeyValue());
	        ListaconOrdenes.add(ElementoOrden);*/

		    int lenth_array=resp_arrayOrden_JSON.length();
	        for(int i=0;i<lenth_array;i++){
	        	Orden ElementoOrden = new Gson().fromJson(resp_arrayOrden_JSON.getString(i), Orden.class);

	        	_getMesa = new HttpGet("http://infra-oath-557.appspot.com/?EXECOP=SEL&MOD=GT&GTKEY="+ElementoOrden.getmKeyMesa());
	        	_getMesa.setHeader("content-type", "application/json");

			        HttpResponse resp2 = httpClient.execute(_getMesa);
			        String respStr2 = EntityUtils.toString(resp2.getEntity());
			        Log.v("ServicioRestMesa",respStr2);
			        JSONObject respMesa_JSON = new JSONObject(respStr2);
			        JSONArray resp_arrayMesa_JSON = respMesa_JSON.getJSONArray("RETURNVALUE");
			        Mesa temp = new Gson().fromJson(resp_arrayMesa_JSON.getString(0), Mesa.class);
	        	ElementoOrden.setmNumeroMesa(temp.getmNumeroMesa());

		        Log.v("Menú cargado",ElementoOrden.getmKeyValue());
		        ListaconOrdenes.add(ElementoOrden);
		        //CreaListadePlatillos(ElementoOrden.getmKeyValue());
	        }
		}
	    catch(Exception ex)
		{
		        Log.e("ServicioRest","Error!", ex);
		}
	}

	@SuppressWarnings("unchecked")
	public ArrayList<Orden> getListaconOrdenes() {
		return (ArrayList<Orden>) ListaconOrdenes.clone();
	}

	public void removeListaconOrdenes(String pos_element) {
		int position=Integer.parseInt(pos_element);
		if(!ListaconOrdenes.isEmpty()){
		ListaconOrdenes.remove(position);
		}
	}
	/**********************ListaconPlatillos*******************************************************/

	@SuppressWarnings("unchecked")
	public ArrayList<DetalleOrden> getListaconPlatillos() {
		return (ArrayList<DetalleOrden>) ListaconPlatillos.clone();
	}

	public void removeListaconPlatillos(String pos_element) {
		int position=Integer.parseInt(pos_element);
		if(!ListaconPlatillos.isEmpty()){
		ListaconPlatillos.remove(position);
		}
	}

	//Convertir el arrreglo a Arraylist, eliminar la orden y volver a convertirlo en arreglo
	/*public void eliminarOrdenLista(int position){

		int contOrdenes=datos.length-1;
		Orden[] ListTemp = new Orden[contOrdenes];
		int posicion=position-1;// resto la posicion por el algoritmo inicia de 0 a n-1

		 if(0!=contOrdenes){ //si el codigo a eliminar es menor o igual al contador de estudiantes

             for(int i=0; i<=contOrdenes; i++){ //Inicio ciclo para realizar la eliminacion
                 if(i ==posicion){ //si el codigo a aliminar coincide con el codigo que hay en la posicion i
                     continue; //continua con el ciclo
                 }
                 else{
                     if(i < posicion)
                    	 ListTemp[i] = datos[i];//si esl codigo es menor se almacena tal cual
                     if(i > posicion){
                         //si el codigo es mayor se le resta para que quede en consecutivo
                    	 ListTemp[i-1] = datos[i]; //se almacena con el nuevo codigo
                     }
                 }
             } //Fin ciclo para realizar la eliminacion
             datos=null; //se hacen las modificaciones para los nuevos valores
             datos = new Orden[ListTemp.length]; //se vuelve a crear el arreglo
             for(int i=0; i<=(ListTemp.length-1); i++){ //se almacenan los valores no eliminados
                 datos[i]=ListTemp[i];
             }
         }
	}*/

	HttpGet _getListaPlatillos,_getPlatillos;
	Orden ElementoDetalleOrden=new Orden();;
	JSONObject respDetalleOrden_JSON;
	JSONArray resp_arrayDetalleOrden_JSON;

	public void CreaListadePlatillos(String Posicion_mKeyValue){

		ListaconPlatillos= new ArrayList<DetalleOrden>();
		StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
	    StrictMode.setThreadPolicy(policy);

	    _getListaPlatillos = new HttpGet("http://infra-oath-557.appspot.com/?EXECOP=SPL&MOD=GO&GOKEY="+Posicion_mKeyValue);
	    _getListaPlatillos.setHeader("content-type", "application/json");

	    try
		{
		    HttpResponse resp = httpClient.execute(_getListaPlatillos);
		    String respStr = EntityUtils.toString(resp.getEntity());
		    Log.v("ServicioRestListaPlatillos",respStr);

		    respDetalleOrden_JSON = new JSONObject(respStr);
		    resp_arrayDetalleOrden_JSON = respDetalleOrden_JSON.getJSONArray("RETURNVALUE");

		    int lenth_array=resp_arrayDetalleOrden_JSON.length();
	        for(int i=0;i<lenth_array;i++){
	        	DetalleOrden ElementoDetalleOrden = new Gson().fromJson(resp_arrayDetalleOrden_JSON.getString(i), DetalleOrden.class);

	        	_getPlatillos = new HttpGet("http://modern-door-542.appspot.com/?EXECOP=SEL&MOD=GP&GPKEY="+ElementoDetalleOrden.getmKeyPlatillo());
	        	_getPlatillos.setHeader("content-type", "application/json");

			        HttpResponse resp2 = httpClient.execute(_getPlatillos);
			        String respStr2 = EntityUtils.toString(resp2.getEntity());
			        Log.v("ServicioRestMesa",respStr2);
			        JSONObject respMesa_JSON = new JSONObject(respStr2);
			        JSONArray resp_arrayMesa_JSON = respMesa_JSON.getJSONArray("RETURNVALUE");
			        Platillo temp = new Gson().fromJson(resp_arrayMesa_JSON.getString(0), Platillo.class);
	        	ElementoDetalleOrden.setmNombrePlatillo(temp.getmNombrePlatillo());

		        Log.v("Platillo cargado",ElementoDetalleOrden.getmKeyOrden());
		        ListaconPlatillos.add(ElementoDetalleOrden);

	        }
		}
	    catch(Exception ex)
		{
		        Log.e("ServicioRest","Error!", ex);
		}
	}

}


text:
package org.hl7.v3;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlID;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name="POCD_MT000040.RegionOfInterest", propOrder={"realmCode", "typeId", "templateId", "id", "code", "value", "subject", "specimen", "performer", "author", "informant", "participant", "entryRelationship", "reference", "precondition"})
public class POCDMT000040RegionOfInterest
{
  protected List<CS> realmCode;
  protected POCDMT000040InfrastructureRootTypeId typeId;
  protected List<II> templateId;

  @XmlElement(required=true)
  protected List<II> id;

  @XmlElement(required=true)
  protected CS code;

  @XmlElement(required=true)
  protected List<POCDMT000040RegionOfInterestValue> value;
  protected POCDMT000040Subject subject;
  protected List<POCDMT000040Specimen> specimen;
  protected List<POCDMT000040Performer2> performer;
  protected List<POCDMT000040Author> author;
  protected List<POCDMT000040Informant12> informant;
  protected List<POCDMT000040Participant2> participant;
  protected List<POCDMT000040EntryRelationship> entryRelationship;
  protected List<POCDMT000040Reference> reference;
  protected List<POCDMT000040Precondition> precondition;

  @XmlAttribute(name="ID1")
  @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
  @XmlID
  @XmlSchemaType(name="ID")
  protected String id1;

  @XmlAttribute(name="nullFlavor")
  protected List<String> nullFlavor;

  @XmlAttribute(name="classCode", required=true)
  protected List<String> classCode;

  @XmlAttribute(name="moodCode", required=true)
  protected List<String> moodCode;

  public List<CS> getRealmCode()
  {
    if (this.realmCode == null) {
      this.realmCode = new ArrayList();
    }
    return this.realmCode;
  }

  public POCDMT000040InfrastructureRootTypeId getTypeId()
  {
    return this.typeId;
  }

  public void setTypeId(POCDMT000040InfrastructureRootTypeId value)
  {
    this.typeId = value;
  }

  public List<II> getTemplateId()
  {
    if (this.templateId == null) {
      this.templateId = new ArrayList();
    }
    return this.templateId;
  }

  public List<II> getId()
  {
    if (this.id == null) {
      this.id = new ArrayList();
    }
    return this.id;
  }

  public CS getCode()
  {
    return this.code;
  }

  public void setCode(CS value)
  {
    this.code = value;
  }

  public List<POCDMT000040RegionOfInterestValue> getValue()
  {
    if (this.value == null) {
      this.value = new ArrayList();
    }
    return this.value;
  }

  public POCDMT000040Subject getSubject()
  {
    return this.subject;
  }

  public void setSubject(POCDMT000040Subject value)
  {
    this.subject = value;
  }

  public List<POCDMT000040Specimen> getSpecimen()
  {
    if (this.specimen == null) {
      this.specimen = new ArrayList();
    }
    return this.specimen;
  }

  public List<POCDMT000040Performer2> getPerformer()
  {
    if (this.performer == null) {
      this.performer = new ArrayList();
    }
    return this.performer;
  }

  public List<POCDMT000040Author> getAuthor()
  {
    if (this.author == null) {
      this.author = new ArrayList();
    }
    return this.author;
  }

  public List<POCDMT000040Informant12> getInformant()
  {
    if (this.informant == null) {
      this.informant = new ArrayList();
    }
    return this.informant;
  }

  public List<POCDMT000040Participant2> getParticipant()
  {
    if (this.participant == null) {
      this.participant = new ArrayList();
    }
    return this.participant;
  }

  public List<POCDMT000040EntryRelationship> getEntryRelationship()
  {
    if (this.entryRelationship == null) {
      this.entryRelationship = new ArrayList();
    }
    return this.entryRelationship;
  }

  public List<POCDMT000040Reference> getReference()
  {
    if (this.reference == null) {
      this.reference = new ArrayList();
    }
    return this.reference;
  }

  public List<POCDMT000040Precondition> getPrecondition()
  {
    if (this.precondition == null) {
      this.precondition = new ArrayList();
    }
    return this.precondition;
  }

  public String getID1()
  {
    return this.id1;
  }

  public void setID1(String value)
  {
    this.id1 = value;
  }

  public List<String> getNullFlavor()
  {
    if (this.nullFlavor == null) {
      this.nullFlavor = new ArrayList();
    }
    return this.nullFlavor;
  }

  public List<String> getClassCode()
  {
    if (this.classCode == null) {
      this.classCode = new ArrayList();
    }
    return this.classCode;
  }

  public List<String> getMoodCode()
  {
    if (this.moodCode == null) {
      this.moodCode = new ArrayList();
    }
    return this.moodCode;
  }
}

redpajama_set_name: RedPajamaGithub


text:
class RemoveParentNamefromstudents < ActiveRecord::Migration
  def up
    remove_column :students, :Parent_Name
  end

  def down
    add_column :students, :Parent_Name, :string
  end
end


text:
package com.facebook.buck.io;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;

import com.google.common.base.Charsets;
import com.google.common.collect.ImmutableList;
import com.google.common.io.Files;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import java.io.File;
import java.io.IOException;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.nio.file.attribute.FileTime;
import java.nio.file.attribute.PosixFilePermissions;
import java.util.Arrays;
import java.util.List;

public class MoreFilesTest {

  @Rule
  public TemporaryFolder tmp = new TemporaryFolder();

  @Test
  public void testDeleteRecursively() throws IOException {
    tmp.newFile(".dotfile");
    tmp.newFile("somefile");
    tmp.newFolder("foo");
    tmp.newFile("foo/bar");
    tmp.newFolder("foo/baz");
    tmp.newFile("foo/baz/biz");
    assertEquals("There should be files to delete.", 3, tmp.getRoot().listFiles().length);
    MoreFiles.deleteRecursively(tmp.getRoot().toPath());
    assertNull(tmp.getRoot().listFiles());
  }

  @Test
  public void testWriteLinesToFile() throws IOException {
    File outputFile = tmp.newFile("output.txt");
    ImmutableList<String> lines = ImmutableList.of(
        "The",
        "quick brown fox",
        "jumps over",
        "the lazy dog.");
    MoreFiles.writeLinesToFile(lines, outputFile);

    List<String> observedLines = Files.readLines(outputFile, Charsets.UTF_8);
    assertEquals(lines, observedLines);
  }

  @Test
  public void testSortFilesByAccessTime() throws IOException {
    File dir = tmp.newFolder();
    File fileW = new File(dir, "w");
    File fileX = new File(dir, "x");
    File fileY = new File(dir, "y");
    File fileZ = new File(dir, "z");

    Files.write("w", fileW, Charsets.UTF_8);
    Files.write("x", fileX, Charsets.UTF_8);
    Files.write("y", fileY, Charsets.UTF_8);
    Files.write("z", fileZ, Charsets.UTF_8);

    java.nio.file.Files.setAttribute(fileW.toPath(), "lastAccessTime", FileTime.fromMillis(9000));
    java.nio.file.Files.setAttribute(fileX.toPath(), "lastAccessTime", FileTime.fromMillis(0));
    java.nio.file.Files.setAttribute(fileY.toPath(), "lastAccessTime", FileTime.fromMillis(1000));
    java.nio.file.Files.setAttribute(fileZ.toPath(), "lastAccessTime", FileTime.fromMillis(2000));

    File[] files = dir.listFiles();
    MoreFiles.sortFilesByAccessTime(files);
    assertEquals(
        "Files short be sorted from most recently accessed to least recently accessed.",
        ImmutableList.of(fileW, fileZ, fileY, fileX),
        Arrays.asList(files));
  }

  @Test
  public void testMakeExecutable() throws IOException {
    File file = tmp.newFile();

    // If the file system does not support the executable permission, skip the test
    assumeTrue(file.setExecutable(false));
    assertFalse("File should not be executable", file.canExecute());
    MoreFiles.makeExecutable(file);
    assertTrue("File should be executable", file.canExecute());

    assumeTrue(file.setExecutable(true));
    assertTrue("File should be executable", file.canExecute());
    MoreFiles.makeExecutable(file);
    assertTrue("File should be executable", file.canExecute());
  }

  @Test
  public void testMakeExecutableOnPosix() throws IOException {
    assumeTrue(FileSystems.getDefault().supportedFileAttributeViews().contains("posix"));

    File file = tmp.newFile();
    Path path = file.toPath();

    java.nio.file.Files.setPosixFilePermissions(path, PosixFilePermissions.fromString("r--------"));
    MoreFiles.makeExecutable(file);
    assertEquals(
        "Owner's execute permission should have been set",
        "r-x------",
        PosixFilePermissions.toString(java.nio.file.Files.getPosixFilePermissions(path)));

    java.nio.file.Files.setPosixFilePermissions(path, PosixFilePermissions.fromString("---r-----"));
    MoreFiles.makeExecutable(file);
    assertEquals(
        "Group's execute permission should have been set",
        "---r-x---",
        PosixFilePermissions.toString(java.nio.file.Files.getPosixFilePermissions(path)));

    java.nio.file.Files.setPosixFilePermissions(path, PosixFilePermissions.fromString("------r--"));
    MoreFiles.makeExecutable(file);
    assertEquals(
        "Others' execute permission should have been set",
        "------r-x",
        PosixFilePermissions.toString(java.nio.file.Files.getPosixFilePermissions(path)));

    java.nio.file.Files.setPosixFilePermissions(path, PosixFilePermissions.fromString("r--r--r--"));
    MoreFiles.makeExecutable(file);
    assertEquals(
        "All execute permissions should have been set",
        "r-xr-xr-x",
        PosixFilePermissions.toString(java.nio.file.Files.getPosixFilePermissions(path)));

    java.nio.file.Files.setPosixFilePermissions(path, PosixFilePermissions.fromString("r-xrw-rwx"));
    MoreFiles.makeExecutable(file);
    assertEquals(
        "Only group's execute permission should have been set",
        "r-xrwxrwx",
        PosixFilePermissions.toString(java.nio.file.Files.getPosixFilePermissions(path)));

    java.nio.file.Files.setPosixFilePermissions(path, PosixFilePermissions.fromString("-w---x-wx"));
    MoreFiles.makeExecutable(file);
    assertEquals(
        "No permissions should have been changed",
        "-w---x-wx",
        PosixFilePermissions.toString(java.nio.file.Files.getPosixFilePermissions(path)));

    java.nio.file.Files.setPosixFilePermissions(path, PosixFilePermissions.fromString("---------"));
    MoreFiles.makeExecutable(file);
    assertEquals(
        "No permissions should have been changed",
        "---------",
        PosixFilePermissions.toString(java.nio.file.Files.getPosixFilePermissions(path)));

    java.nio.file.Files.setPosixFilePermissions(path, PosixFilePermissions.fromString("rwxrwxrwx"));
    MoreFiles.makeExecutable(file);
    assertEquals(
        "No permissions should have been changed",
        "rwxrwxrwx",
        PosixFilePermissions.toString(java.nio.file.Files.getPosixFilePermissions(path)));
  }
}


text:
<?php
namespace Chamilo\Application\Weblcms\Tool\Implementation\StreamingVideo\Component;

use Chamilo\Application\Weblcms\Tool\Implementation\StreamingVideo\Manager;

class ToggleVisibilityComponent extends Manager
{
}


text:
<?php

namespace CHMS\Common\Auth;

use Auth;

class PasswordGrantVerifier
{
  public function verify($username, $password)
  {
      $credentials = [
        'email'    => $username,
        'password' => $password,
      ];

      if (Auth::once($credentials)) {
          return Auth::user()->id;
      }

      return false;
  }
}


text:
namespace Percolator.AnalysisServices.Linq
{
    using System;
    using System.Linq;
    using System.Linq.Expressions;
    using System.Reflection;
    using System.Text;

    using Percolator.AnalysisServices;
    using Percolator.AnalysisServices.Attributes;

    /// <summary>
    /// The order type for the MDX 'Order' function.
    /// </summary>
    public enum OrderType
    {
        /// <summary>
        /// Orders in ascending order.
        /// </summary>
        ASC,

        /// <summary>
        /// Orders in descending order.
        /// </summary>
        DESC,

        /// <summary>
        /// Orders in ascending order, breaking the hierarchy.
        /// </summary>
        BASC,

        /// <summary>
        /// Orders in descending order, breaking the hierarchy.
        /// </summary>
        BDESC
    }

    /// <summary>
    /// The count type for the MDX 'Count' function.
    /// </summary>
    public enum CountType
    {
        /// <summary>
        /// Excludes empty cells.
        /// </summary>
        ExcludeEmpty,

        /// <summary>
        /// Includes empty cells. This is the default selection.
        /// </summary>
        IncludeEmpty
    }

    /// <summary>
    /// The HINT type for the MDX 'Filter' function.
    /// </summary>
    public enum HINT
    {
        /// <summary>
        /// Eager
        /// </summary>
        Eager,

        /// <summary>
        /// Strict
        /// </summary>
        Strict,

        /// <summary>
        /// Lazy
        /// </summary>
        Lazy,

        /// <summary>
        /// No HINT. Does not apply a HINT to the returned filter expression.
        /// </summary>
        None
    }

    /// <summary>
    /// Static class that holds the MDX functions to be used in MDX queries and object builders.
    /// </summary>
    public static class Mdx
    {
        private static StringBuilder sb = new StringBuilder();

        /// <summary>
        /// A default method for assembling a MDX function to be used in a MDX query.
        /// </summary>
        /// <typeparam name="T">The type to be returned.  Must be either a Set or Member</typeparam>
        /// <param name="funcName"></param>
        /// <param name="paramz"></param>
        /// <returns></returns>
        public static T MdxFunction<T>(string funcName, params object[] paramz) where T : ICubeObject
        {
            var funcBuilder = new StringBuilder($"{funcName}(");

            paramz
                .Select(x => x.ToString())
                .Aggregate((a, b) => $"{a}, {b}")
                .To(funcBuilder.Append);

            funcBuilder.AppendLine(")");

            var type = typeof(T);
            if(type == typeof(Set) || type == typeof(Member))
                return (T)Activator.CreateInstance(typeof(T), funcBuilder.ToString());
            else
                throw new PercolatorException("The generic type must be a Set or a Member");
        }

        #region Ordering and Pickers
        /// <summary>
        /// MDX 'NonEmpty' function. Returns the set of tuples that are not empty from a specified set, based on the cross product of the specified set with a second set.
        /// </summary>
        /// <param name="set1">A valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <param name="set2">A valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <returns></returns>
        public static Set NonEmpty(ICubeObject set1, ICubeObject set2)
        {
            if (set2 == null)
                return new Set($"NonEmpty({set1})");
            return new Set($"NonEmpty({set1}, {set2})");
        }

        /// <summary>
        /// MDX 'Head' function. Returns the first specified number of elements in a set, while retaining duplicates.
        /// </summary>
        /// <param name="set">A valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <param name="count">A valid numeric expression that specifies the number of tuples to be returned.</param>
        /// <returns></returns>
        public static Set Head(Set set, int count) => new Set($"Head({set}, {count})");

        /// <summary>
        /// MDX 'Tail' function. Returns a subset from the end of a set
        /// </summary>
        /// <param name="set">A valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <param name="count">A valid numeric expression that specifies the number of tuples to be returned.</param>
        /// <returns></returns>
        public static Set Tail(Set set, int count) => new Set($"Tail({set}, {count})");

        /// <summary>
        /// MDX 'TopCount' function. Sorts a set in descending order and returns the specified number of elements with the highest values.
        /// </summary>
        /// <param name="set">A valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <param name="count">A valid numeric expression that specifies the number of tuples to be returned.</param>
        /// <param name="numericExpression">A valid numeric expression that is typically a Multidimensional Expressions (MDX) expression of cell coordinates that return a number.</param>
        /// <returns></returns>
        public static Set TopCount(Set set, int count, object numericExpression)
        {
            if (numericExpression == null)
                return new Set($"TopCount({set}, {count})");

            return new Set($"TopCount({set}, {count}, {numericExpression})");
        }

        /// <summary>
        /// MDX 'BottomCount' function. Sorts a set in ascending order, and returns the specified number of tuples in the specified set with the lowest values.
        /// </summary>
        /// <param name="set">A valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <param name="count">A valid numeric expression that specifies the number of tuples to be returned.</param>
        /// <param name="numericExpression">A valid numeric expression that is typically a Multidimensional Expressions (MDX) expression of cell coordinates that return a number.</param>
        /// <returns></returns>
        public static Set BottomCount(Set set, int count, object numericExpression)
        {
            if (numericExpression == null)
                return new Set($"BottomCount({set}, {count})");

            return new Set($"BottomCount({set}, {count}, {numericExpression})");
        }

        /// <summary>
        /// MDX 'Order' function. Arranges members of a specified set, optionally preserving or breaking the hierarchy.
        /// </summary>
        /// <param name="set">A valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <param name="numericExpression">A valid numeric expression that is typically a Multidimensional Expressions (MDX) expression of cell coordinates that return a number.</param>
        /// <param name="orderType">A valid string expression that is typically a valid Multidimensional Expressions (MDX) expression of cell coordinates that return a number expressed as a string.</param>
        /// <returns></returns>
        public static Set Order(Set set, object numericExpression, OrderType orderType) =>
            new Set($"Order({set}, {numericExpression}, {orderType})");

        /// <summary>
        /// MDX 'Filter' function. Returns the set that results from filtering a specified set based on a search condition.
        /// </summary>
        /// <param name="set">A valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <param name="logicalExpression">A valid Multidimensional Expressions (MDX) logical expression that evaluates to true or false.</param>
        /// <returns></returns>
        public static Set Filter(Set set, Expression<Func<bool>> logicalExpression)
        {
            visit(logicalExpression.Body);
            string str = sb.ToString();
            sb.Clear();
            return new Set($"Filter({set}, {str})");
        }

        /// <summary>
        /// MDX 'Except' function. Evaluates two sets and removes those tuples in the first set that also exist in the second set, optionally retaining duplicates.
        /// </summary>
        /// <param name="set1">A valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <param name="set2">A valid Multidimensional Expressions (MDX) expression that returns a set.></param>
        /// <param name="retainAll">A boolean indicating whether to retain ALL or not.</param>
        /// <returns></returns>
        public static Set Except(Set set1, Set set2, bool retainAll = false)
        {
            if (retainAll)
                return new Set($"Except({set1}, {set2}, ALL)");

            return new Set($"Except({set1}, {set2})");
        }

        /// <summary>
        /// MDX 'Exists' function. Returns the set of tuples of the first set specified that exist with one or more tuples of the second set specified.
        /// </summary>
        /// <param name="set1">A valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <param name="set2">A valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <param name="measureGroupName">A valid string expression specifying a measure group name.</param>
        /// <returns>Set</returns>
        public static Set Exists(Set set1, Set set2, string measureGroupName = null)
        {
            if (string.IsNullOrEmpty(measureGroupName))
                return new Set($"Exists({set1}, {set2})");

            return new Set($"Exists({set1}, {set2}, \"{measureGroupName}\")");
        }

        /// <summary>
        /// Returns a set of tuples from extracted hierarchy elements.
        /// </summary>
        /// <param name="set">A valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <param name="hierarchies">An array of valid Multidimensional Expressions (MDX) expression that returns a hierarchy.</param>
        /// <returns>Set</returns>
        public static Set Extract(Set set, params Set[] hierarchies)
        {
            var sb = new StringBuilder($"Extract({set}");

            foreach (var hier in hierarchies)
                sb.Append($", {hier}");
            sb.Append(")");
            return sb.ToString();
        }

        /// <summary>
        /// Returns the intersection of two input sets, optionally retaining duplicates.
        /// </summary>
        /// <param name="set1">A valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <param name="set2">A valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <param name="retainAll">Boolean indicating whether to retain duplicates.</param>
        /// <returns>Set</returns>
        public static Set Intersect(Set set1, Set set2, bool retainAll = false)
        {
            var retainer = retainAll ? ", ALL" : "";
            return new Set($"Intersect({set1}, {set2}{retainer})");
        }

        #endregion

        #region Dates
        /// <summary>
        /// MDX 'PeriodsToDate' function. Returns a set of sibling members from the same level as a given member,
        /// starting with the first sibling and ending with the given member, as constrained by a specified level in the Time dimension.
        /// </summary>
        /// <param name="level">A valid Multidimensional Expressions (MDX) expression that returns a level.</param>
        /// <param name="memberExpression">A valid Multidimensional Expressions (MDX) expression that returns a member.</param>
        /// <returns></returns>
        public static Set PeriodsToDate(Level level, Member memberExpression) =>
            new Set($"PeriodsToDate({level}, {memberExpression} )");

        /// <summary>
        /// MDX 'ParallelPeriod' function. Returns a member from a prior period in the same relative position as a specified member.
        /// </summary>
        /// <param name="level">A valid Multidimensional Expressions (MDX) expression that returns a level.</param>
        /// <param name="index">A valid numeric expression that specifies the number of parallel periods to lag.</param>
        /// <param name="memberExpression">A valid Multidimensional Expressions (MDX) expression that returns a member.</param>
        /// <returns></returns>
        public static Member ParallelPeriod(Level level, int? index, Member memberExpression) =>
            new Member($"ParallelPeriod({level}, {index}, {memberExpression})");
        #endregion

        #region Aggregations
        /// <summary>
        /// MDX 'Aggregate' function. Returns a number that is calculated by aggregating over the cells returned by the set expression.
        /// If a numeric expression is not provided, this function aggregates each measure within the current query context by using the
        /// default aggregation operator that is specified for each measure. If a numeric expression is provided, this function first evaluates,
        /// and then sums, the numeric expression for each cell in the specified set.
        /// </summary>
        /// <param name="set">A valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <param name="numericExpression">A valid numeric expression that is typically a Multidimensional Expressions (MDX) expression of cell coordinates that return a number.</param>
        /// <returns></returns>
        public static Member Aggregate(Set set, Member numericExpression)
        {
            if (numericExpression == null)
                return new Member($"Aggregate({set})");

            return new Member($"Aggregate({set}, {numericExpression})");
        }

        /// <summary>
        /// MDX 'Avg' function. Evaluates a set and returns the average of the non empty values of the cells in the set, averaged over the measures in the set or over a specified measure.
        /// </summary>
        /// <param name="set">A valid Multidimensional Expressions (MDX) expression that returns a set</param>
        /// <param name="numericExpression">A valid numeric expression that is typically a Multidimensional Expressions (MDX) expression of cell coordinates that return a number.</param>
        /// <returns></returns>
        public static Member Average(Set set, Member numericExpression)
        {
            if (numericExpression == null)
                return new Member($"Avg({set})");

            return new Member($"Avg({set}, {numericExpression})");
        }

        /// <summary>
        /// MDX 'Sum' function. Returns the sum of a numeric expression evaluated over a specified set.
        /// </summary>
        /// <param name="set">A valid Multidimensional Expressions (MDX) set expression.</param>
        /// <param name="numericExpression">A valid numeric expression that is typically a Multidimensional Expressions (MDX) expression of cell coordinates that return a number.</param>
        /// <returns></returns>
        public static Member Sum(Set set, Member numericExpression)
        {
            if (numericExpression == null)
                return new Member(string.Format("Sum({0})", "{" + set + "}"));
            return new Member($"Sum({set}, {numericExpression})");
        }

        public static Member Sum(Member member) => new Member(string.Format("Sum({0})", "{" + member + "}"));

        /// <summary>
        /// MDX 'Count' function. Returns the number of cells in a set.
        /// </summary>
        /// <param name="set">A valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <param name="countType">Indicator to include or exclude empty cells.</param>
        /// <returns></returns>
        public static Member Count(Set set, CountType countType) =>
            new Member($"Count({set}, {countType.ToString().ToUpper()})");

        /// <summary>
        /// MDX 'Max' function. Returns the maximum value of a numeric expression that is evaluated over a set.
        /// </summary>
        /// <param name="set">A valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <param name="numericExpression">A valid numeric expression that is typically a Multidimensional Expressions (MDX) expression of cell coordinates that return a number.</param>
        /// <returns></returns>
        public static Member Max(Set set, Member numericExpression)
        {
            if (numericExpression == null)
                return new Member($"Max({set})");

            return new Member($"Max({set}, {numericExpression})");
        }

        /// <summary>
        /// MDX 'Min' function. Returns the minimum value of a numeric expression that is evaluated over a set.
        /// </summary>
        /// <param name="set">A valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <param name="numericExpression">A valid numeric expression that is typically a Multidimensional Expressions (MDX) expression of cell coordinates that return a number.</param>
        /// <returns></returns>
        public static Member Min(Set set, Member numericExpression)
        {
            if (numericExpression == null)
                return new Member($"Min({set})");

            return new Member($"Min({set}, {numericExpression})");
        }

        /// <summary>
        /// MDX 'DistinctCount' function. Returns the number of distinct, nonempty tuples in a set.
        /// </summary>
        /// <param name="set">A valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <returns></returns>
        public static Member DistinctCount(Set set) => new Member($"DistinctCount({set})");
        #endregion

        #region Program Flow
        /// <summary>
        /// MDX 'IIf' function. Evaluates different branch expressions depending on whether a Boolean condition is true or false.
        /// </summary>
        /// <param name="logicalExpression">A condition that evaluates to true (1) or false (0). It must be a valid Multidimensional Expressions (MDX) logical expression.</param>
        /// <param name="expression1">Used when the logical expression evaluates to true. Expression1 must be a valid Multidimensional Expressions (MDX) expression.</param>
        /// <param name="expression2">Used when the logical expression evaluates to false. Expression2 must be valid Multidimensional Expressions (MDX) expression.</param>
        /// <param name="hint1">The HINT type associated with the first expression.</param>
        /// <param name="hint2">The HINT type associated with the second expression.</param>
        /// <returns></returns>
        public static Member IIf(Expression<Func<bool>> logicalExpression, object expression1, object expression2, HINT hint1, HINT hint2)
        {
            visit(logicalExpression.Body);
            var logical = sb.ToString();
            sb.Clear();
            var tru = hint1 != HINT.None ? $"{expression1} HINT {hint1}" : expression1.ToString();
            var fls = hint2 != HINT.None ? $"{expression2} HINT {hint2}" : expression2.ToString();
            if (expression1 is string && expression2 is string)
                return new Member($"IIf( {logical}, \"{tru}\", \"{fls}\" )");
            else if (expression1 is string)
                return new Member($"IIf( {logical}, \"{tru}\", {fls} )");
            else if (expression2 is string)
                return new Member($"IIf( {logical}, {tru}, \"{fls}\" )");
            else
                return new Member($"IIf( {logical}, {tru}, {fls} )");
        }
        #endregion

        #region Joins and Non Empty Stuff
        /// <summary>
        /// MDX 'CrossJoin' function. Returns the cross product of one or more sets.
        /// </summary>
        /// <param name="joinedSets">Any other valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <returns></returns>
        public static Set CrossJoin(params ICubeObject[] joinedSets)
        {
            var sb = new StringBuilder().AppendLine($"CrossJoin({joinedSets.First()}");
            foreach(var s in joinedSets.Skip(1))
                sb.AppendLine($"\t, {s}");
            sb.Append(")");
            return new Set(sb.ToString());
        }

        /// <summary>
        /// MDX 'NonEmptyCrossJoin' function. Returns a set that contains the cross product of one or more sets, excluding empty tuples and tuples without associated fact table data.
        /// </summary>
        /// <param name="set">A valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <param name="joinedSets">Any other valid Multidimensional Expressions (MDX) expression that returns a set.</param>
        /// <returns></returns>
        public static Set NonEmptyCrossJoin(Set set, params ICubeObject[] joinedSets)
        {
            var sb = new StringBuilder().AppendLine($"NonEmptyCrossJoin({set}");
            foreach (Set s in joinedSets)
                sb.AppendLine($"\t, {s}");
            sb.Append(")");
            return new Set(sb.ToString());
        }

        /// <summary>
        /// MDX 'IsEmpty' function. Returns whether the evaluated expression is the empty cell value.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static bool IsEmpty(ICubeObject obj) => new Member($"IsEmpty({obj})");

        /// <summary>
        /// MDX 'Generate' function. Applies a set to each member of another set, and then joins the resulting sets by union. Alternatively, this function returns
        /// a concatenated string created by evaluating a string expression over a set.
        /// </summary>
        /// <param name="set1"></param>
        /// <param name="set2"></param>
        /// <param name="all"></param>
        /// <returns></returns>
        public static Set Generate(Set set1, Set set2, bool all = false)
        {
            if (all)
                return new Set($"Generate({set1}, {set2})");
            else
                return new Set($"Generate({set1}, {set2}, ALL)");

        }

        /// <summary>
        /// MDX 'CoalesceEmpty' function. Converts an empty cell value to a specified nonempty cell value, which can be either a number or string.
        /// </summary>
        /// <param name="numericExpression">A valid numeric expression that is typically a Multidimensional Expressions (MDX) expression of cell coordinates that return a number.</param>
        /// <param name="replacement">The value to return if the numeric expression is null.</param>
        /// <returns></returns>
        public static Member CoalesceEmpty(Member numericExpression, object replacement) =>
            new Member($"CoalesceEmpty({numericExpression}, {replacement})");
        #endregion

        #region Hierarchy Functions
        public static Member LinkMember(Member memberExpression, Hierarchy hierarchyExpression) =>
            new Member($"LinkMember({memberExpression}, {hierarchyExpression})");
        #endregion

        #region Privates
        private static Expression visit(Expression node)
        {
            switch(node.NodeType)
            {
                case ExpressionType.AndAlso:
                case ExpressionType.OrElse:
                case ExpressionType.GreaterThan:
                case ExpressionType.GreaterThanOrEqual:
                case ExpressionType.LessThan:
                case ExpressionType.LessThanOrEqual:
                case ExpressionType.Equal:
                case ExpressionType.NotEqual:
                    visitBinary((BinaryExpression)node);
                    break;

                case ExpressionType.Convert:
                    visit(((UnaryExpression)node).Operand);
                    break;

                case ExpressionType.MemberAccess:
                    visitMember((MemberExpression)node);
                    break;

                case ExpressionType.Constant:
                    visitConstant((ConstantExpression)node);
                    break;
            }
            return node;
        }

        private static Expression visitConstant(ConstantExpression node)
        {
            sb.Append(node.Value);
            return node;
        }

        private static Expression visitMember(MemberExpression node)
        {
            sb.Append(getObjectValue(node));
            return node;
        }

        private static Expression visitBinary(BinaryExpression node)
        {
            visit(node.Left);
            switch(node.NodeType)
            {
                case ExpressionType.AndAlso:
                    sb.Append(" AND ");
                    break;

                case ExpressionType.OrElse:
                    sb.Append(" OR ");
                    break;

                case ExpressionType.GreaterThan:
                    sb.Append(" > ");
                    break;

                case ExpressionType.GreaterThanOrEqual:
                    sb.Append(" >= ");
                    break;

                case ExpressionType.LessThan:
                    sb.Append(" < ");
                    break;

                case ExpressionType.LessThanOrEqual:
                    sb.Append(" <= ");
                    break;

                case ExpressionType.Equal:
                    sb.Append(" = ");
                    break;

                case ExpressionType.NotEqual:
                    sb.Append(" <> ");
                    break;

                default:
                    throw new NotImplementedInPAS_Exception($"The '{node.NodeType}' is not supported.");
            }
            visit(node.Right);
            return node;
        }

        private static string getObjectValue(MemberExpression member)
        {
            if (member.Expression.NodeType == ExpressionType.Constant)
            {
                var objectMember = Expression.Convert(member, typeof(object));
                var getterLambda = Expression.Lambda<Func<object>>(objectMember);
                var getter = getterLambda.Compile();
                return getter.Invoke().ToString();
            }

            else if (System.Attribute.IsDefined(member.Member, typeof(TagAttribute)))
                return member.Member.GetCustomAttribute<TagAttribute>().Tag;

            else if (System.Attribute.IsDefined(member.Member, typeof(MeasureAttribute)))
                return member.Member.GetCustomAttribute<MeasureAttribute>().Tag;
            else
                return Expression.Lambda<Func<object>>(member, new ParameterExpression[0]).Compile()().ToString();
        }
        #endregion
    }
}


text:
<?php

namespace Atlantests\EditorJS\Blocks;

use Atlantis;
use PHPUnit;

use Atlantis\Struct\EditorJS;

class CodeMirrorTest
extends PHPUnit\Framework\TestCase {

	/** @test */
	public function
	TestThisBlockMyDude():
	void {
	/*//
	@date 2021-04-13
	//*/

		$Struct = (
			new EditorJS\Validator(
				'{ "version": "2.18.0", "time": 123456789, "blocks": ['.
				'{ "type": "code-mirror", "data": { "Title": "picard", "Mime": "captain", "Text": "Engage." } },'.
				'{ "type": "code-mirror", "data": { "Title": "riker", "Mime": "commander" } },'.
				'{ "type": "code-mirror" }'.
				']}'
			)
		)->ToStruct();

		// expect a certain number of blocks...
		$this->AssertCount(3,$Struct->Blocks);

		// this block should contain...
		$this->AssertTrue($Struct->Blocks[0] instanceof EditorJS\Blocks\CodeMirror);
		$this->AssertTrue(str_starts_with((string)$Struct->Blocks[0],'
AssertTrue(str_ends_with((string)$Struct->Blocks[0],"
"));
		$this->AssertTrue(str_contains((string)$Struct->Blocks[0],'data-mime="captain"'));
		$this->AssertTrue(str_contains((string)$Struct->Blocks[0],'data-title="picard"'));
		$this->AssertEquals('Engage.',$Struct->Blocks[0]->Data->Text);

		// this block should contain...
		$this->AssertTrue($Struct->Blocks[1] instanceof EditorJS\Blocks\CodeMirror);
		$this->AssertTrue(str_starts_with((string)$Struct->Blocks[1],'
AssertTrue(str_ends_with((string)$Struct->Blocks[1],"
"));
		$this->AssertTrue(str_contains((string)$Struct->Blocks[1],'data-mime="commander"'));
		$this->AssertTrue(str_contains((string)$Struct->Blocks[1],'data-title="riker"'));
		$this->AssertEquals('',$Struct->Blocks[1]->Data->Text);

		// this block should contain...
		$this->AssertTrue($Struct->Blocks[2] instanceof EditorJS\Blocks\CodeMirror);
		$this->AssertTrue(str_starts_with((string)$Struct->Blocks[2],'
AssertTrue(str_ends_with((string)$Struct->Blocks[2],"
"));
		$this->AssertTrue(str_contains((string)$Struct->Blocks[2],'data-mime=""'));
		$this->AssertTrue(str_contains((string)$Struct->Blocks[2],'data-title=""'));
		$this->AssertEquals('',$Struct->Blocks[2]->Data->Text);

		return;
	}

}


text:
#ifndef SRC_CRYPTO_SYMMETRICCRYPTOCONTEXT_H_
#define SRC_CRYPTO_SYMMETRICCRYPTOCONTEXT_H_

#include <crypto/ICryptoContext.h>
#include <crypto/Key.h>
#include <memory>
#include <string>

namespace netflix {
namespace msl {
namespace util { class MslContext; }
namespace crypto {

/**
 * A symmetric crypto context performs AES-128 encryption/decryption, AES-128
 * key wrap/unwrap, and HMAC-SHA256 or AES-CMAC sign/verify.
 */
class SymmetricCryptoContext: public ICryptoContext
{
public:
     virtual ~SymmetricCryptoContext() {}
     SymmetricCryptoContext(std::shared_ptr<util::MslContext> ctx,
             const std::string& id, const SecretKey& encryptionKey,
             const SecretKey& signatureKey, const SecretKey& wrappingKey);
     virtual std::shared_ptr<ByteArray> encrypt(std::shared_ptr<ByteArray> data, std::shared_ptr<io::MslEncoderFactory> encoder, const io::MslEncoderFormat& format);
     virtual std::shared_ptr<ByteArray> decrypt(std::shared_ptr<ByteArray> data, std::shared_ptr<io::MslEncoderFactory> encoder);
     virtual std::shared_ptr<ByteArray> wrap(std::shared_ptr<ByteArray> data, std::shared_ptr<io::MslEncoderFactory> encoder, const io::MslEncoderFormat& format);
     virtual std::shared_ptr<ByteArray> unwrap(std::shared_ptr<ByteArray> data, std::shared_ptr<io::MslEncoderFactory> encoder);
     virtual std::shared_ptr<ByteArray> sign(std::shared_ptr<ByteArray> data, std::shared_ptr<io::MslEncoderFactory> encoder, const io::MslEncoderFormat& format);
     virtual bool verify(std::shared_ptr<ByteArray> data, std::shared_ptr<ByteArray> signature, std::shared_ptr<io::MslEncoderFactory> encoder);

protected:
     /** MSL context. */
     const std::shared_ptr<util::MslContext> ctx_;
     /** Key set identity. */
     const std::string id_;
     /** Encryption/decryption key. */
     const crypto::SecretKey encryptionKey_;
     /** Signature key. */
     const crypto::SecretKey signatureKey_;
     /** Wrapping key. */
     const crypto::SecretKey wrappingKey_;

private:
     SymmetricCryptoContext();
};

}}} // namespace netflix::msl::crypto

#endif /* SRC_CRYPTO_SYMMETRICCRYPTOCONTEXT_H_ */


text:
namespace Intrinsic
{
namespace AssetManagement
{
namespace Resources
{
// Typedefs
typedef Dod::Ref AssetRef;
typedef _INTR_ARRAY(AssetRef) AssetRefArray;

namespace AssetType
{
enum Enum
{
  kNone,

  kMesh,

  kAlbedoTexture,
  kAlbedoAlphaTexture,
  kLinearColorTexture,
  kNormalTexture,
  kHdrTexture,

  kMeshAndPhysicsMesh,
  kPbrTexture,

  kCount,
  kTexturesBegin = kAlbedoTexture,
  kTexturesEnd = kHdrTexture
};
}

struct AssetData : Dod::Resources::ResourceDataBase
{
  AssetData() : Dod::Resources::ResourceDataBase(_INTR_MAX_ASSET_COUNT)
  {
    descAssetFileName.resize(_INTR_MAX_ASSET_COUNT);
    descAssetType.resize(_INTR_MAX_ASSET_COUNT);
  }

  // Description
  _INTR_ARRAY(_INTR_STRING) descAssetFileName;
  _INTR_ARRAY(AssetType::Enum) descAssetType;
};

struct AssetManager
    : Dod::Resources::ResourceManagerBase<AssetData, _INTR_MAX_ASSET_COUNT>
{
  static void init();

  // <-

  _INTR_INLINE static AssetRef createAsset(const Name& p_Name)
  {
    AssetRef ref = Dod::Resources::ResourceManagerBase<
        AssetData, _INTR_MAX_ASSET_COUNT>::_createResource(p_Name);
    return ref;
  }

  // <-

  _INTR_INLINE static void resetToDefault(AssetRef p_Ref)
  {
    _descAssetFileName(p_Ref) = "";
    _descAssetType(p_Ref) = AssetType::kNone;
  }

  // <-

  _INTR_INLINE static void destroyAsset(AssetRef p_Ref)
  {
    Dod::Resources::ResourceManagerBase<
        AssetData, _INTR_MAX_ASSET_COUNT>::_destroyResource(p_Ref);
  }

  // <-

  _INTR_INLINE static void compileDescriptor(AssetRef p_Ref,
                                             bool p_GenerateDesc,
                                             rapidjson::Value& p_Properties,
                                             rapidjson::Document& p_Document)
  {
    Dod::Resources::ResourceManagerBase<
        AssetData, _INTR_MAX_ASSET_COUNT>::_compileDescriptor(p_Ref,
                                                              p_GenerateDesc,
                                                              p_Properties,
                                                              p_Document);

    p_Properties.AddMember(
        "assetFileName",
        _INTR_CREATE_PROP(p_Document, p_GenerateDesc, _N(Asset), _N(string),
                          _descAssetFileName(p_Ref), false, false),
        p_Document.GetAllocator());
    p_Properties.AddMember(
        "assetType",
        _INTR_CREATE_PROP_ENUM(p_Document, p_GenerateDesc, _N(Asset), _N(enum),
                               _descAssetType(p_Ref),
                               "None,Mesh,AlbedoTexture,AlbedoAlphaTexture,"
                               "LinearColorTexture,NormalTexture,HDRTexture,"
                               "MeshAndPhysicsMesh,PbrTexture",
                               false, false),
        p_Document.GetAllocator());
  }

  // <-

  _INTR_INLINE static void initFromDescriptor(AssetRef p_Ref,
                                              bool p_GenerateDesc,
                                              rapidjson::Value& p_Properties)
  {
    Dod::Resources::ResourceManagerBase<
        AssetData, _INTR_MAX_ASSET_COUNT>::_initFromDescriptor(p_Ref,
                                                               p_GenerateDesc,
                                                               p_Properties);

    if (p_Properties.HasMember("assetFileName"))
      _descAssetFileName(p_Ref) =
          JsonHelper::readPropertyString(p_Properties["assetFileName"]);
    if (p_Properties.HasMember("assetType"))
      _descAssetType(p_Ref) = (AssetType::Enum)JsonHelper::readPropertyEnumUint(
          p_Properties["assetType"]);
  }

  // <-

  _INTR_INLINE static void saveToMultipleFiles(const char* p_Path,
                                               const char* p_Extension)
  {
    Dod::Resources::ResourceManagerBase<AssetData, _INTR_MAX_ASSET_COUNT>::
        _saveToMultipleFiles<
            rapidjson::PrettyWriter<rapidjson::FileWriteStream>>(
            p_Path, p_Extension, compileDescriptor);
  }

  // <-

  _INTR_INLINE static void loadFromMultipleFiles(const char* p_Path,
                                                 const char* p_Extension)
  {
    Dod::Resources::ResourceManagerBase<AssetData, _INTR_MAX_ASSET_COUNT>::
        _loadFromMultipleFiles(p_Path, p_Extension, initFromDescriptor,
                               resetToDefault);
  }

  // <-

  static void compileAssets(AssetRefArray& p_Refs);

  // Description
  _INTR_INLINE static _INTR_STRING& _descAssetFileName(AssetRef p_Ref)
  {
    return _data.descAssetFileName[p_Ref._id];
  }
  _INTR_INLINE static AssetType::Enum& _descAssetType(AssetRef p_Ref)
  {
    return _data.descAssetType[p_Ref._id];
  }
};
}
}
}


text:
name_server::name_server()
{
}

name_server::~name_server()
{
    delete m_responder;
    delete m_publisher;
    delete m_context;
}

int name_server::initialize()
{
    m_context = new zmq::context_t(1);
    m_responder = nullptr;
    m_publisher = nullptr;

    return 0;
}

zmq::socket_t * name_server::sock_create(int type)
{
    return new zmq::socket_t(*m_context, type);
}

void name_server::sock_bind(zmq::socket_t * sock, const char * addr)
{
    if (sock) {
        sock->bind(addr);
    }
}

void name_server::sock_setopt(zmq::socket_t * sock)
{
    return;
}

void name_server::sock_connect(zmq::socket_t * sock, const char * addr)
{
    if (sock) {
        sock->connect(addr);
    }
}

std::string name_server::sock_recv(zmq::socket_t &socket)
{
    zmq::message_t message;
    socket.recv(&message);

    return std::string(static_cast<char*>(message.data()), message.size());
}

bool name_server::sock_send(zmq::socket_t &socket, const std::string &string)
{
    zmq::message_t message(string.size());
    memcpy(message.data(), string.data(), string.size());

    bool result = socket.send(message);

    return result;
}

bool name_server::sock_sendmore(zmq::socket_t &socket, const std::string &string)
{
    zmq::message_t message(string.size());
    memcpy(message.data(), string.data(), string.size());

    bool result = socket.send(message, ZMQ_SNDMORE);

    return result;
}

void name_server::sock_dump(zmq::socket_t &socket)
{
    std::cout << "--------------------------------------------------" << std::endl;
    while (true) {
        zmq::message_t message;
        socket.recv(&message);

        int size = message.size();
        std::string data(static_cast<char *>(message.data()), size);

        bool is_text = true;
        unsigned int count;
        unsigned char c;
        for (count = 0; count < size; count++) {
            c = data[count];
            if (c < 32 || c > 127) {
                is_text = false;
            }
        }
        std::cout << "[" << std::setfill('0') << std::setw(3) << size << "]";
        for (count = 0; count < size; count++) {
            if (is_text) {
                std::cout << (char)data[count];
            } else {
                std::cout << std::setfill('0') << std::setw(2) << std::hex << (unsigned int)data[count];
            }
        }
        std::cout << std::endl;

        int more = 0;
        size_t more_size = sizeof(more);
        socket.getsockopt (ZMQ_RCVMORE, &more, &more_size);

        if (!more) {
            break;
        }
    }
}

std::string name_server::sock_setid(zmq::socket_t &socket)
{
    std::stringstream ss;
    ss << std::hex << std::uppercase
        << std::setw(4) << std::setfill('0') << CANNA_RAND(0x10000) << "-"
        << std::setw(4) << std::setfill('0') << CANNA_RAND(0x10000);
    socket.setsockopt(ZMQ_IDENTITY, ss.str().c_str(), ss.str().length());

    return ss.str();
}

void name_server::responder_create()
{
    m_responder = sock_create(ZMQ_REP);
    //m_responder = (zmq::socket_t *) new zmq::socket_t (*m_context, ZMQ_REP);
}

void name_server::publisher_create()
{
    m_publisher = sock_create(ZMQ_PUB);
}

void name_server::responder_bind(const char * addr)
{
    sock_bind(m_responder, addr);
}

void name_server::publisher_bind(const char * addr)
{
    sock_bind(m_publisher, addr);
}

void name_server::server_loop()
{
    zmq::pollitem_t pollset[] = {
        {(void *)*m_responder, 0, ZMQ_POLLIN, 0}
    };

    name_ctrl namectrl;

    while (true) {
        canna_sleep(100);
        zmq::poll(pollset, 1, 0);

        if (pollset[0].revents & ZMQ_POLLIN) {

            std::string group = sock_recv(*m_responder);

            std::string name  = namectrl.allotnamepair(group);
            std::cout << "GET REQUEST: " << group << std::endl;
            std::vector<std::string> namelist = namectrl.getnamelist(group);
            NameInfo nameinfo;
            for (auto & x : namelist) {
                nameinfo.add_name(x);
            }
            std::string msg;
            nameinfo.SerializeToString(&msg);

            sock_send(*m_responder, msg);
            sock_send(*m_publisher, name);
        }
    }

    return;
}


text:
module Api
  module V1
    class ProductsController < ApplicationController
      class Product < ::Product
        def as_json(options = {})
          super.merge(released_on: released_at.to_date)
        end
      end

      respond_to :json

      def index
        respond_with Product.all
      end

      def show
        respond_with Product.find(params[:id])
      end

      def create
        respond_with Product.create(params[:product])
      end

      def update
        respond_with Product.update(params[:id], params[:product])
      end

      def destroy
        respond_with Product.destroy(params[:id])
      end
    end
  end
end


text:
module Fog
  module OpenStack
    class Network
      class Real
        def update_subnet(subnet_id, options = {})
          data = {'subnet' => {}}

          vanilla_options = [:name, :gateway_ip, :allocation_pools,
                             :dns_nameservers, :host_routes, :enable_dhcp]
          vanilla_options.select { |o| options.key?(o) }.each do |key|
            data['subnet'][key] = options[key]
          end

          request(
            :body    => Fog::JSON.encode(data),
            :expects => 200,
            :method  => 'PUT',
            :path    => "subnets/#{subnet_id}"
          )
        end
      end

      class Mock
        def update_subnet(subnet_id, options = {})
          response = Excon::Response.new
          if subnet = list_subnets.body['subnets'].find { |_| _['id'] == subnet_id }
            subnet['name']              = options[:name]
            subnet['gateway_ip']        = options[:gateway_ip]
            subnet['dns_nameservers']   = options[:dns_nameservers]   || []
            subnet['host_routes']       = options[:host_routes]       || []
            subnet['allocation_pools']  = options[:allocation_pools]  || []
            subnet['enable_dhcp']       = options[:enable_dhcp]
            response.body = {'subnet' => subnet}
            response.status = 200
            response
          else
            raise Fog::OpenStack::Network::NotFound
          end
        end
      end
    end
  end
end


text:
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

using System;
using System.Diagnostics;
using System.Security;
using osu.Framework.Extensions;

namespace osu.Game.Online.API
{
    internal class SecurePassword
    {
        private readonly SecureString storage = new SecureString();
        private readonly Representation representation;

        //todo: move this to a central constants file.
        private const string password_entropy = @"cu24180ncjeiu0ci1nwui";

        public SecurePassword(string input, bool encrypted = false)
        {
            //if (encrypted)
            //{
            //    string rep;
            //    input = DPAPI.Decrypt(input, password_entropy, out rep);
            //    Enum.TryParse(rep, out representation);
            //}
            //else
            {
                representation = Representation.Raw;
            }

            foreach (char c in input)
                storage.AppendChar(c);
            storage.MakeReadOnly();
        }

        internal string Get(Representation request = Representation.Raw)
        {
            Debug.Assert(representation == request);

            switch (request)
            {
                default:
                    return storage.UnsecureRepresentation();
                //case Representation.Encrypted:
                //    return DPAPI.Encrypt(DPAPI.KeyType.UserKey, storage.UnsecureRepresentation(), password_entropy, representation.ToString());
            }
        }
    }

    enum Representation
    {
        Raw,
        Encrypted
    }
}


text:
using System.IO;
using System.Text;

namespace DbfDataReader
{
    public class DbfMemoDbase3 : DbfMemo
    {
        public DbfMemoDbase3(string path) : base(path)
        {
        }

        public DbfMemoDbase3(string path, Encoding encoding) : base(path, encoding)
        {
        }

        public DbfMemoDbase3(Stream stream, Encoding encoding) : base(stream, encoding)
        {
        }

        public override string BuildMemo(long startBlock)
        {
            var offset = Offset(startBlock);
            BinaryReader.BaseStream.Seek(offset, SeekOrigin.Begin);

            var finished = false;
            var stringBuilder = new StringBuilder();

            do
            {
                var block = BinaryReader.ReadString(DefaultBlockSize, CurrentEncoding);
                if ((block == null) || (block.Length == 0))
                {
                    break;
                }
                stringBuilder.Append(block);

                if (block.Length >= DefaultBlockSize) finished = true;
            } while (!finished);

            var value = stringBuilder.ToString();
            var nullIdx = value.IndexOf((char)0);
            if (nullIdx >= 0)
            {
                value = value.Substring(0, nullIdx);   // trim off everything past & including the first NUL byte
            }
            value = value.TrimEnd(' ');
            return value;
        }
    }
}


text:
// @flow

import * as result from 'orio-result'
import { AsIterator, ToString } from 'orio-traits'
import type { Producer } from 'orio-types'

@ToString
@AsIterator
export default class Map<T, U> implements Producer<U> {
  /*:: @@iterator: () => Iterator<U> */
  fn: T => U
  producer: Producer<T>

  constructor(producer: Producer<T>, fn: T => U) {
    this.fn = fn
    this.producer = producer
  }

  drop(): void {
    this.producer.drop()
  }

  next(): IteratorResult<U, void> {
    const next = this.producer.next()

    if (next.done) {
      return next
    }

    return result.next(this.fn(next.value))
  }
}


text:
<?xml version="1.0"?>
<doc>
    <assembly>
        <name>Microsoft.TeamFoundation.Diff</name>
    </assembly>
    <members>
        <member name="T:Microsoft.TeamFoundation.Diff.ContinueDifferencePredicate`1">
            <summary>
            A predicate used by Microsoft.TeamFoundation.Diff.DiffFinder
            that allows callers to stop differencing prematurely.
            </summary>
            <param name="originalIndex">The current index in the original sequence being differenced.</param>
            <param name="originalSequence">The original sequence being differenced.</param>
            <param name="longestMatchSoFar">The length of the longest match so far.</param>
            <returns>true if the algorithm should continue processing, false to stop the algorithm.</returns>
            <remarks>
            When false is returned, the algorithm stops searching for matches and uses
            the information it has computed so far to create the Microsoft.TeamFoundation.Diff.IDiffChange[] array
            that will be returned.
            </remarks>
        </member>
        <member name="T:Microsoft.TeamFoundation.Diff.DiffChangeType">
            <summary>
            An enumeration of the possible change types for a difference operation.
            </summary>
        </member>
        <member name="F:Microsoft.TeamFoundation.Diff.DiffChangeType.Insert">
            <summary>
            Content was inserted into the modified sequence.
            </summary>
        </member>
        <member name="F:Microsoft.TeamFoundation.Diff.DiffChangeType.Delete">
            <summary>
            Content was deleted from the original sequence.
            </summary>
        </member>
        <member name="F:Microsoft.TeamFoundation.Diff.DiffChangeType.Change">
            <summary>
            Content from the original sequence has changed in the modified
            sequence.
            </summary>
        </member>
        <member name="T:Microsoft.TeamFoundation.Diff.IDiffChange">
            <summary>
            Represents information about a specific difference between two sequences.
            </summary>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.IDiffChange.Add(Microsoft.TeamFoundation.Diff.IDiffChange)">
            <summary>
            This methods combines two IDiffChange objects into one
            </summary>
            <param name="diffChange">The diff change to add</param>
            <returns>An IDiffChange that represnets this + diffChange</returns>
        </member>
        <member name="P:Microsoft.TeamFoundation.Diff.IDiffChange.ChangeType">
            <summary>
            The type of difference.
            </summary>
        </member>
        <member name="P:Microsoft.TeamFoundation.Diff.IDiffChange.OriginalStart">
            <summary>
            The position of the first element in the original sequence which
            this change affects.
            </summary>
        </member>
        <member name="P:Microsoft.TeamFoundation.Diff.IDiffChange.OriginalLength">
            <summary>
            The number of elements from the original sequence which were
            affected (deleted).
            </summary>
        </member>
        <member name="P:Microsoft.TeamFoundation.Diff.IDiffChange.OriginalEnd">
            <summary>
            The position of the last element in the original sequence which
            this change affects.
            </summary>
        </member>
        <member name="P:Microsoft.TeamFoundation.Diff.IDiffChange.ModifiedStart">
            <summary>
            The position of the first element in the modified sequence which
            this change affects.
            </summary>
        </member>
        <member name="P:Microsoft.TeamFoundation.Diff.IDiffChange.ModifiedLength">
            <summary>
            The number of elements from the modified sequence which were
            affected (added).
            </summary>
        </member>
        <member name="P:Microsoft.TeamFoundation.Diff.IDiffChange.ModifiedEnd">
            <summary>
            The position of the last element in the modified sequence which
            this change affects.
            </summary>
        </member>
        <member name="T:Microsoft.TeamFoundation.Diff.DiffChange">
            <summary>
            Represents information about a specific difference between two sequences.
            </summary>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.DiffChange.#ctor(System.Int32,System.Int32,System.Int32,System.Int32)">
            <summary>
            Constructs a new DiffChange with the given sequence information
            and content.
            </summary>
            <param name="originalStart">The start position of the difference
            in the original sequence.</param>
            <param name="originalLength">The number of elements of the difference
            from the original sequence.</param>
            <param name="modifiedStart">The start position of the difference
            in the modified sequence.</param>
            <param name="modifiedLength">The number of elements of the difference
            from the modified sequence.</param>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.DiffChange.UpdateChangeType">
            <summary>
            Determines the change type from the ranges and updates the value.
            </summary>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.DiffChange.Add(Microsoft.TeamFoundation.Diff.IDiffChange)">
            <summary>
            This methods combines two DiffChange objects into one
            </summary>
            <param name="diffChange">The diff change to add</param>
            <returns>A IDiffChange object that represnets this + diffChange</returns>
        </member>
        <member name="P:Microsoft.TeamFoundation.Diff.DiffChange.ChangeType">
            <summary>
            The type of difference.
            </summary>
        </member>
        <member name="P:Microsoft.TeamFoundation.Diff.DiffChange.OriginalStart">
            <summary>
            The position of the first element in the original sequence which
            this change affects.
            </summary>
        </member>
        <member name="P:Microsoft.TeamFoundation.Diff.DiffChange.OriginalLength">
            <summary>
            The number of elements from the original sequence which were
            affected.
            </summary>
        </member>
        <member name="P:Microsoft.TeamFoundation.Diff.DiffChange.OriginalEnd">
            <summary>
            The position of the last element in the original sequence which
            this change affects.
            </summary>
        </member>
        <member name="P:Microsoft.TeamFoundation.Diff.DiffChange.ModifiedStart">
            <summary>
            The position of the first element in the modified sequence which
            this change affects.
            </summary>
        </member>
        <member name="P:Microsoft.TeamFoundation.Diff.DiffChange.ModifiedLength">
            <summary>
            The number of elements from the modified sequence which were
            affected (added).
            </summary>
        </member>
        <member name="P:Microsoft.TeamFoundation.Diff.DiffChange.ModifiedEnd">
            <summary>
            The position of the last element in the modified sequence which
            this change affects.
            </summary>
        </member>
        <member name="T:Microsoft.TeamFoundation.Diff.EndOfLineTerminator">
            <summary>
            The types of End of Line terminators.
            </summary>
        </member>
        <member name="T:Microsoft.TeamFoundation.Diff.DiffLineTokenizer">
            <summary>
            Utility class which tokenizes the given stream into string tokens. Each
            token represents a line from the file as delimited by common EOL sequences.
            (\n, \r\n, \r, \u2028, \u2029, \u85)
            </summary>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.DiffLineTokenizer.#ctor(System.IO.Stream,System.Text.Encoding)">
            <summary>
            Constructs a new DiffLineTokenizer for the given stream and encoding.
            </summary>
            <param name="stream">The stream to tokenize.</param>
            <param name="encoding">The character encoding of the bytes
            in the stream. If null, this will be automatically detected.</param>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.DiffLineTokenizer.FillBuffer">
            <summary>
            Fills up the internal buffer with characters from the stream.
            Returns the number of characters in the buffer and resets the
            current buffer position.
            Returns 0 when EOF.
            </summary>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.DiffLineTokenizer.NextLineToken(Microsoft.TeamFoundation.Diff.EndOfLineTerminator@)">
            <summary>
            Gets the next line token as a string from the stream.
            </summary>
            <returns>The next token. Returns null when the end of stream has
            been reached.</returns>
        </member>
        <member name="T:Microsoft.TeamFoundation.Diff.DiffChangeHelper">
            <summary>
            A utility class which helps to create the set of DiffChanges from
            a difference operation. This class accepts original DiffElements and
            modified DiffElements that are involved in a particular change. The
            MarktNextChange() method can be called to mark the seration between
            distinct changes. At the end, the Changes property can be called to retrieve
            the constructed changes.
            </summary>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.DiffChangeHelper.#ctor">
            <summary>
            Constructs a new DiffChangeHelper for the given DiffSequences.
            </summary>
            <param name="originalSequence">The original sequence.</param>
            <param name="modifiedSequnece">The modified sequence.</param>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.DiffChangeHelper.Dispose">
            <summary>
            Disposes of the resources used by this helper class.
            </summary>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.DiffChangeHelper.MarkNextChange">
            <summary>
            Marks the beginning of the next change in the set of differences.
            </summary>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.DiffChangeHelper.AddOriginalElement(System.Int32,System.Int32)">
            <summary>
            Adds the original element at the given position to the elements
            affected by the current change. The modified index gives context
            to the change position with respect to the original sequence.
            </summary>
            <param name="originalIndex">The index of the original element to add.</param>
            <param name="modifiedIndex">The index of the modified element that
            provides corresponding position in the modified sequence.</param>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.DiffChangeHelper.AddModifiedElement(System.Int32,System.Int32)">
            <summary>
            Adds the modified element at the given position to the elements
            affected by the current change. The original index gives context
            to the change position with respect to the modified sequence.
            </summary>
            <param name="originalIndex">The index of the original element that
            provides corresponding position in the original sequence.</param>
            <param name="modifiedIndex">The index of the modified element to add.</param>
        </member>
        <member name="P:Microsoft.TeamFoundation.Diff.DiffChangeHelper.Changes">
            <summary>
            Retrieves all of the changes marked by the class.
            </summary>
        </member>
        <member name="P:Microsoft.TeamFoundation.Diff.DiffChangeHelper.ReverseChanges">
            <summary>
            Retrieves all of the changes marked by the class in the reverse order
            </summary>
        </member>
        <member name="T:Microsoft.TeamFoundation.Diff.DiffFinder`1">
            <summary>
            A base for classes which compute the differences between two input sequences.
            </summary>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.DiffFinder`1.Dispose">
            <summary>
            Disposes resources used by this DiffFinder
            </summary>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.DiffFinder`1.ElementsAreEqual(System.Int32,System.Int32)">
            <summary>
            Returns true if the specified original and modified elements are equal.
            </summary>
            <param name="originalIndex">The index of the original element</param>
            <param name="modifiedIndex">The index of the modified element</param>
            <returns>True if the specified elements are equal</returns>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.DiffFinder`1.OriginalElementsAreEqual(System.Int32,System.Int32)">
            <summary>
            Returns true if the two specified original elements are equal.
            </summary>
            <param name="firstIndex">The index of the first original element</param>
            <param name="secondIndex">The index of the second original element</param>
            <returns>True if the specified elements are equal</returns>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.DiffFinder`1.ModifiedElementsAreEqual(System.Int32,System.Int32)">
            <summary>
            Returns true if the two specified modified elements are equal.
            </summary>
            <param name="firstIndex">The index of the first modified element</param>
            <param name="secondIndex">The index of the second modified element</param>
            <returns>True if the specified elements are equal</returns>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.DiffFinder`1.ElementsAreEqual(System.Int32,System.Boolean,System.Int32,System.Boolean)">
            <summary>
            Returns true if the specified elements are equal.
            </summary>
            <param name="firstIndex">The index of the first element</param>
            <param name="firstIsOriginal">True if the first element is an original
            element, false if modified element</param>
            <param name="secondIndex">The index of the second element</param>
            <param name="secondIsOriginal">True if the second element is an original
            element, false if modified element</param>
            <returns>True if the specified elements are equal</returns>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.DiffFinder`1.ComputeUniqueIdentifiers(System.Int32,System.Int32,System.Int32,System.Int32)">
            <summary>
            This method hashes element groups within the specified range
            and assigns unique identifiers to identical elements.

            This greatly speeds up element comparison as we may compare integers
            instead of having to look at element content.
            </summary>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.DiffFinder`1.Diff(System.Collections.Generic.IList{`0},System.Collections.Generic.IList{`0},System.Collections.Generic.IEqualityComparer{`0})">
            <summary>
            Computes the differences between the given original and modified sequences.
            </summary>
            <param name="original">The original sequence.</param>
            <param name="modified">The modified sequence.</param>
            <param name="elementComparer">The diff element comparer.</param>
            <returns>The set of differences between the sequences.</returns>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.DiffFinder`1.Diff(System.Collections.Generic.IList{`0},System.Collections.Generic.IList{`0},System.Collections.Generic.IEqualityComparer{`0},Microsoft.TeamFoundation.Diff.ContinueDifferencePredicate{`0})">
            <summary>
            Computes the differences between the given original and modified sequences.
            </summary>
            <param name="original">The original sequence.</param>
            <param name="modified">The modified sequence.</param>
            <param name="elementComparer">The diff element comparer.</param>
            <returns>The set of differences between the sequences.</returns>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.DiffFinder`1.ComputeDiff(System.Int32,System.Int32,System.Int32,System.Int32)">
            <summary>
            Computes the differences between the original and modified input
            sequences on the bounded range.
            </summary>
            <returns>An array of the differences between the two input
            sequences.</returns>
        </member>
        <member name="P:Microsoft.TeamFoundation.Diff.DiffFinder`1.OriginalSequence">
            <summary>
            The original sequence
            </summary>
        </member>
        <member name="P:Microsoft.TeamFoundation.Diff.DiffFinder`1.ModifiedSequence">
            <summary>
            The modified sequence
            </summary>
        </member>
        <member name="P:Microsoft.TeamFoundation.Diff.DiffFinder`1.ElementComparer">
            <summary>
            The element comparer
            </summary>
        </member>
        <member name="P:Microsoft.TeamFoundation.Diff.DiffFinder`1.LcsDiff">
            <summary>
            Gets the LCS Diff implementation.
            </summary>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.FileTypeUtil.TryDetermineTextEncoding(System.String)">
            <summary>
            Determines the encoding for a file by first checking for the Unicode byte order mark.  If
            it is Unicode, the particular encoding is returned.  If it does not contain the Unicode
            BOM, it's trying to detect utf8 encoding by scanning first 1024 bytes of the file.
            If it fails, or exception is thrown it returns the current encoding is returned (aka the OEM code page).
            </summary>
            <param name="path">Canonicalized path to the file to check</param>
            <returns>the encoding for the file or OEM code page if exception was thrown</returns>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.FileTypeUtil.DetermineEncoding(System.String,System.Boolean,System.Text.Encoding)">
            <summary>
            Determines the encoding for a file by first checking for the Unicode byte order mark.  If
            it is Unicode, the particular encoding is returned.  If it does not contain the Unicode
            BOM, it's trying to detect utf8 encoding by scanning first 1024 bytes of the file.
            If utf8 is not detected and checkForBinary is false,
            the current encoding is returned (aka the OEM code page).
            When checkForBinary is true and the file does not contain the BOM, the encoding returned is
            null if there are NUL bytes in the first 1K of the file or is the current encoding if there
            are no NUL bytes.
            It throws exception if file is missing or is a directory.
            </summary>
            <param name="path">Canonicalized path to the file to check</param>
            <param name="checkForBinary">if true, check the file for null bytes</param>
            <param name="fallbackEncoding">The encoding to fall back to if a unicode encoding
            was not detected and the file was not detected to contain only ASCII characters</param>
            <returns>the encoding for the file or null if checkForBinary is true and NUL characters are
              present in the file</returns>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.FileTypeUtil.DetermineEncoding(System.IO.Stream,System.Boolean,System.Text.Encoding)">
            <summary>
            Determines the encoding for a file by first checking for the Unicode byte order mark.  If
            it is Unicode, the particular encoding is returned.  If it does not contain the Unicode
            BOM, it's trying to detect utf8 encoding by scanning first 1024 bytes of the file.
            If utf8 is not detected and checkForBinary is false,
            the current encoding is returned (aka the OEM code page).
            When checkForBinary is true and the file does not contain the BOM, the encoding returned is
            null if there are NUL bytes in the first 1K of the file or is the current encoding if there
            are no NUL bytes.
            It throws exception if file is missing or is a directory.
            </summary>
            <param name="stream">Stream to check</param>
            <param name="checkForBinary">if true, check the file for null bytes</param>
            <param name="fallbackEncoding">The encoding to fall back to if a unicode encoding
            was not detected and the stream was not detected to contain only ASCII characters</param>
            <returns>the encoding for the file or null if checkForBinary is true and NUL characters are
              present in the file</returns>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.FileTypeUtil.DetermineEncoding(System.IO.Stream,System.Boolean,System.Text.Encoding,System.Boolean,System.Boolean@)">
            <summary>
            Determines the encoding for a file by first checking for the Unicode byte order mark.  If
            it is Unicode, the particular encoding is returned.  If it does not contain the Unicode
            BOM, it's trying to detect utf8 encoding by scanning first 1024 bytes of the file.
            If utf8 is not detected and checkForBinary is false,
            the current encoding is returned (aka the OEM code page).
            When checkForBinary is true and the file does not contain the BOM, the encoding returned is
            null if there are NUL bytes in the first 1K of the file or is the current encoding if there
            are no NUL bytes.
            It throws exception if file is missing or is a directory.
            </summary>
            <param name="stream">Stream to check</param>
            <param name="checkForBinary">if true, check the file for null bytes</param>
            <param name="fallbackEncoding">The encoding to fall back to if a unicode encoding
            was not detected and the stream was not detected to contain only ASCII characters</param>
            <returns>the encoding for the file or null if checkForBinary is true and NUL characters are
              present in the file</returns>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.FileTypeUtil.FindMatchingEncoding(System.Byte[],System.Int32,System.Boolean@)">
            <summary>
            Finds the encoding with the matching preamble, if any.
            </summary>
            <param name="buffer">the buffer to check</param>
            <param name="length">the length of valid bytes in the buffer</param>
            <param name="isPdf">returned true if the file is a PDF; false otherwise</param>
            <returns>the encoding that matches or null</returns>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.FileTypeUtil.GetUTF8Info(System.Byte[],System.Int32,System.Boolean,System.IO.Stream,Microsoft.TeamFoundation.Diff.UTF8Flags@)">
            <summary>
            Port of vscommon\unilib\utf.cpp::GetUTF8Info
            Analyzes byte array checking if it contains valid and invalid utf8 characters.
            </summary>
            <param name="buffer">Array of bytes, representing string in unknown encoding.</param>
            <param name="bufferLength">Number of bytes in the array to analyze</param>
            <param name="result"></param>
        </member>
        <member name="T:Microsoft.TeamFoundation.Diff.LcsDiff`1">
            <summary>
            An implementation of the difference algorithm described in
            "An O(ND) Difference Algorithm and its Variations" by Eugene W. Myers
            </summary>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.LcsDiff`1.#ctor">
            <summary>
            Constructs the DiffFinder
            </summary>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.LcsDiff`1.Dispose">
            <summary>
            Disposes resources uses by this DiffFinder
            </summary>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.LcsDiff`1.ComputeDiff(System.Int32,System.Int32,System.Int32,System.Int32)">
            <summary>
            Computes the differences between the original and modified input
            sequences on the bounded range.
            </summary>
            <returns>An array of the differences between the two input
            sequences.</returns>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.LcsDiff`1.ComputeDiffRecursive(System.Int32,System.Int32,System.Int32,System.Int32,System.Boolean@)">
            <summary>
            Private helper method which computes the differences on the bounded range
            recursively.
            </summary>
            <returns>An array of the differences between the two input
            sequences.</returns>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.LcsDiff`1.ComputeRecursionPoint(System.Int32,System.Int32,System.Int32,System.Int32,System.Int32@,System.Int32@,System.Boolean@)">
            <summary>
            Given the range to compute the diff on, this method finds the point:
            (midOriginal, midModified)
            that exists in the middle of the LCS of the two sequences and
            is the point at which the LCS problem may be broken down recursively.
            This method will try to keep the LCS trace in memory. If the LCS recursion
            point is calculated and the full trace is available in memory, then this method
            will return the change list.
            </summary>
            <param name="originalStart">The start bound of the original sequence range</param>
            <param name="originalEnd">The end bound of the original sequence range</param>
            <param name="modifiedStart">The start bound of the modified sequence range</param>
            <param name="modifiedEnd">The end bound of the modified sequence range</param>
            <param name="midOriginal">The middle point of the original sequence range</param>
            <param name="midModified">The middle point of the modified sequence range</param>
            <returns>The diff changes, if available, otherwise null</returns>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.LcsDiff`1.ShiftChanges(Microsoft.TeamFoundation.Diff.IDiffChange[])">
            <summary>
            Shifts the given changes to provide a more intuitive diff.
            While the first element in a diff matches the first element after the diff,
            we shift the diff down.
            </summary>
            <param name="changes">The list of changes to shift</param>
            <returns>The shifted changes</returns>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.LcsDiff`1.ConcatenateChanges(Microsoft.TeamFoundation.Diff.IDiffChange[],Microsoft.TeamFoundation.Diff.IDiffChange[])">
            <summary>
            Concatentates the two input DiffChange lists and returns the resulting
            list.
            </summary>
            <param name="left">The left changes</param>
            <param name="right">The right changes</param>
            <returns>The concatenated list</returns>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.LcsDiff`1.ChangesOverlap(Microsoft.TeamFoundation.Diff.IDiffChange,Microsoft.TeamFoundation.Diff.IDiffChange,Microsoft.TeamFoundation.Diff.IDiffChange@)">
            <summary>
            Returns true if the two changes overlap and can be merged into a single
            change
            </summary>
            <param name="left">The left change</param>
            <param name="right">The right change</param>
            <param name="mergedChange">The merged change if the two overlap,
            null otherwise</param>
            <returns>True if the two changes overlap</returns>
        </member>
        <member name="M:Microsoft.TeamFoundation.Diff.LcsDiff`1.ClipDiagonalBound(System.Int32,System.Int32,System.Int32,System.Int32)">
            <summary>
            Helper method used to clip a diagonal index to the range of valid
            diagonals. This also decides whether or not the diagonal index,
            if it exceeds the boundary, should be clipped to the boundary or clipped
            one inside the boundary depending on the Even/Odd status of the boundary
            and numDifferences.
            </summary>
            <param name="diagonal">The index of the diagonal to clip.</param>
            <param name="numDifferences">The current number of differences being
            iterated upon.</param>
            <param name="diagonalBaseIndex">The base reference diagonal.</param>
            <param name="numDiagonals">The total number of diagonals.</param>
            <returns>The clipped diagonal index.</returns>
        </member>
    </members>
</doc>


text:
<?xml version="1.1" encoding="UTF-8"?>
<!DOCTYPE IllegalNameChar [
<!ELEMENT IllegalNameChar ANY>
]>
<!-- IllegalNameChar #0xF1FF -->
<IllegalNameChar/>


text:
import { assert } from 'chai';
import { parseArguments } from '../src/cli';

describe('CLI', () => {

  it('parseArguments Full', () => {

    const fullArguments: string[] = [
      '--project',
      './source/project1',
      '--noClean',
    ];

    const args = parseArguments(fullArguments);

    assert.equal(args.project, './source/project1');
    assert.isUndefined(args.outDir);
    assert.isTrue(args.noClean);
    assert.isFalse(args.noPkgValidation);
    assert.isFalse(args.noDepsValidation);

  });

  it('parseArguments Alias', () => {

    const aliasArguments: string[] = [
      '-g',
      '-d',
      '-o',
      '../output',
      '-p',
      './',
    ];

    const args = parseArguments(aliasArguments);

    assert.equal(args.project, './');
    assert.equal(args.outDir, '../output');
    assert.isFalse(args.noClean);
    assert.isTrue(args.noPkgValidation);
    assert.isTrue(args.noDepsValidation);

  });

});