text:
/* LAI footer */

#gwtoday-local-footer {
  border-top: 2px solid #004065;
  padding-top: 1.5em;
  padding-bottom: 0px;
  margin-top: 1.5em;
  clear: both;
  margin-bottom: 78px;
}
#gwtoday-footer {
  width: 96%;
  margin-left: auto;
  margin-right: auto;
  max-width: 1080px;
  padding-left: 10px;
}
#gwtoday-footer .footer-logo, #gwtoday-footer .footer-address, #gwtoday-footer .footer-social-links {
  border-right: 1px dotted #0096d6;
}
@media screen and (max-width:840px) {
  #footer-promo-item-2.footer-address { border-right: 0; }
}

.promotional-four-col::after {
  content: "";
  clear: left;
  display: block;
}
.promotional-four-col #footer-promo-item-1 {
  float: left;
  width: 25%;
  margin-left: 0%;
  margin-right: -25%;
  -ms-box-sizing: border-box;
  box-sizing: border-box;
  word-wrap: break-word;
  padding: 0em 1em 0em 0em;
  margin-bottom: 0;
}
@media screen and (max-width: 840px) {
  .promotional-four-col #footer-promo-item-1 {
    width: 50%;
    margin-right: -50%;
  }
}
.promotional-four-col #footer-promo-item-2 {
  float: left;
  width: 25%;
  margin-left: 25%;
  margin-right: -50%;
  -ms-box-sizing: border-box;
  box-sizing: border-box;
  word-wrap: break-word;
  padding: 0em 0.64em 0em 0.56em;
  margin-bottom: 0;
}
@media screen and (max-width: 840px) {
  .promotional-four-col #footer-promo-item-2 {
    width: 50%;
    margin-left: 50%;
    margin-right: -100%;
    padding-left: 1em;
  }
}
.promotional-four-col #footer-promo-item-3 {
  clear: none;
  float: left;
  width: 25%;
  margin-left: 50%;
  margin-right: -75%;
  -ms-box-sizing: border-box;
  box-sizing: border-box;
  word-wrap: break-word;
  padding: 0em 0.36em 0em 0.64em;
}
@media screen and (max-width: 840px) {
  .promotional-four-col #footer-promo-item-3 {
    clear: left;
    width: 50%;
    margin-left: 0%;
    margin-right: -50%;
  }
}
.promotional-four-col #footer-promo-item-4 {
  float: left;
  width: 25%;
  margin-left: 75%;
  margin-right: -100%;
  -ms-box-sizing: border-box;
  box-sizing: border-box;
  word-wrap: break-word;
  padding: 0em 0em 0em 1em;
}
@media screen and (max-width: 840px) {
  .promotional-four-col #footer-promo-item-4 {
    width: 50%;
    margin-left: 50%;
    margin-right: -100%;
  }
}
#gwtoday-footer .footer-logo, #gwtoday-footer .footer-address, #gwtoday-footer .footer-social-links, #gwtoday-footer .footer-quick-links {
  border-bottom: none;
  min-height: 180px;
  height: auto;
  overflow: hidden;
}

/* Global GW footer */

footer#footer {
  position: relative;
  line-height: 1.5em;
  clear: both;
  margin-top: 78px;
}
#footer, #footer-wrapper {
  background-color: #033C5A;
}
#footer-wrapper {
  margin-left: auto;
  margin-right: auto;
  max-width: 1080px;
  margin-top: 78px;
  padding: 0 1em;
  box-sizing: border-box;
}
#footer-wrapper::after {
  clear: both;
  content: "";
  display: table;
}
#footer-wrapper .footer-logof {
  /*text-align: left !important;
  width: 330px;*/
  float: left;
}
@media screen and (max-width: 840px) {
  #footer-wrapper .footer-logof {
    float: none;
    text-align: center;
    margin: auto;
  }
}
#footer-wrapper .footer-logof img {
  margin: 1em 0;
}
#footer-wrapper .row-one {
  display: inline-block;
  float: right;
  line-height: 1%;
}
#footer-wrapper .row-two {
  display: inline-block;
  float: right;
  clear: right;
  line-height: 1%;
}
@media screen and (max-width: 840px) {
  #footer-wrapper .row-one, #footer-wrapper .row-two {
    float: none;
    line-height: 1.5em;
    display: block;
  }
}
#footer-wrapper ul {
  list-style: none;
  padding: 0;
  margin: 1em 0;
  text-align: center;
}
#footer-wrapper .row-two ul li, #footer-wrapper .row-one ul li {
  margin: 0 0 0 0.625em;
  float: left;
}
@media screen and (max-width: 840px) {
  #footer-wrapper .row-two ul li, #footer-wrapper .row-one ul li {
    float: none;
  }
}
#footer-wrapper .row-two ul li a, #footer-wrapper .row-one ul li a {
  font-size: 0.75em;
  line-height: 1.5em;
  color: #fefefe;
  text-decoration: none;
}


text:
using System.IO;

namespace xcite.csharp {
    /// <inheritdoc />
    /// <summary> Announces a class that serializes (full or only a part of it) itself. </summary>
    public interface IIncoSerializer : ICustomSerializer {

        /// <summary> Notifies the instance to write its values into the given stream. </summary>
        /// <param name="writer">Stream writer</param>
        void WriteToStream(BinaryWriter writer);

        /// <summary> Notifies the instance to read its values from the given stream. </summary>
        /// <param name="reader">Stream reader</param>
        void ReadFromStream(BinaryReader reader);
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.google.sps.data;
import java.util.List;

public class CloudVisionAnnotation {
  private String gcsUrl;
  private String imageURL;
  private List<ImageLabel> genericLabels;
  private List<ImageLabel> webLabels;
  private List<String> webBestLabels;
  private List<String> webUrls;
  private List<String> textInImage;
  private List<ImageLabel> dominantColors;
  private List<ImageLabel> objectsInImage;
  private List<ImageLabel> logosInImage;

  public CloudVisionAnnotation(String gcsUrl,
                               String imageURL,
                               List<ImageLabel> genericLabels,
                               List<ImageLabel> webLabels,
                               List<String> webBestLabels,
                               List<String> webUrls,
                               List<String> textInImage,
                               List<ImageLabel> dominantColors,
                               List<ImageLabel> objectsInImage,
                               List<ImageLabel> logosInImage) {
    this.gcsUrl = gcsUrl;
    this.imageURL = imageURL;
    this.genericLabels = genericLabels;
    this.webLabels = webLabels;
    this.webBestLabels = webBestLabels;
    this.webUrls = webUrls;
    this.textInImage = textInImage;
    this.dominantColors = dominantColors;
    this.objectsInImage = objectsInImage;
    this.logosInImage = logosInImage;
  }

  public String getGcsUrl() {
    return gcsUrl;
  }

  public String getImageUrl() {
    return imageURL;
  }

  public List<ImageLabel> getGenericLabels() {
    return genericLabels;
  }

  public List<ImageLabel> getWebLabels() {
    return webLabels;
  }

  public List<String> getWebBestLabels() {
    return webBestLabels;
  }

  public List<String> getWebUrls() {
    return webUrls;
  }

  public List<String> getTextInImage() {
    return textInImage;
  }

  public List<ImageLabel> getDominantColors() {
    return dominantColors;
  }

  public List<ImageLabel> getObjectsInImage() {
    return objectsInImage;
  }

  public List<ImageLabel> getLogosInImage() {
    return logosInImage;
  }
}


text:
TestRep
=======
hi, github:
  it is my first branch!
  it is my second branch!


text:
import { IRunnable, Workhorse, Response, Work } from '../../index';
export default class Calculator implements IRunnable {
    errors: Error[];
    workhorse: Workhorse;
    baseWorkPath: string;
    run(work: Work): Promise<Response>;
    onChildrenDone(work: Work): Promise<any>;
    private createChildWork(input);
}


text:
namespace ComplexToonDrawing {

    // skinning model
    interface SkinningModelData {
        images: List<string>;
        bones: List<SkinningModelBoneData>;
        parts: List<SkinningModelPartData>;
    }

    interface SkinningModelBoneData {
        name: string;
        parent: int;
        matrix: Mat4;
    }

    interface SkinningModelPartData {
        bone: List<int>;
        material: int;
        vertexStride: int;
        vertex: List<float>;
        index: List<int>;

        renderModel: RenderModel;
    }

    class SkinningModel {
        data: SkinningModelData = null;
        name: string;
    }

    class SkinningModelLoadingState {
        isInitialized = false;
        isLoaded = false;
        models = new Dictionary<SkinningModel>();
        modelList = new List<SkinningModel>();
    }

    class AnimationDataLoadingState {
        isInitialized = false;
        isLoaded = false;
        animations = new Dictionary<BoneAnimation>();
    }

    // drawing buffer
    class RenderTargetBuffer {
        framebuffer: WebGLFramebuffer = null;
        renderbuffer: WebGLRenderbuffer = null;
        width = 0;
        height = 0;
        texture = new List<RenderImage>();
        textureWidth = 0;
        textureHeight = 0;
    }

    class Main {

        logicalScreenWidth = 640.0;
        logicalScreenHeight = 360.0;

        canvas: HTMLCanvasElement = null;
        gl: WebGLRenderingContext = null;

        render = new WebGLRender();
        screenShader = new ScreenShader();
        bone2Shader = new Bone2Shader();
        bone4Shader = new Bone4Shader();
        bone2Shader_Toons = new Bone2Shader_Toons();
        bone4Shader_Toons = new Bone4Shader_Toons();
        drawer_Bone2Shader: Bone2Shader = null;
        drawer_Bone4Shader: Bone4Shader = null;

        loaded = false;

        screen_ModelResource = new RenderModel();

        skinningModelLoadingState = new SkinningModelLoadingState();
        modelResourceList: List<SkinningModel> = null;

        skinModelImageResources = new List<RenderImage>();
        backImageResources = new List<RenderImage>();

        animationDataLoadingState = new AnimationDataLoadingState();
        boneAnimationResource: BoneAnimation = null;
        boneModel: SkinningModel = null;

        animationSolver = new AnimationSolver();
        boneAnimationBuffer: BoneAnimationBuffer = null;
        boneMatrixBuffer: BoneAnimationMatrixBuffer = null;

        clothes_ModelNameList: List<string> = [
            'CoatBase', 'MafuraBase'
        ];

        skin_ModelNameList: List<string> = [
            'SkinBase'
        ];

        hair_ModelNameList: List<string> = [
            'HairBase'
        ];

        face_ModelNameList: List<string> = [
            'EyeWhite', 'Mayuge', 'Eyes', 'EyeLight', 'Matuge', 'MouseNose'
        ];

        skinShader_ModelNameList: List<string> = [
            'SkinShader'
        ];

        skinBase_FrameBuffer: RenderTargetBuffer;

        eyeLocation = vec3.create();
        lookatLocation = vec3.create();
        upVector = vec3.create();

        modelMatrix = mat4.create();
        viewMatrix = mat4.create();
        pMatrix = mat4.create();
        mvMatrix = mat4.create();
        normalMatrix = mat4.create();
        boneMatrix = mat4.create();

        tmpVector = vec3.create();

        animationTime = 0.0;

