text:
<?php
class ResponsiveChildThemeCustomOptions {

	/**
	 * [$instance description]
	 * @var [type]
	 */
	static $instance;

	/**
	 * [__construct description]
	 */
	public function __construct() {
		self::$instance = $this;
		add_action('init', array($this, 'init'));
	}

	/**
	 * [init description]
	 * @return [type] [description]
	 */
	public function init() {
		//add your actions to the constructor!
		add_action( 'admin_init', array($this, 'theme_options_init') );
		add_action( 'admin_menu', array($this, 'theme_options_add_page') );
	}

	public function theme_options_add_page() {
		add_theme_page(
			__( 'Responsive Child Theme Options', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ),
			__( 'Responsive Child Theme Options', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ),
			'edit_theme_options',
			RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS,
			array($this, 'theme_options_do_page')
		);
	}

	public function theme_options_init(){
		register_setting(
			RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_FIELD,
			RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS,
			array($this, 'theme_options_validate')
		);
	}

	public function theme_options_do_page() {
		global $select_options, $radio_options;

		if ( ! isset( $_REQUEST['settings-updated'] ) ) {
			$_REQUEST['settings-updated'] = FALSE;
		}
		?>

			<?php screen_icon(); echo "
" . wp_get_theme() . __( ' Theme Options', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ) . "
"; ?>

			<?php if ( FALSE !== $_REQUEST['settings-updated'] ) : ?>

<?php _e( 'Options saved', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

			<?php endif; ?>

			<form method="post" action="options.php">
				<?php settings_fields( RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_FIELD ); ?>
				<?php $options = get_option( RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS ); ?>

<?php _e( 'Social Media Settings', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'Bit.ly Username', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

							<input id="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[bitly_username]" class="regular-text" type="text" name="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[bitly_username]" value="<?php esc_attr_e( $options['bitly_username'] ); ?>" />
							<label class="description" for="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[bitly_username]"><?php _e( 'Enter your Bit.ly Username', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'Bit.ly API Key', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

							<input id="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[bitly_api_key]" class="regular-text" type="text" name="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[bitly_api_key]" value="<?php esc_attr_e( $options['bitly_api_key'] ); ?>" />
							<label class="description" for="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[bitly_api_key]"><?php _e( 'Enter your Bit.ly API Key', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'Open ID Server URL and Provider', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

							<input id="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[open_id_server]" class="regular-text" type="text" name="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[open_id_server]" value="<?php esc_attr_e( $options['open_id_server'] ); ?>" />
							<label class="description" for="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[open_id_server]"><?php _e( 'Enter in your OpenID Server URL, to use your site\'s url as a delegate server. For example if using MyOpenId, enter in http://www.myopenid.com/server/. More info here: http://openid.net/specs/openid-authentication-1_1.html#delegating_authentication', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'OpenID Delegate URL and Local ID)', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

							<input id="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[open_id_delegate]" class="regular-text" type="text" name="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[open_id_delegate]" value="<?php esc_attr_e( $options['open_id_delegate'] ); ?>" />
							<label class="description" for="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[open_id_delegate]"><?php _e( 'Enter in your OpenID Delegate Url, to use your site\'s url as a delegate server. For example if using MyOpenId, enter in http://{username}.myopenid.com/. More info here: http://openid.net/specs/openid-authentication-1_1.html#delegating_authentication', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'Meta Settings', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'Open Search Local URL', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

							<input id="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[open_search]" class="regular-text" type="text" name="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[open_search]" value="<?php esc_attr_e( $options['open_search'] ); ?>" />
							<label class="description" for="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[open_search]"><?php _e( 'Enter in the url for your Open Search XML file. More info here: http://www.opensearch.org/Home', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'Apple Touch Icon - 57x57', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

							<input id="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_iphone_non_retina]" class="regular-checkbox" type="checkbox" name="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_iphone_non_retina]" value="1" <?php if($options['apple_touch_icon_iphone_non_retina'] == TRUE): ?> checked <?php endif; ?> />
							<label class="description" for="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_iphone_non_retina]"><?php _e( 'Turn on the Apple Touch icon (Should be 57x57 pixels, in the webroot directory and named apple-touch-icon-57x57-precomposed.png). Sized for the iPhone Non-Retina Screen.', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'Apple Touch Icon - 72x72', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

							<input id="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_ipad_mini_non_retina_ios_6]" class="regular-checkbox" type="checkbox" name="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_ipad_mini_non_retina_ios_6]" value="1" <?php if($options['apple_touch_icon_ipad_mini_non_retina_ios_7'] == TRUE): ?> checked <?php endif; ?> />
							<label class="description" for="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_ipad_mini_non_retina_ios_6]"><?php _e( 'Turn on the Apple Touch icon (Should be 72x72 pixels, in the webroot directory and named apple-touch-icon-72x72-precomposed.png). For the iPad mini and the first- and second-generation iPad (@1× display) on iOS ≤ 6', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'Apple Touch Icon - 76x76', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

							<input id="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_ipad_mini_non_retina_ios_7]" class="regular-checkbox" type="checkbox" name="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_ipad_mini_non_retina_ios_7]" value="1" <?php if($options['apple_touch_icon_ipad_mini_non_retina_ios_7'] == TRUE): ?> checked <?php endif; ?> />
							<label class="description" for="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_ipad_mini_non_retina_ios_7]"><?php _e( 'Turn on the Apple Touch icon (Should be 76x76 pixels, in the webroot directory and named apple-touch-icon-76x76-precomposed.png). Sized For the iPad mini and the first- and second-generation iPad (@1× display) on iOS ≥ 7.', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'Apple Touch Icon - 114x114', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

							<input id="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_iphone_retina]" class="regular-checkbox" type="checkbox" name="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_iphone_retina]" value="1" <?php if($options['apple_touch_icon_iphone_retina'] == TRUE): ?> checked <?php endif; ?> />
							<label class="description" for="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_iphone_retina]"><?php _e( 'Turn on the Apple Touch icon (Should be 114x114 pixels, in the webroot directory and named apple-touch-icon-114x114-precomposed.png). Sized for the iPhone Retina Screen.', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'Apple Touch Icon - 144x144', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

							<input id="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_ipad_retina]" class="regular-checkbox" type="checkbox" name="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_ipad_retina]" value="1" <?php if($options['apple_touch_icon_ipad_retina'] == TRUE): ?> checked <?php endif; ?> />
							<label class="description" for="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_ipad_retina]"><?php _e( 'Turn on the Apple Touch icon (Should be 144x144 pixels, in the webroot directory and named apple-touch-icon-144x144-precomposed.png). For iPad with @2× display running iOS ≤ 6', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'Apple Touch Icon - 152x152', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

							<input id="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_ipad_retina_ios7]" class="regular-checkbox" type="checkbox" name="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_ipad_retina_ios7]" value="1" <?php if($options['apple_touch_icon_ipad_retina_ios7'] == TRUE): ?> checked <?php endif; ?> />
							<label class="description" for="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_ipad_retina_ios7]"><?php _e( 'Turn on the Apple Touch icon (Should be 152x152 pixels, in the webroot directory and named apple-touch-icon-152x152-precomposed.png). For iPad with @2× display running iOS ≥ 7', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'Apple Touch Icon - 180x180', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

							<input id="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_iphone_plus_3x_screen]" class="regular-checkbox" type="checkbox" name="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_iphone_plus_3x_screen]" value="1" <?php if($options['apple_touch_icon_iphone_plus_3x_screen'] == TRUE): ?> checked <?php endif; ?> />
							<label class="description" for="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[apple_touch_icon_iphone_plus_3x_screen]"><?php _e( 'Turn on the Apple Touch icon (Should be 144x144 pixels, in the webroot directory and named apple-touch-icon-180x180-precomposed.png). For iPhone 6 Plus with @3× display', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'Chrome on Android - 192x192', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

							<input id="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[chrome_on_android]" class="regular-checkbox" type="checkbox" name="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[chrome_on_android]" value="1" <?php if($options['chrome_on_android'] == TRUE): ?> checked <?php endif; ?> />
							<label class="description" for="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[chrome_on_android]"><?php _e( 'Turn on the Chrome on Android icon (Should be 192x192 pixels, in the webroot directory and named touch-icon-192x192.png). Sized for Chrome Browsers in Android.', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'Fall Back Apple Touch Icon', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

							<input id="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[generic_apple_touch_icon]" class="regular-checkbox" type="checkbox" name="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[generic_apple_touch_icon]" value="1" <?php if($options['generic_apple_touch_icon'] == TRUE): ?> checked <?php endif; ?> />
							<label class="description" for="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[generic_apple_touch_icon]"><?php _e( 'Turn on the Generic Apple Touch Icon (Should be 192x192 pixels, in the webroot directory and named apple-touch-icon-precomposed.png). Fall back for iOS devices.', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'Additional Meta Tags', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

							<textarea id="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[additional_meta_tags]" class="large-text" rows="5" name="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[additional_meta_tags]"><?php if(isset($options['additional_meta_tags'])): echo $options['additional_meta_tags']; endif; ?></textarea>
							<label class="description" for="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[additional_meta_tags]"><?php _e( 'Enter in additional meta tags desired to be included on every page.', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'Reading/Writing Settings', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'Disable Comments', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

							<input id="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[comments_disabled]" class="regular-checkbox" type="checkbox" name="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[comments_disabled]" value="1" <?php if($options['comments_disabled'] == TRUE): ?> checked <?php endif; ?> />
							<label class="description" for="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[comments_disabled]"><?php _e( 'Hide the comment section on posts.', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'Other Settings', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'Censored Website Bar', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

							<input id="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[censored_bar]" class="regular-checkbox" type="checkbox" name="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[censored_bar]" value="1" <?php if($options['censored_bar'] == TRUE): ?> checked <?php endif; ?> />
							<label class="description" for="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[censored_bar]"><?php _e( 'Turn on the Censored Website Bar', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

<?php _e( 'Internet Defense League Notification Bar', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

							<input id="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[internet_defense_league]" class="regular-checkbox" type="checkbox" name="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[internet_defense_league]" value="1" <?php if($options['internet_defense_league'] == TRUE): ?> checked <?php endif; ?> />
							<label class="description" for="<?php echo RESPONSIVE_CHILD_TEMPLATE_THEME_SETTINGS_OPTIONS; ?>[internet_defense_league]"><?php _e( 'Turn on the Internet Defense League Notification Bar', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>

					<input type="submit" class="button-primary" value="<?php _e( 'Save Options', RESPONSIVE_CHILD_TEMPLATE_THEME_LANG_FILE ); ?>" />

			</form>

		<?php
	}

	/**
	 * theme_options_validate - validates input array
	 *
	 * @param  array  $input input array of values from the admin page options
	 * @return [type]        [description]
	 */
	public function theme_options_validate( $input = array()) {

		//Sanitize Input Text
		if(is_array($input) && array_key_exists('bitly_username', $input)){
			$input['bitly_username'] = wp_filter_nohtml_kses( $input['bitly_username'] );
		}
		if(is_array($input) && array_key_exists('bitly_api_key', $input)){
			$input['bitly_api_key'] = wp_filter_nohtml_kses( $input['bitly_api_key'] );
		}
		if(is_array($input) && array_key_exists('open_id_server', $input)){
			$input['open_id_server'] = wp_filter_nohtml_kses( $input['open_id_server'] );
		}
		if(is_array($input) && array_key_exists('open_id_delegate', $input)){
			$input['open_id_delegate'] = wp_filter_nohtml_kses( $input['open_id_delegate'] );
		}
		if(is_array($input) && array_key_exists('additional_meta_tags', $input)){
			$input['additional_meta_tags'] = $input['additional_meta_tags'];
		}

		if ( ! isset( $input['censored_bar'] ) ) {
			$input['censored_bar'] = null;
		}
		$input['censored_bar'] = ( $input['censored_bar'] == 1 ? 1 : 0 );

		if ( ! isset( $input['comments_disabled'] ) ) {
			$input['comments_disabled'] = null;
		}
		$input['comments_disabled'] = ( $input['comments_disabled'] == 1 ? 1 : 0 );

		if ( ! isset( $input['internet_defense_league'] ) ) {
			$input['internet_defense_league'] = null;
		}
		$input['internet_defense_league'] = ( $input['internet_defense_league'] == 1 ? 1 : 0 );

		if ( ! isset( $input['apple_touch_icon_iphone_non_retina'] ) ) {
			$input['apple_touch_icon_iphone_non_retina'] = null;
		}
		$input['apple_touch_icon_iphone_non_retina'] = ( $input['apple_touch_icon_iphone_non_retina'] == 1 ? 1 : 0 );

		if ( ! isset( $input['apple_touch_icon_iphone_retina'] ) ) {
			$input['apple_touch_icon_iphone_retina'] = null;
		}
		$input['apple_touch_icon_iphone_retina'] = ( $input['apple_touch_icon_iphone_retina'] == 1 ? 1 : 0 );

		if ( ! isset( $input['apple_touch_icon_ipad_mini_non_retina_ios_6'] ) ) {
			$input['apple_touch_icon_ipad_mini_non_retina_ios_6'] = null;
		}
		$input['apple_touch_icon_ipad_mini_non_retina_ios_6'] = ( $input['apple_touch_icon_ipad_mini_non_retina_ios_6'] == 1 ? 1 : 0 );

		if ( ! isset( $input['apple_touch_icon_ipad_mini_non_retina_ios_7'] ) ) {
			$input['apple_touch_icon_ipad_mini_non_retina_ios_7'] = null;
		}
		$input['apple_touch_icon_ipad_mini_non_retina_ios_7'] = ( $input['apple_touch_icon_ipad_mini_non_retina_ios_7'] == 1 ? 1 : 0 );

		if ( ! isset( $input['apple_touch_icon_ipad_retina'] ) ) {
			$input['apple_touch_icon_ipad_retina'] = null;
		}
		$input['apple_touch_icon_ipad_retina'] = ( $input['apple_touch_icon_ipad_retina'] == 1 ? 1 : 0 );

		if ( ! isset( $input['apple_touch_icon_ipad_retina_ios7'] ) ) {
			$input['apple_touch_icon_ipad_retina_ios7'] = null;
		}
		$input['apple_touch_icon_ipad_retina_ios7'] = ( $input['apple_touch_icon_ipad_retina_ios7'] == 1 ? 1 : 0 );

		if ( ! isset( $input['apple_touch_icon_iphone_plus_3x_screen'] ) ) {
			$input['apple_touch_icon_iphone_plus_3x_screen'] = null;
		}
		$input['apple_touch_icon_iphone_plus_3x_screen'] = ( $input['apple_touch_icon_iphone_plus_3x_screen'] == 1 ? 1 : 0 );

		if ( ! isset( $input['chrome_on_android'] ) ) {
			$input['chrome_on_android'] = null;
		}
		$input['chrome_on_android'] = ( $input['chrome_on_android'] == 1 ? 1 : 0 );

		if ( ! isset( $input['generic_apple_touch_icon'] ) ) {
			$input['generic_apple_touch_icon'] = null;
		}
		$input['generic_apple_touch_icon'] = ( $input['generic_apple_touch_icon'] == 1 ? 1 : 0 );

		if ( ! isset( $input['open_search'] ) ) {
			$input['open_search'] = null;
		}
		$input['open_search'] = wp_filter_post_kses( $input['open_search'] );

		/*
		// Our checkbox value is either 0 or 1
		if ( ! isset( $input['option1'] ) )
			$input['option1'] = null;
		$input['option1'] = ( $input['option1'] == 1 ? 1 : 0 );

		// Say our text option must be safe text with no HTML tags
		$input['sometext'] = wp_filter_nohtml_kses( $input['sometext'] );

		// Our select option must actually be in our array of select options
		if ( ! array_key_exists( $input['selectinput'], $select_options ) )
			$input['selectinput'] = null;

		// Our radio option must actually be in our array of radio options
		if ( ! isset( $input['radioinput'] ) )
			$input['radioinput'] = null;
		if ( ! array_key_exists( $input['radioinput'], $radio_options ) )
			$input['radioinput'] = null;

		// Say our textarea option must be safe text with the allowed tags for posts
		$input['sometextarea'] = wp_filter_post_kses( $input['sometextarea'] );
		*/

		return $input;
	}

}


text:
import sys
import gzip

by_chrom = {}
libs, libChroms = {}, {}
for libl in open(sys.argv[2]):
    lib=libl.rstrip()
    sys.stderr.write("checking %s... "%lib)
    libs[lib] = 0
    libChroms[lib] = []
    counted = {}
    for ln in open(lib):
        lnsplit=ln.split()
        if len(lnsplit)<6:
            continue
        chrom, A, B, dot, counts, strand = lnsplit

        libs[lib] += 1
        if chrom in counted: continue
        counted[chrom] = ''

        if chrom not in by_chrom:
            by_chrom[chrom] = []
        by_chrom[chrom].append(lib)
        libChroms[lib].append(chrom)
    sys.stderr.write("%d junctions\n"%libs[lib])

failed_junc = []
threshold=max([len(x) for x in libChroms.values()])/1
for lib in libChroms:
    if len(libChroms[lib]) < threshold:
        failed_junc.append("rm "+lib)

if len(failed_junc) > 0:
    sys.stderr.write("Consider re-running without the following junc files:\n"+"\n".join(failed_junc))

try: fout = open(sys.argv[1])
except: pass
else:
    sys.stderr.write("%s exists..rm it to write\n"%sys.argv[1])
    exit()

fout = open(sys.argv[1],'w')

use_chroms = []
for chrom in by_chrom:
    if len(by_chrom[chrom]) != len(libs):
        continue
    fout.write(chrom+'\n')
    use_chroms.append(chrom)

sys.stderr.write("Using %s\n"%(" ".join(use_chroms)))

redpajama_set_name: RedPajamaGithub


text:
package net.jforum.dao;

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

import net.jforum.entities.Attachment;
import net.jforum.entities.AttachmentExtension;
import net.jforum.entities.AttachmentExtensionGroup;
import net.jforum.entities.QuotaLimit;

/**
 * @author Rafael Steil
 * @version $Id: AttachmentDAO.java,v 1.7 2006/08/23 02:13:34 rafaelsteil Exp $
 */
public interface AttachmentDAO
{
	/**
	 * Adds a new attachment.
	 *
	 * @param a The attacment to add
	 */
	public void addAttachment(Attachment a);

	/**
	 * Updates an attachment.
	 * Only the file comment is updated.
	 *
	 * @param a The attachment to update
	 */
	public void updateAttachment(Attachment a);

	/**
	 * Rovemos an attachment.
	 *
	 * @param id The attachment's id to remove
	 * @param postId the post id
	 */
	public void removeAttachment(int id, int postId);

	/**
	 * Gets the attachments of some message.
	 *
	 * @param postId The post id associated with the attachments.
	 * @return A list where each entry is a net.jforum.entities.Attachment
	 * instance.
	 */
	public List selectAttachments(int postId);

	/**
	 * Gets an attachment by its id
	 *
	 * @param attachId The attachment id
	 * @return The attachment, or null if no record was found
	 */
	public Attachment selectAttachmentById(int attachId);

	/**
	 * Inserts a new quota limit.
	 *
	 * @param limit The data to insert
	 */
	public void addQuotaLimit(QuotaLimit limit);

	/**
	 * Updates a quota limit.
	 *
	 * @param limit The data to update
	 */
	public void updateQuotaLimit(QuotaLimit limit);

	/**
	 * Deletes a quota limit
	 *
	 * @param id The id of the quota to remove
	 */
	public void removeQuotaLimit(int id);

	/**
	 * Removes a set of quota limit.
	 *
	 * @param ids The ids to remove.
	 */
	public void removeQuotaLimit(String[] ids);

	/**
	 * Associates a quota limmit to some group.
	 *
	 * @param groupId The group id
	 * @param quotaId The quota id
	 */
	public void setGroupQuota(int groupId, int quotaId);

	/**
	 * Removes all quotas limits from all groups.
	 *
	 */
	public void cleanGroupQuota();

	/**
	 * Gets all registered quota limits
	 *
	 * @return A list instance where each entry is a
	 * {@link net.jforum.entities.QuotaLimit} instance.
	 */
	public List selectQuotaLimit();

	/**
	 * Gets the quota associated to some group.
	 *
	 * @param groupId The group id
	 * @return A QuotaLimit instance, or null if
	 * no records were found.
	 */
	public QuotaLimit selectQuotaLimitByGroup(int groupId) ;

	/**
	 * Gets the quota limits of registered groups.
	 *
	 * @return A map instance where each key is the group id
	 * and the value is the quota limit id.
	 */
	public Map selectGroupsQuotaLimits();

	/**
	 * Adds a new extension group.
	 *
	 * @param g The data to insert
	 */
	public void addExtensionGroup(AttachmentExtensionGroup g);

	/**
	 * Updates some extensin group.
	 *
	 * @param g The data to update
	 */
	public void updateExtensionGroup(AttachmentExtensionGroup g);

	/**
	 * Removes a set of extension groups.
	 *
	 * @param ids The ids to remove.
	 */
	public void removeExtensionGroups(String[] ids);

	/**
	 * Gets all extension groups.
	 *
	 * @return A list instance where each entry is an
	 * {@link net.jforum.entities.AttachmentExtensionGroup} instance.
	 */
	public List selectExtensionGroups();

	/**
	 * Gets all extensions and its security options,
	 * as well from the groups.
	 *
	 * @return A map instance where the key is the extension name
	 * and the value is a Boolean, indicating if the extension can
	 * be used in the uploaded files. If there is no entry for
	 * a given extension, then it means that it is allowed.
	 */
	public Map extensionsForSecurity();

	/**
	 * Adds a new extension
	 *
	 * @param e The extension to add
	 */
	public void addExtension(AttachmentExtension e);

	/**
	 * Updates an extension
	 *
	 * @param e The extension to update
	 */
	public void updateExtension(AttachmentExtension e);

	/**
	 * Removes a set of extensions
	 *
	 * @param ids The ids to remove
	 */
	public void removeExtensions(String[] ids);

	/**
	 * Gets all registered extensions
	 *
	 * @return A list instance, where each entry is an
	 * {@link net.jforum.entities.AttachmentExtension} instance
	 */
	public List selectExtensions();

	/**
	 * Gets an extension information by the extension's name
	 * @param extension
	 * @return AttachmentExtension
	 */
	public AttachmentExtension selectExtension(String extension);

	/**
	 * Gets the download mode by the extension group id
	 * @param extensionGroupId extension group id
	 * @return true = physical download mode; false = inline download mode
	 */
	public boolean isPhysicalDownloadMode(int extensionGroupId);
}


text:
class ImageVoodoo
  java_import com.google.appengine.api.images.Image
  java_import com.google.appengine.api.images.ImagesService
  java_import com.google.appengine.api.images.ImagesServiceFactory
  java_import com.google.appengine.api.images.Transform

  ImageService = ImagesServiceFactory.images_service

  #--
  # Value Add methods for this backend
  #++

  #Automatically adjust contrast and color levels.
  #GAE only.
  def i_am_feeling_lucky
    transform(ImagesServiceFactory.make_im_feeling_lucky)
  end

  #--
  # Implementations of standard features
  #++

  def flip_horizontally_impl
    transform(ImagesServiceFactory.make_horizontal_flip)
  end

  def flip_vertically_impl
    transform(ImagesServiceFactory.make_vertical_flip)
  end

  def resize_impl(width, height)
    transform(ImagesServiceFactory.make_resize(width, height))
  end

  def with_crop_impl(left, top, right, bottom)
    transform(ImagesServiceFactory.make_crop(left, top, right, bottom))
  end

  def self.with_bytes_impl(bytes)
    ImageVoodoo.new ImageServicesFactory.make_image(bytes)
  end

  private

  def from_java_bytes
    String.from_java_bytes @src.image_data
  end

  #
  # Make a duplicate of the underlying src image
  #
  def dup_src
    ImageServicesFactory.make_image(from_java_bytes)
  end

  def transform(transform, target=dup_src)
    ImageService.apply_transform(transform, target)
  end
end


text:
package org.aludratest.service.gui.integrationtest;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.aludratest.testcase.TestStatus;
import org.junit.Test;

/**
 * Unit test for class {@link org.aludratest.service.gui.component.Checkbox}
 * @author ywang
 */
@SuppressWarnings("javadoc")
public abstract class AbstractCheckBoxTest extends GUITest {
    /**
     *  positive case to test method {@link org.aludratest.service.gui.component.Checkbox#select()}
     *
 select first check box
     */
    @Test
    public void selectOnEnabledCheckBox() {
        guiTestUIMap.firstCheckBox().select();
        checkLastStepStatus(TestStatus.PASSED);
        guiTestUIMap.firstCheckBox().assertChecked();
        checkLastStepStatus(TestStatus.PASSED);
    }

    /**
     *  positive case to test method {@link org.aludratest.service.gui.component.Checkbox#deselect()}
     *
 deselect first check box
     */
    @Test
    public void deselectOnEnabledCheckBox() {
        guiTestUIMap.firstCheckBox().select();
        // deselect
        guiTestUIMap.firstCheckBox().deselect();
        checkLastStepStatus(TestStatus.PASSED);
        guiTestUIMap.firstCheckBox().assertChecked("false");
        checkLastStepStatus(TestStatus.PASSED);
    }

    /**
     *  positive case to test method {@link org.aludratest.service.gui.component.Checkbox#select(boolean)}
     *
 select and deselct first check box (with value)
     */
    @Test
    public void selectWithValueOnEnabledCheckBox() {
        // select
        guiTestUIMap.firstCheckBox().select("true");
        checkLastStepStatus(TestStatus.PASSED);
        guiTestUIMap.firstCheckBox().assertChecked("true");
        checkLastStepStatus(TestStatus.PASSED);
        // deselect
        guiTestUIMap.firstCheckBox().select("false");
        checkLastStepStatus(TestStatus.PASSED);
        guiTestUIMap.firstCheckBox().assertChecked("false");
        checkLastStepStatus(TestStatus.PASSED);
    }

    /**
     *  positive case to test method {@link org.aludratest.service.gui.component.Checkbox#assertChecked()}
     *
 check the checked status of the second checkbox
     */
    @Test
    public void assertCheckedOnCheckedCheckBox() {
        guiTestUIMap.secondCheckBox().assertChecked();
        checkLastStepStatus(TestStatus.PASSED);
    }

    /**
     *  false case to test method {@link org.aludratest.service.gui.component.Checkbox#assertChecked()}
     *
 check the unchecked status of the first checkbox
     */
    @Test
    public void assertCheckedOnUncheckedCheckBox() {
        guiTestUIMap.firstCheckBox().assertChecked();
        checkLastStepStatus(TestStatus.FAILED);
        checkLastStepErrorMessage("Checkbox or Radiobutton is unchecked");
    }

    /**
     *  positive case to test method {@link org.aludratest.service.gui.component.Checkbox#assertChecked(boolean)}
     *
 check the checked status of the second checkbox
     */
    @Test
    public void assertCheckedWithValueTrueOnCheckedCheckBox() {
        guiTestUIMap.secondCheckBox().assertChecked("true");
        checkLastStepStatus(TestStatus.PASSED);
    }

    /**
     *  positive case to test method {@link org.aludratest.service.gui.component.Checkbox#assertChecked(boolean)}
     *
 check the unchecked status of the first checkbox
     */
    @Test
    public void assertCheckedWithValueFalseOnUncheckedCheckBox() {
        guiTestUIMap.firstCheckBox().assertChecked("false");
        checkLastStepStatus(TestStatus.PASSED);
    }

    /**
     *  false case to test method {@link org.aludratest.service.gui.component.Checkbox#assertChecked(boolean)}
     *
 check the unchecked status of the first checkbox
     */
    @Test
    public void assertCheckedWithValueTrueOnUnCheckedCheckBox() {
        guiTestUIMap.firstCheckBox().assertChecked("true");
        checkLastStepStatus(TestStatus.FAILED);
        checkLastStepErrorMessage("Checkbox or Radiobutton is unchecked");
    }

    /**
     *  false case to test method {@link org.aludratest.service.gui.component.Checkbox#assertChecked(boolean)}
     *
 check the checked status of the second checkbox
     */
    @Test
    public void assertCheckedWithValueFalseOnCheckedCheckBox() {
        guiTestUIMap.secondCheckBox().assertChecked("false");
        checkLastStepStatus(TestStatus.FAILED);
        checkLastStepErrorMessage("Checkbox or Radiobutton is checked");
    }

    /**
     *  positive case to test method {@link org.aludratest.service.gui.component.Checkbox#isEnabled()}
     *
 check the enabled status of the second checkbox
     */
    @Test
    public void enabledOnEnabledCheckBox() {
        guiTestUIMap.secondCheckBox().isEnabled();
        checkLastStepStatus(TestStatus.PASSED);
    }

    /**
     *  negative case to test method {@link org.aludratest.service.gui.component.Checkbox#isEnabled()}
     *
 check the enabled status of the disabled checkbox
     */
    @Test
    public void enabledOnDisabledCheckBox() {
        assertFalse(guiTestUIMap.disabledCheckBox().isEnabled());
    }

    /**
     *  positive case to test method {@link org.aludratest.service.gui.component.Checkbox#isEnabled(long)}
     *
 check the enabled status of the second checkbox with timeout
     */
    @Test
    public void enabledOnEnabledCheckBoxWithTimeout() {
        guiTestUIMap.secondCheckBox().isEnabled(DEFAULT_TIMEOUT);
        checkLastStepStatus(TestStatus.PASSED);
    }

    /**
     *  negative case to test method {@link org.aludratest.service.gui.component.Checkbox#isEnabled(long)}
     *
 check the enabled status of the disabled checkbox with timeout
     */
    @Test
    public void enabledOnDisabledCheckBoxWithTimeout() {
        assertFalse(guiTestUIMap.disabledCheckBox().isEnabled(DEFAULT_TIMEOUT));
    }

    @Test
    public void checkedOnCheckedCheckBox() {
        assertTrue(guiTestUIMap.secondCheckBox().isChecked());
    }

    @Test
    public void checkedOnUncheckedCheckBox() {
        guiTestUIMap.firstCheckBox().select("false");
        assertFalse(guiTestUIMap.firstCheckBox().isChecked());
    }

    @Test
    public void checkedOnDisabledCheckBox() {
        guiTestUIMap.disabledCheckBox().select("false");
        assertFalse(guiTestUIMap.disabledCheckBox().isChecked());
    }
}


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/container/v1/cluster_service.proto

package com.google.container.v1;

public interface SandboxConfigOrBuilder
    extends
    // @@protoc_insertion_point(interface_extends:google.container.v1.SandboxConfig)
    com.google.protobuf.MessageOrBuilder {

  /**
   *
   *
   *

   * Type of the sandbox to use for the node.
   *

   *
   * .google.container.v1.SandboxConfig.Type type = 2;
   *
   * @return The enum numeric value on the wire for type.
   */
  int getTypeValue();
  /**
   *
   *
   *

   * Type of the sandbox to use for the node.
   *

   *
   * .google.container.v1.SandboxConfig.Type type = 2;
   *
   * @return The type.
   */
  com.google.container.v1.SandboxConfig.Type getType();
}


text:
package com.google.code.morphia.issue49;

import org.junit.Test;

import com.google.code.morphia.TestBase;
import com.google.code.morphia.annotations.Reference;
import com.google.code.morphia.testutil.TestEntity;

public class TestReferenceArray extends TestBase
{

    @Test
    public final void testArrayPersistence()
    {
        A a = new A();
        B b1 = new B();
        B b2 = new B();

        a.bs[0] = b1;;
        a.bs[1] = b2;;

        ds.save(b2, b1, a);

        a = ds.get(a);
    }

    public static class A extends TestEntity
    {
        /**
		 *
		 */
		private static final long serialVersionUID = 1L;
		@Reference
        B[] bs = new B[2];
    }

    public static class B extends TestEntity
    {
        /**
		 *
		 */
		private static final long serialVersionUID = 1L;
		String foo;
    }

}


text:
package com.spaceproject.systems;

import com.badlogic.ashley.core.Component;
import com.badlogic.ashley.core.Engine;
import com.badlogic.ashley.core.Entity;
import com.badlogic.ashley.core.Family;
import com.badlogic.ashley.systems.IteratingSystem;
import com.badlogic.ashley.utils.ImmutableArray;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType;
import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.InputListener;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.Disposable;
import com.spaceproject.SpaceProject;
import com.spaceproject.components.AsteroidBeltComponent;
import com.spaceproject.components.OrbitComponent;
import com.spaceproject.components.PhysicsComponent;
import com.spaceproject.components.TextureComponent;
import com.spaceproject.components.TransformComponent;
import com.spaceproject.config.DebugConfig;
import com.spaceproject.config.KeyConfig;
import com.spaceproject.generation.FontFactory;
import com.spaceproject.generation.TextureFactory;
import com.spaceproject.math.MyMath;
import com.spaceproject.screens.GameScreen;
import com.spaceproject.ui.debug.DebugText;
import com.spaceproject.ui.debug.DebugVec;
import com.spaceproject.ui.debug.ECSExplorerWindow;
import com.spaceproject.utility.DebugUtil;
import com.spaceproject.utility.ECSUtil;
import com.spaceproject.utility.Mappers;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Set;

public class DebugSystem extends IteratingSystem implements Disposable {

    private static final DebugConfig debugCFG = SpaceProject.configManager.getConfig(DebugConfig.class);
    private static final KeyConfig keyCFG = SpaceProject.configManager.getConfig(KeyConfig.class);

    private ECSExplorerWindow engineView;

    //rendering
    private static OrthographicCamera cam;
    private final SpriteBatch batch;
    private final ShapeRenderer shape;
    private final Matrix4 projectionMatrix;
    private final BitmapFont fontSmall, fontLarge;
    private final Box2DDebugRenderer debugRenderer;
    private final Vector3 tempProjVector = new Vector3(); //for (un)/projecting screen coords

    //textures
    private final Texture texCompBack = TextureFactory.createTile(Color.GRAY);
    private final Texture texCompSeparator = TextureFactory.createTile(Color.RED);

    //entity storage
    private final Array<Entity> objects;

    private static final ArrayList<DebugText> debugTexts = new ArrayList<>();
    private static final ArrayList<DebugVec> debugVecs = new ArrayList<>();

    public DebugSystem() {
        super(Family.all(TransformComponent.class).get());

        cam = GameScreen.cam;
        batch = GameScreen.batch;
        shape = GameScreen.shape;
        projectionMatrix = new Matrix4();
        fontSmall = FontFactory.createFont(FontFactory.fontBitstreamVM, 10);
        fontLarge = FontFactory.createFont(FontFactory.fontBitstreamVMBold, 20);
        objects = new Array<>();

        debugRenderer = new Box2DDebugRenderer(
                debugCFG.drawBodies,
                debugCFG.drawJoints,
                debugCFG.drawAABBs,
                debugCFG.drawInactiveBodies,
                debugCFG.drawVelocities,
                debugCFG.drawContacts);

        GameScreen.getStage().addListener(new InputListener() {
            @Override
            public boolean keyDown(InputEvent event, int keycode) {
                super.keyDown(event, keycode);
                engineView.keyDown(event, keycode);
                return false;
            }

            @Override
            public boolean keyUp(InputEvent event, int keycode) {
                super.keyUp(event, keycode);
                return false;
            }

            @Override
            public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
                super.touchDown(event, x, y, pointer, button);
                return false;
            }
        });
    }

    @Override
    public void addedToEngine(Engine engine) {
        super.addedToEngine(engine);

        engineView = new ECSExplorerWindow(engine);
    }

    @Override
    public void update(float delta) {
        engineView.update();

        updateKeyToggles();

        //don't update if we aren't drawing
        if (!debugCFG.drawDebugUI) return;
        super.update(delta);

        //set projection matrix so things render using correct coordinates
        projectionMatrix.setToOrtho2D(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
        batch.setProjectionMatrix(projectionMatrix);
        shape.setProjectionMatrix(cam.combined);

        shape.begin(ShapeType.Line);
        {
            // draw ring to visualize orbit path
            if (debugCFG.drawOrbitPath)
                drawOrbitPath(true);

            if (debugCFG.drawMousePos)
                drawMouseLine();

            drawDebugVectors();
        }
        shape.end();

        //draw diagnostic info
        int diagnosticX = 15;
        int diagnosticY = Gdx.graphics.getHeight() - 15;

        batch.begin();
        {
            if (debugCFG.drawFPS)
                drawFPS(diagnosticX, diagnosticY);

            if (debugCFG.drawDiagnosticInfo)
                drawDiagnosticInfo(diagnosticX, diagnosticY);

            if (debugCFG.drawPos)
                drawEntityPositions();

            if (debugCFG.drawMousePos)
                drawMousePos();

            if (debugCFG.drawEntityList)
                drawEntityList();

            if (debugCFG.drawComponentList)
                drawComponentList();

            //render debug called from other systems
            drawDebugTexts(batch);
        }
        batch.end();

        if (debugCFG.box2DDebugRender)
            debugRenderer.render(GameScreen.box2dWorld, GameScreen.cam.combined);

        objects.clear();
    }

    @Override
    public void processEntity(Entity entity, float deltaTime) {
        objects.add(entity);
    }

    private void updateKeyToggles() {
        if (Gdx.input.isKeyPressed(Input.Keys.NUM_8)) {
            GameScreen.adjustGameTime(2000);
        }
        if (Gdx.input.isKeyPressed(Input.Keys.NUM_9)) {
            GameScreen.adjustGameTime(-2000);
        }

        if (Gdx.input.isKeyJustPressed(keyCFG.toggleEngineViewer)) {
            engineView.toggle();
        }

        if (Gdx.input.isKeyJustPressed(Input.Keys.F2)) {
            GameScreen.getStage().setDebugAll(!GameScreen.getStage().isDebugAll());
        }

        //toggle debug
        if (Gdx.input.isKeyJustPressed(keyCFG.toggleDebug)) {
            debugCFG.drawDebugUI = !debugCFG.drawDebugUI;
            Gdx.app.log(this.getClass().getSimpleName(), "DEBUG UI: " + debugCFG.drawDebugUI);
        }

        //toggle pos
        if (Gdx.input.isKeyJustPressed(keyCFG.togglePos)) {
            debugCFG.drawPos = !debugCFG.drawPos;
            if (debugCFG.drawComponentList) {
                debugCFG.drawComponentList = false;
            }
            Gdx.app.log(this.getClass().getSimpleName(), "[debug] draw pos: " + debugCFG.drawPos);
        }

        //toggle components
        if (Gdx.input.isKeyJustPressed(keyCFG.toggleComponents)) {
            debugCFG.drawComponentList = !debugCFG.drawComponentList;
            if (debugCFG.drawPos) {
                debugCFG.drawPos = false;
            }
            Gdx.app.log(this.getClass().getSimpleName(), "[debug] draw component list: " + debugCFG.drawComponentList);
        }

        //toggle bounds
        if (Gdx.input.isKeyJustPressed(keyCFG.toggleBounds)) {
            debugCFG.box2DDebugRender = !debugCFG.box2DDebugRender;
            Gdx.app.log(this.getClass().getSimpleName(), "[debug] draw bounds: " + debugCFG.box2DDebugRender);
        }

        //toggle fps
        if (Gdx.input.isKeyJustPressed(keyCFG.toggleFPS)) {
            debugCFG.drawFPS = !debugCFG.drawFPS;
            Gdx.app.log(this.getClass().getSimpleName(), "[debug] draw FPS: " + debugCFG.drawFPS);
        }

        //toggle orbit circle
        if (Gdx.input.isKeyJustPressed(keyCFG.toggleOrbit)) {
            debugCFG.drawOrbitPath = !debugCFG.drawOrbitPath;
            Gdx.app.log(this.getClass().getSimpleName(), "[debug] draw orbit path: " + debugCFG.drawOrbitPath);
        }

        //toggle vector
        if (Gdx.input.isKeyJustPressed(keyCFG.toggleVector)) {
            debugCFG.drawVelocities = !debugCFG.drawVelocities;
            Gdx.app.log(this.getClass().getSimpleName(), "[debug] draw vectors: " + debugCFG.drawVelocities);
        }

        debugRenderer.setDrawVelocities(debugCFG.drawVelocities);
        debugRenderer.setDrawBodies(debugCFG.drawBodies);
        debugRenderer.setDrawJoints(debugCFG.drawJoints);
        debugRenderer.setDrawAABBs(debugCFG.drawAABBs);
        debugRenderer.setDrawInactiveBodies(debugCFG.drawInactiveBodies);
        debugRenderer.setDrawVelocities(debugCFG.drawVelocities);
        debugRenderer.setDrawContacts(debugCFG.drawContacts);
    }

    private void drawFPS(int x, int y) {
        int fps = Gdx.graphics.getFramesPerSecond();
        Color fpsColor = fps >= 120 ? Color.SKY : fps > 45 ? Color.WHITE : fps > 30 ? Color.YELLOW : Color.RED;
        fontLarge.setColor(fpsColor);
        fontLarge.draw(batch, Integer.toString(fps), x, y);
    }

    private void drawDiagnosticInfo(int x, int y) {
        //camera position
        String camera = String.format("Pos: %s %s  Zoom:%3$.2f", (int) cam.position.x, (int) cam.position.y, cam.zoom);

        //memory
        String memory = DebugUtil.getMemory();

        //entity/component count
        String count = ECSUtil.getECSString(getEngine());

        //threads
        Set<Thread> threadSet = Thread.getAllStackTraces().keySet();
        String threads = "  Threads: " + threadSet.size();

        int sbCalls = GameScreen.batch.renderCalls;

        int linePos = 1;
        float lineHeight = fontLarge.getLineHeight();
        fontLarge.setColor(Color.WHITE);
        fontLarge.draw(batch, count, x, y - (lineHeight * linePos++));
        fontLarge.draw(batch, memory + threads, x, y - (lineHeight * linePos++));
        fontLarge.draw(batch, camera, x, y - (lineHeight * linePos++));
        fontLarge.draw(batch, "time: " + MyMath.formatDuration(GameScreen.getGameTimeCurrent())
                        + " (" + GameScreen.getGameTimeCurrent() + ")", Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() - 10);
        fontLarge.draw(batch, "seed: " + GameScreen.getGalaxySeed(), Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() - 10 - lineHeight);

        if (!GameScreen.inSpace()) {
            fontLarge.draw(batch, "planet: " + GameScreen.getPlanetSeed(),
                    Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() - 10 - lineHeight * 2);
        }

        //view threads
        String noisePool = GameScreen.noiseManager.getNoiseThreadPool().toString();
        fontSmall.draw(batch, noisePool, x, y - (lineHeight * linePos++));
        for (Thread t : threadSet) {
            fontSmall.draw(batch, t.toString(), x, y - (lineHeight * linePos++));
        }
    }

    private void drawEntityList() {
        float fontHeight = fontSmall.getLineHeight();
        int x = 30;
        int y = 30;
        int i = 0;
        for (Entity entity : getEngine().getEntities()) {
            fontSmall.draw(batch, Integer.toHexString(entity.hashCode()), x, y + (fontHeight * i++));
        }
    }

    /** Draw all Entity components and fields */
    private void drawComponentList() {
        // todo: this is a very heavy method, consider frustrum culling: if object is offscreen do not render!
        float fontHeight = fontSmall.getLineHeight();
        int backWidth = 400;//width of background

        fontSmall.setColor(1, 1, 1, 1);

        for (Entity entity : objects) {
            //get entities position and list of components
            TransformComponent t = Mappers.transform.get(entity);
            ImmutableArray<Component> components = entity.getComponents();

            //use Vector3.cpy() to project only the position and avoid modifying projection matrix for all coordinates
            tempProjVector.set(t.pos.cpy(), 0);
            Vector3 screenPos = cam.project(tempProjVector);

            //calculate spacing and offset for rendering
            int fields = 0;
            for (Component c : components) {
                fields += c.getClass().getFields().length;
            }
            float yOffset = fontHeight * fields / 2;
            int curLine = 0;

            //draw all components/fields
            for (Component c : components) {
                //save component line to draw name
                float compLine = curLine;

                //draw all fields
                for (Field f : c.getClass().getFields()) {
                    float yOffField = screenPos.y - (fontHeight * curLine) + yOffset;
                    batch.draw(texCompBack, screenPos.x, yOffField, backWidth, -fontHeight);
                    try {
                        fontSmall.draw(batch, String.format("%-14s %s", f.getName(), f.get(c)), screenPos.x + 130, yOffField);
                    } catch (IllegalArgumentException e) {
                        e.printStackTrace();
                    } catch (IllegalAccessException e) {
                        e.printStackTrace();
                    }
                    curLine++;
                }

                //draw backing on empty components
                if (c.getClass().getFields().length == 0) {
                    batch.draw(texCompBack, screenPos.x, screenPos.y - (fontHeight * curLine) + yOffset, backWidth, -fontHeight);
                    curLine++;
                }

                //draw separating line
                batch.draw(texCompSeparator, screenPos.x, screenPos.y - (fontHeight * curLine) + yOffset, backWidth, 1);

                //draw component name
                float yOffComp = screenPos.y - (fontHeight * compLine) + yOffset;
                fontSmall.draw(batch, "[" + c.getClass().getSimpleName() + "]", screenPos.x, yOffComp);
            }
        }

    }

    private void drawEntityPositions() {
        fontSmall.setColor(1, 1, 1, 1);
        for (Entity entity : objects) {
            TransformComponent t = Mappers.transform.get(entity);

            //String vel = " ~ " + MyMath.round(t.velocity.len(), 1);
            String info = MyMath.round(t.pos.x, 1) + "," + MyMath.round(t.pos.y, 1);

            tempProjVector.set(t.pos.cpy(), 0);
            Vector3 screenPos = cam.project(tempProjVector);
            fontSmall.draw(batch, Integer.toHexString(entity.hashCode()), screenPos.x, screenPos.y);
            fontSmall.draw(batch, info, screenPos.x, screenPos.y-10);
        }
    }

    private void drawMousePos() {
        //get mouse coords
        int x = Gdx.input.getX();
        int y = Gdx.graphics.getHeight() - Gdx.input.getY();

        //convert to game world coords
        tempProjVector.set(x, y , 0);
        Vector3 worldPos = cam.unproject(tempProjVector);

        String location = x + "," + y + "\n" + MyMath.formatVector3as2(worldPos, 1);
        //location += "\n" +  MyMath.getSeed(worldPos.x, worldPos.y);//calculate seed for position if used
        fontSmall.draw(batch, location, x, y);
    }

    private void drawMouseLine() {
        int crossHairSize = 32;
        Color mouseLineColor = Color.WHITE;

        int x = Gdx.input.getX();
        int y = Gdx.input.getY();
        tempProjVector.set(x, y, 0);
        Vector3 worldPos = cam.unproject(tempProjVector);
        shape.setColor(mouseLineColor);
        shape.line(worldPos.x, worldPos.y + crossHairSize, worldPos.x, worldPos.y - crossHairSize);
        shape.line(worldPos.x + crossHairSize, worldPos.y, worldPos.x - crossHairSize, worldPos.y);
    }

    /** Draw lines to represent speed and direction of entity */
    private void drawVelocityVectors() {
        for (Entity entity : objects) {
            //get entities position and list of components
            PhysicsComponent t = Mappers.physics.get(entity);
            if (t != null && t.body != null) {
                float scale = 2.0f; //how long to make vectors (higher number is longer line)
                Vector2 end = MyMath.logVec(t.body.getLinearVelocity(), scale).add(t.body.getPosition());

                //draw line to represent movement
                debugVecs.add(new DebugVec(t.body.getPosition(), end, Color.RED, Color.MAGENTA));
            }
        }
    }

    /** Draw orbit path, a ring to visualize objects orbit  */
    private void drawOrbitPath(boolean showSyncedPos) {
        Color orbitObjectColor = new Color(1, 1, 1, 1);
        Color orbitSyncPosColor = new Color(1, 0, 0, 1);

        for (Entity entity : objects) {

            OrbitComponent orbit = Mappers.orbit.get(entity);
            if (orbit != null) {
                TransformComponent entityPos = Mappers.transform.get(entity);

                if (orbit.parent != null) {
                    TransformComponent parentPos = Mappers.transform.get(orbit.parent);

                    if (showSyncedPos) {
                        //synced orbit position (where the object should be)
                        Vector2 orbitPos = OrbitSystem.getTimeSyncedPos(orbit, GameScreen.getGameTimeCurrent());
                        shape.setColor(orbitSyncPosColor);
                        shape.line(parentPos.pos.x, parentPos.pos.y, orbitPos.x, orbitPos.y);
                    }

                    //actual position
                    shape.setColor(orbitObjectColor);
                    shape.circle(parentPos.pos.x, parentPos.pos.y, orbit.radialDistance);
                    shape.line(parentPos.pos.x, parentPos.pos.y, entityPos.pos.x, entityPos.pos.y);
                }

                TextureComponent tex = Mappers.texture.get(entity);
                if (tex != null) {
                    float radius = tex.texture.getWidth() * 0.5f * tex.scale;
                    Vector2 orientation = MyMath.vector(entityPos.rotation, radius).add(entityPos.pos);
                    shape.setColor(orbitObjectColor);
                    shape.line(entityPos.pos.x, entityPos.pos.y, orientation.x, orientation.y);
                    shape.circle(entityPos.pos.x, entityPos.pos.y, radius);
                }
            }

            AsteroidBeltComponent stellarDisk = Mappers.asteroidBelt.get(entity);
            if (stellarDisk != null) {
                Vector2 pos = Mappers.transform.get(entity).pos;
                shape.setColor(Color.LIME);
                shape.circle(pos.x, pos.y, stellarDisk.radius);
                shape.setColor(Color.PURPLE);
                shape.circle(pos.x, pos.y, stellarDisk.radius - (stellarDisk.bandWidth / 2));
                shape.circle(pos.x, pos.y, stellarDisk.radius + (stellarDisk.bandWidth / 2));
            }

        }
    }

    //region external debug util
    public static void addDebugVec(Vector2 pos, Vector2 vec, Color color) {
        float scale = 20; //how long to make vectors (higher number is longer line)
        Vector2 end = MyMath.logVec(vec, scale).add(pos);
        debugVecs.add(new DebugVec(pos, end, color));
    }

    private void drawDebugVectors() {
        for (DebugVec debugVec : debugVecs) {
            shape.line(debugVec.vecA.x, debugVec.vecA.y, debugVec.vecB.x, debugVec.vecB.y, debugVec.colorA, debugVec.colorB);
        }
        debugVecs.clear();
    }

    public static void addDebugText(String text, float x, float y) {
        addDebugText(text, x, y, false);
    }

    static Vector3 tempProj = new Vector3();
    public static void addDebugText(String text, float x, float y, boolean project) {
        if (project) {
            tempProj.set(x, y, 0);
            Vector3 screenPos = cam.project(tempProj);
            x = screenPos.x;
            y = screenPos.y;
        }
        //todo: pooling or some way to use of new here
        debugTexts.add(new DebugText(text, x, y));
    }

    private void drawDebugTexts(SpriteBatch batch) {
        for (DebugText t : debugTexts) {
            if (t.font == null) {
                fontSmall.setColor(t.color);
                fontSmall.draw(batch, t.text, t.x, t.y);
            } else {
                t.font.setColor(t.color);
                t.font.draw(batch, t.text, t.x, t.y);
            }
        }
        debugTexts.clear();
    }
    //endregion

    @Override
    public void dispose() {
        texCompBack.dispose();
        texCompSeparator.dispose();
        fontSmall.dispose();
        fontLarge.dispose();

        getEngine().removeEntityListener(engineView);
    }

}


text:
<?php
/**
 * The Header template.
 */
$top_mag_options = get_option( 'topmag_theme_options' );
?>
<!DOCTYPE html>

<html <?php language_attributes(); ?>>

<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width">
<title>
<?php wp_title(); ?>
</title>
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php if(!empty($top_mag_options['favicon'])) { ?>
<link rel="shortcut icon" href="<?php echo esc_url($top_mag_options['favicon']);?>">
<?php } ?>
<?php wp_head(); ?>

<body <?php body_class(); ?>>

        <?php if(empty($top_mag_options['logo'])) { echo '
'.get_bloginfo('name').'
';  } else { ?>
        <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><img src="<?php echo esc_url($top_mag_options['logo']); ?>" alt="<?php _e('site logo','top-mag'); ?>" class="img-responsive" />
        <?php } ?>

          <?php if(!empty($top_mag_options['logo-tagline'])) { echo get_bloginfo('description'); } ?>

		<?php if(!empty($top_mag_options['display-banner'])) { ?>

            	<?php if(empty($top_mag_options['banner-html']) && !empty($top_mag_options['banner-ads'])) {
						if(!empty($top_mag_options['banneradslink'])) {	?>
                		<a href="<?php echo esc_url($top_mag_options['banneradslink']); ?>" target="_blank"><img width="860" height="90" src="<?php echo $top_mag_options['banner-ads']; ?>" class="img-responsive" />
                <?php } else { ?>
                		<img width="860" height="90" src="<?php echo esc_url($top_mag_options['banner-ads']); ?>" class="img-responsive" />
				<?php }
				} else {
					echo esc_html($top_mag_options['banner-html']);
		  } ?>

        <?php } ?>

          <button type="button" data-target="#navbarCollapse" data-toggle="collapse" class="navbar-toggle">
          <?php _e('Toggle navigation','top-mag'); ?>
              </button>
          <a href="<?php echo site_url(); ?>" class="home-icon"><img src="<?php echo get_template_directory_uri(); ?>/images/home.png" alt="home icon" />

          <?php
				$top_mag_menu_args = array(
							'theme_location'  => 'primary',
							'container'       => 'div',
							'container_class' => '',
							'container_id'    => '',
							'menu_class'      => 'menu-header-menu-container',
							'menu_id'         => '',
							'echo'            => true,
							'fallback_cb'     => 'wp_page_menu',
							'before'          => '',
							'after'           => '',
							'link_before'     => '',
							'link_after'      => '',
							'items_wrap'      => '
%3$s
',
							'depth'           => 0,
				);

				wp_nav_menu( $top_mag_menu_args );

		?>

<?php top_mag_breaking_news(); ?>


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

<TITLE>
TableModels (OpenXava 4.9.1 API)
</TITLE>

<META NAME="keywords" CONTENT="org.openxava.util.TableModels class">

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

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.openxava.util

Class TableModels

java.lang.Object
  org.openxava.util.TableModels

public class TableModels
extends java.lang.Object

Author:

Javier Paniza, Trifon Trifonov

Constructor Summary

TableModels()

Method Summary

static void
saveCSV(javax.swing.table.TableModel table,
        java.lang.String file)

static java.lang.String
toCSV(javax.swing.table.TableModel table)

Methods inherited from class java.lang.Object

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

Constructor Detail

TableModels

public TableModels()

Method Detail

toCSV

public static java.lang.String toCSV(javax.swing.table.TableModel table)

saveCSV

public static void saveCSV(javax.swing.table.TableModel table,
                           java.lang.String file)
                    throws java.io.IOException

Throws:

java.io.IOException

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
/* -*- mode: c -*- */

/* Author:   Huanghao@cellcom
 * Date:     2005/09/29 14:04:52
 * Revision: 0.0.1
 * Function:
 * Usage:
 */

#ifndef __RAD_UTIL_H__
#define __RAD_UTIL_H__

#include <stdarg.h>

#include <radutil/radplatform.h>
#include <radutil/radtypes.h>
#include <radutil/raddebug.h>
#include <radutil/radposix.h>
#include <radutil/radmacros.h>
#include <radutil/radcommon.h>
#include <radutil/radlog.h>
#include <radutil/radslist.h>
#include <radutil/radheaptrack.h>
#include <radutil/radarray.h>
#include <radutil/radtoken.h>
#include <radutil/radconffile.h>
#include <radutil/radipc.h>

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/* just like strncpy, but dst is always null terminated. */
char* strNcpy(char* dst, const char* src, size_t len);
char* strNcat(char* dst, const char* src, size_t len);
/* just like snprintf, but str is always null terminaed. */
int sNprintf(char* str, size_t len, const char* fmt, ...);
int vsNprintf(char* str, size_t len, const char* fmt, va_list args);
int trim_adjust(char** pcstr, const char* delims);
uint32_t ip_getaddr(const char *host);
char    *ip_ntoa(char *buffer, uint32_t ipaddr);
uint32_t ip_addr(const char *ip_str);
char    *ip_hostname(char *buf, size_t buflen, uint32_t ipaddr);
int print_file(const char* filename, const char* format, ...);
char* strRepl(char* dst, size_t n,
              const char* src, const LRAD_NAME_MAP* table);

#ifdef __cplusplus
}
#endif /* __cplusplus */

RAD_EXTERN_C int     librad_dodns;

#endif /* __RAD_UTIL_H__ */


text:
package io.netty.buffer;

import org.junit.Test;

import static org.junit.Assert.*;

public abstract class AbstractPooledByteBufTest extends AbstractByteBufTest {

    private ByteBuf buffer;

    protected abstract ByteBuf alloc(int length);

    @Override
    protected ByteBuf newBuffer(int length) {
        buffer = alloc(length);
        assertEquals(0, buffer.writerIndex());
        assertEquals(0, buffer.readerIndex());
        return buffer;
    }

    @Override
    protected ByteBuf[] components() {
        return new ByteBuf[] { buffer };
    }

    @Test
    public void testDiscardMarks() {
        testDiscardMarks(4);
    }

    @Test
    public void testDiscardMarksUnpooled() {
        testDiscardMarks(32 * 1024 * 1024);
    }

    private void testDiscardMarks(int capacity) {
        ByteBuf buf = newBuffer(capacity);
        buf.writeShort(1);

        buf.skipBytes(1);

        buf.markReaderIndex();
        buf.markWriterIndex();
        assertTrue(buf.release());

        ByteBuf buf2 = newBuffer(capacity);

        assertSame(unwrapIfNeeded(buf), unwrapIfNeeded(buf2));

        buf2.writeShort(1);

        buf2.resetReaderIndex();
        buf2.resetWriterIndex();

        assertEquals(0, buf2.readerIndex());
        assertEquals(0, buf2.writerIndex());
        assertTrue(buf2.release());
    }

    private static ByteBuf unwrapIfNeeded(ByteBuf buf) {
        if (buf instanceof AdvancedLeakAwareByteBuf || buf instanceof SimpleLeakAwareByteBuf) {
            return buf.unwrap();
        }
        return buf;
    }
}


text:
package com.obidea.semantika.database.datatype;

public abstract class AbstractSqlType<T> implements ISqlDatatype<T>
{
   private final String mName;

   protected AbstractSqlType(String name)
   {
      if (name == null) {
         throw new NullPointerException();
      }
      mName = name;
   }

   public String getName()
   {
      return mName;
   }

   @Override
   public boolean equals(Object obj)
   {
      // Note that this implementation assumes singleton classes for each datatype
      if (this == obj) {
         return true;
      }
      if (obj == null) {
         return false;
      }
      if (getClass() != obj.getClass()) {
         return false;
      }
      return true;
   }

   @Override
   public int hashCode()
   {
      return mName.hashCode();
   }
}


text:
<?php
namespace App\MainLanding;

use App\Image\Image;
use Core\Page\AbstractWebPage;
use Imagine\Image\Palette\RGB;
use Imagine\Image\Point;
use Imagine\Imagick\Imagine;

/**
 * Класс описания главной страницы.
 * @author Andrey Mostovoy <stalk.4.me@gmail.com>
 */
class MainLandingPage extends AbstractWebPage {
    private $coeffX = 3.84;
    private $coeffY = 3.84;

    /**
     * {@inheritdoc}
     */
    public function run() {
        if (isset($_POST['save'])) {
            $this->handleSaveImage();
        }

        if (isset($_GET['download'])) {
            $this->handleDownloadImage();
        }

        $category = $this->getArg('category');
        $image = $this->getArg('image');

        $this->addToJs('category', $category);
        $this->addToJs('image', $image);
        $this->bind('workUrl', IMAGE_WORK_THUMB_PATH . Image::getName($category, $image));

        return true;
    }

    /**
     * Обработаем создание нового изображения для дальнейшего скачивания пользователем.
     */
    private function handleSaveImage() {
        $items = $_POST['items'];
        $category = $_POST['cat'];
        $image = $_POST['img'];
        $fileName = Image::getName($category, $image);

        $Palette = new RGB();
        $Imagine = new Imagine();

        $Image = $Imagine->open(IMG_1920x1080 . $fileName);

        foreach ($items as $item) {
            $text = $item['text'];
            $fontSize = $item['fontSize'];
            $x = $item['relativeX'];
            $y = $item['relativeY'];

            $sizedFontSize = ($fontSize * 1920) / 500;
            $sizedX = $this->coeffX * $x;
            $sizedY = $this->coeffY * $y;

            $Font = $Imagine->font(FONT_DIR . 'Arial.ttf', $sizedFontSize, $Palette->color($item['color']));
            $Position = new Point($sizedX, $sizedY);
            $angle = rad2deg($item['angle']);

            $Image->draw()->text($text, $Font, $Position, $angle);
        }

        $id = uniqid();
        $filePath = IMG_DOWNLOAD . $id . Image::EXTENSION;
        $Image->save($filePath);

        header('Content-Type: application/json; charset=utf8');
        echo json_encode(['id' => $id], JSON_UNESCAPED_UNICODE);

        exit();
    }

    /**
     * Отдаем юзеру готовое изображение.
     */
    private function handleDownloadImage() {
        $id = $_GET['download'];
        $fileDir = IMG_DOWNLOAD . $id . Image::EXTENSION;

        header('Cache-Control: public');
        header('Content-Description: File Transfer');
        header('Content-Disposition: attachment; filename=' . basename($fileDir));
        header('Content-Type: image/jpeg');// . mime_content_type($fileDir));
        header('Content-Transfer-Encoding: binary');
        header('Content-Length: ' . filesize($fileDir));

        readfile($fileDir);

        unlink($fileDir);

        exit();
    }
}


text:
package io.trydent.stp.tax;

import io.trydent.stp.SalesTaxException;

import java.util.Optional;

public final class Rate {
  public static final double MIN = 1d;
  public static final double MAX = 100d;

  private final double value;

  private Rate(double value) {
    this.value = value;
  }

  public final double value() { return this.value; }

  public static Rate of(final double rate) {
    return Optional.of(rate)
      .filter(r -> r >= MIN && r <= MAX)
      .map(Rate::new)
      .orElseThrow(SalesTaxException::new);
  }
}


text:
"""Wikipedia-based Image Text (WIT) Dataset for the Kaggle competition."""
from __future__ import annotations

import base64
import csv
import functools
import gzip
import io
import sys
from typing import List, Optional

import numpy as np
from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow as tf
import tensorflow_datasets.public_api as tfds

_DESCRIPTION = """
Wikipedia - Image/Caption Matching Kaggle Competition.

This competition is organized by the
[Research team](https://research.wikimedia.org/) at the
[Wikimedia Foundation](https://wikimediafoundation.org/) in collaboration with
Google Research and a few external collaborators.
This competition is based on the
[WIT dataset](https://github.com/google-research-datasets/wit) published by
Google Research as detailed in this\
[SIGIR paper](https://dl.acm.org/doi/abs/10.1145/3404835.3463257).

In this competition, you'll build a model that automatically retrieves the text
closest to an image. Specifically, you'll train your model to associate given
images with article titles or complex captions, in multiple languages.
The best models will account for the semantic granularity of Wikipedia images.
If successful, you'll be contributing to the accessibility of the largest
online encyclopedia. The millions of Wikipedia readers and edietors will be able
to more easily understand, search, and describe media at scale. As a result,
you'll contribute to an open model to improve learning for all.
"""

_CITATION = """
@article{srinivasan2021wit,
  title={WIT: Wikipedia-based Image Text Dataset for Multimodal Multilingual Machine Learning},
  author={Srinivasan, Krishna and Raman, Karthik and Chen, Jiecao and Bendersky, Michael and Najork, Marc},
  journal={arXiv preprint arXiv:2103.01913},
  year={2021}
}
"""

_EMPTY_IMAGE_BYTES = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z/C/HgAGgwJ/lK3Q6wAAAABJRU5ErkJggg=="

_BEAM_NAMESPACE = "TFDS_WIT_KAGGLE"

class WitKaggleConfig(tfds.core.BuilderConfig):
  """BuilderConfig for WitKaggle."""

  def __init__(
      self,
      *,
      sample_files: Optional[List[str]] = None,
      image_folder: Optional[str] = None,
      split_specific_features: Optional[tfds.features.FeaturesDict] = None,
      resnet_embedding_shape: int = 2048,
      **kwargs):
    """BuilderConfig for WitKaggle.

    Args:
      sample_files: list of paths to the sample files.
      image_folder: path to the folder where image data lies.
      split_specific_features: tfds.features.FeaturesDict. The features for the
        specific WitKaggle split.
      resnet_embedding_shape: shape of resnet embeddings.
      **kwargs: keyword arguments forwarded to super.
    """
    super(WitKaggleConfig, self).__init__(**kwargs)
    self.sample_files = sample_files
    self.image_folder = image_folder

    # Features common to all configs.
    common_features = tfds.features.FeaturesDict({
        "caption_title_and_reference_description":
            tfds.features.Text(
            ),  # Caption for the image_url (if existent, else '').
        "image_url":
            tfds.features.Text(),
        "image":
            tfds.features.Image(
            ),  # Base64 encoded image bytes (if existent, else a blank image).
        "metadata_url":
            tfds.features.Text(
            ),  # Url to the image's commons page (if existent, else '').
        "embedding":
            tfds.features.Tensor(
                shape=(resnet_embedding_shape,), dtype=np.float32
            ),  # A tensor of 2048 floats (if existent, else zeros).
    })
    self.features = tfds.features.FeaturesDict({
        **common_features,
        **split_specific_features
    })
    self.split_specific_features = split_specific_features
    self.resnet_embedding_shape = resnet_embedding_shape
    # For missing images, we use a zeroed vector of dimensionality (2048,) as
    # resnet embedding.
    self.empty_resnet_embedding = [0] * resnet_embedding_shape

class WitKaggle(tfds.core.GeneratorBasedBuilder):
  """DatasetBuilder for wit_kaggle dataset."""

  VERSION = tfds.core.Version("1.0.1")
  RELEASE_NOTES = {
      "1.0.1":
          "Optimize Beam pipeline to avoid strugglers, ignoring rows without "
          "an image URL. Also added more Beam counters.",
      "1.0.0":
          """Initial release. It provides the train and test datasets from the
      Wikipedia - Image/Caption Matching Kaggle competition
      (https://www.kaggle.com/c/wikipedia-image-caption/data).

      The goal of the competition is to build a model that automatically
      retrieves the text closest to an image. Specifically, the model shuld be
      trained to associate given images with article titles or complex captions,
      in multiple languages. The best models will account for the semantic
      granularity of Wikipedia images.

      Note that this release doesn't provide the ground truth for the test set,
      as it hasn't been provided by the Kaggle competition yet.

      Note that not all of the training observations have corresponding image
      data. The released images exclude all images containing humans. For
      samples which are not associated with image data, the following image
      features are used: `image` is a byte-64 encoded blank image, `embedding`
      is a vector of 2048 zeros.

      The samples released for the competition can be loaded as:
      ```
      tfds.load("wit_kaggle/train_with_extended_features")
      tfds.load("wit_kaggle/test_without_gold")
      ```
      """,
  }

  # pytype: disable=wrong-keyword-args
  # In the Wikipedia - Image/Caption Matching competition, train samples are
  # associated with a rich set of metadata, while test samples only have a
  # sample_id and four image-related fields.
  BUILDER_CONFIGS = [
      WitKaggleConfig(
          name="train_with_extended_features",
          description="Training samples for the Wikipedia-Image/Caption Matching competition.",
          sample_files=[
              f"train/train-0000{i}-of-00005.tsv.zip" for i in range(5)
          ],
          image_folder="train/image_data_train",
          split_specific_features=tfds.features.FeaturesDict({
              "language": tfds.features.Text(),
              "page_url": tfds.features.Text(),
              "image_url": tfds.features.Text(),
              "page_title": tfds.features.Text(),
              "section_title": tfds.features.Text(),
              "hierarchical_section_title": tfds.features.Text(),
              "caption_reference_description": tfds.features.Text(),
              "caption_attribution_description": tfds.features.Text(),
              "caption_alt_text_description": tfds.features.Text(),
              "mime_type": tfds.features.Text(),
              "original_height": np.int32,
              "original_width": np.int32,
              "is_main_image": np.bool_,
              "attribution_passes_lang_id": np.bool_,
              "page_changed_recently": np.bool_,
              "context_page_description": tfds.features.Text(),
              "context_section_description": tfds.features.Text(),
              "caption_title_and_reference_description": tfds.features.Text(),
          })),
      WitKaggleConfig(
          name="test_without_gold",
          description="Test samples (without gold answers) for the Wikipedia-Image/Caption Matching competition.",
          sample_files=["test/test.tsv.zip"],
          image_folder="test/image_data_test",
          split_specific_features=tfds.features.FeaturesDict({
              "id": tfds.features.Text(),
              "image_url": tfds.features.Text(),
          })),
  ]
  # pytype: enable=wrong-keyword-args

  MANUAL_DOWNLOAD_INSTRUCTIONS = """
  Depending on the config called, manual_dir should contain some of the
  following subdirectories:
    * train
      - train-{0000x}-of-00005.tsv.zip
      - image_data_train/
        * image_pixels/
          - train_image_pixels_part-00{000-199}.csv.gz
        * resnet_embeddings/
          - train_resnet_embeddings_part-00{000-214}.csv.gz
    * test
      - test.tsv.zip
      - image_data_test/
        * image_pixels/
          - test_image_pixels_part-0000{0-4}.csv
        * resnet_embeddings/
          - test_resnet_embeddings_part-0000{0-9}.csv

  Registration at https://www.kaggle.com/c/wikipedia-image-caption/data
  is needed to get the links to download the dataset.
  """

  def _info(self) -> tfds.core.DatasetInfo:
    """Returns the dataset metadata."""
    return tfds.core.DatasetInfo(
        builder=self,
        description=_DESCRIPTION,
        features=self.builder_config.features,
        supervised_keys=("image_url",
                         "caption_title_and_reference_description"),
        homepage="https://www.kaggle.com/c/wikipedia-image-caption/code",
        citation=_CITATION,
    )

  def _split_generators(self, dl_manager, pipeline):
    """Returns SplitGenerators."""
    archive_path = {
        "samples": [
            tfds.download.Resource(  # pylint:disable=g-complex-comprehension
                path=dl_manager.manual_dir / filename,
                extract_method=tfds.download.ExtractMethod.ZIP)
            for filename in self.builder_config.sample_files
        ],
        "images":
            tfds.download.Resource(path=dl_manager.manual_dir /
                                   self.builder_config.image_folder),
    }

    extracted_paths = dl_manager.extract(archive_path)

    return {
        self.builder_config.name:
            self._generate_examples(
                pipeline=pipeline,
                samples_path=extracted_paths["samples"],
                image_pixels_path=extracted_paths["images"] / "image_pixels",
                image_resnet_path=extracted_paths["images"] /
                "resnet_embeddings")
    }

  def _generate_examples(self, pipeline, samples_path, image_pixels_path,
                         image_resnet_path):
    """Processes the dataset and yields examples.

    Args:
      pipeline: the beam pipeline.
      samples_path: path to the split's sentences.
      image_pixels_path: path to the images' pixel representations.
      image_resnet_path: path to the images' pixel representations.

    Returns:
      Examples.
    """
    beam = tfds.core.lazy_imports.apache_beam
    counter = functools.partial(beam.metrics.Metrics.counter, _BEAM_NAMESPACE)

    def _get_csv_reader(filename):
      if filename.suffix == ".gz":
        counter("gz_csv_files").inc()
        g = tf.io.gfile.GFile(filename, "rb")
        f = gzip.open(g, "rt", newline="")
      else:
        counter("normal_csv_files").inc()
        f = tf.io.gfile.GFile(filename, "r")
      # Limit to 100 MB. Value must be smaller than the C long maximum value.
      csv.field_size_limit(sys.maxsize)
      return csv.reader(f, delimiter="\t")

    def _read_pixel_rows(filename):
      r"""Contains image_url \t image_pixel \t metadata_url."""
      reader = _get_csv_reader(filename)
      for row in reader:
        counter("pixel_rows").inc()
        image_url, image_representation, metadata_url = row
        if image_url:
          yield [image_url, (image_representation, metadata_url)]
        else:
          counter("pixel_rows_no_image_url").inc()

    def _read_resnet_rows(filename):
      r"""Contains image_url \t resnet_embedding."""
      reader = _get_csv_reader(filename)
      for row in reader:
        counter("resnet_rows").inc()
        image_url, image_representation = row
        if image_url:
          yield [image_url, image_representation]
        else:
          counter("resnet_rows_no_image_url").inc()

    def _read_samples_rows(folder_path):
      """Contains samples: train and test have different fields."""
      for filename in tf.io.gfile.listdir(folder_path):
        file_path = folder_path / filename
        f = tf.io.gfile.GFile(file_path, "r")
        # Limit to 100 MB. Value must be smaller than the C long maximum value.
        csv.field_size_limit(sys.maxsize)
        csv_reader = csv.DictReader(f, delimiter="\t", quoting=csv.QUOTE_ALL)
        for row in csv_reader:
          counter("samples_rows").inc()
          sample = {
              feature_key: row[feature_key] for feature_key in
              self.builder_config.split_specific_features.keys()
          }
          image_url = row["image_url"]
          if image_url:
            yield [image_url, sample]
          else:
            counter("samples_rows_no_image_url").inc()

    def _process_examples(el):
      sample_url, sample_fields = el
      # Each image_url can be associated with multiple samples (e.g., multiple
      # languages).
      for i, sample_info in enumerate(sample_fields["sample_info"]):
        sample_id = f"{i}_{sample_url}"
        sample = {"image_url": sample_url}
        for feature_key in self.builder_config.split_specific_features.keys():
          sample[feature_key] = sample_info[feature_key]
        # Test samples don't have gold captions.
        if "caption_title_and_reference_description" not in sample_info:
          sample["caption_title_and_reference_description"] = ""

        # We output image data only if there is at least one image
        # representation per image_url.
        # Not all of the samples in the competition have corresponding image
        # data. In case multiple different image representations are associated
        # with the same image_url, we don't know which one is correct and don't
        # output any.
        if len(set(sample_fields["image_pixels"])) == 1:
          sample_image, sample_metadata = sample_fields["image_pixels"][0]
          sample["image"] = io.BytesIO(base64.b64decode(sample_image))
          sample["metadata_url"] = sample_metadata
        else:
          if len(set(sample_fields["image_pixels"])) > 1:
            counter("image_pixels_multiple").inc()
          else:
            counter("image_pixels_missing").inc()
            sample["image"] = io.BytesIO(base64.b64decode(_EMPTY_IMAGE_BYTES))
          sample["metadata_url"] = ""

        if len(set(sample_fields["image_resnet"])) == 1:
          image_resnet = [
              float(x) for x in sample_fields["image_resnet"][0].split(",")
          ]
          sample["embedding"] = image_resnet
        else:
          if len(set(sample_fields["image_resnet"])) > 1:
            counter("image_resnet_multiple").inc()
          else:
            counter("image_resnet_missing").inc()
          sample["embedding"] = self.builder_config.empty_resnet_embedding

        yield sample_id, sample

    # Read embeddings and bytes representations from (possibly compressed) csv.
    image_resnet_files = [
        image_resnet_path / f for f in tf.io.gfile.listdir(image_resnet_path)
    ]
    resnet_collection = (
        pipeline
        | "Collection from resnet files" >> beam.Create(image_resnet_files)
        | "Get embeddings per image" >> beam.FlatMap(_read_resnet_rows))

    image_pixel_files = [
        image_pixels_path / f for f in tf.io.gfile.listdir(image_pixels_path)
    ]
    pixel_collection = (
        pipeline
        | "Collection from pixel files" >> beam.Create(image_pixel_files)
        | "Get pixels per image" >> beam.FlatMap(_read_pixel_rows))

    # Read samples from tsv files.
    sample_collection = (
        pipeline
        | "Collection from sample files" >> beam.Create(samples_path)
        | "Get samples" >> beam.FlatMap(_read_samples_rows))

    # Combine the features and yield examples.
    return ({
        "sample_info": sample_collection,
        "image_pixels": pixel_collection,
        "image_resnet": resnet_collection,
    }
            | "Group by image_url" >> beam.CoGroupByKey()
            | "Reshuffle" >> beam.Reshuffle()
            | "Process and yield examples" >> beam.FlatMap(_process_examples))


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System.Threading.Tasks;
using Xunit;
using Verifier = Azure.ClientSdk.Analyzers.Tests.AzureAnalyzerVerifier<Azure.ClientSdk.Analyzers.TaskCompletionSourceAnalyzer>;

namespace Azure.ClientSdk.Analyzers.Tests
{
    public class AZC0013Tests
    {
        [Fact]
        public async Task AZC0013WarningOnTaskCompletionSourceDefaultConstructor()
        {
            const string code = @"
namespace RandomNamespace
{
    using System.Threading.Tasks;

    internal class RandomClass
    {
        private TaskCompletionSource<string> _tcs = [|new TaskCompletionSource<string>()|];
    }
}
";
            await Verifier.VerifyAnalyzerAsync(code, "AZC0013");
        }

        [Fact]
        public async Task AZC0013WarningOnTaskCompletionSourceWithState()
        {
            const string code = @"
namespace RandomNamespace
{
    using System.Threading.Tasks;

    internal class RandomClass
    {
        private TaskCompletionSource<string> _tcs = new TaskCompletionSource<string>([|new object()|]);
    }
}
";
            await Verifier.VerifyAnalyzerAsync(code, "AZC0013");
        }

        [Fact]
        public async Task AZC0013WarningOnTaskCompletionSourceWithoutRunContinuationsAsynchronously()
        {
            const string code = @"
namespace RandomNamespace
{
    using System.Threading.Tasks;

    internal class RandomClass
    {
        private TaskCompletionSource<string> _tcs = new TaskCompletionSource<string>(new object(), [|TaskCreationOptions.LongRunning | TaskCreationOptions.PreferFairness|]);
    }
}
";
            await Verifier.VerifyAnalyzerAsync(code, "AZC0013");
        }

        [Fact]
        public async Task AZC0013WarningOnTaskCompletionSourceWithField()
        {
            const string code = @"
namespace RandomNamespace
{
    using System.Threading.Tasks;

    internal class RandomClass
    {
        private static TaskCreationOptions _option = TaskCreationOptions.RunContinuationsAsynchronously;
        private TaskCompletionSource<string> _tcs = new TaskCompletionSource<string>([|TaskCreationOptions.LongRunning | _option | TaskCreationOptions.PreferFairness|]);
    }
}
";
            await Verifier.VerifyAnalyzerAsync(code, "AZC0013");
        }

        [Fact]
        public async Task AZC0013NoWarningOnTaskCompletionSourceWithRunContinuationsAsynchronously()
        {
            const string code = @"
namespace RandomNamespace
{
    using System.Threading.Tasks;

    internal class RandomClass
    {
        private TaskCompletionSource<string> _tcs = new TaskCompletionSource<string>(TaskCreationOptions.RunContinuationsAsynchronously);
    }
}
";
            await Verifier.VerifyAnalyzerAsync(code);
        }

        [Fact]
        public async Task AZC0013NoWarningOnTaskCompletionSourceWithRunContinuationsAsynchronouslyAndState()
        {
            const string code = @"
namespace RandomNamespace
{
    using System.Threading.Tasks;

    internal class RandomClass
    {
        private TaskCompletionSource<string> _tcs = new TaskCompletionSource<string>(new object(), TaskCreationOptions.RunContinuationsAsynchronously);
    }
}
";
            await Verifier.VerifyAnalyzerAsync(code);
        }

        [Fact]
        public async Task AZC0013NoWarningOnTaskCompletionSourceContainsRunContinuationsAsynchronously()
        {
            const string code = @"
namespace RandomNamespace
{
    using System.Threading.Tasks;

    internal class RandomClass
    {
        private TaskCompletionSource<string> _tcs = new TaskCompletionSource<string>(TaskCreationOptions.LongRunning | TaskCreationOptions.RunContinuationsAsynchronously | TaskCreationOptions.PreferFairness);
    }
}
";
            await Verifier.VerifyAnalyzerAsync(code);
        }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Flora, Jena 67: 467 (1884)

#### Original name
Verrucaria brasiliensis Müll. Arg.

### Remarks
null


text:
package org.kie.workbench.common.widgets.decoratedgrid.data;

import java.util.ArrayList;
import java.util.List;

import org.junit.Before;
import org.junit.Test;
import org.kie.workbench.common.widgets.decoratedgrid.client.widget.CellValue;
import org.kie.workbench.common.widgets.decoratedgrid.client.widget.data.Coordinate;
import org.kie.workbench.common.widgets.decoratedgrid.client.widget.data.DynamicData;
import org.kie.workbench.common.widgets.decoratedgrid.client.widget.data.DynamicDataRow;

import static junit.framework.Assert.*;

/**
 * Tests for DynamicData
 */
public class DynamicDataWithHiddenColumns2Test {

    protected DynamicData data = new DynamicData();

    protected static final List<CellValue<? extends Comparable<?>>> EMPTY_COLUMN = new ArrayList<CellValue<? extends Comparable<?>>>();

    @Before
    public void setup() {
        data.clear();

        data.addColumn( 0,
                        EMPTY_COLUMN,
                        true );
        data.addColumn( 1,
                        EMPTY_COLUMN,
                        false );
        data.addColumn( 2,
                        EMPTY_COLUMN,
                        true );

        data.addRow( makeRow() );
        data.addRow( makeRow() );
        data.addRow( makeRow() );

    }

    protected DynamicDataRow makeRow() {
        DynamicDataRow row = new DynamicDataRow();
        for ( CellValue<?> cell : makeCellValueList() ) {
            row.add( cell );
        }
        return row;
    }

    protected List<CellValue<? extends Comparable<?>>> makeCellValueList() {
        List<CellValue<? extends Comparable<?>>> row = new ArrayList<CellValue<? extends Comparable<?>>>();
        row.add( new CellValue<String>( "" ) );
        row.add( new CellValue<String>( "" ) );
        row.add( new CellValue<String>( "" ) );
        return row;
    }

    @Test
    public void testIndexing_DataCoordinates() {

        Coordinate c;
        c = data.get( 0 ).get( 0 ).getCoordinate();
        assertEquals( c.getRow(),
                      0 );
        assertEquals( c.getCol(),
                      0 );
        c = data.get( 0 ).get( 1 ).getCoordinate();
        assertEquals( c.getRow(),
                      0 );
        assertEquals( c.getCol(),
                      1 );
        c = data.get( 0 ).get( 2 ).getCoordinate();
        assertEquals( c.getRow(),
                      0 );
        assertEquals( c.getCol(),
                      2 );

        c = data.get( 1 ).get( 0 ).getCoordinate();
        assertEquals( c.getRow(),
                      1 );
        assertEquals( c.getCol(),
                      0 );
        c = data.get( 1 ).get( 1 ).getCoordinate();
        assertEquals( c.getRow(),
                      1 );
        assertEquals( c.getCol(),
                      1 );
        c = data.get( 1 ).get( 2 ).getCoordinate();
        assertEquals( c.getRow(),
                      1 );
        assertEquals( c.getCol(),
                      2 );

        c = data.get( 2 ).get( 0 ).getCoordinate();
        assertEquals( c.getRow(),
                      2 );
        assertEquals( c.getCol(),
                      0 );
        c = data.get( 2 ).get( 1 ).getCoordinate();
        assertEquals( c.getRow(),
                      2 );
        assertEquals( c.getCol(),
                      1 );
        c = data.get( 2 ).get( 2 ).getCoordinate();
        assertEquals( c.getRow(),
                      2 );
        assertEquals( c.getCol(),
                      2 );
    }

    @Test
    public void testIndexing_HtmlCoordinates() {

        Coordinate c;
        c = data.get( 0 ).get( 0 ).getHtmlCoordinate();
        assertEquals( c.getRow(),
                      0 );
        assertEquals( c.getCol(),
                      0 );
        c = data.get( 0 ).get( 1 ).getHtmlCoordinate();
        assertEquals( c.getRow(),
                      0 );
        assertEquals( c.getCol(),
                      0 );
        c = data.get( 0 ).get( 2 ).getHtmlCoordinate();
        assertEquals( c.getRow(),
                      0 );
        assertEquals( c.getCol(),
                      1 );

        c = data.get( 1 ).get( 0 ).getHtmlCoordinate();
        assertEquals( c.getRow(),
                      1 );
        assertEquals( c.getCol(),
                      0 );
        c = data.get( 1 ).get( 1 ).getHtmlCoordinate();
        assertEquals( c.getRow(),
                      1 );
        assertEquals( c.getCol(),
                      0 );
        c = data.get( 1 ).get( 2 ).getHtmlCoordinate();
        assertEquals( c.getRow(),
                      1 );
        assertEquals( c.getCol(),
                      1 );

        c = data.get( 2 ).get( 0 ).getHtmlCoordinate();
        assertEquals( c.getRow(),
                      2 );
        assertEquals( c.getCol(),
                      0 );
        c = data.get( 2 ).get( 1 ).getHtmlCoordinate();
        assertEquals( c.getRow(),
                      2 );
        assertEquals( c.getCol(),
                      0 );
        c = data.get( 2 ).get( 2 ).getHtmlCoordinate();
        assertEquals( c.getRow(),
                      2 );
        assertEquals( c.getCol(),
                      1 );
    }

    @Test
    public void testIndexing_PhysicalCoordinates() {

        Coordinate c;
        c = data.get( 0 ).get( 0 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      0 );
        assertEquals( c.getCol(),
                      0 );
        c = data.get( 0 ).get( 1 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      0 );
        assertEquals( c.getCol(),
                      2 );
        c = data.get( 0 ).get( 2 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      0 );
        assertEquals( c.getCol(),
                      2 );

        c = data.get( 1 ).get( 0 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      1 );
        assertEquals( c.getCol(),
                      0 );
        c = data.get( 1 ).get( 1 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      1 );
        assertEquals( c.getCol(),
                      2 );
        c = data.get( 1 ).get( 2 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      1 );
        assertEquals( c.getCol(),
                      2 );

        c = data.get( 2 ).get( 0 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      2 );
        assertEquals( c.getCol(),
                      0 );
        c = data.get( 2 ).get( 1 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      2 );
        assertEquals( c.getCol(),
                      2 );
        c = data.get( 2 ).get( 2 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      2 );
        assertEquals( c.getCol(),
                      2 );
    }

    @Test
    public void testIndexing_RowSpans() {

        CellValue<? extends Comparable<?>> cv;
        cv = data.get( 0 ).get( 0 );
        assertEquals( cv.getRowSpan(),
                      1 );
        cv = data.get( 0 ).get( 1 );
        assertEquals( cv.getRowSpan(),
                      1 );
        cv = data.get( 0 ).get( 2 );
        assertEquals( cv.getRowSpan(),
                      1 );

        cv = data.get( 1 ).get( 0 );
        assertEquals( cv.getRowSpan(),
                      1 );
        cv = data.get( 1 ).get( 1 );
        assertEquals( cv.getRowSpan(),
                      1 );
        cv = data.get( 1 ).get( 2 );
        assertEquals( cv.getRowSpan(),
                      1 );

        cv = data.get( 2 ).get( 0 );
        assertEquals( cv.getRowSpan(),
                      1 );
        cv = data.get( 2 ).get( 1 );
        assertEquals( cv.getRowSpan(),
                      1 );
        cv = data.get( 2 ).get( 2 );
        assertEquals( cv.getRowSpan(),
                      1 );
    }

}