text:
using System;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Core.Pipeline;
using Azure.ResourceManager.Network.Models;

namespace Azure.ResourceManager.Network
{
    internal partial class HubRouteTablesRestOperations
    {
        private string subscriptionId;
        private Uri endpoint;
        private ClientDiagnostics _clientDiagnostics;
        private HttpPipeline _pipeline;

        /// <summary> Initializes a new instance of HubRouteTablesRestOperations. </summary>
        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
        /// <param name="subscriptionId"> The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. </param>
        /// <param name="endpoint"> server parameter. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="subscriptionId"/> is null. </exception>
        public HubRouteTablesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null)
        {
            if (subscriptionId == null)
            {
                throw new ArgumentNullException(nameof(subscriptionId));
            }
            endpoint ??= new Uri("https://management.azure.com");

            this.subscriptionId = subscriptionId;
            this.endpoint = endpoint;
            _clientDiagnostics = clientDiagnostics;
            _pipeline = pipeline;
        }

        internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string virtualHubName, string routeTableName, HubRouteTable routeTableParameters)
        {
            var message = _pipeline.CreateMessage();
            var request = message.Request;
            request.Method = RequestMethod.Put;
            var uri = new RawRequestUriBuilder();
            uri.Reset(endpoint);
            uri.AppendPath("/subscriptions/", false);
            uri.AppendPath(subscriptionId, true);
            uri.AppendPath("/resourceGroups/", false);
            uri.AppendPath(resourceGroupName, true);
            uri.AppendPath("/providers/Microsoft.Network/virtualHubs/", false);
            uri.AppendPath(virtualHubName, true);
            uri.AppendPath("/hubRouteTables/", false);
            uri.AppendPath(routeTableName, true);
            uri.AppendQuery("api-version", "2020-04-01", true);
            request.Uri = uri;
            request.Headers.Add("Content-Type", "application/json");
            request.Headers.Add("Accept", "application/json");
            var content = new Utf8JsonRequestContent();
            content.JsonWriter.WriteObjectValue(routeTableParameters);
            request.Content = content;
            return message;
        }

        /// <summary> Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. </summary>
        /// <param name="resourceGroupName"> The resource group name of the VirtualHub. </param>
        /// <param name="virtualHubName"> The name of the VirtualHub. </param>
        /// <param name="routeTableName"> The name of the RouteTable. </param>
        /// <param name="routeTableParameters"> Parameters supplied to create or update RouteTable. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/>, <paramref name="virtualHubName"/>, <paramref name="routeTableName"/>, or <paramref name="routeTableParameters"/> is null. </exception>
        public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string virtualHubName, string routeTableName, HubRouteTable routeTableParameters, CancellationToken cancellationToken = default)
        {
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (virtualHubName == null)
            {
                throw new ArgumentNullException(nameof(virtualHubName));
            }
            if (routeTableName == null)
            {
                throw new ArgumentNullException(nameof(routeTableName));
            }
            if (routeTableParameters == null)
            {
                throw new ArgumentNullException(nameof(routeTableParameters));
            }

            using var message = CreateCreateOrUpdateRequest(resourceGroupName, virtualHubName, routeTableName, routeTableParameters);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
            switch (message.Response.Status)
            {
                case 200:
                case 201:
                    return message.Response;
                default:
                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
            }
        }

        /// <summary> Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. </summary>
        /// <param name="resourceGroupName"> The resource group name of the VirtualHub. </param>
        /// <param name="virtualHubName"> The name of the VirtualHub. </param>
        /// <param name="routeTableName"> The name of the RouteTable. </param>
        /// <param name="routeTableParameters"> Parameters supplied to create or update RouteTable. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/>, <paramref name="virtualHubName"/>, <paramref name="routeTableName"/>, or <paramref name="routeTableParameters"/> is null. </exception>
        public Response CreateOrUpdate(string resourceGroupName, string virtualHubName, string routeTableName, HubRouteTable routeTableParameters, CancellationToken cancellationToken = default)
        {
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (virtualHubName == null)
            {
                throw new ArgumentNullException(nameof(virtualHubName));
            }
            if (routeTableName == null)
            {
                throw new ArgumentNullException(nameof(routeTableName));
            }
            if (routeTableParameters == null)
            {
                throw new ArgumentNullException(nameof(routeTableParameters));
            }

            using var message = CreateCreateOrUpdateRequest(resourceGroupName, virtualHubName, routeTableName, routeTableParameters);
            _pipeline.Send(message, cancellationToken);
            switch (message.Response.Status)
            {
                case 200:
                case 201:
                    return message.Response;
                default:
                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
            }
        }

        internal HttpMessage CreateGetRequest(string resourceGroupName, string virtualHubName, string routeTableName)
        {
            var message = _pipeline.CreateMessage();
            var request = message.Request;
            request.Method = RequestMethod.Get;
            var uri = new RawRequestUriBuilder();
            uri.Reset(endpoint);
            uri.AppendPath("/subscriptions/", false);
            uri.AppendPath(subscriptionId, true);
            uri.AppendPath("/resourceGroups/", false);
            uri.AppendPath(resourceGroupName, true);
            uri.AppendPath("/providers/Microsoft.Network/virtualHubs/", false);
            uri.AppendPath(virtualHubName, true);
            uri.AppendPath("/hubRouteTables/", false);
            uri.AppendPath(routeTableName, true);
            uri.AppendQuery("api-version", "2020-04-01", true);
            request.Uri = uri;
            request.Headers.Add("Accept", "application/json");
            return message;
        }

        /// <summary> Retrieves the details of a RouteTable. </summary>
        /// <param name="resourceGroupName"> The resource group name of the VirtualHub. </param>
        /// <param name="virtualHubName"> The name of the VirtualHub. </param>
        /// <param name="routeTableName"> The name of the RouteTable. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/>, <paramref name="virtualHubName"/>, or <paramref name="routeTableName"/> is null. </exception>
        public async Task<Response<HubRouteTable>> GetAsync(string resourceGroupName, string virtualHubName, string routeTableName, CancellationToken cancellationToken = default)
        {
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (virtualHubName == null)
            {
                throw new ArgumentNullException(nameof(virtualHubName));
            }
            if (routeTableName == null)
            {
                throw new ArgumentNullException(nameof(routeTableName));
            }

            using var message = CreateGetRequest(resourceGroupName, virtualHubName, routeTableName);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        HubRouteTable value = default;
                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
                        value = HubRouteTable.DeserializeHubRouteTable(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                default:
                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
            }
        }

        /// <summary> Retrieves the details of a RouteTable. </summary>
        /// <param name="resourceGroupName"> The resource group name of the VirtualHub. </param>
        /// <param name="virtualHubName"> The name of the VirtualHub. </param>
        /// <param name="routeTableName"> The name of the RouteTable. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/>, <paramref name="virtualHubName"/>, or <paramref name="routeTableName"/> is null. </exception>
        public Response<HubRouteTable> Get(string resourceGroupName, string virtualHubName, string routeTableName, CancellationToken cancellationToken = default)
        {
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (virtualHubName == null)
            {
                throw new ArgumentNullException(nameof(virtualHubName));
            }
            if (routeTableName == null)
            {
                throw new ArgumentNullException(nameof(routeTableName));
            }

            using var message = CreateGetRequest(resourceGroupName, virtualHubName, routeTableName);
            _pipeline.Send(message, cancellationToken);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        HubRouteTable value = default;
                        using var document = JsonDocument.Parse(message.Response.ContentStream);
                        value = HubRouteTable.DeserializeHubRouteTable(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                default:
                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
            }
        }

        internal HttpMessage CreateDeleteRequest(string resourceGroupName, string virtualHubName, string routeTableName)
        {
            var message = _pipeline.CreateMessage();
            var request = message.Request;
            request.Method = RequestMethod.Delete;
            var uri = new RawRequestUriBuilder();
            uri.Reset(endpoint);
            uri.AppendPath("/subscriptions/", false);
            uri.AppendPath(subscriptionId, true);
            uri.AppendPath("/resourceGroups/", false);
            uri.AppendPath(resourceGroupName, true);
            uri.AppendPath("/providers/Microsoft.Network/virtualHubs/", false);
            uri.AppendPath(virtualHubName, true);
            uri.AppendPath("/hubRouteTables/", false);
            uri.AppendPath(routeTableName, true);
            uri.AppendQuery("api-version", "2020-04-01", true);
            request.Uri = uri;
            request.Headers.Add("Accept", "application/json");
            return message;
        }

        /// <summary> Deletes a RouteTable. </summary>
        /// <param name="resourceGroupName"> The resource group name of the RouteTable. </param>
        /// <param name="virtualHubName"> The name of the VirtualHub. </param>
        /// <param name="routeTableName"> The name of the RouteTable. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/>, <paramref name="virtualHubName"/>, or <paramref name="routeTableName"/> is null. </exception>
        public async Task<Response> DeleteAsync(string resourceGroupName, string virtualHubName, string routeTableName, CancellationToken cancellationToken = default)
        {
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (virtualHubName == null)
            {
                throw new ArgumentNullException(nameof(virtualHubName));
            }
            if (routeTableName == null)
            {
                throw new ArgumentNullException(nameof(routeTableName));
            }

            using var message = CreateDeleteRequest(resourceGroupName, virtualHubName, routeTableName);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
            switch (message.Response.Status)
            {
                case 200:
                case 202:
                case 204:
                    return message.Response;
                default:
                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
            }
        }

        /// <summary> Deletes a RouteTable. </summary>
        /// <param name="resourceGroupName"> The resource group name of the RouteTable. </param>
        /// <param name="virtualHubName"> The name of the VirtualHub. </param>
        /// <param name="routeTableName"> The name of the RouteTable. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/>, <paramref name="virtualHubName"/>, or <paramref name="routeTableName"/> is null. </exception>
        public Response Delete(string resourceGroupName, string virtualHubName, string routeTableName, CancellationToken cancellationToken = default)
        {
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (virtualHubName == null)
            {
                throw new ArgumentNullException(nameof(virtualHubName));
            }
            if (routeTableName == null)
            {
                throw new ArgumentNullException(nameof(routeTableName));
            }

            using var message = CreateDeleteRequest(resourceGroupName, virtualHubName, routeTableName);
            _pipeline.Send(message, cancellationToken);
            switch (message.Response.Status)
            {
                case 200:
                case 202:
                case 204:
                    return message.Response;
                default:
                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
            }
        }

        internal HttpMessage CreateListRequest(string resourceGroupName, string virtualHubName)
        {
            var message = _pipeline.CreateMessage();
            var request = message.Request;
            request.Method = RequestMethod.Get;
            var uri = new RawRequestUriBuilder();
            uri.Reset(endpoint);
            uri.AppendPath("/subscriptions/", false);
            uri.AppendPath(subscriptionId, true);
            uri.AppendPath("/resourceGroups/", false);
            uri.AppendPath(resourceGroupName, true);
            uri.AppendPath("/providers/Microsoft.Network/virtualHubs/", false);
            uri.AppendPath(virtualHubName, true);
            uri.AppendPath("/hubRouteTables", false);
            uri.AppendQuery("api-version", "2020-04-01", true);
            request.Uri = uri;
            request.Headers.Add("Accept", "application/json");
            return message;
        }

        /// <summary> Retrieves the details of all RouteTables. </summary>
        /// <param name="resourceGroupName"> The resource group name of the VirtualHub. </param>
        /// <param name="virtualHubName"> The name of the VirtualHub. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/> or <paramref name="virtualHubName"/> is null. </exception>
        public async Task<Response<ListHubRouteTablesResult>> ListAsync(string resourceGroupName, string virtualHubName, CancellationToken cancellationToken = default)
        {
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (virtualHubName == null)
            {
                throw new ArgumentNullException(nameof(virtualHubName));
            }

            using var message = CreateListRequest(resourceGroupName, virtualHubName);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        ListHubRouteTablesResult value = default;
                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
                        value = ListHubRouteTablesResult.DeserializeListHubRouteTablesResult(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                default:
                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
            }
        }

        /// <summary> Retrieves the details of all RouteTables. </summary>
        /// <param name="resourceGroupName"> The resource group name of the VirtualHub. </param>
        /// <param name="virtualHubName"> The name of the VirtualHub. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/> or <paramref name="virtualHubName"/> is null. </exception>
        public Response<ListHubRouteTablesResult> List(string resourceGroupName, string virtualHubName, CancellationToken cancellationToken = default)
        {
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (virtualHubName == null)
            {
                throw new ArgumentNullException(nameof(virtualHubName));
            }

            using var message = CreateListRequest(resourceGroupName, virtualHubName);
            _pipeline.Send(message, cancellationToken);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        ListHubRouteTablesResult value = default;
                        using var document = JsonDocument.Parse(message.Response.ContentStream);
                        value = ListHubRouteTablesResult.DeserializeListHubRouteTablesResult(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                default:
                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
            }
        }

        internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName, string virtualHubName)
        {
            var message = _pipeline.CreateMessage();
            var request = message.Request;
            request.Method = RequestMethod.Get;
            var uri = new RawRequestUriBuilder();
            uri.Reset(endpoint);
            uri.AppendRawNextLink(nextLink, false);
            request.Uri = uri;
            request.Headers.Add("Accept", "application/json");
            return message;
        }

        /// <summary> Retrieves the details of all RouteTables. </summary>
        /// <param name="nextLink"> The URL to the next page of results. </param>
        /// <param name="resourceGroupName"> The resource group name of the VirtualHub. </param>
        /// <param name="virtualHubName"> The name of the VirtualHub. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="nextLink"/>, <paramref name="resourceGroupName"/>, or <paramref name="virtualHubName"/> is null. </exception>
        public async Task<Response<ListHubRouteTablesResult>> ListNextPageAsync(string nextLink, string resourceGroupName, string virtualHubName, CancellationToken cancellationToken = default)
        {
            if (nextLink == null)
            {
                throw new ArgumentNullException(nameof(nextLink));
            }
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (virtualHubName == null)
            {
                throw new ArgumentNullException(nameof(virtualHubName));
            }

            using var message = CreateListNextPageRequest(nextLink, resourceGroupName, virtualHubName);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        ListHubRouteTablesResult value = default;
                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
                        value = ListHubRouteTablesResult.DeserializeListHubRouteTablesResult(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                default:
                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
            }
        }

        /// <summary> Retrieves the details of all RouteTables. </summary>
        /// <param name="nextLink"> The URL to the next page of results. </param>
        /// <param name="resourceGroupName"> The resource group name of the VirtualHub. </param>
        /// <param name="virtualHubName"> The name of the VirtualHub. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="nextLink"/>, <paramref name="resourceGroupName"/>, or <paramref name="virtualHubName"/> is null. </exception>
        public Response<ListHubRouteTablesResult> ListNextPage(string nextLink, string resourceGroupName, string virtualHubName, CancellationToken cancellationToken = default)
        {
            if (nextLink == null)
            {
                throw new ArgumentNullException(nameof(nextLink));
            }
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (virtualHubName == null)
            {
                throw new ArgumentNullException(nameof(virtualHubName));
            }

            using var message = CreateListNextPageRequest(nextLink, resourceGroupName, virtualHubName);
            _pipeline.Send(message, cancellationToken);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        ListHubRouteTablesResult value = default;
                        using var document = JsonDocument.Parse(message.Response.ContentStream);
                        value = ListHubRouteTablesResult.DeserializeListHubRouteTablesResult(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                default:
                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
            }
        }
    }
}


