text:
(function () {
    'use strict';

    angular
        .module('youtube-player', [])
        .constant('YT_event', {
            STOP: 0,
            PLAY: 1,
            PAUSE: 2,
            MOVE: 3,
            STATUS_CHANGE: 4,
            PLAYER_READY: 5
        })
        .directive('youtube', youtube)
        .controller('YouTubeController', YouTubeController)
    ;

    YouTubeController.$inject = [
        '$scope',
        '$interval',
        'YT_event'
    ];

    function YouTubeController($scope, $interval, YT_event) {
        var vm = this;

        vm.progress = 0;
        vm.duration = 0;
        vm.interval = undefined;
        vm.YT_event = YT_event;
        vm.playerStatus = "NOT PLAYING";
        vm.currentTime = 0;

        vm.move = move;
        vm.sendControlEvent = sendControlEvent;

        $scope.$on(YT_event.STATUS_CHANGE, function (event, data) {
            var player = data.player;

            vm.playerStatus = data.message;
            vm.currentTime = player.getCurrentTime();

            showProgress(player);
        });

        $scope.$on(YT_event.PLAYER_READY, function (event, data) {
            vm.duration = data.duration;
        });

        function sendControlEvent(ctrlEvent, args) {
            if (args) {
                $scope.$broadcast(ctrlEvent, args);
            } else {
                $scope.$broadcast(ctrlEvent);
            }
        }

        function move(event) {
            var bar = event.target.className === 'progress-bar progress-bar-info'
                ? event.target.parentNode
                : event.target;

            var currentTime = event.offsetX / bar.offsetWidth * vm.duration;

            vm.progress = currentTime / vm.duration * 100;
            sendControlEvent(YT_event.MOVE, {currentTime: currentTime});
        }

        function showProgress(player) {
            if (vm.currentTime !== null) {
                vm.progress = vm.currentTime / vm.duration * 100;
            }
            if (vm.playerStatus === 'PLAYING') {
                vm.interval = $interval(function () {
                    vm.progress = player.getCurrentTime() / vm.duration * 100;
                }, 500);
            } else {
                if (angular.isDefined(vm.interval)) {
                    $interval.cancel(vm.interval);
                    vm.interval = undefined;
                }
            }
        }
    }

    function youtube(YouTubeLoader, YT_event) {
        return {
            restrict: "E",
            templateUrl: '/src/views/youtube/video.view.html',
            controller: 'YouTubeController',
            controllerAs: 'vm',

            scope: {
                videoid: "@",
                height: "@",
                width: "@",
                currentTime: "@"
            },

            link: function (scope, element, attrs, $rootScope) {
                var tag = document.createElement('script');
                tag.src = "https://www.youtube.com/iframe_api";
                var firstScriptTag = document.getElementsByTagName('script')[0];
                firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

                var player;
                var playerElement = element.children()[0].getElementsByClassName("player")[0];

                YouTubeLoader.whenLoaded().then(function () {
                    player = new YT.Player(playerElement, {
                        playerVars: {
                            autoplay: 0,
                            html5: 1,
                            theme: "light",
                            modesbranding: 0,
                            color: "white",
                            iv_load_policy: 3,
                            showinfo: 0,
                            controls: 0
                        },

                        height: scope.height,
                        width: scope.width,
                        videoId: scope.videoid,
                        scenes: scope.scenes,

                        events: {
                            'onReady': function (event) {
                                var data = {
                                    duration: player.getDuration()
                                };

                                scope.$apply(function () {
                                    scope.$emit(YT_event.PLAYER_READY, data);
                                });
                            },
                            'onStateChange': function (event) {
                                var data = {
                                    message: "",
                                    player: player
                                };

                                switch (event.data) {
                                    case YT.PlayerState.PLAYING:
                                        data.message = "PLAYING";
                                        break;
                                    case YT.PlayerState.ENDED:
                                        data.message = "ENDED";
                                        break;
                                    case YT.PlayerState.UNSTARTED:
                                        data.message = "NOT PLAYING";
                                        break;
                                    case YT.PlayerState.PAUSED:
                                        data.message = "PAUSED";
                                        break;
                                }

                                scope.$apply(function () {
                                    scope.$emit(YT_event.STATUS_CHANGE, data);
                                });
                            }
                        }
                    });
                });

                scope.$watch('height + width', function (newValue, oldValue) {
                    if (newValue == oldValue) {
                        return;
                    }

                    player.setSize(scope.width, scope.height);
                });

                scope.$watch('videoid', function (newValue, oldValue) {
                    if (newValue == oldValue) {
                        return;
                    }

                    player.cueVideoById(scope.videoid);
                });

                scope.$watch('currentTime', function (newValue, oldValue) {
                    if (newValue == oldValue) {
                        return;
                    }

                    if (newValue !== null) {
                        player.seekTo(newValue);
                    }
                });

                scope.$on(YT_event.STOP, function () {
                    player.stopVideo();
                    scope.currentTime = 0;
                });

                scope.$on(YT_event.PLAY, function () {
                    player.playVideo();
                    scope.currentTime = null;
                });

                scope.$on(YT_event.PAUSE, function () {
                    player.pauseVideo();
                    scope.currentTime = player.getCurrentTime();
                });

                scope.$on(YT_event.MOVE, function (event, args) {
                    scope.currentTime = args.currentTime;
                });
            }
        }
    }

})();


text:
angular.module( 'ngBoilerplate')
/**
 * And of course we define a controller for our route.
 */
.controller( 'SidebarCtrl', ['$scope', '$state', 'UserService', function SidebarCtrl( $scope, $state, UserService ) {
  $scope.user = UserService.get();

  $scope.$on('user:update', function() {
    $scope.user = UserService.get();
  });

}])

;

redpajama_set_name: RedPajamaGithub


text:
const webpackMerge = require('webpack-merge')
const webpack = require('webpack')
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin');

const commonConfig = require('./base.config.js')

module.exports = function () {
  return webpackMerge(commonConfig(), {
    devtool: 'source-map',
    plugins: [
      new webpack.NoEmitOnErrorsPlugin(),

      new FriendlyErrorsPlugin(),

      new webpack.DefinePlugin({
        NODE_ENV: JSON.stringify('development'),
      })
    ]
  })
}


text:
package in

import (
	gcsresource "github.com/frodenas/gcs-resource"
)

type InRequest struct {
	Source  gcsresource.Source  `json:"source"`
	Version gcsresource.Version `json:"version"`
	Params  Params              `json:"params"`
}

type Params struct {
	SkipDownload string `json:"skip_download"`
	Unpack       bool   `json:"unpack"`
}

type InResponse struct {
	Version  gcsresource.Version        `json:"version"`
	Metadata []gcsresource.MetadataPair `json:"metadata"`
}


text:
package com.loca.addressbook.userinterface.commands;

import com.loca.addressbook.exceptions.InvalidCommandParameterException;
import com.loca.addressbook.userinterface.ConsolePrinter;
import com.sun.org.apache.bcel.internal.generic.NEW;

import java.util.List;

public class HelpCommand implements Command {
    private static final String NEW_LINE = "\n";
    private static final String TAB = "\t";
    private List<String> parameters;
    private ConsolePrinter consolePrinter;

    public HelpCommand (ConsolePrinter consolePrinter, List<String> parameters) {
        this.parameters = parameters;
        this.consolePrinter = consolePrinter;
    }

    @Override
    public void execute() throws InvalidCommandParameterException {
        validate();
        String helpText = makeHelpText();
        showHelpText(helpText);

    }

    private String makeHelpText() {
        String helpText;
        helpText = "Add" + TAB + TAB + "Adds a contact to the local addressbook" + NEW_LINE +
                "Delete" + TAB + "Deletes a contact with the given UUID" + NEW_LINE +
                "Search" + TAB + "Search for contacts by \"Starts With\"" + NEW_LINE +
                "List" + TAB + "Lists all the contacts" + NEW_LINE +
                "Help" + TAB + "Lists the help menu" + NEW_LINE +
                "Quit" + TAB + "Quits the application.";
        return helpText;
    }

    private void showHelpText(String helpText) {
        consolePrinter.print(helpText);
    }

    private void validate() throws InvalidCommandParameterException {
        if (parameters.size() != 0) {
            throw new InvalidCommandParameterException(parameters.size(), 0);
        }
    }

}


text:
@implementation AccHealthDataOuter
@synthesize dataArrays;
- (instancetype)init
{
    if (self = [super init])
    {
        dataArrays = [[NSMutableArray alloc] init];
    }
    return self;
}

- (void)clearData
{
    [self.dataArrays removeAllObjects];
}

- (void)addData:(NSDictionary*)dictionary
{
    [self.dataArrays addObject:dictionary];
}

+ (AccHealthDataOuter*)shareInstance
{
    static AccHealthDataOuter *shareInstance;

    @synchronized(self)
    {
        if (!shareInstance)
            shareInstance = [[AccHealthDataOuter alloc] init];

        return shareInstance;
    }
}

@end


