text:
<!--
@license
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<script>

  Polymer.Base = {

    // pluggable features
    // `this` context is a prototype, not an instance
    _addFeature: function(feature) {
      this.extend(this, feature);
    },

    // `this` context is a prototype, not an instance
    registerCallback: function() {
      this._registerFeatures();  // abstract
      this._doBehavior('registered'); // abstract
    },

    createdCallback: function() {
      Polymer.telemetry.instanceCount++;
      this.root = this;
      this._doBehavior('created'); // abstract
      this._initFeatures(); // abstract
    },

    // reserved for canonical behavior
    attachedCallback: function() {
      this.isAttached = true;
      this._doBehavior('attached'); // abstract
    },

    // reserved for canonical behavior
    detachedCallback: function() {
      this.isAttached = false;
      this._doBehavior('detached'); // abstract
    },

    // reserved for canonical behavior
    attributeChangedCallback: function(name) {
      this.setAttributeToProperty(this, name);
      this._doBehavior('attributeChanged', arguments); // abstract
    },

    // copy own properties from `api` to `prototype`
    extend: function(prototype, api) {
      if (prototype && api) {
        Object.getOwnPropertyNames(api).forEach(function(n) {
          this.copyOwnProperty(n, api, prototype);
        }, this);
      }
      return prototype || api;
    },

    copyOwnProperty: function(name, source, target) {
      var pd = Object.getOwnPropertyDescriptor(source, name);
      if (pd) {
        Object.defineProperty(target, name, pd);
      }
    }

  };

  if (Object.__proto__) {
    Polymer.Base.chainObject = function(object, inherited) {
      if (object && inherited && object !== inherited) {
        object.__proto__ = inherited;
      }
      return object;
    };
  } else {
    Polymer.Base.chainObject = function(object, inherited) {
      if (object && inherited && object !== inherited) {
        var chained = Object.create(inherited);
        object = Polymer.Base.extend(chained, object);
      }
      return object;
    };
  }

  Polymer.Base = Polymer.Base.chainObject(Polymer.Base, HTMLElement.prototype);

  // TODO(sjmiles): ad hoc telemetry
  Polymer.telemetry.instanceCount = 0;

</script>


text:
package main

import (
	"github.com/stretchr/testify/assert"
	"os"
	"strings"
	"testing"
)

func TestDefaultConfigFilePath(t *testing.T) {
	expectedPath := os.Getenv("HOME") + "/.stash"
	path := DefaultConfigPath()
	assert.Equal(t, path, expectedPath)
}

func TestConvertFileToJson(t *testing.T) {
	mockFile := []byte(`{"test":"value"}`)
	json, _ := convertFileToMap(mockFile)
	assert.Equal(t, json["test"], "value")
}

func TestErrorReturnedWithInvalidJson(t *testing.T) {
	mockFile := []byte(`{"test" ->broken"}`)
	_, err := convertFileToMap(mockFile)
	assert.NotNil(t, err)
}

func TestConvertMapToJsonString(t *testing.T) {
	mapFile := map[string]string{"test": "value"}
	jsonValue, _ := convertConfigToJson(mapFile)
	assert.Equal(t, string(jsonValue), `{"test":"value"}`)
}

func TestAddToStash(t *testing.T) {
	stash := Stash{values: map[string]string{}}
	stash.Add("test", "value")
	assert.Equal(t, stash.Get("test"), "value")
}

func TestBuildStashFromReader(t *testing.T) {
	stash, _ := buildStashFromBuffer(strings.NewReader(`{"loaded":"data"}`))
	assert.Equal(t, stash.Get("loaded"), "data")
}

func TestFormatOutput(t *testing.T) {
	stash := Stash{values: map[string]string{"test": "value"}}
	output := stash.Format()
	assert.Equal(t, output, "test => value\n")
}

redpajama_set_name: RedPajamaGithub


text:
package com.bagri.server.hazelcast.task.schema;

import static com.bagri.core.server.api.CacheConstants.*;
import static com.bagri.server.hazelcast.serialize.TaskSerializationFactory.cli_CleanSchemaTask;
import static com.bagri.server.hazelcast.util.HazelcastUtils.findSchemaInstance;

import java.io.IOException;
import java.util.concurrent.Callable;

import org.springframework.beans.factory.annotation.Autowired;

import com.bagri.core.model.Query;
import com.bagri.server.hazelcast.impl.HealthManagementImpl;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.IMap;
import com.hazelcast.core.ReplicatedMap;
import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.spring.context.SpringAware;

@SpringAware
public class SchemaDocCleaner extends SchemaProcessingTask implements Callable<Boolean> {

	private boolean evictOnly;
	private HealthManagementImpl hMgr;

	public SchemaDocCleaner() {
		super();
	}

	public SchemaDocCleaner(String schemaName, boolean evictOnly) {
		super(schemaName);
		this.evictOnly = evictOnly;
	}

    @Autowired
	public void setHealthManagement(HealthManagementImpl hMgr) {
		this.hMgr = hMgr;
	}

	@Override
	public Boolean call() throws Exception {
    	logger.trace("call.enter; schema: {}", schemaName);
    	boolean result = false;
		HazelcastInstance hz = findSchemaInstance(schemaName);
		if (hz != null) {
			// get docs caches and clean them
			cleanCache(hz, CN_XDM_CONTENT);
			cleanCache(hz, CN_XDM_DOCUMENT);
			cleanCache(hz, CN_XDM_ELEMENT);
			cleanCache(hz, CN_XDM_INDEX);
			cleanCache(hz, CN_XDM_RESULT);
			//cleanCache(hz, CN_XDM_QUERY);
		    ReplicatedMap<Integer, Query> xqCache = hz.getReplicatedMap(CN_XDM_QUERY);
		    xqCache.clear();
			hMgr.clearState();
			System.gc();
			result = true;
		}
    	logger.trace("call.exit; schema {} cleaned: {}", schemaName, result);
		return result;
	}

	private void cleanCache(HazelcastInstance hz, String cacheName) {
		IMap cache = hz.getMap(cacheName);
		if (evictOnly) {
			cache.evictAll();
		} else {
			cache.clear();
		}
	}

	@Override
	public int getId() {
		return cli_CleanSchemaTask;
	}

	@Override
	public void readData(ObjectDataInput in) throws IOException {
		super.readData(in);
		evictOnly = in.readBoolean();
	}

	@Override
	public void writeData(ObjectDataOutput out) throws IOException {
		super.writeData(out);
		out.writeBoolean(evictOnly);
	}
}


text:
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../tf-imports/plottable.html">
<link rel="import" href="../tf-imports/lodash.html">

<!--
tf-chart (TFChart) creates an element that draws a line chart for displaying event values.
It has the following settable properties:
  tag: (required, string) - the name of the tag to load for this chart
  selectedRuns: (required, string[]) - the runs the chart should display
  xType: (required, string) - the way to display x values - allows "step" or "wall_time"
  dataCoordinator: (required, TF.DataCoordinator) - the data coordinator for talking to backend
  colorScale: (required, Plottable.Scales.Color) - maps from runs to colors
  tooltipUpdater: (required, function) - allows the chart to modify tooltips

It exposes the following methods:
  redraw() - cause the chart to re-render (useful if e.g. container size changed)

The data is expected to be an array of [wall_time, step, value] arrays.
The wall_time is serialized as seconds since epoch.
-->
<dom-module id="tf-chart">
  <template>
    <svg id="chartsvg"></svg>
    <style>
      :host {
        -webkit-user-select: none;
        -moz-user-select: none;
        display: flex;
        flex-direction: column;
        flex-grow: 1;
        flex-shrink: 1;
      }
      svg {
        -webkit-user-select: none;
        -moz-user-select: none;
        flex-grow: 1;
        flex-shrink: 1;
      }
      .plottable .crosshairs line.guide-line {
        stroke: #777;
      }
    </style>
  </template>
  <script src="dragZoomInteraction.js"></script>
  <script src="tf-chart.js"></script>
  <script>
    Polymer({
      is: "tf-chart",
      properties: {
        type: String, // "scalar" or "compressedHistogram"
        _chart: Object,
        colorScale: Object,
        tag: String,
        selectedRuns: Array,
        xType: String,
        dataProvider: Function,
        tooltipUpdater: Function,
        _initialized: Boolean,
      },
      observers: [
        "_makeChart(type, tag, dataProvider, tooltipUpdater, xType, colorScale, _initialized)",
        "_changeRuns(_chart, selectedRuns.*)"
      ],
      _changeRuns: function(chart) {
        if (chart.tag !== this.tag) {
          return; // hack around some weird polymer bug :(
        }
        this._chart.changeRuns(this.selectedRuns);
        this.redraw();
      },
      redraw: function() {
        this._chart.redraw();
      },
      reload: function() {
        this._chart.reload();
      },
      _constructor: function(type) {
        if (type === "scalar") {
          return TF.LineChart;
        } else if (type === "compressedHistogram") {
          return TF.HistogramChart;
        } else {
          throw new Error("Unrecognized chart type");
        }
      },
      _makeChart: function(type, tag, dataProvider, tooltipUpdater, xType, colorScale, _initialized) {
        if (!_initialized) {
          return;
        }
        if (this._chart) this._chart.destroy();
        var cns = this._constructor(type);
        var chart = new cns(tag, dataProvider, tooltipUpdater, xType, colorScale);
        var svg = d3.select(this.$.chartsvg);
        this.async(function() {
          chart.renderTo(svg);
          this._chart = chart;
        }, 350);
      },
      attached: function() {
        this._initialized = true;
      },
      detached: function() {
        this._initialized = false;
      }
    });
  </script>
</dom-module>


text:
import q from "q";
import assert from "assert";
import App from "../../models/app";
import pkgcloud from "pkgcloud";

export default class AzureReleaseFinder {
    constructor(account, key) {
        this.client = pkgcloud.storage.createClient({
            provider: "azure",
            storageAccount: account,
            storageAccessKey: key
        });
    }

    async release(app, name) {
        assert(app instanceof App, "app is not an instance of App");

        try {
            const releases = await this.releases(app);

            return releases.find(release => release.name === name) || null;
        } catch (e) {
            return null;
        }
    }

    async releases(app) {
        assert(app instanceof App, "app is not an instance of App");

        try {
            const files = await q.ninvoke(this.client, "getFiles", app.name);
            const releases = {};
            const promises = [];

            files.forEach(file => {
                const parts = file.name.split("/");
                const release = parts[0];

                if (release && !releases[release]) {
                    releases[release] = { name: release };
                }

                if (parts[1] === "notes") {
                    const deferred = q.defer();

                    promises.push(deferred.promise);

                    try {
                        const notes = this.client.download({ container: file.container, remote: file.name });
                        let contents = "";

                        notes.on("data", buffer => { contents += buffer.toString(); });
                        notes.on("end", () => {
                            releases[release].notes = contents;

                            deferred.resolve();
                        });
                    } catch (e) {
                        deferred.resolve();
                    }
                }
            });

            return q.all(promises).then(() => Object.values(releases));
        } catch (e) {
            return [];
        }
    }
}


