text:
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Mvc51ApplicationFx451.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            Trace.TraceInformation("This is an informational trace message");
            Trace.TraceWarning("Here is trace warning");
            Trace.TraceError("Something is broken; tracing an error!");

            return View();
        }

        public ActionResult About()
        {
            string blah = ConfigurationManager.AppSettings["blah"];
            ViewBag.Message = String.Format("The value of setting blah is: '{0}'", blah);

            return View();
        }

        private class Foo { }
        private static List<Foo> foos = new List<Foo>();

        public ActionResult Contact()
        {
            // Leak a bunch of objects for the fun of it!
            for (int i = 0; i < 100; i++)
            {
                foos.Add(new Foo());
            }

            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}


text:
using namespace std;

class Person {
	char name[50];
	float* costs;
	int noCosts;
public:
	Person() {
		strcpy(this->name, "John Doe");
		costs = NULL;
		this->noCosts = 0;
	}
	Person(char *Name,
		float *Costs,
		int noCosts) {
		strcpy(this->name, Name);
		this->costs = new float[noCosts];
		this->noCosts = noCosts;
		memcpy(this->costs,
			Costs,
			noCosts*sizeof(float));
	}

	~Person() {
		if (this->costs != NULL)
			delete [] costs;
	}

	Person& operator=(Person& p) {
		strcpy(this->name, p.name);
		if (this->costs != NULL)
			delete [] this->costs;
		this->costs = new float[p.noCosts];
		this->noCosts = p.noCosts;
		memcpy(this->costs,
			p.costs,
			noCosts*sizeof(float));
		return *this;
	}

	Person(Person &p) {
		strcpy(this->name, p.name);
		this->costs = new float[p.noCosts];
		this->noCosts = p.noCosts;
		memcpy(this->costs,
			p.costs,
			noCosts*sizeof(float));
	}

	friend ostream& operator<<(ostream& console, Person& p);
	friend void generateReport(
		char *fileName,
		Person *persons,
		int noPersons);

	friend void savePersons(char* fileName,
		Person * persons, int noPersons);

	friend void loadPersons(char* fileName,
		Person* & persons, int& noPersons);
};

ostream& operator<<(ostream& console, Person& p) {
	console << endl << "Name:" << p.name;
	console << endl << "Costs:";
	for (int i = 0; i < p.noCosts; i++)
		console << " " << p.costs[i];
	return console;
}

Person* getPersons(char* fileName, int& noPersons) {

	Person* arrayPersons = NULL;

	ifstream file;
	file.open(fileName, ifstream::in);
	if (!file.is_open())
		cout << "The file is not opened !";
	else {
		int noP;
		file >> noP;

		arrayPersons = new Person[noP];
		int index = 0;

		while (!file.eof() && noP>0) {
			char buffer[100];
			file >> buffer;
			int noCosts;
			file >> noCosts;
			float* costs = new float[noCosts];
			for (int i = 0; i < noCosts; i++)
				file >> costs[i];
			Person p(buffer, costs, noCosts);

			if (costs != NULL)
				delete [] costs;

			arrayPersons[index] = p;
			index++;
			noP--;

		}// from while

		noPersons = index;
		file.close();

	}//from else

	return arrayPersons;
}//from method

void generateReport(
	char *fileName,
	Person *persons,
	int noPersons) {

	ofstream file;
	file.open(fileName, ofstream::out | ofstream::app);
	if (!file.is_open()) {
		cout << endl << "Something not correct !";
	}
	else
	{
		for (int i = 0; i < noPersons; i++)
			file << endl <<"The person name is " << persons[i].name;
		file.close();
	}
}

//a method for saving the persons array in a binary file
//NOT WORKING - ONLY FOR DEMO
//void savePersons(char* fileName,
//	Person * persons, int noPersons) {
//	ofstream file;
//	file.open(fileName, ofstream::out | ofstream::trunc |
//		ofstream::binary);
//	if (file.is_open()) {
//		for (int i = 0; i < noPersons; i++) {
//			file.write((char*) &persons[i], sizeof(Person));
//		}
//		file.close();
//	}
//	else
//		cout << endl << "Not able to save data !";
//}

void savePersons(char* fileName,
	Person * persons, int noPersons) {
	ofstream file;
	file.open(fileName, ofstream::out | ofstream::trunc |
		ofstream::binary);
	if (file.is_open()) {
		for (int i = 0; i < noPersons; i++) {
			//write values
			//write the name - the entire string of 50B
			file.write(persons[i].name,sizeof(persons[i].name));

			//write no of costs
			file.write((char*) &persons[i].noCosts, sizeof(int));

			//write the costs values
			for (int j = 0; j < persons[i].noCosts; j++)
				file.write((char*) &persons[i].costs[j],
					sizeof(float));

			//file.write((char*) persons[i].costs,
			//	persons[i].noCosts*sizeof(float));
		}
		file.close();
	}
	else
		cout << endl << "Not able to save data !";
}

//void loadPersons(char* fileName,
//	Person* & persons, int& noPersons) {
//	ifstream file;
//	file.open(fileName, ifstream::in | ifstream::binary);
//	if (file.is_open()) {
//
//		file.seekg(0, fstream::end);
//		int fileSize = file.tellg();
//		noPersons = fileSize / sizeof(Person);
//		persons = new Person[noPersons];
//
//		file.seekg(0, fstream::beg);
//		for (int i = 0; i < noPersons; i++) {
//			file.read((char*) &persons[i], sizeof(Person));
//		}
//		file.close();
//	}
//	else
//		cout << endl << "Not able to load data !";
//}

void loadPersons(char* fileName,
	Person* & persons, int& noPersons) {
	ifstream file;
	file.open(fileName, ifstream::in | ifstream::binary);
	if (file.is_open()) {

		Person p;
		//determine the number of persons
		noPersons = 0;
		while (!file.eof()) {
			int noCosts = -1;
			file.seekg(sizeof(p.name), fstream::cur);
			file.read((char*) &noCosts, sizeof(int));
			if (noCosts == -1)
				break;
			file.seekg(noCosts*sizeof(float), fstream::cur);
			noPersons++;
		}

		file.close();
		file.open(fileName, ifstream::in | ifstream::binary);

		cout << endl << "There are " << noPersons << " Persons";

		persons = new Person[noPersons];
		file.seekg(0, fstream::beg);

		for (int i = 0; i < noPersons; i++) {
			//read name
			file.read(persons[i].name, sizeof(Person::name));
			//read the costs
			file.read((char*) &persons[i].noCosts, sizeof(int));
			persons[i].costs = new float[persons[i].noCosts];
			file.read((char*) persons[i].costs,
				persons[i].noCosts*sizeof(float));
		}
		file.close();
	}
	else
		cout << endl << "Not able to load data !";
}

void main() {
	//Person p1;
	//float costs [] = { 12.3, 56.9 };
	//Person p2("Gigel", costs, 2);

	//cout << p1;
	//cout << p2;

	//Person* persons = NULL;
	//int noPersons = 0;

	//persons = getPersons("Input.txt", noPersons);

	//for (int i = 0; i < noPersons; i++)
	//	cout << persons[i];

	//generateReport("Report.txt", persons, noPersons);

	//////save data
	//savePersons("Persons.data", persons, noPersons);

	Person *persons2 = NULL;
	int noPersons2 = 0;

	//load data
	loadPersons("Persons.data", persons2, noPersons2);
	cout << endl << "The new array:";

	for (int i = 0; i < noPersons2; i++)
		cout << persons2[i];

}

redpajama_set_name: RedPajamaGithub


text:
<!doctype html>

    <meta charset="utf-8">

    <title>{% block page_title %}

        GoldenEye

    {% endblock %}
    </title>
    <meta name="description" content="{% block meta_description %}{% endblock %}">
    <meta name="author" content="{% block meta_author %}{% endblock %}">

    <meta name="viewport" content="width=device-width">

    {{ stylesheet_tag('main_css') | safe }}

    {% block css %}

    {% endblock %}

    <form action="{{ url_for('public.login') }}" method="post" name="form" class="form-signin">

欢迎登录

        {% if  form.errors %}
            账号或密码错误!
        {% endif %}
        {{ form.hidden_tag() }}

        账号
        <input type="text" id="username" name="username"  class="form-control" placeholder="账号" required autofocus>
        密码
        <input type="password" id="password" name="password" class="form-control" placeholder="密码" required>

                <input type="checkbox" value="remember" name="remember" checked="checked"> Remember me

        {{ next }}
        <button class="btn btn-lg btn-primary btn-block" type="submit">登录</button>
    </form>

{{ javascript_tag('main_js') | safe }}
{% block js %}{% endblock %}


text:
class SelectManipulator : public Manipulator
{
    PB_DECLARE_ENTITY

protected:
    SelectManipulator(pb::Scene* scene, pb::Entity* parent, pb::DbEntity* creationEntity);
    virtual ~SelectManipulator();

public:
    virtual std::string GetManipulatorName();
    virtual char GetKey();

    virtual void Render(int layer);

    virtual bool OnMouseDown(pb::MouseButton button, pb::ModifierKeys modifierKeys, glm::vec2 position);
    virtual bool OnMouseUp(pb::MouseButton button, pb::ModifierKeys modifierKeys, glm::vec2 position);
    virtual bool OnMouseMove(glm::vec2 position);
    virtual bool OnKeyDown(pb::KeyboardKey key, pb::ModifierKeys modifier, char character);
    virtual bool OnKeyUp(pb::KeyboardKey key, pb::ModifierKeys modifier, char character);

    virtual void OnSetActive();
    virtual void OnSetInactive();

private:
    enum Mode
    {
        kModeMove,
        kModeRotate,
        kModeSelect,
    };

    bool _Active;
    Mode _Mode;
    glm::vec2 _MouseStart;
    glm::vec2 _MouseEnd;

    pb::RectangleComponent* _BoundsComponent;
};


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">

<meta name="generator" content="JDiff v1.1.1">

<meta name="description" content="JDiff is a Javadoc doclet which generates an HTML report of all the packages, classes, constructors, methods, and fields which have been removed, added or changed in any way, including their documentation, when two APIs are compared.">
<meta name="keywords" content="diff, jdiff, javadiff, java diff, java difference, API difference, difference between two APIs, API diff, Javadoc, doclet">
<TITLE>
com.google.inject.grapher.BindingEdge
</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="../stylesheet-jdiff.css" TITLE="Style">

       <tt>4.0</tt>
       Overview
       Package
        Class
       Text Changes
       Statistics
       Help

  Generated by
JDiff

 PREV CLASS
 NEXT CLASS

  FRAMES
   NO FRAMES
   DETAIL:
CONSTRUCTORS |
METHODS |
FIELDS

Class com.google.inject.grapher.<tt>BindingEdge</tt>

Documentation changed from <tt>old</tt> to <tt>new</tt>.

Changed from an interface to a class. Changed from abstract to non-abstract.

  Added Constructors

  <nobr><tt>BindingEdge</tt>(NodeId,</nobr> NodeId<nobr>,</nobr> Type<nobr><nobr>)</nobr>

  Removed Methods

  <nobr>void <tt>setType</tt>(Type)</nobr>

  Added Methods

  <nobr>Edge <tt>copy</tt>(NodeId,</nobr> NodeId<nobr><nobr>)</nobr>

  <nobr>boolean <tt>equals</tt>(Object)</nobr>

  <nobr>Type <tt>getType</tt>()</nobr>

  <nobr>int <tt>hashCode</tt>()</nobr>

  <nobr>String <tt>toString</tt>()</nobr>

       <tt>4.0</tt>
       Overview
       Package
        Class
       Text Changes
       Statistics
       Help

 PREV CLASS
 NEXT CLASS

  FRAMES
   NO FRAMES


