text:
TestWidgets::TestWidgets(QWidget *parent)
	: QWidget(parent)
{
}

TestWidgets::~TestWidgets()
{
}

Label::Label(QWidget *parent)
	: QWidget(parent) {

	QString lyrics = "Who doesn't long for someone to hold\n\
Who knows how to love you without being told\n\
Somebody tell me why I'm on my own\n\
If there's a soulmate for everyone\n\
\n\
Here we are again, circles never end\n\
How do I find the perfect fit\n\
There's enough for everyone\n\
But I'm still waiting in line\n\
\n\
Who doesn't long for someone to hold\n\
Who knows how to love you without being told\n\
Somebody tell me why I'm on my own\n\
If there's a soulmate for everyone";

	label = new QLabel(lyrics, this);
	label->setFont(QFont("Purisa", 10));

	QVBoxLayout *vbox = new QVBoxLayout();
	vbox->addWidget(label);
	setLayout(vbox);
}

Slider::Slider(QWidget *parent)
	: QWidget(parent) {

	QHBoxLayout *hbox = new QHBoxLayout(this);

	slider = new QSlider(Qt::Horizontal, this);
	hbox->addWidget(slider);

	label = new QLabel("0", this);
	hbox->addWidget(label);

	connect(slider, &QSlider::valueChanged, label,
		static_cast<void (QLabel::*)(int)>(&QLabel::setNum));
}

ComboBoxEx::ComboBoxEx(QWidget *parent)
	: QWidget(parent) {

	QStringList distros = { "Arch", "Xubuntu", "Redhat", "Debian",
		"Mandriva" };

	QHBoxLayout *hbox = new QHBoxLayout(this);

	combo = new QComboBox();
	combo->addItems(distros);

	hbox->addWidget(combo);
	hbox->addSpacing(15);

	label = new QLabel("Arch", this);
	hbox->addWidget(label);

	connect(combo, static_cast<void(QComboBox::*)(const QString &)>(&QComboBox::activated),
		label, &QLabel::setText);
}

SpinBox::SpinBox(QWidget *parent)
	: QWidget(parent) {

	QHBoxLayout *hbox = new QHBoxLayout(this);
	hbox->setSpacing(15);

	spinbox = new QSpinBox(this);
	QLabel *lbl = new QLabel("0", this);

	hbox->addWidget(spinbox);
	hbox->addWidget(lbl);

	connect(spinbox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
		lbl, static_cast<void (QLabel::*)(int)>(&QLabel::setNum));
}

Ledit::Ledit(QWidget *parent)
	: QWidget(parent) {

	QLabel *name = new QLabel("Name:", this);
	name->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
	QLabel *age = new QLabel("Age:", this);
	age->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
	QLabel *occupation = new QLabel("Occupation:", this);
	occupation->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

	QLineEdit *le1 = new QLineEdit(this);
	QLineEdit *le2 = new QLineEdit(this);
	QLineEdit *le3 = new QLineEdit(this);

	QGridLayout *grid = new QGridLayout();

	grid->addWidget(name, 0, 0);
	grid->addWidget(le1, 0, 1);
	grid->addWidget(age, 1, 0);
	grid->addWidget(le2, 1, 1);
	grid->addWidget(occupation, 2, 0);
	grid->addWidget(le3, 2, 1);

	setLayout(grid);
}

Statusbar::Statusbar(QWidget *parent)
	: QMainWindow(parent) {

	QFrame *frame = new QFrame(this);
	setCentralWidget(frame);

	QHBoxLayout *hbox = new QHBoxLayout(frame);

	okBtn = new QPushButton("OK", frame);
	hbox->addWidget(okBtn, 0, Qt::AlignLeft | Qt::AlignTop);

	aplBtn = new QPushButton("Apply", frame);
	hbox->addWidget(aplBtn, 1, Qt::AlignLeft | Qt::AlignTop);

	statusBar();

	connect(okBtn, &QPushButton::clicked, this, &Statusbar::OnOkPressed);
	connect(aplBtn, &QPushButton::clicked, this, &Statusbar::OnApplyPressed);
}

void Statusbar::OnOkPressed() {

	statusBar()->showMessage("OK button pressed", 2000);
}

void Statusbar::OnApplyPressed() {

	statusBar()->showMessage("Apply button pressed", 2000);
}

CheckBox::CheckBox(QWidget *parent)
	: QWidget(parent) {

	QHBoxLayout *hbox = new QHBoxLayout(this);

	QCheckBox *cb = new QCheckBox("Show Title", this);
	cb->setCheckState(Qt::Checked);
	hbox->addWidget(cb, 0, Qt::AlignLeft | Qt::AlignTop);

	connect(cb, &QCheckBox::stateChanged, this, &CheckBox::showTitle);
}

void CheckBox::showTitle(int state) {

	if (state == Qt::Checked) {
		setWindowTitle("QCheckBox");
	}
	else {
		setWindowTitle(" ");
	}
}

ListWidget::ListWidget(QWidget *parent)
	: QWidget(parent) {

	QVBoxLayout *vbox = new QVBoxLayout();
	vbox->setSpacing(10);

	QHBoxLayout *hbox = new QHBoxLayout(this);

	lw = new QListWidget(this);
	lw->addItem("The Omen");
	lw->addItem("The Exorcist");
	lw->addItem("Notes on a scandal");
	lw->addItem("Fargo");
	lw->addItem("Capote");

	add = new QPushButton("Add", this);
	rename = new QPushButton("Rename", this);
	remove = new QPushButton("Remove", this);
	removeAll = new QPushButton("Remove All", this);

	vbox->setSpacing(3);
	vbox->addStretch(1);
	vbox->addWidget(add);
	vbox->addWidget(rename);
	vbox->addWidget(remove);
	vbox->addWidget(removeAll);
	vbox->addStretch(1);

	hbox->addWidget(lw);
	hbox->addSpacing(15);
	hbox->addLayout(vbox);

	connect(add, &QPushButton::clicked, this, &ListWidget::addItem);
	connect(rename, &QPushButton::clicked, this, &ListWidget::renameItem);
	connect(remove, &QPushButton::clicked, this, &ListWidget::removeItem);
	connect(removeAll, &QPushButton::clicked, this, &ListWidget::clearItems);

	setLayout(hbox);
}

void ListWidget::addItem() {

	QString c_text = QInputDialog::getText(this, "Item", "Enter new item");
	QString s_text = c_text.simplified();

	if (!s_text.isEmpty()) {

		lw->addItem(s_text);
		int r = lw->count() - 1;
		lw->setCurrentRow(r);
	}
}

void ListWidget::renameItem() {

	QListWidgetItem *curitem = lw->currentItem();

	int r = lw->row(curitem);
	QString c_text = curitem->text();
	QString r_text = QInputDialog::getText(this, "Item",
		"Enter new item", QLineEdit::Normal, c_text);

	QString s_text = r_text.simplified();

	if (!s_text.isEmpty()) {

		QListWidgetItem *item = lw->takeItem(r);
		delete item;
		lw->insertItem(r, s_text);
		lw->setCurrentRow(r);
	}
}

void ListWidget::removeItem() {

	int r = lw->currentRow();

	if (r != -1) {

		QListWidgetItem *item = lw->takeItem(r);
		delete item;
	}
}

void ListWidget::clearItems() {

	if (lw->count() != 0) {
		lw->clear();
	}
}

ProgressBarEx::ProgressBarEx(QWidget *parent)
	: QWidget(parent) {

	progress = 0;
	timer = new QTimer(this);
	connect(timer, &QTimer::timeout, this, &ProgressBarEx::updateBar);

	QGridLayout *grid = new QGridLayout(this);
	grid->setColumnStretch(2, 1);

	pbar = new QProgressBar();
	grid->addWidget(pbar, 0, 0, 1, 3);

	startBtn = new QPushButton("Start", this);
	connect(startBtn, &QPushButton::clicked, this, &ProgressBarEx::startMyTimer);
	grid->addWidget(startBtn, 1, 0, 1, 1);

	stopBtn = new QPushButton("Stop", this);
	connect(stopBtn, &QPushButton::clicked, this, &ProgressBarEx::stopMyTimer);
	grid->addWidget(stopBtn, 1, 1);
}

void ProgressBarEx::startMyTimer() {

	if (progress >= MAX_VALUE) {

		progress = 0;
		pbar->setValue(0);
	}

	if (!timer->isActive()) {

		startBtn->setEnabled(false);
		stopBtn->setEnabled(true);
		timer->start(DELAY);
	}
}

void ProgressBarEx::stopMyTimer() {

	if (timer->isActive()) {

		startBtn->setEnabled(true);
		stopBtn->setEnabled(false);
		timer->stop();
	}
}

void ProgressBarEx::updateBar() {

	progress++;

	if (progress <= MAX_VALUE) {

		pbar->setValue(progress);
	}
	else {

		timer->stop();
		startBtn->setEnabled(true);
		stopBtn->setEnabled(false);
	}
}

Pixmap::Pixmap(QWidget *parent)
	: QWidget(parent) {

	QHBoxLayout *hbox = new QHBoxLayout(this);

	QPixmap pixmap("bojnice.jpg");

	QLabel *label = new QLabel(this);
	label->setPixmap(pixmap);

	hbox->addWidget(label, 0, Qt::AlignTop);
}

Splitter::Splitter(QWidget *parent)
	: QWidget(parent) {

	QHBoxLayout *hbox = new QHBoxLayout(this);

	QFrame *topleft = new QFrame(this);
	topleft->setFrameShape(QFrame::StyledPanel);

	QFrame *topright = new QFrame(this);
	topright->setFrameShape(QFrame::StyledPanel);

	QSplitter *splitter1 = new QSplitter(Qt::Horizontal, this);
	splitter1->addWidget(topleft);
	splitter1->addWidget(topright);

	QFrame *bottom = new QFrame(this);
	bottom->setFrameShape(QFrame::StyledPanel);

	QSplitter *splitter2 = new QSplitter(Qt::Vertical, this);
	splitter2->addWidget(splitter1);
	splitter2->addWidget(bottom);

	QList<int> sizes({ 50, 100 });
	splitter2->setSizes(sizes);

	hbox->addWidget(splitter2);
}

