text:
/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/
"use strict";

const { RawSource } = require("webpack-sources");
const ModuleFilenameHelpers = require("./ModuleFilenameHelpers");

const cache = new WeakMap();

class EvalSourceMapDevToolModuleTemplatePlugin {
	constructor(compilation, options) {
		this.compilation = compilation;
		this.sourceMapComment =
			options.append || "//# sourceURL=[module]\n//# sourceMappingURL=[url]";
		this.moduleFilenameTemplate =
			options.moduleFilenameTemplate ||
			"webpack://[namespace]/[resource-path]?[hash]";
		this.namespace = options.namespace || "";
		this.options = options;
	}

	apply(moduleTemplate) {
		const self = this;
		const options = this.options;
		const matchModule = ModuleFilenameHelpers.matchObject.bind(
			ModuleFilenameHelpers,
			options
		);
		moduleTemplate.hooks.module.tap(
			"EvalSourceMapDevToolModuleTemplatePlugin",
			(source, module) => {
				const cachedSource = cache.get(source);
				if (cachedSource !== undefined) {
					return cachedSource;
				}

				if (!matchModule(module.resource)) {
					return source;
				}

				/** @type {{ [key: string]: TODO; }} */
				let sourceMap;
				let content;
				if (source.sourceAndMap) {
					const sourceAndMap = source.sourceAndMap(options);
					sourceMap = sourceAndMap.map;
					content = sourceAndMap.source;
				} else {
					sourceMap = source.map(options);
					content = source.source();
				}
				if (!sourceMap) {
					return source;
				}

				// Clone (flat) the sourcemap to ensure that the mutations below do not persist.
				sourceMap = Object.keys(sourceMap).reduce((obj, key) => {
					obj[key] = sourceMap[key];
					return obj;
				}, {});
				const modules = sourceMap.sources.map(source => {
					const module = self.compilation.findModule(source);
					return module || source;
				});
				let moduleFilenames = modules.map(module => {
					return ModuleFilenameHelpers.createFilename(
						module,
						{
							moduleFilenameTemplate: self.moduleFilenameTemplate,
							namespace: self.namespace
						},
						moduleTemplate.runtimeTemplate.requestShortener
					);
				});
				moduleFilenames = ModuleFilenameHelpers.replaceDuplicates(
					moduleFilenames,
					(filename, i, n) => {
						for (let j = 0; j < n; j++) filename += "*";
						return filename;
					}
				);
				sourceMap.sources = moduleFilenames;
				sourceMap.sourceRoot = options.sourceRoot || "";
				sourceMap.file = `${module.id}.js`;

				const footer =
					self.sourceMapComment.replace(
						/\[url\]/g,
						`data:application/json;charset=utf-8;base64,${Buffer.from(
							JSON.stringify(sourceMap),
							"utf8"
						).toString("base64")}`
					) + `\n//# sourceURL=webpack-internal:///${module.id}\n`; // workaround for chrome bug

				const evalSource = new RawSource(
					`eval(${JSON.stringify(content + footer)});`
				);

				cache.set(source, evalSource);

				return evalSource;
			}
		);
		moduleTemplate.hooks.hash.tap(
			"EvalSourceMapDevToolModuleTemplatePlugin",
			hash => {
				hash.update("eval-source-map");
				hash.update("2");
			}
		);
	}
}
module.exports = EvalSourceMapDevToolModuleTemplatePlugin;


text:
package org.neovera.jdiablo.internal;

import org.neovera.jdiablo.ExecutionState;
import org.neovera.jdiablo.annotation.SkipEnvironment;
import org.neovera.jdiablo.environment.Help;

@SkipEnvironment({Help.class})
public class LevelTwoBLaunchable extends LevelOneLaunchable {

    public ExecutionState mainEntryPoint() {
        return ExecutionState.SUCCESS;
    }

}

redpajama_set_name: RedPajamaGithub


text:
class Admin::UsersController < ApplicationController

  before_filter :authenticate_is_admin
  before_filter :authenticate_not_self_and_admin, :only => :destroy
  layout 'admin'

  def show
  end

  def index
    @users = User.order('created_at')
  end

  def edit
    @user = User.find(params[:id])
  end

  def update
    @user = User.find(params[:id])
    @user.name = params[:user][:name]
    @user.description = params[:user][:description]
    @user.is_admin = params[:user][:is_admin]
    success = @user.save
    if success && params[:user][:password] != '' && params[:user][:password_confirmation] != ''
        if params[:user][:password] == params[:user][:password_confirmation]
            @user.change_password2 params[:user][:password], params[:user][:password_confirmation]
        else
            @user.errors.add('Password', "confirmation doesn't match")
            success = false
        end
    end
    if success
        redirect_to admin_users_path, :notice => 'User was successfully updated.'
    else
        render :action => "edit"
    end
  end

  def new
    @user = User.new
  end

  def create
    @user = User.new(params[:user])

    if @user.save
      redirect_to admin_users_path, :notice => 'User was successfully created.'
    else
      render :action => "new"
    end
  end

  def destroy
    @user = User.find(params[:id])

    if @user.destroy
      redirect_to admin_users_path, :notice => 'User was successfully removed.'
    else
      redirect_to admin_users_path, :notice => 'User was NOT successfully removed.'
    end
  end

  private
  def authenticate_not_self_and_admin
    if params[:id] && params[:id] == current_user.id && current_user.is_amdin
        redirect_to admin_users_path, :notice => "You can't delete youself while Admin"
    end
  end
end


text:
<?php
// Start a session feed
session_start();
if (!isset($_SESSION["userId"]))
	{
	header("Location: index.php");
	die();
	}

// Set Database Connection
include 'dbconnector.php';

$ViewerID = $_SESSION["userId"];

$CheckIfAdminQuery = "SELECT `userteam`,`usergame` FROM `hvzuserstate` WHERE `userid`=$ViewerID";
$ViewerTeam = mysqli_fetch_array(mysqli_query($DBCon, $CheckIfAdminQuery))[0];
$ViewerGame = mysqli_fetch_array(mysqli_query($DBCon, $CheckIfAdminQuery))[1];

if ($ViewerTeam != 1 && $ViewerTeam != 4 && $ViewerTeam != -2)
	{
	header("Location: playerstats.php");
	die();
	}

// If we are not in a game, we can't access this.
if ($ViewerGame == 0)
	{
	header("Location: joingame.php");
	die();
	}
?>
<!DOCTYPE html>

		<title>Keene State: Humans VS Zombies</title>
		<link rel="shortcut icon" type="image/x-icon" href="Images/favicon.ico">
		<link href="CSS/general.css" rel="Stylesheet" type="text/css">
		<link href="CSS/admin.css" rel="Stylesheet" type="text/css">

	<?php
	// TopBar + Log Out
	include 'pagetopper.php';

	echo "
";
		echo "
";
		// Get all of the game's story entries:
		$GetGameStory = "SELECT `storyid`,`storytitle`,`storydescription`,`storystate`,`storylock` FROM `hvzbackground` WHERE `storygame` = $UserGame";
		$StoryResults = mysqli_query($DBCon, $GetGameStory);
		while($StoryRow = mysqli_fetch_array($StoryResults))
			{
			echo "<form class=\"StoryListItem\" action=\"storychanges.php\" name=\"storychangeform\" method=\"post\">";
			switch ($StoryRow[3])
				{
				// Revealed to All.
				case 0:
				echo "
All
";
				break;
				// Revealed to Zombies Only.
				case 1:
				echo "
Zombies
";
				break;
				// Revealed to Survivors Only.
				case 2:
				echo "
Survivors
";
				break;
				// Hidden, Unlocks to All
				case 3:
				echo "
Hidden - All
";
				break;
				// Hidden, Unlocks to Zombies
				case 4:
				echo "
Hidden - Zombies
";
				break;
				// Hidden, Unlocks to Survivors
				case 5:
				echo "
Hidden - Survivors
";
				break;
				// Currently hidden from everyone, only opened by Admin
				case 6:
				echo "
Unused
";
				break;
				}
			echo "
" . $StoryRow[1] . "
";
			echo "<button type=\"button\" class=\"GetStoryBtn\" onmousedown=\"GetStory(this.form)\">Edit</button>";
			echo "<input type=\"submit\" id=\"Delete\" name=\"Delete\" value=\"Delete\" class=\"DeleteStoryBtn\">";
			echo "<input type=\"hidden\" id=\"StoryID\" name=\"StoryID\" value=\"" . $StoryRow[0] . "\">";
			echo "<input type=\"hidden\" id=\"StoryTitle\" name=\"StoryTitle\" value=\"" . $StoryRow[1] . "\">";
			echo "<input type=\"hidden\" id=\"StoryDesc\" name=\"StoryDesc\" value=\"" . $StoryRow[2] . "\">";
			echo "<input type=\"hidden\" id=\"StoryState\" name=\"StoryState\" value=\"" . $StoryRow[3] . "\">";
			echo "<input type=\"hidden\" id=\"StoryDesc\" name=\"StoryAccess\" value=\"" . $StoryRow[4] . "\">";
			echo "</form>";
			}
		echo "
";
		echo "<form action=\"storychanges.php\" name=\"storychangeform\" method=\"post\">";
		echo "<input type=\"text\" id=\"StoryNameText\" name=\"StoryNameText\" class=\"StoryNameText\" value=\"\" placeholder=\"Story Title\" maxlength=\"35\" autocomplete=\"off\">";
		echo "<textarea id=\"StoryDescText\" name=\"StoryDescText\" class=\"StoryDescText\" rows=\"5\" autocomplete=\"off\" placeholder=\"Story Text\"></textarea>";
		echo "<select id=\"StoryStateSelect\" class=\"StoryStateSelect\" name=\"StoryStateSelect\">";
			echo "<option value=\"0\">Revealed to All</option>";
			echo "<option value=\"1\">Revealed to Zombies</option>";
			echo "<option value=\"2\">Revealed to Survivors</option>";
			echo "<option value=\"3\">Hidden (For All)</option>";
			echo "<option value=\"4\">Hidden (For Zombies)</option>";
			echo "<option value=\"5\">Hidden (For Survivors)</option>";
			echo "<option value=\"6\">Unused</option>";
		echo "</select>";
		echo "
AAAAAAAA
";
		echo "<input type=\"submit\" id=\"SaveStoryBtn\" name=\"SaveStoryBtn\" value=\"Save Story\" class=\"SaveStoryBtn\">";
		echo "<input type=\"submit\" id=\"NewStoryBtn\" name=\"NewStoryBtn\" value=\"New Story\" class=\"NewStoryBtn\">";
		echo "<input type=\"hidden\" id=\"GivenStoryID\" name=\"GivenStoryID\" value=\"\">";
		echo "<input type=\"hidden\" id=\"GivenStoryAccess\" name=\"GivenStoryAccess\" value=\"\">";
		echo "<input type=\"hidden\" id=\"GameNum\" name=\"GameNum\" value=\"" . $UserGame . "\">";
		echo "</form>";
	echo "
";
	echo "
";
	echo "
Non-Player Tags:
";
	$GetNPCTags = "SELECT `tagcode`,`faketagused` FROM `hvztagnums` WHERE `userId` = 0 AND `gameId` = $UserGame";
	$NPCTags = mysqli_query($DBCon, $GetNPCTags);
		echo "
