text:
import gzip
import json
import base64
import sys
import traceback
import time

from os import listdir
from os.path import isfile, join
from collections import defaultdict

import os

VERBOSE = True

def log(s):
    if VERBOSE:
        print time.strftime("%Y-%m-%d %H:%M:%S"), s

if len(sys.argv) != 3:
    print "Usage: python export_workspaces.py path_to_data out_path"
    print "Walk over sessions files to export whether it uses"
    print "list at level"
    exit(1)

path = sys.argv[1]
outPath = sys.argv[2]

linesCount = 0
dataLinesCount = 0
err = 0;

dtWsCount = {}

def updateResultFile():
    outF = open(outPath, 'w')
    outF.write("Date, No L@L, L@L\n")
    for k in sorted(dtWsCount):
        v = dtWsCount[k]
        outF.write(k + ", " + str(v[False]) + ", " + str(v[True]) + "\n")
        outF.flush()

log("Start")

files = [ f for f in listdir(path) if isfile(join(path,f)) ]
for filePath in files:
    f = gzip.open (join(path,filePath));
    for ln in f:
        linesCount += 1

        if linesCount % 1000 == 0:
            updateResultFile()
            log (str(linesCount))
			# log (str(linesCount) + "\t" + str(dataLinesCount) + "\t" + str(err) + "\tNew sessions:\t" + str(len(newSessionIDSet)) + "\tUpdated sessions:\t" + str(len(sessionIDSet)))
        try:
            if not ln.startswith("{"):
                continue
            dataLinesCount += 1
            data = json.loads(ln)
            session = data["SessionID"]
            serverDate = data["b75e7a7f_ServerDate"]
            tag = data["Tag"]

            if (tag.startswith("Workspace")):
                data = base64.b64decode(data["Data"])
                usesListAtLevel = False
                usesListAtLevel = data.find('useLevels="True"') > -1

                if not dtWsCount.has_key(serverDate):
                    dtWsCount[serverDate] = {}
                    dtWsCount[serverDate][False] = 0
                    dtWsCount[serverDate][True] = 0

                dtWsCount[serverDate][usesListAtLevel] += 1

                # print (dtWsCount)
                # print (session + ",\t" + serverDate + ",\t")

        except err:
            err += 1
            print err

log("Printing results")

redpajama_set_name: RedPajamaGithub


text:
A base for creating inliners for .NET deobfuscation

# Compiling from Source
- Download/Fork
- Open sln
- Rebuild entire solution
- Add folder called 'Plugins' in your output location
- All plugins will be copied to this on build (I advise you to do the same with your plugin project to save time)

# Plugin Support
A plugin must inherit the IGenericInliner class and fill out all relevant details.
You may look at the examples given by 'CallInliner', 'MathInliner', and 'VariableInliner'

You must add reference to the ClientPlugin, and the modified dnlib available in the 'Dependencies' folder.

# Notes
- This is not a final work
- There are some bugs, but very minimal


text:
package metrics

import (
	"context"
	"net/http"
	"strconv"
	"strings"
	"time"
	"unicode/utf8"

	"github.com/containous/alice"
	gokitmetrics "github.com/go-kit/kit/metrics"
	"github.com/traefik/traefik/v2/pkg/log"
	"github.com/traefik/traefik/v2/pkg/metrics"
	"github.com/traefik/traefik/v2/pkg/middlewares"
	"github.com/traefik/traefik/v2/pkg/middlewares/retry"
	traefiktls "github.com/traefik/traefik/v2/pkg/tls"
)

const (
	protoHTTP      = "http"
	protoSSE       = "sse"
	protoWebsocket = "websocket"
	typeName       = "Metrics"
	nameEntrypoint = "metrics-entrypoint"
	nameService    = "metrics-service"
)

type metricsMiddleware struct {
	next                 http.Handler
	reqsCounter          gokitmetrics.Counter
	reqsTLSCounter       gokitmetrics.Counter
	reqDurationHistogram metrics.ScalableHistogram
	openConnsGauge       gokitmetrics.Gauge
	baseLabels           []string
}

// NewEntryPointMiddleware creates a new metrics middleware for an Entrypoint.
func NewEntryPointMiddleware(ctx context.Context, next http.Handler, registry metrics.Registry, entryPointName string) http.Handler {
	log.FromContext(middlewares.GetLoggerCtx(ctx, nameEntrypoint, typeName)).Debug("Creating middleware")

	return &metricsMiddleware{
		next:                 next,
		reqsCounter:          registry.EntryPointReqsCounter(),
		reqsTLSCounter:       registry.EntryPointReqsTLSCounter(),
		reqDurationHistogram: registry.EntryPointReqDurationHistogram(),
		openConnsGauge:       registry.EntryPointOpenConnsGauge(),
		baseLabels:           []string{"entrypoint", entryPointName},
	}
}

// NewRouterMiddleware creates a new metrics middleware for a Router.
func NewRouterMiddleware(ctx context.Context, next http.Handler, registry metrics.Registry, routerName string, serviceName string) http.Handler {
	log.FromContext(middlewares.GetLoggerCtx(ctx, nameEntrypoint, typeName)).Debug("Creating middleware")

	return &metricsMiddleware{
		next:                 next,
		reqsCounter:          registry.RouterReqsCounter(),
		reqsTLSCounter:       registry.RouterReqsTLSCounter(),
		reqDurationHistogram: registry.RouterReqDurationHistogram(),
		openConnsGauge:       registry.RouterOpenConnsGauge(),
		baseLabels:           []string{"router", routerName, "service", serviceName},
	}
}

// NewServiceMiddleware creates a new metrics middleware for a Service.
func NewServiceMiddleware(ctx context.Context, next http.Handler, registry metrics.Registry, serviceName string) http.Handler {
	log.FromContext(middlewares.GetLoggerCtx(ctx, nameService, typeName)).Debug("Creating middleware")

	return &metricsMiddleware{
		next:                 next,
		reqsCounter:          registry.ServiceReqsCounter(),
		reqsTLSCounter:       registry.ServiceReqsTLSCounter(),
		reqDurationHistogram: registry.ServiceReqDurationHistogram(),
		openConnsGauge:       registry.ServiceOpenConnsGauge(),
		baseLabels:           []string{"service", serviceName},
	}
}

// WrapEntryPointHandler Wraps metrics entrypoint to alice.Constructor.
func WrapEntryPointHandler(ctx context.Context, registry metrics.Registry, entryPointName string) alice.Constructor {
	return func(next http.Handler) (http.Handler, error) {
		return NewEntryPointMiddleware(ctx, next, registry, entryPointName), nil
	}
}

