text:
package com.francetelecom.clara.cloud.providersoap.administration.v4.service;

import com.francetelecom.clara.cloud.core.service.ManageApplication;
import com.francetelecom.clara.cloud.core.service.ManageApplicationRelease;
import com.francetelecom.clara.cloud.core.service.exception.*;
import com.francetelecom.clara.cloud.coremodel.Application;
import com.francetelecom.clara.cloud.coremodel.ApplicationRelease;
import com.francetelecom.clara.cloud.coremodel.SSOId;
import com.francetelecom.clara.cloud.providersoap.mapping.SoapMapper;
import com.francetelecom.clara.cloud.services.dto.ApplicationDTO;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import com.orange.clara.cloud.providersoap.administration.v4.exception.*;
import com.orange.clara.cloud.providersoap.administration.v4.model.*;
import com.orange.clara.cloud.providersoap.administration.v4.service.*;
import com.orange.clara.cloud.providersoap.security.v1.Credentials;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.Assert;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

@javax.jws.WebService(serviceName = "PaasAdministrationService", portName = "PaasAdministrationServicePort", targetNamespace = "http://www.orange.com/paas/administration/v4/PaasAdministrationService", endpointInterface = "com.orange.clara.cloud.providersoap.administration.v4.service.PaasAdministrationService")
@org.apache.cxf.annotations.SchemaValidation
public class PaasAdministrationServiceImpl implements PaasAdministrationService {

	private static final Logger LOG = LoggerFactory.getLogger(PaasAdministrationServiceImpl.class);

	private ManageApplication manageApplication;
	private ManageApplicationRelease manageApplicationRelease;

	private SoapMapper mapper;

	/**
	 * Create an application.
	 *
	 * @param command
	 *
	 * @param credentials
	 *            user credentials
	 *
	 * @throws DuplicateApplicationErrorFault
	 *             when application already exists
	 * @throws PaasUserNotFoundErrorFault
	 *             when no paas user matches specified user id
	 */
	@Override
	public String createApplication(CreateApplicationCommand command, Credentials credentials) throws PaasUserNotFoundErrorFault,
			DuplicateApplicationErrorFault {
		try {
			Assert.notNull(credentials, "no credentials provided");
			Assert.notNull(command, "no command provided");

			String label = command.getLabel();
			String code = command.getCode();
			String description = command.getDescription();
			String registryUrl = command.getRegistryUrl();
			Boolean isPublic = command.isIsPublic();

			// boolean isPublicApplication = isPublic != null ? isPublic : true;
			boolean isPublicApplication = isPublic == null ? true : isPublic;
			SSOId ssoid = new SSOId(credentials.getSsoid());
			if (isPublicApplication) {
				return manageApplication.createPublicApplication(code, label, description, registryUrl == null ? null : new URL(registryUrl), ssoid);
			} else {
				return manageApplication.createPrivateApplication(code, label, description, registryUrl == null ? null : new URL(registryUrl), ssoid);
			}
			// returns application generated uid
		} catch (DuplicateApplicationException e) {
			LOG.warn("exception : " + e);
			throw (DuplicateApplicationErrorFault) mapper.map(e, DuplicateApplicationErrorFault.class, DuplicateApplicationError.class);
		} catch (MalformedURLException e) {
			LOG.warn("exception : " + e);
			throw new IllegalArgumentException(e);
		} catch (PaasUserNotFoundException e) {
			LOG.error("exception : " + e);
			throw (PaasUserNotFoundErrorFault) mapper.map(e, PaasUserNotFoundErrorFault.class, PaasUserNotFoundError.class);
		}
	}

	/**
	 * Get all middleware profiles.
	 *
	 * @param credentials
	 *            user credentials
	 * @return List of all middleware profiles available on this platform
	 */
	@Override
	public List<MiddlewareProfile> getAllMiddlewareProfiles(Credentials credentials) {
		List<com.francetelecom.clara.cloud.coremodel.MiddlewareProfile> findAllMiddlewareProfil = manageApplicationRelease.findAllMiddlewareProfil();
		return Lists.transform(findAllMiddlewareProfil, new Function<com.francetelecom.clara.cloud.coremodel.MiddlewareProfile, MiddlewareProfile>() {
			public MiddlewareProfile apply(com.francetelecom.clara.cloud.coremodel.MiddlewareProfile profile) {
				return mapper.map(profile, MiddlewareProfile.class);
			}
		});
	}

	/**
	 * Get all applications.
	 *
	 * @param credentials
	 *            user credentials
	 * @return List of all applications
	 */
	@Override
	public List<ApplicationModel> getAllApplications(Credentials credentials) {
		// we want to get a collection of applications
		Collection<Application> applications = manageApplication.findApplications();

		List<ApplicationModel> target = new ArrayList<ApplicationModel>();

		if (applications != null) {
			for (Application application : applications) {
				target.add(mapper.map(application, ApplicationModel.class));
			}
		}

		// returns applications
		return target;
	}

	/**
	 * Create a release specifyng a middlewareprofileversion.
	 *
	 * @param command
	 *
	 * @param credentials
	 *            user credentials
	 * @return release uid
	 *
	 * @exception DuplicateReleaseErrorFault
	 *                when release already exists
	 * @exception ApplicationNotFoundErrorFault
	 *                when application does not exist
	 * @exception PaasUserNotFoundErrorFault
	 *                when paas user does not exist
	 *
	 * @see MiddlewareProfile
	 */
	@Override
	public String createRelease(CreateReleaseCommand command, Credentials credentials) throws DuplicateReleaseErrorFault, ApplicationNotFoundErrorFault,
			PaasUserNotFoundErrorFault {

		Assert.notNull(credentials, "no credentials provided");
		Assert.notNull(command, "no command provided");

		String version = command.getVersion();
		String applicationUID = command.getApplicationUID();
		String description = command.getDescription();
		String versionControlUrl = command.getVersionControlUrl();
		String profileVersion = command.getProfileVersion();

		try {
			URL url = null;
			if (versionControlUrl != null) {
				url = new URL(versionControlUrl);
			}

			// Creates and persists release
			return manageApplicationRelease.createApplicationRelease(applicationUID, credentials.getSsoid(), version, description, url, profileVersion);
		} catch (PaasUserNotFoundException e) {
			LOG.warn("exception : " + e);
			throw (PaasUserNotFoundErrorFault) mapper.map(e, PaasUserNotFoundErrorFault.class, PaasUserNotFoundError.class);
		} catch (ApplicationNotFoundException e) {
			LOG.warn("exception : " + e);
			throw (ApplicationNotFoundErrorFault) mapper.map(e, ApplicationNotFoundErrorFault.class, ApplicationNotFoundError.class);
		} catch (DuplicateApplicationReleaseException e) {
			LOG.warn("exception : " + e);
			throw (DuplicateReleaseErrorFault) mapper.map(e, DuplicateReleaseErrorFault.class, DuplicateReleaseError.class);
		} catch (MalformedURLException e) {
			throw new IllegalArgumentException(e);
		}
	}

	/**
	 * Find application release uid for a given application and release version
	 *
	 * @param applicationUID
	 *            application uid
	 * @param releaseVersion
	 *            release version
	 * @param credentials
	 *            user credentials
	 * @return application release uid
	 *
	 * @exception ReleaseNotFoundErrorFault
	 *                when release does not exist
	 */
	@Override
	public String findApplicationReleaseByApplicationUIDAndVersion(String applicationUID, String releaseVersion, Credentials credentials)
			throws ReleaseNotFoundErrorFault {
		try {
			// application uid must be provided
			Assert.hasText(applicationUID, "application uid must not be empty");
			// release version must be provided
			Assert.hasText(releaseVersion, "release version must not be empty");
			// we want to get application release
			ApplicationRelease source = manageApplicationRelease.findApplicationReleaseByApplicationAndReleaseVersion(applicationUID, releaseVersion);
			return source.getUID();
		} catch (ApplicationReleaseNotFoundException e) {
			LOG.warn("exception : " + e);
			throw (ReleaseNotFoundErrorFault) mapper.map(e, ReleaseNotFoundErrorFault.class, ReleaseNotFoundError.class);
		}
	}

	/**
	 * Get the details of a given ApplicationRelease
	 *
	 * @param uid
	 *            release uid
	 * @param credentials
	 *            user credentials
	 * @return An application release
	 * @exception ReleaseNotFoundErrorFault
	 *                when release does not exist
	 */
	@Override
	public ReleaseModel getApplicationRelease(String uid, Credentials credentials) throws ReleaseNotFoundErrorFault {
		try {
			// the uid of the release must be provided
			Assert.hasText(uid, "the uid of the release must not be empty");
			// we want to get an applicationRelease
			ApplicationRelease source = manageApplicationRelease.findApplicationReleaseByUID(uid);
			// returns the given release
			return mapper.map(source, ReleaseModel.class);
		} catch (ApplicationReleaseNotFoundException e) {
			LOG.warn("exception : " + e);
			throw (ReleaseNotFoundErrorFault) mapper.map(e, ReleaseNotFoundErrorFault.class, ReleaseNotFoundError.class);
		}
	}

	@Override
	public List<ReleaseModel> getApplicationReleasesByApplicationUID(String applicationUID, Credentials credentials) throws ApplicationNotFoundErrorFault {
		try {
			// find releases for a given application
			List<ApplicationRelease> releases = manageApplicationRelease.findApplicationReleasesByAppUID(applicationUID);
			List<ReleaseModel> target = new ArrayList<ReleaseModel>();
			// map releases (from core model) to releases (SOAP)
			for (ApplicationRelease release : releases) {
				target.add(mapper.map(release, ReleaseModel.class));
			}
			// returns releases
			return target;

		} catch (ObjectNotFoundException e) {
			LOG.warn("exception : " + e);
			throw (ApplicationNotFoundErrorFault) mapper.map(e, ApplicationNotFoundErrorFault.class, ApplicationNotFoundError.class);
		}

	}

	@Override
	public void deleteApplicationRelease(String uid, Credentials header) throws ReleaseNotFoundErrorFault {
		try {
			manageApplicationRelease.deleteApplicationRelease(uid);
		} catch (ApplicationReleaseNotFoundException e) {
			LOG.warn("exception : " + e);
			throw (ReleaseNotFoundErrorFault) mapper.map(e, ReleaseNotFoundErrorFault.class, ReleaseNotFoundError.class);
		}
	}

	/**
	 * Find an application uid by label.
	 *
	 * @param label
	 *            application label
	 * @param credentials
	 *            user credentials
	 * @return application uid
	 * @throws ApplicationNotFoundErrorFault
	 *             when application does not exist
	 */
	@Override
	public String findApplicationByLabel(String label, Credentials credentials) throws ApplicationNotFoundErrorFault {
		try {
			// we want to get application by its label
			ApplicationDTO source = manageApplication.findApplicationByLabel(label);
			// returns the uid of the application
			return source.getUid();
		} catch (ApplicationNotFoundException e) {
			LOG.warn("exception : " + e);
			throw (ApplicationNotFoundErrorFault) mapper.map(e, ApplicationNotFoundErrorFault.class, ApplicationNotFoundError.class);
		}
	}

	public void setManageApplication(ManageApplication manageApplication) {
		if (manageApplication == null)
			throw new IllegalArgumentException("Cannot create PaasAdministrationServiceImpl. manageApplication is required.");
		this.manageApplication = manageApplication;
	}

	public void setManageApplicationRelease(ManageApplicationRelease manageApplicationRelease) {
		if (manageApplicationRelease == null)
			throw new IllegalArgumentException("Cannot create PaasAdministrationServiceImpl. manageApplicationRelease is required.");
		this.manageApplicationRelease = manageApplicationRelease;
	}

	public void setMapper(SoapMapper mapper) {
		if (mapper == null)
			throw new IllegalArgumentException("Cannot create PaasAdministrationServiceImpl. mapper is required.");
		this.mapper = mapper;
	}

	@Override
	public void deleteApplication(String uid, Credentials header) throws ApplicationNotFoundErrorFault {
		try {
			manageApplication.deleteApplication(uid);
		} catch (ApplicationNotFoundException e) {
			LOG.warn("exception : " + e);
			throw (ApplicationNotFoundErrorFault) mapper.map(e, ApplicationNotFoundErrorFault.class, ApplicationNotFoundError.class);
		}

	}

}


text:
package api

type TestHealthCheck struct {
	S string
}

func (n TestHealthCheck) GetName() string {
	return "test"
}

func (n TestHealthCheck) GetHealth() map[string]interface{} {
	return map[string]interface{}{
		"status": "success",
	}
}

redpajama_set_name: RedPajamaGithub


text:
SqlMembershipProviderPasswordService Class
==========================================
A [PasswordService][1] that reuses the password encryption implementations provided by [SqlMembershipProvider][2].

