text:
'use strict'

/**
 * middlewares
 */

const pathjoin = require('path').join
const Router = require('impress-router')
const routing = require('impress-router-table')
const conditional = require('koa-conditional-get')
const etag = require('koa-etag')
const favicon = require('koa-favicon')
const serve = require('koa-static')
const logger = require('koa-logger')
const bodyparser = require('koa-bodyparser')
const ms = require('ms')
const _ = require('lodash')

const builtin = {
  favicon() {
    if (this.config.static.favicon) {
      this.use(favicon(pathjoin(this.projectHome, this.config.static.favicon)))
    }
  },

  static() {
    let list = this.config.static.public
    if (!Array.isArray(list)) {
      list = [list]
    }
    list = list.filter(Boolean)
    if (!list.length) return

    const router = new Router()
    this.use(router)

    for (let item of list) {
      const prefix = item.prefix
      const root = pathjoin(this.projectHome, item.dir)
      const options = item.options || {}

      // maxage
      if (item.maxage) {
        options.maxage = ms(item.maxage)
      }

      // headers
      if (item.headers) {
        options.setHeaders = (res) => {
          for (let key in item.headers) {
            const val = item.headers[key]
            res.setHeader(key, val)
          }
        }
      }

      router.use(item.prefix, serve(root, options))
    }
  },

  logger() {
    if (this.env !== 'test') {
      this.use(logger())
    }
  },

  bodyparser() {
    const options = this.config.middlewares.bodyparserOptions
    this.use(bodyparser(options))
  },

  routing() {
    this.use(routing(this.appHome))
  }
}

module.exports = function() {
  // cache
  this.use(conditional())
  this.use(etag())

  // custom middlewares
  for (let item of this.config.middlewares) {
    // built in
    if (typeof item === 'string') {
      if (!builtin[item]) {
        console.warn('Tiz middleware: no built in middleware %s found', item)
        continue
      }
      item = builtin[item]
      item.call(this)
      continue
    }

    // standard middleware
    this.use(item)
  }
}


text:
package git

import (
	"reflect"
	"testing"
)

func TestParseRemote(t *testing.T) {

	data := []struct {
		input  string
		result *GitRepo
		match  bool
	}{
		{
			"origin	https://github.com/wolfeidau/buildkite-cli.git (fetch)",
			&GitRepo{URL: "https://github.com/wolfeidau/buildkite-cli.git", Owner: "wolfeidau", Name: "buildkite-cli"},
			true,
		},
		{
			"https://github.com/wolfeidau/",
			nil,
			false,
		},
		{
			"origin	git@github.com:wolfeidau/buildkite-cli.git (fetch)",
			&GitRepo{URL: "git@github.com:wolfeidau/buildkite-cli.git", Owner: "wolfeidau", Name: "buildkite-cli"},
			true,
		},
	}

	for _, datum := range data {
		ok, repo := GitRemoteMatch(datum.input)

		if datum.match != ok {
			t.Errorf("expected %v got %v", datum.match, ok)
		}

		if !reflect.DeepEqual(datum.result, repo) {
			t.Errorf("expected %v got %v", datum.result, repo)
		}

	}

}

redpajama_set_name: RedPajamaGithub


text:
@interface UIControl (IDL_View)

@property (nonatomic, assign) IDLViewContentGravity gravity;

@end


text:
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTenantDatabasesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('tenant_databases', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->increments('tenant_database_id');
            $table->integer('tenant_id')->unsigned();
            $table->foreign('tenant_id')->references('tenant_id')->on('tenants')->onDelete('cascade');
            $table->string('driver');
            $table->integer('port');
            $table->string('hostname');
            $table->string('database_name');
            $table->string('user_name');
            $table->string('password');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('tenant_databases');
    }
}


text:
import React from 'react';
import PropTypes from 'prop-types';
import baseTheme from 'material-ui/styles/baseThemes/lightBaseTheme';
import getMuiTheme from 'material-ui/styles/getMuiTheme';

import Utils from '../../../../lib/util';

class BookmarkedTextNode extends React.Component {
	getChildContext() {
		return { muiTheme: getMuiTheme(baseTheme) };
	}

	render() {
		const { text } = this.props;
		let textClasses = 'text-node bookmark-text-node clearfix';
		const textLocation = this.getTextLocation();
		let workTitle = '';
		let link = '';

		if (this.props.work) {
			workTitle = this.props.work.english_title;
			link = `/works/${this.props.work._id}/${this.props.work.slug}?location=${textLocation.location}`;
		}

		if (this.props.isOdd) {
			textClasses = `${textClasses} bookmark-text-node--odd`;
		}

		if ((parseInt(textLocation.textN, 10) % 5) === 0) {
			textClasses = `${textClasses} show-number`;
		}

		return (

{Utils.trunc(workTitle, 40)} {textLocation.location}

 {
						this.anchorEl = ref;
						return ref;
					}}
				>
					{text.text && text.text.length ?
						{Utils.trunc(text.text, 120)}
					:
						[ . . . ]
					}

		);
	}
};

BookmarkedTextNode.childContextTypes = {
	muiTheme: PropTypes.object.isRequired,
};

BookmarkedTextNode.propTypes = {
	text: PropTypes.shape({
		work: PropTypes.object.isRequired,
	}).isRequired,
	isOdd: PropTypes.bool,
};

export default BookmarkedTextNode;


text:
import React, { Component } from 'react'
import { Link } from 'react-router';
import functional from 'react-functional'

export const Categories = (props) => (

    {props.categories.map(cat =>
      <Link key={cat.id} to={`/partners/${cat.id}`}>

{cat.name}{' '}

      </Link>)}

)

