text:
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.Logging;

namespace OrchardCore.Environment.Extensions.Features
{
    public class FeaturesProvider : IFeaturesProvider
    {
        public const string FeatureProviderCacheKey = "FeatureProvider:Features";

        private static string NameKey = "Name";
        private static string PriorityKey = "Priority";
        private static string DependenciesKey = "Dependencies";
        private static string CategoryKey = "Category";
        private static string DescriptionKey = "Description";

        private readonly IEnumerable<IFeatureBuilderEvents> _featureBuilderEvents;

        private readonly ILogger L;

        public FeaturesProvider(
            IEnumerable<IFeatureBuilderEvents> featureBuilderEvents,
            ILogger<FeaturesProvider> logger)
        {
            _featureBuilderEvents = featureBuilderEvents;
            L = logger;
        }

        public IEnumerable<IFeatureInfo> GetFeatures(
            IExtensionInfo extensionInfo,
            IManifestInfo manifestInfo)
        {
            var features = new List<IFeatureInfo>();

            // Features and Dependencies live within this section
            var featuresSectionChildren = manifestInfo.ConfigurationRoot.GetSection("Features").GetChildren().ToList();
            if (featuresSectionChildren.Count > 0)
            {
                foreach (var featureSection in featuresSectionChildren)
                {
                    var featureId = featureSection.Key;

                    var featureDetails = featureSection.GetChildren().ToDictionary(x => x.Key, v => v.Value);

                    var featureName =
                        featureDetails.ContainsKey(NameKey) ?
                            featureDetails[NameKey] : manifestInfo.Name;

                    var featureDependencyIds = featureDetails.ContainsKey(DependenciesKey) ?
                        featureDetails[DependenciesKey]
                            .Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
                            .Select(e => e.Trim())
                            .ToArray() : new string[0];

                    var manifestFeatureDetails = manifestInfo
                        .ConfigurationRoot.GetChildren().ToDictionary(x => x.Key, v => v.Value);

                    var featurePriority = featureDetails.ContainsKey(PriorityKey) ?
                            int.Parse(featureDetails[PriorityKey]) :
                            (manifestFeatureDetails.ContainsKey(PriorityKey) ? int.Parse(manifestFeatureDetails[PriorityKey]) : 0);

                    var featureCategory =
                        featureDetails.ContainsKey(CategoryKey) ?
                            featureDetails[CategoryKey] :
                            (manifestFeatureDetails.ContainsKey(CategoryKey) ? manifestFeatureDetails[CategoryKey] : null);

                    var featureDescription =
                        featureDetails.ContainsKey(DescriptionKey) ?
                            featureDetails[DescriptionKey] :
                            (manifestFeatureDetails.ContainsKey(DescriptionKey) ? manifestFeatureDetails[DescriptionKey] : null);

                    var context = new FeatureBuildingContext
                    {
                        FeatureId = featureId,
                        FeatureName = featureName,
                        Category = featureCategory,
                        Description = featureDescription,
                        ExtensionInfo = extensionInfo,
                        FeatureDetails = featureDetails,
                        ManifestDetails = manifestFeatureDetails,
                        ManifestInfo = manifestInfo,
                        Priority = featurePriority,
                        FeatureDependencyIds = featureDependencyIds
                    };

                    foreach (var builder in _featureBuilderEvents)
                    {
                        builder.Building(context);
                    }

                    var featureInfo = new FeatureInfo(
                        featureId,
                        featureName,
                        featurePriority,
                        featureCategory,
                        featureDescription,
                        extensionInfo,
                        featureDependencyIds);

                    foreach (var builder in _featureBuilderEvents)
                    {
                        builder.Built(featureInfo);
                    }

                    features.Add(featureInfo);
                }
            }
            else
            {
                // The Extension has only one feature, itself, and that can have dependencies
                var featureId = extensionInfo.Id;
                var featureName = manifestInfo.Name;

                var featureDetails = manifestInfo.ConfigurationRoot.GetChildren().ToDictionary(x => x.Key, v => v.Value);

                var featurePriority = featureDetails.ContainsKey(PriorityKey) ? int.Parse(featureDetails[PriorityKey]) : 0;

                var featureDependencyIds = featureDetails.ContainsKey(DependenciesKey) ?
                    featureDetails[DependenciesKey]
                        .Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
                        .Select(e => e.Trim())
                        .ToArray() : new string[0];

                var featureCategory = featureDetails.ContainsKey(CategoryKey) ? featureDetails[CategoryKey] : null;

                var featureDescription = featureDetails.ContainsKey(DescriptionKey) ? featureDetails[DescriptionKey] : null;

                var context = new FeatureBuildingContext
                {
                    FeatureId = featureId,
                    FeatureName = featureName,
                    Category = featureCategory,
                    Description = featureDescription,
                    ExtensionInfo = extensionInfo,
                    FeatureDetails = featureDetails,
                    ManifestDetails = featureDetails,
                    ManifestInfo = manifestInfo,
                    Priority = featurePriority,
                    FeatureDependencyIds = featureDependencyIds
                };

                foreach (var builder in _featureBuilderEvents)
                {
                    builder.Building(context);
                }

                var featureInfo = new FeatureInfo(
                    context.FeatureId,
                    context.FeatureName,
                    context.Priority,
                    context.Category,
                    context.Description,
                    context.ExtensionInfo,
                    context.FeatureDependencyIds);

                foreach (var builder in _featureBuilderEvents)
                {
                    builder.Built(featureInfo);
                }

                features.Add(featureInfo);
            }

            return features;
        }
    }
}


text:
package filepath

import (
	"strings"
	"syscall"
)

func isSlash(c uint8) bool {
	return c == '\\' || c == '/'
}

func toUpper(c byte) byte {
	if 'a' <= c && c <= 'z' {
		return c - ('a' - 'A')
	}
	return c
}

// isReservedName reports if name is a Windows reserved device name or a console handle.
// It does not detect names with an extension, which are also reserved on some Windows versions.
//
// For details, search for PRN in
// https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file.
func isReservedName(name string) bool {
	if 3 <= len(name) && len(name) <= 4 {
		switch string([]byte{toUpper(name[0]), toUpper(name[1]), toUpper(name[2])}) {
		case "CON", "PRN", "AUX", "NUL":
			return len(name) == 3
		case "COM", "LPT":
			return len(name) == 4 && '1' <= name[3] && name[3] <= '9'
		}
	}
	// Passing CONIN$ or CONOUT$ to CreateFile opens a console handle.
	// https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea#consoles
	//
	// While CONIN$ and CONOUT$ aren't documented as being files,
	// they behave the same as CON. For example, ./CONIN$ also opens the console input.
	if len(name) == 6 && name[5] == '$' && strings.EqualFold(name, "CONIN$") {
		return true
	}
	if len(name) == 7 && name[6] == '$' && strings.EqualFold(name, "CONOUT$") {
		return true
	}
	return false
}

