text:
define(
  [ "core/get", "core/loaders/procedural" ],
  function( get, proceduralLoader ) {
    return function() {

      module( "get", {
        setup: function() {
          // Make a custom resource type
          this.MyCustomResource = function( data ) {
            return JSON.parse( data );
          };

          this.makeGetRequest = function makeGetRequest ( url, expectedObj ) {
            var resourceConstructor = this.MyCustomResource;
            var request = {
              type: resourceConstructor,
              url: url,
              onsuccess: function(instance) {
                deepEqual(instance, expectedObj,
                  "object expected for this resource was loaded");
              },
              onfailure: function(error) {
                ok(false, "failed to load minimal JSON file: " + error);
              }
            };

            return request;
          };

        },
        teardown: function() {}
      });

      asyncTest( 'invoke get with an empty list', function() {
        expect(3);

        function oncomplete () {
          equal( arguments.length, 0, 'oncomplete passes no arguments' );
          ok( true, "empty get completed");
          start();
        }

        var result = get( [], {
          oncomplete: oncomplete
        });

        equal( result, undefined, 'result is undefined' );
      });

      asyncTest( 'get invoked without oncomplete succeeds', function() {
        expect( 1 );

        var resourceToLoad = {
          type: this.MyCustomResource,
          url: "assets/test-loadfile1.json",
          onsuccess: function( instance ) {
            ok(true, "get invoked without oncomplete succeeded");
            start();
          },
          onfailure: function( error ) {
            ok(false, "failed to load minimal JSON file: " + error);
            start();
          }
        };

        get( [resourceToLoad] );
      });

      asyncTest( 'get a single resource', function() {
        expect(5);

        var onsuccessCalled = false;

        function oncomplete() {
          equal( arguments.length, 0, 'oncomplete passes no arguments' );
          ok( true, "get completed");
          equal( onsuccessCalled, true, 'oncomplete called after onsuccess' );
          start();
        }

        var resourceToLoad = {
          type: this.MyCustomResource,
          url: "assets/test-loadfile1.json",
          onsuccess: function( instance ) {
            deepEqual(instance, {value: 1},
              "expected simple JSON object was loaded");
            onsuccessCalled = true;
          },
          onfailure: function( error ) {
            ok(false, "failed to load minimal JSON file: " + error);
          }
        };

        var result = get( [resourceToLoad], {
          oncomplete: oncomplete
        });

        equal( result, undefined, 'result is undefined' );
      });

      asyncTest( 'default loader can be overridden in get request', function() {
        expect( 2 );

        function oncomplete() {
          ok( true, "get completed");
          start();
        }

        var resourceToLoad = {
          type: String,
          url: "custom-url",
          load: function( url, onsuccess, onfailure ) {
            onsuccess( url );
          },
          onsuccess: function( instance ) {
            deepEqual(instance, "custom-url", "instance.value is set by custom loader");
          },
          onfailure: function( error ) {
            ok(false, "failed to invoke custom loader");
          }
        };

        get( [resourceToLoad], {
          oncomplete: oncomplete
        });
      });

      asyncTest( 'get a single non-existent resource', function() {
        expect(3);

        var onfailureCalled = false;

        function oncomplete () {
          ok( true, "single non-existent get completed");
          equal( onfailureCalled, true, "onfailure called before oncomplete");
          start();
        }

        var resourceToLoad = {
          type: this.MyCustomResource,
          url: "no-such-url-exists",
          onsuccess: function( result ) {
            ok(false, "non-existent data should not have loaded successfully");
          },
          onfailure: function( error ) {
            ok(true, "failed to get non-existent data: " + error);
            onfailureCalled = true;
          }
        };

        get( [resourceToLoad], {
          oncomplete: oncomplete
        });
      });

      asyncTest( 'get three resources', function() {
        expect(4);

        function oncomplete () {
          ok( true, "get completed");
          start();
        }

        var resourcesToLoad = [
          this.makeGetRequest("assets/test-loadfile1.json", {value: 1}),
          this.makeGetRequest("assets/test-loadfile2.json", {value: 2}),
          this.makeGetRequest("assets/test-loadfile3.json", {value: 3})
        ];

        get( resourcesToLoad, {
          oncomplete: oncomplete
        });
      });

      asyncTest( 'get duplicate resources', function() {
        expect(3);

        function oncomplete() {
          ok( true, 'oncomplete is invoked' );
          start();
        }

        var resourceToLoad = {
          type: this.MyCustomResource,
          url: "assets/test-loadfile1.json",
          onsuccess: function( result ) {
            ok( true, 'onsuccess is invoked' );
          },
          onfailure: function( error ) {
            ok( false, 'onfailure should not be invoked' );
          }
        };

        get( [resourceToLoad, resourceToLoad], {
          oncomplete: oncomplete
        });
      });

      asyncTest( 'procedurally load a simple resource', function() {
        expect( 2 );

        function oncomplete() {
          ok( true, "get completed");
          start();
        }

        var resourceToLoad = {
          type: String,
          url: "assets/reverse-text.js?value=Hello%20world",
          load: proceduralLoader,
          onsuccess: function( instance ) {
            deepEqual(instance, "dlrow olleH", "instance.value is generated by procedural algorithm");
          },
          onfailure: function( error ) {
            ok(false, "failed to invoke procedural loader");
          }
        };

        get( [resourceToLoad], {
          oncomplete: oncomplete
        });
      });

      asyncTest( 'procedurally load a simple resource with no parameters', function() {
        expect( 2 );

        function oncomplete() {
            ok( true, "get completed");
            start();
          }

          var resourceToLoad = {
            type: String,
            url: "assets/reverse-text.js",
            load: proceduralLoader,
            onsuccess: function( instance ) {
              deepEqual(instance, "", "instance is generated by procedural algorithm");
            },
            onfailure: function( error ) {
              ok(false, "failed to invoke procedural loader");
            }
          };

          get( [resourceToLoad], {
            oncomplete: oncomplete
          });
    });

    };
  }
);


text:
<?php
/**
 * Simple Selenium Flow generator
 *
 * @author Roman Ozana <ozana@omdesign.cz>
 * @see https://github.com/OzzyCzech/arsenic
 *
 * @method static Arsenic open()
 * @method static Arsenic verifyElementPresent()
 * @method static Arsenic verifyElementNotPresent()
 * @method static Arsenic verifyTextPresent()
 * @method static Arsenic verifyTextNotPresent()
 * @method static Arsenic verifyText()
 * @method static Arsenic assertTitle()
 * @method static Arsenic deleteCookie()
 * @method static Arsenic waitForPageToLoad()
 * @method static Arsenic clickAndWait()
 * @method static Arsenic click()
 * @method static Arsenic chooseOkOnNextConfirmation()
 * @method static Arsenic assertConfirmation()
 * @method static Arsenic waitForVisible()
 * @method static Arsenic waitForElementPresent()
 * @method static Arsenic type()
 * @method static Arsenic store()
 * @method static Arsenic storeText()
 * @method static Arsenic storeValue()
 * @method static Arsenic storeAttribute()
 * @method static Arsenic assertBodyText()
 * @method static Arsenic verifyXpathCount()
 * @method static Arsenic waitForTextPresent()
 * @method static Arsenic storeLocation()
 * @method static Arsenic storeEval()
 * @method static Arsenic assertElementNotPresent()
 * @method static Arsenic assertElementPresent()
 */
