text:
<?php

class Google_Service_Bigquery_ExplainQueryStage extends Google_Collection
{
  protected $collection_key = 'steps';
  public $completedParallelInputs;
  public $computeMsAvg;
  public $computeMsMax;
  public $computeRatioAvg;
  public $computeRatioMax;
  public $endMs;
  public $id;
  public $inputStages;
  public $name;
  public $parallelInputs;
  public $readMsAvg;
  public $readMsMax;
  public $readRatioAvg;
  public $readRatioMax;
  public $recordsRead;
  public $recordsWritten;
  public $shuffleOutputBytes;
  public $shuffleOutputBytesSpilled;
  public $slotMs;
  public $startMs;
  public $status;
  protected $stepsType = 'Google_Service_Bigquery_ExplainQueryStep';
  protected $stepsDataType = 'array';
  public $waitMsAvg;
  public $waitMsMax;
  public $waitRatioAvg;
  public $waitRatioMax;
  public $writeMsAvg;
  public $writeMsMax;
  public $writeRatioAvg;
  public $writeRatioMax;

  public function setCompletedParallelInputs($completedParallelInputs)
  {
    $this->completedParallelInputs = $completedParallelInputs;
  }
  public function getCompletedParallelInputs()
  {
    return $this->completedParallelInputs;
  }
  public function setComputeMsAvg($computeMsAvg)
  {
    $this->computeMsAvg = $computeMsAvg;
  }
  public function getComputeMsAvg()
  {
    return $this->computeMsAvg;
  }
  public function setComputeMsMax($computeMsMax)
  {
    $this->computeMsMax = $computeMsMax;
  }
  public function getComputeMsMax()
  {
    return $this->computeMsMax;
  }
  public function setComputeRatioAvg($computeRatioAvg)
  {
    $this->computeRatioAvg = $computeRatioAvg;
  }
  public function getComputeRatioAvg()
  {
    return $this->computeRatioAvg;
  }
  public function setComputeRatioMax($computeRatioMax)
  {
    $this->computeRatioMax = $computeRatioMax;
  }
  public function getComputeRatioMax()
  {
    return $this->computeRatioMax;
  }
  public function setEndMs($endMs)
  {
    $this->endMs = $endMs;
  }
  public function getEndMs()
  {
    return $this->endMs;
  }
  public function setId($id)
  {
    $this->id = $id;
  }
  public function getId()
  {
    return $this->id;
  }
  public function setInputStages($inputStages)
  {
    $this->inputStages = $inputStages;
  }
  public function getInputStages()
  {
    return $this->inputStages;
  }
  public function setName($name)
  {
    $this->name = $name;
  }
  public function getName()
  {
    return $this->name;
  }
  public function setParallelInputs($parallelInputs)
  {
    $this->parallelInputs = $parallelInputs;
  }
  public function getParallelInputs()
  {
    return $this->parallelInputs;
  }
  public function setReadMsAvg($readMsAvg)
  {
    $this->readMsAvg = $readMsAvg;
  }
  public function getReadMsAvg()
  {
    return $this->readMsAvg;
  }
  public function setReadMsMax($readMsMax)
  {
    $this->readMsMax = $readMsMax;
  }
  public function getReadMsMax()
  {
    return $this->readMsMax;
  }
  public function setReadRatioAvg($readRatioAvg)
  {
    $this->readRatioAvg = $readRatioAvg;
  }
  public function getReadRatioAvg()
  {
    return $this->readRatioAvg;
  }
  public function setReadRatioMax($readRatioMax)
  {
    $this->readRatioMax = $readRatioMax;
  }
  public function getReadRatioMax()
  {
    return $this->readRatioMax;
  }
  public function setRecordsRead($recordsRead)
  {
    $this->recordsRead = $recordsRead;
  }
  public function getRecordsRead()
  {
    return $this->recordsRead;
  }
  public function setRecordsWritten($recordsWritten)
  {
    $this->recordsWritten = $recordsWritten;
  }
  public function getRecordsWritten()
  {
    return $this->recordsWritten;
  }
  public function setShuffleOutputBytes($shuffleOutputBytes)
  {
    $this->shuffleOutputBytes = $shuffleOutputBytes;
  }
  public function getShuffleOutputBytes()
  {
    return $this->shuffleOutputBytes;
  }
  public function setShuffleOutputBytesSpilled($shuffleOutputBytesSpilled)
  {
    $this->shuffleOutputBytesSpilled = $shuffleOutputBytesSpilled;
  }
  public function getShuffleOutputBytesSpilled()
  {
    return $this->shuffleOutputBytesSpilled;
  }
  public function setSlotMs($slotMs)
  {
    $this->slotMs = $slotMs;
  }
  public function getSlotMs()
  {
    return $this->slotMs;
  }
  public function setStartMs($startMs)
  {
    $this->startMs = $startMs;
  }
  public function getStartMs()
  {
    return $this->startMs;
  }
  public function setStatus($status)
  {
    $this->status = $status;
  }
  public function getStatus()
  {
    return $this->status;
  }
  /**
   * @param Google_Service_Bigquery_ExplainQueryStep
   */
  public function setSteps($steps)
  {
    $this->steps = $steps;
  }
  /**
   * @return Google_Service_Bigquery_ExplainQueryStep
   */
  public function getSteps()
  {
    return $this->steps;
  }
  public function setWaitMsAvg($waitMsAvg)
  {
    $this->waitMsAvg = $waitMsAvg;
  }
  public function getWaitMsAvg()
  {
    return $this->waitMsAvg;
  }
  public function setWaitMsMax($waitMsMax)
  {
    $this->waitMsMax = $waitMsMax;
  }
  public function getWaitMsMax()
  {
    return $this->waitMsMax;
  }
  public function setWaitRatioAvg($waitRatioAvg)
  {
    $this->waitRatioAvg = $waitRatioAvg;
  }
  public function getWaitRatioAvg()
  {
    return $this->waitRatioAvg;
  }
  public function setWaitRatioMax($waitRatioMax)
  {
    $this->waitRatioMax = $waitRatioMax;
  }
  public function getWaitRatioMax()
  {
    return $this->waitRatioMax;
  }
  public function setWriteMsAvg($writeMsAvg)
  {
    $this->writeMsAvg = $writeMsAvg;
  }
  public function getWriteMsAvg()
  {
    return $this->writeMsAvg;
  }
  public function setWriteMsMax($writeMsMax)
  {
    $this->writeMsMax = $writeMsMax;
  }
  public function getWriteMsMax()
  {
    return $this->writeMsMax;
  }
  public function setWriteRatioAvg($writeRatioAvg)
  {
    $this->writeRatioAvg = $writeRatioAvg;
  }
  public function getWriteRatioAvg()
  {
    return $this->writeRatioAvg;
  }
  public function setWriteRatioMax($writeRatioMax)
  {
    $this->writeRatioMax = $writeRatioMax;
  }
  public function getWriteRatioMax()
  {
    return $this->writeRatioMax;
  }
}