Categories.componentWillMount = (props) => {
  props.fetchCategories()
}

Categories.propTypes = {
  categories: React.PropTypes.array,
  fetchCategories: React.PropTypes.func.isRequired
}

export default functional(Categories)


text:
<?php

/*
Provides an easy to use interface for communicating with the iThemes updater server.
Written by Chris Jean for iThemes.com
Version 1.1.0

Version History
	1.0.0 - 2013-04-11 - Chris Jean
		Release ready
	1.0.1 - 2013-06-21 - Chris Jean
		Updated the http_build_query call to force a separator of & in order to avoid issues with servers that change the arg_separator.output php.ini value.
	1.0.2 - 2013-09-19 - Chris Jean
		Updated ithemes-updater-object to ithemes-updater-settings.
	1.0.3 - 2013-12-18 - Chris Jean
		Updated the way that the site URL is generated to ensure consistency across multisite sites.
	1.0.4 - 2014-01-31 - Chris Jean
		Updated to normalize the site URL used for password hash generation and for sending to the server.
	1.1.0 - 2014-10-23 - Chris Jean
		Updated auth token generation to use new password hashing.
		Added CA patch code.
		Updated code to meet WordPress coding standards.
*/

class Ithemes_Updater_Server {
	private static $secure_server_url = 'https://api.ithemes.com/updater';
	private static $insecure_server_url = 'http://api.ithemes.com/updater';

	private static $password_iterations = 8;

	public static function activate_package( $username, $password, $packages ) {
		$query = array(
			'user' => $username
		);

		$data = array(
			'auth_token' => self::get_password_hash( $username, $password ),
			'packages'   => $packages,
		);

		return Ithemes_Updater_Server::request( 'package-activate', $query, $data );
	}

	public static function deactivate_package( $username, $password, $packages ) {
		$query = array(
			'user' => $username
		);

		$data = array(
			'auth_token' => self::get_password_hash( $username, $password ),
			'packages'   => $packages,
		);

		return Ithemes_Updater_Server::request( 'package-deactivate', $query, $data );
	}

	public static function get_package_details( $packages ) {
		$query = array();

		$data = array(
			'packages' => $packages
		);

		return Ithemes_Updater_Server::request( 'package-details', $query, $data );
	}

	public static function request( $action, $query = array(), $data = array() ) {
		if ( false !== ( $timeout_start = get_site_option( 'ithemes-updater-server-timed-out' ) ) ) {
			// Hold off updates for 30 minutes.
			$time_remaining = 1800 - ( time() - $timeout_start );
			$minutes_remaining = ceil( $time_remaining / 60 );

			if ( $time_remaining < 0 ) {
				delete_site_option( 'ithemes-updater-server-timed-out' );
			} else {
				return new WP_Error( 'ithemes-updater-timed-out-server', sprintf( _n( 'The server could not be contacted. Requests are delayed for %d minute to allow the server to recover.', 'The server could not be contacted. Requests are delayed for %d minutes to allow the server to recover.', $minutes_remaining, 'it-l10n-ithemes-sync' ), $minutes_remaining ) );
			}
		}

		if ( isset( $data['auth_token'] ) ) {
			$data['iterations'] = self::$password_iterations;
		}

		$site_url = self::get_site_url();

		$default_query = array(
			'wp'           => $GLOBALS['wp_version'],
			'site'         => $site_url,
			'timestamp'    => time(),
			'auth_version' => '2',
		);

		if ( is_multisite() ) {
			$default_query['ms'] = 1;
		}

		$query = array_merge( $default_query, $query );
		$request = "/$action/?" . http_build_query( $query, '', '&' );

		$post_data = array(
			'request' => json_encode( $data ),
		);

		$remote_post_args = array(
			'timeout' => 10,
			'body'    => $post_data,
		);

		$options = array(
			'use_ca_patch' => false,
			'use_ssl'      => true,
		);

		$patch_enabled = $GLOBALS['ithemes-updater-settings']->get_option( 'use_ca_patch' );

		if ( $patch_enabled ) {
			self::disable_ssl_ca_patch();
		}

		$response = wp_remote_post( self::$secure_server_url . $request, $remote_post_args );

		if ( is_wp_error( $response ) && ( 'connect() timed out!' != $response->get_error_message() ) ) {
			self::enable_ssl_ca_patch();
			$response = wp_remote_post( self::$secure_server_url . $request, $remote_post_args );

			if ( ! is_wp_error( $response ) ) {
				$options['use_ca_patch'] = true;
			}
		}

		if ( is_wp_error( $response ) && ( 'connect() timed out!' != $response->get_error_message() ) ) {
			$response = wp_remote_post( self::$insecure_server_url . $request, $remote_post_args );

			$options['use_ssl'] = false;
		}

		if ( ! $options['use_ca_patch'] ) {
			self::disable_ssl_ca_patch();
		}

		$GLOBALS['ithemes-updater-settings']->update_options( $options );

		if ( is_wp_error( $response ) ) {
			if ( 'connect() timed out!' == $response->get_error_message() ) {
				// Set option to delay server checks for a period of time.
				update_site_option( 'ithemes-updater-server-timed-out', time() );

				return new WP_Error( 'http_request_failed', __( 'The server was unable to be contacted.', 'it-l10n-ithemes-sync' ) );
			}

			return $response;
		}

		$body = json_decode( $response['body'], true );

		if ( ! empty( $body['error'] ) ) {
			return new WP_Error( $body['error']['type'], sprintf( __( 'An error occurred when communicating with the iThemes update server: %s (%s)', 'it-l10n-ithemes-sync' ), $body['error']['message'], $body['error']['code'] ) );
		}

		return $body;
	}

