text:
package async;

import javax.xml.stream.XMLStreamConstants;

import com.fasterxml.aalto.AsyncByteArrayFeeder;
import com.fasterxml.aalto.AsyncByteBufferFeeder;
import com.fasterxml.aalto.AsyncXMLInputFactory;
import com.fasterxml.aalto.AsyncXMLStreamReader;
import com.fasterxml.aalto.stax.InputFactoryImpl;

public class TestCharactersParsing extends AsyncTestBase
{
    public void testLinefeeds() throws Exception
    {
        // let's try with different chunking, addition (or not) of space
        for (int spaces = 0; spaces < 3; ++spaces) {
            _testLinefeeds(1, true, spaces(spaces));
            _testLinefeeds(2, true, spaces(spaces));
            _testLinefeeds(3, true, spaces(spaces));
            _testLinefeeds(5, true, spaces(spaces));
            _testLinefeeds(8, true, spaces(spaces));
            _testLinefeeds(99, true, spaces(spaces));
        }
    }

    public void testSkipLinefeeds() throws Exception
    {
        // let's try with different chunking, addition (or not) of space
        for (int spaces = 0; spaces < 3; ++spaces) {
            _testLinefeeds(1, false, spaces(spaces));
            _testLinefeeds(2, false, spaces(spaces));
            _testLinefeeds(3, false, spaces(spaces));
            _testLinefeeds(5, false, spaces(spaces));
            _testLinefeeds(8, false, spaces(spaces));
            _testLinefeeds(99, false, spaces(spaces));
        }
    }

    public void testTextWithEntities() throws Exception
    {
        // let's try with different chunking, addition (or not) of space
        for (int spaces = 0; spaces < 3; ++spaces) {
            _testTextWithEntities(1, true, spaces(spaces));
            _testTextWithEntities(2, true, spaces(spaces));
            _testTextWithEntities(3, true, spaces(spaces));
            _testTextWithEntities(5, true, spaces(spaces));
            _testTextWithEntities(11, true, spaces(spaces));
            _testTextWithEntities(999, true, spaces(spaces));
        }
    }

    public void testSkipTextWithEntities() throws Exception
    {
        // let's try with different chunking, addition (or not) of space
        for (int spaces = 0; spaces < 3; ++spaces) {
            _testTextWithEntities(1, false, spaces(spaces));
            _testTextWithEntities(2, false, spaces(spaces));
            _testTextWithEntities(3, false, spaces(spaces));
            _testTextWithEntities(5, false, spaces(spaces));
            _testTextWithEntities(11, false, spaces(spaces));
            _testTextWithEntities(999, false, spaces(spaces));
        }
    }

    public void testTextWithNumericEntities() throws Exception
    {
        // let's try with different chunking, addition (or not) of space
        for (int spaces = 0; spaces < 3; ++spaces) {
            _testTextWithNumericEntities(1, true, spaces(spaces));
            _testTextWithNumericEntities(2, true, spaces(spaces));
            _testTextWithNumericEntities(3, true, spaces(spaces));
            _testTextWithNumericEntities(5, true, spaces(spaces));
            _testTextWithNumericEntities(9, true, spaces(spaces));
            _testTextWithNumericEntities(99, true, spaces(spaces));
        }
    }

    public void testSkipTextWithNumericEntities() throws Exception
    {
        // let's try with different chunking, addition (or not) of space
        for (int spaces = 0; spaces < 3; ++spaces) {
            _testTextWithNumericEntities(1, false, spaces(spaces));
            _testTextWithNumericEntities(2, false, spaces(spaces));
            _testTextWithNumericEntities(3, false, spaces(spaces));
            _testTextWithNumericEntities(5, false, spaces(spaces));
            _testTextWithNumericEntities(9, false, spaces(spaces));
            _testTextWithNumericEntities(99, false, spaces(spaces));
        }
    }

    /*
    /**********************************************************************
    /* Secondary test methods
    /**********************************************************************
     */

    private void _testLinefeeds(final int chunkSize, final boolean checkValues, final String SPC) throws Exception
    {
        final String XML = SPC + "<root>\rFirst\r\nSecond\nThird: " + UNICODE_SEGMENT + "</root>";

        final AsyncXMLInputFactory f = new InputFactoryImpl();

        //test for byte array
        AsyncXMLStreamReader<AsyncByteArrayFeeder> sr_array = f.createAsyncForByteArray();
        final AsyncReaderWrapperForByteArray reader_array = new AsyncReaderWrapperForByteArray(sr_array, chunkSize, XML);
        _testLinefeeds(sr_array, reader_array, checkValues);
        sr_array.close();

        //test for byte buffer
        AsyncXMLStreamReader<AsyncByteBufferFeeder> sr_buffer = f.createAsyncForByteBuffer();
        final AsyncReaderWrapperForByteBuffer reader_buffer = new AsyncReaderWrapperForByteBuffer(sr_buffer, chunkSize, XML);
        _testLinefeeds(sr_buffer, reader_buffer, checkValues);
        sr_buffer.close();
    }

    private void _testLinefeeds(final AsyncXMLStreamReader<?> sr, final AsyncReaderWrapper reader,
            final boolean checkValues) throws Exception
    {
        assertTokenType(START_ELEMENT, verifyStart(reader));
        if (checkValues) {
            assertEquals("root", sr.getLocalName());
            assertEquals("", sr.getNamespaceURI());
        }

        assertTokenType(CHARACTERS, reader.nextToken());
        if (checkValues) {
            String str = collectAsyncText(reader, CHARACTERS); // moves to end-element
            assertEquals("\nFirst\nSecond\nThird: "+UNICODE_SEGMENT, str);
        } else {
            reader.nextToken();
        }

        assertTokenType(END_ELEMENT, reader.currentToken());
        if (checkValues) {
            assertEquals("root", sr.getLocalName());
            assertEquals("", sr.getNamespaceURI());
        }
        assertTokenType(XMLStreamConstants.END_DOCUMENT, reader.nextToken());
        assertFalse(sr.hasNext());
    }

    private void _testTextWithEntities(final int chunkSize, final boolean checkValues, final String SPC) throws Exception
    {
        _testTextWithEntities(chunkSize, checkValues, SPC, "&lt", "<");
        _testTextWithEntities(chunkSize, checkValues, SPC, "&gt", ">");
        _testTextWithEntities(chunkSize, checkValues, SPC, "&apos", "'");
        // for [aalto-xml#78]
        _testTextWithEntities(chunkSize, checkValues, SPC, "&quot", "\"");
    }

    private void _testTextWithEntities(final int chunkSize, final boolean checkValues, final String SPC,
            final String entity, final String entityExpanded) throws Exception
    {
        final String XML = SPC + "<root>a"+entity+";b\rMOT</root>";

        final AsyncXMLInputFactory f = new InputFactoryImpl();

        //test for byte array
        AsyncXMLStreamReader<AsyncByteArrayFeeder> sr_array = null;
        try {
            sr_array = f.createAsyncForByteArray();
            final AsyncReaderWrapperForByteArray reader_array = new AsyncReaderWrapperForByteArray(sr_array, chunkSize, XML);
            _testTextWithEntities(sr_array, reader_array, checkValues, entityExpanded);
        } finally {
            if (sr_array != null) {
                sr_array.close();
            }
        }

        //test for byte buffer
        AsyncXMLStreamReader<AsyncByteBufferFeeder> sr_buffer = null;
        try {
            sr_buffer = f.createAsyncForByteBuffer();
            final AsyncReaderWrapperForByteBuffer reader_buffer = new AsyncReaderWrapperForByteBuffer(sr_buffer, chunkSize, XML);
            _testTextWithEntities(sr_buffer, reader_buffer, checkValues, entityExpanded);
        } finally {
            if (sr_buffer != null) {
                sr_buffer.close();
            }
        }
    }

    private void _testTextWithEntities(final AsyncXMLStreamReader<?> sr, final AsyncReaderWrapper reader,
            final boolean checkValues,
            final String entityExpanded) throws Exception
    {
        // should start with START_DOCUMENT, but for now skip
        int t = verifyStart(reader);
        assertTokenType(START_ELEMENT, t);
        if (checkValues) {
            assertEquals("root", sr.getLocalName());
            assertEquals("", sr.getNamespaceURI());
        }
        assertTokenType(CHARACTERS, reader.nextToken());
        if (checkValues) {
            String str = collectAsyncText(reader, CHARACTERS); // moves to end-element
            assertEquals("a"+entityExpanded+"b\nMOT", str);
        } else {
            reader.nextToken();
        }
        assertTokenType(END_ELEMENT, reader.currentToken());
        if (checkValues) {
            assertEquals("root", sr.getLocalName());
            assertEquals("", sr.getNamespaceURI());
        }
        assertTokenType(XMLStreamConstants.END_DOCUMENT, reader.nextToken());
        assertFalse(sr.hasNext());
    }

    private void _testTextWithNumericEntities(final int chunkSize, final boolean checkValues, final String SPC) throws Exception
    {
        final String XML = SPC + "<root><tag>!</root>";

        final AsyncXMLInputFactory f = new InputFactoryImpl();

        //test for byte array
        AsyncXMLStreamReader<AsyncByteArrayFeeder> sr_array = null;
        try {
            sr_array = f.createAsyncForByteArray();
            final AsyncReaderWrapperForByteArray reader_array = new AsyncReaderWrapperForByteArray(sr_array, chunkSize, XML);
            _testTextWithNumericEntities(sr_array, reader_array, checkValues);
        } finally {
            if (sr_array != null) {
                sr_array.close();
            }
        }

        //test for byte buffer
        AsyncXMLStreamReader<AsyncByteBufferFeeder> sr_buffer = null;
        try {
            sr_buffer = f.createAsyncForByteBuffer();
            final AsyncReaderWrapperForByteBuffer reader_buffer = new AsyncReaderWrapperForByteBuffer(sr_buffer, chunkSize, XML);
            _testTextWithNumericEntities(sr_buffer, reader_buffer, checkValues);
        } finally {
            if (sr_buffer != null) {
                sr_buffer.close();
            }
        }
    }

    private void _testTextWithNumericEntities(final AsyncXMLStreamReader<?> sr, final AsyncReaderWrapper reader, final boolean checkValues) throws Exception
    {
        // should start with START_DOCUMENT, but for now skip
        int t = verifyStart(reader);
        assertTokenType(START_ELEMENT, t);
        if (checkValues) {
            assertEquals("root", sr.getLocalName());
            assertEquals("", sr.getNamespaceURI());
        }
        assertTokenType(CHARACTERS, reader.nextToken());
        if (checkValues) {
            String str = collectAsyncText(reader, CHARACTERS); // moves to end-element
            assertEquals("<tag>!", str);
        } else {
            reader.nextToken();
        }
        assertTokenType(END_ELEMENT, reader.currentToken());
        if (checkValues) {
            assertEquals("root", sr.getLocalName());
            assertEquals("", sr.getNamespaceURI());
        }
        assertTokenType(XMLStreamConstants.END_DOCUMENT, reader.nextToken());
        assertFalse(sr.hasNext());
    }
}


text:
<!DOCTYPE html>

    <title>Tag</title>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="keywords" content="Tag,   MR.ROBOT" />
    <meta name="description" content="Tag,   Developer" />

    <link rel="shortcut icon" type="image/x-icon" media="screen" href="http://127.0.0.1:4000/static/favicon.ico" />
    <link rel="canonical" href="http://127.0.0.1:4000/tags/" />
    <link rel="alternate" type="application/rss+xml" title="MR.ROBOT" href="http://127.0.0.1:4000/feed.xml"  />

    <link rel="stylesheet" type="text/css" href="http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="http://127.0.0.1:4000/static/octicons/octicons.css" />

    <link rel="stylesheet" type="text/css" href="http://127.0.0.1:4000/static/css/style.css" />
    <link rel="stylesheet" type="text/css" href="http://127.0.0.1:4000/static/css/article-list.css" />
    <link rel="stylesheet" type="text/css" href="http://127.0.0.1:4000/static/css/category.css" />
    <link rel="stylesheet" type="text/css" href="http://127.0.0.1:4000/static/css/tagCloud.css" />
    <link rel="stylesheet" type="text/css" href="http://127.0.0.1:4000/static/css/tags.css" />