Table::Table(QWidget *parent)
	: QWidget(parent) {

	QHBoxLayout *hbox = new QHBoxLayout(this);

	QTableWidget *table = new QTableWidget(25, 25, this);

	hbox->addWidget(table);
}

const int PANEL_HEIGHT = 30;
const float Widget::FULL_CAPACITY = 700.0f;
const float Widget::MAX_CAPACITY = 750.0f;

Widget::Widget(QWidget *parent)
	: QFrame(parent) {

	m_parent = parent;
	setMinimumHeight(PANEL_HEIGHT);
}

void Widget::paintEvent(QPaintEvent *e) {

	QPainter qp(this);
	drawWidget(qp);

	QFrame::paintEvent(e);
}

void Widget::drawWidget(QPainter &qp) {

	QString num[] = { "75", "150", "225", "300", "375", "450",
		"525", "600", "675" };

	int asize = sizeof(num) / sizeof(num[1]);

	QColor redColor(255, 175, 175);
	QColor yellowColor(255, 255, 184);

	int width = size().width();

	Burning *burn = (Burning *)m_parent;
	int cur_width = burn->getCurrentWidth();

	int step = (int)qRound((double)width / DIVISIONS);
	int till = (int)((width / MAX_CAPACITY) * cur_width);
	int full = (int)((width / MAX_CAPACITY) * FULL_CAPACITY);

	if (cur_width >= FULL_CAPACITY) {

		qp.setPen(yellowColor);
		qp.setBrush(yellowColor);
		qp.drawRect(0, 0, full, 30);
		qp.setPen(redColor);
		qp.setBrush(redColor);
		qp.drawRect(full, 0, till - full, PANEL_HEIGHT);

	}
	else if (till > 0) {

		qp.setPen(yellowColor);
		qp.setBrush(yellowColor);
		qp.drawRect(0, 0, till, PANEL_HEIGHT);
	}

	QColor grayColor(90, 80, 60);
	qp.setPen(grayColor);

	for (int i = 1; i <= asize; i++) {

		qp.drawLine(i*step, 0, i*step, LINE_WIDTH);
		QFont newFont = font();
		newFont.setPointSize(7);
		setFont(newFont);

		QFontMetrics metrics(font());

		int w = metrics.width(num[i - 1]);
		qp.drawText(i*step - w / 2, DISTANCE, num[i - 1]);
	}
}

Burning::Burning(QWidget *parent)
	: QFrame(parent) {

	initUI();
}

void Burning::initUI() {

	const int MAX_VALUE = 750;
	cur_width = 0;

	slider = new QSlider(Qt::Horizontal, this);
	slider->setMaximum(MAX_VALUE);
	slider->setGeometry(50, 50, 130, 30);

	connect(slider, &QSlider::valueChanged, this, &Burning::valueChanged);

	QVBoxLayout *vbox = new QVBoxLayout(this);
	QHBoxLayout *hbox = new QHBoxLayout();

	vbox->addStretch(1);

	widget = new Widget(this);
	hbox->addWidget(widget, 0);

	vbox->addLayout(hbox);

	setLayout(vbox);
}

void Burning::valueChanged(int val) {

	cur_width = val;
	widget->repaint();
}

int Burning::getCurrentWidth() {

	return cur_width;
}


text:
package org.yeastrc.xlink.www.objects;

import java.util.List;

import org.yeastrc.xlink.www.annotation.sort_display_records_on_annotation_values.SortDisplayRecordsWrapperBase;

/**
 * Wrapper for class for data for row in Peptide page
 *
 * Supports sorting and populating annotation display values
 *
 */
public class WebReportedPeptideWrapper extends SortDisplayRecordsWrapperBase implements SearchPeptideCommonLinkAnnDataWrapperIF {

	/**
	 * Wrapped display data
	 */
	private WebReportedPeptide webReportedPeptide;

	/**
	 * Used for sorting when all the values match so that every time the data is displayed, it is in the same order
	 * @return
	 */
	@Override
	public int getFinalSortOrderKey() {

		return webReportedPeptide.getReportedPeptideId();
	}

	/////////////////

	//   Getters and Setters for access to wrapped object

	@Override
	public List<String> getPsmAnnotationValueList() {
		return webReportedPeptide.getPsmAnnotationValueList();
	}

	@Override
	public void setPsmAnnotationValueList(List<String> psmAnnotationValueList) {
		webReportedPeptide.setPsmAnnotationValueList( psmAnnotationValueList );
	}

	@Override
	public List<String> getPeptideAnnotationValueList() {
		return webReportedPeptide.getPeptideAnnotationValueList();
	}

	@Override
	public void setPeptideAnnotationValueList(
			List<String> peptideAnnotationValueList) {
		webReportedPeptide.setPeptideAnnotationValueList( peptideAnnotationValueList );
	}

	@Override
	public int getReportedPeptideId() throws Exception {

		return webReportedPeptide.getReportedPeptide().getId();
	}

	/////////////////

	//   Getters and Setters

	public WebReportedPeptide getWebReportedPeptide() {
		return webReportedPeptide;
	}

	public void setWebReportedPeptide(WebReportedPeptide webReportedPeptide) {
		this.webReportedPeptide = webReportedPeptide;
	}

}

redpajama_set_name: RedPajamaGithub


text:
package kanzi.entropy;

import kanzi.BitStreamException;
import kanzi.EntropyDecoder;
import kanzi.InputBitStream;

public class HuffmanDecoder implements EntropyDecoder
{
    public static final int DECODING_BATCH_SIZE = 10; // in bits
    public static final int DECODING_MASK = (1 << DECODING_BATCH_SIZE) - 1;
    private static final int DEFAULT_CHUNK_SIZE = 1 << 16; // 64 KB by default
    private static final int ABSENT = Integer.MAX_VALUE;

    private final InputBitStream bitstream;
    private final int[] codes;
    private final int[] ranks;
    private final short[] sizes;
    private final int[] fdTable; // Fast decoding table
    private final int[] sdTable; // Slow decoding table
    private final int[] sdtIndexes; // Indexes for slow decoding table
    private final int chunkSize;
    private long state; // holds bits read from bitstream
    private int bits; // hold number of unused bits in 'state'
    private int minCodeLen;

    public HuffmanDecoder(InputBitStream bitstream) throws BitStreamException
    {
       this(bitstream, DEFAULT_CHUNK_SIZE);
    }

    // The chunk size indicates how many bytes are encoded (per block) before
    // resetting the frequency stats. 0 means that frequencies calculated at the
    // beginning of the block apply to the whole block.
    // The default chunk size is 65536 bytes.
    public HuffmanDecoder(InputBitStream bitstream, int chunkSize) throws BitStreamException
    {
        if (bitstream == null)
            throw new NullPointerException("Invalid null bitstream parameter");

        if ((chunkSize != 0) && (chunkSize < 1024))
           throw new IllegalArgumentException("The chunk size must be at least 1024");

        if (chunkSize > 1<<30)
           throw new IllegalArgumentException("The chunk size must be at most 2^30");

        this.bitstream = bitstream;
        this.sizes = new short[256];
        this.ranks = new int[256];
        this.codes = new int[256];
        this.fdTable = new int[1<<DECODING_BATCH_SIZE];
        this.sdTable = new int[256];
        this.sdtIndexes = new int[24];
        this.chunkSize = chunkSize;
        this.minCodeLen = 8;

        // Default lengths & canonical codes
        for (int i=0; i<256; i++)
        {
           this.sizes[i] = 8;
           this.codes[i] = i;
        }
    }

    public int readLengths() throws BitStreamException
    {
        int count = EntropyUtils.decodeAlphabet(this.bitstream, this.ranks);
        ExpGolombDecoder egdec = new ExpGolombDecoder(this.bitstream, true);
        int currSize ;
        this.minCodeLen = 24; // max code length
        int prevSize = 2;

        // Read lengths
        for (int i=0; i<count; i++)
        {
           final int r = this.ranks[i];
           this.codes[r] = 0;
           int delta = egdec.decodeByte();
           currSize = prevSize + delta;

           if (currSize < 0)
           {
              throw new BitStreamException("Invalid bitstream: incorrect size " + currSize +
                      " for Huffman symbol " + r, BitStreamException.INVALID_STREAM);
           }

           if (currSize != 0)
           {
              if (currSize > 24)
              {
                 throw new BitStreamException("Invalid bitstream: incorrect max size " + currSize +
                    " for Huffman symbol " + r, BitStreamException.INVALID_STREAM);
              }

              if (this.minCodeLen > currSize)
                 this.minCodeLen = currSize;
           }

           this.sizes[r] = (short) currSize;
           prevSize = currSize;
        }

        if (count == 0)
           return 0;

        // Create canonical codes
        HuffmanTree.generateCanonicalCodes(this.sizes, this.codes, this.ranks, count);

        // Build decoding tables
        this.buildDecodingTables(count);
        return count;
    }

    // Build decoding tables
    // The slow decoding table contains the codes in natural order.
    // The fast decoding table contains all the prefixes with DECODING_BATCH_SIZE bits.
    private void buildDecodingTables(int count)
    {
        for (int i=this.fdTable.length-1; i>=0; i--)
           this.fdTable[i] = 0;

        for (int i=this.sdTable.length-1; i>=0; i--)
           this.sdTable[i] = 0;

        for (int i=this.sdtIndexes.length-1; i>=0; i--)
           this.sdtIndexes[i] = ABSENT;

        int len = 0;

        for (int i=0; i<count; i++)
        {
           final int r = this.ranks[i];
           final int code = this.codes[r];

           if (this.sizes[r] > len)
           {
              len = this.sizes[r];
              this.sdtIndexes[len] = i - code;
           }

           // Fill slow decoding table
           final int val = (r << 8) | this.sizes[r];
           this.sdTable[i] = val;
           int idx, end;

           // Fill fast decoding table
           // Find location index in table
           if (len < DECODING_BATCH_SIZE)
           {
              idx = code << (DECODING_BATCH_SIZE - len);
              end = idx + (1 << (DECODING_BATCH_SIZE - len));
           }
           else
           {
              idx = code >> (len - DECODING_BATCH_SIZE);
              end = idx + 1;
           }

           // All DECODING_BATCH_SIZE bit values read from the bit stream and
           // starting with the same prefix point to symbol r
           while (idx < end)
              this.fdTable[idx++] = val;
        }
    }

