text:
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import {DetailedError} from "src/base/DetailedError.js"
import {ShaderPart, SingleTypeCoder, ShaderCoder, BOOL_TYPE_CODER} from "src/webgl/ShaderCoders_Base.js"
import {WglArg} from "src/webgl/WglArg.js"

/**
 * @param {!int} vecSize
 * @param {!string} name
 * @returns {!ShaderPart}
 */
function makeFloatCoderInput(vecSize, name) {
    let type = ['float', 'vec2', 'vec3', 'vec4'][vecSize - 1];
    let pre = `_gen_${name}`;
    return new ShaderPart(`
        ///////////// makeFloatCoderInput(${vecSize}, ${name}) ////////////
        uniform sampler2D ${pre}_tex;
        uniform vec2 ${pre}_size;

        ${type} read_${name}(float k) {
            vec2 uv = vec2(mod(k, ${pre}_size.x) + 0.5,
                           floor(k / ${pre}_size.x) + 0.5) / ${pre}_size;
            return texture2D(${pre}_tex, uv).${'xyzw'.substring(0, vecSize)};
        }

        float len_${name}() {
            return ${pre}_size.x * ${pre}_size.y;
        }`,
        [],
        texture => {
            if (texture.pixelType !== WebGLRenderingContext.FLOAT) {
                throw new DetailedError(`vecInput${vecSize}_Float requires float texture`, {name, texture});
            }
            return [
                WglArg.texture(`${pre}_tex`, texture),
                WglArg.vec2(`${pre}_size`, texture.width, texture.height)
            ];
        });
}

/**
 * @param {!int} vecSize
 * @returns {!ShaderPart}
 */
function makeFloatCoderOutput(vecSize) {
    let type = ['float', 'vec2', 'vec3', 'vec4'][vecSize - 1];
    let vIntoVec4 = [
        'vec4(v, 0.0, 0.0, 0.0)',
        'vec4(v.x, v.y, 0.0, 0.0)',
        'vec4(v.x, v.y, v.z, 0.0)',
        'v'
    ][vecSize - 1];
    return new ShaderPart(`
        ///////////// makeFloatCoderOutput${vecSize} ////////////
        ${type} outputFor(float k);

        uniform vec2 _gen_output_size;
        uniform float _gen_secret_half;

        float len_output() {
            return _gen_output_size.x * _gen_output_size.y;
        }

        void main() {
            vec2 xy = gl_FragCoord.xy - vec2(_gen_secret_half, _gen_secret_half);
            float k = xy.y * _gen_output_size.x + xy.x;

            ${type} v = outputFor(k);

            gl_FragColor = ${vIntoVec4};
        }`,
        [],
        texture => [
            WglArg.vec2('_gen_output_size', texture.width, texture.height),
            WglArg.float('_gen_secret_half', 0.5)
        ]);
}

/**
 * @param {!Float32Array} vec1Data
 * @returns {!Float32Array}
 */
function spreadFloatVec1(vec1Data) {
    let result = new Float32Array(vec1Data.length << 2);
    for (let i = 0; i < vec1Data.length; i++) {
        result[4*i] = vec1Data[i];
    }
    return result;
}

/**
 * @param {!Float32Array} vec2Data
 * @returns {!Float32Array}
 */
function spreadFloatVec2(vec2Data) {
    let result = new Float32Array(vec2Data.length << 1);
    for (let i = 0; i*2 < vec2Data.length; i++) {
        result[4*i] = vec2Data[2*i];
        result[4*i+1] = vec2Data[2*i+1];
    }
    return result;
}

/**
 * @param {!Float32Array} pixelData
 * @returns {!Float32Array}
 */
function unspreadFloatVec1(pixelData) {
    let result = new Float32Array(pixelData.length >> 2);
    for (let i = 0; i < result.length; i++) {
        result[i] = pixelData[4*i];
    }
    return result;
}

/**
 * @param {!Float32Array} pixelData
 * @returns {!Float32Array}
 */
function unspreadFloatVec2(pixelData) {
    let result = new Float32Array(pixelData.length >> 1);
    for (let i = 0; i*2 < result.length; i++) {
        result[2*i] = pixelData[4*i];
        result[2*i+1] = pixelData[4*i+1];
    }
    return result;
}

const FLOAT_TYPE_CODER = new SingleTypeCoder(
    name => makeFloatCoderInput(1, name),
    makeFloatCoderOutput(1),
    0,
    WebGLRenderingContext.FLOAT,
    spreadFloatVec1,
    unspreadFloatVec1,
    true);

const VEC2_TYPE_CODER = new SingleTypeCoder(
    name => makeFloatCoderInput(2, name),
    makeFloatCoderOutput(2),
    0,
    WebGLRenderingContext.FLOAT,
    spreadFloatVec2,
    unspreadFloatVec2,
    true);

const VEC4_TYPE_CODER = new SingleTypeCoder(
    name => makeFloatCoderInput(4, name),
    makeFloatCoderOutput(4),
    0,
    WebGLRenderingContext.FLOAT,
    e => e,
    e => e,
    false);

/** @type {!ShaderCoder} */
const SHADER_CODER_FLOATS = new ShaderCoder(
    BOOL_TYPE_CODER,
    FLOAT_TYPE_CODER,
    VEC2_TYPE_CODER,
    VEC4_TYPE_CODER);

export {SHADER_CODER_FLOATS}


text:
""""Argo Workflow for building notebook-server-codeserver's OCI image using Kaniko"""
from kubeflow.kubeflow.cd import config, kaniko_builder

def create_workflow(name=None, namespace=None, bucket=None, **kwargs):
    """
    Args:
        name: Name to give to the workflow. This can also be used to name
              things associated with the workflow.
    """
    builder = kaniko_builder.Builder(name=name, namespace=namespace, bucket=bucket, **kwargs)

    return builder.build(dockerfile="components/example-notebook-servers/codeserver/Dockerfile",
                         context="components/example-notebook-servers/codeserver/",
                         destination=config.NOTEBOOK_SERVER_CODESERVER)

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>The source code</title>
  <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />

/**
 * @class Ext.state.LocalStorageProvider
 * @extends Ext.state.Provider
 * A Provider implementation which saves and retrieves state via the HTML5 localStorage object.
 * If the browser does not support local storage, an exception will be thrown upon instantiating
 * this class.
 */

Ext.define('Ext.state.LocalStorageProvider', {
    /* Begin Definitions */

    extend: 'Ext.state.Provider',

    alias: 'state.localstorage',

    /* End Definitions */

    constructor: function(){
        var me = this;
        me.callParent(arguments);
        me.store = me.getStorageObject();
        me.state = me.readLocalStorage();
    },

    readLocalStorage: function(){
        var store = this.store,
            i = 0,
            len = store.length,
            prefix = this.prefix,
            prefixLen = prefix.length,
            data = {},
            key;

        for (; i < len; ++i) {
            key = store.key(i);
            if (key.substring(0, prefixLen) == prefix) {
                data[key.substr(prefixLen)] = this.decodeValue(store.getItem(key));
            }
        }
        return data;
    },

    set : function(name, value){
        var me = this;

        me.clear(name);
        if (typeof value == "undefined" || value === null) {
            return;
        }
        me.store.setItem(me.prefix + name, me.encodeValue(value));
        me.callParent(arguments);
    },

    // private
    clear : function(name){
        this.store.removeItem(this.prefix + name);
        this.callParent(arguments);
    },

    getStorageObject: function(){
        try {
            var supports = 'localStorage' in window && window['localStorage'] !== null;
            if (supports) {
                return window.localStorage;
            }
        } catch (e) {
            return false;
        }
        //<debug>
        Ext.Error.raise('LocalStorage is not supported by the current browser');
        //</debug>
    }
});


text:
package org.jvyamlb;

import java.io.FileInputStream;
import java.io.InputStream;

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

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.jvyamlb.exceptions.ConstructorException;
import org.jvyamlb.exceptions.YAMLException;

import org.jvyamlb.nodes.Node;

import org.jvyamlb.util.Base64Coder;

import org.jruby.util.ByteList;

import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;

/**
 * @author Ola Bini
 */
public class SafeConstructorImpl extends BaseConstructorImpl {
    private final static Map yamlConstructors = new HashMap();
    private final static Map yamlMultiConstructors = new HashMap();
    private final static Map yamlMultiRegexps = new HashMap();
    public YamlConstructor getYamlConstructor(final Object key) {
        YamlConstructor mine = (YamlConstructor)yamlConstructors.get(key);
        if(mine == null) {
            mine = super.getYamlConstructor(key);
        }
        return mine;
    }

    public YamlMultiConstructor getYamlMultiConstructor(final Object key) {
        YamlMultiConstructor mine = (YamlMultiConstructor)yamlMultiConstructors.get(key);
        if(mine == null) {
            mine = super.getYamlMultiConstructor(key);
        }
        return mine;
    }

    public Pattern getYamlMultiRegexp(final Object key) {
        Pattern mine = (Pattern)yamlMultiRegexps.get(key);
        if(mine == null) {
            mine = super.getYamlMultiRegexp(key);
        }
        return mine;
    }

    public Set getYamlMultiRegexps() {
        final Set all = new HashSet(super.getYamlMultiRegexps());
        all.addAll(yamlMultiRegexps.keySet());
        return all;
    }

    public static void addConstructor(final String tag, final YamlConstructor ctor) {
        yamlConstructors.put(tag,ctor);
    }

    public static void addMultiConstructor(final String tagPrefix, final YamlMultiConstructor ctor) {
        yamlMultiConstructors.put(tagPrefix,ctor);
        yamlMultiRegexps.put(tagPrefix,Pattern.compile("^"+tagPrefix));
    }

    public SafeConstructorImpl(final Composer composer) {
        super(composer);
    }

    private static ByteList into(String v) {
        return new ByteList(v.getBytes(),false);
    }

    private final static Map BOOL_VALUES = new HashMap();
    static {
        BOOL_VALUES.put(into("yes"),Boolean.TRUE);
        BOOL_VALUES.put(into("Yes"),Boolean.TRUE);
        BOOL_VALUES.put(into("YES"),Boolean.TRUE);
        BOOL_VALUES.put(into("no"),Boolean.FALSE);
        BOOL_VALUES.put(into("No"),Boolean.FALSE);
        BOOL_VALUES.put(into("NO"),Boolean.FALSE);
        BOOL_VALUES.put(into("true"),Boolean.TRUE);
        BOOL_VALUES.put(into("True"),Boolean.TRUE);
        BOOL_VALUES.put(into("TRUE"),Boolean.TRUE);
        BOOL_VALUES.put(into("false"),Boolean.FALSE);
        BOOL_VALUES.put(into("False"),Boolean.FALSE);
        BOOL_VALUES.put(into("FALSE"),Boolean.FALSE);
        BOOL_VALUES.put(into("on"),Boolean.TRUE);
        BOOL_VALUES.put(into("On"),Boolean.TRUE);
        BOOL_VALUES.put(into("ON"),Boolean.TRUE);
        BOOL_VALUES.put(into("off"),Boolean.FALSE);
        BOOL_VALUES.put(into("Off"),Boolean.FALSE);
        BOOL_VALUES.put(into("OFF"),Boolean.FALSE);
    }

