text:
<?php

namespace bsadnu\googlecharts;

use Yii;
use yii\base\Widget;
use yii\helpers\Html;
use yii\helpers\Json;
use yii\web\View;
use bsadnu\googlecharts\GoogleJsApiAsset;

/**
 * Pie chart widget.
 * A pie chart is a divided into sectors, illustrating numerical proportion.
 * In a pie chart, the arc length of each sector (and consequently its central angle and area), is proportional to the quantity it represents.
 * While it is named for its resemblance to a pie which has been sliced, there are variations on the way it can be presented.
 *
 * @author Stanislav Bannikov <bsadnu@gmail.com>
 */
class PieChart extends Widget
{
    /**
     * @var string unique id of chart
     */
    public $id;

    /**
     * @var array table of data
     * Example:
     * [
     *     ['Major', 'Degrees'],
     *     ['Business', 256070],
     *     ['Education', 108034],
     *     ['Social Sciences & History', 127101],
     *     ['Health', 81863],
     *     ['Psychology', 74194]
     * ]
     */
    public $data = [];

    /**
     * @var array table of extra data necessary for inner circle chart types
     * Example:
     * [
     *     ['Major', 'Degrees'],
     *     ['Business', 358293],
     *     ['Education', 101265],
     *     ['Social Sciences & History', 172780],
     *     ['Health', 129634],
     *     ['Psychology', 97216]
     * ]
     */
    public $extraData = [];

    /**
     * @var array options
     * Example:
     * [
     *     'fontName' => 'Verdana',
     *     'height' => 300,
     *     'width' => 500,
     *     'chartArea' => [
     *         'left' => 50,
     *         'width' => '90%',
     *         'height' => '90%'
     *     ],
     *     'diff' => [
     *         'oldData' => [
     *             'inCenter' => false
     *         ]
     *     ]
     * ]
     */
    public $options = [];

    /**
     * Initializes the widget.
     */
    public function init()
    {
        parent::init();
        $view = Yii::$app->getView();
        $this->registerAssets();
        $view->registerJs($this->getJs(), View::POS_END);
    }

    /**
     * Renders the widget.
     */
    public function run()
    {
        $content = Html::tag('div', null, ['id'=> $this->id]);

        return $content;
    }

    /**
     * Registers necessary assets.
     */
    public function registerAssets()
    {
        $view = $this->getView();
        GoogleJsApiAsset::register($view);
    }

    /**
     * Return necessary javascript.
     */
    private function getJs()
    {
        $uniqueInt = mt_rand(1, 999999);

        $js = "
            google.load('visualization', '1', {packages:['corechart']});
            google.setOnLoadCallback(drawChart". $uniqueInt .");
        ";
        if (!empty($this->extraData)) {
            $js .= "
                function drawChart". $uniqueInt ."() {

                    var oldData". $uniqueInt ." = google.visualization.arrayToDataTable(". Json::encode($this->data) .");

                    var newData". $uniqueInt ." = google.visualization.arrayToDataTable(". Json::encode($this->extraData) .");

                    var options". $uniqueInt ." = ". Json::encode($this->options) .";

                    var pie". $uniqueInt ." = new google.visualization.PieChart($('#". $this->id ."')[0]);

                    var diffData". $uniqueInt ." = pie". $uniqueInt .".computeDiff(oldData". $uniqueInt .", newData". $uniqueInt .");

                    pie". $uniqueInt .".draw(diffData". $uniqueInt .", options". $uniqueInt .");
                }
            ";
        } else {
            $js .= "
                function drawChart". $uniqueInt ."() {

                    var data". $uniqueInt ." = google.visualization.arrayToDataTable(". Json::encode($this->data) .");

                    var options". $uniqueInt ." = ". Json::encode($this->options) .";

                    var pie". $uniqueInt ." = new google.visualization.PieChart($('#". $this->id ."')[0]);

                    pie". $uniqueInt .".draw(data". $uniqueInt .", options". $uniqueInt .");
                }
            ";
        }

        return $js;
    }
}


text:
export default JSON.parse(
  `[{
  "id": 94926,
  "note": "Et quia eum nobis ut hic autem enim. Qui ea a qui accusantium ducimus ut placeat modi. Esse quibusdam earum cupiditate optio et nulla voluptatem. Qui est deserunt doloremque qui eaque in. Rerum voluptatum dolor corrupti. Voluptatem occaecati laudantium ea enim similique.",
  "createTime": "2017-02-10T07:42:44.828Z",
  "color": 0
}, {
  "id": 51842,
  "note": "Possimus exercitationem qui ea quo repudiandae. Corporis magnam non soluta doloremque et sunt dolores sunt. Corrupti reiciendis sunt optio dolorem. Dignissimos quo adipisci veritatis et repellat. Omnis omnis dignissimos ipsum non iusto voluptates.",
  "createTime": "2017-04-08T03:17:31.999Z",
  "color": 0
}, {
  "id": 28180,
  "note": "Tempore est velit non eaque. Exercitationem fugiat rerum magni. Delectus reprehenderit est neque autem amet. Qui consequatur velit et reprehenderit soluta voluptates. Id reprehenderit dolorum omnis ipsa quae dolores.",
  "createTime": "2017-01-21T05:43:16.889Z",
  "color": 3
}, {
  "id": 29619,
  "note": "Officiis suscipit perferendis blanditiis aut aliquid quod et. Eius repellendus natus dicta saepe. In adipisci alias facilis nihil eligendi consequatur odit sequi. Quae quibusdam eos ut qui aut nisi beatae quaerat qui.",
  "createTime": "2017-01-08T23:36:05.692Z",
  "color": 4
}, {
  "id": 19600,
  "note": "Dolor quas est quae. Id temporibus sed. Illum quo amet est fuga laborum facilis. Aut nisi consequatur voluptatum et. Eum et necessitatibus quam corporis expedita quasi reiciendis quia vitae. Earum harum deserunt minus modi consequuntur perspiciatis labore officia quo.",
  "createTime": "2017-05-11T22:30:14.915Z",
  "color": 4
}]`,
);

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE indirector PUBLIC "urn:pubid:org.dita-community:doctype:dtd:indirector" "indirector.dtd">
<indirector id="none">
  <title>Indirector 03</title>
  <indirectorBody>
    <indirectElementRef keyref="topic-01/fig-01"/>
  </indirectorBody>
</indirector>


text:
var path = require('path');
var http = require('http');
var portchecker = require('portchecker');
var childProcess = require('child_process');

// ---

var vortex = require(path.join(__dirname, 'vortex.js'));

// ---

var LISTENING_PORT = 5656;
var IDLE_TIME = 1000 * 60 * 30;
var CHECK_TIME = 1000 * 60 * 1;

// ---

exports.launch = function (callback) {
	portchecker.isOpen(LISTENING_PORT, 'localhost', function (isOpen) {
		if (isOpen) {
			callback(null);
		} else {
			var child = childProcess.spawn(process.argv[0], [__filename], {detached: true});

			child.unref();

			setTimeout(function () {
				exports.launch(callback);
			}, 5000);
		}
	});
};

// ---

exports.poke = function (callback) {
	http
		.get('http://localhost:' + LISTENING_PORT, function (res) {
			return callback(null);
		})
		.on('error', function (error) {
			return callback(error);
		});
};

// ---

exports.main = function () {
	var lastPoke = new Date().getTime();

	process.on('exit', function () {
		vortex.down('docker', function (err) {
			// pass
		});
	});

	var server = http.createServer(function (req, res) {
		var lastPoke = new Date().getTime();

	    res.writeHead(200, {'Content-Type': 'text/plain'});
	    res.end('OK');
	})

	try {
		server.listen(LISTENING_PORT);
	} catch (e) {
		return process.exit(1);
	}

	setInterval(function () {
		var timeDelta = new Date().getTime() - lastPoke;

		if (timeDelta > IDLE_TIME) {
			vortex.down(function (err) {
				return process.exit(0);
			});
		} else {
			vortex.provider.status('docker', function (err, state, address) {
				if (err) {
					return process.exit(2);
				}

				if (state == 'stopped') {
					return process.exit(0);
				}
			});
		}
	}, CHECK_TIME);
};

// ---

if (require.main === module) {
	exports.main();
}


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

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/login_nome" />

        <EditText
            android:id="@+id/editText1"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:inputType="text"
            android:layout_weight="70" >

            <requestFocus />
        </EditText>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <TextView
            android:id="@+id/textView2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/login_senha" />

        <EditText
            android:id="@+id/editText2"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="70"
            android:inputType="textPassword" >

            <requestFocus />
        </EditText>
    </LinearLayout>

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="14dp"
        android:layout_marginTop="20dp"
        android:text="@string/login_salvar_btn" />

</LinearLayout>


text:
import Ember from 'ember';
import raf from '../utils/e3-raf';
const {get, set, computed, Evented} = Ember;
const RAF = raf();

export default Ember.Mixin.create(Evented, {
  /*
   The list of items that are currently being animated.
   */
  animationQueue: computed(function() {
    return Ember.A();
  }),

  /*
   An optional hook for before a series of animations occur
   */
  animationWillStart() {},

  /*
   An optional hook for after a series of animations occur
   */
  animationDidComplete() {},

  /*
   An optional hook to do something before a tick occurs.
   */
  tickWillRender(/*time*/) {},

  /*
   An optional hook to do something after a tick occurs.
   */
  tickDidRender(/*time*/) {},

  /*
   A flag that says wether there is an animation already running.
   */
  hasActiveQueue: false,

  /*
   Add a new animation to the queue.
   @param animatable is a function which returns true when it's done animating.
   */
  addToQueue(animatable) {
    get(this, 'animationQueue').push(animatable);

    // If we're not animating; start.
    if(!get(this, 'hasActiveQueue')) {
      this.trigger('animationWillStart');
      this._animate();
    }
  },

  /*
   Start an animation.
   */
  _animate() {
    var that = this;
    set(this, 'hasActiveQueue', true);
    RAF(function(newTime) {
      that._flushQueue(newTime);
    });
  },

  /*
   Iterate through all the animation steps.
   */
  _flushQueue(time) {
    this.trigger('tickWillRender', time);

    var queue = get(this, 'animationQueue');

    // Iterate through the queue.
    for (var i = queue.length - 1; i >= 0; i--) {
      let done = queue[i](time);

      // If it's done, remove it from the queue.
      if(done) {
        queue.splice(i, 1);
      }
    }

    // Trigger the did render hook.
    this.trigger('tickDidRender', time);

    if(queue.length > 0) {
      // If there's still an active queue, animate again.
      this._animate();
    } else {
      // Otherwise, turn off animation.
      set(this, 'hasActiveQueue', false);
      this.trigger('animationDidComplete');
    }
  }
});


text:
BSLS_IDENT_RCSID(bdlat_selectioninfo_cpp,"$Id$ $CSID$")

#include <bsl_ostream.h>

namespace BloombergLP {

                         // --------------------------
                         // struct bdlat_SelectionInfo
                         // --------------------------

// FREE OPERATORS
bsl::ostream& operator<<(bsl::ostream&              stream,
                         const bdlat_SelectionInfo& selectionInfo)
{
    stream << "( " << selectionInfo.formattingMode()
           << ", " << selectionInfo.id()
           << ", ";

    const int nameLen = selectionInfo.nameLength();
    if (nameLen) {
        stream.write(selectionInfo.name(), nameLen);
    }
    else {
        stream << "<null-name>";
    }

    stream << ", " << nameLen
           << ", ";

    const char *annotation = selectionInfo.annotation();
    if (annotation) {
        stream << annotation;
    }
    else {
        stream << "<null-annotation>";
    }

    stream << " )";

    return stream;
}

}  // close enterprise namespace

