text:
<!doctype html>
<meta charset="utf-8" />
<title>input type=password Multiple JS events</title>

	Below you should see two lines of password fields: The first one should have one
	field, and the second two.

	Click the first password field.  The second password field (first on second line)
	should have its value changed to "foobar".

	Type something in the first password field.  The third password field (second on
	second line) should have its value changed to "foobar".

<form>

		<input name="first_field" type="password" onclick="document.getElementById('test1').value = 'foobar';" onkeypress="document.getElementById('test2').value = 'foobar';" />

		<input id="test1" name="test1" type="password" />
		<input id="test2" name="test2" type="password" />

</form>


text:
#import <TitaniumKit/TiViewProxy.h>

@interface TiUIAlertDialogProxy : TiViewProxy {
  @private
  UIAlertController *alertController;
  BOOL persistentFlag;
  int cancelIndex;
  int destructiveIndex;
  int preferredIndex;
  int style;
}

- (void)show:(id)unused;
- (void)hide:(id)args;

@end

redpajama_set_name: RedPajamaGithub


text:
* Status: accepted
* Date: 2020-09-31

## Context and Problem Statement
While developing the new, unified API, there weren't clear guidelines for structuring new API endpoints. The first approach
was introducing two different endpoint prefixes, similar to what is currently done in a regular shop. On the 30th of April,
we have merged a unification of our endpoints in https://github.com/Sylius/Sylius/pull/11397. This move was dictated by
the fact that we wanted to push unification even further. Depending on the currently logged in user, we had to expose different
data for available entities in both contexts. Besides, it ought to simplify API usage (as it would reduce the number of endpoints)
and simplify the relations between resources. However, this change rose a lot of new issues to solve:

 * Different serialization for different users is not trivial. Some relations between objects are also contextual, so
admin can see many more links than the regular visitor or shop user.
 * Endpoints like "Product Show" are resolved differently depending on the context as well. The shop products are determined
based on the slug (taking into account the current channel), while the administrator is browsing products by code. This
separation blurs the product identifier, and it is not clear which route should be considered as IRI.
 * the split was not complete. Two separate log in endpoints have to be preserved, due to our user architecture and the
decision that we want to be explicit, which user is trying to log in.

Using one unified identifier in both admin and shop panel is a no go as well. In the shop we should use a `slug`, to be able
to expose product data based on URL (or provide redirect to proper resource based on the channel and locale), while in admin
resources are channel and locale agnostic, and we should use `codes` instead.

## Decision Drivers

* Driver 1: There is not strict requirement to have a direct 1 to 1 correlation between entities in database and exposed API Resources.
One resource in the database may aggregate several API Resources
* Driver 2: There should be a clear way to determine an IRI for each of exposed API Resources
* Driver 3: A clear separation of available resources and paths for visitor and admin may be expected

## Considered Options

Every option will be described considering products example fetched by shop user and administrator:

### Staying with the current solution

`GET /new-api/products/knitted-wool-blend-green-cap` for Visitor (using product slug) which will return
`{"id": 1, "slug": 2, "prices": {} }`
`GET /new-api/products/KNITTED_WOOL_BLEND_GREEN_CAP` for admin user (using product code) which will return
`{"id": 1, "slug": 2, "prices": {}, "admin_related_information" : "" }`

* Good, because there is only one endpoint for the products.
* Bad, because depending on the currently logged in user, the IRIs between related products (or on the product list) have been
changed (between slug and code).
* Bad, because it is not clear how to operate on endpoint before jumping into documentation. (For example tax rates
endpoint is not exposed for shop users).
* Bad, because we have to declare authorization rules on endpoint basis, while some of them will have really complicated
rules (different strategies for admin, shop user and guest).

### Adding additional suffix for path

`GET /new-api/products/knitted-wool-blend-green-cap` for Visitor (using product slug) which will return
`{"id": 1, "slug": 2, "prices": {} }`
`GET /new-api/products/KNITTED_WOOL_BLEND_GREEN_CAP/admin` for admin user (using product code) which will return
`{"id": 1, "slug": 2, "prices": {}, "admin_related_information" : "" }`

* Good, because we can treat two different presentations as two separate resources and generate two different IRIs for both of them.
* Good, because it is clear which endpoint should be used in admin and shop contexts.
* Good, because the authorization of admin and shop users is more straightforward.
* Bad, because there are two endpoints for the products.
* Bad, because it results with n paths with `admin` prefix only, while on others, we should be cautious which path we are using.
* Bad, because we have to declare authorization rules on endpoint basis, while some of them will have really complicated
rules (different strategies for admin, shop user, and guest)

### Moving back to prefixed paths for back-office and shop

`GET /new-api/shop/products/knitted-wool-blend-green-cap` for Visitor (using product slug) which will return
`{"id": 1, "slug": 2, "prices": {} }`
`GET /new-api/admin/products/KNITTED_WOOL_BLEND_GREEN_CAP` for admin user (using product code) which will return
`{"id": 1, "slug": 2, "prices": {}, "admin_related_information" : "" }`

* Good, because we can treat two different presentations as two separate resources and generate two different IRIs for both of them.
* Good, because it is clear which endpoint should be used in admin and shop contexts.
* Good, because the authorization of admin and shop users is more straightforward.
* Good, because we can take advantage of Symfony firewalls and hide all admin endpoints behind one firewall.
* Bad, because there are two endpoints for the products.

## Decision Outcome

Chosen option: "Moving back to prefixed paths for back-office and shop". This option was selected because it allows us to
easily leverage the Symfony Security component's benefits like firewalls and ACL. The only second and third option provides
predictable behavior and clear separation of concerns for admin and shop. Still, suffixes on most of the routes seem like
a worse solution compared to the common prefix. The common prefix will indicate that these endpoints are grouped in the
same context.


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

<title>org.jay3d.engine.rendering</title>
<meta name="date" content="2014-10-05">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

org.jay3d.engine.rendering

Classes

Material

Mesh

RenderingEngine

Shader

Texture

Vertex

Window


text:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.designbest.alinovietanzi" version="6.2.188" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
    <name>Alinovi e Tanzi Arredamenti</name>
    <description>
