text:
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="40dp"
    android:height="40dp"
    android:viewportWidth="40"
    android:viewportHeight="40"
    android:tint="?attr/colorControlNormal">
  <path
      android:fillColor="@android:color/white"
      android:pathData="M5.208,33.083V23.083L17.708,19.958L5.208,16.833V6.875L36.208,19.958Z"/>
</vector>


text:
#pragma once
#include <aws/lexv2-models/LexModelsV2_EXPORTS.h>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace LexModelsV2
{
namespace Model
{

  /**
   *
Indicates whether a slot can return multiple values.

See Also:

   * AWS
   * API Reference

   */
  class AWS_LEXMODELSV2_API MultipleValuesSetting
  {
  public:
    MultipleValuesSetting();
    MultipleValuesSetting(Aws::Utils::Json::JsonView jsonValue);
    MultipleValuesSetting& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
Indicates whether a slot can return multiple values. When true,
     * the slot may return more than one value in a response. When false,
     * the slot returns only a single value.

Multi-value slots are only
     * available in the en-US locale. If you set this value to true in any
     * other locale, Amazon Lex throws a ValidationException.

If
     * the allowMutlipleValues is not set, the default value is
     * false.

     */
    inline bool GetAllowMultipleValues() const{ return m_allowMultipleValues; }

    /**
     *
Indicates whether a slot can return multiple values. When true,
     * the slot may return more than one value in a response. When false,
     * the slot returns only a single value.

Multi-value slots are only
     * available in the en-US locale. If you set this value to true in any
     * other locale, Amazon Lex throws a ValidationException.

If
     * the allowMutlipleValues is not set, the default value is
     * false.

     */
    inline bool AllowMultipleValuesHasBeenSet() const { return m_allowMultipleValuesHasBeenSet; }

    /**
     *
Indicates whether a slot can return multiple values. When true,
     * the slot may return more than one value in a response. When false,
     * the slot returns only a single value.

Multi-value slots are only
     * available in the en-US locale. If you set this value to true in any
     * other locale, Amazon Lex throws a ValidationException.

If
     * the allowMutlipleValues is not set, the default value is
     * false.

     */
    inline void SetAllowMultipleValues(bool value) { m_allowMultipleValuesHasBeenSet = true; m_allowMultipleValues = value; }

    /**
     *
Indicates whether a slot can return multiple values. When true,
     * the slot may return more than one value in a response. When false,
     * the slot returns only a single value.

Multi-value slots are only
     * available in the en-US locale. If you set this value to true in any
     * other locale, Amazon Lex throws a ValidationException.

If
     * the allowMutlipleValues is not set, the default value is
     * false.

     */
    inline MultipleValuesSetting& WithAllowMultipleValues(bool value) { SetAllowMultipleValues(value); return *this;}

  private:

    bool m_allowMultipleValues;
    bool m_allowMultipleValuesHasBeenSet;
  };

} // namespace Model
} // namespace LexModelsV2
} // namespace Aws

redpajama_set_name: RedPajamaGithub


text:
<?php
/* SVN FILE: $Id: security.test.php 7945 2008-12-19 02:16:01Z gwoo $ */
/**
 * Short description for file.
 *
 * Long description for file
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
 * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
 *
 *  Licensed under The Open Group Test Suite License
 *  Redistributions of files must retain the above copyright notice.
 *
 * @filesource
 * @copyright     Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
 * @link          https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
 * @package       cake.tests
 * @subpackage    cake.tests.cases.libs
 * @since         CakePHP(tm) v 1.2.0.5432
 * @version       $Revision: 7945 $
 * @modifiedby    $LastChangedBy: gwoo $
 * @lastmodified  $Date: 2008-12-18 21:16:01 -0500 (Thu, 18 Dec 2008) $
 * @license       http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
 */
App::import('Core', 'Security');
/**
 * Short description for class.
 *
 * @package       cake.tests
 * @subpackage    cake.tests.cases.libs
 */
class SecurityTest extends CakeTestCase {
/**
 * sut property
 *
 * @var mixed null
 * @access public
 */
	var $sut = null;
/**
 * setUp method
 *
 * @access public
 * @return void
 */
	function setUp() {
		$this->sut =& Security::getInstance();
	}
/**
 * testInactiveMins method
 *
 * @access public
 * @return void
 */
	function testInactiveMins() {
		Configure::write('Security.level', 'high');
		$this->assertEqual(10, Security::inactiveMins());

		Configure::write('Security.level', 'medium');
		$this->assertEqual(100, Security::inactiveMins());

		Configure::write('Security.level', 'low');
		$this->assertEqual(300, Security::inactiveMins());
	}
/**
 * testGenerateAuthkey method
 *
 * @access public
 * @return void
 */
	function testGenerateAuthkey() {
		$this->assertEqual(strlen(Security::generateAuthKey()), 40);
	}
/**
 * testValidateAuthKey method
 *
 * @access public
 * @return void
 */
	function testValidateAuthKey() {
		$authKey = Security::generateAuthKey();
		$this->assertTrue(Security::validateAuthKey($authKey));
	}
/**
 * testHash method
 *
 * @access public
 * @return void
 */
	function testHash() {
		$key = 'someKey';
		$hash = 'someHash';

		$this->assertIdentical(strlen(Security::hash($key, null, false)), 40);
		$this->assertIdentical(strlen(Security::hash($key, 'sha1', false)), 40);
		$this->assertIdentical(strlen(Security::hash($key, null, true)), 40);
		$this->assertIdentical(strlen(Security::hash($key, 'sha1', true)), 40);

		$result = Security::hash($key, null, $hash);
		$this->assertIdentical($result, 'e38fcb877dccb6a94729a81523851c931a46efb1');

		$result = Security::hash($key, 'sha1', $hash);
		$this->assertIdentical($result, 'e38fcb877dccb6a94729a81523851c931a46efb1');

		$hashType = 'sha1';
		Security::setHash($hashType);
		$this->assertIdentical($this->sut->hashType, $hashType);
		$this->assertIdentical(strlen(Security::hash($key, null, true)), 40);
		$this->assertIdentical(strlen(Security::hash($key, null, false)), 40);

		$this->assertIdentical(strlen(Security::hash($key, 'md5', false)), 32);
		$this->assertIdentical(strlen(Security::hash($key, 'md5', true)), 32);

		$hashType = 'md5';
		Security::setHash($hashType);
		$this->assertIdentical($this->sut->hashType, $hashType);
		$this->assertIdentical(strlen(Security::hash($key, null, false)), 32);
		$this->assertIdentical(strlen(Security::hash($key, null, true)), 32);

		if (!function_exists('hash') && !function_exists('mhash')) {
			$this->assertIdentical(strlen(Security::hash($key, 'sha256', false)), 32);
			$this->assertIdentical(strlen(Security::hash($key, 'sha256', true)), 32);
		} else {
			$this->assertIdentical(strlen(Security::hash($key, 'sha256', false)), 64);
			$this->assertIdentical(strlen(Security::hash($key, 'sha256', true)), 64);
		}
	}
/**
 * testCipher method
 *
 * @access public
 * @return void
 */
	function testCipher() {
		$length = 10;
		$txt = '';
		for ($i = 0; $i < $length; $i++) {
			$txt .= mt_rand(0, 255);
		}
		$key = 'my_key';
		$result = Security::cipher($txt, $key);
		$this->assertEqual(Security::cipher($result, $key), $txt);

		$txt = '';
		$key = 'my_key';
		$result = Security::cipher($txt, $key);
		$this->assertEqual(Security::cipher($result, $key), $txt);

		$txt = 'some_text';
		$key = '';
		$result = Security::cipher($txt, $key);
		$this->assertError();
		$this->assertIdentical($result, '');
	}
}
?>


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

@import Foundation;

#import "ForwardDeclarations.h"
#import "SCHttpRequestMethod.h"

NS_ASSUME_NONNULL_BEGIN

/*!
 The protocol for all immediate server request objects. All server requests will
 implement this protocol, providing a common interface for calling them.

 @author Ian Copland
 */
@protocol SCImmediateServerRequest <NSObject>

/// The full URL that the request is targeting.
@property (readonly) NSURL *url;

/// The HTTP request method that should be used.
@property (readonly) SCHttpRequestMethod httpRequestMethod;

/*!
 Serialises all header properties. The output will be a dictionary containing the
 extra header key-value pairs in addition the standard headers sent with all server
 requests. Will return an empty dictionary if there are no headers.

 @return The header dictionary.
 */
- (NSDictionary *)serialiseHeaders;

/*!
 Serialises all body properties. The output will be a dictionary containing the body
 of the request in a form that can easily be converted to Json. Will return an empty
 dictionary if there is no body. Will always be empty if the GET HTTP request method
 is used.

 @return The body dictionary.
 */
- (NSDictionary *)serialiseBody;

@end

NS_ASSUME_NONNULL_END


text:
package org.springframework.security.authentication.encoding;

/**
 * <p>
 * Convenience base for digest password encoders.
 * </p>
 *
 * @author colin sampaleanu
 */
public abstract class BaseDigestPasswordEncoder extends BasePasswordEncoder {
	// ~ Instance fields
	// ================================================================================================

	private boolean encodeHashAsBase64 = false;

	// ~ Methods
	// ========================================================================================================

	public boolean getEncodeHashAsBase64() {
		return encodeHashAsBase64;
	}

	/**
	 * The encoded password is normally returned as Hex (32 char) version of the hash
	 * bytes. Setting this property to true will cause the encoded pass to be returned as
	 * Base64 text, which will consume 24 characters.
	 *
	 * @param encodeHashAsBase64 set to true for Base64 output
	 */
	public void setEncodeHashAsBase64(boolean encodeHashAsBase64) {
		this.encodeHashAsBase64 = encodeHashAsBase64;
	}
}


text:
trait Foo<Bar, Baz, Quux>
{}

#[rustc_on_unimplemented="a collection of type `{Self}` cannot be built from an iterator over elements of type `{A}`"]
trait MyFromIterator<A> {
    /// Build a container with elements from an external iterator.
    fn my_from_iter<T: Iterator<Item=A>>(iterator: T) -> Self;
}

#[rustc_on_unimplemented] //~ ERROR `#[rustc_on_unimplemented]` requires a value
trait BadAnnotation1
{}

#[rustc_on_unimplemented = "Unimplemented trait error on `{Self}` with params `<{A},{B},{C}>`"]
//~^ ERROR there is no parameter `C` on trait `BadAnnotation2`
trait BadAnnotation2<A,B>
{}

