text:
/**
 * common js
 */
/** Gobal bCancel; */
var bCancel = false;
var DATE_DELIMITER = "-";
var DB_INT_LENGTH = 64; //Database Length.defalut64
var MAX_INTEGER = Math.pow(2, DB_INT_LENGTH - 1) - 1;
var MIN_INTEGER = -Math.pow(2, DB_INT_LENGTH - 1);
var MAX_SMALLINT = Math.pow(2, DB_INT_LENGTH / 4 - 1) - 1;
var MIN_SMALLINT = -Math.pow(2, DB_INT_LENGTH / 4 - 1);
var VERBOSE = false;
var FIELD_SEPARATOR = "_FIELD_SEPARATOR_";
var GROUP_SEPARATOR = "_GROUP_SEPARATOR_";
function setDateDelimiter(delimiter) {
    DATE_DELIMITER = delimiter;
}
function setDBIntLength(len) {
    DB_INT_LENGTH = len;
    MAX_INTEGER = Math.pow(2, DB_INT_LENGTH - 1) - 1;
    MIN_INTEGER = -Math.pow(2, DB_INT_LENGTH - 1);
    MAX_SMALLINT = Math.pow(2, DB_INT_LENGTH / 4 - 1) - 1;
    MIN_SMALLINT = -Math.pow(2, DB_INT_LENGTH / 4 - 1);
}
function setVerbose(verbose) {
    VERBOSE = verbose;
}
function isVerbose() {
    return VERBOSE;
}
function log(value) {
    if (isVerbose()) {
        window.status = value;
    }
}
function isNetscape() {
    if (navigator.appName == "Netscape") {
        return true;
    } else {
        return false;
    }
}
function getElementOrder(field) {
    var i = 0;
    var order = 0;
    var elements = document.getElementsByName(field.name);
    var elementsCount = elements.length;
    for (i = 0; i < elementsCount; i++) {
        order++;
        if (elements[i] == field) {
            break;
        }
    }
    return order;
}

function isFirstElement(field) {
    var elements = document.getElementsByName(field.name);
    if (elements[0] == field) {
        return true;
    } else {
        return false;
    }
}
function getElementCount(fieldName) {
    var count = 0;
    count = document.getElementsByName(fieldName).length;
    return count;
}
function getByteLength(value) {
    var str;
    var count = 0;
    var valueCount = value.length;
    for (var i = 0; i < valueCount; i++) {
        str = escape(value.charAt(i));
        if (str.length == 6) {
            count = count + 2;
        } else {
            count = count + 1;
        }
    }
    return count;
}
function getTableElements(tableId) {
    var i = 0;
    var elements = new Array();
    var tempElements = null;
    var tbody;
    var index = 0;
    var tbodies = document.getElementById(tableId).tBodies;
    var tbodiesCount = tbodies.length;
    var tempElementsCount = 0;
    for (i = 0; i < tbodiesCount; i++) {
        tbody = tbodies.item(i);
        tempElements = tbody.getElementsByTagName("INPUT");
        tempElementsCount = tempElements.length;
        for (var j = 0; j < tempElementsCount; j++) {
            elements[index++] = tempElements[j];
        }
        tempElements = tbody.getElementsByTagName("SELECT");
        tempElementsCount = tempElements.length;
        for (var j = 0; j < tempElementsCount; j++) {
            elements[index++] = tempElements[j];
        }
        tempElements = tbody.getElementsByTagName("TEXTAREA");
        tempElementsCount = tempElements.length;
        for (var j = 0; j < tempElementsCount; j++) {
            elements[index++] = tempElements[j];
        }
    }
    return elements;
}
function leftTrim(value) {
    var re = /^\s*/;
    if (value == null) {
        return null;
    }
    return value.replace(re, "");
}
function rightTrim(value) {
    var re = /\s*$/;
    if (value == null) {
        return null;
    }
    return value.replace(re, "");
}
function trim(value) {
    return leftTrim(rightTrim(value));
}
function regExpTest(resource, re) {
    var result = false;
    if (resource == null || resource == "") {
        return false;
    }
    if (resource == re.exec(resource)) {
        result = true;
    }
    return result;
}
function replace(str, strFind, strReplaceWith) {
    var strReturn;
    var re = new RegExp(strFind, "g");
    if (str == null) {
        return null;
    }
    strReturn = str.replace(re, strReplaceWith);
    return strReturn;
}
function isEmptyField(field) {
    if (field.value == null || trim(field.value) == "") {
        return true;
    }
    return false;
}
function formatNumberToString(strValue) {
    strValue = trim(strValue);
    strValue = replace(strValue, ",", "");
    return strValue;
}
function formatNumberToDouble(strValue) {
    var dblValue = 0;
    strValue = formatNumberToString(strValue);
    dblValue = parseFloat(strValue);
    if (isNaN(dblValue)) {
        dblValue = 0;
    }
    return dblValue;
}
function fixNumber(cellStr) {
    if (parseFloat(cellStr) == 0) {
        return "0";
    }
    if (cellStr.indexOf(".") == -1) {
        return cellStr;
    }
    var x = parseFloat(cellStr);
    x += (parseFloat(cellStr) < 0) ? -5e-9 : 5e-9;

	// Chop the string to 4 decimal places.
    cellStr = "" + x;
    cellStr = cellStr.substring(0, 5 + cellStr.indexOf("."));

	// Remove trailing zeros beyond the decimal point.
    cellStrArr = cellStr.split("");
    for (k = cellStrArr.length - 1; k > 0 && cellStrArr[k] == "0"; --k) {
        cellStrArr[k] = "X";
    }
    cellStr = "";
    for (k = 0; k < cellStrArr.length && cellStrArr[k] != "X"; ++k) {
        cellStr += cellStrArr[k];
    }
    return cellStr;
}
function setFocus(field) {
    try {
        field.focus();
    }
    catch (E) {
    }
}
function showMessage(message) {
    alert(message);
}
function boundCheckBox(controlField, checkBoxField) {
    var count = 0;
    try {
        count = checkBoxField.length;
    }
    catch (E) {
    }
    if (isNaN(count)) {
	    if(checkBoxField.className!="readonlyCheckBox"){
        checkBoxField.checked = controlField.checked;
        }
    } else {
        for (var i = 0; i < count; i++) {
        	if(checkBoxField[i].className!="readonlyCheckBox"){
            checkBoxField[i].checked = controlField.checked;
        }
    }
}
}
function getElementIndexInForm(form, field) {
    var intElementIndex = -1;
    var elementsCount = form.elements.length;
    for (var i = 0; i < elementsCount; i++) {
        if (form.elements[i] == field) {
            intElementIndex = i;
            break;
        }
    }
    return intElementIndex;
}
function setSelect(field) {
    if (field.type != "hidden") {
        try {
            field.select();
        }
        catch (E) {
        }
    }
}
function isIE6() {
    if (navigator.appVersion.indexOf("MSIE 6") > -1) {
        return true;
    } else {
        return false;
    }
}

function isIE7() {
    if (navigator.appVersion.indexOf("MSIE 7") > -1) {
        return true;
    } else {
        return false;
    }
}

function bindField(source, target) {
    target.value = source.value;
}
function newString(str, times) {
    var value = "";
    for (var i = 0; i < times; i++) {
        value += str;
    }
    return value;
}
function printExcept(obj) {
    obj.style.display = "none";
    window.print();
    obj.style.display = "";
}
function postAction(form, action, target) {
    var oldTarget = form.target;
    if (target != null) {
        form.target = target;
    }
    form.action = action;
    form.submit();
    if (target != null) {
        form.target = oldTarget;
    }
    return true;
}
function postActionWithConfirm(form, action, message, target) {
    if (confirm(message)) {
        var oldTarget = form.target;
        if (target != null) {
            form.target = target;
        }
        form.action = action;
        form.submit();
        if (target != null) {
            form.target = oldTarget;
        }
        return true;
    } else {
        return false;
    }
}
function setFormDisabled(form) {
    if (form == null) {
        form = fm;
    }
    var element;
    for (var i = 0; i < form.elements.length; i++) {
        element = form.elements[i];
        if (element.type == "hidden") {
            continue;
        }
        if (element.name.indexOf("buttonControl") == 0) {
            continue;
        }
        if (element.name == "buttonSubmit") {
            element.style.display = "none";
            continue;
        }
        element.disabled = true;
    }
}
function getFirstElementValue(fieldName) {
    var field;
    if (getElementCount(fieldName) > 1) {
        field = document.getElementsByName(fieldName);
    } else {
        field = document.getElementsByName(fieldName)[0];
    }
    return field.value;
}
function openWindow(urlString, windowName, optionString) {
    var newWindow = window.open(urlString, windowName, optionString);
    try {
        newWindow.focus();
    }
    catch (E) {
    }
    return newWindow;
}
function exportResultDataToExcel(table) {
    var oXL;
    try {
        oXL = GetObject("", "Excel.Application");
    }
    catch (E) {
        try {
            oXL = new ActiveXObject("Excel.Application");
        }
        catch (E2) {
            showMessage("Please confirm:\n1.Microsoft Excel has been installed.\n2.Internet Options=>Security=>Setting \"Enable unsafe ActiveX\"");
            return;
        }
    }
    var oWB = oXL.Workbooks.Add();
    var oSheet = oWB.ActiveSheet;
    var Lenr = 1;
    var maxColumn = 0;
    for (var i = 0; i < Lenr; i++) {
        var Lenc = table.tHead.rows(i).cells.length;
        for (j = 0; j < Lenc; j++) {
            if (maxColumn < j) {
                maxColumn = j;
            }
            oSheet.Columns(j + 1).EntireColumn.NumberFormatLocal = "@";
            oSheet.Cells(i + 1, j + 1).value = table.tHead.rows(i).cells(j).innerText;
        }
    }
    Lenr = table.tBodies(0).rows.length;
    for (var i = 0; i < Lenr; i++) {
        var Lenc = table.tBodies(0).rows(i).cells.length;
        var j = 0;
        var value = table.tBodies(0).rows(i).cells(j).innerText;
        var pos = value.indexOf(" ");
        if (pos > -1) {
            value = trim(value.substring(pos));
        }
        oSheet.Cells(i + 2, j + 1).value = value;
        for (j = 1; j < Lenc; j++) {
            oSheet.Cells(i + 2, j + 1).value = table.tBodies(0).rows(i).cells(j).innerText;
        }
    }
    for (var i = 0; i < maxColumn; i++) {
        oSheet.Columns(i + 1).EntireColumn.AutoFit;
    }
    oXL.Visible = true;
}
function setSameElementValue(field) {
    if (getElementCount(field.name) > 1) {
        var fields = document.getElementsByName(field.name);
        for (var i = 0; i < fields.length; i++) {
            fields[i].value = field.value;
        }
    }
}
function readCookie(name) {
    var cookieValue = "";
    var search = name + "=";
    if (document.cookie.length > 0) {
        offset = document.cookie.indexOf(search);
        if (offset != -1) {
            offset += search.length;
            end = document.cookie.indexOf(";", offset);
            if (end == -1) {
                end = document.cookie.length;
            }
            cookieValue = unescape(document.cookie.substring(offset, end));
        }
    }
    return cookieValue;
}
function writeCookie(name, value, hours) {
    var expire = "";
    if (hours != null) {
        expire = new Date((new Date()).getTime() + hours * 3600000);
        expire = ";  expires=" + expire.toGMTString();
    }
    document.cookie = name + "=" + escape(value) + expire;
}