Rainy  Alley

Tag

                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">

                    </button>
                    MR.ROBOT

Developer

                          Blog

                              Archive

                              Category

                              Tag

Tag

        <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
             Tags

        </button>

                © RainyAlley

redpajama_set_name: RedPajamaGithub


text:
package com.example.mediaplayer;

import android.app.Service;
import android.content.Intent;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.os.Binder;
import android.os.IBinder;

public class MusicService extends Service {
	private static MediaPlayer musicPlayer;
	private final IBinder mBinder = new LocalBinder();
	private MusicService musicService = this;

	public class LocalBinder extends Binder {
		public MusicService getService() {
			// Return this instance of LocalService so clients can call public
			// methods
			return musicService;
		}
	}

	public void loadSong(int songId) {
		if (musicPlayer != null) {
			musicPlayer.reset();
			musicPlayer.release();
		}

		musicPlayer = MediaPlayer.create(musicService, songId);
	}

	public void playSong() {
		if (musicPlayer != null && !musicPlayer.isPlaying()) {
			musicPlayer.start();
		}
	}

	public void togglePlayPause() {
		if (musicPlayer != null && !musicPlayer.isPlaying()) {
			this.playSong();
		} else if (musicPlayer != null && musicPlayer.isPlaying()) {
			this.pauseSong();
		}
	}

	public void stopSong() {
		if (musicPlayer != null) {
			musicPlayer.stop();
		}
	}

	public void pauseSong() {
		if (musicPlayer != null && musicPlayer.isPlaying()) {
			musicPlayer.pause();
		}
	}

	public Boolean isPlaying() {
		return musicPlayer.isPlaying();
	}

	@Override
	public IBinder onBind(Intent intent) {
		return mBinder;
	}

	@Override
	public void onDestroy() {
		super.onDestroy();
		if (musicPlayer != null) {
			musicPlayer.release();
		}
	}
}


text:
<?php

/**
 * Disable single product page actions
 */

// Disable product title
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );

// Single product page
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );

// Disable product excerpt
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );

// Disable product meta information
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );

// No what this is
// remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_sharing', 50 );

// Disable product information tabs
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );

// Disable related products
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );

// Disable product image
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );

/**
 * Create step indication above product
 */

add_action( 'woocommerce_before_main_content', 'sd_custom_product_title');

function sd_custom_product_title() {

	?>

Quality targeted human visitors

<?php the_title(); ?>

Choose a plan and fill in details

User & Billing info

	<?php

}

/**
 * Create Selling points and Payment ways below product
 */

add_action( 'woocommerce_after_main_content', 'sd_orderpage_usps_paymentways');

function sd_orderpage_usps_paymentways() {

	?>

Genuine Human Visitors

Money back Guarantee

Adsense Safe

				<img class="brands__brand__image" src="<?php echo get_site_url(); ?>/wp-content/uploads/2016/01/ideal.png" alt="">

				<img class="brands__brand__image" src="<?php echo get_site_url(); ?>/wp-content/uploads/2016/02/sofort-160x50.png" alt="">

				<img class="brands__brand__image" src="<?php echo get_site_url(); ?>/wp-content/uploads/2016/02/giropay-116x50.png" alt="">

				<img class="brands__brand__image" src="<?php echo get_site_url(); ?>/wp-content/uploads/2016/02/visa-246x50.png" alt="">

	<?php

}

/**
 * Create Frequency, Countries and Niches selection in custom hook sd_after_trafficplans inside woocommerce/single-product/add-to-cart/variable.php
 */

add_action( 'sd_after_trafficplans', function () {

	$countries = get_terms("pa_countries", array(
			'hide_empty'             => false,
	));

	$target = get_terms("pa_niches", array(
			'hide_empty'             => false,
	));

	ob_start(); ?>

Payment period

				<input type="radio" name="properties[frequency]" id="frequency1" value="Monthly" class="frequency__input" <?php print (!empty($_REQUEST['properties']['frequency'])) ? checked( $_REQUEST['properties']['frequency'], "Monthly", false ) : "checked"; ?>>
				Monthly

				<input type="radio" name="properties[frequency]" id="frequency2" value="One-Time" class="frequency__input" <?php print (!empty($_REQUEST['properties']['frequency'])) ? checked( $_REQUEST['properties']['frequency'], "One-Time", false ) : "checked"; ?>>
				One Time

doneCancel anytime you like

doneSave 5% off price

Select up to 5 niches

		<select name="properties[niches][]" class="chosen-select order-step__section__multiple" style="max-width: 100%;" tabindex="4" multiple data-placeholder="Click to select niches">
			<?php foreach ($target as $item): ?>
				<option value="<?php print trim($item->name); ?>" <?php print is_selected( $_REQUEST['properties']['niches'], trim($item->name) ) ?>><?php print $item->name; ?></option>
			<?php endforeach; ?>
		</select>

info_outlineDon't want to target a specific niche? Then don't select any niche.

Select up to 5 countries

		<select name="properties[countries][]" class="chosen-select order-step__section__multiple" style="max-width: 100%;" tabindex="4" multiple data-placeholder="Click to select countries">
			<?php foreach ($countries as $item): ?>
				<option value="<?php print trim($item->name); ?>" <?php print is_selected( $_REQUEST['properties']['countries'], trim($item->name) ) ?>><?php print $item->name; ?></option>
			<?php endforeach; ?>
		</select>

info_outlineWant to target worldwide? Then don't select any country.

	<?php echo ob_get_clean();

});

/**
 * Create Desitnation, Spread over time and Start date selection in custom hook sd_after_first_order_section inside woocommerce/single-product/add-to-cart/variable.php
 */

add_action( 'sd_after_first_order_section', function () {

	$days = get_terms("pa_spread-over-time", array(
			'hide_empty'             => false,
	));

	ob_start();

	?>

2 |Where to send traffic to?

Your Website URL

				<input type="url" name="properties[destination]" placeholder="http://" value="<?php print $_REQUEST['properties']['destination']; ?>" class="order-step__input">

info_outlineA Goo.gl shortning will be applied to your URL. If you don't want this, please state so in 'Order Notes' on next step.

3 |Tweak the time details

Spread visitors over time

				<select data-placeholder="Select days" name="properties[spread]" class="chosen-select" style="width:350px;" tabindex="2">
					<option value=""></option>
					<?php foreach ($days as $item): ?>
						<option value="<?php print trim($item->name); ?>" <?php print is_selected( $_REQUEST['properties']['spread-over-time'], trim($item->name) ) ?>><?php print $item->name; ?></option>
					<?php endforeach; ?>
				</select>

info_outlineChoose between 1-30 days

Start date campaign

				<input type="text" name="properties[date]" autocomplete="off" placeholder="Pick a date" value="<?php print $_REQUEST['properties']['date']; ?>" id="datepicker" class="order-step__input">

info_outlineMonthly campaigns start by default from the first day you ordered

	<?php echo ob_get_clean();

});

/**
 * Change add to cart text
 */

add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text' );    // 2.1 +

function woo_custom_cart_button_text() {

        return __( "I'm ready to Checkout", 'woocommerce' );

}

/**
 * Redirect to checkoutpage
 */

add_filter ('add_to_cart_redirect', 'redirect_to_checkout');

function redirect_to_checkout() {

    return WC()->cart->get_checkout_url();

}

/**
 * Remove 'Product' succesfully added to Cart message
 */

add_filter( 'woocommerce_add_to_cart_message', 'custom_add_to_cart_message' );
add_filter( '_add_to_cart_message', 'custom_add_to_cart_message' );
function custom_add_to_cart_message( $message  ){
	return '';
}

// Form fields validation
add_action( 'woocommerce_add_to_cart_validation', function () {
	$custom_fields = $_REQUEST['properties'];
	$errors = false;
	if ( empty( $custom_fields['frequency'] ) ) {
		wc_add_notice( __( 'Please choose a frequency', 'woocommerce' ), 'error' );
		$errors = true;
	}
	// if ( empty( $custom_fields['niches'] ) ) {
	// 	wc_add_notice( __( 'Please select niches', 'woocommerce' ), 'error' );
	// 	$errors = true;
	// }
	// if ( empty( $custom_fields['countries'] ) ) {
	// 	wc_add_notice( __( 'Please select countries', 'woocommerce' ), 'error' );
	// 	$errors = true;
	// }
	if ( empty( $custom_fields['destination'] ) ) {
		wc_add_notice( __( 'Please enter a traffic destination', 'woocommerce' ), 'error' );
		$errors = true;
	}
	if ( empty( $custom_fields['spread'] ) ) {
		wc_add_notice( __( 'Please enter a spead visitors over time', 'woocommerce' ), 'error' );
		$errors = true;
	}
	if ( empty( $custom_fields['date'] ) ) {
		wc_add_notice( __( 'Please set a campaign start date', 'woocommerce' ), 'error' );
		$errors = true;
	}
	if ($errors) {
		return false;
	}
	return true;
}, 10, 3 );

// Store additional custom fields to WC session
add_action( 'woocommerce_add_to_cart', function ( $cart_item_key, $product_id = null, $quantity= null, $variation_id= null, $variation= null ) {
	WC()->session->set( $cart_item_key.'_custom_fields_data', $_REQUEST['properties'] );
}, 1, 5);


text:
package translatableerror

// NotSupportedOnKubernetesArgumentError represents an error caused by using an
// argument that is not supported on kubernetes
type NotSupportedOnKubernetesArgumentError struct {
	Arg string
}

func (NotSupportedOnKubernetesArgumentError) DisplayUsage() {}

func (NotSupportedOnKubernetesArgumentError) Error() string {
	return "The argument {{.Arg}} is not supported on Kubernetes"
}

func (e NotSupportedOnKubernetesArgumentError) Translate(translate func(string, ...interface{}) string) string {
	return translate(e.Error(), map[string]interface{}{
		"Arg": e.Arg,
	})
}


text:
package cn.com.bugmanager.log.service;

import cn.com.bugmanager.log.dao.LogDao;
import cn.com.bugmanager.log.model.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by threegrand2 on 15-1-9.
 */
@Service("logService")
public class LogService {
    @Autowired
    private LogDao logDao;
    public int saveLog(Log log){
       return logDao.save(log);
    }

    public int deleteLog(String logId){
        return logDao.delete(logId);
    }

    public List<Log>   getLogPageList(){
        return logDao.getLogPageList();
    }
}


text:
using System.Runtime.CompilerServices;
using Validation;

namespace LanguageService
{
    public class ParseTreeCache
    {
        private readonly ConditionalWeakTable<SourceText, SyntaxTree> sources =
            new ConditionalWeakTable<SourceText, SyntaxTree>();

        public SyntaxTree Get(SourceText sourceText)
        {
            Requires.NotNull(sourceText, nameof(sourceText));

            SyntaxTree syntaxTree;
            if (this.sources.TryGetValue(sourceText, out syntaxTree))
            {
                return syntaxTree;
            }

            syntaxTree = Parser.Parse(sourceText.TextReader);
            this.sources.Add(sourceText, syntaxTree);

            return syntaxTree;
        }
    }
}


text:
package org.docksidestage.sqlite.dbflute.readonly.exbhv.pmbean;

import org.docksidestage.sqlite.dbflute.readonly.bsbhv.pmbean.RoyBsPurchaseSummaryMemberPmb;

/**
 *
 * The simple parameter-bean of PurchaseSummaryMember.

 *
 *

 * You can implement your original methods here.
 * This class remains when re-generating.
 *

 * @author DBFlute(AutoGenerator)
 */
public class RoyPurchaseSummaryMemberPmb extends RoyBsPurchaseSummaryMemberPmb {
}


text:
<?php

LeftAndMain::require_css(basename(__DIR__) . '/css/custom.css');
LeftAndMain::require_javascript(basename(__DIR__) . '/javascript/customjs.js');


text:
maintainer       "John E. Vincent"
maintainer_email "lusis.org+github.com@gmail.com"
license          "Apache 2.0"
description      "Installs/Configures client to download files from aws using aws-s3"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version          "0.3"