text:
namespace blink {

namespace {
const char stepIntoV8MethodName[] = "stepIntoStatement";
const char stepOutV8MethodName[] = "stepOutOfFunction";
static const char v8AsyncTaskEventEnqueue[] = "enqueue";
static const char v8AsyncTaskEventWillHandle[] = "willHandle";
static const char v8AsyncTaskEventDidHandle[] = "didHandle";

inline v8::Local<v8::Boolean> v8Boolean(bool value, v8::Isolate* isolate)
{
    return value ? v8::True(isolate) : v8::False(isolate);
}

}

static bool inLiveEditScope = false;

v8::MaybeLocal<v8::Value> V8Debugger::callDebuggerMethod(const char* functionName, int argc, v8::Local<v8::Value> argv[])
{
    v8::MicrotasksScope microtasks(m_isolate, v8::MicrotasksScope::kDoNotRunMicrotasks);
    v8::Local<v8::Object> debuggerScript = m_debuggerScript.Get(m_isolate);
    v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(debuggerScript->Get(toV8StringInternalized(m_isolate, functionName)));
    DCHECK(m_isolate->InContext());
    return function->Call(m_isolate->GetCurrentContext(), debuggerScript, argc, argv);
}

V8Debugger::V8Debugger(v8::Isolate* isolate, V8InspectorImpl* inspector)
    : m_isolate(isolate)
    , m_inspector(inspector)
    , m_lastContextId(0)
    , m_enableCount(0)
    , m_breakpointsActivated(true)
    , m_runningNestedMessageLoop(false)
    , m_ignoreScriptParsedEventsCounter(0)
    , m_maxAsyncCallStackDepth(0)
{
}

V8Debugger::~V8Debugger()
{
}

void V8Debugger::enable()
{
    if (m_enableCount++)
        return;
    DCHECK(!enabled());
    v8::HandleScope scope(m_isolate);
    v8::Debug::SetDebugEventListener(m_isolate, &V8Debugger::v8DebugEventCallback, v8::External::New(m_isolate, this));
    m_debuggerContext.Reset(m_isolate, v8::Debug::GetDebugContext(m_isolate));
    compileDebuggerScript();
}

void V8Debugger::disable()
{
    if (--m_enableCount)
        return;
    DCHECK(enabled());
    clearBreakpoints();
    m_debuggerScript.Reset();
    m_debuggerContext.Reset();
    allAsyncTasksCanceled();
    v8::Debug::SetDebugEventListener(m_isolate, nullptr);
}

bool V8Debugger::enabled() const
{
    return !m_debuggerScript.IsEmpty();
}

// static
int V8Debugger::contextId(v8::Local<v8::Context> context)
{
    v8::Local<v8::Value> data = context->GetEmbedderData(static_cast<int>(v8::Context::kDebugIdIndex));
    if (data.IsEmpty() || !data->IsString())
        return 0;
    String16 dataString = toProtocolString(data.As<v8::String>());
    if (dataString.isEmpty())
        return 0;
    size_t commaPos = dataString.find(",");
    if (commaPos == kNotFound)
        return 0;
    size_t commaPos2 = dataString.find(",", commaPos + 1);
    if (commaPos2 == kNotFound)
        return 0;
    return dataString.substring(commaPos + 1, commaPos2 - commaPos - 1).toInt();
}

// static
int V8Debugger::getGroupId(v8::Local<v8::Context> context)
{
    v8::Local<v8::Value> data = context->GetEmbedderData(static_cast<int>(v8::Context::kDebugIdIndex));
    if (data.IsEmpty() || !data->IsString())
        return 0;
    String16 dataString = toProtocolString(data.As<v8::String>());
    if (dataString.isEmpty())
        return 0;
    size_t commaPos = dataString.find(",");
    if (commaPos == kNotFound)
        return 0;
    return dataString.substring(0, commaPos).toInt();
}

void V8Debugger::getCompiledScripts(int contextGroupId, std::vector<std::unique_ptr<V8DebuggerScript>>& result)
{
    v8::HandleScope scope(m_isolate);
    v8::MicrotasksScope microtasks(m_isolate, v8::MicrotasksScope::kDoNotRunMicrotasks);
    v8::Local<v8::Object> debuggerScript = m_debuggerScript.Get(m_isolate);
    DCHECK(!debuggerScript->IsUndefined());
    v8::Local<v8::Function> getScriptsFunction = v8::Local<v8::Function>::Cast(debuggerScript->Get(toV8StringInternalized(m_isolate, "getScripts")));
    v8::Local<v8::Value> argv[] = { v8::Integer::New(m_isolate, contextGroupId) };
    v8::Local<v8::Value> value;
    if (!getScriptsFunction->Call(debuggerContext(), debuggerScript, PROTOCOL_ARRAY_LENGTH(argv), argv).ToLocal(&value))
        return;
    DCHECK(value->IsArray());
    v8::Local<v8::Array> scriptsArray = v8::Local<v8::Array>::Cast(value);
    result.reserve(scriptsArray->Length());
    for (unsigned i = 0; i < scriptsArray->Length(); ++i) {
        v8::Local<v8::Object> scriptObject = v8::Local<v8::Object>::Cast(scriptsArray->Get(v8::Integer::New(m_isolate, i)));
        result.push_back(wrapUnique(new V8DebuggerScript(m_isolate, scriptObject, inLiveEditScope)));
    }
}

String16 V8Debugger::setBreakpoint(const String16& sourceID, const ScriptBreakpoint& scriptBreakpoint, int* actualLineNumber, int* actualColumnNumber, bool interstatementLocation)
{
    v8::HandleScope scope(m_isolate);
    v8::Context::Scope contextScope(debuggerContext());

    v8::Local<v8::Object> info = v8::Object::New(m_isolate);
    info->Set(toV8StringInternalized(m_isolate, "sourceID"), toV8String(m_isolate, sourceID));
    info->Set(toV8StringInternalized(m_isolate, "lineNumber"), v8::Integer::New(m_isolate, scriptBreakpoint.lineNumber));
    info->Set(toV8StringInternalized(m_isolate, "columnNumber"), v8::Integer::New(m_isolate, scriptBreakpoint.columnNumber));
    info->Set(toV8StringInternalized(m_isolate, "interstatementLocation"), v8Boolean(interstatementLocation, m_isolate));
    info->Set(toV8StringInternalized(m_isolate, "condition"), toV8String(m_isolate, scriptBreakpoint.condition));

    v8::Local<v8::Function> setBreakpointFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.Get(m_isolate)->Get(toV8StringInternalized(m_isolate, "setBreakpoint")));
    v8::Local<v8::Value> breakpointId = v8::Debug::Call(debuggerContext(), setBreakpointFunction, info).ToLocalChecked();
    if (!breakpointId->IsString())
        return "";
    *actualLineNumber = info->Get(toV8StringInternalized(m_isolate, "lineNumber"))->Int32Value();
    *actualColumnNumber = info->Get(toV8StringInternalized(m_isolate, "columnNumber"))->Int32Value();
    return toProtocolString(breakpointId.As<v8::String>());
}

void V8Debugger::removeBreakpoint(const String16& breakpointId)
{
    v8::HandleScope scope(m_isolate);
    v8::Context::Scope contextScope(debuggerContext());

    v8::Local<v8::Object> info = v8::Object::New(m_isolate);
    info->Set(toV8StringInternalized(m_isolate, "breakpointId"), toV8String(m_isolate, breakpointId));

    v8::Local<v8::Function> removeBreakpointFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.Get(m_isolate)->Get(toV8StringInternalized(m_isolate, "removeBreakpoint")));
    v8::Debug::Call(debuggerContext(), removeBreakpointFunction, info).ToLocalChecked();
}

void V8Debugger::clearBreakpoints()
{
    v8::HandleScope scope(m_isolate);
    v8::Context::Scope contextScope(debuggerContext());

    v8::Local<v8::Function> clearBreakpoints = v8::Local<v8::Function>::Cast(m_debuggerScript.Get(m_isolate)->Get(toV8StringInternalized(m_isolate, "clearBreakpoints")));
    v8::Debug::Call(debuggerContext(), clearBreakpoints).ToLocalChecked();
}

void V8Debugger::setBreakpointsActivated(bool activated)
{
    if (!enabled()) {
        NOTREACHED();
        return;
    }
    v8::HandleScope scope(m_isolate);
    v8::Context::Scope contextScope(debuggerContext());

    v8::Local<v8::Object> info = v8::Object::New(m_isolate);
    info->Set(toV8StringInternalized(m_isolate, "enabled"), v8::Boolean::New(m_isolate, activated));
    v8::Local<v8::Function> setBreakpointsActivated = v8::Local<v8::Function>::Cast(m_debuggerScript.Get(m_isolate)->Get(toV8StringInternalized(m_isolate, "setBreakpointsActivated")));
    v8::Debug::Call(debuggerContext(), setBreakpointsActivated, info).ToLocalChecked();

    m_breakpointsActivated = activated;
}

V8Debugger::PauseOnExceptionsState V8Debugger::getPauseOnExceptionsState()
{
    DCHECK(enabled());
    v8::HandleScope scope(m_isolate);
    v8::Context::Scope contextScope(debuggerContext());

    v8::Local<v8::Value> argv[] = { v8::Undefined(m_isolate) };
    v8::Local<v8::Value> result = callDebuggerMethod("pauseOnExceptionsState", 0, argv).ToLocalChecked();
    return static_cast<V8Debugger::PauseOnExceptionsState>(result->Int32Value());
}

void V8Debugger::setPauseOnExceptionsState(PauseOnExceptionsState pauseOnExceptionsState)
{
    DCHECK(enabled());
    v8::HandleScope scope(m_isolate);
    v8::Context::Scope contextScope(debuggerContext());

    v8::Local<v8::Value> argv[] = { v8::Int32::New(m_isolate, pauseOnExceptionsState) };
    callDebuggerMethod("setPauseOnExceptionsState", 1, argv);
}

void V8Debugger::setPauseOnNextStatement(bool pause)
{
    if (m_runningNestedMessageLoop)
        return;
    if (pause)
        v8::Debug::DebugBreak(m_isolate);
    else
        v8::Debug::CancelDebugBreak(m_isolate);
}

bool V8Debugger::canBreakProgram()
{
    if (!m_breakpointsActivated)
        return false;
    return m_isolate->InContext();
}

void V8Debugger::breakProgram()
{
    if (isPaused()) {
        DCHECK(!m_runningNestedMessageLoop);
        v8::Local<v8::Value> exception;
        v8::Local<v8::Array> hitBreakpoints;
        handleProgramBreak(m_pausedContext, m_executionState, exception, hitBreakpoints);
        return;
    }

    if (!canBreakProgram())
        return;

    v8::HandleScope scope(m_isolate);
    v8::Local<v8::Function> breakFunction;
    if (!V8_FUNCTION_NEW_REMOVE_PROTOTYPE(m_isolate->GetCurrentContext(), &V8Debugger::breakProgramCallback, v8::External::New(m_isolate, this), 0).ToLocal(&breakFunction))
        return;
    v8::Debug::Call(debuggerContext(), breakFunction).ToLocalChecked();
}

void V8Debugger::continueProgram()
{
    if (isPaused())
        m_inspector->client()->quitMessageLoopOnPause();
    m_pausedContext.Clear();
    m_executionState.Clear();
}

void V8Debugger::stepIntoStatement()
{
    DCHECK(isPaused());
    DCHECK(!m_executionState.IsEmpty());
    v8::HandleScope handleScope(m_isolate);
    v8::Local<v8::Value> argv[] = { m_executionState };
    callDebuggerMethod(stepIntoV8MethodName, 1, argv);
    continueProgram();
}

void V8Debugger::stepOverStatement()
{
    DCHECK(isPaused());
    DCHECK(!m_executionState.IsEmpty());
    v8::HandleScope handleScope(m_isolate);
    v8::Local<v8::Value> argv[] = { m_executionState };
    callDebuggerMethod("stepOverStatement", 1, argv);
    continueProgram();
}

void V8Debugger::stepOutOfFunction()
{
    DCHECK(isPaused());
    DCHECK(!m_executionState.IsEmpty());
    v8::HandleScope handleScope(m_isolate);
    v8::Local<v8::Value> argv[] = { m_executionState };
    callDebuggerMethod(stepOutV8MethodName, 1, argv);
    continueProgram();
}

void V8Debugger::clearStepping()
{
    DCHECK(enabled());
    v8::HandleScope scope(m_isolate);
    v8::Context::Scope contextScope(debuggerContext());

    v8::Local<v8::Value> argv[] = { v8::Undefined(m_isolate) };
    callDebuggerMethod("clearStepping", 0, argv);
}

bool V8Debugger::setScriptSource(const String16& sourceID, v8::Local<v8::String> newSource, bool preview, ErrorString* error, Maybe<protocol::Runtime::ExceptionDetails>* exceptionDetails, JavaScriptCallFrames* newCallFrames, Maybe<bool>* stackChanged)
{
    class EnableLiveEditScope {
    public:
        explicit EnableLiveEditScope(v8::Isolate* isolate) : m_isolate(isolate)
        {
            v8::Debug::SetLiveEditEnabled(m_isolate, true);
            inLiveEditScope = true;
        }
        ~EnableLiveEditScope()
        {
            v8::Debug::SetLiveEditEnabled(m_isolate, false);
            inLiveEditScope = false;
        }
    private:
        v8::Isolate* m_isolate;
    };

    DCHECK(enabled());
    v8::HandleScope scope(m_isolate);

    std::unique_ptr<v8::Context::Scope> contextScope;
    if (!isPaused())
        contextScope = wrapUnique(new v8::Context::Scope(debuggerContext()));

    v8::Local<v8::Value> argv[] = { toV8String(m_isolate, sourceID), newSource, v8Boolean(preview, m_isolate) };

    v8::Local<v8::Value> v8result;
    {
        EnableLiveEditScope enableLiveEditScope(m_isolate);
        v8::TryCatch tryCatch(m_isolate);
        tryCatch.SetVerbose(false);
        v8::MaybeLocal<v8::Value> maybeResult = callDebuggerMethod("liveEditScriptSource", 3, argv);
        if (tryCatch.HasCaught()) {
            v8::Local<v8::Message> message = tryCatch.Message();
            if (!message.IsEmpty())
                *error = toProtocolStringWithTypeCheck(message->Get());
            else
                *error = "Unknown error.";
            return false;
        }
        v8result = maybeResult.ToLocalChecked();
    }
    DCHECK(!v8result.IsEmpty());
    v8::Local<v8::Object> resultTuple = v8result->ToObject(m_isolate);
    int code = static_cast<int>(resultTuple->Get(0)->ToInteger(m_isolate)->Value());
    switch (code) {
    case 0:
        {
            *stackChanged = resultTuple->Get(1)->BooleanValue();
            // Call stack may have changed after if the edited function was on the stack.
            if (!preview && isPaused()) {
                JavaScriptCallFrames frames = currentCallFrames();
                newCallFrames->swap(frames);
            }
            return true;
        }
    // Compile error.
    case 1:
        {
            *exceptionDetails = protocol::Runtime::ExceptionDetails::create()
                .setText(toProtocolStringWithTypeCheck(resultTuple->Get(2)))
                .setScriptId(String16("0"))
                .setLineNumber(resultTuple->Get(3)->ToInteger(m_isolate)->Value() - 1)
                .setColumnNumber(resultTuple->Get(4)->ToInteger(m_isolate)->Value() - 1).build();
            return false;
        }
    }
    *error = "Unknown error.";
    return false;
}