    // Rebuild the Huffman tree for each chunk of data in the block
    // Use fastDecodeByte until the near end of chunk or block.
    @Override
    public int decode(byte[] array, int blkptr, int len)
    {
       if ((array == null) || (blkptr + len > array.length) || (blkptr < 0) || (len < 0))
         return -1;

       if (len == 0)
          return 0;

       final int sz = (this.chunkSize == 0) ? len : this.chunkSize;
       int startChunk = blkptr;
       final int end = blkptr + len;

       while (startChunk < end)
       {
          // Reinitialize the Huffman tables
          if (this.readLengths() == 0)
             return startChunk - blkptr;

          // Compute minimum number of bits requires in bitstream for fast decoding
          int endPaddingSize = 64 / this.minCodeLen;

          if (this.minCodeLen * endPaddingSize != 64)
             endPaddingSize++;

          final int endChunk = (startChunk + sz < end) ? startChunk + sz : end;
          final int endChunk1 = endChunk - endPaddingSize;
          int i = startChunk;

          // Fast decoding (read DECODING_BATCH_SIZE bits at a time)
          for ( ; i<endChunk1; i++)
             array[i] = this.fastDecodeByte();

          // Fallback to regular decoding (read one bit at a time)
          for ( ; i<endChunk; i++)
             array[i] = this.slowDecodeByte(0, 0);

          startChunk = endChunk;
       }

       return len;
    }

    private byte slowDecodeByte(int code, int codeLen)
    {
       while (codeLen < 23)
       {
          codeLen++;
          code <<= 1;

          if (this.bits == 0)
             code |= this.bitstream.readBit();
          else
          {
             // Consume remaining bits in 'state'
             this.bits--;
             code |= ((this.state >>> this.bits) & 1);
          }

          int idx = this.sdtIndexes[codeLen];

          if (idx == ABSENT) // No code with this length ?
             continue;

          if ((this.sdTable[idx+code] & 0xFF) == codeLen)
             return (byte) (this.sdTable[idx+code] >>> 8);
       }

       throw new BitStreamException("Invalid bitstream: incorrect Huffman code",
          BitStreamException.INVALID_STREAM);
    }

    // 64 bits must be available in the bitstream
    private byte fastDecodeByte()
    {
       if (this.bits < DECODING_BATCH_SIZE)
       {
          // Fetch more bits from bitstream
          long read = this.bitstream.readBits(64-this.bits);
          final long mask = (1 << this.bits) - 1;
          this.state = ((this.state & mask) << (64-this.bits)) | read;
          this.bits = 64;
       }

       // Retrieve symbol from fast decoding table
       int idx = (int) (this.state >>> (this.bits-DECODING_BATCH_SIZE)) & DECODING_MASK;
       int val = this.fdTable[idx];

       if ((val & 0xFF) > DECODING_BATCH_SIZE)
       {
          this.bits -= DECODING_BATCH_SIZE;
          return this.slowDecodeByte(idx, DECODING_BATCH_SIZE);
       }

       this.bits -= (val & 0xFF);
       return (byte) (val >>> 8);
    }

    @Override
    public InputBitStream getBitStream()
    {
       return this.bitstream;
    }

    @Override
    public void dispose()
    {
    }
}


text:
/* This file was generated by SableCC (http://www.sablecc.org/). */

package org.acre.lang.node;

public abstract class PConversionExpr extends Node
{
}


text:
package com.xjeffrose.xio2.TLS;

import java.security.cert.Certificate;
import java.security.cert.CertificateParsingException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.regex.Pattern;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLSession;
import javax.security.auth.x500.X500Principal;

class HostnameVerifier implements javax.net.ssl.HostnameVerifier {

  private static final Pattern VERIFY_AS_IP_ADDRESS = Pattern.compile(
      "([0-9a-fA-F]*:[0-9a-fA-F:.]*)|([\\d.]+)");

  private static final int ALT_DNS_NAME = 2;
  private static final int ALT_IPA_NAME = 7;

  private HostnameVerifier() { }

  @Override
  public boolean verify(String host, SSLSession sslSession) {
    try {
      Certificate[] certificates = sslSession.getPeerCertificates();
      return verify(host, (X509Certificate) certificates[0]);
    } catch (SSLException e) {
      return false;
    }
  }

  public boolean verify(String host, X509Certificate certificate) {
    return verifyAsIpAddress(host)
        ? verifyIpAddress(host, certificate)
        : verifyHostName(host, certificate);
  }

  static boolean verifyAsIpAddress(String host) {
    return VERIFY_AS_IP_ADDRESS.matcher(host).matches();
  }

  private boolean verifyIpAddress(String ipAddress, X509Certificate certificate) {
    List<String> altNames = getSubjectAltNames(certificate, ALT_IPA_NAME);
    for (int i = 0, size = altNames.size(); i < size; i++) {
      if (ipAddress.equalsIgnoreCase(altNames.get(i))) {
        return true;
      }
    }
    return false;
  }

  private boolean verifyHostName(String hostName, X509Certificate certificate) {
    hostName = hostName.toLowerCase(Locale.US);
    boolean hasDns = false;
    List<String> altNames = getSubjectAltNames(certificate, ALT_DNS_NAME);
    for (int i = 0, size = altNames.size(); i < size; i++) {
      hasDns = true;
      if (verifyHostName(hostName, altNames.get(i))) {
        return true;
      }
    }

    if (!hasDns) {
      X500Principal principal = certificate.getSubjectX500Principal();
      // RFC 2818 advises using the most specific name for matching.
//      String cn = new DistinguishedNameParser(principal).findMostSpecific("cn");
//      if (cn != null) {
      String cn = null;
        return verifyHostName(hostName, cn);
//      }
    }

    return false;
  }

  private static List<String> getSubjectAltNames(X509Certificate certificate, int type) {
    List<String> result = new ArrayList<>();
    try {
      Collection<?> subjectAltNames = certificate.getSubjectAlternativeNames();
      if (subjectAltNames == null) {
        return Collections.emptyList();
      }
      for (Object subjectAltName : subjectAltNames) {
        List<?> entry = (List<?>) subjectAltName;
        if (entry == null || entry.size() < 2) {
          continue;
        }
        Integer altNameType = (Integer) entry.get(0);
        if (altNameType == null) {
          continue;
        }
        if (altNameType == type) {
          String altName = (String) entry.get(1);
          if (altName != null) {
            result.add(altName);
          }
        }
      }
      return result;
    } catch (CertificateParsingException e) {
      return Collections.emptyList();
    }
  }

  private boolean verifyHostName(String hostName, String pattern) {
    if ((hostName == null) || (hostName.isEmpty()) || (hostName.startsWith("."))
        || (hostName.endsWith(".."))) {
      // Invalid domain name
      return false;
    }
    if ((pattern == null) || (pattern.isEmpty()) || (pattern.startsWith("."))
        || (pattern.endsWith(".."))) {
      // Invalid pattern/domain name
      return false;
    }

    // Normalize hostName and pattern by turning them into absolute domain names if they are not
    // yet absolute. This is needed because server certificates do not normally contain absolute
    // names or patterns, but they should be treated as absolute. At the same time, any hostName
    // presented to this method should also be treated as absolute for the purposes of matching
    // to the server certificate.
    //   www.android.com  matches www.android.com
    //   www.android.com  matches www.android.com.
    //   www.android.com. matches www.android.com.
    //   www.android.com. matches www.android.com
    if (!hostName.endsWith(".")) {
      hostName += '.';
    }
    if (!pattern.endsWith(".")) {
      pattern += '.';
    }
    // hostName and pattern are now absolute domain names.

    pattern = pattern.toLowerCase(Locale.US);
    // hostName and pattern are now in lower case -- domain names are case-insensitive.

    if (!pattern.contains("*")) {
      // Not a wildcard pattern -- hostName and pattern must match exactly.
      return hostName.equals(pattern);
    }
    // Wildcard pattern

    // WILDCARD PATTERN RULES:
    // 1. Asterisk (*) is only permitted in the left-most domain name label and must be the
    //    only character in that label (i.e., must match the whole left-most label).
    //    For example, *.example.com is permitted, while *a.example.com, a*.example.com,
    //    a*b.example.com, a.*.example.com are not permitted.
    // 2. Asterisk (*) cannot match across domain name labels.
    //    For example, *.example.com matches test.example.com but does not match
    //    sub.test.example.com.
    // 3. Wildcard patterns for single-label domain names are not permitted.

    if ((!pattern.startsWith("*.")) || (pattern.indexOf('*', 1) != -1)) {
      // Asterisk (*) is only permitted in the left-most domain name label and must be the only
      // character in that label
      return false;
    }

    // Optimization: check whether hostName is too short to match the pattern. hostName must be at
    // least as long as the pattern because asterisk must match the whole left-most label and
    // hostName starts with a non-empty label. Thus, asterisk has to match one or more characters.
    if (hostName.length() < pattern.length()) {
      // hostName too short to match the pattern.
      return false;
    }

    if ("*.".equals(pattern)) {
      // Wildcard pattern for single-label domain name -- not permitted.
      return false;
    }

    // hostName must end with the region of pattern following the asterisk.
    String suffix = pattern.substring(1);
    if (!hostName.endsWith(suffix)) {
      // hostName does not end with the suffix
      return false;
    }

    // Check that asterisk did not match across domain name labels.
    int suffixStartIndexInHostName = hostName.length() - suffix.length();
    if ((suffixStartIndexInHostName > 0)
        && (hostName.lastIndexOf('.', suffixStartIndexInHostName - 1) != -1)) {
      // Asterisk is matching across domain name labels -- not permitted.
      return false;
    }

    // hostName matches pattern
    return true;
  }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

    Copyright (c) 2010-2013 Oracle and/or its affiliates. All rights reserved.