";
		while($NPCRow = mysqli_fetch_array($NPCTags))
			{
			if ($NPCRow[1] == 1)
				{
				echo "<form action=\"storychanges.php\" name=\"NPCTag\" class=\"NPCTagUsed\" method=\"post\">";
				echo "<input type=\"checkbox\" class=\"UsedBox\" checked onclick=\"SetPassUsed(this.form);\">";
				}
			else
				{
				echo "<form action=\"storychanges.php\" name=\"NPCTag\" class=\"NPCTag\" method=\"post\">";
				echo "<input type=\"checkbox\" class=\"UsedBox\" onclick=\"SetPassUsed(this.form);\">";
				}
			echo "
" . $NPCRow[0] . "
";
			echo "<input type=\"hidden\" id=\"TAG\" name=\"TAG\" value=\"" . $NPCRow[0] . "\">";
			echo "<input type=\"submit\" id=\"DelNPCBtn\" name=\"DelNPCBtn\" value=\"Delete\" class=\"DelNPCBtn\">";
			echo "</form>";
			}
		echo "
";
		echo "<form action=\"storychanges.php\" name=\"NPCTag\" method=\"post\">";
		echo "<input type=\"hidden\" id=\"GameNum\" name=\"GameNum\" value=\"" . $UserGame . "\">";
		echo "<form action=\"storychanges.php\" name=\"StoryNPCGen\" method=\"post\">";
		echo "<input type=\"submit\" id=\"NewNPCBtn\" name=\"NewNPCBtn\" value=\"New NPT\" class=\"NewNPCBtn\">";
		echo "</form>";
	echo "
";
	?>


text:
<?php

namespace Zephir\Passes;

use Zephir\StatementsBlock;

/**
 * MutateGathererPass.
 *
 * Counts variables mutated inside a specific statement block
 * Non-mutated variables can be promoted to use an inline cache
 */
class MutateGathererPass
{
    protected $variables = [];

    protected $mutations = [];

    /**
     * Do the compilation pass.
     *
     * @param StatementsBlock $block
     */
    public function pass(StatementsBlock $block)
    {
        $this->passStatementBlock($block->getStatements());
    }

    public function declareVariables(array $statement)
    {
        foreach ($statement['variables'] as $variable) {
            if (!isset($this->variables[$variable['variable']])) {
                $this->variables[$variable['variable']] = true;
            }
        }
    }

    /**
     * Increase the number of mutations a variable has inside a statement block.
     *
     * @param string $variable
     *
     * @return MutateGathererPass
     */
    public function increaseMutations($variable)
    {
        if (isset($this->mutations[$variable])) {
            ++$this->mutations[$variable];
        } else {
            $this->mutations[$variable] = 1;
        }

        return $this;
    }

    /**
     * Returns the number of assignment instructions that mutated a variable.
     *
     * @param string $variable
     *
     * @return int
     */
    public function getNumberOfMutations($variable)
    {
        if (isset($this->mutations[$variable])) {
            return $this->mutations[$variable];
        }

        return 0;
    }

    /**
     * Pass let statements.
     *
     * @param array $statement
     */
    public function passLetStatement(array $statement)
    {
        foreach ($statement['assignments'] as $assignment) {
            if (isset($assignment['expr'])) {
                $this->passExpression($assignment['expr']);
            }
            $this->increaseMutations($assignment['variable']);
        }
    }

    /**
     * Pass call expressions.
     *
     * @param array $expression
     */
    public function passCall(array $expression)
    {
        if (isset($expression['parameters'])) {
            foreach ($expression['parameters'] as $parameter) {
                if ('variable' == $parameter['parameter']['type']) {
                    $this->increaseMutations($parameter['parameter']['value']);
                } else {
                    $this->passExpression($parameter['parameter']);
                }
            }
        }
    }

    /**
     * Pass array expressions.
     *
     * @param array $expression
     */
    public function passArray(array $expression)
    {
        foreach ($expression['left'] as $item) {
            if ('variable' != $item['value']['type']) {
                $this->passExpression($item['value']);
            }
        }
    }

    /**
     * Pass "new" expressions.
     *
     * @param array $expression
     */
    public function passNew(array $expression)
    {
        if (isset($expression['parameters'])) {
            foreach ($expression['parameters'] as $parameter) {
                if ('variable' != $parameter['parameter']['type']) {
                    $this->passExpression($parameter['parameter']);
                }
            }
        }
    }

    /**
     * Pass expressions.
     *
     * @param array $expression
     */
    public function passExpression(array $expression)
    {
        switch ($expression['type']) {
            case 'bool':
            case 'double':
            case 'int':
            case 'uint':
            case 'long':
            case 'ulong':
            case 'string':
            case 'istring':
            case 'null':
            case 'char':
            case 'uchar':
            case 'empty-array':
            case 'variable':
            case 'constant':
            case 'static-constant-access':
            case 'closure':
            case 'closure-arrow':
            case 'reference':
                break;

            case 'sub':
            case 'add':
            case 'div':
            case 'mul':
            case 'mod':
            case 'and':
            case 'or':
            case 'concat':
            case 'equals':
            case 'identical':
            case 'not-identical':
            case 'not-equals':
            case 'less':
            case 'greater':
            case 'greater-equal':
            case 'less-equal':
            case 'bitwise_and':
            case 'bitwise_or':
            case 'bitwise_xor':
            case 'bitwise_shiftleft':
            case 'bitwise_shiftright':
            case 'irange':
            case 'erange':
                $this->passExpression($expression['left']);
                $this->passExpression($expression['right']);
                break;

            case 'typeof':
            case 'not':
                $this->passExpression($expression['left']);
                break;

            case 'mcall':
            case 'fcall':
            case 'scall':
                $this->passCall($expression);
                break;

            case 'array':
                $this->passArray($expression);
                break;

            case 'new':
                $this->passNew($expression);
                break;

            case 'property-access':
            case 'property-dynamic-access':
            case 'property-string-access':
            case 'static-property-access':
            case 'array-access':
                $this->passExpression($expression['left']);
                break;

            case 'isset':
            case 'empty':
            case 'instanceof':
            case 'require':
            case 'clone':
            case 'likely':
            case 'unlikely':
            case 'ternary':
                /* do special pass later */
                $this->passExpression($expression['left']);
                break;

            case 'fetch':
                $this->increaseMutations($expression['left']['value']);
                $this->passExpression($expression['right']);
                break;

            case 'minus':
                $this->passExpression($expression['left']);
                break;

            case 'list':
                $this->passExpression($expression['left']);
                break;

            case 'cast':
            case 'type-hint':
                $this->passExpression($expression['right']);
                break;

            default:
                echo 'MutateGathererPassType=', $expression['type'], PHP_EOL;
                break;
        }
    }

    /**
     * Pass statement block.
     *
     * @param array $statements
     */
    public function passStatementBlock(array $statements)
    {
        foreach ($statements as $statement) {
            switch ($statement['type']) {
                case 'let':
                    $this->passLetStatement($statement);
                    break;

                case 'echo':
                    if (isset($statement['expressions'])) {
                        foreach ($statement['expressions'] as $expr) {
                            $this->passExpression($expr);
                        }
                    }
                    break;

                case 'declare':
                    $this->declareVariables($statement);
                    break;

                case 'if':
                    if (isset($statement['expr'])) {
                        $this->passExpression($statement['expr']);
                    }
                    if (isset($statement['statements'])) {
                        $this->passStatementBlock($statement['statements']);
                    }
                    if (isset($statement['else_statements'])) {
                        $this->passStatementBlock($statement['else_statements']);
                    }
                    if (isset($statement['elseif_statements'])) {
                        $this->passStatementBlock($statement['elseif_statements']);
                    }
                    break;

                case 'switch':
                    if (isset($statement['expr'])) {
                        $this->passExpression($statement['expr']);
                    }
                    if (isset($statement['clauses'])) {
                        foreach ($statement['clauses'] as $clause) {
                            if (isset($clause['expr'])) {
                                $this->passExpression($clause['expr']);
                            }
                            if (isset($clause['statements'])) {
                                $this->passStatementBlock($clause['statements']);
                            }
                        }
                    }
                    break;

                case 'while':
                case 'do-while':
                    if (isset($statement['expr'])) {
                        $this->passExpression($statement['expr']);
                    }
                    if (isset($statement['statements'])) {
                        $this->passStatementBlock($statement['statements']);
                    }
                    break;

                case 'for':
                    if (isset($statement['expr'])) {
                        $this->passExpression($statement['expr']);
                    }
                    if (isset($statement['value'])) {
                        $this->increaseMutations($statement['value']);
                    }
                    if (isset($statement['key'])) {
                        $this->increaseMutations($statement['key']);
                    }
                    if (isset($statement['statements'])) {
                        $this->passStatementBlock($statement['statements']);
                    }
                    break;

                case 'return':
                    if (isset($statement['expr'])) {
                        $this->passExpression($statement['expr']);
                    }
                    break;

                case 'loop':
                    if (isset($statement['statements'])) {
                        $this->passStatementBlock($statement['statements']);
                    }
                    break;

                case 'try-catch':
                    if (isset($statement['statements'])) {
                        $this->passStatementBlock($statement['statements']);
                    }
                    if (isset($statement['catches'])) {
                        foreach ($statement['catches'] as $catch) {
                            if (isset($catch['variable'])) {
                                $this->increaseMutations($catch['variable']['value']);
                            }
                            if (isset($catch['statements'])) {
                                $this->passStatementBlock($catch['statements']);
                            }
                        }
                    }
                    break;

                case 'throw':
                    if (isset($statement['expr'])) {
                        $this->passExpression($statement['expr']);
                    }
                    break;

                case 'fetch':
                    $this->passExpression($statement['expr']);
                    break;

                case 'mcall':
                case 'scall':
                case 'fcall':
                case 'require':
                    $this->passCall($statement['expr']);
                    break;

                case 'unset':
                    if ('array-access' == $statement['expr']['type']) {
                        if ('variable' == $statement['expr']['left']['type']) {
                            $this->increaseMutations($statement['expr']['left']['value']);
                        }
                    } else {
                        if ('list' == $statement['expr']['type']) {
                            if ('array-access' == $statement['expr']['left']['type']) {
                                if ('variable' == $statement['expr']['left']['left']['type']) {
                                    $this->increaseMutations($statement['expr']['left']['left']['value']);
                                }
                            }
                        }
                    }
                    break;

                case 'break':
                case 'continue':
                case 'empty':
                case 'cblock':
                case 'comment':
                    break;

                default:
                    echo 'MutateGathererPassStatement=', $statement['type'], PHP_EOL;
            }
        }
    }
}


text:
package org.pathwayeditor.notations.sbgnpd.ndom;

public class PhysicalEntityType {

}


text:
<TITLE>Review for Godfather, The (1972)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Godfather, The (1972)

reviewed by
Brian Koller

The Godfather (1972)

Grade: 95

By the time it finished its run, "The Godfather" had
the biggest box office gross of all time.  It would remain
the highest-grossing film until "Jaws" three years later.
Of all the films that have held that title, "The Godfather"
may be the best.  Unlike later title-holders like "Star Wars",
"E.T." or "Titanic" that relied at least partly upon
special effects, the success of "The Godfather" came
from its script, story, and characters.  Perhaps better than
any other film, "The Godfather" combines outstanding production,
conventional storytelling, and commercial success.

The film was based on the best-selling novel by Mario Puzo,
who also co-wrote the screenplay with the director,
Francis Ford Coppola.  Vito Corleone (Marlon Brando) is
The Godfather, the Don (head) of a successful, tightly-knit
family whose business is organized crime.  Heir apparent
is impulsive, hot-tempered Sonny (James Caan), whose brothers
are brooding Michael (Al Pacino), who tries to seperate himself
from his criminal family, and Fredo (John Cazale), who can't
seem to do anything right.  Vito has also adopted level-headed
Tom Hagan (Robert Duvall), now the family lawyer.  Michael's
second wife is Kay (Diane Keaton).