recipe "s3client::default", "Installs all the dependencies to use the s3client"

depends "apt"


text:
layout: page
title: Menu level 3
permalink: /menu-levels/menu-level-3/
group: menu-levels
menu: menu-level-3
---

<p class="lead">
    This is an example for a menu with levels
</p>
{% include edit.html %}


text:
package org.springframework.social.twitter.api;

import java.util.List;
import java.util.Map;

import org.springframework.social.ApiException;
import org.springframework.social.MissingAuthorizationException;
import org.springframework.social.twitter.api.impl.AccountSettingsData;

/**
 * Interface defining the operations for retrieving information about Twitter users.
 * @author Craig Walls
 */
public interface UserOperations {

	/**
	 * Retrieves the authenticated user's Twitter ID.
	 * @return the user's ID at Twitter
	 * @throws ApiException if there is an error while communicating with Twitter.
	 * @throws MissingAuthorizationException if TwitterTemplate was not created with OAuth credentials.
	 */
	long getProfileId();

	/**
	 * Retrieves the authenticated user's Twitter screen name
	 * @return the user's screen name
	 * @throws ApiException if there is an error while communicating with Twitter.
	 * @throws MissingAuthorizationException if TwitterTemplate was not created with OAuth credentials.
	 */
	String getScreenName();

	/**
	 * Retrieves the authenticated user's Twitter profile details.
	 * @return a {@link TwitterProfile} object representing the user's profile.
	 * @throws ApiException if there is an error while communicating with Twitter.
	 * @throws MissingAuthorizationException if TwitterTemplate was not created with OAuth credentials.
	 */
	TwitterProfile getUserProfile();

	/**
	 * Retrieves a specific user's Twitter profile details.
	 * Supports either user or application authorization.
	 * @param screenName the screen name for the user whose details are to be retrieved.
	 * @return a {@link TwitterProfile} object representing the user's profile.
	 * @throws ApiException if there is an error while communicating with Twitter.
	 * @throws MissingAuthorizationException if TwitterTemplate was not created with OAuth credentials or an application access token.
	 */
	TwitterProfile getUserProfile(String screenName);

	/**
	 * Retrieves a specific user's Twitter profile details.
	 * Supports either user or application authorization.
	 * @param userId the user ID for the user whose details are to be retrieved.
	 * @return a {@link TwitterProfile} object representing the user's profile.
	 * @throws ApiException if there is an error while communicating with Twitter.
	 * @throws MissingAuthorizationException if TwitterTemplate was not created with OAuth credentials or an application access token.
	 */
	TwitterProfile getUserProfile(long userId);

	/**
	 * Retrieves a list of Twitter profiles for the given list of user IDs.
	 * Supports either user or application authorization.
	 * @param userIds identifies the ids of users which will be fetch from the authenticating twitter account.
	 * @return a list of Twitter profiles
	 * @throws ApiException if there is an error while communicating with Twitter.
	 * @throws MissingAuthorizationException if TwitterTemplate was not created with OAuth credentials or an application access token.
	 */
	List<TwitterProfile> getUsers(long... userIds);

	/**
	 * Retrieves a list of Twitter profiles for the given list of screen names.
	 * Supports either user or application authorization.
	 * @param screenNames identifies the screen names of users which will be fetch from the authenticating twitter account.
	 * @return a list of Twitter profiles
	 * @throws ApiException if there is an error while communicating with Twitter.
	 * @throws MissingAuthorizationException if TwitterTemplate was not created with OAuth credentials or an application access token.
	 */
	List<TwitterProfile> getUsers(String... screenNames);

	/**
	 * Searches for up to 20 users that match a given query.
	 * @param query defines the query against which users will be retrieved.
	 * @return a list of Twitter profiles
	 * @throws ApiException if there is an error while communicating with Twitter.
	 * @throws MissingAuthorizationException if TwitterTemplate was not created with OAuth credentials.
	 */
	List<TwitterProfile> searchForUsers(String query);

	/**
	 * Searches for users that match a given query.
	 * @param query defines the query against which users will be retrieved.
	 * @param page the page of search results to return
	 * @param pageSize the number of {@link TwitterProfile}s per page. Maximum of 20 per page.
	 * @return a list of Twitter profiles
	 * @throws ApiException if there is an error while communicating with Twitter.
	 * @throws MissingAuthorizationException if TwitterTemplate was not created with OAuth credentials.
	 */
	List<TwitterProfile> searchForUsers(String query, int page, int pageSize);

	/**
	 * Retrieves a list of categories from which suggested users to follow may be found.
	 * Supports either user or application authorization.
	 * @return a list of categories of suggested users
	 * @throws ApiException if there is an error while communicating with Twitter.
	 * @throws MissingAuthorizationException if TwitterTemplate was not created with OAuth credentials or an application access token.
	 */
	List<SuggestionCategory> getSuggestionCategories();

	/**
	 * Retrieves a list of suggestions of users to follow for a given category.
	 * Supports either user or application authorization.
	 * @param slug the category's slug
	 * @return a list of Twitter profiles
	 * @throws ApiException if there is an error while communicating with Twitter.
	 * @throws MissingAuthorizationException if TwitterTemplate was not created with OAuth credentials or an application access token.
	 */
	List<TwitterProfile> getSuggestions(String slug);

	/**
	 * Retrieves the rate limit statuses for each of the resource families passed as arguments
	 * Supports either user or application authorization.
	 * @param resources the list of resource families to inquire about
	 * @return a Map of resource families to rate limit statuses
	 * @throws ApiException if there is an error while communicating with Twitter.
	 * @throws MissingAuthorizationException if TwitterTemplate was not created with OAuth credentials or an application access token.
	 */
	Map<ResourceFamily, List<RateLimitStatus>> getRateLimitStatus(ResourceFamily... resources);

	/**
	 * Retrives the authenticating user's account settings.
	 * @return the authenticating user's account settings.
	 * @throws ApiException if there is an error while communicating with Twitter.
	 * @throws MissingAuthorizationException if TwitterTemplate was not created with OAuth credentials or an application access token.
	 */
	AccountSettings getAccountSettings();

	/**
	 * Updates the authenticating user's account settings.
	 * @param accountSettingsData An AccountSettingsData with the settings to be changed.
	 * @return The updated account settings.
	 */
	AccountSettings updateAccountSettings(AccountSettingsData accountSettingsData);
}


text:
<?php

namespace Etu\Module\TVBundle;

use Etu\Core\CoreBundle\Framework\Definition\Module;

class EtuModuleTVBundle extends Module
{
    /**
     * Module identifier (to be required by other modules).
     *
     * @return string
     */
    public function getIdentifier()
    {
        return 'tv';
    }

    /**
     * Module title (describe shortly its aim).
     *
     * @return string
     */
    public function getTitle()
    {
        return 'TV';
    }

    /**
     * Module author.
     *
     * @return string
     */
    public function getAuthor()
    {
        return 'Aurélien Labate';
    }

    /**
     * Module description.
     *
     * @return string
     */
    public function getDescription()
    {
        return 'Module permettant d\'afficher des informations syncronisées d\'EtuUTT sur les télévisions du foyer et du BDE';
    }

    /**
     * Define the modules requirements (the other required modules) using their identifiers.
     *
     * @return array
     */
    public function getRequirements()
    {
        return [
            // Insert your requirements here
        ];
    }
}


text:
declare namespace Bokeh.Charts {
  interface IChartOpts {
    width?: Int;
    height?: Int;
  }

  interface IPieOpts extends IChartOpts {
    inner_radius?: number;
    outer_radius?: number;
    start_angle?: number;
    end_angle?: number;
    center?: [number, number];
    treshold?: number;
    palette?: Palette | Array<Color>;
    slice_labels?: "labels" | "values" | "percentages";
  }

  function pie(data: {labels: Array<string>, values: Array<number>}, opts?: IPieOpts): Plot;

  interface IBarOpts extends IChartOpts {
    stacked?: boolean;
    orientation?: "horizontal" | "vertical";
    bar_width?: number;
    palette?: Palette | Array<Color>;
    axis_number_format?: string;
  }

  function bar(data: Array<Array<string | number>>, opts?: IBarOpts): Plot;
}


text:
<!DOCTYPE html>
<html>
<head>
    <title>HelloWorld</title>
    <style type="text/css">
        p {
            background: #97b1ff;
        }
    </style>

    <!-- Native Webcomponent -->
    <script src="my-component.js"></script>

    <!-- Native Webcomponent with Shadow DOM -->
    <script src="my-shadow-component.js"></script>

    <!-- Polymer -->
    <script src="../../../webcomponentsjs/webcomponents-lite.js"></script>
    <link rel="import" href="my-polymer-component.html">

</head>
<body>
<my-component test="foo"></my-component>
<my-shadow-component test="baz"></my-shadow-component>
<my-polymer-component test="bat"></my-polymer-component>

<button onclick="javascript: console.log(document.querySelector('my-shadow-component').myProperty);">shadow getter</button>
<button onclick="javascript: document.querySelector('my-shadow-component').myProperty = 'no-polymer';">shadow getter</button>
<br/>
<button onclick="javascript: console.log(document.querySelector('my-polymer-component').myProperty);">polymer getter</button>
<button onclick="javascript: document.querySelector('my-polymer-component').myProperty = 'with-polymer';">polymer getter</button>

</body>
</html>


text:
/*
 *
 */

import java.text.*;
import java.util.*;
import sun.util.locale.provider.*;
import sun.util.resources.*;

public class TimeZoneNameProviderTest extends ProviderTest {

    com.bar.TimeZoneNameProviderImpl tznp = new com.bar.TimeZoneNameProviderImpl();

    public static void main(String[] s) {
        new TimeZoneNameProviderTest();
    }

    TimeZoneNameProviderTest() {
        test1();
        test2();
        test3();
        aliasTest();
    }

    void test1() {
        Locale[] available = Locale.getAvailableLocales();
        List<Locale> jreimplloc = Arrays.asList(LocaleProviderAdapter.forJRE().getTimeZoneNameProvider().getAvailableLocales());
        List<Locale> providerLocales = Arrays.asList(tznp.getAvailableLocales());
        String[] ids = TimeZone.getAvailableIDs();

        for (Locale target: available) {
            // pure JRE implementation
            OpenListResourceBundle rb = ((ResourceBundleBasedAdapter)LocaleProviderAdapter.forJRE()).getLocaleData().getTimeZoneNames(target);
            boolean jreSupportsTarget = jreimplloc.contains(target);

            for (String id: ids) {
                // the time zone
                TimeZone tz = TimeZone.getTimeZone(id);

                // JRE string array for the id
                String[] jrearray = null;
                if (jreSupportsTarget) {
                    try {
                        jrearray = rb.getStringArray(id);
                    } catch (MissingResourceException mre) {}
                }

                for (int i = 1; i <=(tz.useDaylightTime()?4:2); i++) {
                    // the localized name
                    String name = tz.getDisplayName(i>=3, i%2, target);

                    // provider's name (if any)
                    String providersname = null;
                    if (providerLocales.contains(target)) {
                        providersname = tznp.getDisplayName(id, i>=3, i%2, target);
                    }

                    // JRE's name
                    String jresname = null;
                    if (jrearray != null) {
                        jresname = jrearray[i];
                    }

                    checkValidity(target, jresname, providersname, name,
                        jreSupportsTarget && jresname != null);
                }
            }
        }
    }

    final String pattern = "z";
    final Locale OSAKA = new Locale("ja", "JP", "osaka");
    final Locale KYOTO = new Locale("ja", "JP", "kyoto");
    final Locale GENERIC = new Locale("ja", "JP", "generic");