/**
 * unformat number
 * example:123,222.23 ==> 123322.23
 * @since 2006-09-01
 */
function unformatNumber(value){
  var retValue = replace(value+"", ",", "");
  var valueArray = retValue.split(".");
  if(valueArray.length>1 && valueArray[1]=="00"){
    retValue = valueArray[0];
  }
  return retValue;
}

/**
 * format number
 * example:123222.23 ==> 123,322.23
 * if has precision,the return value will have at least precision number after dot.
 * @since 2006-09-01
 */
function formatNumber(value,precision){
  value  =  value+"";
  var pos = value.indexOf('.');
  if(pos>-1){
    var firstValue=value.substring(0,pos);
    var lastValue=value.substring(pos+1);
    var  re=/(-?\d+)(\d{3})/
    while(re.test(firstValue)){
      firstValue=firstValue.replace(re,"$1,$2")
    }
    /*
    re=/(\d{3})(\d+)/
    while(re.test(lastValue)){
      lastValue=lastValue.replace(re,"$1,$2")
    }
    */
    value = firstValue + "." + lastValue;
  }else{
    var re=/(-?\d+)(\d{3})/
    while(re.test(value)){
      value=value.replace(re,"$1,$2")
    }
  }
  if(precision!=undefined && !isNaN(precision)){
  	var pos = value.indexOf('.');
  	if(pos==-1){
  		value+=".";
  		pos = value.indexOf('.');
  	}

  	var len = value.length-pos-1;

		for(var i=len;i<precision;i++){
			value+="0";
		}
  }
  return  value;
}

/**
 * get multi-line field object.
 * @param statement: fm.ClassCode[]
 * @param elementOrder: 3
 * @return: The third ClassCode field object of this page form.
 * @since 2006-09-01
 */
function getElementObjectByOrder(statement, elementOrder) {
  var object = null;
  if(statement.indexOf("[]")==-1){
    try{
      object = eval(statement);
    }catch (E) {
      object = statement;
    }
  }else{
    var startPos = statement.indexOf("[");
    var endPos = statement.indexOf("]");
    if(startPos==endPos-1){
      statement = statement.substring(0,startPos+1) + elementOrder + statement.substring(endPos);
    }
    try{
      object = eval(statement);
    }catch (E) {
      object = statement;
    }
  }
  return object;
}
function upperCaseFirstChar(str){
  if(str == null || str.length < 1 ){
   return str;
  }
  var convertStr = str.substring(0,1).toUpperCase()+str.substring(1);
  return convertStr ;
}

function lowerCaseFirstChar(str){
  if(str == null || str.length < 1 ){
   return str;
  }
  var convertStr = str.substring(0,1).toLowerCase()+str.substring(1);
  return convertStr ;
}

function getElementByTagName(object,elementName,tagName){
  var tempField = object.getElementsByTagName(tagName);
  for (var i = 0; i <tempField.length; i++) {
    if(tempField[i].name == elementName){
      return tempField[i];
    }
  }
  return null;
}
function copyOptions(targetSelect,sourceSelect){
  targetSelect.options.length=0;
  for(var i=0; i<sourceSelect.length; i++){
    addOption(targetSelect, sourceSelect.options[i].text, sourceSelect.options[i].value);
  }
}
function addOption(targetSelect,text,value){
  targetSelect.options[targetSelect.length]=new Option(text,value);
}

function setChildElementsDisabled(object,disabledValue){
  var fields = object.getElementsByTagName("INPUT");
  var i= 0;
  for (i = 0; i <fields.length; i++) {
    fields[i].disabled = disabledValue;
  }
  fields = object.getElementsByTagName("SELECT");
  for (i = 0; i <fields.length; i++) {
    fields[i].disabled = disabledValue;
  }
  fields = object.getElementsByTagName("TEXTAREA");
  for (i = 0; i <fields.length; i++) {
    fields[i].disabled = disabledValue;
  }
}
//show/hide advanced condition.
function showAdvanced(controlNode,controlButton){
	if(controlNode.style.display=="none"){
		setChildElementsDisabled(controlNode,false);
		controlNode.style.display = "";
	}else{
		controlNode.style.display = "none";
		setChildElementsDisabled(controlNode,true);
	}
}

function round(number,precision)
{
  if(isNaN(number))
    number = 0;
  var prec = Math.pow(10,precision);
  var result = Math.round( number * prec) ;
  result = result/prec;
  return result;
}

function point(number,precision)
{
  if(isNaN(number))
    number = 0;
  var result = number.toString();
  if(result.indexOf(".")==-1)
    result = result + ".";

  result = result + newString("0",precision);
  result = result.substring(0,precision + result.indexOf(".") + 1);
  return result;
}

/**
 * ¹¦ÄÜ£º½«ÊäÈëÓò±ä³ÉÖ»¶Á£¬Í¬Ê±½«CSSµÄÊôÐÔ±ä³ÉÖ»¶Á
 * return true/false
 */
function readonlyAllInput(){
  var testStr = "" ;
  var tempElements = null;

  for(i=0; i<document.all.length; i++){
    //alert(document.all(i).tagName);
    if(document.all(i).tagName=="INPUT"){
        tempElements = document.all(i);
        //½«ÊäÈëÓò±äΪֻ¶Á
        if(tempElements.type=="text"){
	    	tempElements.style.fontSize="9pt";
	    	tempElements.style.borderTop = "none";
	    	tempElements.style.borderBottom = "none";
	    	tempElements.style.borderRight= "none";
	    	tempElements.style.borderLeft = "none" ;
	    	//tempElements.style.width="80%";
	    	tempElements.style.color = "#000000";
	    	tempElements.style.backgroundColor = "#F4F9FF";
        	tempElements.readOnly=true;
        }
        //½«ÊäÈëÓò±äΪֻ¶Á
        if(tempElements.type=="radio"){
        	tempElements.disabled=true;
        }

        //ÇåÀí'þ
        tempElements.ondblclick = "return true";
        tempElements.onkeyup = "return true";
    }
    //½«Ñ¡ÔñÓò±äΪֻ¶Á
    if(document.all(i).tagName=="SELECT"){
    	tempElements = document.all(i);
    	tempElements.disabled = true;
    }
    //½«Ñ¡ÔñÓò±äΪֻ¶Á
    if(document.all(i).tagName=="TEXTAREA"){
    	tempElements = document.all(i);
    	tempElements.readOnly=true;
    	tempElements.style.backgroundColor = "RGB(247,247,247)";
    }

  }
}


text:
Repo to reproduce a (potential) bug

Demo:

http://kasperpeulen.github.io/todomvc-1

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

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

#### Published in
in Kreger-van Rij, Yeasts, a taxonomic study (Amsterdam), 3rd Edn 130, 145 (1984)

#### Original name
Debaryomyces Lodder & Kreger ex Kreger, 1984

### Remarks
null


text:
//
// AudioCdRipper.cs
//
// Authors:
//   Olivier Dufour <olivier.duff@gmail.com>
//   Andrés G. Aragoneses <knocte@gmail.com>
//   Stephan Sundermann <stephansundermann@gmail.com>
//
// Copyright (c) 2011 Olivier Dufour
// Copyright (C) 2013 Andrés G. Aragoneses
// Copyright (C) 2013 Stephan Sundermann
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Runtime.InteropServices;
using Mono.Unix;

using Hyena;
using Banshee.Base;
using Banshee.Collection;
using Banshee.ServiceStack;
using Banshee.MediaEngine;
using Banshee.MediaProfiles;
using Banshee.Configuration.Schema;

using Gst;
using Banshee.Streaming;
using System.Collections;

namespace Banshee.GStreamerSharp
{
    public class AudioCdRipper : IAudioCdRipper
    {
        private string encoder_pipeline;
        private string output_extension;
        private string output_path;
        private TrackInfo current_track;
        private string device;
        private int paranoia_mode;
        private System.Timers.Timer timer;

        Gst.Pipeline pipeline;
        Element cddasrc;
        Bin encoder;
        Element filesink;

        public event AudioCdRipperProgressHandler Progress;
        public event AudioCdRipperTrackFinishedHandler TrackFinished;
        public event AudioCdRipperErrorHandler Error;

        public void Begin (string device, bool enableErrorCorrection)
        {
            try {
                this.device = device;
                this.paranoia_mode = enableErrorCorrection ? 255 : 0;
                Profile profile = null;
                ProfileConfiguration config = ServiceManager.MediaProfileManager.GetActiveProfileConfiguration ("cd-importing");

                if (config != null) {
                    profile = config.Profile;
                } else {
                    profile = ServiceManager.MediaProfileManager.GetProfileForMimeType ("audio/vorbis")
                        ?? ServiceManager.MediaProfileManager.GetProfileForMimeType ("audio/flac");
                    if (profile != null) {
                        Log.InformationFormat ("Using default/fallback encoding profile: {0}", profile.Name);
                        ProfileConfiguration.SaveActiveProfile (profile, "cd-importing");
                    }
                }

                if (profile != null) {
                    encoder_pipeline = profile.Pipeline.GetProcessById ("gstreamer");
                    output_extension = profile.OutputFileExtension;
                }

                if (String.IsNullOrEmpty (encoder_pipeline)) {
                    throw new ApplicationException ();
                }
                timer = new System.Timers.Timer ();
                timer.Interval = 200;
                timer.AutoReset = true;
                timer.Elapsed += OnTick;
                Hyena.Log.InformationFormat ("Ripping using encoder profile `{0}' with pipeline: {1}", profile.Name, encoder_pipeline);
            } catch (Exception e) {
                throw new ApplicationException (Catalog.GetString ("Could not find an encoder for ripping."), e);
            }
        }

        void OnTick (object o, System.Timers.ElapsedEventArgs args)
        {
            Format format = Format.Time;
            State state, pending;
            long position;

            pipeline.GetState (out state, out pending, 0);
            if (state != State.Playing) {
                return;
            }

            if (!cddasrc.QueryPosition (format, out position)) {
                return;
            }

            RaiseProgress (current_track, TimeSpan.FromSeconds (position / (long)Constants.SECOND));
        }

        public void Finish ()
        {
            if (output_path != null) {
                Banshee.IO.File.Delete (new SafeUri (output_path));
            }

            TrackReset ();

            encoder_pipeline = null;
            output_extension = null;

            if (timer != null) {
                timer.Stop ();
            }

            if (pipeline != null && pipeline is Element) {
                pipeline.SetState (State.Null);
                pipeline = null;
            }
        }

        public void Cancel ()
        {
            Finish ();
        }

        private void TrackReset ()
        {
            current_track = null;
            output_path = null;
        }