        initialize(canvas: HTMLCanvasElement) {

            this.canvas = canvas;
            this.canvas.width = this.logicalScreenWidth;
            this.canvas.height = this.logicalScreenHeight;

            if (this.render.initializeWebGL(canvas)) {
                return;
            }

            this.gl = this.render.gl;

            this.render.initializeShader(this.screenShader);
            this.render.initializeShader(this.bone2Shader);
            this.render.initializeShader(this.bone4Shader);
            this.render.initializeShader(this.bone4Shader_Toons);
            this.render.initializeShader(this.bone2Shader_Toons);

            this.render.initializeModelBuffer(this.screen_ModelResource,
                [
                -1.0, -1.0, 0.0, 0.00, 0.00,
                1.00, -1.0, 0.0, 1.00, 0.00,
                -1.0, 1.00, 0.0, 0.00, 1.00,
                1.00, 1.00, 0.0, 1.00, 1.00
                ]
                , [0, 1, 2, 3, 2, 1]
                , 4 * 5);

            this.loadModel(this.skinningModelLoadingState, '../temp/complex_toon_model.json');

            let image = new RenderImage();
            this.loadTexture(image, './texture.png');
            this.skinModelImageResources.push(image);

            let image2 = new RenderImage();
            this.loadTexture(image2, './ebisu_xmas_032.jpg');
            this.backImageResources.push(image2);

            this.loadAnimation(this.animationDataLoadingState, '../temp/complex_toon_animation.json');

            this.skinBase_FrameBuffer = this.createRenderTargetBuffer(this.logicalScreenWidth, this.logicalScreenHeight);

            this.render.setShader(this.bone2Shader_Toons);
            this.bone2Shader_Toons.setResolution(this.skinBase_FrameBuffer.textureWidth, this.skinBase_FrameBuffer.textureHeight);
            this.render.setShader(this.bone4Shader_Toons);
            this.bone4Shader_Toons.setResolution(this.skinBase_FrameBuffer.textureWidth, this.skinBase_FrameBuffer.textureHeight);
        }

        processLoading() {

            // model
            if (!this.skinningModelLoadingState.isInitialized) {

                if (this.skinningModelLoadingState.isLoaded) {

                    this.initializeSkinningModelBuffers(this.skinningModelLoadingState);
                    this.modelResourceList = this.skinningModelLoadingState.modelList;
                    this.skinningModelLoadingState.isInitialized = true;
                }
                else {
                    return;
                }
            }

            // image
            if (this.skinModelImageResources[0].texture == null) {
                return;
            }
            if (this.backImageResources[0].texture == null) {
                return;
            }

            // animation
            if (!this.animationDataLoadingState.isInitialized) {

                if (this.animationDataLoadingState.isLoaded) {

                    this.boneAnimationResource = this.animationDataLoadingState.animations['runrun'];

                    this.boneModel = this.skinningModelLoadingState.models['CoatBase'];
                    this.boneAnimationBuffer = this.animationSolver.createBoneAnimationBuffer(this.boneModel.data.bones);
                    this.boneMatrixBuffer = this.animationSolver.createBoneMatrixBuffer(this.boneModel.data.bones);

                    this.animationDataLoadingState.isInitialized = true;
                }
                else {
                    return;
                }
            }

            this.loaded = true;
        }

        run() {

            if (!this.loaded) {
                this.processLoading();
                if (!this.loaded) {
                    return;
                }
            }

            // animate time
            this.animationTime += 1.0;
            if (this.animationTime > 216.0) {
                this.animationTime -= 144.0;
            }

            // camera position
            vec3.set(this.eyeLocation, 10.4, 0.0, 0.9);
            vec3.set(this.lookatLocation, 0.0, 0.3, 0.9);
            vec3.set(this.upVector, 0.0, 0.0, 1.0);

            // animation
            this.animationSolver.calcBoneAnimation(this.boneAnimationBuffer, this.boneModel.data.bones, this.boneAnimationResource, this.animationTime);
            this.animationSolver.calcBoneMatrix(this.boneMatrixBuffer, this.boneModel.data.bones, this.boneAnimationBuffer);

            mat4.identity(this.modelMatrix);
            mat4.rotateZ(this.modelMatrix, this.modelMatrix, Math.PI * 0.65);
        }

        draw() {

            if (!this.loaded) {
                return;
            }

            // calculates camera matrix
            let aspect = this.logicalScreenWidth / this.logicalScreenHeight;
            mat4.perspective(this.pMatrix, 8.0 * Math.PI / 180, aspect, 0.1, 50.0);
            mat4.lookAt(this.viewMatrix, this.eyeLocation, this.lookatLocation, this.upVector);

            // background
            this.render.setDepthTest(false)
            this.render.setCulling(false);
            this.render.clearColorBufferDepthBuffer(0.0, 0.0, 0.1, 0.0);
            this.drawScreenModel(this.backImageResources);

            // skin base layer
            this.setRenderTargetBuffer(this.skinBase_FrameBuffer);
            this.gl.viewport(0, 0, this.logicalScreenWidth, this.logicalScreenHeight);

            this.render.setDepthTest(true)
            this.render.clearColorBufferDepthBuffer(0.0, 0.0, 0.0, 0.0);

            this.drawer_Bone2Shader = this.bone2Shader;
            this.drawer_Bone4Shader = this.bone4Shader;
            this.drawSkinningModels(this.modelMatrix, this.clothes_ModelNameList, this.skinModelImageResources)
            this.drawSkinningModels(this.modelMatrix, this.skin_ModelNameList, this.skinModelImageResources)
            this.drawSkinningModels(this.modelMatrix, this.hair_ModelNameList, this.skinModelImageResources)

            this.render.setDepthTest(false)
            this.drawSkinningModels(this.modelMatrix, this.face_ModelNameList, this.skinModelImageResources)

            // skin shader layer
            this.setRenderTargetBuffer(null);
            this.gl.viewport(0, 0, this.logicalScreenWidth, this.logicalScreenHeight);

            this.render.setDepthTest(true)
            this.render.clearDepthBuffer();

            this.drawer_Bone2Shader = this.bone2Shader_Toons;
            this.drawer_Bone4Shader = this.bone4Shader_Toons;
            this.render.setDepthTest(true)
            this.drawSkinningModels(this.modelMatrix, this.skinShader_ModelNameList, this.skinBase_FrameBuffer.texture)
        }

        private calcNormalMatrix(out: Mat4, matrix: Mat4) {

            let length = Math.sqrt(Math.pow(matrix[0], 2) + Math.pow(matrix[1], 2) + Math.pow(matrix[2], 2));
            out[0] /= length;
            out[1] /= length;
            out[2] /= length;
            out[3] = 0;

            length = Math.sqrt(Math.pow(matrix[4], 2) + Math.pow(matrix[5], 2) + Math.pow(matrix[6], 2));
            out[4] /= length;
            out[5] /= length;
            out[6] /= length;
            out[7] = 0;

            length = Math.sqrt(Math.pow(matrix[8], 2) + Math.pow(matrix[9], 2) + Math.pow(matrix[10], 2));
            out[8] /= length;
            out[9] /= length;
            out[10] /= length;
            out[11] = 0;

            out[12] = 0;
            out[13] = 0;
            out[14] = 0;
            out[16] = 1;
        }

        private drawSkinningModels(modelMatrix: Mat4, modelNameList: List<string>, imageResources: List<RenderImage>) {

            for (let modelName of modelNameList) {

                let model = this.skinningModelLoadingState.models[modelName];

                this.drawSkinningModel(modelMatrix, model, this.boneMatrixBuffer, imageResources);
            }
        }

        private drawSkinningModel(modelMatrix: Mat4, skinningModel: SkinningModel, matrixBuffer: BoneAnimationMatrixBuffer, imageResources: List<RenderImage>) {

            // calc base matrix (model-view matrix)
            mat4.multiply(this.mvMatrix, this.viewMatrix, this.modelMatrix);

            // cals normal matrix
            this.calcNormalMatrix(this.normalMatrix, this.mvMatrix);

            // set parameter not dependent on parts
            this.render.setShader(this.drawer_Bone2Shader);
            this.drawer_Bone2Shader.setModelViewMatrix(this.mvMatrix);
            this.drawer_Bone2Shader.setProjectionMatrix(this.pMatrix);
            this.drawer_Bone2Shader.setNormalMatrix(this.normalMatrix, this.gl);

            this.render.setShader(this.drawer_Bone4Shader);
            this.drawer_Bone4Shader.setModelViewMatrix(this.mvMatrix);
            this.drawer_Bone4Shader.setProjectionMatrix(this.pMatrix);
            this.drawer_Bone4Shader.setNormalMatrix(this.normalMatrix, this.gl);

            // drawing for each part
            let bones = skinningModel.data.bones;
            let parts = skinningModel.data.parts;

            for (let part of parts) {

                // select shader
                let shader: Bone2Shader;
                if (part.bone.length <= 2) {
                    shader = this.drawer_Bone2Shader;
                }
                else {
                    shader = this.drawer_Bone4Shader;
                }
                this.render.setShader(shader);

                // set bone matrix
                for (let boneIndex = 0; boneIndex < part.bone.length; boneIndex++) {
                    mat4.copy(this.boneMatrix, matrixBuffer.boneMatrixList[part.bone[boneIndex]]);
                    shader.setBoneMatrix(boneIndex, this.boneMatrix, this.gl);
                }

                // draw
                shader.setBuffers(part.renderModel, imageResources);

                this.render.drawElements(part.renderModel);

                shader.disableVertexAttributes();
            }
        }

        private loadModel(loadingState: SkinningModelLoadingState, url: string) {

            let xhr = new XMLHttpRequest();
            xhr.open('GET', url);
            xhr.responseType = 'json';

            xhr.addEventListener('load',
                (e: Event) => {
                    let data: any;
                    if (xhr.responseType == 'json') {
                        data = xhr.response;
                    } else {
                        data = JSON.parse(xhr.response);
                    }

                    for (let modelName in data) {
                        let skinningModel = new SkinningModel();
                        skinningModel.name = modelName;
                        skinningModel.data = data[modelName];
                        loadingState.models[modelName] = skinningModel;
                    }

                    loadingState.isLoaded = true;
                }
            );

            xhr.send();
        }

        private initializeSkinningModelBuffers(loadingState: SkinningModelLoadingState) {

            for (let modelName in loadingState.models) {
                let skinningModel = loadingState.models[modelName];

                console.log('initializing skin model: ' + modelName);

                this.initializeSkinningModelBuffer(skinningModel);

                loadingState.modelList.push(skinningModel);
            }
        }

        private initializeSkinningModelBuffer(skinningModel: SkinningModel) {

            // create buffers for each part
            for (let part of skinningModel.data.parts) {

                let renderModel = new RenderModel();
                this.render.initializeModelBuffer(renderModel, part.vertex, part.index, 4 * part.vertexStride); // 4 (=size of float)

                part.renderModel = renderModel;
            }
        }

        private loadTexture(image: RenderImage, url: string) {

            image.imageData = new Image();

            image.imageData.addEventListener('load',
                () => {
                    this.render.initializeImageTexture(image);
                }
            );

            image.imageData.src = url;
        }

        private loadAnimation(loadingState: AnimationDataLoadingState, url: string) {

            let xhr = new XMLHttpRequest();
            xhr.open('GET', url);
            xhr.responseType = 'json';

            xhr.addEventListener('load',
                (e: Event) => {
                    let data: any;
                    if (xhr.responseType == 'json') {
                        data = xhr.response;
                    } else {
                        data = JSON.parse(xhr.response);
                    }

                    loadingState.animations = data;
                    loadingState.isLoaded = true;
                }
            );

            xhr.send();
        }

