text:
package com.statful.sender;

import com.statful.client.StatfulMetricsOptions;
import com.statful.metric.DataPoint;
import io.netty.handler.codec.http.HttpResponseStatus;
import io.vertx.core.*;
import io.vertx.core.http.HttpClient;
import io.vertx.core.http.HttpClientOptions;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.http.HttpMethod;
import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;

import javax.annotation.Nonnull;
import java.util.List;
import java.util.Optional;
import java.util.Random;

/**
 * Responsible for the HTTP transport
 */
public class HttpSender extends MetricsHolder {

    /**
     * Logger for transport errors
     */
    private static final Logger LOGGER = LoggerFactory.getLogger(HttpSender.class);

    /**
     * Header for the authorization token
     */
    private static final String TOKEN_HEADER = "M-Api-Token";

    /**
     * Statful options to configure the sender
     */
    private final StatfulMetricsOptions options;

    /**
     * Client to send metrics
     */
    private HttpClient client;

    /**
     * @param vertx Vertx instance to create the http client
     * @param options Statful options to configure host and port
     */
    public HttpSender(final Vertx vertx, final StatfulMetricsOptions options) {
        super(options, new Sampler(options, new Random()));

        this.options = options;

        vertx.runOnContext(aVoid -> {
            final HttpClientOptions httpClientOptions = new HttpClientOptions()
                    .setDefaultHost(options.getHost())
                    .setDefaultPort(options.getPort())
                    .setSsl(options.isSecure());

            this.client = vertx.createHttpClient(httpClientOptions);
            this.configureFlushInterval(vertx, this.options.getFlushInterval());
        });
    }

    @Override
    public void send(@Nonnull final List<DataPoint> metrics, @Nonnull final Handler<AsyncResult<Void>> sentHandler) {
        this.bundleAndSend(metrics, sentHandler);
    }

    @Override
    public void send(@Nonnull final List<DataPoint> metrics) {
        this.bundleAndSend(metrics, null);
    }

    private void bundleAndSend(@Nonnull final List<DataPoint> metrics, final Handler<AsyncResult<Void>> endHandler) {
        this.bundleMetrics(metrics).ifPresent(toSendMetrics -> send(endHandler, toSendMetrics));
    }

    private void send(final Handler<AsyncResult<Void>> handler, final String toSendMetrics) {
        final Optional<Handler<AsyncResult<Void>>> endHandler = Optional.ofNullable(handler);

        final HttpClientRequest request = client.request(HttpMethod.PUT, options.getHttpMetricsPath(), response -> {
            if (response.statusCode() != HttpResponseStatus.CREATED.code()) {
                LOGGER.error("Failed to send metrics: " + response.statusMessage() + " - Payload: " + toSendMetrics);
                endHandler.ifPresent(callerHandler -> callerHandler.handle(Future.failedFuture(response.statusMessage())));
            } else {
                endHandler.ifPresent(callerHandler -> callerHandler.handle(Future.succeededFuture()));
            }
        });

        request.putHeader(TOKEN_HEADER, options.getToken());

        request.end(toSendMetrics);
    }

    @Override
    public void close(final Handler<AsyncResult<Void>> handler) {
        final Optional<Handler<AsyncResult<Void>>> closeHandler = Optional.ofNullable(handler);

        try {
            this.client.close();
            closeHandler.ifPresent(close -> close.handle(Future.succeededFuture()));
        } catch (Exception e) {
            LOGGER.error("Failed to close http client", e);
            closeHandler.ifPresent(close -> close.handle(Future.failedFuture(e)));
        }
    }
}


text:
Open Script of Slacknotes/EyeOut For macOS by @leesw98

Note: Definitely not as good as the original but it works! :)

## Requirement
 - Python==2.7.10

## Instruction

```
make install
make
```

redpajama_set_name: RedPajamaGithub


text:
@extends('layouts.auth')

@section('page-title')
    {{ trans('app.auth.login-page-title') }}
@stop

@section('content')

{{ trans('app.auth.login-title') }}

        <form role="form" action="{{ route('admin.auth.login') }}" method="POST">
            {!! csrf_field() !!}

            @include('errors.formErrors')

                <input type="email" name="email" class="form-control" placeholder="{{ trans('app.email') }}" value="{{ old('email') }}">

                <input type="password" name="password" class="form-control" placeholder="{{ trans('app.password') }}">

                            <input type="checkbox" name="remember"> {{ trans('app.auth.remember-me') }}

                    <button type="submit" class="btn btn-primary btn-block btn-flat">{{ trans('app.auth.btn-sign-in') }}</button>

        </form>

            {{ trans('app.auth.forgot-password') }}

@stop


text:
package org.apache.camel.spring.cloud;

import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

import org.apache.camel.cloud.ServiceDiscovery;
import org.springframework.cloud.client.DefaultServiceInstance;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;

public class CamelCloudDiscoveryClient implements DiscoveryClient {
    private final String description;
    private final ServiceDiscovery serviceDiscovery;
    private ServiceInstance localInstance;

    public CamelCloudDiscoveryClient(String description, ServiceDiscovery serviceDiscovery) {
        this(description, null, serviceDiscovery);
    }

    public CamelCloudDiscoveryClient(String description, ServiceInstance localServiceDiscovery, ServiceDiscovery serviceDiscovery) {
        this.description = description;
        this.serviceDiscovery = serviceDiscovery;
        this.localInstance = localServiceDiscovery;
    }

    @Override
    public String description() {
        return description;
    }

    @Override
    public ServiceInstance getLocalServiceInstance() {
        return this.localInstance;
    }

    public CamelCloudDiscoveryClient setLocalServiceInstance(ServiceInstance instance) {
        this.localInstance = instance;
        return this;
    }

    @Override
    public List<ServiceInstance> getInstances(String serviceId) {
        return serviceDiscovery.getServices(serviceId).stream()
            .map(s -> new DefaultServiceInstance(s.getName(), s.getHost(), s.getPort(), false, s.getMetadata()))
            .collect(Collectors.toList());
    }

    @Override
    public List<String> getServices() {
        return Collections.emptyList();
    }
}


text:
package org.jboss.resteasy.reactive.server.vertx.test.resource.basic;

import java.util.function.Supplier;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.core.Response;

import org.jboss.resteasy.reactive.server.vertx.test.framework.ResteasyReactiveUnitTest;
import org.jboss.resteasy.reactive.server.vertx.test.resource.basic.resource.CovariantReturnSubresourceLocatorsRootProxy;
import org.jboss.resteasy.reactive.server.vertx.test.resource.basic.resource.CovariantReturnSubresourceLocatorsSubProxy;
import org.jboss.resteasy.reactive.server.vertx.test.resource.basic.resource.CovariantReturnSubresourceLocatorsSubProxyRootImpl;
import org.jboss.resteasy.reactive.server.vertx.test.resource.basic.resource.CovariantReturnSubresourceLocatorsSubProxySubImpl;
import org.jboss.resteasy.reactive.server.vertx.test.simple.PortProviderUtil;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

/**
 * @tpSubChapter Resources
 * @tpChapter Integration tests
 * @tpTestCaseDetails Test return value of covariant with locators.
 * @tpSince RESTEasy 3.0.16
 */
@DisplayName("Covariant Return Subresource Locators Test")
public class CovariantReturnSubresourceLocatorsTest {

    @RegisterExtension
    static ResteasyReactiveUnitTest testExtension = new ResteasyReactiveUnitTest()
            .setArchiveProducer(new Supplier<>() {
                @Override
                public JavaArchive get() {
                    JavaArchive jar = ShrinkWrap.create(JavaArchive.class);
                    jar.addClasses(CovariantReturnSubresourceLocatorsRootProxy.class, PortProviderUtil.class,
                            CovariantReturnSubresourceLocatorsSubProxy.class);
                    jar.addClasses(CovariantReturnSubresourceLocatorsSubProxyRootImpl.class,
                            CovariantReturnSubresourceLocatorsSubProxySubImpl.class);
                    return jar;
                }
            });

    /**
     * @tpTestDetails Test basic path
     * @tpSince RESTEasy 3.0.16
     */
    @Test
    @DisplayName("Basic Test")
    public void basicTest() {
        Client client = ClientBuilder.newClient();
        Response response = client.target(
                PortProviderUtil.generateURL("/path/sub/xyz", CovariantReturnSubresourceLocatorsTest.class.getSimpleName()))
                .request().get();
        Assertions.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
        Assertions.assertEquals("Boo! - xyz", response.readEntity(String.class), "Wrong content of response");
        response.close();
        client.close();
    }
}


text:
var freeGlobal = require('./_freeGlobal');

/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;

/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;

/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;

/** Detect free variable `process` from Node.js. */
var freeProcess = moduleExports && freeGlobal.process;

/** Used to access faster Node.js helpers. */
var nodeUtil = (function () {
    try {
        return freeProcess && freeProcess.binding && freeProcess.binding('util');
    } catch (e) {
    }
}());

module.exports = nodeUtil;


text:
<?php

namespace Karudev\AppsBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Karudev\AppsBundle\Form\Type\ExpenseType;
use Karudev\AppsBundle\Entity\Expense;

class DepenseController extends Controller {

    private $_em;

    public function init(){
        $this->_em =  $this->getDoctrine()->getManager();
    }
    /**
     *
     * @Template()
     */
    public function indexAction() {

        return array();
    }

     /**
     *
     * @Template()
     */
    public function addAction() {

        $expense = new Expense();
        $form = $this->createForm(new ExpenseType(),$expense);
        $request = $this->getRequest();
        if($request->getMethod() == "POST"){
            $em =  $this->getDoctrine()->getManager();
            $user = $this->get('security.context')->getToken()->getUser();
            $form->submit($request);

            if($expense->getAmountHt() > 0)
                $expense->setAmountTva($expense->getAmountTtc() - $expense->getAmountHt());
            else
                $expense->setAmountHt($expense->getAmountTtc());

            $expense->setDateCreated(new \DateTime());
            $expense->setDateLastUpdated(new \DateTime());

            $expense->setOwnerId($user);

            $em->persist($expense);
            $em->flush();
        }

        return array('form' => $form->createView());
    }
    /**
     *
     * @Template()
     */
    public function showAction() {
        $this->init();
        $expenses = $this->_em->getRepository('KarudevAppsBundle:Expense')->findAll();
        return array('expenses' => $expenses);
    }

}


text:
package com.swfarm.biz.salechannel.dto;

import java.io.Serializable;

public class SearchSkuOnSaleReportItemsCriteria implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = -1309626740651985626L;

    private Long id;

    private String skuArticleNumber;

    private Integer wishProductCount;

    private Integer ebayListingCount;

    private Integer amazonProductCount;

    private Integer smtProductCount;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSkuArticleNumber() {
        return skuArticleNumber;
    }

    public void setSkuArticleNumber(String skuArticleNumber) {
        this.skuArticleNumber = skuArticleNumber;
    }

    public Integer getWishProductCount() {
        return wishProductCount;
    }

    public void setWishProductCount(Integer wishProductCount) {
        this.wishProductCount = wishProductCount;
    }

    public Integer getEbayListingCount() {
        return ebayListingCount;
    }

    public void setEbayListingCount(Integer ebayListingCount) {
        this.ebayListingCount = ebayListingCount;
    }

    public Integer getAmazonProductCount() {
        return amazonProductCount;
    }

    public void setAmazonProductCount(Integer amazonProductCount) {
        this.amazonProductCount = amazonProductCount;
    }

    public Integer getSmtProductCount() {
        return smtProductCount;
    }

    public void setSmtProductCount(Integer smtProductCount) {
        this.smtProductCount = smtProductCount;
    }

}


text:
/**
 * DaemonRepository.disconnect()
 */
'use strict';

const NError = require('nerror');

/**
 * Disassociate daemon with a connection
 * @method connect
 * @memberOf module:repositories/daemon~DaemonRepository
 * @param {DaemonModel} daemon              Daemon model
 * @param {ConnectionModel} connection      Connection model
 * @param {PostgresClient|string} [pg]      Will reuse the Postgres client provided, or if it is a string then will
 *                                          connect to this instance of Postgres.
 * @return {Promise}                        Resolves to a number of connections removed
 */
