text:
$(function(){
	$("form.appnitro").data('active_element','');
	var field_highlight_color = $("form.appnitro").data('highlightcolor');

	//attach event handler to all form fields, to highlight the selected list (except for matrix field)
	$("form.appnitro :input").bind('click focus',function(){
		var current_li = $(this).closest("li").not('.matrix').not('.buttons');
		$("form.appnitro").data('active_element',current_li.attr('id'));

		if(current_li.hasClass('highlighted') != true){
			$("form.appnitro li.highlighted").removeClass('highlighted'); //remove any previous highlight

			if(field_highlight_color != ''){
				//if the user goes through fields too fast, we need to make sure to remove the previous highlight coming from previous animation
				current_li.siblings().not('#li_resume_email').stop(); //stop the highlight animation
				current_li.siblings().not('#li_resume_email').css('background-color',''); //remove the remaining color style

				current_li.animate({ backgroundColor: field_highlight_color }, 500, 'swing',function(){
					if(current_li.attr('id') == $("form.appnitro").data('active_element')){
						current_li.addClass('highlighted').css('background-color','');
						current_li.siblings().not('#li_resume_email').css('background-color',''); //remove the remaining color style
					}else{
						current_li.css('background-color','');
					}
				});
			}else{
				//if background pattern/image being used, simply add the highlight class
				current_li.addClass('highlighted').css('background-color','');
			}
		}

	});

	//if the form has file upload field, attach custom submit handler to the form
	//make sure all files are being uploaded prior submitting the form
	if($("#main_body div.file_queue").length > 0){
		$('form.appnitro').submit(function() {

			if($("form.appnitro").data('form_submitting') !== true){

				$("#li_buttons > input[type=submit],#li_buttons > input[type=image]").prop("disabled",true);

				$("form.appnitro").data('form_submitting',true);
				upload_all_files();
				return false;
			}else{
				return true;
			}
		});

	}else{
		$('form.appnitro').submit(function() {
			$("#li_buttons > input[type=submit],#li_buttons > input[type=image]").prop("disabled",true);
		});
	}

	//primary and secondary buttons are being disabled upon submit
	//thus we need to attach additional handler to send the clicked button as hidden variable
	$("#submit_secondary,#submit_img_secondary").click(function(){
		$("#li_buttons").append('<input type="hidden" name="submit_secondary" value="1" />');
	});

	$("#submit_primary,#submit_img_primary").click(function(){
		$("#li_buttons").append('<input type="hidden" name="submit_primary" value="1" />');
	});

	$("#review_submit").click(function(){
		$("#li_buttons").append('<input type="hidden" name="review_submit" value="1" />');
	});

	$("#review_back").click(function(){
		$("#li_buttons").append('<input type="hidden" name="review_back" value="1" />');
	});

	//if the form has resume enabled, attach event handler to the resume checkbox
	if($("#li_resume_checkbox").length > 0){
		$('#element_resume_checkbox').bind('change', function() {

				if($(this).prop("checked") == true){
					//display the email input and change the submit button
					$("#li_resume_email").show();

					//hide all existing buttons
					$("#li_buttons > input").hide();

					//add the save form button
					$("#li_buttons").append('<input type="button" value="' + $("#li_resume_email").data("resumelabel") + '" name="button_save_form" class="button_text" id="button_save_form">');
					$("#button_save_form").click(function(){
						$("#li_buttons").append('<input type="hidden" id="generate_resume_url" name="generate_resume_url" value="1" />');
						$("form.appnitro").submit();
					});

				}else{
					//hide the email input and restore the original submit button
					$("#li_resume_email").hide();

					$("#button_save_form").remove();
					$("#li_buttons > input").show();
				}

				if($("html").hasClass("embed")){
					$.postMessage({mf_iframe_height: $('body').outerHeight(true)}, '*', parent );
				}
		});

		//if the user entered invalid address, the 'data-resumebutton' will contain value 1
		//we need to display the save form button again and hide others
		if($("#li_resume_email").data("resumebutton") == '1'){
			//hide all existing buttons
			$("#li_buttons > input").hide();

			//add the save form button
			$("#li_buttons").append('<input type="button" value="' + $("#li_resume_email").data("resumelabel") + '" name="button_save_form" class="button_text" id="button_save_form">');
			$("#button_save_form").click(function(){
				$("#li_buttons").append('<input type="hidden" id="generate_resume_url" name="generate_resume_url" value="1" />');
				$("form.appnitro").submit();
			});
		}

		//attach additional event handler to the form submit
		$('form.appnitro').submit(function(){
			if($("#li_buttons > input:visible").attr("id") == 'button_save_form'){
				$("#li_buttons").append('<input type="hidden" id="generate_resume_url" name="generate_resume_url" value="1" />');
			}
		});
	}

	//if the form has payment enabled and the total is being displayed into the form, we need to calculate the total
	//and attach event handler to price-assigned fields
	if($(".total_payment").length > 0 && $(".mf_review").length == 0){

		calculate_total_payment();

		//attach event handler on radio buttons with price assigned
		$('#main_body li[data-pricefield="radio"]').delegate('input.radio', 'click', function(e) {
			var selected_radio = $(this);
			var temp = selected_radio.attr("id").split('_');
			var element_id = temp[1];

			var pricedef = selected_radio.data('pricedef');
			if(pricedef == null){
				pricedef = 0;
			}

			var quantity_field   = $("#main_body input[data-quantity_link=element_"+ element_id +"]");
			var current_quantity = 1;

			if(quantity_field.length > 0){
				current_quantity = parseFloat(quantity_field.val());
				if(isNaN(current_quantity) || current_quantity < 0){
					current_quantity = 0;
				}
			}

			$("#li_" + element_id).data("pricevalue",pricedef * current_quantity);
			calculate_total_payment();
		});

		//attach event handler on checkboxes with price assigned
		$('#main_body li[data-pricefield="checkbox"]').delegate('input.checkbox', 'click', function(e) {

			var temp = $(this).attr("id").split('_');
			var element_id = temp[1];

			var child_checkboxes = $("#li_" + element_id + " input.checkbox");
			var total_price = 0;

			child_checkboxes.each(function(index){
				if($(this).data('pricedef') != null && $(this).prop("checked") == true){
					var quantity_field   = $("#main_body input[data-quantity_link="+ $(this).attr("id") +"]");
					var current_quantity = 1;

					if(quantity_field.length > 0){
						current_quantity = parseFloat(quantity_field.val());
						if(isNaN(current_quantity) || current_quantity < 0){
							current_quantity = 0;
						}
					}

					total_price += ($(this).data('pricedef') * current_quantity);
				}
			});

			$("#li_" + element_id).data("pricevalue",total_price);
			calculate_total_payment();
		});

		//attach event handler on dropdown with price assigned
		$('#main_body li[data-pricefield="select"]').delegate('select', 'change', function(e) {
			var temp = $(this).attr("id").split('_');
			var element_id = temp[1];

			var pricedef = $(this).find('option:selected').data('pricedef');

			if(pricedef == null){
				pricedef = 0;
			}

			var quantity_field   = $("#main_body input[data-quantity_link=element_"+ element_id +"]");
			var current_quantity = 1;

			if(quantity_field.length > 0){
				current_quantity = parseFloat(quantity_field.val());
				if(isNaN(current_quantity) || current_quantity < 0){
					current_quantity = 0;
				}
			}

			$("#li_" + element_id).data("pricevalue",pricedef * current_quantity);
			calculate_total_payment();
		});

		//attach event handler to money field (dollar, euro, etc)
		$('#main_body li[data-pricefield="money"]').delegate('input.text','keyup mouseout change', function(e) {
			var temp = $(this).attr("id").split('_');
			var element_id = temp[1];

			var price_value = $("#element_" + element_id + "_1").val() + '.' + $("#element_" + element_id + "_2").val();
			price_value = parseFloat(price_value);
			if(isNaN(price_value)){
				price_value = 0;
			}

			var quantity_field   = $("#main_body input[data-quantity_link=element_"+ element_id +"]");
			var current_quantity = 1;

			if(quantity_field.length > 0){
				current_quantity = parseFloat(quantity_field.val());
				if(isNaN(current_quantity) || current_quantity < 0){
					current_quantity = 0;
				}
			}

			$("#li_" + element_id).data("pricevalue",price_value * current_quantity);
			calculate_total_payment();
		});

		//attach event handler to simple money field (yen)
		$('#main_body li[data-pricefield="money_simple"]').delegate('input.text','keyup mouseout change', function(e) {
			var temp = $(this).attr("id").split('_');
			var element_id = temp[1];

			var price_value = $(this).val();
			price_value = parseFloat(price_value);
			if(isNaN(price_value)){
				price_value = 0;
			}

			var quantity_field   = $("#main_body input[data-quantity_link=element_"+ element_id +"]");
			var current_quantity = 1;

			if(quantity_field.length > 0){
				current_quantity = parseFloat(quantity_field.val());
				if(isNaN(current_quantity) || current_quantity < 0){
					current_quantity = 0;
				}
			}

			$("#li_" + element_id).data("pricevalue",price_value * current_quantity);
			calculate_total_payment();
		});

		//attach event handler to the number field that has 'quantity' enabled
		$("#main_body input[data-quantity_link]").bind('keyup mouseout change', function() {
			var linked_field_id = $(this).data("quantity_link");
			var temp = linked_field_id.split('_');

			var current_quantity = parseFloat($(this).val());
			if(isNaN(current_quantity) || current_quantity < 0){
				current_quantity = 0;
			}

			//find linked field and trigger the event handle for that field, based on the field type
			var linked_field_type = $('#li_' + temp[1]).data("pricefield");

			if(linked_field_type == 'radio'){
				var selected_radio = $("input[name="+ linked_field_id +"]:checked");

				if(selected_radio.length > 0){
					var temp = selected_radio.attr("id").split('_');
					var element_id = temp[1];

					var pricedef = selected_radio.data('pricedef');
					if(pricedef == null){
						pricedef = 0;
					}

					$("#li_" + element_id).data("pricevalue",pricedef * current_quantity);
					calculate_total_payment();
				}

			}else if(linked_field_type == 'select'){

				var element_id = temp[1];
				var pricedef = $('#' + linked_field_id).find('option:selected').data('pricedef');

				if(pricedef == null){
					pricedef = 0;
				}

				$("#li_" + element_id).data("pricevalue",pricedef * current_quantity);
				calculate_total_payment();
			}else if(linked_field_type == 'checkbox'){
				var element_id = temp[1];

				var child_checkboxes = $("#li_" + element_id + " input.checkbox");
				var total_price = 0;

				child_checkboxes.each(function(index){
					if($(this).data('pricedef') != null && $(this).prop("checked") == true){
						var quantity_field   = $("#main_body input[data-quantity_link="+ $(this).attr("id") +"]");
						var current_quantity = 1;

						if(quantity_field.length > 0){
							current_quantity = parseFloat(quantity_field.val());
							if(isNaN(current_quantity) || current_quantity < 0){
								current_quantity = 0;
							}
						}

						total_price += ($(this).data('pricedef') * current_quantity);
					}
				});

				$("#li_" + element_id).data("pricevalue",total_price);
				calculate_total_payment();
			}else if(linked_field_type == 'money'){
				var element_id = temp[1];
				var price_value = $("#element_" + element_id + "_1").val() + '.' + $("#element_" + element_id + "_2").val();

				price_value = parseFloat(price_value);
				if(isNaN(price_value)){
					price_value = 0;
				}

				$("#li_" + element_id).data("pricevalue",price_value * current_quantity);
				calculate_total_payment();
			}else if(linked_field_type == 'money_simple'){
				var element_id = temp[1];
				var price_value = $("#element_" + element_id).val();

				price_value = parseFloat(price_value);
				if(isNaN(price_value)){
					price_value = 0;
				}

				$("#li_" + element_id).data("pricevalue",price_value * current_quantity);
				calculate_total_payment();
			}

		});

		//trigger the event handler on all number fields that has 'quantity' enabled, to initialize the calculation
		$("#main_body input[data-quantity_link]").change();

	}

	//attach event handler to textarea field to handle resizing
	if($("html").hasClass("embed")){
		$("#main_body textarea.textarea").bind('keyup mouseout mousemove change', function() {
			$.postMessage({mf_iframe_height: $('body').outerHeight(true)}, '*', parent );
		});
	}

	//if the password box is being displayed, add the class 'no_guidelines into the main_body
	if($("form.appnitro ul.password").length > 0){
		$("#main_body").addClass('no_guidelines');
	}

	//workaround for mobile safari, to allow tapping on label
	$('form.appnitro label').click(function(){});

	//workaround for any Safari browsers, when the form being embedded
	//we need to set the cookies here
	if($("html").hasClass("embed") && navigator.userAgent.indexOf('Safari') != -1 && document.cookie.indexOf("mf_safari_cookie_fix") < 0){
		$.postMessage({run_safari_cookie_fix: '1'}, '*', parent );
	}

});

