text:
package annotationInteraction;

import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.util.List;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.ScrollPaneConstants;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

public class RunInterface {

	private static boolean is_new_worksheet = true;
	private static long worksheet_id = 0;

	private static String pattern_id = "70.0.5.3";
	public static String poet_name = "William Shakespeare # ";
	public static String poem_name = "Sonnet 129";

	private static JPanel closeReadingContainerPanel;
	private static JPanel distantReadingContainerPanel;
	private static JPanel containerPanel;
	private static JFrame mainFrame;

	private static TUIOConnectionManager tuio_data_manager = new TUIOConnectionManager(pattern_id);

	public static void main(String[] args) {

		//List<PoemCollectionByPoet> poem_collection = WorksheetManager.poem_collection;

		if(is_new_worksheet){

			WorksheetManager.createWorksheet(poet_name + poem_name);

		}
		else{

			WorksheetManager.retrieveWorksheet(worksheet_id);

		}

		tuio_data_manager.TuioConnect();

		try {

		    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		}
		catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {

			e.printStackTrace();

		}

		javax.swing.SwingUtilities.invokeLater(new Runnable() {

            public void run() {

            	create_and_show_GUI(WorksheetManager.active_worksheets);

            }
        });

	}

	private static void create_and_show_GUI(List<Worksheet> active_worksheets){

		closeReadingContainerPanel = new JPanel();
		closeReadingContainerPanel.setLayout(new BorderLayout());
		closeReadingContainerPanel.setBackground(Color.WHITE);

		for(int i = 0; i < active_worksheets.size(); i++){

			/*WorksheetViewer worksheet_viewer = new WorksheetViewer(active_worksheets.get(i));
			active_worksheets.get(i).setWorksheetViewer(worksheet_viewer);
			containerPanel.add(worksheet_viewer, BorderLayout.WEST);*/

			WorksheetViewer2 worksheet_viewer = new WorksheetViewer2(active_worksheets.get(i));
			active_worksheets.get(i).setWorksheetViewer2(worksheet_viewer);
			closeReadingContainerPanel.add(worksheet_viewer.getViewerScrollPane(), BorderLayout.WEST);

			MetaViewer meta_viewer = new MetaViewer(active_worksheets.get(i));
			active_worksheets.get(i).setMetaViewer(meta_viewer);
			//JScrollPane meta_viewer_scroll_pane = new JScrollPane(meta_viewer, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);

			closeReadingContainerPanel.add(meta_viewer, BorderLayout.CENTER);

		}

		distantReadingContainerPanel = new JPanel();
		distantReadingContainerPanel.setLayout(new BorderLayout());
		distantReadingContainerPanel.setBackground(Color.WHITE);

		CorpusViewerAntonymPairs antonym_viewer = new CorpusViewerAntonymPairs();
		SonnetWordPairs sonnet_129_pairs = antonym_viewer.getSonnetAntonymPairs(128);
		CorpusViewerSingleSonnet single_sonnet_viewer = new CorpusViewerSingleSonnet();
		single_sonnet_viewer.changeSonnetTo(129, sonnet_129_pairs.getAntonymPairs());
		distantReadingContainerPanel.add(single_sonnet_viewer.getViewerScrollPane(), BorderLayout.WEST);
		CorpusViewer corpus_viewer_panel = new CorpusViewer();
		distantReadingContainerPanel.add(corpus_viewer_panel.getViewerPanel(), BorderLayout.CENTER);

		//JScrollPane distantReadingScrollPane = new JScrollPane(distantReadingContainerPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);

		containerPanel = new JPanel();
		containerPanel.setLayout(new CardLayout());
		containerPanel.add(closeReadingContainerPanel, "closeReading");
		containerPanel.add(distantReadingContainerPanel, "distantReading");
		//containerPanel.add(distantReadingScrollPane, "distantReading");
		//TODO Remove after testing
		//CorpusViewerAntonymPairs antonym_viewer = new CorpusViewerAntonymPairs();
		//distantReadingContainerPanel.add(antonym_viewer.getViewerScrollPane());
		//SonnetWordPairs all_pairs = antonym_viewer.getSonnetAntonymPairs(153);
		//SingleSonnetViewer single_sonnet_viewer = new SingleSonnetViewer("William Shakespeare # Sonnet 154", false, all_pairs.getAntonymPairs());

		//CardLayout containerPanelLayout = (CardLayout)(containerPanel.getLayout());
		//containerPanelLayout.show(containerPanel, "distantReading");

		mainFrame = new JFrame("AnnotationInteraction-0.1");

		Dimension mainFrameMinimumSize = new Dimension(1200, 500);
		//mainFrame.setMinimumSize(mainFrameMinimumSize);
		mainFrame.setPreferredSize(mainFrameMinimumSize);
		mainFrame.setResizable(true);

		mainFrame.getContentPane().setLayout(new BorderLayout());
		mainFrame.getContentPane().setBackground(Color.WHITE);

		//JScrollPane scrollPane = new JScrollPane(containerPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
		mainFrame.getContentPane().add(containerPanel, BorderLayout.CENTER);

		mainFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
		mainFrame.pack();
		mainFrame.setVisible(true);

		mainFrame.addWindowListener(new java.awt.event.WindowAdapter() {
		    @Override
		    public void windowClosing(java.awt.event.WindowEvent windowEvent) {

		    	if(tuio_data_manager.isTUIOConnectionEstablished()){

		    		tuio_data_manager.TuioDisconnect();

		    	}

		    	List<Worksheet> active_worksheets = WorksheetManager.active_worksheets;

		    	for(int i = 0; i < active_worksheets.size(); i++){
		    		//TODO uncomment this after testing
		    		//active_worksheets.get(i).saveWorksheetTIF();
		    		active_worksheets.get(i).getQueryResponseExecutorService().shutdown();

		    	}

		    	mainFrame.setVisible(false);
		    	mainFrame.dispose();
		    	System.exit(0);

		    }

		});

	}

	public static void switchCloseAndDistant(String switchTo){

		String panelToDisplay = switchTo;
		CardLayout containerPanelLayout = (CardLayout)(containerPanel.getLayout());
		containerPanelLayout.show(containerPanel, panelToDisplay);

		mainFrame.repaint();
		mainFrame.validate();

	}

}


text:
package codec.x509.extensions;

import codec.asn1.ASN1ObjectIdentifier;
import codec.asn1.ASN1String;
import codec.x509.X509Extension;

/**
 * Class RestrictionExtension awaits the Restrictiontext as the only payload in
 * the constructor. no other constructor is allowed.
 *
 * @author cval
 *
 */
public class RestrictionExtension extends X509Extension {

    /**
     * OID of this extension
     */
    public static final String EXTENSION_OID = "1.3.36.8.3.8";

    /**
     * Text of the Restriction
     */
    private ASN1String restrictionText;

    public RestrictionExtension(ASN1String _text) throws Exception {
	setOID(new ASN1ObjectIdentifier(EXTENSION_OID));
	setValue(_text);
    }

    public String toString() {
	return ("RestricitionExtension OID = " + EXTENSION_OID
		+ "  RestrictionText : " + restrictionText);
    }
}

redpajama_set_name: RedPajamaGithub


text:
ENV['RAILS_ENV'] = 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'

require 'feedjira'
require 'nokogiri'

require 'minitest/reporters'
Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new

CWD = File.dirname __FILE__

module ActiveSupport
  class TestCase
    # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
    #
    # Note: You'll currently still have to declare fixtures explicitly in integration tests
    # -- they do not yet inherit this setting
    fixtures :all

    # Add more helper methods to be used by all tests here...
  end
end

module ActionController
  class TestCase
    fixtures :all
  end
end

require 'sidekiq/testing'
Sidekiq::Testing.fake!

def create_feed(url, feed_url = nil)
  feed_url = url if feed_url.nil?
  feed = Feed.create url: url, feed_url: feed_url
  feed.save!
  feed
end

def delete_feed(url, feed_url = nil)
  feed_url = url if feed_url.nil?
  Feed.find_by!(url: url, feed_url: feed_url).destroy
end

def login(user)
  session[Shreds::Auth::USER_TOKEN] = user.token
end

def load_feed(name)
  feed_content = File.read File.join(CWD, 'fixtures/feeds', "#{name}.xml")
  Feedjira::Feed.parse feed_content
end

def to_article(entry)
  Article.new Article.sanitize_field(entry)
end

def reparse(fragment)
  Nokogiri::HTML::DocumentFragment.parse(fragment).to_s
end


text:
package pipe

// Tx is the transmit side of the shared memory ring buffer.
type Tx struct {
	p              pipe
	maxPayloadSize uint64

	head uint64
	tail uint64
	next uint64

	tailHeader uint64
}

// Init initializes the transmit end of the pipe. In the initial state, the next
// slot to be written is the very first one, and the transmitter has the whole
// ring buffer available to it.
func (t *Tx) Init(b []byte) {
	t.p.init(b)
	// maxPayloadSize excludes the header of the payload, and the header
	// of the wrapping message.
	t.maxPayloadSize = uint64(len(t.p.buffer)) - 2*sizeOfSlotHeader
	t.tail = 0xfffffffe * jump
	t.next = t.tail
	t.head = t.tail + jump
	t.p.write(t.tail, slotFree)
}

// Capacity determines how many records of the given size can be written to the
// pipe before it fills up.
func (t *Tx) Capacity(recordSize uint64) uint64 {
	available := uint64(len(t.p.buffer)) - sizeOfSlotHeader
	entryLen := payloadToSlotSize(recordSize)
	return available / entryLen
}

// Push reserves "payloadSize" bytes for transmission in the pipe. The caller
// populates the returned slice with the data to be transferred and enventually
// calls Flush() to make the data visible to the reader, or Abort() to make the
// pipe forget all Push() calls since the last Flush().
//
// The returned slice is available until Flush() or Abort() is next called.
// After that, it must not be touched.
func (t *Tx) Push(payloadSize uint64) []byte {
	// Fail request if we know we will never have enough room.
	if payloadSize > t.maxPayloadSize {
		return nil
	}

	totalLen := payloadToSlotSize(payloadSize)
	newNext := t.next + totalLen
	nextWrap := (t.next & revolutionMask) | uint64(len(t.p.buffer))
	if int64(newNext-nextWrap) >= 0 {
		// The new buffer would overflow the pipe, so we push a wrapping
		// slot, then try to add the actual slot to the front of the
		// pipe.
		newNext = (newNext & revolutionMask) + jump
		wrappingPayloadSize := slotToPayloadSize(newNext - t.next)
		if !t.reclaim(newNext) {
			return nil
		}

		oldNext := t.next
		t.next = newNext
		if oldNext != t.tail {
			t.p.write(oldNext, wrappingPayloadSize)
		} else {
			t.tailHeader = wrappingPayloadSize
			t.Flush()
		}

		newNext += totalLen
	}

	// Check that we have enough room for the buffer.
	if !t.reclaim(newNext) {
		return nil
	}

	if t.next != t.tail {
		t.p.write(t.next, payloadSize)
	} else {
		t.tailHeader = payloadSize
	}

	// Grab the buffer before updating t.next.
	b := t.p.data(t.next, payloadSize)
	t.next = newNext

	return b
}

