text:
package com.google.android.exoplayer2.extractor.ts;

import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.extractor.ts.TsPayloadReader.TrackIdGenerator;
import com.google.android.exoplayer2.testutil.FakeExtractorOutput;
import com.google.android.exoplayer2.testutil.FakeTrackOutput;
import com.google.android.exoplayer2.testutil.TestUtil;
import com.google.android.exoplayer2.util.ParsableByteArray;
import java.util.Arrays;
import junit.framework.TestCase;

/**
 * Test for {@link AdtsReader}.
 */
public class AdtsReaderTest extends TestCase {

  public static final byte[] ID3_DATA_1 = TestUtil.createByteArray(
      0x49, 0x44, 0x33, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3d, 0x54, 0x58,
      0x58, 0x58, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x03, 0x00, 0x20, 0x2a,
      0x2a, 0x2a, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x49, 0x53, 0x20, 0x54,
      0x69, 0x6d, 0x65, 0x64, 0x20, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74,
      0x61, 0x20, 0x40, 0x20, 0x2d, 0x2d, 0x20, 0x30, 0x30, 0x3a, 0x30, 0x30,
      0x3a, 0x30, 0x30, 0x2e, 0x30, 0x20, 0x2a, 0x2a, 0x2a, 0x20, 0x00);

  public static final byte[] ID3_DATA_2 = TestUtil.createByteArray(
      0x49,
      0x44, 0x33, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x50, 0x52, 0x49,
      0x56, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x63, 0x6f, 0x6d, 0x2e, 0x61,
      0x70, 0x70, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69,
      0x6e, 0x67, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74,
      0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74,
      0x61, 0x6d, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xbb, 0xa0);

  public static final byte[] ADTS_HEADER = TestUtil.createByteArray(
      0xff, 0xf1, 0x50, 0x80, 0x01, 0xdf, 0xfc);

  public static final byte[] ADTS_CONTENT = TestUtil.createByteArray(
      0x20, 0x00, 0x20, 0x00, 0x00, 0x80, 0x0e);

  private static final byte[] TEST_DATA = TestUtil.joinByteArrays(
      ID3_DATA_1,
      ID3_DATA_2,
      ADTS_HEADER,
      ADTS_CONTENT);

  private static final long ADTS_SAMPLE_DURATION = 23219L;

  private FakeTrackOutput adtsOutput;
  private FakeTrackOutput id3Output;
  private AdtsReader adtsReader;
  private ParsableByteArray data;
  private boolean firstFeed;

  @Override
  protected void setUp() throws Exception {
    FakeExtractorOutput fakeExtractorOutput = new FakeExtractorOutput();
    adtsOutput = fakeExtractorOutput.track(0);
    id3Output = fakeExtractorOutput.track(1);
    adtsReader = new AdtsReader(true);
    TrackIdGenerator idGenerator = new TrackIdGenerator(0, 1);
    adtsReader.createTracks(fakeExtractorOutput, idGenerator);
    data = new ParsableByteArray(TEST_DATA);
    firstFeed = true;
  }

  public void testSkipToNextSample() throws Exception {
    for (int i = 1; i <= ID3_DATA_1.length + ID3_DATA_2.length; i++) {
      data.setPosition(i);
      feed();
      // Once the data position set to ID3_DATA_1.length, no more id3 samples are read
      int id3SampleCount = Math.min(i, ID3_DATA_1.length);
      assertSampleCounts(id3SampleCount, i);
    }
  }

  public void testSkipToNextSampleResetsState() throws Exception {
    data = new ParsableByteArray(TestUtil.joinByteArrays(
        ADTS_HEADER,
        ADTS_CONTENT,
        // Adts sample missing the first sync byte
        Arrays.copyOfRange(ADTS_HEADER, 1, ADTS_HEADER.length),
        ADTS_CONTENT));
    feed();
    assertSampleCounts(0, 1);
    adtsOutput.assertSample(0, ADTS_CONTENT, 0, C.BUFFER_FLAG_KEY_FRAME, null);
  }

  public void testNoData() throws Exception {
    feedLimited(0);
    assertSampleCounts(0, 0);
  }

  public void testNotEnoughDataForIdentifier() throws Exception {
    feedLimited(3 - 1);
    assertSampleCounts(0, 0);
  }

  public void testNotEnoughDataForHeader() throws Exception {
    feedLimited(10 - 1);
    assertSampleCounts(0, 0);
  }

  public void testNotEnoughDataForWholeId3Packet() throws Exception {
    feedLimited(ID3_DATA_1.length - 1);
    assertSampleCounts(0, 0);
  }

  public void testConsumeWholeId3Packet() throws Exception {
    feedLimited(ID3_DATA_1.length);
    assertSampleCounts(1, 0);
    id3Output.assertSample(0, ID3_DATA_1, 0, C.BUFFER_FLAG_KEY_FRAME, null);
  }

  public void testMultiId3Packet() throws Exception {
    feedLimited(ID3_DATA_1.length + ID3_DATA_2.length - 1);
    assertSampleCounts(1, 0);
    id3Output.assertSample(0, ID3_DATA_1, 0, C.BUFFER_FLAG_KEY_FRAME, null);
  }

  public void testMultiId3PacketConsumed() throws Exception {
    feedLimited(ID3_DATA_1.length + ID3_DATA_2.length);
    assertSampleCounts(2, 0);
    id3Output.assertSample(0, ID3_DATA_1, 0, C.BUFFER_FLAG_KEY_FRAME, null);
    id3Output.assertSample(1, ID3_DATA_2, 0, C.BUFFER_FLAG_KEY_FRAME, null);
  }

  public void testMultiPacketConsumed() throws Exception {
    for (int i = 0; i < 10; i++) {
      data.setPosition(0);
      feed();

      long timeUs = ADTS_SAMPLE_DURATION * i;
      int j = i * 2;
      assertSampleCounts(j + 2, i + 1);

      id3Output.assertSample(j, ID3_DATA_1, timeUs, C.BUFFER_FLAG_KEY_FRAME, null);
      id3Output.assertSample(j + 1, ID3_DATA_2, timeUs, C.BUFFER_FLAG_KEY_FRAME, null);
      adtsOutput.assertSample(i, ADTS_CONTENT, timeUs, C.BUFFER_FLAG_KEY_FRAME, null);
    }
  }

  public void testAdtsDataOnly() throws Exception {
    data.setPosition(ID3_DATA_1.length + ID3_DATA_2.length);
    feed();
    assertSampleCounts(0, 1);
    adtsOutput.assertSample(0, ADTS_CONTENT, 0, C.BUFFER_FLAG_KEY_FRAME, null);
  }

  private void feedLimited(int limit) {
    maybeStartPacket();
    data.setLimit(limit);
    feed();
  }

  private void feed() {
    maybeStartPacket();
    adtsReader.consume(data);
  }

  private void maybeStartPacket() {
    if (firstFeed) {
      adtsReader.packetStarted(0, true);
      firstFeed = false;
    }
  }

  private void assertSampleCounts(int id3SampleCount, int adtsSampleCount) {
    id3Output.assertSampleCount(id3SampleCount);
    adtsOutput.assertSampleCount(adtsSampleCount);
  }

}


text:
/**
 * AppList interactor
 */

import { interactor, count, scoped, is } from '@bigtest/interactor';
import AppListDropdownInteractor from '../components/AppListDropdown/tests/interactor';

export default interactor(class AppIconInteractor {
  static defaultScope = '[data-test-app-list]';

  itemsCount = count('[data-test-app-list-item]');
  dropdownToggle = scoped('[data-test-app-list-apps-toggle]', {
    isFocused: is(':focus')
  });

  dropdownMenu = new AppListDropdownInteractor();
});

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Arte\ObertestBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * TBOrderProduct
 */
class TBOrderProduct
{
    /**
     * @var integer
     */
    private $OrderId;

    /**
     * @var integer
     */
    private $ProductId;

    /**
     * @var integer
     */
    private $Flag;

    /**
     * @var \Arte\ObertestBundle\Entity\TBOrder
     */
    private $TBOrderOrderId;

    /**
     * @var \Arte\ObertestBundle\Entity\TBProduct
     */
    private $TBProductProductId;

    /**
     * Set OrderId
     *
     * @param integer $orderId
     * @return TBOrderProduct
     */
    public function setOrderId($orderId)
    {
        $this->OrderId = $orderId;

        return $this;
    }

    /**
     * Get OrderId
     *
     * @return integer
     */
    public function getOrderId()
    {
        return $this->OrderId;
    }

    /**
     * Set ProductId
     *
     * @param integer $productId
     * @return TBOrderProduct
     */
    public function setProductId($productId)
    {
        $this->ProductId = $productId;

        return $this;
    }

    /**
     * Get ProductId
     *
     * @return integer
     */
    public function getProductId()
    {
        return $this->ProductId;
    }

    /**
     * Set Flag
     *
     * @param integer $flag
     * @return TBOrderProduct
     */
    public function setFlag($flag)
    {
        $this->Flag = $flag;

        return $this;
    }

    /**
     * Get Flag
     *
     * @return integer
     */
    public function getFlag()
    {
        return $this->Flag;
    }

    /**
     * Set TBOrderOrderId
     *
     * @param \Arte\ObertestBundle\Entity\TBOrder $tBOrderOrderId
     * @return TBOrderProduct
     */
    public function setTBOrderOrderId(\Arte\ObertestBundle\Entity\TBOrder $tBOrderOrderId = null)
    {
        $this->TBOrderOrderId = $tBOrderOrderId;

        return $this;
    }

    /**
     * Get TBOrderOrderId
     *
     * @return \Arte\ObertestBundle\Entity\TBOrder
     */
    public function getTBOrderOrderId()
    {
        return $this->TBOrderOrderId;
    }

    /**
     * Set TBProductProductId
     *
     * @param \Arte\ObertestBundle\Entity\TBProduct $tBProductProductId
     * @return TBOrderProduct
     */
    public function setTBProductProductId(\Arte\ObertestBundle\Entity\TBProduct $tBProductProductId = null)
    {
        $this->TBProductProductId = $tBProductProductId;

        return $this;
    }

    /**
     * Get TBProductProductId
     *
     * @return \Arte\ObertestBundle\Entity\TBProduct
     */
    public function getTBProductProductId()
    {
        return $this->TBProductProductId;
    }
}


text:
import assert from 'assert'
import sinon from 'sinon'
import SNS from 'aws/sns'
import { handle } from 'api/deleteIncidents'
import IncidentsStore from 'db/incidents'
import IncidentUpdatesStore from 'db/incidentUpdates'
import { Incident, IncidentUpdate } from 'model/incidents'

describe('deleteIncidents', () => {
  afterEach(() => {
    IncidentsStore.prototype.get.restore()
    IncidentsStore.prototype.delete.restore()
    IncidentUpdatesStore.prototype.query.restore()
    IncidentUpdatesStore.prototype.delete.restore()
    SNS.prototype.notifyEvent.restore()
  })

  it('should delete the incident', async () => {
    const incident = new Incident({incidentID: '1'})
    sinon.stub(IncidentsStore.prototype, 'get').returns(incident)
    const deleteIncidentStub = sinon.stub(IncidentsStore.prototype, 'delete').returns()

    const incidentUpdates = [new IncidentUpdate({incidentID: '1', incidentUpdateID: '1'})]
    sinon.stub(IncidentUpdatesStore.prototype, 'query').returns(incidentUpdates)
    const deleteIncidentUpdateStub = sinon.stub(IncidentUpdatesStore.prototype, 'delete').returns()

    const snsStub = sinon.stub(SNS.prototype, 'notifyEvent').returns()

    let err
    await handle({ params: { incidentid: '1' } }, null, (error) => {
      err = error
    })
    assert(err === undefined)
    assert(deleteIncidentStub.calledOnce)
    assert(deleteIncidentUpdateStub.calledOnce)
    assert(snsStub.calledOnce)
  })

  it('should return error on exception thrown', async () => {
    sinon.stub(IncidentsStore.prototype, 'get').throws()
    sinon.stub(IncidentsStore.prototype, 'delete').returns()
    sinon.stub(IncidentUpdatesStore.prototype, 'query').returns()
    sinon.stub(IncidentUpdatesStore.prototype, 'delete').returns()
    sinon.stub(SNS.prototype, 'notifyEvent').returns()

    let err
    await handle({params: {incidentid: '1'}}, null, (error, result) => {
      err = error
    })
    assert(err.match(/Error/))
  })
})