JavaScriptCallFrames V8Debugger::currentCallFrames(int limit)
{
    if (!m_isolate->InContext())
        return JavaScriptCallFrames();
    v8::Local<v8::Value> currentCallFramesV8;
    if (m_executionState.IsEmpty()) {
        v8::Local<v8::Function> currentCallFramesFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.Get(m_isolate)->Get(toV8StringInternalized(m_isolate, "currentCallFrames")));
        currentCallFramesV8 = v8::Debug::Call(debuggerContext(), currentCallFramesFunction, v8::Integer::New(m_isolate, limit)).ToLocalChecked();
    } else {
        v8::Local<v8::Value> argv[] = { m_executionState, v8::Integer::New(m_isolate, limit) };
        currentCallFramesV8 = callDebuggerMethod("currentCallFrames", PROTOCOL_ARRAY_LENGTH(argv), argv).ToLocalChecked();
    }
    DCHECK(!currentCallFramesV8.IsEmpty());
    if (!currentCallFramesV8->IsArray())
        return JavaScriptCallFrames();
    v8::Local<v8::Array> callFramesArray = currentCallFramesV8.As<v8::Array>();
    JavaScriptCallFrames callFrames;
    for (size_t i = 0; i < callFramesArray->Length(); ++i) {
        v8::Local<v8::Value> callFrameValue;
        if (!callFramesArray->Get(debuggerContext(), i).ToLocal(&callFrameValue))
            return JavaScriptCallFrames();
        if (!callFrameValue->IsObject())
            return JavaScriptCallFrames();
        v8::Local<v8::Object> callFrameObject = callFrameValue.As<v8::Object>();
        callFrames.push_back(JavaScriptCallFrame::create(debuggerContext(), v8::Local<v8::Object>::Cast(callFrameObject)));
    }
    return callFrames;
}

static V8Debugger* toV8Debugger(v8::Local<v8::Value> data)
{
    void* p = v8::Local<v8::External>::Cast(data)->Value();
    return static_cast<V8Debugger*>(p);
}

void V8Debugger::breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    DCHECK_EQ(info.Length(), 2);
    V8Debugger* thisPtr = toV8Debugger(info.Data());
    if (!thisPtr->enabled())
        return;
    v8::Local<v8::Context> pausedContext = thisPtr->m_isolate->GetCurrentContext();
    v8::Local<v8::Value> exception;
    v8::Local<v8::Array> hitBreakpoints;
    thisPtr->handleProgramBreak(pausedContext, v8::Local<v8::Object>::Cast(info[0]), exception, hitBreakpoints);
}

void V8Debugger::handleProgramBreak(v8::Local<v8::Context> pausedContext, v8::Local<v8::Object> executionState, v8::Local<v8::Value> exception, v8::Local<v8::Array> hitBreakpointNumbers, bool isPromiseRejection)
{
    // Don't allow nested breaks.
    if (m_runningNestedMessageLoop)
        return;

    V8DebuggerAgentImpl* agent = m_inspector->enabledDebuggerAgentForGroup(getGroupId(pausedContext));
    if (!agent)
        return;

    std::vector<String16> breakpointIds;
    if (!hitBreakpointNumbers.IsEmpty()) {
        breakpointIds.reserve(hitBreakpointNumbers->Length());
        for (size_t i = 0; i < hitBreakpointNumbers->Length(); i++) {
            v8::Local<v8::Value> hitBreakpointNumber = hitBreakpointNumbers->Get(i);
            DCHECK(!hitBreakpointNumber.IsEmpty() && hitBreakpointNumber->IsInt32());
            breakpointIds.push_back(String16::fromInteger(hitBreakpointNumber->Int32Value()));
        }
    }

    m_pausedContext = pausedContext;
    m_executionState = executionState;
    V8DebuggerAgentImpl::SkipPauseRequest result = agent->didPause(pausedContext, exception, breakpointIds, isPromiseRejection);
    if (result == V8DebuggerAgentImpl::RequestNoSkip) {
        m_runningNestedMessageLoop = true;
        int groupId = getGroupId(pausedContext);
        DCHECK(groupId);
        m_inspector->client()->runMessageLoopOnPause(groupId);
        // The agent may have been removed in the nested loop.
        agent = m_inspector->enabledDebuggerAgentForGroup(getGroupId(pausedContext));
        if (agent)
            agent->didContinue();
        m_runningNestedMessageLoop = false;
    }
    m_pausedContext.Clear();
    m_executionState.Clear();

    if (result == V8DebuggerAgentImpl::RequestStepFrame) {
        v8::Local<v8::Value> argv[] = { executionState };
        callDebuggerMethod("stepFrameStatement", 1, argv);
    } else if (result == V8DebuggerAgentImpl::RequestStepInto) {
        v8::Local<v8::Value> argv[] = { executionState };
        callDebuggerMethod(stepIntoV8MethodName, 1, argv);
    } else if (result == V8DebuggerAgentImpl::RequestStepOut) {
        v8::Local<v8::Value> argv[] = { executionState };
        callDebuggerMethod(stepOutV8MethodName, 1, argv);
    }
}

void V8Debugger::v8DebugEventCallback(const v8::Debug::EventDetails& eventDetails)
{
    V8Debugger* thisPtr = toV8Debugger(eventDetails.GetCallbackData());
    thisPtr->handleV8DebugEvent(eventDetails);
}

v8::Local<v8::Value> V8Debugger::callInternalGetterFunction(v8::Local<v8::Object> object, const char* functionName)
{
    v8::MicrotasksScope microtasks(m_isolate, v8::MicrotasksScope::kDoNotRunMicrotasks);
    v8::Local<v8::Value> getterValue = object->Get(toV8StringInternalized(m_isolate, functionName));
    DCHECK(!getterValue.IsEmpty() && getterValue->IsFunction());
    return v8::Local<v8::Function>::Cast(getterValue)->Call(m_isolate->GetCurrentContext(), object, 0, 0).ToLocalChecked();
}

void V8Debugger::handleV8DebugEvent(const v8::Debug::EventDetails& eventDetails)
{
    if (!enabled())
        return;
    v8::DebugEvent event = eventDetails.GetEvent();
    if (event != v8::AsyncTaskEvent && event != v8::Break && event != v8::Exception && event != v8::AfterCompile && event && event != v8::CompileError)
        return;

    v8::Local<v8::Context> eventContext = eventDetails.GetEventContext();
    DCHECK(!eventContext.IsEmpty());

    if (event == v8::AsyncTaskEvent) {
        v8::HandleScope scope(m_isolate);
        handleV8AsyncTaskEvent(eventContext, eventDetails.GetExecutionState(), eventDetails.GetEventData());
        return;
    }

    V8DebuggerAgentImpl* agent = m_inspector->enabledDebuggerAgentForGroup(getGroupId(eventContext));
    if (agent) {
        v8::HandleScope scope(m_isolate);
        if (m_ignoreScriptParsedEventsCounter == 0 && (event == v8::AfterCompile || event == v8::CompileError)) {
            v8::Context::Scope contextScope(debuggerContext());
            v8::Local<v8::Value> argv[] = { eventDetails.GetEventData() };
            v8::Local<v8::Value> value = callDebuggerMethod("getAfterCompileScript", 1, argv).ToLocalChecked();
            DCHECK(value->IsObject());
            v8::Local<v8::Object> scriptObject = v8::Local<v8::Object>::Cast(value);
            agent->didParseSource(wrapUnique(new V8DebuggerScript(m_isolate, scriptObject, inLiveEditScope)), event == v8::AfterCompile);
        } else if (event == v8::Exception) {
            v8::Local<v8::Object> eventData = eventDetails.GetEventData();
            v8::Local<v8::Value> exception = callInternalGetterFunction(eventData, "exception");
            v8::Local<v8::Value> promise = callInternalGetterFunction(eventData, "promise");
            bool isPromiseRejection = !promise.IsEmpty() && promise->IsObject();
            handleProgramBreak(eventContext, eventDetails.GetExecutionState(), exception, v8::Local<v8::Array>(), isPromiseRejection);
        } else if (event == v8::Break) {
            v8::Local<v8::Value> argv[] = { eventDetails.GetEventData() };
            v8::Local<v8::Value> hitBreakpoints = callDebuggerMethod("getBreakpointNumbers", 1, argv).ToLocalChecked();
            DCHECK(hitBreakpoints->IsArray());
            handleProgramBreak(eventContext, eventDetails.GetExecutionState(), v8::Local<v8::Value>(), hitBreakpoints.As<v8::Array>());
        }
    }
}

void V8Debugger::handleV8AsyncTaskEvent(v8::Local<v8::Context> context, v8::Local<v8::Object> executionState, v8::Local<v8::Object> eventData)
{
    if (!m_maxAsyncCallStackDepth)
        return;

    String16 type = toProtocolStringWithTypeCheck(callInternalGetterFunction(eventData, "type"));
    String16 name = toProtocolStringWithTypeCheck(callInternalGetterFunction(eventData, "name"));
    int id = callInternalGetterFunction(eventData, "id")->ToInteger(m_isolate)->Value();
    // The scopes for the ids are defined by the eventData.name namespaces. There are currently two namespaces: "Object." and "Promise.".
    void* ptr = reinterpret_cast<void*>(id * 4 + (name[0] == 'P' ? 2 : 0) + 1);
    if (type == v8AsyncTaskEventEnqueue)
        asyncTaskScheduled(name, ptr, false);
    else if (type == v8AsyncTaskEventWillHandle)
        asyncTaskStarted(ptr);
    else if (type == v8AsyncTaskEventDidHandle)
        asyncTaskFinished(ptr);
    else
        NOTREACHED();
}

V8StackTraceImpl* V8Debugger::currentAsyncCallChain()
{
    if (!m_currentStacks.size())
        return nullptr;
    return m_currentStacks.back().get();
}

void V8Debugger::compileDebuggerScript()
{
    if (!m_debuggerScript.IsEmpty()) {
        NOTREACHED();
        return;
    }

    v8::HandleScope scope(m_isolate);
    v8::Context::Scope contextScope(debuggerContext());

    v8::Local<v8::String> scriptValue = v8::String::NewFromUtf8(m_isolate, DebuggerScript_js, v8::NewStringType::kInternalized, sizeof(DebuggerScript_js)).ToLocalChecked();
    v8::Local<v8::Value> value;
    if (!m_inspector->compileAndRunInternalScript(debuggerContext(), scriptValue).ToLocal(&value)) {
        NOTREACHED();
        return;
    }
    DCHECK(value->IsObject());
    m_debuggerScript.Reset(m_isolate, value.As<v8::Object>());
}

v8::Local<v8::Context> V8Debugger::debuggerContext() const
{
    DCHECK(!m_debuggerContext.IsEmpty());
    return m_debuggerContext.Get(m_isolate);
}

