text:
package ${groupId}.stage.processor.sample;

import ${groupId}.stage.lib.sample.Errors;

import com.streamsets.pipeline.api.Record;
import com.streamsets.pipeline.api.StageException;
import com.streamsets.pipeline.api.base.SingleLaneRecordProcessor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

public class SampleProcessor extends SingleLaneRecordProcessor {
  private static final Logger LOG = LoggerFactory.getLogger(SampleProcessor.class);

  private final String sampleConfig;

  /**
   * Creates a new instance of this processor. This processor is an example and is
   * effectively a no-op.
   *
   * @param sampleConfig is a dummy configuration parameter for this example.
   */
  public SampleProcessor(String sampleConfig) {
    this.sampleConfig = sampleConfig;
  }

  /** {@inheritDoc} */
  @Override
  protected List<ConfigIssue> init() {
    // Validate configuration values and open any required resources.
    List<ConfigIssue> issues = super.init();

    if (sampleConfig.equals("invalidValue")) {
      issues.add(
          getContext().createConfigIssue(
              Groups.SAMPLE.name(), "sampleConfig", Errors.SAMPLE_00, "Here's what's wrong..."
          )
      );
    }

    // If issues is not empty, the UI will inform the user of each configuration issue in the list.
    return issues;
  }

  /** {@inheritDoc} */
  @Override
  public void destroy() {
    // Clean up any open resources.
    super.destroy();
  }

  /** {@inheritDoc} */
  @Override
  protected void process(Record record, SingleLaneBatchMaker batchMaker) throws StageException {
    // TODO: Implement your record processing here, then add to the output batch.

    // This example is a no-op
    batchMaker.addRecord(record);
  }

}


text:
class RepositoryPaginator < SimpleDelegator
  def initialize(repo)
    @repo = repo
    @pipeline = []
    super(@repo)
  end

  def [](offset, limit)
    apply_pipeline(repo.all(limit, offset))
  end

  def map(*args, &block)
    pipeline.push([:map, block])

    self
  end

  def count
    repo.count
  end

private

  attr_reader :repo, :pipeline

  def apply_pipeline(results)
    pipeline.reduce(results) { |collection, (op, func)|
      collection.public_send(op, &func)
    }
  end
end

redpajama_set_name: RedPajamaGithub


text: default_app_config = 'mygoals.apps.MygoalsConfig'