// reclaim attempts to advance the head until at least newNext. If the head is
// already at or beyond newNext, nothing happens and true is returned; otherwise
// it tries to reclaim slots that have already been consumed by the receive end
// of the pipe (they will be marked as free) and returns a boolean indicating
// whether it was successful in reclaiming enough slots.
func (t *Tx) reclaim(newNext uint64) bool {
	for int64(newNext-t.head) > 0 {
		// Can't reclaim if slot is not free.
		header := t.p.readAtomic(t.head)
		if header&slotFree == 0 {
			return false
		}

		payloadSize := header & slotSizeMask
		newHead := t.head + payloadToSlotSize(payloadSize)

		// Check newHead is within bounds and valid.
		if int64(newHead-t.tail) > int64(jump) || newHead&offsetMask >= uint64(len(t.p.buffer)) {
			return false
		}

		t.head = newHead
	}

	return true
}

// Abort causes all Push() calls since the last Flush() to be forgotten and
// therefore they will not be made visible to the receiver.
func (t *Tx) Abort() {
	t.next = t.tail
}

// Flush causes all buffers pushed since the last Flush() [or Abort(), whichever
// is the most recent] to be made visible to the receiver.
func (t *Tx) Flush() {
	if t.next == t.tail {
		// Nothing to do if there are no pushed buffers.
		return
	}

	if t.next != t.head {
		// The receiver will spin in t.next, so we must make sure that
		// the slotFree bit is set.
		t.p.write(t.next, slotFree)
	}

	t.p.writeAtomic(t.tail, t.tailHeader)
	t.tail = t.next
}

// Bytes returns the byte slice on which the pipe operates.
func (t *Tx) Bytes() []byte {
	return t.p.buffer
}


text:
<?php
/**
 * @group link
 */
class Tests_Link extends WP_UnitTestCase {

	function tearDown() {
		global $wp_rewrite;
		$wp_rewrite->init();
		parent::tearDown();
	}

	function _get_pagenum_link_cb( $url ) {
		return $url . '/WooHoo';
	}

	/**
	 * @ticket 8847
	 */
	function test_get_pagenum_link_case_insensitivity() {
		$old_req_uri = $_SERVER['REQUEST_URI'];

		global $wp_rewrite;
		$wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
		$wp_rewrite->flush_rules();

		add_filter( 'home_url', array( $this, '_get_pagenum_link_cb' ) );
		$_SERVER['REQUEST_URI'] = '/woohoo';
		$paged = get_pagenum_link( 2 );

		remove_filter( 'home_url', array( $this, '_get_pagenum_link_cb' ) );
		$this->assertEquals( $paged, home_url( '/WooHoo/page/2/' ) );

		$_SERVER['REQUEST_URI'] = $old_req_uri;
	}

	function test_wp_get_shortlink() {
		global $wp_rewrite;

		$post_id = $this->factory->post->create();
		$post_id2 = $this->factory->post->create();

		$wp_rewrite->init();
		$wp_rewrite->set_permalink_structure( '' );
		$wp_rewrite->flush_rules();

		// Basic case
		$this->assertEquals( get_permalink( $post_id ), wp_get_shortlink( $post_id, 'post' ) );

		unset( $GLOBALS['post'] );

		// Global post is not set
		$this->assertEquals( '', wp_get_shortlink( 0, 'post' ) );
		$this->assertEquals( '', wp_get_shortlink( 0 ) );
		$this->assertEquals( '', wp_get_shortlink() );

		$GLOBALS['post'] = get_post( $post_id );

		// Global post is set
		$this->assertEquals( get_permalink( $post_id ), wp_get_shortlink( 0, 'post' ) );
		$this->assertEquals( get_permalink( $post_id ), wp_get_shortlink( 0 ) );
		$this->assertEquals( get_permalink( $post_id ), wp_get_shortlink() );

		// Not the global post
		$this->assertEquals( get_permalink( $post_id2 ), wp_get_shortlink( $post_id2, 'post' ) );

		unset( $GLOBALS['post'] );

		// Global post is not set, once again
		$this->assertEquals( '', wp_get_shortlink( 0, 'post' ) );
		$this->assertEquals( '', wp_get_shortlink( 0 ) );
		$this->assertEquals( '', wp_get_shortlink() );

		$wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
		$wp_rewrite->flush_rules();

		// With a permalink structure set, get_permalink() will no longer match.
		$this->assertNotEquals( get_permalink( $post_id ), wp_get_shortlink( $post_id, 'post' ) );
		$this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink( $post_id, 'post' ) );

		// Global post and permalink structure are set
		$GLOBALS['post'] = get_post( $post_id );
		$this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink( 0, 'post' ) );
		$this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink( 0 ) );
		$this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink() );
	}

	function test_wp_get_shortlink_with_page() {
		$post_id = $this->factory->post->create( array( 'post_type' => 'page' ) );

		// Basic case
		// Don't test against get_permalink() since it uses ?page_id= for pages.
		$this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink( $post_id, 'post' ) );

		global $wp_rewrite;
		$wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
		$wp_rewrite->flush_rules();

		$this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink( $post_id, 'post' ) );
	}

	/**
	 * @ticket 26871
	 */
	function test_wp_get_shortlink_with_home_page() {
		$post_id = $this->factory->post->create( array( 'post_type' => 'page' ) );
		update_option( 'show_on_front', 'page' );
		update_option( 'page_on_front', $post_id );

		$this->assertEquals( home_url( '/' ), wp_get_shortlink( $post_id, 'post' ) );

		global $wp_rewrite;
		$wp_rewrite->permalink_structure = '';
		$wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
		$wp_rewrite->flush_rules();

		$this->assertEquals( home_url( '/' ), wp_get_shortlink( $post_id, 'post' ) );
	}

	/**
	 * @ticket 17807
	 */
	function test_get_adjacent_post() {
		// Need some sample posts to test adjacency
		$post_one = $this->factory->post->create_and_get( array(
			'post_title' => 'First',
			'post_date' => '2012-01-01 12:00:00'
		) );

		$post_two = $this->factory->post->create_and_get( array(
			'post_title' => 'Second',
			'post_date' => '2012-02-01 12:00:00'
		) );

		$post_three = $this->factory->post->create_and_get( array(
			'post_title' => 'Third',
			'post_date' => '2012-03-01 12:00:00'
		) );

		$post_four = $this->factory->post->create_and_get( array(
			'post_title' => 'Fourth',
			'post_date' => '2012-04-01 12:00:00'
		) );

		// Assign some terms
		wp_set_object_terms( $post_one->ID, 'wordpress', 'category', false );
		wp_set_object_terms( $post_three->ID, 'wordpress', 'category', false );

		wp_set_object_terms( $post_two->ID, 'plugins', 'post_tag', false );
		wp_set_object_terms( $post_four->ID, 'plugins', 'post_tag', false );

		// Test normal post adjacency
		$this->go_to( get_permalink( $post_two->ID ) );

		$this->assertEquals( $post_one, get_adjacent_post( false, '', true ) );
		$this->assertEquals( $post_three, get_adjacent_post( false, '', false ) );

		$this->assertNotEquals( $post_two, get_adjacent_post( false, '', true ) );
		$this->assertNotEquals( $post_two, get_adjacent_post( false, '', false ) );

		// Test category adjacency
		$this->go_to( get_permalink( $post_one->ID ) );

		$this->assertEquals( '', get_adjacent_post( true, '', true, 'category' ) );
		$this->assertEquals( $post_three, get_adjacent_post( true, '', false, 'category' ) );

		// Test tag adjacency
		$this->go_to( get_permalink( $post_two->ID ) );

		$this->assertEquals( '', get_adjacent_post( true, '', true, 'post_tag' ) );
		$this->assertEquals( $post_four, get_adjacent_post( true, '', false, 'post_tag' ) );

		// Test normal boundary post
		$this->go_to( get_permalink( $post_two->ID ) );

		$this->assertEquals( array( $post_one ), get_boundary_post( false, '', true ) );
		$this->assertEquals( array( $post_four ), get_boundary_post( false, '', false ) );

		// Test category boundary post
		$this->go_to( get_permalink( $post_one->ID ) );

		$this->assertEquals( array( $post_one ), get_boundary_post( true, '', true, 'category' ) );
		$this->assertEquals( array( $post_three ), get_boundary_post( true, '', false, 'category' ) );

		// Test tag boundary post
		$this->go_to( get_permalink( $post_two->ID ) );

		$this->assertEquals( array( $post_two ), get_boundary_post( true, '', true, 'post_tag' ) );
		$this->assertEquals( array( $post_four ), get_boundary_post( true, '', false, 'post_tag' ) );
	}

	/**
	 * @ticket 22112
	 */
	function test_get_adjacent_post_exclude_self_term() {
		// Bump term_taxonomy to mimic shared term offsets.
		global $wpdb;
		$wpdb->insert( $wpdb->term_taxonomy, array( 'taxonomy' => 'foo', 'term_id' => 12345, 'description' => '' ) );

		$include = $this->factory->term->create( array(
			'taxonomy' => 'category',
			'name' => 'Include',
		) );
		$exclude = $this->factory->category->create();

		$one = $this->factory->post->create_and_get( array(
			'post_date' => '2012-01-01 12:00:00',
			'post_category' => array( $include, $exclude ),
		) );

		$two = $this->factory->post->create_and_get( array(
			'post_date' => '2012-01-02 12:00:00',
			'post_category' => array(),
		) );

		$three = $this->factory->post->create_and_get( array(
			'post_date' => '2012-01-03 12:00:00',
			'post_category' => array( $include, $exclude ),
		) );

		$four = $this->factory->post->create_and_get( array(
			'post_date' => '2012-01-04 12:00:00',
			'post_category' => array( $include ),
		) );

		$five = $this->factory->post->create_and_get( array(
			'post_date' => '2012-01-05 12:00:00',
			'post_category' => array( $include, $exclude ),
		) );

		// First post
		$this->go_to( get_permalink( $one ) );
		$this->assertEquals( $two, get_adjacent_post( false, array(), false ) );
		$this->assertEquals( $three, get_adjacent_post( true, array(), false ) );
		$this->assertEquals( $two, get_adjacent_post( false, array( $exclude ), false ) );
		$this->assertEquals( $four, get_adjacent_post( true, array( $exclude ), false ) );
		$this->assertEmpty( get_adjacent_post( false, array(), true ) );

		// Fourth post
		$this->go_to( get_permalink( $four ) );
		$this->assertEquals( $five, get_adjacent_post( false, array(), false ) );
		$this->assertEquals( $five, get_adjacent_post( true, array(), false ) );
		$this->assertEmpty( get_adjacent_post( false, array( $exclude ), false ) );
		$this->assertEmpty( get_adjacent_post( true, array( $exclude ), false ) );

		$this->assertEquals( $three, get_adjacent_post( false, array(), true ) );
		$this->assertEquals( $three, get_adjacent_post( true, array(), true ) );
		$this->assertEquals( $two, get_adjacent_post( false, array( $exclude ), true ) );
		$this->assertEmpty( get_adjacent_post( true, array( $exclude ), true ) );

		// Last post
		$this->go_to( get_permalink( $five ) );
		$this->assertEquals( $four, get_adjacent_post( false, array(), true ) );
		$this->assertEquals( $four, get_adjacent_post( true, array(), true ) );
		$this->assertEquals( $four, get_adjacent_post( false, array( $exclude ), true ) );
		$this->assertEquals( $four, get_adjacent_post( true, array( $exclude ), true ) );
		$this->assertEmpty( get_adjacent_post( false, array(), false ) );
	}

	public function test_wp_make_link_relative_with_http_scheme() {
		$link = 'http://example.com/this-is-a-test-http-url/';
		$relative_link = wp_make_link_relative( $link );
		$this->assertEquals( '/this-is-a-test-http-url/', $relative_link );
	}

	public function test_wp_make_link_relative_with_https_scheme() {
		$link = 'https://example.com/this-is-a-test-https-url/';
		$relative_link = wp_make_link_relative( $link );
		$this->assertEquals( '/this-is-a-test-https-url/', $relative_link );
	}

	/**
	 * @ticket 30373
	 */
	public function test_wp_make_link_relative_with_no_scheme() {
		$link = '//example.com/this-is-a-test-schemeless-url/';
		$relative_link = wp_make_link_relative( $link );
		$this->assertEquals( '/this-is-a-test-schemeless-url/', $relative_link );
	}

	/**
	 * @ticket 30373
	 */
	public function test_wp_make_link_relative_should_retain_URL_param_that_is_also_a_URL() {
		$link = 'https://example.com/this-is-a-test/?redirect=https://example.org/a-different-test-post/';
		$relative_link = wp_make_link_relative( $link );
		$this->assertEquals( '/this-is-a-test/?redirect=https://example.org/a-different-test-post/', $relative_link );
	}

	/**
	 * @ticket 30910
	 */
	public function test_get_permalink_should_not_reveal_post_name_for_post_with_post_status_future() {
		update_option( 'permalink_structure','/%year%/%monthnum%/%day%/%postname%/' );

		flush_rewrite_rules();

		$p = $this->factory->post->create( array(
			'post_status' => 'publish',
			'post_date'   => strftime( '%Y-%m-%d %H:%M:%S', strtotime( '+1 day' ) )
		) );

		$non_pretty_permalink = add_query_arg( 'p', $p, trailingslashit( home_url() ) );

		$this->assertEquals( $non_pretty_permalink, get_permalink( $p ) );
	}

	/**
	 * @ticket 30910
	 */
	public function test_get_permalink_should_not_reveal_post_name_for_cpt_with_post_status_future() {
		update_option( 'permalink_structure','/%year%/%monthnum%/%day%/%postname%/' );

		register_post_type( 'wptests_pt', array( 'public' => true ) );

		flush_rewrite_rules();

		$p = $this->factory->post->create( array(
			'post_status' => 'future',
			'post_type'   => 'wptests_pt',
			'post_date'   => strftime( '%Y-%m-%d %H:%M:%S', strtotime( '+1 day' ) )
		) );

		$non_pretty_permalink = add_query_arg( array(
			'post_type' => 'wptests_pt',
			'p' => $p,
		), trailingslashit( home_url() ) );

		$this->assertEquals( $non_pretty_permalink, get_permalink( $p ) );
	}
}


