text:
<?php
/**
 * Template Name: Fullpage Scroll Template
 */
?>

<?php while (have_posts()) : the_post(); ?>
  <?php // get_template_part('templates/page', 'header'); ?>
  <?php // get_template_part('templates/content', 'page'); ?>

  <?php if (have_rows('sections')) : ?>
     <?php while (have_rows('sections')) : the_row(); ?>
        <?php if (have_rows('content')): ?>
          <?php while(have_rows('content')) : the_row(); ?>

            <?php if (get_row_layout() == 'slideshow'): ?>
              <?php while(have_rows('slides')): the_row(); ?>

              <div class="col-md-12 jumbotron content-section"
                <?php if (get_sub_field('image')) : ?>
                <?php $image = get_sub_field('image');  ?>
                    style="background-image: url(<?php echo $image['url']; ?>);"
                <?php endif; ?>
              >

                      <?php if (get_sub_field('title')) : ?>

<?php the_sub_field('title'); ?>

                      <?php endif; ?>

                      <?php if (get_sub_field('text')) : ?>

<stong><?php the_sub_field('text'); ?></stong>

                      <?php endif; ?>

                <?php if (get_sub_field('link_type') == 'internal') : ?>
                    <?php if (get_sub_field('internal_link')) : ?>
                      <a class="btn btn-primary btn-block" href="<?php the_sub_field('internal_link'); ?>"><?php the_sub_field('button_text'); ?>
                    <?php endif; ?>

                <?php elseif (get_sub_field('link_type') == 'external') : ?>
                    <?php if (get_sub_field('external_link')) : ?>
                      <a class="btn btn-primary btn-block" href="<?php the_sub_field('external_link'); ?>" target="_blank"><?php the_sub_field('button_text'); ?>
                    <?php endif; ?>
                <?php endif; ?>

            <?php endwhile; ?>
          <?php endif; ?>

            <?php if (get_row_layout() == 'title_text_button'): ?>

                  <?php if (get_sub_field('title')) : ?>

<?php the_sub_field('title'); ?>

                  <?php endif; ?>

                  <?php if (get_sub_field('text')) : ?>

<?php the_sub_field('text'); ?>

                  <?php endif; ?>

                <?php if (get_sub_field('link_type') == 'internal') : ?>
                    <?php if (get_sub_field('internal_link')) : ?>
                      <a class="btn btn-primary btn-block" href="<?php the_sub_field('internal_link'); ?>"><?php the_sub_field('button_text'); ?>
                    <?php endif; ?>

                <?php elseif (get_sub_field('link_type') == 'external') : ?>
                    <?php if (get_sub_field('external_link')) : ?>
                      <a class="btn btn-primary btn-block" href="<?php the_sub_field('external_link'); ?>" target="_blank"><?php the_sub_field('button_text'); ?>
                    <?php endif; ?>
                <?php endif; ?>

          <?php endif; ?>

            <?php if (get_row_layout() == 'two_column'): ?>

                <?php if (get_sub_field('title')) : ?>

<?php the_sub_field('title'); ?>

                <?php endif; ?>

                <?php if (get_sub_field('text')) : ?>

<?php the_sub_field('text'); ?>

                <?php endif; ?>

              <?php while(have_rows('columns')): the_row(); ?>

                  <?php if (get_sub_field('icon')) : ?>

<?php the_sub_field('icon'); ?>

                  <?php endif; ?>

                  <?php if (get_sub_field('title')) : ?>

<?php the_sub_field('title'); ?>

                  <?php endif; ?>

                  <?php if (get_sub_field('text')) : ?>

<?php the_sub_field('text'); ?>

                  <?php endif; ?>

              <?php endwhile; ?>
          <?php endif; ?>

            <?php if (get_row_layout() == 'three_column'): ?>

                  <?php if (get_sub_field('title')) : ?>

<?php the_sub_field('title'); ?>

                  <?php endif; ?>

                  <?php if (get_sub_field('text')) : ?>

<?php the_sub_field('text'); ?>

                  <?php endif; ?>

              <?php while(have_rows('columns')): the_row(); ?>

                  <?php if (get_sub_field('icon')) : ?>
                    <?php $image = get_sub_field('icon');  ?>

                        <img src="<?php echo $image['url']; ?>" class="img-responsive center-block">

                  <?php endif; ?>

                    <?php if (get_sub_field('title')) : ?>
                      <?php the_sub_field('title'); ?>
                    <?php endif; ?>

                    <?php if (get_sub_field('text')) : ?>
                      <?php the_sub_field('text'); ?>
                    <?php endif; ?>

              <?php endwhile; ?>

          <?php if (get_sub_field('link_type') == 'internal') : ?>
              <?php if (get_sub_field('internal_link')) : ?>
                <a class="btn btn-primary btn-block" href="<?php the_sub_field('internal_link'); ?>"><?php the_sub_field('button_text'); ?>
              <?php endif; ?>

          <?php elseif (get_sub_field('link_type') == 'external') : ?>
              <?php if (get_sub_field('external_link')) : ?>
                <a class="btn btn-primary btn-block" href="<?php the_sub_field('external_link'); ?>" target="_blank"><?php the_sub_field('button_text'); ?>
              <?php endif; ?>
          <?php endif; ?>

    <?php endif; ?>

            <?php if (get_row_layout() == 'three_column_services'): ?>

              <?php if (get_sub_field('add_background') == 'yes') : ?>

              <?php else: ?>

              <?php endif; ?>

                  <?php if (get_sub_field('title')) : ?>

<?php the_sub_field('title'); ?>

                  <?php endif; ?>

                  <?php if (get_sub_field('text')) : ?>

<?php the_sub_field('text'); ?>

                  <?php endif; ?>

              <?php while(have_rows('columns')): the_row(); ?>

                  <?php if (get_sub_field('icon')) : ?>
                    <?php $image = get_sub_field('icon');  ?>

                         <img src="<?php echo $image['url']; ?>" class="img-responsive">

                  <?php endif; ?>

                    <?php if (get_sub_field('title')) : ?>
                       <?php the_sub_field('title'); ?>
                    <?php endif; ?>

                    <?php if (get_sub_field('text')) : ?>
                      <?php the_sub_field('text'); ?>
                    <?php endif; ?>

              <?php endwhile; ?>

          <?php if (get_sub_field('link_type') == 'internal') : ?>
              <?php if (get_sub_field('internal_link')) : ?>
                <a class="btn btn-primary btn-block" href="<?php the_sub_field('internal_link'); ?>"><?php the_sub_field('button_text'); ?>
              <?php endif; ?>

          <?php elseif (get_sub_field('link_type') == 'external') : ?>
              <?php if (get_sub_field('external_link')) : ?>
                <a class="btn btn-primary btn-block" href="<?php the_sub_field('external_link'); ?>" target="_blank"><?php the_sub_field('button_text'); ?>
              <?php endif; ?>
          <?php endif; ?>

    <?php endif; ?>

            <?php if (get_row_layout() == 'four_column'): ?>

                  <?php if (get_sub_field('title')) : ?>

<?php the_sub_field('title'); ?>

                  <?php endif; ?>

                  <?php if (get_sub_field('text')) : ?>

<?php the_sub_field('text'); ?>

                  <?php endif; ?>

              <?php while(have_rows('columns')): the_row(); ?>

                  <?php if (get_sub_field('icon')) : ?>
                    <?php $image = get_sub_field('icon');  ?>

                        <a href="<?php the_sub_field('internal_link'); ?>"> <img src="<?php echo $image['url']; ?>" class="img-responsive">

                  <?php endif; ?>

                    <?php if (get_sub_field('title')) : ?>
                       <?php the_sub_field('title'); ?>
                    <?php endif; ?>

                    <?php if (get_sub_field('text')) : ?>
                      <?php the_sub_field('text'); ?>
                    <?php endif; ?>

              <?php endwhile; ?>

          <?php if (get_sub_field('link_type') == 'internal') : ?>
              <?php if (get_sub_field('internal_link')) : ?>
                <a class="btn btn-primary btn-block" href="<?php the_sub_field('internal_link'); ?>"><?php the_sub_field('button_text'); ?>
              <?php endif; ?>

          <?php elseif (get_sub_field('link_type') == 'external') : ?>
              <?php if (get_sub_field('external_link')) : ?>
                <a class="btn btn-primary btn-block" href="<?php the_sub_field('external_link'); ?>" target="_blank"><?php the_sub_field('button_text'); ?>
              <?php endif; ?>
          <?php endif; ?>

      <?php endif; ?>

            <?php if (get_row_layout() == 'four_column_profiles'): ?>

                  <?php if (get_sub_field('title')) : ?>

<?php the_sub_field('title'); ?>

                  <?php endif; ?>

                  <?php if (get_sub_field('text')) : ?>

<?php the_sub_field('text'); ?>

                  <?php endif; ?>

              <?php $profilecounter = 0; ?>

              <?php while(have_rows('columns')): the_row(); ?>

                  <?php if (get_sub_field('icon')) : ?>
                    <?php $image = get_sub_field('icon');  ?>

                        <img src="<?php echo $image['url']; ?>" class="img-responsive profile-image">

                  <?php endif; ?>

                    <?php if (get_sub_field('title')) : ?>
                      <?php echo do_shortcode('[wp_colorbox_media url="#inline_content'.$profilecounter.'" type="inline" hyperlink="'.get_sub_field('title').'"]'); ?> |
                    <?php endif; ?>

                    <?php if (get_sub_field('text')) : ?>
                      <?php the_sub_field('text'); ?>
                    <?php endif; ?>

                    <?php if (get_sub_field('bio')) : ?>
                      <?php $blurb = get_sub_field('bio'); ?>

			<?php if (get_sub_field('show_bio') == 'yes') : ?>
                		 <?php echo string_limit_words($blurb,8); ?>

              		<?php endif; ?>

                      <?php echo do_shortcode('[wp_colorbox_media url="#inline_content'.$profilecounter.'" type="inline" hyperlink="Read More"]'); ?>

                        <div id="inline_content<?php echo $profilecounter?>" style="padding:10px; background:#fff;" class="advisory-board-pop-up">

                            <?php if (get_sub_field('icon')) : ?>
                              <?php $image = get_sub_field('icon');  ?>

                                  <img src="<?php echo $image['url']; ?>" class="img-responsive profile-image">

                            <?php endif; ?>

                          <?php if (get_sub_field('title')) : ?>
                              <?php the_sub_field('title'); ?> |
                            <?php endif; ?>

                            <?php if (get_sub_field('text')) : ?>
                              <?php the_sub_field('text'); ?>
                            <?php endif; ?>

                           <?php if (get_sub_field('bio')) : ?>
                            <?php the_sub_field('bio'); ?>
                          <?php endif; ?>

                    <?php endif; ?>

              <?php $profilecounter++; ?>
              <?php endwhile; ?>

            <?php $pagename = get_query_var('pagename');
             if ( !$pagename=="who-we-are") { ?>
              <?php if (get_sub_field('link_type') == 'internal') : ?>
                  <?php if (get_sub_field('internal_link')) : ?>
                    <a class="btn btn-primary btn-block" href="<?php the_sub_field('internal_link'); ?>"><?php the_sub_field('button_text'); ?>
                  <?php endif; ?>

              <?php elseif (get_sub_field('link_type') == 'external') : ?>
                  <?php if (get_sub_field('external_link')) : ?>
                    <a class="btn btn-primary btn-block" href="<?php the_sub_field('external_link'); ?>" target="_blank"><?php the_sub_field('button_text'); ?>
                  <?php endif; ?>
              <?php endif; ?>
            <?php }else{ ?>

                        Contact Us

            <?php } ?>

      <?php endif; ?>

            <?php if (get_row_layout() == 'five_column_logos'): ?>

                  <?php if (get_sub_field('title')) : ?>