        private createRenderTargetBuffer(width: int, height: int): RenderTargetBuffer {

            let gl = this.gl;

            let textureWidth = 2;
            let textureHeight = 2;
            while (textureWidth < width) {
                textureWidth *= 2;
            }
            while (textureHeight < height) {
                textureHeight *= 2;
            }

            let glFrameBuffer = gl.createFramebuffer();
            gl.bindFramebuffer(gl.FRAMEBUFFER, glFrameBuffer);

            let glTexture = gl.createTexture();
            gl.activeTexture(gl.TEXTURE0);
            gl.bindTexture(gl.TEXTURE_2D, glTexture);
            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
            gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, textureWidth, textureHeight, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);

            gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, glTexture, 0);

            gl.bindTexture(gl.TEXTURE_2D, null);

            let glRenderbuffer = gl.createRenderbuffer();
            gl.bindRenderbuffer(gl.RENDERBUFFER, glRenderbuffer);
            gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, textureWidth, textureHeight);
            gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, glRenderbuffer);

            gl.bindRenderbuffer(gl.RENDERBUFFER, null);
            gl.bindFramebuffer(gl.FRAMEBUFFER, null);

            let renderImage = new RenderImage();
            renderImage.texture = glTexture;

            let buffer = new RenderTargetBuffer();
            buffer.framebuffer = glFrameBuffer;
            buffer.renderbuffer = glRenderbuffer;
            buffer.width = width;
            buffer.height = height;
            buffer.texture.push(renderImage);
            buffer.textureWidth = textureWidth;
            buffer.textureHeight = textureHeight;

            return buffer;
        }

        private setRenderTargetBuffer(buffer: RenderTargetBuffer) {

            if (buffer != null) {
                this.gl.bindFramebuffer(this.gl.FRAMEBUFFER, buffer.framebuffer);
            }
            else {
                this.gl.bindFramebuffer(this.gl.FRAMEBUFFER, null);
            }
        }

        private drawScreenModel(renderImages: List<RenderImage>) {

            this.render.setShader(this.screenShader);

            this.screenShader.setBuffers(this.screen_ModelResource, renderImages);

            this.render.drawElements(this.screen_ModelResource);
        }
    }

    export class ScreenShader extends RenderShader {

        aVertexPosition = -1;
        aTexCoord = -1;

        uTexture0: WebGLUniformLocation = null;

        initializeVertexSourceCode() {

            this.vertexShaderSourceCode = ''
                + this.floatPrecisionDefinitionCode

                + 'attribute vec3 aVertexPosition;'
                + 'attribute vec2 aTexCoord;'

                + 'varying vec2 vTexCoord;'

                + 'void main(void) {'
                + '    gl_Position = vec4(aVertexPosition, 1.0);'
                + '    vTexCoord = aTexCoord;'
                + '}';
        }

        initializeFragmentSourceCode() {

            this.fragmentShaderSourceCode = ''
                + this.floatPrecisionDefinitionCode

                + 'varying vec2 vTexCoord;'

                + 'uniform sampler2D uTexture0;'

                + 'void main(void) {'
                + '    gl_FragColor = texture2D(uTexture0, vTexCoord);'
                + '}';
        }

        initializeAttributes() {

            this.aVertexPosition = this.getAttribLocation('aVertexPosition');
            this.aTexCoord = this.getAttribLocation('aTexCoord');

            this.uTexture0 = this.getUniformLocation('uTexture0');
        }

        setBuffers(model: RenderModel, images: List<RenderImage>) {

            let gl = this.gl;

            gl.bindBuffer(gl.ARRAY_BUFFER, model.vertexBuffer);

            this.enableVertexAttributes();
            this.resetVertexAttribPointerOffset();

            this.vertexAttribPointer(this.aVertexPosition, 3, gl.FLOAT, model.vertexDataStride);
            this.vertexAttribPointer(this.aTexCoord, 2, gl.FLOAT, model.vertexDataStride);

            gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, model.indexBuffer);

            gl.activeTexture(gl.TEXTURE0);
            gl.bindTexture(gl.TEXTURE_2D, images[0].texture);
            gl.uniform1i(this.uTexture0, 0);
        }
    }

    export class Bone2Shader extends RenderShader {

        aTexCoord1 = -1;

        uTexture0: WebGLUniformLocation = null;

        aWeight1 = -1;
        aVertexPosition1 = -1;
        aVertexNormal1 = -1;

        aVertexPosition2 = -1;
        aWeight2 = -1;
        aVertexNormal2 = -1;

        uNormalMatrix: WebGLUniformLocation = null;
        uBoneMatrixList = new List<WebGLUniformLocation>();

        initializeVertexSourceCode() {

            this.vertexShaderSourceCode = ''
                + this.floatPrecisionDefinitionCode

                + 'attribute float aWeight1;'
                + 'attribute vec3 aVertexPosition1;'
                + 'attribute vec3 aVertexNormal1;'

                + 'attribute float aWeight2;'
                + 'attribute vec3 aVertexPosition2;'
                + 'attribute vec3 aVertexNormal2;'

                + 'attribute vec2 aTexCoord1;'

                + 'uniform mat4 uBoneMatrix1;'
                + 'uniform mat4 uBoneMatrix2;'

                + 'uniform mat4 uMVMatrix;'
                + 'uniform mat4 uPMatrix;'
                + 'uniform mat4 uNormalMatrix;'

                + 'varying vec2 vTexCoord;'
                + 'varying vec3 vTransformedNormal;'

                + 'void main(void) {'

                + '    vTexCoord = aTexCoord1;'

                + '    gl_Position = uPMatrix * uMVMatrix * (  uBoneMatrix1 * vec4(aVertexPosition1, 1.0) * aWeight1 '
                + '                                          + uBoneMatrix2 * vec4(aVertexPosition2, 1.0) * aWeight2);'

                + '    vTransformedNormal = (uNormalMatrix * ((uBoneMatrix1 * vec4(aVertexNormal1, 1.0) - uBoneMatrix1[3]) * aWeight1 '
                + '                                         + (uBoneMatrix2 * vec4(aVertexNormal2, 1.0) - uBoneMatrix2[3]) * aWeight2)).xyz;'
                + '}';
        }

        initializeFragmentSourceCode() {

            this.fragmentShaderSourceCode = ''
                + this.floatPrecisionDefinitionCode

                + 'varying vec2 vTexCoord;'
                + 'varying vec3 vTransformedNormal;'

                + 'uniform sampler2D uTexture0;'

                + 'void main(void) {'
                + '    gl_FragColor = texture2D(uTexture0, vTexCoord);'
                + '}';
        }

        initializeAttributes() {

            this.initializeAttributes_RenderShader();
            this.initializeAttributes_Bone2Shader();
        }

        initializeAttributes_Bone2Shader() {

            this.aWeight1 = this.getAttribLocation('aWeight1');
            this.aVertexPosition1 = this.getAttribLocation('aVertexPosition1');
            this.aVertexNormal1 = this.getAttribLocation('aVertexNormal1');

            this.aWeight2 = this.getAttribLocation('aWeight2');
            this.aVertexPosition2 = this.getAttribLocation('aVertexPosition2');
            this.aVertexNormal2 = this.getAttribLocation('aVertexNormal2');

            this.aTexCoord1 = this.getAttribLocation('aTexCoord1');

            this.uNormalMatrix = this.getUniformLocation('uNormalMatrix');

            this.uBoneMatrixList.push(this.getUniformLocation('uBoneMatrix1'));
            this.uBoneMatrixList.push(this.getUniformLocation('uBoneMatrix2'));

            this.uTexture0 = this.getUniformLocation('uTexture0');
        }

        setBuffers(model: RenderModel, images: List<RenderImage>) {

            this.setBuffers_Bone2Shader(model, images);
            this.setBuffers_Bone2Shader_UV(model);
        }

        setBuffers_Bone2Shader(model: RenderModel, images: List<RenderImage>) {

            let gl = this.gl;

            gl.bindBuffer(gl.ARRAY_BUFFER, model.vertexBuffer);

            this.enableVertexAttributes();
            this.resetVertexAttribPointerOffset();

            this.vertexAttribPointer(this.aWeight1, 1, gl.FLOAT, model.vertexDataStride);
            this.vertexAttribPointer(this.aVertexPosition1, 3, gl.FLOAT, model.vertexDataStride);
            this.vertexAttribPointer(this.aVertexNormal1, 3, gl.FLOAT, model.vertexDataStride);

            this.vertexAttribPointer(this.aWeight2, 1, gl.FLOAT, model.vertexDataStride);
            this.vertexAttribPointer(this.aVertexPosition2, 3, gl.FLOAT, model.vertexDataStride);
            this.vertexAttribPointer(this.aVertexNormal2, 3, gl.FLOAT, model.vertexDataStride);

            gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, model.indexBuffer);

            gl.activeTexture(gl.TEXTURE0);
            gl.bindTexture(gl.TEXTURE_2D, images[0].texture);
            gl.uniform1i(this.uTexture0, 0);
        }

        setBuffers_Bone2Shader_UV(model: RenderModel) {

            let gl = this.gl;

            this.vertexAttribPointer(this.aTexCoord1, 2, gl.FLOAT, model.vertexDataStride);
            //this.vertexAttribPointer(this.aTexCoord2, 2, gl.FLOAT, model.vertexDataStride, gl); skip (not used in this sample)
            //this.vertexAttribPointer(this.aTexCoord3, 2, gl.FLOAT, model.vertexDataStride, gl); skip (not used in this sample)
        }

        setNormalMatrix(matrix: Mat4, gl: WebGLRenderingContext) {
            gl.uniformMatrix4fv(this.uNormalMatrix, false, matrix);
        }

        setBoneMatrix(boneIndex: int, matrix: Mat4, gl: WebGLRenderingContext) {
            gl.uniformMatrix4fv(this.uBoneMatrixList[boneIndex], false, matrix);
        }
    }

    export class Bone4Shader extends Bone2Shader {

        aWeight3 = -1;
        aVertexPosition3 = -1;
        aVertexNormal3 = -1;

        aVertexPosition4 = -1;
        aWeight4 = -1;
        aVertexNormal4 = -1;

        initializeVertexSourceCode() {

            this.vertexShaderSourceCode = ''
                + this.floatPrecisionDefinitionCode

                + 'attribute float aWeight1;'
                + 'attribute vec3 aVertexPosition1;'
                + 'attribute vec3 aVertexNormal1;'

                + 'attribute float aWeight2;'
                + 'attribute vec3 aVertexPosition2;'
                + 'attribute vec3 aVertexNormal2;'

                + 'attribute float aWeight3;'
                + 'attribute vec3 aVertexPosition3;'
                + 'attribute vec3 aVertexNormal3;'

                + 'attribute float aWeight4;'
                + 'attribute vec3 aVertexPosition4;'
                + 'attribute vec3 aVertexNormal4;'

                + 'attribute vec2 aTexCoord1;'

                + 'uniform mat4 uBoneMatrix1;'
                + 'uniform mat4 uBoneMatrix2;'
                + 'uniform mat4 uBoneMatrix3;'
                + 'uniform mat4 uBoneMatrix4;'

                + 'uniform mat4 uMVMatrix;'
                + 'uniform mat4 uPMatrix;'
                + 'uniform mat4 uNormalMatrix;'

                + 'varying vec2 vTexCoord;'
                + 'varying vec3 vTransformedNormal;'

                + 'void main(void) {'

                + '    vTexCoord = aTexCoord1;'

                + '    gl_Position = uPMatrix * uMVMatrix * (  uBoneMatrix1 * vec4(aVertexPosition1, 1.0) * aWeight1 '
                + '                                          + uBoneMatrix2 * vec4(aVertexPosition2, 1.0) * aWeight2 '
                + '                                          + uBoneMatrix3 * vec4(aVertexPosition3, 1.0) * aWeight3 '
                + '                                          + uBoneMatrix4 * vec4(aVertexPosition4, 1.0) * aWeight4);'

                + '    vTransformedNormal = (uNormalMatrix * ((uBoneMatrix1 * vec4(aVertexNormal1, 1.0) - uBoneMatrix1[3]) * aWeight1 '
                + '                                         + (uBoneMatrix2 * vec4(aVertexNormal2, 1.0) - uBoneMatrix2[3]) * aWeight2 '
                + '                                         + (uBoneMatrix3 * vec4(aVertexNormal3, 1.0) - uBoneMatrix3[3]) * aWeight3 '
                + '                                         + (uBoneMatrix4 * vec4(aVertexNormal4, 1.0) - uBoneMatrix4[3]) * aWeight4)).xyz;'

                + '}';
        }

        initializeAttributes() {

            this.initializeAttributes_RenderShader();
            this.initializeAttributes_Bone2Shader();
            this.initializeAttributes_Bone4Shader();
        }

        initializeAttributes_Bone4Shader() {

            this.aWeight3 = this.getAttribLocation('aWeight3');
            this.aVertexPosition3 = this.getAttribLocation('aVertexPosition3');
            this.aVertexNormal3 = this.getAttribLocation('aVertexNormal3');

            this.aWeight4 = this.getAttribLocation('aWeight4');
            this.aVertexPosition4 = this.getAttribLocation('aVertexPosition4');
            this.aVertexNormal4 = this.getAttribLocation('aVertexNormal4');

            this.uBoneMatrixList.push(this.getUniformLocation('uBoneMatrix3'));
            this.uBoneMatrixList.push(this.getUniformLocation('uBoneMatrix4'));
        }

        setBuffers(model: RenderModel, images: List<RenderImage>) {

            this.setBuffers_Bone2Shader(model, images);
            this.setBuffers_Bone4Shader(model, images);
            this.setBuffers_Bone2Shader_UV(model);
        }

        setBuffers_Bone4Shader(model: RenderModel, images: List<RenderImage>) {

            let gl = this.gl;

            this.vertexAttribPointer(this.aWeight3, 1, gl.FLOAT, model.vertexDataStride);
            this.vertexAttribPointer(this.aVertexPosition3, 3, gl.FLOAT, model.vertexDataStride);
            this.vertexAttribPointer(this.aVertexNormal3, 3, gl.FLOAT, model.vertexDataStride);

            this.vertexAttribPointer(this.aWeight4, 1, gl.FLOAT, model.vertexDataStride);
            this.vertexAttribPointer(this.aVertexPosition4, 3, gl.FLOAT, model.vertexDataStride);
            this.vertexAttribPointer(this.aVertexNormal4, 3, gl.FLOAT, model.vertexDataStride);
        }
    }

    let toonFragmentShaderCode = ''

        + 'varying vec2 vTexCoord;'
        + 'varying vec3 vTransformedNormal;'

        + 'uniform sampler2D uTexture0;'
        + 'uniform vec2 uResolution;'

        + 'vec3 rgb2hsv(vec3 c)'
        + '{'
        + '  vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);'
        + '  vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));'
        + '  vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));'
        + '  float d = q.x - min(q.w, q.y);'
        + '  float e = 1.0e-10;'
        + '  return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);'
        + '}'

        + 'vec3 hsv2rgb(vec3 c)'
        + '{'
        + '  vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);'
        + '  vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);'
        + '  return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);'
        + '}'

        + 'void main(void) {'
        + '    vec2 p = gl_FragCoord.xy / uResolution;'

        + '    vec3  nnormal = normalize(vTransformedNormal);'
        + '    float directional = clamp(dot(nnormal, vec3(0.5, -0.5, 0.0)), 0.0, 1.0);'
        + '    float toons = 1.0 - smoothstep(0.57, 0.6, directional);'

        + '    vec4 sourceColor = texture2D(uTexture0, p);'
        + '    vec3 hsv = rgb2hsv(sourceColor.rgb);'
        + '    vec3 rgb = hsv2rgb(vec3(hsv.r, hsv.g + (hsv.b * toons * 0.2), hsv.b - (hsv.b * toons * 0.2)));'
        + '    gl_FragColor = vec4(rgb, sourceColor.a);'
        //+ '    gl_FragColor = vec4(toons, 0.0, 0.0, sourceColor.a);'
        + '}';

    export class Bone2Shader_Toons extends Bone2Shader {

        uResolution: WebGLUniformLocation = null;

        initializeFragmentSourceCode() {
            this.fragmentShaderSourceCode = ''
                + this.floatPrecisionDefinitionCode
                + toonFragmentShaderCode;
        }

        initializeAttributes() {

            this.initializeAttributes_RenderShader();
            this.initializeAttributes_Bone2Shader();
            this.initializeAttributes_Bone2Shader_Toons();
        }

        initializeAttributes_Bone2Shader_Toons() {

            this.uResolution = this.getUniformLocation('uResolution');
        }

        setResolution(width: int, height: int) {

            this.gl.uniform2fv(this.uResolution, vec2.fromValues(width, height));
        }
    }

    export class Bone4Shader_Toons extends Bone4Shader {

        uResolution: WebGLUniformLocation = null;

        initializeFragmentSourceCode() {
            this.fragmentShaderSourceCode = ''
                + this.floatPrecisionDefinitionCode
                + toonFragmentShaderCode;
        }

        initializeAttributes() {

            this.initializeAttributes_RenderShader();
            this.initializeAttributes_Bone2Shader();
            this.initializeAttributes_Bone4Shader();
            this.initializeAttributes_Bone2Shader_Toons();
        }

        initializeAttributes_Bone2Shader_Toons() {

            this.uResolution = this.getUniformLocation('uResolution');
        }

        setResolution(width: int, height: int) {

            this.gl.uniform2fv(this.uResolution, vec2.fromValues(width, height));
        }
    }

    let _Main: Main;

    window.onload = () => {

        let canvas = <HTMLCanvasElement>document.getElementById('canvas');
        _Main = new Main();
        _Main.initialize(canvas);

        setTimeout(run, 1000 / 30);
    };

    function run() {
        _Main.run();
        _Main.draw();

        setTimeout(run, 1000 / 24);
    }
}