The film is set in the 1950s.  Vito's refusal to enter the
lucrative drug rackets puts him at odds with other Mafia families.
A war between the families follows.  Events place Michael
as the Don, who plots vengeance against those who opposed or
betrayed the Corleone family.  Along the way, Michael changes
from an idealistic and independent young man to a calculating,
ruthless Mafia Don.

"The Godfather" has little comic relief, but the film is rich
with ironies.  'Family' is considered to be very important by
the Mafia leaders, and yet their very actions lead to the
destruction of their own family.  'Loyalty' to the family is
also vital, enforced by 'hits' that punish betrayal, and yet
family members regularly betray one another.  While Vito's word
is his bond, the same doesn't apply to his son Michael, a
smooth operator for whom words are merely another tool for
information or influence.  Non-Sicilians are outsiders, kept
from knowledge of the 'family business', and even adopted son
Hagan is sometimes excluded.  Women are relegated to being
household servants and child raisers, although this role gives
them a longer lifespan than their vendetta-targeted husbands.

"The Godfather" won only three Academy Awards.  But they were
important ones: Best Picture, Best Actor (Brando) and Best
Screenplay.  There were also nominations for Best Director
(Coppola), Best Supporting Actor (Pacino, Caan, Duvall),
Best Editing and Best Sound.  Oddly, Nino Rota wasn't nominated
for the compelling, mournful score, although he did win the
British Academy Award for Original Film Music.

Pacino must have been surprised to have been nominated as a
supporting actor, since he saw more screen time than Brando.
But the Academy probably did not want to split the votes between
Brando and Pacino.  "The Godfather" recovered the languishing
career of Brando, who did not attend the Academy Awards ceremony.
He instead sent a minor actress who posed as an Indian named
Sacheen Littlefeather, who refused the Oscar on the grounds that
Hollywood discriminated against Indians.  Brando was nominated
for Best Actor the next year for "Last Tango in Paris",
demonstrating that the Academy didn't hold a grudge.

kollers@mpsi.net
http://members.tripod.com/~Brian_Koller/movies.html

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
// ************************************************************************************************
// The MIT License (MIT)
//
// Copyright (c) 2015 Marek Kawa (masterkawaster)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// ************************************************************************************************
using System;

namespace CSharpAdvanced.IComparableTest
{
    public class Animal : IComparable, IComparable<Animal>
    {
        private string _animalName;
        private int _animalWeight;

        public Animal(string animalName, int animalWeight)
        {
            this._animalName = animalName;
            this._animalWeight = animalWeight;
        }

        public int CompareTo(Animal other)
        {
            return this._animalWeight.CompareTo(other._animalWeight);
        }

        public int CompareTo(object obj)
        {
            return CompareTo(obj as Animal);
        }
    }
}


text:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function template equal</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost Algorithm Library">
<link rel="up" href="../../header/boost/algorithm/cxx14/equal_hpp.html" title="Header <boost/algorithm/cxx14/equal.hpp>">
<link rel="prev" href="../../header/boost/algorithm/cxx14/equal_hpp.html" title="Header <boost/algorithm/cxx14/equal.hpp>">
<link rel="next" href="equal_idm45753621179920.html" title="Function template equal">

Home
Libraries
People
FAQ
More

Function template equal

boost::algorithm::equal

Synopsis

// In header: <boost/algorithm/cxx14/equal.hpp>

template<typename InputIterator1, typename InputIterator2,
         typename BinaryPredicate>
  BOOST_CXX14_CONSTEXPR bool
  equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2,
        InputIterator2 last2, BinaryPredicate pred);

Description

<colgroup>
<col align="left" valign="top">
<col>
</colgroup>

Parameters:

<colgroup>
<col align="left" valign="top">
<col>
</colgroup>

first1

The start of the first range.

first2

The start of the second range.

last1

One past the end of the first range.

last2

One past the end of the second range.

pred

A predicate for comparing the elements of the ranges

Returns:

true if all elements in the two ranges are equal

Copyright © 2010-2012 Marshall Clow

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
<?php
namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use DateTime;

/**
 * @ORM\Entity(repositoryClass="AppBundle\Entity\PrivateMessageRepository")
 * @ORM\Table(name="private_message")
 */
class PrivateMessage
{
  /**
   * @var int
   * @ORM\Id
   * @ORM\Column(type="integer")
   * @ORM\GeneratedValue(strategy="AUTO")
   */
    protected $id;

  /**
   * @var string
   * @ORM\Column(name="message", type="string", length=1000, nullable=false)
   */
    protected $message = "";

  /**
   * @var \AppBundle\Entity\User
   *
   * @ORM\ManyToOne(targetEntity="AppBundle\Entity\User", fetch="EAGER")
   * @ORM\JoinColumns({
   *   @ORM\JoinColumn(name="from_user_id", referencedColumnName="id")
   * })
   */
    protected $fromUser;

  /**
   * @var \AppBundle\Entity\User
   *
   * @ORM\ManyToOne(targetEntity="AppBundle\Entity\User", fetch="EAGER")
   * @ORM\JoinColumns({
   *   @ORM\JoinColumn(name="to_user_id", referencedColumnName="id")
   * })
   */
    protected $toUser;

  /**
   * @var DateTime
   * @ORM\Column(name="date_created", type="datetime", nullable=false)
   */
    protected $dateCreated;

  /**
   * Constructor
   */
    public function __construct()
    {
        $this->dateCreated = new DateTime();
    }

  /**
   * @return int
   */
    public function getId()
    {
        return $this->id;
    }

  /**
   * @return mixed
   */
    public function getMessage()
    {
        return $this->message;
    }

  /**
   * @param mixed $message
   * @return $this
   */
    public function setMessage($message)
    {
        $this->message = $message;
        return $this;
    }

  /**
   * @return User
   */
    public function getFromUser()
    {
        return $this->fromUser;
    }

  /**
   * @param User $fromUser
   * @return $this
   */
    public function setFromUser($fromUser)
    {
        $this->fromUser = $fromUser;
        return $this;
    }

  /**
   * @return User
   */
    public function getToUser()
    {
        return $this->toUser;
    }

  /**
   * @param User $toUser
   * @return $this
   */
    public function setToUser($toUser)
    {
        $this->toUser = $toUser;
        return $this;
    }

  /**
   * @return DateTime
   */
    public function getDateCreated()
    {
        return $this->dateCreated;
    }

  /**
   * @param DateTime $dateCreated
   * @return $this
   */
    public function setDateCreated($dateCreated)
    {
        $this->dateCreated = $dateCreated;
        return $this;
    }
}


text:
package org.springside.examples.bootapi.service.exception;

public class ServiceException extends RuntimeException {

	private static final long serialVersionUID = -8634700792767837033L;

	public ErrorCode code;

	public ServiceException(String message, ErrorCode code) {
		super(message);
		this.code = code;
	}
}


text:
#ifndef INVERTERMEDIATOR_H
#define INVERTERMEDIATOR_H

#include <QObject>
#include "defines.h"

class GatewayInterface;
class Inverter;
class InverterSettings;
class Settings;

/*!
 * Represents a PV inverter, and manages data retrieval and D-Bus publishing.
 */
class InverterMediator : public QObject
{
	Q_OBJECT
public:
	explicit InverterMediator(const DeviceInfo &device, GatewayInterface *gateway,
							  Settings *settings, QObject *parent = 0);

	/*!
	 * Checks if the given device is represented by this class.
	 * If so, it will make the necessary adjustments to the data retrieval (like changing
	 * the IP address or the retrieval mode).
	 * @param deviceInfo Describes a newly found PV inverter
	 * @return true is this class represent the given device info. False otherwise.
	 */
	bool processNewInverter(const DeviceInfo &deviceInfo);

private slots:
	void onSettingsInitialized();

	void onIsActivatedChanged();

	void onConnectionLost();

	void onInverterModelChanged();

	void onPositionChanged();

	void onSettingsCustomNameChanged();

	void onInverterCustomNameChanged();

private:
	void startAcquisition();

	Inverter *createInverter();

	DeviceInfo mDeviceInfo;
	Inverter *mInverter;
	InverterSettings *mInverterSettings;
	GatewayInterface *mGateway;
	Settings *mSettings;
};

#endif // INVERTERMEDIATOR_H


text:
<?php

declare(strict_types=1);

namespace spec\Sylius\Component\Order\Model;

use Doctrine\Common\Collections\Collection;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Sylius\Component\Order\Model\AdjustableInterface;
use Sylius\Component\Order\Model\AdjustmentInterface;
use Sylius\Component\Order\Model\Order;
use Sylius\Component\Order\Model\OrderInterface;
use Sylius\Component\Order\Model\OrderItemInterface;
use Sylius\Component\Resource\Model\TimestampableInterface;

/**
 * @author Paweł Jędrzejewski <pawel@sylius.org>
 */
final class OrderSpec extends ObjectBehavior
{
    function it_is_initializable()
    {
        $this->shouldHaveType(Order::class);
    }

    function it_implements_an_order_interface()
    {
        $this->shouldImplement(OrderInterface::class);
    }

    function it_implements_an_adjustable_interface()
    {
        $this->shouldImplement(AdjustableInterface::class);
    }

    function it_implements_a_timestampable_interface()
    {
        $this->shouldImplement(TimestampableInterface::class);
    }

    function it_has_no_id_by_default()
    {
        $this->getId()->shouldReturn(null);
    }

    function it_does_not_have_completed_checkout_by_default()
    {
        $this->shouldNotBeCheckoutCompleted();
    }

    function its_checkout_can_be_completed()
    {
        $this->completeCheckout();
        $this->shouldBeCheckoutCompleted();
    }

    function it_has_checkout_completed_when_completion_date_is_set()
    {
        $this->shouldNotBeCheckoutCompleted();
        $this->setCheckoutCompletedAt(new \DateTime('2 days ago'));
        $this->shouldBeCheckoutCompleted();
    }

    function it_has_no_checkout_completion_date_by_default()
    {
        $this->getCheckoutCompletedAt()->shouldReturn(null);
    }

    function its_checkout_completion_date_is_mutable()
    {
        $date = new \DateTime('1 hour ago');

        $this->setCheckoutCompletedAt($date);
        $this->getCheckoutCompletedAt()->shouldReturn($date);
    }

    function it_has_no_number_by_default()
    {
        $this->getNumber()->shouldReturn(null);
    }

    function its_number_is_mutable()
    {
        $this->setNumber('001351');
        $this->getNumber()->shouldReturn('001351');
    }

    function it_creates_items_collection_by_default()
    {
        $this->getItems()->shouldHaveType(Collection::class);
    }

    function it_adds_items_properly(OrderItemInterface $item)
    {
        $this->hasItem($item)->shouldReturn(false);

        $this->addItem($item);
        $this->hasItem($item)->shouldReturn(true);
    }

    function it_removes_items_properly(OrderItemInterface $item)
    {
        $this->hasItem($item)->shouldReturn(false);

        $this->addItem($item);
        $this->hasItem($item)->shouldReturn(true);

        $this->removeItem($item);
        $this->hasItem($item)->shouldReturn(false);
    }

    function it_has_items_total_equal_to_0_by_default()
    {
        $this->getItemsTotal()->shouldReturn(0);
    }