    public static Object constructYamlNull(final Constructor ctor, final Node node) {
        return null;
    }

    public static Object constructYamlBool(final Constructor ctor, final Node node) {
        final Object val = ctor.constructScalar(node);
        return BOOL_VALUES.get(val);
    }

    public static Object constructYamlOmap(final Constructor ctor, final Node node) {
        return ctor.constructPairs(node);
    }

    public static Object constructYamlPairs(final Constructor ctor, final Node node) {
        return constructYamlOmap(ctor,node);
    }

    public static Object constructYamlSet(final Constructor ctor, final Node node) {
        return ((Map)ctor.constructMapping(node)).keySet();
    }

    public static Object constructYamlStr(final Constructor ctor, final Node node) {
        final ByteList value = (ByteList)ctor.constructScalar(node);
        return value.length() == 0 ? (ByteList)null : value;
    }

    public static Object constructYamlSeq(final Constructor ctor, final Node node) {
        return ctor.constructSequence(node);
    }

    public static Object constructYamlMap(final Constructor ctor, final Node node) {
        return ctor.constructMapping(node);
    }

    public static Object constructUndefined(final Constructor ctor, final Node node) {
        throw new ConstructorException(null,"could not determine a constructor for the tag " + node.getTag(),null);
    }

    private final static Pattern TIMESTAMP_REGEXP = Pattern.compile("^(-?[0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:(?:[Tt]|[ \t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \t]*(Z|([-+][0-9][0-9]?)(?::([0-9][0-9])?)?)))?$");
    public final static Pattern YMD_REGEXP = Pattern.compile("^(-?[0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)$");
    public static Object constructYamlTimestamp(final Constructor ctor, final Node node) {
        Matcher match = YMD_REGEXP.matcher(node.getValue().toString());
        if(match.matches()) {
            final String year_s = match.group(1);
            final String month_s = match.group(2);
            final String day_s = match.group(3);
            DateTime dt = new DateTime(0,1,1,0,0,0,0);
            if(year_s != null) {
                dt = dt.withYear(Integer.parseInt(year_s));
            }
            if(month_s != null) {
                dt = dt.withMonthOfYear(Integer.parseInt(month_s));
            }
            if(day_s != null) {
                dt = dt.withDayOfMonth(Integer.parseInt(day_s));
            }
            return new Object[]{dt};
        }
        match = TIMESTAMP_REGEXP.matcher(node.getValue().toString());
        if(!match.matches()) {
            return new Object[]{ctor.constructPrivateType(node)};
        }
        final String year_s = match.group(1);
        final String month_s = match.group(2);
        final String day_s = match.group(3);
        final String hour_s = match.group(4);
        final String min_s = match.group(5);
        final String sec_s = match.group(6);
        final String fract_s = match.group(7);
        final String utc = match.group(8);
        final String timezoneh_s = match.group(9);
        final String timezonem_s = match.group(10);

        int usec = 0;
        if(fract_s != null) {
            usec = Integer.parseInt(fract_s);
            if(usec != 0) {
                while(10*usec < 1000) {
                    usec *= 10;
                }
            }
        }
        DateTime dt = new DateTime(0,1,1,0,0,0,0);
        if("Z".equalsIgnoreCase(utc)) {
            dt = dt.withZone(DateTimeZone.forID("Etc/GMT"));
        } else {
            if(timezoneh_s != null || timezonem_s != null) {
                int zone = 0;
                int sign = +1;
                if(timezoneh_s != null) {
                    if(timezoneh_s.startsWith("-")) {
                        sign = -1;
                    }
                    zone += Integer.parseInt(timezoneh_s.substring(1))*3600000;
                }
                if(timezonem_s != null) {
                    zone += Integer.parseInt(timezonem_s)*60000;
                }
                dt = dt.withZone(DateTimeZone.forOffsetMillis(sign*zone));
            }
        }
        if(year_s != null) {
            dt = dt.withYear(Integer.parseInt(year_s));
        }
        if(month_s != null) {
            dt = dt.withMonthOfYear(Integer.parseInt(month_s));
        }
        if(day_s != null) {
            dt = dt.withDayOfMonth(Integer.parseInt(day_s));
        }
        if(hour_s != null) {
            dt = dt.withHourOfDay(Integer.parseInt(hour_s));
        }
        if(min_s != null) {
            dt = dt.withMinuteOfHour(Integer.parseInt(min_s));
        }
        if(sec_s != null) {
            dt = dt.withSecondOfMinute(Integer.parseInt(sec_s));
        }
        dt = dt.withMillisOfSecond(usec/1000);

        return new Object[]{dt, new Integer(usec%1000)};
    }

    public static Object constructYamlInt(final Constructor ctor, final Node node) {
        String value = ctor.constructScalar(node).toString().replaceAll("_","").replaceAll(",","");;
        int sign = +1;
        char first = value.charAt(0);
        if(first == '-') {
            sign = -1;
            value = value.substring(1);
        } else if(first == '+') {
            value = value.substring(1);
        }
        int base = 10;
        if(value.equals("0")) {
            return new Long(0);
        } else if(value.startsWith("0b")) {
            value = value.substring(2);
            base = 2;
        } else if(value.startsWith("0x")) {
            value = value.substring(2);
            base = 16;
        } else if(value.startsWith("0")) {
            value = value.substring(1);
            base = 8;
        } else if(value.indexOf(':') != -1) {
            final String[] digits = value.split(":");
            int bes = 1;
            int val = 0;
            for(int i=0,j=digits.length;i<j;i++) {
                val += (Long.parseLong(digits[(j-i)-1])*bes);
                bes *= 60;
            }
            return new Integer(sign*val);
        } else {
            try {
                return new Long(sign * Long.parseLong(value));
            } catch(Exception e) {
                if(sign < 0) {
                    return new java.math.BigInteger(value).negate();
                } else {
                    return new java.math.BigInteger(value);
                }
            }
        }
        try {
            return new Long(sign * Long.parseLong(value,base));
        } catch(Exception e) {
            if(sign < 0) {
                return new java.math.BigInteger(value,base).negate();
            } else {
                return new java.math.BigInteger(value,base);
            }
        }
    }

    private final static Double INF_VALUE_POS = new Double(Double.POSITIVE_INFINITY);
    private final static Double INF_VALUE_NEG = new Double(Double.NEGATIVE_INFINITY);
    private final static Double NAN_VALUE = new Double(Double.NaN);

    public static Object constructYamlFloat(final Constructor ctor, final Node node) {
        String value = ctor.constructScalar(node).toString().replaceAll("_","").replaceAll(",","");
        int sign = +1;
        char first = value.charAt(0);
        if(first == '-') {
            sign = -1;
            value = value.substring(1);
        } else if(first == '+') {
            value = value.substring(1);
        }
        final String valLower = value.toLowerCase();
        if(valLower.equals(".inf")) {
            return sign == -1 ? INF_VALUE_NEG : INF_VALUE_POS;
        } else if(valLower.equals(".nan")) {
            return NAN_VALUE;
        } else if(value.indexOf(':') != -1) {
            final String[] digits = value.split(":");
            int bes = 1;
            double val = 0.0;
            for(int i=0,j=digits.length;i<j;i++) {
                val += (Double.parseDouble(digits[(j-i)-1])*bes);
                bes *= 60;
            }
            return new Double(sign*val);
        } else {
            return new Double(sign*Double.parseDouble(value));
        }
    }

    public static Object constructYamlBinary(final Constructor ctor, final Node node) {
        final String[] values = ctor.constructScalar(node).toString().split("\n|(?:\r[^\n])|\\s");
        final StringBuffer vals = new StringBuffer();
        for(int i=0,j=values.length;i<j;i++) {
            vals.append(values[i].trim());
        }
        return Base64Coder.decode(ByteList.plain(vals));
    }

    public static Object constructSpecializedSequence(final Constructor ctor, final String pref, final Node node) {
        List outp = null;
        try {
            final Class seqClass = Class.forName(pref);
            outp = (List)seqClass.newInstance();
        } catch(final Exception e) {
            throw new YAMLException("Can't construct a sequence from class " + pref + ": " + e.toString());
        }
        outp.addAll((List)ctor.constructSequence(node));
        return outp;
    }

    public static Object constructSpecializedMap(final Constructor ctor, final String pref, final Node node) {
        Map outp = null;
        try {
            final Class mapClass = Class.forName(pref);
            outp = (Map)mapClass.newInstance();
        } catch(final Exception e) {
            throw new YAMLException("Can't construct a mapping from class " + pref + ": " + e.toString());
        }
        outp.putAll((Map)ctor.constructMapping(node));
        return outp;
    }

    private static Object fixValue(final Object inp, final Class outp) {
        if(inp == null) {
            return null;
        }
        final Class inClass = inp.getClass();
        if(outp.isAssignableFrom(inClass)) {
            return inp;
        }
        if(inClass == Long.class && (outp == Integer.class || outp == Integer.TYPE)) {
            return new Integer(((Long)inp).intValue());
        }
        if(inClass == Long.class && (outp == Short.class || outp == Short.TYPE)) {
            return new Short((short)((Long)inp).intValue());
        }
        if(inClass == Long.class && (outp == Character.class || outp == Character.TYPE)) {
            return new Character((char)((Long)inp).intValue());
        }
        if(inClass == Double.class && (outp == Float.class || outp == Float.TYPE)) {
            return new Float(((Double)inp).floatValue());
        }
        return inp;
    }

    public static Object constructJava(final Constructor ctor, final String pref, final Node node) {
        Object outp = null;
        try {
            final Class cl = Class.forName(pref);
            outp = cl.newInstance();
            final Map values = (Map)ctor.constructMapping(node);
            java.lang.reflect.Method[] ems = cl.getMethods();
            for(final Iterator iter = values.keySet().iterator();iter.hasNext();) {
                final Object key = iter.next();
                final Object value = values.get(key);
                final String keyName = key.toString();
                final String mName = "set" + Character.toUpperCase(keyName.charAt(0)) + keyName.substring(1);
                for(int i=0,j=ems.length;i<j;i++) {
                    if(ems[i].getName().equals(mName) && ems[i].getParameterTypes().length == 1) {
                        ems[i].invoke(outp, new Object[]{fixValue(value, ems[i].getParameterTypes()[0])});
                        break;
                    }
                }
            }
        } catch(final Exception e) {
            throw new YAMLException("Can't construct a java object from class " + pref + ": " + e.toString());
        }
        return outp;
    }