text:
CREATE TABLE country (id VARCHAR(2) NOT NULL, name VARCHAR(64) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;

INSERT INTO `country` (`id`, `name`) VALUES ('ZA', 'Afrika ya Súdi');
INSERT INTO `country` (`id`, `name`) VALUES ('AF', 'Afuganisita');
INSERT INTO `country` (`id`, `name`) VALUES ('AZ', 'Ajelbayidja');
INSERT INTO `country` (`id`, `name`) VALUES ('SA', 'Alabu Nsawudi');
INSERT INTO `country` (`id`, `name`) VALUES ('DE', 'Alemanu');
INSERT INTO `country` (`id`, `name`) VALUES ('AR', 'Alijantine');
INSERT INTO `country` (`id`, `name`) VALUES ('DZ', 'Alijeri');
INSERT INTO `country` (`id`, `name`) VALUES ('AL', 'Alubani');
INSERT INTO `country` (`id`, `name`) VALUES ('AM', 'Ameni');
INSERT INTO `country` (`id`, `name`) VALUES ('US', 'Ameriki');
INSERT INTO `country` (`id`, `name`) VALUES ('AD', 'Andore');
INSERT INTO `country` (`id`, `name`) VALUES ('GB', 'Angeletele');
INSERT INTO `country` (`id`, `name`) VALUES ('AI', 'Angiye');
INSERT INTO `country` (`id`, `name`) VALUES ('AO', 'Angola');
INSERT INTO `country` (`id`, `name`) VALUES ('AG', 'Antiga ne Barbuda');
INSERT INTO `country` (`id`, `name`) VALUES ('AN', 'Antiye wa Olande');
INSERT INTO `country` (`id`, `name`) VALUES ('AW', 'Aruba');
INSERT INTO `country` (`id`, `name`) VALUES ('HT', 'Ayiti');
INSERT INTO `country` (`id`, `name`) VALUES ('BS', 'Bahamase');
INSERT INTO `country` (`id`, `name`) VALUES ('BH', 'Bahrene');
INSERT INTO `country` (`id`, `name`) VALUES ('BB', 'Barebade');
INSERT INTO `country` (`id`, `name`) VALUES ('BE', 'Belejiki');
INSERT INTO `country` (`id`, `name`) VALUES ('BZ', 'Belize');
INSERT INTO `country` (`id`, `name`) VALUES ('BJ', 'Bene');
INSERT INTO `country` (`id`, `name`) VALUES ('BD', 'Benguladeshi');
INSERT INTO `country` (`id`, `name`) VALUES ('BM', 'Bermuda');
INSERT INTO `country` (`id`, `name`) VALUES ('BG', 'Biligari');
INSERT INTO `country` (`id`, `name`) VALUES ('BN', 'Brineyi');
INSERT INTO `country` (`id`, `name`) VALUES ('BF', 'Bukinafaso');
INSERT INTO `country` (`id`, `name`) VALUES ('BI', 'Burundi');
INSERT INTO `country` (`id`, `name`) VALUES ('BT', 'Butani');
INSERT INTO `country` (`id`, `name`) VALUES ('BY', 'Byelorisi');
INSERT INTO `country` (`id`, `name`) VALUES ('DK', 'Danemalaku');
INSERT INTO `country` (`id`, `name`) VALUES ('CF', 'Ditunga dya Afrika wa munkatshi');
INSERT INTO `country` (`id`, `name`) VALUES ('CZ', 'Ditunga dya Tsheka');
INSERT INTO `country` (`id`, `name`) VALUES ('DO', 'Ditunga wa Duminiku');
INSERT INTO `country` (`id`, `name`) VALUES ('CD', 'Ditunga wa Kongu');
INSERT INTO `country` (`id`, `name`) VALUES ('DJ', 'Djibuti');
INSERT INTO `country` (`id`, `name`) VALUES ('DM', 'Duminiku');
INSERT INTO `country` (`id`, `name`) VALUES ('EC', 'Ekwatele');
INSERT INTO `country` (`id`, `name`) VALUES ('ER', 'Elitele');
INSERT INTO `country` (`id`, `name`) VALUES ('EE', 'Esitoni');
INSERT INTO `country` (`id`, `name`) VALUES ('ET', 'Etshiopi');
INSERT INTO `country` (`id`, `name`) VALUES ('FI', 'Filande');
INSERT INTO `country` (`id`, `name`) VALUES ('FJ', 'Fuji');
INSERT INTO `country` (`id`, `name`) VALUES ('GM', 'Gambi');
INSERT INTO `country` (`id`, `name`) VALUES ('GQ', 'Gine Ekwatele');
INSERT INTO `country` (`id`, `name`) VALUES ('GF', 'Giyane wa Nfalanse');
INSERT INTO `country` (`id`, `name`) VALUES ('IN', 'Inde');
INSERT INTO `country` (`id`, `name`) VALUES ('ID', 'Indonezi');
INSERT INTO `country` (`id`, `name`) VALUES ('IR', 'Ira');
INSERT INTO `country` (`id`, `name`) VALUES ('IQ', 'Iraki');
INSERT INTO `country` (`id`, `name`) VALUES ('IE', 'Irelande');
INSERT INTO `country` (`id`, `name`) VALUES ('UY', 'Irigwei');
INSERT INTO `country` (`id`, `name`) VALUES ('IS', 'Isilande');
INSERT INTO `country` (`id`, `name`) VALUES ('IL', 'Isirayele');
INSERT INTO `country` (`id`, `name`) VALUES ('IT', 'Itali');
INSERT INTO `country` (`id`, `name`) VALUES ('JM', 'Jamaiki');
INSERT INTO `country` (`id`, `name`) VALUES ('JP', 'Japu');
INSERT INTO `country` (`id`, `name`) VALUES ('GI', 'Jibeletale');
INSERT INTO `country` (`id`, `name`) VALUES ('JO', 'Jodani');
INSERT INTO `country` (`id`, `name`) VALUES ('GE', 'Joriji');
INSERT INTO `country` (`id`, `name`) VALUES ('NC', 'Kaledoni wa mumu');
INSERT INTO `country` (`id`, `name`) VALUES ('KH', 'Kambodza');
INSERT INTO `country` (`id`, `name`) VALUES ('CM', 'Kamerune');
INSERT INTO `country` (`id`, `name`) VALUES ('CA', 'Kanada');
INSERT INTO `country` (`id`, `name`) VALUES ('QA', 'Katari');
INSERT INTO `country` (`id`, `name`) VALUES ('KZ', 'Kazakusita');
INSERT INTO `country` (`id`, `name`) VALUES ('KE', 'Kenya');
INSERT INTO `country` (`id`, `name`) VALUES ('KG', 'Kigizisita');
INSERT INTO `country` (`id`, `name`) VALUES ('KI', 'Kiribati');
INSERT INTO `country` (`id`, `name`) VALUES ('CO', 'Kolombi');
INSERT INTO `country` (`id`, `name`) VALUES ('KM', 'Komoru');
INSERT INTO `country` (`id`, `name`) VALUES ('CG', 'Kongu');
INSERT INTO `country` (`id`, `name`) VALUES ('KP', 'Kore wa muulu');
INSERT INTO `country` (`id`, `name`) VALUES ('KR', 'Kore wa mwinshi');
INSERT INTO `country` (`id`, `name`) VALUES ('CR', 'Kositarika');
INSERT INTO `country` (`id`, `name`) VALUES ('CI', 'Kotedivuale');
INSERT INTO `country` (`id`, `name`) VALUES ('KW', 'Koweti');
INSERT INTO `country` (`id`, `name`) VALUES ('HR', 'Krowasi');
INSERT INTO `country` (`id`, `name`) VALUES ('CU', 'Kuba');
INSERT INTO `country` (`id`, `name`) VALUES ('LA', 'Lawosi');
INSERT INTO `country` (`id`, `name`) VALUES ('AE', 'Lemila alabu');
INSERT INTO `country` (`id`, `name`) VALUES ('RE', 'Lenyo');
INSERT INTO `country` (`id`, `name`) VALUES ('LS', 'Lesoto');
INSERT INTO `country` (`id`, `name`) VALUES ('LV', 'Letoni');
INSERT INTO `country` (`id`, `name`) VALUES ('LB', 'Liba');
INSERT INTO `country` (`id`, `name`) VALUES ('LR', 'Liberiya');
INSERT INTO `country` (`id`, `name`) VALUES ('LY', 'Libi');
INSERT INTO `country` (`id`, `name`) VALUES ('LU', 'Likisambulu');
INSERT INTO `country` (`id`, `name`) VALUES ('LI', 'Lishuteni');
INSERT INTO `country` (`id`, `name`) VALUES ('LT', 'Litwani');
INSERT INTO `country` (`id`, `name`) VALUES ('CV', 'Lutanda lua Kapevele');
INSERT INTO `country` (`id`, `name`) VALUES ('KY', 'Lutanda lua Kayima');
INSERT INTO `country` (`id`, `name`) VALUES ('CK', 'Lutanda lua Kookɛ');
INSERT INTO `country` (`id`, `name`) VALUES ('FK', 'Lutanda lua Maluni');
INSERT INTO `country` (`id`, `name`) VALUES ('MP', 'Lutanda lua Mariane wa muulu');
INSERT INTO `country` (`id`, `name`) VALUES ('MH', 'Lutanda lua Marishale');
INSERT INTO `country` (`id`, `name`) VALUES ('NF', 'Lutanda lua Norfok');
INSERT INTO `country` (`id`, `name`) VALUES ('SB', 'Lutanda lua Solomu');
INSERT INTO `country` (`id`, `name`) VALUES ('TC', 'Lutanda lua Tuluki ne Kaiko');
INSERT INTO `country` (`id`, `name`) VALUES ('VI', 'Lutanda lua Vierzi wa Ameriki');
INSERT INTO `country` (`id`, `name`) VALUES ('VG', 'Lutanda lua Vierzi wa Angeletele');
INSERT INTO `country` (`id`, `name`) VALUES ('IO', 'Lutanda lwa Angeletele ku mbu wa Indiya');
INSERT INTO `country` (`id`, `name`) VALUES ('MG', 'Madagasikari');
INSERT INTO `country` (`id`, `name`) VALUES ('MV', 'Madive');
INSERT INTO `country` (`id`, `name`) VALUES ('MW', 'Malawi');
INSERT INTO `country` (`id`, `name`) VALUES ('MY', 'Malezi');
INSERT INTO `country` (`id`, `name`) VALUES ('ML', 'Mali');
INSERT INTO `country` (`id`, `name`) VALUES ('MT', 'Malite');
INSERT INTO `country` (`id`, `name`) VALUES ('MA', 'Maroke');
INSERT INTO `country` (`id`, `name`) VALUES ('MQ', 'Martiniki');
INSERT INTO `country` (`id`, `name`) VALUES ('MK', 'Masedwane');
INSERT INTO `country` (`id`, `name`) VALUES ('YT', 'Mayote');
INSERT INTO `country` (`id`, `name`) VALUES ('BO', 'Mbolivi');
INSERT INTO `country` (`id`, `name`) VALUES ('BA', 'Mbosini ne Hezegovine');
INSERT INTO `country` (`id`, `name`) VALUES ('BW', 'Mbotswana');
INSERT INTO `country` (`id`, `name`) VALUES ('MX', 'Meksike');
INSERT INTO `country` (`id`, `name`) VALUES ('FM', 'Mikronezi');
INSERT INTO `country` (`id`, `name`) VALUES ('BR', 'Mnulezile');
INSERT INTO `country` (`id`, `name`) VALUES ('MD', 'Molidavi');
INSERT INTO `country` (`id`, `name`) VALUES ('MC', 'Monaku');
INSERT INTO `country` (`id`, `name`) VALUES ('MN', 'Mongoli');
INSERT INTO `country` (`id`, `name`) VALUES ('MU', 'Morise');
INSERT INTO `country` (`id`, `name`) VALUES ('MR', 'Moritani');
INSERT INTO `country` (`id`, `name`) VALUES ('MZ', 'Mozambiki');
INSERT INTO `country` (`id`, `name`) VALUES ('PL', 'Mpoloni');
INSERT INTO `country` (`id`, `name`) VALUES ('PR', 'Mpotoriku');
INSERT INTO `country` (`id`, `name`) VALUES ('PT', 'Mputulugeshi');
INSERT INTO `country` (`id`, `name`) VALUES ('MS', 'Musera');
INSERT INTO `country` (`id`, `name`) VALUES ('EG', 'Mushidi');
INSERT INTO `country` (`id`, `name`) VALUES ('MM', 'Myamare');
INSERT INTO `country` (`id`, `name`) VALUES ('NA', 'Namibi');
INSERT INTO `country` (`id`, `name`) VALUES ('NR', 'Nauru');
INSERT INTO `country` (`id`, `name`) VALUES ('NP', 'Nepálɛ');
INSERT INTO `country` (`id`, `name`) VALUES ('FR', 'Nfalanse');
INSERT INTO `country` (`id`, `name`) VALUES ('PH', 'Nfilipi');
INSERT INTO `country` (`id`, `name`) VALUES ('GA', 'Ngabu');
INSERT INTO `country` (`id`, `name`) VALUES ('GH', 'Ngana');
INSERT INTO `country` (`id`, `name`) VALUES ('GR', 'Ngeleka');
INSERT INTO `country` (`id`, `name`) VALUES ('GD', 'Ngelenade');
INSERT INTO `country` (`id`, `name`) VALUES ('GN', 'Ngine');
INSERT INTO `country` (`id`, `name`) VALUES ('GW', 'Nginebisau');
INSERT INTO `country` (`id`, `name`) VALUES ('GY', 'Ngiyane');
INSERT INTO `country` (`id`, `name`) VALUES ('GL', 'Ngowelande');
INSERT INTO `country` (`id`, `name`) VALUES ('GP', 'Ngwadelupe');
INSERT INTO `country` (`id`, `name`) VALUES ('GU', 'Ngwame');
INSERT INTO `country` (`id`, `name`) VALUES ('GT', 'Ngwatemala');
INSERT INTO `country` (`id`, `name`) VALUES ('NE', 'Nijere');
INSERT INTO `country` (`id`, `name`) VALUES ('NG', 'Nijerya');
INSERT INTO `country` (`id`, `name`) VALUES ('NI', 'Nikaragwa');
INSERT INTO `country` (`id`, `name`) VALUES ('NO', 'Noriveje');
INSERT INTO `country` (`id`, `name`) VALUES ('ES', 'Nsipani');
INSERT INTO `country` (`id`, `name`) VALUES ('VA', 'Nvatika');
INSERT INTO `country` (`id`, `name`) VALUES ('NU', 'Nyue');
INSERT INTO `country` (`id`, `name`) VALUES ('NL', 'Olandɛ');
INSERT INTO `country` (`id`, `name`) VALUES ('OM', 'Omane');
INSERT INTO `country` (`id`, `name`) VALUES ('HN', 'Ondurase');
INSERT INTO `country` (`id`, `name`) VALUES ('HU', 'Ongili');
INSERT INTO `country` (`id`, `name`) VALUES ('AU', 'Ositali');
INSERT INTO `country` (`id`, `name`) VALUES ('AT', 'Otilisi');
INSERT INTO `country` (`id`, `name`) VALUES ('PK', 'Pakisita');
INSERT INTO `country` (`id`, `name`) VALUES ('PY', 'Palagwei');
INSERT INTO `country` (`id`, `name`) VALUES ('PW', 'Palau');
INSERT INTO `country` (`id`, `name`) VALUES ('PS', 'Palesine');
INSERT INTO `country` (`id`, `name`) VALUES ('PA', 'Panama');
INSERT INTO `country` (`id`, `name`) VALUES ('PG', 'Papwazi wa Nginɛ wa mumu');
INSERT INTO `country` (`id`, `name`) VALUES ('PE', 'Peru');
INSERT INTO `country` (`id`, `name`) VALUES ('PN', 'Pikairni');
INSERT INTO `country` (`id`, `name`) VALUES ('PF', 'Polinezi wa Nfalanse');
INSERT INTO `country` (`id`, `name`) VALUES ('RU', 'Risi');
INSERT INTO `country` (`id`, `name`) VALUES ('RO', 'Romani');
INSERT INTO `country` (`id`, `name`) VALUES ('RW', 'Rwanda');
INSERT INTO `country` (`id`, `name`) VALUES ('WS', 'Samoa');
INSERT INTO `country` (`id`, `name`) VALUES ('AS', 'Samoa wa Ameriki');
INSERT INTO `country` (`id`, `name`) VALUES ('SM', 'Santu Marine');
INSERT INTO `country` (`id`, `name`) VALUES ('SH', 'Santu eleni');
INSERT INTO `country` (`id`, `name`) VALUES ('KN', 'Santu krístofe ne Neves');
INSERT INTO `country` (`id`, `name`) VALUES ('LC', 'Santu lisi');
INSERT INTO `country` (`id`, `name`) VALUES ('PM', 'Santu pététo ne Mikelu');
INSERT INTO `country` (`id`, `name`) VALUES ('VC', 'Santu vesa ne Ngelenadine');
INSERT INTO `country` (`id`, `name`) VALUES ('ST', 'Sao Tome ne Presipɛ');
INSERT INTO `country` (`id`, `name`) VALUES ('SV', 'Savadore');
INSERT INTO `country` (`id`, `name`) VALUES ('SN', 'Senegale');
INSERT INTO `country` (`id`, `name`) VALUES ('SC', 'Seshele');
INSERT INTO `country` (`id`, `name`) VALUES ('CL', 'Shili');
INSERT INTO `country` (`id`, `name`) VALUES ('CN', 'Shine');
INSERT INTO `country` (`id`, `name`) VALUES ('CY', 'Shipele');
INSERT INTO `country` (`id`, `name`) VALUES ('SL', 'Siera Leone');
INSERT INTO `country` (`id`, `name`) VALUES ('SK', 'Silovaki');
INSERT INTO `country` (`id`, `name`) VALUES ('SI', 'Siloveni');
INSERT INTO `country` (`id`, `name`) VALUES ('SG', 'Singapure');
INSERT INTO `country` (`id`, `name`) VALUES ('SY', 'Siri');
INSERT INTO `country` (`id`, `name`) VALUES ('LK', 'Sirilanka');
INSERT INTO `country` (`id`, `name`) VALUES ('SO', 'Somali');
INSERT INTO `country` (`id`, `name`) VALUES ('SD', 'Suda');
INSERT INTO `country` (`id`, `name`) VALUES ('SR', 'Suriname');
INSERT INTO `country` (`id`, `name`) VALUES ('SE', 'Suwedi');
INSERT INTO `country` (`id`, `name`) VALUES ('SZ', 'Swazilandi');
INSERT INTO `country` (`id`, `name`) VALUES ('CH', 'Swise');
INSERT INTO `country` (`id`, `name`) VALUES ('TW', 'Taiwani');
INSERT INTO `country` (`id`, `name`) VALUES ('TZ', 'Tanzani');
INSERT INTO `country` (`id`, `name`) VALUES ('TH', 'Tayilanda');
INSERT INTO `country` (`id`, `name`) VALUES ('TJ', 'Tazikisita');
INSERT INTO `country` (`id`, `name`) VALUES ('TL', 'Timoru wa diboku');
INSERT INTO `country` (`id`, `name`) VALUES ('TT', 'Tinidade ne Tobago');
INSERT INTO `country` (`id`, `name`) VALUES ('TN', 'Tinizi');
INSERT INTO `country` (`id`, `name`) VALUES ('TG', 'Togu');
INSERT INTO `country` (`id`, `name`) VALUES ('TK', 'Tokelau');
INSERT INTO `country` (`id`, `name`) VALUES ('TO', 'Tonga');
INSERT INTO `country` (`id`, `name`) VALUES ('TD', 'Tshadi');
INSERT INTO `country` (`id`, `name`) VALUES ('TM', 'Tukemenisita');
INSERT INTO `country` (`id`, `name`) VALUES ('TR', 'Tuluki');
INSERT INTO `country` (`id`, `name`) VALUES ('TV', 'Tuvalu');
INSERT INTO `country` (`id`, `name`) VALUES ('UG', 'Uganda');
INSERT INTO `country` (`id`, `name`) VALUES ('UA', 'Ukreni');
INSERT INTO `country` (`id`, `name`) VALUES ('UZ', 'Uzibekisita');
INSERT INTO `country` (`id`, `name`) VALUES ('VU', 'Vanuatu');
INSERT INTO `country` (`id`, `name`) VALUES ('VE', 'Venezuela');
INSERT INTO `country` (`id`, `name`) VALUES ('VN', 'Viyetiname');
INSERT INTO `country` (`id`, `name`) VALUES ('WF', 'Walise ne Futuna');
INSERT INTO `country` (`id`, `name`) VALUES ('YE', 'Yemenu');
INSERT INTO `country` (`id`, `name`) VALUES ('ZM', 'Zambi');
INSERT INTO `country` (`id`, `name`) VALUES ('NZ', 'Zelanda wa mumu');
INSERT INTO `country` (`id`, `name`) VALUES ('ZW', 'Zimbabwe');

redpajama_set_name: RedPajamaGithub


text:
package com.borqs.server.market.deploy;

import com.borqs.server.market.utils.DateTimeUtils;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;

public class MarketDispatcherServlet extends DispatcherServlet {
    public static final long loadedAt = DateTimeUtils.nowMillis();

    public MarketDispatcherServlet() {
    }

    public MarketDispatcherServlet(WebApplicationContext webApplicationContext) {
        super(webApplicationContext);
    }

}


text:
<?php

/**
 * Class TribeEventsImporter_FileUploader
 */
class TribeEventsImporter_FileUploader {
	private $name = '';
	private $type = '';
	private $tmp_name = '';
	private $error = 0;
	private $size = 0;

	public function __construct( $file_array ) {
		$this->name = $file_array['name'];
		$this->type = $file_array['type'];
		$this->tmp_name = $file_array['tmp_name'];
		$this->error = $file_array['error'];
		$this->size = $file_array['size'];
	}

	public function save_file() {
		$this->validate_temporary_file();
		$this->permanently_save_file();
	}

	private function validate_temporary_file() {
		if ( !file_exists($this->tmp_name) ) {
			throw new RuntimeException( sprintf(__('Temporary file not found. Could not save %s.', 'tribe-events-calendar'), $this->name));
		}
	}

	private function permanently_save_file() {
		self::clear_old_files();
		$moved = move_uploaded_file( $this->tmp_name, self::get_file_path() );
		if ( !$moved ) {
			throw new RuntimeException( sprintf(__('Could not save %s.', 'tribe-events-calendar'), $this->name));
		}
	}

	public static function clear_old_files() {
		$path = self::get_file_path();
		if ( file_exists($path) ) {
			unlink($path);
		}

		$dir = self::get_upload_directory();
		rmdir($dir);
	}

	public static function get_file_path() {
		$path = trailingslashit(self::get_upload_directory());
		$path .= 'tribe-import.csv';
		return $path;
	}

	private static function get_upload_directory() {
		$upload_dir_array = wp_upload_dir();
		$path = $upload_dir_array['basedir'];
		$path = trailingslashit($path).'tribe-importer';
		wp_mkdir_p($path);
		return $path;
	}
}


text:
package com.jukusoft.libgdx.rpg.game.server.handler;

import com.jukusoft.libgdx.rpg.game.server.listener.ConnectionClosedListener;
import com.jukusoft.libgdx.rpg.game.server.listener.ConnectionInitListener;
import com.jukusoft.libgdx.rpg.network.channel.ChannelAttributes;
import com.jukusoft.libgdx.rpg.network.channel.ChannelAttributesManager;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

import java.util.concurrent.atomic.AtomicLong;

/**
 * Created by Justin on 22.03.2017.
 */
public class InitHandler extends ChannelInboundHandlerAdapter {

    protected int receivedMessages = 0;

    //connection ID
    protected AtomicLong connID = new AtomicLong(0);

    protected ConnectionClosedListener closedListener = null;
    protected ConnectionInitListener initListener = null;

    protected ChannelAttributesManager channelAttributesManager = null;
    protected ChannelAttributes channelAttributes = null;

    protected boolean isInitialized = false;

    public InitHandler (long connID, ChannelAttributesManager channelAttributesManager, ConnectionInitListener initListener) {
        this.connID.set(connID);
        this.initListener = initListener;

        //get channel attributes
        this.channelAttributesManager = channelAttributesManager;
        this.channelAttributes = channelAttributesManager.getAttributes(connID);
    }

    public void setClosedListener (ConnectionClosedListener closedListener) {
        this.closedListener = closedListener;
    }

    public void channelRegistered(ChannelHandlerContext ctx) throws Exception {
        //ctx.

        super.channelRegistered(ctx);
    }

    public void channelUnregistered(ChannelHandlerContext ctx) throws Exception {
        //remove channel attributes
        this.channelAttributesManager.removeChannel(connID.get());

        super.channelUnregistered(ctx);
    }

    public void channelActive(ChannelHandlerContext ctx) throws Exception {
        if (!isInitialized) {
            //set channel opened timestamp
            this.channelAttributes.put("channel_opened_timestamp", System.currentTimeMillis());

            //call initialization listener
            initListener.onConnectinInit(connID.get(), ctx);
        }

        super.channelActive(ctx);
    }

    public void channelInactive(ChannelHandlerContext ctx) throws Exception {
        super.channelInactive(ctx);
    }

    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        this.receivedMessages++;

        super.channelRead(ctx, msg);
    }

    public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
        super.channelReadComplete(ctx);
    }

    public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
        super.userEventTriggered(ctx, evt);
    }

    public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception {
        super.channelWritabilityChanged(ctx);
    }

    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
        if (cause.getLocalizedMessage().contains("Eine vorhandene Verbindung wurde vom Remotehost geschlossen")) {
            System.out.println("connection closed (ID: " + connID + ").");

            //logout user
            channelAttributes.logout();

            if (this.closedListener != null) {
                //call listener
                this.closedListener.onConnectionClosed(this.connID.get(), ctx);
            }
        } else {
            System.out.println("InitHandler: exception caught.");
            cause.printStackTrace();
        }
    }

    public long getConnectionID () {
        return this.connID.get();
    }

}


