text:
import bpy, bpy.path, os.path, struct

def get_texture_path(image):
    return os.path.normpath(bpy.path.abspath(image.filepath))

SHADER_TYPES = {
    'RetroShader': b'RSHD',
    'RetroDynamicShader': b'RDYN',
    'RetroDynamicAlphaShader': b'RDAL',
    'RetroDynamicCharacterShader': b'RCHR',
}

PASS_TYPE = {
    'Lightmap': b'LMAP',
    'Diffuse': b'DIFF',
    'DiffuseMod': b'DIFM',
    'Emissive': b'EMIS',
    'Specular': b'SPEC',
    'ExtendedSpecular': b'ESPC',
    'Reflection': b'REFL',
    'IndirectTex': b'INDR',
    'Alpha': b'ALPH',
    'AlphaMod': b'ALPM'
}

def write_chunks(writebuf, mat_obj, mesh_obj):

    if not mat_obj.use_nodes:
        raise RuntimeError("HMDL *requires* that shader nodes are used; '{0}' does not".format(mat_obj.name))

    if 'Output' not in mat_obj.node_tree.nodes or mat_obj.node_tree.nodes['Output'].type != 'GROUP':
        raise RuntimeError("HMDL *requires* that an group shader node named 'Output' is present")

    # Root (output) node
    output_node = mat_obj.node_tree.nodes['Output']
    if output_node.node_tree.name not in SHADER_TYPES:
        raise RuntimeError("HMDL *requires* one of the RetroShader group nodes for the 'Output' node")
    writebuf(SHADER_TYPES[output_node.node_tree.name])

    # Count sockets
    chunk_count = 0
    for inp, def_inp in zip(output_node.inputs, output_node.node_tree.inputs):
        if inp.name in PASS_TYPE:
            if inp.is_linked:
                chunk_count += 1
            else:
                # Color pass
                color_set = False
                if inp.type == 'VALUE':
                    color_set = inp.default_value != def_inp.default_value
                else:
                    for comp, def_comp in zip(inp.default_value, def_inp.default_value):
                        color_set |= comp != def_comp
                if color_set:
                    chunk_count += 1

    writebuf(struct.pack('I', chunk_count))

    # Enumerate sockets
    for inp, def_inp in zip(output_node.inputs, output_node.node_tree.inputs):
        if inp.name in PASS_TYPE:
            pass_fourcc = PASS_TYPE[inp.name]
            if inp.is_linked:
                socket = inp.links[0].from_socket
                node = socket.node
                if node.type != 'TEX_IMAGE':
                    raise RuntimeError("HMDL requires all group node inputs connect to Image Texture nodes")

                if not node.image:
                    raise RuntimeError("HMDL texture nodes must specify an image object")

                if not node.inputs['Vector'].is_linked:
                    raise RuntimeError("HMDL texture nodes must have a 'Texture Coordinate', 'UV Map' or 'Group' UV modifier node linked")

                # Determine matrix generator type
                tex_coord_source = 0xff
                uv_anim_type = 0xff
                uv_anim_args = []
                soc_from = node.inputs['Vector'].links[0].from_socket

                if soc_from.node.type == 'GROUP':
                    if soc_from.node.node_tree.name.startswith('RetroUVMode'):
                        uv_anim_type = int(soc_from.node.node_tree.name[11:12])
                        if len(soc_from.node.inputs)-1:
                            for s in range(len(soc_from.node.inputs)-1):
                                soc = soc_from.node.inputs[s+1]
                                if len(soc.links):
                                    raise RuntimeError("UV Modifier nodes may not have parameter links (default values only)")
                                if soc.type == 'VALUE':
                                    uv_anim_args.append(soc.default_value)
                                else:
                                    uv_anim_args.append(soc.default_value[0])
                                    uv_anim_args.append(soc.default_value[1])
                    soc_from = soc_from.node.inputs[0].links[0].from_socket

                elif soc_from.node.type == 'UVMAP' or soc_from.node.type == 'TEX_COORD':
                    pass

                else:
                    raise RuntimeError("HMDL texture nodes must have a 'Texture Coordinate', 'UV Map' or 'Group' UV modifier node linked")

                if soc_from.node.type != 'UVMAP' and soc_from.node.type != 'TEX_COORD':
                    raise RuntimeError("Matrix animator nodes must connect to 'Texture Coordinate' or 'UV Map' node")

                # Resolve map and matrix index
                node_label = soc_from.node.label
                matrix_idx = None
                if node_label.startswith('MTX_'):
                    matrix_idx = int(node_label[4:])

                if soc_from.name == 'UV':
                    if hasattr(soc_from.node, 'uv_map'):
                        uv_name = soc_from.node.uv_map
                        uv_idx = mesh_obj.data.uv_layers.find(uv_name)
                        if uv_idx == -1:
                            raise RuntimeError('UV Layer "%s" doesn\'t exist' % uv_name)
                        tex_coord_source = uv_idx + 2
                    else:
                        tex_coord_source = 2

                elif soc_from.name == 'Normal':
                    tex_coord_source = 1

                elif soc_from.name == 'Window':
                    tex_coord_source = 0

                else:
                    raise RuntimeError("Only the 'UV', 'Normal' and 'Window' sockets may be used from 'Texture Coordinate' nodes")

                alpha = False
                if socket.name == 'Alpha':
                    alpha = True

                writebuf(b'PASS')
                writebuf(pass_fourcc)
                path = get_texture_path(node.image)
                writebuf(struct.pack('I', len(path)))
                writebuf(path.encode())
                writebuf(struct.pack('B', tex_coord_source))
                writebuf(struct.pack('B', uv_anim_type))
                writebuf(struct.pack('I', len(uv_anim_args)))
                for arg in uv_anim_args:
                    writebuf(struct.pack('f', arg))
                writebuf(struct.pack('B', alpha))

            else:
                # Color pass
                color_set = False
                if inp.type == 'VALUE':
                    color_set = inp.default_value != def_inp.default_value
                else:
                    for comp, def_comp in zip(inp.default_value, def_inp.default_value):
                        color_set |= comp != def_comp

                if color_set:
                    writebuf(b'CLR ')
                    writebuf(pass_fourcc)
                    if inp.type == 'VALUE':
                        writebuf(struct.pack('ffff', inp.default_value, inp.default_value,
                                             inp.default_value, inp.default_value))
                    else:
                        writebuf(struct.pack('ffff', inp.default_value[0], inp.default_value[1],
                                             inp.default_value[2], inp.default_value[3]))


text:
(function() {

  $(document).ready(function() {
    var allRemovableItems, refreshElementRemaining, refreshElementToDelete;
    $("input:text:visible:first").focus();
    allRemovableItems = 0;
    refreshElementRemaining = function() {
      var allCompletedItems;
      allCompletedItems = $("li:not(.completed) ").length;
      return $('#elementsRemaining').html(allCompletedItems);
    };
    refreshElementToDelete = function() {
      this.allRemovableItems = $(".completed").length;
      return $('#clear-completed ').html("Clear completed (" + this.allRemovableItems + ")");
    };
    refreshElementRemaining();
    refreshElementToDelete();
    $('.btnedit').click(function() {
      var that, todoid, url;
      that = this;
      todoid = $(this).data("todoid");
      url = Routing.generate("todo_update", {
        id: todoid
      });
      return $.ajax(url, {
        type: "POST",
        contentType: "application/json",
        success: function(data) {
          if (data.completed === 0) {
            $('.toggle').checked = null;
            $(that).parents("li").removeClass("completed");
          } else {
            $('.toggle').checked = "yes";
            $(that).parents("li").addClass("completed");
          }
          refreshElementRemaining();
          return refreshElementToDelete();
        },
        error: function(xhr, ajaxOptions, thrownError) {
          alert(xhr.status);
          return alert(thrownError);
        }
      });
    });
    return $('#toggle-all').on("click", function() {
      return $('#formtoggle').submit();
    });
  });

}).call(this);

redpajama_set_name: RedPajamaGithub


text:
package com.example.lctse.coolweather.util;

/**
 * Created by LCTSE on 2015/12/17 0017.
 */
public interface HttpCallbackListener {
    void onFinish(String response);

    void onError(Exception e);
}


text:
<!doctype html>

		<title>3DWayfinder WebGL</title>
		<meta charset="utf-8" />
		<meta name="description" content="3DWayfinder WebGL" />
		<link rel="stylesheet" href="style.css" >

Updates:

Average FPS:

Position:

Rotation:

Velocity:

Angular velocity:

		<canvas id="canvas" style="z-index: 1; border: none; position: absolute;" width="500" height="500"></canvas>


text:
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.structuralsearch.impl.matcher.compiler;

import com.intellij.psi.PsiElement;
import com.intellij.psi.XmlRecursiveElementVisitor;
import com.intellij.psi.XmlRecursiveElementWalkingVisitor;
import com.intellij.psi.xml.XmlAttribute;
import com.intellij.psi.xml.XmlTag;
import com.intellij.psi.xml.XmlText;
import com.intellij.psi.xml.XmlToken;
import com.intellij.structuralsearch.impl.matcher.CompiledPattern;
import com.intellij.structuralsearch.impl.matcher.filters.TagValueFilter;
import com.intellij.structuralsearch.impl.matcher.handlers.TopLevelMatchingHandler;

import static com.intellij.structuralsearch.impl.matcher.compiler.GlobalCompilingVisitor.OccurenceKind.TEXT;

/**
* @author Eugene.Kudelevsky
*/
public class XmlCompilingVisitor extends XmlRecursiveElementVisitor {
  final GlobalCompilingVisitor myCompilingVisitor;

  public XmlCompilingVisitor(GlobalCompilingVisitor compilingVisitor) {
    this.myCompilingVisitor = compilingVisitor;
  }

  public void compile(PsiElement[] topLevelElements) {
    final XmlWordOptimizer optimizer = new XmlWordOptimizer();
    final CompiledPattern pattern = myCompilingVisitor.getContext().getPattern();
    for (PsiElement element : topLevelElements) {
      element.accept(this);
      element.accept(optimizer);
      pattern.setHandler(element, new TopLevelMatchingHandler(pattern.getHandler(element)));
    }
  }

  private class XmlWordOptimizer extends XmlRecursiveElementWalkingVisitor implements WordOptimizer {

    @Override
    public void visitXmlTag(XmlTag tag) {
      if (!handleWord(tag.getName(), myCompilingVisitor.getContext())) return;
      super.visitXmlTag(tag);
    }

    @Override
    public void visitXmlAttribute(XmlAttribute attribute) {
      if (!handleWord(attribute.getName(), myCompilingVisitor.getContext())) return;
      handleWord(attribute.getValue(), myCompilingVisitor.getContext());
      super.visitXmlAttribute(attribute);
    }

    @Override
    public void visitXmlText(XmlText text) {
      final String string = text.getText();
      if (!myCompilingVisitor.getContext().getPattern().isTypedVar(string)) {
        myCompilingVisitor.processTokenizedName(string, false, TEXT);
      }
      super.visitXmlText(text);
    }
  }