text:
/**
 * This software is released as part of the Pumpernickel project.
 *
 * All com.pump resources in the Pumpernickel project are distributed under the
 * MIT License:
 * https://github.com/mickleness/pumpernickel/raw/master/License.txt
 *
 * More information about the Pumpernickel project is available here:
 * https://mickleness.github.io/pumpernickel/
 */
package com.pump.animation.quicktime.atom;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * This is the SampleDescriptionEntry for a VideoSampleDescriptionAtom.
 */
public class VideoSampleDescriptionEntry extends SampleDescriptionEntry {

	/**
	 * Create a VideoSampleDescriptionEntry for JPEG-based frames.
	 */
	public static VideoSampleDescriptionEntry createJPEGDescription(int width,
			int height) {
		VideoSampleDescriptionEntry e = new VideoSampleDescriptionEntry("jpeg",
				1, width, height);
		e.compressorName = "Photo - JPEG";
		e.version = 1;
		e.revision = 1;
		e.temporalQuality = 0;
		e.spatialQuality = 512;
		return e;
	}

	/**
	 * Create a VideoSampleDescriptionEntry for PNG-based frames.
	 */
	public static VideoSampleDescriptionEntry createPNGDescription(int width,
			int height) {
		VideoSampleDescriptionEntry e = new VideoSampleDescriptionEntry("png ",
				1, width, height);
		e.compressorName = "Photo - PNG";
		e.version = 1;
		e.revision = 1;
		e.temporalQuality = 0;
		e.spatialQuality = 512;
		return e;
	}

	/**
	 * A 16-bit integer indicating the version number of the compressed data.
	 * This is set to 0, unless a compressor has changed its format.
	 */
	protected int version = 0;

	/** A 16-bit integer that must be set to 0. */
	protected int revision = 0;

	/**
	 * A 32-bit integer that specifies the developer of the compressor that
	 * generated the compressed data. Often this field contains 'appl' to
	 * indicate Apple Computer, Inc.
	 */
	protected String vendor = "pump";

	/**
	 * A 32-bit integer containing a value from 0 to 1023 indicating the degree
	 * of temporal compression.
	 */
	protected long temporalQuality = 0;

	/**
	 * A 32-bit integer containing a value from 0 to 1024 indicating the degree
	 * of spatial compression.
	 */
	protected long spatialQuality = 512;

	/**
	 * A 16-bit integer that specifies the width of the source image in pixels.
	 */
	protected int width;

	/**
	 * A 16-bit integer that specifies the height of the source image in pixels.
	 */
	protected int height;

	/**
	 * A 32-bit fixed-point number containing the horizontal resolution of the
	 * image in pixels for inch.
	 */
	protected float horizontalResolution = 72;

	/**
	 * A 32-bit fixed-point number containing the vertical resolution of the
	 * image in pixels for inch.
	 */
	protected float verticalResolution = 72;

	/** A 32-bit integer that must be set to zero. */
	protected long dataSize = 0;

	/**
	 * A 16-bit integer that indicates how many frames of compressed data are
	 * stored in each sample. Usually set to 1.
	 */
	protected int frameCount = 1;

	/**
	 * A Pascal string containing the name of the creator that compressed an
	 * image, such as "jpeg".
	 */
	protected String compressorName = "";

	/**
	 * A 16-bit integer that indicates the pixel depth of the compressed image.
	 * Values of 1, 2, 4, 8, 16, 24, and 32 indicate the depth of color images.
	 * The value of 32 should be used only if the image contains an alpha
	 * channel. Values of 34, 36, and 40 indicate 2-, 4-, and 9-bit grayscale,
	 * respectively, for grayscale images.
	 */
	protected int depth = 24;

	/**
	 * A 16-bit integer that identifies which color table ot use. If this field
	 * is set to -1, the default color table should be used for the specified
	 * depth. For all depths below 16 bits per pixels, this indicates a standard
	 * macintosh color table for the specified depth. Depths of 16, 24, and 32
	 * have no color table.
	 */
	protected int colorTableID = 65535;

	public VideoSampleDescriptionEntry(String type, int dataReference, int w,
			int h) {
		super(type, dataReference);
		width = w;
		height = h;
	}

	public VideoSampleDescriptionEntry(InputStream in) throws IOException {
		super(in);
		version = Atom.read16Int(in);
		revision = Atom.read16Int(in);
		vendor = Atom.read32String(in);
		temporalQuality = Atom.read32Int(in);
		spatialQuality = Atom.read32Int(in);
		width = Atom.read16Int(in);
		height = Atom.read16Int(in);
		horizontalResolution = Atom.read16_16Float(in);
		verticalResolution = Atom.read16_16Float(in);
		dataSize = Atom.read32Int(in);
		frameCount = Atom.read16Int(in);
		compressorName = Atom.read32BytePascalString(in);
		depth = Atom.read16Int(in);
		colorTableID = Atom.read16Int(in);
	}

	@Override
	protected void write(OutputStream out) throws IOException {
		Atom.write32Int(out, getSize());
		Atom.write32String(out, type);
		Atom.write48Int(out, 0);
		Atom.write16Int(out, dataReference);

		Atom.write16Int(out, version);
		Atom.write16Int(out, revision);
		Atom.write32String(out, vendor);
		Atom.write32Int(out, temporalQuality);
		Atom.write32Int(out, spatialQuality);
		Atom.write16Int(out, width);
		Atom.write16Int(out, height);
		Atom.write16_16Float(out, horizontalResolution);
		Atom.write16_16Float(out, verticalResolution);
		Atom.write32Int(out, dataSize);
		Atom.write16Int(out, frameCount);
		Atom.write32BytePascalString(out, compressorName);
		Atom.write16Int(out, depth);
		Atom.write16Int(out, colorTableID);
	}

	@Override
	protected long getSize() {
		return 86;
	}

	@Override
	public String toString() {
		return "VideoSampleDescriptionEntry[ type=\"" + type + "\", "
				+ "dataReference=" + dataReference + ", " + "version=" + version
				+ ", " + "revision=" + revision + ", " + "vendor=\"" + vendor
				+ "\", " + "temporalQuality=" + temporalQuality + ", "
				+ "spatialQuality=" + spatialQuality + ", " + "width=" + width
				+ ", " + "height=" + height + ", " + "horizontalResolution="
				+ horizontalResolution + ", " + "verticalResolution="
				+ verticalResolution + ", " + "dataSize=" + dataSize + ", "
				+ "frameCount=" + frameCount + ", " + "compressorName=\""
				+ compressorName + "\", " + "depth=" + depth + ", "
				+ "colorTableID=" + colorTableID + " ]";
	}

	/**
	 * Return a 16-bit integer indicating the version number of the compressed
	 * data. This is set to 0, unless a compressor has changed its format.
	 */
	public int getVersion() {
		return version;
	}

	/** Return a 16-bit integer that must be set to 0. */
	public int getRevision() {
		return revision;
	}

	/**
	 * Return a 32-bit integer that specifies the developer of the compressor
	 * that generated the compressed data. Often this field contains 'appl' to
	 * indicate Apple Computer, Inc.
	 */
	public String getVendor() {
		return vendor;
	}

	/**
	 * Return a 32-bit integer containing a value from 0 to 1023 indicating the
	 * degree of temporal compression.
	 */
	public long getTemporalQuality() {
		return temporalQuality;
	}

	/**
	 * Return a 32-bit integer containing a value from 0 to 1024 indicating the
	 * degree of spatial compression.
	 */
	public long getSpatialQuality() {
		return spatialQuality;
	}

	/**
	 * Return a 16-bit integer that specifies the width of the source image in
	 * pixels.
	 */
	public int getWidth() {
		return width;
	}

	/**
	 * Return a 16-bit integer that specifies the height of the source image in
	 * pixels.
	 */
	public int getHeight() {
		return height;
	}

	/**
	 * Return a 32-bit fixed-point number containing the horizontal resolution
	 * of the image in pixels for inch.
	 */
	public float getHorizontalResolution() {
		return horizontalResolution;
	}

	/**
	 * Return a 32-bit fixed-point number containing the vertical resolution of
	 * the image in pixels for inch.
	 */
	public float getVerticalResolution() {
		return verticalResolution;
	}

	/** Return 32-bit integer that must be set to zero. */
	public long getDataSize() {
		return dataSize;
	}

	/**
	 * Return a 16-bit integer that indicates how many frames of compressed data
	 * are stored in each sample. Usually set to 1.
	 */
	public int getFrameCount() {
		return frameCount;
	}

	/**
	 * Return a Pascal string containing the name of the creator that compressed
	 * an image, such as "jpeg".
	 */
	public String getCompressorName() {
		return compressorName;
	}

	/**
	 * Return a 16-bit integer that indicates the pixel depth of the compressed
	 * image. Values of 1, 2, 4, 8, 16, 24, and 32 indicate the depth of color
	 * images. The value of 32 should be used only if the image contains an
	 * alpha channel. Values of 34, 36, and 40 indicate 2-, 4-, and 9-bit
	 * grayscale, respectively, for grayscale images.
	 */
	public int getDepth() {
		return depth;
	}

	/**
	 * Return a 16-bit integer that identifies which color table to use. If this
	 * field is set to -1, the default color table should be used for the
	 * specified depth. For all depths below 16 bits per pixels, this indicates
	 * a standard macintosh color table for the specified depth. Depths of 16,
	 * 24, and 32 have no color table.
	 */
	public int getColorTableID() {
		return colorTableID;
	}
}


text:
class UsersController < ApplicationController
  def index
    render plain: "index"
  end

  def create
    render plain: "create"
  end

  def delete
    render plain: "delete"
  end

  def show
    render plain: "show"
  end
end


text:
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>The source code</title>
    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />

/**
 *
 * Norwegian translation (Nynorsk: no-NN)
 * By Tore Kjørsvik 21-January-2008
 *
 */

Ext.UpdateManager.defaults.indicatorText = '
Lastar...
';

if(Ext.View){
  Ext.View.prototype.emptyText = "";
}

if(Ext.grid.GridPanel){
  Ext.grid.GridPanel.prototype.ddText = "{0} markert(e) rad(er)";
}

if(Ext.TabPanelItem){
  Ext.TabPanelItem.prototype.closeText = "Lukk denne fana";
}

if(Ext.form.Field){
  Ext.form.Field.prototype.invalidText = "Verdien i dette feltet er ugyldig";
}

if(Ext.LoadMask){
  Ext.LoadMask.prototype.msg = "Lastar...";
}

Date.monthNames = [
  "Januar",
  "Februar",
  "Mars",
  "April",
  "Mai",
  "Juni",
  "Juli",
  "August",
  "September",
  "Oktober",
  "November",
  "Desember"
];

Date.getShortMonthName = function(month) {
  return Date.monthNames[month].substring(0, 3);
};

Date.monthNumbers = {
  Jan : 0,
  Feb : 1,
  Mar : 2,
  Apr : 3,
  Mai : 4,
  Jun : 5,
  Jul : 6,
  Aug : 7,
  Sep : 8,
  Okt : 9,
  Nov : 10,
  Des : 11
};

Date.getMonthNumber = function(name) {
  return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()];
};

