text:
using EpisodeInformer.Core.Rss;
using System;
using System.Net;

namespace EpisodeInformer.Core.Torrent
{
    public sealed class TorrentFile
    {
        private bool _isMagnetURI = false;
        private string _trnLink = (string)null;

        public string Title { get; set; }

        public string Description { get; set; }

        public DateTime Published { get; set; }

        public string TorrentLink
        {
            get
            {
                return this._trnLink;
            }
            set
            {
                this._trnLink = value;
                if (RssUtils.IsAMagnetURI(this._trnLink))
                    this._isMagnetURI = true;
                else
                    this._isMagnetURI = false;
            }
        }

        public long TorrentFileSize { get; set; }

        public object Tag { get; set; }

        public bool IsLinkMangnetURI
        {
            get
            {
                return this._isMagnetURI;
            }
        }

        public TorrentFile()
        {
        }

        public TorrentFile(string Title, string Description, DateTime PublishedDate, string TorrentLink, long FileSize)
        {
            try
            {
                this.Title = Title;
                this.Description = Description;
                this.TorrentLink = TorrentLink;
                this.TorrentFileSize = FileSize;
                this.Published = PublishedDate;
                if (!RssUtils.IsAMagnetURI(TorrentLink))
                    return;
                this._isMagnetURI = true;
            }
            catch (Exception ex)
            {
            }
        }