        private TagList MakeTagList (TrackInfo track)
        {
            TagList tags = new TagList ();

            tags.Add (TagMergeMode.Replace, CommonTags.Artist, track.ArtistName);
            tags.Add (TagMergeMode.Replace, CommonTags.Album, track.AlbumTitle);
            tags.Add (TagMergeMode.Replace, CommonTags.Title, track.TrackTitle);
            tags.Add (TagMergeMode.Replace, CommonTags.Genre, track.Genre);

            tags.Add (TagMergeMode.Replace, CommonTags.TrackNumber, (uint)track.TrackNumber);
            tags.Add (TagMergeMode.Replace, CommonTags.TrackCount, (uint)track.TrackCount);
            tags.Add (TagMergeMode.Replace, CommonTags.AlbumDiscNumber, (uint)track.DiscNumber);
            tags.Add (TagMergeMode.Replace, CommonTags.AlbumDiscCount, (uint)track.DiscCount);

            tags.Add (TagMergeMode.Replace, CommonTags.Date, track.Year);
            tags.Add (TagMergeMode.Replace, CommonTags.Date, track.ReleaseDate);

            tags.Add (TagMergeMode.Replace, CommonTags.Composer, track.Composer);
            tags.Add (TagMergeMode.Replace, CommonTags.Copyright, track.Copyright);
            tags.Add (TagMergeMode.Replace, CommonTags.Comment, track.Comment);

            tags.Add (TagMergeMode.Replace, CommonTags.MusicBrainzTrackId, track.MusicBrainzId);
            tags.Add (TagMergeMode.Replace, CommonTags.MusicBrainzArtistId, track.ArtistMusicBrainzId);
            tags.Add (TagMergeMode.Replace, CommonTags.MusicBrainzAlbumId, track.AlbumMusicBrainzId);

            return tags;
        }

        private GLib.GType ToGType (Type t)
        {
            return (GLib.GType)t;
        }

        public void RipTrack (int trackIndex, TrackInfo track, SafeUri outputUri, out bool taggingSupported)
        {
            taggingSupported = false;
            TrackReset ();
            current_track = track;

            TagList tags = MakeTagList (track);
            output_path = String.Format ("{0}.{1}", outputUri.LocalPath, output_extension);

            // Avoid overwriting an existing file
            int i = 1;
            while (Banshee.IO.File.Exists (new SafeUri (output_path))) {
                output_path = String.Format ("{0} ({1}).{2}", outputUri.LocalPath, i++, output_extension);
            }

            Log.DebugFormat ("GStreamer ripping track {0} to {1}", trackIndex, output_path);

            if (!ConstructPipeline ()) {
                return;
            }

            // initialize the pipeline, set the sink output location
            filesink.SetState (State.Null);
            filesink ["location"] = output_path;

            var version = new System.Version (Banshee.ServiceStack.Application.Version);

            // find an element to do the tagging and set tag data
            foreach (Element element in encoder.IterateAllByInterface (TagSetterAdapter.GType)) {
                ITagSetter tag_setter = element as ITagSetter;

                if (tag_setter != null) {
                    tag_setter.AddTagValue (TagMergeMode.ReplaceAll, Constants.TAG_ENCODER,
                        new GLib.Value (String.Format ("Banshee {0}", Banshee.ServiceStack.Application.Version)));
                    tag_setter.AddTagValue (TagMergeMode.ReplaceAll, Constants.TAG_VERSION,
                        new GLib.Value ( (version.Major << 16) | (version.Minor << 8) | version.Build));

                    if (tags != null) {
                        tag_setter.MergeTags (tags, TagMergeMode.Append);
                    }

                    /*if (banshee_is_debugging ()) {
                        bt_tag_list_dump (gst_tag_setter_get_tag_list (tag_setter));
                    }*/

                    // We'll warn the user in the UI if we can't tag the encoded audio files
                    taggingSupported = true;
                }
            }

            // Begin the rip
            cddasrc ["track"] = trackIndex + 1;
            pipeline.SetState (State.Playing);
            timer.Start ();
        }

        bool ConstructPipeline ()
        {
            Element queue;

            pipeline = new Gst.Pipeline ("pipeline");
            if (pipeline == null) {
                RaiseError (current_track, Catalog.GetString ("Could not create pipeline"));
                return false;
            }

            cddasrc = Element.MakeFromUri (URIType.Src, "cdda://1", "cddasrc");
            if (cddasrc == null) {
                RaiseError (current_track, Catalog.GetString ("Could not initialize element from cdda URI"));
                return false;
            }

            cddasrc ["device"] = device;

            try {
                cddasrc ["paranoia-mode"] = paranoia_mode;
            } catch (Gst.PropertyNotFoundException) { }

            try {
                encoder = Parse.BinFromDescription (encoder_pipeline, true);
            } catch (Exception e) {
                string err = Catalog.GetString ("Could not create encoder pipeline : {0}");
                RaiseError (current_track, String.Format (err, e.Message));
                return false;
            }

            queue = ElementFactory.Make ("queue", "queue");
            if (queue == null) {
                RaiseError (current_track, Catalog.GetString ("Could not create queue plugin"));
                return false;
            }

            queue ["max-size-time"] = 120L * Gst.Constants.SECOND;

            filesink = ElementFactory.Make ("filesink", "filesink");
            if (filesink == null) {
                RaiseError (current_track, Catalog.GetString ("Could not create filesink plugin"));
                return false;
            }

            pipeline.Add (cddasrc, queue, encoder, filesink);

            if (!Element.Link (cddasrc, queue, encoder, filesink)) {
                RaiseError (current_track, Catalog.GetString ("Could not link pipeline elements"));
            }

            pipeline.Bus.AddWatch (OnBusMessage);

            return true;
        }

        private string ProbeMimeType ()
        {
            string preferred_mimetype = null;

            foreach (Element element in encoder.IterateRecurse ()) {
                Iterator pad_iter = element.IterateSrcPads ();
                IEnumerator enu = pad_iter.GetEnumerator ();

                while (enu.MoveNext ()) {
                    Pad pad = (Pad)enu.Current;
                    Caps caps = pad.QueryCaps ();
                    Structure str = (caps != null ? caps [0] : null);

                    if (str != null) {
                        string mimetype = str.Name;
                        int mpeg_layer;

                        // Prefer and adjust audio/mpeg, leaving MP3 as audio/mpeg
                        if (mimetype.StartsWith ("audio/mpeg")) {
                            GLib.Value val = str.GetValue ("mpegversion");
                            mpeg_layer = (Int32)val.Val;
                            switch (mpeg_layer) {
                                case 2: mimetype = "audio/mp2"; break;
                                case 4: mimetype = "audio/mp4"; break;
                                default: break;
                            }

                            preferred_mimetype = mimetype;

                        // If no preferred type set and it's not RAW, prefer it
                        } else if (preferred_mimetype == null &&
                            !mimetype.StartsWith ("audio/x-raw")) {
                            preferred_mimetype = mimetype;

                        // Always prefer application containers
                        } else if (mimetype.StartsWith ("application/")) {
                            preferred_mimetype = mimetype;
                        }
                    }
                }
            }
            return preferred_mimetype;
        }

        private void RefreshTrackMimeType (string mimetype)
        {
            if (current_track == null)
                return;

            if (mimetype != null) {
                string [] split = mimetype.Split (';', '.', ' ', '\t');
                if (split != null && split.Length > 0) {
                    current_track.MimeType = split[0].Trim ();
                } else {
                    current_track.MimeType = mimetype.Trim ();
                }
            }
        }

        private bool OnBusMessage (Bus bus, Message msg)
        {
            switch (msg.Type) {
                case MessageType.Eos:
                    pipeline.SetState (State.Null);
                    timer.Stop ();
                    OnFinished ();
                    break;

                case MessageType.StateChanged:
                    State old_state, new_state, pending_state;
                    msg.ParseStateChanged (out old_state, out new_state, out pending_state);
                    if (old_state == State.Ready && new_state == State.Paused && pending_state == State.Playing) {
                        string mimetype = ProbeMimeType ();
                        if (mimetype == null)
                            return true;
                        Log.InformationFormat ("Ripper : Found Mime Type for encoded content: {0}", mimetype);
                        RefreshTrackMimeType (mimetype);
                    }
                    break;

                case MessageType.Error:
                    GLib.GException err;
                    string debug;
                    msg.ParseError (out err, out debug);
                    RaiseError (current_track, String.Format ("{0} : {1}", err.Message, debug));
                    timer.Stop ();
                    break;
            }

            return true;
        }

        protected virtual void RaiseProgress (TrackInfo track, TimeSpan ellapsedTime)
        {
            AudioCdRipperProgressHandler handler = Progress;
            if (handler != null) {
                handler (this, new AudioCdRipperProgressArgs (track, ellapsedTime, track.Duration));
            }
        }

        protected virtual void RaiseTrackFinished (TrackInfo track, SafeUri outputUri)
        {
            AudioCdRipperTrackFinishedHandler handler = TrackFinished;
            if (handler != null) {
                handler (this, new AudioCdRipperTrackFinishedArgs (track, outputUri));
            }
        }

        protected virtual void RaiseError (TrackInfo track, string message)
        {
            AudioCdRipperErrorHandler handler = Error;
            if (handler != null) {
                handler (this, new AudioCdRipperErrorArgs (track, message));
            }
        }

        private void OnFinished ()
        {
            SafeUri uri = new SafeUri (output_path);
            TrackInfo track = current_track;

            TrackReset ();

            RaiseTrackFinished (track, uri);
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Text;

namespace MO.Common.Content
{
   //============================================================
   public class FCsvExport
   {
   }
}


text:
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }

# Checks for pending migrations before tests are run.
# If you are not using ActiveRecord, you can remove this line.
ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)

RSpec.configure do |config|

  config.fixture_path = "#{::Rails.root}/spec/fixtures"

  config.use_transactional_fixtures = true

  config.infer_base_class_for_anonymous_controllers = false

  config.order = 'random'
end


text:
module Fog
  module Vsphere
    class Compute
      class Datastores < Fog::Collection
        model Fog::Vsphere::Compute::Datastore
        attr_accessor :datacenter, :cluster

        def all(filters = {})
          load service.list_datastores(filters.merge(datacenter: datacenter, cluster: cluster))
        end

        def get(id)
          requires :datacenter
          new service.get_datastore(id, datacenter)
        end
      end
    end
  end
end


text:
using System.Collections.Generic;
using System.Threading.Tasks;
using Derivco.Orniscient.Proxy.Grains.Models;
using Orleans;

namespace Derivco.Orniscient.Proxy.Grains
{
    public interface IMethodInvocationGrain : IGrainWithStringKey
    {
        Task<List<GrainMethod>> GetAvailableMethods();
        Task<string> GetGrainKeyType();
        Task<object> InvokeGrainMethod(string id, string methodId, string parametersJson, bool invokeOnNewGrain = false);
    }
}


text:
package de.ulfbiallas.lantexter.view;

import java.util.HashMap;

/**
 * Interface for a SettingsGUI controller.
 *
 * @author Ulf Biallas
 *
 */
public interface SettingsGuiListener {

	/**
	 * Resets all settings to the default values.
	 */
	public void resetSettings();