#[rustc_on_unimplemented = "Unimplemented trait error on `{Self}` with params `<{A},{B},{}>`"]
//~^ only named substitution parameters are allowed
trait BadAnnotation3<A,B>
{}

#[rustc_on_unimplemented(lorem="")]
//~^ this attribute must have a valid
trait BadAnnotation4 {}

#[rustc_on_unimplemented(lorem(ipsum(dolor)))]
//~^ this attribute must have a valid
trait BadAnnotation5 {}

#[rustc_on_unimplemented(message="x", message="y")]
//~^ this attribute must have a valid
trait BadAnnotation6 {}

#[rustc_on_unimplemented(message="x", on(desugared, message="y"))]
//~^ this attribute must have a valid
trait BadAnnotation7 {}

#[rustc_on_unimplemented(on(), message="y")]
//~^ empty `on`-clause
trait BadAnnotation8 {}

#[rustc_on_unimplemented(on="x", message="y")]
//~^ this attribute must have a valid
trait BadAnnotation9 {}

#[rustc_on_unimplemented(on(x="y"), message="y")]
trait BadAnnotation10 {}

#[rustc_on_unimplemented(on(desugared, on(desugared, message="x")), message="y")]
//~^ this attribute must have a valid
trait BadAnnotation11 {}

pub fn main() {
}


text:
class Object
  # Can you safely dup this object?
  #
  # False for +nil+, +false+, +true+, symbol, and number objects;
  # true otherwise.
  def duplicable?
    true
  end
end

class NilClass
  # +nil+ is not duplicable:
  #
  #   nil.duplicable? # => false
  #   nil.dup         # => TypeError: can't dup NilClass
  def duplicable?
    false
  end
end

class FalseClass
  # +false+ is not duplicable:
  #
  #   false.duplicable? # => false
  #   false.dup         # => TypeError: can't dup FalseClass
  def duplicable?
    false
  end
end

class TrueClass
  # +true+ is not duplicable:
  #
  #   true.duplicable? # => false
  #   true.dup         # => TypeError: can't dup TrueClass
  def duplicable?
    false
  end
end

class Symbol
  # Symbols are not duplicable:
  #
  #   :my_symbol.duplicable? # => false
  #   :my_symbol.dup         # => TypeError: can't dup Symbol
  def duplicable?
    false
  end
end

class Numeric
  # Numbers are not duplicable:
  #
  #  3.duplicable? # => false
  #  3.dup         # => TypeError: can't dup Fixnum
  def duplicable?
    false
  end
end

require 'bigdecimal'
class BigDecimal
  begin
    BigDecimal('4.56').dup

    def duplicable?
      true
    end
  rescue TypeError
    # can't dup, so use superclass implementation
    nil
  end
end


text:
from datetime import datetime

class FunctionCallCount(object):
    _count_hash = {}
    _time_hash = {}

    def __init__(self, func):
        self.func = func

    def __call__(self, *args, **kwargs):
        try:
            FunctionCallCount._count_hash[self.func] += 1
        except KeyError:
            FunctionCallCount._count_hash[self.func] = 1

        try:
            start = datetime.now()
            return_val = self.func(self.obj, *args, **kwargs)
            end = datetime.now()
        except AttributeError:
            start = datetime.now()
            return_val = self.func(*args, **kwargs)
            end = datetime.now()

        time_diff = end - start
        time_seconds = time_diff.seconds + float(time_diff.microseconds) / 1000000

        try:
            FunctionCallCount._time_hash[self.func] += time_seconds
        except KeyError:
            FunctionCallCount._time_hash[self.func] = time_seconds

        return return_val

    def __get__(self, instance, klass):
        self.obj = instance
        return self

def dumpCallCounts():
    for func in FunctionCallCount._count_hash.iterkeys():
        print func.__name__, FunctionCallCount._count_hash[func], FunctionCallCount._time_hash[func]

def main():
    class TestClass:
        def __init__(self):
            return

        @FunctionCallCount
        def test_member(self, arg1, arg2):
            return ", ".join([ str(i) for i in range(arg1, arg2) ])

    @FunctionCallCount
    def test_func(arg1, arg2):
        print ", ".join([ str(i) for i in range(arg1, arg2) ])

    mytest = TestClass()
    print mytest.test_member(1, 4)
    print mytest.test_member(5, 8)

    print test_func(1, 4)
    print test_func(5, 8)

    dumpCallCounts()

if __name__ == "__main__":
    main()


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright 2016 Google Inc. All Rights Reserved.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

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

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->
<!-- [START pom] -->
<project>                               <!-- REQUIRED -->

  <modelVersion>4.0.0</modelVersion>    <!-- REQUIRED -->
  <packaging>war</packaging>            <!-- REQUIRED -->

  <groupId>com.example.flex.helloworld</groupId>
  <artifactId>helloworld-servlet</artifactId> <!-- Name of your project -->
  <version>1.0-SNAPSHOT</version>       <!-- xx.xx.xx -SNAPSHOT means development -->

  <properties>
    <maven.compiler.source>1.8</maven.compiler.source> <!-- REQUIRED -->
    <maven.compiler.target>1.8</maven.compiler.target> <!-- REQUIRED -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <failOnMissingWebXml>false</failOnMissingWebXml> <!-- REQUIRED -->
    <appengine.maven.plugin>1.0.0</appengine.maven.plugin>
    <jetty.maven.plugin>9.3.8.v20160314</jetty.maven.plugin>
  </properties>

  <parent>                              <!-- Get parameters and allow bulk testing -->
    <artifactId>getting-started-java</artifactId>
    <groupId>com.example</groupId>
    <version>1.0.0</version>
    <relativePath>..</relativePath>
  </parent>

  <prerequisites>                       <!-- Optional, but suggested -->
    <maven>3.3.9</maven>                <!-- Recommended minimum maven version -->
  </prerequisites>

  <dependencies>
    <dependency>                        <!-- REQUIRED -->
      <groupId>javax.servlet</groupId>  <!-- Java Servlet API -->
      <artifactId>javax.servlet-api</artifactId>
      <version>3.1.0</version>
      <scope>provided</scope>           <!-- Provided by the Jetty Servlet Container -->
    </dependency>
  </dependencies>

  <build>
    <!-- For hot reload of the web application when using an IDE Eclipse / IDEA -->
    <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>

    <plugins>

      <plugin>                          <!-- Used for local debugging -->
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>${jetty.maven.plugin}</version>
      </plugin>

      <plugin>
        <groupId>com.google.cloud.tools</groupId>
        <artifactId>appengine-maven-plugin</artifactId>
        <version>${appengine.maven.plugin}</version>
        <configuration>
          <!-- deploy configuration -->
<!--
          <deploy.promote>true</deploy.promote>                           <!~~ DEFAULT value ~~>
          <deploy.stopPreviousVersion>true</deploy.stopPreviousVersion>   <!~~ DEFAULT value ~~>
 -->
        </configuration>
      </plugin>

    </plugins>
  </build>
</project>
<!-- [END pom] -->


text:
DatabaseCleaner[:active_record].strategy = :transaction if defined? ActiveRecord
DatabaseCleaner[:mongoid].strategy = :truncation if defined? Mongoid

RSpec.configure do |config|
  config.before :suite do
    DatabaseCleaner.clean_with :truncation if defined? ActiveRecord
    DatabaseCleaner.clean_with :truncation if defined? Mongoid
  end
  config.before :each do
    DatabaseCleaner.start
  end
  config.after :each do
    DatabaseCleaner.clean
  end
end


text:
using System.Web.Mvc;
using Couchbase.Core;

namespace WebApplication1.Controllers
{
    public class AirportController : Controller
    {
        private IBucket bucket = null;

        public AirportController()
        {
            bucket = new Workshop.DatabaseConfig().Bucket();
        }

        [ActionName("all")]
        public ActionResult FindAll()
        {
            // TODO: implement me
            var result = string.Empty;

            return Content(result);
        }

        [ActionName("allNames")]
        public ActionResult allAirportNames()
        {
            // TODO: implement me
            var result = string.Empty;

            return Content(result);
        }

        [ActionName("prefixedBy")]
        public ActionResult airportNamesStartingWith(string prefix)
        {
            // TODO: implement me
            var result = string.Empty;

            return Content(result);
        }

        [ActionName("byFaa")]
        public ActionResult byFaa(string faa)
        {
            // TODO: implement me
            var result = string.Empty;

            return Content(result);
        }

        [ActionName("routes")]
        public ActionResult routesByAirline(string airline)
        {
            // TODO: implement me
            var result = string.Empty;

            return Content(result);
        }
    }
}


text:
=head1 LICENSE

Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2017] EMBL-European Bioinformatics Institute

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=cut

=pod

=head1 NAME

Bio::EnsEMBL::Compara::Production::Projection::RunnableDB::RunnableLogger

=head1 DESCRIPTION

This class is a mirror of the calls we can expect to use on a L<Log::Log4perl>
logger class. This allows runnables to use Log4perl should it exist on
a user's @INC otherwise it defaults to the more normal logging to stdout. It
does not provide catagory support just the basic logging interface.

=head1 AUTHOR

Andy Yates (ayatesatebiacuk)

=head1 CONTACT

