text:
package org.sillylossy.games.durak;

import org.sillylossy.games.common.Main;
import org.sillylossy.games.common.cards.Card;
import org.sillylossy.games.common.cards.CardRank;
import org.sillylossy.games.common.cards.CardSuit;
import org.sillylossy.games.common.cards.Deck;
import org.sillylossy.games.common.game.CardGame;
import org.sillylossy.games.common.game.StatEvent;
import org.sillylossy.games.common.players.Participant;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class DurakGame extends CardGame {

    public static final String GAME_NAME = "Durak";
    private final AIPlayer opponent = new AIPlayer(this);
    boolean opponentTakes = false;
    boolean opponentsTurn = false;
    private Map<Card, Card> tableCards = new HashMap<>();
    private Card trumpCard = new Card(CardRank.ACE, CardSuit.DIAMONDS);

    private Map<Card, Card> getTableCards() {
        return tableCards;
    }

    Card getTrumpCard() {
        return trumpCard;
    }

    @Override
    public void betAction(int bet) {
        player.setBet(bet);
        player.decreaseScore(bet);
        setDeck(Deck.getShortDeck());
        trumpCard = deck.getLast();
        dealCards();
    }

    void nextTurn() {
        refillCards();
    }

    private void refillCards() {
        refill(opponent);
        refill(player);
    }

    List<Card> filterCards(Card clicked) {
        List<Card> cards = new ArrayList<>();
        for (Card card : player.getHand().getCards()) {
            if (canBeat(card, clicked)) {
                cards.add(card);
            }
        }
        return cards;
    }

    int getValue(Card card) {
        switch (card.getCardRank()) {
            case SIX:
                return 1;
            case SEVEN:
                return 2;
            case EIGHT:
                return 3;
            case NINE:
                return 4;
            case TEN:
                return 5;
            case JACK:
                return 6;
            case QUEEN:
                return 7;
            case KING:
                return 8;
            case ACE:
                return 9;
        }
        return 0;
    }

    private boolean canBeat(Card card, Card clicked) {
        CardSuit trumpSuit = trumpCard.getCardSuit();
        if (card.getCardSuit() == trumpSuit && clicked.getCardSuit() != trumpSuit) {
            return true;
        } else if (clicked.getCardSuit() == trumpSuit && card.getCardSuit() != trumpSuit) {
            return false;
        } else if (getValue(card) > getValue(clicked)) {
            return true;
        }
        return false;
    }

    public void handCardClick(Card card) {
        if (opponentTakes && !opponentsTurn) {
            opponent.getHand().addCard(card);
        } else {
            tableCards.put(card, null);
            if (opponent.canBeat(card)) {
                tableCards.put(card, opponent.getResponse(card));
            } else {
                opponentTakes = true;
            }
        }
    }

    @Override
    public int getMaxBet() {
        return player.getScore();
    }

    @Override
    public int getMinBet() {
        return 1;
    }

    @Override
    public String getGameName() {
        return GAME_NAME;
    }

    @Override
    public boolean shouldEnd() {
        return deck.isEmpty() && player.getHand().isEmpty() || opponent.getHand().isEmpty();
    }

    @Override
    public String getResult() {
        String result;
        boolean playerEmpty = player.getHand().isEmpty();
        boolean opponentEmpty = opponent.getHand().isEmpty();
        int bet = player.getBet();
        StatEvent statEvent;
        int increase = 0;
        if (playerEmpty && opponentEmpty) {
            result = "Draw.";
            statEvent = StatEvent.DRAW;
            increase = bet;
        } else if (playerEmpty) {
            result = "You've won.";
            statEvent = StatEvent.WON;
            increase = bet * 2;
        } else {
            result = "You've lost.";
            statEvent = StatEvent.LOST;
        }
        Main.getGameController().addStatEvent(player, statEvent);
        player.increaseScore(increase);
        Main.saveData();
        return result;
    }

    @Override
    public void reset() {
        player.getHand().clear();
        player.setBet(0);
        opponent.getHand().clear();
    }

    @Override
    protected void dealCards() {
        refill(opponent);
        refill(player);
    }

    private void refill(Participant p) {
        final int START_CARDS = 6;
        while (p.getHand().size() < START_CARDS) {
            p.getHand().addCard(deck.draw());
        }
    }

    void takeAction() {
        for (Map.Entry<Card, Card> entry : tableCards.entrySet()) {
            if (entry.getKey() != null) {
                player.getHand().addCard(entry.getKey());
            }
            if (entry.getValue() != null) {
                player.getHand().addCard(entry.getValue());
            }
        }
        tableCards.clear();
        opponentsTurn = true;
        nextTurn();
    }

    public AIPlayer getOpponent() {
        return opponent;
    }
}


text:
body{margin:0;padding:0;}
#header{
		width:100%;height:150px;
		background-image:url('img/hrep_x.jpg');background-repeat:repeat-x; }
	#himage{background-image:url('logo.jpg');background-repeat:none;
			margin:0 auto;padding:0;
			height:95px;width:400px;
			float:right;
			}
#content{margin:0 auto; padding:0;
		 width:700px; height:400px;
		 }
		#content h1 {font-size:25px;font-family:Verdana;color:#575757;}
		#content h2 {font-size:15px;font-family:Sans-serif;color:#DA5D13;}
		#content p	{font-size:12px;font-family:Times;color:#000;}

/*enter*/
#content input{
	font-family:verdana;font-size:12px;color:#888;
	border:1px solid#ddd;
}
.button{
	font-family:verdana;font-size:20px;color:#000;
	border:1px solid ;
	width:inherit;
}

#login{
	float:left;
	text-align:right;
}
#registro{
	float:right;
	text-align:right;
}
#vert_sep{
	height:400px;
	width:1px;
	background-color:#ddd;
	float:right;
	position:relative; left:-50px;
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Proxies\__CG__\Compete\ComBundle\Entity;

/**
 * THIS CLASS WAS GENERATED BY THE DOCTRINE ORM. DO NOT EDIT THIS FILE.
 */
class ArtisticCompetitions extends \Compete\ComBundle\Entity\ArtisticCompetitions implements \Doctrine\ORM\Proxy\Proxy
{
    private $_entityPersister;
    private $_identifier;
    public $__isInitialized__ = false;
    public function __construct($entityPersister, $identifier)
    {
        $this->_entityPersister = $entityPersister;
        $this->_identifier = $identifier;
    }
    /** @private */
    public function __load()
    {
        if (!$this->__isInitialized__ && $this->_entityPersister) {
            $this->__isInitialized__ = true;

            if (method_exists($this, "__wakeup")) {
                // call this after __isInitialized__to avoid infinite recursion
                // but before loading to emulate what ClassMetadata::newInstance()
                // provides.
                $this->__wakeup();
            }

            if ($this->_entityPersister->load($this->_identifier, $this) === null) {
                throw new \Doctrine\ORM\EntityNotFoundException();
            }
            unset($this->_entityPersister, $this->_identifier);
        }
    }

    /** @private */
    public function __isInitialized()
    {
        return $this->__isInitialized__;
    }

    public function getId()
    {
        if ($this->__isInitialized__ === false) {
            return (int) $this->_identifier["id"];
        }
        $this->__load();
        return parent::getId();
    }

    public function setPathes($pathes)
    {
        $this->__load();
        return parent::setPathes($pathes);
    }

    public function getPathes()
    {
        $this->__load();
        return parent::getPathes();
    }

    public function setUser(\Compete\ComBundle\Entity\Users $user = NULL)
    {
        $this->__load();
        return parent::setUser($user);
    }

    public function getUser()
    {
        $this->__load();
        return parent::getUser();
    }

    public function setCompte(\Compete\ComBundle\Entity\Competitions $compte = NULL)
    {
        $this->__load();
        return parent::setCompte($compte);
    }

    public function getCompte()
    {
        $this->__load();
        return parent::getCompte();
    }

    public function __sleep()
    {
        return array('__isInitialized__', 'id', 'pathes', 'user', 'compte');
    }

    public function __clone()
    {
        if (!$this->__isInitialized__ && $this->_entityPersister) {
            $this->__isInitialized__ = true;
            $class = $this->_entityPersister->getClassMetadata();
            $original = $this->_entityPersister->load($this->_identifier);
            if ($original === null) {
                throw new \Doctrine\ORM\EntityNotFoundException();
            }
            foreach ($class->reflFields as $field => $reflProperty) {
                $reflProperty->setValue($this, $reflProperty->getValue($original));
            }
            unset($this->_entityPersister, $this->_identifier);
        }

    }
}