        [Obsolete("Do not use this method. It may not work properly")]
        public static bool CheckTorrentLink(string Link)
        {
            HttpWebResponse httpWebResponse = (HttpWebResponse)null;
            bool flag = false;
            if (Link == null)
            {
                flag = false;
            }
            else
            {
                try
                {
                    HttpWebRequest httpWebRequest = WebRequest.Create(Link) as HttpWebRequest;
                    httpWebRequest.Method = "HEAD";
                    httpWebResponse = httpWebRequest.GetResponse() as HttpWebResponse;
                    httpWebResponse.Close();
                    if (httpWebResponse.StatusCode == HttpStatusCode.OK)
                        flag = true;
                }
                catch (WebException ex)
                {
                    flag = false;
                }
                finally
                {
                    if (httpWebResponse != null)
                        httpWebResponse.Close();
                }
            }
            return flag;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

declare(strict_types=1);

namespace DiContainerBenchmarks\Fixture\C;

class FixtureC786
{
    public function __construct(FixtureC785 $dependency)
    {
    }
}


text:
//
// Copyright 2019 Google Inc. All Rights Reserved.
//
// 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.
//
//
import {Directive} from '@angular/core';
import {AbstractControl, NG_VALIDATORS, Validator} from '@angular/forms';

import {getDurationInNsFromHumanReadableString} from './duration';

/**
 * Validates that a given control contains a valid duration value.
 */
@Directive({
  selector: '[isDuration]',
  providers:
      [{provide: NG_VALIDATORS, useExisting: DurationValidator, multi: true}]
})
export class DurationValidator implements Validator {
  validate(control: AbstractControl): {[key: string]: string} | null {
    if (!control.value || isNaN(
            getDurationInNsFromHumanReadableString(control.value))) {
      return {'invalid': 'invalid input'};
    }

    return null;
  }
}


text:
namespace NCast.TestApplication
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.lstDeviceList = new System.Windows.Forms.ListBox();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.tmrRefreshDeviceList = new System.Windows.Forms.Timer(this.components);
            this.groupChromecast = new System.Windows.Forms.GroupBox();
            this.label3 = new System.Windows.Forms.Label();
            this.AppComboBox = new System.Windows.Forms.ComboBox();
            this.lblAddress = new System.Windows.Forms.Label();
            this.lblName = new System.Windows.Forms.Label();
            this.btnLaunchYoutube = new System.Windows.Forms.Button();
            this.lstLog = new System.Windows.Forms.ListBox();
            this.label2 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.button1 = new System.Windows.Forms.Button();
            this.button2 = new System.Windows.Forms.Button();
            this.groupBox1.SuspendLayout();
            this.groupChromecast.SuspendLayout();
            this.SuspendLayout();
            //
            // lstDeviceList
            //
            this.lstDeviceList.FormattingEnabled = true;
            this.lstDeviceList.Location = new System.Drawing.Point(11, 20);
            this.lstDeviceList.Name = "lstDeviceList";
            this.lstDeviceList.Size = new System.Drawing.Size(269, 225);
            this.lstDeviceList.TabIndex = 0;
            this.lstDeviceList.DoubleClick += new System.EventHandler(this.lstDeviceList_DoubleClick);
            //
            // groupBox1
            //
            this.groupBox1.Controls.Add(this.lstDeviceList);
            this.groupBox1.Location = new System.Drawing.Point(12, 12);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(293, 256);
            this.groupBox1.TabIndex = 1;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Devices";
            //
            // tmrRefreshDeviceList
            //
            this.tmrRefreshDeviceList.Interval = 35000;
            this.tmrRefreshDeviceList.Tick += new System.EventHandler(this.tmrRefreshDeviceList_Tick);
            //
            // groupChromecast
            //
            this.groupChromecast.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.groupChromecast.Controls.Add(this.button1);
            this.groupChromecast.Controls.Add(this.button2);
            this.groupChromecast.Controls.Add(this.label3);
            this.groupChromecast.Controls.Add(this.AppComboBox);
            this.groupChromecast.Controls.Add(this.lblAddress);
            this.groupChromecast.Controls.Add(this.lblName);
            this.groupChromecast.Controls.Add(this.btnLaunchYoutube);
            this.groupChromecast.Controls.Add(this.lstLog);
            this.groupChromecast.Controls.Add(this.label2);
            this.groupChromecast.Controls.Add(this.label1);
            this.groupChromecast.Enabled = false;
            this.groupChromecast.Location = new System.Drawing.Point(311, 12);
            this.groupChromecast.Name = "groupChromecast";
            this.groupChromecast.Size = new System.Drawing.Size(1174, 451);
            this.groupChromecast.TabIndex = 2;
            this.groupChromecast.TabStop = false;
            this.groupChromecast.Text = "Chromecast";
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(18, 61);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(83, 13);
            this.label3.TabIndex = 7;
            this.label3.Text = "Supported Apps";
            //
            // AppComboBox
            //
            this.AppComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.AppComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.AppComboBox.FormattingEnabled = true;
            this.AppComboBox.Location = new System.Drawing.Point(107, 58);
            this.AppComboBox.Name = "AppComboBox";
            this.AppComboBox.Size = new System.Drawing.Size(223, 21);
            this.AppComboBox.TabIndex = 6;
            //
            // lblAddress
            //
            this.lblAddress.AutoSize = true;
            this.lblAddress.Location = new System.Drawing.Point(72, 41);
            this.lblAddress.Name = "lblAddress";
            this.lblAddress.Size = new System.Drawing.Size(0, 13);
            this.lblAddress.TabIndex = 5;
            //
            // lblName
            //
            this.lblName.AutoSize = true;
            this.lblName.Location = new System.Drawing.Point(72, 20);
            this.lblName.Name = "lblName";
            this.lblName.Size = new System.Drawing.Size(0, 13);
            this.lblName.TabIndex = 4;
            //
            // btnLaunchYoutube
            //
            this.btnLaunchYoutube.Enabled = false;
            this.btnLaunchYoutube.Location = new System.Drawing.Point(336, 41);
            this.btnLaunchYoutube.Name = "btnLaunchYoutube";
            this.btnLaunchYoutube.Size = new System.Drawing.Size(209, 41);
            this.btnLaunchYoutube.TabIndex = 3;
            this.btnLaunchYoutube.Text = "1. Launch App";
            this.btnLaunchYoutube.UseVisualStyleBackColor = true;
            this.btnLaunchYoutube.Click += new System.EventHandler(this.btnLaunchYoutube_Click);
            //
            // lstLog
            //
            this.lstLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.lstLog.FormattingEnabled = true;
            this.lstLog.HorizontalScrollbar = true;
            this.lstLog.Location = new System.Drawing.Point(16, 83);
            this.lstLog.Name = "lstLog";
            this.lstLog.Size = new System.Drawing.Size(1147, 355);
            this.lstLog.TabIndex = 2;
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(18, 41);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(48, 13);
            this.label2.TabIndex = 1;
            this.label2.Text = "Address:";
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(18, 20);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(38, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "Name:";
            //
            // button1
            //
            this.button1.Location = new System.Drawing.Point(685, 41);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(130, 41);
            this.button1.TabIndex = 3;
            this.button1.Text = "3. Load Playback URL";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // button2
            //
            this.button2.Location = new System.Drawing.Point(551, 41);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(128, 41);
            this.button2.TabIndex = 4;
            this.button2.Text = "2. Start Session";
            this.button2.UseVisualStyleBackColor = true;
            this.button2.Click += new System.EventHandler(this.button2_Click);
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(1497, 593);
            this.Controls.Add(this.groupChromecast);
            this.Controls.Add(this.groupBox1);
            this.Name = "Form1";
            this.Text = "NCast";
            this.Load += new System.EventHandler(this.Form1_Load);
            this.groupBox1.ResumeLayout(false);
            this.groupChromecast.ResumeLayout(false);
            this.groupChromecast.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.ListBox lstDeviceList;
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.Timer tmrRefreshDeviceList;
        private System.Windows.Forms.GroupBox groupChromecast;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.ListBox lstLog;
        private System.Windows.Forms.Button btnLaunchYoutube;
        private System.Windows.Forms.Label lblAddress;
        private System.Windows.Forms.Label lblName;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.ComboBox AppComboBox;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.Button button2;
    }
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
in Seymour, Host Index of the Fungi of North America (Cambridge) 388 (1929)

#### Original name
Sphaeria potentillae Schwein., 1822

### Remarks
null


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

 -->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
    <testCase name="Mage\Adminhtml\Test\TestCase\CreateWebsiteEntityTest" summary="CreateWebsiteEntityTest">
        <variation name="CreateWebsiteEntityTestVariation1" method="test">
            <data name="website/dataset" xsi:type="string">custom_website</data>
            <data name="store/dataset" xsi:type="string">custom</data>
            <data name="storeView/dataset" xsi:type="string">custom</data>
            <data name="tag" xsi:type="string">main:ce</data>
            <constraint name="Mage\Adminhtml\Test\Constraint\AssertProductIsPresentOnCustomWebsite"/>
        </variation>
    </testCase>
</config>


text:
require 'open3'
require 'tempfile'

class Iperf

  # remote_host = ip or host
  # bandwidth = '1m' for 1 megabit
  # port = 12000 (int)
  # size = 60 (size of packet)
  # duration = 10 (num seconds to run test)
  def self.start(session, remote_host, bandwidth, port, size, duration)

    state = {}
    state[:started_at] = Time.now
    state[:duration] = duration
    session[:iperf_state] = state

    file = Tempfile.new('foo')
    state[:output_path] = file.path

    Thread.new(binding) do

      state[:result] = nil
      state[:pid] = nil

      file.close

      cmd = "iperf -c #{remote_host} -i 1 -u -b #{bandwidth} -p #{port} -l #{size} -t #{duration}"

      Open3.popen2e(cmd) do |stdin, stdout_err, wait_thr|
        state[:pid] = wait_thr.pid
        while line = stdout_err.gets
          file.open
          file.seek(file.length)
          file.write(line)
          file.close

        end

        exit_status = wait_thr.value

        if exit_status.success?
          puts "IPERF EXITED NORMALLY"
        else
          puts "IPERF FAILED !!! #{cmd}, #{exit_status.inspect}"
        end

        state[:result] = exit_status.success?
      end
    end
  end

end


text:
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Plugin, Cordova } from './plugin';
/**
 * @name ZBar
 * @description
 * The ZBar Scanner Plugin allows you to scan 2d barcodes.
 *
 * Requires Cordova plugin: `cordova-plugin-cszbar`. For more info, please see the [zBar plugin docs](https://github.com/tjwoon/csZBar).
 *
 * @usage
 * ```
 * import { ZBar } from 'ionic-native';
 *
 * let zBarOptions = {
 *       flash: "off",
 *       drawSight: false
 *     };
 *
 * ZBar.scan(zBarOptions)
 *    .then(result => {
 *       console.log(result); // Scanned code
 *    })
 *    .catch(error => {
 *       console.log(error); // Error message
 *    });
 *
 * ```
 *
 * @advanced
 * zBar options
 *
 * | Option             | Type      | Values                    | Defaults                                                    |
 * |--------------------|-----------|-----------------------------------------------------------------------------------------|
 * | text_title         |`string?`  |                           | `"Scan QR Code"` (Android only)                             |
 * | text_instructions  |`string?`  |                           | `"Please point your camera at the QR code."` (Android only) |
 * | camera             |`string?`  | `"front"`, `"back"`,      | `"back"`                                                    |
 * | flash              |`string?`  | `"on"`, `"off"`, `"auto"` | `"auto"`                                                    |
 * | drawSight          |`boolean?` | `true`, `false`           | `true` (Draws red line in center of scanner)                |
 *
 */
export var ZBar = (function () {
    function ZBar() {
    }
    /**
     * Open the scanner
     * @param options { ZBarOptions } Scan options
     * @return Returns a Promise that resolves with the scanned string, or rejects with an error.
     */
    ZBar.scan = function (options) { return; };
    __decorate([
        Cordova()
    ], ZBar, "scan", null);
    ZBar = __decorate([
        Plugin({
            plugin: 'cordova-plugin-cszbar',
            pluginRef: 'cloudSky.zBar',
            repo: 'https://github.com/tjwoon/csZBar',
            platforms: ['Android', 'iOS']
        })
    ], ZBar);
    return ZBar;
}());
//# sourceMappingURL=z-bar.js.map


text:
/*
 * Copyright 1999-2004 The Apache Software Foundation.
 *
 * 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.
 */
/*
 * $Id: SourceTreeManager.java,v 1.2.4.1 2005/09/10 18:14:09 jeffsuttor Exp $
 */
package com.sun.org.apache.xpath.internal;

import java.io.IOException;
import java.util.Vector;

import javax.xml.transform.Source;
import javax.xml.transform.SourceLocator;
import javax.xml.transform.TransformerException;
import javax.xml.transform.URIResolver;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamSource;

import com.sun.org.apache.xml.internal.dtm.DTM;
import com.sun.org.apache.xml.internal.utils.SystemIDResolver;

import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;

/**
 * This class bottlenecks all management of source trees.  The methods
 * in this class should allow easy garbage collection of source
 * trees (not yet!), and should centralize parsing for those source trees.
 */
public class SourceTreeManager
{