text:
JanusVR Mapper
==============

A headless client for the JanusVR server that scrapes a list of URLs from a given JanusVR compatible room and follows
them a specfic number of levels deep to construct a map. User data is requested from the JanusVR server at regular
intervals so it can show the population of each room. This data is then cached for a specific length of time and
processed into a JanusVR compatible "Map Room" which users can access to see who's online.

It uses the [Laravel](http://laravel.com/) 4 PHP framework and is designed to run on a Linux server running Apache.

Dependencies
------------
* [Laravel 4 PHP Framework](http://laravel.com/)
* [Goutte PHP Web Scraper](http://github.com/fabpot/goutte)
* PHP 5.4 or higher

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

1) `cd` to the root of the repository and follow the instructions at
[https://getcomposer.org/download/](https://getcomposer.org/download/) to install Composer.

2) The following command from the root of the repository: `php composer.phar install`. This will install any required
composer packages into the `vendor` folder. Note that you will need the `php` binary correctly set in your PATH for this
to work.

3) Run `php composer.phar update` to update any packages.

4) If developing locally you may want to set up a new folder with custom config for your environment in the `app/config`
folder. Alternately, adjust the config in the `app/config/local` folder.

5) You will need to edit `app/bootstrap/start.php` and set the `local` environment to match your development machine's
hostname. Add other environment -> hostname mappings here as needed. You can find your hostname by opening up a terminal
and running `hostname`.

6) You can also override only parts of the global config by specifying the keys you wish to override in a php file of
the same name inside the `local` folder. I.e. you can add `debug => true` to a returned array in
`app/config/local/app.php` to turn on debug mode for your local development server.

Usage
-----

* `cd` to the repository folder on your server and run `php artisan crawler:crawl` to start a crawl. This will retrieve
crawl data based on the settings in `app/config/crawler.php` and store it in the server cache at `app/storage/cache`. If
you want to run this command on a scheduled timer, add it to the user's `crontab` on the server by running the following
command: `crontab -e`.

redpajama_set_name: RedPajamaGithub


text:
<FrameworkJobReport>
<TimingService>
  <AvgEventTime  Value="0.0017045" />
  <MaxEventTime  Value="0.00337982" />
  <MinEventTime  Value="0.000648022" />
  <TotalTime  Value="0.017045" />
</TimingService>

<GeneratorInfo>
</GeneratorInfo>
</FrameworkJobReport>


text:
package org.jclouds.openstack.neutron.v2_0.util;

import com.google.common.base.Predicate;
import org.jclouds.javax.annotation.Nullable;

import java.lang.reflect.Field;

public class PredicateUtil {

    public static <T> Predicate<T> createIdEqualsPredicate(final String id) {
        return new Predicate<T>() {
            @Override
            public boolean apply(@Nullable T input) {
                if (input == null) return false;

                try {
                    Class clazz = input.getClass();
                    Field field = ClassUtil.findField(clazz, "id");
                    field.setAccessible(true);
                    String value = (String) field.get(input);
                    field.setAccessible(false);
                    return value != null && value.equals(id);
                } catch (IllegalAccessException iae) {
                    return false;
                }
            }
        };
    }

}


text:
<?php

Yii::import('translate.components.ExplorerController');

/**
 *
 * @author Louis A. DaPrato <l.daprato@gmail.com>
 *
 */
class LanguageController extends ExplorerController
{

	/*public function filters()
	{
		return array_merge(parent::filters(), array(
			'ajaxOnly + ajaxIndex, ajaxView, ajaxCreate',
			'postOnly + create, ajaxCreate',
			array(
				'ext.LDConditionChainFilter.LDForwardActionFilter.LDForwardActionFilter + index',
				'conditions' => 'ajaxIndex + ajax'
			),
			array(
				'ext.LDConditionChainFilter.LDForwardActionFilter.LDForwardActionFilter + view',
				'conditions' => 'ajaxView + ajax'
			),
			array(
				'ext.LDConditionChainFilter.LDForwardActionFilter.LDForwardActionFilter + create',
				'conditions' => 'ajaxCreate + ajax'
			)
		));
	}*/