<?php the_sub_field('title'); ?>

                  <?php endif; ?>

                  <?php if (get_sub_field('text')) : ?>

<?php the_sub_field('text'); ?>

                  <?php endif; ?>

              <?php while(have_rows('columns')): the_row(); ?>

                  <?php if (get_sub_field('icon')) : ?>
                    <?php $image = get_sub_field('icon');  ?>

                            <?php if (get_sub_field('partner_link')) : ?>
                              <a  href="<?php the_sub_field('partner_link'); ?>" target="_blank"><?php the_sub_field('button_text'); ?><img src="<?php echo $image['url']; ?>" class="img-responsive">
                            <?php endif; ?>

                  <?php endif; ?>

              <?php endwhile; ?>

          <?php if (get_sub_field('link_type') == 'internal') : ?>
              <?php if (get_sub_field('internal_link')) : ?>
                <a class="btn btn-primary btn-block" href="<?php the_sub_field('internal_link'); ?>"><?php the_sub_field('button_text'); ?>
              <?php endif; ?>

          <?php elseif (get_sub_field('link_type') == 'external') : ?>
              <?php if (get_sub_field('external_link')) : ?>
                <a class="btn btn-primary btn-block" href="<?php the_sub_field('external_link'); ?>" target="_blank"><?php the_sub_field('button_text'); ?>
              <?php endif; ?>
          <?php endif; ?>

      <?php endif; ?>

            <?php if (get_row_layout() == 'five_column_color_logos'): ?>

                  <?php if (get_sub_field('title')) : ?>

<?php the_sub_field('title'); ?>

                  <?php endif; ?>

                  <?php if (get_sub_field('text')) : ?>

<?php the_sub_field('text'); ?>

                  <?php endif; ?>

              <?php while(have_rows('columns')): the_row(); ?>

                  <?php if (get_sub_field('icon')) : ?>
                    <?php $image = get_sub_field('icon');  ?>

                            <?php if (get_sub_field('partner_link')) : ?>
                              <a  href="<?php the_sub_field('partner_link'); ?>" target="_blank"><?php the_sub_field('button_text'); ?><img src="<?php echo $image['url']; ?>" class="img-responsive">
                            <?php endif; ?>

                  <?php endif; ?>

              <?php endwhile; ?>

          <?php if (get_sub_field('link_type') == 'internal') : ?>
              <?php if (get_sub_field('internal_link')) : ?>
                <a class="btn btn-primary btn-block" href="<?php the_sub_field('internal_link'); ?>"><?php the_sub_field('button_text'); ?>
              <?php endif; ?>

          <?php elseif (get_sub_field('link_type') == 'external') : ?>
              <?php if (get_sub_field('external_link')) : ?>
                <a class="btn btn-primary btn-block" href="<?php the_sub_field('external_link'); ?>" target="_blank"><?php the_sub_field('button_text'); ?>
              <?php endif; ?>
          <?php endif; ?>

      <?php endif; ?>

            <?php if (get_row_layout() == 'contact_form'): ?>

                  <?php if (get_sub_field('title')) : ?>

<?php the_sub_field('title'); ?>

                  <?php endif; ?>

                  <?php if (get_sub_field('text')) : ?>

<?php the_sub_field('text'); ?>

                  <?php endif; ?>

          <?php endif; ?>

            <?php if (get_row_layout() == 'contact_methods'): ?>

              <?php while(have_rows('listings')): the_row(); ?>

                    <?php if (get_sub_field('title')) : ?>
                      <?php the_sub_field('title'); ?>:
                    <?php endif; ?>

                    <?php if (get_sub_field('text')) : ?>
                      <?php the_sub_field('text'); ?>
                    <?php endif; ?>

              <?php endwhile; ?>

            <?php if (get_sub_field('map')) : ?>

                  <?php the_sub_field('map'); ?>

            <?php endif; ?>

          <?php if (get_sub_field('link_type') == 'internal') : ?>
              <?php if (get_sub_field('internal_link')) : ?>
                <a class="btn btn-primary btn-block" href="<?php the_sub_field('internal_link'); ?>"><?php the_sub_field('button_text'); ?>
              <?php endif; ?>

          <?php elseif (get_sub_field('link_type') == 'external') : ?>
              <?php if (get_sub_field('external_link')) : ?>
                <a class="btn btn-primary btn-block" href="<?php the_sub_field('external_link'); ?>" target="_blank"><?php the_sub_field('button_text'); ?>
              <?php endif; ?>
          <?php endif; ?>

    <?php endif; ?>

            <?php if (get_row_layout() == 'image_title_text'): ?>

              <?php while(have_rows('columns')): the_row(); ?>

                 <?php if (get_sub_field('image-alignment') == 'left') : ?>

                  <?php if (get_sub_field('image')) : ?>
                    <?php $image = get_sub_field('image');  ?>
                        <img src="<?php echo $image['url']; ?>" class="img-responsive">
                  <?php endif; ?>

                    <?php if (get_sub_field('title')) : ?>

<?php the_sub_field('title'); ?>

                    <?php endif; ?>

                    <?php if (get_sub_field('text')) : ?>
                      <?php the_sub_field('text'); ?>
                    <?php endif; ?>

                <?php elseif (get_sub_field('image-alignment') == 'right') : ?>

                  <?php if (get_sub_field('image')) : ?>
                    <?php $image = get_sub_field('image');  ?>
                        <img src="<?php echo $image['url']; ?>" class="img-responsive">
                  <?php endif; ?>

                    <?php if (get_sub_field('title')) : ?>

<?php the_sub_field('title'); ?>

                    <?php endif; ?>

                    <?php if (get_sub_field('text')) : ?>
                      <?php the_sub_field('text'); ?>
                    <?php endif; ?>

                <?php endif; ?>

              <?php endwhile; ?>

          <?php if (get_sub_field('link_type') == 'internal') : ?>
              <?php if (get_sub_field('internal_link')) : ?>
                <a class="btn btn-primary btn-block" href="<?php the_sub_field('internal_link'); ?>"><?php the_sub_field('button_text'); ?>
              <?php endif; ?>

          <?php elseif (get_sub_field('link_type') == 'external') : ?>
              <?php if (get_sub_field('external_link')) : ?>
                <a class="btn btn-primary btn-block" href="<?php the_sub_field('external_link'); ?>" target="_blank"><?php the_sub_field('button_text'); ?>
              <?php endif; ?>
          <?php endif; ?>

    <?php endif; ?>

            <?php if (get_row_layout() == 'news_and_events_carousel'): ?>

                  <?php if (get_sub_field('title')) : ?>

<?php the_sub_field('title'); ?>

                  <?php endif; ?>

                  <?php
                  global $post;
                  $args = array( -1, 'post_type' => 'event', 'orderby' => 'date', 'order' => 'DESC','meta_query' => array(
                    array(
                      'key' => '_start_ts',
                      'value' => current_time('timestamp'),
                      'compare' => '>=',
                      'type'=>'numeric'
                    )
                  ));
                  $query = new WP_Query( $args );
                  $args2 = array( 3, 'post_type' => 'post', 'orderby' => 'date', 'order' => 'DESC',);
                  $query2 = new WP_Query( $args2 );
                 // Get the posts
                  $myposts = $query->get_posts();
                  $myposts2 = $query2->get_posts();
                  $myposts = array_merge($myposts, $myposts2);
                // If there are posts
                if($myposts):
                  // Item size (set here the number of posts for each group)
                  $i = 3;
                  // Groups the posts in groups of $i
                  $chunks = array_chunk($myposts, $i);
                  $html = "";
                  /*
                   * Item
                   * For each group (chunk) it generates an item
                   */
                  foreach($chunks as $chunk):
                    // Sets as 'active' the first items
                    ($chunk === reset($chunks)) ? $active = "active" : $active = "";
                    $html .= '
';
                    /*
                     * Posts inside the current Item
                     * For each item it generates the posts HTML
                     */
                    $events=$chunk;
                  foreach($events as $post): setup_postdata($post);
                    $html .= '
';
                    if (has_post_thumbnail( $post->ID ) ):
                    $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
                    $html .= '

';
                    endif;
                    $html .= '
';
                    $html .= ''.get_the_title().'
';
                    $blurb = get_the_excerpt();
                    $html .=  string_limit_words($blurb,8);
                    $html .= '
';
                    $html .= '';
                    $html .= '
';
                   endforeach;
                   wp_reset_postdata();
                    $html .= '
';
                  endforeach;
                  // Prints the HTML
                  echo $html;
                endif;
                ?>

                  Previous

                  Next

                  <?php
                  global $post;
                  $args = array( -1, 'post_type' => 'event', 'orderby' => 'date', 'order' => 'DESC','meta_query' => array(
                    array(
                      'key' => '_start_ts',
                      'value' => current_time('timestamp'),
                      'compare' => '>=',
                      'type'=>'numeric'
                    )
                  ));
                  $query = new WP_Query( $args );
                  $args2 = array( 3, 'post_type' => 'post', 'orderby' => 'date', 'order' => 'DESC',);
                  $query2 = new WP_Query( $args2 );
                 // Get the posts
                  $myposts = $query->get_posts();
                  $myposts2 = $query2->get_posts();
                  $myposts = array_merge($myposts, $myposts2);
                // If there are posts
                if($myposts):
                  // Item size (set here the number of posts for each group)
                  $i = 1;
                  // Groups the posts in groups of $i
                  $chunks = array_chunk($myposts, $i);
                  $html = "";
                  /*
                   * Item
                   * For each group (chunk) it generates an item
                   */
                  foreach($chunks as $chunk):
                    // Sets as 'active' the first items
                    ($chunk === reset($chunks)) ? $active = "active" : $active = "";
                    $html .= '
';
                    /*
                     * Posts inside the current Item
                     * For each item it generates the posts HTML
                     */
                    $events=$chunk;
                  foreach($events as $post): setup_postdata($post);
                    $html .= '
';
                    if (has_post_thumbnail( $post->ID ) ):
                    $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
                    $html .= '

';
                    endif;
                    $html .= '
';
                    $html .= ''.get_the_title().'
';
                    $blurb = get_the_excerpt();
                    $html .=  string_limit_words($blurb,8);
                    $html .= '
';
                    $html .= '';
                    $html .= '
';
                   endforeach;
                   wp_reset_postdata();
                    $html .= '
';
                  endforeach;
                  // Prints the HTML
                  echo $html;
                endif;
                ?>

                  Previous

                  Next

    <?php endif; ?>

            <?php if (get_row_layout() == 'post_carousel'): ?>

                              <?php if (get_sub_field('title')) : ?>