text:
typedef struct STABannerSizeEnum {
    CGSize size;
    BOOL isAuto;
} STABannerSize;

#pragma mark Standard Sizes

// iPhone and iPod Touch in portrait mode = 320x50.
extern STABannerSize  const STA_PortraitAdSize_320x50;

// iPhone and iPod Touch in landscape mode = 480x50.
extern STABannerSize const STA_LandscapeAdSize_480x50;

// iPhone and iPod Touch in landscape mode = 568x50.
extern STABannerSize const STA_LandscapeAdSize_568x50;

// iPad in portrait mode = 768x90.
extern STABannerSize const STA_PortraitAdSize_768x90;

// iPad in landscape mode = 1024x90.
extern STABannerSize const STA_LandscapeAdSize_1024x90;

extern STABannerSize const STA_AutoAdSize;


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
HRESIAbstractType (POI API Documentation)
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.apache.poi.hwpf.model.types

Class HRESIAbstractType

java.lang.Object
  org.apache.poi.hwpf.model.types.HRESIAbstractType

Direct Known Subclasses:
Hyphenation

@Internal
public abstract class HRESIAbstractType
extends java.lang.Object

Hyphenation (HRESI).

 Class and fields descriptions are quoted from Microsoft Office Word 97-2007
 Binary File Format (.doc) Specification

 NOTE: This source is automatically generated please do not modify this file.
 Either subclass or remove the record in src/types/definitions.

Author:

Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary
         File Format (.doc) Specification

Field Summary

protected  byte
field_1_hres

protected  byte
field_2_chHres

static byte
HRES_ADD_LETTER_BEFORE

static byte
HRES_CHANGE_LETTER_AFTER

static byte
HRES_CHANGE_LETTER_BEFORE

static byte
HRES_DELETE_BEFORE_CHANGE_BEFORE

static byte
HRES_DELETE_LETTER_BEFORE

static byte
HRES_NO

static byte
HRES_NORMAL

Constructor Summary

protected
HRESIAbstractType()

Method Summary

protected  void
fillFields(byte[] data,
           int offset)

 byte
getChHres()

          The character that will be used to add or change a letter when hres is 2, 3, 5 or 6.

 byte
getHres()

          Hyphenation rule.

static int
getSize()

          Size of record (exluding 4 byte header)

 void
serialize(byte[] data,
          int offset)

 void
setChHres(byte field_2_chHres)

          The character that will be used to add or change a letter when hres is 2, 3, 5 or 6.

 void
setHres(byte field_1_hres)

          Hyphenation rule.

 java.lang.String
toString()

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

field_1_hres

protected byte field_1_hres

HRES_NO

public static final byte HRES_NO

See Also:
Constant Field Values

HRES_NORMAL

public static final byte HRES_NORMAL

See Also:
Constant Field Values

HRES_ADD_LETTER_BEFORE

public static final byte HRES_ADD_LETTER_BEFORE

See Also:
Constant Field Values

HRES_CHANGE_LETTER_BEFORE

public static final byte HRES_CHANGE_LETTER_BEFORE

See Also:
Constant Field Values

HRES_DELETE_LETTER_BEFORE

public static final byte HRES_DELETE_LETTER_BEFORE

See Also:
Constant Field Values

HRES_CHANGE_LETTER_AFTER

public static final byte HRES_CHANGE_LETTER_AFTER

See Also:
Constant Field Values

HRES_DELETE_BEFORE_CHANGE_BEFORE

public static final byte HRES_DELETE_BEFORE_CHANGE_BEFORE

See Also:
Constant Field Values

field_2_chHres

protected byte field_2_chHres

Constructor Detail

HRESIAbstractType

protected HRESIAbstractType()

Method Detail

fillFields

protected void fillFields(byte[] data,
                          int offset)

serialize

public void serialize(byte[] data,
                      int offset)

getSize

public static int getSize()

Size of record (exluding 4 byte header)

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

getHres

public byte getHres()

Hyphenation rule.

Returns:
One of

HRES_NO

HRES_NORMAL

HRES_ADD_LETTER_BEFORE

HRES_CHANGE_LETTER_BEFORE

HRES_DELETE_LETTER_BEFORE

HRES_CHANGE_LETTER_AFTER

HRES_DELETE_BEFORE_CHANGE_BEFORE

setHres

public void setHres(byte field_1_hres)

Hyphenation rule.

Parameters:
field_1_hres - One of

HRES_NO

HRES_NORMAL

HRES_ADD_LETTER_BEFORE

HRES_CHANGE_LETTER_BEFORE

HRES_DELETE_LETTER_BEFORE

HRES_CHANGE_LETTER_AFTER

HRES_DELETE_BEFORE_CHANGE_BEFORE

getChHres

public byte getChHres()

The character that will be used to add or change a letter when hres is 2, 3, 5 or 6.

setChHres

public void setChHres(byte field_2_chHres)

The character that will be used to add or change a letter when hres is 2, 3, 5 or 6.

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

                Copyright 2017 The Apache Software Foundation or
        its licensors, as applicable.


text:
layout: default
---

Post Categories

{% for category in site.blog_categories %}

	  {% assign posts = site.posts | where: "category", category.slug %}
	  {% assign count = posts | size %}
	  {% assign latest = posts | first %}

{{ category.name }}

{{ posts | size }} {% if count > 1 %}posts{% else %}post{% endif %}

Latest: {{latest.title}}

{% endfor %}


text:
import { filteredDataSelector } from './data.selector';
import { getMockDatasource } from '../../utils/mock';

describe('filtering data works', () => {
	test('with one static filter', () => {
		const actual = filteredDataSelector({
			data: getMockDatasource(1, 10, 10),
			filters: { toto: { dimensionId: 'toto', staticValue: [1] } }
		});
		expect(actual.length).toEqual(20);
		expect(actual.map(data => data.toto).includes(1)).toBe(true);
		expect(actual.map(data => data.toto).includes(0)).toBe(false);
	});
});


