text:
<?php
/* Meta Config
** Build Page & Post option forms.
*/

if ( $meta_box[ 'type' ]=="text") {
	if($meta_box[ 'opentag' ]) {echo $meta_box[ 'opentag' ];} ?>
        <div class="page-options <?php if($meta_box[ 'size' ]) { echo $meta_box[ 'size' ]; } ?>">

<?php echo $meta_box[ 'description' ]; ?>

    <?php if($meta_box[ 'closetag' ]) {echo $meta_box[ 'closetag' ];}

} elseif ( $meta_box[ 'type' ]=="field") {
	if($meta_box['opentag']) {echo $meta_box[ 'opentag' ];} ?>
        <div class="page-options <?php if($meta_box[ 'size' ]) { echo $meta_box[ 'size' ]; } ?>">
            <label for="<?php echo $meta_box[ 'name' ]; ?>"><?php echo $meta_box[ 'title' ]; ?>
            <input type="text" <?php if($meta_box[ 'class' ]) { ?> class="<?php echo $meta_box[ 'class' ]; ?>" <?php } ?> name="<?php echo $meta_box[ 'name' ]; ?>"  id="<?php echo $meta_box[ 'name' ]; ?>" value="<?php echo htmlspecialchars($data[$meta_box['name']]); ?>" /> <?php if($meta_box[ 'extras' ]) { echo $meta_box[ 'extras' ]; } ?>

<?php echo $meta_box['description']; ?>

    <?php if($meta_box[ 'closetag' ]) {echo $meta_box[ 'closetag' ];}

} elseif ( $meta_box[ 'type' ]=="hidden") {
	if($meta_box['opentag']) {echo $meta_box[ 'opentag' ];} ?>
            <input type="hidden" <?php if($meta_box[ 'class' ]) { ?> class="<?php echo $meta_box[ 'class' ]; ?>" <?php } ?> name="<?php echo $meta_box[ 'name' ]; ?>"  id="<?php echo $meta_box[ 'name' ]; ?>" value="<?php echo htmlspecialchars($data[$meta_box['name']]); ?>" /> <?php if($meta_box[ 'extras' ]) { echo $meta_box[ 'extras' ]; } ?>

<?php echo $meta_box['description']; ?>

            <?php if($meta_box[ 'id' ]=="slideset") { ?>

					<?php
					if(htmlspecialchars($data[$meta_box['name']])) {
						$selected_cats = explode(",", htmlspecialchars($data[$meta_box['name']]));

						if(is_array($selected_cats)) {
							foreach ($selected_cats as $selected_cat) { ?>
								<li class="button-secondary" title="<?php echo $selected_cat; ?>"><?php echo $selected_cat; ?>

							<?php }
						} else { ?>
								<li class="button-secondary" title="<?php echo $selected_cats; ?>"><?php echo $selected_cats; ?>

							<?php }
					  } ?>

			<?php }
    if($meta_box[ 'closetag' ]) {echo $meta_box[ 'closetag' ];}

} elseif ( $meta_box[ 'type' ]=="chkbox") {
	if($meta_box[ 'opentag' ]) {echo $meta_box[ 'opentag' ];}
		if( $meta_box[ 'array' ] ) {
			if($meta_box['array']=="cats") {

                  $categories=get_categories();

					foreach ($categories as $cat) {

                    $option = '<input type="checkbox" name="'. $meta_box[ 'name' ] .'[]" ';

					if (is_array($data[$meta_box[ 'name' ]])) {
					foreach ($data[$meta_box['name']] as $cats) {
					if($cats==$cat->term_id) {
					$option .= 'checked="checked"';
					} elseif($cats==$cat->cat_name) {
					$option .= 'checked="checked"';
					}
					}
					} else {
					if($data[$meta_box['name']]==$cat->term_id) {
					$option .= 'checked="checked"';
					} elseif ($data[$meta_box['name']]==$cat->cat_name) {
					$option .= 'checked="checked"';
					}
					}
					$option .= ' value="'. htmlspecialchars($cat->term_id) .'">';
                    $option .= ''.$cat->cat_name;
                    $option .= ' ('.$cat->category_count.')
';
                    echo $option;
                  }

			} elseif($meta_box[ 'array']=="archivecats") {

                  $categories=  get_categories();

					foreach ($categories as $cat) {

                    $option = '<input type="checkbox" name="'. $meta_box[ 'name' ] .'[]" ';

					if (is_array($data[ $meta_box[ 'name' ]])) {
					foreach ($data[ $meta_box[ 'name' ]] as $cats) {
					if($cats==$cat->term_id) {
					$option .= 'checked="checked"';
					}
					}
					} else {
					if($data[ $meta_box[ 'name' ]]==$cat->term_id) {
					$option .= 'checked="checked"';
					}
					}
					$option .= ' value="'.$cat->term_id.'">';
                    $option .= ''.$cat->cat_name;
                    $option .= ' ('.$cat->category_count.') ';
                    echo $option;
                  }
			}

			if($meta_box[ 'closetag' ]) {echo $meta_box[ 'closetag' ];}

		} else { ?>

<div class="page-options <?php if($meta_box[ 'size' ]) { echo $meta_box[ 'size' ]; } ?>">
<label for="<?php echo $meta_box[ 'name' ]; ?>"><?php echo $meta_box[ 'title' ]; ?>
<input type="checkbox" name="<?php echo $meta_box[ 'name' ]; ?>" <?php if($data[ $meta_box[ 'name' ] ]=="yes") {?> checked="checked"  <?php } ?> value="yes" />
<?php echo $meta_box[ 'description' ]; ?>

<?php if($meta_box[ 'closetag' ]) {echo $meta_box[ 'closetag' ];} ?>
<?php } }

elseif ( $meta_box[ 'type' ]=="radio") { ?>
	<?php if($meta_box[ 'opentag' ]) {echo $meta_box[ 'opentag' ];} ?>
    <?php if($meta_box[ 'maintitle' ]) {echo ''.$meta_box[ 'maintitle' ].'';} ?>
    <div class="page-options <?php if($meta_box[ 'size' ]) { echo $meta_box[ 'size' ]; } ?>">
        <label for="<?php echo $meta_box[ 'name' ]; ?>"><?php echo $meta_box[ 'title' ]; ?>

<input type="radio" name="<?php echo $meta_box[ 'name' ]; ?>" <?php if($data[ $meta_box[ 'name' ] ]==$meta_box[ 'id' ]) {?> checked="checked"  <?php } ?> value="<?php echo $meta_box[ 'id' ]; ?>" />
        <?php if($meta_box[ 'image' ]) { ?><img src="<?php bloginfo('template_url'); ?>/lib/adm/imgs/<?php echo $meta_box[ 'image' ]; ?>" alt="<?php echo $meta_box[ 'name' ]; ?>" /><?php } ?><?php echo $meta_box[ 'description' ]; ?>

    <?php if($meta_box[ 'closetag' ]) {echo $meta_box[ 'closetag' ];} ?>
<?php }

elseif ( $meta_box[ 'type' ]=="clear") { ?>

<?php }