  /** Vector of SourceTree objects that this manager manages. */
  private Vector m_sourceTree = new Vector();

  /**
   * Reset the list of SourceTree objects that this manager manages.
   *
   */
  public void reset()
  {
    m_sourceTree = new Vector();
  }

  /** The TrAX URI resolver used to obtain source trees. */
  URIResolver m_uriResolver;

  /**
   * Set an object that will be used to resolve URIs used in
   * document(), etc.
   * @param resolver An object that implements the URIResolver interface,
   * or null.
   */
  public void setURIResolver(URIResolver resolver)
  {
    m_uriResolver = resolver;
  }

  /**
   * Get the object that will be used to resolve URIs used in
   * document(), etc.
   * @return An object that implements the URIResolver interface,
   * or null.
   */
  public URIResolver getURIResolver()
  {
    return m_uriResolver;
  }

  /**
   * Given a document, find the URL associated with that document.
   * @param owner Document that was previously processed by this liaison.
   *
   * @return The base URI of the owner argument.
   */
  public String findURIFromDoc(int owner)
  {
    int n = m_sourceTree.size();

    for (int i = 0; i < n; i++)
    {
      SourceTree sTree = (SourceTree) m_sourceTree.elementAt(i);

      if (owner == sTree.m_root)
        return sTree.m_url;
    }

    return null;
  }

