text:
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<servers>
<server>
      <id>sonatype-nexus-snapshots</id>
      <username>${env.SONATYPE_USER}</username>
      <password>${env.SONATYPE_PASSWORD}</password>
</server>
<server>
    <id>sonatype-nexus-staging</id>
    <username>${env.SONATYPE_USER}</username>
    <password>${env.SONATYPE_PASSWORD}</password>
</server>
    <server>
      <id>ossrh</id>
      <username>${env.SONATYPE_JIRA_USER}</username>
      <password>${env.SONATYPE_JIRA_PASS}</password>
    </server>
</servers>
 <profiles>
    <profile>
      <id>gpg</id>
      <properties>
        <gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
      </properties>
    </profile>
<profile>
<id>sonatype-staging</id>
<repositories>
<repository>
<id>sonatype-staging</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<layout>default</layout>
<releases><enabled>true</enabled></releases>
</repository>
</repositories>
</profile>
  </profiles>
 <activeProfiles>
    <activeProfile>gpg</activeProfile>
    <activeProfile>sonatype-staging</activeProfile>
  </activeProfiles>
</settings>


text:
import { Genes_artist } from "__generated__/Genes_artist.graphql"
import { renderRelayTree } from "DevTools"
import React from "react"
import { graphql } from "react-relay"
import { ExtractProps } from "Utils/ExtractProps"
import { GenesFragmentContainer as Genes } from "../Genes"

jest.unmock("react-relay")

const render = (
  artist: Omit<Genes_artist, " $refType">,
  extraProps?: Partial<ExtractProps<typeof Genes>>
) =>
  renderRelayTree({
    Component: (props: any) => (
      <Genes
        artist={{
          ...artist,
        }}
        {...props}
        {...extraProps}
      />
    ),
    mockData: {
      artist,
    },
    query: graphql`
      query GenesTestQuery {
        artist(id: "whatevs") {
          ...Genes_artist
        }
      }
    `,
  })

describe("Genes", () => {
  describe("when having less than 8 genes", () => {
    it("renders all genes", async () => {
      const component = await render({
        related: {
          genes: {
            edges: [
              { node: { name: "Classic", href: "/gene/classic" } },
              { node: { name: "Modern", href: "/gene/modern" } },
              { node: { name: "Postmodern", href: "/gene/postmodern" } },
              { node: { name: "Contemporary", href: "/gene/contemporary" } },
            ],
          },
        },
      })
      expect(component.find("Tag").length).toBe(4)
      expect(component.find("MoreTag").length).toBe(0)
    })
  })
  describe("when having more than 8 genes", () => {
    it("renders first 8 genes and more button", async () => {
      const component = await render({
        related: {
          genes: {
            edges: [
              { node: { name: "Classic", href: "/gene/classic" } },
              { node: { name: "Modern", href: "/gene/modern" } },
              {
                node: { name: "Modern revival", href: "/gene/modern-revival" },
              },
              {
                node: { name: "Pre postmodern", href: "/gene/pre-postmodern" },
              },
              { node: { name: "Postmodern", href: "/gene/postmodern" } },
              {
                node: {
                  name: "Post postmodern",
                  href: "/gene/post-postmodern",
                },
              },
              { node: { name: "Hyper modern", href: "/gene/hypermodern" } },
              { node: { name: "Contemporary", href: "/gene/contemporary" } },
              {
                node: {
                  name: "Post contemporary",
                  href: "/gene/post-contemporary",
                },
              },
            ],
          },
        },
      })
      expect(component.find("Tag").length).toBe(8)
      expect(component.find("MoreTag").length).toBe(1)
    })
  })
})

redpajama_set_name: RedPajamaGithub


text:
#include "TintinCDKCameraUVC.h"
#include "VoxelXUProgrammer.h"
#include "VoxelUSBProgrammer.h"
#include <Logger.h>
#include <UVCStreamer.h>
#include <Parameter.h>
#define _USE_MATH_DEFINES
#include <math.h>

#define REQUEST_EEPROM_SIZE 0x31
#define REQUEST_EEPROM_DATA 0x33

namespace Voxel
{

namespace TI
{

TintinCDKCameraUVC::TintinCDKCameraUVC(Voxel::DevicePtr device): ToFTintinCamera("TintinCDKCamera", device)
{
  _init();
}

bool TintinCDKCameraUVC::_init()
{
  USBDevice &d = (USBDevice &)*_device;

  DevicePtr controlDevice = _device;

  _programmer = Ptr<RegisterProgrammer>(new VoxelXUProgrammer(
   { {0x2D, 1}, {0x52, 1}, {0x54, 1}, {0x4B, 2}, {0x4E, 2}, {0x58, 3}, {0x5C, 3} },
   controlDevice));
  _streamer = Ptr<Streamer>(new UVCStreamer(controlDevice));

  if(!_programmer->isInitialized() || !_streamer->isInitialized())
    return false;

  /* TPL0102 - remove non-volatile access */

  if (!_programmer->writeRegister(0x5410, 0xC0))
    return false;

  if(!_addParameters({
    ParameterPtr(new TintinCDKMixVoltageParameter(*_programmer)),
    ParameterPtr(new TintinCDKIllumVrefParameter(*_programmer)),
    ParameterPtr(new TintinCDKMainCurrentParameter(*_programmer)),
    ParameterPtr(new TintinCDKIllumCurrentParameter(*_programmer)),
    ParameterPtr(new TintinCDKIlluminationPowerParameter(*_programmer)),
    ParameterPtr(new TintinCDKIlluminationPowerPercentParameter(*this, *_programmer)),
    ParameterPtr(new TintinCDKModulationFrequencyParameter(*this, *_programmer, MOD_FREQ1, VCO_FREQ1, MOD_PS1)),
    ParameterPtr(new TintinCDKModulationFrequencyParameter(*this, *_programmer, MOD_FREQ2, VCO_FREQ2, MOD_PS2)),
    ParameterPtr(new TintinCDKUnambiguousRangeParameter(*this, *_programmer))
    }))
  {
    return false;
  }

    if (!_addParameters({ParameterPtr(new TintinCDKPVDDParameterRev2(*_programmer)),}))
      return false;

  /* INA226 initializations: note byteswapped for now */
  if (!_programmer->writeRegister(0x4B00, 0x274F) ||
    !_programmer->writeRegister(0x4E00, 0x274F) ||
    !_programmer->writeRegister(0x4B05, 0x4807) ||
    !_programmer->writeRegister(0x4E05, 0x4F1B)
  )
    return false;

  if(!ToFTintinCamera::_init())
    return false;

  {
    CalibrationInformation &calibInfo = _getCalibrationInformationStructure()[ToF_CALIB_SECT_COMMON_PHASE_OFFSET];
    Vector<String> params = {ILLUM_POWER_PERCENTAGE, DELAY_FB_CORR_MODE, DELAY_FB_DC_CORR_MODE};
    calibInfo.definingParameters.insert(calibInfo.definingParameters.end(), params.begin(), params.end());
  }

  {
    CalibrationInformation &calibInfo = _getCalibrationInformationStructure()[ToF_CALIB_SECT_TEMPERATURE];
    Vector<String> params = {ILLUM_POWER_PERCENTAGE};
    calibInfo.definingParameters.insert(calibInfo.definingParameters.end(), params.begin(), params.end());
  }

  {
    CalibrationInformation &calibInfo = _getCalibrationInformationStructure()[ToF_CALIB_SECT_NON_LINEARITY];
    Vector<String> params = {ILLUM_POWER_PERCENTAGE};
    calibInfo.definingParameters.insert(calibInfo.definingParameters.end(), params.begin(), params.end());
  }

  Ptr<UnsignedIntegerParameter> pixCntMax = std::dynamic_pointer_cast<UnsignedIntegerParameter>(getParam(PIX_CNT_MAX));

  if(pixCntMax)
    pixCntMax->setLowerLimit(50000);

  Ptr<UnsignedIntegerParameter> intgDutyCycle = std::dynamic_pointer_cast<UnsignedIntegerParameter>(getParam(INTG_DUTY_CYCLE));

  if (intgDutyCycle)
    intgDutyCycle->setUpperLimit(20);

  Ptr<UnsignedIntegerParameter> intgTime = std::dynamic_pointer_cast<UnsignedIntegerParameter>(getParam(INTG_TIME));

  if (intgTime)
    intgTime->setUpperLimit(31);

  _parameters.erase(LUMPED_DEAD_TIME);
  _parameters.erase(ILLUM_DC_CORR);
  _parameters.erase(ILLUM_DC_CORR_DIR);

  if (!set(COMP_VREF, 1405U))
    return false;

  if (!set(TILLUM_SLAVE_ADDR, 0x72U))
    return false;

  return true;
}

bool TintinCDKCameraUVC::_setStreamerFrameSize(const FrameSize &s)
{
  UVCStreamer *uvcStreamer = dynamic_cast<UVCStreamer *>(&*_streamer);
  USBDevice &d = (USBDevice &)*_device;

  VideoMode m;
  m.frameSize = s;

  int bytesPerPixel;
  int quadCount;
  ToFFrameType frameType;

  if(!_get(PIXEL_DATA_SIZE, bytesPerPixel) || !_get(QUAD_CNT_MAX, quadCount) || !_getToFFrameType(frameType))
  {
    logger(LOG_ERROR) << "TintinCDKCamera: Could not get current bytes per pixel" << std::endl;
    return false;
  }

  if(!_getFrameRate(m.frameRate))
  {
    logger(LOG_ERROR) << "TintinCDKCamera: Could not get current frame rate" << std::endl;
    return false;
  }

    if(bytesPerPixel == 4)
      m.frameSize.width *= 2;
    if (!uvcStreamer)
    {
      logger(LOG_ERROR) << "TintinCDKCamera: Streamer is not of type UVC" << std::endl;
      return false;
    }

    if(!uvcStreamer->setVideoMode(m))
    {
      logger(LOG_ERROR) << "TintinCDKCamera: Could not set video mode for UVC" << std::endl;
      return false;
    }

  return true;
}

bool TintinCDKCameraUVC::_initStartParams()
{
  FrameSize s;
  USBDevice &d = (USBDevice &)*_device;

  if (!_getFrameSize(s) || !_setStreamerFrameSize(s))
    return false;

  if(!ToFTintinCamera::_initStartParams())
    return false;

  return true;
}

bool TintinCDKCameraUVC::_getFieldOfView(float &fovHalfAngle) const
{
  fovHalfAngle = (87/2.0f)*(M_PI/180.0f);
  return true;
}

bool TintinCDKCameraUVC::_getSupportedVideoModes(Vector<SupportedVideoMode> &supportedVideoModes) const
{
  USBDevice &d = (USBDevice &)*_device;

      supportedVideoModes = Vector<SupportedVideoMode> {
      SupportedVideoMode(320,240,25,1,4),
      SupportedVideoMode(160,240,50,1,4),
      SupportedVideoMode(160,120,100,1,4),
      SupportedVideoMode(80,120,200,1,4),
      SupportedVideoMode(80,60,400,1,4),
      SupportedVideoMode(320,240,50,1,2),
      SupportedVideoMode(320,120,100,1,2),
      SupportedVideoMode(160,120,200,1,2),
      SupportedVideoMode(160,60,400,1,2),
      SupportedVideoMode(80,60,400,1,2),
    };

  return true;
}

bool TintinCDKCameraUVC::_getMaximumVideoMode(VideoMode &videoMode) const
{
  int bytesPerPixel;
  USBDevice &d = (USBDevice &)*_device;
  if(!_get(PIXEL_DATA_SIZE, bytesPerPixel))
  {
    logger(LOG_ERROR) << "TintinCDKCamera: Could not get current bytes per pixel" << std::endl;
    return false;
  }

  videoMode.frameSize.width = 320;
  videoMode.frameSize.height = 240;
  videoMode.frameRate.denominator = 1;
  videoMode.frameRate.numerator = (bytesPerPixel == 4)?25:50;

  return true;
}

bool TintinCDKCameraUVC::_getMaximumFrameRate(FrameRate &frameRate, const FrameSize &forFrameSize) const
{
  int opClockFrequency, bytesPerPixel;

  if(!_get(OP_CLK_FREQ, opClockFrequency) || !_get(PIXEL_DATA_SIZE, bytesPerPixel))
  {
    logger(LOG_ERROR) << "TintinCDKCamera: Could not get " << OP_CLK_FREQ << " or " << PIXEL_DATA_SIZE << std::endl;
    return false;
  }

  opClockFrequency = 24/(1 << opClockFrequency);

  uint numerator = opClockFrequency*1000000,
  denominator = bytesPerPixel*forFrameSize.width*forFrameSize.height;

  uint g = gcd(numerator, denominator);

  frameRate.numerator = 0.8*numerator/g; // 90% of maximum
  frameRate.denominator = denominator/g;

  return true;

}

}
}