elseif ( $meta_box[ 'type' ]=="menu") { ?>
<?php if($meta_box[ 'opentag' ]) {echo $meta_box[ 'opentag' ];} ?>
    <div class="page-options <?php if($meta_box[ 'size' ]) { echo $meta_box[ 'size' ]; } ?>">
        <label for="<?php echo $meta_box[ 'name' ]; ?>"><?php echo $meta_box[ 'title' ]; ?>
        <select name="<?php echo $meta_box[ 'name' ]; ?>" id="<?php echo $meta_box[ 'name' ]; ?>" <?php if($meta_box[ 'list' ]) { ?> size="<?php echo $meta_box[ 'list' ]; ?>" multiple="multiple" style="height:70px" <?php } ?>>

		<?php

		if($meta_box[ 'id' ]=="columns") { ?>
					<option value="">Select Sidebar</option>
		<?php $i=1;
			while($i<=$num_sidebars)
				{ ?>
					<option value="Sidebar<?php echo $i; ?>" <?php if($data[ $meta_box[ 'name' ] ]=="Sidebar".$i) {?> selected="selected" <?php } ?> >Sidebar<?php echo $i; ?></option>
				<?php $i++;
				}

		} elseif($meta_box[ 'id' ]=="twitter") { ?>

				<option value="none">Disabled</option>
                <option value="pagetop" <?php if($data[ $meta_box[ 'name' ] ]=="pagetop") { ?> selected="selected" <?php } ?>>Above Page Content</option>
                <option value="pagebot" <?php if($data[ $meta_box[ 'name' ] ]=="pagebot") { ?> selected="selected" <?php } ?>>Below Page Content</option>

		<?php

		} elseif($meta_box[ 'id' ]=="outskin") { ?>

                <option <?php if($data[ $meta_box[ 'name' ] ]=="") {?> selected="selected" <?php } ?> value="">Default</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="one") {?> selected="selected" <?php } ?> value="one">Light Grey</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="two") {?> selected="selected" <?php } ?> value="two">Dark Blue</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="three") {?> selected="selected" <?php } ?> value="three">Blue</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="four") {?> selected="selected" <?php } ?> value="four">Teal</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="five") {?> selected="selected" <?php } ?> value="five">Green</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="six") {?> selected="selected" <?php } ?> value="six">Mustard</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="seven") {?> selected="selected" <?php } ?> value="seven">Orange</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="eight") {?> selected="selected" <?php } ?> value="eight">Red</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="nine") {?> selected="selected" <?php } ?> value="nine">Pink</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="ten") {?> selected="selected" <?php } ?> value="ten">Dark Grey</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="eleven") {?> selected="selected" <?php } ?> value="eleven">Urban</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="twelve") {?> selected="selected" <?php } ?> value="twelve">Carbon</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="thirteen") {?> selected="selected" <?php } ?> value="thirteen">Wood</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="fourteen") {?> selected="selected" <?php } ?> value="fourteen">Grunge</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="fithteen") {?> selected="selected" <?php } ?> value="fithteen">Bokeh</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="sixteen") {?> selected="selected" <?php } ?> value="sixteen">Dark Teal</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="seventeen") {?> selected="selected" <?php } ?> value="seventeen">Dark Green</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="eighteen") {?> selected="selected" <?php } ?> value="eighteen">Dark Pink</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="nineteen") {?> selected="selected" <?php } ?> value="nineteen">Dark Red</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="twenty") {?> selected="selected" <?php } ?> value="twenty">Dark Brown</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="custom") {?> selected="selected" <?php } ?> value="custom">Custom</option>

		<?php

		} elseif($meta_box[ 'id' ]=="inskin") { ?>

                <option <?php if($data[ $meta_box[ 'name' ] ]=="") {?> selected="selected" <?php } ?> value="">Default</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="one") {?> selected="selected" <?php } ?> value="one">Light</option>
                <option <?php if($data[ $meta_box[ 'name' ] ]=="two") {?> selected="selected" <?php } ?> value="two">Dark</option>

		<?php

		} elseif ($meta_box[ 'id' ]=="gallerycat") { ?>

                 <?php
                  $categories=  get_categories();
                  foreach ($categories as $cat) {
				  	if($data[ $meta_box[ 'name' ] ]==$cat->category_nicename) {
                    $option = '<option selected="selected" value="'.$cat->category_nicename.'">';
					} else {
					$option = '<option value="'.$cat->category_nicename.'">';
					}
                    $option .= $cat->cat_name;
                    $option .= ' ('.$cat->category_count.')';
                    $option .= '</option>';
                    echo $option;
                  }

		} elseif($meta_box[ 'id' ]=="stagegallery") { ?>

				<option value="image" <?php if($data[ $meta_box[ 'name' ] ]=="image") { ?> selected="selected" <?php } ?>>Image Only (Default) </option>
                <option value="textimageleft" <?php if($data[ $meta_box[ 'name' ] ]=="textimageleft") { ?> selected="selected" <?php } ?>>Text & Image (Left Align) </option>
                <option value="textimageright" <?php if($data[ $meta_box[ 'name' ] ]=="textimageright") { ?> selected="selected" <?php } ?>>Text & Image (Right Align) </option>
				<option value="titleoverlay" <?php if($data[ $meta_box[ 'name' ] ]=="titleoverlay") { ?> selected="selected" <?php } ?>>Title Overlay</option>
                <option value="titletextoverlay" <?php if($data[ $meta_box[ 'name' ] ]=="titletextoverlay") { ?> selected="selected" <?php } ?>>Title / Text Overlay</option>
                <option value="textonly" <?php if($data[ $meta_box[ 'name' ] ]=="textonly") { ?> selected="selected" <?php } ?>>Text Only </option>
		<?php

		} elseif($meta_box[ 'id' ]=="imageeffect") { ?>

				<option value="none" <?php if($data[ $meta_box[ 'name' ] ]=="none") { ?> selected="selected" <?php } ?>>No Effect </option>
                <option value="shadow" <?php if($data[ $meta_box[ 'name' ] ]=="shadow") { ?> selected="selected" <?php } ?>>Drop Shadow </option>
                <option value="reflection" <?php if($data[ $meta_box[ 'name' ] ]=="reflection") { ?> selected="selected" <?php } ?>>Reflection </option>
                <option value="shadowreflection" <?php if($data[ $meta_box[ 'name' ] ]=="shadowreflection") { ?> selected="selected" <?php } ?>>Shadow & Reflection</option>

		<?php
		} elseif($meta_box[ 'id' ]=="slidesetselect") {

        $slideset_data_ids  = substr(maybe_unserialize(get_option('slideset_data_ids')), 0, -1);  // trim last comma
        $slideset_data_ids = explode(",", $slideset_data_ids);

            if(!$slideset_data_ids) {?>
					<option value="">No Slide Sets</option>
            <?php } else {?>
                    <option value="">Select Slide Set</option>
					<?php

					if($slideset_data_ids) {

                 		if(is_array($slideset_data_ids)) {
    						foreach ($slideset_data_ids as $slideset_data_ids) {
                                  echo"<option value='". $slideset_data_ids ."'>". $slideset_data_ids ."</option>";

    						}
                 		} else {
    							  echo"<option value='". $slideset_data_ids ."'>". $slideset_data_ids ."</option>";
                 		}
               		}

					}

		?>

		<?php
		} elseif($meta_box[ 'id' ]=="groupgridcontent") { ?>

				<option value="textimage" <?php if($data[ $meta_box[ 'name' ] ]=="textimage") { ?> selected="selected" <?php } ?>>Text & Image </option>
				<option value="titleimage" <?php if($data[ $meta_box[ 'name' ] ]=="titleimage") { ?> selected="selected" <?php } ?>>Title & Image </option>
                <option value="titleoverlay" <?php if($data[ $meta_box[ 'name' ] ]=="titleoverlay") { ?> selected="selected" <?php } ?>>Title Overlay Image </option>
                <option value="titletextoverlay" <?php if($data[ $meta_box[ 'name' ] ]=="titletextoverlay") { ?> selected="selected" <?php } ?>>Title & Text Overlay Image </option>
				<option value="image" <?php if($data[ $meta_box[ 'name' ] ]=="image") { ?> selected="selected" <?php } ?>>Image Only </option>
				<option value="text" <?php if($data[ $meta_box[ 'name' ] ]=="text") { ?> selected="selected" <?php } ?>>Text Only </option>

		<?php

		} elseif($meta_box[ 'id' ]=="accordiontitles") { ?>

				<option value="" <?php if($data[ $meta_box[ 'name' ] ]=="") { ?> selected="selected" <?php } ?>>Enabled </option>
				<option value="disabled" <?php if($data[ $meta_box[ 'name' ] ]=="disabled") { ?> selected="selected" <?php } ?>>Disabled </option>

		<?php

		} elseif($meta_box[ 'id' ]=="accordionautoplay") { ?>

				<option value="" <?php if($data[ $meta_box[ 'name' ] ]=="") { ?> selected="selected" <?php } ?>>Disabled </option>
				<option value="enabled" <?php if($data[ $meta_box[ 'name' ] ]=="enabled") { ?> selected="selected" <?php } ?>>Enabled </option>

		<?php

		} elseif($meta_box[ 'id' ]=="groupsliderpos") { ?>

				<option value="above" <?php if($data[ $meta_box[ 'name' ] ]=="above") { ?> selected="selected" <?php } ?>>Above Page Content </option>
				<option value="below" <?php if($data[ $meta_box[ 'name' ] ]=="below") { ?> selected="selected" <?php } ?>>Below Page Content </option>

		<?php

		} elseif($meta_box[ 'id' ]=="gridcolumns") { ?>

				<option value="" <?php if($data[ $meta_box[ 'name' ] ]=="") { ?> selected="selected" <?php } ?>>3 Columns </option>
				<option value="4" <?php if($data[ $meta_box[ 'name' ] ]=="4") { ?> selected="selected" <?php } ?>>4 Columns </option>
				<option value="5" <?php if($data[ $meta_box[ 'name' ] ]=="5") { ?> selected="selected" <?php } ?>>5 Columns </option>
				<option value="6" <?php if($data[ $meta_box[ 'name' ] ]=="6") { ?> selected="selected" <?php } ?>>6 Columns </option>
                <option value="7" <?php if($data[ $meta_box[ 'name' ] ]=="7") { ?> selected="selected" <?php } ?>>7 Columns </option>
		<?php

		} elseif($meta_box[ 'id' ]=="gridgallery") { ?>

				<option value="textimage" <?php if($data[ $meta_box[ 'name' ] ]=="textimage") { ?> selected="selected" <?php } ?>>Text & Image (Default) </option>
				<option value="image" <?php if($data[ $meta_box[ 'name' ] ]=="image") { ?> selected="selected" <?php } ?>>Image Only </option>
                <option value="text" <?php if($data[ $meta_box[ 'name' ] ]=="text") { ?> selected="selected" <?php } ?>>Text Only </option>

		<?php

		} elseif($meta_box[ 'id' ]=="imgzoomcrop") { ?>

				<option value="crop" <?php if($data[ $meta_box[ 'name' ] ]=="crop") { ?> selected="selected" <?php } ?>>Crop Image</option>
				<option value="zoom" <?php if($data[ $meta_box[ 'name' ] ]=="zoom") { ?> selected="selected" <?php } ?>>Zoom Image</option>
				<option value="zoom crop" <?php if($data[ $meta_box[ 'name' ] ]=="zoom crop") { ?> selected="selected" <?php } ?>>Zoom & Crop Image</option>
		<?php

		} elseif($meta_box[ 'id' ]=="videotype") { ?>

				<option value="" <?php if($data[ $meta_box[ 'name' ] ]=="") { ?> selected="selected" <?php } ?>>Disabled</option>
				<option value="vimeo" <?php if($data[ $meta_box[ 'name' ] ]=="vimeo") { ?> selected="selected" <?php } ?>>Vimeo</option>
				<option value="youtube" <?php if($data[ $meta_box[ 'name' ] ]=="youtube") { ?> selected="selected" <?php } ?>>YouTube</option>
                <option value="swf" <?php if($data[ $meta_box[ 'name' ] ]=="swf") { ?> selected="selected" <?php } ?>>SWF</option>
				<option value="3dvid" <?php if($data[ $meta_box[ 'name' ] ]=="3dvid") { ?> selected="selected" <?php } ?>>Video (3d Gallery Only)</option>
				<option value="jwp" <?php if($data[ $meta_box[ 'name' ] ]=="jwp") { ?> selected="selected" <?php } ?>>JW Player</option>
		<?php

		} elseif($meta_box[ 'id' ]=="postshowimage") { ?>

				<option value="" <?php if($data[ $meta_box[ 'name' ] ]=="") { ?> selected="selected" <?php } ?>>Default</option>
				<option value="single" <?php if($data[ $meta_box[ 'name' ] ]=="single") { ?> selected="selected" <?php } ?>>Single Post</option>
                <option value="archive" <?php if($data[ $meta_box[ 'name' ] ]=="archive") { ?> selected="selected" <?php } ?>>Archive Pages</option>
                <option value="singlearchive" <?php if($data[ $meta_box[ 'name' ] ]=="singlearchive") { ?> selected="selected" <?php } ?>>Post & Archive</option>
		<?php

		} elseif($meta_box[ 'id' ]=="imgorientation") { ?>

				<option value="landscape" <?php if($data[ $meta_box[ 'name' ] ]=="landscape") { ?> selected="selected" <?php } ?>>Landscape</option>
				<option value="portrait" <?php if($data[ $meta_box[ 'name' ] ]=="portrait") { ?> selected="selected" <?php } ?>>Portrait</option>
		<?php

		} elseif($meta_box[ 'id' ]=="displaytitle") { ?>

		<option value="disabled" <?php if($data[ $meta_box[ 'name' ] ]=="disabled") { ?> selected="selected" <?php } ?>>Disabled</option>
        <option value="center left light" <?php if($data[ $meta_box[ 'name' ] ]=="center left light") { ?> selected="selected" <?php } ?>>Center Left Light Text </option>
        <option value="center right light" <?php if($data[ $meta_box[ 'name' ] ]=="center right light") { ?> selected="selected" <?php } ?>>Center Right Light Text </option>
		<option value="center middle light" <?php if($data[ $meta_box[ 'name' ] ]=="center middle light") { ?> selected="selected" <?php } ?>>Center Middle Light Text </option>
        <option value="center left dark" <?php if($data[ $meta_box[ 'name' ] ]=="center left dark") { ?> selected="selected" <?php } ?>>Center Left Dark Text </option>
        <option value="center right dark" <?php if($data[ $meta_box[ 'name' ] ]=="center right dark") { ?> selected="selected" <?php } ?>>Center Right Dark Text </option>
        <option value="center middle dark" <?php if($data[ $meta_box[ 'name' ] ]=="center middle dark") { ?> selected="selected" <?php } ?>>Center Middle Dark Text </option>

		<option value="top left light" <?php if($data[ $meta_box[ 'name' ] ]=="top left light") { ?> selected="selected" <?php } ?>>Top Left Light Text </option>
		<option value="top right light" <?php if($data[ $meta_box[ 'name' ] ]=="top right light") { ?> selected="selected" <?php } ?>>Top Right Light Text </option>
		<option value="top middle light" <?php if($data[ $meta_box[ 'name' ] ]=="top middle light") { ?> selected="selected" <?php } ?>>Top Middle Light Text </option>
		<option value="top left dark" <?php if($data[ $meta_box[ 'name' ] ]=="top left dark") { ?> selected="selected" <?php } ?>>Top Left Dark Text </option>
		<option value="top right dark" <?php if($data[ $meta_box[ 'name' ] ]=="top right dark") { ?> selected="selected" <?php } ?>>Top Right Dark Text </option>
 		<option value="top middle dark" <?php if($data[ $meta_box[ 'name' ] ]=="top middle dark") { ?> selected="selected" <?php } ?>>Top Middle Dark Text </option>

		<option value="bottom left light" <?php if($data[ $meta_box[ 'name' ] ]=="bottom left light") { ?> selected="selected" <?php } ?>>Bottom Left Light Text </option>
		<option value="bottom right light" <?php if($data[ $meta_box[ 'name' ] ]=="bottom right light") { ?> selected="selected" <?php } ?>>Bottom Right Light Text </option>
		<option value="bottom middle light" <?php if($data[ $meta_box[ 'name' ] ]=="bottom middle light") { ?> selected="selected" <?php } ?>>Bottom Middle Light Text </option>
		<option value="bottom left dark" <?php if($data[ $meta_box[ 'name' ] ]=="bottom left dark") { ?> selected="selected" <?php } ?>>Bottom Left Dark Text </option>
		<option value="bottom right dark" <?php if($data[ $meta_box[ 'name' ] ]=="bottom right dark") { ?> selected="selected" <?php } ?>>Bottom Right Dark Text </option>
		<option value="bottom middle dark" <?php if($data[ $meta_box[ 'name' ] ]=="bottom middle dark") { ?> selected="selected" <?php } ?>>Bottom Middle Dark Text </option>

		<?php

		} elseif($meta_box[ 'id' ]=="gallerysortby") { ?>
				<option value="" <?php if($data[ $meta_box[ 'name' ] ]=="") { ?> selected="selected" <?php } ?>>Post Order (Default)</option>
  				<option value="date" <?php if($data[ $meta_box[ 'name' ] ]=="date") { ?> selected="selected" <?php } ?>>Date</option>
                <option value="rand" <?php if($data[ $meta_box[ 'name' ] ]=="rand") { ?> selected="selected" <?php } ?>>Random</option>
                <option value="title" <?php if($data[ $meta_box[ 'name' ] ]=="title") { ?> selected="selected" <?php } ?>>Title</option>
		<?php

		} elseif($meta_box[ 'id' ]=="galleryorderby") { ?>
				<option value="" <?php if($data[ $meta_box[ 'name' ] ]=="") { ?> selected="selected" <?php } ?>>Ascending (Default)</option>
  				<option value="DESC" <?php if($data[ $meta_box[ 'name' ] ]=="DESC") { ?> selected="selected" <?php } ?>>Descending</option>
		<?php

		} elseif($meta_box[ 'id' ]=="stageplaypause") { ?>
				<option value="" <?php if($data[ $meta_box[ 'name' ] ]=="") { ?> selected="selected" <?php } ?>>Bullet Nav</option>
  				<option value="enabled" <?php if($data[ $meta_box[ 'name' ] ]=="enabled") { ?> selected="selected" <?php } ?>>Bullet Nav + Play/Pause Nav</option>
				<option value="disabled" <?php if($data[ $meta_box[ 'name' ] ]=="disabled") { ?> selected="selected" <?php } ?>>Disable All Nav</option>
		<?php

		} elseif($meta_box[ 'id' ]=="gallery3dtween") { ?>
		  		<option value="" <?php if($data[ $meta_box[ 'name' ] ]=="") { ?> selected="selected" <?php } ?>>Default</option>
		<?php  $tween_types = array("linear","easeInSine","easeOutSine", "easeInOutSine", "easeInCubic", "easeOutCubic", "easeInOutCubic", "easeOutInCubic", "easeInQuint", "easeOutQuint", "easeInOutQuint", "easeOutInQuint", "easeInCirc", "easeOutCirc", "easeInOutCirc", "easeOutInCirc", "easeInBack", "easeOutBack", "easeInOutBack", "easeOutInBack", "easeInQuad", "easeOutQuad", "easeInOutQuad", "easeOutInQuad", "easeInQuart", "easeOutQuart", "easeInOutQuart", "easeOutInQuart", "easeInExpo", "easeOutExpo", "easeInOutExpo", "easeOutInExpo", "easeInElastic", "easeOutElastic", "easeInOutElastic", "easeOutInElastic", "easeInBounce", "easeOutBounce", "easeInOutBounce", "easeOutInBounce");

                  foreach ($tween_types as $tween_type) {
				  	if($data[$meta_box[ 'name' ]]==$tween_type) {
                    $option = '<option selected="selected" value="'.$tween_type.'">';
					} else {
					$option = '<option value="'.$tween_type.'">';
					}
                    $option .= $tween_type;
                    $option .= '</option>';
                    echo $option;
                  }

		}?>

        </select>