<?php the_sub_field('title'); ?>

                              <?php endif; ?>

                                              <?php
                                           global $post;
                                            // Item size (set here the number of posts for each group)
                                            $i = 3;
                                         // Get the posts
                                          $myposts = get_sub_field('featured_posts');
                                          // If there are posts
                                          if($myposts):
                                            // Groups the posts in groups of $i
                                            $chunks = array_chunk($myposts, $i);
                                            $html = "";
                                            /*
                                             * Item
                                             * For each group (chunk) it generates an item
                                             */
                                            foreach($chunks as $chunk):
                                              // Sets as 'active' the first items
                                              ($chunk === reset($chunks)) ? $active = "active" : $active = "";
                                              $html .= '
';
                                              /*
                                               * Posts inside the current Item
                                               * For each item it generates the posts HTML
                                               */
                                              $events=$chunk;
                                              foreach($events as $post): setup_postdata($post);
                                                $html .= '
';
                                                if (has_post_thumbnail( $post->ID ) ):
                                                $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
                                                $html .= '

';
                                                endif;
                                                $html .= '
';
                                                $html .= ''.get_the_title().'
';
                                                $blurb = get_the_excerpt();
                                                $html .=  string_limit_words($blurb,8);
                                                $html .= '
';
                                                $html .= '';
                                                $html .= '
';
                                               endforeach;
                                                wp_reset_postdata();
                                                $html .= '
';
                                            endforeach;
                                            // Prints the HTML
                                            echo $html;
                                          endif;
                                          ?>

                                            Previous

                                            Next

                                              <?php
                                           global $post;
                                            // Item size (set here the number of posts for each group)
                                            $i = 1;
                                         // Get the posts
                                          $myposts = get_sub_field('featured_posts');
                                          // If there are posts
                                          if($myposts):
                                            // Groups the posts in groups of $i
                                            $chunks = array_chunk($myposts, $i);
                                            $html = "";
                                            /*
                                             * Item
                                             * For each group (chunk) it generates an item
                                             */
                                            foreach($chunks as $chunk):
                                              // Sets as 'active' the first items
                                              ($chunk === reset($chunks)) ? $active = "active" : $active = "";
                                              $html .= '
';
                                              /*
                                               * Posts inside the current Item
                                               * For each item it generates the posts HTML
                                               */
                                              $events=$chunk;
                                              foreach($events as $post): setup_postdata($post);
                                                $html .= '
';
                                                if (has_post_thumbnail( $post->ID ) ):
                                                $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
                                                $html .= '

';
                                                endif;
                                                $html .= '
';
                                                $html .= ''.get_the_title().'
';
                                                $blurb = get_the_excerpt();
                                                $html .=  string_limit_words($blurb,8);
                                                $html .= '
';
                                                $html .= '';
                                                $html .= '
';
                                               endforeach;
                                                wp_reset_postdata();
                                                $html .= '
';
                                            endforeach;
                                            // Prints the HTML
                                            echo $html;
                                          endif;
                                          ?>

                                            Previous

                                            Next

                              <?php endif; ?>

        <?php endwhile; ?>
        <?php endif; ?>
    <?php endwhile;?>
  <?php endif; ?>

<?php endwhile; ?>


text:
package org.hisp.dhis.interceptor;

import java.util.HashMap;
import java.util.Map;

import org.hisp.dhis.setting.StyleManager;
import org.hisp.dhis.user.UserSettingKey;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;

/**
 * @author mortenoh
 */