text:
<?php

  _recordWastedTime("Gotcha! ".$dbgErrorCount++);

  $flagCanReviewDBUpdate=true;
  $flagDBStructureReviewed=false;

  function _db_upd_canReviewVersion($aVersion)
  {
    global $flagCanReviewDBUpdate, $currentDBVersion;

    $ret=($flagCanReviewDBUpdate) && ($currentDBVersion<$aVersion);
    return $ret;
  }

  function _db_upd_error($errorMsg)
  {
    global $flagCanReviewDBUpdate, $currentDBVersion;
    $flagCanReviewDBUpdate=false;
  }

  function _db_grantSetupIni()
  {
    global $setupIni, $dbCSVFilename;
    if (!isset($setupIni)) $setupIni=createDBText($dbCSVFilename);
  }

  function _db_upd_createAuditingTrackTable()
  {
    if (!db_tableExists('is_auditing_track')) {
      if (db_connectionTypeIs(_FIREBIRD_)) {
        $sql='SELECT count(*) FROM rdb$relations WHERE (rdb$relation_name = \'IS_AUDITING_TRACK\') AND (rdb$view_blr IS NOT NULL)';
        $cc=db_sql($sql);
      } else {
        $cc=0;
      }
      if ($cc==0) {
        $sql = "CREATE TABLE  is_auditing_track (
                  id char(32),
                  state char(1),
                  userID char(32),
                  eventDate char(14),
                  tableName varchar(80) DEFAULT NULL,
                  tableID char(250) DEFAULT NULL,
                  tableIDField char(250) DEFAULT NULL,
                  sqlVerb char(6),
                  yeapfContext varchar(120),
                  eventDescription varchar(250) DEFAULT NULL, ";
        if (db_connectionTypeIs(_MYSQL_))
          $sql.="prevRecord text,
                 newRecord text ";
        else
          $sql.="prevRecord varchar(32000),
                 newRecord  varchar(32000)";
        $sql.=")";

        db_sql($sql);
      }
    }
  }

  function _db_upd_newVersion($aVersion)
  {
    global $setupIni, $dbTEXT_NO_ERROR, $currentDBVersion, $flagDBStructureReviewed, $cfgCurrentAppRegistry;

    $currentDBVersion=$aVersion;
    _db_grantSetupIni();

    $ok=false;

    if ($cfgCurrentAppRegistry>'') {
      $ok=($setupIni->locate("appRegistry", $cfgCurrentAppRegistry)==$dbTEXT_NO_ERROR);
    } else {
      $ok=($setupIni->locate("active",1)==$dbTEXT_NO_ERROR);
    }

    if ($ok) {
      $setupIni->addField('currentDBVersion');
      $setupIni->setValue('currentDBVersion',$currentDBVersion);
      $setupIni->commit();
    }
    $flagDBStructureReviewed=true;
  }

  global $setupIni;

  if (db_status(_DB_CONNECTED_)==_DB_CONNECTED_) {
    if (db_status(_DB_UPDATABLE)==_DB_UPDATABLE) {
      $currentDBVersion=(intval("$currentDBVersion"));
      if (_db_upd_canReviewVersion(1)) {
        _recordWastedTime("checking v1");
        try {
          if (!db_tableExists('is_context')) {
            $sql = "CREATE TABLE is_context (";
            $sql.= "  userID int NOT NULL,";
            $sql.= "  varName varchar(120) DEFAULT NULL,";
            $sql.= "  varValue varchar(254) DEFAULT NULL,";
            $sql.= "  PRIMARY KEY (userID)";
            $sql.= ")";
            db_sql($sql);
          }

          if (!db_tableExists('is_menu')) {
            $sql ="CREATE TABLE is_menu (";
            if (db_connectionTypeIs(_MYSQL_))
              $sql.="  ID int  NOT NULL AUTO_INCREMENT,";
            else
              $sql.="  ID int  NOT NULL ,";
            $sql.="  enabled char(1) DEFAULT 'Y',";
            $sql.="  attr int  DEFAULT '0',";
            if (db_connectionTypeIs(_MYSQL_))
              $sql.="  o tinyint  DEFAULT '0',";
            else
              $sql.="  o smallint  DEFAULT '0',";
            $sql.="  ancestor int DEFAULT '0',";
            $sql.="  label varchar(64) DEFAULT NULL,";
            $sql.="  d char(1)  DEFAULT '',";
            $sql.="  rights int  DEFAULT '2',";
            $sql.="  a varchar(60) DEFAULT NULL,";
            $sql.="  s varchar(30) DEFAULT NULL,";
            $sql.="  implementation varchar(80) DEFAULT NULL,";
            $sql.="  lnkNewWindow int DEFAULT '0',";
            $sql.="  lnkNewWindowWidth int DEFAULT '600',";
            $sql.="  lnkNewWindowHeight int DEFAULT '480',";
            $sql.="  lnkAllWide int DEFAULT '1',";
            $sql.="  lnkWOHeader int DEFAULT '1',";
            $sql.="  clickCounter int DEFAULT '0',";
            $sql.="  lnkNewWindowLeft int DEFAULT '20',";
            $sql.="  lnkNewWindowTop int DEFAULT '40',";
            $sql.="  lnkCacheable int DEFAULT '0',";
            $sql.="  hasImplementation int DEFAULT '0',";
            $sql.="  app int DEFAULT '0',";
            $sql.="  permiteAtivacao int DEFAULT '0',";
            $sql.="  permiteCriarItems int DEFAULT '0',";
            if (db_connectionTypeIs(_MYSQL_))
              $sql.="  explanation text,";
            else
              $sql.="  explanation varchar(4096),";
            $sql.="  ativo char(1) DEFAULT 'S',";
            $sql.="  lnkAutoPrint int DEFAULT '0',";
            $sql.="  PRIMARY KEY (ID) ";
            $sql.=")";
            db_sql($sql);
          }
          if (!db_tableExists('is_usuarios')) {
            $sql="CREATE TABLE is_usuarios (";
            $sql.="  id varchar(40) DEFAULT '',";
            $sql.="  userID int DEFAULT '0',";
            $sql.="  pessoa varchar(48) DEFAULT NULL,";
            $sql.="  senha varchar(32) DEFAULT NULL,";
            $sql.="  nome varchar(40) DEFAULT NULL,";
            $sql.="  apelido varchar(20) DEFAULT NULL,";
            $sql.="  tipo char(3) DEFAULT NULL,";
            $sql.="  lastAccess varchar(14) DEFAULT NULL,";
            $sql.="  super char(1) DEFAULT 'N',";
            $sql.="  userRights int DEFAULT '0',";
            $sql.="  PRIMARY KEY (id)";
            $sql.=")";
            db_sql($sql);

            $idRoot=md5('root');
            db_sql("INSERT INTO is_usuarios (id, apelido, senha, super, UserRights) VALUES ('$idRoot','root','$cfgRootFirstPassword','Y',65535)");
          }
          if (db_tableExists('is_menu')) {
            $u1=db_fieldExists('is_usuarios','userRights');
            if (!($u1)) {
              db_sql("alter table is_usuarios add userRights integer default 0");
              $u2=db_fieldExists('is_usuarios','ut');
              if ($u2) {
                db_sql("update is_usuarios set userRights=ut");
                db_sql("alter table is_usuarios drop ut");
              }
            }
            $u1=db_fieldExists('is_menu','implementation');
            if (!($u1)) {
              db_sql("alter table is_menu add implementation varchar(80)");
              $u2=db_fieldExists('is_menu','page');
              if ($u2) {
                db_sql("update is_menu set implementation=page");
                db_sql("alter table is_menu drop page");
              }
            }
          }
          _db_upd_newVersion(1);
        } catch (Exception $e) {
          _db_upd_error($e->getMessage());
        }
      }

      if (_db_upd_canReviewVersion(2)) {
        _recordWastedTime("checking v2");
        try {
          if (!db_tableExists('is_sqlcache')) {
            $sql="create table is_sqlcache  (";
            $sql.="  id CHAR(32) NOT NULL,";
            $sql.="  buildDate INTEGER,";
            $sql.="  ttl INTEGER,";
            $sql.="  statement char(32),";
            $sql.="  lastAccess INTEGER);";
            db_sql($sql);
          }
          if (!db_tableExists('is_sqlcache_content')) {
            $sql="create table is_sqlcache_content  (";
            $sql.="  id CHAR(32) NOT NULL,";
            $sql.="  o integer,";
            if (db_connectionTypeIs(_MYSQL_)) {
              $sql.="  content text,";
              $sql.="  comp text);";
            } else {
              $sql.="  content VARCHAR(16368),";
              $sql.="  comp VARCHAR(32765));";
            }
            db_sql($sql);
          }
          _db_upd_newVersion(2);
        } catch (Exception $e) {
          _db_upd_error($e->getMessage());
        }

      }

      if (_db_upd_canReviewVersion(3)) {
        _recordWastedTime("checking v3");
        try {
          if (!db_tableExists('is_doc_tokens')) {
            $sql ="create table is_doc_tokens (";
            $sql.="  token varchar(128) not null, ";
            $sql.="  tokenAlias varchar(128), ";
            $sql.="  appLevel integer, ";
            $sql.="  g smallint default 0, ";
            $sql.="  o smallint default 0, ";
            if (db_connectionTypeIs(_MYSQL_)) {
              $sql.="  description text, ";
              $sql.="  examples text)";
            } else {
              $sql.="  description varchar(2048), ";
              $sql.="  examples VARCHAR(32765))";
            }
            db_sql($sql);
          }

          if (!db_tableExists('is_doc_parameters')) {
            $sql ="create table is_doc_parameters (";
            $sql.="  token varchar(128) not null, ";
            $sql.="  paramNdx smallint, ";
            $sql.="  paramName varchar(60), ";
            $sql.="  isOptional char(1) default 'N', ";
            if (db_connectionTypeIs(_MYSQL_))
              $sql.="  paramDescription text)";
            else
              $sql.="  paramDescription varchar(2048))";
            db_sql($sql);
          }
          _db_upd_newVersion(3);
        } catch (Exception $e) {
          _db_upd_error($e->getMessage());
        }

      }

      if (_db_upd_canReviewVersion(4)) {
        _recordWastedTime("checking v4");
        try {
          if (db_tableExists('is_menu')) {
            if (!db_fieldExists('is_menu','lnkNewWindow'))
            db_sql("alter table is_menu add lnkNewWindow integer default 0");

            if (!db_fieldExists('is_menu','lnkNewWindowWidth'))
            db_sql("alter table is_menu add lnkNewWindowWidth integer default 600");

            if (!db_fieldExists('is_menu','lnkNewWindowHeight'))
            db_sql("alter table is_menu add lnkNewWindowHeight integer default 480");

            if (!db_fieldExists('is_menu','lnkAllWide'))
            db_sql("alter table is_menu add lnkAllWide integer default 1");

            if (!db_fieldExists('is_menu','lnkWOHeader'))
            db_sql("alter table is_menu add lnkWOHeader integer default 1");

            if (!db_fieldExists('is_menu','clickCounter'))
            db_sql("alter table is_menu add clickCounter integer default 0");
          }
          _db_upd_newVersion(4);
        } catch (Exception $e) {
          _db_upd_error($e->getMessage());
        }

      }

      if (_db_upd_canReviewVersion(5)) {
        _recordWastedTime("checking v5");
        try {
          if (db_tableExists('is_menu')) {
            if (!db_fieldExists('is_menu','lnkNewWindowLeft'))
              db_sql("alter table is_menu add lnkNewWindowLeft integer default 20");

            if (!db_fieldExists('is_menu','lnkNewWindowTop'))
              db_sql("alter table is_menu add lnkNewWindowTop integer default 40");

            if (!db_fieldExists('is_menu','lnkCacheable'))
              db_sql("alter table is_menu add lnkCacheable integer default 0");

            if (!db_fieldExists('is_menu','lnkAutoPrint'))
              db_sql("alter table is_menu add lnkAutoPrint integer default 0");

            if (!db_fieldExists('is_menu','hasImplementation'))
              db_sql("alter table is_menu add hasImplementation integer default 0");

          }
          _db_upd_newVersion(5);
        } catch (Exception $e) {
          _db_upd_error($e->getMessage());
        }
      }

      if (_db_upd_canReviewVersion(6)) {
        _recordWastedTime("checking v6");
        try {
          if (db_tableExists('is_menu')) {
            if (!db_fieldExists('is_menu','app'))
              db_sql("alter table is_menu add app integer default 0");
            if (!db_fieldExists('is_menu','permiteAtivacao'))
              db_sql("alter table is_menu add permiteAtivacao integer default 0");
            if (!db_fieldExists('is_menu','permiteCriarItems'))
              db_sql("alter table is_menu add permiteCriarItems  integer default 0");
            if (!db_fieldExists('is_menu','explanation')) {
              if (db_connectionTypeIs(_MYSQL_))
                db_sql("alter table is_menu add explanation text");
              else
                db_sql("alter table is_menu add explanation varchar(2048)");
            }
            if (!db_fieldExists('is_menu','ativo'))
              db_sql("alter table is_menu add ativo char(1) default 'S'");

            if (valorSQL("select count(*) from is_menu where s='menus'")==0) {
              $newID=intval(db_sql("select max(ID) from is_menu"))+1;
              if (($newID)<2100)
                $newID=2100;
              db_sql("INSERT INTO is_menu (ID, enabled, attr, o, ancestor, label, d, rights, a, s, implementation, explanation, ativo, app, permiteAtivacao, permiteCriarItems, lnkNewWindow, lnkNewWindowWidth, lnkNewWindowHeight, lnkAllWide, lnkWOHeader, clickCounter, lnkNewWindowLeft, lnkNewWindowTop, lnkCacheable, hasImplementation) VALUES ($newID, 'Y', '2', '0', '-1', 'Navega��o', '', '2', NULL, 'menus', NULL, NULL, 'N', '65535', '1', '0', '0', '600', '480', '1', '1', '0', '20', '40', '0', '0')");
            }
            if (valorSQL("select count(*) from is_menu where s='menuSuperior'")==0) {
              $newID=intval(db_sql("select max(ID) from is_menu"))+1;
              if (($newID)<2101)
                $newID=2101;
              db_sql("INSERT INTO is_menu (ID, enabled, attr, o, ancestor, label, d, rights, a, s, implementation, explanation, ativo, app, permiteAtivacao, permiteCriarItems, lnkNewWindow, lnkNewWindowWidth, lnkNewWindowHeight, lnkAllWide, lnkWOHeader, clickCounter, lnkNewWindowLeft, lnkNewWindowTop, lnkCacheable, hasImplementation) VALUES ($newID, 'Y', '0', '0', '2100', 'Menu Superior', '', '4', NULL, 'menuSuperior', NULL, NULL, NULL, '65535', '1', '1', '0', '600', '480', '1', '1', '0', '20', '40', '0', '0')");
            }
            if (valorSQL("select count(*) from is_menu where s='menuLateral'")==0) {
              $newID=intval(db_sql("select max(ID) from is_menu"))+1;
              if (($newID)<2102)
                $newID=2102;
              db_sql("INSERT INTO is_menu (ID, enabled, attr, o, ancestor, label, d, rights, a, s, implementation, explanation, ativo, app, permiteAtivacao, permiteCriarItems, lnkNewWindow, lnkNewWindowWidth, lnkNewWindowHeight, lnkAllWide, lnkWOHeader, clickCounter, lnkNewWindowLeft, lnkNewWindowTop, lnkCacheable, hasImplementation) VALUES ('$newID', 'Y', '0', '0', '2100', 'Menu Lateral', '', '4', NULL, 'menuLateral', NULL, NULL, NULL, '65535', '1', '1', '0', '600', '480', '1', '1', '0', '20', '40', '0', '0')");
            }
            if (valorSQL("select count(*) from is_menu where s='menuInferior'")==0) {
              $newID=intval(db_sql("select max(ID) from is_menu"))+1;
              if (($newID)<2103)
                $newID=2103;
              db_sql("INSERT INTO is_menu (ID, enabled, attr, o, ancestor, label, d, rights, a, s, implementation, explanation, ativo, app, permiteAtivacao, permiteCriarItems, lnkNewWindow, lnkNewWindowWidth, lnkNewWindowHeight, lnkAllWide, lnkWOHeader, clickCounter, lnkNewWindowLeft, lnkNewWindowTop, lnkCacheable, hasImplementation) VALUES (2103, 'Y', '0', '0', '2100', 'Menu Inferior', '', '4', NULL, 'menuInferior', NULL, NULL, NULL, '65535', '1', '1', '0', '600', '480', '1', '1', '0', '20', '40', '0', '0')");
            }
            if (valorSQL("select count(*) from is_menu where s='menuPopup'")==0) {
              $newID=intval(db_sql("select max(ID) from is_menu"))+1;
              if (($newID)<2104)
                $newID=2104;
              db_sql("INSERT INTO is_menu (ID, enabled, attr, o, ancestor, label, d, rights, a, s, implementation, explanation, ativo, app, permiteAtivacao, permiteCriarItems, lnkNewWindow, lnkNewWindowWidth, lnkNewWindowHeight, lnkAllWide, lnkWOHeader, clickCounter, lnkNewWindowLeft, lnkNewWindowTop, lnkCacheable, hasImplementation) VALUES ($newID, 'Y', '0', '0', '2100', 'Pop-up', '', '4', NULL, 'menuPopup', NULL, NULL, NULL, '65535', '1', '1', '0', '600', '480', '1', '1', '0', '20', '40', '0', '0')");
            }
            if (valorSQL("select count(*) from is_menu where s='menuChamada'")==0) {
              $newID=intval(db_sql("select max(ID) from is_menu"))+1;
              if (($newID)<2105)
                $newID=2105;
              db_sql("INSERT INTO is_menu (ID, enabled, attr, o, ancestor, label, d, rights, a, s, implementation, explanation, ativo, app, permiteAtivacao, permiteCriarItems, lnkNewWindow, lnkNewWindowWidth, lnkNewWindowHeight, lnkAllWide, lnkWOHeader, clickCounter, lnkNewWindowLeft, lnkNewWindowTop, lnkCacheable, hasImplementation) VALUES ($newID, 'Y', '0', '0', '2100', 'Chamada', '', '4', NULL, 'menuChamada', NULL, NULL, NULL, '65535', '1', '1', '0', '600', '480', '1', '1', '0', '20', '40', '0', '0')");
            }
            if (valorSQL("select count(*) from is_menu where s='artigos'")==0) {
              $newID=intval(db_sql("select max(ID) from is_menu"))+1;
              if (($newID)<4000)
                $newID=4000;
              db_sql("INSERT INTO is_menu (ID, enabled, attr, o, ancestor, label, d, rights, a, s, implementation, explanation, ativo, app, permiteAtivacao, permiteCriarItems, lnkNewWindow, lnkNewWindowWidth, lnkNewWindowHeight, lnkAllWide, lnkWOHeader, clickCounter, lnkNewWindowLeft, lnkNewWindowTop, lnkCacheable, hasImplementation) VALUES ($newID, 'Y', '2', '0', '-1', 'Artigos', '', '2', NULL, 'artigos', NULL, NULL, 'S', '128', '1', '1', '0', '600', '480', '1', '1', '0', '20', '40', '0', '0')");
            }

            if (valorSQL("select count(*) from is_menu where s='sessoes'")==0) {
              $newID=intval(db_sql("select max(ID) from is_menu"))+1;
              if (($newID)<4001)
                $newID=4001;
              db_sql("INSERT INTO is_menu (ID, enabled, attr, o, ancestor, label, d, rights, a, s, implementation, explanation, ativo, app, permiteAtivacao, permiteCriarItems, lnkNewWindow, lnkNewWindowWidth, lnkNewWindowHeight, lnkAllWide, lnkWOHeader, clickCounter, lnkNewWindowLeft, lnkNewWindowTop, lnkCacheable, hasImplementation) VALUES ($newID, 'Y', '2', '0', '-1', 'Sess�es', '', '2', NULL, 'sessoes', NULL, NULL, 'S', '128', '1', '1', '0', '600', '480', '1', '1', '0', '20', '40', '0', '0')");
            }
          }
          _db_upd_newVersion(6);
        } catch (Exception $e) {
          _db_upd_error($e->getMessage());
        }
      }

      if (_db_upd_canReviewVersion(7)) {
        _recordWastedTime("checking v7");
        try {
          if (!db_tableExists('is_jails')) {

            $sql ="create table is_jails (";
            $sql.="  userID integer, ";
            if (db_connectionTypeIs(_MYSQL_))
            $sql.="  jails text ";
            else
            $sql.="  jails varchar(512) ";
            $sql.=")";
            db_sql($sql);

            $sql="create unique index idx_jails on is_jails(userID)";
            db_sql($sql);

          }
          _db_upd_newVersion(7);
        } catch (Exception $e) {
          _db_upd_error($e->getMessage());
        }
      }

      if (_db_upd_canReviewVersion(8)) {
        _recordWastedTime("checking v8");
        try {
          if (!db_tableExists('wbp_buffer')) {
            $sql ="CREATE TABLE wbp_buffer (";
            $sql.="  id varchar(48) NOT NULL,";
            $sql.="  device varchar(22),";
            $sql.="  printer varchar(48) ,";
            $sql.="  description varchar(120) ,";
            $sql.="  orientation char(1) DEFAULT NULL,";
            if (db_connectionTypeIs(_MYSQL_))
              $sql.="  buffer text,";
            else
              $sql.="  buffer varchar(2048),";
            $sql.="  creationDate integer ,";
            $sql.="  lastAccess integer DEFAULT NULL ,";
            $sql.="  status integer ,";
            $sql.="  erro varchar(240) ,";
            $sql.="  valor float DEFAULT NULL ,";
            $sql.="  PRIMARY KEY (id)";
            if (db_connectionTypeIs(_MYSQL_))
              $sql.="  ,KEY printer (printer)";
            $sql.=")";
            db_sql($sql);
          }
          // 082Msvs+B+v1F4SYokfZmLI1+RJH8vdv17JGzdUa9y0rC7sINtNll+CqN36y05w6tFxl5JsMUBHl99xQNrvzGmb0
          if (!db_tableExists('wbp_devices')) {
            $sql="CREATE TABLE wbp_devices (";
            $sql.="  id varchar(22) NOT NULL, ";
            $sql.="  verification varchar(48),";
            $sql.="  place varchar(120) ,";
            $sql.="  lastAccess integer ,";
            $sql.="  keepAlive integer DEFAULT '10',";
            $sql.="  PRIMARY KEY (id)";
            $sql.=")";
            db_sql($sql);
          }

          if (!db_tableExists('wbp_files')) {
            $sql ="CREATE TABLE wbp_files (";
            $sql.="  id varchar(48) NOT NULL,";
            $sql.="  fileName varchar(120) ,";
            $sql.="  sequence integer,";
            if (db_connectionTypeIs(_MYSQL_))
              $sql.="  data text,";
            else
              $sql.="  data varchar(2048),";
            $sql.="  PRIMARY KEY (id)";
            $sql.=")";
            db_sql($sql);
          }

          if (!db_tableExists('wbp_printers')) {
            $sql ="CREATE TABLE wbp_printers (";
            $sql.="  id varchar(48) NOT NULL,";
            $sql.="  sid integer ,";
            $sql.="  device varchar(22) ,";
            $sql.="  virtualType char(3),";
            $sql.="  virtualName varchar(120),";
            $sql.="  windowsName varchar(120),";
            $sql.="  lastAccess integer,";
            $sql.="  PRIMARY KEY (id)";
            $sql.=")";
            db_sql($sql);
          }

          if (!db_fieldExists('wbp_printers','sid')) {
            if (db_connectionTypeIs(_MYSQL_))
              db_sql("ALTER TABLE wbp_printers ADD sid INT  DEFAULT NULL NULL after ID");
            else
              db_sql("ALTER TABLE wbp_printers ADD sid INTEGER DEFAULT NULL");
          }

          _db_upd_newVersion(8);
        } catch (Exception $e) {
          _db_upd_error($e->getMessage());
        }
      }

      if (_db_upd_canReviewVersion(9)) {
        _recordWastedTime("checking v9");
        try {
          if (!db_tableExists('is_updates')) {
            $sql ="create table is_updates (";
            $sql.="id varchar(40), ";
            $sql.="realization varchar(14) DEFAULT NULL, ";
            $sql.="s varchar(50) DEFAULT NULL, ";
            $sql.="layer varchar(78) DEFAULT NULL, ";
            if (db_connectionTypeIs(_MYSQL_))
              $sql.="description text, ";
            else
              $sql.="description varchar(8192), ";
            $sql.="userID varchar(40) DEFAULT NULL, ";
            $sql.="pageID varchar(78) DEFAULT NULL) ";
            db_sql($sql);

            $sql="create unique index idx_updates on is_updates(id)";
            db_sql($sql);
            $sql="create index idx_updates2 on is_updates(s)";
            db_sql($sql);

          }
          _db_upd_newVersion(9);
        } catch (Exception $e) {
          _db_upd_error($e->getMessage());
        }
      }

      if (_db_upd_canReviewVersion(10)) {
        _recordWastedTime("checking v10");
        try {
          _db_upd_createAuditingTrackTable();
          _db_upd_newVersion(10);
        } catch (Exception $e) {
          _db_upd_error($e->getMessage());
        }

      }

      if (_db_upd_canReviewVersion(11)) {
        _recordWastedTime("checking v11");

        try {
          if (!db_tableExists('is_perfil_usuarios')) {
            $sql="CREATE TABLE is_perfil_usuarios (
                    bit integer DEFAULT NULL,
                    etiqueta varchar(40) DEFAULT NULL,
                    explanacao varchar(512)
                  )";
            db_sql($sql);
            db_commit();

            db_sql("INSERT INTO is_perfil_usuarios (bit, etiqueta, explanacao) VALUES(0, 'YeAPF-reserved', NULL)");
            db_sql("INSERT INTO is_perfil_usuarios (bit, etiqueta, explanacao) VALUES(1, 'YeAPF-cms', NULL)");
            db_sql("INSERT INTO is_perfil_usuarios (bit, etiqueta, explanacao) VALUES(2, 'YeAPF-reserved', NULL)");
          }
          _db_upd_newVersion(10);
        } catch(Exception $e) {
          _db_upd_error($e->getMessage());
        }

      }

      if(_db_upd_canReviewVersion(12)) {
        _recordWastedTime("checking v12");
        try {
          if (!db_tableExists('is_tasks')) {
            $sql="CREATE TABLE  is_tasks (
                                id INT NOT NULL ,
                                creation_ts INT,
                                finalization_ts INT ,
                                iteraction_ts INT ,
                                iteraction_ttl INT DEFAULT 480,
                                stage INT ,
                                priority INT ,
                                mru INT DEFAULT 0,
                                s VARCHAR(48) ,
                                a VARCHAR(48) ,
                                xq_start INT ,
                                xq_target INT ,
                                j_params VARCHAR(512) ,
                                PRIMARY KEY (id))";
            db_sql($sql);
            db_commit();
          }
          _db_upd_newVersion(12);
        } catch(Exception $e) {
          _db_upd_error($e->getMessage());
        }
      }

      if(_db_upd_canReviewVersion(13)) {
        _recordWastedTime("checking v13");
        try {
          if (db_tableExists("is_auditingTrack")) {
            if (db_tableExists("is_auditing_track")) {
              _die("'is_auditing_track' already exists.\nYeAPF db v.13 is trying to rename 'is_auditingTrack' to 'is_auditing_track'.\nYou need to solve this by yourself as it can have serious impact in your application\n");
            } else {
              if (db_connectionTypeIs(_FIREBIRD_)) {
                /*
                _db_upd_createAuditingTrackTable();
                db_close();
                sleep(5);
                db_reconnect();
                $sql="insert into is_auditing_track select * from is_auditingTrack";
                db_sql($sql);
                */
                $sql='SELECT count(*) FROM rdb$relations WHERE (rdb$relation_name = \'IS_AUDITING_TRACK\') AND (rdb$view_blr IS NOT NULL)';
                $cc=intval(db_sql($sql));
                if ($cc==0) {
                  $sql="create view is_auditing_track as select * from is_auditingTrack";
                  db_sql($sql);
                }
              } else if (db_connectionTypeIs(_MYSQL_)) {
                $sql="RENAME TABLE `is_auditingTrack` TO `is_auditing_track`";
                db_sql($sql);
              } else if (db_connectionTypeIs(_PGSQL_))  {
                $sql="alter table is_auditingTrack rename to is_auditing_track";
                db_sql($sql);
              }
            }
          }
          _db_upd_newVersion(13);
        } catch(Exception $e) {
          _db_upd_error($e->getMessage());
        }
      }

      if (_db_upd_canReviewVersion(14)) {
        _recordWastedTime("checking v14");
        try {
          if (db_tableExists("wbp_buffer")) {
            if (!db_fieldExists("wbp_buffer", "o")) {
              $sql="ALTER TABLE wbp_buffer ADD o Integer";
              db_sql($sql);
            }
            if (!db_fieldExists("wbp_buffer", "queue")) {
              $sql="ALTER TABLE wbp_buffer ADD queue char(32)";
              db_sql($sql);
            }

            if (!db_tableExists("wbp_queue")) {
              $sql="CREATE TABLE wbp_queue (
                      id char(32) NOT NULL,
                      device char(32) NOT NULL,
                      printer char(32) NOT NULL,
                      creationDate integer NOT NULL,
                      queueSize smallint NOT NULL,
                      status integer NOT NULL
                    )";
              db_sql($sql);
            }
          } else {
            _die("'wbp_printers' table not found");
          }
          _db_upd_newVersion(14);
        } catch(Exception $e) {
          _db_upd_error($e->getMessage());
        }

      }

      if (_db_upd_canReviewVersion(15)) {
        _recordWastedTime("checking v15");
        try {
          if (!db_tableExists("is_server_control")) {
            $sql="create table is_server_control(
              serverKey char(16) not null,
              enabled char(1) default 'N',
              last_verification integer
            )";
            db_sql("$sql");
          }

          if (!db_tableExists("is_node_control")) {
            $sql="create table is_node_control(
              serverKey char(16) not null,
              nodePrefix char(3) not null,
              enabled char(1) default 'N',
              internal_ip char(15),
              external_ip char(15),
              reverse_ip varchar(255),
              last_verification integer
            )";
            db_sql("$sql");
          }

          if (!db_tableExists("is_sequence")) {
            $sql="CREATE TABLE is_sequence (
                    nodePrefix char(3) NOT NULL,
                    segment char(4) NOT NULL,
                    seq_value bigint NOT NULL
                  )";
            db_sql($sql);
            $sql="create index idx_sequence on is_sequence(nodePrefix, clientPrefix)";
            db_sql($sql);
          }

          if (!db_tableExists("is_segment_control")) {
            /* nodeController side */
            $sql="CREATE TABLE is_segment_control (
                    serverKey char(16) NOT NULL,
                    nodePrefix char(3) NOT NULL,
                    identity char(32) NULL,
                    segment char(4) not null,
                    creation char(14) not null,
                    regulation char(14)
                  )";
            db_sql($sql);
            db_sql("ALTER TABLE is_segment_control ADD PRIMARY KEY ( serverKey , nodePrefix, segment )");
            if (db_connectionTypeIs(_FIREBIRD_) || db_connectionTypeIs(_PGSQL_)) {
              db_sql("create unique index ndxIdentity on is_segment_control (identity)");
            } else {
              db_sql("ALTER TABLE is_segment_control ADD UNIQUE ndxIdentity ( identity )");
            }
          }

          if (!db_tableExists("is_segment_reservation")) {
            /* nodeApp side */
            $sql="CREATE TABLE is_segment_reservation (
                    serverKey char(16) NOT NULL,
                    nodePrefix char(3) NOT NULL,
                    identity char(32) NULL,
                    segment char(4) not null,
                    request char(14) not null,
                    regulation char(14) null,
                    regulation_message char(48) null
                  )";
            db_sql($sql);
            db_sql("ALTER TABLE is_segment_reservation ADD PRIMARY KEY ( serverKey , nodePrefix, segment )");
            if (db_connectionTypeIs(_FIREBIRD_) || db_connectionTypeIs(_PGSQL_)) {
              db_sql("create unique index ndxIdentity on is_segment_reservation (identity)");
            } else {
              db_sql("ALTER TABLE is_segment_reservation ADD UNIQUE ndxIdentity ( identity )");
            }
          }

          _db_upd_newVersion(15);
        } catch(Exception $e) {
          _db_upd_error($e->getMessage());
        }
      }

    }

    if ($flagDBStructureReviewed) {
      _recordWastedTime("checking is_context");
      if (((date('w')==1) && ($lastDBCleanUp<date('Ymd0000'))) || ($lastDBCleanUp=='')) {
        $lastDBCleanUp=date('YmdHi');
        if (db_tableExists('is_context'))
          db_sql("delete from is_context");
        _db_grantSetupIni();
        $setupIni->addField('lastDBCleanUp');
        $setupIni->setValue('lastDBCleanUp',$lastDBCleanUp);
        $setupIni->commit();
      }
    }

  }