<?php echo $meta_box[ 'description' ]; ?>

<?php if($meta_box[ 'closetag' ]) {echo $meta_box[ 'closetag' ];} ?>
<?php } ?>


text:
package com.github.neuralnetworks.input;

import static org.junit.Assert.assertEquals;

import java.util.Arrays;
import java.util.Collection;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import com.amd.aparapi.Kernel;
import com.github.neuralnetworks.input.ScalingInputFunction;
import com.github.neuralnetworks.tensor.Matrix;
import com.github.neuralnetworks.tensor.TensorFactory;
import com.github.neuralnetworks.test.AbstractTest;
import com.github.neuralnetworks.util.Environment;
import com.github.neuralnetworks.util.RuntimeConfiguration;

/**
 * Created by chass on 02.12.14.
 */
@RunWith(Parameterized.class)
public class ScalingInputFunctionTest extends AbstractTest {

    public ScalingInputFunctionTest(RuntimeConfiguration conf)
    {
        super();
        Environment.getInstance().setRuntimeConfiguration(conf);
    }

    @Parameterized.Parameters
    public static Collection<RuntimeConfiguration[]> runtimeConfigurations()
    {
        RuntimeConfiguration conf1 = new RuntimeConfiguration();
        conf1.getAparapiConfiguration().setExecutionMode(Kernel.EXECUTION_MODE.SEQ);
        conf1.setUseDataSharedMemory(false);
        conf1.setUseWeightsSharedMemory(false);

        RuntimeConfiguration conf2 = new RuntimeConfiguration();
        conf2.getAparapiConfiguration().setExecutionMode(Kernel.EXECUTION_MODE.SEQ);
        conf2.setUseDataSharedMemory(true);
        conf2.setUseWeightsSharedMemory(true);

        return Arrays.asList(new RuntimeConfiguration[][]{{conf1}, {conf2}});
    }

    @Test
    public void testScaling()
    {
        float[][] input = new float[][] { { 1, 3 }, { -1.5f, 1.5f } };
        ScalingInputFunction si = new ScalingInputFunction();
        Matrix m = TensorFactory.matrix(input);
        si.value(m);

        assertEquals(0f, m.get(0, 0), 0);
        assertEquals(1f, m.get(0, 1), 0);
        assertEquals(0f, m.get(1, 0), 0);
        assertEquals(1f, m.get(1, 1), 0);
    }
}

redpajama_set_name: RedPajamaGithub


text:
Dockerfile for riak

experiment, see: https://docs.docker.com/examples/running_riak_service/ for our starting point


text:
package eu.modernmt.processing;

import eu.modernmt.io.TokensOutputStream;
import eu.modernmt.lang.Language;
import eu.modernmt.lang.LanguageDirection;
import eu.modernmt.model.Sentence;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import java.io.IOException;

import static org.junit.Assert.assertEquals;

public class PreprocessSpecialEntitiesTest {

    private static final LanguageDirection language = new LanguageDirection(Language.ENGLISH, Language.ITALIAN);
    private static Preprocessor preprocessor = null;

    @BeforeClass
    public static void setupPreprocessor() throws IOException {
        preprocessor = new Preprocessor();
    }

    @AfterClass
    public static void teardownPreprocessor() {
        if (preprocessor != null)
            preprocessor.close();
    }

    private static void test(String text, String expected) throws ProcessingException {
        Sentence sentence = preprocessor.process(language, text);

        assertEquals(text, sentence.toString(true, false));
        assertEquals(expected, TokensOutputStream.serialize(sentence, false, true));
    }

    @Test
    public void testDoNotTranslate() throws ProcessingException {
        test("List: ${DNT1}, ${DNT2} and ${DNT3}",
                "List : ${DNT1} , ${DNT2} and ${DNT3}");
    }

    @Test
    public void testPipesDelimiter() throws ProcessingException {
        test("That's | a || very ||| long |||| example . |||||",
                "That 's | a || very ||| long |||| example . |||||");
    }

    @Test
    public void testVarsLikeTokens() throws ProcessingException {
        test("${link_start}Visit %{user_name}'s profile${link_end}.%{terms_of_service_link}",
                "${link_start} Visit %{user_name} 's profile ${link_end} . %{terms_of_service_link}");
    }

    @Test
    public void testAndroidVarsTokens() throws ProcessingException {
        test("That's %f %s", "That 's %f %s");
        test("Hello %1$s, tab %2$d out of %3$f. %1$s:%2$s",
                "Hello %1$s , tab %2$d out of %3$f . %1$s : %2$s");
        test("%1$s (%2$.1f average)",
                "%1$s ( %2$.1f average )");
    }

    @Test
    public void testCombined() throws ProcessingException {
        test("option %{option_one} |||| option %{option_two}",
                "option %{option_one} |||| option %{option_two}");
        test("option %1$s |||| option %2$f",
                "option %1$s |||| option %2$f");
    }

}


text:
from __future__ import absolute_import
from traits.traits_listener import *


text:
require 'test_helper'

class SamajikplaceTest < ActiveSupport::TestCase
  # test "the truth" do
  #   assert true
  # end
end


text:
/**
 * Traducción de librería Bootstrap Table a Español (Chile)
 * @author Brian Álvarez Azócar
 * email brianalvarezazocar@gmail.com
 */
(function ($) {
    'use strict';

    $.fn.bootstrapTable.locales['es-CL'] = {
        formatLoadingMessage: function () {
            return 'Cargando, espere por favor...';
        },
        formatRecordsPerPage: function (pageNumber) {
            return pageNumber + ' filas por p\u00E1gina';
        },
        formatShowingRows: function (pageFrom, pageTo, totalRows) {
            return 'Mostrando ' + pageFrom + ' a ' + pageTo + ' de ' + totalRows + ' filas';
        },
        formatSearch: function () {
            return 'Buscar';
        },
        formatNoMatches: function () {
            return 'No se encontraron registros';
        },
        formatPaginationSwitch: function () {
            return 'Ocultar/Mostrar paginaci\u00F3n';
        },
        formatRefresh: function () {
            return 'Refrescar';
        },
        formatToggle: function () {
            return 'Cambiar';
        },
        formatColumns: function () {
            return 'Columnas';
        },
        formatAllRows: function () {
            return 'Todo';
        }
    };

    $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['es-CL']);

})(jQuery);