public class UserSettingInterceptor
    implements Interceptor
{
    // -------------------------------------------------------------------------
    // Dependencies
    // -------------------------------------------------------------------------

    private StyleManager styleManager;

    public void setStyleManager( StyleManager styleManager )
    {
        this.styleManager = styleManager;
    }

    // -------------------------------------------------------------------------
    // UserSettingInterceptor implementation
    // -------------------------------------------------------------------------

    @Override
    public void destroy()
    {
    }

    @Override
    public void init()
    {
    }

    @Override
    public String intercept( ActionInvocation invocation )
        throws Exception
    {
        Map<String, Object> map = new HashMap<>();

        map.put( UserSettingKey.STYLE.getName(), styleManager.getCurrentStyle() );

        invocation.getStack().push( map );

        return invocation.invoke();
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Reflection;

[assembly: CLSCompliant(true)]

[assembly: AssemblyProduct("NetMonkey")]
[assembly: AssemblyCompany("")]

#if DEBUG
[assembly: AssemblyConfiguration("Debug")]
#else
[assembly: AssemblyConfiguration("Release")]
#endif
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]


text:
#ifndef AVIONICS_SERVO_FIRMWARE_R22_H_
#define AVIONICS_SERVO_FIRMWARE_R22_H_

#include <stdbool.h>

// Initialize hardware for R22 communications.
void R22Init(void);

// Hardware signals.
bool R22GetFaultMon(void);
bool R22GetClampMon(void);
void R22SetClampOverride(void);
void R22ClearClampOverride(void);
void R22EnableClamp(void);
void R22DisableClamp(void);

#endif  // AVIONICS_SERVO_FIRMWARE_R22_H_


text:
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-migrations xmlns="http://doctrine-project.org/schemas/migrations/configuration"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://doctrine-project.org/schemas/migrations/configuration
                    http://doctrine-project.org/schemas/migrations/configuration.xsd">

    <name>Doctrine Sandbox Migrations</name>
    <migrations-directory>.</migrations-directory>
    <migrations-namespace>DoctrineMigrationsTest</migrations-namespace>
    <table name="doctrine_migration_versions_test" />

</doctrine-migrations>


text:
'use strict';

module.exports = function (N, apiPath) {

  N.validate(apiPath, {
    $query: { type: 'object', required: false }
  });

  // Parse querystring
  //
  N.wire.before(apiPath, { priority: -20 }, function parse_query(env) {
    env.data.search_params = Object.assign({}, env.params.$query);

    let is_empty = Object.keys(env.data.search_params).length === 0;

    // - sort list of all users by hid in reverse
    // - sort any searches by nick

    if (!env.data.search_params.sort_by) {
      env.data.search_params.sort_by = is_empty ? 'hid' : 'nick';
    }

    if (!env.data.search_params.sort_order) {
      env.data.search_params.sort_order = is_empty ? 'desc' : 'asc';
    }
  });

  // Call search method (it also validates search query)
  //
  N.wire.before(apiPath, function call_search(env) {
    return N.wire.emit('server:admin.users.members.search.list', env);
  });

  // Fill head
  //
  N.wire.on(apiPath, function fill_head(env) {
    env.res.head = env.res.head || {};
    env.res.head.title = env.t('title');
  });

  // Prepare profile fields for the search form
  //
  N.wire.after(apiPath, async function create_search_form(env) {
    let search_params = env.data.search_params;

    env.res.fields = env.res.fields || [];

    env.res.fields.push({
      name:     'nick',
      value:    search_params.nick,
      priority: 10
    });

    env.res.fields.push({
      name:     'usergroup',
      value:    search_params.usergroup,
      values:   await N.settings.customizers.usergroups(),
      priority: 20
    });

    env.res.fields.push({
      name:     'email',
      value:    search_params.email,
      priority: 30
    });

    env.res.fields.push({
      name:     'reg_date',
      value:    [ search_params.reg_date_from, search_params.reg_date_to ],
      priority: 40
    });

    //env.res.fields.push({
    //  name:     'post_count',
    //  value:    [ search_params.post_count_from, search_params.post_count_to ],
    //  priority: 50
    //});

    if (N.config.users?.about) {
      for (let name of Object.keys(N.config.users.about)) {
        env.res.fields.push({
          name,
          value:    search_params[name],
          priority: N.config.users.about[name].priority
        });
      }
    }

    env.res.fields = env.res.fields.sort((a, b) => a.priority - b.priority);
  });
};


text:
from CTFd import create_app
from sqlalchemy_utils import database_exists, create_database, drop_database
from sqlalchemy.engine.url import make_url

def create_ctfd(ctf_name="CTFd", name="admin", email="admin@ctfd.io", password="password"):
    app = create_app('CTFd.config.TestingConfig')

    url = make_url(app.config['SQLALCHEMY_DATABASE_URI'])
    if url.drivername == 'postgres':
        url.drivername = 'postgresql'

    if database_exists(url):
        drop_database(url)
        create_database(url)
        with app.app_context():
            app.db.create_all()

    with app.app_context():
        with app.test_client() as client:
            data = {}
            r = client.get('/setup')  # Populate session with nonce
            with client.session_transaction() as sess:
                data = {
                    "ctf_name": ctf_name,
                    "name": name,
                    "email": email,
                    "password": password,
                    "nonce": sess.get('nonce')
                }
            client.post('/setup', data=data)
    return app

def register_user(app, name="user", email="user@ctfd.io", password="password"):
    with app.app_context():
        with app.test_client() as client:
            r = client.get('/register')
            with client.session_transaction() as sess:
                data = {
                    "name": name,
                    "email": email,
                    "password": password,
                    "nonce": sess.get('nonce')
                }
            client.post('/register', data=data)

def login_as_user(app, name="user", password="password"):
    with app.app_context():
        with app.test_client() as client:
            r = client.get('/login')
            with client.session_transaction() as sess:
                data = {
                    "name": name,
                    "password": password,
                    "nonce": sess.get('nonce')
                }
            client.post('/login', data=data)
            return client


text:
package com.amazonaws.services.directconnect.model.transform;

import java.util.List;
import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.directconnect.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * LagMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class LagMarshaller {

    private static final MarshallingInfo<String> CONNECTIONSBANDWIDTH_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("connectionsBandwidth").build();
    private static final MarshallingInfo<Integer> NUMBEROFCONNECTIONS_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("numberOfConnections").build();
    private static final MarshallingInfo<String> LAGID_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("lagId").build();
    private static final MarshallingInfo<String> OWNERACCOUNT_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ownerAccount").build();
    private static final MarshallingInfo<String> LAGNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("lagName").build();
    private static final MarshallingInfo<String> LAGSTATE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("lagState").build();
    private static final MarshallingInfo<String> LOCATION_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("location").build();
    private static final MarshallingInfo<String> REGION_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("region").build();
    private static final MarshallingInfo<Integer> MINIMUMLINKS_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("minimumLinks").build();
    private static final MarshallingInfo<String> AWSDEVICE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("awsDevice").build();
    private static final MarshallingInfo<String> AWSDEVICEV2_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("awsDeviceV2").build();
    private static final MarshallingInfo<String> AWSLOGICALDEVICEID_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("awsLogicalDeviceId").build();
    private static final MarshallingInfo<List> CONNECTIONS_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("connections").build();
    private static final MarshallingInfo<Boolean> ALLOWSHOSTEDCONNECTIONS_BINDING = MarshallingInfo.builder(MarshallingType.BOOLEAN)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("allowsHostedConnections").build();
    private static final MarshallingInfo<Boolean> JUMBOFRAMECAPABLE_BINDING = MarshallingInfo.builder(MarshallingType.BOOLEAN)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("jumboFrameCapable").build();
    private static final MarshallingInfo<String> HASLOGICALREDUNDANCY_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("hasLogicalRedundancy").build();
    private static final MarshallingInfo<List> TAGS_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("tags").build();
    private static final MarshallingInfo<String> PROVIDERNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("providerName").build();
    private static final MarshallingInfo<Boolean> MACSECCAPABLE_BINDING = MarshallingInfo.builder(MarshallingType.BOOLEAN)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("macSecCapable").build();
    private static final MarshallingInfo<String> ENCRYPTIONMODE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("encryptionMode").build();
    private static final MarshallingInfo<List> MACSECKEYS_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("macSecKeys").build();

    private static final LagMarshaller instance = new LagMarshaller();

    public static LagMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(Lag lag, ProtocolMarshaller protocolMarshaller) {

        if (lag == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(lag.getConnectionsBandwidth(), CONNECTIONSBANDWIDTH_BINDING);
            protocolMarshaller.marshall(lag.getNumberOfConnections(), NUMBEROFCONNECTIONS_BINDING);
            protocolMarshaller.marshall(lag.getLagId(), LAGID_BINDING);
            protocolMarshaller.marshall(lag.getOwnerAccount(), OWNERACCOUNT_BINDING);
            protocolMarshaller.marshall(lag.getLagName(), LAGNAME_BINDING);
            protocolMarshaller.marshall(lag.getLagState(), LAGSTATE_BINDING);
            protocolMarshaller.marshall(lag.getLocation(), LOCATION_BINDING);
            protocolMarshaller.marshall(lag.getRegion(), REGION_BINDING);
            protocolMarshaller.marshall(lag.getMinimumLinks(), MINIMUMLINKS_BINDING);
            protocolMarshaller.marshall(lag.getAwsDevice(), AWSDEVICE_BINDING);
            protocolMarshaller.marshall(lag.getAwsDeviceV2(), AWSDEVICEV2_BINDING);
            protocolMarshaller.marshall(lag.getAwsLogicalDeviceId(), AWSLOGICALDEVICEID_BINDING);
            protocolMarshaller.marshall(lag.getConnections(), CONNECTIONS_BINDING);
            protocolMarshaller.marshall(lag.getAllowsHostedConnections(), ALLOWSHOSTEDCONNECTIONS_BINDING);
            protocolMarshaller.marshall(lag.getJumboFrameCapable(), JUMBOFRAMECAPABLE_BINDING);
            protocolMarshaller.marshall(lag.getHasLogicalRedundancy(), HASLOGICALREDUNDANCY_BINDING);
            protocolMarshaller.marshall(lag.getTags(), TAGS_BINDING);
            protocolMarshaller.marshall(lag.getProviderName(), PROVIDERNAME_BINDING);
            protocolMarshaller.marshall(lag.getMacSecCapable(), MACSECCAPABLE_BINDING);
            protocolMarshaller.marshall(lag.getEncryptionMode(), ENCRYPTIONMODE_BINDING);
            protocolMarshaller.marshall(lag.getMacSecKeys(), MACSECKEYS_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
// system
#include <stdint.h>
#include <stddef.h>
#include <iostream>
#include <fstream>
#include <ctime>
#include <exception>
#include <sstream>
#include <iomanip>
#include <vector>
#include <cmath>
#include <valarray>

// testing framework & libraries
#include <gtest/gtest.h>

// google logger
#include <glog/logging.h>

#include <VisionCore/Buffers/Buffer3D.hpp>

static constexpr std::size_t BufferSizeX = 1025;
static constexpr std::size_t BufferSizeY = 769;
static constexpr std::size_t BufferSizeZ = 5;
typedef uint32_t BufferElementT;

class Test_Buffer3D : public ::testing::Test
{
public:
    Test_Buffer3D()
    {

    }

    virtual ~Test_Buffer3D()
    {

    }
};

TEST_F(Test_Buffer3D, CPU)
{
    vc::Buffer3DManaged<BufferElementT, vc::TargetHost> bufcpu(BufferSizeX,BufferSizeY,BufferSizeZ);

    ASSERT_TRUE(bufcpu.isValid()) << "Wrong managed state";
    ASSERT_EQ(bufcpu.width(), BufferSizeX) << "Wrong managed width size";
    ASSERT_EQ(bufcpu.height(), BufferSizeY) << "Wrong managed height size";
    ASSERT_EQ(bufcpu.depth(), BufferSizeZ) << "Wrong managed depth size";
    ASSERT_EQ(bufcpu.bytes(), BufferSizeX * BufferSizeY * BufferSizeZ * sizeof(BufferElementT)) << "Wrong managed size bytes";

    for(std::size_t z = 0 ; z < bufcpu.depth() ; ++z)
    {
        for(std::size_t y = 0 ; y < bufcpu.height() ; ++y)
        {
            for(std::size_t x = 0 ; x < bufcpu.width() ; ++x)
            {
                bufcpu(x,y,z) = z * (bufcpu.width() * bufcpu.height()) + y * bufcpu.width() + x;
            }
        }
    }

    vc::Buffer3DView<BufferElementT, vc::TargetHost> viewcpu(bufcpu);

    ASSERT_TRUE(viewcpu.isValid()) << "Wrong view state";
    ASSERT_EQ(viewcpu.width(), BufferSizeX) << "Wrong view width size";
    ASSERT_EQ(viewcpu.height(), BufferSizeY) << "Wrong view height size";
    ASSERT_EQ(viewcpu.depth(), BufferSizeZ) << "Wrong view height size";

    for(std::size_t z = 0 ; z < viewcpu.depth() ; ++z)
    {
        for(std::size_t y = 0 ; y < viewcpu.height() ; ++y)
        {
            for(std::size_t x = 0 ; x < viewcpu.width() ; ++x)
            {
                ASSERT_EQ(viewcpu(x,y,z), viewcpu.ptr()[z * (viewcpu.elementPlanePitch()) + y * viewcpu.elementPitch() + x]) << "Wrong data at " << x << " , " << y << " , " << z;
            }
        }
    }
}


text:
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

defined('MOODLE_INTERNAL') || die();

$string['cc2moodle_checking_schema'] = 'Common Cartridge 格式!請檢查結構...';
$string['cc2moodle_invalid_schema'] = '此結構無效。';
$string['cc2moodle_manifest_dont_load'] = '無法讀取XML裝載清單';
$string['cc2moodle_req_auth'] = '錯誤:必須認證Common Cartridge包';
$string['cc2moodle_valid_schema'] = '模式無效!';
$string['cc_import_req_dom'] = '錯誤:匯入Common Cartridge需要DOM擴充元件。';
$string['cc_import_req_libxml'] = '錯誤:匯入Common Cartridge需要LIBXML擴充元件。';
$string['cc_import_req_libxmlminversion'] = '錯誤:匯入Common Cartridge需要LIBXML2.6.30以上版本。';
$string['cc_import_req_php5'] = '錯誤:匯入Common Cartridge需要PHP5以上版本。';
$string['cc_import_req_xsl'] = '錯誤:匯入Common Cartridge需要XSL。';
$string['checkingforimscc'] = '檢查IMS-CC...';
$string['enable_cc_import'] = '允許匯入Common Cartridge';
$string['enable_cc_import_description'] = '這個設定允許匯入標準還原功能的Common Cartridge(IMS-CC)格式,這功能需要在伺服器上安裝PHP5,DOM,XSL和LIBXML(2.6.30以上版本)擴充元件。';


text:
import requests
from requests.exceptions import RequestException
import random
import json
from common.instances import logging_instance
from json import JSONDecodeError
from retrying import retry
from spider.consts import RETRY_TIMES, STOP_MAX_DELAY, WAIT_FIXED

logger = logging_instance(__name__)

class Proxies(object):

    _proxies = []

    @classmethod
    def refresh_proxies(cls):
        cls._proxies = cls._get_proxies()

    @staticmethod
    @retry(stop_max_attempt_number=RETRY_TIMES, stop_max_delay=STOP_MAX_DELAY,
           wait_fixed=WAIT_FIXED)
    def _get_proxies():
        try:
            r = requests.get("http://123.207.153.235:5051/get_all/")
            if r.status_code == 200:
                return json.loads(r.text)
        except RequestException as e:
            logger.error(e)
            raise e
        except JSONDecodeError as e:
            logger.error(e)
            raise e

    @classmethod
    def get_random_proxy(cls):
        if len(cls._proxies) == 0:
            cls.refresh_proxies()
        return random.choice(cls._proxies)

    @classmethod
    def get_proxies(cls, number=400):
        if len(cls._proxies) == 0:
            cls.refresh_proxies()
        if len(cls._proxies) < number:
            return cls._proxies
        return random.choices(cls._proxies, k=number)

    @classmethod
    def remove_proxy(cls, proxy):
        return cls._proxies.remove(proxy)


text:
;(function($){
	$.fn.extend({
		Tabs:function(options){
			// 处理参数
			options = $.extend({
				event : 'mouseover',
				timeout : 0,
				auto : 0,
				callback : null
			}, options);

			var self = $(this),
				tabBox = self.children( 'div.tab_box' ).children( 'div' ),
				menu = self.children( 'ul.tab_menu' ),
				items = menu.find( 'li' ),
				timer;

			var tabHandle = function( elem ){
					elem.siblings( 'li' )
						.removeClass( 'current' )
						.end()
						.addClass( 'current' );

					tabBox.siblings( 'div' )
						.addClass( 'hide' )
						.end()
						.eq( elem.index() )
						.removeClass( 'hide' );
				},

				delay = function( elem, time ){
					time ? setTimeout(function(){ tabHandle( elem ); }, time) : tabHandle( elem );
				},

				start = function(){
					if( !options.auto ) return;
					timer = setInterval( autoRun, options.auto );
				},

				autoRun = function(){
					var current = menu.find( 'li.current' ),
						firstItem = items.eq(0),
						len = items.length,
						index = current.index() + 1,
						item = index === len ? firstItem : current.next( 'li' ),
						i = index === len ? 0 : index;

					current.removeClass( 'current' );
					item.addClass( 'current' );

					tabBox.siblings( 'div' )
						.addClass( 'hide' )
						.end()
						.eq(i)
						.removeClass( 'hide' );
				};

			items.bind( options.event, function(){
				delay( $(this), options.timeout );
				if( options.callback ){
					options.callback( self );
				}
			});

			if( options.auto ){
				start();
				self.hover(function(){
					clearInterval( timer );
					timer = undefined;
				},function(){
					start();
				});
			}

			return this;
		}
	});
})(jQuery);


text:
package summingbird

import sbt._
import Keys._
import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings
import com.typesafe.tools.mima.plugin.MimaKeys.previousArtifact

object SummingbirdBuild extends Build {
  def withCross(dep: ModuleID) =
    dep cross CrossVersion.binaryMapped {
      case "2.9.3" => "2.9.2" // TODO: hack because twitter hasn't built things against 2.9.3
      case version if version startsWith "2.10" => "2.10" // TODO: hack because sbt is broken
      case x => x
    }

  def specs2Import(scalaVersion: String) = scalaVersion match {
      case version if version startsWith "2.9" => "org.specs2" %% "specs2" % "1.12.4.1" % "test"
      case version if version startsWith "2.10" => "org.specs2" %% "specs2" % "1.13" % "test"
  }

  val extraSettings = Project.defaultSettings ++ mimaDefaultSettings

  val sharedSettings = extraSettings ++ Seq(
    organization := "com.twitter",
    version := "0.4.0rc1",
    scalaVersion := "2.9.3",
    crossScalaVersions := Seq("2.9.3", "2.10.0"),
    libraryDependencies ++= Seq(
      "org.slf4j" % "slf4j-api" % slf4jVersion,
      "org.scalacheck" %% "scalacheck" % "1.10.0" % "test",
      // These satisify's scaldings log4j needs when in test mode
      "log4j" % "log4j" % "1.2.16" % "test",
      "org.slf4j" % "slf4j-log4j12" % slf4jVersion % "test"
    ),

    libraryDependencies <+= scalaVersion(specs2Import(_)),

    resolvers ++= Seq(
      Opts.resolver.sonatypeSnapshots,
      Opts.resolver.sonatypeReleases,
      "Clojars Repository" at "http://clojars.org/repo",
      "Conjars Repository" at "http://conjars.org/repo",
      "Twitter Maven" at "http://maven.twttr.com"
    ),

    parallelExecution in Test := true,

    scalacOptions ++= Seq(
      "-unchecked",
      "-deprecation",
      "-Yresolve-term-conflict:package"
    ),

    // Publishing options:
    publishMavenStyle := true,

    publishArtifact in Test := false,

    pomIncludeRepository := { x => false },

    publishTo <<= version { v =>
      Some(
        if (v.trim.toUpperCase.endsWith("SNAPSHOT"))
          Opts.resolver.sonatypeSnapshots
        else
          Opts.resolver.sonatypeStaging
          //"twttr" at "http://artifactory.local.twitter.com/libs-releases-local"
      )
    },

    pomExtra := (
      <url>https://github.com/twitter/summingbird</url>
      <licenses>
        <license>
          <name>Apache 2</name>
          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
          <distribution>repo</distribution>
          <comments>A business-friendly OSS license</comments>
        </license>
      </licenses>
      <scm>
        <url>git@github.com:twitter/summingbird.git</url>
        <connection>scm:git:git@github.com:twitter/summingbird.git</connection>
      </scm>
      <developers>
        <developer>
          <id>oscar</id>
          <name>Oscar Boykin</name>
          <url>http://twitter.com/posco</url>
        </developer>
        <developer>
          <id>sritchie</id>
          <name>Sam Ritchie</name>
          <url>http://twitter.com/sritchie</url>
        </developer>
        <developer>
          <id>asinghal</id>
          <name>Ashutosh Singhal</name>
          <url>http://twitter.com/daashu</url>
        </developer>
      </developers>)
  )

  lazy val summingbird = Project(
    id = "summingbird",
    base = file("."),
    settings = sharedSettings ++ DocGen.publishSettings
  ).settings(
    test := { },
    publish := { }, // skip publishing for this root project.
    publishLocal := { }
  ).aggregate(
    summingbirdCore,
    summingbirdBatch,
    summingbirdBatchHadoop,
    summingbirdOnline,
    summingbirdClient,
    summingbirdStorm,
    summingbirdStormTest,
    summingbirdScalding,
    summingbirdScaldingTest,
    summingbirdBuilder,
    summingbirdChill,
    summingbirdExample
  )

  val dfsDatastoresVersion = "1.3.4"
  val bijectionVersion = "0.6.2"
  val algebirdVersion = "0.5.0"
  val scaldingVersion = "0.9.0rc15"
  //val storehausVersion = "0.9.0rc2"
  val storehausVersion = "0.8.0"
  val utilVersion = "6.3.8"
  val chillVersion = "0.3.6"
  val tormentaVersion = "0.7.0"

  lazy val slf4jVersion = "1.6.6"

  /**
    * This returns the youngest jar we released that is compatible with
    * the current.
    */
  val unreleasedModules = Set[String]()

  def youngestForwardCompatible(subProj: String) =
    Some(subProj)
      .filterNot(unreleasedModules.contains(_))
      .map { s => "com.twitter" % ("summingbird-" + s + "_2.9.3") % "0.3.0" }

  def module(name: String) = {
    val id = "summingbird-%s".format(name)
    Project(id = id, base = file(id), settings = sharedSettings ++ Seq(
      Keys.name := id,
      previousArtifact := youngestForwardCompatible(name))
    )
  }

  lazy val summingbirdBatch = module("batch").settings(
    libraryDependencies ++= Seq(
      "com.twitter" %% "algebird-core" % algebirdVersion,
      "com.twitter" %% "bijection-core" % bijectionVersion,
      "com.twitter" %% "scalding-date" % scaldingVersion
    )
  )

  lazy val summingbirdChill = module("chill").settings(
    libraryDependencies ++= Seq(
      "com.twitter" %% "chill" % chillVersion,
      "com.twitter" %% "chill-bijection" % chillVersion
    )
  ).dependsOn(
      summingbirdCore,
      summingbirdBatch
  )

  lazy val summingbirdClient = module("client").settings(
    libraryDependencies ++= Seq(
      "com.twitter" %% "algebird-core" % algebirdVersion,
      "com.twitter" %% "algebird-util" % algebirdVersion,
      "com.twitter" %% "bijection-core" % bijectionVersion,
      "com.twitter" %% "storehaus-core" % storehausVersion,
      "com.twitter" %% "storehaus-algebra" % storehausVersion
    )
  ).dependsOn(summingbirdBatch)

  lazy val summingbirdCore = module("core").settings(
    libraryDependencies += "com.twitter" %% "algebird-core" % algebirdVersion
  )

  lazy val summingbirdOnline = module("online").settings(
    libraryDependencies ++= Seq(
      "com.twitter" %% "algebird-core" % algebirdVersion,
      "com.twitter" %% "bijection-core" % bijectionVersion,
      "com.twitter" %% "storehaus-core" % storehausVersion,
      "com.twitter" %% "chill" % chillVersion,
      "com.twitter" %% "storehaus-algebra" % storehausVersion,
      withCross("com.twitter" %% "util-core" % utilVersion)
    )
  ).dependsOn(
    summingbirdCore % "test->test;compile->compile"
  )

  lazy val summingbirdStorm = module("storm").settings(
    parallelExecution in Test := false,
    libraryDependencies ++= Seq(
      "com.twitter" %% "algebird-core" % algebirdVersion,
      "com.twitter" %% "bijection-core" % bijectionVersion,
      "com.twitter" %% "chill" % chillVersion,
      "com.twitter" % "chill-storm" % chillVersion,
      "com.twitter" %% "chill-bijection" % chillVersion,
      "com.twitter" %% "storehaus-core" % storehausVersion,
      "com.twitter" %% "storehaus-algebra" % storehausVersion,
      "com.twitter" %% "scalding-args" % scaldingVersion,
      "com.twitter" %% "tormenta-core" % tormentaVersion,
      withCross("com.twitter" %% "util-core" % utilVersion),
      "storm" % "storm" % "0.9.0-wip15" % "provided"
    )
  ).dependsOn(
    summingbirdCore % "test->test;compile->compile",
    summingbirdOnline,
    summingbirdChill,
    summingbirdBatch
  )

  lazy val summingbirdStormTest = module("storm-test").settings(
    parallelExecution in Test := false,
    libraryDependencies ++= Seq(
      "com.twitter" %% "algebird-core" % algebirdVersion,
      "com.twitter" %% "bijection-core" % bijectionVersion,
      "com.twitter" %% "storehaus-core" % storehausVersion,
      "com.twitter" %% "storehaus-algebra" % storehausVersion,
      "com.twitter" %% "tormenta-core" % tormentaVersion,
      withCross("com.twitter" %% "util-core" % utilVersion),
      "storm" % "storm" % "0.9.0-wip15" % "provided"
    )
  ).dependsOn(
    summingbirdCore % "test->test;compile->compile",
    summingbirdStorm
  )

  lazy val summingbirdScalding = module("scalding").settings(
    libraryDependencies ++= Seq(
      "com.backtype" % "dfs-datastores" % dfsDatastoresVersion,
      "com.backtype" % "dfs-datastores-cascading" % dfsDatastoresVersion,
      "com.twitter" %% "algebird-core" % algebirdVersion,
      "com.twitter" %% "algebird-util" % algebirdVersion,
      "com.twitter" %% "algebird-bijection" % algebirdVersion,
      "com.twitter" %% "bijection-json" % bijectionVersion,
      "com.twitter" %% "chill" % chillVersion,
      "com.twitter" % "chill-hadoop" % chillVersion,
      "com.twitter" %% "chill-bijection" % chillVersion,
      "commons-lang" % "commons-lang" % "2.6",
      "com.twitter" %% "scalding-core" % scaldingVersion,
      "com.twitter" %% "scalding-commons" % scaldingVersion
    )
  ).dependsOn(
    summingbirdCore % "test->test;compile->compile",
    summingbirdChill,
    summingbirdBatchHadoop,
    summingbirdBatch
  )

  lazy val summingbirdScaldingTest = module("scalding-test").settings(
    libraryDependencies ++= Seq(
      "org.scalacheck" %% "scalacheck" % "1.10.0"
    )
  ).dependsOn(
    summingbirdCore % "test->test;compile->compile",
    summingbirdChill,
    summingbirdBatchHadoop,
    summingbirdScalding
  )

  lazy val summingbirdBatchHadoop = module("batch-hadoop").settings(
    libraryDependencies ++= Seq(
      "com.backtype" % "dfs-datastores" % dfsDatastoresVersion,
      "com.twitter" %% "algebird-core" % algebirdVersion,
      "com.twitter" %% "bijection-json" % bijectionVersion,
      "com.twitter" %% "scalding-date" % scaldingVersion
    )
  ).dependsOn(
    summingbirdCore % "test->test;compile->compile",
    summingbirdBatch
  )

  lazy val summingbirdBuilder = module("builder").settings(
    libraryDependencies ++= Seq(
      "storm" % "storm" % "0.9.0-wip15" % "provided"
    )
  ).dependsOn(
    summingbirdCore,
    summingbirdStorm,
    summingbirdScalding
  )

  lazy val summingbirdExample = module("example").settings(
    libraryDependencies ++= Seq(
      "log4j" % "log4j" % "1.2.16",
      "org.slf4j" % "slf4j-log4j12" % slf4jVersion,
      "storm" % "storm" % "0.9.0-wip15" exclude("org.slf4j", "log4j-over-slf4j") exclude("ch.qos.logback", "logback-classic"),
      "com.twitter" %% "bijection-netty" % bijectionVersion,
      "com.twitter" %% "tormenta-twitter" % tormentaVersion,
      "com.twitter" %% "storehaus-memcache" % storehausVersion
    )
  ).dependsOn(summingbirdCore, summingbirdStorm)
}


text:
require 'morpheus/api/api_client'

class Morpheus::PingInterface < Morpheus::APIClient

  # no Authorization header is required
  def authorization_required?
    false
  end

  # health checks use a relatively small timeout by default
  def default_timeout
    5
  end

  def get(params={})
    headers = {params: params}
    # use access token if authenticated
    headers[:authorization] = "Bearer #{@access_token}" if @access_token
    execute(method: :get, url: "/api/ping", headers: headers)
  end

end


text:
using UnityEngine;
using System.Collections;

public class MoneyBag : MonoBehaviour {

	public int coinsInWorld;
	public Hud hud;

	public int coinsInBag;

	// Use this for initialization
	void Start () {
		coinsInBag = 0;
	}

	public void PickupCoin () {
		coinsInBag++;
		hud.DisplayMoneyBag ();
	}
}


text: Demo for the book High Performance JavaScript


text:
var express = require('express');
var bodyParser = require('body-parser');
var path = require('path');
var app = express();
require('./app_api/models/db');
var routesApi = require('./app_api/routes/index');

app.set('view engine', 'ejs');
app.use('/uploads', express.static(path.join(__dirname, 'uploads')));

//app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
    extended: true
}));

app.all("/api/*", function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Headers", "Cache-Control, Pragma, Origin, Authorization, Content-Type, X-Requested-With");
    res.header("Access-Control-Allow-Methods", "GET, PUT, POST, DELETE");
    return next();
});

app.use('/api', routesApi);

app.use(function(req, res) {
    res.render('index');
});

// catch 404 and forward to error handler
app.use(function(req, res, next) {
    var err = new Error('Not Found');
    err.status = 404;
    next(err);
});

// error handlers

//  Catch unauthorised errors
app.use(function(err, req, res, next) {
    if (err.name === 'UnauthorizedError') {
        res.status(401);
        res.json({
            "message": err.name + ": " + err.message
        });
    }
});

// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
    app.use(function(err, req, res, next) {
        res.status(err.status || 500);
        res.render('error', {
            message: err.message,
            error: err
        });
    });
}