text:
package org.jsync.sync;

import java.io.IOException;
import java.util.List;

import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.api.errors.NoFilepatternException;
import org.eclipse.jgit.diff.DiffEntry;
import org.eclipse.jgit.diff.DiffFormatter;
import org.eclipse.jgit.diff.RawTextComparator;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.util.io.DisabledOutputStream;

import lombok.val;

public class Commiter extends Updater {

	public Commiter() throws NoFilepatternException, IOException, GitAPIException {
		super();
	}

	public Commiter(String localFolder, String branch) throws IOException, NoFilepatternException, GitAPIException {
		super(localFolder, branch);
	}

	@Override
	public List<DiffEntry> update() throws NoFilepatternException, GitAPIException, IOException {
		ObjectId oldHead = repository.resolve(Constants.HEAD);
		// if we are at initial commit, add a README.MD file
		if (oldHead == null) {
			//File file = new File(repository.getDirectory().getParent(), "README.MD");
			//file.createNewFile();
			initialCommit();
			try {
				git.checkout().setForce(true).setName(branch).call();
			} catch (Exception e) {
				git.checkout().setCreateBranch(true).setForce(true).setName(branch).call();
			}
			oldHead = repository.resolve(Constants.HEAD);
		}

		val status = git.status().call();
		if (!status.isClean()) {
			git.add().addFilepattern(".").call();
			git.add().setUpdate(true).addFilepattern(".").call();
			git.commit().setMessage(Integer.toString(getRevision() + 1)).call();
		}

		val newHead = repository.resolve(Constants.HEAD);
		val rw = new RevWalk(repository);
		val df = new DiffFormatter(DisabledOutputStream.INSTANCE);
		df.setRepository(repository);
		df.setDiffComparator(RawTextComparator.DEFAULT);
		df.setDetectRenames(true);
		val returnList = df.scan(rw.parseCommit(oldHead).getTree(), rw.parseCommit(newHead).getTree());
		rw.close();
		df.close();
		return returnList;
	}
}


text: print("This is some_package")


text:
import React, { PropTypes } from 'react'
import { Field, reduxForm } from 'redux-form'
import { ACCOUNT_FORM_NAME } from 'constants'
import { Link } from 'react-router'
// import ProviderDataForm from '../ProviderDataForm'
// import classes from './AccountForm.scss'

export const AccountForm = ({ account, handleSubmit, submitting, onLogout, onDelete }) => (
  <form onSubmit={handleSubmit}>

      Display Name:
      <Field style={{padding:3,borderRadius:2,border:"none",boxShadow:"0 1px 5px -2px rgba(0,0,0,.5)",fontSize:18}} name="userName" component="input" type="text" maxlength="24" value={account.userName}/>

    <button
      className="button small bgP2"
      label='Save'
      type='submit'
      style={{marginRight:5,border:"none"}}
    >Update</button>

Logout

    <Link onClick={onDelete} style={{color:"#ffffff",background:"#dd0033",marginRight:5}} className="button small dib" to="/games">Delete Account</Link>
    <Link style={{color:"#ffffff"}} className="button small bgP3 dib" to="/games">Back</Link>
  </form>
)

AccountForm.propTypes = {
  account: PropTypes.object,
  handleSubmit: PropTypes.func,
  submitting: PropTypes.bool
}

export default reduxForm({
  form: ACCOUNT_FORM_NAME
})(AccountForm)


text:
package es.ucm.fdi.tp.control.multiplayer.Responses;

import es.ucm.fdi.tp.basecode.bgame.model.GameObserver;

public class ErrorResponse implements Response {

	private static final long serialVersionUID = -8734500998980567066L;

	private String msg;

	public ErrorResponse(String msg) {
		this.msg = msg;
	}

	@Override
	public void run(GameObserver o) {
		o.onError(msg);
	}

}


text:
using System;
using System.Net;
using Guardtime.KSI.Service.Tcp;

namespace Guardtime.KSI.Service
{
    /// <summary>
    /// TCP KSI service protocol for signing.
    /// </summary>
    [Obsolete("Use TcpKsiSigningServiceProtocol instead.")]
    public class TcpKsiServiceProtocol : TcpKsiSigningServiceProtocol
    {
        /// <summary>
        ///     Create TCP KSI service protocol for signing.
        /// </summary>
        /// <param name="ipAddress">Signing service IP address</param>
        /// <param name="port">Signing service port</param>
        /// <param name="requestTimeout">request timeout in milliseconds</param>
        /// <param name="bufferSize">size of buffer to be used when receiving data</param>
        public TcpKsiServiceProtocol(IPAddress ipAddress, ushort port, uint? requestTimeout = null, uint? bufferSize = null)
            : base(ipAddress, port, requestTimeout, bufferSize)
        {
        }
    }
}


text:
'use strict';

var ensureArray         = require('es5-ext/array/valid-array')
  , toNaturalNumber     = require('es5-ext/number/to-pos-integer')
  , ensureString        = require('es5-ext/object/validate-stringifiable-value')
  , deferred            = require('deferred')
  , ensureObservableSet = require('observable-set/valid-observable-set')
  , serializeValue      = require('dbjs/_setup/serialize/value')
  , ensureStorage       = require('dbjs-persistence/ensure-storage')
  , serializeView       = require('../../utils/db-view/serialize')
  , defaultItemsPerPage = require('../../conf/objects-list-items-per-page');

module.exports = function (storage, snapshotPath, set, array/*, options*/) {
	var sizeRecordId, viewRecordId, options = Object(arguments[4]), itemsPerPage;
	snapshotPath = ensureString(snapshotPath);
	ensureObservableSet(set);
	ensureArray(array);
	ensureStorage(storage);
	if (options.itemsPerPage != null) itemsPerPage = toNaturalNumber(options.itemsPerPage);
	if (!itemsPerPage) itemsPerPage = defaultItemsPerPage;

	sizeRecordId = 'views/' + snapshotPath + '/totalSize';
	viewRecordId = 'views/' + snapshotPath + '/21';

	set._size.on('change', function () {
		storage.storeReduced(sizeRecordId, serializeValue(set.size)).done();
	});
	array.on('change', function () {
		storage.storeReduced(viewRecordId, serializeValue(serializeView(array.slice(0, itemsPerPage))))
			.done();
	});
	return deferred(
		storage.storeReduced(sizeRecordId, serializeValue(set.size)),
		storage.storeReduced(viewRecordId, serializeValue(serializeView(array.slice(0, itemsPerPage))))
	);
};


text:
package com.howmuchbeer.containers;

import java.util.Iterator;

/**
 * An assortment of containers basically determines what sorts of containers you should be
 * buying. I.e., if you don't want kegs or can't buy power hours, you don't want them to
 * be returned to you as a thing to buy.
 *
 * @author nbeckman
 *
 */
public interface ContainerAssortment {

	/**
	 * Given the number of ounces you need, returns a
	 * textual description of the produces and quantities
	 * you should buy, one per line.
	 */
	Iterable<String> resultsForOunces(long ounces);
}


text:
 #include "nectar.cpp"

 using namespace NectarCore::Global;
 using namespace NectarCore::Functions;

 //#include "httplib.h"

var __NJS_ENV = "iOS";
var __NJS_PLATFORM = "{{__PLATFORM__}}";

 #define __NJS_Create_Object() new NectarCore::Class::Object()
 #define __NJS_Create_Array(_arr) new NectarCore::Class::Array(_arr)
 #define __NJS_InitVar() NectarCore::VAR()

 WKWebView * globalWK;

void launchServer()
{
	/*
    using namespace httplib;
    CFBundleRef mainBundle = CFBundleGetMainBundle();
    CFStringEncoding encodingMethod = CFStringGetSystemEncoding();
    CFURLRef rawURL = CFBundleCopyResourceURL(mainBundle, CFSTR("raw"), NULL, NULL);
    CFStringRef rawPath = CFURLCopyFileSystemPath(rawURL, kCFURLPOSIXPathStyle);

    const char *path = CFStringGetCStringPtr(rawPath, encodingMethod);
    var _path = path;
    _path += "/";
    Server svr;
    svr.set_mount_point("/", __NJS_Get_String(_path));
    svr.listen("localhost", 12001);
	*/
}

void drawNative(char* str)
{
    [globalWK loadHTMLString:[NSString stringWithCString:str    encoding:[NSString defaultCStringEncoding]]  baseURL:nil];
}

void navigateNative(char* str)
{
    NSString *urlString = [NSString stringWithCString:str   encoding:[NSString defaultCStringEncoding]];
    NSURL *url = [NSURL URLWithString:urlString];
    NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
    [globalWK loadRequest:urlRequest];
}

 {INCLUDE}

 {DECL}

void njsCallback(WKWebView *wkWV, NSString* nString)
{
    globalWK = wkWV;
	Nectar["onEvent"]([nString UTF8String]);
}

void loadedCallback(WKWebView *wkWV)
{
    // main NectarJS function
    // setup logic, events, init
    globalWK = wkWV;

    {INIT}

	{
		{CODE}
    }

	return;
}


text:
namespace nacl_io {

MountNodeStream::MountNodeStream(Mount* mnt)
    : MountNode(mnt),
      read_timeout_(-1),
      write_timeout_(-1),
      stream_state_flags_(0) {
}

Error MountNodeStream::Init(int perm) {
  MountNode::Init(perm);
  if (perm & O_NONBLOCK)
    SetStreamFlags(SSF_NON_BLOCK);

  return 0;
}

void MountNodeStream::SetStreamFlags(uint32_t bits) {
  sdk_util::AtomicOrFetch(&stream_state_flags_, bits);
}

void MountNodeStream::ClearStreamFlags(uint32_t bits) {
  sdk_util::AtomicAndFetch(&stream_state_flags_, ~bits);
}

uint32_t MountNodeStream::GetStreamFlags() {
  return stream_state_flags_;
}

bool MountNodeStream::TestStreamFlags(uint32_t bits) {
  return (stream_state_flags_ & bits) == bits;
}

void MountNodeStream::QueueInput() {}
void MountNodeStream::QueueOutput() {}

MountStream* MountNodeStream::mount_stream() {
  return static_cast<MountStream*>(mount_);
}

}  // namespace nacl_io


text:
"""
Tools for working with Sphero Options
"""

_BIT0 = 0x00000001
_BIT1 = 0x00000002
_BIT2 = 0x00000004
_BIT3 = 0x00000008
_BIT4 = 0x00000010
_BIT5 = 0x00000020
_BIT6 = 0x00000040
_BIT7 = 0x00000080
_BIT8 = 0x00000100

class PermanentOptions(object):
    """
    Used to set Permanent Options on the spheros.
    Each property represents an option

    Data members should be set to a bool.
    """

    def __init__(self):
        self.bitflags = 0x00000000
        """ Bitflags representing which Options are set."""

    def set_light_wakeup_sensitivity(self):
        """
        Sets sphero's wakeup sensitivity to light.
        """
        self.bitflags &= (~ _BIT7)
        self.bitflags |= _BIT6

    def set_heavy_wakeup_sensitivity(self):
        """
        Sets sphero's wakeup sensitivity to heavy.
        """
        self.bitflags &= (~ _BIT6)
        self.bitflags |= _BIT7

    @property
    def sleep_on_charge_connected(self):
        """
        Prevents the sphero from immediatly sleeping when
        placed on the charger and connected over bluetooth.
        """
        return bool(self.bitflags & _BIT0)

    @sleep_on_charge_connected.setter
    def sleep_on_charge_connected(self, value):
        if value:
            self.bitflags |= _BIT0
        else:
            self.bitflags &= (~ _BIT0)

    @property
    def vector_drive(self):
        """
        When Sphero is stopped and is given a new roll command
        it achieves the heading before moving along it.
        """
        return bool(self.bitflags & _BIT1)

    @vector_drive.setter
    def vector_drive(self, value):
        if value:
            self.bitflags |= _BIT1
        else:
            self.bitflags &= (~ _BIT1)

    @property
    def level_on_charge(self):
        """
        Set to diable self_leveling when sphero is palced on the charger.
        """
        return bool(self.bitflags & _BIT2)

    @level_on_charge.setter
    def level_on_charge(self, value):
        if value:
            self.bitflags |= _BIT2
        else:
            self.bitflags &= (~ _BIT2)

    @property
    def tail_always_on(self):
        """
        Set to force the tail led always on.
        """
        return bool(self.bitflags & _BIT3)

    @tail_always_on.setter
    def tail_always_on(self, value):
        if value:
            self.bitflags |= _BIT3
        else:
            self.bitflags &= (~ _BIT3)

    @property
    def enable_motion_timeout(self):
        """
        Set to enable motion timeout.
        """
        return bool(self.bitflags & _BIT4)

    @enable_motion_timeout.setter
    def enable_motion_timeout(self, value):
        if value:
            self.bitflags |= _BIT4
        else:
            self.bitflags &= (~ _BIT4)

    @property
    def demo_mode(self):
        """
        Set to enable demo retail mode, where
        sphero runs a slow rainbow for 60 minutes when palced in charger.
        """
        return bool(self.bitflags & _BIT5)

    @demo_mode.setter
    def demo_mode(self, value):
        if value:
            self.bitflags |= _BIT5
        else:
            self.bitflags &= (~ _BIT5)

    @property
    def enable_gyro_max_async_msg(self):
        """
        Enables the gyro max async message.
        """
        return bool(self.bitflags & _BIT8)

    @enable_gyro_max_async_msg.setter
    def enable_gyro_max_async_msg(self, value):
        if value:
            self.bitflags |= _BIT8
        else:
            self.bitflags &= (~ _BIT8)