    The contents of this file are subject to the terms of either the GNU
    General Public License Version 2 only ("GPL") or the Common Development
    and Distribution License("CDDL") (collectively, the "License").  You
    may not use this file except in compliance with the License.  You can
    obtain a copy of the License at
    http://glassfish.java.net/public/CDDL+GPL_1_1.html
    or packager/legal/LICENSE.txt.  See the License for the specific
    language governing permissions and limitations under the License.

    When distributing the software, include this License Header Notice in each
    file and include the License file at packager/legal/LICENSE.txt.

    GPL Classpath Exception:
    Oracle designates this particular file as subject to the "Classpath"
    exception as provided by Oracle in the GPL Version 2 section of the License
    file that accompanied this code.

    Modifications:
    If applicable, add the following below the License Header, with the fields
    enclosed by brackets [] replaced by your own identifying information:
    "Portions Copyright [year] [name of copyright owner]"

    Contributor(s):
    If you wish your version of this file to be governed by only the CDDL or
    only the GPL Version 2, indicate your decision by adding "[Contributor]
    elects to include this software in this distribution under the [CDDL or GPL
    Version 2] license."  If you don't indicate a single choice of license, a
    recipient has the option to distribute your version of this file under
    either the CDDL, the GPL Version 2 or to extend the choice of license to
    its licensees as provided above.  However, if you add GPL Version 2 code
    and therefore, elected the GPL Version 2 license, then the option applies
    only if the new code is made subject to such option by the copyright
    holder.

-->
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans.xsd
  http://www.springframework.org/schema/context
  http://www.springframework.org/schema/context/spring-context.xsd"
        >
</beans>


text:
test(function() {
  assert_throws_js(TypeError, function() { self.performance.mark("mark1", 123); }, "Number passed as a dict argument should cause type-error.")
}, "Number should be rejected as the mark-options.")

test(function() {
  assert_throws_js(TypeError, function() { self.performance.mark("mark1", NaN); }, "NaN passed as a dict argument should cause type-error.")
}, "NaN should be rejected as the mark-options.")

test(function() {
  assert_throws_js(TypeError, function() { self.performance.mark("mark1", Infinity); }, "Infinity passed as a dict argument should cause type-error.")
}, "Infinity should be rejected as the mark-options.")

test(function() {
  assert_throws_js(TypeError, function() { self.performance.mark("mark1", "string"); }, "String passed as a dict argument should cause type-error.")
}, "String should be rejected as the mark-options.")


text: Sqwiggle Feed


text:
const DrawCard = require('../../drawcard.js');

class ShinjoScout extends DrawCard {
    setupCardAbilities(ability) {
        this.reaction({
            title: 'Gain 1 fate',
            when: {
                onPassDuringDynasty: (event, context) => event.player === context.player && event.firstToPass
            },
            gameAction: ability.actions.gainFate()
        });
    }
}

ShinjoScout.id = 'shinjo-scout';

module.exports = ShinjoScout;


text:
class Chef
module Provisioning
  VERSION = '1.4.1'
end
end


text:
#define IN_LIBXML
#include "libxml.h"
#ifdef LIBXML_HTML_ENABLED

#include <XMXML/xmlmemory.h>
#include <XMXML/HTMLparser.h>
#include <XMXML/HTMLtree.h>
#include <XMXML/entities.h>
#include <XMXML/valid.h>
#include <XMXML/xmlerror.h>
#include <XMXML/parserInternals.h>
#include <XMXML/globals.h>
#include <XMXML/uri.h>

/************************************************************************
 *									*
 *   		Getting/Setting encoding meta tags			*
 *									*
 ************************************************************************/

/**
 * htmlGetMetaEncoding:
 * @doc:  the document
 *
 * Encoding definition lookup in the Meta tags
 *
 * Returns the current encoding as flagged in the HTML source
 */
const xmlChar *
htmlGetMetaEncoding(htmlDocPtr doc) {
    htmlNodePtr cur;
    const xmlChar *content;
    const xmlChar *encoding;

    if (doc == KD_NULL)
	return(KD_NULL);
    cur = doc->children;

    /*
     * Search the html
     */
    while (cur != KD_NULL) {
	if ((cur->type == XML_ELEMENT_NODE) && (cur->name != KD_NULL)) {
	    if (xmlStrEqual(cur->name, BAD_CAST"html"))
		break;
	    if (xmlStrEqual(cur->name, BAD_CAST"head"))
		goto found_head;
	    if (xmlStrEqual(cur->name, BAD_CAST"meta"))
		goto found_meta;
	}
	cur = cur->next;
    }
    if (cur == KD_NULL)
	return(KD_NULL);
    cur = cur->children;

    /*
     * Search the head
     */
    while (cur != KD_NULL) {
	if ((cur->type == XML_ELEMENT_NODE) && (cur->name != KD_NULL)) {
	    if (xmlStrEqual(cur->name, BAD_CAST"head"))
		break;
	    if (xmlStrEqual(cur->name, BAD_CAST"meta"))
		goto found_meta;
	}
	cur = cur->next;
    }
    if (cur == KD_NULL)
	return(KD_NULL);
found_head:
    cur = cur->children;

    /*
     * Search the meta elements
     */
found_meta:
    while (cur != KD_NULL) {
	if ((cur->type == XML_ELEMENT_NODE) && (cur->name != KD_NULL)) {
	    if (xmlStrEqual(cur->name, BAD_CAST"meta")) {
		xmlAttrPtr attr = cur->properties;
		int http;
		const xmlChar *value;

		content = KD_NULL;
		http = 0;
		while (attr != KD_NULL) {
		    if ((attr->children != KD_NULL) &&
		        (attr->children->type == XML_TEXT_NODE) &&
		        (attr->children->next == KD_NULL)) {
			value = attr->children->content;
			if ((!xmlStrcasecmp(attr->name, BAD_CAST"http-equiv"))
			 && (!xmlStrcasecmp(value, BAD_CAST"Content-Type")))
			    http = 1;
			else if ((value != KD_NULL)
			 && (!xmlStrcasecmp(attr->name, BAD_CAST"content")))
			    content = value;
			if ((http != 0) && (content != KD_NULL))
			    goto found_content;
		    }
		    attr = attr->next;
		}
	    }
	}
	cur = cur->next;
    }
    return(KD_NULL);

found_content:
    encoding = xmlStrstr(content, BAD_CAST"charset=");
    if (encoding == KD_NULL)
	encoding = xmlStrstr(content, BAD_CAST"Charset=");
    if (encoding == KD_NULL)
	encoding = xmlStrstr(content, BAD_CAST"CHARSET=");
    if (encoding != KD_NULL) {
	encoding += 8;
    } else {
	encoding = xmlStrstr(content, BAD_CAST"charset =");
	if (encoding == KD_NULL)
	    encoding = xmlStrstr(content, BAD_CAST"Charset =");
	if (encoding == KD_NULL)
	    encoding = xmlStrstr(content, BAD_CAST"CHARSET =");
	if (encoding != KD_NULL)
	    encoding += 9;
    }
    if (encoding != KD_NULL) {
	while ((*encoding == ' ') || (*encoding == '\t')) encoding++;
    }
    return(encoding);
}

/**
 * htmlSetMetaEncoding:
 * @doc:  the document
 * @encoding:  the encoding string
 *
 * Sets the current encoding in the Meta tags
 * NOTE: this will not change the document content encoding, just
 * the META flag associated.
 *
 * Returns 0 in case of success and -1 in case of error
 */
int
htmlSetMetaEncoding(htmlDocPtr doc, const xmlChar *encoding) {
    htmlNodePtr cur, meta = KD_NULL, head = KD_NULL;
    const xmlChar *content = KD_NULL;
    char newcontent[100];

    if (doc == KD_NULL)
	return(-1);

    /* html isn't a real encoding it's just libxml2 way to get entities */
    if (!xmlStrcasecmp(encoding, BAD_CAST "html"))
        return(-1);

    if (encoding != KD_NULL) {
	kdSnprintfKHR (newcontent, sizeof(newcontent), "text/html; charset=%s",
                (char *)encoding);
	newcontent[sizeof(newcontent) - 1] = 0;
    }

    cur = doc->children;

    /*
     * Search the html
     */
    while (cur != KD_NULL) {
	if ((cur->type == XML_ELEMENT_NODE) && (cur->name != KD_NULL)) {
	    if (xmlStrcasecmp(cur->name, BAD_CAST"html") == 0)
		break;
	    if (xmlStrcasecmp(cur->name, BAD_CAST"head") == 0)
		goto found_head;
	    if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0)
		goto found_meta;
	}
	cur = cur->next;
    }
    if (cur == KD_NULL)
	return(-1);
    cur = cur->children;

    /*
     * Search the head
     */
    while (cur != KD_NULL) {
	if ((cur->type == XML_ELEMENT_NODE) && (cur->name != KD_NULL)) {
	    if (xmlStrcasecmp(cur->name, BAD_CAST"head") == 0)
		break;
	    if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0) {
                head = cur->parent;
		goto found_meta;
            }
	}
	cur = cur->next;
    }
    if (cur == KD_NULL)
	return(-1);
found_head:
    head = cur;
    if (cur->children == KD_NULL)
        goto create;
    cur = cur->children;

found_meta:
    /*
     * Search and update all the remaining the meta elements carrying
     * encoding informations
     */
    while (cur != KD_NULL) {
	if ((cur->type == XML_ELEMENT_NODE) && (cur->name != KD_NULL)) {
	    if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0) {
		xmlAttrPtr attr = cur->properties;
		int http;
		const xmlChar *value;

		content = KD_NULL;
		http = 0;
		while (attr != KD_NULL) {
		    if ((attr->children != KD_NULL) &&
		        (attr->children->type == XML_TEXT_NODE) &&
		        (attr->children->next == KD_NULL)) {
			value = attr->children->content;
			if ((!xmlStrcasecmp(attr->name, BAD_CAST"http-equiv"))
			 && (!xmlStrcasecmp(value, BAD_CAST"Content-Type")))
			    http = 1;
			else
                        {
                           if ((value != KD_NULL) &&
                               (!xmlStrcasecmp(attr->name, BAD_CAST"content")))
			       content = value;
                        }
		        if ((http != 0) && (content != KD_NULL))
			    break;
		    }
		    attr = attr->next;
		}
		if ((http != 0) && (content != KD_NULL)) {
		    meta = cur;
		    break;
		}

	    }
	}
	cur = cur->next;
    }