text:
::*****************************************************************************
:: (c) Copyright 2009 - 2012 Xilinx, Inc. All rights reserved.
::
:: This file contains confidential and proprietary information
:: of Xilinx, Inc. and is protected under U.S. and
:: international copyright and other intellectual property
:: laws.
::
:: DISCLAIMER
:: This disclaimer is not a license and does not grant any
:: rights to the materials distributed herewith. Except as
:: otherwise provided in a valid license issued to you by
:: Xilinx, and to the maximum extent permitted by applicable
:: law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
:: WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
:: AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
:: BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
:: INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
:: (2) Xilinx shall not be liable (whether in contract or tort,
:: including negligence, or under any other theory of
:: liability) for any loss or damage of any kind or nature
:: related to, arising under or in connection with these
:: materials, including for any direct, or any indirect,
:: special, incidental, or consequential loss or damage
:: (including loss of data, profits, goodwill, or any type of
:: loss or damage suffered as a result of any action brought
:: by a third party) even if such damage or loss was
:: reasonably foreseeable or Xilinx had been advised of the
:: possibility of the same.
::
:: CRITICAL APPLICATIONS
:: Xilinx products are not designed or intended to be fail-
:: safe, or for use in any application requiring fail-safe
:: performance, such as life-support or safety devices or
:: systems, Class III medical devices, nuclear facilities,
:: applications related to the deployment of airbags, or any
:: other applications that could lead to death, personal
:: injury, or severe property or environmental damage
:: (individually and collectively, "Critical
:: Applications"). Customer assumes the sole risk and
:: liability of any use of Xilinx products in Critical
:: Applications, subject only to applicable laws and
:: regulations governing limitations on product liability.
::
:: THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
:: PART OF THIS FILE AT ALL TIMES.
::
::****************************************************************************
::   ____  ____
::  /   /\/   /
:: /___/  \  /    Vendor                : Xilinx
:: \   \   \/     Version               : 1.9
::  \   \         Application           : MIG
::  /   /         Filename              : ise_flow.bat
:: /___/   /\     Date Last Modified    : $Date: 2011/06/02 08:31:14 $
:: \   \  /  \    Date Created          : Tue Sept 21 2010
::  \___\/\___\
::
:: Device            : 7 Series
:: Design Name       : DDR2 SDRAM
:: Purpose           : Batch file to run Synthesis and PAR through ISE in batch mode
:: Reference         :
:: Revision History  :
::****************************************************************************

call rem_files.bat

echo Synthesis Tool: XST

mkdir "../synth/__projnav" > ise_flow_results.txt
mkdir "../synth/xst" >> ise_flow_results.txt
mkdir "../synth/xst/work" >> ise_flow_results.txt

xst -ifn xst_options.txt -ofn example_top.syr -intstyle ise >> ise_flow_results.txt
if not exist "example_top.ngc" (
  echo Failed in SYNTHESIS
  goto END )

echo Implementation Tool: ISE

echo Running TRANSLATE
ngdbuild -intstyle ise -dd ../synth/_ngo -nt timestamp -uc example_top.ucf -p xc7a100t-csg324-1 example_top.ngc example_top.ngd >> ise_flow_results.txt
if not exist "example_top.ngd" (
  echo Failed in TRANSLATE
  goto END )

echo Running MAP
map -intstyle ise -p xc7a100t-csg324-1 -w -ol high -xe n -register_duplication off -ir off -pr off -lc off -power off -o example_top_map.ncd example_top.ngd example_top.pcf >> ise_flow_results.txt
if not exist "example_top_map.ncd" (
  echo Failed in MAP
  goto END )

echo Running PAR
par -w -intstyle ise -ol high -xe n example_top_map.ncd example_top.ncd example_top.pcf >> ise_flow_results.txt
if not exist "example_top.ncd" (
  echo Failed in PAR
  goto END )

echo Running TRACE
trce -intstyle ise -v 3 -fastpaths -xml example_top example_top.ncd -o example_top.twr example_top.pcf >> ise_flow_results.txt
echo Running BITGEN
bitgen -intstyle ise example_top.ncd >> ise_flow_results.txt

if not exist "example_top.bit" (
  echo Failed in BITGEN
  goto END )

echo IMPLEMENTATION SUCCESSFUL
:END


text:
package com.mercadopago.android.px.internal.view;

import android.content.Context;
import android.content.res.Resources;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.text.Spanned;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.mercadopago.android.px.internal.util.TextUtil;

public abstract class Renderer<T extends Component> {

    private T component;
    private Context context;

    public void setComponent(@NonNull final T component) {
        this.component = component;
    }

    public void setContext(@NonNull final Context context) {
        this.context = context;
    }

    public View render() {
        return render(null);
    }

    public View render(@Nullable final ViewGroup parent) {
        final View view = render(component, context, parent);
        view.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
            @Override
            public void onViewAttachedToWindow(View v) {
                component.viewAttachedToWindow();
            }

            @Override
            public void onViewDetachedFromWindow(View v) {
                component.viewDetachedFromWindow();
            }
        });
        return view;
    }

    protected abstract View render(@NonNull final T component,
        @NonNull final Context context,
        @Nullable final ViewGroup parent);

    protected View inflate(@LayoutRes final int layout, @Nullable final ViewGroup parent) {
        return LayoutInflater.from(context).inflate(layout, parent);
    }

    protected void setText(@NonNull final TextView view, @StringRes final int resource) {
        try {
            String text = context.getResources().getString(resource);
            if (text.isEmpty()) {
                view.setVisibility(View.GONE);
            } else {
                view.setText(text);
            }
        } catch (final Resources.NotFoundException ex) {
            //Todo: add to tracker
            view.setVisibility(View.GONE);
        }
    }

    protected void setText(@NonNull final TextView view, @Nullable final String text) {
        if (TextUtil.isEmpty(text)) {
            view.setVisibility(View.GONE);
        } else {
            view.setText(text);
        }
    }

    protected void setText(@NonNull final TextView view, @Nullable final CharSequence text) {
        if (TextUtil.isEmpty(text)) {
            view.setVisibility(View.GONE);
        } else {
            view.setText(text);
        }
    }

    protected void setText(@NonNull final TextView view, Spanned text) {
        if (text == null) {
            view.setVisibility(View.GONE);
        } else {
            view.setText(text);
        }
    }
}


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

namespace SharpNeat.View.Graph
{
    /// <summary>
    /// Represents a [weighted and directed] graph of connected nodes with nodes divided into
    /// three types/groups; Input nodes, output nodes and hidden nodes.
    /// </summary>
    public class IOGraph
    {
        readonly List<GraphNode> _inputNodeList;
        readonly List<GraphNode> _outputNodeList;
        readonly List<GraphNode> _hiddenNodeList;
        float _connectionWeightRange;
        Size _bounds;
        int _depth;

        #region Constructors

        /// <summary>
        /// Construct with the specified connection weight range. Weight range is used to determine
        /// each connection's strength relative to the overall range.
        /// </summary>
        public IOGraph(float connectionWeightRange)
        {
            _inputNodeList = new List<GraphNode>();
            _outputNodeList = new List<GraphNode>();
            _hiddenNodeList = new List<GraphNode>();
            _connectionWeightRange = connectionWeightRange;
        }