text:
import _ from 'underscore';
import FS from 'q-io/fs';
import FSSync from 'fs';
import Highlight from 'highlight.js';

import Board from '../boards/board';
import config from '../helpers/config';
import FSWatcher from '../helpers/fs-watcher';
import * as Tools from '../helpers/tools';
import markup from '../markup';

let langNames = FSWatcher.createWatchedResource(`${__dirname}/../../misc/lang-names.json`, (path) => {
  return require(path);
}, async function(path) {
  let data = await FS.read(path);
  langNames = JSON.parse(data);
}) || {};

function filterNotFoundImageFileNames(fileName) {
  return '.gitignore' !== fileName;
}

let notFoundImageFileNames = FSWatcher.createWatchedResource(`${__dirname}/../../public/img/404`, (path) => {
  return FSSync.readdirSync(path).filter(filterNotFoundImageFileNames);
}, async function(path) {
  let fileNames = await FS.list(path);
  return fileNames.filter(filterNotFoundImageFileNames);
}) || [];

export function base() {
  let Captcha = Tools.requireWrapper(require('../captchas/captcha'));
  return {
    site: {
      protocol: config('site.protocol'),
      domain: config('site.domain'),
      pathPrefix: config('site.pathPrefix'),
      locale: config('site.locale'),
      dateFormat: config('site.dateFormat'),
      timeOffset: config('site.timeOffset'),
      twitter: { integrationEnabled: !!config('site.twitter.integrationEnabled') },
      vkontakte: {
        integrationEnabled: !!config('site.vkontakte.integrationEnabled'),
        appId: config('site.vkontakte.appId')
      },
      ws: { transports: config('site.ws.transports') }
    },
    styles: Tools.STYLES,
    codeStyles: Tools.CODE_STYLES,
    availableCodeLangs: Highlight.listLanguages().map((lang) => {
      return {
        id: lang,
        name: langNames[lang] || lang
      };
    }),
    maxSearchQueryLength: config('site.maxSearchQueryLength'),
    markupModes: [{
      name: 'NONE',
      title: Tools.translate('No markup', 'markupMode')
    }, {
      name: markup.EXTENDED_WAKABA_MARK,
      title: Tools.translate('Extended WakabaMark only', 'markupMode')
    }, {
      name: markup.BB_CODE,
      title: Tools.translate('bbCode only', 'markupMode')
    }, {
      name: (markup.EXTENDED_WAKABA_MARK + ',' + markup.BB_CODE),
      title: Tools.translate('Extended WakabaMark and bbCode', 'markupMode')
    }],
    supportedCaptchaEngines: Captcha.captchaIDs().filter((id) => {
      return 'node-captcha-noscript' !== id;
    }).map(id => Captcha.captcha(id).info())
  };
}