class Arsenic {

	/** @var null|string */
	public static $outputDir = null;

	const ALERT = '

		';

	const TEST_HTML = '<?xml version = "1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<link rel="selenium.base" href="" />
	<title>%s</title>

				%s

%s

';

	const SUITE_HTML = '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

	<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
	<title>%s</title>

			%s

%s

';

	/** @var Arsenic */
	private static $instance = null;

	/** @var array */
	public $flow = array();

	/** @var array */
	public $files = array();

	/**
	 * @param string $method
	 * @param array $args
	 * @return Arsenic
	 */
	public static function __callStatic($method, array $args) {
		array_unshift($args, $method);
		call_user_func_array(array(__CLASS__, 'cmd'), $args);
		return self::getInstance();
	}

	/**
	 * @param $method
	 * @param array $args
	 * @return Arsenic
	 */
	public function __call($method, array $args) {
		array_unshift($args, $method);
		call_user_func_array(array($this, 'cmd'), $args);
		return $this;
	}

	/**
	 * @static
	 * @return Arsenic|null
	 */
	public static function getInstance() {
		if (self::$instance == null) self::$instance = new self;
		return self::$instance;
	}

	/**
	 * @param string $text
	 * @return Arsenic
	 */
	public static function comment($text) {
		self::getInstance()->flow[] = sprintf("\t\t", htmlentities($text));
		return self::getInstance();
	}

	/**
	 * @return string
	 */
	public function __toString() {
		return implode(PHP_EOL, self::getInstance()->flow);
	}

	/**
	 * Add command to flow
	 *
	 * @param string $command
	 * @param null|string $target
	 * @param null|string $value
	 * @param bool $escape
	 * @return \Arsenic
	 */
	public static function cmd($command, $target = null, $value = null, $escape = true) {
		self::getInstance()->flow[] = sprintf(
			"\t\t\t
\n\t\t\t\t%s	\n\t\t\t\t%s	\n\t\t\t\t%s	\n\t\t\t
",
			$command,
			$escape ? htmlentities($target) : $target,
			$escape ? htmlentities($value) : $value
		);
		return self::getInstance();
	}

	/**
	 * @param string $file
	 * @param string $title
	 * @param bool $reset
	 * @return \Arsenic
	 */
	public static function toFile($file, $title = null, $reset = true) {
		if ($title === null) $title = basename($file, '.html');
		if (strpos($file, DIRECTORY_SEPARATOR) !== false) {
			@mkdir(self::$outputDir . dirname($file));
		}
		file_put_contents(
			self::$outputDir . $file, sprintf(self::TEST_HTML, $title, $title, self::ALERT . PHP_EOL . self::getInstance())
		);
		self::getInstance()->files[$file] = $title;
		if ($reset) self::reset();
		return self::getInstance();
	}

	/**
	 * @param string $file
	 * @param string $suiteTitle
	 * @param string $pathPrefix
	 * @internal param string $title
	 * @return \Arsenic
	 */
	public static function saveSuite($file, $suiteTitle = 'Test Suite', $pathPrefix = './') {
		$links = '';
		foreach (self::getInstance()->files as $test => $title) {
			$links .= "\n\t\t" . sprintf(
				"
\n\t\t\t%s	\n\t\t
", $pathPrefix . $test, $title
			);
		}
		file_put_contents(self::$outputDir . $file, sprintf(self::SUITE_HTML, $suiteTitle, $suiteTitle, $links));
		return self::getInstance();
	}

	/**
	 * @param string $class
	 * @return \Arsenic
	 */
	public static function useClass($class) {
		foreach (get_class_methods($class) as $test) {
			$class::$test();
			Arsenic::toFile(str_replace('_', DIRECTORY_SEPARATOR, $test) . '.html');
		}
		return self::getInstance();
	}

	/**
	 * Reset flow
	 *
	 * @return Arsenic
	 */
	public static function reset() {
		self::getInstance()->flow = array();
		return self::getInstance();
	}

}

redpajama_set_name: RedPajamaGithub


text:
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of admin
 *
 * @author notebook
 */
class Kpg extends CI_Controller {

    function __construct() {
        parent::__construct();
        $this->load->model('user', '', TRUE);
    }

    function index() {
        if ($this->session->userdata('logged_in')) {
            $session_data = $this->session->userdata('logged_in');
            $data['nama'] = $session_data['nama'];
            $data['username'] = $session_data['username'];
            $data['email'] = $session_data['email'];
            $data['jenis_user'] = $session_data['jenis_user'];
            $this->load->view('kpg', $data);
        }
        else {
            redirect('login', 'refresh');
        }
    }

    function logout() {
        $this->session->unset_userdata('logged_in');
        session_destroy();
        $this->load->view('index');
    }
}


text:
var App = require('app');