text:
package data_struct.labs.l04.b;
/**
 * The abstract class from which all these other shapes are derived
 *
 * @author Eddie Gurnee
 * @version 10/14/2013
 *
 */
public abstract class Shape {
	protected String shapeName;

	/**
	 * No args constructor for shape, defaults named as "no shape"
	 */
	public Shape() {
		this("no shape");
	}
	/**
	 * The constructor for the shape class
	 *
	 * @param shapeName is the name of the shape
	 */
	public Shape(String shapeName) {
		this.shapeName = shapeName;
	}

	public abstract double area();

	public String toString() {
		return shapeName;
	}
}


text:
<!DOCTYPE html>

        <title>Callback Function</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

Callback Function

Request With a Callback Function

The PHP file returns a call to the function you send as a callback.

        <button onclick="clickButton()">Click me!</button>


text:
package io.gravitee.rest.api.management.rest.resource;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.reset;

import io.gravitee.common.http.HttpStatusCode;
import io.gravitee.rest.api.management.rest.model.ApiMembership;
import io.gravitee.rest.api.management.rest.model.RoleMembership;
import io.gravitee.rest.api.model.MembershipReferenceType;
import io.gravitee.rest.api.model.permissions.RoleScope;
import io.gravitee.rest.api.service.MembershipService;
import io.gravitee.rest.api.service.common.GraviteeContext;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Response;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;

/**
 * @author Florent CHAMFROY (florent.chamfroy at graviteesource.com)
 * @author GraviteeSource Team
 */
public class RoleUsersResourceTest extends AbstractResourceTest {

    private static final String SCOPE = "ORGANIZATION";
    private static final String ROLE = "my-role";

    @Override
    protected String contextPath() {
        return "configuration/rolescopes/";
    }

    @Test
    public void shouldAddRoleToUser() {
        reset(membershipService);

        RoleMembership roleMembership = new RoleMembership();
        roleMembership.setId(USER_NAME);

        final Response response = envTarget(SCOPE).path("roles").path(ROLE).path("users").request().post(Entity.json(roleMembership));
        assertEquals(HttpStatusCode.CREATED_201, response.getStatus());
        assertNull(response.getHeaders().getFirst(HttpHeaders.LOCATION));

        ArgumentCaptor<MembershipService.MembershipReference> memberShipRefCaptor = ArgumentCaptor.forClass(
            MembershipService.MembershipReference.class
        );
        ArgumentCaptor<MembershipService.MembershipRole> memberShipRoleCaptor = ArgumentCaptor.forClass(
            MembershipService.MembershipRole.class
        );
        ArgumentCaptor<MembershipService.MembershipMember> memberShipUserCaptor = ArgumentCaptor.forClass(
            MembershipService.MembershipMember.class
        );

        Mockito
            .verify(membershipService)
            .addRoleToMemberOnReference(memberShipRefCaptor.capture(), memberShipUserCaptor.capture(), memberShipRoleCaptor.capture());
        assertEquals(GraviteeContext.getCurrentOrganization(), memberShipRefCaptor.getValue().getId());
        assertEquals(MembershipReferenceType.ORGANIZATION, memberShipRefCaptor.getValue().getType());
        assertEquals(ROLE, memberShipRoleCaptor.getValue().getName());
        assertEquals(RoleScope.ORGANIZATION, memberShipRoleCaptor.getValue().getScope());
        assertEquals(USER_NAME, memberShipUserCaptor.getValue().getMemberId());
    }
}


text:
package com.fasterxml.jackson.datatype.jsr310;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectReader;
import org.junit.Test;

import java.io.IOException;
import java.time.LocalTime;
import java.time.format.DateTimeParseException;

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

public class TestLocalTimeDeserialization extends ModuleTestBase
{
    private final ObjectReader READER = newMapper().readerFor(LocalTime.class);

    @Test
    public void testDeserializationAsString01() throws Exception
    {
        expectSuccess(LocalTime.of(12, 0), "'12:00'");
    }

    @Test
    public void testBadDeserializationAsString01() throws Throwable
    {
        expectFailure("'notalocaltime'");
    }

    private void expectFailure(String aposJson) throws Throwable {
        try {
            read(aposJson);
            fail("expected DateTimeParseException");
        } catch (JsonProcessingException e) {
            if (e.getCause() == null) {
                throw e;
            }
            if (!(e.getCause() instanceof DateTimeParseException)) {
                throw e.getCause();
            }
        } catch (IOException e) {
            throw e;
        }
    }

    private void expectSuccess(Object exp, String aposJson) throws IOException {
        final LocalTime value = read(aposJson);
        notNull(value);
        expect(exp, value);
    }

    private LocalTime read(final String aposJson) throws java.io.IOException {
        return READER.readValue(aposToQuotes(aposJson));
    }

    private static void notNull(Object value) {
        assertNotNull("The value should not be null.", value);
    }