func isLocal(path string) bool {
	if path == "" {
		return false
	}
	if isSlash(path[0]) {
		// Path rooted in the current drive.
		return false
	}
	if strings.IndexByte(path, ':') >= 0 {
		// Colons are only valid when marking a drive letter ("C:foo").
		// Rejecting any path with a colon is conservative but safe.
		return false
	}
	hasDots := false // contains . or .. path elements
	for p := path; p != ""; {
		var part string
		part, p, _ = cutPath(p)
		if part == "." || part == ".." {
			hasDots = true
		}
		// Trim the extension and look for a reserved name.
		base, _, hasExt := strings.Cut(part, ".")
		if isReservedName(base) {
			if !hasExt {
				return false
			}
			// The path element is a reserved name with an extension. Some Windows
			// versions consider this a reserved name, while others do not. Use
			// FullPath to see if the name is reserved.
			//
			// FullPath will convert references to reserved device names to their
			// canonical form: \\.\${DEVICE_NAME}
			//
			// FullPath does not perform this conversion for paths which contain
			// a reserved device name anywhere other than in the last element,
			// so check the part rather than the full path.
			if p, _ := syscall.FullPath(part); len(p) >= 4 && p[:4] == `\\.\` {
				return false
			}
		}
	}
	if hasDots {
		path = Clean(path)
	}
	if path == ".." || strings.HasPrefix(path, `..\`) {
		return false
	}
	return true
}

// IsAbs reports whether the path is absolute.
func IsAbs(path string) (b bool) {
	l := volumeNameLen(path)
	if l == 0 {
		return false
	}
	// If the volume name starts with a double slash, this is an absolute path.
	if isSlash(path[0]) && isSlash(path[1]) {
		return true
	}
	path = path[l:]
	if path == "" {
		return false
	}
	return isSlash(path[0])
}

// volumeNameLen returns length of the leading volume name on Windows.
// It returns 0 elsewhere.
//
// See: https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats
func volumeNameLen(path string) int {
	if len(path) < 2 {
		return 0
	}
	// with drive letter
	c := path[0]
	if path[1] == ':' && ('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') {
		return 2
	}
	// UNC and DOS device paths start with two slashes.
	if !isSlash(path[0]) || !isSlash(path[1]) {
		return 0
	}
	rest := path[2:]
	p1, rest, _ := cutPath(rest)
	p2, rest, ok := cutPath(rest)
	if !ok {
		return len(path)
	}
	if p1 != "." && p1 != "?" {
		// This is a UNC path: \\${HOST}\${SHARE}\
		return len(path) - len(rest) - 1
	}
	// This is a DOS device path.
	if len(p2) == 3 && toUpper(p2[0]) == 'U' && toUpper(p2[1]) == 'N' && toUpper(p2[2]) == 'C' {
		// This is a DOS device path that links to a UNC: \\.\UNC\${HOST}\${SHARE}\
		_, rest, _ = cutPath(rest)  // host
		_, rest, ok = cutPath(rest) // share
		if !ok {
			return len(path)
		}
	}
	return len(path) - len(rest) - 1
}

// cutPath slices path around the first path separator.
func cutPath(path string) (before, after string, found bool) {
	for i := range path {
		if isSlash(path[i]) {
			return path[:i], path[i+1:], true
		}
	}
	return path, "", false
}

// HasPrefix exists for historical compatibility and should not be used.
//
// Deprecated: HasPrefix does not respect path boundaries and
// does not ignore case when required.
func HasPrefix(p, prefix string) bool {
	if strings.HasPrefix(p, prefix) {
		return true
	}
	return strings.HasPrefix(strings.ToLower(p), strings.ToLower(prefix))
}

func splitList(path string) []string {
	// The same implementation is used in LookPath in os/exec;
	// consider changing os/exec when changing this.

	if path == "" {
		return []string{}
	}

	// Split path, respecting but preserving quotes.
	list := []string{}
	start := 0
	quo := false
	for i := 0; i < len(path); i++ {
		switch c := path[i]; {
		case c == '"':
			quo = !quo
		case c == ListSeparator && !quo:
			list = append(list, path[start:i])
			start = i + 1
		}
	}
	list = append(list, path[start:])

	// Remove quotes.
	for i, s := range list {
		list[i] = strings.ReplaceAll(s, `"`, ``)
	}

	return list
}

func abs(path string) (string, error) {
	if path == "" {
		// syscall.FullPath returns an error on empty path, because it's not a valid path.
		// To implement Abs behavior of returning working directory on empty string input,
		// special-case empty path by changing it to "." path. See golang.org/issue/24441.
		path = "."
	}
	fullPath, err := syscall.FullPath(path)
	if err != nil {
		return "", err
	}
	return Clean(fullPath), nil
}

func join(elem []string) string {
	var b strings.Builder
	appendSep := false
	for _, e := range elem {
		// Strip leading slashes from everything after the first element,
		// to avoid creating a UNC path (any path starting with "\\") from
		// non-UNC elements.
		//
		// The correct behavior for Join when the first element is an incomplete UNC
		// path (for example, "\\") is underspecified. We currently join subsequent
		// elements so Join("\\", "host", "share") produces "\\host\share".
		for b.Len() > 0 && len(e) > 0 && isSlash(e[0]) {
			e = e[1:]
		}
		if e == "" {
			continue
		}
		if appendSep {
			b.WriteByte('\\')
		}
		b.WriteString(e)
		appendSep = !isSlash(e[len(e)-1])
		if b.Len() == 2 && volumeNameLen(b.String()) == 2 {
			// If the string is two characters long and consists of nothing but
			// a volume name, this is either a drive ("C:") or the start of an
			// incomplete UNC path ("\\"). In either case, don't append a separator.
			appendSep = false
		}
	}
	if b.Len() == 0 {
		return ""
	}
	return Clean(b.String())
}

// joinNonEmpty is like join, but it assumes that the first element is non-empty.
func joinNonEmpty(elem []string) string {
	if len(elem[0]) == 2 && elem[0][1] == ':' {
		// First element is drive letter without terminating slash.
		// Keep path relative to current directory on that drive.
		// Skip empty elements.
		i := 1
		for ; i < len(elem); i++ {
			if elem[i] != "" {
				break
			}
		}
		return Clean(elem[0] + strings.Join(elem[i:], string(Separator)))
	}
	// The following logic prevents Join from inadvertently creating a
	// UNC path on Windows. Unless the first element is a UNC path, Join
	// shouldn't create a UNC path. See golang.org/issue/9167.
	p := Clean(strings.Join(elem, string(Separator)))
	if !isUNC(p) {
		return p
	}
	// p == UNC only allowed when the first element is a UNC path.
	head := Clean(elem[0])
	if isUNC(head) {
		return p
	}
	// head + tail == UNC, but joining two non-UNC paths should not result
	// in a UNC path. Undo creation of UNC path.
	tail := Clean(strings.Join(elem[1:], string(Separator)))
	if head[len(head)-1] == Separator {
		return head + tail
	}
	return head + string(Separator) + tail
}

// isUNC reports whether path is a UNC path.
func isUNC(path string) bool {
	return len(path) > 1 && isSlash(path[0]) && isSlash(path[1])
}

func sameWord(a, b string) bool {
	return strings.EqualFold(a, b)
}

redpajama_set_name: RedPajamaGithub


text:
var stepped = 0, chunks = 0, rows = 0;
var start, end;
var parser;
var pauseChecked = false;
var printStepChecked = false;

$(function()
{
	$('#submit-parse').click(function()
	{
		stepped = 0;
		chunks = 0;
		rows = 0;

		var txt = $('#input').val();
		var localChunkSize = $('#localChunkSize').val();
		var remoteChunkSize = $('#remoteChunkSize').val();
		var files = $('#files')[0].files;
		var config = buildConfig();

		// NOTE: Chunk size does not get reset if changed and then set back to empty/default value
		if (localChunkSize)
			Papa.LocalChunkSize = localChunkSize;
		if (remoteChunkSize)
			Papa.RemoteChunkSize = remoteChunkSize;

		pauseChecked = $('#step-pause').prop('checked');
		printStepChecked = $('#print-steps').prop('checked');

		if (files.length > 0)
		{
			if (!$('#stream').prop('checked') && !$('#chunk').prop('checked'))
			{
				for (var i = 0; i < files.length; i++)
				{
					if (files[i].size > 1024 * 1024 * 10)
					{
						alert("A file you've selected is larger than 10 MB; please choose to stream or chunk the input to prevent the browser from crashing.");
						return;
					}
				}
			}

			start = performance.now();

			$('#files').parse({
				config: config,
				before: function(file, inputElem)
				{
					console.log("Parsing file:", file);
				},
				complete: function()
				{
					console.log("Done with all files.");
				}
			});
		}
		else
		{
			start = performance.now();
			var results = Papa.parse(txt, config);
			console.log("Synchronous parse results:", results);
		}
	});

	$('#submit-unparse').click(function()
	{
		var input = $('#input').val();
		var delim = $('#delimiter').val();

		var results = Papa.unparse(input, {
			delimiter: delim
		});

		console.log("Unparse complete!");
		console.log("--------------------------------------");
		console.log(results);
		console.log("--------------------------------------");
	});

	$('#insert-tab').click(function()
	{
		$('#delimiter').val('\t');
	});
});

function buildConfig()
{
	return {
		delimiter: $('#delimiter').val(),
		newline: getLineEnding(),
		header: $('#header').prop('checked'),
		dynamicTyping: $('#dynamicTyping').prop('checked'),
		preview: parseInt($('#preview').val() || 0),
		step: $('#stream').prop('checked') ? stepFn : undefined,
		encoding: $('#encoding').val(),
		worker: $('#worker').prop('checked'),
		comments: $('#comments').val(),
		complete: completeFn,
		error: errorFn,
		download: $('#download').prop('checked'),
		fastMode: $('#fastmode').prop('checked'),
		skipEmptyLines: $('#skipEmptyLines').prop('checked'),
		chunk: $('#chunk').prop('checked') ? chunkFn : undefined
	};

	function getLineEnding()
	{
		if ($('#newline-n').is(':checked'))
			return "\n";
		else if ($('#newline-r').is(':checked'))
			return "\r";
		else if ($('#newline-rn').is(':checked'))
			return "\r\n";
		else
			return "";
	}
}

function stepFn(results, parserHandle)
{
	stepped++;
	rows += results.data.length;

	parser = parserHandle;

	if (pauseChecked)
	{
		console.log(results, results.data[0]);
		parserHandle.pause();
		return;
	}

	if (printStepChecked)
		console.log(results, results.data[0]);
}

function chunkFn(results, streamer, file)
{
	if (!results)
		return;
	chunks++;
	rows += results.data.length;

	parser = streamer;

	if (pauseChecked)
	{
		console.log("Pausing; " + results.data.length + " rows in chunk; file:", file);
		streamer.pause();
		return;
	}

	if (printStepChecked)
		console.log("Chunk data:", results.data.length, results);
}

function errorFn(error, file)
{
	console.log("ERROR:", error, file);
}

function completeFn()
{
	end = performance.now();
	if (!$('#stream').prop('checked')
			&& !$('#chunk').prop('checked')
			&& arguments[0]
			&& arguments[0].data)
		rows = arguments[0].data.length;

	console.log("Finished input (async). Time:", end-start, arguments);
	console.log("Rows:", rows, "Stepped:", stepped, "Chunks:", chunks);
}


text:
import { Transactional, TransactionOptions } from '../../transactions';
import { ValidationError } from '../../validation';
import { AnyType } from './any';
import { AttributesContainer, ConstructorOptions } from '../updates';
export declare class AggregatedType extends AnyType {
    type: typeof Transactional;
    clone(value: Transactional): Transactional;
    toJSON(x: any, key: string, options: object): any;
    doInit(value: any, record: AttributesContainer, options: ConstructorOptions): any;
    doUpdate(value: any, record: any, options: any, nested: any[]): boolean;
    canBeUpdated(prev: Transactional, next: any, options: TransactionOptions): any;
    convert(next: any, prev: any, record: AttributesContainer, options: TransactionOptions): Transactional;
    dispose(record: AttributesContainer, value: Transactional): void;
    validate(record: AttributesContainer, value: Transactional): ValidationError;
    create(): Transactional;
    initialize(options: any): void;
    _handleChange(next: Transactional, prev: Transactional, record: AttributesContainer, options: TransactionOptions): void;
}


text:
module SearchableContainerMethods
  abstractmethod :member?

  abstractmethod :insert

  abstractmethod :withdraw

  abstractmethod :find
end

class SearchableContainer < Container
  include SearchableContainerMethods

  def initialize
    super
  end
end

module SearchTreeMethods
  abstractmethod :min

  abstractmethod :max
end

class SearchTree < Tree
  def initialize
    super
  end

  include SearchableContainerMethods
  include SearchTreeMethods
end


text:
package com.atalanda.gpstracker.asyncTasks;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.conn.ssl.X509HostnameVerifier;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.SingleClientConnManager;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONException;
import org.json.JSONObject;

import com.atalanda.gpstracker.LocationCache;

import android.app.ApplicationErrorReport.BatteryInfo;
import android.location.Location;
import android.os.AsyncTask;
import android.os.BatteryManager;
import android.util.Log;
import android.util.Pair;

import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;

public class LocationUploadTask extends AsyncTask<LocationCache, Integer, Boolean> {

  @Override
  protected Boolean doInBackground(LocationCache... cacheEntries) {
    Log.d("Atalanda", "uploading "+cacheEntries.length+" locations");
    for (int i = 0; i < cacheEntries.length; i++) {
      LocationCache locationCache = cacheEntries[i];
      Location location = locationCache.getLocation();

      HostnameVerifier hostnameVerifier = org.apache.http.conn.ssl.SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER;
      HttpClient httpclient = new DefaultHttpClient();

      SchemeRegistry registry = new SchemeRegistry();
      SSLSocketFactory socketFactory = SSLSocketFactory.getSocketFactory();
      socketFactory.setHostnameVerifier((X509HostnameVerifier) hostnameVerifier);
      registry.register(new Scheme("https", socketFactory, 443));
      SingleClientConnManager mgr = new SingleClientConnManager(httpclient.getParams(), registry);
      DefaultHttpClient httpClient = new DefaultHttpClient(mgr, httpclient.getParams());

      // Set verifier
      HttpsURLConnection.setDefaultHostnameVerifier(hostnameVerifier);

      HttpPost httppost = new HttpPost(locationCache.getUrl());
      httppost.setHeader("Content-type", "application/json");

      JSONObject body;
      try {
          body = new JSONObject(locationCache.getParameters());
          body.put("verticalAccuracy", null);
          body.put("horizontalAccuracy", location.getAccuracy());
          body.put("heading", location.getBearing());
          body.put("latitude", location.getLatitude());
          body.put("longitude", location.getLongitude());
          body.put("velocity", location.getSpeed());
          body.put("batteryLevel", locationCache.getBatteryLevel());
          body.put("timestamp", locationCache.getTimestamp());

          httppost.setEntity(new StringEntity(body.toString()));
          httppost.addHeader(locationCache.getAdditionalHeaderKey(), locationCache.getAdditionalHeaderValue());
			} catch (JSONException e) {
				Log.e("JSONException", e.getMessage());
				continue;
			} catch (UnsupportedEncodingException e) {
				Log.e("UnsupportedEncodingExcp", e.getMessage());
				continue;
			}

        Log.d("uploading position", "to "+locationCache.getUrl());

        try {
            // Execute HTTP Post Request
            HttpResponse response = httpclient.execute(httppost);
            Log.d("upload response code", response.getStatusLine().toString());
        } catch (ClientProtocolException e) {
            // TODO Auto-generated catch block
          Log.e("upload failed", e.getLocalizedMessage());
        } catch (IOException e) {
            // TODO Auto-generated catch block
          Log.e("upload failed", e.getLocalizedMessage());
        }

    }

    return true;
  }
}


text:
package org.apache.drill.exec.expr.fn.impl;

import org.apache.drill.exec.expr.fn.impl.RegexpUtil.SqlPatternInfo;

public class SqlPatternFactory {
  public static SqlPatternMatcher getSqlPatternMatcher(SqlPatternInfo patternInfo)
  {
    switch (patternInfo.getPatternType()) {
      case COMPLEX:
        return new SqlPatternComplexMatcher(patternInfo.getJavaPatternString());
      case STARTS_WITH:
        return new SqlPatternStartsWithMatcher(patternInfo.getSimplePatternString());
      case CONSTANT:
        return new SqlPatternConstantMatcher(patternInfo.getSimplePatternString());
      case ENDS_WITH:
        return new SqlPatternEndsWithMatcher(patternInfo.getSimplePatternString());
      case CONTAINS:
        return new SqlPatternContainsMatcher(patternInfo.getSimplePatternString());
      default:
        break;
    }

    return null;
  }
}


text:
// .NAME vtkStructuredGridWriter - write vtk structured grid data file
// .SECTION Description
// vtkStructuredGridWriter is a source object that writes ASCII or binary
// structured grid data files in vtk format. See text for format details.

// .SECTION Caveats
// Binary files written on one system may not be readable on other systems.

#ifndef __vtkStructuredGridWriter_h
#define __vtkStructuredGridWriter_h

#include "vtkIOGeometryModule.h" // For export macro
#include "vtkDataWriter.h"

class vtkStructuredGrid;

class VTKIOGEOMETRY_EXPORT vtkStructuredGridWriter : public vtkDataWriter
{
public:
  static vtkStructuredGridWriter *New();
  vtkTypeMacro(vtkStructuredGridWriter,vtkDataWriter);
  void PrintSelf(ostream& os, vtkIndent indent);

  // Description:
  // Get the input to this writer.
  vtkStructuredGrid* GetInput();
  vtkStructuredGrid* GetInput(int port);

protected:
  vtkStructuredGridWriter() {};
  ~vtkStructuredGridWriter() {};

  void WriteData();
  int WriteBlanking(ostream *fp, vtkStructuredGrid *ds);

  virtual int FillInputPortInformation(int port, vtkInformation *info);

private:
  vtkStructuredGridWriter(const vtkStructuredGridWriter&);  // Not implemented.
  void operator=(const vtkStructuredGridWriter&);  // Not implemented.
};

#endif


text:
1. Convert exported objects to ES6 classes.
2. Documents controller: remove owner check.


text:
'use strict';

exports.__esModule = true;

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _core = require('../../core');

var core = _interopRequireWildcard(_core);

var _BlurXFilter = require('./BlurXFilter');

var _BlurXFilter2 = _interopRequireDefault(_BlurXFilter);

var _BlurYFilter = require('./BlurYFilter');

var _BlurYFilter2 = _interopRequireDefault(_BlurYFilter);

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

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

/**
 * The BlurFilter applies a Gaussian blur to an object.
 * The strength of the blur can be set for x- and y-axis separately.
 *
 * @class
 * @extends PIXI.Filter
 * @memberof PIXI.filters
 */
var BlurFilter = function (_core$Filter) {
    _inherits(BlurFilter, _core$Filter);

    /**
     * @param {number} strength - The strength of the blur filter.
     * @param {number} quality - The quality of the blur filter.
     * @param {number} resolution - The resolution of the blur filter.
     * @param {number} [kernelSize=5] - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.
     */
    function BlurFilter(strength, quality, resolution, kernelSize) {
        _classCallCheck(this, BlurFilter);

        var _this = _possibleConstructorReturn(this, _core$Filter.call(this));

        _this.blurXFilter = new _BlurXFilter2.default(strength, quality, resolution, kernelSize);
        _this.blurYFilter = new _BlurYFilter2.default(strength, quality, resolution, kernelSize);

        _this.padding = 0;
        _this.resolution = resolution || core.settings.RESOLUTION;
        _this.quality = quality || 4;
        _this.blur = strength || 8;
        return _this;
    }

    /**
     * Applies the filter.
     *
     * @param {PIXI.FilterManager} filterManager - The manager.
     * @param {PIXI.RenderTarget} input - The input target.
     * @param {PIXI.RenderTarget} output - The output target.
     */

    BlurFilter.prototype.apply = function apply(filterManager, input, output) {
        var renderTarget = filterManager.getRenderTarget(true);

        this.blurXFilter.apply(filterManager, input, renderTarget, true);
        this.blurYFilter.apply(filterManager, renderTarget, output, false);

        filterManager.returnRenderTarget(renderTarget);
    };

    /**
     * Sets the strength of both the blurX and blurY properties simultaneously
     *
     * @member {number}
     * @default 2
     */

    _createClass(BlurFilter, [{
        key: 'blur',
        get: function get() {
            return this.blurXFilter.blur;
        },
        set: function set(value) // eslint-disable-line require-jsdoc
        {
            this.blurXFilter.blur = this.blurYFilter.blur = value;
            this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2;
        }

        /**
         * Sets the number of passes for blur. More passes means higher quaility bluring.
         *
         * @member {number}
         * @default 1
         */

    }, {
        key: 'quality',
        get: function get() {
            return this.blurXFilter.quality;
        },
        set: function set(value) // eslint-disable-line require-jsdoc
        {
            this.blurXFilter.quality = this.blurYFilter.quality = value;
        }

        /**
         * Sets the strength of the blurX property
         *
         * @member {number}
         * @default 2
         */

    }, {
        key: 'blurX',
        get: function get() {
            return this.blurXFilter.blur;
        },
        set: function set(value) // eslint-disable-line require-jsdoc
        {
            this.blurXFilter.blur = value;
            this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2;
        }

        /**
         * Sets the strength of the blurY property
         *
         * @member {number}
         * @default 2
         */

    }, {
        key: 'blurY',
        get: function get() {
            return this.blurYFilter.blur;
        },
        set: function set(value) // eslint-disable-line require-jsdoc
        {
            this.blurYFilter.blur = value;
            this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2;
        }
    }]);

    return BlurFilter;
}(core.Filter);

exports.default = BlurFilter;
//# sourceMappingURL=BlurFilter.js.map


text:
<!DOCTYPE html>

    <meta charset="UTF-8" />
    <meta name="robots" content="index, follow, all" />
    <title>Thelia\Core\Event\Cart\CartCreateEvent | Thelia 2 API</title>

            <link rel="stylesheet" type="text/css" href="../../../../css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="../../../../css/bootstrap-theme.min.css">
        <link rel="stylesheet" type="text/css" href="../../../../css/sami.css">

        <meta name="MobileOptimized" content="width">
        <meta name="HandheldFriendly" content="true">
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">

                <form id="search-form" action="../../../../search.html" method="GET">

            <input name="search"
                   class="typeahead form-control"
                   type="search"
                   placeholder="Search">
        </form>

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-elements">
                    Toggle navigation

                </button>
                Thelia 2 API

Classes

Namespaces

Interfaces

Traits

Index

Search

class

Thelia

Core

Event

Cart

CartCreateEvent

CartCreateEvent

    class
    CartCreateEvent        extends ActionEvent

Methods

                    __set($name, $value)

No description

from
    ActionEvent

                    __get($name)

No description

from
    ActionEvent

                    bindForm(
    Form $form)

No description

from
    ActionEvent

    Cart

                    getCart()

No description

    $this

                    setCart(
    Cart $cart)

No description

Details

in
    ActionEvent at line 30

    __set($name, $value)

Parameters

                $name

                $value

in
    ActionEvent at line 35

    __get($name)

Parameters

                $name

in
    ActionEvent at line 44

    bindForm(
    Form $form)

Parameters

    Form
                $form

at line 25

    Cart
    getCart()

Return Value

    Cart

at line 35

    $this
    setCart(
    Cart $cart)

Parameters

    Cart
                $cart

Return Value

    $this

        Generated by Sami, the API Documentation Generator.


text:
  Andrézieux-Bouthéon est
      une commune localisée dans le département de Loire en Rhône-Alpes. Elle comptait 9 508 habitants en 2008.

La commune dispose en ce qui concerne l'enseignement aux enfants de un collège et un lycée.
Concernant les plus jeunes, la commune est équipée de deux maternelles et cinq écoles primaires.
Andrézieux-Bouthéon est équipée des  équipements éducatifs permettant une vie locale facilitée.
Si vous avez un projet d'acheter un appartement ou une maison à Andrézieux-Bouthéon, il est important regarder la qualité des écoles de la communes

À coté de Andrézieux-Bouthéon sont situées les communes de
Veauche située à 4 km, 8 276 habitants,
Saint-Just-Saint-Rambert située à 2 km, 14 809 habitants,
Saint-Héand à 5 km, 3 699 habitants,
Saint-Cyprien à 2 km, 2 375 habitants,
Craintilleux à 6 km, 1 082 habitants,
Veauchette située à 4 km, 834 habitants,
 entre autres. De plus, Andrézieux-Bouthéon est située à seulement treize km de Saint-Étienne.

Le nombre de logements, à Andrézieux-Bouthéon, était réparti en 2011 en 2 160 appartements et 1 936 maisons soit
 un marché relativement équilibré.

À Andrézieux-Bouthéon le salaire médian mensuel par habitant se situe à environ 1 994 €  net. Ceci est au dessous de la moyenne nationale.

La commune offre de multiples  aménagements, elle dispose, entre autres, de un bassin de natation, deux terrains de tennis, trois terrains de sport et une boucle de randonnée.

À Andrézieux-Bouthéon, la valeur moyenne à la vente d'un appartement s'évalue à 1 809 € du m² en vente. Le prix moyen d'une maison à l'achat se situe à 1 798 € du m². À la location le prix moyen se situe à 11,73 € du m² par mois.


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

.. _board_teensy_teensy41:

Teensy 4.1
==========

.. contents::

Hardware
--------

Platform :ref:`platform_teensy`: Teensy is a complete USB-based microcontroller development system, in a very small footprint, capable of implementing many types of projects. All programming is done via the USB port. No special programmer is needed, only a standard USB cable and a PC or Macintosh with a USB port.

.. list-table::

  * - **Microcontroller**
    - IMXRT1062
  * - **Frequency**
    - 600MHz
  * - **Flash**
    - 7.75MB
  * - **RAM**
    - 512KB
  * - **Vendor**
    - `Teensy <https://www.pjrc.com/store/teensy41.html?utm_source=platformio.org&utm_medium=docs>`__

Configuration
-------------

Please use ``teensy41`` ID for :ref:`projectconf_env_board` option in :ref:`projectconf`:

.. code-block:: ini

  [env:teensy41]
  platform = teensy
  board = teensy41

You can override default Teensy 4.1 settings per build environment using
``board_***`` option, where ``***`` is a JSON object path from
board manifest `teensy41.json <https://github.com/platformio/platform-teensy/blob/master/boards/teensy41.json>`_. For example,
``board_build.mcu``, ``board_build.f_cpu``, etc.

.. code-block:: ini

  [env:teensy41]
  platform = teensy
  board = teensy41

  ; change microcontroller
  board_build.mcu = imxrt1062

  ; change MCU frequency
  board_build.f_cpu = 600000000L

Uploading
---------
Teensy 4.1 supports the following uploading protocols:

* ``jlink``
* ``teensy-cli``
* ``teensy-gui``

Default protocol is ``teensy-gui``

You can change upload protocol using :ref:`projectconf_upload_protocol` option:

.. code-block:: ini

  [env:teensy41]
  platform = teensy
  board = teensy41

  upload_protocol = teensy-gui

Debugging
---------

:ref:`piodebug` - "1-click" solution for debugging with a zero configuration.

.. warning::
    You will need to install debug tool drivers depending on your system.
    Please click on compatible debug tool below for the further
    instructions and configuration information.

You can switch between debugging :ref:`debugging_tools` using
:ref:`projectconf_debug_tool` option in :ref:`projectconf`.

Teensy 4.1 does not have on-board debug probe and **IS NOT READY** for debugging. You will need to use/buy one of external probe listed below.

.. list-table::
  :header-rows:  1

  * - Compatible Tools
    - On-board
    - Default
  * - :ref:`debugging_tool_jlink`
    -
    - Yes

Frameworks
----------
.. list-table::
    :header-rows:  1

    * - Name
      - Description

    * - :ref:`framework_arduino`
      - Arduino Wiring-based Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences

    * - :ref:`framework_zephyr`
      - The Zephyr Project is a scalable real-time operating system (RTOS) supporting multiple hardware architectures, optimized for resource constrained devices, and built with safety and security in mind


text:
"""IPA-GNN models."""

from typing import Any

from flax import linen as nn
import jax
import jax.numpy as jnp

from core.data import error_kinds
from core.modules.ipagnn import compressive_ipagnn
from core.modules.ipagnn import encoder
from core.modules.ipagnn import ipagnn
from core.modules.ipagnn import logit_math
from core.modules.ipagnn import spans
from core.modules.ipagnn import raise_contributions as raise_contributions_lib
from third_party.flax_examples import transformer_modules

class IPAGNN(nn.Module):

  config: Any
  info: Any
  transformer_config: transformer_modules.TransformerConfig
  docstring_transformer_config: transformer_modules.TransformerConfig

  def setup(self):
    config = self.config
    vocab_size = self.info.vocab_size
    max_tokens = config.max_tokens
    max_num_nodes = config.max_num_nodes
    max_num_edges = config.max_num_edges
    max_steps = config.max_steps
    self.node_span_encoder = spans.NodeSpanEncoder(
        info=self.info,
        config=config,
        transformer_config=self.transformer_config,
        max_tokens=max_tokens,
        max_num_nodes=max_num_nodes,
        use_span_index_encoder=False,
        use_span_start_indicators=False,
    )
    if config.use_film or config.use_cross_attention:
      self.docstring_token_encoder = encoder.TokenEncoder(
          transformer_config=self.docstring_transformer_config,
          num_embeddings=vocab_size,
          features=config.hidden_size,
      )
      self.docstring_encoder = encoder.TransformerEncoder(
          config=self.docstring_transformer_config)

    if config.use_compressive_ipagnn:
      self.ipagnn = compressive_ipagnn.SkipIPAGNN(
          config=config,
          info=self.info,
          max_steps=max_steps,
      )
    else:
      self.ipagnn = ipagnn.IPAGNNModule(
          info=self.info,
          config=config,
          max_steps=max_steps,
      )

  @nn.compact
  def __call__(self, x):
    config = self.config
    info = self.info
    tokens = x['tokens']
    docstring_tokens = x['docstring_tokens']
    # tokens.shape: batch_size, max_tokens
    batch_size = tokens.shape[0]
    encoded_inputs = self.node_span_encoder(
        tokens, x['node_token_span_starts'], x['node_token_span_ends'],
        x['num_nodes'])
    # encoded_inputs.shape: batch_size, max_num_nodes, hidden_size
    if config.use_film or config.use_cross_attention:
      docstring_token_embeddings = self.docstring_token_encoder(
          docstring_tokens)
      docstring_mask = docstring_tokens > 0
      docstring_encoder_mask = nn.make_attention_mask(
          docstring_mask, docstring_mask, dtype=jnp.float32)
      # docstring_token_embeddings.shape: batch_size, max_tokens, hidden_size
      docstring_embeddings = self.docstring_encoder(
          docstring_token_embeddings,
          encoder_mask=docstring_encoder_mask)
    else:
      docstring_embeddings = None
      docstring_mask = None
    ipagnn_output = self.ipagnn(
        node_embeddings=encoded_inputs,
        docstring_embeddings=docstring_embeddings,
        docstring_mask=docstring_mask,
        edge_sources=x['edge_sources'],
        edge_dests=x['edge_dests'],
        edge_types=x['edge_types'],
        true_indexes=x['true_branch_nodes'],
        false_indexes=x['false_branch_nodes'],
        raise_indexes=x['raise_nodes'],
        start_node_indexes=x['start_index'],
        exit_node_indexes=x['exit_index'],
        post_domination_matrix=x['post_domination_matrix'],
        step_limits=x['step_limit'],
    )
    # ipagnn_output['exit_node_embeddings'].shape: batch_size, hidden_size
    # ipagnn_output['raise_node_embeddings'].shape: batch_size, hidden_size
    # ipagnn_output['exit_node_instruction_pointer'].shape: batch_size
    # ipagnn_output['raise_node_instruction_pointer'].shape: batch_size

    exit_node_embeddings = ipagnn_output['exit_node_embeddings']
    # exit_node_embeddings.shape: batch_size, hidden_size
    exit_node_instruction_pointer = ipagnn_output['exit_node_instruction_pointer']
    # exit_node_instruction_pointer.shape: batch_size

    num_classes = info.num_classes
    if config.raise_in_ipagnn:
      raise_node_embeddings = ipagnn_output['raise_node_embeddings']
      # raise_node_embeddings.shape: batch_size, hidden_size
      raise_node_instruction_pointer = ipagnn_output['raise_node_instruction_pointer']
      # raise_node_instruction_pointer.shape: batch_size
      if len(info.no_error_ids) == 1:
        # Multiple error classes; only one No-Error class.
        no_error_id = info.no_error_ids[0]
        logits = nn.Dense(
            features=num_classes, name='output'
        )(raise_node_embeddings)  # P(e | yes exception)
        # logits.shape: batch_size, num_classes
        logits = logits.at[:, no_error_id].set(-jnp.inf)

        no_error_logits = jax.vmap(logit_math.get_additional_logit)(
            exit_node_instruction_pointer + 1e-9,
            raise_node_instruction_pointer + 1e-9,
            logits)
        # no_error_logits.shape: batch_size
        logits = logits.at[:, no_error_id].set(no_error_logits)
      elif len(info.no_error_ids) > 1:
        # Multiple No-Error classes; only one error class.
        if len(info.error_ids) > 1:
          raise NotImplementedError('Multiple error classes and multiple no-error classes.')
        assert len(info.error_ids) == 1
        error_id = info.error_ids[0]
        logits = nn.Dense(
            features=num_classes, name='output'
        )(exit_node_embeddings)  # P(e | no exception)
        # logits.shape: batch_size, num_classes
        logits = logits.at[:, error_id].set(-jnp.inf)
        error_logits = jax.vmap(logit_math.get_additional_logit)(
            raise_node_instruction_pointer + 1e-9,
            exit_node_instruction_pointer + 1e-9,
            logits)
        # error_logits.shape: batch_size
        logits = logits.at[:, error_id].set(error_logits)
      else:
        raise ValueError('Tried using Exception IPA-GNN on data with no errors.')
    else:
      logits = nn.Dense(
          features=num_classes, name='output'
      )(exit_node_embeddings)
    # logits.shape: batch_size, num_classes

    return logits, ipagnn_output


text:
RSpec.describe HTTParty::HashConversions do
  describe ".to_params" do
    it "creates a params string from a hash" do
      hash = {
        name: "bob",
        address: {
          street: '111 ruby ave.',
          city: 'ruby central',
          phones: ['111-111-1111', '222-222-2222']
        }
      }
      expect(HTTParty::HashConversions.to_params(hash)).to eq("name=bob&address[street]=111%20ruby%20ave.&address[city]=ruby%20central&address[phones][]=111-111-1111&address[phones][]=222-222-2222")
    end
  end

  describe ".normalize_param" do
    context "value is an array" do
      it "creates a params string" do
        expect(
          HTTParty::HashConversions.normalize_param(:people, ["Bob Jones", "Mike Smith"])
        ).to eq("people[]=Bob%20Jones&people[]=Mike%20Smith&")
      end
    end

    context "value is an empty array" do
      it "creates a params string" do
        expect(
          HTTParty::HashConversions.normalize_param(:people, [])
        ).to eq("people[]=&")
      end
    end

    context "value is hash" do
      it "creates a params string" do
        expect(
          HTTParty::HashConversions.normalize_param(:person, { name: "Bob Jones" })
        ).to eq("person[name]=Bob%20Jones&")
      end
    end

    context "value is a string" do
      it "creates a params string" do
        expect(
          HTTParty::HashConversions.normalize_param(:name, "Bob Jones")
        ).to eq("name=Bob%20Jones&")
      end
    end
  end
end


text: my Internet Of Things project


text:
require "test_helper"

class AbstracterTest < Minitest::Test
  EXAMPLES = {
    "what's for lunch tomorrow?" => "what's for lunch {{core.date}}?",
    "what time on Wednesday?" => "what time on {{core.date}}?",
    "where were you last Friday?" => "where were you {{core.date}}?",
    "April showers bring May flowers" => "{{core.date.month}} showers bring {{core.date.month}} flowers",
    "16 ounces" => "{{core.number}} ounces",
    "send a reminder to james@example.com" => "send a reminder to {{core.email}}"
  }.freeze

  context "Attentive.abstract" do
    EXAMPLES.each do |message, abstraction|
      should "recognize entities in #{message.inspect}" do
        assert_equal abstraction, Attentive.abstract(message)
      end
    end
  end

end


text:
package de.da_sense.moses.client.userstudy;

/**
 * A class for all objects that have a title coded as {@link String}.
 * @author Zijad Maksuti
 *
 */
public interface IHasTitle {

	/**
	 * Sets the title to this {@link IHasTitle} object.
	 * @param title the title to set
	 * @return old title assigned to this object if any
	 */
	public String setTitle(String title);

	/**
	 * Returns the title assigned to this object.
	 * @return the title assigned to this object if any.
	 */
	public String getTitle();

}


text:
package com.hazelcast.client;

import com.hazelcast.client.config.ClientConfig;
import com.hazelcast.client.test.TestHazelcastFactory;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.map.IMap;
import com.hazelcast.test.HazelcastParallelClassRunner;
import com.hazelcast.test.annotation.ParallelJVMTest;
import com.hazelcast.test.annotation.QuickTest;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;

import java.util.HashMap;
import java.util.Map;

import static com.hazelcast.test.HazelcastTestSupport.randomString;
import static org.junit.Assert.assertEquals;

/**
 * A test that verifies that a non smart client, can send request to a wrong node, but still can get responses to its requests.
 */
@RunWith(HazelcastParallelClassRunner.class)
@Category({QuickTest.class, ParallelJVMTest.class})
public class NonSmartClientRoutingTest {

    private final TestHazelcastFactory hazelcastFactory = new TestHazelcastFactory();

    private HazelcastInstance client;
    private HazelcastInstance server1;

    @After
    public void tearDown() {
        hazelcastFactory.terminateAll();
    }

    @Before
    public void setup() {
        server1 = hazelcastFactory.newHazelcastInstance();
        hazelcastFactory.newHazelcastInstance();
        ClientConfig clientConfig = new ClientConfig();
        clientConfig.getNetworkConfig().setSmartRouting(false);
        client = hazelcastFactory.newHazelcastClient(clientConfig);
    }

    @Test
    public void test() {
        String mapName = randomString();
        // create some dummy data.
        Map<String, String> origin = new HashMap<String, String>();
        for (int k = 0; k < 1000; k++) {
            String value = randomString();
            origin.put(value, value);
        }

        // insert that data on the server.
        server1.getMap(mapName).putAll(origin);

        // now iterate over that dummy data and make sure that we find everything that was inserted.
        IMap<String, String> map = client.getMap(mapName);
        for (Map.Entry<String, String> entry : origin.entrySet()) {
            String key = entry.getKey();
            String expectedValue = map.get(key);
            String actualValue = map.get(key);
            assertEquals(expectedValue, actualValue);
        }
    }
}


text:
void display_frame_define(DisplayFrameImpl* frame, void* context)
{}

void display_frame_commit(DisplayFrameImpl* frame)
{}


text:
require 'harvested'

HARVEST_SUBDOMAIN = 'https://nathanielholland.harvestapp.com'
HARVEST_EMAIL = 'nateholland6@gmail.com'
HARVEST_PASSWORD = 'please123'
# Interval for jobs to schedule
HARVEST_JOB_INTERVAL = '15m'
# Delay for first run of jobs
HARVEST_JOB_FIRST_IN = 0

class HarvestHelper
	attr_reader :client

	def initialize
		@client = Harvest.hardy_client(HARVEST_SUBDOMAIN, HARVEST_EMAIL, HARVEST_PASSWORD)
	end

	# Get hours on a specified date
	#
	# @param date [Date] Date on which we want to get
	# @return total hours on that date
	def hours_on(date)
		# List of TimeEntry objects
		entries = client.time.all(date.to_time)
		return hours_from_entries(entries)
	end

	# Get hours in a specified week
    #
    # @param date [Date] Date within a week which we want to get
    # @return total hours in that week
    def hours_in_week(date)
    	start_date = date.beginning_of_week
    	end_date = date.end_of_week
    	return hours_between(start_date, end_date)
    end

    # Get hours in a specified month
    #
    # @param date [Date] Date within a month which we want to get
    # @return total hours in that month
    def hours_in_month(date)
		start_date = date.beginning_of_month
    	end_date = date.end_of_month
    	return hours_between(start_date, end_date)
    end

	# Get hours between a given timeframe
	#
	# @param start_date [Date] start_date on which we want to get
	# @param end_date [Date] end_date on which we want to get
	# @return total hours on that timeframe
	def hours_between(start_date, end_date)
		# List of TimeEntry objects
		entries = client.reports.time_by_user(user_id(), start_date, end_date)
		return hours_from_entries(entries)
	end

	# Get total hours from a list of TimeEntry objects
	#
	# @param time_entries [] list of TimeEntry objects
	# @return total hours from those entries
	def hours_from_entries(time_entries)
		hours = 0
		for entry in time_entries
			hours += entry.hours
		end
		return hours.round(2)
	end

	# Get id of the user by comparing HARVEST_EMAIL
	#
	# @return the user id if found or -1 if not found.
	def user_id()
		# @TODO: looks for a better way to get user id
		users = client.users.all()
		for user in users
			if user.email == HARVEST_EMAIL
				return user.id
			end
		end
		return -1
	end
end


text:
using UnityEditor;
using UnityEngine;

[CanEditMultipleObjects, CustomEditor(typeof(MegaFFD4x4x4Warp))]
public class MegaFFD4x4x4WarpEditor : MegaFFDWarpEditor
{
	[MenuItem("GameObject/Create Other/MegaFiers/Warps/FFD 4x4x4")]
	static void CreateStarShape()
	{
		CreateFFDWarp("FFD 4x4x4", typeof(MegaFFD4x4x4Warp));
	}

	public override string GetHelpString() { return "FFD4x4x4 Warp by Chris West"; }
}


text:
package com.github.tdesjardins.ol3.demo.client.example;

import ol.source.VectorTile;
import ol.source.VectorTileOptions;

import com.github.tdesjardins.ol3.demo.client.utils.DemoUtils;

import ol.Coordinate;
import ol.Map;
import ol.MapOptions;
import ol.View;
import ol.control.MousePosition;
import ol.format.Mvt;
import ol.layer.VectorTileLayerOptions;

/**
 * Mapbox vector tiles example.
 *
 * @author Tino Desjardins
 *
 */
public class MvtExample implements Example {

    /** This is the Mapbox access token of gwt-ol3. Please replace it with your own token if you want to integrate Mapbox in your application! */
    private static final String ACCESS_TOKEN = "pk.eyJ1IjoiZ3d0LW9sMyIsImEiOiJjaW0yMDM5aTgwMGxsdnVtNXNiNDg2b2VvIn0.qqoJgK-09q7UeOwh-hNtCA";

    /* (non-Javadoc)
     * @see de.desjardins.ol3.demo.client.example.Example#show()
     */
    @Override
    public void show(String exampleId) {

        VectorTileOptions vectorTileOptions = new VectorTileOptions();
        vectorTileOptions.setFormat(new Mvt());
        vectorTileOptions.setUrl("https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/{z}/{x}/{y}.vector.pbf?access_token=" + ACCESS_TOKEN);
        vectorTileOptions.setAttributions("© Mapbox © OpenStreetMap contributors'");

        VectorTile vectorTile = new VectorTile(vectorTileOptions);

        VectorTileLayerOptions tileLayerOptions = new VectorTileLayerOptions();
        tileLayerOptions.setSource(vectorTile);

        ol.layer.VectorTile mvtLayer = new ol.layer.VectorTile(tileLayerOptions);

        // create a view
        View view = new View();

        Coordinate centerCoordinate = new Coordinate(0, 0);
        view.setCenter(centerCoordinate);
        view.setZoom(2);

        // create the map
        MapOptions mapOptions = new MapOptions();
        mapOptions.setTarget(exampleId);
        mapOptions.setView(view);

        Map map = new Map(mapOptions);

        ol.control.Attribution attributionControl = new ol.control.Attribution();
        attributionControl.setCollapsed(false);

        map.addControl(attributionControl);
        map.addControl(new MousePosition());
        map.addControl(DemoUtils.createMapboxLogo());

        map.addLayer(mvtLayer);

    }

}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1,user-scalable=no,maximum-scale=1,width=device-width">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="description" content="csMap, your mapping solution.">
    <meta name="author" content="Arnoud de Jong, Erik Vullings">
    <meta name="color:Accent" content="#a98e2e" />

    <title>csMap</title>

    <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css" />
    <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap-theme.min.css" />
    <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css" />
    <link rel="stylesheet" href="bower_components/leaflet/dist/leaflet.css" />
    <link rel="stylesheet" href="bower_components/dcjs/dc.css" />
    <link rel="stylesheet" href="bower_components/leaflet.markercluster/dist/MarkerCluster.css" />
    <link rel="stylesheet" href="bower_components/leaflet.markercluster/dist/MarkerCluster.Default.css" />
    <link rel="stylesheet" href="bower_components/leaflet.locatecontrol/src/L.Control.Locate.css" />
    <link rel="stylesheet" href="bower_components/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" />

    <link rel="stylesheet" href="css/timeline.css" />
    <link rel="stylesheet" href="css/pnotify.custom.min.css" />
    <link rel="stylesheet" href="css/xbbcode.css">
    <link rel="stylesheet" href="css/csStyles.css" />
    <link rel="stylesheet" href="css/style.css">

    <link rel="shortcut icon" href="favicon.ico">

                        {{vm.$layerService.project.title}}
                         1">

 1" class="dropdown-menu" role="menu">

                            {{lsproject.title}}

MAP_LABEL

TABLE_LABEL

            <form class="navbar-form navbar-right" style="margin-right:0" role="search" data-ng-controller="searchCtrl">

                    <input data-ng-model="vm.searchText"
                           typeahead="address as address.shortName(25) for address in vm.getLocation($viewValue)"
                           typeahead-loading="loadingLocations"
                           typeahead-min-length="2"
                           typeahead-editable="false"
                           typeahead-on-select="vm.onSelect($item, $model, $label)"
                           id="searchbox"
                           type="text"
                           placeholder="Zoek in kaartlagen"
                           class="typeahead form-control">

            </form>

            <language-switch class="navbar-form navbar-right" style="margin: 0 -5px 0 8px;"></language-switch>

            <expert-mode class="navbar-form navbar-right" style="outline:none; margin: 15px 5px 0 0; color: white"></expert-mode>


text:
require "attribute_helpers/version"

# Provides helper functionality for ruby classes that store various
# database-unfriendly types as instance variables. It automatically serializes
# and deserializes things like classes and symbols to interact easily with both
# the database and your application code.

module AttributeHelpers
  def attr_symbol(*attrs)
    transform_attributes(*attrs, &:to_sym)
  end

  def attr_class(*attrs)
    transform_attributes(*attrs) { |val| Kernel.const_get(val) }
  end

  # Implementation Note
  # -------------------
  # The transformers above all work by creating an anonymous module for each
  # group of attributes that gets prepended into the class the AttributeHelpers
  # module is included into. These modules need to be defined at method call
  # time to avoid leaking the overrided methods into other classes this module
  # is included in.
  #
  # This anonymous module needs to be prepended to work in ActiveRecord classes.
  # This is because ActiveRecord doesn't have accessors/mutators defined until
  # an instance is created, which means we need to use the prepend pattern
  # because attempts to use instance_method instance_method will not find the
  # method in the class context as it will not exist until it is dynamically
  # created when an instance is created. Prepend works for us because it inserts
  # the behavior *below* the class in the inheritance hierarchy, so we can
  # access the default ActiveRecord accessors/ mutators through the use of
  # super().
  #
  # More information here: http://stackoverflow.com/a/4471202/1103543
  def transform_attributes(*attrs)
    transformer = Module.new do
      attrs.each do |attr|
        # Overwrite the accessor.
        define_method(attr) do
          val = super()
          val && yield(val)
        end

        # Overwrite the mutator.
        define_method("#{attr}=") do |val|
          super(val&.to_s)
        end
      end
    end

    prepend transformer
  end
end


text:
<?php

namespace Acme\DemoBundle\Lib\UrbanAirship\Push;

use Acme\DemoBundle\Lib\UrbanAirship\Devices;
use Acme\DemoBundle\Lib\UrbanAirship\Device\AndroidDevice;

class AndroidNotification extends AbstractNotification
{
    protected $path = 'api/push';
    protected $devices = array();
    protected $schedule = array();
    protected $alert;
    protected $extra;

    public function getDevices()
    {
        return $this->devices;
    }

    public function setDevices(Devices $devices)
    {
        $this->devices = $devices;
        return $this;
    }

    public function addDevice(AndroidDevice $device)
    {
        $this->devices[] = $device;
        return $this;
    }

    public function scheduleFor(\DateTime $date)
    {
        $this->schedule[] = $date;
        return $this;
    }

    public function getAlert()
    {
        return $this->alert;
    }

    public function setAlert($alert)
    {
        $this->alert = $alert;
        return $this;
    }

    public function getExtra()
    {
        return $this->extra;
    }

    public function setExtra(array $extra)
    {
        $this->extra = $extra;
        return $this;
    }

    public function getPayload()
    {
        $payload = array(
            'apids' => array_map(function ($device) { return $device->getId(); }, $this->devices),
            'aliases' => $this->alias,
            'tags' => $this->tags,
            'schedule_for' => array_map(function ($date) { return $date->format('c'); }, $this->schedule),
            'android' => array(
                'alert' => $this->alert,
                'extra' => $this->extra,
            ),
        );

        $payload = array_filter($payload);
        $payload['android'] = array_filter($payload['android']);
        return json_encode($payload);
    }
}


text:
@implementation MyTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setUp];
    }
    return self;
}