// production error handler
// no stacktraces leaked to user
app.use(function(err, req, res, next) {
    res.status(err.status || 500);
    res.render('error', {
        message: err.message,
        error: {}
    });
});

module.exports = app;
app.listen(3333, function() {
    console.log(' app listening on port 3333!');
});


text:
using namespace NetworkImportingKit;
using namespace BuilderElementsCommonKit;

CInputFactory::CInputFactory(void)
	// Base class constructors invocation
	: CCmnElement()
	, CCmnBuilderElement()
	, CCmnDataFlow()
	, CCmnDataConnector()
	, CCmnLayer()
	// ICommon  data fields initialization
	, numRef_(0)
{
	// IElement data fields initialization (declared in CCmnElement wrapper)
	elementType_ = ET_INPUT;
	sysName_ = "InputFactory";
	sysTitle_ = "Input Factory";
	sysShortName_ = "IF";
	// IBuilderElement data fields initialization (declared in CCmnBuilderElement wrapper)
	menuResourceId_ = IDR_ELEMENTS_POPUPS;
	subMenuResourceId_ = IDR_DF_INPUT_FACTORY_MENU_ITEM;
	layerBehaviour_ = true;
	elementTextureActive_ = _T("Input_Factory_Active");
	elementTexturePassive_ = _T("Input_Factory_Passive");
	imageWidth_ = SIZE_LAYER_IMAGE_WIDTH;
	imageHeight_ = SIZE_LAYER_IMAGE_HEIGHT;
	shortNameOffset_ = 10;
	nameOffset_ = 45;
	// IDataFlow data fields initialization (declared in CCmnDataFlow wrapper)
	// IDataConnector data fields initialization (declared in CCmnDataConnector wrapper)
	// ILayerControl data fields initialization (declared in CCmnLayerControl wrapper)
}

