text:
package org.zstack.kvm;

import org.springframework.beans.factory.annotation.Autowired;
import org.zstack.core.asyncbatch.While;
import org.zstack.core.componentloader.PluginRegistry;
import org.zstack.header.Component;
import org.zstack.header.core.Completion;
import org.zstack.header.core.WhileDoneCompletion;
import org.zstack.header.errorcode.ErrorCode;
import org.zstack.header.errorcode.ErrorCodeList;
import org.zstack.header.host.CheckSnapshotOnHypervisorMsg;
import org.zstack.header.host.CheckVmStateOnHypervisorMsg;
import org.zstack.header.host.HostInventory;
import org.zstack.header.host.TakeSnapshotOnHypervisorMsg;
import org.zstack.header.vm.VmInstanceInventory;
import org.zstack.header.vm.VmInstanceSpec;
import org.zstack.header.volume.VolumeInventory;
import org.zstack.kvm.KVMAgentCommands.AttachDataVolumeCmd;
import org.zstack.kvm.KVMAgentCommands.DetachDataVolumeCmd;
import org.zstack.kvm.KVMAgentCommands.StartVmCmd;
import org.zstack.utils.CollectionUtils;
import org.zstack.utils.Utils;
import org.zstack.utils.function.ForEachFunction;
import org.zstack.utils.logging.CLogger;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

public class KVMExtensionEmitter implements Component {
    private static final CLogger logger = Utils.getLogger(KVMExtensionEmitter.class);

    @Autowired
    private PluginRegistry pluginRgty;

    private List<KVMStartVmExtensionPoint> startVmExts = new ArrayList<>();
    private List<KVMDestroyVmExtensionPoint> destroyVmExts = new ArrayList<>();
    private List<KVMStopVmExtensionPoint> stopVmExts = new ArrayList<>();
    private List<KVMRebootVmExtensionPoint> rebootVmExts = new ArrayList<>();
    private List<KVMStartVmAddonExtensionPoint> addonsExts = new ArrayList<>();
    private List<KVMAttachVolumeExtensionPoint> attachVolumeExts = new ArrayList<>();
    private List<KVMDetachVolumeExtensionPoint> detachVolumeExts = new ArrayList<>();
    private List<KVMTakeSnapshotExtensionPoint> takeSnapshotExts = new ArrayList<>();
    private List<KVMCheckSnapshotExtensionPoint> checkSnapshotExts = new ArrayList<>();
    private List<KVMMergeSnapshotExtensionPoint> mergeSnapshotExts = new ArrayList<>();
    private List<KVMCheckVmStateExtensionPoint> checkVmStateExts = new ArrayList<>();
    private List<KVMSyncVmDeviceInfoExtensionPoint> syncVmDeviceInfoExts = new ArrayList<>();

    private void populateExtensions() {
        startVmExts = pluginRgty.getExtensionList(KVMStartVmExtensionPoint.class);
        destroyVmExts = pluginRgty.getExtensionList(KVMDestroyVmExtensionPoint.class);
        stopVmExts = pluginRgty.getExtensionList(KVMStopVmExtensionPoint.class);
        rebootVmExts = pluginRgty.getExtensionList(KVMRebootVmExtensionPoint.class);
        addonsExts = pluginRgty.getExtensionList(KVMStartVmAddonExtensionPoint.class);
        attachVolumeExts = pluginRgty.getExtensionList(KVMAttachVolumeExtensionPoint.class);
        detachVolumeExts = pluginRgty.getExtensionList(KVMDetachVolumeExtensionPoint.class);
        takeSnapshotExts = pluginRgty.getExtensionList(KVMTakeSnapshotExtensionPoint.class);
        mergeSnapshotExts = pluginRgty.getExtensionList(KVMMergeSnapshotExtensionPoint.class);
        checkVmStateExts = pluginRgty.getExtensionList(KVMCheckVmStateExtensionPoint.class);
        checkSnapshotExts = pluginRgty.getExtensionList(KVMCheckSnapshotExtensionPoint.class);
        syncVmDeviceInfoExts = pluginRgty.getExtensionList(KVMSyncVmDeviceInfoExtensionPoint.class);
    }

    public void afterReceiveSyncVmDeviceInfoRespoinse(final VmInstanceInventory vm, final KVMAgentCommands.VmDevicesInfoResponse rsp) {
        CollectionUtils.safeForEach(syncVmDeviceInfoExts, new ForEachFunction<KVMSyncVmDeviceInfoExtensionPoint>() {
            @Override
            public void run(KVMSyncVmDeviceInfoExtensionPoint arg) {
                arg.afterReceiveVmDeviceInfoResponse(vm, rsp);
            }
        });
    }

    public void beforeStartVmOnKvm(final KVMHostInventory host, final VmInstanceSpec spec, final StartVmCmd cmd) {
        for (KVMStartVmExtensionPoint extp : startVmExts) {
            extp.beforeStartVmOnKvm(host, spec, cmd);
        }
    }

    public void startVmOnKvmSuccess(final KVMHostInventory host, final VmInstanceSpec spec) {
        CollectionUtils.safeForEach(startVmExts, new ForEachFunction<KVMStartVmExtensionPoint>() {
            @Override
            public void run(KVMStartVmExtensionPoint arg) {
                arg.startVmOnKvmSuccess(host, spec);
            }
        });
    }

    public void startVmOnKvmFailed(final KVMHostInventory host, final VmInstanceSpec spec, final ErrorCode err) {
        CollectionUtils.safeForEach(startVmExts, new ForEachFunction<KVMStartVmExtensionPoint>() {
            @Override
            public void run(KVMStartVmExtensionPoint arg) {
                arg.startVmOnKvmFailed(host, spec, err);
            }
        });
    }

    public void beforeDestroyVmOnKvm(KVMHostInventory host, VmInstanceInventory vm, KVMAgentCommands.DestroyVmCmd cmd) throws KVMException {
        for (KVMDestroyVmExtensionPoint extp : destroyVmExts) {
            extp.beforeDestroyVmOnKvm(host, vm, cmd);
        }
    }

    public void beforeDirectlyDestroyVmOnKvm(KVMAgentCommands.DestroyVmCmd cmd) {
        for (KVMDestroyVmExtensionPoint extp : destroyVmExts) {
            extp.beforeDirectlyDestroyVmOnKvm(cmd);
        }
    }

    public void destroyVmOnKvmSuccess(final KVMHostInventory host, final VmInstanceInventory vm) {
        CollectionUtils.safeForEach(destroyVmExts, new ForEachFunction<KVMDestroyVmExtensionPoint>() {
            @Override
            public void run(KVMDestroyVmExtensionPoint arg) {
                arg.destroyVmOnKvmSuccess(host, vm);
            }
        });
    }

    public void destroyVmOnKvmFailed(final KVMHostInventory host, final VmInstanceInventory vm, final ErrorCode err) {
        CollectionUtils.safeForEach(destroyVmExts, new ForEachFunction<KVMDestroyVmExtensionPoint>() {
            @Override
            public void run(KVMDestroyVmExtensionPoint arg) {
                arg.destroyVmOnKvmFailed(host, vm, err);
            }
        });
    }

    public void beforeStopVmOnKvm(KVMHostInventory host, VmInstanceInventory vm, KVMAgentCommands.StopVmCmd cmd) throws KVMException {
        for (KVMStopVmExtensionPoint extp : stopVmExts) {
            extp.beforeStopVmOnKvm(host, vm, cmd);
        }
    }

    public void stopVmOnKvmSuccess(final KVMHostInventory host, final VmInstanceInventory vm) {
        CollectionUtils.safeForEach(stopVmExts, new ForEachFunction<KVMStopVmExtensionPoint>() {
            @Override
            public void run(KVMStopVmExtensionPoint arg) {
                arg.stopVmOnKvmSuccess(host, vm);
            }
        });
    }

    public void stopVmOnKvmFailed(final KVMHostInventory host, final VmInstanceInventory vm, final ErrorCode err) {
        CollectionUtils.safeForEach(stopVmExts, new ForEachFunction<KVMStopVmExtensionPoint>() {
            @Override
            public void run(KVMStopVmExtensionPoint arg) {
                arg.stopVmOnKvmFailed(host, vm, err);
            }
        });
    }

    public void beforeRebootVmOnKvm(KVMHostInventory host, VmInstanceInventory vm) throws KVMException {
        for (KVMRebootVmExtensionPoint extp : rebootVmExts) {
            extp.beforeRebootVmOnKvm(host, vm);
        }
    }

    public void rebootVmOnKvmSuccess(final KVMHostInventory host, final VmInstanceInventory vm) {
        CollectionUtils.safeForEach(rebootVmExts, new ForEachFunction<KVMRebootVmExtensionPoint>() {
            @Override
            public void run(KVMRebootVmExtensionPoint arg) {
                arg.rebootVmOnKvmSuccess(host, vm);
            }
        });
    }

    public void rebootVmOnKvmFailed(final KVMHostInventory host, final VmInstanceInventory vm, final ErrorCode err) {
        CollectionUtils.safeForEach(rebootVmExts, new ForEachFunction<KVMRebootVmExtensionPoint>() {
            @Override
            public void run(KVMRebootVmExtensionPoint arg) {
                arg.rebootVmOnKvmFailed(host, vm, err);
            }
        });
    }

    public void addOn(final KVMHostInventory host, final VmInstanceSpec spec, final StartVmCmd cmd) {
        CollectionUtils.safeForEach(addonsExts, new ForEachFunction<KVMStartVmAddonExtensionPoint>() {
            @Override
            public void run(KVMStartVmAddonExtensionPoint extp) {
                if (spec.getVmInventory().getType().equals(extp.getVmTypeForAddonExtension().toString())) {
                    extp.addAddon(host, spec, cmd);
                }
            }
        });
    }

    public void doBeforeTakeSnapshot(final Iterator<KVMTakeSnapshotExtensionPoint> it, KVMHostInventory host, TakeSnapshotOnHypervisorMsg msg,
                                     KVMAgentCommands.TakeSnapshotCmd cmd, Completion completion) {
        if (!it.hasNext()) {
            completion.success();
            return;
        }

        KVMTakeSnapshotExtensionPoint ext = it.next();
        ext.beforeTakeSnapshot(host, msg, cmd, new Completion(completion) {
            @Override
            public void success() {
                doBeforeTakeSnapshot(it, host, msg, cmd, completion);
            }

            @Override
            public void fail(ErrorCode errorCode) {
                completion.fail(errorCode);
            }
        });
    }

    public void beforeCheckSnapshot(KVMHostInventory host, CheckSnapshotOnHypervisorMsg msg, KVMAgentCommands.CheckSnapshotCmd cmd, Completion completion) {
        ErrorCodeList errorCodeList = new ErrorCodeList();
        new While<>(checkSnapshotExts).each((ext, whileCompletion) -> {
            ext.beforeCheckSnapshot(host, msg, cmd, new Completion(whileCompletion) {
                @Override
                public void success() {
                    whileCompletion.done();
                }

                @Override
                public void fail(ErrorCode errorCode) {
                    errorCodeList.getCauses().add(errorCode);
                    whileCompletion.allDone();
                }
            });
        }).run(new WhileDoneCompletion(completion) {
            @Override
            public void done(ErrorCodeList errorCodeList) {
                if (!errorCodeList.getCauses().isEmpty()) {
                    completion.fail(errorCodeList.getCauses().get(0));
                    return;
                }

                completion.success();
            }
        });
    }

    public void beforeTakeSnapshot(KVMHostInventory host, TakeSnapshotOnHypervisorMsg msg, KVMAgentCommands.TakeSnapshotCmd cmd, Completion completion) {
        Iterator<KVMTakeSnapshotExtensionPoint> it = takeSnapshotExts.iterator();
        doBeforeTakeSnapshot(it, host, msg, cmd, completion);
    }

    public void afterTakeSnapshot(KVMHostInventory host, TakeSnapshotOnHypervisorMsg msg, KVMAgentCommands.TakeSnapshotCmd cmd, KVMAgentCommands.TakeSnapshotResponse rsp) {
        for (KVMTakeSnapshotExtensionPoint ext : takeSnapshotExts) {
            ext.afterTakeSnapshot(host, msg, cmd, rsp);
        }
    }