- (void)setUp{
    self.imgView = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, 34, 34)];
    [self.contentView addSubview:self.imgView];

    self.txtLabel = [[UILabel alloc] initWithFrame:CGRectMake(44, 5, 146, 34)];
    self.txtLabel.numberOfLines = 0;
    self.txtLabel.textColor = ZFSystemBlue;
    self.txtLabel.font = [UIFont systemFontOfSize:14.f];
    [self.contentView addSubview:self.txtLabel];

    self.subTxtLabel = [[UILabel alloc] initWithFrame:CGRectMake(200, 5, 100, 34)];
    self.subTxtLabel.numberOfLines = 0;
    self.subTxtLabel.textColor = ZFLightGray;
    self.subTxtLabel.font = [UIFont systemFontOfSize:13.f];
    [self.contentView addSubview:self.subTxtLabel];
}

@end


text:
/*
 * @(#)$Id$
 *
 * This file is distributed under the terms in the attached LICENSE file.
 * If you do not find this file, copies can be found by writing to:
 * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300,
 * Berkeley, CA, 94704.  Attention:  Intel License Inquiry.
 * Or
 * UC Berkeley EECS Computer Science Division, 387 Soda Hall #1776,
 * Berkeley, CA,  94707. Attention: P2 Group.
 *

 */