module.exports = async function (daemon, connection, pg) {
    let client;

    try {
        client = typeof pg === 'object' ? pg : await this._postgres.connect(pg || this.constructor.instance);
        let result = await client.query(
            `DELETE
               FROM daemon_connections
              WHERE daemon_id = $1
                AND connection_id = $2`,
            [
                typeof daemon === 'object' ? daemon.id : daemon,
                typeof connection === 'object' ? connection.id : connection,
            ]
        );

        if (typeof pg !== 'object')
            client.done();

        return result.rowCount;
    } catch (error) {
        if (client && typeof pg !== 'object')
            client.done();

        throw new NError(error, { daemon, connection }, 'DaemonRepository.disconnect()');
    }
};


text:
from webapp import webapp

webapp.run(debug = True)


text:
local gradient = surface.GetTextureID("gui/gradient")
local surface = surface

local PANEL = {}
function PANEL:Init()
	self:AddTitle(nut.lang.Get("scoreboard"));
	self:SetSize(AdvNut.util.GetCurrentMenuSize());
	self:SetPos(AdvNut.util.GetCurrentMenuPos())
	self:MakePopup()
	self:SetDrawBackground(false)

	local p = self:Add( "nut_NoticePanel" )
	p:Dock( TOP )
	p:DockMargin( 5, 5, 5, 0 )
	p:SetType( 4 )
	p:SetText( nut.lang.Get("sb_tip") )

	self.list = self:Add("AdvNut_ScrollPanel")
	self.list:Dock(FILL)
	self.list:DockMargin(8, 8, 8, 8)
	self.list:DockPadding(4, 4, 4, 4)

	self.lastUpdate = 0
	self.lastCount = #player.GetAll()

	self:PopulateList()
end

function PANEL:PopulateList()
	self.list:Clear();
	self.teamList = {}

	local players = player.GetAll()

	table.sort(players, function(a, b)
		return a:Team() > b:Team()
	end)

	for k, v in ipairs(players) do
		if (v.character) then
			local customClass = v:GetNetVar("customClass")

			if (customClass == "") then
				customClass = nil
			end

			local teamName = customClass or team.GetName(v:Team())

			if (table.HasValue(nut.config.dontshowfactions, v:Team())) then
				continue
			end

			if (!self.teamList[teamName]) then
				self.teamList[teamName] = self.list:Add("AdvNut_CategoryList")
				self.teamList[teamName]:Dock(TOP)
				self.teamList[teamName]:DockMargin(0, 1, 0, 10);
				self.teamList[teamName]:SetDrawBackground(false)
				self.teamList[teamName]:SetLabel(teamName);
				self.teamList[teamName]:SetTall(self.teamList[teamName]:GetTall() + 70)

				self.teamList[teamName].scollPanel = vgui.Create("AdvNut_ScrollPanel");
				self.teamList[teamName]:SetContents(self.teamList[teamName].scollPanel);
				self.teamList[teamName].scollPanel:SizeToContents();

				local userData = vgui.Create("nut_playerdata");
				userData:SetPlayer(v);
				userData:DockMargin(4, 0, 4, 0)
				userData:Dock(TOP)

				self.teamList[teamName].scollPanel:AddItem(userData);

				continue;
			end

			local titleData = self.teamList[teamName]

			if (titleData) then
				local userData = vgui.Create("nut_playerdata");
				userData:DockMargin(4, 0, 4, 1)
				userData:Dock(TOP)
				userData:SetPlayer(v)
				self.teamList[teamName].scollPanel:AddItem(userData);
			end
		end
	end
end