  /**
   * This will be called by the processor when it encounters
   * an xsl:include, xsl:import, or document() function.
   *
   * @param base The base URI that should be used.
   * @param urlString Value from an xsl:import or xsl:include's href attribute,
   * or a URI specified in the document() function.
   *
   * @return a Source that can be used to process the resource.
   *
   * @throws IOException
   * @throws TransformerException
   */
  public Source resolveURI(
          String base, String urlString, SourceLocator locator)
            throws TransformerException, IOException
  {

    Source source = null;

    if (null != m_uriResolver)
    {
      source = m_uriResolver.resolve(urlString, base);
    }

    if (null == source)
    {
      String uri = SystemIDResolver.getAbsoluteURI(urlString, base);

      source = new StreamSource(uri);
    }

    return source;
  }

  /** JJK: Support  <?xalan:doc_cache_off?> kluge in ElemForEach.
   * TODO: This function is highly dangerous. Cache management must be improved.
   *
   * @param n The node to remove.
   */
  public void removeDocumentFromCache(int n)
  {
    if(DTM.NULL ==n)
      return;
    for(int i=m_sourceTree.size()-1;i>=0;--i)
    {
      SourceTree st=(SourceTree)m_sourceTree.elementAt(i);
      if(st!=null && st.m_root==n)
      {
        m_sourceTree.removeElementAt(i);
        return;
      }
    }
  }