        /// <summary>
        /// Construct with the specified input, output and hidden node count. Counts are used to
        /// pre-allocate storage.
        /// Weight range is used to determine each connection's strength relative to the overall range.
        /// </summary>
        public IOGraph(int inputCount, int outputCount, int hiddenCount, float connectionWeightRange, int depth)
        {
            _inputNodeList = new List<GraphNode>(inputCount);
            _outputNodeList = new List<GraphNode>(outputCount);
            _hiddenNodeList = new List<GraphNode>(hiddenCount);
            _connectionWeightRange = connectionWeightRange;
            _depth = depth;
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets the list of input nodes.
        /// </summary>
        public List<GraphNode> InputNodeList
        {
            get { return _inputNodeList; }
        }

        /// <summary>
        /// Gets the list of output nodes.
        /// </summary>
        public List<GraphNode> OutputNodeList
        {
            get { return _outputNodeList; }
        }

        /// <summary>
        /// Gets the list of hidden nodes.
        /// </summary>
        public List<GraphNode> HiddenNodeList
        {
            get { return _hiddenNodeList; }
        }

        /// <summary>
        /// Gets the connection weight range.
        /// </summary>
        public float ConnectionWeightRange
        {
            get { return _connectionWeightRange; }
            set { _connectionWeightRange = value; }
        }

        /// <summary>
        /// Gets or sets the bounds of the model elements.
        /// </summary>
        public Size Bounds
        {
            get { return _bounds; }
            set { _bounds = value; }
        }

        /// <summary>
        /// Indicates the total depth of the network.
        /// E.g. a network with a single hidden node connected up to an input and output will have three layers
        /// (input, hidden layer 1, output) and will thus have a depth of 3. The layers are assigned deph values
        /// of 0, 1 and 2 respectively.
        /// </summary>
        public int Depth
        {
            get { return _depth; }
        }

        #endregion
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="ISO-8859-1">
<title>com.gsma.android.utils</title>
<meta name="date" content="2014-10-03">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

com.gsma.android.utils

Classes

CookieManagement

HttpUtils

JsonUtils

KeyValuePair

ParameterList

PhoneState

PhoneUtils


text:
module NavTypesHelper
end


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

namespace Models.Search.ThirdPartyApiModels
{
	public class GeoNames
	{
		//Returned by GeoNames API
		public class SearchResultRaw
		{
			public SearchResultRaw()
			{
				bbox = new BoundingBox();
			}
			public int geonameId { get; set; } //GeoNames ID
			public string name { get; set; } //Name of the place
			public string toponymName { get; set; } //Alternative name (?)
			public string adminName1 { get; set; } //State/province name
			public string adminCode1 { get; set; } //State/province abbreviation
			public string countryName { get; set; } //Name of the country
			public string countryCode { get; set; } //Country abbreviation
			public string lat { get; set; } //Latitude
			public string lng { get; set; } //Longitude
			public long population { get; set; } //Population Size
			public string countryId { get; set; } //GeoNames country ID. Appears to be an integer, but is returned as a string
			public string fclName { get; set; } //Type of place (e.g., "city, village...")
			public string fcl { get; set; } //Unknown
			public string fcode { get; set; } //Unknown
			public string fcodeName { get; set; } //Unknown
			public BoundingBox bbox { get; set; } //Bounding Box
		}
		//

		//Returned by GeoNames API
		public class SearchResultsRaw
		{
			public int totalResultsCount { get; set; }
			public List<SearchResultRaw> geonames { get; set; }
		}
		//

		public class BoundingBox
		{
			public decimal north { get; set; }
			public decimal south { get; set; }
			public decimal east { get; set; }
			public decimal west { get; set; }
		}
		//

	}

	public class GoogleGeocoding
	{
		//Result set returned by Google. Usually only one result is returned.
		public class Results
		{
			public Results()
			{
				results = new List<Result>();
			}
			public List<Result> results { get; set; }
			public string status { get; set; }

			//Shortcut
			public Location GetLocation()
			{
				try
				{
					return results.First().geometry.location;
				}
				catch
				{
					return new Location();
				}
			}
		}
		//

		//Individual result within the set.
		public class Result
		{
			public Result()
			{
				address_components = new List<AddressComponent>();
				geometry = new Geometry();
				types = new List<string>();
			}

			public List<AddressComponent> address_components { get; set; }
			public string formatted_address { get; set; }
			public Geometry geometry { get; set; }
			public bool partial_match { get; set; }
			public string place_id { get; set; }
			public List<string> types { get; set; }
		}
		//

		//Address item - seems to contain miscellaneous address information about the location including type of location, parent locations all the way up to country level, and zip code info
		public class AddressComponent
		{
			public AddressComponent()
			{
				types = new List<string>();
			}

			public string long_name { get; set; }
			public string short_name { get; set; }
			public List<string> types { get; set; }
		}
		//

		//Geometry information - the "location" field in here is usually what we're interested in
		public class Geometry
		{
			public Geometry()
			{
				location = new Location();
				viewport = new Viewport();
			}
			public Location location { get; set; }
			public string location_type { get; set; }
			public Viewport viewport { get; set; }
		}
		//

		//Location item, used in a few places
		public class Location
		{
			public double lat { get; set; }
			public double lng { get; set; }
		}
		//

		//Viewport data for setting a specific viewport over a location - may not be necessary client-side since the map can be centered over an arbitrary position with an arbitrary zoom level
		public class Viewport
		{
			public Viewport()
			{
				northeast = new Location();
				southwest = new Location();
			}
			public Location northeast { get; set; }
			public Location southwest { get; set; }
		}
		//

	}
}


text:
package org.jivesoftware.smackx.hoxt.packet;

import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.NamedElement;
import org.jivesoftware.smack.util.XmlStringBuilder;
import org.jivesoftware.smackx.shim.packet.HeadersExtension;

/**
 * Abstract parent for Req and Resp IQ packets.
 *
 * @author Andriy Tsykholyas
 * @see XEP-0332: HTTP over XMPP transport
 */
public abstract class AbstractHttpOverXmpp extends IQ {

    public static final String NAMESPACE = "urn:xmpp:http";

    protected AbstractHttpOverXmpp(String element) {
        super(element, NAMESPACE);
    }

    private HeadersExtension headers;
    private Data data;

    protected String version;

    protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) {
        IQChildElementXmlStringBuilder builder = getIQHoxtChildElementBuilder(xml);
        builder.append(headers.toXML());
        builder.append(data.toXML());

        return builder;
    }

    /**
     * Returns start tag.
     *
     * @return start tag
     */
    protected abstract IQChildElementXmlStringBuilder getIQHoxtChildElementBuilder(IQChildElementXmlStringBuilder xml);

    /**
     * Returns version attribute.
     *
     * @return version attribute
     */
    public String getVersion() {
        return version;
    }

    /**
     * Sets version attribute.
     *
     * @param version version attribute
     */
    public void setVersion(String version) {
        this.version = version;
    }

    /**
     * Returns Headers element.
     *
     * @return Headers element
     */
    public HeadersExtension getHeaders() {
        return headers;
    }

    /**
     * Sets Headers element.
     *
     * @param headers Headers element
     */
    public void setHeaders(HeadersExtension headers) {
        this.headers = headers;
    }

    /**
     * Returns Data element.
     *
     * @return Data element
     */
    public Data getData() {
        return data;
    }

    /**
     * Sets Data element.
     *
     * @param data Headers element
     */
    public void setData(Data data) {
        this.data = data;
    }

    /**
     * Representation of Data element.

     * This class is immutable.
     */
    public static class Data {

        private final NamedElement child;

        /**
         * Creates Data element.
         *
         * @param child element nested by Data
         */
        public Data(NamedElement child) {
            this.child = child;
        }

        /**
         * Returns string containing xml representation of this object.
         *
         * @return xml representation of this object
         */
        public String toXML() {
            StringBuilder builder = new StringBuilder();
            builder.append("<data>");
            builder.append(child.toXML());
            builder.append("</data>");
            return builder.toString();
        }

        /**
         * Returns element nested by Data.
         *
         * @return element nested by Data
         */
        public NamedElement getChild() {
            return child;
        }
    }

    /**
     * Representation of Text element.

     * This class is immutable.
     */
    public static class Text implements NamedElement {

        public static final String ELEMENT = "text";

        private final String text;

        /**
         * Creates this element.
         *
         * @param text value of text
         */
        public Text(String text) {
            this.text = text;
        }

        @Override
        public XmlStringBuilder toXML() {
            XmlStringBuilder xml = new XmlStringBuilder(this);
            xml.rightAngleBracket();
            xml.optAppend(text);
            xml.closeElement(this);
            return xml;
        }

        /**
         * Returns text of this element.
         *
         * @return text
         */
        public String getText() {
            return text;
        }

        @Override
        public String getElementName() {
            return ELEMENT;
        }
    }

    /**
     * Representation of Base64 element.

     * This class is immutable.
     */
    public static class Base64 implements NamedElement {

        public static final String ELEMENT = "base64";

        private final String text;

        /**
         * Creates this element.
         *
         * @param text value of text
         */
        public Base64(String text) {
            this.text = text;
        }

        @Override
        public XmlStringBuilder toXML() {
            XmlStringBuilder xml = new XmlStringBuilder(this);
            xml.rightAngleBracket();
            xml.optAppend(text);
            xml.closeElement(this);
            return xml;
        }

        /**
         * Returns text of this element.
         *
         * @return text
         */
        public String getText() {
            return text;
        }

        @Override
        public String getElementName() {
            return ELEMENT;
        }
    }

    /**
     * Representation of Xml element.

     * This class is immutable.
     */
    public static class Xml implements NamedElement {

        public static final String ELEMENT = "xml";

        private final String text;

        /**
         * Creates this element.builder.toString();
         *
         * @param text value of text
         */
        public Xml(String text) {
            this.text = text;
        }

        @Override
        public XmlStringBuilder toXML() {
            XmlStringBuilder xml = new XmlStringBuilder(this);
            xml.rightAngleBracket();
            xml.optAppend(text);
            xml.closeElement(this);
            return xml;
        }

        /**
         * Returns text of this element.
         *
         * @return text
         */
        public String getText() {
            return text;
        }

        @Override
        public String getElementName() {
            return ELEMENT;
        }
    }

    /**
     * Representation of ChunkedBase64 element.

     * This class is immutable.
     */
    public static class ChunkedBase64 implements NamedElement {

        public static final String ELEMENT = "chunkedBase64";

        private final String streamId;

        /**
         * Creates ChunkedBase86 element.
         *
         * @param streamId streamId attribute
         */
        public ChunkedBase64(String streamId) {
            this.streamId = streamId;
        }

        @Override
        public XmlStringBuilder toXML() {
            XmlStringBuilder xml = new XmlStringBuilder(this);
            xml.attribute("streamId", streamId);
            xml.closeEmptyElement();
            return xml;
        }

        /**
         * Returns streamId attribute.
         *
         * @return streamId attribute
         */
        public String getStreamId() {
            return streamId;
        }

        @Override
        public String getElementName() {
            return ELEMENT;
        }
    }

    /**
     * Representation of Ibb element.

     * This class is immutable.
     */
    public static class Ibb implements NamedElement {

        public static final String ELEMENT = "ibb";

        private final String sid;

        /**
         * Creates Ibb element.
         *
         * @param sid sid attribute
         */
        public Ibb(String sid) {
            this.sid = sid;
        }

        @Override
        public XmlStringBuilder toXML() {
            XmlStringBuilder xml = new XmlStringBuilder(this);
            xml.attribute("sid", sid);
            xml.closeEmptyElement();
            return xml;
        }

        /**
         * Returns sid attribute.
         *
         * @return sid attribute
         */
        public String getSid() {
            return sid;
        }

        @Override
        public String getElementName() {
            return ELEMENT;
        }
    }
}


text:
=====================================
Roadmap & NumPy Enhancement Proposals
=====================================

This page provides an overview of development priorities for NumPy.
Specifically, it contains a roadmap with a higher-level overview, as
well as NumPy Enhancement Proposals (NEPs)—suggested changes
to the library—in various stages of discussion or completion (see `NEP
0 <nep-0000>`__).

Roadmap
-------
.. toctree::
   :maxdepth: 1

   Index <index>
   The Scope of NumPy <scope>
   Current roadmap <roadmap>
   Wishlist (opens new window) |wishlist_link|

.. |wishlist_link| raw:: html

   WishList


text:
package com.gooddata.project;

import com.gooddata.AbstractGoodDataIT;
import com.gooddata.GoodDataException;
import com.gooddata.collections.PageRequest;
import com.gooddata.gdc.AsyncTask;
import com.gooddata.gdc.TaskStatus;
import com.gooddata.gdc.UriResponse;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import static com.gooddata.JsonMatchers.isJsonString;
import static com.gooddata.util.ResourceUtils.readFromResource;
import static net.jadler.Jadler.onRequest;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;

import java.util.Collection;
import java.util.List;
import java.util.Set;

public class ProjectServiceIT extends AbstractGoodDataIT {

    private static final ObjectMapper MAPPER = new ObjectMapper();

    private static final String PROJECT_ID = "PROJECT_ID";
    private static final String PROJECT_URI = "/gdc/projects/" + PROJECT_ID;

    private Project loading;
    private Project enabled;
    private Project deleted;

    @BeforeClass
    public void setUp() throws Exception {
        loading = MAPPER.readValue(readFromResource("/project/project-loading.json"), Project.class);
        enabled = MAPPER.readValue(readFromResource("/project/project.json"), Project.class);
        deleted = MAPPER.readValue(readFromResource("/project/project-deleted.json"), Project.class);
    }

    @Test
    public void shouldCreateProject() throws Exception {
        onRequest()
                .havingMethodEqualTo("POST")
                .havingPathEqualTo(Projects.URI)
                .respond()
                .withBody(MAPPER.writeValueAsString(new UriResponse(PROJECT_URI)))
                .withStatus(202)
        ;
        onRequest()
                .havingMethodEqualTo("GET")
                .havingPathEqualTo(PROJECT_URI)
            .respond()
                .withBody(MAPPER.writeValueAsString(loading))
                .withStatus(202)
            .thenRespond()
                .withBody(MAPPER.writeValueAsString(enabled))
                .withStatus(200)
        ;

        final Project project = gd.getProjectService().createProject(new Project("TITLE", "AUTH_TOKEN")).get();
        assertThat(project, is(notNullValue()));
        assertThat(project.getTitle(), is("TITLE"));
    }

