text:
using UnityEngine;
using System.Collections;
using Assets.Scripts.Non_Mono;
using UnityEngine.UI;

public class Tile_Manager : MonoBehaviour {
    private Tower_Manager towerManager;
    private Tower_Prefab_List towerPrefabs;

    private UI_Manager UIManager;

	// Use this for initialization
	void Start () {
        towerPrefabs = GameObject.Find("Manager_Map").GetComponent<Tower_Prefab_List>();
        UIManager = GameObject.Find("UI_Canvas").GetComponent<UI_Manager>();

	}

	// Update is called once per frame
	void Update () {

	}

    void OnMouseEnter()
    {
        if(!gameObject.GetComponent<Tile_Info>().transversable)
        {
            liftTile();
        }

        if (hasTower())
        {
            UIManager.displayTowerInfo(towerManager.getTowerClass(), towerManager.getDamage(), towerManager.getSpeedOfAttack());
        }
        else
        {
            UIManager.hideTowerInfo();
        }
    }

    void OnMouseOver()
    {
        if (hasTower() && Input.GetMouseButtonDown(0))
        {
            UIManager.showUpgradeScreen(getTower());
        }

        if (Input.GetMouseButtonDown(0) && !gameObject.GetComponent<Tile_Info>().transversable)
        {
            if(!Reward_Manager.placed && !hasTower())
            {
                //DEBUG: PLACES AN ATTACK TOWER
                lowerTile();
                GameObject tower = null;

                switch(Reward_Manager.type)
                {
                    case Tower_Manager.Tower_Class.ATTACK:
                        tower = (GameObject)Instantiate(towerPrefabs.prefab_AttackTower, transform.position, transform.localRotation);
                        break;
                    case Tower_Manager.Tower_Class.MONEY:
                        tower = (GameObject)Instantiate(towerPrefabs.prefab_MoneyTower, transform.position, transform.localRotation);
                        break;
                    case Tower_Manager.Tower_Class.SLOW:
                        tower = (GameObject)Instantiate(towerPrefabs.prefab_SlowTower, transform.position, transform.localRotation);
                        break;
                }

                towerManager = tower.GetComponent<Tower_Manager>();
                tower.transform.parent = transform;
                tower.transform.localPosition = new Vector3(0f, 1f, 0f);
                towerManager.init(Reward_Manager.type, Reward_Manager.speed,Reward_Manager.power);
                liftTile();
                GameObject.FindGameObjectWithTag("Canvas").GetComponent<UI_Manager>().deactivatePurchasedText();
                Reward_Manager.placed = true;
            }
        }
    }

    void OnMouseExit()
    {
        if (!gameObject.GetComponent<Tile_Info>().transversable)
            lowerTile();

        UIManager.hideTowerInfo();

    }

    public void liftTile()
    {
        transform.position = new Vector3(transform.position.x, .25f, transform.position.z);
    }

    public void lowerTile()
    {
        transform.position = new Vector3(transform.position.x, 0f, transform.position.z);
    }

    public void setTowerManager(Tower_Manager manager)
    {
        this.towerManager = manager;
    }

    public Tower_Manager getTower()
    {
        return this.towerManager;
    }

    public bool hasTower()
    {
        if (towerManager == null) return false;
        else return true;
    }
}


text:
There are several configuration files you need to set up after
installing QuickSearch. Here are descriptions for each:

### quick_search_config.yml

This is QuickSearch's main configuration file where you configure
searchers, themes, and set other QuickSearch options. See the
/config/quick_search_config.yml.example for a sample configuration file.

### database.yml

This is a Rails configuration file for database connection information.
QuickSearch uses a database to log statistics for searches, and clicks.