module.exports = {
  /**
   * object that shows property names for different kind of config properties
   * - radio button property (db_selector) - main config on which can depend other core properties
   * - properties used to generate connection url (host_name, db_name)
   * - properties that should be updated on radio buttons change (connection_url, driver, db_type, sql_jar_connector)
   * @see setConnectionUrl for details for connection_url
   * - properties that should be hidden in special case (user_name, password)
   * @see handleSpecialUserPassProperties method
   * @type {object}
   */
  dpPropertiesByServiceMap: {
    'HIVE': {
      db_selector: 'hive_database',
      db_name: 'ambari.hive.db.schema.name',

      connection_url: 'javax.jdo.option.ConnectionURL',
      db_type: 'hive_database_type',
      driver: 'javax.jdo.option.ConnectionDriverName',

      user_name: 'javax.jdo.option.ConnectionUserName',
      password: 'javax.jdo.option.ConnectionPassword'
    },
    'OOZIE': {
      db_selector: 'oozie_database',
      db_name: 'oozie.db.schema.name',

      connection_url: 'oozie.service.JPAService.jdbc.url',
      driver: 'oozie.service.JPAService.jdbc.driver',

      user_name: 'oozie.service.JPAService.jdbc.username',
      password: 'oozie.service.JPAService.jdbc.password'
    }
  },

  /**
   * object that shows default(recommended) values for different db type;
   * properties that should have default value ['connection_url', 'driver', 'sql_jar_connector', 'db_type']
   * some properties can be skipped but be sure they are not used.
   * @type {object}
   */
  dpPropertiesMap: {
    'MYSQL': {
      'connection_url': 'jdbc:mysql://{0}/{1}',
      /** in case property has different default value for specific service it can be overriden in such way **/
      'HIVE': {
        'connection_url': 'jdbc:mysql://{0}/{1}?createDatabaseIfNotExist=true'
      },
      'driver': 'com.mysql.jdbc.Driver',
      'sql_jar_connector': '/usr/share/java/mysql-connector-java.jar',
      'db_type': 'mysql',
      'db_name': 'MySQL',
      'driver_download_url': 'https://dev.mysql.com/downloads/connector/j/',
      'driver_name': 'MySQL Connector/J JDBC Driver'
    },
    'POSTGRES': {
      'connection_url': 'jdbc:postgresql://{0}:5432/{1}',
      'driver': 'org.postgresql.Driver',
      'sql_jar_connector': '/usr/share/java/postgresql.jar',
      'db_type': 'postgres',
      'db_name': 'PostgreSQL',
      'driver_download_url': 'https://jdbc.postgresql.org/',
      'driver_name': 'PostgreSQL JDBC Driver'
    },
    'ORACLE': {
      'connection_url': 'jdbc:oracle:thin:@//{0}:1521/{1}',
      'driver': 'oracle.jdbc.driver.OracleDriver',
      'sql_jar_connector': '/usr/share/java/ojdbc6.jar',
      'db_type': 'oracle',
      'db_name': 'Oracle',
      'driver_download_url': 'http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html',
      'driver_name': 'Oracle JDBC Driver'
    },
    'MSSQL': {
      'connection_url': 'jdbc:sqlserver://{0};databaseName={1}',
      'driver': 'com.microsoft.sqlserver.jdbc.SQLServerDriver',
      'sql_jar_connector': '/usr/share/java/sqljdbc4.jar',
      'db_type': 'mssql'
    },
    'MSSQL2': {
      'connection_url': 'jdbc:sqlserver://{0};databaseName={1};integratedSecurity=true',
      'driver': 'com.microsoft.sqlserver.jdbc.SQLServerDriver',
      'sql_jar_connector': '/usr/share/java/sqljdbc4.jar',
      'db_type': 'mssql'
    },
    /** TODO: Remove SQLA from the list of databases once Ranger DB_FLAVOR=SQLA is replaced with SQL Anywhere */
    'SQLA': {
      'connection_url': 'jdbc:sqlanywhere:host={0};database={1}',
      'driver': 'sap.jdbc4.sqlanywhere.IDriver',
      'sql_jar_connector': '/path_to_driver/sqla-client-jdbc.tar.gz',
      'db_type': 'sqlanywhere'
    },
    'ANYWHERE': {
      'connection_url': 'jdbc:sqlanywhere:host={0};database={1}',
      'driver': 'sap.jdbc4.sqlanywhere.IDriver',
      'sql_jar_connector': '/path_to_driver/sqla-client-jdbc.tar.gz',
      'db_type': 'sqlanywhere'
    },
    'DERBY': {
      'connection_url': 'jdbc:derby:${oozie.data.dir}/${oozie.db.schema.name}-db;create=true',
      'driver': 'org.apache.derby.jdbc.EmbeddedDriver',
      'db_type': 'derby'
    }
  }
};


text:
package org.cloudfoundry.routing.v1;

import org.cloudfoundry.AbstractIntegrationTest;
import org.cloudfoundry.routing.RoutingClient;
import org.cloudfoundry.routing.v1.routergroups.ListRouterGroupsRequest;
import org.cloudfoundry.routing.v1.routergroups.ListRouterGroupsResponse;
import org.cloudfoundry.routing.v1.routergroups.RouterGroup;
import org.cloudfoundry.routing.v1.routergroups.UpdateRouterGroupRequest;
import org.cloudfoundry.routing.v1.routergroups.UpdateRouterGroupResponse;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;

import java.time.Duration;
import java.util.concurrent.TimeoutException;

public final class RouterGroupsTest extends AbstractIntegrationTest {

    private static final String DEFAULT_ROUTER_GROUP = "default-tcp";

    @Autowired
    private RoutingClient routingClient;

    @Test
    public void list() {
        this.routingClient.routerGroups()
            .list(ListRouterGroupsRequest.builder()
                .build())
            .flatMapIterable(ListRouterGroupsResponse::getRouterGroups)
            .map(RouterGroup::getName)
            .filter(DEFAULT_ROUTER_GROUP::equals)
            .as(StepVerifier::create)
            .expectNext(DEFAULT_ROUTER_GROUP)
            .expectComplete()
            .verify(Duration.ofMinutes(5));
    }

    @Test
    public void update() {
        getRouterGroupId(this.routingClient, DEFAULT_ROUTER_GROUP)
            .flatMap(routerGroupId -> this.routingClient.routerGroups()
                .update(UpdateRouterGroupRequest.builder()
                    .reservablePorts("1025-1122")
                    .routerGroupId(routerGroupId)
                    .build()))
            .map(UpdateRouterGroupResponse::getReservablePorts)
            .as(StepVerifier::create)
            .expectNext("1025-1122")
            .expectComplete()
            .verify(Duration.ofMinutes(5));
    }

    private static Mono<String> getRouterGroupId(RoutingClient routingClient, String routerGroupName) {
        return requestListRouterGroups(routingClient)
            .flatMapIterable(ListRouterGroupsResponse::getRouterGroups)
            .filter(group -> routerGroupName.equals(group.getName()))
            .single()
            .map(RouterGroup::getRouterGroupId);
    }

    private static Mono<ListRouterGroupsResponse> requestListRouterGroups(RoutingClient routingClient) {
        return routingClient.routerGroups()
            .list(ListRouterGroupsRequest.builder()
                .build());
    }

}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/static/common/apple_touch_icon.png" />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/static/common/apple_touch_icon_114x114.png" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/static/common/apple_touch_icon_72x72.png" />
<link rel="apple-touch-icon-precomposed" href="/static/common/apple_touch_icon_57x57.png" />
<link href="/static/css/fwrite.css" rel="stylesheet" type="text/css" />
<title>{% block title %}{{ 'site_title'|get_base }}-Powered By FWrite{% endblock %}</title>
<meta name="keywords" content="{% block keywords %}{{ 'site_keywords'|get_base }}{% endblock %}" />
<meta name="descript" content="{% block descript %}{{ 'site_descript'|get_base }}{% endblock %}" />
<meta name="author" content="Fooying" />
<meta name="copyright" content="Fooying" />
<base target="_blank" />

{% block body %}{% endblock %}

                        Powered By {{ 'Fwrite'|get_version }}

                        Copyright © {{ 'copy'|get_year }} - {{ 'site_title'|get_base }} - {{ 'test'|get_icp }} {{ 'count_code'|get_base }}


text:
<!DOCTYPE html>

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

        <link rel="stylesheet" href="./js/lib/matter-tools/matter-tools.css" type="text/css">

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

        <title>Matter.js Physics Engine Demo</title>

Matter.js Physics Engine Demo

