text:
<?php

namespace assegai;

class Request extends Stateful
{
    /** Requested route. */
    protected $route;
    /** Whole route */
    protected $whole_route;
    /** Request's HTTP method (GET, POST, whatnot). */
    protected $method;
    /** Stores the GET variables. */
	protected $getvars;
    /** Stores the POST variables. */
	protected $postvars;
    /** This is mostly used for error handlers. */
    protected $exception;

    /** Route parameters. */
    protected $params;

    /** Security */
    protected $sec;
    protected $server;

    protected $prefix;

    /**
     * Initialises this request object.
     * @param $get is a GET associative array.
     * @param $post is a POST associative array.
     * @param $sec is an instance of assegai's security class: \assegai\Security.
     */
    function __construct()
    {
        parent::__construct();
        $this->getvars = array();
        $this->postvars = array();
    }

    function setDependencies(Server $server, Security $sec)
    {
        $this->server = $server;
        $this->sec = $sec;
    }

    function fromGlobals()
    {
        $this->route = $this->server->getRoute();
        $this->whole_route = $this->server->getWholeRoute();
        $this->method = $this->server->getMethod();
		$this->getvars = $_GET;
		$this->postvars = $_POST;
    }

    /**
     * Parses arguments given from command line to make a
     * GET/POST array.
     * @param string $route the route to emulate.
     * @param optional string $method is the HTTP method to emulate,
     *        default is GET.
     */
    function fromCli($route, $method = 'GET')
    {
        global $argv;

        // Extract the arguments from the CLI
        $args = array();
        for ($argnum = 0; $argnum < count($argv); $argnum++) {
            // Long argument
            if (strpos($argv[$argnum], '--') === 0) {
                $args[substr($argv[$argnum], 2)] = $argv[++$argnum];
            // Short argument.
            } elseif (strpos($argv[$argnum], '-') === 0) {
                $args[substr($argv[$argnum], 1)] = $argv[++$argnum];
            // Positional argument.
            } else {
                $args[] = $argv[$argnum];
            }
        }

        $this->route = $route;
        $this->whole_route = $route;
        $this->method = $method;
        $this->getvars = $this->postvars = $args;
    }

    public function setPrefix($prefix)
    {
        $this->prefix = $prefix;
        return $this;
    }

    public function getRoute() {
        $route = $this->route;
        if ($this->prefix && stripos($route, $this->prefix) === 0) {
            $route = substr($route, strlen($this->prefix));
        }

        if (!$route) {
            $route = '/';
        }

        return $route;
    }

    public function getMethod() {
        return $this->method;
    }

    public function getWholeRoute() {
        return $this->whole_route;
    }

    function setRoute($val) {
        $this->route = $val;
        return $this;
    }

    function setWholeRoute($val) {
        $this->whole_route = $val;
        return $this;
    }

    public function getException()
    {
        return $this->exception;
    }
    public function setException($val)
    {
        $this->exception = $val;
        return $this;
    }

    function setMethod($val) {
        $this->method = $val;
        return $this;
    }

	/**
	 * Retrieves a GET variable.
	 * @param string    $varname         The variable to fetch.
	 * @param mixed     $default         Default value to return,
	 * FALSE is the default.
	 */
	public function unsafeGet($varname, $default = false)
	{
		if(isset($this->getvars[$varname])) {
			return $this->getvars[$varname];
		} else {
			return $default;
		}
	}

    /**
     * Returns a string with all GET parameters as they appear in the URL.
     */
    public function getToString()
    {
        $get = $this->allGet();
        $formatted = array();
        foreach($get as $name => $val) {
            $formatted[] = "$name=$val";
        }

        return implode('&', $formatted);
    }

	/**
	 * Retrieves a POST variable.
	 * @param string    $varname         The variable to fetch.
	 * @param mixed     $default         Default value to return,
	 * FALSE is the default.
	 */
	public function unsafePost($varname, $default = false)
	{
		if(isset($this->postvars[$varname])) {
			return $this->postvars[$varname];
		} else {
			return $default;
		}
	}

    /**
     * Retrieves all POST variables.
     */
    public function unsafeAllPost()
    {
        return $this->postvars;
    }

    /**
     * Retrieves all GET variables.
     */
    public function unsafeAllGet()
    {
        return $this->getvars;
    }

    /**
     * Returns an escaped post variable or default. Beware, the $default WILL
     * NOT BE ESCAPED. You must therefore ensure you escape whatever you give
     * as $default value.
     * @param string $varname is the variable's name.
     * @param mixed  $default is the default to be returned if the variable
     * doesn't exist.
     * @return the requested POST value or $default.
     */
    function post($varname, $default = false)
    {
        $postval = $this->sec->clean($this->unsafePost($varname));
        if ($postval === false) {
            return $default;
        }

        return $postval;
    }

    /**
     * Returns an escaped get variable or default. Beware, the $default WILL
     * NOT BE ESCAPED. You must therefore ensure you escape whatever you give
     * as $default value.
     * @param string $varname is the variable's name.
     * @param mixed  $default is the default to be returned if the variable
     * doesn't exist.
     * @return the requested GET value or $default.
     */
    function get($varname, $default = false)
    {
        $getval = $this->sec->clean($this->unsafeGet($varname, false));
        if ($getval === false) {
            return $default;
        }

        return $getval;
    }

    /**
     * Returns all escaped post data as an array.
     */
    function allPost()
    {
        $post = $this->unsafeAllPost();
        return array_map(array($this->sec, 'clean'), $post);
    }

    /**
     * Returns all escaped get data as an array.
     */
    function allGet()
    {
        $get = $this->unsafeAllGet();
        return array_map(array($this->sec, 'clean'), $get);
    }

    /**
     * Does the request contain files?
     */
    function hasFiles()
    {
        return (count($_FILES) > 0);
    }

    function _getAndMoveFile($file, $target, $exts = null)
    {
        $target_filename = basename($target);
        $target_dir = dirname($target);
        $target = Utils::joinPaths($target_dir, Utils::cleanFilename($target_filename));

        if($file['error'] > 0) {
            throw new FileUploadError($file['error']);
        }

        if($exts != NULL && count($exts > 0)) {
            $allowed = false;
            foreach($exts as $ext) {
                if(preg_match("#".$ext.'$#', $target)) {
                    $allowed = true;
                    break;
                }
            }

            if(!$allowed) {
                throw new \Exception("The uploaded file is not allowed.");
            }
        }

        if(move_uploaded_file($file['tmp_name'], $target)) {
            return $target;
        } else {
            return false;
        }
    }

    /**
     * Gets an uploaded file.
     */
    function getFile($slot_name, $target, $exts = NULL, $generate_names = false)
    {
        if(!$target) {
            throw new \Exception("Can't move file without destination.");
        }

        if(!array_key_exists($slot_name, $_FILES)) {
            return false;
        }

        $return = false;

        // Several files uploaded with the same name like uploads[].
        if(is_array($_FILES[$slot_name]['name'])) {
            if(!is_dir($target)) {
                throw new Exception("Target `$target' must be a directory for several files.");
            }

            $return = array();
            for($file_num = 0; $file_num < count($_FILES[$slot_name]['name']); $file_num++) {
                $file = array(
                    'name' => $_FILES[$slot_name]['name'][$file_num],
                    'type' => $_FILES[$slot_name]['type'][$file_num],
                    'tmp_name' => $_FILES[$slot_name]['tmp_name'][$file_num],
                    'error' => $_FILES[$slot_name]['error'][$file_num],
                    'size' => $_FILES[$slot_name]['size'][$file_num]
                    );

                $looptarget = '';
                if($generate_names) {
                    // Getting the ext. I don't use pathinfo() because the file may not exist...
                    $ext = substr(strrchr($file['name'], '.'), 0);
                    $looptarget = Utils::uniqueFilename($target, '', $ext);
                } else {
                    $looptarget = Utils::joinPaths($target, basename($file['name']));
                }

                try {
                    $return[] = $this->_getAndMoveFile($file, $looptarget, $exts);
                }
                catch(FileUploadError $e) {
                    $return[] = $e;
                }
            }
        } else {
            if(is_dir($target)) {
                if($generate_names) {
                    $ext = substr(strrchr($_FILES[$slot_name]['name'], '.'), 0);
                    $target = Utils::uniqueFilename($target, '', $ext);
                } else {
                    $target = Utils::joinPaths($target, basename($_FILES[$slot_name]['name']));
                }
            }

            try {
                $return = $this->_getAndMoveFile($_FILES[$slot_name], $target, $exts);
            }
            catch(FileUploadError $e)
            {
                return $e;
            }
        }

        return $return;
    }

    /**
     * Sets the parameters after extraction from the route.
     * @param array $params is an array of parameters.
     */
    public function setParams(array $params)
    {
        $this->params = $params;
    }

    /**
     * Gets the parameters extracted from the route as an array.
     * @return array the parameters extracted from the route.
     */
    public function getParams()
    {
        return $this->params;
    }
}


text: Spree::Product.include Spree::Product::Recommendable

redpajama_set_name: RedPajamaGithub


text:
'use strict';

import type {Disposable, Fragment, FragmentType} from 'relay-runtime';

declare export var fragmentInput: Fragment<
  Example_user$fragmentType,
  Example_user$data,
>;

declare export opaque type Example_user$fragmentType: FragmentType;
export type Example_user$data = NonNullableData;
export type Example_user$key = {
  +$data?: Example_user$data,
  +$fragmentSpreads: Example_user$fragmentType,
  ...
};

export type NonNullableData = {
  +id: string,
  +count: number,
};
export type NullableData = ?NonNullableData;
export type NonNullablePluralData = $ReadOnlyArray<NonNullableData>;
export type NullablePluralData = ?$ReadOnlyArray<NonNullableData>;

export type AnotherNonNullableData = {
  +name: ?string,
  +friends: ?number,
};

declare export var keyNonNullable: Example_user$key;

declare export var keyNonNullablePlural: $ReadOnlyArray<Example_user$key>;

declare export var keyNullablePlural: ?$ReadOnlyArray<Example_user$key>;

declare export var keyNullable: ?Example_user$key;

declare export var keyAnotherNonNullable: {
  +$data: AnotherNonNullableData,
  +$fragmentSpreads: FragmentType,
  ...
};

declare export var keyAnotherNullable: ?{
  +$data: AnotherNonNullableData,
  +$fragmentSpreads: FragmentType,
  ...
};

declare export var fragmentData: {
  +$fragmentType: FragmentType,
  ...
};

export type QueryOperation = {
  +variables: QueryVariables,
  +response: {...},
};

export type QueryVariables = {
  id: string,
  nickname: ?string,
  name: string,
};

export type QueryVariablesSubset = {
  id: string,
  ...
};

export type FetchFn<TVars> = (vars: TVars) => Disposable;


text:
require "vito/command_line/document_flags"

module Vito
  module CommandLine
    class Options
      include Vito::CommandLine::DocumentFlags

      def initialize(argv)
        @argv = argv
      end

      flag ["-f", "--file filename"]
      desc "Defines a file"
      def file
        file = nil
        argv.each_with_index { |value, index| file = argv[index+1] if file?(value) }
        file
      end

      flag ["-h", "--help"]
      desc "Shows this documentation"
      def help
        argv.any? { |a| ["-h", "--help"].include?(a) }
      end

      def available_options
        flags        = self.class.flags
        descriptions = self.class.descriptions
        flags.each_with_index.map { |flag, index| [flag, descriptions[index]] }
      end

      private

      attr_reader :argv

      def file?(value)
        ["-f", "--file"].include?(value)
      end
    end
  end
end


text:
package com.impetus.client.cassandra.crud.compositeType.association;

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

/**
 * User info entity
 *
 * @author vivek.mishra
 *
 */

@Entity
@Table(name = "UserInfo")
public class UserInfo
{

    @Id
    @Column(name = "userInfo_id")
    private String userInfoId;