    final String[] TIMEZONES = {
        "GMT", "America/Los_Angeles", "SystemV/PST8",
        "SystemV/PST8PDT", "PST8PDT",
    };
    final String[] DISPLAY_NAMES_OSAKA = {
        tznp.getDisplayName(TIMEZONES[0], false, TimeZone.SHORT, OSAKA),
        tznp.getDisplayName(TIMEZONES[1], false, TimeZone.SHORT, OSAKA),
        tznp.getDisplayName(TIMEZONES[2], false, TimeZone.SHORT, OSAKA),
        tznp.getDisplayName(TIMEZONES[3], false, TimeZone.SHORT, OSAKA),
        tznp.getDisplayName(TIMEZONES[4], false, TimeZone.SHORT, OSAKA)
    };
    final String[] DISPLAY_NAMES_KYOTO = {
        tznp.getDisplayName(TIMEZONES[0], false, TimeZone.SHORT, KYOTO),
        tznp.getDisplayName(TIMEZONES[1], false, TimeZone.SHORT, KYOTO),
        tznp.getDisplayName(TIMEZONES[2], false, TimeZone.SHORT, KYOTO),
        tznp.getDisplayName(TIMEZONES[3], false, TimeZone.SHORT, KYOTO),
        tznp.getDisplayName(TIMEZONES[4], false, TimeZone.SHORT, KYOTO)
    };

    void test2() {
        Locale defaultLocale = Locale.getDefault();
        TimeZone reservedTimeZone = TimeZone.getDefault();
        Date d = new Date(2005-1900, Calendar.DECEMBER, 22);
        String formatted;

        TimeZone tz;
        SimpleDateFormat df;

        try {
            for (int i = 0; i < TIMEZONES.length; i++) {
                tz = TimeZone.getTimeZone(TIMEZONES[i]);
                TimeZone.setDefault(tz);
                df = new SimpleDateFormat(pattern, DateFormatSymbols.getInstance(OSAKA));
                Locale.setDefault(defaultLocale);
                System.out.println(formatted = df.format(d));
                if(!formatted.equals(DISPLAY_NAMES_OSAKA[i])) {
                    throw new RuntimeException("TimeZone " + TIMEZONES[i] +
                        ": formatted zone names mismatch. " +
                        formatted + " should match with " +
                        DISPLAY_NAMES_OSAKA[i]);
                }

                df.parse(DISPLAY_NAMES_OSAKA[i]);

                Locale.setDefault(KYOTO);
                df = new SimpleDateFormat(pattern, DateFormatSymbols.getInstance());
                System.out.println(formatted = df.format(d));
                if(!formatted.equals(DISPLAY_NAMES_KYOTO[i])) {
                    throw new RuntimeException("Timezone " + TIMEZONES[i] +
                        ": formatted zone names mismatch. " +
                        formatted + " should match with " +
                        DISPLAY_NAMES_KYOTO[i]);
                }
                df.parse(DISPLAY_NAMES_KYOTO[i]);
            }
        } catch (ParseException pe) {
            throw new RuntimeException("parse error occured" + pe);
        } finally {
            // restore the reserved locale and time zone
            Locale.setDefault(defaultLocale);
            TimeZone.setDefault(reservedTimeZone);
        }
    }

    void test3() {
        final String[] TZNAMES = {
            LATIME, PST, PST8PDT, US_PACIFIC,
            TOKYOTIME, JST, JAPAN,
        };
        for (String tzname : TZNAMES) {
            TimeZone tz = TimeZone.getTimeZone(tzname);
            for (int style : new int[] { TimeZone.LONG, TimeZone.SHORT }) {
                String osakaStd = tz.getDisplayName(false, style, OSAKA);
                if (osakaStd != null) {
                    // No API for getting generic time zone names
                    String generic = TimeZoneNameUtility.retrieveGenericDisplayName(tzname,
                                                                                style, GENERIC);
                    String expected = "Generic " + osakaStd;
                    if (!expected.equals(generic)) {
                        throw new RuntimeException("Wrong generic name: got=\"" + generic
                                                   + "\", expected=\"" + expected + "\"");
                    }
                }
            }
        }
    }

    final String LATIME = "America/Los_Angeles";
    final String PST = "PST";
    final String PST8PDT = "PST8PDT";
    final String US_PACIFIC = "US/Pacific";
    final String LATIME_IN_OSAKA =
        tznp.getDisplayName(LATIME, false, TimeZone.LONG, OSAKA);

    final String TOKYOTIME = "Asia/Tokyo";
    final String JST = "JST";
    final String JAPAN = "Japan";
    final String JST_IN_OSAKA =
        tznp.getDisplayName(JST, false, TimeZone.LONG, OSAKA);

    void aliasTest() {
        // Check that provider's name for a standard id (America/Los_Angeles) is
        // propagated to its aliases
        String latime = TimeZone.getTimeZone(LATIME).getDisplayName(OSAKA);
        if (!LATIME_IN_OSAKA.equals(latime)) {
            throw new RuntimeException("Could not get provider's localized name.  result: "+latime+" expected: "+LATIME_IN_OSAKA);
        }

        String pst = TimeZone.getTimeZone(PST).getDisplayName(OSAKA);
        if (!LATIME_IN_OSAKA.equals(pst)) {
            throw new RuntimeException("Provider's localized name is not available for an alias ID: "+PST+".  result: "+pst+" expected: "+LATIME_IN_OSAKA);
        }

        String us_pacific = TimeZone.getTimeZone(US_PACIFIC).getDisplayName(OSAKA);
        if (!LATIME_IN_OSAKA.equals(us_pacific)) {
            throw new RuntimeException("Provider's localized name is not available for an alias ID: "+US_PACIFIC+".  result: "+us_pacific+" expected: "+LATIME_IN_OSAKA);
        }

        // Check that provider's name for an alias id (JST) is
        // propagated to its standard id and alias ids.
        String jstime = TimeZone.getTimeZone(JST).getDisplayName(OSAKA);
        if (!JST_IN_OSAKA.equals(jstime)) {
            throw new RuntimeException("Could not get provider's localized name.  result: "+jstime+" expected: "+JST_IN_OSAKA);
        }

        String tokyotime = TimeZone.getTimeZone(TOKYOTIME).getDisplayName(OSAKA);
        if (!JST_IN_OSAKA.equals(tokyotime)) {
            throw new RuntimeException("Provider's localized name is not available for a standard ID: "+TOKYOTIME+".  result: "+tokyotime+" expected: "+JST_IN_OSAKA);
        }

        String japan = TimeZone.getTimeZone(JAPAN).getDisplayName(OSAKA);
        if (!JST_IN_OSAKA.equals(japan)) {
            throw new RuntimeException("Provider's localized name is not available for an alias ID: "+JAPAN+".  result: "+japan+" expected: "+JST_IN_OSAKA);
        }
    }
}


text:
package scsp

//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.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

// DataInQueryHotlineSession is a nested struct in scsp response
type DataInQueryHotlineSession struct {
	PageSize         int                    `json:"PageSize" xml:"PageSize"`
	PageNumber       int                    `json:"PageNumber" xml:"PageNumber"`
	TotalCount       int                    `json:"TotalCount" xml:"TotalCount"`
	CallDetailRecord []CallDetailRecordItem `json:"CallDetailRecord" xml:"CallDetailRecord"`
}


text:
"""Test client that connects and sends infinite data."""

import argparse
import sys

from asyncio import *
from asyncio import test_utils

ARGS = argparse.ArgumentParser(description="TCP data sink example.")
ARGS.add_argument(
    '--tls', action='store_true', dest='tls',
    default=False, help='Use TLS')
ARGS.add_argument(
    '--iocp', action='store_true', dest='iocp',
    default=False, help='Use IOCP event loop (Windows only)')
ARGS.add_argument(
    '--stop', action='store_true', dest='stop',
    default=False, help='Stop the server by sending it b"stop" as data')
ARGS.add_argument(
    '--host', action='store', dest='host',
    default='127.0.0.1', help='Host name')
ARGS.add_argument(
    '--port', action='store', dest='port',
    default=1111, type=int, help='Port number')
ARGS.add_argument(
    '--size', action='store', dest='size',
    default=16*1024, type=int, help='Data size')

args = None

def dprint(*args):
    print('source:', *args, file=sys.stderr)

class Client(Protocol):

    total = 0

    def connection_made(self, tr):
        dprint('connecting to', tr.get_extra_info('peername'))
        dprint('my socket is', tr.get_extra_info('sockname'))
        self.tr = tr
        self.lost = False
        self.loop = get_event_loop()
        self.waiter = Future()
        if args.stop:
            self.tr.write(b'stop')
            self.tr.close()
        else:
            self.data = b'x'*args.size
            self.write_some_data()

    def write_some_data(self):
        if self.lost:
            dprint('lost already')
            return
        data = self.data
        size = len(data)
        self.total += size
        dprint('writing', size, 'bytes; total', self.total)
        self.tr.write(data)
        self.loop.call_soon(self.write_some_data)

    def connection_lost(self, exc):
        dprint('lost connection', repr(exc))
        self.lost = True
        self.waiter.set_result(None)

@coroutine
def start(loop, host, port):
    sslctx = None
    if args.tls:
        sslctx = test_utils.dummy_ssl_context()
    tr, pr = yield from loop.create_connection(Client, host, port,
                                               ssl=sslctx)
    dprint('tr =', tr)
    dprint('pr =', pr)
    yield from pr.waiter

def main():
    global args
    args = ARGS.parse_args()
    if args.iocp:
        from asyncio.windows_events import ProactorEventLoop
        loop = ProactorEventLoop()
        set_event_loop(loop)
    else:
        loop = get_event_loop()
    try:
        loop.run_until_complete(start(loop, args.host, args.port))
    finally:
        loop.close()

if __name__ == '__main__':
    main()


text:
<!DOCTYPE html>

    <title>Atom-Control Sample</title>

    <link href="../../../style/atoms.css" rel="stylesheet" />

<button
    atom-type="AtomButton"
    atom-next="[$scope.theWindow.openCommand]"
    atom-data="{ { label:'Open Window Button' } }"
    >Open Window</button>

        This is inside the window.

        <button
            atom-type="AtomButton"
            atom-next="{$scope.theWindow.closeCommand}"
            >Close</button>


text:
namespace Abp.Runtime.Security
{
    /// <summary>
    /// Used to get ABP-specific claim type names.
    /// </summary>
    public static class AbpClaimTypes
    {
        /// <summary>
        /// TenantId.
        /// </summary>
        public const string TenantId = "http://www.aspnetboilerplate.com/identity/claims/tenantId";
    }
}


text:
package fi.helsinki.cs.tmc.cli.core;

import fi.helsinki.cs.tmc.cli.io.HelpGenerator;
import fi.helsinki.cs.tmc.cli.io.Io;

import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.GnuParser;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public abstract class AbstractCommand {

    private static final Logger logger = LoggerFactory.getLogger(AbstractCommand.class);
    private Command command;

    /**
     * Override this method if you want longer description for the command than
     * the annotation description.
     *
     * @return Description text
     */
    protected String getDescription() {
        return null;
    }

    /**
     * Override this method if you want to give usage description.
     * Dont't add the 'tmc-cli COMMAND' prefix, because it is added
     * automatically to every line.
     *
     * @return Description text
     */
    public String[] getUsages() {
        return null;
    }

    public abstract void getOptions(Options options);

    private Options getOptions() {
        Options options;

        options = new Options();
        options.addOption("h", "help", false, "Get this help message.");
        getOptions(options);

        return options;
    }

    /**
     * Method runs the command.
     *
     * @param args Command line arguments for this command.
     * @param ctx The context object.
     */
    public abstract void run(CliContext ctx, CommandLine args);

    public void execute(CliContext context, String[] stringArgs) {
        CommandLine args = parseArgs(context, stringArgs);
        if (args != null) {
            run(context, args);
        }
    }

    protected CommandLine parseArgs(CliContext context, String[] stringArgs) {
        GnuParser parser = new GnuParser();
        CommandLine args;
        Options options = getOptions();

        Io io = context.getIo();

        try {
            args = parser.parse(options, stringArgs);
        } catch (ParseException e) {
            logger.warn("Invalid command line arguments.", e);
            io.errorln("Invalid command line arguments.");
            io.errorln(e.getMessage());
            return null;
        }

        if (args.hasOption("h")) {
            printHelp(context);
            return null;
        }
        return args;
    }

    protected void printUsage(CliContext context) {
        Io io = context.getIo();
        io.println(getUsageString());
    }

    private Command getCommand() {
        if (this.command == null) {
            Class<Command> klass;
            klass = CommandFactory.castToCommandClass(this.getClass());
            this.command = CommandFactory.getCommand(klass);
        }
        return this.command;
    }

    private void printHelp(CliContext context) {
        Io io = context.getIo();
        Options options = getOptions();

        String usage = getUsageString();
        String desc = getDescription();
        if (desc == null) {
            desc = getCommand().desc();
        }
        HelpGenerator.run(io, usage, desc, options);
    }

    /**
     * TODO print the "Usage:" and "Or:" prefixes to every line.
     * @return The printable usage string.
     */
    private String getUsageString() {
        String prefix = "tmc " + getCommand().name() + " ";
        String[] usages = getUsages();
        if (usages == null) {
            return prefix;
        }

        StringBuilder builder = new StringBuilder();
        boolean first = true;
        for (String line : usages) {
            if (!first) {
                builder.append("\n");
            }
            builder.append(prefix);
            builder.append(line);
            first = false;
        }
        return builder.toString();
    }
}