text:
//-----------------------------------------------
//
//	This file is part of the Siv3D Engine.
//
//	Copyright (c) 2008-2019 Ryo Suzuki
//	Copyright (c) 2016-2019 OpenSiv3D Project
//
//	Licensed under the MIT License.
//
//-----------------------------------------------

# pragma once
# include <Siv3D/Fwd.hpp>
# include <Siv3D/Script.hpp>

namespace s3d
{
	class ISiv3DScript
	{
	public:

		static ISiv3DScript* Create();

		virtual ~ISiv3DScript() = default;

		virtual bool init() = 0;

		virtual void shutdown() = 0;

		virtual ScriptID createFromCode(const String& code, int32 compileOption) = 0;

		virtual ScriptID createFromFile(const FilePath& path, int32 compileOption) = 0;

		virtual void release(ScriptID handleID) = 0;

		virtual AngelScript::asIScriptFunction* getFunction(ScriptID handleID, const String& decl) = 0;

		virtual std::shared_ptr<ScriptModuleData> getModuleData(ScriptID handleID) = 0;

		virtual bool compiled(ScriptID handleID) = 0;

		virtual void setSystemUpdateCallback(ScriptID handleID, const std::function<bool(void)>& callback) = 0;

		virtual bool reload(ScriptID handleID, int32 compileOption) = 0;

		virtual const FilePath& path(ScriptID handleID) = 0;

		virtual Array<String> retrieveMessagesInternal() = 0;

		virtual const Array<String>& retrieveMessages(ScriptID handleID) = 0;

		virtual const std::function<bool(void)>& getSystemUpdateCallback(uint64 scriptID) = 0;

		virtual AngelScript::asIScriptEngine* getEngine() = 0;
	};
}


text:
layout: post
author: abaker8
title: "Amandas dictionaries reflection"
---

Hre is the code from class today!

<iframe src="https://trinket.io/embed/python/da5d59d603" width="100%" height="356" frameborder="0" marginwidth="0" marginheight="0" allowfullscreen></iframe>

I think looking at some examples in class really helped especially building up basic concepts and getting more complex. While the textbook explained things well, I think going through examples was much more helpful and made the text much easier to read. I have a lot of experimented to do with dictionary compiling and how these dictionaries can be utilized in diverse types of data analysis. I think having items being referred to by keys is useful and for me is a better way of understanding things since each item or instance has an associated value. I have inclued the code from class below as a text insert:


text:
<?xml version="1.0" encoding="UTF-8"?>
<tei xmlns="http://www.tei-c.org/ns/1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML">
	<teiHeader>
		<fileDesc>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>

						<affiliation>
							<orgName type="laboratory">Laboratory of Molecular Biology</orgName>,
							<orgName type="department">Division of Cancer Biology, Diagnosis, and Centers</orgName>,
							<orgName type="institution">National Cancer Institute</orgName>,
							<orgName type="institution">National Institutes of Health</orgName>,
							<address>
								<settlement>Bethesda</settlement>,
								<region>MD</region>
								<postCode>20892</postCode>
							</address>
						</affiliation>

						</author>
					</analytic>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
	</teiHeader>
</tei>


text:
// cocos2d
#import "CCParticleExamples.h"
#import "CCTextureCache.h"
#import "CCDirector.h"
#import "Support/CGPointExtension.h"

//
// ParticleFireworks
//
@implementation CCParticleFireworks
-(id) init
{
	return [self initWithTotalParticles:1500];
}

-(id) initWithTotalParticles:(int)p
{
	if( (self=[super initWithTotalParticles:p]) ) {
		// duration
		duration = kCCParticleDurationInfinity;

		// Gravity Mode
		self.emitterMode = kCCParticleModeGravity;

		// Gravity Mode: gravity
		self.gravity = ccp(0,-90);

		// Gravity Mode:  radial
		self.radialAccel = 0;
		self.radialAccelVar = 0;

		//  Gravity Mode: speed of particles
		self.speed = 180;
		self.speedVar = 50;

		// emitter position
		CGSize winSize = [[CCDirector sharedDirector] winSize];
		self.position = ccp(winSize.width/2, winSize.height/2);

		// angle
		angle = 90;
		angleVar = 20;

		// life of particles
		life = 3.5f;
		lifeVar = 1;

		// emits per frame
		emissionRate = totalParticles/life;

		// color of particles
		startColor.r = 0.5f;
		startColor.g = 0.5f;
		startColor.b = 0.5f;
		startColor.a = 1.0f;
		startColorVar.r = 0.5f;
		startColorVar.g = 0.5f;
		startColorVar.b = 0.5f;
		startColorVar.a = 0.1f;
		endColor.r = 0.1f;
		endColor.g = 0.1f;
		endColor.b = 0.1f;
		endColor.a = 0.2f;
		endColorVar.r = 0.1f;
		endColorVar.g = 0.1f;
		endColorVar.b = 0.1f;
		endColorVar.a = 0.2f;

		// size, in pixels
		startSize = 8.0f;
		startSizeVar = 2.0f;
		endSize = kCCParticleStartSizeEqualToEndSize;

		self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"];

		// additive
		self.blendAdditive = NO;
	}

	return self;
}
@end

//
// ParticleFire
//
@implementation CCParticleFire
-(id) init
{
	return [self initWithTotalParticles:250];
}

-(id) initWithTotalParticles:(int) p
{
	if( (self=[super initWithTotalParticles:p]) ) {

		// duration
		duration = kCCParticleDurationInfinity;

		// Gravity Mode
		self.emitterMode = kCCParticleModeGravity;

		// Gravity Mode: gravity
		self.gravity = ccp(0,0);

		// Gravity Mode: radial acceleration
		self.radialAccel = 0;
		self.radialAccelVar = 0;

		// Gravity Mode: speed of particles
		self.speed = 60;
		self.speedVar = 20;

		// starting angle
		angle = 90;
		angleVar = 10;

		// emitter position
		CGSize winSize = [[CCDirector sharedDirector] winSize];
		self.position = ccp(winSize.width/2, 60);
		posVar = ccp(40, 20);

		// life of particles
		life = 3;
		lifeVar = 0.25f;

		// size, in pixels
		startSize = 54.0f;
		startSizeVar = 10.0f;
		endSize = kCCParticleStartSizeEqualToEndSize;

		// emits per frame
		emissionRate = totalParticles/life;

		// color of particles
		startColor.r = 0.76f;
		startColor.g = 0.25f;
		startColor.b = 0.12f;
		startColor.a = 1.0f;
		startColorVar.r = 0.0f;
		startColorVar.g = 0.0f;
		startColorVar.b = 0.0f;
		startColorVar.a = 0.0f;
		endColor.r = 0.0f;
		endColor.g = 0.0f;
		endColor.b = 0.0f;
		endColor.a = 1.0f;
		endColorVar.r = 0.0f;
		endColorVar.g = 0.0f;
		endColorVar.b = 0.0f;
		endColorVar.a = 0.0f;

		self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"];

		// additive
		self.blendAdditive = YES;
	}

	return self;
}
@end

//
// ParticleSun
//
@implementation CCParticleSun
-(id) init
{
	return [self initWithTotalParticles:350];
}

-(id) initWithTotalParticles:(int) p
{
	if( (self=[super initWithTotalParticles:p]) ) {

		// additive
		self.blendAdditive = YES;

		// duration
		duration = kCCParticleDurationInfinity;

		// Gravity Mode
		self.emitterMode = kCCParticleModeGravity;

		// Gravity Mode: gravity
		self.gravity = ccp(0,0);

		// Gravity mode: radial acceleration
		self.radialAccel = 0;
		self.radialAccelVar = 0;

		// Gravity mode: speed of particles
		self.speed = 20;
		self.speedVar = 5;

		// angle
		angle = 90;
		angleVar = 360;

		// emitter position
		CGSize winSize = [[CCDirector sharedDirector] winSize];
		self.position = ccp(winSize.width/2, winSize.height/2);
		posVar = CGPointZero;

		// life of particles
		life = 1;
		lifeVar = 0.5f;

		// size, in pixels
		startSize = 30.0f;
		startSizeVar = 10.0f;
		endSize = kCCParticleStartSizeEqualToEndSize;

		// emits per seconds
		emissionRate = totalParticles/life;

		// color of particles
		startColor.r = 0.76f;
		startColor.g = 0.25f;
		startColor.b = 0.12f;
		startColor.a = 1.0f;
		startColorVar.r = 0.0f;
		startColorVar.g = 0.0f;
		startColorVar.b = 0.0f;
		startColorVar.a = 0.0f;
		endColor.r = 0.0f;
		endColor.g = 0.0f;
		endColor.b = 0.0f;
		endColor.a = 1.0f;
		endColorVar.r = 0.0f;
		endColorVar.g = 0.0f;
		endColorVar.b = 0.0f;
		endColorVar.a = 0.0f;

		self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"];
	}

	return self;
}
@end

//
// ParticleGalaxy
//
@implementation CCParticleGalaxy
-(id) init
{
	return [self initWithTotalParticles:200];
}

-(id) initWithTotalParticles:(int)p
{
	if( (self=[super initWithTotalParticles:p]) ) {

		// duration
		duration = kCCParticleDurationInfinity;

		// Gravity Mode
		self.emitterMode = kCCParticleModeGravity;

		// Gravity Mode: gravity
		self.gravity = ccp(0,0);

		// Gravity Mode: speed of particles
		self.speed = 60;
		self.speedVar = 10;

		// Gravity Mode: radial
		self.radialAccel = -80;
		self.radialAccelVar = 0;

		// Gravity Mode: tagential
		self.tangentialAccel = 80;
		self.tangentialAccelVar = 0;

		// angle
		angle = 90;
		angleVar = 360;

		// emitter position
		CGSize winSize = [[CCDirector sharedDirector] winSize];
		self.position = ccp(winSize.width/2, winSize.height/2);
		posVar = CGPointZero;

		// life of particles
		life = 4;
		lifeVar = 1;

		// size, in pixels
		startSize = 37.0f;
		startSizeVar = 10.0f;
		endSize = kCCParticleStartSizeEqualToEndSize;

		// emits per second
		emissionRate = totalParticles/life;

		// color of particles
		startColor.r = 0.12f;
		startColor.g = 0.25f;
		startColor.b = 0.76f;
		startColor.a = 1.0f;
		startColorVar.r = 0.0f;
		startColorVar.g = 0.0f;
		startColorVar.b = 0.0f;
		startColorVar.a = 0.0f;
		endColor.r = 0.0f;
		endColor.g = 0.0f;
		endColor.b = 0.0f;
		endColor.a = 1.0f;
		endColorVar.r = 0.0f;
		endColorVar.g = 0.0f;
		endColorVar.b = 0.0f;
		endColorVar.a = 0.0f;

		self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"];

		// additive
		self.blendAdditive = YES;
	}

	return self;
}
@end

//
// ParticleFlower
//
@implementation CCParticleFlower
-(id) init
{
	return [self initWithTotalParticles:250];
}