	/**
	 * Save a set of settings.
	 *
	 * @param settings The settings to save.
	 */
	public void saveSettings(HashMap<String, String> settings);

}


text:
  <input type="text" class="form-control" placeholder="First name" ng-model="user.firstName">

  <input type="text" class="form-control" placeholder="Last name" ng-model="user.lastName">

  <input type="text" class="form-control" placeholder="City (Optional)" ng-model="user.city">


text:
class MX < Record

  validates_numericality_of :prio,
    :greater_than_or_equal_to => 0,
    :less_than_or_equal_to => 65535,
    :only_integer => true

  validates :content, :presence => true, :hostname => true

  def supports_prio?
    true
  end
end


text:
///////////////////////////////////////////////////////////////////////////////////
// Open 3D Model Viewer (open3mod) (v2.0)
// [TextureThumbnailControl.cs]
// (c) 2012-2015, Open3Mod Contributors
//
// Licensed under the terms and conditions of the 3-clause BSD license. See
// the LICENSE file in the root folder of the repository for the details.
//
// HIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
///////////////////////////////////////////////////////////////////////////////////

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;

using System.Windows.Forms;

namespace open3mod
{
    /// <summary>
    /// Provides a selectable thumbnail control for textures, goes together with the TextureInspectionView class.
    /// </summary>
    public sealed class TextureThumbnailControl : ThumbnailControlBase<TextureThumbnailControl>
    {
        private new readonly TextureInspectionView _owner;
        private readonly Scene _scene;
        private readonly string _filePath;
        private Texture _texture;

        private bool _replaced;
        private string _newFileId;

        private static Image _loadError;
        private static Image _background;
        private static Image _loadAnimImage;
        private Image _imageWithAlpha;
        private Image _imageWithoutAlpha;

        public string FilePath
        {
            get { return _filePath; }
        }

        public Texture Texture
        {
            get { return _texture; }
        }

        public TextureThumbnailControl(TextureInspectionView owner, Scene scene, string filePath)
            : base(owner, GetBackgroundImage(), Path.GetFileName(filePath))
        {
            _owner = owner;
            _scene = scene;
            _filePath = filePath;

            SetLoadingState();

            ContextMenuStrip = new ContextMenuStrip();

            var s = new ToolStripMenuItem("Zoom", null, OnContextMenuZoom);
            ContextMenuStrip.Items.Add(s);
            s.CheckOnClick = true;
            s.Checked = false;

            s = new ToolStripMenuItem("Show Transparency", null, OnContextMenuToggleAlpha);
            ContextMenuStrip.Items.Add(s);
            s.CheckOnClick = true;
            s.Checked = true;

            s = new ToolStripMenuItem("Mirror along X (U) axis", null, OnContextMenuMirrorX);
            ContextMenuStrip.Items.Add(s);
            s.CheckOnClick = true;
            s.Checked = false;
            s.Enabled = true;

            s = new ToolStripMenuItem("Mirror along Y (V) axis", null, OnContextMenuMirrorY);
            ContextMenuStrip.Items.Add(s);
            s.CheckOnClick = true;
            s.Checked = false;
            s.Enabled = true;

            ContextMenuStrip.Items.Add(new ToolStripSeparator());

            s = new ToolStripMenuItem("Delete", null, OnContextMenuDelete);
            ContextMenuStrip.Items.Add(s);
            s.Enabled = true;

            s = new ToolStripMenuItem("Rename", null, OnContextMenuRename);
            ContextMenuStrip.Items.Add(s);
            s.Enabled = true;

            ContextMenuStrip.Items.Add(new ToolStripSeparator());

            s = new ToolStripMenuItem("Texture Viewer", null, OnContextMenuDetails);
            ContextMenuStrip.Items.Add(s);
            s.Font = new System.Drawing.Font(
                DefaultFont.FontFamily,
                DefaultFont.Size,
                FontStyle.Bold,
                GraphicsUnit.Point
            );
            s.Enabled = false;

            s = new ToolStripMenuItem("Save", null, OnContextMenuExport);
            ContextMenuStrip.Items.Add(s);
            s.Enabled = false;

            ContextMenuStrip.Opened += OnContextMenuOpen;
            DoubleClick += OnContextMenuDetails;
        }

        private void OnContextMenuZoom(object sender, EventArgs eventArgs)
        {
            SetZoom();
        }

        private void OnContextMenuDetails(object sender, EventArgs eventArgs)
        {
            if (GetState() == State.Good)
            {
                _owner.ShowDetails(this);
            }
        }

        private void OnContextMenuMirrorX(object sender, EventArgs eventArgs)
        {
            if (GetState() != State.Good)
            {
                return;
            }

            _texture.Image.RotateFlip(RotateFlipType.RotateNoneFlipX);
            _texture.ReleaseUpload();
            _texture.Upload();
            if (pictureBox.Image != _texture.Image)
            {
                pictureBox.Image.RotateFlip(RotateFlipType.RotateNoneFlipX);
            }
            else
            {
                pictureBox.Invalidate();
            }
        }

        private void OnContextMenuMirrorY(object sender, EventArgs eventArgs)
        {
            if (GetState() != State.Good)
            {
                return;
            }
            _texture.Image.RotateFlip(RotateFlipType.RotateNoneFlipY);
            _texture.ReleaseUpload();
            _texture.Upload();
            if (pictureBox.Image != _texture.Image)
            {
                pictureBox.Image.RotateFlip(RotateFlipType.RotateNoneFlipY);
            }
            else
            {
                pictureBox.Invalidate();
            }
        }

        private void OnContextMenuExport(object sender, EventArgs eventArgs)
        {
            var image = _texture.Image;
            var exporter = new TextureExporter(_texture);

            var saver = new SaveFileDialog();
            saver.Title = "Specify file to export " + Path.GetFileName(_texture.OriginalTextureId) + " to";

            if (_texture.OriginalTextureId.Length > 0 && _texture.OriginalTextureId[0] == '*')
            {
                saver.FileName = "EmbeddedTexture_" + _texture.OriginalTextureId.Substring(1) + ".png";
            }
            else
            {
                saver.FileName = Path.GetFileName(_texture.OriginalTextureId);
            }

            var extensions = string.Join(";", exporter.GetExtensionList().Select(s => "*." + s).ToArray());
            saver.Filter = "Image Files ("+extensions+")|"+extensions+"|All files (*.*)|*.*";
            if(saver.ShowDialog(FindForm()) == DialogResult.OK)
            {
                if (!exporter.Export(saver.FileName))
                {
                    MessageBox.Show(FindForm(), "Failed to export to " + saver.FileName);
                }
            }
        }

        private void OnContextMenuDelete(object sender, EventArgs eventArgs)
        {
            // This does *not* delete the texture file on disk.

            int oldIndex = -1;
            _scene.UndoStack.PushAndDo("Delete Texture",
                // Do
                () =>
                {
                    _scene.TextureSet.Delete(Texture.OriginalTextureId);
                    oldIndex = _owner.RemoveEntry(this);
                },
                // Undo
                () =>
                {
                    _scene.TextureSet.Add(Texture.OriginalTextureId);
                    _owner.AddEntry(this, oldIndex);
                },
                // Update
                () =>
                {
                    UpdateDependentMaterialPreviews();
                });
        }

        private void OnContextMenuRename(object sender, EventArgs eventArgs)
        {
            // This renames the texture file on disk. The rename only affects the file name, not the path
            // prefix or file extension.
            //
            // Editing folders is complicated because the texture might be outside of the
            // base folder from which the scene is loaded. Also, when exporting we generally
            // prefer to copy all scene textures to a single folder anyway.
            if (Texture == null)
            {
                return;
            }

            if (Texture.ActualLocation == null)
            {
                MessageBox.Show("This is an embedded texture that cannot be renamed.");
                return;
            }

            SafeRenamer renamer = new SafeRenamer(_scene);
            RenameDialog dialog = new RenameDialog("", new HashSet<string>(), new HashSet<string>());

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                if (MessageBox.Show("This will rename the actual image file on disk.", "Rename texture",
                    MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    string newName = dialog.NewName;
                    string oldName = Texture.OriginalTextureId;
                    _scene.UndoStack.PushAndDo("Rename Texture File",
                        // Do
                        () => renamer.RenameTexture(Texture, newName),
                        // Undo
                        () => renamer.RenameTexture(Texture, oldName),
                        // Update
                        () => { texCaptionLabel.Text = Path.GetFileName(Texture.OriginalTextureId); });
                }
            }
        }

        private void OnContextMenuToggleAlpha(object sender, EventArgs eventArgs)
        {
            SetPictureBoxImage();
        }

        /// <summary>
        /// Called by TextureInspectionView when the texture pertaining
        /// to a thumbnail has been loaded (with success or not).
        /// </summary>
        /// <param name="texture">Texture to show a thumbnail for</param>
        public void SetTexture(Texture texture)
        {
            _texture = texture;
            var image = texture.Image ?? GetLoadErrorImage();

            Debug.Assert(image != null);

            BeginInvoke(new MethodInvoker(() =>
            {
                _imageWithAlpha = image;

                if (GetState() == State.Good)
                {
                    SetPictureBoxImage();
                    SetZoom();

                    // Enable the remainder menu items
                    for (var i = 2; i < ContextMenuStrip.Items.Count; ++i)
                    {
                        ContextMenuStrip.Items[i].Enabled = true;
                    }
                }
                else
                {
                    pictureBox.Image = _imageWithAlpha;
                    pictureBox.SizeMode = PictureBoxSizeMode.CenterImage;

                    // Disable all menu items
                    foreach (var item in ContextMenuStrip.Items)
                    {
                        ((ToolStripItem)item).Enabled = false;
                    }
                }

                Invalidate();
            }));

        }

        private void SetPictureBoxImage()
        {
            if (GetState() != State.Good)
            {
                return;
            }

            var item = ((ToolStripMenuItem)ContextMenuStrip.Items[0]);
            if (!Image.IsAlphaPixelFormat(_imageWithAlpha.PixelFormat))
            {
                item.Enabled = false;
                item.Checked = false;
                pictureBox.Image = _imageWithAlpha;
                return;
            }
            if (item.Checked)
            {
                pictureBox.Image = _imageWithAlpha;
            }
            else
            {
                if (_imageWithoutAlpha == null)
                {
                    var clone = new Bitmap(_imageWithAlpha.Width, _imageWithAlpha.Height, PixelFormat.Format24bppRgb);
                    using (var gr = Graphics.FromImage(clone)) {
                        gr.Clear(Color.White);
                        gr.DrawImage(_imageWithAlpha, new Rectangle(0, 0, clone.Width, clone.Height));
                    }

                    _imageWithoutAlpha = clone;
                }
                pictureBox.Image = _imageWithoutAlpha;
            }
        }

        private void SetZoom()
        {
            if (GetState() != State.Good)
            {
                return;
            }

            var item = ((ToolStripMenuItem)ContextMenuStrip.Items[1]);
            if(_imageWithAlpha.Width >= pictureBox.Width && _imageWithAlpha.Height >= pictureBox.Height)
            {
                item.Enabled = false;
                item.Checked = false;
                pictureBox.SizeMode = PictureBoxSizeMode.Zoom;
                return;
            }

            if (_imageWithAlpha.Width < pictureBox.Width && _imageWithAlpha.Height < pictureBox.Height && !item.Checked)
            {
                pictureBox.SizeMode = PictureBoxSizeMode.CenterImage;
            }
            else
            {
                pictureBox.SizeMode = PictureBoxSizeMode.Zoom;
            }
        }