// ----------------------------------------------------------------------------
// Copyright 2015 Bloomberg Finance L.P.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------- END-OF-FILE ----------------------------------


text:
package br.com.petshopplus.util.model;

import br.com.petshopplus.model.Funcionario;
import br.com.petshopplus.model.Login;

public class LoginBuilder {
	private final Login login = new Login();

	public LoginBuilder withUsuario(String usuario) {
		login.setUsuario(usuario);
		return this;
	}

	public LoginBuilder withSenha(String senha) {
		login.setSenha(senha);
		return this;
	}

	public LoginBuilder withFuncionario(Funcionario funcionario) {
		login.setFuncionario(funcionario);
		return this;
	}

	public Login build() {
		return login;
	}
}


text:
package com.wzc.criminalintent.database;

/**
 * Created by wzc on 2017/7/26.
 *
 */

public class CrimeDbSchema {
    public static final class CrimeTable {
        // 数据库表名
        public static final String NAME = "crimes";

        public static final class Cols {
            // 字段名
            public static final String UUID = "uuid";
            public static final String TITLE = "title";
            public static final String DATE = "date";
            public static final String SOLVED = "solved";
            public static final String SUSPECT = "suspect";
            public static final String SUSPECTID = "suspectid";

        }

    }
}


text:
$:.unshift File.dirname(__FILE__)

# std libs
require 'yaml'
require 'date'
require 'erb'
require 'time'

# 3rd party
require 'rack'
require 'digest'
require 'rdiscount'

# baron specific
require 'baron/page_controller'
require 'baron/blog_engine'
require 'baron/config'
require 'baron/models/article'
require 'baron/models/theme'

module Baron
  def self.env
    ENV['RACK_ENV'] || 'production'
  end

  def self.env= env
    ENV['RACK_ENV'] = env
  end

  class Server
    attr_reader :config, :site

    def initialize config = {}, &block
      @config = config.is_a?(Config) ? config : Config.new(config)
      @config.instance_eval(&block) if block_given?
      @blog_engine = Baron::BlogEngine.new(@config)
    end

    def call env
      @request = Rack::Request.new env
      return [400, {}, []] unless @request.get?

      @response = Rack::Response.new

      path, ext = @request.path_info.split('.')
      extension = ext.to_s.empty? ? '.html' : ".#{ext}"

      redirected_url, status = @blog_engine.process_redirects(@request.path_info)

      if status
        @response.status = status
        @response['Location'] = redirected_url
      else
        baron_response = @blog_engine.process_request(@request.path_info, env)
        @response.body = [baron_response[:body]]
        @response.status = baron_response[:status]
        @response['Content-Length'] = baron_response[:body].bytesize.to_s unless baron_response[:body].empty?
        @response['Content-Type'] = Rack::Mime.mime_type(extension)
        @response['Cache-Control'] = (Baron.env == 'production') ? "public, max-age=#{@config[:cache]}" : "no-cache, must-revalidate"
        @response['ETag'] = %("#{Digest::SHA1.hexdigest(baron_response[:body])}")
      end

      @response.finish
    end
  end
end


text:
ES5Harness.registerTest( {
id: "15.2.3.3-4-153",

path: "TestCases/chapter15/15.2/15.2.3/15.2.3.3/15.2.3.3-4-153.js",

description: "Object.getOwnPropertyDescriptor returns data desc for functions on built-ins (Date.prototype.toString)",

test: function testcase() {
  var desc = Object.getOwnPropertyDescriptor(Date.prototype, "toString");
  if (desc.value === Date.prototype.toString &&
      desc.writable === true &&
      desc.enumerable === false &&
      desc.configurable === true) {
    return true;
  }
 },

precondition: function prereq() {
  return fnExists(Object.getOwnPropertyDescriptor);
 }
});


text:
<system>
	<name>Gliese 221</name>
	<name>GJ 221</name>
	<name>BD-061339</name>
	<name>HIP 27803</name>
	<rightascension>05 53 00</rightascension>
	<declination>-05 59 41</declination>
	<distance errorminus="1" errorplus="1">20</distance>
	<star>
		<magB>11.041</magB>
		<magV>9.693</magV>
		<magR>8.855</magR>
		<magI>8.099</magI>
		<magJ errorminus="0.018" errorplus="0.018">7.128</magJ>
		<magH errorminus="0.059" errorplus="0.059">6.517</magH>
		<magK errorminus="0.018" errorplus="0.018">6.305</magK>
		<name>Gliese 221</name>
		<name>GJ 221</name>
		<name>BD-061339</name>
		<name>HIP 27803</name>
		<mass errorminus="0.032" errorplus="0.032">0.637</mass>
		<temperature errorminus="50" errorplus="50">4040</temperature>
		<metallicity errorminus="0.10" errorplus="0.10">-0.07</metallicity>
		<spectraltype>K7V</spectraltype>
		<age errorminus="2" errorplus="2">3</age>
		<planet>
			<name>Gliese 221 b</name>
			<name>GJ 221 b</name>
			<name>BD-061339 b</name>
			<name>HIP 27803 b</name>
			<list>Confirmed planets</list>
			<mass errorminus="0.0118" errorplus="0.0118">0.13</mass>
			<period errorminus="1.1" errorplus="1.1">125.06</period>
			<semimajoraxis errorminus="0.0039" errorplus="0.0039">0.448</semimajoraxis>
			<eccentricity upperlimit="0.24" />
			<periastron errorminus="44" errorplus="44">118</periastron>
			<longitude errorminus="17.5" errorplus="17.5">131</longitude>
			<description>The planets orbiting the K7 star GJ 221 were discovered using publicly available HARPS data. The dataset was complemented with high precision Doppler measurements from Magellan/PFS. The system hosts at least two planets, one hot Super-Earth and one sub-Saturn mass planet.</description>
			<discoverymethod>RV</discoverymethod>
			<lastupdate>13/05/13</lastupdate>
			<discoveryyear>2013</discoveryyear>
		</planet>
		<planet>
			<name>Gliese 221 c</name>
			<name>GJ 221 c</name>
			<name>BD-061339 c</name>
			<name>HIP 27803 c</name>
			<list>Confirmed planets</list>
			<mass errorminus="0.00541" errorplus="0.00541">0.0196</mass>
			<period errorminus="0.00066" errorplus="0.00066">3.8731</period>
			<semimajoraxis>0.044</semimajoraxis>
			<eccentricity upperlimit="0.48" />
			<periastron>94</periastron>
			<description>The planets orbiting the K7 star GJ 221 were discovered using publicly available HARPS data. The dataset was complemented with high precision Doppler measurements from Magellan/PFS. The system hosts at least two planets, one hot Super-Earth and one sub-Saturn mass planet.</description>
			<discoverymethod>RV</discoverymethod>
			<lastupdate>13/05/13</lastupdate>
			<discoveryyear>2013</discoveryyear>
		</planet>
	</star>
</system>


text:
package io.crate.sql.tree;

public class NaturalJoin extends JoinCriteria {

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        return (obj != null) && (getClass() == obj.getClass());
    }

    @Override
    public int hashCode() {
        return 0;
    }

    @Override
    public String toString() {
        return "NaturalJoin{}";
    }
}


text:
// +build !ignore_autogenerated

// Code generated by deepcopy-gen. DO NOT EDIT.

package v1alpha1

