text:
function uniq(a) {
    var seen = {};
    return a.filter(function(item) {
        var k = item.id;
        return k == null ? true : seen.hasOwnProperty(k) ? false : (seen[k] = true);
    });
}

var colorStudent = "#31708F";
var colorSupervisor = "#A94442";
var colorFirstInspector = "#8A6D3B";
var colorSecondInspector = "#3C763D";
var colorInspection = "#337AB7";
var colorOtherInspection = colorSupervisor;

function Inspector(json) {
	var self = this;

	self.id = json.id;
	self.username= json.username;
	self.name = json.name;
	self.keywords = json.keywords;
	self.load = ko.observable(json.load);
	self.capacity = json.capacity;
	self.isFirstInspector = false;
	self.suggested = json.suggested;

	self.setFirstInspector = function(isFirstInspector) {
		if (self.isFirstInspector != isFirstInspector) {
			self.isFirstInspector = isFirstInspector;
			if (self.isFirstInspector) {
				self.load(self.load() + 1);
			} else {
				self.load(self.load() - 1);
			}
		}
	};

	self.formattedCapacity = function() {
		return self.capacity - self.load() + "/" + self.capacity;
	};

	self.overloaded = function() {
		return self.load() >= self.capacity;
	};

	self.slots = [];
	self.otherInspectionSlots = [];
}

function InspectionViewModel() {
	var self = this;

	self.startDate = null;
	self.endDate = null;
	self.inspectionWeekID = null;

	self.studentID = null;
	self.studentSlots = [];
	self.studentOtherInspectionSlots = [];

	self.supervisorID = null;
	self.supervisorSlots = [];
	self.supervisorOtherInspectionSlots = [];

	self.inspectionSlot = ko.observable({
            title  : 'Project inspection',
            constraint: "businessHours",
            color: "orange"
    });

	self.allInspectors = ko.observableArray([]);
	self.showOverloaded = ko.observable(true);

	// Splitted list of inspectors
	self.filteredInspectors = function(isSuggested, canBeOverloaded) {
		return self.allInspectors().filter(function (inspector) {
			  return inspector.suggested == isSuggested && (canBeOverloaded || !inspector.overloaded() || inspector.isFirstInspector);
		});
	};
	self.suggestedInspectors = ko.computed(function() {
		return self.filteredInspectors(true, self.showOverloaded());
	});
	self.otherInspectors = ko.computed(function() {
		return self.filteredInspectors(false, self.showOverloaded());
	});

	self.firstInspector = ko.observable();
	self.secondInspector = ko.observable();

	self.firstOtherInspector = ko.observable();
	self.secondOtherInspector = ko.observable();

	// Inputs
	self.readSuggestedInspectors = function(json) {
    	var inspectors = [];
    	json.suggestedInspectors.forEach(function(inspectorJson) {
    		if (inspectorJson.id != self.supervisorID) {
        		var inspector = new Inspector(inspectorJson);
        		inspectors.push(inspector);
    		}
    	});
    	//self.suggestedInspectors(inspectors);
    	ko.utils.arrayPushAll(self.allInspectors, inspectors);
    	self.firstInspector(null);
	};

	self.readOtherInspectors = function(json) {
    	var inspectors = [];
    	json.otherInspectors.forEach(function(inspectorJson) {
    		if (inspectorJson.id != self.supervisorID) {
	    		var inspector = new Inspector(inspectorJson);
	    		inspectors.push(inspector);
    		}
    	});
    	//self.otherInspectors(inspectors);
    	ko.utils.arrayPushAll(self.allInspectors, inspectors);
    	self.secondInspector(null);
	};

	self.readFirstInspector = function(json) {
		if (json.firstInspectorID >= 0) {// Get first inspector from back end if it exist
	    	var firstInspector = self.inspectorWithID(json.firstInspectorID);
	    	firstInspector.isFirstInspector = true; // set selection with out changing his load
	    	self.firstInspector(firstInspector);
	    	if (self.otherInspectors().indexOf(firstInspector) >= 0) {
	        	self.firstOtherInspector(firstInspector);
	    	}
		}
	};

	self.readSecondInspector = function(json) {
		if (json.secondInspectorID >= 0) { // Get second inspector from back end if it exist
	    	var secondInspector = self.inspectorWithID(json.secondInspectorID);
	    	self.secondInspector(secondInspector);
	    	if (self.otherInspectors().indexOf(secondInspector) >= 0) {
	        	self.secondOtherInspector(secondInspector);
	    	}
		}
	};

	self.readInspection = function() {
    	var jsonDiv = $('#json-variables');
    	var json = JSON.parse(jsonDiv.text());

		self.allInspectors([]);
		self.readInspectionDate(json);
		self.readStudent(json);
		self.readSuggestedInspectors(json);
		self.readOtherInspectors(json);
		self.readFirstInspector(json);
		self.readSecondInspector(json);

		self.inspectionSlot().id = json.inspectionID;
	};

	self.readStudent = function(json) {
		self.supervisorID = json.supervisorID;
		self.studentID = json.studentID;
	};

	self.readInspectionDate = function(json) {
		self.startDate = moment(json.firstDay).format("YYYY-MM-DD");
		self.endDate = moment(self.startDate).add(4, 'days').format("YYYY-MM-DD");
		self.inspectionWeekID = json.inspectionWeekID;
		if (json.inspectionStart && json.inspectionEnd) {
			self.inspectionSlot().start = json.inspectionStart;
			self.inspectionSlot().end = json.inspectionEnd;
		} else {
			self.inspectionSlot().start = self.startDate + 'T09:00:00';
			self.inspectionSlot().end = self.startDate + 'T09:30:00';
		}
	};

	// Getters
	self.inspectorWithID = function(inspectorID) {
		var inspector = null;
		self.allInspectors().forEach(function(i) {
			if (i.id == inspectorID) {
				inspector = i;
			}
		});
		return inspector;
	};
	self.inspectorMarkedFirstInspector = function() {
		var inspector = null;
		self.allInspectors().forEach(function(i) {
			if (i.isFirstInspector) {
				inspector = i;
			}
		});
		return inspector;
	};
	self.inspectorMarkedSecondInspector = function() {
		var inspector = null;
		self.allInspectors().forEach(function(i) {
			if (i.isSecondInspector) {
				inspector = i;
			}
		});
		return inspector;
	};

	self.getSlots = function(start, end, timezone, callback) {
		var slots = [];
		slots.push(self.inspectionSlot());
		if (self.firstInspector() != null) {
			slots = slots.concat(self.firstInspector().slots);
			slots = slots.concat(self.firstInspector().otherInspectionSlots);
		}
		if (self.secondInspector() != null) {
			slots = slots.concat(self.secondInspector().slots);
			slots = slots.concat(self.secondInspector().otherInspectionSlots);
		}
		slots = slots.concat(self.studentSlots);
		slots = slots.concat(self.studentOtherInspectionSlots);
		slots = slots.concat(self.supervisorSlots);
		slots = slots.concat(self.supervisorOtherInspectionSlots);
		callback(uniq(slots));
	};

	// Get availability
	self.studentIsAvailable = ko.computed(function() {
		return !slotsOverlap(self.studentSlots, self.inspectionSlot());
	});
	self.supervisorIsAvailable = ko.computed(function() {
		return !slotsOverlap(self.supervisorSlots, self.inspectionSlot());
	});
	self.firstInspectorIsAvailable = ko.computed(function() {
		var user = self.firstInspector();
		if (user) {
			return !slotsOverlap(user.slots, self.inspectionSlot());
		} else {
			return true;
		}
	});
	self.secondInspectorIsAvailable = ko.computed(function() {
		var user = self.secondInspector();
		if (user) {
			return !slotsOverlap(user.slots, self.inspectionSlot());
		} else {
			return true;
		}
	});
	self.otherInspectionOverlaped = function () {

	};

	// Setters
	self.slotChanged = function(event, delta, revertFunc) {
		self.inspectionSlot(event);
	};

    self.setCalendarNeedUpdate = function() {
    	$('#calendar').fullCalendar( 'refetchEvents' );
    };

    // Fetchers
    self.fetchFirstInspectorSlots = function() {
    	if (self.firstInspector() != null) {
        	var userType = 'inspector';
        	var userID = self.firstInspector().id;

        	self.fetchAvailability(userType, userID, function(result) {
        		// if success
            	var json = JSON.parse(result);

            	json.slots.forEach(function(slot) {
            		slot.color = colorFirstInspector;
            		slot.rendering = "background";
            		slot.user = "first inspector";
            	});
            	self.firstInspector().slots = json.slots;

            	json.inspections.forEach(function(slot) {
            		slot.color = colorFirstInspector;
            		slot.title = "First inspector";
            		slot.overlap = false;
            		slot.editable = false;
            	});
            	self.firstInspector().otherInspectionSlots = json.inspections;

            	self.setCalendarNeedUpdate();
        	});
    	}
    };
    self.fetchSecondInspectorSlots = function() {
    	if (self.secondInspector() != null) {
        	var userType = 'inspector';
        	var userID = self.secondInspector().id;

        	self.fetchAvailability(userType, userID, function(result) {
        		// if success
            	var json = JSON.parse(result);

            	json.slots.forEach(function(slot) {
            		slot.color = colorSecondInspector;
            		slot.rendering = "background";
            		slot.user = "second inspector";
            	});
            	self.secondInspector().slots = json.slots;

            	json.inspections.forEach(function(slot) {
            		slot.color = colorSecondInspector;
            		slot.title = "Second inspector";
            		slot.overlap = false;
            		slot.editable = false;
            	});
            	self.secondInspector().otherInspectionSlots = json.inspections;

            	self.setCalendarNeedUpdate();
        	});
    	}
    };
    self.fetchSupervisorSlots = function() {
    	var userType = 'inspector';
    	var userID = self.supervisorID;

    	self.fetchAvailability(userType, userID, function(result) {
    		// if success
        	var json = JSON.parse(result);

        	json.slots.forEach(function(slot) {
        		slot.color = colorSupervisor;
        		slot.rendering = "background";
        		slot.user = "supervisor";
        	});
        	self.supervisorSlots = json.slots;

        	json.inspections.forEach(function(slot) {
        		slot.color = colorSupervisor;
        		slot.title = "Supervisor";
        		slot.overlap = false;
        		slot.editable = false;
        	});
        	self.supervisorOtherInspectionSlots = json.inspections;

        	self.setCalendarNeedUpdate();
    	});
    };
    self.fetchStudentSlots = function() {
    	var userType = 'student';
    	var userID = self.studentID;

    	self.fetchAvailability(userType, userID, function(result) {
    		// if success
        	var json = JSON.parse(result);

        	json.slots.forEach(function(slot) {
        		slot.color = colorStudent;
        		slot.rendering = "background";
        		slot.user = "student";
        	});
        	self.studentSlots = json.slots;

        	json.inspections.forEach(function(slot) {
        		slot.color = colorStudent;
        		slot.title = "Student";
        		slot.overlap = false;
        		slot.editable = false;
        	});
        	self.studentOtherInspectionSlots = json.inspections;

        	self.setCalendarNeedUpdate();
    	});
    };

    self.fetchAvailability = function(userType, userID, success) {
    	var contentType = 'json';
		$.ajax({
			url: '/PIMS/availability/?type=' + userType + '&id=' + userID +'&content='+ contentType +'&week='+ self.inspectionWeekID,
			success: function(result) {
				success(result);
				self.updateAvailabilities();
			},
			error: null
		});
    };

	// Bind other inspectors changes
	self.firstInspectorHandler = ko.computed(function() {
		self.fetchFirstInspectorSlots();

		var firstInspector = self.inspectorMarkedFirstInspector();
		if (firstInspector) {
			firstInspector.setFirstInspector(false); // unmark old first inspector
		}
		firstInspector = self.firstInspector();
		if (firstInspector) {
			firstInspector.setFirstInspector(true); // mark new first inspector
		}
	});
	self.secondInspectorHandler = ko.computed(function() {
		self.fetchSecondInspectorSlots();
	});
	self.firstOtherInspectorHandler = ko.computed(function() {
		//console.log(self.firstOtherInspector());
	});
	self.secondOtherInspectorHandler = ko.computed(function() {
		//console.log(self.secondOtherInspector());
	});

	// Submit
    self.submitInspection = function() {
    	if (!self.firstInspector() || !self.secondInspector()) {
    		alert('You first need to chose a first and a second inspector');
    	} else if (self.firstInspector() == self.secondInspector()) {
    		alert('The first and the second inspector can\'t be the same person');
    	} else {
        	var usersAvailable = self.studentIsAvailable();
        	usersAvailable = usersAvailable && self.supervisorIsAvailable();
        	usersAvailable = usersAvailable && self.firstInspectorIsAvailable();
        	usersAvailable = usersAvailable && self.secondInspectorIsAvailable();
        	var forceSave = false;

        	if (!usersAvailable) {
        		forceSave = confirm("Some people may not be available at this time. Do you wish to confirm this time for the inspection ?");
        	}

        	var firstInspectorOverload = (self.firstInspector().load() > self.firstInspector().capacity);
        	if (firstInspectorOverload && (usersAvailable || forceSave)) {
        		forceSave = confirm(self.firstInspector().name + " seems to be overloaded. Do you wish to confirm him/her as the first inspector ?");
        	}

        	if ((usersAvailable && !firstInspectorOverload) || forceSave) {
        		self.postInspection();
        	}
    	}
    };

    self.postInspection = function() {
    	var url = document.url;
    	var data = {
    		firstInspector: self.firstInspector().id,
    		secondInspector: self.secondInspector().id,
    		slot: JSON.stringify(self.inspectionSlot())
    	};
    	$.post(url, data, self.submitHandler);
    };

    self.submitHandler = function(data, status) {
    	if (status == "success") {
        	popSuccess('Inspection saved');
    	} else {
    		popError('Error');
    	}
    };

    self.updateAvailabilities = function() {
    	self.inspectionSlot.valueHasMutated();
    };

	// Start
	self.readInspection();
	self.fetchStudentSlots();
	self.fetchSupervisorSlots();
	createCalendar(self);
}