Date.dayNames = [
  "Søndag",
  "Måndag",
  "Tysdag",
  "Onsdag",
  "Torsdag",
  "Fredag",
  "Laurdag"
];

Date.getShortDayName = function(day) {
  return Date.dayNames[day].substring(0, 3);
};

if(Ext.MessageBox){
  Ext.MessageBox.buttonText = {
    ok     : "OK",
    cancel : "Avbryt",
    yes    : "Ja",
    no     : "Nei"
  };
}

if(Ext.util.Format){
  Ext.util.Format.date = function(v, format){
    if(!v) return "";
    if(!(v instanceof Date)) v = new Date(Date.parse(v));
    return v.dateFormat(format || "d.m.Y");
  };
}

if(Ext.DatePicker){
  Ext.apply(Ext.DatePicker.prototype, {
    todayText         : "I dag",
    minText           : "Denne datoen er før tidlegaste tillatne dato",
    maxText           : "Denne datoen er etter seinaste tillatne dato",
    disabledDaysText  : "",
    disabledDatesText : "",
    monthNames	      : Date.monthNames,
    dayNames		      : Date.dayNames,
    nextText          : 'Neste månad (Control+Pil Høgre)',
    prevText          : 'Førre månad (Control+Pil Venstre)',
    monthYearText     : 'Velj ein månad (Control+Pil Opp/Ned for å skifte år)',
    todayTip          : "{0} (Mellomrom)",
    format            : "d.m.y",
    okText            : " OK ",
    cancelText        : "Avbryt",
    startDay          : 1
  });
}

if(Ext.PagingToolbar){
  Ext.apply(Ext.PagingToolbar.prototype, {
    beforePageText : "Side",
    afterPageText  : "av {0}",
    firstText      : "Første sida",
    prevText       : "Førre sida",
    nextText       : "Neste sida",
    lastText       : "Siste sida",
    refreshText    : "Oppdater",
    displayMsg     : "Viser {0} - {1} av {2}",
    emptyMsg       : 'Ingen data å vise'
  });
}

if(Ext.form.TextField){
  Ext.apply(Ext.form.TextField.prototype, {
    minLengthText : "Den minste lengda for dette feltet er {0}",
    maxLengthText : "Den største lengda for dette feltet er {0}",
    blankText     : "Dette feltet er påkravd",
    regexText     : "",
    emptyText     : null
  });
}

if(Ext.form.NumberField){
  Ext.apply(Ext.form.NumberField.prototype, {
    minText : "Den minste verdien for dette feltet er {0}",
    maxText : "Den største verdien for dette feltet er {0}",
    nanText : "{0} er ikkje eit gyldig nummer"
  });
}

if(Ext.form.DateField){
  Ext.apply(Ext.form.DateField.prototype, {
    disabledDaysText  : "Deaktivert",
    disabledDatesText : "Deaktivert",
    minText           : "Datoen i dette feltet må vere etter {0}",
    maxText           : "Datoen i dette feltet må vere før {0}",
    invalidText       : "{0} er ikkje ein gyldig dato - han må vere på formatet {1}",
    format            : "d.m.y",
    altFormats        : "d.m.Y|d/m/y|d/m/Y|d-m-y|d-m-Y|d.m|d/m|d-m|dm|dmy|dmY|Y-m-d|d"
  });
}

if(Ext.form.ComboBox){
  Ext.apply(Ext.form.ComboBox.prototype, {
    loadingText       : "Lastar...",
    valueNotFoundText : undefined
  });
}

if(Ext.form.VTypes){
   Ext.apply(Ext.form.VTypes, {
      emailText    : 'Dette feltet skal vere ei epost adresse på formatet "bruker@domene.no"',
      urlText      : 'Dette feltet skal vere ein link (URL) på formatet "http:/'+'/www.domene.no"',
      alphaText    : 'Dette feltet skal berre innehalde bokstavar og _',
      alphanumText : 'Dette feltet skal berre innehalde bokstavar, tal og _'
   });
}

if(Ext.form.HtmlEditor){
  Ext.apply(Ext.form.HtmlEditor.prototype, {
    createLinkText : 'Ver venleg og skriv inn URL for lenken:',
    buttonTips : {
      bold : {
        title: 'Feit (Ctrl+B)',
        text: 'Gjer den valde teksten feit.',
        cls: 'x-html-editor-tip'
      },
      italic : {
        title: 'Kursiv (Ctrl+I)',
        text: 'Gjer den valde teksten kursiv.',
        cls: 'x-html-editor-tip'
      },
      underline : {
        title: 'Understrek (Ctrl+U)',
        text: 'Understrek den valde teksten.',
        cls: 'x-html-editor-tip'
      },
      increasefontsize : {
        title: 'Forstørr tekst',
        text: 'Gjer fontstorleik større.',
        cls: 'x-html-editor-tip'
      },
      decreasefontsize : {
        title: 'Forminsk tekst',
        text: 'Gjer fontstorleik mindre.',
        cls: 'x-html-editor-tip'
      },
      backcolor : {
        title: 'Tekst markeringsfarge',
        text: 'Endre bakgrunnsfarge til den valde teksten.',
        cls: 'x-html-editor-tip'
      },
      forecolor : {
        title: 'Font farge',
        text: 'Endre farge på den valde teksten.',
        cls: 'x-html-editor-tip'
      },
      justifyleft : {
        title: 'Venstrejuster tekst',
        text: 'Venstrejuster teksten.',
        cls: 'x-html-editor-tip'
      },
      justifycenter : {
        title: 'Sentrer tekst',
        text: 'Sentrer teksten.',
        cls: 'x-html-editor-tip'
      },
      justifyright : {
        title: 'Høgrejuster tekst',
        text: 'Høgrejuster teksten.',
        cls: 'x-html-editor-tip'
      },
      insertunorderedlist : {
        title: 'Punktliste',
        text: 'Start ei punktliste.',
        cls: 'x-html-editor-tip'
      },
      insertorderedlist : {
        title: 'Nummerert liste',
        text: 'Start ei nummerert liste.',
        cls: 'x-html-editor-tip'
      },
      createlink : {
        title: 'Lenke',
        text: 'Gjer den valde teksten til ei lenke.',
        cls: 'x-html-editor-tip'
      },
      sourceedit : {
        title: 'Rediger kjelde',
        text: 'Bytt til kjelderedigeringsvising.',
        cls: 'x-html-editor-tip'
      }
    }
  });
}

if(Ext.grid.GridView){
  Ext.apply(Ext.grid.GridView.prototype, {
    sortAscText  : "Sorter stigande",
    sortDescText : "Sorter fallande",
    lockText     : "Lås kolonne",
    unlockText   : "Lås opp kolonne",
    columnsText  : "Kolonner"
  });
}

if(Ext.grid.GroupingView){
  Ext.apply(Ext.grid.GroupingView.prototype, {
    emptyGroupText : '(Ingen)',
    groupByText    : 'Grupper etter dette feltet',
    showGroupsText : 'Vis i grupper'
  });
}

if(Ext.grid.PropertyColumnModel){
  Ext.apply(Ext.grid.PropertyColumnModel.prototype, {
    nameText   : "Namn",
    valueText  : "Verdi",
    dateFormat : "d.m.Y"
  });
}

if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){
  Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, {
    splitTip            : "Dra for å endre storleik.",
    collapsibleSplitTip : "Dra for å endre storleik. Dobbelklikk for å skjule."
  });
}


text:
<!--
 * Copyright (c) 2011 The Chromium Authors. All rights reserved.  Use of this
 * source code is governed by a BSD-style license that can be found in the
 * LICENSE file.
-->
<html>
<head>
</head>
<body>
<canvas id="canvas" width="27" height="23">
<script src="update2.js"></script>
</body>
</html>


text:
package org.pentaho.di.plugins.database;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.Driver;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Types;

/**
 * DriverProxyInvocationChain is a temporary solution for interacting with Hive drivers. At the time this class was added,
 * many methods from the JDBC API had not yet been implemented and would instead throw SQLExceptions. Also, some methods
 * such as HiveDatabaseMetaData.getTables() did not return any values.  For these reasons, a dynamic proxy chain was put in
 * place, in order to intercept methods that would otherwise not function properly, and instead inject working and/or
 * default functionality.
 *
 * The "chain" part of this class is a result of not having access to all the necessary objects at driver creation time.
 * For this reason, we have to intercept methods that would return such objects, then create and return a proxy to those
 * objects. There are a number of objects and methods to which this applies, so the result is a "chain" of getting
 * access to objects via a proxy, then returning a proxy to those objects, which in turn may return proxied objects for its
 * methods, and so on.
 *
 * The large amount of reflection used here is because not all Hadoop distributions support both Hive and Hive 2. Thus
 * before proxying or anything, we need to make sure we have the classes we need at runtime.
 */
public class DriverProxyInvocationChain {

  /** The initialized. */
  protected static boolean initialized = false;

  /**
   * Gets the proxy.
   *
   * @param intf the intf
   * @param obj the obj
   * @return the proxy
   */
  public static Driver getProxy(Class<? extends Driver> intf, final Driver obj) {
    if(!initialized) {
      init();
    }
      return (Driver) Proxy.newProxyInstance(obj.getClass().getClassLoader(),
                        new Class[] { intf }, new DriverInvocationHandler(obj));
  }

  /**
   * Inits the.
   */
  protected static void init() {

    initialized = true;
  }

  /**
   * DriverInvocationHandler is a proxy handler class for java.sql.Driver. However the code in this file is
   * specifically for handling Hive JDBC calls, and therefore should not be used to proxy any other JDBC objects
   * besides those provided by Hive.
   */
  private static class DriverInvocationHandler implements InvocationHandler {

    /** The driver. */
    Driver driver;

    /**
     * Instantiates a new Driver proxy handler.
     *
     * @param obj the Driver to proxy
     */
    public DriverInvocationHandler(Driver obj) {
        driver = obj;
    }

      /**
       * Intercepts methods called on the Driver to possibly perform alternate processing.
       *
       * @param proxy the proxy object
       * @param method the method being invoked
       * @param args the arguments to the method
       * @return the object returned by whatever processing takes place
       * @throws Throwable if an error occurs during processing
       */
      @Override
      public Object invoke(final Object proxy, Method method, Object[] args) throws Throwable {

        try {
          Object o = method.invoke(driver, args);
          if(o instanceof Connection) {

            // Intercept the Connection object so we can proxy that too
            return (Connection)Proxy.newProxyInstance(o.getClass().getClassLoader(),
                new Class[] { Connection.class }, new ConnectionInvocationHandler((Connection)o));
          }
          else {
            return o;
          }
        }
        catch(Throwable t) {
          throw (t instanceof InvocationTargetException) ? t.getCause() : t;
        }
      }
  }

  /**
   * ConnectionInvocationHandler is a proxy handler class for java.sql.Connection. However the code in this file is
   * specifically for handling Hive JDBC calls, and therefore should not be used to proxy any other JDBC objects
   * besides those provided by Hive.
   */
  private static class ConnectionInvocationHandler implements InvocationHandler {

    /** The "real" connection. */
    Connection connection;