	public function actionTranslate(array $Language = array(), $dryRun = true)
	{
		$dryRun = true;
		$translator = $this->getTranslateModule()->translator();
		if(!$translator->autoTranslate)
		{
			throw new CHttpException(501, $this->getTranslateModule()->t("Auto translate is disabled. Please check your system configuration."));
		}

		$model = $this->getModel('search');
		$model->with('missingTranslations');
		$model->setAttributes($Language);
		$condition = $model->getSearchCriteria();

		$translationsCreated = 0;
		$translationErrors = 0;
		$messageSourceIds = array();

		$transaction = $model->getDbConnection()->beginTransaction();
		try
		{
			$languages = $model->findAll($condition);
			if($dryRun)
			{
				foreach($languages as $language)
				{
					foreach($language->missingTranslations as $messageSource)
					{
						$messageSourceIds[$messageSource->id] = $messageSource->id;
						$translationsCreated++;
					}
				}
			}
			else
			{
				$source = $translator->getMessageSourceComponent();
				foreach($languages as $language)
				{
					foreach($language->missingTranslations as $messageSource)
					{
						$messageSourceIds[$messageSource->id] = $messageSource->id;
						$translation = $translator->translate($messageSource->message, $messageSource->language->code, $language->code);
						if($translation !== false)
						{
							if($source->addTranslation($messageSource->id, $language->code, trim($translation)) === null)
							{
								Yii::log("Message with ID '{$messageSource->id}' could not be added to the message source component after translating it to language '{$language->code}'", CLogger::LEVEL_ERROR, $this->getTranslateModuleID());
								$translationErrors++;
								continue;
							}
						}
						else
						{
							Yii::log("Message with ID '{$messageSource->id}' could not be translated to '{$language->code}'.", CLogger::LEVEL_ERROR, $this->getTranslateModuleID());
							$translationErrors++;
							continue;
						}
					}
				}
			}
			$transaction->commit();
		}
		catch(Exception $e)
		{
			$transaction->rollback();
			return $this->renderMessage($e);
		}

		if($dryRun)
		{
			$this->renderMessage(
				TController::SUCCESS,
				$this->getTranslateModule()->t(
						'This action will translate {messagesTranslated} source messages into {languagesCount} languages. {translationsCreated} message translations in total will be created. Are you sure that you would like to continue?',
						array('{translationsCreated}' => $translationsCreated, '{languagesCount}' => count($languages), '{messagesTranslated}' => count($messageSourceIds))
				)
			);
		}
		else
		{
			$this->renderMessage(
				$translationErrors > 0 ? TController::NOTICE : TController::SUCCESS,
				$this->getTranslateModule()->t(
						'{translationsCreated} translations were created for {messagesTranslated} source messages in {languagesCount} languages. {translationErrors} errors occurred (see system log).',
						array('{translationsCreated}' => $translationsCreated, '{languagesCount}' => count($languages), '{messagesTranslated}' => count($messageSourceIds), '{translationErrors}' => $translationErrors)
				)
			);
		}
	}

	public function actionCompile(array $ViewSource = array(), $dryRun = true)
	{
		$dryRun = true;
		$translator = $this->getTranslateModule()->translator();

		$model = $this->getModel('search');
		$model->with('missingViews');
		$model->setAttributes($ViewSource);
		$condition = $model->getSearchCriteria();

		$translationsCreated = 0;
		$viewsTranslated = 0;
		$languagesCount = 0;
		$translationErrors = 0;

		$transaction = Yii::app()->db->beginTransaction();
		try
		{
			$viewSources = $model->findAll($condition);
			if($dryRun)
			{
				$languageIds = array();
				foreach($viewSources as $viewSource)
				{
					foreach($viewSource->missingViews as $language)
					{
						$languageIds[$language->id] = $language->id;
						$translationsCreated++;
					}
					$viewsTranslated++;
				}
				$languagesCount = count($languageIds);
			}
			else
			{
				$viewRenderer = Yii::app()->getViewRenderer();
				$languageIds = array();
				foreach($viewSources as $viewSource)
				{
					if($viewSource->getIsReadable())
					{
						foreach($viewSource->missingViews as $language)
						{
							$languageIds[$language->id] = $language->id;
							try
							{
								$viewRenderer->generateViewFile($viewSource->path, $viewRenderer->getViewFile($viewSource->path, $language->code), null, $translator->messageSource, $language->code, false);
							}
							catch(CException $ce)
							{
								Yii::log($ce->getMessage(), CLogger::LEVEL_ERROR, $this->getTranslateModuleID());
								$translationErrors++;
								continue;
							}
							$translationsCreated++;
						}
						$viewsTranslated++;
					}
					else
					{
						Yii::log('The source view with ID "'.$viewSource->id.'" could not be translated because its path not readable.', CLogger::LEVEL_ERROR, $this->getTranslateModuleID());
						$translationErrors++;
					}
				}
				$languagesCount = count($languageIds);
			}
			$transaction->commit();
		}
		catch(Exception $e)
		{
			$transaction->rollback();
			return $this->renderMessage($e);
		}

		if($dryRun)
		{
			$this->renderMessage(
				TController::SUCCESS,
				$this->getTranslateModule()->t('This action will translate {viewsTranslated} source views into {languagesCount} languages. {translationsCreated} view translations in total will be created. Are you sure that you would like to continue?', array('{translationsCreated}' => $translationsCreated, '{languagesCount}' => $languagesCount, '{viewsTranslated}' => $viewsTranslated))
			);
		}
		else if($translationErrors > 0)
		{
			$this->renderMessage(
				TController::NOTICE,
				$this->getTranslateModule()->t('{translationErrors} views could not be translated. Only {translationsCreated} views were successfully translated. Please see the system\'s logs for details.', array('{translationsCreated}' => $translationsCreated, '{translationErrors}' => $translationErrors))
			);
		}
		else
		{
			$this->renderMessage(
				TController::SUCCESS,
				$this->getTranslateModule()->t('{translationsCreated} view translations have been created for {viewsTranslated} source views in {languagesCount} languages.', array('{translationsCreated}' => $translationsCreated, '{languagesCount}' => $languagesCount, '{viewsTranslated}' => $viewsTranslated))
			);
		}
	}

	public function actionCreate($id)
	{
		$model = new Language;
		$model->id = $id;

		$success = $model->save();

		if($model->save())
		{
			$this->renderMessage(TController::SUCCESS, 'The language has been created.');
		}
		else
		{
			$this->renderMessage(TController::ERROR, 'The language could not be created.');
		}
	}

	public function actionAjaxCreate(array $Language = array(), $ajax = null)
	{
		if(isset($ajax))
		{
			if($ajax === 'accepted-language-create-form')
			{
				$language = new Language;
				$language->setAttributes($Language);
				echo CActiveForm::validate($language);
			}
		}
	}

	/**
	 * Deletes a Language and any associated AcceptedLanguages, MessageSources, Messages, and Views
	 *
	 * @param integer $id the ID of the Language to be deleted
	 */
	/*public function actionDelete(array $Language = array(), $dryRun = true)
	{
		$dryRun = true;

		$model = $this->getModel('search');
		$model->setAttributes($Language);
		$condition = $model->getSearchCriteria();

		$messagesDeleted = 0;
		$sourceMessagesDeleted = 0;
		$viewsDeleted = 0;
		$acceptedLanguagesDeleted = 0;
		$languagesDeleted = 0;

		$transaction = Language::model()->getDbConnection()->beginTransaction();
		try
		{
			if(empty($Language))
			{
				if($dryRun)
				{
					$messagesDeleted = Message::model()->count();
					$sourceMessagesDeleted = MessageSource::model()->count();
					$viewsDeleted = View::model()->count();
					$acceptedLanguagesDeleted = AcceptedLanguage::model()->count();
					$languagesDeleted = Language::model()->count();
				}
				else
				{
					$messagesDeleted = Message::model()->deleteAll();
					$sourceMessagesDeleted = MessageSource::model()->deleteAll();
					$viewsDeleted = View::model()->deleteAll();
					$acceptedLanguagesDeleted = AcceptedLanguage::model()->deleteAll();
					$languagesDeleted = Language::model()->deleteAll();
					ViewMessage::model()->deleteAll();
					CategoryMessage::model()->deleteAll();
				}
			}
			else
			{
				$primaryKeys = array();
				foreach($model->filter($model->findAll($condition)) as $record)
				{
					$primaryKeys[] = $record['id'];
				}

				if($dryRun)
				{
					$messagesDeleted = Message::model()->languageSelfOrSource($primaryKeys)->count();
					$sourceMessagesDeleted = MessageSource::model()->language($primaryKeys)->count();
					$viewsDeleted = View::model()->language($primaryKeys)->count();
					$acceptedLanguagesDeleted = AcceptedLanguage::model()->countByAttributes(array('id' => $primaryKeys));
					$languagesDeleted = count($primaryKeys);
				}
				else
				{
					$messagesDeleted = Message::model()->languageSelfOrSource($primaryKeys)->deleteAll();
					$sourceMessagesDeleted = MessageSource::model()->language($primaryKeys)->deleteAll();
					$viewsDeleted = View::model()->language($primaryKeys)->deleteAll();
					$acceptedLanguagesDeleted = AcceptedLanguage::model()->deleteAllByPk($primaryKeys);
					$languagesDeleted = Language::model()->deleteAllByPk($primaryKeys);
					ViewMessage::model()->deleteAllByAttributes(array('message_id' => $primaryKeys));
					CategoryMessage::model()->deleteAllByAttributes(array('message_id' => $primaryKeys));
				}
			}
			$transaction->commit();
		}
		catch(Exception $e)
		{
			$transaction->rollback();
			return $this->renderMessage($e);
		}

		$this->renderMessage(
				TController::SUCCESS,
				$dryRun ? $this->getTranslateModule()->t('This action will deleted {languages} languages, {acceptedLanguages} accepted languages, {sourceMessages} source messages, {messages} translations, and {views} translated views. Are you sure that you would like to continue?', array('{languages}' => $languagesDeleted, '{sourceMessages}' => $sourceMessagesDeleted, '{messages}' => $messagesDeleted, '{acceptedLanguages}' => $acceptedLanguagesDeleted, '{views}' => $viewsDeleted)) : $this->getTranslateModule()->t('{languages} languages, {acceptedLanguages} accepted languages, {sourceMessages} source messages, {messages} translations, and {views} translated views have been deleted.', array('{languages}' => $languagesDeleted, '{sourceMessages}' => $sourceMessagesDeleted, '{messages}' => $messagesDeleted, '{acceptedLanguages}' => $acceptedLanguagesDeleted, '{views}' => $viewsDeleted)),
				'index'
		);
	}*/

}


text:
'use babel'
/** @jsx etch.dom */

import etch from 'etch'
import UiComponent from '../ui/component'
import DefaultBreakpointItemView from './default-breakpoint-item-view'
import helpers from '../helpers'

export default class DefaultBreakpointListView extends UiComponent {

  constructor (props,children) {
    super(props,children)
    this._services = props.services;
    this.subscriptions.add(atom.config.onDidChange("php-debug.exceptions", this.breakpointsUpdated))
  }

  render () {
    const {services,state} = this.props;
    const breakpointComponents = Object.keys(state.breakpoints).map((breakpointType,index) => {
      let breakpoint = state.breakpoints[breakpointType];
      let status = atom.config.get('php-debug.exceptions.'+breakpointType)
      return <DefaultBreakpointItemView key={index} services={services} type={breakpointType} breakpoint={breakpoint} status={status} onchange={this.breakpointChanged} />
    });
    return

        Exceptions:

          {breakpointComponents}

  }