    private static void expect(Object exp, Object value) {
        assertEquals("The value is not correct.", exp,  value);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Text;
using SoftLogik.Miscellaneous;

namespace SoftLogik.Testing
{
  public class AssertTest<T>
  {
    private readonly Predicate<T> _test;
    private readonly string _message;
    private bool _passed;

    public AssertTest(Predicate<T> test, string message)
    {
      ValidationUtils.ArgumentNotNull(test, "test");
      ValidationUtils.ArgumentNotNullOrEmpty(message, "message");

      _test = test;
      _message = message;
    }

    public string Message
    {
      get { return _message; }
    }

    public Predicate<T> Test
    {
      get { return _test; }
    }

    public bool Passed
    {
      get { return _passed; }
      set { _passed = value; }
    }
  }

  public static class TestingUtils
  {
    public static void TestCollection<T>(IList<T> list, IList<AssertTest<T>> tests)
    {
      ValidationUtils.ArgumentNotNull(list, "list");
      ValidationUtils.ArgumentNotNull(tests, "tests");

      List<AssertTest<T>> nonPassedTests = new List<AssertTest<T>>(tests);

      foreach (T t in list)
      {
        for (int i = nonPassedTests.Count - 1; i >= 0; i--)
        {
          AssertTest<T> test = nonPassedTests[i];
          bool testResult = test.Test(t);

          if (testResult)
          {
            test.Passed = true;
            nonPassedTests.RemoveAt(i);
          }
        }

        if (nonPassedTests.Count == 0)
          break;
      }

      foreach (AssertTest<T> nonPassedTest in nonPassedTests)
      {
        throw new Exception(nonPassedTest.Message);
      }
    }
  }
}


text:
package pod

import (
	"fmt"
	"testing"

	"github.com/stretchr/testify/assert"
	"k8s.io/api/admission/v1beta1"
	apiv1 "k8s.io/api/core/v1"
	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	resource_admission "k8s.io/autoscaler/vertical-pod-autoscaler/pkg/admission-controller/resource"
	"k8s.io/autoscaler/vertical-pod-autoscaler/pkg/admission-controller/resource/pod/patch"
	vpa_types "k8s.io/autoscaler/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1"
	"k8s.io/autoscaler/vertical-pod-autoscaler/pkg/utils/test"
)

type fakePodPreProcessor struct {
	err error
}

func (fpp *fakePodPreProcessor) Process(pod apiv1.Pod) (apiv1.Pod, error) {
	return pod, fpp.err
}

type fakeVpaMatcher struct {
	vpa *vpa_types.VerticalPodAutoscaler
}

func (m *fakeVpaMatcher) GetMatchingVPA(_ *apiv1.Pod) *vpa_types.VerticalPodAutoscaler {
	return m.vpa
}

type fakePatchCalculator struct {
	patches []resource_admission.PatchRecord
	err     error
}

func (c *fakePatchCalculator) CalculatePatches(_ *apiv1.Pod, _ *vpa_types.VerticalPodAutoscaler) (
	[]resource_admission.PatchRecord, error) {
	return c.patches, c.err
}

func TestGetPatches(t *testing.T) {
	testVpa := test.VerticalPodAutoscaler().WithName("name").WithContainer("testy-container").Get()
	testPatchRecord := resource_admission.PatchRecord{
		Op:    "add",
		Path:  "some/path",
		Value: "much",
	}
	testPatchRecord2 := resource_admission.PatchRecord{
		Op:    "add",
		Path:  "other/path",
		Value: "not so much",
	}
	tests := []struct {
		name                 string
		podJson              []byte
		namespace            string
		vpa                  *vpa_types.VerticalPodAutoscaler
		podPreProcessorError error
		calculators          []patch.Calculator
		expectPatches        []resource_admission.PatchRecord
		expectError          error
	}{
		{
			name:                 "invalid JSON",
			podJson:              []byte("{"),
			namespace:            "default",
			vpa:                  testVpa,
			podPreProcessorError: nil,
			expectError:          fmt.Errorf("unexpected end of JSON input"),
		},
		{
			name:                 "invalid pod",
			podJson:              []byte("{}"),
			namespace:            "default",
			vpa:                  testVpa,
			podPreProcessorError: fmt.Errorf("bad pod"),
			expectError:          fmt.Errorf("bad pod"),
		},
		{
			name:                 "no vpa found",
			podJson:              []byte("{}"),
			namespace:            "test",
			vpa:                  nil,
			podPreProcessorError: nil,
			expectError:          nil,
			expectPatches:        []resource_admission.PatchRecord{},
		},
		{
			name:      "calculator returns error",
			podJson:   []byte("{}"),
			namespace: "test",
			vpa:       testVpa,
			calculators: []patch.Calculator{&fakePatchCalculator{
				[]resource_admission.PatchRecord{}, fmt.Errorf("Can't calculate this"),
			}},
			podPreProcessorError: nil,
			expectError:          fmt.Errorf("Can't calculate this"),
			expectPatches:        []resource_admission.PatchRecord{},
		},
		{
			name:      "second calculator returns error",
			podJson:   []byte("{}"),
			namespace: "test",
			vpa:       testVpa,
			calculators: []patch.Calculator{
				&fakePatchCalculator{[]resource_admission.PatchRecord{
					testPatchRecord,
				}, nil},
				&fakePatchCalculator{
					[]resource_admission.PatchRecord{}, fmt.Errorf("Can't calculate this"),
				}},
			podPreProcessorError: nil,
			expectError:          fmt.Errorf("Can't calculate this"),
			expectPatches:        []resource_admission.PatchRecord{},
		},
		{
			name:      "patches returned correctly",
			podJson:   []byte("{}"),
			namespace: "test",
			vpa:       testVpa,
			calculators: []patch.Calculator{
				&fakePatchCalculator{[]resource_admission.PatchRecord{
					testPatchRecord,
					testPatchRecord2,
				}, nil}},
			podPreProcessorError: nil,
			expectError:          nil,
			expectPatches: []resource_admission.PatchRecord{
				patch.GetAddEmptyAnnotationsPatch(),
				testPatchRecord,
				testPatchRecord2,
			},
		},
		{
			name:      "patches returned correctly for multiple calculators",
			podJson:   []byte("{}"),
			namespace: "test",
			vpa:       testVpa,
			calculators: []patch.Calculator{
				&fakePatchCalculator{[]resource_admission.PatchRecord{
					testPatchRecord,
				}, nil},
				&fakePatchCalculator{[]resource_admission.PatchRecord{
					testPatchRecord2,
				}, nil}},
			podPreProcessorError: nil,
			expectError:          nil,
			expectPatches: []resource_admission.PatchRecord{
				patch.GetAddEmptyAnnotationsPatch(),
				testPatchRecord,
				testPatchRecord2,
			},
		},
	}
	for _, tc := range tests {
		t.Run(fmt.Sprintf("test case: %s", tc.name), func(t *testing.T) {
			fppp := &fakePodPreProcessor{tc.podPreProcessorError}
			fvm := &fakeVpaMatcher{vpa: tc.vpa}
			h := NewResourceHandler(fppp, fvm, tc.calculators)
			patches, err := h.GetPatches(&v1beta1.AdmissionRequest{
				Resource: v1.GroupVersionResource{
					Version: "v1",
				},
				Namespace: tc.namespace,
				Object: runtime.RawExtension{
					Raw: tc.podJson,
				},
			})
			if tc.expectError == nil {
				assert.NoError(t, err)
			} else {
				if assert.Error(t, err) {
					assert.Equal(t, tc.expectError.Error(), err.Error())
				}
			}
			if assert.Equal(t, len(tc.expectPatches), len(patches), fmt.Sprintf("got %+v, want %+v", patches, tc.expectPatches)) {
				for i, gotPatch := range patches {
					if !patch.EqPatch(gotPatch, tc.expectPatches[i]) {
						t.Errorf("Expected patch at position %d to be %+v, got %+v", i, tc.expectPatches[i], gotPatch)
					}
				}
			}
		})
	}
}


text:
var inherits = require("inherits"),
  _ = require("underscore")._,
  redis = require("redis"),
  RedisEventPublisher = require('./event-publisher-redis');

module.exports = RedisRegistry;

var defaultConfig = {};

function RedisRegistry(options) {
  options = options || {};

  var redisConfig = options.redis || defaultConfig;

  RedisRegistry.super.call(this, _.extend({
    idKey: "id",
    uniqueErrorMessage: "All items in this registry instance must have unique IDs."
  }, options || {}));

  //setup a redis client
  this.client = redis.createClient(
    redisConfig.port, //default = 6379
    redisConfig.host, //default = 127.0.0.1
    redisConfig.options //default = see https://github.com/mranney/node_redis#rediscreateclientport-host-options
  );

  //create a redis hash key for this registry
  this.hashId = 'redis-registry::' + this.id;
}

//public setter method to set global REDIS registry server config defaults
RedisRegistry.__defineSetter__('config', function(config) {
  defaultConfig = config;
});

function noop() {}

RedisRegistry.prototype = {

  add: function(item, cb) {
    cb = cb || noop;

    var me = this,
      idKey = this.options.idKey,
      options = this.options,
      itemJSON;

    if (item[idKey]) {

      //items MUST be JSON serializable for this registry
      try {
        itemJSON = JSON.stringify(item);
      } catch (ex) {
        itemJSON = null;
        cb('Error serializing item to add to registry.', ex);
      }

      if (itemJSON) {
        //enforce unique keys (only set value if hash key does not yet exist)
        me.client.hsetnx(me.hashId, item[idKey], itemJSON, function(err, result) {
          if (err) cb('Error adding item to registry.', err); else {

            //result == 1 if item was successfully set, 0 otherwise
            if (!result) {
              cb(options.uniqueErrorMessage + "... id: " + item[idKey]);
            } else {

              //note: events are also distributed via REDIS (RedisEventPublisher)
              me.fire("itemAdded", item);
              cb();
            }
          }
        });
      }

    } else {
      cb("Items in this registry must have '" + idKey + "' properties in order to be added.");
    }
  },

  /**
   * Copy items from one collection based object (basically any object that supports .each enumeration)
   * into this registry instance
   * @param {Array} collection
   */
  addRange: function(collection, cb) {
    cb = cb || noop;

    var me = this,
      errors = [],
      sem = 0;

    _.each(collection, function(item) {
      sem++;
      me.add(item, function(err) {
        if (err) errors.push(err);

        sem--;
        if (sem == 0) {
          if (errors.length) {
            cb(errors);
          } else {
            cb();
          }
        }
      });
    });
  },

  /**
   * Finds an item in the registry
   * @param {Function} iterator   Function which returns true when the desired item is found
   */
  find: function(iterator, cb) {
    cb = cb || noop;

    //TODO: currently this will be pretty inefficient due to buffering all and deserializing. May need to investigate better way.
    this.client.hvals(this.hashId, function(err, itemsJSON) {
      if (err) cb(err); else {
        try {
          var items = _.map(itemsJSON, function(itemJSON) {
            return JSON.parse(itemJSON);
          });
          cb(null, _.find(items, iterator));
        } catch (ex) {
          cb('Error parsing items during find.', ex);
        }
      }
    });
  },

  length: function(cb) {
    this.client.hlen(this.hashId, cb);
  },

  /**
   * Returns all items in the registry
   * @param {Function} iterator   Function which returns true when the desired item is found
   */
  getAll: function(cb) {
    cb = cb || noop;

    //TODO: currently this will be pretty inefficient due to buffering all and deserializing. May need to investigate better way.
    this.client.hvals(this.hashId, function(err, itemsJSON) {
      if (err) cb(err); else {
        try {
          var items = _.map(itemsJSON, function(itemJSON) {
            return JSON.parse(itemJSON);
          });
          cb(null, items);
        } catch (ex) {
          cb('Error parsing items during getAll.', ex);
        }
      }
    });
  },

  /**
   * Finds all matching items in the registry
   * @param {Function} iterator   Function which returns true when the desired item is found
   */
  findAll: function(iterator, cb) {
    cb = cb || noop;

    this.getAll(function(err, items) {
      if (err) cb(err); else {
        cb(null, _.filter(items, iterator));
      }
    });
  },

  /**
   * Finds an item in the registry by ID
   *
   * @param {String} id ID of the registry item
   */
  findById: function(id, cb) {
    cb = cb || noop;

    this.client.hget(this.hashId, id, function(err, itemJSON) {
      if (err) cb(err); else {
        if (!itemJSON) cb(null, null); else {
          try {
            var item = JSON.parse(itemJSON);
            cb(null, item);
          } catch (ex) {
            cb('Error parsing item during findById.', ex);
          }
        }
      }
    });
  },

  /**
   * Removes an item from the registry by ID
   * @param {String} id   ID of the registry item
   */
  removeById: function(id, cb) {
    cb = cb || noop;

    var me = this;
    //get the item first for event firing
    this.findById(id, function(err, item) {
      if (err) cb(err); else {
        if (!item) cb(null, false); else {
          me.client.hdel(me.hashId, id, function(err, result) {
            if (err) cb(err); else if (result) {

              me.fire('itemRemoved', item);
              //check for cleared status
              me.client.hlen(me.hashId, function(err, len) {
                if (!err && !len) {
                  me.fire('cleared');
                }

                cb(err, true);
              });
            } else {

              cb(null, false);
            }
          });
        }
      }
    })
  },

  /**
   * Removes an item from the registry
   * @param {Object} item The registry item
   */
  remove: function(item, cb) {
    cb = cb || noop;

    this.removeById(item[this.options.idKey], cb);
  },

  /**
   * Removes all items from the registry, with events
   */
  removeAll: function(cb) {
    cb = cb || noop;

    var me = this,
      sem = 0;

    //don't use this.each() here because we only need the keys (each adds parsing overhead)
    this.client.hkeys(this.hashId, function(err, keys) {
      if (err) cb(err); else {
        if (!keys || !keys.length) cb(); else {
          var errors = [];
          _.each(keys, function(key) {
            sem++;
            me.removeById(key, function(err) {
              if (err) errors.push(err);

              sem--;
              if (sem == 0) {
                if (!errors.length) errors = null;
                cb(errors);
              }
            });
          });
        }
      }
    });
  },

  /**
   * Performs an action on each item in the registry
   * @param {Function} iterator   Function containing code to execute on each item
   */
  each: function(iterator, cb) {
    cb = cb || noop;

    var me = this;

    this.getAll(function(err, items) {
      if (err) cb(err); else {
        _.each(items, iterator);
        cb();
      }
    });
  },

  /**
   * Disposes of this registry.
   * @param {Object} $super
   */
  dispose: function(cb) {
    cb = cb || noop;

    var me = this,
      args = _.toArray(arguments);

    this.removeAll(function(err) {
      RedisRegistry.super.prototype.dispose.apply(me, args);

      cb();
    });
  }
};

inherits(RedisRegistry, RedisEventPublisher);


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

<title>org.codehaus.groovy.antlr.treewalker (Groovy 2.4.4)</title>
<meta name="date" content="2015-07-09">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package org.codehaus.groovy.antlr.treewalker

Classes for walking the AST.

See: Description

Interface Summary

Interface
Description

Visitor

An interface for visiting a GroovySourceAST node.

Class Summary

Class
Description

CompositeVisitor

A composite of many visitors.

FlatNodeListTraversal

A simple iterator over an ordered (flat) List of the nodes of the AST.

MindMapPrinter

An antlr AST visitor that prints a format suitable for viewing in http://freemind.sourceforge.net

NodeAsHTMLPrinter

A visitor that prints a html tags of each node to the supplied PrintStream

NodeCollector

A simple antlr AST visitor that collects all nodes into a List.

NodePrinter

A simple antlr AST visitor that outputs the tokenName of each node in a pseudo xml style.

PreOrderTraversal

A simple preorder traversal over the supplied antlr AST.

SourceCodeTraversal

A treewalker for the antlr generated AST that attempts to visit the
 AST nodes in the order needed to generate valid groovy source code.

SourcePrinter

An antlr AST visitor that prints groovy source code for each visited node
 to the supplied PrintStream.

TraversalHelper

Helper Class for Antlr AST traversal and visitation.

VisitorAdapter

A default implementation of all visitor methods.

Package org.codehaus.groovy.antlr.treewalker Description

Classes for walking the AST.

Overview

Package

Class

Tree

Deprecated

Index

Help

Copyright © 2003-2015 The Apache Software Foundation. All rights reserved.

Prev Package

Next Package

Frames

No Frames

All Classes


text:
package com.deleidos.rtws.webapp.dbapi.servlet;

import java.util.Date;

public class JobStatus
{
	public enum JobState {
		PENDNG, IN_PROGRESS, SUCCESS, FAILURE;
	}

	private String jobId;
	private JobState state;
	private int percentComplete;
	private String details;
	private Date lastModifiedTimestamp;

	public String getJobId()
	{
		return jobId;
	}
	public void setJobId(String jobId)
	{
		this.jobId = jobId;
		lastModifiedTimestamp = new Date();
	}
	public JobState getState()
	{
		return state;
	}
	public void setState(JobState state)
	{
		this.state = state;
		lastModifiedTimestamp = new Date();
	}
	public int getPercentComplete()
	{
		return percentComplete;
	}
	public void setPercentComplete(int percentComplete)
	{
		this.percentComplete = percentComplete;
		lastModifiedTimestamp = new Date();
	}
	public String getDetails()
	{
		return details;
	}
	public void setDetails(String details)
	{
		this.details = details;
		lastModifiedTimestamp = new Date();
	}

	public Date getLastModifiedTimestamp()
	{
		return (Date)lastModifiedTimestamp.clone();
	}

	public boolean isComplete()
	{
		return (state == JobState.SUCCESS || state == JobState.FAILURE);
	}
}


text:
package uk.ac.ebi.quickgo.client.controller;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import uk.ac.ebi.quickgo.client.QuickGOREST;
import uk.ac.ebi.quickgo.client.model.presets.impl.CompositePresetImpl;

import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.hasSize;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

/**
 * Tests whether the {@link CompositePresetImpl} instance is populated correctly at application startup.
 *
 * Created 05/09/16
 * @author Edd
 */
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = {QuickGOREST.class})
@WebAppConfiguration
public class PresetsRetrievalIT {
    private static final String RESOURCE_URL = "/internal/presets";
    private static final String FIELDS_PARAM = "fields";