    @Column(name = "first_name")
    private String firstName;

    @Column(name = "last_name")
    private String lastName;

    @Column(name = "age")
    private int age;

    // height in inches.
    @Column(name = "height")
    private transient int height;

    /**
     *
     */
    public UserInfo()
    {
    }

    /**
     * @param userInfoId
     * @param firstName
     * @param lastName
     * @param age
     * @param timeLine
     */
    public UserInfo(String userInfoId, String firstName, String lastName, int age, int height)
    {
        super();
        this.userInfoId = userInfoId;
        this.firstName = firstName;
        this.lastName = lastName;
        this.age = age;
        this.height = height;
    }

    /**
     * @return the userInfoId
     */
    public String getUserInfoId()
    {
        return userInfoId;
    }

    /**
     * @return the firstName
     */
    public String getFirstName()
    {
        return firstName;
    }

    /**
     * @return the lastName
     */
    public String getLastName()
    {
        return lastName;
    }

    /**
     * @return the age
     */
    public int getAge()
    {
        return age;
    }

    /**
     * @param firstName
     *            the firstName to set
     */
    public void setFirstName(String firstName)
    {
        this.firstName = firstName;
    }

    /**
     * @param age
     *            the age to set
     */
    public void setAge(int age)
    {
        this.age = age;
    }

    /**
     * @return the height
     */
    public int getHeight()
    {
        return height;
    }

}


text:
'use strict';

/*!
 * Module requirements.
 */

var Types = {
  Number: require('../number')
};

/*!
 * @ignore
 */

exports.castToNumber = castToNumber;
exports.castArraysOfNumbers = castArraysOfNumbers;

/*!
 * @ignore
 */

function castToNumber(val) {
  return Types.Number.prototype.cast.call(this, val);
}

function castArraysOfNumbers(arr, self) {
  arr.forEach(function(v, i) {
    if (Array.isArray(v)) {
      castArraysOfNumbers(v, self);
    } else {
      arr[i] = castToNumber.call(self, v);
    }
  });
}


text:
layout: id/default
permalink: id/mission
lang: id
title: Mission
tag: main
---

				<form id="verify-email-form">

						<input class="clean-input" autocomplete="off" name="email" id="email" maxlength="50" placeholder="Enter your email">

						<button class="button-secondary" id="btn-verify-email" type="submit">Create Free Account</button>

				</form>

Mission

Our mission is to make trading accessible to all by offering smart custom trading solutions to local markets around the world.

We aim to place our client's needs at the centre of our operations and dedicate ourselves to maintain the highest level of client satisfaction.

Champion FX is commited to becoming an industry leader by placing our client's needs at the centre of every decesion we make. As the markets continually evolve, Champion FX will continuosly update our services to meet trader demands.

Values

At Champion FX, we remain dedicated to creating a dynamic environment that both respects traders and equips them with all necessary tools to take their customer experience to a whole new "champion" level.

We will accomplish this by commiting ourselves to these values:

Client satisfaction

Expansion and refinement of our business model - always with a trader's need in mind

Honesty and integrity

Respect and appreciation

Positive thinking

Inspiring and motivating people to achieve greatness


text:
#ifndef NODEBITMAPAND_H
#define NODEBITMAPAND_H

#include "nodes/execnodes.h"

extern int	ExecCountSlotsBitmapAnd(BitmapAnd *node);
extern BitmapAndState *ExecInitBitmapAnd(BitmapAnd *node, EState *estate, int eflags);
extern Node *MultiExecBitmapAnd(BitmapAndState *node);
extern void ExecEndBitmapAnd(BitmapAndState *node);
extern void ExecReScanBitmapAnd(BitmapAndState *node, ExprContext *exprCtxt);

enum
{
	GPMON_BITMAPAND_TOTAL = GPMON_QEXEC_M_NODE_START,
};

static inline gpmon_packet_t *GpmonPktFromBitmapAndState(BitmapAndState *node)
{
	return &node->ps.gpmon_pkt;
}

#endif   /* NODEBITMAPAND_H */


text:
<!doctype html>

    <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A layout example with a side menu that hides on mobile, just like the Pure website.">
    <title>Responsive Side Menu – Layout Examples – Pure</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css">

        <link rel="stylesheet" href="css/layouts/side-menu.css">

            Company

Home

About

                    Services

Contact

Page Title

A subtitle for your page goes here

How to use this layout

                To use this layout, you can just copy paste the HTML, along with the CSS in side-menu.css, and the JavaScript in ui.js. The JS file uses vanilla JavaScript to simply toggle an active class that makes the menu responsive.

Now Let's Speak Some Latin

                Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Try Resizing your Browser

                Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.


text:
  Panjas est
       un village
       géographiquement positionné dans le département des Gers en Midi-Pyrénées. Elle totalisait 372 habitants en 2008.

La ville offre quelques  aménagements, elle dispose, entre autres, de un bassin de natation, un terrain de tennis et un terrain de sport.

Si vous pensez emmenager à Panjas, vous pourrez facilement trouver une maison à acheter.

Le parc d'habitations, à Panjas, était réparti en 2011 en sept appartements et 247 maisons soit
 un marché relativement équilibré.

À coté de Panjas sont situées les communes de
Estang à 5 km, 666 habitants,
Mormès localisée à 5 km, 123 habitants,
Maupas à 5 km, 198 habitants,
Bourrouillan localisée à 6 km, 155 habitants,
Salles-d'Armagnac située à 3 km, 108 habitants,
Laujuzan localisée à 2 km, 231 habitants,
 entre autres. De plus, Panjas est située à seulement 18 km de Aire-sur-l'Adour.


text:
it("should not deadlock when using loadModule", () => {
	const result = require("./loader!");
	expect(result).toMatch(/console.log\(42\)/);
});


text:
<?php
class VIBE_Options_pagebuilder_layouts extends VIBE_Options{

	/**
	 * Field Constructor.
	 *
	 * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
	 *
	 * @since VIBE_Options 1.0.5
	*/
	function __construct($field = array(), $value ='', $parent){

		parent::__construct($parent->sections, $parent->args, $parent->extra_tabs);
		$this->field = $field;
		$this->value = $value;
		//$this->render();

	}//function

	/**
	 * Field Render Function.
	 *
	 * Takes the vars and outputs the HTML for the field in the settings
	 *
	 * @since VIBE_Options 1.0.5
	*/
	function render(){

		$class = (isset($this->field['class']))?$this->field['class']:'regular-text';

		echo '
field['id'].'-ul">';
		$raw_layouts = get_option('vibe_builder_sample_layouts');
                if(isset($raw_layouts)){
                    if(is_string($raw_layouts))
                         $sample_layouts = unserialize($raw_layouts);
                     else {
                         $sample_layouts = $raw_layouts;
                     }
                for($i=0;$i<count($sample_layouts);$i++){
                    echo '

                              '.$sample_layouts[$i]['name'].'
                           '.__('Remove', 'vibe').'
';

                    }
                }
		echo '
';

		echo (isset($this->field['desc']) && !empty($this->field['desc']))?' '.$this->field['desc'].'':'';

	}//function

	/**
	 * Enqueue Function.
	 *
	 * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
	 *
	 * @since VIBE_Options 1.0.5
	*/
	function enqueue(){

		wp_enqueue_script(
			'vibe-opts-field-pagebuilder-layouts-js',
			VIBE_OPTIONS_URL.'fields/pagebuilder_layouts/field_pagebuilder_layouts.js',
			array('jquery'),
			time(),
			true
		);

	}//function

}//class
?>


text:
package com.switchfly.inputvalidation.sanitizer;

import org.junit.Test;

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

public class UrlStripHtmlSanitizerTest {

    private final UrlStripHtmlSanitizer _sanitizer = new UrlStripHtmlSanitizer();

    @Test
    public void testExecute() throws Exception {
        assertEquals("http://www.foo.com/", _sanitizer.execute("http://www.foo.com"));

        assertEquals("http://www.foo.com/path/page.cfm", _sanitizer.execute("http://www.foo.com/path/page.cfm"));

        assertEquals("http://www.foo.com/path/page.cfm?a=1&num_rooms=1&children=0&int=VA&b=2#foo",
            _sanitizer.execute("http://www.foo.com/path/page.cfm?a=1&num_rooms=1&children=0&int=VA&b=2#foo"));

        assertEquals("/path/page.cfm?a=1&num_rooms=1&children=0&int=VA&b=2",
            _sanitizer.execute("/path/page.cfm?a=1&num_rooms=1&children=0&int=VA&b=2"));

        assertEquals("/?a=1&num_rooms=1&children=0&int=VA&b=2", _sanitizer.execute("?a=1&num_rooms=1&children=0&int=VA&b=2"));

        assertEquals("/foo", _sanitizer.execute("foo"));

        assertEquals(
            "https://travel.americanexpress.co.uk/travel/itinerary_clear_process.cfm?redirect_url=%2Ftravel%2Farc.cfm%3Ftab%3Dact&nav=default",
            _sanitizer
                .execute("https://travel.americanexpress.co.uk/travel/itinerary_clear_process.cfm?redirect_url=/travel/arc.cfm?tab=act&nav=default"));

        try {
            _sanitizer.execute("<script>alert('hacked!');</script>");
            fail("Should throw URISyntaxException");
        } catch (Exception e) {
            assertEquals("java.net.URISyntaxException: Illegal character in path at index 0: <script>alert('hacked!');</script>", e.getMessage());
        }
    }

    @Test
    public void testExecuteWithXSS() throws Exception {
        assertEquals("http://www.foo.com/path/page.cfm?a=1&num_rooms=1&children=0&int=VA&b=2&d=", _sanitizer.execute(
            "http://www.foo.com/path/page.cfm?a=1&num_rooms=1&children=0&int=VA&b=2&d=%3C%2Fscript%3E%3Cscript%3Ealert%281%29%3C%2Fscript%3E"));
    }
}


text:
'use strict';

const utils = require('./utils');
const baServices = require('../../lib/services');
const baEnum = require('../../lib/enum');