Questa applicazione ti permette di portare sempre con te, sul tuo Smartphone o Tablet, il catalogo d'arredamento di Alinovi & Tanzi Arredamenti, il tuo negozio di fiducia di design a Parma.
Ricerca l'arredo di design per la tua casa attraverso le categorie di prodotto (tavoli, sedie, divani, etc.) o con la ricerca testuale libera. Sfoglia le migliori marche di design italiano ed internazionale proposte da Alinovi & Tanzi Arredamenti.
Tieniti aggiornato con tutte le novità presentate alle fiere di settore nell'apposita sezione Novità.
All'interno delle schede prodotto trova tutti i dettagli utili per orientarti nella tua scelta: nome e descrizione del prodotto, misure, materiali e caratteristiche.
Con la gallery guarda il prodotto d'arredo da te selezionato nei minimi dettagli.
</description>
    <author email="info@alinovietanzi.it" href="http://www.alinovietanzi.it">
        Alinovi e Tanzi Arredamenti
    </author>
    <access launch-external="yes" origin="maps:*" />
    <access launch-external="yes" origin="geo:*" />
    <content src="index.html" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="permissions" value="none" />
    <preference name="orientation" value="portrait" />
    <preference name="target-device" value="universal" />
    <preference name="android-minSdkVersion" value="19" />
    <feature name="StatusBar">
        <param name="ios-package" onload="true" value="CDVStatusBar" />
    </feature>
    <preference name="StatusBarOverlaysWebView" value="false" />
    <preference name="StatusBarStyle" value="lightcontent" />
    <plugin name="cordova-plugin-whitelist" source="npm" spec="~1.2.1" />
    <icon src="icon.png" />
    <platform name="android">
        <icon density="ldpi" src="www/res/icons/android/icon-36-ldpi.png" />
        <icon density="mdpi" src="www/res/icons/android/icon-48-mdpi.png" />
        <icon density="hdpi" src="www/res/icons/android/icon-72-hdpi.png" />
        <icon density="xhdpi" src="www/res/icons/android/icon-96-xhdpi.png" />
        <icon density="xxhdpi" src="www/res/icons/android/icon-144-xxhdpi.png" />
        <icon density="xxxhdpi" src="www/res/icons/android/icon-192-xxxhdpi.png" />
        <splash density="port-ldpi" src="www/res/screen/android/screen-ldpi-portrait.png" />
        <splash density="port-mdpi" src="www/res/screen/android/screen-mdpi-portrait.png" />
        <splash density="port-hdpi" src="www/res/screen/android/screen-hdpi-portrait.png" />
        <splash density="port-xhdpi" src="www/res/screen/android/screen-xhdpi-portrait.png" />
        <splash density="port-xxhdpi" src="www/res/screen/android/screen-xxhdpi-portrait.png" />
        <splash density="port-xxxhdpi" src="www/res/screen/android/screen-xxxhdpi-portrait.png" />
    </platform>
    <platform name="ios">
        <icon height="29" platform="ios" src="www/res/icons/ios/icon-small.png" width="29" />
        <icon height="58" platform="ios" src="www/res/icons/ios/icon-small-2x.png" width="58" />
        <icon height="87" platform="ios" src="www/res/icons/ios/icon-small-3x.png" width="87" />
        <icon height="40" platform="ios" src="www/res/icons/ios/icon-40.png" width="40" />
        <icon height="80" platform="ios" src="www/res/icons/ios/icon-40-2x.png" width="80" />
        <icon height="50" platform="ios" src="www/res/icons/ios/icon-50.png" width="50" />
        <icon height="100" platform="ios" src="www/res/icons/ios/icon-50-2x.png" width="100" />
        <icon height="57" platform="ios" src="www/res/icons/ios/icon-57.png" width="57" />
        <icon height="114" platform="ios" src="www/res/icons/ios/icon-57-2x.png" width="114" />
        <icon height="60" platform="ios" src="www/res/icons/ios/icon-60.png" width="60" />
        <icon height="120" platform="ios" src="www/res/icons/ios/icon-60-2x.png" width="120" />
        <icon height="72" platform="ios" src="www/res/icons/ios/icon-72.png" width="72" />
        <icon height="144" platform="ios" src="www/res/icons/ios/icon-72-2x.png" width="144" />
        <icon height="76" platform="ios" src="www/res/icons/ios/icon-76.png" width="76" />
        <icon height="152" platform="ios" src="www/res/icons/ios/icon-76-2x.png" width="152" />
        <icon height="167" platform="ios" src="www/res/icons/ios/icon-167.png" width="167" />
        <icon height="180" platform="ios" src="www/res/icons/ios/180.png" width="180" />
        <icon height="512" platform="ios" src="www/res/icons/ios/icon-512.png" width="512" />
        <icon height="1024" platform="ios" src="www/res/icons/ios/icon-1024.png" width="1024" />
        <splash height="1136" platform="ios" src="www/res/screen/ios/screen-iphone-portrait-568h-2x.png" width="640" />
        <splash height="1334" platform="ios" src="www/res/screen/ios/screen-ipad-667h.png" width="750" />
        <splash height="2208" platform="ios" src="www/res/screen/ios/screen-ipad-736h.png" width="1242" />
        <splash height="2048" platform="ios" src="www/res/screen/ios/screen-iphone-portrait-2x.png" width="1536" />
        <splash height="1024" platform="ios" src="www/res/screen/ios/screen-ipad-portrait.png" width="768" />
        <splash height="960" platform="ios" src="www/res/screen/ios/screen-iphone-portrait-2x.png" width="640" />
        <splash height="480" platform="ios" src="www/res/screen/ios/screen-iphone-portrait.png" width="320" />
    </platform>
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <allow-intent href="maps:*" />
    </platform>
    <config-file parent="UIStatusBarHidden" platform="ios" target="*-Info.plist">
        <true />
    </config-file>
    <config-file parent="UIViewControllerBasedStatusBarAppearance" platform="ios" target="*-Info.plist">
        <false />
    </config-file>
		<config-file platform="ios" target="*-Info.plist" parent="LSApplicationQueriesSchemes">
      <array>
        <string>whatsapp://</string>
      </array>
    </config-file>

    <plugin name="phonegap-plugin-push" spec="~1.8.4">
        <variable name="SENDER_ID" value="xxxxx" />
    </plugin>
    <plugin name="cordova-plugin-device" spec="~1.1.3" />
    <plugin name="cordova-custom-config" spec="~3.0.14" />
    <plugin name="cordova-plugin-dialogs" spec="~1.2.1" />
    <plugin name="cordova-plugin-inappbrowser" spec="~1.5.0" />
    <plugin name="cordova-plugin-network-information" spec="~1.2.1" />
    <plugin name="cordova-plugin-statusbar" spec="~2.2.0" />
    <plugin name="cordova-plugin-contacts" CONTACTS_USAGE_DESCRIPTION="" />
		<plugin name="cordova-plugin-x-socialsharing" spec="~5.1.8" src="https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin" />
</widget>


text:
(function(){

    angular
        .module("eventapp")
        .controller("LoginController", LoginController);

    function LoginController($scope, $location, $rootScope, UserService)
    {
        console.log("Inside login controller");

        $scope.login = function (user)
        {
            var txtUserName = $("#username").val();
            var txtPassword = $("#password").val();

            console.log("username is: " + txtUserName + " password is : "  + txtPassword);

            console.log(user);
            if(txtUserName.trim().length!=0 && txtPassword.trim().length!=0){
                if (user != undefined) {
                    UserService.loginUser(user, function (user) {
                        console.log(user + " from login controller");
                        if (user != null) {
                            $rootScope.currentUser = user;
                            //console.log("user from login controller " + $rootScope.currentUser);
                            //$location.url('/profile'+user.username); // work on this and its routing in config.js
                            $location.url('/home');
                        }
                        else {
                            alert("User does not exist!");
                        }
                    },function(error){

                        alert("User does not exist!")
                    });
                }
            }else{
                alert("username and password be blank!")
            }
        }
    }
})();


text:
<?xml version="1.0" encoding="UTF-8"?>
<ti:app xmlns:ti="http://ti.appcelerator.org">
    <deployment-targets>
        <target device="mobileweb">false</target>
        <target device="iphone">true</target>
        <target device="ipad">false</target>
        <target device="android">true</target>
        <target device="blackberry">false</target>
    </deployment-targets>
    <sdk-version>3.1.0.GA</sdk-version>
    <id>com.att.developer.contacts</id>
    <name>ATTContacts</name>
    <version>1.0</version>
    <publisher>AT&T</publisher>
    <url>https://developer.att.com</url>
    <description>not specified</description>
    <copyright>2013 by AT&T</copyright>
    <icon>appicon.png</icon>
    <persistent-wifi>false</persistent-wifi>
    <prerendered-icon>false</prerendered-icon>
    <statusbar-style>default</statusbar-style>
    <statusbar-hidden>false</statusbar-hidden>
    <fullscreen>false</fullscreen>
    <navbar-hidden>false</navbar-hidden>
    <analytics>true</analytics>
    <guid>87b547f3-9efa-4d98-a046-e022df2ebe7b</guid>
    <property name="ti.ui.defaultunit">dip</property>
    <iphone>
        <orientations device="iphone">
            <orientation>Ti.UI.PORTRAIT</orientation>
        </orientations>
        <orientations device="ipad">
            <orientation>Ti.UI.PORTRAIT</orientation>
            <orientation>Ti.UI.UPSIDE_PORTRAIT</orientation>
            <orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
            <orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>
        </orientations>
    </iphone>
    <android xmlns:android="http://schemas.android.com/apk/res/android"/>
    <mobileweb>
        <precache/>
        <splash>
            <enabled>true</enabled>
            <inline-css-images>true</inline-css-images>
        </splash>
        <theme>default</theme>
    </mobileweb>
    <modules>
        <module platform="commonjs" version="1.1.0">att</module>
        <module platform="iphone" version="1.0.3">ti.api.att</module>
        <module platform="android" version="1.1.0">ti.api.att</module>
        <module platform="android" version="1.0.0">ti.api.att.audiorecorder</module>
    </modules>
    <property name="accessKey">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</property>
    <property name="secretKey">XXXXXXXXXXXXXXXX</property>
</ti:app>