  @Override public void visitElement(PsiElement element) {
    myCompilingVisitor.handle(element);
    super.visitElement(element);
  }

  @Override
  public void visitXmlToken(XmlToken token) {}

  @Override
  public void visitXmlText(XmlText text) {
    super.visitXmlText(text);
    myCompilingVisitor.setFilterSimple(text, TagValueFilter.getInstance());
  }
}


text:
data = {
    'Character': {
        1: dict(id=1, name='James T. Kirk', species='Human'),
        2: dict(id=2, name='Spock', species='Vulcan/Human'),
        3: dict(id=3, name='Leonard McCoy', species='Human'),
    },
    'Actor': {
        1: dict(id=1, character_id=1, name='William Shatner'),
        2: dict(id=2, character_id=2, name='Leonard Nimoy'),
        3: dict(id=3, character_id=3, name='DeForest Kelley'),
        4: dict(id=4, character_id=1, name='Chris Pine'),
        5: dict(id=5, character_id=2, name='Zachary Quinto'),
        6: dict(id=6, character_id=3, name='Karl Urban'),
    },
}

# graph definition

from collections import defaultdict

from hiku.graph import Graph, Root, Field, Node, Link
from hiku.types import TypeRef, Sequence

def character_data(fields, ids):
    result = []
    for id_ in ids:
        character = data['Character'][id_]
        result.append([character[field.name] for field in fields])
    return result

def actor_data(fields, ids):
    result = []
    for id_ in ids:
        actor = data['Actor'][id_]
        result.append([actor[field.name] for field in fields])
    return result

def character_to_actors_link(ids):
    mapping = defaultdict(list)
    for row in data['Actor'].values():
        mapping[row['character_id']].append(row['id'])
    return [mapping[id_] for id_ in ids]

def actor_to_character_link(ids):
    mapping = {}
    for row in data['Actor'].values():
        mapping[row['id']] = row['character_id']
    return [mapping[id_] for id_ in ids]

def to_characters_link():
    return [1, 2, 3]

GRAPH = Graph([
    Node('Character', [
        Field('id', None, character_data),
        Field('name', None, character_data),
        Field('species', None, character_data),
        Link('actors', Sequence[TypeRef['Actor']],
             character_to_actors_link, requires='id'),
    ]),
    Node('Actor', [
        Field('id', None, actor_data),
        Field('name', None, actor_data),
        Link('character', TypeRef['Character'],
             actor_to_character_link, requires='id'),
    ]),
    Root([
        Link('characters', Sequence[TypeRef['Character']],
             to_characters_link, requires=None),
    ]),
])

# test

from hiku.engine import Engine
from hiku.result import denormalize
from hiku.readers.simple import read
from hiku.executors.sync import SyncExecutor

hiku_engine = Engine(SyncExecutor())

def execute(graph, query_string):
    query = read(query_string)
    result = hiku_engine.execute(graph, query)
    return denormalize(graph, result)

def test_link():
    result = execute(GRAPH, '[{:characters [:name {:actors [:name]}]}]')
    assert result == {
        'characters': [
            {'name': 'James T. Kirk',
             'actors': [{'name': 'William Shatner'},
                        {'name': 'Chris Pine'}]},
            {'name': 'Spock',
             'actors': [{'name': 'Leonard Nimoy'},
                        {'name': 'Zachary Quinto'}]},
            {'name': 'Leonard McCoy',
             'actors': [{'name': 'DeForest Kelley'},
                        {'name': 'Karl Urban'}]},
        ],
    }

def test_link_cycle():
    result = execute(GRAPH, '[{:characters'
                            '  [:name {:actors'
                            '          [:name {:character [:name]}]}]}]')
    assert result == {
        'characters': [
            {'name': 'James T. Kirk',
             'actors': [{'name': 'William Shatner',
                         'character': {'name': 'James T. Kirk'}},
                        {'name': 'Chris Pine',
                         'character': {'name': 'James T. Kirk'}}]},
            {'name': 'Spock',
             'actors': [{'name': 'Leonard Nimoy',
                         'character': {'name': 'Spock'}},
                        {'name': 'Zachary Quinto',
                         'character': {'name': 'Spock'}}]},
            {'name': 'Leonard McCoy',
             'actors': [{'name': 'DeForest Kelley',
                         'character': {'name': 'Leonard McCoy'}},
                        {'name': 'Karl Urban',
                         'character': {'name': 'Leonard McCoy'}}]},
        ],
    }


text:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>
	<mapping
		resource="com/bplow/todo/freemark_ex/dao/entity/TbFreemarkInfo.hbm.xml" />
	<mapping
		resource="com/bplow/todo/freemark_ex/dao/entity/SysDicParamter.hbm.xml" />
</session-factory>
</hibernate-configuration>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IDCM.Data.Base;
using IDCM.Data;
using System.Data;
using IDCM.Service.Common.Core;
using IDCM.Data.Base.Utils;

namespace IDCM.Service.Common.DAM
{
    class CustomTColDefDAM
    {
        /// <summary>
        /// 检查数据表配置存在与否,如不存在则创建默认表属性设定
        /// </summary>
        public static bool checkTableSetting(WorkSpaceManager wsm)
        {
            string cmd = "SELECT * FROM " + typeof(CustomTColDef).Name;
            List<CustomTColDef> ctcds = DataSupporter.ListSQLQuery<CustomTColDef>(wsm, cmd);
            if (ctcds != null && ctcds.Count > 0)
            {
                DataSupporter.queryCacheAttrDBMap(wsm);
                return true;
            }
            else
            {
                DataSupporter.buildDefaultSetting(wsm);
                DataTable table = DataSupporter.SQLQuery(wsm, cmd);
                if (table != null && table.Rows.Count > 0)
                {
                    CustomTColMapDAM.buildCustomTable(wsm);
                    return true;
                }
            }
            return false;
        }

        /// <summary>
        /// 保存一条新实例数据
        /// </summary>
        /// <param name="ctcd"></param>
        /// <returns></returns>
        public static int save(WorkSpaceManager wsm,params CustomTColDef[] ctcds)
        {
            List<string> cmds = new List<string>();
            foreach (CustomTColDef ctcd in ctcds)
            {
                StringBuilder cmdBuilder = new StringBuilder();
                cmdBuilder.Append("insert Or Replace into " + typeof(CustomTColDef).Name
                    + "(attr,attrType,comments,defaultVal,corder,isInter,isRequire,isUnique,restrict) values(");
                cmdBuilder.Append("'").Append(ctcd.Attr).Append("',");
                if (ctcd.AttrType == null)
                    cmdBuilder.Append("null,");
                else
                    cmdBuilder.Append("'").Append(ctcd.AttrType).Append("',");
                if (ctcd.Comments == null)
                    cmdBuilder.Append("null,");
                else
                    cmdBuilder.Append("'").Append(ctcd.Comments).Append("',");
                if (ctcd.DefaultVal == null)
                    cmdBuilder.Append("null,");
                else
                    cmdBuilder.Append("'").Append(ctcd.DefaultVal).Append("',");
                cmdBuilder.Append(ctcd.Corder).Append(",");
                cmdBuilder.Append("'").Append(ctcd.IsInter).Append("',");
                cmdBuilder.Append("'").Append(ctcd.IsRequire).Append("',");
                cmdBuilder.Append("'").Append(ctcd.IsUnique).Append("',");
                if (ctcd.Restrict == null)
                    cmdBuilder.Append("null");
                else
                    cmdBuilder.Append("'").Append(ctcd.Restrict).Append("'");
                cmdBuilder.Append(");");
                cmds.Add(cmdBuilder.ToString());
            }
            if (cmds.Count > 0)
                DataSupporter.executeSQL(wsm, cmds.ToArray());
            return -1;
        }
        /// <summary>
        /// clear all setting
        /// </summary>
        public static void clearAll(WorkSpaceManager wsm)
        {
            string cmd = "delete FROM CustomTColDef";
            DataSupporter.executeSQL(wsm, cmd);
        }
        /// <summary>
        /// 查询所有数据表属性定义对象
        /// </summary>
        /// <returns></returns>
        public static List<CustomTColDef> loadAll(WorkSpaceManager wsm,bool refresh = true)
        {
            if (refresh)
            {
                lock (ctcdCache)
                {
                    ctcdCache.Clear();
                    string cmd = "SELECT * FROM CustomTColDef order by corder";
                    DataTable table = DataSupporter.SQLQuery(wsm, cmd);
                    foreach (DataRow dr in table.Rows)
                    {
                        CustomTColDef ctcd = new CustomTColDef();
                        ctcd.Attr = dr["attr"].ToString();
                        ctcd.AttrType = dr["attrtype"].ToString();
                        ctcd.Comments = dr["comments"].ToString();
                        ctcd.DefaultVal = dr.IsNull("defaultVal") ? null : dr["defaultVal"].ToString();
                        ctcd.Corder = Convert.ToInt32(dr["corder"]);
                        ctcd.IsInter = Convert.ToBoolean(dr["isInter"].ToString());
                        ctcd.IsRequire = Convert.ToBoolean(dr["isRequire"].ToString());
                        ctcd.IsUnique = Convert.ToBoolean(dr["isUnique"].ToString());
                        ctcd.Restrict = dr["restrict"].ToString();
                        ctcdCache.Add(ctcd.Attr, ctcd);
                    }
                }
            }
            return ctcdCache.Values.ToList<CustomTColDef>();
        }
        /// <summary>
        /// 查询所有数据表自定义属性记录
        /// </summary>
        /// <returns></returns>
        public static LinkedList<CustomTColDef> loadCustomAll(WorkSpaceManager wsm)
        {
            LinkedList<CustomTColDef> customList = new LinkedList<CustomTColDef>();
            string cmd = "SELECT * FROM CustomTColDef where isInter='" + false.ToString() + "' order by corder ";
            DataTable table = DataSupporter.SQLQuery(wsm, cmd);
            foreach (DataRow dr in table.Rows)
            {
                CustomTColDef ctcd = new CustomTColDef();
                ctcd.Attr = dr["attr"].ToString();
                ctcd.AttrType = dr["attrtype"].ToString();
                ctcd.Comments = dr["comments"].ToString();
                ctcd.DefaultVal = dr.IsNull("defaultVal") ? null : dr["defaultVal"].ToString();
                ctcd.Corder = Convert.ToInt32(dr["corder"]);
                ctcd.IsInter = Convert.ToBoolean(dr["isInter"].ToString());
                ctcd.IsRequire = Convert.ToBoolean(dr["isRequire"].ToString());
                ctcd.IsUnique = Convert.ToBoolean(dr["isUnique"].ToString());
                ctcd.Restrict = dr["restrict"].ToString();
                customList.AddLast(ctcd);
            }
            return customList;
        }
        public static void appendCustomTColDef(WorkSpaceManager wsm,CustomTColDef ctcd)
        {
            //alter table
            CustomTColMapDAM.alterCustomTable_add(wsm,ctcd);
            //add ctcd
            save(wsm,ctcd);
            //add to ctcdcache
            ctcdCache.Add(ctcd.Attr, ctcd);
        }
        public static void updateCustomTColDef(WorkSpaceManager wsm,CustomTColDef ctcd)
        {
            CustomTColDef pctcd = ctcdCache[ctcd.Attr];
            if (!pctcd.Corder.Equals(ctcd.Corder))
            {
                int viewOrder = ctcd.IsRequire ? ctcd.Corder : (CustomTColMap.MaxMainViewCount + ctcd.Corder);
                DataSupporter.noteDefaultColMap(wsm,ctcd.Attr, ctcd.Corder, viewOrder);
            }
            //update ctcd
            save(wsm, ctcd);
            //update ctcdcache
            ctcdCache[ctcd.Attr] = ctcd;
        }
        /// <summary>
        /// 获取用户自定义表字段声明
        /// </summary>
        /// <param name="attr"></param>
        /// <returns></returns>
        public static CustomTColDef getCustomTColDef(WorkSpaceManager wsm,string attr)
        {
            if (ctcdCache.Count < 1)
                loadAll(wsm);//SELECT * FROM CustomTColDef order by corder
            CustomTColDef ctcd = null;
            ctcdCache.TryGetValue(attr, out ctcd);
            return ctcd;
        }