?>


text:
<!DOCTYPE html>

        <meta charset="UTF-8">
        <title>Runners Home Page</title>

Hello, strangers!

Welcome to the Runners Home™

Runners Home™ is dedicated to providing you with:

the most up-to-date information on running races

the best resources for runners

 ©Runners Home. All rights reserved.


text:
import * as assert from 'assert';
import { ITreeNode, ITreeRenderer, IDataSource } from 'vs/base/browser/ui/tree/tree';
import { IListVirtualDelegate, IIdentityProvider } from 'vs/base/browser/ui/list/list';
import { DataTree } from 'vs/base/browser/ui/tree/dataTree';

interface E {
	value: number;
	children?: E[];
}

suite('DataTree', function () {
	let tree: DataTree<E, E>;

	const root: E = {
		value: -1,
		children: [
			{ value: 0, children: [{ value: 10 }, { value: 11 }, { value: 12 }] },
			{ value: 1 },
			{ value: 2 },
		]
	};

	const empty: E = {
		value: -1,
		children: []
	};

	setup(() => {
		const container = document.createElement('div');
		container.style.width = '200px';
		container.style.height = '200px';

		const delegate = new class implements IListVirtualDelegate<E> {
			getHeight() { return 20; }
			getTemplateId(): string { return 'default'; }
		};

		const renderer = new class implements ITreeRenderer<E, void, HTMLElement> {
			readonly templateId = 'default';
			renderTemplate(container: HTMLElement): HTMLElement {
				return container;
			}
			renderElement(element: ITreeNode<E, void>, index: number, templateData: HTMLElement): void {
				templateData.textContent = `${element.element.value}`;
			}
			disposeTemplate(): void { }
		};

		const dataSource = new class implements IDataSource<E, E> {
			getChildren(element: E): E[] {
				return element.children || [];
			}
		};

		const identityProvider = new class implements IIdentityProvider<E> {
			getId(element: E): { toString(): string; } {
				return `${element.value}`;
			}
		};

		tree = new DataTree<E, E>('test', container, delegate, [renderer], dataSource, {
			identityProvider
		});
		tree.layout(200);
	});

	teardown(() => {
		tree.dispose();
	});

	test('view state is lost implicitly', () => {
		tree.setInput(root);

		let navigator = tree.navigate();
		assert.equal(navigator.next()!.value, 0);
		assert.equal(navigator.next()!.value, 10);
		assert.equal(navigator.next()!.value, 11);
		assert.equal(navigator.next()!.value, 12);
		assert.equal(navigator.next()!.value, 1);
		assert.equal(navigator.next()!.value, 2);
		assert.equal(navigator.next()!, null);

		tree.collapse(root.children![0]);
		navigator = tree.navigate();
		assert.equal(navigator.next()!.value, 0);
		assert.equal(navigator.next()!.value, 1);
		assert.equal(navigator.next()!.value, 2);
		assert.equal(navigator.next()!, null);

		tree.setSelection([root.children![1]]);
		tree.setFocus([root.children![2]]);

		tree.setInput(empty);
		tree.setInput(root);
		navigator = tree.navigate();
		assert.equal(navigator.next()!.value, 0);
		assert.equal(navigator.next()!.value, 10);
		assert.equal(navigator.next()!.value, 11);
		assert.equal(navigator.next()!.value, 12);
		assert.equal(navigator.next()!.value, 1);
		assert.equal(navigator.next()!.value, 2);
		assert.equal(navigator.next()!, null);

		assert.deepEqual(tree.getSelection(), []);
		assert.deepEqual(tree.getFocus(), []);
	});

	test('view state can be preserved', () => {
		tree.setInput(root);

		let navigator = tree.navigate();
		assert.equal(navigator.next()!.value, 0);
		assert.equal(navigator.next()!.value, 10);
		assert.equal(navigator.next()!.value, 11);
		assert.equal(navigator.next()!.value, 12);
		assert.equal(navigator.next()!.value, 1);
		assert.equal(navigator.next()!.value, 2);
		assert.equal(navigator.next()!, null);

		tree.collapse(root.children![0]);
		navigator = tree.navigate();
		assert.equal(navigator.next()!.value, 0);
		assert.equal(navigator.next()!.value, 1);
		assert.equal(navigator.next()!.value, 2);
		assert.equal(navigator.next()!, null);

		tree.setSelection([root.children![1]]);
		tree.setFocus([root.children![2]]);

		const viewState = tree.getViewState();

		tree.setInput(empty);
		tree.setInput(root, viewState);
		navigator = tree.navigate();
		assert.equal(navigator.next()!.value, 0);
		assert.equal(navigator.next()!.value, 1);
		assert.equal(navigator.next()!.value, 2);
		assert.equal(navigator.next()!, null);

		assert.deepEqual(tree.getSelection(), [root.children![1]]);
		assert.deepEqual(tree.getFocus(), [root.children![2]]);
	});
});