text:
<?php

namespace Malarzm\Collections;

class ObjectSet extends AbstractCollection
{
    private $hashes = [];

    public function __construct(array $elements = [])
    {
        parent::__construct($elements);
        foreach ($this->elements as $element) {
            $this->hashes[spl_object_hash($element)] = true;
        }
    }

    /**
     * @inheritdoc
     */
    public function add($element)
    {
        $oid = spl_object_hash($element);

        if (isset($this->hashes[$oid])) {
            return;
        }

        $this->elements[] = $element;
        $this->hashes[$oid] = true;
    }

    /**
     * @inheritdoc
     */
    public function clear()
    {
        parent::clear();
        $this->hashes = [];
    }

    /**
     * Checks whether an element is contained in the collection.
     * Contrary to standard implementation this is an O(1) operation.
     *
     * @param object $element
     * @return bool
     */
    public function contains($element)
    {
        return isset($this->hashes[spl_object_hash($element)]);
    }

    /**
     * @inheritdoc
     */
    public function remove($key)
    {
        if ( ! isset($this->elements[$key]) && ! array_key_exists($key, $this->elements)) {
            return null;
        }

        $removed = $this->elements[$key];
        unset($this->elements[$key]);
        unset($this->hashes[spl_object_hash($removed)]);

        return $removed;
    }

    /**
     * @inheritdoc
     */
    public function removeElement($element)
    {
        $oid = spl_object_hash($element);

        if ( ! isset($this->hashes[$oid])) {
            return false;
        }

        $key = $this->indexOf($element);

        if ($key === false) {
            return false;
        }

        unset($this->elements[$key]);
        unset($this->hashes[$oid]);

        return true;
    }

    /**
     * @inheritdoc
     */
    public function set($key, $value)
    {
        $oid = spl_object_hash($value);

        if (isset($this->hashes[$oid])) {
            return;
        }

        if (isset($this->elements[$key])) {
            unset($this->hashes[spl_object_hash($this->elements[$key])]);
        }

        $this->elements[$key] = $value;
        $this->hashes[$oid] = true;
    }
}


text:
Update Book

Update Book

     Name:

      <input class="input" [(ngModel)]="book.name" />

     Category:

      <input class="input" [(ngModel)]="book.category" />

     Writer:

        <input class="input" [(ngModel)]="book.writer" />

    <button class="button is-primary" (click)="goBack()">OK</button>
    <button class="button is-info" (click)="goBack()">Go Back</button>


text:
require 'xommelier'
require 'base64'
require 'active_support/core_ext/module/delegation'