        /// <summary>
        /// 用户自定义表字段声明缓冲池
        /// </summary>
        protected static Dictionary<string, CustomTColDef> ctcdCache = new Dictionary<string, CustomTColDef>();

    }
}


text:
/**
 * Created by ly on 15-6-29.
 */
var config = require("/config"),
    log = require("bole")("mongoose"),
    mongoose = require("mongoose");

mongoose.connect("mongodb://"+config.mongodb.host+":"+config.mongodb.port+"/"+config.mongodb.schema);
var mongodb = mongoose.connection;
mongodb.on('error', console.error.bind(console, 'connection error:'));
mongodb.once('open', function (callback) {
    log.info("Mongodb open successful!");
});

module.exports = mongodb;


text:
using System.Collections.Generic;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Shell.Interop;

namespace Microsoft.VisualStudioTools.Project
{

    public class EnumDependencies : IVsEnumDependencies
    {
        private List<IVsDependency> dependencyList = new List<IVsDependency>();

        private uint nextIndex;

        public EnumDependencies(IList<IVsDependency> dependencyList)
        {
            Utilities.ArgumentNotNull("dependencyList", dependencyList);

            foreach (IVsDependency dependency in dependencyList)
            {
                this.dependencyList.Add(dependency);
            }
        }

        public EnumDependencies(IList<IVsBuildDependency> dependencyList)
        {
            Utilities.ArgumentNotNull("dependencyList", dependencyList);

            foreach (IVsBuildDependency dependency in dependencyList)
            {
                this.dependencyList.Add(dependency);
            }
        }

        public int Clone(out IVsEnumDependencies enumDependencies)
        {
            enumDependencies = new EnumDependencies(this.dependencyList);
            ErrorHandler.ThrowOnFailure(enumDependencies.Skip(this.nextIndex));
            return VSConstants.S_OK;
        }

        public int Next(uint elements, IVsDependency[] dependencies, out uint elementsFetched)
        {
            elementsFetched = 0;
            Utilities.ArgumentNotNull("dependencies", dependencies);

            uint fetched = 0;
            int count = this.dependencyList.Count;

            while (this.nextIndex < count && elements > 0 && fetched < count)
            {
                dependencies[fetched] = this.dependencyList[(int)this.nextIndex];
                this.nextIndex++;
                fetched++;
                elements--;

            }

            elementsFetched = fetched;

            // Did we get 'em all?
            return (elements == 0 ? VSConstants.S_OK : VSConstants.S_FALSE);
        }

        public int Reset()
        {
            this.nextIndex = 0;
            return VSConstants.S_OK;
        }

        public int Skip(uint elements)
        {
            this.nextIndex += elements;
            uint count = (uint)this.dependencyList.Count;

            if (this.nextIndex > count)
            {
                this.nextIndex = count;
                return VSConstants.S_FALSE;
            }

            return VSConstants.S_OK;
        }
    }
}


text:
#include "modules/audio_processing/agc2/rnn_vad/features_extraction.h"

#include <cmath>
#include <vector>

#include "modules/audio_processing/agc2/rnn_vad/test_utils.h"
// TODO(bugs.webrtc.org/8948): Add when the issue is fixed.
// #include "test/fpe_observer.h"
#include "test/gtest.h"

namespace webrtc {
namespace rnn_vad {
namespace test {
namespace {

constexpr size_t ceil(size_t n, size_t m) {
  return (n + m - 1) / m;
}

// Number of 10 ms frames required to fill a pitch buffer having size
// |kBufSize24kHz|.
constexpr size_t kNumTestDataFrames = ceil(kBufSize24kHz, kFrameSize10ms24kHz);
// Number of samples for the test data.
constexpr size_t kNumTestDataSize = kNumTestDataFrames * kFrameSize10ms24kHz;

// Verifies that the pitch in Hz is in the detectable range.
bool PitchIsValid(float pitch_hz) {
  const size_t pitch_period =
      static_cast<size_t>(static_cast<float>(kSampleRate24kHz) / pitch_hz);
  return kInitialMinPitch24kHz <= pitch_period &&
         pitch_period <= kMaxPitch24kHz;
}

void CreatePureTone(float amplitude, float freq_hz, rtc::ArrayView<float> dst) {
  for (size_t i = 0; i < dst.size(); ++i) {
    dst[i] = amplitude * std::sin(2.f * kPi * freq_hz * i / kSampleRate24kHz);
  }
}

// Feeds |features_extractor| with |samples| splitting it in 10 ms frames.
// For every frame, the output is written into |feature_vector|. Returns true
// if silence is detected in the last frame.
bool FeedTestData(FeaturesExtractor* features_extractor,
                  rtc::ArrayView<const float> samples,
                  rtc::ArrayView<float, kFeatureVectorSize> feature_vector) {
  // TODO(bugs.webrtc.org/8948): Add when the issue is fixed.
  // FloatingPointExceptionObserver fpe_observer;
  bool is_silence = true;
  const size_t num_frames = samples.size() / kFrameSize10ms24kHz;
  for (size_t i = 0; i < num_frames; ++i) {
    is_silence = features_extractor->CheckSilenceComputeFeatures(
        {samples.data() + i * kFrameSize10ms24kHz, kFrameSize10ms24kHz},
        feature_vector);
  }
  return is_silence;
}

}  // namespace

// Extracts the features for two pure tones and verifies that the pitch field
// values reflect the known tone frequencies.
TEST(RnnVadTest, FeatureExtractionLowHighPitch) {
  constexpr float amplitude = 1000.f;
  constexpr float low_pitch_hz = 150.f;
  constexpr float high_pitch_hz = 250.f;
  ASSERT_TRUE(PitchIsValid(low_pitch_hz));
  ASSERT_TRUE(PitchIsValid(high_pitch_hz));

  FeaturesExtractor features_extractor;
  std::vector<float> samples(kNumTestDataSize);
  std::vector<float> feature_vector(kFeatureVectorSize);
  ASSERT_EQ(kFeatureVectorSize, feature_vector.size());
  rtc::ArrayView<float, kFeatureVectorSize> feature_vector_view(
      feature_vector.data(), kFeatureVectorSize);

  // Extract the normalized scalar feature that is proportional to the estimated
  // pitch period.
  constexpr size_t pitch_feature_index = kFeatureVectorSize - 2;
  // Low frequency tone - i.e., high period.
  CreatePureTone(amplitude, low_pitch_hz, samples);
  ASSERT_FALSE(FeedTestData(&features_extractor, samples, feature_vector_view));
  float high_pitch_period = feature_vector_view[pitch_feature_index];
  // High frequency tone - i.e., low period.
  features_extractor.Reset();
  CreatePureTone(amplitude, high_pitch_hz, samples);
  ASSERT_FALSE(FeedTestData(&features_extractor, samples, feature_vector_view));
  float low_pitch_period = feature_vector_view[pitch_feature_index];
  // Check.
  EXPECT_LT(low_pitch_period, high_pitch_period);
}

}  // namespace test
}  // namespace rnn_vad
}  // namespace webrtc


text:
Plugin.define "TinyBB" do
author "Brendan Coles <bcoles@gmail.com>" # 2011-04-17
version "0.1"
description "TinyBB is a free, simple bulletin board script."
website "http://tinybb.net/"

# Google results as at 2011-04-17 #
# 41 for "Proudly powered by TinyBB"

# Dorks #
dorks [
'"Proudly powered by TinyBB"'
]

# Matches #
matches [

# Powered by link
{ :text=>"Proudly powered by TinyBB" },

]

end


text:
<?php

namespace Github\HttpClient\Plugin;

use Http\Client\Common\Plugin;
use Psr\Http\Message\RequestInterface;

/**
 * Prepend the URI with a string.
 *
 * @author Tobias Nyholm <tobias.nyholm@gmail.com>
 */
class PathPrepend implements Plugin
{
    use Plugin\VersionBridgePlugin;

    private $path;

    /**
     * @param string $path
     */
    public function __construct($path)
    {
        $this->path = $path;
    }

    /**
     * {@inheritdoc}
     */
    public function doHandleRequest(RequestInterface $request, callable $next, callable $first)
    {
        $currentPath = $request->getUri()->getPath();
        if (strpos($currentPath, $this->path) !== 0) {
            $uri = $request->getUri()->withPath($this->path.$currentPath);
            $request = $request->withUri($uri);
        }

        return $next($request);
    }
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="Date-Revision-yyyymmdd" content="20170508" />
    <meta http-equiv="Content-Language" content="en" />
    <title>Play! 2.x Source Watcher JDK7 – Selecting Play! 2.x Source Watcher JDK7</title>
    <link rel="stylesheet" href="./css/apache-maven-fluido-1.6.min.css" />
    <link rel="stylesheet" href="./css/site.css" />
    <link rel="stylesheet" href="./css/print.css" media="print" />

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

Play! 2.x Source Watcher JDK7

Last Published: 2017-05-08|

Version: 1.0.0-beta8

Parent Project

Play! 2.x Source Watchers

Overview

Introduction

Usage

JavaDocs

Project Documentation

Project Information

Project Reports

Selecting Play! 2.x Source Watcher JDK7

This file watch service is selected automatically on Linux or Windows machines with Java version 1.7 and later.

If you want to force this service on other operating systems, there are three ways of doing so:

- using project property.

Add <tt>play2.fileWatchService</tt> project property with value <tt>jdk7</tt>.

This is simplest and recommended way.

<project>
    ...
    <properties>
        ...
        <play2.fileWatchService>jdk7</play2.fileWatchService>
    </properties>
    ...
</project>

- using plugin configuration parameter.

Add <tt>fileWatchService</tt> parameter with value <tt>jdk7</tt> to plugin configuration section.

<project>
    ...
    <build>
        ...
        <plugins>
            ...
            <plugin>
                <groupId>com.google.code.play2-maven-plugin</groupId>
                <artifactId>play2-maven-plugin</artifactId>
                <version>1.0.0-beta8</version>
                <extensions>true</extensions>
                <configuration>
                    ...
                    <fileWatchService>jdk7</fileWatchService>
                </configuration>
            </plugin>
            ...
        </plugins>
    </build>
    ...
</project>

- watch service as plugin dependency.

Add file watch service artifact as plugin dependency.

Warning: Only one file watch service can be added as plugin’s dependency at a time. It will be selected regardless of the value of <tt>fileWatchService</tt> plugin configuration parameter or <tt>play2.fileWatchService</tt> project property.

<project>
    ...
    <build>
        ...
        <plugins>
            ...
            <plugin>
                <groupId>com.google.code.play2-maven-plugin</groupId>
                <artifactId>play2-maven-plugin</artifactId>
                <version>1.0.0-beta8</version>
                <extensions>true</extensions>
                <dependencies>
                    <dependency>
                        <groupId>com.google.code.play2-maven-plugin</groupId>
                        <artifactId>play2-source-watcher-jdk7</artifactId>
                        <version>1.0.0-beta8</version>
                    </dependency>
                </dependencies>
            </plugin>
            ...
        </plugins>
    </build>
    ...
</project>

Configuring Play! 2.x Source Watcher JDK7

This service has no configuration parameters.

Copyright ©2013–2017.
All rights reserved.


text:
import Linked_List

def sorted_insert(a, b):
    if a.head == None:
        return b
    elif b.head == None:
        return a
    else:
        first = a.head
        second = b.head
        lst = Linked_List.LinkedList()
        while first != None and second != None:
            if first.data < second.data:
                lst.append(first.data)
                first = first.next
            else:
                lst.append(second.data)
                second = second.next