This modules is part of the EnsEMBL project (http://www.ensembl.org)

Questions can be posted to the dev mailing list: http://lists.ensembl.org/mailman/listinfo/dev

=cut

package Bio::EnsEMBL::Compara::Production::Projection::RunnableDB::RunnableLogger;

use strict;
use warnings;
use Bio::EnsEMBL::Utils::Argument qw(rearrange);

=head2 new()

  Arg[DEBUG]  : Indicates if debug mode is on.
  Arg[STDERR] : Indicates we need to write out to STDERR
  Arg[TRACE]  : Indicates if trace mode is on (defaults to 0)
  Description : Constructor for the logger

=cut

sub new {
  my ( $class, @args ) = @_;
  my $self = bless( {}, ref($class) || $class );
  my ( $debug, $stderr, $trace ) = rearrange( [qw(debug stderr trace)], @args );
  $self->_debug($debug);
  $self->_stderr($stderr);
  $self->_trace($trace);
  return $self;
}

sub _debug {
  my ($self, $_debug) = @_;
  $self->{_debug} = $_debug if defined $_debug;
  return $self->{_debug};
}

sub _stderr {
  my ($self, $_stderr) = @_;
  $self->{_stderr} = $_stderr if defined $_stderr;
  return $self->{_stderr};
}

sub _trace {
  my ($self, $_trace) = @_;
  $self->{_trace} = $_trace if defined $_trace;
  return $self->{_trace};
}

=head2 fatal()

Issues an Ensembl warning with the message

=cut

sub fatal {
  my ($self, $message) = @_;
  $self->_print("FATAL: $message");
  return;
}

=head2 is_fatal()

Always returns true

=cut

sub is_fatal {
  return 1;
}

=head2 error()

Issues an Ensembl warning with the message

=cut

sub error {
  my ($self, $message) = @_;
  $self->_print("ERROR: $message");
  return;
}

=head2 is_error()

Always returns true

=cut

sub is_error {
  return 1;
}

=head2 warning()

Issues an Ensembl warning with the message

=cut

sub warning {
  my ($self, $message) = @_;
  $self->_print("WARN: $message");
  return;
}

=head2 is_warning()

Always returns true

=cut

sub is_warning {
  return 1;
}

=head2 info()

Prints the message to STDOUT

=cut

sub info {
  my ($self, $message) = @_;
  $self->_print("INFO: $message");
  return;
}

=head2 is_info()

Always returns true

=cut

sub is_info {
  my ($self) = @_;
  return 1;
}

=head2 debug()

Prints to STDOUT if the object was contstructed with the debug flag on

=cut

sub debug {
  my ($self, $message) = @_;
  return unless $self->is_debug();
  $self->_print("DEBUG: $message");
  return;
}

=head2 is_debug()

Returns true if debug was given as true during construction

=cut

sub is_debug {
  my ($self) = @_;
  return $self->_debug();
}

=head2 trace()

Prints the message to STDOUT if is_trace() responded true

=cut

sub trace {
  my ($self, $message) = @_;
  return unless $self->is_trace();
  $self->_print("TRACE: $message");
  return;
}

=head2 is_trace()

Returns true if debug was given as true during construction

=cut

sub is_trace {
  my ($self) = @_;
  return $self->_trace();
}

sub _print {
  my ($self, $msg) = @_;
  if($self->_stderr()) {
    print STDERR $msg, "\n";
  }
  else {
    print STDOUT $msg, "\n";
  }
  return;
}

1;


text:
import {Injectable} from '@angular/core';

export interface GuideItem {
  id: string;
  name: string;
  document: string;
  overview: string;
}

const GUIDES = [
  {
    id: 'getting-started',
    name: 'Getting started',
    document: '/docs-content/guides/getting-started.html',
    overview: 'Add Angular Material to your project!'
  },
  {
    id: 'schematics',
    name: 'Schematics',
    document: '/docs-content/guides/schematics.html',
    overview: 'Use schematics to quickly generate views with Material Design components.'
  },
  {
    id: 'theming',
    name: 'Theming Angular Material',
    document: '/docs-content/guides/theming.html',
    overview: 'Customize your application with Angular Material\'s theming system.'
  },
  {
    id: 'theming-your-components',
    name: 'Theming your own components',
    document: '/docs-content/guides/theming-your-components.html',
    overview: 'Use Angular Material\'s theming system in your own custom components.'
  },
  {
    id: 'typography',
    name: 'Customizing Typography',
    document: '/docs-content/guides/typography.html',
    overview: 'Configure the typography settings for Angular Material components.'
  },
  {
    id: 'customizing-component-styles',
    name: 'Customizing component styles',
    document: '/docs-content/guides/customizing-component-styles.html',
    overview: 'Understand how to approach style customization with Angular Material components.'
  },
  {
    id: 'creating-a-custom-form-field-control',
    name: 'Custom form field control',
    document: '/docs-content/guides/creating-a-custom-form-field-control.html',
    overview: 'Build a custom control that integrates with `<mat-form-field>`.'
  },
  {
    id: 'elevation',
    name: 'Elevation helpers',
    document: '/docs-content/guides/elevation.html',
    overview: 'Enhance your components with elevation and depth.'
  },
  {
    id: 'creating-a-custom-stepper-using-the-cdk-stepper',
    name: 'Custom stepper using the CdkStepper',
    document: '/docs-content/guides/creating-a-custom-stepper-using-the-cdk-stepper.html',
    overview: 'Create a custom stepper components using Angular CDK.'
  },
  {
    id: 'using-component-harnesses',
    name: 'Testing with component harnesses',
    document: '/docs-content/guides/using-component-harnesses.html',
    overview: 'Write tests with component harnesses for convenience and meaningful results.'
  },
  {
    id: 'duplicate-theming-styles',
    name: 'Duplicate theming styles',
    document: '/docs-content/guides/duplicate-theming-styles.html',
    overview: 'Learn about our new color mixins for Sass that avoid duplicating theming styles.'
  },
  {
    id: 'mdc-migration',
    name: 'Migrating to MDC-based Components',
    document: '/docs-content/guides/v15-mdc-migration.html',
    overview: 'Learn how to migrate your app to the new MDC-based components available in v15.'
  }
];

@Injectable()
export class GuideItems {

  getAllItems(): GuideItem[] {
    return GUIDES;
  }

  getItemById(id: string): GuideItem | undefined {
    return GUIDES.find(i => i.id === id);
  }
}


text:
public void sendBroadcast1(Context context, String token, String refreshToken)
{
    {
        // BAD: broadcast sensitive information to all listeners
        Intent intent = new Intent();
        intent.setAction("com.example.custom_action");
        intent.putExtra("token", token);
        intent.putExtra("refreshToken", refreshToken);
        context.sendBroadcast(intent);
    }

    {
        // GOOD: broadcast sensitive information only to those with permission
        Intent intent = new Intent();
        intent.setAction("com.example.custom_action");
        intent.putExtra("token", token);
        intent.putExtra("refreshToken", refreshToken);
        context.sendBroadcast(intent, "com.example.user_permission");
    }

    {
        // GOOD: broadcast sensitive information to a specific application
        Intent intent = new Intent();
        intent.setAction("com.example.custom_action");
        intent.setClassName("com.example2", "com.example2.UserInfoHandler");
        intent.putExtra("token", token);
        intent.putExtra("refreshToken", refreshToken);
        context.sendBroadcast(intent);
    }
}


text:
class IRenderer
{
public:
	virtual ~IRenderer() {}
	virtual bool LoadScene(const std::string &filename) = 0;
	virtual void SetViewportSize(int w, int h) = 0;
	virtual void SetCameraPos(double x, double y, double z) = 0;
	virtual void SetLookAt(double x, double y, double z) = 0;
	virtual void Render() = 0;
};

#endif


text:
/**
 █▒▓▒░ The FlexPaper Project

 This file is part of FlexPaper.

 FlexPaper is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, version 3 of the License.

 FlexPaper is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with FlexPaper.  If not, see <http://www.gnu.org/licenses/>.

 For more information on FlexPaper please see the FlexPaper project
 home page: http://flexpaper.devaldi.com
 */

/**
 *
 * FlexPaper helper function for retrieving a active FlexPaper instance
 *
 */
window.$FlexPaper = window.getDocViewer = window["$FlexPaper"] = function(id){
    var instance = (id==="undefined")?"":id;

    return window["FlexPaperViewer_Instance"+instance].getApi();
};

/**
 *
 * FlexPaper embedding (name of placeholder, config)
 *
 */
window.FlexPaperViewerEmbedding = window.$f = function(id, args) {
    var config = args.config;
    var _SWFFile,_PDFFile,_IMGFiles,_JSONFile  = "",_jsDirectory="",_cssDirectory="",_localeDirectory="";_WMode = (config.WMode!=null||config.wmmode!=null?config.wmmode||config.WMode:"window");
    var _uDoc = ((config.DOC !=null)?unescape(config.DOC):null);
    var instance = "FlexPaperViewer_Instance"+((id==="undefined")?"":id);
    var _JSONDataType = (config.JSONDataType!=null)?config.JSONDataType:"json";

    if (_uDoc != null) {
        _SWFFile 	= FLEXPAPER.translateUrlByFormat(_uDoc,"swf");
    }

    _SWFFile  			= (config.SwfFile!=null?config.SwfFile:_SWFFile);
    _SWFFile  			= (config.SWFFile!=null?config.SWFFile:_SWFFile);
    _PDFFile 			= (config.PDFFile!=null?config.PDFFile:_PDFFile);
    _IMGFiles 			= (config.IMGFiles!=null?config.IMGFiles:_IMGFiles);
    _IMGFiles 			= (config.PageImagePattern!=null?config.PageImagePattern:_IMGFiles);
    _JSONFile 			= (config.JSONFile!=null?config.JSONFile:_JSONFile);
    _jsDirectory 		= (config.jsDirectory!=null?config.jsDirectory:"");
    _cssDirectory 		= (config.cssDirectory!=null?config.cssDirectory:"css/");
    _localeDirectory 	= (config.localeDirectory!=null?config.localeDirectory:"locale/");
    if(_SWFFile!=null && _SWFFile.indexOf("{" )==0 && _SWFFile.indexOf("[*," ) > 0 && _SWFFile.indexOf("]" ) > 0){_SWFFile = escape(_SWFFile);} // split file fix

    window[instance] = flashembed(id, {
        src						    : _jsDirectory+"/pages/assets/flash/FlexPaperViewer.swf",
        version					    : [10, 0],
        expressInstall			    : "js/expressinstall.swf",
        wmode					    : _WMode
    },{
        ElementId               : id,
        SwfFile  				: _SWFFile,
        PdfFile  				: _PDFFile,
        IMGFiles  				: _IMGFiles,
        JSONFile 				: _JSONFile,
        useCustomJSONFormat 	: config.useCustomJSONFormat,
        JSONPageDataFormat 		: config.JSONPageDataFormat,
        JSONDataType 			: _JSONDataType,
        Scale 					: (config.Scale!=null)?config.Scale:0.8,
        ZoomTransition 			: (config.ZoomTransition!=null)?config.ZoomTransition:'easeOut',
        ZoomTime 				: (config.ZoomTime!=null)?config.ZoomTime:0.5,
        ZoomInterval 			: (config.ZoomInterval)?config.ZoomInterval:0.2,
        FitPageOnLoad 			: (config.FitPageOnLoad!=null)?config.FitPageOnLoad:false,
        FitWidthOnLoad 			: (config.FitWidthOnLoad!=null)?config.FitWidthOnLoad:false,
        FullScreenAsMaxWindow 	: (config.FullScreenAsMaxWindow!=null)?config.FullScreenAsMaxWindow:false,
        ProgressiveLoading 		: (config.ProgressiveLoading!=null)?config.ProgressiveLoading:false,
        MinZoomSize 			: (config.MinZoomSize!=null)?config.MinZoomSize:0.2,
        MaxZoomSize 			: (config.MaxZoomSize!=null)?config.MaxZoomSize:5,
        SearchMatchAll 			: (config.SearchMatchAll!=null)?config.SearchMatchAll:false,
        SearchServiceUrl 		: config.SearchServiceUrl,
        InitViewMode 			: config.InitViewMode,
        BitmapBasedRendering 	: (config.BitmapBasedRendering!=null)?config.BitmapBasedRendering:false,
        StartAtPage 			: config.StartAtPage,
        PrintPaperAsBitmap		: (config.PrintPaperAsBitmap!=null)?config.PrintPaperAsBitmap:false,
        AutoAdjustPrintSize		: (config.AutoAdjustPrintSize!=null)?config.AutoAdjustPrintSize:false,

        EnableCornerDragging 	: ((config.EnableCornerDragging!=null)?config.EnableCornerDragging:true), // FlexPaper Zine parameter
        BackgroundColor 		: config.BackgroundColor, // FlexPaper Zine parameter
        PanelColor 				: config.PanelColor, // FlexPaper Zine parameter
        BackgroundAlpha         : config.BackgroundAlpha, // FlexPaper Zine parameter
        UIConfig                : config.UIConfig,  // FlexPaper Zine parameter

        ViewModeToolsVisible 	: ((config.ViewModeToolsVisible!=null)?config.ViewModeToolsVisible:true),
        ZoomToolsVisible 		: ((config.ZoomToolsVisible!=null)?config.ZoomToolsVisible:true),
        NavToolsVisible 		: ((config.NavToolsVisible!=null)?config.NavToolsVisible:true),
        CursorToolsVisible 		: ((config.SearchToolsVisible!=null)?config.CursorToolsVisible:true),
        SearchToolsVisible 		: ((config.SearchToolsVisible!=null)?config.SearchToolsVisible:true),
        StickyTools				: config.StickyTools,
        Toolbar                 : config.Toolbar,
        DocSizeQueryService 	: config.DocSizeQueryService,

        RenderingOrder 			: config.RenderingOrder,

        localeChain 			: (config.localeChain!=null)?config.localeChain:"en_US",
        jsDirectory 			: _jsDirectory,
        cssDirectory 			: _cssDirectory,
        localeDirectory			: _localeDirectory,
        key 					: config.key
    });
};

(function() {
    if(!window.FLEXPAPER){window.FLEXPAPER = {};}

    FLEXPAPER.getLocationHashParameter = function(param){
        var hash = location.hash.substr(1);

        if(hash.indexOf(param+'=')>=0){
            var value = hash.substr(hash.indexOf(param+'='))
                .split('&')[0]
                .split('=')[1];

            return value;
        }

        return null;
    };

    FLEXPAPER.translateUrlByFormat = function(url,format){
        if(url.indexOf("{") == 0 && format != "swf"){ // loading in split file mode
            url = url.substring(1,url.lastIndexOf(","));
            url = url.replace("[*,0]","{page}")
        }
        return (url!=null && url.indexOf('{format}') > 0 ? url.replace("{format}", format):null);
    };

    FLEXPAPER.animateDenyEffect = function(obj,margin,time,cycles,dir) {
        window.setTimeout(function(){
            var speed = time / ((2*cycles)+1);
            var margRat = 1 + (60/(cycles*cycles)); $(obj).stop(true,true);
            for (var i=0; i<=cycles; i++) {
                for (var j=-1; j<=1; j+=2)
                    $(obj).animate({marginLeft: (i!=cycles)*j*margin},{duration:speed, queue:true});

                margin/=margRat;
            }
        },500);
    };

    FLEXPAPER.initLoginForm = function initLoginForm(IMGFiles,animate){
        jQuery(document.body).css('background-color','#dedede');

        var img = new Image();
        jQuery(img).bind('load',function(){
            jQuery(document.body).append(
                "
"+
                    "<form class='flexpaper_htmldialog' method='POST' style='display:none;top:100px;margin:"+((jQuery(window).height()>500)?"50px auto":"0px auto")+"'>"+
                    "
"+
                    "
"+
                    ""+
                    "
"+

                    "
password protected publication
"+
                    "<input type='password' id='txt_flexpaper_password' name='txt_flexpaper_password' class='flexpaper_htmldialog-input' placeholder='Enter password'>"+
                    "<input type='submit' value='Submit' class='flexpaper_htmldialog-button'>"+
                    "
"+
                    "</form>"+
                    "
"
            );

            var anim_duration = animate?1000:0;
            var anim_height_dur = animate?anim_duration/3:0;
            var theight = 400;

            jQuery('.flexpaper_htmldialog').css({height : '0px', display : 'block'});
            jQuery('.flexpaper_htmldialog').animate({'height': theight+'px','top':'0px'},{duration: anim_height_dur, complete: function(){
                jQuery('.flexpaper_htmldialog').css({'height' : ''}); // remove height attribute to fit publication

                jQuery('.flexpaper_publication').animate({opacity:1},{
                    step : function(now,fx){
                        var target = -7;var opacityfrom = -40;var diff = opacityfrom - target;var rotate = (diff * now);

                        jQuery('.flexpaper_publication').css({
                            '-webkit-transform' : 'perspective(300) rotateY('+(opacityfrom - rotate)+'deg)',
                            '-moz-transform' : 'rotateY('+(opacityfrom - rotate)+'deg)',
                            'box-shadow' : '5px 5px 20px rgba(51, 51, 51, '+now+')'
                        });
                    },
                    duration:anim_duration
                });

            }});

        });
        img.src = (IMGFiles.replace("{page}",1));
    };
})();

/**
 *
 * FlexPaper embedding functionality. Based on FlashEmbed
 *
 */

(function() {

    var  IE = document.all,
        URL = 'http://www.adobe.com/go/getflashplayer',
        JQUERY = typeof jQuery == 'function',
        RE = /(\d+)[^\d]+(\d+)[^\d]*(\d*)/,
        MOBILE = (function(){try {return 'ontouchstart' in document.documentElement;} catch (e) {return false;} })(),
        GLOBAL_OPTS = {
            // very common opts
            width: '100%',
            height: '100%',
            id: "_" + ("" + Math.random()).slice(9),

            // flashembed defaults
            allowfullscreen: true,
            allowscriptaccess: 'always',
            quality: 'high',
            allowFullScreenInteractive : true,

            // flashembed specific options
            version: [10, 0],
            onFail: null,
            expressInstall: null,
            w3c: false,
            cachebusting: false
        };

    window.isTouchScreen = MOBILE;

    if (window.attachEvent) {
        window.attachEvent("onbeforeunload", function() {
            __flash_unloadHandler = function() {};
            __flash_savedUnloadHandler = function() {};
        });
    }

    // simple extend
    function extend(to, from) {
        if (from) {
            for (var key in from) {
                if (from.hasOwnProperty(key)) {
                    to[key] = from[key];
                }
            }
        }
        return to;
    }

    // used by Flash to dispatch a event properly
    window.dispatchJQueryEvent = function (elementId,eventName,args){
        jQuery('#'+elementId).trigger(eventName,args);
    }

    // used by asString method
    function map(arr, func) {
        var newArr = [];
        for (var i in arr) {
            if (arr.hasOwnProperty(i)) {
                newArr[i] = func(arr[i]);
            }
        }
        return newArr;
    }

    window.flashembed = function(root, opts, conf) {
        // root must be found / loaded
        if (typeof root == 'string') {
            root = document.getElementById(root.replace("#", ""));
        }

        // not found
        if (!root) { return; }

        root.onclick = function(){return false;}

        if (typeof opts == 'string') {
            opts = {src: opts};
        }

        return new Flash(root, extend(extend({}, GLOBAL_OPTS), opts), conf);
    };

    // flashembed "static" API
    var f = extend(window.flashembed, {

        conf: GLOBAL_OPTS,

        getVersion: function()  {
            var fo, ver;

            try {
                ver = navigator.plugins["Shockwave Flash"].description.slice(16);
            } catch(e) {

                try  {
                    fo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
                    ver = fo && fo.GetVariable("$version");

                } catch(err) {
                    try  {
                        fo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
                        ver = fo && fo.GetVariable("$version");
                    } catch(err2) { }
                }
            }

            ver = RE.exec(ver);
            return ver ? [ver[1], ver[3]] : [0, 0];
        },

        asString: function(obj) {

            if (obj === null || obj === undefined) { return null; }
            var type = typeof obj;
            if (type == 'object' && obj.push) { type = 'array'; }

            switch (type){

                case 'string':
                    obj = obj.replace(new RegExp('(["\\\\])', 'g'), '\\$1');

                    // flash does not handle %- characters well. transforms "50%" to "50pct" (a dirty hack, I admit)
                    obj = obj.replace(/^\s?(\d+\.?\d+)%/, "$1pct");
                    return '"' +obj+ '"';

                case 'array':
                    return '['+ map(obj, function(el) {
                        return f.asString(el);
                    }).join(',') +']';

                case 'function':
                    return '"function()"';

                case 'object':
                    var str = [];
                    for (var prop in obj) {
                        if (obj.hasOwnProperty(prop)) {
                            str.push('"'+prop+'":'+ f.asString(obj[prop]));
                        }
                    }
                    return '{'+str.join(',')+'}';
            }

            // replace ' --> "  and remove spaces
            return String(obj).replace(/\s/g, " ").replace(/\'/g, "\"");
        },

        getHTML: function(opts, conf) {

            opts = extend({}, opts);
            opts.id = opts.id + (" " + Math.random()).slice(9);

            /******* OBJECT tag and it's attributes *******/
            var html = '<object style="position: relative; z-index: 1000; visibility: visible;" width="' + opts.width +
                '" height="' + opts.height +
                '" id="' + opts.id +
                '" name="' + opts.id + '"';

            if (opts.cachebusting) {
                opts.src += ((opts.src.indexOf("?") != -1 ? "&" : "?") + Math.random());
            }

            if (opts.w3c || !IE) {
                html += ' data="' +opts.src+ '" type="application/x-shockwave-flash"';
            } else {
                html += ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
            }

            html += '>';

            /******* nested PARAM tags *******/
            if (opts.w3c || IE) {
                html += '<param name="movie" value="' +opts.src+ '" />';
            }

            // not allowed params
            opts.width = opts.height = opts.id = opts.w3c = opts.src = null;
            opts.onFail = opts.version = opts.expressInstall = null;

            for (var key in opts) {
                if (opts[key]) {
                    html += '<param name="'+ key +'" value="'+ opts[key] +'" />';
                }
            }

            /******* FLASHVARS *******/
            var vars = "";

            if (conf) {
                for (var k in conf) {
                    if (conf[k] && k!='Toolbar') {
                        var val = conf[k];
                        vars += k +'='+ (/function|object/.test(typeof val) ? f.asString(val) : val) + '&';
                    }
                }
                vars = vars.slice(0, -1);
                html += '<param name="flashvars" value=\'' + vars + '\' />';
            }

            html += "</object>";

            return html;
        },

        isSupported: function(ver) {
            return VERSION[0] > ver[0] || VERSION[0] == ver[0] && VERSION[1] >= ver[1];
        }

    });

    var VERSION = f.getVersion();

    function Flash(root, opts, conf) {
        var userAgent = navigator.userAgent.toLowerCase();
        var browser = {
            version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
            safari: /webkit/.test(userAgent),
            opera: /opera/.test(userAgent),
            msie: /msie/.test(userAgent) && !/opera/.test(userAgent),
            mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent),
            chrome: /chrome/.test(userAgent)
        };

        // Default to a rendering mode if its not set
        if(!conf.RenderingOrder && conf.SwfFile !=  null){conf.RenderingOrder = "flash";}

        if(conf.RenderingOrder.indexOf('html5')==0){
            if(confirm('The FlexPaper GPL version does not support HTML5 rendering. Do you want to navigate to our download page for more details?')){location.href='http://flexpaper.devaldi.com/download.jsp?ref=FlexPaper'}
            return;
        }

        if(conf.RenderingOrder.indexOf('html')==0){
            if(confirm('The FlexPaper GPL version does not support HTML4 rendering. Do you want to navigate to our download page for more details?')){location.href='http://flexpaper.devaldi.com/download.jsp?ref=FlexPaper'}
            return;
        }

        // version is ok
        if (f.isSupported(opts.version)) {
            root.innerHTML = f.getHTML(opts, conf);

            // express install
        } else if (opts.expressInstall && f.isSupported([6, 65])) {
            root.innerHTML = f.getHTML(extend(opts, {src: opts.expressInstall}), {
                MMredirectURL: location.href,
                MMplayerType: 'PlugIn',
                MMdoctitle: document.title
            });

        } else { //use html viewer or die
            // fail #2.1 custom content inside container
            if (!root.innerHTML.replace(/\s/g, '')) {
                var pageHost = ((document.location.protocol == "https:") ? "https://" :	"http://");

                root.innerHTML =
                    "
Your browser is not compatible with FlexPaper
" +
                        "
Upgrade to a newer browser or download Adobe Flash Player 10 or higher.
" +
                        "
Click on the icon below to download the latest version of Adobe Flash" +
                        "";

                if (root.tagName == 'A') {
                    root.onclick = function() {
                        location.href = URL;
                    };
                }
            }

            // onFail
            if (opts.onFail) {
                var ret = opts.onFail.call(this);
                if (typeof ret == 'string') { root.innerHTML = ret; }
            }
        }

        // http://flowplayer.org/forum/8/18186#post-18593
        if (IE) {
            window[opts.id] = document.getElementById(opts.id);
        }

        // API methods for callback
        extend(this, {

            getRoot: function() {
                return root;
            },

            getOptions: function() {
                return opts;
            },

            getConf: function() {
                return conf;
            },

            getApi: function() {
                return root.firstChild;
            }

        });
    }

    // setup jquery support
    if (JQUERY) {
        jQuery.fn.flashembed = function(opts, conf) {
            return this.each(function() {
                jQuery(this).data("flashembed", flashembed(this, opts, conf));
            });
        };

        jQuery.fn.FlexPaperViewer = function(args){
            this.element = new FlexPaperViewerEmbedding(this.attr('id'),args);
        };
    }else{
        throw new Error("jQuery missing!");
    }
})();


text:
from __future__ import print_function
import unittest
import sys
import os

if __name__ == '__main__':
    test_path = os.path.abspath(os.path.join(os.path.dirname(__file__)))
    project_path = os.path.sep.join(test_path.split(os.path.sep)[:-2])
    sys.path.append(project_path)

    tests = unittest.TestLoader().discover(test_path, "*tests.py")
    result = unittest.TextTestRunner().run(tests)

    for skipped in result.skipped:
        print(skipped)

    if not result.wasSuccessful():
        sys.exit(1)


text:
/*******************************************************************
** m a t h 6 4 . c
** Forth Inspired Command Language - 64 bit math support routines
** Authors: Michael A. Gauland (gaulandm@mdhost.cse.tek.com)
**          Larry Hastings (larry@hastings.org)
**          John Sadler (john_sadler@alum.mit.edu)
** Created: 25 January 1998
** Rev 2.03: Support for 128 bit DP math. This file really ouught to
** be renamed!
** $Id: double.c,v 1.2 2010/09/12 15:18:07 asau Exp $
*******************************************************************/
/*
** Copyright (c) 1997-2001 John Sadler (john_sadler@alum.mit.edu)
** All rights reserved.
**
** Get the latest Ficl release at http://ficl.sourceforge.net
**
** I am interested in hearing from anyone who uses Ficl. If you have
** a problem, a success story, a defect, an enhancement request, or
** if you would like to contribute to the Ficl release, please
** contact me by email at the address above.
**
** L I C E N S E  and  D I S C L A I M E R
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
** 1. Redistributions of source code must retain the above copyright
**    notice, this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright
**    notice, this list of conditions and the following disclaimer in the
**    documentation and/or other materials provided with the distribution.
**
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
** ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
** SUCH DAMAGE.
*/

//#include <stdint.h>

#include "ficl.h"

#if FICL_PLATFORM_HAS_2INTEGER

ficl2UnsignedQR ficl2UnsignedDivide(ficl2Unsigned q, ficlUnsigned y)
{
    ficl2UnsignedQR result;

    result.quotient = q / y;
	/*
	** Once we have the quotient, it's cheaper to calculate the
	** remainder this way than with % (mod).  --lch
	*/
    result.remainder  = (ficlInteger)(q - (result.quotient * y));

    return result;
}

#else  /* FICL_PLATFORM_HAS_2INTEGER */

#define FICL_CELL_HIGH_BIT  ((uintmax_t)1 << (FICL_BITS_PER_CELL-1))
#define UMOD_SHIFT (FICL_BITS_PER_CELL / 2)
#define UMOD_MASK ((1L << (FICL_BITS_PER_CELL / 2)) - 1)

/**************************************************************************
                        ficl2IntegerIsNegative
** Returns TRUE if the specified ficl2Unsigned has its sign bit set.
**************************************************************************/
int ficl2IntegerIsNegative(ficl2Integer x)
{
    return (x.high < 0);
}

/**************************************************************************
                        ficl2IntegerNegate
** Negates an ficl2Unsigned by complementing and incrementing.
**************************************************************************/
ficl2Integer ficl2IntegerNegate(ficl2Integer x)
{
    x.high = ~x.high;
    x.low = ~x.low;
    x.low ++;
    if (x.low == 0)
        x.high++;

    return x;
}

/**************************************************************************
                        ficl2UnsignedMultiplyAccumulate
** Mixed precision multiply and accumulate primitive for number building.
** Multiplies ficl2Unsigned u by ficlUnsigned mul and adds ficlUnsigned add. Mul is typically
** the numeric base, and add represents a digit to be appended to the
** growing number.
** Returns the result of the operation
**************************************************************************/
ficl2Unsigned ficl2UnsignedMultiplyAccumulate(ficl2Unsigned u, ficlUnsigned mul, ficlUnsigned add)
{
    ficl2Unsigned resultLo = ficl2UnsignedMultiply(u.low, mul);
    ficl2Unsigned resultHi = ficl2UnsignedMultiply(u.high, mul);
    resultLo.high += resultHi.low;
    resultHi.low = resultLo.low + add;

    if (resultHi.low < resultLo.low)
        resultLo.high++;

    resultLo.low = resultHi.low;

    return resultLo;
}

/**************************************************************************
                        ficl2IntegerMultiply
** Multiplies a pair of ficlIntegers and returns an ficl2Integer result.
**************************************************************************/
ficl2Integer ficl2IntegerMultiply(ficlInteger x, ficlInteger y)
{
    ficl2Unsigned prod;
    int sign = 1;

    if (x < 0)
    {
        sign = -sign;
        x = -x;
    }

    if (y < 0)
    {
        sign = -sign;
        y = -y;
    }

    prod = ficl2UnsignedMultiply(x, y);
    if (sign > 0)
        return FICL_2UNSIGNED_TO_2INTEGER(prod);
    else
        return ficl2IntegerNegate(FICL_2UNSIGNED_TO_2INTEGER(prod));
}

ficl2Integer ficl2IntegerDecrement(ficl2Integer x)
{
	if (x.low == INT_MIN)
		x.high--;
	x.low--;

	return x;
}

ficl2Unsigned ficl2UnsignedAdd(ficl2Unsigned x, ficl2Unsigned y)
{
    ficl2Unsigned result;
    int carry;

    result.high = x.high + y.high;
    result.low = x.low + y.low;

    carry  = ((x.low | y.low) & FICL_CELL_HIGH_BIT) && !(result.low & FICL_CELL_HIGH_BIT);
    carry |= ((x.low & y.low) & FICL_CELL_HIGH_BIT);

    if (carry)
    {
        result.high++;
    }

    return result;
}

/**************************************************************************
                        ficl2UnsignedMultiply
** Contributed by:
** Michael A. Gauland   gaulandm@mdhost.cse.tek.com
**************************************************************************/
ficl2Unsigned ficl2UnsignedMultiply(ficlUnsigned x, ficlUnsigned y)
{
    ficl2Unsigned result = { 0, 0 };
    ficl2Unsigned addend;

    addend.low = y;
    addend.high = 0; /* No sign extension--arguments are unsigned */

    while (x != 0)
    {
        if ( x & 1)
        {
            result = ficl2UnsignedAdd(result, addend);
        }
        x >>= 1;
        addend = ficl2UnsignedArithmeticShiftLeft(addend);
    }
    return result;
}

/**************************************************************************
                        ficl2UnsignedSubtract
**
**************************************************************************/
ficl2Unsigned ficl2UnsignedSubtract(ficl2Unsigned x, ficl2Unsigned y)
{
    ficl2Unsigned result;

    result.high = x.high - y.high;
    result.low = x.low - y.low;

    if (x.low < y.low)
    {
        result.high--;
    }

    return result;
}

/**************************************************************************
                        ficl2UnsignedArithmeticShiftLeft
** 64 bit left shift
**************************************************************************/
ficl2Unsigned ficl2UnsignedArithmeticShiftLeft( ficl2Unsigned x )
{
    ficl2Unsigned result;

    result.high = x.high << 1;
    if (x.low & FICL_CELL_HIGH_BIT)
    {
        result.high++;
    }

    result.low = x.low << 1;

    return result;
}

/**************************************************************************
                        ficl2UnsignedArithmeticShiftRight
** 64 bit right shift (unsigned - no sign extend)
**************************************************************************/
ficl2Unsigned ficl2UnsignedArithmeticShiftRight( ficl2Unsigned x )
{
    ficl2Unsigned result;

    result.low = x.low >> 1;
    if (x.high & 1)
    {
        result.low |= FICL_CELL_HIGH_BIT;
    }

    result.high = x.high >> 1;
    return result;
}

/**************************************************************************
                        ficl2UnsignedOr
** 64 bit bitwise OR
**************************************************************************/
ficl2Unsigned ficl2UnsignedOr( ficl2Unsigned x, ficl2Unsigned y )
{
    ficl2Unsigned result;

    result.high = x.high | y.high;
    result.low = x.low | y.low;

    return result;
}

/**************************************************************************
                        ficl2UnsignedCompare
** Return -1 if x < y; 0 if x==y, and 1 if x > y.
**************************************************************************/
int ficl2UnsignedCompare(ficl2Unsigned x, ficl2Unsigned y)
{
    if (x.high > y.high)
        return 1;
    if (x.high < y.high)
        return -1;

	/* High parts are equal */

    if (x.low > y.low)
        return 1;
    else if (x.low < y.low)
        return -1;

    return 0;
}

/**************************************************************************
                        ficl2UnsignedDivide
** Portable versions of ficl2Multiply and ficl2Divide in C
** Contributed by:
** Michael A. Gauland   gaulandm@mdhost.cse.tek.com
**************************************************************************/
ficl2UnsignedQR ficl2UnsignedDivide(ficl2Unsigned q, ficlUnsigned y)
{
    ficl2UnsignedQR result;
    ficl2Unsigned quotient;
    ficl2Unsigned subtrahend;
    ficl2Unsigned mask;

    quotient.low = 0;
    quotient.high = 0;

    subtrahend.low = y;
    subtrahend.high = 0;

    mask.low = 1;
    mask.high = 0;

    while ((ficl2UnsignedCompare(subtrahend, q) < 0) &&
           (subtrahend.high & FICL_CELL_HIGH_BIT) == 0)
    {
        mask = ficl2UnsignedArithmeticShiftLeft(mask);
        subtrahend = ficl2UnsignedArithmeticShiftLeft(subtrahend);
    }

    while (mask.low != 0 || mask.high != 0)
    {
        if (ficl2UnsignedCompare(subtrahend, q) <= 0)
        {
            q = ficl2UnsignedSubtract( q, subtrahend);
            quotient = ficl2UnsignedOr(quotient, mask);
        }
        mask = ficl2UnsignedArithmeticShiftRight(mask);
        subtrahend = ficl2UnsignedArithmeticShiftRight(subtrahend);
    }

    result.quotient = quotient;
    result.remainder = q.low;
    return result;
}

#endif /* !FICL_PLATFORM_HAS_2INTEGER */

/**************************************************************************
                        ficl2IntegerAbsoluteValue
** Returns the absolute value of an ficl2Unsigned
**************************************************************************/
ficl2Integer ficl2IntegerAbsoluteValue(ficl2Integer x)
{
    if (ficl2IntegerIsNegative(x))
        return ficl2IntegerNegate(x);
    return x;
}

/**************************************************************************
                        ficl2IntegerDivideFloored
**
** FROM THE FORTH ANS...
** Floored division is integer division in which the remainder carries
** the sign of the divisor or is zero, and the quotient is rounded to
** its arithmetic floor. Symmetric division is integer division in which
** the remainder carries the sign of the dividend or is zero and the
** quotient is the mathematical quotient rounded towards zero or
** truncated. Examples of each are shown in tables 3.3 and 3.4.
**
** Table 3.3 - Floored Division Example
** Dividend        Divisor Remainder       Quotient
** --------        ------- ---------       --------
**  10                7       3                1
** -10                7       4               -2
**  10               -7      -4               -2
** -10               -7      -3                1
**
**
** Table 3.4 - Symmetric Division Example
** Dividend        Divisor Remainder       Quotient
** --------        ------- ---------       --------
**  10                7       3                1
** -10                7      -3               -1
**  10               -7       3               -1
** -10               -7      -3                1
**************************************************************************/
ficl2IntegerQR ficl2IntegerDivideFloored(ficl2Integer num, ficlInteger den)
{
    ficl2IntegerQR qr;
    ficl2UnsignedQR uqr;
    int signRem = 1;
    int signQuot = 1;

    if (ficl2IntegerIsNegative(num))
    {
        num = ficl2IntegerNegate(num);
        signQuot = -signQuot;
    }

    if (den < 0)
    {
        den      = -den;
        signRem  = -signRem;
        signQuot = -signQuot;
    }

    uqr = ficl2UnsignedDivide(FICL_2INTEGER_TO_2UNSIGNED(num), (ficlUnsigned)den);
    qr = FICL_2UNSIGNEDQR_TO_2INTEGERQR(uqr);
    if (signQuot < 0)
    {
        qr.quotient = ficl2IntegerNegate(qr.quotient);
        if (qr.remainder != 0)
        {
            qr.quotient = ficl2IntegerDecrement(qr.quotient);
            qr.remainder = den - qr.remainder;
        }
    }

    if (signRem < 0)
        qr.remainder = -qr.remainder;

    return qr;
}

/**************************************************************************
                        ficl2IntegerDivideSymmetric
** Divide an ficl2Unsigned by a ficlInteger and return a ficlInteger quotient and a
** ficlInteger remainder. The absolute values of quotient and remainder are not
** affected by the signs of the numerator and denominator (the operation
** is symmetric on the number line)
**************************************************************************/
ficl2IntegerQR ficl2IntegerDivideSymmetric(ficl2Integer num, ficlInteger den)
{
    ficl2IntegerQR qr;
    ficl2UnsignedQR uqr;
    int signRem = 1;
    int signQuot = 1;

    if (ficl2IntegerIsNegative(num))
    {
        num = ficl2IntegerNegate(num);
        signRem  = -signRem;
        signQuot = -signQuot;
    }

    if (den < 0)
    {
        den      = -den;
        signQuot = -signQuot;
    }

    uqr = ficl2UnsignedDivide(FICL_2INTEGER_TO_2UNSIGNED(num), (ficlUnsigned)den);
    qr = FICL_2UNSIGNEDQR_TO_2INTEGERQR(uqr);
    if (signRem < 0)
        qr.remainder = -qr.remainder;

    if (signQuot < 0)
        qr.quotient = ficl2IntegerNegate(qr.quotient);

    return qr;
}


text:
        {{:: option.label | translate}}

            <input class="form-control" type="text" data-ng-model="config[ option.name ][0]" >

            <input class="form-control" type="password" data-ng-model="config[ option.name ][0]" >

            <input ng-model="config[ option.name ][0]" value="'true'" id="option.name" name="option.name" onoffswitchstring on-text="{{:: 'onText' | translate}}" off-text="{{:: 'offText' | translate}}"/>

            <select ng-model="config[ option.name ][0]" ng-options="data for data in option.options">
                <option value="" selected> {{:: 'selectOne' | translate}} </option>
            </select>

            <select ui-select2 data-ng-model="config[ option.name ]" data-placeholder="{{:: 'selectMultiple' | translate}}..." multiple>
                <option ng-repeat="val in option.options" value="{{val}}" ng-selected="true">{{val}}</option>
            </select>

                    <input class="form-control" type="text" data-ng-model="config[ option.name ][0]" >

                    <button type="submit" data-ng-click="openRoleSelector(option.name, config)" class="btn btn-default" tooltip-placement="top" tooltip-trigger="mouseover mouseout" tooltip="{{:: 'selectRole.tooltip' | translate}}">{{:: 'selectRole.label' | translate}}</button>

            <select ng-model="config[ option.name ][0]" ng-options="client.clientId as client.clientId for client in clients">
                <option value="" selected> {{:: 'selectOne' | translate}} </option>
            </select>

                <input class="form-control" type="text" data-ng-model="config[option.name][0]" >
                {{:: 'select-file' | translate}}
                <input id="{{option.name}}" type="file" class="hidden" ng-file-select="uploadFile($files, option.name, config)">

                {{config[option.name]}}

                <input class="form-control" ng-model="config[option.name][i]">

                    <button class="btn btn-default" type="button" data-ng-click="deleteValueFromMultivalued(option.name, $index)"></button>

                <input class="form-control" ng-model="newValues[option.name]">

                    <button class="btn btn-default" type="button" data-ng-click="newValues[option.name].length > 0 && addValueToMultivalued(option.name)"></button>

        <kc-tooltip>{{:: option.helpText | translate}}</kc-tooltip>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="rustdoc">
    <meta name="description" content="API documentation for the Rust `FromBase64Error` enum in crate `rustc_serialize`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, FromBase64Error">

    <title>rustc_serialize::base64::FromBase64Error - Rust</title>

    <link rel="stylesheet" type="text/css" href="../../normalize.css">
    <link rel="stylesheet" type="text/css" href="../../rustdoc.css">
    <link rel="stylesheet" type="text/css" href="../../main.css">

    <link rel="shortcut icon" href="https://www.rust-lang.org/favicon.ico">

rustc_serialize::<wbr>base64

        <form class="search-form js-only">

                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press 'S' to search, '?' for more options…"
                       type="search">

        </form>

Enum rustc_serialize::<wbr>base64::<wbr>FromBase64Error

                       [−]

               [src]

pub enum FromBase64Error {
    InvalidBase64Byte(u8, usize),
    InvalidBase64Length,
}

Errors that can occur when decoding a base64 encoded string

Variants

InvalidBase64Byte(u8, usize)

The input contained a character not part of the base64 format

InvalidBase64Length

The input had an invalid length

Trait Implementations

impl Clone for FromBase64Error

[src]

fn clone(&self) -> FromBase64Error

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Copy for FromBase64Error

[src]

impl Debug for FromBase64Error

[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Error for FromBase64Error

[src]

fn description(&self) -> &str

A short description of the error. Read more

fn cause(&self) -> Option<&Error>
1.0.0

The lower-level cause of this error, if any. Read more

impl Display for FromBase64Error

[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter. Read more

Help

Keyboard Shortcuts

?

Show this help dialog

S

Focus the search field

⇤

Move up in search results

⇥

Move down in search results

⏎

Go to active search result

+

Collapse/expand all sections

Search Tricks

                    Prefix searches with a type followed by a colon (e.g.
                    fn:) to restrict the search to a given type.

                    Accepted types are: fn, mod,
                    struct, enum,
                    trait, type, macro,
                    and const.

                    Search functions by type signature (e.g.
                    vec -> usize or * -> vec)


text:
layout: shop
title: Your Cart
permalink: /shop/cart/
type: page
---

        info_outline

      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
        ×
      </button>
      Hey there! Our chefs are still cooking up our shop in the kitchen, so you won't be able to purchase anything just yet.

Cart shopping_cart

            Product
            Price
            Qty
            Amount

              FoodSpan Big Box Kit

              $69.99

              1

                <button class="btn btn-round btn-rose btn-xs"> remove </button>
                <button class="btn btn-round btn-rose btn-xs"> add </button>

              $69.99

              <button type="button" rel="tooltip" data-placement="left" title="Remove item" class="btn btn-simple">
                  close
              </button>

              10 FoodSpan Tags

              $5.99

              2

                <button class="btn btn-round btn-rose btn-xs"> remove </button>
                <button class="btn btn-round btn-rose btn-xs"> add </button>

              $11.98

              <button type="button" rel="tooltip" data-placement="left" title="Remove item" class="btn btn-simple">
                close
              </button>

             Total

              $81.97

              <button type="button" class="btn btn-rose btn-round" data-toggle="modal" data-target="#purchaseAlert">Complete Purchase keyboard_arrow_right</button>

                local_shipping

Delivers to your Home

After getting your awesome FoodSpan purchase, we'll ship it straight to your address! If you live in Canada, we'll ship with Canada Post for a nominal fee. It'll be at your house within 9 business days. If you live outside of Canada, it'll cost a bit more and you'll have to pay for customs: we can't guarantee a time. That being said, we're working on connecting FoodSpan to countries all over the world!

                verified_user

Refunds and Warranty

We want to make sure that FoodSpan is an amazing experience for you, but if something goes wrong, we want to help. If you're not satisfied with our product, you can return it and receive a refund on your purchase; and if something breaks or goes wrong within six months of your purchase, we're happy to replace it. Read more on our policy here.

                favorite

Made With Love

All of our products are made with the blood, sweat, and tears of joy from our FoodSpan team. We've put our 100% into making everything here. We're dedicated towards making a dent in the behemoth of food insecurity, with FoodSpan. Hopefully you'll love it as much as we do.

Warranty and Refund Policy

          FoodSpan will offer a thirty-day return policy, allowing customers to mail back their unused purchase within thirty days after receiving the shipment and at their own expense in order to receive a full refund. We will have a limited warranty policy allowing for a refund or replacement of the components of a FoodSpan product if they display signs of defection due to workmanship in the six months prior to purchase; this warranty does not cover any problems due to damage inflicted upon the products, and transportation will be paid for by FoodSpan in these instances.

        <button type="button" class="btn btn-simple" data-dismiss="modal">Go back</button>

Our shop is still in the works.

          As such, you can't actually purchase anything yet. We'll let you know when you can!

        <button type="button" class="btn btn-simple" data-dismiss="modal">Go back</button>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>
Overview (obvious-example 0.0.1-SNAPSHOT API)
</TITLE>

<META NAME="date" CONTENT="2011-05-19">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

    Overview
      Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

obvious-example 0.0.1-SNAPSHOT API

Packages

obvious.demo.io
Package obvious.demo.io

 TODO document the package.

obvious.demo.ivtk
Package obvious.demo.ivtk

 Contains demos from ivtk toolkit written in the obvious way.

obvious.demo.jung
Package obvious.demo.jung

 Contains demos from jung toolkit written in the obvious way.

obvious.demo.misc
Package obvious.demo.mix

 This package contains example created during the development of obvious to
 test newly introduced features.

obvious.demo.networkapp
Package obvious.demo.networkapp

 TODO document the package.

obvious.demo.paper
Package obvious.demo.article

 This package.

obvious.demo.predicate
Package obvious.demo.predicate

 TODO document the package.

obvious.demo.prefuse
Package obvious.demo.prefuse

 Contains demos from prefuse toolkit written in the obvious way.

obvious.demo.sandbox
Package obvious.demo.sandbox

 Contains demos using prefuse and obvious in a polylithic way.

obvious.demo.scatterplotapp
Package obvious.demo.scatterplotapp

 TODO document the package.

obvious.demo.transaction
Package obvious.demo.transaction

 TODO document the package.

    Overview
      Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2011. All Rights Reserved.


text:
package pl.gda.pg.student.project.server.helpers;

import com.badlogic.gdx.math.Vector2;

public class BombLegalPositionFinder {
    private final static int TILE_SIZE = 27;

    public Vector2 countBombLegalPosition(Vector2 playerPosition){
        Vector2 bombPosition = new Vector2();
        int playerPositionX = (int)playerPosition.x;
        int playerPositionY = (int)playerPosition.y;
        int fazeX = playerPositionX%TILE_SIZE;
        int fazeY = playerPositionY%TILE_SIZE;
        int noOfTileX = playerPositionX/TILE_SIZE;
        int noOfTileY = playerPositionY/TILE_SIZE;
        if(fazeX > TILE_SIZE/2)
            noOfTileX++;
        if(fazeY > TILE_SIZE/2)
            noOfTileY++;
        float bombPositionX = noOfTileX*TILE_SIZE;
        float bombPositionY = noOfTileY*TILE_SIZE;
        bombPosition.set(bombPositionX, bombPositionY);
        System.out.println(bombPosition);
        return bombPosition;
    }
}


text:
import React, { SFC } from 'react';
import * as propTypes from 'prop-types';
import { StatusBar, View } from 'react-native';
import tinycolor from 'tinycolor2';

// tslint:disable-next-line:variable-name
const SBar: any = StatusBar;

export interface IAdaptiveStatusBarProps {
	colorBehindStatusBar: string;
}

const adaptiveStatusBar: SFC<IAdaptiveStatusBarProps> = ({ colorBehindStatusBar }) => {
	return (
		<View>
			{tinycolor(colorBehindStatusBar).isLight() ?
				<SBar translucent barStyle="dark-content" backgroundColor={colorBehindStatusBar}/> :
				<SBar translucent barStyle="light-content" backgroundColor={colorBehindStatusBar}/>
			}
		</View>
	);
};
adaptiveStatusBar.propTypes = {
	colorBehindStatusBar:  propTypes.string.isRequired,
};
adaptiveStatusBar.displayName = 'AdaptiveStatusBar';

export default adaptiveStatusBar;


text:
#ifndef vtkMPI_h
#define vtkMPI_h

#ifndef USE_STDARG
 #define USE_STDARG
#include "vtkParallelMPIModule.h" // For export macro
 #include "mpi.h"
 #undef USE_STDARG
#else
 #include "mpi.h"
#endif

#include "vtkSystemIncludes.h"

class VTKPARALLELMPI_EXPORT vtkMPICommunicatorOpaqueComm
{
public:
  vtkMPICommunicatorOpaqueComm(MPI_Comm* handle = 0);

  MPI_Comm* GetHandle();

  friend class vtkMPICommunicator;
  friend class vtkMPIController;

protected:
  MPI_Comm* Handle;
};

class VTKPARALLELMPI_EXPORT vtkMPICommunicatorReceiveDataInfo
{
public:
  vtkMPICommunicatorReceiveDataInfo()
    {
    this->Handle=0;
    }
  MPI_Datatype DataType;
  MPI_Status Status;
  MPI_Comm* Handle;
};

class VTKPARALLELMPI_EXPORT vtkMPIOpaqueFileHandle
{
public:
  vtkMPIOpaqueFileHandle() : Handle(MPI_FILE_NULL) { }
  MPI_File Handle;
};

//-----------------------------------------------------------------------------
class vtkMPICommunicatorOpaqueRequest
{
public:
  MPI_Request Handle;
};

#endif // vtkMPI_h
// VTK-HeaderTest-Exclude: vtkMPI.h


text:
spawncamping-lana
=================

utility-files


text:
using System.IO;
using FluentAssertions;
using TestableFileSystem.Fakes.Builders;
using TestableFileSystem.Interfaces;
using Xunit;

namespace TestableFileSystem.Fakes.Tests.Specs.FakeFileInfo
{
    public sealed class FileInfoOpenSpecs
    {
        [Fact]
        private void When_opening_file_it_must_succeed()
        {
            // Arrange
            const string path = @"c:\some\file.txt";
            const string fileContents = "DEMO";

            IFileSystem fileSystem = new FakeFileSystemBuilder()
                .IncludingTextFile(path, fileContents)
                .Build();

            IFileInfo fileInfo = fileSystem.ConstructFileInfo(path);

            string contentsRead;

            // Act
            using (StreamReader reader = fileInfo.OpenText())
            {
                contentsRead = reader.ReadToEnd();
            }

            // Assert
            contentsRead.Should().Be(fileContents);
        }

        [Fact]
        private void When_opening_file_it_must_update_cache_on_refresh()
        {
            // Arrange
            const string path = @"c:\some\file.txt";

            IFileSystem fileSystem = new FakeFileSystemBuilder()
                .IncludingDirectory(@"c:\some")
                .Build();

            IFileInfo fileInfo = fileSystem.ConstructFileInfo(path);

            bool beforeFound = fileInfo.Exists;

            using (fileInfo.OpenWrite())
            {
            }

            // Act
            fileInfo.Refresh();

            // Assert
            bool afterFound = fileInfo.Exists;

            beforeFound.Should().BeFalse();
            afterFound.Should().BeTrue();
        }

        [Fact]
        private void When_opening_file_it_must_not_refresh_automatically()
        {
            // Arrange
            const string path = @"c:\some\file.txt";

            IFileSystem fileSystem = new FakeFileSystemBuilder()
                .IncludingDirectory(@"c:\some")
                .Build();

            IFileInfo fileInfo = fileSystem.ConstructFileInfo(path);

            bool beforeFound = fileInfo.Exists;

            // Act
            using (fileInfo.OpenWrite())
            {
            }

            // Assert
            bool afterFound = fileInfo.Exists;

            beforeFound.Should().BeFalse();
            afterFound.Should().BeFalse();
        }
    }
}


text:
using System;
using System.Runtime.InteropServices;

namespace OpenLiveWriter.Interop.Com
{
    [ComImport]
    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    [Guid("00000002-0000-0000-C000-000000000046")]
    public interface IMalloc
    {
        [PreserveSig]
        IntPtr Alloc(int cb);

        [PreserveSig]
        IntPtr Realloc(IntPtr pv, int cb);

        [PreserveSig]
        void Free(IntPtr pv);

        [PreserveSig]
        uint GetSize(IntPtr pv);

        [PreserveSig]
        int DidAlloc(IntPtr pv);

        [PreserveSig]
        void HeapMinimize();
    }
}


text:
/*
 * Code for the DLL that will be injected in the target process.
 *
 * The injected DLL will manipulate the import tables to hook the
 * modules/functions of interest.
 *
 * See also:
 * - http://www.codeproject.com/KB/system/api_spying_hack.aspx
 * - http://www.codeproject.com/KB/threads/APIHooking.aspx
 * - http://msdn.microsoft.com/en-us/magazine/cc301808.aspx
 */

#include <windows.h>
#include <sddl.h>

static void
#ifdef __GNUC__
    __attribute__ ((format (printf, 1, 2)))
#endif
debugPrintf(const char *format, ...);

static void
logLastError(const char *szMsg)
{
    DWORD dwLastError = GetLastError();

    // http://msdn.microsoft.com/en-gb/library/windows/desktop/ms680582.aspx
    LPSTR lpErrorMsg = NULL;
    DWORD cbWritten;
    cbWritten = FormatMessage(
        FORMAT_MESSAGE_ALLOCATE_BUFFER |
        FORMAT_MESSAGE_FROM_SYSTEM |
        FORMAT_MESSAGE_IGNORE_INSERTS,
        NULL,
        dwLastError,
        MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
        (LPSTR) &lpErrorMsg,
        0, NULL);

    if (cbWritten) {
        debugPrintf("inject: error: %s: %s", szMsg, lpErrorMsg);
    } else {
        debugPrintf("inject: error: %s: %lu\n", szMsg, dwLastError);
    }

    LocalFree(lpErrorMsg);
}

static inline const char *
getSeparator(const char *szFilename) {
    const char *p, *q;
    p = NULL;
    q = szFilename;
    char c;
    do  {
        c = *q++;
        if (c == '\\' || c == '/' || c == ':') {
            p = q;
        }
    } while (c);
    return p;
}

static inline const char *
getBaseName(const char *szFilename) {
    const char *pSeparator = getSeparator(szFilename);
    if (!pSeparator) {
        return szFilename;
    }
    return pSeparator;
}

static inline void
getDirName(char *szFilename) {
    char *pSeparator = const_cast<char *>(getSeparator(szFilename));
    if (pSeparator) {
        *pSeparator = '\0';
    }
}

static inline void
getModuleName(char *szModuleName, size_t n, const char *szFilename) {
    char *p = szModuleName;
    const char *q = getBaseName(szFilename);
    char c;
    while (--n) {
        c = *q++;
        if (c == '.' || c == '\0') {
            break;
        }
        *p++ = c;
    };
    *p++ = '\0';
}

#define USE_SHARED_MEM 1

struct SharedMem
{
    BOOL bReplaced;
    char cVerbosity;
    char szDllName[4096 - sizeof(BOOL)];
};

static SharedMem *pSharedMem = NULL;
static HANDLE hFileMapping = NULL;

static SharedMem *
OpenSharedMemory(SECURITY_DESCRIPTOR *lpSecurityDescriptor)
{
    if (pSharedMem) {
        return pSharedMem;
    }

    SECURITY_ATTRIBUTES sa;
    ZeroMemory(&sa, sizeof sa);
    sa.nLength = sizeof sa;
    sa.bInheritHandle = TRUE;
    sa.lpSecurityDescriptor = lpSecurityDescriptor;

    hFileMapping = CreateFileMapping(
        INVALID_HANDLE_VALUE,   // system paging file
        &sa,                    // lpAttributes
        PAGE_READWRITE,         // read/write access
        0,                      // dwMaximumSizeHigh
        sizeof(SharedMem),      // dwMaximumSizeLow
        TEXT("injectfilemap")); // name of map object

    if (hFileMapping == NULL) {
        logLastError("failed to create file mapping");
        return NULL;
    }

    BOOL bAlreadyExists = (GetLastError() == ERROR_ALREADY_EXISTS);

    pSharedMem = (SharedMem *)MapViewOfFile(
        hFileMapping,
        FILE_MAP_WRITE, // read/write access
        0,              // dwFileOffsetHigh
        0,              // dwFileOffsetLow
        0);             // dwNumberOfBytesToMap (entire file)
    if (pSharedMem == NULL) {
        logLastError("failed to map view");
        return NULL;
    }

    if (!bAlreadyExists) {
        memset(pSharedMem, 0, sizeof *pSharedMem);
    }

    return pSharedMem;
}

static inline VOID
CloseSharedMem(void) {
    if (!pSharedMem) {
        return;
    }

    UnmapViewOfFile(pSharedMem);
    pSharedMem = NULL;

    CloseHandle(hFileMapping);
    hFileMapping = NULL;
}

/*
 * XXX: Mixed architecture don't quite work.  See also
 * http://www.corsix.org/content/dll-injection-and-wow64
 */
static BOOL
isDifferentArch(HANDLE hProcess)
{
    typedef BOOL (WINAPI *PFNISWOW64PROCESS)(HANDLE, PBOOL);
    PFNISWOW64PROCESS pfnIsWow64Process;
    pfnIsWow64Process = (PFNISWOW64PROCESS)
        GetProcAddress(GetModuleHandleA("kernel32"), "IsWow64Process");
    if (!pfnIsWow64Process) {
        return FALSE;
    }

#ifdef _WIN64
    BOOL isThisWow64 = FALSE;
#else
    BOOL isThisWow64 = TRUE;
#endif

    BOOL isOtherWow64 = FALSE;
    if (!pfnIsWow64Process(hProcess, &isOtherWow64)) {
        logLastError("IsWow64Process failed");
        return FALSE;
    }

    return bool(isThisWow64) != bool(isOtherWow64);
}

static BOOL
injectDll(HANDLE hProcess, const char *szDllPath)
{
    BOOL bRet = FALSE;
    PTHREAD_START_ROUTINE lpStartAddress;
    HANDLE hThread;
    DWORD hModule;

    // Allocate memory in the target process to hold the DLL name
    size_t szDllPathLength = strlen(szDllPath) + 1;
    void *lpMemory = VirtualAllocEx(hProcess, NULL, szDllPathLength, MEM_COMMIT, PAGE_READWRITE);
    if (!lpMemory) {
        logLastError("failed to allocate memory in the process");
        goto no_memory;
    }

    // Copy DLL name into the target process
    if (!WriteProcessMemory(hProcess, lpMemory, szDllPath, szDllPathLength, NULL)) {
        logLastError("failed to write into process memory");
        goto no_thread;
    }

    /*
     * Get LoadLibraryA address from kernel32.dll.  It's the same for all the
     * process (XXX: but only within the same architecture).
     */
    lpStartAddress =
        (PTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandleA("KERNEL32"), "LoadLibraryA");

    // Create remote thread in another process
    hThread = CreateRemoteThread(hProcess, NULL, 0, lpStartAddress, lpMemory, 0, NULL);
    if (!hThread) {
        logLastError("failed to create remote thread");
        goto no_thread;
    }

    // Wait for it to finish
    WaitForSingleObject(hThread, INFINITE);

    GetExitCodeThread(hThread, &hModule);
    if (!hModule) {
        debugPrintf("inject: error: failed to load %s into the remote process %lu\n",
                    szDllPath, GetProcessId(hProcess));
    } else {
        bRet = TRUE;
    }

    CloseHandle(hThread);
no_thread:
    VirtualFreeEx(hProcess, lpMemory, 0, MEM_RELEASE);
no_memory:
    return bRet;
}


text:
<?php

namespace spec\Sylius\Component\Shipping\Processor;

use PhpSpec\ObjectBehavior;
use Sylius\Component\Shipping\Model\ShipmentInterface;
use Sylius\Component\Shipping\Model\ShipmentItemInterface;

/**
 * @author Saša Stamenković <umpirsky@gmail.com>
 */
class ShipmentProcessorSpec extends ObjectBehavior
{
    function it_is_initializable()
    {
        $this->shouldHaveType('Sylius\Component\Shipping\Processor\ShipmentProcessor');
    }

    function it_implements_Sylius_shipment_processor_interface()
    {
        $this->shouldImplement('Sylius\Component\Shipping\Processor\ShipmentProcessorInterface');
    }

    function it_updates_shipment_states(
        ShipmentInterface $shipment,
        ShipmentItemInterface $item
    )
    {
        $shipment->getState()->shouldBeCalled()->willReturn(ShipmentInterface::STATE_READY);
        $shipment->setState(ShipmentInterface::STATE_SHIPPED)->shouldBeCalled();
        $shipment->getItems()->shouldBeCalled()->willReturn(array($item));

        $item->getShippingState()->shouldBeCalled()->willReturn(ShipmentInterface::STATE_READY);
        $item->setShippingState(ShipmentInterface::STATE_SHIPPED)->shouldBeCalled();

        $this->updateShipmentStates(array($shipment), ShipmentInterface::STATE_SHIPPED, ShipmentInterface::STATE_READY);
    }

    function it_does_not_update_shipment_states_if_state_from_does_not_match(
        ShipmentInterface $shipment,
        ShipmentItemInterface $item
    )
    {
        $shipment->getState()->shouldBeCalled()->willReturn(ShipmentInterface::STATE_SHIPPED);
        $shipment->setState(ShipmentInterface::STATE_SHIPPED)->shouldNotBeCalled();

        $item->getShippingState()->shouldNotBeCalled();
        $item->setShippingState(ShipmentInterface::STATE_SHIPPED)->shouldNotBeCalled();

        $this->updateShipmentStates(array($shipment), ShipmentInterface::STATE_SHIPPED, ShipmentInterface::STATE_READY);
    }

    function it_updates_item_states(ShipmentItemInterface $item)
    {
        $item->getShippingState()->shouldBeCalled()->willReturn(ShipmentInterface::STATE_READY);
        $item->setShippingState(ShipmentInterface::STATE_SHIPPED)->shouldBeCalled();

        $this->updateItemStates(array($item), ShipmentInterface::STATE_SHIPPED, ShipmentInterface::STATE_READY);
    }

    function it_does_not_update_item_states_if_state_from_does_not_match(ShipmentItemInterface $item)
    {
        $item->getShippingState()->shouldBeCalled()->willReturn(ShipmentInterface::STATE_SHIPPED);
        $item->setShippingState(ShipmentInterface::STATE_SHIPPED)->shouldNotBeCalled();

        $this->updateItemStates(array($item), ShipmentInterface::STATE_SHIPPED, ShipmentInterface::STATE_READY);
    }
}