    function it_calculates_correct_items_total(
        OrderItemInterface $item1,
        OrderItemInterface $item2,
        OrderItemInterface $item3
    ) {
        $item1->getTotal()->willReturn(29999);
        $item2->getTotal()->willReturn(45000);
        $item3->getTotal()->willReturn(250);

        $item1->setOrder($this)->shouldBeCalled();
        $item2->setOrder($this)->shouldBeCalled();
        $item3->setOrder($this)->shouldBeCalled();

        $item1->equals(Argument::any())->willReturn(false);
        $item2->equals(Argument::any())->willReturn(false);
        $item3->equals(Argument::any())->willReturn(false);

        $this->addItem($item1);
        $this->addItem($item2);
        $this->addItem($item3);

        $this->getItemsTotal()->shouldReturn(75249);
    }

    function it_creates_adjustments_collection_by_default()
    {
        $this->getAdjustments()->shouldHaveType(Collection::class);
    }

    function it_adds_adjustments_properly(AdjustmentInterface $adjustment)
    {
        $adjustment->setAdjustable($this)->shouldBeCalled();
        $adjustment->isNeutral()->willReturn(true);

        $this->hasAdjustment($adjustment)->shouldReturn(false);
        $this->addAdjustment($adjustment);
        $this->hasAdjustment($adjustment)->shouldReturn(true);
    }

    function it_removes_adjustments_properly(AdjustmentInterface $adjustment)
    {
        $this->hasAdjustment($adjustment)->shouldReturn(false);

        $adjustment->setAdjustable($this)->shouldBeCalled();
        $adjustment->isNeutral()->willReturn(true);

        $this->addAdjustment($adjustment);
        $this->hasAdjustment($adjustment)->shouldReturn(true);

        $adjustment->isLocked()->willReturn(false);
        $adjustment->setAdjustable(null)->shouldBeCalled();
        $this->removeAdjustment($adjustment);

        $this->hasAdjustment($adjustment)->shouldReturn(false);
    }

    function it_removes_adjustments_recursively_properly(
        AdjustmentInterface $orderAdjustment,
        OrderItemInterface $item
    ) {
        $this->addAdjustment($orderAdjustment);
        $this->addItem($item);

        $item->removeAdjustmentsRecursively(null)->shouldBeCalled();

        $this->removeAdjustmentsRecursively();

        $this->hasAdjustment($orderAdjustment)->shouldReturn(false);
    }

    function it_removes_adjustments_recursively_by_type_properly(
        AdjustmentInterface $orderPromotionAdjustment,
        AdjustmentInterface $orderTaxAdjustment,
        OrderItemInterface $item
    ) {
        $orderPromotionAdjustment->getType()->willReturn('promotion');
        $orderPromotionAdjustment->isNeutral()->willReturn(true);
        $orderPromotionAdjustment->setAdjustable($this)->shouldBeCalled();
        $orderPromotionAdjustment->isLocked()->willReturn(false);

        $orderTaxAdjustment->getType()->willReturn('tax');
        $orderTaxAdjustment->isNeutral()->willReturn(true);
        $orderTaxAdjustment->setAdjustable($this)->shouldBeCalled();
        $orderTaxAdjustment->isLocked()->willReturn(false);

        $this->addAdjustment($orderPromotionAdjustment);
        $this->addAdjustment($orderTaxAdjustment);
        $this->addItem($item);

        $item->removeAdjustmentsRecursively('tax')->shouldBeCalled();
        $orderTaxAdjustment->setAdjustable(null)->shouldBeCalled();

        $this->removeAdjustmentsRecursively('tax');

        $this->hasAdjustment($orderPromotionAdjustment)->shouldReturn(true);
        $this->hasAdjustment($orderTaxAdjustment)->shouldReturn(false);
    }

    function it_returns_adjustments_recursively(
        AdjustmentInterface $orderAdjustment,
        AdjustmentInterface $itemAdjustment1,
        AdjustmentInterface $itemAdjustment2,
        OrderItemInterface $item1,
        OrderItemInterface $item2
    ) {
        $item1->setOrder($this)->shouldBeCalled();
        $item1->getTotal()->willReturn(100);
        $item1->getAdjustmentsRecursively(null)->willReturn([$itemAdjustment1]);

        $item2->setOrder($this)->shouldBeCalled();
        $item2->getTotal()->willReturn(100);
        $item2->getAdjustmentsRecursively(null)->willReturn([$itemAdjustment2]);

        $this->addItem($item1);
        $this->addItem($item2);

        $orderAdjustment->setAdjustable($this)->shouldBeCalled();
        $orderAdjustment->isNeutral()->willReturn(true);

        $this->addAdjustment($orderAdjustment);

        $this->getAdjustmentsRecursively()->shouldReturn([$orderAdjustment, $itemAdjustment1, $itemAdjustment2]);
    }

    function it_has_adjustments_total_equal_to_0_by_default()
    {
        $this->getAdjustmentsTotal()->shouldReturn(0);
    }

    function it_calculates_correct_adjustments_total(
        AdjustmentInterface $adjustment1,
        AdjustmentInterface $adjustment2,
        AdjustmentInterface $adjustment3
    ) {
        $adjustment1->getAmount()->willReturn(10000);
        $adjustment2->getAmount()->willReturn(-4999);
        $adjustment3->getAmount()->willReturn(1929);

        $adjustment1->isNeutral()->willReturn(false);
        $adjustment2->isNeutral()->willReturn(false);
        $adjustment3->isNeutral()->willReturn(false);

        $adjustment1->setAdjustable($this)->shouldBeCalled();
        $adjustment2->setAdjustable($this)->shouldBeCalled();
        $adjustment3->setAdjustable($this)->shouldBeCalled();

        $this->addAdjustment($adjustment1);
        $this->addAdjustment($adjustment2);
        $this->addAdjustment($adjustment3);

        $this->getAdjustmentsTotal()->shouldReturn(6930);
    }

    function it_returns_adjustments_total_recursively(
        AdjustmentInterface $itemAdjustment,
        AdjustmentInterface $orderAdjustment,
        OrderItemInterface $orderItem
    ) {
        $itemAdjustment->getAmount()->willReturn(10000);
        $orderAdjustment->getAmount()->willReturn(5000);

        $itemAdjustment->isNeutral()->willReturn(false);
        $orderAdjustment->isNeutral()->willReturn(false);

        $orderAdjustment->setAdjustable($this)->shouldBeCalled();

        $orderItem->getAdjustmentsRecursively(null)->willReturn([$itemAdjustment]);
        $orderItem->setOrder($this)->shouldBeCalled();
        $orderItem->getTotal()->willReturn(15000);

        $this->addItem($orderItem);
        $this->addAdjustment($orderAdjustment);

        $this->getAdjustmentsTotalRecursively()->shouldReturn(15000);
    }

    function it_has_total_equal_to_0_by_default()
    {
        $this->getTotal()->shouldReturn(0);
    }

    function it_has_total_quantity(OrderItemInterface $orderItem1, OrderItemInterface $orderItem2)
    {
        $orderItem1->getQuantity()->willReturn(10);
        $orderItem1->setOrder($this)->shouldBeCalled();
        $orderItem1->getTotal()->willReturn(500);

        $orderItem2->getQuantity()->willReturn(30);
        $orderItem2->setOrder($this)->shouldBeCalled();
        $orderItem2->equals($orderItem1)->willReturn(false);
        $orderItem2->getTotal()->willReturn(1000);

        $this->addItem($orderItem1);
        $this->addItem($orderItem2);

        $this->getTotalQuantity()->shouldReturn(40);
    }

    function it_calculates_correct_total(
        OrderItemInterface $item1,
        OrderItemInterface $item2,
        AdjustmentInterface $adjustment1,
        AdjustmentInterface $adjustment2
    ) {
        $item1->getTotal()->willReturn(29999);
        $item2->getTotal()->willReturn(45000);

        $item1->equals(Argument::any())->willReturn(false);
        $item2->equals(Argument::any())->willReturn(false);

        $item1->setOrder($this)->shouldBeCalled();
        $item2->setOrder($this)->shouldBeCalled();

        $adjustment1->isNeutral()->willReturn(false);
        $adjustment1->getAmount()->willReturn(10000);
        $adjustment2->isNeutral()->willReturn(false);
        $adjustment2->getAmount()->willReturn(-4999);

        $adjustment1->setAdjustable($this)->shouldBeCalled();
        $adjustment2->setAdjustable($this)->shouldBeCalled();

        $this->addItem($item1);
        $this->addItem($item2);
        $this->addAdjustment($adjustment1);
        $this->addAdjustment($adjustment2);

        $this->getTotal()->shouldReturn(80000);
    }

    function it_calculates_correct_total_after_items_and_adjustments_changes(
        AdjustmentInterface $adjustment1,
        AdjustmentInterface $adjustment2,
        OrderItemInterface $item1,
        OrderItemInterface $item2,
        OrderItemInterface $item3
    ) {
        $item1->getTotal()->willReturn(29999);
        $item2->getTotal()->willReturn(45000);

        $item1->equals(Argument::any())->willReturn(false);
        $item2->equals(Argument::any())->willReturn(false);

        $item1->setOrder($this)->shouldBeCalled();
        $item2->setOrder($this)->shouldBeCalled();

        $adjustment1->isNeutral()->willReturn(false);
        $adjustment1->getAmount()->willReturn(10000);
        $adjustment1->setAdjustable($this)->shouldBeCalled();

        $this->addItem($item1);
        $this->addItem($item2);
        $this->addAdjustment($adjustment1);

        $this->getTotal()->shouldReturn(84999);

        $item2->setOrder(null)->shouldBeCalled();

        $this->removeItem($item2);

        $adjustment1->setAdjustable(null)->shouldBeCalled();
        $adjustment1->isLocked()->willReturn(false);

        $adjustment2->isNeutral()->willReturn(false);
        $adjustment2->getAmount()->willReturn(-4999);
        $adjustment2->setAdjustable($this)->shouldBeCalled();

        $this->removeAdjustment($adjustment1);
        $this->addAdjustment($adjustment2);

        $item3->getTotal()->willReturn(55000);
        $item3->equals(Argument::any())->willReturn(false);
        $item3->setOrder($this)->shouldBeCalled();

        $this->addItem($item3);

        $this->getTotal()->shouldReturn(80000);
    }

    function it_ignores_neutral_adjustments_when_calculating_total(
        OrderItemInterface $item1,
        OrderItemInterface $item2,
        AdjustmentInterface $adjustment1,
        AdjustmentInterface $adjustment2
    ) {
        $item1->getTotal()->willReturn(29999);
        $item2->getTotal()->willReturn(45000);

        $item1->equals(Argument::any())->willReturn(false);
        $item2->equals(Argument::any())->willReturn(false);

        $item1->setOrder($this)->shouldBeCalled();
        $item2->setOrder($this)->shouldBeCalled();

        $adjustment1->isNeutral()->willReturn(true);
        $adjustment1->getAmount()->willReturn(10000);
        $adjustment2->isNeutral()->willReturn(false);
        $adjustment2->getAmount()->willReturn(-4999);

        $adjustment1->setAdjustable($this)->shouldBeCalled();
        $adjustment2->setAdjustable($this)->shouldBeCalled();

        $this->addItem($item1);
        $this->addItem($item2);
        $this->addAdjustment($adjustment1);
        $this->addAdjustment($adjustment2);

        $this->getTotal()->shouldReturn(70000);
    }