/** Payment Functions **/
function calculate_total_payment(){
	var total_payment = 0;

	//get totals from all visible fields (hidden fields due to logic shouldn't be included)
	$("#main_body li[data-pricevalue]:visible").each(function(index){
		total_payment += parseFloat($(this).data('pricevalue'));
	});

	//get totals from all fields intentionally hidden using custom css class "hidden"
	$("#main_body li[data-pricevalue].hidden").each(function(index){
		total_payment += parseFloat($(this).data('pricevalue'));
	});

	total_payment += parseFloat($('.total_payment').data('basetotal'));

	$(".total_payment var").text(total_payment.toFixed(2));
}

/** Date Picker Functions **/
function select_date(dates){
	var ids = $(this).attr("id").split('_');

    $('#element_' + ids[1] + '_1').val(dates.length ? dates[0].getMonth() + 1 : '');
    $('#element_' + ids[1] + '_2').val(dates.length ? dates[0].getDate() : '');
    $('#element_' + ids[1] + '_3').val(dates.length ? dates[0].getFullYear() : '');
    $('#element_' + ids[1] + '_1').change();
}

function select_europe_date(dates){
	var ids = $(this).attr("id").split('_');

    $('#element_' + ids[1] + '_2').val(dates.length ? dates[0].getMonth() + 1 : '');
    $('#element_' + ids[1] + '_1').val(dates.length ? dates[0].getDate() : '');
    $('#element_' + ids[1] + '_3').val(dates.length ? dates[0].getFullYear() : '');
    $('#element_' + ids[1] + '_1').change();
}
/** File Upload Functions **/
function remove_attachment(filename,form_id,element_id,holder_id,is_db_live,key_id){

	var machform_path = '';
	if (typeof __machform_path != 'undefined'){
		machform_path = __machform_path;
	}

	$("#" + holder_id + " > div.cancel img").attr("src", machform_path + "images/loader_small_grey.gif");
	$.ajax({
		   type: "POST",
		   async: true,
		   url: machform_path + "delete_file_upload.php",
		   data: {
				  filename: filename,
				  form_id: form_id,
				  element_id: element_id,
				  holder_id: holder_id,
				  is_db_live: is_db_live,
				  key_id: key_id
				 },
		   cache: false,
		   global: true,
		   dataType: "json",
		   error: function(xhr,text_status,e){
			   //remove the delete progress on error
			   $("#" + holder_id + " > div.cancel img").attr("src",machform_path + "images/icons/delete.png");
			   alert('Error! Unable to delete file.');
		   },
		   success: function(response_data){

			   if(response_data.status == 'ok'){
				   if(is_support_html5_uploader()){
				   	   try{
				   	   		$("#element_" + response_data.element_id).uploadifive('cancel',$("#" + response_data.holder_id).data('file'));
				   	   }catch(e){}
				   	   $("#" + response_data.holder_id).fadeOut("slow",function(){$(this).remove();});
				   }else{
				       $("#" + response_data.holder_id).fadeOut("slow",function(){$(this).remove();});
				   }
			   }else{
				   //unknown error, response json improperly formatted
				  $("#" + holder_id + " > div.cancel img").attr("src",machform_path + "images/icons/delete.png");
				  alert('Error while deleting the file. Please try again.');
			   }

		   } //end on ajax success
	}); //end ajax call

}
function check_upload_queue(element_id,is_multi,queue_limit,alert_message){
	//check for queue limit
	if(is_multi == true){
		var queue_children = $("#element_" + element_id + "_queue").children().not('.uploadifyError');
		if(queue_children.length > queue_limit){
			alert(alert_message);

			for(i=0;i<=queue_children.length;i++){
				if(i>=queue_limit){
					$("#element_" + element_id).uploadifyCancel(queue_children.eq(i).attr('id').slice(-6));
				}
			}
		}
	}
}

function upload_all_files(){
	if(is_support_html5_uploader()){
		$("#main_body input.file").uploadifive('upload');
		if($("#main_body div.uploadifive-queue-item").not('.complete').not('.error').length < 1){
			$('form.appnitro').submit();
		}
	}else{
		$("#main_body div.uploadifyQueueItem").not('.completed').parent().siblings('input.element').eq(0).uploadifyUpload();
		if($("#main_body div.uploadifyQueueItem").not('.completed').length < 1){
			$('form.appnitro').submit();
		}
	}
}

//Check if HTML5 uploader is supported by the browser
function is_support_html5_uploader(){
	if (window.File && window.FileList && window.Blob && (window.FileReader || window.FormData)) {
		return true;
	}else{
		return false;
	}
}

/** Input Range Functions **/
function count_input(element_id,range_limit_by){
	var current_length = 0;

	if(range_limit_by == 'c' || range_limit_by == 'd'){
		current_length = $("#element_" + element_id).val().length;
	}else if(range_limit_by == 'w'){
		current_length = $("#element_" + element_id).val().trim().split(/[\s\.]+/).length; //we consider a word is one or more characters separated by space or dot
	}

	$("#currently_entered_" + element_id).text(current_length);

	return current_length;
}

function limit_input(element_id,range_limit_by,range_max){
	var current_length = count_input(element_id,range_limit_by);

	if(current_length > range_max){
		if(range_limit_by == 'c' || range_limit_by == 'd'){
			$("#element_" + element_id).val($("#element_" + element_id).val().substr(0,range_max));
			$("#currently_entered_" + element_id).text(range_max);
		}else if(range_limit_by == 'w'){
			//for now, we don't limit the words on client side, only server side validation
		}
	}
}

//clear checkbox 'other'
function clear_cb_other(cb_element,element_id){
	if($(cb_element).prop("checked") == false){
		$("#element_" + element_id + "_other").val('');
	}
}


text:
<?php
class Start_Error_Processing extends Start_Error
{
  public static $TYPE = "processing";
}

redpajama_set_name: RedPajamaGithub


text:
function Get-d00mSharePermissions
{
    param
    (
        [cmdletbinding()]
        [parameter(mandatory                      = $true,
                   Position                       = 0,
                   ValueFromPipeline              = $true,
                   ValueFromPipelineByPropertyName= $true)]
        [string[]]$ComputerName,

        [parameteR(mandatory = $true,
                   Position  = 1)]
        [string[]]$ShareName
    )

    begin
    {
        $timer = New-Object -TypeName System.Diagnostics.Stopwatch
        $cmdletName = $MyInvocation.MyCommand.Name
        $timer.Start()
        Write-Verbose -Message ('{0} : Begin execution {1}' -f $cmdletName, (Get-Date))
    }

    process
    {
        foreach ($computer in $ComputerName)
        {
            Write-Verbose -Message ('{0} : {1} : Begin execution' -f $cmdletName, $computer)

            foreach ($s in $ShareName)
            {
                Write-Verbose -Message ('{0} : {1} : Getting {2} share permission settings' -f $cmdletName, $computer, $s)

                try
                {
                    $params = @{Class        = 'Win32_LogicalShareSecuritySetting'
                                Filter       = ("Name='{0}'" -f $s)
                                ComputerName = $computer
                                ErrorAction  = 'Stop'}
                    $shareSecurity = Get-WmiObject @params
                    if ($shareSecurity)
                    {
                        Write-Verbose -Message ('{0} : {1} : Found {2} share' -f $cmdletName, $computer, $s)
                        foreach ($share in $shareSecurity)
                        {
                            $descriptor = $share.GetSecurityDescriptor()

                            Write-Verbose -Message ('{0} : {1} : Iterating through {2} ACLs' -f $cmdletName, $computer, $s)
                            foreach ($dacl in $descriptor.Descriptor.DACL)
                            {
                                $props = @{ComputerName = $computer
                                           ShareName    = $s
                                           Domain       = $dacl.Trustee.Domain
                                           ID           = $dacl.Trustee.Name}

                                $mask = switch ($dacl.AccessMask)
                                {
				                    2032127     {'FullControl'}
				                    1179785     {'Read'}
				                    1180063     {'Read, Write'}
				                    1179817     {'ReadAndExecute'}
				                    -1610612736 {'ReadAndExecuteExtended'}
				                    1245631     {'ReadAndExecute, Modify, Write'}
				                    1180095     {'ReadAndExecute, Write'}
				                    268435456   {'FullControl (Sub Only)'}
				                    default     {$DACL.AccessMask}
                                }
                                $props.Add('Access', $mask)

                                $type = switch ($dacl.AceType)
                                {
                                    0 {'Allow'}
                                    1 {'Deny'}
                                    2 {'Audit'}
                                }
                                $props.Add('AccessType', $type)

                                New-Object -TypeName psobject -Property $props |
                                    Write-Output

                                $mask, $type = $null
                            }
                        }
                    }

                    else
                    {
                        Write-Warning -Message ('{0} : {1} : Could not find share {2}' -f $cmdletName, $computer, $s)
                    }
                }

                catch
                {
                    throw
                }

                Write-Verbose -Message ('{0} : {1} : End {2} execution' -f $cmdletName, $computer, $s)
            }

            Write-Verbose -Message ('{0} : {1} : End execution' -f $cmdletName, $computer)
        }
    }

    end
    {
        $timer.Stop()
        Write-Verbose -Message ('{0} : End execution. {1} ms' -f $cmdletName, $timer.ElapsedMilliseconds)
    }
}