text:
from argparse import ArgumentParser
from wsgiref.simple_server import make_server

from . import MrPyPi, MemoryIndex, MongoIndex
from .index_util import DEFAULT_PIP_INDEX
from .mongo_index import DEFAULT_MONGO_URI

def main():

    # Command line options
    parser = ArgumentParser(prog='mrpypi')
    parser.add_argument('-p', dest='port', type=int, default=8080,
                        help='server port number (default is 8080)')
    parser.add_argument('--index', dest='index_url', default=DEFAULT_PIP_INDEX, metavar='URL',
                        help='upstream pypi index URL (default is "{0}")'.format(DEFAULT_PIP_INDEX))
    parser.add_argument('--no-index', dest='index_url', action='store_const', const=None,
                        help='disable upstream pypi index')
    parser.add_argument('--mongo', dest='mongo', action='store_true',
                        help='use MongoDB index')
    parser.add_argument('--mongo-uri', dest='mongo_uri', type=str, default=DEFAULT_MONGO_URI, metavar='URI',
                        help='MongoDB URI (default is "{0}")'.format(DEFAULT_MONGO_URI))
    args = parser.parse_args()

    # Create the index
    print('Upstream pypi index URL: {0}'.format(args.index_url))
    if args.mongo:
        print('Mongo index with URI: {0}'.format(args.mongo_uri))
        index = MongoIndex(index_url=args.index_url, mongo_uri=args.mongo_uri)
    else:
        print('Using memory index')
        index = MemoryIndex(index_url=args.index_url)

    # Start the application
    application = MrPyPi(index)
    print('Serving on port {0}...'.format(args.port))
    make_server('', args.port, application).serve_forever()

if __name__ == '__main__':
    main()


text:
package com.michaelfotiadis.crossyscore.data.loader;

import android.app.Activity;

import com.michaelfotiadis.crossyscore.common.models.score.Score;
import com.michaelfotiadis.crossyscore.core.CrossyCore;
import com.michaelfotiadis.crossyscore.data.error.UiDataLoadError;
import com.michaelfotiadis.crossyscore.utils.AppLog;

import java.util.List;

/**
 *
 */
public class ScoreLoader extends DataFeedLoaderAbstract<Score> {

    public ScoreLoader(final Activity activity) {
        super(activity);
    }

    @Override
    public void loadData() {

        final List<Score> scores = CrossyCore.getDataProvider().getScores().getAll();

        if (scores == null) {
            notifyError(new UiDataLoadError("Null scores found", UiDataLoadError.ErrorKind.NO_DATA, false));
        } else {
            AppLog.d("Loaded " + scores.size() + " scores");
            notifySuccess(scores);
        }

    }
}


text:
package com.fsck.k9.mailstore;

import java.util.HashMap;

import com.fsck.k9.mail.Part;

public class MessageCryptoAnnotations {
    private HashMap<Part, CryptoResultAnnotation> annotations = new HashMap<>();

    public void put(Part part, CryptoResultAnnotation annotation) {
        annotations.put(part, annotation);
    }

    public CryptoResultAnnotation get(Part part) {
        return annotations.get(part);
    }

    public boolean has(Part part) {
        return annotations.containsKey(part);
    }

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

    public Part findKeyForAnnotationWithReplacementPart(Part part) {
        for (HashMap.Entry<Part, CryptoResultAnnotation> entry : annotations.entrySet()) {
            if (part == entry.getValue().getReplacementData()) {
                return entry.getKey();
            }
        }
        return null;
    }
}


text:
Vue.component('b', {
    className: 'b box',
    template: '<div>{{msg + " I am component B"}}</div>'
})


text:
module Dota
  module API
    class Cosmetic
      class Rarity
        include Utilities::Inspectable

        attr_reader :raw

        def initialize(raw)
          @raw = raw
        end

        def id
          raw["id"]
        end

        def order
          raw["order"]
        end

        def color
          raw["color"]
        end

        def name
          raw["localized_name"]
        end
      end
    end
  end
end


text: require 'models/feature_extensions'


text:
test -f /root/.provisioned && exit 0

# Distribution-specific package considerations
if [ -f /etc/redhat-release ]; then
  yum makecache fast > /dev/null
  gem install --no-rdoc --no-ri hiera-eyaml > /dev/null
  sed -i '/Defaults    requiretty/d' /etc/sudoers
else
  apt-get update &> /dev/null
  for i in git ruby-json ruby-dev; do
    dpkg -s ${i} &> /dev/null || apt-get -y install ${i} > /dev/null
  done
  for i in librarian-puppet hiera-eyaml; do
    gem query --name ${i} --installed &> /dev/null || gem install --no-rdoc --no-ri ${i} > /dev/null
  done
fi

# VMware Fusion hack
if [ -d /etc/vmware-tools ]; then
  echo "answer AUTO_KMODS_ENABLED yes" >> /etc/vmware-tools/locations
fi

# 260-character limit on filenames in shared folders can cause problems
# See https://github.com/rodjek/librarian-puppet/issues/256 - plagues OS X and Windows
# Set librarian-puppet's tmp folder to be somewhere other than a share
librarian-puppet config tmp /home/vagrant/.tmp --global && chown vagrant:vagrant /home/vagrant/.tmp

# Done provisioning
touch /root/.provisioned

# Install pre-requisite modules
cd /vagrant && librarian-puppet install


text:
import tkinter as tk
import tk_tools
import random
import string

def random_letters():
    sal = string.ascii_letters
    return (random.choice(sal)
            + random.choice(sal)
            + random.choice(sal))

def add_row_random():
    r1 = random_letters()
    r2 = random_letters()
    r3 = random_letters()

    button_grid.add_row(
        [
            (r1, lambda: print(r1)),
            (r2, lambda: print(r2)),
            (r3, lambda: print(r3))
        ]
    )

def remove_row():
    button_grid.remove_row()

if __name__ == '__main__':

    root = tk.Tk()

    button_grid = tk_tools.ButtonGrid(root, 3, ['Column0', 'Column1', 'Column2'])
    button_grid.grid(row=0, column=0)

    add_row_btn2 = tk.Button(text='Add button row (random text)',
                             command=add_row_random)
    add_row_btn2.grid(row=1, column=0, sticky='EW')

    rm_row_btn = tk.Button(text='Remove button row', command=remove_row)
    rm_row_btn.grid(row=2, column=0, sticky='EW')

    root.mainloop()


text:
$(document).ready(function(){
   $('#searchUser').on('keyup', function(e){
     let username = e.target.value;

     // Make Request To GitHub
     $.ajax({
       url:'https://api.github.com/users/'+username,
       data:{
         client_id:'13c0c042253be4b21c62',
         client_secret:'7dcde8d8446420b828f162ca5d8682c32c48e1d7'
       }
     }).done(function(user){
       $.ajax({
         url:'https://api.github.com/users/'+username+'/repos',
         data:{
           client_id:'13c0c042253be4b21c62',
           client_secret:'7dcde8d8446420b828f162ca5d8682c32c48e1d7',
           sort: 'created: asc',
           per_page: 5
         }
       }).done(function(repos){
         $.ajax({
           url:'https://api.github.com/users/'+username+'/gists',
           data:{
             client_id:'13c0c042253be4b21c62',
             client_secret:'7dcde8d8446420b828f162ca5d8682c32c48e1d7',
             sort: 'created: asc',
             per_page: 5
           }
         }).done(function(gists){
           $.each(gists, function(index, gists){
             $('#gists').append(`

                     ${gists.id}

                     Login: ${gists.login}
                     Created At: ${gists.created_at}
                     Updated At: ${gists.updated_at}

                     Gist Page

               `);
           });
         });
         $.each(repos, function(index, repo){
           $('#repos').append(`

                   ${repo.name}: ${repo.description}

                   Forks: ${repo.forks_count}
                   Watchers: ${repo.watchers_count}
                   Stars: ${repo.stargazers_count}
                   Issues: ${repo.open_issues_count}

                   Repository Page

             `);
         });
       });
       $('#profile').html(`

${user.name}

                Visit Profile On GitHub...

              Public Repositorys: ${user.public_repos}
              Public Gists: ${user.public_gists}
              Followers: ${user.followers}
              Following: ${user.following}
			  Gravatar ID: ${user.gravatar_id}

Name: ${user.name}

Email: ${user.email}

Company: ${user.company}

Website/Blog: ${user.blog}

Location: ${user.location}

Member Since: ${user.created_at}

Updated: ${user.updated_at}

Bio: ${user.bio}

Latest Repositorys

Latest Gists

      `);
     });
   });
});


text:
import {_module} from "./apimanPlugin";

_module.controller("Apiman.AboutController",
    ['$scope', 'PageLifecycle', 'CurrentUser', 'Configuration',
    function ($scope, PageLifecycle, CurrentUser, Configuration) {
        PageLifecycle.loadPage('About', undefined, undefined, $scope, function() {
            $scope.github = "https://github.com/apiman/apiman";
            $scope.site = "https://apiman.io/";
            $scope.userGuide = "https://www.apiman.io/apiman-docs/";
            $scope.tutorials = "https://www.apiman.io/latest/tutorials.html";
            $scope.version = Configuration.apiman.version;
            $scope.builtOn = Configuration.apiman.builtOn;
            $scope.apiEndpoint = Configuration.api.endpoint;
            PageLifecycle.setPageTitle('about');
        });
    }]);


text:
<?php

// No direct access.
defined('_JEXEC') or die ('can not access this file!');

$option = JRequest::getCmd('option');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
?>

<form action="<?php echo JRoute::_('index.php?option=com_zmaxlogin');?>" method="post" name="adminForm" id="adminForm">
	<?php if (!empty( $this->sidebar)) : ?>

		<?php echo $this->sidebar; ?>

	<?php else : ?>

	<?php endif;?>
		<?php if (empty($this->items)) : ?>

			<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>

		<?php else : ?>

					<?php echo JHtml::_('grid.checkall'); ?>
					<?php echo JText::_('图标'); ?>
					<?php echo JText::_("COM_ZMAXLOGIN_VIEW_EXTENSIONS_TITLE_TYPE");?>
					<?php echo JText::_("COM_ZMAXLOGIN_VIEW_EXTENSIONS_TITLE_VERSION");?>
					<?php echo JText::_("COM_ZMAXLOGIN_VIEW_EXTENSIONS_TITLE_AUTHOR");?>
					<?php echo JText::_("COM_ZMAXLOGIN_VIEW_EXTENSIONS_TITLE_POST_DATE");?>
					<?php echo JText::_("COM_ZMAXLOGIN_VIEW_EXTENSIONS_TITLE_PUBLISHED");?>
					<?php echo JText::_("COM_ZMAXLOGIN_VIEW_EXTENSIONS_TITLE_ID");?>

				<?php foreach ($this->items as $i => $item) :?>
				<tr class="row<?php echo $i % 2; ?>" sortable-group-id="<?php echo $item->id; ?>">

						<?php echo JHtml::_('grid.id', $i, $item->id); ?>

						<a href="index.php?option=com_zmaxlogin&task=extension.edit&id=<?php echo $item->id;?>">
							<img width="25px" src="components/com_zmaxlogin/images/<?php echo $item->logintype;?>_image/<?php echo $item->logintype;?>_logo_16_16.png"/>

						<a href="index.php?option=com_zmaxlogin&task=extension.edit&id=<?php echo $item->id;?>">
						<?php echo $item->logintype;?>

						<?php echo $item->version;?>

						<?php echo $item->author;?>

						<?php echo JHtml::_('date', $item->post_date, 'Y-m-d'); ?>

						<?php echo  JHTML::_('grid.published',$item->published, $item->id ,'tick.png','publish_x.png','extensions.');?>

						<?php echo $item->id;?>

				<?php endforeach; ?>

		<?php endif; ?>
		<?php  echo $this->pagination->getListFooter(); ?>

		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<?php echo JHtml::_('form.token'); ?>

