text:
#region License

#endregion
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Collections.Generic;
using System.Web.Routing;
namespace System.Web.Mvc.Html
{
    public static class LabelExtensionsEx
    {
        // LABELEX
        public static MvcHtmlString LabelEx(this HtmlHelper htmlHelper, string expression) { return LabelEx(htmlHelper, expression, (IDictionary<string, object>)null, null); }
        public static MvcHtmlString LabelEx(this HtmlHelper htmlHelper, string expression, IDictionary<string, object> htmlAttributes) { return LabelEx(htmlHelper, expression, htmlAttributes, null); }
        public static MvcHtmlString LabelEx(this HtmlHelper htmlHelper, string expression, IDictionary<string, object> htmlAttributes, Action<ModelMetadata> metadataModifer)
        {
            IEnumerable<ILabelViewModifier> modifier;
            var metadata = ModelMetadata.FromStringExpression(expression, htmlHelper.ViewData);
            if ((metadata != null) && (metadata.TryGetExtent<IEnumerable<ILabelViewModifier>>(out modifier)))
                modifier.MapLabelToHtmlAttributes(ref expression, ref htmlAttributes);
            if (metadataModifer != null)
                metadataModifer(metadata);
            return LabelHelperEx(htmlHelper, metadata, expression, htmlAttributes);
        }
        public static MvcHtmlString LabelEx(this HtmlHelper htmlHelper, string expression, object htmlAttributes) { return LabelEx(htmlHelper, expression, (IDictionary<string, object>)new RouteValueDictionary(htmlAttributes), null); }
        public static MvcHtmlString LabelEx(this HtmlHelper htmlHelper, string expression, object htmlAttributes, Action<ModelMetadata> metadataModifer) { return LabelEx(htmlHelper, expression, (IDictionary<string, object>)new RouteValueDictionary(htmlAttributes), metadataModifer); }

        // LABELFOREX
        public static MvcHtmlString LabelForEx<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression) { return LabelForEx<TModel, TProperty>(htmlHelper, expression, (IDictionary<string, object>)null, null); }
        public static MvcHtmlString LabelForEx<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, IDictionary<string, object> htmlAttributes) { return LabelForEx<TModel, TProperty>(htmlHelper, expression, htmlAttributes, null); }
        public static MvcHtmlString LabelForEx<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, IDictionary<string, object> htmlAttributes, Action<ModelMetadata> metadataModifer)
        {
            IEnumerable<ILabelViewModifier> modifier;
            var metadata = ModelMetadata.FromLambdaExpression<TModel, TProperty>(expression, htmlHelper.ViewData);
            if ((metadata != null) && (metadata.TryGetExtent<IEnumerable<ILabelViewModifier>>(out modifier)))
                modifier.MapLabelToHtmlAttributes(ref expression, ref htmlAttributes);
            if (metadataModifer != null)
                metadataModifer(metadata);
            return LabelHelperEx(htmlHelper, metadata, ExpressionHelper.GetExpressionText(expression), htmlAttributes);
        }
        public static MvcHtmlString LabelForEx<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, object htmlAttributes) { return LabelForEx<TModel, TProperty>(htmlHelper, expression, (IDictionary<string, object>)new RouteValueDictionary(htmlAttributes), null); }
        public static MvcHtmlString LabelForEx<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, object htmlAttributes, Action<ModelMetadata> metadataModifer) { return LabelForEx<TModel, TProperty>(htmlHelper, expression, (IDictionary<string, object>)new RouteValueDictionary(htmlAttributes), metadataModifer); }

        // LABELFORMODELEX
        public static MvcHtmlString LabelForModelEx(this HtmlHelper htmlHelper) { return LabelForModelEx(htmlHelper, null); }
        public static MvcHtmlString LabelForModelEx(this HtmlHelper htmlHelper, Action<ModelMetadata> metadataModifer)
        {
            return LabelHelperEx(htmlHelper, htmlHelper.ViewData.ModelMetadata, string.Empty, null);
        }

        internal static MvcHtmlString LabelHelperEx(HtmlHelper htmlHelper, ModelMetadata metadata, string htmlFieldName, IDictionary<string, object> htmlAttributes)
        {
            string text = (metadata.DisplayName ?? (metadata.PropertyName ?? htmlFieldName.Split(new char[] { '.' }).Last<string>()));
            if (string.IsNullOrEmpty(text))
                return MvcHtmlString.Empty;
            var templateInfo = htmlHelper.ViewContext.ViewData.TemplateInfo;
            var fullFieldName = templateInfo.GetFullHtmlFieldName(htmlFieldName);
            var labelTag = new TagBuilder("label");
            labelTag.MergeAttributes<string, object>(htmlAttributes);
            ModelState state;
            if ((!string.IsNullOrEmpty(fullFieldName)) && (htmlHelper.ViewData.ModelState.TryGetValue(fullFieldName, out state)) && (state.Errors.Count > 0))
                labelTag.AddCssClass(HtmlHelperExtensions.ValidationLabelCssClassName);
            labelTag.Attributes.Add("for", CreateSanitizedId(templateInfo.GetFullHtmlFieldId(htmlFieldName), HtmlHelper.IdAttributeDotReplacement));
            labelTag.SetInnerText(text);
            return labelTag.ToMvcHtmlString(TagRenderMode.Normal);
        }

        #region from tagbuilder
        private static class Html401IdUtil
        {
            private static bool IsAllowableSpecialCharacter(char c)
            {
                char ch = c;
                return !(((ch != '-') && (ch != ':')) && (ch != '_'));
            }

            private static bool IsDigit(char c)
            {
                return (('0' <= c) && (c <= '9'));
            }

            public static bool IsLetter(char c)
            {
                return ((('A' <= c) && (c <= 'Z')) || (('a' <= c) && (c <= 'z')));
            }

            public static bool IsValidIdCharacter(char c)
            {
                return (!IsLetter(c) && !IsDigit(c) ? IsAllowableSpecialCharacter(c) : true);
            }
        }

        internal static string CreateSanitizedId(string originalId, string dotReplacement)
        {
            if (string.IsNullOrEmpty(originalId))
                return null;
            char c = originalId[0];
            if (!Html401IdUtil.IsLetter(c))
                return null;
            var b = new StringBuilder(originalId.Length);
            b.Append(c);
            for (int i = 1; i < originalId.Length; i++)
            {
                char ch2 = originalId[i];
                if (Html401IdUtil.IsValidIdCharacter(ch2))
                    b.Append(ch2);
                else
                    b.Append(dotReplacement);
            }
            return b.ToString();
        }
        #endregion
    }
}


text:
package dev.jeka.core.tool.builtins.scaffold;

import dev.jeka.core.api.depmanagement.JkRepoFromProperties;
import dev.jeka.core.api.depmanagement.resolution.JkDependencyResolver;
import dev.jeka.core.api.function.JkConsumers;
import dev.jeka.core.api.utils.JkUtilsIO;
import dev.jeka.core.api.utils.JkUtilsString;
import dev.jeka.core.tool.JkBean;
import dev.jeka.core.tool.JkDoc;

import java.util.function.Consumer;

/**
 * Provides method to generate a project skeleton (folder structure, configuration files, ....)
 */
@JkDoc("Generates project skeletons (folder structure and basic build files).")
public class ScaffoldJkBean extends JkBean {

    private JkScaffolder scaffolder;

    @JkDoc("If set then the wrapper shell script will delegate 'jekaw' call to jekaw script located in the specified folder")
    public String wrapDelegatePath;

    @JkDoc("Set the Jeka version to fetch for the wrapper. If null, it will use the same Jeka version than the running one.")
    public String wrapperJekaVersion;

    @JkDoc("Add extra content at the end of the template cmd.properties file.")
    public String cmdExtraContent = "";

    @JkDoc("Add extra content at the end of the template project.properties file.")
    public String projectPropsExtraContent = "";

    private JkConsumers<JkScaffolder, Void> configurators = JkConsumers.of();

    private JkScaffolder scaffolder() {
        if (scaffolder != null) {
            return scaffolder;
        }
        this.scaffolder = new JkScaffolder(getBaseDir());
        this.scaffolder.setJekaClassCodeProvider(
                () -> JkUtilsIO.read(ScaffoldJkBean.class.getResource("buildclass.snippet")));
        final JkDependencyResolver dependencyResolver = JkDependencyResolver.of()
                .addRepos(JkRepoFromProperties.getDownloadRepos());
        this.scaffolder.setDependencyResolver(dependencyResolver);
        this.scaffolder.addCmdFileContent(this.cmdExtraContent);
        this.scaffolder.addProjectPropsFileContent(this.projectPropsExtraContent);
        configurators.accept(scaffolder);
        return scaffolder;
    }

    @JkDoc("Generates project skeleton (folders and files necessary to work with the project).")
    public void run() {
        scaffolder().run();
    }

    @JkDoc("Copies Jeka wrapper executable inside the project in order to be run in wrapper mode.")
    public void wrapper() {
        if (JkUtilsString.isBlank(wrapDelegatePath)) {
            scaffolder().createStandardWrapperStructure();
        } else {
            scaffolder().createWrapperStructureWithDelagation(wrapDelegatePath);
        }
    }

    public ScaffoldJkBean configure(Consumer<JkScaffolder> configurator) {
        this.configurators.append(configurator);
        return this;
    }

}

redpajama_set_name: RedPajamaGithub


text:
package au.gov.dva.sopapi.sopref;

import au.gov.dva.sopapi.dtos.IncidentType;
import au.gov.dva.sopapi.dtos.sopref.*;
import au.gov.dva.sopapi.dtos.sopref.DefinedTerm;
import au.gov.dva.sopapi.dtos.sopref.FactorDto;
import au.gov.dva.sopapi.dtos.sopref.Operation;
import au.gov.dva.sopapi.dtos.sopsupport.CaseTraceDto;
import au.gov.dva.sopapi.dtos.sopsupport.components.*;
import au.gov.dva.sopapi.dtos.sopsupport.inferredAcceptance.FactorLinkDto;
import au.gov.dva.sopapi.interfaces.CaseTrace;
import au.gov.dva.sopapi.interfaces.model.*;
import au.gov.dva.sopapi.sopref.data.servicedeterminations.ServiceDeterminationPair;
import au.gov.dva.sopapi.sopsupport.processingrules.DeploymentImpl;
import au.gov.dva.sopapi.sopsupport.processingrules.ServiceHistoryImpl;
import au.gov.dva.sopapi.sopsupport.processingrules.ServiceImpl;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

public class DtoTransformations {

    public static FactorDto fromFactor(au.gov.dva.sopapi.interfaces.model.Factor factor) {
        return new FactorDto(factor.getParagraph(), factor.getText(),
                factor.getDefinedTerms().stream().map(t -> DtoTransformations.fromDefinedTerm(t)).collect(Collectors.toList()));

    }