Inheritance Hierarchy
---------------------
[System.Object][3]
  [MvcAccount.PasswordService][1]
    **MvcAccount.Web.Security.SqlMembershipProviderPasswordService**

**Namespace:** [MvcAccount.Web.Security][4]
**Assembly:** MvcAccount (in MvcAccount.dll)

Syntax
------

```csharp
public class SqlMembershipProviderPasswordService : PasswordService
```

The **SqlMembershipProviderPasswordService** type exposes the following members.

Constructors
------------

                 | Name                                      | Description
---------------- | ----------------------------------------- | ----------------------------------------------------------------------------------------------
![Public method] | [SqlMembershipProviderPasswordService][5] | Initializes a new **SqlMembershipProviderPasswordService** using the provided password format.

Methods
-------

                 | Name                           | Description
---------------- | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
![Public method] | [PasswordEquals][6]            | Compares a password provided by a user to one that is stored. (Overrides [PasswordService.PasswordEquals(String, String)][7].)
![Public method] | [ProcessPasswordForStorage][8] | Converts the *clearTextPassword* to one that is suitable for storage. (Overrides [PasswordService.ProcessPasswordForStorage(String)][9].)
![Public method] | [ValidatePassword][10]         | Validates a new password provided by a user. This method can be used to check if the new password has the length required by the encryption method. Returns null by default, which means all passwords are valid. (Inherited from [PasswordService][1].)

See Also
--------

#### Reference
[MvcAccount.Web.Security Namespace][4]

[1]: ../../MvcAccount/PasswordService/README.md
[2]: http://msdn.microsoft.com/en-us/library/89hwy0w9
[3]: http://msdn.microsoft.com/en-us/library/e5kfa45b
[4]: ../README.md
[5]: _ctor.md
[6]: PasswordEquals.md
[7]: ../../MvcAccount/PasswordService/PasswordEquals.md
[8]: ProcessPasswordForStorage.md
[9]: ../../MvcAccount/PasswordService/ProcessPasswordForStorage.md
[10]: ../../MvcAccount/PasswordService/ValidatePassword.md
[Public method]: ../../_icons/pubmethod.gif "Public method"


text:
<?php

// No direct access.
defined('_HZEXEC_') or die();

Html::behavior('tooltip');
Html::behavior('multiselect');

$canDo = \Components\Resources\Helpers\Permissions::getActions('plugin');

Toolbar::title(Lang::txt('COM_RESOURCES') . ': ' . Lang::txt('COM_RESOURCES_PLUGINS'), 'plugin.png');
if ($canDo->get('core.edit.state'))
{
	Toolbar::publishList();
	Toolbar::unpublishList();
}

include_once Component::path('com_plugins') . '/helpers/plugins.php';

$listOrder = $this->escape($this->filters['sort']);
$listDirn  = $this->escape($this->filters['sort_Dir']);
$canOrder  = User::authorise('core.edit.state', 'com_plugins');
$saveOrder = $listOrder == 'ordering';
?>
<form action="<?php echo Route::url('index.php?option=' . $this->option . '&controller=' . $this->controller); ?>" method="post" name="adminForm" id="adminForm">
	<fieldset id="filter-bar">

			<?php echo Lang::txt('JSEARCH_FILTER_LABEL'); ?>
			<input type="text" name="filter_search" id="filter_search" class="filter" value="<?php echo $this->escape($this->filters['search']); ?>" placeholder="<?php echo Lang::txt('JSEARCH_FILTER_SUBMIT'); ?>" />
			<button type="submit"><?php echo Lang::txt('JSEARCH_FILTER_SUBMIT'); ?></button>
			<button type="button" class="filter-clear"><?php echo Lang::txt('JSEARCH_FILTER_CLEAR'); ?></button>

			<select name="filter_state" class="inputbox filter filter-submit">
				<option value=""><?php echo Lang::txt('JOPTION_SELECT_PUBLISHED');?></option>
				<?php echo Html::select('options', Components\Plugins\Helpers\Plugins::stateOptions(), 'value', 'text', $this->filters['state'], true);?>
			</select>

			<select name="filter_access" class="inputbox filter filter-submit">
				<option value=""><?php echo Lang::txt('JOPTION_SELECT_ACCESS');?></option>
				<?php echo Html::select('options', Html::access('assetgroups'), 'value', 'text', $this->filters['access']); ?>
			</select>

	</fieldset>

					<input type="checkbox" name="checkall-toggle" value="" title="<?php echo Lang::txt('JGLOBAL_CHECK_ALL'); ?>" class="checkbox-toggle toggle-all" />

					<?php echo Html::grid('sort', 'Plug-in Name', 'name', $listDirn, $listOrder); ?>

					<?php echo Html::grid('sort', 'JSTATUS', 'enabled', $listDirn, $listOrder); ?>

					<?php echo Html::grid('sort', 'JGRID_HEADING_ORDERING', 'ordering', $listDirn, $listOrder); ?>
					<?php if ($canOrder && $saveOrder) :?>
						<?php echo Html::grid('order', $this->items, 'filesave.png', 'plugins.saveorder'); ?>
					<?php endif; ?>

					<?php echo Lang::txt('Manage'); ?>

					<?php echo Html::grid('sort', 'Element', 'element', $listDirn, $listOrder); ?>

					<?php echo Html::grid('sort', 'JGRID_HEADING_ACCESS', 'access', $listDirn, $listOrder); ?>

					<?php echo Html::grid('sort', 'JGRID_HEADING_ID', 'extension_id', $listDirn, $listOrder); ?>

					<?php echo $this->items->pagination; ?>

			<?php
			$i = 0;
			$folders = $this->items->fieldsByKey('folder');
			foreach ($this->items as $item) :

				$item->loadLanguage(true);

				$ordering   = ($listOrder == 'ordering');
				$canEdit    = User::authorise('core.edit', 'com_plugins');
				$canCheckin = User::authorise('core.manage', 'com_checkin') || $item->checked_out==User::get('id') || $item->checked_out==0;
				$canChange  = User::authorise('core.edit.state', 'com_plugins') && $canCheckin;
				?>
				<tr class="row<?php echo $i % 2; ?>">

						<?php echo Html::grid('id', $i, $item->extension_id); ?>

						<?php if ($item->checked_out) : ?>
							<?php echo Html::grid('checkedout', $i, $item->editor, $item->checked_out_time, '', $canCheckin); ?>
						<?php endif; ?>
						<?php if ($canEdit) : ?>
							<a href="<?php echo Route::url('index.php?option=com_plugins&task=edit&id=' . (int) $item->extension_id . '&' . Session::getFormToken() . '=1'); ?>">
								<?php echo Lang::txt($item->name); ?>

						<?php else : ?>
							<?php echo Lang::txt($item->name); ?>
						<?php endif; ?>

						<?php echo Html::grid('published', $item->enabled, $i, '', $canChange); ?>

						<?php if ($canChange) : ?>
							<?php if ($saveOrder) :?>
								<?php if ($listDirn == 'asc') : ?>
									<?php echo $this->items->pagination->orderUpIcon($i, (@$folders[$i-1] == $item->folder), 'orderup', 'JLIB_HTML_MOVE_UP', $ordering); ?>
									<?php echo $this->items->pagination->orderDownIcon($i, $this->items->pagination->total, (@$folders[$i+1] == $item->folder), 'orderdown', 'JLIB_HTML_MOVE_DOWN', $ordering); ?>
								<?php elseif ($listDirn == 'desc') : ?>
									<?php echo $this->items->pagination->orderUpIcon($i, (@$folders[$i-1] == $item->folder), 'orderdown', 'JLIB_HTML_MOVE_UP', $ordering); ?>
									<?php echo $this->items->pagination->orderDownIcon($i, $this->items->pagination->total, (@$folders[$i+1] == $item->folder), 'orderup', 'JLIB_HTML_MOVE_DOWN', $ordering); ?>
								<?php endif; ?>
							<?php endif; ?>
							<?php $disabled = $saveOrder ? '' : 'disabled="disabled"'; ?>
							<input type="text" name="order[]" size="5" value="<?php echo $item->ordering; ?>" <?php echo $disabled ?> class="text-area-order" />
						<?php else : ?>
							<?php echo $item->ordering; ?>
						<?php endif; ?>

						<?php if (in_array($item->element, $this->manage)) { ?>
							<a href="<?php echo Route::url('index.php?option=' . $this->option . '&controller=' . $this->controller . '&task=manage&plugin=' . $item->element); ?>">
								<?php echo Lang::txt('Manage'); ?>

						<?php } ?>

						<?php echo $this->escape($item->element); ?>

						<?php echo $this->escape($item->access_level); ?>

						<?php echo (int) $item->extension_id; ?>

				<?php
				$i++;
			endforeach;
			?>

	<input type="hidden" name="option" value="<?php echo $this->option; ?>" />
	<input type="hidden" name="controller" value="<?php echo $this->controller; ?>" />
	<input type="hidden" name="task" value="" autocomplete="off" />
	<input type="hidden" name="boxchecked" value="0" />
	<input type="hidden" name="filter_order" value="<?php echo $this->escape($this->filters['sort']); ?>" />
	<input type="hidden" name="filter_order_Dir" value="<?php echo $this->escape($this->filters['sort_Dir']); ?>" />

	<?php echo Html::input('token'); ?>
</form>