  /**
   * Put the source tree root node in the document cache.
   * TODO: This function needs to be a LOT more sophisticated.
   *
   * @param n The node to cache.
   * @param source The Source object to cache.
   */
  public void putDocumentInCache(int n, Source source)
  {

    int cachedNode = getNode(source);

    if (DTM.NULL != cachedNode)
    {
      if (!(cachedNode == n))
        throw new RuntimeException(
          "Programmer's Error!  "
          + "putDocumentInCache found reparse of doc: "
          + source.getSystemId());
      return;
    }
    if (null != source.getSystemId())
    {
      m_sourceTree.addElement(new SourceTree(n, source.getSystemId()));
    }
  }

  /**
   * Given a Source object, find the node associated with it.
   *
   * @param source The Source object to act as the key.
   *
   * @return The node that is associated with the Source, or null if not found.
   */
  public int getNode(Source source)
  {

//    if (source instanceof DOMSource)
//      return ((DOMSource) source).getNode();

    // TODO: Not sure if the BaseID is really the same thing as the ID.
    String url = source.getSystemId();

    if (null == url)
      return DTM.NULL;

    int n = m_sourceTree.size();

    // System.out.println("getNode: "+n);
    for (int i = 0; i < n; i++)
    {
      SourceTree sTree = (SourceTree) m_sourceTree.elementAt(i);

      // System.out.println("getNode -         url: "+url);
      // System.out.println("getNode - sTree.m_url: "+sTree.m_url);
      if (url.equals(sTree.m_url))
        return sTree.m_root;
    }

    // System.out.println("getNode - returning: "+node);
    return DTM.NULL;
  }

  /**
   * Get the source tree from the a base URL and a URL string.
   *
   * @param base The base URI to use if the urlString is relative.
   * @param urlString An absolute or relative URL string.
   * @param locator The location of the caller, for diagnostic purposes.
   *
   * @return should be a non-null reference to the node identified by the
   * base and urlString.
   *
   * @throws TransformerException If the URL can not resolve to a node.
   */
  public int getSourceTree(
          String base, String urlString, SourceLocator locator, XPathContext xctxt)
            throws TransformerException
  {

    // System.out.println("getSourceTree");
    try
    {
      Source source = this.resolveURI(base, urlString, locator);

      // System.out.println("getSourceTree - base: "+base+", urlString: "+urlString+", source: "+source.getSystemId());
      return getSourceTree(source, locator, xctxt);
    }
    catch (IOException ioe)
    {
      throw new TransformerException(ioe.getMessage(), locator, ioe);
    }

    /* catch (TransformerException te)
     {
       throw new TransformerException(te.getMessage(), locator, te);
     }*/
  }

  /**
   * Get the source tree from the input source.
   *
   * @param source The Source object that should identify the desired node.
   * @param locator The location of the caller, for diagnostic purposes.
   *
   * @return non-null reference to a node.
   *
   * @throws TransformerException if the Source argument can't be resolved to
   *         a node.
   */
  public int getSourceTree(Source source, SourceLocator locator, XPathContext xctxt)
          throws TransformerException
  {

    int n = getNode(source);

    if (DTM.NULL != n)
      return n;

    n = parseToNode(source, locator, xctxt);

    if (DTM.NULL != n)
      putDocumentInCache(n, source);

    return n;
  }