    static {
        BaseConstructorImpl.addConstructor("tag:yaml.org,2002:null",new YamlConstructor() {
                public Object call(final Constructor self, final Node node) {
                    return constructYamlNull(self,node);
                }
            });
        addConstructor("tag:yaml.org,2002:bool",new YamlConstructor() {
                public Object call(final Constructor self, final Node node) {
                    return constructYamlBool(self,node);
                }
            });
        addConstructor("tag:yaml.org,2002:omap",new YamlConstructor() {
                public Object call(final Constructor self, final Node node) {
                    return constructYamlOmap(self,node);
                }
            });
        addConstructor("tag:yaml.org,2002:pairs",new YamlConstructor() {
                public Object call(final Constructor self, final Node node) {
                    return constructYamlPairs(self,node);
                }
            });
        addConstructor("tag:yaml.org,2002:set",new YamlConstructor() {
                public Object call(final Constructor self, final Node node) {
                    return constructYamlSet(self,node);
                }
            });
        addConstructor("tag:yaml.org,2002:int",new YamlConstructor() {
                public Object call(final Constructor self, final Node node) {
                    return constructYamlInt(self,node);
                }
            });
        addConstructor("tag:yaml.org,2002:float",new YamlConstructor() {
                public Object call(final Constructor self, final Node node) {
                    return constructYamlFloat(self,node);
                }
            });
        addConstructor("tag:yaml.org,2002:timestamp",new YamlConstructor() {
                public Object call(final Constructor self, final Node node) {
                    return ((Object[])constructYamlTimestamp(self,node))[0];
                }
            });
        addConstructor("tag:yaml.org,2002:timestamp#ymd",new YamlConstructor() {
                public Object call(final Constructor self, final Node node) {
                    return ((Object[])constructYamlTimestamp(self,node))[0];
                }
            });
        addConstructor("tag:yaml.org,2002:str",new YamlConstructor() {
                public Object call(final Constructor self, final Node node) {
                    return constructYamlStr(self,node);
                }
            });
        addConstructor("tag:yaml.org,2002:binary",new YamlConstructor() {
                public Object call(final Constructor self, final Node node) {
                    return constructYamlBinary(self,node);
                }
            });
        addConstructor("tag:yaml.org,2002:seq",new YamlConstructor() {
                public Object call(final Constructor self, final Node node) {
                    return constructYamlSeq(self,node);
                }
            });
        addConstructor("tag:yaml.org,2002:map",new YamlConstructor() {
                public Object call(final Constructor self, final Node node) {
                    return constructYamlMap(self,node);
                }
            });
        addConstructor(null,new YamlConstructor() {
                public Object call(final Constructor self, final Node node) {
                    return self.constructPrivateType(node);
                }
            });

        addMultiConstructor("tag:yaml.org,2002:seq:",new YamlMultiConstructor() {
                public Object call(final Constructor self, final String pref, final Node node) {
                    return constructSpecializedSequence(self,pref,node);
                }
            });
        addMultiConstructor("tag:yaml.org,2002:map:",new YamlMultiConstructor() {
                public Object call(final Constructor self, final String pref, final Node node) {
                    return constructSpecializedMap(self,pref,node);
                }
            });
        addMultiConstructor("!java/object:",new YamlMultiConstructor() {
                public Object call(final Constructor self, final String pref, final Node node) {
                    return constructJava(self,pref,node);
                }
            });
        addMultiConstructor("tag:java.yaml.org,2002:object:",new YamlMultiConstructor() {
                public Object call(final Constructor self, final String pref, final Node node) {
                    return constructJava(self,pref,node);
                }
            });
    }

    public static void main(final String[] args) throws Exception {
        final String filename = args[0];
        System.out.println("Reading of file: \"" + filename + "\"");

        final ByteList input = new ByteList(1024);
        final InputStream reader = new FileInputStream(filename);
        byte[] buff = new byte[1024];
        int read = 0;
        while(true) {
            read = reader.read(buff);
            input.append(buff,0,read);
            if(read < 1024) {
                break;
            }
        }
        reader.close();
        final long before = System.currentTimeMillis();
        for(int i=0;i<1;i++) {
            final Constructor ctor = new SafeConstructorImpl(new ComposerImpl(new ParserImpl(new ScannerImpl(input)),new ResolverImpl()));
            for(final Iterator iter = ctor.eachDocument();iter.hasNext();) {
                iter.next();
                //System.out.println(iter.next());
            }
        }
        final long after = System.currentTimeMillis();
        final long time = after-before;
        final double timeS = (after-before)/1000.0;
        System.out.println("Walking through the nodes for the file: " + filename + " took " + time + "ms, or " + timeS + " seconds");
    }
}// SafeConstructorImpl


text:
layout: splash
title: "Emory Wind Ensemble Repertoire, 2021-2022"
date:   2022-06-01
categories: conducting repertoire
classes: wide
header:
  image: /assets/images/ewegroup.jpg
  caption: 'A post concert photo after our April 14 concert.   Brent Allman'
feature_row:
  - image_path: /assets/images/ewefa21a.jpg
    excerpt: 'This program explored tradition and unorthodoxy in American music for the wind band. The "two" comes from the fact that this repertoire was originally rehearsed for our concert in April 2020. A year and a half later, we were able to reprise the same music and share it with an in-person audience.

    ROBERT JAGER: Esprit de Corps

    RON NELSON: Resonances I

    DAVID MASLANKA: California

    FRANK TICHELI: Blue Shades

    OMAR THOMAS: A Mother of a Revolution!'
feature_row2:
  - image_path: /assets/images/febconcert.gif
    excerpt: 'This shared concert with the Emory University Symphony Orchestra featured a *reflection* of quintessential works. The exception was Carlos Simon's new composition for wind ensemble.

    CHARLES GOUNOD: Petite Symphonie

    SAMUEL BARBER: Commando March

    CARLOS SIMON: reflections

    JOHN ZDECHLIK: Chorale and Shaker Dance'
feature_row3:
  - image_path: /assets/images/ewesp22a.png
    excerpt: 'Due to high COVID-19 case numbers, we pivoted back to two chamber ensembles for this concert cycle: a brass choir and a chamber winds group of Stravinsky octet instrumentation.

     IGOR STRAVINSKY: *Finale* from Octet for Wind Instruments

     OLIVER CAPLAN: Krummholz Variations

     GIOVANNI GABRIELI: Sonata pian' e forte

     ANTHONY PLOG: Music for Brass Octet'
feature_row4:
 - image_path: /assets/images/ewesp22b.png
   excerpt: 'Our last concert of the season centered on unique musical textures. Additionally, it included two premieres by Emory University students.

   JOANNE HARRIS: Dawn Chorus

   SOLOMON KIM: Octet (Premiere)

   IGOR STRAVINSKY: *Sinfonia* and *Finale* from Octet for Wind Instruments

   AARON PERRINE: In the Open Air, In the Silent Lines

   ELI PARRISH: Feathers of Burgundy and Gold (Premiere) -- Gary Paulo, Saxophone

   DWAYNE MILBURN: Meditation

   FRANK TICHELI: Nitro'
---
## Emory Wind Ensemble Repertoire, 2021-2022

While I'm excited to move to Austin this summer, I'll miss my time working with the Emory Wind Ensemble. We played some fantastic repertoire this year, all shared below.

## 'Tis of Thee II -- Sunday, October 24, 2021
{% include feature_row id="feature_row" type="left" %}

## reflections -- Saturday, November 20, 2021
{% include feature_row id="feature_row2" type="right" %}

## Contrasts -- Sunday, February 27, 2022
{% include feature_row id="feature_row3" type="left" %}

## Sharp Edges -- Thursday, April 14, 2022
{% include feature_row id="feature_row4" type="right" %}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>slug-rpc</artifactId>
        <groupId>com.slug</groupId>
        <version>0.01</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>slug-sample</artifactId>
    <packaging>pom</packaging>
    <modules>
        <module>rpc-server</module>
        <module>rpc-client</module>
        <module>rpc-app</module>
    </modules>

</project>


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>Text Helper — CodeIgniter 3.0-dev documentation</title>

    <link rel="shortcut icon" href="../_static/ci-icon.ico"/>

  <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'>

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

    <link rel="top" title="CodeIgniter 3.0-dev documentation" href="../index.html"/>
        <link rel="up" title="Helpers" href="index.html"/>
        <link rel="next" title="Typography Helper" href="typography_helper.html"/>
        <link rel="prev" title="String Helper" href="string_helper.html"/>

           CodeIgniter

  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

Welcome to CodeIgniter

Installation Instructions

Downloading CodeIgniter

Installation Instructions

Upgrading From a Previous Version

Troubleshooting

CodeIgniter Overview

Getting Started

CodeIgniter at a Glance

Supported Features

Application Flow Chart

Model-View-Controller

Architectural Goals

Tutorial

Static pages

News section

Create news items

Conclusion

General Topics

CodeIgniter URLs

Controllers

Reserved Names

Views

Models

Helpers

Using CodeIgniter Libraries

Creating Libraries

Using CodeIgniter Drivers

Creating Drivers

Creating Core System Classes

Creating Ancillary Classes

Hooks - Extending the Framework Core

Auto-loading Resources

Common Functions

Compatibility Functions

URI Routing

Error Handling

Caching

Profiling Your Application

Running via the CLI

Managing your Applications

Handling Multiple Environments

Alternate PHP Syntax for View Files

Security

PHP Style Guide

Libraries

Benchmarking Class

Caching Driver

Calendaring Class

Shopping Cart Class

Config Class

Email Class

Encrypt Class

Encryption Library

File Uploading Class

Form Validation

FTP Class

Image Manipulation Class

Input Class

Javascript Class

Language Class

Loader Class

Migrations Class

Output Class

Pagination Class

Template Parser Class

Security Class

Session Library

HTML Table Class

Trackback Class

Typography Class

Unit Testing Class

URI Class

User Agent Class

XML-RPC and XML-RPC Server Classes

Zip Encoding Class

Database Reference

Quick Start: Usage Examples

Database Configuration

Connecting to a Database

Running Queries

Generating Query Results

Query Helper Functions

Query Builder Class

Transactions

Getting MetaData

Custom Function Calls

Query Caching

Database Manipulation with Database Forge

Database Utilities Class

Database Driver Reference

Helpers

Array Helper

CAPTCHA Helper

Cookie Helper

Date Helper

Directory Helper

Download Helper

Email Helper

File Helper

Form Helper

HTML Helper

Inflector Helper

Language Helper

Number Helper

Path Helper

Security Helper

Smiley Helper

String Helper

Text Helper

Typography Helper

URL Helper

XML Helper

Contributing to CodeIgniter

Writing CodeIgniter Documentation

Developer’s Certificate of Origin 1.1

        CodeIgniter

Docs »

Helpers »

Text Helper

Text Helper¶

The Text Helper file contains functions that assist in working with
text.

Loading this Helper

Available Functions