text:
Test Driven Development using Jasmine.js

This is a project as part of the Javascript testing course on Udacity with @walesmd

my first crack at TDD.


text:
'use strict';

var path = require('path');

var keys = require('when/keys');
var mach = require('mach');

var reach = require('./lib/reach');
var template = require('./lib/template');
var construct = require('./lib/construct');
var renderIndex = require('./lib/renderIndex');

var Events = require('./collections/events');
var Comics = require('./collections/comics');

var getEvent = require('./lib/getEvent');
var getEvents = require('./lib/getEvents');
var getComics = require('./lib/getComics');

var createRouter = require('./router');

var server = mach.stack();

server.use(mach.file, {
  root: path.join(__dirname, '../common/'),
  useLastModified: true,
  useEtag: true
});

server.use(mach.file, {
  root: path.join(__dirname, './build/'),
  useLastModified: true,
  useEtag: true
});

server.get('*', function(request){
  var events = getEvents().fold(reach, 'data.results').fold(construct, Events);

  var router = createRouter();
  router.navigate(request.params.splat);

  var context = {
    eventList: events,
    router: router
  };

  return keys.all(context).then(renderIndex);
});

server.get('/favicon.ico', function(){
  return 404;
});

server.get('/events/:id.json', function(request){
  var event = getEvent(request.params.id).fold(reach, 'data.results.0');
  var comics = event.then(getComics).fold(reach, 'data.results').fold(construct, Comics);

  var context = {
    event: event,
    comics: comics
  };

  return keys.all(context).then(mach.json);
});

mach.serve(server, process.env.PORT);


text:
<?php
/**
 * Created by PhpStorm.
 * User: Rafidion Michael
 * Date: 28/03/2015
 * Time: 00:36
 */

namespace Mvc\BlogBundle\Util;

class Markdown {

    private $parser;

    public function __construct()
    {
        $this->parser = new \Parsedown();
    }

    public function toHtml($text)
    {
        $html = $this->parser->text($text);

        return $html;
    }
}


text:
using System;
using Xunit;

public partial class IntegrationTests
{
    [Fact]
    public void Equals_should_use_custom_logic()
    {
        var first = testResult.GetInstance("CustomEquals");
        first.X = 1;

        var second = testResult.GetInstance("CustomEquals");
        second.X = 2;

        var result = first.Equals(second);

        Assert.True(result);
    }

    [Fact]
    public void Equals_should_use_custom_logic_for_structure()
    {
        var first = testResult.GetInstance("CustomStructEquals");
        first.X = 1;

        var second = testResult.GetInstance("CustomStructEquals");
        second.X = 2;

        var result = first.Equals(second);

        Assert.True(result);
    }

    [Fact]
    public void Equals_should_use_custom_logic_for_generic_type()
    {
        var genericClassType = testResult.Assembly.GetType("CustomGenericEquals`1");
        var propType = typeof(int);
        var type = genericClassType.MakeGenericType(propType);

        dynamic first = Activator.CreateInstance(type);
        first.Prop = 1;
        dynamic second = Activator.CreateInstance(type);
        second.Prop = 1;
        dynamic third = Activator.CreateInstance(type);
        third.Prop = 2;

        Assert.True(first.Equals(second));
        Assert.False(first.Equals(third));
    }

    [Fact]
    public void GetHashCode_should_use_custom_logic()
    {
        var instance = testResult.GetInstance("CustomGetHashCode");
        instance.X = 1;

        var result = instance.GetHashCode();

        Assert.Equal(423, result);
    }

    [Fact]
    public void GetHashCode_should_use_custom_logic_for_structure()
    {
        var instance = testResult.GetInstance("CustomStructEquals");
        instance.X = 1;

        var result = instance.GetHashCode();

        Assert.Equal(42, result);
    }

    [Fact]
    public void GetHashCode_should_use_custom_logic_for_generic_type()
    {
        var genericClassType = testResult.Assembly.GetType("CustomGenericEquals`1");
        var propType = typeof(int);
        var type = genericClassType.MakeGenericType(propType);

        dynamic instance = Activator.CreateInstance(type);
        instance.Prop = 1;

        var result = instance.GetHashCode();

        Assert.Equal(42, result);
    }
}


text:
package mod

import (
	"github.com/skydive-project/skydive/common"
)

type resolveMulti struct {
	resolvers []Resolver
}

// NewResolveMulti creates a new name resolver
func NewResolveMulti(resolvers ...Resolver) Resolver {
	return &resolveMulti{
		resolvers: resolvers,
	}
}

// IPToName resolve ip address to name
func (rm *resolveMulti) IPToName(ipString, nodeTID string) (string, error) {
	for _, r := range rm.resolvers {
		if name, err := r.IPToName(ipString, nodeTID); err == nil {
			return name, nil
		}
	}

	return "", common.ErrNotFound
}

// TIDToType resolve tid to type
func (rm *resolveMulti) TIDToType(nodeTID string) (string, error) {
	for _, r := range rm.resolvers {
		if ty, err := r.TIDToType(nodeTID); err == nil {
			return ty, nil
		}
	}

	return "", common.ErrNotFound
}


text:
package io.vertigo.studio.plugins.mda.task.model;

import io.vertigo.core.definition.DefinitionUtil;
import io.vertigo.dynamo.collections.metamodel.FacetedQueryDefinition;
import io.vertigo.dynamo.domain.metamodel.DataType;
import io.vertigo.lang.Assertion;
import io.vertigo.util.StringUtil;

/**
 * Génération des classes/méthodes des taches de type DAO.
 *
 * @author pchretien
 */
public final class FacetedQueryDefinitionModel {
	private final FacetedQueryDefinition facetedQueryDefinition;
	private final String simpleName;
	private final String criteriaClassCanonicalName;

	FacetedQueryDefinitionModel(final FacetedQueryDefinition facetedQueryDefinition) {
		Assertion.checkNotNull(facetedQueryDefinition);
		//-----
		this.facetedQueryDefinition = facetedQueryDefinition;
		simpleName = StringUtil.constToUpperCamelCase(DefinitionUtil.getLocalName(facetedQueryDefinition.getName(), FacetedQueryDefinition.class));
		criteriaClassCanonicalName = obtainCriteriaClassCanonicalName();
	}

	/**
	 * @return Nom local CamelCase de la facetedQueryDefinition
	 */
	public String getSimpleName() {
		return simpleName;
	}

	/**
	 * @return Urn de la facetedQueryDefinition
	 */
	public String getUrn() {
		return facetedQueryDefinition.getName();
	}

	/**
	 * @return Nom de la classe du criteria
	 */
	public String getCriteriaClassCanonicalName() {
		return criteriaClassCanonicalName;
	}

	private String obtainCriteriaClassCanonicalName() {
		final DataType domainDataType = facetedQueryDefinition.getCriteriaDomain().getDataType();
		final String domainClassName;
		switch (domainDataType) {
			case Boolean:
			case Double:
			case Integer:
			case Long:
			case String:
				domainClassName = domainDataType.name();
				break;
			case Date:
			case BigDecimal:
				domainClassName = domainDataType.getJavaClass().getCanonicalName();
				break;
			case DtObject:
				domainClassName = facetedQueryDefinition.getCriteriaDomain().getDtDefinition().getClassCanonicalName();
				break;
			case DtList:
			case DataStream:
			default:
				throw new IllegalArgumentException("Domain " + facetedQueryDefinition.getCriteriaDomain().getName() + " can't be use for a searchCriteria : use DtObject or primitive");
		}
		return domainClassName;
	}

}


text:
import os
import new

from django.db import models
from django.conf import settings
from django.utils.datastructures import SortedDict

from djapian import utils
from djapian.database import Database
from djapian.indexer import Indexer

class IndexSpace(object):
    instances = []

    def __init__(self, base_dir, name):
        self._base_dir = os.path.abspath(base_dir)
        self._indexers = SortedDict()
        self._name = name

        self.__class__.instances.append(self)

    def __unicode__(self):
        return self._name

    def __str__(self):
        from django.utils.encoding import smart_str
        return smart_str(self.__unicode__())

    def add_index(self, model, indexer=None, attach_as=None):
        if indexer is None:
            indexer = self.create_default_indexer(model)

        db = Database(
            os.path.join(
                self._base_dir,
                model._meta.app_label,
                model._meta.object_name.lower(),
                indexer.get_descriptor()
            )
        )

        indexer = indexer(db, model)

        if attach_as is not None:
            if hasattr(model, attach_as):
                raise ValueError("Attribute with name `%s` is already exist" % attach_as)
            else:
                model.add_to_class(attach_as, indexer)

        if model in self._indexers:
            self._indexers[model].append(indexer)
        else:
            self._indexers[model] = [indexer]

        return indexer

    def get_indexers(self):
        return self._indexers

    def get_indexers_for_model(self, model):
        try:
            return self._indexers[model]
        except KeyError:
            return []

    def create_default_indexer(self, model):
        tags = []
        fields = []

        for field in model._meta.fields:
            if isinstance(field, models.TextField):
                fields.append(field.attname)
            else:
                tags.append((field.name, field.attname))

        return new.classobj(
            "Default%sIndexer" % utils.model_name(model).replace('.', ''),
            (Indexer,),
            {
                "tags": tags,
                "fields": fields
            }
        )


text:
__author__ = 'adaml'

import unittest
import os
from cloudify_exoscale.cloudify_exoscale import _read_config
from cloudify_exoscale.cloudify_exoscale import ExoscaleLogicError
from cloudify_exoscale.cloudify_exoscale import ExoscaleConnector
from cloudify_exoscale.cloudify_exoscale import ExoscaleKeypairCreator
from cloudify_exoscale.cloudify_exoscale import \
    ExoscaleSecurityGroupCreator
import logging