Mobile Demo · Project page · GitHub

                <select id="demo-select">
                    <option value="mixed">Mixed Shapes</option>
                    <option value="mixedSolid">Solid Rendering</option>
                    <option value="newtonsCradle">Newton's Cradle</option>
                    <option value="wreckingBall">Wrecking Ball</option>
                    <option value="rounded">Rounded Corners (Chamfering)</option>
                    <option value="views">Views</option>
                    <option value="timescale">Time Scaling</option>
                    <option value="sprites">Sprites</option>
                    <option value="pyramid">Pyramid</option>
                    <option value="raycasting">Raycasting</option>
                    <option value="car">Car</option>
                    <option value="catapult">Catapult</option>
                    <option value="gravity">Reverse Gravity</option>
                    <option value="bridge">Bridge</option>
                    <option value="avalanche">Avalanche</option>
                    <option value="softBody">Basic Soft Bodies</option>
                    <option value="cloth">Cloth</option>
                    <option value="events">Events</option>
                    <option value="chains">Chains</option>
                    <option value="ballPool">Ball Pool</option>
                    <option value="stack">Stack</option>
                    <option value="circleStack">Circle Stack</option>
                    <option value="restitution">Restitution</option>
                    <option value="friction">Friction</option>
                    <option value="airFriction">Air Friction</option>
                    <option value="sleeping">Sleeping</option>
                    <option value="broadphase">Grid Broadphase</option>
                    <option value="beachBalls">Beach Balls</option>
                    <option value="stress">Stress 1</option>
                    <option value="stress2">Stress 2</option>
                </select>
                <input id="demo-reset" value="Reset" type="submit">


text:
package com.thoughtworks.go.server.service.materials;

import java.io.File;
import java.util.List;

import com.thoughtworks.go.config.materials.SubprocessExecutionContext;
import com.thoughtworks.go.config.materials.perforce.P4Material;
import com.thoughtworks.go.domain.materials.Modification;
import com.thoughtworks.go.domain.materials.Revision;

public class P4Poller implements MaterialPoller<P4Material> {

    @Override
    public List<Modification> latestModification(P4Material material, File baseDir, SubprocessExecutionContext execCtx) {
        return material.latestModification(baseDir, execCtx);
    }

    @Override
    public List<Modification> modificationsSince(P4Material material, File baseDir, Revision revision, SubprocessExecutionContext execCtx) {
        return material.modificationsSince(baseDir, revision, execCtx);
    }
}


text:
package com.baidu.hsb.server.response;

import java.nio.ByteBuffer;

import com.baidu.hsb.config.Fields;
import com.baidu.hsb.mysql.PacketUtil;
import com.baidu.hsb.net.mysql.EOFPacket;
import com.baidu.hsb.net.mysql.FieldPacket;
import com.baidu.hsb.net.mysql.ResultSetHeaderPacket;
import com.baidu.hsb.net.mysql.RowDataPacket;
import com.baidu.hsb.server.ServerConnection;

/**
 * @author xiongzhao@baidu.com 2011-5-7 下午01:00:33
 */
public class SelectVersionComment {

    private static final byte[] VERSION_COMMENT = "Heisenberg Server-1.0.3.2 (BAIDU) author:brucest0078@gmail.com".getBytes();
    private static final int FIELD_COUNT = 1;
    private static final ResultSetHeaderPacket header = PacketUtil.getHeader(FIELD_COUNT);
    private static final FieldPacket[] fields = new FieldPacket[FIELD_COUNT];
    private static final EOFPacket eof = new EOFPacket();
    static {
        int i = 0;
        byte packetId = 0;
        header.packetId = ++packetId;
        fields[i] = PacketUtil.getField("@@VERSION_COMMENT", Fields.FIELD_TYPE_VAR_STRING);
        fields[i++].packetId = ++packetId;
        eof.packetId = ++packetId;
    }

    public static void response(ServerConnection c) {
        ByteBuffer buffer = c.allocate();

        // write header
        buffer = header.write(buffer, c);

        // write fields
        for (FieldPacket field : fields) {
            buffer = field.write(buffer, c);
        }

        // write eof
        buffer = eof.write(buffer, c);

        // write rows
        byte packetId = eof.packetId;
        RowDataPacket row = new RowDataPacket(FIELD_COUNT);
        row.add(VERSION_COMMENT);
        row.packetId = ++packetId;
        buffer = row.write(buffer, c);

        // write last eof
        EOFPacket lastEof = new EOFPacket();
        lastEof.packetId = ++packetId;
        buffer = lastEof.write(buffer, c);

        // post write
        c.write(buffer);
    }

}


text:
package com.netflix.genie.agent.execution.statemachine.stages;

import com.netflix.genie.agent.execution.exceptions.JobSpecificationResolutionException;
import com.netflix.genie.agent.execution.services.AgentJobService;
import com.netflix.genie.agent.execution.statemachine.ExecutionContext;
import com.netflix.genie.agent.execution.statemachine.ExecutionStage;
import com.netflix.genie.agent.execution.statemachine.FatalJobExecutionException;
import com.netflix.genie.agent.execution.statemachine.RetryableJobExecutionException;
import com.netflix.genie.agent.execution.statemachine.States;
import com.netflix.genie.common.internal.dtos.JobSpecification;
import com.netflix.genie.common.internal.dtos.JobStatus;
import com.netflix.genie.common.internal.exceptions.unchecked.GenieRuntimeException;
import lombok.extern.slf4j.Slf4j;

/**
 * Obtains job specification from server.
 *
 * @author mprimi
 * @since 4.0.0
 */
@Slf4j
public class ObtainJobSpecificationStage extends ExecutionStage {
    private final AgentJobService agentJobService;

    /**
     * Constructor.
     *
     * @param agentJobService agent job service
     */
    public ObtainJobSpecificationStage(final AgentJobService agentJobService) {
        super(States.OBTAIN_JOB_SPECIFICATION);
        this.agentJobService = agentJobService;
    }

    @Override
    protected void attemptStageAction(
        final ExecutionContext executionContext
    ) throws RetryableJobExecutionException, FatalJobExecutionException {

        final String reservedJobId = executionContext.getReservedJobId();
        assert reservedJobId != null;

        final JobSpecification jobSpecification;

        try {

            if (executionContext.isPreResolved()) {
                log.info("Retrieving pre-resolved job specification");
                jobSpecification = this.agentJobService.getJobSpecification(reservedJobId);

            } else {
                log.info("Requesting job specification resolution");
                jobSpecification = agentJobService.resolveJobSpecification(reservedJobId);
                executionContext.setCurrentJobStatus(JobStatus.RESOLVED);
            }

        } catch (final GenieRuntimeException e) {
            throw createRetryableException(e);
        } catch (final JobSpecificationResolutionException e) {
            throw createFatalException(e);
        }

        executionContext.setJobSpecification(jobSpecification);

        log.info("Successfully obtained specification");

    }
}


text:
/**
 * Local Server
 * ========
 * 1. load configurations and modules
 * 2. configure app
 * 3. import backend logic
 * 4. create server
 *
 * @author ijse
 */
var express       = require('express');
var http          = require('http');
var path          = require('path');

var RenderManager = require('./RenderManager');
var RouterManager = require('./RouterManager');