        if first == None:
            while second != None:
                lst.append(second.data)
                second = second.next
        elif second == None:
            while first != None:
                lst.append(first.data)
                first = first.next
        return lst

a = Linked_List.LinkedList()
a.append(1)
a.append(2)
a.append(3)

b = Linked_List.LinkedList()
b.append(1)
b.append(2)
b.append(3)
a.append(4)

lst = Linked_List.LinkedList()
lst = sorted_insert(a, b)

a.print_list()
b.print_list()
lst.print_list()


text:
<?php
use kartik\grid\GridView;
use yii\helpers\Html;

//This handles the clicking of the refresh button on the grid
$this->registerJs(
    "$(document).on('click', \"#refresh_price_grid\", function()
    	{
    	$.pjax.reload({container:\"#product_pricing_grid\"});
		});"
   );

//Action on adding an ingredient
$this->registerJs(
    "$(document).on('click', '#add_price_button', function()
    	{

    	var allowAdd = ".($product->id != null ? 'true' : '\'\'').";
    	if(!allowAdd)
    		{
			alert('Please save the Product to the database first');
			return;
			}

		var product_id =  ($(this).attr('product_id'));

		$.ajax
  		({
  		url: '".yii\helpers\Url::toRoute("product/ajax-add-price")."',
		data: {product_id: product_id},
		success: function (data, textStatus, jqXHR)
			{
			$('#activity-modal').modal();
			$('.modal-body').html(data);
			},
        error: function (jqXHR, textStatus, errorThrown)
        	{
            console.log('An error occured!');
            alert('Error in ajax request' );
        	}
		});

	});"
   );

//action on submiting the ingredient add form
$this->registerJs("
$('body').on('beforeSubmit', 'form#add-price-form', function () {
     var form = $(this);
     // return false if form still have some validation errors
     if (form.find('.has-error').length) {
          return false;
     }
     // submit form
     $.ajax({
          url: form.attr('action'),
          type: 'post',
          data: form.serialize(),
          success: function (response)
          		{
          		$('#activity-modal').modal('hide');

          		$.pjax.reload({container:'#product_pricing_grid'});
				}
		  });
     return false;
});
");

$this->registerJs(
    "$(document).on('click', '.price_update', function()
    	{
    	var price_id = $(this).closest('tr').data('key');

		$.ajax
  		({
  		url: '".yii\helpers\Url::toRoute("product/ajax-update-price")."',
		data: {id: price_id},
		success: function (data, textStatus, jqXHR)
			{
			$('#activity-modal').modal();
			$('.modal-body').html(data);
			},
        error: function (jqXHR, textStatus, errorThrown)
        	{
            console.log('An error occured!');
            alert('Error in ajax request' );
        	}
		});
   	});"

   );

$this->registerJs(
    "$(document).on('click', '.price_delete', function()
    	{
    	var price_id = $(this).closest('tr').data('key');

		$.ajax
  		({
  		url: '".yii\helpers\Url::toRoute("product/ajax-delete-price")."',
		data: {id: price_id},
		success: function (data, textStatus, jqXHR)
			{
			$.pjax.reload({container:'#product_pricing_grid'});
			},
        error: function (jqXHR, textStatus, errorThrown)
        	{
            console.log('An error occured!');
            alert('Error in ajax request' );
        	}
		});
   	});"

   );

$gridColumns = 	[
			    	[
			    	'attribute' => 'date_valid_from',
			    	'label' => 'Date Price is valid From',
			    	'value' => function ($data)
			    		{
						return date("d M y", strtotime($data->date_valid_from));
						}
			    	],

			    	[
					'attribute' => 'price_pt',
					'label' => 'Price per Ton',
					],
					[
			    	'class' => '\kartik\grid\ActionColumn',
			    	'template' => '{update} {delete}',
			    	'hidden' => $readOnly,
					'buttons' =>
						[
						'delete' => function ($url, $model, $key)
	   						{
           					return Html::a('','#gridTop',
            					[
                				'class' => 'price_delete',
                				'confirm' => 'Delete Price Entry',
                				'title' => 'Delete',
                				'data-pjax' => '0',
              					]);
							},
						'update' => function ($url, $model, $key)
	   						{
           					return Html::a('','#gridTop',
            					[
                				'class' => 'price_update',
                				'title' => 'Update',
                				'data-pjax' => '0',
              					]);
							},
						]

			    	]
				];

$dataProvider = new yii\data\ActiveDataProvider(['query' => $product->getPricings()]);
$dataProvider->setSort(['defaultOrder' => ['date_valid_from'=>SORT_DESC]]);
echo GridView::widget(
				[
				'id' => 'pricings',
				'panel'=>[
		        		'type'=>GridView::TYPE_PRIMARY,
		        		'heading'=>$product->Name." Price List",
		   		 ],
				'headerRowOptions'=>['class'=>'kartik-sheet-style'],
				'toolbar'=>
					[
						['content'=>
							($readOnly ? ' ' : Html::button('', ['type'=>'button', 'title'=>'Add Product', 'id' => 'add_price_button', 'class'=>'btn btn-success', 'product_id' => $product->id])). ' '.
							Html::button('', ['type'=>'button', 'title'=>'Refresh', 'id' => 'refresh_price_grid', 'class'=>'btn btn-success', ])
						],
					],
				'dataProvider'=> $dataProvider,
				//'filterModel'=>$searchModel,
				'columns'=>$gridColumns,
				'containerOptions'=>['style'=>'overflow: auto'], // only set when $responsive = false
				'headerRowOptions'=>['class'=>'kartik-sheet-style'],
				'filterRowOptions'=>['class'=>'kartik-sheet-style'],
				'pjax'=>true,
				'pjaxSettings' =>
					[
					'neverTimeout'=>true,
					'options' =>['id' => 'product_pricing_grid'],

					],
		 		'export' => false,
		 		'showPageSummary' => true,
				]);

?>


text:
#ifndef EVERGREEN_COMPUTE_INTERNAL_H
#define EVERGREEN_COMPUTE_INTERNAL_H

#include "r600_asm.h"

struct r600_kernel {
	unsigned count;
#ifdef HAVE_OPENCL
	LLVMModuleRef llvm_module;
#endif
	struct r600_resource *code_bo;
	struct r600_bytecode bc;
};

struct r600_pipe_compute {
	struct r600_context *ctx;

	unsigned num_kernels;
	struct r600_kernel *kernels;

	struct r600_kernel *active_kernel;
	unsigned local_size;
	unsigned private_size;
	unsigned input_size;
	struct r600_resource *kernel_param;

#ifdef HAVE_OPENCL
	LLVMContextRef llvm_ctx;
#endif
};

struct r600_resource* r600_compute_buffer_alloc_vram(struct r600_screen *screen, unsigned size);

#endif


text:
import apply from './_apply.js';
import arrayMap from './_arrayMap.js';
import baseFlatten from './_baseFlatten.js';
import baseIteratee from './_baseIteratee.js';
import baseRest from './_baseRest.js';
import baseUnary from './_baseUnary.js';
import castRest from './_castRest.js';
import isArray from './isArray.js';

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;

/**
 * Creates a function that invokes `func` with its arguments transformed.
 *
 * @static
 * @since 4.0.0
 * @memberOf _
 * @category Function
 * @param {Function} func The function to wrap.
 * @param {...(Function|Function[])} [transforms=[_.identity]]
 *  The argument transforms.
 * @returns {Function} Returns the new function.
 * @example
 *
 * function doubled(n) {
 *   return n * 2;
 * }
 *
 * function square(n) {
 *   return n * n;
 * }
 *
 * var func = _.overArgs(function(x, y) {
 *   return [x, y];
 * }, [square, doubled]);
 *
 * func(9, 3);
 * // => [81, 6]
 *
 * func(10, 5);
 * // => [100, 10]
 */
var overArgs = castRest(function(func, transforms) {
  transforms = (transforms.length == 1 && isArray(transforms[0]))
    ? arrayMap(transforms[0], baseUnary(baseIteratee))
    : arrayMap(baseFlatten(transforms, 1), baseUnary(baseIteratee));

  var funcsLength = transforms.length;
  return baseRest(function(args) {
    var index = -1,
        length = nativeMin(args.length, funcsLength);

    while (++index < length) {
      args[index] = transforms[index].call(this, args[index]);
    }
    return apply(func, this, args);
  });
});

export default overArgs;


text:
Test is_finite() - wrong params test is_finite()
--FILE--
<?php
is_finite();
is_finite(23,2,true);
?>
--EXPECTF--

Warning: is_finite() expects exactly 1 parameter, 0 given in %s on line 2

Warning: is_finite() expects exactly 1 parameter, 3 given in %s on line 3


text:
/**
 * Available exit codes for an application.
 */
export const enum ExitCode {
  Success,
  Error,
}

/**
 * Internal task event
 */
export interface TaskEvent {
  taskNames: string[];
  inParallel: boolean;
}

/**
 * A task is defined by the markdown and use of key words.
 */
export interface Task {
  name: string;

  script: string;

  description: string;

  type: string;

  before: TaskEvent[];

  after: TaskEvent[];

  [key: string]: string | TaskEvent[];
}

/**
 * Options to pass to the task runner
 */
export interface TaskRunnerOptions {
  task: Task;

  resolve: Function;

  reject: Function;

  cwd: string;
}


text:
package com.asakusafw.lang.compiler.mapreduce;