class ExoscaleProviderTestCase(unittest.TestCase):
    lgr = logging.getLogger('unittest')

    def test_provider_init(self):
        """
        Check initialization validity.
        """
        # is_init_valid = init(__file__, True)
        # if not is_init_valid:
        # raise AssertionError("Failed initializing Exoscale Provider.")

    def test_create_keypairs(self):
        """
        Tests create agent and management keypairs, passing private key target
        path
        """
        mgmt_key_name = "temp-unittest-mgmt-key"
        agent_key_name = "temp-unittest-agent-key"

        provider_config = _read_config(None)

        # setting special unit-test keynames.
        provider_config['compute']['management_server'][
            'management_keypair']['name'] = mgmt_key_name
        provider_config['compute']['agent_servers'][
            'agents_keypair']['name'] = agent_key_name

        cloud_driver = ExoscaleConnector(provider_config).create()

        keypair_creator = ExoscaleKeypairCreator(cloud_driver, provider_config)

        try:
            mgmt_pk_target_path = os.path.join(os.path.dirname(
                os.path.realpath(__file__)), mgmt_key_name + ".pem")
            agent_pk_target_path = os.path.join(os.path.dirname(
                os.path.realpath(__file__)), agent_key_name + ".pem")
            keypair_creator.create_key_pairs(
                mgmt_private_key_target_path=mgmt_pk_target_path,
                mgmt_keypair_name=mgmt_key_name,
                agent_private_key_target_path=agent_pk_target_path,
                agent_keypair_name=agent_key_name)

            if not keypair_creator._get_keypair(mgmt_key_name):
                raise AssertionError('management keypair not created.')
            if not keypair_creator._get_keypair(agent_key_name):
                raise AssertionError('agent keypair not created.')

            keypair_creator.delete_keypairs()

            if keypair_creator._get_keypair(mgmt_key_name):
                raise AssertionError('management keypair was not deleted.')
            if keypair_creator._get_keypair(agent_key_name):
                raise AssertionError('agent keypair was not deleted.')

        finally:
            try:
                cloud_driver.ex_delete_keypair(mgmt_key_name)
                cloud_driver.ex_delete_keypair(agent_key_name)
            except:
                pass

    def test_keypair_import(self):
        """
        Tests public key import, passing public key path
        """
        resource_folder_path = os.path.join(
            os.path.dirname(os.path.realpath(__file__)), "test_resources")

        provider_config = _read_config(None)

        mgmt_key_name = 'temp-unittest-management-key'
        agent_key_name = 'temp-unittest-agent-key'

        # setting special unit-test keynames.
        provider_config['compute']['management_server'][
            'management_keypair']['name'] = mgmt_key_name
        provider_config['compute']['agent_servers'][
            'agents_keypair']['name'] = agent_key_name

        public_key_name = 'public_key.pub'
        public_key_path = os.path.join(resource_folder_path, public_key_name)
        try:
            cloud_driver = ExoscaleConnector(provider_config).create()

            keypair_creator = ExoscaleKeypairCreator(cloud_driver,
                                                     provider_config)

            keypair_creator.create_key_pairs(
                mgmt_public_key_filepath=public_key_path,
                mgmt_keypair_name=mgmt_key_name,
                agent_public_key_filepath=public_key_path,
                agent_keypair_name=agent_key_name)

            keypair_creator.delete_keypairs()

            if keypair_creator._get_keypair(mgmt_key_name):
                raise AssertionError('management keypair was not deleted.')
            if keypair_creator._get_keypair(agent_key_name):
                raise AssertionError('agent keypair was not deleted.')

        finally:
            try:
                cloud_driver.ex_delete_keypair(mgmt_key_name)
                cloud_driver.ex_delete_keypair(agent_key_name)
            except:
                pass

    def test_get_keypair(self):

        key_name = "temp_unittest_key"

        provider_config = _read_config(None)

        cloud_driver = ExoscaleConnector(provider_config).create()

        keypair_creator = ExoscaleKeypairCreator(cloud_driver, provider_config)
        key_pair = keypair_creator._get_keypair(key_name)
        if key_pair:
            raise AssertionError(
                'the keypair {0} should not exist'.format(key_name))
        cloud_driver.ex_create_keypair(key_name)
        key_pair = keypair_creator._get_keypair(key_name)
        if not key_pair:
            raise AssertionError(
                'expecting to find an existing keypair with name {0}'.format(
                    key_name))

        cloud_driver.ex_delete_keypair(key_name)

    def test_create_security_group(self):
        """
        Tests create security group.
        """
        management_security_group_name = 'temp_unittest-mngt-sg'
        agent_security_group_name = 'temp_unittest-agent-sg'
        provider_config = _read_config(None)

        # change security-group name so test will not affect production
        provider_config['networking']['management_security_group'][
            'name'] = management_security_group_name
        provider_config['networking']['agents_security_group'][
            'name'] = agent_security_group_name

        self.cloud_driver = ExoscaleConnector(provider_config).create()

        try:
            sg_creator = ExoscaleSecurityGroupCreator(self.cloud_driver,
                                                      provider_config)
            sg_creator.create_security_groups()

            if sg_creator.get_security_group(
                    management_security_group_name) is None:
                raise AssertionError(
                    'expecting to find security group {0}'.format(
                        management_security_group_name))
            if sg_creator.get_security_group(
                    agent_security_group_name) is None:
                raise AssertionError(
                    'expecting to find security group {0}'.format(
                        agent_security_group_name))

            sg_creator.delete_security_groups()

            if sg_creator.get_security_group(
                    management_security_group_name):
                raise AssertionError(
                    'expecting security group {0} to be deleted'.format(
                        management_security_group_name))
            if sg_creator.get_security_group(agent_security_group_name):
                raise AssertionError(
                    'expecting security group {0} to be deleted'.format(
                        agent_security_group_name))
        finally:
            try:
                self.cloud_driver.ex_delete_security_group(
                    management_security_group_name)
            except:
                pass

            try:
                self.cloud_driver.ex_delete_security_group(
                    agent_security_group_name)
            except:
                pass

    def test_use_existing_security_group_not_found(self):
        """
        Tests create security group with 'use_existing' property set to true
        """
        provider_config = _read_config(None)

        # security-group use_existing=True
        provider_config['networking']['management_security_group'][
            'use_existing'] = True
        provider_config['networking']['management_security_group'][
            'name'] = 'non-existing-sg'

        cloud_driver = ExoscaleConnector(provider_config).create()
        sg_creator = ExoscaleSecurityGroupCreator(
            cloud_driver, provider_config)
        try:
            sg_creator.create_security_groups()
            raise AssertionError(
                'Security-group validation failed. Non existing group did not '
                'raise an error as expected')
        except ExoscaleLogicError:
            pass

    def test_security_group_does_not_exist(self):
        """
        Tests create security group with use_existing=True expecting an error
        """
        existing_sg_name = 'temp-unittest-security-group'
        provider_config = _read_config(None)

        provider_config['networking']['management_security_group'][
            'use_existing'] = True
        provider_config['networking']['management_security_group'][
            'name'] = existing_sg_name

        cloud_driver = ExoscaleConnector(provider_config).create()
        sg_creator = ExoscaleSecurityGroupCreator(cloud_driver,
                                                  provider_config)
        try:
            sg_creator.create_security_groups()
            raise AssertionError(
                'Security-group validation failed. '
                'use_existing flag did not '
                'raise an error as expected')
        except ExoscaleLogicError:
            pass


text:
/**
 * If you're using typescript you can import the module with:
 * import zwoosh = require("../zwoosh");
 */
window.onload = function () {
    var basics = zwoosh(document.getElementById("basics"));
    var log = document.getElementById("log");
    zwoosh(document.getElementById("events"))
        .on("collide.left", function (e) {
        log.innerHTML += "collide.left Event triggered
";
    })
        .on("collide.top", function (e) {
        log.innerHTML += "collide.top Event triggered
";
    })
        .on("collide.right", function (e) {
        log.innerHTML += "collide.right Event triggered
";
    })
        .on("collide.bottom", function (e) {
        log.innerHTML += "collide.bottom Event triggered
";
    });
    zwoosh(document.getElementById("nest_outer"));
    zwoosh(document.getElementById("nest_inner"));
    var custom = zwoosh(document.getElementById("custom"));
    document.getElementById("scrollBy").onclick = function () {
        custom.scrollBy(50, 50);
    };
    document.getElementById("scrollTo").onclick = function () {
        custom.scrollTo(100, 100);
    };
    document.getElementById("scaleTo").onclick = function () {
        custom.scaleTo(2);
    };
    document.getElementById("scaleBy").onclick = function () {
        custom.scaleBy(90);
    };
    document.getElementById("reinit").onclick = function () {
        custom.reinit();
    };
    document.getElementById("destroy").onclick = function () {
        custom.destroy();
    };
    activeOption(custom, "gridX");
    activeOption(custom, "gridY");
    activeOption(custom, "gridShow", true);
    activeOption(custom, "elasticEdges.left");
    activeOption(custom, "elasticEdges.top");
    activeOption(custom, "elasticEdges.right");
    activeOption(custom, "elasticEdges.bottom");
    activeOption(custom, "dragScroll", true);
    activeOption(custom, "dragOptions.minSpeed");
    activeOption(custom, "dragOptions.maxSpeed");
    activeOption(custom, "dragOptions.brakeSpeed");
    activeOption(custom, "dragOptions.fps");
    activeOption(custom, "dragOptions.fade");
    activeOption(custom, "wheelScroll", true);
    activeOption(custom, "wheelOptions.direction");
    activeOption(custom, "wheelOptions.step");
    activeOption(custom, "wheelOptions.smooth");
    activeOption(custom, "wheelZoom", true);
    activeOption(custom, "zoomOptions.minScale");
    activeOption(custom, "zoomOptions.maxScale");
    activeOption(custom, "zoomOptions.step");
    activeOption(custom, "zoomOptions.direction");
    activeOption(custom, "handleAnchors", true);
    var json = document.getElementById("optionsJson");
    json.innerHTML = JSON.stringify(diff(custom.options, basics.options), null, 2);
    function activeOption(zwooshElement, option, reinit) {
        if (reinit === void 0) { reinit = false; }
        var type;
        var el = document.getElementById(option);
        var opts = option.split(".");
        if (opts.length === 1) {
            type = typeof zwooshElement.options[option];
        }
        else {
            type = typeof zwooshElement.options[opts[0]][opts[1]];
        }
        if (type === "number") {
            el.value = eval("zwooshElement.options." + option);
            el.onkeyup = function () {
                if ((option === "gridX" || option === "gridY") && zwooshElement.options.gridShow) {
                    reinit = true;
                }
                else {
                    reinit = false;
                }
                eval("zwooshElement.options." + option + " = " + parseFloat(el.value) + ";");
                json.innerHTML = JSON.stringify(diff(zwooshElement.options, basics.options), null, 2);
                if (reinit === true) {
                    zwooshElement.reinit();
                }
            };
        }
        else if (type === "string") {
            el.value = eval("zwooshElement.options." + option);
            el.onclick = function () {
                var value = el.options[el.selectedIndex].value;
                eval("zwooshElement.options." + option + " = '" + value + "';");
                json.innerHTML = JSON.stringify(diff(zwooshElement.options, basics.options), null, 2);
                if (reinit === true) {
                    zwooshElement.reinit();
                }
            };
        }
        else if (type === "boolean") {
            el.checked = eval("zwooshElement.options." + option);
            el.onclick = function () {
                eval("zwooshElement.options." + option + " = " + el.checked + ";");
                json.innerHTML = JSON.stringify(diff(zwooshElement.options, basics.options), null, 2);
                if (reinit === true) {
                    zwooshElement.reinit();
                }
            };
        }
    }
    function diff(obj1, obj2) {
        var d = {};
        for (var p in obj2) {
            if (typeof (obj1[p]) === "object" && typeof (obj2[p]) === "object") {
                for (var i in obj2[p]) {
                    if (JSON.stringify(obj1[p][i]) !== JSON.stringify(obj2[p][i])) {
                        d[p] = d[p] ? d[p] : {};
                        d[p][i] = obj1[p][i];
                    }
                }
            }
            else if (JSON.stringify(obj1[p]) !== JSON.stringify(obj2[p])) {
                d[p] = obj1[p];
            }
        }
        return d;
    }
    zwoosh(document.getElementById("edges"), {
        elasticEdges: {
            left: true,
            top: true,
            right: true,
            bottom: true
        }
    });
    zwoosh(document.getElementById("wheelzoom"), {
        gridX: 100,
        gridY: 50,
        gridShow: true,
        wheelScroll: false,
        wheelZoom: true
    });
    zwoosh(document.getElementById("anchors"));
    zwoosh(document.body);
};
//# sourceMappingURL=example.js.map


text:
<TITLE>Review for Leaving Las Vegas (1995)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Leaving Las Vegas (1995)