    public static FactorLinkDto fromFactorToLink(au.gov.dva.sopapi.interfaces.model.Factor factor) {

        String conditionVariantName = factor.getConditionVariant().isPresent() ? factor.getConditionVariant().get().getName() : null;
        return new FactorLinkDto(factor.getParagraph(), factor.getText(),
                factor.getDefinedTerms().stream().map(t -> DtoTransformations.fromDefinedTerm(t)).collect(Collectors.toList()),conditionVariantName);

    }

    public static DefinedTerm fromDefinedTerm(au.gov.dva.sopapi.interfaces.model.DefinedTerm definedTerm) {
        return new DefinedTerm(definedTerm.getTerm(), definedTerm.getDefinition());
    }

    public static Operation fromOperation(au.gov.dva.sopapi.interfaces.model.Operation operation) {
        return new Operation(operation.getName(),
                formatDate(operation.getStartDate()),
                operation.getEndDate().isPresent() ? Optional.of(formatDate(operation.getEndDate().get())) : Optional.empty(),
                operation.getServiceType().toString());
    }

    public static SoPFactorsResponse fromSop(SoP sop,  IncidentType incidentType) {

        ImmutableList<au.gov.dva.sopapi.interfaces.model.Factor> factorsToInclude = (incidentType == IncidentType.Aggravation) ?
                sop.getAggravationFactors() : ((incidentType == IncidentType.Onset) ?
                sop.getOnsetFactors() : ImmutableList.of());

        List<FactorDto> factorDtos = factorsToInclude.stream().map(f -> DtoTransformations.fromFactor(f)).collect(Collectors.toList());

        String instrumentNumber = String.format("%d/%d", sop.getInstrumentNumber().getNumber(), sop.getInstrumentNumber().getYear());

        return new SoPFactorsResponse(sop.getRegisterId(), sop.getCitation(), instrumentNumber, factorDtos);

    }

    public static OperationsResponse buildOperationsResponseDto(ServiceDeterminationPair latestServiceDeterminations) {
        List<String> registerIds = latestServiceDeterminations.getBoth().stream()
                .map(sd -> sd.getRegisterId())
                .collect(Collectors.toList());

        List<Operation> operations = latestServiceDeterminations.getBoth().stream()
                .flatMap(sd -> sd.getOperations().stream())
                .sorted((o1, o2) -> o2.getStartDate().compareTo(o1.getStartDate()))
                .map(DtoTransformations::fromOperation)
                .collect(Collectors.toList());

        return new OperationsResponse(registerIds, operations);
    }

    public static FactorWithInferredResultDto fromFactorWithSatisfaction(FactorWithSatisfaction factorWithSatisfaction) {

        FactorDto factorDto = fromFactor(factorWithSatisfaction.getFactor());
        return new FactorWithInferredResultDto(
                factorDto.get_paragraph(),
                factorDto.get_text(),
                factorDto.get_definedTerms(),
                factorWithSatisfaction.isSatisfied()
        );
    }

    public static ServiceHistory serviceHistoryFromDto(ServiceHistoryDto serviceHistoryDto)
    {
        return new ServiceHistoryImpl(serviceHistoryDto.get_serviceSummaryInfoDto().get_originalHireDate(),
                serviceHistoryDto.get_serviceDetailsArray().stream().map(serviceDto -> serviceFromDto(serviceDto))
        .collect(Collectors.collectingAndThen(Collectors.toList(),ImmutableSet::copyOf)));
    }

    private static Deployment deploymentFromDeploymentDto(OperationalServiceDto operationalServiceDto)
    {
        return new DeploymentImpl(operationalServiceDto.get_description()
                ,operationalServiceDto.get_startDate()
                ,operationalServiceDto.get_endDate() != null ? Optional.of(operationalServiceDto.get_endDate()) : Optional.empty()
                ,operationalServiceDto.get_event());

    }

    private static Service serviceFromDto(ServiceDto serviceDto)
    {
        return new ServiceImpl(serviceDto.get_serviceName(),
                serviceDto.get_serviceType(),
                serviceDto.get_rank(),
                serviceDto.get_startDate(),
                serviceDto.get_endDate() != null ? Optional.of(serviceDto.get_endDate()): Optional.empty(),
                serviceDto.get_operationalServiceDtos().stream().map(operationalServiceDto -> deploymentFromDeploymentDto(operationalServiceDto)).collect(Collectors.collectingAndThen(Collectors.toList(), ImmutableSet::copyOf)));

    }

    public static CaseTraceDto caseTraceDtoFromCaseTrace(CaseTrace caseTrace)
    {
        return new CaseTraceDto(
                caseTrace.getConditionName(),
                caseTrace.getApplicableStandardOfProof(),
                caseTrace.getRequiredCftsDays(),
                caseTrace.getRequiredCftsDaysForRh(),
                caseTrace.getRequiredCftsDaysForBop(),
                caseTrace.getActualCftsDays(),
                caseTrace.getRequiredOperationalDaysForRh(),
                caseTrace.getActualOperationalDays(),
                caseTrace.getRhFactors().stream().map(f -> fromFactor(f)).collect(Collectors.toList()),
                caseTrace.getBopFactors().stream().map(f -> fromFactor(f)).collect(Collectors.toList()),
                caseTrace.getReasonings(),
                caseTrace.getLoggingTraces());
    }

    private static String formatDate(LocalDate localDate)
    {
        return localDate.format(DateTimeFormatter.ISO_LOCAL_DATE);
    }
}


text:
<?php

namespace ProdaCom\FilterBundle\Configuration;

use Symfony\Component\Config\Definition\Processor;
use Symfony\Component\Form\FormInterface;

/**
 * Class FilterConfigurationBuilder
 * @package ProdaCom\FilterBundle\Configuration
 */
class FilterConfigurationBuilder {

    /**
     * @var array
     */
    private $configuration = [];

    /**
     * @var FormInterface
     */
    private $form;

    /**
     * FilterConfigurationBuilder constructor.
     * @param FormInterface $form
     */
    public function __construct(FormInterface $form) {
        $this->form = $form;
    }

    /**
     * @param $formField
     * @param array $options
     * @return FilterConfigurationBuilder
     */
    public function addMapping($formField, array $options) {
        $processor = new Processor();

        $configuration = $processor->processConfiguration(new FilterConfiguration(), ['root' => $options]);

        if (!empty($configuration['fields'])) {
            if (isset($configuration['operator'])) {
                $this->configuration[$formField]['operator'] = $configuration['operator'];
            }

            foreach ($configuration['fields'] as $name => $fieldConfig) {
                $this->configuration[$formField]['fields'][$name] = $fieldConfig;
            }
        }

        return $this;
    }

    /**
     * @return ResolvedFilterConfiguration
     */
    public function finalizeConfiguration() {
        $configuration = new ResolvedFilterConfiguration();

        foreach ($this->configuration as $name => $fieldMappings) {
            $formField = new FormField();
            $formField
                ->setName($name)
                ->setOperatorMethod(isset($fieldMappings['operator']) ? $fieldMappings['operator'] : null)
            ;

            foreach ($fieldMappings['fields'] as $name => $filterType) {
                $alias = isset($filterType['alias']) ? $filterType['alias'] : null;

                $field = new FieldMapping($name, $filterType['comparison'], $alias);

                $formField->addField($field);
            }

            $configuration->addFormField($formField);
        }

        return $configuration;
    }

}


text:
#include "SkTLS.h"

static void* gSpecific = NULL;

void* SkTLS::PlatformGetSpecific(bool) {
    return gSpecific;
}

void SkTLS::PlatformSetSpecific(void* ptr) {
    gSpecific = ptr;
}


text:
module Import
  class BitbucketServerService < Import::BaseService
    attr_reader :client, :params, :current_user

    def execute(credentials)
      if blocked_url?
        return log_and_return_error("Invalid URL: #{url}", :bad_request)
      end

      unless authorized?
        return log_and_return_error("You don't have permissions to create this project", :unauthorized)
      end

      unless repo
        return log_and_return_error("Project %{project_repo} could not be found" % { project_repo: "#{project_key}/#{repo_slug}" }, :unprocessable_entity)
      end

      project = create_project(credentials)

      if project.persisted?
        success(project)
      else
        log_and_return_error(project_save_error(project), :unprocessable_entity)
      end
    rescue BitbucketServer::Connection::ConnectionError => e
      log_and_return_error("Import failed due to a BitBucket Server error: #{e}", :bad_request)
    end

    private

    def create_project(credentials)
      Gitlab::BitbucketServerImport::ProjectCreator.new(
        project_key,
        repo_slug,
        repo,
        project_name,
        target_namespace,
        current_user,
        credentials
      ).execute
    end

    def repo
      @repo ||= client.repo(project_key, repo_slug)
    end

    def project_name
      @project_name ||= params[:new_name].presence || repo.name
    end

    def namespace_path
      @namespace_path ||= params[:new_namespace].presence || current_user.namespace_path
    end

    def target_namespace
      @target_namespace ||= find_or_create_namespace(namespace_path, current_user.namespace_path)
    end

    def repo_slug
      @repo_slug ||= params[:bitbucket_server_repo]
    end

    def project_key
      @project_key ||= params[:bitbucket_server_project]
    end

    def url
      @url ||= params[:bitbucket_server_url]
    end

    def authorized?
      can?(current_user, :create_projects, target_namespace)
    end

    def allow_local_requests?
      Gitlab::CurrentSettings.allow_local_requests_from_web_hooks_and_services?
    end

    def blocked_url?
      Gitlab::UrlBlocker.blocked_url?(
        url,
        {
          allow_localhost: allow_local_requests?,
          allow_local_network: allow_local_requests?,
          schemes: %w(http https)
        }
      )
    end

    def log_and_return_error(message, error_type)
      log_error(message)
      error(_(message), error_type)
    end

    def log_error(message)
      Gitlab::Import::Logger.error(
        message: 'Import failed due to a BitBucket Server error',
        error: message
      )
    end
  end
end


text:
package org.zaproxy.addon.spider.parser;

import org.parosproxy.paros.network.HttpHeader;
import org.parosproxy.paros.network.HttpMessage;
import org.parosproxy.paros.network.HttpStatusCode;

/** The Class SpiderRedirectParser is used for parsing of HTTP Redirection messages. */
public class SpiderRedirectParser extends SpiderParser {

    @Override
    public boolean parseResource(ParseContext ctx) {
        getLogger().debug("Parsing an HTTP redirection resource...");

        HttpMessage message = ctx.getHttpMessage();
        String location = message.getResponseHeader().getHeader(HttpHeader.LOCATION);
        if (location != null && !location.isEmpty()) {
            // Include the base url as well as some applications send relative URLs instead of
            // absolute ones
            processUrl(ctx, location);
        }
        // We consider the message fully parsed
        return true;
    }

    @Override
    public boolean canParseResource(ParseContext ctx, boolean wasAlreadyParsed) {
        return HttpStatusCode.isRedirection(
                ctx.getHttpMessage().getResponseHeader().getStatusCode());
    }
}