create:
    if (meta == KD_NULL) {
        if ((encoding != KD_NULL) && (head != KD_NULL)) {
            /*
             * Create a new Meta element with the right attributes
             */

            meta = xmlNewDocNode(doc, KD_NULL, BAD_CAST"meta", KD_NULL);
            if (head->children == KD_NULL)
                xmlAddChild(head, meta);
            else
                xmlAddPrevSibling(head->children, meta);
            xmlNewProp(meta, BAD_CAST"http-equiv", BAD_CAST"Content-Type");
            xmlNewProp(meta, BAD_CAST"content", BAD_CAST newcontent);
        }
    } else {
        /* change the document only if there is a real encoding change */
        if (xmlStrcasestr(content, encoding) == KD_NULL) {
            xmlSetProp(meta, BAD_CAST"content", BAD_CAST newcontent);
        }
    }

    return(0);
}

/**
 * booleanHTMLAttrs:
 *
 * These are the HTML attributes which will be output
 * in minimized form, i.e. <option selected="selected"> will be
 * output as <option selected>, as per XSLT 1.0 16.2 "HTML Output Method"
 *
 */
static const char* htmlBooleanAttrs[] = {
  "checked", "compact", "declare", "defer", "disabled", "ismap",
  "multiple", "nohref", "noresize", "noshade", "nowrap", "readonly",
  "selected", KD_NULL
};

/**
 * htmlIsBooleanAttr:
 * @name:  the name of the attribute to check
 *
 * Determine if a given attribute is a boolean attribute.
 *
 * returns: false if the attribute is not boolean, true otherwise.
 */
int
htmlIsBooleanAttr(const xmlChar *name)
{
    int i = 0;

    while (htmlBooleanAttrs[i] != KD_NULL) {
        if (xmlStrcasecmp((const xmlChar *)htmlBooleanAttrs[i], name) == 0)
            return 1;
        i++;
    }
    return 0;
}

#ifdef LIBXML_OUTPUT_ENABLED
/*
 * private routine exported from xmlIO.c
 */
xmlOutputBufferPtr
xmlAllocOutputBufferInternal(xmlCharEncodingHandlerPtr encoder);
/************************************************************************
 *									*
 * 			Output error handlers				*
 *									*
 ************************************************************************/
/**
 * htmlSaveErrMemory:
 * @extra:  extra informations
 *
 * Handle an out of memory condition
 */
static void
htmlSaveErrMemory(const char *extra)
{
    __xmlSimpleError(XML_FROM_OUTPUT, XML_ERR_NO_MEMORY, KD_NULL, KD_NULL, extra);
}

/**
 * htmlSaveErr:
 * @code:  the error number
 * @node:  the location of the error.
 * @extra:  extra informations
 *
 * Handle an out of memory condition
 */
static void
htmlSaveErr(int code, xmlNodePtr node, const char *extra)
{
    const char *msg = KD_NULL;

    switch(code) {
        case XML_SAVE_NOT_UTF8:
	    msg = "string is not in UTF-8\n";
	    break;
	case XML_SAVE_CHAR_INVALID:
	    msg = "invalid character value\n";
	    break;
	case XML_SAVE_UNKNOWN_ENCODING:
	    msg = "unknown encoding %s\n";
	    break;
	case XML_SAVE_NO_DOCTYPE:
	    msg = "HTML has no DOCTYPE\n";
	    break;
	default:
	    msg = "unexpected error number\n";
    }
    __xmlSimpleError(XML_FROM_OUTPUT, code, node, msg, extra);
}

/************************************************************************
 *									*
 *   		Dumping HTML tree content to a simple buffer		*
 *									*
 ************************************************************************/

static int
htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur,
	           int format);

/**
 * htmlNodeDumpFormat:
 * @buf:  the HTML buffer output
 * @doc:  the document
 * @cur:  the current node
 * @format:  should formatting spaces been added
 *
 * Dump an HTML node, recursive behaviour,children are printed too.
 *
 * Returns the number of byte written or -1 in case of error
 */
static int
htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur,
	           int format) {
    unsigned int use;
    int ret;
    xmlOutputBufferPtr outbuf;

    if (cur == KD_NULL) {
	return (-1);
    }
    if (buf == KD_NULL) {
	return (-1);
    }
    outbuf = (xmlOutputBufferPtr) xmlMalloc(sizeof(xmlOutputBuffer));
    if (outbuf == KD_NULL) {
        htmlSaveErrMemory("allocating HTML output buffer");
	return (-1);
    }
    kdMemset ( outbuf, 0, sizeof(xmlOutputBuffer) );
    outbuf->buffer = buf;
    outbuf->encoder = KD_NULL;
    outbuf->writecallback = KD_NULL;
    outbuf->closecallback = KD_NULL;
    outbuf->context = KD_NULL;
    outbuf->written = 0;

    use = buf->use;
    htmlNodeDumpFormatOutput(outbuf, doc, cur, KD_NULL, format);
    xmlFree(outbuf);
    ret = buf->use - use;
    return (ret);
}

/**
 * htmlNodeDump:
 * @buf:  the HTML buffer output
 * @doc:  the document
 * @cur:  the current node
 *
 * Dump an HTML node, recursive behaviour,children are printed too,
 * and formatting returns are added.
 *
 * Returns the number of byte written or -1 in case of error
 */
int
htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) {
    xmlInitParser();

    return(htmlNodeDumpFormat(buf, doc, cur, 1));
}

/**
 * htmlNodeDumpFileFormat:
 * @out:  the FILE pointer
 * @doc:  the document
 * @cur:  the current node
 * @encoding: the document encoding
 * @format:  should formatting spaces been added
 *
 * Dump an HTML node, recursive behaviour,children are printed too.
 *
 * TODO: if encoding == KD_NULL try to save in the doc encoding
 *
 * returns: the number of byte written or -1 in case of failure.
 */
int
htmlNodeDumpFileFormat(KDFile *out, xmlDocPtr doc,
	               xmlNodePtr cur, const char *encoding, int format) {
    xmlOutputBufferPtr buf;
    xmlCharEncodingHandlerPtr handler = KD_NULL;
    int ret;

    xmlInitParser();

    if (encoding != KD_NULL) {
	xmlCharEncoding enc;

	enc = xmlParseCharEncoding(encoding);
	if (enc != XML_CHAR_ENCODING_UTF8) {
	    handler = xmlFindCharEncodingHandler(encoding);
	    if (handler == KD_NULL)
		return(-1);
	}
    }

    /*
     * Fallback to HTML or ASCII when the encoding is unspecified
     */
    if (handler == KD_NULL)
	handler = xmlFindCharEncodingHandler("HTML");
    if (handler == KD_NULL)
	handler = xmlFindCharEncodingHandler("ascii");

    /*
     * save the content to a temp buffer.
     */
    buf = xmlOutputBufferCreateFile(out, handler);
    if (buf == KD_NULL) return(0);

    htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);

    ret = xmlOutputBufferClose(buf);
    return(ret);
}

/**
 * htmlNodeDumpFile:
 * @out:  the FILE pointer
 * @doc:  the document
 * @cur:  the current node
 *
 * Dump an HTML node, recursive behaviour,children are printed too,
 * and formatting returns are added.
 */
void
htmlNodeDumpFile(KDFile *out, xmlDocPtr doc, xmlNodePtr cur) {
    htmlNodeDumpFileFormat(out, doc, cur, KD_NULL, 1);
}

/**
 * htmlDocDumpMemoryFormat:
 * @cur:  the document
 * @mem:  OUT: the memory pointer
 * @size:  OUT: the memory length
 * @format:  should formatting spaces been added
 *
 * Dump an HTML document in memory and return the xmlChar * and it's size.
 * It's up to the caller to free the memory.
 */
void
htmlDocDumpMemoryFormat(xmlDocPtr cur, xmlChar**mem, int *size, int format) {
    xmlOutputBufferPtr buf;
    xmlCharEncodingHandlerPtr handler = KD_NULL;
    const char *encoding;

    xmlInitParser();

    if ((mem == KD_NULL) || (size == KD_NULL))
        return;
    if (cur == KD_NULL) {
	*mem = KD_NULL;
	*size = 0;
	return;
    }

    encoding = (const char *) htmlGetMetaEncoding(cur);

    if (encoding != KD_NULL) {
	xmlCharEncoding enc;

	enc = xmlParseCharEncoding(encoding);
	if (enc != cur->charset) {
	    if (cur->charset != XML_CHAR_ENCODING_UTF8) {
		/*
		 * Not supported yet
		 */
		*mem = KD_NULL;
		*size = 0;
		return;
	    }

	    handler = xmlFindCharEncodingHandler(encoding);
	    if (handler == KD_NULL) {
		*mem = KD_NULL;
		*size = 0;
		return;
	    }
	} else {
	    handler = xmlFindCharEncodingHandler(encoding);
	}
    }

    /*
     * Fallback to HTML or ASCII when the encoding is unspecified
     */
    if (handler == KD_NULL)
	handler = xmlFindCharEncodingHandler("HTML");
    if (handler == KD_NULL)
	handler = xmlFindCharEncodingHandler("ascii");

    buf = xmlAllocOutputBufferInternal(handler);
    if (buf == KD_NULL) {
	*mem = KD_NULL;
	*size = 0;
	return;
    }

	htmlDocContentDumpFormatOutput(buf, cur, KD_NULL, format);

    xmlOutputBufferFlush(buf);
    if (buf->conv != KD_NULL) {
	*size = buf->conv->use;
	*mem = xmlStrndup(buf->conv->content, *size);
    } else {
	*size = buf->buffer->use;
	*mem = xmlStrndup(buf->buffer->content, *size);
    }
    (void)xmlOutputBufferClose(buf);
}

/**
 * htmlDocDumpMemory:
 * @cur:  the document
 * @mem:  OUT: the memory pointer
 * @size:  OUT: the memory length
 *
 * Dump an HTML document in memory and return the xmlChar * and it's size.
 * It's up to the caller to free the memory.
 */
void
htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) {
	htmlDocDumpMemoryFormat(cur, mem, size, 1);
}