var createServer = function(gConfig) {
    var serverConfigs = gConfig.server;
    var app = exports.app = new express();

    // app.set('proxy support', gConfig.proxy.enable);
    // app.set('proxy setting', gConfig.proxy);
    app.set('static resource', serverConfigs.path['public']);
    app.set('views', serverConfigs.path.view);
	app.set('view engine', 'ejs');

    // Define renders for response
    // so that it will be used in router
    app.set('render manager', new RenderManager());

    //!! EMIT
    Hub.emit("localServer.renderEngine.regist", { app: app });

    app.use(express.favicon());

    // Will print every request log
    app.use(express.logger('dev'));

    app.use(express.bodyParser());
    app.use(express.methodOverride());

    // Support cookie and session
    app.use(express.cookieParser('ijse'));
    app.use(express.session());

    //!! EMIT
    Hub.emit("localServer.loadRoute.before", { app: app });

    // Now router
    app.use(app.router);

    //!! EMIT
    Hub.emit("localServer.loadRoute.after", { app: app });

    // Static resources
    app.use(express['static'](app.get('static resource')));

    // No router, proxy fail, no static resource, then throw error
    app.use(express.errorHandler());

    // apply global variables
    app.locals(serverConfigs.globals);

    // load routes
    RouterManager.loadRoutes(serverConfigs.path.mock, app);

    // Start local-service host, notify address
    var httpServer = http.createServer(app);

    return httpServer;
};

exports.create = createServer;

// Support express.bodyParser()
// ======================================
// Parse request body to support POST request params so that
// we can use `req.param()` and `req.body`
// function doBodyParser(_app, req, res, next, cb) {
//     express.bodyParser().call(_app, req, res, function(err) {
//         if(err) return next(err);
//         cb();
//     });
// }


text:
globalThis.isGenerator = function isGenerator(value) {
    return isObject(value) &&
        Reflect.has(value, 'next') && Reflect.has(value, 'throw') &&
        'function' === typeof value.next && 'function' === typeof value.throw;
};

/**
 * @param {*} value
 *
 * @returns {boolean}
 */
globalThis.isGeneratorFunction = function isGeneratorFunction(value) {
    if (! value) {
        return false;
    }

    if (isGenerator(value)) {
        return false;
    }

    if ('[object AsyncGeneratorFunction]' === Object.prototype.toString.call(value)) {
        return true;
    }

    if (isGeneratorFunction(value.__invoke)) {
        return true;
    }

    const constructor = value.constructor;
    if (! constructor) {
        return false;
    }

    if ('GeneratorFunction' === constructor.name || 'GeneratorFunction' === constructor.displayName) {
        return true;
    }

    return isGenerator(constructor.prototype);
};

if (__jymfony.Platform.hasAsyncFunctionSupport()) {
    /**
     * @param {*} value
     *
     * @returns {boolean}
     */
    globalThis.isAsyncFunction = function isAsyncFunction(value) {
        if (!value) {
            return false;
        }

        const constructor = value.constructor;
        if (!constructor) {
            return false;
        }

        if ('AsyncFunction' === (constructor.name || constructor.displayName)) {
            return true;
        }

        return '[object AsyncFunction]' === Object.prototype.toString.call(value);
    };
} else {
    globalThis.isAsyncFunction = function isAsyncFunction() {
        return false;
    };
}

/**
 * @param {*} obj
 *
 * @returns {boolean}
 */
globalThis.isFunction = function isFunction(obj) {
    if (! obj) {
        return false;
    }

    if (undefined !== globalThis.BoundFunction && obj instanceof BoundFunction) {
        return true;
    }

    if (
        undefined !== globalThis.BoundFunction &&
        Object.prototype.hasOwnProperty.call(obj, 'innerObject') &&
        obj.innerObject instanceof BoundFunction
    ) {
        return true;
    }

    if (isGeneratorFunction(obj)) {
        return true;
    }

    if (isAsyncFunction(obj)) {
        return true;
    }

    if (isFunction(obj.__invoke)) {
        return true;
    }

    return '[object Function]' === Object.prototype.toString.call(obj);
};


text:
package http

import (
	"encoding/base64"
	"encoding/json"
	"errors"
	"log"
	"net/http"
	"net/url"
	"path"
	"strconv"
	"strings"
	"time"
)

func WriteError(w http.ResponseWriter, code int, msg string) {
	e := struct {
		Error string `json:"error"`
	}{
		Error: msg,
	}
	b, err := json.Marshal(e)
	if err != nil {
		log.Printf("go-oidc: failed to marshal %#v: %v", e, err)
		code = http.StatusInternalServerError
		b = []byte(`{"error":"server_error"}`)
	}
	w.Header().Set("Content-Type", "application/json")
	w.WriteHeader(code)
	w.Write(b)
}

// BasicAuth parses a username and password from the request's
// Authorization header. This was pulled from golang master:
// https://codereview.appspot.com/76540043
func BasicAuth(r *http.Request) (username, password string, ok bool) {
	auth := r.Header.Get("Authorization")
	if auth == "" {
		return
	}

	if !strings.HasPrefix(auth, "Basic ") {
		return
	}
	c, err := base64.StdEncoding.DecodeString(strings.TrimPrefix(auth, "Basic "))
	if err != nil {
		return
	}
	cs := string(c)
	s := strings.IndexByte(cs, ':')
	if s < 0 {
		return
	}
	return cs[:s], cs[s+1:], true
}

func cacheControlMaxAge(hdr string) (time.Duration, bool, error) {
	for _, field := range strings.Split(hdr, ",") {
		parts := strings.SplitN(strings.TrimSpace(field), "=", 2)
		k := strings.ToLower(strings.TrimSpace(parts[0]))
		if k != "max-age" {
			continue
		}

		if len(parts) == 1 {
			return 0, false, errors.New("max-age has no value")
		}

		v := strings.TrimSpace(parts[1])
		if v == "" {
			return 0, false, errors.New("max-age has empty value")
		}

		age, err := strconv.Atoi(v)
		if err != nil {
			return 0, false, err
		}

		if age <= 0 {
			return 0, false, nil
		}

		return time.Duration(age) * time.Second, true, nil
	}

	return 0, false, nil
}

func expires(date, expires string) (time.Duration, bool, error) {
	if date == "" || expires == "" {
		return 0, false, nil
	}

	var te time.Time
	var err error
	if expires == "0" {
		return 0, false, nil
	}
	te, err = time.Parse(time.RFC1123, expires)
	if err != nil {
		return 0, false, err
	}

	td, err := time.Parse(time.RFC1123, date)
	if err != nil {
		return 0, false, err
	}

	ttl := te.Sub(td)

	// headers indicate data already expired, caller should not
	// have to care about this case
	if ttl <= 0 {
		return 0, false, nil
	}

	return ttl, true, nil
}

func Cacheable(hdr http.Header) (time.Duration, bool, error) {
	ttl, ok, err := cacheControlMaxAge(hdr.Get("Cache-Control"))
	if err != nil || ok {
		return ttl, ok, err
	}

	return expires(hdr.Get("Date"), hdr.Get("Expires"))
}

// MergeQuery appends additional query values to an existing URL.
func MergeQuery(u url.URL, q url.Values) url.URL {
	uv := u.Query()
	for k, vs := range q {
		for _, v := range vs {
			uv.Add(k, v)
		}
	}
	u.RawQuery = uv.Encode()
	return u
}

// NewResourceLocation appends a resource id to the end of the requested URL path.
func NewResourceLocation(reqURL *url.URL, id string) string {
	var u url.URL
	u = *reqURL
	u.Path = path.Join(u.Path, id)
	u.RawQuery = ""
	u.Fragment = ""
	return u.String()
}