var inspectionViewModel = new InspectionViewModel();
ko.applyBindings(inspectionViewModel);


text:
package org.infinispan.spark.rdd

import java.net.SocketAddress
import java.util

import org.apache.spark.Partition
import org.infinispan.client.hotrod.CacheTopologyInfo
import org.infinispan.spark.config.ConnectorConfiguration

import scala.collection.JavaConversions._
import scala.collection.mutable

/**
  * The Splitter is responsible to produce one or more [[org.infinispan.spark.rdd.InfinispanPartition]] that will
  * execute the job on a certain slice of the data. On Infinispan, data is spread roughly equally across multiple
  * segments.
  *
  * @author gustavonalle
  */
trait Splitter {

   /**
     * Creates partitions based on a certain cluster topology.
     *
     * @param cacheTopology [[CacheTopologyInfo]] holding information of servers and segments ownership.
     * @param properties    [[org.infinispan.spark.config.ConnectorConfiguration]] used to configure the RDD
     * @return an array of [[InfinispanPartition]]
     */
   def split(cacheTopology: CacheTopologyInfo, properties: ConnectorConfiguration): Array[Partition]
}

/**
  * Create one or more partition per server so that:
  * - Each partition will only contain segments owned by the associated server
  * - A segment is unique across partitions
  */
class PerServerSplitter extends Splitter {

   override def split(cacheTopology: CacheTopologyInfo, properties: ConnectorConfiguration) = {
      val segmentsByServer = cacheTopology.getSegmentsPerServer
      if (segmentsByServer.isEmpty) throw new IllegalArgumentException("No servers found to partition")
      if (segmentsByServer.keySet().size == 1 && segmentsByServer.values.flatten.isEmpty) {
         Array(new SingleServerPartition(segmentsByServer.keySet.head, properties))
      } else {
         val segmentsByServerSeq = segmentsByServer.toStream.sortBy { case (_, v) => v.size }
         val segments = segmentsByServerSeq.flatMap { case (address, segs) => segs.toSeq }.distinct

         val numServers = segmentsByServerSeq.size
         val numSegments = segments.size
         val segmentsPerServer = Math.ceil(numSegments.toFloat / numServers.toFloat).toInt

         val q = mutable.Queue(segments: _*)
         val segmentsByServerIterator = Iterator.continually(segmentsByServerSeq).flatten
         val result = new mutable.HashMap[SocketAddress, collection.mutable.Set[Integer]] with mutable.MultiMap[SocketAddress, Integer]
         while (q.nonEmpty) {
            val (server, segments) = segmentsByServerIterator.next()
            val split = List.fill(segmentsPerServer) {
               q.dequeueFirst(segments.contains)
            }.flatten
            if (split.nonEmpty) {
               split.foreach {
                  result.addBinding(server, _)
               }
            }
         }

         val pps = properties.getServerPartitions
         result.toStream.flatMap { case (a, b) => cut(b.toSeq, pps).map((a, _)) }.zipWithIndex.map { case ((server, segs), idx) =>
            new InfinispanPartition(idx, Location(server), toJavaSet(segs), properties)
         }.toArray
      }
   }

   private def toJavaSet(s: Set[Integer]) = new util.HashSet[Integer](s)

   private def cut[A](l: Seq[A], parts: Int) = (0 until parts).map { i => l.drop(i).sliding(1, parts).flatten.toSet }.filter(_.nonEmpty)

}

redpajama_set_name: RedPajamaGithub


text:
**Monitoring**

[Sampler](https://github.com/sqshq/sampler) is a tool for shell commands execution, visualization and alerting.
Configured with a simple YAML file.

If there is a way to get a metric using shell command - then it can be visualized with Sampler momentarily.

[Sampler example config](config-monitoring.yml.example)


text:
'------------------------------------------------------------------------------
' <generado automáticamente>
'     Este código fue generado por una herramienta.
'
'     Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si
'     se vuelve a generar el código.
' </generado automáticamente>
'------------------------------------------------------------------------------

Option Strict On
Option Explicit On

Partial Public Class ControlDocumento

    '''
    '''Control RadComboBox6.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents RadComboBox6 As Global.Telerik.Web.UI.RadComboBox

    '''
    '''Control RequiredFieldValidator1.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents RequiredFieldValidator1 As Global.System.Web.UI.WebControls.RequiredFieldValidator

    '''
    '''Control txtDate1.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents txtDate1 As Global.System.Web.UI.WebControls.TextBox

    '''
    '''Control MaskedEditExtender1.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents MaskedEditExtender1 As Global.AjaxControlToolkit.MaskedEditExtender

    '''
    '''Control MaskedEditValidator1.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents MaskedEditValidator1 As Global.AjaxControlToolkit.MaskedEditValidator

    '''
    '''Control RadNumericTextBox3.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents RadNumericTextBox3 As Global.Telerik.Web.UI.RadNumericTextBox

    '''
    '''Control RadComboBox8.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents RadComboBox8 As Global.Telerik.Web.UI.RadComboBox

    '''
    '''Control ImageButton7.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents ImageButton7 As Global.System.Web.UI.WebControls.ImageButton

    '''
    '''Control RequiredFieldValidator2.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents RequiredFieldValidator2 As Global.System.Web.UI.WebControls.RequiredFieldValidator

    '''
    '''Control RadTextBox2.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents RadTextBox2 As Global.Telerik.Web.UI.RadTextBox

    '''
    '''Control RequiredFieldValidator3.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents RequiredFieldValidator3 As Global.System.Web.UI.WebControls.RequiredFieldValidator

    '''
    '''Control RadTextBox4.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents RadTextBox4 As Global.Telerik.Web.UI.RadTextBox

    '''
    '''Control RequiredFieldValidator4.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents RequiredFieldValidator4 As Global.System.Web.UI.WebControls.RequiredFieldValidator

    '''
    '''Control RadComboBox2.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents RadComboBox2 As Global.Telerik.Web.UI.RadComboBox

    '''
    '''Control RadNumericTextBox2.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents RadNumericTextBox2 As Global.Telerik.Web.UI.RadNumericTextBox

    '''
    '''Control RadComboBox9.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents RadComboBox9 As Global.Telerik.Web.UI.RadComboBox

    '''
    '''Control RequiredFieldValidator5.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents RequiredFieldValidator5 As Global.System.Web.UI.WebControls.RequiredFieldValidator

    '''
    '''Control RadTextBox3.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents RadTextBox3 As Global.Telerik.Web.UI.RadTextBox

    '''
    '''Control RequiredFieldValidator6.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents RequiredFieldValidator6 As Global.System.Web.UI.WebControls.RequiredFieldValidator

    '''
    '''Control txtDate2.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents txtDate2 As Global.System.Web.UI.WebControls.TextBox

    '''
    '''Control MaskedEditExtender2.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents MaskedEditExtender2 As Global.AjaxControlToolkit.MaskedEditExtender

    '''
    '''Control MaskedEditValidator2.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents MaskedEditValidator2 As Global.AjaxControlToolkit.MaskedEditValidator

    '''
    '''Control RequiredFieldValidator7.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents RequiredFieldValidator7 As Global.System.Web.UI.WebControls.RequiredFieldValidator

    '''
    '''Control txtDate3.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents txtDate3 As Global.System.Web.UI.WebControls.TextBox

    '''
    '''Control MaskedEditExtender3.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents MaskedEditExtender3 As Global.AjaxControlToolkit.MaskedEditExtender

    '''
    '''Control MaskedEditValidator3.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents MaskedEditValidator3 As Global.AjaxControlToolkit.MaskedEditValidator

    '''
    '''Control RequiredFieldValidator8.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents RequiredFieldValidator8 As Global.System.Web.UI.WebControls.RequiredFieldValidator

    '''
    '''Control TextBox1.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents TextBox1 As Global.System.Web.UI.WebControls.TextBox

    '''
    '''Control ImageButton1.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents ImageButton1 As Global.System.Web.UI.WebControls.ImageButton

    '''
    '''Control ImageButton2.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents ImageButton2 As Global.System.Web.UI.WebControls.ImageButton

    '''
    '''Control ImageButton3.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents ImageButton3 As Global.System.Web.UI.WebControls.ImageButton

    '''
    '''Control odsPlanContable.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents odsPlanContable As Global.System.Web.UI.WebControls.ObjectDataSource

    '''
    '''Control odsCCosto.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents odsCCosto As Global.System.Web.UI.WebControls.ObjectDataSource

    '''
    '''Control odsTipoGasto.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents odsTipoGasto As Global.System.Web.UI.WebControls.ObjectDataSource

    '''
    '''Control odsProveedor.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents odsProveedor As Global.System.Web.UI.WebControls.ObjectDataSource

    '''
    '''Control RadCodeBlock1.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents RadCodeBlock1 As Global.Telerik.Web.UI.RadCodeBlock

    '''
    '''Control odsDocumentoContabilizado.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents odsDocumentoContabilizado As Global.System.Web.UI.WebControls.ObjectDataSource
End Class


text:
package armconnectedvmware

import (
	"context"
	"errors"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
	armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
	"net/http"
	"net/url"
	"strconv"
	"strings"
)

// ClustersClient contains the methods for the Clusters group.
// Don't use this type directly, use NewClustersClient() instead.
type ClustersClient struct {
	host           string
	subscriptionID string
	pl             runtime.Pipeline
}

// NewClustersClient creates a new instance of ClustersClient with the specified values.
// subscriptionID - The Subscription ID.
// credential - used to authorize requests. Usually a credential from azidentity.
// options - pass nil to accept the default values.
func NewClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClustersClient, error) {
	if options == nil {
		options = &arm.ClientOptions{}
	}
	ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint
	if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok {
		ep = c.Endpoint
	}
	pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options)
	if err != nil {
		return nil, err
	}
	client := &ClustersClient{
		subscriptionID: subscriptionID,
		host:           ep,
		pl:             pl,
	}
	return client, nil
}