text:
package main

import (
	goflag "flag"
	"fmt"
	"math/rand"
	"os"
	"time"

	"github.com/spf13/cobra"
	"github.com/spf13/pflag"

	utilflag "k8s.io/apiserver/pkg/util/flag"
	"k8s.io/apiserver/pkg/util/logs"

	"github.com/openshift/service-serving-cert-signer/pkg/cmd/apiservicecabundle"
	"github.com/openshift/service-serving-cert-signer/pkg/cmd/operator"
	"github.com/openshift/service-serving-cert-signer/pkg/cmd/servingcertsigner"
)

func main() {
	rand.Seed(time.Now().UTC().UnixNano())

	pflag.CommandLine.SetNormalizeFunc(utilflag.WordSepNormalizeFunc)
	pflag.CommandLine.AddGoFlagSet(goflag.CommandLine)

	logs.InitLogs()
	defer logs.FlushLogs()

	command := NewSSCSCommand()
	if err := command.Execute(); err != nil {
		fmt.Fprintf(os.Stderr, "%v\n", err)
		os.Exit(1)
	}
}

func NewSSCSCommand() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "service-serving-cert-signer",
		Short: "OpenShift service serving cert signer",
		Run: func(cmd *cobra.Command, args []string) {
			cmd.Help()
			os.Exit(1)
		},
	}

	cmd.AddCommand(operator.NewOperator())
	cmd.AddCommand(servingcertsigner.NewController())
	cmd.AddCommand(apiservicecabundle.NewController())

	return cmd
}