v8::MaybeLocal<v8::Value> V8Debugger::functionScopes(v8::Local<v8::Function> function)
{
    if (!enabled()) {
        NOTREACHED();
        return v8::Local<v8::Value>::New(m_isolate, v8::Undefined(m_isolate));
    }
    v8::Local<v8::Value> argv[] = { function };
    v8::Local<v8::Value> scopesValue;
    if (!callDebuggerMethod("getFunctionScopes", 1, argv).ToLocal(&scopesValue) || !scopesValue->IsArray())
        return v8::MaybeLocal<v8::Value>();
    v8::Local<v8::Array> scopes = scopesValue.As<v8::Array>();
    v8::Local<v8::Context> context = m_debuggerContext.Get(m_isolate);
    if (!markAsInternal(context, scopes, V8InternalValueType::kScopeList))
        return v8::MaybeLocal<v8::Value>();
    if (!markArrayEntriesAsInternal(context, scopes, V8InternalValueType::kScope))
        return v8::MaybeLocal<v8::Value>();
    if (!scopes->SetPrototype(context, v8::Null(m_isolate)).FromMaybe(false))
        return v8::Undefined(m_isolate);
    return scopes;
}

v8::MaybeLocal<v8::Array> V8Debugger::internalProperties(v8::Local<v8::Context> context, v8::Local<v8::Value> value)
{
    v8::Local<v8::Array> properties;
    if (!v8::Debug::GetInternalProperties(m_isolate, value).ToLocal(&properties))
        return v8::MaybeLocal<v8::Array>();
    if (value->IsFunction()) {
        v8::Local<v8::Function> function = value.As<v8::Function>();
        v8::Local<v8::Value> location = functionLocation(context, function);
        if (location->IsObject()) {
            properties->Set(properties->Length(), toV8StringInternalized(m_isolate, "[[FunctionLocation]]"));
            properties->Set(properties->Length(), location);
        }
        if (function->IsGeneratorFunction()) {
            properties->Set(properties->Length(), toV8StringInternalized(m_isolate, "[[IsGenerator]]"));
            properties->Set(properties->Length(), v8::True(m_isolate));
        }
    }
    if (!enabled())
        return properties;
    if (value->IsMap() || value->IsWeakMap() || value->IsSet() || value->IsWeakSet() || value->IsSetIterator() || value->IsMapIterator()) {
        v8::Local<v8::Value> entries = collectionEntries(context, v8::Local<v8::Object>::Cast(value));
        if (entries->IsArray()) {
            properties->Set(properties->Length(), toV8StringInternalized(m_isolate, "[[Entries]]"));
            properties->Set(properties->Length(), entries);
        }
    }
    if (value->IsGeneratorObject()) {
        v8::Local<v8::Value> location = generatorObjectLocation(v8::Local<v8::Object>::Cast(value));
        if (location->IsObject()) {
            properties->Set(properties->Length(), toV8StringInternalized(m_isolate, "[[GeneratorLocation]]"));
            properties->Set(properties->Length(), location);
        }
    }
    if (value->IsFunction()) {
        v8::Local<v8::Function> function = value.As<v8::Function>();
        v8::Local<v8::Value> boundFunction = function->GetBoundFunction();
        v8::Local<v8::Value> scopes;
        if (boundFunction->IsUndefined() && functionScopes(function).ToLocal(&scopes)) {
            properties->Set(properties->Length(), toV8StringInternalized(m_isolate, "[[Scopes]]"));
            properties->Set(properties->Length(), scopes);
        }
    }
    return properties;
}

v8::Local<v8::Value> V8Debugger::collectionEntries(v8::Local<v8::Context> context, v8::Local<v8::Object> object)
{
    if (!enabled()) {
        NOTREACHED();
        return v8::Undefined(m_isolate);
    }
    v8::Local<v8::Value> argv[] = { object };
    v8::Local<v8::Value> entriesValue = callDebuggerMethod("getCollectionEntries", 1, argv).ToLocalChecked();
    if (!entriesValue->IsArray())
        return v8::Undefined(m_isolate);
    v8::Local<v8::Array> entries = entriesValue.As<v8::Array>();
    if (!markArrayEntriesAsInternal(context, entries, V8InternalValueType::kEntry))
        return v8::Undefined(m_isolate);
    if (!entries->SetPrototype(context, v8::Null(m_isolate)).FromMaybe(false))
        return v8::Undefined(m_isolate);
    return entries;
}

v8::Local<v8::Value> V8Debugger::generatorObjectLocation(v8::Local<v8::Object> object)
{
    if (!enabled()) {
        NOTREACHED();
        return v8::Null(m_isolate);
    }
    v8::Local<v8::Value> argv[] = { object };
    v8::Local<v8::Value> location = callDebuggerMethod("getGeneratorObjectLocation", 1, argv).ToLocalChecked();
    if (!location->IsObject())
        return v8::Null(m_isolate);
    v8::Local<v8::Context> context = m_debuggerContext.Get(m_isolate);
    if (!markAsInternal(context, v8::Local<v8::Object>::Cast(location), V8InternalValueType::kLocation))
        return v8::Null(m_isolate);
    return location;
}

v8::Local<v8::Value> V8Debugger::functionLocation(v8::Local<v8::Context> context, v8::Local<v8::Function> function)
{
    int scriptId = function->ScriptId();
    if (scriptId == v8::UnboundScript::kNoScriptId)
        return v8::Null(m_isolate);
    int lineNumber = function->GetScriptLineNumber();
    int columnNumber = function->GetScriptColumnNumber();
    if (lineNumber == v8::Function::kLineOffsetNotFound || columnNumber == v8::Function::kLineOffsetNotFound)
        return v8::Null(m_isolate);
    v8::Local<v8::Object> location = v8::Object::New(m_isolate);
    if (!location->Set(context, toV8StringInternalized(m_isolate, "scriptId"), toV8String(m_isolate, String16::fromInteger(scriptId))).FromMaybe(false))
        return v8::Null(m_isolate);
    if (!location->Set(context, toV8StringInternalized(m_isolate, "lineNumber"), v8::Integer::New(m_isolate, lineNumber)).FromMaybe(false))
        return v8::Null(m_isolate);
    if (!location->Set(context, toV8StringInternalized(m_isolate, "columnNumber"), v8::Integer::New(m_isolate, columnNumber)).FromMaybe(false))
        return v8::Null(m_isolate);
    if (!markAsInternal(context, location, V8InternalValueType::kLocation))
        return v8::Null(m_isolate);
    return location;
}

bool V8Debugger::isPaused()
{
    return !m_pausedContext.IsEmpty();
}

std::unique_ptr<V8StackTraceImpl> V8Debugger::createStackTrace(v8::Local<v8::StackTrace> stackTrace)
{
    int contextGroupId = m_isolate->InContext() ? getGroupId(m_isolate->GetCurrentContext()) : 0;
    return V8StackTraceImpl::create(this, contextGroupId, stackTrace, V8StackTraceImpl::maxCallStackSizeToCapture);
}

int V8Debugger::markContext(const V8ContextInfo& info)
{
    DCHECK(info.context->GetIsolate() == m_isolate);
    int contextId = ++m_lastContextId;
    String16 debugData = String16::fromInteger(info.contextGroupId) + "," + String16::fromInteger(contextId) + "," + info.auxData;
    v8::Context::Scope contextScope(info.context);
    info.context->SetEmbedderData(static_cast<int>(v8::Context::kDebugIdIndex), toV8String(m_isolate, debugData));
    return contextId;
}

void V8Debugger::setAsyncCallStackDepth(V8DebuggerAgentImpl* agent, int depth)
{
    if (depth <= 0)
        m_maxAsyncCallStackDepthMap.erase(agent);
    else
        m_maxAsyncCallStackDepthMap[agent] = depth;

    int maxAsyncCallStackDepth = 0;
    for (const auto& pair : m_maxAsyncCallStackDepthMap) {
        if (pair.second > maxAsyncCallStackDepth)
            maxAsyncCallStackDepth = pair.second;
    }

    if (m_maxAsyncCallStackDepth == maxAsyncCallStackDepth)
        return;
    m_maxAsyncCallStackDepth = maxAsyncCallStackDepth;
    if (!maxAsyncCallStackDepth)
        allAsyncTasksCanceled();
}

void V8Debugger::asyncTaskScheduled(const String16& taskName, void* task, bool recurring)
{
    if (!m_maxAsyncCallStackDepth)
        return;
    v8::HandleScope scope(m_isolate);
    int contextGroupId = m_isolate->InContext() ? getGroupId(m_isolate->GetCurrentContext()) : 0;
    std::unique_ptr<V8StackTraceImpl> chain = V8StackTraceImpl::capture(this, contextGroupId, V8StackTraceImpl::maxCallStackSizeToCapture, taskName);
    if (chain) {
        m_asyncTaskStacks[task] = std::move(chain);
        if (recurring)
            m_recurringTasks.insert(task);
    }
}

void V8Debugger::asyncTaskCanceled(void* task)
{
    if (!m_maxAsyncCallStackDepth)
        return;
    m_asyncTaskStacks.erase(task);
    m_recurringTasks.erase(task);
}

void V8Debugger::asyncTaskStarted(void* task)
{
    if (!m_maxAsyncCallStackDepth)
        return;
    m_currentTasks.push_back(task);
    AsyncTaskToStackTrace::iterator stackIt = m_asyncTaskStacks.find(task);
    // Needs to support following order of events:
    // - asyncTaskScheduled
    //   <-- attached here -->
    // - asyncTaskStarted
    // - asyncTaskCanceled <-- canceled before finished
    //   <-- async stack requested here -->
    // - asyncTaskFinished
    std::unique_ptr<V8StackTraceImpl> stack;
    if (stackIt != m_asyncTaskStacks.end() && stackIt->second)
        stack = stackIt->second->cloneImpl();
    m_currentStacks.push_back(std::move(stack));
}

void V8Debugger::asyncTaskFinished(void* task)
{
    if (!m_maxAsyncCallStackDepth)
        return;
    // We could start instrumenting half way and the stack is empty.
    if (!m_currentStacks.size())
        return;

    DCHECK(m_currentTasks.back() == task);
    m_currentTasks.pop_back();

    m_currentStacks.pop_back();
    if (m_recurringTasks.find(task) == m_recurringTasks.end())
        m_asyncTaskStacks.erase(task);
}

void V8Debugger::allAsyncTasksCanceled()
{
    m_asyncTaskStacks.clear();
    m_recurringTasks.clear();
    m_currentStacks.clear();
    m_currentTasks.clear();
}

void V8Debugger::muteScriptParsedEvents()
{
    ++m_ignoreScriptParsedEventsCounter;
}

void V8Debugger::unmuteScriptParsedEvents()
{
    --m_ignoreScriptParsedEventsCounter;
    DCHECK_GE(m_ignoreScriptParsedEventsCounter, 0);
}

std::unique_ptr<V8StackTraceImpl> V8Debugger::captureStackTrace(bool fullStack)
{
    if (!m_isolate->InContext())
        return nullptr;

    v8::HandleScope handles(m_isolate);
    int contextGroupId = getGroupId(m_isolate->GetCurrentContext());
    if (!contextGroupId)
        return nullptr;

    size_t stackSize = fullStack ? V8StackTraceImpl::maxCallStackSizeToCapture : 1;
    if (m_inspector->enabledRuntimeAgentForGroup(contextGroupId))
        stackSize = V8StackTraceImpl::maxCallStackSizeToCapture;

    return V8StackTraceImpl::capture(this, contextGroupId, stackSize);
}

} // namespace blink


text:
package org.apache.catalina;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.ServletException;