    public void afterTakeSnapshotFailed(KVMHostInventory host, TakeSnapshotOnHypervisorMsg msg, KVMAgentCommands.TakeSnapshotCmd cmd, KVMAgentCommands.TakeSnapshotResponse rsp, ErrorCode err) {
        for (KVMTakeSnapshotExtensionPoint ext : takeSnapshotExts) {
            ext.afterTakeSnapshotFailed(host, msg, cmd, rsp, err);
        }
    }

    public void beforeMergeSnapshot(KVMHostInventory host, MergeVolumeSnapshotOnKvmMsg msg, KVMAgentCommands.MergeSnapshotCmd cmd) {
        for (KVMMergeSnapshotExtensionPoint ext : mergeSnapshotExts) {
            ext.beforeMergeSnapshot(host, msg, cmd);
        }
    }

    public void beforeCheckVmState(KVMHostInventory host, CheckVmStateOnHypervisorMsg msg, KVMAgentCommands.CheckVmStateCmd cmd) {
        for (KVMCheckVmStateExtensionPoint ext : checkVmStateExts) {
            ext.beforeCheckVmState(host, msg, cmd);
        }
    }

    public void afterCheckVmState(HostInventory host, Map<String, String> vmStateMap) {
        for (KVMCheckVmStateExtensionPoint ext : checkVmStateExts) {
            ext.afterCheckVmState(host, vmStateMap);
        }
    }

    public void afterMergeSnapshot(KVMHostInventory host, MergeVolumeSnapshotOnKvmMsg msg, KVMAgentCommands.MergeSnapshotCmd cmd) {
        for (KVMMergeSnapshotExtensionPoint ext : mergeSnapshotExts) {
            ext.afterMergeSnapshot(host, msg, cmd);
        }
    }

    public void afterMergeSnapshotFailed(KVMHostInventory host, MergeVolumeSnapshotOnKvmMsg msg, KVMAgentCommands.MergeSnapshotCmd cmd, ErrorCode err) {
        for (KVMMergeSnapshotExtensionPoint ext : mergeSnapshotExts) {
            ext.afterMergeSnapshotFailed(host, msg, cmd, err);
        }
    }

    public void beforeAttachVolume(KVMHostInventory host, VmInstanceInventory vm, VolumeInventory vol, AttachDataVolumeCmd cmd, Map data) {
        for (KVMAttachVolumeExtensionPoint ext : attachVolumeExts) {
            ext.beforeAttachVolume(host, vm, vol, cmd, data);
        }
    }

    public void afterAttachVolume(KVMHostInventory host, VmInstanceInventory vm, VolumeInventory vol, AttachDataVolumeCmd cmd) {
        for (KVMAttachVolumeExtensionPoint ext : attachVolumeExts) {
            ext.afterAttachVolume(host, vm, vol, cmd);
        }
    }

    public void attachVolumeFailed(KVMHostInventory host, VmInstanceInventory vm, VolumeInventory vol, AttachDataVolumeCmd cmd, ErrorCode err, Map data) {
        for (KVMAttachVolumeExtensionPoint ext : attachVolumeExts) {
            ext.attachVolumeFailed(host, vm, vol, cmd, err, data);
        }
    }

    public void beforeDetachVolume(KVMHostInventory host, VmInstanceInventory vm, VolumeInventory vol, DetachDataVolumeCmd cmd) {
        for (KVMDetachVolumeExtensionPoint ext : detachVolumeExts) {
            ext.beforeDetachVolume(host, vm, vol, cmd);
        }
    }

    public void afterDetachVolume(KVMHostInventory host, VmInstanceInventory vm, VolumeInventory vol, DetachDataVolumeCmd cmd) {
        for (KVMDetachVolumeExtensionPoint ext : detachVolumeExts) {
            ext.afterDetachVolume(host, vm, vol, cmd);
        }
    }

    public void detachVolumeFailed(KVMHostInventory host, VmInstanceInventory vm, VolumeInventory vol, DetachDataVolumeCmd cmd, ErrorCode err) {
        for (KVMDetachVolumeExtensionPoint ext : detachVolumeExts) {
            ext.detachVolumeFailed(host, vm, vol, cmd, err);
        }
    }

    @Override
    public boolean start() {
        populateExtensions();
        return true;
    }

