text:
/* Check to see if the file has been included already.  */

#ifndef __INC_EFUSE_H
#define __INC_EFUSE_H

// Roger porting for 8192SU
#define		EFUSE_FOR_92SU		1

/*--------------------------Define Parameters-------------------------------*/
#define		EFUSE_MAC_LEN					0x200

#define		EFUSE_INIT_MAP				0
#define		EFUSE_MODIFY_MAP				1

#define		EFUSE_CLK_CTRL			EFUSE_CTRL
#define 	EFUSE_BIT(x)  (1 << (x))

// From 8712!!!!!!!!
#define		PG_STATE_HEADER 	0x01
#define		PG_STATE_WORD_0		0x02
#define		PG_STATE_WORD_1		0x04
#define		PG_STATE_WORD_2		0x08
#define		PG_STATE_WORD_3		0x10
#define		PG_STATE_DATA		0x20

#define		PG_SWBYTE_H			0x01
#define		PG_SWBYTE_L			0x02

/*--------------------------Define Parameters-------------------------------*/

/*------------------------------Define structure----------------------------*/

/*------------------------------Define structure----------------------------*/

/*------------------------Export global variable----------------------------*/
/*------------------------Export global variable----------------------------*/

/*------------------------Export Marco Definition---------------------------*/

/*------------------------Export Marco Definition---------------------------*/

/*--------------------------Exported Function prototype---------------------*/
extern	void
EFUSE_Initialize(struct net_device* dev);
extern	u8
EFUSE_Read1Byte(struct net_device* dev,u16 Address);
extern	void
EFUSE_Write1Byte(struct net_device* dev,u16 Address,u8 Value);

#ifdef EFUSE_FOR_92SU
extern 	void
ReadEFuse(struct net_device* dev,u16 _offset,u16 _size_byte,u8* pbuf);
extern	void
ReadEFuseByte(struct net_device* dev,u16  _offset,u8  *pbuf);
#endif	// #if (EFUSE_FOR_92SU == 1)

extern	void
EFUSE_ShadowRead(struct net_device* dev,unsigned char Type,unsigned short Offset,u32 *Value);
extern	void
EFUSE_ShadowWrite(struct net_device* dev,unsigned char Type,unsigned short Offset,u32 Value);
extern	void
EFUSE_ShadowUpdate(struct net_device* dev);
extern	void
EFUSE_ShadowMapUpdate(struct net_device* dev);

extern	bool
EFUSE_ProgramMap(struct net_device* dev,char* pFileName, u8 TableType);		// 0=Shadow 1=Real Efuse
/*--------------------------Exported Function prototype---------------------*/

/* End of Efuse.h */

#endif //__INC_EFUSE_H