</form>


text:
package com.crudui.service;

import static com.crudui.util.Util.indexOf;

import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

import com.crudui.dto.UiFormChildernJSON;
import com.crudui.dto.UiFormJSON;

import lombok.val;

@Component
public class SqlQueryBuilder {
	private static final Logger log = LoggerFactory.getLogger(SqlQueryBuilder.class);

	@Autowired
	private JdbcTemplate jdbcTemplate;

	public String getAllTuppleQuery(UiFormJSON uiFormJSON, boolean idNameProjection) {
		// get all the columns from table metadata, build sql query
		val list = getColumnMetadata(uiFormJSON.getFormTableName());

		// dependent table with alias map
		AtomicInteger ai = new AtomicInteger();

		String mainTableAlias = "a" + ai.incrementAndGet();

		val primaryTableColumnSt = list.stream()
				.filter(x -> !isColumnInDependentTableCollection(x, uiFormJSON.getUiFormChildernJSON()))
				.map(x -> mainTableAlias + "." + x);

		Stream<String> dependencyTableColumnSt = null;

		if (idNameProjection) {
			dependencyTableColumnSt = uiFormJSON.getUiFormChildernJSON().stream().filter(x -> !x.getIntermediateTable())
					.map(x1 -> "concat(" + x1.getAliasEx() + "." + x1.getTableId() + " , '#' , "
							+ concatData(x1.getAliasEx(), x1.getTableColumnName()) + ") as " + x1.getJoinColumnName());
		} else {
			dependencyTableColumnSt = uiFormJSON.getUiFormChildernJSON().stream().filter(x -> !x.getIntermediateTable())
					.map(x1 -> "concat(''," + concatData(x1.getAliasEx(), x1.getTableColumnName()) + ") as "
							+ x1.getJoinColumnName());
		}

		String columnsProjected = Stream.concat(primaryTableColumnSt, dependencyTableColumnSt)
				.collect(Collectors.joining(","));

		String selectPart = "select " + columnsProjected;

		String fromPart = " from " + Stream.concat(Stream.of(uiFormJSON.getFormTableName() + " as " + mainTableAlias),
				uiFormJSON.getUiFormChildernJSON().stream().filter(x -> !x.getIntermediateTable())
						.map(x -> x.getTableName() + " as " + x.getAliasEx()))
				.collect(Collectors.joining(","));

		String wherePart = list.stream()
				.filter(x -> isColumnInDependentTableCollection(x, uiFormJSON.getUiFormChildernJSON()))
				.map(x1 -> mainTableAlias + "." + x1 + "="
						+ getTargetInfo(uiFormJSON.getUiFormChildernJSON(), x1).getAliasEx() + "."
						+ getTargetInfo(uiFormJSON.getUiFormChildernJSON(), x1).getTableId())
				.collect(Collectors.joining(" and "));

		// TODO is there a better way to check and concat string
		String withWherePart = Stream.concat(Stream.of(" where "), Stream.of(wherePart))
				.filter(x -> !wherePart.equals("")).collect(Collectors.joining(" "));

		String sql = selectPart + fromPart + withWherePart;

		log.debug("getAllTuppleQuery=" + sql);
		return sql;
	}

	private String concatData(String aliasEx, String tableColumnName) {
		String project = Arrays.asList(tableColumnName.split(",")).stream().map(x -> aliasEx + "." + x + "")
				.collect(Collectors.joining(",',',"));
		log.debug("project=" + project);
		return project;
	}

	private UiFormChildernJSON getTargetInfo(List<UiFormChildernJSON> list, String columnName) {
		return list.stream().filter(x -> !x.getIntermediateTable() && x.getJoinColumnName().equals(columnName))
				.findFirst().get();
	}