    @Override
    public boolean stop() {
        return true;
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycol. eur. (Erlanga) 2: 44 (1825)

#### Original name
Polyporus nummularius var. clypealis Pers.

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
//
//  GBProcessor.h
//  appledoc
//
//  Created by Tomaz Kragelj on 27.8.10.
//  Copyright (C) 2010, Gentle Bytes. All rights reserved.
//

#import <Foundation/Foundation.h>

/** Handles processing of parsed data from any given `GBStore`.

 Processing phase is where parsed raw data is prepared for output. The most prominent part is processing comment raw values by validating and preparing links, formatting etc.
 */
@interface GBProcessor : NSObject

///---------------------------------------------------------------------------------------
/// @name Initialization & disposal
///---------------------------------------------------------------------------------------

/** Returns autoreleased processor that work with the given `GBApplicationSettingsProvider` implementor.

 @param settingsProvider Application-wide settings provider to use for checking parameters.
 @return Returns initialized instance or `nil` if initialization fails.
 @exception NSException Thrown if the given application is `nil`.
 */
+ (id)processorWithSettingsProvider:(id)settingsProvider;

/** Initializes the processor to work with the given `GBApplicationSettingsProvider` implementor.

 This is the designated initializer.

 @param settingsProvider Application-wide settings provider to use for checking parameters.
 @return Returns initialized instance or `nil` if initialization fails.
 @exception NSException Thrown if the given application is `nil`.
 */
- (id)initWithSettingsProvider:(id)settingsProvider;

///---------------------------------------------------------------------------------------
/// @name Processing handling
///---------------------------------------------------------------------------------------

/** Processes all objects from the given store.

 This is the main processing method. It is intended to be invoked from the top level application code. It accepts a `GBStore` with parsed objects and processes all registered objects to make them ready for output. All object's and their data is recursively descended so every object that needs processing is handled properly!

 If any kind of inconsistency is detected in source code, a warning is logged and processing continues. This allows us to extract as much information as possible, while ignoring problems.

 @param store The store that contains all parsed objects.
 @exception NSException Thrown if a serious problem is detected which prevents us from processing.
 */
- (void)processObjectsFromStore:(id)store;

@end


text:
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { parse } from '../parser';
import { readFileSync } from 'fs';
import { visit, BREAK } from '../visitor';
import { join } from 'path';

describe('Visitor', () => {
  it('allows for editing on enter', () => {

    var ast = parse('{ a, b, c { a, b, c } }', { noLocation: true });
    var editedAst = visit(ast, {
      enter(node) {
        if (node.kind === 'Field' && node.name.value === 'b') {
          return null;
        }
      }
    });

    expect(ast).to.deep.equal(
      parse('{ a, b, c { a, b, c } }', { noLocation: true })
    );

    expect(editedAst).to.deep.equal(
      parse('{ a,    c { a,    c } }', { noLocation: true })
    );
  });

  it('allows for editing on leave', () => {

    var ast = parse('{ a, b, c { a, b, c } }', { noLocation: true });
    var editedAst = visit(ast, {
      leave(node) {
        if (node.kind === 'Field' && node.name.value === 'b') {
          return null;
        }
      }
    });

    expect(ast).to.deep.equal(
      parse('{ a, b, c { a, b, c } }', { noLocation: true })
    );

    expect(editedAst).to.deep.equal(
      parse('{ a,    c { a,    c } }', { noLocation: true })
    );
  });

  it('visits edited node', () => {

    var addedField =
      { kind: 'Field',
        name:
         { kind: 'Name',
           value: '__typename' } };

    var didVisitAddedField;

    var ast = parse('{ a { x } }');
    visit(ast, {
      enter(node) {
        if (node.kind === 'Field' && node.name.value === 'a') {
          return {
            kind: 'Field',
            selectionSet: [ addedField ].concat(node.selectionSet)
          };
        }
        if (node === addedField) {
          didVisitAddedField = true;
        }
      }
    });

    expect(didVisitAddedField).to.equal(true);
  });

  it('allows skipping a sub-tree', () => {

    var visited = [];

    var ast = parse('{ a, b { x }, c }');
    visit(ast, {
      enter(node) {
        visited.push([ 'enter', node.kind, node.value ]);
        if (node.kind === 'Field' && node.name.value === 'b') {
          return false;
        }
      },

      leave(node) {
        visited.push([ 'leave', node.kind, node.value ]);
      }
    });

    expect(visited).to.deep.equal([
      [ 'enter', 'Document', undefined ],
      [ 'enter', 'OperationDefinition', undefined ],
      [ 'enter', 'SelectionSet', undefined ],
      [ 'enter', 'Field', undefined ],
      [ 'enter', 'Name', 'a' ],
      [ 'leave', 'Name', 'a' ],
      [ 'leave', 'Field', undefined ],
      [ 'enter', 'Field', undefined ],
      [ 'enter', 'Field', undefined ],
      [ 'enter', 'Name', 'c' ],
      [ 'leave', 'Name', 'c' ],
      [ 'leave', 'Field', undefined ],
      [ 'leave', 'SelectionSet', undefined ],
      [ 'leave', 'OperationDefinition', undefined ],
      [ 'leave', 'Document', undefined ],
    ]);
  });

  it('allows early exit while visiting', () => {

    var visited = [];

    var ast = parse('{ a, b { x }, c }');
    visit(ast, {
      enter(node) {
        visited.push([ 'enter', node.kind, node.value ]);
        if (node.kind === 'Name' && node.value === 'x') {
          return BREAK;
        }
      },

      leave(node) {
        visited.push([ 'leave', node.kind, node.value ]);
      }
    });

    expect(visited).to.deep.equal([
      [ 'enter', 'Document', undefined ],
      [ 'enter', 'OperationDefinition', undefined ],
      [ 'enter', 'SelectionSet', undefined ],
      [ 'enter', 'Field', undefined ],
      [ 'enter', 'Name', 'a' ],
      [ 'leave', 'Name', 'a' ],
      [ 'leave', 'Field', undefined ],
      [ 'enter', 'Field', undefined ],
      [ 'enter', 'Name', 'b' ],
      [ 'leave', 'Name', 'b' ],
      [ 'enter', 'SelectionSet', undefined ],
      [ 'enter', 'Field', undefined ],
      [ 'enter', 'Name', 'x' ]
    ]);
  });

  it('allows a named functions visitor API', () => {

    var visited = [];

    var ast = parse('{ a, b { x }, c }');
    visit(ast, {
      Name(node) {
        visited.push([ 'enter', node.kind, node.value ]);
      },
      SelectionSet: {
        enter(node) {
          visited.push([ 'enter', node.kind, node.value ]);
        },
        leave(node) {
          visited.push([ 'leave', node.kind, node.value ]);
        }
      }
    });

    expect(visited).to.deep.equal([
      [ 'enter', 'SelectionSet', undefined ],
      [ 'enter', 'Name', 'a' ],
      [ 'enter', 'Name', 'b' ],
      [ 'enter', 'SelectionSet', undefined ],
      [ 'enter', 'Name', 'x' ],
      [ 'leave', 'SelectionSet', undefined ],
      [ 'enter', 'Name', 'c' ],
      [ 'leave', 'SelectionSet', undefined ],
    ]);
  });

  var kitchenSink = readFileSync(
    join(__dirname, '/kitchen-sink.graphql'),
    { encoding: 'utf8' }
  );

  it('visits kitchen sink', () => {

    var ast = parse(kitchenSink);

    var visited = [];

    visit(ast, {
      enter(node, key, parent) {
        visited.push([ 'enter', node.kind, key, parent && parent.kind ]);
      },

      leave(node, key, parent) {
        visited.push([ 'leave', node.kind, key, parent && parent.kind ]);
      }
    });

    expect(visited).to.deep.equal([
      [ 'enter', 'Document', undefined, undefined ],
      [ 'enter', 'OperationDefinition', 0, undefined ],
      [ 'enter', 'Name', 'name', 'OperationDefinition' ],
      [ 'leave', 'Name', 'name', 'OperationDefinition' ],
      [ 'enter', 'VariableDefinition', 0, undefined ],
      [ 'enter', 'Variable', 'variable', 'VariableDefinition' ],
      [ 'enter', 'Name', 'name', 'Variable' ],
      [ 'leave', 'Name', 'name', 'Variable' ],
      [ 'leave', 'Variable', 'variable', 'VariableDefinition' ],
      [ 'enter', 'NamedType', 'type', 'VariableDefinition' ],
      [ 'enter', 'Name', 'name', 'NamedType' ],
      [ 'leave', 'Name', 'name', 'NamedType' ],
      [ 'leave', 'NamedType', 'type', 'VariableDefinition' ],
      [ 'leave', 'VariableDefinition', 0, undefined ],
      [ 'enter', 'VariableDefinition', 1, undefined ],
      [ 'enter', 'Variable', 'variable', 'VariableDefinition' ],
      [ 'enter', 'Name', 'name', 'Variable' ],
      [ 'leave', 'Name', 'name', 'Variable' ],
      [ 'leave', 'Variable', 'variable', 'VariableDefinition' ],
      [ 'enter', 'NamedType', 'type', 'VariableDefinition' ],
      [ 'enter', 'Name', 'name', 'NamedType' ],
      [ 'leave', 'Name', 'name', 'NamedType' ],
      [ 'leave', 'NamedType', 'type', 'VariableDefinition' ],
      [ 'enter', 'EnumValue', 'defaultValue', 'VariableDefinition' ],
      [ 'leave', 'EnumValue', 'defaultValue', 'VariableDefinition' ],
      [ 'leave', 'VariableDefinition', 1, undefined ],
      [ 'enter', 'SelectionSet', 'selectionSet', 'OperationDefinition' ],
      [ 'enter', 'Field', 0, undefined ],
      [ 'enter', 'Name', 'alias', 'Field' ],
      [ 'leave', 'Name', 'alias', 'Field' ],
      [ 'enter', 'Name', 'name', 'Field' ],
      [ 'leave', 'Name', 'name', 'Field' ],
      [ 'enter', 'Argument', 0, undefined ],
      [ 'enter', 'Name', 'name', 'Argument' ],
      [ 'leave', 'Name', 'name', 'Argument' ],
      [ 'enter', 'ListValue', 'value', 'Argument' ],
      [ 'enter', 'IntValue', 0, undefined ],
      [ 'leave', 'IntValue', 0, undefined ],
      [ 'enter', 'IntValue', 1, undefined ],
      [ 'leave', 'IntValue', 1, undefined ],
      [ 'leave', 'ListValue', 'value', 'Argument' ],
      [ 'leave', 'Argument', 0, undefined ],
      [ 'enter', 'SelectionSet', 'selectionSet', 'Field' ],
      [ 'enter', 'Field', 0, undefined ],
      [ 'enter', 'Name', 'name', 'Field' ],
      [ 'leave', 'Name', 'name', 'Field' ],
      [ 'leave', 'Field', 0, undefined ],
      [ 'enter', 'InlineFragment', 1, undefined ],
      [ 'enter', 'NamedType', 'typeCondition', 'InlineFragment' ],
      [ 'enter', 'Name', 'name', 'NamedType' ],
      [ 'leave', 'Name', 'name', 'NamedType' ],
      [ 'leave', 'NamedType', 'typeCondition', 'InlineFragment' ],
      [ 'enter', 'Directive', 0, undefined ],
      [ 'enter', 'Name', 'name', 'Directive' ],
      [ 'leave', 'Name', 'name', 'Directive' ],
      [ 'leave', 'Directive', 0, undefined ],
      [ 'enter', 'SelectionSet', 'selectionSet', 'InlineFragment' ],
      [ 'enter', 'Field', 0, undefined ],
      [ 'enter', 'Name', 'name', 'Field' ],
      [ 'leave', 'Name', 'name', 'Field' ],
      [ 'enter', 'SelectionSet', 'selectionSet', 'Field' ],
      [ 'enter', 'Field', 0, undefined ],
      [ 'enter', 'Name', 'name', 'Field' ],
      [ 'leave', 'Name', 'name', 'Field' ],
      [ 'leave', 'Field', 0, undefined ],
      [ 'enter', 'Field', 1, undefined ],
      [ 'enter', 'Name', 'alias', 'Field' ],
      [ 'leave', 'Name', 'alias', 'Field' ],
      [ 'enter', 'Name', 'name', 'Field' ],
      [ 'leave', 'Name', 'name', 'Field' ],
      [ 'enter', 'Argument', 0, undefined ],
      [ 'enter', 'Name', 'name', 'Argument' ],
      [ 'leave', 'Name', 'name', 'Argument' ],
      [ 'enter', 'IntValue', 'value', 'Argument' ],
      [ 'leave', 'IntValue', 'value', 'Argument' ],
      [ 'leave', 'Argument', 0, undefined ],
      [ 'enter', 'Argument', 1, undefined ],
      [ 'enter', 'Name', 'name', 'Argument' ],
      [ 'leave', 'Name', 'name', 'Argument' ],
      [ 'enter', 'Variable', 'value', 'Argument' ],
      [ 'enter', 'Name', 'name', 'Variable' ],
      [ 'leave', 'Name', 'name', 'Variable' ],
      [ 'leave', 'Variable', 'value', 'Argument' ],
      [ 'leave', 'Argument', 1, undefined ],
      [ 'enter', 'Directive', 0, undefined ],
      [ 'enter', 'Name', 'name', 'Directive' ],
      [ 'leave', 'Name', 'name', 'Directive' ],
      [ 'enter', 'Argument', 0, undefined ],
      [ 'enter', 'Name', 'name', 'Argument' ],
      [ 'leave', 'Name', 'name', 'Argument' ],
      [ 'enter', 'Variable', 'value', 'Argument' ],
      [ 'enter', 'Name', 'name', 'Variable' ],
      [ 'leave', 'Name', 'name', 'Variable' ],
      [ 'leave', 'Variable', 'value', 'Argument' ],
      [ 'leave', 'Argument', 0, undefined ],
      [ 'leave', 'Directive', 0, undefined ],
      [ 'enter', 'SelectionSet', 'selectionSet', 'Field' ],
      [ 'enter', 'Field', 0, undefined ],
      [ 'enter', 'Name', 'name', 'Field' ],
      [ 'leave', 'Name', 'name', 'Field' ],
      [ 'leave', 'Field', 0, undefined ],
      [ 'enter', 'FragmentSpread', 1, undefined ],
      [ 'enter', 'Name', 'name', 'FragmentSpread' ],
      [ 'leave', 'Name', 'name', 'FragmentSpread' ],
      [ 'leave', 'FragmentSpread', 1, undefined ],
      [ 'leave', 'SelectionSet', 'selectionSet', 'Field' ],
      [ 'leave', 'Field', 1, undefined ],
      [ 'leave', 'SelectionSet', 'selectionSet', 'Field' ],
      [ 'leave', 'Field', 0, undefined ],
      [ 'leave', 'SelectionSet', 'selectionSet', 'InlineFragment' ],
      [ 'leave', 'InlineFragment', 1, undefined ],
      [ 'leave', 'SelectionSet', 'selectionSet', 'Field' ],
      [ 'leave', 'Field', 0, undefined ],
      [ 'leave', 'SelectionSet', 'selectionSet', 'OperationDefinition' ],
      [ 'leave', 'OperationDefinition', 0, undefined ],
      [ 'enter', 'OperationDefinition', 1, undefined ],
      [ 'enter', 'Name', 'name', 'OperationDefinition' ],
      [ 'leave', 'Name', 'name', 'OperationDefinition' ],
      [ 'enter', 'SelectionSet', 'selectionSet', 'OperationDefinition' ],
      [ 'enter', 'Field', 0, undefined ],
      [ 'enter', 'Name', 'name', 'Field' ],
      [ 'leave', 'Name', 'name', 'Field' ],
      [ 'enter', 'Argument', 0, undefined ],
      [ 'enter', 'Name', 'name', 'Argument' ],
      [ 'leave', 'Name', 'name', 'Argument' ],
      [ 'enter', 'IntValue', 'value', 'Argument' ],
      [ 'leave', 'IntValue', 'value', 'Argument' ],
      [ 'leave', 'Argument', 0, undefined ],
      [ 'enter', 'Directive', 0, undefined ],
      [ 'enter', 'Name', 'name', 'Directive' ],
      [ 'leave', 'Name', 'name', 'Directive' ],
      [ 'leave', 'Directive', 0, undefined ],
      [ 'enter', 'SelectionSet', 'selectionSet', 'Field' ],
      [ 'enter', 'Field', 0, undefined ],
      [ 'enter', 'Name', 'name', 'Field' ],
      [ 'leave', 'Name', 'name', 'Field' ],
      [ 'enter', 'SelectionSet', 'selectionSet', 'Field' ],
      [ 'enter', 'Field', 0, undefined ],
      [ 'enter', 'Name', 'name', 'Field' ],
      [ 'leave', 'Name', 'name', 'Field' ],
      [ 'leave', 'Field', 0, undefined ],
      [ 'leave', 'SelectionSet', 'selectionSet', 'Field' ],
      [ 'leave', 'Field', 0, undefined ],
      [ 'leave', 'SelectionSet', 'selectionSet', 'Field' ],
      [ 'leave', 'Field', 0, undefined ],
      [ 'leave', 'SelectionSet', 'selectionSet', 'OperationDefinition' ],
      [ 'leave', 'OperationDefinition', 1, undefined ],
      [ 'enter', 'FragmentDefinition', 2, undefined ],
      [ 'enter', 'Name', 'name', 'FragmentDefinition' ],
      [ 'leave', 'Name', 'name', 'FragmentDefinition' ],
      [ 'enter', 'NamedType', 'typeCondition', 'FragmentDefinition' ],
      [ 'enter', 'Name', 'name', 'NamedType' ],
      [ 'leave', 'Name', 'name', 'NamedType' ],
      [ 'leave', 'NamedType', 'typeCondition', 'FragmentDefinition' ],
      [ 'enter', 'SelectionSet', 'selectionSet', 'FragmentDefinition' ],
      [ 'enter', 'Field', 0, undefined ],
      [ 'enter', 'Name', 'name', 'Field' ],
      [ 'leave', 'Name', 'name', 'Field' ],
      [ 'enter', 'Argument', 0, undefined ],
      [ 'enter', 'Name', 'name', 'Argument' ],
      [ 'leave', 'Name', 'name', 'Argument' ],
      [ 'enter', 'Variable', 'value', 'Argument' ],
      [ 'enter', 'Name', 'name', 'Variable' ],
      [ 'leave', 'Name', 'name', 'Variable' ],
      [ 'leave', 'Variable', 'value', 'Argument' ],
      [ 'leave', 'Argument', 0, undefined ],
      [ 'enter', 'Argument', 1, undefined ],
      [ 'enter', 'Name', 'name', 'Argument' ],
      [ 'leave', 'Name', 'name', 'Argument' ],
      [ 'enter', 'Variable', 'value', 'Argument' ],
      [ 'enter', 'Name', 'name', 'Variable' ],
      [ 'leave', 'Name', 'name', 'Variable' ],
      [ 'leave', 'Variable', 'value', 'Argument' ],
      [ 'leave', 'Argument', 1, undefined ],
      [ 'enter', 'Argument', 2, undefined ],
      [ 'enter', 'Name', 'name', 'Argument' ],
      [ 'leave', 'Name', 'name', 'Argument' ],
      [ 'enter', 'ObjectValue', 'value', 'Argument' ],
      [ 'enter', 'ObjectField', 0, undefined ],
      [ 'enter', 'Name', 'name', 'ObjectField' ],
      [ 'leave', 'Name', 'name', 'ObjectField' ],
      [ 'enter', 'StringValue', 'value', 'ObjectField' ],
      [ 'leave', 'StringValue', 'value', 'ObjectField' ],
      [ 'leave', 'ObjectField', 0, undefined ],
      [ 'leave', 'ObjectValue', 'value', 'Argument' ],
      [ 'leave', 'Argument', 2, undefined ],
      [ 'leave', 'Field', 0, undefined ],
      [ 'leave', 'SelectionSet', 'selectionSet', 'FragmentDefinition' ],
      [ 'leave', 'FragmentDefinition', 2, undefined ],
      [ 'enter', 'OperationDefinition', 3, undefined ],
      [ 'enter', 'SelectionSet', 'selectionSet', 'OperationDefinition' ],
      [ 'enter', 'Field', 0, undefined ],
      [ 'enter', 'Name', 'name', 'Field' ],
      [ 'leave', 'Name', 'name', 'Field' ],
      [ 'enter', 'Argument', 0, undefined ],
      [ 'enter', 'Name', 'name', 'Argument' ],
      [ 'leave', 'Name', 'name', 'Argument' ],
      [ 'enter', 'BooleanValue', 'value', 'Argument' ],
      [ 'leave', 'BooleanValue', 'value', 'Argument' ],
      [ 'leave', 'Argument', 0, undefined ],
      [ 'enter', 'Argument', 1, undefined ],
      [ 'enter', 'Name', 'name', 'Argument' ],
      [ 'leave', 'Name', 'name', 'Argument' ],
      [ 'enter', 'BooleanValue', 'value', 'Argument' ],
      [ 'leave', 'BooleanValue', 'value', 'Argument' ],
      [ 'leave', 'Argument', 1, undefined ],
      [ 'leave', 'Field', 0, undefined ],
      [ 'enter', 'Field', 1, undefined ],
      [ 'enter', 'Name', 'name', 'Field' ],
      [ 'leave', 'Name', 'name', 'Field' ],
      [ 'leave', 'Field', 1, undefined ],
      [ 'leave', 'SelectionSet', 'selectionSet', 'OperationDefinition' ],
      [ 'leave', 'OperationDefinition', 3, undefined ],
      [ 'leave', 'Document', undefined, undefined ]
    ]);
  });
});


text:
{% if site.expanded_footer %}

{{site.ef_about.heading}}

{{site.ef_about.content}}

{{site.ef_links.heading}}

               {% for link in site.ef_links.links %}

{{ link.title }}

               {% endfor %}

{{site.ef_contact.heading}}

                    <address class="footer-address">{{site.ef_contact.content}}</address>

{% endif %}

           © {{ site.time | date: '%Y' }} {{ site.name }} {% if site.show_footer_credit %}  | Strapless Theme{% endif %}


text:
[![npm version](https://badge.fury.io/js/obsremote-node.svg)](http://badge.fury.io/js/obsremote-node)

OBSRemote-node
==============

A node implementation for OBSRemote. OBSRemote allows control of Open Broadcaster Software over a remote connection.
https://github.com/bilhamil/OBSRemote

#Quickstart

    var OBSRemote = require('./main.js');
    var opts = {pass: "admin", host: "127.0.0.1"};
    var obs = new OBSRemote(opts);

    obs.events.on('connect', function(){
	    obs.MuteMic();
    });

#Options
host - obs-remote host name
port - obs-remote port
pass - obs-remote password
debug - prevents sending commands to obs-remote

#Licence
The MIT License (MIT)

Copyright (c) 2015 Stephen Poole

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Kernel Tuning Toolkit: Class Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

Kernel Tuning Toolkit 2.1

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Here is a list of all documented class members with links to the class documentation for each member:

- c -

CalculateNextConfiguration() : ktt::DeterministicSearcher, ktt::McmcSearcher, ktt::RandomSearcher, ktt::Searcher

ChangeArguments() : ktt::ComputeInterface

ClearBuffer() : ktt::ComputeInterface

ClearData() : ktt::Tuner

ComputationResult() : ktt::ComputationResult

ComputeApiInitializer() : ktt::ComputeApiInitializer

ConfigurationCount() : ktt::ConfigurationCount

ConfigurationDuration() : ktt::ConfigurationDuration

ConfigurationFraction() : ktt::ConfigurationFraction

CopyBuffer() : ktt::ComputeInterface

CopyBufferAsync() : ktt::ComputeInterface

CreateCompositeKernel() : ktt::Tuner

CreateConfiguration() : ktt::Tuner

CreateSimpleKernel() : ktt::Tuner

Generated by  1.9.3


text:
CREATE USER regress_dep_user;
CREATE USER regress_dep_user2;
CREATE USER regress_dep_user3;
CREATE GROUP regress_dep_group;

CREATE TABLE deptest (f1 serial primary key, f2 text) DISTRIBUTED BY (f1);

GRANT SELECT ON TABLE deptest TO GROUP regress_dep_group;
GRANT ALL ON TABLE deptest TO regress_dep_user, regress_dep_user2;

-- can't drop neither because they have privileges somewhere
DROP USER regress_dep_user;
DROP GROUP regress_dep_group;

-- if we revoke the privileges we can drop the group
REVOKE SELECT ON deptest FROM GROUP regress_dep_group;
DROP GROUP regress_dep_group;

-- can't drop the user if we revoke the privileges partially
REVOKE SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES ON deptest FROM regress_dep_user;
DROP USER regress_dep_user;

-- now we are OK to drop him
REVOKE TRIGGER ON deptest FROM regress_dep_user;
DROP USER regress_dep_user;

-- we are OK too if we drop the privileges all at once
REVOKE ALL ON deptest FROM regress_dep_user2;
DROP USER regress_dep_user2;

-- can't drop the owner of an object
-- the error message detail here would include a pg_toast_nnn name that
-- is not constant, so suppress it
\set VERBOSITY terse
ALTER TABLE deptest OWNER TO regress_dep_user3;
DROP USER regress_dep_user3;
\set VERBOSITY default

-- if we drop the object, we can drop the user too
DROP TABLE deptest;
DROP USER regress_dep_user3;

-- Test DROP OWNED
CREATE USER regress_dep_user0;
CREATE USER regress_dep_user1;
CREATE USER regress_dep_user2;
SET SESSION AUTHORIZATION regress_dep_user0;
-- permission denied
DROP OWNED BY regress_dep_user1;
DROP OWNED BY regress_dep_user0, regress_dep_user2;
REASSIGN OWNED BY regress_dep_user0 TO regress_dep_user1;
REASSIGN OWNED BY regress_dep_user1 TO regress_dep_user0;
-- this one is allowed
DROP OWNED BY regress_dep_user0;

CREATE TABLE deptest1 (f1 int unique) DISTRIBUTED BY (f1);
GRANT ALL ON deptest1 TO regress_dep_user1 WITH GRANT OPTION;

SET SESSION AUTHORIZATION regress_dep_user1;
CREATE TABLE deptest (a serial primary key, b text) DISTRIBUTED BY (a);
GRANT ALL ON deptest1 TO regress_dep_user2;
RESET SESSION AUTHORIZATION;
\z deptest1

DROP OWNED BY regress_dep_user1;
-- all grants revoked
\z deptest1
-- table was dropped
\d deptest

-- Test REASSIGN OWNED
GRANT ALL ON deptest1 TO regress_dep_user1;
GRANT CREATE ON DATABASE regression TO regress_dep_user1;

SET SESSION AUTHORIZATION regress_dep_user1;
CREATE SCHEMA deptest;
CREATE TABLE deptest (a serial primary key, b text);
ALTER DEFAULT PRIVILEGES FOR ROLE regress_dep_user1 IN SCHEMA deptest
  GRANT ALL ON TABLES TO regress_dep_user2;
CREATE FUNCTION deptest_func() RETURNS void LANGUAGE plpgsql
  AS $$ BEGIN END; $$;
CREATE TYPE deptest_enum AS ENUM ('red');
CREATE TYPE deptest_range AS RANGE (SUBTYPE = int4);

CREATE TABLE deptest2 (f1 int);
-- make a serial column the hard way
CREATE SEQUENCE ss1;
ALTER TABLE deptest2 ALTER f1 SET DEFAULT nextval('ss1');
ALTER SEQUENCE ss1 OWNED BY deptest2.f1;

-- When reassigning ownership of a composite type, its pg_class entry
-- should match
CREATE TYPE deptest_t AS (a int);
SELECT typowner = relowner
FROM pg_type JOIN pg_class c ON typrelid = c.oid WHERE typname = 'deptest_t';

RESET SESSION AUTHORIZATION;
REASSIGN OWNED BY regress_dep_user1 TO regress_dep_user2;
\dt deptest

SELECT typowner = relowner
FROM pg_type JOIN pg_class c ON typrelid = c.oid WHERE typname = 'deptest_t';

-- doesn't work: grant still exists
DROP USER regress_dep_user1;
DROP OWNED BY regress_dep_user1;
DROP USER regress_dep_user1;

DROP USER regress_dep_user2;
DROP OWNED BY regress_dep_user2, regress_dep_user0;
DROP USER regress_dep_user2;
DROP USER regress_dep_user0;


text:
$(document).ready(function() {
	$("#button-connexion").prop("disabled", true);
	$("#button-connexion, #button-inscription").css("transition", "0.5s all");
	var login = $("#input-login");
	var password = $("#input-password");

	$("#button-connexion").click(function() {
		if ($("#input-email").length >= 1) {
			$("#modal-formulaire .modal-title").text("Formulaire de connexion");
			$("#div-inscription").remove();
			$("#button-inscription").prop("disabled", false);
			checkSubmit();
		}
		else if (login.val().length > 0) {
			if (password.val().length > 0) {
				$("#button-connexion").removeClass("btn-primary").addClass("btn-warning");
				$.ajax({
					type: "POST",
					url: "/Atelier%20801%20Experiments/connexion",
					data: {
						login: login.val(),
						password: password.val()
					},
					dataType: "json",
					success: function (msg) {
						console.log(msg);
						if (msg.Error !== undefined) {
							$("#button-connexion").removeClass("btn-warning").addClass("btn-primary");
							$("#display-error").addClass("alert alert-danger").html(msg.Error);
						} else if (msg.Success !== undefined) {
							location.reload();
						}
					},
					error: function (err) {
						console.log(err.responseText);
					}
				});
			}
			else {
				password.parent().addClass("has-error");
				password.focus();
			}
		}
		else {
			login.parent().addClass("has-error");
			login.focus();
		}
	});

	$("#button-inscription").click(function() {
		if ($("#input-email").length <= 0) {
			$("#modal-formulaire .modal-title").text("Formulaire d'inscription");
			$("#form-connexion").append('
'
										+'
'
										+'
'
										+'		<input type="email" id="input-email" class="form-control" placeholder="Email" required/>'
										+'
'
										+'
'
										+'		<input type="checkbox" name="rules" required/> Ce même mot de passe est différent de mon compte Atelier 801.'
										+'
'
										+'
'
										+'
');
			$("#button-connexion").prop("disabled", false);
			$("#input-email").keyup(function() {
				if ($(this).val().length > 0) {
					$(this).parent().removeClass("has-error");
				}
				checkSubmit();
			});
			checkSubmit();
		}
		else if (login.val().length > 0) {
			if (password.val().length > 0) {
				if ($("#input-email").val().length > 0) {
					$("#button-inscription").removeClass("btn-primary").addClass("btn-warning");
					$.ajax({
						type: "POST",
						url: "controllers/global/inscription.php",
						data: {
							login: login.val(),
							password: password.val(),
							email: $("#input-email").val()
						},
						dataType: "json",
						success: function (msg) {
							console.log(msg);
							if (msg.Error !== undefined) {
								$("#button-inscription").removeClass("btn-warning").addClass("btn-primary");
								$("#display-error").addClass("alert alert-danger").html(msg.Error);
							} else if (msg.Success !== undefined) {
								location.reload();
							}
						},
						error: function (err) {
							console.log(err.responseText);
						}
					});
				}
				else {
					$("#input-email").parent().addClass("has-error");
					$("#input-email").focus();
				}
			}
			else {
				password.parent().addClass("has-error");
				password.focus();
			}
		}
		else {
			login.parent().addClass("has-error");
			login.focus();
		}
	});

	login.keyup(function() {
		if ($(this).val().length > 0) {
			$(this).parent().removeClass("has-error");
		}
		checkSubmit();
	});

	password.keyup(function() {
		if ($(this).val().length > 0) {
			$(this).parent().removeClass("has-error");
		}
		checkSubmit();
	});

	function checkSubmit() {
		if ($("#input-email").length <= 0) {
			if (login.val().length > 0 && password.val().length > 0) {
				$("#button-connexion").prop("disabled", false);
			}
			else {
				$("#button-connexion").prop("disabled", true);
			}
		}
		else {
			if (login.val().length > 0 && password.val().length > 0 && $("#input-email").val().length > 0) {
				$("#button-inscription").prop("disabled", false);
			}
			else {
				$("#button-inscription").prop("disabled", true);
			}
		}
	}
});


text:
<!DOCTYPE  html>

    <meta charset="utf-8">

    <title>doc</title>

grunt-contrib-handlebars v0.9.1

Precompile Handlebars templates to JST file.

Getting Started

This plugin requires Grunt ~0.4.0

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-contrib-handlebars --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-contrib-handlebars');

This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that you upgrade, but in case you can't please use v0.3.3.

Handlebars task

Run this task with the grunt handlebars command.

Task targets, files and options may be specified according to the grunt Configuring tasks guide.

Options

separator

Type: String
Default: linefeed + linefeed

Concatenated files will be joined on this string.

namespace

Type: String or false or function
Default: 'JST'

The namespace in which the precompiled templates will be assigned.  Use dot notation (e.g. App.Templates) for nested namespaces or false for no namespace wrapping.  When false with amd option set true, templates will be returned directly from the AMD wrapper.

Example:

options: {
  namespace: 'MyApp.Templates'
}

You can generate nested namespaces based on the file system paths of your templates by providing a function. The function will be called with one argument (the template filepath).  The function must return a dot notation based on the filepath.

Example:

options: {
  namespace: function(filename) {
    var names = filename.replace(/modules\/(.*)(\/\w+\.hbs)/, '$1');
    return names.split('/').join('.');
  },
  files: {
    'ns_nested_tmpls.js' : [ 'modules/**/*.hbs']
  }
}

partialsUseNamespace

Type: Boolean
Default: false

When set to true, partials will be registered in the namespace in addition to templates.

wrapped

Type: Boolean
Default: true

Determine if preprocessed template functions will be wrapped in Handlebars.template function.

node

Type: Boolean
Default: false

Enable the compiled file to be required on node.js by preppending and appending proper declarations. You can use the file safely on the front-end.

For this option to work you need to define the namespace option.

amd

Type: Boolean or String or Array
Default: false

Wraps the output file with an AMD define function and returns the compiled template namespace unless namespace has been explicitly set to false in which case the template function will be returned directly.

If String then that string will be used in the module definition define(['your_amd_opt_here'])

If Array then those strings will be used in the module definition.  'handlebars' should always be the first item in the array, eg: amd: ['handlebars', 'handlebars.helpers']

define(['handlebars'], function(Handlebars) {
    //...//
    return this['[template namespace]'];
});

commonjs

Type: Boolean
Default: false

Wraps the output file in a CommonJS module function, exporting the compiled templates. It will also add templates to the template namespace, unless namespace is explicitly set to false.

module.exports = function(Handlebars) {
    //...//
    Handlebars.template(…);
    return this['[template namespace]'];
};

When requiring the module in a CommonJS environment, pass in your Handlebars object.

var Handlebars = require('handlebars');
var templates = require('./templates')(Handlebars);

processContent

Type: function

This option accepts a function which takes two arguments (the template file content, and the filepath) and returns a string which will be used as the source for the precompiled template object.  The example below removes leading and trailing spaces to shorten templates.

options: {
  processContent: function(content, filepath) {
    content = content.replace(/^[\x20\t]+/mg, '').replace(/[\x20\t]+$/mg, '');
    content = content.replace(/^[\r\n]+/, '').replace(/[\r\n]*$/, '\n');
    return content;
  }
}

processAST

Type: function

This option accepts a function which takes one argument (the parsed Abstract Syntax Tree) and returns a modified version which will be used as the source for the precompiled template object.  The example below removes any partial and replaces it with the text foo.

options: {
  processAST: function(ast) {
    ast.statements.forEach(function(statement, i) {
      if (statement.type === 'partial') {
        ast.statements[i] = { type: 'content', string: 'foo' };
      }
    });
    return ast;
  }
}

processName

Type: function

This option accepts a function which takes one argument (the template filepath) and returns a string which will be used as the key for the precompiled template object.  The example below stores all templates on the default JST namespace in capital letters.

options: {
  processName: function(filePath) {
    return filePath.toUpperCase();
  }
}

processPartialName

Type: function

This option accepts a function which takes one argument (the partial filepath) and returns a string which will be used as the key for the precompiled partial object when it is registered in Handlebars.partials. The example below stores all partials using only the actual filename instead of the full path.

options: {
  processPartialName: function(filePath) { // input:  templates/_header.hbs
    var pieces = filePath.split("/");
    return pieces[pieces.length - 1]; // output: _header.hbs
  }
}
`

Note: If processPartialName is not provided as an option the default assumes that partials will be stored by stripping trailing underscore characters and filename extensions. For example, the path templates/_header.hbs will become header and can be referenced in other templates as {{> header}}.

partialRegex

Type: Regexp
Default: /^_/

This option accepts a regex that defines the prefix character that is used to identify Handlebars partial files.

// assumes partial files would be prefixed with "par_" ie: "par_header.hbs"
options: {
  partialRegex: /^par_/
}

partialsPathRegex

Type: Regexp
Default: /./

This option accepts a regex that defines the path to a directory of Handlebars partials files. The example below shows how to mark every file in a specific directory as a partial.

options: {
  partialRegex: /.*/,
  partialsPathRegex: /\/partials\//
}

compilerOptions

Type Object
Default: {}

This option allows you to specify a hash of options which will be passed directly to the Handlebars compiler.

options: {
  compilerOptions: {
    knownHelpers: {
      "my-helper": true,
      "another-helper": true
    },
    knownHelpersOnly: true
  }
}

Usage Examples

handlebars: {
  compile: {
    options: {
      namespace: "JST"
    },
    files: {
      "path/to/result.js": "path/to/source.hbs",
      "path/to/another.js": ["path/to/sources/*.hbs", "path/to/more/*.hbs"]
    }
  }
}

Release History

2014-11-09   v0.9.1   Fixes namespacing issues.

2014-10-16   v0.9.0   Update to Handlebars 2.0.

2014-04-15   v0.8.0   Less Verbose output. New custom AMD path options.

2014-03-03   v0.7.0   Update handlebars dep to ~1.3.0

2014-01-23   v0.6.1   Support function on namespace option.

2013-11-11   v0.6.0   Update handlebars dep to ~1.1.2

2013-11-07   v0.5.12   Pass file path into processContent.

2013-09-24   v0.5.11   Fix for broken partial pre-compilation.

2013-07-14   v0.5.10   Add commonjs option.

2013-05-30   v0.5.9   Allow passing compilerOptions to Handlebars compiler.

2013-03-14   v0.5.8   Update handlebars dep to ~1.0.10

2013-03-11   v0.5.7   Fix regression with 'wrapped' option.

2013-03-07   v0.5.6   Add new option, processAST

2013-02-27   v0.5.5   Add new options partialsUseNamespace, partialRegex, partialsPathRegex

2013-02-15   v0.5.4   First official release for Grunt 0.4.0.

2013-02-08   v0.5.4rc7   When namespace is false and amd is true, return handlebars templates directly from AMD wrapper.

2013-02-01   v0.5.3rc7   Add node option to produce dual node.js / front-end compiled file.

2013-01-29   v0.5.2rc7   Define handlebars as a dependency for AMD option.

2013-01-28   v0.5.1rc7   Add AMD compilation option. Add processContent option. Do not generate templates into a namespaces when namespace option is false.

2013-01-23   v0.5.0rc7   Updating grunt/gruntplugin dependencies to rc7. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. Default wrapped option to true.

2013-01-09   v0.4.0rc5   Updating to work with grunt v0.4.0rc5. Switching to this.files api.

2012-11-21   v0.3.3   Reset for each target

2012-10-12   v0.3.2   Rename grunt-contrib-lib dep to grunt-lib-contrib.

2012-10-03   v0.3.1   Bugfix default processPartialName.

2012-09-23   v0.3.0   Options no longer accepted from global config key.

2012-09-16   v0.2.3   Support for nested namespaces.

2012-09-12   v0.2.2   Escape single quotes in filenames.

2012-09-10   v0.2.0   Refactored from grunt-contrib into individual repo.

Task submitted by Tim Branyen

This file was generated on Sun Nov 09 2014 13:49:22.


text:
/**
 * Created by Samuel Gratzl on 25.02.2016.
 */
export class EmbeddedCLUE {
    constructor(parent, url, readyCallback) {
        this.readyCallback = readyCallback;
        this.l = this.onMessage.bind(this);
        this.callbacks = {};
        this.ready = false;
        this.iframe = document.createElement('iframe');
        this.iframe.src = url;
        window.addEventListener('message', this.l);
        parent.appendChild(this.iframe);
    }
    onMessage(event) {
        if (event.data.type !== 'caleydo' || !event.data.clue) {
            return;
        }
        this.onCLUEMessage(event.data.clue, event.data);
    }
    send(type, msg) {
        msg.type = 'caleydo';
        msg.clue = type;
        msg.ref = this.clue_random_id();
        return new Promise((resolve, reject) => {
            this.callbacks[msg.ref] = {
                resolve,
                reject,
                type
            };
            this.iframe.contentWindow.postMessage(msg, '*');
        });
    }
    showSlide(slide) {
        return this.send('show_slide', { slide });
    }
    jumpToState(state) {
        return this.send('jump_to', { state });
    }
    nextSlide() {
        return this.send('next_slide', {});
    }
    previousSlide() {
        return this.send('previous_slide', {});
    }
    onCLUEMessage(type, data) {
        if (type === 'jumped_to_initial') {
            //ready
            this.ready = true;
            this.readyCallback(this);
            return;
        }
        const d = this.callbacks[data.ref];
        delete this.callbacks[data.ref];
        if (/.*_error/.test(type)) {
            d.reject(data);
        }
        else {
            d.resolve(data);
        }
    }
    clue_random_id(length = 8) {
        let id = '';
        while (id.length < length) {
            id += Math.random().toString(36).slice(-8);
        }
        return id.substr(0, length);
    }
    static embedCLUE(parent, server, app, provenanceGraph) {
        const url = `${server}/${app}/#clue_graph=${provenanceGraph}&clue_contained=T&clue=P`;
        return new Promise((resolve) => {
            return new EmbeddedCLUE(parent, url, resolve);
        });
    }
}
//# sourceMappingURL=EmbeddedCLUE.js.map


text:
<?php
namespace Neos\FluidAdaptor\Tests\Unit\ViewHelpers;

use Neos\Flow\Http\Request;
use Neos\Flow\Http\Uri;
use Neos\FluidAdaptor\ViewHelpers\BaseViewHelper;
use Neos\FluidAdaptor\Tests\Unit\ViewHelpers\ViewHelperBaseTestcase;

require_once(__DIR__ . '/ViewHelperBaseTestcase.php');

/**
 */
class BaseViewHelperTest extends ViewHelperBaseTestcase
{
    /**
     * @test
     */
    public function renderTakesBaseUriFromControllerContext()
    {
        $baseUri = new Uri('http://typo3.org/');

        $this->request->expects($this->any())->method('getHttpRequest')->will($this->returnValue(Request::create($baseUri)));

        $viewHelper = new BaseViewHelper();
        $this->injectDependenciesIntoViewHelper($viewHelper);

        $expectedResult = '<base href="' . htmlspecialchars($baseUri) . '" />';
        $actualResult = $viewHelper->render();
        $this->assertSame($expectedResult, $actualResult);
    }

    /**
     * @test
     */
    public function renderEscapesBaseUri()
    {
        $baseUri = new Uri('<some nasty uri>');

        $this->request->expects($this->any())->method('getHttpRequest')->will($this->returnValue(Request::create($baseUri)));

        $viewHelper = new BaseViewHelper();
        $this->injectDependenciesIntoViewHelper($viewHelper);

        $expectedResult = '<base href="http://' . htmlspecialchars($baseUri) . '/" />';
        $actualResult = $viewHelper->render();
        $this->assertSame($expectedResult, $actualResult);
    }
}


text:
package com.capitalone.dashboard.collector;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.stereotype.Component;

import com.capitalone.dashboard.config.SplunkSettings;
import com.capitalone.dashboard.model.SplunkCollector;
import com.capitalone.dashboard.model.SplunkEvent;
import com.capitalone.dashboard.repository.BaseCollectorRepository;
import com.capitalone.dashboard.repository.SplunkCollectorRepository;
import com.capitalone.dashboard.repository.SplunkEventRepository;

@Component
public class SplunkEventCollectorTask extends CollectorTask<SplunkCollector>{
	private final static Logger LOG = LoggerFactory.getLogger(SplunkEventCollectorTask.class);
private final SplunkClient splunkClient;
private final SplunkCollectorRepository splunkRepository;
private final SplunkSettings splunkSettings;
private final SplunkEventRepository eventRepository;

@Autowired
public SplunkEventCollectorTask(TaskScheduler taskScheduler,
		                        SplunkClient splunkClient,
		                        SplunkCollectorRepository splunkRepository,
                                SplunkSettings splunkSettings,
                                SplunkEventRepository eventRepository) {
    super(taskScheduler, "Splunk");
    this.splunkClient = splunkClient;
    this.splunkRepository = splunkRepository;
    this.splunkSettings = splunkSettings;

    this.eventRepository = eventRepository;

}

@Override
public SplunkCollector getCollector() {
    return SplunkCollector.prototype();
}

@Override
public BaseCollectorRepository<SplunkCollector> getCollectorRepository() {
    return splunkRepository;
}

@Override
public String getCron() {
    return splunkSettings.getCron();
}

@Override
public void collect(SplunkCollector collector) {

        long start = System.currentTimeMillis();
        try {
			List<SplunkEvent> eventList = splunkClient.getSplunkEventList();

	    	log(eventList!=null ? eventList.get(0).toString(): "");
			cleanEvents();
			eventRepository.save(eventList);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			LOG.info(e.getStackTrace()[0].toString());
			LOG.info(e.getStackTrace()[1].toString());
			LOG.info(e.getStackTrace()[2].toString());
			LOG.info(e.getStackTrace()[3].toString());
			LOG.info(e.getStackTrace()[4].toString());

			LOG.info("Error");
		}
        log("Finished", start);

    }

public void cleanEvents(){

eventRepository.deleteAll();

}

}


text:
package usage

const testSuffix = ".test"


text:
set -e

#### FUNCTIONS

function set_listen_addresses() {
  sedEscapedValue="$(echo "$1" | sed 's/[\/&]/\\&/g')"
  sed -ri "s/^#?(listen_addresses\s*=\s*)\S+/\1'$sedEscapedValue'/" "$PGDATA/postgresql.conf"
}

function start_postgres() {
  directory=$1

  if systemctl status postgresql >/dev/null 2>&1; then
    return
  fi

  install -d -o postgres -g postgres /var/run/postgresql
  gosu postgres pg_ctl -D "$directory" -o "-c listen_addresses=''" -w start
}

function stop_postgres() {
  directory=$1

  if systemctl status postgresql  >/dev/null 2>&1; then
    return
  fi

  gosu postgres pg_ctl -D "$directory" -m fast -w stop
}

#### CHECK ENV VARIABLES

[[ -n "$PG_MAJOR" ]] || {
  echo 'Please make sure that the environment variable PG_MAJOR is set to something useful, e.g. 9.4' >&2
  exit 1
}

[[ -n "$PGDATA" ]] || {
  echo 'Please make sure that the environment variable PGDATA is set to something useful, e.g. /var/lib/pgsql/9.4/data' >&2
  exit 1
}

#### VARIABLES

PATH=/usr/pgsql-${PG_MAJOR}/bin:$PATH

export PG_MAJOR
export PGDATA
export PATH

#### SET MODE
#
# This should make the following code easier to read.
#
# $PGDATA/PG_VERSION is created by initdb. If this file exists the server has
# already been initialized.
#
# If the user passes POSTGRES_DB to the script assume, that the server has
# already been initialized and the user wants to add a new database only.

if [ ! -s "$PGDATA/PG_VERSION" -a -z "$POSTGRES_DB" ]; then
  MODE="firstrun"
else
  MODE="alreadyinitialized"
fi

#### USER DEFINED VARIABLES

: ${POSTGRES_PW:=$(uuidgen)}
: ${POSTGRES_DB:=postgres}
: ${POSTGRES_USER:=$POSTGRES_DB}
: ${POSTGRES_ENCODING:='UTF8'}

#### CHECK FOR ERRORS
#
# If postgresql has already been initialized, the user needs to pass either
# POSTGRES_DB or POSTGRES_USER to the script.

if [ $MODE == 'alreadyinitialized' -a -z "$POSTGRES_DB" -a -z "$POSTGRES_USER" ]; then
  cat >&2 <<-EOWARN
The database server and \"postgres\"-database have already been initialized.

To create a new database, run the following command. You need to add values for
the variables given down below.

# database and database user have different values
POSTGRES_USER= POSTGRES_PW= POSTGRES_DB= /usr/local/bin/pg-init.sh

# database and database user are the same
POSTGRES_USER= POSTGRES_PW= /usr/local/bin/pg-init.sh

# database and database user are the same and you want us to generate the password
POSTGRES_USER= /usr/local/bin/pg-init.sh
EOWARN
  exit 1
fi

if [ "$MODE" == 'firstrun' ]; then
  # Make postgres own PGDATA
  echo "Changing owner of $PGDATA to postgres:postgres" >&2
  chown -R postgres:postgres $PGDATA

  # Setup postgres
  echo "Initialize postgres" >&2
  gosu postgres initdb

  # Modify listen addresses
  echo "Set listeners" >&2
  set_listen_addresses '*'

  # check password first so we can ouptut the warning before postgres
  # messes it up
  echo $POSTGRES_PW > $PGDATA/.password
    cat >&2 <<-EOS
    ********************************************************
    *
    * WARNING: We saved the password  for the "postgres"-
    * database to the file "$PGDATA/.password." Please remove
    * the file after storing the password at a safe place.
    *
    ********************************************************
EOS

  # Start postgresql
  start_postgres $PGDATA

  psql --username postgres <<-EOS
  ALTER USER "postgres" WITH SUPERUSER PASSWORD '$POSTGRES_PW';
EOS

echo "Accepting connectiongs from everywhere" >&1
cat >> "$PGDATA"/pg_hba.conf <<-EOS

host all all 0.0.0.0/0 md5
EOS

  # Stop postgresql
  stop_postgres $PGDATA

  exit 0
fi

if [ "$MODE" == "alreadyinitialized" -a "$POSTGRES_DB" != "postgres" ]; then
  # Start postgresql
  start_postgres $PGDATA

  if [ "$POSTGRES_USER" != "postgres" ]; then
    echo "Creating role/user $POSTGRES_USER" >&2
    psql --username postgres <<-EOS
CREATE ROLE $POSTGRES_USER WITH LOGIN NOSUPERUSER NOCREATEDB PASSWORD '$POSTGRES_PW';
EOS
  fi

  if [ "$POSTGRES_DB" != "postgres" ]; then
    echo "Creating database $POSTGRES_DB" >&2
    psql --username postgres <<-EOS
CREATE DATABASE $POSTGRES_DB WITH OWNER $POSTGRES_USER ENCODING '$POSTGRES_ENCODING';
EOS
  fi

  # Stop postgresql
  stop_postgres $PGDATA
fi


text:
package org.finra.herd.app;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

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

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.web.WebAppConfiguration;

import org.finra.herd.app.config.AppTestSpringModuleConfig;
import org.finra.herd.app.security.HttpHeaderApplicationUserBuilder;
import org.finra.herd.app.security.HttpHeaderAuthenticationFilter;
import org.finra.herd.app.security.TrustedApplicationUserBuilder;
import org.finra.herd.app.security.TrustedUserAuthenticationFilter;
import org.finra.herd.model.api.xml.NamespaceAuthorization;
import org.finra.herd.model.dto.ApplicationUser;
import org.finra.herd.model.dto.ConfigurationValue;
import org.finra.herd.model.dto.SecurityUserWrapper;
import org.finra.herd.rest.AbstractRestTest;

/**
 * This is an abstract base class that provides useful methods for REST test drivers.
 */
@ContextConfiguration(classes = AppTestSpringModuleConfig.class, inheritLocations = false)
@WebAppConfiguration
public abstract class AbstractAppTest extends AbstractRestTest
{
    @Autowired
    protected TrustedUserAuthenticationFilter trustedUserAuthenticationFilter;

    @Autowired
    protected HttpHeaderAuthenticationFilter httpHeaderAuthenticationFilter;

    /**
     * Invalidated the user in session and also clears the spring security context.
     */
    protected void invalidateApplicationUser(HttpServletRequest request)
    {
        if (request != null)
        {
            HttpSession session = request.getSession(false);
            if (session != null)
            {
                session.invalidate();
            }
        }

        SecurityContextHolder.clearContext();
    }

    protected MockHttpServletRequest getRequestWithHeaders(String userId, String shortUserId, String firstName, String lastName, String email, String memberOf,
        String sessionInitTime)
    {
        MockHttpServletRequest request = new MockHttpServletRequest();

        if (StringUtils.isNotBlank(userId))
        {
            request.addHeader("userId", userId);
        }
        if (StringUtils.isNotBlank(shortUserId))
        {
            request.addHeader("shortUserId", shortUserId);
        }
        if (StringUtils.isNotBlank(firstName))
        {
            request.addHeader("firstName", firstName);
        }
        if (StringUtils.isNotBlank(lastName))
        {
            request.addHeader("lastName", lastName);
        }
        if (StringUtils.isNotBlank(email))
        {
            request.addHeader("email", email);
        }
        if (StringUtils.isNotBlank(memberOf))
        {
            request.addHeader("roles", memberOf);
        }
        if (StringUtils.isNotBlank(sessionInitTime))
        {
            request.addHeader("sessionInitTime", sessionInitTime);
        }

        return request;
    }

    protected Map<String, Object> getDefaultSecurityEnvironmentVariables()
    {
        Map<String, Object> defaultEnvironmentVariables = new HashMap<>();
        defaultEnvironmentVariables.put(ConfigurationValue.SECURITY_HTTP_HEADER_NAMES.getKey(), "useridHeader=userId|shortUseridHeader=shortUserId|" +
            "firstNameHeader=firstName|lastNameHeader=lastName|emailHeader=email|rolesHeader=roles|sessionInitTimeHeader=sessionInitTime");
        defaultEnvironmentVariables.put(ConfigurationValue.SECURITY_HTTP_HEADER_ROLE_REGEX.getKey(), "(?<role>.+?)(,|$)");
        defaultEnvironmentVariables.put(ConfigurationValue.SECURITY_HTTP_HEADER_ROLE_REGEX_GROUP.getKey(), "role");
        defaultEnvironmentVariables.put(ConfigurationValue.USER_NAMESPACE_AUTHORIZATION_ENABLED.getKey(), "true");
        return defaultEnvironmentVariables;
    }

    protected Map<String, Object> getDefaultSecurityEnvironmentVariablesWithMultiHeaderRoles()
    {
        Map<String, Object> defaultEnvironmentVariables = new HashMap<>();
        defaultEnvironmentVariables.put(ConfigurationValue.SECURITY_HTTP_HEADER_NAMES.getKey(), "useridHeader=userId|shortUseridHeader=shortUserId" +
            "|firstNameHeader=firstName|lastNameHeader=lastName|emailHeader=email|sessionInitTimeHeader=sessionInitTime|useridSuffixHeader=useridSuffix");
        defaultEnvironmentVariables.put(ConfigurationValue.SECURITY_HTTP_HEADER_NAME_ROLE_REGEX.getKey(), "priv(.+)");
        defaultEnvironmentVariables.put(ConfigurationValue.SECURITY_HTTP_HEADER_ROLE_VALUE.getKey(), "valid");
        defaultEnvironmentVariables.put(ConfigurationValue.USER_NAMESPACE_AUTHORIZATION_ENABLED.getKey(), "true");
        return defaultEnvironmentVariables;
    }

    /**
     * Delegates to validateHttpHeaderApplicationUser(String, String, String, String, Set, String) with a single role.
     *
     * @param expectedUserId the expected user Id.
     * @param expectedFirstName the expected first name.
     * @param expectedLastName the expected last name.
     * @param expectedEmail the expected e-mail.
     * @param expectedRole the expected role.
     * @param expectedSessionInitTime the expected session init time.
     * @param expectedFunctions the expected functions.
     *
     * @throws Exception if any errors were encountered.
     */
    protected void validateHttpHeaderApplicationUser(String expectedUserId, String expectedFirstName, String expectedLastName, String expectedEmail,
        String expectedRole, String expectedSessionInitTime, String[] expectedFunctions, Set<NamespaceAuthorization> expectedNamespaceAuthorizations)
        throws Exception
    {
        Set<String> roles = new HashSet<>();
        if (expectedRole != null)
        {
            roles.add(expectedRole);
        }
        validateHttpHeaderApplicationUser(expectedUserId, expectedFirstName, expectedLastName, expectedEmail, roles, expectedSessionInitTime, expectedFunctions,
            expectedNamespaceAuthorizations);
    }

    /**
     * Retrieves the user from the current spring security context and asserts that each of the properties of the user matches the given expected values.
     * Asserts that the principal stored in the current security context user is an instance of {@link SecurityUserWrapper}.
     *
     * @param expectedUserId the expected user Id.
     * @param expectedFirstName the expected first name.
     * @param expectedLastName the expected last name.
     * @param expectedEmail the expected e-mail.
     * @param expectedRoles the expected roles.
     * @param expectedSessionInitTime the expected session init time.
     * @param expectedFunctions the expected functions.
     *
     * @throws Exception if any errors were encountered.
     */
    protected void validateHttpHeaderApplicationUser(String expectedUserId, String expectedFirstName, String expectedLastName, String expectedEmail,
        Set<String> expectedRoles, String expectedSessionInitTime, String[] expectedFunctions, Set<NamespaceAuthorization> expectedNamespaceAuthorizations)
        throws Exception
    {
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        assertNotNull(authentication);

        Object principal = authentication.getPrincipal();
        assertNotNull("expected principal to be not null, but was null", principal);
        assertTrue("expected principal to be an instance of " + SecurityUserWrapper.class + ", but was an instance of  " + principal.getClass(),
            principal instanceof SecurityUserWrapper);
        SecurityUserWrapper user = (SecurityUserWrapper) principal;
        ApplicationUser applicationUser = user.getApplicationUser();
        assertEquals(expectedUserId, applicationUser.getUserId());
        assertEquals(expectedFirstName, applicationUser.getFirstName());
        assertEquals(expectedLastName, applicationUser.getLastName());
        assertEquals(expectedEmail, applicationUser.getEmail());

        assertEquals(expectedRoles, applicationUser.getRoles());
        if (StringUtils.isNotBlank(expectedSessionInitTime))
        {
            assertEquals(DateUtils.parseDate(expectedSessionInitTime, HttpHeaderApplicationUserBuilder.CALENDAR_PATTERNS),
                applicationUser.getSessionInitTime());
        }

        assertNotNull(applicationUser.getSessionId());

        assertEquals(HttpHeaderApplicationUserBuilder.class, applicationUser.getGeneratedByClass());

        // Validate functions.
        if (expectedFunctions != null)
        {
            Set<String> functions = new HashSet<>();
            for (GrantedAuthority grantedAuthority : user.getAuthorities())
            {
                functions.add(grantedAuthority.getAuthority());
            }

            for (String expectedFunction : expectedFunctions)
            {
                assertTrue(functions.contains(expectedFunction));
            }
        }

        // Validate namespace authorizations.
        if (expectedNamespaceAuthorizations != null)
        {
            assertEquals(expectedNamespaceAuthorizations, applicationUser.getNamespaceAuthorizations());
        }
    }

    protected void validateTrustedApplicationUser() throws Exception
    {
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        assertNotNull(authentication);

        SecurityUserWrapper user = (SecurityUserWrapper) authentication.getPrincipal();
        ApplicationUser applicationUser = user.getApplicationUser();
        assertEquals(TrustedApplicationUserBuilder.TRUSTED_USER_ID, applicationUser.getUserId());
        assertEquals(TrustedApplicationUserBuilder.TRUSTED_USER_FIRST_NAME, applicationUser.getFirstName());
        assertEquals(TrustedApplicationUserBuilder.TRUSTED_USER_LAST_NAME, applicationUser.getLastName());
        assertEquals(TrustedApplicationUserBuilder.TRUSTED_USER_EMAIL, applicationUser.getEmail());

        Set<String> roles = applicationUser.getRoles();
        assertTrue(roles.contains(TrustedApplicationUserBuilder.TRUSTED_USER_ROLE));
        assertNotNull(applicationUser.getSessionId());

        assertEquals(TrustedApplicationUserBuilder.class, applicationUser.getGeneratedByClass());
    }
}


text:
module.exports =  function(idValue, secretValue) {
  // twitter - https://dev.twitter.com/docs/api/1.1
  var config = {};
  config.enabled=true;
  config.type='oauth-1.0';
  config.authorizationUrl = 'https://api.twitter.com/oauth/authorize';
  config.requestTokenUrl = 'https://api.twitter.com/oauth/request_token';
  config.accessTokenUrl = 'https://api.twitter.com/oauth/access_token';
  config.baseUrl = 'https://api.twitter.com/1.1';
  config.defaultLoadUrl = '/account/verify_credentials.json';
  config.userIdPath = 'screen_name';
  config.clientId = idValue;
  config.clientSecret = secretValue;
  return config;
};


text:
type LRUCache struct {
    queue *Queue
    m map[int]*Node
}

type Node struct {
    key int
    val int
    pre *Node
    next *Node
}

type Queue struct {
    size int
    capacity int
    head *Node
    tail *Node
}

func Constructor(capacity int) LRUCache {
    head := &Node{-1, -1, nil, nil}
    tail := &Node{-1, -1, nil, nil}
    head.next = tail
    tail.pre = head
    queue := &Queue{0, capacity, head, tail}
    m := make(map[int]*Node)
    return LRUCache{queue, m}
}

func (this *LRUCache) Get(key int) int {
    if node, ok := this.m[key]; !ok {
        return -1
    }else {
        // found, update queue
        // remove from cur pos
        node.pre.next = node.next
        node.next.pre = node.pre
        // move to the head
        head := this.queue.head
        node.next = head.next
        head.next.pre = node
        head.next = node
        node.pre = head
        return node.val
    }
}

func (this *LRUCache) Put(key int, value int)  {
    if node, ok := this.m[key]; ok {
        // update
        this.m[key].val = value
        // remove from cur pos
        node.pre.next = node.next
        node.next.pre = node.pre
        // move to the head
        head := this.queue.head
        node.next = head.next
        head.next.pre = node
        head.next = node
        node.pre = head
    }else {
        // insert
        if this.queue.size < this.queue.capacity {
            node := &Node{key, value, nil, nil}
            // move to the head
            head := this.queue.head
            node.next = head.next
            head.next.pre = node
            head.next = node
            node.pre = head
            this.queue.size++
            this.m[key] = node
        }else {
            // remove the tail one
            tail := this.queue.tail.pre
            delete(this.m, tail.key)
            tail.pre.next = this.queue.tail
            this.queue.tail.pre = tail.pre

            node := &Node{key, value, nil, nil}
            // move to the head
            head := this.queue.head
            node.next = head.next
            head.next.pre = node
            head.next = node
            node.pre = head
            this.queue.size++
            this.m[key] = node

        }
    }
}

/**
 * Your LRUCache object will be instantiated and called as such:
 * obj := Constructor(capacity);
 * param_1 := obj.Get(key);
 * obj.Put(key,value);
 */


text:
<?php

namespace App\AdminBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Question
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="App\AdminBundle\Entity\QuestionTypeRepository")
 */
class QuestionType
{
   /**
    * @var integer
    *
    * @ORM\Column(name="id", type="integer")
    * @ORM\Id
    * @ORM\GeneratedValue(strategy="AUTO")
    */
   private $id;

   /**
   * @ORM\ManyToMany(targetEntity="App\AdminBundle\Entity\Langue", inversedBy="questionstype")
   * @ORM\JoinTable(name="questiontype_langue")
   */
    private $langues;

   /**
    * @var string
    *
    * @ORM\Column(name="Libelle", type="string", length=255)
    */
   private $libelle;

    /**
     * @var integer
     *
     * @ORM\Column(name="position", type="integer")
     */
    private $position;

    /**
     * @var integer
     *
     * @ORM\Column(name="value", type="integer")
     */
    private $value;

    public function __construct() {
        $this->langues = new \Doctrine\Common\Collections\ArrayCollection();
    }

   /**
    * Get id
    *
    * @return integer
    */
   public function getId()
   {
       return $this->id;
   }

   /**
    * Set libelle
    *
    * @param string $libelle
    * @return Question
    */
   public function setLibelle($libelle)
   {
       $this->libelle = $libelle;

       return $this;
   }

   /**
    * Get libelle
    *
    * @return string
    */
   public function getLibelle()
   {
       return $this->libelle;
   }

    /**
     * Set reponse
     *
     * @param \App\AdminBundle\Entity\Reponse $reponse
     * @return Question
     */
    public function setReponse(\App\AdminBundle\Entity\Reponse $reponse = null)
    {
        $this->reponse = $reponse;
        return $this;
    }

    /**
     * Get reponse
     *
     * @return \App\AdminBundle\Entity\Reponse
     */
    public function getReponse()
    {
        return $this->reponse;
    }

    /**
     * @param int $position
     */
    public function setPosition($position)
    {
        $this->position = $position;
    }

    /**
     * @return int
     */
    public function getPosition()
    {
        return $this->position;
    }

    /**
     * @param mixed $langues
     */
    public function setLangues($langues)
    {
        $this->langues = $langues;
    }

    /**
     * @return mixed
     */
    public function getLangues()
    {
        return $this->langues;
    }

}


text:
<?php
/**
 * Created by PhpStorm.
 * User: Welton
 * Date: 29/01/2015
 * Time: 00:20
 */

namespace Usuario\Adapter;

use Usuario\Entity\Usuario;
use Zend\Authentication\Adapter\AdapterInterface;
use Zend\Authentication\Result;
use Doctrine\ORM\EntityManager;

class Adapter implements AdapterInterface {

    protected $nome;
    protected $senha;

    protected $em;

    public function __construct(EntityManager $em){

        $this->em= $em;

    }

    public function authenticate(){

        $user= $this->em->getRepository('Usuario\Entity\Usuario')
                    ->findByUsuario(new Usuario() , $this->getNome(), $this->getSenha());

        //var_dump($user[0]->getAtivo());die;

        if($user[0]->getIdEmpresa()->getStatus() == 1){
            if($user[0]->getAtivo() == 1){
                if($user){
                    return new Result(Result::SUCCESS, $user, array());
                }else{
                    return new Result(Result::FAILURE_CREDENTIAL_INVALID, null, array(
                        'Não foi possivel conectar. Login ou senha invalida!'
                    ));
                }
            }else{
                return new Result(Result::FAILURE_CREDENTIAL_INVALID, null, array(
                    'Usuário não ativo! Entre em contato com seu gestor.'
                ));
            }
        }else{
            return new Result(Result::FAILURE_CREDENTIAL_INVALID, null, array(
                'Empresa bloqueada!'
            ));
        }

    }

    /**
     * @return mixed
     */
    public function getSenha()
    {
        return $this->senha;
    }

    /**
     * @param mixed $senha
     */
    public function setSenha($senha)
    {
        $this->senha = $senha;
        return $this;
    }

    /**
     * @return mixed
     */
    public function getNome()
    {
        return $this->nome;
    }

    /**
     * @param mixed $user
     */
    public function setNome($nome)
    {
        $this->nome = $nome;
        return $this;
    }

}


text:
from django.utils.http import http_date

class ConditionalGetMiddleware(object):
    """
    Handles conditional GET operations. If the response has a ETag or
    Last-Modified header, and the request has If-None-Match or
    If-Modified-Since, the response is replaced by an HttpNotModified.

    Also sets the Date and Content-Length response-headers.
    """
    def process_response(self, request, response):
        response['Date'] = http_date()
        if not response.has_header('Content-Length'):
            response['Content-Length'] = str(len(response.content))

        if response.has_header('ETag'):
            if_none_match = request.META.get('HTTP_IF_NONE_MATCH', None)
            if if_none_match == response['ETag']:
                # Setting the status is enough here. The response handling path
                # automatically removes content for this status code (in
                # http.conditional_content_removal()).
                response.status = 304

        if response.has_header('Last-Modified'):
            if_modified_since = request.META.get('HTTP_IF_MODIFIED_SINCE', None)
            if if_modified_since == response['Last-Modified']:
                # Setting the status code is enough here (same reasons as
                # above).
                response.status = 304

        return response

class SetRemoteAddrFromForwardedFor(object):
    """
    Middleware that sets REMOTE_ADDR based on HTTP_X_FORWARDED_FOR, if the
    latter is set. This is useful if you're sitting behind a reverse proxy that
    causes each request's REMOTE_ADDR to be set to 127.0.0.1.

    Note that this does NOT validate HTTP_X_FORWARDED_FOR. If you're not behind
    a reverse proxy that sets HTTP_X_FORWARDED_FOR automatically, do not use
    this middleware. Anybody can spoof the value of HTTP_X_FORWARDED_FOR, and
    because this sets REMOTE_ADDR based on HTTP_X_FORWARDED_FOR, that means
    anybody can "fake" their IP address. Only use this when you can absolutely
    trust the value of HTTP_X_FORWARDED_FOR.
    """
    def process_request(self, request):
        try:
            real_ip = request.META['HTTP_X_FORWARDED_FOR']
        except KeyError:
            return None
        else:
            # HTTP_X_FORWARDED_FOR can be a comma-separated list of IPs. The
            # client's IP will be the first one.
            real_ip = real_ip.split(",")[0].strip()
            request.META['REMOTE_ADDR'] = real_ip


text:
namespace DD.CBU.Compute.Api.Contracts.Datacenter
{
	/// <summary>
	///		Provides read-only access to detailed information about a disk speed specification.
	/// </summary>
	public interface IDiskSpeedDetail
	{
		/// <summary>
		///		Is the disk speed available at the parent data centre?
		/// </summary>
		bool IsAvailable
		{
			get;
		}

		/// <summary>
		///		Is the disk speed the default disk speed at the parent data centre?
		/// </summary>
		bool IsDefault
		{
			get;
		}

		/// <summary>
		///		The disk speed Id.
		/// </summary>
		string Id
		{
			get;
		}

		/// <summary>
		///		A display name for the disk speed.
		/// </summary>
		string DisplayName
		{
			get;
		}

		/// <summary>
		///		An abbreviated name for the disk speed.
		/// </summary>
		string Abbreviation
		{
			get;
		}

		/// <summary>
		///		A description of the disk speed.
		/// </summary>
		string Description
		{
			get;
		}
	}
}


text:
namespace LibGit2Sharp.Core
{
    internal enum GitErrorCode
    {
        /// <summary>
        ///   Operation completed successfully.
        /// </summary>
        GIT_SUCCESS = 0,

        /// <summary>
        ///   Operation failed, with unspecified reason.
        ///   This value also serves as the base error code; all other
        ///   error codes are subtracted from it such that all errors
        ///   are < 0, in typical POSIX C tradition.
        /// </summary>
        GIT_ERROR = -1,

        /// <summary>
        ///   Input was not a properly formatted Git object id.
        /// </summary>
        GIT_ENOTOID = -2,

        /// <summary>
        ///   Input does not exist in the scope searched.
        /// </summary>
        GIT_ENOTFOUND = -3,

        /// <summary>
        ///   Not enough space available.
        /// </summary>
        GIT_ENOMEM = -4,

        /// <summary>
        ///   Consult the OS error information.
        /// </summary>
        GIT_EOSERR = -5,

        /// <summary>
        ///   The specified object is of invalid type
        /// </summary>
        GIT_EOBJTYPE = -6,

        /// <summary>
        ///   The specified repository is invalid
        /// </summary>
        GIT_ENOTAREPO = -7,

        /// <summary>
        ///   The object type is invalid or doesn't match
        /// </summary>
        GIT_EINVALIDTYPE = -8,

        /// <summary>
        ///   The object cannot be written that because it's missing internal data
        /// </summary>
        GIT_EMISSINGOBJDATA = -9,

        /// <summary>
        ///   The packfile for the ODB is corrupted
        /// </summary>
        GIT_EPACKCORRUPTED = -10,

        /// <summary>
        ///   Failed to adquire or release a file lock
        /// </summary>
        GIT_EFLOCKFAIL = -11,

        /// <summary>
        ///   The Z library failed to inflate/deflate an object's data
        /// </summary>
        GIT_EZLIB = -12,

        /// <summary>
        ///   The queried object is currently busy
        /// </summary>
        GIT_EBUSY = -13,

        /// <summary>
        ///   The index file is not backed up by an existing repository
        /// </summary>
        GIT_EBAREINDEX = -14,

        /// <summary>
        ///   The name of the reference is not valid
        /// </summary>
        GIT_EINVALIDREFNAME = -15,

        /// <summary>
        ///   The specified reference has its data corrupted
        /// </summary>
        GIT_EREFCORRUPTED = -16,

        /// <summary>
        ///   The specified symbolic reference is too deeply nested
        /// </summary>
        GIT_ETOONESTEDSYMREF = -17,

        /// <summary>
        ///   The pack-refs file is either corrupted of its format is not currently supported
        /// </summary>
        GIT_EPACKEDREFSCORRUPTED = -18,

        /// <summary>
        ///   The path is invalid
        /// </summary>
        GIT_EINVALIDPATH = -19,

        /// <summary>
        ///   The revision walker is empty; there are no more commits left to iterate
        /// </summary>
        GIT_EREVWALKOVER = -20,

        /// <summary>
        ///   The state of the reference is not valid
        /// </summary>
        GIT_EINVALIDREFSTATE = -21,

        /// <summary>
        ///   This feature has not been implemented yet
        /// </summary>
        GIT_ENOTIMPLEMENTED = -22,

        /// <summary>
        ///   A reference with this name already exists
        /// </summary>
        GIT_EEXISTS = -23,

        /// <summary>
        ///   The given integer literal is too large to be parsed
        /// </summary>
        GIT_EOVERFLOW = -24,

        /// <summary>
        ///   The given literal is not a valid number
        /// </summary>
        GIT_ENOTNUM = -25,

        /// <summary>
        ///   Streaming error
        /// </summary>
        GIT_ESTREAM = -26,

        /// <summary>
        ///   invalid arguments to function
        /// </summary>
        GIT_EINVALIDARGS = -27,

        /// <summary>
        ///   The specified object has its data corrupted
        /// </summary>
        GIT_EOBJCORRUPTED = -28,

        /// <summary>
        ///   The given short oid is ambiguous
        /// </summary>
        GIT_EAMBIGUOUSOIDPREFIX = -29,

        /// <summary>
        ///   Skip and passthrough the given ODB backend
        /// </summary>
        GIT_EPASSTHROUGH = -30,
    }
}


text:
[travis-ci.org](http://travis-ci.org) results: [![Build
Status](https://secure.travis-ci.org/573/ppm2rgb.png?branch=master)](http://travis-ci.org/573/ppm2rgb)

{% comment %} vim: set filetype=markdown fileencoding=utf-8: {% endcomment %}


text:
#import "OBALabelAndTextFieldTableViewCell.h"

#define kOBATableWidth                       320
#define kOBASpacing                          5
#define kOBAMinLabelWidth                    97

@implementation OBALabelAndTextFieldTableViewCell

+ (OBALabelAndTextFieldTableViewCell*) getOrCreateCellForTableView:(UITableView*)tableView {

    static NSString *cellId = @"OBALabelAndTextFieldTableViewCell";

    // Try to retrieve from the table view a now-unused cell with the given identifier
    OBALabelAndTextFieldTableViewCell *cell = (OBALabelAndTextFieldTableViewCell *) [tableView dequeueReusableCellWithIdentifier:cellId];

    // If no cell is available, create a new one using the given identifier
    if (cell == nil) {
        NSArray * nib = [[NSBundle mainBundle] loadNibNamed:cellId owner:self options:nil];
        cell = nib[0];
        cell.textField.textAlignment = NSTextAlignmentRight;
        cell.textField.returnKeyType = UIReturnKeyDone;
        cell.accessoryType = UITableViewCellAccessoryNone;
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }

    return cell;
}

- (void)layoutSubviews {
    CGSize labelSize = [_label sizeThatFits:CGSizeZero];
    labelSize.width = MIN(labelSize.width, _label.bounds.size.width);

    CGRect textFieldFrame = _textField.frame;
    textFieldFrame.origin.x = _label.frame.origin.x + MAX(kOBAMinLabelWidth, labelSize.width) + kOBASpacing;
    if (!_label.text.length)
        textFieldFrame.origin.x = _label.frame.origin.x;
    textFieldFrame.size.width = kOBATableWidth - textFieldFrame.origin.x - _label.frame.origin.x;
    _textField.frame = textFieldFrame;
}

@end


text:
layout: plugin

id: slicer
title: Full-featured Slicer
description: A full-blown GUI-based slicer. Rotate and scale model; slice multiple STL files at a time; set layer height and other slicing settings.
author: Kenneth Jiang
license: AGPLv3

# today's date in format YYYY-MM-DD, e.g.
date: 2016-09-22

homepage: https://github.com/kennethjiang/OctoPrint-Slicer
source: https://github.com/kennethjiang/OctoPrint-Slicer
archive: https://github.com/kennethjiang/OctoPrint-Slicer/archive/master.zip

# set this to true if your plugin uses the dependency_links setup parameter to include
# library versions not yet published on PyPi. SHOULD ONLY BE USED IF THERE IS NO OTHER OPTION!
follow_dependency_links: false

tags:
- slicer
- gcode
- stl

screenshots:
- url: /assets/img/plugins/slicer/screenshot1.png
  alt: Slicer plugin screenshot
  caption: Slicer plugin screenshot

featuredimage: /assets/img/plugins/slicer/screenshot1.png

compatibility:
  # list of compatible versions, for example 1.2.0. If left empty no specific version requirement will be assumed
  octoprint:
  - 1.2.14

  # list of compatible operating systems, valid values are linux, windows, macos, leaving empty defaults to all
  os:
  - linux
  - windows
  - macos
---

Slicer plugin offers useful features that OctoPrint's built-in slicer doesn't have:

- Rotate, scale, and move STL models.
- Slice multiple STLs at a time.
- Auto-arrange models into optimized layout (experimental).
- Slice based on Cura profiles you upload to OctoPrint.
- Customizable slicing settings, including Basic (layer height, bed temperature ...) and Advanced (print speed, start/end G-code ...).
- More is coming...


text:
using SQLite;

namespace MvvmCross.Plugins.Sqlite
{
    public abstract class MvxSqliteConnectionFactoryBase : IMvxSqliteConnectionFactory
    {
        public abstract string GetPlattformDatabasePath(string databaseName);

        protected string GetConnectionString(SqLiteConfig config, bool prefixPlatformPath = true)
        {
            var path = prefixPlatformPath ? GetPlattformDatabasePath(config.DatabaseName) : config.DatabaseName;
            return path;
        }

        public SQLiteConnection GetConnection(string databaseName, bool prefixPlatformPath = true)
        {
            var config = new SqLiteConfig(databaseName);
            var databasePath = GetConnectionString(config, prefixPlatformPath);

            return new SQLiteConnection(databasePath, config.OpenFlags, config.StoreDateTimeAsTicks);
        }

        public SQLiteConnection GetConnection(SqLiteConfig config, bool prefixPlatformPath = true)
        {
            var databasePath = GetConnectionString(config, prefixPlatformPath);

            return new SQLiteConnection(databasePath, config.OpenFlags, config.StoreDateTimeAsTicks);
        }

        public SQLiteAsyncConnection GetAsyncConnection(string databaseName, bool prefixPlatformPath = true)
        {
            var config = new SqLiteConfig(databaseName);
            var databasePath = GetConnectionString(config, prefixPlatformPath);

            return new SQLiteAsyncConnection(databasePath, config.OpenFlags, config.StoreDateTimeAsTicks);
        }

        public SQLiteAsyncConnection GetAsyncConnection(SqLiteConfig config, bool prefixPlatformPath = true)
        {
            var databasePath = GetConnectionString(config, prefixPlatformPath);

            return new SQLiteAsyncConnection(databasePath, config.OpenFlags, config.StoreDateTimeAsTicks);
        }
    }
}


text:
using namespace Shaders;
using namespace ColorVertex;

void Shader::Render()
{
	// Set the shader parameters that it will use for rendering.
	Buffer()->PrepareMatrix(&(Features()->matrix));
	Buffer()->Restart();
	HLSLBase::Render();
}

void Shader::Initialize()
{
	// Create the vertex input layout description.
	// This setup needs to match the VertexType stucture in the ModelClass and in the shader.
	D3D11_INPUT_ELEMENT_DESC polygonLayout[2];
	polygonLayout[0].SemanticName = "POSITION";
	polygonLayout[0].SemanticIndex = 0;
	polygonLayout[0].Format = DXGI_FORMAT_R32G32B32_FLOAT;
	polygonLayout[0].InputSlot = 0;
	polygonLayout[0].AlignedByteOffset = 0;
	polygonLayout[0].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
	polygonLayout[0].InstanceDataStepRate = 0;

	polygonLayout[1].SemanticName = "COLOR";
	polygonLayout[1].SemanticIndex = 0;
	polygonLayout[1].Format = DXGI_FORMAT_R32G32B32A32_FLOAT;
	polygonLayout[1].InputSlot = 0;
	polygonLayout[1].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT;
	polygonLayout[1].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
	polygonLayout[1].InstanceDataStepRate = 0;

	// Nacitaj veci
	HLSLBase::Initialize(L"../Media/Shaders/color", "Color", polygonLayout, 2);
	Buffer()->Create(1);
	Buffer()->Add(sizeof(MatrixList));
}