  breakpointsReady() {
  }

  breakpointsUpdated(event) {
    var changed = false;
    for (let key in event.newValue) {
      if (event.newValue[key] != event.oldValue[key]) {
        changed = true;
      }
    }
    if (changed) {
      this.update({state:this.props.state}, this.children, true);
    }
  }

  init () {
    if (!this.props.state) {
      let config = atom.config.getSchema('php-debug.exceptions').properties;
      this.props.state = {
        breakpoints: config
      };
    }
    super.init();
  }

  breakpointChanged(type, checked) {
    atom.config.set('php-debug.exceptions.'+type, checked)
  }
}
DefaultBreakpointListView.bindFns = ["breakpointsReady","breakpointChanged","breakpointsUpdated"]


text:
/**
 * @param {!string} s
 * @param {!number} i
 * @return {string|undefined}
 */
function getChar(s, i) {
  return LEGACY ? s.charAt(i) : s[i]
}

/**
 * Returns the number of consecutive spaces found starting at the given index or
 * -1 if the index was out of bounds.
 *
 * @param {!string} s
 * @param {!number} i
 * @return {number}
 */
function countSpacesAt(s, i) {
  let res = 0

  for (;;) {
    switch((getChar(s, i+res) || "")) {
    case ' ': case '\t': case '\n':
      res += 1
      continue

    case "":
      return res || -1
    }
    return res
  }
}

/**
 * @param {!Array<*>} coll
 * @param {!*} target
 * @return {boolean}
 */
function contains(coll, target) {
  for (let i = 0, len = coll.length; i < len; i+=1) {
    if (coll[i] === target) {
      return true
    }
  }
  return false
}

 /**
 * @param {!Node} el
 * @return {string}
 */
function nodeName(el) {
  if (LEGACY) {
    /*
    const n = el.nodeName.toUpperCase()

    if (needTagFix && getChar(n, 0) === '/') {
      return n.slice(1)
    } else {
      return n
    }
    */
    return el.nodeName.toUpperCase()

  } else {
    return el.nodeName
  }
}

/**
 * Because `<input type=number>` gets turned into `type=text` in browsers that
 * don't supporter `type=number`, we check for the existence of a `min` or a
 * `max` property as an indicator that it's a number.
 *
 * @param {!Element} el
 * @return {boolean}
 */
function isNumberInput(el) {
  return nodeName(el) === "INPUT" &&
        (el.type === "number" ||
         (el.type === "text" && (hasAttr(el, "min") || hasAttr(el, "max"))))
}

/**
 * @param {!Element} el
 * @param {!string} name
 * @return {boolean}
 */
function checkBooleanAttr(el, name) {
  return el[name] || hasAttr(el, name)
}

/**
 * @param {!Element} el
 * @param {!string} name
 * @return {boolean}
 */
function hasAttr(el, name) {
  if (LEGACY) {
    return !!(!el.attributes[name] && name === "class" ?
                el.attributes["className"] :
                el.attributes[name])
  } else {
    return !!el.attributes[name]
  }
}

const reuse_obj = {}

/**
 * @param {!Element} el
 * @param {!string} name
 * @return {string|undefined}
 */
function getAttr(el, name) {
  if (LEGACY) {
    return ((!el.attributes[name] && name === "class" ?
              el.attributes["className"] :
              el.attributes[name]) || reuse_obj).value
  } else {
    return (el.attributes[name] || reuse_obj).value
  }
}

/**
 * @param {!Element} el
 * @return {Element}
 */
function parentElement(el) {
  if (LEGACY) {
    const par = /**@type{Element}*/(el.parentNode)
    return par && par.nodeType === Node.ELEMENT_NODE ? par : null
  } else {
    return el.parentElement
  }
}

/**
 * @param {!Node} el
 * @return {Element}
 */
function prevElemSib(el) {
  if (LEGACY) {
    let sib = el
    while ((sib = sib.previousSibling) && sib.nodeType !== Node.ELEMENT_NODE){}

    return /**@type{Element}*/(sib)
  } else {
    return el.previousElementSibling
  }
}

/**
 * @param {!Node} el
 * @return {Element}
 */
function nextElemSib(el) {
  if (LEGACY) {
    let sib = el
    while ((sib = sib.nextSibling) && sib.nodeType !== Node.ELEMENT_NODE){}

    return /**@type{Element}*/(sib)
  } else {
    return el.nextElementSibling
  }
}

/**
 * @param {!Node} el
 * @return {Element}
 */
function firstElemChild(el) {
  if (LEGACY) {
    if (el.firstChild && el.firstChild.nodeType !== Node.ELEMENT_NODE) {
      return nextElemSib(el.firstChild)
    } else {
      return /**@type{Element}*/(el.firstChild)
    }
  } else {
    return el.firstElementChild
  }
}

/**
 * @param {!Node} el
 * @return {Element}
 */
function lastElemChild(el) {
  if (LEGACY) {
    if (el.lastChild && el.lastChild.nodeType !== Node.ELEMENT_NODE) {
      return prevElemSib(el.lastChild)
    } else {
      return /**@type{Element}*/(el.lastChild)
    }
  } else {
    return el.lastElementChild
  }
}


text:
import subprocess

try:
    subprocess.call(["solve-field"], stdout=subprocess.DEVNULL)

except FileNotFoundError:
    raise ImportWarning("solve-field not found, is astrometry.net installed and in PATH?")


text:
class ApplicationHelper::Toolbar::MiqAeMethodsCenter < ApplicationHelper::Toolbar::Basic
  button_group('miq_ae_method_vmdb', [
    select(
      :miq_ae_method_vmdb_choice,
      nil,
      N_('Configuration'),
      :items => [
        button(
          :miq_ae_class_edit,
          'pficon pficon-edit fa-lg',
          N_('Edit this Class'),
          :klass => ApplicationHelper::Button::MiqAeDefault),
        button(
          :miq_ae_class_copy,
          'fa fa-files-o fa-lg',
          N_('Copy this Class'),
          :klass => ApplicationHelper::Button::MiqAeClassCopy),
        button(
          :miq_ae_class_delete,
          'pficon pficon-delete fa-lg',
          N_('Remove this Class'),
          :url_parms => "&refresh=y",
          :confirm   => N_("Are you sure you want to remove this Class?"),
          :klass     => ApplicationHelper::Button::MiqAeDefault),
        separator,
        button(
          :miq_ae_method_new,
          'pficon pficon-add-circle-o fa-lg',
          N_('Add a New Method'),
          :klass => ApplicationHelper::Button::MiqAeNew),
        button(
          :miq_ae_method_edit,
          'pficon pficon-edit fa-lg',
          N_('Select a single Method to edit'),
          N_('Edit Selected Method'),
          :url_parms    => "main_div",
          :send_checked => true,
          :enabled      => false,
          :onwhen       => "1",
          :klass        => ApplicationHelper::Button::MiqAeDefault),
        button(
          :miq_ae_method_copy,
          'fa fa-files-o fa-lg',
          N_('Select Methods to copy'),
          N_('Copy selected Methods'),
          :url_parms    => "main_div",
          :send_checked => true,
          :enabled      => false,
          :onwhen       => "1+",
          :klass        => ApplicationHelper::Button::MiqAeInstanceCopy),
        button(
          :miq_ae_method_delete,
          'pficon pficon-delete fa-lg',
          N_('Remove selected Methods'),
          N_('Remove Methods'),
          :url_parms    => "main_div",
          :send_checked => true,
          :confirm      => N_("Are you sure you want to remove the selected Methods?"),
          :enabled      => false,
          :onwhen       => "1+",
          :klass        => ApplicationHelper::Button::MiqAeDefault),
      ]
    ),
  ])
end


text:
Operational layers contain your data. Usually, a basemap sits beneath your operational layers to give them geographic context.

* [CSV Layer (CSV)](csvLayer.md)
* [Feature Layer (ArcGISFeatureLayer)](featureLayer.md)
* [Group Layer](groupLayer.md)
* [Image Service Layer (ArcGISImageServiceLayer)](imageServiceLayer.md)
* [Integrated Mesh Layer (IntegratedMeshLayer)](integratedMeshLayer.md)
* [Map Service Layer (ArcGISMapServiceLayer)](mapServiceLayer.md)
* [PointCloud Layer](pointCloudLayer.md)
* [Scene Layer (ArcGISSceneServiceLayer)](sceneLayer.md)
* [Tiled Image Service Layer (ArcGISTiledImageServiceLayer)](tiledImageServiceLayer.md)
* [Tiled Map Service Layer (ArcGISTiledMapServiceLayer)](tiledMapServiceLayer.md)
* [Vector Tile Layer (VectorTileLayer)](vectorTileLayer.md)
* [WebTiledLayer](webTiledLayer.md)
* [WMS Layer (WMS)](wmsLayer.md)


text:
/*
 * 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.
 */
package models;

import java.util.ArrayList;
import java.util.Date;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author cancancan
 */
public class EntryTest {

    public EntryTest() {
    }

    @BeforeClass
    public static void setUpClass() {
    }

    @AfterClass
    public static void tearDownClass() {
    }

    /**
     * Test of getEntryID method, of class Entry.
     */
    @Test
    public void testGetEntryID() {
        System.out.println("getEntryID");
        Date TestDate = new Date();
        Entry instance = new Entry(123,123,123,"TestTitle","TestContent","TestFlag",TestDate);
        int expResult = 123;
        int result = instance.getEntryID();
        assertEquals(expResult, result);

    }

    /**
     * Test of getUserID method, of class Entry.
     */
    @Test
    public void testGetUserID() {
        System.out.println("getUserID");
          Date TestDate = new Date();
        Entry instance = new Entry(123,123,123,"TestTitle","TestContent","TestFlag",TestDate);
        int expResult = 123;
        int result = instance.getUserID();
        assertEquals(expResult, result);

    }

    /**
     * Test of getJournalID method, of class Entry.
     */
    @Test
    public void testGetJournalID() {
        System.out.println("getJournalID");
         Date TestDate = new Date();
        Entry instance = new Entry(123,123,123,"TestTitle","TestContent","TestFlag",TestDate);
        int expResult = 123;
        int result = instance.getJournalID();
        assertEquals(expResult, result);
    }