function sort(x1, x2) {
  if (!x1.priority && !x2.priority) {
    return x1.name.localeCompare(x2.name);
  }
  return (x1.priority || 0) - (x2.priority || 0);
}

export function boards() {
  let boards = Board.boardNames().map(boardName => Board.board(boardName).info());
  let addDefault = false;
  let boardGroups = _(config('boardGroups', {})).map((group, name) => {
    group.name = name;
    group.boards = boards.reduce((acc, board) => {
      if (!board.groupName) {
        addDefault = true;
      } else if (name === board.groupName) {
        acc.push(board);
      }
      return acc;
    }, []);
    return group;
  });
  if (addDefault || boardGroups.length < 1) {
    let noGroups = (boardGroups.length < 1);
    boardGroups.push({
      name: '',
      boards: boards.filter((board) => { return noGroups || (!board.hidden && !board.groupName); })
    });
  }
  boardGroups = boardGroups.filter((group) => { return group.boards.length > 0; });
  boardGroups.sort(sort);
  boardGroups.forEach((group) => { group.boards.sort(sort); });
  return {
    boards: boards,
    boardGroups: boardGroups
  };
}

export function board(brd) {
  if (typeof brd === 'string') {
    brd = Board.board(brd);
  }
  return brd ? { board: brd.info() } : null;
}

export function translations() {
  return { tr: Tools.translate.translations };
}

export function notFoundImageFileNames() {
  return notFoundImageFileNames;
}

export function codeLangNames() {
  return langNames;
}


text:
Directory

Directory


text:
namespace Castle.DynamicProxy.Contributors
{
	using System;
	using System.Collections.Generic;
	using System.Diagnostics;

	using Castle.DynamicProxy.Generators;
	using Castle.DynamicProxy.Generators.Emitters;

	public class InterfaceProxyWithoutTargetContributor : CompositeTypeContributor
	{
		private readonly GetTargetExpressionDelegate getTargetExpression;

		public InterfaceProxyWithoutTargetContributor(INamingScope namingScope, GetTargetExpressionDelegate getTarget)
			: base(namingScope)
		{
			getTargetExpression = getTarget;
		}

		protected override IEnumerable<MembersCollector> CollectElementsToProxyInternal(IProxyGenerationHook hook)
		{
			Debug.Assert(hook != null, "hook != null");
			foreach (var @interface in interfaces)
			{
				var item = new InterfaceMembersCollector(@interface);
				item.CollectMembersToProxy(hook);
				yield return item;
			}
		}

		protected override MethodGenerator GetMethodGenerator(MetaMethod method, ClassEmitter @class,
		                                                      ProxyGenerationOptions options,
		                                                      OverrideMethodDelegate overrideMethod)
		{
			if (!method.Proxyable)
			{
				return new MinimialisticMethodGenerator(method, overrideMethod);
			}

			var invocation = GetInvocationType(method, @class, options);
			return new MethodWithInvocationGenerator(method,
			                                         @class.GetField("__interceptors"),
			                                         invocation,
			                                         getTargetExpression,
			                                         overrideMethod,
			                                         null);
		}

		private Type GetInvocationType(MetaMethod method, ClassEmitter emitter, ProxyGenerationOptions options)
		{
			var scope = emitter.ModuleScope;
			var key = new CacheKey(method.Method, CompositionInvocationTypeGenerator.BaseType, null, null);

			// no locking required as we're already within a lock
			var invocation = scope.GetFromCache(key);
			if (invocation != null)
			{
				return invocation;
			}

			invocation = new CompositionInvocationTypeGenerator(method.Method.DeclaringType,
			                                                    method,
			                                                    method.Method,
			                                                    false,
			                                                    null)
				.Generate(emitter, options, namingScope)
				.BuildType();

			scope.RegisterInCache(key, invocation);

			return invocation;
		}
	}
}


text:
package gov.nih.nci.evs.browser.utils;

/*
 * Copyright: (c) 2004-2009 Mayo Foundation for Medical Education and
 * Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the
 * triple-shield Mayo logo are trademarks and service marks of MFMER.
 *
 * Except as contained in the copyright notice above, or as used to identify
 * MFMER as the author of this software, the trade names, trademarks, service
 * marks, or product names of the copyright holder shall not be used in
 * advertising, promotion or otherwise in connection with this software without
 * prior written authorization of the copyright holder.
 *
 * Licensed under the Eclipse Public License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.eclipse.org/legal/epl-v10.html
 *
 */

/**
  * @author EVS Team
  * @version 1.0
  *
  * Note: This class is created based on Mayo's BuildTreForCode.java sample code
  *
  * Modification history
  *     Initial modification kim.ong@ngc.com
  *
 */

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.Vector;

import org.LexGrid.LexBIG.DataModel.Collections.AssociatedConceptList;
import org.LexGrid.LexBIG.DataModel.Collections.AssociationList;
import org.LexGrid.LexBIG.DataModel.Collections.LocalNameList;
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList;
import org.LexGrid.LexBIG.DataModel.Core.AssociatedConcept;
import org.LexGrid.LexBIG.DataModel.Core.Association;
import org.LexGrid.LexBIG.DataModel.Core.CodingSchemeSummary;
import org.LexGrid.LexBIG.DataModel.Core.CodingSchemeVersionOrTag;
import org.LexGrid.LexBIG.DataModel.Core.ConceptReference;
import org.LexGrid.LexBIG.DataModel.Core.ResolvedConceptReference;
import org.LexGrid.LexBIG.Exceptions.LBException;
import org.LexGrid.LexBIG.Exceptions.LBResourceUnavailableException;
import org.LexGrid.LexBIG.Extensions.Generic.LexBIGServiceConvenienceMethods;
import org.LexGrid.LexBIG.Extensions.Generic.LexBIGServiceConvenienceMethods.HierarchyPathResolveOption;
import org.LexGrid.LexBIG.Impl.LexBIGServiceImpl;
import org.LexGrid.LexBIG.LexBIGService.CodedNodeGraph;
import org.LexGrid.LexBIG.LexBIGService.CodedNodeSet;
import org.LexGrid.LexBIG.LexBIGService.LexBIGService;
import org.LexGrid.LexBIG.Utility.Constructors;
import org.LexGrid.codingSchemes.CodingScheme;
import org.LexGrid.commonTypes.EntityDescription;
import org.LexGrid.naming.SupportedHierarchy;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;

import org.LexGrid.codingSchemes.Mappings;

/**
 * Attempts to provide a tree, based on a focus code, that includes the
 * following information:
 *

 * - All paths from the hierarchy root to one or more focus codes.
 * - Immediate children of every node in path to root
 * - Indicator to show whether any unexpanded node can be further expanded
 *

 *
 * This example accepts two parameters...
 * The first parameter is required, and must contain at least one code
 * in a comma-delimited list. A tree is produced for each code. Time to
 * produce the tree for each code is printed in milliseconds. In order
 * to factor out costs of startup and shutdown, resolving multiple
 * codes may offer a better overall estimate performance.
 *
 * The second parameter is optional, and can indicate a hierarchy ID to
 * navigate when resolving child nodes. If not provided, "is_a" is
 * assumed.
 */
public class TreeUtils {
    private static Logger _logger = Logger.getLogger(TreeUtils.class);
    LocalNameList noopList_ = Constructors.createLocalNameList("_noop_");

    public TreeUtils() {

    }

    /**
     * Prints the tree for an individual code.
     */

    public HashMap getTreePathData(String scheme, String version, String hierarchyID, String code) throws LBException {
		LexBIGService lbsvc = RemoteServerUtil.createLexBIGService();
		LexBIGServiceConvenienceMethods lbscm = (LexBIGServiceConvenienceMethods) lbsvc
				.getGenericExtension("LexBIGServiceConvenienceMethods");
		lbscm.setLexBIGService(lbsvc);
		if (hierarchyID == null) hierarchyID = "is_a";
		CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
		if (version != null) csvt.setVersion(version);
		SupportedHierarchy hierarchyDefn = getSupportedHierarchy(lbsvc, scheme, csvt, hierarchyID);
 		return getTreePathData(lbsvc, lbscm, scheme, csvt, hierarchyDefn, code);
    }

    public HashMap getTreePathData(LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm, String scheme,
            CodingSchemeVersionOrTag csvt, SupportedHierarchy hierarchyDefn, String focusCode) throws LBException {
        HashMap hmap = new HashMap();
        TreeItem ti = new TreeItem("<Root>", "Root node");
        long ms = System.currentTimeMillis();
        int pathsResolved = 0;
        try {

            // Resolve 'is_a' hierarchy info. This example will
            // need to make some calls outside of what is covered
            // by existing convenience methods, but we use the
            // registered hierarchy to prevent need to hard code
            // relationship and direction info used on lookup ...
            String hierarchyID = hierarchyDefn.getLocalId();
            String[] associationsToNavigate = hierarchyDefn.getAssociationIds();
            boolean associationsNavigatedFwd = hierarchyDefn.getIsForwardNavigable();

            // Identify the set of all codes on path from root
            // to the focus code ...
            Map<String, EntityDescription> codesToDescriptions = new HashMap<String, EntityDescription>();
            AssociationList pathsFromRoot = getPathsFromRoot(lbsvc, lbscm, scheme, csvt, hierarchyID, focusCode,
                    codesToDescriptions);

            // Typically there will be one path, but handle multiple just in
            // case.  Each path from root provides a 'backbone', from focus
            // code to root, for additional nodes to hang off of in our
            // printout. For every backbone node, one level of children is
            // printed, along with an indication of whether those nodes can
            // be expanded.
            for (Iterator<Association> paths = pathsFromRoot.iterateAssociation(); paths.hasNext();) {
                addPathFromRoot(ti, lbsvc, lbscm, scheme, csvt, paths.next(), associationsToNavigate, associationsNavigatedFwd,
                        codesToDescriptions);
                pathsResolved++;
            }

        } finally {
            _logger.debug("Run time (milliseconds): " + (System.currentTimeMillis() - ms) +
                " to resolve " + pathsResolved + " paths from root.");
        }

        hmap.put(focusCode, ti);

        // Print the result ..
        return hmap;

    }

    public void run(String scheme, String version, String hierarchyId, String focusCode) throws LBException {
        HashMap hmap = getTreePathData(scheme, version, hierarchyId, focusCode);
        Set keyset = hmap.keySet();
        Object[] objs = keyset.toArray();
        String code = (String) objs[0];
        TreeItem ti = (TreeItem) hmap.get(code);
        printTree(ti, focusCode, 0);
    }