CInputFactory::~CInputFactory(void)
{
}

// Custom tools
void CInputFactory::PostInitialize()
{
	// Custom initializations
	CustomCreateWeights(
		ELEMENT_DEFAULT_INPUTS_COUNT,
		ELEMENT_DEFAULT_NEURONS_COUNT);
}

void CInputFactory::CustomCreateWeights(uint inputsCount, uint layerDimension)
{
	CCmnDataFlow::piElementData_->CreateFactory(layerDimension);

	CCmnLayer::layerDimension_ = layerDimension;
	CCmnLayer::inputsCount_ = inputsCount;
}

// IElement implementations section

// IBuilderElement implementations section

// IDataFlow implementations section
void CInputFactory::FlowData()
{
	CCmnLayer::FlowLayerData();
}

// IDataConnector implementations section

// ILayerCOntrol implementations section

// IStorageController implementations section
result CInputFactory::Serialize(FILEDev& fileDev, bool loading)
{
	CCmnElement::Serialize(fileDev, loading);
	CCmnBuilderElement::Serialize(fileDev, loading);
	CCmnDataFlow::Serialize(fileDev, loading);
	CCmnDataConnector::Serialize(fileDev, loading);
	CCmnLayer::Serialize(fileDev, loading);

	if (loading)
	{} else	{}

	return S_OK;
}

// ICommon implementations section
ulong CInputFactory::AddRef()
{
	return ++numRef_;
}

ulong CInputFactory::Release()
{
	--numRef_;

	if (numRef_ == 0)
	{
		delete this;
		return 0;
	}

	return numRef_;
}

String CInputFactory::GetClassString() const
{
	return _T("CInputFactory");
}

result CInputFactory::QueryInterface(REFIID iid, void** ppObject)
{
	if (iid == IID_ICommon)
	{
		*ppObject = (ICommon*)(IElement*)this;
	}
	else if (iid == IID_IElement)
	{
		*ppObject = (IElement*)this;
	}
	else if (iid == IID_IBuilderElement)
	{
		*ppObject = (IBuilderElement*)this;
	}
	else if (iid == IID_IDataFlow)
	{
		*ppObject = (IDataFlow*)this;
	}
	else if (iid == IID_IDataConnector)
	{
		*ppObject = (IDataConnector*)this;
	}
	else if (iid == IID_ILayerControl)
	{
		*ppObject = (ILayerControl*)this;
	}
	else if (iid == IID_IStorageController)
	{
		*ppObject = (IStorageController*)(CCmnElement*)this;
	}
	else
	{
		*ppObject = NULL;
		return E_NOINTERFACE;
	}

	((ICommon*)(IElement*)this)->AddRef();
	return S_OK;
}


text:
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/seq_file.h>
#include <linux/proc_fs.h>
#include <linux/uaccess.h>
#include <linux/ratelimit.h>
#include <asm/alignment.h>
#include <asm/processor.h>

static unsigned long se_user;
static unsigned long se_sys;
static unsigned long se_half;
static unsigned long se_word;
static unsigned long se_dword;
static unsigned long se_multi;
/* bitfield: 1: warn 2: fixup 4: signal -> combinations 2|4 && 1|2|4 are not
   valid! */
static int se_usermode = UM_WARN | UM_FIXUP;
/* 0: no warning 1: print a warning message, disabled by default */
static int se_kernmode_warn;

core_param(alignment, se_usermode, int, 0600);

void inc_unaligned_byte_access(void)
{
	se_half++;
}

void inc_unaligned_word_access(void)
{
	se_word++;
}

void inc_unaligned_dword_access(void)
{
	se_dword++;
}

void inc_unaligned_multi_access(void)
{
	se_multi++;
}

void inc_unaligned_user_access(void)
{
	se_user++;
}

void inc_unaligned_kernel_access(void)
{
	se_sys++;
}

/*
 * This defaults to the global policy which can be set from the command
 * line, while processes can overload their preferences via prctl().
 */
unsigned int unaligned_user_action(void)
{
	unsigned int action = se_usermode;

	if (current->thread.flags & SH_THREAD_UAC_SIGBUS) {
		action &= ~UM_FIXUP;
		action |= UM_SIGNAL;
	}

	if (current->thread.flags & SH_THREAD_UAC_NOPRINT)
		action &= ~UM_WARN;

	return action;
}

int get_unalign_ctl(struct task_struct *tsk, unsigned long addr)
{
	return put_user(tsk->thread.flags & SH_THREAD_UAC_MASK,
			(unsigned int __user *)addr);
}

int set_unalign_ctl(struct task_struct *tsk, unsigned int val)
{
	tsk->thread.flags = (tsk->thread.flags & ~SH_THREAD_UAC_MASK) |
			    (val & SH_THREAD_UAC_MASK);
	return 0;
}

void unaligned_fixups_notify(struct task_struct *tsk, insn_size_t insn,
			     struct pt_regs *regs)
{
	if (user_mode(regs) && (se_usermode & UM_WARN))
		pr_notice_ratelimited("Fixing up unaligned userspace access "
			  "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
			  tsk->comm, task_pid_nr(tsk),
			  (void *)instruction_pointer(regs), insn);
	else if (se_kernmode_warn)
		pr_notice_ratelimited("Fixing up unaligned kernel access "
			  "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
			  tsk->comm, task_pid_nr(tsk),
			  (void *)instruction_pointer(regs), insn);
}

static const char *se_usermode_action[] = {
	"ignored",
	"warn",
	"fixup",
	"fixup+warn",
	"signal",
	"signal+warn"
};

static int alignment_proc_show(struct seq_file *m, void *v)
{
	seq_printf(m, "User:\t\t%lu\n", se_user);
	seq_printf(m, "System:\t\t%lu\n", se_sys);
	seq_printf(m, "Half:\t\t%lu\n", se_half);
	seq_printf(m, "Word:\t\t%lu\n", se_word);
	seq_printf(m, "DWord:\t\t%lu\n", se_dword);
	seq_printf(m, "Multi:\t\t%lu\n", se_multi);
	seq_printf(m, "User faults:\t%i (%s)\n", se_usermode,
			se_usermode_action[se_usermode]);
	seq_printf(m, "Kernel faults:\t%i (fixup%s)\n", se_kernmode_warn,
			se_kernmode_warn ? "+warn" : "");
	return 0;
}

static int alignment_proc_open(struct inode *inode, struct file *file)
{
	return single_open(file, alignment_proc_show, NULL);
}

static ssize_t alignment_proc_write(struct file *file,
		const char __user *buffer, size_t count, loff_t *pos)
{
	int *data = PDE(file->f_path.dentry->d_inode)->data;
	char mode;

	if (count > 0) {
		if (get_user(mode, buffer))
			return -EFAULT;
		if (mode >= '0' && mode <= '5')
			*data = mode - '0';
	}
	return count;
}

static const struct file_operations alignment_proc_fops = {
	.owner		= THIS_MODULE,
	.open		= alignment_proc_open,
	.read		= seq_read,
	.llseek		= seq_lseek,
	.release	= single_release,
	.write		= alignment_proc_write,
};

/*
 * This needs to be done after sysctl_init, otherwise sys/ will be
 * overwritten.  Actually, this shouldn't be in sys/ at all since
 * it isn't a sysctl, and it doesn't contain sysctl information.
 * We now locate it in /proc/cpu/alignment instead.
 */