import static com.asakusafw.lang.compiler.model.description.Descriptions.*;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.LocalFileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
import org.apache.hadoop.mapreduce.lib.partition.HashPartitioner;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import com.asakusafw.lang.compiler.common.testing.FileEditor;
import com.asakusafw.lang.compiler.javac.testing.JavaCompiler;
import com.asakusafw.lang.compiler.mapreduce.testing.MapReduceRunner;
import com.asakusafw.lang.compiler.model.description.ClassDescription;
import com.asakusafw.runtime.core.Result;
import com.asakusafw.runtime.stage.output.StageOutputDriver;
import com.asakusafw.runtime.stage.resource.StageResourceDriver;

/**
 * Test for {@link MapReduceStageEmitter}.
 */
public class MapReduceStageEmitterTest {

    /**
     * Java compiler.
     */
    @Rule
    public final JavaCompiler javac = new JavaCompiler();

    /**
     * temporary folder.
     */
    @Rule
    public final TemporaryFolder folder = new TemporaryFolder();

    /**
     * simple case.
     * @throws Exception if failed
     */
    @Test
    public void simple() throws Exception {
        FileEditor.put(new File(folder.getRoot(), "input/test.txt"), "Hello, world!");
        Path root = new Path(folder.getRoot().toURI());
        Path base = new Path(root, "output");
        ClassDescription client = new ClassDescription("com.example.StageClient");
        MapReduceStageInfo info = new MapReduceStageInfo(
                new StageInfo("simple", "simple", "simple"),
                Arrays.asList(new MapReduceStageInfo.Input(
                        new Path(root, "input/*.txt").toString(),
                        classOf(Text.class),
                        classOf(TextInputFormat.class),
                        classOf(SimpleMapper.class),
                        Collections.emptyMap())),
                Arrays.asList(new MapReduceStageInfo.Output(
                        "out",
                        classOf(NullWritable.class),
                        classOf(Text.class),
                        classOf(TextOutputFormat.class),
                        Collections.emptyMap())),
                Collections.emptyList(),
                base.toString());
        MapReduceStageEmitter.emit(client, info, javac);
        int status = MapReduceRunner.execute(
                new Configuration(),
                client,
                "testing",
                Collections.emptyMap(),
                javac.compile());
        assertThat("exit status code", status, is(0));
        assertThat(collect("output"), contains("Hello, world!"));
    }

    /**
     * w/ reduce.
     * @throws Exception if failed
     */
    @Test
    public void reduce() throws Exception {
        FileEditor.put(new File(folder.getRoot(), "input/test.txt"), "Hello, world!");
        Path root = new Path(folder.getRoot().toURI());
        Path base = new Path(root, "output");
        ClassDescription client = new ClassDescription("com.example.StageClient");
        MapReduceStageInfo info = new MapReduceStageInfo(
                new StageInfo("simple", "simple", "simple"),
                Arrays.asList(new MapReduceStageInfo.Input(
                        new Path(root, "input/*.txt").toString(),
                        classOf(Text.class),
                        classOf(TextInputFormat.class),
                        classOf(Mapper.class),
                        Collections.emptyMap())),
                Arrays.asList(new MapReduceStageInfo.Output(
                        "out",
                        classOf(NullWritable.class),
                        classOf(Text.class),
                        classOf(TextOutputFormat.class),
                        Collections.emptyMap())),
                Collections.emptyList(),
                new MapReduceStageInfo.Shuffle(
                        classOf(LongWritable.class),
                        classOf(Text.class),
                        classOf(HashPartitioner.class),
                        null,
                        classOf(LongWritable.Comparator.class),
                        classOf(LongWritable.Comparator.class),
                        classOf(SimpleReducer.class)),
                base.toString());
        MapReduceStageEmitter.emit(client, info, javac);
        int status = MapReduceRunner.execute(
                new Configuration(),
                client,
                "testing",
                Collections.emptyMap(),
                javac.compile());
        assertThat("exit status code", status, is(0));
        assertThat(collect("output"), contains("Hello, world!"));
    }

    /**
     * w/ resources.
     * @throws Exception if failed
     */
    @Test
    public void resource() throws Exception {
        FileEditor.put(new File(folder.getRoot(), "input/test.txt"), "Hello, input!");
        FileEditor.put(new File(folder.getRoot(), "resource/test.txt"), "Hello, resource!");
        Path root = new Path(folder.getRoot().toURI());
        Path base = new Path(root, "output");
        ClassDescription client = new ClassDescription("com.example.StageClient");
        MapReduceStageInfo info = new MapReduceStageInfo(
                new StageInfo("simple", "simple", "simple"),
                Arrays.asList(new MapReduceStageInfo.Input(
                        new Path(root, "input/*.txt").toString(),
                        classOf(Text.class),
                        classOf(TextInputFormat.class),
                        classOf(ResourceMapper.class),
                        Collections.emptyMap())),
                Arrays.asList(new MapReduceStageInfo.Output(
                        "out",
                        classOf(NullWritable.class),
                        classOf(Text.class),
                        classOf(TextOutputFormat.class),
                        Collections.emptyMap())),
                Arrays.asList(new MapReduceStageInfo.Resource(
                        new Path(root, "resource/*.txt").toString(),
                        "resource")),
                base.toString());
        MapReduceStageEmitter.emit(client, info, javac);
        int status = MapReduceRunner.execute(
                new Configuration(),
                client,
                "testing",
                Collections.emptyMap(),
                javac.compile());
        assertThat("exit status code", status, is(0));
        assertThat(collect("output"), contains("Hello, resource!"));
    }

    private List<String> collect(String path) {
        List<String> results = new ArrayList<>();
        File directory = new File(folder.getRoot(), path);
        for (File file : directory.listFiles()) {
            if (file.isFile() == false) {
                continue;
            }
            String name = file.getName();
            if (name.startsWith(".") || name.startsWith("_")) {
                continue;
            }
            results.addAll(FileEditor.get(file));
        }
        return results;
    }

    @SuppressWarnings("javadoc")
    public static class SimpleMapper<T> extends Mapper<Object, T, Object, T> {

        private StageOutputDriver output;

        private Result<T> result;

        @SuppressWarnings("unchecked")
        @Override
        protected void setup(Context context) throws IOException, InterruptedException {
            this.output = new StageOutputDriver(context);
            this.result = (Result<T>) output.getResultSink("out");
        }

        @Override
        protected void cleanup(Context context) throws IOException, InterruptedException {
            this.output.close();
            this.output = null;
            this.result = null;
        }

        @Override
        protected void map(Object key, T value, Context context) throws IOException, InterruptedException {
            result.add(value);
        }
    }

    @SuppressWarnings("javadoc")
    public static class SimpleReducer<T> extends Reducer<Object, T, Object, T> {

        private StageOutputDriver output;

        private Result<T> result;

        @SuppressWarnings("unchecked")
        @Override
        protected void setup(Context context) throws IOException, InterruptedException {
            this.output = new StageOutputDriver(context);
            this.result = (Result<T>) output.getResultSink("out");
        }

        @Override
        protected void cleanup(Context context) throws IOException, InterruptedException {
            this.output.close();
            this.output = null;
            this.result = null;
        }

        @Override
        protected void reduce(Object key, Iterable<T> values, Context context) throws IOException, InterruptedException {
            for (T value : values) {
                result.add(value);
            }
        }
    }

    @SuppressWarnings("javadoc")
    public static class ResourceMapper extends Mapper<Object, Text, Object, Text> {

        private StageOutputDriver output;

        private Result<Text> result;

        @Override
        protected void setup(Context context) throws IOException, InterruptedException {
            this.output = new StageOutputDriver(context);
            this.result = output.getResultSink("out");
        }

        @Override
        protected void cleanup(Context context) throws IOException, InterruptedException {
            this.output.close();
            this.output = null;
            this.result = null;
        }

        @Override
        public void run(Context context) throws IOException, InterruptedException {
            setup(context);
            try {
                body(context);
            } finally {
                cleanup(context);
            }
        }

        private void body(Context context) throws IOException {
            Text buf = new Text();
            LocalFileSystem fs = FileSystem.getLocal(context.getConfiguration());
            try (StageResourceDriver driver = new StageResourceDriver(context)) {
                for (Path path : driver.findCache("resource")) {
                    File file = fs.pathToFile(path);
                    List<String> lines = FileEditor.get(file);
                    for (String line : lines) {
                        buf.set(line);
                        result.add(buf);
                    }
                }
            }
        }
    }
}


text:
/*
 * Author: 陈志杭 Caspar
 * Contact: 279397942@qq.com qq:279397942
 * Description: 数据契约实体模型文件
 * 文件由模板生成,请不要直接修改文件,如需修改请创建一个对应的partial文件
 */
using System;
using System.Collections;
using System.Collections.Generic;
using Zh.DAL.Define.Entities;
using Zh.DAL.Base.Define.Entities;
namespace Zh.DAL.Define.Entities
{
	#region Car_HighTechConfig

	/// <summary>
    /// 车辆高科技配置
	/// Car_HighTechConfig object for mapped table 'Car_HighTechConfig'.
	/// </summary>
	public partial class Car_HighTechConfig
	{

		#region Constructors

		public Car_HighTechConfig() { }

		public Car_HighTechConfig( Guid iD, bool? hasAutoParkingTech, bool? hasEngineStartStopTech, bool? hasAuxiliary, bool? hasLaneDepartureWarningSystem, bool? hasActiveBrakingSystem, bool? hasActiveSafetySystem, bool? hasActiveSteeringSystem, bool? hasNightViewSystem, bool? hasCenterControlLCDScreenDisplay, bool? hasAdaptiveCruiseControl, bool? hasOverallViewCamera )
		{
			this.ID = iD;
			this.HasAutoParkingTech = hasAutoParkingTech;
			this.HasEngineStartStopTech = hasEngineStartStopTech;
			this.HasAuxiliary = hasAuxiliary;
			this.HasLaneDepartureWarningSystem = hasLaneDepartureWarningSystem;
			this.HasActiveBrakingSystem = hasActiveBrakingSystem;
			this.HasActiveSafetySystem = hasActiveSafetySystem;
			this.HasActiveSteeringSystem = hasActiveSteeringSystem;
			this.HasNightViewSystem = hasNightViewSystem;
			this.HasCenterControlLCDScreenDisplay = hasCenterControlLCDScreenDisplay;
			this.HasAdaptiveCruiseControl = hasAdaptiveCruiseControl;
			this.HasOverallViewCamera = hasOverallViewCamera;
		}
		#endregion