text:
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGroupStatusesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('group_statuses', function (Blueprint $table) {
            $table->increments('id');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('group_statuses');
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.brotherjing.utils.bean;

import com.brotherjing.utils.Protocol;
import com.google.gson.annotations.SerializedName;

/**
 * Created by Brotherjing on 2015/10/10.
 */
public class TextMessage extends Message{

    @SerializedName("text")
    String text;

    public TextMessage(String from, String timestamp, String text) {
        super(from,timestamp, Protocol.MSG_TYPE_TEXT);
        this.text = text;
    }

    public TextMessage(String text) {
        super("","", Protocol.MSG_TYPE_TEXT);
        this.text = text;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }
}


text:
package main

import (
	"os"

	"github.com/codegangsta/cli"
	"github.com/oleiade/trousseau"
)

func main() {
	app := cli.NewApp()

	app.Name = "trousseau"
	app.Author = "oleiade"
	app.Email = "tcrevon@gmail.com"
	app.Usage = "Create, manage and share an encrypted data store"
	app.Version = trousseau.TROUSSEAU_VERSION
	app.Commands = []cli.Command{
		CreateCommand(),
		SetCommand(),
		GetCommand(),
		RenameCommand(),
		DelCommand(),
		KeysCommand(),
		ShowCommand(),
		ExportCommand(),
		ImportCommand(),
		PushCommand(),
		PullCommand(),
		ListRecipientsCommand(),
		AddRecipientCommand(),
		RemoveRecipientCommand(),
		MetaCommand(),
		UpgradeCommand(),
	}
	app.Flags = []cli.Flag{
		cli.BoolFlag{
			Name:  "verbose",
			Usage: "Set trousseau in verbose mode",
		},
		cli.StringFlag{
			Name:  "store, s",
			Usage: "Path to the trousseau data store to use",
		},
		cli.StringFlag{
			Name: "gnupg-home",
			Usage: "Provide an alternate gnupg home",
		},
	}

	app.Before = Before
	app.Run(os.Args)
}


text:
require "spec_helper"

feature("Search Views") do
  background do
    # Setup BG Stuff
  end

  scenario("Nav Bar") do
    # it("TODO(jon): Write this test")
  end

  scenario("Page Entries Info") do
    visit("/upmin/m/User")

    # Make sure some basic page entries info exists
    within(".page-entries-info") do
      within("b:first-of-type") do
        expect(page).to(have_content("1 - 30"))
      end

      expect(page).to(have_content("of"))
      expect(page).to(have_content("in total"))
    end
  end

  scenario("Pagination") do
    visit("/upmin/m/User")

    # Make sure some basic pagination exists
    within(".pagination:first-of-type") do
      within(".active, .current") do
        expect(page).to(have_content("1"))
      end

      expect(page).to(have_content("Next"))
      click_link("Next")
    end

    within(".pagination:nth-of-type(2)") do
      within(".active, .current") do
        expect(page).to(have_content("2"))
      end

      expect(page).to(have_content("Next"))
      expect(page).to(have_content("Prev"))

      click_link("3")
    end

    within(".pagination:last-of-type") do
      within(".active, .current") do
        expect(page).to(have_content("3"))
      end
    end
  end

  scenario("Search via integer") do
    visit("/upmin/m/User")

    expect(page).to(have_selector("a.search-result-link", count: 30))

    fill_in("q_id_gteq", with: 2)
    fill_in("q_id_lteq", with: 5)
    click_button("Search")

    expect(page).to(have_selector("a.search-result-link", count: 4))
  end

  scenario("config.items_per_page") do
    Upmin.configuration.items_per_page = 25

    visit("/upmin/m/Order")

    # Global config of 25 should override default of 30
    expect(page).to(have_selector("a.search-result-link", count: 25))

    # Reset this.
    Upmin.configuration = Upmin::Configuration.new
  end

  scenario("Model items_per_page with config.items_per_page") do
    Upmin.configuration.items_per_page = 25

    visit("/upmin/m/Shipment")

    # `items_per_page 20` in the model should override global config of 25
    expect(page).to(have_selector("a.search-result-link", count: 20))

    # Reset this.
    Upmin.configuration = Upmin::Configuration.new
  end

end


text:
<?php
namespace Laranix\Session;

use Carbon\Carbon;
use Illuminate\Contracts\Config\Repository;
use Illuminate\Http\Request;
use Laranix\Support\Exception\NullValueException;
use SessionHandlerInterface;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\QueryException;

class Handler implements SessionHandlerInterface
{
    /**
     * Config repository
     *
     * @var \Illuminate\Contracts\Config\Repository
     */
    protected $config;

    /**
     * @var \Illuminate\Http\Request
     */
    protected $request;

    /**
     * @var \Laranix\Session\Session
     */
    protected $session;

    /**
     * @var string|null
     */
    protected $sessionRead = null;

    /**
     * Create a new database session handler instance.
     *
     * @param \Illuminate\Contracts\Config\Repository $config
     * @param \Illuminate\Http\Request                $request
     */
    public function __construct(Repository $config, Request $request)
    {
        $this->config = $config;
        $this->request = $request;
    }

    /**
    * {@inheritdoc}
    */
    public function open($save_path, $name)
    {
        return true;
    }

    /**
     * {@inheritdoc}
     */
    public function close()
    {
        return true;
    }

    /**
     * {@inheritdoc}
     */
    public function read($session_id)
    {
        $this->session = $this->readFromDatabase($session_id, $this->request->getClientIp());

        if ($this->session === null || $this->expired($this->session) || !isset($this->session->data)) {
            return null;
        }

        $this->sessionRead = $this->session->id;

        return base64_decode($this->session->data);
    }

    /**
     * Determine if the session is expired.
     *
     * @param  \Laranix\Session\Session  $session
     * @return bool
     */
    protected function expired(?Session $session)
    {
        if ($session === null) {
            return false;
        }

        if ($session->updated_at === null) {
            return false;
        }

        return Carbon::now()->diffInMinutes($session->updated_at) > $this->config->get('session.lifetime', 120);
    }

    /**
     * {@inheritdoc}
     */
    public function write($session_id, $data)
    {
        $payload = $this->getPayload($session_id, $data);

        if ($this->sessionRead === null || $this->sessionRead !== $session_id) {
            $this->read($session_id);
        }

        if ($this->session !== null) {
            $this->performUpdate($this->session, $payload);
        } else {
            $this->performInsert($payload);
        }

        return true;
    }

    /**
     * Perform an insert operation on the session ID.
     *
     * @param  array   $payload
     * @return \Laranix\Support\Database\Model
     */
    protected function performInsert(array $payload)
    {
        try {
            return $this->session = Session::createNew($payload);
        } catch (QueryException $e) {
            $this->performUpdate($this->session, $payload);
        }

        return $this->session;
    }

    /**
     * Perform an update operation on the session ID.
     *
     * @param \Laranix\Session\Session $session
     * @param  array                   $payload
     * @return int
     * @throws \Laranix\Support\Exception\NullValueException
     */
    protected function performUpdate(?Session $session, array $payload)
    {
        if ($session === null) {
            throw new NullValueException('Attempted to update null session');
        }

        return $session->updateExisting($payload);
    }

    /**
     * Get session payload
     *
     * @param string       $session_id
     * @param string|array $data
     * @return array
     */
    protected function getPayload(string $session_id, $data) : array
    {
        return [
            'id'            => $session_id,
            'user_id'       => $this->request->user()->id ?? null,
            'ipv4'          => $this->getLongIp(),
            'user_agent'    => $this->request->server('HTTP_USER_AGENT'),
            'data'          => base64_encode(is_array($data) ? serialize($data) : $data),
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function destroy($session_id)
    {
        $this->getModel()
             ->newQuery()
             ->where('id', $session_id)
             ->delete();
    }

    /**
     * {@inheritdoc}
     */
    public function gc($maxlifetime)
    {
        $this->getModel()
             ->newQuery()
             ->where('updated_at', '<=', Carbon::now()->subSeconds($maxlifetime)->toDateTimeString())
             ->delete();
    }

    /**
     * Read session from database
     *
     * @param string     $session_id
     * @param string|int $ip
     * @return \Illuminate\Database\Eloquent\Model|\Laranix\Session\Session|null
     */
    protected function readFromDatabase(string $session_id, $ip) : ?Model
    {
        return $this->getModel()
                    ->newQuery()
                    ->where('id', $session_id)
                    ->where('ipv4', $this->getLongIp($ip))
                    ->first();
    }

    /**
     * Get ip in long format
     *
     * @param string|int $ip
     * @return int
     */
    protected function getLongIp($ip = null) : int
    {
        if ($ip === null) {
            $ip = $this->request->getClientIp();
        }

        return is_int($ip) ? $ip : ip2long($ip);
    }

    /**
     * @return \Illuminate\Database\Eloquent\Model|\Laranix\Session\Session
     */
    public function getModel() : Model
    {
        return new Session();
    }
}


text:
module Crucible
  module Tests
    class TestResult

      attr_accessor :key
      attr_accessor :id
      attr_accessor :description
      attr_accessor :status
      attr_accessor :message
      attr_accessor :data
      attr_accessor :warnings
      attr_accessor :requires
      attr_accessor :validates
      attr_accessor :links
      attr_accessor :code

      def initialize(key, description, status, message, data)
        @key = key
        @status = status
        @description = description
        @message = message
        @data = data
      end

      def update(status, message, data)
        @status = status
        @message = message
        @data = data
        self
      end

      def passed?
        return ( (@status==true) or (@status=='passed') )
      end

      def failed?
        !self.passed?
      end

      def to_hash
        hash = {}
        hash['key'] = @key
        hash['id'] = @id || @key
        hash['description'] = force_encoding(@description)
        hash['status'] = force_encoding(@status)
        if @message.class == Array
          hash['message'] = @message.map { |m| force_encoding(m) }
        else
          hash['message'] = force_encoding(@message)
        end
        hash['data'] = force_encoding(@data) unless hash['status'] == 'pass'
        hash['warnings'] = warnings if warnings
        hash['requires'] = requires if requires
        hash['validates'] = validates if validates
        hash['links'] = links if links
        hash['code'] = @code
        hash
      end

      private

      def force_encoding(value)
        return nil if value.blank?
        value.force_encoding("UTF-8")
      end

    end
  end
end


text:
// Copyright (c) 2013 - 2017 James Skimming. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

namespace AutoTest.ArgNullEx.Xunit
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Reflection;

    /// <summary>
    /// Base class for test methods decorated with
    /// <see cref="RequiresArgumentNullExceptionAttribute"/>.
    /// </summary>
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
    public abstract class CustomizeAttribute : Attribute
    {
        /// <summary>
        /// Gets a customization for a test method.
        /// </summary>
        /// <param name="method">The method to be customized.</param>
        /// <returns>A customization for a test method.</returns>
        /// <exception cref="ArgumentNullException">The <paramref name="method"/> parameter is
        /// <see langword="null"/>.</exception>
        public abstract IArgNullExCustomization GetCustomization(MethodInfo method);
    }
}


text:
package com.amazonaws.services.s3.internal.crypto;

import java.io.IOException;
import java.io.InputStream;

import com.amazonaws.internal.SdkFilterInputStream;
import com.amazonaws.services.s3.internal.crypto.v1.S3CryptoScheme;
import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;

/**
 * @author Hanson Char
 *
 * @see CipherLite
 * @see GCMCipherLite
 */
public class CipherLiteInputStream extends SdkFilterInputStream {
    private static final int MAX_RETRY = 1000;
    private static final int DEFAULT_IN_BUFFER_SIZE = 512;
    private CipherLite cipherLite;
    /**
     * True if this input stream is currently involved in a multipart uploads;
     * false otherwise. For multipart uploads, the doFinal method if the
     * underlying cipher has to be triggered via the read methods rather than
     * the close method, since we cann't tell if closing the input stream is due
     * to a recoverable error (in which case the cipher's doFinal method should
     * never be called) or normal completion (where the cipher's doFinal method
     * would need to be called if it was not a multipart upload).
     */
    private final boolean multipart;
    /**
     * True if this is the last part of a multipart upload; false otherwise.
     */
    private final boolean lastMultiPart;
    private boolean eof;
    private byte[] bufin;
    private byte[] bufout;
    private int curr_pos;
    private int max_pos;

    public CipherLiteInputStream(InputStream is, CipherLite cipherLite) {
        this(is, cipherLite, DEFAULT_IN_BUFFER_SIZE, false, false);
    }

    public CipherLiteInputStream(InputStream is, CipherLite c, int buffsize) {
        this(is, c, buffsize, false, false);
    }

    public CipherLiteInputStream(InputStream is, CipherLite c, int buffsize,
            boolean multipart, boolean lastMultiPart) {
        super(is);
        if (lastMultiPart && !multipart)
            throw new IllegalArgumentException("lastMultiPart can only be true if multipart is true");
        this.multipart = multipart;
        this.lastMultiPart = lastMultiPart;
        this.cipherLite = c;
        if (buffsize <= 0 || (buffsize % DEFAULT_IN_BUFFER_SIZE) != 0) {
            throw new IllegalArgumentException("buffsize (" + buffsize
                    + ") must be a positive multiple of "
                    + DEFAULT_IN_BUFFER_SIZE);
        }
        this.bufin = new byte[buffsize];
    }

    public CipherLiteInputStream(InputStream is) {
        this(is, CipherLite.Null, DEFAULT_IN_BUFFER_SIZE, false, false);
    }

    @Override public int read() throws IOException {
        if (!readNextChunk())
            return -1;
        return ((int) bufout[curr_pos++] & 0xFF);
    }

    @Override public int read(byte b[]) throws IOException {
        return read(b, 0, b.length);
    }

    @Override
    public int read(byte buf[], int off, int target_len) throws IOException {
        if (!readNextChunk())
            return -1;
        if (target_len <= 0)
            return 0;
        int len = max_pos - curr_pos;
        if (target_len < len)
            len = target_len;
        // if buf == null, will throw NPE as intended per javadoc
        System.arraycopy(bufout, curr_pos, buf, off, len);
        curr_pos += len;
        return len;
    }

    private boolean readNextChunk() throws IOException {
        if (curr_pos >= max_pos) {
            // all buffered data has been read, let's get some more
            if (eof)
                return false;
            int count=0;
            int len;
            do {
                if (count > MAX_RETRY)
                    throw new IOException("exceeded maximum number of attempts to read next chunk of data");
                len = nextChunk();
                // if buf != null, it means that data is being read off of the InputStream
                if (bufout == null) {
                    count++;
                }
            } while (len == 0);

            if (len == -1)
                return false;
        }
        return true;
    }

    /**
     * {@inheritDoc}
     *

     * Note: This implementation will only skip up to the end of the buffered
     * data, potentially skipping 0 bytes.
     */
    @Override public long skip(long n) throws IOException {
        abortIfNeeded();
        int available = max_pos - curr_pos;
        if (n > available)
            n = available;
        if (n < 0)
            return 0;
        curr_pos += n;
        return n;
    }

    @Override public int available() {
        abortIfNeeded();
        return max_pos - curr_pos;
    }

    @Override public void close() throws IOException {
        in.close();
        // For multipart upload the doFinal has to be triggered via the read
        // methods, since we cann't tell if the close is due to error or normal
        // completion.
        if (!multipart) {
            if (!S3CryptoScheme.isAesGcm(cipherLite.getCipherAlgorithm())) {
                try {
                    // simulate the RI: throw away the unprocessed data
                    cipherLite.doFinal();
                } catch (BadPaddingException ex) {
                } catch (IllegalBlockSizeException ex) {
                }
            }
        }
        curr_pos = max_pos = 0;
        abortIfNeeded();
    }

    @Override
    public boolean markSupported() {
        abortIfNeeded();
        return in.markSupported() && cipherLite.markSupported();
    }

    @Override
    public void mark(int readlimit) {
        abortIfNeeded();
        in.mark(readlimit);
        cipherLite.mark();
    }

    /**
     * {@inheritDoc}
     *

     * Subclassing this method would need to take care in keeping all internal
     * states consistent.  REF: TT0036173414, ISSUE-JAVA-547.
     */
    @Override
    public void reset() throws IOException {
        abortIfNeeded();
        in.reset();
        cipherLite.reset();
        resetInternal();
    }

    final void resetInternal() {
        curr_pos = max_pos = 0;
        eof = false;
    }

    /**
     * Reads and process the next chunk of data into memory.
     *
     * @return the length of the data chunk read and processed, or -1 if end of
     *         stream.
     * @throws IOException
     *             if there is an IO exception from the underlying input stream
     *
     * @throws SecurityException
     *             if there is authentication failure
     */
    private int nextChunk() throws IOException {
        abortIfNeeded();
        if (eof)
            return -1;
        bufout = null;
        int len = in.read(bufin);
        if (len == -1) {
            eof = true;
            // Skip doFinal if it's a multi-part upload but not the last part
            if (!multipart || lastMultiPart) {
                try {
                    bufout = cipherLite.doFinal();
                    if (bufout == null) {
                        // bufout can be null, for example, when it was the
                        // javax.crypto.NullCipher
                        return -1;
                    }
                    curr_pos = 0;
                    return max_pos = bufout.length;
                } catch (IllegalBlockSizeException ignore) {
                    // like the RI
                } catch (BadPaddingException e) {
                    if (S3CryptoScheme.isAesGcm(cipherLite.getCipherAlgorithm()))
                        throw new SecurityException(e);
                }
            }
            return -1;
        }
        bufout = cipherLite.update(bufin, 0, len);
        curr_pos = 0;
        return max_pos = (bufout == null ? 0 : bufout.length);
    }

    void renewCipherLite() {
        cipherLite = cipherLite.recreate();
    }
}


text:
package net.meisen.general.genmisc;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Random;
import java.util.UUID;

import net.meisen.general.genmisc.resources.IByteBufferReader;
import net.meisen.general.genmisc.resources.WrappedByteBufferReader;
import net.meisen.general.genmisc.types.Numbers;
import net.meisen.general.genmisc.types.Streams;
import net.meisen.general.genmisc.types.Streams.ByteResult;
import net.meisen.general.genmisc.types.Strings;

import org.junit.Assert;
import org.junit.Test;

/**
 * The test specified for the Streams
 *
 * @author pmeisen
 *
 */
public class TestStreams {

	/**
	 * Tests the implementation of the
	 * {@link Streams#writeStringToStream(String, java.io.OutputStream)} method
	 */
	@Test
	public void testWriteStringToStream() {
		final ByteArrayOutputStream baos = new ByteArrayOutputStream();
		final String content = "This is a äöüß Test÷";

		// write it
		Streams.writeStringToStream(content, baos);

		// test it
		assertEquals(baos.toString(), content);
	}

	/**
	 * Tests the implementation of the encoding guesses for some files.
	 *
	 * @throws IOException
	 *             if the file cannot be accessed
	 */
	@Test
	public void testGuessEncoding() throws IOException {
		InputStream is;
		String enc;

		// EMPTY
		is = getClass().getResourceAsStream("encodedFiles/Empty.txt");
		enc = Streams.guessEncoding(is, null);
		assertEquals(System.getProperty("file.encoding"), enc);

		// ASCII
		is = getClass().getResourceAsStream("encodedFiles/ASCII.txt");
		enc = Streams.guessEncoding(is, null);
		assertEquals("US-ASCII", enc);

		// UTF8 with BOM
		is = getClass().getResourceAsStream("encodedFiles/UTF8_BOM.txt");
		enc = Streams.guessEncoding(is, null);
		assertEquals("UTF-8", enc);

		// UTF8 without BOM
		is = getClass().getResourceAsStream("encodedFiles/UTF8_noBOM.txt");
		enc = Streams.guessEncoding(is, null);
		assertEquals("UTF-8", enc);

		// UTF16 BigEndian
		is = getClass().getResourceAsStream("encodedFiles/UCS-2_BigEndian.txt");
		enc = Streams.guessEncoding(is, null);
		assertEquals("UTF-16BE", enc);

		// UTF16 LittleEndian
		is = getClass().getResourceAsStream(
				"encodedFiles/UCS-2_LittleEndian.txt");
		enc = Streams.guessEncoding(is, null);
		assertEquals("UTF-16LE", enc);
	}

	/**
	 * Tests the implementation of {@link Streams#combineBytes(byte[][])}.
	 */
	@Test
	public void testCombineBytes() {

		// null if null is passed
		assertNull(Streams.combineBytes((byte[][]) null));

		// if a null array is passed it is ignored
		assertTrue(Arrays.equals(new byte[0],
				Streams.combineBytes((byte[]) null)));

		// test the combination
		byte[] input;

		input = new byte[] { 0x3, 0x2c };
		assertTrue(Arrays.equals(input,
				Streams.combineBytes(null, input)));

		assertTrue(Arrays.equals(
				new byte[] { 0x3, 0x2c, 0x3, 0x2c },
				Streams.combineBytes(new byte[] { 0x3, 0x2c }, new byte[] {
						0x3, 0x2c })));
	}

	/**
	 * Tests the implementation of the short mappers, i.e.
	 * {@link Streams#shortToByte(short)} and
	 * {@link Streams#byteToShort(byte[])}.
	 */
	@Test
	public void testShortByte() {
		byte[] byteArray;
		short value;

		for (short i = Short.MIN_VALUE;; i++) {
			byteArray = Streams.shortToByte(i);
			value = Streams.byteToShort(byteArray);
			assertEquals(i, value);

			if (i == Short.MAX_VALUE) {
				break;
			}
		}
	}

	/**
	 * Tests the implementation of the int mappers, i.e.
	 * {@link Streams#intToByte(int)} and {@link Streams#byteToInt(byte[])}.
	 */
	@Test
	public void testIntByte() {
		byte[] byteArray;
		int value;

		int start = new Random().nextInt();
		start = Math.min(start, Integer.MAX_VALUE - 1000);

		for (int i = start; i < start + 1000; i++) {
			byteArray = Streams.intToByte(i);
			value = Streams.byteToInt(byteArray);

			assertEquals(i, value);
		}
	}

	/**
	 * Tests the implementation of the long mappers, i.e.
	 * {@link Streams#longToByte(long)} and {@link Streams#byteToLong(byte[])}.
	 */
	@Test
	public void testLongByte() {
		byte[] byteArray;
		long value;

		// test the boundaries
		byteArray = Streams.longToByte(Long.MIN_VALUE);
		value = Streams.byteToLong(byteArray);
		assertEquals(Long.MIN_VALUE, value);

		byteArray = Streams.longToByte(Long.MAX_VALUE);
		value = Streams.byteToLong(byteArray);
		assertEquals(Long.MAX_VALUE, value);

		byteArray = Streams.longToByte(0);
		value = Streams.byteToLong(byteArray);
		assertEquals(0, value);

		// pick some random numbers
		final Random rnd = new Random();
		for (int i = 0; i < 1000; i++) {
			final long rndValue = rnd.nextLong();

			byteArray = Streams.longToByte(rndValue);
			value = Streams.byteToLong(byteArray);

			assertEquals(rndValue, value);
		}
	}

	/**
	 * Tests the implementation of the string mappers, i.e.
	 * {@link Streams#doubleToByte(double)} and
	 * {@link Streams#byteToDouble(byte[])}.
	 */
	@Test
	public void testDoubleByte() {
		byte[] byteArray;
		double value;

		byteArray = Streams.doubleToByte(Double.MAX_VALUE);
		value = Streams.byteToDouble(byteArray);
		assertEquals(Double.MAX_VALUE, value, 0.0);

		byteArray = Streams.doubleToByte(Double.MIN_VALUE);
		value = Streams.byteToDouble(byteArray);
		assertEquals(Double.MIN_VALUE, value, 0.0);

		byteArray = Streams.doubleToByte(Double.NaN);
		value = Streams.byteToDouble(byteArray);
		assertEquals(Double.NaN, value, 0.0);

		byteArray = Streams.doubleToByte(Double.NEGATIVE_INFINITY);
		value = Streams.byteToDouble(byteArray);
		assertEquals(Double.NEGATIVE_INFINITY, value, 0.0);

		byteArray = Streams.doubleToByte(500.120312803921);
		value = Streams.byteToDouble(byteArray);
		assertEquals(500.120312803921, value, 0.0);
	}

	/**
	 * Tests the implementation of the string mappers, i.e.
	 * {@link Streams#stringToByte(String)} and
	 * {@link Streams#byteToString(byte[])}.
	 */
	@Test
	public void testStringByte() {
		byte[] byteArray;
		String value;

		byteArray = Streams.stringToByte("");
		value = Streams.byteToString(byteArray);
		assertEquals("", value);

		byteArray = Streams.stringToByte("Hello");
		value = Streams.byteToString(byteArray);
		assertEquals("Hello", value);

		byteArray = Streams.stringToByte("äüöüöäüß?\"");
		value = Streams.byteToString(byteArray);
		assertEquals("äüöüöäüß?\"", value);
	}

	/**
	 * Tests the implementation of the object mappers, i.e.
	 * {@link Streams#objectToByte(Object)} and
	 * {@link Streams#byteToObject(byte[])}.
	 */
	@SuppressWarnings("ConstantConditions")
	@Test
	public void testObjectByte() {
		byte[] byteArray;
		Object org;
		ByteResult value;

		// test an empty string
		org = "";
		byteArray = Streams.objectToByte(org);
		value = Streams.byteToObject(byteArray);
		assertEquals(org, value.object);
		assertEquals(byteArray.length, value.nextPos);
		assertTrue(Streams.serializeObject(org).length > byteArray.length);

		// test a string
		org = "äüößAÜÖ!?  ";
		byteArray = Streams.objectToByte(org);
		value = Streams.byteToObject(byteArray);
		assertEquals(org, value.object);
		assertEquals(byteArray.length, value.nextPos);
		assertTrue(Streams.serializeObject(org).length > byteArray.length);

		// test a byte
		org = Byte.MIN_VALUE;
		byteArray = Streams.objectToByte(org);
		value = Streams.byteToObject(byteArray);
		assertEquals(org, value.object);
		assertEquals(byteArray.length, value.nextPos);
		assertTrue(Streams.serializeObject(org).length > byteArray.length);

		// test a short
		org = Short.MAX_VALUE;
		byteArray = Streams.objectToByte(org);
		value = Streams.byteToObject(byteArray);
		assertEquals(org, value.object);
		assertEquals(byteArray.length, value.nextPos);
		assertTrue(Streams.serializeObject(org).length > byteArray.length);

		// test null
		org = null;
		byteArray = Streams.objectToByte(org);
		value = Streams.byteToObject(byteArray);
		assertEquals(org, value.object);
		assertEquals(byteArray.length, value.nextPos);
		assertEquals(1, byteArray.length);

		// test some objects
		org = new Date();
		byteArray = Streams.objectToByte(org);
		value = Streams.byteToObject(byteArray);
		assertEquals(org, value.object);
		assertEquals(byteArray.length, value.nextPos);
		assertEquals(Streams.serializeObject(org).length + 1
				+ Streams.SIZEOF_INT, byteArray.length);

		org = UUID.randomUUID();
		byteArray = Streams.objectToByte(org);
		value = Streams.byteToObject(byteArray);
		assertEquals(org, value.object);
		assertEquals(byteArray.length, value.nextPos);
		assertEquals(Streams.serializeObject(org).length + 1
				+ Streams.SIZEOF_INT, byteArray.length);

		// test some combination
		org = new Date();
		byteArray = Streams.combineBytes(Streams.objectToByte(org),
				Streams.objectToByte(Byte.MIN_VALUE),
				Streams.objectToByte("This is a test!"),
				Streams.objectToByte(Integer.MIN_VALUE),
				Streams.objectToByte(Long.MAX_VALUE));

		// write some objects in an array and read those
		final Object[] objects = new Object[5];
		int counter = 0;
		int offset = 0;
		while (offset < byteArray.length) {
			value = Streams.byteToObject(byteArray, offset);
			offset = value.nextPos;

			objects[counter] = value.object;
			counter++;
		}

		assertEquals(org, objects[0]);
		assertEquals(Byte.MIN_VALUE, objects[1]);
		assertEquals("This is a test!", objects[2]);
		assertEquals(Integer.MIN_VALUE, objects[3]);
		assertEquals(Long.MAX_VALUE, objects[4]);
	}

	/**
	 * Tests the implementation of {@link Streams#writeAllObjects(Object...)}
	 * and {@link Streams#readAllObjects(byte[])}.
	 */
	@Test
	public void testWriteAndReadAll() {

		final List<Object> objects = new ArrayList<>();
		objects.add(5L);
		objects.add(new Date());
		objects.add("äüößÄÖÜ+\"*");
		objects.add((byte) 5);
		objects.add(21000);
		objects.add(null);
		objects.add(UUID.randomUUID());
		objects.add(Strings.repeat('A', Short.MAX_VALUE));

		// test reading all
		final byte[] res = Streams.writeAllObjects(objects);
		assertEquals(objects, Streams.readAllObjects(res));

		// test the offset
		assertEquals(objects.subList(1, objects.size()),
				Streams.readAllObjects(res, Streams.objectSize(Long.class)));
	}

	/**
	 *
	 */
	@Test
	public void testReadNextObject() {

		// test the reading of three sample objects
		final byte[] sampleFile = Streams
				.combineBytes(Streams.objectToByte(5),
						Streams.objectToByte(500L),
						Streams.objectToByte("Hello World"));
		final WrappedByteBufferReader ret = new WrappedByteBufferReader(
				ByteBuffer.wrap(sampleFile));

		final Object o1 = Streams.readNextObject(ret);
		assertEquals(5, o1);
		final Object o2 = Streams.readNextObject(ret);
		assertEquals(500L, o2);
		final Object o3 = Streams.readNextObject(ret);
		assertEquals("Hello World", o3);

		boolean exception = false;
		try {
			Streams.readNextObject(new WrappedByteBufferReader(ByteBuffer
					.wrap(new byte[0])));
		} catch (final IllegalArgumentException e) {
			assertTrue(e.getMessage().contains(
					"buffer does not contain any object"));
			exception = true;
		}
		assertTrue(exception);
	}

	/**
	 * Tests an instance of each {@link Streams#BYTE_TYPES}.
	 *
	 * @throws Exception
	 *             if an exception occurred
	 */
	@SuppressWarnings({"unchecked", "ConstantConditions"})
	@Test
	public void testAllTypes() throws Exception {
		for (final Class<?> clazz : Streams.BYTE_TYPES) {
			final Object o;

			// generate the needed values
			if (Object.class.equals(clazz)) {
				continue;
			} else if (Number.class.isAssignableFrom(clazz)) {
				o = Numbers.castToNumber(100, (Class<? extends Number>) clazz);
			} else if (Boolean.class.equals(clazz)) {
				o = true;
			} else if (String.class.equals(clazz)) {
				o = "Hello World";
			} else {
				o = clazz.newInstance();
			}

			final byte[] rep = Streams.writeAllObjects(o);
			final ArrayList<Object> res = Streams.readAllObjects(rep);
			assertEquals(1, res.size());
			assertEquals(o, res.get(0));

			/*
			 * all the representative should be smaller than the typical object
			 * representation
			 */
			final byte[] oRep = Streams.serializeObject(o);
			assertTrue(oRep.length + " > " + rep.length + " (" + clazz + ")",
					oRep.length > rep.length);

			// Strings have a dynamic overhead
			if (String.class.equals(clazz)) {
				continue;
			}

			/*
			 * check the overhead and the size, only String and Object are
			 * dynamic
			 */
			assertEquals(Streams.classOverhead(), Streams.objectOverhead(clazz));
			assertTrue(Streams.objectSize(clazz) > 0);
		}
	}

	/**
	 * Tests the reading of a file using the {@code FileByteBufferReader} and
	 * the {@code Streams#readNextObject(IByteBufferReader)} and
	 * {@code Streams#objectToByte(Object)}.
	 *
	 * @throws IOException
	 *             if the file cannot be created
	 */
	@Test
	public void testStreamsWithByteBufferReader() throws IOException {

		// create a tmpFile
		final File tmpFile = new File(System.getProperty("java.io.tmpdir"),
				UUID.randomUUID().toString());
		Assert.assertTrue(tmpFile.createNewFile());
		final FileOutputStream fos = new FileOutputStream(tmpFile);
		for (int i = 0; i < 50000; i++) {
			fos.write(Streams.objectToByte(i));
		}
		fos.flush();
		fos.close();

		final IByteBufferReader reader = Streams
				.createByteBufferReader(tmpFile);
		for (int i = 0; i < 50000; i++) {
			assertEquals(i, Streams.readNextObject(reader));
		}
		reader.close();

		assertTrue(tmpFile.delete());
	}
}


text:
package inclinometer

/**
 * Created by two on 2016-03-01.
 */
import scala.math._
object Inclinometer {

  def mmToMeters(scale: Int)(mm:Double): Double = scale * mm / 1000

  def metersToMm(scale: Int)(metrs:Double): Double = metrs / scale * 1000

  def mmToInclination(scale: Int)(high: Double)(dist:Double) =
    atan(high / mmToMeters(scale)(dist)).toDegrees

  def degreeToMm(scale: Int)(h: Double)(alpha: Double) =
    metersToMm(scale)(h / tan(alpha.toRadians))

  def s25000h100Inclination = mmToInclination(25000)(100)_
  def s25000h50Inclination = mmToInclination(25000)(50)_
  def s25000h100Distance = degreeToMm(25000)(100)_
  def s25000h50Distance = degreeToMm(25000)(50)_

  def compute(f: Double => Double)(l: List[Double]): List[(Double, Double)] =
    l.map(x => (x, f(x)))

}

import Inclinometer._
import List._

object InclinometerMain{

  val mm =  range(1, 21, 1).map(_.toDouble)
  val degrees =  range(1, 46, 1).map(_.toDouble)

  def print(unit1: String, unit2:String)(a: (Double, Double)):String = a match {
    case (x, y) => f"$x%.0f$unit1%s -> $y%.2f$unit2%s"
  }

  def printInclinations = print("mm", "\u00b0")_
  def printDegrees = print("\u00b0", "mm")_

  def main(args: Array[String]) {
    println("h = 50m")
    println(compute(s25000h50Inclination)(mm).map(printInclinations))
    println("h = 100m")
    println(compute(s25000h100Inclination)(mm).map(printInclinations))
    println("h = 50m")
    println(compute(s25000h50Distance)(degrees).map(printDegrees))
    println("h = 100m")
    println(compute(s25000h100Distance)(degrees).map(printDegrees))
  }
}


text:
using System;
using System.Xml;

using inf = Anycmd.Xacml.Interfaces;

namespace Anycmd.Xacml.Policy
{
    /// <summary>
    /// Represents a generic attribute referencing element found in the Policy document.  The only elements that are
    /// referencing other elements are: AttributeDesignator and AttributeSelector.
    /// </summary>
    public abstract class AttributeReferenceBase : XacmlElement, inf.IExpression
    {
        #region Private members

        #endregion

        #region Constructors

        /// <summary>
        /// Creates an instance of the AttributeReference using the data type and the flag specified.
        /// </summary>
        /// <param name="dataType">The data type id.</param>
        /// <param name="mustBePresent">Whether the attribute must be present.</param>
        /// <param name="schemaVersion">The version of the schema that was used to validate.</param>
        protected AttributeReferenceBase(string dataType, bool mustBePresent, XacmlVersion schemaVersion)
            : base(XacmlSchema.Policy, schemaVersion)
        {
            DataType = dataType;
            MustBePresent = mustBePresent;
        }

        /// <summary>
        /// Creates an instance of the AttributeReference using the XmlNode specified.
        /// </summary>
        /// <param name="reader">The XmlReader positioned at the attribute reference node.</param>
        /// <param name="schemaVersion">The version of the schema that was used to validate.</param>
        protected AttributeReferenceBase(XmlReader reader, XacmlVersion schemaVersion)
            : base(XacmlSchema.Policy, schemaVersion)
        {
            if (reader == null) throw new ArgumentNullException("reader");
            DataType = reader.GetAttribute(Consts.Schema1.AttributeSelectorElement.DataType);
            string mustBePresent = reader.GetAttribute(Consts.Schema1.AttributeSelectorElement.MustBePresent);
            if (string.IsNullOrEmpty(mustBePresent))
            {
                MustBePresent = false;
            }
            else
            {
                MustBePresent = bool.Parse(mustBePresent);
            }
        }

        #endregion

        #region Public properties

        /// <summary>
        /// Gets the data type of the referenced node
        /// </summary>
        public string DataType { get; set; }

        /// <summary>
        /// Whether the referenced value must be present or not.
        /// </summary>
        public bool MustBePresent { get; set; }

        #endregion

        #region Abstract methods

        /// <summary>
        /// Writes the XML of the current element
        /// </summary>
        /// <param name="writer">The XmlWriter in which the element will be written</param>
        public abstract void WriteDocument(XmlWriter writer);

        #endregion
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- From: file:/home/hassan/instabug/repo/android-as/instabugcore/src/main/res/values-fr/strings.xml -->
    <eat-comment/>
    <string-array name="report_options">
        <item>Signaler un problème</item>
        <item>Envoyer un avis</item>
    </string-array>
    <string name="bottommessage">Système d\'avis avec &name&</string>
    <string name="bugheader">Signaler un problème</string>
    <string name="cancelbutton">Annuler</string>
    <string name="commentplaceholder">Rédigez votre avis ici...</string>
    <string name="edgeswipestartalerttext">Balayez depuis un bord pour envoyer un avis</string>
    <string name="emailplaceholder">Indiquez votre adresse e-mail...</string>
    <string name="feedbackheader">Envoyer un avis</string>
    <string name="feedbacksentalerttext">Merci de nous aider à améliorer InstabugApp!</string>
    <string name="feedbacksentalerttitle">Commentaire envoyé</string>
    <string name="invalidcommentalerttext">Veuillez saisir une commentaire valide</string>
    <string name="invalidcommentalerttitle">Commentaire invalide</string>
    <string name="invalidemailalerttext">Veuillez saisir un e-mail valide</string>
    <string name="invalidemailalerttitle">E-mail invalide</string>
    <string name="pleasewait">S\'il vous plaît attendez un moment</string>
    <string name="screenshotstartalerttext">Prenez une capture d\'écran pour envoyer un avis</string>
    <string name="shakestartalerttext">Secouez pour envoyer un avis</string>
    <string name="submitbutton">Envoyer</string>
    <string name="tutorialalerttext">Dessinez sur la capture d\'écran et ajoutez du texte</string>
    <string name="twofingerswipestartalerttext">Balayez deux doigts pour envoyer un avis</string>
</resources>


text: <!DOCTYPE html>


text:
#ifndef _SAM3U_PIOC_INSTANCE_
#define _SAM3U_PIOC_INSTANCE_

/* ========== Register definition for PIOC peripheral ========== */
#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
#define REG_PIOC_PER             (0x400E1000U) /**< \brief (PIOC) PIO Enable Register */
#define REG_PIOC_PDR             (0x400E1004U) /**< \brief (PIOC) PIO Disable Register */
#define REG_PIOC_PSR             (0x400E1008U) /**< \brief (PIOC) PIO Status Register */
#define REG_PIOC_OER             (0x400E1010U) /**< \brief (PIOC) Output Enable Register */
#define REG_PIOC_ODR             (0x400E1014U) /**< \brief (PIOC) Output Disable Register */
#define REG_PIOC_OSR             (0x400E1018U) /**< \brief (PIOC) Output Status Register */
#define REG_PIOC_IFER            (0x400E1020U) /**< \brief (PIOC) Glitch Input Filter Enable Register */
#define REG_PIOC_IFDR            (0x400E1024U) /**< \brief (PIOC) Glitch Input Filter Disable Register */
#define REG_PIOC_IFSR            (0x400E1028U) /**< \brief (PIOC) Glitch Input Filter Status Register */
#define REG_PIOC_SODR            (0x400E1030U) /**< \brief (PIOC) Set Output Data Register */
#define REG_PIOC_CODR            (0x400E1034U) /**< \brief (PIOC) Clear Output Data Register */
#define REG_PIOC_ODSR            (0x400E1038U) /**< \brief (PIOC) Output Data Status Register */
#define REG_PIOC_PDSR            (0x400E103CU) /**< \brief (PIOC) Pin Data Status Register */
#define REG_PIOC_IER             (0x400E1040U) /**< \brief (PIOC) Interrupt Enable Register */
#define REG_PIOC_IDR             (0x400E1044U) /**< \brief (PIOC) Interrupt Disable Register */
#define REG_PIOC_IMR             (0x400E1048U) /**< \brief (PIOC) Interrupt Mask Register */
#define REG_PIOC_ISR             (0x400E104CU) /**< \brief (PIOC) Interrupt Status Register */
#define REG_PIOC_MDER            (0x400E1050U) /**< \brief (PIOC) Multi-driver Enable Register */
#define REG_PIOC_MDDR            (0x400E1054U) /**< \brief (PIOC) Multi-driver Disable Register */
#define REG_PIOC_MDSR            (0x400E1058U) /**< \brief (PIOC) Multi-driver Status Register */
#define REG_PIOC_PUDR            (0x400E1060U) /**< \brief (PIOC) Pull-up Disable Register */
#define REG_PIOC_PUER            (0x400E1064U) /**< \brief (PIOC) Pull-up Enable Register */
#define REG_PIOC_PUSR            (0x400E1068U) /**< \brief (PIOC) Pad Pull-up Status Register */
#define REG_PIOC_ABSR            (0x400E1070U) /**< \brief (PIOC) Peripheral AB Select Register */
#define REG_PIOC_SCIFSR          (0x400E1080U) /**< \brief (PIOC) System Clock Glitch Input Filter Select Register */
#define REG_PIOC_DIFSR           (0x400E1084U) /**< \brief (PIOC) Debouncing Input Filter Select Register */
#define REG_PIOC_IFDGSR          (0x400E1088U) /**< \brief (PIOC) Glitch or Debouncing Input Filter Clock Selection Status Register */
#define REG_PIOC_SCDR            (0x400E108CU) /**< \brief (PIOC) Slow Clock Divider Debouncing Register */
#define REG_PIOC_OWER            (0x400E10A0U) /**< \brief (PIOC) Output Write Enable */
#define REG_PIOC_OWDR            (0x400E10A4U) /**< \brief (PIOC) Output Write Disable */
#define REG_PIOC_OWSR            (0x400E10A8U) /**< \brief (PIOC) Output Write Status Register */
#define REG_PIOC_AIMER           (0x400E10B0U) /**< \brief (PIOC) Additional Interrupt Modes Enable Register */
#define REG_PIOC_AIMDR           (0x400E10B4U) /**< \brief (PIOC) Additional Interrupt Modes Disables Register */
#define REG_PIOC_AIMMR           (0x400E10B8U) /**< \brief (PIOC) Additional Interrupt Modes Mask Register */
#define REG_PIOC_ESR             (0x400E10C0U) /**< \brief (PIOC) Edge Select Register */
#define REG_PIOC_LSR             (0x400E10C4U) /**< \brief (PIOC) Level Select Register */
#define REG_PIOC_ELSR            (0x400E10C8U) /**< \brief (PIOC) Edge/Level Status Register */
#define REG_PIOC_FELLSR          (0x400E10D0U) /**< \brief (PIOC) Falling Edge/Low Level Select Register */
#define REG_PIOC_REHLSR          (0x400E10D4U) /**< \brief (PIOC) Rising Edge/ High Level Select Register */
#define REG_PIOC_FRLHSR          (0x400E10D8U) /**< \brief (PIOC) Fall/Rise - Low/High Status Register */
#define REG_PIOC_LOCKSR          (0x400E10E0U) /**< \brief (PIOC) Lock Status */
#define REG_PIOC_WPMR            (0x400E10E4U) /**< \brief (PIOC) Write Protect Mode Register */
#define REG_PIOC_WPSR            (0x400E10E8U) /**< \brief (PIOC) Write Protect Status Register */
#else
#define REG_PIOC_PER    (*(WoReg*)0x400E1000U) /**< \brief (PIOC) PIO Enable Register */
#define REG_PIOC_PDR    (*(WoReg*)0x400E1004U) /**< \brief (PIOC) PIO Disable Register */
#define REG_PIOC_PSR    (*(RoReg*)0x400E1008U) /**< \brief (PIOC) PIO Status Register */
#define REG_PIOC_OER    (*(WoReg*)0x400E1010U) /**< \brief (PIOC) Output Enable Register */
#define REG_PIOC_ODR    (*(WoReg*)0x400E1014U) /**< \brief (PIOC) Output Disable Register */
#define REG_PIOC_OSR    (*(RoReg*)0x400E1018U) /**< \brief (PIOC) Output Status Register */
#define REG_PIOC_IFER   (*(WoReg*)0x400E1020U) /**< \brief (PIOC) Glitch Input Filter Enable Register */
#define REG_PIOC_IFDR   (*(WoReg*)0x400E1024U) /**< \brief (PIOC) Glitch Input Filter Disable Register */
#define REG_PIOC_IFSR   (*(RoReg*)0x400E1028U) /**< \brief (PIOC) Glitch Input Filter Status Register */
#define REG_PIOC_SODR   (*(WoReg*)0x400E1030U) /**< \brief (PIOC) Set Output Data Register */
#define REG_PIOC_CODR   (*(WoReg*)0x400E1034U) /**< \brief (PIOC) Clear Output Data Register */
#define REG_PIOC_ODSR   (*(RwReg*)0x400E1038U) /**< \brief (PIOC) Output Data Status Register */
#define REG_PIOC_PDSR   (*(RoReg*)0x400E103CU) /**< \brief (PIOC) Pin Data Status Register */
#define REG_PIOC_IER    (*(WoReg*)0x400E1040U) /**< \brief (PIOC) Interrupt Enable Register */
#define REG_PIOC_IDR    (*(WoReg*)0x400E1044U) /**< \brief (PIOC) Interrupt Disable Register */
#define REG_PIOC_IMR    (*(RoReg*)0x400E1048U) /**< \brief (PIOC) Interrupt Mask Register */
#define REG_PIOC_ISR    (*(RoReg*)0x400E104CU) /**< \brief (PIOC) Interrupt Status Register */
#define REG_PIOC_MDER   (*(WoReg*)0x400E1050U) /**< \brief (PIOC) Multi-driver Enable Register */
#define REG_PIOC_MDDR   (*(WoReg*)0x400E1054U) /**< \brief (PIOC) Multi-driver Disable Register */
#define REG_PIOC_MDSR   (*(RoReg*)0x400E1058U) /**< \brief (PIOC) Multi-driver Status Register */
#define REG_PIOC_PUDR   (*(WoReg*)0x400E1060U) /**< \brief (PIOC) Pull-up Disable Register */
#define REG_PIOC_PUER   (*(WoReg*)0x400E1064U) /**< \brief (PIOC) Pull-up Enable Register */
#define REG_PIOC_PUSR   (*(RoReg*)0x400E1068U) /**< \brief (PIOC) Pad Pull-up Status Register */
#define REG_PIOC_ABSR   (*(RwReg*)0x400E1070U) /**< \brief (PIOC) Peripheral AB Select Register */
#define REG_PIOC_SCIFSR (*(WoReg*)0x400E1080U) /**< \brief (PIOC) System Clock Glitch Input Filter Select Register */
#define REG_PIOC_DIFSR  (*(WoReg*)0x400E1084U) /**< \brief (PIOC) Debouncing Input Filter Select Register */
#define REG_PIOC_IFDGSR (*(RoReg*)0x400E1088U) /**< \brief (PIOC) Glitch or Debouncing Input Filter Clock Selection Status Register */
#define REG_PIOC_SCDR   (*(RwReg*)0x400E108CU) /**< \brief (PIOC) Slow Clock Divider Debouncing Register */
#define REG_PIOC_OWER   (*(WoReg*)0x400E10A0U) /**< \brief (PIOC) Output Write Enable */
#define REG_PIOC_OWDR   (*(WoReg*)0x400E10A4U) /**< \brief (PIOC) Output Write Disable */
#define REG_PIOC_OWSR   (*(RoReg*)0x400E10A8U) /**< \brief (PIOC) Output Write Status Register */
#define REG_PIOC_AIMER  (*(WoReg*)0x400E10B0U) /**< \brief (PIOC) Additional Interrupt Modes Enable Register */
#define REG_PIOC_AIMDR  (*(WoReg*)0x400E10B4U) /**< \brief (PIOC) Additional Interrupt Modes Disables Register */
#define REG_PIOC_AIMMR  (*(RoReg*)0x400E10B8U) /**< \brief (PIOC) Additional Interrupt Modes Mask Register */
#define REG_PIOC_ESR    (*(WoReg*)0x400E10C0U) /**< \brief (PIOC) Edge Select Register */
#define REG_PIOC_LSR    (*(WoReg*)0x400E10C4U) /**< \brief (PIOC) Level Select Register */
#define REG_PIOC_ELSR   (*(RoReg*)0x400E10C8U) /**< \brief (PIOC) Edge/Level Status Register */
#define REG_PIOC_FELLSR (*(WoReg*)0x400E10D0U) /**< \brief (PIOC) Falling Edge/Low Level Select Register */
#define REG_PIOC_REHLSR (*(WoReg*)0x400E10D4U) /**< \brief (PIOC) Rising Edge/ High Level Select Register */
#define REG_PIOC_FRLHSR (*(RoReg*)0x400E10D8U) /**< \brief (PIOC) Fall/Rise - Low/High Status Register */
#define REG_PIOC_LOCKSR (*(RoReg*)0x400E10E0U) /**< \brief (PIOC) Lock Status */
#define REG_PIOC_WPMR   (*(RwReg*)0x400E10E4U) /**< \brief (PIOC) Write Protect Mode Register */
#define REG_PIOC_WPSR   (*(RoReg*)0x400E10E8U) /**< \brief (PIOC) Write Protect Status Register */
#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */

#endif /* _SAM3U_PIOC_INSTANCE_ */


text:
void assert(const char* conditionDescription, bool condition)
{

	if(!condition)
	{

		std::cout << "Condition not satisfied: " << conditionDescription << std::endl;

		throw std::runtime_error("Condition not satisfied!");

	}

	return;

}

#endif


text:
package com.janrain.android.utils;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;

import static java.lang.reflect.Array.newInstance;

/**
 * @internal
 *
 * @class CollectionUtils
 **/
public final class CollectionUtils {
    /**
     * Loosey goosey variant of emptiness checking
     * @param list a list or null
     * @return true if there are no elements in list
     */
    public static boolean isEmpty(List<?> list) {
        return ((list == null) || (list.size() < 1));
    }

    /**
     * Constructs a SortedSet<T> with all the elements available from i
     * @param i an iterator to pull elements from
     * @param <T> The type of the elements
     * @return a SortedSet of the elements
     */
    public static <T> SortedSet<T> sortedSetFromIterator(Iterator<T> i) {
        SortedSet<T> retval = new TreeSet<T>();
        while (i.hasNext()) retval.add(i.next());
        return retval;
    }

    public static <T> List<T> listFromIterator(Iterator<T> i) {
        List<T> retval = new ArrayList<T>();
        while (i.hasNext()) retval.add(i.next());
        return retval;
    }

    /**
     * Constructs the sorted union of two sets
     * @param a
     * @param b
     * @return the sorted union
     */
    public static <T> SortedSet<T> sortedUnion(Set<T> a, Set<T> b) {
        SortedSet<T> retVal = new TreeSet<T>(a);
        retVal.addAll(b);
        return retVal;
    }

    public static String collectionToHumanReadableString(Map<String, Object> messages) {
        return JsonUtils.collectionToJson(messages).toString();
    }

    /**
     * A first-class function stand-in
     * @param <L> the return type of the function
     * @param <R> the parameter type of the function
     */
    public static interface Function<L, R> {
        /**
         * The function's implementation
         * @param arg
         * @return the function's evaluation on arg
         */
        L operate(R arg);
    }

    /**
     * Maps a function f onto the values of a map map. Returns a new map with with the result.
     * @param map
     *      A map onto which to apply f to the values of
     * @param f
     *      A function mapped onto the values of map
     * @param <K>
     *      The key type for map
     * @param <L>
     *      The left hand side type of f
     * @param <R>
     *      The right hand side type of f
     * @return
     *      A new map>K, L> with with the result.
     */
    public static <K, L, R> HashMap<K, L> map(Map<K, R> map, Function<L, R> f) {
        HashMap<K, L> retMap = new HashMap<K, L>();

        for (Map.Entry<K, R> e : map.entrySet()) retMap.put(e.getKey(), f.operate(e.getValue()));

        return retMap;
    }

    //public static <K, R> ArrayList<R> collectValues(Map<K, R> map, Function<Boolean, Map.Entry> f) {
    //    ArrayList<R> retList = new ArrayList<R>();
    //    for (Map.Entry<K, R> e : map.entrySet()) if (f.operate(e)) retList.add(e.getValue());
    //    return retList;
    //}

    public static <K, R> HashMap<K, R> filter(Map<K, R> map, Function<Boolean, Map.Entry> f) {
        HashMap<K, R> retMap = new HashMap<K, R>();
        for (Map.Entry<K, R> e : map.entrySet()) if (f.operate(e)) retMap.put(e.getKey(), e.getValue());
        return retMap;
    }

    /**
     * Maps a function f onto the values of a list list. Returns a new list with with the result.
     * @param list
     *      A list onto which to apply f to the values of
     * @param f
     *      A function mapped onto the values of list
     * @param <L>
     *      The left hand side type of f
     * @param <R>
     *      The right hand side type of f
     * @return
     *      A new list>L> with the result
     */
    public static <L, R> ArrayList<L> map(List<R> list, Function<L, R> f) {
        ArrayList<L> retList = new ArrayList<L>();

        for (R e : list) retList.add(f.operate(e));

        return retList;
    }

    /**
     * Attempts to construct a new collection of the same class as collection with elements as f mapped onto
     * collection. If that class cannot be instantiated via Class#newInstance() then an ArrayList is
     * constructed to hold the return value
     *
     * @param collection the collection to map f onto
     * @param f a Function to map onto collection
     * @param <L> the generic type of the constructed collection
     * @param <R> the generic type of collection
     * @return the newly constructed collection
     */
    public static <L, R> Collection<L> map(Collection<R> collection, Function<L, R> f) {
        Collection<L> retCollection;
        try {
            retCollection = collection.getClass().newInstance();
        } catch (InstantiationException ignore) {
            retCollection = new ArrayList<L>();
        } catch (IllegalAccessException ignore) {
            retCollection = new ArrayList<L>();
        }

        for (R e : collection) retCollection.add(f.operate(e));

        return retCollection;
    }

    /**
     * Maps a function f onto the values of a array array. Returns a new array of the same type
     * with with the result.
     * @param array
     *      A array onto which to apply f to the values of
     * @param f
     *      A function mapped onto the values of array
     * @param <T>
     *      The right and left hand side type of f
     * @return
     *      A new T[] with the result
     */
    @SuppressWarnings("unchecked")
    public static <T> T[] map(T[] array, Function<T, T> f) {
        T[] retArray = (T[]) newInstance(array.getClass().getComponentType(), array.length);

        int i = 0;
        for (T e : array) retArray[i++] = (f.operate(e));

        return retArray;
    }
}


text:
package actors

import java.util.UUID
import javax.inject.Inject

import akka.actor.{ActorLogging, ActorRef, ActorSystem, Props}
import akka.persistence.{PersistentActor, SnapshotOffer}
import commands.{CreateRoomCommand, ListPublicRoomsCommand, NewMessageCommand, UserJoinRoomCommand}
import events.{JoinedChannelEvent, NewMessageEvent}

import scala.collection.mutable.{Map => MutableMap}

/**
  * Created by daz on 12/09/2016.
  */
class RoomMasterActor @Inject() (system: ActorSystem) extends PersistentActor with ActorLogging {

  var chatRooms: MutableMap[String, ActorRef] = MutableMap()

  override def receiveRecover: Receive = {
    case SnapshotOffer(_, snap: MutableMap[String, ActorRef]) => chatRooms = snap
  }

  override def persistenceId: String = getClass.getSimpleName

  override def receiveCommand: Receive = {
    case msg: UserJoinRoomCommand => processUserJoinRoomCommand(msg)
    case msg: CreateRoomCommand => processCreateRoomCommand(msg)
    case msg: ListPublicRoomsCommand => {
      chatRooms.foreach { actor => log.info("Channel id: {}", actor._1)}
    }
    case msg: NewMessageCommand => processNewMessageCommand(msg)
    case msg: Any => unhandled(msg)
  }

  def processUserJoinRoomCommand(msg: UserJoinRoomCommand): Unit = {
    // Notify all users in the channel
    val actorRoom = chatRooms.getOrElse(msg.roomId, None)

    actorRoom match {
      case room: ActorRef => room forward  msg
      case None => log.warning("userId:{}|roomId:{}|room not found", msg.userId, msg.roomId)
    }
  }

  def processCreateRoomCommand(msg: CreateRoomCommand): Unit = {
    val roomId = UUID.randomUUID().toString
    val roomActor = system.actorOf(RoomActor.props(self, roomId, msg.userId, msg.isPrivate))
    chatRooms += (roomId -> roomActor)

    persist(msg) {
      // TODO: implement this logic
      event => log.info("Room created - Name {} | Room ID: {}", msg.name, roomId)
    }
  }

  def processNewMessageCommand(msg: NewMessageCommand): Unit = {
    log.info("process new message command")
    val actorRoom = chatRooms.getOrElse(msg.to, None)

    actorRoom match {
      case room: ActorRef => room forward msg
      case None => log.warning("userId:{}|roomId:{}|room not found", msg.fromUser, msg.to)
    }
  }
}

object RoomMasterActor {
  def props(system: ActorSystem) = Props(new RoomMasterActor(system))
}


text:
<?php

namespace Bermone\BlogBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * DiaporamaRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class DiaporamaRepository extends EntityRepository
{
}


text:
define(
	['Views/BaseView'],
	function (BaseView)
	{
		var Settings = BaseView.extend({

			events: {
				'click [data-action=remove]': 'removeAdmin',
				'focus .admin-add input': 'enableSubmit',
				'blur .admin-add input': 'disableSubmit',
				'click [data-action=save]': 'saveSettings'
			},

			initialize: function(options) {

				$('body').addClass('small_header');
				$('body').find('.sub_title').html('Manage your settings here');

			},

		    render: function()
		    {
				if(window.pageYOffset === 0)
					$('.navbar-brand').removeAttr('style');

		    	this.$el.html(Mustache.render(Templates.settings, {settings: Application.config}));

		        return this;
		    },

		    enableSubmit: function(e) {

		    	$(e.currentTarget).keypress(function(key){
		    		if (key.which == 13)
		    			this.addAdmin()
		    	}.bind(this));
		    },

		    disableSubmit: function(e) {

		    	$(e.currentTarget).off('keypress');
		    },

		    addAdmin: function() {

		    	var email = this.$el.find('[data-attr=admin-email]').val();

		    	if (!email)
		    		this.$el.find('.admin-add').append('nope.');
		    	else
		    		hacktoolSdk.Settings.addAdmin(email, this.adminUpdated.bind(this, false, email), this.adminError.bind(this));
		    },

		    removeAdmin: function(e) {

		    	var $item = $(e.currentTarget).closest('.display');
		    	var email = $item.data('email');

		    	hacktoolSdk.Settings.removeAdmin(email, this.adminUpdated.bind(this, true, email), this.adminError.bind(this));
		    },

		    saveSettings: function() {

		    	var settings = {
		    		"name": this.$el.find('[data-attr=hacktool-name]').val(),
					"description": this.$el.find('[data-attr=hacktool-description]').val(),
					"time": {
						"date": "20 September 2016",
						"time": "09:00 (UTC+1)"
					},
					"location": {
						"street": this.$el.find('[data-attr=hacktool-street]').val(),
						"place": this.$el.find('[data-attr=hacktool-place]').val()
					}
		    	}

		    	hacktoolSdk.Settings.editSettings(settings, this.settingsUpdated.bind(this), this.settingsError.bind(this));
		    },

		    adminUpdated: function(remove, email) {

		    	if (!remove)
		    		this.$el.find('.admin-list').append(Mustache.render(Templates.admin_list_item, {email: email}));
		    	else
		    		this.$el.find('.admin-list [data-email="'+email+'"]').remove();

		    	this.$el.find('.admin-add input').val('');
		    },

		    adminError: function(error) {
		    	this.renderAlert('.admin-alerts', 'danger', error);
		    },

		    settingsUpdated: function() {
		    	this.renderAlert('.settings-alerts', 'success', "Settings updated!");
		    },

		    settingsError: function() {
		    	this.renderAlert('.settings-alerts', 'danger', error);
		    }
		});

		return Settings;
	}
);


text:
{% macro period_form(form) -%}

    <form method="get" style="float: left;">
        Show results from start of {{form.monthStart()}} / {{form.yearStart()}} to end of {{form.monthEnd()}} / {{form.yearEnd()}}
        <input type="submit" value="Update"/>
    </form>

Showing {{form.get_start() | timestamp}} to {{form.get_end() | timestamp }}

{%- endmacro %}

{% macro map_form(form) -%}

    <form method="get" style="float: left;">
        Drop pins for {{form.pins()}}
        from start of {{form.monthStart()}} / {{form.yearStart()}} to end of {{form.monthEnd}} / {{form.yearEnd}}
        {% if form.pins.errors %}
        {{ ". ".join(form.pins.errors) }}
        {% endif %}
        <input type="submit" value="Update"/>
    </form>

Pinning {{form.get_pins()}} to the map

        Showing {{form.get_start() | timestamp}} to {{form.get_end() | timestamp }}

{%- endmacro %}

{% macro trend_form(form) -%}

    <form method="get" style="float: left;">
        Show top 10 trends from start of {{form.monthStart()}} / {{form.yearStart()}} to end of {{form.monthEnd()}} / {{form.yearEnd()}}
        <input type="submit" value="Update"/>
    </form>

Showing {{form.get_start() | timestamp}} to {{form.get_end() | timestamp }}

{%- endmacro %}

{% macro histogram_form(form) -%}

    <form method="get" style="float:left;">

        Show distribution of workflows based on {{form.jobOrFile()}} with type
        {% if form.jobOrFile.data == "job" %}
            {{form.jobType()}}.
        {% else %}
            {{form.fileType()}}.
        {% endif %}

Between the values {{form.min()}} and {{form.max()}}.

From the start of {{form.monthStart()}} / {{form.yearStart()}} to the end of {{form.monthEnd()}} / {{form.yearEnd()}}

        <input type="submit" value="Update"/>

    </form>

Showing number of workflows with {{form.get_metric()}} counts between {{form.get_min()}} and {{form.get_max()}}
that were run between {{form.get_start() | timestamp}} and {{form.get_end() | timestamp}}

{%- endmacro %}


text:
<?php

/**
* <auto-generated>
*     This code was generated by Codezu.
*
*     Changes to this file may cause incorrect behavior and will be lost if
*     the code is regenerated.
* </auto-generated>
*/

namespace Mozu\Api\Resources\Commerce\Shipping\Admin\Profiles;

use Mozu\Api\Clients\Commerce\Shipping\Admin\Profiles\ShippingInclusionRuleClient;
use Mozu\Api\ApiContext;

/**
* Use the ShippingInclusionRules sub-resource to manage your shipping inclusion rules that are associated with a specific shipping profile.
*/
class ShippingInclusionRuleResource {

		private $apiContext;

	public function __construct(ApiContext $apiContext)
	{
		$this->apiContext = $apiContext;
	}

	/**
	* Retrieves the details of the specified shipping inclusion rule.
	*
	* @param string $id Unique identifier of the customer segment to retrieve.
	* @param string $profilecode The unique, user-defined code of the profile with which the shipping inclusion rule is associated.
	* @param string $responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	* @return ShippingInclusionRule
	* @deprecated deprecated since version 1.17
	*/
	public function getShippingInclusionRule($profilecode, $id, $responseFields =  null)
	{
		$mozuClient = ShippingInclusionRuleClient::getShippingInclusionRuleClient($profilecode, $id, $responseFields);
		$mozuClient = $mozuClient->withContext($this->apiContext);
		$mozuClient->execute();
		return $mozuClient->getResult();

	}

/**
	* Retrieves the details of the specified shipping inclusion rule.
	*
	* @param string $id Unique identifier of the customer segment to retrieve.
	* @param string $profilecode The unique, user-defined code of the profile with which the shipping inclusion rule is associated.
	* @param string $responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	* @return Promise - use $promise->then(sucessfn, errorfn). successFn is passed Mozu\Api\MozuResult. errorFn is passed Mozu\Api\ApiException
	*/
	public function getShippingInclusionRuleAsync($profilecode, $id, $responseFields =  null)
	{
		$mozuClient = ShippingInclusionRuleClient::getShippingInclusionRuleClient($profilecode, $id, $responseFields);
		$mozuClient = $mozuClient->withContext($this->apiContext);
		return $mozuClient->executeAsync();

	}

	/**
	* Retrieves a list of shipping inclusion rules and their details.
	*
	* @param string $profilecode The unique, user-defined code of the profile with which the shipping inclusion rule is associated.
	* @param string $responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	* @return ShippingInclusionRuleCollection
	* @deprecated deprecated since version 1.17
	*/
	public function getShippingInclusionRules($profilecode, $responseFields =  null)
	{
		$mozuClient = ShippingInclusionRuleClient::getShippingInclusionRulesClient($profilecode, $responseFields);
		$mozuClient = $mozuClient->withContext($this->apiContext);
		$mozuClient->execute();
		return $mozuClient->getResult();

	}

/**
	* Retrieves a list of shipping inclusion rules and their details.
	*
	* @param string $profilecode The unique, user-defined code of the profile with which the shipping inclusion rule is associated.
	* @param string $responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	* @return Promise - use $promise->then(sucessfn, errorfn). successFn is passed Mozu\Api\MozuResult. errorFn is passed Mozu\Api\ApiException
	*/
	public function getShippingInclusionRulesAsync($profilecode, $responseFields =  null)
	{
		$mozuClient = ShippingInclusionRuleClient::getShippingInclusionRulesClient($profilecode, $responseFields);
		$mozuClient = $mozuClient->withContext($this->apiContext);
		return $mozuClient->executeAsync();

	}

	/**
	* Creates a new shipping inclusion rule.
	*
	* @param string $profilecode The unique, user-defined code of the profile with which the shipping inclusion rule is associated.
	* @param string $responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	* @param ShippingInclusionRule $rule The details of the new shipping inclusion rule.
	* @return ShippingInclusionRule
	* @deprecated deprecated since version 1.17
	*/
	public function createShippingInclusionRule($rule, $profilecode, $responseFields =  null)
	{
		$mozuClient = ShippingInclusionRuleClient::createShippingInclusionRuleClient($rule, $profilecode, $responseFields);
		$mozuClient = $mozuClient->withContext($this->apiContext);
		$mozuClient->execute();
		return $mozuClient->getResult();

	}

/**
	* Creates a new shipping inclusion rule.
	*
	* @param string $profilecode The unique, user-defined code of the profile with which the shipping inclusion rule is associated.
	* @param string $responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	* @return Promise - use $promise->then(sucessfn, errorfn). successFn is passed Mozu\Api\MozuResult. errorFn is passed Mozu\Api\ApiException
	*/
	public function createShippingInclusionRuleAsync($rule, $profilecode, $responseFields =  null)
	{
		$mozuClient = ShippingInclusionRuleClient::createShippingInclusionRuleClient($rule, $profilecode, $responseFields);
		$mozuClient = $mozuClient->withContext($this->apiContext);
		return $mozuClient->executeAsync();

	}

	/**
	* Updates the details of the specified shipping inclusion rule.
	*
	* @param string $id Unique identifier of the customer segment to retrieve.
	* @param string $profilecode The unique, user-defined code of the profile with which the shipping inclusion rule is associated.
	* @param string $responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	* @param ShippingInclusionRule $rule The updated details of the shipping inclusion rule.
	* @return ShippingInclusionRule
	* @deprecated deprecated since version 1.17
	*/
	public function updateShippingInclusionRule($rule, $profilecode, $id, $responseFields =  null)
	{
		$mozuClient = ShippingInclusionRuleClient::updateShippingInclusionRuleClient($rule, $profilecode, $id, $responseFields);
		$mozuClient = $mozuClient->withContext($this->apiContext);
		$mozuClient->execute();
		return $mozuClient->getResult();

	}

/**
	* Updates the details of the specified shipping inclusion rule.
	*
	* @param string $id Unique identifier of the customer segment to retrieve.
	* @param string $profilecode The unique, user-defined code of the profile with which the shipping inclusion rule is associated.
	* @param string $responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	* @return Promise - use $promise->then(sucessfn, errorfn). successFn is passed Mozu\Api\MozuResult. errorFn is passed Mozu\Api\ApiException
	*/
	public function updateShippingInclusionRuleAsync($rule, $profilecode, $id, $responseFields =  null)
	{
		$mozuClient = ShippingInclusionRuleClient::updateShippingInclusionRuleClient($rule, $profilecode, $id, $responseFields);
		$mozuClient = $mozuClient->withContext($this->apiContext);
		return $mozuClient->executeAsync();

	}

	/**
	* Deletes the specified shipping inclusion rule.
	*
	* @param string $id Unique identifier of the customer segment to retrieve.
	* @param string $profilecode The unique, user-defined code of the profile with which the shipping inclusion rule is associated.
	* @deprecated deprecated since version 1.17
	*/
	public function deleteShippingInclusionRule($profilecode, $id)
	{
		$mozuClient = ShippingInclusionRuleClient::deleteShippingInclusionRuleClient($profilecode, $id);
		$mozuClient = $mozuClient->withContext($this->apiContext);
		$mozuClient->execute();

	}

/**
	* Deletes the specified shipping inclusion rule.
	*
	* @param string $id Unique identifier of the customer segment to retrieve.
	* @param string $profilecode The unique, user-defined code of the profile with which the shipping inclusion rule is associated.
	* @return Promise - use $promise->then(sucessfn, errorfn). successFn is passed Mozu\Api\MozuResult. errorFn is passed Mozu\Api\ApiException
	*/
	public function deleteShippingInclusionRuleAsync($profilecode, $id)
	{
		$mozuClient = ShippingInclusionRuleClient::deleteShippingInclusionRuleClient($profilecode, $id);
		$mozuClient = $mozuClient->withContext($this->apiContext);
		return $mozuClient->executeAsync();

	}

}

?>


text:
#include "avl.h"
0;136;0c
struct AVLTreeNode
{
  ET Element;
  AVL Left;
  AVL Right;
  int Height;
};

static int
Height(Position P)
{
  if (P == NULL)
    return -1;
  else
    return P->Height;
}

AVL
makeEmpty(AVL T)
{
  if (T != NULL)
  {
    makeEmpty(T->Left);
    makeEmpty(T->Right);
    free(T);
  }
  return NULL;
}

Position
find(ET elem, AVL T)
{
  if (T == NULL)
    return NULL;
  if (elem < T->Element)
    return find(elem, T->Left);
  else if (elem > T->Element)
    return find(elem, T->Right);
  else
    return T;
}

Position
findMin(AVL T)
{
  if (T == NULL)
    return NULL;
  else if (T->Left == NULL)
    return T;
  else
    return findMin(T->Left);
}

Position
findMax(AVL T)
{
  if (T != NULL)
    while (T->Right != NULL)
      T = T->Right;
  return T;
}

/*
 * MAW 4.22 Write the functions to perform the double rotation without the inefficiency of doing
 * two single rotations.
 * Naming convention follows the figure 4.42 on P.122 of MAW
 */
static AVL
doubleRotateWithLeft2(Position K3)
{
  Position K1 = K3->Left;
  Position K2 = K3->Left->Right;
  K1->Right = K2->Left;
  K3->Left = K2->Right;
  K2->Left = K1;
  K2->Right = K3;

  K1->Height = max(Height(K1->Left), Height(K1->Right)) + 1;
  K3->Height = max(Height(K3->Left), Height(K3->Right)) + 1;
  K2->Height = max(Height(K2->Left), Height(K2->Right)) + 1;

  return K2;
}

/*
 * This function can be called only if K2 has a left child
 * Peform a rotate between a node (K2) and its left child
 * Update heights, then return new root
 */
static AVL
singleRotateWithLeft(Position K2)
{
  Position K1;
  K1 = K2->Left;
  K2->Left = K1->Right;
  K1->Right = K2;

  K1->Height = max(Height(K1->Left), Height(K1->Right)) + 1;
  K2->Height = max(Height(K2->Right), Height(K2->Right)) + 1;

  return K1; // new root
}

/*
 * This function can be called only if K3 has a left
 * child and K3's left child has a right child
 * Do the left-right double rotation
 * Update heights, then return new root
 */
static AVL
doubleRotateWithLeft(Position K3)
{
  K3->Left = singleRotateWithLeft(K3->Left); // Rotate between K1 and K2
  return singleRotateWithLeft(K3); // Rotate between K3 and K2
}

/*
 * This function can be called only if K1 has a right child
 * Peform a rotate between a node (K1) and its right child
 * Update heights, then return new root
 */
static AVL
singleRotateWithRight(Position K2)
{
  Position K1;
  K1 = K2->Right;
  K2->Right = K1->Left;
  K1->Left = K2;

  K2->Height = max(Height(K2->Left), Height(K2->Right)) + 1;
  K1->Height = max(Height(K1->Left), Height(K1->Right)) + 1;
  return K1;
}

/*
 * This function can be called only if K3 has a right
 * child and K3's right child has a left child
 * Do the right-left double rotation
 * Update heights, then return new root
 */
static AVL
doubleRotateWithRight(Position K3)
{
  K3->Right = singleRotateWithLeft(K3->Right);
  return singleRotateWithRight(K3);
}

AVL
insert(ET elem, AVL T)
{
  if (T == NULL)
  {
    T = malloc(sizeof(struct AVLTreeNode));
    T->Element = elem;
    T->Left = T->Right = NULL;
    T->Height = 0;
  }
  else if (elem < T->Element)
  {
    T->Left = insert(elem, T->Left);
    if (Height(T->Left) - Height(T->Right) == 2)
    {
      if(elem < T->Left->Element)
      {
        T = singleRotateWithLeft(T);
      }
      else
      {
        T = doubleRotateWithLeft2(T);  //Use MAW 4.22 version
//        T = doubleRotateWithLeft(T);
      }
    }
  }
  else if (elem > T->Element)
  {
    T->Right = insert(elem, T->Right);
    if (Height(T->Right) - Height(T->Left) == 2)
    {
      if (elem > T->Right->Element)
      {
        T = singleRotateWithRight(T);
      }
      else
      {
        T = doubleRotateWithRight(T);
      }
    }
  }
  // else elem is in the tree already; we'll do nothing
  T->Height = max(Height(T->Left), Height(T->Right)) + 1;
  return T;
}

static Position
makeNode(ET elem)
{
  Position T = malloc(sizeof(struct AVLTreeNode));
  T->Element = elem;
  T->Left = NULL;
  T->Right = NULL;
  T->Height = 0;
  return T;
}

/* To understand this function, I would suggest to try the following insertion to an empty AVL tree:
 * 2,1,4,5,9,3,6,7
 * and follow the illustration: https://cseweb.ucsd.edu/classes/su05/cse100/cse100hw1.pdf p.5
 * a copy is also included in this repo
 */
AVL
insert2(ET elem, AVL T)
{
  // We want to implement a simple stack to store the path from the root to the insertion location.
  // This stack is used when we move backward from the insertion location to
  // the root while we updating the height and do the rotation along the way.
  struct StackRecord
  {
    int Capacity;
    int TopOfStack;
    Position *Array;
  };
  typedef struct StackRecord* NodeStack;
  NodeStack s = malloc(sizeof(struct StackRecord));
  s->Capacity = 10;
  s->TopOfStack = -1;
  s->Array = malloc(s->Capacity *  sizeof(Position));
  if (T == NULL) // if T is an empty AVL tree, we create root and done.
  {
    T = makeNode(elem);
    free(s->Array);
    free(s);
    return T;
  }
  // LastS comes from https://courses.cs.washington.edu/courses/cse373/06sp/handouts/lecture12.pdf p.39 (a copy included)
  // It is the node where the rotation can occur.
  Position LastS = NULL;
  Position K = T;
  while(K != NULL) // We find the insertion location, insert the node, and save the path from root to that location along the way
  {
    s->Array[++s->TopOfStack] = K; // push the node to stack
    if (Height(K->Left) - Height(K->Right) != 0)
      LastS = K;
    if (elem < K->Element)
    {
      if (K->Left == NULL)
      {
        K->Left = makeNode(elem);
        s->Array[++s->TopOfStack] = K->Left; // push the node to stack
        break;
      }
      else
        K = K->Left;
    }
    else if (elem > K->Element)
    {
      if (K->Right == NULL)
      {
        K->Right = makeNode(elem);
        s->Array[++s->TopOfStack] = K->Right; // push the node to stack
        break;
      }
      else
        K = K->Right;
    }
    else
      break;
  }
  Position M = NULL;
  while(s->TopOfStack != -1) // We pop the element from the stack, do the rotation when we meet LastS node, and update height of each node.
  {
    M = s->Array[s->TopOfStack--];
    if (M == LastS)
    {
      if (elem > T->Element) // the path is in the right subtree of the root. We relies on this info to determine what rotation methods to call
      {
        if (Height(M->Right) - Height(M->Left) == 2)
        {
          if (elem < M->Right->Element)
          {
            if (M == T) // handles the case when insert 3 after 2,1,4,5,9 (do the double rotation at the root)
            {
              T = doubleRotateWithRight(M);
            }
            else
            {
              s->Array[s->TopOfStack]->Right = doubleRotateWithRight(M);
            }
          }
          else
          {
            s->Array[s->TopOfStack]->Right = singleRotateWithRight(M);
          }
        }
      }
      else // the path is in the left subtree of the root
      {
        if (Height(M->Right) - Height(M->Left) == 2)
        {
          if (elem < M->Left->Element)
          {
            s->Array[s->TopOfStack]->Left = singleRotateWithLeft(M);
          }
          else
          {
            if (M == T)
            {
              T = doubleRotateWithLeft(M);
            }
            else
            {
              s->Array[s->TopOfStack]->Left = doubleRotateWithLeft(M);
            }
          }
        }
      }
    }
    else
    {
      M->Height = max(Height(M->Left), Height(M->Right)) + 1;
    }
  }
  if (s != NULL) // dispose the stack
  {
    free(s->Array);
    free(s);
  }
  return T;
}

AVL
delete(ET elem, AVL T)
{
  // Perform a normal BST deletion
  Position tmpCell;
  if (T == NULL)
    fatal("Element not found");
  else if (elem < T->Element)
    T->Left = delete(elem, T->Left);
  else if (elem > T->Element)
    T->Right = delete(elem, T->Right);
  else // we found the element to be deleted
  if (T->Left != NULL && T->Right != NULL) // two children
  {
      tmpCell = findMin(T->Right);
      T->Element = tmpCell->Element;
      T->Right = delete(T->Element, T->Right);
  }
  else // one or two children
  {
    tmpCell = T;
    if (T->Right == NULL)
      T = T->Left;
    else if (T->Left == NULL)
      T = T->Right;
    free(tmpCell);
  }

  // Peform AVL deletion specific part
  if (T == NULL) // No node left, simply return
    return T;
  T->Height = max(Height(T->Left), Height(T->Right)) + 1; // update the height for the current node
  if (Height(T->Left) - Height(T->Right) == 2)
  {
    if (Height(T->Left->Left) - Height(T->Left->Right) >= 0)
      T = singleRotateWithLeft(T); //Left Left case
    else
      T = doubleRotateWithLeft(T); //Left Right case
  }
  else if (Height(T->Right) - Height(T->Left) == 2)
  {
    if (Height(T->Right->Right) - Height(T->Right->Left) >= 0)
      T = singleRotateWithRight(T); //Right Right case
    else
      T = doubleRotateWithRight(T); //Right Left case
  }

  return T;
}

ET
retrieve(Position T)
{
  if (T != NULL)
    return T->Element;
  return 0;
}

AVL
initializeAVL(ET* array, int arrayLength)
{
  AVL T = NULL;
  int i;
  for(i = 0; i < arrayLength; i++)
    T = insert(array[i], T);
  return T;
}

static void
bst_print_dot_aux(AVL T, FILE* stream)
{
  if (T != NULL)
  {
    if (T->Left != NULL)
    {
      fprintf(stream, "%d->%d;\n", T->Element, T->Left->Element);
      bst_print_dot_aux(T->Left, stream);
    }
    if (T->Right != NULL)
    {
      fprintf(stream, "%d->%d;\n", T->Element, T->Right->Element);
      bst_print_dot_aux(T->Right, stream);
    }
  }
}

void
bst_print_dot(AVL T, FILE* stream)
{
  fprintf(stream, "digraph AVLSearchTree \{\n");
  bst_print_dot_aux(T, stream);
  fprintf(stream,"}\n");
}

// LastNode is the address containing last value that was assigned to a node
// This function has some nice trick:
// - "*T" is same as "struct AVLTreeNode"
// - we use "*LastNode" to assign value to the tree nodes. In this case, we don't really care about the actual
//   values as long as we satisfy BST property.
static AVL
genTree(int H, int *LastNode)
{
  AVL T;

  if (H >= 0)
  {
    T = malloc(sizeof(*T));
    T->Left = genTree(H-1, LastNode);
    // *LastNode++ will first do "LastNode++" (increamenting the address) then try to access the element using *.
    // We want to access the element first then incrementing. Remember associativity is "right to left" for ++ and *
    T->Element = ++*LastNode;
    T->Right = genTree(H-2, LastNode);
    return T;
  }
  else
    return NULL;
}

// O(log N)
AVL
minAVL(int H)
{
  int LastNodeAssigned = 0;
  return genTree(H, &LastNodeAssigned);
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<xmlReplay>
    <auths>

        <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
        <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>
    </auths>

    <testGroup ID="authrefs" autoDeletePOSTS="false">
        <test ID="oe9">
         <method>POST</method>
         <uri>/cspace-services/personauthorities/</uri>
         <part>
             personauthorities_common
             <filename>objectexit/oe9.xml</filename>
         </part>
      </test>
      <test ID="oe11">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>
             <part>
                 persons_common
                 <filename>objectexit/oe11.xml</filename>
             </part>
        </test>
        <test ID="oe15">
             <method>POST</method>
             <uri>/cspace-services/objectexit/</uri>
             <part>
                 objectexit_common
                 <filename>objectexit/oe15.xml</filename>
             </part>
        </test>
    </testGroup>

    <testGroup ID="makeone" autoDeletePOSTS="false">
         <test ID="oe1"  auth="test">
             <method>POST</method>
             <uri>/cspace-services/objectexit/</uri>
             <filename>objectexit/oe1.xml</filename>
         </test>
        <test ID="oe2">
            <method>GET</method>
            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
            <response>
                <expected level="ADDOK" />
                <filename>objectexit/res/oe2.res.xml</filename>
                objectexit_common
             </response>
        </test>
    </testGroup>

    <testGroup ID="testStartName" autoDeletePOSTS="false">
         <test ID="oe1"  auth="test">
             <method>POST</method>
             <uri>/cspace-services/objectexit/</uri>
             <filename>objectexit/oe1.xml</filename>
         </test>
        <test ID="oe2">
            <method>GET</method>
            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
            <response>
                <expected level="ADDOK" />
                <filename>objectexit/res/oe2.res.xml</filename>

                <startElement>/document/*[local-name()='objectexit_common']</startElement>
             </response>
        </test>
    </testGroup>

    <testGroup ID="checkList" autoDeletePOSTS="true">
        <test ID="oe35"  auth="test">
             <method>POST</method>
             <uri>/cspace-services/objectexit/</uri>
             <vars>
            	<var ID="exitNumber">checkList-1234</var>
            </vars>
            <filename>objectexit/oe35.xml</filename>
        </test>
        <test ID="o36">
            <method>GET</method>
            <uri>/cspace-services/objectexit/</uri>
            <response>
                <expected level="ADDOK" />
                <filename>objectexit/res/oe35.res.xml</filename>
                <vars>
		  <var ID="targetCSID">${oe35.CSID}</var>
		</vars>

                <startElement>//list-item[./exitNumber='checkList-1234']</startElement>
             </response>
        </test>
    </testGroup>

    <testGroup ID="cleanup" autoDeletePOSTS="true">
         <test ID="oe1"  auth="test">
             <method>DELETE</method>
             <uri>/cspace-services/objectexit/065aa56e-a4f5-44b7-955e</uri>
         </test>
         <test ID="oe1"  auth="test">
             <method>DELETE</method>
             <uri>/cspace-services/objectexit/1735327c-f9bb-42c7-959b</uri>
         </test>
         <test ID="oe1"  auth="test">
             <method>DELETE</method>
             <uri>/cspace-services/objectexit/106cb53d-ee79-44e3-8665</uri>
         </test>
    </testGroup>

    <testGroup ID="domwalk" autoDeletePOSTS="false">
         <test ID="oe1"  auth="test">
             <method>POST</method>
             <uri>/cspace-services/objectexit/</uri>
             <part>
                 objectexit_common
                 <filename>objectexit/oe1.xml</filename>
             </part>
         </test>
        <test ID="oe2">
            <method>GET</method>
            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
            <response>
                <expected level="TEXT" />
                objectexit_common
                <filename>objectexit/res/oe2.res.xml</filename>
             </response>
        </test>
    </testGroup>

    <testGroup ID="repeat" autoDeletePOSTS="true">
        <test ID="oeRepeat"  auth="admin@core.collectionspace.org">
            <method>POST</method>
            <uri>/cspace-services/objectexit/</uri>
            <part>
                objectexit_common
                <filename>objectexit/oeRepeat.xml</filename>
            </part>
        </test>
    </testGroup>

     <testGroup ID="CRUDL" autoDeletePOSTS="true">
         <test ID="oe1"  auth="admin@core.collectionspace.org">
             <method>POST</method>
             <uri>/cspace-services/objectexit/</uri>
             <part>
                 objectexit_common
                 <filename>objectexit/oe1.xml</filename>
             </part>
         </test>
        <test ID="oe2">
            <method>GET</method>
            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
            <response>
                objectexit_common
                <filename>objectexit/res/oe2.res.xml</filename>
             </response>
        </test>
        <test ID="oe3">
             <method>POST</method>
             <uri>/cspace-services/objectexit/</uri>
             <part>
                 objectexit_common
                 <filename>objectexit/oe3.xml</filename>
             </part>
         </test>
        <test ID="oe4">
             <method>POST</method>
             <uri>/cspace-services/objectexit/</uri>
             <part>
                 objectexit_common
                 <filename>objectexit/oe4.xml</filename>
             </part>
         </test>
         <test ID="oe5">
             <method>POST</method>
             <uri>/cspace-services/objectexit/</uri>
             <part>
                 objectexit_common
                 <filename>objectexit/oe5.xml</filename>
             </part>
         </test>

         <test ID="oe7">
            <method>GET</method>
            <uri>/cspace-services/objectexit/9223372036854775807</uri>
            <expectedCodes>404</expectedCodes>
        </test>
        <test ID="oe8">
            <method>GET</method>
            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
            <reponse>oe8.res.xml</reponse>
        </test>
         <test ID="oe9">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/</uri>
             <part>
                 personauthorities_common
                 <filename>objectexit/oe9.xml</filename>
             </part>
         </test>
         <test ID="oe10">
            <method>GET</method>
            <uri>/cspace-services/personauthorities/${oe9.CSID}</uri>
        </test>

        <test ID="oe11">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>
             <part>
                 persons_common
                 <filename>objectexit/oe11.xml</filename>
             </part>
        </test>
        <test ID="oe12">
            <method>GET</method>
            <uri>/cspace-services/personauthorities/${oe9.CSID}/items/${oe11.CSID}</uri>
        </test>
        <test ID="oe13">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>
             <part>
                 persons_common
                 <filename>objectexit/oe13.xml</filename>
             </part>
        </test>
        <test ID="oe14">
            <method>GET</method>
            <uri>/cspace-services/personauthorities/${oe11.CSID}/items/${oe13.CSID}</uri>
        </test>
        <test ID="oe15">
             <method>POST</method>
             <uri>/cspace-services/objectexit/</uri>
             <part>
                 objectexit_common
                 <filename>objectexit/oe15.xml</filename>
             </part>
        </test>
        <test ID="oe16">
            <method>GET</method>
            <uri>/cspace-services/objectexit/${oe15.CSID}</uri>
        </test>
        <test ID="oe17">
            <method>GET</method>
            <uri>/cspace-services/objectexit/${oe15.CSID}/authorityrefs/</uri>
        </test>
        <test ID="oe18">
            <method>DELETE</method>
            <uri>/cspace-services/personauthorities/${oe9.CSID}/items/${oe11.CSID}</uri>
        </test>

        <test ID="oe19">
            <method>DELETE</method>
            <uri>/cspace-services/personauthorities/${oe9.CSID}/items/${oe13.CSID}</uri>
        </test>
        <test ID="oe20">
            <method>DELETE</method>
            <uri>/cspace-services/personauthorities/${oe9.CSID}</uri>
        </test>
        <test ID="oe21">
            <method>DELETE</method>
            <uri>/cspace-services/objectexit/${oe15.CSID}</uri>
        </test>
        <test ID="oe22">
            <method>GET</method>
            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
        </test>
        <test ID="oe23">
             <method>PUT</method>
             <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
             <part>
                 objectexit_common
                 <filename>objectexit/oe23.xml</filename>
             </part>
        </test>
        <test ID="oe24">
            <method>DELETE</method>
            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
        </test>
        <test ID="oe25">
            <method>DELETE</method>
            <uri>/cspace-services/objectexit/9223372036854775807</uri>
            <expectedCodes>404</expectedCodes>
        </test>
       <test ID="oe26">
             <method>PUT</method>
             <uri>/cspace-services/objectexit/9223372036854775807</uri>
             <part>
                 objectexit_common
                 <filename>objectexit/oe23.xml</filename>
             </part>
             <expectedCodes>404</expectedCodes>
        </test>
        <test ID="oe27">
            <method>GET</method>
            <uri>/cspace-services/objectexit/?sortBy=&pgNum=0&pgSz=1</uri>
        </test>
        <test ID="oe28">
            <method>GET</method>
            <uri>/cspace-services/objectexit/?sortBy=&pgNum=0&pgSz=1</uri>
        </test>
        <test ID="oe29">
            <method>GET</method>
            <uri>/cspace-services/objectexit/?sortBy=&pgNum=1&pgSz=1</uri>
        </test>
        <test ID="oe30">
            <method>GET</method>
            <uri>/cspace-services/objectexit/?sortBy=&pgNum=2&pgSz=1</uri>
        </test>
        <test ID="oe31">
            <method>DELETE</method>
            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
            <expectedCodes>404</expectedCodes>
        </test>
        <test ID="oe32">
            <method>DELETE</method>
            <uri>/cspace-services/objectexit/${oe3.CSID}</uri>
        </test>
        <test ID="oe33">
            <method>DELETE</method>
            <uri>/cspace-services/objectexit/${oe4.CSID}</uri>
        </test>
        <test ID="oe34">
            <method>DELETE</method>
            <uri>/cspace-services/objectexit/${oe5.CSID}</uri>
        </test>

     </testGroup>

    <testGroup ID="domlist" autoDeletePOSTS="true">
         <test ID="oe1"  auth="admin@core.collectionspace.org">
             <method>POST</method>
             <uri>/cspace-services/objectexit/</uri>
             <part>
                 objectexit_common
                 <filename>objectexit/oe1.xml</filename>
             </part>
         </test>
        <test ID="oe3">
             <method>POST</method>
             <uri>/cspace-services/objectexit/</uri>
             <part>
                 objectexit_common
                 <filename>objectexit/oe3.xml</filename>
             </part>
         </test>
        <test ID="oe4">
             <method>POST</method>
             <uri>/cspace-services/objectexit/</uri>
             <part>
                 objectexit_common
                 <filename>objectexit/oe4.xml</filename>
             </part>
         </test>
         <test ID="oe5">
             <method>POST</method>
             <uri>/cspace-services/objectexit/</uri>
             <part>
                 objectexit_common
                 <filename>objectexit/oe5.xml</filename>
             </part>
         </test>
         <test ID="oe6">
            <method>GET</method>
            <uri>/cspace-services/objectexit/</uri>
            <response>
                <expected level="TEXT" />
                <filename>objectexit/res/oe6.res.xml</filename>
             </response>
        </test>
    </testGroup>

</xmlReplay>


text:
package console

// RunningOnTerminal checks whether stdout is terminal
//
// Stub for FreeBSD, until in go1.3 terminal.IsTerminal would start working for FreeBSD
func RunningOnTerminal() bool {
	return false
}


text:
require 'alki/feature_test'

describe 'Try mounts' do
  it 'should not mount if other assembly can be found' do
    obj = Alki.new do
      try_mount :other, 'missing_assembly'
      set :val do
        respond_to? :other
      end
    end
    obj.val.must_equal false
  end

  it 'should mount if other assembly can be found' do
    obj = Alki.new do
      try_mount :other, 'example' # example fixture assembly
      set :val do
        respond_to? :other
      end
    end
    obj.val.must_equal true
  end
end