// WrapRouterHandler Wraps metrics router to alice.Constructor.
func WrapRouterHandler(ctx context.Context, registry metrics.Registry, routerName string, serviceName string) alice.Constructor {
	return func(next http.Handler) (http.Handler, error) {
		return NewRouterMiddleware(ctx, next, registry, routerName, serviceName), nil
	}
}

// WrapServiceHandler Wraps metrics service to alice.Constructor.
func WrapServiceHandler(ctx context.Context, registry metrics.Registry, serviceName string) alice.Constructor {
	return func(next http.Handler) (http.Handler, error) {
		return NewServiceMiddleware(ctx, next, registry, serviceName), nil
	}
}

func (m *metricsMiddleware) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
	var labels []string
	labels = append(labels, m.baseLabels...)
	labels = append(labels, "method", getMethod(req), "protocol", getRequestProtocol(req))

	m.openConnsGauge.With(labels...).Add(1)
	defer m.openConnsGauge.With(labels...).Add(-1)

	// TLS metrics
	if req.TLS != nil {
		var tlsLabels []string
		tlsLabels = append(tlsLabels, m.baseLabels...)
		tlsLabels = append(tlsLabels, "tls_version", traefiktls.GetVersion(req.TLS), "tls_cipher", traefiktls.GetCipherName(req.TLS))

		m.reqsTLSCounter.With(tlsLabels...).Add(1)
	}

	recorder := newResponseRecorder(rw)
	start := time.Now()

	m.next.ServeHTTP(recorder, req)

	labels = append(labels, "code", strconv.Itoa(recorder.getCode()))

	histograms := m.reqDurationHistogram.With(labels...)
	histograms.ObserveFromStart(start)

	m.reqsCounter.With(labels...).Add(1)
}

func getRequestProtocol(req *http.Request) string {
	switch {
	case isWebsocketRequest(req):
		return protoWebsocket
	case isSSERequest(req):
		return protoSSE
	default:
		return protoHTTP
	}
}

// isWebsocketRequest determines if the specified HTTP request is a websocket handshake request.
func isWebsocketRequest(req *http.Request) bool {
	return containsHeader(req, "Connection", "upgrade") && containsHeader(req, "Upgrade", "websocket")
}

// isSSERequest determines if the specified HTTP request is a request for an event subscription.
func isSSERequest(req *http.Request) bool {
	return containsHeader(req, "Accept", "text/event-stream")
}

func containsHeader(req *http.Request, name, value string) bool {
	items := strings.Split(req.Header.Get(name), ",")
	for _, item := range items {
		if value == strings.ToLower(strings.TrimSpace(item)) {
			return true
		}
	}
	return false
}

// getMethod returns the request's method.
// It checks whether the method is a valid UTF-8 string.
// To restrict the (potentially infinite) number of accepted values for the method,
// and avoid unbounded memory issues,
// values that are not part of the set of HTTP verbs are replaced with EXTENSION_METHOD.
// See https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
// https://datatracker.ietf.org/doc/html/rfc2616/#section-5.1.1.
func getMethod(r *http.Request) string {
	if !utf8.ValidString(r.Method) {
		log.WithoutContext().Warnf("Invalid HTTP method encoding: %s", r.Method)
		return "NON_UTF8_HTTP_METHOD"
	}

	switch r.Method {
	case "HEAD", "GET", "POST", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", // https://datatracker.ietf.org/doc/html/rfc7231#section-4
		"PATCH", // https://datatracker.ietf.org/doc/html/rfc5789#section-2
		"PRI":   // https://datatracker.ietf.org/doc/html/rfc7540#section-11.6
		return r.Method
	default:
		return "EXTENSION_METHOD"
	}
}

type retryMetrics interface {
	ServiceRetriesCounter() gokitmetrics.Counter
}

// NewRetryListener instantiates a MetricsRetryListener with the given retryMetrics.
func NewRetryListener(retryMetrics retryMetrics, serviceName string) retry.Listener {
	return &RetryListener{retryMetrics: retryMetrics, serviceName: serviceName}
}

// RetryListener is an implementation of the RetryListener interface to
// record RequestMetrics about retry attempts.
type RetryListener struct {
	retryMetrics retryMetrics
	serviceName  string
}

// Retried tracks the retry in the RequestMetrics implementation.
func (m *RetryListener) Retried(req *http.Request, attempt int) {
	m.retryMetrics.ServiceRetriesCounter().With("service", m.serviceName).Add(1)
}


text:
if (typeof Control == 'undefined') Control = {};