describe('bacstack - Services layer EventNotifyData unit', () => {
  it('should successfully encode and decode a change of bitstring event', () => {
    const buffer = utils.getBuffer();
    const date = new Date();
    date.setMilliseconds(880);
    baServices.eventNotifyData.encode(buffer, {
      processId: 3,
      initiatingObjectId: {type: 60, instance: 12},
      eventObjectId: {type: 61, instance: 1121},
      timeStamp: {type: 2, value: date},
      notificationClass: 9,
      priority: 7,
      eventType: 0,
      messageText: 'Test1234$',
      notifyType: 1,
      ackRequired: true,
      fromState: 5,
      toState: 6,
      changeOfBitstringReferencedBitString: {bitsUsed: 24, value: [0xaa, 0xaa, 0xaa]},
      changeOfBitstringStatusFlags: {bitsUsed: 24, value: [0xaa, 0xaa, 0xaa]}
    });
    const result = baServices.eventNotifyData.decode(buffer.buffer, 0);
    delete result.len;
    expect(result).toEqual({
      processId: 3,
      initiatingObjectId: {type: 60, instance: 12},
      eventObjectId: {type: 61, instance: 1121},
      timeStamp: date,
      notificationClass: 9,
      priority: 7,
      eventType: 0,
      messageText: 'Test1234$',
      notifyType: 1,
      ackRequired: true,
      fromState: 5,
      toState: 6
    });
  });

  it('should successfully encode and decode a change of state event', () => {
    const buffer = utils.getBuffer();
    const date = new Date();
    date.setMilliseconds(880);
    baServices.eventNotifyData.encode(buffer, {
      processId: 3,
      initiatingObjectId: {},
      eventObjectId: {},
      timeStamp: {type: 2, value: date},
      notificationClass: 9,
      priority: 7,
      eventType: 1,
      messageText: 'Test1234$',
      notifyType: 1,
      ackRequired: false,
      fromState: 1,
      toState: 2,
      changeOfStateNewState: {type: 2, state: 2},
      changeOfStateStatusFlags: {bitsUsed: 24, value: [0xaa, 0xaa, 0xaa]}
    });
    const result = baServices.eventNotifyData.decode(buffer.buffer, 0);
    delete result.len;
    expect(result).toEqual({
      processId: 3,
      initiatingObjectId: {type: 0, instance: 0},
      eventObjectId: {type: 0, instance: 0},
      timeStamp: date,
      notificationClass: 9,
      priority: 7,
      eventType: 1,
      messageText: 'Test1234$',
      notifyType: 1,
      ackRequired: false,
      fromState: 1,
      toState: 2
    });
  });

  it('should successfully encode and decode a change of value event', () => {
    const buffer = utils.getBuffer();
    const date = new Date();
    date.setMilliseconds(880);
    baServices.eventNotifyData.encode(buffer, {
      processId: 3,
      initiatingObjectId: {},
      eventObjectId: {},
      timeStamp: {type: 2, value: date},
      notificationClass: 9,
      priority: 7,
      eventType: 2,
      messageText: 'Test1234$',
      notifyType: 1,
      changeOfValueTag: baEnum.CovTypes.REAL,
      changeOfValueChangeValue: 90,
      changeOfValueStatusFlags: {bitsUsed: 24, value: [0xaa, 0xaa, 0xaa]}
    });
    const result = baServices.eventNotifyData.decode(buffer.buffer, 0);
    delete result.len;
    expect(result).toEqual({
      processId: 3,
      initiatingObjectId: {type: 0, instance: 0},
      eventObjectId: {type: 0, instance: 0},
      timeStamp: date,
      notificationClass: 9,
      priority: 7,
      eventType: 2,
      messageText: 'Test1234$',
      notifyType: 1,
      ackRequired: false,
      fromState: 0,
      toState: 0
    });
  });

  it('should successfully encode and decode a floating limit event', () => {
    const buffer = utils.getBuffer();
    const date = new Date();
    date.setMilliseconds(880);
    baServices.eventNotifyData.encode(buffer, {
      processId: 3,
      initiatingObjectId: {},
      eventObjectId: {},
      timeStamp: {type: 2, value: date},
      notificationClass: 9,
      priority: 7,
      eventType: 4,
      messageText: 'Test1234$',
      notifyType: 1,
      ackRequired: true,
      fromState: 19,
      toState: 12,
      floatingLimitReferenceValue: 121,
      floatingLimitStatusFlags: {bitsUsed: 24, value: [0xaa, 0xaa, 0xaa]},
      floatingLimitSetPointValue: 120,
      floatingLimitErrorLimit: 120
    });
    const result = baServices.eventNotifyData.decode(buffer.buffer, 0);
    delete result.len;
    expect(result).toEqual({
      processId: 3,
      initiatingObjectId: {type: 0, instance: 0},
      eventObjectId: {type: 0, instance: 0},
      timeStamp: date,
      notificationClass: 9,
      priority: 7,
      eventType: 4,
      messageText: 'Test1234$',
      notifyType: 1,
      ackRequired: true,
      fromState: 19,
      toState: 12
    });
  });

  it('should successfully encode and decode an out of range event', () => {
    const buffer = utils.getBuffer();
    const date = new Date();
    date.setMilliseconds(880);
    baServices.eventNotifyData.encode(buffer, {
      processId: 3,
      initiatingObjectId: {},
      eventObjectId: {},
      timeStamp: {type: 2, value: date},
      notificationClass: 9,
      priority: 7,
      eventType: 5,
      messageText: 'Test1234$',
      notifyType: 1,
      outOfRangeExceedingValue: 155,
      outOfRangeStatusFlags: {bitsUsed: 24, value: [0xaa, 0xaa, 0xaa]},
      outOfRangeDeadband: 50,
      outOfRangeExceededLimit: 150
    });
    const result = baServices.eventNotifyData.decode(buffer.buffer, 0);
    delete result.len;
    expect(result).toEqual({
      processId: 3,
      initiatingObjectId: {type: 0, instance: 0},
      eventObjectId: {type: 0, instance: 0},
      timeStamp: date,
      notificationClass: 9,
      priority: 7,
      eventType: 5,
      messageText: 'Test1234$',
      notifyType: 1,
      ackRequired: false,
      fromState: 0,
      toState: 0
    });
  });

  it('should successfully encode and decode a change of life-safety event', () => {
    const buffer = utils.getBuffer();
    const date = new Date();
    date.setMilliseconds(880);
    baServices.eventNotifyData.encode(buffer, {
      processId: 3,
      initiatingObjectId: {},
      eventObjectId: {},
      timeStamp: {type: 2, value: date},
      notificationClass: 9,
      priority: 7,
      eventType: 8,
      messageText: 'Test1234$',
      notifyType: 1,
      changeOfLifeSafetyNewState: 8,
      changeOfLifeSafetyNewMode: 9,
      changeOfLifeSafetyStatusFlags: {bitsUsed: 24, value: [0xaa, 0xaa, 0xaa]},
      changeOfLifeSafetyOperationExpected: 2
    });
    const result = baServices.eventNotifyData.decode(buffer.buffer, 0);
    delete result.len;
    expect(result).toEqual({
      processId: 3,
      initiatingObjectId: {type: 0, instance: 0},
      eventObjectId: {type: 0, instance: 0},
      timeStamp: date,
      notificationClass: 9,
      priority: 7,
      eventType: 8,
      messageText: 'Test1234$',
      notifyType: 1,
      ackRequired: false,
      fromState: 0,
      toState: 0
    });
  });

  it('should successfully encode and decode a buffer ready event', () => {
    const buffer = utils.getBuffer();
    const date = new Date();
    date.setMilliseconds(880);
    baServices.eventNotifyData.encode(buffer, {
      processId: 3,
      initiatingObjectId: {},
      eventObjectId: {},
      timeStamp: {type: 2, value: date},
      notificationClass: 9,
      priority: 7,
      eventType: 10,
      messageText: 'Test1234$',
      notifyType: 1,
      bufferReadyBufferProperty: {
        objectId: {type: 65, instance: 2},
        id: 85,
        arrayIndex: 3,
        deviceIndentifier: {type: 8, instance: 443}
      },
      bufferReadyPreviousNotification: 121,
      bufferReadyCurrentNotification: 281
    });
    const result = baServices.eventNotifyData.decode(buffer.buffer, 0);
    delete result.len;
    expect(result).toEqual({
      processId: 3,
      initiatingObjectId: {type: 0, instance: 0},
      eventObjectId: {type: 0, instance: 0},
      timeStamp: date,
      notificationClass: 9,
      priority: 7,
      eventType: 10,
      messageText: 'Test1234$',
      notifyType: 1,
      ackRequired: false,
      fromState: 0,
      toState: 0
    });
  });

  it('should successfully encode and decode a unsigned range event', () => {
    const buffer = utils.getBuffer();
    const date = new Date();
    date.setMilliseconds(880);
    baServices.eventNotifyData.encode(buffer, {
      processId: 3,
      initiatingObjectId: {},
      eventObjectId: {},
      timeStamp: {type: 2, value: date},
      notificationClass: 9,
      priority: 7,
      eventType: 11,
      messageText: 'Test1234$',
      notifyType: 1,
      unsignedRangeExceedingValue: 101,
      unsignedRangeStatusFlags: {bitsUsed: 24, value: [0xaa, 0xaa, 0xaa]},
      unsignedRangeExceededLimit: 100
    });
    const result = baServices.eventNotifyData.decode(buffer.buffer, 0);
    delete result.len;
    expect(result).toEqual({
      processId: 3,
      initiatingObjectId: {type: 0, instance: 0},
      eventObjectId: {type: 0, instance: 0},
      timeStamp: date,
      notificationClass: 9,
      priority: 7,
      eventType: 11,
      messageText: 'Test1234$',
      notifyType: 1,
      ackRequired: false,
      fromState: 0,
      toState: 0
    });
  });
});


text:
package org.apache.activemq.artemis.spi.core.security.scram;

import java.nio.charset.StandardCharsets;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;

/**
 * Provides static methods for working with SCRAM/SASL
 */
public class ScramUtils {
   private static final byte[] INT_1 = new byte[] {0, 0, 0, 1};

   private ScramUtils() {
      throw new AssertionError("non-instantiable utility class");
   }

   /**
    * Generates salted password.
    * @param password Clear form password, i.e. what user typed
    * @param salt Salt to be used
    * @param iterationsCount Iterations for 'salting'
    * @param mac HMAC to be used
    * @return salted password
    * @throws ScramException
    */
   public static byte[] generateSaltedPassword(final String password, byte[] salt, int iterationsCount,
                                               Mac mac) throws ScramException {
      SecretKeySpec key = new SecretKeySpec(password.getBytes(StandardCharsets.US_ASCII), mac.getAlgorithm());
      try {
         mac.init(key);
      } catch (InvalidKeyException e) {
         throw new ScramException("Incompatible key", e);
      }
      mac.update(salt);
      mac.update(INT_1);
      byte[] result = mac.doFinal();

      byte[] previous = null;
      for (int i = 1; i < iterationsCount; i++) {
         mac.update(previous != null ? previous : result);
         previous = mac.doFinal();
         for (int x = 0; x < result.length; x++) {
            result[x] ^= previous[x];
         }
      }

      return result;
   }

   /**
    * Creates HMAC
    * @param keyBytes key
    * @param hmacName HMAC name
    * @return Mac
    * @throws InvalidKeyException if internal error occur while working with SecretKeySpec
    * @throws NoSuchAlgorithmException if hmacName is not supported by the java
    */
   public static Mac createHmac(final byte[] keyBytes, String hmacName) throws NoSuchAlgorithmException,
                                                                        InvalidKeyException {

      Mac mac = Mac.getInstance(hmacName);
      SecretKeySpec key = new SecretKeySpec(keyBytes, hmacName);
      mac.init(key);
      return mac;
   }

   /**
    * Computes HMAC byte array for given string
    * @param key key
    * @param hmacName HMAC name
    * @param string string for which HMAC will be computed
    * @return computed HMAC
    * @throws InvalidKeyException if internal error occur while working with SecretKeySpec
    * @throws NoSuchAlgorithmException if hmacName is not supported by the java
    */
   public static byte[] computeHmac(final byte[] key, String hmacName, final String string) throws InvalidKeyException,
                                                                                NoSuchAlgorithmException {

      Mac mac = createHmac(key, hmacName);
      mac.update(string.getBytes(StandardCharsets.US_ASCII));
      return mac.doFinal();
   }

   public static byte[] computeHmac(final byte[] key, Mac hmac, final String string) throws ScramException {

      try {
         hmac.init(new SecretKeySpec(key, hmac.getAlgorithm()));
      } catch (InvalidKeyException e) {
         throw new ScramException("invalid key", e);
      }
      hmac.update(string.getBytes(StandardCharsets.US_ASCII));
      return hmac.doFinal();
   }

   /**
    * Checks if string is null or empty
    * @param string String to be tested
    * @return true if the string is null or empty, false otherwise
    */
   public static boolean isNullOrEmpty(String string) {
      return string == null || string.length() == 0; // string.isEmpty() in Java 6
   }

   /**
    * Computes the data associated with new password like salted password, keys, etc
    * <p>
    * This method is supposed to be used by a server when user provides new clear form password. We
    * don't want to save it that way so we generate salted password and store it along with other
    * data required by the SCRAM mechanism
    * @param passwordClearText Clear form password, i.e. as provided by the user
    * @param salt Salt to be used
    * @param iterations Iterations for 'salting'
    * @param mac HMAC name to be used
    * @param messageDigest Digest name to be used
    * @return new password data while working with SecretKeySpec
    * @throws ScramException
    */
   public static NewPasswordByteArrayData newPassword(String passwordClearText, byte[] salt, int iterations,
                                                      MessageDigest messageDigest, Mac mac) throws ScramException {
      byte[] saltedPassword = ScramUtils.generateSaltedPassword(passwordClearText, salt, iterations, mac);

      byte[] clientKey = ScramUtils.computeHmac(saltedPassword, mac, "Client Key");
      byte[] storedKey = messageDigest.digest(clientKey);
      byte[] serverKey = ScramUtils.computeHmac(saltedPassword, mac, "Server Key");

      return new NewPasswordByteArrayData(saltedPassword, salt, clientKey, storedKey, serverKey, iterations);
   }