Loading this Helper¶

This helper is loaded using the following code:

$this->load->helper('text');

Available Functions¶

The following functions are available:

<tt class="descname">word_limiter</tt><big>(</big>$str[, $limit = 100[, $end_char = '&#8230;']]<big>)</big>¶

<col class="field-name" />
<col class="field-body" />

Parameters:

$str (string) – Input string

$limit (int) – Limit

$end_char (string) – End character (usually an ellipsis)

Returns:
Word-limited string

Return type:
string

Truncates a string to the number of words specified. Example:

$string = "Here is a nice text string consisting of eleven words.";
$string = word_limiter($string, 4);
// Returns:  Here is a nice

The third parameter is an optional suffix added to the string. By
default it adds an ellipsis.

<tt class="descname">character_limiter</tt><big>(</big>$str[, $n = 500[, $end_char = '&#8230;']]<big>)</big>¶

<col class="field-name" />
<col class="field-body" />

Parameters:

$str (string) – Input string

$n (int) – Number of characters

$end_char (string) – End character (usually an ellipsis)

Returns:
Character-limited string

Return type:
string

Truncates a string to the number of characters specified. It
maintains the integrity of words so the character count may be slightly
more or less than what you specify.

Example:

$string = "Here is a nice text string consisting of eleven words.";
$string = character_limiter($string, 20);
// Returns:  Here is a nice text string

The third parameter is an optional suffix added to the string, if
undeclared this helper uses an ellipsis.

Note

If you need to truncate to an exact number of characters please
see the <tt class="xref php php-func docutils literal">ellipsize()</tt> function below.

<tt class="descname">ascii_to_entities</tt><big>(</big>$str<big>)</big>¶

<col class="field-name" />
<col class="field-body" />

Parameters:

$str (string) – Input string

Returns:
A string with ASCII values converted to entities

Return type:
string

Converts ASCII values to character entities, including high ASCII and MS
Word characters that can cause problems when used in a web page, so that
they can be shown consistently regardless of browser settings or stored
reliably in a database. There is some dependence on your server’s
supported character sets, so it may not be 100% reliable in all cases,
but for the most part it should correctly identify characters outside
the normal range (like accented characters).

Example:

$string = ascii_to_entities($string);

<tt class="descname">convert_accented_characters</tt><big>(</big>$str<big>)</big>¶

<col class="field-name" />
<col class="field-body" />

Parameters:

$str (string) – Input string

Returns:
A string with accented characters converted

Return type:
string

Transliterates high ASCII characters to low ASCII equivalents. Useful
when non-English characters need to be used where only standard ASCII
characters are safely used, for instance, in URLs.

Example:

$string = convert_accented_characters($string);

Note

This function uses a companion config file
application/config/foreign_chars.php to define the to and
from array for transliteration.

<tt class="descname">word_censor</tt><big>(</big>$str, $censored[, $replacement = '']<big>)</big>¶

<col class="field-name" />
<col class="field-body" />

Parameters:

$str (string) – Input string

$censored (array) – List of bad words to censor

$replacement (string) – What to replace bad words with

Returns:
Censored string

Return type:
string

Enables you to censor words within a text string. The first parameter
will contain the original string. The second will contain an array of
words which you disallow. The third (optional) parameter can contain
a replacement value for the words. If not specified they are replaced
with pound signs: ####.

Example:

$disallowed = array('darn', 'shucks', 'golly', 'phooey');
$string = word_censor($string, $disallowed, 'Beep!');

<tt class="descname">highlight_code</tt><big>(</big>$str<big>)</big>¶

<col class="field-name" />
<col class="field-body" />

Parameters:

$str (string) – Input string

Returns:
String with code highlighted via HTML

Return type:
string

Colorizes a string of code (PHP, HTML, etc.). Example:

$string = highlight_code($string);

The function uses PHP’s <tt class="docutils literal">highlight_string()</tt> function, so the
colors used are the ones specified in your php.ini file.

<tt class="descname">highlight_phrase</tt><big>(</big>$str, $phrase[, $tag_open = '<mark>'[, $tag_close = '</mark>']]<big>)</big>¶

<col class="field-name" />
<col class="field-body" />

Parameters:

$str (string) – Input string

$phrase (string) – Phrase to highlight

$tag_open (string) – Opening tag used for the highlight

$tag_close (string) – Closing tag for the highlight

Returns:
String with a phrase highlighted via HTML

Return type:
string

Will highlight a phrase within a text string. The first parameter will
contain the original string, the second will contain the phrase you wish
to highlight. The third and fourth parameters will contain the
opening/closing HTML tags you would like the phrase wrapped in.

Example:

$string = "Here is a nice text string about nothing in particular.";
echo highlight_phrase($string, "nice text", '<span style="color:#990000;">', '</span>');

The above code prints:

Here is a <span style="color:#990000;">nice text</span> string about nothing in particular.

Note

This function used to use the <tt class="docutils literal"><strong></tt> tag by default. Older browsers
might not support the new HTML5 mark tag, so it is recommended that you
insert the following CSS code into your stylesheet if you need to support
such browsers:

mark {
        background: #ff0;
        color: #000;
};

<tt class="descname">word_wrap</tt><big>(</big>$str[, $charlim = 76]<big>)</big>¶

<col class="field-name" />
<col class="field-body" />

Parameters:

$str (string) – Input string

$charlim (int) – Character limit

Returns:
Word-wrapped string

Return type:
string

Wraps text at the specified character count while maintaining
complete words.

Example:

$string = "Here is a simple string of text that will help us demonstrate this function.";
echo word_wrap($string, 25);

// Would produce:  Here is a simple string of text that will help us demonstrate this function

<tt class="descname">ellipsize</tt><big>(</big>$str, $max_length[, $position = 1[, $ellipsis = '&hellip;']]<big>)</big>¶

<col class="field-name" />
<col class="field-body" />

Parameters:

$str (string) – Input string

$max_length (int) – String length limit

$position (mixed) – Position to split at (int or float)

$ellipsis (string) – What to use as the ellipsis character

Returns:
Ellipsized string

Return type:
string

This function will strip tags from a string, split it at a defined
maximum length, and insert an ellipsis.

The first parameter is the string to ellipsize, the second is the number
of characters in the final string. The third parameter is where in the
string the ellipsis should appear from 0 - 1, left to right. For
example. a value of 1 will place the ellipsis at the right of the
string, .5 in the middle, and 0 at the left.

An optional forth parameter is the kind of ellipsis. By default,
&hellip; will be inserted.

Example:

$str = 'this_string_is_entirely_too_long_and_might_break_my_design.jpg';
echo ellipsize($str, 32, .5);

Produces:

this_string_is_e&hellip;ak_my_design.jpg

        Next

         Previous

        © Copyright 2014 - 2015, British Columbia Institute of Technology.
      Last updated on Mar 10, 2015.

  Built with Sphinx using a theme provided by Read the Docs.


