text:
Skeetr [![Build Status](https://travis-ci.org/skeetr/skeetr.png?branch=master)](https://travis-ci.org/skeetr/skeetr)
==============================

PHP Application Server based on Gearmand + Nginx, your PHP faster than ever.

Requirements
------------

* PHP 5.3.23
* Unix system
* PECL http
* PECL gearman
* [php-skeetr](https://github.com/skeetr/php-skeetr)

Installation
------------

The recommended way to install skeetr/skeetr is [through composer](http://getcomposer.org).
You can see [package information on Packagist.](https://packagist.org/packages/skeetr/skeetr)

```JSON
{
    "require": {
        "skeetr/skeetr": "dev-master"
    }
}
```

Tests
-----

Tests are in the `tests` folder.
To run them, you need PHPUnit.
Example:

    $ phpunit --configuration phpunit.xml.dist

License
-------

MIT, see [LICENSE](LICENSE)


text:
A tool to download and process IGMT HLA sequence alignments from EBI

[![DOI](https://zenodo.org/badge/19622/danielmirchandani/hla_alignments.svg)](https://zenodo.org/badge/latestdoi/19622/danielmirchandani/hla_alignments)

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Net;
using QuantConnect.Data;
using QuantConnect.Data.Market;
using Newtonsoft.Json;
using System.Linq;

package com.quantconnect.lean.ToolBox.CryptoiqDownloader
{
    /**
     * Cryptoiq Data Downloader class
    */
    public class CryptoiqDownloader : IDataDownloader
    {
        private final String _exchange;
        private final BigDecimal _scaleFactor;

        /**
         * Initializes a new instance of the <see cref="CryptoiqDownloader"/> class
        */
         * @param exchange The bitcoin exchange
         * @param scaleFactor Scale factor used to scale the data, useful for changing the BTC units
        public CryptoiqDownloader( String exchange = "bitfinex", BigDecimal scaleFactor = 1m) {
            _exchange = exchange;
            _scaleFactor = scaleFactor;
        }

        /**
         * Get historical data enumerable for a single symbol, type and resolution given this start and end time (in UTC).
        */
         * @param symbol Symbol for the data we're looking for.
         * @param resolution Only Tick is currently supported
         * @param startUtc Start time of the data in UTC
         * @param endUtc End time of the data in UTC
        @returns Enumerable of base data for this symbol
        public IEnumerable<BaseData> Get(Symbol symbol, Resolution resolution, DateTime startUtc, DateTime endUtc) {
            if( resolution != Resolution.Tick) {
                throw new IllegalArgumentException( "Only tick data is currently supported.");
            }

            hour = 1;
            counter = startUtc;
            static final String url = "http://cryptoiq.io/api/marketdata/ticker/%4$s/%3$s/%1$s/%2$s";

            while (counter <= endUtc) {
                while (hour < 24) {
                    using (cl = new WebClient()) {
                        request = String.format(url, counter.toString( "yyyy-MM-dd"), hour, symbol.Value, _exchange);
                        data = cl.DownloadString(request);

                        mbtc = JsonConvert.DeserializeObject<List<CryptoiqBitcoin>>(data);
                        foreach (item in mbtc.OrderBy(x -> x.Time)) {
                            yield return new Tick
                            {
                                Time = item.Time,
                                Symbol = symbol,
                                Value = item.Last/_scaleFactor,
                                AskPrice = item.Ask/_scaleFactor,
                                BidPrice = item.Bid/_scaleFactor,
                                TickType = TickType.Quote
                            };
                        }
                        hour++;
                    }
                }
                counter = counter.AddDays(1);
                hour = 0;
            }
        }

    }
}


text:
import uuid  # used to generate unique user accesion if it is not provided.

class RowData:
    def __init__(self, sheet_name, meta_structure):
        self.sheet_name = sheet_name
        self.meta_structure = meta_structure
        self.schema = dict()
        self.relationships = dict()

    def add(self, column_header, value):
        """Add or replace value in column. Convert "NA" in link columns to "". """
        sheet_name = self.sheet_name
        meta_structure = self.meta_structure
        column_name = meta_structure.get_column_name(sheet_name, column_header)
        if column_header in meta_structure.get_link_column_headers(sheet_name):
            # do link stuff
            if value == "NA":
                value = ""
            accession_list = value.split(",")  # split value in cell by ",""
            sheetlinkto = meta_structure.get_linkto(self.sheet_name, column_header)
            categorylinkto = meta_structure.get_category(sheetlinkto)
            if column_name in self.relationships:
                self.relationships[column_name][categorylinkto] = accession_list
            else:
                self.relationships[column_name] = {categorylinkto: accession_list}
        elif column_header in meta_structure.get_schema_column_headers(sheet_name):
            self.schema[column_name] = value
        else:
            raise RowError("unknown column %s in %s!" % (column_header, sheet_name))

    def remove(self, column_name):
        """
        It's input is a column_name, instead of a column_header! And it only works for column names in schema. I use it only to delete accession columns.
        """
        if column_name in self.schema:
            return self.schema.pop(column_name)
        else:
            raise RowError("remove method can only delete schema columns, but you are trying to delete %s in %s" % (column_name, self.sheet_name))

    def old_accession(self, old_accession=""):
        # redundant with submission, but seems it is bad idea to make mutable attribes.
        if old_accession == "":
            try:
                return self.the_old_accession
            except:
                return ""
        else:
            self.the_old_accession = old_accession

    def submission(self, submission=""):
        """
        submission should be "submitted" or "updated"
        with param, set the submission;
        without param, returns current submission.
        """

        if submission == "":
            try:
                return self.the_submission
            except:
                return ""
        else:
            self.the_submission = submission

    def replace_accession(self, new_user_accession=""):
        sheet_name = self.sheet_name
        meta_structure = self.meta_structure
        user_accession_rule = meta_structure.get_user_accession_rule(sheet_name)
        if new_user_accession == "":
            randomid = uuid.uuid1()
            new_user_accession = user_accession_rule + str(randomid)
        self.old_accession(self.schema["user_accession"])
        self.schema["user_accession"] = new_user_accession

class RowError:
    """Errors process row data in excel file"""
    pass


text:
/**
 *
 */
package com.emc.ecs.metadata.bo;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;

import org.elasticsearch.transport.ReceiveTimeoutTransportException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.emc.ecs.management.client.ManagementClient;
import com.emc.ecs.management.client.ManagementClientConfig;
import com.emc.ecs.management.entity.ListNamespaceRequest;
import com.emc.ecs.management.entity.ListNamespacesResult;
import com.emc.ecs.management.entity.Namespace;
import com.emc.ecs.management.entity.NamespaceDetail;
import com.emc.ecs.management.entity.NamespaceQuota;
import com.emc.ecs.management.entity.NamespaceRequest;
import com.emc.ecs.metadata.dao.NamespaceDAO;

/**
 * @author nlengc
 *
 */
public class NamespaceBO {

	private final static Logger LOGGER = LoggerFactory.getLogger(NamespaceBO.class);
	private ManagementClient client;
	private NamespaceDAO namespaceDAO;
	private AtomicLong objectCount;

	public NamespaceBO(String mgmtAccessKey, String mgmtSecretKey, List<String> hosts, Integer port,
			NamespaceDAO namespaceDAO, AtomicLong objectCount) {

		// client config
		ManagementClientConfig clientConfig = new ManagementClientConfig(mgmtAccessKey, mgmtSecretKey, port, hosts);

		this.client = new ManagementClient(clientConfig);
		this.namespaceDAO = namespaceDAO;
		this.objectCount = objectCount;
	}

	/**
	 * Gathers all namespaces present on a cluster
	 *
	 * @return List - List of namespace
	 */
	public List<Namespace> getNamespaces() {

		List<Namespace> namespaceList = new ArrayList<Namespace>();
		ListNamespaceRequest listNamespaceRequest = new ListNamespaceRequest();

		// first batch
		ListNamespacesResult namespacesResult = client.listNamespaces(listNamespaceRequest);
		namespaceList.addAll(namespacesResult.getNamespaces());

		// n subsequent batches
		while (namespacesResult.getNextMarker() != null) {
			listNamespaceRequest.setNextMarker(namespacesResult.getNextMarker());
			namespacesResult = client.listNamespaces(listNamespaceRequest);
			if (namespacesResult.getNamespaces() != null) {
				namespaceList.addAll(namespacesResult.getNamespaces());
			}
		}

		return namespaceList;
	}

	/**
	 * Gathers all namespaces details present on a cluster
	 *
	 * @return List - List of namespace details
	 */
	public void collectNamespaceDetails(Date collectionTime) {

		// Start collecting namespace data details from ECS systems
		List<Namespace> namespaceList = getNamespaces();
		// At this point we should have all the namespace supported by the ECS
		// system
		try {
			long objCounter = 0;
			for (Namespace namespace : namespaceList) {
				LOGGER.info("Collecting Details for namespace: " + namespace.getName());
				NamespaceDetail namespaceDetail = client.getNamespaceDetails(namespace.getId());

				if (namespaceDetail == null) {
					continue;
				}
				objCounter++;
				// Push collected details into datastore
				if (namespaceDAO != null) {
					// insert something
					namespaceDAO.insert(namespaceDetail, collectionTime);
				}
			}

			// peg global counter
			this.objectCount.getAndAdd(objCounter);
		} catch (ReceiveTimeoutTransportException re) {
			LOGGER.error("Data collection will be aborted due to an error while connecting to ElasticSearch Cluster ",
					re);
			System.exit(1);
		}
	}

	/**
	 * Gathers all namespaces quota present on a cluster
	 *
	 * @return List - List of namespace quota
	 */
	public void collectNamespaceQuota(Date collectionTime) {

		// Start collecting namespace data quota from ECS systems
		List<Namespace> namespaceList = getNamespaces();
		// At this point we should have all the namespace supported by the ECS
		// system
		try {
			long objCounter = 0;

			for (Namespace namespace : namespaceList) {

				NamespaceRequest namespaceRequest = new NamespaceRequest();
				namespaceRequest.setName(namespace.getName());

				LOGGER.info("Collecting Quota Details for namespace: " + namespace.getName());
				NamespaceQuota namespaceQuota = client.getNamespaceQuota(namespaceRequest);

				if (namespaceQuota == null) {
					continue;
				}

				objCounter++;

				// Push collected details into datastore
				if (namespaceDAO != null) {
					// insert something
					namespaceDAO.insert(namespaceQuota, collectionTime);
				}

			}

			// peg global counter
			this.objectCount.getAndAdd(objCounter);
		} catch (ReceiveTimeoutTransportException re) {
			LOGGER.error("Data collection will be aborted due to an error while connecting to ElasticSearch Cluster ",
					re);
			System.exit(1);
		}
	}

	public void shutdown() {
		if(this.client != null) {
			client.shutdown();
		}
	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:jaxrs="http://cxf.apache.org/jaxrs"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:camel="http://camel.apache.org/schema/spring"
       xmlns:jee="http://www.springframework.org/schema/jee"
       xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://cxf.apache.org/jaxrs
http://cxf.apache.org/schemas/jaxrs.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd">

    <import resource="classpath:META-INF/cxf/cxf.xml"/>
    <context:property-placeholder system-properties-mode="OVERRIDE" location="classpath*:*.properties"/>
    <context:property-placeholder/>
    <context:annotation-config/>
    <context:component-scan base-package="com.ba.captwo.eda.demo"/>
    <context:component-scan base-package="com.ba.captwo.eda.demo.db"/>
    <context:component-scan base-package="com.ba.captwo.eda.demo.routes"/>
    <context:component-scan base-package="com.ba.captwo.eda.demo.resources"/>
    <context:component-scan base-package="com.ba.captwo.eda.demo.coreservices"/>

    <bean id="sellingDatasource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="org.postgresql.Driver"/>
        <property name="url" value="jdbc:postgresql://${db.host}:${db.port}/${db.username}"/>
        <property name="username" value="${db.username}"/>
        <property name="password" value="${db.password}"/>
    </bean>

    <bean id="PersonCoreserviceRoutes" class="com.ba.captwo.eda.demo.routes.PersonCoreServiceRoutes"/>
    <bean id="FlightCoreServiceRoutes" class="com.ba.captwo.eda.demo.routes.FlightCoreServiceRoutes"/>

    <camelContext id="PersonCoreserviceRouteContext" xmlns="http://camel.apache.org/schema/spring">
        <routeBuilder ref="PersonCoreserviceRoutes"/>
        <routeBuilder ref="FlightCoreServiceRoutes"/>
    </camelContext>

</beans>


text:
using System.Collections.Generic;
using System.Linq;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;

namespace Bit.BlazorUI.SourceGenerators;

public class BlazorParameterPropertySyntaxReceiver : ISyntaxContextReceiver
{
    public IList<IPropertySymbol> Properties { get; } = new List<IPropertySymbol>();

    public void OnVisitSyntaxNode(GeneratorSyntaxContext context)
    {
        if (context.Node is not PropertyDeclarationSyntax propertyDeclarationSyntax || !propertyDeclarationSyntax.AttributeLists.Any()) return;

        var parent = propertyDeclarationSyntax.Parent;

        if (parent is null || parent.IsKind(SyntaxKind.ClassDeclaration) is false) return;

        var classDeclarationSyntax = (ClassDeclarationSyntax?)parent;

        if (classDeclarationSyntax?.Modifiers.Any(k => k.IsKind(SyntaxKind.PartialKeyword)) is false) return;

        var propertySymbol = context.SemanticModel.GetDeclaredSymbol(propertyDeclarationSyntax);

        if (propertySymbol is null) return;

        var type = propertySymbol.ContainingType;

        if (type == null) return;

        if (type.GetMembers().Any(m => m.Name == "SetParametersAsync")) return;

        if (propertySymbol.GetAttributes().Any(ad => ad.AttributeClass?.ToDisplayString() == "Microsoft.AspNetCore.Components.ParameterAttribute"
                                                  || ad.AttributeClass?.ToDisplayString() == "Microsoft.AspNetCore.Components.CascadingParameterAttribute"))
        {
            Properties.Add(propertySymbol);
        }
    }
}


text:
<?php

namespace Magento\Framework\Config\Test\Unit\Dom;

use Magento\Framework\Config\Dom\UrnResolver;
use Magento\Framework\Component\ComponentRegistrar;

class UrnResolverTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var UrnResolver
     */
    protected $urnResolver;

    /**
     * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager
     */
    protected $objectManagerHelper;

    public function setUp()
    {
        $this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
        $this->urnResolver = $this->objectManagerHelper->getObject('Magento\Framework\Config\Dom\UrnResolver');
    }

    public function testGetRealPathNoUrn()
    {
        $xsdPath = '../../testPath/test.xsd';
        $result = $this->urnResolver->getRealPath($xsdPath);
        $this->assertSame($xsdPath, $result, 'XSD paths does not match.');
    }

    public function testGetRealPathWithFrameworkUrn()
    {
        $xsdUrn = 'urn:magento:framework:Config/Test/Unit/_files/sample.xsd';
        $xsdPath = realpath(dirname(__DIR__)) . '/_files/sample.xsd';
        $result = $this->urnResolver->getRealPath($xsdUrn);
        $this->assertSame($xsdPath, $result, 'XSD paths does not match.');
    }

    public function testGetRealPathWithModuleUrn()
    {
        $xsdUrn = 'urn:magento:module:Magento_Customer:etc/address_formats.xsd';
        $componentRegistrar = new ComponentRegistrar();
                $xsdPath = $componentRegistrar->getPath(ComponentRegistrar::MODULE, 'Magento_Customer')
                    . '/etc/address_formats.xsd';

        $result = $this->urnResolver->getRealPath($xsdUrn);
        $this->assertSame($xsdPath, $result, 'XSD paths does not match.');
    }

    /**
     * @expectedException \Magento\Framework\Exception\NotFoundException
     * @expectedExceptionMessage Unsupported format of schema location: 'urn:magento:test:test:etc/test_test.xsd'
     */
    public function testGetRealPathWrongSection()
    {
        $xsdUrn = 'urn:magento:test:test:etc/test_test.xsd';
        $this->urnResolver->getRealPath($xsdUrn);
    }

    /**
     * @expectedException \Magento\Framework\Exception\NotFoundException
     * @expectedExceptionMessage Could not locate schema: 'urn:magento:module:Magento_Test:test.xsd' at '/test.xsd'
     */
    public function testGetRealPathWrongModule()
    {
        $xsdUrn = 'urn:magento:module:Magento_Test:test.xsd';
        $this->urnResolver->getRealPath($xsdUrn);
    }
}


text:
package co.gem.round;

import co.gem.round.patchboard.Client;
import co.gem.round.patchboard.Resource;

import java.io.IOException;
import java.util.*;
/**
 * Base class for building Gem API collection objects.
 *
 * @author Julian Vergel de Dios (julian@gem.co) on 12/18/14.
 */
public abstract class BaseCollection<T> extends Base implements Iterable<T> {

  protected List<T> list = new ArrayList<T>();
  protected Map<String, T> map = new HashMap<String, T>();

  public static final String DEFAULT_ACTION = "list";

  public BaseCollection(String url, Round round, String resourceName) {
    super(url, round, resourceName);
  }

  public BaseCollection(Resource resource, Round round) {
    super(resource, round);
  }

  public T get(int index) {
    return this.list.get(index);
  }

  public T get(String key) {
    return this.map.get(key);
  }

  public void add(String key, T element) {
    list.add(element);
    map.put(key, element);
  }

  public void fetch() throws Client.UnexpectedStatusCodeException, IOException {
    resource = resource.action(DEFAULT_ACTION);
    list = new ArrayList<T>();
    map = new HashMap<String, T>();
    populateCollection(resource);
  }

  public int size() {
    return this.list.size();
  }

  public List<T> asList() {
    return list;
  }
  public Map<String, T> asMap() { return map; }

  public abstract void populateCollection(Iterable<Resource> collection);

  @Override
  public Iterator<T> iterator() {
    return list.iterator();
  }
}


text:
#include "config/stm32plus.h"

#if defined(STM32PLUS_F0)

#include "config/i2c.h"

using namespace stm32plus;

// static initialisers for the hack that forces the IRQ handlers to be linked

template<> I2CInterruptFeatureEnabler<1>::FPTR I2CInterruptFeatureEnabler<1>::_forceLinkage=nullptr;
template<> I2CEventSource *I2CInterruptFeature<1> ::_i2cInstance=nullptr;

extern "C" {

  #if defined(USE_I2C1_INTERRUPT)

    void __attribute__ ((interrupt("IRQ"))) I2C1_IRQHandler(void) {

      if(I2C_GetITStatus(I2C1,I2C_IT_TXIS)!=RESET) {
        I2CInterruptFeature<1>::_i2cInstance->I2CInterruptEventSender.raiseEvent(I2CEventType::EVENT_READY_TO_TRANSMIT);
        I2C_ClearITPendingBit(I2C1,I2C_IT_TXIS);
      }
      else if(I2C_GetITStatus(I2C1,I2C_IT_RXNE)!=RESET) {
        I2CInterruptFeature<1>::_i2cInstance->I2CInterruptEventSender.raiseEvent(I2CEventType::EVENT_RECEIVE);
        I2C_ClearITPendingBit(I2C1,I2C_IT_RXNE);
      }
      else if(I2C_GetITStatus(I2C1,I2C_IT_STOPF)!=RESET) {
        I2CInterruptFeature<1>::_i2cInstance->I2CInterruptEventSender.raiseEvent(I2CEventType::EVENT_STOP_BIT_RECEIVED);
        I2C_ClearITPendingBit(I2C1,I2C_IT_STOPF);
      }
      else if(I2C_GetITStatus(I2C1,I2C_IT_ADDR)!=RESET) {
        I2CInterruptFeature<1>::_i2cInstance->I2CInterruptEventSender.raiseEvent(I2CEventType::EVENT_ADDRESS_MATCH);
        I2C_ClearITPendingBit(I2C1,I2C_IT_ADDR);
      }
      else if(I2C_GetITStatus(I2C1,I2C_IT_TC | I2C_IT_TCR)!=RESET) {
        I2CInterruptFeature<1>::_i2cInstance->I2CInterruptEventSender.raiseEvent(I2CEventType::EVENT_TRANSFER_COMPLETE);
        I2C_ClearITPendingBit(I2C1,I2C_IT_TC | I2C_IT_TCR);
      }
      else if(I2C_GetITStatus(I2C1,I2C_IT_BERR | I2C_IT_ARLO | I2C_IT_OVR | I2C_IT_PECERR | I2C_IT_TIMEOUT | I2C_IT_ALERT)!=RESET) {
        I2CInterruptFeature<1>::_i2cInstance->I2CInterruptEventSender.raiseEvent(I2CEventType::EVENT_ERROR);
        I2C_ClearITPendingBit(I2C1,I2C_IT_BERR | I2C_IT_ARLO | I2C_IT_OVR | I2C_IT_PECERR | I2C_IT_TIMEOUT | I2C_IT_ALERT);
      }
      else if(I2C_GetITStatus(I2C1,I2C_IT_NACKF)!=RESET) {
        I2CInterruptFeature<1>::_i2cInstance->I2CInterruptEventSender.raiseEvent(I2CEventType::EVENT_NOT_ACKNOWLEDGE);
        I2C_ClearITPendingBit(I2C1,I2C_IT_NACKF);
      }
      __DSB();      // prevent erroneous recall of this handler due to delayed memory write
    }

  #endif
}

#endif


text:
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Diagnostics;
using Microsoft.Rest;
using Microsoft.Azure.Management.ResourceManager;
using System.Threading.Tasks;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using Microsoft.Azure;
using Microsoft.Azure.Management.ResourceManager.Models;
using Newtonsoft.Json.Linq;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using System.Configuration;
using System.Net;
using System.Text;
using System.Web;
using Microsoft.Research.MultiWorldTesting.Contract;
using System.Threading;

namespace Microsoft.Research.DecisionServiceTest
{
    public class ProvisioningUtil
    {
        private JObject deploymentOutput;

        private static string GetConfiguration(string name)
        {
            var value = Environment.GetEnvironmentVariable(name);
            if (value != null)
                return value;

            return ConfigurationManager.AppSettings[name];
        }

        private ResourceManagementClient CreateResourceManagementClient()
        {
            string clientId = GetConfiguration("ClientId");
            string passwd = GetConfiguration("Password");
            string tenantId = GetConfiguration("TenantId");
            string subscriptionId = GetConfiguration("SubscriptionId");

            var clientCredentials = new ClientCredential(clientId, passwd);
            var authorityUri = "https://login.windows.net/" + tenantId;
            var context = new AuthenticationContext(authorityUri);
            var authResult = context.AcquireTokenAsync("https://management.azure.com/", clientCredentials);
            authResult.Wait();

            var tokenCredentials = new TokenCloudCredentials(subscriptionId, authResult.Result.AccessToken);
            var credentialsForRM = new TokenCredentials(tokenCredentials.Token);

            var armClient = new ResourceManagementClient(credentialsForRM);
            armClient.SubscriptionId = subscriptionId;

            return armClient;
        }

        public DecisionServiceDeployment Deploy()
        {
            var armClient = this.CreateResourceManagementClient();

            var prefix = GetConfiguration("prefix");

            var resourceGroupName = prefix + Guid.NewGuid().ToString().Replace("-", "").Substring(4);
            var deploymentName = resourceGroupName + "_deployment";
            var location = "eastus";

            // create resource group
            var rgResult = armClient.ResourceGroups.CreateOrUpdate(resourceGroupName, new ResourceGroup { Location = location });

            Assert.AreEqual("Succeeded", rgResult.Properties.ProvisioningState);

            DeploymentOperation failedOperation = null;
            using (var poller = Observable
                .Interval(TimeSpan.FromSeconds(2))
                .Delay(TimeSpan.FromSeconds(5))
                .SelectMany(async _ =>
                {
                    try
                    {
                        var operations = await armClient.DeploymentOperations.ListAsync(resourceGroupName, deploymentName);

                        // {op.Properties.TargetResource.Id}
                        foreach (var op in operations)
                        {
                            if (op == null || op.Properties == null || op.Properties.ProvisioningState == null)
                                continue;

                            Trace.WriteLine($"Status: {op?.Properties?.TargetResource?.ResourceName,-30} '{op?.Properties?.ProvisioningState}'");
                            switch (op.Properties.ProvisioningState)
                            {
                                case "Running":
                                case "Succeeded":
                                    break;
                                default:
                                    failedOperation = op;
                                    break;
                            }
                        }
                        Trace.WriteLine("");
                    }
                    catch (Exception ex)
                    {
                        Trace.WriteLine("Status polling failed: " + ex.Message);
                    }

                    return Task.FromResult(true);
                })
                .Subscribe())
            {
                var deployment = new Deployment();
                deployment.Properties = new DeploymentProperties
                {
                    Mode = DeploymentMode.Incremental,
                    TemplateLink = new TemplateLink("https://raw.githubusercontent.com/Microsoft/mwt-ds/master/provisioning/azuredeploy.json"),
                    // Parameters = JObject.Parse("{\"param\":{\"subtemplate location\":\"https://raw.githubusercontent.com/Microsoft/mwt-ds/master/provisioning/\"}}")
                };

                try
                {
                    var dpResult = armClient.Deployments.CreateOrUpdate(resourceGroupName, deploymentName, deployment);
                    this.deploymentOutput = (JObject)dpResult.Properties.Outputs;

                    // make test case copy paste easy
                    Console.WriteLine(deploymentOutput.ToString(Newtonsoft.Json.Formatting.Indented).Replace("\"", "\"\""));
                }
                catch (AggregateException ae)
                {
                    // Go through all exceptions and dump useful information
                    ae.Handle(x =>
                    {
                        Trace.WriteLine(x);
                        return false;
                    });
                }
            }

            Assert.IsNull(failedOperation, $"Deployment operation failed: '{failedOperation}'");

            // give the deployment a bit of time to spin up completely
            Thread.Sleep(TimeSpan.FromMinutes(2));

            return new DecisionServiceDeployment(this.deploymentOutput);
        }

        public void DeleteExistingResourceGroupsMatchingPrefix()
        {
            try
            {
                var armClient = this.CreateResourceManagementClient();
                var prefix = GetConfiguration("prefix");
                var oldResources = armClient.ResourceGroups.List().Where(r => r.Name.StartsWith(prefix));

                foreach (var resource in oldResources)
                {
                    var task = armClient.ResourceGroups.DeleteAsync(resource.Name);
                }
            }
            catch (Exception)
            {
            }
        }
    }
}


text:
class PIDProcessing : public PID{
private:
	const int P = 1;  // Proporcional
	const int I = 2;  // Integral
	const int D = 3;  // Derivada
	const int S = 4;  // SetPoint

	// PID* pid;

	String KStr, valStr;
	bool checkValue;

	void setParameters(float value, int param);

public:

	// PIDProcessing(PID* _pid);
	PIDProcessing(float _kP = 0.0, float _kI = 0.0, float _kD = 0.0);
	PIDProcessing(float _kP, float _kI, float _kD, float _outMin, float _outMax);

	// margem de valores (min e max) devem estar
	// de acordo com os valores setados no Processing
	void sendToGraphics(int input, int output);

	// recebe valores atualizados do Processing
	// 1 -> kP; 2 -> kI; 3 -> kD; 4 -> SetPoint
	// Ex:
	//    "*1_2.1" -> kP = 2.1
	//    "*4_700" -> SetPoint = 700;
	void receiveProcessing(char inChar);
};


text:
<title>memmem - Untitled</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Untitled">
<meta name="generator" content="makeinfo 4.11">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Strings.html#Strings" title="Strings">
<link rel="prev" href="memcpy.html#memcpy" title="memcpy">
<link rel="next" href="memmove.html#memmove" title="memmove">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">

Next: memmove,
Previous: memcpy,
Up: Strings

5.9 memmem—find memory segment

Synopsis

     #include <string.h>
     char *memmem(const void *<var>s1</var>, size_t <var>l1</var>, const void *<var>s2</var>,
         size_t <var>l2</var>);

Description

Locates the first occurrence in the memory region pointed to
by <var>s1</var> with length <var>l1</var> of the sequence of bytes pointed
to by <var>s2</var> of length <var>l2</var>.  If you already know the
lengths of your haystack and needle, memmem can be much
faster than strstr.

Returns

Returns a pointer to the located segment, or a null pointer if
<var>s2</var> is not found. If <var>l2</var> is 0, <var>s1</var> is returned.

Portability

memmem is a newlib extension.

memmem requires no supporting OS subroutines.


text:
package InterfazGrafica;

import java.awt.BorderLayout;
import java.awt.Font;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.border.TitledBorder;

/**
 * Construye la interfaz del panel de ayuda
 */
@SuppressWarnings("serial")
public class InterfazAyuda extends JFrame{

	/**
	 * Construye la ventana con el texto de ayuda
	 */
	public InterfazAyuda(){

		JPanel panelPrincipal = new JPanel();

		// Borde del panel izquierdo
		TitledBorder tituloSeccion;
		tituloSeccion = BorderFactory.createTitledBorder("Instrucciones Básicas");
		tituloSeccion.setTitleJustification(TitledBorder.LEFT);

		panelPrincipal.setLayout(new BorderLayout());

		JTextArea campoTexto = new JTextArea(0,80);
		campoTexto.setFont(new Font("Microsoft Sans Serif", Font.PLAIN, 12));
		campoTexto.setWrapStyleWord(true);
		campoTexto.setEditable(false);

		try {

		    InputStream is = getClass().getResourceAsStream("/resources/strings/Ayuda.txt");
		    BufferedReader br = new BufferedReader(new InputStreamReader(is));
			String linea;

		    while ((linea = br.readLine()) != null)
		    	campoTexto.append(linea+"\n");

            br.close();
            campoTexto.requestFocus();
	     	}
	    catch(Exception e2) {
	    	JOptionPane.showMessageDialog(null, "ERROR!\nNo se puede cargar archivo de prueba");
           }

		JScrollPane scrollPane = new JScrollPane(campoTexto);
		scrollPane.setBorder(tituloSeccion);
		scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
		scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
		//scrollPane.setMinimumSize(new Dimension(350,300));	// Ancho: 350 - Alto: 300
		panelPrincipal.add(scrollPane);

		this.setTitle("Ayuda - Compilador PLG (G05)");

		this.setContentPane(panelPrincipal);
		this.setSize(750,500);
		this.setResizable(false);
		//this.setVisible(true);

		ImageIcon iconoVentana = new ImageIcon((this.getClass().getResource("/resources/icons/menu/iconHelpMenu.png")));
		this.setIconImage(iconoVentana.getImage());

		this.addWindowListener(new WindowAdapter()
		{public void windowClosing(WindowEvent e)
			{
			setVisible(false);
			}
		}
		);
	}

	/**
	 * Muestra la ventana de ayuda con el contenido del fichero de ayuda
	 */
	public void mostrarAyuda(){
		this.setVisible(true);
		this.setEnabled(true);
		this.requestFocus();
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/dcn_login_background"
    android:orientation="vertical" >

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="45dip"
        android:layout_marginLeft="12dp"
        android:layout_marginRight="40dip"
        android:contentDescription="@null"
        android:scaleType="centerInside"
        android:src="@drawable/dcn_exit_logo" />

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="135dp"
        android:layout_marginLeft="12dp"
        android:layout_marginRight="12dp" >

        <LinearLayout
            android:id="@+id/dcn_exit_ll_content_group"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical" >

            <LinearLayout
                android:id="@+id/dcn_exit_fl_group_01"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:background="@drawable/dcn_verify_key"
                android:gravity="center"
                android:minHeight="45dp"
                android:orientation="horizontal"
                android:visibility="invisible" >

                <ImageView
                    android:id="@android:id/icon"
                    android:layout_width="24dip"
                    android:layout_height="24dip"
                    android:layout_marginRight="4dip"
                    android:background="@android:color/transparent"
                    android:contentDescription="@null"
                    android:scaleType="centerInside"
                    android:src="@drawable/dcn_exit_gift" />

                <TextView
                    android:id="@android:id/title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@android:color/transparent"
                    android:gravity="center"
                    android:text="@string/dcn_exit_gift"
                    android:textColor="#525252"
                    android:textSize="18sp" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/dcn_exit_fl_group_02"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:background="@drawable/dcn_verify_key"
                android:gravity="center"
                android:minHeight="45dp"
                android:orientation="horizontal"
                android:visibility="invisible" >

                <ImageView
                    android:id="@android:id/icon"
                    android:layout_width="24dip"
                    android:layout_height="24dip"
                    android:layout_marginRight="4dip"
                    android:background="@android:color/transparent"
                    android:contentDescription="@null"
                    android:src="@drawable/dcn_exit_activity" />

                <TextView
                    android:id="@android:id/title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@android:color/transparent"
                    android:gravity="center"
                    android:text="@string/dcn_exit_activity"
                    android:textColor="#525252"
                    android:textSize="18sp" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/dcn_exit_fl_group_03"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:background="@drawable/dcn_verify_key"
                android:gravity="center"
                android:minHeight="45dp"
                android:orientation="horizontal"
                android:visibility="invisible" >

                <ImageView
                    android:id="@android:id/icon"
                    android:layout_width="24dip"
                    android:layout_height="24dip"
                    android:layout_marginRight="4dip"
                    android:background="@android:color/transparent"
                    android:contentDescription="@null"
                    android:src="@drawable/dcn_exit_question" />

                <TextView
                    android:id="@android:id/title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@android:color/transparent"
                    android:gravity="center"
                    android:text="@string/dcn_exit_question"
                    android:textColor="#525252"
                    android:textSize="18sp" />
            </LinearLayout>
        </LinearLayout>

        <RelativeLayout
            android:id="@+id/dcn_exit_rl_adv_group"
            android:layout_width="match_parent"
            android:layout_height="match_parent" >

            <ImageView
                android:id="@+id/dcn_exit_iV_adv_pic"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_centerInParent="true"
                android:contentDescription="@null"
                android:scaleType="fitXY" />

            <FrameLayout
                android:id="@+id/dcn_exit_fl_adv_close"
                android:layout_width="36dip"
                android:layout_height="36dip"
                android:layout_alignParentRight="true"
                android:layout_alignParentTop="true"
                android:alpha="0.5"
                android:background="@android:color/black" >

                <ImageView
                    android:id="@+id/dcn_exit_ib_adv_close"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:background="@android:color/transparent"
                    android:contentDescription="@null"
                    android:src="@drawable/dcn_popup_closed_selector" />
            </FrameLayout>
        </RelativeLayout>
    </FrameLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="45dip"
        android:layout_marginBottom="12dp"
        android:layout_marginLeft="12dp"
        android:layout_marginRight="12dp"
        android:layout_marginTop="6dip"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/dcn_exit_btn_exit"
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_marginRight="8dp"
            android:layout_weight="1"
            android:background="@drawable/dcn_edit_verify_btn_selector"
            android:text="@string/dcn_exit_exit"
            android:textColor="@color/dcn_henp_chapter_sencond_level_content"
            android:textSize="18sp" />

        <Button
            android:id="@+id/dcn_exit_btn_continue"
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="@drawable/dcn_orange_btn_selector"
            android:text="@string/dcn_exit_continue"
            android:textColor="#fff4ee"
            android:textSize="18sp" />
    </LinearLayout>

</LinearLayout>


text:
      <button type=button class=navbar-toggle data-toggle=collapse data-target="#main-navbar">
        Toggle nav

      </button>
      {{ site.title }}

        {% for link in site.navbar-links %}

          {{ link[0] }}

        {% endfor %}

                <form action="/search" method="get">
                  <input id=search-query type=text name=q placeholder=Search... />
                </form>

        {% if site.avatar %}

        {% endif %}

            {% if site.author.stackoverflow and site.footer-links-active.stackoverflow %}

            {% endif %}
            {% if site.author.github and site.footer-links-active.github %}

            {% endif %}
            {% if site.author.twitter and site.footer-links-active.twitter %}

            {% endif %}
            {% if site.author.facebook and site.footer-links-active.facebook %}

            {% endif %}
            {% if site.author.linkedin and site.footer-links-active.linkedin %}

            {% endif %}
            {% if site.footer-links-active.rss %}

            {% endif %}
            {% if site.author.email and site.footer-links-active.email %}

            {% endif %}

            {% if site.author.stackoverflow and site.footer-links-active.stackoverflow %}

            {% endif %}
            {% if site.author.github and site.footer-links-active.github %}

            {% endif %}
            {% if site.author.twitter and site.footer-links-active.twitter %}

            {% endif %}
            {% if site.author.facebook and site.footer-links-active.facebook %}

            {% endif %}
            {% if site.author.linkedin and site.footer-links-active.linkedin %}

            {% endif %}

            {% if site.footer-links-active.rss %}

            {% endif %}
            {% if site.author.email and site.footer-links-active.email %}

            {% endif %}


text:
require "orizuru/version"
require "orizuru/client"

require "faraday"
require "faraday_middleware"

module Orizuru
  def self.create(url, token)
    conn = Faraday::Connection.new(:url => url) do |builder|
      builder.use Faraday::Request::UrlEncoded  # リクエストパラメータを URL エンコードする
      builder.use Faraday::Response::Logger     # リクエストを標準出力に出力する
      builder.use Faraday::Adapter::NetHttp     # Net/HTTP をアダプターに使う
      builder.use FaradayMiddleware::EncodeJson

      builder.use FaradayMiddleware::ParseJson, :content_type => /\bjson$/
      builder.use FaradayMiddleware::Instrumentation
    end

    conn.authorization :Bearer, token
    # conn.response :json

    Orizuru::Client.new(conn)
  end
end


text:
/**
 * This class is generated by jOOQ
 */
package generated;

/**
 * This class is generated by jOOQ.
 */
@javax.annotation.Generated(value    = { "http://www.jooq.org", "3.4.4" },
                            comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Protectme extends org.jooq.impl.SchemaImpl {

	private static final long serialVersionUID = -1847931577;

	/**
	 * The singleton instance of protectme
	 */
	public static final Protectme PROTECTME = new Protectme();

	/**
	 * No further instances allowed
	 */
	private Protectme() {
		super("protectme");
	}

	@Override
	public final java.util.List<org.jooq.Table<?>> getTables() {
		java.util.List result = new java.util.ArrayList();
		result.addAll(getTables0());
		return result;
	}

	private final java.util.List<org.jooq.Table<?>> getTables0() {
		return java.util.Arrays.<org.jooq.Table<?>>asList(
			generated.tables.Accounts.ACCOUNTS,
			generated.tables.Clients.CLIENTS,
			generated.tables.Comments.COMMENTS,
			generated.tables.Company.COMPANY,
			generated.tables.Names.NAMES,
			generated.tables.Pictures.PICTURES,
			generated.tables.Protectednames.PROTECTEDNAMES,
			generated.tables.Unprotectednames.UNPROTECTEDNAMES);
	}
}


text:
package com.frank.search.solr.core.query.result;

import com.frank.search.solr.core.query.Field;

/**
 * Entry for facet on field
 *
 * @author Christoph Strobl
 */
public interface FacetFieldEntry extends FacetEntry {

	@Override
    Field getKey();

	/**
	 * get the associated Field
	 *
	 * @return
	 */
	Field getField();

}


text:
// This file is part of OpenTSDB.
// Copyright (C) 2010-2016  The OpenTSDB Authors.
//
// This program is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 2.1 of the License, or (at your
// option) any later version.  This program is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
// General Public License for more details.  You should have received a copy
// of the GNU Lesser General Public License along with this program.  If not,
// see <http://www.gnu.org/licenses/>.
package com.heliosapm.tsdbscale.core.handlers;

import reactor.core.publisher.Mono;

import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;

/**
 *
Title: EchoHandler

 *
Description:

 *
Company: Helios Development Group LLC

 * @author Whitehead (nwhitehead AT heliosdev DOT org)
 *
com.heliosapm.tsdbscale.core.handlers.EchoHandler

 */
@Component
public class EchoHandler {

	public EchoHandler() {
		System.err.println("EchoHandler Created");
	}

	public Mono<ServerResponse> echo(ServerRequest request) {
		return ServerResponse.ok().body(request.bodyToMono(String.class), String.class);
	}
}


text:
import { GraphQLResolveInfo } from "graphql";

declare function getFieldList(info: GraphQLResolveInfo): string[];

export = getFieldList;


text:
require 'mongo'
require 'base64'
require 'lite_spec_helper'

describe Mongo::Crypt::DataKeyContext do
  require_libmongocrypt
  include_context 'define shared FLE helpers'

  let(:credentials) { Mongo::Crypt::KMS::Credentials.new(kms_providers) }

  let(:kms_tls_options) do
    {}
  end

  let(:mongocrypt) do
    Mongo::Crypt::Handle.new(credentials, kms_tls_options)
  end

  let(:io) { double("Mongo::Crypt::EncryptionIO") }

  let(:key_alt_names) { [] }

  let(:context) { described_class.new(mongocrypt, io, key_document, key_alt_names, nil) }

  describe '#initialize' do
    shared_examples 'it properly sets key_alt_names' do
      context 'with one key_alt_names' do
        let(:key_alt_names) { ['keyAltName1'] }

        it 'does not raise an exception' do
          expect do
            context
          end.not_to raise_error
        end
      end

      context 'with multiple key_alt_names' do
        let(:key_alt_names) { ['keyAltName1', 'keyAltName2'] }

        it 'does not raise an exception' do
          expect do
            context
          end.not_to raise_error
        end
      end

      context 'with empty key_alt_names' do
        let(:key_alt_names) { [] }

        it 'does not raise an exception' do
          expect do
            context
          end.not_to raise_error
        end
      end

      context 'with invalid key_alt_names' do
        let(:key_alt_names) { ['keyAltName1', 3] }

        it 'does raises an exception' do
          expect do
            context
          end.to raise_error(ArgumentError, /All values of the :key_alt_names option Array must be Strings/)
        end
      end

      context 'with non-array key_alt_names' do
        let(:key_alt_names) { "keyAltName1" }

        it 'does raises an exception' do
          expect do
            context
          end.to raise_error(ArgumentError, /key_alt_names option must be an Array/)
        end
      end
    end

    context 'with aws kms provider' do
      include_context 'with AWS kms_providers'

      let(:key_document) do
        Mongo::Crypt::KMS::MasterKeyDocument.new(
          'aws',
          { master_key: { region: 'us-east-2', key: 'arn' } }
        )
      end

      it_behaves_like 'it properly sets key_alt_names'

      context 'with valid options' do
        it 'does not raise an exception' do
          expect do
            context
          end.not_to raise_error
        end
      end

      context 'with valid endpoint' do
        let(:key_document) do
          Mongo::Crypt::KMS::MasterKeyDocument.new(
            'aws',
            {
              master_key: {
                region: 'us-east-2',
                key: 'arn',
                endpoint: 'kms.us-east-2.amazonaws.com:443'
              }
            }
          )
        end

        it 'does not raise an exception' do
          expect do
            context
          end.not_to raise_error
        end
      end
    end
  end

  describe '#run_state_machine' do
    # TODO: test with AWS KMS provider

    context 'with local KMS provider' do
      include_context 'with local kms_providers'

      let(:key_document) do
        Mongo::Crypt::KMS::MasterKeyDocument.new(
          'local',
          {
            master_key: { key: 'MASTER-KEY' }
          }
        )
      end

      it 'creates a data key' do
        expect(context.run_state_machine).to be_a_kind_of(Hash)
      end
    end
  end
end


text:
layout:     post
title:      irrelevant
date:       2018-11-12 19:37:39
summary:
categories: drawing
---
![irrelevant](/images/diary/irrelevant.png "This picture is irrelevant to this name.")


text:
(function () {
    "use strict";

    var app = angular.module("app");

    var controllerId = "pageCon";
    app.controller(controllerId,
        ["$scope", "common","type", page]);

    function page($scope, common,type) {

        //type can be contact, about

        $scope.options = {
            height: 200,                 // set editor height

            minHeight: null,             // set minimum height of editor
            maxHeight: null,             // set maximum height of editor

            focus: true,                 // set focus to editable area after initializing summernote

            toolbar: [
                ['edit',['undo','redo']],
                ['headline', ['style']],
                ['style', ['bold', 'italic', 'underline', 'superscript', 'subscript', 'strikethrough', 'clear']],
                ['fontface', ['fontname']],
                ['textsize', ['fontsize']],
                ['fontclr', ['color']],
                ['alignment', ['ul', 'ol', 'paragraph', 'lineheight']],
                ['height', ['height']],
                ['table', ['table']],
                ['insert', ['link','picture','video','hr']],
                ['view', ['fullscreen', 'codeview']],
                ['help', ['help']]

            ]
        };
        activate();
        function activate() {
            common.activateController([], controllerId)
                 .then(function () {});
        }
    };
})();


text:
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <unistd.h>
#include <inttypes.h>
#include <string.h>

/****************************************
        Author: Tim Wood
        Author: Phil Lopreiato
        with a little help from
        http://beej.us/guide/bgnet/
****************************************/

#define MAX_PAYLOAD_SIZE 1024
#define DEFAULT_NUM_PACKETS -1 /* Go forever */

int main(int argc, char ** argv)
{
        char* server_port = "1234";
        char* server_ip = "127.0.0.1";
        char *message = malloc(MAX_PAYLOAD_SIZE);
        int sockfd, rc;
        int i;
        struct addrinfo hints, *server;
        int o;
        int num_packets = DEFAULT_NUM_PACKETS;

        /* Command line args:
                -p port
                -h host name or IP
                -m message to send
        */
        while ((o = getopt (argc, argv, "p:h:m:n:")) != -1) {
                switch(o){
                case 'p':
                        server_port = optarg;
                        break;
                case 'h':
                        server_ip = optarg;
                        break;
                case 'm':
                        message = optarg;
                        break;
                case 'n':
                        num_packets = atoi(optarg);
                        break;
                case '?':
                        if(optopt == 'p' || optopt == 'h' ) {
                                fprintf (stderr, "Option %c requires an argument.\n", optopt);
                        }
                        else {
                                fprintf (stderr, "Unknown argument: %c.\n", optopt);
                        }
                        break;
                }
        }

        if(num_packets < 0){
                printf("Sending packets forever\n");
        }else{
                printf("Sending %d packets", num_packets);
        }

        printf("server_ip: %s   port: %s\n", server_ip, server_port);

        /* Initialize the message with some data
         * and ensure the string is terminated with \0
         */
        for(i=strlen(message); i<MAX_PAYLOAD_SIZE; i++){
                message[i] = 'A';
        }
        message[MAX_PAYLOAD_SIZE - 1] = '\0';

        /* The hints struct is used to specify what kind of server info we are looking for */
        memset(&hints, 0, sizeof hints);
        hints.ai_family = AF_INET;
        hints.ai_socktype = SOCK_STREAM; /* or SOCK_DGRAM */

        /* getaddrinfo() gives us back a server address we can connect to.
           It actually gives us a linked list of addresses, but we'll just use the first.
         */
        if (rc = getaddrinfo(server_ip, server_port, &hints, &server) != 0) {
                perror(gai_strerror(rc));
                exit(-1);
        }

        /* Now we can create the socket and connect */
        sockfd = socket(server->ai_family, server->ai_socktype, server->ai_protocol);
        if (sockfd == -1) {
                perror("ERROR opening socket");
                exit(-1);
        }
        rc = connect(sockfd, server->ai_addr, server->ai_addrlen);
        if (rc == -1) {
                perror("ERROR on connect");
                goto out;
                /* Watch out for velociraptors...
                 * http://xkcd.com/292/
                 */
        }

        /* Send messages as fast as possible
         * Use infinite while/break to allow for infinite sending (avoid overflow with for counters)
         */
        i = 0;
        while(1){
                /* Send the message, plus the \0 string ending. Use 0 flags. */
                rc = send(sockfd, message, MAX_PAYLOAD_SIZE, 0);
                if (rc < 0) {
                        perror("ERROR on send");
                        exit(-1);
                }

                /* Only break if we're not sending infinitely (avoid int overflow issues) */
                if (num_packets > 0 && i == num_packets){
                        break;
                }
                i++;
        }

        out:
        freeaddrinfo(server);
        close(sockfd);
        free(message);

        printf("Done.\n");
        return 0;
}


text:
/**
 * create by 朱施健
 */
package com.flower.tables;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;

import org.hibernate.annotations.Index;

import com.flower.enums.ApplyState;

/**
 * @author 朱施健
 * 好友申请表
 */
@Entity
public class FriendApply implements Serializable{
	public FriendApplyId id;
	public String applyMsg;
	public ApplyState applyState = ApplyState.等待认证;

	@EmbeddedId
	public FriendApplyId getId() {
		return id;
	}
	public void setId(FriendApplyId id) {
		this.id = id;
	}

	@Column(length = 50)
	public String getApplyMsg() {
		return applyMsg;
	}
	public void setApplyMsg(String applyMsg) {
		this.applyMsg = applyMsg;
	}

	@Column
	public byte getApplyState() {
		return applyState.flag;
	}

	public void setApplyState(byte applyState) {
		this.applyState = ApplyState.getEnum(applyState);
	}

	@Embeddable
	public static class FriendApplyId implements Serializable{
		public String me;
		public String applyTarget;

		public FriendApplyId(){}
		public FriendApplyId(String me,String applyTarget){
			this.me =me;
			this.applyTarget = applyTarget;
		}

		@Column(length = 50, nullable = false, updatable = false)
		public String getMe() {
			return me;
		}
		public void setMe(String me) {
			this.me = me;
		}

		@Index(name="index_applyTarget")
		@Column(length = 50, nullable = false, updatable = false)
		public String getApplyTarget() {
			return applyTarget;
		}
		public void setApplyTarget(String applyTarget) {
			this.applyTarget = applyTarget;
		}

		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result
					+ ((applyTarget == null) ? 0 : applyTarget.hashCode());
			result = prime * result + ((me == null) ? 0 : me.hashCode());
			return result;
		}

		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			FriendApplyId other = (FriendApplyId) obj;
			if (applyTarget == null) {
				if (other.applyTarget != null)
					return false;
			} else if (!applyTarget.equals(other.applyTarget))
				return false;
			if (me == null) {
				if (other.me != null)
					return false;
			} else if (!me.equals(other.me))
				return false;
			return true;
		}
	}
}


text:
angular.module('incrementalList', [])
    .directive('ilList', ilListDirective)
    .directive('ilList', ilListScopeDirective)
    .directive('ilItemModel', ilItemModelDirective)
    .directive('ilNewItem', ilNewItemDirective)
    .directive('ilIncreaseOn', ilIncreaseOnDirective)
    .directive('ilDecreaseOn', ilDecreaseOnDirective)
    .directive('ilListModel', ilListModelDirective)
    .directive('ilMinLength', ilMinLengthDirective)
    .directive('ilMaxLength', ilMaxLengthDirective)
    .directive('ilEnableHasFocus', ilEnableHasFocusDirective)
    .directive('ilDecreaseMiddle', ilDecreaseMiddleDirective);


text:
@interface ViewController ()
@property (nonatomic, strong) NSArray *apps;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.apps.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    AppCell *cell = [tableView dequeueReusableCellWithIdentifier:@"appCell" forIndexPath:indexPath];

        AppInfo *app = self.apps[indexPath.row];
        cell.app = app;

    return cell;
}

- (NSArray *)apps {
    if (_apps == nil) {
        _apps = [AppInfo apps];
    }
    return _apps;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];

}

@end


text:
service_interface::service_interface()
{
}

service_interface::~service_interface()
{
}


text:
/* @flow */

export function snakeToCamel(type: string): string{

  // replaces - and then capitalizes next letter
  // turns 'example-text' into 'exampleText'

  let formattedType = type;
  while(formattedType.indexOf('-') !== -1){
    let idx = formattedType.indexOf('-');
    let splitString = formattedType.split('');
    splitString.splice(idx, 1);
    splitString[idx] = splitString[idx].toUpperCase();
    formattedType = splitString.join('');
  }

  return formattedType;
}


text:
package com.netflix.zuul.message.http;

import com.netflix.zuul.message.Headers;
import com.netflix.zuul.message.ZuulMessage;
import java.util.Optional;

/**
 * User: Mike Smith
 * Date: 7/15/15
 * Time: 1:18 PM
 */
public interface HttpRequestInfo extends ZuulMessage
{
    String getProtocol();

    String getMethod();

    String getPath();

    HttpQueryParams getQueryParams();

    String getPathAndQuery();

    Headers getHeaders();

    String getClientIp();

    String getScheme();

    int getPort();

    String getServerName();

    int getMaxBodySize();

    String getInfoForLogging();

    String getOriginalHost();

    String getOriginalScheme();

    String getOriginalProtocol();

    int getOriginalPort();

    /**
     * Reflects the actual destination port that the client intended to communicate with,
     * in preference to the port Zuul was listening on. In the case where proxy protocol is
     * enabled, this should reflect the destination IP encoded in the TCP payload by the load balancer.
     */
    default Optional<Integer> getClientDestinationPort() {
        throw new UnsupportedOperationException();
    }

    String reconstructURI();

    /** Parse and lazily cache the request cookies. */
    Cookies parseCookies();

    /**
     * Force parsing/re-parsing of the cookies. May want to do this if headers
     * have been mutated since cookies were first parsed.
     */
    Cookies reParseCookies();
}


text:
package app

import (
	"runtime"
	"time"

	"github.com/robfig/revel"
	"github.com/zimmski/tirion/backend"
)

var Db backend.Backend

func init() {
	// Filters is the default set of global filters.
	revel.Filters = []revel.Filter{
		revel.PanicFilter,             // Recover from panics and display an error page instead.
		revel.RouterFilter,            // Use the routing table to select the right Action
		revel.FilterConfiguringFilter, // A hook for adding or removing per-Action filters.
		revel.ParamsFilter,            // Parse parameters into Controller.Params.
		revel.SessionFilter,           // Restore and write the session cookie.
		revel.FlashFilter,             // Restore and write the flash cookie.
		revel.ValidationFilter,        // Restore kept validation errors and save new ones from cookie.
		revel.I18nFilter,              // Resolve the requested language
		revel.InterceptorFilter,       // Run interceptors around the action.
		revel.ActionInvoker,           // Invoke the action.
	}

	runtime.GOMAXPROCS(runtime.NumCPU())

	time.Local = time.UTC

	revel.OnAppStart(func() {
		var err error

		var dbDriver, _ = revel.Config.String("db.driver")

		Db, err = backend.NewBackend(dbDriver)

		if err != nil {
			panic(err)
		}

		var dbParams backend.Parameters

		dbParams.Spec, _ = revel.Config.String("db.spec")
		dbParams.MaxIdleConns, _ = revel.Config.Int("db.maxIdleConns")
		dbParams.MaxOpenConns, _ = revel.Config.Int("db.maxOpenConns")

		Db.Init(dbParams)
	})
}


text:
package tech.aroma.service.operations;

import java.util.List;
import java.util.Set;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import sir.wellington.alchemy.collections.sets.Sets;
import tech.aroma.data.InboxRepository;
import tech.aroma.thrift.authentication.UserToken;
import tech.aroma.thrift.exceptions.InvalidArgumentException;
import tech.aroma.thrift.service.DismissMessageRequest;
import tech.aroma.thrift.service.DismissMessageResponse;
import tech.sirwellington.alchemy.test.junit.runners.*;

import static org.hamcrest.Matchers.notNullValue;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.*;
import static tech.sirwellington.alchemy.generator.AlchemyGenerator.Get.one;
import static tech.sirwellington.alchemy.generator.CollectionGenerators.listOf;
import static tech.sirwellington.alchemy.generator.NumberGenerators.integers;
import static tech.sirwellington.alchemy.generator.StringGenerators.alphabeticStrings;
import static tech.sirwellington.alchemy.generator.StringGenerators.uuids;
import static tech.sirwellington.alchemy.test.junit.ThrowableAssertion.*;
import static tech.sirwellington.alchemy.test.junit.runners.GenerateString.Type.UUID;

/**
 * @author SirWellington
 */
@Repeat(10)
@RunWith(AlchemyTestRunner.class)
public class DismissMessageOperationTest
{
    @Mock
    private InboxRepository inboxRepo;

    @GeneratePojo
    private UserToken token;

    @GenerateString(UUID)
    private String userId;

    @GenerateString(UUID)
    private String messageId;

    @GeneratePojo
    private DismissMessageRequest request;

    private DismissMessageOperation instance;

    @Before
    public void setUp() throws Exception
    {
        instance = new DismissMessageOperation(inboxRepo);
        verifyZeroInteractions(inboxRepo);

        setupData();

        setupMocks();
    }

    @DontRepeat
    @Test
    public void testConstructor()
    {
        assertThrows(() -> new DismissMessageOperation(null))
                .isInstanceOf(IllegalArgumentException.class);
    }

    @Test
    public void testProcess() throws Exception
    {
        DismissMessageResponse response = instance.process(request);
        assertThat(response, notNullValue());

        verify(inboxRepo).deleteMessageForUser(userId, messageId);
    }

    @Test
    public void testProcessWithMultipleMessages() throws Exception
    {
        int count = one(integers(10, 50));
        List<String> messageIds = listOf(uuids, count);
        request.setMessageIds(messageIds);

        Set<String> expected = Sets.copyOf(messageIds);

        instance.process(request);

        for (String id : expected)
        {
            verify(inboxRepo).deleteMessageForUser(userId, id);
        }
    }

    @Test
    public void testProcessWithDismissAll() throws Exception
    {
        request.setDismissAll(true);

        DismissMessageResponse response = instance.process(request);
        assertThat(response, notNullValue());

        verify(inboxRepo).deleteAllMessagesForUser(userId);
    }

    @Test
    public void testProcessWithBadRequests() throws Exception
    {
        DismissMessageRequest nullRequest = null;
        assertThrows(() -> instance.process(nullRequest)).isInstanceOf(InvalidArgumentException.class);

        DismissMessageRequest requestWithoutToken = new DismissMessageRequest(request);
        requestWithoutToken.unsetToken();
        assertThrows(() -> instance.process(requestWithoutToken)).isInstanceOf(InvalidArgumentException.class);

        UserToken tokenWithoutUserId = new UserToken(token);
        tokenWithoutUserId.unsetUserId();

        DismissMessageRequest requestWithoutUserId = new DismissMessageRequest(request);
        requestWithoutUserId.setToken(tokenWithoutUserId);

        assertThrows(() -> instance.process(requestWithoutUserId)).isInstanceOf(InvalidArgumentException.class);

        List<String> badIds = listOf(alphabeticStrings());
        DismissMessageRequest requestWithBadMessageIds = new DismissMessageRequest(request);
        requestWithBadMessageIds.setMessageIds(badIds);

        assertThrows(() -> instance.process(requestWithBadMessageIds)).isInstanceOf(InvalidArgumentException.class);

    }

    private void setupData()
    {
        token.userId = userId;

        request.setToken(token);
        request.setDismissAll(false);
        request.messageId = messageId;

        request.messageIds.clear();

    }

    private void setupMocks()
    {
    }

}


text:
namespace cgreen {
#endif

#define MEMORY_INCREMENT 1024

struct MemoryPool_ {
    void** blocks;
    long size;
    long space;
};

static void enlarge(MemoryPool *pool);
static int move_to_front(MemoryPool *pool, void *pointer);
static void move_up_one(void **blocks, long amount);

MemoryPool *create_memory_pool() {
    MemoryPool *pool = (MemoryPool *)malloc(sizeof(MemoryPool));
    if (pool == NULL) {
        return NULL;
    }
    pool->blocks = (void **)malloc(MEMORY_INCREMENT * sizeof(void *));
    if (pool->blocks == NULL) {
        free(pool);
        return NULL;
    }
    pool->size = 0;
    pool->space = MEMORY_INCREMENT;
    return pool;
}

void free_memory_pool(MemoryPool *pool) {
    long i;
    for (i = 0; i < pool->size; i++) {
        free(pool->blocks[i]);
    }
    free(pool->blocks);
    free(pool);
}

void *memory_pool_allocate(MemoryPool *pool, size_t bytes) {
    enlarge(pool);
    return pool->blocks[pool->size++] = malloc(bytes);
}

void *memory_pool_reallocate(MemoryPool *pool, void *pointer, size_t bytes) {
    if (! move_to_front(pool, pointer)) {
        return NULL;
    }
    return pool->blocks[0] = realloc(pool->blocks[0], bytes);
}

static void enlarge(MemoryPool *pool) {
    if (pool->size == pool->space) {
        pool->blocks = (void**)realloc(pool->blocks, (pool->space + MEMORY_INCREMENT) * sizeof(void *));
        pool->space += MEMORY_INCREMENT;
    }
}

static int move_to_front(MemoryPool *pool, void *pointer) {
    long i;
    for (i = 1; i < pool->size; i++) {
        if (pool->blocks[i] == pointer) {
            move_up_one(pool->blocks, i);
            pool->blocks[0] = pointer;
            return 1;
        }
    }
    return 0;
}

static void move_up_one(void **blocks, long amount) {
    if (amount == 0) {
        return;
    }
    // FIXME: this doesn't compile and the smenatics might be wrong
    //memmove(blocks[0], blocks[1], (size_t)(blocks[amount] - blocks[1]));
}

#ifdef __cplusplus
} // namespace cgreen
#endif


text:
        {{site.username}}

        {{site.user_title}}

        About Me
        Projects
        Résumé


text:
namespace Lucene
{
    class SimpleFSLock : public Lock
    {
    public:
        SimpleFSLock(const String& lockDir, const String& lockFileName);
        virtual ~SimpleFSLock();

        LUCENE_CLASS(SimpleFSLock);

    public:
        String lockDir;
        String lockFile;

    public:
        /// Attempts to obtain exclusive access and immediately return upon success or failure.
        /// @return true if exclusive access is obtained.
        virtual bool obtain();

        /// Releases exclusive access.
        virtual void release();

        /// Returns true if the resource is currently locked. Note that one must still call {@link #obtain()}
        /// before using the resource.
        virtual bool isLocked();

        /// Returns derived object name.
        virtual String toString();
    };
}

#endif


text:
typedef struct {
    unsigned char   chunk_id[4];        // RIFF string
    unsigned int    chunk_size;         // overall size of file in bytes (36 + data_size)
    unsigned char   sub_chunk1_id[8];   // WAVEfmt string with trailing null char
    unsigned int    sub_chunk1_size;    // 16 for PCM.  This is the size of the rest of the Subchunk which follows this number.
    unsigned short  audio_format;       // format type. 1-PCM, 3- IEEE float, 6 - 8bit A law, 7 - 8bit mu law
    unsigned short  num_channels;       // Mono = 1, Stereo = 2
    unsigned int    sample_rate;        // 8000, 16000, 44100, etc. (blocks per second)
    unsigned int    byte_rate;          // SampleRate * NumChannels * BitsPerSample/8
    unsigned short  block_align;        // NumChannels * BitsPerSample/8
    unsigned short  bits_per_sample;    // bits per sample, 8- 8bits, 16- 16 bits etc
    unsigned char   sub_chunk2_id[4];   // Contains the letters "data"
    unsigned int    sub_chunk2_size;    // NumSamples * NumChannels * BitsPerSample/8 - size of the next chunk that will be read
} wav_header_t;


text:
A full-featured, developer centric e-commerce platform that makes custom code easy, with powerful templates & expressive syntax.

### Requirements

* PHP 5.3+
* MongoDB 2.0+
* Apache or equivalent

See the demo at <http://demo.getfwd.com>.

Visit <http://getfwd.com> for documentation and more.


text:
layout: ru-RU/untranslated
title: The Rust Code of Conduct · The Rust Programming Language
---


text:
<?php defined('SYSPATH') or die('No direct script access.');

abstract class Kohana_UI {
  /**
  * Return assets from Masher config. Utilize 3.0 helpers (http://kohanaframework.org/3.0/guide/api/HTML)
  *
  * // Call position or type specific assets
  * UI::masher('footer', 'js', $page);
  *
  * @author  Michael Dyer
  * @param   string string : location, type, page
  * @return  Kohana_Ui
  * @throws  None
  */
  public static function masher($location, $type, $page)
  {
	$assets = array(
	  'header' => array(
		'css' => array(),
		'js' => array(),
		'str' => '',
	  ),
	  'footer' => array(
		'css' => array(),
		'js' => array(),
		'str' => '',
	  ),
	);
	$masher = Kohana::$config->load('masher');
	array_push($assets[$location][$type], $masher[$page][$type]);

	foreach ($assets[$location][$type][0] as $key => $asset) {
	  $assets[$location]['str'] .= ($type == 'css') ? HTML::style($asset) : HTML::script($asset);
	}

	return $assets[$location]['str'];
  }
  /**
  * Return CDN paths for anchor medium
  *
  * // Link will return a full URI protocol mapped to defaults.config
  * UI::link($base, $content, $attributes);
  *
  * @author  Michael Dyer
  * @param   string string array : base, content, attributes
  * @return  Kohana_Ui
  * @throws  None
  */
  public static function link($base, $content, $attributes)
  {
	if(!isset($attributes)) exit;
	$defaults = Kohana::$config->load('defaults');
	if(isset($base)) {
	  $attributes['href'] = $defaults['paths'][$base].$attributes['href'];
	}
	return '<a'.HTML::attributes($attributes).'>'.$content.'</a>';
  }
  /**
  * Return dynamic text wrapper
  *
  * // Text will wrap content in $type tags
  * UI::text($content, $type, $attributes);
  *
  * @author  Michael Dyer
  * @param   string string array : content, null, null
  * @return  Kohana_Ui
  * @throws  None
  */
  public static function text($content, $type = null, $attributes = null)
  {
	if(!isset($type)) $type = 'span';
	return '<'.$type.HTML::attributes($attributes).'>'.$content.'</'.$type.'>';
  }
  /**
  * Return CDN paths for image medium
  *
  * // Link will return a full URI protocol mapped to defaults.config
  * UI::image($base, $content, $attributes);
  *
  * @author  Michael Dyer
  * @param   string string array : base, content, attributes
  * @return  Kohana_Ui
  * @throws  None
  */
  public static function img($uri, $base = null, $attributes = null)
  {
	if(!isset($uri)) exit;
	$defaults = Kohana::$config->load('defaults');
	if(!isset($base)){
	  $base = 'cdn';
	}
	$uri = $defaults['paths'][$base].$uri;
	return HTML::image($uri, $attributes);
  }
}
// END KOHANA UI