/*
 * The run-command meta-object for all actions!
 * this includes insert,delete, and commit buffer
 *
*/

#ifndef _WORLD_WHEEL_H_
#define _WORLD_WHEEL_H_
#include "element.h"
#include "boost/shared_ptr.hpp"
#include "list"
using namespace std;

class CommitManager{
public:
  CommitManager();

  // This is in essence a stl set with
  // particular actions. See insert2 and delete2
  // for example.
  class Action{
  public:
    virtual ~Action();

    virtual void commit()=0;
    virtual void abort(){_buffer.clear();};

    void addTuple(TuplePtr);
    void removeTuple(TuplePtr);
  protected:
    TupleMSet _buffer;
  };
  typedef boost::shared_ptr<Action> ActionPtr;

  void addAction(ActionPtr anAct);
  void removeAction(ActionPtr anAct);

  void commit();
  void commit(ActionPtr);
  void abort();
  void abort(ActionPtr);

protected:
  typedef list<ActionPtr> ActionList;
  ActionList mActionList;

};

#endif


text:
package text

import (
	"testing"

	. "github.com/smartystreets/goconvey/convey"
)

func TestTextRawContentType(t *testing.T) {
	Convey("The text/raw content type", t, func() {
		ct := new(Raw)

		Convey("Should be unsafe", func() {
			So(ct.Safe(), ShouldBeFalse)
		})

		Convey("Should not modify content for index or rendering", func() {
			content, err := ct.RenderDisplayContent("content<script></script>")
			So(content, ShouldEqual, "content<script></script>")
			So(err, ShouldBeNil)

			content, err = ct.RenderIndexContent("content<script></script>")
			So(content, ShouldEqual, "content<script></script>")
			So(err, ShouldBeNil)
		})
	})
}