text:
function GUI() {

	var DEFAULT_TEAM_COLORS = ['red', 'yellow', 'green', 'blue'];

	var getDamageColor = function( damage ) {
		if ( damage < 70 ) {
			return 'high';
		} else if ( damage < 140 ) {
			return 'medium';
		} else if ( damage < 210 ) {
			return 'low';
		} else {
			return 'lowest';
		}
	};

	var createPlayerElement = function( player ) {
		var s = '
';
		for ( var i = 0; i < player.initialLife; i++ ) {
			s += '';
		}
	  s += '' + player.name + ''
      + '
0 frags
'
      + '' + player.damage + '%'
      + '

'
    + '
';
    return s;
	};

	var getPlayerElement = function( playerId ) {
		return $( '#players .player[data-id="' + playerId + '"]' );
	};

	var roundStartAnimation = function( labels, duration, delay, callback ) {
		var message = $( '#message' );
		message.removeClass( 'hide grow' );
		setTimeout(function () {
			if ( labels.length == 0 ) {
				message.addClass( 'hide' ).html( '' );
			} else {
				message.html( labels[0] ).addClass( 'grow' );
				labels.splice( 0, 1 );
				if ( labels.length == 0 ) {
					callback();
				}
				setTimeout(function () {
					roundStartAnimation( labels, duration, delay, callback );
				}, duration);
			}
		}, delay);
	};

	/**
	*
	*		PUBLIC METHODS
	*
	*/
	this.init = function( map ) {
		var teamScores = $( '#teamScores' );
		teamScores.addClass( 'hide' ).html( '' );
		if ( map.id == Map.Types.FLAG.id ) {
			for ( var i = 0 ; i < map.teams; i++ ) {
				teamScores.append( '
0
' );
			}
			teamScores.removeClass( 'hide' );
		}
	};

	this.addPlayer = function( player ) {
		$( '#players' ).append( createPlayerElement( player ) );
		setTimeout(function () {
			getPlayerElement( player.id ).removeClass( 'grow' );
		}, 100);
	};

	this.removePlayer = function( playerId ) {
		getPlayerElement( playerId ).addClass( 'shrink' );
		setTimeout(function () {
			getPlayerElement( playerId )[0].remove();
		}, 300);
	};

	this.updateInitialLife = function( player ) {
		var playerElement = getPlayerElement( player.id );
		playerElement.remove();
		$( '#players' ).append( createPlayerElement( player ) );
		getPlayerElement( player.id ).removeClass( 'grow' );
	};

	this.updateLife = function( player, isReset ) {
		var playerElement = getPlayerElement( player.id );

		// animate UI
		if ( !isReset ) {
			playerElement.addClass( 'loseLife' );
			setTimeout(function () {
				playerElement.removeClass( 'loseLife' );
			}, 500);
		}

		if ( player.life == 0 ) {
			// player has lost
			$( 'img', playerElement ).addClass( 'invisible' );
			playerElement.addClass( 'dead' );
		} else {
			playerElement.removeClass( 'dead' );
			$( 'img', playerElement ).removeClass( 'invisible' );
			$( 'img:gt(' + ( player.life - 1 ) + ')', playerElement ).addClass( 'invisible' );
		}
	};

	this.updateDamage = function( player ) {
		var playerElement = getPlayerElement( player.id );
		$( '.damage', playerElement ).html( player.damage + '%' ).removeClass( 'lowest low medium high' ).addClass( getDamageColor( player.damage ) );
	};

	this.updateTeam = function( player ) {
		var playerElement = getPlayerElement( player.id );
		$( '.name', playerElement ).removeClass( 'blue red green yellow' ).addClass( DEFAULT_TEAM_COLORS[player.team] );
	};

	this.updateFrags = function( player ) {
		var playerElement = getPlayerElement( player.id );
		$( '.frags', playerElement ).html( player.frags + ' frags' );
	};

	this.showRoundStart = function( callback ) {
		roundStartAnimation( ['Round starts in', '3', '2', '1', 'GO !'], 700, 200, callback );
	};

	this.showVictory = function( text, team ) {
		var victory = $( '#victory' );
		$( '#victory span' ).html( text ).removeClass( 'blue red green yellow' ).addClass( DEFAULT_TEAM_COLORS[team] );
		victory.removeClass( 'hide' );
	};

	this.hideLoading = function() {
		$( '#loading' ).addClass( 'invisible' )
		setTimeout(function () {
			$( '#loading' ).addClass( 'hide' );
		}, 500);
	};

	this.addItem = function( player ) {
		var weapon = player.weapon;
		$( '.items', getPlayerElement( player.id ) ).addClass( 'invisible' ).html( '' );//.attr('data-content', weapon.ammo);
		setTimeout(function () {
			$( '.items', getPlayerElement( player.id ) ).removeClass( 'invisible' );
		}, 100);
	};

	this.updateItem = function( player ) {
		// var weapon = player.weapon;
		// $('.items', getPlayerElement(player.id)).attr('data-content', weapon.ammo);
	};

	this.removeItem = function( player ) {
		$( '.items', getPlayerElement( player.id ) ).html( '' );//.attr('data-content', '');
	};

	this.updateTeamScore = function( team, score ) {
		var el = $( '#teamScores div:nth-child(' + ( team + 1 ) + ')' );
		el.html( score ).addClass( 'bounce' );
		setTimeout(function () {
			el.removeClass( 'bounce' );
		}, 1000);
	};

}


text:
describe("regionWinners",function(){
   it("contains the right set of winners",function(){
      var logic=require("../logic"),
          _=require("underscore"),
          gateway = require("../data"),
          data = gateway.electionData(),
          winners = logic.regionWinners(data.regions[0]);

       expect(winners.length).toBe(data.regions[0].additionalMembers);
       expect(winners[0].listMember).toBe("Siobhan McMahon");
       expect(winners[1].listMember).toBe("Mark Griffin");
       expect(winners[2].listMember).toBe("Richard Lyle");
       expect(winners[3].listMember).toBe("Margaret Mitchell");
       expect(winners[4].listMember).toBe("Margaret McCulloch");
       expect(winners[5].listMember).toBe("Clare Adamson");
   });
});


text:
import { resolve, dirname } from 'path';
import builtins from 'builtin-modules';
import nodeResolve from 'resolve';
import browserResolve from 'browser-resolve';

var COMMONJS_BROWSER_EMPTY = nodeResolve.sync('browser-resolve/empty.js', __dirname);
var ES6_BROWSER_EMPTY = resolve(__dirname, '../src/empty.js');

function npm(options) {
	options = options || {};

	var skip = options.skip || [];
	var useMain = options.main !== false;

	var _resolveId = options.browser ? browserResolve : nodeResolve;

	return {
		resolveId: function resolveId(importee, importer) {
			var parts = importee.split(/[\/\\]/);
			var id = parts.shift();

			// scoped packages
			if (id[0] === '@' && parts.length) {
				id += '/' + parts.shift();
			}

			if (skip !== true && ~skip.indexOf(id)) return null;

			// disregard entry module
			if (!importer) return null;

			return new Promise(function (accept, reject) {
				_resolveId(importee, {
					basedir: dirname(importer),
					packageFilter: function packageFilter(pkg) {
						if (options.jsnext) {
							var main = pkg['jsnext:main'];
							if (main) {
								pkg['main'] = main;
							} else if (!useMain) {
								if (skip === true) accept(false);else reject(Error('Package ' + importee + ' (imported by ' + importer + ') does not have a jsnext:main field. You should either allow legacy modules with options.main, or skip it with options.skip = [\'' + importee + '\'])'));
							}
						} else if (!useMain) {
							if (skip === true) accept(false);else reject(Error('To import from a package in node_modules (' + importee + '), either options.jsnext or options.main must be true'));
						}
						return pkg;
					},

					extensions: options.extensions
				}, function (err, resolved) {
					if (err) {
						if (skip === true) accept(false);else reject(err);
					} else {
						if (resolved === COMMONJS_BROWSER_EMPTY) resolved = ES6_BROWSER_EMPTY;
						if (~builtins.indexOf(resolved)) resolved = null;

						accept(resolved);
					}
				});
			});
		}
	};
}

export default npm;


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/videointelligence/v1p1beta1/video_intelligence.proto

package com.google.cloud.videointelligence.v1p1beta1;

public interface WordInfoOrBuilder
    extends
    // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p1beta1.WordInfo)
    com.google.protobuf.MessageOrBuilder {

  /**
   *
   *
   *

   * Output only. Time offset relative to the beginning of the audio, and
   * corresponding to the start of the spoken word. This field is only set if
   * `enable_word_time_offsets=true` and only in the top hypothesis. This is an
   * experimental feature and the accuracy of the time offset can vary.
   *

   *
   * .google.protobuf.Duration start_time = 1;
   *
   * @return Whether the startTime field is set.
   */
  boolean hasStartTime();
  /**
   *
   *
   *

   * Output only. Time offset relative to the beginning of the audio, and
   * corresponding to the start of the spoken word. This field is only set if
   * `enable_word_time_offsets=true` and only in the top hypothesis. This is an
   * experimental feature and the accuracy of the time offset can vary.
   *

   *
   * .google.protobuf.Duration start_time = 1;
   *
   * @return The startTime.
   */
  com.google.protobuf.Duration getStartTime();
  /**
   *
   *
   *

   * Output only. Time offset relative to the beginning of the audio, and
   * corresponding to the start of the spoken word. This field is only set if
   * `enable_word_time_offsets=true` and only in the top hypothesis. This is an
   * experimental feature and the accuracy of the time offset can vary.
   *

   *
   * .google.protobuf.Duration start_time = 1;
   */
  com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder();

  /**
   *
   *
   *

   * Output only. Time offset relative to the beginning of the audio, and
   * corresponding to the end of the spoken word. This field is only set if
   * `enable_word_time_offsets=true` and only in the top hypothesis. This is an
   * experimental feature and the accuracy of the time offset can vary.
   *

   *
   * .google.protobuf.Duration end_time = 2;
   *
   * @return Whether the endTime field is set.
   */
  boolean hasEndTime();
  /**
   *
   *
   *

   * Output only. Time offset relative to the beginning of the audio, and
   * corresponding to the end of the spoken word. This field is only set if
   * `enable_word_time_offsets=true` and only in the top hypothesis. This is an
   * experimental feature and the accuracy of the time offset can vary.
   *

   *
   * .google.protobuf.Duration end_time = 2;
   *
   * @return The endTime.
   */
  com.google.protobuf.Duration getEndTime();
  /**
   *
   *
   *

   * Output only. Time offset relative to the beginning of the audio, and
   * corresponding to the end of the spoken word. This field is only set if
   * `enable_word_time_offsets=true` and only in the top hypothesis. This is an
   * experimental feature and the accuracy of the time offset can vary.
   *

   *
   * .google.protobuf.Duration end_time = 2;
   */
  com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder();

  /**
   *
   *
   *

   * Output only. The word corresponding to this set of information.
   *

   *
   * string word = 3;
   *
   * @return The word.
   */
  java.lang.String getWord();
  /**
   *
   *
   *

   * Output only. The word corresponding to this set of information.
   *

   *
   * string word = 3;
   *
   * @return The bytes for word.
   */
  com.google.protobuf.ByteString getWordBytes();
}


text:
import { EventEmitter } from 'events'

export const emitter = new EventEmitter()

let flash = null
let timeout = null

export function getFlash() {
  const tempFlash = flash
  timeout = setTimeout(() => (flash = null), 100)
  return tempFlash
}

export function setFlash(message, type) {
  clearTimeout(timeout)
  flash = { message, type: type || 'info' }
  emitter.emit('flash', flash)
}

export function clearFlash() {
  setFlash(null)
}


text:
package ec2query

//go:generate go run ../../fixtures/protocol/generate.go ../../fixtures/protocol/output/ec2.json unmarshal_test.go

import (
	"encoding/xml"
	"io"

	"github.com/trayio/inventory/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws"
	"github.com/trayio/inventory/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/trayio/inventory/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil"
)

// Unmarshal unmarshals a response body for the EC2 protocol.
func Unmarshal(r *aws.Request) {
	defer r.HTTPResponse.Body.Close()
	if r.DataFilled() {
		decoder := xml.NewDecoder(r.HTTPResponse.Body)
		err := xmlutil.UnmarshalXML(r.Data, decoder, "")
		if err != nil {
			r.Error = awserr.New("SerializationError", "failed decoding EC2 Query response", err)
			return
		}
	}
}

// UnmarshalMeta unmarshals response headers for the EC2 protocol.
func UnmarshalMeta(r *aws.Request) {
	// TODO implement unmarshaling of request IDs
}

type xmlErrorResponse struct {
	XMLName   xml.Name `xml:"Response"`
	Code      string   `xml:"Errors>Error>Code"`
	Message   string   `xml:"Errors>Error>Message"`
	RequestID string   `xml:"RequestId"`
}

// UnmarshalError unmarshals a response error for the EC2 protocol.
func UnmarshalError(r *aws.Request) {
	defer r.HTTPResponse.Body.Close()

	resp := &xmlErrorResponse{}
	err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp)
	if err != nil && err != io.EOF {
		r.Error = awserr.New("SerializationError", "failed decoding EC2 Query error response", err)
	} else {
		r.Error = awserr.NewRequestFailure(
			awserr.New(resp.Code, resp.Message, nil),
			r.HTTPResponse.StatusCode,
			resp.RequestID,
		)
	}
}


text:
<?php

class ModeContestAjaxChallenge extends JControl
{
    public function Start()
    {
        if (jf::CurrentUser()) {
            if (jf::Check("contest")) {
                if (isset($_POST['challenge'])
                    && isset($_POST['name'])
                    && isset($_POST['points'])
                    && isset($_POST['flag'])
                ) {
                    $hashedFlag = md5($_POST['flag']);
                    $activeContest = \webgoat\ContestDetails::getActive();
                    $activeContestID = $activeContest[0]['ID'];

                    $data = array(
                        'ContestID' => $activeContestID,
                        'ChallengeName' => $_POST['challenge'],
                        'NameToDisplay' => $_POST['name'],
                        'Points' => $_POST['points'],
                        'CorrectFlag' => $hashedFlag
                    );
                    \webgoat\ContestChallenges::add($data);
                    echo json_encode(array('status' => true, 'message' => 'Challenge successfully added'));

                    return true;
                }
            }
        }
    }
}