text:
namespace Js
{
    SIMDValue SIMDFloat64x2Operation::OpFloat64x2(double x, double y)
    {
        X86SIMDValue x86Result;

        // Sets the lower double-precision, floating-point value to x
        // and sets the upper double-precision, floating-point value to y.
        x86Result.m128d_value = _mm_set_pd(y, x);

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpFloat64x2(const SIMDValue& v)
    {
        X86SIMDValue x86Result;

        // Sets the lower double-precision, floating-point value to x
        // and sets the upper double-precision, floating-point value to y.
        x86Result.m128d_value = _mm_set_pd(v.f64[SIMD_Y], v.f64[SIMD_X]);

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpZero()
    {
        X86SIMDValue x86Result;
        // Sets the 2 double-precision, floating-point values to zero
        x86Result.m128d_value = _mm_setzero_pd();

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpSplat(double x)
    {
        X86SIMDValue x86Result;
        // Sets the 2 double-precision, floating-point values to x
        x86Result.m128d_value = _mm_set1_pd(x);

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpSplat(const SIMDValue& v)
    {
        X86SIMDValue x86Result;
        // Sets the 2 double-precision, floating-point values to v.f64[SIMD_X]
        x86Result.m128d_value = _mm_set1_pd(v.f64[SIMD_X]);

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    // Conversions
    SIMDValue SIMDFloat64x2Operation::OpFromFloat32x4(const SIMDValue& value)
    {
        X86SIMDValue x86Result;
        X86SIMDValue v = X86SIMDValue::ToX86SIMDValue(value);

        // Converts the lower 2 single-precision, floating-point values
        // to two double-precision, floating-point values
        x86Result.m128d_value = _mm_cvtps_pd(v.m128_value);

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpFromInt32x4(const SIMDValue& value)
    {
        X86SIMDValue x86Result;
        X86SIMDValue v = X86SIMDValue::ToX86SIMDValue(value);

        // Converts the lower 2 signed 32-bit integer values of
        // to double-precision, floating-point values
        x86Result.m128d_value = _mm_cvtepi32_pd(v.m128i_value);

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpFromFloat32x4Bits(const SIMDValue& value)
    {
        X86SIMDValue x86Result;
        X86SIMDValue v = X86SIMDValue::ToX86SIMDValue(value);

        _mm_store_ps(x86Result.simdValue.f32, v.m128_value);

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpFromInt32x4Bits(const SIMDValue& value)
    {
        return OpFromFloat32x4Bits(value);
    }

    // Unary Ops
    SIMDValue SIMDFloat64x2Operation::OpAbs(const SIMDValue& value)
    {
        X86SIMDValue x86Result, SIGNMASK;
        X86SIMDValue v = X86SIMDValue::ToX86SIMDValue(value);

        SIGNMASK.m128d_value = _mm_castsi128_pd(_mm_set_epi32(0x7fffffff, 0xffffffff, 0x7fffffff, 0xffffffff));
        x86Result.m128d_value = _mm_and_pd(v.m128d_value, SIGNMASK.m128d_value); // v & SIGNMASK

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpNeg(const SIMDValue& value)
    {
        X86SIMDValue x86Result;

        X86SIMDValue SIGNMASK;
        X86SIMDValue v = X86SIMDValue::ToX86SIMDValue(value);

        SIGNMASK.m128d_value = _mm_castsi128_pd(_mm_set_epi32(0x80000000, 0x0, 0x80000000, 0x0));
        x86Result.m128d_value = _mm_xor_pd(v.m128d_value, SIGNMASK.m128d_value); // v ^ mask

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpNot(const SIMDValue& value)
    {
        X86SIMDValue x86Result;

        X86SIMDValue negativeOnes = { { -1, -1, -1, -1 } };
        X86SIMDValue v = X86SIMDValue::ToX86SIMDValue(value);

        x86Result.m128d_value = _mm_xor_pd(v.m128d_value, negativeOnes.m128d_value); // v ^ -1

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpReciprocal(const SIMDValue& value)
    {
        X86SIMDValue x86Result;

        X86SIMDValue doubleOnes;
        X86SIMDValue v = X86SIMDValue::ToX86SIMDValue(value);

        doubleOnes.m128d_value = _mm_set_pd(1.0, 1.0);
        x86Result.m128d_value = _mm_div_pd(doubleOnes.m128d_value, v.m128d_value); // result = 1.0/value

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpReciprocalSqrt(const SIMDValue& value)
    {
        X86SIMDValue x86Result;

        X86SIMDValue doubleOnes, temp;
        X86SIMDValue v = X86SIMDValue::ToX86SIMDValue(value);

        doubleOnes.m128d_value = _mm_set_pd(1.0, 1.0);
        temp.m128d_value = _mm_div_pd(doubleOnes.m128d_value, v.m128d_value); // temp = 1.0/value
        x86Result.m128d_value = _mm_sqrt_pd(temp.m128d_value); // result = sqrt(1.0/value)

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpSqrt(const SIMDValue& value)
    {
        X86SIMDValue x86Result;

        X86SIMDValue v = X86SIMDValue::ToX86SIMDValue(value);

        x86Result.m128d_value = _mm_sqrt_pd(v.m128d_value); // result = sqrt(value)

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    // Binary Ops
    SIMDValue SIMDFloat64x2Operation::OpAdd(const SIMDValue& aValue, const SIMDValue& bValue)
    {
        X86SIMDValue x86Result;
        X86SIMDValue tmpaValue = X86SIMDValue::ToX86SIMDValue(aValue);
        X86SIMDValue tmpbValue = X86SIMDValue::ToX86SIMDValue(bValue);

        x86Result.m128d_value = _mm_add_pd(tmpaValue.m128d_value, tmpbValue.m128d_value); // a + b

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpSub(const SIMDValue& aValue, const SIMDValue& bValue)
    {
        X86SIMDValue x86Result;
        X86SIMDValue tmpaValue = X86SIMDValue::ToX86SIMDValue(aValue);
        X86SIMDValue tmpbValue = X86SIMDValue::ToX86SIMDValue(bValue);

        x86Result.m128d_value = _mm_sub_pd(tmpaValue.m128d_value, tmpbValue.m128d_value);  // a - b

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpMul(const SIMDValue& aValue, const SIMDValue& bValue)
    {
        X86SIMDValue x86Result;
        X86SIMDValue tmpaValue = X86SIMDValue::ToX86SIMDValue(aValue);
        X86SIMDValue tmpbValue = X86SIMDValue::ToX86SIMDValue(bValue);

        x86Result.m128d_value = _mm_mul_pd(tmpaValue.m128d_value, tmpbValue.m128d_value); // a * b

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpDiv(const SIMDValue& aValue, const SIMDValue& bValue)
    {
        X86SIMDValue x86Result;
        X86SIMDValue tmpaValue = X86SIMDValue::ToX86SIMDValue(aValue);
        X86SIMDValue tmpbValue = X86SIMDValue::ToX86SIMDValue(bValue);

        x86Result.m128d_value = _mm_div_pd(tmpaValue.m128d_value, tmpbValue.m128d_value); // a / b

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpAnd(const SIMDValue& aValue, const SIMDValue& bValue)
    {
        X86SIMDValue x86Result;
        X86SIMDValue tmpaValue = X86SIMDValue::ToX86SIMDValue(aValue);
        X86SIMDValue tmpbValue = X86SIMDValue::ToX86SIMDValue(bValue);

        x86Result.m128d_value = _mm_and_pd(tmpaValue.m128d_value, tmpbValue.m128d_value); // a & b

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpOr(const SIMDValue& aValue, const SIMDValue& bValue)
    {
        X86SIMDValue x86Result;
        X86SIMDValue tmpaValue = X86SIMDValue::ToX86SIMDValue(aValue);
        X86SIMDValue tmpbValue = X86SIMDValue::ToX86SIMDValue(bValue);

        x86Result.m128d_value = _mm_or_pd(tmpaValue.m128d_value, tmpbValue.m128d_value); // a | b

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpXor(const SIMDValue& aValue, const SIMDValue& bValue)
    {
        X86SIMDValue x86Result;
        X86SIMDValue tmpaValue = X86SIMDValue::ToX86SIMDValue(aValue);
        X86SIMDValue tmpbValue = X86SIMDValue::ToX86SIMDValue(bValue);

        x86Result.m128d_value = _mm_xor_pd(tmpaValue.m128d_value, tmpbValue.m128d_value); // a ^ b

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpMin(const SIMDValue& aValue, const SIMDValue& bValue)
    {
        X86SIMDValue x86Result;
        X86SIMDValue tmpaValue = X86SIMDValue::ToX86SIMDValue(aValue);
        X86SIMDValue tmpbValue = X86SIMDValue::ToX86SIMDValue(bValue);

        // choose the smaller value of the two parameters a and b
        x86Result.m128d_value = _mm_min_pd(tmpaValue.m128d_value, tmpbValue.m128d_value);

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpMax(const SIMDValue& aValue, const SIMDValue& bValue)
    {
        X86SIMDValue x86Result;
        X86SIMDValue tmpaValue = X86SIMDValue::ToX86SIMDValue(aValue);
        X86SIMDValue tmpbValue = X86SIMDValue::ToX86SIMDValue(bValue);

        // choose the larger value of the two parameters a and b
        x86Result.m128d_value = _mm_max_pd(tmpaValue.m128d_value, tmpbValue.m128d_value);

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpScale(const SIMDValue& Value, double scaleValue)
    {
        X86SIMDValue x86Result;
        X86SIMDValue v = X86SIMDValue::ToX86SIMDValue(Value);

        X86SIMDValue scaleVector;
        scaleVector.m128d_value = _mm_set1_pd(scaleValue);
        x86Result.m128d_value = _mm_mul_pd(v.m128d_value, scaleVector.m128d_value); // v * scale

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpLessThan(const SIMDValue& aValue, const SIMDValue& bValue)
    {
        X86SIMDValue x86Result;
        X86SIMDValue tmpaValue = X86SIMDValue::ToX86SIMDValue(aValue);
        X86SIMDValue tmpbValue = X86SIMDValue::ToX86SIMDValue(bValue);
        x86Result.m128d_value = _mm_cmplt_pd(tmpaValue.m128d_value, tmpbValue.m128d_value); // a < b?

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpLessThanOrEqual(const SIMDValue& aValue, const SIMDValue& bValue)
    {
        X86SIMDValue x86Result;
        X86SIMDValue tmpaValue = X86SIMDValue::ToX86SIMDValue(aValue);
        X86SIMDValue tmpbValue = X86SIMDValue::ToX86SIMDValue(bValue);
        x86Result.m128d_value = _mm_cmple_pd(tmpaValue.m128d_value, tmpbValue.m128d_value); // a <= b?

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpEqual(const SIMDValue& aValue, const SIMDValue& bValue)
    {
        X86SIMDValue x86Result;
        X86SIMDValue tmpaValue = X86SIMDValue::ToX86SIMDValue(aValue);
        X86SIMDValue tmpbValue = X86SIMDValue::ToX86SIMDValue(bValue);
        x86Result.m128d_value = _mm_cmpeq_pd(tmpaValue.m128d_value, tmpbValue.m128d_value); // a == b?

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpNotEqual(const SIMDValue& aValue, const SIMDValue& bValue)
    {
        X86SIMDValue x86Result;
        X86SIMDValue tmpaValue = X86SIMDValue::ToX86SIMDValue(aValue);
        X86SIMDValue tmpbValue = X86SIMDValue::ToX86SIMDValue(bValue);
        x86Result.m128d_value = _mm_cmpneq_pd(tmpaValue.m128d_value, tmpbValue.m128d_value); // a != b?

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpGreaterThan(const SIMDValue& aValue, const SIMDValue& bValue)
    {
        X86SIMDValue x86Result;
        X86SIMDValue tmpaValue = X86SIMDValue::ToX86SIMDValue(aValue);
        X86SIMDValue tmpbValue = X86SIMDValue::ToX86SIMDValue(bValue);
        x86Result.m128d_value = _mm_cmpgt_pd(tmpaValue.m128d_value, tmpbValue.m128d_value); // a > b?

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpGreaterThanOrEqual(const SIMDValue& aValue, const SIMDValue& bValue)
    {
        X86SIMDValue x86Result;
        X86SIMDValue tmpaValue = X86SIMDValue::ToX86SIMDValue(aValue);
        X86SIMDValue tmpbValue = X86SIMDValue::ToX86SIMDValue(bValue);
        x86Result.m128d_value = _mm_cmpge_pd(tmpaValue.m128d_value, tmpbValue.m128d_value); // a >= b?

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    SIMDValue SIMDFloat64x2Operation::OpClamp(const SIMDValue& value, const SIMDValue& lower, const SIMDValue& upper)
    { // SIMD review: do we have intrinsic for the implementation?
        SIMDValue result;

        // lower clamp
        result.f64[SIMD_X] = value.f64[SIMD_X] < lower.f64[SIMD_X] ? lower.f64[SIMD_X] : value.f64[SIMD_X];
        result.f64[SIMD_Y] = value.f64[SIMD_Y] < lower.f64[SIMD_Y] ? lower.f64[SIMD_Y] : value.f64[SIMD_Y];

        // upper clamp
        result.f64[SIMD_X] = result.f64[SIMD_X] > upper.f64[SIMD_X] ? upper.f64[SIMD_X] : result.f64[SIMD_X];
        result.f64[SIMD_Y] = result.f64[SIMD_Y] > upper.f64[SIMD_Y] ? upper.f64[SIMD_Y] : result.f64[SIMD_Y];

        return result;
    }

    SIMDValue SIMDFloat64x2Operation::OpSelect(const SIMDValue& mV, const SIMDValue& tV, const SIMDValue& fV)
    {
        X86SIMDValue x86Result;
        X86SIMDValue maskValue  = X86SIMDValue::ToX86SIMDValue(mV);
        X86SIMDValue trueValue  = X86SIMDValue::ToX86SIMDValue(tV);
        X86SIMDValue falseValue = X86SIMDValue::ToX86SIMDValue(fV);

        X86SIMDValue tempTrue, tempFalse;
        tempTrue.m128d_value = _mm_and_pd(maskValue.m128d_value, trueValue.m128d_value);      // mask & True
        tempFalse.m128d_value = _mm_andnot_pd(maskValue.m128d_value, falseValue.m128d_value); // !mask & False
        x86Result.m128d_value = _mm_or_pd(tempTrue.m128d_value, tempFalse.m128d_value); // tempTrue | tempFalse

        return X86SIMDValue::ToSIMDValue(x86Result);
    }

    // Get SignMask
    int SIMDFloat64x2Operation::OpGetSignMask(const SIMDValue& value)
    {
        X86SIMDValue v = X86SIMDValue::ToX86SIMDValue(value);
        // Creates a two-bit mask from the sign bits of the two double-precision, floating-point
        // values of v.m128d_value
        return _mm_movemask_pd(v.m128d_value);
    }
}

#endif


text:
//----------------------------------------------------------------------------
/** @file GoUctObjectWithSearch.h */
//----------------------------------------------------------------------------

#ifndef GOUCT_OBJECTWITHSEARCH_H
#define GOUCT_OBJECTWITHSEARCH_H

class GoUctSearch;

//----------------------------------------------------------------------------

/** Interface implemented by object that owns a (single) GoUctSearch.
    If a GoPlayer implements this interface, the GoUctSearch related GTP
    commands in GoUctCommands can be used with this player. */
class GoUctObjectWithSearch
{
public:
    virtual ~GoUctObjectWithSearch();

    virtual GoUctSearch& Search() = 0;

    virtual const GoUctSearch& Search() const = 0;
};

//----------------------------------------------------------------------------

#endif // GOUCT_OBJECTWITHSEARCH_H


text:
int main()
{
    char st[MAX];
    PilaC letras, letras_aux;
    PilaS palabras, palabras_aux;
    createChar(&letras);
    createChar(&letras_aux);
    createString(&palabras);
    createString(&palabras_aux);
    printf("Introduce la cadena: ");
    gets(st);
    system("cls");
    puts(st);
    separarLetras(&letras, st);
    separarPalabras(&palabras, st);
    while(GetAsyncKeyState(ESC) != XD)
    {
        if(GetAsyncKeyState(ABAJO) == XD)
            retrocwwLetra(&letras, &letras_aux);
        else if(GetAsyncKeyState(ARRIBA) == XD)
            avanzarLetra(&letras, &letras_aux);
        else if(GetAsyncKeyState(IZQUIERDA) == XD)
            retrocwwPalabra(&palabras, &palabras_aux);
        else if(GetAsyncKeyState(DERECHA) == XD)
            avanzarPalabra(&palabras, &palabras_aux);
        else
            continue;
    }
    system("cls");
    Beep(4000, 800);
    return 0;
}


text:
<?php

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class ACA_ACF_Free_Setting_Field_Comment extends ACA_ACF_Free_Setting_Field {

	public function get_grouped_field_options() {
		add_filter( 'acf/location/rule_match/user_type', '__return_true', 16 );
		add_filter( 'acf/location/rule_match/page_type', '__return_true', 16 ); // In case where it's set to be not equal to Front Page

		$group_ids = apply_filters( 'acf/location/match_field_groups', array(), array() );

		remove_filter( 'acf/location/rule_match/user_type', '__return_true', 16 );
		remove_filter( 'acf/location/rule_match/page_type', '__return_true', 16 );

		return $this->get_option_groups( $group_ids );
	}

}


text:
Plain-Javascript
================


text:
<?php

namespace Webmozart\Expression\Tests\Comparison;

use PHPUnit_Framework_TestCase;
use Webmozart\Expression\Constraint\In;

/**
 * @since  1.0
 *
 * @author Bernhard Schussek <bschussek@gmail.com>
 */
class InTest extends PHPUnit_Framework_TestCase
{
    public function testEvaluateStrict()
    {
        $expr = new In(array('1', '2', '3'));

        $this->assertTrue($expr->evaluate('1'));
        $this->assertFalse($expr->evaluate(1));
        $this->assertFalse($expr->evaluate(1.0));
        $this->assertFalse($expr->evaluate(0));
        $this->assertFalse($expr->evaluate(10));
        $this->assertFalse($expr->evaluate(null));
    }

    public function testEvaluateNonStrict()
    {
        $expr = new In(array('1', '2', '3'), false);

        $this->assertTrue($expr->evaluate('1'));
        $this->assertTrue($expr->evaluate(1));
        $this->assertTrue($expr->evaluate(1.0));
        $this->assertFalse($expr->evaluate(0));
        $this->assertFalse($expr->evaluate(10));
        $this->assertFalse($expr->evaluate(null));
    }

    public function testToString()
    {
        $expr = new In(array('1', '2', '3'), false);

        $this->assertSame('in("1", "2", "3")', $expr->toString());
    }
}


text:
@interface Box
-(int) foo;
-(int) bar;
@end

@implementation Box
+(void) load {
  // This is not entirely safe, in real code it would be in a dispatch once
  // block.
  Class me = [self class];
  SEL fooSel = @selector(foo);
  SEL barSel = @selector(bar);
  Method fooMethod = class_getInstanceMethod(me, fooSel);
  Method barMethod = class_getInstanceMethod(me, barSel);
  class_replaceMethod(
      me,
      fooSel,
      method_getImplementation(barMethod),
      method_getTypeEncoding(barMethod)
  );
}

-(int) foo {
  return 10;
}

-(int) bar {
  return 20;
}

@end

int main(int argc, char **argv) {
  Box *b = [[Box alloc] init];

  // fooval should be equal to barval due to the swizzle.
  int fooval = [b foo];
  int barval = [b bar];

  return 0;
}


text:
<?php

namespace Homie\EggTimer;

use BrainExe\Core\EventDispatcher\AbstractEvent;
use BrainExe\Core\Traits\JsonSerializableTrait;
use Homie\Espeak\EspeakVO;
use JsonSerializable;

class EggTimerEvent extends AbstractEvent implements JsonSerializable
{
    use JsonSerializableTrait;

    const DONE = 'egg_timer.done';

    /**
     * @var EspeakVO
     */
    private $espeak;

    /**
     * @param EspeakVO $espeak
     */
    public function __construct(EspeakVO $espeak = null)
    {
        parent::__construct(self::DONE);
        $this->espeak = $espeak;
    }

    /**
     * @return EspeakVO|null
     */
    public function getEspeak()
    {
        return $this->espeak;
    }
}


text:
namespace AngleSharp.Html
{
    using AngleSharp.Dom.Io;
    using System;

    /// <summary>
    /// Defines the visitor for form data set entries.
    /// </summary>
    public interface IFormDataSetVisitor
    {
        /// <summary>
        /// Called by text form data set entries.
        /// </summary>
        /// <param name="entry">The entry to pass.</param>
        /// <param name="value">The contained text value.</param>
        void Text(FormDataSetEntry entry, String value);

        /// <summary>
        /// Called by file form data set entries.
        /// </summary>
        /// <param name="entry">The entry to pass.</param>
        /// <param name="fileName">The name of the file.</param>
        /// <param name="contentType">The MIME-type.</param>
        /// <param name="content">The contained content.</param>
        void File(FormDataSetEntry entry, String fileName, String contentType, IFile content);
    }
}


text:
class StaticConstantBufferPoolVK {
    DeviceVK* m_pDevice;

    RingWithTabs m_mem;

    VkBuffer                m_buffer;
    VkDeviceMemory          m_deviceMemory;

    std::uint32_t           m_totalMemSize;
    std::uint32_t           m_memOffset;
    char            *m_pData;

    bool            m_bUseVidMem;

  public:
    void OnCreate(DeviceVK* pDevice, std::uint32_t totalMemSize);
    void OnDestroy();
    bool AllocConstantBuffer(std::uint32_t size, void **pData, VkDescriptorBufferInfo *pOut);
    void UploadData(VkCommandBuffer cmd_buf);
    void FreeUploadHeap();

};


text:
angular.module('ionic-timepicker', ['ionic', 'ionic-timepicker.templates'])

// Defining `ionicTimepicker` directive
.directive('ionicTimepicker', ['$ionicPopup', '$filter', function($ionicPopup, $filter) {
    return {
        restrict: 'AE',
        replace: true,
        scope: {
            time: '=',
            step: '@',
            format: '@',
            popupTitle: '@',
            btnCloseText: '@',
            btnSetText: '@',
            btnCloseType: '@',
            btnSetType: '@'
        },

        link: function(scope, element, attrs) {

            element.on("click", function() {

                scope.timePicker = {
                    time: new Date(scope.time.getTime()),
                    step: angular.isDefined(scope.step) && scope.step > 0 && scope.step < 60 ? Number(scope.step) : 10,
                    format: angular.isDefined(scope.format) && scope.format == 24 ? 24 : 12,
                    popupTitle: '',
                    btnCloseText: angular.isDefined(scope.btnCloseText) ? scope.btnCloseText : 'Close',
                    btnSetText: angular.isDefined(scope.btnSetText) ? scope.btnSetText : 'Set',
                    btnCloseType: angular.isDefined(scope.btnCloseType) ? scope.btnCloseType : 'button-default',
                    btnSetType: angular.isDefined(scope.btnSetType) ? scope.btnSetType : 'button-positive'
                }

                if (angular.isDefined(scope.popupTitle)) {
                    scope.timePicker.popupTitle = scope.popupTitle;
                } else {
                    scope.timePicker.popupTitle = scope.timePicker.format == 12 ? '12-Hour Format' : '24-Hour Format';
                }

                function updateSlots() {
                    scope.slot = {
                        hours: $filter('date')(scope.timePicker.time, scope.timePicker.format == 12 ? 'hh' : 'HH'),
                        minutes: $filter('date')(scope.timePicker.time, 'mm'),
                        meridian: $filter('date')(scope.timePicker.time, 'a')
                    }
                }

                updateSlots();

                scope.increaseHours = function() {
                    scope.timePicker.time.setHours(scope.timePicker.time.getHours() + 1);
                    updateSlots();
                };

                scope.decreaseHours = function() {
                    scope.timePicker.time.setHours(scope.timePicker.time.getHours() - 1);
                    updateSlots();
                };

                scope.increaseMinutes = function() {
                    var minutes = scope.timePicker.time.getMinutes();
                    if (minutes % scope.timePicker.step != 0) {
                        minutes -= minutes % scope.timePicker.step;
                    }
                    scope.timePicker.time.setMinutes(minutes + scope.timePicker.step);
                    updateSlots();
                };

                scope.decreaseMinutes = function() {
                    var minutes = scope.timePicker.time.getMinutes();
                    if (minutes % scope.timePicker.step != 0) {
                        minutes -= minutes % scope.timePicker.step;
                    } else {
                        minutes -= scope.timePicker.step;
                    }
                    scope.timePicker.time.setMinutes(minutes);
                    updateSlots();
                };

                if (scope.timePicker.format == 12) {
                    scope.changeMeridian = function() {
                        scope.timePicker.time.setHours(scope.timePicker.time.getHours() + 12);
                        updateSlots();
                    };
                }

                $ionicPopup.show({
                    templateUrl: 'time-picker.html',
                    title: '<strong>' + scope.timePicker.popupTitle + '</strong>',
                    subTitle: '',
                    scope: scope,
                    buttons: [{
                        text: scope.timePicker.btnCloseText,
                        type: scope.timePicker.btnCloseType
                    }, {
                        text: scope.timePicker.btnSetText,
                        type: scope.timePicker.btnSetType,
                        onTap: function(e) {
                            scope.time.setHours(scope.timePicker.time.getHours());
                            scope.time.setMinutes(scope.timePicker.time.getMinutes());
                        }
                    }]
                })
            });
        }
    };
}]);


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

<!-- $Revision: 338152 $ -->
<refentry xml:id="mongoclient.connect" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>MongoClient::connect</refname>
  <refpurpose>Connects to a database server</refpurpose>
 </refnamediv>

 <refsynopsisdiv role="soft-deprecation-notice">
  <sidebar>
   &mongo.noalternative.method.note;
  </sidebar>
 </refsynopsisdiv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <modifier>public</modifier> <type>bool</type><methodname>MongoClient::connect</methodname>
   <void/>
  </methodsynopsis>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  &no.function.parameters;
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   If the connection was successful.
  </para>
 </refsect1>

 <refsect1 role="errors">
  &reftitle.errors;
  <para>
   Throws <classname>MongoConnectionException</classname> if it fails to connect
   to the database.
  </para>
 </refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->


text:
package com.github.dockerjava.cmd;

import org.apache.commons.io.IOUtils;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.InputStream;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.not;

public class SaveImageCmdIT extends CmdIT {
    public static final Logger LOG = LoggerFactory.getLogger(SaveImageCmdIT.class);

    @Test
    public void saveImage() throws Exception {

        try (
            InputStream inputStream = dockerRule.getClient().saveImageCmd("busybox").exec();
            InputStream image = IOUtils.toBufferedInputStream(inputStream)
        ) {
            assertThat(image.read(), not(-1));
        }

        try (
            InputStream inputStream = dockerRule.getClient().saveImageCmd("busybox").withTag("latest").exec();
            InputStream image2 = IOUtils.toBufferedInputStream(inputStream)
        ) {
            assertThat(image2.read(), not(-1));
        }
    }

}


text:
  /**

  **/
  d3.mappu.VectorLayer = function(name, config){
      return d3_mappu_VectorLayer(name, config);
  };

  d3_mappu_VectorLayer = function(name, config) {
  	  /*Work in progress for webworker
  	  var builder = new Worker("../src/layer/builder.js");
  	  builder.onmessage = function(e) {
		  console.log('Message received from worker', e.data.aap);
	  };
	  var obj = {project:'noot'};
  	  builder.postMessage(obj);
  	  console.log('Message posted to worker');
  	  */
  	  config = config || {};
      d3_mappu_Layer.call(this,name, config);
      var layer = d3_mappu_Layer(name, config);
      layer.type = 'vector';
      var _data = [];
	  layer.zindex = 100; //vectors always on top
	  var _duration = config.duration || 0;
	  var _path;
	  var _projection;
	  var style = config.style || {};
	  var labelStyle = config.labelStyle || {};
	  var _events = config.events;

      /* exposed properties*/
      Object.defineProperty(layer, 'data', {
        get: function() {
            return _data;
        },
        set: function(array) {
        	_data = array;
            draw(false);
        }
      });

      Object.defineProperty(layer, 'events', {
        get: function() {
            return _events;
        },
        set: function(array) {
            _events = array;
        }
      });

      //Function taken from terraformer
      function ringIsClockwise(ringToTest) {
		var total = 0,i = 0;
		var rLength = ringToTest.length;
		var pt1 = ringToTest[i];
		var pt2;
		for (i; i < rLength - 1; i++) {
		  pt2 = ringToTest[i + 1];
		  total += (pt2[0] - pt1[0]) * (pt2[1] + pt1[1]);
		  pt1 = pt2;
		}
		return (total >= 0);
	  }

      function setStyle(d){
          var self = this;
      	  var entity = d3.select(this);
      	  //Do generic layer style
      	  if (style){
      	  	  for (var key in style) {
      	  	  	  entity.select('path').style(key, style[key]);
      	  	  }
      	  }

      	  //Now use per-feature styling
      	  if (d.style){
      	  	  for (var key in d.style) {
      	  	  	  entity.select('path').style(key, d.style[key]);
      	  	  }
      	  }

      	  if (d._selected){
      	  	  //make halo around entity to show as selected
      	  	  entity
      	  	  	.append('path').attr("d", _path)
      	  	  	.style('stroke', 'none')
      	  	  	.style('fill', 'red')
      	  	  	.classed('halo', true);
      	  }
      	  else {
      	  	  entity.selectAll('.halo').remove();
      	  }
      }
      //Build is only called on entry
      function build(d){
      	  var project = _projection;

      	  if (d.geometry.type == 'Point' && d.style){
      	      var x = project(d.geometry.coordinates)[0];
              var y = project(d.geometry.coordinates)[1];
              var width = d.style && d.style.width ? d.style.width :
                           (style.width ? style.width : 32);
              var height = d.style && d.style.height ? d.style.height :
                           (style.height ? style.height : 37);
              var img = d3.select(this).append('g').append("image")
                .attr("width", width)
                .attr("height", height)
                //.attr("x",x-12.5) //No need setting x and y, since it's reset later
                //.attr("y",y-25)
                .style('pointer-events','visiblepainted')
                .attr("xlink:href", function(d){
                    if (d.style['iconimg']){
					    return 'data:image/' + d.style['iconimg_encoding'] +','+ d.style['iconimg_bytearray'];
                    }
                    else if (d.style['marker-url']){
    					return d.style['marker-url'];
                    };
				});
  	      }
      	  else {
			  if (d.geometry.type == 'Polygon' && !ringIsClockwise(d.geometry.coordinates[0])){
				  d.geometry.coordinates[0].reverse();
			  }
			  d3.select(this).append('path').attr("d", _path)
				.classed(name, true)
				.style('pointer-events','visiblepainted');//make clickable
		  }
		  d3.select(this).append('text')
		  	.classed('shadowtext',true)
		  	.attr('text-anchor',"middle");
		  d3.select(this).append('text')
		  	.classed('vectorLabel',true)
		  	.attr('text-anchor',"middle");

      }

      var draw = function(rebuild){
      	  if (config.reproject){
				_projection = layer.map.projection;
				_path = d3.geoPath()
					.projection(_projection)
					.pointRadius(function(d) {
						if (d.style && d.style.radius){
							return d.style.radius;
						}
						else {
							return 4.5;
						}
					});
		  }
		  else {
		  	  //TODO: this should be depending on the projection given ins the config, no?
				_projection = d3.geoMercator()
					.scale(1 / 2 / Math.PI)
					.translate([0, 0]);
				_path = d3.geoPath()
					.projection(_projection);
		  }
          var drawboard = layer.drawboard;
          if (rebuild){
               drawboard.selectAll('.entity').remove();
          }
          var entities = drawboard.select('g').selectAll('.entity').data(_data, function(d){
          	return d.id;
          });

          var newentity = entities.enter().append('g')
          	.classed('entity',true)
          	.attr('id',function(d){
                    return 'entity'+ d.id;
            })

          newentity.each(build);
          newentity.each(setStyle);

          entities.exit().remove();

          // Add events from config
          if (_events){
              _events.forEach(function(d){
                 newentity.each(function(){
                 	d3.select(this).select('path').on(d.event, d.action);
                 	d3.select(this).select('image').on(d.event, d.action);
                 });
              });
          }
          layer.refresh(rebuild?0:_duration);
      };

      var calcwidth = d3.scaleLinear().range([20,20,32,32]).domain([0,21,24,30]);
      var calcheight = d3.scaleLinear().range([20,20,37,37]).domain([0,21,24,30]);

      var refresh = function(duration){
          var drawboard = layer.drawboard;
          drawboard.select('g').style('opacity', this.opacity).style('display',this.visible ? 'block':'none');
          if (layer.visible){
          	  var entities = drawboard.select('g').selectAll('.entity');
			  if (config.reproject){//the slow way
			  	  var project = layer.map.projection;
				  entities.select('path').transition().duration(duration).attr("d", _path);
				  entities.select('image').transition().duration(duration).each(function(d){
                    //TODO: create something nice customizable for widh-height calculations
                    var width = d.style && d.style.width ? d.style.width :
                                 (style.width ? style.width : 32); //calcwidth(layer.map.zoom);
                    var height = d.style && d.style.height ? d.style.height :
                                 (style.height ? style.height : 37); //calcheight(layer.map.zoom);
				  	var x = project(d.geometry.coordinates)[0];
				  	var y = project(d.geometry.coordinates)[1];
				  	var offsetx = width/2;
				  	var offsety = height/2;
				  	d3.select(this).attr('x',x).attr('y',y)
				  		//Smaller markers when zooming out
				  		.attr("width", width)
				  		.attr("height", height);
				  	//Rotation has to be done seperately
					if (d.style && d.style.rotate){
						  //TODO: still experimental, rotate +90 should be fixed
						  d3.select(this.parentElement).attr("transform", "translate("+ -offsetx+" "+ -offsety+") rotate("+ d.style.rotate +" " + Math.round(x + offsetx) +"  "+  Math.round(y + offsety) +")");
						  //d3.select(this.parentElement).attr("transform", "translate("+ -offsetx+" "+ -offsety+")");
					  }
					  else {
					  	  d3.select(this.parentElement).attr("transform", "translate("+ -offsetx+" "+ -offsety+")");
					  }
				  });

				  if (config.labelfield){
				  	  //TODO: add option to only show layer from certain zoomlevel
					  entities.each(function(d){
						var loc = _path.centroid(d.geometry);
						var text = d.properties[config.labelfield];
						d3.select(this).selectAll('text')
							.attr('x',loc[0])
							.attr('y', loc[1] -20)
							.text(text);

                        //Add shadow text for halo
                        d3.select(this).select('.shadowtext')
                                .style('stroke-width','2.5px')
                                .style('stroke','white')
                                .style('opacity', 0.8);

						//Style text
                        if (labelStyle){
    						for (var key in labelStyle) {
    							d3.select(this).selectAll('.vectorLabel').style(key, labelStyle[key]);
                                //shadowtext only sensitive to the opacity style
                                if (key == 'opacity'){
                                    d3.select(this).select('.shadowtext').style('opacity', labelStyle[key]);
                                }
    						}
                        }

					  });
				  }
				  entities.each(setStyle);
			  }
			  else {
				//based on: http://bl.ocks.org/mbostock/5914438
				var transform = layer.map.transform;
				//FIXME: bug in chrome? When zoomed in too much, browser tab stalls on zooming. Probably to do with rounding floats or something..
				drawboard.select('g')
				  .attr("transform", transform)
				  .style("stroke-width", 1 / transform.k);
			  }
          }
          else {
          	  drawboard.selectAll('.entity').remove();
          }
      };

      var addFeature = function(feature){
      	  //var replaced = false;
		  //Testing with d3.map to make it faster
      	  var _datamap = d3.map(_data, function(d) { return d.id; });
      	  _datamap.set(feature.id, feature);
      	  _data = _datamap.values();
      	  //TODO: this is an expensive iteration when the amount of data increases
      	  //Make it cheaper.
      	  /*
      	  _data.forEach(function(d){
			  if (d.id == feature.id){
				  d = feature;
				  layer.draw();
				  replaced = true;
				  return;
			  }
      	  });
      	  if (!replaced){
      	  	  _data.push(feature);
      	  }*/
      	  layer.draw(true);
      };

      var removeFeature = function(feature){
      	  var idx = null;
      	  _data.forEach(function(d,i){
			  if (d.id == feature.id){
				  idx = i;
			  }
      	  });
      	  _data.splice(idx,1);
      	  layer.draw();
      };

      var zoomToFeature = function(feature){
      	  var loc = _projection.invert(_path.centroid(feature));
      	  layer.map.center = loc;
          layer.map.redraw();
      }

      /* Exposed functions*/
      layer.refresh = refresh;
      layer.draw = draw;
      layer.addFeature = addFeature;
      layer.removeFeature = removeFeature;
      layer.zoomToFeature = zoomToFeature;
      return layer;
  };

  d3_mappu_VectorLayer.prototype = Object.create(d3_mappu_Layer.prototype);

  //                                                                          マップ


text:
console Package
===============

:mod:`api` Module
-----------------

.. automodule:: pyface.ui.qt4.console.api
    :members:
    :undoc-members:
    :show-inheritance:

:mod:`bracket_matcher` Module
-----------------------------

.. automodule:: pyface.ui.qt4.console.bracket_matcher
    :members:
    :undoc-members:
    :show-inheritance:

:mod:`call_tip_widget` Module
-----------------------------

.. automodule:: pyface.ui.qt4.console.call_tip_widget
    :members:
    :undoc-members:
    :show-inheritance:

:mod:`completion_lexer` Module
------------------------------

.. automodule:: pyface.ui.qt4.console.completion_lexer
    :members:
    :undoc-members:
    :show-inheritance:

:mod:`console_widget` Module
----------------------------

.. automodule:: pyface.ui.qt4.console.console_widget
    :members:
    :undoc-members:
    :show-inheritance:

:mod:`history_console_widget` Module
------------------------------------

.. automodule:: pyface.ui.qt4.console.history_console_widget
    :members:
    :undoc-members:
    :show-inheritance:


text:
package necat.client;

import necat.channel.NxChannel;

public class NxClientImpl implements NxClient {
    private final NxChannel nxChannel;

    public NxClientImpl(NxChannel nxChannel) {
        this.nxChannel = nxChannel;
    }

}


text:
import json

from django.core.urlresolvers import reverse
from django.conf import settings

from rest_framework.serializers import ValidationError

from example.tests import TestBase
from example.tests.utils import load_json

class GenericValidationTest(TestBase):
    """
    Test that a non serializer specific validation can be thrown and formatted
    """
    def setUp(self):
        super(GenericValidationTest, self).setUp()
        self.url = reverse('user-validation', kwargs={'pk': self.miles.pk})

    def test_generic_validation_error(self):
        """
        Check error formatting
        """
        response = self.client.get(self.url)
        self.assertEqual(response.status_code, 400)

        expected = {
            'errors': [{
                'status': '400',
                'source': {
                    'pointer': '/data'
                },
                'detail': 'Oh nohs!'
            }]
        }

        parsed_content = load_json(response.content)

        assert expected == parsed_content


text:
layout: page
title: Ranger Citadel Company Seminar
date: 2016-05-24
author: Grace Montoya
tags: weekly links, java
status: published
summary: Sed eu vehicula magna, in.
banner: images/banner/people.jpg
booking:
  startDate: 05/10/2017
  endDate: 05/15/2017
  ctyhocn: GRRDTHX
  groupCode: RCCS
published: true
---
In hac habitasse platea dictumst. Nunc posuere, arcu eu mattis imperdiet, metus purus mollis elit, quis bibendum justo tortor et nunc. Ut porta metus ultricies, interdum magna eu, lacinia nulla. Sed vel dictum ante, non placerat mi. Suspendisse consectetur eu ligula sit amet finibus. Pellentesque luctus finibus nisl ac pretium. Morbi ullamcorper sapien tristique diam tincidunt condimentum.
Proin sapien risus, auctor id lorem ac, sodales finibus sapien. Curabitur eget volutpat sem. Mauris rhoncus pellentesque arcu, a condimentum lacus pulvinar at. Etiam quis dui ac nibh pellentesque molestie vel id dui. Integer a pharetra nunc, ultrices rhoncus ex. Nullam id ante vitae ligula tempus pretium vitae vitae erat. Aliquam ultrices elit quis elit tincidunt, nec molestie arcu eleifend. Mauris sollicitudin turpis non nulla gravida, vel interdum sapien malesuada. Vestibulum non enim aliquam, varius tortor quis, sagittis sem. Cras tincidunt vitae sem id condimentum. Suspendisse fermentum in magna quis venenatis.

* Nulla auctor ex eget rutrum viverra
* Etiam in tortor suscipit, dapibus leo consectetur, iaculis erat
* Vestibulum sit amet felis rutrum, aliquet urna et, facilisis dui
* Suspendisse accumsan ex porta justo placerat viverra
* In scelerisque tellus ac dolor sollicitudin lacinia.

Aliquam erat volutpat. Etiam rhoncus pulvinar nisl, in dapibus leo ultrices at. Aenean porta fermentum orci, efficitur vulputate mi malesuada sed. Nunc in vulputate dolor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Phasellus rutrum elit lacus, a rutrum odio pretium et. Morbi vitae mauris nec risus lacinia pretium blandit non libero. Suspendisse in quam porta, pellentesque tortor ut, iaculis est. Curabitur augue elit, ornare id convallis sit amet, rhoncus nec ante. Integer viverra, leo ac luctus rutrum, odio nulla porttitor dui, et elementum tortor eros mollis eros. Aenean vestibulum dignissim diam, et volutpat velit lacinia ut. Pellentesque eros enim, accumsan eget elit ac, vestibulum suscipit orci. Etiam cursus nisi ac vulputate suscipit. Duis vel quam nec elit interdum iaculis.


text:
use ga::Array;
use rand;

pub trait Initializer {
    fn init(self, rng: &mut rand::ThreadRng, shape: Vec<usize>) -> Array<f32>;
}

////////////////////////////////////////////////////////////////////////////////////////////////////

impl Initializer for f32 {
    fn init(self, _: &mut rand::ThreadRng, shape: Vec<usize>) -> Array<f32> {
        Array::new(shape, self)
    }
}

////////////////////////////////////////////////////////////////////////////////////////////////////

impl Initializer for Vec<f32> {
    fn init(self, _: &mut rand::ThreadRng, shape: Vec<usize>) -> Array<f32> {
        Array::from_vec(shape, self)
    }
}

////////////////////////////////////////////////////////////////////////////////////////////////////

/// Uniform(min, max)
pub struct Uniform(pub f32, pub f32);

impl Initializer for Uniform {
    fn init(self, rng: &mut rand::ThreadRng, shape: Vec<usize>) -> Array<f32> {
        use rand::Rng;

        let Uniform(min, max) = self;
        let vec = (0..shape[0]*shape[1]).map(|_| rng.next_f32()*(max-min) + min).collect();
        Array::from_vec(shape, vec)
    }
}

////////////////////////////////////////////////////////////////////////////////////////////////////

/// Normal(mean, standard deviation)
pub struct Normal(pub f32, pub f32);

impl Initializer for Normal {
    fn init(self, rng: &mut rand::ThreadRng, shape: Vec<usize>) -> Array<f32> {
        use rand::distributions::Sample;

        let Normal(mean, std_dev) = self;
        let mut dist = rand::distributions::Normal::new(mean as f64, std_dev as f64);
        let vec = (0..shape[0]*shape[1]).map(|_| dist.sample(rng) as f32).collect();
        Array::from_vec(shape, vec)
    }
}


text:
var util = require('../util');

function populateMethod(req) {
  req.httpRequest.method = req.service.api.operations[req.operation].httpMethod;
}

function populateURI(req) {
  var operation = req.service.api.operations[req.operation];
  var input = operation.input;
  var uri = [req.httpRequest.endpoint.path, operation.httpPath].join('/');
  uri = uri.replace(/\/+/g, '/');

  var escapePathParamFn = req.service.escapePathParam || escapePathParam;
  var escapeQuerystringParamFn = req.service.escapeQuerystringParam ||
                                 escapeQuerystringParam;

  var queryString = {}, queryStringSet = false;
  util.each(input.members, function (name, member) {
    var paramValue = req.params[name];
    if (paramValue === null || paramValue === undefined) return;
    if (member.location === 'uri') {
      uri = uri.replace('{' + member.name + '}', escapePathParamFn(paramValue));
    } else if (member.location === 'querystring') {
      queryStringSet = true;
      queryString[member.name] = escapeQuerystringParamFn(paramValue);
    }
  });

  if (queryStringSet) {
    uri += (uri.indexOf('?') >= 0 ? '&' : '?');
    var parts = [];
    util.arrayEach(Object.keys(queryString).sort(), function(key) {
      parts.push(escapeQuerystringParam(key) + '=' + queryString[key]);
    });
    uri += parts.join('&');
  }

  req.httpRequest.path = uri;
}

function escapePathParam(value) {
  return util.uriEscape(String(value));
}

function escapeQuerystringParam(value) {
  return util.uriEscape(String(value));
}

function populateHeaders(req) {
  var operation = req.service.api.operations[req.operation];
  util.each(operation.input.members, function (name, member) {
    var value = req.params[name];
    if (value === null || value === undefined) return;

    if (member.location === 'headers' && member.type === 'map') {
      util.each(value, function(key, value) {
        req.httpRequest.headers[member.name + key] = value;
      });
    } else if (member.location === 'header') {
      value = member.toWireFormat(value).toString();
      req.httpRequest.headers[member.name] = value;
    }
  });
}

function buildRequest(req) {
  populateMethod(req);
  populateURI(req);
  populateHeaders(req);
}

function extractError() {
}

function extractData(resp) {
  var req = resp.request;
  var data = {};
  var r = resp.httpResponse;
  var operation = req.service.api.operations[req.operation];
  var output = operation.output;

  // normalize headers names to lower-cased keys for matching
  var headers = {};
  util.each(r.headers, function (k, v) {
    headers[k.toLowerCase()] = v;
  });

  util.each(output.members, function(name, member) {
    var header = (member.name || name).toLowerCase();
    if (member.location === 'headers' && member.type === 'map') {
      data[name] = {};
      util.each(r.headers, function (k, v) {
        var result = k.match(new RegExp('^' + member.name + '(.+)', 'i'));
        if (result !== null) {
          data[name][result[1]] = v;
        }
      });
    } else if (member.location === 'header') {
      if (headers[header] !== undefined) {
        data[name] = headers[header];
      }
    } else if (member.location === 'status') {
      data[name] = parseInt(r.statusCode, 10);
    }
  });

  resp.data = data;
}

module.exports = {
  buildRequest: buildRequest,
  extractError: extractError,
  extractData: extractData
};


text:
/*jslint node: true*/
"use strict";

var utils = require('../utils');

/**
 * TOPIC plugin to emit "topic" events.
 *
 * @return {Function}
 * @api public
 */
module.exports = function () {
    return function (irc) {
        irc.topic = function ircTopic(channel, topic, network, fn) {
            var parse = utils.parseTarget(channel);
            if (!network) { network = parse.network; }
            channel = parse.target;
            channel = typeof channel !== "string" ? channel.getName() : channel;
            if (typeof topic === 'function') {
                fn = topic;
                topic = '';
            }
            this.write('TOPIC ' + channel + ' :' + topic, network, fn);
        };

        irc.on('data', function (err, msg) {
            var network = msg.network;
            switch (msg.command) {
                case 'RPL_TOPIC':
                    irc.getChannel(msg.params.split(' ')[1], network).topic.topic = msg.trailing;
                    break;
                case 'RPL_TOPIC_WHO_TIME':
                    var params = msg.params.split(' '),
                        chan = irc.getChannel(params[1], network);
                    chan.topic.user = irc.getUser(params[2].split('!')[0], network);
                    chan.topic.time = new Date(parseInt(params[3], 10) * 1000);
                    utils.emit(irc, network, 'topic', {
                        "channel": chan,
                        "topic": chan.topic.topic,
                        "user": chan.topic.user,
                        "time": chan.topic.time,
                        "changed": false,
                        "network": network,
                        "tags": msg.tags ? msg.tags : []
                    });
                    break;
                case 'TOPIC':
                    var channel = irc.getChannel(msg.params, network);
                    channel.topic.topic = msg.trailing;
                    channel.topic.user = irc.getUser(utils.nick(msg), network);
                    channel.topic.time = new Date();
                    utils.emit(irc, network, 'topic', {
                        "channel": channel,
                        "topic": channel.topic.topic,
                        "user": channel.topic.user,
                        "time": channel.topic.time,
                        "changed": true,
                        "network": network,
                        "tags": msg.tags ? msg.tags : []
                    });
                    break;
            }
        });
    };
};


text:
<?php
/**
 * DoctrineAchievementProviderFactoryTest
 *
 * @category  AxalianAchievementsTest\ServiceFactory\AchievementProvider
 * @package   AxalianAchievementsTest\ServiceFactory\AchievementProvider
 * @author    Michel Maas <michel@michelmaas.com>
 */

namespace AxalianAchievementsTest\ServiceFactory\AchievementProvider;

use AxalianAchievementsDoctrine\ServiceFactory\AchievementProvider\DoctrineAchievementProviderFactory;
use PHPUnit_Framework_TestCase;

class DoctrineAchievementProviderFactoryTest extends PHPUnit_Framework_TestCase
{
    /**
     * @var DoctrineAchievementProviderFactory
     */
    protected $providerFactory;

    public function setUp()
    {
        $this->providerFactory = new DoctrineAchievementProviderFactory();
    }

    public function testIfServiceCreated()
    {
        $rootServiceLocatorMock = \Mockery::mock('Zend\ServiceManager\ServiceLocatorInterface');
        $serviceLocatorMock = \Mockery::mock('Zend\ServiceManager\ServiceLocatorInterface');
        $repositoryFactoryMock = \Mockery::mock('AxalianAchievementsDoctrine\ServiceFactory\Repository\RepositoryFactory');

        $repositoryFactoryMock
            ->shouldReceive('createServiceWithName')
            ->with(
                $rootServiceLocatorMock,
                'axalianachievementsdoctrinerepositoryachievementrepository',
                'AxalianAchievementsDoctrine\Repository\AchievementRepository'
            )
            ->andReturn(
                \Mockery::mock('AxalianAchievementsDoctrine\Repository\AchievementRepository')
            );

        $repositoryFactoryMock
            ->shouldReceive('createServiceWithName')
            ->with(
                $rootServiceLocatorMock,
                'axalianachievementsdoctrinerepositorycategoryrepository',
                'AxalianAchievementsDoctrine\Repository\CategoryRepository'
            )
            ->andReturn(
                \Mockery::mock('AxalianAchievementsDoctrine\Repository\CategoryRepository')
            );

        $rootServiceLocatorMock->shouldReceive('get')->with('AxalianAchievementsDoctrine\ServiceFactory\Repository\RepositoryFactory')->andReturn($repositoryFactoryMock);
        $serviceLocatorMock->shouldReceive('getServiceLocator')->andReturn($rootServiceLocatorMock);

        $service = $this->providerFactory->createService($serviceLocatorMock);

        $this->assertInstanceOf('AxalianAchievementsDoctrine\AchievementProvider\DoctrineAchievementProvider', $service);
    }
}


text:
typedef struct wav_info
{
	int chunk_size;
	int subchunk1_size;
	int audio_format;
	int n_channels;
	int sample_rate;
	int byte_rate;
	int block_align;
	int bits_per_sample;
	int subchunk2_size;
} wav_info;

int open_wav_r(char* filename, FILE** fp);
int write_wav(char* filename, wav_info* header, int* signal);
void write_wav_header(wav_info* p_header, FILE* m_fp);
void write_sample(int sample, wav_info* header, FILE* fp);
void make_mono(wav_info* p_header);
int check_wav_header(FILE* m_fp, wav_info* p_header);
int get_sample(FILE* fp, wav_info* header);
int get_data_len(wav_info* header);
void read_signal(FILE* fp, wav_info* header, int** signal);

#endif


text:
package com.devopsbuddy.config;

import com.devopsbuddy.backend.service.EmailService;
import com.devopsbuddy.backend.service.MockEmailService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.context.annotation.PropertySource;

/**
 * Created by tedonema on 21/03/2016.
 */
@Configuration
@Profile("dev")
@PropertySource("file:///${user.home}/.devopsbuddy/application-dev.properties")
public class DevelopmentConfig {

    @Bean
    public EmailService emailService() {
        return new MockEmailService();
    }
}


text:
> see https://aka.ms/autorest

This is the AutoRest configuration file for Azure Migrate.

---

### Java multi-api

``` yaml $(java) && $(multiapi)
batch:
  - tag: package-2018-02
  - tag: package-2020-01
  - tag: package-2020-05
  - tag: package-2020-07
```

### Tag: package-2018-02 and java

These settings apply only when `--tag=package-2018-02 --java` is specified on the command line.
Please also specify `--azure-libraries-for-java=<path to the root directory of your azure-sdk-for-java clone>`.

``` yaml $(tag) == 'package-2018-02' && $(java) && $(multiapi)
java:
  namespace: com.microsoft.azure.management.azuremigrate.v2018_02_02
  output-folder: $(azure-libraries-for-java-folder)/sdk/azuremigrate/mgmt-v2018_02_02
regenerate-manager: true
generate-interface: true
```

### Tag: package-2020-01 and java

These settings apply only when `--tag=package-2020-01 --java` is specified on the command line.
Please also specify `--azure-libraries-for-java=<path to the root directory of your azure-sdk-for-java clone>`.

``` yaml $(tag) == 'package-2020-01' && $(java) && $(multiapi)
java:
  namespace: com.microsoft.azure.management.azuremigrate.v2020_01_01
  output-folder: $(azure-libraries-for-java-folder)/sdk/azuremigrate/mgmt-v2020_01_01
regenerate-manager: true
generate-interface: true
```

### Tag: package-2020-05 and java

These settings apply only when `--tag=package-2020-05 --java` is specified on the command line.
Please also specify `--azure-libraries-for-java=<path to the root directory of your azure-sdk-for-java clone>`.

``` yaml $(tag) == 'package-2020-05' && $(java) && $(multiapi)
java:
  namespace: com.microsoft.azure.management.azuremigrate.v2020_05_01
  output-folder: $(azure-libraries-for-java-folder)/sdk/azuremigrate/mgmt-v2020_05_01
regenerate-manager: true
generate-interface: true
```

### Tag: package-2020-07 and java

These settings apply only when `--tag=package-2020-07 --java` is specified on the command line.
Please also specify `--azure-libraries-for-java=<path to the root directory of your azure-sdk-for-java clone>`.

``` yaml $(tag) == 'package-2020-07' && $(java) && $(multiapi)
java:
  namespace: com.microsoft.azure.management.azuremigrate.v2020_07_07
  output-folder: $(azure-libraries-for-java-folder)/sdk/azuremigrate/mgmt-v2020_07_07
regenerate-manager: true
generate-interface: true
```

## Getting Started

To build the SDK for Migrate, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run:

> `autorest`

To see additional help and options, run:

> `autorest --help`

---

## Configuration

### Basic Information

These are the global settings for the API.

``` yaml
openapi-type: arm
tag: package-2019-10
```

### Tag: package-2018-02

These settings apply only when `--tag=package-2018-02` is specified on the command line.

``` yaml $(tag) == 'package-2018-02'
input-file:
- Microsoft.Migrate/stable/2018-02-02/migrate.json
```

### Tag: package-2019-10

These settings apply only when `--tag=package-2019-10` is specified on the command line.

``` yaml $(tag) == 'package-2019-10'
input-file:
- Microsoft.Migrate/stable/2019-10-01/migrate.json
```

### Tag: package-2020-01

These settings apply only when `--tag=package-2020-01` is specified on the command line.

``` yaml $(tag) == 'package-2020-01'
input-file:
- Microsoft.OffAzure/stable/2020-01-01/migrate.json
```

### Tag: package-2020-05

These settings apply only when `--tag=package-2020-05` is specified on the command line.

``` yaml $(tag) == 'package-2020-05'
input-file:
- Microsoft.Migrate/stable/2020-05-01/hubmigrate.json
```

### Tag: package-2020-07

These settings apply only when `--tag=package-2020-07` is specified on the command line.

``` yaml $(tag) == 'package-2020-07'
input-file:
- Microsoft.OffAzure/stable/2020-07-07/migrate.json
```

## Suppression

``` yaml
directive:
  - suppress: DefinitionsPropertiesNamesCamelCase
    from: migrate.json
    where: $.definitions.AssessedMachineProperties.properties.monthlyStandardSSDStorageCost
    reason: SSD is short form.
  - suppress: DefinitionsPropertiesNamesCamelCase
    from: migrate.json
    where: $.definitions.AssessmentProperties.properties.monthlyStandardSSDStorageCost
    reason: SSD is short form.
```

# Code Generation

## Swagger to SDK

This section describes what SDK should be generated by the automatic system.
This is not used by Autorest itself.

``` yaml $(swagger-to-sdk)
swagger-to-sdk:
  - repo: azure-sdk-for-net-track2
  - repo: azure-sdk-for-go
  - repo: azure-sdk-for-go-track2
  - repo: azure-sdk-for-js
  - repo: azure-sdk-for-node
  - repo: azure-resource-manager-schemas
  - repo: azure-powershell
```

## Go

See configuration in [readme.go.md](./readme.go.md)


text:
TEST_DIR="$(cd "$(dirname "${0}")" && pwd)"
S3CURL_URL="http://s3.amazonaws.com/doc/s3-example-code/s3-curl.zip"
S3_ACCOUNT="account"
S3_USER="user"
S3_PASSWORD="password"

source "${TEST_DIR}/lib.sh"

run -r master -e "${TEST_DIR}/test-inside-object-store-setup.sh ${S3CURL_URL} ${S3_ACCOUNT} ${S3_USER} ${S3_PASSWORD}" "Setup s3curl"

run -r master -e "${TEST_DIR}/test-inside-object-store.sh ${S3_ACCOUNT}:${S3_USER} clearbucket" "Clear bucket"

run -r master -e "${TEST_DIR}/test-inside-object-store.sh ${S3_ACCOUNT}:${S3_USER} putbucket" "Test put of bucket"

run -r master "${TEST_DIR}/test-inside-object-store.sh ${S3_ACCOUNT}:${S3_USER} putobject" "Test put of object"

run -r master "${TEST_DIR}/test-inside-object-store.sh ${S3_ACCOUNT}:${S3_USER} delobject" "Test delete of object"

run -r master "${TEST_DIR}/test-inside-object-store.sh ${S3_ACCOUNT}:${S3_USER} delbucket" "Test delete of bucket"


text:
<?php
// signup.php, signup.common.php, signup.server.php
// demonstrate a a simple implementation of a multipage signup form
// using xajax version 0.2
// http://xajaxproject.org

require_once ("../../xajax.inc.php");

session_start();

$xajax = new xajax("signup.server.php");
$xajax->registerFunction("processForm");
?>


text:
/*

	Thi code is to test the Magnetometer HMC58831, for the moment this code
	is borrowed from other code for MPU6050, so you can expec the word
	accelerometer in some parts

	don't forget run to load the i2c kernel:

	gpio load i2c 400
*/
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <time.h>
#include <math.h>

//RPi headers!!!
#include <wiringPi.h>
#include <wiringPiI2C.h>
#include <linux/i2c-dev.h>

//For Guanajuato, Mexico: 5* 53' 48'' E,  that means: 5.88 Degrees
//that means: 0.10262 rads, negative
#define MAGNETIC_DECLINATION -0.10262f

#define RPI_SERVER

#define LED 0

void error(const char *msg)
{
    perror(msg);
    exit(1);
}

int main(int argc, char *argv[])
{
	int sockfd, newsockfd, portno;
	socklen_t clilen;
	int pid;
	char buffer[256];
	int i;
	struct sockaddr_in serv_addr, cli_addr;
	int n;
	int accel=0;
	int low,high;
	short accelerations[3];
	int address;
	FILE *mpu_log_ptr=NULL;
	int	data_written=0;
	short MPU_RAM_LOG[20000*3];
	int sample_print=300;
	clock_t start_time,end_time;
	unsigned char buffer_read[14];
	unsigned char buffer_before[14];
	unsigned char *ptr_buffer_current=buffer_read;
	unsigned char *ptr_buffer_before=buffer_before;
	unsigned char *ptr_exchange_buffer=NULL;
	int result;
	off_t real_offset;
	int total_read=0;
	float heading;

	address=0x1E;
	accel=wiringPiI2CSetup(address);

	if(accel<0)
	{
		printf("Error to access Acceleromteter");
		return 0;
	}

	printf("Conected to %x, result connection: %i\n",address,accel);

	//8-average, 15 Hz default, normal measurement
	wiringPiI2CWriteReg8(accel,0x00,0x70);
	//Gain=5
	wiringPiI2CWriteReg8(accel,0x01,0xA0);
	//Continuous Measurement
	wiringPiI2CWriteReg8(accel,0x02,0x00);

	//Open the file log
	mpu_log_ptr=fopen("mpu6050.log","wt");

	if(mpu_log_ptr==NULL)
	{
		printf("Sorry, the file cannot be created, be sure you have permissions\n");
		return -1;
	}

	memset(ptr_buffer_before,0,14);

	start_time=clock();
	i=0;
	while(1)
	{
		ioctl(accel,I2C_SLAVE,0x1E); //We want communicate with the slave 0x1E
		ptr_buffer_current[0]=0x03;  //Point to the dir 0x03, here start the measurements of the magnetometer
		result=write(accel,ptr_buffer_current,1); //Write the dir
		result=read(accel,ptr_buffer_current,6);  //Read 6 registers (increment automatically), check the datasheet
							  //to understand better the next code

		//Compare the current sample and the before (to avoid oversampling)
		result=memcmp(ptr_buffer_before,ptr_buffer_current,14);

		if(result!=0)
		{
			//increment a counter to manage the total counts in a time
			data_written++;

			//Convert to signed short int, this translate the 16 bit signed of the magnetometer
			//to a type that C understand better, we have three axis, 16 bit each of them.
			for(i=0;i<3;i++)
			{
				low=buffer_read[i*2+1];
				high=buffer_read[i*2];
				accelerations[i]=(short)(((unsigned char)low) + ((unsigned char)(high))*256);
				printf("%hi ",accelerations[i]);

			}
			//fprintf(mpu_log_ptr,"\n");

			/*Try to calculate the angle respecting the "magnetic field" of the earth
			Compensate the Magnetic declination, see more at:
			http://bildr.org/2012/02/hmc5883l_arduino/
			http://www.ngdc.noaa.gov/geomag-web/#declination */
			heading = atan2(accelerations[2],accelerations[0])+MAGNETIC_DECLINATION;

			printf(" \t  %f ",heading*180.0f/3.1416f);

			printf("\n");
		}

		//Exchange the buffers to compare the before and the current sample
		ptr_exchange_buffer=ptr_buffer_current;
		ptr_buffer_current=ptr_buffer_before;
		ptr_buffer_before=ptr_exchange_buffer;

		//Print some info to track time
		total_read++;
		sample_print=15;
		if(data_written==sample_print)
		{
			end_time=clock();
			printf("%i sampled, time %lf, total read: %i\n", sample_print,(double)(end_time - start_time)/CLOCKS_PER_SEC,total_read);
			fflush(mpu_log_ptr);
			data_written=0;
			total_read=0;
			start_time=end_time;
		}

	}
}


text:
import os
import tarfile
from Naked.toolshed.system import stderr, dir_exists, file_exists

# ------------------------------------------------------------------------------
# PUBLIC
# ------------------------------------------------------------------------------

def generate_tar_files(directory_list):
    """Public function that reads a list of local directories and generates tar archives from them"""

    tar_file_list = []

    for directory in directory_list:
        if dir_exists(directory):
            _generate_tar(directory)                  # create the tar archive
            tar_file_list.append(directory + '.tar')  # append the tar archive filename to the returned tar_file_list list
        else:
            stderr("The directory '" + directory + "' does not exist and a tar archive could not be created from it.", exit=1)

    return tar_file_list

def remove_tar_files(file_list):
    """Public function that removes temporary tar archive files in a local directory"""
    for f in file_list:
        if file_exists(f) and f.endswith('.tar'):
            os.remove(f)  # remove any tar files in the list, if it does not appear to be a tar file, leave it alone

# ------------------------------------------------------------------------------
# PRIVATE
# ------------------------------------------------------------------------------

def _generate_tar(dir_path):
    """Private function that reads a local directory and generates a tar archive from it"""
    try:
        with tarfile.open(dir_path + '.tar', 'w') as tar:
            tar.add(dir_path)
    except tarfile.TarError as e:
        stderr("Error: tar archive creation failed [" + str(e) + "]", exit=1)


text:
#include "VoxelTools/VoxelPaintMaterial.h"
#include "VoxelUtilities/VoxelMathUtilities.h"

void FVoxelPaintMaterial::ApplyToMaterial(FVoxelMaterial& Material, float Strength) const
{
	// Else goes way beyond target
	Strength = FMath::Clamp(Strength, -1.f, 1.f);

	switch (Type)
	{
	case EVoxelPaintMaterialType::Color:
	{
		// Note: the voxel colors are in linear space, even if they are stored in FColors
		FColor ColorToPaint = Color.bUseLinearColor ? Color.LinearColor.ToFColor(false) : Color.Color;
		if (Strength < 0)
		{
			Strength = -Strength;
			ColorToPaint = FColor(0, 0, 0, 0);
		}
		if (Color.bPaintR)
		{
			Material.SetR(FVoxelUtilities::LerpUINT8(Material.GetR(), ColorToPaint.R, Strength));
		}
		if (Color.bPaintG)
		{
			Material.SetG(FVoxelUtilities::LerpUINT8(Material.GetG(), ColorToPaint.G, Strength));
		}
		if (Color.bPaintB)
		{
			Material.SetB(FVoxelUtilities::LerpUINT8(Material.GetB(), ColorToPaint.B, Strength));
		}
		if (Color.bPaintA)
		{
			Material.SetA(FVoxelUtilities::LerpUINT8(Material.GetA(), ColorToPaint.A, Strength));
		}
		break;
	}
	case EVoxelPaintMaterialType::FiveWayBlend:
	{
		float TargetValue = Strength > 0 ? FiveWayBlend.TargetValue : 1.f - FiveWayBlend.TargetValue;
		Strength = FMath::Abs(Strength);

		if (FiveWayBlend.bFourWayBlend)
		{
			const int32 Channel = FMath::Clamp(FiveWayBlend.Channel, 0, 3);

			const float R = Material.GetR_AsFloat();
			const float G = Material.GetG_AsFloat();
			const float B = Material.GetB_AsFloat();

			TVoxelStaticArray<float, 4> Strengths = FVoxelUtilities::XWayBlend_AlphasToStrengths_Static<4>({ R, G, B });

			// Add locked channels to ChannelsToKeepIntact,
			// and make TargetValue relative to the strength that's left to edit
			uint32 ChannelsToKeepIntact = 1u << Channel;
			{
				float LockedChannelsStrength = 0.f;
				for (uint8 LockedChannel : FiveWayBlend.LockedChannels)
				{
					LockedChannel = FMath::Clamp<uint8>(LockedChannel, 0, 3);
					ChannelsToKeepIntact |= 1u << LockedChannel;
					LockedChannelsStrength += Strengths[LockedChannel];
				}
				TargetValue *= 1.f - LockedChannelsStrength;
			}

			Strengths[Channel] = FMath::Clamp(FMath::Lerp(Strengths[Channel], TargetValue, Strength), 0.f, 1.f);

			const TVoxelStaticArray<float, 3> Alphas = FVoxelUtilities::XWayBlend_StrengthsToAlphas_Static<4>(Strengths, ChannelsToKeepIntact);

			Material.SetR(FVoxelUtilities::FloatToUINT8_ForLerp(Alphas[0], R));
			Material.SetG(FVoxelUtilities::FloatToUINT8_ForLerp(Alphas[1], G));
			Material.SetB(FVoxelUtilities::FloatToUINT8_ForLerp(Alphas[2], B));
		}
		else
		{
			const int32 Channel = FMath::Clamp(FiveWayBlend.Channel, 0, 4);

			const float R = Material.GetR_AsFloat();
			const float G = Material.GetG_AsFloat();
			const float B = Material.GetB_AsFloat();
			const float A = Material.GetA_AsFloat();

			TVoxelStaticArray<float, 5> Strengths = FVoxelUtilities::XWayBlend_AlphasToStrengths_Static<5>({ R, G, B, A });

			// Add locked channels to ChannelsToKeepIntact,
			// and make TargetValue relative to the strength that's left to edit
			uint32 ChannelsToKeepIntact = 1u << Channel;
			{
				float LockedChannelsStrength = 0.f;
				for (uint8 LockedChannel : FiveWayBlend.LockedChannels)
				{
					LockedChannel = FMath::Clamp<uint8>(LockedChannel, 0, 4);
					ChannelsToKeepIntact |= 1u << LockedChannel;
					LockedChannelsStrength += Strengths[LockedChannel];
				}
				TargetValue *= 1.f - LockedChannelsStrength;
			}

			Strengths[Channel] = FMath::Clamp(FMath::Lerp(Strengths[Channel], TargetValue, Strength), 0.f, 1.f);

			const TVoxelStaticArray<float, 4> Alphas = FVoxelUtilities::XWayBlend_StrengthsToAlphas_Static<5>(Strengths, ChannelsToKeepIntact);

			Material.SetR(FVoxelUtilities::FloatToUINT8_ForLerp(Alphas[0], R));
			Material.SetG(FVoxelUtilities::FloatToUINT8_ForLerp(Alphas[1], G));
			Material.SetB(FVoxelUtilities::FloatToUINT8_ForLerp(Alphas[2], B));
			Material.SetA(FVoxelUtilities::FloatToUINT8_ForLerp(Alphas[3], A));
		}

		break;
	}
	case EVoxelPaintMaterialType::SingleIndex:
	{
		Material.SetSingleIndex(SingleIndex.Channel.Channel);
		break;
	}
	case EVoxelPaintMaterialType::MultiIndex:
	{
		float TargetValue = Strength > 0 ? MultiIndex.TargetValue : 1.f - MultiIndex.TargetValue;
		Strength = FMath::Abs(Strength);

		const float Blend0 = Material.GetMultiIndex_Blend0_AsFloat();
		const float Blend1 = Material.GetMultiIndex_Blend1_AsFloat();
		const float Blend2 = Material.GetMultiIndex_Blend2_AsFloat();

		TVoxelStaticArray<float, 4> Strengths = FVoxelUtilities::XWayBlend_AlphasToStrengths_Static<4>({ Blend0, Blend1, Blend2 });

		uint32 ChannelsToKeepIntact = 0;

		// Propagate strengths backward if the indices are equal, and mark them as fixed:
		// we want them to always be 0, and the "main" one have all the strength instead
		// This is to handle cases where indices are eg 1 0 0 0
		{
			if (Material.GetMultiIndex_Index3() == Material.GetMultiIndex_Index2())
			{
				Strengths[2] += Strengths[3];
				Strengths[3] = 0;
				ChannelsToKeepIntact |= 1u << 3;
			}
			else if (Material.GetMultiIndex_Index3() == Material.GetMultiIndex_Index1())
			{
				Strengths[1] += Strengths[3];
				Strengths[3] = 0;
				ChannelsToKeepIntact |= 1u << 3;
			}
			else if (Material.GetMultiIndex_Index3() == Material.GetMultiIndex_Index0())
			{
				Strengths[0] += Strengths[3];
				Strengths[3] = 0;
				ChannelsToKeepIntact |= 1u << 3;
			}

			if (Material.GetMultiIndex_Index2() == Material.GetMultiIndex_Index1())
			{
				Strengths[1] += Strengths[2];
				Strengths[2] = 0;
				ChannelsToKeepIntact |= 1u << 2;
			}
			else if (Material.GetMultiIndex_Index2() == Material.GetMultiIndex_Index0())
			{
				Strengths[0] += Strengths[2];
				Strengths[2] = 0;
				ChannelsToKeepIntact |= 1u << 2;
			}

			if (Material.GetMultiIndex_Index1() == Material.GetMultiIndex_Index0())
			{
				Strengths[0] += Strengths[1];
				Strengths[1] = 0;
				ChannelsToKeepIntact |= 1u << 1;
			}
		}

		// Add locked channels to ChannelsToKeepIntact,
		// and make TargetValue relative to the strength that's left to edit
		{
			float LockedChannelsStrength = 0.f;
			for (uint8 LockedChannel : MultiIndex.LockedChannels)
			{
				if (Material.GetMultiIndex_Index0() == LockedChannel)
				{
					ChannelsToKeepIntact |= 1u << 0;
					LockedChannelsStrength += Strengths[0];
				}
				else if (Material.GetMultiIndex_Index1() == LockedChannel)
				{
					ChannelsToKeepIntact |= 1u << 1;
					LockedChannelsStrength += Strengths[1];
				}
				else if (Material.GetMultiIndex_Index2() == LockedChannel)
				{
					ChannelsToKeepIntact |= 1u << 2;
					LockedChannelsStrength += Strengths[2];
				}
				else if (Material.GetMultiIndex_Index3() == LockedChannel)
				{
					ChannelsToKeepIntact |= 1u << 3;
					LockedChannelsStrength += Strengths[3];
				}
			}
			TargetValue *= 1.f - LockedChannelsStrength;
		}

		int32 ChannelIndex;
		if (MultiIndex.Channel == Material.GetMultiIndex_Index0())
		{
			ChannelIndex = 0;
		}
		else if (MultiIndex.Channel == Material.GetMultiIndex_Index1())
		{
			ChannelIndex = 1;
		}
		else if (MultiIndex.Channel == Material.GetMultiIndex_Index2())
		{
			ChannelIndex = 2;
		}
		else if (MultiIndex.Channel == Material.GetMultiIndex_Index3())
		{
			ChannelIndex = 3;
		}
		else
		{
			ChannelIndex = 0;
			{
				float MinStrength = Strengths[0];
				if (Strengths[1] < MinStrength) { MinStrength = Strengths[1]; ChannelIndex = 1; }
				if (Strengths[2] < MinStrength) { MinStrength = Strengths[2]; ChannelIndex = 2; }
				if (Strengths[3] < MinStrength) { ChannelIndex = 3; }
			}

			Strengths[ChannelIndex] = 0.f;

			switch (ChannelIndex)
			{
			case 0: Material.SetMultiIndex_Index0(MultiIndex.Channel.Channel); break;
			case 1: Material.SetMultiIndex_Index1(MultiIndex.Channel.Channel); break;
			case 2: Material.SetMultiIndex_Index2(MultiIndex.Channel.Channel); break;
			case 3: Material.SetMultiIndex_Index3(MultiIndex.Channel.Channel); break;
			default: ensureVoxelSlow(false);
			}
		}

		// Do not modify the channel we are setting
		ChannelsToKeepIntact |= 1u << ChannelIndex;

		Strengths[ChannelIndex] = FMath::Clamp(FMath::Lerp(Strengths[ChannelIndex], TargetValue, Strength), 0.f, 1.f);

		const auto Alphas = FVoxelUtilities::XWayBlend_StrengthsToAlphas_Static<4>(Strengths, ChannelsToKeepIntact);

		Material.SetMultiIndex_Blend0(FVoxelUtilities::FloatToUINT8_ForLerp(Alphas[0], Blend0));
		Material.SetMultiIndex_Blend1(FVoxelUtilities::FloatToUINT8_ForLerp(Alphas[1], Blend1));
		Material.SetMultiIndex_Blend2(FVoxelUtilities::FloatToUINT8_ForLerp(Alphas[2], Blend2));

		break;
	}
	case EVoxelPaintMaterialType::MultiIndexWetness:
	{
		float TargetValue = MultiIndexWetness.TargetValue;
		if (Strength < 0)
		{
			Strength = -Strength;
			TargetValue = 1.f - TargetValue;
		}
		Material.SetMultiIndex_Wetness(FVoxelUtilities::LerpUINT8(Material.GetMultiIndex_Wetness(), FVoxelUtilities::FloatToUINT8(TargetValue), Strength));
		break;
	}
	case EVoxelPaintMaterialType::MultiIndexRaw:
	{
		TVoxelStaticArray<float, 4> Strengths;
		Strengths[0] = MultiIndexRaw.Strength0;
		Strengths[1] = MultiIndexRaw.Strength1;
		Strengths[2] = MultiIndexRaw.Strength2;
		Strengths[3] = MultiIndexRaw.Strength3;
		const auto Alphas = FVoxelUtilities::XWayBlend_StrengthsToAlphas_Static<4>(Strengths);

		Material.SetMultiIndex_Blend0_AsFloat(Alphas[0]);
		Material.SetMultiIndex_Blend1_AsFloat(Alphas[1]);
		Material.SetMultiIndex_Blend2_AsFloat(Alphas[2]);

		Material.SetMultiIndex_Index0(MultiIndexRaw.Channel0.Channel);
		Material.SetMultiIndex_Index1(MultiIndexRaw.Channel1.Channel);
		Material.SetMultiIndex_Index2(MultiIndexRaw.Channel2.Channel);
		Material.SetMultiIndex_Index3(MultiIndexRaw.Channel3.Channel);

		break;
	}
	case EVoxelPaintMaterialType::UV:
	{
		FVector2D TargetUV = UV.UV;
		if (Strength < 0)
		{
			Strength = -Strength;
			TargetUV = FVector2D(1, 1) - TargetUV;
		}
		if (UV.bPaintU)
		{
			Material.SetU(UV.Channel, FVoxelUtilities::LerpUINT8(Material.GetU(UV.Channel), FVoxelUtilities::FloatToUINT8(TargetUV.X), Strength));
		}
		if (UV.bPaintV)
		{
			Material.SetV(UV.Channel, FVoxelUtilities::LerpUINT8(Material.GetV(UV.Channel), FVoxelUtilities::FloatToUINT8(TargetUV.Y), Strength));
		}
		break;
	}
	default: ensure(false);
	}
}


text:
select c_city,s_city,d_year,sum(lo_revenue) as revenue
from customer,lineorder,supplier,ddate
where lo_custkey = c_custkey
and lo_suppkey = s_suppkey
and lo_orderdate = d_datekey
and c_nation = 'UNITED STATES'
and s_nation = 'UNITED STATES'
and d_year >=1992 and d_year <= 1997
group by c_city,s_city,d_year
order by d_year asc,revenue desc;