text:
package com.avconv4java.model;

/**
 * Type shows how strictly to follow the standards.
 *
 * @author Vladislav Bauer
 */

public enum AVStrictType {

    /**
     * Strictly conform to a older more strict version of the spec or reference software.
     */
    VERY(Constants.VERY),

    /**
     * Strictly conform to all the things in the spec no matter what the consequences.
     */
    STRICT(Constants.STRICT),

    /**
     * Allow unofficial extensions.
     */
    NORMAL(Constants.NORMAL),

    /**
     * Allow unofficial extensions.
     */
    UNOFFICIAL(Constants.UNOFFICIAL),

    /**
     * Allow non-standardized experimental things.
     */
    EXPERIMENTAL(Constants.EXPERIMENTAL);

    private final String name;

    private AVStrictType(final String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public static AVStrictType findByName(final String name) {
        for (final AVStrictType type : values()) {
            if (type.getName().equalsIgnoreCase(name)) {
                return type;
            }
        }
        return null;
    }

    /**
     * @author Vladislav Bauer
     */

    public static final class Constants {

        public static final String VERY = "very";
        public static final String STRICT = "strict";
        public static final String NORMAL = "normal";
        public static final String UNOFFICIAL = "unofficial";
        public static final String EXPERIMENTAL = "experimental";

        private Constants() {
            throw new UnsupportedOperationException();
        }

    }

}


text:
'use strict';

/* Controllers */
angular.module("pu.assetsmanage.controllers")
    .controller('CollectionController',function ($scope, $rootScope, $state,$stateParams, toaster,modal, $uibModal,CollectionService,LoanQueryService,SysDictService,UnitInfoService,ArchiveService) {
        $scope.initCollectionData = function(){
            $scope.procInstId = $stateParams.procInstId;
            $scope.taskId = $stateParams.taskId;
            $scope.businessKey = $stateParams.businessKey;
            $scope.appId = $stateParams.appId;
            $scope.workflowKey = $stateParams.workflowKey;
            $scope.applyVo = {};
            //$scope.doInitApplyEdit($stateParams.appId);
            $scope.task = LoanQueryService.getTaskByTaskId($stateParams.taskId,$stateParams.workflowKey).$object;
            $scope.baseInfoVo = LoanQueryService.getLoanCustApplyInfo($scope.appId).$object;

        };
        $scope.initCollection = function(){
            $scope.initCollectionData();
            //根据流程定义ID初始化数据
            if($scope.workflowKey =='DHCS' || $scope.workflowKey =='WWCS'||$scope.workflowKey =='SMCS'){
                $scope.collectionStatusList = SysDictService.queryDictDataByTypeCode("cszt").$object;
                $scope.overdueReasonList  =  SysDictService.queryDictDataByTypeCode("yqyy").$object;
            }
            if($scope.workflowKey =='WWSC'){
                $scope.recoverStatusList = SysDictService.queryDictDataByTypeCode("sczt").$object;
            }
            if($scope.workflowKey =='CLTH'){
                $scope.refundStatusList = SysDictService.queryDictDataByTypeCode("thzt").$object;
            }
            if($scope.workflowKey =='ZCCZ'){
                $scope.disposeStatusList = SysDictService.queryDictDataByTypeCode("czzt").$object;
            }
            if($scope.workflowKey =='SS'){
                $scope.lawsuitStatusList = SysDictService.queryDictDataByTypeCode("sszt").$object;
            }
            CollectionService.getCollectionAppyInfo($scope.businessKey).then(function(response){
                $scope.applyVo = response;
                var taskType = response.taskType;
                if(taskType=='csrwlx02'){
                    $scope.taskName = '上门催收';
                    $scope.visitReasonList = SysDictService.queryDictDataByTypeCode("smcsyy").$object;
                }
                if(taskType =='csrwlx03'){
                    $scope.taskName = '委外催收';
                    $scope.outReasonList =  SysDictService.queryDictDataByTypeCode("wycsyy").$object;
                    $scope.outUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx01').$object;
                }
                if(taskType =='csrwlx04'){
                    $scope.taskName = '委外收车';
                    $scope.recoverReasonList = SysDictService.queryDictDataByTypeCode("wwscyy").$object;
                    $scope.recoverUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx02').$object;
                }
                if(taskType =='csrwlx05'){
                    $scope.taskName = '车辆退回';
                    $scope.backReasonList = SysDictService.queryDictDataByTypeCode("clthyy").$object;
                }
                if(taskType =='csrwlx06'){
                    $scope.taskName = '资产处置';
                    $scope.disposeReasonList = SysDictService.queryDictDataByTypeCode("zcczyy").$object;
                    $scope.disposeUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx02').$object;
                }
                if(taskType =='csrwlx07'){
                    $scope.taskName = '诉讼';
                    $scope.lawsuitReasonList = SysDictService.queryDictDataByTypeCode("ssyy").$object;
                    $scope.lawsuitUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx03').$object;
                }
            });
        };
        $scope.initCollectionApprove = function(){
            $scope.initCollectionData();
            CollectionService.getNewCollectionAppyInfo($scope.taskId).then(function(response){
                $scope.applyVo = response;
                var taskType = response.taskType;
                $scope.approveVo = {};
                if(taskType=='csrwlx02'){
                    $scope.taskName = '上门催收';
                    $scope.visitReasonList = SysDictService.queryDictDataByTypeCode("smcsyy").$object;
                }
                if(taskType =='csrwlx03'){
                    $scope.taskName = '委外催收';
                    $scope.outReasonList =  SysDictService.queryDictDataByTypeCode("wycsyy").$object;
                    $scope.outUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx01').$object;
                }
                if(taskType =='csrwlx04'){
                    $scope.taskName = '委外收车';
                    $scope.recoverReasonList = SysDictService.queryDictDataByTypeCode("wwscyy").$object;
                    $scope.recoverUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx02').$object;
                }
                if(taskType =='csrwlx05'){
                    $scope.taskName = '车辆退回';
                    $scope.backReasonList = SysDictService.queryDictDataByTypeCode("clthyy").$object;
                }
                if(taskType =='csrwlx06'){
                    $scope.taskName = '资产处置';
                    $scope.disposeReasonList = SysDictService.queryDictDataByTypeCode("zcczyy").$object;
                    $scope.disposeUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx02').$object;
                }
                if(taskType =='csrwlx07'){
                    $scope.taskName = '诉讼';
                    $scope.lawsuitReasonList = SysDictService.queryDictDataByTypeCode("ssyy").$object;
                    $scope.lawsuitUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx03').$object;
                }
            });
        };
        $scope.initRecoverCollectionApprove = function(){
            $scope.initCollectionData();
            $scope.approveVo = {};
            $scope.applyVo = CollectionService.getCollectionAppyInfo($scope.businessKey).$object;
            $scope.approveList = SysDictService.queryDictDataByTypeCode("fkspjglx").$object;
            $scope.taskName = '委外收车';
            $scope.recoverReasonList = SysDictService.queryDictDataByTypeCode("wwscyy").$object;
            $scope.recoverUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx02').$object;
        }
        $scope.saveCollectionLog =function(){
            CollectionService.saveCollectionLog($scope.taskId,$scope.applyVo).then(function(response){
                toaster.pop('success', '操作提醒', '提交任务成功 ');
                $scope.applyVo={};
            })
        };
        $scope.commitApproveApplyNewCollectionTask = function(){
            modal.confirm('操作提醒','确认提交任务?').then(function(){
                CollectionService.commitApproveApplyNewCollectionTask($scope.taskId,$scope.approveVo).then(function(){
                    toaster.pop('success', '操作提醒', '提交任务成功 ');
                    $state.go('app.loantask.todolist');
                })
            })
        };
        $scope.commitApproveRecoverCollectionTask = function(){
            CollectionService.commitApproveRecoverCollectionTask($scope.taskId,$scope.approveVo).then(function(){
                toaster.pop('success', '操作提醒', '提交任务成功 ');
                $state.go('app.loantask.todolist');
            })
        };
        $scope.applyReAssigneeTask = function(){
            modal.prompt('调配原因','请输入调配原因').then(function(response){
                CollectionService.applyReAssigneeTask($scope.taskId,response).then(function(response){
                    toaster.pop('success', '操作提醒', '提交任务成功 ');
                    $state.go('app.loantask.todolist');
                })
            })
        }
        $scope.getImportantCollectionLog = function(){
            $scope.collectionLogCntMap = CollectionService.getCollectionTaskCnt($scope.appId).$object;
            $scope.importanCollectionLogList = CollectionService.getImportanCollectionLogInfo($scope.appId).$object;
        };
        $scope.getCollectionLog = function(taskType){
            $scope.collectionLogList = CollectionService.getCollectionLogInfo($scope.appId,taskType).$object;
        };
        $scope.getCollectionTask = function(){
            $scope.collectionTaskList = CollectionService.getCollectionApplyTask($scope.appId).$object;
        }
        $scope.selectAssignee = function(){
            CollectionService.selectAssignee($scope.taskId).then(function(response){
                modal.confirm("操作提醒","是否确认分配给"+response.accountName+"?").then(function(){
                    CollectionService.reassigneeTaskOperId($scope.taskId,response.accountId).then(function(){
                        toaster.pop('success', '操作提醒', '提交任务成功 ');
                        $state.go('app.loantask.todolist');
                    })
                })
            })
        }
        $scope.initCollectionAssignee = function(){
            $scope.initCollectionData();
            CollectionService.getCollectionAppyInfo($scope.businessKey).then(function(response){
               $scope.applyVo = response;
               var taskType = response.taskType;
                if(taskType=='csrwlx02'){
                    $scope.taskName = '上门催收';
                    $scope.visitReasonList = SysDictService.queryDictDataByTypeCode("smcsyy").$object;
                }
                if(taskType =='csrwlx03'){
                    $scope.taskName = '委外催收';
                    $scope.outReasonList =  SysDictService.queryDictDataByTypeCode("wycsyy").$object;
                    $scope.outUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx01').$object;
                }
                if(taskType =='csrwlx04'){
                    $scope.taskName = '委外收车';
                    $scope.recoverReasonList = SysDictService.queryDictDataByTypeCode("wwscyy").$object;
                    $scope.recoverUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx02').$object;
                }
                if(taskType =='csrwlx05'){
                    $scope.taskName = '车辆退回';
                    $scope.backReasonList = SysDictService.queryDictDataByTypeCode("clthyy").$object;
                }
                if(taskType =='csrwlx06'){
                    $scope.taskName = '资产处置';
                    $scope.disposeReasonList = SysDictService.queryDictDataByTypeCode("zcczyy").$object;
                    $scope.disposeUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx02').$object;
                }
                if(taskType =='csrwlx07'){
                    $scope.taskName = '诉讼';
                    $scope.lawsuitReasonList = SysDictService.queryDictDataByTypeCode("ssyy").$object;
                    $scope.lawsuitUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx03').$object;
                }
            });

        }
        $scope.appendToEl = angular.element(document.querySelector('#check-header'));

        $scope.applyNewCollectionTask = function(taskType){
            var appId = $scope.appId;
            var taskId = $scope.taskId;
            var modalInstance = $uibModal.open({
                animation: false,
                backdrop: 'static',
                size: 'lg',
                templateUrl: 'module_assetsmanage/tpl/dialog-collection-add.html',
                controller: function ($scope, RestApi, SettleService, ToolsService, modal, LoanQueryService,UnitInfoService) {
                    $scope.appId = appId;
                    $scope.taskType = taskType;
                    $scope.taskId = taskId;
                    $scope.applyVo = {};
                    if(taskType=='csrwlx02'){
                        $scope.taskName = '上门催收';
                        $scope.visitReasonList = SysDictService.queryDictDataByTypeCode("smcsyy").$object;

                    }
                    if(taskType =='csrwlx03'){
                        $scope.taskName = '委外催收';
                        $scope.outReasonList =  SysDictService.queryDictDataByTypeCode("wycsyy").$object;
                        $scope.outUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx01').$object;
                    }
                    if(taskType =='csrwlx04'){
                        $scope.taskName = '委外收车';
                        $scope.recoverReasonList = SysDictService.queryDictDataByTypeCode("wwscyy").$object;
                        $scope.recoverUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx02').$object;
                    }
                    if(taskType =='csrwlx05'){
                        $scope.taskName = '车辆退回';
                        $scope.backReasonList = SysDictService.queryDictDataByTypeCode("clthyy").$object;
                    }
                    if(taskType =='csrwlx06'){
                        $scope.taskName = '资产处置';
                        $scope.disposeReasonList = SysDictService.queryDictDataByTypeCode("zcczyy").$object;
                        $scope.disposeUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx02').$object;
                    }
                    if(taskType =='csrwlx07'){
                        $scope.taskName = '诉讼';
                        $scope.lawsuitReasonList = SysDictService.queryDictDataByTypeCode("ssyy").$object;
                        $scope.lawsuitUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx03').$object;
                    }
                    $scope.ok = function () {
                        modal.confirm("操作提醒", "确认提交任务?").then(function () {
                            CollectionService.applyNewCollectionTask($scope.taskId,$scope.appId, $scope.taskType, $scope.applyVo).then(function () {
                                modalInstance.close();
                            })
                        })
                    };
                    $scope.cancel = function () {
                        modalInstance.dismiss('cancel');
                    };
                }
            });
            modalInstance.result.then(function (response) {
                toaster.pop('success', '操作提醒', "提交任务成功");
                $state.go('app.loantask.todolist');
            })
        };
        $scope.commitSettleLawsuitTask = function(){
            modal.confirm("操作提醒","确认提交结案?").then(function(){
                CollectionService.commitSettleLawsuitTask($scope.taskId).then(function(response){
                    toaster.pop('success', '操作提醒', '提交任务成功 ');
                    $state.go('app.loantask.todolist');
                    if(response.reason!=null){
                        modal.info("操作提醒",response.reason);
                    }
                })
            })
        }
        $scope.initCollectionSettleApprove = function(){
            $scope.initCollectionData();
            CollectionService.getCollectionAppyInfo($scope.businessKey).then(function(response){
                $scope.applyVo = response;
                var taskType = response.taskType;
                $scope.approveVo = {};
                if(taskType=='csrwlx01'){
                    $scope.taskName = '电话催收';
                }
                if(taskType=='csrwlx02'){
                    $scope.taskName = '上门催收';
                    $scope.visitReasonList = SysDictService.queryDictDataByTypeCode("smcsyy").$object;
                }
                if(taskType =='csrwlx03'){
                    $scope.taskName = '委外催收';
                    $scope.outReasonList =  SysDictService.queryDictDataByTypeCode("wycsyy").$object;
                    $scope.outUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx01').$object;
                }
                if(taskType =='csrwlx04'){
                    $scope.taskName = '委外收车';
                    $scope.recoverReasonList = SysDictService.queryDictDataByTypeCode("wwscyy").$object;
                    $scope.recoverUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx02').$object;
                }
                if(taskType =='csrwlx05'){
                    $scope.taskName = '车辆退回';
                    $scope.backReasonList = SysDictService.queryDictDataByTypeCode("clthyy").$object;
                }
                if(taskType =='csrwlx06'){
                    $scope.taskName = '资产处置';
                    $scope.disposeReasonList = SysDictService.queryDictDataByTypeCode("zcczyy").$object;
                    $scope.disposeUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx02').$object;
                }
                if(taskType =='csrwlx07'){
                    $scope.taskName = '诉讼';
                    $scope.lawsuitReasonList = SysDictService.queryDictDataByTypeCode("ssyy").$object;
                    $scope.lawsuitUnitList = UnitInfoService.getUnitInfoList(true,'csdwlx03').$object;
                }
            });
        };
        $scope.commitSettleApprove = function(){
            modal.confirm("操作提醒", "确认提交任务?").then(function () {
                CollectionService.commitSettleApprove($scope.taskId).then(function () {
                    toaster.pop('success', '操作提醒', '提交任务成功 ');
                    $state.go('app.loantask.todolist');
                })
            })
        };
        $scope.doCreateCollectionArchiveTask = function(){
            var archiveType="";
            if($scope.workflowKey == 'DHCS'){
                archiveType="dhcsgd";
            }
            if($scope.workflowKey == 'SMCS'){
                archiveType="smcsgd";
            }
            if($scope.workflowKey == 'WWCS'){
                archiveType="wwcsgd";
            }
            if($scope.workflowKey == 'WWSC'){
                archiveType="wwscgd";
            }
            if($scope.workflowKey == 'CLTH'){
                archiveType="clthgd";
            }
            if($scope.workflowKey == 'ZCCZ'){
                archiveType="zcccgd";
            }
            if($scope.workflowKey == 'SS'){
                archiveType="ssgd";
            }
            ArchiveService.doCreateCollectionArchiveTask($scope.appId,archiveType).then(function(){
                toaster.pop('success', '操作提醒', '创建任务成功 ');
            })
        };
        $scope.initCollectionHistoryTaskList = function(){
            $scope.taskList = CollectionService.getApplyCollectionTaskListByOperId().$object;
        };
        $scope.showCollectionTaskDetail = function(item){
            CollectionService.showCollectionTaskDetail(item);
        }
    })
;


text:
<?php

namespace League\Geotools\Batch;

use Geocoder\Location;
use Geocoder\Model\Address;
use Geocoder\Model\Coordinates;

/**
 * BatchGeocoded class
 *
 * @author Antoine Corcy <contact@sbin.dk>
 */
class BatchGeocoded
{
    /**
     * The name of the provider.
     *
     * @var string
     */
    protected $providerName;