    function it_calculates_correct_total_when_adjustment_is_bigger_than_cost(
        OrderItemInterface $item,
        AdjustmentInterface $adjustment
    ) {
        $item->getTotal()->willReturn(45000);

        $item->equals(Argument::any())->willReturn(false);

        $item->setOrder($this)->shouldBeCalled();

        $adjustment->isNeutral()->willReturn(false);
        $adjustment->getAmount()->willReturn(-100000);

        $adjustment->setAdjustable($this)->shouldBeCalled();

        $this->addItem($item);
        $this->addAdjustment($adjustment);

        $this->getTotal()->shouldReturn(0);
    }

    function it_initializes_creation_date_by_default()
    {
        $this->getCreatedAt()->shouldHaveType(\DateTimeInterface::class);
    }

    function it_has_no_last_update_date_by_default()
    {
        $this->getUpdatedAt()->shouldReturn(null);
    }

    function it_is_empty_by_default()
    {
        $this->countItems()->shouldReturn(0);
        $this->shouldBeEmpty();
    }

    function it_clears_items(OrderItemInterface $item)
    {
        $this->shouldBeEmpty();
        $this->addItem($item);
        $this->countItems()->shouldReturn(1);
        $this->clearItems();
        $this->shouldBeEmpty();
    }

    function it_has_notes()
    {
        $this->setNotes('something squishy');
        $this->getNotes()->shouldReturn('something squishy');
    }
}


text:
module ServiceNow
  VERSION = "0.0.4"
end


text:
var _ = require('lodash'),
    AssetGraph = require('../');

module.exports = function (queryObj) {
    return function addJavaScriptSourceUrl(assetGraph) {
        assetGraph.findAssets(_.extend({type: 'JavaScript'}, queryObj)).forEach(function (javaScript) {
            new AssetGraph.JavaScriptSourceUrl({
                to: javaScript,
                hrefType: 'rootRelative'
            }).attach(javaScript, 'last');
        });
    };
};


text:
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.util.Queue;
import java.util.Set;
import java.util.concurrent.ConcurrentSkipListSet;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * Created by arshad on 07/02/15.
 */
public class Crawler {

    private String url;
    private ExecutorService pool;
    public Crawler(String startUrl) {
        this.url = startUrl;
        this.pool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 10);
    }

    public void crawl() {
        Queue<String> queue = new LinkedBlockingQueue<String>();
        Set<String> visited = new ConcurrentSkipListSet<String>();
        queue.offer(this.url);
        AtomicInteger stopCount = new AtomicInteger(0);
        while(!queue.isEmpty() || stopCount.get() > 0) {
            String _url = queue.poll();
            if (_url == null) {
                try {
                   Thread.currentThread().sleep(1000);
                    continue;
                } catch (InterruptedException e) {
                    System.out.println("Thread interrupted");
                }
            }
            System.out.println("[*]" + _url);
            System.out.println("[*] Visited: " + visited.size() + ", Queue: " + queue.size());
            if (visited.contains(_url))
                continue;
            visited.add(_url);
            Task t = new Task(_url, this.url, queue, visited, stopCount);
            stopCount.incrementAndGet();
            pool.submit(t);
        }

    }

    public static void main(String[] args) {
        String url = "http://www.aiktc.org";
        Crawler crawler = new Crawler(url);
        crawler.crawl();

    }

    public static class Task implements Runnable{

        private String url;
        private String startUrl;
        private Queue<String> queue;
        private Set<String> visited;
        private AtomicInteger stopCount;

        public Task(String url, String startUrl, Queue<String> queue, Set<String> visited, AtomicInteger stopCount) {
            this.url = url;
            this.startUrl = startUrl;
            this.queue = queue;
            this.visited = visited;
            this.stopCount = stopCount;
        }

        @Override
        public void run() {
            try {
                Document document = Jsoup.connect(this.url).timeout(30000).get();
                System.out.println(document.toString().length());
                Elements links = document.select("a[abs:href]");

                for(Element e: links) {
                    String link = e.attr("href");

                    if (link != null && link.startsWith("/")) {
                        link = this.startUrl + link;
                    }
                    if (link == null
                            || "".equals(link)
                            || link.startsWith("#")
                            || !link.contains(startUrl)
                            || visited.contains(link)) {
                        continue;
                    }
                    System.out.println("FOUND: "  + link);
                    queue.offer(link);
                }
            } catch(Exception e) {
                e.printStackTrace();
            } finally {
                stopCount.decrementAndGet();
            }

        }
    }
}


text:
<?php

use \Illuminate\Support\Facades\Route ;
Route::group(['middleware' => ['web']], function () {

    Route::group(['prefix' => 'admin', 'middleware' => 'IsAdmin'], function () {
        //content
        Route::get('/ModuleName', ['as' => 'admin.ModuleName.index', 'uses' => 'Savy\Admin\AdminModuleNameController@index']);

    });

});


text:
function [dtsvS] = GpsEph2Dtsv(gpsEph,tS)
%[dtsvS] = GpsEph2Dtsv(gpsEph,tS)
%
% Calculate satellite clock bias
% Inputs:
% gpsEph = vector of GPS ephemeris structures defined in ReadRinexNav
% tS GPS time of week (secs) at time of transmission, calculate this as:
%   tS = trx - PR/c,
%    where trx = time of reception (receiver clock)
%           PR = pseudorange
%
% tS may be a vector, gpsEph is a structure or vector of structures
% If gpsEph is a vector then t must have the same number of rows as gpsEph
%   tS(i) is interpreted as being associated with gpsEph(i,:)
% If gpsEph is a single structure then tS may be any length
%
% Outputs:
%   dtsvS = sat clock bias  (seconds). GPS time = satellite time - dtsvS
%   length(dtsvS) = length(tS)
%
% See  IS-GPS-200 and RTCM Paper 99-92 SC104-88 for details of data

%Author: Frank van Diggelen
%Open Source code for processing Android GNSS Measurements

%% Check size of inputs
if min(size(tS))>1
  error('tS must be a vector or a scalar, not a matrix')
end
tS=tS(:)';%make t a row vector, to match [gpsEph.*] vectors below
pt=length(tS);
[p]=length(gpsEph);
if (p>1 && pt~=p),
  error('If gpsEph is a vector tS must be a vector with #rows = length(gpsEph),\n')
end
%%
%%Extract the necessary variables from gpsEph
TGD     = [gpsEph.TGD];
Toc     = [gpsEph.Toc];
af2     = [gpsEph.af2];
af1     = [gpsEph.af1];
af0     = [gpsEph.af0];
Delta_n = [gpsEph.Delta_n];
M0      = [gpsEph.M0];
e       = [gpsEph.e];
Asqrt   = [gpsEph.Asqrt];
Toe     = [gpsEph.Toe];
%%
%%Calculate dependent variables ------------------------------------------------

tk = tS - Toe; %time since time of applicability
I = find(tk > 302400.0);
if any(I),  tk(I) = tk(I)-GpsConstants.WEEKSEC; end,
I = find(tk < -302400.0);
if (I), tk(I) = tk(I)+GpsConstants.WEEKSEC; end,

A = Asqrt.^2;    %semi-major axis of orbit
n0=sqrt(GpsConstants.mu./(A.^3));    %Computed mean motion (rad/sec)
n=n0+Delta_n;      %Corrected Mean Motion
Mk=M0+n.*tk;     %Mean Anomaly
Ek=Kepler(Mk,e);  %Solve Kepler's equation for eccentric anomaly
%%
%%Calculate satellite clock bias (See ICD-GPS-200 20.3.3.3.3.1) ----------------
dt = tS - Toc;
I = find(dt > 302400.0);
if any(I),  dt(I) = dt(I)-GpsConstants.WEEKSEC; end,
I = find(dt < -302400.0);
if (I), dt(I) = dt(I)+GpsConstants.WEEKSEC; end,

dtsvS = af0 + af1.*dt + af2.*(dt.^2)  + ...
    GpsConstants.FREL.*e.*Asqrt.*sin(Ek) -TGD;

end % end of function GpsEph2Dtsv
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Copyright 2016 Google Inc.
%
% Licensed 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.


text:
"""
    Posts
    =====

    Get Post By ID
    ~~~~~~~~~~~~~~

    .. http:get:: /flicket-api/post/(int:post_id)

        **Request**

        .. sourcecode:: http

            GET /flicket-api/priority/1 HTTP/1.1
            HOST: localhost:5000
            Accept: application/json
            Authorization: Bearer <token>

        **Response**

        .. sourcecode:: http

            HTTP/1.0 200 OK
            Content-Length: 1231
            Content-Type: application/json
            Date: Sun, 30 Jun 2019 13:00:13 GMT
            Server: Werkzeug/0.14.1 Python/3.7.3

            {
                "content": "The Galactic Empire is nearing completion of the Death Star, a space station with the power
                 to destroy entire planets. Initially ...",
                "data_added": "Sun, 05 May 2019 14:19:42 GMT",
                "date_modified": null,
                "id": 1,
                "links": {
                    "created_by": "http://127.0.0.1:5000/flicket-api/user/15",
                    "posts": "http://127.0.0.1:5000/flicket-api/posts/1/",
                    "self": "http://127.0.0.1:5000/flicket-api/post/1"
                },
                "ticket_id": 1,
                "user_id": 15
            }

    Get Posts
    ~~~~~~~~~

    Retrieve all posts associated to a ticket by ticket_id.

    .. http:get:: /flicket-api/posts/(int:ticket_id)/(int:page)/

        **Request**

        .. sourcecode:: http

            GET /flicket-api/posts/1/ HTTP/1.1
            HOST: localhost:5000
            Accept: application/json
            Authorization: Bearer <token>

        **Response**

        .. sourcecode:: http

            HTTP/1.0 200 OK
            Content-Length: 27640
            Content-Type: application/json
            Date: Sun, 30 Jun 2019 15:41:09 GMT
            Server: Werkzeug/0.14.1 Python/3.7.3

            {
                "_links": {
                    "next": null,
                    "prev": null,
                    "self": "http://127.0.0.1:5000/flicket-api/posts/1/1/?per_page=50"
                },
                "_meta": {
                    "page": 1,
                    "per_page": 50,
                    "total_items": 25,
                    "total_pages": 1
                },
                "items": [
                    {
                        "content": "The Galactic Empire is nearing completion of the Death Star, a space station with
                        the power to destroy entire planets. Initially composing light-hearted and irreverent works,
                        he also wrote serious, sombre and religious pieces beginning in the 1930s. Erlang is known for
                        its designs that are well suited for systems. It is also a garbage-collected runtime system.
                        They are written as strings of consecutive alphanumeric characters, the first character being
                        lowercase. The sequential subset of Erlang supports eager evaluation, single assignment, and
                        dynamic typing. Tuples are containers for a fixed number of Erlang data types. Tuples are
                        containers for a fixed number of Erlang data types. The arguments can be primitive data types
                        or compound data types. Type classes first appeared in the Haskell programming language. The
                        arguments can be primitive data types or compound data types.",
                        "data_added": "Sun, 05 May 2019 14:19:42 GMT",
                        "date_modified": null,
                        "id": 1,
                        "links": {
                            "created_by": "http://127.0.0.1:5000/flicket-api/user/15",
                            "posts": "http://127.0.0.1:5000/flicket-api/posts/1/",
                            "self": "http://127.0.0.1:5000/flicket-api/post/1"
                        },
                        "ticket_id": 1,
                        "user_id": 15
                    }
                ]
            }
"""

from flask import jsonify, request

from .sphinx_helper import api_url
from . import bp_api
from application import app
from application.flicket.models.flicket_models import FlicketPost
from application.flicket_api.views.auth import token_auth

@bp_api.route(api_url + 'post/<int:id>', methods=['GET'])
@token_auth.login_required
def get_post(id):
    return jsonify(FlicketPost.query.get_or_404(id).to_dict())

@bp_api.route(api_url + 'posts/<int:ticket_id>/', methods=['GET'])
@bp_api.route(api_url + 'posts/<int:ticket_id>/<int:page>/', methods=['GET'])
@token_auth.login_required
def get_posts(page=1, ticket_id=None):
    posts = FlicketPost.query.filter_by(ticket_id=ticket_id)
    per_page = min(request.args.get('per_page', app.config['posts_per_page'], type=int), 100)
    data = FlicketPost.to_collection_dict(posts, page, per_page, 'bp_api.get_posts', ticket_id=ticket_id)
    return jsonify(data)


text:
<footer>
</footer>

<!-- Scripts
============================================= -->

<!-- jQuery -->
<script src="<?=$appPublic?>/vendor/jquery/jquery.min.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="<?=$appPublic?>/vendor/bootstrap/js/bootstrap.min.js"></script>

<!-- Metis Menu Plugin JavaScript -->
<script src="<?=$appPublic?>/vendor/metisMenu/metisMenu.min.js"></script>

<!-- Morris Charts JavaScript -->
<!--
<script src="<?=$appPublic?>/vendor/raphael/raphael.min.js"></script>
<script src="<?=$appPublic?>/vendor/morrisjs/morris.min.js"></script>
<script src="<?=$appPublic?>/data/morris-data.js"></script>
-->

<!-- Custom Theme JavaScript -->
<script src="<?=$appPublic?>/js/dist/sb-admin-2.js"></script>

<!-- angular 1.5.8 -->
<script src="<?=$appPublic?>/vendor/angular/angular.js"></script>


text:
/*
 *                      Yeppp! library implementation
 *
 * This file is part of Yeppp! library and licensed under the New BSD license.
 * See LICENSE.txt for the full text of the license.
 */

namespace Yeppp
{

	/// The company which designed the processor microarchitecture.
	/// <seealso cref="Library.GetCpuVendor" />
	public struct CpuVendor
	{

		/// Processor vendor is not known to the library, or the library failed to get vendor information from the OS.
		public static readonly CpuVendor Unknown            = new CpuVendor(0);

		/* x86/x86-64 CPUs */

		/// Intel Corporation. Vendor of x86, x86-64, IA64, and ARM processor microarchitectures.
		/// <remarks>Sold its ARM design subsidiary in 2006. The last ARM processor design was released in 2004.</remarks>
		public static readonly CpuVendor Intel              = new CpuVendor(1);
		/// Advanced Micro Devices, Inc. Vendor of x86 and x86-64 processor microarchitectures.
		public static readonly CpuVendor AMD                = new CpuVendor(2);
		/// VIA Technologies, Inc. Vendor of x86 and x86-64 processor microarchitectures.
		/// <remarks>Processors are designed by Centaur Technology, a subsidiary of VIA Technologies.</remarks>
		public static readonly CpuVendor VIA                = new CpuVendor(3);
		/// Transmeta Corporation. Vendor of x86 processor microarchitectures.
		/// <remarks>Now defunct. The last processor design was released in 2004.</remarks>
		/// <remarks>Transmeta processors implemented VLIW ISA and used binary translation to execute x86 code.</remarks>
		public static readonly CpuVendor Transmeta          = new CpuVendor(4);
		/// Cyrix Corporation. Vendor of x86 processor microarchitectures.
		/// <remarks>Now defunct. The last processor design was released in 1996.</remarks>
		public static readonly CpuVendor Cyrix              = new CpuVendor(5);
		/// Rise Technology. Vendor of x86 processor microarchitectures.
		/// <remarks>Now defunct. The last processor design was released in 1999.</remarks>
		public static readonly CpuVendor Rise               = new CpuVendor(6);
		/// National Semiconductor. Vendor of x86 processor microarchitectures.
		/// <remarks>Sold its x86 design subsidiary in 1999. The last processor design was released in 1998.</remarks>
		public static readonly CpuVendor NSC                = new CpuVendor(7);
		/// Silicon Integrated Systems. Vendor of x86 processor microarchitectures.
		/// <remarks>Sold its x86 design subsidiary in 2001. The last processor design was released in 2001.</remarks>
		public static readonly CpuVendor SiS                = new CpuVendor(8);
		/// NexGen. Vendor of x86 processor microarchitectures.
		/// <remarks>Now defunct. The last processor design was released in 1994.</remarks>
		/// <remarks>NexGen designed the first x86 microarchitecture which decomposed x86 instructions into simple microoperations.</remarks>
		public static readonly CpuVendor NexGen             = new CpuVendor(9);
		/// United Microelectronics Corporation. Vendor of x86 processor microarchitectures.
		/// <remarks>Ceased x86 in the early 1990s. The last processor design was released in 1991.</remarks>
		/// <remarks>Designed U5C and U5D processors. Both are 486 level.</remarks>
		public static readonly CpuVendor UMC                = new CpuVendor(10);
		/// RDC Semiconductor Co., Ltd. Vendor of x86 processor microarchitectures.
		/// <remarks>Designes embedded x86 CPUs.</remarks>
		public static readonly CpuVendor RDC                = new CpuVendor(11);
		/// DM&P Electronics Inc. Vendor of x86 processor microarchitectures.
		/// <remarks>Mostly embedded x86 designs.</remarks>
		public static readonly CpuVendor DMP                = new CpuVendor(12);

		/* ARM CPUs */

		/// ARM Holdings plc. Vendor of ARM processor microarchitectures.
		public static readonly CpuVendor ARM                = new CpuVendor(20);
		/// Marvell Technology Group Ltd. Vendor of ARM processor microarchitectures.
		public static readonly CpuVendor Marvell            = new CpuVendor(21);
		/// Qualcomm Incorporated. Vendor of ARM processor microarchitectures.
		public static readonly CpuVendor Qualcomm           = new CpuVendor(22);
		/// Digital Equipment Corporation. Vendor of ARM processor microarchitecture.
		/// <remarks>Sold its ARM designs in 1997. The last processor design was released in 1997.</remarks>
		public static readonly CpuVendor DEC                = new CpuVendor(23);
		/// Texas Instruments Inc. Vendor of ARM processor microarchitectures.
		public static readonly CpuVendor TI                 = new CpuVendor(24);
		/// Apple Inc. Vendor of ARM processor microarchitectures.
		public static readonly CpuVendor Apple              = new CpuVendor(25);

		/* MIPS CPUs */

		/// Ingenic Semiconductor. Vendor of MIPS processor microarchitectures.
		public static readonly CpuVendor Ingenic            = new CpuVendor(40);
		/// Institute of Computing Technology of the Chinese Academy of Sciences. Vendor of MIPS processor microarchitectures.
		public static readonly CpuVendor ICT                = new CpuVendor(41);
		/// MIPS Technologies, Inc. Vendor of MIPS processor microarchitectures.
		public static readonly CpuVendor MIPS               = new CpuVendor(42);

		/* PowerPC CPUs */

		/// International Business Machines Corporation. Vendor of PowerPC processor microarchitectures.
		public static readonly CpuVendor IBM                = new CpuVendor(50);
		/// Motorola, Inc. Vendor of PowerPC and ARM processor microarchitectures.
		public static readonly CpuVendor Motorola           = new CpuVendor(51);
		/// P. A. Semi. Vendor of PowerPC processor microarchitectures.
		/// <remarks>Now defunct. The last processor design was released in 2007.</remarks>
		public static readonly CpuVendor PASemi             = new CpuVendor(52);

		/* SPARC CPUs */

		/// Sun Microsystems, Inc. Vendor of SPARC processor microarchitectures.
		/// <remarks>Now defunct. The last processor design was released in 2008.</remarks>
		public static readonly CpuVendor Sun                = new CpuVendor(60);
		/// Oracle Corporation. Vendor of SPARC processor microarchitectures.
		public static readonly CpuVendor Oracle             = new CpuVendor(61);
		/// Fujitsu Limited. Vendor of SPARC processor microarchitectures.
		public static readonly CpuVendor Fujitsu            = new CpuVendor(62);
		/// Moscow Center of SPARC Technologies CJSC. Vendor of SPARC processor microarchitectures.
		public static readonly CpuVendor MCST               = new CpuVendor(63);

		private readonly uint id;

		internal CpuVendor(uint id)
		{
			this.id = id;
		}

		internal uint Id
		{
			get
			{
				return this.id;
			}
		}

		/// Compares for equality with another <see cref="CpuVendor" /> object.
		/// <remarks>Comparison is performed by value.</remarks>
		public bool Equals(CpuVendor other)
		{
			return this.id == other.id;
		}

		/// Compares for equality with another object.
		/// <remarks>Comparison is performed by value.</remarks>
		public override bool Equals(System.Object other)
		{
			if (other == null || GetType() != other.GetType())
				return false;

			return this.Equals((CpuVendor)other);
		}

		/// Provides a hash for the object.
		/// <remarks>Non-equal <see cref="CpuVendor" /> objects are guaranteed to have different hashes.</remarks>
		public override int GetHashCode()
		{
			return unchecked((int)this.id);
		}

		/// Provides a string ID for the object.
		/// <remarks>The string ID starts with a Latin letter and contains only Latin letters, digits, and underscore symbol.</remarks>
		/// <seealso cref="Description" />
		public override string ToString()
		{
			return Library.GetString(Enumeration.CpuVendor, this.id, StringType.ID);
		}

		/// Provides a description for the object.
		/// <remarks>The description can contain spaces and non-ASCII characters.</remarks>
		/// <seealso cref="ToString()" />
		public string Description
		{
			get
			{
				return Library.GetString(Enumeration.CpuVendor, this.id, StringType.Description);
			}
		}

	}

}


text:
require 'travis/build/addons/base'

module Travis
  module Build
    class Addons
      class AptPackages < Base
        SUPER_USER_SAFE = true

        class << self
          def whitelist
            @whitelist ||= load_whitelist
          end

          private

          def load_whitelist
            require 'faraday'
            response = Faraday.get(ENV['TRAVIS_BUILD_APT_WHITELIST'])
            response.body.to_s.split.map(&:strip).sort.uniq
          rescue => e
            warn e
            []
          end
        end

        def after_prepare
          sh.fold 'apt_packages' do
            sh.echo "Installing APT Packages (BETA)", ansi: :yellow

            whitelisted = []
            disallowed = []

            config.each do |package|
              if whitelist.include?(package)
                whitelisted << package
              else
                disallowed << package
              end
            end

            unless disallowed.empty?
              sh.echo "Disallowing packages: #{disallowed.join(', ')}", ansi: :red
              sh.echo 'If you require these packages, please review the package ' \
                      'approval process at: ' \
                      'https://github.com/travis-ci/apt-package-whitelist#package-approval-process'
            end

            unless whitelisted.empty?
              sh.export 'DEBIAN_FRONTEND', 'noninteractive', echo: true
              sh.cmd "sudo -E apt-get -yq update &>> ~/apt-get-update.log", echo: true, timing: true
              sh.cmd 'sudo -E apt-get -yq --no-install-suggests --no-install-recommends ' \
                     "install #{whitelisted.join(' ')}", echo: true, timing: true
            end
          end
        end

        private

          def config
            Array(super)
          end

          def whitelist
            ::Travis::Build::Addons::AptPackages.whitelist
          end
      end
    end
  end