    @Autowired private WebApplicationContext webApplicationContext;

    private MockMvc mockMvc;

    @Before
    public void setup() {
        mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build();
    }

    @Test
    public void canRetrieveAssignedByPresets() throws Exception {
        mockMvc.perform(get(RESOURCE_URL))
                .andDo(print())
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.assignedBy").exists());
    }

    @Test
    public void canRetrieveReferencePresets() throws Exception {
        mockMvc.perform(get(RESOURCE_URL))
                .andDo(print())
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.references.*", hasSize(greaterThan(0))));
    }

    @Test
    public void canRetrieveEvidencePresets() throws Exception {
        mockMvc.perform(get(RESOURCE_URL))
                .andDo(print())
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.evidences.*", hasSize(greaterThan(0))));
    }

    @Test
    public void canRetrieveWithFromPresets() throws Exception {
        mockMvc.perform(get(RESOURCE_URL))
                .andDo(print())
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.withFrom").exists());
    }

    @Test
    public void canRetrieveGeneProductPresets() throws Exception {
        mockMvc.perform(get(RESOURCE_URL))
                .andDo(print())
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.geneProducts.*", hasSize(greaterThan(0))));
    }

    @Test
    public void canRetrieveGOSlimSetsPresets() throws Exception {
        mockMvc.perform(get(RESOURCE_URL))
                .andDo(print())
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.goSlimSets.*", hasSize(greaterThan(0))));
    }

    @Test
    public void canRetrieveTaxonPresets() throws Exception {
        mockMvc.perform(get(RESOURCE_URL))
                .andDo(print())
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.taxons").exists());
    }

    @Test
    public void canRetrieveQualifierPresets() throws Exception {
        mockMvc.perform(get(RESOURCE_URL))
                .andDo(print())
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.qualifiers").exists());
    }

    @Test
    public void canRetrieveAspectPresets() throws Exception {
        mockMvc.perform(get(RESOURCE_URL))
                .andDo(print())
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.aspects.*", hasSize(3)));
    }

    @Test
    public void canRetrieveGeneProductTypesPresets() throws Exception {
        mockMvc.perform(get(RESOURCE_URL))
                .andDo(print())
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.geneProductTypes.*", hasSize(3)));
    }

    @Test
    public void canRetrieveAnnotationExtensionRelationsPresets() throws Exception {
        mockMvc.perform(get(RESOURCE_URL))
                .andDo(print())
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.extRelations.*", hasSize(greaterThan(0))));
    }

    @Test
    public void canRetrieveAnnotationExtensionDatabasesPresets() throws Exception {
        mockMvc.perform(get(RESOURCE_URL))
               .andDo(print())
               .andExpect(status().isOk())
               .andExpect(jsonPath("$.extDatabases.*", hasSize(greaterThan(0))));
    }

    @Test
    public void canRetrieveSingleDesiredPreset() throws Exception {
        mockMvc.perform(get(RESOURCE_URL).param(FIELDS_PARAM, "goSlimSets"))
                .andDo(print())
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.assignedBy").doesNotExist())
                .andExpect(jsonPath("$.references").doesNotExist())
                .andExpect(jsonPath("$.evidences").doesNotExist())
                .andExpect(jsonPath("$.withFrom").doesNotExist())
                .andExpect(jsonPath("$.geneProducts").doesNotExist())
                .andExpect(jsonPath("$.goSlimSets.*", hasSize(greaterThan(0))));
    }

    @Test
    public void canRetrieveMultipleDesiredPresets() throws Exception {
        mockMvc.perform(get(RESOURCE_URL).param(FIELDS_PARAM, "goSlimSets,geneProducts"))
                .andDo(print())
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.assignedBy").doesNotExist())
                .andExpect(jsonPath("$.references").doesNotExist())
                .andExpect(jsonPath("$.evidences").doesNotExist())
                .andExpect(jsonPath("$.withFrom").doesNotExist())
                .andExpect(jsonPath("$.geneProducts.*", hasSize(greaterThan(0))))
                .andExpect(jsonPath("$.goSlimSets.*", hasSize(greaterThan(0))));
    }
}


text:
/*
 * Author: Rickard Green
 *
 * Description: Implementation of a driver with a smaller major
 *              driver version than allowed on load.
 */

#define VSN_MISMATCH_DRV_NAME_STR		"smaller_major_vsn_drv"
#define VSN_MISMATCH_DRV_NAME			smaller_major_vsn_drv
#define VSN_MISMATCH_DRV_MAJOR_VSN_DIFF		(ERL_DRV_MIN_REQUIRED_MAJOR_VERSION_ON_LOAD - ERL_DRV_EXTENDED_MAJOR_VERSION - 1)
#define VSN_MISMATCH_DRV_MINOR_VSN_DIFF		0

#include "vsn_mismatch_drv_impl.c"


text:
<?xml version="1.0" encoding="utf-8"?>
<com.example.mypractice.v4.DragHelperViewGroup xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:id="@+id/root"
    android:layout_height="match_parent">
    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:src="@drawable/lol_jinkesi"/>
    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:src="@drawable/lol_mangseng"/>
</com.example.mypractice.v4.DragHelperViewGroup>


text:
namespace dawn {

class Expr;
class StatementAccessesPair;
class StencilFunctionInstantiation;
class StencilInstantiation;

/// @name Renaming routines
/// @ingroup optimizer
/// @{

/// @brief Rename all occurrences of `oldAccessID` to `newAccessID` in the `stmts` by updating the
/// AccessID maps
///
/// @param instantiation          Instantiation in which AccessID maps are updated
/// @param oldAccessID            Old AccessID of the field
/// @param newAccessID            New AccessID of the field
/// @param statementAccessesPair  AST statements to inspect
///
/// @ingroup optimizer
/// @{
void renameAccessIDInStmts(StencilInstantiation* instantiation, int oldAccessID, int newAccessID,
                           ArrayRef<std::shared_ptr<StatementAccessesPair>> statementAccessesPairs);
void renameAccessIDInStmts(StencilFunctionInstantiation* instantiation, int oldAccessID,
                           int newAccessID,
                           ArrayRef<std::shared_ptr<StatementAccessesPair>> statementAccessesPairs);
void renameAccessIDInExpr(StencilInstantiation* instantiation, int oldAccessID, int newAccessID,
                          std::shared_ptr<Expr>& expr);
/// @}

/// @brief Rename all occurrences of `oldAccessID` to `newAccessID` in the in the stencil or
/// stencil-function instantiation
///
/// For stencil-function instantiation the caller and callee accesses are renamed.
///
/// @param oldAccessID                  Old AccessID of the field
/// @param newAccessID                  New AccessID of the field
/// @param statementAccessesPairs       Accesses to update
///
/// @ingroup optimizer
void renameAccessIDInAccesses(
    StencilInstantiation* instantiation, int oldAccessID, int newAccessID,
    ArrayRef<std::shared_ptr<StatementAccessesPair>> statementAccessesPairs);
void renameAccessIDInAccesses(
    StencilFunctionInstantiation* instantiation, int oldAccessID, int newAccessID,
    ArrayRef<std::shared_ptr<StatementAccessesPair>> statementAccessesPairs);
/// @}

} // namespace dawn

#endif


text:
/* jshint indent: 2 */

module.exports = function(sequelize, DataTypes) {
  return sequelize.define('phpbb_backup_remote_file', {
    id: {
      type: DataTypes.INTEGER(10),
      allowNull: false,
      primaryKey: true,
      autoIncrement: true
    },
    backup_id: {
      type: DataTypes.INTEGER(11),
      allowNull: false
    },
    file_name: {
      type: DataTypes.STRING,
      allowNull: false
    },
    file_size: {
      type: DataTypes.BIGINT,
      allowNull: false
    },
    ftp_host: {
      type: DataTypes.STRING,
      allowNull: false
    },
    start_time: {
      type: DataTypes.INTEGER(11),
      allowNull: false
    },
    end_time: {
      type: DataTypes.INTEGER(11),
      allowNull: true
    },
    status: {
      type: DataTypes.INTEGER(3),
      allowNull: false
    }
  }, {
    tableName: 'phpbb_backup_remote_file'
  });
};


text:
namespace HelpScout.Customers.Websites
{
    public class WebsiteCreateRequest
    {
        public string Value { get; set; }
    }

    public class WebsiteDetail
    {
        public long Id { get; set; }
        public string Value { get; set; }
    }

    public class WebsiteListItem
    {
        public long Id { get; set; }
        public string Value { get; set; }
    }
}


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