    /**
     * Instantiates a new connection invocation handler.
     *
     * @param obj the obj
     */
    public ConnectionInvocationHandler(Connection obj) {
      connection = obj;
    }

    /**
     * Intercepts methods called on the Connection to possibly perform alternate processing.
     *
     * @param proxy the proxy
     * @param method the method
     * @param args the args
     * @return the object
     * @throws Throwable the throwable
     */
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
      Object o = null;
      try {
        o = method.invoke(connection, args);
      }
      catch(Throwable t) {

        if(t instanceof InvocationTargetException) {
          Throwable cause = t.getCause();

          if(cause instanceof SQLException) {
            if(cause.getMessage().equals("Method not supported")) {
              String methodName = method.getName();
              if("createStatement".equals(methodName)) {
                o = createStatement(connection,args);
              }
              else if("setReadOnly".equals(methodName)) {
                o = (Void)null;
              }
              else {
                throw cause;
              }
            }
            else throw cause;
          }
          else {
            throw cause;
          }
        }
        else {
          throw t;
        }

      }
      if(o instanceof DatabaseMetaData) {
        DatabaseMetaData dbmd = (DatabaseMetaData)o;

        // Intercept the DatabaseMetaData object so we can proxy that too
        return (DatabaseMetaData)Proxy.newProxyInstance(dbmd.getClass().getClassLoader(),
            new Class[] { DatabaseMetaData.class }, new DatabaseMetaDataInvocationHandler(dbmd));
      }
      else if(o instanceof PreparedStatement) {
        PreparedStatement st = (PreparedStatement)o;

        // Intercept the Statement object so we can proxy that too
        return (PreparedStatement)Proxy.newProxyInstance(st.getClass().getClassLoader(),
            new Class[] { PreparedStatement.class }, new CaptureResultSetInvocationHandler<PreparedStatement>(st));
      }
      else if(o instanceof Statement) {
        Statement st = (Statement)o;

        // Intercept the Statement object so we can proxy that too
        return (Statement)Proxy.newProxyInstance(st.getClass().getClassLoader(),
            new Class[] { Statement.class }, new CaptureResultSetInvocationHandler<Statement>(st));
      }
      else {
        return o;
      }
    }

    /**
     * Creates a statement for the given Connection with the specified arguments
     *
     * @param c the connection object
     * @param args the arguments
     * @return the statement
     * @throws SQLException the sQL exception
     * @see java.sql.Connection#createStatement(int, int)
     */
    public Statement createStatement(Connection c, Object[] args) throws SQLException {
      if (c.isClosed()) {
        throw new SQLException("Can't create Statement, connection is closed ");
      }

      /* Ignore these for now -- this proxy stuff should go away anyway when the fixes are made to Apache Hive

      int resultSetType = (Integer)args[0];
      int resultSetConcurrency = (Integer)args[1];

      if(resultSetType != ResultSet.TYPE_FORWARD_ONLY) {
        throw new SQLException(
            "Invalid parameter to createStatement() only TYPE_FORWARD_ONLY is supported ("+resultSetType+"!="+ResultSet.TYPE_FORWARD_ONLY+")");
      }

      if(resultSetConcurrency != ResultSet.CONCUR_READ_ONLY) {
        throw new SQLException(
            "Invalid parameter to createStatement() only CONCUR_READ_ONLY is supported");
      }*/
      return c.createStatement();
    }
  }

 /**
  * DatabaseMetaDataInvocationHandler is a proxy handler class for java.sql.DatabaseMetaData. However the code in this file is
   * specifically for handling Hive JDBC calls, and therefore should not be used to proxy any other JDBC objects
   * besides those provided by Hive.
  */
 private static class DatabaseMetaDataInvocationHandler implements InvocationHandler {

   /** The "real" database metadata object. */
   DatabaseMetaData t;

    /**
     * Instantiates a new database meta data invocation handler.
     *
     * @param t the database metadata object to proxy
     */
    public DatabaseMetaDataInvocationHandler(DatabaseMetaData t) {
      this.t = t;
    }

    /**
     * Intercepts methods called on the DatabaseMetaData object to possibly perform alternate processing.
     *
     * @param proxy the proxy
     * @param method the method
     * @param args the args
     * @return the object
     * @throws Throwable the throwable
     */
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

      try {

        // Need to intercept getIdentifierQuoteString() before trying the driver version, as our "fixed"
        // drivers return a single quote when it should be empty.
        /*String methodName = method.getName();
        if("getIdentifierQuoteString".equals(methodName)) {
          return getIdentifierQuoteString();
        }*/

        // try to invoke the method as-is
        Object o = method.invoke(t, args);
        if(o instanceof ResultSet) {
          ResultSet r = (ResultSet)o;

          return (ResultSet)Proxy.newProxyInstance(r.getClass().getClassLoader(),
              new Class[] { ResultSet.class }, new ResultSetInvocationHandler(r));
        }
        else {
          return o;
        }
      }
      catch(Throwable t) {
        if(t instanceof InvocationTargetException) {
          Throwable cause = t.getCause();
          throw cause;
        }
        else {
          throw t;
        }
      }
    }

    /**
     * Returns the identifier quote string.  This is HiveQL specific
     *
     * @return String the quote string for identifiers in HiveQL
     * @throws SQLException if any SQL error occurs
     */
    public String getIdentifierQuoteString() throws SQLException {
      return "";
    }

    /**
     * Gets the tables for the specified database.
     *
     * @param originalObject the original object
     * @param dbMetadataClass the db metadata class
     * @param statementClass the statement class
     * @param clientClass the client class
     * @param catalog the catalog
     * @param schemaPattern the schema pattern
     * @param tableNamePattern the table name pattern
     * @param types the types
     * @return the tables
     * @throws Exception the exception
     */
    public ResultSet getTables(Object originalObject, Class<? extends DatabaseMetaData> dbMetadataClass,
                               Class<? extends Statement> statementClass, Class<?> clientClass,
                               String catalog, String schemaPattern,
                               String tableNamePattern, String[] types) throws Exception {

      boolean tables = false;
      if(types == null) {
        tables = true;
      }
      else {
        for(String type : types) {
          if("TABLE".equals(type)) tables = true;
        }
      }

      // If we're looking for tables, execute "show tables" query instead
      if(tables) {
        Method getClient = dbMetadataClass.getDeclaredMethod("getClient");
        Constructor<? extends Statement> statementCtor = (Constructor<? extends Statement>) statementClass.getDeclaredConstructor(clientClass);
        Statement showTables = statementCtor.newInstance(clientClass.cast(getClient.invoke(originalObject)));
        showTables.executeQuery("show tables");
        ResultSet rs = showTables.getResultSet();
        return rs;
      }
      else {
        Method getTables = dbMetadataClass.getDeclaredMethod("getTables");
        ResultSet rs = (ResultSet)getTables.invoke(originalObject, catalog, schemaPattern, tableNamePattern, types);
        return rs;
      }
    }
  }

  /**
   * CaptureResultSetInvocationHandler is a generic proxy handler class for any java.sql.* class that has methods
   * to return ResultSet objects. However the code in this file is specifically for handling Hive JDBC calls, and
   * therefore should not be used to proxy any other JDBC objects besides those provided by Hive.
   *
   * @param <T> the generic type of object whose methods return ResultSet objects
   */
  private static class CaptureResultSetInvocationHandler<T> implements InvocationHandler {

    /** The object whose methods return ResultSet objects. */
    T t;

    /**
     * Instantiates a new capture result set invocation handler.
     *
     * @param t the t
     */
    public CaptureResultSetInvocationHandler(T t) {
      this.t = t;
    }

    /**
     * Intercepts methods called on the object to possibly perform alternate processing.
     *
     * @param proxy the proxy
     * @param method the method
     * @param args the args
     * @return the object
     * @throws Throwable the throwable
     */
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
      // try to invoke the method as-is
      try {
        // Intercept PreparedStatement.getMetaData() to see if it throws an exception
        if("getMetaData".equals(method.getName()) && (args == null || args.length==0)) {
          return getProxiedObject(getMetaData());
        }

        Object po = getProxiedObject(method.invoke(t, args));
        return po;
      }
      catch(InvocationTargetException ite) {
        Throwable cause = ite.getCause();

        if(cause instanceof SQLException) {
          if(cause.getMessage().equals("Method not supported")) {
            String methodName = method.getName();
            // Intercept PreparedStatement.getMetaData() to see if it throws an exception
            if("getMetaData".equals(method.getName()) && (args == null || args.length==0)) {
              return getProxiedObject(getMetaData());
            }
            else {
              throw cause;
            }
          }
          else throw cause;
        }
        else {
          throw cause;
        }
      }
    }

    /**
     *  Returns the result set meta data.  If a result set was not created by running an execute or executeQuery then a null is returned.
     *
     *  @return null is returned if the result set is null
     *  @throws SQLException if an error occurs while getting metadata
     * @see java.sql.PreparedStatement#getMetaData()
     */

    public ResultSetMetaData getMetaData() {
      ResultSetMetaData rsmd = null;
      if(t instanceof Statement) {
        try {
          ResultSet resultSet = ((Statement)t).getResultSet();
          rsmd = (resultSet == null ? null : resultSet.getMetaData());
        }
        catch(SQLException se) {
          rsmd = null;
        }
      }
      return rsmd;
    }

    private Object getProxiedObject(Object o) {

      if(o instanceof ResultSet) {
        ResultSet r = (ResultSet)o;

        return (ResultSet)Proxy.newProxyInstance(r.getClass().getClassLoader(),
            new Class[] { ResultSet.class }, new ResultSetInvocationHandler(r));
      }
      else if(o instanceof ResultSetMetaData) {
        ResultSetMetaData r = (ResultSetMetaData)o;

        return (ResultSetMetaData)Proxy.newProxyInstance(r.getClass().getClassLoader(),
            new Class[] { ResultSetMetaData.class }, new ResultSetMetaDataInvocationHandler(r));
      }
      else {
        return o;
      }
    }
  }

  /**
   * ResultSetInvocationHandler is a proxy handler class for java.sql.ResultSet. However the code in this file is
   * specifically for handling Hive JDBC calls, and therefore should not be used to proxy any other JDBC objects
   * besides those provided by Hive.
   */
  private static class ResultSetInvocationHandler implements InvocationHandler {

    /** The "real" ResultSet object . */
    ResultSet rs;

    /**
     * Instantiates a new result set invocation handler.
     *
     * @param r the r
     */
    public ResultSetInvocationHandler(ResultSet r) {
      rs = r;
    }

    /**
     * Intercepts methods called on the ResultSet to possibly perform alternate processing.
     *
     * @param proxy the proxy
     * @param method the method
     * @param args the args
     * @return the object
     * @throws Throwable the throwable
     */
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

      try {
        // Intercept the getString(String) method to implement the hack for "show tables" vs. getTables()
        if("getString".equals(method.getName()) && args != null && args.length==1 && args[0] instanceof String) {
          return getString((String)args[0]);
        }
        else {
          Object o = method.invoke(rs,args);

          if(o instanceof ResultSetMetaData ) {
            // Intercept the ResultSetMetaData object so we can proxy that too
            return (ResultSetMetaData)Proxy.newProxyInstance(o.getClass().getClassLoader(),
                new Class[] { ResultSetMetaData.class }, new ResultSetMetaDataInvocationHandler((ResultSetMetaData)o));
          }
          else {
            return o;
          }
        }
      }
      catch(Throwable t) {
        throw (t instanceof InvocationTargetException) ? t.getCause() : t;
      }
    }

    /**
     * Gets the string value from the current row at the column with the specified name.
     *
     * @param columnName the column name
     * @return the string value of the row at the column with the specified name
     * @throws SQLException if the column name cannot be found
     */
    public String getString(String columnName) throws SQLException {

      String columnVal = null;
      SQLException exception = null;
      try {
        columnVal = rs.getString(columnName);
      }
      catch(SQLException se) {
        // Save for returning later
        exception = se;
      }
      if(columnVal != null) return columnVal;
      if(columnName != null && "TABLE_NAME".equals(columnName)) {
        if(columnName != null && "TABLE_NAME".equals(columnName)) {
          try {
            // If we're using the "show tables" hack in getTables(), return the first column
            columnVal = rs.getString(1);
          }
          catch(SQLException se) {
            throw (exception == null) ? se : exception;
          }
        }
      }
      return columnVal;
    }
  }

  /**
   * ResultSetMetaDataInvocationHandler is a proxy handler class for java.sql.ResultSetMetaData. However the code in
   * this file is specifically for handling Hive JDBC calls, and therefore should not be used to proxy any other
   * JDBC objects besides those provided by Hive.
   */
  private static class ResultSetMetaDataInvocationHandler implements InvocationHandler {

    /** The "real" ResultSetMetaData object. */
    ResultSetMetaData rsmd;

    /**
     * Instantiates a new result set meta data invocation handler.
     *
     * @param r the r
     */
    public ResultSetMetaDataInvocationHandler(ResultSetMetaData r) {
      rsmd = r;
    }

    /**
     * Intercepts methods called on the ResultSetMetaData object to possibly perform alternate processing.
     *
     * @param proxy the proxy
     * @param method the method
     * @param args the args
     * @return the object
     * @throws Throwable the throwable
     */
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

      try {
        return method.invoke(rsmd, args);
      }
      catch(Throwable t) {
        if(t instanceof InvocationTargetException) {
          Throwable cause = t.getCause();

          if(cause instanceof SQLException) {
            if(cause.getMessage().equals("Method not supported")) {
              String methodName = method.getName();
              if("isSigned".equals(methodName)) {
                return isSigned((Integer)args[0]);
              }
              else {
                throw cause;
              }
            }
            else throw cause;
          }
          else {
            throw cause;
          }
        }
        else {
          throw t;
        }
      }
    }

    /**
     * Returns a true if values in the column are signed, false if not.
     *
     * This method checks the type of the passed column.  If that
     * type is not numerical, then the result is false.
     * If the type is a numeric then a true is returned.
     *
     * @param column the index of the column to test
     * @return boolean
     * @throws SQLException the sQL exception
     */
    public boolean isSigned(int column) throws SQLException {
      int numCols = rsmd.getColumnCount();

      if (column < 1 || column > numCols) {
        throw new SQLException("Invalid column value: " + column);
      }

      // we need to convert the thrift type to the SQL type
      int type = rsmd.getColumnType(column);
      switch(type){
      case Types.DOUBLE: case Types.DECIMAL: case Types.FLOAT:
      case Types.INTEGER: case Types.REAL: case Types.SMALLINT: case Types.TINYINT:
      case Types.BIGINT:
        return true;
      }
      return false;
    }
  }
}