text:
package org.apache.camel.component.weather;

import java.util.Scanner;

import org.apache.camel.component.weather.geolocation.FreeGeoIpGeoLocationProvider;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.UriParams;
import org.apache.camel.spi.UriPath;

import static org.apache.camel.component.weather.WeatherLanguage.en;
import static org.apache.camel.component.weather.WeatherMode.JSON;
import static org.apache.camel.component.weather.WeatherUnits.METRIC;
import static org.apache.camel.util.ObjectHelper.notNull;

@UriParams
public class WeatherConfiguration {

    private final WeatherComponent component;
    private final WeatherQuery weatherQuery;

    @UriPath(description = "The name value is not used.") @Metadata(required = "true")
    private String name;
    @UriParam @Metadata(required = "true")
    private String appid;
    @UriParam
    private String location = "";
    @UriParam
    private String lat;
    @UriParam
    private String lon;
    @UriParam
    private String rightLon;
    @UriParam
    private String topLat;
    @UriParam
    private Integer zoom;
    @UriParam
    private String period = "";
    @UriParam(defaultValue = "JSON")
    private WeatherMode mode = JSON;
    @UriParam
    private WeatherUnits units;
    @UriParam(defaultValue = "en")
    private WeatherLanguage language = en;
    @UriParam
    private String headerName;