text:
define('ace/mode/lsl', ['require', 'exports', 'module' , 'ace/tokenizer', 'ace/mode/lsl_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/text', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle', 'ace/lib/oop'], function(require, exports, module) {

var Tokenizer = require("../tokenizer").Tokenizer;
var Rules = require("./lsl_highlight_rules").LSLHighlightRules;
var Outdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var Range = require("../range").Range;
var TextMode = require("./text").Mode;
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var oop = require("../lib/oop");

var Mode = function() {
    this.$tokenizer = new Tokenizer(new Rules().getRules());
    this.$outdent = new Outdent();
    this.$behaviour = new CstyleBehaviour();
    this.foldingRules = new CStyleFoldMode();
};
oop.inherits(Mode, TextMode);

(function() {

    this.lineCommentStart = ["//"];

    this.blockComment = {
        start: "/*",
        end: "*/"
    };

    this.getNextLineIndent = function(state, line, tab) {
        var indent = this.$getIndent(line);

        var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
        var tokens = tokenizedLine.tokens;
        var endState = tokenizedLine.state;

        if (tokens.length && tokens[tokens.length-1].type === "comment.block.lsl") {
            return indent;
        }

        if (state === "start") {
            var match = line.match(/^.*[\{\(\[]\s*$/);
            if (match) {
                indent += tab;
            }
        }

        return indent;
    };

    this.checkOutdent = function(state, line, input) {
        return this.$outdent.checkOutdent(line, input);
    };

    this.autoOutdent = function(state, doc, row) {
        this.$outdent.autoOutdent(doc, row);
    };

}).call(Mode.prototype);

exports.Mode = Mode;
});

define('ace/mode/lsl_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {

var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;

oop.inherits(LSLHighlightRules, TextHighlightRules);

function LSLHighlightRules() {
    var keywordMapper = this.createKeywordMapper({
        "constant.language.float.lsl" : "DEG_TO_RAD|PI|PI_BY_TWO|RAD_TO_DEG|SQRT2|TWO_PI",
        "constant.language.integer.lsl": "ACTIVE|AGENT|AGENT_ALWAYS_RUN|AGENT_ATTACHMENTS|" +
            "AGENT_AUTOPILOT|AGENT_AWAY|AGENT_BUSY|AGENT_BY_LEGACY_NAME|AGENT_BY_USERNAME|" +
            "AGENT_CROUCHING|AGENT_FLYING|AGENT_IN_AIR|AGENT_LIST_PARCEL|AGENT_LIST_PARCEL_OWNER|" +
            "AGENT_LIST_REGION|AGENT_MOUSELOOK|AGENT_ON_OBJECT|AGENT_SCRIPTED|AGENT_SITTING|" +
            "AGENT_TYPING|AGENT_WALKING|ALL_SIDES|ANIM_ON|ATTACH_AVATAR_CENTER|ATTACH_BACK|" +
            "ATTACH_BELLY|ATTACH_CHEST|ATTACH_CHIN|ATTACH_HEAD|ATTACH_HUD_BOTTOM|" +
            "ATTACH_HUD_BOTTOM_LEFT|ATTACH_HUD_BOTTOM_RIGHT|ATTACH_HUD_CENTER_1|ATTACH_HUD_CENTER_2|" +
            "ATTACH_HUD_TOP_CENTER|ATTACH_HUD_TOP_LEFT|ATTACH_HUD_TOP_RIGHT|ATTACH_LEAR|" +
            "ATTACH_LEFT_PEC|ATTACH_LEYE|ATTACH_LFOOT|ATTACH_LHAND|ATTACH_LHIP|ATTACH_LLARM|" +
            "ATTACH_LLLEG|ATTACH_LSHOULDER|ATTACH_LUARM|ATTACH_LULEG|ATTACH_MOUTH|" +
            "ATTACH_NECK|ATTACH_NOSE|ATTACH_PELVIS|ATTACH_REAR|ATTACH_REYE|ATTACH_RFOOT|" +
            "ATTACH_RHAND|ATTACH_RHIP|ATTACH_RIGHT_PEC|ATTACH_RLARM|ATTACH_RLLEG|" +
            "ATTACH_RSHOULDER|ATTACH_RUARM|ATTACH_RULEG|AVOID_CHARACTERS|AVOID_DYNAMIC_OBSTACLES|" +
            "AVOID_NONE|CAMERA_ACTIVE|CAMERA_BEHINDNESS_ANGLE|CAMERA_BEHINDNESS_LAG|" +
            "CAMERA_DISTANCE|CAMERA_FOCUS|CAMERA_FOCUS_LAG|CAMERA_FOCUS_LOCKED|CAMERA_FOCUS_OFFSET|" +
            "CAMERA_FOCUS_THRESHOLD|CAMERA_PITCH|CAMERA_POSITION|CAMERA_POSITION_LAG|" +
            "CAMERA_POSITION_LOCKED|CAMERA_POSITION_THRESHOLD|CHANGED_ALLOWED_DROP|" +
            "CHANGED_COLOR|CHANGED_INVENTORY|CHANGED_LINK|CHANGED_MEDIA|CHANGED_OWNER|" +
            "CHANGED_REGION|CHANGED_REGION_START|CHANGED_SCALE|CHANGED_SHAPE|CHANGED_TELEPORT|" +
            "CHANGED_TEXTURE|CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES|CHARACTER_AVOIDANCE_MODE|" +
            "CHARACTER_CMD_JUMP|CHARACTER_CMD_SMOOTH_STOP|CHARACTER_CMD_STOP|CHARACTER_DESIRED_SPEED|" +
            "CHARACTER_DESIRED_TURN_SPEED|CHARACTER_LENGTH|CHARACTER_MAX_ACCEL|CHARACTER_MAX_DECEL|" +
            "CHARACTER_MAX_SPEED|CHARACTER_MAX_TURN_RADIUS|CHARACTER_ORIENTATION|" +
            "CHARACTER_RADIUS|CHARACTER_STAY_WITHIN_PARCEL|CHARACTER_TYPE|CHARACTER_TYPE_A|" +
            "CHARACTER_TYPE_B|CHARACTER_TYPE_C|CHARACTER_TYPE_D|CHARACTER_TYPE_NONE|" +
            "CLICK_ACTION_BUY|CLICK_ACTION_NONE|CLICK_ACTION_OPEN|CLICK_ACTION_OPEN_MEDIA|" +
            "CLICK_ACTION_PAY|CLICK_ACTION_PLAY|CLICK_ACTION_SIT|CLICK_ACTION_TOUCH|" +
            "CONTENT_TYPE_ATOM|CONTENT_TYPE_FORM|CONTENT_TYPE_HTML|CONTENT_TYPE_JSON|" +
            "CONTENT_TYPE_LLSD|CONTENT_TYPE_RSS|CONTENT_TYPE_TEXT|CONTENT_TYPE_XHTML|" +
            "CONTENT_TYPE_XML|CONTROL_BACK|CONTROL_DOWN|CONTROL_FWD|CONTROL_LBUTTON|" +
            "CONTROL_LEFT|CONTROL_ML_LBUTTON|CONTROL_RIGHT|CONTROL_ROT_LEFT|CONTROL_ROT_RIGHT|" +
            "CONTROL_UP|DATA_BORN|DATA_NAME|DATA_ONLINE|DATA_PAYINFO|DATA_SIM_POS|" +
            "DATA_SIM_RATING|DATA_SIM_STATUS|DEBUG_CHANNEL|DENSITY|ERR_GENERIC|ERR_MALFORMED_PARAMS|" +
            "ERR_PARCEL_PERMISSIONS|ERR_RUNTIME_PERMISSIONS|ERR_THROTTLED|ESTATE_ACCESS_ALLOWED_AGENT_ADD|" +
            "ESTATE_ACCESS_ALLOWED_AGENT_REMOVE|ESTATE_ACCESS_ALLOWED_GROUP_ADD|ESTATE_ACCESS_ALLOWED_GROUP_REMOVE|" +
            "ESTATE_ACCESS_BANNED_AGENT_ADD|ESTATE_ACCESS_BANNED_AGENT_REMOVE|FORCE_DIRECT_PATH|" +
            "FRICTION|GCNP_RADIUS|GCNP_STATIC|GRAVITY_MULTIPLIER|HORIZONTAL|HTTP_BODY_MAXLENGTH|" +
            "HTTP_BODY_TRUNCATED|HTTP_CUSTOM_HEADER|HTTP_METHOD|HTTP_MIMETYPE|HTTP_PRAGMA_NO_CACHE|" +
            "HTTP_VERBOSE_THROTTLE|HTTP_VERIFY_CERT|INVENTORY_ALL|INVENTORY_ANIMATION|" +
            "INVENTORY_BODYPART|INVENTORY_CLOTHING|INVENTORY_GESTURE|INVENTORY_LANDMARK|" +
            "INVENTORY_NONE|INVENTORY_NOTECARD|INVENTORY_OBJECT|INVENTORY_SCRIPT|" +
            "INVENTORY_SOUND|INVENTORY_TEXTURE|JSON_APPEND|KFM_CMD_PAUSE|KFM_CMD_PLAY|" +
            "KFM_CMD_SET_MODE|KFM_CMD_STOP|KFM_COMMAND|KFM_DATA|KFM_FORWARD|KFM_LOOP|" +
            "KFM_MODE|KFM_PING_PONG|KFM_REVERSE|KFM_ROTATION|KFM_TRANSLATION|LAND_LEVEL|" +
            "LAND_LOWER|LAND_NOISE|LAND_RAISE|LAND_REVERT|LAND_SMOOTH|LINK_ALL_CHILDREN|" +
            "LINK_ALL_OTHERS|LINK_ROOT|LINK_SET|LINK_THIS|LIST_STAT_GEOMETRIC_MEAN|" +
            "LIST_STAT_MAX|LIST_STAT_MEAN|LIST_STAT_MEDIAN|LIST_STAT_MIN|LIST_STAT_NUM_COUNT|" +
            "LIST_STAT_RANGE|LIST_STAT_STD_DEV|LIST_STAT_SUM|LIST_STAT_SUM_SQUARES|" +
            "LOOP|MASK_BASE|MASK_EVERYONE|MASK_GROUP|MASK_NEXT|MASK_OWNER|OBJECT_ATTACHED_POINT|" +
            "OBJECT_CHARACTER_TIME|OBJECT_CREATOR|OBJECT_DESC|OBJECT_GROUP|OBJECT_NAME|" +
            "OBJECT_OWNER|OBJECT_PATHFINDING_TYPE|OBJECT_PHANTOM|OBJECT_PHYSICS|OBJECT_PHYSICS_COST|" +
            "OBJECT_POS|OBJECT_PRIM_EQUIVALENCE|OBJECT_RETURN_PARCEL|OBJECT_RETURN_PARCEL_OWNER|" +
            "OBJECT_RETURN_REGION|OBJECT_ROOT|OBJECT_ROT|OBJECT_RUNNING_SCRIPT_COUNT|" +
            "OBJECT_SCRIPT_MEMORY|OBJECT_SCRIPT_TIME|OBJECT_SERVER_COST|OBJECT_STREAMING_COST|" +
            "OBJECT_TEMP_ON_REZ|OBJECT_TOTAL_SCRIPT_COUNT|OBJECT_UNKNOWN_DETAIL|OBJECT_VELOCITY|" +
            "OPT_AVATAR|OPT_CHARACTER|OPT_EXCLUSION_VOLUME|OPT_LEGACY_LINKSET|OPT_MATERIAL_VOLUME|" +
            "OPT_OTHER|OPT_STATIC_OBSTACLE|OPT_WALKABLE|PARCEL_COUNT_GROUP|PARCEL_COUNT_OTHER|" +
            "PARCEL_COUNT_OWNER|PARCEL_COUNT_SELECTED|PARCEL_COUNT_TEMP|PARCEL_COUNT_TOTAL|" +
            "PARCEL_DETAILS_AREA|PARCEL_DETAILS_DESC|PARCEL_DETAILS_GROUP|PARCEL_DETAILS_ID|" +
            "PARCEL_DETAILS_NAME|PARCEL_DETAILS_OWNER|PARCEL_DETAILS_SEE_AVATARS|" +
            "PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY|PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS|" +
            "PARCEL_FLAG_ALLOW_CREATE_OBJECTS|PARCEL_FLAG_ALLOW_DAMAGE|PARCEL_FLAG_ALLOW_FLY|" +
            "PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY|PARCEL_FLAG_ALLOW_GROUP_SCRIPTS|" +
            "PARCEL_FLAG_ALLOW_LANDMARK|PARCEL_FLAG_ALLOW_SCRIPTS|PARCEL_FLAG_ALLOW_TERRAFORM|" +
            "PARCEL_FLAG_LOCAL_SOUND_ONLY|PARCEL_FLAG_RESTRICT_PUSHOBJECT|PARCEL_FLAG_USE_ACCESS_GROUP|" +
            "PARCEL_FLAG_USE_ACCESS_LIST|PARCEL_FLAG_USE_BAN_LIST|PARCEL_FLAG_USE_LAND_PASS_LIST|" +
            "PARCEL_MEDIA_COMMAND_AGENT|PARCEL_MEDIA_COMMAND_AUTO_ALIGN|PARCEL_MEDIA_COMMAND_DESC|" +
            "PARCEL_MEDIA_COMMAND_LOOP|PARCEL_MEDIA_COMMAND_LOOP_SET|PARCEL_MEDIA_COMMAND_PAUSE|" +
            "PARCEL_MEDIA_COMMAND_PLAY|PARCEL_MEDIA_COMMAND_SIZE|PARCEL_MEDIA_COMMAND_STOP|" +
            "PARCEL_MEDIA_COMMAND_TEXTURE|PARCEL_MEDIA_COMMAND_TIME|PARCEL_MEDIA_COMMAND_TYPE|" +
            "PARCEL_MEDIA_COMMAND_UNLOAD|PARCEL_MEDIA_COMMAND_URL|PASSIVE|PATROL_PAUSE_AT_WAYPOINTS|" +
            "PAY_DEFAULT|PAY_HIDE|PAYMENT_INFO_ON_FILE|PAYMENT_INFO_USED|PERM_ALL|" +
            "PERM_COPY|PERM_MODIFY|PERM_MOVE|PERM_TRANSFER|PERMISSION_ATTACH|PERMISSION_CHANGE_LINKS|" +
            "PERMISSION_CONTROL_CAMERA|PERMISSION_DEBIT|PERMISSION_OVERRIDE_ANIMATIONS|" +
            "PERMISSION_RETURN_OBJECTS|PERMISSION_SILENT_ESTATE_MANAGEMENT|PERMISSION_TAKE_CONTROLS|" +
            "PERMISSION_TELEPORT|PERMISSION_TRACK_CAMERA|PERMISSION_TRIGGER_ANIMATION|" +
            "PING_PONG|PRIM_BUMP_BARK|PRIM_BUMP_BLOBS|PRIM_BUMP_BRICKS|PRIM_BUMP_BRIGHT|" +
            "PRIM_BUMP_CHECKER|PRIM_BUMP_CONCRETE|PRIM_BUMP_DARK|PRIM_BUMP_DISKS|" +
            "PRIM_BUMP_GRAVEL|PRIM_BUMP_LARGETILE|PRIM_BUMP_NONE|PRIM_BUMP_SHINY|" +
            "PRIM_BUMP_SIDING|PRIM_BUMP_STONE|PRIM_BUMP_STUCCO|PRIM_BUMP_SUCTION|" +
            "PRIM_BUMP_TILE|PRIM_BUMP_WEAVE|PRIM_BUMP_WOOD|PRIM_COLOR|PRIM_DESC|PRIM_FLEXIBLE|" +
            "PRIM_FULLBRIGHT|PRIM_GLOW|PRIM_HOLE_CIRCLE|PRIM_HOLE_DEFAULT|PRIM_HOLE_SQUARE|" +
            "PRIM_HOLE_TRIANGLE|PRIM_LINK_TARGET|PRIM_MATERIAL|PRIM_MATERIAL_FLESH|" +
            "PRIM_MATERIAL_GLASS|PRIM_MATERIAL_METAL|PRIM_MATERIAL_PLASTIC|PRIM_MATERIAL_RUBBER|" +
            "PRIM_MATERIAL_STONE|PRIM_MATERIAL_WOOD|PRIM_MEDIA_ALT_IMAGE_ENABLE|PRIM_MEDIA_AUTO_LOOP|" +
            "PRIM_MEDIA_AUTO_PLAY|PRIM_MEDIA_AUTO_SCALE|PRIM_MEDIA_AUTO_ZOOM|PRIM_MEDIA_CONTROLS|" +
            "PRIM_MEDIA_CONTROLS_MINI|PRIM_MEDIA_CONTROLS_STANDARD|PRIM_MEDIA_CURRENT_URL|" +
            "PRIM_MEDIA_FIRST_CLICK_INTERACT|PRIM_MEDIA_HEIGHT_PIXELS|PRIM_MEDIA_HOME_URL|" +
            "PRIM_MEDIA_MAX_HEIGHT_PIXELS|PRIM_MEDIA_MAX_URL_LENGTH|PRIM_MEDIA_MAX_WHITELIST_COUNT|" +
            "PRIM_MEDIA_MAX_WHITELIST_SIZE|PRIM_MEDIA_MAX_WIDTH_PIXELS|PRIM_MEDIA_PARAM_MAX|" +
            "PRIM_MEDIA_PERM_ANYONE|PRIM_MEDIA_PERM_GROUP|PRIM_MEDIA_PERM_NONE|PRIM_MEDIA_PERM_OWNER|" +
            "PRIM_MEDIA_PERMS_CONTROL|PRIM_MEDIA_PERMS_INTERACT|PRIM_MEDIA_WHITELIST|" +
            "PRIM_MEDIA_WHITELIST_ENABLE|PRIM_MEDIA_WIDTH_PIXELS|PRIM_NAME|PRIM_OMEGA|" +
            "PRIM_PHANTOM|PRIM_PHYSICS|PRIM_PHYSICS_SHAPE_CONVEX|PRIM_PHYSICS_SHAPE_NONE|" +
            "PRIM_PHYSICS_SHAPE_PRIM|PRIM_PHYSICS_SHAPE_TYPE|PRIM_POINT_LIGHT|PRIM_POS_LOCAL|" +
            "PRIM_POSITION|PRIM_ROT_LOCAL|PRIM_ROTATION|PRIM_SCULPT_FLAG_INVERT|PRIM_SCULPT_FLAG_MIRROR|" +
            "PRIM_SCULPT_TYPE_CYLINDER|PRIM_SCULPT_TYPE_MASK|PRIM_SCULPT_TYPE_PLANE|" +
            "PRIM_SCULPT_TYPE_SPHERE|PRIM_SCULPT_TYPE_TORUS|PRIM_SHINY_HIGH|PRIM_SHINY_LOW|" +
            "PRIM_SHINY_MEDIUM|PRIM_SHINY_NONE|PRIM_SIZE|PRIM_SLICE|PRIM_TEMP_ON_REZ|" +
            "PRIM_TEXGEN|PRIM_TEXGEN_DEFAULT|PRIM_TEXGEN_PLANAR|PRIM_TEXT|PRIM_TEXTURE|" +
            "PRIM_TYPE|PRIM_TYPE_BOX|PRIM_TYPE_CYLINDER|PRIM_TYPE_PRISM|PRIM_TYPE_RING|" +
            "PRIM_TYPE_SCULPT|PRIM_TYPE_SPHERE|PRIM_TYPE_TORUS|PRIM_TYPE_TUBE|PROFILE_NONE|" +
            "PROFILE_SCRIPT_MEMORY|PSYS_PART_BOUNCE_MASK|PSYS_PART_EMISSIVE_MASK|" +
            "PSYS_PART_END_ALPHA|PSYS_PART_END_COLOR|PSYS_PART_END_SCALE|PSYS_PART_FLAGS|" +
            "PSYS_PART_FOLLOW_SRC_MASK|PSYS_PART_FOLLOW_VELOCITY_MASK|PSYS_PART_INTERP_COLOR_MASK|" +
            "PSYS_PART_INTERP_SCALE_MASK|PSYS_PART_MAX_AGE|PSYS_PART_START_ALPHA|" +
            "PSYS_PART_START_COLOR|PSYS_PART_START_SCALE|PSYS_PART_TARGET_LINEAR_MASK|" +
            "PSYS_PART_TARGET_POS_MASK|PSYS_PART_WIND_MASK|PSYS_SRC_ACCEL|PSYS_SRC_ANGLE_BEGIN|" +
            "PSYS_SRC_ANGLE_END|PSYS_SRC_BURST_PART_COUNT|PSYS_SRC_BURST_RADIUS|PSYS_SRC_BURST_RATE|" +
            "PSYS_SRC_BURST_SPEED_MAX|PSYS_SRC_BURST_SPEED_MIN|PSYS_SRC_MAX_AGE|PSYS_SRC_OMEGA|" +
            "PSYS_SRC_PATTERN|PSYS_SRC_PATTERN_ANGLE|PSYS_SRC_PATTERN_ANGLE_CONE|" +
            "PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY|PSYS_SRC_PATTERN_DROP|PSYS_SRC_PATTERN_EXPLODE|" +
            "PSYS_SRC_TARGET_KEY|PSYS_SRC_TEXTURE|PU_EVADE_HIDDEN|PU_EVADE_SPOTTED|" +
            "PU_FAILURE_DYNAMIC_PATHFINDING_DISABLED|PU_FAILURE_INVALID_GOAL|PU_FAILURE_INVALID_START|" +
            "PU_FAILURE_NO_NAVMESH|PU_FAILURE_NO_VALID_DESTINATION|PU_FAILURE_OTHER|" +
            "PU_FAILURE_PARCEL_UNREACHABLE|PU_FAILURE_TARGET_GONE|PU_FAILURE_UNREACHABLE|" +
            "PU_GOAL_REACHED|PU_SLOWDOWN_DISTANCE_REACHED|PUBLIC_CHANNEL|PURSUIT_FUZZ_FACTOR|" +
            "PURSUIT_GOAL_TOLERANCE|PURSUIT_INTERCEPT|PURSUIT_OFFSET|RC_DATA_FLAGS|" +
            "RC_DETECT_PHANTOM|RC_GET_LINK_NUM|RC_GET_NORMAL|RC_GET_ROOT_KEY|RC_MAX_HITS|" +
            "RC_REJECT_AGENTS|RC_REJECT_LAND|RC_REJECT_NONPHYSICAL|RC_REJECT_PHYSICAL|" +
            "RC_REJECT_TYPES|RCERR_CAST_TIME_EXCEEDED|RCERR_SIM_PERF_LOW|RCERR_UNKNOWN|" +
            "REGION_FLAG_ALLOW_DAMAGE|REGION_FLAG_ALLOW_DIRECT_TELEPORT|REGION_FLAG_BLOCK_FLY|" +
            "REGION_FLAG_BLOCK_TERRAFORM|REGION_FLAG_DISABLE_COLLISIONS|REGION_FLAG_DISABLE_PHYSICS|" +
            "REGION_FLAG_FIXED_SUN|REGION_FLAG_RESTRICT_PUSHOBJECT|REGION_FLAG_SANDBOX|" +
            "REMOTE_DATA_CHANNEL|REMOTE_DATA_REPLY|REMOTE_DATA_REQUEST|REQUIRE_LINE_OF_SIGHT|" +
            "RESTITUTION|REVERSE|ROTATE|SCALE|SCRIPTED|SIM_STAT_PCT_CHARS_STEPPED|" +
            "SMOOTH|STATUS_BLOCK_GRAB|STATUS_BLOCK_GRAB_OBJECT|STATUS_BOUNDS_ERROR|" +
            "STATUS_CAST_SHADOWS|STATUS_DIE_AT_EDGE|STATUS_INTERNAL_ERROR|STATUS_MALFORMED_PARAMS|" +
            "STATUS_NOT_FOUND|STATUS_NOT_SUPPORTED|STATUS_OK|STATUS_PHANTOM|STATUS_PHYSICS|" +
            "STATUS_RETURN_AT_EDGE|STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z|" +
            "STATUS_SANDBOX|STATUS_TYPE_MISMATCH|STATUS_WHITELIST_FAILED|STRING_TRIM|" +
            "STRING_TRIM_HEAD|STRING_TRIM_TAIL|TOUCH_INVALID_FACE|TRAVERSAL_TYPE|" +
            "TRAVERSAL_TYPE_FAST|TRAVERSAL_TYPE_NONE|TRAVERSAL_TYPE_SLOW|TYPE_FLOAT|" +
            "TYPE_INTEGER|TYPE_INVALID|TYPE_KEY|TYPE_ROTATION|TYPE_STRING|TYPE_VECTOR|" +
            "VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY|VEHICLE_ANGULAR_DEFLECTION_TIMESCALE|" +
            "VEHICLE_ANGULAR_FRICTION_TIMESCALE|VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE|" +
            "VEHICLE_ANGULAR_MOTOR_DIRECTION|VEHICLE_ANGULAR_MOTOR_TIMESCALE|VEHICLE_BANKING_EFFICIENCY|" +
            "VEHICLE_BANKING_MIX|VEHICLE_BANKING_TIMESCALE|VEHICLE_BUOYANCY|VEHICLE_FLAG_CAMERA_DECOUPLED|" +
            "VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT|VEHICLE_FLAG_HOVER_TERRAIN_ONLY|VEHICLE_FLAG_HOVER_UP_ONLY|" +
            "VEHICLE_FLAG_HOVER_WATER_ONLY|VEHICLE_FLAG_LIMIT_MOTOR_UP|VEHICLE_FLAG_LIMIT_ROLL_ONLY|" +
            "VEHICLE_FLAG_MOUSELOOK_BANK|VEHICLE_FLAG_MOUSELOOK_STEER|VEHICLE_FLAG_NO_DEFLECTION_UP|" +
            "VEHICLE_HOVER_EFFICIENCY|VEHICLE_HOVER_HEIGHT|VEHICLE_HOVER_TIMESCALE|" +
            "VEHICLE_LINEAR_DEFLECTION_EFFICIENCY|VEHICLE_LINEAR_DEFLECTION_TIMESCALE|" +
            "VEHICLE_LINEAR_FRICTION_TIMESCALE|VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE|" +
            "VEHICLE_LINEAR_MOTOR_DIRECTION|VEHICLE_LINEAR_MOTOR_OFFSET|VEHICLE_LINEAR_MOTOR_TIMESCALE|" +
            "VEHICLE_REFERENCE_FRAME|VEHICLE_TYPE_AIRPLANE|VEHICLE_TYPE_BALLOON|VEHICLE_TYPE_BOAT|" +
            "VEHICLE_TYPE_CAR|VEHICLE_TYPE_NONE|VEHICLE_TYPE_SLED|VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY|" +
            "VEHICLE_VERTICAL_ATTRACTION_TIMESCALE|VERTICAL|WANDER_PAUSE_AT_WAYPOINTS",
        "constant.language.integer.boolean.lsl" : "FALSE|TRUE",
        "constant.language.quaternion.lsl" : "ZERO_ROTATION",
        "constant.language.string.lsl" : "EOF|JSON_ARRAY|JSON_FALSE|JSON_INVALID|" +
            "JSON_NULL|JSON_NUMBER|JSON_OBJECT|JSON_STRING|JSON_TRUE|NULL_KEY|" +
            "TEXTURE_BLANK|TEXTURE_DEFAULT|TEXTURE_MEDIA|TEXTURE_PLYWOOD|" +
            "TEXTURE_TRANSPARENT|URL_REQUEST_DENIED|URL_REQUEST_GRANTED",
        "constant.language.vector.lsl" : "TOUCH_INVALID_TEXCOORD|TOUCH_INVALID_VECTOR|ZERO_VECTOR",
        "invalid.broken.lsl": "LAND_LARGE_BRUSH|LAND_MEDIUM_BRUSH|LAND_SMALL_BRUSH",
        "invalid.deprecated.lsl" : "ATTACH_LPEC|ATTACH_RPEC|CHARACTER_MAX_ANGULAR_ACCEL|" +
            "CHARACTER_MAX_ANGULAR_SPEED|CHARACTER_TURN_SPEED_MULTIPLIER|DATA_RATING|" +
            "PRIM_CAST_SHADOWS|PRIM_MATERIAL_LIGHT|PRIM_PHYSICS_MATERIAL|PRIM_TYPE_LEGACY|" +
            "PSYS_SRC_INNERANGLE|PSYS_SRC_OUTERANGLE|VEHICLE_FLAG_NO_FLY_UP|llCloud|" +
            "llGodLikeRezObject|llMakeExplosion|llMakeFire|llMakeFountain|llMakeSmoke|" +
            "llRemoteDataSetRegion|llSetInventoryPermMask|llSetObjectPermMask|llSound|" +
            "llSoundPreload|llXorBase64Strings|llXorBase64StringsCorrect",
        "invalid.godmode.lsl": "llGodLikeRezObject|llSetInventoryPermMask|llSetObjectPermMask",
        "invalid.illegal.lsl" : "print",
        "invalid.unimplemented.lsl": "CHARACTER_MAX_ANGULAR_ACCEL|CHARACTER_MAX_ANGULAR_SPEED|" +
            "CHARACTER_TURN_SPEED_MULTIPLIER|PERMISSION_CHANGE_JOINTS|PERMISSION_CHANGE_PERMISSIONS|" +
            "PERMISSION_RELEASE_OWNERSHIP|PERMISSION_REMAP_CONTROLS|PRIM_PHYSICS_MATERIAL|PRIM_TYPE_LEGACY|" +
            "PSYS_SRC_OBJ_REL_MASK|event|llCollisionSprite|llPointAt|llRefreshPrimURL|" +
            "llReleaseCamera|llRemoteLoadScript|llSetPrimURL|llStopPointAt|llTakeCamera",
        "keyword.control.lsl" : "do|else|for|if|jump|return|while",
        "storage.type.lsl" : "float|integer|key|list|quaternion|rotation|string|vector",
        "support.function.lsl": "llAbs|llAcos|llAddToLandBanList|llAddToLandPassList|" +
            "llAdjustSoundVolume|llAllowInventoryDrop|llAngleBetween|llApplyImpulse|" +
            "llApplyRotationalImpulse|llAsin|llAtan2|llAttachToAvatar|llAttachToAvatarTemp|" +
            "llAvatarOnLinkSitTarget|llAvatarOnSitTarget|llAxes2Rot|llAxisAngle2Rot|" +
            "llBase64ToInteger|llBase64ToString|llBreakAllLinks|llBreakLink|llCastRay|" +
            "llCeil|llClearCameraParams|llClearLinkMedia|llClearPrimMedia|llCloseRemoteDataChannel|" +
            "llCollisionFilter|llCollisionSound|llCos|llCreateCharacter|llCreateLink|" +
            "llCSV2List|llDeleteCharacter|llDeleteSubList|llDeleteSubString|llDetachFromAvatar|" +
            "llDetectedGrab|llDetectedGroup|llDetectedKey|llDetectedLinkNumber|llDetectedName|" +
            "llDetectedOwner|llDetectedPos|llDetectedRot|llDetectedTouchBinormal|" +
            "llDetectedTouchFace|llDetectedTouchNormal|llDetectedTouchPos|llDetectedTouchST|" +
            "llDetectedTouchUV|llDetectedType|llDetectedVel|llDialog|llDie|llDumpList2String|" +
            "llEdgeOfWorld|llEjectFromLand|llEmail|llEscapeURL|llEuler2Rot|llExecCharacterCmd|" +
            "llEvade|llFabs|llFleeFrom|llFloor|llForceMouselook|llFrand|llGenerateKey|" +
            "llGetAccel|llGetAgentInfo|llGetAgentLanguage|llGetAgentList|llGetAgentSize|" +
            "llGetAlpha|llGetAndResetTime|llGetAnimation|llGetAnimationList|llGetAnimationOverride|" +
            "llGetAttached|llGetBoundingBox|llGetCameraPos|llGetCameraRot|llGetCenterOfMass|" +
            "llGetClosestNavPoint|llGetColor|llGetCreator|llGetDate|llGetDisplayName|" +
            "llGetEnergy|llGetEnv|llGetForce|llGetFreeMemory|llGetFreeURLs|llGetGeometricCenter|" +
            "llGetGMTclock|llGetHTTPHeader|llGetInventoryCreator|llGetInventoryKey|llGetInventoryName|" +
            "llGetInventoryNumber|llGetInventoryPermMask|llGetInventoryType|llGetKey|" +
            "llGetLandOwnerAt|llGetLinkKey|llGetLinkMedia|llGetLinkName|llGetLinkNumber|" +
            "llGetLinkNumberOfSides|llGetLinkPrimitiveParams|llGetListEntryType|llGetListLength|" +
            "llGetLocalPos|llGetLocalRot|llGetMass|llGetMassMKS|llGetMemoryLimit|" +
            "llGetNextEmail|llGetNotecardLine|llGetNumberOfNotecardLines|llGetNumberOfPrims|" +
            "llGetNumberOfSides|llGetObjectDesc|llGetObjectDetails|llGetObjectMass|" +
            "llGetObjectName|llGetObjectPermMask|llGetObjectPrimCount|llGetOmega|" +
            "llGetOwner|llGetOwnerKey|llGetParcelDetails|llGetParcelFlags|llGetParcelMaxPrims|" +
            "llGetParcelMusicURL|llGetParcelPrimCount|llGetParcelPrimOwners|llGetPermissions|" +
            "llGetPermissionsKey|llGetPhysicsMaterial|llGetPos|llGetPrimitiveParams|" +
            "llGetPrimMediaParams|llGetRegionAgentCount|llGetRegionCorner|llGetRegionFlags|" +
            "llGetRegionFPS|llGetRegionName|llGetRegionTimeDilation|llGetRootPosition|" +
            "llGetRootRotation|llGetRot|llGetScale|llGetScriptName|llGetScriptState|" +
            "llGetSimStats|llGetSimulatorHostname|llGetSPMaxMemory|llGetStartParameter|" +
            "llGetStaticPath|llGetStatus|llGetSubString|llGetSunDirection|llGetTexture|" +
            "llGetTextureOffset|llGetTextureRot|llGetTextureScale|llGetTime|llGetTimeOfDay|" +
            "llGetTimestamp|llGetTorque|llGetUnixTime|llGetUsedMemory|llGetUsername|" +
            "llGetVel|llGetWallclock|llGiveInventory|llGiveInventoryList|llGiveMoney|" +
            "llGround|llGroundContour|llGroundNormal|llGroundRepel|llGroundSlope|" +
            "llHTTPRequest|llHTTPResponse|llInsertString|llInstantMessage|llIntegerToBase64|" +
            "llJson2List|llJsonGetValue|llJsonSetValue|llJsonValueType|llKey2Name|" +
            "llLinkParticleSystem|llLinkSitTarget|llList2CSV|llList2Float|llList2Integer|" +
            "llList2Json|llList2Key|llList2List|llList2ListStrided|llList2Rot|" +
            "llList2String|llList2Vector|llListen|llListenControl|llListenRemove|" +
            "llListFindList|llListInsertList|llListRandomize|llListReplaceList|llListSort|" +
            "llListStatistics|llLoadURL|llLog|llLog10|llLookAt|llLoopSound|llLoopSoundMaster|" +
            "llLoopSoundSlave|llManageEstateAccess|llMapDestination|llMD5String|llMessageLinked|" +
            "llMinEventDelay|llModifyLand|llModPow|llMoveToTarget|llNavigateTo|llOffsetTexture|" +
            "llOpenRemoteDataChannel|llOverMyLand|llOwnerSay|llParcelMediaCommandList|" +
            "llParcelMediaQuery|llParseString2List|llParseStringKeepNulls|llParticleSystem|" +
            "llPassCollisions|llPassTouches|llPatrolPoints|llPlaySound|llPlaySoundSlave|" +
            "llPow|llPreloadSound|llPursue|llPushObject|llRegionSay|llRegionSayTo|" +
            "llReleaseControls|llReleaseURL|llRemoteDataReply|llRemoteLoadScriptPin|" +
            "llRemoveFromLandBanList|llRemoveFromLandPassList|llRemoveInventory|llRemoveVehicleFlags|" +
            "llRequestAgentData|llRequestDisplayName|llRequestInventoryData|llRequestPermissions|" +
            "llRequestSecureURL|llRequestSimulatorData|llRequestURL|llRequestUsername|" +
            "llResetAnimationOverride|llResetLandBanList|llResetLandPassList|llResetOtherScript|" +
            "llResetScript|llResetTime|llReturnObjectsByID|llReturnObjectsByOwner|" +
            "llRezAtRoot|llRezObject|llRot2Angle|llRot2Axis|llRot2Euler|" +
            "llRot2Fwd|llRot2Left|llRot2Up|llRotateTexture|llRotBetween|llRotLookAt|" +
            "llRotTarget|llRotTargetRemove|llRound|llSameGroup|llSay|llScaleTexture|" +
            "llScriptDanger|llScriptProfiler|llSendRemoteData|llSensor|llSensorRemove|" +
            "llSensorRepeat|llSetAlpha|llSetAngularVelocity|llSetAnimationOverride|llSetBuoyancy|" +
            "llSetCameraAtOffset|llSetCameraEyeOffset|llSetCameraParams|llSetClickAction|" +
            "llSetColor|llSetContentType|llSetDamage|llSetForce|llSetForceAndTorque|llSetHoverHeight|" +
            "llSetKeyframedMotion|llSetLinkAlpha|llSetLinkCamera|llSetLinkColor|llSetLinkMedia|" +
            "llSetLinkPrimitiveParams|llSetLinkPrimitiveParamsFast|llSetLinkTexture|llSetLinkTextureAnim|" +
            "llSetLocalRot|llSetMemoryLimit|llSetObjectDesc|llSetObjectName|llSetParcelMusicURL|" +
            "llSetPayPrice|llSetPhysicsMaterial|llSetPos|llSetPrimitiveParams|llSetPrimMediaParams|" +
            "llSetRegionPos|llSetRemoteScriptAccessPin|llSetRot|llSetScale|llSetScriptState|" +
            "llSetSitText|llSetSoundQueueing|llSetSoundRadius|llSetStatus|llSetText|" +
            "llSetTexture|llSetTextureAnim|llSetTimerEvent|llSetTorque|llSetTouchText|" +
            "llSetVehicleFlags|llSetVehicleFloatParam|llSetVehicleRotationParam|llSetVehicleType|" +
            "llSetVehicleVectorParam|llSetVelocity|llSHA1String|llShout|llSin|llSitTarget|" +
            "llSleep|llSqrt|llStartAnimation|llStopAnimation|llStopHover|llStopLookAt|" +
            "llStopMoveToTarget|llStopSound|llStringLength|llStringToBase64|llStringTrim|" +
            "llSubStringIndex|llTakeControls|llTan|llTarget|llTargetOmega|llTargetRemove|" +
            "llTeleportAgent|llTeleportAgentGlobalCoords|llTeleportAgentHome|llTextBox|" +
            "llToLower|llToUpper|llTransferLindenDollars|llTriggerSound|llTriggerSoundLimited|" +
            "llUnescapeURL|llUnSit|llUpdateCharacter|llVecDist|llVecMag|llVecNorm|" +
            "llVolumeDetect|llWanderWithin|llWater|llWhisper|llWind|llXorBase64",
        "support.function.event.lsl" : "at_rot_target|at_target|attach|changed|collision|" +
            "collision_end|collision_start|control|dataserver|email|http_request|" +
            "http_response|land_collision|land_collision_end|land_collision_start|" +
            "link_message|listen|money|moving_end|moving_start|no_sensor|not_at_rot_target|" +
            "not_at_target|object_rez|on_rez|path_update|remote_data|run_time_permissions|" +
            "sensor|state_entry|state_exit|timer|touch|touch_end|touch_start|transaction_result"
        }, "identifier");

    this.$rules = {
        "start" : [
            {
                token : "comment.line.double-slash.lsl",
                regex : "\\/\\/.*$"
            }, {
                token : "comment.block.lsl",
                regex : "\\/\\*",
                next : "comment"
            }, {
                token : "string.quoted.double.lsl",
                start : '"',
                end : '"',
                next : [{
                    token : "constant.language.escape.lsl", regex : /\\[tn"\\]/
                }]
            }, {
                token : "constant.numeric.lsl",
                regex : "(0[xX][0-9a-fA-F]+|[+-]?[0-9]+(?:(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?)?)\\b"
            }, {
                token : "entity.name.state.lsl",
                regex : "\\b((state)\\s+\\w+|default)\\b"
            }, {
                token : keywordMapper,
                regex : "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b"
            }, {
                token : "support.function.user-defined.lsl",
                regex : /\b([a-zA-Z_]\w*)(?=\(.*?\))/
            }, {
                token : "keyword.operator.lsl",
                regex : "\\+\\+|\\-\\-|<<|>>|&&?|\\|\\|?|\\^|~|[!%<>=*+\\-\\/]=?"
            }, {
                token : "punctuation.operator.lsl",
                regex : "\\,|\\;"
            }, {
                token : "paren.lparen.lsl",
                regex : "[\\[\\(\\{]"
            }, {
                token : "paren.rparen.lsl",
                regex : "[\\]\\)\\}]"
            }, {
                token : "text.lsl",
                regex : "\\s+"
            }
        ],
        "comment" : [
            {
                token : "comment.block.lsl",
                regex : ".*?\\*\\/",
                next : "start"
            }, {
                token : "comment.block.lsl",
                regex : ".+"
            }
        ]
    };
    this.normalizeRules();
}

exports.LSLHighlightRules = LSLHighlightRules;
});

define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {

var Range = require("../range").Range;

var MatchingBraceOutdent = function() {};

(function() {

    this.checkOutdent = function(line, input) {
        if (! /^\s+$/.test(line))
            return false;

        return /^\s*\}/.test(input);
    };

    this.autoOutdent = function(doc, row) {
        var line = doc.getLine(row);
        var match = line.match(/^(\s*\})/);

        if (!match) return 0;

        var column = match[1].length;
        var openBracePos = doc.findMatchingBracket({row: row, column: column});

        if (!openBracePos || openBracePos.row == row) return 0;

        var indent = this.$getIndent(doc.getLine(openBracePos.row));
        doc.replace(new Range(row, 0, row, column-1), indent);
    };

    this.$getIndent = function(line) {
        return line.match(/^\s*/)[0];
    };

}).call(MatchingBraceOutdent.prototype);

exports.MatchingBraceOutdent = MatchingBraceOutdent;
});