text:
<?php
namespace litepubl\core;

      Header( 'Cache-Control: no-cache, must-revalidate');
      Header( 'Pragma: no-cache');
    error_reporting(E_ALL | E_NOTICE | E_STRICT | E_WARNING );
    ini_set('display_errors', 1);

define('litepubl\mode', 'ignoreRequest');
include('index.php');

   $password = Str::md5uniq();
   litepubl::$app->options->changepassword($password);
   litepubl::$app->poolStorage->commit();
echo "<pre>\n";
echo litepubl::$app->options->email;
echo "\n$password\n<br>new password";


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Pertusaria confundens Nyl.

### Remarks
null


text:
#pragma once
#include <aws/elasticloadbalancing/ElasticLoadBalancing_EXPORTS.h>
#include <aws/elasticloadbalancing/ElasticLoadBalancingRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace ElasticLoadBalancing
{
namespace Model
{

  /**
   *
Contains the parameters for DeleteLoadBalancer.

See Also:
   AWS
   * API Reference

   */
  class AWS_ELASTICLOADBALANCING_API DeleteLoadBalancerRequest : public ElasticLoadBalancingRequest
  {
  public:
    DeleteLoadBalancerRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "DeleteLoadBalancer"; }

    Aws::String SerializePayload() const override;

  protected:
    void DumpBodyToUrl(Aws::Http::URI& uri ) const override;

  public:

    /**
     *
The name of the load balancer.

     */
    inline const Aws::String& GetLoadBalancerName() const{ return m_loadBalancerName; }

    /**
     *
The name of the load balancer.

     */
    inline bool LoadBalancerNameHasBeenSet() const { return m_loadBalancerNameHasBeenSet; }

    /**
     *
The name of the load balancer.

     */
    inline void SetLoadBalancerName(const Aws::String& value) { m_loadBalancerNameHasBeenSet = true; m_loadBalancerName = value; }

    /**
     *
The name of the load balancer.

     */
    inline void SetLoadBalancerName(Aws::String&& value) { m_loadBalancerNameHasBeenSet = true; m_loadBalancerName = std::move(value); }

    /**
     *
The name of the load balancer.

     */
    inline void SetLoadBalancerName(const char* value) { m_loadBalancerNameHasBeenSet = true; m_loadBalancerName.assign(value); }

    /**
     *
The name of the load balancer.

     */
    inline DeleteLoadBalancerRequest& WithLoadBalancerName(const Aws::String& value) { SetLoadBalancerName(value); return *this;}

    /**
     *
The name of the load balancer.

     */
    inline DeleteLoadBalancerRequest& WithLoadBalancerName(Aws::String&& value) { SetLoadBalancerName(std::move(value)); return *this;}

    /**
     *
The name of the load balancer.

     */
    inline DeleteLoadBalancerRequest& WithLoadBalancerName(const char* value) { SetLoadBalancerName(value); return *this;}

  private:

    Aws::String m_loadBalancerName;
    bool m_loadBalancerNameHasBeenSet;
  };

} // namespace Model
} // namespace ElasticLoadBalancing
} // namespace Aws


text:
<Record>
<Term>Floropryl</Term>
<SemanticType>Pharmacologic Substance</SemanticType>
<SemanticType>Organic Chemical</SemanticType>
<PrimarySemanticType>Pharmacologic Substance</PrimarySemanticType>
<Synonym>Isoflurophate</Synonym>
<Source>FDA Registry</Source>
</Record>


text:
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
class Application_Service_Importcsv {

	public function getAllData($params){
		$adminDb = new Application_Model_DbTable_Importcsv();
		return $adminDb->getAllData($params);
	}
	public function addData($params,$provider,$program,$period){
		$adminDb = new Application_Model_DbTable_Importcsv();
		return $adminDb->addData($params,$provider,$program,$period);
	}

}


text:
namespace arc {

// Implements message routing to communicate with arc_support Chrome App.
// Provides JSON (base::Value) APIs for the communication.
class ArcSupportMessageHost : public extensions::NativeMessageHost {
 public:
  class Observer {
   public:
    // Called when an message is sent from arc_support Chrome App.
    virtual void OnMessage(const base::DictionaryValue& message) = 0;

   protected:
    virtual ~Observer() = default;
  };

  static const char kHostName[];
  static const char* const kHostOrigin[];

  // Called when the arc_support connects the "port". Returns the
  // instance of ArcSupportMessageHost.
  static std::unique_ptr<NativeMessageHost> Create();

  ~ArcSupportMessageHost() override;

  // Sends a message to arc_support. If the client is not yet ready, the
  // message will be just ignored.
  void SendMessage(const base::Value& message);

  // Registers (or unregisters if nullptr) the observer. Currently this class
  // assumes that it has only one observer.
  void SetObserver(Observer* observer);

 private:
  // Keep private. The instance will be created via Create().
  ArcSupportMessageHost();

  // extensions::NativeMessageHost overrides:
  void Start(Client* client) override;
  void OnMessage(const std::string& request_string) override;
  scoped_refptr<base::SingleThreadTaskRunner> task_runner() const override;

  Observer* observer_ = nullptr;
  Client* client_ = nullptr;

  DISALLOW_COPY_AND_ASSIGN(ArcSupportMessageHost);
};

}  // namespace arc

#endif  // CHROME_BROWSER_CHROMEOS_ARC_EXTENSIONS_ARC_SUPPORT_MESSAGE_HOST_H_


text:
<?php

namespace Zogs\UtilsBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class ZogsUtilsBundle extends Bundle
{
}


text:
using System;
using System.Dynamic;
using System.Threading.Tasks;
using System.Reflection;
using System.Collections.Generic;

public static class MonoEmbedding
{
    static Int64 MinDateTimeTicks = 621355968000000000; // (new DateTime(1970, 1, 1, 0, 0, 0)).Ticks;

    // dummy Main so we can exec from mono
    static public int Main()
    {
        return 0;
    }

    static public Exception NormalizeException(Exception e)
    {
        AggregateException aggregate = e as AggregateException;
        if (aggregate != null && aggregate.InnerExceptions.Count == 1)
        {
            e = aggregate.InnerExceptions[0];
        }
        else {
            TargetInvocationException target = e as TargetInvocationException;
            if (target != null && target.InnerException != null)
            {
                e = target.InnerException;
            }
        }

        return e;
    }

    static public Type GetIDictionaryStringObjectType()
    {
        return typeof(IDictionary<string, Object>);
    }

    static public Type GetUriType()
    {
        return typeof(Uri);
    }

    static public Func<Object, Task<Object>> GetFunc(string assemblyFile, string typeName, string methodName)
    {
        var assembly = Assembly.LoadFrom(assemblyFile);
        var wrap = ClrFuncReflectionWrap.Create(assembly, typeName, methodName);
        return new Func<Object, Task<Object>>(wrap.Call);
    }

    static public DateTime CreateDateTime(double ticks)
    {
        return new DateTime((Int64)ticks * 10000 + MinDateTimeTicks, DateTimeKind.Utc);
    }

    static public ExpandoObject CreateExpandoObject()
    {
        return new ExpandoObject();
    }

    static public double GetDateValue(DateTime dt)
    {
        if (dt.Kind == DateTimeKind.Local)
            dt = dt.ToUniversalTime();
        else if (dt.Kind == DateTimeKind.Unspecified)
            dt = new DateTime(dt.Ticks, DateTimeKind.Utc);
        Int64 value = (dt.Ticks - MinDateTimeTicks) / 10000;

        return (double)value;
    }

    static public object[] IDictionaryToFlatArray(object dictionary)
    {
        var list = new List<object>();
        IDictionary<string, object> dso = dictionary as IDictionary<string, object>;
        if (dso != null)
        {
            foreach (var kv in dso)
            {
                list.Add(kv.Key);
                list.Add(kv.Value);
            }
        }
        else
        {
            System.Collections.IDictionary d = dictionary as System.Collections.IDictionary;
            if (d != null)
            {
                foreach (System.Collections.DictionaryEntry kv in d)
                {
                    if ((kv.Key as string) != null)
                    {
                        list.Add(kv.Key);
                        list.Add(kv.Value);
                    }
                }
            }
            else
            {
                throw new InvalidOperationException("Expected a dictionary.");
            }
        }

        return list.ToArray();
    }

    static public object[] IEnumerableToArray(System.Collections.IEnumerable enumerable)
    {
        var list = new List<object>();
        foreach (var item in enumerable)
            list.Add(item);

        return list.ToArray();
    }

    static public Type GetFuncType()
    {
        return typeof(Func<Object, Task<Object>>);
    }

    static public void edgeAppCompletedOnCLRThread(Task<object> task, object state)
    {
        var context = (ClrFuncInvokeContext)state;
        context.CompleteOnCLRThread(task);
    }

    static public void ContinueTask(Task<object> task, object state)
    {
        // Will complete asynchronously. Schedule continuation to finish processing.
        task.ContinueWith(new Action<Task<object>, object>(edgeAppCompletedOnCLRThread), state);
    }

    static public string ObjectToString(object o)
    {
        return o.ToString();
    }

    static public double Int64ToDouble(long i64)
    {
        return (double)i64;
    }

    static public string TryConvertPrimitiveOrDecimal(object obj)
    {
        Type t = obj.GetType();
        if (t.IsPrimitive || typeof(Decimal) == t)
        {
            IConvertible c = obj as IConvertible;
            return c == null ? obj.ToString() : c.ToString();
        }
        else
        {
            return null;
        }
    }

    // used for ExpandoObject & IDictionary<string, object> to add values
    static public void AddPropertyToObject( object obj, string propName, object val)
    {
        var eo = obj as IDictionary<string, object>;
        if ( eo == null )
            return;

        eo.Add(propName, val);
    }
}


text:
namespace gfx {
class Rect;
}

namespace cc {

class CC_EXPORT ContentDrawQuadBase : public DrawQuad {
 public:
  void SetNew(const SharedQuadState* shared_quad_state,
              DrawQuad::Material material,
              const gfx::Rect& rect,
              const gfx::Rect& opaque_rect,
              const gfx::Rect& visible_rect,
              const gfx::RectF& tex_coord_rect,
              const gfx::Size& texture_size,
              bool swizzle_contents,
              bool nearest_neighbor);

  void SetAll(const SharedQuadState* shared_quad_state,
              DrawQuad::Material material,
              const gfx::Rect& rect,
              const gfx::Rect& opaque_rect,
              const gfx::Rect& visible_rect,
              bool needs_blending,
              const gfx::RectF& tex_coord_rect,
              const gfx::Size& texture_size,
              bool swizzle_contents,
              bool nearest_neighbor);

  gfx::RectF tex_coord_rect;
  gfx::Size texture_size;
  bool swizzle_contents;
  bool nearest_neighbor;