text:
This repository contains various bash scripts used to initialize and control VM instances on the Jetstream cluster. Note that many of the [install](#general) scripts are not specific to Jetstream instances and can be used to install software to most Ubuntu, CentOS and RedHat 6/7 machines.  The scripts have not been tested on Debian, Fedora, or other Linux distributions.

Code pushed to the master branch of this repository will be automatically pushed to http://downloads.lappsgrid.org/scripts.

1. [General Installation Scripts](#general)
  1. install-common.sh
  1. install-java.sh
  1. install-postgres.sh
  1. install-docker.sh
  1. install-groovy.sh
  1. install-lsd.sh
1. [Galaxy Installation Scripts](#galaxy)
  1. galaxy-setup.sh
  1. patch-galaxy-ini.sh
  1. db-setup.sh
1. [Miscellaneous Scripts](#miscellaneous)
  1. sniff.sh
  1. proxy
  1. pull.sh
  1. jetstream
1. [Jetstream Control Script](Jetstream.md)

This repository contains various bash scripts used to initialize and control VM instances on the Jetstream cluster. Note that many of the [install](#general) scripts are not specific to Jetstream instances and can be used to install software to most Ubuntu, CentOS and RedHat 6/7 machines.  The scripts have not been tested on Debian, Fedora, or other Linux distributions.

### General

The following scripts are used to install various required packages on either Ubuntu, CentOS, or RedHat.

1. `install-common.sh`

Installs `git`, `zip`, `unzip`, and `emacs`
1. `install-java.sh`

Installs OpenJDK 1.8
1. `install-postgres.sh`

Installs PostgreSQL 9.6
1. `install-docker.sh`

Installs the latest beta versions of Docker and Docker Compose.  The beta versions are required to support the latest features of Docker Compose and Docker Swarm.
1. `install-groovy.sh`

Installs Groovy 2.4.7
1. `install-lsd.sh`

Installs the [Lappsgrid Services DSL](https://github.com/lappsgrid-incubator/org.anc.lapps.dsl) (Domain Specific Language).

### Galaxy

1. `galaxy-setup.sh`

Installs Java, Postgres, LSD, and the common packages before cloning Galaxy from the Lappgrid GitHub repository.  Uses the following scripts to configure the Galaxy instance and database.
1. `patch-galaxy-ini.sh`

Patches Galaxy's galaxy.ini script with the appropriate port number (default is 8000), database password, secret, and installation directory.
1. `db-setup.sql`

Creates the galaxy database and user in Postgres.

### Miscellaneous

- `sniff.sh`

The `sniff.sh` script is used by other scripts to detect the Linux distribution being used.
- `proxy`

This is the script used on the proxy server to update the nginx configuration. Proxy configuration will typically be done with the [jetstream](Jetstream.md) script, however, the *jetstream* script simply invokes the *proxy* script on the server to perform the actual work.
- `pull.sh`

The script used by the `http://api.lappsgrid.org/pull` web-hook to update the */var/lib/downloads/scripts* and */var/lib/downloads/service-manager* directories.
- `jetstream`

Use the `jetstream` script on your local Linux/MacOS system to manage VM instances on the Jetstream cluster. The `jetstream` script contains command for starting and stopping instances as well as reconfiguring the proxy to change the server that jetstream.lappsgrid.org resolves to.

You can read more about the Jetstream script [here](Jetstream.md).

### Deprecated

These scripts were used with the Jetstream "Atmosphere" user interface.  However, we now use the much more powerful OpenStack interface directly.

- **vm-setup.sh**

The OpenStack web UI allows users to upload an initialization script that will be run when the VM is first initialized.  However, the script uploaded to the OpenStack UI can not be deleted or renamed.  To work around these drawbacks the `vm-setup.sh` script downloads the `vm-initialize.sh` script which does the actual work of initiallizing the VM. Now the `vm-initialize.sh` script can be updated and used to initialize ne VM instances.
- **vm-inialize.sh**

Does all the work of initializing a new VM.  This script will install (amongst other things):
  - Java
  - Groovy
  - Zip, unzip, emacs, and other utils
  - Several Lappsgrid tools (lsd, jsonc, tool-config-editor, etc.)


text:
using Abp.Dependency;
using Abp.ObjectMapping;

namespace Abp.AutoMapper
{
    public class AutoMapperObjectMapper : IObjectMapper, ISingletonDependency
    {
        public TDestination Map<TDestination>(object source)
        {
            return source.MapTo<TDestination>();
        }

        public TDestination Map<TSource, TDestination>(TSource source, TDestination destination)
        {
            return source.MapTo(destination);
        }
    }
}


text:
package io.cloudslang.lang.compiler.modeller.transformers;

import io.cloudslang.lang.compiler.SlangTextualKeys;

public class DoExternalTransformer extends DoTransformer {

    @Override
    public String keyToTransform() {
        return SlangTextualKeys.DO_EXTERNAL_KEY;
    }

    @Override
    public Type getType() {
        return Type.EXTERNAL;
    }
}


text:
'use strict';

if (typeof OnePRGame === 'undefined') {
    var OnePRGame = {};
}

OnePRGame.Engine3D = function (context, gameBoardClassName) {

    this.GameBoardClassName = gameBoardClassName;
    this.Context = context;
    this.ScreenWidth = 0;
    this.ScreenHeight = 0;
    this.HalfWidth = 0;
    this.HalfHeight = 0;
    this.CanvasContext = null;
	this.Camera = {
        DrawDistance: 4,
        XFieldOfView: 100 * Math.PI / 180,
        YFieldOfView: 100 * Math.PI / 180
    };
    this.MoveQueue = [];
    this.RenderInterval = null;
    this.MoveQueueInterval = null;
    this.Planes = [];
    let that = this;

	// Applying patterns to the 2D image doesn't work right.
    ////this.StoneBrick = that.CanvasContext.createPattern(document.getElementsByClassName('stone-bricks')[0], 'repeat');
    ////for (let i = 2; i < that.Planes.length; i++) {
    ////    that.Planes[i].Color = that.StoneBrick;
    ////}

    this.Run = function () {

        let gameBoardWindow = document.getElementsByClassName('game-board-window')[0];
        that.ScreenWidth = gameBoardWindow.clientWidth;
        that.ScreenHeight = gameBoardWindow.clientHeight;

        that.HalfWidth = that.ScreenWidth / 2;
        that.HalfHeight = that.ScreenHeight / 2;

        that.Camera.XFocalLength = that.HalfWidth / Math.tan(that.Camera.XFieldOfView / 2);
        that.Camera.YFocalLength = that.HalfHeight / Math.tan(that.Camera.YFieldOfView / 2);

        let gameBoard = document.getElementsByClassName(that.GameBoardClassName)[0];

		// Remove old elements
        let existingGameBoardCanvases = gameBoard.getElementsByClassName('game-board-3d-canvas');
        if (existingGameBoardCanvases.length > 0) {
            gameBoard.removeChild(existingGameBoardCanvases[0]);
        }

        let existingGameBoardPlayerActions = gameBoard.getElementsByClassName('game-board-3d-player-action');
        for (let i = existingGameBoardPlayerActions.length - 1; i >= 0; i--) {
            gameBoard.removeChild(existingGameBoardPlayerActions[i]);
        }

        let existingGameBoardControls = gameBoard.getElementsByClassName('game-board-3d-controls');
        if (existingGameBoardControls.length > 0) {
            gameBoard.removeChild(existingGameBoardControls[0]);
        }

        // Add canvas element
        let canvas = document.createElement('canvas');
        canvas.className = 'game-board-3d-canvas';
        canvas.width = that.ScreenWidth;
        canvas.height = that.ScreenHeight;
        gameBoard.appendChild(canvas);
        that.CanvasContext = canvas.getContext('2d');

		// Convert map to planes.
        for (let i = 0; i < that.Context.Map.length; i++) {
            for (let j = 0; j < that.Context.Map[i].length; j++) {
                that.Planes.push({
                    Vertices: [
                        [j, 0, i],
                        [j, 0, i + 1],
                        [j + 1, 0, i + 1],
                        [j + 1, 0, i]
                    ],
                    Color: that.Context.Tileset[that.Context.Map[i][j]].Color
                });
            }
        }

        // This is the frame rate (1000/50 = 20 frames/sec)
        // Mainstream games: 60 FPS is good, 30 FPS low.
        that.RenderInterval = setInterval(function () { that.Render(); }, 50);

        that.MoveQueueInterval = setInterval(function () { that.ExecuteMoveQueue(); }, 25);

        // Setup controls elements
        let controls3d = document.createElement('div');
        controls3d.className = 'game-board-3d-controls';
        controls3d.style.position = 'absolute';
        controls3d.style.bottom = '0px';
        controls3d.style.left = '0px';

        let leftButton = document.createElement('button');
        leftButton.type = 'button';
        leftButton.className = 'game-board-3d-controls-left';
        leftButton.textContent = 'Left';
        controls3d.appendChild(leftButton);

        let forwardButton = document.createElement('button');
        forwardButton.type = 'button';
        forwardButton.className = 'game-board-3d-controls-forward';
        forwardButton.textContent = 'Forward';
        controls3d.appendChild(forwardButton);

        let rightButton = document.createElement('button');
        rightButton.type = 'button';
        rightButton.className = 'game-board-3d-controls-right';
        rightButton.textContent = 'Right';
        controls3d.appendChild(rightButton);

        gameBoard.appendChild(controls3d);

        // Controls event listeners
        gameBoard.getElementsByClassName('game-board-3d-controls-left')[0].addEventListener('click', that.Left, false);

        gameBoard.getElementsByClassName('game-board-3d-controls-forward')[0].addEventListener('click', that.Forward, false);

        gameBoard.getElementsByClassName('game-board-3d-controls-right')[0].addEventListener('click', that.Right, false);

    };

    this.Stop = function (callback) {

        clearInterval(that.RenderInterval);
        clearInterval(that.MoveQueueInterval);

        let gameBoard = document.getElementsByClassName(that.GameBoardClassName)[0];

        gameBoard.getElementsByClassName('game-board-3d-controls-left')[0].removeEventListener('click', that.Left, false);

        gameBoard.getElementsByClassName('game-board-3d-controls-forward')[0].removeEventListener('click', that.Forward, false);

        gameBoard.getElementsByClassName('game-board-3d-controls-right')[0].removeEventListener('click', that.Right, false);

        let stopInterval = setInterval(function () {
            if (that.MoveQueue.length === 0 || that.MoveQueue[0].Status !== 'Executing') {

                clearInterval(stopInterval);

                if (typeof callback !== 'undefined') {
                    callback();
                }
            }
        }, 50);
    };

    this.Forward = function () {
        if (that.MoveQueue.length === 0 || that.MoveQueue[0].Status !== 'Executing') {
            that.MoveQueue.push({
                Status: 'Not Started',
                Move: function () {
                    let isX = that.Context.Player.Direction !== Math.PI / 2 && that.Context.Player.Direction !== Math.PI * 3 / 2;
                    let isAdd = that.Context.Player.Direction !== Math.PI && that.Context.Player.Direction !== Math.PI * 3 / 2;

                    let startPosition = parseFloat((that.Context.Player.Position[isX ? 1 : 0] + 0.5));
                    let endPosition = startPosition + (isAdd ? 1 : -1);

                    // Where am I going?
                    let targetTile = OnePRGame.Tileset[OnePRGame.Map[that.Context.Player.Position[0] + (isX ? 0 : isAdd ? 1 : -1)][that.Context.Player.Position[1] + (!isX ? 0 : isAdd ? 1 : -1)]];

                    // Can I get there?
                    if (targetTile !== null && !targetTile.Impassable) {

                        let intervalId = setInterval(function () {

                            if ((isAdd && (that.Context.Player.Position[isX ? 1 : 0] + 0.5) >= endPosition) || (!isAdd && (that.Context.Player.Position[isX ? 1 : 0] + 0.5) <= endPosition)) {
                                that.Context.Player.Position[isX ? 1 : 0] = endPosition - 0.5;
                                clearInterval(intervalId);
                                that.MoveQueue[0].Status = 'Complete';
                                if (typeof targetTile.Event === 'function') {
                                    targetTile.Event();
                                }
                            }
                            else {
                                that.Context.Player.Position[isX ? 1 : 0] = (parseFloat((that.Context.Player.Position[isX ? 1 : 0] + 0.5)) + (isAdd ? 0.05 : -0.05)).toPrecision(3) - 0.5;
                            }

                        }, 50);

                    }
                    else {
                        that.MoveQueue[0].Status = 'Complete';
                    }
                }
            });
        }
    };

    this.Left = function () {
        if (that.MoveQueue.length === 0 || that.MoveQueue[0].Status !== 'Executing') {
            that.MoveQueue.push({
                Status: 'Not Started',
                Move: function () {
                    let startPosition = parseFloat(that.Context.Player.Direction);
                    let endPosition = startPosition - (Math.PI / 2);

                    let intervalId = setInterval(function () {

                        if (that.Context.Player.Direction <= endPosition) {
                            that.Context.Player.Direction = endPosition;
                            clearInterval(intervalId);
                            if (that.Context.Player.Direction < 0) {
                                that.Context.Player.Direction += Math.PI * 2;
                            }

                            that.MoveQueue[0].Status = 'Complete';
                        }
                        else {
                            that.Context.Player.Direction = parseFloat(that.Context.Player.Direction) - (Math.PI / 20);
                        }
                    }, 50);
                }
            });
        }
    };

    this.Right = function () {
        if (that.MoveQueue.length === 0 || that.MoveQueue[0].Status !== 'Executing') {
            that.MoveQueue.push({
                Status: 'Not Started',
                Move: function () {
                    let startPosition = parseFloat(that.Context.Player.Direction);
                    let endPosition = startPosition + (Math.PI / 2);

                    let intervalId = setInterval(function () {

                        if (that.Context.Player.Direction >= endPosition) {
                            that.Context.Player.Direction = endPosition;
                            clearInterval(intervalId);
                            if (that.Context.Player.Direction > Math.PI * 2) {
                                that.Context.Player.Direction -= Math.PI * 2;
                            }

                            that.MoveQueue[0].Status = 'Complete';
                        }
                        else {
                            that.Context.Player.Direction = parseFloat(that.Context.Player.Direction) + (Math.PI / 20);
                        }
                    }, 50);
                }
            });
        }
    };

    this.PlayerAction = function (text) {

        let playerAction = document.createElement('div');
        playerAction.className = 'game-board-3d-player-action';
        playerAction.textContent = text;
        document.getElementsByClassName(that.GameBoardClassName)[0].appendChild(playerAction);

    };

    this.RotatePointAroundCameraDirection = function (point3d) {
        let x = point3d[0];
        let z = point3d[2];

        let cosRY = Math.cos(that.Context.Player.Direction);
        let sinRY = Math.sin(that.Context.Player.Direction);
        let tempz = z;
        let tempx = x;

        x = Math.round(((tempx * cosRY) + (tempz * sinRY)) * 100) / 100;
        z = Math.round(((tempx * -sinRY) + (tempz * cosRY)) * 100) / 100;

        return [z, point3d[1], x];
    };

    this.GetLocalCoordinates = function (plane3d) {

        let localPlane = {
            Vertices: [],
            Color: plane3d.Color
        };

        for (let i = 0; i < plane3d.Vertices.length; i++) {

            // Camera position modification
            let vertex = [
                plane3d.Vertices[i][0] - (that.Context.Player.Position[1] + 0.5),
                plane3d.Vertices[i][1] - 0.5,
                plane3d.Vertices[i][2] - (that.Context.Player.Position[0] + 0.5)
            ];

            // Camera direction modification
            vertex = that.RotatePointAroundCameraDirection(vertex);

            localPlane.Vertices.push(vertex);
        }

        return localPlane;
    };

    this.Calc3DPointIn2D = function (point3d) {

        // Using projection, not using ray casting. Maybe some other time.

        let x3d = point3d[0];
        let y3d = point3d[1];
        let z3d = point3d[2];

        // Projection
        let x2d = z3d === 0 && x3d > 0 ? that.HalfWidth : z3d === 0 && x3d < 0 ? -that.HalfWidth : (x3d * (that.Camera.XFocalLength / z3d));

        if (z3d < 0) {
            // Using this as a surrogate for proper 3D clipping.
            // See: www.cubic.org/docs/3dclip.htm
            x2d = -6 * x2d;
        }

        let y2d = z3d === 0 && y3d > 0 ? that.HalfHeight : z3d === 0 && y3d < 0 ? -that.HalfHeight : (y3d * (that.Camera.YFocalLength / z3d));

        if (z3d < 0) {
            // Using this as a surrogate for proper 3D clipping.
            // See: www.cubic.org/docs/3dclip.htm
            y2d = -6 * y2d;
        }

        // So, point (0, 0) on the canvas is the upper left corner and positive is in
        // the direction of the bottom of the screen.
        // That means everything is mirrored over the Y, and the code here adjusts for that.
        // And we want (0, 0) in the middle, so we move it to the center of the screen.
        return [x2d + that.HalfWidth, -y2d + that.HalfHeight];

    };

    this.DrawPlaneIn2D = function (plane2d) {

        that.CanvasContext.beginPath();

        for (let i = 0; i < plane2d.Vertices.length; i++) {

            if (i === 0) {
                that.CanvasContext.moveTo.apply(that.CanvasContext, plane2d.Vertices[i]);
            }
            else {
                that.CanvasContext.lineTo.apply(that.CanvasContext, plane2d.Vertices[i]);
            }

        }

        that.CanvasContext.closePath();
        that.CanvasContext.fillStyle = plane2d.Color;
        that.CanvasContext.fill();

    };

    this.RegionContains = function (region, location) {
        var lastPoint = region.Vertices[region.Vertices.length - 1];
        var isInside = false;
        var x = location[2];
        for (var i = 0; i < region.Vertices.length; i++) {
            var x1 = lastPoint[2];
            var x2 = region.Vertices[i][2];
            var dx = x2 - x1;

            if ((x1 <= x && x2 > x) || (x1 >= x && x2 < x)) {
                var grad = (region.Vertices[i][0] - lastPoint[0]) / dx;
                var intersectAtLat = lastPoint[0] + ((x - x1) * grad);

                if (intersectAtLat > location[0]) {
                    isInside = !isInside;
                }
            }

            lastPoint = region.Vertices[i];
        }

        return isInside;
    };

    this.SortByLeastZ = function (a, b) {

        let aX = null, bX = null, aZ = null, bZ = null;
        for (let i = 0; i < a.Vertices.length; i++) {
            if (aX === null || Math.abs(a.Vertices[i][0]) < aX) {
                aX = Math.abs(a.Vertices[i][0]);
            }

            if (a.Vertices[i][2] >= 0 && (aZ === null || a.Vertices[i][2] < aZ)) {
                aZ = a.Vertices[i][2];
            }
        }

        for (let i = 0; i < b.Vertices.length; i++) {
            if (bX === null || Math.abs(b.Vertices[i][0]) < bX) {
                bX = Math.abs(b.Vertices[i][0]);
            }

            if (b.Vertices[i][2] >= 0 && (bZ === null || b.Vertices[i][2] < bZ)) {
                bZ = b.Vertices[i][2];
            }
        }

        return aZ === null && bZ === null ? 0
            : aZ === null && bZ !== null ? 1
                : aZ !== null && bZ === null ? -1
                    : aZ < bZ ? 1
                        : aZ === bZ && aX < bX ? 1
                            : aZ === bZ && aX > bX ? 1
                                : aZ === bZ && aX === bX ? 0
                                    : -1;
    };

    this.Render = function () {

        // If we don't clear out the canvas, old frames will still show.
        that.CanvasContext.fillStyle = "rgb(0,0,0)";
        that.CanvasContext.fillRect(0, 0, that.ScreenWidth, that.ScreenHeight);

        // Get camera relative 3D coordinates.
        let cameraRelative3DPlanes = [];
        for (let i = 0; i < that.Planes.length; i++) {

            // Because planes are stored in global coordinates.
            let plane3d = that.GetLocalCoordinates(that.Planes[i]);

            // Get the camera's field of view. Ignoring Y.
            let cameraFieldOfView = {
                Vertices: [
                    [0, null, 0],
                    [-1 * that.Camera.DrawDistance * Math.tan(that.Camera.XFieldOfView), null, that.Camera.DrawDistance],
                    [that.Camera.DrawDistance * Math.tan(that.Camera.XFieldOfView), null, that.Camera.DrawDistance]
                ]
            };

            // Does plane have at least one vertex in the camera's field of view?
            let hasVertexInFront = false;
            for (let j = 0; j < plane3d.Vertices.length; j++) {
                if (that.RegionContains(cameraFieldOfView, plane3d.Vertices[j])) {
                    hasVertexInFront = true;
                    break;
                }
            }

            // Plane is visible. Store it.
            if (hasVertexInFront) {
                cameraRelative3DPlanes.push(plane3d);
            }

        }

        // Sort them by lowest distance positive vertex.
        cameraRelative3DPlanes.sort(that.SortByLeastZ);

        // Get camera relative 2D coordinates.
        let cameraRelative2DPlanes = [];
        for (let i = 0; i < cameraRelative3DPlanes.length; i++) {

            let plane2d = {
                Vertices: [],
                Color: cameraRelative3DPlanes[i].Color
            };

            // Calculate 2D vertices
            for (let j = 0; j < cameraRelative3DPlanes[i].Vertices.length; j++) {

                let vertex2d = that.Calc3DPointIn2D(cameraRelative3DPlanes[i].Vertices[j]);
                plane2d.Vertices.push(vertex2d);

            }

            cameraRelative2DPlanes.push(plane2d);

        }

        // Draw 2D planes
        for (let i = 0; i < cameraRelative2DPlanes.length; i++) {

            that.DrawPlaneIn2D(cameraRelative2DPlanes[i]);

        }

    };

    this.ExecuteMoveQueue = function () {

        if (that.MoveQueue.length > 0) {
            if (that.MoveQueue[0].Status === 'Complete') {
                that.MoveQueue.shift();
            }
            else if (that.MoveQueue[0].Status === 'Not Started') {
                that.MoveQueue[0].Status = 'Executing';
                that.MoveQueue[0].Move();
            }

            // If status is 'Executing' don't do anything.
        }
    };

};


text:
package proguard.obfuscate;

import proguard.classfile.*;
import proguard.classfile.attribute.*;
import proguard.classfile.attribute.visitor.AttributeVisitor;
import proguard.classfile.util.*;
import proguard.classfile.visitor.*;

import java.io.PrintStream;

/**
 * This ClassVisitor prints out the renamed classes and class members with
 * their old names and new names.
 *
 * @see ClassRenamer
 *
 * @author Eric Lafortune
 */
public class MappingPrinter
extends      SimplifiedVisitor
implements   ClassVisitor,
             MemberVisitor,
             AttributeVisitor
{
    private final PrintStream ps;

    /**
     * Creates a new MappingPrinter that prints to System.out.
     */
    public MappingPrinter()
    {
        this(System.out);
    }

    /**
     * Creates a new MappingPrinter that prints to the given stream.
     * @param printStream the stream to which to print
     */
    public MappingPrinter(PrintStream printStream)
    {
        this.ps = printStream;
    }

    // Implementations for ClassVisitor.

    public void visitProgramClass(ProgramClass programClass)
    {
        String name    = programClass.getName();
        String newName = ClassObfuscator.newClassName(programClass);

        ps.println(ClassUtil.externalClassName(name) +
                   " -> " +
                   ClassUtil.externalClassName(newName) +
                   ":");

        // Print out the class members.
        programClass.fieldsAccept(this);
        programClass.methodsAccept(this);
    }

    // Implementations for MemberVisitor.

    public void visitProgramField(ProgramClass programClass, ProgramField programField)
    {
        String newName = MemberObfuscator.newMemberName(programField);
        if (newName != null)
        {
            ps.println("    " +
                       ClassUtil.externalFullFieldDescription(
                           0,
                           programField.getName(programClass),
                           programField.getDescriptor(programClass)) +
                       " -> " +
                       newName);
        }
    }

    public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
    {
        // Special cases: <clinit> and <init> are always kept unchanged.
        // We can ignore them here.
        String name = programMethod.getName(programClass);
        if (ClassUtil.isInitializer(name))
        {
            return;
        }

        String newName = MemberObfuscator.newMemberName(programMethod);
        if (newName != null)
        {
            ps.print("    ");
            programMethod.attributesAccept(programClass, this);
            ps.println(ClassUtil.externalFullMethodDescription(
                           programClass.getName(),
                           0,
                           programMethod.getName(programClass),
                           programMethod.getDescriptor(programClass)) +
                       " -> " +
                       newName);
        }
    }

    // Implementations for AttributeVisitor.

    public void visitAnyAttribute(Clazz clazz, Attribute attribute) {}

    public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute)
    {
        codeAttribute.attributesAccept(clazz, method, this);
    }

    public void visitLineNumberTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberTableAttribute lineNumberTableAttribute)
    {
        ps.print(lineNumberTableAttribute.getLowestLineNumber() + ":" +
                 lineNumberTableAttribute.getHighestLineNumber() + ":");
    }
}


text:
package com.distelli.europa.filters;

import com.distelli.europa.EuropaRequestContext;
import com.distelli.europa.models.SslSettings;
import com.distelli.webserver.RequestFilter;
import com.distelli.webserver.RequestFilterChain;
import com.distelli.webserver.WebConstants;
import com.distelli.webserver.WebResponse;
import lombok.extern.log4j.Log4j;

import javax.inject.Inject;
import javax.inject.Provider;

@Log4j
public class ForceHttpsFilter implements RequestFilter<EuropaRequestContext>
{
    @Inject
    protected Provider<SslSettings> _sslSettingsProvider;
    @Inject
    private HttpAlwaysAllowedPaths _httpAlwaysAllowedPaths;

    public ForceHttpsFilter()
    {

    }

    @Override
    public WebResponse filter(EuropaRequestContext requestContext, RequestFilterChain next)
    {
        String protocol = requestContext.getProto();
        String path = requestContext.getPath();
        // The health check endpoint needs to work over HTTP
        if(protocol.equalsIgnoreCase("http") && !_httpAlwaysAllowedPaths.isHttpAlwaysAllowedPath(path)) {
            SslSettings sslSettings = _sslSettingsProvider.get();
            if (sslSettings != null && sslSettings.getForceHttps()) {
                StringBuilder newLocation = new StringBuilder();
                newLocation.append("https://");
                String hostName = sslSettings.getDnsName();
                if (null == hostName) {
                    hostName = requestContext.getHost("");
                }
                newLocation.append(hostName);
                newLocation.append(requestContext.getOriginalPath());
                if (null != requestContext.getQueryString()) {
                    newLocation.append("?");
                    newLocation.append(requestContext.getQueryString());
                }
                WebResponse redirectResponse = new WebResponse(307);
                redirectResponse.setResponseHeader(WebConstants.LOCATION_HEADER, newLocation.toString());
                return redirectResponse;
            }
        }
        return next.filter(requestContext);
    }
}


text:
/**
 * SQL query to retrieve information from the 'user' table about a set of users.
 */
 SELECT
 	user_id,
    user_name,
    user_registration,
    user_editcount
 FROM
 	user
 WHERE
    user_id IN (?);


text:
require 'spec_helper'

describe BalanceSheetController, :js => true do
  self.use_transactional_fixtures = false
  fixtures :users, :accounts, :preferences
  set_fixture_class  :accounts => Account::Base

  include_context "太郎 logged in"

  let(:target_date) {Date.today >> 1}
  before do
    Deal::Base.destroy_all
    find('#header_menu').click_link '家計簿'
    click_link '貸借対照表'
  end

  describe "カレンダー(翌月)のクリック" do
    before do
      find("#month_#{target_date.year}_#{target_date.month}").click_link("#{target_date.month}月")
    end
    it do
      page.should have_content("#{target_date.year}年#{target_date.month}月末日の貸借対照表")
    end
  end

end


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Form Helper : CodeIgniter User Guide</title>

<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />

<meta http-equiv='expires' content='-1' />
<meta http-equiv= 'pragma' content='no-cache' />
<meta name='robots' content='all' />
<meta name='author' content='ExpressionEngine Dev Team' />
<meta name='description' content='CodeIgniter User Guide' />

CodeIgniter User Guide Version 2.2.6

Table of Contents Page

CodeIgniter Home  ›
User Guide Home  ›
Form Helper

<form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide  <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" /> <input type="submit" class="submit" name="sa" value="Go" /></form>

Form Helper

The Form Helper file contains functions that assist in working with forms.

Loading this Helper

This helper is loaded using the following code:

$this->load->helper('form');

The following functions are available:

form_open()

Creates an opening form tag with a base URL built from your config preferences.  It will optionally let you
add form attributes and hidden input fields, and will always add the attribute accept-charset based on the charset value in your config file.

The main benefit of using this tag rather than hard coding your own HTML is that it permits your site to be more portable
in the event your URLs ever change.

Here's a simple example:

echo form_open('email/send');

The above example would create a form that points to your base URL plus the "email/send" URI segments, like this:

<form method="post" accept-charset="utf-8" action="http:/example.com/index.php/email/send" />

Adding Attributes

Attributes can be added by passing an associative array to the second parameter, like this:

$attributes = array('class' => 'email', 'id' => 'myform');

echo form_open('email/send', $attributes);

The above example would create a form similar to this:

<form method="post" accept-charset="utf-8" action="http:/example.com/index.php/email/send"  class="email"  id="myform" />

Adding Hidden Input Fields

Hidden fields can be added by passing an associative array to the third parameter, like this:

$hidden = array('username' => 'Joe', 'member_id' => '234');

echo form_open('email/send', '', $hidden);

The above example would create a form similar to this:

<form method="post" accept-charset="utf-8" action="http:/example.com/index.php/email/send">

<input type="hidden" name="username" value="Joe" />

<input type="hidden" name="member_id" value="234" />

form_open_multipart()

This function is absolutely identical to the <dfn>form_open()</dfn> tag above except that it adds a multipart attribute,
which is necessary if you would like to use the form to upload files with.

form_hidden()

Lets you generate hidden input fields.  You can either submit a name/value string to create one field:

form_hidden('username', 'johndoe');

// Would produce:

<input type="hidden" name="username" value="johndoe" />

Or you can submit an associative array to create multiple fields:

$data = array(

              'name'  => 'John Doe',

              'email' => 'john@example.com',

              'url'   => 'http://example.com'

            );

echo form_hidden($data);

// Would produce:

<input type="hidden" name="name" value="John Doe" />

<input type="hidden" name="email" value="john@example.com" />

<input type="hidden" name="url" value="http://example.com" />

form_input()

Lets you generate a standard text input field.  You can minimally pass the field name and value in the first
and second parameter:

echo form_input('username', 'johndoe');

Or you can pass an associative array containing any data you wish your form to contain:

$data = array(

              'name'        => 'username',

              'id'          => 'username',

              'value'       => 'johndoe',

              'maxlength'   => '100',

              'size'        => '50',

              'style'       => 'width:50%',

            );

echo form_input($data);

// Would produce:

<input type="text" name="username" id="username" value="johndoe" maxlength="100" size="50" style="width:50%" />

If you would like your form to contain some additional data, like Javascript, you can pass it as a string in the
third parameter:

$js = 'onClick="some_function()"';

echo form_input('username', 'johndoe', $js);

form_password()

This function is identical in all respects to the <dfn>form_input()</dfn> function above
except that is sets it as a "password" type.

form_upload()

This function is identical in all respects to the <dfn>form_input()</dfn> function above
except that is sets it as a "file" type, allowing it to be used to upload files.

form_textarea()

This function is identical in all respects to the <dfn>form_input()</dfn> function above
except that it generates a "textarea" type. Note: Instead of the "maxlength" and "size" attributes in the above
example, you will instead specify "rows" and "cols".

form_dropdown()

Lets you create a standard drop-down field.  The first parameter will contain the name of the field,
the second parameter will contain an associative array of options, and the third parameter will contain the
value you wish to be selected.  You can also pass an array of multiple items through the third parameter, and CodeIgniter will create a multiple select for you. Example:

$options = array(

                  'small'  => 'Small Shirt',

                  'med'    => 'Medium Shirt',

                  'large'   => 'Large Shirt',

                  'xlarge' => 'Extra Large Shirt',

                );

$shirts_on_sale = array('small', 'large');

echo form_dropdown('shirts', $options, 'large');

// Would produce:

<select name="shirts">

<option value="small">Small Shirt</option>

<option value="med">Medium  Shirt</option>

<option value="large" selected="selected">Large Shirt</option>

<option value="xlarge">Extra Large Shirt</option>

</select>

echo form_dropdown('shirts', $options, $shirts_on_sale);

// Would produce:

<select name="shirts" multiple="multiple">

<option value="small" selected="selected">Small Shirt</option>

<option value="med">Medium  Shirt</option>

<option value="large" selected="selected">Large Shirt</option>

<option value="xlarge">Extra Large Shirt</option>

</select>

If you would like the opening <select> to contain additional data, like an id attribute or JavaScript, you can pass it as a string in the
fourth parameter:

$js = 'id="shirts" onChange="some_function();"';

echo form_dropdown('shirts', $options, 'large', $js);

If the array passed as $options is a multidimensional array, form_dropdown() will produce an <optgroup> with the array key as the label.

form_multiselect()

Lets you create a standard multiselect field.  The first parameter will contain the name of the field,
the second parameter will contain an associative array of options, and the third parameter will contain the
value or values you wish to be selected.  The parameter usage is identical to using form_dropdown() above,
except of course that the name of the field will need to use POST array syntax, e.g. <samp>foo[]</samp>.

form_fieldset()

Lets you generate fieldset/legend fields.

echo form_fieldset('Address Information');

echo "<p>fieldset content here</p>\n";

echo form_fieldset_close();

// Produces

<fieldset>

<legend>Address Information</legend>

<p>form content here</p>

</fieldset>

Similar to other functions, you can submit an associative array in the second parameter if you prefer to set additional attributes.

$attributes = array('id' => 'address_info', 'class' => 'address_info');

    echo form_fieldset('Address Information', $attributes);

echo "<p>fieldset content here</p>\n";

echo form_fieldset_close();

// Produces

<fieldset id="address_info" class="address_info">

<legend>Address Information</legend>

<p>form content here</p>

</fieldset>

form_fieldset_close()

Produces a closing </fieldset> tag.  The only advantage to using this function is it permits you to pass data to it
    which will be added below the tag.  For example:

$string = "</div></div>";

echo form_fieldset_close($string);

// Would produce:

</fieldset>

</div></div>

form_checkbox()

Lets you generate a checkbox field. Simple example:

echo form_checkbox('newsletter', 'accept', TRUE);

// Would produce:

<input type="checkbox" name="newsletter" value="accept" checked="checked" />

The third parameter contains a boolean TRUE/FALSE to determine whether the box should be checked or not.

Similar to the other form functions in this helper, you can also pass an array of attributes to the function:

$data = array(

    'name'        => 'newsletter',

    'id'          => 'newsletter',

    'value'       => 'accept',

    'checked'     => TRUE,

    'style'       => 'margin:10px',

    );

echo form_checkbox($data);

// Would produce:

<input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px" />

As with other functions, if you would like the tag to contain  additional data, like JavaScript, you can pass it as a string in the
fourth parameter:

$js = 'onClick="some_function()"';

 echo form_checkbox('newsletter', 'accept', TRUE, $js)

form_radio()

This function is identical in all respects to the <dfn>form_checkbox()</dfn> function above except that is sets it as a "radio" type.

form_submit()

Lets you generate a standard submit button. Simple example:

echo form_submit('mysubmit', 'Submit Post!');

// Would produce:

<input type="submit" name="mysubmit" value="Submit Post!" />

Similar to other functions, you can submit an associative array in the first parameter if you prefer to set your own attributes.
    The third parameter lets you add extra data to your form, like JavaScript.

form_label()

Lets you generate a <label>. Simple example:

echo form_label('What is your Name', 'username');

// Would produce:

<label for="username">What is your Name</label>

Similar to other functions, you can submit an associative array in the third parameter if you prefer to set additional attributes.

$attributes = array(

    'class' => 'mycustomclass',

    'style' => 'color: #000;',

);

    echo form_label('What is your Name', 'username', $attributes);

// Would produce:

<label for="username" class="mycustomclass" style="color: #000;">What is your Name</label>

form_reset()

Lets you generate a standard reset button. Use is identical to <dfn>form_submit()</dfn>.

form_button()

Lets you generate a standard button element. You can minimally pass the button name and content in the first and second parameter:

echo form_button('name','content');

// Would produce

<button name="name" type="button">Content</button>

Or you can pass an associative array containing any data you wish your form to contain:

$data = array(

    'name' => 'button',

    'id' => 'button',

    'value' => 'true',

    'type' => 'reset',

    'content' => 'Reset'

);

echo form_button($data);

// Would produce:

<button name="button" id="button" value="true" type="reset">Reset</button>

If you would like your form to contain some additional data, like JavaScript, you can pass it as a string in the third parameter:

$js = 'onClick="some_function()"';

echo form_button('mybutton', 'Click Me', $js);

form_close()

Produces a closing </form> tag.  The only advantage to using this function is it permits you to pass data to it
which will be added below the tag.  For example:

$string = "</div></div>";

echo form_close($string);

// Would produce:

</form>

</div></div>

form_prep()

Allows you to safely use HTML and characters such as quotes within form elements without breaking out of the form.  Consider this example:

$string = 'Here is a string containing "quoted" text.';

<input type="text" name="myform" value="<var>$string</var>" />

Since the above string contains a set of quotes it will cause the form to break.
The form_prep function converts HTML so that it can be used safely:

<input type="text" name="myform" value="<var><?php echo form_prep($string); ?></var>" />

Note: If you use any of the form helper functions listed in this page the form
values will be prepped automatically, so there is no need to call this function. Use it only if you are
creating your own form elements.

set_value()

Permits you to set the value of an input form or textarea. You must supply the field name via the first parameter of the function.
The second (optional) parameter allows you to set a default value for the form. Example:

<input type="text" name="quantity" value="<dfn><?php echo set_value('quantity', '0'); ?></dfn>" size="50" />

The above form will show "0" when loaded for the first time.

set_select()

If you use a <dfn><select></dfn> menu, this function permits you to display the menu item that was selected.  The first parameter
must contain the name of the select menu, the second parameter must contain the value of
each item, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE).

Example:

<select name="myselect">

<option value="one" <dfn><?php echo  set_select('myselect', 'one', TRUE); ?></dfn> >One</option>

<option value="two" <dfn><?php echo  set_select('myselect', 'two'); ?></dfn> >Two</option>

<option value="three" <dfn><?php echo  set_select('myselect', 'three'); ?></dfn> >Three</option>

</select>

set_checkbox()

Permits you to display a checkbox in the state it was submitted.  The first parameter
must contain the name of the checkbox, the second parameter must contain its value, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE). Example:

<input type="checkbox" name="mycheck" value="1" <dfn><?php echo set_checkbox('mycheck', '1'); ?></dfn> />

<input type="checkbox" name="mycheck" value="2" <dfn><?php echo set_checkbox('mycheck', '2'); ?></dfn> />

set_radio()

Permits you to display radio buttons in the state they were submitted. This function is identical to the set_checkbox() function above.

<input type="radio" name="myradio" value="1" <dfn><?php echo  set_radio('myradio', '1', TRUE); ?></dfn> />

<input type="radio" name="myradio" value="2" <dfn><?php echo  set_radio('myradio', '2'); ?></dfn> />

Previous Topic:  File Helper
   ·
Top of Page   ·
User Guide Home   ·
Next Topic:  HTML Helper

CodeIgniter  ·  Copyright © 2006 - 2014  ·  EllisLab, Inc.  ·  Copyright © 2014 - 2015  ·  British Columbia Institute of Technology


text:
//
//  Generated by the J2ObjC translator.  DO NOT EDIT!
//  source: ./core/src/java/org/apache/lucene/LucenePackage.java
//

#include "J2ObjC_header.h"

#pragma push_macro("INCLUDE_ALL_OrgApacheLuceneLucenePackage")
#ifdef RESTRICT_OrgApacheLuceneLucenePackage
#define INCLUDE_ALL_OrgApacheLuceneLucenePackage 0
#else
#define INCLUDE_ALL_OrgApacheLuceneLucenePackage 1
#endif
#undef RESTRICT_OrgApacheLuceneLucenePackage

#if __has_feature(nullability)
#pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wnullability"
#pragma GCC diagnostic ignored "-Wnullability-completeness"
#endif

#if !defined (OrgApacheLuceneLucenePackage_) && (INCLUDE_ALL_OrgApacheLuceneLucenePackage || defined(INCLUDE_OrgApacheLuceneLucenePackage))
#define OrgApacheLuceneLucenePackage_

@class JavaLangPackage;

/*!
 @brief Lucene's package information, including version.
 */
@interface OrgApacheLuceneLucenePackage : NSObject

#pragma mark Public

/*!
 @brief Return Lucene's package, including version information.
 */
+ (JavaLangPackage *)get;

@end

J2OBJC_EMPTY_STATIC_INIT(OrgApacheLuceneLucenePackage)

FOUNDATION_EXPORT JavaLangPackage *OrgApacheLuceneLucenePackage_get(void);

J2OBJC_TYPE_LITERAL_HEADER(OrgApacheLuceneLucenePackage)

#endif

#if __has_feature(nullability)
#pragma clang diagnostic pop
#endif
#pragma pop_macro("INCLUDE_ALL_OrgApacheLuceneLucenePackage")


text:
var vfs = require('vinyl-fs'),
    phpConfig = require('../'),
    through = require('through2'),
    options = {
        filename: 'config.php',
        openTag: '<?php',
        closeTag: '',
        define: false //Set true to use define(); instead $variables
    };

vfs.src('./.configrc')
    .pipe(phpConfig(options))
    .pipe(vfs.dest('./config/'));


text:
package com.github.cirorizzo.whitsquare.presenter;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.support.annotation.NonNull;

import com.github.cirorizzo.whitsquare.BuildConfig;
import com.github.cirorizzo.whitsquare.R;
import com.github.cirorizzo.whitsquare.model.Venue;
import com.github.cirorizzo.whitsquare.model.Venues;
import com.github.cirorizzo.whitsquare.view.MainViewInterface;

import java.io.IOException;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

public class WhitSquarePresenterImpl implements WhitSquarePresenter {
    private final String TAG = WhitSquarePresenterImpl.class.getSimpleName();

    private AtomicBoolean isExecuting;
    private OkHttpClient client;
    private MainViewInterface mainViewInterface;

    public WhitSquarePresenterImpl() {
        isExecuting = new AtomicBoolean(false);
        client = new OkHttpClient();
    }

    @Override
    public void connect(@NonNull MainViewInterface mainViewInterface) {
        this.mainViewInterface = mainViewInterface;
    }

    @Override
    @NonNull
    public void getExplore(final Context context, String place) {
        if (isConnected(context)) {

            if (isExecuting.get() == false) {

                isExecuting.set(true);

                final Request request = new Request.Builder()
                        .url(getExploreURL(place))
                        .build();

                client.newCall(request).enqueue(new Callback() {
                    @Override
                    public void onFailure(Call call, IOException e) {
                        isExecuting.set(false);
                        setMessageUI(context.getString(R.string.general_network_error) + e.getMessage());
                    }

                    @Override
                    public void onResponse(Call call, Response response) throws IOException {
                        isExecuting.set(false);

                        if (!response.isSuccessful()) {
                            setMessageUI(getMessageErrore(context, response.code()));
                        } else {
                            // Deserializing Data
                            List<Venue> venues = new Venues(context).setVenues(response.body().charStream());
                            if (!venues.isEmpty()) {
                                mainViewInterface.setData(venues);
                            } else {
                                setMessageUI(context.getString(R.string.no_venues_found));
                            }
                        }
                    }
                });
            }
        } else {
            setMessageUI(context.getString(R.string.not_connected));
        }
    }

    public String getExploreURL(@NonNull String place) {
        return String.format("%s?client_id=%s&client_secret=%s&v=20130815&near=%s",
                BuildConfig.EXPLORE_API_ENDPOINT,
                BuildConfig.CLIENT_ID,
                BuildConfig.CLIENT_SECRET,
                place);
    }

    private void setMessageUI(String message) {
        mainViewInterface.setMessage(message);
    }

    private String getMessageErrore(Context context, int responseCode) {
        if (responseCode == 400) {
            return context.getString(R.string.error_code_400);
        } else if (responseCode == 500) {
            return context.getString(R.string.error_code_500);
        }

        return context.getResources().getString(R.string.error_code_4xx);
    }

    private boolean isConnected(Context context) {
        ConnectivityManager cm =
                (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);

        NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
        return activeNetwork != null &&
                activeNetwork.isConnectedOrConnecting();
    }
}


text:
using System.Collections.Generic;
using System.Linq;
using UnityEngine.Experimental.Rendering.LWRP.LibTessDotNet;

namespace UnityEngine.Experimental.Rendering.LWRP
{
    internal static class LightUtility
    {
        public static bool CheckForChange<T>(T a, ref T b)
        {
            bool changed = !Equals(a,b);
            b = a;
            return changed;
        }

        public static Bounds CalculateBoundingSphere(ref Vector3[] vertices)
        {
            Bounds localBounds = new Bounds();

            Vector3 minimum = new Vector3(float.MaxValue, float.MaxValue);
            Vector3 maximum = new Vector3(float.MinValue, float.MinValue);
            for (int i = 0; i < vertices.Length; i++)
            {
                Vector3 vertex = vertices[i];
                minimum.x = vertex.x < minimum.x ? vertex.x : minimum.x;
                minimum.y = vertex.y < minimum.y ? vertex.y : minimum.y;
                maximum.x = vertex.x > maximum.x ? vertex.x : maximum.x;
                maximum.y = vertex.y > maximum.y ? vertex.y : maximum.y;
            }

            localBounds.max = maximum;
            localBounds.min = minimum;

            return localBounds;
        }

        // Takes in a mesh that
        public static Bounds GenerateParametricMesh(ref Mesh mesh, float radius, Vector2 falloffOffset, float angle, int sides, float feathering, Color color, float volumeOpacity)
        {
            if (mesh == null)
                mesh = new Mesh();

            float angleOffset = Mathf.PI / 2.0f + Mathf.Deg2Rad * angle;
            if (sides < 3)
            {
                radius = 0.70710678118654752440084436210485f * radius;
                sides = 4;
            }

            if(sides == 4)
            {
                angleOffset = Mathf.PI / 4.0f + Mathf.Deg2Rad * angle;
            }

            // Return a shape with radius = 1
            Vector3[] vertices;
            int[] triangles;
            Color[] colors;
            Vector4[] volumeColors;

            int centerIndex;
            if (feathering <= 0.0f || radius == 0)
            {
                vertices = new Vector3[1 + sides];
                triangles = new int[3 * sides];
                colors = new Color[1 + sides];
                volumeColors = new Vector4[1 + sides];
                centerIndex = sides;
            }
            else
            {
                vertices = new Vector3[1 + 2 * sides];
                colors = new Color[1 + 2 * sides];
                triangles = new int[3 * 3 * sides];
                volumeColors = new Vector4[1 + 2 * sides];
                centerIndex = 2 * sides;
            }

            color.a = 1;
            Vector3 featherOffset = new Vector3(falloffOffset.x, falloffOffset.y);
            Color transparentColor = new Color(color.r, color.g, color.b, 0);
            Color volumeColor = new Vector4(1, 1, 1, volumeOpacity);
            vertices[centerIndex] = Vector3.zero;
            colors[centerIndex] = color;
            volumeColors[centerIndex] = volumeColor;
            float radiansPerSide = 2 * Mathf.PI / sides;

            bool createSimpleShape = false;
            if (radius <= 0 || feathering <= 0)
            {
                color = transparentColor;
                if(radius == 0)
                    radius = feathering;
                createSimpleShape = true;
            }

            for (int i = 0; i < sides; i++)
            {
                float endAngle = (i + 1) * radiansPerSide;
                Vector3 endPoint = new Vector3(radius * Mathf.Cos(endAngle + angleOffset), radius * Mathf.Sin(endAngle + angleOffset), 0);

                int vertexIndex;
                if(createSimpleShape)
                {
                    vertexIndex = i % sides;
                    vertices[vertexIndex] = endPoint;
                    colors[vertexIndex] = color;
                    volumeColors[vertexIndex] = volumeColor;

                    int triangleIndex = 3 * i;
                    triangles[triangleIndex] = (i + 1) % sides;
                    triangles[triangleIndex + 1] = i;
                    triangles[triangleIndex + 2] = centerIndex;
                }
                else
                {
                    Vector3 endSplitPoint = endPoint + feathering * Vector3.Normalize(endPoint);
                    vertexIndex = (2 * i + 2) % (2 * sides);

                    vertices[vertexIndex] = endSplitPoint + featherOffset;
                    vertices[vertexIndex + 1] = endPoint;

                    colors[vertexIndex] = transparentColor;
                    colors[vertexIndex + 1] = color;
                    volumeColors[vertexIndex] = volumeColor;
                    volumeColors[vertexIndex + 1] = volumeColor;

                    // Triangle 1 (Tip)
                    int triangleIndex = 9 * i;
                    triangles[triangleIndex] = vertexIndex + 1;
                    triangles[triangleIndex + 1] = 2 * i + 1;
                    triangles[triangleIndex + 2] = centerIndex;

                    // Triangle 2 (Upper Top Left)
                    triangles[triangleIndex + 3] = vertexIndex;
                    triangles[triangleIndex + 4] = 2 * i;
                    triangles[triangleIndex + 5] = 2 * i + 1;

                    // Triangle 2 (Bottom Top Left)
                    triangles[triangleIndex + 6] = vertexIndex + 1;
                    triangles[triangleIndex + 7] = vertexIndex;
                    triangles[triangleIndex + 8] = 2 * i + 1;
                }
            }

            mesh.Clear();
            mesh.vertices = vertices;
            mesh.colors = colors;
            mesh.triangles = triangles;
            mesh.tangents = volumeColors;

            return CalculateBoundingSphere(ref vertices);
        }

        public static Bounds GenerateSpriteMesh(ref Mesh mesh, Sprite sprite, Color color, float volumeOpacity, float scale)
        {
            if (mesh == null)
                mesh = new Mesh();

            if (sprite != null)
            {
                Vector2[] vertices2d = sprite.vertices;
                Vector3[] vertices3d = new Vector3[vertices2d.Length];
                Color[] colors = new Color[vertices2d.Length];
                Vector4[] volumeColor = new Vector4[vertices2d.Length];

                ushort[] triangles2d = sprite.triangles;
                int[] triangles3d = new int[triangles2d.Length];

                Vector3 center = 0.5f * scale * (sprite.bounds.min + sprite.bounds.max);

                for (int vertexIdx = 0; vertexIdx < vertices2d.Length; vertexIdx++)
                {
                    Vector3 pos = new Vector3(vertices2d[vertexIdx].x, vertices2d[vertexIdx].y) - center;
                    vertices3d[vertexIdx] = scale * pos;
                    colors[vertexIdx] = color;
                    volumeColor[vertexIdx] = new Vector4(1, 1, 1, volumeOpacity);
                }

                for (int triangleIdx = 0; triangleIdx < triangles2d.Length; triangleIdx++)
                {
                    triangles3d[triangleIdx] = (int)triangles2d[triangleIdx];
                }

                mesh.Clear();
                mesh.vertices = vertices3d;
                mesh.uv = sprite.uv;
                mesh.triangles = triangles3d;
                mesh.colors = colors;
                mesh.tangents = volumeColor;

                return CalculateBoundingSphere(ref vertices3d);
            }

            return new Bounds(Vector3.zero, Vector3.zero);
        }

        static List<Vector2> UpdateFeatheredShapeLightMesh(ContourVertex[] contourPoints, int contourPointCount, float feathering)
        {
            List<Vector2> feathered = new List<Vector2>();
            for (int i = 0; i < contourPointCount; ++i)
            {
                int h = (i == 0) ? (contourPointCount - 1) : (i - 1);
                int j = (i + 1) % contourPointCount;

                Vector2 pp = new Vector2(contourPoints[h].Position.X, contourPoints[h].Position.Y);
                Vector2 cp = new Vector2(contourPoints[i].Position.X, contourPoints[i].Position.Y);
                Vector2 np = new Vector2(contourPoints[j].Position.X, contourPoints[j].Position.Y);

                Vector2 cpd = cp - pp;
                Vector2 npd = np - cp;
                if (cpd.magnitude < 0.001f || npd.magnitude < 0.001f)
                    continue;

                Vector2 vl = cpd.normalized;
                Vector2 vr = npd.normalized;

                vl = new Vector2(-vl.y, vl.x);
                vr = new Vector2(-vr.y, vr.x);

                Vector2 va = vl.normalized + vr.normalized;
                Vector2 vn = -va.normalized;

                if (va.magnitude > 0 && vn.magnitude > 0)
                {
                    var t = cp + (vn * feathering);
                    feathered.Add(t);
                }
            }

            return feathered;
        }

        static object InterpCustomVertexData(Vec3 position, object[] data, float[] weights)
        {
            return data[0];
        }

        public static List<Vector2> GetFeatheredShape(Vector3[] shapePath, float feathering)
        {
            int pointCount = shapePath.Length;
            var inputs = new ContourVertex[pointCount];
            for (int i = 0; i < pointCount; ++i)
                inputs[i] = new ContourVertex() { Position = new Vec3() { X = shapePath[i].x, Y = shapePath[i].y }, Data = null };

            var feathered = UpdateFeatheredShapeLightMesh(inputs, pointCount, feathering);
            return feathered;
        }

        public static Bounds GenerateShapeMesh(ref Mesh mesh, Color color, Vector3[] shapePath, Vector2 falloffOffset, float volumeOpacity, float feathering)
        {
            color.a = 1;
            Bounds localBounds;
            Color meshInteriorColor = color;
            Color meshFeatherColor = new Color(color.r, color.g, color.b, 0);

            int pointCount = shapePath.Length;
            var inputs = new ContourVertex[pointCount];
            for (int i = 0; i < pointCount; ++i)
                inputs[i] = new ContourVertex() { Position = new Vec3() { X = shapePath[i].x, Y = shapePath[i].y }, Data = meshFeatherColor };

            var feathered = UpdateFeatheredShapeLightMesh(inputs, pointCount, feathering);
            int featheredPointCount = feathered.Count + pointCount;

            Tess tessI = new Tess();  // Interior
            Tess tessF = new Tess();  // Feathered Edge

            var inputsI = new ContourVertex[pointCount];
            for (int i = 0; i < pointCount - 1; ++i)
            {
                var inputsF = new ContourVertex[4];
                inputsF[0] = new ContourVertex() { Position = new Vec3() { X = shapePath[i].x, Y = shapePath[i].y }, Data = meshInteriorColor };
                inputsF[1] = new ContourVertex() { Position = new Vec3() { X = feathered[i].x, Y = feathered[i].y }, Data = meshFeatherColor };
                inputsF[2] = new ContourVertex() { Position = new Vec3() { X = feathered[i + 1].x, Y = feathered[i + 1].y }, Data = meshFeatherColor };
                inputsF[3] = new ContourVertex() { Position = new Vec3() { X = shapePath[i + 1].x, Y = shapePath[i + 1].y }, Data = meshInteriorColor };
                tessF.AddContour(inputsF, ContourOrientation.Original);

                inputsI[i] = new ContourVertex() { Position = new Vec3() { X = shapePath[i].x, Y = shapePath[i].y }, Data = meshInteriorColor };
            }

            var inputsL = new ContourVertex[4];
            inputsL[0] = new ContourVertex() { Position = new Vec3() { X = shapePath[pointCount - 1].x, Y = shapePath[pointCount - 1].y }, Data = meshInteriorColor };
            inputsL[1] = new ContourVertex() { Position = new Vec3() { X = feathered[pointCount - 1].x, Y = feathered[pointCount - 1].y }, Data = meshFeatherColor };
            inputsL[2] = new ContourVertex() { Position = new Vec3() { X = feathered[0].x, Y = feathered[0].y }, Data = meshFeatherColor };
            inputsL[3] = new ContourVertex() { Position = new Vec3() { X = shapePath[0].x, Y = shapePath[0].y }, Data = meshInteriorColor };
            tessF.AddContour(inputsL, ContourOrientation.Original);

            inputsI[pointCount - 1] = new ContourVertex() { Position = new Vec3() { X = shapePath[pointCount - 1].x, Y = shapePath[pointCount - 1].y }, Data = meshInteriorColor };
            tessI.AddContour(inputsI, ContourOrientation.Original);

            tessI.Tessellate(WindingRule.EvenOdd, ElementType.Polygons, 3, InterpCustomVertexData);
            tessF.Tessellate(WindingRule.EvenOdd, ElementType.Polygons, 3, InterpCustomVertexData);

            var indicesI = tessI.Elements.Select(i => i).ToArray();
            var verticesI = tessI.Vertices.Select(v => new Vector3(v.Position.X, v.Position.Y, 0)).ToArray();
            var colorsI = tessI.Vertices.Select(v => new Color(((Color)v.Data).r, ((Color)v.Data).g, ((Color)v.Data).b, ((Color)v.Data).a)).ToArray();

            var indicesF = tessF.Elements.Select(i => i + verticesI.Length).ToArray();
            var verticesF = tessF.Vertices.Select(v => new Vector3(v.Position.X, v.Position.Y, 0)).ToArray();
            var colorsF = tessF.Vertices.Select(v => new Color(((Color)v.Data).r, ((Color)v.Data).g, ((Color)v.Data).b, ((Color)v.Data).a)).ToArray();

            List<Vector3> finalVertices = new List<Vector3>();
            List<int> finalIndices = new List<int>();
            List<Color> finalColors = new List<Color>();
            finalVertices.AddRange(verticesI);
            finalVertices.AddRange(verticesF);
            finalIndices.AddRange(indicesI);
            finalIndices.AddRange(indicesF);
            finalColors.AddRange(colorsI);
            finalColors.AddRange(colorsF);

            var volumeColors = new Vector4[finalColors.Count];
            for (int i = 0; i < volumeColors.Length; i++)
                volumeColors[i] = new Vector4(1, 1, 1, volumeOpacity);

            Vector3[] vertices = finalVertices.ToArray();
            mesh.Clear();
            mesh.vertices = vertices;
            mesh.tangents = volumeColors;
            mesh.colors = finalColors.ToArray();
            mesh.SetIndices(finalIndices.ToArray(), MeshTopology.Triangles, 0);

            localBounds = CalculateBoundingSphere(ref vertices);

            return localBounds;
        }
    }
}