// CopyRequest returns a clone of the provided *http.Request.
// The returned object is a shallow copy of the struct and a
// deep copy of its Header field.
func CopyRequest(r *http.Request) *http.Request {
	r2 := *r
	r2.Header = make(http.Header)
	for k, s := range r.Header {
		r2.Header[k] = s
	}
	return &r2
}


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

namespace BodeAbp.Queue.Protocols
{
    [Serializable]
    public class ConsumerHeartbeatData
    {
        public string ConsumerId { get; private set; }
        public string GroupName { get; private set; }
        public IEnumerable<string> SubscriptionTopics { get; private set; }
        public IEnumerable<MessageQueue> ConsumingQueues { get; private set; }

        public ConsumerHeartbeatData(string consumerId, string groupName, IEnumerable<string> subscriptionTopics, IEnumerable<MessageQueue> consumingQueues)
        {
            ConsumerId = consumerId;
            GroupName = groupName;
            SubscriptionTopics = subscriptionTopics;
            ConsumingQueues = consumingQueues;
        }

        public override string ToString()
        {
            return string.Format("[ConsumerId:{0}, GroupName:{1}, SubscriptionTopics:{2}, ConsumingQueues:{3}]", ConsumerId, GroupName, string.Join("|", SubscriptionTopics), string.Join("|", ConsumingQueues));
        }
    }
}


text:
namespace gl10
{

// import bitfields to namespace
using gl::GL_ACCUM_BUFFER_BIT;
using gl::GL_ALL_ATTRIB_BITS;
using gl::GL_COLOR_BUFFER_BIT;
using gl::GL_CURRENT_BIT;
using gl::GL_DEPTH_BUFFER_BIT;
using gl::GL_ENABLE_BIT;
using gl::GL_EVAL_BIT;
using gl::GL_FOG_BIT;
using gl::GL_HINT_BIT;
using gl::GL_LIGHTING_BIT;
using gl::GL_LINE_BIT;
using gl::GL_LIST_BIT;
using gl::GL_PIXEL_MODE_BIT;
using gl::GL_POINT_BIT;
using gl::GL_POLYGON_BIT;
using gl::GL_POLYGON_STIPPLE_BIT;
using gl::GL_SCISSOR_BIT;
using gl::GL_STENCIL_BUFFER_BIT;
using gl::GL_TEXTURE_BIT;
using gl::GL_TRANSFORM_BIT;
using gl::GL_VIEWPORT_BIT;

} // namespace gl10


text:
require "rails_helper"
require 'features/user_and_organisations'

feature "Add dataset page", type: :feature, vcr: { :match_requests_on => [:host, :method] } do
  include_context 'user and organisations'

  let(:data_file) { get_fixture_file('valid-schema.csv') }
  let(:wonky_file) { get_fixture_schema_file('good-schema.json') }
  let(:common_name) { Faker::Lorem.word }
  let(:page_copy) { 'Infer a new schema' }
  let(:infer_schema_filename) { 'schemas/infer-from/data_infer.csv' }
  let(:uuid) { 'd42c4843-bc5b-4c62-b161-a55356125b59' }
  let(:csv_storage_key) { "uploads/#{uuid}/data_infer.csv" }
  let(:wonky_storage_key) { "uploads/#{uuid}/good-schema.json" }
  let(:infer_schema_csv_url) { url_with_stubbed_get_for_storage_key(csv_storage_key, infer_schema_filename) }

  before(:each) do
    visit root_path
    click_link 'Schemas'
    expect(page).to have_content 'You currently have no dataset file schemas, why not add one?'
  end

  context "logged in visitors has no schemas" do
    scenario "and can infer a dataset file schema from a data file" do
      click_link 'Infer a new schema'
      expect(page).to have_content page_copy

      before_datasets = DatasetFileSchema.count

      within 'form' do
        expect(page).to have_content @user.github_username
        select @user.github_username, :from => "inferred_dataset_file_schema_owner_username"
        fill_in 'inferred_dataset_file_schema_name', with: "#{common_name}-schema-name"
        fill_in 'inferred_dataset_file_schema_description', with: "#{common_name}-schema-description"
        attach_file('inferred_dataset_file_schema_csv_url', data_file)
        click_on 'Add to schemas'
      end

      expect(CGI.unescapeHTML(page.html)).to have_content "Dataset File Schemas for #{@user.name}"
      expect(DatasetFileSchema.count).to be before_datasets + 1
      expect(DatasetFileSchema.last.name).to eq "#{common_name}-schema-name"
    end

    scenario "and can infer a dataset file schema from a data file with categories" do

      category_1 = SchemaCategory.create(name: 'cat1')
      category_2 = SchemaCategory.create(name: 'cat2')
      schema_category_ids = [ category_1.id, category_2.id ]

      click_link 'Infer a new schema'
      expect(page).to have_content page_copy

      within 'form' do
        expect(page).to have_content @user.github_username
        select @user.github_username, :from => "inferred_dataset_file_schema_owner_username"
        fill_in 'inferred_dataset_file_schema_name', with: "#{common_name}-schema-name"
        fill_in 'inferred_dataset_file_schema_description', with: "#{common_name}-schema-description"
        attach_file('inferred_dataset_file_schema_csv_url', data_file)
        check ('cat1')
        check ('cat2')
        click_on 'Add to schemas'
      end

      expect(CGI.unescapeHTML(page.html)).to have_content "Dataset File Schemas for #{@user.name}"
      dataset_file_schema = DatasetFileSchema.first
      expect(DatasetFileSchema.count).to be 1
      expect(dataset_file_schema.schema_categories).to eq [ category_1, category_2 ]
    end

    context "and gets an error if they do not populate the correct fields" do

      before(:each) do
      	click_link 'Infer a new schema'
        expect(page).to have_content page_copy
      end

      it "errors if no name" do
        within 'form' do

          fill_in 'inferred_dataset_file_schema_description', with: "#{common_name}-schema-description"
          attach_file('inferred_dataset_file_schema_csv_url', data_file)

        	click_on 'Add to schemas'
        end

        expect(page).to have_content page_copy
        expect(page).to have_content 'Please give the schema a meaningful name'
      end

      it "errors if no file" do
        within 'form' do
          fill_in 'inferred_dataset_file_schema_name', with: "#{common_name}-schema-name"
          fill_in 'inferred_dataset_file_schema_description', with: "#{common_name}-schema-description"
        	click_on 'Add to schemas'
        end

        expect(page).to have_content page_copy
        expect(page).to have_content 'You must have a data file'
      end

      it "errors if file is wrong format" do
        within 'form' do
          expect(page).to have_content @user.github_username
          select @user.github_username, :from => "inferred_dataset_file_schema_owner_username"
          fill_in 'inferred_dataset_file_schema_name', with: "#{common_name}-schema-name"
          fill_in 'inferred_dataset_file_schema_description', with: "#{common_name}-schema-description"
          attach_file('inferred_dataset_file_schema_csv_url', wonky_file)
        	click_on 'Add to schemas'
        end

        expect(page).to have_content page_copy
        expect(page).to have_content 'Inferring schema from dataset failed'
      end
    end
  end