function PANEL:Think()
	if (self.lastUpdate < CurTime()) then
		self.lastUpdate = CurTime() + 1

		if (self.lastCount != #player.GetAll()) then
			self.list:Clear(true)
			self:PopulateList()
		end

		self.lastCount = #player.GetAll()
	end
end
vgui.Register("nut_Scoreboard", PANEL, "AdvNut_BaseForm")

local PANEL = {}
function PANEL:Init()
	local width = ScrW() * nut.config.menuWidth - 20
	self:SetTall(45)

	self.avatarIcon = vgui.Create("AvatarImage", self);
	self.avatarIcon:SetPos(45, 2)
	self.avatarIcon:SetSize(40, 40)

	self.avatarIconButton = vgui.Create("DButton", self);
	self.avatarIconButton:SetPos(45, 2)
	self.avatarIconButton:SetSize(40, 40);
	self.avatarIconButton:SetText("");
	self.avatarIconButton:SetDrawBackground(false);
	self.avatarIconButton:SetDrawBorder(false);

	AdvNut.util.DrawOutline(self.avatarIcon, 1, color_black);

	self.name = vgui.Create("DLabel", self)
	self.name:SetPos(95, 5)
	self.name:SetText("John Doe")
	self.name:SetFont("nut_SmallFont");
	self.name:SetTextColor(color_black)

	self.desc = vgui.Create("DLabel", self)
	self.desc:SetPos(95, 21)
	self.desc:SetText("...")
	self.desc:SetTextColor(color_black)
	self.desc:SetWrap(true)
	self.desc:SetTall(38)
	self.desc:SetWide(width - 128)
	self.desc:SetContentAlignment(7)
	self.desc:SetFont("nut_SmallFont");
	self.stringRequestPanel = {};
end

function PANEL:SetPlayer(client)
	local recognized = AdvNut.hook.Run("IsPlayerRecognized", client)
	local name = ""
	local description = client.character:GetVar("description")
	local model = ""

	if (recognized) then
		self.model = vgui.Create("SpawnIcon", self);
		self.model:SetModel(client:GetModel(), client:GetSkin());
		name = AdvNut.hook.Run("GetPlayerName", client, "scoreboard");
	else
		self.model = vgui.Create("DImageButton", self);
		self.model.Paint = function(client, w, h)
			surface.SetDrawColor(Color(200, 200, 200, 255));
			surface.DrawRect(0, 0, w, h);
		end;

		self.model:SetImage("nutscript/logo.png");
		name = AdvNut.hook.Run("GetUnknownPlayerName", client) or nut.lang.Get("unknown_player");
	end

	self.name:SetText(name)
	self.name:SizeToContents()
	AdvNut.util.DrawOutline(self.model, 1, color_black);

	self.model:SetPos(2, 2)
	self.model:SetSize(40, 40)
	self.model.client = client;
	if (LocalPlayer():IsAdmin()) then
		self.model.DoClick = function(panel)
			local menu = DermaMenu();
			local target = panel.client;
			local client = LocalPlayer();

			menu:AddOption(nut.lang.Get("sb_menu_change_name"), function()
				self.stringRequestPanel.changeName = Derma_StringRequest(nut.lang.Get("sb_menu_change_name"), nut.lang.Get("sb_menu_change_name_desc"), target:Name(), function(name)

					if (name and string.find(name, "%S")) then
						local oldName = target.character:GetVar("charname", "ERROR");
						netstream.Start(AdvNut.util.CreateIdentifier("SetCharName", SERVER), {name = name, target = target});

						nut.util.Notify(nut.lang.Get("char_set_name", client:Name(), oldName, name));
					else
						nut.util.Notify(nut.lang.Get("char_bad_name"), client);
					end;

					self:Refresh();
				end);
			end);

			// Faction Sub Menu //
			menu.factionMenu = menu:AddSubMenu(nut.lang.Get("faction"));
			menu.factionGiveMenu = menu.factionMenu:AddSubMenu(nut.lang.Get("sb_menu_faction_give"));
			for index, faction in pairs(nut.faction.GetAll()) do
				if (!faction.isDefault) then
					menu.factionGiveMenu:AddOption(faction.name, function()
						netstream.Start(AdvNut.util.CreateIdentifier("PlayerGiveWhitelist", SERVER), {factionName = faction.name, factionIndex = faction.index, target = target});

						self:Refresh();
					end);
				end;
			end;

			menu.factionTakeMenu = menu.factionMenu:AddSubMenu(nut.lang.Get("sb_menu_faction_take"));
			if (target.whitelists) then
				local whitelists = string.Split(target.whitelists, ",");
				whitelists[#whitelists] = nil;

				for index, factionName in pairs(whitelists) do
					local faction = nut.faction.GetByStringID(factionName);
					menu.factionTakeMenu:AddOption(faction.name, function()
						netstream.Start(AdvNut.util.CreateIdentifier("PlayerTakeWhitelist", SERVER), {factionName = faction.name, factionIndex = faction.index, target = target});

						self:Refresh();
					end);
				end;
			end;
			// End Faction Sub Menu //

			// Flags Sub Menu //
			menu.flagsMenu = menu:AddSubMenu(nut.lang.Get("sb_menu_flags"));
			menu.flagsMenu:AddOption(nut.lang.Get("sb_menu_flags_give"), function()
				self.stringRequestPanel.flagGive = Derma_StringRequest(nut.lang.Get("sb_menu_flags_give"), nut.lang.Get("sb_menu_flags_give_desc"), "", function(flags)
					netstream.Start(AdvNut.util.CreateIdentifier("PlayerGiveFlags", SERVER), {flags = flags, target = target});

					self:Refresh();
				end);
			end);

			menu.flagsMenu:AddOption(nut.lang.Get("sb_menu_flags_take"), function()
				self.stringRequestPanel.flagTake = Derma_StringRequest(nut.lang.Get("sb_menu_flags_take"), nut.lang.Get("sb_menu_flags_take"), "", function(flags)
					netstream.Start(AdvNut.util.CreateIdentifier("PlayerTakeFlags", SERVER), {flags = flags, target = target});

					self:Refresh();
				end);
			end);
			// End Flags Sub Menu //

			// Kick Sub Menu //
			menu.kickMenu = menu:AddSubMenu(nut.lang.Get("sb_menu_kick"));
			menu.kickMenu:AddOption(nut.lang.Get("sb_menu_kick"), function()
				netstream.Start("PlayerKick", {reason = "No Reason", target = target});

				self:Refresh();
			end);

			menu.kickMenu:AddOption(nut.lang.Get("sb_menu_kick_reason"), function()
				self.stringRequestPanel.kickReason = Derma_StringRequest(nut.lang.Get("sb_menu_kick_reason"), nut.lang.Get("sb_menu_kick_reason_desc"), "", function(reason)
					netstream.Start("PlayerKick", {reason = reason, target = target});
				end);

				self:Refresh();
			end);
			// End Kick Sub Menu //

			menu:AddOption(nut.lang.Get("sb_menu_ban"), function()
				self.stringRequestPanel.ban = Derma_StringRequest(nut.lang.Get("sb_menu_ban"), nut.lang.Get("sb_menu_ban_desc"), "", function(time)
					if (tonumber(time)) then
						netstream.Start(AdvNut.util.CreateIdentifier("PlayerBan", SERVER), {time = tonumber(time), target = target});
					else
						nut.util.Notify(nut.lang.Get("wrong_value"), client);
					end;
				end);

				self:Refresh();
			end);

			AdvNut.hook.Run("AddScoreboardModelMenu", menu);
			menu:Open();
		end;
	end;

	self.avatarIcon:SetPlayer(client, 45);
	self.avatarIconButton:SetToolTip(nut.lang.Get("sb_avatar_tip", client:RealName(), client:SteamID()));
	self.avatarIconButton.DoClick = function()
		if (IsValid(client)) then
			client:ShowProfile();
		end
	end

	if (description) then
		self.desc:SetText(description)
	end
end

function PANEL:Think()
	self.model:SetToolTip(nut.lang.Get("sb_model_tip", LocalPlayer():Ping()));
end

function PANEL:Refresh()
	timer.Simple(0.1, function()
		nut.gui.sb:PopulateList();
	end);
end

function PANEL:Paint(w, h)
	surface.SetDrawColor(0, 0, 0, 0)
	surface.DrawRect(0, 0, w, h)
end
vgui.Register("nut_playerdata", PANEL, "DPanel")


text:
using FrameLog.Contexts;
using FrameLog.Filter;
using FrameLog.Logging;
using FrameLog.Models;
using FrameLog.Transactions;
using System;
using System.Data.Common;
using System.Data.Entity;
using System.Data.Entity.Core.Objects;
using System.Transactions;

namespace FrameLog
{
    public class FrameLogModule<TChangeSet, TPrincipal>
        where TChangeSet : IChangeSet<TPrincipal>
    {
        public bool Enabled { get; set; }
        private IChangeSetFactory<TChangeSet, TPrincipal> factory;
        private IFrameLogContext<TChangeSet, TPrincipal> context;
        private ILoggingFilter filter;

        public FrameLogModule(IChangeSetFactory<TChangeSet, TPrincipal> factory,
            IFrameLogContext<TChangeSet, TPrincipal> context,
            ILoggingFilterProvider filter = null)
        {
            this.factory = factory;
            this.context = context;
            this.filter = (filter ?? Filters.Default).Get(context);
            Enabled = true;
        }

        /// <summary>
        /// Save the changes and log them as controlled by the logging filter.
        /// A TransactionScope will be used to wrap the save, which will use an ambient
        /// transaction if available, or create a new one otherwise.
        ///
        /// If you are using an explicit transaction, and not using the TransactionScope
        /// API, then do not use this overload. Use SaveChangesWithinExplicitTransaction.
        /// </summary>
        /// <returns>The number of objects written to the underlying database.</returns>
        public int SaveChanges(TPrincipal principal)
        {
            return SaveChanges(principal, new TransactionOptions());
        }
        /// <summary>
        /// Save the changes and log them as controlled by the logging filter.
        /// A TransactionScope will be used to wrap the save, which will use an ambient
        /// transaction available, or create a new one otherwise. The given options
        /// will be used in constructing the TransactionScope.
        ///
        /// If you are using an explicit transaction, and not using the TransactionScope
        /// API, then do not use this overload. Use SaveChangesWithinExplicitTransaction.
        /// </summary>
        /// <returns>The number of objects written to the underlying database.</returns>
        public int SaveChanges(TPrincipal principal, TransactionOptions transactionOptions)
        {
            return saveChanges(principal, new TransactionScopeProvider(transactionOptions));
        }
        /// <summary>
        /// Save the changes and log them as controlled by the logging filter.
        /// Warning: Only use this overload when you are wrapping the call to FrameLog in your
        /// own transaction. This prevents FrameLog from automatically creating its own transaction.
        ///
        /// If you are using the TransactionScope API, you can use the SaveChanges overload,
        /// as FrameLog will automatically detect the ambient transaction.
        /// </summary>
        /// <returns>The number of objects written to the underlying database.</returns>
        public int SaveChangesWithinExplicitTransaction(TPrincipal principal)
        {
            // If there is already an explicit transaction in use, we don't need to do anything
            // with transactions in FrameLog, so just use the NullTransactionProvider
            return saveChanges(principal, new NullTransactionProvider());
        }

        protected int saveChanges(TPrincipal principal, ITransactionProvider transactionProvider)
        {
            if (!Enabled)
                return context.SaveChanges(detectAndAccept);

            int result = 0;
            // We want to split saving and logging into two steps, so that when we
            // generate the log objects the database has already assigned IDs to new
            // objects. Then we can log about them meaningfully. So we wrap it in a
            // transaction so that even though there are two saves, the change is still
            // atomic.
            transactionProvider.InTransaction(() =>
            {
                // First we save all the changes, but we do not accept the changes
                // (i.e. we keep our record of them).
                result = context.SaveChanges(SaveOptions.DetectChangesBeforeSave);

                // Then, based on that record of changes we create log objects for
                // them and then accept the first set of changes.
                logChanges(principal);

                // Then we save the changes that result from creating the log objects,
                // and accept this second set of changes.
                context.SaveChanges(detectAndAccept);
            });
            return result;
        }

        private void logChanges(TPrincipal principal)
        {
            var logger = new ChangeLogger<TChangeSet, TPrincipal>(context, factory, filter);

            // This returns the log objects, but they are not attached to the context
            // so the context change tracker hasn't noticed them
            var oven = logger.Log(context.ObjectStateManager);

            // So when we accept changes, we are only accepting the changes from the
            // original changes - the context hasn't yet detected the log changes
            context.AcceptAllChanges();

            // This code then attaches the log objects to the context
            if (oven.HasChangeSet)
            {
                // First do any deferred log value calculations.
                // See PropertyChange.Bake for more information
                TChangeSet changeSet = oven.Bake(DateTime.Now, principal);
                context.AddChangeSet(changeSet);
            }
        }

        private static readonly SaveOptions detectAndAccept =
            SaveOptions.DetectChangesBeforeSave |
            SaveOptions.AcceptAllChangesAfterSave;
    }
}


text:
import operator as op
import bisect as bs
#from sortedcontainers import SortedList

def possible(points, left_out, right_out, w):
    bottom_in = points[0][1] + w
    top_in = points[-1][1] - w
    left_in = left_out + w
    right_in = right_out - w

    points_y = tuple(p[1] for p in points)
    bottom_point = bs.bisect_right(points_y, points[0][1]+w)
    top_point = bs.bisect_left(points_y, points[-1][1]-w)
    points_without_top_bottom = points[bottom_point:top_point]

    for p in points_without_top_bottom:
        if left_in < p[0] and p[0] < right_in:
            return False
    return True

def solve(n, k, w, points):
    x_sorted_points = sorted(points, key=op.itemgetter(0, 1))
    y_sorted_points = sorted(points, key=op.itemgetter(1, 0))
    left_out = x_sorted_points[0][0]
    right_out = x_sorted_points[-1][0]

    for bottom_k in range(0, k+1):
        cleaned_points = y_sorted_points[bottom_k:n-k+bottom_k]
        if possible(cleaned_points, left_out, right_out, w):
            return True
        else:
            return False

if __name__ == '__main__':
    T = int(input())
    for _ in range(T):
        N, K, W = tuple(int(n) for n in input().split())
        PS = tuple(tuple(int(c) for c in input().split()) for i in range(N))
        if solve(N, K, W, PS):
            print("YES")
        else:
            print("NO")


text:
package mealplaner.plugins.recipephoto;

import java.util.Locale;
import java.util.Optional;
import java.util.ResourceBundle;

import mealplaner.commons.BundleUtils;
import mealplaner.plugins.PluginStore;
import mealplaner.plugins.api.PluginDescription;
import mealplaner.plugins.recipephoto.mealedit.MealEditRecipePhoto;
import mealplaner.plugins.recipephoto.mealedit.MealInputRecipePhoto;
import mealplaner.plugins.recipephoto.mealedit.RecipePhotoFact;

public class RecipePhotoPlugin implements PluginDescription {
  @Override
  public void registerPlugins(PluginStore pluginStore) {
    pluginStore.registerMealExtension(RecipePhotoFact.class, RecipePhotoFact.class, RecipePhotoFact::new);
    pluginStore.registerMealGuiExtension(new MealInputRecipePhoto(), new MealEditRecipePhoto());
  }

  @Override
  public Optional<ResourceBundle> getMessageBundle(Locale locale) {
    return Optional.of(BundleUtils.loadBundle("RecipePhotoMessagesBundle", locale));
  }

  @Override
  public Optional<ResourceBundle> getErrorBundle(Locale locale) {
    return Optional.of(BundleUtils.loadBundle("RecipePhotoErrorBundle", locale));
  }
}


text:
<?php

namespace DLSUtils\Component\Validator\Constraints;

use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\Exception\MissingOptionsException;

/**
 * @Annotation
 *
 * @author Josep Bonet <josep.bonet@digitallifesciences.co.uk>
 *
 */

/*
 * Based on the source of Michaël Perrin in http://blog.michaelperrin.fr/2013/03/19/range-date-validator-for-symfony2/.
 */

class DateRange extends Constraint
{
    public $minMessage = 'This date should be greater than {{ limit }}.';
    public $maxMessage = 'This date should be less than {{ limit }}.';
    public $invalidMessage = 'This value should be a valid date.';
    public $min;
    public $max;

    public function __construct($options = null)
    {
        parent::__construct($options);

        if (null === $this->min && null === $this->max) {
            throw new MissingOptionsException('Either option "min" or "max" must be given for constraint ' . __CLASS__, array('min', 'max'));
        }

//        if (null !== $this->min) {
//            $this->min = new \DateTime($this->min);
//        }
//
//        if (null !== $this->max) {
//            $this->max = new \DateTime($this->max);
//        }
    }
}


text:
if(WIN32)
	find_library(WS2_32_LIBRARY NAMES ws2_32)
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Winsock REQUIRED_VARS WS2_32_LIBRARY)
imported_library(Winsock::Lib "${WS2_32_LIBRARY}")


text:
TeamLeader::TeamLeader() : Specialist() {
	std::cout << "TeamLeader::TeamLeader()" << std::endl;
	this->departmentDescription = NULL;
	this->employees = NULL;
	this->numberEmployees = 0;
	this->capacityEmployees = 2;
}

TeamLeader::TeamLeader(char* name, char* address, char* department, int salary, char* speciality, char* departmentDescription)
: Specialist(name, address, department, salary, speciality) {
	std::cout << "TeamLeader::TeamLeader(.....) : Specialist(....)" << std::endl;
	int lenDepDesc = strlen(departmentDescription) + 1;
	this->departmentDescription = NULL;

	this->departmentDescription = new (std::nothrow) char[lenDepDesc];
	if (this->departmentDescription == NULL)
		return;
	strcpy_s(this->departmentDescription, lenDepDesc, departmentDescription);
	this->employees = NULL;
	this->numberEmployees = 0;
	this->capacityEmployees = 2;
}

TeamLeader::TeamLeader(const TeamLeader& other) : Specialist(other) {
	std::cout << "TeamLeader::TeamLeader(const TeamLeader& other)" << std::endl;
	copyTeamLeader(other);
}

TeamLeader& TeamLeader::operator=(const TeamLeader& other) {
	std::cout << "TeamLeader& TeamLeader::operator=(const TeamLeader& other)" << std::endl;
	if (this != &other) {
		clearTeamLeader();
		Specialist::operator=(other);
		copyTeamLeader(other);
	}
	return *this;
}

TeamLeader::~TeamLeader() {
	std::cout << "TeamLeader::~TeamLeader()" << std::endl;
	clearTeamLeader();
}

//void TeamLeader::addEmployee(Employee& other) {
//	if (this->numberEmployees + 1 == this->capacityEmployees) {
//		this->capacityEmployees *= 2;
//	}
//	Employee** temp = new (std::nothrow) Employee*[this->capacityEmployees];
//	if (temp == NULL)
//		return;
//	std::cout << "numberEmployees: " << this->numberEmployees << std::endl;
//	for (int i = 0; i < this->numberEmployees; i++) {
//		temp[i] = this->employees[i];
//	}
//	for (int i = 0; i < this->numberEmployees; i++) {
//		delete[] this->employees[i];
//	}
//	delete[] employees;
//
//	temp[this->numberEmployees] = &other;
//	this->numberEmployees += 1;
//	this->employees = new (std::nothrow) Employee*[this->capacityEmployees];
//	if (this->employees == NULL)
//		return;
//	for (int i = 0; i < this->numberEmployees; i++) {
//		this->employees[i] = temp[i];
//	}
//	for (int i = 0; i < this->numberEmployees - 1; i++) {
//		delete[] temp[i];
//	}
//	delete[] temp;
//}

void TeamLeader::addEmployee(Employee* other) {
	if (this->numberEmployees + 1 == this->capacityEmployees) {
		this->capacityEmployees *= 2;
	}
	Employee** temp = new (std::nothrow) Employee*[this->capacityEmployees];
	if (temp == NULL)
		return;
	for (int i = 0; i < this->numberEmployees; i++) {
		temp[i] = this->employees[i];
	}
	//for (int i = 0; i < this->numberEmployees; i++) {
	//	delete[] this->employees[i];
	//}
	delete[] employees;

	temp[this->numberEmployees] = other;
	this->numberEmployees += 1;
	this->employees = new (std::nothrow) Employee*[this->capacityEmployees];
	if (this->employees == NULL)
		return;
	for (int i = 0; i < this->numberEmployees; i++) {
		//this->employees[i] = new Employee;
		this->employees[i] = temp[i];
	}
	//for (int i = 0; i < this->numberEmployees - 1; i++) {
	//	delete[] temp[i];
	//}
	delete[] temp;
}

char* TeamLeader::getDepartmentDescription() const {
	return this->departmentDescription;
}

void TeamLeader::setDepartmentDescription(const char* departmentDescription) {
	int lenDepDesc = strlen(departmentDescription) + 1;
	this->departmentDescription = NULL;

	this->departmentDescription = new (std::nothrow) char[lenDepDesc];
	if (this->departmentDescription == NULL)
		return;
	strcpy_s(this->departmentDescription, lenDepDesc, departmentDescription);
}

int TeamLeader::getNumberEmployees() const {
	return this->numberEmployees;
}

void TeamLeader::clearTeamLeader() {
	delete[] this->departmentDescription;

	//for (int i = 0; i < this->numberEmployees - 1; i++) {
	//	delete[] this->employees[i];
	//}
	delete[] this->employees;
	this->numberEmployees = 0;
	this->capacityEmployees = 2;
}

void TeamLeader::copyTeamLeader(const TeamLeader& other) {
	setDepartmentDescription(other.getDepartmentDescription());
	this->numberEmployees = other.getNumberEmployees();
	this->capacityEmployees = other.capacityEmployees;

	this->employees = new (std::nothrow) Employee*[this->numberEmployees];
	if (this->employees == NULL)
		return;
	for (int i = 0; i < this->numberEmployees; i++) {
		this->employees[i] = other.getEmployeesTeam()[i];
	}
}

void TeamLeader::printTeamLeader() const {
	std::cout << "TeamLeader: " << std::endl;
	std::cout << "--name: " << getName()
		<< std::endl
		<< "--address: " << getAddress()
		<< std::endl
		<< "--department: " << getDepartment()
		<< std::endl
		<< "--speciality: " << getSpeciality()
		<< std::endl
		<< "--salary: " << getSalary()
		<< std::endl
		<< "--departmentDescription: " << getDepartment()
		<< std::endl
		<< "--has " << getNumberEmployees() << " employees in his team."
		<< std::endl << std::endl;
}

Employee** TeamLeader::getEmployeesTeam() const {
	return this->employees;
}


text:
import React from 'react';

export default function About() {
  return (

          About

          Moolah is the simplest way to stay on top of your finances.

  );
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="all" name="plugin">
    <property name="i2pbase" value="../../i2p.i2p"/>
    <property name="i2plib" value="${i2pbase}/build"/>
    <path id="cp">
        <pathelement path="${java.class.path}" />
        <pathelement location="${i2plib}/i2p.jar" />
    </path>

    <target name="all" depends="clean, build" />
    <target name="build" depends="jar" />
    <target name="builddep">
    </target>

    <property name="javac.compilerargs" value="" />
    <property name="javac.version" value="1.8" />

    <target name="compile">
        <mkdir dir="./build" />
        <mkdir dir="./build/obj" />
        <javac
            srcdir="./src"
            debug="true" deprecation="on" source="${javac.version}" target="${javac.version}"
            destdir="./build/obj"
            includeAntRuntime="false"
            classpath="${i2plib}/i2p.jar:../dist/itoopie.jar" >
            <compilerarg line="${javac.compilerargs}" />
        </javac>
    </target>

    <target name="jar" depends="builddep, compile">
        <jar destfile="build/itoopie-plugin.jar" basedir="./build/obj">
        </jar>
    </target>

    <target name="clean">
        <delete dir="./build" />
    </target>

    <target name="cleandep" depends="clean">
    </target>
    <target name="distclean" depends="clean">
    </target>
</project>


text:
/**
 * @typedef {import('micromark-util-types').Code} Code
 */
import {
  markdownLineEndingOrSpace,
  unicodePunctuation,
  unicodeWhitespace
} from 'micromark-util-character'

/**
 * Classify whether a character code represents whitespace, punctuation, or
 * something else.
 *
 * Used for attention (emphasis, strong), whose sequences can open or close
 * based on the class of surrounding characters.
 *
 * Note that eof (`null`) is seen as whitespace.
 *
 * @param {Code} code
 * @returns {number|undefined}
 */
export function classifyCharacter(code) {
  if (
    code === null ||
    markdownLineEndingOrSpace(code) ||
    unicodeWhitespace(code)
  ) {
    return 1
  }

  if (unicodePunctuation(code)) {
    return 2
  }
}


text:
package org.jclouds.azureblob.blobstore.functions;

import java.util.Map.Entry;

import javax.inject.Singleton;

import org.jclouds.azureblob.domain.MutableBlobProperties;
import org.jclouds.azureblob.domain.internal.MutableBlobPropertiesImpl;
import org.jclouds.blobstore.domain.BlobMetadata;
import org.jclouds.http.HttpUtils;

import com.google.common.base.Function;

@Singleton
public class BlobMetadataToBlobProperties implements Function<BlobMetadata, MutableBlobProperties> {
   public MutableBlobProperties apply(BlobMetadata from) {
      if (from == null)
         return null;
      MutableBlobProperties to = new MutableBlobPropertiesImpl();
      HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata());
      to.setETag(from.getETag());
      to.setName(from.getName());
      to.setUrl(from.getUri());
      to.setLastModified(from.getLastModified());
      if (from.getUserMetadata() != null) {
         for (Entry<String, String> entry : from.getUserMetadata().entrySet())
            to.getMetadata().put(entry.getKey().toLowerCase(), entry.getValue());
      }
      return to;
   }

}


text:
using System;
using System.Collections.Generic;
using System.Reactive.Linq;
using System.Reactive.Threading.Tasks;
using MS.Core;

namespace System.Threading.Tasks
{
    public static class __ParallelOptions
    {
        public static IObservable<System.Threading.Tasks.TaskScheduler> get_TaskScheduler(
            this IObservable<System.Threading.Tasks.ParallelOptions> ParallelOptionsValue)
        {
            return Observable.Select(ParallelOptionsValue,
                (ParallelOptionsValueLambda) => ParallelOptionsValueLambda.TaskScheduler);
        }

        public static IObservable<System.Int32> get_MaxDegreeOfParallelism(
            this IObservable<System.Threading.Tasks.ParallelOptions> ParallelOptionsValue)
        {
            return Observable.Select(ParallelOptionsValue,
                (ParallelOptionsValueLambda) => ParallelOptionsValueLambda.MaxDegreeOfParallelism);
        }

        public static IObservable<System.Threading.CancellationToken> get_CancellationToken(
            this IObservable<System.Threading.Tasks.ParallelOptions> ParallelOptionsValue)
        {
            return Observable.Select(ParallelOptionsValue,
                (ParallelOptionsValueLambda) => ParallelOptionsValueLambda.CancellationToken);
        }

        public static IObservable<System.Reactive.Unit> set_TaskScheduler(
            this IObservable<System.Threading.Tasks.ParallelOptions> ParallelOptionsValue,
            IObservable<System.Threading.Tasks.TaskScheduler> value)
        {
            return ObservableExt.ZipExecute(ParallelOptionsValue, value,
                (ParallelOptionsValueLambda, valueLambda) => ParallelOptionsValueLambda.TaskScheduler = valueLambda);
        }

        public static IObservable<System.Reactive.Unit> set_MaxDegreeOfParallelism(
            this IObservable<System.Threading.Tasks.ParallelOptions> ParallelOptionsValue,
            IObservable<System.Int32> value)
        {
            return ObservableExt.ZipExecute(ParallelOptionsValue, value,
                (ParallelOptionsValueLambda, valueLambda) =>
                    ParallelOptionsValueLambda.MaxDegreeOfParallelism = valueLambda);
        }

        public static IObservable<System.Reactive.Unit> set_CancellationToken(
            this IObservable<System.Threading.Tasks.ParallelOptions> ParallelOptionsValue,
            IObservable<System.Threading.CancellationToken> value)
        {
            return ObservableExt.ZipExecute(ParallelOptionsValue, value,
                (ParallelOptionsValueLambda, valueLambda) => ParallelOptionsValueLambda.CancellationToken = valueLambda);
        }
    }
}


text:
namespace v8 {
namespace internal {

class MarkBit {
 public:
  typedef uint32_t CellType;
  STATIC_ASSERT(sizeof(CellType) == sizeof(base::Atomic32));

  enum AccessMode { ATOMIC, NON_ATOMIC };

  inline MarkBit(base::Atomic32* cell, CellType mask) : cell_(cell) {
    mask_ = static_cast<base::Atomic32>(mask);
  }

#ifdef DEBUG
  bool operator==(const MarkBit& other) {
    return cell_ == other.cell_ && mask_ == other.mask_;
  }
#endif

 private:
  inline MarkBit Next() {
    CellType new_mask = mask_ << 1;
    if (new_mask == 0) {
      return MarkBit(cell_ + 1, 1);
    } else {
      return MarkBit(cell_, new_mask);
    }
  }

  // The function returns true if it succeeded to
  // transition the bit from 0 to 1.
  template <AccessMode mode = NON_ATOMIC>
  inline bool Set();

  template <AccessMode mode = NON_ATOMIC>
  inline bool Get();

  // The function returns true if it succeeded to
  // transition the bit from 1 to 0.
  template <AccessMode mode = NON_ATOMIC>
  inline bool Clear();

  base::Atomic32* cell_;
  base::Atomic32 mask_;

  friend class IncrementalMarking;
  friend class ConcurrentMarkingMarkbits;
  friend class Marking;
};

template <>
inline bool MarkBit::Set<MarkBit::NON_ATOMIC>() {
  base::Atomic32 old_value = *cell_;
  *cell_ = old_value | mask_;
  return (old_value & mask_) == 0;
}

template <>
inline bool MarkBit::Set<MarkBit::ATOMIC>() {
  base::Atomic32 old_value;
  base::Atomic32 new_value;
  do {
    old_value = base::NoBarrier_Load(cell_);
    if (old_value & mask_) return false;
    new_value = old_value | mask_;
  } while (base::Release_CompareAndSwap(cell_, old_value, new_value) !=
           old_value);
  return true;
}

template <>
inline bool MarkBit::Get<MarkBit::NON_ATOMIC>() {
  return (base::NoBarrier_Load(cell_) & mask_) != 0;
}

template <>
inline bool MarkBit::Get<MarkBit::ATOMIC>() {
  return (base::Acquire_Load(cell_) & mask_) != 0;
}

template <>
inline bool MarkBit::Clear<MarkBit::NON_ATOMIC>() {
  base::Atomic32 old_value = *cell_;
  *cell_ = old_value & ~mask_;
  return (old_value & mask_) == mask_;
}

template <>
inline bool MarkBit::Clear<MarkBit::ATOMIC>() {
  base::Atomic32 old_value;
  base::Atomic32 new_value;
  do {
    old_value = base::NoBarrier_Load(cell_);
    if (!(old_value & mask_)) return false;
    new_value = old_value & ~mask_;
  } while (base::Release_CompareAndSwap(cell_, old_value, new_value) !=
           old_value);
  return true;
}

// Bitmap is a sequence of cells each containing fixed number of bits.
class Bitmap {
 public:
  static const uint32_t kBitsPerCell = 32;
  static const uint32_t kBitsPerCellLog2 = 5;
  static const uint32_t kBitIndexMask = kBitsPerCell - 1;
  static const uint32_t kBytesPerCell = kBitsPerCell / kBitsPerByte;
  static const uint32_t kBytesPerCellLog2 = kBitsPerCellLog2 - kBitsPerByteLog2;

  static const size_t kLength = (1 << kPageSizeBits) >> (kPointerSizeLog2);

  static const size_t kSize = (1 << kPageSizeBits) >>
                              (kPointerSizeLog2 + kBitsPerByteLog2);

  static int CellsForLength(int length) {
    return (length + kBitsPerCell - 1) >> kBitsPerCellLog2;
  }

  int CellsCount() { return CellsForLength(kLength); }

  static int SizeFor(int cells_count) {
    return sizeof(MarkBit::CellType) * cells_count;
  }

  INLINE(static uint32_t IndexToCell(uint32_t index)) {
    return index >> kBitsPerCellLog2;
  }

  V8_INLINE static uint32_t IndexInCell(uint32_t index) {
    return index & kBitIndexMask;
  }

  INLINE(static uint32_t CellToIndex(uint32_t index)) {
    return index << kBitsPerCellLog2;
  }

  INLINE(static uint32_t CellAlignIndex(uint32_t index)) {
    return (index + kBitIndexMask) & ~kBitIndexMask;
  }

  INLINE(MarkBit::CellType* cells()) {
    return reinterpret_cast<MarkBit::CellType*>(this);
  }

  INLINE(Address address()) { return reinterpret_cast<Address>(this); }

  INLINE(static Bitmap* FromAddress(Address addr)) {
    return reinterpret_cast<Bitmap*>(addr);
  }

  inline MarkBit MarkBitFromIndex(uint32_t index) {
    MarkBit::CellType mask = 1u << IndexInCell(index);
    MarkBit::CellType* cell = this->cells() + (index >> kBitsPerCellLog2);
    return MarkBit(reinterpret_cast<base::Atomic32*>(cell), mask);
  }

  void Clear() {
    for (int i = 0; i < CellsCount(); i++) cells()[i] = 0;
  }

  // Sets all bits in the range [start_index, end_index).
  void SetRange(uint32_t start_index, uint32_t end_index) {
    unsigned int start_cell_index = start_index >> Bitmap::kBitsPerCellLog2;
    MarkBit::CellType start_index_mask = 1u << Bitmap::IndexInCell(start_index);

    unsigned int end_cell_index = end_index >> Bitmap::kBitsPerCellLog2;
    MarkBit::CellType end_index_mask = 1u << Bitmap::IndexInCell(end_index);

    if (start_cell_index != end_cell_index) {
      // Firstly, fill all bits from the start address to the end of the first
      // cell with 1s.
      cells()[start_cell_index] |= ~(start_index_mask - 1);
      // Then fill all in between cells with 1s.
      for (unsigned int i = start_cell_index + 1; i < end_cell_index; i++) {
        cells()[i] = ~0u;
      }
      // Finally, fill all bits until the end address in the last cell with 1s.
      cells()[end_cell_index] |= (end_index_mask - 1);
    } else {
      cells()[start_cell_index] |= end_index_mask - start_index_mask;
    }
  }

  // Clears all bits in the range [start_index, end_index).
  void ClearRange(uint32_t start_index, uint32_t end_index) {
    unsigned int start_cell_index = start_index >> Bitmap::kBitsPerCellLog2;
    MarkBit::CellType start_index_mask = 1u << Bitmap::IndexInCell(start_index);

    unsigned int end_cell_index = end_index >> Bitmap::kBitsPerCellLog2;
    MarkBit::CellType end_index_mask = 1u << Bitmap::IndexInCell(end_index);

    if (start_cell_index != end_cell_index) {
      // Firstly, fill all bits from the start address to the end of the first
      // cell with 0s.
      cells()[start_cell_index] &= (start_index_mask - 1);
      // Then fill all in between cells with 0s.
      for (unsigned int i = start_cell_index + 1; i < end_cell_index; i++) {
        cells()[i] = 0;
      }
      // Finally, set all bits until the end address in the last cell with 0s.
      cells()[end_cell_index] &= ~(end_index_mask - 1);
    } else {
      cells()[start_cell_index] &= ~(end_index_mask - start_index_mask);
    }
  }

  // Returns true if all bits in the range [start_index, end_index) are set.
  bool AllBitsSetInRange(uint32_t start_index, uint32_t end_index) {
    unsigned int start_cell_index = start_index >> Bitmap::kBitsPerCellLog2;
    MarkBit::CellType start_index_mask = 1u << Bitmap::IndexInCell(start_index);

    unsigned int end_cell_index = end_index >> Bitmap::kBitsPerCellLog2;
    MarkBit::CellType end_index_mask = 1u << Bitmap::IndexInCell(end_index);

    MarkBit::CellType matching_mask;
    if (start_cell_index != end_cell_index) {
      matching_mask = ~(start_index_mask - 1);
      if ((cells()[start_cell_index] & matching_mask) != matching_mask) {
        return false;
      }
      for (unsigned int i = start_cell_index + 1; i < end_cell_index; i++) {
        if (cells()[i] != ~0u) return false;
      }
      matching_mask = (end_index_mask - 1);
      // Check against a mask of 0 to avoid dereferencing the cell after the
      // end of the bitmap.
      return (matching_mask == 0) ||
             ((cells()[end_cell_index] & matching_mask) == matching_mask);
    } else {
      matching_mask = end_index_mask - start_index_mask;
      // Check against a mask of 0 to avoid dereferencing the cell after the
      // end of the bitmap.
      return (matching_mask == 0) ||
             (cells()[end_cell_index] & matching_mask) == matching_mask;
    }
  }

  // Returns true if all bits in the range [start_index, end_index) are cleared.
  bool AllBitsClearInRange(uint32_t start_index, uint32_t end_index) {
    unsigned int start_cell_index = start_index >> Bitmap::kBitsPerCellLog2;
    MarkBit::CellType start_index_mask = 1u << Bitmap::IndexInCell(start_index);

    unsigned int end_cell_index = end_index >> Bitmap::kBitsPerCellLog2;
    MarkBit::CellType end_index_mask = 1u << Bitmap::IndexInCell(end_index);

    MarkBit::CellType matching_mask;
    if (start_cell_index != end_cell_index) {
      matching_mask = ~(start_index_mask - 1);
      if ((cells()[start_cell_index] & matching_mask)) return false;
      for (unsigned int i = start_cell_index + 1; i < end_cell_index; i++) {
        if (cells()[i]) return false;
      }
      matching_mask = (end_index_mask - 1);
      // Check against a mask of 0 to avoid dereferencing the cell after the
      // end of the bitmap.
      return (matching_mask == 0) || !(cells()[end_cell_index] & matching_mask);
    } else {
      matching_mask = end_index_mask - start_index_mask;
      // Check against a mask of 0 to avoid dereferencing the cell after the
      // end of the bitmap.
      return (matching_mask == 0) || !(cells()[end_cell_index] & matching_mask);
    }
  }

  static void PrintWord(uint32_t word, uint32_t himask = 0) {
    for (uint32_t mask = 1; mask != 0; mask <<= 1) {
      if ((mask & himask) != 0) PrintF("[");
      PrintF((mask & word) ? "1" : "0");
      if ((mask & himask) != 0) PrintF("]");
    }
  }

  class CellPrinter {
   public:
    CellPrinter() : seq_start(0), seq_type(0), seq_length(0) {}

    void Print(uint32_t pos, uint32_t cell) {
      if (cell == seq_type) {
        seq_length++;
        return;
      }

      Flush();

      if (IsSeq(cell)) {
        seq_start = pos;
        seq_length = 0;
        seq_type = cell;
        return;
      }

      PrintF("%d: ", pos);
      PrintWord(cell);
      PrintF("\n");
    }

    void Flush() {
      if (seq_length > 0) {
        PrintF("%d: %dx%d\n", seq_start, seq_type == 0 ? 0 : 1,
               seq_length * kBitsPerCell);
        seq_length = 0;
      }
    }

    static bool IsSeq(uint32_t cell) { return cell == 0 || cell == 0xFFFFFFFF; }

   private:
    uint32_t seq_start;
    uint32_t seq_type;
    uint32_t seq_length;
  };

  void Print() {
    CellPrinter printer;
    for (int i = 0; i < CellsCount(); i++) {
      printer.Print(i, cells()[i]);
    }
    printer.Flush();
    PrintF("\n");
  }

  bool IsClean() {
    for (int i = 0; i < CellsCount(); i++) {
      if (cells()[i] != 0) {
        return false;
      }
    }
    return true;
  }
};

class Marking : public AllStatic {
 public:
  // TODO(hpayer): The current mark bit operations use as default NON_ATOMIC
  // mode for access. We should remove the default value or switch it with
  // ATOMIC as soon we add concurrency.

  // Impossible markbits: 01
  static const char* kImpossibleBitPattern;
  template <MarkBit::AccessMode mode = MarkBit::NON_ATOMIC>
  INLINE(static bool IsImpossible(MarkBit mark_bit)) {
    if (mode == MarkBit::NON_ATOMIC) {
      return !mark_bit.Get<mode>() && mark_bit.Next().Get<mode>();
    }
    // If we are in concurrent mode we can only tell if an object has the
    // impossible bit pattern if we read the first bit again after reading
    // the first and the second bit. If the first bit is till zero and the
    // second bit is one then the object has the impossible bit pattern.
    bool is_impossible = !mark_bit.Get<mode>() && mark_bit.Next().Get<mode>();
    if (is_impossible) {
      return !mark_bit.Get<mode>();
    }
    return false;
  }

  // Black markbits: 11
  static const char* kBlackBitPattern;
  template <MarkBit::AccessMode mode = MarkBit::NON_ATOMIC>
  INLINE(static bool IsBlack(MarkBit mark_bit)) {
    return mark_bit.Get<mode>() && mark_bit.Next().Get<mode>();
  }

  // White markbits: 00 - this is required by the mark bit clearer.
  static const char* kWhiteBitPattern;
  template <MarkBit::AccessMode mode = MarkBit::NON_ATOMIC>
  INLINE(static bool IsWhite(MarkBit mark_bit)) {
    DCHECK(!IsImpossible(mark_bit));
    return !mark_bit.Get<mode>();
  }

  // Grey markbits: 10
  static const char* kGreyBitPattern;
  template <MarkBit::AccessMode mode = MarkBit::NON_ATOMIC>
  INLINE(static bool IsGrey(MarkBit mark_bit)) {
    return mark_bit.Get<mode>() && !mark_bit.Next().Get<mode>();
  }

  // IsBlackOrGrey assumes that the first bit is set for black or grey
  // objects.
  template <MarkBit::AccessMode mode = MarkBit::NON_ATOMIC>
  INLINE(static bool IsBlackOrGrey(MarkBit mark_bit)) {
    return mark_bit.Get<mode>();
  }

  template <MarkBit::AccessMode mode = MarkBit::NON_ATOMIC>
  INLINE(static void MarkWhite(MarkBit markbit)) {
    STATIC_ASSERT(mode == MarkBit::NON_ATOMIC);
    markbit.Clear<mode>();
    markbit.Next().Clear<mode>();
  }

  // Warning: this method is not safe in general in concurrent scenarios.
  // If you know that nobody else will change the bits on the given location
  // then you may use it.
  template <MarkBit::AccessMode mode = MarkBit::NON_ATOMIC>
  INLINE(static void MarkBlack(MarkBit markbit)) {
    markbit.Set<mode>();
    markbit.Next().Set<mode>();
  }

  template <MarkBit::AccessMode mode = MarkBit::NON_ATOMIC>
  INLINE(static bool BlackToGrey(MarkBit markbit)) {
    STATIC_ASSERT(mode == MarkBit::NON_ATOMIC);
    DCHECK(IsBlack(markbit));
    return markbit.Next().Clear<mode>();
  }

  template <MarkBit::AccessMode mode = MarkBit::NON_ATOMIC>
  INLINE(static bool WhiteToGrey(MarkBit markbit)) {
    return markbit.Set<mode>();
  }

  template <MarkBit::AccessMode mode = MarkBit::NON_ATOMIC>
  INLINE(static bool WhiteToBlack(MarkBit markbit)) {
    return markbit.Set<mode>() && markbit.Next().Set<mode>();
  }

  template <MarkBit::AccessMode mode = MarkBit::NON_ATOMIC>
  INLINE(static bool GreyToBlack(MarkBit markbit)) {
    return markbit.Get<mode>() && markbit.Next().Set<mode>();
  }

  enum ObjectColor {
    BLACK_OBJECT,
    WHITE_OBJECT,
    GREY_OBJECT,
    IMPOSSIBLE_COLOR
  };

  static const char* ColorName(ObjectColor color) {
    switch (color) {
      case BLACK_OBJECT:
        return "black";
      case WHITE_OBJECT:
        return "white";
      case GREY_OBJECT:
        return "grey";
      case IMPOSSIBLE_COLOR:
        return "impossible";
    }
    return "error";
  }

  static ObjectColor Color(MarkBit mark_bit) {
    if (IsBlack(mark_bit)) return BLACK_OBJECT;
    if (IsWhite(mark_bit)) return WHITE_OBJECT;
    if (IsGrey(mark_bit)) return GREY_OBJECT;
    UNREACHABLE();
    return IMPOSSIBLE_COLOR;
  }

 private:
  DISALLOW_IMPLICIT_CONSTRUCTORS(Marking);
};

}  // namespace internal
}  // namespace v8

#endif  // V8_MARKING_H_


text:
package de.newsarea.homecockpit.connector.facade.event;

public interface OutboundEventListener {

	void outboundEvent(OutboundEvent outboundEvent);

}


text:
<?php

 require_once("../libs/utils.obj.php");

try {

 $m = MySqlCM::getInstance();
 if ($m->connect()) {
   throw new ExitException('An error has occurred with the SQL Server and we were unable to process your request...');
 }
 $lm = LoginCM::getInstance();
 $lm->startSession();

 $h = HTTP::getInstance();
 $h->parseUrl();

 $index = new Template("../tpl/index.tpl");
 $head = new Template("../tpl/head.tpl");
 $foot = new Template("../tpl/foot.tpl");
 $page = array();
 $page['title'] = 'Edit ';
 $page['action'] = 'Edit';
 if ($lm->o_login) {
   $page['login'] = &$lm->o_login;
   $lm->o_login->fetchRights();
 } else {
   throw new ExitException(null, EXIT_LOGIN);
 }

 if (isset($_GET['w']) && !empty($_GET['w'])) {
   switch($_GET['w']) {
     case 'vm':
       $what = 'VM';
       if (!$lm->o_login->cRight('SRV', R_EDIT)) {
         throw new ExitException('Access Denied, please check your access rights!');
       }
       if (isset($_GET['i']) && !empty($_GET['i'])) {
         $suid = $_GET['i'];
       } else {
         $content = new Template('../tpl/error.tpl');
         $content->set('error', 'ID of VM is not provided');
         goto screen;
       }
       $obj = new VM();
       $obj->id = $suid;
       if ($obj->fetchFromId()) {
         throw new ExitException('The VM ID provided has not been foudn in DB');
       }
       if (isset($_GET['a']) && !empty($_GET['a'])) {
           switch($_GET['a']) {
               case 'enable':
                   $obj->f_upd = 1;
                   $obj->update();
                   $content = new Template('../tpl/message.tpl');
                   $content->set('msg', $what." $obj has been updated");
                   goto screen;
               break;
               case 'disable':
                   $obj->f_upd = 0;
                   $obj->update();
                   $content = new Template('../tpl/message.tpl');
                   $content->set('msg', $what." $obj has been updated");
                   goto screen;
               break;
               default:
                 throw new ExitException('Unknown action');
           }
       } else {
         throw new ExitException('No action provided for this VM');
       }
     break;
     case 'rjob':
       if (!$lm->o_login->cRight('RJOB', R_EDIT)) {
         throw new ExitException('Access Denied, please check your access rights!');
       }
       if (isset($_GET['i']) && !empty($_GET['i'])) {
         $suid = $_GET['i'];
       } else {
         $content = new Template('../tpl/error.tpl');
         $content->set('error', 'ID of Recurrent Job is not provided');
         goto screen;
       }
       $what = 'Recurrent Job';
       $obj = new RJob($suid);
       if ($obj->fetchFromId()) {
         $content = new Template('../tpl/error.tpl');
         $content->set('error', $what.' not found in the database');
         goto screen;
       }
       $content = new Template('../tpl/form_rjob.tpl');
       $content->set('obj', $obj);
       $content->set('edit', true);
       $content->set('page', $page);
       $page['title'] .= $what;
       if (isset($_POST['submit'])) { /* clicked on the Edit button */
         $fields = array('class', 'fct', 'frequency', 'arg');
         foreach($fields as $field) {
           if (!strncmp($field, 'f_', 2)) { // should be a checkbox
             if (isset($_POST[$field])) {
               $obj->{$field} = 1;
             } else {
               $obj->{$field} = 0;
             }
           } else {
             if (isset($_POST[$field])) {
               $obj->{$field} = $_POST[$field];
             }
           }
         }
         $errors = $obj->valid(false);
         if ($errors) {
           $content->set('error', $errors);
           $content->set('obj', $obj);
           goto screen;
         }
         $obj->update();
         $content = new Template('../tpl/message.tpl');
         $content->set('msg', $what." $obj has been updated");
         goto screen;
       }
     break;
     case 'suser':
       if (!$lm->o_login->cRight('CUSER', R_EDIT)) {
         throw new ExitException('Access Denied, please check your access rights!');
       }
       if (isset($_GET['i']) && !empty($_GET['i'])) {
         $suid = $_GET['i'];
       } else {
         $content = new Template('../tpl/error.tpl');
         $content->set('error', 'ID of SSH User is not provided');
         goto screen;
       }
       $what = 'SSH User';
       $obj = new SUser($suid);
       if ($obj->fetchFromId()) {
         $content = new Template('../tpl/error.tpl');
         $content->set('error', 'SSH User not found in the database');
         goto screen;
       }
       $content = new Template('../tpl/form_suser.tpl');
       $content->set('obj', $obj);
       $content->set('edit', true);
       $content->set('page', $page);
       $page['title'] .= $what;
       if (isset($_POST['submit'])) { /* clicked on the Edit button */
         $fields = array('description', 'pubkey', 'username', 'password');
         foreach($fields as $field) {
           if (!strncmp($field, 'f_', 2)) { // should be a checkbox
             if (isset($_POST[$field])) {
               $obj->{$field} = 1;
             } else {
               $obj->{$field} = 0;
             }
           } else {
             if (isset($_POST[$field])) {
               $obj->{$field} = $_POST[$field];
             }
           }
         }
         $errors = $obj->valid(false);
         if ($errors) {
           $content->set('error', $errors);
           $content->set('obj', $obj);
           goto screen;
         }
         $obj->update();
         $content = new Template('../tpl/message.tpl');
         $content->set('msg', "SSH User $obj has been updated");
         goto screen;
       }
     break;
     case 'cluster':
       if (!$lm->o_login->cRight('CLUSTER', R_EDIT)) {
         throw new ExitException('Access Denied, please check your access rights!');
       }
       $what = 'Cluster';
       if (isset($_GET['i']) && !empty($_GET['i'])) {
         $cuid = $_GET['i'];
       } else {
         $content = new Template('../tpl/error.tpl');
         $content->set('error', 'ID of Cluster is not provided');
         goto screen;
       }
       $obj = new Cluster($cuid);
       if ($obj->fetchFromId()) {
         $content = new Template('../tpl/error.tpl');
         $content->set('error', 'Cluster not found in the database');
         goto screen;
       }
       $obj->fetchRL('a_server');
       $obj->detectOsFromNodes();
       $content = new Template('../tpl/form_cluster.tpl');
       $a_os = OS::getAll(true, array(), array('ASC:name'));
       $content->set('oses', $a_os);
       $js = array('cluster.js');
       $head->set('js', $js);
       $page['title'] .= $what;
       $content->set('edit', true);
       $content->set('page', $page);
       if (isset($obj->fk_os) && is_numeric($obj->fk_os) && $obj->fk_os > 0) {
         $a_server = Server::getAll(true, array('fk_os' => 'CST:'.$obj->fk_os), array('ASC:hostname'));
         $content->set('a_server', $a_server);
	 /* sort the a_server array of $obj to have index as server id */
         $a = $obj->a_server;
	 $obj->a_server = array();
	 foreach($a as $o) {
	   $obj->a_server[$o->id] = $o;
 	 }
       }
       if (isset($_POST['submit'])) { /* clicked on the Edit button */
         $objold = $obj;
         $obj = new Cluster();
         $fields = array('name', 'description', 'f_upd', 'a_server', 'fk_os');
         foreach($fields as $field) {
           if (!strncmp($field, 'f_', 2)) { // should be a checkbox
             if (isset($_POST[$field])) {
               $obj->{$field} = 1;
             } else {
               $obj->{$field} = 0;
             }
           } else {
             if (isset($_POST[$field])) {
               $obj->{$field} = $_POST[$field];
             }
           }
         }
         $errors = $obj->valid(false, $objold);
         if ($errors) {
           $content->set('error', $errors);
           $content->set('obj', $objold);
           goto screen;
         }
         $objold->update();
         foreach($obj->a_server as $s) {
           $s->fk_cluster = $objold->id;
           $s->update();
         }
         foreach($objold->a_server as $s) {
           if (!isset($obj->a_server[$s->id])) {
             $s->fk_cluster = -1;
             $s->update();
           }
         }
         $content = new Template('../tpl/message.tpl');
         $content->set('msg', "Cluster $obj has been updated inside database");
         goto screen;
       }
       $content->set('obj', $obj);
     break;
     case 'log':
       if (!$lm->o_login->cRight('SRV', R_EDIT)) { /* @TODO: fix this */
         throw new ExitException('Access Denied, please check your access rights!');
       }
       $what = 'Log Entry';
       if (isset($_GET['i']) && !empty($_GET['i'])) {
         $suid = $_GET['i'];
       } else {
         $content = new Template('../tpl/error.tpl');
         $content->set('error', 'ID of Log Entry is not provided');
         goto screen;
       }
       $obj = new Log($suid);
       if ($obj->fetchFromId()) {
         $content = new Template('../tpl/error.tpl');
         $content->set('error', 'Log Entry not found in the database');
         goto screen;
       }
       if ($lm->o_login->id != $obj->fk_login) {
         throw new ExitException('Access Denied, You are not the owner of this log entry!');
       }
       $content = new Template('../tpl/form_log.tpl');
       $content->set('obj', $obj);
       $content->set('edit', true);
       $content->set('page', $page);
       $page['title'] .= $what;
       if (isset($_POST['submit'])) { /* clicked on the Edit button */
         $fields = array('msg');
         foreach($fields as $field) {
           if (!strncmp($field, 'f_', 2)) { // should be a checkbox
             if (isset($_POST[$field])) {
               $obj->{$field} = 1;
             } else {
               $obj->{$field} = 0;
             }
           } else {
             if ($_POST[$field]) {
               $obj->{$field} = $_POST[$field];
             }
           }
         }
         //$errors = $obj->valid(false);
         //if ($errors) {
         //  $content->set('error', $errors);
         //  $content->set('obj', $obj);
         //  goto screen;
         //}
         $obj->update();
         $content = new Template('../tpl/message.tpl');
         $content->set('msg', "Log Entry $obj has been updated to database");
         $a_link = array(
                     array('href' => '/list/w/logs',
                           'name' => 'Back to list of Event Logs',
                     ),
                 );
         goto screen;
       }
     break;
     case 'server':
       if (!$lm->o_login->cRight('SRV', R_EDIT)) {
         throw new ExitException('Access Denied, please check your access rights!');
       }
       $what = 'Server';
       if (isset($_GET['i']) && !empty($_GET['i'])) {
         $suid = $_GET['i'];
       } else {
         $content = new Template('../tpl/error.tpl');
         $content->set('error', 'ID of Server is not provided');
         goto screen;
       }
       $what = 'Server';
       $obj = new Server($suid);
       if ($obj->fetchFromId()) {
         $content = new Template('../tpl/error.tpl');
         $content->set('error', 'Server not found in the database');
         goto screen;
       }
       $content = new Template('../tpl/form_server.tpl');
       $content->set('obj', $obj);
       $content->set('edit', true);
       $content->set('page', $page);
       $a_suser = SUser::getAll(true, array(), array('ASC:username'));
       $a_pserver = PServer::getAll(true, array(), array('ASC:name'));
       $content->set('susers', $a_suser);
       $content->set('pservers', $a_pserver);
       $page['title'] .= $what;
       if (isset($_POST['submit'])) { /* clicked on the Edit button */
         $fields = array('description', 'fk_pserver', 'fk_suser', 'f_rce', 'f_upd');
         foreach($fields as $field) {
           if (!strncmp($field, 'f_', 2)) { // should be a checkbox
             if (isset($_POST[$field])) {
               $obj->{$field} = 1;
             } else {
               $obj->{$field} = 0;
             }
           } else {
             if ($_POST[$field]) {
               $obj->{$field} = $_POST[$field];
             }
           }
         }
         $errors = $obj->valid(false);
         if ($errors) {
           $content->set('error', $errors);
           $content->set('obj', $obj);
           goto screen;
         }
	 if ($obj->fk_pserver == -2) { /* should be added */
	   $ps = new PServer();
	   $ps->name = $obj->hostname;
	   $ps->insert();
	   $obj->fk_pserver = $ps->id;
	 }
         $obj->update();
         $content = new Template('../tpl/message.tpl');
         $content->set('msg', "Server $obj has been updated to database");
         goto screen;
       }
     break;
     case 'check':
       if (!$lm->o_login->cRight('CHK', R_EDIT)) {
         throw new ExitException('Access Denied, please check your access rights!');
       }
       $what = 'Check';
       if (isset($_GET['i']) && !empty($_GET['i'])) {
         $suid = $_GET['i'];
       } else {
         $content = new Template('../tpl/error.tpl');
         $content->set('error', 'ID of Check is not provided');
         goto screen;
       }
       $what = 'Check';
       $obj = new Check($suid);
       if ($obj->fetchFromId()) {
         $content = new Template('../tpl/error.tpl');
         $content->set('error', 'Check not found in the database');
         goto screen;
       }
       $content = new Template('../tpl/form_check.tpl');
       $content->set('obj', $obj);
       $content->set('edit', true);
       $content->set('page', $page);
       $page['title'] .= $what;
       if (isset($_POST['submit'])) { /* clicked on the Edit button */
         $fields = array('description', 'm_error', 'm_warn', 'f_text', 'f_noalerts', 'f_vm', 'f_root', 'frequency', 'lua');
         foreach($fields as $field) {
           if (!strncmp($field, 'f_', 2)) { // should be a checkbox
             if (isset($_POST[$field])) {
               $obj->{$field} = 1;
             } else {
               $obj->{$field} = 0;
             }
           } else {
             if ($_POST[$field]) {
               $obj->{$field} = $_POST[$field];
             }
           }
         }
         $errors = $obj->valid(false);
         if ($errors) {
           $content->set('error', $errors);
           $content->set('obj', $obj);
           goto screen;
         }
         $obj->update();
         $content = new Template('../tpl/message.tpl');
         $content->set('msg', "Check $obj has been updated to database");
         goto screen;
       }
     break;
     case 'sgroup':
       if (!$lm->o_login->cRight('SRVGRP', R_EDIT)) {
         throw new ExitException('Access Denied, please check your access rights!');
       }
       $what = 'Server Group';
       if (isset($_GET['i']) && !empty($_GET['i'])) {
         $suid = $_GET['i'];
       } else {
         $content = new Template('../tpl/error.tpl');
         $content->set('error', 'ID of Server Group is not provided');
         goto screen;
       }
       $what = 'Server Group';
       $obj = new SGroup($suid);
       if ($obj->fetchFromId()) {
         $content = new Template('../tpl/error.tpl');
         $content->set('error', 'Server Group not found in the database');
         goto screen;
       }
       $content = new Template('../tpl/form_sgroup.tpl');
       $content->set('obj', $obj);
       $content->set('edit', true);
       $content->set('page', $page);
       $page['title'] .= $what;
       if (isset($_POST['submit'])) { /* clicked on the Edit button */
         $fields = array('description');
         foreach($fields as $field) {
           if (!strncmp($field, 'f_', 2)) { // should be a checkbox
             if (isset($_POST[$field])) {
               $obj->{$field} = 1;
             } else {
               $obj->{$field} = 0;
             }
           } else {
             if ($_POST[$field]) {
               $obj->{$field} = $_POST[$field];
             }
           }
         }
         $errors = $obj->valid(false);
         if ($errors) {
           $content->set('error', $errors);
           $content->set('obj', $obj);
           goto screen;
         }
         $obj->update();
         $content = new Template('../tpl/message.tpl');
         $content->set('msg', "Server Group $obj has been updated to database");
         goto screen;
       }
     break;
     case 'ugroup':
       if (!$lm->o_login->cRight('UGRP', R_EDIT)) {
         throw new ExitException('Access Denied, please check your access rights!');
       }
       $what = 'User Group';
       if (isset($_GET['i']) && !empty($_GET['i'])) {
         $suid = $_GET['i'];
       } else {
         $content = new Template('../tpl/error.tpl');
         $content->set('error', 'ID of User Group is not provided');
         goto screen;
       }
       $what = 'User Group';
       $obj = new UGroup($suid);
       if ($obj->fetchFromId()) {
         $content = new Template('../tpl/error.tpl');
         $content->set('error', 'User Group not found in the database');
         goto screen;
       }
       $content = new Template('../tpl/form_ugroup.tpl');
       $content->set('obj', $obj);
       $content->set('edit', true);
       $content->set('page', $page);
       $page['title'] .= $what;
       if (isset($_POST['submit'])) { /* clicked on the Edit button */
         $fields = array('description');
         foreach($fields as $field) {
           if (!strncmp($field, 'f_', 2)) { // should be a checkbox
             if (isset($_POST[$field])) {
               $obj->{$field} = 1;
             } else {
               $obj->{$field} = 0;
             }
           } else {
             if ($_POST[$field]) {
               $obj->{$field} = $_POST[$field];
             }
           }
         }
         $errors = $obj->valid(false);
         if ($errors) {
           $content->set('error', $errors);
           $content->set('obj', $obj);
           goto screen;
         }
         $obj->update();
         $content = new Template('../tpl/message.tpl');
         $content->set('msg', "User Group $obj has been updated to database");
         goto screen;
       }
     break;
     case 'login':
       $self = false;
       if (!strcmp($_GET['i'], 'self') || $_GET['i'] == $lm->o_login->id) {
         $_GET['i'] = $lm->o_login->id;
         $self = true;
       }
       if (!$lm->o_login->cRight('USR', R_EDIT) && !$self) {
         throw new ExitException('Access Denied, please check your access rights!');
       }
       if (isset($_GET['i']) && !empty($_GET['i'])) {
         $suid = $_GET['i'];
       } else {
         $content = new Template('../tpl/error.tpl');
         $content->set('error', 'ID of User is not provided');
         goto screen;
       }
       $what = 'User';
       $obj = new Login($suid);
       if ($obj->fetchFromId()) {
         $content = new Template('../tpl/error.tpl');
         $content->set('error', 'User not found in the database');
         goto screen;
       }
       $what = 'User';
       $content = new Template('../tpl/form_user.tpl');
       $content->set('obj', $obj);
       $content->set('edit', true);
       $content->set('page', $page);
       $page['title'] .= $what;
       if (isset($_POST['submit'])) { /* clicked on the Edit button */
         $fields = array('fullname', 'email', 'phone', 'password', 'password_c', 'f_noalerts', 'f_admin', 'f_api');
         foreach($fields as $field) {
           if (!strncmp($field, 'f_', 2)) { // should be a checkbox
             if (isset($_POST[$field])) {
               $obj->{$field} = 1;
             } else {
               $obj->{$field} = 0;
             }
           } else {
             if ($_POST[$field]) {
               $obj->{$field} = $_POST[$field];
             }
           }
	     }

         $errors = $obj->valid(false);

         /* special case for username change */
         if ($lm->o_login->cRight('USR', R_EDIT)) { /* if you can modify users */
             if (isset($_POST['username'])) {
                 $new_username = $_POST['username'];
                 if (strcmp($obj->username, $new_username)) {
                     /* check if that username is not already taken */
                     $t = new Login();
                     $t->username = $new_username;
                     if (!$t->fetchFromField('username')) {
                         if (!$errors) {
                             $errors = array('Username already taken');
                         } else {
                             $errors[] = 'Username already taken';
                         }
                     } else {
                         $obj->username = $new_username;
                     }
                 }
             }
         }

         if ($errors) {
           $content->set('error', $errors);
           $content->set('obj', $obj);
           goto screen;
         }

         $lm = LoginCM::getInstance();
         if (!$obj->f_active && isset($_POST['f_active']) && !$lm->o_login->f_admin) {
             $content->set('error', 'You cannot set account as active as you aren\'t administrator yourself.');
             $content->set('obj', $obj);
             $obj->f_active = 0;
             goto screen;
         } else if (!$obj->f_active && isset($_POST['f_active']) && $lm->o_login->f_admin) {
             $obj->f_active = 1;
         }

         /* Must crypt the password */
         if (!empty($obj->password) && !empty($obj->password_c)) $obj->encryptPassword($obj->password); // If password_c is empty then password has not been modified
         $obj->update();
         $content = new Template('../tpl/message.tpl');
         $content->set('msg', "User $obj has been updated to database");
         $a_link = array(
                     array('href' => '/list/w/login',
                           'name' => 'Back to list of users',
                     ),
                  );
         goto screen;
       }
     break;
     default:
       $content = new Template('../tpl/error.tpl');
       $content->set('error', 'Unknown option or not yet implemented');
     break;
   }
 } else {
   $content = new Template('../tpl/error.tpl');
   $content->set('error', "I don't know what to list...");
 }

screen:
 $head->set('page', $page);
 if (isset($a_link)) $foot->set('a_link', $a_link);
 $index->set('head', $head);
 $index->set('content', $content);
 $index->set('foot', $foot);

 echo $index->fetch();

} catch (ExitException $e) {

    if ($e->type == 2) {
        echo Utils::getJSONError($e->getMessage());
    } else if ($e->type == EXIT_LOGIN) { /* login needed */
        LoginCM::requestLogin();
    } else {
        $h = Utils::getHTTPError($e->getMessage());
        echo $h->fetch();
    }

} catch (Exception $e) {
    /* @TODO: LOG EXCEPTION */
    $h = Utils::getHTTPError('Unexpected Exception');
    echo $h->fetch();
}
?>


text:
from enum import IntEnum
import sdl2

class Button(IntEnum):
    LEFT = sdl2.SDL_BUTTON_LEFT
    MIDDLE = sdl2.SDL_BUTTON_MIDDLE
    RIGHT = sdl2.SDL_BUTTON_RIGHT
    X1 = sdl2.SDL_BUTTON_X1
    X2 = sdl2.SDL_BUTTON_X2

class EventType(IntEnum):
    AUDIO_DEVICE_ADDED = sdl2.SDL_AUDIODEVICEADDED
    AUDIO_DEVICE_REMOVED = sdl2.SDL_AUDIODEVICEREMOVED
    CONTROLLER_AXIS_MOTION = sdl2.SDL_CONTROLLERAXISMOTION
    CONTROLLER_BUTTON_DOWN = sdl2.SDL_CONTROLLERBUTTONDOWN
    CONTROLLER_BUTTON_UP = sdl2.SDL_CONTROLLERBUTTONUP
    CONTROLLER_DEVICE_ADDED = sdl2.SDL_CONTROLLERDEVICEADDED
    CONTROLLER_DEVICE_REMOVED = sdl2.SDL_CONTROLLERDEVICEREMOVED
    CONTROLLER_DEVICE_REMAPPED = sdl2.SDL_CONTROLLERDEVICEREMAPPED
    # No dollar gesture: logic implemented in Vulk
    DROP_FILE = sdl2.SDL_DROPFILE
    DROP_TEXT = sdl2.SDL_DROPTEXT
    DROP_BEGIN = sdl2.SDL_DROPBEGIN
    DROP_COMPLETE = sdl2.SDL_DROPCOMPLETE
    FINGER_MOTION = sdl2.SDL_FINGERMOTION
    FINGER_DOWN = sdl2.SDL_FINGERDOWN
    FINGER_UP = sdl2.SDL_FINGERUP
    KEY_DOWN = sdl2.SDL_KEYDOWN
    KEY_UP = sdl2.SDL_KEYUP
    JOY_AXISMOTION = sdl2.SDL_JOYAXISMOTION
    JOY_BALLMOTION = sdl2.SDL_JOYBALLMOTION
    JOY_HATMOTION = sdl2.SDL_JOYHATMOTION
    JOY_BUTTONDOWN = sdl2.SDL_JOYBUTTONDOWN
    JOY_BUTTONUP = sdl2.SDL_JOYBUTTONUP
    JOY_DEVICEADDED = sdl2.SDL_JOYDEVICEADDED
    JOY_DEVICEREMOVED = sdl2.SDL_JOYDEVICEREMOVED
    MOUSE_MOTION = sdl2.SDL_MOUSEMOTION
    MOUSE_BUTTONDOWN = sdl2.SDL_MOUSEBUTTONDOWN
    MOUSE_BUTTONUP = sdl2.SDL_MOUSEBUTTONUP
    MOUSE_WHEEL = sdl2.SDL_MOUSEWHEEL
    QUIT = sdl2.SDL_QUIT
    # We create custom type for window events
    WINDOW = sdl2.SDL_WINDOWEVENT
    WINDOW_RESIZED = sdl2.SDL_WINDOWEVENT_RESIZED

class KeyCode(IntEnum):
    LEFT = sdl2.SDL_SCANCODE_LEFT
    RIGHT = sdl2.SDL_SCANCODE_RIGHT

class BaseEvent():
    def __init__(self, event):
        self.type = event.common.type
        self.timestamp = event.common.timestamp

class KeyboardEvent(BaseEvent):
    def __init__(self, event):
        '''Create keyboard event from `event`

        *Parameters:*

        - `event`: `SDL_KeyboardEvent`
        '''
        super().__init__(event)
        self.key = event.key.keysym.scancode

class MouseButtonEvent(BaseEvent):
    def __init__(self, event):
        '''Create mouse button event from `event`

        *Parameters:*

        - `event`: `SDL_MouseButtonEvent`
        '''
        super().__init__(event)
        self.x = event.motion.x
        self.y = event.motion.y
        self.button = event.button.button

class MouseMotionEvent(BaseEvent):
    def __init__(self, event):
        '''Create mouse motion event from `event`

        *Parameters:*

        - `event`: `SDL_MouseMotionEvent`
        '''
        super().__init__(event)
        self.x = event.motion.x
        self.y = event.motion.y
        self.xr = event.motion.xrel
        self.yr = event.motion.yrel

class QuitEvent(BaseEvent):
    pass

class WindowEvent():
    def __init__(self, event):
        self.type = event.window.event
        self.timestamp = event.common.timestamp

class WindowResizedEvent(WindowEvent):
    def __init__(self, event):
        """Create window resized event from `event`

        Args:
            event (SDL_WindowEvent)
        """
        super().__init__(event)
        self.width = event.window.data1
        self.height = event.window.data2

def window_event_builder(event):
    """Create widow event according to event"""
    if event.window.event == EventType.WINDOW_RESIZED:
        return WindowResizedEvent(event)

map_sdl_vulk = {
    EventType.KEY_UP: KeyboardEvent,
    EventType.KEY_DOWN: KeyboardEvent,
    EventType.MOUSE_BUTTONUP: MouseButtonEvent,
    EventType.MOUSE_BUTTONDOWN: MouseButtonEvent,
    EventType.MOUSE_MOTION: MouseMotionEvent,
    EventType.QUIT: QuitEvent,
    EventType.WINDOW: window_event_builder
}

def to_vulk_event(event):
    '''Convert a SDL2 event to a Vulk Event

    *Parameters:*

    - `event` : `SDL_Event`
    '''
    vulk_class = map_sdl_vulk.get(event.type)
    return vulk_class(event) if vulk_class else None


text:
package org.jasig.cas.services.web.factory;

import org.jasig.cas.services.web.beans.RegisteredServiceEditBean.FormData;
import org.jasig.services.persondir.IPersonAttributeDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Add all available attribute names to {@link FormData} for use by the edit service form.
 *
 * @author Daniel Frett
 * @since 4.2
 */
@Component("attributeFormDataPopulator")
public final class AttributeFormDataPopulator implements FormDataPopulator {
    /**
     * Instance of AttributeRegistry.
     */
    @NotNull
    private final IPersonAttributeDao personAttributeDao;

    /**
     * Default constructor.
     *
     * @param personAttributeDao the attribute source to retrieve available attribute names from.
     */
    @Autowired
    public AttributeFormDataPopulator(@Qualifier("attributeRepository") final IPersonAttributeDao personAttributeDao) {
        this.personAttributeDao = personAttributeDao;
    }

    @Override
    public void populateFormData(final FormData formData) {
        final List<String> possibleAttributeNames = new ArrayList<>(personAttributeDao.getPossibleUserAttributeNames());
        Collections.sort(possibleAttributeNames);
        formData.setAvailableAttributes(possibleAttributeNames);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
	<display-name>${project.name} v${project.version}.r${buildNumber}</display-name>

	<!-- <context-param> <param-name>org.basex.dbpath</param-name> <param-value>/Users/rpslpereira/BaseXData</param-value>
		</context-param> <context-param> <param-name>org.basex.lang</param-name>
		<param-value>English</param-value> </context-param> -->

	<!-- Stripes -->
	<!-- <filter> <display-name>Stripes Filter</display-name> <filter-name>StripesFilter</filter-name>
		<filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>
		<init-param> <param-name>ActionResolver.Packages</param-name> <param-value>uk.ac.ebi.arrayexpress.utils.saxon.search</param-value>
		</init-param> </filter> -->

	<filter>
		<filter-name>performancemonitorfilter</filter-name>
		<filter-class>uk.ac.ebi.arrayexpress.filters.PerformanceMonitorFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>performancemonitorfilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

	<!-- <filter-mapping> <filter-name>StripesFilter</filter-name> <url-pattern>*.jsp</url-pattern>
		<dispatcher>REQUEST</dispatcher> </filter-mapping> <filter-mapping> <filter-name>StripesFilter</filter-name>
		<servlet-name>StripesDispatcher</servlet-name> <dispatcher>REQUEST</dispatcher>
		</filter-mapping> <servlet> <servlet-name>StripesDispatcher</servlet-name>
		<servlet-class>net.sourceforge.stripes.controller.DispatcherServlet</servlet-class>
		<load-on-startup>1</load-on-startup> </servlet> -->
	<!-- Stripes -->

	<servlet>
		<description>ArrayExpress Application Status Servlet</description>
		<servlet-name>StatusServlet</servlet-name>
		<servlet-class>uk.ac.ebi.arrayexpress.servlets.StatusServlet</servlet-class>
	</servlet>
	  <servlet>
        <description>ArrayExpress Error Pages Servlet</description>
        <servlet-name>ErrorServlet</servlet-name>
        <servlet-class>uk.ac.ebi.arrayexpress.servlets.ErrorServlet</servlet-class>
    </servlet>
	<servlet>
		<description>ArrayExpress Experiments Query Servlet</description>
		<servlet-name>QueryServlet</servlet-name>
		<servlet-class>uk.ac.ebi.arrayexpress.servlets.QueryServlet</servlet-class>
	</servlet>
	<servlet>
		<description>ArrayExpress Experiments Query Page Writer Servlet</description>
		<servlet-name>QueryPageWriterServlet</servlet-name>
		<servlet-class>uk.ac.ebi.arrayexpress.servlets.QueryPageWriterServlet</servlet-class>
	</servlet>
	<servlet>
		<description>ArrayExpress Experiments Query Page Writer Servlet for Flat Files</description>
		<servlet-name>QueryPageWriterFileServlet</servlet-name>
		<servlet-class>uk.ac.ebi.arrayexpress.servlets.QueryPageWriterFileServlet</servlet-class>
	</servlet>
	<servlet>
		<description>ArrayExpress Flat File Transformation Servlet</description>
		<servlet-name>FlatFileTransformationServlet</servlet-name>
		<servlet-class>uk.ac.ebi.arrayexpress.servlets.FlatFileTransformationServlet</servlet-class>
	</servlet>
	<servlet>
		<description>ArrayExpress File Download Servlet</description>
		<servlet-name>FileDownloadServlet</servlet-name>
		<servlet-class>uk.ac.ebi.arrayexpress.servlets.FileDownloadServlet</servlet-class>
	</servlet>
	<servlet>
		<description>ArrayExpress Archived File Download Servlet</description>
		<servlet-name>ArchivedFileDownloadServlet</servlet-name>
		<servlet-class>uk.ac.ebi.arrayexpress.servlets.ArchivedFileDownloadServlet</servlet-class>
	</servlet>
	<servlet>
		<description>ArrayExpress Data Control Servlet</description>
		<servlet-name>ControlServlet</servlet-name>
		<servlet-class>uk.ac.ebi.arrayexpress.servlets.ControlServlet</servlet-class>
	</servlet>
	<servlet>
		<description>ArrayExpress Feedback Reporter Servlet</description>
		<servlet-name>FeedbackServlet</servlet-name>
		<servlet-class>uk.ac.ebi.arrayexpress.servlets.FeedbackServlet</servlet-class>
	</servlet>
	<servlet>
		<description>ArrayExpress Authentication Servlet</description>
		<servlet-name>AuthServlet</servlet-name>
		<servlet-class>uk.ac.ebi.arrayexpress.servlets.AuthServlet</servlet-class>
	</servlet>
	<servlet>
		<description>ArrayExpress HTTP Proxy Servlet</description>
		<servlet-name>HttpProxyServlet</servlet-name>
		<servlet-class>uk.ac.ebi.arrayexpress.servlets.HttpProxyServlet</servlet-class>
	</servlet>
	<servlet>
		<description>ArrayExpress Data Lookup Servlet</description>
		<servlet-name>LookupServlet</servlet-name>
		<servlet-class>uk.ac.ebi.arrayexpress.servlets.LookupServlet</servlet-class>
	</servlet>

	<servlet>
		<description>BioSamples MetaData Servlet</description>
		<servlet-name>MetaDataServlet</servlet-name>
		<servlet-class>uk.ac.ebi.arrayexpress.servlets.MetaDataServlet</servlet-class>
	</servlet>

	<!-- Stripes -->
	<!-- <servlet-mapping> <servlet-name>StripesDispatcher</servlet-name> <url-pattern>*.action</url-pattern>
		</servlet-mapping> -->
	<!-- Stripes -->

	<servlet-mapping>
		<servlet-name>StatusServlet</servlet-name>
		<url-pattern>/servlets/status</url-pattern>
	</servlet-mapping>
	 <servlet-mapping>
        <servlet-name>ErrorServlet</servlet-name>
        <url-pattern>/servlets/error/*</url-pattern>
    </servlet-mapping>
	<servlet-mapping>
		<servlet-name>MetaDataServlet</servlet-name>
		<url-pattern>/servlets/metadata</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>QueryServlet</servlet-name>
		<url-pattern>/servlets/query/*</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>QueryPageWriterServlet</servlet-name>
		<url-pattern>/servlets/querypagewriter/*</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>QueryPageWriterFileServlet</servlet-name>
		<url-pattern>/servlets/querypagewriterfile/*</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>FlatFileTransformationServlet</servlet-name>
		<url-pattern>/servlets/fftransform/*</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>FileDownloadServlet</servlet-name>
		<url-pattern>/servlets/download/*</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>ArchivedFileDownloadServlet</servlet-name>
		<url-pattern>/servlets/archdownload/*</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>ControlServlet</servlet-name>
		<url-pattern>/servlets/control/*</url-pattern>
	</servlet-mapping>

	<servlet-mapping>
		<servlet-name>FeedbackServlet</servlet-name>
		<url-pattern>/feedback</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>AuthServlet</servlet-name>
		<url-pattern>/auth</url-pattern>
	</servlet-mapping>

	<servlet-mapping>
		<servlet-name>HttpProxyServlet</servlet-name>
		<url-pattern>/servlets/proxy/*</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>LookupServlet</servlet-name>
		<url-pattern>/servlets/lookup/*</url-pattern>
	</servlet-mapping>
	<filter>
		<filter-name>AccessLoggingSuppressFilter</filter-name>
		<filter-class>uk.ac.ebi.arrayexpress.servlets.AccessLoggingSuppressFilter</filter-class>
	</filter>
	<filter>
		<filter-name>UrlRewriteFilter</filter-name>
		<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
		<init-param>
			<param-name>confPath</param-name>
			<param-value>/WEB-INF/urlrewrite.xml</param-value>
		</init-param>
		<init-param>
			<param-name>confReloadCheckInterval</param-name>
			<param-value>-1</param-value>
		</init-param>
		<!-- <init-param> <param-name>logLevel</param-name> <param-value>slf4j</param-value>
			</init-param> -->
		<init-param>
			<param-name>logLevel</param-name>
			<param-value>log4j</param-value>
		</init-param>
	</filter>
	<filter-mapping>
		<filter-name>AccessLoggingSuppressFilter</filter-name>
		<url-pattern>/servlets/status</url-pattern>
	</filter-mapping>
	<filter-mapping>
		<filter-name>UrlRewriteFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	<listener>
		<description>The class implementing the "ServletContextListener" interface and thus receiving the
            "contextInitialized" and "contextDestroyed" messages indicating that the application
            is being de/initialized.
        </description>
		<listener-class>uk.ac.ebi.arrayexpress.AEInterfaceApplication</listener-class>
	</listener>

	<session-config>
		<session-timeout>1</session-timeout>
	</session-config>
	<error-page>
        <error-code>400</error-code>
        <location>/servlets/error/400</location>
    </error-page>
    <error-page>
        <error-code>403</error-code>
        <location>/servlets/error/403</location>
    </error-page>
    <error-page>
        <error-code>404</error-code>
        <location>/servlets/error/404</location>
    </error-page>
    <error-page>
        <error-code>500</error-code>
        <location>/servlets/error/500</location>
    </error-page>
</web-app>