	private static function get_site_url() {
		if ( is_callable( 'network_home_url' ) ) {
			$site_url = network_home_url();
		} else {
			$site_url = get_bloginfo( 'url' );
		}

		$site_url = preg_replace( '/^https/', 'http', $site_url );
		$site_url = preg_replace( '|/$|', '', $site_url );

		return $site_url;
	}

	private static function get_password_hash( $username, $password ) {
		require_once( ABSPATH . 'wp-includes/class-phpass.php' );
		require_once( dirname( __FILE__ ) . '/class-ithemes-credentials.php' );

		$password = iThemes_Credentials::get_password_hash( $username, $password );

		$salted_password = $password . $username . self::get_site_url() . $GLOBALS['wp_version'];
		$salted_password = substr( $salted_password, 0, max( strlen( $password ), 512 ) );

		$hasher = new PasswordHash( self::$password_iterations, true );
		$auth_token = $hasher->HashPassword( $salted_password );

		return $auth_token;
	}

	public static function enable_ssl_ca_patch() {
		add_action( 'http_api_curl', array( __CLASS__, 'add_ca_patch_to_curl_opts' ) );
	}

	public static function disable_ssl_ca_patch() {
		remove_action( 'http_api_curl', array( __CLASS__, 'add_ca_patch_to_curl_opts' ) );
	}

	public static function add_ca_patch_to_curl_opts( $handle ) {
		$url = curl_getinfo( $handle, CURLINFO_EFFECTIVE_URL );

		if ( ! preg_match( '{^https://(api|downloads)\.ithemes\.com}', $url ) ) {
			return;
		}

		curl_setopt( $handle, CURLOPT_CAINFO, $GLOBALS['ithemes_updater_path'] . '/ca/roots.crt' );
	}
}


text:
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
require "rubyonacid/factories/weighted"
require "shared_factory_specs"

include RubyOnAcid

describe WeightedFactory do

  subject do
    WeightedFactory.new
  end

  describe "general behavior" do

    before :each do
      subject.source_factories << double('Factory', :get_unit => 0.2)
      subject.source_factories << double('Factory', :get_unit => 0.3)
    end

    it_should_behave_like "a factory"

  end

  describe "#get_unit" do

    it "gives factories with higher weights more influence" do
      factory1 = double('Factory', :get_unit => 0.25)
      factory2 = double('Factory', :get_unit => 0.75)
      subject.source_factories << factory1
      subject.source_factories << factory2
      subject.get_unit(:x).should be_within(MARGIN).of(0.5)
      subject.weights[factory1] = 1.0
      subject.weights[factory2] = 2.0
      subject.get_unit(:x).should > 0.5
    end

    it "multiplies factory values by weights when averaging" do
      factory1 = double('Factory', :get_unit => 0.2)
      factory2 = double('Factory', :get_unit => 0.4)
      subject.source_factories << factory1
      subject.source_factories << factory2
      subject.get_unit(:x).should be_within(MARGIN).of(0.3)
      subject.weights[factory1] = 2.0 #0.2 * 2.0 = 0.4
      subject.weights[factory2] = 4.0 #0.4 * 4.0 = 1.6
      #0.4 + 1.6 = 2.0
      #2.0 / 6.0 (total weight) = 0.333
      subject.get_unit(:x).should be_within(MARGIN).of(0.333)
    end

    it "can handle 3 or more factories" do
      factory1 = double('Factory', :get_unit => 0.2)
      factory2 = double('Factory', :get_unit => 0.4)
      factory3 = double('Factory', :get_unit => 0.8)
      subject.source_factories << factory1
      subject.source_factories << factory2
      subject.source_factories << factory3
      subject.get_unit(:x).should be_within(MARGIN).of(0.4666)
      subject.weights[factory1] = 10.0 #0.2 * 10.0 = 2.0
      subject.weights[factory2] = 3.0 #0.4 * 3.0 = 1.2
      subject.weights[factory3] = 2.0 #0.8 * 2.0 = 1.6
      #2.0 + 1.2 + 1.6 = 4.8
      #puts 4.8 / 15.0 (total weight) = 0.32
      subject.get_unit(:x).should be_within(MARGIN).of(0.32)
    end

  end

end


text:
'''
Try and except:

In computer programs errors occur. This is expected. It is normal.
But if something unexpected happens, it is exceptional—and an exception is thrown.
'''

# import module sys to get the type of exception.

import sys

while True:
    try:
        value = int(input('Enter an integer:'))
        result = 1/value
        break
    except:
        print 'Oops!', sys.exc_info()[0], 'occured.'
        print

print 'The reciprocal of', value, 'is', result


text:
#ifndef API_SOCKET_H_INCLUDED
#define API_SOCKET_H_INCLUDED

/*
 * socket
 */

int api_socket_non_block(int fd, int on);
int api_socket_send_buffer_size(int fd, int size);
int api_socket_recv_buffer_size(int fd, int size);

/*
 * tcp
 */

int api_tcp_nodelay(int fd, int enable);
int api_tcp_keepalive(int fd, int enable, unsigned int delay);

#endif // API_SOCKET_H_INCLUDED


text:
<?php
  include_once 'includes/dbConnect.php';
  include_once 'includes/functions.php';

  session_start();

  // Set permission restrictions here
  if (!isAdmin($mysqli))
  {
    header("Location: /page_403.php");

  }
?>