        #region Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SyndromicAberrationReport));
            this.xrTable3 = new DevExpress.XtraReports.UI.XRTable();
            this.xrTableRow7 = new DevExpress.XtraReports.UI.XRTableRow();
            this.xrTableCell20 = new DevExpress.XtraReports.UI.XRTableCell();
            this.cellNotificationType = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableRow13 = new DevExpress.XtraReports.UI.XRTableRow();
            this.xrTableCell10 = new DevExpress.XtraReports.UI.XRTableCell();
            this.cellSite = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableRow9 = new DevExpress.XtraReports.UI.XRTableRow();
            this.xrTableCell21 = new DevExpress.XtraReports.UI.XRTableCell();
            this.cellTimeInterval = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableRow14 = new DevExpress.XtraReports.UI.XRTableRow();
            this.xrTableCell11 = new DevExpress.XtraReports.UI.XRTableCell();
            this.cellLocation = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableRow15 = new DevExpress.XtraReports.UI.XRTableRow();
            this.xrTableCell14 = new DevExpress.XtraReports.UI.XRTableCell();
            this.cellHospital = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableRow16 = new DevExpress.XtraReports.UI.XRTableRow();
            this.xrTableCell15 = new DevExpress.XtraReports.UI.XRTableCell();
            this.cellGender = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableRow17 = new DevExpress.XtraReports.UI.XRTableRow();
            this.xrTableCell17 = new DevExpress.XtraReports.UI.XRTableCell();
            this.cellAge = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableRow6 = new DevExpress.XtraReports.UI.XRTableRow();
            this.xrTableCell18 = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableCell19 = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableRow8 = new DevExpress.XtraReports.UI.XRTableRow();
            this.xrTableCell2 = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableCell12 = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableCell22 = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableCell9 = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableCell23 = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableCell16 = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableCell25 = new DevExpress.XtraReports.UI.XRTableCell();
            ((System.ComponentModel.ISupportInitialize)(this.m_aberrationDataSet1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.tableInterval)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.m_BaseDataSet)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.tableBaseHeader)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.xrTable3)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
            //
            // ChildHeader
            //
            this.ChildHeader.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
            this.xrTable3});
            resources.ApplyResources(this.ChildHeader, "ChildHeader");
            this.ChildHeader.Expanded = true;
            this.ChildHeader.StylePriority.UseBorderWidth = false;
            this.ChildHeader.StylePriority.UsePadding = false;
            //
            // tableInterval
            //
            resources.ApplyResources(this.tableInterval, "tableInterval");
            this.tableInterval.StylePriority.UseBorders = false;
            this.tableInterval.StylePriority.UseFont = false;
            this.tableInterval.StylePriority.UsePadding = false;
            //
            // cellInputStartDate
            //
            resources.ApplyResources(this.cellInputStartDate, "cellInputStartDate");
            this.cellInputStartDate.StylePriority.UseFont = false;
            this.cellInputStartDate.StylePriority.UseTextAlignment = false;
            //
            // cellInputEndDate
            //
            resources.ApplyResources(this.cellInputEndDate, "cellInputEndDate");
            this.cellInputEndDate.StylePriority.UseFont = false;
            this.cellInputEndDate.StylePriority.UseTextAlignment = false;
            //
            // cellDefis
            //
            resources.ApplyResources(this.cellDefis, "cellDefis");
            this.cellDefis.StylePriority.UseFont = false;
            this.cellDefis.StylePriority.UseTextAlignment = false;
            //
            // cellLanguage
            //
            resources.ApplyResources(this.cellLanguage, "cellLanguage");
            this.cellLanguage.StylePriority.UseTextAlignment = false;
            //
            // lblReportName
            //
            resources.ApplyResources(this.lblReportName, "lblReportName");
            this.lblReportName.StylePriority.UseBorders = false;
            this.lblReportName.StylePriority.UseBorderWidth = false;
            this.lblReportName.StylePriority.UseFont = false;
            this.lblReportName.StylePriority.UseTextAlignment = false;
            //
            // Detail
            //
            resources.ApplyResources(this.Detail, "Detail");
            this.Detail.StylePriority.UseFont = false;
            this.Detail.StylePriority.UsePadding = false;
            //
            // PageHeader
            //
            resources.ApplyResources(this.PageHeader, "PageHeader");
            this.PageHeader.StylePriority.UseBorders = false;
            this.PageHeader.StylePriority.UseFont = false;
            this.PageHeader.StylePriority.UsePadding = false;
            //
            // PageFooter
            //
            resources.ApplyResources(this.PageFooter, "PageFooter");
            this.PageFooter.StylePriority.UseBorders = false;
            //
            // ReportHeader
            //
            resources.ApplyResources(this.ReportHeader, "ReportHeader");
            //
            // xrPageInfo1
            //
            resources.ApplyResources(this.xrPageInfo1, "xrPageInfo1");
            this.xrPageInfo1.StylePriority.UseBorders = false;
            //
            // cellReportHeader
            //
            resources.ApplyResources(this.cellReportHeader, "cellReportHeader");
            this.cellReportHeader.StylePriority.UseBorders = false;
            this.cellReportHeader.StylePriority.UseFont = false;
            this.cellReportHeader.StylePriority.UseTextAlignment = false;
            //
            // cellBaseSite
            //
            resources.ApplyResources(this.cellBaseSite, "cellBaseSite");
            this.cellBaseSite.StylePriority.UseBorders = false;
            this.cellBaseSite.StylePriority.UseFont = false;
            this.cellBaseSite.StylePriority.UseTextAlignment = false;
            //
            // cellBaseCountry
            //
            resources.ApplyResources(this.cellBaseCountry, "cellBaseCountry");
            this.cellBaseCountry.StylePriority.UseFont = false;
            //
            // cellBaseLeftHeader
            //
            resources.ApplyResources(this.cellBaseLeftHeader, "cellBaseLeftHeader");
            //
            // tableBaseHeader
            //
            resources.ApplyResources(this.tableBaseHeader, "tableBaseHeader");
            this.tableBaseHeader.StylePriority.UseBorders = false;
            this.tableBaseHeader.StylePriority.UseBorderWidth = false;
            this.tableBaseHeader.StylePriority.UseFont = false;
            this.tableBaseHeader.StylePriority.UsePadding = false;
            this.tableBaseHeader.StylePriority.UseTextAlignment = false;
            //
            // xrTable3
            //
            this.xrTable3.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top)
            | DevExpress.XtraPrinting.BorderSide.Right)
            | DevExpress.XtraPrinting.BorderSide.Bottom)));
            resources.ApplyResources(this.xrTable3, "xrTable3");
            this.xrTable3.Name = "xrTable3";
            this.xrTable3.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
            this.xrTableRow7,
            this.xrTableRow13,
            this.xrTableRow9,
            this.xrTableRow14,
            this.xrTableRow15,
            this.xrTableRow16,
            this.xrTableRow17});
            this.xrTable3.StylePriority.UseBorders = false;
            //
            // xrTableRow7
            //
            this.xrTableRow7.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.xrTableCell20,
            this.cellNotificationType});
            resources.ApplyResources(this.xrTableRow7, "xrTableRow7");
            this.xrTableRow7.Name = "xrTableRow7";
            //
            // xrTableCell20
            //
            resources.ApplyResources(this.xrTableCell20, "xrTableCell20");
            this.xrTableCell20.Name = "xrTableCell20";
            //
            // cellNotificationType
            //
            resources.ApplyResources(this.cellNotificationType, "cellNotificationType");
            this.cellNotificationType.Name = "cellNotificationType";
            //
            // xrTableRow13
            //
            this.xrTableRow13.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.xrTableCell10,
            this.cellSite});
            resources.ApplyResources(this.xrTableRow13, "xrTableRow13");
            this.xrTableRow13.Name = "xrTableRow13";
            //
            // xrTableCell10
            //
            resources.ApplyResources(this.xrTableCell10, "xrTableCell10");
            this.xrTableCell10.Multiline = true;
            this.xrTableCell10.Name = "xrTableCell10";
            //
            // cellSite
            //
            resources.ApplyResources(this.cellSite, "cellSite");
            this.cellSite.Name = "cellSite";
            //
            // xrTableRow9
            //
            this.xrTableRow9.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.xrTableCell21,
            this.cellTimeInterval});
            resources.ApplyResources(this.xrTableRow9, "xrTableRow9");
            this.xrTableRow9.Name = "xrTableRow9";
            //
            // xrTableCell21
            //
            resources.ApplyResources(this.xrTableCell21, "xrTableCell21");
            this.xrTableCell21.Name = "xrTableCell21";
            //
            // cellTimeInterval
            //
            resources.ApplyResources(this.cellTimeInterval, "cellTimeInterval");
            this.cellTimeInterval.Name = "cellTimeInterval";
            //
            // xrTableRow14
            //
            this.xrTableRow14.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.xrTableCell11,
            this.cellLocation});
            resources.ApplyResources(this.xrTableRow14, "xrTableRow14");
            this.xrTableRow14.Name = "xrTableRow14";
            //
            // xrTableCell11
            //
            resources.ApplyResources(this.xrTableCell11, "xrTableCell11");
            this.xrTableCell11.Multiline = true;
            this.xrTableCell11.Name = "xrTableCell11";
            //
            // cellLocation
            //
            resources.ApplyResources(this.cellLocation, "cellLocation");
            this.cellLocation.Name = "cellLocation";
            //
            // xrTableRow15
            //
            this.xrTableRow15.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.xrTableCell14,
            this.cellHospital});
            resources.ApplyResources(this.xrTableRow15, "xrTableRow15");
            this.xrTableRow15.Name = "xrTableRow15";
            //
            // xrTableCell14
            //
            resources.ApplyResources(this.xrTableCell14, "xrTableCell14");
            this.xrTableCell14.Multiline = true;
            this.xrTableCell14.Name = "xrTableCell14";
            //
            // cellHospital
            //
            resources.ApplyResources(this.cellHospital, "cellHospital");
            this.cellHospital.Name = "cellHospital";
            //
            // xrTableRow16
            //
            this.xrTableRow16.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.xrTableCell15,
            this.cellGender});
            resources.ApplyResources(this.xrTableRow16, "xrTableRow16");
            this.xrTableRow16.Name = "xrTableRow16";
            //
            // xrTableCell15
            //
            resources.ApplyResources(this.xrTableCell15, "xrTableCell15");
            this.xrTableCell15.Multiline = true;
            this.xrTableCell15.Name = "xrTableCell15";
            //
            // cellGender
            //
            resources.ApplyResources(this.cellGender, "cellGender");
            this.cellGender.Name = "cellGender";
            //
            // xrTableRow17
            //
            this.xrTableRow17.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.xrTableCell17,
            this.cellAge});
            resources.ApplyResources(this.xrTableRow17, "xrTableRow17");
            this.xrTableRow17.Name = "xrTableRow17";
            //
            // xrTableCell17
            //
            resources.ApplyResources(this.xrTableCell17, "xrTableCell17");
            this.xrTableCell17.Multiline = true;
            this.xrTableCell17.Name = "xrTableCell17";
            //
            // cellAge
            //
            resources.ApplyResources(this.cellAge, "cellAge");
            this.cellAge.Name = "cellAge";
            //
            // xrTableRow6
            //
            this.xrTableRow6.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.xrTableCell18,
            this.xrTableCell19});
            resources.ApplyResources(this.xrTableRow6, "xrTableRow6");
            this.xrTableRow6.Name = "xrTableRow6";
            //
            // xrTableCell18
            //
            this.xrTableCell18.Borders = DevExpress.XtraPrinting.BorderSide.Bottom;
            resources.ApplyResources(this.xrTableCell18, "xrTableCell18");
            this.xrTableCell18.Name = "xrTableCell18";
            this.xrTableCell18.StylePriority.UseBorders = false;
            //
            // xrTableCell19
            //
            this.xrTableCell19.Borders = DevExpress.XtraPrinting.BorderSide.Bottom;
            resources.ApplyResources(this.xrTableCell19, "xrTableCell19");
            this.xrTableCell19.Name = "xrTableCell19";
            this.xrTableCell19.StylePriority.UseBorders = false;
            //
            // xrTableRow8
            //
            this.xrTableRow8.Borders = DevExpress.XtraPrinting.BorderSide.None;
            resources.ApplyResources(this.xrTableRow8, "xrTableRow8");
            this.xrTableRow8.Name = "xrTableRow8";
            this.xrTableRow8.StylePriority.UseBorders = false;
            //
            // xrTableCell2
            //
            this.xrTableCell2.Borders = DevExpress.XtraPrinting.BorderSide.None;
            resources.ApplyResources(this.xrTableCell2, "xrTableCell2");
            this.xrTableCell2.Name = "xrTableCell2";
            this.xrTableCell2.StylePriority.UseBorders = false;
            this.xrTableCell2.StylePriority.UseTextAlignment = false;
            //
            // xrTableCell12
            //
            resources.ApplyResources(this.xrTableCell12, "xrTableCell12");
            this.xrTableCell12.Name = "xrTableCell12";
            //
            // xrTableCell22
            //
            resources.ApplyResources(this.xrTableCell22, "xrTableCell22");
            this.xrTableCell22.Name = "xrTableCell22";
            //
            // xrTableCell9
            //
            resources.ApplyResources(this.xrTableCell9, "xrTableCell9");
            this.xrTableCell9.Name = "xrTableCell9";
            //
            // xrTableCell23
            //
            resources.ApplyResources(this.xrTableCell23, "xrTableCell23");
            this.xrTableCell23.Name = "xrTableCell23";
            //
            // xrTableCell16
            //
            resources.ApplyResources(this.xrTableCell16, "xrTableCell16");
            this.xrTableCell16.Name = "xrTableCell16";
            //
            // xrTableCell25
            //
            resources.ApplyResources(this.xrTableCell25, "xrTableCell25");
            this.xrTableCell25.Name = "xrTableCell25";
            //
            // SyndromicAberrationReport
            //
            this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
            this.Detail,
            this.PageHeader,
            this.PageFooter,
            this.ReportHeader});
            resources.ApplyResources(this, "$this");
            this.Version = "14.1";
            ((System.ComponentModel.ISupportInitialize)(this.m_aberrationDataSet1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.tableInterval)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.m_BaseDataSet)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.tableBaseHeader)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.xrTable3)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this)).EndInit();

        }

        #endregion

        private DevExpress.XtraReports.UI.XRTable xrTable3;
        private DevExpress.XtraReports.UI.XRTableRow xrTableRow8;
        private DevExpress.XtraReports.UI.XRTableCell xrTableCell2;
        private DevExpress.XtraReports.UI.XRTableCell xrTableCell12;
        private DevExpress.XtraReports.UI.XRTableRow xrTableRow13;
        private DevExpress.XtraReports.UI.XRTableCell xrTableCell22;
        private DevExpress.XtraReports.UI.XRTableCell cellSite;
        private DevExpress.XtraReports.UI.XRTableRow xrTableRow14;
        private DevExpress.XtraReports.UI.XRTableCell xrTableCell9;
        private DevExpress.XtraReports.UI.XRTableCell cellLocation;
        private DevExpress.XtraReports.UI.XRTableRow xrTableRow15;
        private DevExpress.XtraReports.UI.XRTableCell xrTableCell23;
        private DevExpress.XtraReports.UI.XRTableCell cellHospital;
        private DevExpress.XtraReports.UI.XRTableRow xrTableRow16;
        private DevExpress.XtraReports.UI.XRTableCell xrTableCell16;
        private DevExpress.XtraReports.UI.XRTableCell cellGender;
        private DevExpress.XtraReports.UI.XRTableRow xrTableRow17;
        private DevExpress.XtraReports.UI.XRTableCell xrTableCell25;
        private DevExpress.XtraReports.UI.XRTableCell cellAge;
        private DevExpress.XtraReports.UI.XRTableCell xrTableCell10;
        private DevExpress.XtraReports.UI.XRTableCell xrTableCell11;
        private DevExpress.XtraReports.UI.XRTableCell xrTableCell14;
        private DevExpress.XtraReports.UI.XRTableCell xrTableCell15;
        private DevExpress.XtraReports.UI.XRTableCell xrTableCell17;
        private DevExpress.XtraReports.UI.XRTableRow xrTableRow6;
        private DevExpress.XtraReports.UI.XRTableCell xrTableCell18;
        private DevExpress.XtraReports.UI.XRTableCell xrTableCell19;
        private DevExpress.XtraReports.UI.XRTableRow xrTableRow7;
        private DevExpress.XtraReports.UI.XRTableCell xrTableCell20;
        private DevExpress.XtraReports.UI.XRTableCell cellNotificationType;
        private DevExpress.XtraReports.UI.XRTableRow xrTableRow9;
        private DevExpress.XtraReports.UI.XRTableCell xrTableCell21;
        private DevExpress.XtraReports.UI.XRTableCell cellTimeInterval;
    }
}