define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {

var oop = require("../../lib/oop");
var Behaviour = require("../behaviour").Behaviour;
var TokenIterator = require("../../token_iterator").TokenIterator;
var lang = require("../../lib/lang");

var SAFE_INSERT_IN_TOKENS =
    ["text", "paren.rparen", "punctuation.operator"];
var SAFE_INSERT_BEFORE_TOKENS =
    ["text", "paren.rparen", "punctuation.operator", "comment"];

var autoInsertedBrackets = 0;
var autoInsertedRow = -1;
var autoInsertedLineEnd = "";
var maybeInsertedBrackets = 0;
var maybeInsertedRow = -1;
var maybeInsertedLineStart = "";
var maybeInsertedLineEnd = "";

var CstyleBehaviour = function () {

    CstyleBehaviour.isSaneInsertion = function(editor, session) {
        var cursor = editor.getCursorPosition();
        var iterator = new TokenIterator(session, cursor.row, cursor.column);
        if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
            var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
            if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
                return false;
        }
        iterator.stepForward();
        return iterator.getCurrentTokenRow() !== cursor.row ||
            this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
    };

    CstyleBehaviour.$matchTokenType = function(token, types) {
        return types.indexOf(token.type || token) > -1;
    };

    CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
        var cursor = editor.getCursorPosition();
        var line = session.doc.getLine(cursor.row);
        if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
            autoInsertedBrackets = 0;
        autoInsertedRow = cursor.row;
        autoInsertedLineEnd = bracket + line.substr(cursor.column);
        autoInsertedBrackets++;
    };

    CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
        var cursor = editor.getCursorPosition();
        var line = session.doc.getLine(cursor.row);
        if (!this.isMaybeInsertedClosing(cursor, line))
            maybeInsertedBrackets = 0;
        maybeInsertedRow = cursor.row;
        maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
        maybeInsertedLineEnd = line.substr(cursor.column);
        maybeInsertedBrackets++;
    };

    CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
        return autoInsertedBrackets > 0 &&
            cursor.row === autoInsertedRow &&
            bracket === autoInsertedLineEnd[0] &&
            line.substr(cursor.column) === autoInsertedLineEnd;
    };

    CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
        return maybeInsertedBrackets > 0 &&
            cursor.row === maybeInsertedRow &&
            line.substr(cursor.column) === maybeInsertedLineEnd &&
            line.substr(0, cursor.column) == maybeInsertedLineStart;
    };

    CstyleBehaviour.popAutoInsertedClosing = function() {
        autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
        autoInsertedBrackets--;
    };

    CstyleBehaviour.clearMaybeInsertedClosing = function() {
        maybeInsertedBrackets = 0;
        maybeInsertedRow = -1;
    };

    this.add("braces", "insertion", function (state, action, editor, session, text) {
        var cursor = editor.getCursorPosition();
        var line = session.doc.getLine(cursor.row);
        if (text == '{') {
            var selection = editor.getSelectionRange();
            var selected = session.doc.getTextRange(selection);
            if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
                return {
                    text: '{' + selected + '}',
                    selection: false
                };
            } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
                if (/[\]\}\)]/.test(line[cursor.column])) {
                    CstyleBehaviour.recordAutoInsert(editor, session, "}");
                    return {
                        text: '{}',
                        selection: [1, 1]
                    };
                } else {
                    CstyleBehaviour.recordMaybeInsert(editor, session, "{");
                    return {
                        text: '{',
                        selection: [1, 1]
                    };
                }
            }
        } else if (text == '}') {
            var rightChar = line.substring(cursor.column, cursor.column + 1);
            if (rightChar == '}') {
                var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
                if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
                    CstyleBehaviour.popAutoInsertedClosing();
                    return {
                        text: '',
                        selection: [1, 1]
                    };
                }
            }
        } else if (text == "\n" || text == "\r\n") {
            var closing = "";
            if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
                closing = lang.stringRepeat("}", maybeInsertedBrackets);
                CstyleBehaviour.clearMaybeInsertedClosing();
            }
            var rightChar = line.substring(cursor.column, cursor.column + 1);
            if (rightChar == '}' || closing !== "") {
                var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column}, '}');
                if (!openBracePos)
                     return null;

                var indent = this.getNextLineIndent(state, line.substring(0, cursor.column), session.getTabString());
                var next_indent = this.$getIndent(line);

                return {
                    text: '\n' + indent + '\n' + next_indent + closing,
                    selection: [1, indent.length, 1, indent.length]
                };
            }
        }
    });

    this.add("braces", "deletion", function (state, action, editor, session, range) {
        var selected = session.doc.getTextRange(range);
        if (!range.isMultiLine() && selected == '{') {
            var line = session.doc.getLine(range.start.row);
            var rightChar = line.substring(range.end.column, range.end.column + 1);
            if (rightChar == '}') {
                range.end.column++;
                return range;
            } else {
                maybeInsertedBrackets--;
            }
        }
    });

    this.add("parens", "insertion", function (state, action, editor, session, text) {
        if (text == '(') {
            var selection = editor.getSelectionRange();
            var selected = session.doc.getTextRange(selection);
            if (selected !== "" && editor.getWrapBehavioursEnabled()) {
                return {
                    text: '(' + selected + ')',
                    selection: false
                };
            } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
                CstyleBehaviour.recordAutoInsert(editor, session, ")");
                return {
                    text: '()',
                    selection: [1, 1]
                };
            }
        } else if (text == ')') {
            var cursor = editor.getCursorPosition();
            var line = session.doc.getLine(cursor.row);
            var rightChar = line.substring(cursor.column, cursor.column + 1);
            if (rightChar == ')') {
                var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
                if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
                    CstyleBehaviour.popAutoInsertedClosing();
                    return {
                        text: '',
                        selection: [1, 1]
                    };
                }
            }
        }
    });

    this.add("parens", "deletion", function (state, action, editor, session, range) {
        var selected = session.doc.getTextRange(range);
        if (!range.isMultiLine() && selected == '(') {
            var line = session.doc.getLine(range.start.row);
            var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
            if (rightChar == ')') {
                range.end.column++;
                return range;
            }
        }
    });

    this.add("brackets", "insertion", function (state, action, editor, session, text) {
        if (text == '[') {
            var selection = editor.getSelectionRange();
            var selected = session.doc.getTextRange(selection);
            if (selected !== "" && editor.getWrapBehavioursEnabled()) {
                return {
                    text: '[' + selected + ']',
                    selection: false
                };
            } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
                CstyleBehaviour.recordAutoInsert(editor, session, "]");
                return {
                    text: '[]',
                    selection: [1, 1]
                };
            }
        } else if (text == ']') {
            var cursor = editor.getCursorPosition();
            var line = session.doc.getLine(cursor.row);
            var rightChar = line.substring(cursor.column, cursor.column + 1);
            if (rightChar == ']') {
                var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
                if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
                    CstyleBehaviour.popAutoInsertedClosing();
                    return {
                        text: '',
                        selection: [1, 1]
                    };
                }
            }
        }
    });

    this.add("brackets", "deletion", function (state, action, editor, session, range) {
        var selected = session.doc.getTextRange(range);
        if (!range.isMultiLine() && selected == '[') {
            var line = session.doc.getLine(range.start.row);
            var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
            if (rightChar == ']') {
                range.end.column++;
                return range;
            }
        }
    });

    this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
        if (text == '"' || text == "'") {
            var quote = text;
            var selection = editor.getSelectionRange();
            var selected = session.doc.getTextRange(selection);
            if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
                return {
                    text: quote + selected + quote,
                    selection: false
                };
            } else {
                var cursor = editor.getCursorPosition();
                var line = session.doc.getLine(cursor.row);
                var leftChar = line.substring(cursor.column-1, cursor.column);
                if (leftChar == '\\') {
                    return null;
                }
                var tokens = session.getTokens(selection.start.row);
                var col = 0, token;
                var quotepos = -1; // Track whether we're inside an open quote.

                for (var x = 0; x < tokens.length; x++) {
                    token = tokens[x];
                    if (token.type == "string") {
                      quotepos = -1;
                    } else if (quotepos < 0) {
                      quotepos = token.value.indexOf(quote);
                    }
                    if ((token.value.length + col) > selection.start.column) {
                        break;
                    }
                    col += tokens[x].value.length;
                }
                if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
                    if (!CstyleBehaviour.isSaneInsertion(editor, session))
                        return;
                    return {
                        text: quote + quote,
                        selection: [1,1]
                    };
                } else if (token && token.type === "string") {
                    var rightChar = line.substring(cursor.column, cursor.column + 1);
                    if (rightChar == quote) {
                        return {
                            text: '',
                            selection: [1, 1]
                        };
                    }
                }
            }
        }
    });

    this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
        var selected = session.doc.getTextRange(range);
        if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
            var line = session.doc.getLine(range.start.row);
            var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
            if (rightChar == selected) {
                range.end.column++;
                return range;
            }
        }
    });

};

