text:
#ifndef itkVolumeSplineKernelTransform_h
#define itkVolumeSplineKernelTransform_h

#include "itkKernelTransform.h"

namespace itk
{
/** \class VolumeSplineKernelTransform
 * This class defines the thin plate spline (TPS) transformation.
 * It is implemented in as straightforward a manner as possible from
 * the IEEE TMI paper by Davis, Khotanzad, Flamig, and Harms,
 * Vol. 16 No. 3 June 1997
 *
 * \ingroup ITKTransform
 */
template<typename TParametersValueType,
         unsigned int NDimensions=3>
// Number of dimensions
class VolumeSplineKernelTransform:
  public KernelTransform<TParametersValueType, NDimensions>
{
public:
  /** Standard class typedefs. */
  typedef VolumeSplineKernelTransform                        Self;
  typedef KernelTransform<TParametersValueType, NDimensions> Superclass;
  typedef SmartPointer<Self>                                 Pointer;
  typedef SmartPointer<const Self>                           ConstPointer;

  /** New macro for creation of through a Smart Pointer */
  itkNewMacro(Self);

  /** Run-time type information (and related methods). */
  itkTypeMacro(VolumeSplineKernelTransform, KernelTransform);

  /** Scalar type. */
  typedef typename Superclass::ScalarType ScalarType;

  /** Parameters type. */
  typedef typename Superclass::ParametersType      ParametersType;
  typedef typename Superclass::FixedParametersType FixedParametersType;

  /** Jacobian Type */
  typedef typename Superclass::JacobianType JacobianType;

  /** Dimension of the domain space. */
  itkStaticConstMacro(SpaceDimension, unsigned int,
                      Superclass::SpaceDimension);

  /** These (rather redundant) typedefs are needed because typedefs are not inherited */
  typedef typename Superclass::InputPointType            InputPointType;
  typedef typename Superclass::OutputPointType           OutputPointType;
  typedef typename Superclass::InputVectorType           InputVectorType;
  typedef typename Superclass::OutputVectorType          OutputVectorType;
  typedef typename Superclass::InputCovariantVectorType  InputCovariantVectorType;
  typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
  typedef typename Superclass::PointsIterator            PointsIterator;

protected:
  VolumeSplineKernelTransform() {}
  virtual ~VolumeSplineKernelTransform() {}

  /** These (rather redundant) typedefs are needed because on typedefs are not inherited. */
  typedef typename Superclass::GMatrixType GMatrixType;

  /** Compute G(x)
   * For the volume plate spline, this is:
   * G(x) = r(x)^3*I
   * \f$ G(x) = r(x)^3*I \f$
   * where
   * r(x) = Euclidean norm = sqrt[x1^2 + x2^2 + x3^2]
   * \f[ r(x) = \sqrt{ x_1^2 + x_2^2 + x_3^2 }  \f]
   * I = identity matrix. */
  virtual void ComputeG(const InputVectorType & landmarkVector,
                        GMatrixType & gmatrix) const ITK_OVERRIDE;

  /** Compute the contribution of the landmarks weighted by the kernel
   *  funcion to the global deformation of the space  */
  virtual void ComputeDeformationContribution(
    const InputPointType & inputPoint,
    OutputPointType & result) const ITK_OVERRIDE;

private:
  ITK_DISALLOW_COPY_AND_ASSIGN(VolumeSplineKernelTransform);
};
} // namespace itk

#ifndef ITK_MANUAL_INSTANTIATION
#include "itkVolumeSplineKernelTransform.hxx"
#endif

#endif // itkVolumeSplineKernelTransform_h


text:
#ifndef PointLightSource_h
#define PointLightSource_h

#include "platform/graphics/filters/LightSource.h"

namespace blink {

class PLATFORM_EXPORT PointLightSource : public LightSource {
public:
    static PassRefPtr<PointLightSource> create(const FloatPoint3D& position)
    {
        return adoptRef(new PointLightSource(position));
    }

    PassRefPtr<LightSource> create(const FloatPoint3D& scale, const FloatSize& offset) const override
    {
        FloatPoint3D position(m_position.x() * scale.x() - offset.width(), m_position.y() * scale.y() - offset.height(), m_position.z() * scale.z());
        return adoptRef(new PointLightSource(position));
    }

    const FloatPoint3D& position() const { return m_position; }
    bool setPosition(const FloatPoint3D&) override;

    TextStream& externalRepresentation(TextStream&) const override;

private:
    PointLightSource(const FloatPoint3D& position)
        : LightSource(LS_POINT)
        , m_position(position)
    {
    }

    FloatPoint3D m_position;
};

} // namespace blink

#endif // PointLightSource_h

redpajama_set_name: RedPajamaGithub


text:
Shareable
=========

A gem for adding social buttons to your Rails app. This gem runs with minimal configuration* and offers many options for personalizing your social buttons. You can generate javascript buttons or static links. Render buttons for popular social media sites and your own custom code with a single method call. Buttons are available for the following social networks:
  - Facebook
  - Twitter
  - Pinterest
  - Reddit
  - Linkedin
  - Google Plus
  - Tumblr**
  - StumbleUpon**

The Shareable gem supports Rails 3 and 4.