text:
{-# LANGUAGE FlexibleContexts #-}
module Villefort.Daily where
import Villefort.Definitions
import Villefort.Database
import Control.Monad.Reader
import Data.Time
import Data.Time.Calendar.OrdinalDate
import Data.List.Split as S
import Control.Concurrent (threadDelay)

-- | Date representation
data D = D { year :: Integer,
             month :: Int,
             day :: Int} deriving (Show)

fromZonedTimeToDay :: String -> Day
fromZonedTimeToDay x = fromGregorian (year up) (month up ) (day up)
  where up = unpackStringToDate x

getDate :: IO Day
getDate = fromZonedTimeToDay <$> show <$> getZonedTime

getDateD :: IO D
getDateD = unpackStringToDate <$> show <$> getZonedTime

unpackStringToDate :: [Char] -> D
unpackStringToDate x = D (read (nums !! 0) :: Integer) (read (nums !! 1) :: Int) (read (nums !! 2) :: Int)
  where nums = S.splitOn "-" $  take 10 x

getDay :: IO Int
getDay = do
  z <- getDate
  return $ snd $mondayStartWeek z

writeDate :: (MonadReader VConfig m, MonadIO m) => m ()
writeDate = do
  date <- liftIO $ show <$> getDate
  execQuery ("update dates set  date = ? where type = 'date';") [date]

readDate :: (MonadReader VConfig m, MonadIO m) => m D
readDate = do
  rawDate <- makeQuery "select date from dates where type = 'date';"
  return $ unpackStringToDate $ head $ head $ rawDate

writeDay :: (MonadReader VConfig m, MonadIO m) => m ()
writeDay = do
  newDay <- liftIO $ show <$> getDay
  execQuery ("update dates set  date = ? where type = 'day';") [newDay]

readDay :: (MonadReader VConfig m, MonadIO m) => m Int
readDay = do
  rawDay <- makeQuery "select date from dates where type = 'day';"
  let int = read (head $ head $ rawDay) :: Int
  return int

checkDay :: D -> D ->Bool
checkDay oldDate currentDate= ((day oldDate) == (day currentDate))
checkMonth :: D -> D -> Bool
checkMonth oldDate currentDate = (month oldDate) == (month currentDate)
checkYear :: D -> D -> Bool
checkYear oldDate currentDate  = (year oldDate)  == (year currentDate)

runDaily :: VConfig -> D -> D -> IO ()
runDaily vconf oldDate currentDate=
  if (checkDay oldDate currentDate) then
    return ()
  else
    putStrLn "adding-daily" >> do
    dailies <- sequence (daily vconf)
    mapM_ add dailies
    where add = (\x -> if Prelude.null x then return () else runReaderT ( addDaily x) vconf)

runMonthly :: D -> D -> IO ()
runMonthly oldDate currentDate = if(checkMonth oldDate currentDate) then
  putStrLn "same-month"
  else
  putStrLn "adding monthly"

runYearly :: D -> D -> IO ()
runYearly oldDate currentDate = if(checkYear oldDate currentDate) then
  putStrLn "same-year"
  else
  putStrLn "adding yearly"

runWeekly :: VConfig -> Int -> Int -> IO ()
runWeekly conf old current = do
  if old /= current
    then do
    let stmt = selector conf (current-1)
    stmts <- sequence stmt
    mapM_ add stmts
    else return ()
    where add = (\x -> if Prelude.null x then return () else runReaderT ( addDaily x) conf)

selector :: (Num a, Eq a) => VConfig -> a -> [IO [String]]
selector  conf x
  | x == 0 = monday lookconf
  | x == 1 = tuesday lookconf
  | x == 2 = wednesday lookconf
  | x == 3 = thursday lookconf
  | x == 4 = friday lookconf
  | x == 5 = saturday lookconf
  | otherwise = sunday lookconf
    where lookconf = weekly conf

man :: VConfig -> IO ()
man conf = do
  oldDate <- runReaderT readDate conf
  currentDate <- getDateD
  oldDay <- runReaderT readDay conf
  currentDay <- getDay
  runWeekly conf oldDay currentDay
  runDaily conf oldDate currentDate
  runReaderT writeDate conf
  runReaderT writeDay conf
  threadDelay 18000000

-- | Run daily check for updates
dailyCheck :: VConfig -> IO b
dailyCheck conf = forever$  man conf


text:
package com.devopsbuddy.web.controllers;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class CopyController {

	@RequestMapping("/about")
	public String about(){
		return "copy/about";
	}
}


text:
require "test/unit"
require "net/protocol"
require "stringio"

class TestProtocol < Test::Unit::TestCase
  def test_should_properly_dot_stuff_period_with_no_endline
    bug9627 = '[ruby-core:61441] [Bug #9627]'
    sio = StringIO.new("".dup)
    imio = Net::InternetMessageIO.new(sio)
    email = "To: bob@aol.com\nlook, a period with no endline\n."
    imio.write_message(email)
    assert_equal("To: bob@aol.com\r\nlook, a period with no endline\r\n..\r\n.\r\n", sio.string, bug9627)
  end

  def test_each_crlf_line
    assert_output('', '') do
      sio = StringIO.new("".dup)
      imio = Net::InternetMessageIO.new(sio)
      assert_equal(23, imio.write_message("\u3042\r\u3044\n\u3046\r\n\u3048"))
      assert_equal("\u3042\r\n\u3044\r\n\u3046\r\n\u3048\r\n.\r\n", sio.string)

      sio = StringIO.new("".dup)
      imio = Net::InternetMessageIO.new(sio)
      assert_equal(8, imio.write_message("\u3042\r"))
      assert_equal("\u3042\r\n.\r\n", sio.string)
    end
  end

  def create_mockio(capacity: 100, max: nil)
    mockio = Object.new
    mockio.instance_variable_set(:@str, +'')
    mockio.instance_variable_set(:@capacity, capacity)
    mockio.instance_variable_set(:@max, max)
    def mockio.string; @str; end
    def mockio.to_io; self; end
    def mockio.wait_writable(sec); sleep sec; false; end
    def mockio.write_nonblock(*strs, exception: true)
      if @capacity <= @str.bytesize
        if exception
          raise Net::WaitWritable
        else
          return :wait_writable
        end
      end
      len = 0
      max = @max ? [@capacity, @str.bytesize + @max].min : @capacity
      strs.each do |str|
        len1 = @str.bytesize
        break if max <= len1
        @str << str.byteslice(0, max - @str.bytesize)
        len2 = @str.bytesize
        len += len2 - len1
      end
      len
    end
    mockio
  end

  def test_write0_multibyte
    mockio = create_mockio(max: 1)
    io = Net::BufferedIO.new(mockio)
    assert_equal(3, io.write("\u3042"))
  end

  def test_write0_timeout
    mockio = create_mockio
    io = Net::BufferedIO.new(mockio)
    io.write_timeout = 0.1
    assert_raise(Net::WriteTimeout){ io.write("a"*1000) }
  end

  def test_write0_success
    mockio = create_mockio
    io = Net::BufferedIO.new(mockio)
    io.write_timeout = 0.1
    len = io.write("a"*10)
    assert_equal "a"*10, mockio.string
    assert_equal 10, len
  end

  def test_write0_success2
    mockio = create_mockio
    io = Net::BufferedIO.new(mockio)
    io.write_timeout = 0.1
    len = io.write("a"*100)
    assert_equal "a"*100, mockio.string
    assert_equal 100, len
  end

  def test_write0_success_multi1
    mockio = create_mockio
    io = Net::BufferedIO.new(mockio)
    io.write_timeout = 0.1
    len = io.write("a"*50, "a"*49)
    assert_equal "a"*99, mockio.string
    assert_equal 99, len
  end

  def test_write0_success_multi2
    mockio = create_mockio
    io = Net::BufferedIO.new(mockio)
    io.write_timeout = 0.1
    len = io.write("a"*50, "a"*50)
    assert_equal "a"*100, mockio.string
    assert_equal 100, len
  end

  def test_write0_timeout_multi1
    mockio = create_mockio
    io = Net::BufferedIO.new(mockio)
    io.write_timeout = 0.1
    assert_raise(Net::WriteTimeout){ io.write("a"*50,"a"*51) }
  end

  def test_write0_timeout_multi2
    mockio = create_mockio
    io = Net::BufferedIO.new(mockio)
    io.write_timeout = 0.1
    assert_raise(Net::WriteTimeout){ io.write("a"*50,"a"*50,"a") }
  end
end


text:
#region Copyright & License

// Copyright © 2012 - 2015 François Chabot, Yves Dierick
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#endregion

using Microsoft.BizTalk.Component.Interop;

namespace Be.Stateless.BizTalk.Dsl.Binding.Adapter.Extensions
{
	internal static class AdapterPropertyBagExtensions
	{
		internal static void WriteAdapterCustomProperty<T>(this IPropertyBag propertyBag, string name, T value) where T : struct
		{
			propertyBag.WriteAdapterProperty(name, value);
		}

		internal static void WriteAdapterCustomProperty(this IPropertyBag propertyBag, string name, string value)
		{
			propertyBag.WriteAdapterProperty(name, value);
		}

		private static void WriteAdapterProperty(this IPropertyBag propertyBag, string name, object value)
		{
			propertyBag.Write(name, value);
		}
	}
}


text:
use euler::algorithm::long::int_sqrt;
use euler::Solver;

// The first two consecutive numbers to have two distinct prime factors are:
// 14 = 2 × 7
// 15 = 3 × 5
// The first three consecutive numbers to have three distinct prime factors are:
// 644 = 22 × 7 × 23
// 645 = 3 × 5 × 43
// 646 = 2 × 17 × 19.
// Find the first four consecutive integers to have four distinct prime factors each. What is the first of these numbers?

pub struct Solver047 {
    pub n: isize
}

impl Default for Solver047 {
    fn default() -> Self {
        Solver047 { n: 4 }
    }
}

impl Solver for Solver047 {
    fn solve(&self) -> isize {
        let mut primes = vec![2];
        (3..).scan(0, |count, l| {
            *count = if is_num_prime_factors(l, &mut primes, self.n) { *count + 1 } else { 0 };
            if *count == self.n { Some(l - self.n + 1) } else { Some(0) }
        }).find(|&a| a != 0).unwrap()
    }
}

// Similar to primes.prime_factors() but optimized for this problem
fn is_num_prime_factors(n: isize, primes: &mut Vec<isize>, expected: isize) -> bool {
    let (mut count, mut value, small, stop) = (0, n, n <= i32::MAX as _, int_sqrt(n));
    for &factor in primes.iter() {
        let mut divides = false;
        while if small { value as i32 % factor as i32 == 0 } else { value % factor == 0 } {
            value /= factor;
            divides = true;
        }
        if divides {
            count += 1;
            // if count > expected { return false; } is slightly slower
        }
        if factor >= stop {
            // if the number is prime, or if there is still a remainder, add itself as a factor
            if count == 0 {
                primes.push(n);
            }
            if value >= factor || count == 0 {
                count += 1;
            }
            return count == expected;
        }
    }
    false
}


text:
// Template Source: BaseEntity.java.tt
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.  See License in the project root for license information.
// ------------------------------------------------------------------------------

package com.microsoft.graph.models;
import com.microsoft.graph.serializer.ISerializer;
import com.microsoft.graph.serializer.IJsonBackedObject;
import com.microsoft.graph.serializer.AdditionalDataManager;
import java.util.EnumSet;
import com.microsoft.graph.http.BaseCollectionPage;
import com.microsoft.graph.models.Entity;
import com.microsoft.graph.requests.SimulationAutomationCollectionPage;
import com.microsoft.graph.requests.SimulationCollectionPage;

import com.google.gson.JsonObject;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import javax.annotation.Nullable;
import javax.annotation.Nonnull;

// **NOTE** This file was generated by a tool and any changes will be overwritten.

/**
 * The class for the Attack Simulation Root.
 */
public class AttackSimulationRoot extends Entity implements IJsonBackedObject {

    /**
     * The Simulation Automations.
     * Represents simulation automation created to run on a tenant.
     */
    @SerializedName(value = "simulationAutomations", alternate = {"SimulationAutomations"})
    @Expose
	@Nullable
    public com.microsoft.graph.requests.SimulationAutomationCollectionPage simulationAutomations;

    /**
     * The Simulations.
     * Represents an attack simulation training campaign in a tenant.
     */
    @SerializedName(value = "simulations", alternate = {"Simulations"})
    @Expose
	@Nullable
    public com.microsoft.graph.requests.SimulationCollectionPage simulations;

    /**
     * Sets the raw JSON object
     *
     * @param serializer the serializer
     * @param json the JSON object to set this object to
     */
    public void setRawObject(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) {

        if (json.has("simulationAutomations")) {
            simulationAutomations = serializer.deserializeObject(json.get("simulationAutomations"), com.microsoft.graph.requests.SimulationAutomationCollectionPage.class);
        }

        if (json.has("simulations")) {
            simulations = serializer.deserializeObject(json.get("simulations"), com.microsoft.graph.requests.SimulationCollectionPage.class);
        }
    }
}


text:
use crate::integration::{mock_endpoint, register_test, EndpointOptions};

#[test]
fn command_projects_list() {
    let _server = mock_endpoint(
        EndpointOptions::new("GET", "/api/0/organizations/wat-org/projects/?cursor=", 200)
            .with_response_file("projects/get-projects.json"),
    );
    register_test("projects/projects-list.trycmd");
}

#[test]
fn command_projects_list_help() {
    register_test("projects/projects-list-help.trycmd");
}


text:
#include <aws/ec2/model/FleetLaunchTemplateSpecificationRequest.h>
#include <aws/core/utils/xml/XmlSerializer.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>

#include <utility>

using namespace Aws::Utils::Xml;
using namespace Aws::Utils;

namespace Aws
{
namespace EC2
{
namespace Model
{

FleetLaunchTemplateSpecificationRequest::FleetLaunchTemplateSpecificationRequest() :
    m_launchTemplateIdHasBeenSet(false),
    m_launchTemplateNameHasBeenSet(false),
    m_versionHasBeenSet(false)
{
}

FleetLaunchTemplateSpecificationRequest::FleetLaunchTemplateSpecificationRequest(const XmlNode& xmlNode) :
    m_launchTemplateIdHasBeenSet(false),
    m_launchTemplateNameHasBeenSet(false),
    m_versionHasBeenSet(false)
{
  *this = xmlNode;
}

FleetLaunchTemplateSpecificationRequest& FleetLaunchTemplateSpecificationRequest::operator =(const XmlNode& xmlNode)
{
  XmlNode resultNode = xmlNode;

  if(!resultNode.IsNull())
  {
    XmlNode launchTemplateIdNode = resultNode.FirstChild("LaunchTemplateId");
    if(!launchTemplateIdNode.IsNull())
    {
      m_launchTemplateId = StringUtils::Trim(launchTemplateIdNode.GetText().c_str());
      m_launchTemplateIdHasBeenSet = true;
    }
    XmlNode launchTemplateNameNode = resultNode.FirstChild("LaunchTemplateName");
    if(!launchTemplateNameNode.IsNull())
    {
      m_launchTemplateName = StringUtils::Trim(launchTemplateNameNode.GetText().c_str());
      m_launchTemplateNameHasBeenSet = true;
    }
    XmlNode versionNode = resultNode.FirstChild("Version");
    if(!versionNode.IsNull())
    {
      m_version = StringUtils::Trim(versionNode.GetText().c_str());
      m_versionHasBeenSet = true;
    }
  }

  return *this;
}

void FleetLaunchTemplateSpecificationRequest::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const
{
  if(m_launchTemplateIdHasBeenSet)
  {
      oStream << location << index << locationValue << ".LaunchTemplateId=" << StringUtils::URLEncode(m_launchTemplateId.c_str()) << "&";
  }

  if(m_launchTemplateNameHasBeenSet)
  {
      oStream << location << index << locationValue << ".LaunchTemplateName=" << StringUtils::URLEncode(m_launchTemplateName.c_str()) << "&";
  }

  if(m_versionHasBeenSet)
  {
      oStream << location << index << locationValue << ".Version=" << StringUtils::URLEncode(m_version.c_str()) << "&";
  }

}

void FleetLaunchTemplateSpecificationRequest::OutputToStream(Aws::OStream& oStream, const char* location) const
{
  if(m_launchTemplateIdHasBeenSet)
  {
      oStream << location << ".LaunchTemplateId=" << StringUtils::URLEncode(m_launchTemplateId.c_str()) << "&";
  }
  if(m_launchTemplateNameHasBeenSet)
  {
      oStream << location << ".LaunchTemplateName=" << StringUtils::URLEncode(m_launchTemplateName.c_str()) << "&";
  }
  if(m_versionHasBeenSet)
  {
      oStream << location << ".Version=" << StringUtils::URLEncode(m_version.c_str()) << "&";
  }
}

} // namespace Model
} // namespace EC2
} // namespace Aws


text:
package org.gradle.tooling.internal.provider.runner;

import org.gradle.initialization.BuildEventConsumer;
import org.gradle.internal.progress.BuildOperationInternal;
import org.gradle.internal.progress.InternalBuildListener;
import org.gradle.internal.progress.OperationResult;
import org.gradle.internal.progress.OperationStartEvent;
import org.gradle.tooling.internal.provider.events.*;

import java.util.Collections;

/**
 * Build listener that forwards all receiving events to the client via the provided {@code BuildEventConsumer} instance.
 *
 * @since 2.5
 */
class ClientForwardingBuildListener implements InternalBuildListener {

    private final BuildEventConsumer eventConsumer;

    ClientForwardingBuildListener(BuildEventConsumer eventConsumer) {
        this.eventConsumer = eventConsumer;
    }

    @Override
    public void started(BuildOperationInternal buildOperation, OperationStartEvent startEvent) {
        eventConsumer.dispatch(new DefaultOperationStartedProgressEvent(startEvent.getStartTime(), toBuildOperationDescriptor(buildOperation)));
    }

    @Override
    public void finished(BuildOperationInternal buildOperation, OperationResult result) {
        eventConsumer.dispatch(new DefaultOperationFinishedProgressEvent(result.getEndTime(), toBuildOperationDescriptor(buildOperation), adaptResult(result)));
    }

    private DefaultOperationDescriptor toBuildOperationDescriptor(BuildOperationInternal buildOperation) {
        Object id = buildOperation.getId();
        String name = buildOperation.getDisplayName();
        String displayName = buildOperation.getDisplayName();
        Object parentId = buildOperation.getParentId();
        return new DefaultOperationDescriptor(id, name, displayName, parentId);
    }

    private AbstractOperationResult adaptResult(OperationResult result) {
        Throwable failure = result.getFailure();
        long startTime = result.getStartTime();
        long endTime = result.getEndTime();
        if (failure != null) {
            return new DefaultFailureResult(startTime, endTime, Collections.singletonList(DefaultFailure.fromThrowable(failure)));
        }
        return new DefaultSuccessResult(startTime, endTime);
    }
}


text:
package com.mathworks.xzheng.analysis;

import java.io.IOException;
import java.io.Reader;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.Tokenizer;
import org.apache.lucene.analysis.core.LowerCaseTokenizer;
import org.apache.lucene.util.Version;

// From chapter 4
public final class SimpleAnalyzer extends Analyzer {

//	@Override
//	public TokenStream reusableTokenStream(Analyzer analyzer, Reader reader) throws IOException {
//		Tokenizer tokenizer = (Tokenizer) getPreviousTokenStream();
//		if (tokenizer == null) {
//			tokenizer = new LowerCaseTokenizer(Version.LUCENE_46, reader);
//			setPreviousTokenStream(tokenizer);
//		} else
//			tokenizer.reset(reader);
//		return tokenizer;
//	}

	public static void main(String[] args) throws IOException {
		AnalyzerUtils.displayTokensWithFullDetails(new SimpleAnalyzer(),
				"The quick brown fox....");
	}
	@Override
	protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
		Tokenizer source = new LowerCaseTokenizer(Version.LUCENE_46, reader);
		return new TokenStreamComponents(source);
	}
}