/**
 * class Control.ColorPicker
 *
 * Transforms an ordinary input textbox into an interactive color chooser,
 * allowing the user to select a color from a swatch palette.
 *
 * Control ID: `colorpicker`
 *
 * Features:
 *
 * * Allows saving custom colors to the palette for later use
 * * Customizable by CSS
**/
Control.ColorPicker = Class.create({

/**
 * new Control.ColorPicker(element[, options])
 * - element (String | Element): A `<input type="text">` element (or DOM ID).
 * - options (Hash): Additional options for the control.
 *
 * Create a new color picker from the given `<input type="text">`
 * element.
 *
 * Additional options:
 *
 * * className: The CSS class to apply to the dialog panel.
 * * colors: An array of 40 colors to display in the picker.
 * * addLabel: The label for the "Add" button (for internationalization).
**/
	initialize: function (element, options) {

/**
 * Control.ColorPicker#element -> Element
 *
 * The underlying `<input>` element passed to the constructor.
**/
		this.element = $(element);

		if (cp = this.element.retrieve('colorpicker'))
			cp.destroy();

		this.options = Object.extend({
				className: 'colorpickerControl'
			}, options || {});

		this.colorpicker = new Control.ColorPicker.Panel({
				onSelect: this.colorSelected.bind(this)
			});

		if (typeof Protoplasm != 'undefined')
			Protoplasm.loadStylesheet('colorpicker.css', 'colorpicker');

		this.open = false;
		this.dialog = new Element('div', {'style': 'position:absolute;'});
		var cpCont = new Element('div', { 'class': this.options.className });
		cpCont.appendChild(this.colorpicker.element);
		this.dialog.appendChild(cpCont);

		// Wrap element in a relative div to overlay the clickable swatch
		this.wrapper = this.element.wrap(new Element('div'));
		this.wrapper.style.position = 'relative';

		// Get layout information for the swatch position
		var layout = this.element.getLayout();
		var size = layout.get('height') - 2;
		var topPad = layout.get('padding-top');
		if (topPad < 1) {
			topPad = 1;
			size -= (topPad - layout.get('padding-top')) * 2;
		}
		var rightPad = layout.get('padding-right');
		if (rightPad < 1) rightPad = 1;

		// Create the color swatch
		this.swatch = new Element('div', {
			'class': 'inputExtension',
			'title': 'Open color palette' });
		this.swatch.setStyle({'border': '1px solid gray',
			'position': 'absolute',
			'fontSize': '1px',
			'width': size + 'px',
			'height': size + 'px',
			'backgroundColor': this.element.value });
		this.wrapper.appendChild(this.swatch);

		// Set the swatch position
		this.swatch.clonePosition(this.element, {
			'setWidth': false,
			'setHeight': false,
			'offsetTop': topPad + layout.get('border-top'),
			'offsetLeft': layout.get('padding-box-width') + 1 + layout.get('border-left') });
		this.oldPadding = this.element.style.paddingRight;
		this.element.style.paddingRight = (size + 3 + layout.get('padding-left') + rightPad) + 'px';
		this.element.maxLength = 7;

		this.listeners = [
			this.element.on('change', this.textChanged.bindAsEventListener(this)),
			this.element.on('blur',  this.hide.bindAsEventListener(this)),
			this.swatch.on('click', this.toggle.bindAsEventListener(this)),
			this.swatch.on('selectstart', Event.stop)
		];
		this.clickListener = null;

		this.element.store('colorpicker', this);
		this.destructor = Event.on(window, 'unload', this.destroy.bind(this));
	},

/**
 * Control.ColorPicker#destroy() -> null
 *
 * Destroy this control and return the underlying element to
 * its original behavior.
**/
	destroy: function() {
		for (var i = 0; i < this.listeners.length; i++)
			this.listeners[i].stop();
		if (this.clickListener)
			this.clickListener.stop();
		this.wrapper.parentNode.replaceChild(this.element, this.wrapper);
		this.element.style.paddingRight = this.oldPadding;
		this.element.store('colorpicker', null);
		this.destructor.stop();
	},

	colorSelected: function(color) {
		this.element.value = color;
		this.swatch.style.backgroundColor = color;
		this.hide();
	},

	textChanged: function(e) {
		this.swatch.style.backgroundColor = this.element.value;
	},

/**
 * Control.ColorPicker#toggle() -> null
 *
 * Toggle the visibility of the picker panel for this control.
**/
	toggle: function(e) {
		if (this.open) this.hide();
		else this.show();
	},

/**
 * Control.ColorPicker#show() -> null
 *
 * Show the picker panel for this control.
**/
	show: function(e) {
		if (!this.open) {
			var layout = this.element.getLayout();
			this.swatch.parentNode.appendChild(this.dialog);
			var offsetTop = layout.get('border-box-height') - layout.get('border-bottom');
			this.dialog.clonePosition(this.element, {
				'setWidth': false,
				'setHeight': false,
				'offsetTop': offsetTop});
			this.clickListener = document.on('click',
				this.clickHandler.bindAsEventListener(this));
			this.open = true;
		}
	},

/**
 * Control.ColorPicker#hide() -> null
 *
 * Hide the picker panel for this control.
**/
	hide: function(e) {
		if (this.open) {
			if (this.clickListener)
				this.clickListener.stop();
			this.dialog.remove();
			this.open = false;
		}
	},

	clickHandler: function(e) {
		var element = Event.element(e);
		do {
			if (element == this.swatch || element == this.dialog)
				return;
		} while (element = element.parentNode);
		this.hide();
	}
});