    /**
     * The query.
     *
     * @var string
     */
    protected $query;

    /**
     * The exception message.
     *
     * @var string
     */
    protected $exception;

    /**
     * The Location object.
     *
     * @var Location
     */
    protected $address;

    /**
     * Get the name of the provider.
     *
     * @return string The name of the provider.
     */
    public function getProviderName()
    {
        return $this->providerName;
    }

    /**
     * Set the name of the provider.
     *
     * @param string $providerName The name of the provider.
     */
    public function setProviderName($providerName)
    {
        $this->providerName = $providerName;
    }

    /**
     * Get the query.
     *
     * @return string The query.
     */
    public function getQuery()
    {
        return $this->query;
    }

    /**
     * Set the query.
     *
     * @param string $query The query.
     */
    public function setQuery($query)
    {
        $this->query = $query;
    }

    /**
     * Get the exception message.
     *
     * @return string The exception message.
     */
    public function getExceptionMessage()
    {
        return $this->exception;
    }

    /**
     * Set the exception message.
     *
     * @param string $exception The exception message.
     */
    public function setExceptionMessage($exception)
    {
        $this->exception = $exception;
    }

    /**
     * Get the address
     *
     * @return Location
     */
    public function getAddress()
    {
        return $this->address;
    }

    /**
     * Set the address
     *
     * @param Location $address
     */
    public function setAddress($address)
    {
        $this->address = $address;
    }

