text:
<input id="list-search-id" class="search-box" type="search" placeholder="Filter by Name.." ng-model="query1">

            Name
            Description
            Location
            Open Times
            Facility

            {{foodtruck.name}}
            {{foodtruck.description}}
            {{foodtruck.address}}
             {{foodtruck.schedule[0].startTime}} to {{foodtruck.schedule[0].endTime}}
            {{foodtruck.facilityType}}


text:
package org.apache.spark.rdd

import scala.reflect.ClassTag

import org.apache.spark.{Partition, SparkContext, TaskContext}

/**
 * An RDD partition used to recover checkpointed data.
 */
private[spark] class CheckpointRDDPartition(val index: Int) extends Partition

/**
 * An RDD that recovers checkpointed data from storage.
 */
private[spark] abstract class CheckpointRDD[T: ClassTag](@transient sc: SparkContext)
  extends RDD[T](sc, Nil) {

  // CheckpointRDD should not be checkpointed again
  override def doCheckpoint(): Unit = { }
  override def checkpoint(): Unit = { }
  override def localCheckpoint(): this.type = this

  // Note: There is a bug in MiMa that complains about `AbstractMethodProblem`s in the
  // base [[org.apache.spark.rdd.RDD]] class if we do not override the following methods.
  // scalastyle:off
  protected override def getPartitions: Array[Partition] = ???
  override def compute(p: Partition, tc: TaskContext): Iterator[T] = ???
  // scalastyle:on

}

redpajama_set_name: RedPajamaGithub


text:
package com.google.gerrit.reviewdb.server;

import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.ChangeMessage;
import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gwtorm.server.Access;
import com.google.gwtorm.server.OrmException;
import com.google.gwtorm.server.PrimaryKey;
import com.google.gwtorm.server.Query;
import com.google.gwtorm.server.ResultSet;

public interface ChangeMessageAccess extends Access<ChangeMessage, ChangeMessage.Key> {
  @Override
  @PrimaryKey("key")
  ChangeMessage get(ChangeMessage.Key id) throws OrmException;

  @Query("WHERE key.changeId = ? ORDER BY writtenOn")
  ResultSet<ChangeMessage> byChange(Change.Id id) throws OrmException;

  @Query("WHERE patchset = ?")
  ResultSet<ChangeMessage> byPatchSet(PatchSet.Id id) throws OrmException;

  @Query
  ResultSet<ChangeMessage> all() throws OrmException;
}


text:
package org.kaazing.k3po.lang.internal.ast.builder;

import java.net.URI;

import org.kaazing.k3po.lang.internal.ast.AstAcceptNode;
import org.kaazing.k3po.lang.internal.ast.AstScriptNode;
import org.kaazing.k3po.lang.internal.ast.value.AstValue;
import org.kaazing.k3po.lang.types.TypeInfo;

public final class AstAcceptNodeBuilder extends AbstractAstAcceptNodeBuilder<AstAcceptNode> {

    public AstAcceptNodeBuilder() {
        this(new AstAcceptNode());
    }

    public AstAcceptNodeBuilder setLocation(AstValue<URI> location) {
        node.setLocation(location);
        return this;
    }

    public AstAcceptNodeBuilder setAcceptName(String acceptName) {
        node.setAcceptName(acceptName);
        return this;
    }

    public <T> AstAcceptNodeBuilder setOption(TypeInfo<T> option, AstValue<T> optionValue) {
        node.getOptions().put(option.getName(), optionValue);
        return this;
    }

    public AstAcceptNodeBuilder setOption(String optionName, AstValue<?> optionValue) {
        node.getOptions().put(optionName, optionValue);
        return this;
    }

    @Override
    public AstOpenedNodeBuilder.StreamNested<AstAcceptNodeBuilder> addOpenedEvent() {
        return new AstOpenedNodeBuilder.StreamNested<>(this);
    }

    @Override
    public AstBoundNodeBuilder.StreamNested<AstAcceptNodeBuilder> addBoundEvent() {
        return new AstBoundNodeBuilder.StreamNested<>(this);
    }

    @Override
    public AstChildOpenedNodeBuilder.StreamNested<AstAcceptNodeBuilder> addChildOpenedEvent() {
        return new AstChildOpenedNodeBuilder.StreamNested<>(this);
    }

    @Override
    public AstChildClosedNodeBuilder.StreamNested<AstAcceptNodeBuilder> addChildClosedEvent() {
        return new AstChildClosedNodeBuilder.StreamNested<>(this);
    }

    @Override
    public AstUnboundNodeBuilder.StreamNested<AstAcceptNodeBuilder> addUnboundEvent() {
        return new AstUnboundNodeBuilder.StreamNested<>(this);
    }

    @Override
    public AstClosedNodeBuilder.StreamNested<AstAcceptNodeBuilder> addClosedEvent() {
        return new AstClosedNodeBuilder.StreamNested<>(this);
    }

    @Override
    public AstReadAwaitNodeBuilder.StreamNested<AstAcceptNodeBuilder> addReadAwaitBarrier() {
        return new AstReadAwaitNodeBuilder.StreamNested<>(this);
    }

    @Override
    public AstReadNotifyNodeBuilder.StreamNested<AstAcceptNodeBuilder> addReadNotifyBarrier() {
        return new AstReadNotifyNodeBuilder.StreamNested<>(this);
    }

    @Override
    public AstWriteAwaitNodeBuilder.StreamNested<AstAcceptNodeBuilder> addWriteAwaitBarrier() {
        return new AstWriteAwaitNodeBuilder.StreamNested<>(this);
    }

    @Override
    public AstWriteNotifyNodeBuilder.StreamNested<AstAcceptNodeBuilder> addWriteNotifyBarrier() {
        return new AstWriteNotifyNodeBuilder.StreamNested<>(this);
    }

    @Override
    public AstAcceptNode done() {
        return result;
    }

    private AstAcceptNodeBuilder(AstAcceptNode node) {
        super(node, node);
    }

    public static final class ScriptNested<R extends AbstractAstNodeBuilder<? extends AstScriptNode, ?>> extends
            AbstractAstAcceptNodeBuilder<R> {

        public ScriptNested(R builder) {
            super(new AstAcceptNode(), builder);
        }

        public ScriptNested<R> setLocation(AstValue<URI> location) {
            node.setLocation(location);
            return this;
        }

        public ScriptNested<R> setAcceptName(String acceptName) {
            node.setAcceptName(acceptName);
            return this;
        }

        public <T> ScriptNested<R> setOption(TypeInfo<T> option, AstValue<T> optionValue) {
            node.getOptions().put(option.getName(), optionValue);
            return this;
        }

        public <T> ScriptNested<R> setOption(String optionName, AstValue<?> optionValue) {
            node.getOptions().put(optionName, optionValue);
            return this;
        }

        public AstAcceptableNodeBuilder.AcceptNested<ScriptNested<R>> addAcceptedStream() {
            return new AstAcceptableNodeBuilder.AcceptNested<>(this);
        }

        @Override
        public AstOpenedNodeBuilder.StreamNested<ScriptNested<R>> addOpenedEvent() {
            return new AstOpenedNodeBuilder.StreamNested<>(this);
        }

        @Override
        public AstBoundNodeBuilder.StreamNested<ScriptNested<R>> addBoundEvent() {
            return new AstBoundNodeBuilder.StreamNested<>(this);
        }

        @Override
        public AstChildOpenedNodeBuilder.StreamNested<ScriptNested<R>> addChildOpenedEvent() {
            return new AstChildOpenedNodeBuilder.StreamNested<>(this);
        }

        @Override
        public AstChildClosedNodeBuilder.StreamNested<ScriptNested<R>> addChildClosedEvent() {
            return new AstChildClosedNodeBuilder.StreamNested<>(this);
        }

        @Override
        public AstUnboundNodeBuilder.StreamNested<ScriptNested<R>> addUnboundEvent() {
            return new AstUnboundNodeBuilder.StreamNested<>(this);
        }

        @Override
        public AstClosedNodeBuilder.StreamNested<ScriptNested<R>> addClosedEvent() {
            return new AstClosedNodeBuilder.StreamNested<>(this);
        }

        @Override
        public AstReadAwaitNodeBuilder.StreamNested<ScriptNested<R>> addReadAwaitBarrier() {
            return new AstReadAwaitNodeBuilder.StreamNested<>(this);
        }

        @Override
        public AstReadNotifyNodeBuilder.StreamNested<ScriptNested<R>> addReadNotifyBarrier() {
            return new AstReadNotifyNodeBuilder.StreamNested<>(this);
        }

        @Override
        public AstWriteAwaitNodeBuilder.StreamNested<ScriptNested<R>> addWriteAwaitBarrier() {
            return new AstWriteAwaitNodeBuilder.StreamNested<>(this);
        }

        @Override
        public AstWriteNotifyNodeBuilder.StreamNested<ScriptNested<R>> addWriteNotifyBarrier() {
            return new AstWriteNotifyNodeBuilder.StreamNested<>(this);
        }

        @Override
        public R done() {
            AstScriptNode scriptNode = result.node;
            scriptNode.getStreams().add(node);
            return result;
        }
    }

}


text:
import { useRemoteCall } from "@hooks/RemoteCall";
import { getUserInfo, postUserInfo } from "@services/UserInfo";

export function useUserInfoPOST() {
    return useRemoteCall(postUserInfo, []);
}

export function useUserInfoGET() {
    return useRemoteCall(getUserInfo, []);
}


text:
using System.Collections.Immutable;
using System.Linq;
using Analyzer.Utilities;
using Analyzer.Utilities.Extensions;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Operations;

namespace Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines
{
    /// <summary>
    /// CA2007: Do not directly await a Task in libraries. Append ConfigureAwait(false) to the task.
    /// </summary>
    [DiagnosticAnalyzer(LanguageNames.CSharp, LanguageNames.VisualBasic)]
    public sealed class DoNotDirectlyAwaitATaskAnalyzer : DiagnosticAnalyzer
    {
        internal const string RuleId = "CA2007";

        private static readonly LocalizableString s_localizableTitle = new LocalizableResourceString(nameof(MicrosoftCodeQualityAnalyzersResources.DoNotDirectlyAwaitATaskTitle), MicrosoftCodeQualityAnalyzersResources.ResourceManager, typeof(MicrosoftCodeQualityAnalyzersResources));
        private static readonly LocalizableString s_localizableMessage = new LocalizableResourceString(nameof(MicrosoftCodeQualityAnalyzersResources.DoNotDirectlyAwaitATaskMessage), MicrosoftCodeQualityAnalyzersResources.ResourceManager, typeof(MicrosoftCodeQualityAnalyzersResources));
        private static readonly LocalizableString s_localizableDescription = new LocalizableResourceString(nameof(MicrosoftCodeQualityAnalyzersResources.DoNotDirectlyAwaitATaskDescription), MicrosoftCodeQualityAnalyzersResources.ResourceManager, typeof(MicrosoftCodeQualityAnalyzersResources));