    public WeatherConfiguration(WeatherComponent component) {
        this.component = notNull(component, "component");
        weatherQuery = new WeatherQuery(this);
        FreeGeoIpGeoLocationProvider geoLocationProvider = new FreeGeoIpGeoLocationProvider();
        geoLocationProvider.setCamelContext(component.getCamelContext());
        weatherQuery.setGeoLocationProvider(geoLocationProvider);
    }

    public String getPeriod() {
        return period;
    }

    /**
     * If null, the current weather will be returned, else use values of 5, 7, 14 days.
     * Only the numeric value for the forecast period is actually parsed, so spelling, capitalisation of the time period is up to you (its ignored)
     */
    public void setPeriod(String period) {
        notNull(period, "period");
        int result = 0;
        try {
            result = new Scanner(period).useDelimiter("\\D+").nextInt();
        } catch (Exception e) {
            // ignore and fallback the period to be an empty string
        }
        if (result != 0) {
            this.period = "" + result;
        }
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public WeatherMode getMode() {
        return mode;
    }

    /**
     * The output format of the weather data.
     */
    public void setMode(WeatherMode mode) {
        this.mode = notNull(mode, "mode");
    }

    public WeatherUnits getUnits() {
        return units;
    }

    /**
     * The units for temperature measurement.
     */
    public void setUnits(WeatherUnits units) {
        this.units = notNull(units, "units");
    }

    public String getLocation() {
        return location;
    }

    /**
     * If null Camel will try and determine your current location using the geolocation of your ip address,
     * else specify the city,country. For well known city names, Open Weather Map will determine the best fit,
     * but multiple results may be returned. Hence specifying and country as well will return more accurate data.
     * If you specify "current" as the location then the component will try to get the current latitude and longitude
     * and use that to get the weather details. You can use lat and lon options instead of location.
     */
    public void setLocation(String location) {
        this.location = location;
    }

    public String getHeaderName() {
        return headerName;
    }

    /**
     * To store the weather result in this header instead of the message body. This is useable if you want to keep current message body as-is.
     */
    public void setHeaderName(String headerName) {
        this.headerName = headerName;
    }

    public String getLat() {
        return lat;
    }

    /**
     * Latitude of location. You can use lat and lon options instead of location.
     * For boxed queries this is the bottom latitude.
     */
    public void setLat(String lat) {
        this.lat = lat;
    }

    public String getLon() {
        return lon;
    }

    /**
     * Longitude of location. You can use lat and lon options instead of location.
     * For boxed queries this is the left longtitude.
     */
    public void setLon(String lon) {
        this.lon = lon;
    }

    /**
     * APPID ID used to authenticate the user connected to the API Server
     */
    public void setAppid(String appid) {
        this.appid = appid;
    }

    public String getAppid() {
        return appid;
    }

    String getQuery() throws Exception {
        return weatherQuery.getQuery();
    }

    String getQuery(String location) throws Exception {
        return weatherQuery.getQuery(location);
    }

    public WeatherLanguage getLanguage() {
        return language;
    }

    /**
     * Language of the response.
     */
    public void setLanguage(WeatherLanguage language) {
        this.language = language;
    }

    public String getRightLon() {
        return rightLon;
    }

    /**
     * For boxed queries this is the right longtitude. Needs to be used
     * in combination with topLat and zoom.
     */
    public void setRightLon(String rightLon) {
        this.rightLon = rightLon;
    }

    public String getTopLat() {
        return topLat;
    }

    /**
     * For boxed queries this is the top latitude. Needs to be used
     * in combination with rightLon and zoom.
     */
    public void setTopLat(String topLat) {
        this.topLat = topLat;
    }

    public Integer getZoom() {
        return zoom;
    }

    /**
     * For boxed queries this is the zoom. Needs to be used
     * in combination with rightLon and topLat.
     */
    public void setZoom(Integer zoom) {
        this.zoom = zoom;
    }
}


text:
<?php
namespace Avenue\Interfaces;

interface RequestInterface
{
    /**
     * Check if http request is GET method.
     */
    public function isGet();

    /**
     * Check if http request is POST method.
     */
    public function isPost();