text:
package net.glowstone.command;

import net.glowstone.GlowServer;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionDefault;

import java.util.HashSet;
import java.util.Set;

/**
 * Command to ban players or IP addresses.
 */
public class BanCommand extends GlowCommand {

    public BanCommand(GlowServer server) {
        super(server, "ban", "Manage player and ip bans", "[-ip] add|remove|check name|ip");
    }
    @Override
    public boolean run(CommandSender sender, String commandLabel, String[] args) {
        int mod = 0;
        boolean ip = false;
        if (!checkArgs(sender, args, 2, 3)) return false;
        if (args[0].equalsIgnoreCase("-ip")) {
            ip = true; mod = 1;
        }
        String option = args[mod];
        String target = args[1 + mod];
        Player player = server.getPlayer(target);
        String senderName = (sender instanceof Player? ((Player) sender).getDisplayName(): "Console");
        if (option.equalsIgnoreCase("add")) {
            if (ip) {
                if (!checkPermission(sender, "addip")) return false;
                String newTarget = target;
                if (player != null) newTarget = player.getAddress().getAddress().getHostAddress();
                server.getBanManager().setIpBanned(newTarget, true);
            } else {
                if (!checkPermission(sender, "add")) return false;
                server.getBanManager().setBanned(target, true);
            }
            if (player != null) player.kickPlayer("You have been " + (ip ? "ip banned" : "banned") + " by " + senderName);
            server.broadcastMessage(ChatColor.RED + target + " has been banned by " + senderName);
        } else if (option.equalsIgnoreCase("remove")) {
           if (ip) {
               if (!checkPermission(sender, "removeip")) return false;
                server.getBanManager().setIpBanned(target, false);
            } else {
               if (!checkPermission(sender, "remove")) return false;
                server.getBanManager().setBanned(target, false);
            }
            sender.sendMessage(ChatColor.RED + target + " was unbanned.");
        } else if (option.equalsIgnoreCase("check")) {
            boolean banned;
            if (!checkPermission(sender, "check")) return false;
            if (ip) {
                banned = server.getBanManager().isIpBanned(target);
            } else {
                banned = server.getBanManager().isBanned(target);
            }
            sender.sendMessage(ChatColor.RED + target + (banned ? " is" : " is not") + " banned.");
        } else {
            sender.sendMessage(ChatColor.GRAY + "Invalid option. Usage: " + usageMessage);
            return false;
        }
        return true;
    }

    @Override
    public Set<Permission> registerPermissions(String prefix) {
        Set<Permission> perms = new HashSet<Permission>();
        perms.add(new Permission(prefix + ".add", "Allow users to add name bans to the ban list"));
        perms.add(new Permission(prefix + ".addip", "Allow users to add ip bans to the ban list"));
        perms.add(new Permission(prefix + ".remove", "Allow users to remove name bans from the ban list"));
        perms.add(new Permission(prefix + ".removeip", "Allow users to remove ip bans from the ban list"));
        perms.add(new Permission(prefix + ".check", "Allow users to check if a name or ip is banned"));
        return perms;
    }

    @Override
    public PermissionDefault getPermissionDefault() {
        return PermissionDefault.OP;
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Gnomoniella brunaudiana Pass.

### Remarks
null


text:
    <link rel='stylesheet' href='style.css'>

THERMOSTAT

    Change temp
    <button class='invert' id="up-button" type="button">UP</button>
    <button class='invert' id='down-button' type="button">DOWN</button>
    <button class='invert' id="reset-button" type="button">RESET</button>
    Power saving mode
    <input class='invert' id='power-saving' type="checkbox" value="on">


text:
namespace BlueSheep.Interface
{
    partial class MainForm
    {
        /// <summary>
        /// Variable nécessaire au concepteur.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Nettoyage des ressources utilisées.
        /// </summary>
        /// <param name="disposing">true si les ressources managées doivent être supprimées ; sinon, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Code généré par le Concepteur Windows Form

        /// <summary>
        /// Méthode requise pour la prise en charge du concepteur - ne modifiez pas
        /// le contenu de cette méthode avec l'éditeur de code.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
            this.imageList = new System.Windows.Forms.ImageList(this.components);
            this.toolStrip1 = new System.Windows.Forms.ToolStrip();
            this.AccountsBt = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this.GroupsBt = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
            this.LanguageChoice = new System.Windows.Forms.ToolStripComboBox();
            this.toolStrip1.SuspendLayout();
            this.SuspendLayout();
            //
            // imageList
            //
            this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
            this.imageList.TransparentColor = System.Drawing.Color.Transparent;
            this.imageList.Images.SetKeyName(0, "Account.ico");
            this.imageList.Images.SetKeyName(1, "Add Account.ico");
            this.imageList.Images.SetKeyName(2, "Delete Account.ico");
            this.imageList.Images.SetKeyName(3, "Home.ico");
            this.imageList.Images.SetKeyName(4, "Manager.ico");
            this.imageList.Images.SetKeyName(5, "Empty.ico");
            this.imageList.Images.SetKeyName(6, "Begin.ico");
            this.imageList.Images.SetKeyName(7, "Delete.ico");
            this.imageList.Images.SetKeyName(8, "Stop.ico");
            this.imageList.Images.SetKeyName(9, "1391210883_5892.ico");
            //
            // toolStrip1
            //
            this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.AccountsBt,
            this.toolStripSeparator1,
            this.GroupsBt,
            this.toolStripSeparator2,
            this.LanguageChoice});
            this.toolStrip1.Location = new System.Drawing.Point(0, 0);
            this.toolStrip1.Name = "toolStrip1";
            this.toolStrip1.Size = new System.Drawing.Size(820, 25);
            this.toolStrip1.TabIndex = 2;
            this.toolStrip1.Text = "toolStrip1";
            //
            // AccountsBt
            //
            this.AccountsBt.Image = global::BlueSheep.Properties.Resources.account;
            this.AccountsBt.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.AccountsBt.Name = "AccountsBt";
            this.AccountsBt.Size = new System.Drawing.Size(75, 22);
            this.AccountsBt.Text = "Comptes";
            this.AccountsBt.ToolTipText = "Gestion des comptes";
            this.AccountsBt.Click += new System.EventHandler(this.AccountsBt_Click);
            //
            // toolStripSeparator1
            //
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
            //
            // GroupsBt
            //
            this.GroupsBt.Image = global::BlueSheep.Properties.Resources.group;
            this.GroupsBt.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.GroupsBt.Name = "GroupsBt";
            this.GroupsBt.Size = new System.Drawing.Size(71, 22);
            this.GroupsBt.Text = "Groupes";
            this.GroupsBt.Click += new System.EventHandler(this.GroupsBt_Click);
            //
            // toolStripSeparator2
            //
            this.toolStripSeparator2.Name = "toolStripSeparator2";
            this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
            //
            // LanguageChoice
            //
            this.LanguageChoice.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.LanguageChoice.AutoCompleteCustomSource.AddRange(new string[] {
            "FR",
            "EN"});
            this.LanguageChoice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
            this.LanguageChoice.Items.AddRange(new object[] {
            "FR",
            "EN",
            "ES",
            "PT"});
            this.LanguageChoice.MaxDropDownItems = 2;
            this.LanguageChoice.Name = "LanguageChoice";
            this.LanguageChoice.Size = new System.Drawing.Size(140, 25);
            this.LanguageChoice.Text = "Change the language";
            this.LanguageChoice.SelectedIndexChanged += new System.EventHandler(this.LanguageChoice_SelectedTextChanged);
            //
            // MainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(820, 556);
            this.Controls.Add(this.toolStrip1);
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.IsMdiContainer = true;
            this.Name = "MainForm";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "BlueSheep";
            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed);
            this.toolStrip1.ResumeLayout(false);
            this.toolStrip1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.ImageList imageList;
        private System.Windows.Forms.ToolStrip toolStrip1;
        private System.Windows.Forms.ToolStripButton AccountsBt;
        private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
        private System.Windows.Forms.ToolStripButton GroupsBt;
        private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
        public System.Windows.Forms.ToolStripComboBox LanguageChoice;
    }
}