  /**
   * Try to create a DOM source tree from the input source.
   *
   * @param source The Source object that identifies the source node.
   * @param locator The location of the caller, for diagnostic purposes.
   *
   * @return non-null reference to node identified by the source argument.
   *
   * @throws TransformerException if the source argument can not be resolved
   *         to a source node.
   */
  public int parseToNode(Source source, SourceLocator locator, XPathContext xctxt)
          throws TransformerException
  {

    try
    {
      Object xowner = xctxt.getOwnerObject();
      DTM dtm;
      if(null != xowner && xowner instanceof com.sun.org.apache.xml.internal.dtm.DTMWSFilter)
      {
        dtm = xctxt.getDTM(source, false,
                          (com.sun.org.apache.xml.internal.dtm.DTMWSFilter)xowner, false, true);
      }
      else
      {
        dtm = xctxt.getDTM(source, false, null, false, true);
      }
      return dtm.getDocument();
    }
    catch (Exception e)
    {
      //e.printStackTrace();
      throw new TransformerException(e.getMessage(), locator, e);
    }

  }

  /**
   * This method returns the SAX2 parser to use with the InputSource
   * obtained from this URI.
   * It may return null if any SAX2-conformant XML parser can be used,
   * or if getInputSource() will also return null. The parser must
   * be free for use (i.e.
   * not currently in use for another parse().
   *
   * @param inputSource The value returned from the URIResolver.
   * @return a SAX2 XMLReader to use to resolve the inputSource argument.
   * @param locator The location of the original caller, for diagnostic purposes.
   *
   * @throws TransformerException if the reader can not be created.
   */
  public static XMLReader getXMLReader(Source inputSource, SourceLocator locator)
          throws TransformerException
  {

    try
    {
      XMLReader reader = (inputSource instanceof SAXSource)
                         ? ((SAXSource) inputSource).getXMLReader() : null;

      if (null == reader)
      {
        try {
          javax.xml.parsers.SAXParserFactory factory=
              javax.xml.parsers.SAXParserFactory.newInstance();
          factory.setNamespaceAware( true );
          javax.xml.parsers.SAXParser jaxpParser=
              factory.newSAXParser();
          reader=jaxpParser.getXMLReader();

        } catch( javax.xml.parsers.ParserConfigurationException ex ) {
          throw new org.xml.sax.SAXException( ex );
        } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) {
            throw new org.xml.sax.SAXException( ex1.toString() );
        } catch( NoSuchMethodError ex2 ) {
        }
        catch (AbstractMethodError ame){}
        if(null == reader)
          reader = XMLReaderFactory.createXMLReader();
      }

      try
      {
        reader.setFeature("http://xml.org/sax/features/namespace-prefixes",
                          true);
      }
      catch (org.xml.sax.SAXException se)
      {

        // What can we do?
        // TODO: User diagnostics.
      }

      return reader;
    }
    catch (org.xml.sax.SAXException se)
    {
      throw new TransformerException(se.getMessage(), locator, se);
    }
  }
}


text:
package cefet.rba.test;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Test;

import cefet.rba.chromossome.Chromosome;
import cefet.rba.chromossome.MagicSquareChromosomeFactory;
import cefet.rba.operators.permutation.Inversion;

public class InversionTest {

	private static final Logger log4j = LogManager.getLogger(InversionTest.class.getName());

	@Test
	public void testEvoluate() {
		Inversion<Integer> inv = new Inversion<>();
		MagicSquareChromosomeFactory chromosomeFactory = new MagicSquareChromosomeFactory(4);
		Chromosome<Integer> chromosome = chromosomeFactory.makeIt();
		assert chromosome != null;
		assert chromosome.size() == 16;
		log4j.debug("Before: ");
		log4j.debug("\n"+chromosome);
		inv.evoluate(chromosome);
		log4j.debug("After: ");
		log4j.debug("\n"+chromosome);
		log4j.debug("Fim!");
	}

}


text:
class AddSignatureToUser < ActiveRecord::Migration
  def up
  	add_column :users, :email_signature, :string
  end

  def down
  	remove_column :users, :email_signature
  end
end