/************************************************************************
 *									*
 *   		Dumping HTML tree content to an I/O output buffer	*
 *									*
 ************************************************************************/

void xmlNsListDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur);

/**
 * htmlDtdDumpOutput:
 * @buf:  the HTML buffer output
 * @doc:  the document
 * @encoding:  the encoding string
 *
 * TODO: check whether encoding is needed
 *
 * Dump the HTML document DTD, if any.
 */
static void
htmlDtdDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
	          const char *encoding ATTRIBUTE_UNUSED) {
    xmlDtdPtr cur = doc->intSubset;

    if (cur == KD_NULL) {
	htmlSaveErr(XML_SAVE_NO_DOCTYPE, (xmlNodePtr) doc, KD_NULL);
	return;
    }
    xmlOutputBufferWriteString(buf, "<!DOCTYPE ");
    xmlOutputBufferWriteString(buf, (const char *)cur->name);
    if (cur->ExternalID != KD_NULL) {
	xmlOutputBufferWriteString(buf, " PUBLIC ");
	xmlBufferWriteQuotedString(buf->buffer, cur->ExternalID);
	if (cur->SystemID != KD_NULL) {
	    xmlOutputBufferWriteString(buf, " ");
	    xmlBufferWriteQuotedString(buf->buffer, cur->SystemID);
	}
    }  else if (cur->SystemID != KD_NULL) {
	xmlOutputBufferWriteString(buf, " SYSTEM ");
	xmlBufferWriteQuotedString(buf->buffer, cur->SystemID);
    }
    xmlOutputBufferWriteString(buf, ">\n");
}

/**
 * htmlAttrDumpOutput:
 * @buf:  the HTML buffer output
 * @doc:  the document
 * @cur:  the attribute pointer
 * @encoding:  the encoding string
 *
 * Dump an HTML attribute
 */
static void
htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur,
	           const char *encoding ATTRIBUTE_UNUSED) {
    xmlChar *value;

    /*
     * TODO: The html output method should not escape a & character
     *       occurring in an attribute value immediately followed by
     *       a { character (see Section B.7.1 of the HTML 4.0 Recommendation).
     */

    if (cur == KD_NULL) {
	return;
    }
    xmlOutputBufferWriteString(buf, " ");
    if ((cur->ns != KD_NULL) && (cur->ns->prefix != KD_NULL)) {
        xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
	xmlOutputBufferWriteString(buf, ":");
    }
    xmlOutputBufferWriteString(buf, (const char *)cur->name);
    if ((cur->children != KD_NULL) && (!htmlIsBooleanAttr(cur->name))) {
	value = xmlNodeListGetString(doc, cur->children, 0);
	if (value) {
	    xmlOutputBufferWriteString(buf, "=");
	    if ((cur->ns == KD_NULL) && (cur->parent != KD_NULL) &&
		(cur->parent->ns == KD_NULL) &&
		((!xmlStrcasecmp(cur->name, BAD_CAST "href")) ||
	         (!xmlStrcasecmp(cur->name, BAD_CAST "action")) ||
		 (!xmlStrcasecmp(cur->name, BAD_CAST "src")) ||
		 ((!xmlStrcasecmp(cur->name, BAD_CAST "name")) &&
		  (!xmlStrcasecmp(cur->parent->name, BAD_CAST "a"))))) {
		xmlChar *escaped;
		xmlChar *tmp = value;

		while (IS_BLANK_CH(*tmp)) tmp++;

		escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+");
		if (escaped != KD_NULL) {
		    xmlBufferWriteQuotedString(buf->buffer, escaped);
		    xmlFree(escaped);
		} else {
		    xmlBufferWriteQuotedString(buf->buffer, value);
		}
	    } else {
		xmlBufferWriteQuotedString(buf->buffer, value);
	    }
	    xmlFree(value);
	} else  {
	    xmlOutputBufferWriteString(buf, "=\"\"");
	}
    }
}

/**
 * htmlAttrListDumpOutput:
 * @buf:  the HTML buffer output
 * @doc:  the document
 * @cur:  the first attribute pointer
 * @encoding:  the encoding string
 *
 * Dump a list of HTML attributes
 */
static void
htmlAttrListDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur, const char *encoding) {
    if (cur == KD_NULL) {
	return;
    }
    while (cur != KD_NULL) {
        htmlAttrDumpOutput(buf, doc, cur, encoding);
	cur = cur->next;
    }
}

/**
 * htmlNodeListDumpOutput:
 * @buf:  the HTML buffer output
 * @doc:  the document
 * @cur:  the first node
 * @encoding:  the encoding string
 * @format:  should formatting spaces been added
 *
 * Dump an HTML node list, recursive behaviour,children are printed too.
 */
static void
htmlNodeListDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
	               xmlNodePtr cur, const char *encoding, int format) {
    if (cur == KD_NULL) {
	return;
    }
    while (cur != KD_NULL) {
        htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
	cur = cur->next;
    }
}

/**
 * htmlNodeDumpFormatOutput:
 * @buf:  the HTML buffer output
 * @doc:  the document
 * @cur:  the current node
 * @encoding:  the encoding string
 * @format:  should formatting spaces been added
 *
 * Dump an HTML node, recursive behaviour,children are printed too.
 */
void
htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
	                 xmlNodePtr cur, const char *encoding, int format) {
    const htmlElemDesc * info;

    xmlInitParser();

    if ((cur == KD_NULL) || (buf == KD_NULL)) {
	return;
    }
    /*
     * Special cases.
     */
    if (cur->type == XML_DTD_NODE)
	return;
    if ((cur->type == XML_HTML_DOCUMENT_NODE) ||
        (cur->type == XML_DOCUMENT_NODE)){
	htmlDocContentDumpOutput(buf, (xmlDocPtr) cur, encoding);
	return;
    }
    if (cur->type == XML_ATTRIBUTE_NODE) {
        htmlAttrDumpOutput(buf, doc, (xmlAttrPtr) cur, encoding);
	return;
    }
    if (cur->type == HTML_TEXT_NODE) {
	if (cur->content != KD_NULL) {
	    if (((cur->name == (const xmlChar *)xmlStringText) ||
		 (cur->name != (const xmlChar *)xmlStringTextNoenc)) &&
		((cur->parent == KD_NULL) ||
		 ((xmlStrcasecmp(cur->parent->name, BAD_CAST "script")) &&
		  (xmlStrcasecmp(cur->parent->name, BAD_CAST "style"))))) {
		xmlChar *buffer;

		buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
		if (buffer != KD_NULL) {
		    xmlOutputBufferWriteString(buf, (const char *)buffer);
		    xmlFree(buffer);
		}
	    } else {
		xmlOutputBufferWriteString(buf, (const char *)cur->content);
	    }
	}
	return;
    }
    if (cur->type == HTML_COMMENT_NODE) {
	if (cur->content != KD_NULL) {
	    xmlOutputBufferWriteString(buf, "<!--");
	    xmlOutputBufferWriteString(buf, (const char *)cur->content);
	    xmlOutputBufferWriteString(buf, "-->");
	}
	return;
    }
    if (cur->type == HTML_PI_NODE) {
	if (cur->name == KD_NULL)
	    return;
	xmlOutputBufferWriteString(buf, "<?");
	xmlOutputBufferWriteString(buf, (const char *)cur->name);
	if (cur->content != KD_NULL) {
	    xmlOutputBufferWriteString(buf, " ");
	    xmlOutputBufferWriteString(buf, (const char *)cur->content);
	}
	xmlOutputBufferWriteString(buf, ">");
	return;
    }
    if (cur->type == HTML_ENTITY_REF_NODE) {
        xmlOutputBufferWriteString(buf, "&");
	xmlOutputBufferWriteString(buf, (const char *)cur->name);
        xmlOutputBufferWriteString(buf, ";");
	return;
    }
    if (cur->type == HTML_PRESERVE_NODE) {
	if (cur->content != KD_NULL) {
	    xmlOutputBufferWriteString(buf, (const char *)cur->content);
	}
	return;
    }

    /*
     * Get specific HTML info for that node.
     */
    if (cur->ns == KD_NULL)
	info = htmlTagLookup(cur->name);
    else
	info = KD_NULL;

    xmlOutputBufferWriteString(buf, "<");
    if ((cur->ns != KD_NULL) && (cur->ns->prefix != KD_NULL)) {
        xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
	xmlOutputBufferWriteString(buf, ":");
    }
    xmlOutputBufferWriteString(buf, (const char *)cur->name);
    if (cur->nsDef)
	xmlNsListDumpOutput(buf, cur->nsDef);
    if (cur->properties != KD_NULL)
        htmlAttrListDumpOutput(buf, doc, cur->properties, encoding);

    if ((info != KD_NULL) && (info->empty)) {
        xmlOutputBufferWriteString(buf, ">");
	if ((format) && (!info->isinline) && (cur->next != KD_NULL)) {
	    if ((cur->next->type != HTML_TEXT_NODE) &&
		(cur->next->type != HTML_ENTITY_REF_NODE) &&
		(cur->parent != KD_NULL) &&
		(cur->parent->name != KD_NULL) &&
		(cur->parent->name[0] != 'p')) /* p, pre, param */
		xmlOutputBufferWriteString(buf, "\n");
	}
	return;
    }
    if (((cur->type == XML_ELEMENT_NODE) || (cur->content == KD_NULL)) &&
	(cur->children == KD_NULL)) {
        if ((info != KD_NULL) && (info->saveEndTag != 0) &&
	    (xmlStrcmp(BAD_CAST info->name, BAD_CAST "html")) &&
	    (xmlStrcmp(BAD_CAST info->name, BAD_CAST "body"))) {
	    xmlOutputBufferWriteString(buf, ">");
	} else {
	    xmlOutputBufferWriteString(buf, "></");
            if ((cur->ns != KD_NULL) && (cur->ns->prefix != KD_NULL)) {
                xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
                xmlOutputBufferWriteString(buf, ":");
            }
	    xmlOutputBufferWriteString(buf, (const char *)cur->name);
	    xmlOutputBufferWriteString(buf, ">");
	}
	if ((format) && (cur->next != KD_NULL) &&
            (info != KD_NULL) && (!info->isinline)) {
	    if ((cur->next->type != HTML_TEXT_NODE) &&
		(cur->next->type != HTML_ENTITY_REF_NODE) &&
		(cur->parent != KD_NULL) &&
		(cur->parent->name != KD_NULL) &&
		(cur->parent->name[0] != 'p')) /* p, pre, param */
		xmlOutputBufferWriteString(buf, "\n");
	}
	return;
    }
    xmlOutputBufferWriteString(buf, ">");
    if ((cur->type != XML_ELEMENT_NODE) &&
	(cur->content != KD_NULL)) {
	    /*
	     * Uses the OutputBuffer property to automatically convert
	     * invalids to charrefs
	     */

            xmlOutputBufferWriteString(buf, (const char *) cur->content);
    }
    if (cur->children != KD_NULL) {
        if ((format) && (info != KD_NULL) && (!info->isinline) &&
	    (cur->children->type != HTML_TEXT_NODE) &&
	    (cur->children->type != HTML_ENTITY_REF_NODE) &&
	    (cur->children != cur->last) &&
	    (cur->name != KD_NULL) &&
	    (cur->name[0] != 'p')) /* p, pre, param */
	    xmlOutputBufferWriteString(buf, "\n");
	htmlNodeListDumpOutput(buf, doc, cur->children, encoding, format);
        if ((format) && (info != KD_NULL) && (!info->isinline) &&
	    (cur->last->type != HTML_TEXT_NODE) &&
	    (cur->last->type != HTML_ENTITY_REF_NODE) &&
	    (cur->children != cur->last) &&
	    (cur->name != KD_NULL) &&
	    (cur->name[0] != 'p')) /* p, pre, param */
	    xmlOutputBufferWriteString(buf, "\n");
    }
    xmlOutputBufferWriteString(buf, "</");
    if ((cur->ns != KD_NULL) && (cur->ns->prefix != KD_NULL)) {
        xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
	xmlOutputBufferWriteString(buf, ":");
    }
    xmlOutputBufferWriteString(buf, (const char *)cur->name);
    xmlOutputBufferWriteString(buf, ">");
    if ((format) && (info != KD_NULL) && (!info->isinline) &&
	(cur->next != KD_NULL)) {
        if ((cur->next->type != HTML_TEXT_NODE) &&
	    (cur->next->type != HTML_ENTITY_REF_NODE) &&
	    (cur->parent != KD_NULL) &&
	    (cur->parent->name != KD_NULL) &&
	    (cur->parent->name[0] != 'p')) /* p, pre, param */
	    xmlOutputBufferWriteString(buf, "\n");
    }
}