        /// <summary>
        /// Changes the source texture path for this texture. This
        /// tries to load the requested file and sets it as new texture
        /// image. It then updates the thumbnail view. This is only
        /// valid if CanChangeTextureSource() is true.
        ///
        /// TODO Texture instances are available from the very beginning,
        /// it's just that this part of the system doesn't get them
        /// until loading is complete. So this is a design limitation
        /// that could probably be resolved.
        /// </summary>
        /// <param name="newFile"></param>
        public void ChangeTextureSource(string newFile)
        {
            Debug.Assert(CanChangeTextureSource());

            if (Texture.OriginalTextureId == newFile)
            {
                return;
            }

            // note: it is important to keep _newFileId as a field just in case the
            // users drags and drops another texture onto the control while this
            // texture is still being loaded.
            _newFileId = _owner.Scene.TextureSet.Replace(Texture.OriginalTextureId, newFile);

            // SetLoadingState() needs to be run on the GUI thread - AddCallback()
            // need not, but it needs to be sequenced after SetLoadingState().
            BeginInvoke(new MethodInvoker(() =>
            {
                SetLoadingState();

                _owner.Scene.TextureSet.AddCallback((id, tex) =>
                {
                    if (id == _newFileId)
                    {
                        var old = texCaptionLabel.Text;

                        BeginInvoke(new MethodInvoker(() =>
                        {
                            texCaptionLabel.Text = Path.GetFileName(newFile);

                            if (!_replaced)
                            {
                                labelOldTexture.Text = "was " + old;
                                texCaptionLabel.Top -= 4;

                                _replaced = true;
                            }
                        }));

                        SetTexture(tex);
                        UpdateDependentMaterialPreviews();
                        return false;
                    }
                    return true;
                });
            }));

            Invalidate();
        }

        private void UpdateDependentMaterialPreviews()
        {
            // TODO
        }

        protected override State GetState()
        {
            if (Texture == null)
            {
                return State.Pending;
            }
            return Texture.State == Texture.TextureState.LoadingFailed ? State.Failed : State.Good;
        }

        private void SetLoadingState()
        {
            _texture = null;
            pictureBox.Image = GetLoadingImage();
            pictureBox.SizeMode = PictureBoxSizeMode.CenterImage;
        }

        public bool CanChangeTextureSource()
        {
            return Texture != null;
        }

        protected override void OnDragDrop(DragEventArgs e)
        {
            try
            {
                var a = (Array)e.Data.GetData(DataFormats.FileDrop, false);

                if (a != null)
                {
                    // Extract string from first array element
                    // (ignore all files except first if more than one file was dropped)
                    string s = a.GetValue(0).ToString();

                    if (Directory.Exists(s))
                    {
                        // different behaviour when folders are dragged onto the panel:
                        // all FAILED textures are auto-matched against the file names
                        // in the folder in the hope that they can be resolved.
                        _owner.MatchWithFolder(s);
                        return;
                    }

                    // Do it async to avoid stalling the cursor
                    BeginInvoke((MethodInvoker)(() => ChangeTextureSource(s)), new object[] { this });
                }
            }
            catch (Exception ex)
            {
                Trace.WriteLine("Error in DragDrop function: " + ex.Message);
            }
        }

        protected override void OnDragEnter(DragEventArgs e)
        {
            if (!CanChangeTextureSource())
            {
                e.Effect = DragDropEffects.None;
                return;
            }
            // only accept files for drag and drop
            e.Effect = e.Data.GetDataPresent(DataFormats.FileDrop) ? DragDropEffects.Copy : DragDropEffects.None;
        }

        // hack: we make that public because it gets also used by the Renderer
        // to draw tabs which failed to load their scenes.
        public static Image GetLoadErrorImage()
        {
            if (_loadError != null)
            {
                return _loadError;
            }

            _loadError = ImageFromResource.Get("open3mod.Images.FailedToLoad.png");
            return _loadError;
        }

        private static Image GetBackgroundImage()
        {
            if (_background != null)
            {
                return _background;
            }

            _background = ImageFromResource.Get("open3mod.Images.TextureTransparentBackground.png");
            return _background;
        }

        private static Image GetLoadingImage()
        {
            if (_loadAnimImage != null)
            {
                return _loadAnimImage;
            }

            _loadAnimImage = ImageFromResource.Get("open3mod.Images.TextureLoading.gif");
            return _loadAnimImage;
        }
    }
}

/* vi: set shiftwidth=4 tabstop=4: */


text:
package com.foilen.smalltools.tools;

import java.util.Optional;

/**
 * This is to help searching for an available value by checking small ranges at a time.
 *
 * Features:
 *

 *
Keeps track of the last found value to use it as the next lower range

 *
Will loop once if the end is reached

 *

 *
 * @param <T>
 *            The type of value to search for
 */
public class SearchingAvailabilityTools<T extends Comparable<T>> extends AbstractBasics {

    public interface CheckAvailability<T> {
        /**
         * Calculate the next value.
         *
         * @param from
         *            the value to increment
         * @param increment
         *            the amount to increment
         * @return the incremented value
         */
        T increment(T from, long increment);

        /**
         * Give the next available value in the specified range.
         *
         * @param from
         *            the lower range (inclusive)
         * @param to
         *            the upper range (inclusive)
         * @return the next value if any
         */
        Optional<T> nextAvailable(T from, T to);
    }

    // Properties
    private T min;
    private T max;
    private long range;
    private CheckAvailability<T> checkAvailability;

    // Internal
    private T cursor;

    public SearchingAvailabilityTools(T min, T max, long range, CheckAvailability<T> checkAvailability) {
        this.min = min;
        this.max = max;
        this.range = range;
        this.checkAvailability = checkAvailability;

        this.cursor = min;
    }

    /**
     * Get the next available value if any.
     *
     * @return the next value
     */
    public synchronized Optional<T> getNext() {

        logger.debug("Search: min={}, cursor={}, max={}, range={}", min, cursor, max, range);

        T initialCursor = cursor;
        boolean didLoop = false;

        while (!didLoop || cursor.compareTo(initialCursor) < 0) {

            // Search
            T to = checkAvailability.increment(cursor, range);
            T stepTo = min(to, max);
            logger.debug("Next Available: cursor={}, stepTo={}", cursor, stepTo);
            Optional<T> next = checkAvailability.nextAvailable(cursor, stepTo);
            logger.debug("Found: {}", next);

            // Found one
            if (next.isPresent()) {
                cursor = checkAvailability.increment(next.get(), 1);
                if (cursor.compareTo(max) > 0) {
                    cursor = min;
                }
                return next;
            }

            // Move on
            cursor = checkAvailability.increment(stepTo, 1);
            if (cursor.compareTo(max) > 0) {
                cursor = min;
                didLoop = true;
            }

        }

        return Optional.empty();

    }

    private T min(T a, T b) {
        if (a.compareTo(b) < 0) {
            return a;
        }
        return b;
    }

}


text:
/**
 * @fileoverview
 * @enhanceable
 * @public
 */
// GENERATED CODE -- DO NOT EDIT!

goog.provide('proto.tensorflow.VariableDef');

goog.require('jspb.Message');
goog.require('jspb.BinaryReader');
goog.require('jspb.BinaryWriter');
goog.require('proto.tensorflow.SaveSliceInfoDef');

/**
 * Generated by JsPbCodeGenerator.
 * @param {Array=} opt_data Optional initial data array, typically from a
 * server response, or constructed directly in Javascript. The array is used
 * in place and becomes part of the constructed object. It is not cloned.
 * If no data is provided, the constructed object will be empty, but still
 * valid.
 * @extends {jspb.Message}
 * @constructor
 */
proto.tensorflow.VariableDef = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.tensorflow.VariableDef, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  proto.tensorflow.VariableDef.displayName = 'proto.tensorflow.VariableDef';
}

if (jspb.Message.GENERATE_TO_OBJECT) {
/**
 * Creates an object representation of this proto suitable for use in Soy templates.
 * Field names that are reserved in JavaScript and will be renamed to pb_name.
 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
 * For the list of reserved names please see:
 *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
 * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
 *     for transitional soy proto support: http://goto/soy-param-migration
 * @return {!Object}
 */
proto.tensorflow.VariableDef.prototype.toObject = function(opt_includeInstance) {
  return proto.tensorflow.VariableDef.toObject(opt_includeInstance, this);
};

/**
 * Static version of the {@see toObject} method.
 * @param {boolean|undefined} includeInstance Whether to include the JSPB
 *     instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @param {!proto.tensorflow.VariableDef} msg The msg instance to transform.
 * @return {!Object}
 */
proto.tensorflow.VariableDef.toObject = function(includeInstance, msg) {
  var f, obj = {
    variableName: jspb.Message.getFieldWithDefault(msg, 1, ""),
    initializerName: jspb.Message.getFieldWithDefault(msg, 2, ""),
    snapshotName: jspb.Message.getFieldWithDefault(msg, 3, ""),
    saveSliceInfoDef: (f = msg.getSaveSliceInfoDef()) && proto.tensorflow.SaveSliceInfoDef.toObject(includeInstance, f),
    isResource: jspb.Message.getFieldWithDefault(msg, 5, false)
  };

  if (includeInstance) {
    obj.$jspbMessageInstance = msg;
  }
  return obj;
};
}

/**
 * Deserializes binary data (in protobuf wire format).
 * @param {jspb.ByteSource} bytes The bytes to deserialize.
 * @return {!proto.tensorflow.VariableDef}
 */
proto.tensorflow.VariableDef.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.tensorflow.VariableDef;
  return proto.tensorflow.VariableDef.deserializeBinaryFromReader(msg, reader);
};

/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.tensorflow.VariableDef} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.tensorflow.VariableDef}
 */
proto.tensorflow.VariableDef.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = /** @type {string} */ (reader.readString());
      msg.setVariableName(value);
      break;
    case 2:
      var value = /** @type {string} */ (reader.readString());
      msg.setInitializerName(value);
      break;
    case 3:
      var value = /** @type {string} */ (reader.readString());
      msg.setSnapshotName(value);
      break;
    case 4:
      var value = new proto.tensorflow.SaveSliceInfoDef;
      reader.readMessage(value,proto.tensorflow.SaveSliceInfoDef.deserializeBinaryFromReader);
      msg.setSaveSliceInfoDef(value);
      break;
    case 5:
      var value = /** @type {boolean} */ (reader.readBool());
      msg.setIsResource(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};

/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.tensorflow.VariableDef.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.tensorflow.VariableDef.serializeBinaryToWriter(this, writer);
  return writer.getResultBuffer();
};

/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.tensorflow.VariableDef} message
 * @param {!jspb.BinaryWriter} writer
 */