    /**
     * Check if http request is PUT method.
     */
    public function isPut();

    /**
     * Check if http request is DELETE method.
     */
    public function isDelete();

    /**
     * Check if http request is OPTIONS method.
     */
    public function isOptions();

    /**
     * Check if http request is PATCH method.
     */
    public function isPatch();

    /**
     * Check if http request is HEAD method.
     */
    public function isHead();

    /**
     * Check if http request is TRACE method.
     */
    public function isTrace();

    /**
     * Check if http request is CONNECT method.
     */
    public function isConnect();

    /**
     * Get the current http request method.
     * Returned as lowercase if the parameter is true.
     *
     * @param boolean $lowerCase
     */
    public function getRequestMethod($lowerCase = false);

    /**
     * Check if request is made via Ajax.
     */
    public function isAjax();

    /**
     * Check if secure http.
     */
    public function isSecure();

    /**
     * Get particular header value based on the key.
     *
     * @param mixed $key
     */
    public function getHeader($key);

    /**
     * Get all headers of the http request.
     */
    public function getAllHeaders();

    /**
     * Alternative for getting all headers of http request via custom handling.
     * Useful for say, nginx web server.
     */
    public function getCustomAllHeaders();

    /**
     * Get the URL path info.
     */
    public function getPathInfo();

    /**
     * Get the query string parameters.
     */
    public function getQueryString();

    /**
     * Get the parsed query string in array
     */
    public function getParsedQueryString();

    /**
     * Get the host name.
     */
    public function getHost();

    /**
     * Get the current URL's scheme.
     */
    public function getScheme();

    /**
     * Get the page script name.
     */
    public function getScriptName();

    /**
     * Get the current request URI.
     */
    public function getRequestUri();

    /**
     * Get the current user agent.
     */
    public function getUserAgent();

    /**
     * Get the base URL of request.
     */
    public function getBaseUrl();

    /**
     * Page redirection with path provided.
     * Base URL is included if second parameter is true.
     *
     * @param mixed $path
     * @param string $baseUrl
     */
    public function redirect($path, $baseUrl = true);

    /**
     * Get IP address.
     */
    public function getIpAddress();

    /**
     * Get the raw data of request body.
     */
    public function getBody();

    /**
     * Alias method for getting namespace prefix (directory) name that provided in route for request.
     */
    public function getPrefix();

    /**
     * Alias method for getting controller name that provided in route for request.
     */
    public function getController();

    /**
     * Alias method for getting controller namespace.
     */
    public function getNamespace();

    /**
     * Alias method for getting action name that provided in route for request.
     */
    public function getAction();
}


text:
/*This header file defines a table of extensions to the ARC processor
  architecture.  These extensions are read from the '.arcextmap' or
  '.gnu.linkonce.arcextmap.<type>.<N>' sections in the ELF file which
  is identified by the bfd parameter to the build_ARC_extmap function.

  These extensions may include:
	 core registers
	 auxiliary registers
	 instructions
	 condition codes

  Once the table has been constructed, accessor functions may be used
  to retrieve information from it.

  The build_ARC_extmap constructor function build_ARC_extmap may be
  called as many times as required; it will re-initialize the table
  each time.  */

#ifndef ARC_EXTENSIONS_H
#define ARC_EXTENSIONS_H

#include "opcode/arc.h"

#ifdef __cplusplus
extern "C" {
#endif

#define IGNORE_FIRST_OPD 1

/* Define this if we do not want to encode instructions based on the
   ARCompact Programmer's Reference.  */
#define UNMANGLED

/* This defines the kinds of extensions which may be read from the
   ections in the executable files.  */
enum ExtOperType
{
  EXT_INSTRUCTION	     = 0,
  EXT_CORE_REGISTER	     = 1,
  EXT_AUX_REGISTER	     = 2,
  EXT_COND_CODE		     = 3,
  EXT_INSTRUCTION32	     = 4,
  EXT_AC_INSTRUCTION	     = 4,
  EXT_REMOVE_CORE_REG	     = 5,
  EXT_LONG_CORE_REGISTER     = 6,
  EXT_AUX_REGISTER_EXTENDED  = 7,
  EXT_INSTRUCTION32_EXTENDED = 8,
  EXT_CORE_REGISTER_CLASS    = 9
};

enum ExtReadWrite
{
  REG_INVALID,
  REG_READ,
  REG_WRITE,
  REG_READWRITE
};

/* Macro used when generating the patterns for an extension
   instruction.  */
#define INSERT_XOP(OP, NAME, CODE, MASK, CPU, ARG, FLG)	\
  do {							\
    (OP)->name   = NAME;				\
    (OP)->opcode = CODE;				\
    (OP)->mask   = MASK;				\
    (OP)->cpu    = CPU;					\
    (OP)->insn_class  = ARITH;				\
    (OP)->subclass = NONE;				\
    memcpy ((OP)->operands, (ARG), MAX_INSN_ARGS);	\
    memcpy ((OP)->flags, (FLG), MAX_INSN_FLGS);		\
    (OP++);						\
  } while (0)

/* Typedef to hold the extension instruction definition.  */
typedef struct ExtInstruction
{
  /* Name.  */
  char *name;

  /* Major opcode.  */
  char major;

  /* Minor(sub) opcode.  */
  char minor;

  /* Flags, holds the syntax class and modifiers.  */
  char flags;

  /* Syntax class.  Use by assembler.  */
  unsigned char syntax;

  /* Syntax class modifier.  Used by assembler.  */
  unsigned char modsyn;

  /* Suffix class.  Used by assembler.  */
  unsigned char suffix;

  /* Pointer to the next extension instruction.  */
  struct ExtInstruction* next;
} extInstruction_t;

/* Constructor function.  */
extern void build_ARC_extmap (bfd *);

/* Accessor functions.  */
extern enum ExtReadWrite arcExtMap_coreReadWrite (int);
extern const char * arcExtMap_coreRegName (int);
extern const char * arcExtMap_auxRegName (long);
extern const char * arcExtMap_condCodeName (int);
extern const extInstruction_t *arcExtMap_insn (int, unsigned long long);
extern struct arc_opcode *arcExtMap_genOpcode (const extInstruction_t *,
					       unsigned arc_target,
					       const char **errmsg);

/* Dump function (for debugging).  */
extern void dump_ARC_extmap (void);

#ifdef __cplusplus
}
#endif

#endif /* ARC_EXTENSIONS_H */


text:
<?php
namespace metastore;

/**
 * Autogenerated by Thrift Compiler (0.14.1)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;

class CacheFileMetadataResult
{
    static public $isValidate = false;

    static public $_TSPEC = array(
        1 => array(
            'var' => 'isSupported',
            'isRequired' => true,
            'type' => TType::BOOL,
        ),
    );

    /**
     * @var bool
     */
    public $isSupported = null;

    public function __construct($vals = null)
    {
        if (is_array($vals)) {
            if (isset($vals['isSupported'])) {
                $this->isSupported = $vals['isSupported'];
            }
        }
    }

    public function getName()
    {
        return 'CacheFileMetadataResult';
    }

    public function read($input)
    {
        $xfer = 0;
        $fname = null;
        $ftype = 0;
        $fid = 0;
        $xfer += $input->readStructBegin($fname);
        while (true) {
            $xfer += $input->readFieldBegin($fname, $ftype, $fid);
            if ($ftype == TType::STOP) {
                break;
            }
            switch ($fid) {
                case 1:
                    if ($ftype == TType::BOOL) {
                        $xfer += $input->readBool($this->isSupported);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                default:
                    $xfer += $input->skip($ftype);
                    break;
            }
            $xfer += $input->readFieldEnd();
        }
        $xfer += $input->readStructEnd();
        return $xfer;
    }

    public function write($output)
    {
        $xfer = 0;
        $xfer += $output->writeStructBegin('CacheFileMetadataResult');
        if ($this->isSupported !== null) {
            $xfer += $output->writeFieldBegin('isSupported', TType::BOOL, 1);
            $xfer += $output->writeBool($this->isSupported);
            $xfer += $output->writeFieldEnd();
        }
        $xfer += $output->writeFieldStop();
        $xfer += $output->writeStructEnd();
        return $xfer;
    }
}


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;

using ILCompiler.DependencyAnalysisFramework;

using Internal.TypeSystem;
using Internal.Runtime;
using Internal.IL;

namespace ILCompiler.DependencyAnalysis
{
    public abstract class NodeFactory
    {
        private TargetDetails _target;
        private CompilerTypeSystemContext _context;
        private CompilationModuleGroup _compilationModuleGroup;

        public NodeFactory(CompilerTypeSystemContext context, CompilationModuleGroup compilationModuleGroup)
        {
            _target = context.Target;
            _context = context;
            _compilationModuleGroup = compilationModuleGroup;
            CreateNodeCaches();

            MetadataManager = new MetadataGeneration();
        }

        public TargetDetails Target
        {
            get
            {
                return _target;
            }
        }

        public CompilationModuleGroup CompilationModuleGroup
        {
            get
            {
                return _compilationModuleGroup;
            }
        }

        public CompilerTypeSystemContext TypeSystemContext
        {
            get
            {
                return _context;
            }
        }

        public MetadataGeneration MetadataManager
        {
            get; private set;
        }

        private struct NodeCache<TKey, TValue>
        {
            private Func<TKey, TValue> _creator;
            private Dictionary<TKey, TValue> _cache;

            public NodeCache(Func<TKey, TValue> creator, IEqualityComparer<TKey> comparer)
            {
                _creator = creator;
                _cache = new Dictionary<TKey, TValue>(comparer);
            }

            public NodeCache(Func<TKey, TValue> creator)
            {
                _creator = creator;
                _cache = new Dictionary<TKey, TValue>();
            }

            public TValue GetOrAdd(TKey key)
            {
                TValue result;
                if (!_cache.TryGetValue(key, out result))
                {
                    result = _creator(key);
                    _cache.Add(key, result);
                }
                return result;
            }
        }