    @Test(expectedExceptions = GoodDataException.class)
    public void shouldFailWhenPostFails() throws Exception {
        onRequest()
                .havingMethodEqualTo("POST")
                .havingPathEqualTo(Projects.URI)
            .respond()
                .withStatus(400)
        ;
        gd.getProjectService().createProject(new Project("TITLE", "AUTH_TOKEN")).get();
    }

    @Test(expectedExceptions = GoodDataException.class)
    public void shouldFailWhenPollFails() throws Exception {
        onRequest()
                .havingMethodEqualTo("POST")
                .havingPathEqualTo(Projects.URI)
            .respond()
                .withBody(MAPPER.writeValueAsString(new UriResponse(PROJECT_URI)))
                .withStatus(202)
        ;
        onRequest()
                .havingMethodEqualTo("GET")
                .havingPathEqualTo(PROJECT_URI)
            .respond()
                .withStatus(400)
        ;

        gd.getProjectService().createProject(new Project("TITLE", "AUTH_TOKEN")).get();
    }

    @Test(expectedExceptions = GoodDataException.class)
    public void shouldFailWhenCantCreateProject() throws Exception {
        onRequest()
                .havingMethodEqualTo("POST")
                .havingPathEqualTo(Projects.URI)
            .respond()
                .withBody(MAPPER.writeValueAsString(new UriResponse(PROJECT_URI)))
                .withStatus(202)
        ;
        onRequest()
                .havingMethodEqualTo("GET")
                .havingPathEqualTo(PROJECT_URI)
            .respond()
                .withBody(MAPPER.writeValueAsString(deleted))
                .withStatus(200)
        ;

        gd.getProjectService().createProject(new Project("TITLE", "AUTH_TOKEN")).get();
    }

    @Test
    public void shouldRemoveProject() throws Exception {
        onRequest()
                .havingMethodEqualTo("DELETE")
                .havingPathEqualTo(PROJECT_URI)
                .respond()
                .withStatus(202);

        gd.getProjectService().removeProject(enabled);
    }

    @Test
    public void shouldReturnProjectTemplates() throws Exception {
        onRequest()
                .havingPathEqualTo("/gdc/md/" + PROJECT_ID + "/templates")
            .respond()
                .withBody(readFromResource("/project/project-templates.json"));

        final Collection<ProjectTemplate> templates = gd.getProjectService().getProjectTemplates(enabled);
        assertThat(templates, is(notNullValue()));
        assertThat(templates, hasSize(1));
    }

    @Test
    public void shouldReturnAvailableValidations() throws Exception {
        onRequest()
                .havingPathEqualTo("/gdc/md/" + PROJECT_ID + "/validate")
                    .respond()
                    .withBody(readFromResource("/project/project-validationAvail.json"));

        final Set<ProjectValidationType> validations = gd.getProjectService().getAvailableProjectValidationTypes(enabled);
        assertThat(validations, notNullValue());
        assertThat(validations, hasSize(7));

    }

    @Test
    public void shouldValidateProject() throws Exception {
        final String validateUri = "/gdc/md/"  + PROJECT_ID + "/validate";
        final String task1Uri = validateUri + "/task/TASK_ID";
        final String task2Uri = validateUri + "/task/TASK_ID2";
        final String resultUri = validateUri + "/result/RESULT_ID";

        onRequest()
                .havingPathEqualTo(validateUri)
            .respond()
                .withBody(readFromResource("/project/project-validationAvail.json"));

        onRequest()
                .havingPathEqualTo(validateUri)
                .havingMethodEqualTo("POST")
                .havingBody(isJsonString("/project/project-validate.json"))
            .respond()
                .withBody(MAPPER.writeValueAsString(new AsyncTask(task1Uri)))
                .withStatus(201);

        onRequest()
                .havingPathEqualTo(task1Uri)
            .respond()
                .withBody(MAPPER.writeValueAsString(new UriResponse(task2Uri)))
                .withHeader("Location", task2Uri)
                .withStatus(303);

        onRequest()
                .havingPathEqualTo(task2Uri)
            .respond()
                .withBody(MAPPER.writeValueAsString(new AsyncTask(task2Uri)))
                .withStatus(202)
            .thenRespond()
                .withBody(MAPPER.writeValueAsString(new UriResponse(resultUri)))
                .withHeader("Location", resultUri)
                .withStatus(303);

        onRequest()
                .havingPathEqualTo(resultUri)
            .respond()
                .withBody(readFromResource("/project/project-validationResults.json"))
                .withStatus(200);

        final ProjectValidationResults validateResult = gd.getProjectService().validateProject(enabled).get();

        assertThat(validateResult, notNullValue());
    }

    @Test
    public void shouldValidateProject2() throws Exception {
        final String validateUri = "/gdc/md/" + PROJECT_ID + "/validate";
        final String task1Uri = validateUri + "/task/TASK_ID";
        final String task2Uri = validateUri + "/task/TASK_ID2";
        final String resultUri = validateUri + "/result/RESULT_ID";

        onRequest()
                .havingPathEqualTo(validateUri)
            .respond()
                .withBody(readFromResource("/project/project-validationAvail.json"));

        onRequest()
                .havingPathEqualTo(validateUri)
                .havingMethodEqualTo("POST")
                .havingBody(isJsonString("/project/project-validate.json"))
            .respond()
                .withBody(MAPPER.writeValueAsString(new AsyncTask(task1Uri)))
                .withStatus(201);

        onRequest()
                .havingPathEqualTo(task1Uri)
            .respond()
                .withBody(MAPPER.writeValueAsString(new UriResponse(task2Uri)))
                .withHeader("Location", task1Uri)
                .withStatus(303)
            .thenRespond()
                .withBody(MAPPER.writeValueAsString(new TaskStatus("RUNNING", task2Uri)))
                .withHeader("Location", task1Uri)
                .withStatus(202)
            .thenRespond()
                .withBody(MAPPER.writeValueAsString(new UriResponse(resultUri)))
                .withHeader("Location", resultUri)
                .withStatus(303)
        ;
        onRequest()
                .havingPathEqualTo(resultUri)
            .respond()
                .withBody(readFromResource("/project/project-validationResults.json"))
                .withStatus(200);

        final ProjectValidationResults validateResult = gd.getProjectService().validateProject(enabled).get();

        assertThat(validateResult, notNullValue());
    }

    @Test
    public void shouldReturnProjectRoles() {
        onRequest()
                .havingMethodEqualTo("GET")
                .havingPathEqualTo("/gdc/projects/PROJECT_ID/roles")
        .respond()
                .withBody(readFromResource("/project/project-roles.json"))
                .withStatus(200);

        onRequest()
                .havingMethodEqualTo("GET")
                .havingPathEqualTo("/gdc/projects/PROJECT_ID/roles/ROLE1")
        .respond()
                .withBody(readFromResource("/project/project-role.json"))
                .withStatus(200);

        onRequest()
                .havingMethodEqualTo("GET")
                .havingPathEqualTo("/gdc/projects/PROJECT_ID/roles/ROLE2")
        .respond()
                .withBody(readFromResource("/project/project-role2.json"))
                .withStatus(200);

        final Set<Role> roles = gd.getProjectService().getRoles(enabled);
        assertThat(roles, notNullValue());
        assertThat(roles, hasSize(2));
    }

    @Test
    public void shouldReturnProjectRoleForUri() {
        final String roleUri = "/gdc/projects/PROJECT_ID/roles/ROLE1";
        onRequest()
                .havingMethodEqualTo("GET")
                .havingPathEqualTo(roleUri)
        .respond()
                .withBody(readFromResource("/project/project-role.json"))
                .withStatus(200);

        final Role role = gd.getProjectService().getRoleByUri(roleUri);
        assertThat(role, notNullValue());
        assertThat(role.getTitle(), is("Embedded Dashboard Only"));
    }

    @Test
    public void shouldListPagedUsers() throws Exception {
        onRequest()
                .havingMethodEqualTo("GET")
                .havingPathEqualTo(Users.TEMPLATE.expand("PROJECT_ID").toString())
        .respond()
                .withBody(readFromResource("/project/project-users.json"))
                .withStatus(200);
        onRequest()
                .havingMethodEqualTo("GET")
                .havingPathEqualTo(Users.TEMPLATE.expand("PROJECT_ID").toString())
                .havingQueryStringEqualTo("offset=1&limit=1")
        .respond()
                .withBody(readFromResource("/project/project-users-empty.json"))
                .withStatus(200);

        final List<User> firstPage = gd.getProjectService().listUsers(enabled);
        assertThat(firstPage, notNullValue());
        assertThat(firstPage, hasSize(1));

        final List<User> secondPage = gd.getProjectService().listUsers(enabled, new PageRequest(firstPage.size(), 1));
        assertThat(secondPage, notNullValue());
        assertThat(secondPage, empty());
    }

}


text:
"""
Volume driver for NetApp Data ONTAP (7-mode) iSCSI storage systems.
"""

from oslo_log import log as logging

from cinder.volume import driver
from cinder.volume.drivers.netapp.dataontap import block_7mode

LOG = logging.getLogger(__name__)

class NetApp7modeISCSIDriver(driver.ISCSIDriver):
    """NetApp 7-mode iSCSI volume driver."""

    DRIVER_NAME = 'NetApp_iSCSI_7mode_direct'

    def __init__(self, *args, **kwargs):
        super(NetApp7modeISCSIDriver, self).__init__(*args, **kwargs)
        self.library = block_7mode.NetAppBlockStorage7modeLibrary(
            self.DRIVER_NAME, 'iSCSI', **kwargs)

    def do_setup(self, context):
        self.library.do_setup(context)

    def check_for_setup_error(self):
        self.library.check_for_setup_error()

    def create_volume(self, volume):
        self.library.create_volume(volume)

    def create_volume_from_snapshot(self, volume, snapshot):
        self.library.create_volume_from_snapshot(volume, snapshot)

    def create_cloned_volume(self, volume, src_vref):
        self.library.create_cloned_volume(volume, src_vref)

    def delete_volume(self, volume):
        self.library.delete_volume(volume)

    def create_snapshot(self, snapshot):
        self.library.create_snapshot(snapshot)

    def delete_snapshot(self, snapshot):
        self.library.delete_snapshot(snapshot)

    def get_volume_stats(self, refresh=False):
        return self.library.get_volume_stats(refresh)

    def extend_volume(self, volume, new_size):
        self.library.extend_volume(volume, new_size)

    def ensure_export(self, context, volume):
        return self.library.ensure_export(context, volume)

    def create_export(self, context, volume, connector):
        return self.library.create_export(context, volume)

    def remove_export(self, context, volume):
        self.library.remove_export(context, volume)

    def manage_existing(self, volume, existing_ref):
        return self.library.manage_existing(volume, existing_ref)