<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

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

    <title>Edit School Year</title>

   <?php include("includes/genericCSS.php"); ?>

    <link href="vendors/select2/dist/css/select2.min.css" rel="stylesheet">

        <?php
          include("includes/navPanel.php");
        ?>

Edit School Year

                    <form method="post" id="edit-schoolYear-form" class="form-horizontal form-label-left">

                        Select School Year to Edit

                          <select class="select2_single form-control" tabindex="-1" name="schoolYearID" id="schoolYearID">

                          </select>

                          <button type="submit" class="btn btn-success">Next</button>

                    </form>

                    <form method="post" id="edit-schoolYear-form-2" class="form-horizontal form-label-left">
                      <input type="hidden" id="selectedSchoolYearID" name="selectedSchoolYearID">

                        Fall Semester Start Date *

                          <input type="text" class="form-control has-feedback-left" id="fall-semester-start" name="fall-semester-start" placeholder="Fall Semester Start Date">

                        Fall Semester End Date *

                          <input type="text" class="form-control has-feedback-left" id="fall-semester-end" name="fall-semester-end" placeholder="Fall Semester End Date">

                        Spring Semester Start Date *

                          <input type="text" class="form-control has-feedback-left" id="spring-semester-start" name="spring-semester-start" placeholder="Spring Semester Start Date">

                        Spring Semester End Date *

                          <input type="text" class="form-control has-feedback-left" id="spring-semester-end" name="spring-semester-end" placeholder="Spring Semester End Date">

                          <button type="button" class="btn btn-primary" onclick="switchSchoolYear()">Switch School Year</button>
                          <button type="submit" class="btn btn-success" name="edit" value="edit">Edit School Year</button>

                    </form>

        <?php include("includes/footer.php"); ?>

    <?php include("includes/genericJS.php"); ?>


text:
namespace util {

class Date {
public:
    virtual ~Date() {}
    virtual int year() const = 0;
    virtual int month() const = 0;
    virtual int day() const = 0;
};

std::ostream& operator<<(std::ostream& sout, const Date& date);

}  // namespace util

#endif  // CH1_S2_DATE_H_


text:
<?php

/**
 * @file
 * Contains \Drupal\system\Tests\Theme\MessageTest.
 */

namespace Drupal\system\Tests\Theme;

use Drupal\simpletest\KernelTestBase;

/**
 * Tests built-in message theme functions.
 *
 * @group Theme
 */
class MessageTest extends KernelTestBase {

  /**
   * {@inheritdoc}
   */
  public static $modules = array('system');