You can find more information on populating this file in the [Rails
documentation for database.yml](http://guides.rubyonrails.org/configuring.html#configuring-a-database)

### secret_token.rb

This file contains a secret key for session verification. It should be
set to a 30+ character value, and a non-dictionary word. For more
information, see the [Rails Documentation](http://guides.rubyonrails.org/v4.1/security.html#session-storage)

## Configuring Themes

QuickSearch themes are implemented as Rails Gem Engines. To change which theme that QuickSearch uses, there are four steps to follow:

- Add the theme gem into your Gemfile
- Change the "theme" key in quick_search_config.yml to your theme's name
- Run "rake assets:clobber" to clear the Rails cache (otherwise you may get odd results)
- Restart the QuickSearch server

QuickSearch is designed to be modular in terms of its look and feel. A generic base theme is included by default, based on the Foundation CSS framework, where the templates are written in ERB, the stylesheets are SASS. Any part of this base theme can be overridden, for instance if you'd only like to change the colors, or replace the QuickSearch header with your library website headers, etc.

To override a file in a theme, just create your own version of the file
in the corresponding directory in your QuickSearch installation. This is
a good approach if you'd like to only modify smaller parts - otherwise
you would probably want to create your own theme.

If you would like to start from scratch and create your own theme, you are able to do that too. Here are a list of templates that QuickSearch expects to be implemented - other than that, you are able to use whichever technologies you'd like for the front-end (you are not tied to Foundation, or anything else that the generic theme implements).

- app/views/layouts/index.html.erb (the main QuickSearch layout)
- app/views/search/index.html.erb (the search results page)

## Configuring Searchers

In the QuickSearch bento-box layout, each section of the bento-box is referred to as a "searcher". A searcher is essentially an interface between a service that your library uses (such as your library catalog) and QuickSearch that defines how to search that service, and how to present the results. Searchers are implemented as Rails Gem Engines that can then be included into QuickSearch.

There are a number of searchers that have already been written for QuickSearch, and have been contributed to the community. These can be found here.

To include a searcher in QuickSearch, follow these steps:

- Include your searcher gem in the QuickSearch Gemfile
- Add the searcher name to the "searchers" section in "config/quick_search_config.yml"
- In your theme, you will need to specify where the searcher is rendered. To do this, edit your "app/views/quick_search/search/index.html.erb" file, and include this where you'd like the searcher to be rendered: "render_module(@your_searcher, 'your_searcher')"

Normally, searchers require some configuration options to be set -
things like API keys, URL to the service, etc. To override the default
configuration of the searcher, you need to create a configuration file in
the quick_search/config/searchers/ directory called [searcher_name_here]_config.yml.
So if your searcher is called catalog, it would be catalog_config.yml.

You can also [implement your own searcher](customizing_searchers.md) - this usually involves a minimal amount of code, depending on how complex you want it to be.

redpajama_set_name: RedPajamaGithub


text:
# USAGE

es5
```js
var storage = require("@trejgun/mongo-bot-storage");
var MongoDbBotStorage = storage.MongoDbBotStorage;
var MongoDBStorageClient = storage.MongoDBStorageClient;
```

es6
```js
import {MongoDbBotStorage, MongoDBStorageClient} from "@trejgun/mongo-bot-storage";
```

new native connection
```js
bot.set("storage", new MongoDbBotStorage(new MongoDBStorageClient({
    url: "mongodb://localhost/mydb",
    mongoOptions: {}
})));
```

mongoose connection
```js
const connection = mongoose.createConnection(/* ... */);
bot.set("storage", new MongoDbBotStorage(new MongoDBStorageClient({
    mongooseConnection: connection
})));
```

db connection
```js
MongoClient.connect("mongodb://localhost/mydb", (error, db) => {
    bot.set("storage", new MongoDbBotStorage(new MongoDBStorageClient({db})));
});
```

promise connection
```js
const dbPromise = new Promise((resolve, reject) => {
	MongoClient.connect("mongodb://localhost/mydb", (error, db) => {
		if (error) {
			reject(error);
		} else {
			resolve(db);
		}
	});
});

bot.set("storage", new MongoDbBotStorage(new MongoDBStorageClient({dbPromise})));
```


text:
/**
 * @fileoverview Tests for func-names rule.
 * @author Kyle T. Nunery
 */

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

var eslint = require("../../../lib/eslint"),
    ESLintTester = require("eslint-tester");

//------------------------------------------------------------------------------
// Tests
//------------------------------------------------------------------------------

var eslintTester = new ESLintTester(eslint);
eslintTester.addRuleTest("lib/rules/func-names", {
    valid: [
        "Foo.prototype.bar = function bar(){};",
        "function foo(){}",
        "function test(d, e, f) {}",
        "new function bar(){}"
    ],
    invalid: [
        { code: "Foo.prototype.bar = function() {};", errors: [{ message: "Missing function expression name.", type: "FunctionExpression"}] },
        { code: "(function(){}())", errors: [{ message: "Missing function expression name.", type: "FunctionExpression"}] },
        { code: "f(function(){})", errors: [{ message: "Missing function expression name.", type: "FunctionExpression"}] },
        { code: "var a = new Date(function() {});", errors: [{ message: "Missing function expression name.", type: "FunctionExpression"}] },
        { code: "var test = function (d, e, f) {};", errors: [{ message: "Missing function expression name.", type: "FunctionExpression"}] },
        { code: "new function() {}", errors: [{ message: "Missing function expression name.", type: "FunctionExpression"}] }
    ]
});


text:
require 'fileutils'

module Repository
  module Asset
    ##
    # Copy asset file
    #
    class Copy < AssetCommand
      attr_accessor :file

      def execute
        raise OpenWebslides::ArgumentError, 'Filename not specified' unless @file
        raise OpenWebslides::ArgumentError, 'File does not exist' unless File.exist? @file

        FileUtils.cp @file, asset_file
      end
    end
  end
end


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

/*==========================================================================
**
** Interface:  IEnumerable
**
**
** Purpose:
** This interface is redefined here since the original IEnumerable interface
** has all its methods marked as ecall's since it is a managed standard
** interface. This interface is used from within the runtime to make a call
** on the COM server directly when it implements the IEnumerable interface.
**
**
==========================================================================*/
namespace System.Runtime.InteropServices.ComTypes
{
    using System;

    [Guid("496B0ABE-CDEE-11d3-88E8-00902754C43A")]
    internal interface IEnumerable
    {
        [DispId(-4)]
        System.Collections.IEnumerator GetEnumerator();
    }
}


text:
from mpi4py import rc
import mpiunittest as unittest

class TestRC(unittest.TestCase):

    def testRC1(self):
        rc(initialize   = rc.initialize)
        rc(threads      = rc.threads)
        rc(thread_level = rc.thread_level)
        rc(finalize     = rc.finalize)
        rc(fast_reduce  = rc.fast_reduce)
        rc(recv_mprobe  = rc.recv_mprobe)

    def testRC2(self):
        kwargs = rc.__dict__.copy()
        rc(**kwargs)

    def testRC3(self):
        error = lambda: rc(ABCXYZ=123456)
        self.assertRaises(TypeError, error)

if __name__ == '__main__':
    unittest.main()


text:
<?php
/**
 * Created by PhpStorm.
 * User: farkas-berlin
 * Date: 06.12.14
 * Time: 20:56
 */

namespace AppBundle\Service\Chart;

use AppBundle\Helper\StatisticDate;
use AppBundle\Service\CsvReader;
use AppBundle\Service\Filter;

/**
 * Class AbstractChart
 * @package AppBundle\Service\Chart
 */
abstract class AbstractChart
{

    const TYPE_INCOME = 'income';
    const TYPE_OUTCOME = 'outcome';

    /**
     * @var CsvReader
     */
    protected $csvReader;

    /**
     * @var Filter
     */
    protected $filter;

    /**
     * @var array
     */
    protected $data = array();

    /**
     * @param CsvReader $csvReader
     * @param Filter $filter
     */
    public function __construct(
        CsvReader $csvReader,
        Filter $filter
    )
    {
        $this->csvReader = $csvReader;
        $this->filter = $filter;
    }

    /**
     * @param StatisticDate $statisticDate
     * @return mixed
     */
    abstract protected function preProcess(StatisticDate $statisticDate);

    /**
     * @param String $arrayKey
     */
    protected function postProcess($arrayKey)
    {
        return;
    }

    /**
     * @param $value
     * @param \DateTime $date
     * @param $category
     * @param $arrayKey
     * @return mixed
     */
    abstract protected function setRow($value, \DateTime $date, $category, $arrayKey);

    /**
     * @return array
     */
    public function getData(StatisticDate $statisticDate)
    {
        $arrayKey = (String)$statisticDate;
        if (isset($this->data[$arrayKey])) {
            return $this->data[$arrayKey];
        }

        $rows = $this->csvReader->getRows();
        $filterKeys = $this->filter->getKeys();

        $this->preProcess($statisticDate);
        foreach ($rows as $row) {
            $category = $category = !empty($row[2]) ? $row[2] : 'undefined';
            $value = $row[0];
            $date = new \DateTime($row[1]);

            if (
                in_array($category, $filterKeys) ||
                !$statisticDate->isDateBetweenStartAndEnd($date)
            ) {
                continue;
            }

            $this->setRow($value, $date, $category, $arrayKey);
        }
        $this->postProcess($arrayKey);

        return $this->data[$arrayKey];
    }
}


text:
MonoCross.Templates
===================

C# Templates to accelerate app development using MonoCross. Templates primarily target Visual Studio 2012 and newer.


text:
<?xml version="1.0"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You 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.
-->
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<configuration>
  <!-- Needs to exist on the namenode -->
  <property>
    <name>dfs.namenode.name.dir</name>
    <value>file:///var/lib/hadoop-hdfs/cache/hdfs/dfs/name</value>
  </property>

  <!-- Needs to exist on the namenode -->
  <property>
    <name>dfs.datanode.data.dir</name>
    <value>file:///var/lib/hadoop-hdfs/cache/hdfs/dfs/data</value>
  </property>

  <!-- Set the WebHDFS address -->
  <property>
    <name>dfs.namenode.http-address</name>
    <value>hdfsnamenode.hdp2-lagoon:50070</value>
    <description>
      The address and the base port on which the dfs NameNode Web UI will listen.
    </description>
  </property>

  <!-- Enable WebHDFS -->
  <property>
    <name>dfs.webhdfs.enabled</name>
    <value>true</value>
  </property>

  <property>
    <name>dfs.permissions.superusergroup</name>
    <value>hadoop</value>
  </property>

  <!-- Set replication to 1 so that you can use one clusternode -->
  <property>
    <name>dfs.replication</name>
    <value>1</value>
  </property>

  <!-- Support appending to files -->
  <property>
    <name>dfs.support.append</name>
    <value>true</value>
  </property>
</configuration>


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

namespace Orchard.Mvc.ModelBinders {
    public class ModelBinderDescriptor {
        public Type Type { get; set; }
        public IModelBinder ModelBinder { get; set; }
    }
}


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('artists', '0005_auto_20160411_0257'),
        ('concerts', '0002_sponsoredevent'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='sponsoredevent',
            name='artist',
        ),
        migrations.AddField(
            model_name='sponsoredevent',
            name='artists',
            field=models.ManyToManyField(related_name='sponsored_events', to='artists.Artist'),
        ),
    ]


text:
require File.expand_path('../../../test/test_helper', File.dirname(__FILE__))

# Ensure that we are using the temporary fixture path
# Engines::Testing.set_fixture_path


text:
import {HarnessPredicate} from '@angular/cdk/testing';
import {
  MatSnackBarHarness as BaseMatSnackBarHarness,
  SnackBarHarnessFilters,
} from '@angular/material/snack-bar/testing';

/** Harness for interacting with an MDC-based mat-snack-bar in tests. */
export class MatSnackBarHarness extends BaseMatSnackBarHarness {
  // Developers can provide a custom component or template for the snackbar. The canonical snack-bar
  // parent is the "MatSnackBarContainer". We use `:not([mat-exit])` to exclude snack bars that
  // are in the process of being dismissed, because the element only gets removed after the
  // animation is finished and since it runs outside of Angular, we don't have a way of being
  // notified when it's done.
  /** The selector for the host element of a `MatSnackBar` instance. */
  static override hostSelector = '.mat-mdc-snack-bar-container:not([mat-exit])';
  protected override _messageSelector = '.mat-mdc-simple-snack-bar .mat-mdc-snack-bar-label';
  protected override _simpleSnackBarSelector = '.mat-mdc-simple-snack-bar';
  protected override _actionButtonSelector = '.mat-mdc-simple-snack-bar .mat-mdc-snack-bar-action';

  /**
   * Gets a `HarnessPredicate` that can be used to search for a `MatSnackBarHarness` that meets
   * certain criteria.
   * @param options Options for filtering which snack bar instances are considered a match.
   * @return a `HarnessPredicate` configured with the given options.
   */
  static override with(
      options: SnackBarHarnessFilters = {}): HarnessPredicate<BaseMatSnackBarHarness> {
    return new HarnessPredicate<BaseMatSnackBarHarness>(MatSnackBarHarness, options);
  }
}


text:
package com.evature.evasdk;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.support.v4.app.TaskStackBuilder;
import android.util.Log;
import android.view.MenuItem;

import com.evature.evasdk.util.DLog;

/**
 * Created by iftah on 6/4/15.
 */
public class EvaChatScreenActivity extends Activity {
    private static final String TAG = "EvaChatScreenActivity";
    EvaChatScreenComponent chatScreen;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        chatScreen = new EvaChatScreenComponent(this);
        chatScreen.onCreate(savedInstanceState);
        setContentView(chatScreen.createMainView(getLayoutInflater(), null, savedInstanceState));
    }

    @Override
    protected void onResume() {
        super.onResume();
        chatScreen.onResume();

        Intent intent = getIntent();
        if ("com.google.android.gms.actions.SEARCH_ACTION".equals(intent.getAction())) {
            onNewIntent(new Intent());
        }
    }

    public void onSaveInstanceState(Bundle savedInstanceState) {
        super.onSaveInstanceState(savedInstanceState);
        chatScreen.onSaveInstanceState(savedInstanceState);
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        // getIntent() should always return the most recent
        setIntent(intent);
    }

    @Override
    protected void onPause() {
        chatScreen.onPause();
        super.onPause();
    }

    @Override
    protected void onDestroy() {
        chatScreen.onDestroy();
        super.onDestroy();
    }

    @Override
    public void onBackPressed() {
        if (!chatScreen.onBackPressed()) {
            chatScreen.speak("", true); // stop speech
            // back pressed, not handled internally, try to see if parent task should be created
            Intent upIntent = NavUtils.getParentActivityIntent(this);
            if (upIntent == null) {
                super.onBackPressed();
                return;
            }

            if (NavUtils.shouldUpRecreateTask(this, upIntent)) {
                // This activity is NOT part of this app's task, so create a new task
                // when navigating up, with a synthesized back stack.
                TaskStackBuilder.create(this)
                        // Add all of this activity's parents to the back stack
                        .addNextIntentWithParentStack(upIntent)
                                // Navigate up to the closest parent
                        .startActivities();
            } else {
                // This activity is part of this app's task, so simply
                // navigate up to the logical parent activity.
                NavUtils.navigateUpTo(this, upIntent);
            }
        }
    }
}


text:
package com.fionapet.business.restclient;

import com.alibaba.fastjson.JSON;
import com.fionapet.business.entity.PhoneMessage;
import junit.framework.Assert;
import org.dubbo.x.consumer.Assertable;
import org.dubbo.x.consumer.RestClientTestCase;
import org.dubbo.x.entity.RestResultEnum;
import org.dubbo.x.facade.RestResult;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.ws.rs.ProcessingException;
import java.util.List;

/**
* Created by tom on 2016-07-18 11:00:45.
 */
public class PhoneMessageRestClient extends RestClientTestCase {
    private static final Logger LOGGER = LoggerFactory.getLogger(PhoneMessageRestClient.class);
    private static final String TOKEN = "fc5db3b3-4063-4a12-a511-880ba19e4b58";
    private static final String URL = "http://localhost:8818/api/v2/phonemessages";

    @Test(expected = ProcessingException.class)
    public void testList(){
         assertRequest(new Assertable() {
            @Override
            public void assertBlack(RestResult restResult) throws Exception {
                RestResult<List<PhoneMessage>> result = (RestResult<List<PhoneMessage>>)restResult;
                Assert.assertEquals(restResult.getCode(), RestResultEnum.OK.getCode());

                Assert.assertNotNull(result.getData());

                Assert.assertEquals(result.getData().size(), 0);

                LOGGER.info("PhoneMessage list:{}", JSON.toJSON(restResult));
            }
        }, URL, PhoneMessageRestClient.TOKEN);
    }

//    @Test(expected = ProcessingException.class)
//    public void testCreate(){
//        final PhoneMessage phoneMessage = new PhoneMessage();
////        phoneMessage.set*("*");
//
//        Response response = getBuilder(URL, phoneMessageRestClient.TOKEN).post(Entity.entity(phoneMessage, MediaType.APPLICATION_JSON));
//
//        assertRequest(new Assertable() {
//            @Override
//            public void assertBlack(RestResult restResult) throws Exception {
//                LOGGER.info("restResult:{}", restResult);
//                RestResult<HashMap> result = (RestResult<HashMap>)restResult;
//                Assert.assertEquals(restResult.getCode(), RestResultEnum.OK.getCode());
//
//                Assert.assertNotNull(result.getData());
//
//                LOGGER.info("result.getData():{}", result.getData().getClass());
//
//                Assert.assertNotNull(result.getData().get("id"));
//
//                LOGGER.info("list:{}", JSON.toJSON(restResult));
//            }
//        }, response);
//    }

}