reviewed by
Pedro Sena

FILM TITLE:             LEAVING LAS VEGAS
DIRECTOR:             MIKE FIGGIS
COUNTRY:               USA 1995
CINEMATOGRAPHY:         DEDAM QUINN
MUSIC:                     MIKE FIGGIS
CAST:                       Nicholas Cage, Elizabeth Shue
SUPER FEATURES:         The acting

         !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

American films have never been known for one man films.  The "auteur", as it
is called in the media, is the type that has defined film history, with its
eccentric directors, who wrote their own material, and defined an art form
with it.

Hollywood, has defined the art of entertainment, or better explained, the
art of figuring out how to make money regardless of what it is that is being
done.  The nice thing about this is that the technical elements in this
genre are always getting better.  The bad thing is that it really hurts in
the development of the art form, beyond any kind of standard which says
"give them what they want".  Thus American arts have not been defined by
their content, but how much they earn.  Needless to say, there is another
side to this whole story, that is finally making a serious move, away from
the studio controlled delivered machines.

Today, more independent films are made and earn decent honors that it may,
yet, change the quality of the film making, from a money making thing, to a
more literary, and artistic, point of view.

And it takes one man shows, like this film, LEAVING LAS VEGAS, to bring it
about.  Watching this movie, is like going to your local theatre, and
discover that this time, they DID do a great job, and they deserve some
serious consideration.  And if the credit is not given to the two actors
that pull it off, at least quite a bit of it needs to go to the man who
directed, who pretty much wrote the whole thing himself, and created his own
music for the film.

Nothing fancy, nothing showy, just solid quality work.

And it is the two actors here, that just about cook the heck out of this
film, and its inherent sadness. It is riveting, and worth every claim and
award it is earning.  This is what it is all about, and it all means.  This
is the power that the art form can have, to create literature, rather than
entertainment.  And this is what the history of film teaches us at every
school.  Hollywood, has rarely been on the map for its artistic successes.

This is the story of a failed film writer that pretty much has turned away
from life, and decided to drink himself down the drain.  And in doing so, he
meets a prostitute, that pretty much falls in love with him in Las Vegas,
who becomes dependent on him, for learning and leaning, when things do not
go quite right for herself.  The sad part, is that,
no matter how much she tries, she is not capable of changing this man, and
save him. She has come to understand that changing what is already set and
done, is beyond the realm of her ability, and human desire for that matter.
And in the one moment, when the love between the two is finally demonstrated
in the physical way that they have wished for, but hasn't happened, he
finally gets his wish.  She is left, hung out to dry, with a therapist,
which has been a going thing through out the film, which at first is hard to
understand and figure out, but becomes clear in the end.

It is a well written story, and very well defined in its design, and how to
carry it out.  And a lot of credit goes to the two leading actors that just
shine all the way through, showing us, that there  are actors in this
country that can hold their own to the famed West End style of depth in
acting.  This film, is an amazing evening, of what acting can be, but is
rarely, in much of the arts in this country.  What a great thing this is,
and hope, for the many, who try, but get washed by a machine that rarely
cares about acting, but for the sake of making money.  Nicholas Cage had
been advised not to do this film, and he sticks to his feelings, and wishes,
and ends up proving that what he is capable of doing, at least in film, is
something that most actors would dream that they had that ONE chance in
their life to prove they could do it.  In this case, they just grabbed fate
by the throat, as the saying goes.

Superb film, even if it is a bit depressing.  And deserving, in every way,
of its awards.  Excellently directed, with its subjective points of view.

4.5 GIBLOONS out of 5

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

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

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

Broken URLs inthe reviews are the responsibility of the author.

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

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


text:
/* Generated By:JJTree: Do not edit this line. ASTCharDescriptor.java Version 4.1 */
/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY= */
package org.javacc.jjtree;

public class ASTCharDescriptor extends JJTreeNode{
  public ASTCharDescriptor(int id) {
    super(id);
  }

  public ASTCharDescriptor(JJTreeParser p, int id) {
    super(p, id);
  }

  /** Accept the visitor. **/
  public Object jjtAccept(JJTreeParserVisitor visitor, Object data) {
    return visitor.visit(this, data);
  }
}
/* JavaCC - OriginalChecksum=7f8dface55cedc92e30dd141bbe6f866 (do not edit this line) */


text:
// HTMLParser Library $Name:  $ - A java-based parser for HTML
// http://sourceforge.org/projects/htmlparser
// Copyright (C) 2004 Somik Raha
//
//
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//

package org.htmlparser.tags;
//import checkers.inference.ownership.quals.*;

/**
 * A title tag.
 */
public class TitleTag extends CompositeTag
{
    /**
     * The set of names handled by this tag.
     */
    private static final String[] mIds = new String[] {"TITLE"};

    /**
     * The set of tag names that indicate the end of this tag.
     */
    private static final String[] mEnders = new String[] {"TITLE","BODY"};

    /**
     * The set of end tag names that indicate the end of this tag.
     */
    private static final String[] mEndTagEnders = new String[] {"HEAD", "HTML"};

    /**
     * Create a new title tag.
     */
    public TitleTag ()
    {
    }

    /**
     * Return the set of names handled by this tag.
     * @return The names to be matched that create tags of this type.
     */
    public String[] getIds ()
    {
        return (mIds);
    }

    /**
     * Return the set of tag names that cause this tag to finish.
     * @return The names of following tags that stop further scanning.
     */
    public String[] getEnders ()
    {
        return (mEnders);
    }

    /**
     * Return the set of end tag names that cause this tag to finish.
     * @return The names of following end tags that stop further scanning.
     */
    public String[] getEndTagEnders ()
    {
        return (mEndTagEnders);
    }

    /**
     * Get the title text.
     * @return The title.
     */
    public String getTitle()
    {
        return toPlainTextString();
    }

    /**
     * Return a string representation of this tag for debugging.
     * @return A string with the text of the title.
     */
    public String toString()
    {
        return "TITLE: " + getTitle();
    }
}


text:
//
//  SCHDefinitions.h
//  Sonar Cocos Helper
//
//  Created by Sonar Systems on 04/03/2015.
//
//

#ifndef __SCH__DEFINITIONS__
#define __SCH__DEFINITIONS__

#define ADBANNERPOSITION_BOTTOM 0
#define ADBANNERPOSITION_TOP 1
#define ADBANNERPOSITION_BOTH 2

#define SCH_GOOGLE_ANALYTICS_DEFAULT_DISPATCH_TIME 120

#define CALENDAR_UNIT_MINUTE 0
#define CALENDAR_UNIT_HOURLY 1
#define CALENDAR_UNIT_DAILY 2
#define CALENDAR_UNIT_WEEKLY 3
#define CALENDAR_UNIT_MONTHLY 4
#define CALENDAR_UNIT_YEARLY 5

#endif


text:
<?php

namespace PHPExiftool\Driver\Tag\Canon;

use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;

/**
 * @ExclusionPolicy("all")
 */
class ToneCurveMatching extends AbstractTag
{

    protected $Id = 178;

    protected $Name = 'ToneCurveMatching';

    protected $FullName = 'Canon::Main';

    protected $GroupName = 'Canon';

    protected $g0 = 'MakerNotes';

    protected $g1 = 'Canon';

    protected $g2 = 'Camera';

    protected $Type = '?';

    protected $Writable = false;

    protected $Description = 'Tone Curve Matching';

    protected $flag_Permanent = true;
}


text:
<?php
defined( 'ABSPATH' ) or die( 'Cheatin’ uh?' );

// Are we white-labeled?
$rwl = rocket_is_white_label();

add_settings_section( 'rocket_display_tools', __( 'Tools', 'rocket' ), '__return_false', 'rocket_tools' );

/**
 * Beta testing
 */
if ( ! $rwl ) {

	add_settings_field(
		'rocket_do_beta',
		__( 'Beta testing:', 'rocket' ),
		'rocket_field',
		'rocket_tools',
		'rocket_display_tools',
		array(
			array(
				'type'         => 'checkbox',
				'label'        => __( 'Yes, I would like to receive beta versions of WP Rocket as updates. I understand that beta versions may contain unstable code, and I know how to roll back to a stable version manually if I have to.', 'rocket' ),
				'label_for'    => 'do_beta',
				'label_screen' => __( 'Beta Testing', 'rocket' ),
			),
		)
	);
}

/**
 * Clear cache
 */
add_settings_field(
	'rocket_purge_all',
	__( 'Clear cache:', 'rocket' ),
	'rocket_button',
	'rocket_tools',
	'rocket_display_tools',
	array(
		'helper_help' => array(
			'name'         => 'purge_all',
			'description'  => __( 'Clear the cache for the whole website.', 'rocket' ),
		),
		'button' => array(
			'button_label' => __( 'Clear cache', 'rocket' ),
			'url'		   => wp_nonce_url( admin_url( 'admin-post.php?action=purge_cache&type=all' ), 'purge_cache_all' ),
		),
	)
);

/**
 * Preload
 */
add_settings_field(
	'rocket_preload',
	__( 'Preload cache:', 'rocket' ),
	'rocket_button',
	'rocket_tools',
	'rocket_display_tools',
	array(
		'helper_help' => array(
			'name'         => 'preload',
			'description'  => sprintf(
				/* translators: %s = tab anchor */
				__( 'Preload the cache according to your Preload settings.', 'rocket' ),
				'#tab_preload'
			)
		),
		'button' => array(
			'button_label' => __( 'Preload cache', 'rocket' ),
			'url'		   => wp_nonce_url( admin_url( 'admin-post.php?action=preload' ), 'preload' ),
		),
	)
);

/**
 * Clear OPcache
 */
if ( function_exists( 'opcache_reset' ) ) {

	add_settings_field(
		'rocket_purge_opcache',
		__( 'Purge OPcache:', 'rocket' ),
		'rocket_button',
		'rocket_tools',
		'rocket_display_tools',
		array(
			'button' => array(
				'button_label' => __( 'Purge OPcache', 'rocket' ),
				'url'		   => wp_nonce_url( admin_url( 'admin-post.php?action=rocket_purge_opcache' ), 'rocket_purge_opcache' ),
			),
		)
	);
}

/**
 * Export
 */
add_settings_field(
	'rocket_export_options',
	__( 'Export settings:', 'rocket' ),
	'rocket_field',
	'rocket_tools',
	'rocket_display_tools',
	array( 'type' => 'rocket_export_form', 'name' => 'export' )
);

/**
 * Import
 */
add_settings_field(
	'rocket_import_options',
	__( 'Import settings:', 'rocket' ),
	'rocket_field',
	'rocket_tools',
	'rocket_display_tools',
	array( 'type' => 'rocket_import_upload_form' )
);

/**
 * Rollback
 */