    /**
     * Test of getContent method, of class Entry.
     */
    @Test
    public void testGetContent() {
        System.out.println("getContent");
        Date TestDate = new Date();
        Entry instance = new Entry(123,123,123,"TestTitle","TestContent","TestFlag",TestDate);
        String expResult = "TestContent";
        String result = instance.getContent();
        assertEquals(expResult, result);

    }

    /**
     * Test of getContentSnippet method, of class Entry.
     */
    @Test
    public void testGetContentSnippet() {
        System.out.println("getContentSnippet");
        Date TestDate = new Date();
        Entry instance = new Entry(123,123,123,"TestTitle","TestContent","TestFlag",TestDate);
        String expResult = "TestContent";
        String result = instance.getContentSnippet();
        assertEquals(expResult, result);

    }

    /**
     * Test of getTitle method, of class Entry.
     */
    @Test
    public void testGetTitle() {
        System.out.println("getTitle");
        Date TestDate = new Date();
        Entry instance = new Entry(123,123,123,"TestTitle","TestContent","TestFlag",TestDate);
        String expResult = "TestTitle";
        String result = instance.getTitle();
        assertEquals(expResult, result);

    }

    /**
     * Test of getTitleLowercase method, of class Entry.
     */
    @Test
    public void testGetTitleLowercase() {
        System.out.println("getTitleLowercase");
        Date TestDate = new Date();
        Entry instance = new Entry(123,123,123,"TestTitle","TestContent","TestFlag",TestDate);
        String expResult = "testtitle";
        String result = instance.getTitleLowercase();
        assertEquals(expResult, result);

    }

    /**
     * Test of getDateCreated method, of class Entry.
     */
    @Test
    public void testGetDateCreated() {
        System.out.println("getDateCreated");
        Date TestDate = new Date();
        Entry instance = new Entry(123,123,123,"TestTitle","TestContent","TestFlag",TestDate);
        Date expResult = new Date();
        Date result = instance.getDateCreated();
        assertEquals(expResult, result);

    }

    /**
     * Test of getDateModified method, of class Entry.
     */
    @Test
    public void testGetDateModified() {
        System.out.println("getDateModified");
        Date TestDate = new Date();
        Entry instance = new Entry(123,123,123,"TestTitle","TestContent","TestFlag",TestDate);
        Date expResult = new Date();
        Date result = instance.getDateModified();
        assertEquals(expResult, result);

    }

    /**
     * Test of getFlag method, of class Entry.
     */
    @Test
    public void testGetFlag() {
        System.out.println("getFlag");
      Date TestDate = new Date();
        Entry instance = new Entry(123,123,123,"TestTitle","TestContent","TestFlag",TestDate);
        String expResult = "TestFlag";
        String result = instance.getFlag();
        assertEquals(expResult, result);
    }

    /**
     * Test of getComments method, of class Entry.
     */
    @Test
    public void testGetComments() {
        System.out.println("getComments");
        Date TestDate = new Date();
       Comment comments = new Comment(123,TestDate,"Comment");

       ArrayList<Comment> commentsTest = new ArrayList<Comment>();
       commentsTest.add(comments);

        Entry e = new Entry();
        Entry instance = e;
        e.addComment(comments);
        ArrayList<Comment> result = instance.getComments();
         assertEquals(result,commentsTest);

    }

    /**
     * Test of getHistory method, of class Entry.
     */
    @Test
    public void testGetHistory() {
        System.out.println("getHistory");

        Date TestDate1 = new Date();
        EntryHistory eh = new EntryHistory(123,123,123,123,"TestTitle","TestContent",TestDate1);
        ArrayList<EntryHistory> history = new ArrayList<EntryHistory>();
        history.add(eh);

        ArrayList<EntryHistory> historyTest = new ArrayList<EntryHistory>();
        historyTest.add(eh);

        Entry e = new Entry();
        Entry instance = e;
        e.setHistory(history);

        ArrayList<EntryHistory> result = instance.getHistory();
        assertEquals(result,historyTest);

    }

    /**
     * Test of getHistoryReverse method, of class Entry.
     */
    @Test
    public void testGetHistoryReverse() {
        System.out.println("getHistoryReverse");

        Date TestDate1 = new Date();
        EntryHistory eh = new EntryHistory(123,123,123,123,"TestTitle","TestContent",TestDate1);
        ArrayList<EntryHistory> history = new ArrayList<EntryHistory>();
        history.add(eh);
         ArrayList<EntryHistory> historyTest = new ArrayList<EntryHistory>();
        historyTest.add(eh);

        Entry e = new Entry();
        Entry instance = e;
        e.setHistory(history);
        ArrayList<EntryHistory> result = instance.getHistoryReverse();
           assertEquals(result,historyTest);

    }

}


text:
// $Id$

/** Creates a new ContainerMenuItem.
  * @class It extends the base functionality of Ext.menu.Item
  * with the possibility of dynamically adding (or removing) a submenu to an item.
  * @constructor
  * @param {Object} config Configuration options. They are exactly the same config option of Ext.menu.Item
  * @extends Ext.menu.Item
  */
Ext.define('Ext.ux.netbox.ContainerMenuItem', {
	extend: 'Ext.menu.Item',
	constructor: function(config) {
	  Ext.ux.netbox.ContainerMenuItem.superclass.constructor.call(this,config);
	},

  getSubMenu : function(){
    return this.menu;
  },

  setSubMenu : function(menu){
    this.menu = Ext.menu.MenuMgr.get(menu);
    if(this.getEl()){
      this.getEl().addCls('x-menu-item-arrow');
    }
  },

  removeSubMenu : function(){
    this.menu=undefined;
    if(this.getEl()){
      this.getEl().removeClass('x-menu-item-arrow');
    }
  }

});


text:
var specFromRoute = require('./spec-from-route')

describe('SpecFromRoute', function () {
  describe('Given /', () => {
    var pathName = '/'
    var expectedOut = '/index.json'
    var specPath = specFromRoute(pathName)

    it('should result in ' + expectedOut, function () {
      expect(specPath).toEqual(expectedOut)
    })
  })

  describe('Given /', () => {
    var pathName = ''
    var expectedOut = '/index.json'
    var specPath = specFromRoute(pathName)

    it('should result in ' + expectedOut, function () {
      expect(specPath).toEqual(expectedOut)
    })
  })

  describe('Given a full  url string', () => {
    var pathName = '/bacon.html'
    var expectedOut = '/bacon.json'
    var specPath = specFromRoute(pathName)

    it('should result in ' + expectedOut, function () {
      expect(specPath).toEqual(expectedOut)
    })
  })

  describe('Given a a url ending with a forward slash (folder containing index.html)', () => {
    var pathName = '/bacon/'
    var expectedOut = '/bacon/index.json'
    var specPath = specFromRoute(pathName)

    it('should result in ' + expectedOut, function () {
      expect(specPath).toEqual(expectedOut)
    })
  })
})


text:
package edu.stqa.irigri.addressbook.tests;

import edu.stqa.irigri.addressbook.model.ContactData;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import java.util.Arrays;
import java.util.stream.Collectors;

import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;

public class ContactDetailsTests extends TestBase {

    @BeforeMethod
    public void ensurePreconditions(){
        if (app.db().contacts().size() == 0) {
            app.goTo().homePage();
            app.contact().create(new ContactData().withFirstname("Iri").withLastname("Gri")
                    .withMobile("3222333").withEmail("test@email.com").withAddress("France"));
        }
    }

    @Test
    public void testContactDetails() {
        app.goTo().homePage();
        ContactData contact = app.contact().all().iterator().next();
        ContactData contactDetails = app.contact().contactDetails(contact);

        assertThat(mergeDetails(contact), equalTo(cleanedDetails(contactDetails.getDetails())));
    }

    private String mergeDetails(ContactData contact){
        return Arrays.asList(contact.getFirstname(), contact.getLastname(), contact.getAddress(), contact.getAllPhones(), contact.getAllEmails())
                .stream().filter((s) -> ! s.equals(""))
                        .map(ContactDetailsTests::cleanedDetails)
                        .collect(Collectors.joining(""));
    }

    public static String cleanedDetails(String details) {
        return details.replaceAll("\\s", "").replaceAll("(\r\n|\n)", "").replaceAll("[-():HMW]", "")
                .replaceAll("www.email.com", "").replaceAll("www.test.go", "");
    }
}


text:
Cookie-Stand

Day 6


text:
"""
Creates a 32-bit server to use for
`inter-process communication <https://en.wikipedia.org/wiki/Inter-process_communication>`_.

This module must be run from a 32-bit Python interpreter with PyInstaller_ installed.

If you want to re-freeze the 32-bit server, for example, if you want a 32-bit version of
:mod:`numpy` to be available on the server, then run the following with a 32-bit Python
interpreter that has the packages that you want to be available on the server installed

.. code-block:: pycon

   >>> from msl.loadlib import freeze_server32
   >>> freeze_server32.main()  # doctest: +SKIP

.. _PyInstaller: https://www.pyinstaller.org/
.. _Python for .NET: https://pypi.python.org/pypi/pythonnet/
.. _comtypes: https://pythonhosted.org/comtypes/#
"""
import os
import shutil
import subprocess
import sys
try:
    from urllib.request import urlopen
except ImportError:  # then Python 2
    from urllib import urlopen

try:
    from msl import loadlib
except ImportError:
    sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
    from msl import loadlib