proto.tensorflow.VariableDef.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getVariableName();
  if (f.length > 0) {
    writer.writeString(
      1,
      f
    );
  }
  f = message.getInitializerName();
  if (f.length > 0) {
    writer.writeString(
      2,
      f
    );
  }
  f = message.getSnapshotName();
  if (f.length > 0) {
    writer.writeString(
      3,
      f
    );
  }
  f = message.getSaveSliceInfoDef();
  if (f != null) {
    writer.writeMessage(
      4,
      f,
      proto.tensorflow.SaveSliceInfoDef.serializeBinaryToWriter
    );
  }
  f = message.getIsResource();
  if (f) {
    writer.writeBool(
      5,
      f
    );
  }
};

/**
 * optional string variable_name = 1;
 * @return {string}
 */
proto.tensorflow.VariableDef.prototype.getVariableName = function() {
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};

/** @param {string} value */
proto.tensorflow.VariableDef.prototype.setVariableName = function(value) {
  jspb.Message.setField(this, 1, value);
};

/**
 * optional string initializer_name = 2;
 * @return {string}
 */
proto.tensorflow.VariableDef.prototype.getInitializerName = function() {
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};

/** @param {string} value */
proto.tensorflow.VariableDef.prototype.setInitializerName = function(value) {
  jspb.Message.setField(this, 2, value);
};

/**
 * optional string snapshot_name = 3;
 * @return {string}
 */
proto.tensorflow.VariableDef.prototype.getSnapshotName = function() {
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};

/** @param {string} value */
proto.tensorflow.VariableDef.prototype.setSnapshotName = function(value) {
  jspb.Message.setField(this, 3, value);
};

/**
 * optional SaveSliceInfoDef save_slice_info_def = 4;
 * @return {?proto.tensorflow.SaveSliceInfoDef}
 */
proto.tensorflow.VariableDef.prototype.getSaveSliceInfoDef = function() {
  return /** @type{?proto.tensorflow.SaveSliceInfoDef} */ (
    jspb.Message.getWrapperField(this, proto.tensorflow.SaveSliceInfoDef, 4));
};

/** @param {?proto.tensorflow.SaveSliceInfoDef|undefined} value */
proto.tensorflow.VariableDef.prototype.setSaveSliceInfoDef = function(value) {
  jspb.Message.setWrapperField(this, 4, value);
};

proto.tensorflow.VariableDef.prototype.clearSaveSliceInfoDef = function() {
  this.setSaveSliceInfoDef(undefined);
};

/**
 * Returns whether this field is set.
 * @return {!boolean}
 */
proto.tensorflow.VariableDef.prototype.hasSaveSliceInfoDef = function() {
  return jspb.Message.getField(this, 4) != null;
};

/**
 * optional bool is_resource = 5;
 * Note that Boolean fields may be set to 0/1 when serialized from a Java server.
 * You should avoid comparisons like {@code val === true/false} in those cases.
 * @return {boolean}
 */
proto.tensorflow.VariableDef.prototype.getIsResource = function() {
  return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 5, false));
};

/** @param {boolean} value */
proto.tensorflow.VariableDef.prototype.setIsResource = function(value) {
  jspb.Message.setField(this, 5, value);
};


text:
		 Courses

	<button class="btn btn-primary pull-right" ng-click="edit()">Edit</button>

	<button class="btn btn-primary pull-right" ng-click="addHomework()">

		Add homework
	</button>

{{course.name || "Untitled"}}

{{course.info || "No description"}}

ID

{{course.id}}


text:
import Ember from "ember";
import hammerEvents from "./hammer-events";

var Gestures = {};

var gestureGroups = Object.keys(hammerEvents), i;
for (i = 0; i < gestureGroups.length; i++) {
  Ember.merge(Gestures, hammerEvents[gestureGroups[i]]);
}

export default function isGesture(name) {
  return Gestures.hasOwnProperty(name.toLowerCase());
}


text:
/**
 * @file args.h
 * Parses command line arguments.
 *
 * This differs from the GNU/getopt way in that:
 *  - parameters cannot mixed "-e -f" is not the same as "-ef"
 *  - knowledge of the complete set of parameters is not required
 *  - this means you can handle args in multiple spots
 *  - it is more portable
 *
 * @author  Ben Gardner
 * @license GPL v2+
 */
#ifndef ARGS_H_INCLUDED
#define ARGS_H_INCLUDED

#include "base_types.h"

class Args
{
protected:
   int   m_count;
   char  **m_values;
   UINT8 *m_used;      /* array of bits */

public:

   /**
    * Initializes the argument library.
    * This keeps a reference to argv, so don't change it.
    *
    * @param argc The argc that was passed to main()
    * @param argv The argv that was passed to main()
    */
   Args(int argc, char **argv);

   /** Standard destructor */
   ~Args();

   /**
    * Checks to see if an arg w/o a value is present.
    * Just scans the args looking for an exact match.
    *
    * "-c" matches "-c", but not "-call" or "-ec"
    *
    * @param token   The token string to match
    * @return        true/false -- Whether the argument was present
    */
   bool Present(const char *token);

   /**
    * Check for an arg with a value.
    * Returns only the first match.
    *
    * Assuming the token "-c"...
    *   "-call" returns "all"
    *   "-c=all" returns "all"
    *   "-c", "all" returns "all"
    *   "-c=", "all" returns ""
    *
    * @param token   The token string to match
    * @return        NULL or the pointer to the string
    */
   const char *Param(const char *token);

   /**
    * Similiar to arg_param, but can iterate over all matches.
    * Set index to 0 before the first call.
    *
    * @param token   The token string to match
    * @param idx     Pointer to the index that you initialized to 0
    * @return        NULL or the pointer to the string.
    */
   const char *Params(const char *token, int& index);

   /**
    * Marks an argument as being used.
    *
    * @param idx  The index of the argument
    */
   void SetUsed(int idx);

   /**
    * Gets whether an argument has been used, by index.
    *
    * @param idx  The index of the argument
    */
   bool GetUsed(int idx);

   /**
    * This function retrieves all unused parameters.
    * You must set the index before the first call.
    * Set the index to 1 to skip argv[0].
    *
    * @param idx  Pointer to the index
    * @return     NULL (done) or the pointer to the string
    */
   const char *Unused(int& idx);

   /**
    * Takes text and splits it into arguments.
    * args is an array of char * pointers that will get populated.
    * num_args is the maximum number of args split off.
    * If there are more than num_args, the remaining text is ignored.
    * Note that text is modified (zeroes are inserted)
    *
    * @param text       The text to split (modified)
    * @param args       The char * array to populate
    * @param num_args   The number of items in args
    * @return           The number of arguments parsed (always <= num_args)
    */
   static int SplitLine(char *text, char *args[], int num_args);
};

#endif   /* ARGS_H_INCLUDED */


text:
package components.diagram.providers;

import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.Map;
import java.util.Set;

import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.ecore.ENamedElement;
import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.tooling.runtime.providers.DiagramElementTypeImages;
import org.eclipse.gmf.tooling.runtime.providers.DiagramElementTypes;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;

import components.ComponentsPackage;
import components.diagram.edit.parts.Component2EditPart;
import components.diagram.edit.parts.ComponentEditPart;
import components.diagram.edit.parts.ConnectionEditPart;
import components.diagram.edit.parts.Port2EditPart;
import components.diagram.edit.parts.PortEditPart;
import components.diagram.part.ComponentModelDiagramEditorPlugin;

/**
 * @generated
 */
public class ComponentModelElementTypes {

	/**
	* @generated
	*/
	private ComponentModelElementTypes() {
	}

	/**
	* @generated
	*/
	private static Map<IElementType, ENamedElement> elements;

	/**
	* @generated
	*/
	private static DiagramElementTypeImages elementTypeImages = new DiagramElementTypeImages(
			ComponentModelDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());

	/**
	* @generated
	*/
	private static Set<IElementType> KNOWN_ELEMENT_TYPES;

	/**
	* @generated
	*/
	public static final IElementType Component_1000 = getElementType("ComponentTester.diagram.Component_1000"); //$NON-NLS-1$
	/**
	* @generated
	*/
	public static final IElementType Port_2001 = getElementType("ComponentTester.diagram.Port_2001"); //$NON-NLS-1$
	/**
	* @generated
	*/
	public static final IElementType Component_2002 = getElementType("ComponentTester.diagram.Component_2002"); //$NON-NLS-1$
	/**
	* @generated
	*/
	public static final IElementType Port_3001 = getElementType("ComponentTester.diagram.Port_3001"); //$NON-NLS-1$
	/**
	* @generated
	*/
	public static final IElementType Connection_4001 = getElementType("ComponentTester.diagram.Connection_4001"); //$NON-NLS-1$

	/**
	* @generated
	*/
	public static ImageDescriptor getImageDescriptor(ENamedElement element) {
		return elementTypeImages.getImageDescriptor(element);
	}

	/**
	* @generated
	*/
	public static Image getImage(ENamedElement element) {
		return elementTypeImages.getImage(element);
	}

	/**
	* @generated
	*/
	public static ImageDescriptor getImageDescriptor(IAdaptable hint) {
		return getImageDescriptor(getElement(hint));
	}

	/**
	* @generated
	*/
	public static Image getImage(IAdaptable hint) {
		return getImage(getElement(hint));
	}

	/**
	* Returns 'type' of the ecore object associated with the hint.
	*
	* @generated
	*/
	public static ENamedElement getElement(IAdaptable hint) {
		Object type = hint.getAdapter(IElementType.class);
		if (elements == null) {
			elements = new IdentityHashMap<IElementType, ENamedElement>();

			elements.put(Component_1000, ComponentsPackage.eINSTANCE.getComponent());

			elements.put(Port_2001, ComponentsPackage.eINSTANCE.getPort());

			elements.put(Component_2002, ComponentsPackage.eINSTANCE.getComponent());

			elements.put(Port_3001, ComponentsPackage.eINSTANCE.getPort());

			elements.put(Connection_4001, ComponentsPackage.eINSTANCE.getConnection());
		}
		return (ENamedElement) elements.get(type);
	}

	/**
	* @generated
	*/
	private static IElementType getElementType(String id) {
		return ElementTypeRegistry.getInstance().getType(id);
	}

	/**
	* @generated
	*/
	public static boolean isKnownElementType(IElementType elementType) {
		if (KNOWN_ELEMENT_TYPES == null) {
			KNOWN_ELEMENT_TYPES = new HashSet<IElementType>();
			KNOWN_ELEMENT_TYPES.add(Component_1000);
			KNOWN_ELEMENT_TYPES.add(Port_2001);
			KNOWN_ELEMENT_TYPES.add(Component_2002);
			KNOWN_ELEMENT_TYPES.add(Port_3001);
			KNOWN_ELEMENT_TYPES.add(Connection_4001);
		}
		return KNOWN_ELEMENT_TYPES.contains(elementType);
	}

	/**
	* @generated
	*/
	public static IElementType getElementType(int visualID) {
		switch (visualID) {
		case ComponentEditPart.VISUAL_ID:
			return Component_1000;
		case PortEditPart.VISUAL_ID:
			return Port_2001;
		case Component2EditPart.VISUAL_ID:
			return Component_2002;
		case Port2EditPart.VISUAL_ID:
			return Port_3001;
		case ConnectionEditPart.VISUAL_ID:
			return Connection_4001;
		}
		return null;
	}