if ( current_user_can( 'update_plugins' ) ) {
	$temp_description = sprintf(
		/* translators: %s = button text */
		__( 'Backup your settings with the "%s" button above before you re-install a previous version.', 'rocket' ),
		_x( 'Download settings', 'button text', 'rocket' )
	);
	add_settings_field(
		'rocket_rollback',
		__( 'Rollback:', 'rocket' ),
		'rocket_button',
		'rocket_tools',
		'rocket_display_tools',
		array(
			'helper_warning' => array(
				'name'         => 'rollback2',
				'description'  => $temp_description,
			),
			'button' => array(
				'button_label' => sprintf( __( 'Re-install version %s', 'rocket' ), WP_ROCKET_LASTVERSION ),
				'url'		   => wp_nonce_url( admin_url( 'admin-post.php?action=rocket_rollback' ), 'rocket_rollback' ),
			),
			'helper_description' => array(
				'name'         => 'rollback',
				'description'  => $rwl ? sprintf(
					/* translators: %s = version number */
					__( 'Has version %1$s caused an issue on your website? You can roll back to the previous major version here.', 'rocket' ),
					WP_ROCKET_VERSION
				) : sprintf(
					/* translators: %1$s = version number; %2$s = tab anchor */
					__( 'Has version %1$s caused an issue on your website?
You can roll back to the previous major version here. Then send us a support request.', 'rocket' ),
					WP_ROCKET_VERSION,
					'#tab_support'
				),
			),
		)
	);
}
unset( $temp_description );


text:
package org.mifos.framework.formulaic;

public class ConstantValidator extends BaseValidator {

    private Object expectedValue;

    public ConstantValidator(Object expectedValue) {
        this.expectedValue = expectedValue;
    }

    @Override
    public Object validate(Object value) throws ValidationError {
        checkNull(value);
        if (value.equals(expectedValue)) {
            return value;
        } else {
            return makeError(value, ErrorType.WRONG_VALUE);
        }
    }

}


text:
package alexaforbusinessiface

import (
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/request"
	"github.com/aws/aws-sdk-go/service/alexaforbusiness"
)

// AlexaForBusinessAPI provides an interface to enable mocking the
// alexaforbusiness.AlexaForBusiness service client's API operation,
// paginators, and waiters. This make unit testing your code that calls out
// to the SDK's service client's calls easier.
//
// The best way to use this interface is so the SDK's service client's calls
// can be stubbed out for unit testing your code with the SDK without needing
// to inject custom request handlers into the SDK's request pipeline.
//
//    // myFunc uses an SDK service client to make a request to
//    // Alexa For Business.
//    func myFunc(svc alexaforbusinessiface.AlexaForBusinessAPI) bool {
//        // Make svc.AssociateDeviceWithRoom request
//    }
//
//    func main() {
//        sess := session.New()
//        svc := alexaforbusiness.New(sess)
//
//        myFunc(svc)
//    }
//
// In your _test.go file:
//
//    // Define a mock struct to be used in your unit tests of myFunc.
//    type mockAlexaForBusinessClient struct {
//        alexaforbusinessiface.AlexaForBusinessAPI
//    }
//    func (m *mockAlexaForBusinessClient) AssociateDeviceWithRoom(input *alexaforbusiness.AssociateDeviceWithRoomInput) (*alexaforbusiness.AssociateDeviceWithRoomOutput, error) {
//        // mock response/functionality
//    }
//
//    func TestMyFunc(t *testing.T) {
//        // Setup Test
//        mockSvc := &mockAlexaForBusinessClient{}
//
//        myfunc(mockSvc)
//
//        // Verify myFunc's functionality
//    }
//
// It is important to note that this interface will have breaking changes
// when the service model is updated and adds new API operations, paginators,
// and waiters. Its suggested to use the pattern above for testing, or using
// tooling to generate mocks to satisfy the interfaces.
type AlexaForBusinessAPI interface {
	AssociateDeviceWithRoom(*alexaforbusiness.AssociateDeviceWithRoomInput) (*alexaforbusiness.AssociateDeviceWithRoomOutput, error)
	AssociateDeviceWithRoomWithContext(aws.Context, *alexaforbusiness.AssociateDeviceWithRoomInput, ...request.Option) (*alexaforbusiness.AssociateDeviceWithRoomOutput, error)
	AssociateDeviceWithRoomRequest(*alexaforbusiness.AssociateDeviceWithRoomInput) (*request.Request, *alexaforbusiness.AssociateDeviceWithRoomOutput)

	AssociateSkillGroupWithRoom(*alexaforbusiness.AssociateSkillGroupWithRoomInput) (*alexaforbusiness.AssociateSkillGroupWithRoomOutput, error)
	AssociateSkillGroupWithRoomWithContext(aws.Context, *alexaforbusiness.AssociateSkillGroupWithRoomInput, ...request.Option) (*alexaforbusiness.AssociateSkillGroupWithRoomOutput, error)
	AssociateSkillGroupWithRoomRequest(*alexaforbusiness.AssociateSkillGroupWithRoomInput) (*request.Request, *alexaforbusiness.AssociateSkillGroupWithRoomOutput)

	CreateProfile(*alexaforbusiness.CreateProfileInput) (*alexaforbusiness.CreateProfileOutput, error)
	CreateProfileWithContext(aws.Context, *alexaforbusiness.CreateProfileInput, ...request.Option) (*alexaforbusiness.CreateProfileOutput, error)
	CreateProfileRequest(*alexaforbusiness.CreateProfileInput) (*request.Request, *alexaforbusiness.CreateProfileOutput)

	CreateRoom(*alexaforbusiness.CreateRoomInput) (*alexaforbusiness.CreateRoomOutput, error)
	CreateRoomWithContext(aws.Context, *alexaforbusiness.CreateRoomInput, ...request.Option) (*alexaforbusiness.CreateRoomOutput, error)
	CreateRoomRequest(*alexaforbusiness.CreateRoomInput) (*request.Request, *alexaforbusiness.CreateRoomOutput)

	CreateSkillGroup(*alexaforbusiness.CreateSkillGroupInput) (*alexaforbusiness.CreateSkillGroupOutput, error)
	CreateSkillGroupWithContext(aws.Context, *alexaforbusiness.CreateSkillGroupInput, ...request.Option) (*alexaforbusiness.CreateSkillGroupOutput, error)
	CreateSkillGroupRequest(*alexaforbusiness.CreateSkillGroupInput) (*request.Request, *alexaforbusiness.CreateSkillGroupOutput)

	CreateUser(*alexaforbusiness.CreateUserInput) (*alexaforbusiness.CreateUserOutput, error)
	CreateUserWithContext(aws.Context, *alexaforbusiness.CreateUserInput, ...request.Option) (*alexaforbusiness.CreateUserOutput, error)
	CreateUserRequest(*alexaforbusiness.CreateUserInput) (*request.Request, *alexaforbusiness.CreateUserOutput)

	DeleteProfile(*alexaforbusiness.DeleteProfileInput) (*alexaforbusiness.DeleteProfileOutput, error)
	DeleteProfileWithContext(aws.Context, *alexaforbusiness.DeleteProfileInput, ...request.Option) (*alexaforbusiness.DeleteProfileOutput, error)
	DeleteProfileRequest(*alexaforbusiness.DeleteProfileInput) (*request.Request, *alexaforbusiness.DeleteProfileOutput)

	DeleteRoom(*alexaforbusiness.DeleteRoomInput) (*alexaforbusiness.DeleteRoomOutput, error)
	DeleteRoomWithContext(aws.Context, *alexaforbusiness.DeleteRoomInput, ...request.Option) (*alexaforbusiness.DeleteRoomOutput, error)
	DeleteRoomRequest(*alexaforbusiness.DeleteRoomInput) (*request.Request, *alexaforbusiness.DeleteRoomOutput)

	DeleteRoomSkillParameter(*alexaforbusiness.DeleteRoomSkillParameterInput) (*alexaforbusiness.DeleteRoomSkillParameterOutput, error)
	DeleteRoomSkillParameterWithContext(aws.Context, *alexaforbusiness.DeleteRoomSkillParameterInput, ...request.Option) (*alexaforbusiness.DeleteRoomSkillParameterOutput, error)
	DeleteRoomSkillParameterRequest(*alexaforbusiness.DeleteRoomSkillParameterInput) (*request.Request, *alexaforbusiness.DeleteRoomSkillParameterOutput)

	DeleteSkillGroup(*alexaforbusiness.DeleteSkillGroupInput) (*alexaforbusiness.DeleteSkillGroupOutput, error)
	DeleteSkillGroupWithContext(aws.Context, *alexaforbusiness.DeleteSkillGroupInput, ...request.Option) (*alexaforbusiness.DeleteSkillGroupOutput, error)
	DeleteSkillGroupRequest(*alexaforbusiness.DeleteSkillGroupInput) (*request.Request, *alexaforbusiness.DeleteSkillGroupOutput)

	DeleteUser(*alexaforbusiness.DeleteUserInput) (*alexaforbusiness.DeleteUserOutput, error)
	DeleteUserWithContext(aws.Context, *alexaforbusiness.DeleteUserInput, ...request.Option) (*alexaforbusiness.DeleteUserOutput, error)
	DeleteUserRequest(*alexaforbusiness.DeleteUserInput) (*request.Request, *alexaforbusiness.DeleteUserOutput)

	DisassociateDeviceFromRoom(*alexaforbusiness.DisassociateDeviceFromRoomInput) (*alexaforbusiness.DisassociateDeviceFromRoomOutput, error)
	DisassociateDeviceFromRoomWithContext(aws.Context, *alexaforbusiness.DisassociateDeviceFromRoomInput, ...request.Option) (*alexaforbusiness.DisassociateDeviceFromRoomOutput, error)
	DisassociateDeviceFromRoomRequest(*alexaforbusiness.DisassociateDeviceFromRoomInput) (*request.Request, *alexaforbusiness.DisassociateDeviceFromRoomOutput)

	DisassociateSkillGroupFromRoom(*alexaforbusiness.DisassociateSkillGroupFromRoomInput) (*alexaforbusiness.DisassociateSkillGroupFromRoomOutput, error)
	DisassociateSkillGroupFromRoomWithContext(aws.Context, *alexaforbusiness.DisassociateSkillGroupFromRoomInput, ...request.Option) (*alexaforbusiness.DisassociateSkillGroupFromRoomOutput, error)
	DisassociateSkillGroupFromRoomRequest(*alexaforbusiness.DisassociateSkillGroupFromRoomInput) (*request.Request, *alexaforbusiness.DisassociateSkillGroupFromRoomOutput)

	GetDevice(*alexaforbusiness.GetDeviceInput) (*alexaforbusiness.GetDeviceOutput, error)
	GetDeviceWithContext(aws.Context, *alexaforbusiness.GetDeviceInput, ...request.Option) (*alexaforbusiness.GetDeviceOutput, error)
	GetDeviceRequest(*alexaforbusiness.GetDeviceInput) (*request.Request, *alexaforbusiness.GetDeviceOutput)

	GetProfile(*alexaforbusiness.GetProfileInput) (*alexaforbusiness.GetProfileOutput, error)
	GetProfileWithContext(aws.Context, *alexaforbusiness.GetProfileInput, ...request.Option) (*alexaforbusiness.GetProfileOutput, error)
	GetProfileRequest(*alexaforbusiness.GetProfileInput) (*request.Request, *alexaforbusiness.GetProfileOutput)

	GetRoom(*alexaforbusiness.GetRoomInput) (*alexaforbusiness.GetRoomOutput, error)
	GetRoomWithContext(aws.Context, *alexaforbusiness.GetRoomInput, ...request.Option) (*alexaforbusiness.GetRoomOutput, error)
	GetRoomRequest(*alexaforbusiness.GetRoomInput) (*request.Request, *alexaforbusiness.GetRoomOutput)

	GetRoomSkillParameter(*alexaforbusiness.GetRoomSkillParameterInput) (*alexaforbusiness.GetRoomSkillParameterOutput, error)
	GetRoomSkillParameterWithContext(aws.Context, *alexaforbusiness.GetRoomSkillParameterInput, ...request.Option) (*alexaforbusiness.GetRoomSkillParameterOutput, error)
	GetRoomSkillParameterRequest(*alexaforbusiness.GetRoomSkillParameterInput) (*request.Request, *alexaforbusiness.GetRoomSkillParameterOutput)

	GetSkillGroup(*alexaforbusiness.GetSkillGroupInput) (*alexaforbusiness.GetSkillGroupOutput, error)
	GetSkillGroupWithContext(aws.Context, *alexaforbusiness.GetSkillGroupInput, ...request.Option) (*alexaforbusiness.GetSkillGroupOutput, error)
	GetSkillGroupRequest(*alexaforbusiness.GetSkillGroupInput) (*request.Request, *alexaforbusiness.GetSkillGroupOutput)

	ListSkills(*alexaforbusiness.ListSkillsInput) (*alexaforbusiness.ListSkillsOutput, error)
	ListSkillsWithContext(aws.Context, *alexaforbusiness.ListSkillsInput, ...request.Option) (*alexaforbusiness.ListSkillsOutput, error)
	ListSkillsRequest(*alexaforbusiness.ListSkillsInput) (*request.Request, *alexaforbusiness.ListSkillsOutput)

	ListSkillsPages(*alexaforbusiness.ListSkillsInput, func(*alexaforbusiness.ListSkillsOutput, bool) bool) error
	ListSkillsPagesWithContext(aws.Context, *alexaforbusiness.ListSkillsInput, func(*alexaforbusiness.ListSkillsOutput, bool) bool, ...request.Option) error

	ListTags(*alexaforbusiness.ListTagsInput) (*alexaforbusiness.ListTagsOutput, error)
	ListTagsWithContext(aws.Context, *alexaforbusiness.ListTagsInput, ...request.Option) (*alexaforbusiness.ListTagsOutput, error)
	ListTagsRequest(*alexaforbusiness.ListTagsInput) (*request.Request, *alexaforbusiness.ListTagsOutput)

	ListTagsPages(*alexaforbusiness.ListTagsInput, func(*alexaforbusiness.ListTagsOutput, bool) bool) error
	ListTagsPagesWithContext(aws.Context, *alexaforbusiness.ListTagsInput, func(*alexaforbusiness.ListTagsOutput, bool) bool, ...request.Option) error

	PutRoomSkillParameter(*alexaforbusiness.PutRoomSkillParameterInput) (*alexaforbusiness.PutRoomSkillParameterOutput, error)
	PutRoomSkillParameterWithContext(aws.Context, *alexaforbusiness.PutRoomSkillParameterInput, ...request.Option) (*alexaforbusiness.PutRoomSkillParameterOutput, error)
	PutRoomSkillParameterRequest(*alexaforbusiness.PutRoomSkillParameterInput) (*request.Request, *alexaforbusiness.PutRoomSkillParameterOutput)

	ResolveRoom(*alexaforbusiness.ResolveRoomInput) (*alexaforbusiness.ResolveRoomOutput, error)
	ResolveRoomWithContext(aws.Context, *alexaforbusiness.ResolveRoomInput, ...request.Option) (*alexaforbusiness.ResolveRoomOutput, error)
	ResolveRoomRequest(*alexaforbusiness.ResolveRoomInput) (*request.Request, *alexaforbusiness.ResolveRoomOutput)

	RevokeInvitation(*alexaforbusiness.RevokeInvitationInput) (*alexaforbusiness.RevokeInvitationOutput, error)
	RevokeInvitationWithContext(aws.Context, *alexaforbusiness.RevokeInvitationInput, ...request.Option) (*alexaforbusiness.RevokeInvitationOutput, error)
	RevokeInvitationRequest(*alexaforbusiness.RevokeInvitationInput) (*request.Request, *alexaforbusiness.RevokeInvitationOutput)

	SearchDevices(*alexaforbusiness.SearchDevicesInput) (*alexaforbusiness.SearchDevicesOutput, error)
	SearchDevicesWithContext(aws.Context, *alexaforbusiness.SearchDevicesInput, ...request.Option) (*alexaforbusiness.SearchDevicesOutput, error)
	SearchDevicesRequest(*alexaforbusiness.SearchDevicesInput) (*request.Request, *alexaforbusiness.SearchDevicesOutput)

	SearchDevicesPages(*alexaforbusiness.SearchDevicesInput, func(*alexaforbusiness.SearchDevicesOutput, bool) bool) error
	SearchDevicesPagesWithContext(aws.Context, *alexaforbusiness.SearchDevicesInput, func(*alexaforbusiness.SearchDevicesOutput, bool) bool, ...request.Option) error

	SearchProfiles(*alexaforbusiness.SearchProfilesInput) (*alexaforbusiness.SearchProfilesOutput, error)
	SearchProfilesWithContext(aws.Context, *alexaforbusiness.SearchProfilesInput, ...request.Option) (*alexaforbusiness.SearchProfilesOutput, error)
	SearchProfilesRequest(*alexaforbusiness.SearchProfilesInput) (*request.Request, *alexaforbusiness.SearchProfilesOutput)

	SearchProfilesPages(*alexaforbusiness.SearchProfilesInput, func(*alexaforbusiness.SearchProfilesOutput, bool) bool) error
	SearchProfilesPagesWithContext(aws.Context, *alexaforbusiness.SearchProfilesInput, func(*alexaforbusiness.SearchProfilesOutput, bool) bool, ...request.Option) error

	SearchRooms(*alexaforbusiness.SearchRoomsInput) (*alexaforbusiness.SearchRoomsOutput, error)
	SearchRoomsWithContext(aws.Context, *alexaforbusiness.SearchRoomsInput, ...request.Option) (*alexaforbusiness.SearchRoomsOutput, error)
	SearchRoomsRequest(*alexaforbusiness.SearchRoomsInput) (*request.Request, *alexaforbusiness.SearchRoomsOutput)

	SearchRoomsPages(*alexaforbusiness.SearchRoomsInput, func(*alexaforbusiness.SearchRoomsOutput, bool) bool) error
	SearchRoomsPagesWithContext(aws.Context, *alexaforbusiness.SearchRoomsInput, func(*alexaforbusiness.SearchRoomsOutput, bool) bool, ...request.Option) error

	SearchSkillGroups(*alexaforbusiness.SearchSkillGroupsInput) (*alexaforbusiness.SearchSkillGroupsOutput, error)
	SearchSkillGroupsWithContext(aws.Context, *alexaforbusiness.SearchSkillGroupsInput, ...request.Option) (*alexaforbusiness.SearchSkillGroupsOutput, error)
	SearchSkillGroupsRequest(*alexaforbusiness.SearchSkillGroupsInput) (*request.Request, *alexaforbusiness.SearchSkillGroupsOutput)

	SearchSkillGroupsPages(*alexaforbusiness.SearchSkillGroupsInput, func(*alexaforbusiness.SearchSkillGroupsOutput, bool) bool) error
	SearchSkillGroupsPagesWithContext(aws.Context, *alexaforbusiness.SearchSkillGroupsInput, func(*alexaforbusiness.SearchSkillGroupsOutput, bool) bool, ...request.Option) error

	SearchUsers(*alexaforbusiness.SearchUsersInput) (*alexaforbusiness.SearchUsersOutput, error)
	SearchUsersWithContext(aws.Context, *alexaforbusiness.SearchUsersInput, ...request.Option) (*alexaforbusiness.SearchUsersOutput, error)
	SearchUsersRequest(*alexaforbusiness.SearchUsersInput) (*request.Request, *alexaforbusiness.SearchUsersOutput)

	SearchUsersPages(*alexaforbusiness.SearchUsersInput, func(*alexaforbusiness.SearchUsersOutput, bool) bool) error
	SearchUsersPagesWithContext(aws.Context, *alexaforbusiness.SearchUsersInput, func(*alexaforbusiness.SearchUsersOutput, bool) bool, ...request.Option) error

	SendInvitation(*alexaforbusiness.SendInvitationInput) (*alexaforbusiness.SendInvitationOutput, error)
	SendInvitationWithContext(aws.Context, *alexaforbusiness.SendInvitationInput, ...request.Option) (*alexaforbusiness.SendInvitationOutput, error)
	SendInvitationRequest(*alexaforbusiness.SendInvitationInput) (*request.Request, *alexaforbusiness.SendInvitationOutput)

	StartDeviceSync(*alexaforbusiness.StartDeviceSyncInput) (*alexaforbusiness.StartDeviceSyncOutput, error)
	StartDeviceSyncWithContext(aws.Context, *alexaforbusiness.StartDeviceSyncInput, ...request.Option) (*alexaforbusiness.StartDeviceSyncOutput, error)
	StartDeviceSyncRequest(*alexaforbusiness.StartDeviceSyncInput) (*request.Request, *alexaforbusiness.StartDeviceSyncOutput)

	TagResource(*alexaforbusiness.TagResourceInput) (*alexaforbusiness.TagResourceOutput, error)
	TagResourceWithContext(aws.Context, *alexaforbusiness.TagResourceInput, ...request.Option) (*alexaforbusiness.TagResourceOutput, error)
	TagResourceRequest(*alexaforbusiness.TagResourceInput) (*request.Request, *alexaforbusiness.TagResourceOutput)

	UntagResource(*alexaforbusiness.UntagResourceInput) (*alexaforbusiness.UntagResourceOutput, error)
	UntagResourceWithContext(aws.Context, *alexaforbusiness.UntagResourceInput, ...request.Option) (*alexaforbusiness.UntagResourceOutput, error)
	UntagResourceRequest(*alexaforbusiness.UntagResourceInput) (*request.Request, *alexaforbusiness.UntagResourceOutput)

	UpdateDevice(*alexaforbusiness.UpdateDeviceInput) (*alexaforbusiness.UpdateDeviceOutput, error)
	UpdateDeviceWithContext(aws.Context, *alexaforbusiness.UpdateDeviceInput, ...request.Option) (*alexaforbusiness.UpdateDeviceOutput, error)
	UpdateDeviceRequest(*alexaforbusiness.UpdateDeviceInput) (*request.Request, *alexaforbusiness.UpdateDeviceOutput)

	UpdateProfile(*alexaforbusiness.UpdateProfileInput) (*alexaforbusiness.UpdateProfileOutput, error)
	UpdateProfileWithContext(aws.Context, *alexaforbusiness.UpdateProfileInput, ...request.Option) (*alexaforbusiness.UpdateProfileOutput, error)
	UpdateProfileRequest(*alexaforbusiness.UpdateProfileInput) (*request.Request, *alexaforbusiness.UpdateProfileOutput)

	UpdateRoom(*alexaforbusiness.UpdateRoomInput) (*alexaforbusiness.UpdateRoomOutput, error)
	UpdateRoomWithContext(aws.Context, *alexaforbusiness.UpdateRoomInput, ...request.Option) (*alexaforbusiness.UpdateRoomOutput, error)
	UpdateRoomRequest(*alexaforbusiness.UpdateRoomInput) (*request.Request, *alexaforbusiness.UpdateRoomOutput)

	UpdateSkillGroup(*alexaforbusiness.UpdateSkillGroupInput) (*alexaforbusiness.UpdateSkillGroupOutput, error)
	UpdateSkillGroupWithContext(aws.Context, *alexaforbusiness.UpdateSkillGroupInput, ...request.Option) (*alexaforbusiness.UpdateSkillGroupOutput, error)
	UpdateSkillGroupRequest(*alexaforbusiness.UpdateSkillGroupInput) (*request.Request, *alexaforbusiness.UpdateSkillGroupOutput)
}

var _ AlexaForBusinessAPI = (*alexaforbusiness.AlexaForBusiness)(nil)


text:
require 'rack/contrib'

module FacultyAPI
  module V1
    class API < Grape::API
      use Rack::JSONP

      version 'v1', using: :header, vendor: :faculty_bio

      format :json

      # Simple CORS support
      before do
        header 'Access-Control-Allow-Origin', '*'
      end

      rescue_from Mongoid::Errors::DocumentNotFound do |e|
        Rack::Response.new({
            status: 404,
            message: 'Not found'
          }.to_json, 404)
      end

      mount FacultyBiosAPI
      mount BooksAPI
      mount ExpertiseAPI
    end
  end
end


text:
#include <qsqldriverplugin.h>
#include <qstringlist.h>
#include "../../../sql/drivers/mysql/qsql_mysql_p.h"

QT_BEGIN_NAMESPACE

class QMYSQLDriverPlugin : public QSqlDriverPlugin
{
    Q_OBJECT
    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QSqlDriverFactoryInterface" FILE "mysql.json")

public:
    QMYSQLDriverPlugin();

    QSqlDriver* create(const QString &);
};

QMYSQLDriverPlugin::QMYSQLDriverPlugin()
    : QSqlDriverPlugin()
{
}

QSqlDriver* QMYSQLDriverPlugin::create(const QString &name)
{
    if (name == QLatin1String("QMYSQL") || name == QLatin1String("QMYSQL3")) {
        QMYSQLDriver* driver = new QMYSQLDriver();
        return driver;
    }
    return 0;
}

QT_END_NAMESPACE

#include "main.moc"


text:
(function() {
    'use strict';

    angular
        .module('webHipsterApp')
        .controller('LivroDeleteController',LivroDeleteController);

    LivroDeleteController.$inject = ['$uibModalInstance', 'entity', 'Livro'];

    function LivroDeleteController($uibModalInstance, entity, Livro) {
        var vm = this;

        vm.livro = entity;
        vm.clear = clear;
        vm.confirmDelete = confirmDelete;

        function clear () {
            $uibModalInstance.dismiss('cancel');
        }

        function confirmDelete (id) {
            Livro.delete({id: id},
                function () {
                    $uibModalInstance.close(true);
                });
        }
    }
})();


text:
package openblocks.common.block;

import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Vec3;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import openblocks.common.tileentity.TileEntityTarget;
import openmods.block.BlockRotationMode;
import openmods.geometry.BlockSpaceTransform;
import openmods.geometry.Orientation;

public class BlockTarget extends OpenBlock {

	private int lastEntityHit = 0;

	public BlockTarget() {
		super(Material.rock);
		setLightLevel(0.3f);
		setRotationMode(BlockRotationMode.FOUR_DIRECTIONS);
		setRenderMode(RenderMode.TESR_ONLY);
	}

	@Override
	public boolean isOpaqueCube() {
		return false;
	}

	@Override
	public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {

		if (!world.isRemote && entity != null && entity instanceof EntityArrow) {
			if (lastEntityHit != entity.getEntityId()) {
				lastEntityHit = entity.getEntityId();
				return;
			}
			lastEntityHit = entity.getEntityId();
			onTargetHit(world, x, y, z, Vec3.createVectorHelper(entity.posX, entity.posY, entity.posZ));
		}
	}

	public void onTargetHit(World world, int x, int y, int z, Vec3 entityPosition) {

		if (world.isRemote) return;

		final TileEntityTarget target = getTileEntity(world, x, y, z, TileEntityTarget.class);
		if (target == null) return;

		/**
		 * onEntityCollidedWithBlock is called twice when the arrow is hit
		 * The first is from the raytracing, which is predictive and
		 * inaccurate The second is from the bounding box collision. We only
		 * care about the second one
		 */

		if (!target.isEnabled()) return;

		ForgeDirection opposite = target.getOrientation().south();

		double centerX = x + 0.5 + (opposite.offsetX * 0.5);
		double centerY = y + 0.55 + (opposite.offsetY * 0.45);
		double centerZ = z + 0.5 + (opposite.offsetZ * 0.5);

		switch (opposite) {
			case NORTH:
			case SOUTH:
				entityPosition.zCoord = centerZ;
				break;
			case EAST:
			case WEST:
				entityPosition.xCoord = centerX;
				break;
			default:
				break;

		}

		Vec3 bullseye = Vec3.createVectorHelper(centerX, centerY, centerZ);

		double distance = entityPosition.distanceTo(bullseye);

		target.setStrength(15 - Math.min(15, Math.max(0, (int)(distance * 32))));

	}

	@Override
	public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int m) {
		final TileEntityTarget tile = getTileEntity(world, x, y, z, TileEntityTarget.class);
		return tile != null? tile.getStrength() : 0;
	}

	@Override
	public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int m) {
		return isProvidingWeakPower(world, x, y, z, m);
	}

	@Override
	public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) {
		setBlockBoundsBasedOnState(world, x, y, z);
		return super.getSelectedBoundingBoxFromPool(world, x, y, z);
	}

	@Override
	public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
		setBlockBoundsBasedOnState(world, x, y, z);
		return super.getCollisionBoundingBoxFromPool(world, x, y, z);
	}

	@Override
	public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {

		TileEntity tile = world.getTileEntity(x, y, z);

		if (tile == null || !(tile instanceof TileEntityTarget)) { return; }

		TileEntityTarget target = (TileEntityTarget)tile;

		if (!target.isEnabled()) {
			setBlockBounds(0, 0, 0, 1.0f, 0.1f, 1.0f);
			return;
		}

		final Orientation orientation = target.getOrientation();

		final AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(0.0, 0.0, 0.9, 1.0, 1.0, 1.0);
		final AxisAlignedBB rotatedAabb = BlockSpaceTransform.instance.mapBlockToWorld(orientation, aabb);
		setBlockBounds(rotatedAabb);
	}

	@Override
	public boolean canPlaceBlockOnSide(World world, int x, int y, int z, ForgeDirection side) {
		return isOnTopOfSolidBlock(world, x, y, z, side);
	}
}