// BeginCreate - Create Or Update cluster.
// If the operation fails it returns an *azcore.ResponseError type.
// Generated from API version 2022-01-10-preview
// resourceGroupName - The Resource Group Name.
// clusterName - Name of the cluster.
// body - Request payload.
// options - ClustersClientBeginCreateOptions contains the optional parameters for the ClustersClient.BeginCreate method.
func (client *ClustersClient) BeginCreate(ctx context.Context, resourceGroupName string, clusterName string, body Cluster, options *ClustersClientBeginCreateOptions) (*runtime.Poller[ClustersClientCreateResponse], error) {
	if options == nil || options.ResumeToken == "" {
		resp, err := client.create(ctx, resourceGroupName, clusterName, body, options)
		if err != nil {
			return nil, err
		}
		return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ClustersClientCreateResponse]{
			FinalStateVia: runtime.FinalStateViaAzureAsyncOp,
		})
	} else {
		return runtime.NewPollerFromResumeToken[ClustersClientCreateResponse](options.ResumeToken, client.pl, nil)
	}
}

// Create - Create Or Update cluster.
// If the operation fails it returns an *azcore.ResponseError type.
// Generated from API version 2022-01-10-preview
func (client *ClustersClient) create(ctx context.Context, resourceGroupName string, clusterName string, body Cluster, options *ClustersClientBeginCreateOptions) (*http.Response, error) {
	req, err := client.createCreateRequest(ctx, resourceGroupName, clusterName, body, options)
	if err != nil {
		return nil, err
	}
	resp, err := client.pl.Do(req)
	if err != nil {
		return nil, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) {
		return nil, runtime.NewResponseError(resp)
	}
	return resp, nil
}