end


text:
package emas_appmonitor

//Licensed 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.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

// CentroidItem is a nested struct in emas_appmonitor response
type CentroidItem struct {
	Range string  `json:"Range" xml:"Range"`
	Rate  float64 `json:"Rate" xml:"Rate"`
	Value float64 `json:"Value" xml:"Value"`
}


text:
#include <assert.h>
#include <stdint.h>

#include "image.hpp"
#include "json.hpp"
#include "d3d9imports.hpp"
#include "d3dstate.hpp"

namespace d3dstate {

static image::Image *
getRenderTargetImage(IDirect3DDevice9 *pDevice,
                     IDirect3DSurface9 *pRenderTarget) {
    image::Image *image = NULL;
    D3DSURFACE_DESC Desc;
    IDirect3DSurface9 *pStagingSurface = NULL;
    D3DLOCKED_RECT LockedRect;
    const unsigned char *src;
    unsigned char *dst;
    HRESULT hr;

    if (!pRenderTarget) {
        return NULL;
    }

    hr = pRenderTarget->GetDesc(&Desc);
    assert(SUCCEEDED(hr));

    if (Desc.Format != D3DFMT_X8R8G8B8 &&
        Desc.Format != D3DFMT_A8R8G8B8 &&
        Desc.Format != D3DFMT_R5G6B5) {
        std::cerr << "warning: unsupported D3DFORMAT " << Desc.Format << "\n";
        goto no_staging;
    }

    hr = pDevice->CreateOffscreenPlainSurface(Desc.Width, Desc.Height, Desc.Format, D3DPOOL_SYSTEMMEM, &pStagingSurface, NULL);
    if (FAILED(hr)) {
        goto no_staging;
    }

    hr = pDevice->GetRenderTargetData(pRenderTarget, pStagingSurface);
    if (FAILED(hr)) {
        goto no_rendertargetdata;
    }

    hr = pStagingSurface->LockRect(&LockedRect, NULL, D3DLOCK_READONLY);
    if (FAILED(hr)) {
        goto no_rendertargetdata;
    }

    image = new image::Image(Desc.Width, Desc.Height, 3, true);
    if (!image) {
        goto no_image;
    }

    dst = image->start();
    src = (const unsigned char *)LockedRect.pBits;
    for (unsigned y = 0; y < Desc.Height; ++y) {
        if (Desc.Format == D3DFMT_R5G6B5) {
            for (unsigned x = 0; x < Desc.Width; ++x) {
                uint32_t pixel = ((const uint16_t *)src)[x];
                dst[3*x + 0] = (( pixel        & 0x1f) * (2*0xff) + 0x1f) / (2*0x1f);
                dst[3*x + 1] = (((pixel >>  5) & 0x3f) * (2*0xff) + 0x3f) / (2*0x3f);
                dst[3*x + 2] = (( pixel >> 11        ) * (2*0xff) + 0x1f) / (2*0x1f);
                dst[3*x + 3] = 0xff;
            }
        } else {
            for (unsigned x = 0; x < Desc.Width; ++x) {
                dst[3*x + 0] = src[4*x + 2];
                dst[3*x + 1] = src[4*x + 1];
                dst[3*x + 2] = src[4*x + 0];
            }
        }

        src += LockedRect.Pitch;
        dst += image->stride();
    }

no_image:
    pStagingSurface->UnlockRect();
no_rendertargetdata:
    pStagingSurface->Release();
no_staging:
    return image;
}

image::Image *
getRenderTargetImage(IDirect3DDevice9 *pDevice) {
    HRESULT hr;

    IDirect3DSurface9 *pRenderTarget = NULL;
    hr = pDevice->GetRenderTarget(0, &pRenderTarget);
    if (FAILED(hr)) {
        return NULL;
    }
    assert(pRenderTarget);

    image::Image *image = NULL;
    if (pRenderTarget) {
        image = getRenderTargetImage(pDevice, pRenderTarget);
        pRenderTarget->Release();
    }

    return image;
}

void
dumpFramebuffer(JSONWriter &json, IDirect3DDevice9 *pDevice)
{
    HRESULT hr;

    json.beginMember("framebuffer");
    json.beginObject();

    D3DCAPS9 Caps;
    pDevice->GetDeviceCaps(&Caps);

    for (UINT i = 0; i < Caps.NumSimultaneousRTs; ++i) {
        IDirect3DSurface9 *pRenderTarget = NULL;
        hr = pDevice->GetRenderTarget(i, &pRenderTarget);
        if (FAILED(hr)) {
            continue;
        }

        if (!pRenderTarget) {
            continue;
        }

        image::Image *image;
        image = getRenderTargetImage(pDevice, pRenderTarget);
        if (image) {
            char label[64];
            _snprintf(label, sizeof label, "RENDER_TARGET_%u", i);
            json.beginMember(label);
            json.writeImage(image, "UNKNOWN");
            json.endMember(); // RENDER_TARGET_*
        }

        pRenderTarget->Release();
    }

    json.endObject();
    json.endMember(); // framebuffer
}

} /* namespace d3dstate */


text:
define(['jquery'], function (jQuery) {
    (function($) {

        /**
         * Catch the keypress event for `enter` and `space` when an editable field has focus
         */
        $(document).on('focus', '.jeditable-field', function(ev) {
            $(this).keypress(function(ev) {
                var keyCode = parseInt(ev.which, 10);
                if (keyCode === 13 || keyCode === 32) {
                    $(this).trigger('click.editable');
                }
            });
        });

    })(jQuery);
});


text:
Meteor collections instances should describe themselves

## usage
```js
Example = new Mongo.Collection('example');

Example.insert({test: 'test'})

var example = Example.findOne({test: 'test'})
example.$shadow().collection === Example //true
```


text:
#ifndef CRYS_ECPKI_KG_H
#define CRYS_ECPKI_KG_H

/*! @file
@brief Defines the API for generation of ECC private and public keys.
@defgroup crys_ecpki_kg CryptoCell ECC Key Generation APIs
@{
@ingroup cryptocell_ecpki
*/

#include "crys_error.h"
#include "crys_rnd.h"
#include "crys_ecpki_types.h"

#ifdef __cplusplus
extern "C"
{
#endif

/*****************  CRYS_ECPKI_GenKeyPair function   **********************/
/*!
@brief Generates a pair of private and public keys in internal representation according to [ANS X9.62].

@return CRYS_OK on success.
@return A non-zero value on failure as defined crys_ecpki_error.h or crys_rnd_error.h
*/
CIMPORT_C CRYSError_t CRYS_ECPKI_GenKeyPair(
            void       *rndState_ptr,     /*!< [in/out] Pointer to the RND state structure. */
            SaSiRndGenerateVectWorkFunc_t rndGenerateVectFunc,   /*!< [in] Pointer to the random vector generation function.  */
                        const CRYS_ECPKI_Domain_t  *pDomain,          /*!< [in]  Pointer to EC domain (curve). */
                        CRYS_ECPKI_UserPrivKey_t   *pUserPrivKey,     /*!< [out] Pointer to the private key structure. This structure is used as input to the
                                         ECPKI cryptographic primitives. */
                        CRYS_ECPKI_UserPublKey_t   *pUserPublKey,     /*!< [out] Pointer to the public key structure. This structure is used as input to the
                                         ECPKI cryptographic primitives. */
            CRYS_ECPKI_KG_TempData_t   *pTempData,        /*!< [in] Temporary buffers for internal use, defined in ::CRYS_ECPKI_KG_TempData_t. */
                        CRYS_ECPKI_KG_FipsContext_t   *pFipsCtx       /*!< [in] Pointer to temporary buffer used in case FIPS certification if required. */
);

#ifdef __cplusplus
}
#endif
/**
@}
 */
#endif


text:
package com.webfluxclient.utils;

import org.springframework.core.io.buffer.DataBuffer;
import org.springframework.util.FileCopyUtils;

import java.io.IOException;
import java.io.InputStreamReader;

public class DataBuffers {

    public static String readToString(DataBuffer dataBuffer) {
        try {
            return FileCopyUtils.copyToString(new InputStreamReader(dataBuffer.asInputStream()));
        }
        catch (IOException e) {
            return e.getMessage();
        }
    }
}


text:
Find the best Wi-Fi near you

    Help us find the best places in town to surf the web. It's simple. If you're on free Wi-Fi right now, just take a moment to rank it. Together we can eliminate the need to hunt for good connections.

      Report a Hotspot

      Find a Hotspot


text:
/*
 * Do not modify this file. This file is generated from the ec2-2014-10-01.normal.json service model.
 */
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;

using Amazon.Runtime;
using Amazon.Runtime.Internal;

namespace Amazon.EC2.Model
{
    ///
    /// Container for the parameters to the ResetSnapshotAttribute operation.
    /// Resets permission settings for the specified snapshot.
    ///
    ///
    /// <para>
    /// For more information on modifying snapshot permissions, see Sharing
    /// Snapshots in the Amazon Elastic Compute Cloud User Guide for Linux.
    /// </para>
    ///
    public partial class ResetSnapshotAttributeRequest : AmazonEC2Request
    {
        private SnapshotAttributeName _attribute;
        private string _snapshotId;

        ///
        /// Empty constructor used to set  properties independently even when a simple constructor is available
        ///
        public ResetSnapshotAttributeRequest() { }

        ///
        /// Instantiates ResetSnapshotAttributeRequest with the parameterized properties
        ///
        /// <param name="snapshotId">The ID of the snapshot.</param>
        /// <param name="attribute">The attribute to reset (currently only the attribute for permission to create volumes can be reset).</param>
        public ResetSnapshotAttributeRequest(string snapshotId, SnapshotAttributeName attribute)
        {
            _snapshotId = snapshotId;
            _attribute = attribute;
        }

        ///
        /// Gets and sets the property Attribute.
        /// <para>
        /// The attribute to reset (currently only the attribute for permission to create volumes
        /// can be reset).
        /// </para>
        ///
        public SnapshotAttributeName Attribute
        {
            get { return this._attribute; }
            set { this._attribute = value; }
        }

        // Check to see if Attribute property is set
        internal bool IsSetAttribute()
        {
            return this._attribute != null;
        }

        ///
        /// Gets and sets the property SnapshotId.
        /// <para>
        /// The ID of the snapshot.
        /// </para>
        ///
        public string SnapshotId
        {
            get { return this._snapshotId; }
            set { this._snapshotId = value; }
        }

        // Check to see if SnapshotId property is set
        internal bool IsSetSnapshotId()
        {
            return this._snapshotId != null;
        }

    }
}


text:
$(function () {

  'use strict';

  var $image = $(window.createCropperImage());

  $image.on('dragstart.cropper', function (e) {

    QUnit.test('methods.dragstart', function (assert) {
      assert.equal(e.type, 'dragstart');
      assert.equal(e.namespace, 'cropper');
    });

  }).cropper({
    built: function () {
      var $dragBox = $image.data('cropper').$dragBox;

       // Triggers events manually when built
      $dragBox.trigger('mousedown').trigger('mouseup');
    },

    dragstart: function (e) {

      QUnit.test('options.dragstart', function (assert) {
        assert.equal(e.type, 'dragstart');
        assert.equal(e.namespace, 'cropper');
      });

    }
  });

});


text:
package com.gdn.venice.constants;

/**
 *
 * @author yauritux
 *
 */
public enum VenVAPaymentStatusIDConstants {

	 VEN_VA_PAYMENT_STATUS_ID_APPROVING(0),
	 VEN_VA_PAYMENT_STATUS_ID_APPROVED(1);