/**
 * htmlNodeDumpOutput:
 * @buf:  the HTML buffer output
 * @doc:  the document
 * @cur:  the current node
 * @encoding:  the encoding string
 *
 * Dump an HTML node, recursive behaviour,children are printed too,
 * and formatting returns/spaces are added.
 */
void
htmlNodeDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
	           xmlNodePtr cur, const char *encoding) {
    htmlNodeDumpFormatOutput(buf, doc, cur, encoding, 1);
}

/**
 * htmlDocContentDumpFormatOutput:
 * @buf:  the HTML buffer output
 * @cur:  the document
 * @encoding:  the encoding string
 * @format:  should formatting spaces been added
 *
 * Dump an HTML document.
 */
void
htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr cur,
	                       const char *encoding, int format) {
    int type;

    xmlInitParser();

    if ((buf == KD_NULL) || (cur == KD_NULL))
        return;

    /*
     * force to output the stuff as HTML, especially for entities
     */
    type = cur->type;
    cur->type = XML_HTML_DOCUMENT_NODE;
    if (cur->intSubset != KD_NULL) {
        htmlDtdDumpOutput(buf, cur, KD_NULL);
    }
    if (cur->children != KD_NULL) {
        htmlNodeListDumpOutput(buf, cur, cur->children, encoding, format);
    }
    xmlOutputBufferWriteString(buf, "\n");
    cur->type = (xmlElementType) type;
}

/**
 * htmlDocContentDumpOutput:
 * @buf:  the HTML buffer output
 * @cur:  the document
 * @encoding:  the encoding string
 *
 * Dump an HTML document. Formating return/spaces are added.
 */
void
htmlDocContentDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr cur,
	                 const char *encoding) {
    htmlDocContentDumpFormatOutput(buf, cur, encoding, 1);
}

/************************************************************************
 *									*
 *		Saving functions front-ends				*
 *									*
 ************************************************************************/

/**
 * htmlDocDump:
 * @f:  the FILE*
 * @cur:  the document
 *
 * Dump an HTML document to an open FILE.
 *
 * returns: the number of byte written or -1 in case of failure.
 */
int
htmlDocDump(KDFile *f, xmlDocPtr cur) {
    xmlOutputBufferPtr buf;
    xmlCharEncodingHandlerPtr handler = KD_NULL;
    const char *encoding;
    int ret;

    xmlInitParser();

    if ((cur == KD_NULL) || (f == KD_NULL)) {
	return(-1);
    }

    encoding = (const char *) htmlGetMetaEncoding(cur);

    if (encoding != KD_NULL) {
	xmlCharEncoding enc;

	enc = xmlParseCharEncoding(encoding);
	if (enc != cur->charset) {
	    if (cur->charset != XML_CHAR_ENCODING_UTF8) {
		/*
		 * Not supported yet
		 */
		return(-1);
	    }

	    handler = xmlFindCharEncodingHandler(encoding);
	    if (handler == KD_NULL)
		return(-1);
	} else {
	    handler = xmlFindCharEncodingHandler(encoding);
	}
    }

    /*
     * Fallback to HTML or ASCII when the encoding is unspecified
     */
    if (handler == KD_NULL)
	handler = xmlFindCharEncodingHandler("HTML");
    if (handler == KD_NULL)
	handler = xmlFindCharEncodingHandler("ascii");

    buf = xmlOutputBufferCreateFile(f, handler);
    if (buf == KD_NULL) return(-1);
    htmlDocContentDumpOutput(buf, cur, KD_NULL);

    ret = xmlOutputBufferClose(buf);
    return(ret);
}

/**
 * htmlSaveFile:
 * @filename:  the filename (or URL)
 * @cur:  the document
 *
 * Dump an HTML document to a file. If @filename is "-" the stdout file is
 * used.
 * returns: the number of byte written or -1 in case of failure.
 */
int
htmlSaveFile(const char *filename, xmlDocPtr cur) {
    xmlOutputBufferPtr buf;
    xmlCharEncodingHandlerPtr handler = KD_NULL;
    const char *encoding;
    int ret;

    if ((cur == KD_NULL) || (filename == KD_NULL))
        return(-1);

    xmlInitParser();

    encoding = (const char *) htmlGetMetaEncoding(cur);

    if (encoding != KD_NULL) {
	xmlCharEncoding enc;

	enc = xmlParseCharEncoding(encoding);
	if (enc != cur->charset) {
	    if (cur->charset != XML_CHAR_ENCODING_UTF8) {
		/*
		 * Not supported yet
		 */
		return(-1);
	    }

	    handler = xmlFindCharEncodingHandler(encoding);
	    if (handler == KD_NULL)
		return(-1);
	}
    }

    /*
     * Fallback to HTML or ASCII when the encoding is unspecified
     */
    if (handler == KD_NULL)
	handler = xmlFindCharEncodingHandler("HTML");
    if (handler == KD_NULL)
	handler = xmlFindCharEncodingHandler("ascii");

    /*
     * save the content to a temp buffer.
     */
    buf = xmlOutputBufferCreateFilename(filename, handler, cur->compression);
    if (buf == KD_NULL) return(0);

    htmlDocContentDumpOutput(buf, cur, KD_NULL);

    ret = xmlOutputBufferClose(buf);
    return(ret);
}

/**
 * htmlSaveFileFormat:
 * @filename:  the filename
 * @cur:  the document
 * @format:  should formatting spaces been added
 * @encoding: the document encoding
 *
 * Dump an HTML document to a file using a given encoding.
 *
 * returns: the number of byte written or -1 in case of failure.
 */
int
htmlSaveFileFormat(const char *filename, xmlDocPtr cur,
	           const char *encoding, int format) {
    xmlOutputBufferPtr buf;
    xmlCharEncodingHandlerPtr handler = KD_NULL;
    int ret;

    if ((cur == KD_NULL) || (filename == KD_NULL))
        return(-1);

    xmlInitParser();

    if (encoding != KD_NULL) {
	xmlCharEncoding enc;

	enc = xmlParseCharEncoding(encoding);
	if (enc != cur->charset) {
	    if (cur->charset != XML_CHAR_ENCODING_UTF8) {
		/*
		 * Not supported yet
		 */
		return(-1);
	    }

	    handler = xmlFindCharEncodingHandler(encoding);
	    if (handler == KD_NULL)
		return(-1);
	}
        htmlSetMetaEncoding(cur, (const xmlChar *) encoding);
    } else {
	htmlSetMetaEncoding(cur, (const xmlChar *) "UTF-8");
    }

    /*
     * Fallback to HTML or ASCII when the encoding is unspecified
     */
    if (handler == KD_NULL)
	handler = xmlFindCharEncodingHandler("HTML");
    if (handler == KD_NULL)
	handler = xmlFindCharEncodingHandler("ascii");

    /*
     * save the content to a temp buffer.
     */
    buf = xmlOutputBufferCreateFilename(filename, handler, 0);
    if (buf == KD_NULL) return(0);

    htmlDocContentDumpFormatOutput(buf, cur, encoding, format);

    ret = xmlOutputBufferClose(buf);
    return(ret);
}

/**
 * htmlSaveFileEnc:
 * @filename:  the filename
 * @cur:  the document
 * @encoding: the document encoding
 *
 * Dump an HTML document to a file using a given encoding
 * and formatting returns/spaces are added.
 *
 * returns: the number of byte written or -1 in case of failure.
 */
int
htmlSaveFileEnc(const char *filename, xmlDocPtr cur, const char *encoding) {
    return(htmlSaveFileFormat(filename, cur, encoding, 1));
}