-(id) initWithTotalParticles:(int) p
{
	if( (self=[super initWithTotalParticles:p]) ) {

		// duration
		duration = kCCParticleDurationInfinity;

		// Gravity Mode
		self.emitterMode = kCCParticleModeGravity;

		// Gravity Mode: gravity
		self.gravity = ccp(0,0);

		// Gravity Mode: speed of particles
		self.speed = 80;
		self.speedVar = 10;

		// Gravity Mode: radial
		self.radialAccel = -60;
		self.radialAccelVar = 0;

		// Gravity Mode: tagential
		self.tangentialAccel = 15;
		self.tangentialAccelVar = 0;

		// angle
		angle = 90;
		angleVar = 360;

		// emitter position
		CGSize winSize = [[CCDirector sharedDirector] winSize];
		self.position = ccp(winSize.width/2, winSize.height/2);
		posVar = CGPointZero;

		// life of particles
		life = 4;
		lifeVar = 1;

		// size, in pixels
		startSize = 30.0f;
		startSizeVar = 10.0f;
		endSize = kCCParticleStartSizeEqualToEndSize;

		// emits per second
		emissionRate = totalParticles/life;

		// color of particles
		startColor.r = 0.50f;
		startColor.g = 0.50f;
		startColor.b = 0.50f;
		startColor.a = 1.0f;
		startColorVar.r = 0.5f;
		startColorVar.g = 0.5f;
		startColorVar.b = 0.5f;
		startColorVar.a = 0.5f;
		endColor.r = 0.0f;
		endColor.g = 0.0f;
		endColor.b = 0.0f;
		endColor.a = 1.0f;
		endColorVar.r = 0.0f;
		endColorVar.g = 0.0f;
		endColorVar.b = 0.0f;
		endColorVar.a = 0.0f;

		self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"];

		// additive
		self.blendAdditive = YES;
	}

	return self;
}
@end

//
// ParticleMeteor
//
@implementation CCParticleMeteor
-(id) init
{
	return [self initWithTotalParticles:150];
}

-(id) initWithTotalParticles:(int) p
{
	if( (self=[super initWithTotalParticles:p]) ) {

		// duration
		duration = kCCParticleDurationInfinity;

		// Gravity Mode
		self.emitterMode = kCCParticleModeGravity;

		// Gravity Mode: gravity
		self.gravity = ccp(-200,200);

		// Gravity Mode: speed of particles
		self.speed = 15;
		self.speedVar = 5;

		// Gravity Mode: radial
		self.radialAccel = 0;
		self.radialAccelVar = 0;

		// Gravity Mode: tagential
		self.tangentialAccel = 0;
		self.tangentialAccelVar = 0;

		// angle
		angle = 90;
		angleVar = 360;

		// emitter position
		CGSize winSize = [[CCDirector sharedDirector] winSize];
		self.position = ccp(winSize.width/2, winSize.height/2);
		posVar = CGPointZero;

		// life of particles
		life = 2;
		lifeVar = 1;

		// size, in pixels
		startSize = 60.0f;
		startSizeVar = 10.0f;
		endSize = kCCParticleStartSizeEqualToEndSize;

		// emits per second
		emissionRate = totalParticles/life;

		// color of particles
		startColor.r = 0.2f;
		startColor.g = 0.4f;
		startColor.b = 0.7f;
		startColor.a = 1.0f;
		startColorVar.r = 0.0f;
		startColorVar.g = 0.0f;
		startColorVar.b = 0.2f;
		startColorVar.a = 0.1f;
		endColor.r = 0.0f;
		endColor.g = 0.0f;
		endColor.b = 0.0f;
		endColor.a = 1.0f;
		endColorVar.r = 0.0f;
		endColorVar.g = 0.0f;
		endColorVar.b = 0.0f;
		endColorVar.a = 0.0f;

		self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"];

		// additive
		self.blendAdditive = YES;
	}

	return self;
}
@end

//
// ParticleSpiral
//
@implementation CCParticleSpiral
-(id) init
{
	return [self initWithTotalParticles:500];
}

-(id) initWithTotalParticles:(int) p
{
	if( (self=[super initWithTotalParticles:p]) ) {

		// duration
		duration = kCCParticleDurationInfinity;

		// Gravity Mode
		self.emitterMode = kCCParticleModeGravity;

		// Gravity Mode: gravity
		self.gravity = ccp(0,0);

		// Gravity Mode: speed of particles
		self.speed = 150;
		self.speedVar = 0;

		// Gravity Mode: radial
		self.radialAccel = -380;
		self.radialAccelVar = 0;

		// Gravity Mode: tagential
		self.tangentialAccel = 45;
		self.tangentialAccelVar = 0;

		// angle
		angle = 90;
		angleVar = 0;

		// emitter position
		CGSize winSize = [[CCDirector sharedDirector] winSize];
		self.position = ccp(winSize.width/2, winSize.height/2);
		posVar = CGPointZero;

		// life of particles
		life = 12;
		lifeVar = 0;

		// size, in pixels
		startSize = 20.0f;
		startSizeVar = 0.0f;
		endSize = kCCParticleStartSizeEqualToEndSize;

		// emits per second
		emissionRate = totalParticles/life;

		// color of particles
		startColor.r = 0.5f;
		startColor.g = 0.5f;
		startColor.b = 0.5f;
		startColor.a = 1.0f;
		startColorVar.r = 0.5f;
		startColorVar.g = 0.5f;
		startColorVar.b = 0.5f;
		startColorVar.a = 0.0f;
		endColor.r = 0.5f;
		endColor.g = 0.5f;
		endColor.b = 0.5f;
		endColor.a = 1.0f;
		endColorVar.r = 0.5f;
		endColorVar.g = 0.5f;
		endColorVar.b = 0.5f;
		endColorVar.a = 0.0f;

		self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"];

		// additive
		self.blendAdditive = NO;
	}

	return self;
}
@end

//
// ParticleExplosion
//
@implementation CCParticleExplosion
-(id) init
{
	return [self initWithTotalParticles:700];
}

-(id) initWithTotalParticles:(int)p
{
	if( (self=[super initWithTotalParticles:p]) ) {

		// duration
		duration = 0.1f;

		self.emitterMode = kCCParticleModeGravity;

		// Gravity Mode: gravity
		self.gravity = ccp(0,0);

		// Gravity Mode: speed of particles
		self.speed = 30;
		self.speedVar = 20;

		// Gravity Mode: radial
		self.radialAccel = 0;
		self.radialAccelVar = 0;

		// Gravity Mode: tagential
		self.tangentialAccel = 0;
		self.tangentialAccelVar = 0;

		// angle
		angle = 90;
		angleVar = 360;

		// emitter position
		CGSize winSize = [[CCDirector sharedDirector] winSize];
		self.position = ccp(winSize.width/2, winSize.height/2);
		posVar = CGPointZero;

		// life of particles
		life = 1.0f;
		lifeVar = 2;

		// size, in pixels
		startSize = 2.0f;
		startSizeVar = 3.0f;
		endSize = kCCParticleStartSizeEqualToEndSize;

		// emits per second
		emissionRate = totalParticles/duration;

		// color of particles
		startColor.r = 0.01f;
		startColor.g = 0.01f;
		startColor.b = 0.01f;
		startColor.a = 1.0f;
		startColorVar.r = 0.02f;
		startColorVar.g = 0.02f;
		startColorVar.b = 0.02f;
		startColorVar.a = 1.0f;
		endColor.r = 0.03f;
		endColor.g = 0.03f;
		endColor.b = 0.03f;
		endColor.a = 1.0f;
		endColorVar.r = 0.4f;
		endColorVar.g = 0.4f;
		endColorVar.b = 0.4f;
		endColorVar.a = 1.0f;

		self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"];

		// additive
		self.blendAdditive = NO;
	}

	return self;
}
@end

//
// ParticleSmoke
//
@implementation CCParticleSmoke
-(id) init
{
	return [self initWithTotalParticles:200];
}

-(id) initWithTotalParticles:(int) p
{
	if( (self=[super initWithTotalParticles:p]) ) {

		// duration
		duration = kCCParticleDurationInfinity;

		// Emitter mode: Gravity Mode
		self.emitterMode = kCCParticleModeGravity;

		// Gravity Mode: gravity
		self.gravity = ccp(0,0);

		// Gravity Mode: radial acceleration
		self.radialAccel = 0;
		self.radialAccelVar = 0;

		// Gravity Mode: speed of particles
		self.speed = 25;
		self.speedVar = 10;

		// angle
		angle = 90;
		angleVar = 5;

		// emitter position
		CGSize winSize = [[CCDirector sharedDirector] winSize];
		self.position = ccp(winSize.width/2, 0);
		posVar = ccp(20, 0);

		// life of particles
		life = 4;
		lifeVar = 1;

		// size, in pixels
		startSize = 60.0f;
		startSizeVar = 10.0f;
		endSize = kCCParticleStartSizeEqualToEndSize;

		// emits per frame
		emissionRate = totalParticles/life;

		// color of particles
		startColor.r = 0.8f;
		startColor.g = 0.8f;
		startColor.b = 0.8f;
		startColor.a = 1.0f;
		startColorVar.r = 0.02f;
		startColorVar.g = 0.02f;
		startColorVar.b = 0.02f;
		startColorVar.a = 0.0f;
		endColor.r = 0.0f;
		endColor.g = 0.0f;
		endColor.b = 0.0f;
		endColor.a = 1.0f;
		endColorVar.r = 0.0f;
		endColorVar.g = 0.0f;
		endColorVar.b = 0.0f;
		endColorVar.a = 0.0f;

		self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"];

		// additive
		self.blendAdditive = NO;
	}

	return self;
}
@end

@implementation CCParticleSnow
-(id) init
{
	return [self initWithTotalParticles:700];
}

-(id) initWithTotalParticles:(int)p
{
	if( (self=[super initWithTotalParticles:p]) ) {

		// duration
		duration = kCCParticleDurationInfinity;

		// set gravity mode.
		self.emitterMode = kCCParticleModeGravity;

		// Gravity Mode: gravity
		self.gravity = ccp(0,-1);

		// Gravity Mode: speed of particles
		self.speed = 5;
		self.speedVar = 1;

		// Gravity Mode: radial
		self.radialAccel = 0;
		self.radialAccelVar = 1;

		// Gravity mode: tagential
		self.tangentialAccel = 0;
		self.tangentialAccelVar = 1;

		// emitter position
		self.position = (CGPoint) {
			[[CCDirector sharedDirector] winSize].width / 2,
			[[CCDirector sharedDirector] winSize].height + 10
		};
		posVar = ccp( [[CCDirector sharedDirector] winSize].width / 2, 0 );

		// angle
		angle = -90;
		angleVar = 5;

		// life of particles
		life = 45;
		lifeVar = 15;

		// size, in pixels
		startSize = 10.0f;
		startSizeVar = 5.0f;
		endSize = kCCParticleStartSizeEqualToEndSize;

		// emits per second
		emissionRate = 10;

		// color of particles
		startColor.r = 1.0f;
		startColor.g = 1.0f;
		startColor.b = 1.0f;
		startColor.a = 1.0f;
		startColorVar.r = 0.0f;
		startColorVar.g = 0.0f;
		startColorVar.b = 0.0f;
		startColorVar.a = 0.0f;
		endColor.r = 1.0f;
		endColor.g = 1.0f;
		endColor.b = 1.0f;
		endColor.a = 0.0f;
		endColorVar.r = 0.0f;
		endColorVar.g = 0.0f;
		endColorVar.b = 0.0f;
		endColorVar.a = 0.0f;

		self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"];

		// additive
		self.blendAdditive = NO;
	}

	return self;
}
@end

@implementation CCParticleRain
-(id) init
{
	return [self initWithTotalParticles:1000];
}