	/**
	* @generated
	*/
	public static final DiagramElementTypes TYPED_INSTANCE = new DiagramElementTypes(elementTypeImages) {

		/**
		* @generated
		*/
		@Override

		public boolean isKnownElementType(IElementType elementType) {
			return components.diagram.providers.ComponentModelElementTypes.isKnownElementType(elementType);
		}

		/**
		* @generated
		*/
		@Override

		public IElementType getElementTypeForVisualId(int visualID) {
			return components.diagram.providers.ComponentModelElementTypes.getElementType(visualID);
		}

		/**
		* @generated
		*/
		@Override

		public ENamedElement getDefiningNamedElement(IAdaptable elementTypeAdapter) {
			return components.diagram.providers.ComponentModelElementTypes.getElement(elementTypeAdapter);
		}
	};

}


text:
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security.Cryptography.X509Certificates;
using Digipost.Api.Client.Shared.Resources.Resource;

[assembly: InternalsVisibleTo("Difi.Felles.Utility,PublicKey=0024000004800000940000000602000000240000525341310004000001000100f71f491a4cebe0a3d18a61744f92edfca908e4d756aa1140ebceeffb1fc4aa2e7bbe4d672067e2c0a3afd8c4511ef84cc1267ba04d8041e24d96c3d93e268fd69abc712fa81bcbae729f1c0524eef0254705bb2fcf1ffd43a647e9306b93e8dd7afd094a61ca2761fe87c20fdda758ad55d2c5ba6ad6edc9493309a355e51f99")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2,PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]

namespace Difi.Felles.Utility.Resources.Certificate
{
    internal class CertificateResource
    {
        private static readonly ResourceUtility ResourceUtility = new ResourceUtility(Assembly.GetExecutingAssembly(),"Certificate.Data");

        internal static X509Certificate2 GetCertificate(params string[] path)
        {
            byte[] cert = ResourceUtility.ReadAllBytes(path);
            return new X509Certificate2(cert, "", X509KeyStorageFlags.Exportable);
        }

        public static class UnitTests
        {
            public static X509Certificate2 GetProduksjonsMottakerSertifikatOppslagstjenesten()
            {
                return GetCertificate("UnitTests", "produksjonsmottakersertifikatFraOppslagstjenesten.pem");
            }

            public static X509Certificate2 GetFunksjoneltTestmiljøMottakerSertifikatOppslagstjenesten()
            {
                return GetCertificate("UnitTests", "testmottakersertifikatFraOppslagstjenesten.pem");
            }

            public static X509Certificate2 NotActivatedSelfSignedTestCertificate()
            {
                return GetCertificate("UnitTests", "NotActivatedSelfSignedBringAs.cer");
            }

            public static X509Certificate2 GetExpiredSelfSignedTestCertificate()
            {
                return GetCertificate("UnitTests", "ExpiredSelfSignedBringAs.cer");
            }

            public static X509Certificate2 GetValidSelfSignedTestCertificate()
            {
                return GetCertificate("UnitTests", "ValidSelfSignedBringAs.cer");
            }

            public static X509Certificate2 TestIntegrasjonssertifikat()
            {
                return GetPostenCertificate();
            }

            public static X509Certificate2 GetEnhetstesterSelvsignertSertifikat()
            {
                return GetCertificate("UnitTests", "difi-enhetstester.cer");
            }

            public static X509Certificate2 GetPostenCertificate()
            {
                return GetFunksjoneltTestmiljøMottakerSertifikatOppslagstjenesten();
            }

            internal static X509Certificate2 GetAvsenderEnhetstesterSertifikat()
            {
                return EvigTestSertifikatMedPrivatnøkkel();
            }

            internal static X509Certificate2 GetMottakerEnhetstesterSertifikat()
            {
                return EvigTestSertifikatUtenPrivatnøkkel();
            }

            private static X509Certificate2 EvigTestSertifikatUtenPrivatnøkkel()
            {
                return GetCertificate("UnitTests", "difi-enhetstester.cer");
            }

            private static X509Certificate2 EvigTestSertifikatMedPrivatnøkkel()
            {
                return GetCertificate("UnitTests", "difi-enhetstester.p12");
            }
        }

        public static class Chain
        {
            public static List<X509Certificate2> GetDifiTestChain()
            {
                return new List<X509Certificate2>
                {
                    new X509Certificate2(GetCertificate("TestChain", "Buypass_Class_3_Test4_CA_3.cer")),
                    new X509Certificate2(GetCertificate("TestChain", "Buypass_Class_3_Test4_Root_CA.cer")),
                    new X509Certificate2(GetCertificate("TestChain", "intermediate - commfides cpn enterprise-norwegian sha256 ca - test2.crt")),
                    new X509Certificate2(GetCertificate("TestChain", "root - cpn root sha256 ca - test.crt"))
                };
            }

            public static List<X509Certificate2> GetDifiProductionChain()
            {
                return new List<X509Certificate2>
                {
                    new X509Certificate2(GetCertificate("ProdChain", "BPClass3CA3.cer")),
                    new X509Certificate2(GetCertificate("ProdChain", "BPClass3RootCA.cer")),
                    new X509Certificate2(GetCertificate("ProdChain", "cpn enterprise sha256 class 3.crt")),
                    new X509Certificate2(GetCertificate("ProdChain", "cpn rootca sha256 class 3.crt"))
                };
            }
        }
    }
}


text:
printf "** Building linux/amd64\n"
go build -a -o bin/linux-amd64/http2nsq github.com/zerklabs/http2nsq


text:
goog.module('jscomp.runtime_tests.polyfill_tests.object_getownpropertysymbols_test');
goog.setTestOnly();

const testSuite = goog.require('goog.testing.testSuite');
const testing = goog.require('jscomp.runtime_tests.polyfill_tests.testing');

const assertPropertyListEquals = testing.assertPropertyListEquals;
const objectCreate = testing.objectCreate;

const SYMBOL_IS_POLYFILLED = typeof Symbol('') === 'string';