text:
from __future__ import annotations

import warnings

from poetry.core.constraints.generic import AnyConstraint
from poetry.core.constraints.generic import BaseConstraint
from poetry.core.constraints.generic import Constraint
from poetry.core.constraints.generic import EmptyConstraint
from poetry.core.constraints.generic import MultiConstraint
from poetry.core.constraints.generic import UnionConstraint
from poetry.core.constraints.generic import parse_constraint
from poetry.core.constraints.generic.parser import parse_single_constraint

warnings.warn(
    "poetry.core.packages.constraints is deprecated."
    " Use poetry.core.constraints.generic instead.",
    DeprecationWarning,
    stacklevel=2,
)

__all__ = [
    "AnyConstraint",
    "BaseConstraint",
    "Constraint",
    "EmptyConstraint",
    "MultiConstraint",
    "UnionConstraint",
    "parse_constraint",
    "parse_single_constraint",
]


text:
Super-optimized cross-browser resize listener for elements. Up to 37x faster than related approaches (read section 5 of the [article](http://arxiv.org/pdf/1511.01223v1.pdf)).

```
npm install element-resize-detector
```

## Usage
Include the script in the browser:
```html
<script src="node_modules/element-resize-detector/dist/element-resize-detector.min.js"></script>
```
This will create a global function `elementResizeDetectorMaker`, which is the maker function that makes an element resize detector instance.

You can also `require` it like so:
```js
var elementResizeDetectorMaker = require("element-resize-detector");
```

### Create instance
```js
// With default options (will use the object-based approach).
// The object-based approach is deprecated, and will be removed in v2.
var erd = elementResizeDetectorMaker();

// With the ultra fast scroll-based approach.
// This will be the default in v2.
var erdUltraFast = elementResizeDetectorMaker({
  strategy: "scroll" //<- For ultra performance.
});
```

## API

### listenTo(element, listener)
Listens to the element for resize events and calls the listener function with the element as argument on resize events.

**Example usage:**

```js
erd.listenTo(document.getElementById("test"), function(element) {
  var width = element.offsetWidth;
  var height = element.offsetHeight;
  console.log("Size: " + width + "x" + height);
});
```

### removeListener(element, listener)
Removes the listener from the element.

### removeAllListeners(element)
Removes all listeners from the element, but does not completely remove the detector. Use this function if you may add listeners later and don't want the detector to have to initialize again.

### uninstall(element)
Completely removes the detector and all listeners.

## Caveats

1. If the element has `position: static` it will be changed to `position: relative`. Any unintentional `top/right/bottom/left/z-index` styles will therefore be applied and absolute positioned children will be positioned relative to the element.
2. A hidden element will be injected as a direct child to the element.

## Credits
This library is using the two approaches (scroll and object) as first described at [http://www.backalleycoder.com/2013/03/18/cross-browser-event-based-element-resize-detection/](http://www.backalleycoder.com/2013/03/18/cross-browser-event-based-element-resize-detection/).

The scroll based approach implementation was based on Marc J's implementation [https://github.com/marcj/css-element-queries/blob/master/src/ResizeSensor.js](https://github.com/marcj/css-element-queries/blob/master/src/ResizeSensor.js).

Please note that both approaches have been heavily reworked for better performance and robustness.

## Changelog

#### 1.1.8

* Fixed a compatability issue with `options.idHandler.get`.

#### 1.1.7

* Fixed some rare issues with uninstalling elements while preparing/resizing.

#### 1.1.6

* Fixed an issue with the resize detector changing the dimensions of the target element in some browsers (e.g., IE and FireFox).

#### 1.1.5

* Fixed an issue with having parent elements `dir=RTL`.

#### 1.1.4

* Added extra safety styles to injected elements to make them more resilient to global CSS affecting them.

#### 1.1.3

* Now `uninstall` supports being called with elements that haven't been initialized. `uninstall` simply ignores non-erd elements.
* `uninstall` now also supports a collection of elements.

#### 1.1.2

* Fixed so that `uninstall` may be called directly after a `listenTo` call.
* Fixed a typo in the readme.
* Fixed an invalid test.

#### 1.1.1

* Using `window.getComputedStyle` instead of relying on the method being available in the global scope. This enables this library to be used in simulated browser environments such as jsdom.

#### 1.1.0

* Supporting inline elements
* Event-based solution for detecting attached/rendered events so that detached/unrendered elements can be listened to without polling
* Now all changes that affects the offset size of an element are properly detected (such as padding and font-size).
* Scroll is stabilized, and is the preferred strategy to use. The object strategy will be deprecated (and is currently only used for some legacy browsers such as IE9 and Opera 12).


text:
import 'core-js';

function createResult(ctx, next) {
  return {
    status: next.status,
    context: ctx,
    output: next.output,
    completed: next.status === pipelineStatus.completed
  };
}

export const pipelineStatus = {
  completed: 'completed',
  canceled: 'canceled',
  rejected: 'rejected',
  running: 'running'
};

interface PipelineStep {
  run(context: Object, next: Function): void;
}

export class Pipeline {
  steps: Array<Function|PipelineStep> = [];

  withStep(step) {
    let run;

    if (typeof step === 'function') {
      run = step;
    } else if (step.isMultiStep) {
      let steps = step.getSteps();
      for (let i = 0, l = steps.length; i < l; i++) {
        this.withStep(steps[i]);
      }

      return this;
    } else {
      run = step.run.bind(step);
    }

    this.steps.push(run);

    return this;
  }

  run(ctx) {
    let index = -1;
    let steps = this.steps;

    function next() {
      index++;

      if (index < steps.length) {
        let currentStep = steps[index];

        try {
          return currentStep(ctx, next);
        } catch(e) {
          return next.reject(e);
        }
      } else {
        return next.complete();
      }
    }

    next.complete = (output) => {
      next.status = pipelineStatus.completed;
      next.output = output;
      return Promise.resolve(createResult(ctx, next));
    };

    next.cancel = (reason) => {
      next.status = pipelineStatus.canceled;
      next.output = reason;
      return Promise.resolve(createResult(ctx, next));
    };

    next.reject = (error) => {
      next.status = pipelineStatus.rejected;
      next.output = error;
      return Promise.resolve(createResult(ctx, next));
    };

    next.status = pipelineStatus.running;

    return next();
  }
}


text:
<?php

namespace Onend\PayPal\Payment\Model;

use JMS\Serializer\Annotation as JMS;

use Onend\PayPal\Common\Enum\Intent;
use Onend\PayPal\Common\Model\AbstractModel;

class Payment extends AbstractModel
{
    /**
     * @JMS\Type("string")
     *
     * @var string
     */
    protected $id;

    /**
     * @JMS\Type("string")
     * @JMS\SerializedName("create_time")
     *
     * @var string
     */
    protected $createTime;

    /**
     * @JMS\Type("string")
     * @JMS\SerializedName("update_time")
     *
     * @var string
     */
    protected $updateTime;

    /**
     * @JMS\Type("string")
     *
     * @var string
     */
    protected $intent;

    /**
     * @JMS\Type("Onend\PayPal\Payment\Model\Payer")
     *
     * @var Payer
     */
    protected $payer;

    /**
     * @JMS\Type("array<Onend\PayPal\Payment\Model\Transaction>")
     *
     * @var Transaction[]
     */
    protected $transactions;

    /**
     * @JMS\Type("Onend\PayPal\Payment\Model\RedirectUrl")
     * @JMS\SerializedName("redirect_urls")
     *
     * @var RedirectUrl
     */
    protected $redirectUrls;

    /**
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @param string $id
     */
    public function setId($id)
    {
        $this->id = $id;
    }

    /**
     * @return string
     */
    public function getCreateTime()
    {
        return $this->createTime;
    }

    /**
     * @param string $createTime
     */
    public function setCreateTime($createTime)
    {
        $this->createTime = $createTime;
    }

    /**
     * @return string
     */
    public function getUpdateTime()
    {
        return $this->updateTime;
    }

    /**
     * @param string $updateTime
     */
    public function setUpdateTime($updateTime)
    {
        $this->updateTime = $updateTime;
    }

    /**
     * @return string
     */
    public function getIntent()
    {
        return $this->intent;
    }

    /**
     * @param string $intent
     * @throws \InvalidArgumentException
     */
    public function setIntent($intent)
    {
        Intent::checkValue($intent);
        $this->intent = $intent;
    }

    /**
     * @return Payer
     */
    public function getPayer()
    {
        return $this->payer;
    }

    /**
     * @param Payer $payer
     */
    public function setPayer(Payer $payer)
    {
        $this->payer = $payer;
    }

    /**
     * @return Transaction[]
     */
    public function getTransactions()
    {
        return $this->transactions;
    }

    /**
     * @param Transaction[] $transactions
     */
    public function setTransactions(array $transactions)
    {
        foreach ($transactions as $transaction) {
            $this->addTransaction($transaction);
        }
    }

    /**
     * @param Transaction $transaction
     */
    public function addTransaction(Transaction $transaction)
    {
        $this->transactions[] = $transaction;
    }

    /**
     * @return RedirectUrl
     */
    public function getRedirectUrls()
    {
        return $this->redirectUrls;
    }

    /**
     * @param RedirectUrl $redirectUrl
     */
    public function setRedirectUrls(RedirectUrl $redirectUrl)
    {
        $this->redirectUrls = $redirectUrl;
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">

x
y
z

End of test


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.ai.formrecognizer.documentanalysis.models;

import com.azure.core.annotation.Immutable;
import com.azure.core.util.ExpandableStringEnum;

import java.util.Collection;

/** Defines values for DocumentPageLengthUnit. */
@Immutable
public final class DocumentPageLengthUnit extends ExpandableStringEnum<DocumentPageLengthUnit> {
    /** Static value pixel for DocumentPageLengthUnit. */
    public static final DocumentPageLengthUnit PIXEL = fromString("pixel");

    /** Static value inch for DocumentPageLengthUnit. */
    public static final DocumentPageLengthUnit INCH = fromString("inch");

    /**
     * Creates or finds a DocumentPageLengthUnit from its string representation.
     *
     * @param name a name to look for.
     * @return the corresponding DocumentPageLengthUnit.
     */
    public static DocumentPageLengthUnit fromString(String name) {
        return fromString(name, DocumentPageLengthUnit.class);
    }

    /** @return known DocumentPageLengthUnit values. */
    public static Collection<DocumentPageLengthUnit> values() {
        return values(DocumentPageLengthUnit.class);
    }
}


text:
import React from 'react';
import { ProgressIndicator, ProgressStep } from '../ProgressIndicator';
import { shallow, mount } from 'enzyme';

describe('ProgressIndicator', () => {
  describe('Renders as expected', () => {
    const progress = (
      <ProgressIndicator className="some-class" currentIndex={3}>
        <ProgressStep
          label="label"
          description="Step 1: Getting Started with Node.js"
        />
        <ProgressStep
          label="label"
          description="Step 2: Getting Started with Node.js"
        />
        <ProgressStep
          label="label"
          description="Step 3: Getting Started with Node.js"
        />
        <ProgressStep
          label="label"
          description="Step 4: Getting Started with Node.js"
        />
        <ProgressStep
          label="label"
          description="Step 5: Getting Started with Node.js"
        />
        <ProgressStep
          label="label"
          description="Step 6: Getting Started with Node.js"
        />
      </ProgressIndicator>
    );
    const list = shallow(progress);
    const mountedList = mount(progress);

    it('should be a ul element', () => {
      expect(list.find('ul').length).toEqual(1);
    });

    it('should render with the appropriate classes', () => {
      expect(list.hasClass('bx--progress')).toEqual(true);
      expect(list.hasClass('some-class')).toEqual(true);
    });

    it('should render children as expected', () => {
      expect(list.find(ProgressStep).length).toEqual(6);
    });

    it('should update state when currentIndex is changed', () => {
      mountedList.setProps({ currentIndex: 1 });
      expect(mountedList.state().currentIndex).toEqual(
        mountedList.props().currentIndex
      );
      mountedList.setProps({ currentIndex: 3 });
    });

    describe('ProgressStep', () => {
      it('should render with correct base className', () => {
        expect(
          mountedList
            .find(ProgressStep)
            .at(0)
            .children()
            .hasClass('bx--progress-step')
        ).toEqual(true);
      });

      it('should render with a label', () => {
        expect(
          mountedList
            .find(ProgressStep)
            .at(0)
            .prop('label')
        ).toEqual('label');
      });

      it('should render with a description', () => {
        expect(
          mountedList
            .find(ProgressStep)
            .at(0)
            .prop('description')
        ).toEqual('Step 1: Getting Started with Node.js');
      });

      it('should render description in <title> node', () => {
        expect(
          mountedList
            .find('ProgressStep title')
            .at(0)
            .text()
        ).toEqual('Step 1: Getting Started with Node.js');
      });

      describe('current', () => {
        it('should render a current ProgressStep with correct className', () => {
          expect(
            mountedList
              .find(ProgressStep)
              .at(3)
              .children()
              .hasClass('bx--progress-step--current')
          ).toEqual(true);
        });

        it('should render a current ProgressStep with correct props', () => {
          expect(
            list
              .find(ProgressStep)
              .at(3)
              .prop('current')
          ).toBe(true);
        });
      });

      describe('complete', () => {
        it('should render any completed ProgressSteps with correct className', () => {
          expect(
            mountedList
              .find(ProgressStep)
              .at(0)
              .children()
              .hasClass('bx--progress-step--complete')
          ).toEqual(true);
        });
        it('should render any completed ProgressSteps with correct props', () => {
          expect(
            list
              .find(ProgressStep)
              .at(0)
              .prop('complete')
          ).toBe(true);
        });
      });

      describe('incomplete', () => {
        it('should render any incompleted ProgressSteps with correct className', () => {
          expect(
            mountedList
              .find(ProgressStep)
              .at(5)
              .children()
              .hasClass('bx--progress-step--incomplete')
          ).toEqual(true);
        });
        it('should render any incompleted ProgressSteps with correct className', () => {
          expect(
            list
              .find(ProgressStep)
              .at(5)
              .prop('complete')
          ).toBe(false);
        });
      });
    });
  });
});


text:
Create native iOS charts using simple JSON as you are used-to with Highcharts like JS library.
This library is a wrapper on top of [CorePlot](https://code.google.com/p/core-plot/), the iOS plotting framework to build native chart using CoreAnimation, Core Data and Cocoa Bindings

## Installation

1. Add this line to your application's Gemfile:

    `gem 'motion-plot'`

  Then execute:

    `$ bundle`

  Or install it yourself as:

    `$ gem install motion-plot`

  And add `require 'motion-plot'` to your `Gemfile`

2. Run '`pod setup`' to install core-plot as a pod

## Usage

  1. Create a UIView (with whatever frame size you wish)
  2. Build a JSON structure with the details of the chart (look at examples for more)
  3. Initialize the chart type with this JSON (it returns back an instance of `CPTGraphHostingView`)
  4. Add the view returned to your view

  Look at the `examples` directory for detail usage options.

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
<?php
/**
 * The manifest of files that are local to specific environment.
 * This file returns a list of environments that the application
 * may be installed under. The returned data must be in the following
 * format:
 *
 * ```php
 * return [
 *     'environment name' => [
 *         'path' => 'directory storing the local files',
 *         'writable' => [
 *             // list of directories that should be set writable
 *         ],
 *     ],
 * ];
 * ```
 */
return [
    'Development' => [
        'path' => 'dev',
        'writable' => [
            'backend/runtime',
            'backend/web/assets',
            'frontend/runtime',
            'frontend/web/assets',
        ],
        'executable' => [
            'yii',
        ],
    ],
    'Production' => [
        'path' => 'prod',
        'writable' => [
            'backend/runtime',
            'backend/web/assets',
            'frontend/runtime',
            'frontend/web/assets',
        ],
        'executable' => [
            'yii',
        ],
    ],
];


text:
//============================================================================
// Copyright 5AM Solutions, Inc
// Copyright Ekagra Software Technologies Ltd.
// Copyright Guidewire Architecture
// Copyright The Ohio State University Research Foundation
// Copyright SAIC
//
// Distributed under the OSI-approved BSD 3-Clause License.
// See http://ncip.github.com/iso21090/LICENSE.txt for details.
//============================================================================

package gov.nih.nci.iso21090.grid.dto.transform.iso;

import gov.nih.nci.iso21090.Ivl;
import gov.nih.nci.iso21090.Ts;
import gov.nih.nci.iso21090.Pq;
import gov.nih.nci.iso21090.grid.dto.transform.AbstractTransformer;
import gov.nih.nci.iso21090.grid.dto.transform.DtoTransformException;
import gov.nih.nci.iso21090.grid.dto.transform.Transformer;

import org.apache.log4j.Logger;
import org.iso._21090.IVLTS;
import org.iso._21090.TS;
import org.iso._21090.PQ;

/**
 * Transforms timestamp intervals.
 */
public final class IVLTSTransformer extends AbstractTransformer<IVLTS, Ivl<Ts>>
    implements Transformer<IVLTS, Ivl<Ts>> {

    /**
     * Public singleton.
     */
    public static final IVLTSTransformer INSTANCE = new IVLTSTransformer();
    private static final Logger LOG = Logger.getLogger(IVLTSTransformer.class);
    private IVLTSTransformer() {
        // intentionally blank
    }

    /**
     * {@inheritDoc}
     */
    public Ivl<Ts> toDto(IVLTS input) throws DtoTransformException {
        if (input == null) {
            return null;
        }
        Ivl<Ts> result = new Ivl<Ts>();

        result.setHigh(TSTransformer.INSTANCE.toDto(input.getHigh()));
        result.setHighClosed(input.isHighClosed());
        result.setLow(TSTransformer.INSTANCE.toDto(input.getLow()));
        result.setLowClosed(input.isLowClosed());
        result.setNullFlavor(NullFlavorTransformer.INSTANCE.toDto(input.getNullFlavor()));
        // Cast from QTY -> TS is ok by invariant in 21090 Sec. 7.11.8.3.5
        result.setWidth(PQTransformer.INSTANCE.toDto((PQ) input.getWidth()));

        // PO-1054 - any not in xsd, but is in our localization

        if (result.isLowMissing() || result.isHighEqualLow()) {
            result.setAny(result.getHigh());
        } else if (result.isHighMissing()) {
            result.setAny(result.getLow());
        }

        return result;
    }

    /**
     * {@inheritDoc}
     */
    public IVLTS toXml(Ivl<Ts> input) throws DtoTransformException {
        if (input == null) {
            return null;
        }
        IVLTS result = new IVLTS();

        result.setHigh(TSTransformer.INSTANCE.toXml(input.getHigh()));
        result.setHighClosed(input.getHighClosed());
        result.setLow(TSTransformer.INSTANCE.toXml(input.getLow()));
        result.setLowClosed(input.getLowClosed());
        result.setNullFlavor(NullFlavorTransformer.INSTANCE.toXml(input.getNullFlavor()));
        // Cast from QTY -> TS is ok by invariant in 21090 Sec. 7.11.8.3.5
        result.setWidth(PQTransformer.INSTANCE.toXml((Pq) input.getWidth()));

        // PO-1054 - any not in xsd, but is in our localization
        if (input.getAny() != null && input.getAny().getNullFlavor() == null) {
            if ((result.getHigh() == null || (result.getHigh() != null && result.getHigh().getNullFlavor() != null))
            		&& (result.getLow() == null || (result.getLow() != null && result.getLow().getNullFlavor() != null))) {
                result.setHigh(TSTransformer.INSTANCE.toXml(input.getAny()));
                result.setLow(TSTransformer.INSTANCE.toXml(input.getAny()));
                result.setHighClosed(true);
                result.setLowClosed(true);
            } else {
                LOG.warn("Lost IVL.any information because high and low were non-null.");
            }
        }

        return result;
    }

    /**
     * {@inheritDoc}
     */
    public IVLTS[] createXmlArray(int size) throws DtoTransformException {
        return new IVLTS[size];
    }

}


text:
<?php
/**
 * APPLICATION FRONT CONTROLLER FILE
 *
 * @author Denysenko Dmytro
 */
ini_set('display_errors', true);
error_reporting(E_ALL | E_STRICT);
define('DS', DIRECTORY_SEPARATOR);
define('PS', PATH_SEPARATOR);
define('BP', dirname(dirname(__FILE__)));
$pathinfo = pathinfo(__FILE__);
// Define the front controller name and docroot
define('DOC_ROOT', $pathinfo['dirname'] . DS);
define('FRONT_CONTROLLER_FILE', $pathinfo['basename']);
// If the front controller is a symlink, change to the real docroot
is_link(FRONT_CONTROLLER_FILE) and chdir(dirname(realpath(__FILE__)));
define('STATIC_PATH', realpath(DOC_ROOT . 'static') . DS);
define('VAR_PATH', realpath(dirname(__FILE__) . '/var') . DS);
// Define path to application directory
define('APPLICATION_PATH', DOC_ROOT . 'application' . DS);
// Define application environment
define('APPLICATION_ENV', ((file_exists(DOC_ROOT . '.production')) ? 'production' : 'development'));
define('INSTALLER_PATH', DOC_ROOT . 'installer' . DS);
define('LIBRARY_PATH', DOC_ROOT . 'library' . DS);
@set_include_path(LIBRARY_PATH . PATH_SEPARATOR . './');
if (! file_exists(VAR_PATH . 'configuration.ini') and file_exists(INSTALLER_PATH . 'Bootstrap.php')) {
    $bootstrap = INSTALLER_PATH . 'Bootstrap.php';
    $bootstrapClass = 'Installer_Bootstrap';
} else {
    $bootstrap = LIBRARY_PATH . 'Bootstrap.php';
    $bootstrapClass = 'Main_Bootstrap';
}
require_once $bootstrap;
$bootstrap = new $bootstrapClass();
$bootstrap->run();


text:
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;

import com.sun.nio.sctp.MessageInfo;

public class SctpMain {
	public static int msgexch = 0;
	public static SctpVectorClock sv;
	public static SctpMessage sm;
	public static SctpME sme;
	public static SctpServer s1;
	public static SctpClient c1;
	public static SctpToken st;
	public static SctpValidateReply svr;
	public static SctpApp sap;
	public static SctpLogger LOG;
	public static boolean Oktoterminate=false;
	public static boolean terminationreceived=false;

	public static int nodeno;
	public static BufferedReader br = new BufferedReader(new InputStreamReader(
			System.in));

	// Synchronized block for processing incoming request
	// Server threads will send the data here as they receive
	public static void Processdata(SctpMessage newmsg)
	{
		// do message processing here

		if (newmsg != null) {

			// determine if the message type is of request and take action accordingly
			if(newmsg.isIs_msg_request())
			{
				System.out.println("Process Data : New request for critical section received from node: "+ newmsg.getNode_no());
				SctpMain.LOG.logger.info("\tProcess Data :  New request for critical section received from node: "+ newmsg.getNode_no());
				System.out.println("Process Data : Sequence no: "+newmsg.getSeq_no());
				SctpMain.LOG.logger.info("\tProcess Data :  Sequence no: "+newmsg.getSeq_no());

				//Update RN with the received request
				SctpMain.sv.setRequest_Node(newmsg.getNode_no(), newmsg.getSeq_no());

				// if token is idle and queue is empty then add it to queue
				if((SctpToken.doihavetoken)&&(!SctpToken.isLocktoken()))//&&(SctpToken.getTokenQ().isEmpty()))
				{
					SctpToken.addTokenQ(newmsg.getNode_no());

					SctpValidateReply.ValidateReply();
				}

				// else we dont have action pending
				// if you have token then its in CS or if not you have queue waiting
				//to which you will transfer control

			}
			else if(newmsg.isIs_msg_reply())
			{

				System.out.println("Process Data : Reply received");
				SctpMain.LOG.logger.info("\tProcess Data :Reply received");
				// Lock token for executing CS
				// Validate reply: sending token will be prevented until lock is removed
				SctpToken.setLocktoken(true);

				System.out.println("Process Data : q content before update" +SctpToken.getTokenQ());
				SctpMain.LOG.logger.info("\tProcess Data : q content before update" +SctpToken.getTokenQ());
				SctpToken.setTokenVector(newmsg.getTokenVector());
				SctpToken.setTokenQ(newmsg.getTokenQueue());
				System.out.println("Process Data : q content after update" +SctpToken.getTokenQ());
				SctpMain.LOG.logger.info("\tProcess Data : q content after update" +SctpToken.getTokenQ());

				// you have the token so update the flag
				// ME: the condition will be true and thread will be unblocked
				SctpToken.doihavetoken=true;

				System.out.println("Process Data :Token Lock status: "+SctpToken.isLocktoken());
				SctpMain.LOG.logger.info("\tProcess Data :Token Lock status: "+SctpToken.isLocktoken());
				System.out.println("Process Data :Token status: "+SctpToken.doihavetoken);
				SctpMain.LOG.logger.info("\tProcess Data :Token status: "+SctpToken.doihavetoken);
			}
			else if(newmsg.isterminationmsg)
			{
				System.out.println("Process Data : Termination Received ");
				terminationreceived=true;
				Oktoterminate=true;
			}

		}
	}

	public static void main(String args[]) throws InterruptedException,
			IOException {

		nodeno = Integer.parseInt(args[0]);
		Configfilereader r = new Configfilereader();
		r.readfile();

		SctpServer s1 = new SctpServer(nodeno);
		SctpClient c1 = new SctpClient(nodeno);
		sm = new SctpMessage(nodeno);
		sv = new SctpVectorClock();
		sme=new SctpME();
		svr=new SctpValidateReply();
		SctpToken st=new SctpToken();
		LOG=new SctpLogger();

		Thread t1 = new Thread(s1);
		t1.start();

		Thread.sleep(1000);

		System.out
		.println("Main : Press enter to start Application...Make sure your all node servers are UP");
		br.readLine();

		Thread t2 = new Thread(c1);
		t2.start();

			// start the application thread
		SctpApp sap = new SctpApp();
		Thread t4 = new Thread(sap);
		t4.start();

		//t1.join();
		//t2.join();

		while(Oktoterminate==false)
		{
			// do nothing
			if(Oktoterminate==true)
				break;

			System.out.print("");

		}

		System.out.println("Closing the connections");

	//	Thread.sleep(5000);

		if(terminationreceived==true)
		{
			if(c1.send_terminatation())
			{
			t2.interrupt();
			t1.interrupt();
			}
		}
		else if(c1.send_terminatation())
		{

			t2.interrupt();
			t1.interrupt();
		}

		Thread.sleep(5000);

//		for (int i = 0; i < Configfilereader.totalnodes; i++) {
//			System.out.print(SctpVectorClock.Request_Node[i] + "\t");
//
//		}

	}

}


text:
namespace DispatchSourceExamples.Models
{
    public class DispatchSourceItem
    {
        public string Title { get; set; }

        public string Subtitle { get; set; }

        public DispatchSourceType Type { get; set; }
    }

    public enum DispatchSourceType
    {
        Timer,
        Vnode,
        MemoryPressure,
        ReadMonitor,
        WriteMonitor
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Nova Hedwigia, Beih. 29: 143 (1969)

#### Original name
Hydropus gerronematoides Singer

### Remarks
null


text:
import markdown from 'markdown-in-js'
import withDoc, { components } from '~/lib/with-doc'

import { expoteam } from '~/data/team'

// prettier-ignore
export default withDoc({
  title: 'Detaching to ExpoKit',
  authors: [expoteam],
})(markdown(components)`

ExpoKit is an Objective-C and Java library that allows you to use the Expo platform and your existing Expo project as part of a larger standard native project -- one that you would normally create using Xcode, Android Studio, or \`react-native init\`.

## What is this for?

If you created an Expo project in XDE and you want a way to add custom native modules, this guide will explain how to use ExpoKit for that purpose.

Normally, Expo apps are written in pure JS and never "drop down" to the native iOS or Android layer. This is core to the Expo philosophy and it's part of what makes Expo fast and powerful to use.

However, there are some cases where advanced developers need native capabilities outside of what Expo offers out-of-the-box. The most common situation is when a project requires a specific Native Module which is not supported by React Native Core or the Expo SDK.

In this case, Expo allows you to \`detach\` your pure-JS project from the Expo iOS/Android clients, providing you with native projects that can be opened and built with Xcode and Android Studio. Those projects will have dependencies on ExpoKit, so everything you already built will keep working as it did before.

We call this "detaching" because you still depend on the Expo SDK, but your project no longer lives inside the standard Expo client. You control the native projects, including configuring and building them yourself.

## Should I detach?

### You might want to detach if:

- Your Expo project needs a native module that Expo doesn't currently support. We're always expanding the [Expo SDK](../sdk), so we hope this is never the case. But it happens, especially if your app has very specific and uncommon native demands.

### You should not detach if:

- All you need is to distribute your app in the iTunes Store or Google Play. Expo can [build binaries for you](building-standalone-apps) in that case. If you detach, we can't automatically build for you any more.
- You are uncomfortable writing native code. Detached apps will require you to manage Xcode and Android Studio projects.
- You enjoy the painless React Native upgrades that come with Expo. After your app is detached, breaking changes in React Native will affect your project differently, and you may need to figure them out for your particular situation.
- You require Expo's push notification services. After detaching, since Expo no longer manages your push certificates, you'll need to manage your own push notification pipeline.
- You rely on asking for help in the Expo community. In your native Xcode and Android Studio projects, you may encounter questions which are no longer within the realm of Expo.

## Instructions

The following steps are for converting a pure-JS Expo project (such as one created from XDE)
into a native iOS and Android project which depends on ExpoKit.

After you \`detach\`, all your JS files will stay the same, but we'll additionally create \`ios\` and
\`android\` directories in your project folder. These will contain Xcode and Android Studio projects
respectively, and they'll have dependencies on React Native and on Expo's core SDK.

You'll still be able to develop and test your project from XDE, and you'll still be able to publish
your Expo JS code the same way. However, if you add native dependencies that aren't included
in Expo, other users won't be able to run those features of your app with the main Expo app.
You'll need to distribute the native project yourself.

>  **Note:** \`detach\` is currently an alpha feature and you may run into issues. Your project must be running Expo SDK 16.0.0 or newer to detach. Proceed at your own risk and please reach out to us with any feedback or issues you encounter.

### 1. Install exp

If you don't have it, run \`npm install -g exp\` to get our command line library.

If you haven't used \`exp\` or XDE before, the first thing you'll need to do is log in
with your Expo account using \`exp login\`.

### 2. Make sure you have the necessary keys in app.json

Detaching requires the same keys as building a standalone app. [Follow these instructions before continuing to the next step](building-standalone-apps.html#2-configure-appjson).

### 3. Detach

From your project directory, run \`exp detach\`. This will download the required dependencies and
build native projects under the \`ios\` and \`android\` directories.

### 4. Set up and Run your native project

Congrats, you now have a native project with ExpoKit! Follow the directions under [Developing with ExpoKit](expokit.html) to get things set up and running.

### 5. Make native changes

You can do whatever you want in the Xcode and Android Studio projects.

To add third-party native modules for React Native, non-Expo-specific instructions such as \`react-native link\` should be supported. [Read more details about changing native dependencies in your ExpoKit project](expokit.html#changing-native-dependencies).

### 6. Distribute your app

Publishing your JS from XDE/exp will still work. Users of your app will get the new JS on their
devices as soon as they reload their app; you don't need to rebuild your native code if it has
not changed.

If you do make native changes, people who don't have your native code may encounter crashes if
they try to use features that depend on those changes.

If you decide to distribute your app as an \`ipa\` or \`apk\`, it will automatically hit
your app's published URL instead of your development XDE url. Read [advanced details about your app's JS url](advanced-expokit-topics#configuring-the-js-url).

In general, before taking your app all the way to production, it's a good idea to glance over the [Advanced ExpoKit Topics](advanced-expokit-topics) guide.

`)


text:
package org.doublelong.jastroblast.controller;

import java.util.HashMap;
import java.util.Map;

import org.doublelong.jastroblast.Inputs;
import org.doublelong.jastroblast.entity.Ship;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputAdapter;
import com.badlogic.gdx.math.Vector2;

public class ShipController extends InputAdapter
{
	private static final float DAMP = .991f;
	private static final float MAX_VELOCITY = 2.5f;
	private static final float SPEED = 1.1f;

	enum Keys {LEFT, RIGHT, UP, DOWN}
	static Map<Keys, Boolean> keys = new HashMap<ShipController.Keys, Boolean>();
	static
	{
		keys.put(Keys.LEFT, false);
		keys.put(Keys.RIGHT, false);
		keys.put(Keys.UP, false);
		keys.put(Keys.DOWN, false);
	}

	public Ship getShip() { return this.ship; }

	private final Ship ship;

	public ShipController(Ship ship)
	{
		this.ship = ship;
	}

	public void update(float delta)
	{
		this.processInput(delta);

		//		// add the velocity to the position
		//		this.setMaxVelocities();
		//		this.space.getShip().getPosition().add(this.space.getShip().getVelocity());
		//
		//
		//		// "frame-time!"
		//		this.space.getShip().getVelocity().mul(delta);
		//
		//		// dampen the x and y velocity by a fixed amount (to add slowing effect)
		//		this.space.getShip().getVelocity().x *= DAMP;
		//		this.space.getShip().getVelocity().y *= DAMP;
		//
		//		this.space.getShip().getVelocity().mul(1 / delta);
		//
		//		this.space.getShip().renderer.sprite.setPosition(this.space.getShip().getPosition().x, this.space.getShip().getPosition().y);

		//this.wrap();
	}

	public void processInput(float delta)
	{
		Vector2 velocity = this.ship.getBody().getLinearVelocity();
		float angle =  (float) Math.toDegrees(this.ship.getBody().getAngle()) / 60; //add 90 degress because it's pointing up!
		System.out.println(angle);
		Vector2 desiredVelocity = new Vector2();
		Vector2 worldCenter = this.ship.getBody().getWorldCenter();
		Vector2 localCenter = this.ship.getBody().getLocalCenter();

		if(this.isLeftThrust())
		{
			this.ship.getBody().applyLinearImpulse(new Vector2(0,-Ship.SPEED), localCenter, true);
		}

		if(this.isRightThrust())
		{
			this.ship.getBody().applyLinearImpulse(new Vector2(0, Ship.SPEED), localCenter, true);
		}

		if (this.isForwardThrust())
		{
			float y = (float) Math.cos(angle) * Ship.SPEED;
			float x = (float) Math.sin(angle) * Ship.SPEED;
			desiredVelocity.x = x * Ship.RAITO * -1;
			desiredVelocity.y = y * Ship.RAITO;
			//			desiredVelocity.x += velocity.x;
			//			desiredVelocity.y += velocity.y;
			this.ship.getBody().applyLinearImpulse(desiredVelocity, worldCenter, true);
		}
		this.ship.getBody().setAngularDamping(0.5f);
		this.ship.getBody().setLinearDamping(0.1f);
	}

	private boolean isForwardThrust()
	{
		return Gdx.input.isKeyPressed(Inputs.PLAYER_THRUST);
	}

	private boolean isRightThrust()
	{
		return Gdx.input.isKeyPressed(Inputs.PLAYER_RIGHT);
	}

	private boolean isLeftThrust()
	{
		return Gdx.input.isKeyPressed(Inputs.PLAYER_LEFT);
	}
}


text:
import createFetchSaga from '../../sagas/createFetchSaga'

import { roomLeave } from '../actions'
import { getRoomSelection } from '../selectors'

export default createFetchSaga(roomLeave, {
  payloadSelector: getRoomSelection,
  payloadReducer: roomId => ({ roomId })
})


text:
require 'formula'

class Cookiecutter < Formula
  homepage 'https://github.com/audreyr/cookiecutter'
  url 'https://pypi.python.org/packages/source/c/cookiecutter/cookiecutter-0.7.1.tar.gz'
  sha1 '278a615977a4b29cead14cc9ede07a8c7452864a'

  depends_on :python if MacOS.version <= :snow_leopard

  def install
    ENV.prepend_create_path 'PYTHONPATH', libexec+'lib/python2.7/site-packages'
    system "python", "setup.py", "install", "--prefix=#{libexec}"

    bin.install Dir[libexec/'bin/*']
    bin.env_script_all_files(libexec+'bin', :PYTHONPATH => ENV['PYTHONPATH'])
  end

  test do
    system "#{bin}/cookiecutter", "--help"
  end
end


text:
#include "tensorflow/lite/delegates/gpu/cl/kernels/max_unpooling.h"

#include <string>

#include "tensorflow/lite/delegates/gpu/cl/kernels/util.h"
#include "tensorflow/lite/delegates/gpu/cl/kernels/work_group_picking.h"

namespace tflite {
namespace gpu {
namespace cl {
namespace {

std::string GetMaxUnpoolingKernelCode(
    const OperationDef& op_def, const CLDevice& device,
    const std::vector<ElementwiseOperation*>& linked_operations) {
  TensorCodeGenerator src("src_data",
                          WHSPoint{"src_size.x", "src_size.y", "src_size.z"},
                          op_def.src_tensors[0]);
  TensorCodeGenerator src_ind(
      "src_data_indices", WHSPoint{"src_size.x", "src_size.y", "src_size.z"},
      op_def.src_tensors[1]);
  TensorCodeGenerator dst("dst_data",
                          WHSPoint{"dst_size.x", "dst_size.y", "dst_size.z"},
                          op_def.dst_tensors[0]);

  const auto address_mode = GetFastestZeroMode(device);

  std::string c = GetCommonDefines(op_def.precision);

  c += "__kernel void main_function(\n";
  c += src.GetDeclaration(AccessType::READ) + ",\n";
  c += src_ind.GetDeclaration(AccessType::READ);
  c += GetArgsDeclaration(linked_operations);
  c += dst.GetDeclaration(AccessType::WRITE) + ",\n";
  c += "    int4 src_size,      \n";
  c += "    int4 dst_size,      \n";
  c += "    int2 kernel_size,   \n";
  c += "    int2 padding,       \n";
  c += "    int2 stride         \n";
  c += ") {\n";
  c += "  int X = get_global_id(0);\n";
  c += "  int Y = get_global_id(1);\n";
  c += "  int Z = get_global_id(2);\n";
  c += "  if (X >= dst_size.x || Y >= dst_size.y || Z >= dst_size.z) return;\n";
  if (op_def.IsBatchSupported()) {
    c += "  int linear_id = get_global_id(0);\n";
    c += "  int X0 = linear_id / dst_size.w;\n";
    c += "  int B = linear_id % dst_size.w;\n";
    c += "  int src_x0 = (X0 + padding.x) / stride.x;\n";
    c += "  int src_x = src_x0 * dst_size.w + B;\n";
  } else {
    c += "  int src_x = (X + padding.x) / stride.x;\n";
  }
  c += "  int src_y = (Y + padding.y) / stride.y;\n";
  c += "  " + src.GetAddressWHS("src_adr", "src_x", "src_y", "Z") + "\n";
  if (op_def.src_tensors[0].storage_type == TensorStorageType::BUFFER) {
    c += "  bool outside = src_x < 0 || src_y < 0 ||";
    c += "  src_x >= src_size.x || src_y >= src_size.y;\n";
    c += "  FLT4 src = (FLT4)(0.0f);\n";
    c += "  int4 ind = (int4)(0);\n";
    c += "  if (!outside) {\n";
    c += "    src = " + src.Read("src_adr") + ";\n";
    c += "    ind = convert_int4(" + src_ind.Read("src_adr") + ");\n";
    c += "  }\n";
  } else {
    c += "  FLT4 src = " + src.Read("src_adr", address_mode) + ";\n";
    c += "  int4 ind = convert_int4(" + src_ind.Read("src_adr", address_mode) +
         ");\n";
  }
  if (op_def.IsBatchSupported()) {
    c += "  int t_x = X0 - (src_x0 * stride.x - padding.x);\n";
  } else {
    c += "  int t_x = X - (src_x * stride.x - padding.x);\n";
  }
  c += "  int t_y = Y - (src_y * stride.y - padding.y);\n";
  c += "  int t_index = t_y * kernel_size.x + t_x;\n";
  c += "  FLT4 result;\n";
  const std::string channels[] = {".x", ".y", ".z", ".w"};
  for (int i = 0; i < 4; ++i) {
    const auto& s = channels[i];
    c += "  result" + s + "= t_index == ind" + s + "? src" + s + ": 0.0f;\n";
  }
  c += PostProcess(linked_operations, {"result", "X", "Y", "Z"});
  c += "  " + dst.WriteWHS("result", "X", "Y", "Z");
  c += "}\n";

  return c;
}

std::string GetMaxUnpooling3DKernelCode(
    const OperationDef& op_def, const CLDevice& device,
    const std::vector<ElementwiseOperation*>& linked_operations) {
  TensorCodeGenerator src(
      "src_data",
      WHDSPoint{"src_size.x", "src_size.y", "src_size.z", "src_size.w"},
      op_def.src_tensors[0]);
  TensorCodeGenerator src_ind(
      "src_data_indices",
      WHDSPoint{"src_size.x", "src_size.y", "src_size.z", "src_size.w"},
      op_def.src_tensors[1]);
  TensorCodeGenerator dst(
      "dst_data",
      WHDSPoint{"dst_size.x", "dst_size.y", "dst_size.z", "dst_size.w"},
      op_def.dst_tensors[0]);

  const auto address_mode = GetFastestZeroMode(device);

  std::string c = GetCommonDefines(op_def.precision);

  c += "__kernel void main_function(\n";
  c += src.GetDeclaration(AccessType::READ) + ",\n";
  c += src_ind.GetDeclaration(AccessType::READ);
  c += GetArgsDeclaration(linked_operations);
  c += dst.GetDeclaration(AccessType::WRITE) + ",\n";
  c += "    int4 src_size,      \n";
  c += "    int4 dst_size,      \n";
  if (op_def.IsBatchSupported()) {
    c += "    int batch_size,          \n";
  }
  c += "    int4 kernel_size,   \n";
  c += "    int4 padding,       \n";
  c += "    int4 stride         \n";
  c += ") {\n";
  c += "  int X = get_global_id(0);\n";
  c += "  int Y = get_global_id(1);\n";
  c += "  int linear_id_z = get_global_id(2);\n";
  c += "  int S = linear_id_z % dst_size.w;\n";
  c += "  int Z = linear_id_z / dst_size.w;\n";
  c += "  if (X >= dst_size.x || Y >= dst_size.y || Z >= dst_size.z) return;\n";
  if (op_def.IsBatchSupported()) {
    c += "  int linear_id = get_global_id(0);\n";
    c += "  int X0 = linear_id / batch_size;\n";
    c += "  int B = linear_id % batch_size;\n";
    c += "  int src_x0 = (X0 + padding.x) / stride.x;\n";
    c += "  int src_x = src_x0 * batch_size + B;\n";
  } else {
    c += "  int src_x = (X + padding.x) / stride.x;\n";
  }
  c += "  int src_y = (Y + padding.y) / stride.y;\n";
  c += "  int src_z = (Z + padding.z) / stride.z;\n";
  c += "  " + src.GetAddressWHDS("src_adr", "src_x", "src_y", "src_z", "S") +
       "\n";
  if (op_def.src_tensors[0].storage_type == TensorStorageType::BUFFER) {
    c += "  bool outside = src_x < 0 || src_y < 0 || src_z < 0 || ";
    c += "  src_x >= src_size.x || src_y >= src_size.y || src_z >= "
         "src_size.z;\n";
    c += "  FLT4 src = (FLT4)(0.0f);\n";
    c += "  int4 ind = (int4)(0);\n";
    c += "  if (!outside) {\n";
    c += "    src = " + src.Read("src_adr") + ";\n";
    c += "    ind = convert_int4(" + src_ind.Read("src_adr") + ");\n";
    c += "  }\n";
  } else {
    c += "  FLT4 src = " + src.Read("src_adr", address_mode) + ";\n";
    c += "  int4 ind = convert_int4(" + src_ind.Read("src_adr", address_mode) +
         ");\n";
  }
  if (op_def.IsBatchSupported()) {
    c += "  int t_x = X0 - (src_x0 * stride.x - padding.x);\n";
  } else {
    c += "  int t_x = X - (src_x * stride.x - padding.x);\n";
  }
  c += "  int t_y = Y - (src_y * stride.y - padding.y);\n";
  c += "  int t_z = Z - (src_z * stride.z - padding.z);\n";
  c += "  int t_index = (t_y * kernel_size.x + t_x) * kernel_size.z + t_z;\n";
  c += "  FLT4 result;\n";
  const std::string channels[] = {".x", ".y", ".z", ".w"};
  for (int i = 0; i < 4; ++i) {
    const auto& s = channels[i];
    c += "  result" + s + " = t_index == ind" + s + " ? src" + s + ": 0.0f;\n";
  }
  c += PostProcess(linked_operations, {"result", "X", "Y", "S"});
  c += "  " + dst.WriteWHDS("result", "X", "Y", "Z", "S");
  c += "}\n";
  return c;
}
}  // namespace

MaxUnpooling::MaxUnpooling(const OperationDef& definition,
                           const MaxUnpooling2DAttributes& attr)
    : GPUOperation(definition),
      stride_(attr.strides.w, attr.strides.h),
      padding_(attr.padding.appended.w, attr.padding.appended.h),
      kernel_size_(attr.kernel.w, attr.kernel.h) {}

MaxUnpooling::MaxUnpooling(MaxUnpooling&& kernel)
    : GPUOperation(std::move(kernel)),
      stride_(kernel.stride_),
      padding_(kernel.padding_),
      kernel_size_(kernel.kernel_size_),
      kernel_(std::move(kernel.kernel_)),
      work_group_size_(kernel.work_group_size_) {}

MaxUnpooling& MaxUnpooling::operator=(MaxUnpooling&& kernel) {
  if (this != &kernel) {
    std::swap(stride_, kernel.stride_);
    std::swap(padding_, kernel.padding_);
    std::swap(kernel_size_, kernel.kernel_size_);
    kernel_ = std::move(kernel.kernel_);
    std::swap(work_group_size_, kernel.work_group_size_);
    GPUOperation::operator=(std::move(kernel));
  }
  return *this;
}

absl::Status MaxUnpooling::Compile(const CreationContext& creation_context) {
  const auto code = GetMaxUnpoolingKernelCode(
      definition_, *creation_context.device, linked_operations_);
  return creation_context.cache->GetOrCreateCLKernel(
      code, "main_function", *creation_context.context,
      *creation_context.device, &kernel_);
}

absl::Status MaxUnpooling::BindArguments() {
  kernel_.ResetBindingCounter();
  RETURN_IF_ERROR(kernel_.SetMemoryAuto(src_[0]->GetMemoryPtr()));
  RETURN_IF_ERROR(kernel_.SetMemoryAuto(src_[1]->GetMemoryPtr()));
  RETURN_IF_ERROR(BindArgs(&kernel_, linked_operations_));
  RETURN_IF_ERROR(kernel_.SetMemoryAuto(dst_[0]->GetMemoryPtrForWriting()));
  RETURN_IF_ERROR(kernel_.SetBytesAuto(src_[0]->GetWBatchedHSB()));
  RETURN_IF_ERROR(kernel_.SetBytesAuto(dst_[0]->GetWBatchedHSB()));
  RETURN_IF_ERROR(kernel_.SetBytesAuto(kernel_size_));
  RETURN_IF_ERROR(kernel_.SetBytesAuto(padding_));
  RETURN_IF_ERROR(kernel_.SetBytesAuto(stride_));
  return absl::OkStatus();
}

int3 MaxUnpooling::GetGridSize() const {
  const int grid_x = dst_[0]->Width() * dst_[0]->Batch();
  const int grid_y = dst_[0]->Height();
  const int grid_z = dst_[0]->Slices();
  return int3(grid_x, grid_y, grid_z);
}

absl::Status MaxUnpooling::Tune(const TuningParameters& params) {
  RETURN_IF_ERROR(BindArguments());
  return GetBestWorkGroup(params, kernel_, GetGridSize(), &work_group_size_);
}

absl::Status MaxUnpooling::AddToQueue(CLCommandQueue* queue) {
  RETURN_IF_ERROR(BindArguments());
  return queue->DispatchImplicit(kernel_, GetGridSize(), work_group_size_);
}

MaxUnpooling CreateMaxUnpooling(const OperationDef& definition,
                                const MaxUnpooling2DAttributes& attr) {
  return MaxUnpooling(definition, attr);
}

MaxUnpooling3D::MaxUnpooling3D(const OperationDef& definition,
                               const MaxUnpooling3DAttributes& attr)
    : GPUOperation(definition),
      stride_(attr.strides.w, attr.strides.h, attr.strides.d),
      padding_(attr.padding.appended.w, attr.padding.appended.h,
               attr.padding.appended.d),
      kernel_size_(attr.kernel.w, attr.kernel.h, attr.kernel.d) {}

MaxUnpooling3D::MaxUnpooling3D(MaxUnpooling3D&& kernel)
    : GPUOperation(std::move(kernel)),
      stride_(kernel.stride_),
      padding_(kernel.padding_),
      kernel_size_(kernel.kernel_size_),
      kernel_(std::move(kernel.kernel_)),
      work_group_size_(kernel.work_group_size_) {}

MaxUnpooling3D& MaxUnpooling3D::operator=(MaxUnpooling3D&& kernel) {
  if (this != &kernel) {
    std::swap(stride_, kernel.stride_);
    std::swap(padding_, kernel.padding_);
    std::swap(kernel_size_, kernel.kernel_size_);
    kernel_ = std::move(kernel.kernel_);
    std::swap(work_group_size_, kernel.work_group_size_);
    GPUOperation::operator=(std::move(kernel));
  }
  return *this;
}

absl::Status MaxUnpooling3D::Compile(const CreationContext& creation_context) {
  const auto code = GetMaxUnpooling3DKernelCode(
      definition_, *creation_context.device, linked_operations_);
  return creation_context.cache->GetOrCreateCLKernel(
      code, "main_function", *creation_context.context,
      *creation_context.device, &kernel_);
}

absl::Status MaxUnpooling3D::BindArguments() {
  kernel_.ResetBindingCounter();
  RETURN_IF_ERROR(kernel_.SetMemoryAuto(src_[0]->GetMemoryPtr()));
  RETURN_IF_ERROR(kernel_.SetMemoryAuto(src_[1]->GetMemoryPtr()));
  RETURN_IF_ERROR(BindArgs(&kernel_, linked_operations_));
  RETURN_IF_ERROR(kernel_.SetMemoryAuto(dst_[0]->GetMemoryPtrForWriting()));
  RETURN_IF_ERROR(kernel_.SetBytesAuto(src_[0]->GetWBatchedHDS()));
  RETURN_IF_ERROR(kernel_.SetBytesAuto(dst_[0]->GetWBatchedHDS()));
  if (definition_.IsBatchSupported()) {
    RETURN_IF_ERROR(kernel_.SetBytesAuto(src_[0]->Batch()));
  }
  RETURN_IF_ERROR(kernel_.SetBytesAuto(
      int4(kernel_size_.x, kernel_size_.y, kernel_size_.z, 1)));
  RETURN_IF_ERROR(
      kernel_.SetBytesAuto(int4(padding_.x, padding_.y, padding_.z, 1)));
  RETURN_IF_ERROR(
      kernel_.SetBytesAuto(int4(stride_.x, stride_.y, stride_.z, 1)));
  return absl::OkStatus();
}

int3 MaxUnpooling3D::GetGridSize() const {
  const int grid_x = dst_[0]->Width() * dst_[0]->Batch();
  const int grid_y = dst_[0]->Height();
  const int grid_z = dst_[0]->Slices() * dst_[0]->Depth();
  return int3(grid_x, grid_y, grid_z);
}

absl::Status MaxUnpooling3D::Tune(const TuningParameters& params) {
  RETURN_IF_ERROR(BindArguments());
  return GetBestWorkGroup(params, kernel_, GetGridSize(), &work_group_size_);
}

absl::Status MaxUnpooling3D::AddToQueue(CLCommandQueue* queue) {
  RETURN_IF_ERROR(BindArguments());
  return queue->DispatchImplicit(kernel_, GetGridSize(), work_group_size_);
}

MaxUnpooling3D CreateMaxUnpooling3D(const OperationDef& definition,
                                    const MaxUnpooling3DAttributes& attr) {
  return MaxUnpooling3D(definition, attr);
}

}  // namespace cl
}  // namespace gpu
}  // namespace tflite


text:
select
ci.id as id,
ci.field_name as field_name,
ci.field_txt as field_txt,
ci.field_href as field_href,
ci.is_show as is_show,
ci.field_type as field_type,
ci.replace_va as replace_value,
ci.dict_code as dict_code,
ci.s_flag  as search_flag,
ci.s_mode as search_mode,
ci.cgrhead_id as cgreport_head_id
from jform_cgreport_item ci,jform_cgreport_head ch
where 1=1
and ci.cgrhead_id = ch.id
and ch.code = '${configId}'
order by ci.order_num asc


text:
\chapter{Back-end design}
This chapter describes the communication between server and client, as well as the design choices and implementation of database.

\section{Communication}
\label{sec:com}

The communication between the client application and the server is done by \ac{http} POST requests.
The client sends a \ac{http} POST request to the server containing a certain list of parameters which define what the server is supposed to do. All requests must take at least two required parameters, a \textit{RequestCode} and a \textit{Type}.

\textit{RequestCode} is an integer that is simply passed through the server, it is not handled in any way on the server. The purpose of the \textit{RequestCode} parameter is to distinguish the request on the client allowing it to execute the appropriate function.

\textit{Type} is used to identify the request. A typical request is to get a list of feeds, and the value of the \textit{Type} parameter would be ``GetFeeds'' in this case.

Depending on the \textit{Type} of the request, additional parameters may be required. As an example, \textit{GetFeeds} takes the following additional parameters:
\begin{itemize}
\item RequestCode
\item UserId
\item Limit
\end{itemize}

The approach is to process the request server side, and make the right calls to the database. The server will then return a JSON object containing all the relevant information that was requested. This JSON object can easily be parsed on the client side. The reason why we chose JSON as a format is because it is well supported and easy to generate in both Android and PHP.

\begin{lstlisting}[language=phpstyle, caption=getFeeds function call]
$requestCode = $_POST['RequestCode'];

switch ($_POST['Type']) {
        case "GetFeeds":
            getFeeds($con, $_POST['UserId'], $_POST['Limit']);
            break;
}
\end{lstlisting}

\begin{description}
\item[Line 1] Get the \lstinline|RequestCode| parameter.
\item[Lines 3-7] If \lstinline|Type| equals ``GetFeeds'', call the \lstinline|getFeeds()| function.
\end{description}

\begin{lstlisting}[language=phpstyle, label=lst:getFeeds, caption={getFeeds function}]
function getFeeds($con, $userId, $limit) {

    global $requestCode;

    #Escape special characters to avoid SQL injection attacks
    $userId    = $con->real_escape_string($userId);
    $limit     = $con->real_escape_string($limit);

    $query =   "SELECT feeds.id, feeds.boothid, feeds.header, feeds.description, feeds.feedtime, userbooths.userid, companies.logo, booths.name ".
        "FROM feeds ".
        "LEFT JOIN userbooths ".
        "ON feeds.boothid = userbooths.boothid ".
        "LEFT JOIN booths ".
        "ON feeds.boothid = booths.id ".
        "LEFT JOIN companies ".
        "ON booths.companyid = companies.id ".
        "WHERE userid = ".$userId." ".
        "AND sub = 1 ".
        "ORDER BY feeds.feedtime DESC ".
        "LIMIT "$limit;

    $result = $con->query($query);

    $json = array();
    while($row = $result->fetch_object()) {
      array_push($json, $row);
    }

    $final->RequestCode = $requestCode;
    $final->Data = $json;
    echo json_encode($final);
}
\end{lstlisting}

\begin{description}
\item[Line 1] The function takes three parameters, the MySQLi object which has a connection
  established to the database, the user ID from the client, and the limit which is also given by the client.
\item[Line 3] Since the \lstinline|RequestCode| is always a required parameter the variable is global.
\item[Lines 6-7] Escape special characters to avoid malicious SQL injections.
\item[Lines 9-20] Create the SQL query with the user ID and the limit parameter.
\item[Line 22] Execute the query.
\item[Lines 24-31] Get the results from the database and push them to the JSON array. When all of the results have been pushed to the array, the \textit{RequestCode} and the JSON array will be JSON encoded and echoed.
\end{description}

As seen on line 29 in \autoref{lst:getFeeds} the result is JSON encoded and then echoed. An example of a result from the \textit{GetFeeds} type request could look like the following:

\begin{lstlisting}[language=json, label=lst:jsonResult, caption=Example result from a request with type: \textit{GetFeeds}]
{
    "RequestCode": "1",
    "Data": [
        {
            "id": "16",
            "boothid": "90",
            "header": "Windows 9",
            "description": "Come and get a preview of the new Windows 9!",
            "feedtime": "2013-11-21 13:39:20",
            "userid": "66",
            "logo": "microsoftlogo.png",
            "name": "Gruppe nr 5"
        },
        {
            "id": "1",
            "boothid": "90",
            "header": "Welcome to the exhibition!",
            "description": "Welcome to this test exhibition, we hope you enjoy your stay.",
            "feedtime": "2013-11-21 13:17:36",
            "userid": "66",
            "logo": "microsoftlogo.png",
            "name": "Gruppe nr 5"
        }
    ]
}
\end{lstlisting}

Note that the result in \autoref{lst:jsonResult} is an object with two attributes, the data and the request code. The result will always be in this format.

All of the requests to the server follows this principle. When a request is made, the query is run and data is gathered, lastly the result is returned as a JSON object that the client reads. Our types of requests are as follows:
\begin{description}
\item[GetFeeds] Will return all the necessary data about a certain number of feeds. They are sorted to return the newest feed first and then the next number of feeds that corresponds to the given limit parameter.
\item[CreateUser] Creates a new user in the database and returns the user ID.
\item[GetNewFeeds] Returns data about all new feeds since the last update. This means that the user can manually fetch all new feeds.
\item[CheckFeeds] Check if any new feeds are available, and if it is the case the of new feeds will be returned.
\item[GetOldFeeds] Load a certain number of feeds that are older than the current oldest feed showing. This allows the user to load the next batch of feeds.
\item[GetSchedule] Returns relevant data about the schedule of the exhibition. Used for the schedule tab on the Android application.
\item[GetExhibitionInfo] Returns all information about the exhibition, such as the description and logo.
\item[GetCategories] Returns a list of categories, and the booths of this category, that are associated with the current exhibition. It also contains a flag that shows whether the user is currently subscribed to a booth or not.
\item[SetCategories] This request is run when the ``submit'' button is pressed in the category chooser. This updates the booths that the user is subscribed to in the database.
\item[GetFloorPlan] This request returns all relevant data about the floor plan. This includes the position of booths and the walk path. This is used to construct the floor plan.
\item[BoothSeen] This requests takes a user ID and a booth ID as additional parameters and increments the \textit{seen} attribute of that booth by one for that particular user. This way we can track how many times a user has seen a specific booth.
\end{description}

\section{Database}
We are using a MySQL database which is located at a remote server.

The server contains all data about each exhibition, the companies at the exhibition, the feeds, the schedule, and basic information about the users.

\autoref{fig:erd} shows the \ac{er} diagram of our database. The diagram does not show the attributes of the entities.

\begin{figure}[H]
\centering
\includegraphics[page=1,width=1\linewidth]{img/sw7ERD.pdf}
\caption{ER diagram}
\label{fig:erd}
\end{figure}

\newcommand{\rel}[2]{$(#1:#2)$}

The relationships in the \ac{er} diagram needs a detailed description, but most of them are self explanatory.

All functional relationship types are total participations, except for the relationship \textit{has} between \textit{coordinate} and \textit{booth}, which is partial participation.

The \textit{attends} relationship between \textit{exhib} and \textit{user} is \rel{1}{n} because it is decided that one person that attends different exhibitions will get a new user for each exhibition he visits. We could also have made it an \rel{n}{m} relationship, but that would require us to make some kind of way to retrieve an existing user for that person and then also subscribe him to that exhibition. The user is not required to give any information when he is registered to an exhibition i.e. the registration is automatic, then we do not need to save any user data to be used at other exhibitions.

The \textit{contain} relationship between edge and \textit{coordinate} is shown to be a \rel{n}{1}, but the \textit{edge} actually contains exactly two coordinates, which can not be shown with Chen notation.

\textit{Category} only has a relationship with \textit{booth}. This means that one specific category can be used for multiple booths at different exhibitions. This is a design choice.

\autoref{tab:relations} shows the mapping of our \ac{er} diagram to relations.

\newcommand{\relation}[1]{[\{ #1 \}]\\}

\begin{table}[H]
\centering
\small
\begin{tabular}{p{1.2cm} p{9.6cm}}
booth: & \relation{\underline{id: int}, exhibid $\ra$ exhib: int, categoryid $\ra$ category: int, companyid $\ra$ company: int, name: varchar, description: text}
category: & \relation{\underline{id: int}, name: varchar}
company: & \relation{\underline{id: int}, name: varchar, logo: varchar}
coordinate: & \relation{\underline{id: int}, x: double, y: double, isroad: tinyint, boothid $\ra$ booth: int, exhibid $\ra$ exhib: int}
edge: & \relation{\underline{id: int}, weight: double, vertexA $\ra$ coordinate: int, vertexB $\ra$ coordinate: int}
exhib: & \relation{\underline{id: int}, name: varchar, address: varchar, zip: int, country: varchar, description: text, logo: varchar}
feed: & \relation{\underline{id: int}, boothid $\ra$ booth: int, header: varchar, description: text, feedtime: timestamp}
schedule: & \relation{\underline{id: int}, boothid $\ra$ booth: int, name: text, starttime: timestamp, endtime: timestamp}
picks: & \relation{\underline{id: int}, userid $\ra$ user: int, boothid $\ra$ booth: int, seen: tinyint, sub: tinyint}
user: & \relation{\underline{id: int}, exhibid $\ra$ exhib: int}
\end{tabular}
\caption{Relations}
\label{tab:relations}
\end{table}
%\todo{Måske skriv at vi ikke kan bruge foreign keys i vores database}
A coordinate can be of three different types. If \textit{boothid} is null and \textit{isroad} is not null the coordinate is simply a point on the road. If \textit{boothid} is not null and \textit{isroad} is null the coordinate is a point used to define where the booth lies. If neither of the two attributes are null the coordinate is an entrance to the booth, i.e. the point lies on the road but is a part of the booth.
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "../master"
%%% End:


text:
Z3Ann
=====

A neural network generator using Z3 constraint solver to find weights

/!\ You should first install Z3 C++ api to compile this project.


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

<title>Source code</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

001package com.teamupnext.robot;
002
003/**
004 * The RobotMap is a mapping from the ports sensors and actuators are wired into
005 * to a variable name. This provides flexibility changing wiring, makes checking
006 * the wiring easier and significantly reduces the number of magic numbers
007 * floating around.
008 */
009public class RobotMap {
010
011    //General Constants
012    public static final double DEFAULT_MOTOR_SAFETY_EXPIRATION = .5;
013    public static double DEFAULT_PNEUMATIC_TIMEOUT = .5;
014    //End General Constants
015
016    //Joystick Constants
017    public static final int DRIVING_JOYSTICK_PORT = 1;
018    public static final int CONTROLS_JOYSTICK_PORT = 2;
019    public static final int TESTING_JOYSTICK_PORT = 4;
020    public static final int A_BUTTON = 1;
021    public static final int B_BUTTON = 2;
022    public static final int X_BUTTON = 3;
023    public static final int Y_BUTTON = 4;
024    public static final int LEFT_BUMPER = 5;
025    public static final int RIGHT_BUMPER = 6;
026    public static final int BACK_BUTTON = 7;
027    public static final int START_BUTTON = 8;
028    public static final int LEFT_X_AXIS_INDEX = 1;
029    public static final int LEFT_Y_AXIS_INDEX = 2;
030    public static final int TRIGGERS = 3; //Triggers (Each trigger = 0 to 1, axis value = right - left)
031    public static final int RIGHT_X_AXIS_INDEX = 4;
032    public static final int RIGHT_Y_AXIS_INDEX = 5;
033    public static final int DPAD = 6; //DPad Left/Right
034    //End Joystick Constants
035
036    //Drive Train Constants
037    public static final int DRIVE_LEFT_FRONT_CAN = 4;
038    public static final int DRIVE_LEFT_BACK_CAN = 5;
039    public static final int DRIVE_RIGHT_FRONT_CAN = 2;
040    public static final int DRIVE_RIGHT_BACK_CAN = 3;
041    public static final int SHIFT_DOWN_SOLENOID_CHANNEL = 7;
042    public static final int SHIFT_UP_SOLENOID_CHANNEL = 8;
043    public static final double SHIFT_TIMEOUT_TIME = .25;
044    public static final int DEFAULT_JOYSTICK_SENSITIVITY = 8;
045    //End Drive Train Constants
046
047    //Camera Constants
048    public static final int CAMERA_BRIGHTNESS = 50;
049    public static final String TARGETING_CAMERA_ADDRESS = "10.35.28.11";
050    public static final String DISC_CAMERA_ADDRESS = "10.35.28.12";
051    public static final int TARGETING_CAMERA_BRIGHTNESS = 0;
052    public static final int TARGETING_CAMERA_COMPRESSION = 50;
053    public static final int TARGETING_CAMERA_COLOR_LEVEL = 100;
054    public static final int DISC_CAMERA_COMPRESSION = 50;
055    public static final int DISC_CAMERA_COLOR_LEVEL = 0;
056    public static final int DISC_CAMERA_BRIGHTNESS = 50;
057    //End Camera Constants
058
059    //Feeder Constants
060    public static final int FEEDER_PUSH_SOLENOID_CHANNEL = 5;
061    public static final int FEEDER_PULL_SOLENOID_CHANNEL = 6;
062    public static final int HOLDER_PUSH_SOLENOID_CHANNEL = 3;
063    public static final int HOLDER_PULL_SOLENOID_CHANNEL = 4;
064    public static final double FEEDER_PUSH_TIMEOUT = .5;
065    public static final double FEEDER_PULL_TIMEOUT = .1;
066    public static final double HOLDER_PUSH_TIMEOUT = .1;
067    public static final double HOLDER_PULL_TIMEOUT = .25;
068    //End Feeder Constants
069
070    //PickerUpper Constants
071    public static final int ARM_UP_SOLENOID_CHANNEL = 2;
072    public static final int ARM_DOWN_SOLENOID_CHANNEL = 1;
073    public static final double ARM_UP_TIMEOUT = .25;
074    public static final double ARM_DOWN_TIMEOUT = .25;
075    public static final int SWEEPER_PWM_CHANNEL = 2;
076    public static double SWEEPER_SPEED = 1;
077    public static double CLAMP_TIMEOUT = .3;
078    //End PickerUpper Constants
079
080    //Shooter Constants
081    public static final int SHOOTER_CAN = 6;
082    public static final int SHOOTER_PWM_CHANNEL = 3;
083    public static final double SHOOTING_POWER_DEFAULT = .75;
084    public static final double SHOOTER_FROM_STOP_TIMEOUT = 4;
085    public static final double SHOOTER_LITTLE_HOP_TIMEOUT = 1;
086    public static final double SHOOTER_PREHOP_TIMEOUT = .5;
087    public static final double SHOOTER_HOP_SPEED = 1.0;
088    public static final double SHOOTER_PREHOP_SPEED = .5;
089    //End Shooter Constants
090
091    //Compressor Constants
092    public static final int COMPRESSOR_RELAY_CHANNEL = 1;
093    public static final int PRESSURE_SWITCH_DIO_CHANNEL = 1;
094    //End Compressor Constants
095
096    //TableTilter Constants
097    public static final int TABLE_GYRO_CHANNEL = 2;
098    public static final int LEAD_SCREW_RELAY_CHANNEL = 3;
099    public static final int TABLE_LOW_LIMIT_CHANNEL = 3;
100    public static final int TABLE_HIGH_LIMIT_CHANNEL = 5;
101    public static final double TABLE_GYRO_SENSITIVITY = .007;
102    //End TableTilter Constants
103
104    //Auto Constants
105    public static final double AUTO_REVERSE_TIME = 1.7;
106    public static final double AUTO_DRIVE_POWER = 0.6;
107    public static final double AUTO_FORWARD_TIME = 2;
108    //End Auto Constants
109}


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Port (JUnit5-Docker 1.0.1-SNAPSHOT API)</title>
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Field |

Required |

Optional

Detail:

Field |

Element

com.github.junit5docker

Annotation Type Port

public @interface Port

Describes a port binding for a docker container.

Since:

1.0

Required Element Summary

Required Elements

Modifier and Type
Required Element and Description

int
exposed

This is the port number to use in the test code for data exchange with the container.

int
inner

This is the port number used by the application inside the container.

Element Detail

exposed

public abstract int exposed

This is the port number to use in the test code for data exchange with the container.

Returns:

the port number exposed on the host.

inner

public abstract int inner

This is the port number used by the application inside the container.

Returns:

the port number declared by the container.

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Field |

Required |

Optional

Detail:

Field |

Element

Copyright © 2017. All rights reserved.


text:
using System;
using Adaptive.Arp.Api;

namespace Adaptive.Arp.Api.Impl
{

     /**
        Interface for Managing the browser operations
        Auto-generated implementation of IBrowser specification.
     */
     public class BrowserDelegate : BaseUIDelegate, IBrowser
     {

          /**
             Default Constructor.
          */
          public BrowserDelegate() : base()
          {
          }

          /**
             Method for opening a URL like a link in the native default browser

             @param url Url to open
             @return The result of the operation
             @since v2.0
          */
          public bool OpenExtenalBrowser(string url) {
               // bool response;
               // TODO: Not implemented.
               throw new NotSupportedException("BrowserDelegate:openExtenalBrowser");
               // return response;
          }

          /**
             Method for opening a browser embedded into the application

             @param url            Url to open
             @param title          Title of the Navigation bar
             @param backButtonText Title of the Back button bar
             @return The result of the operation
             @since v2.0
          */
          public bool OpenInternalBrowser(string url, string title, string backButtonText) {
               // bool response;
               // TODO: Not implemented.
               throw new NotSupportedException("BrowserDelegate:openInternalBrowser");
               // return response;
          }

          /**
             Method for opening a browser embedded into the application in a modal window

             @param url            Url to open
             @param title          Title of the Navigation bar
             @param backButtonText Title of the Back button bar
             @return The result of the operation
             @since v2.0
          */
          public bool OpenInternalBrowserModal(string url, string title, string backButtonText) {
               // bool response;
               // TODO: Not implemented.
               throw new NotSupportedException("BrowserDelegate:openInternalBrowserModal");
               // return response;
          }

     }
}
/**
------------------------------------| Engineered with ♥ in Barcelona, Catalonia |--------------------------------------
*/


text:
var win = Titanium.UI.currentWindow;

// path variables
Titanium.API.info('Resources Directory :' + Titanium.Filesystem.resourcesDirectory);
Titanium.API.info('Temp Directory :' + Titanium.Filesystem.tempDirectory);
Titanium.API.info('Application Directory :' + Titanium.Filesystem.applicationDirectory);
Titanium.API.info('Application Data Directory :' + Titanium.Filesystem.applicationDataDirectory);
Titanium.API.info('Application Support Directory :' + Titanium.Filesystem.applicationSupportDirectory);

Titanium.API.info('External Storage Available :' + Titanium.Filesystem.isExternalStoragePresent());
Titanium.API.info('Separator :' + Titanium.Filesystem.separator);
Titanium.API.info('Line Ending :' + Titanium.Filesystem.lineEnding);

var f = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory, 'text.txt');
Ti.API.info('file = ' + f);
var contents = f.read();
Ti.API.info("contents blob object = "+contents);
Ti.API.info('contents = ' + contents.text);
Ti.API.info('mime type = ' + contents.mimeType);
Ti.API.info('Blob\'s file = ' + contents.file);
Ti.API.info('nativePath = ' + f.nativePath);
Ti.API.info('Blob\'s file nativePath= ' + contents.file.nativePath);
Ti.API.info('exists = ' + f.exists());
Ti.API.info('size = ' + f.size);
Ti.API.info('readonly = ' + f.readonly);
Ti.API.info('symbolicLink = ' + f.symbolicLink);
Ti.API.info('executable = ' + f.executable);
Ti.API.info('hidden = ' + f.hidden);
Ti.API.info('writable = ' + f.writable);
Ti.API.info('name = ' + f.name);
Ti.API.info('extension = ' + f.extension());
Ti.API.info('resolve = ' + f.resolve());
Ti.API.info('created = ' + String(new Date(f.createTimestamp()))); // #2085 test

var dir = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory);
Ti.API.info('directoryListing = ' + dir.getDirectoryListing());
Ti.API.info('getParent = ' + dir.getParent());
Ti.API.info('spaceAvailable = ' + dir.spaceAvailable());

var newDir = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'mydir');
Ti.API.info("Created mydir: " + newDir.createDirectory());
Ti.API.info('newdir ' + newDir);
var newFile = Titanium.Filesystem.getFile(newDir.nativePath,'newfile.txt');
newFile.write(f.read());
Ti.API.info('directoryListing for newDir = ' + newDir.getDirectoryListing());
Ti.API.info("newfile.txt created: " + String(new Date(newFile.createTimestamp())));
Ti.API.info("newfile.txt modified: " + String(new Date(newFile.modificationTimestamp())));
Ti.API.info("newfile.txt renamed as b.txt: " + newFile.rename('b.txt'));

var renamedFile = Titanium.Filesystem.getFile(newDir.nativePath, 'b.txt');
Ti.API.info("newfile.txt deleted (expected to fail): " + newFile.deleteFile());
Ti.API.info("b.txt deleted: " + renamedFile.deleteFile());
Ti.API.info("mydir deleted: " + newDir.deleteDirectory());
Ti.API.info('directoryListing for newDir after deleteDirectory = ' + newDir.getDirectoryListing());

if (Ti.Platform.name == 'android') {
	var dir = Titanium.Filesystem.getFile(Titanium.Filesystem.externalStorageDirectory);
	Ti.API.info('external directoryListing = ' + dir.getParent().getDirectoryListing());
}

var l = Titanium.UI.createLabel({text:'Check Log for details', width:300, height:'auto', textAlign:'center'});
win.add(l);

// test to make sure we can still access compiled JS files
var jsfile = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory,'app.js');
Ti.API.info("app.js exists? " + jsfile.exists());
Ti.API.info("app.js size? " + jsfile.size);

// test to make sure that #3385 is resolved - we can append files, blobs or strings to a file
// this will go away once Streams are fully integrated into the Filesystem API.

var testfile = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'text.txt');
Ti.API.info('text.txt exists? ' + testfile.exists());
Ti.API.info('text.txt size: ' + testfile.size + ' bytes');

if(!testfile.write("text written via write()\n")) {
	Ti.API.info("could not write string to file.");
}

if(!testfile.write(Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'text_two.txt'), true)) {
	Ti.API.info("could not append File object to file via write method.");
}

if(!testfile.write("\nText appended via write()", true)) {
	Ti.API.info("could not append string to file via write method.");
}

Ti.API.info("------------");
Ti.API.info("Test file contents:\n" + (testfile.read()).text);

//these should all fail
var bad_params = [10000, true, {}];
for(var i = 0, j = bad_params.length; i < j; i++) {
	if(!testfile.write(bad_params[i])) {
		Ti.API.info('Expected failure: (first parameter is "' + (typeof bad_params[i]) + '")');
	}
}


text:
package crispy_octo_moo.consts;

/**
 * Created by yangboz on 10/14/15.
 */
public enum TaxCategories {

    EITC("EITC");

    private String _value;

    TaxCategories(final String value) {
        this._value = value;
    }

    public String getValue() {
        return _value;
    }
}


text:
package eu.qualimaster.easy.extension.internal;

import java.util.HashMap;

import net.ssehub.easy.instantiation.core.model.common.VilException;
import net.ssehub.easy.instantiation.core.model.vilTypes.Map;
import net.ssehub.easy.instantiation.core.model.vilTypes.TypeDescriptor;
import net.ssehub.easy.instantiation.rt.core.model.rtVil.types.RtVilTypeRegistry;

/**
 * Some utility methods for algorithm predictions.
 *
 * @author Holger Eichelberger
 */
public class PredictionUtils {

    /**
     * Translates a VIL map to a Java map.
     *
     * @param <K> the key type
     * @param <V> the value type
     * @param map the map to be translated (may be null)
     * @return the translated map (may be null if map is null)
     */
    static <K, V> java.util.Map<K, V> toMappedMap(Map<K, V> map) {
        java.util.Map<K, V> result;
        if (null != map) {
            result = map.toMappedMap();
        } else {
            result = null;
        }
        return result;
    }

    /**
     * Translates the Java result instance to a VIL result instance.
     *
     * @param <K> the main access key
     * @param <KV> the secondary access key to the internal map/values
     * @param <V> the value type
     * @param res the Java result instance
     * @param classK the actual class of K
     * @param classKV the actual class of KV
     * @param classV the actual class of V
     * @return the corresponding VIL result instance, always a result even if empty
     */
    static <K, KV, V> Map<K, Map<KV, V>> transferMap(java.util.Map<K, java.util.Map<KV, V>> res,
        Class<K> classK, Class<KV> classKV, Class<V> classV) {

        TypeDescriptor<?>[] predTypesInner = TypeDescriptor.createArray(2);
        predTypesInner[0] = RtVilTypeRegistry.INSTANCE.getType(classKV);
        predTypesInner[1] = RtVilTypeRegistry.INSTANCE.getType(classV);
        TypeDescriptor<?>[] predTypes = TypeDescriptor.createArray(2);
        predTypes[0] = RtVilTypeRegistry.INSTANCE.getType(classK);
        try {
            predTypes[1] = RtVilTypeRegistry.getMapType(predTypesInner);
        } catch (VilException e) {
            predTypes[1] = RtVilTypeRegistry.anyType();
        }

        java.util.Map<Object, Object> resTemp = new HashMap<Object, Object>();
        if (null != res) {
            for (java.util.Map.Entry<K, java.util.Map<KV, V>> ent : res.entrySet()) {
                K key = ent.getKey();
                java.util.Map<KV, V> inner = ent.getValue();
                java.util.Map<Object, Object> tmpInner = new HashMap<Object, Object>();
                tmpInner.putAll(inner);
                resTemp.put(key, new Map<KV, V>(tmpInner, predTypesInner));
            }
        }
        return new Map<K, Map<KV, V>>(resTemp, predTypes);
    }

}


text:
<!DOCTYPE html>

	<meta charset="utf-8">

	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>MOSAIC+</title>
	<meta name="description" content="Spirit8 is a Digital agency one page template built based on bootstrap framework. This template is design by Robert Berki and coded by Jenn Pereira. It is simple, mobile responsive, perfect for portfolio and agency websites. Get this for free exclusively at ThemeForces.com">
	<meta name="keywords" content="bootstrap theme, portfolio template, digital agency, onepage, mobile responsive, spirit8, free website, free theme, themeforces themes, themeforces wordpress themes, themeforces bootstrap theme">
	<meta name="author" content="ThemeForces.com">

<link rel="apple-touch-icon" sizes="57x57" href="img/favicon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="img/favicon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="img/favicon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="img/favicon/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="img/favicon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="img/favicon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="img/favicon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="img/favicon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="img/favicon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192"  href="img/favicon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="img/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="img/favicon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="img/favicon/favicon-16x16.png">
<link rel="manifest" href="img/favicon/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="img/favicon/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">

	<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
	<link rel="stylesheet" type="text/css" href="fonts/font-awesome/css/font-awesome.css">

	 <link href="css/owl.carousel.css" rel="stylesheet" media="screen">
	<link href="css/owl.theme.css" rel="stylesheet" media="screen">

	<link rel="stylesheet" type="text/css" href="css/style.css">
	<link rel="stylesheet" type="text/css" href="css/responsive.css">

	<link href='http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic' rel='stylesheet' type='text/css'>
	<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,700,300,600,800,400' rel='stylesheet' type='text/css'>

	<link href='onepage-scroll/onepage-scroll.css' rel='stylesheet' type='text/css'>

				<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
					Toggle navigation

				</button>

Home

About

Team

Transition Program

Mentoring Program

Connecting out there

Contact

Fostering community. Developing inclusiveness.

Mosaic+ Defined

										Mission - To create a community

Transition Program

Survival Guide

Transition Program

Photos

Something Else?

Mentoring Program

Connecting Out There

Feel free to contact us

							<form>

									Email address
									<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter email">

									Message
									<textarea class="form-control" rows="3"></textarea>

								<button type="submit" class="btn tf-btn btn-default">Submit</button>
							</form>

ALL RIGHTS RESERVED. COPYRIGHT © 2015