text:
#ifdef HAS_VTK

#include <vtkUnstructuredGrid.h>
#include <vtkUnstructuredGridReader.h>
#include <vtkUnstructuredGridWriter.h>

#include <irtkTransformation.h>

char *_target_name = NULL, *_source_name = NULL;
char *resultout_name = NULL;

void usage()
{
  cerr << "Usage: pevaluation [target] [source]" << endl;
  cerr << "<-output file>       Result output file" << endl;
  exit(1);
}

int main(int argc, char **argv)
{
  int i, ok;
  double error, source_point[3], target_point[3];

  if (argc < 3) {
    usage();
  }

  // Parse filenames
  _target_name = argv[1];
  argv++;
  argc--;
  _source_name = argv[1];
  argv++;
  argc--;

  // Parse remaining parameters
  while (argc > 1){
    ok = false;
	if ((ok == false) && (strcmp(argv[1], "-output") == 0)){
      argc--;
      argv++;
      resultout_name = argv[1];
      argc--;
      argv++;
      ok = true;
    }
    if (ok == false){
      cerr << "Can not parse argument " << argv[1] << endl;
      usage();
    }
  }

  // Target pipeline
  cout << "Reading target ... " << _target_name << endl;
  vtkUnstructuredGridReader *target_reader = vtkUnstructuredGridReader::New();
  target_reader->SetFileName(_target_name);
  target_reader->Modified();
  target_reader->Update();
  vtkUnstructuredGrid *target = vtkUnstructuredGrid::New();
  target = target_reader->GetOutput();
#if VTK_MAJOR_VERSION < 6
  target->Update();
#endif

  // Source pipeline
  cout << "Reading source ... " << _source_name << endl;
  vtkUnstructuredGridReader *source_reader = vtkUnstructuredGridReader::New();
  source_reader->SetFileName(_source_name);
  source_reader->Modified();
  source_reader->Update();
  vtkUnstructuredGrid *source = vtkUnstructuredGrid::New();
  source = source_reader->GetOutput();
#if VTK_MAJOR_VERSION < 6
  source->Update();
#endif

  if (target->GetNumberOfPoints() != source->GetNumberOfPoints()) {
    cerr << "Landmarks should have equal number of points" << endl;
    exit(1);
  }

  error = 0;
  for (i = 0; i < target->GetNumberOfPoints(); i++) {
    target->GetPoints()->GetPoint (i, target_point);
    source->GetPoints()->GetPoint (i, source_point);
    error += sqrt((target_point[0] - source_point[0]) * (target_point[0] - source_point[0]) +
                  (target_point[1] - source_point[1]) * (target_point[1] - source_point[1]) +
                  (target_point[2] - source_point[2]) * (target_point[2] - source_point[2]));
    cout << "Error for landmark " << i + 1 << " = " <<
         sqrt((target_point[0] - source_point[0]) * (target_point[0] - source_point[0]) +
              (target_point[1] - source_point[1]) * (target_point[1] - source_point[1]) +
              (target_point[2] - source_point[2]) * (target_point[2] - source_point[2])) << endl;

  }

  error /= (double)target->GetNumberOfPoints();
  cout << "RMS = " << error << " mm" << endl;

  double tstd = 0, stderror = 0;
  for (i = 0; i < target->GetNumberOfPoints(); i++){
	  target->GetPoints()->GetPoint (i, target_point);
	  source->GetPoints()->GetPoint (i, source_point);
	  tstd = sqrt((target_point[0] - source_point[0]) * (target_point[0] - source_point[0]) +
		  (target_point[1] - source_point[1]) * (target_point[1] - source_point[1]) +
		  (target_point[2] - source_point[2]) * (target_point[2] - source_point[2]));
	  tstd = pow(tstd - error,2);
	  stderror += tstd;
  }
  stderror=sqrt(stderror/double(target->GetNumberOfPoints()));
  cout<<"standard deviation is " << stderror  << " mm" << endl;

  if(resultout_name){
	  cerr << "Writing Results: " << resultout_name << endl;
	  ofstream fout(resultout_name,ios::app);
	  fout << error << " " << stderror << endl;
	  fout.close();
  }
}

#else

#include <irtkImage.h>

int main( int argc, char *argv[] )
{
  cerr << argv[0] << " needs to be compiled with the VTK library " << endl;
}
#endif


text:
<title>PKCS #11 JAR Format</title>

PKCS #11 JAR Format

PKCS #11 modules can be packaged into JAR files that support automatic
installation onto the filesystem and into the security module database.
The JAR file should contain:

All files that will be installed onto the target machine.  This will
include at least the PKCS #11 module library file (.DLL or .so), and
may also include any other file that should be installed (such as
documentation).

A script to perform the installation.

The script can be in one of two forms. If the JAR file is to be
run by Communicator (or any program that interprets Javascript), the
instructions will be in the form of a SmartUpdate script.
Documentation
 on creating this script can be found on DevEdge.

If the
JAR file is to be run by a server, modutil, or any other program that
doesn't interpret Javascript, a special information file must be included
in the format described in this document.

Declaring the Script in the Manifest File

The script can have any name, but it must be declared in the manifest file
of the JAR archive.  The metainfo tag for this is
Pkcs11_install_script.  Meta-information is put in the manifest
file by putting it in a file which is passed to
Signtool.  For example,
suppose the PKCS #11 installer script is in the file pk11install.
In Signtool's metainfo file, you would have a line like this:

+ Pkcs11_install_script: pk11install

Sample Script File

ForwardCompatible { IRIX:6.2:mips Solaris:5.5.1:sparc }
Platforms {
	WINNT::x86 {
		ModuleName { "Fortezza Module" }
		ModuleFile { win32/fort32.dll }
		DefaultMechanismFlags{0x0001}
		DefaultCipherFlags{0x0001}
		Files {
			win32/setup.exe {
				Executable
				RelativePath { %temp%/setup.exe }
			}
			win32/setup.hlp {
				RelativePath { %temp%/setup.hlp }
			}
			win32/setup.cab {
				RelativePath { %temp%/setup.cab }
			}
		}
	}
	WIN95::x86 {
		EquivalentPlatform {WINNT::x86}
	}
	Solaris:5.5.1:sparc {
		ModuleName { "Fortezza UNIX Module" }
		ModuleFile { unix/fort.so }
		DefaultMechanismFlags{0x0001}
		CipherEnableFlags{0x0001}
		Files {
			unix/fort.so {
				RelativePath{%root%/lib/fort.so}
				AbsolutePath{/usr/local/netscape/lib/fort.so}
				FilePermissions{555}
			}
			xplat/instr.html {
				RelativePath{%root%/docs/inst.html}
				AbsolutePath{/usr/local/netscape/docs/inst.html}
				FilePermissions{555}
			}
		}
	}
	IRIX:6.2:mips {
		EquivalentPlatform { Solaris:5.5.1:sparc }
	}
}

Script File Grammar

--> valuelist

valuelist --> value valuelist
              <null>

value --> key_value_pair
          string

key_value_pair --> key { valuelist }

key --> string

string --> simple_string
           "complex_string"