    public void printTree(HashMap hmap) {
        Object[] objs = hmap.keySet().toArray();
        String code = (String) objs[0];
        TreeItem ti = (TreeItem) hmap.get(code);
        printTree(ti, code, 0);
	}

    /**
     * The given path represents a multi-tier association with associated
     * concepts and targets.  This method expands the association content
     * and adds results to the given tree item, recursing as necessary to
     * process each level in the path.
     *

     * Nodes in the association acts as the backbone for the display.
     * For each backbone node, additional children are resolved one level
     * deep along with an indication of further expandability.
     */
    protected void addPathFromRoot(TreeItem ti,
            LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm,
            String scheme, CodingSchemeVersionOrTag csvt,
            Association path, String[] associationsToNavigate, boolean associationsNavigatedFwd,
            Map<String, EntityDescription> codesToDescriptions)
        throws LBException {

        // First, add the branch point from the path ...
        ConceptReference branchRoot = path.getAssociationReference();
        String branchCode = branchRoot.getConceptCode();
        String branchCodeDescription = codesToDescriptions.containsKey(branchCode) ? codesToDescriptions
                .get(branchCode).getContent() : getCodeDescription(lbsvc, scheme, csvt, branchCode);

        TreeItem branchPoint = new TreeItem(branchCode, branchCodeDescription);
        String branchNavText = getDirectionalLabel(lbscm, scheme, csvt, path, associationsNavigatedFwd);

        // Now process elements in the branch ...
        AssociatedConceptList concepts = path.getAssociatedConcepts();
        for (int i = 0; i < concepts.getAssociatedConceptCount(); i++) {

            // Add all immediate leafs in the branch, and indication of
            // sub-nodes. Do not process codes already in the backbone here;
            // they will be printed in the recursive call ...
            AssociatedConcept concept = concepts.getAssociatedConcept(i);
            String code = concept.getConceptCode();
            TreeItem branchItem = new TreeItem(code, getCodeDescription(concept));
            branchPoint.addChild(branchNavText, branchItem);

            addChildren(branchItem, lbsvc, lbscm, scheme, csvt, code, codesToDescriptions.keySet(),
                    associationsToNavigate, associationsNavigatedFwd);

            // Recurse to process the remainder of the backbone ...
            AssociationList nextLevel = concept.getSourceOf();
            if (nextLevel != null) {
                if (nextLevel.getAssociationCount() != 0) {
                    // More levels left to process ...
                    for (int j = 0; j < nextLevel.getAssociationCount(); j++)
                        addPathFromRoot(branchPoint, lbsvc, lbscm, scheme, csvt, nextLevel.getAssociation(j), associationsToNavigate,
                                associationsNavigatedFwd, codesToDescriptions);
                } else {
                    // End of the line ...
                    // Always add immediate children ot the focus code.
                    addChildren(branchItem, lbsvc, lbscm, scheme,
                        csvt, concept.getConceptCode(), Collections.EMPTY_SET,
                        associationsToNavigate, associationsNavigatedFwd);
                }
            }
        }

        // Add the populated tree item to those tracked from root.
        ti.addChild(branchNavText, branchPoint);
    }

    /**
     * Populate child nodes for a single branch of the tree,
     * and indicates whether further expansion (to grandchildren)
     * is possible.
     */
    protected void addChildren(TreeItem ti,
            LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm,
            String scheme, CodingSchemeVersionOrTag csvt,
            String branchRootCode, Set<String> codesToExclude, String[] associationsToNavigate,
            boolean associationsNavigatedFwd)
        throws LBException {

        // Resolve the next branch, representing children of the given
        // code, navigated according to the provided relationship and
        // direction.  Resolve the children as a code graph, looking 2
        // levels deep but leaving the final level unresolved.
        CodedNodeGraph cng = lbsvc.getNodeGraph(scheme, csvt, null);
        ConceptReference focus = Constructors.createConceptReference(branchRootCode, scheme);
        cng = cng.restrictToAssociations(Constructors.createNameAndValueList(associationsToNavigate), null);
/*
        ResolvedConceptReferenceList branch = cng.resolveAsList(focus, associationsNavigatedFwd,
                !associationsNavigatedFwd, -1, 2, noopList_, null, null, null, -1, true);
*/
        // to be reversed after loading the patch
        ResolvedConceptReferenceList branch = cng.resolveAsList(focus, associationsNavigatedFwd,
                !associationsNavigatedFwd, -1, 2, noopList_, null, null, null, -1, false);

        // The resolved branch will be represented by the first node in
        // the resolved list.  The node will be subdivided by source or
        // target associations (depending on direction). The associated
        // nodes define the children.
        for (Iterator<ResolvedConceptReference> nodes = branch.iterateResolvedConceptReference(); nodes.hasNext();) {
            ResolvedConceptReference node = nodes.next();
            AssociationList childAssociationList = associationsNavigatedFwd ? node.getSourceOf() : node.getTargetOf();

            // Process each association defining children ...
            for (Iterator<Association> pathsToChildren = childAssociationList.iterateAssociation(); pathsToChildren.hasNext();) {
                Association child = pathsToChildren.next();
                String childNavText = getDirectionalLabel(lbscm, scheme, csvt, child, associationsNavigatedFwd);

                // Each association may have multiple children ...
                AssociatedConceptList branchItemList = child.getAssociatedConcepts();
                for (Iterator<AssociatedConcept> branchNodes = branchItemList.iterateAssociatedConcept(); branchNodes
                        .hasNext();) {
                    AssociatedConcept branchItemNode = branchNodes.next();
                    String branchItemCode = branchItemNode.getConceptCode();

                    // Add here if not in the list of excluded codes.
                    // This is also where we look to see if another level
                    // was indicated to be available.  If so, mark the
                    // entry with a '+' to indicate it can be expanded.
                    if (!codesToExclude.contains(branchItemCode)) {
                        TreeItem childItem = new TreeItem(branchItemCode, getCodeDescription(branchItemNode));
                        AssociationList grandchildBranch =
                            associationsNavigatedFwd
                                ? branchItemNode.getSourceOf()
                                : branchItemNode.getTargetOf();
                        if (grandchildBranch != null)
                            childItem.expandable = true;
                        ti.addChild(childNavText, childItem);
                    }
                }
            }
        }
    }

    /**
     * Prints the given tree item, recursing through all branches.
     * @param ti
     */

    protected void printTree(TreeItem ti, String focusCode, int depth) {
        StringBuffer indent = new StringBuffer();
        for (int i = 0; i < depth * 2; i++)
            indent.append("| ");

        StringBuffer codeAndText = new StringBuffer(indent)
            .append(focusCode.equals(ti.code) ? ">>>>" : "")
            .append(ti.code).append(':')
            .append(ti.text.length() > 64 ? ti.text.substring(0, 62) + "..." : ti.text)
            .append(ti.expandable ? " [+]" : "");
        _logger.debug(codeAndText.toString());

        indent.append("| ");
        for (String association : ti.assocToChildMap.keySet()) {
            _logger.debug(indent.toString() + association);
            List<TreeItem> children = ti.assocToChildMap.get(association);
            Collections.sort(children);
            for (TreeItem childItem : children)
                printTree(childItem, focusCode, depth + 1);
        }
    }

    ///////////////////////////////////////////////////////
    // Helper Methods
    ///////////////////////////////////////////////////////

    /**
     * Returns the entity description for the given code.
     */
    protected String getCodeDescription(LexBIGService lbsvc, String scheme, CodingSchemeVersionOrTag csvt, String code)
            throws LBException {

        CodedNodeSet cns = lbsvc.getCodingSchemeConcepts(scheme, csvt);
        cns = cns.restrictToCodes(Constructors.createConceptReferenceList(code, scheme));
        ResolvedConceptReferenceList rcrl = cns.resolveToList(null, noopList_, null, 1);
        if (rcrl.getResolvedConceptReferenceCount() > 0) {
            EntityDescription desc = rcrl.getResolvedConceptReference(0).getEntityDescription();
            if (desc != null)
                return desc.getContent();
        }
        return "<Not assigned>";
    }

    /**
     * Returns the entity description for the given resolved concept reference.
     */
    protected String getCodeDescription(ResolvedConceptReference ref) throws LBException {
        EntityDescription desc = ref.getEntityDescription();
        if (desc != null)
            return desc.getContent();
        return "<Not assigned>";
    }

	public static boolean isBlank(String str) {
		if ((str == null) || str.matches("^\\s*$")) {
		    return true;
		} else {
			return false;
	    }
	}

    /**
     * Returns the label to display for the given association and directional
     * indicator.
     */
    protected String getDirectionalLabel(LexBIGServiceConvenienceMethods lbscm,
            String scheme, CodingSchemeVersionOrTag csvt,
            Association assoc, boolean navigatedFwd)
        throws LBException {

        String assocLabel = navigatedFwd
            ? lbscm.getAssociationForwardName(assoc.getAssociationName(), scheme, csvt)
            : lbscm.getAssociationReverseName(assoc.getAssociationName(), scheme, csvt);
        //if (StringUtils.isBlank(assocLabel))
        if (isBlank(assocLabel))
            assocLabel = (navigatedFwd ? "" : "[Inverse]") + assoc.getAssociationName();
        return assocLabel;
    }

    /**
     * Resolves one or more paths from the hierarchy root to the given code
     * through a list of connected associations defined by the hierarchy.
     */
    protected AssociationList getPathsFromRoot(LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm,
            String scheme, CodingSchemeVersionOrTag csvt, String hierarchyID, String focusCode,
            Map<String, EntityDescription> codesToDescriptions) throws LBException {

        // Get paths from the focus code to the root from the
        // convenience method.  All paths are resolved.  If only
        // one path is required, it would be possible to use
        // HierarchyPathResolveOption.ONE to reduce processing
        // and improve overall performance.
        AssociationList pathToRoot = lbscm.getHierarchyPathToRoot(scheme, csvt, null, focusCode, false,
                HierarchyPathResolveOption.ALL, null);

        // But for purposes of this example we need to display info
        // in order coming from root direction. Process the paths to root
        // recursively to reverse the order for processing ...
        AssociationList pathFromRoot = new AssociationList();
        for (int i = pathToRoot.getAssociationCount() - 1; i >= 0; i--)
            reverseAssoc(lbsvc, lbscm, scheme, csvt, pathToRoot.getAssociation(i), pathFromRoot, codesToDescriptions);

        return pathFromRoot;
    }

    /**
     * Returns a description of the hierarchy defined by the given coding
     * scheme and matching the specified ID.
     */
    protected static SupportedHierarchy getSupportedHierarchy(LexBIGService lbsvc, String scheme,
            CodingSchemeVersionOrTag csvt, String hierarchyID) throws LBException {

        CodingScheme cs = lbsvc.resolveCodingScheme(scheme, csvt);
        if (cs == null) {
            throw new LBResourceUnavailableException("Coding scheme not found: " + scheme);
        }
        for (SupportedHierarchy h : cs.getMappings().getSupportedHierarchy())
            if (h.getLocalId().equals(hierarchyID))
                return h;
        throw new LBResourceUnavailableException("Hierarchy not defined: " + hierarchyID);
    }