        public static readonly DiagnosticDescriptor Rule = DiagnosticDescriptorHelper.Create(
            RuleId,
            s_localizableTitle,
            s_localizableMessage,
            DiagnosticCategory.Reliability,
            RuleLevel.Disabled,
            description: s_localizableDescription,
            isPortedFxCopRule: false,
            isDataflowRule: false);

        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);

        public override void Initialize(AnalysisContext analysisContext)
        {
            analysisContext.EnableConcurrentExecution();
            analysisContext.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None);

            analysisContext.RegisterCompilationStartAction(context =>
            {
                if (!(context.Compilation.SyntaxTrees.FirstOrDefault() is SyntaxTree tree) ||
                    !context.Options.GetOutputKindsOption(Rule, tree, context.Compilation, context.CancellationToken).Contains(context.Compilation.Options.OutputKind))
                {
                    // Configured to skip analysis for the compilation's output kind
                    return;
                }

                if (!TryGetTaskTypes(context.Compilation, out ImmutableArray<INamedTypeSymbol> taskTypes))
                {
                    return;
                }

                context.RegisterOperationBlockStartAction(operationBlockStartContext =>
                {
                    if (operationBlockStartContext.OwningSymbol is IMethodSymbol method)
                    {
                        if (method.IsAsync &&
                            method.ReturnsVoid &&
                            operationBlockStartContext.Options.GetBoolOptionValue(
                                optionName: EditorConfigOptionNames.ExcludeAsyncVoidMethods,
                                rule: Rule,
                                method,
                                context.Compilation,
                                defaultValue: false,
                                cancellationToken: operationBlockStartContext.CancellationToken))
                        {
                            // Configured to skip this analysis in async void methods.
                            return;
                        }

                        operationBlockStartContext.RegisterOperationAction(oc => AnalyzeOperation(oc, taskTypes), OperationKind.Await);
                    }
                });
            });
        }

        private static void AnalyzeOperation(OperationAnalysisContext context, ImmutableArray<INamedTypeSymbol> taskTypes)
        {
            var awaitExpression = (IAwaitOperation)context.Operation;

            // Get the type of the expression being awaited and check it's a task type.
            ITypeSymbol? typeOfAwaitedExpression = awaitExpression.Operation.Type;
            if (typeOfAwaitedExpression != null && taskTypes.Contains(typeOfAwaitedExpression.OriginalDefinition))
            {
                context.ReportDiagnostic(awaitExpression.Operation.Syntax.CreateDiagnostic(Rule));
            }
        }

        private static bool TryGetTaskTypes(Compilation compilation, out ImmutableArray<INamedTypeSymbol> taskTypes)
        {
            INamedTypeSymbol? taskType = compilation.GetOrCreateTypeByMetadataName(WellKnownTypeNames.SystemThreadingTasksTask);
            INamedTypeSymbol? taskOfTType = compilation.GetOrCreateTypeByMetadataName(WellKnownTypeNames.SystemThreadingTasksTask1);

            if (taskType == null || taskOfTType == null)
            {
                taskTypes = ImmutableArray<INamedTypeSymbol>.Empty;
                return false;
            }

            INamedTypeSymbol? valueTaskType = compilation.GetOrCreateTypeByMetadataName(WellKnownTypeNames.SystemThreadingTasksValueTask);
            INamedTypeSymbol? valueTaskOfTType = compilation.GetOrCreateTypeByMetadataName(WellKnownTypeNames.SystemThreadingTasksValueTask1);

            taskTypes = valueTaskType != null && valueTaskOfTType != null ?
                ImmutableArray.Create(taskType, taskOfTType, valueTaskType, valueTaskOfTType) :
                ImmutableArray.Create(taskType, taskOfTType);

            return true;
        }
    }
}


text:
namespace CasaEngine
{
	class CA_EXPORT Capsule :
		public IShape
	{
	public:
		Capsule();
	};
}

#endif


text:
title: Introducing Cordova 3.0.0 for Android
date: 2013-07-19 16:45:46 Z
tags:
- PhoneGap Network
type: post
status: publish
format: html
author: Joe Bowser
thumb: "/blog/uploads/thumb/joe.jpg"
link: http://infil00p.org/adobe/android/cordova/2013/07/19/introducing-cordova-3-0-0-for-android//
external: true
---

Once again, it's time for another release of Cordova, this time Cordova 3.0.0.  This is a major update and a major departure from the previous release in that there is only a single built-in plugin, the App plugin, which deals … Continue reading →