oop.inherits(CstyleBehaviour, Behaviour);

exports.CstyleBehaviour = CstyleBehaviour;
});

define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {

var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;

var FoldMode = exports.FoldMode = function(commentRegex) {
    if (commentRegex) {
        this.foldingStartMarker = new RegExp(
            this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
        );
        this.foldingStopMarker = new RegExp(
            this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
        );
    }
};
oop.inherits(FoldMode, BaseFoldMode);

(function() {

    this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
    this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;

    this.getFoldWidgetRange = function(session, foldStyle, row) {
        var line = session.getLine(row);
        var match = line.match(this.foldingStartMarker);
        if (match) {
            var i = match.index;

            if (match[1])
                return this.openingBracketBlock(session, match[1], row, i);

            return session.getCommentFoldRange(row, i + match[0].length, 1);
        }

        if (foldStyle !== "markbeginend")
            return;

        var match = line.match(this.foldingStopMarker);
        if (match) {
            var i = match.index + match[0].length;

            if (match[1])
                return this.closingBracketBlock(session, match[1], row, i);

            return session.getCommentFoldRange(row, i, -1);
        }
    };

}).call(FoldMode.prototype);

});


text:
import StringIO

import subprocess

import os

import time

from datetime import datetime

from PIL import Image

threshold = 10