text:
shadow-engine
===========

Successor to IGM2E.

What is it?
----------

It's an codebase for simple games written in Java with LibGDX.
'git clone' and throw yourself into the code!
Replace assets, code etc. easily without worrying much about handling input, block updates, the light system and so on.
If you really want to squish the last part of customization, modify it!

What for?
----------

It's meant as codebase for simple games and people who are interrested in switching to the gamedevness of Java.
It's NOT meant as highly complex, powerfull game engine / framework / library / codebase / ...
It just offers what a codebase must offer. And some more.

I've begun IGM2E as codebase for my Ludum Dare entries. IGM2E (outdated now) uses Slick2D and was really poor written.
After some time I've stumbled upon LibGDX. I wanted to create a new codebase for further games.

And so begun Shadow.

<EOF>


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    android:orientation="vertical"
    app:carbon_insetColor="?attr/colorPrimary">

    <carbon.widget.RecyclerView
        android:id="@+id/recyclerView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:carbon_overScroll="always"
        app:carbon_headerMinHeight="@dimen/carbon_toolbarHeight"
        app:carbon_headerParallax="0.5"
        app:carbon_headerTint="?attr/colorPrimary"/>
</LinearLayout>


text:
package com.github.nest.arcteryx.data.codes.ut02;

import org.junit.Test;
import org.springframework.context.ApplicationContext;