testSuite({
  testGetOwnPropertySymbols_symbols() {
    if (SYMBOL_IS_POLYFILLED) return;

    const a = Symbol('a');
    const b = Symbol('b');
    const c = Symbol('c');
    const obj = {[b]: 42, [a]: 13};
    assertPropertyListEquals([b, a], Object.getOwnPropertySymbols(obj));

    const sub = objectCreate(obj);
    assertObjectEquals([], Object.getOwnPropertySymbols(sub));
    sub[a] = 23;
    sub[c] = 12;

    assertPropertyListEquals([a, c], Object.getOwnPropertySymbols(sub));
  },

  testGetOwnPropertySymbols_stringsExcluded() {
    if (SYMBOL_IS_POLYFILLED) return;

    const a = Symbol('a');
    const b = Symbol('b');
    const c = Symbol('c');
    const obj = {[a]: 32, [c]: 12, 12: 14, 'a': 23};
    const sub = objectCreate(obj);
    sub[c] = 2;
    sub[b] = 1;
    sub['42'] = 42;
    sub['x'] = 25;

    assertPropertyListEquals([a, c], Object.getOwnPropertySymbols(obj));
    assertPropertyListEquals([c, b], Object.getOwnPropertySymbols(sub));
  },

  testGetOwnPropertySymbols_polyfilled() {
    if (!SYMBOL_IS_POLYFILLED) return;

    // If symbol is polyfilled, then this always returns empty list.
    const a = Symbol('a');
    const obj = {[a]: 32, 'a': 23};
    assertPropertyListEquals([], Object.getOwnPropertySymbols(obj));
  }
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE markables SYSTEM "markables.dtd">
<markables xmlns="www.eml.org/NameSpaces/intensifier">
<markable id="markable_59" span="word_929" degree="medium"  mmax_level="intensifier"  emo-expression-ref="emo-expression:markable_57" />
<markable id="markable_10050091" span="word_49" degree="medium"  mmax_level="intensifier"  emo-expression-ref="emo-expression:markable_5" />
<markable id="markable_10050104" span="word_1070" degree="medium"  mmax_level="intensifier"  emo-expression-ref="emo-expression:markable_10050102" />
</markables>


text:
"""Tests for module csv_merger."""

import datetime
import filecmp
import os
import shutil
import tempfile
import unittest

import csv_comparer

class TestCsvComparer(unittest.TestCase):

  def setUp(self):
    self._test_csv_dir = os.path.join(
        os.path.dirname(os.path.realpath(__file__)),
        'test_data', 'csv_comparer')
    self._actual_output_dir = tempfile.mkdtemp()

    # Set mocks.
    class _MockUtcNow(object):
      @staticmethod
      def strftime(format_str):
        self.assertEqual('%Y-%m-%d %H:%M UTC', format_str)
        return '2014-05-19 16:50 UTC'
    class _MockDatetime(object):
      @staticmethod
      def utcnow():
        return _MockUtcNow()
    self._original_datetime = datetime.datetime
    datetime.datetime = _MockDatetime

  def tearDown(self):
    shutil.rmtree(self._actual_output_dir)
    datetime.datetime = self._original_datetime

  def _AssertHTMLFiles(self, sub_dir, additional_files=()):
    # Ensure that the two html files we care about are as expected.
    for html_file in ('index.html', 'fieldname1.html') + additional_files:
      self.assertTrue(
          filecmp.cmp(os.path.join(self._test_csv_dir, sub_dir, html_file),
                      os.path.join(self._actual_output_dir, html_file)))

  def test_E2EComparerWithDiscardOutliers(self):
    comparer = csv_comparer.CsvComparer(
        csv_file1=os.path.join(self._test_csv_dir, 'comparer_csv1.csv'),
        csv_file2=os.path.join(self._test_csv_dir, 'comparer_csv2.csv'),
        output_html_dir=self._actual_output_dir,
        requester_email='superman@krypton.com',
        chromium_patch_link='http://chromium-patch.com',
        skia_patch_link='http://skia-patch.com',
        raw_csv_nopatch='http://raw-csv-nopatch.com',
        raw_csv_withpatch='http://raw-csv-withpatch.com',
        variance_threshold=10,
        absolute_url='',
        min_pages_in_each_field=1,
        discard_outliers=12.5,
        num_repeated=3,
        target_platform='Android',
        crashed_instances='build1-b5 build10-b5',
        missing_devices='build99-b5 build100-b5',
        browser_args_nopatch='--test=1',
        browser_args_withpatch='--test=2',
        pageset_type='Mobile10k',
        chromium_hash='abcdefg1234567',
        skia_hash='tuvwxyz1234567',
        missing_output_workers='1 3 100',
        logs_link_prefix=('https://chrome-swarming.appspot.com/tasklist?'
                          'l=500&f=runid:testing&f=name:perf_task_'),
        description='E2EComparerWithDiscardOutliers',
        total_archives='',
    )
    comparer.Compare()
    self._AssertHTMLFiles('discard_outliers')

  def test_E2EComparerWithNoDiscardOutliers(self):
    comparer = csv_comparer.CsvComparer(
        csv_file1=os.path.join(self._test_csv_dir, 'comparer_csv1.csv'),
        csv_file2=os.path.join(self._test_csv_dir, 'comparer_csv2.csv'),
        output_html_dir=self._actual_output_dir,
        requester_email='superman@krypton.com',
        chromium_patch_link='http://chromium-patch.com',
        skia_patch_link='http://skia-patch.com',
        raw_csv_nopatch='http://raw-csv-nopatch.com',
        raw_csv_withpatch='http://raw-csv-withpatch.com',
        variance_threshold=0,
        absolute_url='',
        min_pages_in_each_field=0,
        discard_outliers=0,
        num_repeated=3,
        target_platform='Linux',
        crashed_instances='',
        missing_devices='',
        browser_args_nopatch='',
        browser_args_withpatch='',
        pageset_type='10k',
        chromium_hash='abcdefg1234567',
        skia_hash='tuvwxyz1234567',
        missing_output_workers='',
        logs_link_prefix='',
        description='E2EComparerWithNoDiscardOutliers',
        total_archives='10',
    )
    comparer.Compare()
    self._AssertHTMLFiles('keep_outliers',
                          ('fieldname2.html', 'fieldname3.html'))

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


text:
require "spec_helper"

describe Synced::Strategies::SyncedPerScopeTimestampStrategy do
  let(:unrelated_account) { Account.create }
  let(:account) { Account.create }
  let(:timestamp_strategy) do
    Synced::Strategies::SyncedPerScopeTimestampStrategy.new(scope: account, model_class: Booking)
  end
  let(:timestamp_strategy_without_scope) do
    Synced::Strategies::SyncedPerScopeTimestampStrategy.new(scope: nil, model_class: Booking)
  end
  let(:unrelated_scope_timestamp_strategy) do
    Synced::Strategies::SyncedPerScopeTimestampStrategy.new(scope: unrelated_account,
      model_class: Booking)
  end
  let(:unrelated_model_timestamp_strategy) do
    Synced::Strategies::SyncedPerScopeTimestampStrategy.new(scope: account, model_class: Rental)
  end

  around { |example| Timecop.freeze(Time.zone.now.round) { example.run} }

  describe "#last_synced_at" do
    before do
      Synced::Timestamp.with_scope_and_model(account, Booking).create(synced_at: Time.zone.now)
      Synced::Timestamp.with_scope_and_model(account, Booking).create(synced_at: 1.day.ago)
      Synced::Timestamp.with_scope_and_model(account, Booking).create(synced_at: 1.hour.from_now)
      Synced::Timestamp.with_scope_and_model(account, Booking).create(synced_at: 1.hour.ago)
      # having different model
      Synced::Timestamp.with_scope_and_model(account, Rental).create(synced_at: 2.day.from_now)
      # having different scope
      Synced::Timestamp.with_scope_and_model(unrelated_account, Booking).create(synced_at: 1.day.from_now)
    end

    context "with scope" do
      it "always returns latest synced_at for given scope" do
        expect(timestamp_strategy.last_synced_at).to eq(1.hour.from_now)
        expect(unrelated_scope_timestamp_strategy.last_synced_at).to eq(1.day.from_now)
        expect(unrelated_model_timestamp_strategy.last_synced_at).to eq(2.day.from_now)
      end
    end

    context "without scope" do
      it "always returns latest synced_at from global scope" do
        # from unrelated account
        expect(timestamp_strategy_without_scope.last_synced_at).to eq(1.day.from_now)
      end
    end
  end

  describe "#reset" do
    before do
      Synced::Timestamp.with_scope_and_model(account, Booking).create(synced_at: Time.zone.now)
      Synced::Timestamp.with_scope_and_model(account, Booking).create(synced_at: 1.day.ago)
      Synced::Timestamp.with_scope_and_model(account, Booking).create(synced_at: 1.hour.from_now)
      Synced::Timestamp.with_scope_and_model(account, Booking).create(synced_at: 1.hour.ago)
      # having different model
      Synced::Timestamp.with_scope_and_model(account, Rental).create(synced_at: 2.day.from_now)
      # having different scope
      Synced::Timestamp.with_scope_and_model(unrelated_account, Booking).create(synced_at: 1.day.from_now)
    end

    context "with scope" do
      it "removes timestamps for given scope" do
        expect {
          timestamp_strategy.reset
        }.to change(Synced::Timestamp, :count).by(-4)
        expect(Synced::Timestamp.with_scope_and_model(unrelated_account, Booking).count).to eq(1)
        # ensure nothing was removed for other model
        expect(Synced::Timestamp.with_scope_and_model(account, Rental).count).to eq(1)
      end
    end

    context "without scope" do
      it "removes all timestamps for given model" do
        expect {
          timestamp_strategy_without_scope.reset
        }.to change(Synced::Timestamp, :count).by(-5)
        expect(Synced::Timestamp.with_scope_and_model(unrelated_account, Booking).count).to eq(0)
        # ensure nothing was removed for other model
        expect(Synced::Timestamp.with_scope_and_model(account, Rental).count).to eq(1)
      end
    end
  end

  describe "#update" do
    before do
      Synced::Timestamp.create(parent_scope: unrelated_account, model_class: Booking, synced_at: 1.day.from_now)
    end

    context "with scope" do
      it "properly updates last_synced_at for given scope" do
        expect(timestamp_strategy.last_synced_at).to be_nil
        expect {
          timestamp_strategy.update(Time.zone.now)
        }.to change(timestamp_strategy, :last_synced_at).from(nil).to(Time.zone.now)
        expect {
          unrelated_scope_timestamp_strategy.update(1.day.from_now)
        }.not_to change(timestamp_strategy, :last_synced_at)
        expect {
          unrelated_model_timestamp_strategy.update(1.day.from_now)
        }.not_to change(timestamp_strategy, :last_synced_at)
        expect {
          timestamp_strategy.update(1.day.ago)
        }.not_to change(timestamp_strategy, :last_synced_at)
        expect {
          timestamp_strategy.update(1.day.from_now)
        }.to change(timestamp_strategy, :last_synced_at).from(Time.zone.now).to(1.day.from_now)
      end
    end

    context "without scope" do
      it "properly updates last_synced_at for global scope" do
        expect(timestamp_strategy_without_scope.last_synced_at).to eq 1.day.from_now
        expect {
          timestamp_strategy_without_scope.update(2.days.from_now)
        }.to change(timestamp_strategy_without_scope, :last_synced_at)
          .from(1.day.from_now).to(2.days.from_now)
        expect {
          unrelated_scope_timestamp_strategy.update(3.days.from_now)
        }.to change(timestamp_strategy_without_scope, :last_synced_at)
          .from(2.days.from_now).to(3.days.from_now)
      end
    end
  end
end


text:
module Files
  class UpdateContext < BaseContext
    def execute
      allowed = if project.protected_branch?(ref)
                  can?(current_user, :push_code_to_protected_branches, project)
                else
                  can?(current_user, :push_code, project)
                end

      unless allowed
        return error("You are not allowed to push into this branch")
      end

      unless repository.branch_names.include?(ref)
        return error("You can only create files if you are on top of a branch")
      end

      blob = repository.blob_at(ref, path)

      unless blob
        return error("You can only edit text files")
      end

      new_file_action = Gitlab::Satellite::EditFileAction.new(current_user, project, ref, path)
      created_successfully = new_file_action.commit!(
        params[:content],
        params[:commit_message],
        params[:last_commit]
      )

      if created_successfully
        success
      else
        error("Your changes could not be commited, because the file has been changed")
      end
    end
  end
end


text:
package in.cdac.medinfo.csnotk.csnoserv;

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

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;

@ApplicationPath("/")
public class CSnoServAppilcation extends Application {
    @Override
    public Set<Class<?>> getClasses() {
        final Set<Class<?>> classes = new HashSet<Class<?>>();
        // register root resource
        classes.add(CSnoServResource.class);
        return classes;
    }
}


text:
Dropdowns offer items that the user can choose from.

Add the `nglDropdown` directive to the `<div>` that wraps the dropdown list.

Use the `nglDropdownTrigger` directive to any child element,
usually a `<button>` or a `<a>`, to open or close the dropdown.

Add the `nglDropdownItem` directive on any child element that constitutes
a dropdown item.

**Accessibility and Keyboard interactions**:

  * `Space` and `Enter` on an `nglDropdownTrigger` toggle the dropdown's open status
  * `DownArrow` on an `nglDropdownTrigger` opens the dropdown and moves focus to the first dropdown item
  * An open `nglDropdown` has `aria-selected="true"` and a closed one has `aria-selected="false"`
  * `DownArrow` and `UpArrow` on an open `nglDropdown` move focus to the next and previous items respectively
  * `Escape` closes an open `nglDropdown` and moves focus to the `nglDropdownTrigger`
  * `Tab` closes an open `nglDropdown` and moves focus to the next focusable element


text:
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>I Watch Stuff</title>
    <link rel="alternate" type="text/html" href="http://iwatchstuff.com/" />
    <link rel="self" type="application/atom+xml" href="http://iwatchstuff.com/atom.xml" />
    <id>tag:iwatchstuff.com,2011-04-07://1</id>
    <updated>2015-05-01T22:18:09Z</updated>
    <subtitle>Movie news that respects your personal boundaries and safety words.</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 4.38</generator>

<entry>
    <title>Adam Sandler Covering Up 'Ridiculous Six' Controversy in Bronzer</title>
    <link rel="alternate" type="text/html" href="http://iwatchstuff.com/2015/05/adam-sandler-covering-up-ridiculous-six.php" />
    <id>tag:iwatchstuff.com,2015://1.14150</id>

    <published>2015-05-01T20:54:31Z</published>
    <updated>2015-05-01T22:18:09Z</updated>

     Now a week since seeing much of the Native American cast of his Ridiculous Six walk off the set, Adam Sandler has found a way to cover up the controversy: copious bronzer....
    <author>
        <name>Mark</name>

    </author>

    <category term="adamsandler" label="adam sandler" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="movie" label="movie" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="news" label="news" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ridiculoussix" label="ridiculous six" scheme="http://www.sixapart.com/ns/types#tag" />

    <content type="html" xml:lang="en" xml:base="http://iwatchstuff.com/">
        <![CDATA[

Now a week since seeing much of the Native American cast of his Ridiculous Six walk off the set, Adam Sandler has found a way to cover up the controversy: copious bronzer.
]]>
        <![CDATA[
 Yes, like Rob Schneider before (seen above in Bedtime Stories), extras of various ethnicities on Sandler's latest are reportedly being slathered in makeup to give the appearance of the darker, Native skin tones lost when people for some reason found the name "No Bra" offensive. Perhaps in an attempt to make that seem fine somehow, it's said that at least one full-blooded Navajo extra was also "bronzed," which she explained left her "quite confused"--much like one is left after a "joke" about a woman squatting to pee while smoking a peace pipe.

Netflix has not yet returned the Hollywood Reporter's request for a comment on how they plan to somehow shove this under their increasingly hole-filled umbrella of "satire."
]]>
    </content>
</entry>
</feed>