   /**
    * Transforms NewPasswordByteArrayData into NewPasswordStringData into database friendly (string)
    * representation Uses Base64 to encode the byte arrays into strings
    * @param ba Byte array data
    * @return String data
    */
   public static NewPasswordStringData byteArrayToStringData(NewPasswordByteArrayData ba) {
      return new NewPasswordStringData(Base64.getEncoder().encodeToString(ba.saltedPassword),
                                       Base64.getEncoder().encodeToString(ba.salt),
                                       Base64.getEncoder().encodeToString(ba.clientKey),
                                       Base64.getEncoder().encodeToString(ba.storedKey),
                                       Base64.getEncoder().encodeToString(ba.serverKey), ba.iterations);
   }

   /**
    * New password data in database friendly format, i.e. Base64 encoded strings
    */
   @SuppressWarnings("unused")
   public static class NewPasswordStringData {
      /**
       * Salted password
       */
      public final String saltedPassword;
      /**
       * Used salt
       */
      public final String salt;
      /**
       * Client key
       */
      public final String clientKey;
      /**
       * Stored key
       */
      public final String storedKey;
      /**
       * Server key
       */
      public final String serverKey;
      /**
       * Iterations for slating
       */
      public final int iterations;

      /**
       * Creates new NewPasswordStringData
       * @param saltedPassword Salted password
       * @param salt Used salt
       * @param clientKey Client key
       * @param storedKey Stored key
       * @param serverKey Server key
       * @param iterations Iterations for slating
       */
      public NewPasswordStringData(String saltedPassword, String salt, String clientKey, String storedKey,
                                   String serverKey, int iterations) {
         this.saltedPassword = saltedPassword;
         this.salt = salt;
         this.clientKey = clientKey;
         this.storedKey = storedKey;
         this.serverKey = serverKey;
         this.iterations = iterations;
      }
   }

   /**
    * New password data in byte array format
    */
   @SuppressWarnings("unused")
   public static class NewPasswordByteArrayData {
      /**
       * Salted password
       */
      public final byte[] saltedPassword;
      /**
       * Used salt
       */
      public final byte[] salt;
      /**
       * Client key
       */
      public final byte[] clientKey;
      /**
       * Stored key
       */
      public final byte[] storedKey;
      /**
       * Server key
       */
      public final byte[] serverKey;
      /**
       * Iterations for slating
       */
      public final int iterations;

      /**
       * Creates new NewPasswordByteArrayData
       * @param saltedPassword Salted password
       * @param salt Used salt
       * @param clientKey Client key
       * @param storedKey Stored key
       * @param serverKey Server key
       * @param iterations Iterations for slating
       */
      public NewPasswordByteArrayData(byte[] saltedPassword, byte[] salt, byte[] clientKey, byte[] storedKey,
                                      byte[] serverKey, int iterations) {

         this.saltedPassword = saltedPassword;
         this.salt = salt;
         this.clientKey = clientKey;
         this.storedKey = storedKey;
         this.serverKey = serverKey;
         this.iterations = iterations;
      }
   }
}


text:
package ezvcard.parameter;

import java.util.Collection;

import ezvcard.property.Interest;

/**
 * Represents a LEVEL parameter for the {@link Interest} property.
 *
 *

 * Supported versions: {@code 4.0}
 *

 * @author Michael Angstadt
 * @see RFC 6715
 */
public class InterestLevel extends VCardParameter {
	private static final VCardParameterCaseClasses<InterestLevel> enums = new VCardParameterCaseClasses<InterestLevel>(InterestLevel.class);

	public static final InterestLevel LOW = new InterestLevel("low");
	public static final InterestLevel MEDIUM = new InterestLevel("medium");
	public static final InterestLevel HIGH = new InterestLevel("high");

	private InterestLevel(String value) {
		super(value);
	}

	/**
	 * Searches for a parameter value that is defined as a static constant in
	 * this class.
	 * @param value the parameter value
	 * @return the object or null if not found
	 */
	public static InterestLevel find(String value) {
		return enums.find(value);
	}

	/**
	 * Searches for a parameter value and creates one if it cannot be found. All
	 * objects are guaranteed to be unique, so they can be compared with
	 * {@code ==} equality.
	 * @param value the parameter value
	 * @return the object
	 */
	public static InterestLevel get(String value) {
		return enums.get(value);
	}

	/**
	 * Gets all of the parameter values that are defined as static constants in
	 * this class.
	 * @return the parameter values
	 */
	public static Collection<InterestLevel> all() {
		return enums.all();
	}
}


text:
function update_checked(checked) {
    $("#checkbox_option").prop("checked", checked);
    table.$(".track_select").prop("checked", checked);
};

function login() {
    var $login = $("#login_dialog");
    $login.dialog("option", "closeOnEscape", false);
    $login.dialog("option", "dialogClass", "login_dialog");
    $(".ui-dialog-titlebar-close", this.parentNode).hide();
    $login.load("Login");
    $login.dialog("open");
    $login.dialog("option", "width", "auto");
};

function logout() {
    $.ajax({
        type: "post",
        url: "Login?operation=logout",
        headers: {
            "Content-Type":"application/x-www-form-urlencoded",
        },
        success: function(data, textStatus, jqXHR) {
        },
        error: function(qXHR, textStatus, errorThrown) {
        }
    });
};

function open_user_manager_dialog() {
    var $userManager = $("

");
    $userManager.dialog( {
        draggable: false,
        modal: true,
        autoOpen: true,
        resizable: false,
        closeOnEscape: true,
        close: function() {
            $(this).dialog("destroy").remove();
        },
        width: "70%"
    } );
    $userManager.load("userPermissions.jsp", null, function() {
        $userManager.dialog('option', 'position', 'center');
    });
    //$userManager.dialog("open");
}


text:
require 'digest/md5'

module Mongo
  module Support

    include Mongo::Conversions
    extend self

    # Commands that may be sent to replica-set secondaries, depending on
    # read preference and tags. All other commands are always run on the primary.
    SECONDARY_OK_COMMANDS = [
      'group',
      'aggregate',
      'collstats',
      'dbstats',
      'count',
      'distinct',
      'geonear',
      'geosearch',
      'geowalk',
      'mapreduce',
      'replsetgetstatus',
      'ismaster',
    ]

    # Generate an MD5 for authentication.
    #
    # @param [String] username
    # @param [String] password
    # @param [String] nonce
    #
    # @return [String] a key for db authentication.
    def auth_key(username, password, nonce)
      Digest::MD5.hexdigest("#{nonce}#{username}#{hash_password(username, password)}")
    end

    # Return a hashed password for auth.
    #
    # @param [String] username
    # @param [String] plaintext
    #
    # @return [String]
    def hash_password(username, plaintext)
      Digest::MD5.hexdigest("#{username}:mongo:#{plaintext}")
    end

    def validate_db_name(db_name)
      unless [String, Symbol].include?(db_name.class)
        raise TypeError, "db_name must be a string or symbol"
      end

      [" ", ".", "$", "/", "\\"].each do |invalid_char|
        if db_name.include? invalid_char
          raise Mongo::InvalidNSName, "database names cannot contain the character '#{invalid_char}'"
        end
      end
      raise Mongo::InvalidNSName, "database name cannot be the empty string" if db_name.empty?
      db_name
    end

    def secondary_ok?(selector)
      command = selector.keys.first.to_s.downcase

      if command == 'mapreduce'
        out = selector.select { |k, v| k.to_s.downcase == 'out' }.first.last
        # mongo looks at the first key in the out object, and doesn't
        # look at the value
        out.is_a?(Hash) && out.keys.first.to_s.downcase == 'inline' ? true : false
      else
        SECONDARY_OK_COMMANDS.member?(command)
      end
    end

    def format_order_clause(order)
      case order
        when Hash, BSON::OrderedHash then hash_as_sort_parameters(order)
        when String, Symbol then string_as_sort_parameters(order)
        when Array then array_as_sort_parameters(order)
        else
          raise InvalidSortValueError, "Illegal sort clause, '#{order.class.name}'; must be of the form " +
            "[['field1', '(ascending|descending)'], ['field2', '(ascending|descending)']]"
      end
    end

    def normalize_seeds(seeds)
      pairs = Array(seeds)
      pairs = [ seeds ] if pairs.last.is_a?(Fixnum)
      pairs = pairs.collect do |hostport|
        if hostport.is_a?(String)
          host, port = hostport.split(':')
          [ host, port && port.to_i || MongoClient::DEFAULT_PORT ]
        else
          hostport
        end
      end
      pairs.length > 1 ? pairs : pairs.first
    end

    def is_i?(value)
      return !!(value =~ /^\d+$/)
    end

    # Determine if a database command has succeeded by
    # checking the document response.
    #
    # @param [Hash] doc
    #
    # @return [Boolean] true if the 'ok' key is either 1 or *true*.
    def ok?(doc)
      doc['ok'] == 1.0 || doc['ok'] == true
    end
  end
end


text:
require 'test_helper'

class CllycmsTest < ActiveSupport::TestCase
  test "truth" do
    assert_kind_of Module, Cllycms
  end
end


text:
<?php

namespace Ecommerce\EcommerceBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class UtilisateursAdressesType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('nom')
            ->add('prenom')
            ->add('telephone')
            ->add('adresse')
            ->add('cp')
            ->add('ville')
            ->add('pays')
            ->add('complement', null, array('required' => false))
            //->add('utilisateur')
        ;
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Ecommerce\EcommerceBundle\Entity\UtilisateursAdresses'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'ecommerce_ecommercebundle_utilisateursadresses';
    }
}


text:
<?php

class Google_Service_CloudKMS_ListImportJobsResponse extends Google_Collection
{
  protected $collection_key = 'importJobs';
  protected $importJobsType = 'Google_Service_CloudKMS_ImportJob';
  protected $importJobsDataType = 'array';
  public $nextPageToken;
  public $totalSize;

  /**
   * @param Google_Service_CloudKMS_ImportJob[]
   */
  public function setImportJobs($importJobs)
  {
    $this->importJobs = $importJobs;
  }
  /**
   * @return Google_Service_CloudKMS_ImportJob[]
   */
  public function getImportJobs()
  {
    return $this->importJobs;
  }
  public function setNextPageToken($nextPageToken)
  {
    $this->nextPageToken = $nextPageToken;
  }
  public function getNextPageToken()
  {
    return $this->nextPageToken;
  }
  public function setTotalSize($totalSize)
  {
    $this->totalSize = $totalSize;
  }
  public function getTotalSize()
  {
    return $this->totalSize;
  }
}


text:
package license

import (
	"context"
	"flag"
	"fmt"

	"github.com/vmware/govmomi/govc/cli"
	"github.com/vmware/govmomi/govc/flags"
	"github.com/vmware/govmomi/license"
)

type remove struct {
	*flags.ClientFlag
	*flags.OutputFlag
}

func init() {
	cli.Register("license.remove", &remove{})
}

func (cmd *remove) Register(ctx context.Context, f *flag.FlagSet) {
	cmd.ClientFlag, ctx = flags.NewClientFlag(ctx)
	cmd.ClientFlag.Register(ctx, f)

	cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx)
	cmd.OutputFlag.Register(ctx, f)
}

func (cmd *remove) Process(ctx context.Context) error {
	if err := cmd.ClientFlag.Process(ctx); err != nil {
		return err
	}
	if err := cmd.OutputFlag.Process(ctx); err != nil {
		return err
	}
	return nil
}