simple_string --> [^ \t\n\""{""}"]+ (no whitespace, quotes, or braces)

complex_string --> ([^\"\\\r\n]|(\\\")|(\\\\))+ (quotes and backslashes must be escaped with a backslash, no newlines or carriage returns are allowed in the string)

Outside of complex strings, all whitespace (space, tab, newline) is considered
equal and is used only to delimit tokens.

Keys

Keys are case-insensitive.

Global Keys

ForwardCompatible

Gives a list of platforms that are forward compatible.  If the current
platform cannot be found in the list of supported platforms, then the
ForwardCompatible list will be checked for any platforms that have the same
OS and architecture and an earlier version. If one is found, its
attributes will be used for the current platform.

Platforms (required)

Gives a list of platforms.  Each entry in the list is itself a key-value
pair:
the key is the name of the platform, and the valuelist contains various
attributes of the platform. The ModuleName, ModuleFile, and Files attributes
must be specified, unless an EquivalentPlatform attribute is specified.
The platform string is in the following
format: system name:os release:architecture. The installer
will obtain these values from NSPR. os release is an empty
string on non-UNIX operating systems.  The following system names and platforms
are currently defined by NSPR:

AIX (rs6000)

BSDI (x86)

FREEBSD (x86)

HPUX (hppa1.1)

IRIX (mips)

LINUX (ppc, alpha, x86)

MacOS (PowerPC) (Note: NSPR actually defines the OS as
"Mac OS".  The
space makes the name unsuitable for being embedded in identifiers.  Until
NSPR changes, you will have to add some special code to deal with this case.
)

NCR (x86)

NEC (mips)

OS2 (x86)

OSF (alpha)

ReliantUNIX (mips)

SCO (x86)

SOLARIS (sparc)

SONY (mips)

SUNOS (sparc)

UnixWare (x86)

WIN95 (x86)

WINNT (x86)

Examples of valid platform strings: IRIX:6.2:mips, Solaris:5.5.1:sparc,
Linux:2.0.32:x86, WIN95::x86.

Per-Platform Keys

These keys only have meaning within the value list of an entry in
the Platforms list.

ModuleName (required)

Gives the common name for the module. This name will be used to
reference the module from Communicator, modutil, servers, or any other
program that uses the Netscape security module database.

ModuleFile (required)

Names the PKCS #11 module file (DLL or .so) for this platform.  The name
is given as the relative path of the file within the JAR archive.

Files (required)

Lists the files that should be installed for this module.  Each entry
in the file list is a key-value pair: the key is the path of the file in
the JAR archive, and
the valuelist contains attributes of the file.  At least RelativePath and
AbsoluteDir must be specified in this valuelist.

DefaultMechanismFlags

This key-value pair specifies
of which mechanisms this module will be a default provider. It is a bitstring
specified in hexadecimal (0x) format.  It is constructed as a bitwise OR
of the following constants. If the DefaultMechanismFlags
entry is omitted, the value will default to 0x0.

RSA:			0x0000 0001
DSA:			0x0000 0002
RC2:			0x0000 0004
RC4:			0x0000 0008
DES:			0x0000 0010
DH:			0x0000 0020
FORTEZZA:		0x0000 0040
RC5:			0x0000 0080
SHA1:			0x0000 0100
MD5:			0x0000 0200
MD2:			0x0000 0400
RANDOM:			0x0800 0000
FRIENDLY:		0x1000 0000
OWN_PW_DEFAULTS:	0x2000 0000
DISABLE:		0x4000 0000

CipherEnableFlags

This key-value pair specifies
which SSL ciphers will be enabled.  It is a bitstring specified in
hexadecimal (0x) format.  It is constructed as a bitwise OR of the following
constants.  If the CipherEnableFlags entry is omitted, the
value will default to 0x0.

FORTEZZA:		0x0000 0001

EquivalentPlatform

Specifies that the attributes of the named platform should also be used
for the current platform. Saves typing when there is more than one platform
that uses the same settings.

Per-File Keys

These keys only have meaning within the valuelist of an entry in a
Files list. At least one of RelativePath and
AbsolutePath must be specified.  If both are specified, the
relative path will be tried first and the absolute path used only if no
relative root directory is provided by the installer program.

RelativePath

Specifies the destination directory of the file, relative to some directory
decided at install-time.  Two variables can be used in the relative
path, "%root%" and "%temp%".  "%root%" will be replaced at run-time with
the directory relative to which files should be installed; for
example, it may be the server's root directory or Communicator's root
directory. "%temp%" is a directory that will be created at the beginning
of the installation and destroyed at the end of the installation. Its purpose
is to hold executable files (such as setup programs), or files that are
used by these programs.  For example, a Windows installation might consist
of a setup.exe installation program, a help file, and a .cab file
containing compressed information. All these files could be installed into the
temporary directory. Files destined for the temporary directory are guaranteed
to be in place before any executable file is run, and will not be deleted
until all executable files have finished.

AbsoluteDir

Specifies the destination directory of the file as an absolute path.
This will only be used if the installer is unable to determine a
relative directory.

Executable

This string specifies that the file is to be executed during the
course of the
installation.  Typically this would be used for a setup program provided
by a module vendor, such as a self-extracting setup.exe.
More than one file can be specified as executable, in which case they will
be run in the order they are specified in the script file.

FilePermissions

This string is interpreted as a string of octal digits, according to the
standard UNIX format. It is a bitwise OR of the following constants:

user read:         400
user write:        200
user execute:      100
group read:        040
group write:       020
group execute:     010
other read:        004
other write:       002
other execute:     001

Some platforms may not understand these permissions.  They will only be
applied insofar as makes sense for the current platform. If this attribute
is omitted, a default of 777 is assumed.


text:
document.getElementById('login-form').addEventListener('submit', function (e) {
    function value(id) {
        return document.getElementById(id).value;
    }

    var jid = value('jid');
    if (SERVER_CONFIG.domain && jid.indexOf('@') == -1)
         jid += "@" + SERVER_CONFIG.domain;
    var password = value('password');
    var connURL = SERVER_CONFIG.wss ? SERVER_CONFIG.wss : value('connURL');
    var publicComputer = document.getElementById('public-computer').checked;

    var transport;
    var wsURL = '';
    var boshURL = '';
    if (connURL.indexOf('http') === 0) {
        boshURL = connURL;
        transport = 'bosh';
    } else if (connURL.indexOf('ws') === 0) {
        wsURL = connURL;
        transport = 'websocket';
    }

    var softwareVersion = SERVER_CONFIG.softwareVersion;
    if (softwareVersion) {
        softwareVersion.os = navigator.userAgent
    }

    localStorage.config = JSON.stringify({
        jid: jid,
        server: jid.slice(jid.indexOf('@') + 1),
        wsURL: wsURL,
        boshURL: boshURL,
        transports: [transport],
        credentials: {
            password: password
        },
        saveCredentials: !publicComputer,
        softwareVersion: softwareVersion
    });

    window.location = './';

    e.preventDefault();
});


text:
def log_task(task_id, task):
    print 'LOG TASK'
    print task_id
    print task


text:
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeVectorScalarMix" inherits="VisualShaderNode" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
	<brief_description>
		Linearly interpolates between two vectors using a scalar. For use within the visual shader graph.
	</brief_description>
	<description>
		Translates to [code]mix(a, b, weight)[/code] in the shader language, where [code]a[/code] and [code]b[/code] are vectors and [code]weight[/code] is a scalar.
	</description>
	<tutorials>
	</tutorials>
	<methods>
	</methods>
	<constants>
	</constants>
</class>


text:
package uk.ac.susx.mlcl.byblo.weighings.impl;

/**
 * Created with IntelliJ IDEA.
 * User: hamish
 * Date: 13/09/2012
 * Time: 15:38
 * To change this template use File | Settings | File Templates.
 */
public class NegativeWeightingTest extends AbstractWeightingTest<NegativeWeighting> {
    @Override
    protected String getWeightingName() {
        return "neg";
    }

    @Override
    protected Class<? extends NegativeWeighting> getImplementation() {
        return NegativeWeighting.class;
    }
}


text:
package com.hazelcast.internal.yaml;

/**
 * Interface for YAML mapping nodes
 */
public interface YamlMapping extends YamlCollection {

    /**
     * Gets a child node by its name
     *
     * @param name the name of the child node
     * @return the child node with the given name if exists,
     * {@code null} otherwise
     */
    YamlNode child(String name);

    /**
     * Returns the children as {@link YamlNameNodePair}s
     *

     * This method may have {@code null} values as the {@code childNode}
     * in the returned pairs if the node's values is explicitly defined
     * as {@code !!null} in the YAML document.
     *

     * The difference from the {@link #children()} children method is
     * that {@link #children()} does not return {@code null} children
     * nodes, while {@link #childrenPairs()} does.
     *
     * @return an {@link Iterable} pair of node names and node instances
     */
    Iterable<YamlNameNodePair> childrenPairs();

    /**
     * Gets a child mapping node by its name
     *
     * @param name the name of the child node
     * @return the child mapping node with the given name if exists,
     * {@code null} otherwise
     */
    YamlMapping childAsMapping(String name);

    /**
     * Gets a child sequence node by its name
     *
     * @param name the name of the child node
     * @return the child sequence node with the given name if exists,
     * {@code null} otherwise
     */
    YamlSequence childAsSequence(String name);

    /**
     * Gets a child scalar node by its name
     *
     * @param name the name of the child node
     * @return the child scalar node with the given name if exists,
     * {@code null} otherwise
     */
    YamlScalar childAsScalar(String name);

    /**
     * Gets a child scalar node's value by its name
     *

     * See {@link YamlScalar} for the possible types
     *

     * Please note that if the scalar's type is not the expected type T,
     * a {@link ClassCastException} is thrown at the call site.
     *
     * @param name the name of the child node
     * @return the child scalar node's value with the given name if exists,
     * {@code null} otherwise
     * @see YamlScalar
     * @see #childAsScalarValue(String, Class)
     */
    <T> T childAsScalarValue(String name);

    /**
     * Gets a child scalar node's value by its name with type hinting
     *

     * See {@link YamlScalar} for the possible types
     *
     * @param name the name of the child node
     * @param type the type that the scalar's value type to be validated
     *             against
     * @return the child scalar node's value with the given name
     * @throws YamlException if the scalar's value is not a type of T
     * @see YamlScalar
     */
    <T> T childAsScalarValue(String name, Class<T> type);
}


text:
$(document).ready(function() {
  $('#service_service_areas').select2({
    placeholder: 'Select one or more service areas'
  });
});


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Interface IRetryWithTypeBuilder
   </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Interface IRetryWithTypeBuilder
   ">
    <meta name="generator" content="docfx 2.43.1.0">

    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">

              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                Toggle navigation

              </button>

              <form class="navbar-form navbar-right" role="search" id="search">

                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">

              </form>

          Show / Hide Table of Contents

Interface IRetryWithTypeBuilder

Retry IDispatcher builder filtering exception based on type

Inherited Members

      IRetryBuilderWithWait.WithWaitBetweenRetry(Int32)

      IRetryBuilderWithWait.WithWaitBetweenRetry(TimeSpan)

      IRetryBuilderWithWait.WithWaitBetweenRetry(TimeSpan[])

      IRetryBuilderWithWait.WithWaitBetweenRetry(Int32[])

      IRetryBuilderWithWait.WithWaitBetweenRetry(Func<Int32, TimeSpan>)

      IRetryBuilder.ForEver()

      IRetryBuilder.WithMaxRetry(Int32)

Namespace: ComposableAsync.Resilient

Assembly: ComposableAsync.Resilient.dll

Syntax

public interface IRetryWithTypeBuilder : IRetryBuilderWithWait, IRetryBuilder

Methods

    |
    Improve this Doc

    View Source

And<T>()

Add the exception type to be caught

Declaration

IRetryWithTypeBuilder And<T>()
    where T : Exception

Returns

        Type
        Description

        IRetryWithTypeBuilder

Type Parameters

        Name
        Description

        T

                    Improve this Doc

                    View Source

              Back to top

            Generated by DocFX


text:
package org.metis.sql;

import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Timestamp;
import java.sql.Time;
import java.sql.Types;
import java.net.URL;
import java.net.MalformedURLException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * Represents a string token of a SQL statement. There are two types: regular
 * and key. A regular token is a SQL word, while a key-token represents a
 * parameterized field of the SQL statement. A parameterized field is comprised
 * of three parts (sql-type, key, mode) and is delimited by '`'. The type and
 * key-name are required, while mode is optional and reserved for call'able
 * statements. For example, `string:first` represents a field of type string
 * whose key name is 'first'. For example: <code>
 * select first from users where first like `string:first` || '%'
 * </code>
 *
 */
public class SqlToken implements Comparable<SqlToken> {

	public static final Log LOG = LogFactory.getLog(SqlToken.class);

	public static final int ORACLE_CURSOR = -10;

	/**
	 * Enumeration used for identifying the parameter mode for this token; used
	 * for call'able statements
	 */
	public enum Mode {
		IN, OUT, INOUT, NOMODE;
	}

	/**
	 * Enumeration used for the valid or accepted SQL types
	 */
	public enum JdbcType {
		// @formatter:off
		CHAR,
		VARCHAR,
		LONGVARCHAR,
		NUMERIC,
		DECIMAL,
		BIT,
		BOOLEAN,
		TINYINT,
		SMALLINT,
		INTEGER,
		BIGINT,
		REAL,
		FLOAT,
		DOUBLE,
		DATE,
		TIME,
		TIMESTAMP,
		DATALINK,
		NCHAR,
		NVARCHAR,
		LONGNVARCHAR,
		CURSOR,
		// RSET is our own type used for defining
		// ResultSet OUT params
		RSET,
		// PKEY is our type used for defining
		// a primary key for an insert
		PKEY;
		// @formatter:on

		// return the numeric value of this JDBC type
		public int getType() {
			switch (this) {
			case CHAR:
				return Types.CHAR;
			case NCHAR:
				return Types.NCHAR;
			case VARCHAR:
				return Types.VARCHAR;
			case NVARCHAR:
				return Types.NVARCHAR;
			case LONGVARCHAR:
				return Types.LONGVARCHAR;
			case LONGNVARCHAR:
				return Types.LONGNVARCHAR;
			case NUMERIC:
				return Types.NUMERIC;
			case DECIMAL:
				return Types.DECIMAL;
			case BIT:
				return Types.BIT;
			case BOOLEAN:
				return Types.BOOLEAN;
			case TINYINT:
				return Types.TINYINT;
			case SMALLINT:
				return Types.SMALLINT;
			case INTEGER:
				return Types.INTEGER;
			case BIGINT:
				return Types.BIGINT;
			case REAL:
				return Types.REAL;
			case FLOAT:
				return Types.FLOAT;
			case DOUBLE:
				return Types.DOUBLE;
			case DATE:
				return Types.DATE;
			case TIMESTAMP:
				return Types.TIMESTAMP;
			case TIME:
				return Types.TIME;
			case DATALINK:
				return Types.DATALINK;
			case CURSOR:
				return ORACLE_CURSOR;
			default:
				return 0;
			}
		}
	}

	// the key is used only for key fields such as `<sql type>:<key>:<mode>`
	// the key is left null for non key fields like SQL keywords
	private String key;
	private String value;
	private JdbcType jdbcType;
	private Mode mode = Mode.NOMODE;
	// the token's first, and most probably only, position in the sql statment
	private int position = -1;
	// additional positions that this token is found in
	private List<Integer> positions = new ArrayList<Integer>();

	/**
	 * Create a parameterized token
	 *
	 * @param sqlType
	 * @param key
	 * @param mode
	 * @param position
	 * @throws IllegalArgumentException
	 */
	public SqlToken(String sqlType, String key, String mode, int position)
			throws IllegalArgumentException {
		try {
			jdbcType = Enum.valueOf(JdbcType.class, sqlType.toUpperCase());
		} catch (IllegalArgumentException e) {
			LOG.error("This is an invalid jdbcType type ["
					+ sqlType.toUpperCase() + "]");
			throw e;
		}
		// the key is used to id this token as a parameter field; i.e., a
		// key-value field, where the value is the value of the input param that
		// is bound to the statement. The value in key-value is not be confused
		// with the value of this token, which is the token's name.
		// TODO: clear this up - too confusing!!!
		this.key = key.toLowerCase();
		this.value = this.key;
		this.position = position;
		// mode is optional
		if (mode != null) {
			try {
				this.mode = Enum.valueOf(Mode.class, mode.toUpperCase());
			} catch (IllegalArgumentException e) {
				LOG.error("This mode type is not valid/allowed ["
						+ mode.toUpperCase() + "]");
				throw e;
			}
		}
	}

	/**
	 * Create a non-parameterized token.
	 *
	 * @param value
	 */
	public SqlToken(String value) {
		this.value = value;
	}

	/**
	 * Returns the position of this key-token in the SQL statement
	 *
	 * @return
	 */
	public int getPosition() {
		return this.position;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public boolean isKey() {
		return key != null;
	}

	public Mode getMode() {
		return this.mode;
	}

	public JdbcType getJdbcType() {
		return jdbcType;
	}

	public boolean isPkey() {
		return getJdbcType() == JdbcType.PKEY;
	}

	public boolean isRset() {
		return getJdbcType() == JdbcType.RSET;
	}

	public boolean isCursor() {
		return getJdbcType() == JdbcType.CURSOR;
	}

	public boolean isIn() {
		return getMode() == Mode.IN;
	}

	public boolean isInOut() {
		return getMode() == Mode.INOUT;
	}

	public boolean isOut() {
		return getMode() == Mode.OUT;
	}

	public List<Integer> getPositions() {
		return positions;
	}

	/**
	 * Returns a Java object for this field token. Its value is taken from the
	 * given String.
	 *
	 * @param value
	 * @return
	 */
	public Object getObjectValue(String value) throws NumberFormatException,
			IllegalArgumentException, MalformedURLException {

		if (!isKey()) {
			return null;
		}

		switch (getJdbcType()) {
		case NUMERIC:
		case DECIMAL:
			return new BigDecimal(value);
		case BIT:
		case BOOLEAN:
			if (value.trim().equalsIgnoreCase("true")
					|| value.trim().equalsIgnoreCase("false")) {
				return Boolean.valueOf(value);
			} else {
				LOG.error("this value is set to neither 'true' nor 'false' :"
						+ value);
				throw new NumberFormatException(
						"this value is set to neither 'true' nor 'false' :"
								+ value);
			}
		case TINYINT:
		case SMALLINT:
		case INTEGER:
			return Integer.valueOf(value);
		case BIGINT:
			return Long.valueOf(value);
		case REAL:
			return Float.valueOf(value);
		case FLOAT:
		case DOUBLE:
			return Double.valueOf(value);
		case DATE:
			return Date.valueOf(value);
		case TIME:
			return Time.valueOf(value);
		case TIMESTAMP:
			return Timestamp.valueOf(value);
		case DATALINK:
			return new URL(value);
		default:
			// if it is none of the above, then it is a String type
			return value;
		}
	}

	/**
	 * Used for sorting, in ascending order, a list of key tokens.
	 */
	public int compareTo(SqlToken token) {
		if (position == token.position) {
			return 0;
		} else if (position < token.position) {
			return -1;
		}
		return 1;
	}

	public String toString() {
		return "jdbcType=" + jdbcType + " key=" + key + " value=" + value
				+ " mode=" + mode + " pos=" + position;
	}

	public boolean isEqual(SqlToken token) {
		return (getKey().equals(token.getKey())
				&& getJdbcType() == token.getJdbcType() && getMode() == token
					.getMode()) ? true : false;
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <item android:title="Borrar"
        android:id="@+id/borrar_menu_item"
        android:icon="@android:drawable/ic_menu_delete"
        app:showAsAction="ifRoom" />
</menu>


text:
import jstz from 'jstz';
import Ember from 'ember';
import ComponentCalendar from 'ember-calendar/models/component-calendar';

export default Ember.Component.extend({
  classNameBindings: [':as-calendar'],
  tagName: 'section',

  dayEndingTime: '22:00',
  dayStartingTime: '8:00',
  defaultOccurrenceDuration: '1:00',
  defaultOccurrenceTitle: 'New event',
  defaultTimeZoneQuery: '',
  isEditing: true,
  model: null,
  occurrences: null,
  showHeader: true,
  showTimeZoneSearch: true,
  startingDate: null,
  startFromDate: null,
  timeSlotDuration: '00:30',
  timeSlotHeight: 20,
  timeZone: jstz.determine().name(),
  title: null,

  _initializeModel: Ember.on('init', function() {
    this.set('model', ComponentCalendar.create({ component: this }));
  }),

  actions: {
    changeTimeZone: function(timeZone) {
      this.set('timeZone', timeZone);
    },

    addOccurrence: function(time) {
      var occurrence = this.get('model').createOccurrence({
        startsAt: time.toDate()
      });

      this.attrs['onAddOccurrence'](occurrence.get('content'));
    },

    onNavigateWeek: function(index) {
      if (this.attrs['onNavigateWeek']) {
        this.attrs['onNavigateWeek'](index);
      }
    }
  }
});


text:
package com.google.android.exoplayer.upstream;

import com.google.android.exoplayer.util.Assertions;

import java.io.IOException;

/**
 * Allows {@link #open(DataSpec)} and {@link #read(byte[], int, int)} calls only if the specified
 * priority is the highest priority of any task. {@link NetworkLock.PriorityTooLowException} is
 * thrown when this condition does not hold.
 */
public class PriorityDataSource implements DataSource {

  private final DataSource upstream;
  private final int priority;

  /**
   * @param priority The priority of the source.
   * @param upstream The upstream {@link DataSource}.
   */
  public PriorityDataSource(int priority, DataSource upstream) {
    this.priority = priority;
    this.upstream = Assertions.checkNotNull(upstream);
  }

  @Override
  public long open(DataSpec dataSpec) throws IOException {
    NetworkLock.instance.proceedOrThrow(priority);
    return upstream.open(dataSpec);
  }

  @Override
  public int read(byte[] buffer, int offset, int max) throws IOException {
    NetworkLock.instance.proceedOrThrow(priority);
    return upstream.read(buffer, offset, max);
  }

  @Override
  public void close() throws IOException {
    upstream.close();
  }

}


text:
from django.conf.urls.defaults import patterns, url, include
from .views import IndexView, CreateView, DetailView, UpdateView

from .subnets.views import CreateView as AddSubnetView
from .subnets.views import UpdateView as EditSubnetView
from .ports.views import CreateView as AddPortView
from .ports.views import UpdateView as EditPortView

from .subnets import urls as subnet_urls
from .ports import urls as port_urls

NETWORKS = r'^(?P<network_id>[^/]+)/%s$'

urlpatterns = patterns('',
    url(r'^$', IndexView.as_view(), name='index'),
    url(r'^create/$', CreateView.as_view(), name='create'),
    url(NETWORKS % 'update', UpdateView.as_view(), name='update'),
    # for detail view
    url(NETWORKS % 'detail', DetailView.as_view(), name='detail'),
    url(NETWORKS % 'subnets/create', AddSubnetView.as_view(),
        name='addsubnet'),
    url(NETWORKS % 'ports/create', AddPortView.as_view(), name='addport'),
    url(r'^(?P<network_id>[^/]+)/subnets/(?P<subnet_id>[^/]+)/update$',
        EditSubnetView.as_view(), name='editsubnet'),
    url(r'^(?P<network_id>[^/]+)/ports/(?P<port_id>[^/]+)/update$',
        EditPortView.as_view(), name='editport'),

    url(r'^subnets/', include(subnet_urls, namespace='subnets')),
    url(r'^ports/', include(port_urls, namespace='ports')))


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

namespace GridDomain.Configuration.MessageRouting
{
    public class AggregateCommandsHandlerDescriptor<T> : IAggregateCommandsHandlerDescriptor
    {
        private readonly List<Type> _registrations = new List<Type>();
        public IReadOnlyCollection<Type> RegisteredCommands => _registrations;
        public Type AggregateType => typeof(T);

        public void RegisterCommand<TCommand>()
        {
            RegisterCommand(typeof(TCommand));
        }

        public void RegisterCommand(Type type)
        {
            _registrations.Add(type);
        }
    }
}


text:
<?php

class Responses extends MyBiotrackingActiveRecord
{
	private $compatibilityMode;
	// public $USER_ENTERED;
	// public $RESPONSE_ID;
	// public $SEQ_NUM;
	// public $FORM_ID;
	// public $MATERIAL_ID;
	// public $VALUE;
	// public $QUESTION_ID;
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return ParcelDetails the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	public function getDbConnection()
    {
        return self::getBiotrackingDbConnection();
    }

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'RESPONSES';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('USER_ENTERED, RESPONSE_ID, SEQ_NUM, FORM_ID, MATERIAL_ID, QUESTION_ID','required')
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

        public function insertResults($userID, array $fields, array $attributes)
        {
            foreach($fields as $value => $questionID)
            {
                $responses=new Responses ();
                $responses->USER_ENTERED= $userID;
                $responses->ENTERED_DATE= new CDbExpression("SYSDATE");
                $responses->RESPONSE_ID=new CDbExpression("RESPONSES_SEQ.nextval");
                $responses->SEQ_NUM=0;
                $responses->FORM_ID=$attributes['formID'];
                $responses->MATERIAL_ID=$attributes['sampleID'];
                $newValue=trim($attributes["$value"]);
                $responses->VALUE= $this->convertToNumeric($newValue);
                $responses->QUESTION_ID=(int)$questionID;
                if (!$responses->save())
                {
                    ob_start();
                    print_r($responses->getErrors());
                    $errors = ob_get_contents();
                    ob_end_clean();
                    Yii::log($errors);
                    throw new Exception("AphinityLocalForm::save(): missing parameters");
                }

            }
        }

        public function updateResults($userID, array $fields, array $attributes,$compatibilityMode=array())
        {
            $this->compatibilityMode=$compatibilityMode;
            foreach($fields as $value => $questionID)
            {
                $response=Responses::model()->findByAttributes(array("MATERIAL_ID"=>(int)$attributes["sampleID"],"FORM_ID"=>(int)$attributes["formID"],"QUESTION_ID"=>(int)$questionID));
                if ($response != null)
                {
                    $newResponse= $this->transformNewValueToOldValue($questionID, $attributes["$value"]);
                    $newReponse=trim($newResponse);
                    if ($newResponse != $response->VALUE)
                    {
                        $response->VALUE= $this->convertToNumeric($newResponse);
                        $response->MODIFICATION_USER=$userID;
                        $response->MODIFICATION_DATE= new CDbExpression("SYSDATE");
                        if (!$response->save())
                            throw new Exception("AphinityLocalForm::save(): missing parameters");
                    }
                }
                else
                    throw new Exception ("AphinityLocalForm::update row to update not found");
            }
        }

        private function transformNewValueToOldValue ($questionID,$response)
        {
            if (count($this->compatibilityMode)>0)
            if (key_exists($questionID,$this->compatibilityMode ))
            {
                $values = $this->compatibilityMode[$questionID];
                if (key_exists($response,$values))
                {
                    $oldToNew = $values[$response];
                    return $oldToNew;
                }
            }
            return $response;
        }

        private function convertToNumeric($value)
        {
            if ((int) intval($value) !== 0 )
                return intval($value);
            else if ((int)floatval($value)!==0)
                return floatval($value);
            else
                return $value;
        }
}


text:
@interface eisoAppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@end


text: #include "SynchronousQueue.h"


text:
package ru.apetrov.storege;

import net.jcip.annotations.GuardedBy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ru.apetrov.ConnectionDB;
import ru.apetrov.Settings;
import ru.apetrov.model.User;

import java.sql.*;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Andrey on 15.02.2018.
 */
public class UserStore implements AutoCloseable {

    /**
     * logger.
     */
    private static final Logger log = LoggerFactory.getLogger(UserStore.class);

    /**
     * Storege by users.
     */
    @GuardedBy("this")
    private static UserStore instance;

    /**
     * database connection.
     */
    @GuardedBy("this")
    private Connection connection;

    /**
     * constructor.
     */
    private UserStore() {
    }

    /**
     * singleton instance UserStore.
     * @return UserStore.
     */
    public synchronized static UserStore getInstance() {
        if (instance == null) {
            instance = new UserStore();
            instance.initConnection();
        }
        return instance;
    }

    /**
     * initial database connection.
     */
    private synchronized void initConnection() {
        try {
            this.connection = new ConnectionDB().getConnection();
            Statement statement = this.connection.createStatement();
            statement.executeUpdate("CREATE TABLE IF NOT EXISTS users(login CHARACTER VARYING(30) UNIQUE PRIMARY KEY, user_name CHARACTER VARYING(50), email CHARACTER VARYING(50), create_date TIMESTAMP)");
        } catch (SQLException e) {
            log.error(e.getMessage(), e);
        }
    }

    /**
     * add User from datebase.
     * @param user user.
     */
    public synchronized void put(User user) {
        try (PreparedStatement statement = this.connection.prepareStatement("INSERT INTO users(login, user_name, email, create_date) VALUES(?, ?, ?, ?)")) {
            statement.setString(1, user.getLogin());
            statement.setString(2, user.getName());
            statement.setString(3, user.getEmail());
            statement.setTimestamp(4, user.getCreateDate());
            statement.execute();
        } catch (SQLException e) {
            log.error(e.getMessage(), e);
        }
    }

    /**
     * delete User from datebase.
     * @param login user.
     */
    public synchronized void delete(String login) {
        try (PreparedStatement statement = this.connection.prepareStatement("DELETE FROM users WHERE login = ?")) {
            statement.setString(1, login);
            statement.execute();
        } catch (SQLException e) {
            log.error(e.getMessage(), e);
        }
    }

    /**
     * update User from datebase.
     * @param user user.
     */
    public synchronized void update(User user) {
        try (PreparedStatement statement = this.connection.prepareStatement("UPDATE users SET user_name = ?, email = ?, create_date = ? WHERE login = ?")) {
            statement.setString(1, user.getName());
            statement.setString(2, user.getEmail());
            statement.setTimestamp(3, user.getCreateDate());
            statement.setString(4, user.getLogin());
            statement.execute();
        } catch (SQLException e) {
            log.error(e.getMessage(), e);
        }
    }

    /**
     * list all users from datebase.
     * @return list users.
     */
    public synchronized List<User> getAll() {
        List<User> result = new ArrayList<>();
        try (Statement statement = this.connection.createStatement()) {
            ResultSet resultSet = statement.executeQuery("SELECT * FROM users");
            while (resultSet.next()) {
                User user = new User(resultSet.getString("login"), resultSet.getString("user_name"), resultSet.getString("email"), resultSet.getTimestamp("create_date"));
                result.add(user);
            }
        } catch (SQLException e) {
            log.error(e.getMessage(), e);
        }
        return result;
    }

    /**
     * close datebase connection.
     * @throws SQLException exeption.
     */
    @Override
    public synchronized void close() throws SQLException {
        this.connection.close();
    }
}


text:
package controller

import (
	"errors"
	"testing"

	"github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1"
	"github.com/kubernetes-incubator/service-catalog/test/fake"
	"k8s.io/apimachinery/pkg/runtime"

	"k8s.io/apimachinery/pkg/fields"
	"k8s.io/apimachinery/pkg/labels"
	clientgotesting "k8s.io/client-go/testing"
)

func TestReconcileClusterServiceClassRemovedFromCatalog(t *testing.T) {
	getRemovedServiceClass := func() *v1beta1.ClusterServiceClass {
		p := getTestClusterServiceClass()
		p.Status.RemovedFromBrokerCatalog = true
		return p
	}

	cases := []struct {
		name                    string
		serviceClass            *v1beta1.ClusterServiceClass
		instances               []v1beta1.ServiceInstance
		catalogClientPrepFunc   func(*fake.Clientset)
		shouldError             bool
		errText                 *string
		catalogActionsCheckFunc func(t *testing.T, name string, actions []clientgotesting.Action)
	}{
		{
			name:         "not removed from catalog",
			serviceClass: getTestClusterServiceClass(),
			shouldError:  false,
		},
		{
			name:         "removed from catalog, instances left",
			serviceClass: getRemovedServiceClass(),
			instances:    []v1beta1.ServiceInstance{*getTestServiceInstance()},
			shouldError:  false,
			catalogActionsCheckFunc: func(t *testing.T, name string, actions []clientgotesting.Action) {
				listRestrictions := clientgotesting.ListRestrictions{
					Labels: labels.Everything(),
					Fields: fields.OneTermEqualSelector("spec.clusterServiceClassRef.name", "SCGUID"),
				}

				expectNumberOfActions(t, name, actions, 1)
				assertList(t, actions[0], &v1beta1.ServiceInstance{}, listRestrictions)
			},
		},
		{
			name:         "removed from catalog, no instances left",
			serviceClass: getRemovedServiceClass(),
			instances:    nil,
			shouldError:  false,
			catalogActionsCheckFunc: func(t *testing.T, name string, actions []clientgotesting.Action) {
				listRestrictions := clientgotesting.ListRestrictions{
					Labels: labels.Everything(),
					Fields: fields.OneTermEqualSelector("spec.clusterServiceClassRef.name", "SCGUID"),
				}

				expectNumberOfActions(t, name, actions, 2)
				assertList(t, actions[0], &v1beta1.ServiceInstance{}, listRestrictions)
				assertDelete(t, actions[1], getRemovedServiceClass())
			},
		},
		{
			name: "removed from catalog, no instances left, delete fails", serviceClass: getRemovedServiceClass(),
			instances:   nil,
			shouldError: true,
			catalogClientPrepFunc: func(client *fake.Clientset) {
				client.AddReactor("delete", "clusterserviceclasses", func(action clientgotesting.Action) (bool, runtime.Object, error) {
					return true, nil, errors.New("oops")
				})
			},
			errText: strPtr("oops"),
			catalogActionsCheckFunc: func(t *testing.T, name string, actions []clientgotesting.Action) {
				listRestrictions := clientgotesting.ListRestrictions{
					Labels: labels.Everything(),
					Fields: fields.OneTermEqualSelector("spec.clusterServiceClassRef.name", "SCGUID"),
				}

				expectNumberOfActions(t, name, actions, 2)
				assertList(t, actions[0], &v1beta1.ServiceInstance{}, listRestrictions)
				assertDelete(t, actions[1], getRemovedServiceClass())
			},
		},
	}

	for _, tc := range cases {
		_, fakeCatalogClient, _, testController, _ := newTestController(t, noFakeActions())

		fakeCatalogClient.AddReactor("list", "serviceinstances", func(action clientgotesting.Action) (bool, runtime.Object, error) {
			return true, &v1beta1.ServiceInstanceList{Items: tc.instances}, nil
		})

		if tc.catalogClientPrepFunc != nil {
			tc.catalogClientPrepFunc(fakeCatalogClient)
		}

		err := testController.reconcileClusterServiceClass(tc.serviceClass)
		if err != nil {
			if !tc.shouldError {
				t.Errorf("%v: unexpected error from method under test: %v", tc.name, err)
				continue
			} else if tc.errText != nil && *tc.errText != err.Error() {
				t.Errorf("%v: unexpected error text from method under test; expected %v, got %v", tc.name, tc.errText, err.Error())
				continue
			}
		}

		actions := fakeCatalogClient.Actions()

		if tc.catalogActionsCheckFunc != nil {
			tc.catalogActionsCheckFunc(t, tc.name, actions)
		} else {
			expectNumberOfActions(t, tc.name, actions, 0)
		}
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;

namespace PlaceSystem.CustomAttributes
{
    public class MinValueAttribute : ValidationAttribute
    {
        private readonly int minValue;

        public MinValueAttribute(int minValue)
        {
            this.minValue = minValue;
        }

        public override bool IsValid(object value)
        {
            return (int)value >= minValue;
        }
    }
}


text:
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding model 'Availability'
        db.create_table(u'stepup_availability', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('morning', self.gf('django.db.models.fields.BooleanField')()),
            ('afternoon', self.gf('django.db.models.fields.BooleanField')()),
            ('evening', self.gf('django.db.models.fields.BooleanField')()),
            ('night', self.gf('django.db.models.fields.BooleanField')()),
        ))
        db.send_create_signal(u'stepup', ['Availability'])

        # Adding M2M table for field people on 'Tag'
        m2m_table_name = db.shorten_name(u'stepup_tag_people')
        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('tag', models.ForeignKey(orm[u'stepup.tag'], null=False)),
            ('person', models.ForeignKey(orm[u'stepup.person'], null=False))
        ))
        db.create_unique(m2m_table_name, ['tag_id', 'person_id'])

        # Adding M2M table for field opportunities on 'Tag'
        m2m_table_name = db.shorten_name(u'stepup_tag_opportunities')
        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('tag', models.ForeignKey(orm[u'stepup.tag'], null=False)),
            ('opportunity', models.ForeignKey(orm[u'stepup.opportunity'], null=False))
        ))
        db.create_unique(m2m_table_name, ['tag_id', 'opportunity_id'])

        # Deleting field 'Organization.members'
        db.delete_column(u'stepup_organization', 'members_id')

        # Deleting field 'Organization.opportunities'
        db.delete_column(u'stepup_organization', 'opportunities_id')

        # Adding M2M table for field people on 'Organization'
        m2m_table_name = db.shorten_name(u'stepup_organization_people')
        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('organization', models.ForeignKey(orm[u'stepup.organization'], null=False)),
            ('person', models.ForeignKey(orm[u'stepup.person'], null=False))
        ))
        db.create_unique(m2m_table_name, ['organization_id', 'person_id'])

        # Adding M2M table for field opportunities on 'Organization'
        m2m_table_name = db.shorten_name(u'stepup_organization_opportunities')
        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('organization', models.ForeignKey(orm[u'stepup.organization'], null=False)),
            ('opportunity', models.ForeignKey(orm[u'stepup.opportunity'], null=False))
        ))
        db.create_unique(m2m_table_name, ['organization_id', 'opportunity_id'])

        # Adding field 'Opportunity.city'
        db.add_column(u'stepup_opportunity', 'city',
                      self.gf('django.db.models.fields.CharField')(default=None, max_length=50),
                      keep_default=False)

        # Adding field 'Opportunity.state'
        db.add_column(u'stepup_opportunity', 'state',
                      self.gf('django.db.models.fields.CharField')(default=None, max_length=50),
                      keep_default=False)

        # Adding field 'Opportunity.country'
        db.add_column(u'stepup_opportunity', 'country',
                      self.gf('django.db.models.fields.CharField')(default=None, max_length=50),
                      keep_default=False)

        # Adding field 'Opportunity.date_created'
        db.add_column(u'stepup_opportunity', 'date_created',
                      self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, default=None),
                      keep_default=False)

        # Adding M2M table for field tags on 'Opportunity'
        m2m_table_name = db.shorten_name(u'stepup_opportunity_tags')
        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('opportunity', models.ForeignKey(orm[u'stepup.opportunity'], null=False)),
            ('tag', models.ForeignKey(orm[u'stepup.tag'], null=False))
        ))
        db.create_unique(m2m_table_name, ['opportunity_id', 'tag_id'])

        # Adding M2M table for field organizations on 'Opportunity'
        m2m_table_name = db.shorten_name(u'stepup_opportunity_organizations')
        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('opportunity', models.ForeignKey(orm[u'stepup.opportunity'], null=False)),
            ('organization', models.ForeignKey(orm[u'stepup.organization'], null=False))
        ))
        db.create_unique(m2m_table_name, ['opportunity_id', 'organization_id'])

        # Deleting field 'Person.schedule'
        db.delete_column(u'stepup_person', 'schedule')

        # Deleting field 'Person.tags'
        db.delete_column(u'stepup_person', 'tags_id')

        # Adding M2M table for field sunday on 'Person'
        m2m_table_name = db.shorten_name(u'stepup_person_sunday')
        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('person', models.ForeignKey(orm[u'stepup.person'], null=False)),
            ('availability', models.ForeignKey(orm[u'stepup.availability'], null=False))
        ))
        db.create_unique(m2m_table_name, ['person_id', 'availability_id'])

        # Adding M2M table for field tags on 'Person'
        m2m_table_name = db.shorten_name(u'stepup_person_tags')
        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('person', models.ForeignKey(orm[u'stepup.person'], null=False)),
            ('tag', models.ForeignKey(orm[u'stepup.tag'], null=False))
        ))
        db.create_unique(m2m_table_name, ['person_id', 'tag_id'])

        # Adding M2M table for field organizations on 'Person'
        m2m_table_name = db.shorten_name(u'stepup_person_organizations')
        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('person', models.ForeignKey(orm[u'stepup.person'], null=False)),
            ('organization', models.ForeignKey(orm[u'stepup.organization'], null=False))
        ))
        db.create_unique(m2m_table_name, ['person_id', 'organization_id'])

    def backwards(self, orm):
        # Deleting model 'Availability'
        db.delete_table(u'stepup_availability')

        # Removing M2M table for field people on 'Tag'
        db.delete_table(db.shorten_name(u'stepup_tag_people'))

        # Removing M2M table for field opportunities on 'Tag'
        db.delete_table(db.shorten_name(u'stepup_tag_opportunities'))

        # Adding field 'Organization.members'
        db.add_column(u'stepup_organization', 'members',
                      self.gf('django.db.models.fields.related.ForeignKey')(default=None, to=orm['stepup.Person']),
                      keep_default=False)

        # Adding field 'Organization.opportunities'
        db.add_column(u'stepup_organization', 'opportunities',
                      self.gf('django.db.models.fields.related.ForeignKey')(default=None, to=orm['stepup.Opportunity']),
                      keep_default=False)

        # Removing M2M table for field people on 'Organization'
        db.delete_table(db.shorten_name(u'stepup_organization_people'))

        # Removing M2M table for field opportunities on 'Organization'
        db.delete_table(db.shorten_name(u'stepup_organization_opportunities'))

        # Deleting field 'Opportunity.city'
        db.delete_column(u'stepup_opportunity', 'city')

        # Deleting field 'Opportunity.state'
        db.delete_column(u'stepup_opportunity', 'state')

        # Deleting field 'Opportunity.country'
        db.delete_column(u'stepup_opportunity', 'country')

        # Deleting field 'Opportunity.date_created'
        db.delete_column(u'stepup_opportunity', 'date_created')

        # Removing M2M table for field tags on 'Opportunity'
        db.delete_table(db.shorten_name(u'stepup_opportunity_tags'))

        # Removing M2M table for field organizations on 'Opportunity'
        db.delete_table(db.shorten_name(u'stepup_opportunity_organizations'))

        # Adding field 'Person.schedule'
        db.add_column(u'stepup_person', 'schedule',
                      self.gf('django.db.models.fields.DateField')(default=None),
                      keep_default=False)

        # Adding field 'Person.tags'
        db.add_column(u'stepup_person', 'tags',
                      self.gf('django.db.models.fields.related.ForeignKey')(default=None, to=orm['stepup.Tag']),
                      keep_default=False)

        # Removing M2M table for field sunday on 'Person'
        db.delete_table(db.shorten_name(u'stepup_person_sunday'))

        # Removing M2M table for field tags on 'Person'
        db.delete_table(db.shorten_name(u'stepup_person_tags'))

        # Removing M2M table for field organizations on 'Person'
        db.delete_table(db.shorten_name(u'stepup_person_organizations'))

    models = {
        u'stepup.availability': {
            'Meta': {'object_name': 'Availability'},
            'afternoon': ('django.db.models.fields.BooleanField', [], {}),
            'evening': ('django.db.models.fields.BooleanField', [], {}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'morning': ('django.db.models.fields.BooleanField', [], {}),
            'night': ('django.db.models.fields.BooleanField', [], {})
        },
        u'stepup.opportunity': {
            'Meta': {'object_name': 'Opportunity'},
            'city': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'country': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True'}),
            'description': ('django.db.models.fields.TextField', [], {}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
            'organizations': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['stepup.Organization']", 'symmetrical': 'False', 'blank': 'True'}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}),
            'state': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['stepup.Tag']", 'symmetrical': 'False', 'blank': 'True'})
        },
        u'stepup.organization': {
            'Meta': {'object_name': 'Organization'},
            'city': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'country': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'description': ('django.db.models.fields.TextField', [], {}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
            'opportunities': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['stepup.Opportunity']", 'symmetrical': 'False', 'blank': 'True'}),
            'people': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['stepup.Person']", 'symmetrical': 'False', 'blank': 'True'}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}),
            'state': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        u'stepup.person': {
            'Meta': {'object_name': 'Person'},
            'city': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'country': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'description': ('django.db.models.fields.TextField', [], {}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
            'organizations': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['stepup.Organization']", 'symmetrical': 'False', 'blank': 'True'}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}),
            'state': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'sunday': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['stepup.Availability']", 'symmetrical': 'False'}),
            'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['stepup.Tag']", 'symmetrical': 'False', 'blank': 'True'})
        },
        u'stepup.tag': {
            'Meta': {'object_name': 'Tag'},
            'description': ('django.db.models.fields.TextField', [], {}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
            'opportunities': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['stepup.Opportunity']", 'symmetrical': 'False', 'blank': 'True'}),
            'people': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['stepup.Person']", 'symmetrical': 'False', 'blank': 'True'})
        }
    }

    complete_apps = ['stepup']


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <title>Login Tecnologias Para la Web</title>
        <link rel="import" href="static/generalParticlesBackground.html">

Registro.

                        <form action="../registerServlet">

Ingresa tus datos para poder acceder a la plataforma y disfrutar de sus herramientas.

                                 <input type="text" class="form-control input-lg" placeholder="Nombre" name="name" required>

                                 <input type="email" class="form-control input-lg" placeholder="Email" name="email" required>

                                 <input type="password" class="form-control input-lg" placeholder="Password" name="password" required>

                                 <button class="btn btn-primary btn-lg btn-block" type="submit">Registrar</button>

                        </form>

        <link rel="import" href="static/generalParticlesBackgroundScript.html">


text:
namespace MLifter.Controls
{
    partial class CardStyleEdit
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CardStyleEdit));
            this.stylePreview = new MLifter.Components.MLifterWebBrowser();
            this.tabControlMain = new System.Windows.Forms.TabControl();
            this.tabPageQuestion = new System.Windows.Forms.TabPage();
            this.textStyleEditQuestion = new MLifter.Controls.TextStyleEdit();
            this.tabPageQuestionExample = new System.Windows.Forms.TabPage();
            this.textStyleEditQuestionExample = new MLifter.Controls.TextStyleEdit();
            this.tabPageAnswer = new System.Windows.Forms.TabPage();
            this.textStyleEditAnswer = new MLifter.Controls.TextStyleEdit();
            this.tabPageAnswerExample = new System.Windows.Forms.TabPage();
            this.textStyleEditAnswerExample = new MLifter.Controls.TextStyleEdit();
            this.tabPageCorrect = new System.Windows.Forms.TabPage();
            this.textStyleEditCorrect = new MLifter.Controls.TextStyleEdit();
            this.tabPageWrong = new System.Windows.Forms.TabPage();
            this.textStyleEditWrong = new MLifter.Controls.TextStyleEdit();
            this.tabControlMain.SuspendLayout();
            this.tabPageQuestion.SuspendLayout();
            this.tabPageQuestionExample.SuspendLayout();
            this.tabPageAnswer.SuspendLayout();
            this.tabPageAnswerExample.SuspendLayout();
            this.tabPageCorrect.SuspendLayout();
            this.tabPageWrong.SuspendLayout();
            this.SuspendLayout();
            //
            // stylePreview
            //
            resources.ApplyResources(this.stylePreview, "stylePreview");
            this.stylePreview.MinimumSize = new System.Drawing.Size(20, 20);
            this.stylePreview.Name = "stylePreview";
            this.stylePreview.Tag = "";
            //
            // tabControlMain
            //
            this.tabControlMain.Controls.Add(this.tabPageQuestion);
            this.tabControlMain.Controls.Add(this.tabPageQuestionExample);
            this.tabControlMain.Controls.Add(this.tabPageAnswer);
            this.tabControlMain.Controls.Add(this.tabPageAnswerExample);
            this.tabControlMain.Controls.Add(this.tabPageCorrect);
            this.tabControlMain.Controls.Add(this.tabPageWrong);
            resources.ApplyResources(this.tabControlMain, "tabControlMain");
            this.tabControlMain.Multiline = true;
            this.tabControlMain.Name = "tabControlMain";
            this.tabControlMain.SelectedIndex = 0;
            this.tabControlMain.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
            this.tabControlMain.SelectedIndexChanged += new System.EventHandler(this.tabControlMain_SelectedIndexChanged);
            //
            // tabPageQuestion
            //
            this.tabPageQuestion.Controls.Add(this.textStyleEditQuestion);
            resources.ApplyResources(this.tabPageQuestion, "tabPageQuestion");
            this.tabPageQuestion.Name = "tabPageQuestion";
            this.tabPageQuestion.UseVisualStyleBackColor = true;
            //
            // textStyleEditQuestion
            //
            resources.ApplyResources(this.textStyleEditQuestion, "textStyleEditQuestion");
            this.textStyleEditQuestion.Name = "textStyleEditQuestion";
            this.textStyleEditQuestion.Style = null;
            this.textStyleEditQuestion.Changed += new System.EventHandler(this.CardStyle_Changed);
            //
            // tabPageQuestionExample
            //
            this.tabPageQuestionExample.Controls.Add(this.textStyleEditQuestionExample);
            resources.ApplyResources(this.tabPageQuestionExample, "tabPageQuestionExample");
            this.tabPageQuestionExample.Name = "tabPageQuestionExample";
            this.tabPageQuestionExample.UseVisualStyleBackColor = true;
            //
            // textStyleEditQuestionExample
            //
            resources.ApplyResources(this.textStyleEditQuestionExample, "textStyleEditQuestionExample");
            this.textStyleEditQuestionExample.Name = "textStyleEditQuestionExample";
            this.textStyleEditQuestionExample.Style = null;
            this.textStyleEditQuestionExample.Changed += new System.EventHandler(this.CardStyle_Changed);
            //
            // tabPageAnswer
            //
            this.tabPageAnswer.Controls.Add(this.textStyleEditAnswer);
            resources.ApplyResources(this.tabPageAnswer, "tabPageAnswer");
            this.tabPageAnswer.Name = "tabPageAnswer";
            this.tabPageAnswer.UseVisualStyleBackColor = true;
            //
            // textStyleEditAnswer
            //
            resources.ApplyResources(this.textStyleEditAnswer, "textStyleEditAnswer");
            this.textStyleEditAnswer.Name = "textStyleEditAnswer";
            this.textStyleEditAnswer.Style = null;
            this.textStyleEditAnswer.Changed += new System.EventHandler(this.CardStyle_Changed);
            //
            // tabPageAnswerExample
            //
            this.tabPageAnswerExample.Controls.Add(this.textStyleEditAnswerExample);
            resources.ApplyResources(this.tabPageAnswerExample, "tabPageAnswerExample");
            this.tabPageAnswerExample.Name = "tabPageAnswerExample";
            this.tabPageAnswerExample.UseVisualStyleBackColor = true;
            //
            // textStyleEditAnswerExample
            //
            resources.ApplyResources(this.textStyleEditAnswerExample, "textStyleEditAnswerExample");
            this.textStyleEditAnswerExample.Name = "textStyleEditAnswerExample";
            this.textStyleEditAnswerExample.Style = null;
            this.textStyleEditAnswerExample.Changed += new System.EventHandler(this.CardStyle_Changed);
            //
            // tabPageCorrect
            //
            this.tabPageCorrect.Controls.Add(this.textStyleEditCorrect);
            resources.ApplyResources(this.tabPageCorrect, "tabPageCorrect");
            this.tabPageCorrect.Name = "tabPageCorrect";
            this.tabPageCorrect.UseVisualStyleBackColor = true;
            //
            // textStyleEditCorrect
            //
            resources.ApplyResources(this.textStyleEditCorrect, "textStyleEditCorrect");
            this.textStyleEditCorrect.Name = "textStyleEditCorrect";
            this.textStyleEditCorrect.Style = null;
            this.textStyleEditCorrect.Changed += new System.EventHandler(this.CardStyle_Changed);
            //
            // tabPageWrong
            //
            this.tabPageWrong.Controls.Add(this.textStyleEditWrong);
            resources.ApplyResources(this.tabPageWrong, "tabPageWrong");
            this.tabPageWrong.Name = "tabPageWrong";
            this.tabPageWrong.UseVisualStyleBackColor = true;
            //
            // textStyleEditWrong
            //
            resources.ApplyResources(this.textStyleEditWrong, "textStyleEditWrong");
            this.textStyleEditWrong.Name = "textStyleEditWrong";
            this.textStyleEditWrong.Style = null;
            this.textStyleEditWrong.Changed += new System.EventHandler(this.CardStyle_Changed);
            //
            // CardStyleEdit
            //
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
            this.Controls.Add(this.tabControlMain);
            this.Controls.Add(this.stylePreview);
            resources.ApplyResources(this, "$this");
            this.Name = "CardStyleEdit";
            this.Resize += new System.EventHandler(this.CardStyleEdit_Resize);
            this.tabControlMain.ResumeLayout(false);
            this.tabPageQuestion.ResumeLayout(false);
            this.tabPageQuestionExample.ResumeLayout(false);
            this.tabPageAnswer.ResumeLayout(false);
            this.tabPageAnswerExample.ResumeLayout(false);
            this.tabPageCorrect.ResumeLayout(false);
            this.tabPageWrong.ResumeLayout(false);
            this.ResumeLayout(false);

        }

        #endregion

        private MLifter.Components.MLifterWebBrowser stylePreview;
        private System.Windows.Forms.TabControl tabControlMain;
        private System.Windows.Forms.TabPage tabPageQuestion;
        private System.Windows.Forms.TabPage tabPageQuestionExample;
        private System.Windows.Forms.TabPage tabPageAnswer;
        private System.Windows.Forms.TabPage tabPageAnswerExample;
        private System.Windows.Forms.TabPage tabPageCorrect;
        private System.Windows.Forms.TabPage tabPageWrong;
        private TextStyleEdit textStyleEditQuestion;
        private TextStyleEdit textStyleEditQuestionExample;
        private TextStyleEdit textStyleEditAnswer;
        private TextStyleEdit textStyleEditAnswerExample;
        private TextStyleEdit textStyleEditCorrect;
        private TextStyleEdit textStyleEditWrong;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you 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.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.apache.maven.plugins.its.differentparentsite</groupId>
    <artifactId>root</artifactId>
    <version>1.0-SNAPSHOT</version>
	<relativePath>root/pom.xml</relativePath>
  </parent>

  <groupId>org.apache.maven.plugins.its.differentparentsite</groupId>
  <artifactId>main</artifactId>
  <packaging>pom</packaging>
  <name>main</name>
  <version>1.0-SNAPSHOT</version>

  <url>http://dummy.com/</url>

  <distributionManagement>
    <site>
      <id>website</id>
      <url>file://@project.build.directory@/it/top-parent-different-site/deploy/</url>
    </site>
  </distributionManagement>

  <modules>
    <module>module1</module>
  </modules>

</project>