    /**
     * Returns an array of coordinates (latitude, longitude).
     *
     * @return Coordinates|null
     */
    public function getCoordinates()
    {
        if (null === $this->address) {
            return null;
        }

        return $this->address->getCoordinates();
    }

    /**
     * Returns the latitude value.
     *
     * @return double
     */
    public function getLatitude()
    {
        if (null === $coordinates = $this->getCoordinates()) {
            return null;
        }

        return $coordinates->getLatitude();
    }

    /**
     * Returns the longitude value.
     *
     * @return double
     */
    public function getLongitude()
    {
        if (null === $coordinates = $this->getCoordinates()) {
            return null;
        }

        return $coordinates->getLongitude();
    }

    /**
     * Create an instance from an array, used from cache libraries.
     *
     * @param array $data
     */
    public function fromArray(array $data = [])
    {
        if (isset($data['providerName'])) {
            $this->providerName = $data['providerName'];
        }
        if (isset($data['query'])) {
            $this->query = $data['query'];
        }
        if (isset($data['exception'])) {
            $this->exception = $data['exception'];
        }

        //GeoCoder Address::createFromArray expects longitude/latitude keys
        $data['address']['longitude'] = $data['address']['coordinates']['longitude'] ?? null;
        $data['address']['latitude'] = $data['address']['coordinates']['latitude'] ?? null;

        // Shortcut to create the address and set it in this class
        $this->setAddress(Address::createFromArray($data['address']));
    }

	/**
     * Router all other methods call directly to our address object
     *
     * @param $method
     * @param $args
     * @return mixed
     */
    public function __call($method, $args)
    {
        if (null === $this->address) {
            return null;
        }

        return call_user_func_array([$this->address, $method], $args);
    }
}


text:
<?php

/**
 * Pre-transform that changes deprecated name attribute to ID if necessary
 */
class HTMLPurifier_AttrTransform_Name extends HTMLPurifier_AttrTransform
{

    public function transform($attr, $config, $context) {
        if (!isset($attr['name'])) return $attr;
        $id = $this->confiscateAttr($attr, 'name');
        if ( isset($attr['id']))   return $attr;
        $attr['id'] = $id;
        return $attr;
    }

}

// vim: et sw=4 sts=4


text:
require 'usbmux'

mux = Usbmux::USBMux.new
puts "Waiting for devices..."
if !mux.devices
  mux.process(0.1)
end
loop do
  puts "Devices: "
  mux.devices.each do |device|
    puts device
  end
  mux.process()
end