sensitivity = 20

forceCapture = True

forceCaptureTime = 60 * 60 # Once an hour

filepath = "/home/pi/www/picam"

filenamePrefix = "capture"

diskSpaceToReserve = 40 * 1024 * 1024 # Keep 40 mb free on disk

cameraSettings = ""

# settings of the photos to save

saveWidth   = 1296

saveHeight  = 972

saveQuality = 15 # Set jpeg quality (0 to 100)

# Test-Image settings

testWidth = 100

testHeight = 75

# this is the default setting, if the whole image should be scanned for changed pixel

testAreaCount = 1

testBorders = [ [[1,testWidth],[1,testHeight]] ]  # [ [[start pixel on left side,end pixel on right side],[start pixel on top side,stop pixel on bottom side]] ]

debugMode = False # False or True

# Capture a small test image (for motion detection)

def captureTestImage(settings, width, height):

    command = "raspistill %s -w %s -h %s -t 200 -e bmp -n -o -" % (settings, width, height)

    imageData = StringIO.StringIO()

    imageData.write(subprocess.check_output(command, shell=True))

    imageData.seek(0)

    im = Image.open(imageData)

    buffer = im.load()

    imageData.close()

    return im, buffer

# Save a full size image to disk

def saveImage(settings, width, height, quality, diskSpaceToReserve):

    keepDiskSpaceFree(diskSpaceToReserve)

    time = datetime.now()

    filename = filepath + "/" + filenamePrefix + "-%04d%02d%02d-%02d%02d%02d.jpg" % (time.year, time.month, time.day, time.hour, time.minute, time.second)

    subprocess.call("raspistill %s -w %s -h %s -t 200 -e jpg -q %s -n -o %s" % (settings, width, height, quality, filename), shell=True)

    print "Captured %s" % filename