def main(spec=None, requires_pythonnet=True, requires_comtypes=True):
    """Creates a 32-bit Python server.

    Uses PyInstaller_ to create a frozen 32-bit Python executable. This executable
    starts a 32-bit server, :class:`~.server32.Server32`, which hosts a Python
    module that can load a 32-bit library.

    .. versionchanged:: 0.5
       Added the `requires_pythonnet` and `requires_comtypes` arguments.

    Parameters
    ----------
    spec : :class:`str`, optional
        The path to a PyInstaller_ .spec file to use to create the frozen
        32-bit server.
    requires_pythonnet : :class:`bool`, optional
        Whether `Python for .NET`_ must be available on the frozen 32-bit server.
        This argument is ignored for a non-Windows operating system.
    requires_comtypes : :class:`bool`, optional
        Whether comtypes_ must be available on the frozen 32-bit server.
        This argument is ignored for a non-Windows operating system.
    """
    if loadlib.IS_PYTHON_64BIT:
        print('Must run {} using a 32-bit Python interpreter'.format(os.path.basename(__file__)))
        return

    missing_packages = []
    try:
        import PyInstaller
    except ImportError:
        missing_packages.append('pyinstaller')

    if loadlib.IS_WINDOWS and requires_pythonnet:
        try:
            import clr
        except ImportError:
            missing_packages.append('pythonnet')

    if loadlib.IS_WINDOWS and requires_comtypes:
        try:
            import comtypes
        except ImportError:
            missing_packages.append('comtypes')
        except OSError:
            # OSError: [WinError -2147417850] Cannot change thread mode after it is set
            # don't care about this error since comtypes is indeed installed
            pass

    if missing_packages:
        print('Packages are missing to be able to create the 32-bit server, run:')
        print('pip install ' + ' '.join(missing_packages))
        return

    here = os.path.abspath(os.path.dirname(__file__))

    # Specifically invoke pyinstaller in the context of the current python interpreter.
    # This fixes the issue where the blind `pyinstaller` invocation points to a 64-bit version.
    cmd = [sys.executable, '-m', 'PyInstaller']

    version_info_file = None
    if spec is None:
        cmd.extend([
            '--distpath', here,
            '--python-option', 'u',
            '--noconfirm',
        ])

        if loadlib.IS_WINDOWS:
            version_info_file = _create_version_info_file(here)
            cmd.extend([
                '--version-file', version_info_file
            ])

        cmd.extend([
            '--name', loadlib.SERVER_FILENAME,
            '--onefile',
            '--clean',
            '--hidden-import', 'msl.examples.loadlib',
        ])
        if loadlib.IS_WINDOWS and requires_pythonnet:
            cmd.extend(['--hidden-import', 'clr'])
        if loadlib.IS_WINDOWS and requires_comtypes:
            cmd.extend(['--hidden-import', 'comtypes'])
        cmd.extend(_get_standard_modules())
        cmd.append(os.path.join(here, 'start_server32.py'))
    else:
        cmd.append(spec)
    subprocess.check_call(cmd)

    # cleanup
    shutil.rmtree('./build/' + loadlib.SERVER_FILENAME)
    if not os.listdir('./build'):
        shutil.rmtree('./build')
    if version_info_file:
        os.remove(version_info_file)
    try:
        os.remove(loadlib.SERVER_FILENAME + '.spec')
    except OSError:
        pass

    # create the .NET Framework config file
    loadlib.utils.check_dot_net_config(os.path.join(here, loadlib.SERVER_FILENAME))

    print('Server saved to: ' + os.path.join(here, loadlib.SERVER_FILENAME))

def _get_standard_modules():
    """
    Returns a list of standard python modules to include and exclude in the
    frozen application.

    PyInstaller does not automatically bundle all the standard Python modules
    into the frozen application. This method parses the 'docs.python.org'
    website for the list of standard Python modules that are available.

    The 'pyinstaller --exclude-module' option ensures that the module is
    excluded from the frozen application.

    The 'pyinstaller --hidden-import' option ensures that the module is included
    into the frozen application (only if the module is available for the operating
    system that is running this script).

    Returns
    -------
    :class:`list` of :class:`str`
        A list of modules to be included and excluded.
    """

    # the frozen application is not meant to create GUIs or to add
    # support for building and installing Python modules
    ignore_list = ['__main__', 'distutils', 'ensurepip', 'idlelib', 'lib2to3'
                   'test', 'tkinter', 'turtle']

    # some modules are platform specific and got a
    #   RecursionError: maximum recursion depth exceeded
    # when running this script with PyInstaller 3.3 installed
    if loadlib.IS_WINDOWS:
        os_ignore_list = ['(Unix)', '(Linux)', '(Linux, FreeBSD)']
    elif loadlib.IS_LINUX:
        os_ignore_list = ['(Windows)']
    elif loadlib.IS_MAC:
        os_ignore_list = ['(Windows)', '(Linux)', '(Linux, FreeBSD)']
    else:
        os_ignore_list = []

    modules = []
    url = 'https://docs.python.org/{0}.{1}/py-modindex.html'.format(*sys.version_info)
    for s in urlopen(url).read().decode().split('#module-')[1:]:
        m = s.split('"><code')
        add_module = True
        for x in os_ignore_list:
            if x in m[1]:
                ignore_list.append(m[0])
                add_module = False
                break
        if add_module:
            modules.append(m[0])

    included_modules, excluded_modules = [], []
    for module in modules:
        include_module = True
        for mod in ignore_list:
            if module.startswith(mod):
                excluded_modules.extend(['--exclude-module', module])
                include_module = False
                break
        if include_module:
            included_modules.extend(['--hidden-import', module])
    return included_modules + excluded_modules

def _create_version_info_file(root_path):
    text = """# UTF-8
#
# For more details about fixed file info 'ffi' see:
# https://docs.microsoft.com/en-us/windows/win32/api/verrsrc/ns-verrsrc-vs_fixedfileinfo
# For language and charset parameters see:
# https://docs.microsoft.com/en-us/windows/win32/menurc/stringfileinfo-block
VSVersionInfo(
  ffi=FixedFileInfo(
    filevers=({loadlib_major}, {loadlib_minor}, {loadlib_micro}, 0),
    prodvers=({py_major}, {py_minor}, {py_micro}, 0),
    mask=0x3f,
    flags=0x0,
    OS=0x40004,
    fileType=0x1,
    subtype=0x0,
    date=(0, 0)
    ),
  kids=[
    StringFileInfo(
      [
      StringTable(
        '000004B0',
        [StringStruct('CompanyName', '{author}'),
        StringStruct('FileDescription', 'Access a 32-bit library from 64-bit Python'),
        StringStruct('FileVersion', '{loadlib_major}.{loadlib_minor}.{loadlib_micro}.0'),
        StringStruct('InternalName', '{filename}'),
        StringStruct('LegalCopyright', '\xc2{copyright}'),
        StringStruct('OriginalFilename', '{filename}'),
        StringStruct('ProductName', 'Python'),
        StringStruct('ProductVersion', '{py_major}.{py_minor}.{py_micro}.0')])
      ]),
    VarFileInfo([VarStruct('Translation', [0, 1200])])
  ]
)
""".format(
        loadlib_major=loadlib.version_info.major,
        loadlib_minor=loadlib.version_info.minor,
        loadlib_micro=loadlib.version_info.micro,
        py_major=sys.version_info.major,
        py_minor=sys.version_info.minor,
        py_micro=sys.version_info.micro,
        filename=loadlib.SERVER_FILENAME,
        copyright=loadlib.__copyright__,
        author=loadlib.__author__,
    )
    save_to = os.path.join(root_path, 'file_version_info.txt')
    with open(save_to, mode='wt') as fp:
        fp.write(text)
    return save_to

if __name__ == '__main__':
    import argparse

    parser = argparse.ArgumentParser(description='Create the frozen 32-bit server.')
    parser.add_argument(
        '-s', '--spec',
        help='the PyInstaller spec file to use'
    )
    parser.add_argument(
        '--ignore-pythonnet',
        action='store_true',
        default=False,
        help='ignore the error that pythonnet is not installed'
    )
    parser.add_argument(
        '--ignore-comtypes',
        action='store_true',
        default=False,
        help='ignore the error that comtypes is not installed'
    )

    args = parser.parse_args(sys.argv[1:])

    sys.exit(
        main(
            spec=args.spec,
            requires_pythonnet=not args.ignore_pythonnet,
            requires_comtypes=not args.ignore_comtypes
        )
    )