	public List<String> getColumnMetadata(String formTableName) {
		val sql = String.format("select * from %s where 1=2", formTableName);
		val list = new ArrayList<String>();

		try {
			Statement st = jdbcTemplate.getDataSource().getConnection().createStatement();
			ResultSet rs = st.executeQuery(sql);
			ResultSetMetaData rsmd = rs.getMetaData();
			for (int i = 1; i < rsmd.getColumnCount() + 1; i++) {
				list.add(rsmd.getColumnName(i).toLowerCase());
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
	}

	private Boolean isColumnInDependentTableCollection(String columnName, List<UiFormChildernJSON> uiFormChildernJSON) {
		return uiFormChildernJSON.stream()
				.filter(x -> !x.getIntermediateTable() && x.getJoinColumnName().equals(columnName)).findAny()
				.isPresent();
	}

	public String getSingleTuppleQuery(UiFormJSON uiFormJSON) {
		String sql1 = getAllTuppleQuery(uiFormJSON, true);

		if (sql1.contains("where")) {
			sql1 += " and ";
		} else {
			sql1 += " where ";
		}
		val sql = String.format("%s a1.%s=?", sql1, uiFormJSON.getIdColumn());
		log.debug("getSingleTuppleQuery=" + sql);
		return sql;
	}

	public String getTuppleQueryWithFilter(UiFormJSON uiFormJSON, List<Map> input) {
		Function<Map, String> createWhereClause = (x) -> "a1." + indexOf((String) x.get("text"), "=", 0) + "='"
				+ indexOf((String) x.get("text"), "=", 1) + "'";

		String sql1 = getAllTuppleQuery(uiFormJSON, false);

		if (sql1.contains("where")) {
			sql1 += " and ";
		} else {
			sql1 += " where ";
		}

		String where = input.stream().map(createWhereClause).collect(Collectors.joining(" and "));

		val sql = String.format("%s %s", sql1, where);

		log.debug("getTuppleQueryWithFilter=" + sql);

		return sql;
	}

	public String getDropDownSelectQueryWithoutIntermediateTable(UiFormJSON form, UiFormChildernJSON formChild) {
		val sql = String.format("select x.%s, x.%s from %s as x, %s as y where x.%s=y.%s and y.%s=?",
				formChild.getTableId(), formChild.getTableColumnName(), formChild.getTableName(),
				form.getFormTableName(), formChild.getTableId(), formChild.getJoinColumnName(), form.getIdColumn());
		log.debug("getDropDownSelectQueryWithoutIntermediateTable=" + sql);
		return sql;
	}

	public String getDropDownSelectQuery(UiFormChildernJSON form) {
		val sql = String.format("select x.%s, concat('', %s) from %s as x, %s as y where x.%s=y.%s and y.%s=?",
				form.getTableId(), concatData("x", form.getTableColumnName()), form.getTableName(),
				form.getRelationshipTableName(), form.getTableId(), form.getRelationshipTargetTableId(),
				form.getRelationshipSourceTableId());
		log.debug("getDropDownSelectQuery=" + sql);
		return sql;
	}

	public String getDropDownQuery(UiFormChildernJSON form) {
		val sql = String.format("select %s, %s from %s", form.getTableId(), concatData(form.getTableColumnName()),
				form.getTableName());
		log.debug("getDropDownQuery=" + sql);
		return sql;
	}

	private String concatData(String tableColumnName) {
		String[] split = tableColumnName.split(",");
		String project = Arrays.asList(split).stream().collect(Collectors.joining(",',',"));
		log.debug("project=" + project);
		return "concat(''," + project + ")";
	}

}


text:
package org.onosproject.pcep.pcepio.protocol;

import java.util.List;

import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcep.pcepio.exceptions.PcepParseException;
import org.onosproject.pcep.pcepio.types.PcepObjectHeader;
import org.onosproject.pcep.pcepio.types.PcepValueType;

/**
 * Abstraction of an entity providing PCEP LS Object.
 */
public interface PcepLSObject {

    /**
     * Returns LS object header.
     *
     * @return LS object header
     */
    PcepObjectHeader getLSObjHeader();

    /**
     * Sets LS Object header.
     *
     * @param obj LS Object header
     */
    void setLSObjHeader(PcepObjectHeader obj);

    /**
     * Returns ProtocolId in LS Object.
     *
     * @return ProtocolId in LS Object
     */
    byte getProtocolId();

    /**
     * Sets ProtocolId in LS Object.
     *
     * @param protId ProtocolId in LS Object
     */
    void setProtocolId(byte protId);

    /**
     * Returns R flag in LS Object.
     *
     * @return R flag in LS Object
     */
    boolean getRemoveFlag();

    /**
     * Sets R flag in LS Object.
     *
     * @param removeFlag R flag in LS Object
     */
    void setRemoveFlag(boolean removeFlag);

    /**
     * Returns sync flag in LS Object.
     *
     * @return sync flag in LS Object
     */
    boolean getSyncFlag();

    /**
     * Sets sync flag in LS Object.
     *
     * @param syncFlag sync flag in LS Object
     */
    void setSyncFlag(boolean syncFlag);

    /**
     * Returns LS ID in LS Object.
     *
     * @return LS ID in LS Object
     */
    long getLSId();

    /**
     * Sets LS ID in LS Object.
     *
     * @param lsId LS ID in LS Object
     */
    void setLSId(long lsId);

    /**
     * Returns list of Optional Tlvs in LS Object.
     *
     * @return list of Optional Tlvs
     */
    List<PcepValueType> getOptionalTlv();

    /**
     * Sets list of Optional Tlvs in LS Object.
     *
     * @param optionalTlvList list of Optional Tlvs
     */
    void setOptionalTlv(List<PcepValueType> optionalTlvList);

    /**
     * Writes the LS Object into channel buffer.
     *
     * @param bb channel buffer
     * @return Returns the writerIndex of this buffer
     * @throws PcepParseException when object header is not written to channel buffer
     */
    int write(ChannelBuffer bb) throws PcepParseException;

    /**
     * Builder interface with get and set functions to build LS object.
     */
    interface Builder {

        /**
         * Builds LS Object.
         *
         * @return LS Object
         */
        PcepLSObject build();

        /**
         * Returns LS object header.
         *
         * @return LS object header
         */
        PcepObjectHeader getLSObjHeader();

        /**
         * Sets LS object header and returns its builder.
         *
         * @param obj LS object header
         * @return Builder by setting LS object header
         */
        Builder setLSObjHeader(PcepObjectHeader obj);

        /**
         * Returns ProtocolId in LS Object.
         *
         * @return ProtocolId in LS Object
         */
        byte getProtocolId();

        /**
         * Sets ProtocolId in LS Object and returns its builder.
         *
         * @param protId ProtocolId in LS Object
         * @return Builder by setting ProtocolId
         */
        Builder setProtocolId(byte protId);

        /**
         * Returns R flag in LS Object.
         *
         * @return R flag in LS Object
         */
        boolean getRemoveFlag();

        /**
         * Sets R flag in LS Object and returns its builder.
         *
         * @param removeFlag R flag in LS Object
         * @return Builder by setting R flag
         */
        Builder setRemoveFlag(boolean removeFlag);

        /**
         * Returns sync flag in LS Object.
         *
         * @return sync flag in LS Object
         */
        boolean getSyncFlag();

        /**
         * Sets sync flag in LS Object and returns its builder.
         *
         * @param syncFlag sync flag in LS Object
         * @return Builder by setting sync flag
         */
        Builder setSyncFlag(boolean syncFlag);

        /**
         * Returns LS ID in LS Object.
         *
         * @return LS ID in LS Object
         */
        long getLSId();

        /**
         * Sets LS ID in LS Object and returns its builder.
         *
         * @param lsId LS ID in LS Object
         * @return Builder by setting LS ID
         */
        Builder setLSId(long lsId);

        /**
         * Returns list of Optional Tlvs in LS Object.
         *
         * @return list of Optional Tlvs
         */
        List<PcepValueType> getOptionalTlv();

        /**
         * Sets list of Optional Tlvs in LS Object and returns its builder.
         *
         * @param optionalTlvList list of Optional Tlvs
         * @return Builder by setting list of Optional Tlvs
         */
        Builder setOptionalTlv(List<PcepValueType> optionalTlvList);

        /**
         * Sets Processing rule flag in LS object header and returns its builder.
         *
         * @param value boolean value to set Processing rule flag
         * @return Builder by setting Processing rule flag
         */
        Builder setPFlag(boolean value);

        /**
         * Sets Ignore flag in LS object header and returns its builder.
         *
         * @param value boolean value to set Ignore flag
         * @return Builder by setting Ignore flag
         */
        Builder setIFlag(boolean value);
    }
}


text:
//
//  XSTableViewCell.h
//  Xieshi
//
//  Created by Tesiro on 16/7/13.
//  Copyright © 2016年 Lessu. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface XSTableViewCell : UITableViewCell
/**
 *  cell标示符
 *
 *  @return return value description
 */
+ (NSString *)cellIdentifier;

/**
 *  cell的高度
 *
 *  @param model model description
 *
 *  @return return value description
 */
+ (CGFloat)returnCellHeight:(id)model;

@property (strong, nonatomic)id model;
@property (strong, nonatomic)UIView *viewLine;
- (void)initSubviews;    //override

/**
 *  加载cell的数据
 *
 *  @param model model description
 */
- (void)reloadDataForCell:(id)model;  //override

- (void)addLineView:(CGRect)frame;

@end


text:
{-# htermination keysFM_GE :: FiniteMap Float b -> Float -> [Float] #-}
import FiniteMap


text:
package org.apache.kylin.model.tool;

import com.google.common.base.Preconditions;
import org.apache.calcite.sql.SqlNode;
import org.apache.calcite.sql.SqlSelect;
import org.apache.calcite.sql.parser.SqlParseException;
import org.apache.kylin.common.util.Pair;
import org.apache.kylin.metadata.model.tool.CalciteParser;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

public class CalciteParserTest {

    @Rule
    public final ExpectedException exception = ExpectedException.none();

    @Test
    public void testNoTableNameExists() throws SqlParseException {
        String expr1 = "a + b";
        assertEquals("x.a + x.b", CalciteParser.insertAliasInExpr(expr1, "x"));

        String expr2 = "a + year(b)";
        assertEquals("x.a + year(x.b)", CalciteParser.insertAliasInExpr(expr2, "x"));

        String expr3 = "a + hiveudf(b)";
        assertEquals("x.a + hiveudf(x.b)", CalciteParser.insertAliasInExpr(expr3, "x"));
    }

    @Test
    public void testTableNameExists1() throws SqlParseException {
        String expr1 = "a + x.b";

        exception.expect(IllegalArgumentException.class);
        exception.expectMessage("SqlIdentifier X.B contains DB/Table name");
        CalciteParser.insertAliasInExpr(expr1, "x");
    }

    @Test
    public void testTableNameExists2() throws SqlParseException {
        String expr1 = "a + year(x.b)";

        exception.expect(IllegalArgumentException.class);
        exception.expectMessage("SqlIdentifier X.B contains DB/Table name");
        CalciteParser.insertAliasInExpr(expr1, "x");
    }

    @Test
    public void testTableNameExists3() throws SqlParseException {
        String expr1 = "a + hiveudf(x.b)";

        exception.expect(IllegalArgumentException.class);
        exception.expectMessage("SqlIdentifier X.B contains DB/Table name");
        CalciteParser.insertAliasInExpr(expr1, "x");
    }

    @Test
    public void testCaseWhen() {
        String expr = "(CASE LSTG_FORMAT_NAME  WHEN 'Auction' THEN 'x'  WHEN 'y' THEN '222' ELSE 'z' END)";
        String alias = "TEST_KYLIN_FACT";
        String s = CalciteParser.insertAliasInExpr(expr, alias);
        System.out.println(s);
        assertEquals(
                "(CASE TEST_KYLIN_FACT.LSTG_FORMAT_NAME  WHEN 'Auction' THEN 'x'  WHEN 'y' THEN '222' ELSE 'z' END)",
                s);
    }

    @Test
    public void testPos() throws SqlParseException {
        String[] sqls = new String[]{"select \n a \n + \n b \n from t", //
                "select\na\n+\nb\nfrom t", //
                "select \r\n a \r\n + \r\n b \r\n from t", //
                "select\r\na\r\n+\r\nb\r\nfrom t"};

        for (String sql : sqls) {
            SqlNode parse = ((SqlSelect) CalciteParser.parse(sql)).getSelectList().get(0);
            Pair<Integer, Integer> replacePos = CalciteParser.getReplacePos(parse, sql);
            String substring = sql.substring(replacePos.getFirst(), replacePos.getSecond());
            Preconditions.checkArgument(substring.startsWith("a"));
            Preconditions.checkArgument(substring.endsWith("b"));
        }

    }

    @Test
    public void testPosWithBracketsInConstant() throws SqlParseException {
        String[] sqls = new String[]{"select '(   a + b) * (c+ d     ' from t", };
        for (String sql : sqls) {
            SqlNode parse = ((SqlSelect) CalciteParser.parse(sql)).getSelectList().get(0);
            Pair<Integer, Integer> replacePos = CalciteParser.getReplacePos(parse, sql);
            String substring = sql.substring(replacePos.getFirst(), replacePos.getSecond());
            Preconditions.checkArgument(substring.startsWith("'"));
        }
    }

    @Test
    public void testRowExpression() {
        String sql = "SELECT 'LO_LINENUMBER', 'LO_SUPPKEY' FROM \"SSB\".\"P_LINEORDER\" WHERE ROW('LO_ORDERKEY', 'LO_CUSTKEY') IN (ROW(123, 234), ROW(321, 432)) GROUP BY 'LO_LINENUMBER', 'LO_SUPPKEY'";
        try {
            CalciteParser.parse(sql);
        } catch (SqlParseException e) {
            fail("can't parse row construction");
        }
    }
}


text:
<?php

declare(strict_types = 1);

namespace UnitConverter\Unit\Speed;

use UnitConverter\Measure;
use UnitConverter\Unit\AbstractUnit;

/**
 * Speed unit base data class. Any new speed units should
 * extend this class and implement their name, symbol and units;
 * overriding the $unitOf and $base properties only if necessary.
 *
 * @version 1.0.0
 * @since 0.0.1
 * @author Jordan Brauer <18744334+jordanbrauer@users.noreply.github.com>
 */
abstract class SpeedUnit extends AbstractUnit
{
    protected $base = MetrePerSecond::class;

    protected $unitOf = Measure::SPEED;
}


text:
    Normally, a build fails if archiving returns zero artifacts.
    This option allows the archiving process to return nothing without failing the build.
    Instead, the build will simply throw a warning.


text:
package runfunc

import (
	"github.com/metakeule/observe/lib/internal/observer"
	"github.com/metakeule/observe/lib/internal/watcher"
	"regexp"
	"time"
)

type funcProcess struct {
	fn     func(dir, file string) error
	errors chan error
	dir    string
}

// Terminate does nothing
func (f *funcProcess) Terminate(timeout time.Duration) error {
	return nil
}

// Kill does nothing
func (f *funcProcess) Kill() error {
	return nil
}

// Kill2 does nothing
func (f *funcProcess) Kill2() error {
	return nil
}

func (f *funcProcess) Run(file string, block bool) {
	err := f.fn(f.dir, file)
	if err != nil {
		f.errors <- err
	}
}

type Stoppable interface {
	Kill() error
	Terminate(time.Duration) error
}

type RunFunc struct {
	fn         func(dir, file string) error
	dir        string
	matchFiles *regexp.Regexp
	ignore     *regexp.Regexp
	sleep      time.Duration
	bufSize    int
	verbose    bool
}

const DefaultBufSize = 10000

type Config func(*RunFunc)

func BufSize(bfsize int) Config {
	return func(rc *RunFunc) {
		rc.bufSize = bfsize
	}
}

func MatchFiles(m *regexp.Regexp) Config {
	return func(rc *RunFunc) {
		rc.matchFiles = m
	}
}

func Ignore(i *regexp.Regexp) Config {
	return func(rc *RunFunc) {
		rc.ignore = i
	}
}

func Sleep(s time.Duration) Config {
	return func(rc *RunFunc) {
		rc.sleep = s
	}
}

// New creates a new RunFunc that calls fn on changes within
// watchDir or any of its subdirectories.
// No two instances of fn will be running at the same time.
// When calling fn, dir will be the path of watchDir and file will be the file path of the file that was
// created/modified. If file is the empty string, a file has been removed or renamed.
// Optional Configs are
// BufSize(): setting the buffer size of the reporting channels (default: DefaultBufSize)
// Ignore(): setting the regular expression to which matching files and directories are ignored (default: nil; ignore nothing)
// MatchFiles(): setting the regular expression to which file must match in order to be tracked (default: nil; all files match)
// Sleep(): setting the duration of sleeping time of two invocations of fn (default: 0; no sleeping time)
func New(watchDir string, fn func(dir, file string) error, configs ...Config) *RunFunc {
	rc := &RunFunc{
		fn:  fn,
		dir: watchDir,
	}

	for _, c := range configs {
		c(rc)
	}

	if rc.bufSize == 0 {
		rc.bufSize = DefaultBufSize
	}

	return rc
}

// Run initiates the watching and running goroutines.
// Errors while watching are reported to the error channel.
// So are errors returned by the called function.
// If the watcher or the observer could not be initialized properly,
// an error is returned. Otherwise the returned Stoppable can be used to
// terminate and kill the running process and end the observation
func (rc *RunFunc) Run(errors chan error) (Stoppable, error) {
	filechanged := make(chan string, rc.bufSize)

	watch, err := watcher.New(rc.dir, rc.matchFiles, rc.ignore, rc.verbose)
	if err != nil {
		return nil, err
	}

	proc := &funcProcess{
		fn:     rc.fn,
		errors: errors,
		dir:    rc.dir,
	}

	obs := observer.New("$_file", rc.dir, proc, rc.bufSize, rc.verbose)

	obs.ReportRemoved = true
	obs.DirOnly = false

	watch.Run(filechanged, errors)
	obs.Run(filechanged, rc.sleep, false)
	return obs, nil
}


text:
__author__ = 'kocsen'

"""
Command 'Interface'.
"""

class Command:
    def execute(self):
        pass


text:
use std::io;
use std::mem;
use std::sync::Arc;
use std::thread;

use base::error;
use base::warn;
use base::AsRawDescriptor;
use base::Error as SysError;
use base::Event;
use base::RawDescriptor;
use base::Tube;
use data_model::DataInit;
use data_model::Le32;
use remain::sorted;
use resources::Alloc;
use sync::Mutex;
use thiserror::Error;
use vm_control::FsMappingRequest;
use vm_control::VmResponse;
use vm_memory::GuestMemory;

use crate::pci::PciAddress;
use crate::pci::PciBarConfiguration;
use crate::pci::PciBarPrefetchable;
use crate::pci::PciBarRegionType;
use crate::pci::PciCapability;
use crate::virtio::copy_config;
use crate::virtio::DescriptorError;
use crate::virtio::DeviceType;
use crate::virtio::Interrupt;
use crate::virtio::PciCapabilityType;
use crate::virtio::Queue;
use crate::virtio::VirtioDevice;
use crate::virtio::VirtioPciShmCap;
use crate::Suspendable;

mod caps;
mod multikey;
pub mod passthrough;
mod read_dir;
mod worker;

use fuse::Server;
use passthrough::PassthroughFs;
pub use worker::process_fs_queue;
use worker::Worker;

// The fs device does not have a fixed number of queues.
pub const QUEUE_SIZE: u16 = 1024;

const FS_BAR_NUM: u8 = 4;
const FS_BAR_OFFSET: u64 = 0;
const FS_BAR_SIZE: u64 = 1 << 33;

/// Defined in kernel/include/uapi/linux/virtio_fs.h.
const VIRTIO_FS_SHMCAP_ID_CACHE: u8 = 0;

/// The maximum allowable length of the tag used to identify a specific virtio-fs device.
pub const FS_MAX_TAG_LEN: usize = 36;

/// kernel/include/uapi/linux/virtio_fs.h
#[repr(C, packed)]
#[derive(Clone, Copy)]
pub struct virtio_fs_config {
    /// Filesystem name (UTF-8, not NUL-terminated, padded with NULs)
    pub tag: [u8; FS_MAX_TAG_LEN],
    /// Number of request queues
    pub num_request_queues: Le32,
}

// Safe because all members are plain old data and any value is valid.
unsafe impl DataInit for virtio_fs_config {}

/// Errors that may occur during the creation or operation of an Fs device.
#[sorted]
#[derive(Error, Debug)]
pub enum Error {
    /// Failed to create the file system.
    #[error("failed to create file system: {0}")]
    CreateFs(io::Error),
    /// Creating WaitContext failed.
    #[error("failed to create WaitContext: {0}")]
    CreateWaitContext(SysError),
    /// Error happened in FUSE.
    #[error("fuse error: {0}")]
    FuseError(fuse::Error),
    /// Failed to get the securebits for the worker thread.
    #[error("failed to get securebits for the worker thread: {0}")]
    GetSecurebits(SysError),
    /// The `len` field of the header is too small.
    #[error("DescriptorChain is invalid: {0}")]
    InvalidDescriptorChain(DescriptorError),
    /// A request is missing readable descriptors.
    #[error("request does not have any readable descriptors")]
    NoReadableDescriptors,
    /// A request is missing writable descriptors.
    #[error("request does not have any writable descriptors")]
    NoWritableDescriptors,
    /// Error while reading from the virtio queue's Event.
    #[error("failed to read from virtio queue Event: {0}")]
    ReadQueueEvent(SysError),
    /// Failed to set the securebits for the worker thread.
    #[error("failed to set securebits for the worker thread: {0}")]
    SetSecurebits(SysError),
    /// Failed to signal the virio used queue.
    #[error("failed to signal used queue: {0}")]
    SignalUsedQueue(SysError),
    /// The tag for the Fs device was too long to fit in the config space.
    #[error("Fs device tag is too long: len = {0}, max = {}", FS_MAX_TAG_LEN)]
    TagTooLong(usize),
    /// Calling unshare to disassociate FS attributes from parent failed.
    #[error("failed to unshare fs from parent: {0}")]
    UnshareFromParent(SysError),
    /// Error while polling for events.
    #[error("failed to wait for events: {0}")]
    WaitError(SysError),
}

impl From<fuse::Error> for Error {
    fn from(err: fuse::Error) -> Error {
        Error::FuseError(err)
    }
}

pub type Result<T> = ::std::result::Result<T, Error>;

pub struct Fs {
    cfg: virtio_fs_config,
    tag: String,
    fs: Option<PassthroughFs>,
    queue_sizes: Box<[u16]>,
    avail_features: u64,
    acked_features: u64,
    pci_bar: Option<Alloc>,
    tube: Option<Tube>,
    workers: Vec<(Event, thread::JoinHandle<Result<()>>)>,
}

impl Fs {
    pub fn new(
        base_features: u64,
        tag: &str,
        num_workers: usize,
        fs_cfg: passthrough::Config,
        tube: Tube,
    ) -> Result<Fs> {
        if tag.len() > FS_MAX_TAG_LEN {
            return Err(Error::TagTooLong(tag.len()));
        }

        let mut cfg_tag = [0u8; FS_MAX_TAG_LEN];
        cfg_tag[..tag.len()].copy_from_slice(tag.as_bytes());

        let cfg = virtio_fs_config {
            tag: cfg_tag,
            num_request_queues: Le32::from(num_workers as u32),
        };

        let fs = PassthroughFs::new(fs_cfg).map_err(Error::CreateFs)?;

        // There is always a high priority queue in addition to the request queues.
        let num_queues = num_workers + 1;

        Ok(Fs {
            cfg,
            tag: tag.to_string(),
            fs: Some(fs),
            queue_sizes: vec![QUEUE_SIZE; num_queues].into_boxed_slice(),
            avail_features: base_features,
            acked_features: 0,
            pci_bar: None,
            tube: Some(tube),
            workers: Vec::with_capacity(num_workers + 1),
        })
    }

    fn stop_workers(&mut self) {
        for (kill_evt, handle) in mem::take(&mut self.workers) {
            if let Err(e) = kill_evt.signal() {
                error!("failed to kill virtio-fs worker thread: {}", e);
                continue;
            }

            // Only wait on the child thread if we were able to send it a kill event.
            match handle.join() {
                Ok(r) => {
                    if let Err(e) = r {
                        error!("virtio-fs worker thread exited with error: {}", e)
                    }
                }
                Err(e) => error!("virtio-fs worker thread panicked: {:?}", e),
            }
        }
    }
}

impl VirtioDevice for Fs {
    fn keep_rds(&self) -> Vec<RawDescriptor> {
        let mut fds = self
            .fs
            .as_ref()
            .map(PassthroughFs::keep_rds)
            .unwrap_or_else(Vec::new);
        if let Some(rd) = self.tube.as_ref().map(|s| s.as_raw_descriptor()) {
            fds.push(rd);
        }

        fds
    }

    fn device_type(&self) -> DeviceType {
        DeviceType::Fs
    }

    fn queue_max_sizes(&self) -> &[u16] {
        &self.queue_sizes
    }

    fn features(&self) -> u64 {
        self.avail_features
    }

    fn ack_features(&mut self, mut v: u64) {
        // Check if the guest is ACK'ing a feature that we didn't claim to have.
        let unrequested_features = v & !self.avail_features;
        if unrequested_features != 0 {
            warn!("virtio_fs got unknown feature ack: {:x}", v);

            // Don't count these features as acked.
            v &= !unrequested_features;
        }
        self.acked_features |= v;
    }

    fn read_config(&self, offset: u64, data: &mut [u8]) {
        copy_config(data, 0, self.cfg.as_slice(), offset)
    }

    fn activate(
        &mut self,
        guest_mem: GuestMemory,
        interrupt: Interrupt,
        queues: Vec<Queue>,
        queue_evts: Vec<Event>,
    ) {
        if queues.len() != self.queue_sizes.len() || queue_evts.len() != self.queue_sizes.len() {
            return;
        }

        let fs = self.fs.take().expect("missing file system implementation");
        let use_dax = fs.cfg().use_dax;

        let server = Arc::new(Server::new(fs));
        let socket = self.tube.take().expect("missing mapping socket");
        let mut slot = 0;

        // Set up shared memory for DAX.
        // TODO(b/176129399): Remove cfg! once DAX is supported on ARM.
        if cfg!(any(target_arch = "x86", target_arch = "x86_64")) && use_dax {
            // Create the shared memory region now before we start processing requests.
            let request = FsMappingRequest::AllocateSharedMemoryRegion(
                self.pci_bar.as_ref().cloned().expect("No pci_bar"),
            );
            socket
                .send(&request)
                .expect("failed to send allocation message");
            slot = match socket.recv() {
                Ok(VmResponse::RegisterMemory { pfn: _, slot }) => slot,
                Ok(VmResponse::Err(e)) => panic!("failed to allocate shared memory region: {}", e),
                r => panic!(
                    "unexpected response to allocate shared memory region: {:?}",
                    r
                ),
            };
        }

        let socket = Arc::new(Mutex::new(socket));
        let mut watch_resample_event = true;
        for (idx, (queue, evt)) in queues.into_iter().zip(queue_evts.into_iter()).enumerate() {
            let (self_kill_evt, kill_evt) = match Event::new().and_then(|e| Ok((e.try_clone()?, e)))
            {
                Ok(v) => v,
                Err(e) => {
                    error!("fs: failed creating kill Event pair: {}", e);
                    self.stop_workers();
                    return;
                }
            };

            let mem = guest_mem.clone();
            let server = server.clone();
            let irq = interrupt.clone();
            let socket = Arc::clone(&socket);

            let worker_result = thread::Builder::new()
                .name(format!("v_fs:{}:{}", self.tag, idx))
                .spawn(move || {
                    let mut worker = Worker::new(mem, queue, server, irq, socket, slot);
                    worker.run(evt, kill_evt, watch_resample_event)
                });

            if watch_resample_event {
                watch_resample_event = false;
            }

            match worker_result {
                Ok(worker) => self.workers.push((self_kill_evt, worker)),
                Err(e) => {
                    error!("fs: failed to spawn virtio_fs worker: {}", e);
                    self.stop_workers();
                    return;
                }
            }
        }
    }

    fn get_device_bars(&mut self, address: PciAddress) -> Vec<PciBarConfiguration> {
        if self.fs.as_ref().map_or(false, |fs| !fs.cfg().use_dax) {
            return vec![];
        }

        self.pci_bar = Some(Alloc::PciBar {
            bus: address.bus,
            dev: address.dev,
            func: address.func,
            bar: FS_BAR_NUM,
        });

        vec![PciBarConfiguration::new(
            FS_BAR_NUM as usize,
            FS_BAR_SIZE,
            PciBarRegionType::Memory64BitRegion,
            PciBarPrefetchable::Prefetchable,
        )]
    }

    fn get_device_caps(&self) -> Vec<Box<dyn PciCapability>> {
        if self.fs.as_ref().map_or(false, |fs| !fs.cfg().use_dax) {
            return vec![];
        }

        vec![Box::new(VirtioPciShmCap::new(
            PciCapabilityType::SharedMemoryConfig,
            FS_BAR_NUM,
            FS_BAR_OFFSET,
            FS_BAR_SIZE,
            VIRTIO_FS_SHMCAP_ID_CACHE,
        ))]
    }
}

impl Suspendable for Fs {}

impl Drop for Fs {
    fn drop(&mut self) {
        self.stop_workers()
    }
}


text:
// Eloquent JavaScript

// Run this file in your terminal using `node my_solution.js`. Make sure it works before moving on!

// Program Structure
// Write your own variable and do something to it.

var myName = "Jonathan"
console.log(myName);

// Complete one of the exercises: Looping a Triangle, FizzBuzz, or Chess Board
for (var i=1; i <= 100; i++)
{
    if (i % 15 == 0)
        console.log("FizzBuzz");
    else if (i % 3 == 0)
        console.log("Fizz");
    else if (i % 5 == 0)
        console.log("Buzz");
    else
        console.log(i);
}

// Functions

// Complete the `minimum` exercise.

console.log(Math.min(5, 20));

// Data Structures: Objects and Arrays
// Create an object called "me" that stores your name, age, 3 favorite foods, and a quirk below.
var me = {
  name: "Jonath",
  age: 33,
  favoriteFoods: ["Pasta", "Rice", "Mcdo"],
  quirk: "I enjoy reading math books"
}

/*
REFLECTION
Q: What are the biggest similarities  and differences between JavaScript and Ruby?
A: JavaScript and Ruby both are scripting languages so they are quite similar. The logic is quite the same and jumping from Ruby to Javascript feels quite natural. Some of the differences I think would be in the syntax. Here are a few examples:

- To increment or decrement by 1 in JavaScript, you can write ++.
- Functions in JavaScript are the same as methods in Ruby. Syntax def with Javascript defining functions with curly brace ( function nameOfFunction(){})
-Objects are similar to Ruby's hash), declared as variables, are a way of organizing key/value pairs.
-Both Ruby and JavaScript have Arrays, which are more of less logically the same.
-Both Ruby and JavaScript have a .each method (for ruby) .forEach(for javaScript)

Q: Was some of your Ruby knowledge solidified by learning another language? If
so, which concepts?
A: I solidified my control flow understanding as it was like a review of what was done in ruby.

Q: How do you feel about diving into JavaScript after reading these chapters?
A: Feel good but would but would from what I read online javascript is more efficient than Ruby and I would like to get an opportunity to see that in action.

*/