    def manage_existing_get_size(self, volume, existing_ref):
        return self.library.manage_existing_get_size(volume, existing_ref)

    def unmanage(self, volume):
        return self.library.unmanage(volume)

    def initialize_connection(self, volume, connector):
        return self.library.initialize_connection_iscsi(volume, connector)

    def terminate_connection(self, volume, connector, **kwargs):
        return self.library.terminate_connection_iscsi(volume, connector,
                                                       **kwargs)

    def get_pool(self, volume):
        return self.library.get_pool(volume)


text:
<!DOCTYPE html>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>The source code</title>
  <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />

/**
 * @class Ext.layout.container.AbstractFit
 * @extends Ext.layout.container.Container
 * <p>This is a base class for layouts that contain <b>a single item</b> that automatically expands to fill the layout's
 * container.  This class is intended to be extended or created via the <tt>layout:'fit'</tt> {@link Ext.container.Container#layout}
 * config, and should generally not need to be created directly via the new keyword.</p>
 * <p>FitLayout does not have any direct config options (other than inherited ones).  To fit a panel to a container
 * using FitLayout, simply set layout:'fit' on the container and add a single panel to it.  If the container has
 * multiple panels, only the first one will be displayed.  Example usage:</p>
 * <pre><code>
var p = new Ext.panel.Panel({
    title: 'Fit Layout',
    layout:'fit',
    items: {
        title: 'Inner Panel',
        html: '&lt;p&gt;This is the inner panel content&lt;/p&gt;',
        border: false
    }
});
</code></pre>
 */
Ext.define('Ext.layout.container.AbstractFit', {

    /* Begin Definitions */

    extend: 'Ext.layout.container.Container',

    /* End Definitions */

    itemCls: Ext.baseCSSPrefix + 'fit-item',
    targetCls: Ext.baseCSSPrefix + 'layout-fit',
    type: 'fit'
});


text:
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { of as observableOf, Observable } from 'rxjs';
import { Store, StoreModule } from '@ngrx/store';

import { FooterComponent } from './footer.component';
import * as fromRoot from '../../../root-store/app.reducers';
import * as configActions from '../../../root-store/config/config.actions';

describe('FooterComponent', () => {

    let fixture: ComponentFixture<FooterComponent>;
    let component: FooterComponent;
    let store: Store<fromRoot.AppState>;

    const config = {
        'showBanner': true,
        'bannerText': 'This is a test',
        'contentOwner': 'bob',
        'pagePublisher': 'bob',
        'lastReviewed': 20170404,
        'lastModified': 20170404,
        'footerTextHtml': '
hi

More stuff!
',
    };

    beforeEach(async(() => {
        TestBed
            .configureTestingModule({
                imports: [
                    StoreModule.forRoot(fromRoot.reducers),
                ],
                declarations: [
                    FooterComponent,
                ],
                schemas: [NO_ERRORS_SCHEMA],
            })
            .compileComponents();
    }));

    beforeEach(() => {
        fixture = TestBed.createComponent(FooterComponent);
        component = fixture.componentInstance;
        store = component['store'];
        store.dispatch(new configActions.LoadRunConfig(config));
        fixture.detectChanges();
    });

    it('should create', () => {
        expect(component).toBeTruthy();
    });

});


text:
This install method is end of life and has been removed from the codebase. The documentation below is only here for future reference and may be removed at any point in time.

## Documentation on setup.bash

The bash script setup.bash was created to automate installation of Defect Dojo and allow for the following install situations to be automated:

### Supported Installs

* Single Server - simplest DefectDojo install where DefectDojo, Dojo dependencies and 3rd party services are installed on a single server. [default install]
* Dev Install - install for local development where a Single Server install is run with credentials and other passwords set to known values.
* Stand-alone Server - install DefectDojo & Dojo dependencies only where 3rd party services (database) is running on other infrastructure.
* ? Docker Single Server - a Single Server install where DefectDojo, Dojo dependencies and 3rd party services are installed in a single container
* ? Docker Stand-alone - a Stand-alone Server install DefectDojo & Dojo dependencies only are installed in a single container.

Note: Cloning the DefectDojo repo and running ./setup.bash does a single server interactive install.  Doing other install methods requires setting configuration values and/or using command-line options.

### TDB install situations

* Docker Dev Install - a dev install that uses docker + a mounted local directory structure to isolate dojo code from the rest of the run-time.
* Fronted Dojo Installs - a install of DefectDojo where a separate HTTP server answers the initial requests for DefectDojo such as using Nginx upstream of DefectDojo

### Assumptions

All installs make these assumption:

* DefectDojo will be run in a virtualenv
* All installs support an interactive and non-interactive install methods
* All installation configuration lives in ./dojo/settings/template-env
* * Running setup.bash without editing template-env assumes a single-server install.
* * Running setup.bash without editing template-env non-interactively assumes a single-server install with MySQL
* Any install configuration variable can be overridden by setting an environmental variable
* One of the following Operating Systems is used as the base for the install
* * Ubuntu Linux - officially supported versions: 16.04 LTS, 18.04 LTS
* * CentOS - officially supported versions: ?
* * Mac OS X - officially supported versions: ?

### Definitions

* DefectDojo - the source code and supporting files for DefectDojo contained in the Github repo at https://github.com/DefectDojo/django-DefectDojo
* Dojo dependencies - any additional software, libraries or services needed to install and run the software in the DefectDojo repo.  This includes Django and other pip packages, celery workers, and any binaries required to run DefectDojo
* 3rd party services - additional services not maintained by DefectDojo but needed to run DefectDojo - currently a database

### Command-line options

```
 ./setup.bash --help
Usage: ./setup.bash [OPTION]...

Install DefectDojo in an interactive (default) or non-interactive method

Options:
  -h or --help             Display this help message and exit with a status code of 0
  -n or --non-interactive  Run install non-interactivity e.g. for Dockerfiles or automation

Note: No options are required, all are optional
```

### Installer details

setup.bash relies on the following files and directory structure:

```
setup.bash => the main install program
├── scripts
    ├── common
        ├── config-vars.sh
        ├── cmd-args.sh
        ├── prompt.sh
```

Install configuration is in [config-vars.sh](scripts/common/config-vars.sh) contains the following install options and default values:

**Format for this list:** *install option* [default value] - *definition*

* PROMPT [true] - Run the install in interactive mode aka prompt the user for config values
* DB_TYPE [MySQL] - The database type to be used by DefectDojo
* DB_LOCAL [true] - Boolean for if the database is installed locally aka on the same OS as DefectDojo
* DB_EXISTS [false] - Boolean for if the database already exists for DefectDojo to use aka doesn't need to be installed
* DB_NAME [dojodb] - Name of the database created to store DefectDojo data
* DB_USER [dojodbusr] - Database username used to access the DefectDojo database
* DB_PASS [vee0Thoanae1daePooz0ieka] - Default password used only for Dev installs, otherwise a random 24 character password is created at install time
* DB_HOST [localhost] - Database hostname where the DefectDojo database is located
* DB_PORT [3306] - Port database is listening on, default port is for the default database MySQL
* DB_DROP_EXISTING [true] - If the database name already exists in database server for DefectDojo, drop that database if this is true.  If false and a database name match occurs, throw an error and exit the installer.
* OS_USER=${OS_USER:-"dojo-srv"}
* OS_PASS=${OS_PASS:-"wahlieboojoKa8aitheibai3"}
* OS_GROUP=${OS_GROUP:-"dojo-srv"}
* INSTALL_ROOT=${INSTALL_ROOT:-"/opt/dojo"}
* DOJO_SOURCE=${DOJO_SOURCE:-"$INSTALL_ROOT/django-DefectDojo"}
* DOJO_FILES=${DOJO_FILES:-"$INSTALL_ROOT/local"}
* MEDIA_ROOT=${MEDIA_ROOT:-"$DOJO_FILES/media"}
* STATIC_ROOT=${STATIC_ROOT:-"$DOJO_FILES/static"}
* ADMIN_USER=${ADMIN_USER:-"admin"}
* ADMIN_PASS=${ADMIN_PASS:-"admin"}
* ADMIN_EMAIL=${ADMIN_EMAIL:-"ed@example.com"}

Configuration items for setup.py are in template-env in ./dojo/settings/ and contain

### Installers workflow

1. Check for command-line arguments, if none, do an interactive single server install
2. Check for install OS
3. Bootstrap any software needed by the install process
4. Install Dojo dependencies
5. Install 3rd party services

### Installer Bash variables

* SETUP_BASE : The full path to where the setup.bash file is located e.g ./setup if starting from the Dojo repository root
* REPO_BASE : The full path to where the DefectDojo source was cloned usually /opt/dojo/django-DefectDojo
* LIB_PATH : The full path to where the configuration values and libraries are for the DefectDojo installer which is SETUP_BASE + /scripts/common/
* DB_TYPPE : The database type DefectDojo will use - currently either SQLite, MySQL or PostgreSQL


text:
package com.umarbhutta.xlightcompanion.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.umarbhutta.xlightcompanion.R;
import com.umarbhutta.xlightcompanion.Tools.Logger;
import com.umarbhutta.xlightcompanion.control.bean.NewRuleInfo;
import com.umarbhutta.xlightcompanion.control.bean.NewRuleItemInfo;

/**
 * Created by luomengxin on 2017/4/23.
 */

public class NewRuleAdapter extends BaseAdapter {
    private Context context;
    private final LayoutInflater inflater;
    private NewRuleInfo mNewRuleInfo;
    /**
     * `
     * 0既没有执行条件,也没有执行结果,
     * 1有执行条件,没有执行结果
     * 2没有执行条件,有执行结果
     * 3有执行条件,也有执行结果
     */
    private int type;

    public NewRuleAdapter(Context context, NewRuleInfo mNewRuleInfo) {
        this.context = context;
        this.mNewRuleInfo = mNewRuleInfo;
        inflater = LayoutInflater.from(context);
    }

    @Override
    public int getCount() {
        int conditionSize = mNewRuleInfo.mNewRuleConditionInfoList.size();  //条件size
        int resultSize = mNewRuleInfo.mNewRuleResultInfoList.size();    //结果size

        if (resultSize > 0 && conditionSize > 0) {  //有执行条件,也有执行结果
            type = 3;
            return conditionSize + resultSize;
        } else if (conditionSize > 0 && resultSize <= 0) {  //有执行条件,没有执行结果
            type = 1;
            return conditionSize + 1;
        } else if (conditionSize <= 0 && resultSize > 0) {   //有执行结果,没有执行条件
            type = 2;
            return resultSize + 1;
        } else {//既没有执行条件,又没有执行结果
            type = 0;
            return 2;
        }
    }