  /**
   * Tests setting messages output.
   */
  function testMessages() {
    drupal_set_message('An error occurred', 'error');
    drupal_set_message('But then something nice happened');
    $messages = array(
      '#theme' => 'status_messages',
    );
    $this->render($messages);
    $this->assertRaw('messages messages--error');
    $this->assertRaw('messages messages--status');
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.pacinetes</groupId>
        <artifactId>Proyecto2017Seguros</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>

    <artifactId>Proyecto2017Seguros-dom</artifactId>
    <name>Simple App DOM</name>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**</include>
                </includes>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.apache.isis.core</groupId>
            <artifactId>isis-core-applib</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.isis.core</groupId>
            <artifactId>isis-core-unittestsupport</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Bytecode libraries (for mocking) -->
        <dependency>
            <groupId>org.objenesis</groupId>
            <artifactId>objenesis</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
		    <groupId>org.isisaddons.module.security</groupId>
		    <artifactId>isis-module-security-dom</artifactId>
		    <version>1.14.0</version>
		</dependency>

		<dependency>
		    <groupId>org.mindrot</groupId>
		    <artifactId>jbcrypt</artifactId>
		    <version>0.3m</version>
		</dependency>

				<!-- AGREGO PARA JASPERREPORTS-->
		<dependency>
		    <groupId>net.sf.jasperreports</groupId>
		    <artifactId>jasperreports</artifactId>
		    <version>6.3.1</version>
		</dependency>
		<dependency>
		    <groupId>org.apache.commons</groupId>
		    <artifactId>commons-email</artifactId>
		    <version>1.4</version>
		</dependency>
		<dependency>
		    <groupId>org.apache.httpcomponents</groupId>
		    <artifactId>httpclient</artifactId>
		    <version>4.5.2</version>
		</dependency>
				<!-- AGREGO PARA JASPERREPORTS-->

    </dependencies>

    <profiles>
        <profile>
            <id>enhance</id>
            <activation>
                <property>
                    <name>!skip.enhance</name>
                </property>
            </activation>
            <properties>
                <datanucleus-maven-plugin.version>4.0.1</datanucleus-maven-plugin.version>
            </properties>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                            <groupId>org.eclipse.m2e</groupId>
                            <artifactId>lifecycle-mapping</artifactId>
                            <version>1.0.0</version>
                            <configuration>
                                <lifecycleMappingMetadata>
                                    <pluginExecutions>
                                        <pluginExecution>
                                            <pluginExecutionFilter>
                                                <groupId>org.datanucleus</groupId>
                                                <artifactId>datanucleus-maven-plugin</artifactId>
                                                <versionRange>[${datanucleus-maven-plugin.version},)</versionRange>
                                                <goals>
                                                    <goal>enhance</goal>
                                                </goals>
                                            </pluginExecutionFilter>
                                            <action>
                                                <ignore></ignore>
                                            </action>
                                        </pluginExecution>
                                    </pluginExecutions>
                                </lifecycleMappingMetadata>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>org.datanucleus</groupId>
                        <artifactId>datanucleus-maven-plugin</artifactId>
                        <version>${datanucleus-maven-plugin.version}</version>
                        <configuration>
                            <fork>false</fork>
                            <log4jConfiguration>${basedir}/log4j.properties</log4jConfiguration>
                            <verbose>true</verbose>
                            <props>${basedir}/datanucleus.properties</props>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>process-classes</phase>
                                <goals>
                                    <goal>enhance</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>org.datanucleus</groupId>
                    <artifactId>datanucleus-core</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.datanucleus</groupId>
                    <artifactId>datanucleus-jodatime</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.datanucleus</groupId>
                    <artifactId>datanucleus-api-jdo</artifactId>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>isis-validate</id>
            <activation>
                <property>
                    <name>!skip.isis-validate</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.isis.tool</groupId>
                        <artifactId>isis-maven-plugin</artifactId>
                        <version>${isis.version}</version>
                        <configuration>
                             <appManifest>com.pacinetes.dom.PacinetesAppDomManifest</appManifest>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>${project.groupId}</groupId>
                                <artifactId>${project.artifactId}</artifactId>
                                <version>${project.version}</version>
                            </dependency>
                            <!--
                            ... workaround to avoid conflict with plexus-default
                                (not sure why exclusions in the isis-maven-plugin aren't sufficient, though ...
                            -->
                            <dependency>
                                <groupId>com.google.guava</groupId>
                                <artifactId>guava</artifactId>
                                <version>19.0</version>
                            </dependency>
                            <dependency>
                                <groupId>org.hsqldb</groupId>
                                <artifactId>hsqldb</artifactId>
                                <version>2.3.1</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <phase>test</phase>
                                <goals>
                                    <goal>validate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

    </profiles>

</project>


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- From: file:/Users/applelike/Desktop/Camera2Video/Application/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.0/res/values-xlarge-land/values-xlarge-land.xml -->
    <eat-comment/>
    <dimen name="abc_search_view_text_min_width">256dip</dimen>
</resources>


text:
<link href="<?php echo base_url(); ?>assets/vendors/bootstrap-table/dist/bootstrap-table.css" rel="stylesheet">
<link href="<?php echo base_url(); ?>assets/vendors/bootstrap-table/dist/bootstrap-editable.css" rel="stylesheet">

<link href="<?php echo base_url(); ?>assets/vendors/select2/dist/css/select2.min.css" rel="stylesheet">

<link href="<?php echo base_url(); ?>assets/vendors/timepickermaster/jquery.ui.timepicker.css" rel="stylesheet">

<link href="<?php echo base_url(); ?>assets/vendors/datetimepicker/build/css/bootstrap-datetimepicker.min.css" rel="stylesheet">

<link href="<?php echo base_url(); ?>assets/vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">

<link href="<?php echo base_url(); ?>assets/vendors/datetimepicker/build/css/bootstrap-datetimepicker.min.css" rel="stylesheet">

                            <?php $attrib = array('id' => 'complaint');
                            echo form_open("complaints",$attrib); ?>

                                Complaint Type

                                    <select id="complaint_type" name="complaint_type" class="form-control" data-placeholder="Select Your Complaint" style="width:200px">
                                        <option value="REJECT PRODUCT/DEFECT">REJECT PRODUCT/DEFECT</option>
                                        <option value="DELIVERY DELAY">DELIVERY DELAY</option>
                                        <option value="INCORRECT DELIVERY">INCORRECT DELIVERY</option>
                                    </select>

                                Order No

                                    <select id="order_no" name="order_no" class="form-control" data-placeholder="Select Your Order" style="width:200px">
                                        <option></option>
                                    </select>

                                Description :
                                <textarea id="description" name="description" class="form-control" data-placeholder="Describe Your Complaint" cols="15" rows="5"></textarea>

                                <button type="submit" value="xls" name="submit" class="btn btn-primary">Submit</button>
                                <a href="#" class="btn btn-default" onClick="window.location.replace('<?php echo base_url(); ?>complaints');"> Back

                            <?php echo form_close(); ?>


text:
(function($) {

  // Initialization
  $.fn.printPreview = function() {
    return this;
  };

  $.printPreview = {

    printPreview: function(element) {
      var $body = $('body'),
          $container = $('.container-main'),
          footnoteLinks = "",
          linksIndex = 0;

      $body.find('.nav-mobile, .drilldown, .nav-main, .header-separator, .nav-service, .nav-lang, .form-search, .yamm--select, header > div:first-child, footer, .alert, .icon--print, .social-sharing, form, .nav-process, .carousel-indicators, .carousel-control, .breadcrumb, .pagination-container').remove();

      // if an element is passed, we want it to be the only thing to print out
      if (element) {
        element = $('[data-print=' + element + ']').clone(); // clone to fix issue with IE render
        var header = $('header').clone(); // clone to fix issue with IE render
            title = element.attr('data-title') ? '
' + element.attr('data-title') + '
' : '';
        $container.addClass('print-element').html('').append(header, title, element);
      }

      $body.addClass('print-preview');

      $container.prepend('
'+
        '
'+
          ''+
            ''+
              '<input type="checkbox" id="footnote-links">  '+
              'Links as footnotes'+
            ''+
            '
'+
              '
'+
                '<button id="print-button" title="print" class="btn"></button>'+
                '  '+
                '<button id="close-button" title="close" class="btn btn-secondary"></button>'+
              '
'+
            '
'+
          ''+
        '
'+
      '
');

      $('#print-button').click(function () {
        $.printPreview.printProcess();
      });

      $('#close-button').click(function () {
        $.printPreview.printClose();
      });

      $('a').not('.access-keys a').each(function () {
        var target = $(this).attr('href');
        target = String(target);

        if (target != "undefined" && target.indexOf("http") === 0) {
          linksIndex ++;
          footnoteLinks += '
'+target+'
';
          $('('+linksIndex+')').insertAfter(this);
        }
      });

      $('#footnote-links').change(function(){
        if (this.checked) {
          $container.append('
'+
            '
'+
            '
Page Links

'+
            '
'+
              footnoteLinks+
            '
'+
            '
'+
          '
');
          $body.addClass('print-footnotes');
        } else {
          $('#footnote-links-wrapper').remove();
          $body.removeClass('print-footnotes');
        }
      });
    },

    printProcess: function() {
      window.print();
    },

    printClose: function() {
      window.location.reload();
    }

  };

 }) (jQuery);


text:
require 'nokogiri'

class TrelloCardPrintersController < ApplicationController
  def index
    base_url = "https://trello.com"
    html = `curl #{base_url}/b/0dbvNFHt/coding-test`
    doc = Nokogiri::HTML(html)
    card_urls = doc.css('li[itemtype="http://schema.org/ListItem"] a[href]').map do |link|
      base_url + link['href']
    end

    list_items = []
    card_urls.each do |url|
      list_items << fetch_data_from(url)
    end

    @cards = list_items
  end

  def fetch_data_from(url)
    html = `curl #{url}`
    doc = Nokogiri::HTML(html)
    {
        title: doc.css('h1[itemprop="name"]').text,
        description: doc.css('div[itemprop="description"] p').text,
        labels: doc.css('li[itemprop="keywords"]').map(&:text),
        checklists: checklists(doc),
        url: url
    }
  end

  def checklists(doc)
    list = []
    item_list = doc.css('div[itemtype="http://schema.org/ItemList"]')
    item_list.each do |item|
      list << {
          name: item.css('h3').text,
          checked: item.css('input[checked] ~ span').map(&:text),
          unchecked: item.css('input[type="checkbox"] ~ span').map(&:text) - item.css('input[checked] ~ span').map(&:text)
      }
    end
    list
  end

  def generate_pdfs
    if params[:cards]
      pdf = TrelloCardPrinterPdf.new(params[:cards])
      send_data pdf.render,
                filename: "trello_card_printers.pdf",
                type: 'application/pdf',
                disposition: 'inline'
    else
      redirect_to action: 'index'
    end

  end
end


text:
using namespace ofp;

PropertyRange PortMod::properties() const {
  return SafeByteRange(this, header_.length(), sizeof(PortMod));
}

bool PortMod::validateInput(Validation *context) const {
  return properties().validateInput(context);
}

PortModBuilder::PortModBuilder(const PortMod *msg) : msg_{*msg} {}

UInt32 PortModBuilder::send(Writable *channel) {
  UInt8 version = channel->version();
  UInt32 xid = channel->nextXid();

  msg_.header_.setVersion(version);
  msg_.header_.setXid(xid);

  if (version >= OFP_VERSION_5) {
    size_t msgLen = sizeof(msg_) + properties_.size();
    msg_.header_.setLength(msgLen);

    channel->write(&msg_, sizeof(msg_));
    channel->write(properties_.data(), properties_.size());
    channel->flush();
    return xid;
  }

  // For OpenFlow version 1.3 and previous, only the Ethernet property
  // should be the present.

  if (properties_.size() != sizeof(PortModPropertyEthernet)) {
    log_warning("PortModBuilder: Invalid properties for version", version);
  }

  OFPPortFeaturesFlags advertise =
      properties_.toRange().value<PortModPropertyEthernet>();

  if (version >= OFP_VERSION_2) {
    size_t msgLen = sizeof(msg_) + sizeof(OFPPortFeaturesFlags) + 4;
    msg_.header_.setLength(msgLen);
    channel->write(&msg_, sizeof(msg_));

    Big<OFPPortFeaturesFlags> adv = advertise;
    Padding<4> pad;
    channel->write(&adv, sizeof(adv));
    channel->write(&pad, sizeof(pad));

  } else {
    size_t msgLen = sizeof(msg_);
    // Temporarily set the message type to the V1 value.
    msg_.header_.setRawType(deprecated::v1::OFPT_PORT_MOD);
    msg_.header_.setLength(msgLen);
    channel->write(&msg_.header_, sizeof(Header));
    msg_.header_.setType(OFPT_PORT_MOD);

    channel->write(BytePtr(&msg_.portNo_) + 2, 2);
    channel->write(&msg_.hwAddr_, 6);
    channel->write(&msg_.config_, 8);

    Big<OFPPortFeaturesFlags> adv = OFPPortFeaturesFlagsConvertToV1(advertise);
    Padding<4> pad;
    channel->write(&adv, sizeof(adv));
    channel->write(&pad, sizeof(pad));
  }

  channel->flush();

  return xid;
}


text: Rails.application.config.session_store :cookie_store, key: '_lockstockbarril_session'


text:
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;

namespace QIRC.CSharp.SDIL
{
        //public enum AssemblyType
        //{
        //    None,
        //    Console,
        //    Application,
        //    Library
        //}

        //public enum BinaryOperator
        //{
        //    Add,
        //    Subtract,
        //    Multiply,
        //    Divide,
        //    Modulus,
        //    ShiftLeft,
        //    ShiftRight,
        //    IdentityEquality,
        //    IdentityInequality,
        //    ValueEquality,
        //    ValueInequality,
        //    BitwiseOr,
        //    BitwiseAnd,
        //    BitwiseExclusiveOr,
        //    BooleanOr,
        //    BooleanAnd,
        //    LessThan,
        //    LessThanOrEqual,
        //    GreaterThan,
        //    GreaterThanOrEqual
        //}

        //public enum ExceptionHandlerType
        //{
        //    Finally,
        //    Catch,
        //    Filter,
        //    Fault
        //}

        //public enum FieldVisibility
        //{
        //    Private,
        //    Public,
        //    Internal,
        //    Protected,
        //}

        //public enum MethodVisibility
        //{
        //    Private,
        //    Public,
        //    Internal,
        //    External,
        //    Protected,
        //}
        //public enum MethodModifier
        //{
        //    Static,
        //    Override,
        //    Abstract,
        //    Virtual,
        //    Final,
        //    None,
        //}

        //public enum ResourceVisibility
        //{
        //    Public,
        //    Private
        //}

        //public enum TypeVisibility
        //{
        //    vPublic,
        //    vProtected,
        //    vInternal,
        //    vProtectedInternal,
        //    vPrivate
        //}

        //public enum ClassModifiers
        //{
        //    mAbstract,
        //    mSealed,
        //    mStatic,
        //    mNone,
        //}

        //public enum UnaryOperator
        //{
        //    Negate,
        //    BooleanNot,
        //    BitwiseNot,
        //    PreIncrement,
        //    PreDecrement,
        //    PostIncrement,
        //    PostDecrement
        //}

    public static class Globals
    {
        public static Dictionary<Int32, Object> Cache = new Dictionary<Int32, Object>();

        public static OpCode[] multiByteOpCodes;
        public static OpCode[] singleByteOpCodes;
        public static Module[] modules = null;

        public static void LoadOpCodes()
        {
            singleByteOpCodes = new OpCode[0x100];
            multiByteOpCodes = new OpCode[0x100];
            FieldInfo[] infoArray1 = typeof(OpCodes).GetFields();
            for (Int32 num1 = 0; num1 < infoArray1.Length; num1++)
            {
                FieldInfo info1 = infoArray1[num1];
                if (info1.FieldType == typeof(OpCode))
                {
                    OpCode code1 = (OpCode)info1.GetValue(null);
                    UInt16 num2 = (UInt16)code1.Value;
                    if (num2 < 0x100)
                    {
                        singleByteOpCodes[(Int32)num2] = code1;
                    }
                    else
                    {
                        if ((num2 & 0xff00) != 0xfe00)
                        {
                            throw new Exception("Invalid OpCode.");
                        }
                        multiByteOpCodes[num2 & 0xff] = code1;
                    }
                }
            }
        }

        /// <summary>
        /// Retrieve the friendly name of a type
        /// </summary>
        /// <param name="typeName">
        /// The complete name to the type
        /// </param>
        /// <returns>
        /// The simplified name of the type (i.e. "int" instead f System.Int32)
        /// </returns>
        public static String ProcessSpecialTypes(String typeName)
        {
            String result = typeName;
            switch (typeName)
            {
                case "System.string":
                case "System.String":
                case "String":
                    result = "string"; break;
                case "System.Int32":
                case "Int":
                case "Int32":
                    result = "int"; break;
            }
            return result;
        }

        //public static string SpaceGenerator(int count)
        //{
        //    string result = "";
        //    for (int i = 0; i < count; i++) result += " ";
        //    return result;
        //}

        //public static string AddBeginSpaces(string source, int count)
        //{
        //    string[] elems = source.Split('\n');
        //    string result = "";
        //    for (int i = 0; i < elems.Length; i++)
        //    {
        //        result += SpaceGenerator(count) + elems[i] + "\n";
        //    }
        //    return result;
        //}
    }
}


text:
@class IDEContainer, NSError;

@protocol IDEContainerErrorPresenter
- (BOOL)presentError:(NSError *)arg1;
- (int)handleSaveError:(NSError *)arg1 forContainer:(IDEContainer *)arg2 withAction:(int)arg3;
@end


text:
title: Search configuration
tags: [publishing, navigation]
keywords: search, json, configuration, findability
last_updated: July 3, 2016
summary: "The search feature uses JavaScript to look for keyword matches in a JSON file. The results show instant matches, but it doesn't provide a search results page like Google. Also, sometimes invalid formatting can break the JSON file."
sidebar: mydoc_sidebar
permalink: mydoc_search_configuration.html
folder: mydoc
---

## About search
The search is configured through the search.json file in the root directory. The search is a simple search that looks at content in pages. It looks at titles, summaries, keywords, and tags.

However, the search doesn't work like google — you can't hit return and see a list of results on the search results page, with the keywords in bold. Instead, this search shows a list of page titles that contain keyword matches. It's fast, but simple.

## Excluding pages from search

By default, every page is included in the search. Depending on the type of content you're including, you may find that some pages will break the JSON formatting. If that happens, then the search will no longer work.

If you want to exclude a page from search add `search: exclude` in the page's frontmatter.

## Troubleshooting search

You should exclude any files from search that you don't want appearing in the search results. For example, if you have a tooltips.json file or prince-list.txt, don't include it, as the formatting will break the JSON format.

If any formatting in the search.json file is invalid (in the build), search won't work. You'll know that search isn't working if no results appear when you start typing in the search box.

If this happens, point your browser to your build's search.json file at http://localhost:4000/search.json (or your public github pages site), copy the entire search.json page as it's output on the browser, and then use a [JSON validator](http://jsonlint.com/) to validate the output by pasting what you copied into the validator. Look for the line causing trouble.  It will be highlighted. Edit the file that's causing the problem to either exclude it from the search or fix the syntax so that it doesn't invalidate the JSON. (Note that tabs in the body will invalidate JSON, as will certain characters in the file's front matter.  For example, the summary: cannot have " quotes in it.

The search.json file already tries to strip out content that would otherwise make the JSON invalid.

## Including the body field in search

I've found that including the `body` field in the search creates too many problems, and so I've removed `body` from the search. You can see the results of including the `body` by adding this along with the other fields in search.json:

{% raw %}
```json
      "body": "{{ page.content | strip_html | strip_newlines | replace: '\', '\\\\' | replace: '"', '\\"' | replace: '	', '    '  }}",
```
{% endraw %}

Note that the last replace, `| replace: '^t', '    ' `, looks for any tab character and replaces it with four spaces. (Tab characters invalidate JSON.) If you run into other problematic formatting, you can use regex expressions to find and replace the content. See [Regular Expressions](http://www.ultraedit.com/support/tutorials_power_tips/ultraedit/regular_expressions.html) for details on finding and replacing code.

It's possible that the formatting may not account for all the scenarios that would invalidate the JSON. (Sometimes it's an extra comma after the last item that makes it invalid.)

Note that including the body in the search creates other problems as well. The search results show the most immediate matches in the JSON file. If several topics have matches for the keyword in the body, these matches might appear before other files that have matches in the title, summary, or keywords. This is because this simple search does not provide any weighting mechanisms for the content.

## Customizing search results

At some point, you may want to customize the search results more. Here's a little more detail that will be helpful. The search.json file retrieves various page values:

```json
{% raw %}---
title: search
layout: none
search: exclude
---

[
{% for page in site.pages %}
{% unless page.search == "exclude" %}
{
"title": "{{ page.title | escape }}",
"tags": "{{ page.tags }}",
"keywords": "{{page.keywords}}",
"url": "{{ page.url | remove: "/"}}",
"summary": "{{page.summary | strip }}"
},
{% endunless %}
{% endfor %}

{% for post in site.posts %}

{
"title": "{{ post.title | escape }}",
"tags": "{{ post.tags }}",
"keywords": "{{post.keywords}}",
"url": "{{ post.url }}",
"summary": "{{post.summary | strip }}"
}
{% unless forloop.last %},{% endunless %}
{% endfor %}

]
{% endraw %}
```

The \_includes/topnav.html file then makes use of these values:

```html
<li>
    <!--start search-->
    <div id="search-demo-container">
        <input type="text" id="search-input" placeholder="{{site.data.strings.search_placeholder_text}}">
        <ul id="results-container"></ul>
    </div>
    <script src="{{ "js/jekyll-search.js" }}" type="text/javascript"></script>
    <script type="text/javascript">
            SimpleJekyllSearch.init({
                searchInput: document.getElementById('search-input'),
                resultsContainer: document.getElementById('results-container'),
                dataSource: '{{ "search.json" }}',
                searchResultTemplate: '<li><a href="{url}" title="{{page.title | replace: "'", "\"}}">{title}</a></li>',
    noResultsText: '{{site.data.strings.search_no_results_text}}',
            limit: 10,
            fuzzy: true,
    })
    </script>
    <!--end search-->
</li>
```

Where you see `{url}` and `{title}`, the search is retrieving the values for these as specified in the search.json file.

## More robust search

Overall, the built-in search only works for small documentation projects. If you have more robust search needs, consider integrating [Google Custom Search](https://cse.google.com/cse/), [Algolia](http://algolia.com), or [Swifttype](http://swiftype.com).

{% include links.html %}


text:
package dynamo

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/service/dynamodb"
	"github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute"
	"github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface"
)

//Delete holds configuration for a delete
type Delete struct {
	ConditionInput
	ExpressionHolder
	dynamodb.DeleteItemInput
	PrimaryKey interface{}
}

//NewDelete prepares a query with it mandatory elements
func NewDelete(tname string, pk interface{}) *Delete {
	return &Delete{DeleteItemInput: dynamodb.DeleteItemInput{
		TableName: aws.String(tname),
	}, PrimaryKey: pk}
}

//Execute will delete an item with the background context
func (inp *Delete) Execute(db dynamodbiface.DynamoDBAPI) (err error) {
	return inp.ExecuteWithContext(aws.BackgroundContext(), db)
}

// ExecuteWithContext will delete an item from by its primary key
func (inp *Delete) ExecuteWithContext(ctx aws.Context, db dynamodbiface.DynamoDBAPI) (err error) {
	ipk, err := dynamodbattribute.MarshalMap(inp.PrimaryKey)
	if err != nil {
		return fmt.Errorf("failed to marshal primarky key: %+v", err)
	}

	inp.SetKey(ipk)
	if len(inp.ExpAttrNames) > 0 {
		inp.SetExpressionAttributeNames(aws.StringMap(inp.ExpAttrNames))
	}

	if len(inp.ExpAttrValues) > 0 {
		if inp.ExpressionAttributeValues, err = dynamodbattribute.MarshalMap(inp.ExpAttrValues); err != nil {
			return fmt.Errorf("failed to marshal expression values: %+v", err)
		}
	}

	if _, err = db.DeleteItemWithContext(ctx, &inp.DeleteItemInput); err != nil {
		aerr, ok := err.(awserr.Error)
		if !ok || aerr.Code() != dynamodb.ErrCodeConditionalCheckFailedException {
			return fmt.Errorf("failed to perform request: %+v", err)
		}

		if inp.ConditionError != nil {
			return inp.ConditionError
		}
		return err
	}

	return nil
}


text:
'use strict';

define(['app'], function(app) {
	app.controller('historyCtrl', function(msg) {
		var vm = this;
		vm.name = "historyCtrl";
		vm.msg = msg;
	});
});