text:
namespace Microsoft.Azure.Management.StorSimple8000Series.Models
{
    using Azure;
    using Management;
    using StorSimple8000Series;
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// The 'Data 0' network interface card settings.
    /// </summary>
    public partial class NetworkInterfaceData0Settings
    {
        /// <summary>
        /// Initializes a new instance of the NetworkInterfaceData0Settings
        /// class.
        /// </summary>
        public NetworkInterfaceData0Settings() { }

        /// <summary>
        /// Initializes a new instance of the NetworkInterfaceData0Settings
        /// class.
        /// </summary>
        /// <param name="controllerZeroIp">The controller 0's IPv4
        /// address.</param>
        /// <param name="controllerOneIp">The controller 1's IPv4
        /// address.</param>
        public NetworkInterfaceData0Settings(string controllerZeroIp = default(string), string controllerOneIp = default(string))
        {
            ControllerZeroIp = controllerZeroIp;
            ControllerOneIp = controllerOneIp;
        }

        /// <summary>
        /// Gets or sets the controller 0's IPv4 address.
        /// </summary>
        [JsonProperty(PropertyName = "controllerZeroIp")]
        public string ControllerZeroIp { get; set; }

        /// <summary>
        /// Gets or sets the controller 1's IPv4 address.
        /// </summary>
        [JsonProperty(PropertyName = "controllerOneIp")]
        public string ControllerOneIp { get; set; }

    }
}


text:
As your Flask application grows, you may find that your configuration is coming from all over the place, and it may be difficult to understand what is overriding what. Ordbok adds a strict order of operations as to how the config should be loaded, and tools to specify that a certain variable should be specified later in the chain.

The default configurations has three configuration steps:

1. `config.yml`
2. `local_config.yml`
3. Environmental Variables

YAML already has some structure like this, but the idea behind the `local_config.yml` is for settings that may be dependent of a developers own configuration.