-(id) initWithTotalParticles:(int)p
{
	if( (self=[super initWithTotalParticles:p]) ) {

		// duration
		duration = kCCParticleDurationInfinity;

		self.emitterMode = kCCParticleModeGravity;

		// Gravity Mode: gravity
		self.gravity = ccp(10,-10);

		// Gravity Mode: radial
		self.radialAccel = 0;
		self.radialAccelVar = 1;

		// Gravity Mode: tagential
		self.tangentialAccel = 0;
		self.tangentialAccelVar = 1;

		// Gravity Mode: speed of particles
		self.speed = 130;
		self.speedVar = 30;

		// angle
		angle = -90;
		angleVar = 5;

		// emitter position
		self.position = (CGPoint) {
			[[CCDirector sharedDirector] winSize].width / 2,
			[[CCDirector sharedDirector] winSize].height
		};
		posVar = ccp( [[CCDirector sharedDirector] winSize].width / 2, 0 );

		// life of particles
		life = 4.5f;
		lifeVar = 0;

		// size, in pixels
		startSize = 4.0f;
		startSizeVar = 2.0f;
		endSize = kCCParticleStartSizeEqualToEndSize;

		// emits per second
		emissionRate = 20;

		// color of particles
		startColor.r = 0.7f;
		startColor.g = 0.8f;
		startColor.b = 1.0f;
		startColor.a = 1.0f;
		startColorVar.r = 0.0f;
		startColorVar.g = 0.0f;
		startColorVar.b = 0.0f;
		startColorVar.a = 0.0f;
		endColor.r = 0.7f;
		endColor.g = 0.8f;
		endColor.b = 1.0f;
		endColor.a = 0.5f;
		endColorVar.r = 0.0f;
		endColorVar.g = 0.0f;
		endColorVar.b = 0.0f;
		endColorVar.a = 0.0f;

		self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"];

		// additive
		self.blendAdditive = NO;
	}

	return self;
}
@end


text:
namespace CGAL {

/*!
\ingroup PkgPolyhedron

The class `Polyhedron_items_3` is a model of the `PolyhedronItems_3`
concept. It provides definitions for vertices with points, halfedges,
and faces with plane equations. The polyhedron traits class must
provide the respective types for the point and the plane equation.
Vertices and facets both contain a halfedge handle to an incident
halfedge.

\cgalModels `PolyhedronItems_3`

\sa `CGAL::Polyhedron_3<Traits>`
\sa `CGAL::Polyhedron_min_items_3`
\sa `CGAL::HalfedgeDS_min_items`
\sa `CGAL::HalfedgeDS_items_2`

\cgalHeading{Example}

The following example program defines a new face class based on the
`CGAL::HalfedgeDS_face_base` and adds a new color member variable.
The new face class is used to replace the face definition in the
`CGAL::Polyhedron_items_3` class. The main function illustrates the
access to the new member variable.
See also the `PolyhedronItems_3` concept for another illustrative
example.

\cgalExample{Polyhedron/polyhedron_prog_color.cpp}

*/

class Polyhedron_items_3 {
public:

/// \name Types in Polyhedron_items_3::Face_wrapper<Refs,Traits>::Vertex
/// @{

`Polyhedron_items_3::Vertex_wrapper<Refs,Traits>::Vertex`
/*!

*/
typedef Traits::Point_3 Point;

`Polyhedron_items_3::Vertex_wrapper<Refs,Traits>::Vertex`
/*!

*/
typedef CGAL::Tag_true Supports_vertex_point;

/// @}

/// \name Types in Polyhedron_items_3::Face_wrapper<Refs,Traits>::Face
/// @{

/*!

*/
typedef Traits::Plane_3 Plane;

/*!

*/
typedef CGAL::Tag_true Supports_face_plane;

/// @}

/// \name Creation
/// @{

/*!
default constructor.
*/
Polyhedron_items_3();

/// @}

}; /* end Polyhedron_items_3 */
} /* end namespace CGAL */


text:
require 'simplecov'

require 'helpers/simulation'
require File.expand_path('../../lib/big-o.rb', __FILE__)
require File.expand_path('../../lib/big-o-matchers.rb', __FILE__)

RSpec.configure do |c|
  c.include BigO
  c.include BigO::Helpers
end


text:
    <target name="-crunch">
      <copy todir="${out.res.absolute.dir}">
        <fileset dir="${resource.absolute.dir}" />
      </copy>
    </target>


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Hjortstam & Ryvarden, Mycotaxon 22(1): 164 (1985)

#### Original name
Pyrrhoderma andinopatagonicum J.E. Wright & J.R. Deschamps

### Remarks
null


text:
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/ios'

Motion::Project::App.setup do |app|
  app.build_dir = 'build/ios'
  app.archs['iPhoneOS'] = ['armv7', 'arm64']
  app.deployment_target = '7.0' unless Motion::Project::Config.starter?
  app.files.concat(Dir.glob(File.join(File.dirname(__FILE__), 'ios/*.rb')))
  app.frameworks += ['CoreMotion', 'AVFoundation', 'GameController', 'MediaPlayer', 'OpenAL']
  app.libs += ['-lz', '-lsqlite3', '-liconv']
  app.vendor_project File.join(File.dirname(__FILE__), '../../build/ios'), :static, :force_load => true
  app.custom_init_funcs << 'Init_Fluency'

  app.info_plist['UISupportedInterfaceOrientations'] = ['UIInterfaceOrientationLandscapeRight', 'UIInterfaceOrientationLandscapeLeft']
end