    /**
     * Recursive call to reverse order of the given association list, adding
     * results to the given list. In context of this program we use this
     * technique to determine the path from root, starting from the path to root
     * provided by the standard convenience method.
     */
    protected AssociationList reverseAssoc(LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm, String scheme,
            CodingSchemeVersionOrTag csvt, Association assoc, AssociationList addTo,
            Map<String, EntityDescription> codeToEntityDescriptionMap) throws LBException {

        ConceptReference acRef = assoc.getAssociationReference();
        AssociatedConcept acFromRef = new AssociatedConcept();
        acFromRef.setCodingScheme(acRef.getCodingScheme());
        acFromRef.setConceptCode(acRef.getConceptCode());
        AssociationList acSources = new AssociationList();
        acFromRef.setIsNavigable(Boolean.TRUE);
        acFromRef.setSourceOf(acSources);

        // Use cached description if available (should be cached
        // for all but original root) ...
        if (codeToEntityDescriptionMap.containsKey(acRef.getConceptCode()))
            acFromRef.setEntityDescription(codeToEntityDescriptionMap.get(acRef.getConceptCode()));
        // Otherwise retrieve on demand ...
        else
            acFromRef.setEntityDescription(Constructors.createEntityDescription(getCodeDescription(lbsvc, scheme, csvt,
                    acRef.getConceptCode())));

        AssociatedConceptList acl = assoc.getAssociatedConcepts();
        for (AssociatedConcept ac : acl.getAssociatedConcept()) {
            // Create reverse association (same non-directional name)
            Association rAssoc = new Association();
            rAssoc.setAssociationName(assoc.getAssociationName());

            // On reverse, old associated concept is new reference point.
            ConceptReference ref = new ConceptReference();
            ref.setCodingScheme(ac.getCodingScheme());
            ref.setConceptCode(ac.getConceptCode());
            rAssoc.setAssociationReference(ref);

            // And old reference is new associated concept.
            AssociatedConceptList rAcl = new AssociatedConceptList();
            rAcl.addAssociatedConcept(acFromRef);
            rAssoc.setAssociatedConcepts(rAcl);

            // Set reverse directional name, if available.
            String dirName = assoc.getDirectionalName();
            if (dirName != null)
                try {
                    rAssoc.setDirectionalName(lbscm.isForwardName(scheme, csvt, dirName) ? lbscm
                            .getAssociationReverseName(assoc.getAssociationName(), scheme, csvt) : lbscm
                            .getAssociationReverseName(assoc.getAssociationName(), scheme, csvt));
                } catch (LBException e) {
                }

            // Save code desc for future reference when setting up
            // concept references in recursive calls ...
            codeToEntityDescriptionMap.put(ac.getConceptCode(), ac.getEntityDescription());

            AssociationList sourceOf = ac.getSourceOf();
            if (sourceOf != null)
                for (Association sourceAssoc : sourceOf.getAssociation()) {
                    AssociationList pos = reverseAssoc(lbsvc, lbscm, scheme, csvt, sourceAssoc, addTo,
                            codeToEntityDescriptionMap);
                    pos.addAssociation(rAssoc);
                }
            else
                addTo.addAssociation(rAssoc);
        }
        return acSources;
    }

    ///////////////////////////////////////////////////////
    // Helper classes
    ///////////////////////////////////////////////////////