Variables that show up in multiple files will assume the value in the later declaration. Moreover, variables can be declared in earlier files such that they must be found in later file or the environment. This works with the `<namespace>`, which defaults to `ordbok` but can be specified. For example setting `KEY: 'ordbok_local_config'` in `config.yml` will raise an exception if `KEY` isn't specified in `local_config.yml`.

### Private Configuration

Ordbok also has the ability to handle an encrypted config file, which can simplify the process of storing and maintaining secret API keys for your application.

As an example, we add a private config file (e.g. `config/private_config.yml`) to the default configuration:

```
from ordbok import Ordbok
private_config_file = PrivateConfigFile(
    'private_config.yml', envs=['production'])
config = Ordbok(
    custom_config_files=['config.yml', 'local_config.yml',
                         private_config_file]
)
config.load()
```

This configuration only loads the private file in the `'production'` environment, however you can add/change the list of `envs` supplied to the `PrivateConfigFile`.

The `private_config.yml` will contain your unencrypted secret keys, and then encrypted with Ordbok's CLI:

```
ordbok encrypt <path_to_file> <password>
```

In your production environment (or anywhere else you wish to use the private files), simply set `PRIVATE_KEY_ORDBOK` in the environment (or you can set the value under that key in your `Ordbok` instance in your application logic) to decrypt the file in that environment. Of course, this key still needs to be handled with care, but this does simplify the process of updating keys and retaining them in your repository without risk of exposing them.

You can also decrypt locally with the CLI:

```
ordbok decrypt <path_to_file> <password>
```

###OS Environmental Config
Config variables can be loaded from the OS environment just like the YAML config files, and is the last in the hierarchy of config variables sources. Config variables are loaded from the OS environment in two ways:

1. Every environmental variable of the form `ORDBOK_<KEY>` will be loaded into the Ordbok config dict as `'<KEY>':value` (where `value` is the value of the environmental variable.)

2. In any YAML config file, setting `KEY: ordbok_env_conifg_<env_var>` will look for `<ENV_VAR>` in the OS Environment and load the value into the Ordbok config dict as `'KEY': value`.

Specifying `KEY: 'ordbok_env_config'` or `KEY: 'ordbok_env_config_<env_var>'` in any of the YAML config files will raise an exception if `ORDBOK_KEY` isn't specified in the environment.

NOTE: OS Environment variables and Ordbok config dict keys are assumed to be uppercase (`ENV_VAR` and `'KEY'` respectively), even if the value is specified in lowercase (`env_var`.)


text:
using EOLib.Domain.Character;
using System;

namespace EOLib.Domain.Extensions
{
    public static class CharacterExtensions
    {
        public static Character.Character WithAppliedData(this Character.Character original, Character.Character updatedData, bool isRangedWeapon)
        {
            var existingRenderProps = original.RenderProperties;
            var newRenderProps = updatedData.RenderProperties.ToBuilder();

            newRenderProps.CurrentAction = updatedData.RenderProperties.SitState == SitState.Standing
                ? CharacterActionState.Standing
                : CharacterActionState.Sitting;
            newRenderProps.IsDead = existingRenderProps.IsDead;
            newRenderProps.IsRangedWeapon = isRangedWeapon;
            newRenderProps.IsDrunk = existingRenderProps.IsDrunk;
            newRenderProps.IsHidden = existingRenderProps.IsHidden;

            var existingStats = original.Stats;
            var newStats = existingStats
                .WithNewStat(CharacterStat.Level, existingStats[CharacterStat.Level])
                .WithNewStat(CharacterStat.HP, existingStats[CharacterStat.HP])
                .WithNewStat(CharacterStat.MaxHP, existingStats[CharacterStat.MaxHP])
                .WithNewStat(CharacterStat.TP, existingStats[CharacterStat.TP])
                .WithNewStat(CharacterStat.MaxTP, existingStats[CharacterStat.MaxTP]);

            return original
                .WithName(updatedData.Name)
                .WithGuildTag(updatedData.GuildTag)
                .WithMapID(updatedData.MapID)
                .WithRenderProperties(newRenderProps.ToImmutable())
                .WithStats(newStats);
        }

        public static Character.Character WithDamage(this Character.Character original, int damageTaken, bool isDead)
        {
            var stats = original.Stats;
            stats = stats.WithNewStat(CharacterStat.HP, (short)Math.Max(stats[CharacterStat.HP] - damageTaken, 0));

            var props = original.RenderProperties
                .WithIsDead(isDead);

            return original.WithStats(stats).WithRenderProperties(props);
        }
    }
}


text:
<?php

namespace Fxp\Composer\AssetPlugin\Tests\Repository;

use Composer\Config;
use Composer\EventDispatcher\EventDispatcher;
use Composer\IO\IOInterface;
use Fxp\Composer\AssetPlugin\Repository\BowerRepository;

/**
 * Tests of Bower repository.
 *
 * @author François Pluchino <francois.pluchino@gmail.com>
 */
class BowerRepositoryTest extends AbstractAssetsRepositoryTest
{
    /**
     * {@inheritDoc}
     */
    protected function getType()
    {
        return 'bower';
    }

    /**
     * {@inheritDoc}
     */
    protected function getRegistry(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null)
    {
        return new BowerRepository($repoConfig, $io, $config, $eventDispatcher);
    }

    /**
     * {@inheritDoc}
     */
    protected function getMockPackageForVcsConfig()
    {
        return array(
            'url' => 'http://foo.tld',
        );
    }

    /**
     * {@inheritDoc}
     */
    protected function getMockSearchResult($name = 'mock-package')
    {
        return array(
            array(
                'name' => $name,
            ),
        );
    }
}


text:
Executes the Model validation. The validation checks the correctness of the resource shape and checks the unique fields. By overriding the inherited validate() method it is possible to extend or rewrite the validation logic. In case of extending the validation (as opposed to completely rewriting), the inherited validation logic can be called with `parent::validate();`

Before Model::create() and Model::update() the Model::validate() method is called. To change this behaviour the Model::create() and Model::update() methods may be overwritten.

### Parameters ###

*None*

### Returns ###

*void* The method does not return value

### Throws ###

*RestException*

### Example code ###

```php
<?php
namespace YourApp\Logic;

use Fathomminds\Rest\Exceptions\RestException;
use YourApp\Models\FooModel;

class Do
{
    public function something()
    {
        try {
            $resource = new \StdClass;
            $model = new FooModel();
            $model->use($resource);
            $model->validate();
        } catch (RestException $exception) {
            $message = $exception->getMessage();
            $details = $exception->getDetails();
        }
    }
}

```


text:
/**

A square of squares

You like building blocks. You especially like building blocks that are squares. And what you even like more, is to arrange them into a square of square building blocks!

However, sometimes, you can't arrange them into a square. Instead, you end up with an ordinary rectangle! Those blasted things! If you just had a way to know, whether you're currently working in vain… Wait! That's it! You just have to check if your number of building blocks is a perfect square.

Task

Given an integral number, determine if it's a square number:

In mathematics, a square number or perfect square is an integer that is the square of an integer; in other words, it is the product of some integer with itself.
The tests will always use some integral number, so don't worry about that in dynamic typed languages.

Examples

isSquare(-1) // => false
isSquare( 3) // => false
isSquare( 4) // => true
isSquare(25) // => true
isSquare(26) // => false

**/


text:
#ifndef TIMER_H
#define TIMER_H

#include <stdlib.h>
#include <iostream>

#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#else
#include <sys/time.h>
#endif

#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
double PCFreq = 0.0;
__int64 timerStart = 0;
#else
struct timeval timerStart;
#endif

void StartTimer()
{
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
    LARGE_INTEGER li;

    if (!QueryPerformanceFrequency(&li))
    {
        std::cout << "QueryPerformanceFrequency failed!\n" << std::endl;
    }

    PCFreq = (double)li.QuadPart/1000.0;
    QueryPerformanceCounter(&li);
    timerStart = li.QuadPart;
#else
    gettimeofday(&timerStart, NULL);
#endif
}

// time elapsed in ms
double GetTimer()
{
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
    LARGE_INTEGER li;
    QueryPerformanceCounter(&li);
    return (double)(li.QuadPart-timerStart)/PCFreq;
#else
    struct timeval timerStop, timerElapsed;
    gettimeofday(&timerStop, NULL);
    timersub(&timerStop, &timerStart, &timerElapsed);
    return timerElapsed.tv_sec*1000.0+timerElapsed.tv_usec/1000.0;
#endif
}
#endif // TIMER_H


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

<title>Ihmeellinen maailma: Retrokognitio</title>
<meta http-equiv="Content-Type" content />
<link type="image/x-icon" rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="../main.css" />
<link rel="stylesheet" type="text/css" href="ihmeellinen.css" />

Retrokognitio

(engl. retrocognition). Retrokognitio on ilmiö, jossa henkilö tietää menneisyyden tapahtumista ilman päättelyä, tai fyysisin tai tunnetuin aistein hankittua tietoa. Esimerkiksi muistot edellisistä elämistä ovat retrokognitiivisia. Retrokognitio tunnetaan myös postkognition nimellä.

Katso: Parapsykologiset ilmiöt.


text:
using System;
using System.Collections.Generic;
using System.Net;

using NextCallerApi;
using NextCallerApi.Entities;
using NextCallerApi.Entities.Platform;
using NextCallerApi.Exceptions;

using FormatException = NextCallerApi.Exceptions.FormatException;

namespace NextCallerApiSample.NextCallerPlatformClientExamples
{
    public static class CreatePlatformAccount
    {
        public static void Run()
        {
            const string Username = "";
            const string Password = "";
            const bool Sandbox = true;

            NextCallerPlatformClient client = new NextCallerPlatformClient(Username, Password, Sandbox);

            try
            {
                PlatformAccountToPost user = new PlatformAccountToPost
                {
                    Id = "TestUser1",
                    CompanyName = "platform_company1_name",
                    Email = "company_email@company1.com",
                    FirstName = "platform_user1_fname",
                    LastName = "platform_user1_lname"
                };

                client.CreatePlatformAccount(user);

            }
            catch (FormatException formatException)
            {

                HttpWebRequest request = formatException.Request;
                HttpWebResponse response = formatException.Response;

                HttpStatusCode code = response.StatusCode;
                Console.WriteLine("Status code: {0}", code);

                string reasonPhrase = response.StatusDescription;
                Console.WriteLine("Reason Phrase: {0}", reasonPhrase);

                string responseContent = formatException.Content;
                Console.WriteLine("Content : {0}", responseContent);

            }
            catch (BadRequestException badRequestException)
            {

                HttpWebRequest request = badRequestException.Request;
                HttpWebResponse response = badRequestException.Response;

                Error parsedError = badRequestException.Error;

                string errorCode = parsedError.Code;
                string message = parsedError.Message;
                string type = parsedError.Type;

                Dictionary<string, string[]> description = parsedError.Description;

                Console.WriteLine(parsedError.ToString());

            }

        }
    }
}