 protected:
  ContentDrawQuadBase();
  ~ContentDrawQuadBase() override;
  void ExtendValue(base::trace_event::TracedValue* value) const override;
};

}  // namespace cc

#endif  // CC_QUADS_CONTENT_DRAW_QUAD_BASE_H_


text:
import { NgModule, ModuleWithProviders } from "@angular/core";
import { CommonModule } from "@angular/common";
import {RestaurantService} from "../../providers/Restaurant.service";
import {TableComponent} from "../../directives/diagram/diagram.component";
import {CustomModals} from "../../directives/modals/CustomModals";
import {FoodService} from "../../providers/Menu.server";

@NgModule({
    imports:      [ CommonModule ],
    declarations: [ TableComponent, CustomModals ],
    exports:      [ TableComponent, CustomModals ]
})
export class SharedModule {

    static forRoot(): ModuleWithProviders {
        return {
            ngModule: SharedModule,
            providers: [
                RestaurantService,
                FoodService
            ]
        };
    }
}


text:
package com.chmbrs.apps.notepad;

import com.google.android.apps.analytics.GoogleAnalyticsTracker;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.provider.LiveFolders;

public class NotePadLiveFolder extends Activity
{
	public static final Uri CONTENT_URI = Uri.parse("content://"+ Notes.PROVIDER_NAME+"/live_folders/notes");
	public static final Uri NOTE_URI = Uri.parse("content://"+ Notes.PROVIDER_NAME+"/notes/#");

	private GoogleAnalyticsTracker tracker;
	private NotePadApplication app;
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);

		final Intent intent = getIntent();
		final String action = intent.getAction();
		app = ((NotePadApplication) NotePadLiveFolder.this.getApplication());
		tracker = app.getTracker();

		if(LiveFolders.ACTION_CREATE_LIVE_FOLDER.equals(action))
		{
			tracker.trackEvent(
	                "Home Screen",
	                "Live Folder",
	                "Create Live Folder",
	                 0);
			setResult(RESULT_OK, createLiveFolder(this, CONTENT_URI, getString(R.string.defaultLiveFolderName), android.R.drawable.ic_menu_agenda));
		}
		else
		{
			setResult(RESULT_CANCELED);
		}
		finish();
	}
	private static Intent createLiveFolder(Context context, Uri contentUri, String folderName, int icon)
	{
		final Intent intent = new Intent();
		intent.setData(CONTENT_URI);
		intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_NAME, folderName);
		intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_ICON, Intent.ShortcutIconResource.fromContext(context, icon));
		intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_DISPLAY_MODE, LiveFolders.DISPLAY_MODE_LIST);
		intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_BASE_INTENT, new Intent(Intent.ACTION_EDIT, NOTE_URI));
		return intent;
	}
}


text:
package de.SweetCode.TextAdventure.Conversations;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Yonas on 20.08.2015.
 */
public class Conversation {

    private List<Conversational> conversationals = new ArrayList<Conversational>();

    public Conversation() {}

    public Conversation add(Conversational conversational) {
        this.conversationals.add(conversational);
        return this;
    }

    public void start() {

        for(Conversational conversational : this.conversationals) {

            conversational.send();

        }

    }

}


text:
require 'rspec'
require 'aws-sdk'

RSpec.configure do |config|
  config.treat_symbols_as_metadata_keys_with_true_values = true
  config.run_all_when_everything_filtered = true
  config.filter_run :focus
  config.order = 'random'
end

class Dummy
  def method_missing(name, *args, &block)
    #puts "Tried to handle unknown method %s" % name # name is a symbol
    #unless args.empty?
      #puts "It had arguments: %p" % [args]
    #end
  end
end

require "#{File.dirname(__FILE__)}/aws_mock.rb"


text:
#pragma once

class CShellFolder;

///////////////////////////////////////////////////////////////////////////////
// CImageThumbnailProvider

class ATL_NO_VTABLE CImageThumbnailProvider :
   public CComObjectRootEx<CComSingleThreadModel>,
   public IThumbnailProvider
{
public:
   CRefPtr<CShellFolder> m_spFolder;
   CPidl m_pidlItem;

   BEGIN_COM_MAP(CImageThumbnailProvider)
      COM_INTERFACE_ENTRY(IThumbnailProvider)
   END_COM_MAP()

   HRESULT Init(CShellFolder* pFolder, PCUITEMID_CHILD pidlItem);

   // IThumbnailProvider

   STDMETHOD(GetThumbnail)(UINT cx, HBITMAP* phbmp, WTS_ALPHATYPE* pdwAlpha);
};

// Creation helper
HRESULT SHCreateImageThumbProvider(CShellFolder* pFolder, PCUITEMID_CHILD pidlItem, REFIID riid, LPVOID* ppRetVal);


text:
require 'rubygems'
require 'sequel'

Sequel.migration do

  up do

    create_table :contributors do
      primary_key :id
      Integer :contributor_id
      Integer :user_id # account being contributed to
      timestamp :created_at
      timestamp :updated_at
    end

    [:items, :comments].each do |table|
      alter_table table do
        add_column :contributor_id, Integer
      end
    end

    self[:contributors].insert({:contributor_id => 1, :user_id => 4, :created_at => Time.now})
    self[:contributors].insert({:contributor_id => 2, :user_id => 4, :created_at => Time.now})
    self[:contributors].insert({:contributor_id => 3, :user_id => 4, :created_at => Time.now})

    self[:comments].insert({:owner_id => 4, :contributor_id => 1, :text => 'contributor comment by 1 for 4', :created_at => Time.now})
    self[:comments].insert({:owner_id => 4, :contributor_id => 2, :text => 'contributor comment about [item-1] by 2 for 4', :created_at => Time.now})
    self[:comments].insert({:owner_id => 4, :contributor_id => 3, :reply_to_id => 8, :text => 'contributor reply (3 to reply 2) by 3 for 4', :created_at => Time.now})
  end

  down do
    drop_table :contributors, :cascade => true

    [:items, :comments].each do |table|
      alter_table table do
        drop_column :contributor_id
      end
    end
  end
end


text:
package org.sky.x.tij.c04;

public class Garbage {

	protected void finalize(){

	}

	public static void main(String[] args){

	}
}


text:
function values = snc_pp_strings(jobj,jdata,shape)
% Post process NC_STRING data into cell arrays.
if isempty(jdata)
    values = {''};
    return;
elseif strcmp(version('-release'),'14')
    % In R14, we must use the 2.2.x release of java.  No access to the
    % "getObject" method.  Assuming a single-valued string.
    values = {char(jobj.getStringValue())};
    return;
end

% Make it a 1D vector until we know how to shape it properly.
values = cell([1 prod(shape)]);

switch class(jdata.getObject(0))
    case 'opendap.dap.DString'
        for j = 1:prod(shape)
            values{j} = char(jdata.getObject(j-1).getValue());
        end

    otherwise
        for j = 1:prod(shape)
            values{j} = jdata.getObject(j-1);
        end
end

% If just a single string, then do not store it as a cell array.
% netcdf-java treats nc_char as just a single-valued case of nc_string,
% but mexcdf cannot do this.
if numel(values) == 1
    values = values{1};
else
    % Ok more than one value string value.  If a 1D vector, make it a row
    % vector.
    %values = reshape(values, fliplr(shape));
    sz = size(values);
    if sz(1) == 1
        % already 1D, nothing to do.
    else sz(2) == 1
        values = values';
    end
end


text:
<?php

namespace Symfonian\Indonesia\AdminBundle\Contract;

use DateTime;

/**
 * @author Muhammad Surya Ihsanuddin <surya.kejawen@gmail.com>
 */
interface SoftDeletableInterface
{
    /**
     * @param null $isDeleted
     *
     * @return bool
     */
    public function isDeleted($isDeleted = null);

    /**
     * @param DateTime $date
     */
    public function setDeletedAt(DateTime $date);

    /**
     * @return DateTime
     */
    public function getDeletedAt();

    /**
     * @param $username
     */
    public function setDeletedBy($username);

    /**
     * @return string
     */
    public function getDeletedBy();
}


text:
/**
 * @file
 * @author  Mateusz Malicki (m.malicki2@samsung.com)
 * @brief   IPCSignalWrapper and IPCMethodWrapper classes used to hide IPC specifics
 */

#ifndef SERVER_IPC_CALLBACK_WRAPPER_HPP
#define SERVER_IPC_CALLBACK_WRAPPER_HPP

#include "api/messages.hpp"
#include "api/method-result-builder.hpp"
#include "api/ipc-method-result-builder.hpp"

#include <functional>

namespace vasum {

template<typename ArgIn>
class IPCSignalWrapper {
public:
    typedef typename std::remove_cv<ArgIn>::type in;
    typedef std::function<void(const in&)> type;

    static typename cargo::ipc::SignalHandler<in>::type
    getWrapper(const type& callback) {
        return [callback](const cargo::ipc::PeerID, const std::shared_ptr<in>& argIn)
        {
            callback(*argIn);
            return cargo::ipc::HandlerExitCode::SUCCESS;
        };
    }
};

template<>
class IPCSignalWrapper<const api::Void> {
public:
    typedef api::Void in;
    typedef std::function<void()> type;

    static typename cargo::ipc::SignalHandler<in>::type
    getWrapper(const type& callback) {
        return [callback](const cargo::ipc::PeerID, const std::shared_ptr<in>& /* argIn */)
        {
            callback();
            return cargo::ipc::HandlerExitCode::SUCCESS;
        };
    }
};

template<typename ArgIn = const api::Void, typename ArgOut = api::Void>
class IPCMethodWrapper {
public:
    typedef typename std::remove_cv<ArgIn>::type in;
    typedef ArgOut out;
    typedef std::function<void(const in&, api::MethodResultBuilder::Pointer)> type;

    static typename cargo::ipc::MethodHandler<out, in>::type
    getWrapper(const type& callback) {
        return [callback](const cargo::ipc::PeerID,
                          const std::shared_ptr<in>& argIn,
                          cargo::ipc::MethodResult::Pointer&& argOut)
        {
            auto rb = std::make_shared<api::IPCMethodResultBuilder>(argOut);
            callback(*argIn, rb);
            return cargo::ipc::HandlerExitCode::SUCCESS;
        };
    }
};

template<typename ArgOut>
class IPCMethodWrapper<ArgOut, typename std::enable_if<!std::is_const<ArgOut>::value, api::Void>::type> {
public:
    typedef api::Void in;
    typedef ArgOut out;
    typedef std::function<void(api::MethodResultBuilder::Pointer)> type;

    static typename cargo::ipc::MethodHandler<out, in>::type
    getWrapper(const type& callback) {
        return [callback](const cargo::ipc::PeerID,
                          const std::shared_ptr<in>& /* argIn */,
                          cargo::ipc::MethodResult::Pointer&& argOut)
        {
            auto rb = std::make_shared<api::IPCMethodResultBuilder>(argOut);
            callback(rb);
            return cargo::ipc::HandlerExitCode::SUCCESS;
        };
    }
};

} // namespace vasum