end


text:
typedef void(^fileArchiverDidError)(NSError *error);
typedef void(^fileArchiverDidArchive)(NSString *fullPath);

@interface FileArchiver : NSObject
-(void)rotateLogs;
-(NSArray *)archivedLogs;
-(NSString *)fullPathForLogDated:(NSDate *)date;

@property (nonatomic, copy) NSString *activeLogPath;
@property (nonatomic, copy) NSString *archivedLogPath;
@property (nonatomic, copy) fileArchiverDidArchive didArchive;
@property (nonatomic, copy) fileArchiverDidError didError;
@end


text:
[CmdletBinding()]
param (
    [Parameter(ValueFromPipeline,
        ValueFromPipelineByPropertyName)]
    [Alias("CN", "Name")]
    [ValidateNotNullOrEmpty()]
    [String[]]
    $ComputerName = $Env:COMPUTERNAME,

    [Pscredential]
    $Credential
)

process {
    Foreach ($Computer in $ComputerName) {
        Write-Verbose "Disabling fastboot on $Computer"

        $Command = {
            Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power\' -Name hiberbootenabled -Value 0
        }

        $Parameters = @{
            Command          = $Command
            ErrorAction      = "Stop"
            ComputerName     = $Computer
            HideComputerName = $True
        }

        if ($Computer -in @($Env:COMPUTERNAME, "localhost")) {
            $Parameters.remove('ComputerName')
            $Parameters.remove('HideComputerName')
        }
        elseIf ($PSBoundParameters.ContainsKey("Credential")) {
            $Parameters.Credential = $Credential
        }

        try {
            Write-Verbose "Connecting to $Computer"
            Invoke-Command @Parameters

            Write-Output "Fastboot was disabled on $Computer"
            Write-Verbose "Fastboot was disabled on $Computer"
        }
        catch {
            Write-Error $_
        } # catch
    } # foreach
} # process


text:
package typedvalues

import (
	"github.com/golang/protobuf/proto"
	"github.com/golang/protobuf/ptypes/wrappers"
)

var (
	TypeBool       string
	TypeInt32      string
	TypeInt64      string
	TypeUInt32     string
	TypeUInt64     string
	TypeFloat32    string
	TypeFloat64    string
	TypeString     string
	TypeBytes      string
	TypeNil        string
	TypeExpression string
	TypeMap        string
	TypeList       string
	TypeNumber     []string
	Types          []string
)

// Note: ensure that this file is lexically after the generated Protobufs because of package initialization order.
func init() {
	TypeBool = proto.MessageName(&wrappers.BoolValue{})
	TypeInt32 = proto.MessageName(&wrappers.Int32Value{})
	TypeInt64 = proto.MessageName(&wrappers.Int64Value{})
	TypeUInt32 = proto.MessageName(&wrappers.UInt32Value{})
	TypeUInt64 = proto.MessageName(&wrappers.UInt64Value{})
	TypeFloat32 = proto.MessageName(&wrappers.FloatValue{})
	TypeFloat64 = proto.MessageName(&wrappers.DoubleValue{})
	TypeString = proto.MessageName(&wrappers.StringValue{})
	TypeBytes = proto.MessageName(&wrappers.BytesValue{})
	TypeNil = proto.MessageName(&NilValue{})
	TypeExpression = proto.MessageName(&Expression{})
	TypeMap = proto.MessageName(&MapValue{})
	TypeList = proto.MessageName(&ArrayValue{})
	TypeNumber = []string{
		TypeFloat64,
		TypeFloat32,
		TypeInt32,
		TypeInt64,
		TypeUInt32,
		TypeUInt64,
	}
	Types = []string{
		TypeBool,
		TypeInt32,
		TypeInt64,
		TypeUInt32,
		TypeUInt64,
		TypeFloat32,
		TypeFloat64,
		TypeString,
		TypeBytes,
		TypeNil,
		TypeExpression,
		TypeMap,
		TypeList,
	}
}


text:
var Tree;
(function (_Tree) {
    var Tree = (function () {
        function Tree() {
        }
        Tree.prototype.Tree = function (node) {
            this._root = node;
        };

        Object.defineProperty(Tree.prototype, "root", {
            get: function () {
                return this._root;
            },
            enumerable: true,
            configurable: true
        });

        Tree.prototype.traverseDFS = function () {
            this._traverseDFS(this.root, '');
        };

        Tree.prototype._traverseDFS = function (root, spaces) {
            if (!root) {
                return;
            }

            console.log(spaces + root.value);

            for (var i = 0; i < root.childrenCount; i++) {
                this._traverseDFS(root.children[i], spaces + "   ");
            }
        };
        return Tree;
    })();
    _Tree.Tree = Tree;
})(Tree || (Tree = {}));
//# sourceMappingURL=firm.js.map


text:
namespace net {
namespace test {

// static
bool QuicPacketCreatorPeer::SendVersionInPacket(QuicPacketCreator* creator) {
  return creator->send_version_in_packet_;
}

// static
void QuicPacketCreatorPeer::SetSendVersionInPacket(
    QuicPacketCreator* creator, bool send_version_in_packet) {
  creator->send_version_in_packet_ = send_version_in_packet;
}

// static
void QuicPacketCreatorPeer::SetSequenceNumberLength(
      QuicPacketCreator* creator,
      QuicSequenceNumberLength sequence_number_length) {
  creator->sequence_number_length_ = sequence_number_length;
}

// static
void QuicPacketCreatorPeer::SetNextSequenceNumberLength(
    QuicPacketCreator* creator,
    QuicSequenceNumberLength next_sequence_number_length) {
  creator->next_sequence_number_length_ = next_sequence_number_length;
}

// static
QuicSequenceNumberLength QuicPacketCreatorPeer::NextSequenceNumberLength(
    QuicPacketCreator* creator) {
  return creator->next_sequence_number_length_;
}

// static
QuicSequenceNumberLength QuicPacketCreatorPeer::GetSequenceNumberLength(
    QuicPacketCreator* creator) {
  return creator->sequence_number_length_;
}

void QuicPacketCreatorPeer::SetSequenceNumber(QuicPacketCreator* creator,
                                              QuicPacketSequenceNumber s) {
  creator->sequence_number_ = s;
}

}  // namespace test
}  // namespace net