/**
 * A Comet filter, similar to regular filters, performs filtering tasks on either
 * the request to a resource (a Comet servlet), or on the response from a resource, or both.
 *

 * Filters perform filtering in the doFilterEvent method. Every Filter has access to
 * a FilterConfig object from which it can obtain its initialization parameters, a
 * reference to the ServletContext which it can use, for example, to load resources
 * needed for filtering tasks.
 *

 * Filters are configured in the deployment descriptor of a web application
 *

 * Examples that have been identified for this design are

 * 1) Authentication Filters

 * 2) Logging and Auditing Filters

 * 3) Image conversion Filters

 * 4) Data compression Filters

 * 5) Encryption Filters

 * 6) Tokenizing Filters

 * 7) Filters that trigger resource access events

 * 8) XSL/T filters

 * 9) Mime-type chain Filter

 *

 *
 * @author Remy Maucherat
 * @author Filip Hanik
 */
public interface CometFilter extends Filter {

    /**
     * The doFilterEvent method of the CometFilter is called by the container
     * each time a request/response pair is passed through the chain due
     * to a client event for a resource at the end of the chain. The CometFilterChain passed in to this
     * method allows the Filter to pass on the event to the next entity in the
     * chain.

     * A typical implementation of this method would follow the following pattern:-

     * 1. Examine the request

     * 2. Optionally wrap the request object contained in the event with a custom implementation to
     * filter content or headers for input filtering and pass a CometEvent instance containing
     * the wrapped request to the next filter

     * 3. Optionally wrap the response object contained in the event with a custom implementation to
     * filter content or headers for output filtering and pass a CometEvent instance containing
     * the wrapped request to the next filter

     * 4. a) Either invoke the next entity in the chain using the CometFilterChain object (chain.doFilterEvent()),

     * 4. b) or not pass on the request/response pair to the next entity in the filter chain to block the event processing

     * 5. Directly set fields on the response after invocation of the next entity in the filter chain.
     *
     * @param event the event that is being processed. Another event may be passed along the chain.
     * @param chain
     * @throws IOException
     * @throws ServletException
     */
    public void doFilterEvent(CometEvent event, CometFilterChain chain)
        throws IOException, ServletException;

}