module Xommelier
  module DS
    include Xommelier::Xml

    xmlns 'http://www.w3.org/2000/09/xmldsig#', as: :ds
    schema

    class CryptoBinary < DelegateClass(String)
      def self.from_xommelier(value)
        return unless value
        case value
        when %r(\A[a-zA-Z0-9+/]={0,2}\Z)
          new Base64.decode64(value)
        when String
          new value
        else
          new value.to_s
        end
      end

      def inspect
        %(#<#{self.class.name} "#{self}">)
      end

      def raw
        __getobj__
      end

      delegate :to_s, to: :to_xommelier

      def to_xommelier
        Base64.encode64(raw)
      end
    end

    class Element < Xml::Element
      def self.find_element_name
        name.demodulize
      end

      # Defines containing attribute
      def self.attribute(name, options = {})
        options[:as] ||= name.to_s.camelcase
        super(name, options)
      end

      def self.any!(_options = {})
        # TODO: implement <any /> logic
      end

      def self.choice!(_options = {})
        # TODO: implement <choice /> logic
        may do
          yield
        end
      end

      def self.sequence!(_options = {})
        # TODO: implement <choice /> logic
        yield
      end

      def self.has_algorithm(map = {})
        attribute :algorithm, type: Uri, required: true

        const_set(:ALGORITHMS, map)
        map.each do |name, algorithm|
          define_singleton_method("new_#{name}") do |options = {}|
            new(options.merge(algorithm: algorithm))
          end
        end

        define_method(:algorithm_name) do
          map.key(algorithm.to_s)
        end
      end
    end

    class SignatureValue < Element
      attribute :id, optional: true

      text
    end

    class CanonicalizationMethod < Element
      any! ns: :any, count: :any
      has_algorithm(
        omit_comments: 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315',
        with_comments: 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments'
      )
    end

    class SignatureMethod < Element
      element :hmac_output_length, as: 'HMACOutputLength', type: Integer, count: :may
      any! ns: :other, count: :any
      has_algorithm(
        rsa_sha1: 'http://www.w3.org/2000/09/xmldsig#rsa-sha1',
        dsa_sha1: 'http://www.w3.org/2000/09/xmldsig#dsa-sha1'
      )
    end

    class Transform < Element
      choice! count: :any do
        any! ns: :other
        element :xpath, as: 'XPath'
      end
      has_algorithm(
        xslt: 'http://www.w3.org/TR/1999/REC-xslt-19991116',
        xpath: 'http://www.w3.org/TR/1999/REC-xpath-19991116',
        enveloped_signature: 'http://www.w3.org/2000/09/xmldsig#enveloped-signature'
      )
    end

    class Transforms < Element
      element ref: Transform, count: :many
    end

    class DigestMethod < Element
      any! ns: :other, count: :any
      has_algorithm(
        sha1: 'http://www.w3.org/2000/09/xmldsig#sha1'
      )
    end

    class Reference < Element
      element ref: Transforms, count: :may
      element ref: DigestMethod
      element :digest_value, as: 'DigestValue'
      attribute :id, optional: true
      attribute :uri, as: 'URI', type: Uri, optional: true
      attribute :type, type: Uri, optional: true
    end

    class SignedInfo < Element
      element ref: CanonicalizationMethod
      element ref: SignatureMethod
      element ref: Reference, count: :many
      attribute :id, optional: true
    end

    class DSAKeyValue < Element
      sequence! count: :may do
        element :p, as: 'P', type: CryptoBinary
        element :q, as: 'Q', type: CryptoBinary
      end
      element :g, as: 'G', type: CryptoBinary, count: :may
      element :y, as: 'Y', type: CryptoBinary
      element :j, as: 'J', type: CryptoBinary, count: :may
      sequence! count: :may do
        element :seed, as: 'Seed', type: CryptoBinary
        element :pgen_counter, as: 'PgenCounter', type: CryptoBinary
      end
    end

    class RSAKeyValue < Element
      sequence! do
        element :modulus, as: 'Modulus', type: CryptoBinary
        element :exponent, as: 'Exponent', type: CryptoBinary
      end
    end

    class KeyValue < Element
      choice! do
        element ref: DSAKeyValue
        element ref: RSAKeyValue
        any! ns: :other
      end
    end

    class RetrievalMethod < Element
      element ref: Transforms, count: :any
      attribute :uri, as: 'URI', type: URI
      attribute :type, type: URI, optional: true
    end

    class X509IssuerSerial < Element
      element :issuer_name, as: 'X509IssuerName'
      element :serial_number, as: 'X509SerialNumber', type: Integer
    end

    class X509Data < Element
      sequence! count: :many do
        choice! do
          element :issuer_serial, type: X509IssuerSerial
          element :ski, as: 'X509SKI'
          element :subject_name, as: 'X509SubjectName'
          element :certificate, as: 'X509Certificate'
          element :crl, as: 'X509CRL'
          any! ns: :other
        end
      end
    end

    class PGPData < Element
      element :key_id, as: 'PGPKeyID', count: :may
      element :key_packet, as: 'PGPKeyPacket', count: :may
      any! ns: :other, count: :any
    end

    class SPKIData < Element
      element :sexp, as: 'SPKISexp'
      any! ns: :other, count: :may
    end

    class KeyInfo < Element
      choice! count: :many do
        element :key_name, as: 'KeyName'
        element ref: KeyValue
        element ref: RetrievalMethod
        element ref: X509Data
        element ref: PGPData
        element ref: SPKIData
        element :mgmt_data, as: 'MgmtData'
        any! ns: :other
      end
      attribute :id, optional: true
    end

    class Manifest < Element
      element ref: Reference, count: :many
      attribute :id, optional: true
    end

    class SignatureProperty < Element
      choice! do
        any! ns: :other
      end
      attribute :target, type: Uri, optional: true
      attribute :id, optional: true
    end

    class SignatureProperties < Element
      element ref: SignatureProperty, count: :many
      attribute :id, optional: true
    end

    class Object < Element
      any! ns: :any, count: :any
      attribute :id, optional: true
      attribute :mime_type, optional: true
      attribute :encoding, type: Uri, optional: true
    end

    class Signature < Element
      element ref: SignedInfo
      element ref: SignatureValue
      element ref: KeyInfo, count: :may
      element ref: Object, count: :any

      attribute :id, optional: true
    end
  end
end


text:
require 'optparse'
require 'fileutils'
require 'json'

VERSION = '0.0.1'
DESTINATION = 'git_source'

def git_repo?(dir)
  cwd = Dir.pwd
  return false unless Dir.exist? dir
  begin
    Dir.chdir dir
    %x(git status 2>&1)
    return true if $?.exitstatus == 0
    return false
  ensure
    Dir.chdir cwd
  end
end

def git_revision(dir)
  cwd = Dir.pwd
  begin
    Dir.chdir dir
    return %x(git rev-parse --verify HEAD).strip
  ensure
    Dir.chdir cwd
  end
end

def git_clone(source, destination)
  $stderr.puts "Cloning #{source} to #{destination} ..."
  %x(git clone #{source} #{destination} 2>&1)
  fail 'Git clone failed' if $?.exitstatus != 0
  $stderr.puts '... cloning done.'
end

def git_update(git_repo)
  $stderr.puts "Updating git repository #{git_repo} ..."
  cwd = Dir.pwd
  begin
    Dir.chdir git_repo
    %x(git pull 2>&1)
    fail 'Git pull failed' if $?.exitstatus != 0
  ensure
    Dir.chdir cwd
  end
  $stderr.puts '... update done.'
end

options = {}
OptionParser.new do |opts|
  opts.on('-v', '--version', 'Version of the script') do
    puts VERSION
    exit
  end

  opts.on('-r', '--repository URL', 'URL of repository to clone') do |r|
    options[:repository] = r
  end
end.parse!

workdir = ARGV.pop

if workdir.nil?
  fail 'Please supply path to work directory.'
end

destination = File.expand_path(File.join(workdir, DESTINATION))
FileUtils.mkdir_p destination

if git_repo?(destination)
  git_update(destination)
else
  git_clone(options[:repository], destination)
end

revision = git_revision(destination)

puts JSON.dump({ source: destination, revision: revision })


text:
SCENARIO("Reading gates from the intersection table", "[Board]") {
  GIVEN("An uninitialised Board") {
    Board board;

    REQUIRE(board.gateFromIntersection('m', '5') == 'E');
    REQUIRE(board.gateFromIntersection('c', '3') == 'N');
    REQUIRE(board.gateFromIntersection('w', '8') == 'S');

    // Intersection 'a' is not next to piece 2.
    REQUIRE_THROWS_AS(board.gateFromIntersection('a', '2'), Ex::IntersectionMismatch);

    // Input garbage.
    REQUIRE_THROWS(board.gateFromIntersection('\0', '\0'));
    REQUIRE_THROWS(board.gateFromIntersection('9', 'w'));

    // We shouldn't call with stations.
    REQUIRE_THROWS_AS(board.gateFromIntersection('A', '3'), Ex::IncorrectNodePassed);

    WHEN("we initialise it with standard pieces") {
        // Yes, we should really use a NiceBoard. We can't use getStandardBoard
        // either, because that returns a NiceBoard (we could cast it down, but
        // it means we would need to pull NiceBoard in anyway).
        board.bits[0][0] = OrientatedPiece(getStandardPiece(1));
        board.bits[1][0] = OrientatedPiece(getStandardPiece(2));
        board.bits[2][0] = OrientatedPiece(getStandardPiece(2));
        board.bits[0][1] = OrientatedPiece(getStandardPiece(2));
        board.bits[1][1] = OrientatedPiece(getStandardPiece(3));
        board.bits[2][1] = OrientatedPiece(getStandardPiece(3));
        board.bits[0][2] = OrientatedPiece(getStandardPiece(4));
        board.bits[1][2] = OrientatedPiece(getStandardPiece(5));
        board.bits[2][2] = OrientatedPiece(getStandardPiece(5));

        THEN("the flows work correctly (nice to have, but we really only care about NiceBoard)") {
          CHECK(board.canFlow('a','h','A') == true);
          CHECK(board.canFlow('a','A','A') == false);
          CHECK(board.canFlow('a','A','1') == true);
          CHECK(board.canFlow('a','A','5') == false);
          CHECK(board.canFlow('D','v','D') == true);
        }
    }
  }
}


text:
import sublime, sublime_plugin
import os, subprocess

class RefreshCommand(sublime_plugin.TextCommand):
    """ Refresh the project """

    label = "REFRESH: "
    base_cmd = "source ~/.bash_profile && "
    status_msg = ""

    folder = None
    cmd = None
    callback = None

    # will only run if there is one (1) project folder in the window
    # runs asynchronously for real-time status updates (useful for
    # long running refreshes)

    # First runs `rebuild_jekyll`, then `remove_logs`, then `restart_rack`

    def run(self, edit):
        folders = self.view.window().folders()
        if len(folders) == 1:
            self.status_msg = ""
            self.set_status(self.label)
            self.folder = str(folders.pop())

            self.start_refresh()
        elif len(folders) == 0:
            self.set_status("no project folders to refresh, ")
            self.finish_refresh()
        else:
            self.set_status("can't refresh more than one project folder, ")
            self.finish_refresh()

    # action methods

    def start_refresh(self):
        self.rebuild_jekyll()

    def rebuild_jekyll(self):
        cmd = "bundle exec jekyll --no-auto --no-server"
        callback = self.remove_logs
        if os.path.exists(os.path.join(self.folder, '_config.yml')):
            self.setup_cmd(cmd, callback)
        else:
            callback()

    def remove_logs(self):
        cmd = "rm -f log/*.log"
        callback = self.restart_rack
        if os.path.exists(os.path.join(self.folder, 'log')):
            self.setup_cmd(cmd, callback)
        else:
            callback()

    def restart_rack(self):
        cmd = "mkdir -p tmp && touch tmp/restart.txt"
        callback = self.finish_refresh
        if os.path.exists(os.path.join(self.folder, 'config.ru')):
            self.setup_cmd(cmd, callback)
        else:
            callback()

    def finish_refresh(self):
        if self.status_msg == self.label:
            self.set_status("nothing needed.")
        else:
            self.set_status("done.")

    # private methods

    def setup_cmd(self, cmd, callback):
        self.set_status("`" + cmd + "`... ")
        self.cmd = cmd
        self.callback = callback
        sublime.set_timeout(self.run_cmd, 1)

    def run_cmd(self):
        try:
            p = subprocess.Popen(self.base_cmd+self.cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=self.folder, shell=True)
            result, err = p.communicate()
        except Exception as e:
            self.set_status(str(e))
        self.callback()

    def set_status(self, msg):
        self.status_msg += msg
        sublime.status_message(self.status_msg)


text:
import os
import os.path as op

from werkzeug import secure_filename
from werkzeug.datastructures import FileStorage

from wtforms import ValidationError, fields
from wtforms.widgets import HTMLString, html_params

try:
    from wtforms.fields.core import _unset_value as unset_value
except ImportError:
    from wtforms.utils import unset_value

from flask_admin.babel import gettext
from flask_admin.helpers import get_url

from flask_admin._compat import string_types, urljoin

try:
    from PIL import Image, ImageOps
except ImportError:
    Image = None
    ImageOps = None

__all__ = ['FileUploadInput', 'FileUploadField',
           'ImageUploadInput', 'ImageUploadField',
           'namegen_filename', 'thumbgen_filename']

# Widgets
class FileUploadInput(object):
    """
        Renders a file input chooser field.

        You can customize `empty_template` and `data_template` members to customize
        look and feel.
    """
    empty_template = ('<input %(file)s>')

    data_template = ('
'
                     ' <input %(text)s>'
                     ' <input type="checkbox" name="%(marker)s">Delete</input>'
                     '
'
                     '<input %(file)s>')

    def __call__(self, field, **kwargs):
        kwargs.setdefault('id', field.id)
        kwargs.setdefault('name', field.name)

        template = self.data_template if field.data else self.empty_template

        if field.errors:
            template = self.empty_template

        if field.data and isinstance(field.data, FileStorage):
            value = field.data.filename
        else:
            value = field.data or ''

        return HTMLString(template % {
            'text': html_params(type='text',
                                readonly='readonly',
                                value=value,
                                name=field.name),
            'file': html_params(type='file',
                                value=value,
                                **kwargs),
            'marker': '_%s-delete' % field.name
        })

class ImageUploadInput(object):
    """
        Renders a image input chooser field.

        You can customize `empty_template` and `data_template` members to customize
        look and feel.
    """
    empty_template = ('<input %(file)s>')

    data_template = ('
'
                     ' '
                     ' <input type="checkbox" name="%(marker)s">Delete</input>'
                     '
'
                     '<input %(file)s>')

    def __call__(self, field, **kwargs):
        kwargs.setdefault('id', field.id)
        kwargs.setdefault('name', field.name)

        args = {
            'file': html_params(type='file',
                                **kwargs),
            'marker': '_%s-delete' % field.name
        }

        if field.data and isinstance(field.data, string_types):
            url = self.get_url(field)
            args['image'] = html_params(src=url)

            template = self.data_template
        else:
            template = self.empty_template

        return HTMLString(template % args)

    def get_url(self, field):
        if field.thumbnail_size:
            filename = field.thumbnail_fn(field.data)
        else:
            filename = field.data

        if field.url_relative_path:
            filename = urljoin(field.url_relative_path, filename)

        return get_url(field.endpoint, filename=filename)

# Fields
class FileUploadField(fields.StringField):
    """
        Customizable file-upload field.

        Saves file to configured path, handles updates and deletions. Inherits from `StringField`,
        resulting filename will be stored as string.
    """
    widget = FileUploadInput()

    def __init__(self, label=None, validators=None,
                 base_path=None, relative_path=None,
                 namegen=None, allowed_extensions=None,
                 permission=0o666, allow_overwrite=True,
                 **kwargs):
        """
            Constructor.

            :param label:
                Display label
            :param validators:
                Validators
            :param base_path:
                Absolute path to the directory which will store files
            :param relative_path:
                Relative path from the directory. Will be prepended to the file name for uploaded files.
                Flask-Admin uses `urlparse.urljoin` to generate resulting filename, so make sure you have
                trailing slash.
            :param namegen:
                Function that will generate filename from the model and uploaded file object.
                Please note, that model is "dirty" model object, before it was committed to database.

                For example::

                    import os.path as op

                    def prefix_name(obj, file_data):
                        parts = op.splitext(file_data.filename)
                        return secure_filename('file-%s%s' % parts)

                    class MyForm(BaseForm):
                        upload = FileUploadField('File', namegen=prefix_name)

            :param allowed_extensions:
                List of allowed extensions. If not provided, will allow any file.
            :param allow_overwrite:
                Whether to overwrite existing files in upload directory. Defaults to `True`.

            .. versionadded:: 1.1.1
                The `allow_overwrite` parameter was added.
        """
        self.base_path = base_path
        self.relative_path = relative_path

        self.namegen = namegen or namegen_filename
        self.allowed_extensions = allowed_extensions
        self.permission = permission
        self._allow_overwrite = allow_overwrite

        self._should_delete = False

        super(FileUploadField, self).__init__(label, validators, **kwargs)

    def is_file_allowed(self, filename):
        """
            Check if file extension is allowed.

            :param filename:
                File name to check
        """
        if not self.allowed_extensions:
            return True

        return ('.' in filename and
                filename.rsplit('.', 1)[1].lower() in
                map(lambda x: x.lower(), self.allowed_extensions))

    def _is_uploaded_file(self, data):
        return (data
                and isinstance(data, FileStorage)
                and data.filename)

    def pre_validate(self, form):
        if self._is_uploaded_file(self.data) and not self.is_file_allowed(self.data.filename):
            raise ValidationError(gettext('Invalid file extension'))

        # Handle overwriting existing content
        if not self._is_uploaded_file(self.data):
            return

        if not self._allow_overwrite and os.path.exists(self._get_path(self.data.filename)):
            raise ValidationError(gettext('File "%s" already exists.' % self.data.filename))

    def process(self, formdata, data=unset_value):
        if formdata:
            marker = '_%s-delete' % self.name
            if marker in formdata:
                self._should_delete = True

        return super(FileUploadField, self).process(formdata, data)

    def process_formdata(self, valuelist):
        if self._should_delete:
            self.data = None
        elif valuelist:
            for data in valuelist:
                if self._is_uploaded_file(data):
                    self.data = data
                    break

    def populate_obj(self, obj, name):
        field = getattr(obj, name, None)
        if field:
            # If field should be deleted, clean it up
            if self._should_delete:
                self._delete_file(field)
                setattr(obj, name, None)
                return

        if self._is_uploaded_file(self.data):
            if field:
                self._delete_file(field)

            filename = self.generate_name(obj, self.data)
            filename = self._save_file(self.data, filename)
            # update filename of FileStorage to our validated name
            self.data.filename = filename

            setattr(obj, name, filename)

    def generate_name(self, obj, file_data):
        filename = self.namegen(obj, file_data)

        if not self.relative_path:
            return filename

        return urljoin(self.relative_path, filename)

    def _get_path(self, filename):
        if not self.base_path:
            raise ValueError('FileUploadField field requires base_path to be set.')

        if callable(self.base_path):
            return op.join(self.base_path(), filename)
        return op.join(self.base_path, filename)

    def _delete_file(self, filename):
        path = self._get_path(filename)

        if op.exists(path):
            os.remove(path)

    def _save_file(self, data, filename):
        path = self._get_path(filename)
        if not op.exists(op.dirname(path)):
            os.makedirs(os.path.dirname(path), self.permission | 0o111)

        if self._allow_overwrite == False and os.path.exists(path):
            raise ValueError(gettext('File "%s" already exists.' % path))

        data.save(path)

        return filename

class ImageUploadField(FileUploadField):
    """
        Image upload field.

        Does image validation, thumbnail generation, updating and deleting images.

        Requires PIL (or Pillow) to be installed.
    """
    widget = ImageUploadInput()

    keep_image_formats = ('PNG',)
    """
        If field detects that uploaded image is not in this list, it will save image
        as PNG.
    """

    def __init__(self, label=None, validators=None,
                 base_path=None, relative_path=None,
                 namegen=None, allowed_extensions=None,
                 max_size=None,
                 thumbgen=None, thumbnail_size=None,
                 permission=0o666,
                 url_relative_path=None, endpoint='static',
                 **kwargs):
        """
            Constructor.

            :param label:
                Display label
            :param validators:
                Validators
            :param base_path:
                Absolute path to the directory which will store files
            :param relative_path:
                Relative path from the directory. Will be prepended to the file name for uploaded files.
                Flask-Admin uses `urlparse.urljoin` to generate resulting filename, so make sure you have
                trailing slash.
            :param namegen:
                Function that will generate filename from the model and uploaded file object.
                Please note, that model is "dirty" model object, before it was committed to database.

                For example::

                    import os.path as op

                    def prefix_name(obj, file_data):
                        parts = op.splitext(file_data.filename)
                        return secure_filename('file-%s%s' % parts)

                    class MyForm(BaseForm):
                        upload = FileUploadField('File', namegen=prefix_name)

            :param allowed_extensions:
                List of allowed extensions. If not provided, then gif, jpg, jpeg, png and tiff will be allowed.
            :param max_size:
                Tuple of (width, height, force) or None. If provided, Flask-Admin will
                resize image to the desired size.

                Width and height is in pixels. If `force` is set to `True`, will try to fit image into dimensions and
                keep aspect ratio, otherwise will just resize to target size.
            :param thumbgen:
                Thumbnail filename generation function. All thumbnails will be saved as JPEG files,
                so there's no need to keep original file extension.

                For example::

                    import os.path as op

                    def thumb_name(filename):
                        name, _ = op.splitext(filename)
                        return secure_filename('%s-thumb.jpg' % name)

                    class MyForm(BaseForm):
                        upload = ImageUploadField('File', thumbgen=thumb_name)

            :param thumbnail_size:
                Tuple or (width, height, force) values. If not provided, thumbnail won't be created.

                Width and height is in pixels. If `force` is set to `True`, will try to fit image into dimensions and
                keep aspect ratio, otherwise will just resize to target size.
            :param url_relative_path:
                Relative path from the root of the static directory URL. Only gets used when generating
                preview image URLs.

                For example, your model might store just file names (`relative_path` set to `None`), but
                `base_path` is pointing to subdirectory.
            :param endpoint:
                Static endpoint for images. Used by widget to display previews. Defaults to 'static'.
        """
        # Check if PIL is installed
        if Image is None:
            raise ImportError('PIL library was not found')

        self.max_size = max_size
        self.thumbnail_fn = thumbgen or thumbgen_filename
        self.thumbnail_size = thumbnail_size
        self.endpoint = endpoint
        self.image = None
        self.url_relative_path = url_relative_path

        if not allowed_extensions:
            allowed_extensions = ('gif', 'jpg', 'jpeg', 'png', 'tiff')

        super(ImageUploadField, self).__init__(label, validators,
                                               base_path=base_path,
                                               relative_path=relative_path,
                                               namegen=namegen,
                                               allowed_extensions=allowed_extensions,
                                               permission=permission,
                                               **kwargs)

    def pre_validate(self, form):
        super(ImageUploadField, self).pre_validate(form)

        if self._is_uploaded_file(self.data):
            try:
                self.image = Image.open(self.data)
            except Exception as e:
                raise ValidationError('Invalid image: %s' % e)

    # Deletion
    def _delete_file(self, filename):
        super(ImageUploadField, self)._delete_file(filename)

        self._delete_thumbnail(filename)

    def _delete_thumbnail(self, filename):
        path = self._get_path(self.thumbnail_fn(filename))

        if op.exists(path):
            os.remove(path)

    # Saving
    def _save_file(self, data, filename):
        path = self._get_path(filename)

        if not op.exists(op.dirname(path)):
            os.makedirs(os.path.dirname(path), self.permission | 0o111)

        # Figure out format
        filename, format = self._get_save_format(filename, self.image)

        if self.image and (self.image.format != format or self.max_size):
            if self.max_size:
                image = self._resize(self.image, self.max_size)
            else:
                image = self.image

            self._save_image(image, self._get_path(filename), format)
        else:
            data.seek(0)
            data.save(self._get_path(filename))

        self._save_thumbnail(data, filename, format)

        return filename

    def _save_thumbnail(self, data, filename, format):
        if self.image and self.thumbnail_size:
            path = self._get_path(self.thumbnail_fn(filename))

            self._save_image(self._resize(self.image, self.thumbnail_size),
                             path,
                             format)

    def _resize(self, image, size):
        (width, height, force) = size

        if image.size[0] > width or image.size[1] > height:
            if force:
                return ImageOps.fit(self.image, (width, height), Image.ANTIALIAS)
            else:
                thumb = self.image.copy()
                thumb.thumbnail((width, height), Image.ANTIALIAS)
                return thumb

        return image

    def _save_image(self, image, path, format='JPEG'):
        if image.mode not in ('RGB', 'RGBA'):
            image = image.convert('RGBA')

        with open(path, 'wb') as fp:
            image.save(fp, format)

    def _get_save_format(self, filename, image):
        if image.format not in self.keep_image_formats:
            name, ext = op.splitext(filename)
            filename = '%s.jpg' % name
            return filename, 'JPEG'

        return filename, image.format

# Helpers
def namegen_filename(obj, file_data):
    """
        Generate secure filename for uploaded file.
    """
    return secure_filename(file_data.filename)

def thumbgen_filename(filename):
    """
        Generate thumbnail name from filename.
    """
    name, ext = op.splitext(filename)
    return '%s_thumb%s' % (name, ext)


text:
SimpleNavigation::Configuration.run do |navigation|
  # Specify a custom renderer if needed.
  # The default renderer is SimpleNavigation::Renderer::List which renders HTML lists.
  # The renderer can also be specified as option in the render_navigation call.
  # navigation.renderer = Your::Custom::Renderer

  # Specify the class that will be applied to active navigation items. Defaults to 'selected'
  # navigation.selected_class = 'your_selected_class'
  navigation.selected_class = 'current_page_item'

  # Specify the class that will be applied to the current leaf of
  # active navigation items. Defaults to 'simple-navigation-active-leaf'
  # navigation.active_leaf_class = 'your_active_leaf_class'

  # Item keys are normally added to list items as id.
  # This setting turns that off
  navigation.autogenerate_item_ids = false

  # You can override the default logic that is used to autogenerate the item ids.
  # To do this, define a Proc which takes the key of the current item as argument.
  # The example below would add a prefix to each key.
  # navigation.id_generator = Proc.new {|key| "my-prefix-#{key}"}

  # If you need to add custom html around item names, you can define a proc that will be called with the name you pass in to the navigation.
  # The example below shows how to wrap items spans.
  # navigation.name_generator = Proc.new {|name| "<span>#{name}</span>"}

  # The auto highlight feature is turned on by default.
  # This turns it off globally (for the whole plugin)
  # navigation.auto_highlight = false

  # Define the primary navigation
  navigation.items do |primary|
    # Add an item to the primary navigation. The following params apply:
    # key - a symbol which uniquely defines your navigation item in the scope of the primary_navigation
    # name - will be displayed in the rendered navigation. This can also be a call to your I18n-framework.
    # url - the address that the generated item links to. You can also use url_helpers (named routes, restful routes helper, url_for etc.)
    # options - can be used to specify attributes that will be included in the rendered navigation item (e.g. id, class etc.)
    #           some special options that can be set:
    #           :if - Specifies a proc to call to determine if the item should
    #                 be rendered (e.g. <tt>:if => Proc.new { current_user.admin? }</tt>). The
    #                 proc should evaluate to a true or false value and is evaluated in the context of the view.
    #           :unless - Specifies a proc to call to determine if the item should not
    #                     be rendered (e.g. <tt>:unless => Proc.new { current_user.admin? }</tt>). The
    #                     proc should evaluate to a true or false value and is evaluated in the context of the view.
    #           :method - Specifies the http-method for the generated link - default is :get.
    #           :highlights_on - if autohighlighting is turned off and/or you want to explicitly specify
    #                            when the item should be highlighted, you can set a regexp which is matched
    #                            against the current URI.  You may also use a proc, or the symbol <tt>:subpath</tt>.
    #
    # primary.item :key_1, 'name', url, options

    primary.item :accounts, 'Clients', accounts_path, :if => Proc.new { current_user } do |accounts|
      accounts.item :new_client, 'New Client', new_account_path, :highlights_on => /accounts/
      accounts.item :all_clients, 'Show All Clients', accounts_path + "?search_string=", :highlights_on => /accounts/
    end

    primary.item :billing, 'Billing', billing_sessions_path, :if => Proc.new { current_user } do |billing|
      billing.item :billing_sessions, 'Billing Sessions', billing_sessions_path, :highlights_on => /(\/billing_sessions)|(\/bills)/
      billing.item :call_detail_records, 'Call Detail Records', call_detail_records_path, :highlights_on => /call_detail_records/
      billing.item :stranded_calls, 'Stranded Calls', temp_calls_path, :highlights_on => /temp_calls/
    end

    # Add an item which has a sub navigation (same params, but with block)
    primary.item :settings, 'Settings', company_path, :if => Proc.new { current_user } do |settings|
      # Add an item to the sub navigation (same params again)
      settings.item :company, 'Company', company_path, :highlights_on => /sites/
      settings.item :taxes, 'Taxes', taxes_path, :highlights_on => /taxes/
      settings.item :sales_reps, 'Sales Representatives', sales_reps_path, :highlights_on => /sales_reps/
      settings.item :call_types, 'Call Types', call_type_infos_path, :highlights_on => /call_type_infos/
      settings.item :providers, 'Providers', providers_path, :highlights_on => /providers/
      settings.item :local_rates, 'Local Rates', local_plans_path, :highlights_on => /local_plans/
      settings.item :international_rates, 'International Rates', international_plans_path, :highlights_on => /(\/international_plans)|(\/international_rates)/
      settings.item :call_minimum_charges, 'Call Minimum Charges', minimum_charge_ratings_path, :highlights_on => /minimum_charge_ratings/
      settings.item :long_distance_plans, 'Long Distance Plans', rating_plans_path, :highlights_on => /rating_plans/
    end

    primary.item :admin, 'Admin', admin_path, :unless => Proc.new { current_user } do |admin|
       admin.item :companies, 'Companies', sites_path, :highlights_on => /sites/
       admin.item :users, 'Users', users_path, :highlights_on => /users/
    end

    # You can also specify a condition-proc that needs to be fullfilled to display an item.
    # Conditions are part of the options. They are evaluated in the context of the views,
    # thus you can use all the methods and vars you have available in the views.
    # primary.item :key_3, 'Admin', url, :class => 'special', :if => Proc.new { current_user.admin? }
    # primary.item :key_4, 'Account', url, :unless => Proc.new { logged_in? }

    # you can also specify a css id or class to attach to this particular level
    # works for all levels of the menu
    # primary.dom_id = 'menu-id'
    # primary.dom_class = 'menu-class'

    # You can turn off auto highlighting for a specific level
    # primary.auto_highlight = false

  end

end


text:
package options

import (
	"errors"
	"fmt"

	"github.com/spf13/pflag"
)

// ManifestOptions contains the values that influence manifest contents.
type ManifestOptions struct {
	Namespace             string
	Image                 string
	ImagePullPolicy       string
	ConfigHostPath        string
	ConfigFileName        string
	CloudProviderHostPath string
	SecretsHostPath       string
}

// NewManifestOptions return default values for ManifestOptions.
func NewManifestOptions(componentName, image string) *ManifestOptions {
	return &ManifestOptions{
		Namespace:             fmt.Sprintf("openshift-%s", componentName),
		Image:                 image,
		ImagePullPolicy:       "IfNotPresent",
		ConfigHostPath:        "/etc/kubernetes/bootstrap-configs",
		ConfigFileName:        fmt.Sprintf("%s-config.yaml", componentName),
		CloudProviderHostPath: "/etc/kubernetes/cloud",
		SecretsHostPath:       "/etc/kubernetes/bootstrap-secrets",
	}
}

// AddfFlags adds the manifest related flags to the flagset.
func (o *ManifestOptions) AddFlags(fs *pflag.FlagSet, humanReadableComponentName string) {
	fs.StringVar(&o.Namespace, "manifest-namespace", o.Namespace,
		fmt.Sprintf("Target namespace for phase 3 %s pods.", humanReadableComponentName))
	fs.StringVar(&o.Image, "manifest-image", o.Image,
		fmt.Sprintf("Image to use for the %s.", humanReadableComponentName))
	fs.StringVar(&o.ImagePullPolicy, "manifest-image-pull-policy", o.ImagePullPolicy,
		fmt.Sprintf("Image pull policy to use for the %s.", humanReadableComponentName))
	fs.StringVar(&o.ConfigHostPath, "manifest-config-host-path", o.ConfigHostPath,
		fmt.Sprintf("A host path mounted into the %s pods to hold a config file.", humanReadableComponentName))
	fs.StringVar(&o.SecretsHostPath, "manifest-secrets-host-path", o.SecretsHostPath,
		fmt.Sprintf("A host path mounted into the %s pods to hold secrets.", humanReadableComponentName))
	fs.StringVar(&o.ConfigFileName, "manifest-config-file-name", o.ConfigFileName,
		"The config file name inside the manifest-config-host-path.")
	fs.StringVar(&o.CloudProviderHostPath, "manifest-cloud-provider-host-path", o.CloudProviderHostPath,
		fmt.Sprintf("A host path mounted into the %s pods to hold cloud provider configuration.", humanReadableComponentName))
}

// Complete fills in missing values before execution.
func (o *ManifestOptions) Complete() error {
	return nil
}

// Validate verifies the inputs.
func (o *ManifestOptions) Validate() error {
	if len(o.Namespace) == 0 {
		return errors.New("missing required flag: --manifest-namespace")
	}
	if len(o.Image) == 0 {
		return errors.New("missing required flag: --manifest-image")
	}
	if len(o.ImagePullPolicy) == 0 {
		return errors.New("missing required flag: --manifest-image-pull-policy")
	}
	if len(o.ConfigHostPath) == 0 {
		return errors.New("missing required flag: --manifest-config-host-path")
	}
	if len(o.ConfigFileName) == 0 {
		return errors.New("missing required flag: --manifest-config-file-name")
	}
	if len(o.CloudProviderHostPath) == 0 {
		return errors.New("missing required flag: --manifest-cloud-provider-host-path")
	}
	if len(o.SecretsHostPath) == 0 {
		return errors.New("missing required flag: --manifest-secrets-host-path")
	}

	return nil
}

// ApplyTo applies the options ot the given config struct.
func (o *ManifestOptions) ApplyTo(cfg *ManifestConfig) error {
	cfg.Namespace = o.Namespace
	cfg.Image = o.Image
	cfg.ImagePullPolicy = o.ImagePullPolicy
	cfg.ConfigHostPath = o.ConfigHostPath
	cfg.ConfigFileName = o.ConfigFileName
	cfg.CloudProviderHostPath = o.CloudProviderHostPath
	cfg.SecretsHostPath = o.SecretsHostPath

	return nil
}


text:
using System;
using System.Configuration;
using StackExchange.Redis;

namespace RedisSample.RedisCore
{
    // Singleton to grab a connection to Redis
    public class RedisConnectionManager
    {
        private static readonly object InternalLock = new object();
        private static ConnectionMultiplexer _connection;

        public static ConnectionMultiplexer Connection
        {
            get
            {
                if (_connection == null)
                {
                    lock (InternalLock)
                    {
                        if (_connection == null)
                        {
                            var redisUrl = ConfigurationManager.AppSettings["RedisUrl"];
                            var redisPassword = ConfigurationManager.AppSettings["RedisPassword"];

                            string connectionString = String.Format("{0},abortConnect=false,ssl=true,password={1}", redisUrl, redisPassword);

                            _connection = ConnectionMultiplexer.Connect(connectionString);
                        }
                    }
                }

                return _connection;
            }
        }
    }
}


text:
from ._core import Broker, lookup_config, SPECIAL_NAME
from ._core import get_fields  # unused, but here for API compat
from functools import wraps
import os
import six
from warnings import warn

if six.PY2:
    FileNotFoundError = IOError

def deprecate(f):
    @wraps(f)
    def inner(*args, **kwargs):
        name = getattr(f, '__name__', '')  # works on py3.5+
        warn("This function {} is deprecated. Use a method on Broker instead."
             "".format(name))
        return f(*args, **kwargs)
    return inner

try:
    config = lookup_config(SPECIAL_NAME)
except FileNotFoundError:
    # No config was provided for back-compatibility so there we be no
    # pre-built Broker instance.
    pass
else:
    # Don't allow any errors generated by loading this instance to escape and
    # make databroker un-importable.
    try:
        DataBroker = Broker.from_config(config)
    except Exception as exc:
        warn("There was a error loading {!r}: {!r}".format(SPECIAL_NAME, exc))
    else:
        get_events = deprecate(DataBroker.get_events)
        get_table = deprecate(DataBroker.get_table)
        get_images = deprecate(DataBroker.get_images)
        restream = deprecate(DataBroker.restream)
        stream = deprecate(DataBroker.stream)
        process = deprecate(DataBroker.process)
        fill_event = deprecate(DataBroker.fill_event)


text: __all__ = ["icalendar", "BeautifulSoup"]


text:
body{
  font-family: Verdana;
  font-size: 11px;
  padding:0;
  margin:0;
  background:#FFF;
  height:100%;
  width:100%;
}
a{text-decoration:none;color:#DD7700;}
ul{
  list-style:none;
  margin:0;
  padding:0;
}
#wraper{
  width:100%;
  height:100%;
}
#wraper,#dlgNewDir,#dlgFileProp,#dlgAddFile,#menuDir,
#menuFile,#pnlRenameFile,#pnlLoadingDirs,
#pnlDirName,#pnlLoading,#pnlEmptyDir,
#pnlSearchNoFiles,#pnlFileProp, #pnlDirList ul{
  display:none;
}
.contextMenu a:hover,
#pnlFileList .selected,#pnlFileList .selected:hover,
#menuFile a:hover{
  background-color: #000099 !important;
  color:#FFF;
}
#pnlDirList .selected,#pnlDirList div.selected:hover{background-color: #DFD !important;}
.dialog input{width:97%;}
.filesize{font-weight:bold;margin-top:4px;display:inline-block;}
.pnlDragFile,.pnlDragDir{
  background:#FFF;
  opacity:0.8;
  float:left;
  width:auto !important;
}
#pnlStatus{
  padding:5px;
}
.scrollPane{
  height:400px;
  overflow: auto;
}
.bottomLine{background:#DDD;border-top:1px solid #CCC;}
.pale{opacity:0.5;}
/* Search and order fields */
#txtSearch,#ddlOrder{
  border:1px solid #CCC;
  border-radius:3px;
}
#txtSearch{
  padding:0 22px 0 3px;
  background:url(../images/sprite.png) no-repeat 87px -314px;
  width:80px;
  height:20px;
}
input[type=text]::-ms-clear { display: none; }
/* END OF Search and order fields */