		#region Public Properties
        /// <summary>
        /// ID
        /// </summary>
		public virtual Guid ID { get; set; }
        /// <summary>
        /// 自动泊车入位
        /// </summary>
		public virtual bool? HasAutoParkingTech { get; set; }
        /// <summary>
        /// 发动机启停技术
        /// </summary>
		public virtual bool? HasEngineStartStopTech { get; set; }
        /// <summary>
        /// 并线辅助
        /// </summary>
		public virtual bool? HasAuxiliary { get; set; }
        /// <summary>
        /// 车道偏离预警系统
        /// </summary>
		public virtual bool? HasLaneDepartureWarningSystem { get; set; }
        /// <summary>
        /// 主动刹车系统
        /// </summary>
		public virtual bool? HasActiveBrakingSystem { get; set; }
        /// <summary>
        /// 主动安全系统
        /// </summary>
		public virtual bool? HasActiveSafetySystem { get; set; }
        /// <summary>
        /// 整体主动转向系统
        /// </summary>
		public virtual bool? HasActiveSteeringSystem { get; set; }
        /// <summary>
        /// 夜视系统
        /// </summary>
		public virtual bool? HasNightViewSystem { get; set; }
        /// <summary>
        /// 中控液晶屏分屏显示
        /// </summary>
		public virtual bool? HasCenterControlLCDScreenDisplay { get; set; }
        /// <summary>
        /// 自适应巡航
        /// </summary>
		public virtual bool? HasAdaptiveCruiseControl { get; set; }
        /// <summary>
        /// 全景摄像头
        /// </summary>
		public virtual bool? HasOverallViewCamera { get; set; }

        /// <summary>
        /// 指定车辆表
        /// </summary>
        public virtual Car_MainItem Car_MainItem{get;set;}

		#endregion

	}
	#endregion
}


text:
#include "EventDispatcher.h"

#include <react/core/StateUpdate.h>

#include "BatchedEventQueue.h"
#include "RawEvent.h"
#include "UnbatchedEventQueue.h"

namespace facebook {
namespace react {

EventDispatcher::EventDispatcher(
    EventPipe const &eventPipe,
    StatePipe const &statePipe,
    EventBeat::Factory const &synchonousEventBeatFactory,
    EventBeat::Factory const &asynchonousEventBeatFactory,
    EventBeat::SharedOwnerBox const &ownerBox) {
  // Synchronous/Unbatched
  eventQueues_[(int)EventPriority::SynchronousUnbatched] =
      std::make_unique<UnbatchedEventQueue>(
          eventPipe, statePipe, synchonousEventBeatFactory(ownerBox));

  // Synchronous/Batched
  eventQueues_[(int)EventPriority::SynchronousBatched] =
      std::make_unique<BatchedEventQueue>(
          eventPipe, statePipe, synchonousEventBeatFactory(ownerBox));

  // Asynchronous/Unbatched
  eventQueues_[(int)EventPriority::AsynchronousUnbatched] =
      std::make_unique<UnbatchedEventQueue>(
          eventPipe, statePipe, asynchonousEventBeatFactory(ownerBox));

  // Asynchronous/Batched
  eventQueues_[(int)EventPriority::AsynchronousBatched] =
      std::make_unique<BatchedEventQueue>(
          eventPipe, statePipe, asynchonousEventBeatFactory(ownerBox));
}

void EventDispatcher::dispatchEvent(
    RawEvent const &rawEvent,
    EventPriority priority) const {
  getEventQueue(priority).enqueueEvent(std::move(rawEvent));
}

void EventDispatcher::dispatchStateUpdate(
    StateUpdate &&stateUpdate,
    EventPriority priority) const {
  getEventQueue(priority).enqueueStateUpdate(std::move(stateUpdate));
}

const EventQueue &EventDispatcher::getEventQueue(EventPriority priority) const {
  return *eventQueues_[(int)priority];
}

} // namespace react
} // namespace facebook


text:
package com.yberg.android.flock;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;

import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.Marker;

import org.joda.time.DateTime;

/**
 * Created by Viktor on 2016-10-09.
 */

/**
 * Describes a family member and its marker on the map.
 */
public class Member extends MapLocation {

    private static final float DEFAULT_MARKER_COLOR = BitmapDescriptorFactory.HUE_RED;
    private static int TYPE = MapLocation.MEMBER;

    private DateTime lastUpdated;

    /**
     * Constructs an empty member.
     */
    public Member() {
        this.name = "";
        this._id = "";
        this.familyId = "";
    }

    /**
     * Constructs a member without a marker.
     * @param name The member's name
     * @param _id The member's id
     * @param familyId The member's family id.
     */
    public Member(String name, String _id, String familyId) {
        this(name, _id, familyId, null);
    }

    /**
     * Constructs a member with a marker.
     * @param name The member's name
     * @param _id The member's id
     * @param familyId The member's family id.
     * @param marker The member's map marker.
     */
    public Member(String name, String _id, String familyId, Marker marker) {
        this.name = name;
        this._id = _id;
        this.familyId = familyId;
        this.marker = marker;
        if (marker != null) {
            this.marker.setTitle(name);
            this.marker.setIcon(BitmapDescriptorFactory.defaultMarker(DEFAULT_MARKER_COLOR));
            this.marker.setTag(new Tag(TYPE, this));
        }
    }

    @Override
    public int getType() {
        return TYPE;
    }

    @Override
    public Drawable getIcon(Context context) {
        return ContextCompat.getDrawable(context, R.drawable.ic_account_circle_black_48dp);
    }

    @Override
    public void setDefaultMarkerColor() {
        marker.setIcon(BitmapDescriptorFactory.defaultMarker(DEFAULT_MARKER_COLOR));
    }

    /**
     * Sets the marker.
     * @param marker The marker.
     */
    public void setMarker(Marker marker) {
        this.marker = marker;
        this.marker.setTitle(name);
        this.marker.setIcon(BitmapDescriptorFactory.defaultMarker(DEFAULT_MARKER_COLOR));
        this.marker.setTag(new Tag(TYPE, this));
    }

    /**
     * Sets the last updated timestamp.
     * @param lastUpdated The last update timestamp.
     */
    public void setLastUpdated(DateTime lastUpdated) {
        this.lastUpdated = lastUpdated;
    }

    /**
     * @return The time when the member's position was last updated.
     */
    public String getLastUpdated() {
        StringBuilder s = new StringBuilder();
        if (lastUpdated.getHourOfDay() < 10) {
            s.append("0");
        }
        s.append(lastUpdated.getHourOfDay());
        s.append(":");
        if (lastUpdated.getMinuteOfHour() < 10) {
            s.append("0");
        }
        s.append(lastUpdated.getMinuteOfHour());
        return s.toString();
    }
}


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});

exports.default = function (result, ruleName) {
  var noErrors = true;

  for (var _len = arguments.length, optionDescriptions = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
    optionDescriptions[_key - 2] = arguments[_key];
  }

  optionDescriptions.forEach(validate);

  return noErrors;

  function validate(_ref) {
    var possible = _ref.possible;
    var actual = _ref.actual;
    var optional = _ref.optional;

    var nothingPossible = !possible || Array.isArray(possible) && !possible.length;

    if (nothingPossible && actual === true) {
      return;
    }

    if (actual == null) {
      if (nothingPossible || optional) {
        return;
      }
      complain("Expected option value for rule \"" + ruleName + "\"");
      return;
    } else if (nothingPossible) {
      complain("Unexpected option value \"" + actual + "\" for rule \"" + ruleName + "\"");
      return;
    }

    // If `possible` is a function ...
    if (_lodash2.default.isFunction(possible)) {
      if (!possible(actual)) {
        complain("Invalid option \"" + JSON.stringify(actual) + "\" for rule " + ruleName);
      }
      return;
    }

    // If `possible` is an array instead of an object ...
    if (!_lodash2.default.isPlainObject(possible)) {
      [].concat(actual).forEach(function (a) {
        if (isValid(possible, a)) {
          return;
        }
        complain("Invalid option value \"" + a + "\" for rule \"" + ruleName + "\"");
      });
      return;
    }

    // If possible is an object ...
    if (!_lodash2.default.isPlainObject(actual)) {
      complain("Invalid option value " + JSON.stringify(actual) + " for rule \"" + ruleName + "\": " + "should be an object");
      return;
    }

    Object.keys(actual).forEach(function (optionName) {
      if (ignoredOptions.indexOf(optionName) !== -1) {
        return;
      }

      if (!possible[optionName]) {
        complain("Invalid option name \"" + optionName + "\" for rule \"" + ruleName + "\"");
        return;
      }

      var actualOptionValue = actual[optionName];[].concat(actualOptionValue).forEach(function (a) {
        if (isValid(possible[optionName], a)) {
          return;
        }
        complain("Invalid value \"" + a + "\" for option \"" + optionName + "\" of rule \"" + ruleName + "\"");
      });
    });

    function complain(message) {
      noErrors = false;
      result.warn(message, {
        stylelintType: "invalidOption"
      });
      _lodash2.default.set(result, "stylelint.stylelintError", true);
    }
  }
};

var _lodash = require("lodash");

var _lodash2 = _interopRequireDefault(_lodash);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ignoredOptions = ["severity", "message"];

/**
 * Validate a rule's options.
 *
 * See existing rules for examples.
 *
 * @param {Result} result - postcss result
 * @param {string} ruleName
 * @param {...object} ...optionDescriptions - Each optionDescription can
 *   have the following properties:
 *   	- `actual` (required): the actual passed option value or object.
 *   	- `possible` (required): a schema representation of what values are
 *      valid for those options. `possible` should be an object if the
 *      options are an object, with corresponding keys; if the options are not an
 *      object, `possible` isn't, either. All `possible` value representations
 *      should be **arrays of either values or functions**. Values are === checked
 *      against `actual`. Functions are fed `actual` as an argument and their
 *      return value is interpreted: truthy = valid, falsy = invalid.
 *    - `optional` (optional): If this is `true`, `actual` can be undefined.
 * @return {boolean} Whether or not the options are valid (true = valid)
 */