text:
module Gws::Share::DescendantsFileInfo
  extend ActiveSupport::Concern
  extend SS::Translation
  include ActiveSupport::NumberHelper

  included do
    field :descendants_files_count, type: Integer
    field :descendants_total_file_size, type: Integer

    validate :validate_attached_file_size
    #after_save_files :set_file_info

    after_save :update_folder_descendants_file_info
    #after_destroy_files :update_folder_descendants_file_info
  end

  def total_file_size
    return @total_file_size if @total_file_size
    @total_file_size = files.compact.map(&:size).inject(:+) || 0
  end

  def files_count
    return @files_count if @files_count
    @files_count = files.active.compact.length || 0
  end

  def readable_active_files_count(user, site)
    files.readable(user, site: site).active.count
  end

  def readable_deleted_files_count(user, site)
    files.readable(user, site: site).deleted.count
  end

  def update_folder_descendants_file_info
    path = nil
    name.split("/").each do |n|
      path = path ? (path + "/" + n) : n
      folder = Gws::Share::Folder.site(site).where(name: path).first
      next unless folder

      descendants_folder_ids = Gws::Share::Folder.site(site).where(name: /^#{folder.name}\//).pluck(:id)
      descendants_folder_ids << folder.id
      descendants_files = Gws::Share::File.site(site).in(folder_id: descendants_folder_ids)

      folder.set(
        descendants_files_count: descendants_files.count,
        descendants_total_file_size: descendants_files.pluck(:size).sum
      )
    end
  end

  private

  def validate_attached_file_size
    return if self.attributes["controller"] == "gws/share/folders"
    if (limit = (self.share_max_file_size || 0)) > 0
      size = files.compact.map(&:size).max || 0
      if size > limit
        errors.add(
          :base,
          :file_size_exceeds_folder_limit,
          size: number_to_human_size(size),
          limit: number_to_human_size(limit))
      end
    end
  end

  def folder_file_info(folder)
    sizes = folder.files.compact.map(&:size) || []
    sizes.compact!

    [ sizes.length, sizes.inject(:+) || 0 ]
  end

  def set_file_info
    files_count, total_file_size = folder_file_info(self)
    self.descendants_files_count = files_count
    self.descendants_total_file_size = total_file_size
  end
end


text:
package com.tinkerpop.blueprints.impls.orient;

import com.tinkerpop.blueprints.Graph;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/**
 * Test suite for OrientDB graph implementation compatible with the classic one before OrientDB 1.4.
 *
 * @author Luca Garulli (l.garulli--(at)--orientdb.com) (http://orientdb.com)
 */
@RunWith(JUnit4.class)
public class OrientGraphClassicTestIT extends OrientGraphTest {

  public Graph generateGraph(final String graphDirectoryName) {
    OrientGraph graph = (OrientGraph) super.generateGraph(graphDirectoryName);
    graph.setUseLightweightEdges(false);
    graph.setUseVertexFieldsForEdgeLabels(false);
    return graph;
  }
}


text:
package org.springframework.social.vkontakte.api.impl;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import org.springframework.social.MissingAuthorizationException;
import org.springframework.social.support.URIBuilder;
import org.springframework.social.vkontakte.api.ApiVersion;
import org.springframework.social.vkontakte.api.VKGenericResponse;
import org.springframework.social.vkontakte.api.VKResponse;
import org.springframework.social.vkontakte.api.VKontakteErrorException;
import org.springframework.social.vkontakte.api.impl.json.VKArray;
import org.springframework.util.Assert;
import org.springframework.util.MultiValueMap;

import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;

/**
 * Generic class for operation templates.
 * @author vkolodrevskiy
 */
class AbstractVKontakteOperations {
    private final static String VK_REST_URL = "https://api.vk.com/method/";

    private final boolean isAuthorized;
    private final String accessToken;
    protected final ObjectMapper objectMapper;

    public AbstractVKontakteOperations(boolean isAuthorized, String accessToken, ObjectMapper objectMapper) {
        this.isAuthorized = isAuthorized;
        this.accessToken = accessToken;
        this.objectMapper = objectMapper;
    }

    /**
     * throws {@link MissingAuthorizationException} if not authorized.
     */
    protected void requireAuthorization() {
        if (!isAuthorized) {
            throw new MissingAuthorizationException("vkontakte");
        }
    }

    protected URI makeOperationURL(String method, Properties params, ApiVersion apiVersion) {
        URIBuilder uri = URIBuilder.fromUri(VK_REST_URL + method);

        preProcessURI(uri);

        // add api version
        // TODO: I think finally we should migrate to latest api
        uri.queryParam("v", apiVersion.toString());

        for (Map.Entry<Object, Object> objectObjectEntry : params.entrySet()) {
            uri.queryParam(objectObjectEntry.getKey().toString(), objectObjectEntry.getValue().toString());
        }
        return uri.build();
    }

    protected URI makeOperationPOST(String method, MultiValueMap<String, Object> data, ApiVersion apiVersion) {
        URIBuilder uri = URIBuilder.fromUri(VK_REST_URL + method);
        data.set("access_token", accessToken);
        data.set("v", apiVersion.toString());
        return uri.build();
    }

    protected void preProcessURI(URIBuilder uri) {
        // add access_token
        // TODO: for some methods we do not need access token, so think about it.
        uri.queryParam("access_token", accessToken);
    }

    // throw exception if VKontakte response contains error
    // TODO: consider to throw specific exceptions for each error code.
    //       like for error code 113 that would be let's say InvalidUserIdVKException
    protected <T extends VKResponse> void checkForError(T toCheck) {
        if(toCheck.getError() != null) {
            throw new VKontakteErrorException(toCheck.getError());
        }
    }

    protected <T> VKArray<T> deserializeArray(VKGenericResponse response, Class<T> itemClass) {
        checkForError(response);

        Assert.isTrue(response.getResponse().isArray());
        ArrayNode items = (ArrayNode) response.getResponse();
        int count = items.get(0).asInt();
        return new VKArray<T>(count, deserializeItems(items, itemClass));
    }

    /**
     * for responses of VK API 5.0+
     *
     * @param response  {@link VKGenericResponse response}
     * @param itemClass class of the item
     * @param <T> item type
     * @return array
     */
    protected <T> VKArray<T> deserializeVK50ItemsResponse(VKGenericResponse response, Class<T> itemClass) {
        checkForError(response);
        JsonNode jsonNode = response.getResponse();
        JsonNode itemsNode = jsonNode.get("items");
        Assert.isTrue(itemsNode.isArray());
        int count = jsonNode.get("count").asInt();
        return new VKArray<T>(count, deserializeItems((ArrayNode) itemsNode, itemClass));
    }

    protected <T> List<T> deserializeItems(ArrayNode items, Class<T> itemClass) {
        List<T> elements = new ArrayList<T>();
        for (int i = 0; i < items.size(); i++) {
            elements.add(objectMapper.convertValue(items.get(i), itemClass));
        }
        return elements;
    }

    protected <T> T deserializeVK50Item( VKGenericResponse response, Class<T> itemClass) {
        checkForError(response);
        return objectMapper.convertValue(response.getResponse(), itemClass);
    }
}


text:
@interface UIFont (LovedbytheKing)

+ (instancetype)lovedbytheKingFontOfSize:(CGFloat)size;

@end


text:
select ps_availqty, ps_supplycost, ps_comment
from `filter/pushdown/varchar_decimal/no_metadata_file/1.14.0/partsupp`
where ps_supplycost > 999.9;


text:
package com.github.tomakehurst.wiremock.extension.responsetemplating;

import com.github.tomakehurst.wiremock.common.Urls;
import com.github.tomakehurst.wiremock.http.Cookie;
import com.github.tomakehurst.wiremock.http.MultiValue;
import com.github.tomakehurst.wiremock.http.QueryParameter;
import com.github.tomakehurst.wiremock.http.Request;
import com.google.common.base.Function;
import com.google.common.collect.Maps;

import java.net.URI;
import java.util.Map;

public class RequestTemplateModel {

    private final String url;
    private final UrlPath path;
    private final Map<String, ListOrSingle<String>> query;
    private final Map<String, ListOrSingle<String>> headers;
    private final Map<String, ListOrSingle<String>> cookies;
    private final String body;

    public RequestTemplateModel(String url, UrlPath path, Map<String, ListOrSingle<String>> query, Map<String, ListOrSingle<String>> headers, Map<String, ListOrSingle<String>> cookies, String body) {
        this.url = url;
        this.path = path;
        this.query = query;
        this.headers = headers;
        this.cookies = cookies;
        this.body = body;
    }

    public static RequestTemplateModel from(final Request request) {
        URI url = URI.create(request.getUrl());
        Map<String, QueryParameter> rawQuery = Urls.splitQuery(url);
        Map<String, ListOrSingle<String>> adaptedQuery = Maps.transformValues(rawQuery, TO_TEMPLATE_MODEL);
        Map<String, ListOrSingle<String>> adaptedHeaders = Maps.toMap(request.getAllHeaderKeys(), new Function<String, ListOrSingle<String>>() {
            @Override
            public ListOrSingle<String> apply(String input) {
                return ListOrSingle.of(request.header(input).values());
            }
        });
        Map<String, ListOrSingle<String>> adaptedCookies = Maps.transformValues(request.getCookies(), new Function<Cookie, ListOrSingle<String>>() {
            @Override
            public ListOrSingle<String> apply(Cookie input) {
                return ListOrSingle.of(input.getValue());
            }
        });

        UrlPath path = new UrlPath(request.getUrl());

        return new RequestTemplateModel(
            request.getUrl(),
            path,
            adaptedQuery,
            adaptedHeaders,
            adaptedCookies,
            request.getBodyAsString()
        );
    }

    public String getUrl() {
        return url;
    }

    public UrlPath getPath() {
        return path;
    }

    public Map<String, ListOrSingle<String>> getQuery() {
        return query;
    }

    public Map<String, ListOrSingle<String>> getHeaders() {
        return headers;
    }

    public Map<String, ListOrSingle<String>> getCookies() {
        return cookies;
    }

    public String getBody() {
        return body;
    }

    private static final Function<MultiValue, ListOrSingle<String>> TO_TEMPLATE_MODEL = new Function<MultiValue, ListOrSingle<String>>() {
        @Override
        public ListOrSingle<String> apply(MultiValue input) {
            return ListOrSingle.of(input.values());
        }
    };
}


text:
.. _running:

Running YANK
************

Hardware
========

Running on GPUs
"""""""""""""""

YANK uses `OpenMM <http://openmm.org>`_ as its simulation engine, which runs fastest on modern GPUs using either the
``CUDA`` or ``OpenCL`` platforms.
Modern GTX-class hardware, such as the `GTX-1080 <http://www.geforce.com/hardware/10series/geforce-gtx-1080>`_ or
`GTX-TITAN-X (Maxwell) <http://www.geforce.com/hardware/desktop-gpus/geforce-gtx-titan-x>`_, should work very well.
See :ref:`Supported hardware <supported_hardware>` for more information about supported and recommended hardware.

Running on the CPU
""""""""""""""""""

If you don't have a GPU, the OpenMM ``CPU`` platform will run in multithreaded mode by default (see `Selecting a platform`_).
While not as fast as `gromacs <http://www.gromacs.org>`_, running on the CPU can still let you explore the features of YANK without needing a GPU.
You can also use CPUs acting as ``OpenCL`` devices utilizing the `AMD OpenCL APP SDK <http://developer.amd.com/tools-and-sdks/opencl-zone/>`_ or the `Intel OpenCL SDK <https://software.intel.com/en-us/intel-opencl>`_, though this has not been extensively tested.

Parallelization
===============

YANK can operate in two different modes:

Serial mode
"""""""""""

In :ref:`serial mode <serial-mode>`, a single simulation is run at a time, either on the GPU or CPU.
For replica-exchange calculations, this means that each replica is run serially, and then exchanges between replicas are allowed to occur.
This is useful if you are testing YANK, or running a large number of free energy calculations where speed is not a major concern.

.. _mpi_notes:

MPI mode
""""""""

In :ref:`MPI mode <mpi-mode>`, multiple simulations can be run at once, either on multiple GPUs or multiple CPUs, though
running simulations on a mixture of platforms is not supported at this time.
We utilize the widely-supported
`Message Passing Interface (MPI) standard <http://www.mcs.anl.gov/research/projects/mpi/standard.html>`_ for parallelization.
All simulations are run using the same OpenMM ``Platform`` choice (``CUDA``, ``OpenCL``, ``CPU``, or ``Reference``)

No GPU management is needed on single GPU/node systems.

Multi-GPU and multi-node systems require masking the GPUs so YANK only sees the one its suppose to.
You will need to set the ``CUDA_VISIBLE_DEVICES`` environment variables on each process to mask all but the card you intend to use.
We cannot provide a universal solution as systems will differ, but we can provide some general rules of thumb.

.. note:: |mpichNotes|

.. |mpichNotes| replace::
    All our documentation assumes MPICH 3 formatting which has the package name ``mpich`` and version formatting ``3.X``.
    This is distinct from MPICH2 which has the package name ``mpich2`` and version formatting ``1.X``.
    Please see `the official MPICH site <https://www.mpich.org/about/overview/>`__ for more information about the
    version naming and numbering.

* |torquepbs|

.. |torquepbs| replace::
    ``torque`` or ``PBS`` cluster - Install the `clusterutils <https://github.com/choderalab/clusterutils>`__ module (automatic when YANK
    is installed from conda). Run the ``build_mpirun_configfile "yank --script=yank.yaml"`` targeting your YAML file.
    The command works by targeting the cluster's ``$PBS_GPUFILE`` to determine device IDs as the cluster sees them.

*  |slurmsub|

.. |slurmsub| replace::
    ``SLURM`` cluster -  SLURM handles some of the GPU masking for you by setting ``CUDA_VISIBLE_DEVICES``, but we have
    found breaks down over multiple nodes. The `clusterutils <https://github.com/choderalab/clusterutils>`__ will also
    help you configure the MPI jobs to run over multiple nodes. The command in this case operates by reading environment
    variables to figure out host and card names.

* |lsfsub|

.. |lsfsub| replace::
    ``LSF`` cluster - Rely on the `clusterutils <https://github.com/choderalab/clusterutils>`__ module which comes with
    YANK when conda installed. This configures hosts and GPU masking based on the batch job environment variables which
    are set at job submission.

We recommend running YANK with an MPI configfile. You can specify all of these sets to ``CUDA_VISIBLE_DEVICES`` by hand,
but it will make for a long command line. Creating a hostfile and configfile to feed into MPI is the preferred option
for this reason. Although `clusterutils <https://github.com/choderalab/clusterutils>`_ will handle file creation for you,
below we show an example of a hostfile and configfile in case you need to make the files by hand. This is a 2 node,
4 GPU/node torque cluster (8 processes distributed over 2 nodes) setup:

Hostfile:

.. code-block:: bash

    gpu-1-4
    gpu-1-4
    gpu-1-4
    gpu-1-4
    gpu-2-17
    gpu-2-17
    gpu-2-17
    gpu-2-17

Configfile:

.. code-block:: bash

    -np 1 -env CUDA_VISIBLE_DEVICES 3 yank script --yaml=freesolv.yaml
    -np 1 -env CUDA_VISIBLE_DEVICES 2 yank script --yaml=freesolv.yaml
    -np 1 -env CUDA_VISIBLE_DEVICES 1 yank script --yaml=freesolv.yaml
    -np 1 -env CUDA_VISIBLE_DEVICES 0 yank script --yaml=freesolv.yaml
    -np 1 -env CUDA_VISIBLE_DEVICES 3 yank script --yaml=freesolv.yaml
    -np 1 -env CUDA_VISIBLE_DEVICES 2 yank script --yaml=freesolv.yaml
    -np 1 -env CUDA_VISIBLE_DEVICES 1 yank script --yaml=freesolv.yaml
    -np 1 -env CUDA_VISIBLE_DEVICES 0 yank script —-yaml=freesolv.yaml

Hopefully this example helps you construct your own configfile if the ``build_mpirun_configfile`` is unavailable or you
are on a custom system.

Simulations may be started in one mode and then can be resumed using another parallelization mode or OpenMM ``Platform``.
The NetCDF files generated by YANK are platform-portable and hardware agnostic, so they can be moved from system to
system if you want to start a simulation on one system and resume it elsewhere.

Parallelization is "pleasantly parallel", where information is exchanged only every few seconds or more.
This does not require high-bandwidth interconnects such as `Infiniband <https://en.wikipedia.org/wiki/InfiniBand>`_;
10Gbit/s ethernet connections should work very well.

We show a more formal "use case" of setting up an MPI run :ref:`below <mpi-mode>`.

.. _getting-help:

Getting help
============

To get a list of all command-like options, simply use the ``--help`` flag:

.. code-block:: bash

   $ yank --help

Each YANK command supports its own full command-line support. Type in any of these commands without options or
``yank help COMMAND`` to see what they do.

.. tabularcolumns:: |l|L|

===================  ============================================
Command              Description
===================  ============================================
``yank help``        The basic help message and this list
``yank selftest``    Check YANK's install status and hardware
``yank script``      Primary tool for running yank from command line from options file
``yank platforms``   List platforms available on current hardware
``yank status``      Deprecated - Check the current status of a store directory
``yank analyze``     Analyze a simulation or make an analysis Jupyter Notebook
``yank cleanup``     Remove simulation files
===================  ============================================

|

.. _serial-mode:

Running in serial mode
======================

To run the simulation in serial mode, simply use ``yank script``, specifying a yaml file by ``--yaml=filename.yaml``:

.. code-block:: bash

   $ yank script --yaml=yank.yaml

The optional :ref:`yaml_options_verbose` option will show additional output during execution.

.. _mpi-mode:

Running in MPI mode
===================

Alternatively, to run the simulation in MPI mode:

.. code-block:: none

   $ mpirun yank script --yaml=yank.yaml

Keep in mind your system may have a different MPI executable name and/or syntax.

On systems with multiple NVIDIA GPUs per node, it is necessary to perform masking using ``CUDA_VISIBLE_DEVICES``.

On systems using the conda-installed ``mpi4py`` package, the `MPICH hydra mpirun <https://wiki.mpich.org/mpich/index.php/Using_the_Hydra_Process_Manager>`_ will be automatically installed for you.
You can use the cluster utility command
``build-mpirun-configfile``
available in our `clusterutils <https://github.com/choderalab/clusterutils>`_ tools to generate an appropriate ``configfile``:

.. code-block:: none

  $ build-mpirun-configfile "yank script --yaml=yank.yaml"
  $ mpirun -f hostfile -configfile configfile

``build-mpirun-configfile`` is automatically installed with YANK when you use the ``conda`` installation route. Please
see our :ref:`notes from above <mpi_notes>` about this script's applicability on torque, PBS, SLURM and LSF clusters.

.. note::

   The name of your ``mpi`` binary may be different than what is shown in the example. Make sure you are using the
   correct binary, especially on systems which already had an MPI installed before the ``conda`` one was installed.

|

Selecting a platform
====================

OpenMM supports running simulations on a number of platforms, though not all platforms are available on all hardware.
To see which platforms your current installation supports, you can query the list of available platforms with

.. code-block:: none

  $ yank platforms
  Available OpenMM platforms:
      0 Reference
      1 CUDA
      2 CPU
      3 OpenCL

You can either leave the choice of platform up to YANK---in which case it will choose the fastest available platform---or specify
the desired platform via the :ref:`platform argument <yaml_options_platform>` in a YAML file.

You can also (*although not recommended*) override the platform selection through the ``yank script -o`` flag.
For example, to force YANK to use the ``OpenCL`` platform:

.. code-block:: bash

   $ yank script --yaml=yank.yaml -o options:platform:OpenCL

See the ``yank script`` command line docs for more information on the ``-o`` flag.

.. note:: The ``CPU`` platform will automatically use all available cores/hyperthreads in serial mode, but in MPI mode, will use a single thread to avoid causing problems in queue-regulated parallel systems.  To control the number of threads yourself, set the ``OPENMM_NUM_THREADS`` environment variable to the desired number of threads.

Breaking up Simulations
=======================

One limitation simulations run to compute free energy is that you need sufficient data to estimate all legs of the
:ref:`thermodynamic cycle <yank_cycle>` before you can estimate many properties. YANK by default simulates each phase of
the thermodynamic cycle sequentially, meaning you have to wait for simulation completion before you can do any kind of
analysis.

YANK allows its simulations to switch between phases of the thermodynamic cycle mid-simulation. Setting the
:ref:`yaml_options_switch_phase_interval` option in the YAML file allows you to control how many iterations the
simulation will run of one phase before switching to the other to allow collection between each phase on-the-fly, and
therefore allowing analysis at any point. This feature is helpful for those who want to run for an arbitrarily long
length of time, then wish to end the simulation after some convergence criteria is met, e.g. error in free energy
estimate.

YANK also provides a way flip between different experiments when setting the
:ref:`\!Combinatorial <yaml_combinatorial_head>` flag. The :ref:`yaml_options_switch_experiment_interval` allows
simulations to cycle through all the experiments created when users invoke the ``!Combinatorial`` flag. This option
can be set in tandem with the :ref:`yaml_options_switch_phase_interval`. Please see the respective documentation on
these options for more information.

Specifying Simulation Stop Conditions
=====================================

YANK simulations will run until one of two stop conditions are met, if specified: either the
:ref:`maximum number of iterations <yaml_options_default_number_of_iterations>` is reached, or the
:ref:`error in free energy difference of the phase <yaml_samplers_online_analysis_parameters>` reaches a target value
through online analysis.
These options can be combined to change when YANK stops a simulation.

Specifying a :ref:`maximum number of iterations <yaml_options_default_number_of_iterations>` will tell YANK to run each phase
up to the target number of iterations. This options accepts any positive integer, ``0`` (zero), or infinity
(``.inf`` in the .yaml, ``float('inf')`` or ``numpy.inf`` in the API). Setting this option to ``0`` will tell YANK to only handle file
initialization and input preparation, without running any production simulation. Setting this to ``.inf`` will
run an unlimited number of simulations until another stop condition is met, or is stopped by the user. This option
can be increased after a simulation has completed to extend the number of iterations run for each phase.

Setting a target :ref:`free energy difference error <yaml_samplers_online_analysis_parameters>` tells
YANK to run each phase until the error in the free energy difference is below some threshold. The free energy difference
of the phase is estimated during the simulation through online analysis every
:ref:`specified interval <yaml_samplers_online_analysis_interval>`.
This process will slow down the simulation, so it is recommended the interval be at least 100 iterations, if not more.

It is recommended you also set a :ref:`switch phase interval <yaml_options_switch_phase_interval>` for a large number
of iterations, especially if an unlimited number of iterations are specified, otherwise only one phase will be
simulated.

..
    Extending Simulations
    =====================

    One common operation when running simulations is to collect additional samples from an already run simulation to get
    better statistics. Alternately, when running on shared resources, you may need to break up long simulations into smaller
    simulations run in series. YANK provides a way to run its simulations in this manner by extending its simulations.

    YANK's :doc:`YAML <yamlpages/index>` files have two main options that work together to extend simulations.
    In order to extend simulations, set the following options in a YAML fie:

    .. code-block:: yaml

      number_of_iterations: <Integer>
      extend_simulation: True

    First you set :ref:`yaml_options_number_of_iterations` to an integer number of iterations you wish to extend the
    simulation. If no simulation has been run yet, then one will be run for the number of iterations.
    Setting :ref:`yaml_options_extend_simulation` to ``True`` modifies the behavior of
    :ref:`yaml_options_number_of_iterations` to extend the simulation by the specified number, adding on to what is already
    on the file.

    One could optionally just increase :ref:`yaml_options_number_of_iterations`, but then you have to change
    the YAML file every time you want to extend the run. Setting :ref:`yaml_options_extend_simulation` allows you to run
    the same YAML file without modification to do the same thing.

    You should also set the following two options as well as :ref:`yaml_options_number_of_iterations` and
    :ref:`yaml_options_extend_simulation`:

    .. code-block:: yaml

      resume_setup: yes
      resume_simulation: yes

    :ref:`resume_setup <yaml_options_resume_setup>` and :ref:`resume_simulation <yaml_options_resume_simulation>` allow
    YANK to resume simulations if it detects existing setup file or simulation output respectively. YANK will raise an error
    if these are not set and files exist to protect against overwrite. The only reason these are not mandatory is that if
    no files exist (i.e. fresh simulation), then the simulation will run without error once.

    Extending Previous Simulations from Command Line
    """"""""""""""""""""""""""""""""""""""""""""""""

    You may already have a simulation that you previously ran, but do not want to modify the YAML to extend the simulation.
    In this case, your YAML file has ``extend_simulation: False`` or is not set, and you only want to interact with the
    simulation through the command line. You can override individual settings from the command line; the settings for
    extending simulation would look like:

    .. code-block:: bash

       $ yank script --yaml=yank.yaml -o options:extend_simulation:True -o options:number_of_iterations:X

    where ``X`` is the integer number you wish to extend the simulation by. The second option to override
    ``number_of_iterations`` is optional if you are happy the existing option in the YAML file.

    See the ``yank script`` command line docs for more information on the ``-o`` flag.


text:
A publicly released icon font set commissioned by the crowd.  These icons go perfectly with the [Font Awesome](http://fontawesome.io/) icon set.

### Visit https://customfonticons.com/ to learn more


text:
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar

from msrest import Serializer

from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat

from .. import models as _models
from .._vendor import _convert_request, _format_url_section
T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]

_SERIALIZER = Serializer()
_SERIALIZER.client_side_validation = False

def build_list_by_namespace_request(
    resource_group_name: str,
    namespace_name: str,
    subscription_id: str,
    **kwargs: Any
) -> HttpRequest:
    _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    api_version = kwargs.pop('api_version', _params.pop('api-version', "2018-01-01-preview"))  # type: str
    accept = _headers.pop('Accept', "application/json")

    # Construct URL
    _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/eventhubs")  # pylint: disable=line-too-long
    path_format_arguments = {
        "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
        "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
        "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="GET",
        url=_url,
        params=_params,
        headers=_headers,
        **kwargs
    )

class EventHubsOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~azure.mgmt.servicebus.v2018_01_01_preview.ServiceBusManagementClient`'s
        :attr:`event_hubs` attribute.
    """

    models = _models

    def __init__(self, *args, **kwargs):
        input_args = list(args)
        self._client = input_args.pop(0) if input_args else kwargs.pop("client")
        self._config = input_args.pop(0) if input_args else kwargs.pop("config")
        self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
        self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")

    @distributed_trace
    def list_by_namespace(
        self,
        resource_group_name: str,
        namespace_name: str,
        **kwargs: Any
    ) -> Iterable[_models.EventHubListResult]:
        """Gets all the Event Hubs in a service bus Namespace.

        :param resource_group_name: Name of the Resource group within the Azure subscription.
        :type resource_group_name: str
        :param namespace_name: The namespace name.
        :type namespace_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: An iterator like instance of either EventHubListResult or the result of cls(response)
        :rtype:
         ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2018_01_01_preview.models.EventHubListResult]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        _headers = kwargs.pop("headers", {}) or {}
        _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

        api_version = kwargs.pop('api_version', _params.pop('api-version', "2018-01-01-preview"))  # type: str
        cls = kwargs.pop('cls', None)  # type: ClsType[_models.EventHubListResult]

        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}) or {})
        def prepare_request(next_link=None):
            if not next_link:

                request = build_list_by_namespace_request(
                    resource_group_name=resource_group_name,
                    namespace_name=namespace_name,
                    subscription_id=self._config.subscription_id,
                    api_version=api_version,
                    template_url=self.list_by_namespace.metadata['url'],
                    headers=_headers,
                    params=_params,
                )
                request = _convert_request(request)
                request.url = self._client.format_url(request.url)  # type: ignore

            else:

                request = build_list_by_namespace_request(
                    resource_group_name=resource_group_name,
                    namespace_name=namespace_name,
                    subscription_id=self._config.subscription_id,
                    api_version=api_version,
                    template_url=next_link,
                    headers=_headers,
                    params=_params,
                )
                request = _convert_request(request)
                request.url = self._client.format_url(request.url)  # type: ignore
                request.method = "GET"
            return request

        def extract_data(pipeline_response):
            deserialized = self._deserialize("EventHubListResult", pipeline_response)
            list_of_elem = deserialized.value
            if cls:
                list_of_elem = cls(list_of_elem)
            return deserialized.next_link or None, iter(list_of_elem)

        def get_next(next_link=None):
            request = prepare_request(next_link)

            pipeline_response = self._client._pipeline.run(  # pylint: disable=protected-access
                request,
                stream=False,
                **kwargs
            )
            response = pipeline_response.http_response

            if response.status_code not in [200]:
                map_error(status_code=response.status_code, response=response, error_map=error_map)
                error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
                raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

            return pipeline_response

        return ItemPaged(
            get_next, extract_data
        )
    list_by_namespace.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/eventhubs"}  # type: ignore


text:
$(document).ready(function(){
  var maxFileSize;

  if (typeof $('#max-file-size-in-mb').data() !== 'undefined') {
    maxFileSize = $('#max-file-size-in-mb').data().value;
  }

  jQuery.validator.addMethod("filesize", function(value, element, filesize) {
    return this.optional(element) || (element.files[0].size / 1048576 <= filesize);
  });

  $(".paste").validate({
    rules: {
      area: {
        required: true
      }
    },
    messages: {
      area: {
        required: _("This field is required")
      }
    }
  });

  $(".upload").validate({
      rules: {
        upload: {
            required: true,
              extension: "csv|xlsx|xls",
              filesize: maxFileSize
          },
      },
      messages: {
        upload: {
          required: _("This field is required"),
          extension: _("Only these file types are accepted: csv, xls, xlsx"),
          filesize: _("Only files under " + maxFileSize + "MB are accepted")
        }
      }
  });
});


text:
:loop
ruby mqttreader.rb
echo '-----> restart <-----'
goto loop


text:
package javax.naming.ldap;

import javax.naming.Name;
import javax.naming.InvalidNameException;

import java.util.Enumeration;
import java.util.Collection;
import java.util.ArrayList;
import java.util.List;
import java.util.Iterator;
import java.util.ListIterator;
import java.util.Collections;

import java.io.ObjectOutputStream;
import java.io.ObjectInputStream;
import java.io.IOException;

/**
 * This class represents a distinguished name as specified by
 * RFC 2253.
 * A distinguished name, or DN, is composed of an ordered list of
 * components called relative distinguished names, or RDNs.
 * Details of a DN's syntax are described in RFC 2253.
 *

 * This class resolves a few ambiguities found in RFC 2253
 * as follows:
 *

 *
 RFC 2253 leaves the term "whitespace" undefined. The
 *      ASCII space character 0x20 (" ") is used in its place.
 *
 Whitespace is allowed on either side of ',', ';', '=', and '+'.
 *      Such whitespace is accepted but not generated by this code,
 *      and is ignored when comparing names.
 *
 AttributeValue strings containing '=' or non-leading '#'
 *      characters (unescaped) are accepted.
 *

 *

 * String names passed to LdapName or returned by it
 * use the full Unicode character set. They may also contain
 * characters encoded into UTF-8 with each octet represented by a
 * three-character substring such as "\\B4".
 * They may not, however, contain characters encoded into UTF-8 with
 * each octet represented by a single character in the string:  the
 * meaning would be ambiguous.
 *

 * LdapName will properly parse all valid names, but
 * does not attempt to detect all possible violations when parsing
 * invalid names.  It is "generous" in accepting invalid names.
 * The "validity" of a name is determined ultimately when it
 * is supplied to an LDAP server, which may accept or
 * reject the name based on factors such as its schema information
 * and interoperability considerations.
 *

 * When names are tested for equality, attribute types, both binary
 * and string values, are case-insensitive.
 * String values with different but equivalent usage of quoting,
 * escaping, or UTF8-hex-encoding are considered equal.  The order of
 * components in multi-valued RDNs (such as "ou=Sales+cn=Bob") is not
 * significant.
 *

 * The components of a LDAP name, that is, RDNs, are numbered. The
 * indexes of a LDAP name with n RDNs range from 0 to n-1.
 * This range may be written as [0,n).
 * The right most RDN is at index 0, and the left most RDN is at
 * index n-1. For example, the distinguished name:
 * "CN=Steve Kille, O=Isode Limited, C=GB" is numbered in the following
 * sequence ranging from 0 to 2: {C=GB, O=Isode Limited, CN=Steve Kille}. An
 * empty LDAP name is represented by an empty RDN list.
 *

 * Concurrent multithreaded read-only access of an instance of
 * <tt>LdapName</tt> need not be synchronized.
 *

 * Unless otherwise noted, the behavior of passing a null argument
 * to a constructor or method in this class will cause a
 * NullPointerException to be thrown.
 *
 * @author Scott Seligman
 * @since 1.5
 */

public class LdapName implements Name {

    // private transient ArrayList<Rdn> rdns;   // parsed name components

    private transient ArrayList rdns;   // parsed name components
    private transient String unparsed;  // if non-null, the DN in unparsed form
    private static final long serialVersionUID = -1595520034788997356L;

    /**
     * Constructs an LDAP name from the given distinguished name.
     *
     * @param name  This is a non-null distinguished name formatted
     * according to the rules defined in
     * RFC 2253.
     *
     * @throws InvalidNameException if a syntax violation is detected.
     * @see Rdn#escapeValue(Object value)
     */
    public LdapName(String name) throws InvalidNameException {
        unparsed = name;
        parse();
    }

    /**
     * Constructs an LDAP name given its parsed RDN components.
     *

     * The indexing of RDNs in the list follows the numbering of
     * RDNs described in the class description.
     *
     * @param rdns The non-null list of <tt>Rdn</tt>s forming this LDAP name.
     */
    public LdapName(List<Rdn> rdns) {

        // if (rdns instanceof ArrayList<Rdn>) {
        //      this.rdns = rdns.clone();
        // } else if (rdns instanceof List<Rdn>) {
        //      this.rdns = new ArrayList<Rdn>(rdns);
        // } else {
        //      throw IllegalArgumentException(
        //              "Invalid entries, list entries must be of type Rdn");
        //  }

        this.rdns = new ArrayList(rdns.size());
        for (int i = 0; i < rdns.size(); i++) {
            Object obj = rdns.get(i);
            if (!(obj instanceof Rdn)) {
                throw new IllegalArgumentException("Entry:" + obj +
                        "  not a valid type;list entries must be of type Rdn");
            }
            this.rdns.add(obj);
        }
    }

    /*
     * Constructs an LDAP name given its parsed components (the elements
     * of "rdns" in the range [beg,end)) and, optionally
     * (if "name" is not null), the unparsed DN.
     *
     */
    // private LdapName(String name, List<Rdn> rdns, int beg, int end) {

    private LdapName(String name, ArrayList rdns, int beg, int end) {
        unparsed = name;
        // this.rdns = rdns.subList(beg, end);

        List sList = rdns.subList(beg, end);
        this.rdns = new ArrayList(sList);
    }

    /**
     * Retrieves the number of components in this LDAP name.
     * @return The non-negative number of components in this LDAP name.
     */
    public int size() {
        return rdns.size();
    }

    /**
     * Determines whether this LDAP name is empty.
     * An empty name is one with zero components.
     * @return true if this LDAP name is empty, false otherwise.
     */
    public boolean isEmpty() {
        return rdns.isEmpty();
    }

    /**
     * Retrieves the components of this name as an enumeration
     * of strings. The effect of updates to this name on this enumeration
     * is undefined. If the name has zero components, an empty (non-null)
     * enumeration is returned.
     * The order of the components returned by the enumeration is same as
     * the order in which the components are numbered as described in the
     * class description.
     *
     * @return A non-null enumeration of the components of this LDAP name.
     * Each element of the enumeration is of class String.
     */
    public Enumeration<String> getAll() {
        final Iterator iter = rdns.iterator();

        return new Enumeration<String>() {
            public boolean hasMoreElements() {
                return iter.hasNext();
            }
            public String nextElement() {
                return iter.next().toString();
            }
        };
    }

    /**
     * Retrieves a component of this LDAP name as a string.
     * @param  posn The 0-based index of the component to retrieve.
     *              Must be in the range [0,size()).
     * @return The non-null component at index posn.
     * @exception IndexOutOfBoundsException if posn is outside the
     *          specified range.
     */
    public String get(int posn) {
        return rdns.get(posn).toString();
    }

    /**
     * Retrieves an RDN of this LDAP name as an Rdn.
     * @param   posn The 0-based index of the RDN to retrieve.
     *          Must be in the range [0,size()).
     * @return The non-null RDN at index posn.
     * @exception IndexOutOfBoundsException if posn is outside the
     *            specified range.
     */
    public Rdn getRdn(int posn) {
        return (Rdn) rdns.get(posn);
    }

    /**
     * Creates a name whose components consist of a prefix of the
     * components of this LDAP name.
     * Subsequent changes to this name will not affect the name
     * that is returned and vice versa.
     * @param  posn     The 0-based index of the component at which to stop.
     *                  Must be in the range [0,size()].
     * @return  An instance of <tt>LdapName</tt> consisting of the
     *          components at indexes in the range [0,posn).
     *          If posn is zero, an empty LDAP name is returned.
     * @exception   IndexOutOfBoundsException
     *              If posn is outside the specified range.
     */
    public Name getPrefix(int posn) {
        try {
            return new LdapName(null, rdns, 0, posn);
        } catch (IllegalArgumentException e) {
            throw new IndexOutOfBoundsException(
                "Posn: " + posn + ", Size: "+ rdns.size());
        }
    }

    /**
     * Creates a name whose components consist of a suffix of the
     * components in this LDAP name.
     * Subsequent changes to this name do not affect the name that is
     * returned and vice versa.
     *
     * @param  posn     The 0-based index of the component at which to start.
     *                  Must be in the range [0,size()].
     * @return  An instance of <tt>LdapName</tt> consisting of the
     *          components at indexes in the range [posn,size()).
     *          If posn is equal to size(), an empty LDAP name is
     *          returned.
     * @exception IndexOutOfBoundsException
     *          If posn is outside the specified range.
     */
    public Name getSuffix(int posn) {
        try {
            return new LdapName(null, rdns, posn, rdns.size());
        } catch (IllegalArgumentException e) {
            throw new IndexOutOfBoundsException(
                "Posn: " + posn + ", Size: "+ rdns.size());
        }
    }

    /**
     * Determines whether this LDAP name starts with a specified LDAP name
     * prefix.
     * A name <tt>n</tt> is a prefix if it is equal to
     * <tt>getPrefix(n.size())</tt>--in other words this LDAP
     * name starts with 'n'. If n is null or not a RFC2253 formatted name
     * as described in the class description, false is returned.
     *
     * @param n The LDAP name to check.
     * @return  true if <tt>n</tt> is a prefix of this LDAP name,
     * false otherwise.
     * @see #getPrefix(int posn)
     */
    public boolean startsWith(Name n) {
        if (n == null) {
            return false;
        }
        int len1 = rdns.size();
        int len2 = n.size();
        return (len1 >= len2 &&
                matches(0, len2, n));
    }

    /**
     * Determines whether the specified RDN sequence forms a prefix of this
     * LDAP name.  Returns true if this LdapName is at least as long as rdns,
     * and for every position p in the range [0, rdns.size()) the component
     * getRdn(p) matches rdns.get(p). Returns false otherwise. If rdns is
     * null, false is returned.
     *
     * @param rdns The sequence of <tt>Rdn</tt>s to check.
     * @return  true if <tt>rdns</tt> form a prefix of this LDAP name,
     *          false otherwise.
     */
    public boolean startsWith(List<Rdn> rdns) {
        if (rdns == null) {
            return false;
        }
        int len1 = this.rdns.size();
        int len2 = rdns.size();
        return (len1 >= len2 &&
                doesListMatch(0, len2, rdns));
    }

    /**
     * Determines whether this LDAP name ends with a specified
     * LDAP name suffix.
     * A name <tt>n</tt> is a suffix if it is equal to
     * <tt>getSuffix(size()-n.size())</tt>--in other words this LDAP
     * name ends with 'n'. If n is null or not a RFC2253 formatted name
     * as described in the class description, false is returned.
     *
     * @param n The LDAP name to check.
     * @return true if <tt>n</tt> is a suffix of this name, false otherwise.
     * @see #getSuffix(int posn)
     */
    public boolean endsWith(Name n) {
        if (n == null) {
            return false;
        }
        int len1 = rdns.size();
        int len2 = n.size();
        return (len1 >= len2 &&
                matches(len1 - len2, len1, n));
    }

    /**
     * Determines whether the specified RDN sequence forms a suffix of this
     * LDAP name.  Returns true if this LdapName is at least as long as rdns,
     * and for every position p in the range [size() - rdns.size(), size())
     * the component getRdn(p) matches rdns.get(p). Returns false otherwise.
     * If rdns is null, false is returned.
     *
     * @param rdns The sequence of <tt>Rdn</tt>s to check.
     * @return  true if <tt>rdns</tt> form a suffix of this LDAP name,
     *          false otherwise.
     */
    public boolean endsWith(List<Rdn> rdns) {
        if (rdns == null) {
            return false;
        }
        int len1 = this.rdns.size();
        int len2 = rdns.size();
        return (len1 >= len2 &&
                doesListMatch(len1 - len2, len1, rdns));
    }

    private boolean doesListMatch(int beg, int end, List rdns) {
        for (int i = beg; i < end; i++) {
            if (!this.rdns.get(i).equals(rdns.get(i - beg))) {
                return false;
            }
        }
        return true;
    }

    /*
     * Helper method for startsWith() and endsWith().
     * Returns true if components [beg,end) match the components of "n".
     * If "n" is not an LdapName, each of its components is parsed as
     * the string form of an RDN.
     * The following must hold:  end - beg == n.size().
     */
    private boolean matches(int beg, int end, Name n) {
        if (n instanceof LdapName) {
            LdapName ln = (LdapName) n;
            return doesListMatch(beg, end, ln.rdns);
        } else {
            for (int i = beg; i < end; i++) {
                Rdn rdn;
                String rdnString = n.get(i - beg);
                try {
                    rdn = (new Rfc2253Parser(rdnString)).parseRdn();
                } catch (InvalidNameException e) {
                    return false;
                }
                if (!rdn.equals(rdns.get(i))) {
                    return false;
                }
            }
        }
        return true;
    }

    /**
     * Adds the components of a name -- in order -- to the end of this name.
     *
     * @param   suffix The non-null components to add.
     * @return  The updated name (not a new instance).
     *
     * @throws  InvalidNameException if <tt>suffix</tt> is not a valid LDAP
     *          name, or if the addition of the components would violate the
     *          syntax rules of this LDAP name.
     */
    public Name addAll(Name suffix) throws InvalidNameException {
         return addAll(size(), suffix);
    }

    /**
     * Adds the RDNs of a name -- in order -- to the end of this name.
     *
     * @param   suffixRdns The non-null suffix <tt>Rdn</tt>s to add.
     * @return  The updated name (not a new instance).
     */
    public Name addAll(List<Rdn> suffixRdns) {
        return addAll(size(), suffixRdns);
    }

    /**
     * Adds the components of a name -- in order -- at a specified position
     * within this name. Components of this LDAP name at or after the
     * index (if any) of the first new component are shifted up
     * (away from index 0) to accomodate the new components.
     *
     * @param suffix    The non-null components to add.
     * @param posn      The index at which to add the new component.
     *                  Must be in the range [0,size()].
     *
     * @return  The updated name (not a new instance).
     *
     * @throws  InvalidNameException if <tt>suffix</tt> is not a valid LDAP
     *          name, or if the addition of the components would violate the
     *          syntax rules of this LDAP name.
     * @throws  IndexOutOfBoundsException.
     *          If posn is outside the specified range.
     */
    public Name addAll(int posn, Name suffix)
        throws InvalidNameException {
        unparsed = null;        // no longer valid
        if (suffix instanceof LdapName) {
            LdapName s = (LdapName) suffix;
            rdns.addAll(posn, s.rdns);
        } else {
            Enumeration comps = suffix.getAll();
            while (comps.hasMoreElements()) {
                rdns.add(posn++,
                    (new Rfc2253Parser((String) comps.nextElement()).
                    parseRdn()));
            }
        }
        return this;
    }

    /**
     * Adds the RDNs of a name -- in order -- at a specified position
     * within this name. RDNs of this LDAP name at or after the
     * index (if any) of the first new RDN are shifted up (away from index 0) to
     * accomodate the new RDNs.
     *
     * @param suffixRdns        The non-null suffix <tt>Rdn</tt>s to add.
     * @param posn              The index at which to add the suffix RDNs.
     *                          Must be in the range [0,size()].
     *
     * @return  The updated name (not a new instance).
     * @throws  IndexOutOfBoundsException.
     *          If posn is outside the specified range.
     */
    public Name addAll(int posn, List<Rdn> suffixRdns) {
        unparsed = null;
        for (int i = 0; i < suffixRdns.size(); i++) {
            Object obj = suffixRdns.get(i);
            if (!(obj instanceof Rdn)) {
                throw new IllegalArgumentException("Entry:" + obj +
                "  not a valid type;suffix list entries must be of type Rdn");
            }
            rdns.add(i + posn, obj);
        }
        return this;
    }

    /**
     * Adds a single component to the end of this LDAP name.
     *
     * @param comp      The non-null component to add.
     * @return          The updated LdapName, not a new instance.
     *                  Cannot be null.
     * @exception       InvalidNameException If adding comp at end of the name
     *                  would violate the name's syntax.
     */
    public Name add(String comp) throws InvalidNameException {
        return add(size(), comp);
    }

    /**
     * Adds a single RDN to the end of this LDAP name.
     *
     * @param comp      The non-null RDN to add.
     *
     * @return          The updated LdapName, not a new instance.
     *                  Cannot be null.
     */
    public Name add(Rdn comp) {
        return add(size(), comp);
    }

    /**
     * Adds a single component at a specified position within this
     * LDAP name.
     * Components of this LDAP name at or after the index (if any) of the new
     * component are shifted up by one (away from index 0) to accommodate
     * the new component.
     *
     * @param  comp     The non-null component to add.
     * @param  posn     The index at which to add the new component.
     *                  Must be in the range [0,size()].
     * @return          The updated LdapName, not a new instance.
     *                  Cannot be null.
     * @exception       IndexOutOfBoundsException.
     *                  If posn is outside the specified range.
     * @exception       InvalidNameException If adding comp at the
     *                  specified position would violate the name's syntax.
     */
    public Name add(int posn, String comp) throws InvalidNameException {
        Rdn rdn = (new Rfc2253Parser(comp)).parseRdn();
        rdns.add(posn, rdn);
        unparsed = null;        // no longer valid
        return this;
    }

    /**
     * Adds a single RDN at a specified position within this
     * LDAP name.
     * RDNs of this LDAP name at or after the index (if any) of the new
     * RDN are shifted up by one (away from index 0) to accommodate
     * the new RDN.
     *
     * @param  comp     The non-null RDN to add.
     * @param  posn     The index at which to add the new RDN.
     *                  Must be in the range [0,size()].
     * @return          The updated LdapName, not a new instance.
     *                  Cannot be null.
     * @exception       IndexOutOfBoundsException
     *                  If posn is outside the specified range.
     */
    public Name add(int posn, Rdn comp) {
        if (comp == null) {
            throw new NullPointerException("Cannot set comp to null");
        }
        rdns.add(posn, comp);
        unparsed = null;        // no longer valid
        return this;
    }

    /**
     * Removes a component from this LDAP name.
     * The component of this name at the specified position is removed.
     * Components with indexes greater than this position (if any)
     * are shifted down (toward index 0) by one.
     *
     * @param posn      The index of the component to remove.
     *                  Must be in the range [0,size()).
     * @return          The component removed (a String).
     *
     * @throws          IndexOutOfBoundsException
     *                  if posn is outside the specified range.
     * @throws          InvalidNameException if deleting the component
     *                  would violate the syntax rules of the name.
     */
    public Object remove(int posn) throws InvalidNameException {
        unparsed = null;        // no longer valid
        return rdns.remove(posn).toString();
    }

    /**
     * Retrieves the list of relative distinguished names.
     * The contents of the list are unmodifiable.
     * The indexing of RDNs in the returned list follows the numbering of
     * RDNs as described in the class description.
     * If the name has zero components, an empty list is returned.
     *
     * @return  The name as a list of RDNs which are instances of
     *          the class {@link Rdn Rdn}.
     */
    public List<Rdn> getRdns() {
        return Collections.unmodifiableList(rdns);
    }

    /**
     * Generates a new copy of this name.
     * Subsequent changes to the components of this name will not
     * affect the new copy, and vice versa.
     *
     * @return A copy of the this LDAP name.
     */
    public Object clone() {
        return new LdapName(unparsed, rdns, 0, rdns.size());
    }

    /**
     * Returns a string representation of this LDAP name in a format
     * defined by RFC 2253
     * and described in the class description. If the name has zero
     * components an empty string is returned.
     *
     * @return The string representation of the LdapName.
     */
    public String toString() {
        if (unparsed != null) {
            return unparsed;
        }
        StringBuilder builder = new StringBuilder();
        int size = rdns.size();
        if ((size - 1) >= 0) {
            builder.append((Rdn) rdns.get(size - 1));
        }
        for (int next = size - 2; next >= 0; next--) {
            builder.append(',');
            builder.append((Rdn) rdns.get(next));
        }
        unparsed = builder.toString();
        return unparsed;
    }

    /**
     * Determines whether two LDAP names are equal.
     * If obj is null or not an LDAP name, false is returned.
     *

     * Two LDAP names are equal if each RDN in one is equal
     * to the corresponding RDN in the other. This implies
     * both have the same number of RDNs, and each RDN's
     * equals() test against the corresponding RDN in the other
     * name returns true. See {@link Rdn#equals(Object obj)}
     * for a definition of RDN equality.
     *
     * @param  obj      The possibly null object to compare against.
     * @return          true if obj is equal to this LDAP name,
     *                  false otherwise.
     * @see #hashCode
     */
    public boolean equals(Object obj) {
        // check possible shortcuts
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof LdapName)) {
            return false;
        }
        LdapName that = (LdapName) obj;
        if (rdns.size() != that.rdns.size()) {
            return false;
        }
        if (unparsed != null && unparsed.equalsIgnoreCase(
                that.unparsed)) {
            return true;
        }
        // Compare RDNs one by one for equality
        for (int i = 0; i < rdns.size(); i++) {
            // Compare a single pair of RDNs.
            Rdn rdn1 = (Rdn) rdns.get(i);
            Rdn rdn2 = (Rdn) that.rdns.get(i);
            if (!rdn1.equals(rdn2)) {
                return false;
            }
        }
        return true;
    }

    /**
     * Compares this LdapName with the specified Object for order.
     * Returns a negative integer, zero, or a positive integer as this
     * Name is less than, equal to, or greater than the given Object.
     *

     * If obj is null or not an instance of LdapName, ClassCastException
     * is thrown.
     *

     * Ordering of LDAP names follows the lexicographical rules for
     * string comparison, with the extension that this applies to all
     * the RDNs in the LDAP name. All the RDNs are lined up in their
     * specified order and compared lexicographically.
     * See {@link Rdn#compareTo(Object obj) Rdn.compareTo(Object obj)}
     * for RDN comparison rules.
     *

     * If this LDAP name is lexicographically lesser than obj,
     * a negative number is returned.
     * If this LDAP name is lexicographically greater than obj,
     * a positive number is returned.
     * @param obj The non-null LdapName instance to compare against.
     *
     * @return  A negative integer, zero, or a positive integer as this Name
     *          is less than, equal to, or greater than the given obj.
     * @exception ClassCastException if obj is null or not a LdapName.
     */
    public int compareTo(Object obj) {

        if (!(obj instanceof LdapName)) {
            throw new ClassCastException("The obj is not a LdapName");
        }

        // check possible shortcuts
        if (obj == this) {
            return 0;
        }
        LdapName that = (LdapName) obj;

        if (unparsed != null && unparsed.equalsIgnoreCase(
                        that.unparsed)) {
            return 0;
        }

        // Compare RDNs one by one, lexicographically.
        int minSize = Math.min(rdns.size(), that.rdns.size());
        for (int i = 0; i < minSize; i++) {
            // Compare a single pair of RDNs.
            Rdn rdn1 = (Rdn)rdns.get(i);
            Rdn rdn2 = (Rdn)that.rdns.get(i);

            int diff = rdn1.compareTo(rdn2);
            if (diff != 0) {
                return diff;
            }
        }
        return (rdns.size() - that.rdns.size());        // longer DN wins
    }

    /**
     * Computes the hash code of this LDAP name.
     * The hash code is the sum of the hash codes of individual RDNs
     * of this  name.
     *
     * @return An int representing the hash code of this name.
     * @see #equals
     */
    public int hashCode() {
        // Sum up the hash codes of the components.
        int hash = 0;

        // For each RDN...
        for (int i = 0; i < rdns.size(); i++) {
            Rdn rdn = (Rdn) rdns.get(i);
            hash += rdn.hashCode();
        }
        return hash;
    }

    /**
     * Serializes only the unparsed DN, for compactness and to avoid
     * any implementation dependency.
     *
     * @serialData      The DN string
     */
    private void writeObject(ObjectOutputStream s)
            throws java.io.IOException {
        s.defaultWriteObject();
        s.writeObject(toString());
    }

    private void readObject(ObjectInputStream s)
            throws java.io.IOException, ClassNotFoundException {
        s.defaultReadObject();
        unparsed = (String)s.readObject();
        try {
            parse();
        } catch (InvalidNameException e) {
            // shouldn't happen
            throw new java.io.StreamCorruptedException(
                    "Invalid name: " + unparsed);
        }
    }

    private void parse() throws InvalidNameException {
        // rdns = (ArrayList<Rdn>) (new RFC2253Parser(unparsed)).getDN();

        rdns = (ArrayList) (new Rfc2253Parser(unparsed)).parseDn();
    }
}


text:
<?php

declare(strict_types=1);

namespace Badcow\DNS\Rdata;

use Badcow\DNS\Message;

/**
 * @see https://tools.ietf.org/html/rfc1035#section-3.3.1
 */
class CNAME implements RdataInterface
{
    use RdataTrait;

    public const TYPE = 'CNAME';
    public const TYPE_CODE = 5;

    /**
     * @var string|null
     */
    protected $target;

    public function setTarget(string $target): void
    {
        $this->target = $target;
    }

    /**
     * @return string
     */
    public function getTarget(): ?string
    {
        return $this->target;
    }

    public function toText(): string
    {
        return $this->target ?? '';
    }

    public function toWire(): string
    {
        if (null === $this->target) {
            throw new \InvalidArgumentException('Target must be set.');
        }

        return Message::encodeName($this->target);
    }

    public function fromText(string $text): void
    {
        $this->setTarget($text);
    }

    public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void
    {
        $this->setTarget(Message::decodeName($rdata, $offset));
    }
}


text:
using System;

namespace Jenkins2SkypeMsg.utils.configuration.notifications
{
    class DailyMessagesConfig
    {
        public String type { get; set; }
        public String condition { get; set; }
        public int minToGet { get; set; }
        public int maxToGet { get; set; }
        public String message { get; set; }
    }
}


text:
package tcpopt

import (
	"errors"
	"time"
	"unsafe"
)

const (
	sysSOL_SOCKET = 0xffff

	sysSO_SNDBUF    = 0x1001
	sysSO_RCVBUF    = 0x1002
	sysSO_KEEPALIVE = 0x8

	sysTCP_NODELAY = 0x1

	sysIOC_OUT    = 0x40000000
	sysIOC_IN     = 0x80000000
	sysIOC_VENDOR = 0x18000000
)

var sysSIO_KEEPALIVE_VALS uint = sysIOC_IN | sysIOC_VENDOR | 4

var options = [soMax]option{
	soNodelay:   {ianaProtocolTCP, sysTCP_NODELAY, 0},
	soSndbuf:    {sysSOL_SOCKET, sysSO_SNDBUF, 0},
	soRcvbuf:    {sysSOL_SOCKET, sysSO_RCVBUF, 0},
	soKeepalive: {sysSOL_SOCKET, sysSO_KEEPALIVE, 0},
	soKeepidle:  {ianaProtocolTCP, int(sysSIO_KEEPALIVE_VALS), time.Millisecond},
	soKeepintvl: {ianaProtocolTCP, int(sysSIO_KEEPALIVE_VALS), time.Millisecond},
}

var parsers = map[int64]func([]byte) (Option, error){
	ianaProtocolTCP<<32 | sysTCP_NODELAY:               parseNoDelay,
	sysSOL_SOCKET<<32 | sysSO_SNDBUF:                   parseSendBuffer,
	sysSOL_SOCKET<<32 | sysSO_RCVBUF:                   parseReceiveBuffer,
	sysSOL_SOCKET<<32 | sysSO_KEEPALIVE:                parseKeepAlive,
	ianaProtocolTCP<<32 | int64(sysSIO_KEEPALIVE_VALS): parseKeepAliveValues,
}

// Marshal implements the Marshal method of Option interface.
func (nd NoDelay) Marshal() ([]byte, error) {
	v := boolint32(bool(nd))
	return (*[4]byte)(unsafe.Pointer(&v))[:], nil
}

// Marshal implements the Marshal method of Option interface.
func (mss MSS) Marshal() ([]byte, error) {
	return nil, errors.New("operation not supported")
}

// Marshal implements the Marshal method of Option interface.
func (sb SendBuffer) Marshal() ([]byte, error) {
	v := int32(sb)
	return (*[4]byte)(unsafe.Pointer(&v))[:], nil
}

// Marshal implements the Marshal method of Option interface.
func (rb ReceiveBuffer) Marshal() ([]byte, error) {
	v := int32(rb)
	return (*[4]byte)(unsafe.Pointer(&v))[:], nil
}

// Marshal implements the Marshal method of Option interface.
func (ka KeepAlive) Marshal() ([]byte, error) {
	v := boolint32(bool(ka))
	return (*[4]byte)(unsafe.Pointer(&v))[:], nil
}

// Marshal implements the Marshal method of Option interface.
func (ka KeepAliveIdleInterval) Marshal() ([]byte, error) {
	ka += KeepAliveIdleInterval(options[soKeepidle].uot - time.Nanosecond)
	v := uint32(time.Duration(ka) / options[soKeepidle].uot)
	return (*[4]byte)(unsafe.Pointer(&v))[:], nil
}

// Marshal implements the Marshal method of Option interface.
func (ka KeepAliveProbeInterval) Marshal() ([]byte, error) {
	ka += KeepAliveProbeInterval(options[soKeepintvl].uot - time.Nanosecond)
	v := uint32(time.Duration(ka) / options[soKeepintvl].uot)
	return (*[4]byte)(unsafe.Pointer(&v))[:], nil
}

// Marshal implements the Marshal method of Option interface.
func (ka KeepAliveProbeCount) Marshal() ([]byte, error) {
	return nil, errors.New("operation not supported")
}

// Marshal implements the Marshal method of Option interface.
func (ck Cork) Marshal() ([]byte, error) {
	return nil, errors.New("operation not supported")
}

// Marshal implements the Marshal method of Option interface.
func (ns NotSentLowWMK) Marshal() ([]byte, error) {
	return nil, errors.New("operation not supported")
}

// Marshal implements the Marshal method of Option interface.
func (e Error) Marshal() ([]byte, error) {
	return nil, errors.New("operation not supported")
}

// Marshal implements the Marshal method of Option interface.
func (cn ECN) Marshal() ([]byte, error) {
	return nil, errors.New("operation not supported")
}

func parseNoDelay(b []byte) (Option, error) {
	if len(b) < 4 {
		return nil, errors.New("short buffer")
	}
	return NoDelay(uint32bool(nativeEndian.Uint32(b))), nil
}

func parseSendBuffer(b []byte) (Option, error) {
	if len(b) < 4 {
		return nil, errors.New("short buffer")
	}
	return SendBuffer(nativeEndian.Uint32(b)), nil
}

func parseReceiveBuffer(b []byte) (Option, error) {
	if len(b) < 4 {
		return nil, errors.New("short buffer")
	}
	return ReceiveBuffer(nativeEndian.Uint32(b)), nil
}

func parseKeepAlive(b []byte) (Option, error) {
	if len(b) < 4 {
		return nil, errors.New("short buffer")
	}
	return KeepAlive(uint32bool(nativeEndian.Uint32(b))), nil
}

func parseKeepAliveValues(b []byte) (Option, error) {
	return nil, errors.New("operation not supported")
}


text:
namespace Inventory.Frm
{
    partial class frmTakeStock
    {
        /// <summary>
        /// 必需的设计器变量。
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows 窗体设计器生成的代码

        /// <summary>
        /// 设计器支持所需的方法 - 不要
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            this.menuItem1 = new System.Windows.Forms.MenuItem();
            this.mainMenu1 = new System.Windows.Forms.MainMenu();
            this.miBack = new System.Windows.Forms.MenuItem();
            this.textBox1 = new System.Windows.Forms.TextBox();
            this.tabOther = new System.Windows.Forms.TabPage();
            this.label2 = new System.Windows.Forms.Label();
            this.txtGdBaco = new System.Windows.Forms.TextBox();
            this.lvGd = new System.Windows.Forms.ListView();
            this.lblGdBaco = new System.Windows.Forms.Label();
            this.tabControl = new System.Windows.Forms.TabControl();
            this.tabPage1 = new System.Windows.Forms.TabPage();
            this.listView1 = new System.Windows.Forms.ListView();
            this.tabOther.SuspendLayout();
            this.tabControl.SuspendLayout();
            this.tabPage1.SuspendLayout();
            this.SuspendLayout();
            //
            // menuItem1
            //
            this.menuItem1.Text = "确认";
            //
            // mainMenu1
            //
            this.mainMenu1.MenuItems.Add(this.menuItem1);
            this.mainMenu1.MenuItems.Add(this.miBack);
            //
            // miBack
            //
            this.miBack.Text = "返回";
            //
            // textBox1
            //
            this.textBox1.Anchor = System.Windows.Forms.AnchorStyles.Right;
            this.textBox1.Location = new System.Drawing.Point(69, 3);
            this.textBox1.Name = "textBox1";
            this.textBox1.Size = new System.Drawing.Size(165, 21);
            this.textBox1.TabIndex = 58;
            //
            // tabOther
            //
            this.tabOther.BackColor = System.Drawing.SystemColors.ScrollBar;
            this.tabOther.Controls.Add(this.textBox1);
            this.tabOther.Controls.Add(this.label2);
            this.tabOther.Controls.Add(this.txtGdBaco);
            this.tabOther.Controls.Add(this.lvGd);
            this.tabOther.Controls.Add(this.lblGdBaco);
            this.tabOther.Location = new System.Drawing.Point(0, 0);
            this.tabOther.Name = "tabOther";
            this.tabOther.Size = new System.Drawing.Size(240, 245);
            this.tabOther.Text = "物料";
            //
            // label2
            //
            this.label2.Anchor = System.Windows.Forms.AnchorStyles.Left;
            this.label2.Location = new System.Drawing.Point(4, 4);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(73, 20);
            this.label2.Text = "盘点代码";
            //
            // txtGdBaco
            //
            this.txtGdBaco.Anchor = System.Windows.Forms.AnchorStyles.Right;
            this.txtGdBaco.Location = new System.Drawing.Point(69, 223);
            this.txtGdBaco.Name = "txtGdBaco";
            this.txtGdBaco.Size = new System.Drawing.Size(165, 21);
            this.txtGdBaco.TabIndex = 52;
            //
            // lvGd
            //
            this.lvGd.Location = new System.Drawing.Point(0, 27);
            this.lvGd.Name = "lvGd";
            this.lvGd.Size = new System.Drawing.Size(240, 194);
            this.lvGd.TabIndex = 27;
            //
            // lblGdBaco
            //
            this.lblGdBaco.Anchor = System.Windows.Forms.AnchorStyles.Left;
            this.lblGdBaco.Location = new System.Drawing.Point(4, 226);
            this.lblGdBaco.Name = "lblGdBaco";
            this.lblGdBaco.Size = new System.Drawing.Size(73, 20);
            this.lblGdBaco.Text = "包装码";
            //
            // tabControl
            //
            this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.tabControl.Controls.Add(this.tabOther);
            this.tabControl.Controls.Add(this.tabPage1);
            this.tabControl.Dock = System.Windows.Forms.DockStyle.None;
            this.tabControl.Location = new System.Drawing.Point(0, 0);
            this.tabControl.Name = "tabControl";
            this.tabControl.SelectedIndex = 0;
            this.tabControl.Size = new System.Drawing.Size(240, 268);
            this.tabControl.TabIndex = 23;
            //
            // tabPage1
            //
            this.tabPage1.BackColor = System.Drawing.SystemColors.ScrollBar;
            this.tabPage1.Controls.Add(this.listView1);
            this.tabPage1.Location = new System.Drawing.Point(0, 0);
            this.tabPage1.Name = "tabPage1";
            this.tabPage1.Size = new System.Drawing.Size(240, 245);
            this.tabPage1.Text = "条码";
            //
            // listView1
            //
            this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.listView1.Location = new System.Drawing.Point(0, 0);
            this.listView1.Name = "listView1";
            this.listView1.Size = new System.Drawing.Size(240, 245);
            this.listView1.TabIndex = 28;
            //
            // frmTakeStock
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
            this.AutoScroll = true;
            this.ClientSize = new System.Drawing.Size(240, 268);
            this.Controls.Add(this.tabControl);
            this.Menu = this.mainMenu1;
            this.Name = "frmTakeStock";
            this.Text = "盘点";
            this.tabOther.ResumeLayout(false);
            this.tabControl.ResumeLayout(false);
            this.tabPage1.ResumeLayout(false);
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.MenuItem menuItem1;
        private System.Windows.Forms.MainMenu mainMenu1;
        private System.Windows.Forms.MenuItem miBack;
        private System.Windows.Forms.TextBox textBox1;
        private System.Windows.Forms.TabPage tabOther;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.TextBox txtGdBaco;
        private System.Windows.Forms.ListView lvGd;
        private System.Windows.Forms.Label lblGdBaco;
        private System.Windows.Forms.TabControl tabControl;
        private System.Windows.Forms.TabPage tabPage1;
        private System.Windows.Forms.ListView listView1;
    }
}


text:
/**
 * Handles the dialog for uploading files to non-SSU accounts.
 */
wesabe.$class('wesabe.views.widgets.accounts.ManualUploadDialog', wesabe.views.widgets.Dialog, function($class, $super, $package) {
  $.extend($class.prototype, {
    _account: null,
    _form: null,
    _accountUriInput: null,
    _fiLink: null,

    init: function(element, account) {
      $super.init.call(this, element);
      this._account = account;
      this._accountUriInput = element.find('input[name=account_uri]');
      this._fiLink = element.find('a.fi-link');
      this._form = element.find('form');
    },

    show: function() {
      this._accountUriInput.val(this._account.get('uri'));
      this._fiLink.attr('href', this._account.get('uri')+'/financial_institution_site');
      $super.show.apply(this, arguments);
    },

    onBlur: function() {
      this.hide();
    },

    onConfirm: function() {
      this._form[0].submit();
    }
  });
});


text:
RollingLinks is a jQuery plugin for create rolling effect at links. It works in all modern browsers with support CSS transitions and transformations.

Tested with jQuery versions 1.8+

File size is

Documentation and examples are here:

Inspired by Hakim's demo: https://github.com/hakimel/

## Usage

You can simply init RollingLinks with one line:

```javascript
$('element').rollingLinks();
```

and linking 'rollingLinks.css' file to the project:

```html
<link rel="stylesheet" href="path/to/your/rollingLinks.css">
```

MIT Licensed

**enjoy!**


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Uses of Class org.springframework.aop.framework.adapter.UnknownAdviceTypeException (Spring Framework)
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.springframework.aop.framework.adapter.UnknownAdviceTypeException

Packages that use UnknownAdviceTypeException

org.springframework.aop.framework.adapter
SPI package allowing Spring AOP framework to handle arbitrary advice types.

Uses of UnknownAdviceTypeException in org.springframework.aop.framework.adapter

Methods in org.springframework.aop.framework.adapter that throw UnknownAdviceTypeException

 Advisor
DefaultAdvisorAdapterRegistry.wrap(java.lang.Object adviceObject)

 org.aopalliance.intercept.Interceptor
DefaultAdvisorAdapterRegistry.getInterceptor(Advisor advisor)

 Advisor
AdvisorAdapterRegistry.wrap(java.lang.Object advice)

          Return an Advisor wrapping the given advice

 org.aopalliance.intercept.Interceptor
AdvisorAdapterRegistry.getInterceptor(Advisor advisor)

          Return an AOP Alliance Interceptor to allow use of the given
 Advisor in an interception-based framework.

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright (C) 2003-2004 The Spring Framework Project.