#endif // SERVER_IPC_CALLBACK_WRAPPER_HPP


text:
/**
  Contains various helper functions.
*/

#ifndef CVWRAP_COMMON_H
#define CVWRAP_COMMON_H

#include <maya/MDagPath.h>
#include <maya/MDoubleArray.h>
#include <maya/MFloatVectorArray.h>
#include <maya/MIntArray.h>
#include <maya/MMatrix.h>
#include <maya/MPoint.h>
#include <maya/MPointArray.h>
#include <maya/MString.h>
#include <map>
#include <vector>
#include <set>

#ifdef __AVX__
#include <xmmintrin.h>
#include <immintrin.h>
#endif

/**
  Helper function to start a new progress bar.
  @param[in] title Status title.
  @param[in] count Progress bar maximum count.
*/
void StartProgress(const MString& title, unsigned int count);

/**
  Helper function to increase the progress bar by the specified amount.
  @param[in] step Step amount.
*/
void StepProgress(int step);

/**
  Check if the progress has been cancelled.
  @return true if the progress has been cancelled.
*/
bool ProgressCancelled();

/**
  Ends any running progress bar.
*/
void EndProgress();

/**
  Checks if the path points to a shape node.
  @param[in] path A dag path.
  @return true if the path points to a shape node.
 */
bool IsShapeNode(MDagPath& path);

/**
  Ensures that the given dag path points to a non-intermediate shape node.
  @param[in,out] path Path to a dag node that could be a transform or a shape.
  On return, the path will be to a shape node if one exists.
  @param[in] intermediate true to get the intermediate shape.
  @return MStatus.
 */
MStatus GetShapeNode(MDagPath& path, bool intermediate=false);

/**
  Get the MDagPath of an object.
  @param[in] name Name of a dag node.
  @param[out] path Storage for the dag path.
 */
MStatus GetDagPath(MString& name, MDagPath& path);

/**
  Delete all intermediate shapes of the given dag path.
  @param[in] path MDagPath.
 */
MStatus DeleteIntermediateObjects(MDagPath& path);

/**
  Helper struct to hold the 3 barycentric coordinates.
*/
struct BaryCoords {
  float coords[3];
  float operator[](int index) const { return coords[index]; }
  float& operator[](int index) { return coords[index]; }
};

/**
  Get the barycentric coordinates of point P in the triangle specified by points A,B,C.
  @param[in] P The sample point.
  @param[in] A Triangle point.
  @param[in] B Triangle point.
  @param[in] C Triangle point.
  @param[out] coords Barycentric coordinates storage.
*/
void GetBarycentricCoordinates(const MPoint& P, const MPoint& A, const MPoint& B, const MPoint& C,
                               BaryCoords& coords);

/**
  Get the vertex adjacency of the specified mesh.  The vertex adjacency are the vertex ids
  of the connected faces of each vertex.
  @param[in] pathMesh Path to a mesh.
  @param[out] adjacency Ajdancency storage of the adjancency per vertex id.
 */
MStatus GetAdjacency(MDagPath& pathMesh, std::vector<std::set<int> >& adjacency);

/**
  Crawls the surface to find all the points within the sampleradius.
  @param[in] startPoint The position from which to start the crawl.
  @param[in] vertexIndices The starting vertex indices we want to crawl to.
  @param[in] points The array of all the mesh points.
  @param[in] maxDistance The maximum crawl distance.
  @param[in] adjacency Vertex adjacency data from the GetAdjacency function.
  @param[out] distances Storage for the distances to the crawled points.
  @return MStatus
 */
MStatus CrawlSurface(const MPoint& startPoint, const MIntArray& vertexIndices, MPointArray& points, double maxDistance,
                     std::vector<std::set<int> >& adjacency, std::map<int, double>& distances);

/**
  Calculates a weight for each vertex within the crawl sample radius.  Vertices that are further
  away from the origin should have a lesser effect than vertices closer to the origin.
  @param[in] distances Crawl distances calculated from CrawlSurface.
  @param[in] radius Sample radius.
  @param[out] vertexIds Storage for the vertex ids sampled during the crawl.
  @param[out] weights Storage for the calculated weights of each sampled vertex.
*/
void CalculateSampleWeights(const std::map<int, double>& distances, double radius,
                            MIntArray& vertexIds, MDoubleArray& weights);

 /**
   Creates an orthonormal basis using the given point and two axes.
   @param[in] origin Position.
   @param[in] normal Normal vector.
   @param[in] up Up vector.
   @param[out] matrix Generated matrix.
 */
void CreateMatrix(const MPoint& origin, const MVector& normal, const MVector& up,
                  MMatrix& matrix);

/**
  Calculates the components necessary to create a wrap basis matrix.
  @param[in] weights The sample weights array from the wrap binding.
  @param[in] coords The barycentric coordinates of the closest point.
  @param[in] triangleVertices The vertex ids forming the triangle of the closest point.
  @param[in] points The driver point array.
  @param[in] normals The driver per-vertex normal array.
  @param[in] sampleIds The vertex ids on the driver of the current sample.
  @param[in] alignedStorage double array that is 32 byte aligned for AVX.
  @param[out] origin The origin of the coordinate system.
  @param[out] up The up vector of the coordinate system.
  @param[out] normal The normal vector of the coordinate system.
*/
void CalculateBasisComponents(const MDoubleArray& weights, const BaryCoords& coords,
                              const MIntArray& triangleVertices, const MPointArray& points,
                              const MFloatVectorArray& normals, const MIntArray& sampleIds,
                              double* alignedStorage,
                              MPoint& origin, MVector& up, MVector& normal);

/**
  Ensures that the up and normal vectors are perpendicular to each other.
  @param[in] weights The sample weights array from the wrap binding.
  @param[in] points The driver point array.
  @param[in] sampleIds The vertex ids on the driver of the current sample.
  @param[in] origin The origin of the coordinate system.
  @param[in] up The up vector of the coordinate system.
  @param[out] normal The normal vector of the coordinate system.
*/
void GetValidUp(const MDoubleArray& weights, const MPointArray& points,
                const MIntArray& sampleIds, const MPoint& origin, const MVector& normal,
                MVector& up);

template <typename T>
struct ThreadData {
  unsigned int start;
  unsigned int end;
  unsigned int numTasks;
  double* alignedStorage;
  T* pData;

#ifdef __AVX__
  ThreadData() {
    alignedStorage = (double*) _mm_malloc(4*sizeof(double), 256);
  }
  ~ThreadData() {
    _mm_free(alignedStorage);
  }
#endif
};

/**
  Creates the data stuctures that will be sent to each thread.  Divides the vertices into
  discrete chunks to be evaluated in the threads.
  @param[in] taskCount The number of individual tasks we want to divide the calculation into.
  @param[in] elementCount The number of vertices or elements to be divided up.
  @param[in] taskData The TaskData or BindData object.
  @param[out] threadData The array of ThreadData objects.  It is assumed the array is of size taskCount.
*/
template <typename T>
void CreateThreadData(int taskCount, unsigned int elementCount, T* taskData, ThreadData<T>* threadData) {
  unsigned int taskLength = (elementCount + taskCount - 1) / taskCount;
  unsigned int start = 0;
  unsigned int end = taskLength;
  int lastTask = taskCount - 1;
  for(int i = 0; i < taskCount; i++) {
    if (i == lastTask) {
      end = elementCount;
    }
    threadData[i].start = start;
    threadData[i].end = end;
    threadData[i].numTasks = taskCount;
    threadData[i].pData = taskData;

    start += taskLength;
    end += taskLength;
  }
}

#ifdef __AVX__
/**
  Calculates 4 dot products at once.
  @param[in] w1 Weight vector x element.
  @param[in] w2 Weight vector y element.
  @param[in] w3 Weight vector z element.
  @param[in] w4 Weight vector w element.
  @param[in] p1 First vector.
  @param[in] p2 Second vector.
  @param[in] p3 Third vector.
  @param[in] p4 Fourth vector.
  @return A __m256d vector where each element is the corresponding p vector dot product with w.
 */
template <typename T>
__m256d Dot4(double w1, double w2, double w3, double w4,
             const T& p1, const T& p2, const T& p3, const T& p4) {
  __m256d xxx = _mm256_set_pd(p1.x, p2.x, p3.x, p4.x);
  __m256d yyy = _mm256_set_pd(p1.y, p2.y, p3.y, p4.y);
  __m256d zzz = _mm256_set_pd(p1.z, p2.z, p3.z, p4.z);
  __m256d www = _mm256_set_pd(w1, w2, w3, w4);
  __m256d xw = _mm256_mul_pd(xxx, www);
  __m256d yw = _mm256_mul_pd(yyy, www);
  __m256d zw = _mm256_mul_pd(zzz, www);
  __m256d ww = _mm256_mul_pd(www, www); // Dummy
  // low to high: xw0+xw1 yw0+yw1 xw2+xw3 yw2+yw3
  __m256d temp01 = _mm256_hadd_pd(xw, yw);
  // low to high: zw0+zw1 ww0+ww1 zw2+zw3 ww2+ww3
  __m256d temp23 = _mm256_hadd_pd(zw, ww);
  // low to high: xw2+xw3 yw2+yw3 zw0+zw1 ww0+ww1
  __m256d swapped = _mm256_permute2f128_pd(temp01, temp23, 0x21);
  // low to high: xw0+xw1 yw0+yw1 zw2+zw3 ww2+ww3
  __m256d blended = _mm256_blend_pd(temp01, temp23, 0xC);
  // low to high: xw0+xw1+xw2+xw3 yw0+yw1+yw2+yw3 zw0+zw1+zw2+zw3 ww0+ww1+ww2+ww3
  __m256d dotproduct = _mm256_add_pd(swapped, blended);
  return dotproduct;
}
#endif

#endif


text:
import { Test, TestingModule } from '@nestjs/testing';
import { ConfigService } from './config.service';
import { CONFIG_OPTIONS } from './constants';

jest.mock('dotenv');
jest.mock('fs');

describe('ConfigService', () => {
  let service: ConfigService;

  beforeEach(async () => {
    const moduleRef: TestingModule = await Test.createTestingModule({
      providers: [
        ConfigService,
        {
          provide: CONFIG_OPTIONS,
          useValue: {
            folder: 'config',
          },
        },
      ],
    }).compile();

    service = moduleRef.get<ConfigService>(ConfigService);
  });

  it('should be defined', () => {
    expect(service).toBeDefined();
  });
});


text:
layout: post
title: "Rebrand: From Joe's GitHub Blog to JoeHx Blog"
tags: [meta, rebrand]
keywords: [blog, blogging, github, rebrand]
image: /images/rebrand/rebrand.jpg
---

If you've been to this blog before, you'll notice that I changed the name from **Joe's GitHub Blog** to **JoeHx Blog**. I also changed the tagline from **Personal Finance, Programming, Politics, and Other Ponderings** to **Writing What I Want**.