static int __init alignment_init(void)
{
	struct proc_dir_entry *dir, *res;

	dir = proc_mkdir("cpu", NULL);
	if (!dir)
		return -ENOMEM;

	res = proc_create_data("alignment", S_IWUSR | S_IRUGO, dir,
			       &alignment_proc_fops, &se_usermode);
	if (!res)
		return -ENOMEM;

        res = proc_create_data("kernel_alignment", S_IWUSR | S_IRUGO, dir,
			       &alignment_proc_fops, &se_kernmode_warn);
        if (!res)
                return -ENOMEM;

	return 0;
}
fs_initcall(alignment_init);


text:
<?php
declare( strict_types = 1 );
namespace Arrayly\Producers;

use Arrayly\Util\internals as utils;
final class RewindableProducer implements \Iterator
{
    /**
     * @var \Closure
     */
    private $supplier;
    /**
     * @var \Iterator
     */
    private $iterator;

    private function __construct( \Closure $iteratorSupplier ) {
        $this->supplier = $iteratorSupplier;
        $this->createIterator();
    }

    public static function ofIteratorSupplier(\Closure $iteratorSupplier):RewindableProducer {
        return new static($iteratorSupplier);
    }

    public static function ofIterable(iterable $iterable):RewindableProducer {
        if($iterable instanceof static) {

            return $iterable->newInstance();
        }
        $supplier = utils\iterableToRewindableIteratorSupplier($iterable);

        return static::ofIteratorSupplier($supplier);
    }

    private function createIterator() {
        $supplier = $this->supplier;
        $iterator = $supplier();
        $iterator = utils\iterableToIterator($iterator);

        $this->iterator = $iterator;
    }

    public function current()
    {
        return $this->iterator->current();
    }

    public function next()
    {
        $this->iterator->next();
    }

    public function key()
    {
        return $this->iterator->key();
    }

    public function valid()
    {
        return $this->iterator->valid();
    }

    public function rewind()
    {
        $this->createIterator();
    }