text:
namespace principia {
namespace numerics {
namespace internal_newhall {

using base::not_null;
using geometry::Instant;
using quantities::Difference;
using quantities::Variation;

// Computes a Newhall approximation of the given |degree| in the Чебышёв basis.
// |q| and |v| are the positions and velocities over a constant division of
// [t_min, t_max].  |error_estimate| gives an estimate of the error between the
// approximation the input data.  The client probably wants to compute some
// norm of that estimate.
template<typename Vector>
ЧебышёвSeries<Vector>
NewhallApproximationInЧебышёвBasis(int degree,
                                   std::vector<Vector> const& q,
                                   std::vector<Variation<Vector>> const& v,
                                   Instant const& t_min,
                                   Instant const& t_max,
                                   Vector& error_estimate);

// Computes a Newhall approximation of the given |degree| in the monomial basis.
// The parameters have the same meaning as in the preceding function.  The
// result is a polynomial of |Time| valid around |(t_min + t_max) / 2| with
// an argument in the range [(t_min - t_max) / 2, (t_max - t_min) / 2].
template<typename Value, int degree,
         template<typename, typename, int> class Evaluator>
PolynomialInMonomialBasis<Value, Instant, degree, Evaluator>
NewhallApproximationInMonomialBasis(std::vector<Value> const& q,
                                    std::vector<Variation<Value>> const& v,
                                    Instant const& t_min,
                                    Instant const& t_max,
                                    Difference<Value>& error_estimate);

// Same as above but the |degree| is not a constant expression.
template<typename Value,
         template<typename, typename, int> class Evaluator>
not_null<std::unique_ptr<Polynomial<Value, Instant>>>
NewhallApproximationInMonomialBasis(int degree,
                                    std::vector<Value> const& q,
                                    std::vector<Variation<Value>> const& v,
                                    Instant const& t_min,
                                    Instant const& t_max,
                                    Difference<Value>& error_estimate);

}  // namespace internal_newhall

using internal_newhall::NewhallApproximationInЧебышёвBasis;
using internal_newhall::NewhallApproximationInMonomialBasis;

}  // namespace numerics
}  // namespace principia

#include "numerics/newhall_body.hpp"


text:
package com.coderbd.scdb.web.dto;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "event_details")
public class EventDetail implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = 4983614943766619554L;

	@Id
	@GeneratedValue
	@Column(name = "event_id")
	private int eventId;

	@Column(name = "event_title")
	private String eventTitle;

	@Column(name = "event_start_time")
	private Date eventStartTime;

	@Column(name = "event_end_time")
	private Date eventEndTime;

	@Column(name = "event_team_size")
	private int eventTeamSize=0;

	@Column(name = "reg_need")
	private boolean regNeed=false;;

	public EventDetail() {
	}

	public EventDetail(int eventId, String eventTitle, Date eventStartTime,
			Date eventEndTime, int eventTeamSize, boolean regNeed) {

		this.eventId = eventId;
		this.eventTitle = eventTitle;
		this.eventStartTime = eventStartTime;
		this.eventEndTime = eventEndTime;
		this.eventTeamSize = eventTeamSize;
		this.regNeed = regNeed;
	}

	public EventDetail(String eventTitle, Date eventStartTime,
			Date eventEndTime, int eventTeamSize, boolean regNeed) {

		this.eventTitle = eventTitle;
		this.eventStartTime = eventStartTime;
		this.eventEndTime = eventEndTime;
		this.eventTeamSize = eventTeamSize;
		this.regNeed = regNeed;
	}

	public int getEventId() {
		return eventId;
	}

	public void setEventId(int eventId) {
		this.eventId = eventId;
	}

	public String getEventTitle() {
		return eventTitle;
	}

	public void setEventTitle(String eventTitle) {
		this.eventTitle = eventTitle;
	}

	public Date getEventStartTime() {
		return eventStartTime;
	}

	public void setEventStartTime(Date eventStartTime) {
		this.eventStartTime = eventStartTime;
	}

	public Date getEventEndTime() {
		return eventEndTime;
	}

	public void setEventEndTime(Date eventEndTime) {
		this.eventEndTime = eventEndTime;
	}

	public int getEventTeamSize() {
		return eventTeamSize;
	}

	public void setEventTeamSize(int eventTeamSize) {
		this.eventTeamSize = eventTeamSize;
	}

	public boolean isRegNeed() {
		return regNeed;
	}

	public void setRegNeed(boolean regNeed) {
		this.regNeed = regNeed;
	}

	@Override
	public String toString() {
		return "EventDetail [eventId=" + eventId + ", eventTitle=" + eventTitle
				+ ", eventStartTime=" + eventStartTime + ", eventEndTime="
				+ eventEndTime + ", eventTeamSize=" + eventTeamSize
				+ ", regNeed=" + regNeed + "]";
	}

}


text:
using UnityEngine;

/// <summary>
///
/// </summary>
public class Enemy : MonoBehaviour
{
    #region Properties
    public float MinSpeed;
    public float MaxSpeed;
    public GameObject ProjectilePrefab1;
    public GameObject ProjectilePrefab2;

    private float m_CurSpeed;
    private float m_StartX;
    private float m_StartY;
    private float m_StartZ;
    private bool m_SpawnSide;
    #endregion

    #region Event Handlers
    /// <summary>
    /// Start is called on the frame when a script is enabled just before any of the Update methods is called the first time.
    ///
    /// Like the Awake function, Start is called exactly once in the lifetime of the script.
    /// However, Awake is called when the script object is initialised, regardless of whether or not the script is enabled. Start may not be called on the same frame as Awake if the script is not enabled at initialisation time.
    ///
    /// The Awake function is called on all objects in the scene before any object's Start function is called.
    /// This fact is useful in cases where object A's initialisation code needs to rely on object B's already being initialised; B's initialisation should be done in Awake while A's should be done in Start.
    /// </summary>
    void Awake() {
        m_StartZ = 0;
        SetRandomStartLoc();
    }

    /// <summary>
    /// Update is called every frame, if the MonoBehaviour is enabled.
    /// Update is the most commonly used function to implement any kind of game behaviour.
    /// </summary>
    void Update()
    {
        float amtToMove = m_CurSpeed * Time.deltaTime;

        if (m_SpawnSide)
        {
            transform.Translate(Vector3.right * amtToMove);
            if (transform.position.x > 6.5f)
            {
                SetRandomStartLoc();
            }
        }
        else
        {
            transform.Translate(Vector3.left * amtToMove);
            if (transform.position.x < -6.5f)
            {
                SetRandomStartLoc();
            }
        }
        /*
        if (transform.position.y < -6.5f)
        {
            Player.Missed++;
            setRandomStartLoc();
        }*/
    }
    #endregion

    #region Functions
    /// <summary>
    ///
    /// </summary>
    /// <returns></returns>
    public bool RandomizeStartingLocation()
    {
        float temp;
        temp = Random.value;
        if (temp > 0.5f)
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    /// <summary>
    ///
    /// </summary>
    public void SetRandomStartLoc() {
        m_SpawnSide = RandomizeStartingLocation();

        if (m_SpawnSide)
        {
            m_StartX = -6.5f;
        }
        else
        {
            m_StartX = 6.5f;
        }

        m_StartY = Random.Range(-1.4f, 5.1f);
        transform.position = new Vector3(m_StartX, m_StartY, m_StartZ);
        //Setting Enemy's speed
        m_CurSpeed = Random.Range(MinSpeed, MaxSpeed);
    }

    /// <summary>
    ///
    /// </summary>
    /// <param name="pos"></param>
    /// <param name="rot"></param>
    void CreateNewEnemy(Vector3 pos, Quaternion rot) {
        Enemy enemy = new Enemy();
        Instantiate(enemy.gameObject, pos, rot);
    }
    #endregion
}