import com.github.nest.arcteryx.common.ut.EnableLogger;
import com.github.nest.arcteryx.context.Context;
import com.github.nest.arcteryx.data.codes.ICodeTableRegistry;
import com.github.nest.arcteryx.data.internal.codes.utils.js.JSONGenerator;

public class UT02Test extends EnableLogger {
	/**
	 * test json generator
	 */
	@Test
	public void test() {
		ApplicationContext context = Context.createContextByClassPath("ut02",
				"/com/github/nest/arcteryx/data/codes/ut02/CodeTableA.xml");
		ICodeTableRegistry registry = context.getBean("CodeTableRegistry", ICodeTableRegistry.class);

		System.out.println(JSONGenerator.generate(registry));
	}
}


text:
if [[ -n $GITHUB_USER && -n $GITHUB_PASSWORD && -n $DOCKER_PROJECT && -n $IMAGE_NAME ]]; then
  install_hub || exit 1

  # hub release complains if we're not on a branch
  git checkout master

  # update the image tag in the k8s.yaml manifest
  sed 's|image: bitnami/kubeless-ui:.*|image: '"$DOCKER_PROJECT/$IMAGE_NAME:$CIRCLE_TAG"'|g' k8s.yaml > /tmp/k8s.yaml

  # create a github release
  hub release create -m "Release $CIRCLE_TAG" -a /tmp/k8s.yaml $CIRCLE_TAG

  # switch back to the checkout branch
  git checkout -
fi


text:
package Class::MOP::Mixin::HasAttributes;
BEGIN {
  $Class::MOP::Mixin::HasAttributes::AUTHORITY = 'cpan:STEVAN';
}
{
  $Class::MOP::Mixin::HasAttributes::VERSION = '2.0602';
}

use strict;
use warnings;

use Carp         'confess';
use Scalar::Util 'blessed';

use base 'Class::MOP::Mixin';

sub add_attribute {
    my $self = shift;

    my $attribute
        = blessed( $_[0] ) ? $_[0] : $self->attribute_metaclass->new(@_);

    ( $attribute->isa('Class::MOP::Mixin::AttributeCore') )
        || confess
        "Your attribute must be an instance of Class::MOP::Mixin::AttributeCore (or a subclass)";

    $self->_attach_attribute($attribute);

    my $attr_name = $attribute->name;

    $self->remove_attribute($attr_name)
        if $self->has_attribute($attr_name);

    my $order = ( scalar keys %{ $self->_attribute_map } );
    $attribute->_set_insertion_order($order);

    $self->_attribute_map->{$attr_name} = $attribute;

    # This method is called to allow for installing accessors. Ideally, we'd
    # use method overriding, but then the subclass would be responsible for
    # making the attribute, which would end up with lots of code
    # duplication. Even more ideally, we'd use augment/inner, but this is
    # Class::MOP!
    $self->_post_add_attribute($attribute)
        if $self->can('_post_add_attribute');

    return $attribute;
}

sub has_attribute {
    my ( $self, $attribute_name ) = @_;

    ( defined $attribute_name )
        || confess "You must define an attribute name";

    exists $self->_attribute_map->{$attribute_name};
}

sub get_attribute {
    my ( $self, $attribute_name ) = @_;

    ( defined $attribute_name )
        || confess "You must define an attribute name";

    return $self->_attribute_map->{$attribute_name};
}

sub remove_attribute {
    my ( $self, $attribute_name ) = @_;

    ( defined $attribute_name )
        || confess "You must define an attribute name";

    my $removed_attribute = $self->_attribute_map->{$attribute_name};
    return unless defined $removed_attribute;

    delete $self->_attribute_map->{$attribute_name};

    return $removed_attribute;
}

sub get_attribute_list {
    my $self = shift;
    keys %{ $self->_attribute_map };
}

sub _restore_metaattributes_from {
    my $self = shift;
    my ($old_meta) = @_;

    for my $attr (sort { $a->insertion_order <=> $b->insertion_order }
                       map { $old_meta->get_attribute($_) }
                           $old_meta->get_attribute_list) {
        $attr->_make_compatible_with($self->attribute_metaclass);
        $self->add_attribute($attr);
    }
}