text:
[![Powered by Dockwa](https://raw.githubusercontent.com/dockwa/openpixel/dockwa/by-dockwa.png)](https://engineering.dockwa.com/)

[![Version](https://img.shields.io/cocoapods/v/EmailPicker.svg?style=flat)](http://cocoapods.org/pods/EmailPicker)
[![License](https://img.shields.io/cocoapods/l/EmailPicker.svg?style=flat)](http://cocoapods.org/pods/EmailPicker)
[![Platform](https://img.shields.io/cocoapods/p/EmailPicker.svg?style=flat)](http://cocoapods.org/pods/EmailPicker)

## What It Is

EmailPicker is a simple Swift viewcontroller to easily select emails from a user's contacts and/or enter them manually. Great for sharing content or inviting users.

## Example
![Sample](https://github.com/dockwa/EmailPicker/blob/main/Example/Sample.gif)

To test out EmailPicker, just run `pod try EmailPicker` from your terminal, or clone the repo, and run `pod install` from the Example directory.

## Usage
Check out the example project for a usage example, like this:

```swift
let textToShow = "To share your fun results with some friends, please type their emails or select their names from the list. Enjoy!"
let picker = EmailPickerViewController(infoText: textToShow, doneButtonTitle: "Send", completion: {(result, vc) in
    vc.dismiss(animated: true) {
        switch result {
        case .selected(let emails):
            self.contactsLabel.text = "Selected Emails: \(emails)"
        case .cancelled:
            self.contactsLabel.text = "Cancelled!"
        }
    }
})
present(UINavigationController(rootViewController: picker), animated: true, completion: nil)
```

## Requirements
Swift 5.1
iOS 11.4

This is a Swift project and uses Swift specific features such as associated values on enums, so you cannot use this pod in Objective-C.

If you need backwards compatibility to iOS 8.0, use version 1.5.0 of this library.

## Installation

### Swift Package Manager

The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler.

Once you have your Swift package set up, adding SimpleImageSlider as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.

```swift
dependencies: [
    .package(url: "https://github.com/dockwa/EmailPicker", .upToNextMajor(from: "4.0.0"))
]
```

### CocoaPods

EmailPicker is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'EmailPicker'
```

## Author

Christian Hatch, [@commodoreftp](https://twitter.com/Commodoreftp)

## License

EmailPicker is available under the MIT license. See the LICENSE file for more info.


text:
Shows a message on a dimmed desktop that the user is forced to acknowledge. All other running programs are "dimmed" and cliking on them just makes the displayed message flush.

This ensures the attention of the user and makes it a great app for any script that needs to inform about something. All options (Title, Text, Icons etc.) can be set using command line parameters.

```
OverlayMessageBoxCmd.exe -Caption "Title of message" --symbol Information -Text "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna"
```

![Example image](/images/example.png?raw=true "Example image")

## General ##

Download the newest version from [Releases](https://github.com/texhex/OverlayMessageBox/releases/latest). It requires .NET Framework 4.5 or higher to be installed.

OverlayMessageBox comes with two different executable:

* ``OverlayMessageBoxCmd.exe`` is intent for use in batch files, scripts etc. that are already displaying a command prompt window.

* ``OverlayMessageBoxUI.exe`` is intent if you want to call it from a Windows application or any other executable and you want to avoid showing a command prompt window.

Except the different behavior of creating a command prompt window, both versions behave the same.

Please note that you will also need to copy ``OverlayMessageBox.dll``, both of them do not work if this file is missing.

## Usage ##

The most basic example is that you only display a message with this command:

``OverlayMessageBoxCmd.exe -Text "My text"``

![Example 1 image](/images/example1.png?raw=true "Example image 1")

For more control, you can specify the title, the caption and a different symbol:

``OverlayMessageBoxCmd.exe -Caption "Title" -Text "My text" -Symbol Warning``

![Example 2 image](/images/example2.png?raw=true "Example image 2")

You can also use a "Task Dialog" style message box which supports a headline before the text. Just specify the parameter "Headline" to use it:

``OverlayMessageBoxCmd.exe -Caption "Title" -Headline "The headline" -Text "My text" -Symbol Warning``

![Example 3 image](/images/example3.png?raw=true "Example image 3")

**Note**: When using ``-Headline`` together with ``-Symbol Question``, no icon will appear because Task Dialog does not support this symbol.

If you wish to split your text among multiple lines, you can use \n to insert line breaks.

``OverlayMessageBoxCmd.exe -Caption "Title" -Text "My text\nLine 2\nLine 3\n\nLine 5" -Symbol Warning``

![Example 5 image](/images/example5.png?raw=true "Example image 5")

## Working with buttons ##

You can also define which buttons are displayed and determine which button was selected by checking the return code.

```
OverlayMessageBoxCmd.exe -Caption "Title" -Headline "The headline" -Text "My text" -Symbol Warning -Buttonset YesNo
SET RETCODE=%ERRORLEVEL%

IF "%RETCODE%"=="104" goto YES
IF "%RETCODE%"=="105" goto NO
```

![Example 4 image](/images/example4.png?raw=true "Example image 4")

Each button has a different return code. To see the full list, use ``OverlayMessageBoxCmd.exe -?``

The download file (see [Releases](https://github.com/texhex/OverlayMessageBox/releases/latest)) contains a folder ``Examples`` that includes use batch files that use this method.

## Using it in your own program ##

In case you want to use it in your own .NET application, you can do so easily. Add a reference to OverlayMessageBox.dll and add it with USING:

```c#
 using OverlayMessageBox;
```

Then code right away

```c#
    OverlayMessageBoxSettings settings = new OverlayMessageBoxSettings();

    settings.Caption = "Title goes here";
    settings.Headline = "My Headline";
    settings.Text = "Sample text";
    settings.Symbol = OverlayMessageBoxSymbol.Warning;
    settings.ButtonSet = OverlayMessageBoxButtonSet.RetryCancel;

    if (OverlayMessageBox.OverlayMessageBox.Show(settings) == OverlayMessageBoxButton.Cancel)
    {
       MessageBox.Show("Cancel selected!");
    }
```

If you specify the Headline parameter (which will trigger a TaskDialog instead of a MessageBox), you need to add a reference to the new ComCtrl32.dll v6.0 with a manifest.

For details, please see: http://stackoverflow.com/questions/719251/unable-to-find-an-entry-point-named-taskdialogindirect-in-dll-comctl32

## Copyright and License ##

Copyright © 2012-2016 [Michael Hex](http://www.texhex.info/) ([@texhex](https://github.com/texhex/)).

Licensed under the **Apache License, Version 2.0**. For details, please see [LICENSE.txt](https://github.com/texhex/overlaymessagebox/blob/master/licenses/LICENSE.txt).


text:
import { GlobalState } from '../../globalState';
import { NodeMaterial } from 'babylonjs/Materials/Node/nodeMaterial';
import { Nullable } from 'babylonjs/types';
import { Observer } from 'babylonjs/Misc/observable';
import { Engine } from 'babylonjs/Engines/engine';
import { Scene } from 'babylonjs/scene';
import { Mesh } from 'babylonjs/Meshes/mesh';
import { Vector3 } from 'babylonjs/Maths/math.vector';
import { HemisphericLight } from 'babylonjs/Lights/hemisphericLight';
import { ArcRotateCamera } from 'babylonjs/Cameras/arcRotateCamera';
import { PreviewType } from './previewType';
import { Animation } from 'babylonjs/Animations/animation';
import { SceneLoader } from 'babylonjs/Loading/sceneLoader';
import { TransformNode } from 'babylonjs/Meshes/transformNode';
import { AbstractMesh } from 'babylonjs/Meshes/abstractMesh';
import { FramingBehavior } from 'babylonjs/Behaviors/Cameras/framingBehavior';
import { DirectionalLight } from 'babylonjs/Lights/directionalLight';
import { LogEntry } from '../log/logComponent';
import { PointerEventTypes } from 'babylonjs/Events/pointerEvents';
import { Color3, Color4 } from 'babylonjs/Maths/math.color';
import { PostProcess } from 'babylonjs/PostProcesses/postProcess';
import { Constants } from 'babylonjs/Engines/constants';
import { CurrentScreenBlock } from 'babylonjs/Materials/Node/Blocks/Dual/currentScreenBlock';
import { NodeMaterialModes } from 'babylonjs/Materials/Node/Enums/nodeMaterialModes';
import { ParticleSystem } from 'babylonjs/Particles/particleSystem';
import { IParticleSystem } from 'babylonjs/Particles/IParticleSystem';
import { ParticleHelper } from 'babylonjs/Particles/particleHelper';
import { Texture } from 'babylonjs/Materials/Textures/texture';
import { ParticleTextureBlock } from 'babylonjs/Materials/Node/Blocks/Particle/particleTextureBlock';
import { FileTools } from 'babylonjs/Misc/fileTools';

export class PreviewManager {
    private _nodeMaterial: NodeMaterial;
    private _onBuildObserver: Nullable<Observer<NodeMaterial>>;
    private _onPreviewCommandActivatedObserver: Nullable<Observer<boolean>>;
    private _onAnimationCommandActivatedObserver: Nullable<Observer<void>>;
    private _onUpdateRequiredObserver: Nullable<Observer<void>>;
    private _onPreviewBackgroundChangedObserver: Nullable<Observer<void>>;
    private _onBackFaceCullingChangedObserver: Nullable<Observer<void>>;
    private _onDepthPrePassChangedObserver: Nullable<Observer<void>>;
    private _onLightUpdatedObserver: Nullable<Observer<void>>;
    private _engine: Engine;
    private _scene: Scene;
    private _meshes: AbstractMesh[];
    private _camera: ArcRotateCamera;
    private _material: NodeMaterial;
    private _globalState: GlobalState;
    private _currentType: number;
    private _lightParent: TransformNode;
    private _postprocess: Nullable<PostProcess>;
    private _particleSystem: Nullable<IParticleSystem>;

    public constructor(targetCanvas: HTMLCanvasElement, globalState: GlobalState) {
        this._nodeMaterial = globalState.nodeMaterial;
        this._globalState = globalState;

        this._onBuildObserver = this._nodeMaterial.onBuildObservable.add((nodeMaterial) => {
            let serializationObject = nodeMaterial.serialize();
            this._updatePreview(serializationObject);
        });

        this._onPreviewCommandActivatedObserver = globalState.onPreviewCommandActivated.add((forceRefresh: boolean) => {
            if (forceRefresh) {
                this._currentType = -1;
            }
            this._refreshPreviewMesh();
        });

        this._onLightUpdatedObserver = globalState.onLightUpdated.add(() => {
            this._prepareLights();
        });

        this._onUpdateRequiredObserver = globalState.onUpdateRequiredObservable.add(() => {
            let serializationObject = this._nodeMaterial.serialize();
            this._updatePreview(serializationObject);
        });

        this._onPreviewBackgroundChangedObserver = globalState.onPreviewBackgroundChanged.add(() => {
            this._scene.clearColor = this._globalState.backgroundColor;
        });

        this._onAnimationCommandActivatedObserver = globalState.onAnimationCommandActivated.add(() => {
            this._handleAnimations();
        });

        this._onBackFaceCullingChangedObserver = globalState.onBackFaceCullingChanged.add(() => {
            this._material.backFaceCulling = this._globalState.backFaceCulling;
        });

        this._onDepthPrePassChangedObserver = globalState.onDepthPrePassChanged.add(() => {
            this._material.needDepthPrePass = this._globalState.depthPrePass;
        });

        this._engine = new Engine(targetCanvas, true);
        this._scene = new Scene(this._engine);
        this._scene.clearColor = this._globalState.backgroundColor;
        this._camera = new ArcRotateCamera("Camera", 0, 0.8, 4, Vector3.Zero(), this._scene);

        this._camera.lowerRadiusLimit = 3;
        this._camera.upperRadiusLimit = 10;
        this._camera.wheelPrecision = 20;
        this._camera.minZ = 0.1;
        this._camera.attachControl(targetCanvas, false);

        this._lightParent = new TransformNode("LightParent", this._scene);

        this._refreshPreviewMesh();

        this._engine.runRenderLoop(() => {
            this._engine.resize();
            this._scene.render();
        });

        let lastOffsetX: number | undefined = undefined;
        const lightRotationSpeed = 0.01;

        this._scene.onPointerObservable.add((evt) => {
            if (this._globalState.controlCamera) {
                return;
            }

            if (evt.type === PointerEventTypes.POINTERUP) {
                lastOffsetX = undefined;
                return;
            }

            if (evt.event.buttons !== 1) {
                return;
            }

            if (lastOffsetX === undefined) {
                lastOffsetX = evt.event.offsetX;
            }

            var rotateLighting = (lastOffsetX - evt.event.offsetX) * lightRotationSpeed;
            this._lightParent.rotation.y += rotateLighting;
            lastOffsetX = evt.event.offsetX;
        });

        // this._scene.registerBeforeRender(() => {
        //     if (this._camera.alpha === cameraLastRotation) {
        //         return;
        //     }
        //     if (!this._globalState.controlCamera) {
        //         return;
        //     }
        //     var rotateLighting = (this._camera.alpha - cameraLastRotation) * lightRotationParallaxSpeed;
        //     this._lightParent.rotate(Vector3.Up(), rotateLighting);
        //     cameraLastRotation = this._camera.alpha;
        // });
    }

    private _handleAnimations() {
        this._scene.stopAllAnimations();

        if (this._globalState.rotatePreview) {
            for (var root of this._scene.rootNodes) {
                let transformNode = root as TransformNode;

                if (transformNode.getClassName() === "TransformNode" || transformNode.getClassName() === "Mesh" || transformNode.getClassName() === "GroundMesh") {
                    if (transformNode.rotationQuaternion) {
                        transformNode.rotation = transformNode.rotationQuaternion.toEulerAngles();
                        transformNode.rotationQuaternion = null;
                    }
                    Animation.CreateAndStartAnimation("turnTable", root, "rotation.y", 60, 1200, transformNode.rotation.y, transformNode.rotation.y + 2 * Math.PI, 1);
                }
            }
        }
    }

    private _prepareLights() {
        // Remove current lights
        let currentLights = this._scene.lights.slice(0);

        for (var light of currentLights) {
            light.dispose();
        }

        // Create new lights based on settings
        if (this._globalState.hemisphericLight) {
            new HemisphericLight("Hemispheric light", new Vector3(0, 1, 0), this._scene);
        }

        if (this._globalState.directionalLight0) {
            let dir0 = new DirectionalLight("Directional light #0", new Vector3(0.841626576496605, -0.2193391004130599, -0.49351298337996535), this._scene);
            dir0.intensity = 0.9;
            dir0.diffuse = new Color3(0.9294117647058824, 0.9725490196078431, 0.996078431372549);
            dir0.specular = new Color3(0.9294117647058824, 0.9725490196078431, 0.996078431372549);
            dir0.parent = this._lightParent;
        }

        if (this._globalState.directionalLight1) {
            let dir1 = new DirectionalLight("Directional light #1", new Vector3(-0.9519937437504213, -0.24389315636999764, -0.1849974057546125), this._scene);
            dir1.intensity = 1.2;
            dir1.specular = new Color3(0.9803921568627451, 0.9529411764705882, 0.7725490196078432);
            dir1.diffuse = new Color3(0.9803921568627451, 0.9529411764705882, 0.7725490196078432);
            dir1.parent = this._lightParent;
        }
    }

    private _prepareScene() {
        this._camera.useFramingBehavior = this._globalState.mode === NodeMaterialModes.Material;

        switch (this._globalState.mode) {
            case NodeMaterialModes.Material: {
                this._prepareLights();

                var framingBehavior = this._camera.getBehaviorByName("Framing") as FramingBehavior;

                setTimeout(() => { // Let the behavior activate first
                    framingBehavior.framingTime = 0;
                    framingBehavior.elevationReturnTime = -1;

                    if (this._scene.meshes.length) {
                        var worldExtends = this._scene.getWorldExtends();
                        this._camera.lowerRadiusLimit = null;
                        this._camera.upperRadiusLimit = null;
                        framingBehavior.zoomOnBoundingInfo(worldExtends.min, worldExtends.max);
                    }

                    this._camera.pinchPrecision = 200 / this._camera.radius;
                    this._camera.upperRadiusLimit = 5 * this._camera.radius;
                });

                this._camera.wheelDeltaPercentage = 0.01;
                this._camera.pinchDeltaPercentage = 0.01;

                // Animations
                this._handleAnimations();
                break;
            }
            case NodeMaterialModes.PostProcess: {
                this._camera.radius = 4;
                this._camera.upperRadiusLimit = 10;
                break;
            }
            case NodeMaterialModes.Particle: {
                this._camera.radius = this._globalState.previewType === PreviewType.Explosion ? 50 : this._globalState.previewType === PreviewType.DefaultParticleSystem ? 6 : 20;
                this._camera.upperRadiusLimit = 5000;
                break;
            }
        }

        // Material
        let serializationObject = this._nodeMaterial.serialize();
        this._updatePreview(serializationObject);
    }

    private _refreshPreviewMesh() {
        if (this._currentType !== this._globalState.previewType || this._currentType === PreviewType.Custom) {
            this._currentType = this._globalState.previewType;
            if (this._meshes && this._meshes.length) {
                for (var mesh of this._meshes) {
                    mesh.dispose();
                }
            }
            this._meshes = [];

            let lights = this._scene.lights.slice(0);
            for (var light of lights) {
                light.dispose();
            }

            this._engine.releaseEffects();

            if (this._particleSystem) {
                this._particleSystem.onBeforeDrawParticlesObservable.clear();
                this._particleSystem.onDisposeObservable.clear();
                this._particleSystem.stop();
                this._particleSystem.dispose();
                this._particleSystem = null;
            }

            SceneLoader.ShowLoadingScreen = false;

            this._globalState.onIsLoadingChanged.notifyObservers(true);

            if (this._globalState.mode === NodeMaterialModes.Material) {
                switch (this._globalState.previewType) {
                    case PreviewType.Box:
                        SceneLoader.AppendAsync("https://models.babylonjs.com/", "roundedCube.glb", this._scene).then(() => {
                            this._meshes.push(...this._scene.meshes);
                            this._prepareScene();
                        });
                        return;
                    case PreviewType.Sphere:
                        this._meshes.push(Mesh.CreateSphere("dummy-sphere", 32, 2, this._scene));
                        break;
                    case PreviewType.Torus:
                        this._meshes.push(Mesh.CreateTorus("dummy-torus", 2, 0.5, 32, this._scene));
                        break;
                    case PreviewType.Cylinder:
                        SceneLoader.AppendAsync("https://models.babylonjs.com/", "roundedCylinder.glb", this._scene).then(() => {
                            this._meshes.push(...this._scene.meshes);
                            this._prepareScene();
                        });
                        return;
                    case PreviewType.Plane:
                        let plane = Mesh.CreateGround("dummy-plane", 2, 2, 128, this._scene);
                        plane.scaling.y = -1;
                        plane.rotation.x = Math.PI;
                        this._meshes.push(plane);
                        break;
                    case PreviewType.ShaderBall:
                        SceneLoader.AppendAsync("https://models.babylonjs.com/", "shaderBall.glb", this._scene).then(() => {
                            this._meshes.push(...this._scene.meshes);
                            this._prepareScene();
                        });
                        return;
                    case PreviewType.Custom:
                        SceneLoader.AppendAsync("file:", this._globalState.previewFile, this._scene).then(() => {
                            this._meshes.push(...this._scene.meshes);
                            this._prepareScene();
                        });
                        return;
                }
            } else if (this._globalState.mode === NodeMaterialModes.Particle) {
                switch (this._globalState.previewType) {
                    case PreviewType.DefaultParticleSystem:
                        this._particleSystem = ParticleHelper.CreateDefault(new Vector3(0, 0, 0), 500, this._scene);
                        this._particleSystem.start();
                        break;
                    case PreviewType.Bubbles:
                        this._particleSystem = new ParticleSystem("particles", 4000, this._scene);
                        this._particleSystem.particleTexture = new Texture("https://assets.babylonjs.com/particles/textures/explosion/Flare.png", this._scene);
                        this._particleSystem.minSize = 0.1;
                        this._particleSystem.maxSize = 1.0;
                        this._particleSystem.minLifeTime = 0.5;
                        this._particleSystem.maxLifeTime = 5.0;
                        this._particleSystem.minEmitPower = 0.5;
                        this._particleSystem.maxEmitPower = 3.0;
                        this._particleSystem.createBoxEmitter(new Vector3(-1, 1, -1), new Vector3(1, 1, 1), new Vector3(-0.1, -0.1, -0.1), new Vector3(0.1, 0.1, 0.1));
                        this._particleSystem.emitRate = 100;
                        this._particleSystem.blendMode = ParticleSystem.BLENDMODE_ONEONE;
                        this._particleSystem.color1 = new Color4(1, 1, 0, 1);
                        this._particleSystem.color2 = new Color4(1, 0.5, 0, 1);
                        this._particleSystem.gravity = new Vector3(0, -1.0, 0);
                        this._particleSystem.start();
                        break;
                    case PreviewType.Explosion:
                        this._loadParticleSystem(this._globalState.previewType, 1);
                        return;
                    case PreviewType.Fire:
                    case PreviewType.Rain:
                    case PreviewType.Smoke:
                        this._loadParticleSystem(this._globalState.previewType);
                        return;
                    case PreviewType.Custom:
                        FileTools.ReadFile(this._globalState.previewFile, (json) =>  {
                            this._particleSystem = ParticleSystem.Parse(JSON.parse(json), this._scene, "");
                            this._particleSystem.start();
                            this._prepareScene();
                        }, undefined, false, (error) => {
                            console.log(error);
                        });
                        return;
                }
            }

            this._prepareScene();
        }
    }

    private _loadParticleSystem(particleNumber: number, systemIndex = 0, prepareScene = true) {
        let name = "";

        switch (particleNumber) {
            case PreviewType.Explosion:
                name = "explosion";
                break;
            case PreviewType.Fire:
                name = "fire";
                break;
            case PreviewType.Rain:
                name = "rain";
                break;
            case PreviewType.Smoke:
                name = "smoke";
                break;
        }

        ParticleHelper.CreateAsync(name, this._scene).then((set) => {
            for (let i = 0; i < set.systems.length; ++i) {
                if (i == systemIndex) {
                    this._particleSystem = set.systems[i];
                    this._particleSystem.disposeOnStop = true;
                    this._particleSystem.onDisposeObservable.add(() => {
                        this._loadParticleSystem(particleNumber, systemIndex, false);
                    });
                    this._particleSystem.start();
                } else {
                    set.systems[i].dispose();
                }
            }
            if (prepareScene) {
                this._prepareScene();
            } else {
                let serializationObject = this._nodeMaterial.serialize();
                this._updatePreview(serializationObject);
            }
        });
    }

    private _forceCompilationAsync(material: NodeMaterial, mesh: AbstractMesh): Promise<void> {
        return material.forceCompilationAsync(mesh);
    }

    private _updatePreview(serializationObject: any) {
        try {
            let store = NodeMaterial.IgnoreTexturesAtLoadTime;
            NodeMaterial.IgnoreTexturesAtLoadTime = false;
            let tempMaterial = NodeMaterial.Parse(serializationObject, this._scene);
            NodeMaterial.IgnoreTexturesAtLoadTime = store;

            tempMaterial.backFaceCulling = this._globalState.backFaceCulling;
            tempMaterial.needDepthPrePass = this._globalState.depthPrePass;

            if (this._postprocess) {
                this._postprocess.dispose(this._camera);
                this._postprocess = null;
            }

            switch (this._globalState.mode) {
                case NodeMaterialModes.PostProcess: {
                    this._globalState.onIsLoadingChanged.notifyObservers(false);

                    this._postprocess = tempMaterial.createPostProcess(this._camera, 1.0, Constants.TEXTURE_NEAREST_SAMPLINGMODE, this._engine);

                    const currentScreen = tempMaterial.getBlockByPredicate((block) => block instanceof CurrentScreenBlock);
                    if (currentScreen) {
                        this._postprocess.onApplyObservable.add((effect) => {
                            effect.setTexture("textureSampler", (currentScreen as CurrentScreenBlock).texture);
                        });
                    }

                    if (this._material) {
                        this._material.dispose();
                    }
                    this._material = tempMaterial;
                    break;
                }

                case NodeMaterialModes.Particle: {
                    this._globalState.onIsLoadingChanged.notifyObservers(false);

                    this._particleSystem!.onBeforeDrawParticlesObservable.clear();

                    this._particleSystem!.onBeforeDrawParticlesObservable.add((effect) => {
                        const textureBlock = tempMaterial.getBlockByPredicate((block) => block instanceof ParticleTextureBlock);
                        if (textureBlock && (textureBlock as ParticleTextureBlock).texture && effect) {
                            effect.setTexture("diffuseSampler", (textureBlock as ParticleTextureBlock).texture);
                        }
                    });
                    tempMaterial.createEffectForParticles(this._particleSystem!);

                    if (this._material) {
                        this._material.dispose();
                    }
                    this._material = tempMaterial;
                    break;
                }

                default: {
                    if (this._meshes.length) {
                        let tasks = this._meshes.map((m) => this._forceCompilationAsync(tempMaterial, m));

                        Promise.all(tasks).then(() => {
                            for (var mesh of this._meshes) {
                                mesh.material = tempMaterial;
                            }

                            if (this._material) {
                                this._material.dispose();
                            }

                            this._material = tempMaterial;
                            this._globalState.onIsLoadingChanged.notifyObservers(false);
                        }).catch((reason) => {
                            this._globalState.onLogRequiredObservable.notifyObservers(new LogEntry("Shader compilation error:\r\n" + reason, true));
                            this._globalState.onIsLoadingChanged.notifyObservers(false);
                        });
                    } else {
                        this._material = tempMaterial;
                    }
                    break;
                }
            }
        } catch (err) {
            // Ignore the error
            this._globalState.onIsLoadingChanged.notifyObservers(false);
        }
    }

    public dispose() {
        this._nodeMaterial.onBuildObservable.remove(this._onBuildObserver);
        this._globalState.onPreviewCommandActivated.remove(this._onPreviewCommandActivatedObserver);
        this._globalState.onUpdateRequiredObservable.remove(this._onUpdateRequiredObserver);
        this._globalState.onAnimationCommandActivated.remove(this._onAnimationCommandActivatedObserver);
        this._globalState.onPreviewBackgroundChanged.remove(this._onPreviewBackgroundChangedObserver);
        this._globalState.onBackFaceCullingChanged.remove(this._onBackFaceCullingChangedObserver);
        this._globalState.onDepthPrePassChanged.remove(this._onDepthPrePassChangedObserver);
        this._globalState.onLightUpdated.remove(this._onLightUpdatedObserver);

        if (this._material) {
            this._material.dispose();
        }

        this._camera.dispose();
        for (var mesh of this._meshes) {
            mesh.dispose();
        }

        this._scene.dispose();
        this._engine.dispose();
    }
}


text:
var fs = require('fs');
var tm = require('./tm');
var Bridge = require('tilelive-bridge');
var tilelive = require('tilelive');

var cache = {};

module.exports = source;
tilelive.protocols['xml:'] = source;
tilelive.protocols['tmsource:'] = source;
tilelive.protocols['pgvectiles:'] = source;
tilelive.protocols['pgsource:'] = source;

function source(arg, callback) {
    if (arg) {
        var sourceType = arg.protocol;
        var id = tm._config.source + arg.host;
        if (cache[id]) return callback(null, cache[id]);
        switch (sourceType) {
            case 'pgvectiles:':
                return callback(null, tm.pgtiles);
            default :
                var xml = fs.readFileSync(id, 'utf-8');
                var opts = {};
                function parsed(err, p) {
                    if (err) return callback(err);
                    opts.id = id;
                    opts.xml = p;
                    source.refresh(opts, callback);
                }
                if (sourceType == 'pgsource:')
                    tm.updateResourceFilepath(xml, tm._config.geo_data, parsed);
                else
                    tm.updateXMLFilePath(xml, tm._config.geo_data, parsed);
                break;
        }
    }
}

// Load or refresh the relevant source using specified data + xml.
source.refresh = function(rawdata, callback) {
    var id = rawdata.id;
    var uri = tm.parse(rawdata.id);
    var opts = {};
    opts.xml = rawdata.xml;
    opts.base = uri.dirname;
    new Bridge(opts, loaded);
    function loaded(err, p) {
        if (err) return callback(err);
        cache[id] = cache[id] || p;
        cache[id].xml = rawdata.xml;
        callback(null, cache[id]);
    }
};

// Set or get tile serving errors.
source.error = function(id, err) {
    if (!cache[id]) return false;
    cache[id].errors = cache[id].errors || [];
    if (err && cache[id].errors.indexOf(err.message) === -1) {
        cache[id].errors.push(err.message);
    }
    return cache[id].errors;
};


text:
var Backbone = require('backbone');
var _ = require('underscore');

var INPUT_TYPE_ORDER = ['size', 'color'];

module.exports = Backbone.Collection.extend({
  constructor: function (models, options) {
    options = _.extend(options || {}, { silent: false });
    Backbone.Collection.prototype.constructor.call(this, models, options);
  },

  comparator: function (m) {
    return INPUT_TYPE_ORDER.indexOf(m.get('type'));
  },

  initialize: function () {
    this.bind('change:selected', this._onSelectedChange, this);
    this.bind('change', this._onModelsChanged, this);
  },

  getSelected: function () {
    return this.find(function (model) {
      return model.get('selected');
    });
  },

  unselect: function () {
    this.each(function (model) {
      model.set('selected', false);
    }, this);
  },

  _onSelectedChange: function (itemModel, isSelected) {
    if (!isSelected) {
      return;
    }

    this.each(function (model) {
      if (model !== itemModel) {
        model.set('selected', false);
      }
    }, this);
  },

  _onModelsChanged: function (mdl) {
    var mdlChanges = mdl.changed;

    // If there is any change about selected, don't propagate it
    if (_.isEmpty(mdlChanges) || (_.size(mdlChanges) === 1 && mdl.changed.hasOwnProperty('selected'))) {
      return;
    }

    this.trigger('inputChanged', mdl, this);
  },

  getValues: function () {
    return this.reduce(function (memo, mdl) {
      var data = {};
      var typeValues = mdl.toJSON();

      if (typeValues.fixed) {
        data.fixed = typeValues.fixed;

        if (typeValues.type === 'color') {
          if (typeValues.image) {
            data.image = typeValues.image;
          }
          if (typeValues.kind) {
            data.kind = typeValues.kind;
          }
          data.opacity = typeValues.opacity;
        }
      } else {
        data = _.omit(typeValues, ['createContentView', 'selected', 'type']);
      }

      memo[typeValues.type] = data;

      return memo;
    }, {});
  }
});


text:
package org.apache.pulsar.functions.worker.service;

import java.io.IOException;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.pulsar.broker.ServiceConfiguration;
import org.apache.pulsar.broker.authentication.AuthenticationService;
import org.apache.pulsar.broker.authorization.AuthorizationService;
import org.apache.pulsar.broker.resources.PulsarResources;
import org.apache.pulsar.common.conf.InternalConfigurationData;
import org.apache.pulsar.common.nar.NarClassLoader;
import org.apache.pulsar.common.util.SimpleTextOutputStream;
import org.apache.pulsar.functions.worker.ErrorNotifier;
import org.apache.pulsar.functions.worker.WorkerConfig;
import org.apache.pulsar.functions.worker.WorkerService;
import org.apache.pulsar.functions.worker.service.api.Functions;
import org.apache.pulsar.functions.worker.service.api.FunctionsV2;
import org.apache.pulsar.functions.worker.service.api.Sinks;
import org.apache.pulsar.functions.worker.service.api.Sources;
import org.apache.pulsar.functions.worker.service.api.Workers;

/**
 * A worker service with its classloader.
 */
@Slf4j
@Data
@RequiredArgsConstructor
public class WorkerServiceWithClassLoader implements WorkerService {

    private final WorkerService service;
    private final NarClassLoader classLoader;

    @Override
    public WorkerConfig getWorkerConfig() {
        return service.getWorkerConfig();
    }

    @Override
    public void initAsStandalone(WorkerConfig workerConfig) throws Exception {
        service.initAsStandalone(workerConfig);
    }

    @Override
    public void initInBroker(ServiceConfiguration brokerConfig,
                             WorkerConfig workerConfig,
                             PulsarResources pulsarResources,
                             InternalConfigurationData internalConf) throws Exception {
        service.initInBroker(brokerConfig, workerConfig, pulsarResources, internalConf);
    }

    @Override
    public void start(AuthenticationService authenticationService,
                      AuthorizationService authorizationService,
                      ErrorNotifier errorNotifier) throws Exception {
        service.start(authenticationService, authorizationService, errorNotifier);
    }

    @Override
    public void stop() {
        service.stop();
        try {
            classLoader.close();
        } catch (IOException e) {
            log.warn("Failed to close the worker service class loader", e);
        }
    }

    @Override
    public boolean isInitialized() {
        return service.isInitialized();
    }

    @Override
    public Functions<? extends WorkerService> getFunctions() {
        return service.getFunctions();
    }

    @Override
    public FunctionsV2<? extends WorkerService> getFunctionsV2() {
        return service.getFunctionsV2();
    }

    @Override
    public Sinks<? extends WorkerService> getSinks() {
        return service.getSinks();
    }

    @Override
    public Sources<? extends WorkerService> getSources() {
        return service.getSources();
    }

    @Override
    public Workers<? extends WorkerService> getWorkers() {
        return service.getWorkers();
    }

    @Override
    public void generateFunctionsStats(SimpleTextOutputStream out) {
        service.generateFunctionsStats(out);
    }

}


text: A Java library for generating perfect and minimal-perfect hashes.


text:
CurrentDir=$PWD

if [ -z "$1" ]; then
  echo "using default generator"
  GeneratorOption=""
else
  echo "using $1"
  GeneratorOptions=-G"$1"
fi

CMAKE_OGG_INC_DIR=${CurrentDir}/Deps/include
CMAKE_VORBIS_INC_DIR=${CMAKE_OGG_INC_DIR}
CMAKE_OPENAL_INC_DIR=${CurrentDir}/../../ThirdParty-mod/openal-soft/include/AL

CMAKE_OGG_LIB_DIR=${CurrentDir}/Deps/lib
CMAKE_VORBIS_LIB_DIR=${CMAKE_OGG_LIB_DIR}
CMAKE_OPENAL_LIB_DIR=${CMAKE_OGG_LIB_DIR}

DepsIncPathOptions="-DCMAKE_OGG_INC_DIR=${CMAKE_OGG_INC_DIR} -DCMAKE_VORBIS_INC_DIR=${CMAKE_VORBIS_INC_DIR} -DCMAKE_OPENAL_INC_DIR=${CMAKE_OPENAL_INC_DIR}"
DepsLibPathOptions="-DCMAKE_OGG_LIB_DIR=${CMAKE_OGG_LIB_DIR} -DCMAKE_VORBIS_LIB_DIR=${CMAKE_VORBIS_LIB_DIR} -DCMAKE_OPENAL_LIB_DIR=${CMAKE_OPENAL_LIB_DIR}"

mkdir Release
cd Release
cmake -DCMAKE_BUILD_TYPE=Release  "${GeneratorOption}" ${DepsIncPathOptions} ${DepsLibPathOptions} ..

cd $CurrentDir

echo "go to $CurrentDir/Release to build the project"


text:
module StructJuMP

import MPI
import JuMP # To reexport, should be using (not import)
import MathProgBase
import MathProgBase.MathProgSolverInterface
import ReverseDiffSparse
import StructJuMPSolverInterface

export StructuredModel, getStructure, getparent, getchildren, getProcIdxSet,
       num_scenarios, @second_stage, getprobability, getMyRank

# ---------------
# StructureData
# ---------------
type MPIWrapper
    comm::MPI.Comm
    init::Function

    function MPIWrapper()
        instance = new(MPI.Comm(-1))
        finalizer(instance, freeMPIWrapper)

        instance.init = function(ucomm::MPI.Comm)
            if isdefined(:MPI) && MPI.Initialized() && ucomm.val == -1
                instance.comm = MPI.COMM_WORLD
            elseif isdefined(:MPI) && !MPI.Initialized()
                MPI.Init()
                instance.comm = MPI.COMM_WORLD
            elseif isdefined(:MPI) && MPI.Initialized() && ucomm.val != -1
                instance.comm = ucomm
            elseif isdefined(:MPI) && MPI.Finalized()
                error("MPI is already finalized!")
            else
                #doing nothing
            end
        end

        return instance
    end

end
function freeMPIWrapper(instance::MPIWrapper)
    if isdefined(:MPI) && MPI.Initialized() && !MPI.Finalized()
        MPI.Finalize()
    end
end

const mpiWrapper = MPIWrapper();

type StructureData
    probability::Vector{Float64}
    children::Dict{Int,JuMP.Model}
    parent
    num_scen::Int
    othermap::Dict{JuMP.Variable,JuMP.Variable}
    mpiWrapper::MPIWrapper
end

default_probability(m::JuMP.Model) = 1 / num_scenarios(m)
default_probability(::Void) = 1.0

# ---------------
# StructuredModel
# ---------------

# Constructor with the number of scenarios
function StructuredModel(;solver=JuMP.UnsetSolver(), parent=nothing, same_children_as=nothing, id=0, comm=MPI.Comm(-1), num_scenarios::Int=0, prob::Float64=default_probability(parent))
    m = JuMP.Model(solver=solver)
    if parent === nothing
        id = 0
        mpiWrapper.init(comm)
        JuMP.setsolvehook(m,StructJuMPSolverInterface.sj_solve)
    else
        @assert id != 0
        stoch = getStructure(parent)
        stoch.children[id] = m
        push!(stoch.probability, prob)
    end

    if same_children_as !== nothing
      if !isa(same_children_as, JuMP.Model) || !haskey(same_children_as.ext, :Stochastic)
        error("The JuMP model given for the argument `same_children_as' is not valid. Please create it using the `StructuredModel' function.")
      end
      probability = same_children_as.ext[:Stochastic].probability
      children = same_children_as.ext[:Stochastic].children
    else
      probability = Float64[]
      children = Dict{Int, JuMP.Model}()
    end
    m.ext[:Stochastic] = StructureData(probability, children, parent, num_scenarios, Dict{JuMP.Variable,JuMP.Variable}(), mpiWrapper)
    m
end

# -------------
# Get functions
# -------------

getStructure(m::JuMP.Model)  = m.ext[:Stochastic]::StructureData
getparent(m::JuMP.Model)      = getStructure(m).parent
getchildren(m::JuMP.Model)    = getStructure(m).children::Dict{Int,JuMP.Model}
getprobability(m::JuMP.Model) = getStructure(m).probability::Vector{Float64}
num_scenarios(m::JuMP.Model)  = getStructure(m).num_scen::Int

function getMyRank()
    myrank = 0;
    mysize = 1;
    if isdefined(:MPI) && MPI.Initialized() && !MPI.Finalized()
        comm = MPI.COMM_WORLD
        mysize = MPI.Comm_size(comm)
        myrank = MPI.Comm_rank(comm)
    end
    return myrank,mysize
end

function getProcIdxSet(numScens::Integer)
    mysize = 1;
    myrank = 0;
    if isdefined(:MPI) == true && MPI.Initialized() == true
        comm = MPI.COMM_WORLD
        mysize = MPI.Comm_size(comm)
        myrank = MPI.Comm_rank(comm)
    end
    # Why don't we just take a round-and-robin?
    proc_idx_set = Int[];
    for s = myrank:mysize:(numScens-1)
        push!(proc_idx_set, s+1);
    end
    return proc_idx_set;
end

function getProcIdxSet(m::JuMP.Model)
    numScens = num_scenarios(m)
    return getProcIdxSet(numScens)
end

macro second_stage(m,ind,code)
    return quote
        proc_idx_set = getProcIdxSet($(esc(m)))
        for $(esc(ind)) in proc_idx_set
            $(esc(code))
        end
    end
end

include("nlp.jl")

end


text:
package net.kwas.impatient.ch7

import org.scalatest._

class ExercisesSpec extends FlatSpec with Matchers {
  "Chapter 7 exercises" should "not explode" in {
    Exercises.main(Array.empty)
  }
}


text:
<?php

/**
 * BjyAuthorize Module (https://github.com/bjyoungblood/BjyAuthorize)
 *
 * @link https://github.com/bjyoungblood/BjyAuthorize for the canonical source repository
 * @license http://framework.zend.com/license/new-bsd New BSD License
 */

namespace Application\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity(repositoryClass="ProjectRepository")
 * @ORM\Table(name="projects")
 */
class Project
{

    /**
     * @var int
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @var string
     * @ORM\Column(type="string")
     */
    protected $title;

    /**
     * @var string
     * @ORM\Column(type="datetime",name="starting_date",nullable=true)
     */
    protected $startingDate;

    /**
     * @var string
     * @ORM\Column(type="datetime",name="closing_date",nullable=true)
     */
    protected $closingDate;

    /**
     * @var int
     * @ORM\Column(type="integer")
     */
    protected $status;

    /**
     * @ORM\ManyToOne(targetEntity="User", inversedBy="projects")
     * @ORM\JoinColumn(name="client_id", referencedColumnName="id",onDelete="CASCADE")
     */
    protected $client;

    /**
     * @ORM\ManyToMany(targetEntity="User")
     * @ORM\JoinTable(name="projects_developers",
     *      joinColumns={@ORM\JoinColumn(name="project_id", referencedColumnName="id",onDelete="CASCADE")},
     *      inverseJoinColumns={@ORM\JoinColumn(name="developer_id", referencedColumnName="id",onDelete="CASCADE")}
     *      )
     */
    private $developers;

    /**
     * @ORM\OneToMany(targetEntity="Memu", mappedBy="project")
     */
    protected $memus;

    /**
     * Initialies the roles variable.
     */
    public function __construct()
    {
	$this->developers = new \Doctrine\Common\Collections\ArrayCollection();
	$this->memus = new \Doctrine\Common\Collections\ArrayCollection();
	$this->status = 1;
    }

    // add
    public function addDeveloper(\Application\Entity\User $developer)
    {
	if (!$this->getDevelopers()->contains($developer) and $developer->getUserType() == 3)
	    $this->getDevelopers()->add($developer);
    }

    public function getId()
    {
	return $this->id;
    }

    public function setId($id)
    {
	$this->id = $id;
    }

    public function getTitle()
    {
	return $this->title;
    }

    public function setTitle($title)
    {
	$this->title = $title;
    }

    public function getStartingDate()
    {
	$date = $this->startingDate;
	return $date->format('d-m-Y');
    }

    public function setStartingDate($startingDate)
    {
	$this->startingDate = $startingDate;
    }

    public function getClosingDate()
    {
	return $this->closingDate;
    }

    public function setClosingDate($closingDate)
    {
	$this->closingDate = $closingDate;
    }

    public function getStatus()
    {
	return ($this->status) ? 'Enable' : 'Disabled';
    }

    public function getDBStatus()
    {
	return $this->status;
    }

    public function setStatus($status)
    {
	$this->status = $status;
    }

    public function getClient()
    {
	return $this->client;
    }

    public function setClient($client)
    {
	$this->client = $client;
    }

    public function getDevelopers()
    {
	return $this->developers;
    }

    public function setDevelopers($developers)
    {
	$this->developers = $developers;
    }

    public function getMemus()
    {
	return $this->memus;
    }

    public function setMemus($memus)
    {
	$this->memus = $memus;
    }

    /**
     * Convert the object to an array.
     *
     * @return array
     */
    public function getArrayCopy()
    {
	return get_object_vars($this);
    }

}


text:
/* Based on @sergeche's work in his emmet plugin */

import * as vscode from 'vscode';

const reNumber = /[0-9]/;

/**
 * Incerement number under caret of given editor
 */
export function incrementDecrement(delta: number): Thenable<boolean> | undefined {
	if (!vscode.window.activeTextEditor) {
		vscode.window.showInformationMessage('No editor is active');
		return;
	}
	const editor = vscode.window.activeTextEditor;

	return editor.edit(editBuilder => {
		editor.selections.forEach(selection => {
			const rangeToReplace = locate(editor.document, selection.isReversed ? selection.anchor : selection.active);
			if (!rangeToReplace) {
				return;
			}

			const text = editor.document.getText(rangeToReplace);
			if (isValidNumber(text)) {
				editBuilder.replace(rangeToReplace, update(text, delta));
			}
		});
	});
}

/**
 * Updates given number with `delta` and returns string formatted according
 * to original string format
 */
export function update(numString: string, delta: number): string {
	let m: RegExpMatchArray | null;
	const decimals = (m = numString.match(/\.(\d+)$/)) ? m[1].length : 1;
	let output = String((parseFloat(numString) + delta).toFixed(decimals)).replace(/\.0+$/, '');

	if (m = numString.match(/^\-?(0\d+)/)) {
		// padded number: preserve padding
		output = output.replace(/^(\-?)(\d+)/, (_, minus, prefix) =>
			minus + '0'.repeat(Math.max(0, (m ? m[1].length : 0) - prefix.length)) + prefix);
	}

	if (/^\-?\./.test(numString)) {
		// omit integer part
		output = output.replace(/^(\-?)0+/, '$1');
	}

	return output;
}

/**
 * Locates number from given position in the document
 *
 * @return Range of number or `undefined` if not found
 */
export function locate(document: vscode.TextDocument, pos: vscode.Position): vscode.Range | undefined {

	const line = document.lineAt(pos.line).text;
	let start = pos.character;
	let end = pos.character;
	let hadDot = false, hadMinus = false;
	let ch;

	while (start > 0) {
		ch = line[--start];
		if (ch === '-') {
			hadMinus = true;
			break;
		} else if (ch === '.' && !hadDot) {
			hadDot = true;
		} else if (!reNumber.test(ch)) {
			start++;
			break;
		}
	}

	if (line[end] === '-' && !hadMinus) {
		end++;
	}

	while (end < line.length) {
		ch = line[end++];
		if (ch === '.' && !hadDot && reNumber.test(line[end])) {
			// A dot must be followed by a number. Otherwise stop parsing
			hadDot = true;
		} else if (!reNumber.test(ch)) {
			end--;
			break;
		}
	}

	// ensure that found range contains valid number
	if (start !== end && isValidNumber(line.slice(start, end))) {
		return new vscode.Range(pos.line, start, pos.line, end);
	}

	return;
}

/**
 * Check if given string contains valid number
 */
function isValidNumber(str: string): boolean {
	return str ? !isNaN(parseFloat(str)) : false;
}


text:
/**
 * @author geeksaga
 * @version 0.1
 */
package com.geeksaga.forest.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@Entity
// @Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "pw_authority", schema = "")
// @AssociationOverrides({ @AssociationOverride(name = "user", joinColumns = @JoinColumn(name = "user_sid")) })
public class Authority extends BaseEntity implements Serializable
{
    private static final long serialVersionUID = 1L;

    @NotNull
    @Size(min = 2, max = 64)
    @Column(name = "role", nullable = false, length = 64)
    private String role;

    @Size(min = 6, max = 12)
    @Column(name = "target_type", length = 12)
    private String targetType;

    @NotNull
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "regist_timestamp", nullable = false)
    private Date registTimestamp;

    // @NotNull
    // @Column(name = "user_sid", nullable = false)
    // private Long userSid;

    @ManyToOne(optional = false, fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.REMOVE })
    @JoinColumn(name = "user_sid", referencedColumnName = "sid", nullable = false)
    // @Fetch(FetchMode.SELECT)
    // @Transient
    private User user;

    public Authority()
    {}

    public Authority(Long userSid, String role)
    {
        this(0L, userSid, role);
    }

    public Authority(Long sid, Long userSid, String role)
    {
        this(sid, userSid, role, null, new Date());
    }

    public Authority(Long sid, Long userSid, String role, String targetType, Date registTimestamp)
    {
        setSid(sid);
        setUser(new User(userSid));
        setRole(role);
        setTargetType(targetType);
        setRegistTimestamp(registTimestamp);
    }

    public String getRole()
    {
        return role;
    }

    public void setRole(String role)
    {
        this.role = role;
    }

    public String getTargetType()
    {
        return targetType;
    }

    public void setTargetType(String targetType)
    {
        this.targetType = targetType;
    }

    public Date getRegistTimestamp()
    {
        return registTimestamp;
    }

    public void setRegistTimestamp(Date registTimestamp)
    {
        this.registTimestamp = registTimestamp;
    }

    public User getUser()
    {
        return user;
    }

    public void setUser(User user)
    {
        this.user = user;
    }

    @Override
    public String toString()
    {
        return "Authority [sid=" + getSid() + ", user=" + getUser() + ", role=" + getRole() + ", targetType=" + getTargetType() + "]";
    }
}


text:
Run sudo commands without a sweat

## Getting Started
Install the module with: `npm install sweat`

```javascript
var sweat = require('sweat');
sweat.awesome(); // "awesome"
```

## Documentation
_(Coming soon)_

## Examples
_(Coming soon)_

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).

## Release History
* 2015-11-21: sweat@0.2.0 Initial `npm` release
* 2015-11-21: sweat@0.3.0 Added missing deps

## License
Copyright (c) 2015 goliatone
Licensed under the MIT license.


text:
<?php

class sfSympalContentConfiguration extends sfSympalExtendClass
{

  /**
   * Get array of configured content templates for a given moel name
   *
   * @param string $model
   * @return array $contentTemplates
   */
  public function getContentTemplates($model)
  {
    return sfSympalConfig::get($model, 'content_templates', array());
  }
}


text:
#ifndef _SnP_FBWL_Default_h_
#define _SnP_FBWL_Default_h_

#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

size_t SnP_FBWL_Absorb_Default(void *state, unsigned int laneCount, const unsigned char *data, size_t dataByteLen, unsigned char trailingBits);
size_t SnP_FBWL_Squeeze_Default(void *state, unsigned int laneCount, unsigned char *data, size_t dataByteLen);
size_t SnP_FBWL_Wrap_Default(void *state, unsigned int laneCount, const unsigned char *dataIn, unsigned char *dataOut, size_t dataByteLen, unsigned char trailingBits);
size_t SnP_FBWL_Unwrap_Default(void *state, unsigned int laneCount, const unsigned char *dataIn, unsigned char *dataOut, size_t dataByteLen, unsigned char trailingBits);

#ifdef __cplusplus
}
#endif

#endif


text:
/**
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 */

package com.ubergeek42.WeechatAndroid.relay;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import com.ubergeek42.WeechatAndroid.service.Notificator;
import com.ubergeek42.WeechatAndroid.service.P;
import com.ubergeek42.WeechatAndroid.service.RelayService;
import com.ubergeek42.weechat.relay.RelayMessageHandler;
import com.ubergeek42.WeechatAndroid.service.RelayService.STATE;
import com.ubergeek42.weechat.relay.protocol.Array;
import com.ubergeek42.weechat.relay.protocol.Hashtable;
import com.ubergeek42.weechat.relay.protocol.Hdata;
import com.ubergeek42.weechat.relay.protocol.HdataEntry;
import com.ubergeek42.weechat.relay.protocol.RelayObject;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.ListIterator;
import java.util.Locale;

/** a class that holds information about buffers
 ** probably should be made static */

public class BufferList {
    final private static Logger logger = LoggerFactory.getLogger("BufferList");
    final private static boolean DEBUG_SYNCING = false;
    final private static boolean DEBUG_HANDLERS = false;

    private static @Nullable String filterLc = null;
    private static @Nullable String filterUc = null;

    private static @Nullable RelayService relay;
    private static @Nullable BufferListEye buffersEye;

    /** the mother variable. list of current buffers */
    public static @NonNull ArrayList<Buffer> buffers = new ArrayList<>();

    ////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////

    public static void launch(final RelayService relay) {
        BufferList.relay = relay;

        // handle buffer list changes
        // including initial hotlist
        addMessageHandler("listbuffers", bufferListWatcher);

        addMessageHandler("_buffer_opened", bufferListWatcher);
        addMessageHandler("_buffer_renamed", bufferListWatcher);
        addMessageHandler("_buffer_title_changed", bufferListWatcher);
        addMessageHandler("_buffer_localvar_added", bufferListWatcher);
        addMessageHandler("_buffer_localvar_changed", bufferListWatcher);
        addMessageHandler("_buffer_localvar_removed", bufferListWatcher);
        addMessageHandler("_buffer_closing", bufferListWatcher);
        addMessageHandler("_buffer_moved", bufferListWatcher);
        addMessageHandler("_buffer_merged", bufferListWatcher);

        addMessageHandler("hotlist", hotlistInitWatcher);
        addMessageHandler("last_read_lines", lastReadLinesWatcher);

        // handle newly arriving chat lines
        // and chatlines we are reading in reverse
        addMessageHandler("_buffer_line_added", newLineWatcher);

        // handle nicklist init and changes
        addMessageHandler("nicklist", nickListWatcher);
        addMessageHandler("_nicklist", nickListWatcher);
        addMessageHandler("_nicklist_diff", nickListWatcher);

        // request a list of buffers current open, along with some information about them
        relay.connection.sendMessage("listbuffers", "hdata", "buffer:gui_buffers(*) number,full_name,short_name,type,title,nicklist,local_variables,notify");
        syncHotlist();
        relay.connection.sendMessage(P.optimizeTraffic ? "sync * buffers,upgrade" : "sync");
    }

    public static void stop() {
        relay = null;
        messageHandlersMap.clear();
    }

    private static HashMap<String, LinkedHashSet<RelayMessageHandler>> messageHandlersMap = new HashMap<>();

    private static void addMessageHandler(String id, RelayMessageHandler handler) {
        LinkedHashSet<RelayMessageHandler> handlers = messageHandlersMap.get(id);
        if (handlers == null) messageHandlersMap.put(id, handlers = new LinkedHashSet<>());
        handlers.add(handler);
    }

    private static void removeMessageHandler(String id, RelayMessageHandler handler) {
        LinkedHashSet<RelayMessageHandler> handlers = messageHandlersMap.get(id);
        if (handlers != null) handlers.remove(handler);
    }

    public static void handleMessage(@Nullable RelayObject obj, String id) {
        HashSet<RelayMessageHandler> handlers = messageHandlersMap.get(id);
        if (handlers == null) return;
        for (RelayMessageHandler handler : handlers) handler.handleMessage(obj, id);
    }

    /** send synchronization data to weechat and return true. if not connected, return false. */
    public static boolean syncHotlist() {
        if (relay == null || !relay.state.contains(STATE.AUTHENTICATED))
            return false;
        relay.connection.sendMessage("last_read_lines", "hdata", "buffer:gui_buffers(*)/own_lines/last_read_line/data buffer");
        relay.connection.sendMessage("hotlist", "hdata", "hotlist:gui_hotlist(*) buffer,count");
        return true;
    }

    ////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////// called by the Eye
    ////////////////////////////////////////////////////////////////////////////////////////////////

    private static @Nullable ArrayList<Buffer> sentBuffers = null;

    /** returns an independent copy of the buffer list
     ** MIGHT return the same object (albeit sorted as needed) */
    synchronized static public @NonNull ArrayList<Buffer> getBufferList() {
        if (sentBuffers == null) {
            sentBuffers = new ArrayList<>();
            for (Buffer buffer : buffers) {
                if (buffer.type == Buffer.HARD_HIDDEN) continue;
                if (P.filterBuffers && buffer.type == Buffer.OTHER && buffer.highlights == 0 && buffer.unreads == 0) continue;
                if (filterLc != null && filterUc != null && !buffer.fullName.toLowerCase().contains(filterLc) && !buffer.fullName.toUpperCase().contains(filterUc)) continue;
                sentBuffers.add(buffer);
            }
        }
        if (P.sortBuffers) Collections.sort(sentBuffers, sortByHotAndMessageCountComparator);
        else Collections.sort(sentBuffers, sortByHotCountAndNumberComparator);
        return sentBuffers;
    }

    static public boolean hasData() {
        return buffers.size() > 0;
    }

    synchronized static public void setFilter(String filter) {
        filterLc = (filter.length() == 0) ? null : filter.toLowerCase();
        filterUc = (filter.length() == 0) ? null : filter.toUpperCase();
        sentBuffers = null;
    }

    synchronized static public @Nullable Buffer findByFullName(@Nullable String fullName) {
        if (fullName == null) return null;
        for (Buffer buffer : buffers) if (buffer.fullName.equals(fullName)) return buffer;
        return null;
    }

    /** sets or remove (using null) buffer list change watcher */
    synchronized static public void setBufferListEye(@Nullable BufferListEye buffersEye) {
        BufferList.buffersEye = buffersEye;
    }

    ////////////////////////////////////////////////////////////////////////////////////////////////

    /** returns a "random" hot buffer or null */
    synchronized static public @Nullable Buffer getHotBuffer() {
        for (Buffer buffer : buffers)
            if ((buffer.type == Buffer.PRIVATE && buffer.unreads > 0) || buffer.highlights > 0)
                return buffer;
        return null;
    }

    //////////////////////////////////////////////////////////////////////////////////////////////// called on the Eye
    ////////////////////////////////////////////////////////////////////////////////////////////////    from this and Buffer (local)
    ////////////////////////////////////////////////////////////////////////////////////////////////    (also alert Buffer)

    /** called when a buffer has been added or removed */
    synchronized static private void notifyBuffersChanged() {
        sentBuffers = null;
        if (buffersEye != null) buffersEye.onBuffersChanged();
    }

    /** called when buffer data has been changed, but the no of buffers is the same
     ** otherMessagesChanged signifies if buffer type is OTHER and message count has changed
     ** used to temporarily display the said buffer if OTHER buffers are filtered */
    synchronized static void notifyBuffersSlightlyChanged(boolean otherMessagesChanged) {
        if (buffersEye != null) {
            if (otherMessagesChanged && P.filterBuffers) sentBuffers = null;
            buffersEye.onBuffersChanged();
        }
    }

    synchronized static void notifyBuffersSlightlyChanged() {
        notifyBuffersSlightlyChanged(false);
    }

    /** called when no buffers has been added or removed, but
     ** buffer changes are such that we should reorder the buffer list */
    synchronized static private void notifyBufferPropertiesChanged(Buffer buffer) {
        buffer.onPropertiesChanged();
        sentBuffers = null;
        if (buffersEye != null) buffersEye.onBuffersChanged();
    }

    /** process all open buffers and, if specified, notify them of the change
     ** practically notifying is only needed when pressing volume up/dn keys,
     ** which means we are not in the preferences window and the activity will not
     ** get re-rendered */
    synchronized public static void notifyOpenBuffersMustBeProcessed(boolean notify) {
        for (Buffer buffer : buffers)
            if (buffer.isOpen) {
                buffer.forceProcessAllMessages();
                if (notify) buffer.onLinesChanged();
            }
    }

    ////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////// called from Buffer & RelayService (local)
    ////////////////////////////////////////////////////////////////////////////////////////////////

    /** send sync command to relay (if traffic is set to optimized) and
     ** add it to the synced buffers (=open buffers) list */
    synchronized static void syncBuffer(String fullName) {
        if (P.optimizeTraffic) sendMessage("sync " + fullName);
    }

    synchronized static void desyncBuffer(String fullName) {
        if (P.optimizeTraffic) sendMessage("desync " + fullName);
    }

    private static int counter = 0;
    private final static String MEOW = "(%d) hdata buffer:0x%x/own_lines/last_line(-%d)/data date,displayed,prefix,message,highlight,notify,tags_array";
    public static void requestLinesForBufferByPointer(long pointer, int number) {
        addMessageHandler(Integer.toString(counter), new BufferLineWatcher(counter, pointer));
        sendMessage(String.format(Locale.ROOT, MEOW, counter, pointer, number));
        counter++;
    }

    public static void requestNicklistForBufferByPointer(long  pointer) {
        sendMessage(String.format("(nicklist) nicklist 0x%x", pointer));
    }

    private static void sendMessage(String string) {
        if (relay != null && relay.connection != null) relay.connection.sendMessage(string);
    }

    ////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////// hotlist stuff
    ////////////////////////////////////////////////////////////////////////////////////////////////

    /** a list of most recent ACTUALLY RECEIVED hot messages
     ** each entry has a form of {"irc.free.#123", "<nick> hi there"} */
    static public ArrayList<String[]> hotList = new ArrayList<>();

    /** this is the value calculated from hotlist received from weechat
     ** it MIGHT BE GREATER than size of hotList
     ** initialized, it's -1, so that on service restart we know to remove notification 43 */
    static private int hotCount = -1;

    /** returns hot count or 0 if unknown */
    static public int getHotCount() {
        return hotCount == -1 ? 0 : hotCount;
    }

    /** called when a new new hot message just arrived */
    synchronized static void newHotLine(final @NonNull Buffer buffer, final @NonNull Line line) {
        hotList.add(new String[]{buffer.fullName, line.getNotificationString()});
        if (processHotCountAndTellIfChanged())
            notifyHotCountChanged(true);
    }

    /** called when buffer is read or closed
     ** must be called AFTER buffer hot count adjustments / buffer removal from the list */
    synchronized static void removeHotMessagesForBuffer(final @NonNull Buffer buffer) {
        for (Iterator<String[]> it = hotList.iterator(); it.hasNext(); )
            if (it.next()[0].equals(buffer.fullName)) it.remove();
        if (processHotCountAndTellIfChanged())
            notifyHotCountChanged(false);
    }

    /** remove a number of messages for a given buffer, leaving last 'leave' messages
     ** DOES NOT notify anyone of the change */
    synchronized static void adjustHotMessagesForBuffer(final @NonNull Buffer buffer, int leave) {
        for (ListIterator<String[]> it = hotList.listIterator(hotList.size()); it.hasPrevious();) {
            if (it.previous()[0].equals(buffer.fullName) && (leave-- <= 0))
                it.remove();
        }
    }

    synchronized static void onHotlistFinished() {
        if (processHotCountAndTellIfChanged())
            notifyHotCountChanged(false);
    }

    ////////////////////////////////////////////////////////////////////////////////////////////////

    /** HELPER. stores hotCount;
     ** returns true if hot count has changed */
    static private boolean processHotCountAndTellIfChanged() {
        int hot = 0;
        for (Buffer buffer : buffers) {
            hot += buffer.highlights;
            if (buffer.type == Buffer.PRIVATE) hot += buffer.unreads;
        }
        return hotCount != (hotCount = hot); // har har
    }

    /** HELPER. notifies everyone interested of hotlist changes */
    static private void notifyHotCountChanged(boolean newHighlight) {
        Notificator.showHot(newHighlight);
        if (buffersEye != null) buffersEye.onHotCountChanged();
    }

    ////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////// private stuffs
    ////////////////////////////////////////////////////////////////////////////////////////////////

    synchronized static private @Nullable Buffer findByPointer(long pointer) {
        for (Buffer buffer : buffers) if (buffer.pointer == pointer) return buffer;
        return null;
    }

    static private final Comparator<Buffer> sortByHotCountAndNumberComparator = new Comparator<Buffer>() {
        @Override public int compare(Buffer left, Buffer right) {
            int l, r;
            if ((l = left.highlights) != (r = right.highlights)) return r - l;
            if ((l = left.type == Buffer.PRIVATE ? left.unreads : 0) !=
                    (r = right.type == Buffer.PRIVATE ? right.unreads : 0)) return r - l;
            return left.number - right.number;
        }
    };

    static private final Comparator<Buffer> sortByHotAndMessageCountComparator = new Comparator<Buffer>() {
        @Override
        public int compare(Buffer left, Buffer right) {
            int l, r;
            if ((l = left.highlights) != (r = right.highlights)) return r - l;
            if ((l = left.type == Buffer.PRIVATE ? left.unreads : 0) !=
                    (r = right.type == Buffer.PRIVATE ? right.unreads : 0)) return r - l;
            return right.unreads - left.unreads;
        }
    };

    ////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////// yay!! message handlers!! the joy
    //////////////////////////////////////////////////////////////////////////////////////////////// buffer list
    ////////////////////////////////////////////////////////////////////////////////////////////////

    static RelayMessageHandler bufferListWatcher = new RelayMessageHandler() {
        final private Logger logger = LoggerFactory.getLogger("bufferListWatcher");

        @Override public void handleMessage(RelayObject obj, String id) {
            if (DEBUG_HANDLERS) logger.debug("handleMessage(..., {}) (hdata size = {})", id, ((Hdata) obj).getCount());
            Hdata data = (Hdata) obj;

            if (id.equals("listbuffers")) buffers.clear();

            for (int i = 0, size = data.getCount(); i < size; i++) {
                HdataEntry entry = data.getItem(i);

                if (id.equals("listbuffers") || id.equals("_buffer_opened")) {
                    RelayObject r;
                    Buffer buffer = new Buffer(entry.getPointerLong(),
                            entry.getItem("number").asInt(),
                            entry.getItem("full_name").asString(),
                            entry.getItem("short_name").asString(),
                            entry.getItem("title").asString(),
                            ((r = entry.getItem("notify")) != null) ? r.asInt() : 3,            // TODO request notify level afterwards???
                            (Hashtable) entry.getItem("local_variables"));                      // TODO because _buffer_opened doesn't provide notify level
                    synchronized (BufferList.class) {buffers.add(buffer);}
                    notifyBuffersChanged();
                } else {
                    Buffer buffer = findByPointer(entry.getPointerLong(0));
                    if (buffer == null) {
                        logger.warn("handleMessage(..., {}): buffer is not present", id);
                    } else {
                        if (id.equals("_buffer_renamed")) {
                            buffer.fullName = entry.getItem("full_name").asString();
                            String short_name = entry.getItem("short_name").asString();
                            buffer.shortName = (short_name != null) ? short_name : buffer.fullName;
                            buffer.localVars = (Hashtable) entry.getItem("local_variables");
                            notifyBufferPropertiesChanged(buffer);
                        } else if (id.equals("_buffer_title_changed")) {
                            buffer.title = entry.getItem("title").asString();
                            notifyBufferPropertiesChanged(buffer);
                        } else if (id.startsWith("_buffer_localvar_")) {
                            buffer.localVars = (Hashtable) entry.getItem("local_variables");
                            notifyBufferPropertiesChanged(buffer);
                        } else if (id.equals("_buffer_moved") || id.equals("_buffer_merged")) { // TODO if buffer is moved, reorder others?
                            buffer.number = entry.getItem("number").asInt();                    // TODO this is not our issue; it's going to be resolved in future versions of weechat
                            notifyBufferPropertiesChanged(buffer);
                        } else if (id.equals("_buffer_closing")) {
                            synchronized (BufferList.class) {buffers.remove(buffer);}
                            buffer.onBufferClosed();
                            notifyBuffersChanged();
                        } else {
                            logger.warn("handleMessage(..., {}): unknown message id", id);
                        }
                    }
                }
            }
        }
    };

    ////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////// hotlist
    ////////////////////////////////////////////////////////////////////////////////////////////////

    // last_read_lines
    static RelayMessageHandler lastReadLinesWatcher = new RelayMessageHandler() {
        final private Logger logger = LoggerFactory.getLogger("lastReadLinesWatcher");

        @Override public void handleMessage(RelayObject obj, String id) {
            if (DEBUG_HANDLERS) logger.debug("handleMessage(..., {})", id);
            if (!(obj instanceof Hdata)) return;

            HashMap<Long, Long> bufferToLrl = new HashMap<>();

            Hdata data = (Hdata) obj;
            for (int i = 0, size = data.getCount(); i < size; i++) {
                HdataEntry entry = data.getItem(i);
                long bufferPointer = entry.getItem("buffer").asPointerLong();
                long linePointer = entry.getPointerLong();
                bufferToLrl.put(bufferPointer, linePointer);
            }

            synchronized (BufferList.class) {
                for (Buffer buffer : buffers) {
                    Long linePointer = bufferToLrl.get(buffer.pointer);
                    buffer.updateLastReadLine(linePointer == null ? -1 : linePointer);
                }
            }
        }
    };

    // hotlist (ONLY)
    static RelayMessageHandler hotlistInitWatcher = new RelayMessageHandler() {
        final private Logger logger = LoggerFactory.getLogger("hotlistInitWatcher");

        @Override public void handleMessage(RelayObject obj, String id) {
            if (DEBUG_HANDLERS) logger.debug("handleMessage(..., {})", id);
            if (!(obj instanceof Hdata)) return;

            HashMap<Long, Array> bufferToHotlist = new HashMap<>();

            Hdata data = (Hdata) obj;
            for (int i = 0, size = data.getCount(); i < size; i++) {
                HdataEntry entry = data.getItem(i);
                long pointer = entry.getItem("buffer").asPointerLong();
                Array count = entry.getItem("count").asArray();
                bufferToHotlist.put(pointer, count);
            }

            for (Buffer buffer: buffers) {
                Array count = bufferToHotlist.get(buffer.pointer);
                int unreads = count == null ? 0 : count.get(1).asInt() + count.get(2).asInt();   // chat messages & private messages
                int highlights = count == null ? 0 : count.get(3).asInt();                       // highlights
                buffer.updateHighlightsAndUnreads(highlights, unreads);
            }

            onHotlistFinished();
            notifyBuffersSlightlyChanged();
        }
    };

    ////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////// line
    ////////////////////////////////////////////////////////////////////////////////////////////////

    // _buffer_line_added
    // listlines_reverse
    static class BufferLineWatcher implements RelayMessageHandler {
        final private Logger logger = LoggerFactory.getLogger("BufferLineWatcher");
        final private long bufferPointer;
        final private int id;

        public BufferLineWatcher(int id, long bufferPointer) {
            this.bufferPointer = bufferPointer;
            this.id = id;
        }

        @Override public void handleMessage(RelayObject obj, String id) {
            if (DEBUG_HANDLERS) logger.debug("handleMessage(..., {})", id);
            if (!(obj instanceof Hdata)) return;
            Hdata data = (Hdata) obj;
            boolean isBottom = id.equals("_buffer_line_added");

            Buffer buffer = findByPointer(isBottom ? data.getItem(0).getItem("buffer").asPointerLong() : bufferPointer);
            if (buffer == null) {
                logger.warn("handleMessage(..., {}): no buffer to update", id);
                return;
            }

            for (int i = 0, size = data.getCount(); i < size; i++)
                buffer.addLine(getLine(data.getItem(i)), isBottom);

            if (!isBottom) {
                buffer.onLinesListed();
                removeMessageHandler(Integer.toString(this.id), this);
            }
        }

        private static Line getLine(HdataEntry entry) {
            String message = entry.getItem("message").asString();
            String prefix = entry.getItem("prefix").asString();
            boolean displayed = (entry.getItem("displayed").asChar() == 0x01);
            Date time = entry.getItem("date").asTime();
            RelayObject high = entry.getItem("highlight");
            boolean highlight = (high != null && high.asChar() == 0x01);
            RelayObject tagsobj = entry.getItem("tags_array");
            String[] tags = (tagsobj != null && tagsobj.getType() == RelayObject.WType.ARR) ?
                    tagsobj.asArray().asStringArray() : null;
            return new Line(entry.getPointerLong(), time, prefix, message, displayed, highlight, tags);
        }
    }

    static BufferLineWatcher newLineWatcher = new BufferLineWatcher(-1, -1);

    ////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////// nicklist
    ////////////////////////////////////////////////////////////////////////////////////////////////

    private static final char ADD = '+';
    private static final char REMOVE = '-';
    private static final char UPDATE = '*';

    // the following two are rather the same thing. so check if it's not _diff
    // nicklist
    // _nicklist
    // _nicklist_diff
    static RelayMessageHandler nickListWatcher = new RelayMessageHandler() {
        final private Logger logger = LoggerFactory.getLogger("nickListWatcher");

        @Override public void handleMessage(RelayObject obj, String id) {
            if (DEBUG_HANDLERS) logger.debug("handleMessage(..., {})", id);
            if (!(obj instanceof Hdata)) return;
            Hdata data = (Hdata) obj;
            boolean diff = id.equals("_nicklist_diff");
            HashSet<Buffer> renickedBuffers = new HashSet<>();

            for (int i = 0, size = data.getCount(); i < size; i++) {
                HdataEntry entry = data.getItem(i);

                // find buffer
                Buffer buffer = findByPointer(entry.getPointerLong(0));
                if (buffer == null) {
                    if (DEBUG_HANDLERS) logger.warn("handleMessage(..., {}): no buffer to update", id);
                    continue;
                }

                // if buffer doesn't hold all nicknames yet, break execution, since full nicks will be requested anyway later
                // erase nicklist if we have a full list here
                if (diff && !buffer.holdsAllNicks) continue;
                if (!diff && renickedBuffers.add(buffer)) buffer.removeAllNicks();

                // decide whether it's adding, removing or updating nicks
                // if _nicklist, treat as if we have _diff = '+'
                char command = (diff) ? entry.getItem("_diff").asChar() : ADD;

                // do the job, but
                // care only for items that are visible (e.g. not 'root')
                // and that are not grouping items
                if (command == ADD || command == UPDATE) {
                    if (entry.getItem("visible").asChar() != 0 && entry.getItem("group").asChar() != 1) {
                        long pointer = entry.getPointerLong();
                        String prefix = entry.getItem("prefix").asString();
                        String name = entry.getItem("name").asString();
                        boolean away = entry.getItem("color").asString().contains("weechat.color.nicklist_away");
                        if (command == ADD)
                            buffer.addNick(pointer, prefix, name, away);
                        else
                            buffer.updateNick(pointer, prefix, name, away);
                    }
                } else if (command == REMOVE) {
                    buffer.removeNick(entry.getPointerLong());
                }
            }

            // sort nicknames when we receive them for the very first time
            if (id.equals("nicklist"))
                for (Buffer buffer : renickedBuffers) {
                    buffer.holdsAllNicks = true;
                    buffer.sortNicksByLines();
                }
        }
    };
}


text:
using System;
using FinancialControl.Model;

namespace FinancialControl.Business.Importers
{
	public class MemoMapperItem
	{
		public Account MappedAccount { get; set; }
		public ResultCenter MappedCenter { get; set; }
		public string MappedMemo { get; set; }
	}
}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.06.05 at 12:12:28 PM PDT
//

package com.per_colator.percolator_out._14;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;

import org.yeastrc.proteomics.percolator.out.perc_out_common_interfaces.*;

/**
 *
Java class for anonymous complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element ref="{http://per-colator.com/percolator_out/14}process_info"/>
 *         <element ref="{http://per-colator.com/percolator_out/14}psms"/>
 *         <element ref="{http://per-colator.com/percolator_out/14}peptides" minOccurs="0"/>
 *         <element ref="{http://per-colator.com/percolator_out/14}proteins" minOccurs="0"/>
 *       </sequence>
 *       <attribute ref="{http://per-colator.com/percolator_out/14}percolator_version use="required""/>
 *       <attribute ref="{http://per-colator.com/percolator_out/14}majorVersion use="required" fixed="2""/>
 *       <attribute ref="{http://per-colator.com/percolator_out/14}minorVersion use="required""/>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "processInfo",
    "psms",
    "peptides",
    "proteins"
})
@XmlRootElement(name = "percolator_output")
public class PercolatorOutput implements IPercolatorOutput {

    @XmlElement(name = "process_info", required = true)
    protected ProcessInfo processInfo;
    @XmlElement(required = true)
    protected Psms psms;
    protected Peptides peptides;
    protected Proteins proteins;
    @XmlAttribute(name = "percolator_version", namespace = "http://per-colator.com/percolator_out/14", required = true)
    protected String percolatorVersion;
    @XmlAttribute(name = "majorVersion", namespace = "http://per-colator.com/percolator_out/14", required = true)
    @XmlSchemaType(name = "unsignedShort")
    protected int majorVersion;
    @XmlAttribute(name = "minorVersion", namespace = "http://per-colator.com/percolator_out/14", required = true)
    @XmlSchemaType(name = "unsignedShort")
    protected int minorVersion;

    /**
     * Gets the value of the processInfo property.
     *
     * @return
     *     possible object is
     *     {@link ProcessInfo }
     *
     */
    public ProcessInfo getProcessInfo() {
        return processInfo;
    }

    /**
     * Sets the value of the processInfo property.
     *
     * @param value
     *     allowed object is
     *     {@link ProcessInfo }
     *
     */
    public void setProcessInfo(ProcessInfo value) {
        this.processInfo = value;
    }

    /**
     * Gets the value of the psms property.
     *
     * @return
     *     possible object is
     *     {@link Psms }
     *
     */
    public Psms getPsms() {
        return psms;
    }

    /**
     * Sets the value of the psms property.
     *
     * @param value
     *     allowed object is
     *     {@link Psms }
     *
     */
    public void setPsms(Psms value) {
        this.psms = value;
    }

    /**
     * Gets the value of the peptides property.
     *
     * @return
     *     possible object is
     *     {@link Peptides }
     *
     */
    public Peptides getPeptides() {
        return peptides;
    }

    /**
     * Sets the value of the peptides property.
     *
     * @param value
     *     allowed object is
     *     {@link Peptides }
     *
     */
    public void setPeptides(Peptides value) {
        this.peptides = value;
    }

    /**
     * Gets the value of the proteins property.
     *
     * @return
     *     possible object is
     *     {@link Proteins }
     *
     */
    public Proteins getProteins() {
        return proteins;
    }

    /**
     * Sets the value of the proteins property.
     *
     * @param value
     *     allowed object is
     *     {@link Proteins }
     *
     */
    public void setProteins(Proteins value) {
        this.proteins = value;
    }

    /**
     * Gets the value of the percolatorVersion property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getPercolatorVersion() {
        return percolatorVersion;
    }

    /**
     * Sets the value of the percolatorVersion property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setPercolatorVersion(String value) {
        this.percolatorVersion = value;
    }

    /**
     * Gets the value of the majorVersion property.
     *
     */
    public int getMajorVersion() {
        return majorVersion;
    }

    /**
     * Sets the value of the majorVersion property.
     *
     */
    public void setMajorVersion(int value) {
        this.majorVersion = value;
    }

    /**
     * Gets the value of the minorVersion property.
     *
     */
    public int getMinorVersion() {
        return minorVersion;
    }

    /**
     * Sets the value of the minorVersion property.
     *
     */
    public void setMinorVersion(int value) {
        this.minorVersion = value;
    }

}


text:
package rajawali.materials;

import android.opengl.GLES20;

import com.monyetmabuk.livewallpapers.photosdof.R;

import java.nio.FloatBuffer;

import rajawali.math.Number3D;

public class ParticleMaterial extends AParticleMaterial {

    protected float mPointSize = 10.0f;

    protected int muPointSizeHandle;
    protected int muCamPosHandle;
    protected int muDistanceAttHandle;
    protected int muCurrentFrameHandle;
    protected int muTileSizeHandle;
    protected int muNumTileRowsHandle;
    protected int maVelocityHandle;
    protected int maAnimOffsetHandle;
    protected int muFrictionHandle;
    protected int muTimeHandle;
    protected int muMultiParticlesEnabledHandle;

    protected float[] mDistanceAtt;
    protected boolean mMultiParticlesEnabled;
    protected float[] mFriction;
    protected float[] mCamPos;
    protected float mTime;
    protected int mCurrentFrame;
    protected float mTileSize;
    protected float mNumTileRows;
    protected boolean mIsAnimated;

    public ParticleMaterial() {
        this(false);
    }

    public ParticleMaterial(boolean isAnimated) {
        this(RawMaterialLoader.fetch(R.raw.particle_material_vertex), RawMaterialLoader.fetch(R.raw.particle_material_fragment), isAnimated);
    }

    public ParticleMaterial(String vertexShader, String fragmentShader, boolean isAnimated) {
        super(vertexShader, fragmentShader, NONE);
        mDistanceAtt = new float[]{1, 1, 1};
        mFriction = new float[3];
        mCamPos = new float[3];
        mIsAnimated = isAnimated;
        if (mIsAnimated) {
            mUntouchedVertexShader = "\n#define ANIMATED\n" + mUntouchedVertexShader;
            mUntouchedFragmentShader = "\n#define ANIMATED\n" + mUntouchedFragmentShader;
        }
        setShaders(mUntouchedVertexShader, mUntouchedFragmentShader);
    }

    public void setPointSize(float pointSize) {
        mPointSize = pointSize;
        GLES20.glUniform1f(muPointSizeHandle, mPointSize);
    }

    public void setMultiParticlesEnabled(boolean enabled) {
        mMultiParticlesEnabled = enabled;
        GLES20.glUniform1i(muMultiParticlesEnabledHandle, mMultiParticlesEnabled == true ? GLES20.GL_TRUE : GLES20.GL_FALSE);
    }

    @Override
    public void useProgram() {
        super.useProgram();
        GLES20.glUniform3fv(muCamPosHandle, 1, mCamPos, 0);
        GLES20.glUniform3fv(muDistanceAttHandle, 1, mDistanceAtt, 0);
        GLES20.glUniform3fv(muFrictionHandle, 1, mFriction, 0);
        GLES20.glUniform1f(muTimeHandle, mTime);
        GLES20.glUniform1f(muCurrentFrameHandle, mCurrentFrame);
        GLES20.glUniform1f(muTileSizeHandle, mTileSize);
        GLES20.glUniform1f(muNumTileRowsHandle, mNumTileRows);
    }

    public void setVelocity(final int velocityBufferHandle) {
        GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, velocityBufferHandle);
        GLES20.glEnableVertexAttribArray(maVelocityHandle);
        GLES20.glVertexAttribPointer(maVelocityHandle, 3, GLES20.GL_FLOAT, false,
                0, 0);
    }

    public void setFriction(Number3D friction) {
        mFriction[0] = friction.x;
        mFriction[1] = friction.y;
        mFriction[2] = friction.z;
    }

    public void setTime(float time) {
        mTime = time;
    }

    @Override
    public void setShaders(String vertexShader, String fragmentShader) {
        super.setShaders(vertexShader, fragmentShader);
        muPointSizeHandle = getUniformLocation("uPointSize");
        muDistanceAttHandle = getUniformLocation("uDistanceAtt");

        maVelocityHandle = getAttribLocation("aVelocity");
        maAnimOffsetHandle = getAttribLocation("aAnimOffset");
        muFrictionHandle = getUniformLocation("uFriction");
        muTimeHandle = getUniformLocation("uTime");
        muMultiParticlesEnabledHandle = getUniformLocation("uMultiParticlesEnabled");

        muCurrentFrameHandle = getUniformLocation("uCurrentFrame");
        muTileSizeHandle = getUniformLocation("uTileSize");
        muNumTileRowsHandle = getUniformLocation("uNumTileRows");
    }

    public void setAnimOffsets(FloatBuffer animOffsets) {
        GLES20.glEnableVertexAttribArray(maAnimOffsetHandle);
        GLES20.glVertexAttribPointer(maAnimOffsetHandle, 1, GLES20.GL_FLOAT, false, 0, animOffsets);
    }

    public void setCurrentFrame(int currentFrame) {
        mCurrentFrame = currentFrame;
    }

    public void setTileSize(float tileSize) {
        mTileSize = tileSize;
    }

    public void setNumTileRows(int numTileRows) {
        mNumTileRows = numTileRows;
    }

    public void setCameraPosition(Number3D cameraPos) {
        mCamPos[0] = cameraPos.x;
        mCamPos[1] = cameraPos.y;
        mCamPos[2] = cameraPos.z;
    }
}


text:
package correlation

import (
	"testing"

	"github.com/stretchr/testify/require"
	"go.opentelemetry.io/collector/config/confighttp"
)

func TestValidConfig(t *testing.T) {
	config := DefaultConfig()
	config.Endpoint = "https://localhost"
	require.NoError(t, config.validate())
}

func TestInvalidConfig(t *testing.T) {
	invalid := Config{}
	noEndpointErr := invalid.validate()
	require.Error(t, noEndpointErr)

	invalid = Config{
		HTTPClientSettings: confighttp.HTTPClientSettings{Endpoint: ":123:456"},
	}
	invalidURLErr := invalid.validate()
	require.Error(t, invalidURLErr)
}