# Keep free space above given level

def keepDiskSpaceFree(bytesToReserve):

    if (getFreeSpace() < bytesToReserve):

        for filename in sorted(os.listdir(filepath + "/")):

            if filename.startswith(filenamePrefix) and filename.endswith(".jpg"):

                os.remove(filepath + "/" + filename)

                print "Deleted %s/%s to avoid filling disk" % (filepath,filename)

                if (getFreeSpace() > bytesToReserve):

                    return

# Get available disk space

def getFreeSpace():

    st = os.statvfs(filepath + "/")

    du = st.f_bavail * st.f_frsize

    return du

# Get first image

image1, buffer1 = captureTestImage(cameraSettings, testWidth, testHeight)

# Reset last capture time

lastCapture = time.time()

while (True):

    # Get comparison image

    image2, buffer2 = captureTestImage(cameraSettings, testWidth, testHeight)

    # Count changed pixels

    changedPixels = 0

    takePicture = False

    if (debugMode): # in debug mode, save a bitmap-file with marked changed pixels and with visible testarea-borders

        debugimage = Image.new("RGB",(testWidth, testHeight))

        debugim = debugimage.load()

    for z in xrange(0, testAreaCount): # = xrange(0,1) with default-values = z will only have the value of 0 = only one scan-area = whole picture

        for x in xrange(testBorders[z][0][0]-1, testBorders[z][0][1]): # = xrange(0,100) with default-values

            for y in xrange(testBorders[z][1][0]-1, testBorders[z][1][1]):   # = xrange(0,75) with default-values; testBorders are NOT zero-based, buffer1[x,y] are zero-based (0,0 is top left of image, testWidth-1,testHeight-1 is botton right)

                if (debugMode):

                    debugim[x,y] = buffer2[x,y]

                    if ((x == testBorders[z][0][0]-1) or (x == testBorders[z][0][1]-1) or (y == testBorders[z][1][0]-1) or (y == testBorders[z][1][1]-1)):

                        # print "Border %s %s" % (x,y)

                        debugim[x,y] = (0, 0, 255) # in debug mode, mark all border pixel to blue

                # Just check green channel as it's the highest quality channel

                pixdiff = abs(buffer1[x,y][1] - buffer2[x,y][1])

                if pixdiff > threshold:

                    changedPixels += 1

                    if (debugMode):

                        debugim[x,y] = (0, 255, 0) # in debug mode, mark all changed pixel to green

                # Save an image if pixels changed

                if (changedPixels > sensitivity):

                    takePicture = True # will shoot the photo later

                if ((debugMode == False) and (changedPixels > sensitivity)):

                    break  # break the y loop

            if ((debugMode == False) and (changedPixels > sensitivity)):

                break  # break the x loop

        if ((debugMode == False) and (changedPixels > sensitivity)):

            break  # break the z loop

    if (debugMode):

        debugimage.save(filepath + "/debug.bmp") # save debug image as bmp

        print "debug.bmp saved, %s changed pixel" % changedPixels

    # Check force capture

    if forceCapture:

        if time.time() - lastCapture > forceCaptureTime:

            takePicture = True

    if takePicture:

        lastCapture = time.time()

        saveImage(cameraSettings, saveWidth, saveHeight, saveQuality, diskSpaceToReserve)

    # Swap comparison buffers

    image1 = image2

    buffer1 = buffer2#!/usr/bin/python


text:
package com.sumologic.shellbase.notifications

trait ShellNotification {
  def name: String

  def notify(title: String, message: String): Unit
}


text:
<?php

namespace Oro\Component\EntitySerializer;

use Doctrine\Common\Persistence\ManagerRegistry;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;

class DoctrineHelper
{
    /** @var ManagerRegistry */
    protected $doctrine;

    /** @var EntityMetadata[] */
    protected $metadata = [];

    /**
     * @param ManagerRegistry $doctrine
     */
    public function __construct(ManagerRegistry $doctrine)
    {
        $this->doctrine = $doctrine;
    }

    /**
     * @param string $entityClass
     *
     * @return EntityManager
     *
     * @throws \RuntimeException
     */
    public function getEntityManager($entityClass)
    {
        $em = $this->doctrine->getManagerForClass($entityClass);
        if (!$em) {
            throw new \RuntimeException(sprintf('Entity class "%s" is not manageable.', $entityClass));
        }

        return $em;
    }

    /**
     * @param string $entityClass
     *
     * @return EntityRepository
     */
    public function getEntityRepository($entityClass)
    {
        return $this->getEntityManager($entityClass)->getRepository($entityClass);
    }

    /**
     * @param string $entityClass
     *
     * @return EntityMetadata
     */
    public function getEntityMetadata($entityClass)
    {
        if (!isset($this->metadata[$entityClass])) {
            $this->metadata[$entityClass] = new EntityMetadata(
                $this->getEntityManager($entityClass)->getClassMetadata($entityClass)
            );
        }

        return $this->metadata[$entityClass];
    }

    /**
     * Gets the full class name for the given entity
     *
     * @param string $entityName The name of the entity. Can be bundle:entity or full class name
     *
     * @return string The full class name
     * @throws \InvalidArgumentException
     */
    public function resolveEntityClass($entityName)
    {
        $split = explode(':', $entityName);
        if (count($split) <= 1) {
            // The given entity name is not in bundle:entity format. Suppose that it is the full class name
            return $entityName;
        } elseif (count($split) > 2) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Incorrect entity name: %s. Expected the full class name or bundle:entity.',
                    $entityName
                )
            );
        }

        return $this->doctrine->getAliasNamespace($split[0]) . '\\' . $split[1];
    }

    /**
     * @param QueryBuilder $qb
     *
     * @return string
     *
     * @throws \RuntimeException
     */
    public function getRootAlias(QueryBuilder $qb)
    {
        $aliases = $qb->getRootAliases();
        if (count($aliases) !== 1) {
            if (count($aliases) === 0) {
                throw new \RuntimeException(
                    'Cannot get root alias. A query builder has no root entity.'
                );
            } else {
                throw new \RuntimeException(
                    'Cannot get root alias. A query builder has more than one root entity.'
                );
            }
        }

        return $aliases[0];
    }

    /**
     * @param QueryBuilder $qb
     *
     * @return string
     *
     * @throws \RuntimeException
     */
    public function getRootEntityClass(QueryBuilder $qb)
    {
        $entities = $qb->getRootEntities();
        if (count($entities) !== 1) {
            if (count($entities) === 0) {
                throw new \RuntimeException(
                    'Cannot get root entity class. A query builder has no root entity.'
                );
            } else {
                throw new \RuntimeException(
                    'Cannot get root entity class. A query builder has more than one root entity.'
                );
            }
        }

        return $this->resolveEntityClass($entities[0]);
    }

    /**
     * Gets the name of entity identifier field if an entity has a single-field identifier
     *
     * @param string $entityClass
     *
     * @return string
     */
    public function getEntityIdFieldName($entityClass)
    {
        return $this->getEntityMetadata($entityClass)->getSingleIdentifierFieldName();
    }
}


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

    <style name="dividerVertical">
        <item name="android:background">?android:attr/dividerVertical</item>
    </style>

    <style name="flatButton" parent="android:attr/borderlessButtonStyle">
        <item name="android:background">@android:color/transparent</item>
    </style>

</resources>