text:
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/d29413b8-767c-4f21-ae6b-6a627d402643/mini.png)](https://insight.sensiolabs.com/projects/d29413b8-767c-4f21-ae6b-6a627d402643)

J'ai utilisé le thème Clean Blog disponible sur le site startbootstrap.com pour réaliser la partie front de ce blog
Si vous voulez voir le code sur GitHub, cliquez sur le lien : [https://www.github.com/Maxxxiimus92/p5_blog](https://www.github.com/Maxxxiimus92/p5_blog)

I used the theme Clean Blog available on the website startbootstrap.com
If you want to see the code on GitHub, go here : [https://www.github.com/Maxxxiimus92/p5_blog](https://www.github.com/Maxxxiimus92/p5_blog)

## Installation

Pour utiliser ce blog, il faut suivre les étapes suivantes :
* Créer une base de données et importer le fichier projet_blog.sql situé dans le dossier db
* Entrez vos identifiants de connexion à la base de données dans le fichier dev.ini situé dans le dossier config
* Pour le formulaire de Contact, entrez votre email dans le fichier mail/contact_me.php
* Amusez-vous avec ce blog !

To use this blog, you must follow this steps :
* Create a database and import the projet_blog.sql file located in the db folder
* Enter your connexion settings in the dev.ini file located in the config folder
* To use the Contact Form, enter your email in the mail/contact_me.php file
* Have fun using this blog !

## About Clean Blog Theme

Start Bootstrap is an open source library of free Bootstrap templates and themes. All of the free templates and themes on Start Bootstrap are released under the MIT license, which means you can use them for any purpose, even for commercial projects.

* https://startbootstrap.com
* https://twitter.com/SBootstrap

Start Bootstrap was created by and is maintained by **[David Miller](http://davidmiller.io/)**, Owner of [Blackrock Digital](http://blackrockdigital.io/).

* http://davidmiller.io
* https://twitter.com/davidmillerskt
* https://github.com/davidtmiller

Start Bootstrap is based on the [Bootstrap](http://getbootstrap.com/) framework created by [Mark Otto](https://twitter.com/mdo) and [Jacob Thorton](https://twitter.com/fat).

## Copyright and License of the Clean Blog Theme

Copyright 2013-2017 Blackrock Digital LLC. Code released under the [MIT](https://github.com/BlackrockDigital/startbootstrap-clean-blog/blob/gh-pages/LICENSE) license.


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

namespace Ex07NNumbersSum
{
    /*7. Write a program that gets a number n and after that gets more n numbers and calculates and prints their sum. */
    class Ex07NNumbersSumClass
    {
        static void Main(string[] args)
        {
            Console.Write("Insert the number of addends: ");
            uint n = uint.Parse(Console.ReadLine());

            Console.WriteLine("Insert the addends: ");
            double sum = 0;
            for (int i = 0; i < n; i++)
            {
                sum += double.Parse(Console.ReadLine());
            }

            Console.WriteLine("The sum is {0}: ", sum);
        }
    }
}


text:
from vtk import *

source = vtkRandomGraphSource()
source.SetIncludeEdgeWeights(True)

degree = vtkVertexDegree()
degree.AddInputConnection(source.GetOutputPort())

view = vtkGraphLayoutView()
view.AddRepresentationFromInputConnection(degree.GetOutputPort())
view.SetVertexLabelArrayName("VertexDegree")
view.SetVertexLabelVisibility(True)
view.SetVertexColorArrayName("VertexDegree")
view.SetColorVertices(True)
view.SetEdgeLabelArrayName("edge weight")
view.SetEdgeLabelVisibility(True)
view.SetEdgeColorArrayName("edge weight")
view.SetColorEdges(True)
view.SetLayoutStrategyToSimple2D()

theme = vtkViewTheme.CreateMellowTheme()
theme.SetLineWidth(4)
view.ApplyViewTheme(theme)
theme.FastDelete()

view.GetRenderWindow().SetSize(600, 600)
view.ResetCamera()
view.Render()

view.GetInteractor().Start()


text:
#ifndef TIMESTAMP_H
#define TIMESTAMP_H
/*
Szymon Rusinkiewicz
Princeton University

timestamp.h
Wrapper around system-specific timestamps.
*/

#ifdef WIN32

# define WIN32_LEAN_AND_MEAN
# include <limits.h>
# include <windows.h>
# define usleep(x) Sleep((x)/1000)

  struct timestamp { LARGE_INTEGER t; };

  static inline double LI2d(const LARGE_INTEGER &li)
  {
	// Work around random compiler bugs...
	double d = *(unsigned *)(&(li.HighPart));
	d *= 65536.0 * 65536.0;
	d += *(unsigned *)(&(li.LowPart));
	return d;
  }

  static inline float operator - (const timestamp &t1, const timestamp &t2)
  {
	static LARGE_INTEGER PerformanceFrequency;
	int status = QueryPerformanceFrequency(&PerformanceFrequency);
	if (status == 0) return 1.0f;

	return float((LI2d(t1.t) - LI2d(t2.t)) / LI2d(PerformanceFrequency));
  }

  static inline timestamp now()
  {
	timestamp t;
	QueryPerformanceCounter(&t.t);
	return t;
  }

#else

# include <sys/time.h>
# include <unistd.h>

  typedef struct timeval timestamp;

  static inline float operator - (const timestamp &t1, const timestamp &t2)
  {
	return (float)(t1.tv_sec  - t2.tv_sec) +
	       1.0e-6f*(t1.tv_usec - t2.tv_usec);
  }

  static inline timestamp now()
  {
	timestamp t;
	gettimeofday(&t, 0);
	return t;
  }

#endif

#endif


text:
from __future__ import absolute_import, division, print_function
from guitool_ibeis.__PYQT__ import QtCore, QtGui
from guitool_ibeis.__PYQT__ import QtWidgets
from guitool_ibeis import api_item_view
from guitool_ibeis.guitool_decorators import signal_, slot_
import utool

(print, rrr, profile) = utool.inject2(__name__, '[APITableView]', DEBUG=False)

# If you need to set the selected index try:
# AbstractItemView::setCurrentIndex
# AbstractItemView::scrollTo
# AbstractItemView::keyboardSearch

API_VIEW_BASE = QtWidgets.QTableView
#API_VIEW_BASE = QtWidgets.QAbstractItemView

class APITableView(API_VIEW_BASE):
    """
    Table view of API data.
    Implicitly inherits from APIItemView
    """
    rows_updated = signal_(str, int)
    contextMenuClicked = signal_(QtCore.QModelIndex, QtCore.QPoint)
    API_VIEW_BASE = API_VIEW_BASE

    def __init__(view, parent=None):
        # Qt Inheritance
        API_VIEW_BASE.__init__(view, parent)
        # Implicitly inject common APIItemView functions
        api_item_view.injectviewinstance(view)
        view._init_itemview_behavior()
        view._init_table_behavior()
        view._init_header_behavior()
        view.col_hidden_list = []
        # Context menu
        view.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        view.customContextMenuRequested.connect(view.on_customMenuRequested)
        view._init_api_item_view()

    #---------------
    # Initialization
    #---------------

    def _init_table_behavior(view):
        """ Table behavior

        SeeAlso:
            api_item_view._init_itemview_behavior
        """
        # Allow sorting by column
        view.setCornerButtonEnabled(False)
        view.setShowGrid(True)

        view.setIconSize(QtCore.QSize(64, 64))

    def _init_header_behavior(view):
        """ Header behavior

        CommandLine:
            python -m guitool_ibeis.api_item_widget --test-simple_api_item_widget --show
            python -m guitool_ibeis.api_table_view --test-_init_header_behavior --show

        Example:
            >>> # ENABLE_DOCTEST
            >>> from guitool_ibeis.api_table_view import *  # NOQA
            >>> import guitool_ibeis
            >>> guitool_ibeis.ensure_qapp()
            >>> view = APITableView()
            >>> view._init_header_behavior()
        """
        # Row Headers
        verticalHeader = view.verticalHeader()
        verticalHeader.setVisible(False)
        #verticalHeader.setSortIndicatorShown(True)
        verticalHeader.setHighlightSections(True)
        try:
            verticalHeader.setResizeMode(QtWidgets.QHeaderView.Interactive)
            verticalHeader.setMovable(False)
        except AttributeError:
            verticalHeader.setSectionResizeMode(QtWidgets.QHeaderView.Interactive)
            verticalHeader.setSectionsMovable(False)
        # TODO: get good estimate if there are thumbnails
        #verticalHeader.setDefaultSectionSize(256)

        # Column headers
        horizontalHeader = view.horizontalHeader()
        horizontalHeader.setVisible(True)
        horizontalHeader.setStretchLastSection(True)
        horizontalHeader.setSortIndicatorShown(True)
        horizontalHeader.setHighlightSections(True)
        # Column Sizes
        # DO NOT USE ResizeToContents. IT MAKES THINGS VERY SLOW
        #horizontalHeader.setResizeMode(QtWidgets.QHeaderView.ResizeToContents)
        #horizontalHeader.setResizeMode(QtWidgets.QHeaderView.Stretch)
        try:
            horizontalHeader.setResizeMode(QtWidgets.QHeaderView.Interactive)
            horizontalHeader.setMovable(True)
        except AttributeError:
            horizontalHeader.setSectionResizeMode(QtWidgets.QHeaderView.Interactive)
            horizontalHeader.setSectionsMovable(True)
        #horizontalHeader.setCascadingSectionResizes(True)
        # Columns moveable

    #---------------
    # Qt Overrides
    #---------------

    def setModel(view, model):
        """ QtOverride: Returns item delegate for this index """
        api_item_view.setModel(view, model)

    def keyPressEvent(view, event):
        """
        CommandLine:
            python -m guitool_ibeis.api_item_widget --test-simple_api_item_widget --show
            python -m guitool_ibeis.api_table_view --test-keyPressEvent --show

        Example:
            >>> # ENABLE_DOCTEST
            >>> from guitool_ibeis.api_table_view import *  # NOQA
            >>> import guitool_ibeis
            >>> guitool_ibeis.ensure_qapp()
            >>> view = APITableView()
            >>> view._init_header_behavior()
        """
        return api_item_view.keyPressEvent(view, event)

        # # TODO: can this be in api_item_view?
        # assert isinstance(event, QtGui.QKeyEvent)
        # view.API_VIEW_BASE.keyPressEvent(view, event)
        # if event.matches(QtGui.QKeySequence.Copy):
        #     #print('Received Ctrl+C in View')
        #     view.copy_selection_to_clipboard()
        # #print ('[view] keyPressEvent: %s' % event.key())
        # for func in view.registered_keypress_funcs:
        #     func(view, event)
        # for key, func in view.registered_single_keys:
        #     #print(key)
        #     if event.key() == key:
        #         func(view, event)

    def mouseMoveEvent(view, event):
        assert isinstance(event, QtGui.QMouseEvent)
        API_VIEW_BASE.mouseMoveEvent(view, event)

    def mousePressEvent(view, event):
        assert isinstance(event, QtGui.QMouseEvent)
        API_VIEW_BASE.mousePressEvent(view, event)
        #print('no editing')
        view.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)

    def mouseReleaseEvent(view, event):
        assert isinstance(event, QtGui.QMouseEvent)
        #print('editing ok')
        view.setEditTriggers(view._defaultEditTriggers)
        API_VIEW_BASE.mouseReleaseEvent(view, event)

    #---------------
    # Slots
    #---------------

    @slot_(str, int)
    def on_rows_updated(view, tblname, num):
        # re-emit the model signal
        view.rows_updated.emit(tblname, num)

    @slot_(QtCore.QPoint)
    def on_customMenuRequested(view, pos):
        index = view.indexAt(pos)
        view.contextMenuClicked.emit(index, pos)


text:
static BOOL WINAPI _new_kernel32__CreateProcessW(LPCTSTR lpApplicationName, LPTSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCTSTR lpCurrentDirectory, LPSTARTUPINFO lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) {

	// return (*_original_kernel32__CreateProcessW)(lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation);

	BOOL retV;
	BOOL isSuspended;

	isSuspended = ((dwCreationFlags & CREATE_SUSPENDED) == CREATE_SUSPENDED);
	retV = XYO::Win::Inject::Process::createProcessW(
	    (WCHAR *)lpApplicationName,
	    (WCHAR *)lpCommandLine,
	    lpProcessAttributes,
	    lpThreadAttributes,
	    bInheritHandles,
	    dwCreationFlags | CREATE_SUSPENDED,
	    lpEnvironment,
	    (WCHAR *)lpCurrentDirectory,
	    (LPSTARTUPINFOW)lpStartupInfo,
	    lpProcessInformation,
	    thisModuleFileName);

	if (retV == TRUE) {
		if (!isSuspended) {
			ResumeThread(lpProcessInformation->hThread);
		};
	};

	return retV;
};


text:
package com.ucloud.ulive.example.widget;

import android.annotation.TargetApi;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.os.Build;
import android.support.v4.view.GestureDetectorCompat;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.ScaleGestureDetector.SimpleOnScaleGestureListener;
import android.view.View;
import android.view.WindowManager;

import com.ucloud.ulive.UCameraSessionListener;
import com.ucloud.ulive.USize;
import com.ucloud.ulive.UVideoProfile;
import com.ucloud.ulive.example.AVOption;
import com.ucloud.ulive.example.utils.DensityUtil;

import java.util.List;

public class FloatingWindow extends LiveCameraView implements View.OnTouchListener {

    private static final float MIN_SCALE_FACTOR = 0.75f;
    private static final float MAX_SCALE_FACTOR = 2.0f;
    private static final int DEFAULT_MARGIN = 20;
    private static final int DEFAULT_WIDTH = 3 * 40;
    private static final int DEFAULT_HEIGHT = 4 * 40;

    private int previewWidth = 0;
    private int previewHeight = 0;

    private int origWidth = 0;
    private int origHeight = 0;
    private float scaleFactor = 1.0f;

    private final WindowManager windowManager;
    private WindowManager.LayoutParams windowParams;

    private final Point displaySize = new Point();
    private final Point origPosition = new Point();

    private final Point initialDown = new Point();
    private final Point startPosition = new Point();
    private final Point currentPosition = new Point();

    private final GestureDetectorCompat gestureDetector;
    private final ScaleGestureDetector scaleDetector;

    private boolean isHide = false;
    private final AVOption avOption;

    public FloatingWindow(Context context, AVOption avOption) {
        super(context);
        this.avOption = avOption;
        avOption.videoResolution = UVideoProfile.Resolution.RATIO_4x3.ordinal(); //默认Camera预览大小写死成了4:3
        windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
        initWindow();
        gestureDetector = new GestureDetectorCompat(context, new GestureListener());
        scaleDetector = new ScaleGestureDetector(context, new ScaleListener());
        addCameraSessionListener(cameraSessionListener);
        setOnTouchListener(this);
        init(avOption);
    }

    private void initWindow() {
        windowManager.getDefaultDisplay().getSize(displaySize);
        windowParams = new WindowManager.LayoutParams();
        windowParams.gravity = Gravity.START | Gravity.TOP;

        int orientation = avOption.videoCaptureOrientation;
        if (orientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
            origWidth = DensityUtil.dip2px(getContext(), DEFAULT_WIDTH);
            origHeight = DensityUtil.dip2px(getContext(), DEFAULT_HEIGHT);
            origPosition.x = displaySize.x - origWidth - DEFAULT_MARGIN;
            origPosition.y = DEFAULT_MARGIN;
        }
        else {
            origWidth = DensityUtil.dip2px(getContext(), DEFAULT_HEIGHT);
            origHeight = DensityUtil.dip2px(getContext(), DEFAULT_WIDTH);
            origPosition.x = DEFAULT_MARGIN;
            origPosition.y = DEFAULT_MARGIN;
        }

        windowParams.type = WindowManager.LayoutParams.TYPE_TOAST;
        windowParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
                | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
                | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
                | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH
                | WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
        windowParams.format = PixelFormat.TRANSLUCENT;
        windowParams.width = origWidth;
        windowParams.height = origHeight;
        windowParams.x = origPosition.x;
        windowParams.y = origPosition.y;
    }

    public void show() {
        windowManager.addView(this, windowParams);
        startPreview();
        setShowMode(Mode.ORIGIN);
        isHide = false;
    }

    public void hide() {
        if (!isHide) {
            onDestroy();
            windowManager.removeView(this);
            isHide = true;
        }
    }

    @Override
    public void onConfigurationChanged(Configuration newConfiguration) {
        windowManager.getDefaultDisplay().getSize(displaySize);
        if (newConfiguration.orientation == Configuration.ORIENTATION_PORTRAIT) {
            avOption.videoCaptureOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
        }
        else {
            avOption.videoCaptureOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
        }
        hide();
        initWindow();
        init(avOption);
        if (avOption.videoCaptureOrientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
            setAspectRatio(((float) previewWidth) / previewHeight);
        }
        else {
            setAspectRatio(((float) previewHeight) / previewWidth);
        }
        show();
    }

    @Override
    public boolean onTouch(View view, MotionEvent event) {
        scaleDetector.onTouchEvent(event);
        gestureDetector.onTouchEvent(event);

        switch (event.getActionMasked()) {
            case MotionEvent.ACTION_DOWN:
                startPosition.set(windowParams.x, windowParams.y);
                initialDown.set((int) event.getRawX(), (int) event.getRawY());
                break;
            case MotionEvent.ACTION_CANCEL:
                break;
            case MotionEvent.ACTION_UP:
                break;
            case MotionEvent.ACTION_MOVE:
                currentPosition.x = startPosition.x + (int) (event.getRawX() - initialDown.x);
                currentPosition.y = startPosition.y + (int) (event.getRawY() - initialDown.y);
                updateWindowPosition(currentPosition.x, currentPosition.y);
                break;
            default:
                break;
        }
        return true;
    }

    private class GestureListener extends SimpleOnGestureListener {

        @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
        @Override
        public boolean onDoubleTap(MotionEvent event) {
            hide();
            return true;
        }

        @Override
        public boolean onSingleTapConfirmed(MotionEvent event) {
            return true;
        }
    }

    private class ScaleListener extends SimpleOnScaleGestureListener {
        @Override
        public boolean onScale(ScaleGestureDetector detector) {
            scaleFactor *= detector.getScaleFactor();
            scaleFactor = Math.max(MIN_SCALE_FACTOR, Math.min(scaleFactor, MAX_SCALE_FACTOR));
            int newWidth = (int) (origWidth * scaleFactor);
            int newHeight = (int) (origHeight * scaleFactor);
            updateWindowSize(newWidth, newHeight);
            return true;
        }
    }

    private void updateWindowPosition(int x, int y) {
        windowParams.x = x;
        windowParams.y = y;
        windowManager.updateViewLayout(this, windowParams);
    }

    private void updateWindowSize(int width, int height) {
        windowParams.width = width;
        windowParams.height = height;
        windowManager.updateViewLayout(this, windowParams);
    }

    private final UCameraSessionListener cameraSessionListener = new UCameraSessionListener() {
        @Override
        public USize[] onPreviewSizeChoose(int cameraId, List<USize> cameraSupportPreviewSize) {
            return null;
        }

        @Override
        public void onCameraOpenSucceed(int cameraId, List<Integer> supportCameraIndex, int width, int height) {
            previewWidth = width;
            previewHeight = height;
            if (avOption.videoCaptureOrientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
                setAspectRatio(((float) width) / height);
            }
            else {
                setAspectRatio(((float) height) / width);
            }
        }

        @Override
        public void onCameraError(Error error, Object extra) {

        }

        @Override
        public void onCameraFlashSwitched(int cameraId, boolean currentState) {

        }

        @Override
        public void onPreviewFrame(int cameraId, byte[] data, int width, int height) {

        }
    };
}


text:
namespace EAValidator
{
    partial class CheckEditorForm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.idLabel = new System.Windows.Forms.Label();
            this.idTextBox = new System.Windows.Forms.TextBox();
            this.descriptionTextBox = new System.Windows.Forms.TextBox();
            this.descriptionLabel = new System.Windows.Forms.Label();
            this.rationaleTextBox = new System.Windows.Forms.TextBox();
            this.rationaleLabel = new System.Windows.Forms.Label();
            this.proposedSolutionTextBox = new System.Windows.Forms.TextBox();
            this.solutionLabel = new System.Windows.Forms.Label();
            this.typeComboBox = new System.Windows.Forms.ComboBox();
            this.typeLabel = new System.Windows.Forms.Label();
            this.helpUrlTextBox = new System.Windows.Forms.TextBox();
            this.helpURLLabel = new System.Windows.Forms.Label();
            this.checkTabControl = new System.Windows.Forms.TabControl();
            this.mainTab = new System.Windows.Forms.TabPage();
            this.invalidElementsLabel = new System.Windows.Forms.Label();
            this.invalidElementsTextBox = new System.Windows.Forms.TextBox();
            this.selectElementsQueryLabel = new System.Windows.Forms.Label();
            this.elementsToCheckTextBox = new System.Windows.Forms.TextBox();
            this.filtersTab = new System.Windows.Forms.TabPage();
            this.diagramFilterLabel = new System.Windows.Forms.Label();
            this.diagramFilterTextBox = new System.Windows.Forms.TextBox();
            this.releaseFilterLabel = new System.Windows.Forms.Label();
            this.releaseFilterTextBox = new System.Windows.Forms.TextBox();
            this.changeFilterLabel = new System.Windows.Forms.Label();
            this.changeFilterTextBox = new System.Windows.Forms.TextBox();
            this.packageFilterLabel = new System.Windows.Forms.Label();
            this.packageFilterTextBox = new System.Windows.Forms.TextBox();
            this.resolveTab = new System.Windows.Forms.TabPage();
            this.resolveCodeTextBox = new System.Windows.Forms.TextBox();
            this.okButton = new System.Windows.Forms.Button();
            this.cancelButton = new System.Windows.Forms.Button();
            this.languageComboBox = new System.Windows.Forms.ComboBox();
            this.languageLabel = new System.Windows.Forms.Label();
            this.checkTabControl.SuspendLayout();
            this.mainTab.SuspendLayout();
            this.filtersTab.SuspendLayout();
            this.resolveTab.SuspendLayout();
            this.SuspendLayout();
            //
            // idLabel
            //
            this.idLabel.AutoSize = true;
            this.idLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.idLabel.Location = new System.Drawing.Point(16, 17);
            this.idLabel.Name = "idLabel";
            this.idLabel.Size = new System.Drawing.Size(18, 13);
            this.idLabel.TabIndex = 0;
            this.idLabel.Text = "ID";
            //
            // idTextBox
            //
            this.idTextBox.Location = new System.Drawing.Point(16, 34);
            this.idTextBox.Name = "idTextBox";
            this.idTextBox.Size = new System.Drawing.Size(100, 20);
            this.idTextBox.TabIndex = 1;
            //
            // descriptionTextBox
            //
            this.descriptionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.descriptionTextBox.Location = new System.Drawing.Point(16, 80);
            this.descriptionTextBox.Name = "descriptionTextBox";
            this.descriptionTextBox.Size = new System.Drawing.Size(572, 20);
            this.descriptionTextBox.TabIndex = 3;
            //
            // descriptionLabel
            //
            this.descriptionLabel.AutoSize = true;
            this.descriptionLabel.Location = new System.Drawing.Point(16, 63);
            this.descriptionLabel.Name = "descriptionLabel";
            this.descriptionLabel.Size = new System.Drawing.Size(60, 13);
            this.descriptionLabel.TabIndex = 2;
            this.descriptionLabel.Text = "Description";
            //
            // rationaleTextBox
            //
            this.rationaleTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.rationaleTextBox.Location = new System.Drawing.Point(16, 126);
            this.rationaleTextBox.Name = "rationaleTextBox";
            this.rationaleTextBox.Size = new System.Drawing.Size(572, 20);
            this.rationaleTextBox.TabIndex = 5;
            //
            // rationaleLabel
            //
            this.rationaleLabel.AutoSize = true;
            this.rationaleLabel.Location = new System.Drawing.Point(16, 109);
            this.rationaleLabel.Name = "rationaleLabel";
            this.rationaleLabel.Size = new System.Drawing.Size(52, 13);
            this.rationaleLabel.TabIndex = 4;
            this.rationaleLabel.Text = "Rationale";
            //
            // proposedSolutionTextBox
            //
            this.proposedSolutionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.proposedSolutionTextBox.Location = new System.Drawing.Point(16, 171);
            this.proposedSolutionTextBox.Name = "proposedSolutionTextBox";
            this.proposedSolutionTextBox.Size = new System.Drawing.Size(572, 20);
            this.proposedSolutionTextBox.TabIndex = 7;
            //
            // solutionLabel
            //
            this.solutionLabel.AutoSize = true;
            this.solutionLabel.Location = new System.Drawing.Point(16, 154);
            this.solutionLabel.Name = "solutionLabel";
            this.solutionLabel.Size = new System.Drawing.Size(91, 13);
            this.solutionLabel.TabIndex = 6;
            this.solutionLabel.Text = "Proposed solution";
            //
            // typeComboBox
            //
            this.typeComboBox.FormattingEnabled = true;
            this.typeComboBox.Items.AddRange(new object[] {
            "Error",
            "Warning"});
            this.typeComboBox.Location = new System.Drawing.Point(122, 34);
            this.typeComboBox.Name = "typeComboBox";
            this.typeComboBox.Size = new System.Drawing.Size(121, 21);
            this.typeComboBox.TabIndex = 8;
            //
            // typeLabel
            //
            this.typeLabel.AutoSize = true;
            this.typeLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.typeLabel.Location = new System.Drawing.Point(119, 17);
            this.typeLabel.Name = "typeLabel";
            this.typeLabel.Size = new System.Drawing.Size(31, 13);
            this.typeLabel.TabIndex = 9;
            this.typeLabel.Text = "Type";
            //
            // helpUrlTextBox
            //
            this.helpUrlTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.helpUrlTextBox.Location = new System.Drawing.Point(16, 213);
            this.helpUrlTextBox.Name = "helpUrlTextBox";
            this.helpUrlTextBox.Size = new System.Drawing.Size(572, 20);
            this.helpUrlTextBox.TabIndex = 11;
            //
            // helpURLLabel
            //
            this.helpURLLabel.AutoSize = true;
            this.helpURLLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.helpURLLabel.Location = new System.Drawing.Point(16, 196);
            this.helpURLLabel.Name = "helpURLLabel";
            this.helpURLLabel.Size = new System.Drawing.Size(54, 13);
            this.helpURLLabel.TabIndex = 10;
            this.helpURLLabel.Text = "Help URL";
            //
            // checkTabControl
            //
            this.checkTabControl.Controls.Add(this.mainTab);
            this.checkTabControl.Controls.Add(this.filtersTab);
            this.checkTabControl.Controls.Add(this.resolveTab);
            this.checkTabControl.Dock = System.Windows.Forms.DockStyle.Top;
            this.checkTabControl.Location = new System.Drawing.Point(0, 0);
            this.checkTabControl.Name = "checkTabControl";
            this.checkTabControl.SelectedIndex = 0;
            this.checkTabControl.Size = new System.Drawing.Size(608, 976);
            this.checkTabControl.TabIndex = 14;
            //
            // mainTab
            //
            this.mainTab.BackColor = System.Drawing.SystemColors.Control;
            this.mainTab.Controls.Add(this.invalidElementsLabel);
            this.mainTab.Controls.Add(this.invalidElementsTextBox);
            this.mainTab.Controls.Add(this.selectElementsQueryLabel);
            this.mainTab.Controls.Add(this.elementsToCheckTextBox);
            this.mainTab.Controls.Add(this.helpURLLabel);
            this.mainTab.Controls.Add(this.idLabel);
            this.mainTab.Controls.Add(this.idTextBox);
            this.mainTab.Controls.Add(this.helpUrlTextBox);
            this.mainTab.Controls.Add(this.descriptionLabel);
            this.mainTab.Controls.Add(this.descriptionTextBox);
            this.mainTab.Controls.Add(this.typeLabel);
            this.mainTab.Controls.Add(this.rationaleLabel);
            this.mainTab.Controls.Add(this.typeComboBox);
            this.mainTab.Controls.Add(this.rationaleTextBox);
            this.mainTab.Controls.Add(this.proposedSolutionTextBox);
            this.mainTab.Controls.Add(this.solutionLabel);
            this.mainTab.Location = new System.Drawing.Point(4, 22);
            this.mainTab.Name = "mainTab";
            this.mainTab.Padding = new System.Windows.Forms.Padding(3);
            this.mainTab.Size = new System.Drawing.Size(600, 950);
            this.mainTab.TabIndex = 0;
            this.mainTab.Text = "Main";
            //
            // invalidElementsLabel
            //
            this.invalidElementsLabel.AutoSize = true;
            this.invalidElementsLabel.Location = new System.Drawing.Point(16, 565);
            this.invalidElementsLabel.Name = "invalidElementsLabel";
            this.invalidElementsLabel.Size = new System.Drawing.Size(112, 13);
            this.invalidElementsLabel.TabIndex = 14;
            this.invalidElementsLabel.Text = "Invalid elements query";
            //
            // invalidElementsTextBox
            //
            this.invalidElementsTextBox.AcceptsReturn = true;
            this.invalidElementsTextBox.AcceptsTab = true;
            this.invalidElementsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.invalidElementsTextBox.Location = new System.Drawing.Point(16, 582);
            this.invalidElementsTextBox.Multiline = true;
            this.invalidElementsTextBox.Name = "invalidElementsTextBox";
            this.invalidElementsTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
            this.invalidElementsTextBox.Size = new System.Drawing.Size(572, 350);
            this.invalidElementsTextBox.TabIndex = 15;
            this.invalidElementsTextBox.TextChanged += new System.EventHandler(this.invalidElementsTextBox_TextChanged);
            //
            // selectElementsQueryLabel
            //
            this.selectElementsQueryLabel.AutoSize = true;
            this.selectElementsQueryLabel.Location = new System.Drawing.Point(16, 241);
            this.selectElementsQueryLabel.Name = "selectElementsQueryLabel";
            this.selectElementsQueryLabel.Size = new System.Drawing.Size(124, 13);
            this.selectElementsQueryLabel.TabIndex = 12;
            this.selectElementsQueryLabel.Text = "Elements to check query";
            //
            // elementsToCheckTextBox
            //
            this.elementsToCheckTextBox.AcceptsReturn = true;
            this.elementsToCheckTextBox.AcceptsTab = true;
            this.elementsToCheckTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.elementsToCheckTextBox.Location = new System.Drawing.Point(16, 258);
            this.elementsToCheckTextBox.Multiline = true;
            this.elementsToCheckTextBox.Name = "elementsToCheckTextBox";
            this.elementsToCheckTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
            this.elementsToCheckTextBox.Size = new System.Drawing.Size(572, 297);
            this.elementsToCheckTextBox.TabIndex = 13;
            this.elementsToCheckTextBox.TextChanged += new System.EventHandler(this.elementsToCheckTextBox_TextChanged);
            //
            // filtersTab
            //
            this.filtersTab.BackColor = System.Drawing.SystemColors.Control;
            this.filtersTab.Controls.Add(this.diagramFilterLabel);
            this.filtersTab.Controls.Add(this.diagramFilterTextBox);
            this.filtersTab.Controls.Add(this.releaseFilterLabel);
            this.filtersTab.Controls.Add(this.releaseFilterTextBox);
            this.filtersTab.Controls.Add(this.changeFilterLabel);
            this.filtersTab.Controls.Add(this.changeFilterTextBox);
            this.filtersTab.Controls.Add(this.packageFilterLabel);
            this.filtersTab.Controls.Add(this.packageFilterTextBox);
            this.filtersTab.Location = new System.Drawing.Point(4, 22);
            this.filtersTab.Name = "filtersTab";
            this.filtersTab.Padding = new System.Windows.Forms.Padding(3);
            this.filtersTab.Size = new System.Drawing.Size(600, 950);
            this.filtersTab.TabIndex = 1;
            this.filtersTab.Text = "Filters";
            //
            // diagramFilterLabel
            //
            this.diagramFilterLabel.AutoSize = true;
            this.diagramFilterLabel.Location = new System.Drawing.Point(5, 594);
            this.diagramFilterLabel.Name = "diagramFilterLabel";
            this.diagramFilterLabel.Size = new System.Drawing.Size(71, 13);
            this.diagramFilterLabel.TabIndex = 20;
            this.diagramFilterLabel.Text = "Diagram Filter";
            //
            // diagramFilterTextBox
            //
            this.diagramFilterTextBox.AcceptsReturn = true;
            this.diagramFilterTextBox.AcceptsTab = true;
            this.diagramFilterTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.diagramFilterTextBox.Location = new System.Drawing.Point(8, 611);
            this.diagramFilterTextBox.Multiline = true;
            this.diagramFilterTextBox.Name = "diagramFilterTextBox";
            this.diagramFilterTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
            this.diagramFilterTextBox.Size = new System.Drawing.Size(572, 200);
            this.diagramFilterTextBox.TabIndex = 21;
            this.diagramFilterTextBox.TextChanged += new System.EventHandler(this.diagramFilterTextBox_TextChanged);
            //
            // releaseFilterLabel
            //
            this.releaseFilterLabel.AutoSize = true;
            this.releaseFilterLabel.Location = new System.Drawing.Point(5, 363);
            this.releaseFilterLabel.Name = "releaseFilterLabel";
            this.releaseFilterLabel.Size = new System.Drawing.Size(71, 13);
            this.releaseFilterLabel.TabIndex = 18;
            this.releaseFilterLabel.Text = "Release Filter";
            //
            // releaseFilterTextBox
            //
            this.releaseFilterTextBox.AcceptsReturn = true;
            this.releaseFilterTextBox.AcceptsTab = true;
            this.releaseFilterTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.releaseFilterTextBox.Location = new System.Drawing.Point(8, 380);
            this.releaseFilterTextBox.Multiline = true;
            this.releaseFilterTextBox.Name = "releaseFilterTextBox";
            this.releaseFilterTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
            this.releaseFilterTextBox.Size = new System.Drawing.Size(572, 200);
            this.releaseFilterTextBox.TabIndex = 19;
            this.releaseFilterTextBox.TextChanged += new System.EventHandler(this.releaseFilterTextBox_TextChanged);
            //
            // changeFilterLabel
            //
            this.changeFilterLabel.AutoSize = true;
            this.changeFilterLabel.Location = new System.Drawing.Point(5, 133);
            this.changeFilterLabel.Name = "changeFilterLabel";
            this.changeFilterLabel.Size = new System.Drawing.Size(69, 13);
            this.changeFilterLabel.TabIndex = 16;
            this.changeFilterLabel.Text = "Change Filter";
            //
            // changeFilterTextBox
            //
            this.changeFilterTextBox.AcceptsReturn = true;
            this.changeFilterTextBox.AcceptsTab = true;
            this.changeFilterTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.changeFilterTextBox.Location = new System.Drawing.Point(8, 150);
            this.changeFilterTextBox.Multiline = true;
            this.changeFilterTextBox.Name = "changeFilterTextBox";
            this.changeFilterTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
            this.changeFilterTextBox.Size = new System.Drawing.Size(572, 200);
            this.changeFilterTextBox.TabIndex = 17;
            this.changeFilterTextBox.TextChanged += new System.EventHandler(this.changeFilterTextBox_TextChanged);
            //
            // packageFilterLabel
            //
            this.packageFilterLabel.AutoSize = true;
            this.packageFilterLabel.Location = new System.Drawing.Point(5, 16);
            this.packageFilterLabel.Name = "packageFilterLabel";
            this.packageFilterLabel.Size = new System.Drawing.Size(75, 13);
            this.packageFilterLabel.TabIndex = 14;
            this.packageFilterLabel.Text = "Package Filter";
            //
            // packageFilterTextBox
            //
            this.packageFilterTextBox.AcceptsReturn = true;
            this.packageFilterTextBox.AcceptsTab = true;
            this.packageFilterTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.packageFilterTextBox.Location = new System.Drawing.Point(8, 33);
            this.packageFilterTextBox.Multiline = true;
            this.packageFilterTextBox.Name = "packageFilterTextBox";
            this.packageFilterTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
            this.packageFilterTextBox.Size = new System.Drawing.Size(572, 88);
            this.packageFilterTextBox.TabIndex = 15;
            this.packageFilterTextBox.TextChanged += new System.EventHandler(this.packageFilterTextBox_TextChanged);
            //
            // resolveTab
            //
            this.resolveTab.BackColor = System.Drawing.SystemColors.Control;
            this.resolveTab.Controls.Add(this.languageLabel);
            this.resolveTab.Controls.Add(this.languageComboBox);
            this.resolveTab.Controls.Add(this.resolveCodeTextBox);
            this.resolveTab.Location = new System.Drawing.Point(4, 22);
            this.resolveTab.Name = "resolveTab";
            this.resolveTab.Padding = new System.Windows.Forms.Padding(3);
            this.resolveTab.Size = new System.Drawing.Size(600, 950);
            this.resolveTab.TabIndex = 2;
            this.resolveTab.Text = "Resolve Code";
            //
            // resolveCodeTextBox
            //
            this.resolveCodeTextBox.AcceptsReturn = true;
            this.resolveCodeTextBox.AcceptsTab = true;
            this.resolveCodeTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.resolveCodeTextBox.Location = new System.Drawing.Point(3, 33);
            this.resolveCodeTextBox.Multiline = true;
            this.resolveCodeTextBox.Name = "resolveCodeTextBox";
            this.resolveCodeTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
            this.resolveCodeTextBox.Size = new System.Drawing.Size(594, 914);
            this.resolveCodeTextBox.TabIndex = 23;
            this.resolveCodeTextBox.TextChanged += new System.EventHandler(this.resolveCodeTextBox_TextChanged);
            //
            // okButton
            //
            this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.okButton.Location = new System.Drawing.Point(440, 982);
            this.okButton.Name = "okButton";
            this.okButton.Size = new System.Drawing.Size(75, 23);
            this.okButton.TabIndex = 15;
            this.okButton.Text = "OK";
            this.okButton.UseVisualStyleBackColor = true;
            this.okButton.Click += new System.EventHandler(this.okButton_Click);
            //
            // cancelButton
            //
            this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.cancelButton.Location = new System.Drawing.Point(521, 982);
            this.cancelButton.Name = "cancelButton";
            this.cancelButton.Size = new System.Drawing.Size(75, 23);
            this.cancelButton.TabIndex = 15;
            this.cancelButton.Text = "Cancel";
            this.cancelButton.UseVisualStyleBackColor = true;
            this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
            //
            // languageComboBox
            //
            this.languageComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.languageComboBox.FormattingEnabled = true;
            this.languageComboBox.Items.AddRange(new object[] {
            "VBScript",
            "JavaScript",
            "JScript"});
            this.languageComboBox.Location = new System.Drawing.Point(471, 6);
            this.languageComboBox.Name = "languageComboBox";
            this.languageComboBox.Size = new System.Drawing.Size(121, 21);
            this.languageComboBox.TabIndex = 24;
            //
            // languageLabel
            //
            this.languageLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.languageLabel.AutoSize = true;
            this.languageLabel.Location = new System.Drawing.Point(401, 9);
            this.languageLabel.Name = "languageLabel";
            this.languageLabel.Size = new System.Drawing.Size(55, 13);
            this.languageLabel.TabIndex = 25;
            this.languageLabel.Text = "Language";
            //
            // CheckEditorForm
            //
            this.AcceptButton = this.okButton;
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.CancelButton = this.cancelButton;
            this.ClientSize = new System.Drawing.Size(608, 1017);
            this.Controls.Add(this.cancelButton);
            this.Controls.Add(this.okButton);
            this.Controls.Add(this.checkTabControl);
            this.MinimumSize = new System.Drawing.Size(250, 1056);
            this.Name = "CheckEditorForm";
            this.Text = "Check Editor";
            this.checkTabControl.ResumeLayout(false);
            this.mainTab.ResumeLayout(false);
            this.mainTab.PerformLayout();
            this.filtersTab.ResumeLayout(false);
            this.filtersTab.PerformLayout();
            this.resolveTab.ResumeLayout(false);
            this.resolveTab.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Label idLabel;
        private System.Windows.Forms.TextBox idTextBox;
        private System.Windows.Forms.TextBox descriptionTextBox;
        private System.Windows.Forms.Label descriptionLabel;
        private System.Windows.Forms.TextBox rationaleTextBox;
        private System.Windows.Forms.Label rationaleLabel;
        private System.Windows.Forms.TextBox proposedSolutionTextBox;
        private System.Windows.Forms.Label solutionLabel;
        private System.Windows.Forms.ComboBox typeComboBox;
        private System.Windows.Forms.Label typeLabel;
        private System.Windows.Forms.TextBox helpUrlTextBox;
        private System.Windows.Forms.Label helpURLLabel;
        private System.Windows.Forms.TabControl checkTabControl;
        private System.Windows.Forms.TabPage mainTab;
        private System.Windows.Forms.Label selectElementsQueryLabel;
        private System.Windows.Forms.TextBox elementsToCheckTextBox;
        private System.Windows.Forms.TabPage filtersTab;
        private System.Windows.Forms.TabPage resolveTab;
        private System.Windows.Forms.Label invalidElementsLabel;
        private System.Windows.Forms.TextBox invalidElementsTextBox;
        private System.Windows.Forms.Label diagramFilterLabel;
        private System.Windows.Forms.TextBox diagramFilterTextBox;
        private System.Windows.Forms.Label releaseFilterLabel;
        private System.Windows.Forms.TextBox releaseFilterTextBox;
        private System.Windows.Forms.Label changeFilterLabel;
        private System.Windows.Forms.TextBox changeFilterTextBox;
        private System.Windows.Forms.Label packageFilterLabel;
        private System.Windows.Forms.TextBox packageFilterTextBox;
        private System.Windows.Forms.TextBox resolveCodeTextBox;
        private System.Windows.Forms.Button okButton;
        private System.Windows.Forms.Button cancelButton;
        private System.Windows.Forms.Label languageLabel;
        private System.Windows.Forms.ComboBox languageComboBox;
    }
}


text:
RSpec::Matchers.define :raise_access_denied do |_expected|
  def supports_block_expectations?
    true
  end

  match do |actual|
    begin
      subject && subject.stub(:access_denied) do |exception|
        raise exception
      end

      actual.call
      false
    rescue CanCan::AccessDenied
      true
    rescue Services::Security::AccessDeniedError
      true
    end
      false
  end
end

RSpec::Matchers.define :be_permitted_to do |*args|

  def supports_block_expectations?
    true
  end

  failure_message do
    "be permitted to #{ expected.first } #{ expected.second.inspect }"
  end

  description do
    "be permitted to #{ expected.first } #{ expected.second.inspect }"
  end

  match do |policy|
    policy.permit?( *args )
  end
end

RSpec::Matchers.define :maybe_be_permitted_to do |*args|

  def supports_block_expectations?
    true
  end

  failure_message do
    "maybe be permitted to #{ expected.first } #{ expected.second.inspect }"
  end

  description do
    "maybe be permitted to #{ expected.first } #{ expected.second.inspect }"
  end

  match do |policy|
    policy.permit?( *args ) == :maybe
  end
end

RSpec::Matchers.define :absolutely_be_permitted_to do |*args|

  def supports_block_expectations?
    true
  end

  failure_message do
    "absolutely be permitted to #{ expected.first } #{ expected.second.inspect }"
  end

  description do
    "absolutely be permitted to #{ expected.first } #{ expected.second.inspect }"
  end

  match do |policy|
    policy.permit?( *args ) == :yes
  end
end


text:
 <?php if (isset($error)): ?>

        <?=$error;?>

<?php endif; ?>
<?php echo form_open(); ?>

    Name :
    <input name="name"  class="form-control" placeholder="Edit Name" type="text" value="<?php echo set_value('name', $user->getName()); ?>" />
    <?php echo form_error('name','
','
'); ?>

    Email :
    <input name="email"  class="form-control" placeholder="Edit email" type="email" value="<?php echo set_value('email', $user->getEmail()); ?>" />
    <?php echo form_error('email','
','
'); ?>

    Address :
    <input name="address"  class="form-control" placeholder="Edit Address" type="text" value="<?php echo set_value('address', $user->getBillingAddress()); ?>" />
    <?php echo form_error('address','
','
'); ?>

    <input  class="btn btn-danger-outline btn-lg"  type="submit" value="Update User">

<?php echo form_close(); ?>


text:
/*
This file demonstrates how we can separate functionality that might not need to be loaded with the SPFx Web Part or Extension immediately, but be bundled into a separate .js file and loaded dynamically.

This function will write a message to the console when it is dynamcially loaded.
*/

export default class DynamicFunctions {
    public static executeDynamicLoad():void {
        console.log('Dynamic Functionality has been imported');
    }

}