function isValid(possible, actual) {
  var possibleList = [].concat(possible);
  for (var i = 0, l = possibleList.length; i < l; i++) {
    var possibility = possibleList[i];
    if (typeof possibility === "function" && possibility(actual)) {
      return true;
    }
    if (actual === possibility) {
      return true;
    }
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<shape
    xmlns:android="http://schemas.android.com/apk/res/android">

    <solid android:color="#53ccc3"/>
    <stroke android:color="#7c7c7c" android:width="1px"/>

</shape>


text:
package com.jdroid.gradle.android;

import com.jdroid.gradle.commons.JdroidPom;

import org.gradle.api.Action;
import org.gradle.api.Project;
import org.gradle.api.XmlProvider;
import org.gradle.api.artifacts.Dependency;
import org.gradle.api.artifacts.ExcludeRule;
import org.gradle.api.artifacts.ModuleDependency;
import org.gradle.api.publish.maven.MavenPom;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import groovy.util.Node;

public class AndroidJdroidPom extends JdroidPom {

	private List<CharSequence> configurationNames;
	private Boolean debug;

	public AndroidJdroidPom(List<CharSequence> configurationNames, Boolean debug) {
		this.configurationNames = configurationNames;
		this.debug = debug;
	}

	@Override
	protected void configure(Project project, MavenPom mavenPom) {
		mavenPom.withXml(new Action<XmlProvider>() {
			@Override
			public void execute(XmlProvider xmlProvider) {
				// Creating additional node for dependencies
				Node dependenciesNode = xmlProvider.asNode().appendNode("dependencies");

				Map<String, Dependency> dependenciesMap = new LinkedHashMap<>();

				for (CharSequence configurationName : configurationNames) {
					for (Dependency dependency : project.getConfigurations().getByName(configurationName.toString()).getAllDependencies()) {
						dependenciesMap.put(dependency.getGroup() + ":" + dependency.getName(), dependency);
					}
				}

				for (Dependency dependency : dependenciesMap.values()) {
					if (dependency.getGroup() != null) {
						Node dependencyNode = dependenciesNode.appendNode("dependency");

						// TODO This is only working for jdroid
						String artifactId = dependency.getName();
						if (debug && dependency.getGroup().equals("com.jdroidtools") && artifactId.startsWith("jdroid-android-")) {
							artifactId = artifactId + "-debug";
						}
						dependencyNode.appendNode("groupId", dependency.getGroup());
						dependencyNode.appendNode("artifactId", artifactId);
						dependencyNode.appendNode("version", dependency.getVersion());

						// If there are any exclusions in dependency
						if (dependency instanceof ModuleDependency) {
							ModuleDependency moduleDependency = (ModuleDependency)dependency;
							if (moduleDependency.getExcludeRules().size() > 0) {
								Node exclusionsNode = dependencyNode.appendNode("exclusions");
								for (ExcludeRule excludeRule : moduleDependency.getExcludeRules()) {
									Node exclusionNode = exclusionsNode.appendNode("exclusion");
									if (excludeRule.getGroup() != null) {
										exclusionNode.appendNode("groupId", excludeRule.getGroup());
									}
									if (excludeRule.getModule() != null) {
										exclusionNode.appendNode("artifactId", excludeRule.getModule());
									}
								}
							}
						}
					}
				}
			}
		});
	}
}


text:
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html

#ifndef __CSRMBCS_H
#define __CSRMBCS_H

#include "unicode/utypes.h"

#if !UCONFIG_NO_CONVERSION

#include "csrecog.h"

U_NAMESPACE_BEGIN

// "Character"  iterated character class.
//    Recognizers for specific mbcs encodings make their "characters" available
//    by providing a nextChar() function that fills in an instance of IteratedChar
//    with the next char from the input.
//    The returned characters are not converted to Unicode, but remain as the raw
//    bytes (concatenated into an int) from the codepage data.
//
//  For Asian charsets, use the raw input rather than the input that has been
//   stripped of markup.  Detection only considers multi-byte chars, effectively
//   stripping markup anyway, and double byte chars do occur in markup too.
//
class IteratedChar : public UMemory
{
public:
    uint32_t charValue;             // 1-4 bytes from the raw input data
    int32_t  index;
    int32_t  nextIndex;
    UBool    error;
    UBool    done;

public:
    IteratedChar();
    //void reset();
    int32_t nextByte(InputText* det);
};

class CharsetRecog_mbcs : public CharsetRecognizer {

protected:
    /**
     * Test the match of this charset with the input text data
     *      which is obtained via the CharsetDetector object.
     *
     * @param det  The CharsetDetector, which contains the input text
     *             to be checked for being in this charset.
     * @return     Two values packed into one int  (Damn java, anyhow)
     *

     *             bits 0-7:  the match confidence, ranging from 0-100
     *

     *             bits 8-15: The match reason, an enum-like value.
     */
    int32_t match_mbcs(InputText* det, const uint16_t commonChars[], int32_t commonCharsLen) const;

public:

    virtual ~CharsetRecog_mbcs();

    /**
     * Get the IANA name of this charset.
     * @return the charset name.
     */

    const char *getName() const = 0;
    const char *getLanguage() const = 0;
    UBool match(InputText* input, CharsetMatch *results) const = 0;

    /**
     * Get the next character (however many bytes it is) from the input data
     *    Subclasses for specific charset encodings must implement this function
     *    to get characters according to the rules of their encoding scheme.
     *
     *  This function is not a method of class IteratedChar only because
     *   that would require a lot of extra derived classes, which is awkward.
     * @param it  The IteratedChar "struct" into which the returned char is placed.
     * @param det The charset detector, which is needed to get at the input byte data
     *            being iterated over.
     * @return    True if a character was returned, false at end of input.
     */
    virtual UBool nextChar(IteratedChar *it, InputText *textIn) const = 0;

};

/**
 *   Shift-JIS charset recognizer.
 *
 */
class CharsetRecog_sjis : public CharsetRecog_mbcs {
public:
    virtual ~CharsetRecog_sjis();

    UBool nextChar(IteratedChar *it, InputText *det) const;

    UBool match(InputText* input, CharsetMatch *results) const;

    const char *getName() const;
    const char *getLanguage() const;

};

/**
 *   EUC charset recognizers.  One abstract class that provides the common function
 *             for getting the next character according to the EUC encoding scheme,
 *             and nested derived classes for EUC_KR, EUC_JP, EUC_CN.
 *
 */
class CharsetRecog_euc : public CharsetRecog_mbcs
{
public:
    virtual ~CharsetRecog_euc();

    const char *getName() const = 0;
    const char *getLanguage() const = 0;

    UBool match(InputText* input, CharsetMatch *results) const = 0;
    /*
     *  (non-Javadoc)
     *  Get the next character value for EUC based encodings.
     *  Character "value" is simply the raw bytes that make up the character
     *     packed into an int.
     */
    UBool nextChar(IteratedChar *it, InputText *det) const;
};

/**
 * The charset recognize for EUC-JP.  A singleton instance of this class
 *    is created and kept by the public CharsetDetector class
 */
class CharsetRecog_euc_jp : public CharsetRecog_euc
{
public:
    virtual ~CharsetRecog_euc_jp();

    const char *getName() const;
    const char *getLanguage() const;

    UBool match(InputText* input, CharsetMatch *results) const;
};

/**
 * The charset recognize for EUC-KR.  A singleton instance of this class
 *    is created and kept by the public CharsetDetector class
 */
class CharsetRecog_euc_kr : public CharsetRecog_euc
{
public:
    virtual ~CharsetRecog_euc_kr();

    const char *getName() const;
    const char *getLanguage() const;

    UBool match(InputText* input, CharsetMatch *results) const;
};

/**
 *
 *   Big5 charset recognizer.
 *
 */
class CharsetRecog_big5 : public CharsetRecog_mbcs
{
public:
    virtual ~CharsetRecog_big5();

    UBool nextChar(IteratedChar* it, InputText* det) const;

    const char *getName() const;
    const char *getLanguage() const;

    UBool match(InputText* input, CharsetMatch *results) const;
};

/**
 *
 *   GB-18030 recognizer. Uses simplified Chinese statistics.
 *
 */
class CharsetRecog_gb_18030 : public CharsetRecog_mbcs
{
public:
    virtual ~CharsetRecog_gb_18030();

    UBool nextChar(IteratedChar* it, InputText* det) const;

    const char *getName() const;
    const char *getLanguage() const;

    UBool match(InputText* input, CharsetMatch *results) const;
};

U_NAMESPACE_END

#endif
#endif /* __CSRMBCS_H */


text:
#ifndef HEADER_OPENH264_ENCODER_HPP
#define HEADER_OPENH264_ENCODER_HPP

class CaptureLibrary;

namespace Recorder
{
#ifdef ENABLE_H264
    int openh264Encoder(CaptureLibrary* cl);
#else
    inline int openh264Encoder(CaptureLibrary* cl) { return 0; }
#endif
};
#endif


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mycopathologia 21: 9 (1963)

#### Original name
Gymnoascus longitrichus G.F. Orr & Kuehn, 1963

### Remarks
null


text:
Welcome to transfer_wise ruby gem! The transfer_wise Ruby gem provide a small SDK for convenient access to the TransferWise API from applications written in the Ruby language. It provides a pre-defined set of classes for API resources that initialize themselves dynamically from API responses which allows the bindings to tolerate a number of different versions of the API.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'transfer_wise'
```

And then execute:

    $ bundle install

Or install it yourself as:

    $ gem install transfer_wise

## Usage

The library needs to be configured with environment mode "test" or "live"
```ruby
For live mode
TransferWise.mode = "live"

For test mode
TransferWise.mode = "test"
```
# Development
## Authentication

TransferWise uses OAuth 2 for API authentication and authorization. Calls done in behalf of the user require the access token, other calls require Basic Auth. Please keep in mind that tokens are unique to user and should be stored securely.

```ruby
tw = TransferWise::OAuth.new(client_id, client_secret)
```

```ruby
redirect_url = "www.example.com/callback" # Url where you want user to redirect back after authentication from transferwise
url = tw.authorize_url(redirect_url)
```

This will give you the url where you have to redirect the user to authorize and after authorization you will get redirected to redirect_url with  authentication_code.

```ruby
code = "aqw12q" # some authentication_code from response of authentication
tw.get_access_token(code, redirect_url)
=begin
Response:
{
    "token_type" => "bearer",
         "scope" => "transfers",
   :access_token => "1bceb8d8-4115-4daa-8370-d9bc8de0c732",
  :refresh_token => "6ff3451a-e713-416a-b735-20d8020f6ce2",
     :expires_at => 1487908739
}
=end
```

Store this access token and periodically refresh it before it expires

```ruby
tw.refresh_token(access_token, opts = {refresh_token: refresh_token, expires_at: expires_at})
=begin
Response:
{
  "token_type" => "bearer",
       "scope" => "transfers",
 :access_token => "59e18a25-c84e-4f06-aee4-416c9211a8c8",
:refresh_token => "6ff3451a-e713-416a-b735-20d8020f6ce2",
   :expires_at => 1487873072
}
=end
```

# Anatomy of a TransferWise Transfer
To create the transfers, we need to get profile, quote and target account first.

## Profile
Create a profile as individual or business.
```ruby
profile_request = {
  type: "personal", # or business
  details: {
      firstName: "First name",       # Sender FirstName
      lastName: "Last Name",         # Sender LastName
      dateOfBirth: "1980-07-20",     # sender DOB
      phoneNumber: "+918147001602"   # Sender number in international format
  }
}
profile = TransferWise::Profile.create(profile_request, {access_token: access_token})
```
## Quote
Create a quote
```ruby
quote_request = {
  profile: profile.id,  # got from previous profile response
  source: "USD",        # source currency
  target: "INR",        # target currency
  sourceAmount: "100",  # source amount is amount which sender is going to send. TransferWise will deduct their fees and receipient will receive less money.
  rateType: "FIXED"
}
quote = TransferWise::Quote.create(quote_request, {access_token: access_token})
```
## Account

Next step is to create the account where you want to transfer the money.
If you already have the account you can use that account id and skip this account creation part.

```ruby
account_request = {
  "profile" => profile.id,
  "accountHolderName" => "Account Holder Name",
  "currency" => "INR",     # target currency name
  "country" => "IN",       # target country code
  "type" => "",            # get from account requirements
  "details" => {
      "legalType" => "PRIVATE",
      "accountNumber" => "",     # target account number
      "ifscCode" => "",          # ifsc code or any other field. Get field name finformation from account requirements api. This could be different for other country except india.
      "address" => {             # get address details also from account requirement based on country.
        "city" => "City name",   # city name
        "country" => "IN",       # country code
        "firstLine" => "",       # address first line
        "postCode" => ""         # post code
      }
  }
}
account = TransferWise::Account.create(account_request, {access_token: access_token})
```

## Transfer

Create a transfer
```ruby
transfer_request = {
  "customerTransactionId" => "d57db29d-1060-4ce8-bd5e-800edaf982a9", # some unique uuid format number to identify the transfer.
  "targetAccount" => account.id,
  "quote" => quote.id,
  "details" => {
    "reference" => "Any Comment" # get the field detail, from transfer requirements api before creating the transfer object.
  }
}
transfer = TransferWise::Transfer.create(transfer_request, {access_token: access_token})

```

The Transfer object is created via the TransferWise website. You can go there and make payments to complete the transfer.

# TransferWise Borderless Account
A Borderless Account is a "virtual" bank account that you can control via the TransferWise API, to send funds to external bank accounts (across borders), as well as download statements and view the current balance.

## Borderless Accounts
https://api-docs.transferwise.com/v1/borderless-account/search-account-by-user-profile

Get all the borderless accounts given a `profileId`

```ruby
account_request = { profileId: 1234567 }
account = TransferWise::BorderlessAccount.list(nil, { 'params' => account_request })
```

## Borderless Account
https://api-docs.transferwise.com/v1/borderless-account/get-available-balances

Get a borderless account given a `borderlessAccountId`

```ruby
borderlessAccountId = 123
account = TransferWise::BorderlessAccount.get(borderlessAccountId)
```

## Transactions
https://api-docs.transferwise.com/v1/borderless-account/get-account-statement

Get all the transactions for an account given a `borderlessAccountId`

```ruby
borderlessAccountId = 123
transactions = TransferWise::BorderlessAccount::Transaction.list(nil, { 'params' => { page: '5' } }, resource_id: borderlessAccountId)
```

## Statement
https://api-docs.transferwise.com/v1/borderless-account/get-statement

Get a borderless account statement for a given currency

```ruby
query_string = {
  profileId: 1234567,
  currency: 'GBP',
  startDate: '2017-12-01',
  endDate: '2017-12-07'
}
statement = TransferWise::BorderlessAccount::Statement.list(nil, { 'params' => query_string })
```

## Currencies
https://api-docs.transferwise.com/v1/borderless-account/available-currencies

Get a list of available currencies for your balances

```ruby
TransferWise::BorderlessAccount::BalanceCurrency.list
```


text:
<?xml version="1.0"?>
<Runs Version="1" Minor="0">
	<Run Id="impl_1" LaunchDir="/home/huchao/Daily-Learning/Digital-Logic/lab3_2/lab3_2.runs/impl_1" FlowId="Vivado_Implementation" FromStepId="init_design" ToStepId="write_bitstream"/>
</Runs>


text:
using UnityEngine;
using System.Collections;
using GameController;

public class ShadowText : MonoBehaviour {

    private TextMesh foreGround;
    private TextMesh shadow;

    private Color foreGroundColor = Color.black;
    private Color shadowColor = Color.white;

    private TextAlignment textAlign = TextAlignment.Left;
    private TextAnchor anchor = TextAnchor.UpperLeft;

    private string text;

    void Start()
    {
        foreGround = GameObjectUtility.FindChildWithName(this.gameObject, "ForegroundText").GetComponent<TextMesh>();
        shadow = GameObjectUtility.FindChildWithName(this.gameObject, "ShadowText").GetComponent<TextMesh>();
        SetValues();
    }

    public void SetForeGroundColor(Color color)
    {
        this.foreGroundColor = color;
    }

    public void SetShadowColor(Color color)
    {
        this.shadowColor = color;
    }

    public void SetAlignment(TextAlignment textAlign, TextAnchor anchor)
    {
        this.textAlign = textAlign;
        this.anchor = anchor;
    }

    public void SetText(string text)
    {
        this.text = text;
    }

    private void SetValues()
    {
        foreGround.text = text;
        foreGround.color = foreGroundColor;
        foreGround.alignment = textAlign;
        foreGround.anchor = anchor;
        shadow.text = text;
        shadow.color = shadowColor;
        shadow.alignment = textAlign;
        shadow.anchor = anchor;
    }
}


text:
#ifndef SCANNER_H
#define SCANNER_H

/* this enum holds all token types */
enum {   /* non-single char tokens */
  IDENT_ = 256,
  ASSIGN_,
  REAL_,
  NE_, LE_, GE_,
  OR_, AND_, NOT_,
  WHILE_, DO_, OD_,
  IF_, THEN_, ELSIF_, ELSE_, FI_,
  HOME_, PENUP_, PENDOWN_, FORWARD_, RIGHT_, LEFT_, PUSHSTATE_, POPSTATE_, VAR_
};

/* LVAL can either be a real number or an identifier */
typedef union {     /* lexeme associated with certain tokens */
  float f;          /* /Users/nerdgirl/Documents/School/WSU/Spring2014/CS355/Assignments/yertle2/yertle2/yertle2.xcodeprojREAL_ */
  char *s;          /* IDENT_ */
} LVAL;

extern int lineno;  /* current source code line number */

/*
 * Returns the next token/lexeme read from stdin.
 * Returns 0 when there are no more tokens.
 */
int nextToken(LVAL *lval);

#endif /* SCANNER_H */


text:
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.4.RELEASE</version>
        <relativePath/>
    </parent>
    <artifactId>etl</artifactId>
    <packaging>jar</packaging>
    <version>1.0-SNAPSHOT</version>

    <name>etl</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <spring.boot.version>2.2.4.RELEASE</spring.boot.version>
        <spring.cloud.version>2.1.2.RELEASE</spring.cloud.version>
        <jetcd.version>0.5.0</jetcd.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.8.6</version>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>

        <dependency>
            <groupId>com.robin</groupId>
            <artifactId>common</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <version>${logback.version}</version>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.10</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>27.0-jre</version>
        </dependency>
        <dependency>
            <groupId>com.robin</groupId>
            <artifactId>spring-starter</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.zookeeper</groupId>
            <artifactId>zookeeper</artifactId>
            <version>3.4.6</version>
        </dependency>
        <dependency>
            <groupId>org.apache.curator</groupId>
            <artifactId>curator-recipes</artifactId>
            <version>4.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.curator</groupId>
            <artifactId>curator-framework</artifactId>
            <version>4.0.1</version>
        </dependency>
        <dependency>
            <groupId>io.etcd</groupId>
            <artifactId>jetcd-core</artifactId>
            <version>${jetcd.version}</version>
        </dependency>
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>3.1.0</version>
        </dependency>

    </dependencies>

    <build>
        <sourceDirectory>src/main/java</sourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <classpathPrefix>lib/</classpathPrefix>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>


text:
jQuery.Console = {};
jQuery.Console.log = function(message){};
if(include.options.env == 'development' || include.options.env == 'test'){
	include('console');
}


text:
package gobblin.util;

import java.io.IOException;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import gobblin.source.workunit.WorkUnit;

/**
 * Unit tests for {@link SerializationUtils}.
 *
 * @author Yinan Li
 */
@Test(groups = { "gobblin.util" })
public class SerializationUtilsTest {

  private FileSystem fs;
  private Path outputPath;

  @BeforeClass
  public void setUp() throws IOException {
    this.fs = FileSystem.getLocal(new Configuration());
    this.outputPath = new Path(SerializationUtilsTest.class.getSimpleName());
  }

  @Test
  public void testSerializeState() throws IOException {
    WorkUnit workUnit1 = WorkUnit.createEmpty();
    workUnit1.setProp("foo", "bar");
    workUnit1.setProp("a", 10);
    SerializationUtils.serializeState(this.fs, new Path(this.outputPath, "wu1"), workUnit1);

    WorkUnit workUnit2 = WorkUnit.createEmpty();
    workUnit2.setProp("foo", "baz");
    workUnit2.setProp("b", 20);
    SerializationUtils.serializeState(this.fs, new Path(this.outputPath, "wu2"), workUnit2);
  }

  @Test(dependsOnMethods = "testSerializeState")
  public void testDeserializeState() throws IOException {
    WorkUnit workUnit1 = WorkUnit.createEmpty();
    WorkUnit workUnit2 = WorkUnit.createEmpty();

    SerializationUtils.deserializeState(this.fs, new Path(this.outputPath, "wu1"), workUnit1);
    SerializationUtils.deserializeState(this.fs, new Path(this.outputPath, "wu2"), workUnit2);

    Assert.assertEquals(workUnit1.getPropertyNames().size(), 2);
    Assert.assertEquals(workUnit1.getProp("foo"), "bar");
    Assert.assertEquals(workUnit1.getPropAsInt("a"), 10);

    Assert.assertEquals(workUnit2.getPropertyNames().size(), 2);
    Assert.assertEquals(workUnit2.getProp("foo"), "baz");
    Assert.assertEquals(workUnit2.getPropAsInt("b"), 20);
  }

  @AfterClass
  public void tearDown() throws IOException {
    if (this.fs != null && this.outputPath != null) {
      this.fs.delete(this.outputPath, true);
    }
  }
}


text:
#include "bfunc.h"
#include "bbase.h"

/* Creates, initializes and returns a pointer to a bfunc */
/* This function will do checking to make sure that a function of the same name does not already exist */
struct bfunc *bfunc_create( char *name ) {
    struct bfunc *newfunc = xmalloc( sizeof(struct bfunc) );
    newfunc->name = name;
    newfunc->deque = bdeque_create();
    newfunc->args  = bdeque_create();
    return newfunc;
}

/* Adds the given bfunc to bfuncdb */
void bfuncddb_add( struct bfunc *func ) {
    return;
}


text:
require(['grape', 'resources', 'scenes'], function (Grape, Resources, Scenes) {
    'use strict';

    //START GAME
    var pong = new Grape.Game({
        container: 'game',
        reservedKeys: ['up', 'down']
    });
    Resources.load(function () {
        pong.start(new Scenes.MenuScene());
    });
});


text:
ifndef MAXCOMPILERDIR
  $(error The environment variable MAXCOMPILERDIR is not defined)
endif

all:

build: Makefile.rules
	@java -jar "$(MAXCOMPILERDIR)/lib/MaxIDE/projectAdmin.jar" -u ../.. Vectis
	$(MAKE) -f Makefile.rules build

installer_no_dependencies: Makefile.rules
	@java -jar "$(MAXCOMPILERDIR)/lib/MaxIDE/projectAdmin.jar" -u ../.. Vectis
	$(MAKE) -f Makefile.rules installer_no_dependencies

maxfiles/%.max include/%.h: Makefile.rules
	@java -jar "$(MAXCOMPILERDIR)/lib/MaxIDE/projectAdmin.jar" -u ../.. Vectis
	$(MAKE) -f Makefile.rules $@

clean distclean startsim stopsim: Makefile.rules
	$(MAKE) -f Makefile.rules $@

Makefile.rules: Makefile.settings

Makefile.settings: RunRules.settings
	java -jar "$(MAXCOMPILERDIR)/lib/MaxIDE/projectAdmin.jar" -u ../.. Vectis

.PHONY: all build clean installer_no_dependencies