* If your app uses Rails 4 or Turbolinks, set configuration option *turbolinks* to **true** ([see Turbolinks](https://github.com/hermango/shareable#turbolinks)). ** Tumblr and StumbleUpon buttons aren't displayed by default ([see Configuration](https://github.com/hermango/shareable#configuration)).

Install
--------
Put this line in your Gemfile:

  gem 'shareable'

Then run the bundle command:

  bundle

Usage
------
### Views

For the simplest way of using this gem, add this helper method to your views:

```no-highlight
<%= render_shareable %>
```

That's it! Change the look and content of each button with more options. Keep reading to find out how.

You can also render each social button separately by calling the following methods:
+ facebook_button
+ twitter_button
+ pinterest_button
+ linkedin_button
+ reddit_button
+ google_plus_button
+ tumblr_button
+ stumble_upon_button

#### Static Links

Javascript buttons are rendered by default. To render plain html links instead, set the configuration option *static_link* to boolean **true** in your app's 'shareable.rb' configuration file ([see Configuration](https://github.com/hermango/shareable#configuration) for more information). You can also pass *static_link* to the render_shareable method like so:

```no-highlight
<%= render_shareable :static_link => true %>
```

#### Tumblr and StumbleUpon Buttons

By default, display of Tumblr and StumbleUpon buttons is disabled. Enable either button by including the name of the button you want to add (**tumblr** or **stumble_upon**) to the configuration option *names* (found in your local 'shareable.rb' configuration file).

### Advanced Usage
Pass hash values to the render_shareable method to overwrite options locally:
```no-highlight
<%= render_shareable :url=> 'http://github.com/hermango/', :facebook=> {:send=> 'true', :url=> 'http://demo.dev'} %>
```

To render only certain buttons:
```no-highlight
<%= render_shareable :buttons=> ['twitter', 'facebook', 'tumblr'] %>
```

Alternatively, omit the render_shareable method and render each button individually instead.
The helper method for each social link is the site name joined with an underscore to the word 'button'. E.g.:

```no-highlight
<%= twitter_button %>
<%= reddit_button :title=> 'Alternate Title' %>
```

#### Customizing Buttons
Overriding Shareable is possible and entirely optional. Some knowledge of [Rails layouts and rendering](http://guides.rubyonrails.org/layouts_and_rendering.html) is required. Read on to learn how you can personalize your buttons.

##### Custom HTML Wrappers

Buttons and static links are wrapped in overwritable files called partials. The look and DOM structure of your buttons can be changed by creating your own files with matching filenames and placed in your local 'views' directory. As long as the yield method is called in the following two partials, you can make whatever changes you want:
+ [_parent_wrapper.html.erb](https://github.com/hermango/shareable/blob/master/app/views/shareable/partials/_parent_wrapper.html.erb) goes in your app's 'app/views/shareable/partials/' directory. This partial is rendered once and encloses all of the buttons.
+ [_button_wrapper.html.erb](https://github.com/hermango/shareable/blob/master/app/views/shareable/partials/_button_wrapper.html.erb) goes in your app's 'app/views/shareable/partials/' directory. This partial is rendered inside _parent_wrapper.html.erb and is outputted for each button.

##### Change Static Links

The partial used for static links is named _link.html.erb. The important variable you want to include is called *options[:url]*.
+ [_link.html.erb](https://github.com/hermango/shareable/blob/master/app/views/shareable/partials/_link.html.erb) goes in your app's 'app/views/shareable/partials/' directory.

##### Change Javascript Buttons

To override the code for a javascript button, place your own template file in the
'app/views/shareable/' directory of your app and prepend that filename with an underscore and the name of the social media site. For example, to overwrite the Facebook button: Create a file called _facebook.html.erb that goes in the 'app/views/shareable/' directory.

##### A Note about Variables: button_name and button_caption
Each outputted button has two variables that identify the social network the button belongs to. These variables are named *button_name* and *button_caption* and are contained in the *options* hash. Depending on the button instance these variables are accessed within, the possible string values are:
+ options[:button_name] is one of the following: "facebook", "twitter", "pinterest", "linkedin", "google_plus", "reddit", "tumblr" or "stumble_upon".
+ options[:button_caption] is one of the following: "Facebook", "Twitter", "Pinterest", "Linkedin", "Google+", "Reddit", "Tumblr" or "StumbleUpon".

Both variables can be overridden when passed to the render_shareable method as hash values. E.g.:
```
<%= render_shareable :twitter => {:button_caption => 'Tweet this!'} %>
```

#### Styling for Buttons
For horizontally aligned buttons, try this CSS:

```no-highlight
nav.share {display:inline-block;} /* shareable's nav tag */
nav.share div {float:left;}
nav.share iframe {border:0; margin-top:0; padding-top:0;} /* if using medium sized buttons */
#___plusone_0 {font-size: default !important;}
.fb_iframe_widget span { vertical-align: top; }
.fb_edge_widget_with_comment { vertical-align: top;}
.fb-like{display:inline-block}
* html .fb-like{display:inline}/* ie6 inline block fix*/
*+html .fb-like{display:inline}/* ie7 inline block fix*/
```

If you use the default configuration options and styling above, the output should appear as:

###Turbolinks
**Important:** If your project uses Rails 4 then it's very likely you should set the *turbolinks* option to **true**. Otherwise social buttons won't appear on pages loaded via Turbolinks (Turbolinks is default in Rails 4 unless explicitly disabled).

This gem works with Turbolinks however the javascript library [jQuery](https://github.com/rails/jquery-rails) is required. Turbolinks support in Shareable is turned off by default. To enable Turbolinks support, first make sure your app includes jQuery then set configuration option *turbolinks* in your local 'shareable.rb' [configuration](https://github.com/hermango/shareable/blob/master/README.md#configuration) file to boolean **true**. The *turbolinks* option can also be passed as a hash value to the render_shareable method like this:

```
<%= render_shareable :turbolinks => true, :facebook => {:turbolinks => false} %>
```
If your app doesn't use jQuery or you don't want to use the provided solution but still want to use this gem, here are some other options:

 1. Use [static links](https://github.com/hermango/shareable#static-links) instead.
 2. Roll your own solution: Set configuration option *button_only* to boolean **true**. This will output button tags without javascript. Then you can add your own javascript solution. See [Nick Reed's tutorials](http://reed.github.io/turbolinks-compatibility/) to check out some approaches.
 3. Disable Turbolinks. To disable Turbolinks from your app: Remove the line "//= require turbolinks" from your app's application.js. Or to disable Turbolinks for only some cases, use the data marker *data-no-turbolink* in links and html elements [(instructions here)](https://github.com/rails/turbolinks#opting-out-of-turbolinks).

Configuration
------------
This gem comes pre-configured and ready to use. You can use the [default configuration settings](https://github.com/hermango/shareable/blob/master/lib/shareable/config.rb) or customize your buttons by adding and editing your own initializer named 'shareable.rb' to your app's 'config/initializers' directory.

A generator is available for generating an editable configuration file. Run the following command, then edit the file as preferred.

rails g shareable:config

String values are expected for nearly all configuration options. Any value passed to a configuration option not enclosed in quotation marks will cause errors! Four configuration options are exceptions to this rule. The configuration option *names* (also called *buttons* when passed as a hash value to the render_shareable method) expects an array of strings ([see it in the configuration file](https://github.com/hermango/shareable/blob/master/lib/shareable/config.rb)). The other three configuration options listed below expect boolean values only:
 * static_link - **false** by default. See [Static Links](https://github.com/hermango/shareable#static-links).
 * button_only - **false** by default. If set to **true**, javascript code for buttons is omitted.
 * turbolinks - **false** by default. When set to **true**, javascript buttons will work with Turbolinks. Relies on jQuery. See [Turbolinks](https://github.com/hermango/shareable#turbolinks).

---

This project was inspired by [Akira Matsuda's](https://github.com/amatsuda) [Kaminari gem](https://github.com/amatsuda/kaminari) and uses the MIT-LICENSE. Suggestions, bug reports, criticism and all contributions welcome.


text:
<?php

declare(strict_types=1);

/*
 * This file is part of SolidInvoice project.
 *
 * (c) Pierre du Plessis <open-source@solidworx.co>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace SolidInvoice\ClientBundle\Entity;

use ApiPlatform\Core\Annotation\ApiProperty;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Core\Annotation\ApiSubresource;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Money\Currency;
use SolidInvoice\CoreBundle\Traits\Entity\Archivable;
use SolidInvoice\CoreBundle\Traits\Entity\TimeStampable;
use SolidInvoice\InvoiceBundle\Entity\Invoice;
use SolidInvoice\InvoiceBundle\Entity\RecurringInvoice;
use SolidInvoice\PaymentBundle\Entity\Payment;
use SolidInvoice\QuoteBundle\Entity\Quote;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Serializer\Annotation as Serialize;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ApiResource(attributes={"normalization_context"={"groups"={"client_api"}}, "denormalization_context"={"groups"={"client_api"}}}, iri="https://schema.org/Corporation")
 * @ORM\Table(name="clients")
 * @ORM\Entity(repositoryClass="SolidInvoice\ClientBundle\Repository\ClientRepository")
 * @ORM\HasLifecycleCallbacks()
 * @UniqueEntity("name")
 * @Gedmo\Loggable
 */
class Client
{
    use Archivable;
    use TimeStampable;

    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     * @Serialize\Groups({"client_api"})
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=125, nullable=false, unique=true)
     * @Assert\NotBlank()
     * @Assert\Length(max=125)
     * @Serialize\Groups({"client_api"})
     * @ApiProperty(iri="http://schema.org/name")
     */
    private $name;

    /**
     * @var string
     *
     * @ORM\Column(name="website", type="string", length=125, nullable=true)
     * @Assert\Url()
     * @Assert\Length(max=125)
     * @Serialize\Groups({"client_api"})
     * @ApiProperty(iri="https://schema.org/URL")
     */
    private $website;

    /**
     * @var string
     *
     * @ORM\Column(name="status", type="string", length=25)
     * @Serialize\Groups({"client_api"})
     * @ApiProperty(iri="http://schema.org/Text")
     */
    private $status;

    /**
     * @var string
     *
     * @ORM\Column(name="currency", type="string", length=3, nullable=true)
     * @Serialize\Groups({"client_api"})
     * @ApiProperty(iri="http://schema.org/Text")
     */
    private $currency;

    /**
     * @var string
     *
     * @ORM\Column(name="vat_number", type="string", nullable=true)
     * @Serialize\Groups({"client_api"})
     */
    private $vatNumber;

    /**
     * @var Contact[]|Collection<int, Contact>
     *
     * @ORM\OneToMany(targetEntity="Contact", mappedBy="client", fetch="EXTRA_LAZY", cascade={"persist", "remove"}, orphanRemoval=true)
     * @ORM\OrderBy({"firstName" = "ASC"})
     * @Assert\Count(min=1, minMessage="You need to add at least one contact to this client")
     * @Assert\Valid()
     * @Serialize\Groups({"client_api"})
     * @ApiProperty(iri="http://schema.org/Person")
     */
    private $contacts;

    /**
     * @var Quote[]|Collection<int, Quote>
     *
     * @ORM\OneToMany(targetEntity="SolidInvoice\QuoteBundle\Entity\Quote", mappedBy="client", fetch="EXTRA_LAZY", cascade={"remove"}, orphanRemoval=true)
     * @ORM\OrderBy({"created" = "DESC"})
     * @ApiSubresource
     */
    private $quotes;

    /**
     * @var Invoice[]|Collection<int, Invoice>
     *
     * @ORM\OneToMany(targetEntity="SolidInvoice\InvoiceBundle\Entity\Invoice", mappedBy="client", fetch="EXTRA_LAZY", cascade={"remove"}, orphanRemoval=true)
     * @ORM\OrderBy({"created" = "DESC"})
     * @ApiSubresource
     */
    private $invoices;

    /**
     * @var RecurringInvoice[]|Collection<int, RecurringInvoice>
     *
     * @ORM\OneToMany(targetEntity="SolidInvoice\InvoiceBundle\Entity\RecurringInvoice", mappedBy="client", fetch="EXTRA_LAZY", cascade={"remove"}, orphanRemoval=true)
     * @ORM\OrderBy({"created" = "DESC"})
     * @ApiSubresource
     */
    private $recurringInvoices;

    /**
     * @var Payment[]|Collection<int, Payment>
     *
     * @ORM\OneToMany(targetEntity="SolidInvoice\PaymentBundle\Entity\Payment", mappedBy="client", cascade={"persist", "remove"}, orphanRemoval=true)
     * @ApiSubresource
     */
    private $payments;

    /**
     * @var Address[]|Collection<int, Address>
     *
     * @ORM\OneToMany(targetEntity="SolidInvoice\ClientBundle\Entity\Address", mappedBy="client", cascade={"persist", "remove"}, orphanRemoval=true)
     * @Serialize\Groups({"client_api"})
     */
    private $addresses;

    /**
     * @var Credit
     *
     * @ORM\OneToOne(targetEntity="SolidInvoice\ClientBundle\Entity\Credit", mappedBy="client", fetch="EXTRA_LAZY", cascade={"persist", "remove"}, orphanRemoval=true)
     * @Serialize\Groups({"client_api"})
     * @ApiProperty(iri="http://schema.org/MonetaryAmount")
     */
    private $credit;

    public function __construct()
    {
        $this->contacts = new ArrayCollection();
        $this->quotes = new ArrayCollection();
        $this->invoices = new ArrayCollection();
        $this->recurringInvoices = new ArrayCollection();
        $this->payments = new ArrayCollection();
        $this->addresses = new ArrayCollection();
    }

    /**
     * Get id.
     *
     * @return int
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * Get name.
     *
     * @return string
     */
    public function getName(): ?string
    {
        return $this->name;
    }

    /**
     * Set name.
     *
     * @return Client
     */
    public function setName(string $name): self
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get status.
     *
     * @return string
     */
    public function getStatus(): ?string
    {
        return $this->status;
    }

    /**
     * Set status.
     *
     * @return Client
     */
    public function setStatus(string $status): self
    {
        $this->status = $status;

        return $this;
    }

    /**
     * Get website.
     *
     * @return string
     */
    public function getWebsite(): ?string
    {
        return $this->website;
    }

    /**
     * Set website.
     *
     * @return Client
     */
    public function setWebsite(string $website): self
    {
        $this->website = $website;

        return $this;
    }

    /**
     * Add contact.
     *
     * @return Client
     */
    public function addContact(Contact $contact): self
    {
        $this->contacts[] = $contact;
        $contact->setClient($this);

        return $this;
    }

    /**
     * Removes a contact.
     *
     * @return Client
     */
    public function removeContact(Contact $contact): self
    {
        $this->contacts->removeElement($contact);

        return $this;
    }

    /**
     * Get contacts.
     *
     * @return Collection|Contact[]
     */
    public function getContacts(): Collection
    {
        return $this->contacts;
    }

    /**
     * Add quote.
     *
     * @return Client
     */
    public function addQuote(Quote $quote): self
    {
        $this->quotes[] = $quote;
        $quote->setClient($this);

        return $this;
    }

    /**
     * Remove quote.
     *
     * @return Client
     */
    public function removeQuote(Quote $quote): self
    {
        $this->quotes->removeElement($quote);

        return $this;
    }

    /**
     * Get quotes.
     *
     * @return Quote[]|Collection<int, Quote>
     */
    public function getQuotes(): Collection
    {
        return $this->quotes;
    }

    /**
     * Add invoice.
     *
     * @return Client
     */
    public function addInvoice(Invoice $invoice): self
    {
        $this->invoices[] = $invoice;
        $invoice->setClient($this);

        return $this;
    }

    /**
     * Remove invoice.
     *
     * @return Client
     */
    public function removeInvoice(Invoice $invoice): self
    {
        $this->invoices->removeElement($invoice);

        return $this;
    }

    /**
     * Get invoices.
     *
     * @return Invoice[]|Collection<int, Invoice>
     */
    public function getInvoices(): Collection
    {
        return $this->invoices;
    }

    /**
     * @return Client
     */
    public function addRecurringInvoice(RecurringInvoice $invoice): self
    {
        $this->recurringInvoices[] = $invoice;
        $invoice->setClient($this);

        return $this;
    }

    /**
     * @return Client
     */
    public function removeRecurringInvoice(RecurringInvoice $invoice): self
    {
        $this->recurringInvoices->removeElement($invoice);

        return $this;
    }

    /**
     * @return RecurringInvoice[]|Collection<int, RecurringInvoice>
     */
    public function getRecurringInvoices(): Collection
    {
        return $this->recurringInvoices;
    }

    /**
     * Add payment.
     *
     * @return Client
     */
    public function addPayment(Payment $payment): self
    {
        $this->payments[] = $payment;
        $payment->setClient($this);

        return $this;
    }

    /**
     * Removes a payment.
     *
     * @return Client
     */
    public function removePayment(Payment $payment): self
    {
        $this->payments->removeElement($payment);

        return $this;
    }

    /**
     * Get payments.
     *
     * @return Payment[]|Collection<int, Payment>
     */
    public function getPayments(): Collection
    {
        return $this->payments;
    }

    /**
     * @return Client
     */
    public function addAddress(?Address $address): self
    {
        if (null !== $address) {
            $this->addresses[] = $address;
            $address->setClient($this);
        }

        return $this;
    }

    /**
     * Removes an address.
     *
     * @return Client
     */
    public function removeAddress(Address $address): self
    {
        $this->addresses->removeElement($address);

        return $this;
    }

    /**
     * Get addresses.
     *
     * @return Address[]|Collection<int, Address>
     */
    public function getAddresses(): Collection
    {
        return $this->addresses;
    }

    /**
     * @return Credit
     */
    public function getCredit(): ?Credit
    {
        return $this->credit;
    }

    /**
     * @return Client
     */
    public function setCredit(Credit $credit): self
    {
        $this->credit = $credit;

        return $this;
    }

    /**
     * @ORM\PrePersist()
     * @ApiProperty(iri="http://schema.org/MonetaryAmount")
     */
    public function setInitialCredit(): void
    {
        if (null === $this->id) {
            $credit = new Credit();
            $credit->setClient($this);
            $this->setCredit($credit);
        }
    }

    /**
     * Return the client name as a string.
     */
    public function __toString(): string
    {
        return $this->name;
    }

    public function getCurrency(): ?Currency
    {
        return null !== $this->currency ? new Currency($this->currency) : null;
    }

    /**
     * @return Client
     */
    public function setCurrency(?string $currency): self
    {
        $this->currency = $currency;

        return $this;
    }

    /**
     * @return string
     */
    public function getVatNumber(): ?string
    {
        return $this->vatNumber;
    }

    /**
     * @return $this
     */
    public function setVatNumber(?string $vatNumber): self
    {
        $this->vatNumber = $vatNumber;

        return $this;
    }
}


text:
**WARNING:** This repository comes with no documentation, no rationale, and no future.

This is the automatic summarizer from my undergraduate project, which
I have updated to work with the [NLP library](https://github.com/t6/snippets) I developed for my bachelor
report.

[<img width="100%" src="https://raw.githubusercontent.com/t6/itac-summary/master/screenshot.png">](https://raw.githubusercontent.com/t6/itac-summary/master/screenshot.png)

Article shown in the screenshot is ['Child asthma drop since smoke ban'](http://www.bbc.co.uk/newsround/21116719)
from the CBBC (checked 28.02.2015).

Icons from the [Tango Desktop Project](http://tango.freedesktop.org/).

## Running the summarizer

1. Install [Leiningen](https://github.com/technomancy/leiningen/)
2. Use `lein run` to start the summarizer UI
3. Select an article under the 'Online articles' tab and click the
   play button in the toolbar. Summarizing will take some time,
   especially the first text.

## Approach

*Never to be added...*

## License

Copyright (c) 2013-2015 Tobias Kortkamp

Distributed under the MIT License.


text:
package happynewmoonwithreport.opcode.comparison.F32;

import happynewmoonwithreport.WasmInstanceInterface;
import happynewmoonwithreport.WasmRuntimeException;
import happynewmoonwithreport.WasmStack;
import happynewmoonwithreport.type.F32;
import happynewmoonwithreport.type.I32;
import java.util.UUID;

/**
 * F32 not equal to (f32_ne)
 *

 * Note this is the same for all Relative Operations
 *

 * t.relop
 *

 *

 * Assert: due to validation, two values of value type t are on the top of the stack.
 *

 *

 * Pop the value t.const c2 from the stack.
 *

 *

 * Pop the value t.const c1 from the stack.
 *

 *

 * Let c be the result of computing relopt(c1,c2).
 *

 *

 * Push the value f32.const c to the stack.
 *

 *

 *

 * Source:
 *
 * https://webassembly.github.io/spec/core/exec/instructions.html#exec-relop
 *
 */
public class F32_ne {
	private WasmInstanceInterface instance;

	private F32_ne() {
		super();
	}

	public F32_ne(WasmInstanceInterface instance) {
		this();
		this.instance = instance;
	}

	/**
	 * Execute the opcode.
	 */
	public void execute() {
		WasmStack<Object> stack = instance.stack();

		// 1. Assert: due to validation, two values of value type t are on the top of the stack.
		if ((stack.peek() instanceof F32) == false) {
			throw new WasmRuntimeException(UUID.fromString("ebe2ffe2-97fa-4fe2-a73c-1d9c2a6d3bf2"),
				"f32_ne: Value2 type is incorrect");
		}
		// 2. Pop the value t.const c2 from the stack.
		F32 value2 = (F32) stack.pop();

		// 1. Assert: due to validation, two values of value type t are on the top of the stack.
		if ((stack.peek() instanceof F32) == false) {
			throw new WasmRuntimeException(UUID.fromString("12a49c3e-30d5-4487-ac40-c3f1c6780612"),
				"f32_ne: Value1 type is incorrect");
		}
		// 3. Pop the value t.const c1 from the stack.
		F32 value1 = (F32) stack.pop();

		// 4. Let c be the result of computing relopt(c1,c2).
		I32 cTemp = value1.equalsWasm(value2);
		// negate the result.
		I32 c;
		if (cTemp.booleanValue() == true) {
			c = new I32(0);
		} else {
			c = new I32(1);
		}

		// 5. Push the value f32.const c to the stack.
		stack.push(c);
	}

}


text:
package org.locationtech.geomesa.accumulo.util

import org.junit.runner.RunWith
import org.locationtech.geomesa.index.conf.DigitSplitter
import org.opengis.feature.simple.SimpleFeatureType
import org.specs2.mutable.Specification
import org.specs2.runner.JUnitRunner

import scala.collection.JavaConversions._

@RunWith(classOf[JUnitRunner])
class AccumuloSftBuilderTest extends Specification {

  sequential

  "SpecBuilder" >> {
    "configure table splitters as strings" >> {
      val sft1 = new AccumuloSftBuilder()
        .intType("i")
        .longType("l")
        .recordSplitter(classOf[DigitSplitter].getName, Map("fmt" ->"%02d", "min" -> "0", "max" -> "99"))
        .build("test")

      // better - uses class directly (or at least less annoying)
      val sft2 = new AccumuloSftBuilder()
        .recordSplitter(classOf[DigitSplitter], Map("fmt" ->"%02d", "min" -> "0", "max" -> "99"))
        .intType("i")
        .longType("l")
        .build("test")

      def test(sft: SimpleFeatureType) = {
        import org.locationtech.geomesa.utils.geotools.RichSimpleFeatureType.RichSimpleFeatureType

        sft.getAttributeCount mustEqual 2
        sft.getAttributeDescriptors.map(_.getLocalName) must containAllOf(List("i", "l"))

        sft.getTableSplitter must beSome(classOf[DigitSplitter])
        val opts = sft.getTableSplitterOptions
        opts.size must be equalTo 3
        opts("fmt") must be equalTo "%02d"
        opts("min") must be equalTo "0"
        opts("max") must be equalTo "99"
      }

      List(sft1, sft2) forall test
    }
  }
}


text:
using FlightNode.DataCollection.Domain.Entities;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace FlightNode.DataCollection.Domain.Interfaces.Persistence
{
    public interface IEnumRepository
    {
        Task<IReadOnlyCollection<Weather>> GetWeather();
        Task<IReadOnlyCollection<WaterHeight>> GetWaterHeights();
        Task<IReadOnlyCollection<DisturbanceType>> GetDisturbanceTypes();
        Task<IReadOnlyCollection<HabitatType>> GetHabitatTypes();
        Task<IReadOnlyCollection<FeedingSuccessRate>> GetFeedingSuccessRates();
        Task<IReadOnlyCollection<SurveyActivity>> GetSurveyActivities();
        Task<IReadOnlyCollection<SiteAssessment>> GetSiteAssessments();
        Task<IReadOnlyCollection<VantagePoint>> GetVantagePoints();
        Task<IReadOnlyCollection<AccessPoint>> GetAccessPoints();
        Task<IReadOnlyCollection<WindSpeed>> GetWindSpeeds();
        Task<IReadOnlyCollection<WindDirection>> GetWindDirections();
    }
}


text:
/* ** GENEREATED FILE - DO NOT MODIFY ** */
package com.wilutions.mslib.office;
import com.wilutions.com.*;

/**
 * MsoWizardMsgType.
 *
 */
@SuppressWarnings("all")
@CoInterface(guid="{00000000-0000-0000-0000-000000000000}")
public class MsoWizardMsgType implements ComEnum {
  static boolean __typelib__loaded = __TypeLib.load();

  // Typed constants
  public final static MsoWizardMsgType msoWizardMsgLocalStateOn = new MsoWizardMsgType(1);
  public final static MsoWizardMsgType msoWizardMsgLocalStateOff = new MsoWizardMsgType(2);
  public final static MsoWizardMsgType msoWizardMsgShowHelp = new MsoWizardMsgType(3);
  public final static MsoWizardMsgType msoWizardMsgSuspending = new MsoWizardMsgType(4);
  public final static MsoWizardMsgType msoWizardMsgResuming = new MsoWizardMsgType(5);

  // Integer constants for bitsets and switch statements
  public final static int _msoWizardMsgLocalStateOn = 1;
  public final static int _msoWizardMsgLocalStateOff = 2;
  public final static int _msoWizardMsgShowHelp = 3;
  public final static int _msoWizardMsgSuspending = 4;
  public final static int _msoWizardMsgResuming = 5;

  // Value, readonly field.
  public final int value;

  // Private constructor, use valueOf to create an instance.
  private MsoWizardMsgType(int value) { this.value = value; }

  // Return one of the predefined typed constants for the given value or create a new object.
  public static  MsoWizardMsgType valueOf(int value) {
    switch(value) {
    case 1: return msoWizardMsgLocalStateOn;
    case 2: return msoWizardMsgLocalStateOff;
    case 3: return msoWizardMsgShowHelp;
    case 4: return msoWizardMsgSuspending;
    case 5: return msoWizardMsgResuming;
    default: return new MsoWizardMsgType(value);
    }
  }

  public String toString() {
    switch(value) {
    case 1: return "msoWizardMsgLocalStateOn";
    case 2: return "msoWizardMsgLocalStateOff";
    case 3: return "msoWizardMsgShowHelp";
    case 4: return "msoWizardMsgSuspending";
    case 5: return "msoWizardMsgResuming";
    default: {
      StringBuilder sbuf = new StringBuilder();
      sbuf.append("[").append(value).append("=");
      if ((value & 1) != 0) sbuf.append("|msoWizardMsgLocalStateOn");
      if ((value & 2) != 0) sbuf.append("|msoWizardMsgLocalStateOff");
      if ((value & 3) != 0) sbuf.append("|msoWizardMsgShowHelp");
      if ((value & 4) != 0) sbuf.append("|msoWizardMsgSuspending");
      if ((value & 5) != 0) sbuf.append("|msoWizardMsgResuming");
      return sbuf.toString();
      }
    }
  }
}


text:
package io.cloudslang.content.maps.actions;

import com.hp.oo.sdk.content.annotations.Action;
import com.hp.oo.sdk.content.annotations.Output;
import com.hp.oo.sdk.content.annotations.Param;
import com.hp.oo.sdk.content.annotations.Response;
import com.hp.oo.sdk.content.plugin.ActionMetadata.MatchType;
import io.cloudslang.content.constants.ReturnCodes;
import io.cloudslang.content.maps.constants.InputNames;
import io.cloudslang.content.maps.entities.MergeMapsInput;
import io.cloudslang.content.maps.services.MergeMapsService;
import io.cloudslang.content.utils.OutputUtilities;

import java.util.Map;

public class MergeMapsAction {

    private final MergeMapsService service = new MergeMapsService();

    /**
     * Merges 2 maps into one map.
     *
     * The maps can have different structures, but the resulted map will keep the map1's structure.
     * If a key exists in both maps, the result map will contain it only once, with the value found in map2.
     *
     * Examples:
     * map1=|A|1||B|2|, map1_pair_delimiter=|, map1_entry_delimiter=||, map1_start=|, map1_end=|
     * map2={'A':'1','B':'5','C':'6'}, map2_pair_delimiter=':', map2_entry_delimiter=',', map2_start={', map2_end='}
     * return_result = |A|1||B|5||C|6|
     *
     * @param map1               Optional - The first map to merge.
     *                           Example: {a:1,b:2,c:3,d:4}, Apples=3;Oranges=2
     * @param map1PairDelimiter  Optional - The separator to use for splitting first map's key-value pairs into key, respectively value.
     *                           Default value: ':'.
     *                           Valid values: Any value that does not contain or is equal to map1_entry_delimiter.
     * @param map1EntryDelimiter Optional - The separator to use for splitting the first map into entries.
     *                           Default value: ','.
     *                           Valid values: Any value.
     * @param map1Start          Optional - A sequence of 0 or more characters that marks the beginning of the first  map.
     *                           Default value: {'.
     *                           Valid values: Any value.
     * @param map1End            Optional - A sequence of 0 or more characters that marks the end of the first map.
     *                           Default value: '}.
     *                           Valid values: Any value.
     * @param map1ElementWrapper Optional - A sequence of 0 or more characters that marks the beginning and the end of a key or value of map1.
     *                           Valid values: Any value that does not have common characters with pair_delimiter or entry_delimiter.
     * @param map2               Optional - The second map to merge.
     *                           Example: {a:1,b:2,c:3,d:4}, Apples=3;Oranges=2
     * @param map2PairDelimiter  Optional - The separator to use for splitting second map's key-value pairs into key, respectively value.
     *                           Default value: ':'.
     *                           Valid values: Any value that does not contain or is equal to map2_entry_delimiter.
     * @param map2EntryDelimiter Optional - The separator to use for splitting the second map into entries.
     *                           Default value: ','.
     *                           Valid values: Any value.
     * @param map2Start          Optional - A sequence of 0 or more characters that marks the beginning of the second map.
     *                           Default value: {'.
     *                           Valid values: Any value.
     * @param map2End            Optional - A sequence of 0 or more characters that marks the end of the second map.
     *                           Default value: '}.
     *                           Valid values: Any value.
     * @param map2ElementWrapper Optional - A sequence of 0 or more characters that marks the beginning and the end of a key or value of map2.
     *                           Valid values: Any value that does not have common characters with pair_delimiter or entry_delimiter.
     * @param stripWhitespaces   Optional - True if leading and trailing whitespaces should be removed from the keys and values of the map.
     *                           Default: false.
     *                           Valid values: true, false.
     * @param handleEmptyValue   Optional - If the value is empty and this input is true it will fill the value with NULL.
     *                           Default value: false.
     *                           Valid values: true, false.
     * @return a map with following entries:
     * return_result: The map resulted from the merge of map1 and map2. Otherwise, it will contain the message of the exception.
     * return_code: 0 if operation succeeded, -1 otherwise.
     * exception: The exception's stack trace if operation failed. Empty otherwise.
     */
    @Action(name = "Merge maps",
            outputs = {
                    @Output(io.cloudslang.content.constants.OutputNames.RETURN_RESULT),
                    @Output(io.cloudslang.content.constants.OutputNames.RETURN_CODE),
                    @Output(io.cloudslang.content.constants.OutputNames.EXCEPTION)

            },
            responses = {
                    @Response(text = io.cloudslang.content.constants.ResponseNames.SUCCESS,
                            field = io.cloudslang.content.constants.OutputNames.RETURN_CODE,
                            value = ReturnCodes.SUCCESS,
                            matchType = MatchType.COMPARE_EQUAL),
                    @Response(text = io.cloudslang.content.constants.ResponseNames.FAILURE,
                            field = io.cloudslang.content.constants.OutputNames.RETURN_CODE,
                            value = ReturnCodes.FAILURE,
                            matchType = MatchType.COMPARE_EQUAL,
                            isOnFail = true, isDefault = true)
            })
    public Map<String, String> execute(@Param(value = InputNames.MAP1) String map1,
                                       @Param(value = InputNames.MAP1_PAIR_DELIMITER, required = true) String map1PairDelimiter,
                                       @Param(value = InputNames.MAP1_ENTRY_DELIMITER, required = true) String map1EntryDelimiter,
                                       @Param(value = InputNames.MAP1_START) String map1Start,
                                       @Param(value = InputNames.MAP1_END) String map1End,
                                       @Param(value = InputNames.MAP1_ELEMENT_WRAPPER) String map1ElementWrapper,
                                       @Param(value = InputNames.MAP2) String map2,
                                       @Param(value = InputNames.MAP2_PAIR_DELIMITER, required = true) String map2PairDelimiter,
                                       @Param(value = InputNames.MAP2_ENTRY_DELIMITER, required = true) String map2EntryDelimiter,
                                       @Param(value = InputNames.MAP2_START) String map2Start,
                                       @Param(value = InputNames.MAP2_END) String map2End,
                                       @Param(value = InputNames.MAP2_ELEMENT_WRAPPER) String map2ElementWrapper,
                                       @Param(value = InputNames.STRIP_WHITESPACES) String stripWhitespaces,
                                       @Param(value = InputNames.HANDLE_EMPTY_VALUE) String handleEmptyValue
    ) {

        try {
            MergeMapsInput input = new MergeMapsInput.Builder()
                    .map1(map1)
                    .map1PairDelimiter(map1PairDelimiter)
                    .map1EntryDelimiter(map1EntryDelimiter)
                    .map1Start(map1Start)
                    .map1End(map1End)
                    .map1ElementWrapper(map1ElementWrapper)
                    .map2(map2)
                    .map2PairDelimiter(map2PairDelimiter)
                    .map2EntryDelimiter(map2EntryDelimiter)
                    .map2Start(map2Start)
                    .map2End(map2End)
                    .map2ElementWrapper(map2ElementWrapper)
                    .stripWhitespaces(stripWhitespaces)
                    .handleEmptyValue(handleEmptyValue)
                    .build();
            return service.execute(input);
        } catch (Exception ex) {
            return OutputUtilities.getFailureResultsMap(ex);
        }
    }
}


text:
package pers.hal42.ext;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * Created by andyh on 4/3/17.
 * <p>
 * an attempt to mimic c++ 'decrement on going out of scope via "try with resources"
 * usage: try (Countedlock thistoo= thiscounter.push())
 */
public class CountedLock implements AutoCloseable {
  public java.util.concurrent.atomic.AtomicInteger counter = new AtomicInteger(0);

  @Override
  public void close() {
    counter.decrementAndGet();
  }

  /**
   * use this in a try-with-resources try clause, you may assign it to an AutoCloseable if you don't need the value in the try body.
   */
  public CountedLock open() {
    counter.incrementAndGet();
    return this;
  }

  public int asInt() {
    return counter.get();
  }

  public void setto(int i) {
    counter.set(i);
  }
}


text:
package com.xiaoguang.xtaobao.application;

import android.app.Application;
import android.content.Context;

import com.xiaoguang.xtaobao.bean.User;
import com.xiaoguang.xtaobao.config.Contracts;

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

import c.b.BP;
import cn.bmob.sms.BmobSMS;
import cn.bmob.v3.Bmob;

/**
 * 自定义的全部的Applcation类
 * Created by 11655 on 2016/10/18.
 */

public class CustomApplcation extends Application {

    //一个标记
    public static String TAG;
    //当前的用户
    private static User currentUser;

    /**
     * 维护一个全局的context对象
     */
    public Context context;
    //用于存放数据
    private static Map<String,Object> datas = new HashMap<String, Object>();
    private static CustomApplcation customApplcation = null;

    public static CustomApplcation getInstance() {
        return customApplcation;
    }

    public void setCurrentUser(User currentUser) {
        this.currentUser = currentUser;
    }

    /**
     * 获取当前的用户对象
     *
     * @return
     */
    public User getCurrentUser() {
        User user = currentUser;
        if (user != null) {
            return user;
        }
        return null;
    }

    public static Object getDatas(String key, boolean delFlag) {
        if (delFlag) {
            return datas.remove(key);
        }
        return datas.get(key);
    }

    public static Object putDatas(String key, Object value) {
        return datas.put(key, value);
    }
    @Override
    public void onCreate() {
        super.onCreate();
        TAG = this.getClass().getSimpleName();
        //由于Application类本身已经单例,所以直接按以下处理即可。
        customApplcation = this;
        context = getApplicationContext();
        context = getApplicationContext();
        //初始化BMob 短信服务SDK
        BmobSMS.initialize(context, Contracts.BMOB_APP_KEY);
        //初始化BMob 数据SDK
        Bmob.initialize(this,Contracts.BMOB_APP_KEY);
        //初始化Bmob 支付SDK
        BP.init(context,Contracts.BMOB_APP_KEY);
        //Bmob自动更新
//        BmobUpdateAgent.initAppVersion();
    }
}


text:
package com.somedamnmusic.database;

public class UnexplainableDatabaseServiceException extends Exception {

	public UnexplainableDatabaseServiceException(Exception e) {
		super(e);
	}

	public UnexplainableDatabaseServiceException() {
		super();
	}

	/**
	 *
	 */
	private static final long serialVersionUID = 3594557192204090146L;

}


text:
define([
	'jquery',
	'underscore'
], function($, _){
	/*
	 * Return the width types we're using and their minimum widths
	 */

	var getWindowWidth = function() {
		return $(window).width();
	};

	var getWidthTypes = function() {
		// these must be in ascending order of minimum browser width
		return {
			'mobile': 0,
			'tabletPortrait': 768,
			'tabletLandscape': 992,
			'desktop': 1200
		};
	};

	var getWidthType = function() {
		var type;
		var width = $('#responsive-width-aid').width();

		$.each(getWidthTypes(), function(key) {
			var w = parseInt(this);
			if (w > width) { // looking at a width type whose minimum is wider than current browser size
				return false; // break
			}
			type = key;
		});
		return type;
	};

	return {
		getWidthTypes: getWidthTypes,
		getWidthType: getWidthType,
		getWindowWidth: getWindowWidth
	};
});


text:
<?php
    require_once('config/Config.php');
    require_once 'lib/MobileDetect/Mobile_Detect.php';

    /**
     * Class Gallery
     */
    class Gallery {

        /**
         * @var
         */
        private $sRootFolder;

        /**
         * @var string
         */
        private $sFolder;

        /**
         * Gallery constructor.
         */
        public function __construct(){
            $this->sFolder = 'img/backgrounds';
        }

        /**
         * @param $iPageIndex
         * @param $aFiles
         * @return mixed
         */
        private function CreateGalleryPages($iPageIndex, $aFiles){
            foreach($aFiles as $sFolder =>  $aContent){
                if($iPageIndex == 1){
                    //print active page begin
                    echo '
';
                }else{
                    //print regular page begin
                    echo '
';
                }

                //print begin of new row
                echo '
';
                foreach($aContent as $sKey => $aFiles){
                    foreach($aFiles as $sKey => $sFile){

                        if (is_array($sFile)) continue;
                        $aImageInfo = explode(";", $sFile);

                        $sImagePack = $aImageInfo[1];
                        $sImageTitle = pathinfo($aImageInfo[0])['filename'];

                        //print new image
                        echo '
';
                            if($sImagePack != "z_default"){
                                echo '
'. $sImagePack .'
';
                            }

                            echo '
';
                                echo '
';
                                    echo 'sFolder . '/' . $sImagePack . '/' . $aImageInfo[0] .'">';
                                    echo '
' . $sImageTitle . '
';
                                echo '
';
                            echo '
';
                        echo '
';
                    }
                }

                echo '

';

                $iPageIndex++;
            }

            return $iPageIndex;
        }

        /**
         *
         */
        public function CreateGallery(){
            chdir($this->sFolder);
            $this->sRootFolder = getcwd();

            //$aFolderContent = scandir($this->sRootFolder);

            $this->GetImagePackFolder();

            chdir("../../");
        }

        /**
         *
         */
        private function GetImagePackFolder(){
            $iPageIndex = 1;
            $aFilter = array();

            $aFolders = scandir(getcwd());
            foreach ($aFolders as $sFolder){
                if($sFolder != "." && $sFolder != "..") {
                    $aFolderContent = scandir(getcwd() . '/' . $sFolder . '/');
                    //print_r($aFolderContent);
                    for ($i = 0; $i < count($aFolderContent); $i++) {
                        if ($aFolderContent[$i] != "." && $aFolderContent[$i] != ".." && $aFolderContent[$i] != $sFolder) {
                            $aFilter[] = $aFolderContent[$i] . ';' . $sFolder;
                        }
                    }
                }
            }

            $aFilter = array_chunk(array_chunk($aFilter, 3), 3);
            $this->CreateGalleryPages($iPageIndex, $aFilter);
        }
    }
?>


text:
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System.Diagnostics;
using System.IO;
using System.Reflection;
using Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;

namespace ExtensionsMetadataGenerator.BuildTasks
{
#if NET46
    public class GenerateFunctionsExtensionsMetadata : AppDomainIsolatedTask
#else
    public class GenerateFunctionsExtensionsMetadata : Task
#endif
    {
        [Required]
        public string SourcePath { get; set; }

        [Required]
        public string OutputPath { get; set; }

        public override bool Execute()
        {
            string outputPath = Path.Combine(OutputPath, "extensions.json");

            if (SourcePath.EndsWith("\\"))
            {
                SourcePath = Path.GetDirectoryName(SourcePath);
            }

            Assembly taskAssembly = typeof(GenerateFunctionsExtensionsMetadata).Assembly;

            var info = new ProcessStartInfo
            {
                UseShellExecute = false,
                CreateNoWindow = false,
                RedirectStandardError = true,
                RedirectStandardOutput = true,
                WorkingDirectory = Path.Combine(Path.GetDirectoryName(taskAssembly.Location), "..", "netstandard2.0", "generator"),
                FileName = DotNetMuxer.MuxerPathOrDefault(),
                Arguments = $"Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.Console.dll \"{SourcePath}\" \"{outputPath}\""
            };

            var process = new Process { StartInfo = info };
            process.EnableRaisingEvents = true;
            process.ErrorDataReceived += (s, e) =>
            {
                if (e.Data != null)
                {
                    Log.LogWarning(e.Data);
                }
            };

            process.Start();
            process.BeginErrorReadLine();
            process.BeginOutputReadLine();
            process.WaitForExit();

            if (process.ExitCode != 0)
            {
                Log.LogError("Metadata generation failed.");

                return false;
            }

            process.Close();

            return true;
        }
    }
}


text:
package org.myrobotlab.service.meta;

import org.myrobotlab.logging.LoggerFactory;
import org.myrobotlab.service.meta.abstracts.MetaData;
import org.slf4j.Logger;

public class Bno055Meta extends MetaData {
  private static final long serialVersionUID = 1L;
  public final static Logger log = LoggerFactory.getLogger(Bno055Meta.class);

  /**
   * This static method returns all the details of the class without it having
   * to be constructed. It has description, categories, dependencies, and peer
   * definitions.
   */
  public Bno055Meta() {

    addDescription("General BNO055 acclerometer and gyro");
    addCategory("microcontroller", "sensors");
    setSponsor("calamity");

  }

}


text:
die() {
    echo " *** ERROR: " $*
    exit 1
}

cleanup() {
    # Clear logs and flash files
    sudo rm tmp/*.flash > /dev/null 2>&1
    sudo rm *.log > /dev/null 2>&1

    # Clear any wpantund instances
    sudo killall wpantund > /dev/null 2>&1

    wpan_interfaces=$(ifconfig 2>/dev/null | grep -o wpan[0-9]*)

    for interface in $wpan_interfaces; do
        sudo ip link delete $interface > /dev/null 2>&1
    done

    sleep 0.3
}

run() {
    counter=0
    while true; do

        if sudo python $1; then
            cleanup
            return
        fi

        # On Travis, we allow a failed test to be retried up to 3 attempts.
        if [ "$BUILD_TARGET" = "toranj-test-framework" ]; then
            if [ "$counter" -lt 2 ]; then
                counter=$((counter+1))
                echo Attempt $counter running "$1" failed. Trying again.
                cleanup
                sleep 10
                continue
            fi
        fi

        echo " *** TEST FAILED"
        tail -n 40 wpantund-logs*.log
        exit 1
    done
}

cd $(dirname $0)
cd ../..

# Build OpenThread posix mode with required configuration

./bootstrap || die
./configure                             \
    CPPFLAGS='-DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"../tests/toranj/openthread-core-toranj-config.h\"' \
    --enable-coverage                   \
    --enable-ncp-app=all                \
    --with-ncp-bus=uart                 \
    --with-examples=posix               \
    --enable-border-router              \
    --enable-child-supervision          \
    --enable-diag                       \
    --enable-jam-detection              \
    --enable-legacy                     \
    --enable-mac-filter                 \
    --enable-service                    \
    --enable-channel-monitor            \
    --enable-channel-manager            \
    --disable-docs                      \
    --disable-test || die

make -j 8 || die

# Run all the tests

cd tests/toranj

cleanup

run test-001-get-set.py
run test-002-form.py
run test-003-join.py
run test-004-scan.py
run test-005-discover-scan.py
run test-006-traffic-router-end-device.py
run test-007-traffic-router-sleepy.py
run test-008-permit-join.py
run test-100-mcu-power-state.py

run test-600-channel-manager-properties.py
run test-601-channel-manager-channel-change.py
run test-602-channel-manager-channel-select.py

exit 0


text:
package com.project.service;

import java.util.List;

import javax.validation.Validator;

import org.hibernate.Session;

import com.project.model.RandomDataGeneration;

public interface RandomDataGenModelServiceInterface<T> {

    T findByIdOrdinalNumber(int id, int ordinalNumber);

    void save(T object);

    void update(T object);

    void delete(Integer id);

    List<T> findAll();

    List<T> search(T object);

    Validator getValidator();

    Session getSession();

}


text:
/*================================================================================
  code generated by: java2cpp
  author: Zoran Angelov, mailto://baldzar@gmail.com
  class: java.util.zip.DeflaterOutputStream
================================================================================*/

#ifndef J2CPP_INCLUDE_IMPLEMENTATION

#ifndef J2CPP_JAVA_UTIL_ZIP_DEFLATEROUTPUTSTREAM_HPP_DECL
#define J2CPP_JAVA_UTIL_ZIP_DEFLATEROUTPUTSTREAM_HPP_DECL

namespace j2cpp { namespace java { namespace lang { class Object; } } }
namespace j2cpp { namespace java { namespace util { namespace zip { class Deflater; } } } }
namespace j2cpp { namespace java { namespace io { class FilterOutputStream; } } }
namespace j2cpp { namespace java { namespace io { class Closeable; } } }
namespace j2cpp { namespace java { namespace io { class Flushable; } } }
namespace j2cpp { namespace java { namespace io { class OutputStream; } } }

#include <java/io/Closeable.hpp>
#include <java/io/FilterOutputStream.hpp>
#include <java/io/Flushable.hpp>
#include <java/io/OutputStream.hpp>
#include <java/lang/Object.hpp>
#include <java/util/zip/Deflater.hpp>

namespace j2cpp {

namespace java { namespace util { namespace zip {

	class DeflaterOutputStream;
	class DeflaterOutputStream
		: public object<DeflaterOutputStream>
	{
	public:

		J2CPP_DECLARE_CLASS

		J2CPP_DECLARE_METHOD(0)
		J2CPP_DECLARE_METHOD(1)
		J2CPP_DECLARE_METHOD(2)
		J2CPP_DECLARE_METHOD(3)
		J2CPP_DECLARE_METHOD(4)
		J2CPP_DECLARE_METHOD(5)
		J2CPP_DECLARE_METHOD(6)
		J2CPP_DECLARE_METHOD(7)
		J2CPP_DECLARE_METHOD(8)
		J2CPP_DECLARE_FIELD(0)
		J2CPP_DECLARE_FIELD(1)

		explicit DeflaterOutputStream(jobject jobj)
		: object<DeflaterOutputStream>(jobj)
		{
		}

		operator local_ref<java::lang::Object>() const;
		operator local_ref<java::io::FilterOutputStream>() const;
		operator local_ref<java::io::Closeable>() const;
		operator local_ref<java::io::Flushable>() const;
		operator local_ref<java::io::OutputStream>() const;

		DeflaterOutputStream(local_ref< java::io::OutputStream > const&, local_ref< java::util::zip::Deflater > const&);
		DeflaterOutputStream(local_ref< java::io::OutputStream > const&);
		DeflaterOutputStream(local_ref< java::io::OutputStream > const&, local_ref< java::util::zip::Deflater > const&, jint);
		void close();
		void finish();
		void write(jint);
		void write(local_ref< array<jbyte,1> >  const&, jint, jint);
		void flush();

	}; //class DeflaterOutputStream

} //namespace zip
} //namespace util
} //namespace java

} //namespace j2cpp

#endif //J2CPP_JAVA_UTIL_ZIP_DEFLATEROUTPUTSTREAM_HPP_DECL

#else //J2CPP_INCLUDE_IMPLEMENTATION

#ifndef J2CPP_JAVA_UTIL_ZIP_DEFLATEROUTPUTSTREAM_HPP_IMPL
#define J2CPP_JAVA_UTIL_ZIP_DEFLATEROUTPUTSTREAM_HPP_IMPL

namespace j2cpp {

java::util::zip::DeflaterOutputStream::operator local_ref<java::lang::Object>() const
{
	return local_ref<java::lang::Object>(get_jobject());
}

java::util::zip::DeflaterOutputStream::operator local_ref<java::io::FilterOutputStream>() const
{
	return local_ref<java::io::FilterOutputStream>(get_jobject());
}

java::util::zip::DeflaterOutputStream::operator local_ref<java::io::Closeable>() const
{
	return local_ref<java::io::Closeable>(get_jobject());
}

java::util::zip::DeflaterOutputStream::operator local_ref<java::io::Flushable>() const
{
	return local_ref<java::io::Flushable>(get_jobject());
}

java::util::zip::DeflaterOutputStream::operator local_ref<java::io::OutputStream>() const
{
	return local_ref<java::io::OutputStream>(get_jobject());
}

java::util::zip::DeflaterOutputStream::DeflaterOutputStream(local_ref< java::io::OutputStream > const &a0, local_ref< java::util::zip::Deflater > const &a1)
: object<java::util::zip::DeflaterOutputStream>(
	call_new_object<
		java::util::zip::DeflaterOutputStream::J2CPP_CLASS_NAME,
		java::util::zip::DeflaterOutputStream::J2CPP_METHOD_NAME(0),
		java::util::zip::DeflaterOutputStream::J2CPP_METHOD_SIGNATURE(0)
	>(a0, a1)
)
{
}

java::util::zip::DeflaterOutputStream::DeflaterOutputStream(local_ref< java::io::OutputStream > const &a0)
: object<java::util::zip::DeflaterOutputStream>(
	call_new_object<
		java::util::zip::DeflaterOutputStream::J2CPP_CLASS_NAME,
		java::util::zip::DeflaterOutputStream::J2CPP_METHOD_NAME(1),
		java::util::zip::DeflaterOutputStream::J2CPP_METHOD_SIGNATURE(1)
	>(a0)
)
{
}

java::util::zip::DeflaterOutputStream::DeflaterOutputStream(local_ref< java::io::OutputStream > const &a0, local_ref< java::util::zip::Deflater > const &a1, jint a2)
: object<java::util::zip::DeflaterOutputStream>(
	call_new_object<
		java::util::zip::DeflaterOutputStream::J2CPP_CLASS_NAME,
		java::util::zip::DeflaterOutputStream::J2CPP_METHOD_NAME(2),
		java::util::zip::DeflaterOutputStream::J2CPP_METHOD_SIGNATURE(2)
	>(a0, a1, a2)
)
{
}

void java::util::zip::DeflaterOutputStream::close()
{
	return call_method<
		java::util::zip::DeflaterOutputStream::J2CPP_CLASS_NAME,
		java::util::zip::DeflaterOutputStream::J2CPP_METHOD_NAME(4),
		java::util::zip::DeflaterOutputStream::J2CPP_METHOD_SIGNATURE(4),
		void
	>(get_jobject());
}

void java::util::zip::DeflaterOutputStream::finish()
{
	return call_method<
		java::util::zip::DeflaterOutputStream::J2CPP_CLASS_NAME,
		java::util::zip::DeflaterOutputStream::J2CPP_METHOD_NAME(5),
		java::util::zip::DeflaterOutputStream::J2CPP_METHOD_SIGNATURE(5),
		void
	>(get_jobject());
}

void java::util::zip::DeflaterOutputStream::write(jint a0)
{
	return call_method<
		java::util::zip::DeflaterOutputStream::J2CPP_CLASS_NAME,
		java::util::zip::DeflaterOutputStream::J2CPP_METHOD_NAME(6),
		java::util::zip::DeflaterOutputStream::J2CPP_METHOD_SIGNATURE(6),
		void
	>(get_jobject(), a0);
}

void java::util::zip::DeflaterOutputStream::write(local_ref< array<jbyte,1> > const &a0, jint a1, jint a2)
{
	return call_method<
		java::util::zip::DeflaterOutputStream::J2CPP_CLASS_NAME,
		java::util::zip::DeflaterOutputStream::J2CPP_METHOD_NAME(7),
		java::util::zip::DeflaterOutputStream::J2CPP_METHOD_SIGNATURE(7),
		void
	>(get_jobject(), a0, a1, a2);
}

void java::util::zip::DeflaterOutputStream::flush()
{
	return call_method<
		java::util::zip::DeflaterOutputStream::J2CPP_CLASS_NAME,
		java::util::zip::DeflaterOutputStream::J2CPP_METHOD_NAME(8),
		java::util::zip::DeflaterOutputStream::J2CPP_METHOD_SIGNATURE(8),
		void
	>(get_jobject());
}

J2CPP_DEFINE_CLASS(java::util::zip::DeflaterOutputStream,"java/util/zip/DeflaterOutputStream")
J2CPP_DEFINE_METHOD(java::util::zip::DeflaterOutputStream,0,"<init>","(Ljava/io/OutputStream;Ljava/util/zip/Deflater;)V")
J2CPP_DEFINE_METHOD(java::util::zip::DeflaterOutputStream,1,"<init>","(Ljava/io/OutputStream;)V")
J2CPP_DEFINE_METHOD(java::util::zip::DeflaterOutputStream,2,"<init>","(Ljava/io/OutputStream;Ljava/util/zip/Deflater;I)V")
J2CPP_DEFINE_METHOD(java::util::zip::DeflaterOutputStream,3,"deflate","()V")
J2CPP_DEFINE_METHOD(java::util::zip::DeflaterOutputStream,4,"close","()V")
J2CPP_DEFINE_METHOD(java::util::zip::DeflaterOutputStream,5,"finish","()V")
J2CPP_DEFINE_METHOD(java::util::zip::DeflaterOutputStream,6,"write","(I)V")
J2CPP_DEFINE_METHOD(java::util::zip::DeflaterOutputStream,7,"write","([BII)V")
J2CPP_DEFINE_METHOD(java::util::zip::DeflaterOutputStream,8,"flush","()V")
J2CPP_DEFINE_FIELD(java::util::zip::DeflaterOutputStream,0,"buf","[B")
J2CPP_DEFINE_FIELD(java::util::zip::DeflaterOutputStream,1,"def","Ljava/util/zip/Deflater;")

} //namespace j2cpp

#endif //J2CPP_JAVA_UTIL_ZIP_DEFLATEROUTPUTSTREAM_HPP_IMPL

#endif //J2CPP_INCLUDE_IMPLEMENTATION


text:
"""Tables for SVI

Revision ID: 6d55c6f80f40
Revises: dd2f91cf1b1e
Create Date: 2017-12-18 14:36:19.451172

"""

# revision identifiers, used by Alembic.
revision = '6d55c6f80f40'
down_revision = 'dd2f91cf1b1e'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects.mysql import VARCHAR

def upgrade():
    op.create_table(
        'aim_l3out_node_profiles',
        sa.Column('aim_id', sa.Integer, autoincrement=True),
        sa.Column('name', sa.String(64), nullable=False),
        sa.Column('tenant_name', sa.String(64), nullable=False),
        sa.Column('display_name', sa.String(256), nullable=False, default=''),
        sa.Column('l3out_name', sa.String(64), nullable=False),
        sa.Column('monitored', sa.Boolean, nullable=False, default=False),
        sa.PrimaryKeyConstraint('aim_id'),
        sa.UniqueConstraint('tenant_name', 'l3out_name', 'name',
                            name='uniq_aim_l3out_node_profile_identity'),
        sa.Index('idx_aim_l3out_node_profile_identity',
                 'tenant_name', 'l3out_name', 'name'))

    op.create_table(
        'aim_l3out_nodes',
        sa.Column('aim_id', sa.Integer, autoincrement=True),
        sa.Column('tenant_name', sa.String(64), nullable=False),
        sa.Column('l3out_name', sa.String(64), nullable=False),
        sa.Column('node_profile_name', sa.String(64), nullable=False),
        sa.Column('node_path', VARCHAR(512, charset='latin1'), nullable=False),
        sa.Column('router_id', sa.String(64), nullable=False),
        sa.Column('router_id_loopback', sa.Boolean, nullable=False),
        sa.Column('monitored', sa.Boolean, nullable=False, default=False),
        sa.PrimaryKeyConstraint('aim_id'),
        sa.UniqueConstraint('tenant_name', 'l3out_name', 'node_profile_name',
                            'node_path',
                            name='uniq_aim_l3out_node_identity'),
        sa.Index('idx_aim_l3out_node_identity',
                 'tenant_name', 'l3out_name', 'node_profile_name',
                 'node_path'))

    op.create_table(
        'aim_l3out_static_routes',
        sa.Column('aim_id', sa.Integer, autoincrement=True),
        sa.Column('tenant_name', sa.String(64), nullable=False),
        sa.Column('display_name', sa.String(256), nullable=False, default=''),
        sa.Column('l3out_name', sa.String(64), nullable=False),
        sa.Column('node_profile_name', sa.String(64), nullable=False),
        sa.Column('node_path', VARCHAR(512, charset='latin1'), nullable=False),
        sa.Column('cidr', sa.String(64), nullable=False),
        sa.Column('preference', sa.String(16), nullable=False),
        sa.Column('monitored', sa.Boolean, nullable=False, default=False),
        sa.PrimaryKeyConstraint('aim_id'),
        sa.UniqueConstraint('tenant_name', 'l3out_name', 'node_profile_name',
                            'node_path', 'cidr',
                            name='uniq_aim_l3out_static_route_identity'),
        sa.Index('idx_aim_l3out_static_route_identity',
                 'tenant_name', 'l3out_name', 'node_profile_name',
                 'node_path', 'cidr'))

    op.create_table(
        'aim_l3out_next_hops',
        sa.Column('static_route_aim_id', sa.Integer, nullable=False),
        sa.Column('addr', sa.String(64), nullable=False),
        sa.Column('preference', sa.String(16), nullable=False),
        sa.PrimaryKeyConstraint('static_route_aim_id', 'addr'),
        sa.ForeignKeyConstraint(
            ['static_route_aim_id'], ['aim_l3out_static_routes.aim_id']))

    op.create_table(
        'aim_l3out_interface_profiles',
        sa.Column('aim_id', sa.Integer, autoincrement=True),
        sa.Column('tenant_name', sa.String(64), nullable=False),
        sa.Column('display_name', sa.String(256), nullable=False, default=''),
        sa.Column('l3out_name', sa.String(64), nullable=False),
        sa.Column('node_profile_name', sa.String(64), nullable=False),
        sa.Column('name', sa.String(64), nullable=False),
        sa.Column('monitored', sa.Boolean, nullable=False, default=False),
        sa.PrimaryKeyConstraint('aim_id'),
        sa.UniqueConstraint('tenant_name', 'l3out_name', 'node_profile_name',
                            'name',
                            name='uniq_aim_l3out_if_profile_identity'),
        sa.Index('idx_aim_l3out_if_profile_identity',
                 'tenant_name', 'l3out_name', 'node_profile_name',
                 'name'))

    op.create_table(
        'aim_l3out_interfaces',
        sa.Column('aim_id', sa.Integer, autoincrement=True),
        sa.Column('tenant_name', sa.String(64), nullable=False),
        sa.Column('l3out_name', sa.String(64), nullable=False),
        sa.Column('node_profile_name', sa.String(64), nullable=False),
        sa.Column('interface_profile_name', sa.String(64), nullable=False),
        sa.Column('interface_path', VARCHAR(512, charset='latin1'),
                  nullable=False),
        sa.Column('encap', sa.String(24), nullable=False),
        sa.Column('type', sa.String(16), nullable=False),
        sa.Column('primary_addr_a', sa.String(64), nullable=False),
        sa.Column('primary_addr_b', sa.String(64)),
        sa.Column('monitored', sa.Boolean, nullable=False, default=False),
        sa.PrimaryKeyConstraint('aim_id'),
        sa.UniqueConstraint('tenant_name', 'l3out_name', 'node_profile_name',
                            'interface_profile_name', 'interface_path',
                            name='uniq_aim_l3out_if_identity'),
        sa.Index('idx_aim_l3out_if_identity',
                 'tenant_name', 'l3out_name', 'node_profile_name',
                 'interface_profile_name', 'interface_path'))

    op.create_table(
        'aim_l3out_interface_secondary_ip_a',
        sa.Column('interface_aim_id', sa.Integer, nullable=False),
        sa.Column('addr', sa.String(64), nullable=False),
        sa.PrimaryKeyConstraint('interface_aim_id', 'addr'),
        sa.ForeignKeyConstraint(
            ['interface_aim_id'], ['aim_l3out_interfaces.aim_id']))

    op.create_table(
        'aim_l3out_interface_secondary_ip_b',
        sa.Column('interface_aim_id', sa.Integer, nullable=False),
        sa.Column('addr', sa.String(64), nullable=False),
        sa.PrimaryKeyConstraint('interface_aim_id', 'addr'),
        sa.ForeignKeyConstraint(
            ['interface_aim_id'], ['aim_l3out_interfaces.aim_id']))

def downgrade():
    pass


text:
package models

import (
	// "github.com/astaxie/beego"
	"github.com/astaxie/beego/orm"
	// _ "github.com/mattn/go-sqlite3"
	// "strconv"
	// "strings"
	"time"
)

type CarCalendar struct {
	Id        int64     `json:"id",form:"-"`
	Title     string    `json:"title",form:"title;text;title:",valid:"MinSize(1);MaxSize(100)"` //orm:"unique",
	Content   string    `json:"content",orm:"sie(20)"`
	Starttime time.Time `json:"start",orm:"type(datetime)"`
	Endtime   time.Time `json:"end",orm:"type(datetime)"`
	Allday    bool      `json:"allDay",orm:"default(0)"`
	Color     string    `json:"color",orm:"null"`
	Public    bool      `default(true)`
	Ip        string    `json:"ip",orm:"null"`
	// Color     string    `json:"backgroundColor",orm:"null"`
	// BColor    string    `json:"borderColor",orm:"null"`
}

type MeetCalendar struct {
	Id        int64     `json:"id",form:"-"`
	Title     string    `json:"title",form:"title;text;title:",valid:"MinSize(1);MaxSize(100)"` //orm:"unique",
	Content   string    `json:"content",orm:"sie(20)"`
	Starttime time.Time `json:"start",orm:"type(datetime)"`
	Endtime   time.Time `json:"end",orm:"type(datetime)"`
	Allday    bool      `json:"allDay",orm:"default(0)"`
	Color     string    `json:"color",orm:"null"`
	Public    bool      `default(true)`
	Ip        string    `json:"ip",orm:"null"`
	// Color     string    `json:"backgroundColor",orm:"null"`
	// BColor    string    `json:"borderColor",orm:"null"`
}

func init() {
	orm.RegisterModel(new(CarCalendar), new(MeetCalendar)) //, new(Article)
}

//********汽车日历********
//添加
func AddCarCalendar(title, content, color, ip string, allday, public bool, start, end time.Time) (id int64, err error) {
	o := orm.NewOrm()
	calendar := &CarCalendar{
		Title:   title,
		Content: content,
		Color:   color,
		Ip:      ip,
		Allday:  allday,
		Public:  public,
		// BColor:    color,
		Starttime: start,
		Endtime:   end,
	}
	id, err = o.Insert(calendar)
	if err != nil {
		return id, err
	}
	// }
	return id, err
}

//取所有——要修改为支持时间段的,比如某个月份
func GetCarCalendar(start, end time.Time, public bool) (calendars []*CarCalendar, err error) {
	cond := orm.NewCondition()
	cond1 := cond.And("Starttime__gte", start).And("Starttime__lt", end) //这里全部用开始时间来判断
	o := orm.NewOrm()
	qs := o.QueryTable("CarCalendar")
	qs = qs.SetCond(cond1)

	// o := orm.NewOrm()
	calendars = make([]*CarCalendar, 0)
	// qs := o.QueryTable("CarCalendar")
	if public { //只取公开的
		_, err = qs.Filter("public", true).OrderBy("-Starttime").All(&calendars)
		if err != nil {
			return calendars, err
		}
	} else { //取全部
		_, err = qs.OrderBy("-Starttime").All(&calendars)
		if err != nil {
			return calendars, err
		}
	}
	return calendars, err
}

//修改
func UpdateCarCalendar(cid int64, title, content, color string, allday, public bool, start, end time.Time) error {
	o := orm.NewOrm()
	calendar := &CarCalendar{Id: cid}
	if o.Read(calendar) == nil {
		calendar.Title = title
		calendar.Content = content
		calendar.Color = color
		calendar.Allday = allday
		calendar.Public = public
		// calendar.BColor = color
		calendar.Starttime = start
		calendar.Endtime = end
		// calendar.Updated = time.Now()
		_, err := o.Update(calendar)
		if err != nil {
			return err
		}
	}
	return nil
}

//拖曳
func DropCarCalendar(cid int64, start, end time.Time) error {
	o := orm.NewOrm()
	calendar := &CarCalendar{Id: cid}
	if o.Read(calendar) == nil {
		calendar.Starttime = start
		calendar.Endtime = end
		_, err := o.Update(calendar)
		if err != nil {
			return err
		}
	}
	return nil
}

//resize
func ResizeCarCalendar(cid int64, end time.Time) error {
	o := orm.NewOrm()
	calendar := &CarCalendar{Id: cid}
	if o.Read(calendar) == nil {
		// calendar.Starttime = start
		calendar.Endtime = end
		// calendar.Updated = time.Now()
		_, err := o.Update(calendar)
		if err != nil {
			return err
		}
	}
	return nil
}

//根据id查询事件
func GetCarCalendarbyid(id int64) (calendar CarCalendar, err error) {
	o := orm.NewOrm()
	qs := o.QueryTable("CarCalendar")
	err = qs.Filter("id", id).One(&calendar)
	if err != nil {
		return calendar, err
	}
	return calendar, err
}

//删除事件
func DeleteCarCalendar(cid int64) error {
	o := orm.NewOrm()
	calendar := &CarCalendar{Id: cid}
	if o.Read(calendar) == nil {
		_, err := o.Delete(calendar)
		if err != nil {
			return err
		}
	}
	return nil
}

//*******会议室日历
//添加
func AddMeetCalendar(title, content, color, ip string, allday, public bool, start, end time.Time) (id int64, err error) {
	o := orm.NewOrm()
	calendar := &MeetCalendar{
		Title:   title,
		Content: content,
		Color:   color,
		Ip:      ip,
		Allday:  allday,
		Public:  public,
		// BColor:    color,
		Starttime: start,
		Endtime:   end,
	}
	id, err = o.Insert(calendar)
	if err != nil {
		return id, err
	}
	// }
	return id, err
}

//取所有——要修改为支持时间段的,比如某个月份
func GetMeetCalendar(start, end time.Time, public bool) (calendars []*MeetCalendar, err error) {
	cond := orm.NewCondition()
	cond1 := cond.And("Starttime__gte", start).And("Starttime__lt", end) //这里全部用开始时间来判断
	o := orm.NewOrm()
	qs := o.QueryTable("MeetCalendar")
	qs = qs.SetCond(cond1)

	// o := orm.NewOrm()
	calendars = make([]*MeetCalendar, 0)
	// qs := o.QueryTable("MeetCalendar")
	if public { //只取公开的
		_, err = qs.Filter("public", true).OrderBy("-Starttime").All(&calendars)
		if err != nil {
			return calendars, err
		}
	} else { //取全部
		_, err = qs.OrderBy("-Starttime").All(&calendars)
		if err != nil {
			return calendars, err
		}
	}
	return calendars, err
}

//修改
func UpdateMeetCalendar(cid int64, title, content, color string, allday, public bool, start, end time.Time) error {
	o := orm.NewOrm()
	calendar := &MeetCalendar{Id: cid}
	if o.Read(calendar) == nil {
		calendar.Title = title
		calendar.Content = content
		calendar.Color = color
		calendar.Allday = allday
		calendar.Public = public
		// calendar.BColor = color
		calendar.Starttime = start
		calendar.Endtime = end
		// calendar.Updated = time.Now()
		_, err := o.Update(calendar)
		if err != nil {
			return err
		}
	}
	return nil
}

//拖曳
func DropMeetCalendar(cid int64, start, end time.Time) error {
	o := orm.NewOrm()
	calendar := &MeetCalendar{Id: cid}
	if o.Read(calendar) == nil {
		calendar.Starttime = start
		calendar.Endtime = end
		_, err := o.Update(calendar)
		if err != nil {
			return err
		}
	}
	return nil
}

//resize
func ResizeMeetCalendar(cid int64, end time.Time) error {
	o := orm.NewOrm()
	calendar := &MeetCalendar{Id: cid}
	if o.Read(calendar) == nil {
		// calendar.Starttime = start
		calendar.Endtime = end
		// calendar.Updated = time.Now()
		_, err := o.Update(calendar)
		if err != nil {
			return err
		}
	}
	return nil
}

//根据id查询事件
func GetMeetCalendarbyid(id int64) (calendar MeetCalendar, err error) {
	o := orm.NewOrm()
	qs := o.QueryTable("MeetCalendar")
	err = qs.Filter("id", id).One(&calendar)
	if err != nil {
		return calendar, err
	}
	return calendar, err
}

//删除事件
func DeleteMeetCalendar(cid int64) error {
	o := orm.NewOrm()
	calendar := &MeetCalendar{Id: cid}
	if o.Read(calendar) == nil {
		_, err := o.Delete(calendar)
		if err != nil {
			return err
		}
	}
	return nil
}

//取所有——要修改为支持时间段的,比如某个月份
//未测试20181117修改filter为cond3
func SearchMeetCalendar(title string, public bool) (calendars []*MeetCalendar, err error) {
	cond := orm.NewCondition()
	cond1 := cond.Or("title__contains", title).Or("content__contains", title)
	cond2 := cond.And("title", title).And("public", true)
	cond3 := cond.AndCond(cond1).AndCond(cond2)
	o := orm.NewOrm()
	qs := o.QueryTable("MeetCalendar")
	qs = qs.SetCond(cond3)

	calendars = make([]*MeetCalendar, 0)
	// qs := o.QueryTable("AdminCalendar")
	if public { //只取公开的
		_, err = qs.OrderBy("-Starttime").Distinct().All(&calendars)
		if err != nil {
			return calendars, err
		}
	} else { //取全部
		_, err = qs.OrderBy("-Starttime").Distinct().All(&calendars)
		if err != nil {
			return calendars, err
		}
	}
	return calendars, err
}


text:
title: Kong Enterprise k8s Changelog
---

## 2.0.4.1

> Released on 2020/05/05

### Fixed

- Ensure that a worker being spawned due to any errors always receives the
  latest up-to-date configuration in the DB-less mode
  [#5850](https://github.com/Kong/kong/pull/5850)

## 2.0.4.0

> Released on 2020/04/28

### Summary

Kong Enterprise k8s 2.0.4.0 is based on Kong Gateway 2.0.4.

### Kong Gateway

Kong Enterprise k8s 2.0.4.0 is based on Kong Gateway 2.0.4,
meaning it inherits the bug-fixes between Kong Gateway 2.0.2 and
2.0.4.
Please review the changelog for
[Kong Gateway](https://github.com/Kong/kong/blob/master/CHANGELOG.md).

### Enterprise Plugins

The following fixes have been included in this release:

- `openid-connect` plugin has been bumped up to v1.4.2
  - Adds support for `client_secret_jwt` and `private_key_jwt` authentication
  - Adds support for cookie for `config.bearer_token_param_type`
  - Adds support for `config.bearer_token_cookie_name`
- `collector` plugin has been bumped up to v1.7.4
- `response-transformer-advanced` has been bumped up to v0.3.3
- `mtls-auth` plugin has been bumped up to v0.1.1
- `kafka-log` plugin has been bumped up to v0.1.0

## 2.0.2.0

> Released on 2020/03/27

### Summary

Kong Enterprise k8s 2.0.2.0 is based on Kong Gateway 2.0.2.

### Kong Gateway

Kong Enterprise k8s 2.0.2.0 is based on Kong Gateway 2.0.2,
meaning it inherits all new features and changes between Kong Gateway 1.4.2 and
2.0.2.
Please review the changelog for
[Kong Gateway](https://github.com/Kong/kong/blob/master/CHANGELOG.md).

### Enterprise Plugins

The following plugins are included in this release:

* degraphql
* graphql-rate-limiting-advanced
* graphql-proxy-cache-advanced

## 1.4.2.0

> Released on 2020/01/02

### Summary

Kong Enterprise k8s 1.4.2.0 is based on Kong Gateway 1.4.2.

### Kong Gateway

Kong Enterprise k8s 1.4.2.0 is based on Kong Gateway 1.4.2,
meaning it inherits all new features and changes between Kong Gateway 1.3.0 and
1.4.2.
Please review the changelog for
[Kong Gateway 1.4.0](https://github.com/Kong/kong/blob/master/CHANGELOG.md#140).

## 1.3.0.0

> Released on 2019/11/19

### Summary

Kong Enterprise k8s 1.3.0.0 is the debut release for this package.

### Kong Gateway

Kong Enterprise k8s 1.3.0.0 is based on Kong Gateway 1.3.0,
meaning it inherits all the features and changes from it.
Please review the changelog for
[Kong Gateway 1.3.0](https://github.com/Kong/kong/blob/master/CHANGELOG.md#130).

### Enterprise plugins

The following plugins are included with this release:

* oauth2-introspection
* openid-connect
* proxy-cache-advanced
* rate-limiting-advanced
* response-transformer-advanced
* kafka-log
* kafka-upstream
* canary release
* ldap-auth-advanced
* forward-proxy
* jwt-signer
* collector
* mtls-auth
* request-validator


text: Contains the Kinect controller for the brick menu.


text:
Filter

			Nachname:

				<input id='nameFilter' class='form-control' type='text' ng-model='nameFilter' />

					<button class='btn btn-info' ng-click='clearNameSelection()'>

					</button>

      	<button type='button' class='btn btn-primary btn-block' ng-click='getReportData()'>Laden</button>

			Nachname
			Vorname
			Von
			Bis
			Woche
			Programm
			Rolle
			Betrag
			Email
			Tel

			{{rel.lastName}}
			{{rel.firstName}}
			{{rel.startDate | date: 'dd/MM/yyyy'}}
			{{rel.endDate | date: 'dd/MM/yyyy'}}
			{{rel.activityName}}
			{{rel.eventName}}
			{{rel.type}}
			{{rel.amount}}
			{{rel.email}}
			{{rel.phoneNumber}}

			Summe:
			{{sumAmount}}

        Email-Adressen Teamleiter:
        <textarea name='uniqueEmailLeader' type='text' rows='4' class='form-control' ng-model='emailsLeader'></textarea>

        Email-Adressen Betreuer:
        <textarea name='uniqueEmailCaregiver' type='text' rows='4' class='form-control' ng-model='emailsCaregiver'></textarea>

        Email-Adressen Praktikanten:
        <textarea name='uniqueEmailTrainee' type='text' rows='4' class='form-control' ng-model='emailsTrainee'></textarea>


text:
namespace blink {

v8::Handle<v8::Value> stringToV8Value(String);

v8::Handle<v8::Value> doubleToV8Value(double);

void setV8ObjectPropertyAsString(v8::Handle<v8::Object>, String, String);

void setV8ObjectPropertyAsNumber(v8::Handle<v8::Object>, String, double);

} // namespace blink

#endif // AnimationTestHelper_h


text:
/*
 * Created on Oct 25, 2004
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package org.tolweb.tapestry;

import java.util.List;

import org.tolweb.hibernate.MappedPage;
import org.tolweb.hibernate.MappedTextSection;
import org.tolweb.misc.CacheAccess;
import org.tolweb.misc.TextPreparer;
import org.tolweb.tapestry.injections.BaseInjectable;
import org.tolweb.treegrow.main.StringUtils;

/**
 * @author dmandel
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public abstract class TextSections extends CachedOutputComponent implements BaseInjectable {
    public abstract boolean getUseGlossary();
    public abstract MappedTextSection getCurrentTextSection();
    public abstract MappedPage getTolPage();
	public abstract String getTotalJavascriptString();
	public abstract void setTotalJavascriptString(String value);

	@SuppressWarnings("unchecked")
	public String getCurrentTextSectionText() {
	    TextPreparer preparer = getTextPreparer();
	    List results = preparer.prepareText(getCurrentTextSection().getText(), CacheAccess.PAGE_TEXT_CACHE,
	            getTolPage(), false, getUseGlossary());
	    String actualText = (String) results.get(0);
	    if (getUseGlossary()) {
		    String totalJavascript = getTotalJavascriptString();
		    if (StringUtils.notEmpty(totalJavascript)) {
		        totalJavascript += (String) results.get(1);
		    } else {
		        totalJavascript = (String) results.get(1);
		    }
		    setTotalJavascriptString(totalJavascript);
	    }
	    return actualText;
	}

	public String getCurrentTextSectionHeading() {
	    return getCurrentTextSection().getHeadingNoSpaces();
	}

	protected String getCachedOutput() {
	    CacheAccess cacheAccess = getCacheAccess();
	    if (getUseGlossary()) {
	        setTotalJavascriptString(cacheAccess.getPageJavascript(getTolPage()));
	    }
	    // turned off (temporarily) due to problems with characters getting mangled
	    //return cacheAccess.getTextSectionTextForPage(getTolPage(), getUseGlossary());
	    return null;
	}

	protected void setCachedOutput(String value) {
	    getCacheAccess().setTextSectionTextForPage(getTolPage(), value, getUseGlossary());
	    if (getUseGlossary()) {
	        getCacheAccess().setPageJavascript(getTolPage(), getTotalJavascriptString());
	    }
	}
}


text:
module.exports = function (panel, stdout) {
    var me = {
        getChildOffsetV: function (child) {
            return 0;
        },
        getChildOffsetH: function (child) {
            return 0;
        },
        getChildOffset: function (child) {
            return [this.getChildOffsetV(child), this.getChildOffsetH(child)];
        },
        getChildWidth: function (child) {
            return stdout.columns;
        },
        getSpaceBelowChild: function (child) {
            return 0;
        },
        redrawBelowChild: function () {
        },
        getHeight: function () {
            return panel.getHeight();
        },
        isFooter: function () {
            return true;
        },
        rewrite: function () {
            panel.rewrite();
        },
        setFooter: function (footer_) {
            panel.setFooter(footer_);
        }
    };
    panel.setParent(me);
    panel.setFooter(me);
    return me;
};


text:
<?php
$p = new Phar(dirname(__FILE__) . '/brandnewphar.phar.zip', 0, 'brandnewphar.phar');
var_dump($p->isFileFormat(Phar::ZIP));
//var_dump($p->getStub());
var_dump($p->isBuffering());
$p->startBuffering();
var_dump($p->isBuffering());
$p['a.php'] = '<?php var_dump("Hello");';
$p->setStub('<?php var_dump("First"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?>');
include 'phar://brandnewphar.phar/a.php';
var_dump($p->getStub());
$p['b.php'] = '<?php var_dump("World");';
$p->setStub('<?php var_dump("Second"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER();');
include 'phar://brandnewphar.phar/b.php';
var_dump($p->getStub());
$p->stopBuffering();
echo "===COMMIT===\n";
var_dump($p->isBuffering());
include 'phar://brandnewphar.phar/a.php';
include 'phar://brandnewphar.phar/b.php';
var_dump($p->getStub());

// add portion to test setting stub from resource
file_put_contents(dirname(__FILE__) . '/myfakestub.php', '<?php var_dump("First resource"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?>');
$a = fopen(dirname(__FILE__) . '/myfakestub.php', 'rb');
$p->setStub($a);
var_dump($p->getStub());
$c = strlen('<?php var_dump("First resource"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?>');
file_put_contents(dirname(__FILE__) . '/myfakestub.php', '<?php var_dump("First resource"); Phar::mapPhar("brandnewphar.phar"); __HALT_COMPILER(); ?>' . 'extra stuff');
fseek($a, 0);
$p->setStub($a, $c);
var_dump($p->getStub());
fclose($a);
?>
===DONE===


text:
var curry = require('curry')
/*
  group: get the cb's of several functions.

*/

function findErr (funx){
  for(var i in funx){
    if(funx[i].arguments[0])
      return funx[i].arguments[0]
  }
}

exports.group = function (done){
  var c = 0, i = 0, funx = [], args = [], called = 0, error = null
  if(!done)
    done = function (){
      throw new Error("group was never given a 'done' callback")
    }
  var group =
  function group (){
    c++
    var x = i ++
    funx[x] = function (){
      if(args[x])
        throw new Error ('function called twice')
      args[x] = arguments
      error = error || arguments[0]
      called ++
      if(called == c){
        done(error, args)
      }
    }
    return funx[x]
  }
  group.done = function (_done){
    done = _done
    return group
  }
  return group
}

exports.defer = function (obj,commands){

  var called = []
  commands.forEach(function (name){
    obj[name] = function (){
      called.push({name: name,args: arguments})
    }
  })

  return function (newObj){
    commands.forEach(function (name){
      obj[name] = curry(newObj[name],[],newObj)
    })
    called.forEach(function (cmd){
      newObj[cmd.name].apply(newObj,cmd.args)
    })
    //execute commands, and then hook to the regular methods.
  }
}

exports.width = Queue

function Queue(jobs,width){
  if(!(this instanceof Queue)) return new Queue(jobs,width)

  var self = this

  if(!jobs)
    throw new Error("ctrlflow.width cannot process " + jobs + ", expected an array")

  this.keys = Object.keys(jobs)
  this.running = 0
  this.jobs = jobs
  this.width = width || 1
  this.done = function (){}

  this.start = function (){
    var k = self.keys.shift()
    self.running ++
    self.func(self.jobs[k],k,self.jobs)
  }

  this.next = function (){
    self.running --
    if(self.keys.length){
      self.start()
    } else if (self.running == 0){
        self.done()
    }
  }
}

Queue.prototype = {

  forEach:
    function (func,done){
      this.func = func
      this.done = done || this.done
      var i = 0
      while(i++ < this.width && this.keys.length)
        this.start()
    }
}
function toArray (args){
  var a = []
  for(var i = 0; i < args.length; i ++)
    a.push(args[i])
  return a
}

exports.seq = function (){
  var array = [].concat(Array.isArray(arguments[0]) ? [].shift.apply(arguments) : [])
    , onError = [].pop.apply(arguments)
    , done = function (){}

  function sequence (){
    if(!onError)
      sequence.throws()

// done = 'function' == typeof this.next ? this.next : [].pop.apply(arguments) //test for this.
    var args = toArray(arguments)

    function next (){
      var f = array.shift()
      if(!f)
        return done();
      args = toArray(arguments)
      args.push(next)
      try{
        f.apply({next:next},args)
      } catch (err){
        if(onError)
          onError(err)
        else
          throw err
      }
    }

    next.apply({next:next},args)
  }
  sequence.go = function (){
    sequence()
    return sequence
  }
  sequence.done = function (_done){
    done = _done
    return sequence
  }
  sequence.onError = function (_onError){
    onError = _onError
    return sequence
  }
  sequence.throws = function (){
    done = function (err){
      if(!err)
        throw new Error('Threw falsey error:' + err )
      throw err
    }
    return sequence
  }
  //option to pass error to next function? no, I can't imagine using that.
  return sequence
}


text:
package aggregation.sof20140106;

import static com.allanbank.mongodb.builder.AggregationGroupField.set;
import static com.allanbank.mongodb.builder.AggregationGroupId.constantId;
import static com.allanbank.mongodb.builder.AggregationProjectFields.include;
import static com.allanbank.mongodb.builder.Find.ALL;
import static com.allanbank.mongodb.builder.expression.Expressions.cond;
import static com.allanbank.mongodb.builder.expression.Expressions.constant;
import static com.allanbank.mongodb.builder.expression.Expressions.eq;
import static com.allanbank.mongodb.builder.expression.Expressions.field;
import static com.allanbank.mongodb.builder.expression.Expressions.ifNull;
import static com.allanbank.mongodb.builder.expression.Expressions.set;

import java.io.IOException;
import java.util.Random;

import com.allanbank.mongodb.MongoClient;
import com.allanbank.mongodb.MongoCollection;
import com.allanbank.mongodb.MongoFactory;
import com.allanbank.mongodb.bson.builder.BuilderFactory;
import com.allanbank.mongodb.bson.builder.DocumentBuilder;
import com.allanbank.mongodb.bson.element.ObjectId;
import com.allanbank.mongodb.builder.Aggregate;

/**
 * Count the number of documents that have a particular field.
 *

 * This is an interesting problem because the set of operators that can be used
 * within a projection is limited. In this solution we use {@code $ifNull}
 * operator to detect the condition and the use a {@code $eq} within a
 * {@code $cond} to actually set the value.
 *

 *

 * The main take away from trying to solve this problem is that the MongoDB
 * query engine does not behave the same as the expression engine.
 *

 *

 * Sample output of the application is:

 *
 *

 *
 * '$pipeline' : [
 *   {
 *     '$project' : {
 *       a : 1,
 *       b : 1,
 *       c : 1,
 *       etc : 1,
 *       myfieldnameExists : {
 *         '$cond' : [
 *           {
 *             '$eq' : [
 *               {
 *                 '$ifNull' : [
 *                   '$myfieldname',
 *                   ObjectId('52cb9a7a6c4a281ac27e482c')
 *                 ]
 *               },
 *               ObjectId('52cb9a7a6c4a281ac27e482c')
 *             ]
 *           },
 *           0,
 *           1
 *         ]
 *       }
 *     }
 *   },
 *   {
 *     '$group' : {
 *       '_id' : 'a',
 *       count : { '$sum' : '$myfieldnameExists' }
 *     }
 *   }
 * ]
 * [{
 *   '_id' : 'a',
 *   count : 33
 * }]
 *
 *

 *
 *

 *
 * @see StackOverflow
 *      Question
 *
 * @copyright 2013, Allanbank Consulting, Inc., All Rights Reserved
 */
public class SumIfExists {
    /**
     * The handle to the MongoDB client. We assume MongoDB is running on your
     * machine on the default port of 27017.
     */
    private final static MongoClient client = MongoFactory
            .createClient("mongodb://localhost:27017/");

    /**
     * A source of no so random values. Use a fixed seed to always get the same
     * values for fields.
     */
    private final static Random random = new Random(123456789L);

    /** The collection we will be using. */
    private final static MongoCollection theCollection = client.getDatabase(
            "db").getCollection("collection");

    /**
     * Run the demo.
     *
     * @param args
     *            Command line arguments. Ignored.
     * @throws IOException
     *             On a failure closing the MongoClient.
     */
    public static void main(final String[] args) throws IOException {
        // Build the aggregation document/command.
        final Aggregate.Builder builder = Aggregate.builder();

        // From the StackOverflow Question.
        final String fieldName = "myfieldname";

        // A token ObjectId to use in comparisons for the null field.
        final ObjectId nullToken = new ObjectId();

        builder.project(
                include("a", "b", "c", "etc"),
                set("myfieldnameExists",
                        cond(eq(ifNull(field(fieldName), constant(nullToken)),
                                constant(nullToken)), constant(0), constant(1))));
        builder.group(constantId("a"), set("count").sum("myfieldnameExists"));

        // Print the pipeline for review.
        System.out.println(builder);

        // Insert some documents to test with.
        theCollection.delete(ALL);
        for (int i = 0; i < 99; ++i) {
            final DocumentBuilder doc = BuilderFactory.start();
            if ((i % 3) == 0) {
                doc.addNull(fieldName);
            }
            else if ((i % 3) == 1) {
                doc.add(fieldName, random.nextDouble());
            }
            // else if (i % 3 == 2) -- Field does not exist.

            doc.add("a", random.nextBoolean());
            doc.add("b", random.nextInt());
            doc.add("c", random.nextLong());
            doc.add("etc", random.nextLong());

            theCollection.insert(doc);
        }

        // Run the aggregation.
        System.out.println(theCollection.aggregate(builder).toList());

        // Always remember to close your client!
        client.close();
    }
}


text:
<?php

namespace Application\GlobalBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * StoreInformation
 * @ORM\MappedSuperclass
 */
class BaseFuelStationInformation
{
    /**
     * @var integer
     * @ORM\Column(type="integer")
     */
    protected $dispenserQuantity;

    public function getDispenserQuantity()
    {
        return $this->dispenserQuantity;
    }

    public function setDispenserQuantity($quantity = 0)
    {
        $this->dispenserQuantity = $quantity;

        return $this;
    }

    /**
     * @var integer
     * @ORM\Column(type="string")
     */
    protected $serviceBuildingLocation;

    public function getServiceBuuildingLocation()
    {
        return $this->serviceBuildingLocation;
    }

    public function setServiceBuildingLocation($location = null)
    {
        $this->serviceBuildingLocation = $location;

        return $this;
    }

    /**
     * @var integer
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

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

    public function __construct()
    {
    }
}


text:
```coffee
Store = require "store"
```

### Static Data

`Store` can be used as a static data store.

```coffee
store = Store frozen: yes

store foo: 1

store foo: 2 # This throws an error!
```

### Dynamic Data

`Store` can also be used as a dynamic data store.

A great part about `Store` is the ability to set data using an `Object` literal.

```coffee
store = Store()

store foo: bar: 1

store.foo.bar # 1

store foo: red: 1

store.foo # { bar: 1, red: 1 }
```

### Reactive Data

`Store` uses Meteor's [`ReactiveVar`](https://github.com/aleclarson/reactive-var) to become a reactive data store.

```coffee
store = Store()

Tracker.autorun -> console.log store.foo

# => undefined

store foo: 1

# => 1
```