import (
	runtime "k8s.io/apimachinery/pkg/runtime"
)

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AttachDetachControllerConfiguration) DeepCopyInto(out *AttachDetachControllerConfiguration) {
	*out = *in
	out.ReconcilerSyncLoopPeriod = in.ReconcilerSyncLoopPeriod
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttachDetachControllerConfiguration.
func (in *AttachDetachControllerConfiguration) DeepCopy() *AttachDetachControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(AttachDetachControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CSRSigningControllerConfiguration) DeepCopyInto(out *CSRSigningControllerConfiguration) {
	*out = *in
	out.ClusterSigningDuration = in.ClusterSigningDuration
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CSRSigningControllerConfiguration.
func (in *CSRSigningControllerConfiguration) DeepCopy() *CSRSigningControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(CSRSigningControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CloudProviderConfiguration) DeepCopyInto(out *CloudProviderConfiguration) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudProviderConfiguration.
func (in *CloudProviderConfiguration) DeepCopy() *CloudProviderConfiguration {
	if in == nil {
		return nil
	}
	out := new(CloudProviderConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DaemonSetControllerConfiguration) DeepCopyInto(out *DaemonSetControllerConfiguration) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DaemonSetControllerConfiguration.
func (in *DaemonSetControllerConfiguration) DeepCopy() *DaemonSetControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(DaemonSetControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DeploymentControllerConfiguration) DeepCopyInto(out *DeploymentControllerConfiguration) {
	*out = *in
	out.DeploymentControllerSyncPeriod = in.DeploymentControllerSyncPeriod
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentControllerConfiguration.
func (in *DeploymentControllerConfiguration) DeepCopy() *DeploymentControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(DeploymentControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DeprecatedControllerConfiguration) DeepCopyInto(out *DeprecatedControllerConfiguration) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeprecatedControllerConfiguration.
func (in *DeprecatedControllerConfiguration) DeepCopy() *DeprecatedControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(DeprecatedControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EndpointControllerConfiguration) DeepCopyInto(out *EndpointControllerConfiguration) {
	*out = *in
	out.EndpointUpdatesBatchPeriod = in.EndpointUpdatesBatchPeriod
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointControllerConfiguration.
func (in *EndpointControllerConfiguration) DeepCopy() *EndpointControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(EndpointControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EndpointSliceControllerConfiguration) DeepCopyInto(out *EndpointSliceControllerConfiguration) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointSliceControllerConfiguration.
func (in *EndpointSliceControllerConfiguration) DeepCopy() *EndpointSliceControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(EndpointSliceControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GarbageCollectorControllerConfiguration) DeepCopyInto(out *GarbageCollectorControllerConfiguration) {
	*out = *in
	if in.EnableGarbageCollector != nil {
		in, out := &in.EnableGarbageCollector, &out.EnableGarbageCollector
		*out = new(bool)
		**out = **in
	}
	if in.GCIgnoredResources != nil {
		in, out := &in.GCIgnoredResources, &out.GCIgnoredResources
		*out = make([]GroupResource, len(*in))
		copy(*out, *in)
	}
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GarbageCollectorControllerConfiguration.
func (in *GarbageCollectorControllerConfiguration) DeepCopy() *GarbageCollectorControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(GarbageCollectorControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GenericControllerManagerConfiguration) DeepCopyInto(out *GenericControllerManagerConfiguration) {
	*out = *in
	out.MinResyncPeriod = in.MinResyncPeriod
	out.ClientConnection = in.ClientConnection
	out.ControllerStartInterval = in.ControllerStartInterval
	in.LeaderElection.DeepCopyInto(&out.LeaderElection)
	if in.Controllers != nil {
		in, out := &in.Controllers, &out.Controllers
		*out = make([]string, len(*in))
		copy(*out, *in)
	}
	out.Debugging = in.Debugging
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericControllerManagerConfiguration.
func (in *GenericControllerManagerConfiguration) DeepCopy() *GenericControllerManagerConfiguration {
	if in == nil {
		return nil
	}
	out := new(GenericControllerManagerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GroupResource) DeepCopyInto(out *GroupResource) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupResource.
func (in *GroupResource) DeepCopy() *GroupResource {
	if in == nil {
		return nil
	}
	out := new(GroupResource)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *HPAControllerConfiguration) DeepCopyInto(out *HPAControllerConfiguration) {
	*out = *in
	out.HorizontalPodAutoscalerSyncPeriod = in.HorizontalPodAutoscalerSyncPeriod
	out.HorizontalPodAutoscalerUpscaleForbiddenWindow = in.HorizontalPodAutoscalerUpscaleForbiddenWindow
	out.HorizontalPodAutoscalerDownscaleStabilizationWindow = in.HorizontalPodAutoscalerDownscaleStabilizationWindow
	out.HorizontalPodAutoscalerDownscaleForbiddenWindow = in.HorizontalPodAutoscalerDownscaleForbiddenWindow
	if in.HorizontalPodAutoscalerUseRESTClients != nil {
		in, out := &in.HorizontalPodAutoscalerUseRESTClients, &out.HorizontalPodAutoscalerUseRESTClients
		*out = new(bool)
		**out = **in
	}
	out.HorizontalPodAutoscalerCPUInitializationPeriod = in.HorizontalPodAutoscalerCPUInitializationPeriod
	out.HorizontalPodAutoscalerInitialReadinessDelay = in.HorizontalPodAutoscalerInitialReadinessDelay
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HPAControllerConfiguration.
func (in *HPAControllerConfiguration) DeepCopy() *HPAControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(HPAControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *JobControllerConfiguration) DeepCopyInto(out *JobControllerConfiguration) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobControllerConfiguration.
func (in *JobControllerConfiguration) DeepCopy() *JobControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(JobControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubeCloudSharedConfiguration) DeepCopyInto(out *KubeCloudSharedConfiguration) {
	*out = *in
	out.CloudProvider = in.CloudProvider
	out.RouteReconciliationPeriod = in.RouteReconciliationPeriod
	out.NodeMonitorPeriod = in.NodeMonitorPeriod
	if in.ConfigureCloudRoutes != nil {
		in, out := &in.ConfigureCloudRoutes, &out.ConfigureCloudRoutes
		*out = new(bool)
		**out = **in
	}
	out.NodeSyncPeriod = in.NodeSyncPeriod
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeCloudSharedConfiguration.
func (in *KubeCloudSharedConfiguration) DeepCopy() *KubeCloudSharedConfiguration {
	if in == nil {
		return nil
	}
	out := new(KubeCloudSharedConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubeControllerManagerConfiguration) DeepCopyInto(out *KubeControllerManagerConfiguration) {
	*out = *in
	out.TypeMeta = in.TypeMeta
	in.Generic.DeepCopyInto(&out.Generic)
	in.KubeCloudShared.DeepCopyInto(&out.KubeCloudShared)
	out.AttachDetachController = in.AttachDetachController
	out.CSRSigningController = in.CSRSigningController
	out.DaemonSetController = in.DaemonSetController
	out.DeploymentController = in.DeploymentController
	out.StatefulSetController = in.StatefulSetController
	out.DeprecatedController = in.DeprecatedController
	out.EndpointController = in.EndpointController
	out.EndpointSliceController = in.EndpointSliceController
	in.GarbageCollectorController.DeepCopyInto(&out.GarbageCollectorController)
	in.HPAController.DeepCopyInto(&out.HPAController)
	out.JobController = in.JobController
	out.NamespaceController = in.NamespaceController
	out.NodeIPAMController = in.NodeIPAMController
	in.NodeLifecycleController.DeepCopyInto(&out.NodeLifecycleController)
	in.PersistentVolumeBinderController.DeepCopyInto(&out.PersistentVolumeBinderController)
	out.PodGCController = in.PodGCController
	out.ReplicaSetController = in.ReplicaSetController
	out.ReplicationController = in.ReplicationController
	out.ResourceQuotaController = in.ResourceQuotaController
	out.SAController = in.SAController
	out.ServiceController = in.ServiceController
	out.TTLAfterFinishedController = in.TTLAfterFinishedController
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeControllerManagerConfiguration.
func (in *KubeControllerManagerConfiguration) DeepCopy() *KubeControllerManagerConfiguration {
	if in == nil {
		return nil
	}
	out := new(KubeControllerManagerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *KubeControllerManagerConfiguration) DeepCopyObject() runtime.Object {
	if c := in.DeepCopy(); c != nil {
		return c
	}
	return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NamespaceControllerConfiguration) DeepCopyInto(out *NamespaceControllerConfiguration) {
	*out = *in
	out.NamespaceSyncPeriod = in.NamespaceSyncPeriod
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceControllerConfiguration.
func (in *NamespaceControllerConfiguration) DeepCopy() *NamespaceControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(NamespaceControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NodeIPAMControllerConfiguration) DeepCopyInto(out *NodeIPAMControllerConfiguration) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeIPAMControllerConfiguration.
func (in *NodeIPAMControllerConfiguration) DeepCopy() *NodeIPAMControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(NodeIPAMControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NodeLifecycleControllerConfiguration) DeepCopyInto(out *NodeLifecycleControllerConfiguration) {
	*out = *in
	if in.EnableTaintManager != nil {
		in, out := &in.EnableTaintManager, &out.EnableTaintManager
		*out = new(bool)
		**out = **in
	}
	out.NodeStartupGracePeriod = in.NodeStartupGracePeriod
	out.NodeMonitorGracePeriod = in.NodeMonitorGracePeriod
	out.PodEvictionTimeout = in.PodEvictionTimeout
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeLifecycleControllerConfiguration.
func (in *NodeLifecycleControllerConfiguration) DeepCopy() *NodeLifecycleControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(NodeLifecycleControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PersistentVolumeBinderControllerConfiguration) DeepCopyInto(out *PersistentVolumeBinderControllerConfiguration) {
	*out = *in
	out.PVClaimBinderSyncPeriod = in.PVClaimBinderSyncPeriod
	in.VolumeConfiguration.DeepCopyInto(&out.VolumeConfiguration)
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PersistentVolumeBinderControllerConfiguration.
func (in *PersistentVolumeBinderControllerConfiguration) DeepCopy() *PersistentVolumeBinderControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(PersistentVolumeBinderControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PersistentVolumeRecyclerConfiguration) DeepCopyInto(out *PersistentVolumeRecyclerConfiguration) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PersistentVolumeRecyclerConfiguration.
func (in *PersistentVolumeRecyclerConfiguration) DeepCopy() *PersistentVolumeRecyclerConfiguration {
	if in == nil {
		return nil
	}
	out := new(PersistentVolumeRecyclerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodGCControllerConfiguration) DeepCopyInto(out *PodGCControllerConfiguration) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGCControllerConfiguration.
func (in *PodGCControllerConfiguration) DeepCopy() *PodGCControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(PodGCControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ReplicaSetControllerConfiguration) DeepCopyInto(out *ReplicaSetControllerConfiguration) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaSetControllerConfiguration.
func (in *ReplicaSetControllerConfiguration) DeepCopy() *ReplicaSetControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(ReplicaSetControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ReplicationControllerConfiguration) DeepCopyInto(out *ReplicationControllerConfiguration) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicationControllerConfiguration.
func (in *ReplicationControllerConfiguration) DeepCopy() *ReplicationControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(ReplicationControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceQuotaControllerConfiguration) DeepCopyInto(out *ResourceQuotaControllerConfiguration) {
	*out = *in
	out.ResourceQuotaSyncPeriod = in.ResourceQuotaSyncPeriod
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceQuotaControllerConfiguration.
func (in *ResourceQuotaControllerConfiguration) DeepCopy() *ResourceQuotaControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(ResourceQuotaControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SAControllerConfiguration) DeepCopyInto(out *SAControllerConfiguration) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SAControllerConfiguration.
func (in *SAControllerConfiguration) DeepCopy() *SAControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(SAControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ServiceControllerConfiguration) DeepCopyInto(out *ServiceControllerConfiguration) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceControllerConfiguration.
func (in *ServiceControllerConfiguration) DeepCopy() *ServiceControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(ServiceControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *StatefulSetControllerConfiguration) DeepCopyInto(out *StatefulSetControllerConfiguration) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatefulSetControllerConfiguration.
func (in *StatefulSetControllerConfiguration) DeepCopy() *StatefulSetControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(StatefulSetControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TTLAfterFinishedControllerConfiguration) DeepCopyInto(out *TTLAfterFinishedControllerConfiguration) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TTLAfterFinishedControllerConfiguration.
func (in *TTLAfterFinishedControllerConfiguration) DeepCopy() *TTLAfterFinishedControllerConfiguration {
	if in == nil {
		return nil
	}
	out := new(TTLAfterFinishedControllerConfiguration)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VolumeConfiguration) DeepCopyInto(out *VolumeConfiguration) {
	*out = *in
	if in.EnableHostPathProvisioning != nil {
		in, out := &in.EnableHostPathProvisioning, &out.EnableHostPathProvisioning
		*out = new(bool)
		**out = **in
	}
	if in.EnableDynamicProvisioning != nil {
		in, out := &in.EnableDynamicProvisioning, &out.EnableDynamicProvisioning
		*out = new(bool)
		**out = **in
	}
	out.PersistentVolumeRecyclerConfiguration = in.PersistentVolumeRecyclerConfiguration
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeConfiguration.
func (in *VolumeConfiguration) DeepCopy() *VolumeConfiguration {
	if in == nil {
		return nil
	}
	out := new(VolumeConfiguration)
	in.DeepCopyInto(out)
	return out
}


text:
Change Password

	<?php echo $this->session->flashdata('PWchange'); ?>

    <?php
    $user = 'placeholder="Username" autocomplete="off"';
    $pass = 'placeholder="Current Password", autocomplete="off"';
    $newpass = 'placeholder="New Password (Atleast 7 Characters)", autocomplete="off"';
    $newpass1 = 'placeholder="Confirm Password", autocomplete="off"';
    $code = 'placeholder="Secret Code", autocomplete="off"';
    $passs = 'placeholder="Current Password", autocomplete="off"';

    echo validation_errors('
');
    echo form_open('login_controller/changePW');
    echo form_input('username', set_value('username'), $user);
    echo form_password('currentpass', '', $passs);
    echo form_password('password', '', $newpass);
    echo form_password('passconf', '', $newpass1);
    echo form_password('code', '', $code);
    echo form_submit('submit', 'Change Password');
    echo anchor('login_controller/index', 'Return');
    ?>

	Special thanks to  Suny Orange Applied Technology Department and SunyOrange Financial Aid Office

	Application Created By Rixhers Ajazi. <?php echo anchor('email_controller/email_rix', 'Send Me An Email', 'target="_blank"') ?>


text:
/**********************************************************************************************
 * Programmer: Christian Webber
 * Class: CptS 122, Spring 2012; Lab Section 3
 * Standard Menu System
 * Created: September 28th, 2011
 * Last Revised: March 2nd, 2012
 * Description: This function set allows a menu to be generated and a valid answer
 *							to be selected and returned.
 *
 * File Changelog:
 *					March 2nd, 2012: Creation of C++ tokenizer, replacement of char[] with strings,
 *									printf with cout
 *					February 29th, 2012: Initial C++ conversion (in C++ file type, but nothing else).
 *					January 28th, 2012: Removed old menu system functions, cleaned up
 *									file, and finished new function.
 *					January 25th, 2012: Created new menu system function to replace
 *									old ones.
 *					November 30th, 2011: Cleanup of selector menu and standardization
 *									for both menu types.
 *					November 12th and 13th, 2011: Addition of a selector menu (uses arrow keys)
 *									as an alternate to the regular menu (letter/number input) and support
 *									functions.
 *					October 5th and 10th, 2011: Improvements to initial menu system for
 *									error checking.
 *					September 28th and 29th, 2011: Creation of initial menu system and support
 *									functions.
 *
 * File Description: "menu_system.h" contains the various includes and function
 *									prototypes which control the menu_system.c file functions.
 *********************************************************************************************/

#include "menu_system.h"

/*************************************************************
 * Function: display_menu ()
 * Date Created: January 25th, 2012
 * Date Last Modified: February 29th, 2012
 * Changelog:
 *					March 2nd, 2012: Creation of C++ tokenizer, replacement of char[] with strings,
 *									printf with cout
 *					February 29th, 2012: Initial C++ conversion (in C++ file type, but nothing else).
 *					January 28th, 2012: Finished creation of function.
 *					January 25th, 2012: Created function. Merged old menu display functions.
 * Description: This function displays a menu, determined by the passed information.
 * Input parameters:
 *							inputMode: 0 = number/char input (used with itemPre for numbers
 *												vs. letters), 1 = arrows, 2 = both.
 *							itemPreType: 0 = use nothing, 1 = use lowercase letters,
 *												2 = use uppercase letters
 *							itemPreChar: character to seperate the pre and the item.
 *							minItem: Lowest possible option.
 *							numItems: Number (start at 1) of items in the menu. Doubles as highest
 *												possible option.
 *							itemDelim: delim char(s) between menu items.
 *							menuTitle: A string containing the title of the program. No need for
 *												included new line.
 *							programTitle: A string containing the title of the menu. No need for
 *												included new line.
 *							menuItems: A string containing all menu items (printed as one,
 *												include new lines aside from last one). Max of 64
 *												items in a single menu.
 * Special Notes: Don't use non arrow input if there are more than 26 items.
 * Returns: Item selected as an int
 * Preconditions: Menu needs to be displayed for an option to be gotten
 * Postconditions: Returns the menu option selected.
 *************************************************************/
int display_menu (int inputMode, int itemPreType, char itemPreChar, int minItem, int numItems,
				  string itemDelim, string programTitle, string menuTitle, string menuItems)
{
	/////////////////////////////////////////
	////////// VARIABLES ///////////
	/////////////////////////////////////////
	int option = minItem, i = 0, j = 0, isSelected = 0, position = 0,
		inputCycle = 1, specialKey = 0, optionCheck = 0;
	string backupMenu, menu[64], subItem;
	char char_item = '\0';
	KeyInput keysSelected;

	//////////////////////////////////////////
	////////// BUILD MENU //////////
	//////////////////////////////////////////
	backupMenu = menuTitle;
	subItem = getToken (position, menuItems, itemDelim);
	menu[0] = subItem;
	for (i = 1; i < numItems; i++)
	{
		subItem = getToken (position, menuItems, itemDelim);
		menu[i] = subItem;
	}

	//////////////////////////////////////////
	////////// MENU LOGIC //////////
	//////////////////////////////////////////
	do
	{
		//// DISPLAY MENU ////
		// Display Program and Menu Titles
		cout << programTitle << endl;
		cout << menuTitle << endl << endl;
		// Display Items
		for (i = 1; i <= numItems; i++)
		{
			// Print selector icon
			// option is selected
			if (option == i)
			{
				cout<< "> ";
			}
			// option is not selected
			else
			{
				cout<< "  ";
			}

			// print number or characters if necessary
			if (inputMode == 0 || inputMode == 2)
			{
				// if nothing, print nothing
				if (itemPreType == 1 || itemPreType == 2)
				{
					j = i;
					while (j > 0)
					{
						char_item = char_reverse_convert (j, itemPreType - 2);
						cout << char_item;
						j -= 26;
					}
				}
				// print the char after the id but before the item
				cout << itemPreChar;
			}
			// print item string
			cout << menu[i - 1] << endl;
		}

		//// GET INPUT ////
		do
		{
			// sleep the program for a bit to help with input detection
			Sleep (200);
			// get input
			keysSelected = getKeySelected ();
			// check keys if one was pressed
			if (keysSelected.key != '\0')
			{
				// check if a special key was pressed
				if (keysSelected.key == '~')
				{
					specialKey = 1;
				}

				// if a special key was pressed
				if (specialKey == 1)
				{
					// check arrows if allowed
					if ((inputMode == 1) || (inputMode == 2))
					{
						// up and left
						if ((keysSelected.specialKey == 'W') || (keysSelected.specialKey == 'A'))
						{
							option--;
						}
						// down and right
						else if ((keysSelected.specialKey == 'S') || (keysSelected.specialKey == 'D'))
						{
							option++;
						}
					}
					// check enter
					if (keysSelected.specialKey == 'E')
					{
						isSelected = 1;
					}
				}
				// otherwise
				else
				{
					// check if allowed to do letter input
					if ((inputMode == 0) || (inputMode == 2))
					{
						// assign the key selected to a check variable and check if it is
						//			a valid option
						optionCheck = char_convert(keysSelected.key);
						if ((optionCheck >= minItem) && (optionCheck <= numItems))
						{
							// if it is, assign the option to the selected key
							option = optionCheck;
						}
					}
				}
				// end the input cycle
				inputCycle = 0;
			}
		} while (inputCycle);

		// OPTION VALIDITY CHECK
		if (option < minItem)
		{
			option = numItems;
		}
		else if (option > numItems)
		{
			option = minItem;
		}

		// RESET INPUT CYCLE
		inputCycle = 1;
		specialKey = 0;

		// CLEAR SCREEN
		system ("cls");
	} while (!isSelected);

	// return the option selected
	return option;
}

/*************************************************************
 * Function: getKeySelected ()
 * Date Created: September 28th, 2011
 * Date Last Modified: January 28th, 2012
 * Description: This function gets the current
 *						pressed key. Special input keys
 *						have priority over regular input keys..
 * Input parameters: N/A
 * Returns: A value for the key
 * Preconditions: A key input is needed
 * Postconditions: The key input is gotten
 *************************************************************/
KeyInput getKeySelected (void)
{
	int i = 0;
	KeyInput key = {'\0', '\0'};
	/* SPECIALKEY KEYCODES
	 * Key = ~
	 Special Key =
	 * Up Arrow: W
	 * Left Arrow: A
	 * Down Arrow: S
	 * Right Arrow: D
	 * Enter: E
	*/

	//// LETTERS
	for (i = 1; i <= 26; i++)
	{
		 if (GetAsyncKeyState ((char)(i + 64)))
		 {
			 key.key = (char)(i + 64);
		 }
	}

	//// SPECIAL KEYS
	// up arrow selected
	if (GetAsyncKeyState (VK_UP))
	{
		key.key = '~';
		key.specialKey = 'W';
	}
	// left arrow selected
	else if (GetAsyncKeyState (VK_LEFT))
	{
		key.key = '~';
		key.specialKey = 'A';
	}
	// right arrow selected

	else if (GetAsyncKeyState (VK_RIGHT))
	{
		key.key = '~';
		key.specialKey = 'D';
	}
	// down arrow selected
	else if (GetAsyncKeyState (VK_DOWN))
	{
		key.key = '~';
		key.specialKey = 'S';
	}
	// enter selected
	else if (GetAsyncKeyState (VK_RETURN) & 0x8000)
	{
		key.key = '~';
		key.specialKey = 'E';
	}

	// return key
	return key;
}

/*************************************************************
 * Function: char_convert ()
 * Date Created: September 28th, 2011
 * Date Last Modified: October 10th, 2011
 * Description: This function converts a char value to a
 *						int version of itself (adjusted so A = 0 and
 *						lower + uppercases have the same value).
 * Input parameters: value - the char value to adjust
 * Returns: The adjusted char value
 * Preconditions: A char value is needed to be adjusted.
 * Postconditions: The char value has been adjusted.
 *************************************************************/
int char_convert (char value)
{
	// assign the char value to a int version and reduce it's value by 64
	int int_value = (int)value - 64;
	// if the value is greater than 32, reduce it by 32
	if (int_value > 32)
	{
		int_value -= 32;
	}
	// return the value
	return int_value;
}

/*************************************************************
 * Function: char_reverse_convert ()
 * Date Created: November 12th, 2011
 * Date Last Modified: November 13th, 2011
 * Description: This function converts a passed char
 *						into a lower or upper-cased char.
 * Input parameters: value - the value to adjust.
 *								is_upper - Should it be uppercase?
 * Returns: The adjusted char value
 * Preconditions: A char value is needed to be adjusted.
 * Postconditions: The char value has been adjusted.
 *************************************************************/
char char_reverse_convert (int value, int is_upper)
{
	// create a temporary char variable
	char char_value = '\0';
	// add 64 to the passed value
	int int_value = value + 64;
	// if it is supposed to be lowercase, add another 32 to it
	if (!is_upper)
	{
		int_value += 32;
	}
	// convert it to a char and return it
	char_value = (char)int_value;
	return char_value;
}

/*************************************************************
 * Function: getToken ()
 * Date Created: March 2nd, 2012
 * Date Last Modified: March 2nd, 2012
 * Description: This function gets a token from a string.
 * Input parameters: the start position, the base string,
 *					and the deliminators.
 * Returns: The substring/token (and updates the start
 *					position)
 * Preconditions: Tokens are needed
 * Postconditions: Tokens are gotten
 *************************************************************/
string getToken (int &startPosition, string baseString, string delim)
{
	// get the length of the substring to pull out
	int length = baseString.find_first_of (delim, startPosition) - startPosition;
	// pull out the substring
	string subString = baseString.substr (startPosition, length);
	// update the start position for the search
	startPosition += length + 1;
	// return the substring
	return subString;
}


text:
describe BubbleWrap::Persistence do

  describe '.app_key' do

    it "caches the @app_key" do
      BubbleWrap::Persistence.instance_variable_get(:@app_key).should.equal nil
      BubbleWrap::Persistence.app_key
      BubbleWrap::Persistence.instance_variable_get(:@app_key).should.not.equal nil
    end

    it 'delegates to BubbleWrap::App.idenfitier' do
      BubbleWrap::Persistence.app_key.should == BubbleWrap::App.identifier
    end

  end

  describe "storing objects" do
    it 'can persist simple objects' do
      lambda do
        BubbleWrap::Persistence['arbitraryNumber'] = 42
      end.
        should.not.raise(Exception)
    end

    it "must call synchronize" do
      storage = NSUserDefaults.standardUserDefaults
      def storage.synchronize; @sync_was_called = true; end

      BubbleWrap::Persistence['arbitraryNumber'] = 42
      storage.instance_variable_get(:@sync_was_called).should.equal true
    end
  end

  describe "storing multiple objects" do
    it 'can persist multiple objects' do
      lambda do
        BubbleWrap::Persistence.merge({
          :anotherArbitraryNumber => 9001,
          :arbitraryString => 'test string'
        })
      end.
        should.not.raise(Exception)
    end

    it 'must call synchronize' do
      storage = NSUserDefaults.standardUserDefaults
      def storage.synchronize; @sync_was_called = true; end

      BubbleWrap::Persistence.merge({
        :anotherArbitraryNumber => 9001,
        :arbitraryString => 'test string'
      })
      storage.instance_variable_get(:@sync_was_called).should.equal true
    end
  end

  describe "retrieving objects" do
    it 'can retrieve persisted objects' do
      BubbleWrap::Persistence['arbitraryNumber'].should == 42
      BubbleWrap::Persistence[:arbitraryString].should == 'test string'
    end
  end
end


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">

<title>FtpMkdir</title>
<link rel="stylesheet" type="text/css" href="doc.css">

FtpMkdir

Create a directory on the remote system.

SYNOPSIS

#include <ftplib.h>
int FtpMkdir(const char *path, netbuf *nControl);

PARAMETERS

path

Specifies the argument to mkdir on the remote system.

nControl

A handle returned by FtpConnect().

DESCRIPTION

FtpMkdir() sends a make directory request to the remote
system.

RETURN VALUE

Returns 1 if successful or 0 on error.


text:
![alt tag](http://s23.postimg.org/qu1eqj6cb/app.png)

Installation:
========================
1. Configure database settings in app/config/parameters.yml;
2. Run the following command

        php app/console doctrine:schema:create

.


text:
<?xml version="1.0" encoding="utf-8" ?>
<RealSubjects xmlns="urn:Jolt.Testing.CodeGeneration.Xml">
  <Type name="System.String, mscorlib" />
  <Type name="System.IO.File, mscorlib" />
  <Type name="System.Text.Decoder, mscorlib" />
  <Assembly name="mscorlib" />
</RealSubjects>


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Fl. austral. 3:154. 1867

#### Original name
null

### Remarks
null


text:
//
//  NSURL+Query.h
//  NSURL+Query
//
//  Created by Jon Crooke on 10/12/2013.
//  Copyright (c) 2013 Jonathan Crooke. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSURL (BJCFURLQuery)

/**
 *  @return URL's query component as keys/values
 *  Returns nil for an empty query
 */
- (NSDictionary*) bjcf_queryDictionary;

/**
 *  @return URL with keys values appending to query string
 *  @param queryDictionary Query keys/values
 *  @param sortedKeys Sorted the keys alphabetically?
 *  @warning If keys overlap in receiver and query dictionary,
 *  behaviour is undefined.
 */
- (NSURL*) bjcf_URLByAppendingQueryDictionary:(NSDictionary*) queryDictionary
                             withSortedKeys:(BOOL) sortedKeys;

/** As above, but `sortedKeys=NO` */
- (NSURL*) bjcf_URLByAppendingQueryDictionary:(NSDictionary*) queryDictionary;

@end

#pragma mark -

@interface NSString (BJCFURLQuery)

/**
 *  @return If the receiver is a valid URL query component, returns
 *  components as key/value pairs. If couldn't split into *any* pairs,
 *  returns nil.
 */
- (NSDictionary*) bjcf_URLQueryDictionary;

@end

#pragma mark -

@interface NSDictionary (BJCFURLQuery)

/**
 *  @return URL query string component created from the keys and values in
 *  the dictionary. Returns nil for an empty dictionary.
 *  @param sortedKeys Sorted the keys alphabetically?
 *  @see cavetas from the main `NSURL` category as well.
 */
- (NSString*) bjcf_URLQueryStringWithSortedKeys:(BOOL) sortedKeys;

/** As above, but `sortedKeys=NO` */
- (NSString*) bjcf_URLQueryString;

@end


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<quiz>
<topic>The Question is "What is the Matrix?"</topic>
<question>
   <n>1</n>
    <q>What is Neo's full name in the matrix?</q>
    <options1>Jonathan C. Anderson</options1>
	<options2>Thomas A. Anderson</options2>
	<options3>Clayton H. Anderson</options3>
	<options4>Micheal F. Anderson</options4>
    <correct>2</correct>
</question>
<question>
    <n>2</n>
    <q>What is the name of the software company where Neo works?</q>
    <options1>Cybertech</options1>
	<options2>Torneo Incorporated</options2>
	<options3>Metacortex</options3>
	<options4>Medulaobla Technical</options4>
    <correct>3</correct>
</question>
<question>
    <n>3</n>
    <q>What is the first Martial Art that Neo learns during his upload training?</q>
    <options1>Kung Fu</options1>
	<options2>Jujistu</options2>
	<options3>Savate</options3>
	<options4>Kenpo Karate</options4>
    <correct>2</correct>
</question>
<question>
    <n>4</n>
    <q>What is the Latin Phrase above the doorway in the Oracle's kitchen?</q>
    <options1>Temet Nosce</options1>
	<options2>Habeas Corpus</options2>
	<options3>Anima Tua Libera Est</options3>
	<options4>Vitam Arti Impendere</options4>
    <correct>1</correct>
</question>
<question>
    <n>5</n>
    <q>What year was the Nebuchadnezzar comissioned?</q>
    <options1>2045</options1>
	<options2>2188</options2>
	<options3>2114</options3>
	<options4>2069</options4>
    <correct>4</correct>
</question>
<question>
    <n>6</n>
    <q>What is Cypher's real name inside the Matrix as refered by Agent Smith?</q>
    <options1>Mr. Phillips</options1>
	<options2>Mr. Reagan</options2>
	<options3>Mr. Thompson</options3>
	<options4>Mr. Jackson</options4>
    <correct>2</correct>
</question>
<question>
    <n>7</n>
    <q>What is is the loading program called to load weapons and other programs?</q>
    <options1>The Real</options1>
	<options2>The Platform</options2>
	<options3>The Construct</options3>
	<options4>The Processor</options4>
    <correct>3</correct>
</question>
<question>
    <n>8</n>
    <q>What are the three agents names?</q>
    <options1>Smith, Brown, and Jones</options1>
	<options2>Smith, Clark, and Hansen</options2>
	<options3>Smith, Lee, and Jackson</options3>
	<options4>Smith, Harris, and Ford</options4>
    <correct>1</correct>
</question>
<question>
    <n>9</n>
    <q>What kind of Battery does Morpheus compare humans too?</q>
    <options1>Energizer</options1>
	<options2>Eveready</options2>
	<options3>Duracell</options3>
	<options4>Maxell</options4>
    <correct>3</correct>
</question>
<question>
    <n>10</n>
    <q>Where does Morpheus take Neo to explain the Matrix which was formerly New York City?</q>
    <options1>The Dead Jungle</options1>
	<options2>The Tempest Tundra</options2>
	<options3>The Plateau of Vail</options3>
	<options4>The Desert of the Real</options4>
    <correct>4</correct>
</question>
</quiz>


text:
#include <aws/cloudfront/model/CustomErrorResponse.h>
#include <aws/core/utils/xml/XmlSerializer.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>

#include <utility>

using namespace Aws::CloudFront::Model;
using namespace Aws::Utils::Xml;
using namespace Aws::Utils;

CustomErrorResponse::CustomErrorResponse() :
    m_errorCode(0),
    m_errorCodeHasBeenSet(false),
    m_responsePagePathHasBeenSet(false),
    m_responseCodeHasBeenSet(false),
    m_errorCachingMinTTL(0),
    m_errorCachingMinTTLHasBeenSet(false)
{
}

CustomErrorResponse::CustomErrorResponse(const XmlNode& xmlNode) :
    m_errorCode(0),
    m_errorCodeHasBeenSet(false),
    m_responsePagePathHasBeenSet(false),
    m_responseCodeHasBeenSet(false),
    m_errorCachingMinTTL(0),
    m_errorCachingMinTTLHasBeenSet(false)
{
  *this = xmlNode;
}

CustomErrorResponse& CustomErrorResponse::operator =(const XmlNode& xmlNode)
{
  XmlNode resultNode = xmlNode;

  if(!resultNode.IsNull())
  {
    XmlNode errorCodeNode = resultNode.FirstChild("ErrorCode");
    if(errorCodeNode.IsNull())
    {
      errorCodeNode = resultNode;
    }

    if(!errorCodeNode.IsNull())
    {
      m_errorCode = StringUtils::ConvertToInt32(StringUtils::Trim(errorCodeNode.GetText().c_str()).c_str());
      m_errorCodeHasBeenSet = true;
    }
    XmlNode responsePagePathNode = resultNode.FirstChild("ResponsePagePath");
    if(responsePagePathNode.IsNull())
    {
      responsePagePathNode = resultNode;
    }

    if(!responsePagePathNode.IsNull())
    {
      m_responsePagePath = StringUtils::Trim(responsePagePathNode.GetText().c_str());
      m_responsePagePathHasBeenSet = true;
    }
    XmlNode responseCodeNode = resultNode.FirstChild("ResponseCode");
    if(responseCodeNode.IsNull())
    {
      responseCodeNode = resultNode;
    }

    if(!responseCodeNode.IsNull())
    {
      m_responseCode = StringUtils::Trim(responseCodeNode.GetText().c_str());
      m_responseCodeHasBeenSet = true;
    }
    XmlNode errorCachingMinTTLNode = resultNode.FirstChild("ErrorCachingMinTTL");
    if(errorCachingMinTTLNode.IsNull())
    {
      errorCachingMinTTLNode = resultNode;
    }

    if(!errorCachingMinTTLNode.IsNull())
    {
      m_errorCachingMinTTL = StringUtils::ConvertToInt64(StringUtils::Trim(errorCachingMinTTLNode.GetText().c_str()).c_str());
      m_errorCachingMinTTLHasBeenSet = true;
    }
  }

  return *this;
}

void CustomErrorResponse::AddToNode(XmlNode& parentNode) const
{
  Aws::StringStream ss;
  if(m_errorCodeHasBeenSet)
  {
   XmlNode errorCodeNode = parentNode.CreateChildElement("ErrorCode");
  ss << m_errorCode;
   errorCodeNode.SetText(ss.str());
  ss.str("");
  }

  if(m_responsePagePathHasBeenSet)
  {
   XmlNode responsePagePathNode = parentNode.CreateChildElement("ResponsePagePath");
   responsePagePathNode.SetText(m_responsePagePath);
  }

  if(m_responseCodeHasBeenSet)
  {
   XmlNode responseCodeNode = parentNode.CreateChildElement("ResponseCode");
   responseCodeNode.SetText(m_responseCode);
  }

  if(m_errorCachingMinTTLHasBeenSet)
  {
   XmlNode errorCachingMinTTLNode = parentNode.CreateChildElement("ErrorCachingMinTTL");
  ss << m_errorCachingMinTTL;
   errorCachingMinTTLNode.SetText(ss.str());
  ss.str("");
  }

}


text:
package helpers

import "github.com/gopherjs/gopherjs/js"

// GetWSBaseURL constructs the base URL for WebSocket calls
// Copied from
// https://github.com/gopherjs/websocket/blob/edfe1438a4184bea0b3f9e35fd77969061676d9c/test/test/index.go
func GetWSBaseURL() string {
	document := js.Global.Get("window").Get("document")
	location := document.Get("location")

	wsProtocol := "ws"
	if location.Get("protocol").String() == "https:" {
		wsProtocol = "wss"
	}

	return wsProtocol + "://" + location.Get("hostname").String() + ":" + location.Get("port").String()
}


text:
// Type definitions for webpack-clean 1.2
// Project: https://github.com/allexcd/webpack-clean#readme
// Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import { Plugin } from 'webpack';

declare namespace WebpackCleanPlugin {
    interface Options {
        /**
         * directory to be resolved to
         * @default null;
         */
        basePath?: string | null;
        /**
         * specify if the .map files should be automatically removed
         * @default false
         */
        removeMaps?: boolean;
        /**
         * specify if the files should be force deleted in case of compile errors.
         * If forceDelete is not enabled, the compile errors will be logged to stdout but the deletion of the files will not take place
         * @default false
         */
        forceDelete?: boolean;
    }
}

/**
 * A webpack plugin to clean specified files after build
 */
declare class WebpackCleanPlugin extends Plugin {
    /**
     * @param files  array of files or string for a single file relative to the basePath
     * or to the context of your config (if the basePath param is not specified)
     */
    constructor(files: string | string[], options?: WebpackCleanPlugin.Options);
}

/**
 *  A webpack plugin to clean specified files after build
 */
export = WebpackCleanPlugin;


text:
<package>
  <description brief="gps_common">

    GPS messages and common routines for use in GPS drivers

  </description>
  <author>Maintained by Ken Tossell</author>
  <license>BSD</license>
  <review status="unreviewed" notes=""/>
  <url>http://ros.org/wiki/gps_common</url>
  <export>
    <cpp cflags="-I${prefix}/include -I${prefix}/msg/cpp -I${prefix}/srv/cpp" lflags="-L${prefix}/lib -Wl,-rpath,${prefix}/lib"/>
  </export>

  <depend package="roscpp"/>
  <depend package="message_filters"/>
  <depend package="nav_msgs"/>
  <depend package="sensor_msgs"/>
</package>


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Lecanora sulphureorufa Nyl.

### Remarks
null


text:
package org.dasein.cloud.qingcloud.util.requester;

import org.dasein.cloud.qingcloud.model.ResponseModel;
import org.dasein.cloud.util.requester.DriverToCoreMapper;

/**
 * Created by Jeffrey Yan on 11/17/2015.
 *
 * @author Jeffrey Yan
 * @since 2016.02.1
 */
public abstract class QingCloudDriverToCoreMapper<T extends ResponseModel, V> implements DriverToCoreMapper<T, V> {
    @Override
    public V mapFrom(T responseModel) {
        if(responseModel.getRetCode() != 0) {
            throw new QingCloudResponseException(responseModel.getRetCode(), responseModel.getErrorMessage());
        }
        return doMapFrom(responseModel);
    }

    protected abstract V doMapFrom(T responseModel);
}


text:
const mongoose = require("mongoose");
const ProcessorItem = require("./ProcessorItem");
const TransactionAddress = require("./Transaction/Address");
const TransactionCustomer = require("./Transaction/Customer");
const TransactionStatus = require("./Statuses/TransactionStatus");
const TransactionDiscount = require("./Transaction/Discount");
const Descriptor = require("./Descriptor");
const CreditCard = require("./Transaction/CreditCard");
const PayPalAccount = require("./Transaction/PayPalAccount");
const ApplePayCard = require("./Transaction/ApplePayCard");
const AndroidPayCard = require("./Transaction/AndroidPayCard");

const Transaction = new mongoose.Schema({
    _id: String,
    processor: {
        type: ProcessorItem,
        default: ProcessorItem,
    },
    amount: Number,
    currency: String,
    subscriptionId: {
        type: String,
        default: null,
    },
    planProcessorId: {
        type: String,
        default: null,
    },
    refundedTransactionId: {
        type: String,
        default: null,
    },
    billing: TransactionAddress,
    discounts: [TransactionDiscount],
    descriptor: Descriptor,
    customer: TransactionCustomer,
    status: {
        type: String,
        enum: TransactionStatus.Statuses,
    },
    createdAt: Date,
    updatedAt: Date,
    statusHistory: [TransactionStatus],
});

Transaction.TransactionCreditCard = CreditCard;
Transaction.TransactionPayPalAccount = PayPalAccount;
Transaction.TransactionApplePayCard = ApplePayCard;
Transaction.TransactionAndroidPayCard = AndroidPayCard;

Transaction.TransactionAddress = TransactionAddress;
Transaction.TransactionCustomer = TransactionCustomer;
Transaction.TransactionDiscount = TransactionDiscount;

module.exports = Transaction;


text:
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/css-break-3/#varying-size-boxes">
<link rel="match" href="fragmented-autowidth-fc-root-beside-floats-ref.html">

There should be (from left to right) a hotpink square, a thin hotpink
  rectangle, then a wider hotpink rectangle.


text:
/ -(id) initWithAction:(UICollectionUpdateAction)updateAction forIndexPath:(id)indexPath;
/* annotate with type */ -(id) initWithInitialIndexPath:(id)initialIndexPath finalIndexPath:(id)finalIndexPath updateAction:(UICollectionUpdateAction)updateAction;
/* annotate with type */ -(id) indexPathBeforeUpdate;
/* annotate with type */ -(id) setIndexPathBeforeUpdate:(id)indexPath;
/* annotate with type */ -(id) indexPathAfterUpdate;
@end


text:
"""
Our abstract overlay class provides shared tools for our overlays
"""

from ConfigReader import ConfigReader
from enum import Enum
import platform
from tkinter import *
from tkinter.ttk import *

class DisplaySettings(Enum):
    overlay_on_bottom = -1
    overlay_as_draggable_window = 0
    only_appears_when_Tekken_7_has_focus = 1
    transparent_background = 2
    tiny_live_frame_data_numbers = 3

    def config_name():
        return "DisplaySettings"

class ColorSchemeEnum(Enum):
    background = 0
    transparent = 1
    p1_text = 2
    p2_text = 3
    system_text = 4
    advantage_plus = 5
    advantage_slight_minus = 6
    advantage_safe_minus = 7
    advantage_punishible = 8
    advantage_very_punishible = 9
    advantage_text = 10

class CurrentColorScheme:
    dict = {
        ColorSchemeEnum.background : 'gray10',
        ColorSchemeEnum.transparent: 'white',
        ColorSchemeEnum.p1_text: '#93A1A1',
        ColorSchemeEnum.p2_text: '#586E75',
        ColorSchemeEnum.system_text: 'lawn green',
        ColorSchemeEnum.advantage_plus: 'DodgerBlue2',
        ColorSchemeEnum.advantage_slight_minus: 'ivory2',
        ColorSchemeEnum.advantage_safe_minus: 'ivory2',
        ColorSchemeEnum.advantage_punishible: 'orchid2',
        ColorSchemeEnum.advantage_very_punishible: 'deep pink',
        ColorSchemeEnum.advantage_text: 'black',
    }

class Overlay:
    def __init__(self, master, xy_size, window_name):
        print("Launching {}".format(window_name))
        config_filename = "frame_data_overlay"
        self.tekken_config = ConfigReader(config_filename)
        is_windows_7 = 'Windows-7' in platform.platform()
        self.is_draggable_window = self.tekken_config.get_property(DisplaySettings.config_name(), DisplaySettings.overlay_as_draggable_window.name, False)
        self.is_minimize_on_lost_focus = self.tekken_config.get_property(DisplaySettings.config_name(), DisplaySettings.only_appears_when_Tekken_7_has_focus.name, True)
        self.is_transparency = self.tekken_config.get_property(DisplaySettings.config_name(), DisplaySettings.transparent_background.name, not is_windows_7)
        self.is_overlay_on_top = not self.tekken_config.get_property(DisplaySettings.config_name(), DisplaySettings.overlay_on_bottom.name, False)

        self.overlay_visible = False
        if master == None:
            self.toplevel = Tk()
        else:
            self.toplevel = Toplevel()

        self.toplevel.wm_title(window_name)

        self.toplevel.attributes("-topmost", True)

        self.background_color = CurrentColorScheme.dict[ColorSchemeEnum.background]

        if self.is_transparency:
            self.tranparency_color = CurrentColorScheme.dict[ColorSchemeEnum.transparent]
            self.toplevel.wm_attributes("-transparentcolor", self.tranparency_color)
            self.toplevel.attributes("-alpha", "0.75")
        else:
            if is_windows_7:
                print("Windows 7 detected. Disabling transparency.")
            self.tranparency_color = self.background_color
        self.toplevel.configure(background=self.tranparency_color)

        self.toplevel.iconbitmap('TekkenData/tekken_bot_close.ico')
        if not self.is_draggable_window:
            self.toplevel.overrideredirect(True)

        self.w = xy_size[0]
        self.h = xy_size[1]

        self.toplevel.geometry(str(self.w) + 'x' + str(self.h))

    def update_location(self):
        if not self.is_draggable_window:
            tekken_rect = self.launcher.gameState.gameReader.GetWindowRect()
            if tekken_rect != None:
                x = (tekken_rect.right + tekken_rect.left) / 2 - self.w / 2
                if self.is_overlay_on_top:
                    y = tekken_rect.top
                else:
                    y = tekken_rect.bottom - self.h - 10
                self.toplevel.geometry('%dx%d+%d+%d' % (self.w, self.h, x, y))
                if not self.overlay_visible:
                    self.show()
            else:
                if self.overlay_visible:
                    self.hide()

    def update_state(self):
        pass

    def hide(self):
        if self.is_minimize_on_lost_focus and not self.is_draggable_window:
            self.toplevel.withdraw()
            self.overlay_visible = False

    def show(self):
        self.toplevel.deiconify()
        self.overlay_visible = True

    def write_config_file(self):
        self.tekken_config.write()


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <android.support.v4.view.ViewPager
        android:id="@+id/viewPager"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <LinearLayout
        android:id="@+id/linearlayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:gravity="center"
        android:orientation="horizontal"
        android:padding="10dp" >
    </LinearLayout>

</RelativeLayout>


text:
#ifndef PARTICLE_3D_HH
#define PARTICLE_3D_HH

#include "core/globalDefs.h"
#include "finiteDifference/interpolations3D.h"
#include "particles/particle3D.h"
#include "particles/particleIdentifiers3D.h"
#include "multiGrid/multiGridUtil.h"
#include <cmath>

namespace plb {

/* *************** class Particle3D ***************************************** */

template<typename T, template<typename U> class Descriptor>
Particle3D<T,Descriptor>::Particle3D()
    : tag(0),
      position(T(),T(),T())
{ }

template<typename T, template<typename U> class Descriptor>
Particle3D<T,Descriptor>::Particle3D(plint tag_, Array<T,3> const& position_)
    : tag(tag_),
      position(position_)
{ }

template<typename T, template<typename U> class Descriptor>
void Particle3D<T,Descriptor>::reset(Array<T,3> const& position_)
{
    position = position_;
}

template<typename T, template<typename U> class Descriptor>
void Particle3D<T,Descriptor>::serialize(HierarchicSerializer& serializer) const
{
    serializer.addValue(tag);
    serializer.addValues<T,3>(position);
}

template<typename T, template<typename U> class Descriptor>
void Particle3D<T,Descriptor>::unserialize(HierarchicUnserializer& unserializer)
{
    unserializer.readValue(tag);
    unserializer.readValues<T,3>(position);
}

template<typename T, template<typename U> class Descriptor>
plint Particle3D<T,Descriptor>::getTag() const {
    return tag;
}

template<typename T, template<typename U> class Descriptor>
void Particle3D<T,Descriptor>::setTag(plint tag_) {
    tag = tag_;
}

template<typename T, template<typename U> class Descriptor>
bool Particle3D<T,Descriptor>::getVector(plint whichVector, Array<T,3>& vector) const {
    return false;
}

template<typename T, template<typename U> class Descriptor>
bool Particle3D<T,Descriptor>::setVector(plint whichVector, Array<T,3> const& vector) {
    return false;
}

template<typename T, template<typename U> class Descriptor>
bool Particle3D<T,Descriptor>::getScalar(plint whichScalar, T& scalar) const {
    return false;
}

template<typename T, template<typename U> class Descriptor>
bool Particle3D<T,Descriptor>::setScalar(plint whichScalar, T scalar) {
    return false;
}

template<typename T, template<typename U> class Descriptor>
bool Particle3D<T,Descriptor>::getTensor(plint whichVector, Array<T,SymmetricTensorImpl<T,3>::n>& tensor) const
{
    return false;
}

template<typename T, template<typename U> class Descriptor>
bool Particle3D<T,Descriptor>::setTensor(plint whichVector, Array<T,SymmetricTensorImpl<T,3>::n> const& tensor)
{
    return false;
}

template<typename T, template<typename U> class Descriptor>
bool Particle3D<T,Descriptor>::setScalars(std::vector<T> const& scalars)
{
    return false;
}

template<typename T, template<typename U> class Descriptor>
bool Particle3D<T,Descriptor>::setVectors(std::vector<Array<T,3> > const& vectors)
{
    return false;
}

template<typename T, template<typename U> class Descriptor>
bool Particle3D<T,Descriptor>::setTensors (
        std::vector<Array<T,SymmetricTensorImpl<T,3>::n> > const& tensors )
{
    return false;
}

template<typename T, template<typename U> class Descriptor>
void Particle3D<T,Descriptor>::rescale(int dxScale, int dtScale) {
    int dimDx = 1;
    int dimDt = 0;
    T scaleFactor = scaleFromReference(dxScale, dimDx, dtScale, dimDt);
    position *= scaleFactor;
}

/* *************** class PointParticle3D ************************************ */

template<typename T, template<typename U> class Descriptor>
int PointParticle3D<T,Descriptor>::id =
        meta::registerPointParticle3D<T,Descriptor,PointParticle3D<T,Descriptor> >("Point");

template<typename T, template<typename U> class Descriptor>
PointParticle3D<T,Descriptor>::PointParticle3D()
    : Particle3D<T,Descriptor>(),
      velocity(T(),T(),T())
{ }

template<typename T, template<typename U> class Descriptor>
PointParticle3D<T,Descriptor>::PointParticle3D(plint tag_, Array<T,3> const& position_, Array<T,3> const& velocity_)
    : Particle3D<T,Descriptor>(tag_, position_),
      velocity(velocity_)
{ }

template<typename T, template<typename U> class Descriptor>
int PointParticle3D<T,Descriptor>::getId() const {
    return id;
}

template<typename T, template<typename U> class Descriptor>
void PointParticle3D<T,Descriptor>::reset(Array<T,3> const& position_)
{
    Particle3D<T,Descriptor>::reset(position_);
    velocity.resetToZero();
}

template<typename T, template<typename U> class Descriptor>
void PointParticle3D<T,Descriptor>::velocityToParticle(TensorField3D<T,3>& velocityField, T scaling)
{
    velocity = predictorCorrectorTensorField<T,3>(velocityField, this->getPosition(), scaling);
}

template<typename T, template<typename U> class Descriptor>
void PointParticle3D<T,Descriptor>::velocityToParticle(NTensorField3D<T>& velocityField, T scaling)
{
    velocity = predictorCorrectorNTensorField<T>(velocityField, this->getPosition(), scaling);
}

template<typename T, template<typename U> class Descriptor>
void PointParticle3D<T,Descriptor>::rhoBarJtoParticle (
        NTensorField3D<T>& rhoBarJfield, bool velIsJ, T scaling )
{
    T rhoBar;
    Array<T,3> j;
    predictorCorrectorRhoBarJ(rhoBarJfield, this->getPosition(), velIsJ, j, rhoBar);
    if (velIsJ) {
        velocity = j*scaling;
    }
    else {
        velocity = j*scaling*Descriptor<T>::invRho(rhoBar);
    }
}

template<typename T, template<typename U> class Descriptor>
void PointParticle3D<T,Descriptor>::fluidToParticle(BlockLattice3D<T,Descriptor>& fluid, T scaling)
{
    static const T maxVel = 0.25-1.e-6;
    static const T maxVelSqr = maxVel*maxVel;
#ifdef PLB_DEBUG
    Box3D bbox(fluid.getBoundingBox());
#endif
    Dot3D loc(fluid.getLocation());
    Array<T,3> position1(this->getPosition()-Array<T,3>(loc.x,loc.y,loc.z));
    PLB_ASSERT( position1[0] >= bbox.x0+0.5 );
    PLB_ASSERT( position1[0] <= bbox.x1-0.5 );
    PLB_ASSERT( position1[1] >= bbox.y0+0.5 );
    PLB_ASSERT( position1[1] <= bbox.y1-0.5 );
    PLB_ASSERT( position1[2] >= bbox.z0+0.5 );
    PLB_ASSERT( position1[2] <= bbox.z1-0.5 );

    Dot3D intPos( (plint)position1[0], (plint)position1[1], (plint)position1[2] );
    T u = position1[0] - (T)intPos.x;
    T v = position1[1] - (T)intPos.y;
    T w = position1[2] - (T)intPos.z;

    Array<T,3> tmpVel;
    Array<T,3> velocity1; velocity1.resetToZero();
    fluid.get(intPos.x  ,intPos.y  ,intPos.z  ).computeVelocity(tmpVel);
    velocity1 += ((T)1.-u) * ((T)1.-v) * ((T)1.-w) *tmpVel;
    fluid.get(intPos.x  ,intPos.y  ,intPos.z+1).computeVelocity(tmpVel);
    velocity1 += ((T)1.-u) * ((T)1.-v) * (      w) *tmpVel;
    fluid.get(intPos.x  ,intPos.y+1,intPos.z  ).computeVelocity(tmpVel);
    velocity1 += ((T)1.-u) * (      v) * ((T)1.-w) *tmpVel;
    fluid.get(intPos.x  ,intPos.y+1,intPos.z+1).computeVelocity(tmpVel);
    velocity1 += ((T)1.-u) * (      v) * (      w) *tmpVel;
    fluid.get(intPos.x+1,intPos.y  ,intPos.z  ).computeVelocity(tmpVel);
    velocity1 += (      u) * ((T)1.-v) * ((T)1.-w) *tmpVel;
    fluid.get(intPos.x+1,intPos.y  ,intPos.z+1).computeVelocity(tmpVel);
    velocity1 += (      u) * ((T)1.-v) * (      w) *tmpVel;
    fluid.get(intPos.x+1,intPos.y+1,intPos.z  ).computeVelocity(tmpVel);
    velocity1 += (      u) * (      v) * ((T)1.-w) *tmpVel;
    fluid.get(intPos.x+1,intPos.y+1,intPos.z+1).computeVelocity(tmpVel);
    velocity1 += (      u) * (      v) * (      w) *tmpVel;

    velocity1 *= scaling;

    if (normSqr(velocity1)>maxVelSqr) {
        velocity1 /= norm(velocity1);
        velocity1 *= maxVel;
    }

    Array<T,3> position2(position1+velocity1);

    intPos = Dot3D( (plint)position2[0], (plint)position2[1], (plint)position2[2] );
    u = position2[0] - (T)intPos.x;
    v = position2[1] - (T)intPos.y;
    w = position2[2] - (T)intPos.z;

    Array<T,3> velocity2; velocity2.resetToZero();
    fluid.get(intPos.x  ,intPos.y  ,intPos.z  ).computeVelocity(tmpVel);
    velocity2 += ((T)1.-u) * ((T)1.-v) * ((T)1.-w) *tmpVel;
    fluid.get(intPos.x  ,intPos.y  ,intPos.z+1).computeVelocity(tmpVel);
    velocity2 += ((T)1.-u) * ((T)1.-v) * (      w) *tmpVel;
    fluid.get(intPos.x  ,intPos.y+1,intPos.z  ).computeVelocity(tmpVel);
    velocity2 += ((T)1.-u) * (      v) * ((T)1.-w) *tmpVel;
    fluid.get(intPos.x  ,intPos.y+1,intPos.z+1).computeVelocity(tmpVel);
    velocity2 += ((T)1.-u) * (      v) * (      w) *tmpVel;
    fluid.get(intPos.x+1,intPos.y  ,intPos.z  ).computeVelocity(tmpVel);
    velocity2 += (      u) * ((T)1.-v) * ((T)1.-w) *tmpVel;
    fluid.get(intPos.x+1,intPos.y  ,intPos.z+1).computeVelocity(tmpVel);
    velocity2 += (      u) * ((T)1.-v) * (      w) *tmpVel;
    fluid.get(intPos.x+1,intPos.y+1,intPos.z  ).computeVelocity(tmpVel);
    velocity2 += (      u) * (      v) * ((T)1.-w) *tmpVel;
    fluid.get(intPos.x+1,intPos.y+1,intPos.z+1).computeVelocity(tmpVel);
    velocity2 += (      u) * (      v) * (      w) *tmpVel;

    velocity2 *= scaling;

    if (normSqr(velocity2)>maxVelSqr) {
        velocity2 /= norm(velocity2);
        velocity2 *= maxVel;
    }

    velocity = (velocity1+velocity2)/(T)2;
}

template<typename T, template<typename U> class Descriptor>
void PointParticle3D<T,Descriptor>::advance() {
    PLB_ASSERT( norm(velocity)<1. );
    this->getPosition() += velocity;
}

template<typename T, template<typename U> class Descriptor>
void PointParticle3D<T,Descriptor>::serialize(HierarchicSerializer& serializer) const
{
    Particle3D<T,Descriptor>::serialize(serializer);
    serializer.addValues<T,3>(velocity);
}

template<typename T, template<typename U> class Descriptor>
void PointParticle3D<T,Descriptor>::unserialize(HierarchicUnserializer& unserializer)
{
    Particle3D<T,Descriptor>::unserialize(unserializer);
    unserializer.readValues<T,3>(velocity);
}

template<typename T, template<typename U> class Descriptor>
PointParticle3D<T,Descriptor>* PointParticle3D<T,Descriptor>::clone() const {
    return new PointParticle3D<T,Descriptor>(*this);
}

template<typename T, template<typename U> class Descriptor>
bool PointParticle3D<T,Descriptor>::getVector(plint whichVector, Array<T,3>& vector) const {
    if (whichVector==0) {
        vector = velocity;
        return true;
    }
    return Particle3D<T,Descriptor>::getVector(whichVector, vector);
}

template<typename T, template<typename U> class Descriptor>
bool PointParticle3D<T,Descriptor>::setVectors(std::vector<Array<T,3> > const& vectors)
{
    if (vectors.size()==1) {
        velocity = vectors[0];
        return true;
    }
    return false;
}

template<typename T, template<typename U> class Descriptor>
void PointParticle3D<T,Descriptor>::rescale(int dxScale, int dtScale) {
    Particle3D<T,Descriptor>::rescale(dxScale, dtScale);
    T dimDx = 1.;
    T dimDt = -1.;
    T scaleFactor = scaleFromReference(dxScale, dimDx, dtScale, dimDt);
    velocity *= scaleFactor;
}

/* *************** class NormedVelocityParticle3D ************************************ */

template<typename T, template<typename U> class Descriptor>
int NormedVelocityParticle3D<T,Descriptor>::id =
        meta::registerGenericParticle3D<T,Descriptor,NormedVelocityParticle3D<T,Descriptor> >("NormedVelocity");

template<typename T, template<typename U> class Descriptor>
NormedVelocityParticle3D<T,Descriptor>::NormedVelocityParticle3D()
    : PointParticle3D<T,Descriptor>(),
      fluidUmax(0.),
      particleUmax(0.),
      exponent(0.)
{ }

template<typename T, template<typename U> class Descriptor>
NormedVelocityParticle3D<T,Descriptor>::NormedVelocityParticle3D (
        plint tag_, Array<T,3> const& position_, Array<T,3> const& velocity_,
        T fluidUmax_, T particleUmax_, T exponent_ )
    : PointParticle3D<T,Descriptor>(tag_, position_, velocity_),
      fluidUmax(fluidUmax_), particleUmax(particleUmax_), exponent(exponent_)
{ }

template<typename T, template<typename U> class Descriptor>
void NormedVelocityParticle3D<T,Descriptor>::advance() {
    T fluidNormu = norm(this->getVelocity());
    PLB_ASSERT( fluidNormu<1. );
    T particleNormU;
    if (fluidNormu >= fluidUmax) {
        particleNormU = particleUmax;
    }
    else {
        particleNormU = std::pow(fluidNormu/fluidUmax, (T) exponent)*particleUmax;
    }
    PLB_ASSERT( particleNormU<1. );
    this->getPosition() += this->getVelocity()/fluidNormu*particleNormU;
}

template<typename T, template<typename U> class Descriptor>
void NormedVelocityParticle3D<T,Descriptor>::serialize(HierarchicSerializer& serializer) const
{
    PointParticle3D<T,Descriptor>::serialize(serializer);
    serializer.addValue(fluidUmax);
    serializer.addValue(particleUmax);
    serializer.addValue(exponent);
}

template<typename T, template<typename U> class Descriptor>
void NormedVelocityParticle3D<T,Descriptor>::unserialize(HierarchicUnserializer& unserializer)
{
    PointParticle3D<T,Descriptor>::unserialize(unserializer);
    unserializer.readValue(fluidUmax);
    unserializer.readValue(particleUmax);
    unserializer.readValue(exponent);
}

template<typename T, template<typename U> class Descriptor>
NormedVelocityParticle3D<T,Descriptor>* NormedVelocityParticle3D<T,Descriptor>::clone() const {
    return new NormedVelocityParticle3D<T,Descriptor>(*this);
}

template<typename T, template<typename U> class Descriptor>
void NormedVelocityParticle3D<T,Descriptor>::rescale(int dxScale, int dtScale) {
    PointParticle3D<T,Descriptor>::rescale(dxScale, dtScale);
    T dimDx = 1.;
    T dimDt = -1.;
    T scaleFactor = scaleFromReference(dxScale, dimDx, dtScale, dimDt);
    fluidUmax *= scaleFactor;
    particleUmax *= scaleFactor;
}

template<typename T, template<typename U> class Descriptor>
int NormedVelocityParticle3D<T,Descriptor>::getId() const {
    return id;
}

template<typename T, template<typename U> class Descriptor>
void serialize(Particle3D<T,Descriptor> const& particle, std::vector<char>& data)
{
    HierarchicSerializer serializer(data, particle.getId());
    particle.serialize(serializer);
}

template<typename T, template<typename U> class Descriptor>
void generateAndUnserializeParticles (
        std::vector<char> const& data,
        std::vector<Particle3D<T,Descriptor>*>& particles )
{
    pluint serializerPos = 0;
    while (serializerPos < data.size()) {
        HierarchicUnserializer unserializer(data, serializerPos);
        particles.push_back (
                meta::particleRegistration3D<T,Descriptor>().generate(unserializer) );
        serializerPos = unserializer.getCurrentPos();
    }
}

/* *************** class RestParticle3D ************************************ */

template<typename T, template<typename U> class Descriptor>
int RestParticle3D<T,Descriptor>::id =
        meta::registerGenericParticle3D<T,Descriptor,RestParticle3D<T,Descriptor> >("Rest");

template<typename T, template<typename U> class Descriptor>
RestParticle3D<T,Descriptor>::RestParticle3D()
{ }

template<typename T, template<typename U> class Descriptor>
RestParticle3D<T,Descriptor>::RestParticle3D (
        plint tag_, Array<T,3> const& position )
    : Particle3D<T,Descriptor>(tag_, position)
{ }

template<typename T, template<typename U> class Descriptor>
void RestParticle3D<T,Descriptor>::velocityToParticle(TensorField3D<T,3>& velocityField, T scaling) { }

template<typename T, template<typename U> class Descriptor>
void RestParticle3D<T,Descriptor>::velocityToParticle(NTensorField3D<T>& velocityField, T scaling) { }

template<typename T, template<typename U> class Descriptor>
void RestParticle3D<T,Descriptor>::rhoBarJtoParticle (
        NTensorField3D<T>& rhoBarJfield, bool velIsJ, T scaling )
{ }

template<typename T, template<typename U> class Descriptor>
void RestParticle3D<T,Descriptor>::fluidToParticle(BlockLattice3D<T,Descriptor>& fluid, T scaling) { }

template<typename T, template<typename U> class Descriptor>
void RestParticle3D<T,Descriptor>::advance() { }

template<typename T, template<typename U> class Descriptor>
int RestParticle3D<T,Descriptor>::getId() const {
    return id;
}

template<typename T, template<typename U> class Descriptor>
RestParticle3D<T,Descriptor>* RestParticle3D<T,Descriptor>::clone() const {
    return new RestParticle3D<T,Descriptor>(*this);
}

template<typename T, template<typename U> class Descriptor>
bool RestParticle3D<T,Descriptor>::getVector(plint whichVector, Array<T,3>& vector) const {
    return Particle3D<T,Descriptor>::getVector(whichVector, vector);
}

/* *************** class VerletParticle3D ************************************ */

template<typename T, template<typename U> class Descriptor>
int VerletParticle3D<T,Descriptor>::id =
        meta::registerGenericParticle3D<T,Descriptor,VerletParticle3D<T,Descriptor> >("Verlet");

template<typename T, template<typename U> class Descriptor>
VerletParticle3D<T,Descriptor>::VerletParticle3D()
    : v(T(),T(),T()),
      vHalfTime(T(),T(),T()),
      a(T(),T(),T()),
      fluidCompliance((T)1.),
      rho((T)1.),
      invRho((T)1.)
{ }

template<typename T, template<typename U> class Descriptor>
VerletParticle3D<T,Descriptor>::VerletParticle3D (
        plint tag_, Array<T,3> const& position )
    : Particle3D<T,Descriptor>(tag_, position),
      v(T(),T(),T()),
      vHalfTime(T(),T(),T()),
      a(T(),T(),T()),
      fluidCompliance((T)1.),
      rho((T)1.),
      invRho((T)1.)
{ }

template<typename T, template<typename U> class Descriptor>
void VerletParticle3D<T,Descriptor>::velocityToParticle(TensorField3D<T,3>& velocityField, T scaling)
{
    Array<T,3> position(this->getPosition());
    std::vector<Dot3D> pos(8);
    std::vector<T> weights(8);
    linearInterpolationCoefficients(velocityField, position, pos, weights);
    Array<T,3> fluidVelocity;
    fluidVelocity.resetToZero();
    for (plint iCell=0; iCell<8; ++iCell) {
        fluidVelocity += weights[iCell]*velocityField.get(pos[iCell].x,pos[iCell].y,pos[iCell].z)*scaling;
    }

    Array<T,3> force( (fluidVelocity-this->get_v()) *fluidCompliance);
    this->set_a(force / this->get_rho());
}

template<typename T, template<typename U> class Descriptor>
void VerletParticle3D<T,Descriptor>::velocityToParticle(NTensorField3D<T>& velocityField, T scaling)
{
    Array<T,3> position(this->getPosition());
    std::vector<Dot3D> pos(8);
    std::vector<T> weights(8);
    linearInterpolationCoefficients(velocityField, position, pos, weights);
    Array<T,3> fluidVelocity;
    fluidVelocity.resetToZero();
    for (plint iCell=0; iCell<8; ++iCell) {
        T* data = velocityField.get(pos[iCell].x,pos[iCell].y,pos[iCell].z);
        fluidVelocity[0] += weights[iCell]*scaling * data[0];
        fluidVelocity[1] += weights[iCell]*scaling * data[0];
        fluidVelocity[2] += weights[iCell]*scaling * data[0];
    }

    Array<T,3> force( (fluidVelocity-this->get_v()) *fluidCompliance);
    this->set_a(force / this->get_rho());
}

template<typename T, template<typename U> class Descriptor>
void VerletParticle3D<T,Descriptor>::rhoBarJtoParticle (
        NTensorField3D<T>& rhoBarJfield, bool velIsJ, T scaling )
{
    Array<T,3> position(this->getPosition());
    std::vector<Dot3D> pos(8);
    std::vector<T> weights(8);
    linearInterpolationCoefficients(rhoBarJfield, position, pos, weights);
    Array<T,3> j;
    j.resetToZero();
    T rhoBar = T();
    for (plint iCell=0; iCell<8; ++iCell) {
        T* data = rhoBarJfield.get(pos[iCell].x,pos[iCell].y,pos[iCell].z);
        j.add_from_cArray(data+1, weights[iCell]);
        rhoBar += weights[iCell]*(*data);
    }
    Array<T,3> fluidVelocity;
    if (velIsJ) {
        fluidVelocity = j*scaling;
    }
    else {
        fluidVelocity = j*scaling*Descriptor<T>::invRho(rhoBar);
    }

    Array<T,3> force( (fluidVelocity-this->get_v()) *fluidCompliance);
    this->set_a(force / this->get_rho());
}

template<typename T, template<typename U> class Descriptor>
void VerletParticle3D<T,Descriptor>::fluidToParticle(BlockLattice3D<T,Descriptor>& fluid, T scaling)
{
    Array<T,3> position(this->getPosition());
    std::vector<Dot3D> pos(8);
    std::vector<T> weights(8);
    linearInterpolationCoefficients(fluid, position, pos, weights);
    Array<T,3> tmpVel;
    Array<T,3> fluidVelocity;
    fluidVelocity.resetToZero();
    for (plint iCell=0; iCell<8; ++iCell) {
        if (contained(pos[iCell].x,pos[iCell].y,pos[iCell].z, fluid.getBoundingBox())) {
            fluid.get(pos[iCell].x,pos[iCell].y,pos[iCell].z).computeVelocity(tmpVel);
        }
        else {
            tmpVel.resetToZero();
        }
        fluidVelocity += weights[iCell]*tmpVel*scaling;
    }

    Array<T,3> force( (fluidVelocity-this->get_v()) *fluidCompliance);
    this->set_a(force / this->get_rho());
}

template<typename T, template<typename U> class Descriptor>
void VerletParticle3D<T,Descriptor>::advance() {
    vHalfTime = v + (T)0.5*a;
    this->getPosition() += vHalfTime;
}

template<typename T, template<typename U> class Descriptor>
int VerletParticle3D<T,Descriptor>::getId() const {
    return id;
}

template<typename T, template<typename U> class Descriptor>
void VerletParticle3D<T,Descriptor>::reset(Array<T,3> const& position_)
{
    Particle3D<T,Descriptor>::reset(position_);
    v.resetToZero();
    vHalfTime.resetToZero();
    a.resetToZero();
}

template<typename T, template<typename U> class Descriptor>
void VerletParticle3D<T,Descriptor>::serialize(HierarchicSerializer& serializer) const
{
    Particle3D<T,Descriptor>::serialize(serializer);
    serializer.addValues<T,3>(v);
    serializer.addValues<T,3>(vHalfTime);
    serializer.addValues<T,3>(a);
    serializer.addValue<T>(fluidCompliance);
    serializer.addValue<T>(rho);
    serializer.addValue<T>(invRho);
}

template<typename T, template<typename U> class Descriptor>
void VerletParticle3D<T,Descriptor>::unserialize(HierarchicUnserializer& unserializer)
{
    Particle3D<T,Descriptor>::unserialize(unserializer);
    unserializer.readValues<T,3>(v);
    unserializer.readValues<T,3>(vHalfTime);
    unserializer.readValues<T,3>(a);
    unserializer.readValue<T>(fluidCompliance);
    unserializer.readValue<T>(rho);
    unserializer.readValue<T>(invRho);
}

template<typename T, template<typename U> class Descriptor>
VerletParticle3D<T,Descriptor>* VerletParticle3D<T,Descriptor>::clone() const {
    return new VerletParticle3D<T,Descriptor>(*this);
}

template<typename T, template<typename U> class Descriptor>
bool VerletParticle3D<T,Descriptor>::getVector(plint whichVector, Array<T,3>& vector) const {
    if (whichVector==0) {
        vector = get_v();
        return true;
    }
    else if (whichVector==1) {
        vector = get_a();
        return true;
    }
    return Particle3D<T,Descriptor>::getVector(whichVector, vector);
}

template<typename T, template<typename U> class Descriptor>
bool VerletParticle3D<T,Descriptor>::getScalar(plint whichScalar, T& scalar) const {
    if (whichScalar==0) {
        scalar = rho;
        return true;
    }
    else if (whichScalar==1) {
        scalar = fluidCompliance;
        return true;
    }
    return Particle3D<T,Descriptor>::getScalar(whichScalar, scalar);
}

}  // namespace plb

#endif  // PARTICLE_3D_H


text: package gorethink