        private void CreateNodeCaches()
        {
            _typeSymbols = new NodeCache<TypeDesc, IEETypeNode>((TypeDesc type) =>
            {
                if (_compilationModuleGroup.ContainsType(type))
                {
                    if (type.IsGenericDefinition)
                    {
                        return new GenericDefinitionEETypeNode(type);
                    }
                    else
                    {
                        return new EETypeNode(type);
                    }
                }
                else
                {
                    return new ExternEETypeSymbolNode(type);
                }
            });

            _constructedTypeSymbols = new NodeCache<TypeDesc, IEETypeNode>((TypeDesc type) =>
            {
                if (_compilationModuleGroup.ContainsType(type))
                {
                    return new ConstructedEETypeNode(type);
                }
                else
                {
                    return new ExternEETypeSymbolNode(type);
                }
            });

            _nonGCStatics = new NodeCache<MetadataType, NonGCStaticsNode>((MetadataType type) =>
            {
                return new NonGCStaticsNode(type, this);
            });

            _GCStatics = new NodeCache<MetadataType, GCStaticsNode>((MetadataType type) =>
            {
                return new GCStaticsNode(type);
            });

            _GCStaticIndirectionNodes = new NodeCache<MetadataType, EmbeddedObjectNode>((MetadataType type) =>
            {
                ISymbolNode gcStaticsNode = TypeGCStaticsSymbol(type);
                Debug.Assert(gcStaticsNode is GCStaticsNode);
                return GCStaticsRegion.NewNode((GCStaticsNode)gcStaticsNode);
            });

            _threadStatics = new NodeCache<MetadataType, ThreadStaticsNode>((MetadataType type) =>
            {
                return new ThreadStaticsNode(type, this);
            });

            _GCStaticEETypes = new NodeCache<GCPointerMap, GCStaticEETypeNode>((GCPointerMap gcMap) =>
            {
                return new GCStaticEETypeNode(Target, gcMap);
            });

            _readOnlyDataBlobs = new NodeCache<Tuple<string, byte[], int>, BlobNode>((Tuple<string, byte[], int> key) =>
            {
                return new BlobNode(key.Item1, ObjectNodeSection.ReadOnlyDataSection, key.Item2, key.Item3);
            }, new BlobTupleEqualityComparer());

            _externSymbols = new NodeCache<string, ExternSymbolNode>((string name) =>
            {
                return new ExternSymbolNode(name);
            });

            _pInvokeModuleFixups = new NodeCache<string, PInvokeModuleFixupNode>((string name) =>
            {
                return new PInvokeModuleFixupNode(name);
            });

            _pInvokeMethodFixups = new NodeCache<Tuple<string, string>, PInvokeMethodFixupNode>((Tuple<string, string> key) =>
            {
                return new PInvokeMethodFixupNode(key.Item1, key.Item2);
            });

            _internalSymbols = new NodeCache<Tuple<ObjectNode, int, string>, ObjectAndOffsetSymbolNode>(
                (Tuple<ObjectNode, int, string> key) =>
                {
                    return new ObjectAndOffsetSymbolNode(key.Item1, key.Item2, key.Item3);
                });

            _methodEntrypoints = new NodeCache<MethodDesc, IMethodNode>(CreateMethodEntrypointNode);

            _unboxingStubs = new NodeCache<MethodDesc, IMethodNode>(CreateUnboxingStubNode);

            _virtMethods = new NodeCache<MethodDesc, VirtualMethodUseNode>((MethodDesc method) =>
            {
                return new VirtualMethodUseNode(method);
            });

            _readyToRunHelpers = new NodeCache<Tuple<ReadyToRunHelperId, Object>, ISymbolNode>(CreateReadyToRunHelperNode);

            _stringDataNodes = new NodeCache<string, StringDataNode>((string data) =>
            {
                return new StringDataNode(data);
            });

            _stringIndirectionNodes = new NodeCache<string, StringIndirectionNode>((string data) =>
            {
                return new StringIndirectionNode(data);
            });

            _typeOptionalFields = new NodeCache<EETypeOptionalFieldsBuilder, EETypeOptionalFieldsNode>((EETypeOptionalFieldsBuilder fieldBuilder) =>
            {
                return new EETypeOptionalFieldsNode(fieldBuilder, this.Target);
            });

            _interfaceDispatchCells = new NodeCache<MethodDesc, InterfaceDispatchCellNode>((MethodDesc method) =>
            {
                return new InterfaceDispatchCellNode(method);
            });

            _interfaceDispatchMaps = new NodeCache<TypeDesc, InterfaceDispatchMapNode>((TypeDesc type) =>
            {
                return new InterfaceDispatchMapNode(type);
            });

            _interfaceDispatchMapIndirectionNodes = new NodeCache<TypeDesc, EmbeddedObjectNode>((TypeDesc type) =>
            {
                var dispatchMap = InterfaceDispatchMap(type);
                return DispatchMapTable.NewNodeWithSymbol(dispatchMap, (indirectionNode) =>
                {
                    dispatchMap.SetDispatchMapIndex(this, DispatchMapTable.IndexOfEmbeddedObject(indirectionNode));
                });
            });

            _genericCompositions = new NodeCache<GenericCompositionDetails, GenericCompositionNode>((GenericCompositionDetails details) =>
            {
                return new GenericCompositionNode(details);
            });

            _eagerCctorIndirectionNodes = new NodeCache<MethodDesc, EmbeddedObjectNode>((MethodDesc method) =>
            {
                Debug.Assert(method.IsStaticConstructor);
                Debug.Assert(TypeSystemContext.HasEagerStaticConstructor((MetadataType)method.OwningType));
                return EagerCctorTable.NewNode(MethodEntrypoint(method));
            });

            _vTableNodes = new NodeCache<TypeDesc, VTableSliceNode>((TypeDesc type ) =>
            {
                if (CompilationModuleGroup.ShouldProduceFullType(type))
                    return new EagerlyBuiltVTableSliceNode(type);
                else
                    return new LazilyBuiltVTableSliceNode(type);
            });
        }

        protected abstract IMethodNode CreateMethodEntrypointNode(MethodDesc method);

        protected abstract IMethodNode CreateUnboxingStubNode(MethodDesc method);

        protected abstract ISymbolNode CreateReadyToRunHelperNode(Tuple<ReadyToRunHelperId, Object> helperCall);

        private NodeCache<TypeDesc, IEETypeNode> _typeSymbols;

        public IEETypeNode NecessaryTypeSymbol(TypeDesc type)
        {
            return _typeSymbols.GetOrAdd(type);
        }

        private NodeCache<TypeDesc, IEETypeNode> _constructedTypeSymbols;

        public IEETypeNode ConstructedTypeSymbol(TypeDesc type)
        {
            return _constructedTypeSymbols.GetOrAdd(type);
        }

        private NodeCache<MetadataType, NonGCStaticsNode> _nonGCStatics;

        public ISymbolNode TypeNonGCStaticsSymbol(MetadataType type)
        {
            if (_compilationModuleGroup.ContainsType(type))
            {
                return _nonGCStatics.GetOrAdd(type);
            }
            else
            {
                return ExternSymbol("__NonGCStaticBase_" + NodeFactory.NameMangler.GetMangledTypeName(type));
            }
        }

        private NodeCache<MetadataType, GCStaticsNode> _GCStatics;

        public ISymbolNode TypeGCStaticsSymbol(MetadataType type)
        {
            if (_compilationModuleGroup.ContainsType(type))
            {
                return _GCStatics.GetOrAdd(type);
            }
            else
            {
                return ExternSymbol("__GCStaticBase_" + NodeFactory.NameMangler.GetMangledTypeName(type));
            }
        }

        private NodeCache<MetadataType, EmbeddedObjectNode> _GCStaticIndirectionNodes;

        public EmbeddedObjectNode GCStaticIndirection(MetadataType type)
        {
            return _GCStaticIndirectionNodes.GetOrAdd(type);
        }

        private NodeCache<MetadataType, ThreadStaticsNode> _threadStatics;

        public ISymbolNode TypeThreadStaticsSymbol(MetadataType type)
        {
            if (_compilationModuleGroup.ContainsType(type))
            {
                return _threadStatics.GetOrAdd(type);
            }
            else
            {
                return ExternSymbol("__ThreadStaticBase_" + NodeFactory.NameMangler.GetMangledTypeName(type));
            }
        }

        private NodeCache<MethodDesc, InterfaceDispatchCellNode> _interfaceDispatchCells;

        internal InterfaceDispatchCellNode InterfaceDispatchCell(MethodDesc method)
        {
            return _interfaceDispatchCells.GetOrAdd(method);
        }

        private class BlobTupleEqualityComparer : IEqualityComparer<Tuple<string, byte[], int>>
        {
            bool IEqualityComparer<Tuple<string, byte[], int>>.Equals(Tuple<string, byte[], int> x, Tuple<string, byte[], int> y)
            {
                return x.Item1.Equals(y.Item1);
            }

            int IEqualityComparer<Tuple<string, byte[], int>>.GetHashCode(Tuple<string, byte[], int> obj)
            {
                return obj.Item1.GetHashCode();
            }
        }

        private NodeCache<GCPointerMap, GCStaticEETypeNode> _GCStaticEETypes;

        public ISymbolNode GCStaticEEType(GCPointerMap gcMap)
        {
            return _GCStaticEETypes.GetOrAdd(gcMap);
        }

        private NodeCache<Tuple<string, byte[], int>, BlobNode> _readOnlyDataBlobs;

        public BlobNode ReadOnlyDataBlob(string name, byte[] blobData, int alignment)
        {
            return _readOnlyDataBlobs.GetOrAdd(new Tuple<string, byte[], int>(name, blobData, alignment));
        }

        private NodeCache<EETypeOptionalFieldsBuilder, EETypeOptionalFieldsNode> _typeOptionalFields;

        internal EETypeOptionalFieldsNode EETypeOptionalFields(EETypeOptionalFieldsBuilder fieldBuilder)
        {
            return _typeOptionalFields.GetOrAdd(fieldBuilder);
        }

        private NodeCache<TypeDesc, InterfaceDispatchMapNode> _interfaceDispatchMaps;

        internal InterfaceDispatchMapNode InterfaceDispatchMap(TypeDesc type)
        {
            return _interfaceDispatchMaps.GetOrAdd(type);
        }

        private NodeCache<TypeDesc, EmbeddedObjectNode> _interfaceDispatchMapIndirectionNodes;

        public EmbeddedObjectNode InterfaceDispatchMapIndirection(TypeDesc type)
        {
            return _interfaceDispatchMapIndirectionNodes.GetOrAdd(type);
        }

        private NodeCache<GenericCompositionDetails, GenericCompositionNode> _genericCompositions;

        internal ISymbolNode GenericComposition(GenericCompositionDetails details)
        {
            return _genericCompositions.GetOrAdd(details);
        }

        private NodeCache<string, ExternSymbolNode> _externSymbols;

        public ISymbolNode ExternSymbol(string name)
        {
            return _externSymbols.GetOrAdd(name);
        }