text:
import packageJson from '../../package.json';

export default {
  open: false,
  notify: false,
  logPrefix: packageJson.name,
};


text:
var assert = require('assert');
var fs = require('fs');
var miaow = require('miaow');
var path = require('path');

var parse = require('../index');
describe('miaow-png-mini', function () {
  this.timeout(10e3);

  function doCompile(done) {
    miaow({
      context: path.resolve(__dirname, './fixtures')
    }, function(err) {
      if (err) {
        console.error(err.toString(), err.stack);
        process.exit(1);
      }

      done();
    });
  }

  before(doCompile);

  it('接口是否存在', function () {
    assert(!!parse);
  });

  it('压缩', function () {
    var stat = fs.statSync(path.join(__dirname, './output', 'bar.png'));
    assert.equal(stat.size, 1027);
  });
});


text:
package org.apereo.cas.uma.web.controllers.resource;

import org.apereo.cas.support.oauth.OAuth20Constants;
import org.apereo.cas.support.oauth.util.OAuth20Utils;
import org.apereo.cas.uma.UmaConfigurationContext;
import org.apereo.cas.uma.ticket.resource.ResourceSet;
import org.apereo.cas.uma.web.controllers.BaseUmaEndpointController;
import org.apereo.cas.util.CollectionUtils;
import org.apereo.cas.util.LoggingUtils;

import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.stream.Collectors;

/**
 * This is {@link UmaFindResourceSetRegistrationEndpointController}.
 *
 * @author Misagh Moayyed
 * @since 6.0.0
 */
@Controller("umaFindResourceSetRegistrationEndpointController")
@Slf4j
public class UmaFindResourceSetRegistrationEndpointController extends BaseUmaEndpointController {
    public UmaFindResourceSetRegistrationEndpointController(final UmaConfigurationContext umaConfigurationContext) {
        super(umaConfigurationContext);
    }

    /**
     * Find resource sets response entity.
     *
     * @param request  the request
     * @param response the response
     * @return the response entity
     */
    @GetMapping(value = '/' + OAuth20Constants.BASE_OAUTH20_URL + '/' + OAuth20Constants.UMA_RESOURCE_SET_REGISTRATION_URL,
        consumes = MediaType.APPLICATION_JSON_VALUE,
        produces = MediaType.APPLICATION_JSON_VALUE)
    public ResponseEntity findResourceSets(final HttpServletRequest request, final HttpServletResponse response) {
        try {
            val profileResult = getAuthenticatedProfile(request, response, OAuth20Constants.UMA_PROTECTION_SCOPE);
            val resources = getUmaConfigurationContext().getUmaResourceSetRepository()
                .getByClient(OAuth20Utils.getClientIdFromAuthenticatedProfile(profileResult));
            val model = resources.stream().map(ResourceSet::getId).collect(Collectors.toSet());
            return new ResponseEntity(model, HttpStatus.OK);
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
        }
        return new ResponseEntity("Unable to locate resource-sets.", HttpStatus.BAD_REQUEST);
    }

    /**
     * Find resource set response entity.
     *
     * @param id       the id
     * @param request  the request
     * @param response the response
     * @return the response entity
     */
    @GetMapping(value = '/' + OAuth20Constants.BASE_OAUTH20_URL + '/' + OAuth20Constants.UMA_RESOURCE_SET_REGISTRATION_URL + "/{id}",
        consumes = MediaType.APPLICATION_JSON_VALUE,
        produces = MediaType.APPLICATION_JSON_VALUE)
    public ResponseEntity findResourceSet(@PathVariable("id") final long id, final HttpServletRequest request, final HttpServletResponse response) {
        try {
            val profileResult = getAuthenticatedProfile(request, response, OAuth20Constants.UMA_PROTECTION_SCOPE);

            val resourceSetResult = getUmaConfigurationContext().getUmaResourceSetRepository().getById(id);
            if (resourceSetResult.isEmpty()) {
                val model = buildResponseEntityErrorModel(HttpStatus.NOT_FOUND, "Requested resource-set cannot be found");
                return new ResponseEntity(model, model, HttpStatus.BAD_REQUEST);
            }
            val resourceSet = resourceSetResult.get();
            resourceSet.validate(profileResult);

            val model = CollectionUtils.wrap("entity", resourceSet, "code", HttpStatus.FOUND);
            return new ResponseEntity(model, HttpStatus.OK);
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
        }
        return new ResponseEntity("Unable to locate resource-set.", HttpStatus.BAD_REQUEST);
    }

}


text:
import proto  # type: ignore

__protobuf__ = proto.module(
    package="google.ads.googleads.v11.errors",
    marshal="google.ads.googleads.v11",
    manifest={"CustomInterestErrorEnum",},
)

class CustomInterestErrorEnum(proto.Message):
    r"""Container for enum describing possible custom interest
    errors.

    """

    class CustomInterestError(proto.Enum):
        r"""Enum describing possible custom interest errors."""
        UNSPECIFIED = 0
        UNKNOWN = 1
        NAME_ALREADY_USED = 2
        CUSTOM_INTEREST_MEMBER_ID_AND_TYPE_PARAMETER_NOT_PRESENT_IN_REMOVE = 3
        TYPE_AND_PARAMETER_NOT_FOUND = 4
        TYPE_AND_PARAMETER_ALREADY_EXISTED = 5
        INVALID_CUSTOM_INTEREST_MEMBER_TYPE = 6
        CANNOT_REMOVE_WHILE_IN_USE = 7
        CANNOT_CHANGE_TYPE = 8

__all__ = tuple(sorted(__protobuf__.manifest))


text:
@interface MDLog : NSObject
- (void)log ;

@end


text:
local targs = {...}
local opt = table.remove(targs, 1)

if opt == "get" then print(fs.drive.toLetter(computer.getBootAddress()) .. ":"); return end

local td, tf = fs.drive.drivepathSplit(table.remove(targs, 1) or "")
if #targs == 0 then targs = nil end
local ta = fs.drive.toAddress(td)

if opt == "set" then computer.setBootAddress(ta); return end

if tf == "" then tf = "init.lua" end

local oldgetboot = computer.getBootAddress
local fakeget = function() return ta end
local oldsetboot = computer.setBootAddress
local fakeset = function(addr) ta = addr end
computer.getBootAddress = fakeget

if opt == "tmp" then computer.setBootAddress = fakeset
elseif opt == "nex" then computer.setBootAddress = function(...) fakeset(...); oldsetboot(...) end
else
  printErr("Unexpected option `" .. (opt or "") .. "`")
  print([[

Usage:
chain <option> <path>

Options:
get - get boot drive
set - set boot drive from path
tmp - start OS from path, blocks set
nex - start OS from path, allows set

Warning!
If the OS returns then REBOOT!
miniOS will probably be broken.]])
  return
end

if not filesystem.exists(td .. ":" .. tf) then
  printErr("File to chainload `" .. td .. ":" .. tf .. "` does not exist!")
  return
end

term.clear()
error({[1]="INTERRUPT", [2]="RUN", [3]=(td .. ":" .. tf), [4]=targs or {}})

error("INTERRUPT failiure.")