/**
 * class Control.ColorPicker.Panel
 *
 * The dialog panel that is displayed when the color picker is opened.
**/
Control.ColorPicker.Panel = Class.create({

/**
 * new Control.ColorPicker.Panel([options])
 * - options (Hash): Additional options for the panel.
 *
 * Create a new color picker panel.
 *
 * Additional options:
 *
 * * colors: An array of 40 colors to display in the picker.
 * * addLabel: The label for the "Add" button (for internationalization).
**/
	initialize: function(options) {
		this.options = Object.extend({
				addLabel: 'Add',
				colors: Array(
					'#000000', '#993300', '#333300', '#003300', '#003366', '#000080', '#333399', '#333333',
					'#800000', '#FF6600', '#808000', '#008000', '#008080', '#0000FF', '#666699', '#808080',
					'#FF0000', '#FF9900', '#99CC00', '#339966', '#33CCCC', '#3366FF', '#800080', '#969696',
					'#FF00FF', '#FFCC00', '#FFFF00', '#00FF00', '#00FFFF', '#00CCFF', '#993366', '#C0C0C0',
					'#FF99CC', '#FFCC99', '#FFFF99', '#CCFFCC', '#CCFFFF', '#99CCFF', '#CC99FF', '#FFFFFF'),
				onSelect: Prototype.emptyFunction
			}, options || {});
		this.customSwatches = [];
		this.activeCustom =  null,

/**
 * Control.ColorPicker.Panel#element -> Element
 *
 * The root Element of this dialog panel.
**/
		this.element = this.create();
	},

	create: function() {
		var cont = document.createElement('div');
		var colors = this.options.colors;
		var row, cell;

		// Create swatch table
		var table = new Element('table', {'cellPadding': 0, 'cellSpacing': 0, 'border': 0});
		for (var i = 0; i < 5; ++i) {
			row = table.insertRow(i);
			for (var j = 0; j < 8; ++j) {
				cell = row.insertCell(j);
				Element.setStyle(cell, { 'border': '0px', 'padding': '0px' });
				var color = colors[(8 * i) + j];
				var swatch = new Element('div', {'style': 'width:15px;height:15px;font-size:1px;border:1px solid #EEEEEE;background-color:'+color+';padding:0'});
				swatch.on('click', this.clickListener(color));
				swatch.on('mouseover', this.hoverListener(color));
				cell.appendChild(swatch);
			}
		}

		this.addSpacerRow(table, 5);

		// Add custom color row
		row = table.insertRow(6);
		var customColors = this.loadSetting('customColors')
			?  this.loadSetting('customColors').split(',')
			: new Array();
		this.customSwatches = [];
		for (var i = 0; i < 8; ++i) {
			cell = row.insertCell(i);
			Element.setStyle(cell, { 'border': '0', 'padding': '0' });
			var color = customColors[i] ? customColors[i] : '#000000';
			var swatch = new Element('div', {'style': 'width:15px;height:15px;fontSize:15px;border:1px solid #EEEEEE;background-color:'+color+';padding:0'});
			cell.appendChild(swatch);
			swatch.on('click', this.customClickListener(color, swatch));
			swatch.on('mouseover', this.hoverListener(color));
			this.customSwatches.push(swatch);
		}

		this.addSpacerRow(table, 7);

		// Add custom color entry interface
		row = table.insertRow(8);
		cell = row.insertCell(0);
		Element.setStyle(cell, { 'border': '0', 'padding': '0'});
		cell.colSpan = 8;
		var entryTable = new Element('table', {'cellspacing': 0, 'cellpadding': 0, 'border': 0, 'style': 'width:136px;'});
		cell.appendChild(entryTable);

		row = entryTable.insertRow(0);
		cell = row.insertCell(0);
		Element.setStyle(cell, { 'border': '0', 'padding': '0', 'vertical-align': 'middle'});
		var preview = new Element('div', {'style': 'width:15px;height:15px;fontSize:15px;border:1px solid #EEEEEE;background-color:#000000'});
		cell.appendChild(preview);
		this.previewSwatch = preview;

		cell = row.insertCell(1);
		Element.setStyle(cell, {'border': '0', 'padding': '0', 'vertical-align': 'middle', 'text-align': 'center'});
		var textbox = new Element('input', {'type': 'text', 'value': '#000000', 'style': 'width:70px;border:1px solid gray' });
		textbox.on('keyup', function(e) {
				this.previewSwatch.style.backgroundColor = textbox.value;
			}.bindAsEventListener(this));
		cell.appendChild(textbox);
		this.customInput = textbox;

		cell = row.insertCell(2);
		Element.setStyle(cell, { 'border': '0', 'padding': '0', 'vertical-align': 'middle', 'text-align': 'right'});
		var submit = new Element('input', {'type': 'button', 'value': this.options.addLabel,
			'style': 'width:40px;border:1px solid gray'});
		submit.on('click', function(e) {
				var idx = 0;
				if (this.activeCustom) {
					for (var i = 0; i < this.customSwatches.length; ++i)
						if (this.customSwatches[i] == this.activeCustom) {
							idx = i;
							break;
						}
					this.activeCustom.style.border = '1px solid #EEEEEE';
					this.activeCustom = null;
				} else {
					var lastIndex = this.loadSetting('customColorIndex');
					if (lastIndex) idx = (parseInt(lastIndex) + 1) % 8;
				}
				this.saveSetting('customColorIndex', idx);
				customColors[idx] = this.customSwatches[idx].style.backgroundColor = this.customInput.value;
				this.customSwatches[idx].onclick = this.customClickListener(customColors[idx], this.customSwatches[idx]);
				this.customSwatches[idx].onmouseover = this.hoverListener(customColors[idx]);
				this.saveSetting('customColors', customColors.join(','));
			}.bindAsEventListener(this));
		cell.appendChild(submit);

		// Create form
		var form = new Element('form', {'style': 'margin:0;padding:0'});
		form.onsubmit = function() {
			if (this.activeCustom) this.activeCustom.style.border = '1px solid #EEEEEE';
			this.activeCustom = null;
			this.editor.setDialogColor(this.customInput.value);
			return false;
		}.bindAsEventListener(this);
		form.appendChild(table);

		// Add to dialog window
		cont.appendChild(form);
		return cont;
	},

	addSpacerRow: function(table, idx) {
		var row = table.insertRow(idx);
		cell = row.insertCell(0);
		cell.colSpan = 8;
		Element.setStyle(cell, {'border': '0', 'padding': '0'});
		cell.appendChild(new Element('hr', {'style': 'color:gray;background-color:gray;'
			+'height:1px;border:0;margin-top:3px;margin-bottom:3px;padding:0'}));
		return row;
	},

	clickListener: function(color) {
		return function(e) {
				if (this.activeCustom) this.activeCustom.style.border = '1px solid #EEEEEE';
				this.activeCustom = null;
				this.options.onSelect(color);
			}.bindAsEventListener(this);
	},

	customClickListener: function(color, element) {
		return function(e) {
			if (e.ctrlKey) {
				if (this.activeCustom)
					this.activeCustom.style.border = '1px solid #EEEEEE';
				this.activeCustom = element;
				this.activeCustom.style.border = '1px solid #FF0000';
			} else {
				this.activeCustom = null;
				this.options.onSelect(color);
			}
		}.bindAsEventListener(this);
	},

	hoverListener: function(color) {
		return function(e) {
				this.previewSwatch.style.backgroundColor = color;
				this.customInput.value = color;
			}.bindAsEventListener(this);
	},

	loadSetting: function(name) {
		name = 'colorpicker_' + name;
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	},

	saveSetting: function(name, value, days) {
		name = 'colorpicker_' + name;
		if (!days) days = 180;
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
		document.cookie = name+"="+value+expires+"; path=/";
	},

	clearSetting: function(name) {
		this.saveSetting(name, "", -1);
	}

});

if (typeof Protoplasm != 'undefined')
	Protoplasm.register('colorpicker', Control.ColorPicker);


text:
package org.apache.guacamole.properties;

import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.GuacamoleServerException;

/**
 * A GuacamoleProperty whose value is an integer.
 */
public abstract class IntegerGuacamoleProperty implements GuacamoleProperty<Integer> {

    @Override
    public Integer parseValue(String value) throws GuacamoleException {

        // If no property provided, return null.
        if (value == null)
            return null;

        try {
            return Integer.valueOf(value);
        }
        catch (NumberFormatException e) {
            throw new GuacamoleServerException("Property \"" + getName() + "\" must be an integer.", e);
        }

    }

}


text:
@echo off
cls
deno run --allow-all ./src/pathfinder.js
@echo on


text:
local num_players = GAMESTATE:GetHumanPlayers();
local function PositionItem(i,max)
	local x_spacing = 128;
	return x_spacing * (i-(max-1)/2);
end