    /**
     * Inner class to hold tree items for printout.
     */
    public class TreeItem implements Comparable<TreeItem> {
        public String code = null;
        public String text = null;
        public boolean expandable = false;
        public Map<String, List<TreeItem>> assocToChildMap = new TreeMap<String, List<TreeItem>>();
        public boolean equals(Object o) {
            return o instanceof TreeItem
                && code.compareTo(((TreeItem) o).code) == 0;
        }
        public int compareTo(TreeItem ti) {
            String c1 = code;
            String c2 = ti.code;
            if (c1.startsWith("@")) return 1;
            if (c2.startsWith("@")) return -1;
            return c1.compareTo(c2);
        }
        public TreeItem(String code, String text) {
            super();
            this.code = code;
            this.text = text;
        }
        public void addAll(String assocText, List<TreeItem> children) {
            for (TreeItem item : children)
                addChild(assocText, item);
        }
        public void addChild(String assocText, TreeItem child) {
            List<TreeItem> children = assocToChildMap.get(assocText);
            if (children == null) {
                children = new ArrayList<TreeItem>();
                assocToChildMap.put(assocText, children);
            }
            int i;
            if ((i = children.indexOf(child)) >= 0) {
                TreeItem existingTreeItem = children.get(i);
                for (String assoc : child.assocToChildMap.keySet()) {
                    List<TreeItem> toAdd = child.assocToChildMap.get(assoc);
                    if (!toAdd.isEmpty()) {
                        existingTreeItem.addAll(assoc, toAdd);
                        existingTreeItem.expandable = false;
                    }
                }
            } else
                children.add(child);
        }
    }

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    public Vector getHierarchyAssociationId(String scheme, String version) {

		Vector association_vec = new Vector();
		try {
			LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();

            // Will handle secured ontologies later.
            CodingSchemeVersionOrTag versionOrTag = new CodingSchemeVersionOrTag();
            versionOrTag.setVersion(version);
            CodingScheme cs = lbSvc.resolveCodingScheme(scheme, versionOrTag);
            Mappings mappings = cs.getMappings();
            SupportedHierarchy[] hierarchies = mappings.getSupportedHierarchy();
            java.lang.String[] ids = hierarchies[0].getAssociationIds();

            for (int i=0; i<ids.length; i++)
            {
				if (!association_vec.contains(ids[i])) {
					association_vec.add(ids[i]);
			    }
			}

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

	public HashMap getSubconcepts(String scheme, String version, String code)
	{
		//String assocName = "hasSubtype";
		String hierarchicalAssoName = "hasSubtype";
        Vector hierarchicalAssoName_vec = getHierarchyAssociationId(scheme, version);
        if (hierarchicalAssoName_vec != null && hierarchicalAssoName_vec.size() > 0)
        {
			hierarchicalAssoName = (String) hierarchicalAssoName_vec.elementAt(0);
		}
		return getAssociationTargets(scheme, version, code, hierarchicalAssoName);
	}

	public HashMap getAssociationTargets(String scheme, String version, String code, String assocName)
	{
        HashMap hmap = new HashMap();
        TreeItem ti = null;
        long ms = System.currentTimeMillis();
        Util.StopWatch stopWatch = new Util.StopWatch(); //DYEE

        Set<String> codesToExclude = Collections.EMPTY_SET;

		CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
		if (version != null) csvt.setVersion(version);
		ResolvedConceptReferenceList matches = null;
		Vector v = new Vector();
		try {
			//EVSApplicationService lbSvc = new RemoteServerUtil().createLexBIGService();
			LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();
			LexBIGServiceConvenienceMethods lbscm = (LexBIGServiceConvenienceMethods) lbSvc
					.getGenericExtension("LexBIGServiceConvenienceMethods");
			lbscm.setLexBIGService(lbSvc);

            String name = getCodeDescription(lbSvc, scheme, csvt, code);
            ti = new TreeItem(code, name);
            ti.expandable = false;

			CodedNodeGraph cng = lbSvc.getNodeGraph(scheme, csvt, null);
			ConceptReference focus = Constructors.createConceptReference(code, scheme);
			cng = cng.restrictToAssociations(Constructors.createNameAndValueList(assocName), null);
			boolean associationsNavigatedFwd = true;
/*
			ResolvedConceptReferenceList branch = cng.resolveAsList(focus, associationsNavigatedFwd,
					!associationsNavigatedFwd, -1, 2, noopList_, null, null, null, -1, true);
*/
			ResolvedConceptReferenceList branch = cng.resolveAsList(focus, associationsNavigatedFwd,
					!associationsNavigatedFwd, -1, 2, noopList_, null, null, null, -1, false);

			for (Iterator<ResolvedConceptReference> nodes = branch.iterateResolvedConceptReference(); nodes.hasNext();) {
				ResolvedConceptReference node = nodes.next();
				AssociationList childAssociationList = associationsNavigatedFwd ? node.getSourceOf() : node.getTargetOf();

				// Process each association defining children ...
				for (Iterator<Association> pathsToChildren = childAssociationList.iterateAssociation(); pathsToChildren.hasNext();) {
					Association child = pathsToChildren.next();
					String childNavText = getDirectionalLabel(lbscm, scheme, csvt, child, associationsNavigatedFwd);

					// Each association may have multiple children ...
					AssociatedConceptList branchItemList = child.getAssociatedConcepts();
					for (Iterator<AssociatedConcept> branchNodes = branchItemList.iterateAssociatedConcept(); branchNodes
							.hasNext();) {
						AssociatedConcept branchItemNode = branchNodes.next();
						String branchItemCode = branchItemNode.getConceptCode();

						// Add here if not in the list of excluded codes.
						// This is also where we look to see if another level
						// was indicated to be available.  If so, mark the
						// entry with a '+' to indicate it can be expanded.
						if (!codesToExclude.contains(branchItemCode)) {
							TreeItem childItem = new TreeItem(branchItemCode, getCodeDescription(branchItemNode));
							ti.expandable = true;
							AssociationList grandchildBranch =
								associationsNavigatedFwd
									? branchItemNode.getSourceOf()
									: branchItemNode.getTargetOf();
							if (grandchildBranch != null)
								childItem.expandable = true;
							ti.addChild(childNavText, childItem);
						}
					}
				}
			}
			hmap.put(code, ti);

		} catch (Exception ex) {
			ex.printStackTrace();
		}
		_logger.debug("Run time (milliseconds) getSubconcepts: " + (System.currentTimeMillis() - ms) + " to resolve " );
		_logger.debug("DYEE: getSubconcepts: " + stopWatch.getResult() + " to resolve " );
		return hmap;
    }

//Focus code: C7387 C26709

	public static void main(String[] args)
	{
		 String url = "http://lexevsapi-dev.nci.nih.gov/lexevsapi42";
		 url = "http://lexevsapi.nci.nih.gov/lexevsapi42";

         String scheme = "NCI Thesaurus";
         String version = null;//"08.06d";
         String code = "C26709";

         TreeUtils test = new TreeUtils();
         HashMap hmap = test.getSubconcepts(scheme, version, code);
         test.printTree(hmap);

         code = "C2910";
         hmap = test.getSubconcepts(scheme, version, code);
         test.printTree(hmap);

	 }
}

/*
ResolvedConceptReferenceList resolveAsList(ConceptReference graphFocus,
                                           boolean resolveForward,
                                           boolean resolveBackward,
                                           int resolveCodedEntryDepth,
                                           int resolveAssociationDepth,
                                           LocalNameList propertyNames,
                                           CodedNodeSet.PropertyType[] propertyTypes,
                                           SortOptionList sortOptions,
                                           LocalNameList filterOptions,
                                           int maxToReturn,
                                           boolean keepLastAssociationLevelUnresolved)

Graph
   Restricted Graph
       ResolvedConceptReferenceList by ResolveAsList
           ResolvedConceptReference (node)
                AssociationList
                      Association
                            AssociatedConcept
                                    TreeItem

*/


text:
<?php

/* This document is meant to follow PSR-1 and PSR-2 php-fig standards
   http://www.php-fig.org/psr/psr-1/
   http://www.php-fig.org/psr/psr-2/ */

/**
 * A Map Class
 *
 * This file contains the Map class.  A map is quite a formidable data type.
 * Traditionally an array in PHP is associative, using integers or strings as
 * hashes/keys.  This class allows the creation of an associate array where the
 * key can be any data type or object, and the value can be any data type or
 * object.
 *
 * @copyright Copyright 2015 Asher Wolfstein
 * @author Asher Wolfstein <asherwunk@gmail.com>
 * @link http://wunk.me/ The author's URL
 * @link http://www.furdev.com/primus-artificial-intelligence-framework/ Framework URL
 * @license http://opensource.org/licenses/MIT
 * @package Data
 * @subpackage Structures
 * @category Types
 *
 */

/**
 * Falcraft Libraries Data Types Namespace
 *
 */
namespace Falcraft\Data\Types
{
    require_once(realpath( __DIR__ . '/../../') . '/falcraftLoad.php');

    // For object configuration purposes
    $includes = array('/Features/Configuration.php',
                      '/Data/Types/Exception/RangeException.php',
                      '/Data/Types/Exception/InvalidArgumentException.php',);

    falcraftLoad($includes, __FILE__);

    use Falcraft\Features;
    use Falcraft\Data\Types\Exception;

    /**
     * Map Class - Defines A Map Data Structure
     *
     * A Map in this instance is a very versatile and complex data type.
     * In a traditional array in PHP, the keys are integers or strings,
     * as an indexed array is pretty much the same as an indexed one in the
     * language.  This cracks this concept wide open and allows keys to be
     * objects, resources, any valid comparable php value.  This means
     * that a Person object could be a key to an array of Courses.
     *
     * Some of this functionality can be accomplished by simply creating
     * a private array in the 'enclosing' class, (e.g. Person->Courses),
     * but some functionality is unique to Maps themselves as arrays.
     *
     * CHANGELOG
     *
     * 1.0: Map Completed and Documented - March 8th, 2013
     * 1.1: Eliminated unnecessary Null objects - March 26th, 2013
     * 1.2: Provided closure's for static methods - October 7th, 2013
     * 2.0: Implemented in Primus - August 25th, 2015
     * 2.1: Fixed Typo in Remove - September 5th, 2015
     *
     * @link http://en.wikipedia.org/wiki/Associative_array [English]
     *
     * @version 2.1
     */
    class Map implements \Iterator
    {
        use Features\Configuration;

        /**
         * The default key index in an array defined element
         *
         * EX:  Array( 0 => 'key', 1 => 'value' )
         * See __constructor
         *
         */
        const KEY = 0;

        /**
         * The default value index in an array defined element
         *
         * EX:  Array( 0 => 'key', 1 => 'value' )
         * See __constructor
         *
         */
        const INDEX = 1;

        /**
         * The default separator in a string defined element
         *
         * EX:  key=value
         * See __constructor
         *
         */
        const SEPARATOR = '=';

        /**
         * The keys for the map
         *
         * Defined as an array of ( key, indices );
         *
         * @var array
         *
         */
        private $keys = array();

        /**
         * The values for the map
         *
         * Defined as a hopefully indexed array of values
         *
         * @var array
         *
         */
        private $values = array();

        /**
         * The internal index counter
         *
         * This links a key to it's value in this way:
         * VAL[KEY[1]]
         *
         * @var integer
         *
         */
        private $index = 0;

        /* The \Iterator functions
         *
         * These enable the Map to be used in foreach loops... very handy.
         *
         * Note: This simply wraps around to the Keys array iterator.  This
         *       is so that if a key is unset later on, causing there to be
         *       a gap in the array index sequence, we can let PHP handle it.
         */

        /**
         * Reset the internal \Iterator counter
         *
         */
        public function rewind()
        {
            reset($this->keys);
        }

        /**
         * Return the current \Iterator value
         *
         * $this->pos is an index of the keys of the map, NOT it's values.
         * This means that any given key's actual value will be the self::VALUE
         * index in the values member.  Thus:
         *
         * VALUES[ KEY[pos][INDEX]]
         *
         * @return mixed The value currently being pointed to by \Iterator
         *
         */
        public function current()
        {
            $current = current($this->keys);
            return $this->values[$current[self::INDEX]];
        }

        /**
         * Returns the key of the current \Iterator value
         *
         * This just looks at the key data of the current \Iterator key
         *
         * @return mixed The key currently being pointed to by \Iterator
         *
         */
        public function key()
        {
            $current = current($this->keys);
            return $current[self::KEY];
        }

        /**
         * Advance the \Iterator index by one
         *
         */
        public function next()
        {
            return next($this->keys);
        }

        /**
         * Are we currently pointing to a valid key?
         *
         */
        public function valid()
        {
            if (current($this->keys)) {
                return true;
            }

            return false;
        }

        /**
         * Returns the keys of the map as an array.
         *
         * Since the keys are stored in: KEYS[ I[SELF::KEY] ] we have
         * to step through and extract them into a separate array
         *
         * @return array The key values of the map sans mapping
         *
         */
        public function getKeys()
        {
            $keys = array();

            // Build an array of key values from the internal key data
            // KEYS[ I[SELF::KEY] ]
            foreach ($this->keys as $key) {
                $keys[] = $key[self::KEY];
            }

            return $keys;
        }

        /**
         * Collect the reference to a given key
         *
         * @return mixed &
         *
         */
        public function &getKeyObject($object)
        {
            foreach ($this->keys as $key) {
                if ($key == $object) {
                    return $key;
                }

            }

        }

        /**
         * Returns the values of the map as an array
         *
         * The values are stored in their own indexed array internally so,
         * this is a relatively straight-forward simple request.
         *
         * @return array
         *
         */
        public function getValues()
        {
            return $this->values;
        }

        /**
         * Increments the internal index
         *
         * This increments the internal index so that a new key
         * has a place to store a new value.  We don't care if
         * previosu indices have been unset, we just need a new unique
         * number.
         *
         */
        private function incrementIndex()
        {
            $this->index++;
        }

        /**
         * The Map Constructor
         *
         * This constructor is a beast.  It takes several forms of input, but it
         * generally boils down to an array of values that will be turned into
         * key/value pairs, and an array of options.
         *
         * The key/value pair is constructed according to the array elements
         * data type.
         *
         * Currently the allowe data types are:
         *     stdClass (->key, and ->value)
         *     array ('key'/0, 'value'/1)
         *     string keySELF::SEPARATORvalue
         *     the actual key and value of the element otherwise
         *
         * Currently available options:
         *     strict => whether to output errors or remain silent (and return
         *                  empties)
         *     typed => check the types of keys in comparisons (unique)
         *
         * @param array $values The values, as outlined above, for the Map laid
         *                      out in key/value pairs
         * @param array $options The options for the Map as outlined above
         *
         */
        public function __construct(
            array $values = array(),
            array $options = array()
        ) {
            // Set default options
            if (is_array($options)) {
                $options = array_change_key_case($options);
            }

            $this->configure($options);

            foreach ($values as $k => $value) {
                /* The goal here is to put a value in key
                 * a value in val, and then associate those
                 * two together in the Map:
                 *
                 * KEYS[i][ $key, x ], VALUES[x] = $val;
                 */
                $key = null;
                $val = null;

                if ($value instanceof \stdClass) {
                    $key = $value->key;
                    $val = $value->value;
                } else if (is_array($value)) {
                    if (isset($value['key']) && isset($value['value'])) {
                        $key = $value['key'];
                        $val = $value['value'];
                    } else {
                        $key = $value[self::KEY];
                        $val = $value[self::INDEX];
                    }

                } else if (is_string($value)) {
                    if (strpos($value, self::SEPARATOR)) {
                        list($key, $val) = explode(self::SEPARATOR, $value, 2);
                    } else {
                        $key = $k;
                        $val = $value;
                    }

                } else {
                    $key = $k;
                    $val = $value;
                }

                // KEYS[i][ $key, x ], VALUES[x] = $val;
                $this->keys[] = array($key, $this->index);
                $this->values[$this->index] = $val;
                $this->incrementIndex();
            }
        }

        /**
         * Check to see if a key already exists in the Map
         *
         * @return bool True if key is unique
         *
         */
        public function exists($key)
        {
            if (in_array($key, $this->getKeys())) {
                return true;
            }

            return false;
        }

        /**
         * Add a value to the map with a key that previously did not exist
         *
         * @param mixed $key
         * @param mixed $value
         *
         * @return bool True on success (currently everything succeeds)
         *
         */
        private function add($key, $value)
        {
            $this->keys[] = array($key, $this->index);
            $this->values[$this->index] = $value;
            $this->incrementIndex();
            return true;
        }

        /**
         * Return the internal index of a key
         *
         * This value is the index of ->values as held by a ->key[]
         *
         * @param mixed $key The key we are calculating the index for
         *
         * @return integer|null The internal index, linking the map key to the
         *                          map value
         *
         * @throws \RangException when 'strict' and no such key exists
         *
         */
        private function index($key)
        {
            if ($this->exists($key)) {
                foreach ($this->keys as $k) {
                    if ($this->conf->typed) {
                        if ($key === $k[self::KEY]) {
                            return $k[self::INDEX];
                        }

                    } else {
                        if ($key == $k[self::KEY]) {
                            return $k[self::INDEX];
                        }

                    }

                }

            }

            if ($this->conf->strict) {
                throw new Exception\RangeException(
                    'Map->index: Non-Existent Key');
            } else {
                return null;
            }

        }

        /**
         * Replaces a value in the map of key
         *
         * Checks to make sure the index exists before replacing it
         *
         * @param mixed $key
         * @param mixed $value
         *
         * @return bool Successful replacement?
         *
         */
        private function replace($key, $value)
        {
            if (($index = $this->index($key)) !== null) {
                $this->values[$index] = $value;
                return true;
            }

            return false;
        }

        /**
         * The public set function, for setting keys and values
         *
         * Given key will always override already existing key,
         * just like a normal PHP array
         *
         * @param mixed $key
         * @param mixed $value
         *
         * @return bool Operation successful?
         *
         */
        public function set($key, $value)
        {
            if ($this->exists($key)) {
                return $this->replace($key, $value);
            } else {
                return $this->add($key, $value);
            }

        }

        /**
         * The 'unset' of the Map: remove value by key
         *
         * In essence deletes the value of key from the Map
         *
         * @param mixed $key The key to remove
         *
         * @throws Falcraft\Data\Types\Exception\RangeException if 'strict' and
         *              key doesn't exist
         *
         */
        public function remove($key)
        {
            // Does the key exist?
            if ($this->exists($key))
            {
                foreach ($this->keys as $i => $k) {
                    if ($this->conf->typed) {
                        if ($key === $k[self::KEY]) {
                            // Unset the associated value (tied together by index)
                            // KEYS[i] = ( key, x) VALUES[x] = val
                            unset($this->values[$k[$i][self::INDEX]]);
                            unset($this->keys[$i]);
                            return true;
                        }

                    } else {
                        if ($key == $k[self::KEY]) {
                            // Unset the associated value (tied together by index)
                            // KEYS[i] = ( key, x) VALUES[x] = val
                            unset($this->values[$k[self::INDEX]]);
                            unset($this->keys[$i]);
                            return true;
                        }

                    }

                }

            } else {
                if ($this->conf->strict) {
                    throw new Exception\RangeException(
                        'Map->remove: Non-Existent Key');
                } else {
                    return false;
                }

            }

        }

        /**
         * The 'get' function of the Map object
         *
         * This technically 'finds' the value for a given key in the
         * morass of internal counters that is the Map object, so it
         * is named 'find', but it essentially 'gets' the associated value
         *
         * $map->find($key) = $map[$key]
         *
         * @param mixed $key The key to find the value for
         *
         * @return mixed The value associated with the given key
         *
         * @throws Falcraft\Data\Types\Exception\RangeException if the key
         *      doesn't exist and 'strict' is set
         *
         */
        public function find($key)
        {
            if ($this->exists($key)) {
                foreach ($this->keys as $k) {
                    if ($this->conf->typed) {
                        if ($key === $k[self::KEY]) {
                            return $this->values[$k[self::INDEX]];
                        }

                    } else {
                        if ($key == $k[self::KEY]) {
                            return $this->values[ $k[self::INDEX] ];
                        }

                    }

                }

            }

            if ($this->conf-strict) {
                throw new Exception\RangeException(
                    'Map->find: Non-Existent Key');
            } else {
                return null;
            }

        }

        /* The following static functions exist as a sort of small
         * 'Map library' much like PHP arrays have their own set
         * of functions.  They're very basic but useful.
         */

        /**
         * Utility function for the static functions
         *
         * This turns all the given arguments of a function into Maps
         *
         * This simplified operations as they only have to act on Map objects
         *
         * @static
         *
         * @param array $args The arguments to turn into Map objects
         *
         * @return array An array of Map objects constructed from the arguments
         *
         */
        private static function mapArgs(array $args)
        {
            $mappedArgs = array();

            foreach ($args as $arg) {
                if (is_array($arg)) {
                    $mappedArgs[] = new Map($arg);
                } else if ($arg instanceof Map) {
                    $mappedArgs[] = $arg;
                } else {
                    if ($this->conf-strict) {
                        throw new RangeException\InvalidArgumentException(
                            'Map->mapArgs: Function requires only Maps and Arrays');
                    } else {
                        $mappedArgs[] = new Map($arg);
                    }

                }

            }

            return $mappedArgs;
        }

        /**
         * The difference between Map(s), takes a variable number of arguments (> 1)
         *
         * @static
         *
         * @param $maps,... A variable list of Map objects (or data that can be
         *                  turned into Map objects)
         *
         * @return Map A difference map (containing all the entries from the
         *             first argument not present in others)
         *
         * @throws Exception\InvalidArgumentException if less than two arguments
         *              are provided
         *
         */
        public static function difference()
        {
            if (func_num_args() < 2) {
                throw new Exception\InvalidArgumentException(
                    'Map->difference: Difference requires 2 or more arguments');
            } else {
                $args = self::mapArgs(func_get_args());

                $arg0 = clone $args[0];
                unset($args[0]);
                $sameKeys = $arg0->getKeys();
                foreach ($args as $arg) {
                    $sameKeys = array_uintersect(
                        $sameKeys,
                        $arg->getKeys(),
                        function($a,$b){if ($a==$b) return 0; else return -1;}
                    );

                    foreach ($sameKeys as $k) {
                        $arg0->remove($k);
                    }

                }

                return $arg0;
            }

        }

        /**
         * The intersection between Map(s), takes a variable number of
         * arguments (> 1)
         *
         * @static
         *
         * @param $maps,... A variable list of Map objects (or data that can be
         *                  turned into Map objects)
         *
         * @return Map the intersection of the arguments: all the values in
         *                  present in all the parameters
         *
         * @throws Exception\InvalidArgumentException if less than two arguments
         *              are provided
         *
         */
        public static function intersect()
        {
            if (func_num_args() < 2) {
                throw new Exception\InvalidArgumentException(
                    'Map->intersect: Intersect requires 2 or more arguments');
            } else {
                $args = self::mapArgs(func_get_args());

                $arg0 = clone $args[0];
                unset($args[0]);
                $diffKeys = $arg0->getKeys();
                foreach($args as $arg) {
                    $diffKeys = array_udiff(
                        $diffKeys,
                        $arg->getKeys(),
                        function($a,$b){if ($a==$b) return 0; else return -1;}
                    );

                    foreach ($diffKeys as $k) {
                        $arg0->remove($k);
                    }

                }

                return $arg0;
            }

        }

        /**
         * Handy function that takes an array of keys (of any type), and
         * assigns them in a Map to $values
         *
         * @static
         *
         * @param array $keys The keys of the map
         * @param array $values The values to be associated with the
         *                      keys (in order)
         *
         * Note: Just like array_combine, the keys and values must be of the
         *       same length
         *
         * @return false|Map returns false on failure (non-matching arrays)
         *
         */
        public static function combine(array $keys, array $values)
        {
            if (count($keys) != count($values)) {
                return false;
            }

            $result = array();
            foreach ($keys as $k) {
                $val = each($values);
                $result[] = array($k, $val[self::INDEX]);
            }

            return new Map($result, array('strict' => true));
        }

        /**
         * "returns an array using the values of the input array as keys and
         * their frequency in input as values."
         *
         * This is where Maps really shine, as they can accept keys that are
         * not strings and integers
         *
         * @static
         *
         * @param Map $map The map to analyze
         *
         * @return Map
         *
         */
        public static function countValues(Map $map)
        {
            $result = new Map();
            foreach ($map as $val) {
                if (!$result->exists($val)) {
                   $result->set($val, 1);
                } else {
                   $result->set($val, $result->find($val) + 1);
                }

            }

            return $result;
        }

        /**
         * Merge two or more Maps, just like array_merge
         *
         * @static
         *
         * @param $maps,... A variable number of arguments, all to merge
         *
         * @return Map
         *
         * @throws Falcraft\Data\TypesException\InvalidArgumentException
         *              if less than two arguments are provided
         *
         */
        public static function merge()
        {
            if (func_num_args() < 2) {
                throw new Exception\InvalidArgumentException(
                    'Map->merge: Merge requires 2 or more arguments');
            } else {
                $args = self::mapArgs(func_get_args());

                $result = new Map();
                foreach ($args as $val) {
                    foreach ($val as $key => $ival) {
                        $result->set($key, $ival);
                    }

                }

                return $result;
            }

        }
    }
}


text:
#pragma once

#include "CustomData.h"

#include <string>
#include <vector>

namespace ZXing {
namespace Pdf417 {

/**
* @author Guenther Grau
*/
class DecoderResultExtra : public CustomData
{
	int _segmentIndex = 0;
	std::string _fileId;
	std::vector<int> _optionalData;
	bool _lastSegment = false;
	int _segmentCount = -1;
	std::string _sender;
	std::string _addressee;
	std::string _fileName;
	int64_t _fileSize = -1;
	int64_t _timestamp = -1;
	int _checksum = -1;

public:

	int segmentIndex() const {
		return _segmentIndex;
	}

	void setSegmentIndex(int segmentIndex) {
		_segmentIndex = segmentIndex;
	}

	std::string fileId() const {
		return _fileId;
	}

	void setFileId(const std::string& fileId) {
		_fileId = fileId;
	}

	const std::vector<int>& optionalData() const {
		return _optionalData;
	}

	void setOptionalData(const std::vector<int>& optionalData) {
		_optionalData = optionalData;
	}

	bool isLastSegment() const {
		return _lastSegment;
	}

	void setLastSegment(bool lastSegment) {
		_lastSegment = lastSegment;
	}

	int segmentCount() const {
		return _segmentCount;
	}

	void setSegmentCount(int segmentCount) {
		_segmentCount = segmentCount;
	}

	std::string sender() const {
		return _sender;
	}

	void setSender(const std::string& sender) {
		_sender = sender;
	}

	std::string addressee() const {
		return _addressee;
	}

	void setAddressee(const std::string& addressee) {
		_addressee = addressee;
	}

	std::string fileName() const {
		return _fileName;
	}

	void setFileName(const std::string& fileName) {
		_fileName = fileName;
	}

	// -1 if not set
	int64_t fileSize() const {
		return _fileSize;
	}

	void setFileSize(int64_t fileSize) {
		_fileSize = fileSize;
	}

	 // 16-bit CRC checksum using CCITT-16, -1 if not set
	int checksum() const {
		return _checksum;
	}

	void setChecksum(int checksum) {
		_checksum = checksum;
	}

	// Unix epock timestamp, elapsed seconds since 1970-01-01, -1 if not set
	int64_t timestamp() const {
		return _timestamp;
	}

	void setTimestamp(int64_t timestamp) {
		_timestamp = timestamp;
	}
};

} // Pdf417
} // ZXing


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InstaKiller.Model
{
    public class Person
    {
        public Guid Id { get; set; }
        public string Name { get; set; }
        public string LastName { get; set; }
        public string FirstName { get; set; }
        public string Email { get; set; }
        public Int32 PasswordHash { get; set; }
        public string About { get; set; }
        public List<Person> Subscribers { get; set; }
        public List<Person> Subscriptions { get; set; }

        public Person()
        {
            Subscribers = new List<Person>();
            Subscriptions = new List<Person>();
        }
    }
}


text:
package net.ontrack.extension.issue;

import lombok.Data;

@Data
public class IssueServiceConfigSummary {

    private final int id;
    private final String name;

}


text:
/* $Id$ */
#include "common_core.h"
#include "qp2.h"

HOOK_STRUCT(
	HOOK_LINK(qp_init)
	HOOK_LINK(qp_init_request)
	HOOK_LINK(qp_init_response)
	HOOK_LINK(qp_light_search)
	HOOK_LINK(qp_full_search)
	HOOK_LINK(qp_abstract_search)
	HOOK_LINK(qp_do_filter_operation)
	HOOK_LINK(qp_get_query_string)
	HOOK_LINK(qp_finalize_search)

	HOOK_LINK(qp_cb_orderby_virtual_document)
	HOOK_LINK(qp_cb_orderby_document)
	HOOK_LINK(qp_cb_where)
	HOOK_LINK(qp_set_where_expression)

	HOOK_LINK(qp_get_max_doc_hits_size)
	HOOK_LINK(qp_get_comment_list_size)
)
SB_IMPLEMENT_HOOK_RUN_FIRST(int, qp_init, (void), (), DECLINE)
SB_IMPLEMENT_HOOK_RUN_FIRST(int, qp_init_request, (request_t * req, char* query), (req, query), DECLINE)
SB_IMPLEMENT_HOOK_RUN_FIRST(int, qp_init_response, (response_t * res), (res), DECLINE)
SB_IMPLEMENT_HOOK_RUN_FIRST(int, qp_light_search, (request_t *req, response_t *res), (req,res), DECLINE)
SB_IMPLEMENT_HOOK_RUN_FIRST(int, qp_full_search, (request_t *req, response_t *res), (req,res), DECLINE)
SB_IMPLEMENT_HOOK_RUN_FIRST(int, qp_abstract_search, (request_t *req, response_t *res), (req,res), DECLINE)
SB_IMPLEMENT_HOOK_RUN_FIRST(int, qp_do_filter_operation, \
		(request_t *req, response_t *res, enum doc_type type), (req,res,type), DECLINE)
SB_IMPLEMENT_HOOK_RUN_FIRST(int, qp_get_query_string, \
		(request_t *req, char query[MAX_QUERY_STRING_SIZE]), (req,query), DECLINE)
SB_IMPLEMENT_HOOK_RUN_FIRST(int, qp_finalize_search, (request_t *req, response_t *res), (req,res), DECLINE)

SB_IMPLEMENT_HOOK_RUN_FIRST(int, qp_cb_orderby_virtual_document, \
	(const void *dest, const void *sour, void *userdata), \
	(dest, sour, userdata), MINUS_DECLINE)
SB_IMPLEMENT_HOOK_RUN_FIRST(int, qp_cb_orderby_document, \
	(const void *dest, const void *sour, void *userdata), \
	(dest, sour, userdata), MINUS_DECLINE)
SB_IMPLEMENT_HOOK_RUN_FIRST(int, qp_cb_where, \
	(const void *dest), (dest), MINUS_DECLINE)
SB_IMPLEMENT_HOOK_RUN_FIRST(int, qp_set_where_expression, \
	(char *clause), (clause), DECLINE)

SB_IMPLEMENT_HOOK_RUN_FIRST(int, qp_get_max_doc_hits_size, (int *size), (size), DECLINE)
SB_IMPLEMENT_HOOK_RUN_FIRST(int, qp_get_comment_list_size, (int *size), (size), DECLINE)