/* Directory tree */
.pnlDirs{
  width:260px;
  overflow:auto;
  border-right:1px solid #DDD;
}
#pnlDirList{margin-left:4px;}
#pnlDirList ul{padding:0 0 0 20px;}
#pnlDirList .dir{
  line-height:30px;
  float:left;
  margin-right:5px;
}
#pnlDirList .dirPlus{
  float:left;
  margin: 3px 3px 0 0;
}
#pnlDirList li,#pnlDirList div{
  float:left;
  clear:both;
  width:98%;
}
#pnlDirList div{padding:3px;cursor:pointer;}
#pnlLoadingDirs{margin-left:5px;}
/* END OF Directory tree */

/* File list */
.pnlFiles{padding-left:4px;}
#pnlFileList .icon{float:left;margin-right:3px;}
#pnlFileList li{float:left;padding:3px;clear:both;width:98%;cursor:pointer;}
#pnlFileList li:hover,#pnlDirList li div:hover{background:#FFFFCC !important;}
#pnlFileList .size{float:right;margin-left:20px;}
#pnlFileList .time{float:right;margin-left:15px;width:130px;}
.imgPreview{max-width:300px;}
/* END OF File list */

/* Context menus */
.contextMenu{
  position:absolute;
  background-color:#DDD;
  border:1px solid #BBB;
  min-width:100px;
  font-weight: bold;
  z-index:1000 !important;
}
.contextMenu a{
  background-repeat:no-repeat;
  background-position: 4px 6px;
  padding: 5px 25px 5px 20px;
  display:block;
  color:#000;
  text-decoration:none;
}
hr{margin:0;color:#AAA;}
/* END OF Context menus */

/* Buttons */
.actions{padding:3px 0 10px 5px;}
.actions input{
  background-repeat:no-repeat;
  background-position: 3px center;
  padding:0 3px 0 18px;
  height:22px;
  font-size: 11px;
  border:1px solid #CCC;
  background-color: #EEE;
  border-radius:3px;
  margin-bottom: 3px;
}
.actions input[type=button]:hover,.actions input.selected{background-color: #DFD;cursor:pointer;}
#btnAddDir{background-image:url(../images/sprite.png);background-position: 4px -213px;}
#mnuCreateDir{background-image:url(../images/sprite.png);background-position: 4px -210px;}
#mnuDownloadDir{background-image:url(../images/sprite.png);background-position: 4px 7px;}
#btnDeleteDir{background-image:url(../images/sprite.png);background-position: 4px -237px;}
#mnuDeleteDir{background-image:url(../images/sprite.png);background-position: 4px -235px;}
#btnAddFile{background-image:url(../images/sprite.png);background-position: 4px -81px;}
#btnDeleteFile{background-image:url(../images/sprite.png);background-position: 4px -104px;}
#mnuDeleteFile{background-image:url(../images/sprite.png);background-position: 4px -102px;}
#btnDeleteFile{margin-right:15px;}
#btnDownloadFile{background-image:url(../images/sprite.png);background-position: 4px -128px;}
#mnuDownload{background-image:url(../images/sprite.png);background-position: 4px -126px;}
#btnPreviewFile{background-image:url(../images/sprite.png);background-position: 4px -285px;}
#mnuPreview{background-image:url(../images/sprite.png);background-position: 4px -283px;}
#btnSelectFile{background-image:url(../images/sprite.png);background-position: 4px -399px;}
#mnuSelectFile{background-image:url(../images/sprite.png);background-position: 4px -397px;}
#btnThumbView{background-image:url(../images/sprite.png);background-position: center -447px;}
#btnListView{background-image:url(../images/sprite.png);background-position: center -483px;}
#btnRenameFile,#btnRenameDir{background-image:url(../images/sprite.png);background-position: 4px 4px;}
#mnuRenameDir,#mnuRenameFile{background-image:url(../images/sprite.png);background-position: 4px 7px;}
#mnuDirCut,#mnuFileCut{background-image:url(../images/sprite.png);background-position: 4px -47px;}
#mnuDirCopy,#mnuFileCopy{background-image:url(../images/sprite.png);background-position: 4px -20px;}
#mnuDirPaste,#mnuFilePaste{background-image:url(../images/sprite.png);background-position: 4px -370px;}

/* END OF Buttons */
/* File list views */
ul#pnlFileList.thumbView li{
  /*
  width:140px;
  height: 140px;
  */
  float:left !important;
  clear:none;
  margin:0 6px 6px 0;
  overflow:hidden;
  padding:10px;
  text-align:center;
  vertical-align:middle;
  border: 1px solid #EEE;
  border-radius: 5px;
  position:relative;
  background:#EEE;
}
ul#pnlFileList.thumbView .name,ul#pnlFileList.thumbView .time{display:none;}
ul#pnlFileList.thumbView .icon{
  clear:both;
  float:none;
  margin:0 !important;
  text-align:center;
  vertical-align:middle;
  background-position:center center;
  background-repeat:no-repeat;
  /*
  width:140px;
  height:120px;
  */
}
ul#pnlFileList.thumbView .size{
  display:block !important;
  width:95% !important;
  position:absolute;
  bottom:5px;
  margin:0;
}
/* END OF File list views */
#fileUploads{width:100%;}
.uploadFilesList{
  width:100%;
  height:300px;
  overflow:auto;
}
#uploadResult{

}
div.ui-tooltip {
    max-width: 90%;
}
/* Upload dialog */
.uploadFilesList{
  font-size: 11px;
}
.fileUpload{
  margin: 8px 0 0 0;
  position: relative;
  border:1px solid #EEE;
}
.fileUpload .error{font-weight:bold;}
.fileName{
  z-index:2;
  line-height: 20px;
  height:20px;
  overflow: hidden;
  padding:0 13px 0 5px;
}
.progressPercent{z-index:2;}
.stripes{
  background: url('../images/stripes.gif') repeat-x;
  -moz-opacity: 0.40;
  -khtml-opacity: 0.40;
  opacity: 0.40;
  -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40);
  filter: progid:DXImageTransform.Microsoft.Alpha(opacity=40);
  filter: alpha(opacity=40);
  width:100%;
  height:100%;
  z-index:-1;
  position: relative;
}
.uploadProgress{
  position: absolute;
  width:0;
  height:100%;
  top:0;
  left:0;
  z-index:-1;
  background: #d3edff;
  background: -moz-linear-gradient(top,  #d3edff 0%, #cbebff 47%, #a1dbff 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#d3edff), color-stop(47%,#cbebff), color-stop(100%,#a1dbff));
  background: -webkit-linear-gradient(top,  #d3edff 0%,#cbebff 47%,#a1dbff 100%);
  background: -o-linear-gradient(top,  #d3edff 0%,#cbebff 47%,#a1dbff 100%);
  background: -ms-linear-gradient(top,  #d3edff 0%,#cbebff 47%,#a1dbff 100%);
  background: linear-gradient(to bottom,  #d3edff 0%,#cbebff 47%,#a1dbff 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d3edff', endColorstr='#a1dbff',GradientType=0 );
}
.uploadError{
  background: #ff8787;
  background: -moz-linear-gradient(top,  #ff8787 0%, #ffa3a3 45%, #ff5e5e 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ff8787), color-stop(45%,#ffa3a3), color-stop(100%,#ff5e5e));
  background: -webkit-linear-gradient(top,  #ff8787 0%,#ffa3a3 45%,#ff5e5e 100%);
  background: -o-linear-gradient(top,  #ff8787 0%,#ffa3a3 45%,#ff5e5e 100%);
  background: -ms-linear-gradient(top,  #ff8787 0%,#ffa3a3 45%,#ff5e5e 100%);
  background: linear-gradient(to bottom,  #ff8787 0%,#ffa3a3 45%,#ff5e5e 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ff8787', endColorstr='#ff5e5e',GradientType=0 );
}
.uploadComplete{
  background: #dbff87;
  background: -moz-linear-gradient(top,  #dbff87 0%, #e0f49c 45%, #bddd49 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#dbff87), color-stop(45%,#e0f49c), color-stop(100%,#bddd49));
  background: -webkit-linear-gradient(top,  #dbff87 0%,#e0f49c 45%,#bddd49 100%);
  background: -o-linear-gradient(top,  #dbff87 0%,#e0f49c 45%,#bddd49 100%);
  background: -ms-linear-gradient(top,  #dbff87 0%,#e0f49c 45%,#bddd49 100%);
  background: linear-gradient(to bottom,  #dbff87 0%,#e0f49c 45%,#bddd49 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#dbff87', endColorstr='#bddd49',GradientType=0 );
}
.uploadError .stripes,.uploadComplete .stripes{display:none;}
.removeUpload{
  background:url(../images/sprite.png) no-repeat 6px -421px;
  position:absolute;
  right:0;
  top:0;
  height: 100%;
  width:20px;
  cursor:pointer;
}
/* END OF Upload dialog */