text:
package com.amazonaws.services.securityhub.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.securityhub.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetailsMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetailsMarshaller {

    private static final MarshallingInfo<String> NAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Name").build();
    private static final MarshallingInfo<String> TYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Type").build();
    private static final MarshallingInfo<String> VALUE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Value").build();

    private static final AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetailsMarshaller instance = new AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetailsMarshaller();

    public static AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetailsMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails awsCodeBuildProjectEnvironmentEnvironmentVariablesDetails,
            ProtocolMarshaller protocolMarshaller) {

        if (awsCodeBuildProjectEnvironmentEnvironmentVariablesDetails == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(awsCodeBuildProjectEnvironmentEnvironmentVariablesDetails.getName(), NAME_BINDING);
            protocolMarshaller.marshall(awsCodeBuildProjectEnvironmentEnvironmentVariablesDetails.getType(), TYPE_BINDING);
            protocolMarshaller.marshall(awsCodeBuildProjectEnvironmentEnvironmentVariablesDetails.getValue(), VALUE_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
package nl.cwi.reo.interpret.variables;

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

import org.checkerframework.checker.nullness.qual.Nullable;

import nl.cwi.reo.interpret.Scope;
import nl.cwi.reo.interpret.typetags.TypeTag;
import nl.cwi.reo.util.Monitor;

// TODO: Auto-generated Javadoc
/**
 * Interpretation of a parameter expression.
 */
public final class ParameterExpression extends VariableExpression {

	/**
	 * Type of this parameter.
	 */
	private final ParameterType type;

	/**
	 * Constructs a new parameter expression.
	 *
	 * @param var
	 *            the var
	 * @param type
	 *            type of parameter
	 */
	public ParameterExpression(VariableExpression var, ParameterType type) {
		super(var.getName(), var.getIndices(), var.getLocation());
		this.type = type;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	@Nullable
	public List<Parameter> evaluate(Scope s, Monitor m) {
		List<Parameter> params = new ArrayList<Parameter>();
		List<? extends Identifier> list = super.evaluate(s, m);
		if (list == null)
			return null;
		for (Identifier x : list)
			params.add(new Parameter(x.toString(), type));
		return params;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public String toString() {
		return type instanceof TypeTag ? super.toString() + ":" + type : super.toString();
	}
}


text:
function sample_data = aquatrackaPP( sample_data, qcLevel, auto )
%AQUATRACKAPP transforms an Aquatracka analog output into engineering units.
%
% This function uses the following formula PARAM =
% scale_factor*10^(PARAM_analog) + offset . scale_factor and offset are
% taken from calibration sheets.
%
% Inputs:
%   sample_data - cell array of data sets, ideally with conductivity,
%                 temperature and pressure variables.
%   qcLevel     - string, 'raw' or 'qc'. Some pp not applied when 'raw'.
%   auto        - logical, run pre-processing in batch mode.
%
% Outputs:
%   sample_data - the same data sets, with variables in engineering units added.
%
% Author:       Guillaume Galibert <guillaume.galibert@utas.edu.au>
%

%
% Copyright (C) 2017, Australian Ocean Data Network (AODN) and Integrated
% Marine Observing System (IMOS).
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation version 3 of the License.
%
% 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 General Public License for more details.

% You should have received a copy of the GNU General Public License
% along with this program.
% If not, see <https://www.gnu.org/licenses/gpl-3.0.en.html>.
%
narginchk(2, 3);

if ~iscell(sample_data), error('sample_data must be a cell array'); end
if isempty(sample_data), return;                                    end

% no modification of data is performed on the raw FV00 dataset except
% local time to UTC conversion
if strcmpi(qcLevel, 'raw'), return; end

% auto logical in input to enable running under batch processing
if nargin<3, auto=false; end

analogAquatracka = {'CHL', 'FTU', 'PAH', 'CDOM'};
imosAquatracka = {'CHLF', 'TURBF', 'CHR', 'CHC'};
commentsAquatracka = {['Artificial chlorophyll data '...
          'computed from bio-optical sensor raw counts measurements using factory calibration coefficient. The '...
          'fluorometre is equipped with a 430nm peak wavelength LED to irradiate and a '...
          'photodetector paired with an optical filter which measures everything '...
          'that fluoresces in the region of 685nm. '...
          'Originally expressed in ug/l, 1l = 0.001m3 was assumed.'], ...
          ['Turbidity data in FTU '...
          'computed from bio-optical sensor raw counts measurements using factory calibration coefficient. The '...
          'fluorometre is used as a nephelometre equipped with a 440nm peak wavelength LED to irradiate. '], ...
          '', ...
          ''};
nAquatracka = length(analogAquatracka);

voltLabel   = cell(1, nAquatracka);
scaleFactor = NaN(1, nAquatracka);
offset      = NaN(1, nAquatracka);

ParamFile = ['Preprocessing' filesep 'aquatrackaPP.txt'];
for i=1:nAquatracka
    voltLabel{i}    = readProperty(['volt' analogAquatracka{i}], ParamFile);
    scaleFactor(i)  = str2double(readProperty(['scaleFactor' analogAquatracka{i}], ParamFile));
    offset(i)       = str2double(readProperty(['offset' analogAquatracka{i}], ParamFile));
end

for k = 1:length(sample_data)
  for i=1:nAquatracka
      sam = sample_data{k};

      voltIdx     = getVar(sam.variables, ['volt_' voltLabel{i}]);

      % analog aquatracka output not present in data set
      if ~voltIdx, continue; end

      volt = sam.variables{voltIdx}.data;

      % Aquatracka formulae
      data = scaleFactor(i)*10.^(volt) + offset(i);

      dimensions = sam.variables{voltIdx}.dimensions;

      if isfield(sam.variables{voltIdx}, 'coordinates')
          coordinates = sam.variables{voltIdx}.coordinates;
      else
          coordinates = '';
      end

      % add data as new variable in data set
      sample_data{k} = addVar(...
          sam, ...
          imosAquatracka{i}, ...
          data, ...
          dimensions, ...
          commentsAquatracka{i}, ...
          coordinates);

      history = sample_data{k}.history;
      if isempty(history)
          sample_data{k}.history = sprintf('%s - %s', datestr(now_utc, readProperty('exportNetCDF.dateFormat')), commentsAquatracka{i});
      else
          sample_data{k}.history = sprintf('%s\n%s - %s', history, datestr(now_utc, readProperty('exportNetCDF.dateFormat')), commentsAquatracka{i});
      end

  end
end


text:
<!-- LIST CARD EXHIBITION -->
<div id="js-list-card-exhibition" class="list-card-exhibition">
	<button class="list-card-exhibition__button is-current" data-list-view="is-view-default" disabled>Ver em formato de cards</button>
	<button class="list-card-exhibition__button" data-list-view="is-view-list" >Ver em formato de lista</button>
</div>
<!-- END LIST CARD EXHIBITION -->


text:
layout: default
title: National Day of Civic Hacking
is_ndoch: true

---

Resources to Download

One Page Flyer

      <form method="get" action="NDoCH_onepager.pdf">
        <button type="submit" i class="fa fa-file-pdf-o"> Download!</button>
      </form>

Web Flyer

      <form method="get" action="NDoCH_webflyer_WhiteBackground.png">
        <button type="submit"  Download!</button>
      </form>

Logo

      <form method="get" action="NDoCH_Logo-02-02_WhiteBackground.png">
        <button type="submit"  Download!</button>
      </form>

Use the following information to help promote the event

Calling all passionate people who want to improve San Francisco. Attend SF's National Day of Civic Hacking, June 5 - 7 at Galvanize (downtown SF)! As part of a global event with thousands of people tackling local issues, this nontraditional hackathon will focus on developing civic and socially-oriented projects for the San Francisco Bay Area. All skills, interests, and people are welcome. Just be ready to collaborative and make a difference.

We invite you to join us: get tickets to attend, pitch a project, lead a national challenge, sponsor the event, or partner with us.

Facebook: Want to help improve SF? Have an idea for how? Attend SF's National Day of Civic Hacking (June 5-7). A nontraditional hackathon to tackle challenges, pitch a new projects, and meet other civically-oriented residents. #hackforchangeSF #civictech

Twitter: Join SF's National Day of Civic Hacking with @SFbrigade. Hack to improve SF! June 5-7 at @galvanize. #hackforchangeSF #civictech


text:
'use strict';

import State = require('./state');

interface StateMap {
  [ name: string ]: State
}

export = StateMap;


text:
<!doctype html>

        <link rel="stylesheet" href="../../css/anychart-ui.min.css" />

        <title>Stacked 3D Column Chart</title>


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:id="@+id/rl_activity_title"
                android:layout_width="fill_parent"
                android:layout_height="50dp"
                android:background="@color/ui_green">

    <ImageButton
        android:id="@+id/imgBtn_back"
        android:layout_width="40dp"
        android:layout_height="40dp"
        android:layout_centerVertical="true"
        android:background="@drawable/ic_back"
        />

    <TextView
        android:id="@+id/tv_title"
        android:layout_width="wrap_content"
        android:layout_height="30dp"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:ellipsize="end"
        android:gravity="center_vertical"
        android:maxEms="15"
        android:singleLine="true"
        android:textColor="@android:color/white"
        android:textSize="18sp"/>

</RelativeLayout>


text:
<?xml version="1.0" encoding="utf-8"?>

<ListView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@android:id/list"
    android:listSelector="#00000000"
    android:transcriptMode="normal" />


text:
layout: default
title: Welcome!
description: This is my site. Welcome.
keywords: github pages, Jekyll, foundation 5
---

Whoa! Jekyll, Foundation 5, HTML5 boilerplate and github pages!

Isn't that nuts!

I've combined my locally installed libsass/grunt version of foundation 5, html5 boilder plate, and Jekyll to be used for github pages! See Jekyll's documentation, the foundation documentations, and GitHub pages help pages.

You can see all
		 my sources here. I created this for my personal use, but if you'd like to use it, please feel free. Shout out daigo.org or @DaigoFuji are appreciated, but not required.

You should probably update the <samp>_config.yml</samp> file, and edit <samp>scss/_setting.scss</samp> file. As well as <samp>scss/_custom.scss</samp>, where most the overrides are happening.

foundation-example.html shows how all the html tags are rendered. Foundation takes care of those out of the box.

Another example are shown in foundation-example.html.

And finally, foundation's grid system, page-template-example You can also get more templates from foundations home.

And out of the box, this supports

		font awesome, so you can go crazy with the icons:

		.


text:
package com.github.dreamhead.moco;

import com.github.dreamhead.moco.internal.SessionContext;
import com.github.dreamhead.moco.util.Idles;
import com.google.common.collect.ImmutableMultimap;
import org.junit.Test;
import org.mockito.Mockito;

import java.nio.charset.Charset;
import java.util.concurrent.TimeUnit;

import static com.github.dreamhead.moco.Moco.and;
import static com.github.dreamhead.moco.Moco.async;
import static com.github.dreamhead.moco.Moco.by;
import static com.github.dreamhead.moco.Moco.complete;
import static com.github.dreamhead.moco.Moco.context;
import static com.github.dreamhead.moco.Moco.eq;
import static com.github.dreamhead.moco.Moco.file;
import static com.github.dreamhead.moco.Moco.fileRoot;
import static com.github.dreamhead.moco.Moco.get;
import static com.github.dreamhead.moco.Moco.header;
import static com.github.dreamhead.moco.Moco.httpServer;
import static com.github.dreamhead.moco.Moco.latency;
import static com.github.dreamhead.moco.Moco.pathResource;
import static com.github.dreamhead.moco.Moco.post;
import static com.github.dreamhead.moco.Moco.template;
import static com.github.dreamhead.moco.Moco.text;
import static com.github.dreamhead.moco.Moco.uri;
import static com.github.dreamhead.moco.Runner.running;
import static com.github.dreamhead.moco.helper.RemoteTestUtils.port;
import static com.github.dreamhead.moco.helper.RemoteTestUtils.remoteUrl;
import static com.github.dreamhead.moco.helper.RemoteTestUtils.root;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

public class MocoEventTest extends AbstractMocoHttpTest {
    @Test
    public void should_fire_event_on_complete() throws Exception {
        MocoEventAction action = mock(MocoEventAction.class);
        server.response("foo").on(complete(action));

        running(server, () -> assertThat(helper.get(root()), is("foo")));

        verify(action).execute(any(Request.class));
    }

    @Test
    public void should_not_fire_event_on_specific_request() throws Exception {
        MocoEventAction action = mock(MocoEventAction.class);
        server.request(by(uri("/event"))).response("event").on(complete(action));

        running(server, () -> assertThat(helper.get(remoteUrl("/event")), is("event")));

        verify(action).execute(any(Request.class));
    }

    @Test
    public void should_not_fire_event_on_other_request() throws Exception {
        MocoEventAction action = mock(MocoEventAction.class);
        server.request(by(uri("/noevent"))).response("noevent");
        server.request(by(uri("/event"))).response("foo").on(complete(action));

        running(server, () -> assertThat(helper.get(remoteUrl("/noevent")), is("noevent")));

        verify(action, Mockito.never()).execute(any(Request.class));
    }

    @Test
    public void should_send_get_request_to_target_on_complete() throws Exception {
        ResponseHandler handler = mock(ResponseHandler.class);
        server.request(by(uri("/target"))).response(handler);
        server.request(by(uri("/event"))).response("event").on(complete(get(remoteUrl("/target"))));

        running(server, () -> assertThat(helper.get(remoteUrl("/event")), is("event")));

        verify(handler).writeToResponse(any(SessionContext.class));
    }

    @Test
    public void should_send_get_request_with_text_url_and_header_to_target_on_complete_with_resource() throws Exception {
        ResponseHandler handler = mock(ResponseHandler.class);
        server.request(and(by(uri("/target")), eq(header("foo"), "bar"))).response(handler);
        server.request(by(uri("/event"))).response("event").on(complete(get(remoteUrl("/target"),
                header("foo", text("bar")))));

        running(server, () -> assertThat(helper.get(remoteUrl("/event")), is("event")));

        verify(handler).writeToResponse(any(SessionContext.class));
    }

    @Test
    public void should_send_get_request_to_target_on_complete_with_resource() throws Exception {
        ResponseHandler handler = mock(ResponseHandler.class);
        server.request(by(uri("/target"))).response(handler);
        server.request(by(uri("/event"))).response("event").on(complete(get(text(remoteUrl("/target")))));

        running(server, () -> assertThat(helper.get(remoteUrl("/event")), is("event")));

        verify(handler).writeToResponse(any(SessionContext.class));
    }

    @Test
    public void should_send_get_request_with_header_to_target_on_complete_with_resource() throws Exception {
        ResponseHandler handler = mock(ResponseHandler.class);
        server.request(and(by(uri("/target")), eq(header("foo"), "bar"))).response(handler);
        server.request(by(uri("/event"))).response("event").on(complete(get(text(remoteUrl("/target")),
                header("foo", text("bar")))));

        running(server, () -> assertThat(helper.get(remoteUrl("/event")), is("event")));

        verify(handler).writeToResponse(any(SessionContext.class));
    }

    @Test
    public void should_send_get_request_to_target_on_complete_with_template_fetching_var_from_request() throws Exception {
        ResponseHandler handler = mock(ResponseHandler.class);
        server.request(by(uri("/target"))).response(handler);
        server.request(by(uri("/event"))).response("event").on(complete(get(template("${base}/${req.headers['foo']}", "base", root()))));

        running(server, () -> assertThat(helper.getWithHeader(remoteUrl("/event"), ImmutableMultimap.of("foo", "target")), is("event")));

        verify(handler).writeToResponse(any(SessionContext.class));
    }

    @Test
    public void should_send_get_request_to_target_on_complete_with_path_resource() throws Exception {
        ResponseHandler handler = mock(ResponseHandler.class);
        server.request(by(uri("/target"))).response(handler);
        server.request(by(uri("/event"))).response("event").on(complete(get(pathResource("template.url"))));

        running(server, () -> assertThat(helper.get(remoteUrl("/event")), is("event")));

        verify(handler).writeToResponse(any(SessionContext.class));
    }

    @Test
    public void should_send_get_request_to_target_on_complete_with_template() throws Exception {
        ResponseHandler handler = mock(ResponseHandler.class);
        server.request(by(uri("/target"))).response(handler);
        server.request(by(uri("/event"))).response("event").on(complete(get(template("${var}", "var", remoteUrl("/target")))));

        running(server, () -> assertThat(helper.get(remoteUrl("/event")), is("event")));

        verify(handler).writeToResponse(any(SessionContext.class));
    }

    @Test
    public void should_send_post_request_to_target_on_complete_with_string() throws Exception {
        ResponseHandler handler = mock(ResponseHandler.class);
        server.request(and(by(uri("/target")), by("content"))).response(handler);
        server.request(by(uri("/event"))).response("event").on(complete(post(remoteUrl("/target"), "content")));

        running(server, () -> assertThat(helper.get(remoteUrl("/event")), is("event")));

        verify(handler).writeToResponse(any(SessionContext.class));
    }

    @Test
    public void should_send_post_request_to_target_on_complete_with_string_and_resource_url() throws Exception {
        ResponseHandler handler = mock(ResponseHandler.class);
        server.request(and(by(uri("/target")), by("content"))).response(handler);
        server.request(by(uri("/event"))).response("event").on(complete(post(text(remoteUrl("/target")), "content")));

        running(server, () -> assertThat(helper.get(remoteUrl("/event")), is("event")));

        verify(handler).writeToResponse(any(SessionContext.class));
    }

    @Test
    public void should_send_post_request_to_target_on_complete_with_path_resource_url() throws Exception {
        ResponseHandler handler = mock(ResponseHandler.class);
        server.request(by(uri("/target"))).response(handler);
        server.request(by(uri("/event"))).response("event").on(complete(post(pathResource("template.url"), "content")));

        running(server, () -> assertThat(helper.get(remoteUrl("/event")), is("event")));

        verify(handler).writeToResponse(any(SessionContext.class));
    }

    @Test
    public void should_send_post_request_to_target_on_complete_with_path_resource_content() throws Exception {
        ResponseHandler handler = mock(ResponseHandler.class);
        server.request(by(uri("/target"))).response(handler);
        server.request(by(uri("/event"))).response("event").on(complete(post(remoteUrl("/target"), pathResource("foo.request"))));

        running(server, () -> assertThat(helper.get(remoteUrl("/event")), is("event")));

        verify(handler).writeToResponse(any(SessionContext.class));
    }

    @Test
    public void should_send_post_request_to_target_on_complete() throws Exception {
        ResponseHandler handler = mock(ResponseHandler.class);
        server.request(and(by(uri("/target")), by("content"))).response(handler);
        server.request(by(uri("/event"))).response("event").on(complete(post(remoteUrl("/target"), text("content"))));

        running(server, () -> assertThat(helper.get(remoteUrl("/event")), is("event")));

        verify(handler).writeToResponse(any(SessionContext.class));
    }

    @Test
    public void should_send_post_request_with_header_to_target_on_complete() throws Exception {
        ResponseHandler handler = mock(ResponseHandler.class);
        server.request(and(by(uri("/target")), by("content"), eq(header("foo"), "bar"))).response(handler);
        server.request(by(uri("/event"))).response("event").on(complete(post(text(remoteUrl("/target")), text("content"), header("foo", text("bar")))));

        running(server, () -> assertThat(helper.get(remoteUrl("/event")), is("event")));

        verify(handler).writeToResponse(any(SessionContext.class));
    }

    @Test
    public void should_send_post_request_to_target_on_complete_with_template_content() throws Exception {
        ResponseHandler handler = mock(ResponseHandler.class);
        server.request(and(by(uri("/target")), by("content"))).response(handler);
        server.request(by(uri("/event"))).response("event").on(complete(post(remoteUrl("/target"), template("${req.headers['foo']}"))));

        running(server, () -> assertThat(helper.getWithHeader(remoteUrl("/event"), ImmutableMultimap.of("foo", "content")), is("event")));

        verify(handler).writeToResponse(any(SessionContext.class));
    }

    @Test
    public void should_send_post_request_to_target_on_complete_with_resource_url() throws Exception {
        ResponseHandler handler = mock(ResponseHandler.class);
        server.request(and(by(uri("/target")), by("content"))).response(handler);
        server.request(by(uri("/event"))).response("event").on(complete(post(text(remoteUrl("/target")), text("content"))));

        running(server, () -> assertThat(helper.get(remoteUrl("/event")), is("event")));

        verify(handler).writeToResponse(any(SessionContext.class));
    }

    @Test
    public void should_send_post_request_to_target_on_complete_asyc() throws Exception {
        final ResponseHandler handler = mock(ResponseHandler.class);
        server.request(and(by(uri("/target")), by("content"))).response(handler);
        server.request(by(uri("/event"))).response("event").on(complete(async(post(remoteUrl("/target"), text("content")))));

        running(server, () -> {
            assertThat(helper.get(remoteUrl("/event")), is("event"));
            verify(handler, never()).writeToResponse(any(SessionContext.class));
            Idles.idle(2, TimeUnit.SECONDS);
        });

        verify(handler).writeToResponse(any(SessionContext.class));
    }

    @Test
    public void should_send_post_request_to_target_on_complete_async_after_awhile() throws Exception {
        final ResponseHandler handler = mock(ResponseHandler.class);
        server.request(and(by(uri("/target")), by("content"))).response(handler);
        server.request(by(uri("/event"))).response("event").on(complete(async(post(remoteUrl("/target"), text("content")), latency(1, TimeUnit.SECONDS))));

        running(server, () -> {
            assertThat(helper.get(remoteUrl("/event")), is("event"));
            verify(handler, never()).writeToResponse(any(SessionContext.class));
            Idles.idle(2, TimeUnit.SECONDS);
        });

        verify(handler).writeToResponse(any(SessionContext.class));
    }

    @Test
    public void should_fire_event_for_context_configuration() throws Exception {
        MocoEventAction action = mock(MocoEventAction.class);
        when(action.apply(any(MocoConfig.class))).thenReturn(action);
        server = httpServer(port(), context("/context"));
        server.get(by(uri("/foo"))).response("foo").on(complete(action));

        running(server, () -> assertThat(helper.get(remoteUrl("/context/foo")), is("foo")));

        verify(action).execute(any(Request.class));
    }

    @Test
    public void should_send_post_request_with_file_root_configuration() throws Exception {
        ResponseHandler handler = mock(ResponseHandler.class);
        when(handler.apply(any(MocoConfig.class))).thenReturn(handler);

        server = httpServer(port(), fileRoot("src/test/resources"));
        server.request(by(uri("/target")), by(file("foo.request"))).response(handler);
        server.request(by(uri("/event"))).response("event").on(complete(post(remoteUrl("/target"), file("foo.request"))));

        running(server, () -> assertThat(helper.get(remoteUrl("/event")), is("event")));

        verify(handler).writeToResponse(any(SessionContext.class));
    }

    @Test
    public void should_send_post_request_to_target_on_complete_with_gbk() throws Exception {
        ResponseHandler handler = mock(ResponseHandler.class);
        final Charset gbk = Charset.forName("GBK");
        server.request(and(by(uri("/target")), by(pathResource("gbk.json", gbk)))).response(handler);
        server.request(by(uri("/event"))).response("event").on(complete(post(text(remoteUrl("/target")), pathResource("gbk.json", gbk))));

        running(server, () -> assertThat(helper.get(remoteUrl("/event")), is("event")));

        verify(handler).writeToResponse(any(SessionContext.class));
    }
}