    public function newInstance():RewindableProducer {
        return new static($this->supplier);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.btrax.on_task" >

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="com.google.android.permission.PROVIDE_BACKGROUND" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

    <uses-feature android:name="android.hardware.type.watch" />

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.DeviceDefault" >

        <activity
            android:name=".activity.InputActivity"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <service
            android:name=".service.MyWatchFaceService"
            android:allowEmbedded="true"
            android:label="@string/watch_face_name"
            android:permission="android.permission.BIND_WALLPAPER"
            android:taskAffinity="">
            <meta-data
                android:name="android.service.wallpaper"
                android:resource="@xml/watch_face" />
            <meta-data
                android:name="com.google.android.wearable.watchface.preview"
                android:resource="@drawable/watch_face_preview" />
            <meta-data
                android:name="com.google.android.wearable.watchface.preview_circular"
                android:resource="@drawable/watch_face_preview_circular" />

            <intent-filter>
                <action android:name="android.service.wallpaper.WallpaperService" />
                <category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
            </intent-filter>
        </service>
    </application>

</manifest>


text:
<!DOCTYPE html>

  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>Stay Focused</title>

  <link href="css/bootstrap.min.css" rel="stylesheet">
  <link href="css/bootstrap-theme.min.css" rel="stylesheet">
  <link href="css/index.css" rel="stylesheet">

  {{#each accounts}}

{{login}}

{{password}}

{{workblock}}

{{breakblock}}

{{blockcount}}

  {{/each}}

STAY FOCUSED

The app to get $#!t done

    <form method="post" action="homepage.html">

<input type="text" name="login" value="" placeholder="Username or Email">

<input type="password" name="password" value="" placeholder="Password">

          <input type="checkbox" name="remember_me" id="remember_me">
          Remember me on this computer

<input type="submit" name="commit" value="Login">

<input type="submit" name="commit" value="New User">

    </form>

Forgot your password? Click here to reset it.


text:
module Faker
  class LoremPixel < Base
    class << self
      SUPPORTED_CATEGORIES = %w[abstract
                                animals
                                business
                                cats
                                city
                                food
                                nightlife
                                fashion
                                people
                                nature
                                sports
                                technics
                                transport].freeze

      # rubocop:disable Metrics/ParameterLists
      def image(size = '300x300', is_gray = false, category = nil, number = nil, text = nil, secure: true)
        raise ArgumentError, 'Size should be specified in format 300x300' unless size =~ /^[0-9]+x[0-9]+$/
        raise ArgumentError, "Supported categories are #{SUPPORTED_CATEGORIES.join(', ')}" unless category.nil? || SUPPORTED_CATEGORIES.include?(category)
        raise ArgumentError, 'Category required when number is passed' if !number.nil? && category.nil?
        raise ArgumentError, 'Number must be between 1 and 10' unless number.nil? || (1..10).cover?(number)
        raise ArgumentError, 'Category and number must be passed when text is passed' if !text.nil? && number.nil? && category.nil?

        url_parts = secure ? ['https:/'] : ['http:/']
        url_parts << ['lorempixel.com']
        url_parts << 'g' if is_gray
        url_parts += size.split('x')
        url_parts += [category, number, text].compact
        url_parts.join('/')
      end
      # rubocop:enable Metrics/ParameterLists
    end
  end
end


text:
'use strict';
/* global describe, it */

var assert = require('assert');
var pattern = require('hyphenation.de');
var extractor = require('../index.js')(pattern);

describe('words-and-hyphens', function () {

    describe('unit tests', function () {

        describe('uniqueWords', function () {

            it('should return an array of unique words', function () {
                var output = extractor.uniqueWords('My, schöner st[ring] *full* of %punct) "and\' of the\r same Same same words.\n');
                assert.strictEqual(output[0], 'and');
                assert.strictEqual(output[1], 'full');
                assert.strictEqual(output[2], 'My');
                assert.strictEqual(output[3], 'of');
                assert.strictEqual(output[4], 'punct');
                assert.strictEqual(output[5], 'ring');
                assert.strictEqual(output[6], 'same');
                assert.strictEqual(output[7], 'schöner');
                assert.strictEqual(output[8], 'st');
                assert.strictEqual(output[9], 'the');
                assert.strictEqual(output[10], 'words');
            });

            it('should return an array of unique case sensitive words', function () {
                var output = extractor.uniqueWords('My, st[ring] *full* of %punct) "and\' of the same Same same words.', true);
                assert.strictEqual(output[0], 'and');
                assert.strictEqual(output[1], 'full');
                assert.strictEqual(output[2], 'My');
                assert.strictEqual(output[3], 'of');
                assert.strictEqual(output[4], 'punct');
                assert.strictEqual(output[5], 'ring');
                assert.strictEqual(output[6], 'Same');
                assert.strictEqual(output[7], 'same');
                assert.strictEqual(output[8], 'st');
                assert.strictEqual(output[9], 'the');
                assert.strictEqual(output[10], 'words');
            });
        });

        describe('uniqueHyphens', function () {

           it('should return an array of lower-case unique hyphens', function () {
                var output = extractor.uniqueHyphens('Fischers\' Fritz fischt frische Fische.');
                assert.strictEqual(output[0], 'fi');
                assert.strictEqual(output[1], 'fischt');
                assert.strictEqual(output[2], 'fri');
                assert.strictEqual(output[3], 'fritz');
                assert.strictEqual(output[4], 'sche');
                assert.strictEqual(output[5], 'schers');
            });
        });
    });
});


text:
<ng-form name="vm.form">
  <vertical-section-layout section-title="Example Pre Step" on-save-edit="vm.onSave()" on-edit="vm.onEdit()" allow-edit="vm.allowEdit" editable="vm.editableSection" keep-editable-after-save="true"
                           is-valid="vm.form.$valid">

    <readonly-section>

          Name

            {{vm.model.tableOption.preStepName}}

          Age

            {{vm.model.tableOption.preStepAge}}

          Magic Word

            {{vm.model.tableOption.preStepMagicWord}}

    </readonly-section>

    <editable-section>
      <md-input-container class="md-block" flex-gt-sm>
        Name
        <input ng-model="vm.editModel.tableOption.preStepName" required>
        </input>
      </md-input-container>

      <md-input-container class="md-block" flex-gt-sm>
        Age
        <input name="preStepAge" ng-model="vm.editModel.tableOption.preStepAge" number required  ng-change="vm.ageChanged()">
        </input>

Required.

You must be at least 21 to continue.

      </md-input-container>

      <md-input-container class="md-block" flex-gt-sm>
        Magic Word
        <input  name="preStepMagicWord" ng-model="vm.editModel.tableOption.preStepMagicWord" required ng-change="vm.magicWordChanged()">
        </input>

Required.

Incorrect Magic Word.... try 'kylo'

        The magic word is 'kylo'
      </md-input-container>
    </editable-section>

  </vertical-section-layout>
</ng-form>


text:
import { fileExists } from '../utils';

import { BaseTool } from './base-tool';

export class ReadElfTool extends BaseTool {
    static get key() { return 'readelf-tool'; }

    async runTool(compilationInfo, inputFilename, args) {
        if(!compilationInfo.filters.binary)
        {
            return this.createErrorResponse('readelf requires an executable');
        }

        if (await fileExists(compilationInfo.executableFilename)) {
            return super.runTool(compilationInfo, compilationInfo.executableFilename, args);
        } else {
            return super.runTool(compilationInfo, compilationInfo.outputFilename, args);
        }
    }
}


text:
<?php

declare(strict_types=1);

namespace Sylius\Bundle\ResourceBundle\Tests\DependencyInjection\Compiler;

use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractCompilerPassTestCase;
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\DefinitionHasMethodCallConstraint;
use PHPUnit\Framework\Constraint\LogicalNot;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\RegisterResourceRepositoryPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;

final class RegisterResourceRepositoryPassTest extends AbstractCompilerPassTestCase
{
    /**
     * @test
     */
    public function it_adds_resource_repository_to_resource_repository_registry(): void
    {
        $this->setDefinition('sylius.registry.resource_repository', new Definition());
        $this->setDefinition('sylius.repository.product', new Definition());

        $this->setParameter(
            'sylius.resources',
            ['sylius.product' => []]
        );

        $this->compile();

        $this->assertContainerBuilderHasServiceDefinitionWithMethodCall(
            'sylius.registry.resource_repository',
            'register',
            ['sylius.product', new Reference('sylius.repository.product')]
        );
    }

    /**
     * @test
     */
    public function it_does_not_add_resource_repository_to_resource_repository_registry_if_registry_does_not_exist(): void
    {
        $this->setDefinition('sylius.repository.product', new Definition());

        $this->setParameter(
            'sylius.resources',
            ['sylius.product' => []]
        );

        $this->compile();
    }

    /**
     * @test
     */
    public function it_does_not_add_resource_repository_to_resource_repository_registry_if_resources_do_not_exist(): void
    {
        $this->setDefinition('sylius.registry.resource_repository', new Definition());
        $this->setDefinition('sylius.repository.product', new Definition());

        $this->compile();

        $this->assertContainerBuilderNotHasServiceDefinitionWithMethodCall(
            'sylius.registry.resource_repository',
            'register',
            ['sylius.product', new Reference('sylius.repository.product')]
        );
    }

    /**
     * @test
     */
    public function it_does_not_add_resource_repository_to_resource_repository_registry_if_resource_repository_does_not_exist(): void
    {
        $this->setDefinition('sylius.registry.resource_repository', new Definition());

        $this->setParameter(
            'sylius.resources',
            ['sylius.product' => []]
        );

        $this->compile();

        $this->assertContainerBuilderNotHasServiceDefinitionWithMethodCall(
            'sylius.registry.resource_repository',
            'register',
            ['sylius.product', new Reference('sylius.repository.product')]
        );
    }

    /**
     * {@inheritdoc}
     */
    protected function registerCompilerPass(ContainerBuilder $container): void
    {
        $container->addCompilerPass(new RegisterResourceRepositoryPass());
    }

    private function assertContainerBuilderNotHasServiceDefinitionWithMethodCall(
        string $serviceId,
        string $method,
        array $arguments
    ): void {
        $definition = $this->container->findDefinition($serviceId);

        self::assertThat(
            $definition,
            new LogicalNot(new DefinitionHasMethodCallConstraint($method, $arguments))
        );
    }
}


text:
"""
Program to test hdf5 functionality.
It works.
"""

import numpy as np
import h5py
import matplotlib.pyplot as plt
import subprocess, os

def writeHdf5(filename):
  f=h5py.File(filename, "w")
  sampleValues= np.array([1.1,17.0,6.2])
  f["sampleValues"]= sampleValues
  f.close()

def dumpHdf5(filename):
  """Method to execute xyce"""
  h5dumpBin = "/usr/local/bin/h5dump"
  h5dumpCmd = [h5dumpBin, filename]
  thisEnv = os.environ.copy()
  proc= subprocess.Popen(h5dumpCmd, env=thisEnv)
  return proc

def readHdf5(filename):
  f=h5py.File(filename, "r")
  data= f['sampleValues']
  print "sampleValues"
  for v in data:
    print v
  print "Done"
  f.close()

def main():
  filename= "hdf5ex_dat.hdf5"
  writeHdf5(filename)
  proc= dumpHdf5(filename)
  proc.wait()
  readHdf5(filename)

main()


text:
var fs = require('fs'),
	webpage = require("webpage"),
	system = require('system'),
	args = system.args;

args.shift();

if (!Function.prototype.bind) {
	Function.prototype.bind = function (oThis) {
		if (typeof this !== "function") {
			// closest thing possible to the ECMAScript 5
			// internal IsCallable function
			throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
		}

		var aArgs = Array.prototype.slice.call(arguments, 1),
		fToBind = this,
		fNOP = function () {},
		fBound = function () {
			return fToBind.apply(this instanceof fNOP && oThis
				? this
				: oThis,
				aArgs.concat(Array.prototype.slice.call(arguments)));
		};

		fNOP.prototype = this.prototype;
		fBound.prototype = new fNOP();

		return fBound;
	};
}

if (args.length !== 2) {
	console.log("Usage: converter.js source dest scale");
	phantom.exit();
} else {
	convert(args[0], args[1]);
}

function convert(template, destination) {
	var count = 0,
		page = webpage.create();

	page.settings.userAgent = "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90";

	count++;
	page.open(template, function (status) {
		if (status !== "success") {
			console.log("Unable to load the source file " + filePath);
			phantom.exit();
			return;
		}

		var configs = getLaunchImageConfigurations();
		configs.forEach(function(config){
			page.viewportSize = {
				width: Math.round(config.width),
				height: Math.round(config.height)
			};
			page.zoomFactor = config.zoom;

			var path = destination + '/' + config.path;
			page.render(path);
		});
		count--;
	});
	function close(){
		if(count == 0){
			phantom.exit();
		}else{
			setTimeout(close, 0);
		}
	}
	close();
};

function getLaunchImageConfigurations(){
	return [
		{path: 'iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png', width: 640, height: 1136, zoom: 1},
		{path: 'iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png', width: 750, height: 1334, zoom: 1.5},
		{path: 'iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png', width: 1242, height: 2208, zoom: 2.5},
		{path: 'iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png', width: 1024, height: 768, zoom: 1.5},
		{path: 'iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png', width: 2048, height: 1536, zoom: 3},
		{path: 'iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png', width: 2208, height: 1242, zoom: 3},
		{path: 'iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png', width: 768, height: 1024, zoom: 1.5},
		{path: 'iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png', width: 1536, height: 2048, zoom: 2.5},
		{path: 'iOS/Assets.xcassets/LaunchImage.launchimage/Default.png', width: 320, height: 480, zoom: 0.5},
		{path: 'iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png', width: 640, height: 960, zoom: 1.25},
	];
}


text:
<?php

use Dwij\Laraadmin\Helpers\LAHelper;

$as = "";
if(LAHelper::laravel_ver() == 5.3 || LAHelper::laravel_ver() == 5.4) {
    $as = config('laraadmin.adminRoute') . '.';
}

/**
 * Connect routes with ADMIN_PANEL permission(for security) and 'Dwij\Laraadmin\Controllers' namespace
 * and '/admin' url.
 */
Route::group([
    'namespace' => 'Dwij\Laraadmin\Controllers',
    'as' => $as,
    'middleware' => ['web', 'auth', 'permission:ADMIN_PANEL', 'role:SUPER_ADMIN']
], function () {

    /* ================== Modules ================== */
    Route::resource(config('laraadmin.adminRoute') . '/modules', 'ModuleController');
    Route::resource(config('laraadmin.adminRoute') . '/module_fields', 'FieldController');
    Route::get(config('laraadmin.adminRoute') . '/module_generate_crud/{model_id}', 'ModuleController@generate_crud');
    Route::get(config('laraadmin.adminRoute') . '/module_generate_migr/{model_id}', 'ModuleController@generate_migr');
    Route::get(config('laraadmin.adminRoute') . '/module_generate_update/{model_id}', 'ModuleController@generate_update');
    Route::get(config('laraadmin.adminRoute') . '/module_generate_migr_crud/{model_id}', 'ModuleController@generate_migr_crud');
    Route::get(config('laraadmin.adminRoute') . '/modules/{model_id}/set_view_col/{column_name}', 'ModuleController@set_view_col');
    Route::post(config('laraadmin.adminRoute') . '/save_role_module_permissions/{id}', 'ModuleController@save_role_module_permissions');
    Route::get(config('laraadmin.adminRoute') . '/save_module_field_sort/{model_id}', 'ModuleController@save_module_field_sort');
    Route::post(config('laraadmin.adminRoute') . '/check_unique_val/{field_id}', 'FieldController@check_unique_val');
    Route::get(config('laraadmin.adminRoute') . '/module_fields/{id}/delete', 'FieldController@destroy');
    Route::post(config('laraadmin.adminRoute') . '/get_module_files/{module_id}', 'ModuleController@get_module_files');
    Route::post(config('laraadmin.adminRoute') . '/module_update', 'ModuleController@update');
    Route::post(config('laraadmin.adminRoute') . '/module_field_listing_show', 'FieldController@module_field_listing_show_ajax');

    /* ================== Code Editor ================== */
    Route::get(config('laraadmin.adminRoute') . '/lacodeeditor', function () {
        if(file_exists(resource_path("views/la/editor/index.blade.php"))) {
            return redirect(config('laraadmin.adminRoute') . '/laeditor');
        } else {
            // show install code editor page
            return View('la.editor.install');
        }
    });

    /* ================== Menu Editor ================== */
    Route::resource(config('laraadmin.adminRoute') . '/la_menus', 'MenuController');
    Route::post(config('laraadmin.adminRoute') . '/la_menus/update_hierarchy', 'MenuController@update_hierarchy');

    /* ================== Configuration ================== */
    Route::resource(config('laraadmin.adminRoute') . '/la_configs', '\App\Http\Controllers\LA\LAConfigController');

    Route::group([
        'middleware' => 'role'
    ], function () {
        /*
        Route::get(config('laraadmin.adminRoute') . '/menu', [
            'as'   => 'menu',
            'uses' => 'LAController@index'
        ]);
        */
    });
});


text:
namespace base {
class SingleThreadTaskRunner;
class UnguessableToken;
}  // namespace base

namespace device {

// TODO(leonhsl): Merge this class with SerialDeviceEnumerator if/once
// SerialDeviceEnumerator is exposed only via the Device Service.
// crbug.com/748505
//
// Threading notes:
// 1. Created on the UI thread.
// 2. Used on the UI thread runner (macOS only), otherwise on a blocking task
//    runner.
// 3. Deleted on the same runner on which it is used *except* sometimes
//    during shutdown when the runner threadpool is already shutdown.
//    See crbug.com/1263149#c20 for details.
class SerialPortManagerImpl : public mojom::SerialPortManager,
                              public SerialDeviceEnumerator::Observer {
 public:
  SerialPortManagerImpl(
      scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
      scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);

  SerialPortManagerImpl(const SerialPortManagerImpl&) = delete;
  SerialPortManagerImpl& operator=(const SerialPortManagerImpl&) = delete;

  ~SerialPortManagerImpl() override;

  void Bind(mojo::PendingReceiver<mojom::SerialPortManager> receiver);
  void SetSerialEnumeratorForTesting(
      std::unique_ptr<SerialDeviceEnumerator> fake_enumerator);
  void SetBluetoothSerialEnumeratorForTesting(
      std::unique_ptr<BluetoothSerialDeviceEnumerator>
          fake_bluetooth_enumerator);

 private:
  // mojom::SerialPortManager methods:
  void SetClient(
      mojo::PendingRemote<mojom::SerialPortManagerClient> client) override;
  void GetDevices(GetDevicesCallback callback) override;
  void OpenPort(const base::UnguessableToken& token,
                bool use_alternate_path,
                device::mojom::SerialConnectionOptionsPtr options,
                mojo::PendingRemote<mojom::SerialPortClient> client,
                mojo::PendingRemote<mojom::SerialPortConnectionWatcher> watcher,
                OpenPortCallback callback) override;

  // SerialDeviceEnumerator::Observer methods:
  void OnPortAdded(const mojom::SerialPortInfo& port) override;
  void OnPortRemoved(const mojom::SerialPortInfo& port) override;

  void OpenBluetoothSerialPortOnUI(
      const std::string& address,
      mojom::SerialConnectionOptionsPtr options,
      mojo::PendingRemote<mojom::SerialPortClient> client,
      mojo::PendingRemote<mojom::SerialPortConnectionWatcher> watcher,
      BluetoothSerialPortImpl::OpenCallback callback);

  std::unique_ptr<SerialDeviceEnumerator> enumerator_;
  std::unique_ptr<BluetoothSerialDeviceEnumerator> bluetooth_enumerator_;
  base::ScopedMultiSourceObservation<SerialDeviceEnumerator,
                                     SerialDeviceEnumerator::Observer>
      observed_enumerator_{this};

  scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
  scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;

  mojo::ReceiverSet<SerialPortManager> receivers_;
  mojo::RemoteSet<mojom::SerialPortManagerClient> clients_;
  // See threading notes above for guidelines for checking sequence.
  SEQUENCE_CHECKER(sequence_checker_);
  base::WeakPtrFactory<SerialPortManagerImpl> weak_factory_{this};
};

}  // namespace device

#endif  // SERVICES_DEVICE_SERIAL_SERIAL_PORT_MANAGER_IMPL_H_