#endif /* LIBXML_OUTPUT_ENABLED */

#define bottom_HTMLtree
#include "elfgcchack.h"
#endif /* LIBXML_HTML_ENABLED */


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ESRI.ArcGIS.Analyst3D;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.Carto;

namespace MultiPatchExamples
{
    public partial class MultiPatchExamples : Form
    {
        private object _missing = Type.Missing;
        private IGraphicsContainer3D _axesGraphicsContainer3D;
        private IGraphicsContainer3D _outlineGraphicsContainer3D;
        private IGraphicsContainer3D _multiPatchGraphicsContainer3D;

        public MultiPatchExamples()
        {
            InitializeComponent();

            Initialize();
        }

        private void Initialize()
        {
            _axesGraphicsContainer3D = GraphicsLayer3DUtilities.ConstructGraphicsLayer3D("Axes");
            _multiPatchGraphicsContainer3D = GraphicsLayer3DUtilities.ConstructGraphicsLayer3D("MultiPatch");
            _outlineGraphicsContainer3D = GraphicsLayer3DUtilities.ConstructGraphicsLayer3D("Outline");

            GraphicsLayer3DUtilities.DisableLighting(_multiPatchGraphicsContainer3D);

            axSceneControl.Scene.AddLayer(_axesGraphicsContainer3D as ILayer, true);
            axSceneControl.Scene.AddLayer(_multiPatchGraphicsContainer3D as ILayer, true);
            axSceneControl.Scene.AddLayer(_outlineGraphicsContainer3D as ILayer, true);

            DrawUtilities.DrawAxes(_axesGraphicsContainer3D);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void triangleStrip1Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = TriangleStripExamples.GetExample1();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void triangleStrip2Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = TriangleStripExamples.GetExample2();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void triangleStrip3Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = TriangleStripExamples.GetExample3();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void triangleStrip4Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = TriangleStripExamples.GetExample4();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void triangleStrip5Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = TriangleStripExamples.GetExample5();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void triangleFan1Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = TriangleFanExamples.GetExample1();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void triangleFan2Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = TriangleFanExamples.GetExample2();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void triangleFan3Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = TriangleFanExamples.GetExample3();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void triangleFan4Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = TriangleFanExamples.GetExample4();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void triangleFan5Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = TriangleFanExamples.GetExample5();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void triangleFan6Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = TriangleFanExamples.GetExample6();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void triangles1Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = TrianglesExamples.GetExample1();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void triangles2Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = TrianglesExamples.GetExample2();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void triangles3Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = TrianglesExamples.GetExample3();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void triangles4Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = TrianglesExamples.GetExample4();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void triangles5Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = TrianglesExamples.GetExample5();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void triangles6Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = TrianglesExamples.GetExample6();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void ring1Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = RingExamples.GetExample1();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void ring2Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = RingExamples.GetExample2();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void ring3Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = RingExamples.GetExample3();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void ring4Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = RingExamples.GetExample4();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void ring5Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = RingExamples.GetExample5();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void vector3D1Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = Vector3DExamples.GetExample1();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void vector3D2Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = Vector3DExamples.GetExample2();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void vector3D3Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = Vector3DExamples.GetExample3();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void transform3D1Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = Transform3DExamples.GetExample1();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void transform3D2Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = Transform3DExamples.GetExample2();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void transform3D3Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = Transform3DExamples.GetExample3();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void transform3D4Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = Transform3DExamples.GetExample4();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void extrusion1Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = ExtrusionExamples.GetExample1();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void extrusion2Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = ExtrusionExamples.GetExample2();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void extrusion3Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = ExtrusionExamples.GetExample3();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void extrusion4Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = ExtrusionExamples.GetExample4();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void extrusion5Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = ExtrusionExamples.GetExample5();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void extrusion6Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = ExtrusionExamples.GetExample6();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void extrusion7Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = ExtrusionExamples.GetExample7();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void ringGroup1Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = RingGroupExamples.GetExample1();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void ringGroup2Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = RingGroupExamples.GetExample2();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void ringGroup3Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = RingGroupExamples.GetExample3();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void ringGroup4Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = RingGroupExamples.GetExample4();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void ringGroup5Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = RingGroupExamples.GetExample5();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void extrusion8Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = ExtrusionExamples.GetExample8();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void extrusionButton9_Click(object sender, EventArgs e)
        {
            IGeometry geometry = ExtrusionExamples.GetExample9();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void extrusion10Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = ExtrusionExamples.GetExample10();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void extrusion11Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = ExtrusionExamples.GetExample11();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void extrusion12Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = ExtrusionExamples.GetExample12();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void extrusion13Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = ExtrusionExamples.GetExample13();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void vector3D4Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = Vector3DExamples.GetExample4();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void vector3D5Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = Vector3DExamples.GetExample5();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void composite1Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = CompositeExamples.GetExample1();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void composite2Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = CompositeExamples.GetExample2();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void composite3Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = CompositeExamples.GetExample3();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void composite4Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = CompositeExamples.GetExample4();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void extrusion14Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = ExtrusionExamples.GetExample14();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }

        private void extrusion15Button_Click(object sender, EventArgs e)
        {
            IGeometry geometry = ExtrusionExamples.GetExample15();

            DrawUtilities.DrawMultiPatch(_multiPatchGraphicsContainer3D, geometry);
            DrawUtilities.DrawOutline(_outlineGraphicsContainer3D, geometry);

            axSceneControl.SceneGraph.RefreshViewers();
        }
    }
}


text:
package org.jpox.samples.types.set;

import java.io.Serializable;
import java.util.Random;

import org.jpox.samples.types.container.CollectionHolder;

/**
 * Container object for FK Set tests.
 *
 * @version $Revision: 1.1 $
 */
public class Set2 implements CollectionHolder
{
	private static Random r = new Random(0);

    private int identifierA;
    private String identifierB;

    java.util.Set items = new java.util.HashSet();

    public Set2()
    {
        identifierA = r.nextInt();
        identifierB = String.valueOf(r.nextInt());
    }

    public java.util.Collection  getItems()
    {
        return items;
    }

    public int getNoOfItems()
    {
        return items.size();
    }

    public void addItem(Object item)
    {
        items.add(item);
    }

    public void addItems(java.util.Collection c)
    {
        items.addAll(c);
    }

    public void removeItem(Object item)
    {
        items.remove(item);
    }

    public void removeItems(java.util.Collection c)
    {
        items.removeAll(c);
    }

    public void retainItems(java.util.Collection c)
    {
        items.retainAll(c);
    }

    public void clear()
    {
        items.clear();
    }

    public boolean isEmpty()
    {
        return items.isEmpty();
    }

    public int getIdentifierA()
    {
        return identifierA;
    }

    public void setIdentifierA(int identifierA)
    {
        this.identifierA = identifierA;
    }

    public String getIdentifierB()
    {
        return identifierB;
    }

    public void setIdentifierB(String identifierB)
    {
        this.identifierB = identifierB;
    }

    public void setItems(java.util.Set items)
    {
        this.items = items;
    }

    public String toString()
    {
        return getClass().getName() + " : [" + items.size() + " items]";
    }

    public boolean contains(Object value)
    {
        return items.contains(value);
    }

    public boolean containsAll(java.util.Collection values)
    {
        return items.containsAll(values);
    }

    public static class Oid implements Serializable
    {
        public int identifierA;
        public String identifierB;

        public Oid()
        {
        }

        public Oid(String s)
        {
            java.util.StringTokenizer token = new java.util.StringTokenizer (s, "::");
            //ignore first token
            s = token.nextToken ();
            s = token.nextToken ();
            this.identifierA = Integer.valueOf(s).intValue();
            s = token.nextToken ();
            this.identifierB = s;
        }

        public String toString()
        {
            return this.getClass().getName() + "::"  + identifierA + "::" + identifierB;
        }

        public int hashCode()
        {
            if (identifierB != null)
            {
                return identifierA ^ identifierB.hashCode();
            }
            else
            {
                return identifierA;
            }
        }

        public boolean equals(Object other)
        {
            if (other != null && (other instanceof Oid))
            {
                Oid k = (Oid)other;
                return k.identifierA == this.identifierA && k.identifierB.equals(this.identifierB);
            }
            return false;
        }
    }
}


text:
/**
 * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package pt.lighthouselabs.obd.commands.protocol;

/**
 * Turns off line-feed.
 */
public class LineFeedOffObdCommand extends ObdProtocolCommand {

  public LineFeedOffObdCommand() {
    super("AT L0");
  }

  /**
   * @param other
   */
  public LineFeedOffObdCommand(LineFeedOffObdCommand other) {
    super(other);
  }

  @Override
  public String getFormattedResult() {
    return getResult();
  }

  @Override
  public String getName() {
    return "Line Feed Off";
  }

}


text:
NS_ASSUME_NONNULL_BEGIN

static const char *const WMFImageControllerAssociationKey = "WMFImageControllerAssociationKey";

@implementation UIImageView (WMFImageFetching)

- (void)wmf_reset {
    self.image = nil;
    [self wmf_resetContentsRect];
    [self wmf_cancelImageDownload];
}

- (void)wmf_setImageWithURL:(NSURL *)imageURL detectFaces:(BOOL)detectFaces onGPU:(BOOL)onGPU failure:(nonnull WMFErrorHandler)failure success:(nonnull WMFSuccessHandler)success {
    [self wmf_cancelImageDownload];
    self.wmf_imageURL = imageURL;
    [self wmf_fetchImageDetectFaces:detectFaces onGPU:onGPU failure:failure success:success];
}

- (nullable NSURL *)wmf_imageURLToFetch {
    return self.wmf_imageURL;
}

- (WMFPermanentCacheController *__nullable)wmf_imageController {
    WMFPermanentCacheController *controller = objc_getAssociatedObject(self, WMFImageControllerAssociationKey);
    if (!controller) {
        controller = [MWKDataStore shared].cacheController;
    }
    return controller;
}

- (void)wmf_setImageController:(nullable WMFPermanentCacheController *)imageController {
    objc_setAssociatedObject(self, WMFImageControllerAssociationKey, imageController, OBJC_ASSOCIATION_ASSIGN);
}

@end

NS_ASSUME_NONNULL_END


text:
<?php

namespace GTaxi\TaxiDriverBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class GTaxiTaxiDriverBundle extends Bundle
{
}