// createCreateRequest creates the Create request.
func (client *ClustersClient) createCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, body Cluster, options *ClustersClientBeginCreateOptions) (*policy.Request, error) {
	urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/clusters/{clusterName}"
	if client.subscriptionID == "" {
		return nil, errors.New("parameter client.subscriptionID cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
	if resourceGroupName == "" {
		return nil, errors.New("parameter resourceGroupName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
	if clusterName == "" {
		return nil, errors.New("parameter clusterName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName))
	req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath))
	if err != nil {
		return nil, err
	}
	reqQP := req.Raw().URL.Query()
	reqQP.Set("api-version", "2022-01-10-preview")
	req.Raw().URL.RawQuery = reqQP.Encode()
	req.Raw().Header["Accept"] = []string{"application/json"}
	return req, runtime.MarshalAsJSON(req, body)
}

// BeginDelete - Implements cluster DELETE method.
// If the operation fails it returns an *azcore.ResponseError type.
// Generated from API version 2022-01-10-preview
// resourceGroupName - The Resource Group Name.
// clusterName - Name of the cluster.
// options - ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method.
func (client *ClustersClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*runtime.Poller[ClustersClientDeleteResponse], error) {
	if options == nil || options.ResumeToken == "" {
		resp, err := client.deleteOperation(ctx, resourceGroupName, clusterName, options)
		if err != nil {
			return nil, err
		}
		return runtime.NewPoller[ClustersClientDeleteResponse](resp, client.pl, nil)
	} else {
		return runtime.NewPollerFromResumeToken[ClustersClientDeleteResponse](options.ResumeToken, client.pl, nil)
	}
}

// Delete - Implements cluster DELETE method.
// If the operation fails it returns an *azcore.ResponseError type.
// Generated from API version 2022-01-10-preview
func (client *ClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*http.Response, error) {
	req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, options)
	if err != nil {
		return nil, err
	}
	resp, err := client.pl.Do(req)
	if err != nil {
		return nil, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
		return nil, runtime.NewResponseError(resp)
	}
	return resp, nil
}

// deleteCreateRequest creates the Delete request.
func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*policy.Request, error) {
	urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/clusters/{clusterName}"
	if client.subscriptionID == "" {
		return nil, errors.New("parameter client.subscriptionID cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
	if resourceGroupName == "" {
		return nil, errors.New("parameter resourceGroupName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
	if clusterName == "" {
		return nil, errors.New("parameter clusterName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName))
	req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath))
	if err != nil {
		return nil, err
	}
	reqQP := req.Raw().URL.Query()
	reqQP.Set("api-version", "2022-01-10-preview")
	if options != nil && options.Force != nil {
		reqQP.Set("force", strconv.FormatBool(*options.Force))
	}
	req.Raw().URL.RawQuery = reqQP.Encode()
	req.Raw().Header["Accept"] = []string{"application/json"}
	return req, nil
}

// Get - Implements cluster GET method.
// If the operation fails it returns an *azcore.ResponseError type.
// Generated from API version 2022-01-10-preview
// resourceGroupName - The Resource Group Name.
// clusterName - Name of the cluster.
// options - ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method.
func (client *ClustersClient) Get(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientGetOptions) (ClustersClientGetResponse, error) {
	req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, options)
	if err != nil {
		return ClustersClientGetResponse{}, err
	}
	resp, err := client.pl.Do(req)
	if err != nil {
		return ClustersClientGetResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return ClustersClientGetResponse{}, runtime.NewResponseError(resp)
	}
	return client.getHandleResponse(resp)
}

// getCreateRequest creates the Get request.
func (client *ClustersClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientGetOptions) (*policy.Request, error) {
	urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/clusters/{clusterName}"
	if client.subscriptionID == "" {
		return nil, errors.New("parameter client.subscriptionID cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
	if resourceGroupName == "" {
		return nil, errors.New("parameter resourceGroupName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
	if clusterName == "" {
		return nil, errors.New("parameter clusterName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName))
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))
	if err != nil {
		return nil, err
	}
	reqQP := req.Raw().URL.Query()
	reqQP.Set("api-version", "2022-01-10-preview")
	req.Raw().URL.RawQuery = reqQP.Encode()
	req.Raw().Header["Accept"] = []string{"application/json"}
	return req, nil
}

// getHandleResponse handles the Get response.
func (client *ClustersClient) getHandleResponse(resp *http.Response) (ClustersClientGetResponse, error) {
	result := ClustersClientGetResponse{}
	if err := runtime.UnmarshalAsJSON(resp, &result.Cluster); err != nil {
		return ClustersClientGetResponse{}, err
	}
	return result, nil
}

// NewListPager - List of clusters in a subscription.
// If the operation fails it returns an *azcore.ResponseError type.
// Generated from API version 2022-01-10-preview
// options - ClustersClientListOptions contains the optional parameters for the ClustersClient.List method.
func (client *ClustersClient) NewListPager(options *ClustersClientListOptions) *runtime.Pager[ClustersClientListResponse] {
	return runtime.NewPager(runtime.PagingHandler[ClustersClientListResponse]{
		More: func(page ClustersClientListResponse) bool {
			return page.NextLink != nil && len(*page.NextLink) > 0
		},
		Fetcher: func(ctx context.Context, page *ClustersClientListResponse) (ClustersClientListResponse, error) {
			var req *policy.Request
			var err error
			if page == nil {
				req, err = client.listCreateRequest(ctx, options)
			} else {
				req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)
			}
			if err != nil {
				return ClustersClientListResponse{}, err
			}
			resp, err := client.pl.Do(req)
			if err != nil {
				return ClustersClientListResponse{}, err
			}
			if !runtime.HasStatusCode(resp, http.StatusOK) {
				return ClustersClientListResponse{}, runtime.NewResponseError(resp)
			}
			return client.listHandleResponse(resp)
		},
	})
}

// listCreateRequest creates the List request.
func (client *ClustersClient) listCreateRequest(ctx context.Context, options *ClustersClientListOptions) (*policy.Request, error) {
	urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/clusters"
	if client.subscriptionID == "" {
		return nil, errors.New("parameter client.subscriptionID cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))
	if err != nil {
		return nil, err
	}
	reqQP := req.Raw().URL.Query()
	reqQP.Set("api-version", "2022-01-10-preview")
	req.Raw().URL.RawQuery = reqQP.Encode()
	req.Raw().Header["Accept"] = []string{"application/json"}
	return req, nil
}

// listHandleResponse handles the List response.
func (client *ClustersClient) listHandleResponse(resp *http.Response) (ClustersClientListResponse, error) {
	result := ClustersClientListResponse{}
	if err := runtime.UnmarshalAsJSON(resp, &result.ClustersList); err != nil {
		return ClustersClientListResponse{}, err
	}
	return result, nil
}

// NewListByResourceGroupPager - List of clusters in a resource group.
// If the operation fails it returns an *azcore.ResponseError type.
// Generated from API version 2022-01-10-preview
// resourceGroupName - The Resource Group Name.
// options - ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.ListByResourceGroup
// method.
func (client *ClustersClient) NewListByResourceGroupPager(resourceGroupName string, options *ClustersClientListByResourceGroupOptions) *runtime.Pager[ClustersClientListByResourceGroupResponse] {
	return runtime.NewPager(runtime.PagingHandler[ClustersClientListByResourceGroupResponse]{
		More: func(page ClustersClientListByResourceGroupResponse) bool {
			return page.NextLink != nil && len(*page.NextLink) > 0
		},
		Fetcher: func(ctx context.Context, page *ClustersClientListByResourceGroupResponse) (ClustersClientListByResourceGroupResponse, error) {
			var req *policy.Request
			var err error
			if page == nil {
				req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options)
			} else {
				req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)
			}
			if err != nil {
				return ClustersClientListByResourceGroupResponse{}, err
			}
			resp, err := client.pl.Do(req)
			if err != nil {
				return ClustersClientListByResourceGroupResponse{}, err
			}
			if !runtime.HasStatusCode(resp, http.StatusOK) {
				return ClustersClientListByResourceGroupResponse{}, runtime.NewResponseError(resp)
			}
			return client.listByResourceGroupHandleResponse(resp)
		},
	})
}

// listByResourceGroupCreateRequest creates the ListByResourceGroup request.
func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ClustersClientListByResourceGroupOptions) (*policy.Request, error) {
	urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/clusters"
	if client.subscriptionID == "" {
		return nil, errors.New("parameter client.subscriptionID cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
	if resourceGroupName == "" {
		return nil, errors.New("parameter resourceGroupName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))
	if err != nil {
		return nil, err
	}
	reqQP := req.Raw().URL.Query()
	reqQP.Set("api-version", "2022-01-10-preview")
	req.Raw().URL.RawQuery = reqQP.Encode()
	req.Raw().Header["Accept"] = []string{"application/json"}
	return req, nil
}

// listByResourceGroupHandleResponse handles the ListByResourceGroup response.
func (client *ClustersClient) listByResourceGroupHandleResponse(resp *http.Response) (ClustersClientListByResourceGroupResponse, error) {
	result := ClustersClientListByResourceGroupResponse{}
	if err := runtime.UnmarshalAsJSON(resp, &result.ClustersList); err != nil {
		return ClustersClientListByResourceGroupResponse{}, err
	}
	return result, nil
}

// Update - API to update certain properties of the cluster resource.
// If the operation fails it returns an *azcore.ResponseError type.
// Generated from API version 2022-01-10-preview
// resourceGroupName - The Resource Group Name.
// clusterName - Name of the cluster.
// body - Resource properties to update.
// options - ClustersClientUpdateOptions contains the optional parameters for the ClustersClient.Update method.
func (client *ClustersClient) Update(ctx context.Context, resourceGroupName string, clusterName string, body ResourcePatch, options *ClustersClientUpdateOptions) (ClustersClientUpdateResponse, error) {
	req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, body, options)
	if err != nil {
		return ClustersClientUpdateResponse{}, err
	}
	resp, err := client.pl.Do(req)
	if err != nil {
		return ClustersClientUpdateResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return ClustersClientUpdateResponse{}, runtime.NewResponseError(resp)
	}
	return client.updateHandleResponse(resp)
}

// updateCreateRequest creates the Update request.
func (client *ClustersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, body ResourcePatch, options *ClustersClientUpdateOptions) (*policy.Request, error) {
	urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/clusters/{clusterName}"
	if client.subscriptionID == "" {
		return nil, errors.New("parameter client.subscriptionID cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
	if resourceGroupName == "" {
		return nil, errors.New("parameter resourceGroupName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
	if clusterName == "" {
		return nil, errors.New("parameter clusterName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName))
	req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath))
	if err != nil {
		return nil, err
	}
	reqQP := req.Raw().URL.Query()
	reqQP.Set("api-version", "2022-01-10-preview")
	req.Raw().URL.RawQuery = reqQP.Encode()
	req.Raw().Header["Accept"] = []string{"application/json"}
	return req, runtime.MarshalAsJSON(req, body)
}

// updateHandleResponse handles the Update response.
func (client *ClustersClient) updateHandleResponse(resp *http.Response) (ClustersClientUpdateResponse, error) {
	result := ClustersClientUpdateResponse{}
	if err := runtime.UnmarshalAsJSON(resp, &result.Cluster); err != nil {
		return ClustersClientUpdateResponse{}, err
	}
	return result, nil
}


text:
class CustomQueryBuilder < McCracken::Query
  # Noop, nothing fancy
end


text:
import scrapy

class JobtongItem(scrapy.Item):
    url = scrapy.Field()
    complogo = scrapy.Field()
    compabbr = scrapy.Field()
    compintro = scrapy.Field()
    slogon = scrapy.Field()
    city = scrapy.Field()
    scale = scrapy.Field()
    comptype = scrapy.Field()
    industry = scrapy.Field()
    compfullname = scrapy.Field()
    compwebsite = scrapy.Field()
    location = scrapy.Field()


text:
package com.facebook.drawee.controller;

/**
 * A listener for {@link AbstractDraweeController} that listens to events regarding visibility of
 * the drawee in the viewport. As Android does not provide these events, the client must call
 * {@link AbstractDraweeController#onViewportVisibilityHint(boolean)} accordingly.
 */
public interface ControllerViewportVisibilityListener {

  /**
   * Called after a client has given the {@link AbstractDraweeController} a hint that the view
   * became visible in the viewport.
   *
   * @param id controller id
   */
  void onDraweeViewportEntry(String id);

  /**
   * Called after a client has given the {@link AbstractDraweeController} a hint that the view
   * is no longer visible in the viewport.
   *
   * @param id controller id
   */
  void onDraweeViewportExit(String id);
}


text:
<?php
namespace App\Listeners;

use Log;

class SampleListener
{

	public function handle()
	{
		Log::info('listener tetiklendi - {SampleListener}');
	}

}


text:
using System;

namespace MsgPack.Serialization
{
	/// <summary>
	///		Defines common interface for parameter of <see cref="NilImplicationHandler{TCondition,TPackingParameter,TAction,TUnpackedParameter}.OnPacking"/> method and its template methods.
	/// </summary>
	internal interface INilImplicationHandlerParameter
	{
		Type ItemType { get; }
	}
}


text:
package openccsensors.common.util;

import java.util.HashMap;

import net.minecraft.world.World;

import Reika.RotaryCraft.API.Power.PowerGenerator;
import Reika.RotaryCraft.API.Power.ShaftMachine;
import Reika.RotaryCraft.API.Interfaces.ThermalMachine;

public class RotaryCraftUtils {

	public static boolean isValidPowerTarget(Object target) {
		return target != null && ((target instanceof ShaftMachine) || (target instanceof PowerGenerator));
	}

	public static boolean isValidMachineTarget(Object target) {
		return target != null && (target instanceof ThermalMachine);
	}

	public static HashMap getPowerDetails(World world, Object obj, boolean additional) {
		HashMap response = new HashMap();

		if (obj == null || (!(obj instanceof ShaftMachine) && !(obj instanceof PowerGenerator)) || !additional) {
			return response;
		}

		if (obj instanceof ShaftMachine) {
			ShaftMachine shaftMachine = (ShaftMachine) obj;
			response.put("Speed", shaftMachine.getOmega());
			response.put("Torque", shaftMachine.getTorque());
			response.put("Power", shaftMachine.getPower());
		}
		if (obj instanceof PowerGenerator) {
			PowerGenerator powerGen = (PowerGenerator) obj;
			response.put("PowerOutput", powerGen.getCurrentPower());
			response.put("PowerOutputMax", powerGen.getMaxPower());
		}

		return response;
	}

	public static HashMap getMachineDetails(World world, Object obj, boolean additional) {
		HashMap response = new HashMap();

		if (obj == null || !(obj instanceof ThermalMachine) || !additional) {
			return response;
		}

		ThermalMachine machine = (ThermalMachine) obj;
		int heat = machine.getTemperature();
		int maxHeat = machine.getMaxTemperature();
		response.put("Heat", heat);
		response.put("MaxHeat", maxHeat);
		response.put("HeatPercentage", 0);

		if (maxHeat > 0) {
			response.put("HeatPercentage", Math.max(Math.min(100,((100.0 / maxHeat) * heat)), 0));
		}
		return response;
	}
}


text:
package org.b3log.symphony.util;

import java.util.Calendar;
import java.util.Date;
import org.b3log.latke.ioc.LatkeBeanManager;
import org.b3log.latke.ioc.LatkeBeanManagerImpl;
import org.b3log.latke.service.LangPropsService;
import org.b3log.latke.service.LangPropsServiceImpl;

/**
 * Time utilities.
 *
 * @author Liang Ding
 * @version 1.4.3.0, Nov 10, 2016
 * @since 1.3.0
 */
public final class Times {

    /**
     * Minute unit.
     */
    private static final long MINUTE_UNIT = 60 * 1000;

    /**
     * Hour unit.
     */
    private static final long HOUR_UNIT = 60 * MINUTE_UNIT;

    /**
     * Day unit.
     */
    private static final long DAY_UNIT = 24 * HOUR_UNIT;

    /**
     * Week unit.
     */
    private static final long WEEK_UNIT = 7 * DAY_UNIT;

    /**
     * Month unit.
     */
    private static final long MONTH_UNIT = 31 * DAY_UNIT;

    /**
     * Year unit.
     */
    private static final long YEAR_UNIT = 12 * MONTH_UNIT;

    /**
     * Gets the display name of the specified week day.
     *
     * @param weekDay the specified week day (1-7)
     * @return display name
     */
    public static String getWeekDayName(final int weekDay) {
        final LatkeBeanManager beanManager = LatkeBeanManagerImpl.getInstance();
        final LangPropsService langService = beanManager.getReference(LangPropsServiceImpl.class);

        switch (weekDay) {
            case 1:
                return langService.get("monLabel");
            case 2:
                return langService.get("tueLabel");
            case 3:
                return langService.get("wenLabel");
            case 4:
                return langService.get("thuLabel");
            case 5:
                return langService.get("friLabel");
            case 6:
                return langService.get("satLabel");
            case 7:
                return langService.get("sunLabel");
            default:
                return langService.get("monLabel");
        }
    }

    /**
     * Gets time ago format text.
     *
     * @param time the specified time.
     * @return time ago format text
     */
    public static String getTimeAgo(final long time) {
        final LatkeBeanManager beanManager = LatkeBeanManagerImpl.getInstance();
        final LangPropsService langService = beanManager.getReference(LangPropsServiceImpl.class);

        final long diff = System.currentTimeMillis() - time;
        long r = 0;

        if (diff > YEAR_UNIT) {
            r = diff / YEAR_UNIT;

            return r + " " + langService.get("yearsAgoLabel");
        }

        if (diff > MONTH_UNIT) {
            r = diff / MONTH_UNIT;

            return r + " " + langService.get("monthsAgoLabel");
        }

        if (diff > WEEK_UNIT) {
            r = diff / WEEK_UNIT;

            return r + " " + langService.get("weeksAgoLabel");
        }

        if (diff > DAY_UNIT) {
            r = diff / DAY_UNIT;

            return r + " " + langService.get("daysAgoLabel");
        }

        if (diff > HOUR_UNIT) {
            r = diff / HOUR_UNIT;

            return r + " " + langService.get("hoursAgoLabel");
        }

        if (diff > MINUTE_UNIT) {
            r = diff / MINUTE_UNIT;

            return r + " " + langService.get("minutesAgoLabel");
        }

        return langService.get("justNowLabel");
    }

    /**
     * Determines whether the specified date1 is the same day with the specified date2.
     *
     * @param date1 the specified date1
     * @param date2 the specified date2
     * @return {@code true} if it is the same day, returns {@code false} otherwise
     */
    public static boolean isSameDay(final Date date1, final Date date2) {
        final Calendar cal1 = Calendar.getInstance();
        cal1.setTime(date1);
        final Calendar cal2 = Calendar.getInstance();
        cal2.setTime(date2);

        return cal1.get(Calendar.ERA) == cal2.get(Calendar.ERA) && cal1.get(Calendar.DATE) == cal2.get(Calendar.DATE);
    }

    /**
     * Determines whether the specified date1 is the same week with the specified date2.
     *
     * @param date1 the specified date1
     * @param date2 the specified date2
     * @return {@code true} if it is the same week, returns {@code false} otherwise
     */
    public static boolean isSameWeek(final Date date1, final Date date2) {
        final Calendar cal1 = Calendar.getInstance();
        cal1.setFirstDayOfWeek(Calendar.MONDAY);
        cal1.setTime(date1);

        final Calendar cal2 = Calendar.getInstance();
        cal2.setFirstDayOfWeek(Calendar.MONDAY);
        cal2.setTime(date2);

        return cal1.get(Calendar.ERA) == cal2.get(Calendar.ERA)
                && cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR)
                && cal1.get(Calendar.WEEK_OF_YEAR) == cal2.get(Calendar.WEEK_OF_YEAR);
    }

    /**
     * Gets the day start time with the specified time.
     *
     * @param time the specified time
     * @return day start time
     */
    public static long getDayStartTime(final long time) {
        final Calendar start = Calendar.getInstance();

        start.setTimeInMillis(time);
        int year = start.get(Calendar.YEAR);
        int month = start.get(Calendar.MONTH);
        int day = start.get(Calendar.DATE);
        start.set(year, month, day, 0, 0, 0);
        start.set(Calendar.MILLISECOND, 0);

        return start.getTime().getTime();
    }

    /**
     * Gets the day end time with the specified time.
     *
     * @param time the specified time
     * @return day end time
     */
    public static long getDayEndTime(final long time) {
        final Calendar end = Calendar.getInstance();

        end.setTimeInMillis(time);
        int year = end.get(Calendar.YEAR);
        int month = end.get(Calendar.MONTH);
        int day = end.get(Calendar.DATE);
        end.set(year, month, day, 23, 59, 59);
        end.set(Calendar.MILLISECOND, 999);

        return end.getTime().getTime();
    }

    /**
     * Gets the week day with the specified time.
     *
     * @param time the specified time
     * @return week day
     */
    public static int getWeekDay(final long time) {
        final Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(time);
        int ret = calendar.get(Calendar.DAY_OF_WEEK) - 1;
        if (ret <= 0) {
            ret = 7;
        }

        return ret;
    }

    /**
     * Gets the week start time with the specified time.
     *
     * @param time the specified time
     * @return week start time
     */
    public static long getWeekStartTime(final long time) {
        final Calendar start = Calendar.getInstance();

        start.setFirstDayOfWeek(Calendar.MONDAY);

        start.setTimeInMillis(time);
        start.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
        start.set(Calendar.HOUR, 0);
        start.set(Calendar.MINUTE, 0);
        start.set(Calendar.SECOND, 0);
        start.set(Calendar.MILLISECOND, 0);

        return start.getTime().getTime();
    }

    /**
     * Gets the week end time with the specified time.
     *
     * @param time the specified time
     * @return week end time
     */
    public static long getWeekEndTime(final long time) {
        final Calendar end = Calendar.getInstance();

        end.setFirstDayOfWeek(Calendar.MONDAY);

        end.setTimeInMillis(time);
        end.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
        end.set(Calendar.HOUR, 23);
        end.set(Calendar.MINUTE, 59);
        end.set(Calendar.SECOND, 59);
        end.set(Calendar.MILLISECOND, 999);

        return end.getTime().getTime();
    }

    /**
     * Gets the month start time with the specified time.
     *
     * @param time the specified time
     * @return month start time
     */
    public static long getMonthStartTime(final long time) {
        final Calendar start = Calendar.getInstance();

        start.setTimeInMillis(time);
        int year = start.get(Calendar.YEAR);
        int month = start.get(Calendar.MONTH);
        start.set(year, month, 1, 0, 0, 0);
        start.set(Calendar.MILLISECOND, 0);

        return start.getTime().getTime();
    }

    /**
     * Gets the month end time with the specified time.
     *
     * @param time the specified time
     * @return month end time
     */
    public static long getMonthEndTime(final long time) {
        final Calendar end = Calendar.getInstance();

        end.setTimeInMillis(time);
        end.set(Calendar.DAY_OF_MONTH, end.getActualMaximum(Calendar.DAY_OF_MONTH));
        end.set(Calendar.HOUR, 23);
        end.set(Calendar.MINUTE, 59);
        end.set(Calendar.SECOND, 59);
        end.set(Calendar.MILLISECOND, 999);

        return end.getTime().getTime();
    }

    /**
     * Private constructor.
     */
    private Times() {
    }
}


text:
<?xml version='1.0' encoding='UTF-8'?>
<eveapi version="2">
  <currentTime>2015-05-01 20:55:38</currentTime>
  <result>
    <rowset name="blueprints" key="itemID" columns="itemID,locationID,typeID,typeName,flagID,quantity,timeEfficiency,materialEfficiency,runs">
      <row itemID="42" locationID="11" typeID="22" typeName="TypeName" flagID="33" quantity="-44" timeEfficiency="12" materialEfficiency="13" runs="-55" />
    </rowset>
  </result>
  <cachedUntil>2015-05-02 08:25:39</cachedUntil>
</eveapi>


text:
#ifdef __cplusplus
extern "C" {
#endif

//expression variable type
#define OA_INT				0
#define OA_DOUBLE			1
#define OA_CHAR				2
#define OA_STRING			3
#define OA_LEFT_VALUE		4
#define OA_ARRAY_VALUE		5
#define OA_FUNCTION_VALUE	6

//parse tree node type
#define VAR_DECLARE_NODE			0
#define VAR_DEFINE_NODE				1
#define VAR_ASSIGN_NODE				2
#define ARRAY_DECLARE_NODE			3
#define ARRAY_DEFINE_NODE			4
#define ARRAY_ASSIGN_NODE			5
#define IF_NODE						6
#define ELIF_NODE					7
#define ELSE_NODE					8
#define WHILE_NODE					9
#define FOREACH_NODE				10
#define CLASS_DEFINE_NODE			11
#define FUNCTION_DECLARE_NODE		12
#define FUNCTION_DEFINE_NODE		13
#define CLASS_METHOD_DEFINE_NODE	14
#define BREAK_NODE					15
#define CONTINUE_NODE				16
#define RETURN_NODE					17

//expression operator type
#define OA_EXP_NONE		0
#define OA_EXP_MULTIPLE	1
#define OA_EXP_DIVIDE	2
#define OA_EXP_PLUS		3
#define OA_EXP_MINUS	4
#define OA_EXP_EQ		5
#define OA_EXP_NE		6
#define OA_EXP_GT		7
#define OA_EXP_GE		8
#define OA_EXP_LT		9
#define OA_EXP_LE		10
#define OA_EXP_AND		11
#define OA_EXP_OR		12
#define OA_EXP_NOT		13

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

//------------------word and syntax part------------------
//---------------------parameter part---------------------
struct FormParam{
	char *type;
	char *name;
	struct FormParam *next;
};
struct FactParam{
	struct Expression *exp;
	struct FactParam *next;
};
struct FormParam *createFormParam(char *type, char *name);
struct FactParam *createFactParam(struct Expression *exp);
//-------------------end parameter part--------------------

//---------------------expression part---------------------
struct LeftValue{
	char *name;
	struct LeftValue *next;
};
struct ArrayValue{
	struct LeftValue *name;
	struct Expression *index;
};
struct FunctionValue{
	struct LeftValue *name;
	struct FactParam *factParam;
};

struct Expression{
	struct Expression *left;
	struct Expression *right;
	int op;
	int leafType;
	union{
		int number_int;
		double number_double;
		char type_char;
		char *type_string;
		struct LeftValue *name;
		struct ArrayValue *arrayValue;
		struct FunctionValue * functionValue;
	};
};
struct LeftValue *createLeftValue(char *name);
struct Expression *createExpression(struct Expression *left, struct Expression *right, int op);
struct Expression *createExpressionIntLeaf(int value, int changeSymbol);
struct Expression *createExpressionDoubleLeaf(double value, int changeSymbol);
struct Expression *createExpressionCharLeaf(char value);
struct Expression *createExpressionStringLeaf(char *value);
struct Expression *createExpressionLeftValueLeaf(struct LeftValue *name);
struct Expression *createExpressionArrayValue(struct LeftValue *name, struct Expression *index);
struct Expression *createExpressionFunctionValue(struct LeftValue *name, struct FactParam *factParam);

//-----------------end expression part-----------------

//------------------ statement part---------------------
struct VarDeclareNode{
	char *type;
	char *name;
};
struct VarDefineNode{
	char *type;
	char *name;
	struct Expression *exp;
};
struct VarAssignNode{
	struct LeftValue *name;
	struct Expression *exp;
	struct Expression *expOfVar;
};
struct ArrayDeclareNode{
	char *type;
	char *name;
};
struct ArrayDefineNode{
	char *type;
	char *name;
	struct Expression *exp;
};
struct ArrayAssignNode{
	struct LeftValue *name;
	char *type;
	struct Expression *exp;
};
struct IfNode{
	struct Expression *exp;
	struct TreeNode *stmts;
	struct TreeNode *elifStmts;
	struct TreeNode *elseStmts;
};
struct ElifNode{
	struct Expression *exp;
	struct TreeNode *stmts;
};
struct ElseNode{
	struct TreeNode *stmts;
};
struct WhileNode{
	struct Expression *exp;
	struct TreeNode *stmts;
};
struct ForeachNode{
	char *nameIn;
	struct LeftValue *nameOut;
	struct TreeNode *stmts;
};
struct ClassDefineNode{
	char *type;
	char *typeParent;
	struct TreeNode *stmts;
};
struct FunctionDeclareNode{
	char *type;
	char *name;
	struct FormParam *formParams;
};
struct FunctionDefineNode{
	char *type;
	char *name;
	struct FormParam *formParams;
	struct TreeNode *stmts;
};
struct ClassMethodDefineNode{
	char *classType;
	char *type;
	char *name;
	struct FormParam *formParams;
	struct TreeNode *stmts;
};
struct ReturnNode{
	struct Expression *exp;
};

struct TreeNode {
	int type;
	int lineno;
	char *str;
	struct TreeNode *next;
	union{
		//[WANING] break and continue statement has no node
		struct VarDeclareNode *varDeclareNode;
		struct VarDefineNode *varDefineNode;
		struct VarAssignNode *varAssignNode;
		struct ArrayDeclareNode *arrayDeclareNode;
		struct ArrayDefineNode *arrayDefineNode;
		struct ArrayAssignNode *arrayAssignNode;
		struct IfNode *ifNode;
		struct ElifNode *elifNode;
		struct ElseNode *elseNode;
		struct WhileNode *whileNode;
		struct ForeachNode *foreachNode;
		struct ClassDefineNode *classDefineNode;
		struct FunctionDeclareNode *functionDeclareNode;
		struct FunctionDefineNode *functionDefineNode;
		struct ClassMethodDefineNode *classMethodDefineNode;
		struct ReturnNode *returnNode;
	};
};
struct ParseTree{
	struct TreeNode *root;
};

char *createArrayType(char *type);
struct TreeNode *createVarDeclare(char *type, char *name);
struct TreeNode *createVarDefine(char *type, char *name, struct Expression *exp);
struct TreeNode *createVarAssign(struct LeftValue *name, struct Expression *exp, struct Expression *expOfVar);
struct TreeNode *createArrayDeclare(char *type, char *name);
struct TreeNode *createArrayDefine(char *type, char *name, char *type2, struct Expression *exp);
struct TreeNode *createArrayAssign(struct LeftValue *name, char *type, struct Expression *exp);
struct TreeNode *createIf(struct Expression *exp, struct TreeNode *stmts, struct TreeNode *elifStmts, struct TreeNode *elseStmts);
struct TreeNode *createElifPart(struct Expression *exp, struct TreeNode *stmts);
struct TreeNode *createElsePart(struct TreeNode *stmts);
struct TreeNode *createWhile(struct Expression *exp, struct TreeNode *stmts);
struct TreeNode *createForeach(char *nameIn, struct LeftValue *nameOut, struct TreeNode *stmts);
struct TreeNode *createClassDefine(char *type, char *typeParent, struct TreeNode *stmts);
struct TreeNode *createFunctionDeclare(char *type, char *name, struct FormParam *formParams);
struct TreeNode *createFunctionDefine(char *type, char *name, struct FormParam *formParams, struct TreeNode *stmts);
struct TreeNode *createClassMethodDefine(char *type, char *name, struct FormParam *formParams, struct TreeNode *stmts, char *classType);
struct TreeNode *createBreak();
struct TreeNode *createContinue();
struct TreeNode *createReturn(struct Expression *exp);
//-------------------end statement part-------------------
//----------------end word and syntax part----------------

//-------------helper variables and functions-------------
extern struct ParseTree *parseTree;
void printJason(struct TreeNode *node);
void printExpression(struct Expression *exp);
int executeParser(const char *filename);
void parsePrintFunction(struct FactParam *params);

#ifdef __cplusplus
}
#endif

#endif


text:
class TestManager : public QObject
{
public:
    TestManager(const QString &qtSrcDir);

    QStringList tests();
    QString testVersion(const QString &test);

    void runAllTests();
signals:
    void testCompleted(const QString &test, TestRunResult result);

private:
    QString m_testsPath;

};

#endif // TESTMANAGER_H


text:
namespace BoboBrowse.Net.Service
{
    using Lucene.Net.Search;

    ///<summary>Builds a DocSet from an array of SelectioNodes </summary>
    public interface IBrowseQueryParser
    {
        DocIdSet Parse(SelectionNode[] selectionNodes, SelectionNode[] notSelectionNodes, int maxDoc);
    }

    public class SelectionNode
    {
        public SelectionNode()
        {
        }

        public SelectionNode(string fieldName, DocIdSet docSet)
        {
            FieldName = fieldName;
            DocSet = docSet;
        }

        public virtual string FieldName { get; set; }
        public virtual DocIdSet DocSet { get; set; }
    }
}


text:
'use strict';

import * as chai from 'chai';
import 'mocha';

import * as request from 'request';
import {Container} from 'typescript-ioc';
import {Configuration} from '../../src/configuration';

const expect = chai.expect;
// tslint:disable:no-unused-expression
// tslint:disable:no-console

let gatewayRequest: any;
let config: Configuration;

describe('The Gateway Cors', () => {
    before(() => {
        config = Container.get(Configuration);
        gatewayRequest = request.defaults({baseUrl: `http://localhost:${config.gateway.protocol.http.listenPort}`});

    });

    it('should be able to accept cors requests', (done) => {
        gatewayRequest('/cors/get', (error: any, response: any, body: any) => {
            expect(response.statusCode).to.equal(200);
            done();
        });
    });

    it('should be able to accept cors requests verified by middleware', (done) => {
        gatewayRequest('/cors-middleware/get', (error: any, response: any, body: any) => {
            expect(response.statusCode).to.equal(200);
            done();
        });
    });
});


text:
@interface BoardActionMenu ()

@property (nonatomic) ActionButtonInfo *addFavInfo;
@property (nonatomic) ActionButtonInfo *createThreadInfo;
@property (nonatomic) ActionButtonInfo *deleteExternalBoardInfo;

@end

@implementation BoardActionMenu

- (void)dealloc
{
}

- (NSArray *)createAllButtons
{
    if (self.addFavInfo == nil) {
        self.addFavInfo = [[ActionButtonInfo alloc] initWithTitle:@"お気に入り" withImageName:@"star_gray_30.png"];
        self.deleteExternalBoardInfo = [[ActionButtonInfo alloc] initWithTitle:@"外部板削除" withImageName:@"delete_30.png"];
        self.createThreadInfo = [[ActionButtonInfo alloc] initWithTitle:@"スレッド作成" withImageName:@"file_30.png"];
    }

    NSMutableArray *buttons = [NSMutableArray arrayWithArray:@[ self.addFavInfo, self.createThreadInfo ]];
    BoardManager *bm = [BoardManager sharedManager];
    if ([bm containsExternalBoard:self.board]) {
        [buttons addObject:self.deleteExternalBoardInfo];
    }

    return buttons;
}

- (void)onLayoutCompleted
{
}

- (NSArray *)createAboveViews
{
    return nil;
}

- (void)onButtonTap:(ActionButtonInfo *)info
{
    [super changeButtonStyle:info asTouch:NO];

    if (info.button == self.addFavInfo.button) {
        double delayInSeconds = 0.1f;
        dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
        dispatch_after(popTime, dispatch_get_main_queue(), ^(void) {
          [[BoardManager sharedManager] addFavBoard:self.board];
          [[MySplitVC instance] closeActionMenu:nil
                                       complete:^{
                                       [self.boardVC reloadTable];
                                       }];

        });

    } else if (info == self.createThreadInfo) {
        [[MySplitVC instance] closeActionMenu:nil
                                     complete:^{

                                             PostNaviVC *postNaviVC = [[MySplitVC instance] sharedCreatePostNaviVC];
                                             postNaviVC.board = self.board;
                                             postNaviVC.onPostCompleted = ^(BOOL success) {

                                               ThListTransaction *thListTransaction = [[ThListTransaction alloc] init];
                                               [thListTransaction startOpenThListTransaction:self.board];

                                             };

                                             [[MySplitVC instance] presentViewController:postNaviVC
                                                                                animated:YES
                                                                                completion:^{

                                                                                }];
                                           }];
    } else if (info == self.deleteExternalBoardInfo) {
        [[MySplitVC instance] closeActionMenu:nil
                                           complete:^{
                                             [[BoardManager sharedManager] removeExternalBoard:self.board];
                                             [self.boardVC reloadTable];
                                           }];
    }

}

@end


text:
using namespace std;

class IndexOutOfBoundsException : public exception {

};

class CourseMember {
protected:
    char name[30];
    int finalPoints;
    bool extra;
public:
    CourseMember(char* name, int finalPoints) {
        strcpy(this->name, name);
        this->finalPoints = finalPoints;
        this->extra = false;
    }
    friend ostream& operator<<(ostream &out, const CourseMember &cm) {
        out << cm.name << " - " << cm.points();
        return out;
    }
    virtual int points() const {
        return finalPoints;
    }
    virtual bool hasExtra() const {
        return false;
    }

    bool operator==(const char *n) {
        return strcmp(name, n) == 0;
    }

    // finish the class
};

// implment here ExtraCourseMember

class ExtraCourseMember : public CourseMember {
private:
    int extraActivities;
    int *extraPoints;
    void copy(const ExtraCourseMember &ecm) {
        extraActivities = ecm.extraActivities;
        extraPoints = new int[extraActivities];
        for(int i = 0; i < extraActivities; ++i) {
            extraPoints[i] = ecm.extraPoints[i];
        }
    }
public:
    static const int M = 5;
    ExtraCourseMember(char* name, int finalPoints) :
        CourseMember(name, finalPoints) {
            extraActivities = 0;
            extraPoints = NULL;
        }

    int points() const {
        int total = 80 * finalPoints / 100;
        for(int i = 0; i < extraActivities; ++i) {
            total += extraPoints[i];
        }
        return total;
    }

    bool hasExtra() const {
        return true;
    }

    ExtraCourseMember& operator+=(int p) {
        if(extraActivities == ExtraCourseMember::M) {
            throw IndexOutOfBoundsException();
        }
        ++extraActivities;
        int *temp = extraPoints;
        extraPoints = new int[extraActivities];
        for(int i = 0; i < extraActivities - 1; ++i) {
            extraPoints[i] = temp[i];
        }
        extraPoints[extraActivities - 1] = p;
        delete [] temp;
        return *this;
    }

    ExtraCourseMember(const ExtraCourseMember &ecm)
    : CourseMember(ecm) {
        copy(ecm);
    }
    ExtraCourseMember& operator=(const ExtraCourseMember &ecm) {
        if(this == &ecm) return *this;
        delete [] extraPoints;
        *this = ecm;
        copy(ecm);
        return *this;
    }

    ~ExtraCourseMember() {
        delete [] extraPoints;
    }
};

class Course {
private:
    char name[30];
    CourseMember *ucesnici[10];
    int broj;
    static int P;
public:
    Course(char *name, CourseMember** ucesnici, int broj ) {
        strcpy(this->name, name);
        for (int i = 0; i < broj; i++) {
            //ako ucesnikot ima dopolnitelni aktivnosti
            if (ucesnici[i]->hasExtra()) {
                this->ucesnici[i] = new ExtraCourseMember(*dynamic_cast<ExtraCourseMember*>(ucesnici[i]));
            }
            else this->ucesnici[i] = new CourseMember(*ucesnici[i]);
        }
        this->broj = broj;
    }
    ~Course() {
        for (int i = 0; i < broj; i++) delete ucesnici[i];
    }

    static void setP(int p) {
        Course::P = p;
    }

    // finish the class
    void printMembers() {
        cout << "The course ";
        cout << name;
        cout << " is passed from:" << endl;
        for(int i = 0; i < broj; ++i) {
            if(ucesnici[i]->points() > Course::P) {
                cout << *ucesnici[i] << endl;
            }
        }
    }

    void addPointsForExtraActivity(char *name, int points) {
        for(int i = 0; i < broj; ++i) {
            if(*ucesnici[i] == name) {
                (*ucesnici) += points;
            }
        }
    }
};
int Course::P = 50;

int main() {

    CourseMember **members;
    int n, m, points;
    char name[10];
    bool hasExtraActivity;
    cin >> n;
    members = new CourseMember*[n];
    for (int i = 0; i < n; i++) {
        cin >> name;
        cin >> points;
        cin >> hasExtraActivity;
        if (!hasExtraActivity)
            members[i] = new CourseMember(name, points);
        else
            members[i] = new ExtraCourseMember(name, points);
    }

    Course programming("Programiranje", members, n);
    for (int i = 0; i < n; i++) delete members[i];
    delete [] members;

    cin >> m;
    for (int i = 0; i < m; i++) {
        cin >> name >> points;
        programming.addPointsForExtraActivity(name, points);
    }

    Course::setP(60);

    programming.printMembers();

}


text:
package org.unitedinternet.cosmo.model;

import java.util.Date;
import java.util.Set;

/**
 * Represents a ticket that is used to grant access to
 * an Item.
 */
public interface Ticket extends AuditableObject {

    /** */
    public static final String TIMEOUT_INFINITE = "Infinite";
    /** */
    public static final String PRIVILEGE_READ = "read";
    /** */
    public static final String PRIVILEGE_WRITE = "write";
    /** */
    public static final String PRIVILEGE_FREEBUSY = "freebusy";

    public String getKey();

    public void setKey(String key);

    /**
     */
    public String getTimeout();

    /**
     */
    public void setTimeout(String timeout);

    /**
     */
    public void setTimeout(Integer timeout);

    /**
     */
    public Set<String> getPrivileges();

    /**
     */
    public void setPrivileges(Set<String> privileges);

    /**
     * Returns the ticket type if the ticket's privileges match up
     * with one of the predefined types, or null
     * otherwise.
     */
    public TicketType getType();

    /**
     */
    public Date getCreated();

    /**
     */
    public void setCreated(Date created);

    public User getOwner();

    public void setOwner(User owner);

    /**
     */
    public boolean hasTimedOut();

    /**
     * Determines whether or not the ticket is granted on the given
     * item or one of its ancestors.
     */
    public boolean isGranted(Item item);

    public boolean isReadOnly();

    public boolean isReadWrite();

    public boolean isFreeBusy();

    public int compareTo(Ticket t);

    public Item getItem();

    public void setItem(Item item);

}


text:
import React, { useCallback, useContext, useMemo, useState } from 'react';

import OAuthContext from '../../oauth/Context';
import './ProfileMenu.css';

const MicrosoftGraphProfileMenu = () => {
  // This will become falsy if sign in is not available, e.g. already signed in or misconfiguration
  // This will become falsy if sign out is not available, e.g. not signed in
  const {
    user: { avatarURL, name },
    onSignIn,
    onSignOut
  } = useContext(OAuthContext);
  const [expanded, setExpanded] = useState(false);
  const signedIn = !!onSignOut;

  // CSS style for displaying avatar as background image.
  // Background image will ease handling 404 or other HTTP errors by not showing the image.
  const avatarStyle = useMemo(
    () => ({
      backgroundImage: `url(${avatarURL || '/images/Microsoft-Graph-64px-DDD-White.png'})`
    }),
    [avatarURL]
  );

  // In addition to running the sign in logic from OAuth context, we will also collapse the menu.
  const handleSignIn = useCallback(() => {
    onSignIn && onSignIn();
    setExpanded(false);
  }, [onSignIn]);

  // In addition to running the sign in logic from OAuth context, we will also collapse the menu.
  const handleSignOut = useCallback(() => {
    onSignOut && onSignOut();
    setExpanded(false);
  }, [onSignOut]);

  const handleToggleExpand = useCallback(() => setExpanded(!expanded), [expanded]);

  return (

        <button
          aria-label="Open profile menu"
          className="sso__profileAvatar"
          onClick={signedIn ? handleToggleExpand : handleSignIn}
          style={avatarStyle}
        >
          {signedIn &&
}
        </button>
        {signedIn && expanded && (

            {name && (

                  Signed in as {name}

            )}
            {onSignOut && (

                  Review access on Office.com

            )}
            {onSignOut && (

                <button onClick={handleSignOut} type="button">
                  Sign out
                </button>

            )}

        )}

  );
};

export default MicrosoftGraphProfileMenu;


text:
#This class handles conversion between letters and numbers.
class conversion():
    #Goes through string and checks if any numbers can be changed to a letter, if it can, it will add to a list and return a string of that list.
    def numbersToLetters(self, string):
        "Converts numbers to letters; returns string"
        self.list = []
        for i in range(len(string)):
            if string[i] == '0':
                self.list.append('o')
            if string[i] == '1':
                self.list.append('l')
            if string[i] == '3' or string[i] == '5':
                self.list.append('e')
            if string[i] == '8':
                self.list.append('b')
            else:
                self.list.append(string[i])
        return ''.join(self.list)
    #Goes through string and checks if any letters can be changed to numbers, if it can, it will add to a list and return a string of that list.
    def lettersToNumbers(self, string):
        "Converts letters to numbers; returns string"
        self.list = []
        for i in range(len(string)):
            if string[i] == 'o':
                self.list.append('0')
            if string[i] == 'i' or string[i] == 'l':
                self.list.append('1')
            if string[i] == 'e':
                self.list.append('5')
            if string[i] == 'b':
                self.list.append('8')
            else:
                self.list.append(string[i])
        return ''.join(self.list)

#This class handles the cross referencing of various strings and text files.
class check():
    #Checks if string is in registered plates text file
    def registered(self, string):
        "Checks if string is in registered plates file; returns boolean"
        self.registeredPlates = open('registeredPlates.txt').read().splitlines()
        if string in self.registeredPlates:
            return True
        else:
            return False
    #Checks if string is in restricted plates text file
    def restricted(self, string):
        "Checks if string is in restricted plates file; returns boolean"
        self.restrictedWords = open('restrictedWords.txt').read().splitlines()
        if string in self.restrictedWords:
            return True
        else:
            return False
    #Checks if string is in dictionary text file
    def word(self, string):
        "Checks if string is in dictionary; returns boolean"
        self.wordList = open('wordList.txt').read().splitlines()
        if string in self.wordList:
            return True
        else:
            return False

def lowerCharacters(string):
    #Lowers characters in 'plate' and sets to new variable 'loweredPlate'
    plateList = []
    for i in range(len(string)):
        try:
            plateList.append(strnig[i].lower())
        except:
            plateList.append(string[i])
    return ''.join(plateList)

def writeFile(string):
    registeredPlates = open('registeredPlates.txt', 'r+')
    registeredPlates.seek(0, 2)
    registeredPlates.write(string + '\n')
    registeredPlates.close()


text:
/**
 * Created by Root on 1/8/2015.
 */
(function() {

    'use strict';

    angular
        .module('authApp')
        .controller('AuthController', AuthController);

    function AuthController($auth, $state) {

        var vm = this;

        vm.login = function() {

            var credentials = {
                email: vm.email,
                password: vm.password
            }

            // Use Satellizer's $auth service to login
            $auth.login(credentials).then(function(data) {

                // If login is successful, redirect to the users state
                $state.go('users', {});
            });
        }

    }

})();


text:
require 'google/protobuf'

require 'google/ads/google_ads/v12/common/criterion_category_availability_pb'
require 'google/ads/google_ads/v12/enums/user_interest_taxonomy_type_pb'
require 'google/api/field_behavior_pb'
require 'google/api/resource_pb'

Google::Protobuf::DescriptorPool.generated_pool.build do
  add_file("google/ads/googleads/v12/resources/user_interest.proto", :syntax => :proto3) do
    add_message "google.ads.googleads.v12.resources.UserInterest" do
      optional :resource_name, :string, 1
      optional :taxonomy_type, :enum, 2, "google.ads.googleads.v12.enums.UserInterestTaxonomyTypeEnum.UserInterestTaxonomyType"
      proto3_optional :user_interest_id, :int64, 8
      proto3_optional :name, :string, 9
      proto3_optional :user_interest_parent, :string, 10
      proto3_optional :launched_to_all, :bool, 11
      repeated :availabilities, :message, 7, "google.ads.googleads.v12.common.CriterionCategoryAvailability"
    end
  end
end

module Google
  module Ads
    module GoogleAds
      module V12
        module Resources
          UserInterest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v12.resources.UserInterest").msgclass
        end
      end
    end
  end
end


text:
class StepByStepScheduledPublishWorker
  include Sidekiq::Worker
  sidekiq_options retry: 5

  sidekiq_retries_exhausted do |msg, _e|
    GovukError.notify(msg["error_message"])
  end

  def perform(id)
    step_nav = StepByStepPage.find_by(id:)

    if publish_now?(step_nav)
      step_nav.with_lock do
        StepNavPublisher.publish(step_nav)
        step_nav.mark_as_published
        generate_internal_change_note(step_nav)
      end
    end
  end

  def generate_internal_change_note(step_nav)
    change_note = step_nav.internal_change_notes.new(
      author: "Scheduled publishing",
      headline: "Published on schedule",
    )
    change_note.save!
  end

private

  def publish_now?(step_nav)
    step_nav.scheduled_for_publishing? && !scheduled_in_future?(step_nav)
  end

  def scheduled_in_future?(step_nav)
    step_nav.scheduled_at > Time.zone.now
  end
end


text:
from distance.levelobjects import LevelObject, SubObject
from distance.bytes import Section, Magic
from distance.base import Transform, Fragment
from distance.classes import CollectorGroup, DefaultClasses
from distance.levelobjects import material_attrs

Classes = CollectorGroup()

fragment_attrs = DefaultClasses.fragments.fragment_attrs

@Classes.level_objects.object(
    'Teleporter',
    'TeleporterVirus',
    'TeleporterAndAmbientChangeTrigger',
    'TeleporterExit',
)
class Teleporter(LevelObject):

    default_transform = Transform.fill()

@Classes.level_subobjects.object
@fragment_attrs(
    'TeleporterEntrance',
    'TeleporterExit',
    'TeleporterExitCheckpoint',
)
class SubTeleporter(SubObject):

    type = 'Teleporter'

@Classes.level_subobjects.object
@fragment_attrs('RaceEndLogic')
class WinLogic(SubObject):

    type = 'WinLogic'

@Classes.level_objects.object
@fragment_attrs('TextMesh')
class WorldText(LevelObject):

    type = 'WorldText'

@Classes.level_objects.object
@fragment_attrs('InfoDisplayLogic')
class InfoDisplayBox(LevelObject):

    type = 'InfoDisplayBox'

@Classes.level_objects.object
@fragment_attrs('CarScreenTextDecodeTrigger')
class CarScreenTextDecodeTrigger(LevelObject):

    type = 'CarScreenTextDecodeTrigger'

@Classes.level_objects.object
@fragment_attrs('SphereCollider', 'GravityToggle', 'MusicTrigger')
class GravityTrigger(LevelObject):

    type = 'GravityTrigger'
    default_transform = Transform.fill()

@Classes.level_objects.object
@fragment_attrs('CustomName', 'ForceZone')
class ForceZoneBox(LevelObject):

    type = 'ForceZoneBox'
    default_transform = Transform.fill(scale=(35, 35, 35))

@Classes.level_objects.object
@fragment_attrs('EnableAbilitiesTrigger')
class EnableAbilitiesBox(LevelObject):

    type = 'EnableAbilitiesBox'
    default_transform = Transform.fill(scale=(100, 100, 100))

@Classes.level_objects.object
@fragment_attrs('SetAbilitiesTrigger')
class SetAbilitiesTrigger(LevelObject):

    type = 'SetAbilitiesTrigger'
    default_transform = Transform.fill(scale=(100, 100, 100))

@Classes.level_objects.object
@fragment_attrs('WarpAnchor')
class WarpAnchor(LevelObject):

    type = 'WarpAnchor'
    default_transform = Transform.fill()

@Classes.level_objects.object('EventTriggerBox', 'EventTriggerSphere')
@fragment_attrs('EventTrigger')
class EventTrigger(LevelObject):

    default_transform = Transform.fill(scale=(35, 35, 35))

@Classes.level_objects.object
class WingCorruptionZone(LevelObject):

    type = 'WingCorruptionZone'
    default_transform = Transform.fill(scale=(100, 100, 100))

@Classes.level_objects.object
class WingCorruptionZoneLarge(LevelObject):

    type = 'WingCorruptionZoneLarge'
    default_transform = Transform.fill(scale=(1000, 1000, 1000))

@Classes.level_objects.object
class VirusSpiritSpawner(LevelObject):

    type = 'VirusSpiritSpawner'
    default_transform = Transform.fill()

@Classes.level_objects.object
class KillGridBox(LevelObject):

    type = 'KillGridBox'
    default_transform = Transform.fill(scale=(50, 50, 50))

@Classes.level_objects.object
class KillGridCylinder(LevelObject):

    type = 'KillGridCylinder'
    default_transform = Transform.fill(scale=(50, 50, 50))

@Classes.level_objects.object('CheckpointNoVisual', 'EmpireCheckpoint',
                              'EmpireCheckpointHalf')
class Checkpoint(LevelObject):

    default_transform = Transform.fill(rot=(0, 1, 0, 0), scale=14)

@Classes.level_objects.object('AbilityCheckpoint', 'AbilityCheckpointOLD')
class AbilityCheckpoint(LevelObject):

    default_transform = Transform.fill()

@Classes.level_objects.object
class NitronicCheckpoint(LevelObject):

    type = 'NitronicCheckpoint'
    default_transform = Transform.fill(scale=1.097)

@Classes.level_objects.object
class EmpirePowerFlyingRing(LevelObject):

    type = 'EmpirePowerFlyingRing'
    default_transform = Transform.fill(scale=1.5)

@Classes.level_objects.object
class EmpirePowerRoadRing(LevelObject):

    type = 'EmpirePowerRoadRing'
    default_transform = Transform.fill()

@Classes.level_objects.object
class CooldownTriggerNoVisual(LevelObject):

    type = 'CooldownTriggerNoVisual'
    default_transform = Transform.fill()

@Classes.level_objects.object(
    'VirusMazeTowerFat',
    'VirusMazeCeiling001',
    'VirusMazeTowerFat002',
    'VirusMazeTowerFat003',
    'EmpireMovingPillar',
)
class VirusMazeBuilding(LevelObject):

    default_transform = Transform.fill()

@Classes.level_objects.object
class PlanetWithSphericalGravity(LevelObject):

    type = 'PlanetWithSphericalGravity'
    default_transform = Transform.fill(scale=2.5)

BASIC_GOLDEN_SIMPLES_NAMES = (
    'AppleGS',
    'ArchGS',
    'ArchQuarterGS',
    'CapsuleGS',
    'CheeseGS',
    'CircleFrustumGS',
    'ConeGS',
    'CubeGS',
    'CylinderGS',
    'CylinderHDGS',
    'DodecahedronGS',
    'FrustumGS',
    'HemisphereGS',
    'HexagonGS',
    'IcosahedronGS',
    'IrregularCapsule1GS',
    'IrregularCapsule2GS',
    'IrregularConeGS',
    'IrregularCubeGS',
    'IrregularCylinderGS',
    'IrregularDodecahedronGS',
    'IrregularFlatDropGS 1',
    'IrregularHexagonGS',
    'IrregularIcosahedronGS',
    'IrregularOctahedronGS',
    'IrregularPlaneGS',
    'IrregularPyramid001GS',
    'IrregularPyramid002GS',
    'IrregularRectangle001GS',
    'IrregularRectangle002GS',
    'IrregularRectangle003GS',
    'IrregularRectangle004GS',
    'IrregularRingGS',
    'IrregularSphere001GS',
    'IrregularSphere002GS',
    'IrregularTeardropGS',
    'IrregularTube001GS',
    'IrregularTube002GS',
    'OctahedronGS',
    'PeanutGS',
    'PentagonGS',
    'PlaneGS',
    'PlaneOneSidedGS',
    'PointyGS',
    'PyramidGS',
    'QuadGS',
    'RingGS',
    'RingHalfGS',
    'Rock1GS',
    'Rock2GS',
    'Rock3GS',
    'SphereGS',
    'SphereHDGS',
    'TeardropGS',
    'TetrahedronGS',
    'TrapezoidGS',
    'TubeGS',
    'WedgeGS',
)

@fragment_attrs('GoldenSimples')
@material_attrs(
    mat_color = ('SimplesMaterial', '_Color', (.3, .3, .3, 1)),
    mat_emit = ('SimplesMaterial', '_EmitColor', (.8, .8, .8, .5)),
    mat_reflect = ('SimplesMaterial', '_ReflectColor', (.3, .3, .3, .9)),
    mat_spec = ('SimplesMaterial', '_SpecColor', (1, 1, 1, 1)),
)
@Classes.common.add_info(tag='GoldenSimple')
class GoldenSimple(LevelObject):

    default_transform = Transform.fill()

    def _init_defaults(self):
        super()._init_defaults()
        material_attrs.reset_colors(self)

for name in BASIC_GOLDEN_SIMPLES_NAMES:
    Classes.level_objects.add_object(name, GoldenSimple)
del name

class WedgeGS(GoldenSimple):
    type = 'WedgeGS'

@material_attrs(
    color_diffuse = ('Default-Diffuse', '_Color', (0.3, 0.3, 0.3, 1)),
    color_cone = ('Cone', '_Color', (0.3, 0.3, 0.3, 1)),
    color_emit = ('EmitDetail__ArchGrid', '_EmitColor', (0.2, 0.2, 0.2, 0.5))
)
@Classes.common.add_info(tag='OldSimple')
class OldSimple(LevelObject):

    default_cone_transform = Transform.fill(rot=(2**.5 / 2, 0, 0, 2**.5 / -2),
                                            scale=(.5, .5, .5))
    default_other_transform = Transform.fill()

    @property
    def default_transform(self):
        if self.shape in ('Cone', 'TrueCone'):
            return self.default_cone_transform
        return self.default_other_transform

    def _after_init(self):
        super()._after_init()
        if self.emissive:
            del self.color_diffuse
            del self.color_cone
        else:
            del self.color_emit
            if self.shape != 'Cone':
                del self.color_cone
        if self.with_collision:
            sec = Section(Magic[3], 0x0f, 2)
            frag = Fragment(container=sec)
            # box collider fragment seems to be empty for simples
            frag.raw_data = b''
            self.fragments.append(frag)

    def _init_defaults(self):
        super()._init_defaults()
        material_attrs.reset_colors(self)
        self.type = 'Cube'

    @property
    def split_type(self):
        emit, coll = "", ""
        typ = self.type
        if typ.startswith('Emissive'):
            emit = 'Emissive'
            typ = typ[8:]
        if typ.endswith('WithCollision'):
            coll = 'WithCollision'
            typ = typ[:-13]
        return emit, typ, coll

    @split_type.setter
    def split_type(self, split):
        self.type = ''.join(split)

    @property
    def emissive(self):
        return self.type.startswith('Emissive')

    @emissive.setter
    def emissive(self, value):
        old, typ, coll = self.split_type
        self.split_type = value and 'Emissive' or '', typ, coll

    @property
    def with_collision(self):
        return self.type.endswith("WithCollision")

    @with_collision.setter
    def with_collision(self, value):
        emit, typ, old = self.split_type
        self.split_type = emit, typ, value and 'WithCollision' or ''

    @property
    def shape(self):
        return self.split_type[1]

    @shape.setter
    def shape(self, value):
        emit, old, coll = self.split_type
        self.split_type = emit, value, coll

    @property
    def color_fixed_diffuse(self):
        """Get the diffuse color, but for opaque Cones return the 'Cone' color."""
        if self.shape == 'Cone':
            return self.color_cone
        else:
            return self.color_diffuse

    @color_fixed_diffuse.setter
    def color_fixed_diffuse(self, value):
        if self.shape == 'Cone':
            self.color_cone = value
        else:
            self.color_diffuse = value

    @color_fixed_diffuse.deleter
    def color_fixed_diffuse(self):
        if self.shape == 'Cone':
            del self.color_cone
        else:
            del self.color_diffuse

OLD_SIMPLES_SHAPES = (
    'Capsule',
    'Cone',
    'Cube',
    'Cylinder',
    'CylinderTapered',
    'Dodecahedron',
    'FlatDrop',
    'Hexagon',
    'Icosahedron',
    'IrregularCapsule001',
    'IrregularCapsule002',
    'IrregularFlatDrop',
    'Octahedron',
    'Plane',
    'Pyramid',
    'Ring',
    'RingHalf',
    'Sphere',
    'Teardrop',
    'TrueCone',
    'Tube',
    'Wedge',
)

for shape in OLD_SIMPLES_SHAPES:
    Classes.level_objects.add_object(shape, OldSimple)
    Classes.level_objects.add_object('Emissive' + shape, OldSimple)
    Classes.level_objects.add_object(shape + 'WithCollision', OldSimple)
    Classes.level_objects.add_object('Emissive' + shape + 'WithCollision', OldSimple)
del shape

# vim:set sw=4 ts=8 sts=4 et: