text:
'use strict';

var
  util       = require('util'),
  Controller = require('hmpo-form-wizard').Controller,
  _          = require('underscore'),
  FormModel  = new require('../models/form');

function Finish()
{
  Controller.apply(this, arguments);
}

util.inherits(Finish, Controller);

Finish.prototype.data = function(req){
  // Return form data from the session
  return _.pick(req.sessionModel.toJSON(), Object.keys(require('../routes/fields')));
};

Finish.prototype.locals = function (req, res) {
  // Add 'name' to the locals and reset the session
  var
    name   = this.data(req).name,
    locals = Controller.prototype.locals.call(this, req, res);

  req.sessionModel.reset();

  return _.extend(locals, { name: name });
};

Finish.prototype.getValues = function(req, res, callback){
  // Grab data from session
  var
    data  = this.data(req),
    model = new FormModel({
      name:    data.name,
      sex:     ('male' === data.sex) ? 1 : 0,
      age:     data.age,
      country: data.country
    });

  // Save the data
  model.save(function(err){
    err
      ? console.log('Error: ' + err)
      : Controller.prototype.getValues.call(this, req, res, callback);
  });
};

module.exports = Finish;


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <title>TODO List</title>
        <link href="main.css" rel="stylesheet" type="text/css">
        <link rel="icon" type="image/ico" href="favicon.ico">

TODO List

                Completed todos : {{tdListService.data.completedCounter}}

            <todo-list-directive></todo-list-directive>
                <form ng-submit="submitTodo(title)" id="todo-form">
                    <input id="new-todo" ng-model="title" placeholder="What needs to be done?" autofocus>
                    <input id="submit-todo" type="submit" value="Create">
                </form>

{{tdListService.data.errorMessage}}

            {{updateCounter()}}

redpajama_set_name: RedPajamaGithub


text:
"""
Created on Fri Mar 11 15:32:58 2016

@author: Tobias Jachowski
"""
import numpy as np
import pint

from pyoti import config as cfg
from pyoti.calibration.calibsource import CalibrationSource
from pyoti import helpers as hp

class PyOTICfSource(CalibrationSource):
    def __init__(self, filename=None, focalshift=None, name=None, **kwargs):
        if filename is None:
            raise TypeError("PyOTICfSource missing the required positional "
                            "argument 'filename'.")
        self.filename = filename

        value, factor = read_pyotic_hc_result(filename)

        self.corrfactor = value['correction_factor']
        self.dsurf = value['apparent_surface_distance'] \
            * factor['apparent_distance']
        self.beta = np.array([value['beta_x'],
                              value['beta_y'],
                              value['beta_z']]) * factor['beta']
        self.kappa = np.array([value['kappa_x'],
                               value['kappa_y'],
                               value['kappa_z']]) * factor['kappa']
        self.mbeta = np.array([value['mbeta_x'],
                               value['mbeta_y'],
                               value['mbeta_z']]) * factor['mbeta']
        self.mkappa = np.array([value['mkappa_x'],
                                value['mkappa_y'],
                                value['mkappa_z']]) * factor['mkappa']
        self.radiusspec = value['radius'] * factor['radius']
        self.focalshift = focalshift or value['focal_shift']
        self.name = name or 'OT Investigator and Calibrator Height ' \
                            'Calibration file originally loaded from \n    ' \
                            '%s' % (self.filename)

def read_pyotic_hc_result(filename):
    pars = cfg.read_cfg_file(filename)

    ureg = pint.UnitRegistry()

    results = pars['RESULTS']
    units = pars['UNITS']

    values = {}
    for key, value in results.items():
        try:
            values[key] = float(value)
        except:
            values[key] = value

    factors = {}
    factors['radius'] = ureg(units['radius']).to('m').magnitude
    factors['apparent_distance'] \
        = ureg(units['apparent_distance']).to('m').magnitude
    factors['beta'] = ureg(units['beta']).to('m/V').magnitude
    factors['mbeta'] = ureg(units['mbeta']).to('m/(V*m)').magnitude
    factors['kappa'] = ureg(units['kappa']).to('N/m').magnitude
    factors['mkappa'] = ureg(units['mkappa']).to('N/(m*m)').magnitude

    return values, factors

class PyOTICSource(CalibrationSource):
    def __init__(self, heightcalibration, focalshift=0.785, name=None,
                 **kwargs):
        self.hc = heightcalibration

        self.name = name or 'OT Investigator and Calibrator Height Calibration'

    @property
    def corrfactor(self):
        return self.hc.height_fit_results.corr
        # value['correction_factor']

    @property
    def dsurf(self):
        return self.hc.height_fit_results.h0
        # value['apparent_surface_distance']
        # * ureg(units['apparent_distance']).to('m').magnitude

    @property
    def beta(self):
        hfr = self.hc.height_fit_results
        return np.array([hfr.beta_x, hfr.beta_y, hfr.beta_z])
        # * ureg(units['beta']).to('m/V').magnitude

    @property
    def kappa(self):
        hfr = self.hc.height_fit_results
        return np.array([hfr.kappa_x, hfr.kappa_y, hfr.kappa_z])
        # * ureg(units['kappa']).to('N/m').magnitude

    @property
    def mbeta(self):
        hfr = self.hc.height_fit_results
        return np.array([hfr.mbeta_x, hfr.mbeta_y, hfr.mbeta_z])
        # * ureg(units['mbeta']).to('m/(V*m)').magnitude

    @property
    def mkappa(self):
        hfr = self.hc.height_fit_results
        return np.array([hfr.mkappa_x, hfr.mkappa_y, hfr.mkappa_z])
        # * ureg(units['mkappa']).to('N/(m*m)').magnitude

    @property
    def radiusspec(self):
        return self.hc.height_fit_results.radius
        # value['radius']
        # * ureg(units['radius']).to('m').magnitude

    @property
    def focalshift(self):
        return self.hc.focal_shift

class PyOTICSingleSource(CalibrationSource):
    def __init__(self, filename=None, number=1, active=True, radiusspec=None,
                 corrfactor=1.0, focalshift=None, mbeta=None, mkappa=None,
                 dsurf=0.0, name=None, **kwargs):
        if filename is None:
            raise TypeError("PyOTICSingle missing the required positional "
                            "argument 'filename'.")
        self.filename = filename
        self.number = 1
        self.active = active

        # read in the calibration data and parameters
        data, pars = read_pyotic_single_calibration(filename, number=number)

        # calculate conversion factors
        ureg = pint.UnitRegistry()
        factor = {}
        factor['radius'] = ureg(pars['radius_unit']).to('m').magnitude
        factor['beta'] \
            = ureg(pars['displacement_sensitivity_unit']).to('m/V').magnitude
        factor['kappa'] \
            = ureg(pars['trapstiffness_unit']).to('N/m').magnitude

        # extract the calibration data
        self.excited_axis = int(data['ex_axis'])
        beta_x_pc = data['beta_x_pc'] * factor['beta']
        beta_y_pc = data['beta_y_pc'] * factor['beta']
        beta_z_pc = data['beta_z_pc'] * factor['beta']
        self.beta_pc = np.array([beta_x_pc, beta_y_pc, beta_z_pc])
        beta_x_ac = data['beta_x_ac'] * factor['beta']
        beta_y_ac = data['beta_y_ac'] * factor['beta']
        beta_z_ac = data['beta_z_ac'] * factor['beta']
        self.beta_ac = np.array([beta_x_ac, beta_y_ac, beta_z_ac])
        kappa_x_pc = data['kappa_x_pc'] * factor['kappa']
        kappa_y_pc = data['kappa_y_pc'] * factor['kappa']
        kappa_z_pc = data['kappa_z_pc'] * factor['kappa']
        self.kappa_pc = np.array([kappa_x_pc, kappa_y_pc, kappa_z_pc])
        kappa_x_ac = data['kappa_x_ac'] * factor['kappa']
        kappa_y_ac = data['kappa_y_ac'] * factor['kappa']
        kappa_z_ac = data['kappa_z_ac'] * factor['kappa']
        self.kappa_ac = np.array([kappa_x_ac, kappa_y_ac, kappa_z_ac])
        if mbeta is None:
            mbeta = [0.0 for i in range(self.beta.size)]
        self.mbeta = np.array(hp.listify(mbeta))
        if mkappa is None:
            mkappa = [0.0 for i in range(self.kappa.size)]
        self.mkappa = np.array(hp.listify(mkappa))
        self.dsurf = dsurf
        self.radiusspec = radiusspec \
            or pars['specified_radius'] * factor['radius']
        self.corrfactor = corrfactor
        self.focalshift = focalshift or pars['focal_shift']
        self.name = name or 'OT Investigator and Calibrator single ' \
                            'calibration originally loaded from \n    %s' \
                            % (self.filename)

    @property
    def beta(self):
        if self.active:
            return self.beta_ac
        else:
            return self.beta_pc

    @beta.setter
    def beta(self, beta):
        print('Setting beta not supported. Instead, set the property '
              '`beta_pc` or `beta_ac`.')

    @property
    def kappa(self):
        if self.active:
            return self.kappa_ac
        else:
            return self.beta_pc

    @kappa.setter
    def kappa(self, kappa):
        print('Setting kappa not supported. Instead, set the property '
              '`kappa_pc` or `kappa_ac`.')

def read_pyotic_single_calibration(hc_datafile, hc_parafile=None, number=1):
    # Autodetermine the name of the parameterfile
    hc_parafile = hc_parafile or hc_datafile.replace('_data.dat',
                                                     '_parameters.txt')

    # read in the parameters of the calibration
    pars = cfg.read_cfg_file(hc_parafile)
    # convert strings into floats
    parameters = {}
    for key, value in pars['DEFAULT'].items():
        try:
            parameters[key] = float(value)
        except:
            parameters[key] = value

    # read in the data of the first calibration
    with open(hc_datafile) as f:
        lines = f.readlines()
        header = lines[0].split()
        calibration = lines[number].split()
    # create a dict with all the data of the calibration
    data = dict(zip(header, [float(i) for i in calibration]))

    return data, parameters


text:
package com.datatorrent.lib.io.fs;

import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import com.google.common.collect.Maps;

/**
 * An interface for classes that want to provide filtering functionality for data being written to a
 * file. Multiple filters can be chained together using the chain filter provider.
 *
 * @since 2.1.0
 */
public interface FilterStreamProvider<F extends FilterOutputStream, S extends OutputStream>
{
  public FilterStreamContext<F> getFilterStreamContext(S outputStream) throws IOException;

  public void reclaimFilterStreamContext(FilterStreamContext<F> filterStreamContext);

  abstract class SimpleFilterReusableStreamProvider<F extends FilterOutputStream, S extends OutputStream> implements FilterStreamProvider<F, S>
  {

    private transient Map<OutputStream, FilterStreamContext<F>> reusableContexts = Maps.newHashMap();
    private transient Map<FilterStreamContext<F>, OutputStream> allocatedContexts = Maps.newHashMap();

    @Override
    public FilterStreamContext<F> getFilterStreamContext(S outputStream) throws IOException
    {
      FilterStreamContext<F> streamContext = reusableContexts.remove(outputStream);
      if (streamContext == null) {
        streamContext = createFilterStreamContext(outputStream);
      }
      allocatedContexts.put(streamContext, outputStream);
      return streamContext;
    }

    @Override
    public void reclaimFilterStreamContext(FilterStreamContext<F> filterStreamContext)
    {
      OutputStream outputStream = allocatedContexts.remove(filterStreamContext);
      if (outputStream != null) {
        reusableContexts.put(outputStream, filterStreamContext);
      }
    }

    protected abstract FilterStreamContext<F> createFilterStreamContext(OutputStream outputStream) throws IOException;
  }

  /**
   * The chain filter to use for chaining multiple filters.
   * @param <S> The original output stream
   */
  public static class FilterChainStreamProvider<F extends FilterOutputStream, S extends OutputStream> implements FilterStreamProvider<F, S>
  {
    private List<FilterStreamProvider<?,?>> streamProviders = new ArrayList<FilterStreamProvider<?, ?>>();

    public Collection<FilterStreamProvider<?,?>> getStreamProviders()
    {
      return Collections.unmodifiableList(streamProviders);
    }

    public void addStreamProvider(FilterStreamProvider<?,?> streamProvider)
    {
      streamProviders.add(streamProvider);
    }

    @Override
    public FilterStreamContext<F> getFilterStreamContext(S outputStream) throws IOException
    {
      FilterChainStreamContext filterStreamContext = new FilterChainStreamContext();
      OutputStream currOutputStream = outputStream;
      for (int i = streamProviders.size() - 1; i >= 0; i-- ) {
        //for (FilterStreamProvider streamProvider : streamProviders) {
        FilterStreamProvider streamProvider = streamProviders.get(i);
        FilterStreamContext streamContext = streamProvider.getFilterStreamContext(currOutputStream);
        filterStreamContext.pushStreamContext(streamContext);
        currOutputStream = streamContext.getFilterStream();
      }
      return filterStreamContext;
    }

    @Override
    public void reclaimFilterStreamContext(FilterStreamContext<F> filterStreamContext)
    {
      FilterChainStreamContext filterChainContext = (FilterChainStreamContext)filterStreamContext;
      Collection<FilterStreamContext<?>> streamContexts = filterChainContext.getStreamContexts();
      Iterator<FilterStreamContext<?>> iterator = streamContexts.iterator();
      for (FilterStreamProvider streamProvider : streamProviders) {
        if (iterator.hasNext()) {
          streamProvider.reclaimFilterStreamContext(iterator.next());
        }
      }
    }

    private class FilterChainStreamContext extends FilterStreamContext.BaseFilterStreamContext
        implements FilterStreamContext
    {

      private List<FilterStreamContext<?>> streamContexts = new ArrayList<FilterStreamContext<?>>();

      public void pushStreamContext(FilterStreamContext<?> streamContext)
      {
        streamContexts.add(0, streamContext);
        filterStream = streamContext.getFilterStream();
      }

      public Collection<FilterStreamContext<?>> getStreamContexts()
      {
        return Collections.unmodifiableCollection(streamContexts);
      }

      @Override
      public void finalizeContext() throws IOException
      {
        for (FilterStreamContext streamContext : streamContexts) {
        //for (int i = streamContexts.size() - 1; i >= 0; i --) {
          //FilterStreamContext streamContext = streamContexts.get(i);
          streamContext.finalizeContext();
        }
      }
    }

  }
}


text:
package org.sagebionetworks.table.worker;

import com.amazonaws.services.sqs.model.Message;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.junit.MockitoJUnitRunner;
import org.mockito.stubbing.Answer;
import org.sagebionetworks.common.util.progress.ProgressCallback;
import org.sagebionetworks.repo.manager.UserManager;
import org.sagebionetworks.repo.manager.asynch.AsynchJobStatusManager;
import org.sagebionetworks.repo.manager.table.TableQueryManager;
import org.sagebionetworks.repo.model.UserInfo;
import org.sagebionetworks.repo.model.asynch.AsynchronousJobStatus;
import org.sagebionetworks.repo.model.dbo.dao.table.TableExceptionTranslator;
import org.sagebionetworks.repo.model.table.Query;
import org.sagebionetworks.repo.model.table.QueryBundleRequest;
import org.sagebionetworks.repo.model.table.QueryResultBundle;
import org.sagebionetworks.repo.model.table.TableFailedException;
import org.sagebionetworks.repo.model.table.TableStatus;
import org.sagebionetworks.repo.model.table.TableUnavailableException;
import org.sagebionetworks.workers.util.aws.message.RecoverableMessageException;
import org.sagebionetworks.workers.util.semaphore.LockUnavilableException;
import org.springframework.test.util.ReflectionTestUtils;

import static org.junit.Assert.fail;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

@RunWith(MockitoJUnitRunner.class)
public class TableQueryWorkerTest {

	@Mock
	private AsynchJobStatusManager mockAsynchJobStatusManager;
	@Mock
	private TableQueryManager mockTableQueryManager;
	@Mock
	private UserManager mockUserManger;
	@Mock
	TableExceptionTranslator mockTableExceptionTranslator;

	@Mock
	ProgressCallback mockProgressCallback;

	TableQueryWorker worker;

	Long userId;
	UserInfo userInfo;
	QueryBundleRequest request;
	AsynchronousJobStatus status;
	String jobId;
	Message message;

	QueryResultBundle results;

	RuntimeException translatedException;

	@Before
	public void before() throws Exception {
		worker = new TableQueryWorker();
		ReflectionTestUtils.setField(worker, "asynchJobStatusManager", mockAsynchJobStatusManager);
		ReflectionTestUtils.setField(worker, "tableQueryManager", mockTableQueryManager);
		ReflectionTestUtils.setField(worker, "userManger", mockUserManger);
		ReflectionTestUtils.setField(worker, "tableExceptionTranslator", mockTableExceptionTranslator);

		userId = 987L;
		userInfo = new UserInfo(false);
		userInfo.setId(userId);
		when(mockUserManger.getUserInfo(userId)).thenReturn(userInfo);

		Query query = new Query();
		query.setSql("select * from syn123");
		request = new QueryBundleRequest();
		request.setQuery(query);

		jobId = "1";
		status = new AsynchronousJobStatus();
		status.setJobId(jobId);
		status.setRequestBody(request);
		status.setStartedByUserId(userId);

		message = new Message();
		message.setBody(jobId);
		when(mockAsynchJobStatusManager.lookupJobStatus(jobId)).thenReturn(status);

		results = new QueryResultBundle();

		when(mockTableQueryManager.queryBundle(mockProgressCallback, userInfo, request)).thenReturn(results);

		doAnswer(new Answer<RuntimeException>() {

			@Override
			public RuntimeException answer(InvocationOnMock invocation) throws Throwable {
				Throwable exception = (Throwable) invocation.getArguments()[0];
				translatedException = new RuntimeException("translated",exception);
				return translatedException;
			}
		}).when(mockTableExceptionTranslator).translateException(any(Throwable.class));

	}

	@Test
	public void testBasicQuery() throws Exception {
		// call under test
		worker.run(mockProgressCallback, message);
		verify(mockAsynchJobStatusManager).setComplete(jobId, results);
	}

	@Test
	public void testTableUnavailableException() throws Exception {
		// table not available
		when(mockTableQueryManager.queryBundle(mockProgressCallback, userInfo, request)).thenThrow(new TableUnavailableException(new TableStatus()));
		try {
			// call under test
			worker.run(mockProgressCallback, message);
			fail();
		} catch (RecoverableMessageException e) {
			// expected
		}
		verify(mockAsynchJobStatusManager).updateJobProgress(eq(jobId), any(Long.class),  any(Long.class), anyString());
	}

	@Test
	public void testLockUnavilableExceptionException() throws Exception {
		// table not available
		when(mockTableQueryManager.queryBundle(mockProgressCallback, userInfo, request)).thenThrow(new LockUnavilableException());
		try {
			// call under test
			worker.run(mockProgressCallback, message);
			fail();
		} catch (RecoverableMessageException e) {
			// expected
		}
		verify(mockAsynchJobStatusManager).updateJobProgress(eq(jobId), any(Long.class),  any(Long.class), anyString());
	}

	@Test
	public void testTableFailedExceptionException() throws Exception {
		TableFailedException exception = new TableFailedException(new TableStatus());
		// table not available
		when(mockTableQueryManager.queryBundle(mockProgressCallback, userInfo, request)).thenThrow(exception);
		// call under test
		worker.run(mockProgressCallback, message);
		verify(mockAsynchJobStatusManager).setJobFailed(jobId, exception);
	}

	@Test
	public void testUnknownException() throws Exception {
		RuntimeException error = new RuntimeException("Bad stuff happened");
		// table not available
		when(mockTableQueryManager.queryBundle(mockProgressCallback, userInfo, request)).thenThrow(error);
		try {
			// call under test
			worker.run(mockProgressCallback, message);
			fail();
		} catch (Throwable e) {
			// expected
		}
		// the exception should be translated.
		verify(mockTableExceptionTranslator).translateException(error);
		// The translated exception should be set
		verify(mockAsynchJobStatusManager).setJobFailed(jobId, translatedException);
	}
}


text:
the scraper gathering the product data for surfactory

## how to use
```
npm install
npm start
bin/publish
```


text:
import _ from 'lodash';
import UtilizationView from '../utilization-view';

function EmployeeNodeManager(options) {
  _.extend(this, options);
  this._children = [];
}

_.extend(EmployeeNodeManager.prototype, {
  render({firstIndex, lastIndex, direction}) {
    // Map our indices
    var indices = this._mapIndices({firstIndex, lastIndex});
    firstIndex = indices.firstIndex;
    lastIndex = indices.lastIndex;

    // When the indices are the same, it means that we should
    // render nothing. So we clear shop and return.
    if (firstIndex === lastIndex) {
      this.clear();
      this._firstIndex = firstIndex;
      this._lastIndex = lastIndex;
      return;
    }

    // Subtract the last index
    lastIndex -= 1;

    // Nothing to update if the indices are unchanged
    if (firstIndex === this._firstIndex && lastIndex === this._lastIndex) {
      return;
    }

    var backwardDelta, forwardDelta, addDelta, removeDelta, referenceIndex, clear, currentSize;

    if (!_.isUndefined(this._firstIndex)) {
      backwardDelta = Math.abs(this._firstIndex - firstIndex);
      forwardDelta = Math.abs(this._lastIndex - lastIndex);
      removeDelta = direction > 0 ? backwardDelta : forwardDelta;
      addDelta = direction > 0 ? forwardDelta : backwardDelta;
      currentSize = this._lastIndex - this._firstIndex + 1;
    }

    if (!_.isUndefined(removeDelta) && removeDelta < currentSize) {
      referenceIndex = direction > 0 ? this._lastIndex : this._firstIndex;
      // Correct our index according to the direction that we're moving in. This
      // won't go over our limits because we check for the size of the `addDelta`, which
      // is determined by maths up in the AxisView, before we ever use this value.
      referenceIndex += direction;
      clear = false;
      this._removeNodes({direction, removeDelta});
    }

    else {
      clear = true;
      referenceIndex = firstIndex;
      direction = 1;
      addDelta = lastIndex - firstIndex + 1;
    }

    // Always check to see if we need to add nodes
    this._addNodes({
      direction,
      addDelta,
      clear,
      referenceIndex
    });

    this._firstIndex = firstIndex;
    this._lastIndex = lastIndex;
  },

  // Deletes all of the nodes
  clear() {
    _.each(this._children, c => {
      c.el.remove();
    });
    this._children = [];
    // Reset our indices so that the next render is a fresh one
    this._firstIndex = undefined;
    this._lastIndex = undefined;
  },

  // These indices keep track of where we begin and end
  _firstIndex: undefined,
  _lastIndex: undefined,

  _removeNodes({direction, removeDelta}) {
    // If we have no nodes, then there's nothing to remove!
    if (!this._children.length) { return; }

    var targetIndex, relativeIndex;
    _.times(removeDelta, n => {
      n = direction > 0 ? 0 : this._children.length - 1;
      // Remove the node from the page
      this._children[n].el.remove();
      // Remove the view from the children array
      this._children.splice(targetIndex, 1);
    });
  },

  _addNodes({direction, addDelta, referenceIndex, clear}) {
    if (!addDelta) { return; }

    // If we need to clear house, then we do so
    if (clear) {
      this.clear();
    }

    var fragment = document.createDocumentFragment();
    var view, absoluteIndex;
    _.times(addDelta, n => {
      // When we're prepending the nodes, we need to add them in reverse order.
      // Note that because `n` is 0-indexed, and `addDelta` is not, we must
      // correct the value by subtracting 1
      if (direction < 0) {
        n = addDelta - n - 1;
      }

      absoluteIndex = referenceIndex + (n * direction);
      view = this._createChildView(absoluteIndex);
      this._children.push(view);
      fragment.appendChild(view.el);
    });

    if (direction > 0) {
      this.el.appendChild(fragment);
    } else {
      this.el.insertBefore(fragment, this.el.firstChild);
    }
  },

  // The indices that we get from ManagerManager are not mapped to our utilization
  // space. This does that using Lodash's binary search algorithms.
  _mapIndices({firstIndex, lastIndex}) {
    var utilizations = this.employee.utilizations;
    var firstUtilizationIndex = _.sortedIndex(utilizations, {
      bottomIndex: firstIndex
    }, 'bottomIndex');
    var lastUtilizationIndex = _.sortedLastIndex(utilizations, {
      topIndex: lastIndex
    }, 'topIndex');

    return {
      firstIndex: firstUtilizationIndex,
      lastIndex: lastUtilizationIndex
    };
  },

  _createChildView(index) {
    var utilization = this.employee.utilizations[index];
    return new UtilizationView(utilization, this.index);
  }
});

export default EmployeeNodeManager;


text:
package com.facebook.buck.rules.coercer;

import com.facebook.buck.core.rulekey.AddToRuleKey;
import com.facebook.buck.core.rulekey.AddsToRuleKey;
import com.facebook.buck.core.util.immutables.BuckStyleImmutable;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.google.common.collect.ImmutableMap;
import java.util.Optional;
import org.immutables.value.Value;

/**
 * Manifest entries to be injected into the AndroidManifest.xml file via AAPT command line flags.
 */
@JsonDeserialize(as = ManifestEntries.class)
@Value.Immutable
@BuckStyleImmutable
abstract class AbstractManifestEntries implements AddsToRuleKey {
  @Value.Parameter
  @AddToRuleKey
  protected abstract Optional<Integer> getMinSdkVersion();

  @Value.Parameter
  @AddToRuleKey
  protected abstract Optional<Integer> getTargetSdkVersion();

  @Value.Parameter
  @AddToRuleKey
  protected abstract Optional<Integer> getVersionCode();

  @Value.Parameter
  @AddToRuleKey
  protected abstract Optional<String> getVersionName();

  @Value.Parameter
  @AddToRuleKey
  protected abstract Optional<Boolean> getDebugMode();

  @Value.Parameter
  @AddToRuleKey
  protected abstract Optional<ImmutableMap<String, String>> getPlaceholders();

  /** @return true if and only if at least one of the parameters is non-absent. */
  public boolean hasAny() {
    return getMinSdkVersion().isPresent()
        || getTargetSdkVersion().isPresent()
        || getVersionName().isPresent()
        || getVersionCode().isPresent()
        || getDebugMode().isPresent()
        || getPlaceholders().isPresent();
  }

  /** @return an empty (all items set to Optional.empty()) ManifestEntries */
  public static ManifestEntries empty() {
    return ManifestEntries.builder().build();
  }
}


text:
% Calculates the far field of the harmonics in a specified plane.
%
% Arguments:
%   xv - row array of x values for the input plane, in mm
%   yv - row array of y values for the input plane, in mm
%   z_U - z position of the input plane, in mm
%   omega - the angular frequency axis for the input field, in scaled atomic
%           units, i.e. in multiples of the driving field angular frequency
%   U - the complex field amplitude at the input z plane for each value of
%       omega; the array shape is length(yv) x length(xv) x C x length(omega),
%       where C is the number of electric field components which must be
%       smaller than 3. The field amplitude must be given in conventional
%       coordinates, not in co-moving ones, and in scaled atomic units.
%   config - struct() of following fields:
%     config.wavelength - driving field wavelength in millimeters
%     config.plane_x - x component a of output meshgrid
%     config.plane_y - y component a of output meshgrid
%     config.padding_x (optional) - if specified, the input data is zero padded
%                                   in x direction to cover the interval
%                                   (start,end); format is [start, end].
%     config.padding_y (optional) - if specified, the input data is zero padded
%                                   in y direction to cover the interval
%                                   (start, end); format is [start, end].
%     config.plane_theta (optional) - rotation of output plane around x axis
%     config.plane_phi (optional) - rotation of output plane around y axis
%     config.plane_psi (optional) - rotation of output plane around z axis
%     config.plane_distance - distance of output plane from origin (focus)
%     config.nochecks (optional) - by default, it is checked whether padding is
%                                  sufficient by comparing phases of adjacent
%                                  points in Fourier space; with nochecks=1,
%                                  these checks can be disabled for better
%                                  performance
%
% Return values:
%   E_plane - complex field amplitude in the output plane for each value of
%       omega and each electric field component; the array shape is
%          length(omega) x C x size(config.plane_y,1) x size(config.plane_x,2)
%       The output is in scaled atomic units.
%
% Example:
%   see PDF documentation

function [E_plane] = hhgmax_farfield(xv,yv,z_U,omega,U, config)

% setup rotation matrix R for screen plane
R = eye(3);
degree = pi/180;

if isfield(config,'plane_theta') % rotation around x axis
  s = sin(config.plane_theta*degree);
  c = cos(config.plane_theta*degree);
  R = R * [1 0 0; 0 c s; 0 -s c];
end

if isfield(config,'plane_phi') % rotation around y axis
  s = sin(config.plane_phi*degree);
  c = cos(config.plane_phi*degree);
  R = R * [c 0 -s; 0 1 0; s 0 c];
end

if isfield(config,'plane_psi') % rotation around z axis
  s = sin(config.plane_psi*degree);
  c = cos(config.plane_psi*degree);
  R = R * [c s 0; -s c 0; 0 0 1];
end

% check xv and yv
if size(xv,2)~=length(xv)
  error('xv must be a row vector')
end
if size(yv,2)~=length(yv)
  error('yv must be a row vector')
end

% apply zero padding to xv and yv axes
dx = xv(2) - xv(1);
dy = yv(2) - yv(1);

if isfield(config,'padding_x')
  x1 = config.padding_x(1);
  x2 = config.padding_x(2);
  assert(x1<xv(1) && x2>xv(end))

  before = fliplr( xv(1):-dx:x1 );
  after = xv(1):dx:x2;
  x_i_start = length(before);
  x_i_end = length(before)+length(xv)-1;
  xv = [before, after(2:end)];
else
  x_i_start = 1;
  x_i_end = length(xv);
end

if isfield(config,'padding_y')
  y1 = config.padding_y(1);
  y2 = config.padding_y(2);
  assert(y1<yv(1) && y2>yv(end))

  before = fliplr( yv(1):-dy:y1 );
  after = yv(1):dy:y2;
  y_i_start = length(before);
  y_i_end = length(before)+length(yv)-1;
  yv = [before, after(2:end)];
else
  y_i_start = 1;
  y_i_end = length(yv);
end

% setup reciprocal space axes and use them to construct a meshgrid
dkx = 2*pi/dx/length(xv);
dky = 2*pi/dy/length(yv);

temp = fftshift(0:length(xv)-1);
temp(temp>=temp(1)) = temp(temp>=temp(1)) - length(xv);
kxv = temp * dkx;

temp = fftshift(0:length(yv)-1);
temp(temp>=temp(1)) = temp(temp>=temp(1)) - length(yv);
kyv = temp * dky;

[kx, ky] = meshgrid(kxv, kyv);

% configure discretization checks
if isfield(config,'nochecks') && config.nochecks
  nochecks = config.nochecks;
  warning('Discretization checks are disabled.');
else
  nochecks = 0;
end

% compute the position of the plane's meshgrid points in 3d coordinate system
x = R(1,1)*config.plane_x + R(1,2)*config.plane_y + R(1,3)*config.plane_distance;
y = R(2,1)*config.plane_x + R(2,2)*config.plane_y + R(2,3)*config.plane_distance;
z = R(3,1)*config.plane_x + R(3,2)*config.plane_y + R(3,3)*config.plane_distance - z_U;
r = sqrt(x.^2 + y.^2 + z.^2);

% get number of electric field components
C = size(U,3);
if C>2
  error('Far field of 3-dimensionally polarized fields not supported.');
end

% preallocate memory for output
E_plane = zeros([length(omega) C size(config.plane_x)]);

for omega_i=1:length(omega)
  disp(['farfield: processing frequency ' num2str(omega(omega_i)) ' (' num2str(omega_i) '/' num2str(length(omega)) ')']);

  for component=1:C
    k = 2*pi/config.wavelength * omega(omega_i);

    % apply zero padding to data
    U_padded = zeros([length(yv) length(xv)]);
    U_padded(y_i_start:y_i_end, x_i_start:x_i_end) = squeeze(U(:,:,component,omega_i));

    % calculate 2d Fourier transformation of harmonic field, with centered zero
    % value in both reciprocal and original space
    F = fftshift(fft2(ifftshift( U_padded ))) * dx/2/pi * dy/2/pi;

    % check if phase oscillates too fast in reciprocal space
    if ~nochecks
      anglediff_x = zeros(size(F));
      anglediff_x(1:end,2:end) = diff(angle(F),1,2);
      normalized_anglediff_x = angle(exp(i*anglediff_x)); % normalize to -pi to pi interval

      anglediff_y = zeros(size(F));
      anglediff_y(2:end,1:end) = diff(angle(F),1,1);
      normalized_anglediff_y = angle(exp(i*anglediff_y)); % normalize to -pi to pi interval

      intensity = abs(F).^2;
      max_intensity = max(max(max(intensity)));
      significant = (intensity > 0.05*max_intensity);

      significant_anglediff_x = normalized_anglediff_x .* significant; % discard phase differences for low amplitudes
      significant_anglediff_y = normalized_anglediff_y .* significant; % discard phase differences for low amplitudes

      max_anglediff_x = max(max(abs(significant_anglediff_x)));
      max_anglediff_y = max(max(abs(significant_anglediff_y)));

      if max_anglediff_x > 0.33*pi
        warning(['The phase difference between two k_x values is too big: ',...
                 num2str(max_anglediff_x/pi), '*pi at omega=', num2str(omega(omega_i)),'. '...
                 'Use (more) zero padding in x direction to make sure that interpolation in reciprocal space works.']);
      end

      if max_anglediff_y > 0.33*pi
        warning(['The phase difference between two k_y values is too big: ',...
                 num2str(max_anglediff_y/pi), '*pi at omega=', num2str(omega(omega_i)),'. ',...
                 'Use (more) zero padding in y direction to make sure that interpolation in reciprocal space works.']);
      end
    end

    % (2.2) from http://en.wikipedia.org/w/index.php?title=Fourier_optics&oldid=557985220#The_far_field_approximation_and_the_concept_of_angular_bandwidth
    % but with different signs because we use the exp(ikr-iwt) convention
    E_plane(omega_i,component,:,:) = -2*pi*1i * k*z./r .* exp(i*k*r)./r ...
                                   .* interp2(kx,ky,F, x./r*k, y./r*k);
  end
end


text:
import * as csx from '../../../base/csx';
import {cssRule} from 'typestyle';

// Base Colors
export let primaryHighlightColor = '#0AA1C6';
export let secondaryHighlightColor = '#CF1F5F';
export let primaryBackgroundColor = '#1E1E1E'
export let secondaryBackgroundColor = '#252526'

export let primaryTextColor = '#BBBBBB';

export let errorColor = '#CF1F5F';
export let warningColor = '#938816'; // Color from CodeMirror `lint.css` warning squiggly color
export let successColor = '#88CF00';

// Tree
export let selectedTreeBackgroundColor = '#3f3f46';

// Editor
export let monokaiBackgroundColor = primaryBackgroundColor;
export let monokaiTextColor = primaryTextColor;

// Tabs
export let tabHeaderBackgroundColor = '#000000';
export let tabActiveBackgroundColor = '#1e1e1e';
export let tabBackgroundColor = '#2d2d2d';
export let tabActiveTextColor = '#EDEDED';
export let tabTextColor = '#959595';
export let tabBorderColor = '#403f3f'

/**
 * FA Icon names used in the application
 */
export const icons = {
    tested: 'futbol-o',
    testedSuite: 'pagelines', // http://fontawesome.io/icon/pagelines/
    testedTest: 'leaf',// http://fontawesome.io/icon/leaf/
}

/**
 * A background color that looks nice over the "editor" background black
 */
export const blackHighlightColor = "#1C1D18"

/**
 * If you expect a child to scroll you need to tell it that I will not give you a scroll bar
 */
export var someChildWillScroll: NestedCSSProperties = {
    overflow: 'hidden'
}

export var tabHeaderContainer = {
    background: 'grey'
}

export var tabHeader = {
    fontSize: '.8em',
    fontFamily: 'Roboto, sans-serif',
    fontWeight: 'bold',
    paddingLeft: '10px',
    paddingRight: '10px',
    paddingTop: '5px',
    paddingBottom: '5px',
    background: "rgb(66, 66, 66)",
    color: "rgb(150,150,150)",
    borderLeft: '6px solid rgb(88, 88, 88)',
    cursor: 'pointer',
    userSelect: 'none',
    transition: "color .5s, border-left .5s, background .5s"
};

export var tabHeaderActive = {
    color: primaryHighlightColor,
    borderLeft: `6px solid ${primaryHighlightColor}`,
};

export var tabHeaderUnsaved = {
    background: "#777",
};

export let fullWindow = {
    position: 'absolute',
    left: '10px',
    right: '10px',
    top: '10px',
    bottom: '10px',
};

export let padded1 = {
    padding: '.25rem'
};
export let padded1TopBottom = {
    paddingTop: padded1.padding,
    paddingBottom: padded1.padding
};
export let padded1LeftRightBottom = {
    paddingLeft: padded1.padding,
    paddingRight: padded1.padding,
    paddingBottom: padded1.padding
};
export let padded2 = {
    padding: '.5rem'
};

export let fullSize = {
    width: '100%',
    height: '100%',
}

const statusBarHeight = 25;
export let statusBar = {
    height: `${statusBarHeight}px`,
    color: '#999',
    paddingLeft: '3px',
    paddingRight: '3px',
    fontSize: '12px',
    border: '1px solid #999',
}
export let statusBarSection = {
    paddingLeft: '3px',
    paddingRight: '3px',
}
export let statusBarError = {
    color: errorColor
}
export let statusBarSuccess = {
    color: successColor
}

export var noSelect = {
    userSelect: 'none',
    cursor: 'default'
}

export let hand = {
    cursor: 'pointer',
}

export let noWrap = {
    whiteSpace: 'nowrap',
}

export let codeFont = {
    fontFamily: 'monospace'
}

export namespace errorsPanel {
    export let success = {
        color: successColor
    }
    export let main = {
        color: primaryTextColor,
        fontFamily: codeFont.fontFamily,
        padding: '6px',
        overflow: 'hidden',
        display: 'flex',
        flexDirection: 'column'
    }

    export const headerSection = {
        flexShrink: 0,
        marginBottom: '5px',
    }

    export const tooMany = {
        fontSize: '1.2rem',
        fontWeight: 'bolder',
    }

    export let filePath = {
        fontSize: '1rem',
        fontWeight: 'bold',
        padding: '8px 8px 8px 0px',
        cursor: hand.cursor,
    }

    export let perFileList = {
    }

    const itemDetailsContainer = csx.extend(
        hand, {
            padding: '3px'
        }
    );
    export let errorDetailsContainer = csx.extend(
        itemDetailsContainer,
        {
            borderLeft: '6px solid ' + errorColor

        }
    );
    export let warningDetailsContainer = csx.extend(
        itemDetailsContainer,
        {
            borderLeft: '6px solid ' + warningColor
        }
    );

    export let errorDetailsContent = {
        padding: '3px',
    }
    export let errorMessage = {
        paddingBottom: '3px',
        cursor: 'pointer',
        userSelect: 'none',
    }

    export let errorPreview = {
        padding: '3px',
        background: 'black',
        border: '2px solid #999',
        cursor: 'pointer',
    }
}

/**
 * Used by all our modals
 */
export namespace modal {
    /** Keyboard shortcuts */
    export var keyStrokeStyle = {
        fontSize: '0.9rem',
        background: '#111',
        paddingTop: '1px',
        paddingBottom: '1px',
        paddingLeft: '4px',
        paddingRight: '4px',
        borderRadius: '5px',
        border: '2px solid'
    };

    /** Big input */
    export let inputStyleBase = {
        backgroundColor: 'rgb(42,42,42)',
        color: 'white',
        outline: 'none',
        padding: '2px',
        fontSize: '1.5rem',
        lineHeight: '2rem',
        fontFamily: 'monospace',

        border: '3px solid #3C3C3C',
        transition: 'border .2s',
        '&:focus':{
            boxShadow: '0px 0px 1px 1px #3C3C3C'
        }
    }

    /** The container around code samples */
    export let previewContainerStyle = {
        background: tabHeader.background,
        padding: '5px',
    }
}

/** Sometimes we need a keyboard input to handle our keyboard events but not be visible in any way */
export let hiddenInput = {
    height: '0px',
    width: '0px',
    color: 'transparent',
    background: 'transparent',
    position: 'absolute',
    top: '0px'
}

export namespace Input {
    export let inputBlackStyleBase = {
        backgroundColor: '#333',
        color: 'white',
        outline: 'none',
        padding: '2px',
        border: '2px solid #3C3C3C',
        transition: 'border .2s',
        '&:focus':{
            border: '2px solid #0099E0',
            boxShadow: '0px 0px 1px 1px #0099E0'
        }
    }
}

/**
 * Some views have tips at the bottom. This for that
 */
export namespace Tip {
    export const root = csx.extend({
        color: 'grey',
        lineHeight: '1.5rem',
        fontSize: '.8rem',
    }, padded1);

    export const keyboardShortCutStyle = {
        border: '2px solid',
        borderRadius: '6px',
        padding: '2px',
        backgroundColor: 'black',
    }
}

/**
 * For when you don't want anything on focus
 */
export const noFocusOutlineBase = {
    "&:focus":{
        outline: 'none'
    }
}

/**
 * When you want text ellipsis
 * Note: whitespace no wrap is significant
 * Note: you probably want a limited width on the parent
 */
export const ellipsis = {
    overflow: 'hidden',
    textOverflow: 'ellipsis',
    whiteSpace: 'nowrap'
}

/**
 * body bg
 */

cssRule('body',{ backgroundColor: primaryBackgroundColor + ' !important'})

/**
 * Scroll bar for chrome
 */

cssRule('::-webkit-scrollbar',{ width: '8px', height: '8px' })
cssRule('::-webkit-scrollbar-track',{ backgroundColor: 'transparent' })
cssRule('::-webkit-scrollbar-thumb',{ background: 'rgba(121, 121, 121, .2)',
        border: '0px none #ffffff',
        borderRadius: '0px',
         })
cssRule('::-webkit-scrollbar-thumb:hover',{background: 'rgba(121, 121, 121, .5)'})
cssRule('::-webkit-scrollbar-corner',{ background: 'transparent' })


text:
The `Menu` class is used to create native menus that can be used as
application menu and context menu. Each menu is consisted of multiple menu
items, and each menu item can have a submenu.

An example of creating a menu dynamically and show it when user right clicks
the page:

```javascript
var Menu = require('menu');
var MenuItem = require('menu-item');

var menu = new Menu();
menu.append(new MenuItem({ label: 'MenuItem1', click: function() { console.log('item 1 clicked'); } }));
menu.append(new MenuItem({ type: 'separator' }));
menu.append(new MenuItem({ label: 'MenuItem2', type: 'checkbox', clicked: true }));

window.addEventListener('contextmenu', function (e) {
  e.preventDefault();
  menu.popup();
}, false);
```

Another example of creating the application menu with the simple template API:

```javascript
var template = [
  {
    label: 'Atom Shell',
    submenu: [
      {
        label: 'About Atom Shell',
        selector: 'orderFrontStandardAboutPanel:'
      },
      {
        type: 'separator'
      },
      {
        label: 'Hide Atom Shell',
        accelerator: 'Command+H',
        selector: 'hide:'
      },
      {
        label: 'Hide Others',
        accelerator: 'Command+Shift+H',
        selector: 'hideOtherApplications:'
      },
      {
        label: 'Show All',
        selector: 'unhideAllApplications:'
      },
      {
        type: 'separator'
      },
      {
        label: 'Quit',
        accelerator: 'Command+Q',
        click: function() { app.quit(); }
      },
    ]
  },
  {
    label: 'Edit',
    submenu: [
      {
        label: 'Undo',
        accelerator: 'Command+Z',
        selector: 'undo:'
      },
      {
        label: 'Redo',
        accelerator: 'Shift+Command+Z',
        selector: 'redo:'
      },
      {
        type: 'separator'
      },
      {
        label: 'Cut',
        accelerator: 'Command+X',
        selector: 'cut:'
      },
      {
        label: 'Copy',
        accelerator: 'Command+C',
        selector: 'copy:'
      },
      {
        label: 'Paste',
        accelerator: 'Command+V',
        selector: 'paste:'
      },
      {
        label: 'Select All',
        accelerator: 'Command+A',
        selector: 'selectAll:'
      },
    ]
  },
  {
    label: 'View',
    submenu: [
      {
        label: 'Reload',
        accelerator: 'Command+R',
        click: function() { BrowserWindow.getFocusedWindow().reloadIgnoringCache(); }
      },
      {
        label: 'Toggle DevTools',
        accelerator: 'Alt+Command+I',
        click: function() { BrowserWindow.getFocusedWindow().toggleDevTools(); }
      },
    ]
  },
  {
    label: 'Window',
    submenu: [
      {
        label: 'Minimize',
        accelerator: 'Command+M',
        selector: 'performMiniaturize:'
      },
      {
        label: 'Close',
        accelerator: 'Command+W',
        selector: 'performClose:'
      },
      {
        type: 'separator'
      },
      {
        label: 'Bring All to Front',
        selector: 'arrangeInFront:'
      },
    ]
  },
];

menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);
```

## Class: Menu

### new Menu()

Creates a new menu.

### Class Method: Menu.setApplicationMenu(menu)

* `menu` Menu

Sets `menu` as the application menu.

**Note:** This method is OS X only.

### Class Method: Menu.sendActionToFirstResponder(action)

* `action` String

Sends the `action` to the first responder of application, this is used for
emulating default Cocoa menu behaviors, usually you would just use the
`selector` property of `MenuItem`.

**Note:** This method is OS X only.

### Class Method: Menu.buildFromTemplate(template)

* `template` Array

Generally, the `template` is just an array of `options` for constructing
`MenuItem`, the usage can be referenced above.

You can also attach other fields to element of the `template`, and they will
become properties of the constructed menu items.

### Menu.popup(browserWindow)

* `browserWindow` BrowserWindow

Popups the this as context menu in the `browserWindow`.

### Menu.append(menuItem)

* `menuItem` MenuItem

Appends the `menuItem` to the menu.

### Menu.insert(pos, menuItem)

* `pos` Integer
* `menuItem` MenuItem

Inserts the `menuItem` to the `pos` position of the menu.

### Menu.items

Get the array containing the menu's items.


text:
module API
  class ProjectContainerRepositories < Grape::API
    include PaginationParams

    REPOSITORY_ENDPOINT_REQUIREMENTS = API::NAMESPACE_OR_PROJECT_REQUIREMENTS.merge(
      tag_name: API::NO_SLASH_URL_PART_REGEX)

    before { error!('404 Not Found', 404) unless Feature.enabled?(:container_registry_api, user_project, default_enabled: true) }
    before { authorize_read_container_images! }

    params do
      requires :id, type: String, desc: 'The ID of a project'
    end
    resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
      desc 'Get a project container repositories' do
        detail 'This feature was introduced in GitLab 11.8.'
        success Entities::ContainerRegistry::Repository
      end
      params do
        use :pagination
        optional :tags, type: Boolean, default: false, desc: 'Determines if tags should be included'
      end
      get ':id/registry/repositories' do
        repositories = ContainerRepositoriesFinder.new(
          id: user_project.id, container_type: :project
        ).execute

        present paginate(repositories), with: Entities::ContainerRegistry::Repository, tags: params[:tags]
      end

      desc 'Delete repository' do
        detail 'This feature was introduced in GitLab 11.8.'
      end
      params do
        requires :repository_id, type: Integer, desc: 'The ID of the repository'
      end
      delete ':id/registry/repositories/:repository_id', requirements: REPOSITORY_ENDPOINT_REQUIREMENTS do
        authorize_admin_container_image!

        DeleteContainerRepositoryWorker.perform_async(current_user.id, repository.id)

        status :accepted
      end

      desc 'Get a list of repositories tags' do
        detail 'This feature was introduced in GitLab 11.8.'
        success Entities::ContainerRegistry::Tag
      end
      params do
        requires :repository_id, type: Integer, desc: 'The ID of the repository'
        use :pagination
      end
      get ':id/registry/repositories/:repository_id/tags', requirements: REPOSITORY_ENDPOINT_REQUIREMENTS do
        authorize_read_container_image!

        tags = Kaminari.paginate_array(repository.tags)
        present paginate(tags), with: Entities::ContainerRegistry::Tag
      end

      desc 'Delete repository tags (in bulk)' do
        detail 'This feature was introduced in GitLab 11.8.'
      end
      params do
        requires :repository_id, type: Integer, desc: 'The ID of the repository'
        requires :name_regex, type: String, desc: 'The tag name regexp to delete, specify .* to delete all'
        optional :keep_n, type: Integer, desc: 'Keep n of latest tags with matching name'
        optional :older_than, type: String, desc: 'Delete older than: 1h, 1d, 1month'
      end
      delete ':id/registry/repositories/:repository_id/tags', requirements: REPOSITORY_ENDPOINT_REQUIREMENTS do
        authorize_admin_container_image!

        message = 'This request has already been made. You can run this at most once an hour for a given container repository'
        render_api_error!(message, 400) unless obtain_new_cleanup_container_lease

        CleanupContainerRepositoryWorker.perform_async(current_user.id, repository.id,
          declared_params.except(:repository_id))

        status :accepted
      end

      desc 'Get a details about repository tag' do
        detail 'This feature was introduced in GitLab 11.8.'
        success Entities::ContainerRegistry::TagDetails
      end
      params do
        requires :repository_id, type: Integer, desc: 'The ID of the repository'
        requires :tag_name, type: String, desc: 'The name of the tag'
      end
      get ':id/registry/repositories/:repository_id/tags/:tag_name', requirements: REPOSITORY_ENDPOINT_REQUIREMENTS do
        authorize_read_container_image!
        validate_tag!

        present tag, with: Entities::ContainerRegistry::TagDetails
      end

      desc 'Delete repository tag' do
        detail 'This feature was introduced in GitLab 11.8.'
      end
      params do
        requires :repository_id, type: Integer, desc: 'The ID of the repository'
        requires :tag_name, type: String, desc: 'The name of the tag'
      end
      delete ':id/registry/repositories/:repository_id/tags/:tag_name', requirements: REPOSITORY_ENDPOINT_REQUIREMENTS do
        authorize_destroy_container_image!
        validate_tag!

        result = ::Projects::ContainerRepository::DeleteTagsService
          .new(repository.project, current_user, tags: [declared_params[:tag_name]])
          .execute(repository)

        if result[:status] == :success
          status :ok
        else
          status :bad_request
        end
      end
    end

    helpers do
      def authorize_read_container_images!
        authorize! :read_container_image, user_project
      end

      def authorize_read_container_image!
        authorize! :read_container_image, repository
      end

      def authorize_destroy_container_image!
        authorize! :destroy_container_image, repository
      end

      def authorize_admin_container_image!
        authorize! :admin_container_image, repository
      end

      def obtain_new_cleanup_container_lease
        Gitlab::ExclusiveLease
          .new("container_repository:cleanup_tags:#{repository.id}",
               timeout: 1.hour)
          .try_obtain
      end

      def repository
        @repository ||= user_project.container_repositories.find(params[:repository_id])
      end

      def tag
        @tag ||= repository.tag(params[:tag_name])
      end

      def validate_tag!
        not_found!('Tag') unless tag.valid?
      end
    end
  end
end


text:
#ifndef TYPEGRAPH_H
#define TYPEGRAPH_H

#include <string>
#include <vector>

#include <map>
#include <list>

#include "Type.h"

namespace intro
{

	/// A TypeGraph describes the subtype relations that hold in a a type system
	/**
It holds complete information about every types parent type, and any variable
		transformations required. For instance, Dictionary(?V,?K)<:Generator([key:?K;value:?V;]).

It should be remembered that opaque types provie mechanisms for adding to the type hierarchy,
		even though we can expect most opaque types to be records (and union types, when implemented).

The TypeGraph owns all types used internally, as it created them itself...

	*/
	class TypeGraph
	{
	public:
		/// Nodes represent subtype hierarchy and provide data for converting a given type to it's supertype.
		struct node
		{
			struct edge
			{
				/// Type parameters used to represent this type as a supertype, e.g. Dictionary(A,B)<:Generator([key:A;value:B;])
				/**
This vector of types, together with the type variables in my_params, describes how to turn a
					type's parameters into it's supertype's paramters (which need not be the same number),
					by using my_params to build a variable mapping for a substitution (i.e. which also creates
					a new, "copied" types which must be manually deleted after use).

To continue the Dictionary(A,B)<:Generator([key:A;value:B;]) example, for this
					my_params would the dictionary node's parameters A' and B', and super_params
					would contain one record type [key:A';value:B';].

 Given this information in the node, and a concrete use of e.g. a Dictionary(Integer,String)
					as a generator, the subtype check would build a mapping {A'=>Integer,B'=>String} which
					subtitutes the record type to [key:Integer;value:String;] which is what we need
					to continue type inference.

				*/
				std::vector<Type::pointer_t> super_params; ///< Replace with actual type of parent expressed with above variables, so that we can just copy for return value!
				Type::pointer_t parentTemplate; ///< used with this types paramter to convert a type instance to it's supertype isntance.
				node *super, *sub;
				typedef std::vector<Type::pointer_t>::iterator iterator;

				inline edge(void) : parentTemplate(NULL), super(NULL), sub(NULL)
				{};

			};

			std::wstring name; ///< Name of the type?
			size_t rank; ///< The rank is the distance from the Top type, that is the number of supertypes. Type Error has no meaningfull rank
			std::vector<Type::pointer_t > my_params;	///< Type parameters of this type, see member super_params
			bool isAbstract; ///< An abstract type does not have actual values, but has subtypes that do have values.
			Type::Types my_kind; ///< Nodes refer to the type they represent.
			typedef std::vector<edge *> edges; ///< Type for lists of edges (connections between nodes).
			typedef std::vector<Type::pointer_t >::iterator param_iter;
			typedef edges::iterator iterator; ///< An nterator tpe for edges.
			edges children; ///< Edges linking to subtypes.
			edges supers; ///< Edges linking to supertypes.

			// Convenient, not reliable
			inline node(const std::wstring &name_, Type::Types kind, bool isAbstract_ = false)
				: name(name_)
				, rank(0)
				, isAbstract(isAbstract_)
				, my_kind(kind)
			{ };

			inline ~node(void)
			{
				for (iterator iter = supers.begin(); iter != supers.end(); iter++)
					delete (*iter);
			};

			/// Set a nodes supernode and rank
			inline edge *addSuper(node *sup)
			{
				edge *e = new edge;
				e->sub = this;
				e->super = sup;
				if (rank < (sup->rank + 1)) rank = sup->rank + 1;
				supers.push_back(e);
				if (this != sup) sup->children.push_back(e);
				return e;
			};

			void print(std::wostream &os);
		};
	private:
		/// Manage opaque types by name, they are user defined so the total number os opaque types is dynamic
		std::map<std::wstring, node *> opaques;
		/// Builtins are referenced by numeric value with a static maximum, so we can use a vector (or array) for fast lookup
		std::vector<node *> builtins;

		std::list<TypeVariable *> variables;

		Type::pointer_t fresh(const std::wstring &name);
		/// Add the built in types to the type graph
		void createBuiltins(void);

	public:

		void addOpaque(Type::pointer_t opaque, Type::pointer_t super);

		TypeGraph();

		~TypeGraph();

		PartialOrder findSupertype(Type::pointer_t ta, Type::pointer_t  tb, std::vector<Type::pointer_t > &cur);

		// Find the node that represents the passed type's position in the type hierarchy, returns NULL on failure.
		node *getNode(Type::pointer_t type);

		inline bool isAbtractType(Type::pointer_t type)
		{
			node *n = getNode(type);
			return n->isAbstract;
		}

	};

}

#endif


text:
package com.jakewharton.rxbinding.view;

import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
import android.view.ViewGroup;
import rx.Observable;

/**
 * Static factory methods for creating {@linkplain Observable observables} for {@link ViewGroup}.
 */
public final class RxViewGroup {
  /**
   * Create an observable of hierarchy change events for {@code viewGroup}.
   *

   * Warning: The created observable keeps a strong reference to {@code viewGroup}. Unsubscribe
   * to free this reference.
   */
  @CheckResult @NonNull
  public static Observable<ViewGroupHierarchyChangeEvent> changeEvents(@NonNull ViewGroup viewGroup) {
    return Observable.create(new ViewGroupHierarchyChangeEventOnSubscribe(viewGroup));
  }

  private RxViewGroup() {
    throw new AssertionError("No instances.");
  }
}


text:
using namespace std;

FileMetadata::~FileMetadata() {
    // the flush has to be explicit
    // put a bigg error emssage if modified at time of destruction
    FATALIF(modified, "You should have flushed before killing the FileMetadata");

    free(relName);
}


text:
BUNDLE
------

This target is a ``CFBundle`` on the OS X.

If a module library target has this property set to true it will be
built as a ``CFBundle`` when built on the mac.  It will have the directory
structure required for a ``CFBundle`` and will be suitable to be used for
creating Browser Plugins or other application resources.


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

<title>org.springframework.jmx.export.assembler (Spring Framework 5.1.18.RELEASE API)</title>
<meta name="date" content="2020-09-15">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

org.springframework.jmx.export.assembler

Interfaces

AutodetectCapableMBeanInfoAssembler

MBeanInfoAssembler

Classes

AbstractConfigurableMBeanInfoAssembler

AbstractMBeanInfoAssembler

AbstractReflectiveMBeanInfoAssembler

InterfaceBasedMBeanInfoAssembler

MetadataMBeanInfoAssembler

MethodExclusionMBeanInfoAssembler

MethodNameBasedMBeanInfoAssembler

SimpleReflectiveMBeanInfoAssembler


text:
#pragma once
#include <aws/iot/IoT_EXPORTS.h>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace IoT
{
namespace Model
{
  class AWS_IOT_API UpdateDynamicThingGroupResult
  {
  public:
    UpdateDynamicThingGroupResult();
    UpdateDynamicThingGroupResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    UpdateDynamicThingGroupResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
The dynamic thing group version.

     */
    inline long long GetVersion() const{ return m_version; }

    /**
     *
The dynamic thing group version.

     */
    inline void SetVersion(long long value) { m_version = value; }

    /**
     *
The dynamic thing group version.

     */
    inline UpdateDynamicThingGroupResult& WithVersion(long long value) { SetVersion(value); return *this;}

  private:

    long long m_version;
  };

} // namespace Model
} // namespace IoT
} // namespace Aws


text:
/**
 * Not type checking this file because flow doesn't like attaching
 * properties to Elements.
 */

import { looseEqual, looseIndexOf } from 'shared/util'
import { warn, isAndroid, isIE9, isIE, isEdge } from 'core/util/index'

/* istanbul ignore if */
if (isIE9) {
  // http://www.matts411.com/post/internet-explorer-9-oninput/
  document.addEventListener('selectionchange', () => {
    const el = document.activeElement
    if (el && el.vmodel) {
      trigger(el, 'input')
    }
  })
}

export default {
  inserted (el, binding, vnode) {
    if (vnode.tag === 'select') {
      const cb = () => {
        setSelected(el, binding, vnode.context)
      }
      cb()
      /* istanbul ignore if */
      if (isIE || isEdge) {
        setTimeout(cb, 0)
      }
    } else if (vnode.tag === 'textarea' || el.type === 'text' || el.type === 'password') {
      el._vModifiers = binding.modifiers
      if (!binding.modifiers.lazy) {
        // Safari < 10.2 & UIWebView doesn't fire compositionend when
        // switching focus before confirming composition choice
        // this also fixes the issue where some browsers e.g. iOS Chrome
        // fires "change" instead of "input" on autocomplete.
        el.addEventListener('change', onCompositionEnd)
        if (!isAndroid) {
          el.addEventListener('compositionstart', onCompositionStart)
          el.addEventListener('compositionend', onCompositionEnd)
        }
        /* istanbul ignore if */
        if (isIE9) {
          el.vmodel = true
        }
      }
    }
  },
  componentUpdated (el, binding, vnode) {
    if (vnode.tag === 'select') {
      setSelected(el, binding, vnode.context)
      // in case the options rendered by v-for have changed,
      // it's possible that the value is out-of-sync with the rendered options.
      // detect such cases and filter out values that no longer has a matching
      // option in the DOM.
      const needReset = el.multiple
        ? binding.value.some(v => hasNoMatchingOption(v, el.options))
        : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, el.options)
      if (needReset) {
        trigger(el, 'change')
      }
    }
  }
}

function setSelected (el, binding, vm) {
  const value = binding.value
  const isMultiple = el.multiple
  if (isMultiple && !Array.isArray(value)) {
    process.env.NODE_ENV !== 'production' && warn(
      `<select multiple v-model="${binding.expression}"> ` +
      `expects an Array value for its binding, but got ${
        Object.prototype.toString.call(value).slice(8, -1)
      }`,
      vm
    )
    return
  }
  let selected, option
  for (let i = 0, l = el.options.length; i < l; i++) {
    option = el.options[i]
    if (isMultiple) {
      selected = looseIndexOf(value, getValue(option)) > -1
      if (option.selected !== selected) {
        option.selected = selected
      }
    } else {
      if (looseEqual(getValue(option), value)) {
        if (el.selectedIndex !== i) {
          el.selectedIndex = i
        }
        return
      }
    }
  }
  if (!isMultiple) {
    el.selectedIndex = -1
  }
}

function hasNoMatchingOption (value, options) {
  for (let i = 0, l = options.length; i < l; i++) {
    if (looseEqual(getValue(options[i]), value)) {
      return false
    }
  }
  return true
}

function getValue (option) {
  return '_value' in option
    ? option._value
    : option.value
}

function onCompositionStart (e) {
  e.target.composing = true
}

function onCompositionEnd (e) {
  e.target.composing = false
  trigger(e.target, 'input')
}

function trigger (el, type) {
  const e = document.createEvent('HTMLEvents')
  e.initEvent(type, true, true)
  el.dispatchEvent(e)
}


text:
function walog_writelog(logtype,entry)
global GPS WHALETIME handl
computername=getenv('COMPUTERNAME');

if ~exist('logs/','dir')
    mkdir('logs');
end;
dayfile=fopen(['logs/' datestr(now,'yyyymmdd') ' MAPS Wallog.log'],'a');
mailfile=fopen('WHALE.mail','a');
if ~exist('entry')
    output=[];
elseif ischar(entry)
    output=entry;
elseif isstruct(entry)
    output=[];
   % entry
    for f=sort(fields(entry)')
        f=char(f);
        e=entry.(f);
        if isnumeric(e), e=num2str(e);end;
        e=char(e);
        if isempty(output)
            if ~isempty(e)
                output=[f '=' e];
            else
                output=[f '='];
            end
        else
            if ~isempty(e)
                output=[output ',' f '=' e];
            else
                output=[output ',' f '='];
            end;
        end
    end;
end;
%if ~isempty(output)
%    output=[output ','];
%end
%output
%writestring=char(['timestamp=' datestr(now,31) ',event=' logtype ',' output ',' GPS.INFO]);
if isempty(GPS)
    writestring=sprintf('timestamp=%s,event=%s,computer=%s,%s,%s',datestr(now,31),logtype,computername,output,'nan');

else
    writestring=sprintf('timestamp=%s,event=%s,computer=%s,%s,%s',datestr(now,31),logtype,computername,output,GPS.INFO);
end
%writestring2=sprintf('timestamp=%s,event=%s,\n%s,\n%s',datestr(now,31),log
%type,output,GPS.INFO);
writestring=strrep(writestring,',,',',');writestring=strrep(writestring,',,',',');
if writestring(end)==',', writestring=writestring(1:end-1); end;
set(handl.display_lastsight,'String',writestring);
fprintf('%s\n',writestring);
fprintf(mailfile,'%s\n',writestring);
fprintf(dayfile,'%s\n',writestring);
fclose all;


text:
var $$_asDate = function($object, $unobstructed)
{
    // Get the object type
    var $type = $object == null ?
                $object + '' :
                $_types[$__toString__.call($object)] || 'object';

    // If the object is a boolean
    if ($type == 'boolean')
    {
        // If the boolean is not a primitive, get the primitive value of the boolean
        if (typeof $object != 'boolean')
            $object = $__boolean_valueOf__.call($object);

        // Return the date object
        return new $__date($object ? 1 : 0);
    }

    // FORMAT $unobstructed
    $unobstructed = $unobstructed !== undefined ?
                    $$_asBoolean($unobstructed) :
                    false;

    // If the unobstructed flag is set and the object is a date
    if ($unobstructed && $type == 'date')
    {
        // Create the obstructed flag
        var $obstructed = false;

        // If the date has the date prototype
        if ($__dateProto__ === $__getPrototypeOf($object))
        {
            for (var $i = 0, $j = $_prototypes_date.length; $i < $j && !$obstructed; $i++)
            {
                // Get the current property in the prototype
                var $property = $_prototypes_date[$i];

                // If the property is a reserved property, skip it
                if ($_reserved($property))
                    continue;

                // Get the function from the prototype
                var $function = $__dateProto__[$property];

                // If the function is not a function, skip it
                if (typeof $function != 'function')
                    continue;

                // Set the obstructed flag
                $obstructed = $function !== $object[$property];
            }
        }
        // Set the obstructed flag
        else
            $obstructed = true;

        // If the date object is obstructed
        if ($obstructed)
        {
            // Get the primitive value of the date
            $object = $__date_valueOf__.call($object);
            $type   = 'number';
        }
    }

    // If the object is a number
    if ($type == 'number')
    {
        // If the number is not a primitive, get the primitive value of the number
        if (typeof $object != 'number')
            $object = $__number_valueOf__.call($object);

        // If the number is not an integer, return an invalid date object
        if (!$$_isInteger($object))
            return new $__date($__NaN__);

        // If the number is greater than the maximum representable timestamp, return the maximum representable date object
        if ($object > $_const_date_max)
            return new $__date($_const_date_max);

        // If the number is less than the minimum representable timestamp, return the minimum representable date object
        if ($object < $_const_date_min)
            return new $__date($_const_date_min);

        // Return the date object
        return new $__date($object);
    }

    // If the object is a string
    if ($type == 'string')
    {
        // If the string is not a primitive, get the primitive value of the string
        if (typeof $object != 'string')
            $object = $__string_valueOf__.call($object);

        // Return the date object
        return new $__date($object);
    }

    // If the object is not a date, return an invalid date object
    if ($type != 'date')
        return new $__date($__NaN__);

    // Get the time of the date
    var $time = $__date_valueOf__.call($object);

    // If the time is greater than the maximum representable timestamp, return the maximum representable date object
    if ($time > $_const_date_max)
        return new $__date($_const_date_max);

    // If the time is less than the minimum representable timestamp, return the minimum representable date object
    if ($time < $_const_date_min)
        return new $__date($_const_date_min);

    // Return the object
    return $object;
};

$_defineMethod('asDate', $$_asDate);


text:
package com.intellij.ui.docking;

import com.intellij.openapi.Disposable;
import com.intellij.ui.awt.RelativePoint;
import com.intellij.ui.awt.RelativeRectangle;
import com.intellij.util.ui.update.Activatable;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.awt.*;

public interface DockContainer extends Disposable, Activatable {
  enum ContentResponse {ACCEPT_MOVE, ACCEPT_COPY, DENY;
    public boolean canAccept() {return this != DENY;}
  }

  RelativeRectangle getAcceptArea();

  /**
   * This area is used when nothing was found with getAcceptArea
   */
  RelativeRectangle getAcceptAreaFallback();

  @NotNull
  ContentResponse getContentResponse(@NotNull DockableContent content, RelativePoint point);

  JComponent getContainerComponent();

  void add(@NotNull DockableContent content, RelativePoint dropTarget);

  void closeAll();

  void addListener(Listener listener, Disposable parent);

  boolean isEmpty();

  @Nullable
  Image startDropOver(@NotNull DockableContent content, RelativePoint point);

  @Nullable
  Image processDropOver(@NotNull DockableContent content, RelativePoint point);

  void resetDropOver(@NotNull DockableContent content);

  boolean isDisposeWhenEmpty();

  interface Dialog extends DockContainer {}

  interface Persistent extends DockContainer {

    String getDockContainerType();
    Element getState();

  }

  interface Listener {
    void contentAdded(Object key);
    void contentRemoved(Object key);

    class Adapter implements Listener {
      @Override
      public void contentAdded(Object key) {
      }

      @Override
      public void contentRemoved(Object key) {
      }
    }
  }
}


text:
require 'spec_helper'

describe "/contacts/new" do
  include ContactsHelper

  before do
    login_and_assign
    @account = FactoryGirl.create(:account)
    assign(:contact, Contact.new(:user => current_user))
    assign(:users, [ current_user ])
    assign(:account, @account)
    assign(:accounts, [ @account ])
  end

  it "should toggle empty message div if it exists" do
    render

    rendered.should include("crm.flick('empty', 'toggle')")
  end

  describe "new contact" do
    it "should render [new] template into :create_contact div" do
      params[:cancel] = nil
      render

      rendered.should include("$('#create_contact').html")
      rendered.should include("crm.create_or_select_account(false)")
    end
  end

  describe "cancel new contact" do
    it "should hide [create contact] form" do
      params[:cancel] = "true"
      render

      rendered.should_not include("$('#create_contact').html")
      rendered.should include("crm.flip_form('create_contact');")
    end
  end

end


text:
.class public final Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;
.super Lcom/fasterxml/jackson/databind/deser/std/StdDeserializer;
.source ""

# interfaces
.implements Lcom/fasterxml/jackson/databind/deser/ContextualDeserializer;

# annotations
.annotation runtime Lcom/fasterxml/jackson/databind/annotation/JacksonStdImpl;
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/fasterxml/jackson/databind/deser/std/StdDeserializer<[Ljava/lang/String;>;Lcom/fasterxml/jackson/databind/deser/ContextualDeserializer;"
    }
.end annotation

# static fields
.field public static final instance:Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer; = null

.field private static final serialVersionUID:J = -0x69535cf715633df5L

# instance fields
.field protected _elementDeserializer:Lcom/fasterxml/jackson/databind/JsonDeserializer;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/fasterxml/jackson/databind/JsonDeserializer<Ljava/lang/String;>;"
        }
    .end annotation
.end field

# direct methods
.method static constructor <clinit>()V
    .locals 1

    .line 25
    new-instance v0, Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;

    invoke-direct {v0}, Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;-><init>()V

    sput-object v0, Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;->instance:Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;

    return-void
.end method

.method public constructor <init>()V
    .locals 1

    .line 33
    const-class v0, [Ljava/lang/String;

    invoke-direct {p0, v0}, Lcom/fasterxml/jackson/databind/deser/std/StdDeserializer;-><init>(Ljava/lang/Class;)V

    .line 34
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;->_elementDeserializer:Lcom/fasterxml/jackson/databind/JsonDeserializer;

    .line 35
    return-void
.end method

.method protected constructor <init>(Lcom/fasterxml/jackson/databind/JsonDeserializer;)V
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(Lcom/fasterxml/jackson/databind/JsonDeserializer<*>;)V"
        }
    .end annotation

    .line 39
    const-class v0, [Ljava/lang/String;

    invoke-direct {p0, v0}, Lcom/fasterxml/jackson/databind/deser/std/StdDeserializer;-><init>(Ljava/lang/Class;)V

    .line 40
    iput-object p1, p0, Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;->_elementDeserializer:Lcom/fasterxml/jackson/databind/JsonDeserializer;

    .line 41
    return-void
.end method

.method private final handleNonArray(Lcom/fasterxml/jackson/core/JsonParser;Lcom/fasterxml/jackson/databind/DeserializationContext;)[Ljava/lang/String;
    .locals 3

    .line 121
    sget-object v0, Lcom/fasterxml/jackson/databind/DeserializationFeature;->ACCEPT_SINGLE_VALUE_AS_ARRAY:Lcom/fasterxml/jackson/databind/DeserializationFeature;

    invoke-virtual {p2, v0}, Lcom/fasterxml/jackson/databind/DeserializationContext;->isEnabled(Lcom/fasterxml/jackson/databind/DeserializationFeature;)Z

    move-result v0

    if-nez v0, :cond_1

    .line 123
    invoke-virtual {p1}, Lcom/fasterxml/jackson/core/JsonParser;->getCurrentToken()Lcom/fasterxml/jackson/core/JsonToken;

    move-result-object v0

    sget-object v1, Lcom/fasterxml/jackson/core/JsonToken;->VALUE_STRING:Lcom/fasterxml/jackson/core/JsonToken;

    if-ne v0, v1, :cond_0

    sget-object v0, Lcom/fasterxml/jackson/databind/DeserializationFeature;->ACCEPT_EMPTY_STRING_AS_NULL_OBJECT:Lcom/fasterxml/jackson/databind/DeserializationFeature;

    invoke-virtual {p2, v0}, Lcom/fasterxml/jackson/databind/DeserializationContext;->isEnabled(Lcom/fasterxml/jackson/databind/DeserializationFeature;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 125
    invoke-virtual {p1}, Lcom/fasterxml/jackson/core/JsonParser;->getText()Ljava/lang/String;

    move-result-object v0

    .line 126
    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v0

    if-nez v0, :cond_0

    .line 127
    const/4 v0, 0x0

    return-object v0

    .line 130
    :cond_0
    iget-object v0, p0, Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;->_valueClass:Ljava/lang/Class;

    invoke-virtual {p2, v0}, Lcom/fasterxml/jackson/databind/DeserializationContext;->mappingException(Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/JsonMappingException;

    move-result-object v0

    throw v0

    .line 132
    :cond_1
    const/4 v0, 0x1

    new-array v0, v0, [Ljava/lang/String;

    invoke-virtual {p1}, Lcom/fasterxml/jackson/core/JsonParser;->getCurrentToken()Lcom/fasterxml/jackson/core/JsonToken;

    move-result-object v1

    sget-object v2, Lcom/fasterxml/jackson/core/JsonToken;->VALUE_NULL:Lcom/fasterxml/jackson/core/JsonToken;

    if-ne v1, v2, :cond_2

    const/4 v1, 0x0

    goto :goto_0

    :cond_2
    invoke-virtual {p0, p1, p2}, Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;->_parseString(Lcom/fasterxml/jackson/core/JsonParser;Lcom/fasterxml/jackson/databind/DeserializationContext;)Ljava/lang/String;

    move-result-object v1

    :goto_0
    const/4 v2, 0x0

    aput-object v1, v0, v2

    return-object v0
.end method

# virtual methods
.method protected final _deserializeCustom(Lcom/fasterxml/jackson/core/JsonParser;Lcom/fasterxml/jackson/databind/DeserializationContext;)[Ljava/lang/String;
    .locals 7

    .line 88
    invoke-virtual {p2}, Lcom/fasterxml/jackson/databind/DeserializationContext;->leaseObjectBuffer()Lcom/fasterxml/jackson/databind/util/ObjectBuffer;

    move-result-object v0

    .line 89
    move-object v2, v0

    invoke-virtual {v0}, Lcom/fasterxml/jackson/databind/util/ObjectBuffer;->resetAndStart()[Ljava/lang/Object;

    move-result-object v3

    .line 90
    iget-object v4, p0, Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;->_elementDeserializer:Lcom/fasterxml/jackson/databind/JsonDeserializer;

    .line 92
    const/4 v5, 0x0

    .line 95
    :goto_0
    invoke-virtual {p1}, Lcom/fasterxml/jackson/core/JsonParser;->nextToken()Lcom/fasterxml/jackson/core/JsonToken;

    move-result-object v0

    move-object v6, v0

    sget-object v1, Lcom/fasterxml/jackson/core/JsonToken;->END_ARRAY:Lcom/fasterxml/jackson/core/JsonToken;

    if-eq v0, v1, :cond_2

    .line 97
    sget-object v0, Lcom/fasterxml/jackson/core/JsonToken;->VALUE_NULL:Lcom/fasterxml/jackson/core/JsonToken;

    if-ne v6, v0, :cond_0

    const/4 v6, 0x0

    goto :goto_1

    :cond_0
    invoke-virtual {v4, p1, p2}, Lcom/fasterxml/jackson/databind/JsonDeserializer;->deserialize(Lcom/fasterxml/jackson/core/JsonParser;Lcom/fasterxml/jackson/databind/DeserializationContext;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    move-object v6, v0

    .line 98
    :goto_1
    array-length v0, v3

    if-lt v5, v0, :cond_1

    .line 99
    invoke-virtual {v2, v3}, Lcom/fasterxml/jackson/databind/util/ObjectBuffer;->appendCompletedChunk([Ljava/lang/Object;)[Ljava/lang/Object;

    move-result-object v3

    .line 100
    const/4 v5, 0x0

    .line 102
    :cond_1
    move v0, v5

    add-int/lit8 v5, v5, 0x1

    aput-object v6, v3, v0

    .line 103
    goto :goto_0

    .line 104
    :cond_2
    const-class v0, Ljava/lang/String;

    invoke-virtual {v2, v3, v5, v0}, Lcom/fasterxml/jackson/databind/util/ObjectBuffer;->completeAndClearBuffer([Ljava/lang/Object;ILjava/lang/Class;)[Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [Ljava/lang/String;

    move-object v6, v0

    .line 105
    invoke-virtual {p2, v2}, Lcom/fasterxml/jackson/databind/DeserializationContext;->returnObjectBuffer(Lcom/fasterxml/jackson/databind/util/ObjectBuffer;)V

    .line 106
    return-object v6
.end method

.method public final createContextual(Lcom/fasterxml/jackson/databind/DeserializationContext;Lcom/fasterxml/jackson/databind/BeanProperty;)Lcom/fasterxml/jackson/databind/JsonDeserializer;
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(Lcom/fasterxml/jackson/databind/DeserializationContext;Lcom/fasterxml/jackson/databind/BeanProperty;)Lcom/fasterxml/jackson/databind/JsonDeserializer<*>;"
        }
    .end annotation

    .line 143
    iget-object v1, p0, Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;->_elementDeserializer:Lcom/fasterxml/jackson/databind/JsonDeserializer;

    .line 145
    invoke-virtual {p0, p1, p2, v1}, Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;->findConvertingContentDeserializer(Lcom/fasterxml/jackson/databind/DeserializationContext;Lcom/fasterxml/jackson/databind/BeanProperty;Lcom/fasterxml/jackson/databind/JsonDeserializer;)Lcom/fasterxml/jackson/databind/JsonDeserializer;

    move-result-object v0

    .line 146
    move-object v1, v0

    if-nez v0, :cond_0

    .line 147
    const-class v0, Ljava/lang/String;

    invoke-virtual {p1, v0}, Lcom/fasterxml/jackson/databind/DeserializationContext;->constructType(Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/JavaType;

    move-result-object v0

    invoke-virtual {p1, v0, p2}, Lcom/fasterxml/jackson/databind/DeserializationContext;->findContextualValueDeserializer(Lcom/fasterxml/jackson/databind/JavaType;Lcom/fasterxml/jackson/databind/BeanProperty;)Lcom/fasterxml/jackson/databind/JsonDeserializer;

    move-result-object v1

    goto :goto_0

    .line 149
    :cond_0
    instance-of v0, v1, Lcom/fasterxml/jackson/databind/deser/ContextualDeserializer;

    if-eqz v0, :cond_1

    .line 150
    move-object v0, v1

    check-cast v0, Lcom/fasterxml/jackson/databind/deser/ContextualDeserializer;

    invoke-interface {v0, p1, p2}, Lcom/fasterxml/jackson/databind/deser/ContextualDeserializer;->createContextual(Lcom/fasterxml/jackson/databind/DeserializationContext;Lcom/fasterxml/jackson/databind/BeanProperty;)Lcom/fasterxml/jackson/databind/JsonDeserializer;

    move-result-object v1

    .line 154
    :cond_1
    :goto_0
    if-eqz v1, :cond_2

    invoke-virtual {p0, v1}, Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;->isDefaultDeserializer(Lcom/fasterxml/jackson/databind/JsonDeserializer;)Z

    move-result v0

    if-eqz v0, :cond_2

    .line 155
    const/4 v1, 0x0

    .line 157
    :cond_2
    iget-object v0, p0, Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;->_elementDeserializer:Lcom/fasterxml/jackson/databind/JsonDeserializer;

    if-eq v0, v1, :cond_3

    .line 158
    new-instance v0, Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;

    invoke-direct {v0, v1}, Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;-><init>(Lcom/fasterxml/jackson/databind/JsonDeserializer;)V

    return-object v0

    .line 160
    :cond_3
    return-object p0
.end method

.method public final bridge synthetic deserialize(Lcom/fasterxml/jackson/core/JsonParser;Lcom/fasterxml/jackson/databind/DeserializationContext;)Ljava/lang/Object;
    .locals 1

    .line 18
    invoke-virtual {p0, p1, p2}, Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;->deserialize(Lcom/fasterxml/jackson/core/JsonParser;Lcom/fasterxml/jackson/databind/DeserializationContext;)[Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public final deserialize(Lcom/fasterxml/jackson/core/JsonParser;Lcom/fasterxml/jackson/databind/DeserializationContext;)[Ljava/lang/String;
    .locals 6

    .line 48
    invoke-virtual {p1}, Lcom/fasterxml/jackson/core/JsonParser;->isExpectedStartArrayToken()Z

    move-result v0

    if-nez v0, :cond_0

    .line 49
    invoke-direct {p0, p1, p2}, Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;->handleNonArray(Lcom/fasterxml/jackson/core/JsonParser;Lcom/fasterxml/jackson/databind/DeserializationContext;)[Ljava/lang/String;

    move-result-object v0

    return-object v0

    .line 51
    :cond_0
    iget-object v0, p0, Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;->_elementDeserializer:Lcom/fasterxml/jackson/databind/JsonDeserializer;

    if-eqz v0, :cond_1

    .line 52
    invoke-virtual {p0, p1, p2}, Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;->_deserializeCustom(Lcom/fasterxml/jackson/core/JsonParser;Lcom/fasterxml/jackson/databind/DeserializationContext;)[Ljava/lang/String;

    move-result-object v0

    return-object v0

    .line 55
    :cond_1
    invoke-virtual {p2}, Lcom/fasterxml/jackson/databind/DeserializationContext;->leaseObjectBuffer()Lcom/fasterxml/jackson/databind/util/ObjectBuffer;

    move-result-object v0

    .line 56
    move-object v2, v0

    invoke-virtual {v0}, Lcom/fasterxml/jackson/databind/util/ObjectBuffer;->resetAndStart()[Ljava/lang/Object;

    move-result-object v3

    .line 58
    const/4 v4, 0x0

    .line 61
    :goto_0
    invoke-virtual {p1}, Lcom/fasterxml/jackson/core/JsonParser;->nextToken()Lcom/fasterxml/jackson/core/JsonToken;

    move-result-object v0

    move-object v5, v0

    sget-object v1, Lcom/fasterxml/jackson/core/JsonToken;->END_ARRAY:Lcom/fasterxml/jackson/core/JsonToken;

    if-eq v0, v1, :cond_5

    .line 64
    sget-object v0, Lcom/fasterxml/jackson/core/JsonToken;->VALUE_STRING:Lcom/fasterxml/jackson/core/JsonToken;

    if-ne v5, v0, :cond_2

    .line 65
    invoke-virtual {p1}, Lcom/fasterxml/jackson/core/JsonParser;->getText()Ljava/lang/String;

    move-result-object v5

    goto :goto_1

    .line 66
    :cond_2
    sget-object v0, Lcom/fasterxml/jackson/core/JsonToken;->VALUE_NULL:Lcom/fasterxml/jackson/core/JsonToken;

    if-ne v5, v0, :cond_3

    .line 67
    const/4 v5, 0x0

    goto :goto_1

    .line 69
    :cond_3
    invoke-virtual {p0, p1, p2}, Lcom/fasterxml/jackson/databind/deser/std/StringArrayDeserializer;->_parseString(Lcom/fasterxml/jackson/core/JsonParser;Lcom/fasterxml/jackson/databind/DeserializationContext;)Ljava/lang/String;

    move-result-object v5

    .line 71
    :goto_1
    array-length v0, v3

    if-lt v4, v0, :cond_4

    .line 72
    invoke-virtual {v2, v3}, Lcom/fasterxml/jackson/databind/util/ObjectBuffer;->appendCompletedChunk([Ljava/lang/Object;)[Ljava/lang/Object;

    move-result-object v3

    .line 73
    const/4 v4, 0x0

    .line 75
    :cond_4
    move v0, v4

    add-int/lit8 v4, v4, 0x1

    aput-object v5, v3, v0

    .line 76
    goto :goto_0

    .line 77
    :cond_5
    const-class v0, Ljava/lang/String;

    invoke-virtual {v2, v3, v4, v0}, Lcom/fasterxml/jackson/databind/util/ObjectBuffer;->completeAndClearBuffer([Ljava/lang/Object;ILjava/lang/Class;)[Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [Ljava/lang/String;

    move-object v5, v0

    .line 78
    invoke-virtual {p2, v2}, Lcom/fasterxml/jackson/databind/DeserializationContext;->returnObjectBuffer(Lcom/fasterxml/jackson/databind/util/ObjectBuffer;)V

    .line 79
    return-object v5
.end method

.method public final deserializeWithType(Lcom/fasterxml/jackson/core/JsonParser;Lcom/fasterxml/jackson/databind/DeserializationContext;Lcom/fasterxml/jackson/databind/jsontype/TypeDeserializer;)Ljava/lang/Object;
    .locals 1

    .line 114
    invoke-virtual {p3, p1, p2}, Lcom/fasterxml/jackson/databind/jsontype/TypeDeserializer;->deserializeTypedFromArray(Lcom/fasterxml/jackson/core/JsonParser;Lcom/fasterxml/jackson/databind/DeserializationContext;)Ljava/lang/Object;

    move-result-object v0

    return-object v0
.end method


text:
<?php

use yii\helpers\Html;

?>
<?php echo Html::textArea("title", '', array('id' => "contentForm_title", 'class' => 'form-control autosize contentForm', 'rows' => '1', 'placeholder' => Yii::t('NotesModule.widgets_views_form', "Title of your new note"))); ?>


text:
<?php

namespace App\Http\Controllers\API;

use App\Http\Requests\API\CreateStockAdjustmentProductAPIRequest;
use App\Http\Requests\API\UpdateStockAdjustmentProductAPIRequest;
use App\Models\StockAdjustmentProduct;
use App\Repositories\StockAdjustmentProductRepository;
use Illuminate\Http\Request;
use App\Http\Controllers\AppBaseController;
use InfyOm\Generator\Criteria\LimitOffsetCriteria;
use Prettus\Repository\Criteria\RequestCriteria;
use Response;

/**
 * Class StockAdjustmentProductController
 * @package App\Http\Controllers\API
 */

class StockAdjustmentProductAPIController extends AppBaseController
{
    /** @var  StockAdjustmentProductRepository */
    private $stockAdjustmentProductRepository;

    public function __construct(StockAdjustmentProductRepository $stockAdjustmentProductRepo)
    {
        $this->stockAdjustmentProductRepository = $stockAdjustmentProductRepo;
    }

    /**
     * Display a listing of the StockAdjustmentProduct.
     * GET|HEAD /stockAdjustmentProducts
     *
     * @param Request $request
     * @return Response
     */
    public function index(Request $request)
    {
        $this->stockAdjustmentProductRepository->pushCriteria(new RequestCriteria($request));
        $this->stockAdjustmentProductRepository->pushCriteria(new LimitOffsetCriteria($request));
        $stockAdjustmentProducts = $this->stockAdjustmentProductRepository->all();

        return $this->sendResponse($stockAdjustmentProducts->toArray(), 'Stock Adjustment Products retrieved successfully');
    }

    /**
     * Store a newly created StockAdjustmentProduct in storage.
     * POST /stockAdjustmentProducts
     *
     * @param CreateStockAdjustmentProductAPIRequest $request
     *
     * @return Response
     */
    public function store(CreateStockAdjustmentProductAPIRequest $request)
    {
        $input = $request->all();

        $stockAdjustmentProducts = $this->stockAdjustmentProductRepository->create($input);

        return $this->sendResponse($stockAdjustmentProducts->toArray(), 'Stock Adjustment Product saved successfully');
    }

    /**
     * Display the specified StockAdjustmentProduct.
     * GET|HEAD /stockAdjustmentProducts/{id}
     *
     * @param  int $id
     *
     * @return Response
     */
    public function show($id)
    {
        /** @var StockAdjustmentProduct $stockAdjustmentProduct */
        $stockAdjustmentProduct = $this->stockAdjustmentProductRepository->findWithoutFail($id);

        if (empty($stockAdjustmentProduct)) {
            return $this->sendError('Stock Adjustment Product not found');
        }

        return $this->sendResponse($stockAdjustmentProduct->toArray(), 'Stock Adjustment Product retrieved successfully');
    }

    /**
     * Update the specified StockAdjustmentProduct in storage.
     * PUT/PATCH /stockAdjustmentProducts/{id}
     *
     * @param  int $id
     * @param UpdateStockAdjustmentProductAPIRequest $request
     *
     * @return Response
     */
    public function update($id, UpdateStockAdjustmentProductAPIRequest $request)
    {
        $input = $request->all();

        /** @var StockAdjustmentProduct $stockAdjustmentProduct */
        $stockAdjustmentProduct = $this->stockAdjustmentProductRepository->findWithoutFail($id);

        if (empty($stockAdjustmentProduct)) {
            return $this->sendError('Stock Adjustment Product not found');
        }

        $stockAdjustmentProduct = $this->stockAdjustmentProductRepository->update($input, $id);

        return $this->sendResponse($stockAdjustmentProduct->toArray(), 'StockAdjustmentProduct updated successfully');
    }

    /**
     * Remove the specified StockAdjustmentProduct from storage.
     * DELETE /stockAdjustmentProducts/{id}
     *
     * @param  int $id
     *
     * @return Response
     */
    public function destroy($id)
    {
        /** @var StockAdjustmentProduct $stockAdjustmentProduct */
        $stockAdjustmentProduct = $this->stockAdjustmentProductRepository->findWithoutFail($id);

        if (empty($stockAdjustmentProduct)) {
            return $this->sendError('Stock Adjustment Product not found');
        }

        $stockAdjustmentProduct->delete();

        return $this->sendResponse($id, 'Stock Adjustment Product deleted successfully');
    }
}