	 private long code;

	 private VenVAPaymentStatusIDConstants(long code) {
		 this.code = code;
	 }

	 public long code() {
		 return code;
	 }
}


text:
local utility = require 'remotedebug.utility'
local ev = require 'backend.event'
local absolute = utility.fs_absolute
local u2a = utility.u2a or function (...) return ... end
local a2u = utility.a2u or function (...) return ... end

local isWindows = package.config:sub(1,1) == "\\"
local sourceFormat = isWindows and "path" or "linuxpath"
local pathFormat = "path"
local useWSL = false
local useUtf8 = false

local function towsl(s)
    if not useWSL or not s:match "^%a:" then
        return s
    end
    return s:gsub("\\", "/"):gsub("^(%a):", function(c)
        return "/mnt/"..c:lower()
    end)
end

local function nativepath(s)
    if not useWSL and not useUtf8 then
        return u2a(s)
    end
    return towsl(s)
end

ev.on('initializing', function(config)
    sourceFormat = config.sourceFormat or (isWindows and "path" or "linuxpath")
    pathFormat = config.pathFormat or "path"
    useWSL = config.useWSL
    useUtf8 = config.sourceCoding == "utf8"
end)

local function normalize_posix(p)
    local stack = {}
    p:gsub('[^/]*', function (w)
        if #w == 0 and #stack ~= 0 then
        elseif w == '..' and #stack ~= 0 and stack[#stack] ~= '..' then
            stack[#stack] = nil
        elseif w ~= '.' then
            stack[#stack + 1] = w
        end
    end)
    return stack
end

local function normalize_win32(p)
    local stack = {}
    p:gsub('[^/\\]*', function (w)
        if #w == 0 and #stack ~= 0 then
        elseif w == '..' and #stack ~= 0 and stack[#stack] ~= '..' then
            stack[#stack] = nil
        elseif w ~= '.' then
            stack[#stack + 1] = w
        end
    end)
    return stack
end

local m = {}

function m.fromwsl(s)
    if sourceFormat == "string" then
        return s
    end
    if not useWSL or not s:match "^/mnt/%a" then
        return s
    end
    return s:gsub("^/mnt/(%a)", "%1:")
end

function m.source_native(s)
    return sourceFormat == "path" and s:lower() or s
end

function m.path_native(s)
    return pathFormat == "path" and s:lower() or s
end

function m.source_normalize(path)
    if sourceFormat == "string" then
        return path
    end
    if sourceFormat == "path" then
        local absolute_path = isWindows and absolute(path) or path
        return table.concat(normalize_win32(absolute_path), '/')
    end
    local absolute_path = isWindows and path or absolute(path)
    return table.concat(normalize_posix(absolute_path), '/')
end

function m.path_normalize(path)
    local normalize = pathFormat == "path" and normalize_win32 or normalize_posix
    return table.concat(normalize(path), '/')
end

function m.path_relative(path, base)
    local normalize = pathFormat == "path" and normalize_win32 or normalize_posix
    local equal = pathFormat == "path"
        and (function(a, b) return a:lower() == b:lower() end)
        or (function(a, b) return a == b end)
    local rpath = normalize(path)
    local rbase = normalize(base)
    while #rpath > 0 and #rbase > 0 and equal(rpath[1], rbase[1]) do
        table.remove(rpath, 1)
        table.remove(rbase, 1)
    end
    if #rpath == 0 and #rbase== 0 then
        return "./"
    end
    local s = {}
    for _ in ipairs(rbase) do
        s[#s+1] = '..'
    end
    for _, e in ipairs(rpath) do
        s[#s+1] = e
    end
    return table.concat(s, '/')
end

function m.path_filename(path)
    local normalize = pathFormat == "path" and normalize_win32 or normalize_posix
    local paths = normalize(path)
    return paths[#paths]
end

m.nativepath = nativepath
m.a2u = a2u

return m


text:
import random

class Rules(object):

    """

    1 | 2 | 3
    ----------
    4 | 5 | 6
    ----------
    7 | 8 | 9

    """
    WIN = 'win'
    DRAW = 'draw'

    TOTAL_MOVES = 9
    END_GAME_STRINGS = ['XXX', 'OOO']

    #Helpers
    ROW0 = [1, 2, 3]
    ROW1 = [4, 5, 6]
    ROW2 = [7, 8, 9]

    COL0 = [1, 4, 7]
    COL1 = [2, 5, 8]
    COL2 = [3, 6, 9]

    F_DIAG = [7, 5, 3]
    R_DIAG = [1, 5, 9]

    DEFAULT_START = 'X'
    MARKS = {
        0: 'X',
        1: 'O'
    }

    def __init__(self, board):
        """
        initialize next play
        """
        if not board:
            raise ValueError

        self.board = board
        self.next_play = self.DEFAULT_START
        self.remaining_moves = self.TOTAL_MOVES

    def _next(self):
        """
        returns the next player
        """
        current_play = self.next_play
        if current_play == 'X':
            self.next_play = 'O'
        else:
            self.next_play = 'X'

        self.remaining_moves -= 1
        return current_play

    def _get_row(self, last_play):
        if last_play in self.ROW0:
            return 0
        elif last_play in self.ROW1:
            return 1
        else:
            return 2

    def _get_column(self, last_play):
    	if last_play in self.COL0:
            return 0
        elif last_play in self.COL1:
            return 1
        else:
            return 2

    def _is_horizontal_win(self, last_play):
        """
        check if 3 in row horizontally (---)
        """
        row = self._get_row(last_play)
        res = self.board.get_horizontal(row)
        if ''.join(res) in self.END_GAME_STRINGS:
            return True
        return False

    def _is_vertical_win(self, last_play):
        """
        check if 3 in row vertically (|)
        """
        column = self._get_column(last_play)
        res = self.board.get_vertical(column)

        if ''.join(res) in self.END_GAME_STRINGS:
            return True
        return

    def _is_diagnol_win(self, last_play):
        """
        check if 3 in row diagonally (/ or \)
        """
        fdiag = [" ", " ", " "]
        rdiag = [" ", " ", " "]

        if (last_play in self.R_DIAG) and (last_play in self.F_DIAG):
            fdiag = self.board.get_forward_diagonal()
            rdiag = self.board.get_reverse_diagonal()

        elif last_play in self.F_DIAG:
            fdiag = self.board.get_forward_diagonal()

        elif last_play in self.R_DIAG:
            rdiag = self.board.get_reverse_diagonal()

        if ''.join(fdiag) in self.END_GAME_STRINGS or ''.join(rdiag) in self.END_GAME_STRINGS:
            return True

        return False

    def _is_draw(self):
        if self.remaining_moves <= 0:
            return True
        return False

    def random_start(self):
        """
        select starting player at random
        """
        self.next_play = self.MARKS(random.randint(0, 1))

    def set_board(self, board):
        self.board = board

    def get_current_player(self):
        """
        who's move is it?
        """
        return self._next()

    def end_game(self, last_play):
        """
        check for end game conditions where last_play is a number
        between 1 and 9

        passing in last_play ensures we only check for wins along the
        last column, row, and diag (if applicable) played

        http://stackoverflow.com/questions/3311119/determining-three-in-a-row-in-python-2d-array
        """
        #check horizontal win
        if self._is_horizontal_win(last_play):
            return True, self.WIN

        #check vertical win
        if self._is_vertical_win(last_play):
            return True, self.WIN

        #check diagnol win
        if self._is_diagnol_win(last_play):
            return True, self.WIN

        if self._is_draw():
            return True, self.DRAW

        return False, None


text:
void estimateScale(cv::Mat projPoints1, cv::Mat projPoints2,
		cv::Mat projPoints3, cv::Mat cameraPos1, cv::Mat cameraPos2,
		cv::Mat &rotation, cv::Mat &translation, cv::Mat cameraMatrix, cv::Mat distCoeffs, int flag = CV_ITERATIVE);

// Estimates scale on translations: (t12 can have scale included or given as next parameter)
//       t23
//       ___
//      \   |
//	 t23 \  |  t12
//        \ |
//	       \|
double estimateScaleTriangle(Eigen::Vector3d trans12, Eigen::Vector3d trans13, Eigen::Vector3d trans23, double scale12 = 1);
double estimateScaleTriangle(cv::Mat trans12, cv::Mat trans13, cv::Mat trans23, double scale12 = 1);


text:
namespace mcr {

class CWinApp : public CWinThread
{
public:
	CWinApp();
	virtual ~CWinApp();

	// These are the functions you might wish to override
	virtual BOOL InitInstance();
	virtual int  MessageLoop();

	// These functions aren't intended to be overridden
	HINSTANCE GetInstanceHandle() const {return m_hInstance;}
	HINSTANCE GetResourceHandle() const {return (m_hResource ? m_hResource : m_hInstance);}
	int Run();
	void SetResourceHandle(HINSTANCE hResource) {m_hResource = hResource;}

	HICON LoadIcon(UINT id);
	void OnHelp();
	void SetRegistryKey(const TCHAR* section);
	HCURSOR LoadStandardCursor(UINT id);
	HCURSOR LoadStandardCursor(const TCHAR* id);
	HCURSOR LoadCursor(UINT id);

private:
	CWinApp(const CWinApp&);
	CWinApp& operator = (const CWinApp&);

	HINSTANCE m_hResource;		// handle to the applications resources

	//	HINSTANCE rsc_instance_;
	//	HINSTANCE app_instance_;

	DECLARE_MESSAGE_MAP()
public:
	HINSTANCE m_hInstance;		// handle to the applications instance
	CWnd* m_pMainWnd;
};

} // namespace


text:
Sets specified response header (`header`) to the specified value (`value`).

Alternatively, you can pass in a single object argument (`headers`) to set multiple header fields at once, where the keys are the header field names and the corresponding values are the desired values.

### Usage
```usage
res.set(header, value);
```

-or-

```usage
res.set(headers);
```

### Example
```javascript

res.set('Content-Type', 'text/plain');

res.set({
  'Content-Type': 'text/plain',
  'Content-Length': '123',
  'ETag': '12345'
})

```

<docmeta name="displayName" value="res.set()">
<docmeta name="pageType" value="method">


text:
from muntjac.api import VerticalLayout, ComboBox
from muntjac.ui import abstract_select
from muntjac.data.property import IValueChangeListener

class ComboBoxNewItemsExample(VerticalLayout, IValueChangeListener,
            abstract_select.INewItemHandler):

    _cities = ['Berlin', 'Brussels', 'Helsinki', 'Madrid', 'Oslo',
            'Paris', 'Stockholm']

    def __init__(self):
        super(ComboBoxNewItemsExample, self).__init__()

        self._lastAdded = False

        self.setSpacing(True)
        self._l = ComboBox('Please select a city')
        for c in self._cities:
            self._l.addItem(c)

        self._l.setNewItemsAllowed(True)
        self._l.setNewItemHandler(self)
        self._l.setImmediate(True)
        self._l.addListener(self, IValueChangeListener)
        self.addComponent(self._l)

    # Shows a notification when a selection is made.
    def valueChange(self, event):
        if not self._lastAdded:
            self.getWindow().showNotification('Selected city: '
                    + str(event.getProperty()))
        self._lastAdded = False

    def addNewItem(self, newItemCaption):
        if not self._l.containsId(newItemCaption):
            self.getWindow().showNotification('Added city: '
                    + newItemCaption)
            self._lastAdded = True
            self._l.addItem(newItemCaption)
            self._l.setValue(newItemCaption)