        private NodeCache<string, PInvokeModuleFixupNode> _pInvokeModuleFixups;

        public ISymbolNode PInvokeModuleFixup(string moduleName)
        {
            return _pInvokeModuleFixups.GetOrAdd(moduleName);
        }

        private NodeCache<Tuple<string, string>, PInvokeMethodFixupNode> _pInvokeMethodFixups;

        public PInvokeMethodFixupNode PInvokeMethodFixup(string moduleName, string entryPointName)
        {
            return _pInvokeMethodFixups.GetOrAdd(new Tuple<string, string>(moduleName, entryPointName));
        }

        private NodeCache<Tuple<ObjectNode, int, string>, ObjectAndOffsetSymbolNode> _internalSymbols;

        public ISymbolNode ObjectAndOffset(ObjectNode obj, int offset, string name)
        {
            return _internalSymbols.GetOrAdd(new Tuple<ObjectNode, int, string>(obj, offset, name));
        }

        private NodeCache<TypeDesc, VTableSliceNode> _vTableNodes;

        internal VTableSliceNode VTable(TypeDesc type)
        {
            return _vTableNodes.GetOrAdd(type);
        }

        private NodeCache<MethodDesc, IMethodNode> _methodEntrypoints;
        private NodeCache<MethodDesc, IMethodNode> _unboxingStubs;

        public IMethodNode MethodEntrypoint(MethodDesc method, bool unboxingStub = false)
        {
            if (unboxingStub)
            {
                return _unboxingStubs.GetOrAdd(method);
            }

            return _methodEntrypoints.GetOrAdd(method);
        }

        private static readonly string[][] s_helperEntrypointNames = new string[][] {
            new string[] { "System.Runtime.CompilerServices", "ClassConstructorRunner", "CheckStaticClassConstructionReturnGCStaticBase" },
            new string[] { "System.Runtime.CompilerServices", "ClassConstructorRunner", "CheckStaticClassConstructionReturnNonGCStaticBase" }
        };

        private ISymbolNode[] _helperEntrypointSymbols;

        public ISymbolNode HelperEntrypoint(HelperEntrypoint entrypoint)
        {
            if (_helperEntrypointSymbols == null)
                _helperEntrypointSymbols = new ISymbolNode[s_helperEntrypointNames.Length];

            int index = (int)entrypoint;

            ISymbolNode symbol = _helperEntrypointSymbols[index];
            if (symbol == null)
            {
                var entry = s_helperEntrypointNames[index];

                var type = _context.SystemModule.GetKnownType(entry[0], entry[1]);
                var method = type.GetKnownMethod(entry[2], null);

                symbol = MethodEntrypoint(method);

                _helperEntrypointSymbols[index] = symbol;
            }
            return symbol;
        }

        private MetadataType _systemArrayOfTClass;
        public MetadataType ArrayOfTClass
        {
            get
            {
                if (_systemArrayOfTClass == null)
                {
                    _systemArrayOfTClass = _context.SystemModule.GetKnownType("System", "Array`1");
                }
                return _systemArrayOfTClass;
            }
        }

        private TypeDesc _systemArrayOfTEnumeratorType;
        public TypeDesc ArrayOfTEnumeratorType
        {
            get
            {
                if (_systemArrayOfTEnumeratorType == null)
                {
                    _systemArrayOfTEnumeratorType = ArrayOfTClass.GetNestedType("ArrayEnumerator");
                }
                return _systemArrayOfTEnumeratorType;
            }
        }

        private TypeDesc _systemICastableType;

        public TypeDesc ICastableInterface
        {
            get
            {
                if (_systemICastableType == null)
                {
                    _systemICastableType = _context.SystemModule.GetKnownType("System.Runtime.CompilerServices", "ICastable");
                }
                return _systemICastableType;
            }
        }

        private NodeCache<MethodDesc, VirtualMethodUseNode> _virtMethods;

        public DependencyNode VirtualMethodUse(MethodDesc decl)
        {
            return _virtMethods.GetOrAdd(decl);
        }

        private NodeCache<Tuple<ReadyToRunHelperId, Object>, ISymbolNode> _readyToRunHelpers;

        public ISymbolNode ReadyToRunHelper(ReadyToRunHelperId id, Object target)
        {
            return _readyToRunHelpers.GetOrAdd(new Tuple<ReadyToRunHelperId, object>(id, target));
        }

        private NodeCache<string, StringDataNode> _stringDataNodes;

        public StringDataNode StringData(string data)
        {
            return _stringDataNodes.GetOrAdd(data);
        }

        private NodeCache<string, StringIndirectionNode> _stringIndirectionNodes;

        public StringIndirectionNode StringIndirection(string data)
        {
            return _stringIndirectionNodes.GetOrAdd(data);
        }

        private NodeCache<MethodDesc, EmbeddedObjectNode> _eagerCctorIndirectionNodes;

        public EmbeddedObjectNode EagerCctorIndirection(MethodDesc cctorMethod)
        {
            return _eagerCctorIndirectionNodes.GetOrAdd(cctorMethod);
        }

        /// <summary>
        /// Returns alternative symbol name that object writer should produce for given symbols
        /// in addition to the regular one.
        /// </summary>
        public string GetSymbolAlternateName(ISymbolNode node)
        {
            string value;
            if (!NodeAliases.TryGetValue(node, out value))
                return null;
            return value;
        }

        public ArrayOfEmbeddedPointersNode<GCStaticsNode> GCStaticsRegion = new ArrayOfEmbeddedPointersNode<GCStaticsNode>(
            CompilationUnitPrefix + "__GCStaticRegionStart",
            CompilationUnitPrefix + "__GCStaticRegionEnd",
            null);
        public ArrayOfEmbeddedDataNode ThreadStaticsRegion = new ArrayOfEmbeddedDataNode(
            CompilationUnitPrefix + "__ThreadStaticRegionStart",
            CompilationUnitPrefix + "__ThreadStaticRegionEnd",
            null);
        public ArrayOfEmbeddedDataNode StringTable = new ArrayOfEmbeddedDataNode(
            CompilationUnitPrefix + "__StringTableStart",
            CompilationUnitPrefix + "__StringTableEnd",
            null);

        public ArrayOfEmbeddedPointersNode<IMethodNode> EagerCctorTable = new ArrayOfEmbeddedPointersNode<IMethodNode>(
            CompilationUnitPrefix + "__EagerCctorStart",
            CompilationUnitPrefix + "__EagerCctorEnd",
            new EagerConstructorComparer());

        public ArrayOfEmbeddedPointersNode<InterfaceDispatchMapNode> DispatchMapTable = new ArrayOfEmbeddedPointersNode<InterfaceDispatchMapNode>(
            CompilationUnitPrefix + "__DispatchMapTableStart",
            CompilationUnitPrefix + "__DispatchMapTableEnd",
            null);

        public ReadyToRunHeaderNode ReadyToRunHeader;

        public Dictionary<ISymbolNode, string> NodeAliases = new Dictionary<ISymbolNode, string>();

        internal ModuleManagerIndirectionNode ModuleManagerIndirection = new ModuleManagerIndirectionNode();

        public static NameMangler NameMangler;
        public static string CompilationUnitPrefix;

        public void AttachToDependencyGraph(DependencyAnalysisFramework.DependencyAnalyzerBase<NodeFactory> graph)
        {
            ReadyToRunHeader = new ReadyToRunHeaderNode(Target);

            graph.AddRoot(ReadyToRunHeader, "ReadyToRunHeader is always generated");
            graph.AddRoot(new ModulesSectionNode(Target), "ModulesSection is always generated");

            graph.AddRoot(GCStaticsRegion, "GC StaticsRegion is always generated");
            graph.AddRoot(ThreadStaticsRegion, "ThreadStaticsRegion is always generated");
            graph.AddRoot(StringTable, "StringTable is always generated");
            graph.AddRoot(EagerCctorTable, "EagerCctorTable is always generated");
            graph.AddRoot(ModuleManagerIndirection, "ModuleManagerIndirection is always generated");
            graph.AddRoot(DispatchMapTable, "DispatchMapTable is always generated");

            ReadyToRunHeader.Add(ReadyToRunSectionType.GCStaticRegion, GCStaticsRegion, GCStaticsRegion.StartSymbol, GCStaticsRegion.EndSymbol);
            ReadyToRunHeader.Add(ReadyToRunSectionType.ThreadStaticRegion, ThreadStaticsRegion, ThreadStaticsRegion.StartSymbol, ThreadStaticsRegion.EndSymbol);
            ReadyToRunHeader.Add(ReadyToRunSectionType.StringTable, StringTable, StringTable.StartSymbol, StringTable.EndSymbol);
            ReadyToRunHeader.Add(ReadyToRunSectionType.EagerCctor, EagerCctorTable, EagerCctorTable.StartSymbol, EagerCctorTable.EndSymbol);
            ReadyToRunHeader.Add(ReadyToRunSectionType.ModuleManagerIndirection, ModuleManagerIndirection, ModuleManagerIndirection);
            ReadyToRunHeader.Add(ReadyToRunSectionType.InterfaceDispatchTable, DispatchMapTable, DispatchMapTable.StartSymbol);

            MetadataManager.AddToReadyToRunHeader(ReadyToRunHeader);
            MetadataManager.AttachToDependencyGraph(graph);

            _compilationModuleGroup.AddCompilationRoots(new RootingServiceProvider(graph, this));
        }

        private class RootingServiceProvider : IRootingServiceProvider
        {
            private DependencyAnalyzerBase<NodeFactory> _graph;
            private NodeFactory _factory;

            public RootingServiceProvider(DependencyAnalyzerBase<NodeFactory> graph, NodeFactory factory)
            {
                _graph = graph;
                _factory = factory;
            }

            public void AddCompilationRoot(MethodDesc method, string reason, string exportName = null)
            {
                var methodEntryPoint = _factory.MethodEntrypoint(method);

                _graph.AddRoot(methodEntryPoint, reason);

                if (exportName != null)
                    _factory.NodeAliases.Add(methodEntryPoint, exportName);
            }

            public void AddCompilationRoot(TypeDesc type, string reason)
            {
                _graph.AddRoot(_factory.ConstructedTypeSymbol(type), reason);
            }
        }
    }

    public enum HelperEntrypoint
    {
        EnsureClassConstructorRunAndReturnGCStaticBase,
        EnsureClassConstructorRunAndReturnNonGCStaticBase,
    }
}