func (cmd *remove) Usage() string {
	return "KEY..."
}

func (cmd *remove) Run(ctx context.Context, f *flag.FlagSet) error {
	client, err := cmd.Client()
	if err != nil {
		return err
	}

	m := license.NewManager(client)
	for _, v := range f.Args() {
		err = m.Remove(ctx, v)
		if err != nil {
			return err
		}
	}

	list, err := m.List(ctx)
	if err != nil {
		return err
	}

	for _, v := range f.Args() {
		for _, l := range list {
			if v == l.LicenseKey {
				return fmt.Errorf("cannot remove license %q", v)
			}
		}
	}

	return nil
}


text:
module OpenNebula
    # we use this file to extend opennebula oca functionalities
    # It contains generic methods that can be used in oca context
    # to help other components

    # receive a object key => value format
    # returns hashed values
    def self.encrypt(opts, token)
        res = {}
        opts.each do |key, value|
            cipher = OpenSSL::Cipher::AES.new(256,:CBC)
            cipher.encrypt.key = token[0..31]
            encrypted = cipher.update(value) + cipher.final
            res[key] = Base64::encode64(encrypted).gsub("\n", "")
        end
        return res
    end

    # receive hashed values (res) with a token
    # returns original values
    def self.decrypt(res, token)
        opts = {}

        res.each do |key, encrypted_value|
            decipher = OpenSSL::Cipher::AES.new(256,:CBC)
            decipher.decrypt
            decipher.key = token[0..31]
            plain = decipher.update(Base64::decode64(encrypted_value)) + decipher.final
            opts[key] = plain
        end
        return opts
    end

end


text:
function global:deactivate ([switch]$NonDestructive) {
    # Revert to original values
    if (Test-Path function:_OLD_VIRTUAL_PROMPT) {
        copy-item function:_OLD_VIRTUAL_PROMPT function:prompt
        remove-item function:_OLD_VIRTUAL_PROMPT
    }

    if (Test-Path env:_OLD_VIRTUAL_PYTHONHOME) {
        copy-item env:_OLD_VIRTUAL_PYTHONHOME env:PYTHONHOME
        remove-item env:_OLD_VIRTUAL_PYTHONHOME
    }

    if (Test-Path env:_OLD_VIRTUAL_PATH) {
        copy-item env:_OLD_VIRTUAL_PATH env:PATH
        remove-item env:_OLD_VIRTUAL_PATH
    }

    if (Test-Path env:VIRTUAL_ENV) {
        remove-item env:VIRTUAL_ENV
    }

    if (!$NonDestructive) {
        # Self destruct!
        remove-item function:deactivate
    }
}

deactivate -nondestructive

$env:VIRTUAL_ENV="D:\projeto\Brapci\py\venv"

if (! $env:VIRTUAL_ENV_DISABLE_PROMPT) {
    # Set the prompt to include the env name
    # Make sure _OLD_VIRTUAL_PROMPT is global
    function global:_OLD_VIRTUAL_PROMPT {""}
    copy-item function:prompt function:_OLD_VIRTUAL_PROMPT
    function global:prompt {
        Write-Host -NoNewline -ForegroundColor Green '(venv) '
        _OLD_VIRTUAL_PROMPT
    }
}

# Clear PYTHONHOME
if (Test-Path env:PYTHONHOME) {
    copy-item env:PYTHONHOME env:_OLD_VIRTUAL_PYTHONHOME
    remove-item env:PYTHONHOME
}

# Add the venv to the PATH
copy-item env:PATH env:_OLD_VIRTUAL_PATH
$env:PATH = "$env:VIRTUAL_ENV\Scripts;$env:PATH"


text:
module.exports = {

  name: 'Project',

  description: 'React Project',

  directory: true,

  params: ['Name'],

  rules: function(config) {
    return({
      items: [
        {
          destinationFile: '/',
          sourceContentFile: '/'
        }
      ]
    })

  }

}


text:
require 'faye/websocket'
require 'rack'
require 'thin'

Faye::WebSocket.load_adapter('thin')

module WebsocketRails
  # The +ConnectionManager+ class implements the core Rack application that handles
  # incoming WebSocket connections.
  class ConnectionManager

    include Logging

    SuccessfulResponse = [200,{'Content-Type' => 'text/plain'},['success']].freeze
    BadRequestResponse = [400,{'Content-Type' => 'text/plain'},['invalid']].freeze
    ExceptionResponse  = [500,{'Content-Type' => 'text/plain'},['exception']].freeze

    # Contains a Hash of currently open connections.
    # @return [Hash]
    attr_reader :connections

    # Contains the {Dispatcher} instance for the active server.
    # @return [Dispatcher]
    attr_reader :dispatcher

    # Contains the {Synchronization} instance for the active server.
    # @return [Synchronization]
    attr_reader :synchronization

    def self.mount
      @mount_point ||= new
    end

    def initialize
      @connections = {}
      @dispatcher  = Dispatcher.new(self)

      if WebsocketRails.synchronize?
        EM.next_tick do
          Fiber.new {
            Synchronization.synchronize!
            EM.add_shutdown_hook { Synchronization.shutdown! }
          }.resume
        end
      end
    end

    def inspect
      "websocket_rails"
    end

    # Primary entry point for the Rack application
    def call(env)
      request = ActionDispatch::Request.new(env)

      if request.post?
        response = parse_incoming_event(request.params)
      else
        response = open_connection(request)
      end

      response
    rescue InvalidConnectionError
      BadRequestResponse
    end

    private

    def parse_incoming_event(params)
      connection = find_connection_by_id(params["client_id"])
      connection.on_message params["data"]
      SuccessfulResponse
    end

    def find_connection_by_id(id)
      connections[id] || raise(InvalidConnectionError)
    end

    # Opens a persistent connection using the appropriate {ConnectionAdapter}. Stores
    # active connections in the {connections} Hash.
    def open_connection(request)
      connection = ConnectionAdapters.establish_connection(request, dispatcher)

      assign_connection_id connection
      register_user_connection connection

      connections[connection.id] = connection

      info "Connection opened: #{connection}"
      connection.rack_response
    end

    def close_connection(connection)
      WebsocketRails.channel_manager.unsubscribe connection
      destroy_user_connection connection

      connections.delete connection.id

      info "Connection closed: #{connection}"
      connection = nil
    end
    public :close_connection

    def assign_connection_id(connection)
      begin
        id = SecureRandom.hex(10)
      end while connections.has_key?(id)

      connection.id = id
    end

    def register_user_connection(connection)
      return unless connection.user_connection?
      WebsocketRails.users[connection.user_identifier] = connection
    end

    def destroy_user_connection(connection)
      return unless connection.user_connection?
      WebsocketRails.users.delete(connection)
    end

  end
end


text:
/***
* Inferno Engine v4 2015-2017
* Written by Tomasz "Rex Dex" Jonarski
*
* [#filter: rtti\types\function #]
***/

#pragma once

namespace base
{
    namespace rtti
    {

        //---

        class IFunctionStackFrame;

        // "calling convention" for scripted functions
        struct FunctionCallingParams
        {
            static const Uint32 MAX_ARGS = 16;

            // where should we write the return value, points to memory location prepared for return type T
            // NOTE: this may be NULL if we are not interested in the return value
            void* m_returnPtr;

            // memory location of the argument DATA
            // if function argument is a reference this will be the actual place to suck the data
            // if function argument is passed by value we will have to get value from the memory at this location
            void* m_argumentsPtr[MAX_ARGS];

            //--

            template< typename T >
            FORCEINLINE void writeResult(T val) const
            {
                *(typename std::remove_cv<T*>::type)m_returnPtr = std::move(val);
            }

            template< typename T, Uint32 Arg >
            FORCEINLINE T getArg() const
            {
                typedef typename std::remove_reference< typename std::remove_pointer<T>::type >::type InnerT;
                typedef typename std::remove_cv<InnerT>::type SafeT;

                return *(InnerT*) m_argumentsPtr[Arg];
            }
        };

        //---

#ifdef PLATFORM_MSVC
		class UnknownClass {};
		typedef void(__cdecl UnknownClass::* TMethodPtr)();
#else
		class UnknownClass;
		typedef void (UnknownClass::* TMethodPtr)();
#endif
        typedef void (*TFunctionPtr)();

        // pointer to a function, supports different types
        // based on AngleScript implementation
        struct FunctionPointer
        {
            FORCEINLINE FunctionPointer(Uint8 f = 0)
            {
                memzero(ptr.dummy, sizeof(ptr.dummy));
                flag = f;
            }

            FORCEINLINE operator bool() const
            {
                return flag != 0;
            }

            void CopyMethodPtr(const void *mthdPtr, size_t size)
            {
                for( size_t n = 0; n < size; n++ )
                    ptr.dummy[n] = reinterpret_cast<const char *>(mthdPtr)[n];
            }

            union
            {
                // The largest known method point is 20 bytes (MSVC 64bit),
                // but with 8byte alignment this becomes 24 bytes. So we need
                // to be able to store at least that much.
                char dummy[25];
                struct {TMethodPtr mthd; char dummy[25-sizeof(TMethodPtr)];} m;
                struct {TFunctionPtr func; char dummy[25-sizeof(TFunctionPtr )];} f;
            } ptr;

            Uint8 flag; // 1 = generic, 2 = global func, 3 = method
        };

        //---

        //---

        template <class T>
        FORCEINLINE FunctionPointer MakeFunctionHelper(T func)
        {
            FunctionPointer p(2);

#ifdef PLATFORM_64BIT
            p.ptr.f.func = reinterpret_cast<TFunctionPtr>(size_t(func));
#else
            p.ptr.f.func = reinterpret_cast<TFunctionPtr>(func);
#endif
            return p;
        }

        typedef void (UnknownClass::*TSimpleMethod)();
        const int SINGLE_PTR_SIZE = sizeof(TSimpleMethod);

        template <int N>
        struct MakeMethodHelper
        {
            template<class M>
            static FunctionPointer Convert(M Mthd)
            {
                int ERROR_UnsupportedMethodPtr[N-100];

                FunctionPointer p(0);
                return p;
            }
        };

        template <>
        struct MakeMethodHelper<SINGLE_PTR_SIZE>
        {
            template<class M>
            static FunctionPointer Convert(M Mthd)
            {
                FunctionPointer p(3);
                p.CopyMethodPtr(&Mthd, SINGLE_PTR_SIZE);
                return p;
            }
        };

        template <>
        struct MakeMethodHelper<SINGLE_PTR_SIZE+1*sizeof(int)>
        {
            template <class M>
            static FunctionPointer Convert(M Mthd)
            {
                FunctionPointer p(3);
                p.CopyMethodPtr(&Mthd, SINGLE_PTR_SIZE+sizeof(int));
                return p;
            }
        };

        template <>
        struct MakeMethodHelper<SINGLE_PTR_SIZE+2*sizeof(int)>
        {
            template <class M>
            static FunctionPointer Convert(M Mthd)
            {
                FunctionPointer p(3);
                p.CopyMethodPtr(&Mthd, SINGLE_PTR_SIZE+2*sizeof(int));

                // Microsoft has a terrible optimization on class methods with virtual inheritance.
                // They are hardcoding an important offset, which is not coming in the method pointer.

#if defined(PLATFORM_MSVC) && !defined(PLATFORM_64BIT)
                // Method pointers for virtual inheritance is not supported,
                    // as it requires the location of the vbase table, which is
                    // only available to the C++ compiler, but not in the method
                    // pointer.

                    // You can get around this by forward declaring the class and
                    // storing the sizeof its method pointer in a constant. Example:

                    // class ClassWithVirtualInheritance;
                    // const int ClassWithVirtualInheritance_workaround = sizeof(void ClassWithVirtualInheritance::*());

                    // This will force the compiler to use the unknown type
                    // for the class, which falls under the next case

                    // Copy the virtual table index to the 4th dword so that AngelScript
                    // can properly detect and deny the use of methods with virtual inheritance.
                    *(reinterpret_cast<Uint32*>(&p)+3) = *(reinterpret_cast<Uint32*>(&p)+2);
#endif

                return p;
            }
        };