local t = Def.ActorFrame {
	FOV=90;
	--
	Def.Quad {
		InitCommand=cmd(zoomto,SCREEN_CENTER_X+80,SCREEN_HEIGHT);
		OnCommand=cmd(diffuse,Color.Black;diffusealpha,0.75;fadeleft,32/SCREEN_CENTER_X;faderight,32/SCREEN_CENTER_X);
	};
};
--
for i=1,#num_players do
	local f = Def.ActorFrame {
		InitCommand=cmd(x,-128+PositionItem(i,#num_players));
		UnchosenCommand=cmd(finishtweening;bounceend,0.25;zoom,1);
		ChosenCommand=cmd(stoptweening;bouncebegin,0.3;zoom,0);
		--
		StepsChosenMessageCommand=function( self, param )
			if param.Player ~= num_players[i] then return end;
			self:playcommand("Chosen");
		end;
		StepsUnchosenMessageCommand=function( self, param )
			if param.Player ~= num_players[i] then return end;
			self:playcommand("Unchosen");
		end;
		Def.Quad {
			InitCommand=cmd(y,-35);
			OnCommand=cmd(diffuse,PlayerColor(num_players[i]);shadowlength,1;linear,0.25;zoomtowidth,80;fadeleft,0.5;faderight,0.5);
		};
		LoadFont("Common Bold") .. {
			Text=ToEnumShortString(num_players[i]);
			InitCommand=cmd(y,-48);
			OnCommand=cmd(shadowlength,1;diffuse,PlayerColor(num_players[i]));
		};
		LoadFont("Common Bold") .. {
			Text="PRESS";
			InitCommand=cmd(y,-20);
			OnCommand=cmd(shadowlength,1;pulse;effectmagnitude,1,1.125,1;effectperiod,0.5);
		};
		LoadFont("Common Normal") .. {
			Text="TO START";
			InitCommand=cmd(y,58);
			OnCommand=cmd(shadowlength,1;zoom,0.75);
		};
	};
	if GAMESTATE:GetCurrentGame():GetName() == "pump" then
		local ns = num_players[i] == PLAYER_1 and RoutineSkinP1() or RoutineSkinP2()
		f[#f+1] = LoadActor( NOTESKIN:GetPathForNoteSkin("Center","Tap",ns) ) .. {
			InitCommand=cmd(y,20);
		}
	end
	t[#t+1] = f;
end
-- Lock input for half a second so that players don't accidentally start a song
t[#t+1] = Def.Actor {
	StartSelectingStepsMessageCommand=function() SCREENMAN:GetTopScreen():lockinput(0.5); end;
};

--
t.InitCommand=cmd(Center;x,SCREEN_CENTER_X*1.5;diffusealpha,0);
t.StartSelectingStepsMessageCommand=cmd(linear,0.2;diffusealpha,1);
t.SongUnchosenMessageCommand=cmd(linear,0.2;diffusealpha,0);

return t;


text:
/*
 * DynamicPropertyAdaptor.java
 *
 * Created on August 8, 2010, 7:23 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.opensim.k12;

import java.util.Vector;
import org.opensim.modeling.Model;
import org.opensim.modeling.OpenSimContext;
import org.opensim.modeling.OpenSimObject;
import org.opensim.modeling.AbstractProperty;
import org.opensim.modeling.PropertyHelper;
import org.opensim.view.pub.OpenSimDB;
import org.opensim.swingui.DblBoundedRangeModel;
import org.opensim.view.ObjectsChangedEvent;
import org.opensim.view.pub.ViewDB;
/**
 *
 * @author ayman
 */
public class DynamicPropertyAdaptor extends DblBoundedRangeModel {
    OpenSimObject dObject;
    OpenSimContext context;
    AbstractProperty dProperty;
    private double value;

    public DynamicPropertyAdaptor(OpenSimObject object, Model model, AbstractProperty prop, double min, double max) {
        setRangeForObjectPropertyDbl(object, model, prop, min, max);
    }

    public DynamicPropertyAdaptor(OpenSimObject object, Model model, AbstractProperty prop) {
        setRangeForObjectPropertyDbl(object, model, prop);
    }
    private void setRangeForObjectPropertyDbl(OpenSimObject object, Model model, AbstractProperty prop,
            double min, double max) {
        this.dObject = object;
        this.dProperty=prop;
        context = OpenSimDB.getInstance().getContext(model);
        //double v, double e, double minimum, double maximum, int p
        if (!Double.isNaN(min) && !Double.isNaN(max))
            doSetRangeProps(PropertyHelper.getValueDouble(prop), 0., min, max, 3);
        else
            doSetRangeProps(PropertyHelper.getValueDouble(prop), 0., PropertyHelper.getValueDouble(prop)/2., PropertyHelper.getValueDouble(prop)*2.0, 3);
    }
    private void setRangeForObjectPropertyDbl(OpenSimObject object, Model model, AbstractProperty prop) {
        setRangeForObjectPropertyDbl(object, model, prop,
                PropertyHelper.getValueDouble(prop)/2.,
                PropertyHelper.getValueDouble(prop)*2.0);
    }

    public double getDoubleValue() {
        return PropertyHelper.getValueDouble(dProperty);
    }

    public void setDoubleValue(double value) {
        this.value = value;
        PropertyHelper.setValueDouble(value, dProperty);
        context.realizePosition();
         // Use renderAll rather than repaintAll for greater responsiveness in 3d viewer
         Model mdl=OpenSimDB.getInstance().getCurrentModel();
         ViewDB.getInstance().updateModelDisplayNoRepaint(mdl);
         ViewDB.getInstance().renderAll();
         Vector<OpenSimObject> objs = new Vector<OpenSimObject>(1);
         objs.add(dObject);
         ObjectsChangedEvent evnt = new ObjectsChangedEvent(this, mdl, objs);
         OpenSimDB.getInstance().setChanged();
         OpenSimDB.getInstance().notifyObservers(evnt);
    }

}


text:
module UsesThis
  class Link
    attr_accessor :name, :summary, :url

    def initialize(path)
      metadata = YAML::load_file(path)

      @slug = File.basename(path, File.extname(path))

      @name = metadata['name']
      @summary = metadata['summary']
      @url = metadata['url']
    end
  end
end


text:
    case PayloadType::type: \
        reinterpret_cast<PayloadType*>(icmpPacket->payload)->received(macInterface, macFrame, ipPacket, icmpPacket); \
        break;

struct Icmpv4 {
    static constexpr Natural8 protocolID = 1;

    struct Packet {
        Natural8 type, code;
        Natural16 checksum;
        Natural8 payload[0];

        void prepareTransmit(Ipv4::Packet* ipPacket, Natural16 payloadLength) {
            ipPacket->protocol = protocolID;
            ipPacket->totalLength = sizeof(Packet)+payloadLength;
            checksum = 0;
            checksum = ipPacket->payloadChecksum<Icmpv4>();
        }
    };

    static void received(Mac::Interface* macInterface, Mac::Frame* macFrame, Ipv4::Packet* ipPacket, Packet* icmpPacket);
};

struct Icmpv6 {
    static constexpr Natural8 protocolID = 58;

    struct Option {
        enum Type {
            SourceLinkLayerAddress = 1,
            TargetLinkLayerAddress = 2,
            PrefixInformation = 3,
            RedirectedHeader = 4,
            MaximumTransmissionUnit = 5
        };
        Natural8 type, chunks, payload[0];
    };

    struct Packet {
        Natural8 type, code;
        Natural16 checksum;
        Natural8 payload[0];

        void prepareTransmit(Ipv6::Packet* ipPacket, Natural16 payloadLength) {
            ipPacket->nextHeader = protocolID;
            ipPacket->payloadLength = sizeof(Packet)+payloadLength;
            checksum = 0;
            checksum = ipPacket->payloadChecksum<Icmpv6>();
        }
    };

    struct DestinationUnreachable {
        static constexpr Natural8 type = 1;
        enum Code {
            NoRouteToDestination = 0,
            CommunicationProhibited = 1,
            BeyondScopeOfSourceAddress = 2,
            AddressUnreachable = 3,
            PortUnreachable = 4,
            SourceAddressFailedPolicy = 5,
            RejectRouteToDestination = 6
        };
        Natural32 pad0;

        void correctEndian() { }

        void received(Mac::Interface* macInterface, Mac::Frame* macFrame, Ipv6::Packet* ipPacket, Packet* icmpPacket) {
            #ifdef NETWORK_DEBUG
            puts("DestinationUnreachable");
            #endif
            correctEndian();
        }
    };

    struct PacketTooBig {
        static constexpr Natural8 type = 2;
        Natural32 maximumTransmissionUnit;

        void correctEndian() {
            swapEndian(maximumTransmissionUnit);
        }

        void received(Mac::Interface* macInterface, Mac::Frame* macFrame, Ipv6::Packet* ipPacket, Packet* icmpPacket) {
            #ifdef NETWORK_DEBUG
            puts("PacketTooBig");
            #endif
            correctEndian();
        }
    };

    struct TimeExceeded {
        static constexpr Natural8 type = 3;
        enum Code {
            HopLimitExceeded = 0,
            FragmentReassembly = 1
        };
        Natural32 pad0;

        void correctEndian() { }

        void received(Mac::Interface* macInterface, Mac::Frame* macFrame, Ipv6::Packet* ipPacket, Packet* icmpPacket) {
            #ifdef NETWORK_DEBUG
            puts("TimeExceeded");
            #endif
            correctEndian();
        }
    };

    struct ParameterProblem {
        static constexpr Natural8 type = 4;
        enum Code {
            ErroneousHeaderField = 0,
            UnrecognizedNextHeaderType = 1,
            UnrecognizedIPv6Option = 2,
        };
        Natural32 pointer;

        void correctEndian() {
            swapEndian(pointer);
        }

        void received(Mac::Interface* macInterface, Mac::Frame* macFrame, Ipv6::Packet* ipPacket, Packet* icmpPacket) {
            #ifdef NETWORK_DEBUG
            puts("ParameterProblem");
            #endif
            correctEndian();
        }
    };

    struct EchoRequest {
        static constexpr Natural8 type = 128;
        Natural16 identifier, sequenceNumber;
        Natural8 payload[0];

        void correctEndian() {
            swapEndian(identifier);
            swapEndian(sequenceNumber);
        }

        void received(Mac::Interface* macInterface, Mac::Frame* macFrame, Ipv6::Packet* ipPacket, Packet* icmpPacket) {
            #ifdef NETWORK_DEBUG
            puts("EchoRequest");
            #endif
            correctEndian();

            EchoReply::transmit(macInterface, ipPacket);
        }
    };

    struct EchoReply {
        static constexpr Natural8 type = 129;
        Natural16 identifier, sequenceNumber;
        Natural8 payload[0];

        void correctEndian() {
            swapEndian(identifier);
            swapEndian(sequenceNumber);
        }

        void received(Mac::Interface* macInterface, Mac::Frame* macFrame, Ipv6::Packet* ipPacket, Packet* icmpPacket) {
            #ifdef NETWORK_DEBUG
            puts("EchoReply");
            #endif
            correctEndian();
        }

        static bool transmit(Mac::Interface* macInterface, Ipv6::Packet* receivedIpPacket) {
            auto macFrame = macInterface->createFrame(sizeof(Ipv6::Packet)+receivedIpPacket->payloadLength);
            if(!macFrame)
                return false;
            auto ipPacket = reinterpret_cast<Ipv6::Packet*>(macFrame->payload);
            auto icmpPacket = reinterpret_cast<Packet*>(ipPacket->payload);
            auto echoReply = reinterpret_cast<EchoReply*>(icmpPacket->payload);
            auto echoRequest = reinterpret_cast<EchoRequest*>(reinterpret_cast<Packet*>(receivedIpPacket->payload)->payload);
            echoReply->identifier = echoRequest->identifier;
            echoReply->sequenceNumber = echoRequest->sequenceNumber;
            echoReply->correctEndian();
            ipPacket->destinationAddress = receivedIpPacket->sourceAddress;
            ipPacket->sourceAddress = macInterface->ipv6LinkLocalAddress;
            icmpPacket->type = type;
            icmpPacket->code = 0;
            icmpPacket->prepareTransmit(ipPacket, receivedIpPacket->payloadLength-sizeof(Packet));
            ipPacket->prepareTransmit();
            macInterface->transmitIpPacket(macFrame);
            return true;
        }
    };

    struct MulticastListenerQuery {
        static constexpr Natural8 type = 130;
        Natural16 maximumResponseCode, pad0;
        Ipv6::Address multicastAddress;
        Natural8 queriersRobustnessVariable : 3,
                 suppressRouterSideProcessing : 1,
                 pad1 : 4;
        Natural8 queriersQueryIntervalCode;
        Natural16 numberOfSources;
        Ipv6::Address sourceAddress[0];

        void correctEndian() {
            swapEndian(maximumResponseCode);
            swapEndian(numberOfSources);
        }

        void received(Mac::Interface* macInterface, Mac::Frame* macFrame, Ipv6::Packet* ipPacket, Packet* icmpPacket) {
            #ifdef NETWORK_DEBUG
            puts("MulticastListenerQuery");
            #endif
            correctEndian();
        }
    };

    struct NeighborSolicitation {
        static constexpr Natural8 type = 135;
        Natural32 pad0;
        Ipv6::Address targetAddress;
        Option options[0];

        void correctEndian() { }

        void received(Mac::Interface* macInterface, Mac::Frame* macFrame, Ipv6::Packet* ipPacket, Packet* icmpPacket) {
            #ifdef NETWORK_DEBUG
            puts("NeighborSolicitation");
            #endif
            correctEndian();

            if(targetAddress != macInterface->ipv6LinkLocalAddress)
                return;
            macInterface->addNeighbor(macFrame->sourceAddress, ipPacket->sourceAddress);
            NeighborAdvertisement::transmit(macInterface, ipPacket);
        }
    };

    struct NeighborAdvertisement {
        static constexpr Natural8 type = 136;
        Natural32 pad0 : 5,
                  overrideFlag : 1,
                  solicitedFlag : 1,
                  routerFlag : 1,
                  pad1 : 24;
        Ipv6::Address targetAddress;
        Option options[0];

        void correctEndian() { }

        void received(Mac::Interface* macInterface, Mac::Frame* macFrame, Ipv6::Packet* ipPacket, Packet* icmpPacket) {
            #ifdef NETWORK_DEBUG
            puts("NeighborAdvertisement");
            #endif
            correctEndian();
        }

        static bool transmit(Mac::Interface* macInterface, Ipv6::Packet* receivedIpPacket = nullptr) {
            auto macFrame = macInterface->createFrame(sizeof(Ipv6::Packet)+sizeof(Packet)+sizeof(NeighborAdvertisement)+8);
            if(!macFrame)
                return false;
            auto ipPacket = reinterpret_cast<Ipv6::Packet*>(macFrame->payload);
            auto icmpPacket = reinterpret_cast<Packet*>(ipPacket->payload);
            auto neighborAdvertisement = reinterpret_cast<NeighborAdvertisement*>(icmpPacket->payload);
            neighborAdvertisement->routerFlag = 0;
            neighborAdvertisement->solicitedFlag = (receivedIpPacket) ? 1 : 0;
            neighborAdvertisement->overrideFlag = 1;
            neighborAdvertisement->pad0 = 0;
            neighborAdvertisement->pad1 = 0;
            neighborAdvertisement->targetAddress = (receivedIpPacket)
                ? reinterpret_cast<NeighborSolicitation*>(reinterpret_cast<Packet*>(receivedIpPacket->payload)->payload)->targetAddress
                : macInterface->ipv6LinkLocalAddress;
            neighborAdvertisement->options[0].type = Option::TargetLinkLayerAddress;
            neighborAdvertisement->options[0].chunks = 1;
            macInterface->getMACAddress(reinterpret_cast<Mac::Address&>(neighborAdvertisement->options[0].payload));
            neighborAdvertisement->correctEndian();
            ipPacket->destinationAddress = (receivedIpPacket) ? receivedIpPacket->sourceAddress : Ipv6::localNetworkSegmentAllNodesMulticastAddress;
            ipPacket->sourceAddress = macInterface->ipv6LinkLocalAddress;
            icmpPacket->type = type;
            icmpPacket->code = 0;
            icmpPacket->prepareTransmit(ipPacket, sizeof(NeighborAdvertisement)+8);
            ipPacket->prepareTransmit();
            macInterface->transmitIpPacket(macFrame);
            return true;
        }
    };

    struct MulticastListenerReport {
        static constexpr Natural8 type = 143;
        Natural16 pad0, numberOfRecords;
        struct MulticastListenerRecord {
            enum Type {
                MODE_IS_INCLUDE = 1,
                MODE_IS_EXCLUDE = 2,
                CHANGE_TO_INCLUDE_MODE = 3,
                CHANGE_TO_EXCLUDE_MODE = 4,
                ALLOW_NEW_SOURCES = 5,
                BLOCK_OLD_SOURCES = 6
            };
            Natural8 type, auxDataLength;
            Natural16 numberOfSources;
            Ipv6::Address multicastAddress, sourceAddress[0];
        } records[0];

        void correctEndian() {
            swapEndian(numberOfRecords);
            for(Natural16 i = 0; i < numberOfRecords; ++i)
                swapEndian(records[i].numberOfSources);
        }

        void received(Mac::Interface* macInterface, Mac::Frame* macFrame, Ipv6::Packet* ipPacket, Packet* icmpPacket) {
            #ifdef NETWORK_DEBUG
            puts("MulticastListenerReport");
            #endif
            correctEndian();
        }
    };

    static void received(Mac::Interface* macInterface, Mac::Frame* macFrame, Ipv6::Packet* ipPacket, Packet* icmpPacket);
};

void Icmpv4::received(Mac::Interface* macInterface, Mac::Frame* macFrame, Ipv4::Packet* ipPacket, Icmpv4::Packet* icmpPacket) {
    #ifdef NETWORK_DEBUG
    puts("ICMPv4");
    #endif
}

void Icmpv6::received(Mac::Interface* macInterface, Mac::Frame* macFrame, Ipv6::Packet* ipPacket, Icmpv6::Packet* icmpPacket) {
    #ifdef NETWORK_DEBUG
    auto uart = AllwinnerUART::instances[0].address;
    puts("ICMPv6");
    #endif

    switch(icmpPacket->type) {
        // IcmpReceivedCase(DestinationUnreachable)
        // IcmpReceivedCase(PacketTooBig)
        // IcmpReceivedCase(TimeExceeded)
        // IcmpReceivedCase(ParameterProblem)
        IcmpReceivedCase(EchoRequest)
        // IcmpReceivedCase(EchoReply)
        IcmpReceivedCase(MulticastListenerQuery)
        IcmpReceivedCase(NeighborSolicitation)
        // IcmpReceivedCase(NeighborAdvertisement)
        // IcmpReceivedCase(MulticastListenerReport)
        default:
            #ifdef NETWORK_DEBUG
            uart->putDec(icmpPacket->type);
            puts(" unknown type");
            #endif
            break;
    }
}


text:
/* Challenge #4 githubbin
Code by Perrin Clark
BlackGuyCoding@gmail.com
https://www.nodeschool.io */

//this challenge requires you commit a new change to your repository//


text:
/*
 * Decompiled with CFR 0_119.
 */
package script.names;

import script.InternalScriptError;
import script.dataObjects.DataObject;
import script.dataObjects.NullObject;
import script.names.VarSpace;

public class VarHandle {
    private Object name;
    private VarSpace space;

    protected VarHandle() {
    }

    public VarHandle(VarSpace cont, Object name) {
        this.name = name;
        this.space = cont;
    }

    public boolean erase() {
        return this.space.erase(this.name);
    }

    public DataObject getValue() throws InternalScriptError {
        DataObject result = this.space.get(this.name);
        if (result == null) {
            return new NullObject();
        }
        return result;
    }

    public void setValue(DataObject newValue) throws InternalScriptError {
        this.space.put(this.name, newValue);
    }
}


text:
require 'spec_helper'

describe ContainerRepositoriesFinder do
  let(:group) { create(:group) }
  let(:project) { create(:project, group: group) }
  let(:project_repository) { create(:container_repository, project: project) }

  describe '#execute' do
    let(:id) { nil }

    subject { described_class.new(id: id, container_type: container_type).execute }

    context 'when container_type is group' do
      let(:other_project) { create(:project, group: group) }

      let(:other_repository) do
        create(:container_repository, name: 'test_repository2', project: other_project)
      end

      let(:container_type) { :group }
      let(:id) { group.id }

      it { is_expected.to match_array([project_repository, other_repository]) }
    end

    context 'when container_type is project' do
      let(:container_type) { :project }
      let(:id) { project.id }

      it { is_expected.to match_array([project_repository]) }
    end

    context 'with invalid id' do
      let(:container_type) { :project }
      let(:id) { 123456789 }

      it 'raises an error' do
        expect { subject.execute }.to raise_error(ActiveRecord::RecordNotFound)
      end
    end
  end
end


text:
#include "FreeRTOS.h"
#include "queue.h"
#include "task.h"
#include "oled.h"
#include "display.h"

#define    FCY    16000000UL
#include <libpic30.h>
#define DELAY 300/portTICK_RATE_MS

xQueueHandle xDisplayQueue;

void vDisplayInit ( void )
{
    vOLEDInit();
    xDisplayQueue = xQueueCreate( 5, 10 );
}

void vDisplayPrintTask ( void * pvParameters )
{
    /*
    portBASE_TYPE xI;
    for ( xI = 0; xI < 10; xI++ )
        vOLEDPutChar ( (char) pvParameters );
    vTaskDelete ( NULL );
    */
    while(1){
        vDisplayPutString((char*) pvParameters);
        __delay_ms(500);
    }

}

void vDisplayPrintTask2 ( void * pvParameters )
{

    while(1){
        vDisplayPutString((char*) pvParameters);
        vTaskDelay(DELAY);
    }

}

void vDisplayGatekeeperTask ( void * pvParameters )
{
    while(1){
        char buf[10];
        xQueueReceive( xDisplayQueue, (void*) &buf, portMAX_DELAY );
        vOLEDPutString(buf);
    }
}

void vDisplayPutString ( const char * pcString )
{
    xQueueSendToBack( xDisplayQueue, (void*) pcString, portMAX_DELAY);
}


text:
var express = require('express');
var app = express();

var webpack = require('webpack');
var config = require('./webpack.config');

var compiler = webpack(config);

app.use(require('webpack-dev-middleware')(compiler, {
  noInfo: true,
  publicPath: config.output.publicPath
}));

app.use(require('webpack-hot-middleware')(compiler));

app.listen(process.env.PORT || 3000);


text:
using Microsoft.Build.Framework;
using MSBuild.SCM.Tasks.Git.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MSBuild.SCM.Tasks.Git
{
    public class GitAddTag : Microsoft.Build.Utilities.Task
    {
        public string Version { get; set; }
        public string TagPattern { get; set; }
        public string TagMessage { get; set; }
        public string AssemblyInfoPath { get; set; }

        public override bool Execute()
        {
            List<string> output = AddTag.ExecCommand(TagPattern, Version, TagMessage, AssemblyInfoPath);

            foreach(string line in output)
            {
                if (line != null)
                {
                    Log.LogMessage(line);
                }
            }

            return true;
        }
    }
}


text:
<?php

namespace DotPlant\Store\models\filters;

use DevGroup\DataStructure\models\StaticValue;
use Yii;
use yii\db\ActiveRecord;

/**
 * This is the model class for table "{{%dotplant_store_filter_static_value}}".
 *
 * @property integer $id
 * @property integer $static_value_id
 * @property integer $sort_order
 * @property integer $display
 * @property integer $filter_set_id
 *
 * @property FilterSetsModel $filterSet
 * @property StaticValue $staticValue
 */
class FilterStaticValueModel extends ActiveRecord
{

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%dotplant_store_filter_static_value}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['static_value_id', 'sort_order', 'display', 'filter_set_id'], 'required'],
            [['static_value_id', 'sort_order', 'display', 'filter_set_id'], 'integer'],
            [
                ['filter_set_id'],
                'exist',
                'skipOnError' => true,
                'targetClass' => FilterSetsModel::className(),
                'targetAttribute' => ['filter_set_id' => 'id'],
            ],
            [
                ['static_value_id'],
                'exist',
                'skipOnError' => true,
                'targetClass' => StaticValue::className(),
                'targetAttribute' => ['static_value_id' => 'id'],
            ],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'static_value_id' => Yii::t('app', 'Static Value ID'),
            'sort_order' => Yii::t('app', 'Sort Order'),
            'display' => Yii::t('app', 'Display'),
            'filter_set_id' => Yii::t('app', 'Filter Set ID'),
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getFilterSet()
    {
        return $this->hasOne(FilterSetsModel::className(), ['id' => 'filter_set_id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getStaticValue()
    {
        return $this->hasOne(StaticValue::className(), ['id' => 'static_value_id']);
    }

}


text:
using System;
namespace Tools.Random
{
    public interface IRandomObjects
    {
        string RandomHexString(int length);
    }
}


text:
#!/usr/bin/env node

var os = require("os");
var promise = require("deferred");

var vccutil = require("./vccutil.js");
var logger = require("./log.js");
var kvstore = require("./kvstore.js");

/**
 * Register service module
 * @module registerservice
 */

/**
 * Register the cluster service, if local service providers are configured
 * @param {Object} config - A configuration object (usually loaded from vccutil.GetConfig)
 */
exports.registerService = function (config) {
    var deferred = promise();
    // register our service state if we are providing one
    if(config.providers) {
        // open kvstore
        var kv = new kvstore();
        kv.connect(config.kvstore.host, config.kvstore.port);
        // register the service key
        logger.debug("Registering service:", config.service);
        kv.register("/cluster/"+config.cluster+"/services/"+config.service, config.myhostname, 60).then(function () {
            logger.debug("service registered:", config.service);
            deferred.resolve(true);
        }, function (err) {
            deferred.reject(err);
        });
    } else {
        logger.info("There is no service to register.")
        deferred.resolve(false);
    }
    return deferred.promise;
}

if (require.main === module) {
    var config = vccutil.getConfig();
    exports.registerService(config)
        .then(function () {
            // tell the service manager we are ready
            if (config.systemd) {
                vccutil.systemdNotify("registerService is ready", true);
            }
        });
}