text:
The *h1_connection* module adheres to the [*connection*](#connection) interface and provides HTTP 1 and 1.1 specific operations.

### `new(socket, conn_type, version)` <!-- --> {#connection.new}

Constructor for a new connection. Takes a cqueues socket object, a [connection type string](#connection.type) and a numeric HTTP version number. Valid values for the connection type are `"client"` and `"server"`. Valid values for the version number are `1` and `1.1`. Returns the newly initialized connection object.

### `h1_connection.version` <!-- --> {#http.h1_connection.version}

Specifies the HTTP version used for the connection handshake. Valid values are:

  - `1.0`
  - `1.1`

See [`connection.version`](#connection.version)

### `h1_connection:pollfd()` <!-- --> {#http.h1_connection:pollfd}

See [`connection:pollfd()`](#connection:pollfd)

### `h1_connection:events()` <!-- --> {#http.h1_connection:events}

See [`connection:events()`](#connection:events)

### `h1_connection:timeout()` <!-- --> {#http.h1_connection:timeout}

See [`connection:timeout()`](#connection:timeout)

### `h1_connection:connect(timeout)` <!-- --> {#http.h1_connection:connect}

See [`connection:connect(timeout)`](#connection:connect)

### `h1_connection:checktls()` <!-- --> {#http.h1_connection:checktls}

See [`connection:checktls()`](#connection:checktls)

### `h1_connection:localname()` <!-- --> {#http.h1_connection:localname}

See [`connection:localname()`](#connection:localname)

### `h1_connection:peername()` <!-- --> {#http.h1_connection:peername}

See [`connection:peername()`](#connection:peername)

### `h1_connection:flush(timeout)` <!-- --> {#http.h1_connection:flush}

See [`connection:flush(timeout)`](#connection:flush)

### `h1_connection:shutdown(dir)` <!-- --> {#http.h1_connection:shutdown}

Shut down is as graceful as possible: pipelined streams are [shutdown](#http.h1_stream:shutdown), then the underlying socket is shut down in the appropriate direction(s).

`dir` is a string representing the direction of communication to shut down communication in. If it contains `"r"` it will shut down reading, if it contains `"w"` it will shut down writing. The default is `"rw"`, i.e. to shutdown communication in both directions.

See [`connection:shutdown()`](#connection:shutdown)

### `h1_connection:close()` <!-- --> {#http.h1_connection:close}

See [`connection:close()`](#connection:close)

### `h1_connection:new_stream()` <!-- --> {#http.h1_connection:new_stream}

In HTTP 1, only a client may initiate new streams with this function.

See [`connection:new_stream()`](#connection:new_stream) for more information.

### `h1_connection:get_next_incoming_stream(timeout)` <!-- --> {#http.h1_connection:get_next_incoming_stream}

See [`connection:get_next_incoming_stream(timeout)`](#connection:get_next_incoming_stream)

### `h1_connection:onidle(new_handler)` <!-- --> {#http.h1_connection:onidle}

See [`connection:onidle(new_handler)`](#connection:onidle)

### `h1_connection:setmaxline(read_length)` <!-- --> {#http.h1_connection:setmaxline}

Sets the maximum read buffer size (in bytes) to `read_length`. i.e. sets the maximum length lines (such as headers).

The default comes from the underlying socket, which gets the (changable) cqueues default at time of construction.
The default cqueues default is 4096 bytes.

### `h1_connection:clearerr(...)` <!-- --> {#http.h1_connection:clearerr}

Clears errors to allow for further read or write operations on the connection. Returns the error number of existing errors. This function is used to recover from known errors.

### `h1_connection:error(...)` <!-- --> {#http.h1_connection:error}

Returns the error number of existing errors.

### `h1_connection:take_socket()` <!-- --> {#http.h1_connection:take_socket}

Used to hand the reference of the connection socket to another object. Resets the socket to defaults and returns the single existing reference of the socket to the calling routine. This function can be used for connection upgrades such as upgrading from HTTP 1 to a WebSocket.

### `h1_connection:read_request_line(timeout)` <!-- --> {#http.h1_connection:read_request_line}

Reads a request line from the socket. Returns the request method, request target and HTTP version for an incoming request. `:read_request_line()` yields until a `"\r\n"` terminated chunk is received, or `timeout` is exceeded. If the incoming chunk is not a valid HTTP request line, `nil` is returned. On error, returns `nil`, an error message and an error number.

### `h1_connection:read_status_line(timeout)` <!-- --> {#http.h1_connection:read_status_line}

Reads a line of input from the socket. If the input is a valid status line, the HTTP version (1 or 1.1), status code and reason description (if applicable) is returned. `:read_status_line()` yields until a `"\r\n"` terminated chunk is received, or `timeout` is exceeded. If the socket could not be read, returns `nil`, an error message and an error number.

### `h1_connection:read_header(timeout)` <!-- --> {#http.h1_connection:read_header}

Reads a CRLF terminated HTTP header from the socket and returns the header key and value. This function will yield until a MIME compliant header item is received or until `timeout` is exceeded. If the header could not be read, the function returns `nil` an error and an error message.

### `h1_connection:read_headers_done(timeout)` <!-- --> {#http.h1_connection:read_headers_done}

Checks for an empty line, which indicates the end of the HTTP headers. Returns `true` if an empty line is received. Any other value is pushed back on the socket receive buffer (unget) and the function returns `false`. This function will yield waiting for input from the socket or until `timeout` is exceeded. Returns `nil`, an error and an error message if the socket cannot be read.

### `h1_connection:read_body_by_length(len, timeout)` <!-- --> {#http.h1_connection:read_body_by_length}

Get `len` number of bytes from the socket. Use a negative number for *up to* that number of bytes. This function will yield and wait on the socket if length of the buffered body is less than `len`. Asserts if len is not a number.

### `h1_connection:read_body_till_close(timeout)` <!-- --> {#http.h1_connection:read_body_till_close}

Reads the entire request body. This function will yield until the body is complete or `timeout` is expired. If the read fails the function returns `nil`, an error message and an error number.

### `h1_connection:read_body_chunk(timeout)` <!-- --> {#http.h1_connection:read_body_chunk}

Reads the next available line of data from the request and returns the chunk and any chunk extensions. This function will yield until chunk size is received or `timeout` is exceeded. If the chunk size is indicated as `0` then `false` and any chunk extensions are returned. Returns `nil`, an error message and an error number if there was an error reading reading the chunk header or the socket.

### `h1_connection:write_request_line(method, target, httpversion, timeout)` <!-- --> {#http.h1_connection:write_request_line}

Writes the opening HTTP 1.x request line for a new request to the socket buffer. Yields until success or `timeout`. If the write fails, returns `nil`, an error message and an error number.

*Note the request line will not be flushed to the remote server until* [`write_headers_done`](#http.h1_connection:write_headers_done) *is called.*

### `h1_connection:write_status_line(httpversion, status_code, reason_phrase, timeout)` <!-- --> {#http.h1_connection:write_status_line}

Writes an HTTP status line to the socket buffer. Yields until success or `timeout`. If the write fails, the function returns `nil`, an error message and an error number.

*Note the status line will not be flushed to the remote server until* [`write_headers_done`](#http.h1_connection:write_headers_done) *is called.*

### `h1_connection:write_header(k, v, timeout)` <!-- --> {#http.h1_connection:write_header}

Writes a header item to the socket buffer as a `key:value` string. Yields until success or `timeout`. Returns `nil`, an error message and an error if the write fails.

*Note the header item will not be flushed to the remote server until* [`write_headers_done`](#http.h1_connection:write_headers_done) *is called.*

### `h1_connection:write_headers_done(timeout)` <!-- --> {#http.h1_connection:write_headers_done}

Terminates a header block by writing a blank line (`"\r\n"`) to the socket. This function will flush all outstanding data in the socket output buffer. Yields until success or `timeout`. Returns `nil`, an error message and an error if the write fails.

### `h1_connection:write_body_chunk(chunk, chunk_ext, timeout)` <!-- --> {#http.h1_connection:write_body_chunk}

Writes a chunk of data to the socket. `chunk_ext` must be `nil` as chunk extensions are not supported. Will yield until complete or `timeout` is exceeded. Returns true on success. Returns `nil`, an error message and an error number if the write fails.

### `h1_connection:write_body_last_chunk(chunk_ext, timeout)` <!-- --> {#http.h1_connection:write_body_last_chunk}

Writes the chunked body terminator `"0\r\n"` to the socket. `chunk_ext` must be `nil` as chunk extensions are not supported. Will yield until complete or `timeout` is exceeded. Returns `nil`, an error message and an error number if the write fails.

*Note that the connection will not be immediately flushed to the remote server; normally this will occur when trailers are written.*

### `h1_connection:write_body_plain(body, timeout)` <!-- --> {#http.h1_connection:write_body_plain}

Writes the contents of `body` to the socket and flushes the socket output buffer immediately. Yields until success or `timeout` is exceeded. Returns `nil`, an error message and an error number if the write fails.


text:
package main

import (
    "database/sql"
    _ "github.com/go-sql-driver/mysql"
)

var (
    DBC *sql.DB
    err error
)

/*
Initialize MySQL Connection
Starts the connection to the Database in a global variable
 */
func InitDBConnection() {
    DBC, err = sql.Open("mysql", CFG.DBUser+":"+CFG.DBPass+"@tcp("+CFG.DBHost+")/"+CFG.DBTable+CFG.DBParams)
    if err != nil {
        log("InitDBConnection", err.Error())
    }
}


text:
import WorkerPlugin = require('worker-plugin');
import webpack = require('webpack');

new WorkerPlugin();

class ExistingPlugin extends webpack.Plugin {}

const optionsArray: WorkerPlugin.Options[] = [
    {
        globalObject: false,
    },
    {
        globalObject: 'self',
    },
    {
        plugins: [
          'SomeExistingPlugin',
          new ExistingPlugin(),
        ],
    },
    {
        preserveTypeModule: true,
        workerType: 'module'
    },
    {
        worker: true,
        sharedWorker: true
    }
];

const plugins = optionsArray.map(options => new WorkerPlugin(options));


text:
package com.lexicalscope.jewel.cli;

import com.lexicalscope.jewel.cli.specification.OptionSpecification;

class ValidationFailureMissingOption extends ValidationFailureImpl
{
    private static final long serialVersionUID = 3863449901586707461L;

    public ValidationFailureMissingOption(final OptionSpecification specification) {
        super(specification, ArgumentValidationException.m_messages.getString("validationError.MissingOption"));
    }

    @Override public ValidationFailureType getFailureType() {
        return ValidationFailureType.MissingOption;
    }
}


text:
package org.gramar.extension;

import javax.xml.xpath.XPathFunction;

public class DefinedFunction {

	private String name;
	private int parms;
	private boolean variableNumberOfParms;
	private XPathFunction function;

	public DefinedFunction(String name, int parms, boolean variableNumberOfParms, XPathFunction function) {
		super();
		this.name = name;
		this.parms = parms;
		this.variableNumberOfParms = variableNumberOfParms;
		this.function = function;
	}

	public String getName() {
		return name;
	}

	public int getParms() {
		return parms;
	}

	public XPathFunction getFunction() {
		return function;
	}

	public boolean matches(String aName, int numberOfArgs) {

		if (!name.equals(aName)) {
			return false;
		}

		if (variableNumberOfParms) {
			return parms <= numberOfArgs;
		}

		return parms == numberOfArgs;

	}

}


text:
<?php
/* Loads from the database and renders the selected jpeg image (recordID and imageID)
 * Parameters:
 * $recordID, required radiology record
 * $imageID, chosen image associated with radiology record
 * $imageType, image size option (THUMBNAIL, REGULAR_SIZE, FULL_SIZE)
 *
 * Note: any white space above the intial <?php will break the content-type decoding
 *
 *  Author: Michael Williams
 */
	include("PHPconnectionDB.php");
	$conn = connect();
	$imageID = $_GET['imageID'];
	$recordID = $_GET['recordID'];
	$imageType = $_GET['imageType'];

	$query = "SELECT ".$imageType." FROM PACS_IMAGES WHERE RECORD_ID = :recordID AND IMAGE_ID = :imageID";
	$stid = oci_parse ($conn, $query);
	oci_bind_by_name($stid, ':recordID', $recordID);
	oci_bind_by_name($stid, ':imageID', $imageID);

	oci_execute($stid);
	//extract image blob from the selection array and display as jpg
	//echo src="data:image/jpeg;base64,'.$regular.'"$result;
	$arr = oci_fetch_array($stid, OCI_ASSOC);
	$result = base64_encode($arr[$imageType]->load());
	echo '';
	//echo '';
	//header("Content-type: image/JPEG");
	//echo $result;
	oci_close($conn);
?>


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

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>org.avaje.metric (avaje-metric-api 3.5.0 API)</title>
<meta name="date" content="2014-08-05">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

org.avaje.metric

Interfaces

BucketTimedMetric

CounterMetric

CounterStatistics

GaugeDouble

GaugeDoubleGroup

GaugeDoubleMetric

GaugeLong

GaugeLongGroup

GaugeLongMetric

Metric

MetricName

MetricNameCache

MetricVisitor

TimedEvent

TimedMetric

TimedMetricGroup

ValueMetric

ValueStatistics

Classes

MetricManager


text:
import os
import random
import numpy as np
import importlib

def get_listfile(image_dir, extension=".jpg"):
    if not image_dir.endswith("/"):
        image_dir = image_dir + "/"

    image_list = os.listdir(image_dir)
    image_list = [image_dir + image for image in image_list if image.endswith(extension)]
    return image_list

def get_dir_list(frame_dir):
    if not frame_dir.endswith("/"):
        frame_dir = frame_dir + "/"

    dir_list = os.listdir(frame_dir)
    dir_list = [frame_dir +
                image_dir for image_dir in dir_list if os.path.isdir(frame_dir + image_dir)]
    return dir_list

def delete_last_empty_line(s):
    end_index = len(s) - 1
    while(end_index >= 0 and (s[end_index] == "\n" or s[end_index] == "\r")):
        end_index -= 1
    s = s[:end_index + 1]
    return s

def read_file(file_name):
    with open(file_name, "r") as f:
        s = f.read()
        s = delete_last_empty_line(s)
        s_l = s.split("\n")
        for i, l in enumerate(s_l):
            if l.endswith("\r"):
                s_l[i] = s_l[i][:-1]
    return s_l

def save_file(string_list, file_name, shuffle_data=False):
    if (shuffle_data):
        random.shuffle(string_list)

    with open(file_name, "w") as f:
        if not len(string_list):
            f.write("")
        else:
            file_string = '\n'.join(string_list)
            if (file_string[-1] != "\n"):
                file_string += "\n"
            f.write(file_string)

def get_file_length(file_name):
    with open(file_name, 'r') as f:
        s = f.read()
        s_l = s.split("\n")
        total_len = len(s_l)
    return total_len

def save_numpy_array(numpy_array, file_name):
    numpy_array.tofile(file_name)

def remove_extension(file_name):
    index = file_name.rfind(".")
    if (index == -1):
        return file_name
    else:
        return file_name[0:index]

def import_module_class(module_name, class_name=None):
    module = importlib.import_module(module_name)
    if class_name == None:
        return module
    else:
        return getattr(module, class_name)

def check_exist(file_name):
    """
    Args:
        file_name: file name of the file list
                    i.e.: train_list.txt
    """
    file_list = read_file(file_name)
    for i, f in enumerate(file_list):
        f_l = f.split(" ")
        for ff in f_l:
            is_exist = os.path.exists(ff)
            if not is_exist:
                raise OSError("In %s, row: %d, "
                              "%s does not exist" % (file_name, i, ff))

def save_string(input_string, file_name):
    if os.path.exists(file_name):
        mode = "a"
    else:
        mode = "w"
    if not input_string.endswith("\n"):
        input_string += "\n"

    with open(file_name, mode) as f:
        f.write(input_string)


text:
namespace Microsoft.Azure.Management.ApiManagement.Models
{
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// Create keyVault contract details.
    /// </summary>
    public partial class KeyVaultContractCreateProperties
    {
        /// <summary>
        /// Initializes a new instance of the KeyVaultContractCreateProperties
        /// class.
        /// </summary>
        public KeyVaultContractCreateProperties()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the KeyVaultContractCreateProperties
        /// class.
        /// </summary>
        /// <param name="secretIdentifier">Key vault secret identifier for
        /// fetching secret. Providing a versioned secret will prevent
        /// auto-refresh. This requires API Management service to be configured
        /// with aka.ms/apimmsi</param>
        /// <param name="identityClientId">SystemAssignedIdentity or
        /// UserAssignedIdentity Client Id which will be used to access key
        /// vault secret.</param>
        public KeyVaultContractCreateProperties(string secretIdentifier = default(string), string identityClientId = default(string))
        {
            SecretIdentifier = secretIdentifier;
            IdentityClientId = identityClientId;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets key vault secret identifier for fetching secret.
        /// Providing a versioned secret will prevent auto-refresh. This
        /// requires API Management service to be configured with
        /// aka.ms/apimmsi
        /// </summary>
        [JsonProperty(PropertyName = "secretIdentifier")]
        public string SecretIdentifier { get; set; }

        /// <summary>
        /// Gets or sets systemAssignedIdentity or UserAssignedIdentity Client
        /// Id which will be used to access key vault secret.
        /// </summary>
        [JsonProperty(PropertyName = "identityClientId")]
        public string IdentityClientId { get; set; }

    }
}


text:
import testMatrix from './_matrix'
// @ts-ignore
import type { Prisma, PrismaClient, Tag } from './node_modules/@prisma/client'

declare let prisma: PrismaClient

// https://github.com/prisma/prisma/issues/9326
testMatrix.setupTestSuite(
  () => {
    async function createTags(length: number): Promise<number[]> {
      const ids = Array.from({ length }, (_, i) => i + 1)
      const data = ids.map((id) => ({ id }))
      await prisma.tag.createMany({
        data,
      })
      return ids
    }

    async function getTagsParams(ids: number[]): Promise<Tag[]> {
      const idsParams = ids.map((paramIdx) => `\$${paramIdx}`)

      const tags = await prisma.$queryRawUnsafe<Tag[]>(
        `
        SELECT *
        FROM tag
        WHERE "id" IN (${idsParams.join(', ')})
      `,
        ...ids,
      )
      return tags
    }

    async function clean() {
      const cleanPrismaPromises = [prisma.tagsOnPosts.deleteMany(), prisma.post.deleteMany(), prisma.tag.deleteMany()]
      for (const promise of cleanPrismaPromises) {
        await promise
      }
    }

    describe('issue #9326', () => {
      beforeEach(async () => {
        await clean()
      }, 30_000)

      test('should succeed when the number of params is 32767 or less', async () => {
        const n = 32767
        const ids = await createTags(n)
        const tags = await getTagsParams(ids)

        expect(tags.length).toBe(n)
      })

      test('should fail with `Assertion violation` when the number of params is 32768+', async () => {
        expect.assertions(3)
        const n = 32768
        const ids = await createTags(n)

        try {
          await getTagsParams(ids)
        } catch (e) {
          const error = e as Prisma.PrismaClientKnownRequestError
          expect(error.message).toContain(
            'Assertion violation on the database: `too many bind variables in prepared statement, expected maximum of 32767, received 32768`',
          )
          expect(error.code).toBe('P2035')
          expect(error.meta).toMatchObject({
            database_error: 'too many bind variables in prepared statement, expected maximum of 32767, received 32768',
          })
        }
      })
    })
  },
  {
    optOut: {
      from: ['mysql', 'sqlserver', 'cockroachdb', 'sqlite', 'mongodb'],
      reason: 'we have only captured this issue with postgres',
    },
  },
)


text:
hello
we AE KILLING IT
This is kwane testing


text:
/**
 * Contains load tests classes
 */
package org.apache.ignite.cassandra.load;


text:
package org.batfish.representation.palo_alto;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;
import org.batfish.datamodel.IpProtocol;
import org.batfish.datamodel.SubRange;

/**
 * BuiltIn applications available on PAN devices. See here for details about specific applications:
 * https://applipedia.paloaltonetworks.com/
 */
@ParametersAreNonnullByDefault
public final class ApplicationBuiltIn {
  public static final Application AMAZON_CLOUD_DRIVE_BASE =
      Application.builder("amazon-cloud-drive-base")
          .setDescription("built-in application amazon-cloud-drive-base")
          .addService(
              Service.builder("amazon-cloud-drive-base")
                  .setIpProtocol(IpProtocol.TCP)
                  .addPorts(80, 443)
                  .build())
          .build();
  public static final Application AMAZON_CLOUD_DRIVE_UPLOADING =
      Application.builder("amazon-cloud-drive-uploading")
          .setDescription("built-in application amazon-cloud-drive-uploading")
          .addService(
              Service.builder("amazon-cloud-drive-uploading")
                  .setIpProtocol(IpProtocol.TCP)
                  .addPorts(80, 443)
                  .build())
          .build();
  public static final Application AOL_MESSAGEBOARD_POSTING =
      Application.builder("aol-messageboard-posting")
          .setDescription("built-in application aol-messageboard-posting")
          .addService(
              Service.builder("aol-messageboard-posting")
                  .setIpProtocol(IpProtocol.TCP)
                  .addPort(80)
                  .build())
          .build();
  public static final Application AOL_PROXY =
      Application.builder("aol-proxy")
          .setDescription("built-in application aol-proxy")
          .addService(
              Service.builder("aol-proxy")
                  .setIpProtocol(IpProtocol.TCP)
                  .addPorts(80, 5192, 5190)
                  .build())
          .build();
  public static final Application BFD =
      Application.builder("bfd")
          .setDescription("built-in application bfd")
          .addService(
              Service.builder("bfd")
                  .setIpProtocol(IpProtocol.UDP)
                  .addPort(3784)
                  .addPort(3785)
                  .addPort(4784)
                  .build())
          .build();
  public static final Application BGP =
      Application.builder("bgp")
          .setDescription("built-in application bgp")
          .addService(Service.builder("bgp-tcp").setIpProtocol(IpProtocol.TCP).addPort(179).build())
          .addService(Service.builder("bgp-udp").setIpProtocol(IpProtocol.UDP).addPort(179).build())
          .build();
  public static final Application BOXNET =
      Application.builder("boxnet")
          .setDescription("built-in application boxnet")
          .addService(
              Service.builder("boxnet").setIpProtocol(IpProtocol.TCP).addPorts(80, 443).build())
          .build();
  public static final Application CISCO_SPARK_BASE =
      Application.builder("cisco-spark-base")
          .setDescription("built-in application cisco-spark-base")
          .addService(
              Service.builder("cisco-spark-base")
                  .setIpProtocol(IpProtocol.TCP)
                  .addPorts(80, 443)
                  .build())
          .build();
  public static final Application DHCP =
      Application.builder("dhcp")
          .setDescription("built-in application dhcp")
          .addService(
              Service.builder("dhcp-tcp").setIpProtocol(IpProtocol.TCP).addPorts(67, 68).build())
          .addService(
              Service.builder("dhcp-udp").setIpProtocol(IpProtocol.UDP).addPorts(67, 68).build())
          .build();
  public static final Application DNS =
      Application.builder("dns")
          .setDescription("built-in application dns")
          .addService(Service.builder("dns-tcp").setIpProtocol(IpProtocol.TCP).addPorts(53).build())
          .addService(
              Service.builder("dns-udp").setIpProtocol(IpProtocol.UDP).addPorts(53, 5353).build())
          .build();
  public static final Application FINGER =
      Application.builder("finger")
          .setDescription("built-in application finger")
          .addService(
              Service.builder("finger-tcp").setIpProtocol(IpProtocol.TCP).addPort(79).build())
          .addService(
              Service.builder("finger-udp").setIpProtocol(IpProtocol.UDP).addPorts(79).build())
          .build();

  public static final Application FTP =
      Application.builder("ftp")
          .setDescription("built-in application ftp")
          .addService(Service.builder("ftp").setIpProtocol(IpProtocol.TCP).addPort(21).build())
          .build();

  public static final Application GNUTELLA =
      // No well-known ports, DPI only
      Application.builder("gnutella").setDescription("built-in application gnutella").build();

  public static final Application GRE =
      Application.builder("gre")
          .setDescription("built-in application gre")
          .addService(Service.builder("gre").setIpProtocol(IpProtocol.GRE).build())
          .build();

  public static final Application GOOGLE_BASE =
      Application.builder("google-base")
          .setDescription("built-in application google-base")
          .addService(
              Service.builder("google-base")
                  .setIpProtocol(IpProtocol.TCP)
                  .addPorts(80, 443, 5228, 5229)
                  .addPorts(new SubRange(5222, 5224))
                  .build())
          .build();

  public static final Application GOPHER =
      Application.builder("gopher")
          .setDescription("built-in application gopher")
          .addService(Service.builder("gopher").setIpProtocol(IpProtocol.TCP).addPort(70).build())
          .build();

  public static final Application ICMP =
      Application.builder("icmp")
          .setDescription("built-in application icmp")
          .addService(Service.builder("icmp").setIpProtocol(IpProtocol.ICMP).build())
          .build();
  public static final Application LDAP =
      Application.builder("ldap")
          .setDescription("built-in application ldap")
          .addService(
              Service.builder("ldap tcp")
                  .setIpProtocol(IpProtocol.TCP)
                  .addPorts(389, 636, 3268, 3269)
                  .build())
          .addService(
              Service.builder("ldap udp").setIpProtocol(IpProtocol.UDP).addPorts(389, 3268).build())
          .build();

  public static final Application MCSQL_MON =
      Application.builder("mssql-mon")
          .setDescription("built-in application mssql-mon")
          .addService(
              Service.builder("mssql-mon").setIpProtocol(IpProtocol.UDP).addPort(1434).build())
          .build();

  public static final Application MS_DS_SMB =
      Application.builder("ms-ds-smb")
          .setDescription("built-in application ms-ds-smb")
          .addService(
              Service.builder("ms-ds-smb tcp")
                  .setIpProtocol(IpProtocol.TCP)
                  .addPorts(139, 445)
                  .build())
          .addService(
              Service.builder("ms-ds-smb udp").setIpProtocol(IpProtocol.UDP).addPorts(445).build())
          .build();
  public static final Application MSN =
      Application.builder("msn")
          .setDescription("built-in application msn")
          .addService(
              Service.builder("msn tcp")
                  .setIpProtocol(IpProtocol.TCP)
                  .addPorts(1863, 80, 7001, 443)
                  .addPorts(new SubRange(1025, 65535))
                  .build())
          .addService(
              Service.builder("msn udp")
                  .setIpProtocol(IpProtocol.UDP)
                  .addPorts(new SubRange(1025, 65535))
                  .addPorts(7001)
                  .build())
          .build();
  public static final Application MS_NETLOGON =
      Application.builder("ms-netlogon")
          .setDescription("built-in application ms-netlogon")
          .addService(
              Service.builder("ms-netlogon tcp")
                  .setIpProtocol(IpProtocol.TCP)
                  .addPorts(135, 139, 445)
                  .addPorts(new SubRange(1025, 5000))
                  .addPorts(new SubRange(49152, 65535))
                  .build())
          .addService(
              Service.builder("ms-netlogon udp")
                  .setIpProtocol(IpProtocol.UDP)
                  .addPorts(137, 138, 445)
                  .build())
          .build();
  public static final Application MS_KMS =
      Application.builder("ms-kms")
          .setDescription("built-in application ms-kms")
          .addService(
              Service.builder("ms-kms tcp").setIpProtocol(IpProtocol.TCP).addPorts(1688).build())
          .build();
  public static final Application MSRPC =
      // No well-known ports, DPI only
      Application.builder("msrpc").setDescription("built-in application msrpc").build();
  public static final Application MSSQL_DB =
      Application.builder("mssql-db")
          .addService(
              Service.builder("mssql-db tcp").setIpProtocol(IpProtocol.TCP).addPorts(1433).build())
          .addService(
              Service.builder("mssql-db udp").setIpProtocol(IpProtocol.UDP).addPorts(1433).build())
          .setDescription("built-in application mssql-db")
          .build();
  public static final Application NETBIOS_SS =
      Application.builder("netbios-ss")
          .setDescription("built-in application netbios-ss")
          .addService(
              Service.builder("netbios-ss").setIpProtocol(IpProtocol.TCP).addPorts(139).build())
          .build();
  public static final Application NTP =
      Application.builder("ntp")
          .setDescription("built-in application ntp")
          .addService(
              Service.builder("ntp tcp").setIpProtocol(IpProtocol.TCP).addPorts(123).build())
          .addService(
              Service.builder("ntp udp").setIpProtocol(IpProtocol.UDP).addPorts(123).build())
          .build();
  public static final Application OFFICE365_ENTERPRISE_ACCESS =
      Application.builder("office365-enterprise-access")
          .setDescription("built-in application office365-enterprise-access")
          .addService(
              Service.builder("office365-enterprise-access")
                  .setIpProtocol(IpProtocol.TCP)
                  .addPorts(80, 443)
                  .build())
          .build();
  public static final Application OSPF =
      Application.builder("ospf")
          .setDescription("built-in application ospf")
          .addService(Service.builder("ospf").setIpProtocol(IpProtocol.OSPF).build())
          .build();
  public static final Application PAN_DB_CLOUD =
      Application.builder("pan-db-cloud")
          .setDescription("built-in application pan-db-cloud")
          .addService(
              Service.builder("pan-db-cloud tcp")
                  .setIpProtocol(IpProtocol.TCP)
                  .addPorts(443)
                  .build())
          .build();
  public static final Application PIM =
      Application.builder("pim")
          .setDescription("built-in application pim")
          .addService(Service.builder("pim").setIpProtocol(IpProtocol.PIM).build())
          .build();
  public static final Application PING =
      Application.builder("ping")
          .setDescription("built-in application ping")
          .addService(Service.builder("ping").setIpProtocol(IpProtocol.ICMP).build())
          .build();
  public static final Application PC_ANYWHERE =
      Application.builder("pcanywhere")
          .setDescription("built-in application pcanywhere")
          .addService(
              Service.builder("pcanywhere-tcp")
                  .setIpProtocol(IpProtocol.TCP)
                  .addPorts(5631, 65301)
                  .build())
          .addService(
              Service.builder("pcanywhere-udp")
                  .setIpProtocol(IpProtocol.UDP)
                  .addPorts(22, 5632)
                  .build())
          .build();
  public static final Application POP3 =
      Application.builder("pop3")
          .setDescription("built-in application pop3")
          .addService(Service.builder("pop3").setIpProtocol(IpProtocol.TCP).addPort(110).build())
          .build();
  public static final Application RPC =
      // No well-known ports, DPI only
      Application.builder("rpc").setDescription("built-in application rpc").build();
  public static final Application RTCP =
      Application.builder("rtcp")
          .setDescription("built-in application rtcp")
          .addService(
              Service.builder("rtcp")
                  .setIpProtocol(IpProtocol.UDP)
                  .addPorts(new SubRange(1, 65535)) // udp/dynamic
                  .build())
          .build();
  public static final Application RTP_BASE =
      Application.builder("rtp-base")
          .setDescription("built-in application rtp-base")
          .addService(
              Service.builder("rtp-base")
                  .setIpProtocol(IpProtocol.UDP)
                  .addPorts(new SubRange(1, 65535)) // udp/dynamic
                  .build())
          .build();
  public static final Application SMTP =
      Application.builder("smtp")
          .setDescription("built-in application smtp")
          .addService(
              Service.builder("smtp").setIpProtocol(IpProtocol.TCP).addPorts(25, 587).build())
          .build();
  public static final Application SNMP =
      Application.builder("snmp")
          .setDescription("built-in application snmp")
          .addService(
              Service.builder("snmp tcp").setIpProtocol(IpProtocol.TCP).addPorts(161).build())
          .addService(
              Service.builder("snmp udp").setIpProtocol(IpProtocol.UDP).addPorts(161).build())
          .build();
  public static final Application SNMP_TRAP =
      Application.builder("snmp-trap")
          .setDescription("built-in application snmp-trap")
          .addService(
              Service.builder("snmp-trap tcp").setIpProtocol(IpProtocol.TCP).addPorts(162).build())
          .addService(
              Service.builder("snmp-trap udp").setIpProtocol(IpProtocol.UDP).addPorts(162).build())
          .build();
  public static final Application SOAP =
      Application.builder("soap")
          .setDescription("built-in application soap")
          .addService(
              Service.builder("soap").setIpProtocol(IpProtocol.TCP).addPorts(80, 443).build())
          .build();
  public static final Application SSH =
      Application.builder("ssh")
          .setDescription("built-in application ssh")
          .addService(Service.builder("ssh").setIpProtocol(IpProtocol.TCP).addPort(22).build())
          .build();
  public static final Application SSL =
      Application.builder("ssl")
          .setDescription("built-in application ssl")
          .addService(Service.builder("ssl").setIpProtocol(IpProtocol.TCP).addPort(443).build())
          .build();
  public static final Application STUN =
      Application.builder("stun")
          .setDescription("built-in application stun")
          .addService(
              Service.builder("stun tcp").setIpProtocol(IpProtocol.TCP).addPort(3478).build())
          .addService(
              Service.builder("stun udp").setIpProtocol(IpProtocol.UDP).addPort(3478).build())
          .build();
  public static final Application SYSLOG =
      Application.builder("syslog")
          .setDescription("built-in application syslog")
          .addService(
              Service.builder("syslog tcp")
                  .setIpProtocol(IpProtocol.TCP)
                  .addPort(1468)
                  .addPort(1514)
                  .addPort(6514)
                  .build())
          .addService(
              Service.builder("syslog udp")
                  .setIpProtocol(IpProtocol.UDP)
                  .addPort(514)
                  .addPort(1514)
                  .build())
          .build();
  public static final Application TACACS =
      Application.builder("tacacs")
          .setDescription("built-in application tacacs")
          .addService(Service.builder("tacacs").setIpProtocol(IpProtocol.TCP).addPort(49).build())
          .build();
  public static final Application TACACS_PLUS =
      Application.builder("tacacs-plus")
          .setDescription("built-in application tacacs-plus")
          .addService(
              Service.builder("tacacs-plus").setIpProtocol(IpProtocol.TCP).addPort(49).build())
          .build();
  public static final Application TRACEROUTE =
      Application.builder("traceroute")
          .setDescription("built-in application traceroute")
          .addService(Service.builder("traceroute icmp").setIpProtocol(IpProtocol.ICMP).build())
          .addService(
              Service.builder("traceroute icmpv6").setIpProtocol(IpProtocol.IPV6_ICMP).build())
          .addService(
              Service.builder("traceroute udp")
                  .setIpProtocol(IpProtocol.UDP)
                  .addPorts(new SubRange(33434, 33534))
                  .build())
          .build();
  public static final Application WEB_BROWSING =
      Application.builder("web-browsing")
          .setDescription("built-in application web-browsing")
          .addService(
              Service.builder("web-browsing").setIpProtocol(IpProtocol.TCP).addPort(80).build())
          .build();
  public static final Application WEBEX =
      Application.builder("webex")
          .setDescription("built-in application webex")
          .addService(
              Service.builder("webex tcp")
                  .setIpProtocol(IpProtocol.TCP)
                  .addPorts(80, 443, 1270)
                  .build())
          .addService(
              Service.builder("webex udp")
                  .setIpProtocol(IpProtocol.UDP)
                  .addPorts(8070, 8090, 9000)
                  .build())
          .build();
  public static final Application WEBSOCKET =
      Application.builder("websocket")
          .setDescription("built-in application websocket")
          .addService(
              Service.builder("websocket")
                  .setIpProtocol(IpProtocol.TCP)
                  .addPorts(80, 443, 8080)
                  .build())
          .build();

  private static final List<Application> BUILTIN_LIST =
      ImmutableList.of(
          AMAZON_CLOUD_DRIVE_BASE,
          AMAZON_CLOUD_DRIVE_UPLOADING,
          AOL_MESSAGEBOARD_POSTING,
          AOL_PROXY,
          BFD,
          BGP,
          BOXNET,
          CISCO_SPARK_BASE,
          DHCP,
          DNS,
          FINGER,
          FTP,
          GNUTELLA,
          GRE,
          GOOGLE_BASE,
          GOPHER,
          ICMP,
          LDAP,
          MCSQL_MON,
          MS_DS_SMB,
          MS_KMS,
          MSN,
          MS_NETLOGON,
          MSSQL_DB,
          MSRPC,
          NETBIOS_SS,
          NTP,
          OFFICE365_ENTERPRISE_ACCESS,
          OSPF,
          PAN_DB_CLOUD,
          PC_ANYWHERE,
          PIM,
          PING,
          POP3,
          RPC,
          RTCP,
          RTP_BASE,
          SMTP,
          SNMP,
          SNMP_TRAP,
          SOAP,
          SSH,
          SSL,
          STUN,
          SYSLOG,
          TACACS,
          TACACS_PLUS,
          TRACEROUTE,
          WEB_BROWSING,
          WEBEX,
          WEBSOCKET);

  private static final Map<String, Application> BUILTINS =
      BUILTIN_LIST.stream()
          .collect(ImmutableMap.toImmutableMap(Application::getName, Function.identity()));

  /**
   * Returns the definition of the builtin corresponding to the named {@link Application}, or an
   * absent {@link Optional} if none exists (or has had its definition implemented here).
   */
  public static @Nonnull Optional<Application> getBuiltInApplication(@Nonnull String name) {
    return Optional.ofNullable(BUILTINS.get(name));
  }

  private ApplicationBuiltIn() {} // prevent instantiation of utility class
}


text:
package com.tuplejump.calliope

import java.nio.ByteBuffer
import org.apache.cassandra.utils.ByteBufferUtil
import org.scalatest.FunSpec
import org.scalatest.matchers.{MustMatchers, ShouldMatchers}
import com.tuplejump.calliope.utils.RichByteBuffer

class RichByteBufferSpec extends FunSpec with ShouldMatchers with MustMatchers {
  describe("RichByteBuffer") {

    import RichByteBuffer._

    it("should should add implicit conversion of ByteBuffer to String") {
      val b = ByteBufferUtil.bytes("Test")

      b.length must be(4) //Should come from test
      "Test".equalsIgnoreCase(b) must be(true)
    }

    it("should add implicit conversion of ByteBuffer to Int") {
      val b: ByteBuffer = ByteBufferUtil.bytes(100)

      100 % b must be(0)
    }

    it("should add implicit conversion of ByteBuffer to Double") {
      val b: ByteBuffer = ByteBufferUtil.bytes(100)

      300d - b must be(200d)
    }

    it("should add implicit conversion of ByteBuffer to Long") {
      val b: ByteBuffer = ByteBufferUtil.bytes(100)

      300l - b must be(200l)
    }

    it("should ease the conversion of list to case class") {
      case class Person(name: String, age: Int)
      val l: List[ByteBuffer] = List("Joey", 10)

      def list2Person(list: List[ByteBuffer]) = Person(list(0), list(1)) //One line boiler plate

      val p = list2Person(l)

      p.isInstanceOf[Person] must be(true)

      p.name must be("Joey")
      p.age must be(10)
    }

    it("should ease the conversion to typed Tuple") {
      val l: List[ByteBuffer] = List("Joey", 10)

      def list2Tuple2(list: List[ByteBuffer]) = new Tuple2[String, Int](list(0), list(1)) //One line boiler plate

      val p = list2Tuple2(l)

      p.isInstanceOf[Tuple2[_, _]] must be(true)

      p._1 must be("Joey")
      p._2 must be(10)
    }

  }
}


text:
/*
 *  unspcs.c:
 *  1998/08             kmatsui
 *
 *   These texts are unportable ones, because the order of the evaluation is
 * unspecified.  Good preprocessor will warn at these texts even if the
 * results are valid.  Good preprocessor will also document the order of
 * evaluation and the behavior on invalid results.
 *   Note: Order of evaluation of sub-expressions (other than operands of &&,
 * ||, ? :) of #if expression is also unspecified.  The order, however, never
 * affects the result, because #if expression never cause side effect, so no
 * warning is necessary.  Precedence and grouping rules of operators are other
 * things than order of evaluation, and shall be obeyed by preprocessor.
 *
 *  2003/03 Rewritten for testsuite.        kmatsui
 */

/* { dg-do preprocess } */
/* { dg-options "-ansi -pedantic -Wall" }   */

#define str( a)     # a
#define xstr( a)    str( a)

/* s.1.1:   Order of evaluation of #, ## operators. */
#define MAKWIDESTR( s)  L ## # s    /* { dg-warning "Macro with mixing of ## and # operators isn't portable" } */
/*  Either of L"name"; or L# name; ("L#" is not a valid pp-token).  */
    MAKWIDESTR( name);

/* s.1.2:   Order of evaluation of ## operators.    */
#define glue3( a, b, c)     a ## b ## c     /* { dg-warning "Macro with multiple ## operators isn't portable" } */
/*  "1.a" or undefined, since .a is not a valid pp-token, while 1. and 1.a are
        valid pp-tokens.    */
    xstr( glue3( 1, ., a));


text:
Thank you for your interest in contributing to Pollarity!

This one-page web app was originally designed as a Dev Bootcamp final project by Matt Bogen, Connor Ring, Jay Quigley, and Jasmine Feldmann. It uses the Huffington Post Pollster API to gather poll data, the D3 library to visualize the data into maps, charts, and bar graphs, Backbone.js to structure our front-end, and the Python SKlearn library as well as clustering methods to make predictions.

### Submitting Issues

To submit an issue, please include the file and folder name, as well as a screen shot of the issue being noted. Any relevant errors or reasons why you think this issue needs to be addressed would be extremely helpful.

### Pull Requests

When submitting a pull request, please include a screen shot of the changes.

### Git Commit Messages

Git commit messages should be stated in the present tense using the imperative. (Ex. "Add legend to bar chart").


text:
'use strict';

// Reviews controller
angular.module('reviews').controller('ReviewsController', ['$scope', '$stateParams', '$location', 'Authentication', 'Reviews',
	function($scope, $stateParams, $location, Authentication, Reviews) {
		$scope.authentication = Authentication;

		// Create new Review
		$scope.create = function() {
			// Create new Review object
			var review = new Reviews ({
				name: this.name
			});

			// Redirect after save
			review.$save(function(response) {
				$location.path('reviews/' + response._id);

				// Clear form fields
				$scope.name = '';
			}, function(errorResponse) {
				$scope.error = errorResponse.data.message;
			});
		};

		// Remove existing Review
		$scope.remove = function(review) {
			if ( review ) {
				review.$remove();

				for (var i in $scope.reviews) {
					if ($scope.reviews [i] === review) {
						$scope.reviews.splice(i, 1);
					}
				}
			} else {
				$scope.review.$remove(function() {
					$location.path('reviews');
				});
			}
		};

		// Update existing Review
		$scope.update = function() {
			var review = $scope.review;

			review.$update(function() {
				$location.path('reviews/' + review._id);
			}, function(errorResponse) {
				$scope.error = errorResponse.data.message;
			});
		};

		// Find a list of Reviews
		$scope.find = function() {
			$scope.reviews = Reviews.query();
		};

		// Find existing Review
		$scope.findOne = function() {
			$scope.review = Reviews.get({
				reviewId: $stateParams.reviewId
			});
		};
	}
]);


text:
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>handler_type</title>
<link rel="stylesheet" href="../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="../../index.html" title="Asio">
<link rel="up" href="../reference.html" title="Reference">
<link rel="prev" href="get_associated_executor/overload3.html" title="get_associated_executor (3 of 3 overloads)">
<link rel="next" href="handler_type/type.html" title="handler_type::type">

handler_type

        Default handler type traits provided for all completion token types.

template<
    typename CompletionToken,
    typename Signature,
    typename  = void>
struct handler_type

        Types

<colgroup>
<col>
<col>
</colgroup>

                  Name

                  Description

                  type

                  The handler type for the specific signature.

        The handler_type
        traits class is used for determining the concrete handler type to be used
        for an asynchronous operation. It allows the handler type to be determined
        at the point where the specific completion handler signature is known.

        This template may be specialised for user-defined completion token types.

        Requirements

        Header: asio/handler_type.hpp

        Convenience header: asio.hpp

Copyright © 2003-2015 Christopher M.
      Kohlhoff

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)