        template <>
        struct MakeMethodHelper<SINGLE_PTR_SIZE+3*sizeof(int)>
        {
            template <class M>
            static FunctionPointer Convert(M Mthd)
            {
                FunctionPointer p(3);
                p.CopyMethodPtr(&Mthd, SINGLE_PTR_SIZE+3*sizeof(int));
                return p;
            }
        };

        template <>
        struct MakeMethodHelper<SINGLE_PTR_SIZE+4*sizeof(int)>
        {
            template <class M>
            static FunctionPointer Convert(M Mthd)
            {
                // On 64bit platforms with 8byte data alignment
                // the unknown class method pointers will come here.

                FunctionPointer p(3);
                p.CopyMethodPtr(&Mthd, SINGLE_PTR_SIZE+4*sizeof(int));
                return p;
            }
        };

        //---

        // native calling wrapper pointer
        typedef void (*TFunctionWrapperPtr)(void* contextPtr, const FunctionPointer& func, const FunctionCallingParams& params);

        //---

        // JITed function wrapper pointer
        typedef void (*TFunctionJittedWrapperPtr)(void* context, const IFunctionStackFrame* stackFrame, const rtti::FunctionCallingParams* params);

        //---

    } // rtti
} // base

#define MakeMethodPtr(c,m) base::rtti::MakeMethodHelper<sizeof(void (c::*)())>::Convert((void (c::*)())(&c::m))
#define MakeFunctionPtr(f) base::rtti::MakeFunctionHelper(f)


text:
'use strict';

const client = require('./client');

module.exports = (
  client.getAsync('shortUrls')
    .then(res => (JSON.parse(res) || []))
);


text:
import { app } from "electron"

export interface WindowEvent {
  sender: Electron.BrowserWindow
}

export interface WebContentsEvent {
  sender: Electron.WebContents
}

function isEnvTrue(v: string): boolean {
  return v != null && (v.length === 0 || v === "true")
}

const isLogEvent = isEnvTrue(process.env.LOG_EVENTS)

function addHandler(emitter: Electron.EventEmitter, event: string, handler: (...args: any[]) => void) {
  if (isLogEvent) {
    emitter.on(event, function (...args: any[]) {
      console.log("%s %s", event, args)
      handler.apply(this, args)
    })
  }
  else {
    emitter.on(event, handler)
  }
}

export class WebContentsSignal {
  constructor(private emitter: Electron.WebContents) {
  }

  navigated(handler: (event: WebContentsEvent, url: string) => void): WebContentsSignal {
    addHandler(this.emitter, "did-navigate", handler)
    return this
  }

  navigatedInPage(handler: (event: WebContentsEvent, url: string) => void): WebContentsSignal {
    addHandler(this.emitter, "did-navigate-in-page", handler)
    return this
  }

  frameLoaded(handler: (event: any, isMainFrame: boolean) => void): WebContentsSignal {
    addHandler(this.emitter, "did-frame-finish-load", handler)
    return this
  }
}

export class AppSignal {
  private emitter = app

  windowBlurred(handler: (event: any, window: Electron.BrowserWindow) => void): AppSignal {
    addHandler(this.emitter, "browser-window-blur", handler)
    return this
  }

  windowFocused(handler: (event: any, window: Electron.BrowserWindow) => void): AppSignal {
    addHandler(this.emitter, "browser-window-focus", handler)
    return this
  }
}


text:
#
# Main Makefile, intended for use on Linux/X11 and compatible platforms
# using GNU Make.
#
# It should guess the paths to the game dependencies on its own, except for
# Boost which is assumed to be installed to the default locations. If you have
# installed Boost to a non-standard location, you will need to override CXXFLAGS
# and LDFLAGS with any applicable -I and -L arguments.
#
# The main options are:
#
#   CCACHE           The ccache binary that should be used when USE_CCACHE is
#                     enabled (see below). Defaults to 'ccache'.
#   CXX              C++ compiler comand line.
#   CXXFLAGS         Additional C++ compiler options.
#   OPTIMIZE         If set to 'yes' (default), builds with compiler
#                     optimizations enabled (-O2). You may alternatively use
#                     CXXFLAGS to set your own optimization options.
#   LDFLAGS          Additional linker options.
#   USE_CCACHE       If set to 'yes' (default), builds using the CCACHE binary
#                     to run the compiler. If ccache is not installed (i.e.
#                     found in PATH), this option has no effect.
#

OPTIMIZE=yes
CCACHE?=ccache
USE_CCACHE?=$(shell which $(CCACHE) 2>&1 > /dev/null && echo yes)
ifneq ($(USE_CCACHE),yes)
CCACHE=
endif

ifeq ($(OPTIMIZE),yes)
BASE_CXXFLAGS += -O2
endif

ifeq ($(CXX), g++)
GCC_GTEQ_490 := $(shell expr `$(CXX) -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/'` \>= 40900)
ifeq "$(GCC_GTEQ_490)" "1"
BASE_CXXFLAGS += -fdiagnostics-color=auto -fsanitize=undefined
endif
endif

SDL2_CONFIG?=sdl2-config
USE_SDL2?=$(shell which $(SDL2_CONFIG) 2>&1 > /dev/null && echo yes)

ifneq ($(USE_SDL2),yes)
$(error SDL2 not found, SDL-1.2 is not supported)
endif

PROTOC ?= protoc
PROTOC_FLAGS = --cpp_out=src --proto_path=src

# Initial compiler options, used before CXXFLAGS and CPPFLAGS.
# -Wno-reorder -Wno-unused-variable added to make noiseutils.cpp build
BASE_CXXFLAGS += -std=c++11 -g -rdynamic -fno-inline-functions \
	-fthreadsafe-statics -Werror -Wall -Wno-reorder -Wno-unused-variable

# Compiler include options, used after CXXFLAGS and CPPFLAGS.
INC := -Isrc -Iinclude -Isrc/lua -ILuaBridge/Source/LuaBridge $(shell pkg-config --cflags x11 sdl2 SDL2_image SDL2_ttf libpng zlib libenet protobuf)

ifdef STEAM_RUNTIME_ROOT
	INC += -I$(STEAM_RUNTIME_ROOT)/include
endif

# Linker library options.
LIBS := $(shell pkg-config --libs x11 gl ) \
	$(shell pkg-config --libs sdl2 SDL2_image libpng zlib protobuf libenet) \
	-lSDL2_ttf -lSDL2_mixer -lboost_system -lboost_regex -lboost_filesystem -lboost_chrono -lboost_thread -lnoise