text:
Setting up SSL is not all that fun. It is not lost on anyone that setting up even a single web service with HTTPS involves setting up several certificates, reading boring cryptography documentation and dire warnings.

Despite that, all the security features in SSL are there for good reasons, and turning them off, even for development purposes, has led to even less fun than setting up SSL properly.

##Please read this before turning anything off!
###Man in the Middle attacks are well known
The information security community is very well aware of how insecure most internal networks are, and uses that to their advantage. A video discussing attacks detailed a [wide range of possible attacks](http://2012.video.sector.ca/page/6).

###Man in the Middle attacks are common
The average company can expect to have seven or eight [Man in the Middle](https://sites.google.com/site/cse825maninthemiddle/) attacks a year. In some cases, up to 300,000 users can be compromised [over several months](https://security.stackexchange.com/questions/12041/are-man-in-the-middle-attacks-extremely-rare).

###Attackers have a suite of tools that automatically exploit flaws
The days of the expert hacker are over. Most security professionals use automated linux environments such as Kali Linux to do penetration testing, packed with hundreds of tools to check for exploits. A video of [Cain & Abel](https://www.youtube.com/watch?v=pfHsRscy540) shows passwords being compromised in less than 20 seconds.

Hackers won't bother to see whether something will "look encrypted" or not. Instead, they'll set up a machine with a toolkit that will run through every possible exploit, and go out for coffee.

###Security is increasingly important and public
More and more information flows through computers every day. The public and the media are taking increasing notice of the possibility that their private communications can be intercepted. Google, Facebook, Yahoo, and other leading companies have made secure communication a priority and have devoted millions to ensuring that [data cannot be read](https://www.eff.org/deeplinks/2013/11/encrypt-web-report-whos-doing-what).

###Ethernet / Password protected WiFi does not provide a meaningful level of security.
A networking auditing tool such as a [Wifi Pineapple](https://wifipineapple.com/) costs around $100, picks up all traffic sent over a wifi network, and is so good at intercepting traffic that people have turned it on and started [intercepting traffic accidentally](http://www.troyhunt.com/2013/04/the-beginners-guide-to-breaking-website.html).

###Companies have been sued for inadequate security
PCI compliance is not the only thing that companies have to worry about. The FTC sued [Fandango and Credit Karma](https://www.ftc.gov/news-events/press-releases/2014/03/fandango-credit-karma-settle-ftc-charges-they-deceived-consumers) on charges that they failed to securely transmit information, including credit card information.

###Correctly configured HTTPS clients are important
Sensitive, company confidential information goes over web services. A paper discussing insecurities in WS clients was titled [The Most Dangerous Code in the World: Validating SSL Certificates in Non-Browser Software](https://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf), and lists poor default configuration and explicit disabling of security options as the primary reason for exposure. The WS client has been configured as much as possible to be secure by default, and there are example configurations provided for your benefit.

##Mitigation
If you must turn on loose options, there are a couple of things you can do to minimize your exposure.

**Custom WSClient**: You can create a [custom WSClient](https://playframework.com/documentation/2.4.x/ScalaWS) specifically for the server, using the [`WSConfigParser`](https://playframework.com/documentation/2.4.x/api/scala/play/api/libs/ws/WSConfigParser.html) together with `ConfigFactory.parseString`, and ensure it is never used outside that context.

**Environment Scoping**: You can define [environment variables in HOCON](https://github.com/typesafehub/config/blob/master/HOCON.md#substitution-fallback-to-environment-variables) to ensure that any loose options are not hardcoded in configuration files, and therefore cannot escape an development environment.

**Runtime / Deployment Checks**: You can add code to your deployment scripts or program that checks that `play.ws.ssl.loose` options are not enabled in a production environment. The runtime mode can be found in the [`Application.mode`](https://playframework.com/documentation/2.4.x/api/scala/play/api/Application.html) method.

##Loose Options
Finally, here are the options themselves.

###Disabling Certificate Verification
> **NOTE**: In most cases, people turn off certificate verification because they haven't generated certificates. **There are other options besides disabling certificate verification**.
>
* [Quick Start to WS SSL](https://playframework.com/documentation/2.4.x/WSQuickStart) shows how to connect directly to a server using a self signed certificate.
* [Generating X.509 Certificates](https://playframework.com/documentation/2.4.x/CertificateGeneration) lists a number of GUI applications that will generate certificates for you.
* [Example Configurations](https://playframework.com/documentation/2.4.x/ExampleSSLConfig) shows complete configuration of TLS using self signed certificates.
* If you want to view your application through HTTPS, you can use [ngrok](https://ngrok.com/) to proxy your application.
* If you need a certificate authority but don't want to pay money, [StartSSL](https://www.startssl.com/?app=1) or [CACert](http://www.cacert.org/) will give you a free certificate.
* If you want a self signed certificate and private key without typing on the command line, you can use [selfsignedcertificate.com](http://www.selfsignedcertificate.com/).

If you've read the above and you still want to completely disable certificate verification, set the following;

```scala
play.ws.ssl.loose.acceptAnyCertificate=true
```

With certificate verification completely disabled, you are vulnerable to attack from anyone on the network using a tool such as [mitmproxy](https://mitmproxy.org/).

###Disabling Weak Ciphers Checking
There are some ciphers which are known to have flaws, and are [disabled](http://sim.ivi.co/2011/08/jsse-oracle-provider-default-disabled.html) in 1.7. WS will throw an exception if a weak cipher is found in the `ws.ssl.enabledCiphers` list. If you specifically want a weak cipher, set this flag:

```scala
play.ws.ssl.loose.allowWeakCiphers=true
```

With weak cipher checking disabled, you are vulnerable to attackers that use forged certificates, such as [Flame](http://arstechnica.com/security/2012/06/flame-crypto-breakthrough/).

###Disabling Hostname Verification
If you want to disable hostname verification, you can set a loose flag:

```scala
play.ws.ssl.loose.disableHostnameVerification=true
```

With hostname verification disabled, a DNS proxy such as `dnschef` can [easily intercept communication](https://tersesystems.com/2014/03/31/testing-hostname-verification/).

###Disabled Protocols
WS recognizes "SSLv3", "SSLv2" and "SSLv2Hello" as weak protocols with a number of [security issues](https://www.schneier.com/paper-ssl.pdf), and will throw an exception if they are in the `ws.ssl.enabledProtocols` list. Virtually all servers support `TLSv1`, so there is no advantage in using these older protocols.

If you specifically want a weak protocol, set the loose flag to disable the check:

```scala
play.ws.ssl.loose.allowWeakProtocols=true
```

SSLv2 and SSLv2Hello (there is no v1) are obsolete and usage in the field is [down to 25% on the public Internet](https://www.trustworthyinternet.org/ssl-pulse/). SSLv3 is known to have [security issues](http://www.yaksman.org/~lweith/ssl.pdf) compared to TLS. The only reason to turn this on is if you are connecting to a legacy server, but doing so does not make you vulnerable per se.


text:
using System;
using System.Collections.Generic;
using System.Data.Odbc;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using MSBuild.Community.Tasks.Tfs;

namespace MSBuild.Community.Tasks.SourceServer
{
    ///
    /// Task to index pdb files and entries to retrieve source files from Team Foundation Server source control.
    ///
    /// <remarks>
    /// This implementation is based on a pdb indexed by Team Foundation Build 2013 and has not been tested on other versions
    /// of TFS.
    /// </remarks>
    /// <example>Index a PDB.
    /// <![CDATA[
    /// <TfsSourceIndex SymbolFiles="@(Symbols)" TeamProjectCollectionUri="http://my-tfsserver/tfs/DefaultCollection" />
    /// ]]>
    /// </example>
    public class TfsSourceIndex : SourceIndexBase
    {
        ///
        /// Path to the root of the team collection hosting your project
        ///
        /// <example>http://my-tfsserver/tfs/DefaultCollection</example>
        [Required]
        public string TeamProjectCollectionUri { get; set; }

        ///
        /// Gets or sets the root of the workspace where the <see cref="SourceIndexBase.SymbolFiles"/>.
        ///
        public string WorkspaceDirectory { get; set; }

        ///
        /// Gets or sets the tfs collection uri to use.
        /// When this options is set pdb source information is retrieved from the server, rather
        /// that using local workspace information.
        ///
        /// <value>
        /// The collection.
        /// </value>
        /// <remarks>
        /// Also set the <see cref="ChangesetVersion"/> to retrieve the correct changeset
        /// </remarks>
        /// <example>http://mytfs.com:8080/tfs/DefaultCollection</example>
        public string Collection { get; set; }

        ///
        /// Gets or sets the change set used to retrieve file information.
        ///
        /// <value>
        /// The change set number.
        /// </value>
        public string ChangesetVersion { get; set; }

        [Required]
        public string TeamProjectRootDirectory { get; set; }

        [Required]
        public string TeamProjectName { get; set; }

        /// <inheritdoc />
        public override bool Execute()
        {
            return base.Execute() && this.Failed == 0;
        }

        /// <inheritdoc />
        protected override bool AddSourceProperties(SymbolFile symbolFile)
        {
            var itemInformation = GetItemInformation(symbolFile.SourceFiles.Select(item => new TaskItem(item.File.FullName)).Cast<ITaskItem>());
            foreach (var item in symbolFile.SourceFiles)
            {
                var key = GetItemSpec(item.File.FullName, true).ToLower();
                if (!itemInformation.ContainsKey(key))
                {
                    var allKeys = new StringBuilder();
                    foreach (var entry in itemInformation)
                    {
                        allKeys.Append(entry.Key + "|");
                    }

                    throw new KeyNotFoundException(string.Format("Could not find a local information entry for |{0}|.\n{1}.", key, allKeys));
                }

                item.Properties["FileName"] = item.File.Name;
                item.Properties["Revision"] = itemInformation[key].Changeset;
                item.Properties["ItemPath"] = itemInformation[key].ServerPath.TrimStart('$');
                item.IsResolved = true;
            }

            return true;
        }

        /// <inheritdoc />
        protected override bool CreateSourceIndexFile(SymbolFile symbolFile, string sourceIndexFile)
        {
            using (var writer = File.CreateText(sourceIndexFile))
            {
                writer.WriteLine("SRCSRV: ini ------------------------------------------------");
                writer.WriteLine("VERSION=3");
                writer.WriteLine("INDEXVERSION=2");
                writer.WriteLine("VERCTRL=Team Foundation Server");
                writer.WriteLine("DATETIME={0}", DateTime.UtcNow.ToString("ddd MMM dd HH:mm:ss yyyy")); // strange format used by TFS, just copied in case its used
                writer.WriteLine("INDEXER=MSCT"); // MSBUILD Community tasks
                writer.WriteLine("SRCSRV: variables ------------------------------------------");
                writer.WriteLine(@"TFS_EXTRACT_CMD=tf.exe view /version:%var4% /noprompt ""$%var3%"" /server:%fnvar%(%var2%) /console >%srcsrvtrg%");
                writer.WriteLine(@"TFS_EXTRACT_TARGET=%targ%\%var2%%fnbksl%(%var3%)\%var4%\%fnfile%(%var5%)");
                writer.WriteLine("SRCSRVVERCTRL=tfs");
                writer.WriteLine("SRCSRVERRDESC=access");
                writer.WriteLine("SRCSRVERRVAR=var2");
                writer.WriteLine(string.Format("VSTFSSERVER={0}", this.TeamProjectCollectionUri));
                writer.WriteLine("SRCSRVTRG=%TFS_extract_target%");
                writer.WriteLine("SRCSRVCMD=%TFS_extract_cmd%");
                writer.WriteLine("SRCSRV: source files ---------------------------------------");

                foreach (var file in symbolFile.SourceFiles)
                    if (file.IsResolved)
                        writer.WriteLine(file.ToSourceString("{File}*VSTFSSERVER*{ItemPath}*{Revision}*{FileName}"));

                writer.WriteLine("SRCSRV: end ------------------------------------------------");

                writer.Flush();
                writer.Close();
            }

            return true;
        }

        public bool ServerMode
        {
            get
            {
                return !string.IsNullOrEmpty(this.ChangesetVersion);
            }
        }

        private Dictionary<string, IItemInformation> GetItemInformation(IEnumerable<ITaskItem> files)
        {
            var client = new TfsClient();
            CopyBuildEngine(client);

            var success = false;
            var attempt = 0; const int retryCount = 3;

            while (!success && attempt < retryCount)
            {
                Log.LogMessage("Retrieving local file information to determine tfs source indexing attempt {0}", attempt + 1);
                client.Command = "info";
                if (!string.IsNullOrEmpty(this.ChangesetVersion))
                {
                    client.ChangesetVersion = this.ChangesetVersion;
                }

                if (!string.IsNullOrEmpty(this.TeamProjectCollectionUri))
                {
                    client.Collection = this.TeamProjectCollectionUri;
                }

                client.Files = GetItemSpecs(files);
                client.WorkingDirectory = this.WorkspaceDirectory;
                success = client.Execute();
                attempt = attempt + 1;
            }

            Log.LogMessage("Success {0}, exit code {1} after {2} attempts.", success.ToString().ToLower(), client.ExitCode, attempt);

            var infoCommandResponse = new InfoCommandResponse(client.Output.ToString());
            return this.ServerMode  ? infoCommandResponse.ServerInformation : infoCommandResponse.LocalInformation;
        }

        private ITaskItem[] GetItemSpecs(IEnumerable<ITaskItem> files)
        {
            return files.ToArray()
                .Select(item => new TaskItem(GetItemSpec(item.ItemSpec, this.ServerMode)))
                .Cast<ITaskItem>()
                .ToArray();
        }

        private string GetItemSpec(string value, bool serverMode)
        {
            if (serverMode)
            {
                return
                    string.Format("$/{0}{1}",
                        this.TeamProjectName,
                        ReplaceString(value, this.TeamProjectRootDirectory, string.Empty, StringComparison.CurrentCultureIgnoreCase).Replace('\\', '/'));
            }

            if (!string.IsNullOrEmpty(this.WorkspaceDirectory))
            {
                return
                    ReplaceString(value, this.WorkspaceDirectory, string.Empty, StringComparison.InvariantCultureIgnoreCase)
                    .TrimStart('\\');
            }

            return value;
        }

        public static string ReplaceString(string value, string oldValue, string newValue, StringComparison comparison)
        {
            var result = new StringBuilder();

            int previousIndex = 0;
            int index = value.IndexOf(oldValue, comparison);
            while (index != -1)
            {
                result.Append(value.Substring(previousIndex, index - previousIndex));
                result.Append(newValue);
                index += oldValue.Length;

                previousIndex = index;
                index = value.IndexOf(oldValue, index, comparison);
            }
            result.Append(value.Substring(previousIndex));

            return result.ToString();
        }
    }
}


text:
@interface DSHistoryGraph : CPTXYGraph <CPTScatterPlotDataSource>

@property (nonatomic, strong) NSArray *types;

@end


text:
#import "SCGeometry.h"

@interface SCMultiPolygon : SCGeometry

@property(nonatomic) NSArray *polygons;

@end


text:
<?php
/**
 *
 */

namespace Mvc5\Response\Config;

use Mvc5\Arg;
use Mvc5\Cookie\Cookies;
use Mvc5\Cookie\Container as CookieContainer;
use Mvc5\Http\Config\Response as _Response;
use Mvc5\Http\Headers as HttpHeaders;
use Mvc5\Http\Headers\Config as Headers;

trait Response
{
    /**
     *
     */
    use _Response;

    /**
     * @param null $body
     * @param string $status
     * @param array $headers
     * @param array $config
     */
    function __construct($body = null, $status = null, $headers = [], array $config = [])
    {
        $this->config = [
            Arg::BODY    => $body,
            Arg::COOKIES => isset($config[Arg::COOKIES]) ? $config[Arg::COOKIES] : new CookieContainer,
            Arg::HEADERS => $headers instanceof HttpHeaders ? $headers : new Headers($headers),
            Arg::STATUS  => $status
        ] + $config;
    }

    /**
     * @param $body
     * @return string
     */
    function body($body = null)
    {
        return func_num_args() ? $this[Arg::BODY] = $body : $this[Arg::BODY];
    }

    /**
     * @param string     $name
     * @param string     $value
     * @param int        $expire
     * @param string     $path
     * @param string     $domain
     * @param bool|false $secure
     * @param bool|true  $httponly
     * @return mixed
     */
    function cookie($name, $value, $expire = null, $path = null, $domain = null, $secure = null, $httponly = null)
    {
        return $this->cookies()->set($name, $value, $expire, $path, $domain, $secure, $httponly);
    }

    /**
     * @param $cookies
     * @return array|Cookies
     */
    function cookies($cookies = null)
    {
        return null !== $cookies ? $this[Arg::COOKIES] = $cookies : $this[Arg::COOKIES];
    }

    /**
     * @param string $name
     * @param string $value
     * @return string
     */
    function header($name, $value)
    {
        return $this[Arg::HEADERS][$name] = $value;
    }

    /**
     * @param $headers
     * @return array|Headers
     */
    function headers($headers = null)
    {
        return null !== $headers ? $this[Arg::HEADERS] = $headers : $this[Arg::HEADERS];
    }

    /**
     * @param $status
     * @return string
     */
    function status($status = null)
    {
        return null !== $status ? $this[Arg::STATUS] = $status : $this[Arg::STATUS];
    }

    /**
     * @param $version
     * @return string
     */
    function version($version = null)
    {
        return null !== $version ? $this[Arg::VERSION] = $version : $this[Arg::VERSION];
    }
}


text:
package edu.ccsu.cs407.vehicleAbstractFactory;

/**
 * Specific car information
 */
public class ToyotaCamry extends Car{

  public ToyotaCamry(Engine engine,Transmission transmission) {
    // 4 seats, 4 doors
    super(engine,transmission, 4, 4);
  }
}


text:
using namespace boost::python;
//#include <iostream>
//using namespace std;

class WorldWrap : public World, public wrapper<World> {
public:
	virtual std::string vir(int a) const {
		//if pure virtual
#if PUREVIRTEST
		return this->get_override("vir")(a);
#else
		//from c++ calls to WorldWrap instaces as World instance (i.e. InvokeWorld)
		//calls python derived function if present, or base function.
		if(override f = this->get_override("vir"))
			return f(a);
		return World::vir(a);
#endif
	}

#if PUREVIRTEST
#else
	//from python calls this, if not derived in python
	//if vir derived in python, gets called directly
	std::string default_vir(int a) const {
		return World::vir(a);
	}
#endif

};

std::string InvokeWorld(const World& w, int a) //for testing the instances from python env
{
	return w.vir(a);
}

class UniverseWrap : public Universe, public wrapper<Universe> {
public:
	virtual std::string vir(int a) const {
		//if pure virtual
#if PUREVIRTEST
		return this->get_override("vir")(a);
#else
		//from c++ calls to WorldWrap instaces as World instance (i.e. InvokeWorld)
		//calls python derived function if present, or base function.
		if(override f = this->get_override("vir"))
			return f(a);
		return Universe::vir(a);
#endif
	}

#if PUREVIRTEST
#else
	//from python calls this, if not derived in python
	//if vir derived in python, gets called directly
	std::string default_vir(int a) const {
		return Universe::vir(a);
	}
#endif

};

NAMESPACE_UPP

void export_world()
{
ONCELOCK
{
	class_<WorldWrap, boost::noncopyable>("World", "A simple world"
#if 0 //PUREVIRTEST, not needed though abstract, otherwise it cant instantiate in python
		, no_init
#endif
		)
		//.def(init<const World&>())
		.def("__str__", &World::get) //somehow works only for print not for general return as string echo
		.def("greet", &World::greet)
		.def("get", &World::get)
		.def("set", &World::set)
#if PUREVIRTEST
		.def("vir", pure_virtual(&World::vir))
#else
		.def("vir",  &World::vir, &WorldWrap::default_vir)
#endif
	;

	def("invworld", &InvokeWorld);

	class_<UniverseWrap, bases<World>, boost::noncopyable >("Universe", "A simple Universe")
		//.def(init<const Universe&>())
		.def("__str__", &Universe::getg) //somehow works only for print not for general return as string echo
		.def("getg", &Universe::getg)
		.def("setg", &Universe::setg)
#if 1
//somehow does not override the World export of vir
#if PUREVIRTEST
		.def("vir", pure_virtual(&Universe::vir))
#else
		.def("vir",  &Universe::vir, &UniverseWrap::default_vir)
#endif
#endif
	;
}
}

END_UPP_NAMESPACE


text:
#pragma once
#include <aws/codebuild/CodeBuild_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace CodeBuild
{
namespace Model
{
  class AWS_CODEBUILD_API PutResourcePolicyResult
  {
  public:
    PutResourcePolicyResult();
    PutResourcePolicyResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    PutResourcePolicyResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
 The ARN of the Project or ReportGroup resource
     * that is associated with a resource policy.

     */
    inline const Aws::String& GetResourceArn() const{ return m_resourceArn; }

    /**
     *
 The ARN of the Project or ReportGroup resource
     * that is associated with a resource policy.

     */
    inline void SetResourceArn(const Aws::String& value) { m_resourceArn = value; }

    /**
     *
 The ARN of the Project or ReportGroup resource
     * that is associated with a resource policy.

     */
    inline void SetResourceArn(Aws::String&& value) { m_resourceArn = std::move(value); }

    /**
     *
 The ARN of the Project or ReportGroup resource
     * that is associated with a resource policy.

     */
    inline void SetResourceArn(const char* value) { m_resourceArn.assign(value); }

    /**
     *
 The ARN of the Project or ReportGroup resource
     * that is associated with a resource policy.

     */
    inline PutResourcePolicyResult& WithResourceArn(const Aws::String& value) { SetResourceArn(value); return *this;}

    /**
     *
 The ARN of the Project or ReportGroup resource
     * that is associated with a resource policy.

     */
    inline PutResourcePolicyResult& WithResourceArn(Aws::String&& value) { SetResourceArn(std::move(value)); return *this;}

    /**
     *
 The ARN of the Project or ReportGroup resource
     * that is associated with a resource policy.

     */
    inline PutResourcePolicyResult& WithResourceArn(const char* value) { SetResourceArn(value); return *this;}

  private:

    Aws::String m_resourceArn;
  };

} // namespace Model
} // namespace CodeBuild
} // namespace Aws


text:
"""
    An API to insert and retrieve metadata on cloud artifacts.

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: v1alpha1

    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six

class LayerDirective(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

    """
    allowed enum values
    """
    DIRECTIVE_UNSPECIFIED = "DIRECTIVE_UNSPECIFIED"
    MAINTAINER = "MAINTAINER"
    RUN = "RUN"
    CMD = "CMD"
    LABEL = "LABEL"
    EXPOSE = "EXPOSE"
    ENV = "ENV"
    ADD = "ADD"
    COPY = "COPY"
    ENTRYPOINT = "ENTRYPOINT"
    VOLUME = "VOLUME"
    USER = "USER"
    WORKDIR = "WORKDIR"
    ARG = "ARG"
    ONBUILD = "ONBUILD"
    STOPSIGNAL = "STOPSIGNAL"
    HEALTHCHECK = "HEALTHCHECK"
    SHELL = "SHELL"

    """
    Attributes:
      swagger_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    swagger_types = {
    }

    attribute_map = {
    }

    def __init__(self):  # noqa: E501
        """LayerDirective - a model defined in Swagger"""  # noqa: E501
        self.discriminator = None

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value
        if issubclass(LayerDirective, dict):
            for key, value in self.items():
                result[key] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self.to_dict())

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, LayerDirective):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        return not self == other


text:
require("requirish")._(module);
var assert = require("better-assert");

var NodeClass = require("lib/datamodel/nodeclass").NodeClass;
var NodeId = require("lib/datamodel/nodeid").NodeId;
var makeNodeId = require("lib/datamodel/nodeid").makeNodeId;
var resolveNodeId = require("lib/datamodel/nodeid").resolveNodeId;

var DataValue = require("lib/datamodel/datavalue").DataValue;
var DataType = require("lib/datamodel/variant").DataType;
var StatusCodes = require("lib/datamodel/opcua_status_code").StatusCodes;

var UADataType = require("lib/address_space/ua_data_type").UADataType;
var UAVariableType = require("lib/address_space/ua_variable_type").UAVariableType;
var UAObject = require("lib/address_space/ua_object").UAObject;

var util = require("util");
var _ = require("underscore");

exports.install = function (AddressSpace) {

    var makeStructure = require("lib/address_space/convert_nodeset_to_types").makeStructure;
    /**
     * @method constructExtensionObject
     * @param dataType {UADataType}
     * @param [options {Object} =null]
     */
    AddressSpace.prototype.constructExtensionObject = function(dataType,options){

        if (dataType instanceof NodeId) {
            dataType = this.findObject(dataType);
        }
        assert(dataType instanceof UADataType);

        if (!dataType._extensionObjectConstructor) {
            dataType._extensionObjectConstructor = makeStructure(dataType);
        }

        var Constructor =  dataType._extensionObjectConstructor;
        return new Constructor(options);
    };
};


text:
"use strict";

/**
 * An example command, to get you going
 * @arg {Command} Command - The command constructor function, which cli.js passed in
 * @arg {Object} scope - an object containing args, commandName, and conf (commandline arguments, configuration settings, and the current command's name)
 * @returns (Function) - new Command
 * @example: sjc example hello world
 * @example: sjc throw
 */

var run = function(good,bad) {

    /**
     * this performs our main logic. when we passed `scope` in, it attached to `this`
     * good is a callback function for when things turned out ok
     * bad is it's evil twin
     */

     var scope = this;

    if ( scope.args[0] === 'throw' ) {
        bad('i am throwing an error');
    } else {
        //  let's show the user everything in run's scope, which we bound to "this"
        good(scope);
    }
};

module.exports = function(Command,scope) {

    /**
     * Command is the Command.js constructor
     * scope is an object made up of data we think the command might need.
     * we can modify it as desired. ex:
     */

    scope.userPreferences = {
        favouriteColour: 'blue'
    };
    scope.conf.soundEffects.volume = 0.5;

    return new Command(scope,run);
};


text:
require 'rspec'
require 'puggle'

ENV["TEST_VALUE_A"] = "hello"

RSpec.configure do |config|
  config.treat_symbols_as_metadata_keys_with_true_values = true
end

Puggle.configure do |config|
  config.config_files = ["spec/fixtures/app.yml"]
end


text:
        <button type="button" class="btn btn-default" ng-click="cc.createContainer()">

          <translate>Container</translate>
        </button>

        <hz-magic-search-context filter-facets="cc.filterFacets">
          <hz-magic-search-bar></hz-magic-search-bar>
        </hz-magic-search-context>
        <uib-accordion class="hz-container-accordion" ng-if="cc.model.containers.length > 0">

            <uib-accordion-heading>

                {$ container.name $}

            </uib-accordion-heading>

                Object Count
                {$ container.count $}

                Size
                {$ container.bytes | bytes $}

                Date Created
                {$ container.timestamp | date $}

                  <input type="checkbox" id="id_access" ng-model="container.is_public"
                         ng-if="container.name === cc.model.container.name"
                         ng-click="cc.toggleAccess(container)">
                  Public Access

                  Link
                  Disabled

        </uib-accordion>

<translate>No items to display.</translate>


text:
#ifndef __SMTP_H
#define __SMTP_H

/****************************************************************************
  Section:
	Data Type Definitions
  ***************************************************************************/
	#define SMTP_SUCCESS		(0x0000u)	// Message was successfully sent
	#define SMTP_RESOLVE_ERROR	(0x8000u)	// DNS lookup for SMTP server failed
	#define SMTP_CONNECT_ERROR	(0x8001u)	// Connection to SMTP server failed

/****************************************************************************
  Function:
      typedef struct SMTP_POINTERS

  Summary:
    Configures the SMTP client to send a message

  Description:
    This structure of pointers configures the SMTP Client to send an e-mail
    message. Initially, all pointers will be null. Set <c>SMTPClient.[field
    name].szRAM</c> to use a string stored in RAM, or <c>SMTPClient.[field
    name].szROM</c> to use a string stored in ROM. (Where <c>[field name]</c>
    is one of the parameters below.)

    If a ROM string is specified, <c>SMTPClient.ROMPointers.[field name]</c>
    must also be set to 1 to indicate that this field should be retrieved
    from ROM instead of RAM.

  Parameters:
    Server -        the SMTP server to relay the message through
    Username -      the user name to use when logging into the SMTP server,
                    if any is required
    Password -      the password to supply when logging in, if any is required
    To -            the destination address for this message. May be a
                    comma\-separated list of addresss, and/or formatted.
    CC -            The CC addresses for this message, if any. May be a
                    comma\-separated list of addresss, and/or formatted.
    BCC -           The BCC addresses for this message, if any. May be a
                    comma\-separated list of addresss, and/or formatted.
    From -          The From address for this message. May be formatted.
    Subject -       The Subject header for this message.
    OtherHeaders -  Any additional headers for this message. Each additional
                    header, including the last one, must be terminated with
                    a CRLF pair.
    Body -          When sending a message from memory, the location of the
    				body of this message in memory. Leave as NULL to build
    				a message on\-the\-fly.
    ROMPointers -   Indicates which parameters to read from ROM instead of RAM.
    UseSSL -        When STACK_USE_SSL_CLIENT is enabled, this flag causes
                    the SMTP client to make an SSL connection to the server.
    ServerPort -    (WORD value) Indicates the port on which to connect to the
                    remote SMTP server.

  Remarks:
    When formatting an e-mail address, the SMTP standard format for associating a
    printable name may be used. This format places the printable name in quotation
    marks, with the address following in pointed brackets, such as "John Smith"
    \<john.smith@domain.com\>
  ***************************************************************************/
typedef struct
{
	union
	{
		BYTE *szRAM;
		ROM BYTE *szROM;
	} Server;
	union
	{
		BYTE *szRAM;
		ROM BYTE *szROM;
	} Username;
	union
	{
		BYTE *szRAM;
		ROM BYTE *szROM;
	} Password;
	union
	{
		BYTE *szRAM;
		ROM BYTE *szROM;
	} To;
	union
	{
		BYTE *szRAM;
		ROM BYTE *szROM;
	} CC;
	union
	{
		BYTE *szRAM;
		ROM BYTE *szROM;
	} BCC;
	union
	{
		BYTE *szRAM;
		ROM BYTE *szROM;
	} From;
	union
	{
		BYTE *szRAM;
		ROM BYTE *szROM;
	} Subject;
	union
	{
		BYTE *szRAM;
		ROM BYTE *szROM;
	} OtherHeaders;
	union
	{
		BYTE *szRAM;
		ROM BYTE *szROM;
	} Body;

	struct
	{
		unsigned char Server:1;
		unsigned char Username:1;
		unsigned char Password:1;
		unsigned char To:1;
		unsigned char CC:1;
		unsigned char BCC:1;
		unsigned char From:1;
		unsigned char Subject:1;
		unsigned char OtherHeaders:1;
		unsigned char Body:1;
	} ROMPointers;

	#if defined(STACK_USE_SSL_CLIENT)
	BOOL UseSSL;
	#endif

	WORD ServerPort;

} SMTP_POINTERS;

/****************************************************************************
  Section:
	Global SMTP Variables
  ***************************************************************************/
	extern SMTP_POINTERS SMTPClient;

/****************************************************************************
  Section:
	SMTP Function Prototypes
  ***************************************************************************/

BOOL SMTPBeginUsage(void);
WORD SMTPEndUsage(void);
void SMTPTask(void);
void SMTPSendMail(void);
BOOL SMTPIsBusy(void);
WORD SMTPIsPutReady(void);
BOOL SMTPPut(BYTE c);
WORD SMTPPutArray(BYTE* Data, WORD Len);
WORD SMTPPutString(BYTE* Data);
void SMTPFlush(void);
void SMTPPutDone(void);

#if defined(__18CXX)
	WORD SMTPPutROMArray(ROM BYTE* Data, WORD Len);
	WORD SMTPPutROMString(ROM BYTE* Data);
#else
	// Non-ROM variant for C30 / C32
	#define SMTPPutROMArray(a,b)	SMTPPutArray((BYTE*)a,b)
	// Non-ROM variant for C30 / C32
	#define SMTPPutROMString(a)		SMTPPutString((BYTE*)a)
#endif

#endif