1;

# ABSTRACT: Methods for metaclasses which have attributes

=pod

=head1 NAME

Class::MOP::Mixin::HasAttributes - Methods for metaclasses which have attributes

=head1 VERSION

version 2.0602

=head1 DESCRIPTION

This class implements methods for metaclasses which have attributes
(L<Class::MOP::Class> and L<Moose::Meta::Role>). See L<Class::MOP::Class> for
API details.

=head1 AUTHOR

Moose is maintained by the Moose Cabal, along with the help of many contributors. See L<Moose/CABAL> and L<Moose/CONTRIBUTORS> for details.

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Infinity Interactive, Inc..

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

__END__


text:
import threading
import logging
from socketIO_client import BaseNamespace
from socketIO_client import SocketIO
from pokemongo_bot import inventory

class WebsocketRemoteControl(object):

    def __init__(self, bot):
        self.bot = bot
        self.host, port_str = self.bot.config.websocket_server_url.split(':')
        self.port = int(port_str)
        self.sio = SocketIO(self.host, self.port)
        self.sio.on(
            'bot:process_request:{}'.format(self.bot.config.username),
            self.on_remote_command
        )
        self.thread = threading.Thread(target=self.process_messages)
        self.logger = logging.getLogger(type(self).__name__)

    def start(self):
        self.thread.start()
        return self

    def process_messages(self):
        self.sio.wait()

    def on_remote_command(self, command):
        name = command['name']
        command_handler = getattr(self, name, None)
        if not command_handler or not callable(command_handler):
            self.sio.emit(
                'bot:send_reply',
                {
                    'response': '',
                    'command': 'command_not_found',
                    'account': self.bot.config.username
                }
            )
            return
        if 'args' in command:
            command_handler(*args)
            return
        command_handler()

    def get_player_info(self):
        try:
            self.sio.emit(
                'bot:send_reply',
                {
                    'result': {'inventory': inventory.jsonify_inventory(), 'player': self.bot._player},
                    'command': 'get_player_info',
                    'account': self.bot.config.username
                }
            )
        except Exception as e:
            self.logger.error(e)


text:
var REST_REQUESTS_TIMEOUT = 3000;

describe('Content API', function() {
  var token,
      data = {};

  // beforeAll
  //
  beforeAll(function(done){
    QB.init(CREDENTIALS.appId, CREDENTIALS.authKey, CREDENTIALS.authSecret);

    QB.createSession(QBUser1, function(err, session) {
      if (err) {
        done.fail("Create session error: " + JSON.stringify(err));
      } else {
        expect(session).not.toBeNull();
        token = session.token;

        done();
      }
    });
  }, REST_REQUESTS_TIMEOUT);

  it('can create and upload files', function(done) {
    var d = new Date(2015, 10, 13, 14, 30, 30, 600),
        genFile = new File(["Hello QuickBlox"], "QB.txt", {type: "text/plain", lastModified: d});

    data = {name: genFile.name, file: genFile, type: genFile.type, size: genFile.size, public: false};

    QB.content.createAndUpload(data, function(err, res) {
      if (err) {
        done.fail("Create and upload files error: " + JSON.stringify(err));
      }else{
        expect(res).not.toBeNull();
        expect(res.name).toBe('QB.txt');
        console.info('can create and upload files');
        done();
      }
    });
  }, 5000);

  it('can list content objects', function(done) {
    QB.content.list(function(err, res) {
      if (err) {
        done.fail("List content objects error: " + JSON.stringify(err));
      }else{
        expect(res).not.toBeNull();
        expect(res.items.length).toBeGreaterThan(0);
        console.info('can list content objects');
        done();
      }
    });
  }, REST_REQUESTS_TIMEOUT);

  it('can delete content objects', function(done) {
    QB.content.createAndUpload(data, function(err, response) {
      if (err) {
        done.fail("Create and upload files error: " + JSON.stringify(err));
      }else{
        var elemId = response.id;
        QB.content.delete(elemId, function(err, result) {
          if (err) {
            done.fail("Delete content objects error: " + JSON.stringify(err));
          }else{
            expect(result).toEqual(true);
            console.info('can delete content objects');
            done();
          }
        });
      }
    });
  }, 7000);

  it('can get file information by ID', function(done) {
    QB.content.getInfo(2917985, function(err, res) {
      if (err) {
        done.fail("Get file information by ID error: " + JSON.stringify(err));
      }else{
        expect(res).not.toBeNull();
        expect(res.blob.id).toEqual(2917985);
        expect(res.blob.size).toBe(15);
        console.info('can get file information by ID');

        done();
      }
    });
  }, REST_REQUESTS_TIMEOUT);

  // Private Url
  //
  it('can access private URL', function() {
    var fileUID = "97f5802dcbd34a59a4921d73f6baedd000",
        privateURL = QB.content.privateUrl(fileUID);

    expect(privateURL).toBe("https://api.quickblox.com/blobs/97f5802dcbd34a59a4921d73f6baedd000?token="+token);
    console.info('can access private URL');
  });

  // Public Url
  //
  it('can access public URL', function() {
    var fileUID = "97f5802dcbd34a59a4921d73f6baedd000",
        publicUrl = QB.content.publicUrl(fileUID);

    expect(publicUrl).toEqual("https://api.quickblox.com/blobs/97f5802dcbd34a59a4921d73f6baedd000");
  });
});


text:
#ifndef EVENTS_H
#define EVENTS_H

#define EV_QUIT	    -1		// Used to end the run() loop

#define EV_FIRST    0x00020000	    // First non-key event

#define EV_STATUS_MSG	    EV_FIRST	    // add msg to status line, event.data is a string
#define EV_STATUS_EXTRA	    (EV_FIRST + 1)  // add extra msg to status line, event.data is a string

#define EV_CURSOR_CHANGE    (EV_FIRST + 2)  // A scroller's cursor has changed location, event.data is numeric location

#define EV_TITLE_MSG	    (EV_FIRST + 3)  // add msg to title bar, event.data is a string
#define EV_TITLE_EXTRA	    (EV_FIRST + 4)  // add extra msg to title bar, event.data is a string

#define EV_RUN_SINGLE_COMMAND	(EV_FIRST + 5)	// run a single command, event.data is command key
#define EV_RUN_MULTI_COMMAND	(EV_FIRST + 6)	// run a single command, event.data is command key

#define EV_REDRAW	    (EV_FIRST + 7)	// redraw window, event.data is nothing

#define EV_COLOR_CHANGE	    (EV_FIRST + 8)	// new colors!

#endif


text:
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// 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.
// ----------------------------------------------------------------------------------

using System.Globalization;
using System.Management.Automation;
using System.Net;
using System.Security.Permissions;
using Microsoft.Azure.Commands.DataFactoryV2.Models;
using Microsoft.Azure.Commands.DataFactoryV2.Properties;

namespace Microsoft.Azure.Commands.DataFactoryV2
{
    [Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "DataFactoryV2Pipeline", DefaultParameterSetName = ParameterSetNames.ByFactoryName, SupportsShouldProcess = true), OutputType(typeof(bool))]
    public class RemoveAzureDataFactoryPipelineCommand : DataFactoryContextActionBaseCmdlet
    {
        [Parameter(ParameterSetName = ParameterSetNames.ByFactoryName, Position = 2, Mandatory = true,
            HelpMessage = Constants.HelpPipelineName)]
        [Alias(Constants.PipelineName)]
        [ValidateNotNullOrEmpty]
        public override string Name { get; set; }

        [Parameter(ParameterSetName = ParameterSetNames.ByInputObject, Position = 0, Mandatory = true, ValueFromPipeline = true,
            HelpMessage = Constants.HelpPipeline)]
        [ValidateNotNull]
        public PSPipeline InputObject { get; set; }

        [EnvironmentPermission(SecurityAction.Demand, Unrestricted = true)]
        public override void ExecuteCmdlet()
        {
            ByInputObject(InputObject);
            ByResourceId();

            ConfirmAction(
                Force.IsPresent,
                string.Format(
                    CultureInfo.InvariantCulture,
                    Resources.PipelineConfirmationMessage,
                    Name,
                    DataFactoryName),
                string.Format(
                    CultureInfo.InvariantCulture,
                    Resources.PipelineRemoving,
                    Name,
                    DataFactoryName),
                Name,
                ExecuteDelete);

            WriteObject(true);

        }

        private void ExecuteDelete()
        {
            HttpStatusCode respone = DataFactoryClient.DeletePipeline(ResourceGroupName, DataFactoryName, Name);
            if (respone == HttpStatusCode.NoContent)
            {
                WriteWarning(string.Format(CultureInfo.InvariantCulture, Resources.PipelineNotFound, Name, DataFactoryName));
            }
        }
    }
}


text:
<?php
namespace PayPal\EBLBaseComponents;
use PayPal\Core\PPXmlMessage;
/**
 * Onboarding program code given to you by PayPal. Required
 * Character length and limitations: 64 alphanumeric characters
 *
 */
class EnterBoardingRequestDetailsType
   extends PPXmlMessage{

	/**
	 * Onboarding program code given to you by PayPal. Required
	 * Character length and limitations: 64 alphanumeric characters
	 * @access public

	 * @namespace ebl

	 * @var string
	 */
	public $ProgramCode;

	/**
	 * A list of comma-separated values that indicate the PayPal
	 * products you are implementing for this merchant: Direct
	 * Payment (dp) allows payments by credit card without
	 * requiring the customer to have a PayPal account. Express
	 * Checkout (ec) allows customers to fund transactions with
	 * their PayPal account. Authorization and Capture
	 * (auth_settle) allows merchants to verify availability of
	 * funds in a PayPal account, but capture them at a later time.
	 * Administrative APIs (admin_api) is a collection of the
	 * PayPal APIs for transaction searching, getting transaction
	 * details, refunding, and mass payments. Required Character
	 * length and limitations: 64 alphanumeric characters
	 * @access public

	 * @namespace ebl

	 * @var string
	 */
	public $ProductList;

	/**
	 * Any custom information you want to store for this partner
	 * Optional Character length and limitations: 256 alphanumeric
	 * characters
	 * @access public

	 * @namespace ebl

	 * @var string
	 */
	public $PartnerCustom;

	/**
	 * The URL for the logo displayed on the PayPal Partner Welcome
	 * Page. Optional Character length and limitations: 2,048
	 * alphanumeric characters
	 * @access public

	 * @namespace ebl

	 * @var string
	 */
	public $ImageUrl;

	/**
	 * Marketing category tha configures the graphic displayed n
	 * the PayPal Partner Welcome page.
	 * @access public

	 * @namespace ebl

	 * @var string
	 */
	public $MarketingCategory;

	/**
	 * Information about the merchantâs business
	 * @access public

	 * @namespace ebl

	 * @var PayPal\EBLBaseComponents\BusinessInfoType
	 */
	public $BusinessInfo;

	/**
	 * Information about the merchant (the business owner)
	 * @access public

	 * @namespace ebl

	 * @var PayPal\EBLBaseComponents\BusinessOwnerInfoType
	 */
	public $OwnerInfo;

	/**
	 * Information about the merchant's bank account
	 * @access public

	 * @namespace ebl

	 * @var PayPal\EBLBaseComponents\BankAccountDetailsType
	 */
	public $BankAccount;

}