PBSRCS := $(wildcard src/*.proto)
PBOBJS := $(PBSRCS:.proto=.pb.o)
PBGENS := $(PBSRCS:.proto=.pb.cc)

SRCS := $(wildcard src/*.cpp)
OBJS := $(SRCS:.cpp=.o)

include Makefile.common

src/%.pb.cc: src/%.proto
	$(PROTOC) $(PROTOC_FLAGS) $<

src/%.pb.o : src/%.pb.cc
	@echo "Building:" $<
	@$(CCACHE) $(CXX) $(BASE_CXXFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(INC) -c -o $@ $<
	@$(CXX) $(BASE_CXXFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(INC) -MM $< > $*.d
	@mv -f $*.d $*.d.tmp
	@sed -e 's|.*:|src/$*.o:|' < $*.d.tmp > src/$*.d
	@sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
		sed -e 's/^ *//' -e 's/$$/:/' >> src/$*.d
	@rm -f $*.d.tmp

src/%.o : src/%.cpp
	@echo "Building:" $<
	@$(CCACHE) $(CXX) $(BASE_CXXFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(INC) -c -o $@ $<
	@$(CXX) $(BASE_CXXFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(INC) -MM $< > $*.d
	@mv -f $*.d $*.d.tmp
	@sed -e 's|.*:|src/$*.o:|' < $*.d.tmp > src/$*.d
	@sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
		sed -e 's/^ *//' -e 's/$$/:/' >> src/$*.d
	@rm -f $*.d.tmp

src/lua/%.o : src/lua/%.c
	@echo "Building:" $<
	@$(CCACHE) $(CXX) $(BASE_CXXFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(INC) -c -o $@ $<

HexWarfare: $(PBOBJS) $(OBJS) $(ogl_objects) $(sdl_objects) liblua.a
	@echo "Linking : HexWarfare"
	@$(CCACHE) $(CXX) \
		$(BASE_CXXFLAGS) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(INC) \
		$(OBJS) $(PBOBJS) -o HexWarfare \
		$(LIBS) -fthreadsafe-statics

liblua.a: $(lua_objects)
	@echo "Creating local copy of lua library"
	@$(AR) -rcs $@ $(lua_objects)

# pull in dependency info for *existing* .o files
-include $(OBJS:.o=.d)

all: HexWarfare

clean:
	rm -f src/*.o src/*.d *.o *.d HexWarfare $(PBOBJS) $(PBGENS)


text:
/**
 * created at 12:22:58 AM Jan 13, 2011
 */
using System;
using SharpBox2D.Callbacks;
using SharpBox2D.Collision;
using SharpBox2D.Collision.Shapes;
using SharpBox2D.Common;
using SharpBox2D.Dynamics;
using SharpBox2D.Dynamics.Contacts;
using SharpBox2D.Dynamics.Joints;
using SharpBox2D.TestBed.Framework;

namespace SharpBox2D.TestBed.Tests
{

/**
 * @author Daniel Murphy
 */

    public class TheoJansen : TestbedTest
    {
        private static long CHASSIS_TAG = 1;
        private static long WHEEL_TAG = 2;
        private static long MOTOR_TAG = 8;

        private Vec2 m_offset = new Vec2();
        private Body m_chassis;
        private Body m_wheel;
        private RevoluteJoint m_motorJoint;
        private bool m_motorOn;
        private float m_motorSpeed;

        public override long getTag(Body argBody)
        {
            if (argBody == m_chassis)
            {
                return CHASSIS_TAG;
            }
            else if (argBody == m_wheel)
            {
                return WHEEL_TAG;
            }
            return default(long);
        }

        public override long getTag(Joint argJoint)
        {
            if (argJoint == m_motorJoint)
            {
                return MOTOR_TAG;
            }
            return default(long);
        }

        public override void processBody(Body argBody, long argTag)
        {
            if (argTag == CHASSIS_TAG)
            {
                m_chassis = argBody;
            }
            else if (argTag == WHEEL_TAG)
            {
                m_wheel = argBody;
            }
        }

        public override void processJoint(Joint argJoint, long argTag)
        {
            if (argTag == MOTOR_TAG)
            {
                m_motorJoint = (RevoluteJoint) argJoint;
                m_motorOn = m_motorJoint.isMotorEnabled();
            }
        }

        public override bool isSaveLoadEnabled()
        {
            return true;
        }

        public override void initTest(bool argDeserialized)
        {
            if (argDeserialized)
            {
                return;
            }

            m_offset.set(0.0f, 8.0f);
            m_motorSpeed = 2.0f;
            m_motorOn = true;
            Vec2 pivot = new Vec2(0.0f, 0.8f);

            // Ground
            {
                BodyDef bd = new BodyDef();
                Body ground = getWorld().createBody(bd);

                EdgeShape shape = new EdgeShape();
                shape.set(new Vec2(-50.0f, 0.0f), new Vec2(50.0f, 0.0f));
                ground.createFixture(shape, 0.0f);

                shape.set(new Vec2(-50.0f, 0.0f), new Vec2(-50.0f, 10.0f));
                ground.createFixture(shape, 0.0f);

                shape.set(new Vec2(50.0f, 0.0f), new Vec2(50.0f, 10.0f));
                ground.createFixture(shape, 0.0f);
            }

            // Balls
            for (int i = 0; i < 40; ++i)
            {
                CircleShape shape = new CircleShape();
                shape.m_radius = 0.25f;

                BodyDef bd = new BodyDef();
                bd.type = BodyType.DYNAMIC;
                bd.position.set(-40.0f + 2.0f*i, 0.5f);

                Body body = getWorld().createBody(bd);
                body.createFixture(shape, 1.0f);
            }

            // Chassis
            {
                PolygonShape shape = new PolygonShape();
                shape.setAsBox(2.5f, 1.0f);

                FixtureDef sd = new FixtureDef();
                sd.density = 1.0f;
                sd.shape = shape;
                sd.filter.groupIndex = -1;
                BodyDef bd = new BodyDef();
                bd.type = BodyType.DYNAMIC;
                bd.position.set(pivot);
                bd.position.addLocal(m_offset);
                m_chassis = getWorld().createBody(bd);
                m_chassis.createFixture(sd);
            }

            {
                CircleShape shape = new CircleShape();
                shape.m_radius = 1.6f;

                FixtureDef sd = new FixtureDef();
                sd.density = 1.0f;
                sd.shape = shape;
                sd.filter.groupIndex = -1;
                BodyDef bd = new BodyDef();
                bd.type = BodyType.DYNAMIC;
                bd.position.set(pivot);
                bd.position.addLocal(m_offset);
                m_wheel = getWorld().createBody(bd);
                m_wheel.createFixture(sd);
            }

            {
                RevoluteJointDef jd = new RevoluteJointDef();

                jd.initialize(m_wheel, m_chassis, pivot.add(m_offset));
                jd.collideConnected = false;
                jd.motorSpeed = m_motorSpeed;
                jd.maxMotorTorque = 400.0f;
                jd.enableMotor = m_motorOn;
                m_motorJoint = (RevoluteJoint) getWorld().createJoint(jd);
            }

            Vec2 wheelAnchor;

            wheelAnchor = pivot.add(new Vec2(0.0f, -0.8f));

            createLeg(-1.0f, wheelAnchor);
            createLeg(1.0f, wheelAnchor);

            m_wheel.setTransform(m_wheel.getPosition(), 120.0f*MathUtils.PI/180.0f);
            createLeg(-1.0f, wheelAnchor);
            createLeg(1.0f, wheelAnchor);

            m_wheel.setTransform(m_wheel.getPosition(), -120.0f*MathUtils.PI/180.0f);
            createLeg(-1.0f, wheelAnchor);
            createLeg(1.0f, wheelAnchor);
        }

        private void createLeg(float s, Vec2 wheelAnchor)
        {
            Vec2 p1 = new Vec2(5.4f*s, -6.1f);
            Vec2 p2 = new Vec2(7.2f*s, -1.2f);
            Vec2 p3 = new Vec2(4.3f*s, -1.9f);
            Vec2 p4 = new Vec2(3.1f*s, 0.8f);
            Vec2 p5 = new Vec2(6.0f*s, 1.5f);
            Vec2 p6 = new Vec2(2.5f*s, 3.7f);

            FixtureDef fd1 = new FixtureDef();
            FixtureDef fd2 = new FixtureDef();
            fd1.filter.groupIndex = -1;
            fd2.filter.groupIndex = -1;
            fd1.density = 1.0f;
            fd2.density = 1.0f;

            PolygonShape poly1 = new PolygonShape();
            PolygonShape poly2 = new PolygonShape();

            if (s > 0.0f)
            {
                Vec2[] vertices = new Vec2[3];

                vertices[0] = p1;
                vertices[1] = p2;
                vertices[2] = p3;
                poly1.set(vertices, 3);

                vertices[0] = new Vec2();
                vertices[1] = p5.sub(p4);
                vertices[2] = p6.sub(p4);
                poly2.set(vertices, 3);
            }
            else
            {
                Vec2[] vertices = new Vec2[3];

                vertices[0] = p1;
                vertices[1] = p3;
                vertices[2] = p2;
                poly1.set(vertices, 3);

                vertices[0] = new Vec2();
                vertices[1] = p6.sub(p4);
                vertices[2] = p5.sub(p4);
                poly2.set(vertices, 3);
            }

            fd1.shape = poly1;
            fd2.shape = poly2;

            BodyDef bd1 = new BodyDef(), bd2 = new BodyDef();
            bd1.type = BodyType.DYNAMIC;
            bd2.type = BodyType.DYNAMIC;
            bd1.position = m_offset;
            bd2.position = p4.add(m_offset);

            bd1.angularDamping = 10.0f;
            bd2.angularDamping = 10.0f;

            Body body1 = getWorld().createBody(bd1);
            Body body2 = getWorld().createBody(bd2);

            body1.createFixture(fd1);
            body2.createFixture(fd2);

            DistanceJointDef djd = new DistanceJointDef();

            // Using a soft distance constraint can reduce some jitter.
            // It also makes the structure seem a bit more fluid by
            // acting like a suspension system.
            djd.dampingRatio = 0.5f;
            djd.frequencyHz = 10.0f;

            djd.initialize(body1, body2, p2.add(m_offset), p5.add(m_offset));
            getWorld().createJoint(djd);

            djd.initialize(body1, body2, p3.add(m_offset), p4.add(m_offset));
            getWorld().createJoint(djd);

            djd.initialize(body1, m_wheel, p3.add(m_offset), wheelAnchor.add(m_offset));
            getWorld().createJoint(djd);

            djd.initialize(body2, m_wheel, p6.add(m_offset), wheelAnchor.add(m_offset));
            getWorld().createJoint(djd);

            RevoluteJointDef rjd = new RevoluteJointDef();

            rjd.initialize(body2, m_chassis, p4.add(m_offset));
            getWorld().createJoint(rjd);
        }

        public override void keyPressed(char key, int argKeyCode)
        {
            switch (key)
            {
                case 'a':
                    m_motorJoint.setMotorSpeed(-m_motorSpeed);
                    break;

                case 's':
                    m_motorJoint.setMotorSpeed(0.0f);
                    break;

                case 'd':
                    m_motorJoint.setMotorSpeed(m_motorSpeed);
                    break;

                case 'm':
                    m_motorJoint.enableMotor(!m_motorJoint.isMotorEnabled());
                    break;
            }
        }

        public override void step(TestbedSettings settings)
        {
            base.step(settings);
            addTextLine("Keys: left = a, brake = s, right = d, toggle motor = m");
        }

        public override string getTestName()
        {
            return "TheoJansen Walker";
        }
    }
}


text:
namespace pmlc::conversion::pxa_to_affine {

#define GEN_PASS_CLASSES
#include "pmlc/conversion/pxa_to_affine/passes.h.inc"

} // namespace pmlc::conversion::pxa_to_affine


text:
/* Pixel ratio of 2. Background-size is 1/2 = 50% (of a 200px image) */
@media only screen and (-moz-min-device-pixel-ratio: 2), only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-device-pixel-ratio: 2) {
  span.apico-black {
    background-image: url("../img/ap_icons_black_2x_social.png");
  }
  span.apico-color {
    background-image: url("../img/ap_icons_color_2x_social.png");
  }
  span.apico-white {
    background-image: url("../img/ap_icons_white_2x_social.png");
  }
}
span.apico-black {
  background-image: url("../img/ap_icons_black_social.png");
}
span.apico-color {
  background-image: url("../img/ap_icons_color_social.png");
}
span.apico-white {
  background-image: url("../img/ap_icons_white_social.png");
}
.apico{
	list-style-type: none;
	line-height: 32px;
    vertical-align: middle;
}

.apico-black,
.apico-color,
.apico-white {
  display: inline-block;
  width: 32px;
  height: 32px;
  line-height: 32px;
  vertical-align: middle;
}

/*
body{
	background-color: #BBBBBB;
}

body h2{
	color: #FFFFFF;
}
*/

/********************************
* social-sport
*
***/
.apico-twitter {
  background-position: 0px -2px;
}
/*0 2px off*/
.apico-facebook {
  background-position: -51px 0px;
}
/*1 0 off*/
.apico-google-plus {
  background-position: -100px 0px;
}
.apico-linkedin {
  background-position: -150px -2px;
}
/*0 2px off*/
.apico-pinterest {
  background-position: -200px 0px;
}
.apico-flickr {
  background-position: -250px 0px;
}
.apico-rss {
  background-position: -300px -2px;
}
.apico-vimeo {
  background-position: -350px 0px;
}
.apico-bebo {
  background-position: -400px 0px;
}
.apico-github {
  background-position: -450px 0px;
}
.apico-picasa {
  background-position: -500px 0px;
}
.apico-skype {
  background-position: -550px 0px;
}
.apico-twitter-square {
  background-position: 0px -50px;
}
.apico-facebook-square {
  background-position: -50px -50px;
}
.apico-google-plus-square {
  background-position: -100px -50px;
}
.apico-linkedin-square {
  background-position: -150px -50px;
}
.apico-pinterest-square {
  background-position: -200px -50px;
}
.apico-flickr-square {
  background-position: -250px -50px;
}
.apico-rss-square {
  background-position: -300px -50px;
}
.apico-vimeo-square {
  background-position: -350px -50px;
}
.apico-bebo-square {
  background-position: -400px -50px;
}
.apico-github-square {
  background-position: -450px -50px;
}
.apico-picasa-square {
  background-position: -500px -50px;
}
.apico-skype-square {
  background-position: -550px -50px;
}
.apico-twitter-circle {
  background-position: 0px -100px;
}
.apico-facebook-circle {
  background-position: -50px -100px;
}
.apico-google-plus-circle {
  background-position: -100px -100px;
}
.apico-linkedin-circle {
  background-position: -150px -100px;
}
.apico-pinterest-circle {
  background-position: -200px -100px;
}
.apico-flickr-circle {
  background-position: -250px -100px;
}
.apico-rss-circle {
  background-position: -300px -100px;
}
.apico-vimeo-circle {
  background-position: -350px -100px;
}
.apico-bebo-circle {
  background-position: -400px -100px;
}
.apico-github-circle {
  background-position: -450px -100px;
}
.apico-picasa-circle {
  background-position: -500px -100px;
}
.apico-skype-circle {
  background-position: -550px -100px;
}
.apico-youtube {
  background-position: 0px -150px;
}
.apico-dribbble {
  background-position: -50px -150px;
}
.apico-zerply {
  background-position: -100px -150px;
}
.apico-wikipedia {
  background-position: -150px -150px;
}
.apico-stumbleupon {
  background-position: -200px -150px;
}
.apico-grooveshark {
  background-position: -250px -150px;
}
.apico-digg {
  background-position: -299px -153px;
}
/*1 3px off*/.apico-behance {
  background-position: -350px -153px;
}
/*0 2px off*/
.apico-technoratie {
  background-position: -400px -150px;
}
.apico-blogger {
  background-position: -450px -150px;
}
.apico-tumblr {
  background-position: -500px -150px;
}
.apico-dropbox {
  background-position: -550px -150px;
}
.apico-youtube-square {
  background-position: 0px -200px;
}
.apico-dribbble-square {
  background-position: -50px -200px;
}
.apico-zerply-square {
  background-position: -100px -200px;
}
.apico-wikipedia-square {
  background-position: -150px -200px;
}
.apico-stumbleupon-square {
  background-position: -200px -200px;
}
.apico-grooveshark-square {
  background-position: -250px -200px;
}
.apico-digg-square {
  background-position: -300px -200px;
}
.apico-behance-square {
  background-position: -350px -200px;
}
.apico-technoratie-square {
  background-position: -400px -200px;
}
.apico-blogger-square {
  background-position: -450px -200px;
}
.apico-tumblr-square {
  background-position: -500px -200px;
}
.apico-dropbox-square {
  background-position: -550px -200px;
}
.apico-youtube-circle {
  background-position: 0px -250px;
}
.apico-dribbble-circle {
  background-position: -50px -250px;
}
.apico-zerply-circle {
  background-position: -100px -250px;
}
.apico-wikipedia-circle {
  background-position: -150px -250px;
}
.apico-stumbleupon-circle {
  background-position: -200px -250px;
}
.apico-grooveshark-circle {
  background-position: -250px -250px;
}
.apico-digg-circle {
  background-position: -300px -250px;
}
.apico-behance-circle {
  background-position: -350px -250px;
}
.apico-technoratie-circle {
  background-position: -400px -250px;
}
.apico-blogger-circle {
  background-position: -450px -250px;
}
.apico-tumblr-circle {
  background-position: -500px -250px;
}
.apico-dropbox-circle {
  background-position: -550px -250px;
}
.apico-fingers2 {
  background-position: 0px -300px;
}
.apico-fingers3 {
  background-position: -50px -300px;
}
.apico-fingers4 {
  background-position: -100px -300px;
}
.apico-fingers5 {
  background-position: -150px -300px;
}
.apico-fingers-spread {
  background-position: -200px -300px;
}
.apico-fingers-wave {
  background-position: -250px -300px;
}
.apico-fingers-drag {
  background-position: -300px -300px;
}
.apico-fingers-touch {
  background-position: -350px -300px;
}
.apico-fingers-scroll {
  background-position: -400px -300px;
}
.apico-fingers-scroll-down {
  background-position: -450px -300px;
}
.apico-fingers-slide {
  background-position: -500px -300px;
}
.apico-fingers5-spread {
  background-position: -550px -300px;
}


text: Back


text:
from __future__ import absolute_import

from exam import fixture
from six.moves.urllib.parse import parse_qs

from sentry.models import ApiApplication, ApiAuthorization, ApiGrant, ApiToken
from sentry.testutils import TestCase

class OAuthAuthorizeCodeTest(TestCase):
    @fixture
    def path(self):
        return '/oauth/authorize/'

    def setUp(self):
        super(OAuthAuthorizeCodeTest, self).setUp()
        self.application = ApiApplication.objects.create(
            owner=self.user,
            redirect_uris='https://example.com',
        )

    def test_missing_response_type(self):
        self.login_as(self.user)

        resp = self.client.get('{}?redirect_uri={}&client_id={}'.format(
            self.path,
            'https://example.com',
            self.application.client_id,
        ))

        assert resp.status_code == 302
        assert resp['Location'] == 'https://example.com?error=unsupported_response_type'

    def test_invalid_response_type(self):
        self.login_as(self.user)

        resp = self.client.get('{}?response_type=foobar&redirect_uri={}&client_id={}'.format(
            self.path,
            'https://example.com',
            self.application.client_id,
        ))

        assert resp.status_code == 302
        assert resp['Location'] == 'https://example.com?error=unsupported_response_type'

    def test_missing_client_id(self):
        self.login_as(self.user)

        resp = self.client.get('{}?response_type=code&redirect_uri={}'.format(
            self.path,
            'https://example.com',
        ))

        assert resp.status_code == 200
        self.assertTemplateUsed('sentry/oauth-error.html')
        assert resp.context['error'] == 'Missing or invalid client_id parameter.'

    def test_invalid_scope(self):
        self.login_as(self.user)

        resp = self.client.get('{}?response_type=code&client_id={}&scope=foo'.format(
            self.path,
            self.application.client_id,
        ))

        assert resp.status_code == 302
        assert resp['Location'] == 'https://example.com?error=invalid_scope'

    def test_invalid_redirect_uri(self):
        self.login_as(self.user)

        resp = self.client.get('{}?response_type=code&redirect_uri=https://google.com&client_id={}'.format(
            self.path,
            self.application.client_id,
        ))

        assert resp.status_code == 200
        self.assertTemplateUsed('sentry/oauth-error.html')
        assert resp.context['error'] == 'Missing or invalid redirect_uri parameter.'

    def test_minimal_params_approve_flow(self):
        self.login_as(self.user)

        resp = self.client.get('{}?response_type=code&client_id={}'.format(
            self.path,
            self.application.client_id,
        ))

        assert resp.status_code == 200
        self.assertTemplateUsed('sentry/oauth-authorize.html')
        assert resp.context['application'] == self.application

        resp = self.client.post(self.path, {
            'op': 'approve',
        })

        grant = ApiGrant.objects.get(user=self.user)
        assert grant.redirect_uri == self.application.get_default_redirect_uri()
        assert grant.application == self.application
        assert not grant.get_scopes()

        assert resp.status_code == 302
        assert resp['Location'] == 'https://example.com?code={}'.format(
            grant.code,
        )

        authorization = ApiAuthorization.objects.get(
            user=self.user,
            application=self.application,
        )
        assert authorization.get_scopes() == grant.get_scopes()

    def test_minimal_params_deny_flow(self):
        self.login_as(self.user)

        resp = self.client.get('{}?response_type=code&client_id={}'.format(
            self.path,
            self.application.client_id,
        ))

        assert resp.status_code == 200
        self.assertTemplateUsed('sentry/oauth-authorize.html')
        assert resp.context['application'] == self.application

        resp = self.client.post(self.path, {
            'op': 'deny',
        })

        assert resp.status_code == 302
        assert resp['Location'] == 'https://example.com?error=access_denied'

        assert not ApiGrant.objects.filter(user=self.user).exists()
        assert not ApiToken.objects.filter(user=self.user).exists()

    def test_rich_params(self):
        self.login_as(self.user)

        resp = self.client.get('{}?response_type=code&client_id={}&scope=org%3Aread&state=foo'.format(
            self.path,
            self.application.client_id,
        ))

        assert resp.status_code == 200
        self.assertTemplateUsed('sentry/oauth-authorize.html')
        assert resp.context['application'] == self.application

        resp = self.client.post(self.path, {
            'op': 'approve',
        })

        grant = ApiGrant.objects.get(user=self.user)
        assert grant.redirect_uri == self.application.get_default_redirect_uri()
        assert grant.application == self.application
        assert grant.get_scopes() == ['org:read']

        assert resp.status_code == 302
        assert resp['Location'] == 'https://example.com?state=foo&code={}'.format(
            grant.code,
        )

        assert not ApiToken.objects.filter(user=self.user).exists()

    def test_approve_flow_bypass_prompt(self):
        self.login_as(self.user)

        ApiAuthorization.objects.create(
            user=self.user,
            application=self.application,
        )

        resp = self.client.get('{}?response_type=code&client_id={}'.format(
            self.path,
            self.application.client_id,
        ))

        grant = ApiGrant.objects.get(user=self.user)
        assert grant.redirect_uri == self.application.get_default_redirect_uri()
        assert grant.application == self.application
        assert not grant.get_scopes()

        assert resp.status_code == 302
        assert resp['Location'] == 'https://example.com?code={}'.format(
            grant.code,
        )

    def test_approve_flow_force_prompt(self):
        self.login_as(self.user)

        ApiAuthorization.objects.create(
            user=self.user,
            application=self.application,
        )

        resp = self.client.get('{}?response_type=code&client_id={}&force_prompt=1'.format(
            self.path,
            self.application.client_id,
        ))

        assert resp.status_code == 200
        self.assertTemplateUsed('sentry/oauth-authorize.html')
        assert resp.context['application'] == self.application

    def test_approve_flow_requires_prompt_new_scope(self):
        self.login_as(self.user)

        authorization = ApiAuthorization.objects.create(
            user=self.user,
            application=self.application,
            scope_list=['org:write'],
        )

        resp = self.client.get('{}?response_type=code&client_id={}&scope=org:read'.format(
            self.path,
            self.application.client_id,
        ))

        assert resp.status_code == 200
        self.assertTemplateUsed('sentry/oauth-authorize.html')
        assert resp.context['application'] == self.application

        resp = self.client.post(self.path, {
            'op': 'approve',
        })

        authorization = ApiAuthorization.objects.get(id=authorization.id)
        assert sorted(authorization.get_scopes()) == ['org:read', 'org:write']

class OAuthAuthorizeTokenTest(TestCase):
    @fixture
    def path(self):
        return '/oauth/authorize/'

    def setUp(self):
        super(OAuthAuthorizeTokenTest, self).setUp()
        self.application = ApiApplication.objects.create(
            owner=self.user,
            redirect_uris='https://example.com',
        )

    def test_missing_response_type(self):
        self.login_as(self.user)

        resp = self.client.get('{}?redirect_uri={}&client_id={}'.format(
            self.path,
            'https://example.com',
            self.application.client_id,
        ))

        assert resp.status_code == 302
        assert resp['Location'] == 'https://example.com?error=unsupported_response_type'

    def test_invalid_response_type(self):
        self.login_as(self.user)

        resp = self.client.get('{}?response_type=foobar&redirect_uri={}&client_id={}'.format(
            self.path,
            'https://example.com',
            self.application.client_id,
        ))

        assert resp.status_code == 302
        assert resp['Location'] == 'https://example.com?error=unsupported_response_type'

    def test_missing_client_id(self):
        self.login_as(self.user)

        resp = self.client.get('{}?response_type=token&redirect_uri={}'.format(
            self.path,
            'https://example.com',
        ))

        assert resp.status_code == 200
        self.assertTemplateUsed('sentry/oauth-error.html')
        assert resp.context['error'] == 'Missing or invalid client_id parameter.'

    def test_invalid_scope(self):
        self.login_as(self.user)

        resp = self.client.get('{}?response_type=token&client_id={}&scope=foo'.format(
            self.path,
            self.application.client_id,
        ))

        assert resp.status_code == 302
        assert resp['Location'] == 'https://example.com#error=invalid_scope'

    def test_minimal_params_approve_flow(self):
        self.login_as(self.user)

        resp = self.client.get('{}?response_type=token&client_id={}'.format(
            self.path,
            self.application.client_id,
        ))

        assert resp.status_code == 200
        self.assertTemplateUsed('sentry/oauth-authorize.html')
        assert resp.context['application'] == self.application

        resp = self.client.post(self.path, {
            'op': 'approve',
        })

        assert not ApiGrant.objects.filter(user=self.user).exists()

        token = ApiToken.objects.get(user=self.user)
        assert token.application == self.application
        assert not token.get_scopes()
        assert not token.refresh_token

        assert resp.status_code == 302
        location, fragment = resp['Location'].split('#', 1)
        assert location == 'https://example.com'
        fragment = parse_qs(fragment)
        assert fragment['access_token'] == [token.token]
        assert fragment['token_type'] == ['bearer']
        assert 'refresh_token' not in fragment
        assert fragment['expires_in']
        assert fragment['token_type'] == ['bearer']

    def test_minimal_params_code_deny_flow(self):
        self.login_as(self.user)

        resp = self.client.get('{}?response_type=token&client_id={}'.format(
            self.path,
            self.application.client_id,
        ))

        assert resp.status_code == 200
        self.assertTemplateUsed('sentry/oauth-authorize.html')
        assert resp.context['application'] == self.application

        resp = self.client.post(self.path, {
            'op': 'deny',
        })

        assert resp.status_code == 302
        location, fragment = resp['Location'].split('#', 1)
        assert location == 'https://example.com'
        fragment = parse_qs(fragment)
        assert fragment == {'error': ['access_denied']}

        assert not ApiToken.objects.filter(user=self.user).exists()


text:
namespace gl11
{

} // namespace gl11


text:
package com.example.ruby.mygetgps.models;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

public class ReferralCodeAttributes {

    @SerializedName("name")
    @Expose
    private String name;

    public ReferralCodeAttributes() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}


text:
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>workerman Web消息推送器</title>

  <link href="css/bootstrap.min.css" rel="stylesheet">
  <link href="css/style.css" rel="stylesheet">

要发送的消息

	           <form onsubmit="onSubmit(); return false;">
                    <textarea class="textarea thumbnail" id="textarea"></textarea>

<input type="submit" class="btn btn-default" value="发表" />

               </form>

Powered by workerman