    @Override
    public Object getItem(int position) {
        return position;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {
        ViewHolder holder = null;
        if (null == convertView) {
            holder = new ViewHolder();
            convertView = inflater.inflate(R.layout.layout_new_rule_item, null);

            holder.titleLayout = (LinearLayout) convertView.findViewById(R.id.titleLayout);
            holder.itemLayout = (RelativeLayout) convertView.findViewById(R.id.itemLayout);
            holder.condidtion_tv = (TextView) convertView.findViewById(R.id.condidtion_tv);
            holder.ib_add_term = (ImageView) convertView.findViewById(R.id.ib_add_term);
            holder.no_condidtion = (TextView) convertView.findViewById(R.id.no_condidtion);
            holder.item_left_tv = (TextView) convertView.findViewById(R.id.item_left_tv);
            holder.ib_minus = (ImageButton) convertView.findViewById(R.id.ib_minus);
            holder.topLine = convertView.findViewById(R.id.topLine);
            holder.bottomLine = convertView.findViewById(R.id.bottomLine);

            convertView.setTag(holder);

        } else {
            holder = (ViewHolder) convertView.getTag();
        }

        if (position == getCount() - 1) {
            holder.bottomLine.setVisibility(View.VISIBLE);
        } else {
            holder.bottomLine.setVisibility(View.GONE);
        }

        NewRuleItemInfo mNewRuleItemInfo = null;
        if (type == 1) {

            if (position == 0) {
                holder.titleLayout.setVisibility(View.VISIBLE);
                holder.itemLayout.setVisibility(View.VISIBLE);
                holder.no_condidtion.setVisibility(View.GONE);
                holder.condidtion_tv.setText(R.string.manzu_tiaojian);
                mNewRuleItemInfo = mNewRuleInfo.mNewRuleConditionInfoList.get(0);
                holder.item_left_tv.setText(mNewRuleItemInfo.getShowText());
                holder.topLine.setVisibility(View.GONE);

            } else if (position == mNewRuleInfo.mNewRuleConditionInfoList.size()) {
                holder.titleLayout.setVisibility(View.VISIBLE);
                holder.itemLayout.setVisibility(View.GONE);
                holder.no_condidtion.setVisibility(View.VISIBLE);
                holder.condidtion_tv.setText(R.string.jiang_zhixing_jieguo);
                holder.no_condidtion.setText(R.string.wei_tianjia_jieguo);
                holder.topLine.setVisibility(View.VISIBLE);
            } else {

                holder.titleLayout.setVisibility(View.GONE);
                holder.itemLayout.setVisibility(View.VISIBLE);
                holder.no_condidtion.setVisibility(View.GONE);
                holder.condidtion_tv.setText(R.string.jiang_zhixing_jieguo);
                holder.no_condidtion.setText(R.string.wei_tianjia_jieguo);
                holder.topLine.setVisibility(View.GONE);

                mNewRuleItemInfo = mNewRuleInfo.mNewRuleConditionInfoList.get(position);
                holder.item_left_tv.setText(mNewRuleItemInfo.getShowText());
            }

        } else if (type == 2) {

            if (position == 0) {
                holder.titleLayout.setVisibility(View.VISIBLE);
                holder.itemLayout.setVisibility(View.GONE);
                holder.no_condidtion.setVisibility(View.VISIBLE);
                holder.condidtion_tv.setText(R.string.manzu_tiaojian);
                holder.no_condidtion.setText(R.string.wei_tianjia_tiaojian);
                holder.topLine.setVisibility(View.GONE);
            } else if (position == 1) {
                holder.titleLayout.setVisibility(View.VISIBLE);
                holder.itemLayout.setVisibility(View.VISIBLE);
                holder.no_condidtion.setVisibility(View.GONE);
                holder.condidtion_tv.setText(R.string.jiang_zhixing_jieguo);

                mNewRuleItemInfo = mNewRuleInfo.mNewRuleResultInfoList.get(0);

                holder.item_left_tv.setText(mNewRuleItemInfo.getShowText());
                holder.topLine.setVisibility(View.VISIBLE);
            } else {
                holder.titleLayout.setVisibility(View.GONE);
                holder.itemLayout.setVisibility(View.VISIBLE);
                holder.no_condidtion.setVisibility(View.GONE);

                mNewRuleItemInfo = mNewRuleInfo.mNewRuleResultInfoList.get(position - 1);

                holder.item_left_tv.setText(mNewRuleItemInfo.getShowText());
                holder.topLine.setVisibility(View.GONE);

            }

        } else if (type == 3) {

            holder.no_condidtion.setVisibility(View.GONE);
            holder.itemLayout.setVisibility(View.VISIBLE);
            if (position == 0) {
                holder.titleLayout.setVisibility(View.VISIBLE);
                holder.condidtion_tv.setText(R.string.manzu_tiaojian);
                holder.topLine.setVisibility(View.GONE);
            } else if (position == mNewRuleInfo.mNewRuleConditionInfoList.size()) {
                holder.titleLayout.setVisibility(View.VISIBLE);
                holder.condidtion_tv.setText(R.string.jiang_zhixing_jieguo);
                holder.topLine.setVisibility(View.VISIBLE);
            } else {
                holder.titleLayout.setVisibility(View.GONE);
                holder.topLine.setVisibility(View.GONE);
            }

            if (position < mNewRuleInfo.mNewRuleConditionInfoList.size()) {
                mNewRuleItemInfo = mNewRuleInfo.mNewRuleConditionInfoList.get(position);
            } else {
                mNewRuleItemInfo = mNewRuleInfo.mNewRuleResultInfoList.get(position - mNewRuleInfo.mNewRuleConditionInfoList.size());
            }

            holder.item_left_tv.setText(mNewRuleItemInfo.getShowText());

        } else {  //type == 0  执行条件和执行结果都为空
            holder.titleLayout.setVisibility(View.VISIBLE);
            holder.itemLayout.setVisibility(View.GONE);
            holder.no_condidtion.setVisibility(View.VISIBLE);
            if (position == 0) {
                holder.condidtion_tv.setText(R.string.manzu_tiaojian);
                holder.no_condidtion.setText(R.string.wei_tianjia_tiaojian);
                holder.topLine.setVisibility(View.GONE);
            } else {
                holder.condidtion_tv.setText(R.string.jiang_zhixing_jieguo);
                holder.no_condidtion.setText(R.string.wei_tianjia_jieguo);
                holder.topLine.setVisibility(View.VISIBLE);
            }
        }

        holder.ib_add_term.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (null != mOnClickAddIconListener) {
                    if (position == 0) {
                        mOnClickAddIconListener.clickAddCondition();
                    } else {
                        mOnClickAddIconListener.clickAddResult();
                    }
                }
            }
        });

        holder.ib_minus.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (null != mOnClickAddIconListener) {

                    Logger.i("index", "position = " + position + ", size = " + mNewRuleInfo.mNewRuleConditionInfoList.size());

                    if (mNewRuleInfo.mNewRuleConditionInfoList.size() <= 0) {
                        mOnClickAddIconListener.clickDeleteIcon(false, position - mNewRuleInfo.mNewRuleConditionInfoList.size() - 1);
                        return;
                    }

                    if (position < mNewRuleInfo.mNewRuleConditionInfoList.size()) {
                        mOnClickAddIconListener.clickDeleteIcon(true, position);
                    } else {
                        mOnClickAddIconListener.clickDeleteIcon(false, position - mNewRuleInfo.mNewRuleConditionInfoList.size());
                    }
                }
            }
        });

        return convertView;
    }

    class ViewHolder {

        public View topLine;
        public View bottomLine;

        //title
        public LinearLayout titleLayout;
        //item
        public RelativeLayout itemLayout;

        //title满足条件时或者将执行结果
        public TextView condidtion_tv;

        //添加按钮
        public ImageView ib_add_term;

        //未添加条件或者未添加结果
        public TextView no_condidtion;

        //左侧的条件或者执行结果
        public TextView item_left_tv;
        //右侧的减号
        public ImageButton ib_minus;
    }

    public OnClickAddIconListener mOnClickAddIconListener;

    public void setOnClickAddIconListener(OnClickAddIconListener mOnClickAddIconListener) {
        this.mOnClickAddIconListener = mOnClickAddIconListener;
    }

    public interface OnClickAddIconListener {
        void clickAddCondition();

        void clickAddResult();

        /**
         * @param isCondition true为条件,false为结果
         * @param position
         */
        void clickDeleteIcon(boolean isCondition, int position);
    }

}


text: Project Sunshine from the Udacity Android Nanodegree.


text:
#ifndef UTILS_GPTREENODE_H
#define UTILS_GPTREENODE_H
#include <string>
#include <map>
#include <vector>
#include "lowlevelAPI/GPRefCount.h"
class GPTreeNode:public GPRefCount
{
public:
    GPTreeNode(const std::string& name);
    GPTreeNode(const std::string& name, const std::string& attr);
    virtual ~GPTreeNode();
    void addChild(GPPtr<GPTreeNode> n);
    void addChild(const std::string& name);
    void addChild(const std::string& name, const std::string& attr);
    std::string attr() const;
    inline const std::vector<GPPtr<GPTreeNode> >& getChildren() const {return mChildren;}
    inline const std::string& name() const {return mName;}
private:
    std::string mName;
    std::vector<GPPtr<GPTreeNode> > mChildren;
};
#endif


text:
package softuni.services.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import softuni.entities.Accessory;
import softuni.entities.Photographer;
import softuni.repositories.AccessoryRepository;
import softuni.repositories.PhotographerRepository;
import softuni.services.api.AccessoryService;

import java.util.List;
import java.util.Random;

@Service
@Transactional
public class AccessoryServiceImpl implements AccessoryService{
    private final AccessoryRepository accessoryRepository;
    private final PhotographerRepository photographerRepository;

    @Autowired
    public AccessoryServiceImpl(AccessoryRepository accessoryRepository, PhotographerRepository photographerRepository) {
        this.accessoryRepository = accessoryRepository;
        this.photographerRepository = photographerRepository;
    }

    @Override
    public void addAccessory(Accessory accessory) {
        List<Photographer> photographers = this.photographerRepository.findAll();
        Random random = new Random();
        accessory.setOwner(photographers.get(random.nextInt(photographers.size())));
        this.accessoryRepository.saveAndFlush(accessory);
    }
}


text:
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;

namespace $rootnamespace$
{
    public class $safeitemrootname$ : Window
    {
        public $safeitemrootname$()
        {
            this.InitializeComponent();
#if DEBUG
            this.AttachDevTools();
#endif
        }

        private void InitializeComponent()
        {
            AvaloniaXamlLoader.Load(this);
        }
    }
}