I'm currently undergoing a slight rebrand of the site.

## The Reasoning

The main reason is that I needed to remove the word *GitHub* from the name.

This blog is not affiliated with GitHub. I merely serve this blog via [GitHub Pages](https://pages.github.com/).

So it is *a GitHub blog*. Which made sense when I first created the blog. However, I don't want to get in any legal trouble with Microsoft. [(Microsoft bought GitHub back in 2018)](https://news.microsoft.com/2018/06/04/microsoft-to-acquire-github-for-7-5-billion/).

I've not received any cease-and-desist correspondence from Microsoft, although I think it would be cool if I did. I'm just doing this proactively.

Another reason is I plan on moving to a custom domain soon, and I didn't want to use the letters "g" "i" "t" "h" "u" and "b" in the domain.

## The Name

"Joe" is a pretty generic name. There's probably a "[Joe's Blog](https://www.google.com/search?q=joe's+blog)" out there already, and I need to differentiate myself somehow.

Some time ago I started referring to myself as *JoeHx* on blog comments instead of simply *Joe*. Not sure how long ago, but the oldest comment I could find was on someones [blog post from June 26, 2014](https://clubthrifty.com/worst-money-mistakes/#comment-500025).

So I could've renamed the blog **JoeHx's Blog** except *how do you pronounce that?* That's the issue with making nouns possessive that end with "s" or an "s" sound.

So, **JoeHx's Blog** would just be *friggin awkward* like using "he and/or she" instead of just one or the other (hint: use the singular they or make the object plural to begin with).

Just look at all these articles on making -s nouns possessive:

* [Apostrophes with Names Ending in s, ch, or z](https://data.grammarbook.com/blog/apostrophes/apostrophes-with-names-ending-in-s-ch-or-z/)
* [Apostrophes with Words Ending in s](https://data.grammarbook.com/blog/apostrophes/apostrophes-with-words-ending-in-s/)
* [Forming Possessives With Singular Names](https://blog.apastyle.org/apastyle/2013/06/forming-possessives-with-singular-names.html)
* [Possessive of Proper Names Ending in S](https://www.dailywritingtips.com/possessive-of-proper-names-ending-in-s/)
* [Apostrophes and Possessive Nouns, Part 2: Apostrophe After S](https://magoosh.com/toefl/2016/apostrophes-and-possessive-nouns-part-2-apostrophe-after-s/)
* [What is the possessive form of words ending in S?](https://www.quora.com/What-is-the-possessive-form-of-words-ending-in-S)

**Blog of JoeHx** sounds awkward, too. Plus, using "of" to show possession is supposed to be used for inanimate objects. Think "the engine of the car" versus "the car's engine."

So screw it, I thought. Just throw my name and the word blog together. No possessive necessary.

**JoeHx Blog**.

## The Tagline

Before it was **Personal Finance, Programming, Politics, and Other Ponderings**, it was **Programming, Politics, and Ponderings**.

But as I began more and more to write about [money](https://www.joehxblog.com/tags/#money), I decided to throw in "Personal Finance" in the tagline since it fit with the alliteration.

However, on this site at least, I'll write whatever I want to.

So, I initially thought I should set the new tagline to **Writing Whatever I Want To**.

It still uses alliteration, but ut's a bit long, and that [dangling preposition](https://en.wikipedia.org/wiki/Preposition_stranding) is unnecessary.

So I cleaned it up and simplified it a bit.

Now it's simply **Writing What I Want**.

## The Process

So, I had decided on a name, but before I went all switchy-switchy on everything, I had to make sure things were available.

Things like domains, Twitter usernames, and Facebook page names.

Things like... Well, that's pretty much it.

### Facebook

I tried a little over a year ago to change my Facebook page to just *JoeHx* but Facebook rejected the name change since I removed the "Blog" from the name.

![The message from Facebook rejecting the name change.](/images/rebrand/facebook-reject-name-change-message.png)
*The message from Facebook rejecting the name change.*

I had no problems switching to *JoeHx Blog*. Even though Facebook says the process could take a few days, the change was approved almost immediately.

![The message from Facebook approving the name change.](/images/rebrand/facebook-approve-name-change-message.png)
*The message from Facebook approving the name change.*

I also made sure the username of the page - the part that is in the URL - was changed to `JoeHxBlog` as well.

![The old Facebook header image.](/images/rebrand/old-facebook.jpg)
*The old Facebook header image.*

![The new Facebook header image.](/images/rebrand/facebook.png)
*The new Facebook header image.*

### Twitter

On Twitter, [@JoeHx](https://twitter.com/JoeHx) has been taken (in fact, it's been suspended). Thankfully, [@JoeHxBlog](https://twitter.com/JoeHxBlog) has not. I did create another account to ensure no one takes my old [@JoesGitHubBlog](https://twitter.com/JoesGitHubBlog) one.

![The old Twitter header image.](/images/rebrand/old-twitter.jpg)
*The old Twitter header image.*

![The new Twitter header image.](/images/rebrand/twitter.png)
*The new Twitter header image.*

### The Domain

I've already purchased `JoeHxBlog.com`. `JoeHx.com` is taken (it's just one of those coming-soon-under-construction landing pages right now). Thanks to the European GDPR, [WHOIS no longer gives owner contact information](https://www.plagiarismtoday.com/2018/05/17/the-quiet-death-of-whois/). I can't contact who owns it to offer to purchase (it's probably outside my price range, anyway).

I briefly considered `Joe.Hx` or `JoeHx.Blog` (or even `Joe.Hx.Blog`). Well, there's no `.Hx` top-level domain. I buy my [domains from Google](https://domains.google/). They don't support the `.BLOG` ending.

Here are [the domains Google does support](https://support.google.com/domains/answer/6010092).

That and a *proper* domain ends in either .com, .net, .org, .gov, or .mil, dag-nab-it!

> Two letter top-level-domains represent country codes. What country would be `.hx`?

So `JoeHxBlog.com` it is.

Once I make the switch, I'll have to [update my domain on Google Search Console](https://support.google.com/webmasters/answer/6033049) as well as see if I can get any [backlinks to this site](https://www.joehxblog.com/featured/) that I know of updated.

I'm not too worried about all the old comments I've posted on various blogs throughout the years. I'm still going to deliver the blog through GitHub Pages, which means `hendrixjoseph.github.io` and all its pages will have a 301 Permanent Redirect to the new site.

That's how my other blog works - https://hendrixjoseph.github.io/puppy-snuggles redirects to https://www.puppy-snuggles.com/.

Hopefully, this will help any SEO link juice transfer to the new URL.

### Modifying Some Jekyll Code

In preparation for the changes, I had to modify some of the "backend" code for my blog.

This blog is served via [GitHub Pages](https://pages.github.com/), which uses a static site generator known as [Jekyll](https://jekyllrb.com/).

I needed to go through every piece of my site looking for places where I typed in either the blog's old name (Joe's GitHub Blog) or the URL (`hendrixjoseph.github.io`) instead of referencing a variable.

I also needed to make sure I didn't change anytime I didn't want to use the variable... Or accidentally make the variable assigned to itself.

It wasn't too hard. I use [Notepad++](https://notepad-plus-plus.org/) at home, which has pretty robust text-search and replace capabilities. It took me no time at all, but I did hard code the name and URL way too many times.

## Almost Done

The last thing I had to do is fix my default share image since it said "Joe's GitHub Blog" on it.

![The old default share image.](/images/rebrand/old-index-cover.png)
*The old default share image.*

![The new default share image.](/images/rebrand/index-cover.png)
*The new default share image.*

Just got changing the domain left, which I'll probably do this weekend.


text:
<?php
/**
 * ContactNote
 *
 * PHP version 5
 *
 * @category Class
 * @package  BrightpearlApiClient
 * @author   http://github.com/swagger-api/swagger-codegen
 * @license  http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
 * @link     https://github.com/swagger-api/swagger-codegen
 */
/**
 *  Copyright 2016 SmartBear Software
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
/**
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen
 * Do not edit the class manually.
 */

namespace BrightpearlApiClient\Model;

use \ArrayAccess;
/**
 * ContactNote Class Doc Comment
 *
 * @category    Class
 * @description
 * @package     BrightpearlApiClient
 * @author      http://github.com/swagger-api/swagger-codegen
 * @license     http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
 * @link        https://github.com/swagger-api/swagger-codegen
 */
class ContactNote implements ArrayAccess
{
    /**
      * Array of property to type mappings. Used for (de)serialization
      * @var string[]
      */
    static $swaggerTypes = array(
        'text' => 'string',
        'is_public' => 'bool',
        'added_on' => 'string'
    );

    /**
      * Array of attributes where the key is the local name, and the value is the original name
      * @var string[]
      */
    static $attributeMap = array(
        'text' => 'text',
        'is_public' => 'isPublic',
        'added_on' => 'addedOn'
    );

    /**
      * Array of attributes to setter functions (for deserialization of responses)
      * @var string[]
      */
    static $setters = array(
        'text' => 'setText',
        'is_public' => 'setIsPublic',
        'added_on' => 'setAddedOn'
    );

    /**
      * Array of attributes to getter functions (for serialization of requests)
      * @var string[]
      */
    static $getters = array(
        'text' => 'getText',
        'is_public' => 'getIsPublic',
        'added_on' => 'getAddedOn'
    );

    /**
      * $text
      * @var string
      */
    protected $text;

    /**
      * $is_public
      * @var bool
      */
    protected $is_public;

    /**
      * $added_on
      * @var string
      */
    protected $added_on;

    /**
     * Constructor
     * @param mixed[] $data Associated array of property value initalizing the model
     */
    public function __construct(array $data = null)
    {
        if ($data != null) {
            $this->text = $data["text"];
            $this->is_public = $data["is_public"];
            $this->added_on = $data["added_on"];
        }
    }

    /**
     * Gets text
     * @return string
     */
    public function getText()
    {
        return $this->text;
    }

    /**
     * Sets text
     * @param string $text
     * @return $this
     */
    public function setText($text)
    {

        $this->text = $text;
        return $this;
    }

    /**
     * Gets is_public
     * @return bool
     */
    public function getIsPublic()
    {
        return $this->is_public;
    }

    /**
     * Sets is_public
     * @param bool $is_public
     * @return $this
     */
    public function setIsPublic($is_public)
    {

        $this->is_public = $is_public;
        return $this;
    }

    /**
     * Gets added_on
     * @return string
     */
    public function getAddedOn()
    {
        return $this->added_on;
    }

    /**
     * Sets added_on
     * @param string $added_on
     * @return $this
     */
    public function setAddedOn($added_on)
    {

        $this->added_on = $added_on;
        return $this;
    }

    /**
     * Returns true if offset exists. False otherwise.
     * @param  integer $offset Offset
     * @return boolean
     */
    public function offsetExists($offset)
    {
        return isset($this->$offset);
    }

    /**
     * Gets offset.
     * @param  integer $offset Offset
     * @return mixed
     */
    public function offsetGet($offset)
    {
        return $this->$offset;
    }

    /**
     * Sets value based on offset.
     * @param  integer $offset Offset
     * @param  mixed   $value  Value to be set
     * @return void
     */
    public function offsetSet($offset, $value)
    {
        $this->$offset = $value;
    }

    /**
     * Unsets offset.
     * @param  integer $offset Offset
     * @return void
     */
    public function offsetUnset($offset)
    {
        unset($this->$offset);
    }

    /**
     * Gets the string presentation of the object
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) {
            return json_encode(\BrightpearlApiClient\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
        } else {
            return json_encode(\BrightpearlApiClient\ObjectSerializer::sanitizeForSerialization($this));
        }
    }
}


text:
package us.guihouse.autobank.repositories;

import us.guihouse.autobank.models.client.Token;

import java.security.SecureRandom;
import java.sql.*;
import java.util.Base64;

/**
 * Classe responsável por criar o tokens e gerenciar tokens de usários logados no mobile
 * Created by vrjunior on 15/10/16.
 * @author Guilherme Otranto
 * @author Valmir Massonir Jr.
 */
public class TokenRepository {
    private Connection conn;

    public TokenRepository(Connection conn) {
        this.conn = conn;
    }

    /**
     * Gera uma string aletória base 64
     * @return string randômica base 64
     */
    private String generateTokenString(){
        SecureRandom random = new SecureRandom();
        byte bytes[] = new byte[64];
        random.nextBytes(bytes);

        Base64.Encoder encoder = Base64.getUrlEncoder().withoutPadding();
        return encoder.encodeToString(bytes);
    }

    /**
     * Cria um token e persiste no banco associando-o ao cliente.
     * @param clientId id do cliente
     * @return objeto Token contendo o token em si, id do token e data de criação.
     */
    public Token createToken(Long clientId) {
        Token tokenResult = new Token();
        Long id = null;
        java.util.Date creationDate = new Date(System.currentTimeMillis());
        String strToken = this.generateTokenString();
        StringBuilder insertTokenSql = new StringBuilder();

        insertTokenSql.append("INSERT INTO TOKENS(CLIENT_ID, TOKEN, CREATION_DATE)")
        .append("VALUES(?, ?, ?)");

        try {
            String generatedColumns[] = { "ID" };
            PreparedStatement preparedStatement = conn.prepareStatement(insertTokenSql.toString(), generatedColumns);
            preparedStatement.setLong(1, clientId);
            preparedStatement.setString(2, strToken);
            preparedStatement.setDate(3, new Date(creationDate.getTime()));
            preparedStatement.executeUpdate();

            //getting last id inserted
            ResultSet rs = preparedStatement.getGeneratedKeys();
            if(rs.next()) {
                id = rs.getLong(1);
            }
            preparedStatement.close();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        tokenResult.setId(id);
        tokenResult.setToken(strToken);
        tokenResult.setCreationDate(creationDate);

        return tokenResult;
    }

}


text:
<?php

$autoloadFile = 'vendor/autoload.php';
if (file_exists($autoloadFile)) {
    define('AUTOLOAD_COMPOSER_INSTALL', $autoloadFile);
}

if (!defined('AUTOLOAD_COMPOSER_INSTALL')) {
    echo 'You need to set up the project dependencies using the following commands:' . PHP_EOL .
        'wget http://getcomposer.org/composer.phar' . PHP_EOL .
        'php composer.phar install' . PHP_EOL;
    die(1);
}

require AUTOLOAD_COMPOSER_INSTALL;

Matks\GmailCleaner\Launcher::main();


text:
One Sansome - 40th Floor Networks

        This is a demo of templating with data from the OpsDB.  It is formatted for this specific dataset, but will soon be completely dynamic, with the column headers being populated from UDN.  Currently the rows are templated from UDN.

            Network Name
            Address
            CIDR
            Location
            Default Gateway
            Default VLAN

{{index .Map "table_rows"}}


text:
// Created by Ron 'Maxwolf' McDowell (ron.mcdowell@gmail.com)
// Timestamp 01/03/2016@1:50 AM

namespace OregonTrailDotNet.Entity.Vehicle
{
    /// <summary>
    ///     The pace at which you travel can change.
    /// </summary>
    public enum TravelPace
    {
        /// <summary>
        ///     8 hours a day, taking frequent rests. You take care not to get too tired.
        /// </summary>
        Steady = 1,

        /// <summary>
        ///     12 hours a day, stopping only when necessary. Finish each day feeling very tired.
        /// </summary>
        Strenuous = 2,

        /// <summary>
        ///     16 hours a day, you never rest and barley sleep. You are absolutely exhausted, and your health suffers.
        /// </summary>
        Grueling = 3
    }
}


text:
module TeX.Util
( lexAll
)
where

import Prelude (Maybe(Just, Nothing))

import TeX.Lexer
import TeX.State
import TeX.Token

lexAll :: Lexer -> TeXState -> [Token]
lexAll lexer texState =
  case lexToken lexer texState of
    Just (token, newLexer) -> token:(lexAll newLexer texState)
    Nothing -> []


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="File-List" href="STM32F4x7_files/filelist.xml">
<link rel="Edit-Time-Data" href="STM32F4x7_files/editdata.mso"><title>STM32F4x7</title>

STM32F4x7 Webserver Demo

Based on the lwIP TCP/IP stack

Home
page<o:p></o:p>

 Led
control<o:p></o:p>

ADC
status bar<o:p></o:p>

STM32
F-4 Series

A new
generation on STM32 with significant improvement in

 features /
performance:<o:p></o:p>

More Memory<o:p></o:p>

Advanced
features<o:p></o:p>

Maintain
close pin-out compatibility<o:p></o:p>

Maintain
close software compatibility<o:p></o:p>

Complement
the existing family with more performance, memory and features

The STM32F4x7 home page

<o:p> </o:p>

 About this
demonstration<o:p></o:p>

This
webserver is a part of a demonstration package developed on the top
level of the lwIP TCP/IP stack.

The package contains nine applications:

Applications running in standalone (without an RTOS):

A
Webserver. <o:p></o:p>

A TFTP server.

A TCP echo
client application

A TCP echo
server application

A UDP echo
client application

A UDP echo
server application

Applications running with FreeRTOS operating system:

A Webserver
based on netconn API.

A Webserver
based on socket API.

A TCP/UDP
echo server application based on netconn API.

<o:p> </o:p>

 About LwIP<o:p></o:p>

lwIP,
pronounced lightweight IP, is an open source TCP/IP stack developed by
Adam Dunkels at the Swedish Institute of Computer Science and is
maintained now by a world wide community of developers.

lwIP features:

- IP (Internet Protocol) including packet forwarding over multiple
network interfaces

- ICMP (Internet Control Message Protocol) for network maintenance and
debugging

- UDP (User Datagram Protocol) including experimental UDP-lite
extensions

- TCP (Transmission Control Protocol) with congestion control, RTT
estimation and fast recovery/fast retransmit

- Specialized raw API for enhanced performance

- Optional Berkeley-alike socket API

- DHCP (Dynamic Host Configuration Protocol)

- PPP (Point-to-Point Protocol)

- ARP (Address Resolution Protocol) for Ethernet

For more informations you can refer to the website:  http://savannah.nongnu.org/projects/lwip/
<o:p></o:p>

<o:p></o:p>

<o:p></o:p>

<o:p> </o:p>

All rights reserved ©2011
STMicroelectronics

<o:p> </o:p>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Generics.GenericMethods
{
    interface ICache<T>
    {
        T Get(string key);
        void Insert(string key, T value);
        void Update(string key, T value);
        void Delete(string key);
    }

    public class Cache<T>:ICache<T>
    {

        public T Get(string key)
        {
            throw new NotImplementedException();
        }

        public void Insert(string key, T value)
        {
            throw new NotImplementedException();
        }

        public void Delete(string key)
        {
            throw new NotImplementedException();
        }

        public void Update(string key, T value)
        {
            throw new NotImplementedException();
        }

        public void Insert(string cacheKey, object value)
        {
            throw new NotImplementedException();
        }
    }
}


text:
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;

using Xunit;

namespace System.Net.Security.Tests
{
    public class NegotiateStreamStreamToStreamTest
    {
        private readonly byte[] _sampleMsg = Encoding.UTF8.GetBytes("Sample Test Message");

        [ActiveIssue(5284, PlatformID.Windows)]
        [Fact]
        [PlatformSpecific(PlatformID.Windows)]
        public void NegotiateStream_StreamToStream_Authentication_Success()
        {
            MockNetwork network = new MockNetwork();

            using (var clientStream = new FakeNetworkStream(false, network))
            using (var serverStream = new FakeNetworkStream(true, network))
            using (var client = new NegotiateStream(clientStream))
            using (var server = new NegotiateStream(serverStream))
            {
                Assert.False(client.IsAuthenticated);
                Assert.False(server.IsAuthenticated);

                Task[] auth = new Task[2];
                auth[0] = client.AuthenticateAsClientAsync();
                auth[1] = server.AuthenticateAsServerAsync();

                bool finished = Task.WaitAll(auth, TestConfiguration.PassingTestTimeoutMilliseconds);
                Assert.True(finished, "Handshake completed in the allotted time");

                // Expected Client property values:
                Assert.True(client.IsAuthenticated);
                Assert.Equal(TokenImpersonationLevel.Identification, client.ImpersonationLevel);
                Assert.Equal(true, client.IsEncrypted);
                Assert.Equal(false, client.IsMutuallyAuthenticated);
                Assert.Equal(false, client.IsServer);
                Assert.Equal(true, client.IsSigned);
                Assert.Equal(false, client.LeaveInnerStreamOpen);

                IIdentity serverIdentity = client.RemoteIdentity;
                Assert.Equal("NTLM", serverIdentity.AuthenticationType);
                Assert.Equal(false, serverIdentity.IsAuthenticated);
                Assert.Equal("", serverIdentity.Name);

                // Expected Server property values:
                Assert.True(server.IsAuthenticated);
                Assert.Equal(TokenImpersonationLevel.Identification, server.ImpersonationLevel);
                Assert.Equal(true, server.IsEncrypted);
                Assert.Equal(false, server.IsMutuallyAuthenticated);
                Assert.Equal(true, server.IsServer);
                Assert.Equal(true, server.IsSigned);
                Assert.Equal(false, server.LeaveInnerStreamOpen);

                IIdentity clientIdentity = server.RemoteIdentity;
                Assert.Equal("NTLM", clientIdentity.AuthenticationType);

                Assert.Equal(true, clientIdentity.IsAuthenticated);
                IdentityValidator.AssertIsCurrentIdentity(clientIdentity);
            }
        }

        [ActiveIssue(5284, PlatformID.Windows)]
        [Fact]
        [PlatformSpecific(PlatformID.Windows)]
        public void NegotiateStream_StreamToStream_Authentication_TargetName_Success()
        {
            string targetName = "testTargetName";

            MockNetwork network = new MockNetwork();

            using (var clientStream = new FakeNetworkStream(false, network))
            using (var serverStream = new FakeNetworkStream(true, network))
            using (var client = new NegotiateStream(clientStream))
            using (var server = new NegotiateStream(serverStream))
            {
                Assert.False(client.IsAuthenticated);
                Assert.False(server.IsAuthenticated);

                Task[] auth = new Task[2];

                auth[0] = client.AuthenticateAsClientAsync(CredentialCache.DefaultNetworkCredentials, targetName);
                auth[1] = server.AuthenticateAsServerAsync();

                bool finished = Task.WaitAll(auth, TestConfiguration.PassingTestTimeoutMilliseconds);
                Assert.True(finished, "Handshake completed in the allotted time");

                // Expected Client property values:
                Assert.True(client.IsAuthenticated);
                Assert.Equal(TokenImpersonationLevel.Identification, client.ImpersonationLevel);
                Assert.Equal(true, client.IsEncrypted);
                Assert.Equal(false, client.IsMutuallyAuthenticated);
                Assert.Equal(false, client.IsServer);
                Assert.Equal(true, client.IsSigned);
                Assert.Equal(false, client.LeaveInnerStreamOpen);

                IIdentity serverIdentity = client.RemoteIdentity;
                Assert.Equal("NTLM", serverIdentity.AuthenticationType);
                Assert.Equal(true, serverIdentity.IsAuthenticated);
                Assert.Equal(targetName, serverIdentity.Name);

                // Expected Server property values:
                Assert.True(server.IsAuthenticated);
                Assert.Equal(TokenImpersonationLevel.Identification, server.ImpersonationLevel);
                Assert.Equal(true, server.IsEncrypted);
                Assert.Equal(false, server.IsMutuallyAuthenticated);
                Assert.Equal(true, server.IsServer);
                Assert.Equal(true, server.IsSigned);
                Assert.Equal(false, server.LeaveInnerStreamOpen);

                IIdentity clientIdentity = server.RemoteIdentity;
                Assert.Equal("NTLM", clientIdentity.AuthenticationType);

                Assert.Equal(true, clientIdentity.IsAuthenticated);
                IdentityValidator.AssertIsCurrentIdentity(clientIdentity);
            }
        }

        [ActiveIssue(5284, PlatformID.Windows)]
        [Fact]
        [PlatformSpecific(PlatformID.Windows)]
        public void NegotiateStream_StreamToStream_Authentication_EmptyCredentials_Fails()
        {
            string targetName = "testTargetName";

            // Ensure there is no confusion between DefaultCredentials / DefaultNetworkCredentials and a
            // NetworkCredential object with empty user, password and domain.
            NetworkCredential emptyNetworkCredential = new NetworkCredential("", "", "");
            Assert.NotEqual(emptyNetworkCredential, CredentialCache.DefaultCredentials);
            Assert.NotEqual(emptyNetworkCredential, CredentialCache.DefaultNetworkCredentials);

            MockNetwork network = new MockNetwork();

            using (var clientStream = new FakeNetworkStream(false, network))
            using (var serverStream = new FakeNetworkStream(true, network))
            using (var client = new NegotiateStream(clientStream))
            using (var server = new NegotiateStream(serverStream))
            {
                Assert.False(client.IsAuthenticated);
                Assert.False(server.IsAuthenticated);

                Task[] auth = new Task[2];

                auth[0] = client.AuthenticateAsClientAsync(emptyNetworkCredential, targetName);
                auth[1] = server.AuthenticateAsServerAsync();

                bool finished = Task.WaitAll(auth, TestConfiguration.PassingTestTimeoutMilliseconds);
                Assert.True(finished, "Handshake completed in the allotted time");

                // Expected Client property values:
                Assert.True(client.IsAuthenticated);
                Assert.Equal(TokenImpersonationLevel.Identification, client.ImpersonationLevel);
                Assert.Equal(true, client.IsEncrypted);
                Assert.Equal(false, client.IsMutuallyAuthenticated);
                Assert.Equal(false, client.IsServer);
                Assert.Equal(true, client.IsSigned);
                Assert.Equal(false, client.LeaveInnerStreamOpen);

                IIdentity serverIdentity = client.RemoteIdentity;
                Assert.Equal("NTLM", serverIdentity.AuthenticationType);
                Assert.Equal(true, serverIdentity.IsAuthenticated);
                Assert.Equal(targetName, serverIdentity.Name);

                // Expected Server property values:
                Assert.True(server.IsAuthenticated);
                Assert.Equal(TokenImpersonationLevel.Identification, server.ImpersonationLevel);
                Assert.Equal(true, server.IsEncrypted);
                Assert.Equal(false, server.IsMutuallyAuthenticated);
                Assert.Equal(true, server.IsServer);
                Assert.Equal(true, server.IsSigned);
                Assert.Equal(false, server.LeaveInnerStreamOpen);

                IIdentity clientIdentity = server.RemoteIdentity;
                Assert.Equal("NTLM", clientIdentity.AuthenticationType);

                // TODO #5241: Behavior difference:
                Assert.Equal(false, clientIdentity.IsAuthenticated);
                // On .Net Desktop: Assert.Equal(true, clientIdentity.IsAuthenticated);

                IdentityValidator.AssertHasName(clientIdentity, @"NT AUTHORITY\ANONYMOUS LOGON");
            }
        }

        [ActiveIssue(5283, PlatformID.Windows)]
        [Fact]
        [PlatformSpecific(PlatformID.Windows)]
        public void NegotiateStream_StreamToStream_Successive_ClientWrite_Sync_Success()
        {
            byte[] recvBuf = new byte[_sampleMsg.Length];
            MockNetwork network = new MockNetwork();

            using (var clientStream = new FakeNetworkStream(false, network))
            using (var serverStream = new FakeNetworkStream(true, network))
            using (var client = new NegotiateStream(clientStream))
            using (var server = new NegotiateStream(serverStream))
            {
                Assert.False(client.IsAuthenticated);
                Assert.False(server.IsAuthenticated);

                Task[] auth = new Task[2];
                auth[0] = client.AuthenticateAsClientAsync();
                auth[1] = server.AuthenticateAsServerAsync();

                bool finished = Task.WaitAll(auth, TestConfiguration.PassingTestTimeoutMilliseconds);
                Assert.True(finished, "Handshake completed in the allotted time");

                client.Write(_sampleMsg, 0, _sampleMsg.Length);
                server.Read(recvBuf, 0, _sampleMsg.Length);

                Assert.True(_sampleMsg.SequenceEqual(recvBuf));

                client.Write(_sampleMsg, 0, _sampleMsg.Length);
                server.Read(recvBuf, 0, _sampleMsg.Length);

                Assert.True(_sampleMsg.SequenceEqual(recvBuf));
            }
        }

        [ActiveIssue(5284, PlatformID.Windows)]
        [Fact]
        [PlatformSpecific(PlatformID.Windows)]
        public void NegotiateStream_StreamToStream_Successive_ClientWrite_Async_Success()
        {
            byte[] recvBuf = new byte[_sampleMsg.Length];
            MockNetwork network = new MockNetwork();

            using (var clientStream = new FakeNetworkStream(false, network))
            using (var serverStream = new FakeNetworkStream(true, network))
            using (var client = new NegotiateStream(clientStream))
            using (var server = new NegotiateStream(serverStream))
            {
                Assert.False(client.IsAuthenticated);
                Assert.False(server.IsAuthenticated);

                Task[] auth = new Task[2];
                auth[0] = client.AuthenticateAsClientAsync();
                auth[1] = server.AuthenticateAsServerAsync();

                bool finished = Task.WaitAll(auth, TestConfiguration.PassingTestTimeoutMilliseconds);
                Assert.True(finished, "Handshake completed in the allotted time");

                auth[0] = client.WriteAsync(_sampleMsg, 0, _sampleMsg.Length);
                auth[1] = server.ReadAsync(recvBuf, 0, _sampleMsg.Length);
                finished = Task.WaitAll(auth, TestConfiguration.PassingTestTimeoutMilliseconds);
                Assert.True(finished, "Send/receive completed in the allotted time");
                Assert.True(_sampleMsg.SequenceEqual(recvBuf));

                auth[0] = client.WriteAsync(_sampleMsg, 0, _sampleMsg.Length);
                auth[1] = server.ReadAsync(recvBuf, 0, _sampleMsg.Length);
                finished = Task.WaitAll(auth, TestConfiguration.PassingTestTimeoutMilliseconds);
                Assert.True(finished, "Send/receive completed in the allotted time");
                Assert.True(_sampleMsg.SequenceEqual(recvBuf));
            }
        }

        [Fact]
        [PlatformSpecific(PlatformID.Linux | PlatformID.OSX)]
        public void NegotiateStream_Ctor_Throws()
        {
            Assert.Throws<PlatformNotSupportedException>(() => new NegotiateStream(new FakeNetworkStream(false, null)));
        }
    }
}


text:
require File.dirname(__FILE__) + '/../spec_helper'

describe PressDownloadController do

  #Delete this example and add some real ones
  it "should use PressDownloadController" do
    controller.should be_an_instance_of(PressDownloadController)
  end

end


text:
<?php

class Crunchbutton_Queue_Notification_Your_Driver extends Crunchbutton_Queue {

	public function run() {

		$this->order()->textCustomerAboutDriver();

		return self::STATUS_SUCCESS;
	}
}


text:
'use strict';

import TaskActions from '../../actions/task-actions';

let TaskContent = CustomActions => class extends React.Component {
    constructor(props) {
        super(props);
        this.togleDoneAction = this.togleDoneAction.bind(this);
        this.deleteAction    = this.deleteAction.bind(this);
        this.editAction      = this.editAction.bind(this);
    }
    editAction() {
        TaskActions.editTask(this.props);
    }
    deleteAction() {
        TaskActions.removeTask(this.props);
    }
    togleDoneAction(){
        let auxTask = Object.assign({}, this.props);
        auxTask.done = !auxTask.done;

        if (auxTask.done)
            TaskActions.doneTask(auxTask);
        else
            TaskActions.unDoneTask(auxTask);
    }
    render() {
        return (

                    <input type='checkbox' onClick={this.togleDoneAction} checked={this.props.done} ref='done'/>
                    {this.props.name}

                <CustomActions
                    edit={this.editAction}
                    delete={this.deleteAction}
                    {...this.props} />

{this.props.done ? 100 : this.props.progress}%

        )
    }
}

const taskDoneActions = (props) => (

);

const taskUnDoneActions = (props) => (

);

let TaskUnDoneContent = TaskContent(taskUnDoneActions);
let TaskDoneContent   = TaskContent(taskDoneActions);

export {TaskUnDoneContent, TaskDoneContent};