text:
<!doctype html>

{% load pages_tags mezzanine_tags i18n future staticfiles %}

<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="keywords" content="{% block meta_keywords %}{% endblock %}">
<meta name="description" content="{% block meta_description %}{% endblock %}">
<title>{% block meta_title %}{% endblock %}{% if settings.SITE_TITLE %} | {{ settings.SITE_TITLE }}{% endif %}</title>
<link rel="shortcut icon" href="{% static "img/favicon.ico" %}">

{% compress css %}
<link rel="stylesheet" href="{% static "css/bootstrap.min.css" %}">
<link rel="stylesheet" href="{% static "css/screen.css" %}">
<link rel="stylesheet" href="{% static "css/backgrounds.css" %}">
<link rel="stylesheet" href="{% static "css/animations.css" %}">
<link rel="stylesheet" href="{% static "transitions/css/animations.css" %}">
{% block extra_css %}{% endblock %}
{% endcompress %}

{% compress js %}

{% block extra_js %}{% endblock %}
{% endcompress %}

{% block extra_head %}{% endblock %}

    {% page_menu "pages/menus/dropdown.html" %}

{% block main %}{% endblock %}

  <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
  <input type="hidden" name="cmd" value="_s-xclick">
  <input type="hidden" name="hosted_button_id" value="ARLLTZ8DUJV2L">
  <input type="image" src="/static/img/donate.red.png" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">

  </form>


text:
.bodytypes .allroad
{
    background-image: url(../_common/img/svg/allroad.svg) /* procss.sprite() */;
}

.bodytypes .cabriolet
{
    background-image: url(../_common/img/svg/cabriolet.svg) /* procss.sprite() */;
}

.bodytypes .coupe
{
    background-image: url(../_common/img/svg/coupe.svg) /* procss.sprite() */;
}

.bodytypes .crossover
{
    background-image: url(../_common/img/svg/crossover.svg) /* procss.sprite() */;
}

.bodytypes .hatchback
{
    background-image: url(../_common/img/svg/hatchback.svg) /* procss.sprite() */;
}

.bodytypes .minibus
{
    background-image: url(../_common/img/svg/minibus.svg) /* procss.sprite() */;
}

.bodytypes .miniwen
{
    background-image: url(../_common/img/svg/miniwen.svg) /* procss.sprite() */;
}

.bodytypes .pickup
{
    background-image: url(../_common/img/svg/pickup.svg) /* procss.sprite() */;
}

.bodytypes .sedan
{
    background-image: url(../_common/img/svg/sedan.svg) /* procss.sprite() */;
}

.bodytypes .universal
{
    background-image: url(../_common/img/svg/universal.svg) /* procss.sprite() */;
}

.bodytypes .van
{
    background-image: url(../_common/img/svg/van.svg) /* procss.sprite() */;
}

.bodytypes .man
{
    background-image: url(../_common/img/svg/man.svg) /* procss.sprite() */;
}

redpajama_set_name: RedPajamaGithub


text:
namespace content {

class P2PSocketDispatcher;

class P2PPortAllocator : public cricket::BasicPortAllocator {
 public:
  struct Config {
    // Enable non-proxied UDP-based transport when set to true. When set to
    // false, it effectively disables all UDP traffic until UDP-supporting proxy
    // RETURN is available in the future.
    bool enable_nonproxied_udp = true;

    // Request binding to individual NICs. Whether multiple routes is allowed is
    // subject to the permission check on mic/camera. When specified as false or
    // the permission request is denied, it still uses the default local address
    // to generate a single local candidate. TODO(guoweis): Rename this to
    // |request_multiple_routes|.
    bool enable_multiple_routes = true;

    // Enable exposing the default local address when set to true. This is
    // only in effect when the |enable_multiple_routes| is false or the
    // permission check of mic/camera is denied.
    bool enable_default_local_candidate = true;
  };

  P2PPortAllocator(
      const scoped_refptr<P2PSocketDispatcher>& socket_dispatcher,
      std::unique_ptr<rtc::NetworkManager> network_manager,
      rtc::PacketSocketFactory* socket_factory,
      const Config& config,
      const GURL& origin,
      const scoped_refptr<base::SingleThreadTaskRunner> task_runner);
  ~P2PPortAllocator() override;

 private:
  std::unique_ptr<rtc::NetworkManager> network_manager_;
  scoped_refptr<P2PSocketDispatcher> socket_dispatcher_;
  Config config_;
  GURL origin_;

  // This is the thread |network_manager_| is associated with and must be used
  // to delete |network_manager_|.
  const scoped_refptr<base::SingleThreadTaskRunner>
      network_manager_task_runner_;

  DISALLOW_COPY_AND_ASSIGN(P2PPortAllocator);
};

}  // namespace content

#endif  // CONTENT_RENDERER_P2P_PORT_ALLOCATOR_H_


text:
<?php

class Google_Service_Calendar_EntryPoint extends Google_Collection
{
  protected $collection_key = 'entryPointFeatures';
  public $accessCode;
  public $entryPointFeatures;
  public $entryPointType;
  public $label;
  public $meetingCode;
  public $passcode;
  public $password;
  public $pin;
  public $regionCode;
  public $uri;

  public function setAccessCode($accessCode)
  {
    $this->accessCode = $accessCode;
  }
  public function getAccessCode()
  {
    return $this->accessCode;
  }
  public function setEntryPointFeatures($entryPointFeatures)
  {
    $this->entryPointFeatures = $entryPointFeatures;
  }
  public function getEntryPointFeatures()
  {
    return $this->entryPointFeatures;
  }
  public function setEntryPointType($entryPointType)
  {
    $this->entryPointType = $entryPointType;
  }
  public function getEntryPointType()
  {
    return $this->entryPointType;
  }
  public function setLabel($label)
  {
    $this->label = $label;
  }
  public function getLabel()
  {
    return $this->label;
  }
  public function setMeetingCode($meetingCode)
  {
    $this->meetingCode = $meetingCode;
  }
  public function getMeetingCode()
  {
    return $this->meetingCode;
  }
  public function setPasscode($passcode)
  {
    $this->passcode = $passcode;
  }
  public function getPasscode()
  {
    return $this->passcode;
  }
  public function setPassword($password)
  {
    $this->password = $password;
  }
  public function getPassword()
  {
    return $this->password;
  }
  public function setPin($pin)
  {
    $this->pin = $pin;
  }
  public function getPin()
  {
    return $this->pin;
  }
  public function setRegionCode($regionCode)
  {
    $this->regionCode = $regionCode;
  }
  public function getRegionCode()
  {
    return $this->regionCode;
  }
  public function setUri($uri)
  {
    $this->uri = $uri;
  }
  public function getUri()
  {
    return $this->uri;
  }
}


text:
//-------------------------------------------------------------------------------
// Annotations
//-------------------------------------------------------------------------------

//@Export('ForEachSeriesBuilder')

//@Require('Class')
//@Require('ForEachSeries')
//@Require('IterableFlowBuilder')

//-------------------------------------------------------------------------------
// Context
//-------------------------------------------------------------------------------

require('bugpack').context("*", function(bugpack) {

    //-------------------------------------------------------------------------------
    // BugPack
    //-------------------------------------------------------------------------------

    var Class                   = bugpack.require('Class');
    var ForEachSeries           = bugpack.require('ForEachSeries');
    var IterableFlowBuilder     = bugpack.require('IterableFlowBuilder');

    //-------------------------------------------------------------------------------
    // Declare Class
    //-------------------------------------------------------------------------------

    /**
     * @class
     * @extends {IterableFlowBuilder}
     */
    var ForEachSeriesBuilder = Class.extend(IterableFlowBuilder, {

        _name: "ForEachSeriesBuilder",

        //-------------------------------------------------------------------------------
        // Flow Methods
        //-------------------------------------------------------------------------------

        /**
         * @protected
         * @return {Flow}
         */
        doFactoryFlow: function() {
            return new ForEachSeries(this.getData(), this.getIteratorMethod());
        }
    });

    //-------------------------------------------------------------------------------
    // Export
    //-------------------------------------------------------------------------------

    bugpack.export('ForEachSeriesBuilder', ForEachSeriesBuilder);
});


text:
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <!--
    <services>
        <service id="wlalele_pet_shop.example" class="Wlalele\PetShopBundle\Example">
            <argument type="service" id="service_id" />
            <argument>plain_value</argument>
            <argument>%parameter_name%</argument>
        </service>
    </services>
    -->
</container>


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
        ('users', '0002_auto_20150701_0528'),
    ]

    operations = [
        migrations.AddField(
            model_name='user',
            name='blog_url',
            field=models.URLField(null=True, verbose_name='Blog Profile', blank=True),
        ),
    ]


text:
package alexp.blog.repository;

import alexp.blog.model.Tag;
import org.springframework.data.jpa.repository.JpaRepository;

public interface TagRepository extends JpaRepository<Tag, Long> {

    Tag findByNameIgnoreCase(String name);
}


text:
`deb-fog` is a simple utility to make creating and managing APT repositories on
Cloud object storage platforms.   It is based on a fork of the `deb-s3` repository found [here](https://github.com/krobertson/deb-s3)

Most existing existing guides on using object storage to host an APT repository have you
using something like [reprepro](http://mirrorer.alioth.debian.org/) to generate
the repository file structure, and then [s3cmd](http://s3tools.org/s3cmd) or similar to sync the files to object storage.

The annoying thing about this process is it requires you to maintain a local
copy of the file tree for regenerating and syncing the next time. Personally,
my process is to use one-off virtual machines with
[Vagrant](http://vagrantup.com), script out the build process, and then would
prefer to just upload the final `.deb` from my Mac.

With `deb-fog`, there is no need for this. `deb-fog` features:

* Downloads the existing package manifest and parses it.
* Updates it with the new package, replacing the existing entry if already
  there or adding a new one if not.
* Uploads the package itself, the Packages manifest, and the Packages.gz
  manifest.
* Updates the Release file with the new hashes and file sizes.

## Getting Started

You can simply install it from rubygems:

```console
$ gem install deb-fog
```

Or to run the code directly, just check out the repo and run Bundler to ensure
all dependencies are installed:

```console
$ git clone https://github.com/krobertson/deb-fog.git
$ cd deb-fog
$ bundle install
```

Now to upload a package, simply use:

_this assumes that you have a `~/.fog` file with your provider credentials._

```console
$ deb-fog upload --provider Rackspace --bucket my-bucket my-deb-package-1.0.0_amd64.deb
>> Examining package file my-deb-package-1.0.0_amd64.deb
>> Retrieving existing package manifest
>> Uploading package and new manifests to S3
   -- Transferring pool/m/my/my-deb-package-1.0.0_amd64.deb
   -- Transferring dists/stable/main/binary-amd64/Packages
   -- Transferring dists/stable/main/binary-amd64/Packages.gz
   -- Transferring dists/stable/Release
>> Update complete.
```

```
Usage:
  deb-fog upload FILES

Options:
  -a, [--arch=ARCH]                     # The architecture of the package in the APT repository.
      [--sign=SIGN]                     # Sign the Release file. Use --sign with your key ID to use a specific key.
  -p, [--preserve-versions]             # Whether to preserve other versions of a package in the repository when uploading one.
  -b, [--bucket=BUCKET]                 # The name of the S3 bucket to upload to.
  -c, [--codename=CODENAME]             # The codename of the APT repository.
                                        # Default: stable
  -m, [--component=COMPONENT]           # The component of the APT repository.
                                        # Default: main
      [--access-key-id=ACCESS_KEY]      # The access key or username for
                                        # authenticating with your cloud
                                        # platform
      [--secret-access-key=SECRET_KEY]  # The secret key or API key for
                                        # authenticating with your cloud
                                        # platform
      [--provider=CLOUD_PROVIDER]       # the cloud to connect to Rackspace|AWS
  -v, [--visibility=VISIBILITY]         # The access policy for the uploaded
  files. Can be public, private, or authenticated.
                                        # Default: public

Uploads the given files to a S3 bucket as an APT repository.
```

You can also delete packages from the APT repository. Please keep in mind that
this does NOT delete the .deb file itself, it only removes it from the list of
packages in the specified component, codename and architecture.

Now to delete the package:
```console
$ deb-fog delete --provider Rackspace --arch amd64 --bucket my-bucket --versions 1.0.0 my-deb-package
>> Retrieving existing manifests
   -- Deleting my-deb-package version 1.0.0
>> Uploading new manifests to S3
   -- Transferring dists/stable/main/binary-amd64/Packages
   -- Transferring dists/stable/main/binary-amd64/Packages.gz
   -- Transferring dists/stable/Release
>> Update complete.

````

You can also verify an existing APT repository on S3 using the `verify` command:

```console
deb-fog verify --provider Rackspace -b my-bucket
>> Retrieving existing manifests
>> Checking for missing packages in: stable/main i386
>> Checking for missing packages in: stable/main amd64
>> Checking for missing packages in: stable/main all
```

```
Usage:
  deb-fog verify

Options:
  -f, [--fix-manifests]                 # Whether to fix problems in manifests when verifying.
      [--sign=SIGN]                     # Sign the Release file. Use --sign with your key ID to use a specific key.
  -b, [--bucket=BUCKET]                 # The name of the S3 bucket to upload to.
  -c, [--codename=CODENAME]             # The codename of the APT repository.
                                        # Default: stable
  -m, [--component=COMPONENT]           # The component of the APT repository.
                                        # Default: main
      [--access-key-id=ACCESS_KEY]      # The access key or username for
                                        # authenticating with your cloud
                                        # platform
      [--secret-access-key=SECRET_KEY]  # The secret key or API key for
                                        # authenticating with your cloud
                                        # platform
      [--provider=CLOUD_PROVIDER]       # the cloud to connect to Rackspace|AWS
  -v, [--visibility=VISIBILITY]         # The access policy for the uploaded files. Can be public, private, or authenticated.
                                        # Default: public

Verifies that the files in the package manifests exist
```

## Usage Walkthrough

A typical use of `deb-fog` would be uploading a freshly built `.deb` file ready for consumption.

```
$ sudo gem install fpm
$ sudo gem install deb-fog
$ cd /tmp
$ curl http://download.redis.io/releases/redis-2.8.8.tar.gz | tar xzf -
$ make
$ mkdir -p /tmp/redis-$$/usr/bin
$ mkdir -p /tmp/redis-$$/etc
$ cp redis.conf /tmp/redis-$VERSION.$$/etc/redis.conf
$ cd ..
$ fpm -s dir -t deb -n redis-custom-server -v 2.8.8 -C /tmp/redis-$$/ -p redis-custom-server-2.8.8_amd64.deb usr/bin/
Created deb package {:path=>"redis-custom-server-2.8.8_amd64.deb"}
$ $ deb-fog upload --provider Rackspace --bucket redis redis-custom-server-2.8.8_amd64.deb
>> Retrieving existing manifests
>> Examining package file redis-custom-server-2.8.8_amd64.deb
/usr/bin/dpkg
>> Uploading packages and new manifests to Fog
   -- Transferring pool/r/re/redis-custom-server-2.8.8_amd64.deb
>> Update complete.
```

Using the newly created apt repo:

```
$ echo 'deb http://4ba59f9622d0374c93f0-c4908c782fd10827bfb5ed6c6166b2f3.r15.cf1.rackcdn.com stable main' > /etc/apt/sources.list.d/redis.list
$ sudo apt-get update
$ sudo apt-get install redis-custom-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  redis-custom-server
0 upgraded, 1 newly installed, 0 to remove and 119 not upgraded.
Need to get 666 B of archives.
After this operation, 0 B of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  redis-custom-server
Install these packages without verification [y/N]? y
Get:1 http://4ba59f9622d0374c93f0-c4908c782fd10827bfb5ed6c6166b2f3.r15.cf1.rackcdn.com/ stable/main redis-custom-server amd64 2.8.8 [666 B]
Fetched 666 B in 0s (1,533 B/s)
Selecting previously unselected package redis-custom-server.
(Reading database ... 65707 files and directories currently installed.)
Unpacking redis-custom-server (from .../redis-custom-server_2.8.8_amd64.deb) ...
Setting up redis-custom-server (2.8.8) ...
$
```

## TODO

This is still experimental.  These are several things to be done:

* Don't re-upload a package if it already exists and has the same hashes.


text:
internal abstract class FacadeParameters {
    internal abstract string GetUrl();
}


text:
class Activity {
    public final void runOnUiThread(Runnable action) {
        action.run();
    }
}

public class Foo {
    private Activity activity;

    public void foo() {
        synchronized (this) {
            activity.runOnUiThread(new Runnable() {
                public void run() {
                }
            });
        }
    }

    public void bar() {
        synchronized (this) {
            activity.runOnUiThread(new Runnable() {
                public void run() {
                }
            });
        }
    }
}


text:
import test from 'ava';
test('unicorn', function (t) {
    t.pass();
});
test('rainbow', function (t) {
    t.pass();
});
test.serial('cat', function (t) {
    t.pass();
});
test.todo('dog'); // eslint-disable-line ava/no-todo-test
/* eslint-disable max-statements-per-line, ava/no-inline-assertions */
test('sun', function (t) { return t.pass(); });
test('moon', function (t) {
    t.pass();
});
/* eslint-enable max-statements-per-line, ava/no-inline-assertions */
(function () {
    test('nested call', function (t) {
        t.pass();
    });
})();
//# sourceMappingURL=line-numbers.js.map


text:
package com.twitter.finagle.mux

import com.twitter.finagle.Status
import com.twitter.finagle.stats.{NullStatsReceiver, StatsReceiver}
import com.twitter.finagle.util.{DefaultTimer, Ema}
import com.twitter.util._
import com.twitter.conversions.time._

/**
 * Failure detectors attempt to gauge the liveness of a peer,
 * usually by sending ping messages and evaluating response
 * times.
 */
private trait FailureDetector {
  def status: Status
}

/**
 * The null failure detector is the most conservative: it uses
 * no information, and always gauges the session to be
 * [[Status.Open]].
 */
private object NullFailureDetector extends FailureDetector {
  def status: Status = Status.Open
}

/**
 * The threshold failure detector uses session pings to gauge the health
 * of a peer. It sends ping messages periodically and records their RTTs.
 * These RTTs are averaged over a number of observations.
 *
 * The session is marked [[Status.Busy]] until the first successful ping
 * response has been received.
 *
 * If a ping has been sent and has been outstanding for a time greater
 * than the threshold multiplied by the current exponential moving
 * average, the session is marked as [[Status.Busy]]. It is marked
 * [[Status.Open]] when the ping message returns.
 *
 * If `closeThreshold` is positive and no ping responses has been received
 * during a window of `closeThreshold * ema.last`, then the `close`
 * function is called.
 *
 * This scheme is pretty conservative, but it requires fairly little a priori
 * knowledge: the parameters are used only to tune its sensitivity to
 * history and to bound its failure detection time. The time to detection
 * is bounded by the ping period plus the threshold multiplied by the
 * average ping RTT.
 */
private class ThresholdFailureDetector(
    ping: () => Future[Unit],
    close: () => Future[Unit],
    minPeriod: Duration = 100.milliseconds,
    threshold: Double = 2,
    windowSize: Int = 5,
    closeThreshold: Int = -1,
    nanoTime: () => Long = System.nanoTime,
    statsReceiver: StatsReceiver = NullStatsReceiver,
    implicit val timer: Timer = DefaultTimer.twitter)
  extends FailureDetector {
  private[this] val ema = new Ema(windowSize)
  // The logical clock for EMA measurements. This is accessed
  // by one logical thread, and does not need to be protected.
  private[this] var emaTime = 0L

  // The timestamp of the last ping, in nanoseconds.
  @volatile private[this] var timestamp: Long = 0L

  private[this] val pingLatency = statsReceiver.stat("ping_latency_us")

  private[this] def loop(): Future[Unit] = {
    timestamp = nanoTime()
    val hardTimeout =
      if (closeThreshold > 0)
        if (ema.last > 0) (closeThreshold * ema.last).toInt.nanoseconds
        else minPeriod * threshold * 16 // Arbitrary timeout used for the first ping
      else Duration.Top

    ping().within(hardTimeout) transform {
      case Return(_) =>
        val rtt = nanoTime() - timestamp
        pingLatency.add(rtt.toFloat/1000)
        timestamp = 0L
        emaTime += 1
        ema.update(emaTime, rtt)
        Future.sleep(minPeriod - rtt.nanoseconds) before loop()
      case Throw(_: TimeoutException) =>
        close()
      case Throw(ex) =>
        Future.exception(ex)
    }
  }

  /**
   * The number of nanoseconds pending on the current ping;
   * 0 if no ping is outstanding.
   */
  private[this] def pendingNs(): Long =
    timestamp match {
      case 0 => 0
      case t => nanoTime() - t
    }

  // Note that we assume that the underlying ping() mechanism will
  // simply fail when the accrual detector is no longer required. If
  // ping can fail in other ways, we may fail to do accrual (and indeed
  // be forever stuck).
  loop()

  def status: Status =
    if (ema.isEmpty || pendingNs() > threshold * ema.last) Status.Busy
    else Status.Open
}


text:
<?php

namespace Sylius\Behat\Context\Ui\Admin;

use Behat\Behat\Context\Context;
use Sylius\Behat\NotificationType;
use Sylius\Behat\Page\Admin\Channel\CreatePageInterface;
use Sylius\Behat\Page\Admin\Channel\IndexPageInterface;
use Sylius\Behat\Page\Admin\Channel\UpdatePageInterface;
use Sylius\Behat\Service\Resolver\CurrentPageResolverInterface;
use Sylius\Behat\Service\NotificationCheckerInterface;
use Sylius\Component\Core\Model\ChannelInterface;
use Webmozart\Assert\Assert;

/**
 * @author Łukasz Chruściel <lukasz.chrusciel@lakion.com>
 */
final class ManagingChannelsContext implements Context
{
    /**
     * @var IndexPageInterface
     */
    private $indexPage;

    /**
     * @var CreatePageInterface
     */
    private $createPage;

    /**
     * @var UpdatePageInterface
     */
    private $updatePage;

    /**
     * @var CurrentPageResolverInterface
     */
    private $currentPageResolver;

    /**
     * @var NotificationCheckerInterface
     */
    private $notificationChecker;

    /**
     * @param IndexPageInterface $indexPage
     * @param CreatePageInterface $createPage
     * @param UpdatePageInterface $updatePage
     * @param CurrentPageResolverInterface $currentPageResolver
     * @param NotificationCheckerInterface $notificationChecker
     */
    public function __construct(
        IndexPageInterface $indexPage,
        CreatePageInterface $createPage,
        UpdatePageInterface $updatePage,
        CurrentPageResolverInterface $currentPageResolver,
        NotificationCheckerInterface $notificationChecker
    ) {
        $this->indexPage = $indexPage;
        $this->createPage = $createPage;
        $this->updatePage = $updatePage;
        $this->currentPageResolver = $currentPageResolver;
        $this->notificationChecker = $notificationChecker;
    }

    /**
     * @Given I want to create a new channel
     */
    public function iWantToCreateANewChannel()
    {
        $this->createPage->open();
    }

    /**
     * @When I specify its code as :code
     * @When I do not specify its code
     */
    public function iSpecifyItsCodeAs($code = null)
    {
        $this->createPage->specifyCode($code);
    }

    /**
     * @When I name it :name
     * @When I rename it to :name
     * @When I do not name it
     * @When I remove its name
     */
    public function iNameIt($name = null)
    {
        $this->createPage->nameIt($name);
    }

    /**
     * @When I add it
     * @When I try to add it
     */
    public function iAddIt()
    {
        $this->createPage->create();
    }

    /**
     * @Then the channel :channelName should appear in the registry
     * @Then the channel :channelName should be in the registry
     */
    public function theChannelShouldAppearInTheRegistry($channelName)
    {
        $this->iWantToBrowseChannels();

        Assert::true($this->indexPage->isSingleResourceOnPage(
            ['name' => $channelName]),
            sprintf('Channel with name %s has not been found.', $channelName)
        );
    }

    /**
     * @Then /^(this channel) should still be in the registry$/
     */
    public function thisChannelShouldAppearInTheRegistry(ChannelInterface $channel)
    {
        $this->theChannelShouldAppearInTheRegistry($channel->getName());
    }

    /**
     * @When I describe it as :description
     */
    public function iDescribeItAs($description)
    {
        $this->createPage->describeItAs($description);
    }

    /**
     * @When I set its hostname as :hostname
     */
    public function iSetItsHostnameAs($hostname)
    {
        $this->createPage->setHostname($hostname);
    }

    /**
     * @When I define its color as :color
     */
    public function iDefineItsColorAs($color)
    {
        $this->createPage->defineColor($color);
    }

    /**
     * @When I enable it
     */
    public function iEnableIt()
    {
        $this->updatePage->enable();
    }

    /**
     * @When I disable it
     */
    public function iDisableIt()
    {
        $currentPage = $this->currentPageResolver->getCurrentPageWithForm([$this->createPage, $this->updatePage]);

        $currentPage->disable();
    }

    /**
     * @Then I should be notified that at least one channel has to be defined is required
     */
    public function iShouldBeNotifiedThatAtLeastOneChannelHasToBeDefinedIsRequired()
    {
        $currentPage = $this->currentPageResolver->getCurrentPageWithForm([$this->createPage, $this->updatePage]);

        Assert::true(
            $currentPage->checkValidationMessageFor('enabled', 'Must have at least one enabled entity'),
            sprintf('Channels enabled field should be required.')
        );
    }

    /**
     * @Then channel with :element :value should not be added
     */
    public function channelWithShouldNotBeAdded($element, $value)
    {
        $this->iWantToBrowseChannels();

        Assert::false(
            $this->indexPage->isSingleResourceOnPage([$element => $value]),
            sprintf('Channel with %s "%s" was created, but it should not.', $element, $value)
        );
    }

    /**
     * @Then I should be notified that :element is required
     */
    public function iShouldBeNotifiedThatIsRequired($element)
    {
        $currentPage = $this->currentPageResolver->getCurrentPageWithForm([$this->createPage, $this->updatePage]);

        Assert::true(
            $currentPage->checkValidationMessageFor($element, sprintf('Please enter channel %s.', $element)),
            sprintf('Tax category %s should be required.', $element)
        );
    }

    /**
     * @Given I want to modify a channel :channel
     * @Given /^I want to modify (this channel)$/
     */
    public function iWantToModifyChannel(ChannelInterface $channel)
    {
        $this->updatePage->open(['id' => $channel->getId()]);
    }

    /**
     * @Then /^(this channel) name should be "([^"]+)"$/
     * @Then /^(this channel) should still be named "([^"]+)"$/
     */
    public function thisChannelNameShouldBe(ChannelInterface $channel, $channelName)
    {
        $this->iWantToBrowseChannels();

        Assert::true(
            $this->indexPage->isSingleResourceOnPage(
                [
                    'code' => $channel->getCode(),
                    'name' => $channelName,
                ]
            ),
            sprintf('Channel name %s has not been assigned properly.', $channelName)
        );
    }

    /**
     * @When I save my changes
     * @When I try to save my changes
     */
    public function iSaveMyChanges()
    {
        $this->updatePage->saveChanges();
    }

    /**
     * @Then I should be notified that channel with this code already exists
     */
    public function iShouldBeNotifiedThatChannelWithThisCodeAlreadyExists()
    {
        Assert::true(
            $this->createPage->checkValidationMessageFor('code', 'Channel code has to be unique.'),
            'Unique code violation message should appear on page, but it does not.'
        );
    }

    /**
     * @Then there should still be only one channel with :element :value
     */
    public function thereShouldStillBeOnlyOneChannelWithCode($element, $value)
    {
        $this->iWantToBrowseChannels();

        Assert::true(
            $this->indexPage->isSingleResourceOnPage([$element => $value]),
            sprintf('Channel with %s %s cannot be found.', $element, $value)
        );
    }

    /**
     * @When /^I want to browse channels$/
     */
    public function iWantToBrowseChannels()
    {
        $this->indexPage->open();
    }

    /**
     * @Then I should see :numberOfChannels channels in the list
     */
    public function iShouldSeeChannelsInTheList($numberOfChannels)
    {
        $foundRows = $this->indexPage->countItems();

        Assert::eq(
            (int) $numberOfChannels,
            $foundRows,
            sprintf('%s rows with channels should appear on page, %s rows has been found', $numberOfChannels, $foundRows)
        );
    }

    /**
     * @Then the code field should be disabled
     */
    public function theCodeFieldShouldBeDisabled()
    {
        Assert::true(
            $this->updatePage->isCodeDisabled(),
            'Code should be immutable, but it does not.'
        );
    }

    /**
     * @Then /^(this channel) should be disabled$/
     */
    public function thisChannelShouldBeDisabled(ChannelInterface $channel)
    {
        $this->assertChannelState($channel, false);
    }

    /**
     * @Then /^(this channel) should be enabled$/
     * @Then channel with name :channel should still be enabled
     */
    public function thisChannelShouldBeEnabled(ChannelInterface $channel)
    {
        $this->assertChannelState($channel, true);
    }

    /**
     * @When I delete channel :channel
     */
    public function iDeleteChannel(ChannelInterface $channel)
    {
        $this->indexPage->open();
        $this->indexPage->deleteResourceOnPage(['name' => $channel->getName()]);
    }

    /**
     * @Then the :channelName channel should no longer exist in the registry
     */
    public function thisChannelShouldNoLongerExistInTheRegistry($channelName)
    {
        Assert::false(
            $this->indexPage->isSingleResourceOnPage(['name' => $channelName]),
            sprintf('Channel with name %s exists but should not.', $channelName)
        );
    }

    /**
     * @Then I should be notified that it cannot be deleted
     */
    public function iShouldBeNotifiedThatItCannotBeDeleted()
    {
        $this->notificationChecker->checkNotification(
            "The channel cannot be deleted. At least one enabled channel is required.",
            NotificationType::failure()
        );
    }

    /**
     * @When I make it available in :locale
     */
    public function iMakeItAvailableIn($locale)
    {
        $currentPage = $this->currentPageResolver->getCurrentPageWithForm([$this->createPage, $this->updatePage]);

        $currentPage->chooseLocale($locale);
    }

    /**
     * @Then the channel :channel should be available in :locale
     */
    public function theChannelShouldBeAvailableIn(ChannelInterface $channel, $locale)
    {
        $this->updatePage->open(['id' => $channel->getId()]);

        Assert::true(
            $this->updatePage->isLocaleChosen($locale),
            sprintf('Language %s should be selected but it is not', $locale)
        );
    }

    /**
     * @When I allow for paying in :currencyCode
     */
    public function iAllowToPayingForThisChannel($currencyCode)
    {
        $currentPage = $this->currentPageResolver->getCurrentPageWithForm([$this->createPage, $this->updatePage]);

        $currentPage->chooseCurrency($currencyCode);
    }

    /**
     * @Then paying in :currencyCode should be possible for the :channel channel
     */
    public function payingInEuroShouldBePossibleForTheChannel($currencyCode, ChannelInterface $channel)
    {
        $this->updatePage->open(['id' => $channel->getId()]);

        Assert::true(
            $this->updatePage->isCurrencyChosen($currencyCode),
            sprintf('Currency %s should be selected but it is not', $currencyCode)
        );
    }

    /**
     * @When I select the :shippingMethodName shipping method
     */
    public function iSelectTheShippingMethod($shippingMethodName)
    {
        $currentPage = $this->currentPageResolver->getCurrentPageWithForm([$this->createPage, $this->updatePage]);

        $currentPage->chooseShippingMethod($shippingMethodName);
    }

    /**
     * @Then the :shippingMethodName shipping method should be available for the :channel channel
     */
    public function theShippingMethodShouldBeAvailableForTheChannel($shippingMethodName, ChannelInterface $channel)
    {
        $this->updatePage->open(['id' => $channel->getId()]);

        Assert::true(
            $this->updatePage->isShippingMethodChosen($shippingMethodName),
            sprintf('Shipping method %s should be selected but it is not', $shippingMethodName)
        );
    }

    /**
     * @When I select the :paymentMethodName payment method
     */
    public function iSelectThePaymentMethod($paymentMethodName)
    {
        $currentPage = $this->currentPageResolver->getCurrentPageWithForm([$this->createPage, $this->updatePage]);

        $currentPage->choosePaymentMethod($paymentMethodName);
    }

    /**
     * @Then the :paymentMethodName payment method should be available for the :channel channel
     */
    public function thePaymentMethodShouldBeAvailableForTheChannel($paymentMethodName, ChannelInterface $channel)
    {
        $this->updatePage->open(['id' => $channel->getId()]);

        Assert::true(
            $this->updatePage->isPaymentMethodChosen($paymentMethodName),
            sprintf('Payment method %s should be selected but it is not', $paymentMethodName)
        );
    }

    /**
     * @param ChannelInterface $channel
     * @param bool $state
     */
    private function assertChannelState(ChannelInterface $channel, $state)
    {
        $this->iWantToBrowseChannels();

        Assert::true(
            $this->indexPage->isSingleResourceOnPage(
                [
                    'name' => $channel->getName(),
                    'enabled' => $state,
                ]
            ), sprintf('Channel with name %s and state %s has not been found.', $channel->getName(), $state)
        );
    }
}


text:
//
// any_io_executor.hpp
// ~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef ASIO_ANY_IO_EXECUTOR_HPP
#define ASIO_ANY_IO_EXECUTOR_HPP

#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)

#include "asio/detail/config.hpp"
#if defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
# include "asio/executor.hpp"
#else // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
# include "asio/execution.hpp"
# include "asio/execution_context.hpp"
#endif // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)

#include "asio/detail/push_options.hpp"

namespace asio {

#if defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)

typedef executor any_io_executor;

#else // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)

/// Polymorphic executor type for use with I/O objects.
/**
 * The @c any_io_executor type is a polymorphic executor that supports the set
 * of properties required by I/O objects. It is defined as the
 * execution::any_executor class template parameterised as follows:
 * @code execution::any_executor<
 *   execution::context_as_t<execution_context&>,
 *   execution::blocking_t::never_t,
 *   execution::prefer_only<execution::blocking_t::possibly_t>,
 *   execution::prefer_only<execution::outstanding_work_t::tracked_t>,
 *   execution::prefer_only<execution::outstanding_work_t::untracked_t>,
 *   execution::prefer_only<execution::relationship_t::fork_t>,
 *   execution::prefer_only<execution::relationship_t::continuation_t>
 * > @endcode
 */
class any_io_executor :
#if defined(GENERATING_DOCUMENTATION)
  public execution::any_executor<...>
#else // defined(GENERATING_DOCUMENTATION)
  public execution::any_executor<
      execution::context_as_t<execution_context&>,
      execution::blocking_t::never_t,
      execution::prefer_only<execution::blocking_t::possibly_t>,
      execution::prefer_only<execution::outstanding_work_t::tracked_t>,
      execution::prefer_only<execution::outstanding_work_t::untracked_t>,
      execution::prefer_only<execution::relationship_t::fork_t>,
      execution::prefer_only<execution::relationship_t::continuation_t>
    >
#endif // defined(GENERATING_DOCUMENTATION)
{
public:
#if !defined(GENERATING_DOCUMENTATION)
  typedef execution::any_executor<
      execution::context_as_t<execution_context&>,
      execution::blocking_t::never_t,
      execution::prefer_only<execution::blocking_t::possibly_t>,
      execution::prefer_only<execution::outstanding_work_t::tracked_t>,
      execution::prefer_only<execution::outstanding_work_t::untracked_t>,
      execution::prefer_only<execution::relationship_t::fork_t>,
      execution::prefer_only<execution::relationship_t::continuation_t>
    > base_type;

  typedef void supportable_properties_type(
      execution::context_as_t<execution_context&>,
      execution::blocking_t::never_t,
      execution::prefer_only<execution::blocking_t::possibly_t>,
      execution::prefer_only<execution::outstanding_work_t::tracked_t>,
      execution::prefer_only<execution::outstanding_work_t::untracked_t>,
      execution::prefer_only<execution::relationship_t::fork_t>,
      execution::prefer_only<execution::relationship_t::continuation_t>
    );
#endif // !defined(GENERATING_DOCUMENTATION)

  /// Default constructor.
  ASIO_DECL any_io_executor() ASIO_NOEXCEPT;

  /// Construct in an empty state. Equivalent effects to default constructor.
  ASIO_DECL any_io_executor(nullptr_t) ASIO_NOEXCEPT;

  /// Copy constructor.
  ASIO_DECL any_io_executor(const any_io_executor& e) ASIO_NOEXCEPT;

#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
  /// Move constructor.
  ASIO_DECL any_io_executor(any_io_executor&& e) ASIO_NOEXCEPT;
#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)

  /// Construct to point to the same target as another any_executor.
#if defined(GENERATING_DOCUMENTATION)
  template <class... OtherSupportableProperties>
    any_io_executor(execution::any_executor<OtherSupportableProperties...> e);
#else // defined(GENERATING_DOCUMENTATION)
  template <typename OtherAnyExecutor>
  any_io_executor(OtherAnyExecutor e,
      typename constraint<
        conditional<
          !is_same<OtherAnyExecutor, any_io_executor>::value
            && is_base_of<execution::detail::any_executor_base,
              OtherAnyExecutor>::value,
          typename execution::detail::supportable_properties<
            0, supportable_properties_type>::template
              is_valid_target<OtherAnyExecutor>,
          false_type
        >::type::value
      >::type = 0)
    : base_type(ASIO_MOVE_CAST(OtherAnyExecutor)(e))
  {
  }
#endif // defined(GENERATING_DOCUMENTATION)

  /// Construct a polymorphic wrapper for the specified executor.
#if defined(GENERATING_DOCUMENTATION)
  template <ASIO_EXECUTION_EXECUTOR Executor>
  any_io_executor(Executor e);
#else // defined(GENERATING_DOCUMENTATION)
  template <ASIO_EXECUTION_EXECUTOR Executor>
  any_io_executor(Executor e,
      typename constraint<
        conditional<
          !is_same<Executor, any_io_executor>::value
            && !is_base_of<execution::detail::any_executor_base,
              Executor>::value,
          execution::detail::is_valid_target_executor<
            Executor, supportable_properties_type>,
          false_type
        >::type::value
      >::type = 0)
    : base_type(ASIO_MOVE_CAST(Executor)(e))
  {
  }
#endif // defined(GENERATING_DOCUMENTATION)

  /// Assignment operator.
  ASIO_DECL any_io_executor& operator=(
      const any_io_executor& e) ASIO_NOEXCEPT;

#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
  /// Move assignment operator.
  ASIO_DECL any_io_executor& operator=(
      any_io_executor&& e) ASIO_NOEXCEPT;
#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)

  /// Assignment operator that sets the polymorphic wrapper to the empty state.
  ASIO_DECL any_io_executor& operator=(nullptr_t);

  /// Destructor.
  ASIO_DECL ~any_io_executor();

  /// Swap targets with another polymorphic wrapper.
  ASIO_DECL void swap(any_io_executor& other) ASIO_NOEXCEPT;

  /// Obtain a polymorphic wrapper with the specified property.
  /**
   * Do not call this function directly. It is intended for use with the
   * asio::require and asio::prefer customisation points.
   *
   * For example:
   * @code any_io_executor ex = ...;
   * auto ex2 = asio::require(ex, execution::blocking.possibly); @endcode
   */
  template <typename Property>
  any_io_executor require(const Property& p,
      typename constraint<
        traits::require_member<const base_type&, const Property&>::is_valid
      >::type = 0) const
  {
    return static_cast<const base_type&>(*this).require(p);
  }

  /// Obtain a polymorphic wrapper with the specified property.
  /**
   * Do not call this function directly. It is intended for use with the
   * asio::prefer customisation point.
   *
   * For example:
   * @code any_io_executor ex = ...;
   * auto ex2 = asio::prefer(ex, execution::blocking.possibly); @endcode
   */
  template <typename Property>
  any_io_executor prefer(const Property& p,
      typename constraint<
        traits::prefer_member<const base_type&, const Property&>::is_valid
      >::type = 0) const
  {
    return static_cast<const base_type&>(*this).prefer(p);
  }
};

#if !defined(GENERATING_DOCUMENTATION)

template <>
ASIO_DECL any_io_executor any_io_executor::require(
    const execution::blocking_t::never_t&, int) const;

template <>
ASIO_DECL any_io_executor any_io_executor::prefer(
    const execution::blocking_t::possibly_t&, int) const;

template <>
ASIO_DECL any_io_executor any_io_executor::prefer(
    const execution::outstanding_work_t::tracked_t&, int) const;

template <>
ASIO_DECL any_io_executor any_io_executor::prefer(
    const execution::outstanding_work_t::untracked_t&, int) const;

template <>
ASIO_DECL any_io_executor any_io_executor::prefer(
    const execution::relationship_t::fork_t&, int) const;

template <>
ASIO_DECL any_io_executor any_io_executor::prefer(
    const execution::relationship_t::continuation_t&, int) const;

namespace traits {

#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)

template <>
struct equality_comparable<any_io_executor>
{
  static const bool is_valid = true;
  static const bool is_noexcept = true;
};

#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)

#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)

template <typename F>
struct execute_member<any_io_executor, F>
{
  static const bool is_valid = true;
  static const bool is_noexcept = false;
  typedef void result_type;
};

#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)

#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)

template <typename Prop>
struct query_member<any_io_executor, Prop> :
  query_member<any_io_executor::base_type, Prop>
{
};

#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)

#if !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)

template <typename Prop>
struct require_member<any_io_executor, Prop> :
  require_member<any_io_executor::base_type, Prop>
{
  typedef any_io_executor result_type;
};

#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)

#if !defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT)

template <typename Prop>
struct prefer_member<any_io_executor, Prop> :
  prefer_member<any_io_executor::base_type, Prop>
{
  typedef any_io_executor result_type;
};

#endif // !defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT)

} // namespace traits

#endif // !defined(GENERATING_DOCUMENTATION)

#endif // defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)

} // namespace asio

#include "asio/detail/pop_options.hpp"

#if defined(ASIO_HEADER_ONLY) \
  && !defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
# include "asio/impl/any_io_executor.ipp"
#endif // defined(ASIO_HEADER_ONLY)
       //   && !defined(ASIO_USE_TS_EXECUTOR_AS_DEFAULT)

#endif // ASIO_ANY_IO_EXECUTOR_HPP


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="HandheldFriendly" content="True" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>JXLS - Reporting Excel</title>
    <meta name="description" content="" />
    <link rel="alternate" hreflang="fr" href="http://blog.ellixo.com/" />
    <link href="//fonts.googleapis.com/css?family=Noto+Sans:300,400,700" rel="stylesheet" type="text/css">
    <link href="//fonts.googleapis.com/css?family=Noto+Serif:400,700,400italic" rel="stylesheet" type="text/css">
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
    <link href="//blog.ellixo.com/themes/Ellixo/assets/css/style.css?v=1.0.0" rel="stylesheet" type="text/css">
    <link href="//blog.ellixo.com/themes/Ellixo/assets/css/animate.min.css?v=1.0.0" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/styles/default.min.css">
    <link href="//blog.ellixo.com/themes/Ellixo/favicon.ico" rel="shortcut icon">
    <link rel="canonical" href="http://blog.ellixo.com/2015/09/17/JXLS-Reporting-Excel.html" />

    <meta property="og:site_name" content="Blog Ellixo" />
    <meta property="og:type" content="article" />
    <meta property="og:title" content="JXLS - Reporting Excel" />
    <meta property="og:description" content="JXLS Quand on parle Excel dans le monde Java, on pense tout de suite à l&#8217;acteur historique Apache POI. POI permet depuis de nombreuses années de manipuler les formats Microsoft Office au sein de l'écosystème Java. Le gros..." />
    <meta property="og:url" content="http://blog.ellixo.com/2015/09/17/JXLS-Reporting-Excel.html" />
    <meta property="article:published_time" content="2015-09-16T22:00:00.000Z" />
    <meta property="article:modified_time" content="2015-09-17T23:21:58.473Z" />
    <meta property="article:tag" content="JXLS" />
    <meta property="article:tag" content="Reporting" />
    <meta property="article:tag" content="Jackson" />
    <meta property="article:tag" content="CSV" />
    <meta property="article:tag" content="OpenData" />

    <meta name="twitter:card" content="summary" />
    <meta name="twitter:title" content="JXLS - Reporting Excel" />
    <meta name="twitter:description" content="JXLS Quand on parle Excel dans le monde Java, on pense tout de suite à l&#8217;acteur historique Apache POI. POI permet depuis de nombreuses années de manipuler les formats Microsoft Office au sein de l'écosystème Java. Le gros..." />
    <meta name="twitter:url" content="http://blog.ellixo.com/2015/09/17/JXLS-Reporting-Excel.html" />

    <meta name="generator" content="Ghost ?" />
    <link rel="alternate" type="application/rss+xml" title="Blog Ellixo" href="http://blog.ellixo.com/rss" />
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css">

        Le Blog d'Ellixo

JXLS - Reporting Excel

         <time class="timesince date" data-timesince="1442440800" datetime="2015-09-17T00:00" title="17 September 2015">2015-09-17 00:00:00<ago class="ago"></time>
             JXLS,  Reporting,  Jackson,  CSV,  OpenData
             Grégory Le Bonniec

JXLS

Quand on parle Excel dans le monde Java, on pense tout de suite à l’acteur historique Apache POI. POI permet depuis de nombreuses années de manipuler les formats Microsoft Office au sein de l'écosystème Java. Le gros avantage de POI quand on veut manipuler le format XLS par exemple est son extrême richesse ; pour autant, cette richesse en terme d’API se fait au détriment de la clarté du code : ceux qui ont déjà créé from scratch un fichier Excel via POI savent que le code nécessaire à la génération de ce dernier est extrêmement verbeux et souvent difficilement maintenable.

C’est là que JXLS vient à notre rescousse. En effet, JXLS n’a pas pour objectif de founir une nouvelle API Java MS Office (au contraire même, puisqu’il utilise POI en interne) mais de fournir un outil qui va simplifier la création de rapport Excel en se concentrant uniquement sur les données et le remplissage d’un fichier template standard à l’aide de raccourcis syntaxiques extrêmement puissants.

D’abord, le jeu de données

Pour remplir notre premier fichier via JXLS, nous utiliserons un jeu de données publiques fournis par le site data.gouv.fr[data.gouv.fr] : la base publique de médicaments. Cette base de données permet au grand public et aux professionnels de santé d’accéder à des données et documents de référence sur les médicaments commercialisés ou ayant été commercialisés durant les deux dernières années en France. Et là où cette base se prête bien à l’exercice de reporting Excel, c’est qu’elle est actuellement fournie au format CSV et donc peu lisible et difficilement exploitable en l'état.

Dans le cadre de notre exemple, nous nous concentrerons sur le fichier principal de cette base contenant l’ensemble des médicaments et leurs informations principales (nom, voies d’administration, laboratoire …) : le fichier CIS_bdpm.txt (mise à jour du 04/09/2015 utilisée ici).

La première étape est de transformer chaque ligne du fichier CSV en un objet Java. Pour cela, nous utiliserons la librairie Jackson CSV car oui, Jackson sait aussi faire ça (en plus de JSON bien sûr).

Tout d’abord, définissons un objet Medicament qui portera les données CSV.

@JsonPropertyOrder({"codeCIS", "denomination", "formePharmaceutique", "voiesAdministration", "statutAdministratifAMM", "typeProcedureAMM", "etatCommercialisation", "dateAMM", "statutBDM", "numeroAutorisationEuropeenne", "titulaires", "surveillanceRenforcee"})
public class Medicament {

    private String codeCIS;
    private String denomination;
    private String formePharmaceutique;
    private List<String> voiesAdministration = new ArrayList<>();
    private String statutAdministratifAMM;
    private String typeProcedureAMM;
    private String etatCommercialisation;
    private String dateAMM;
    private String statutBDM;
    private String numeroAutorisationEuropeenne;
    private List<String> titulaires = new ArrayList<>();
    private String surveillanceRenforcee;

    ...

Il ne nous reste plus qu'à lire le fichier CSV et à indiquer à Jackson les informations de mapping pour récupérer la liste complète des médicaments :

CsvMapper mapper = new CsvMapper();

CsvSchema schema = mapper.schemaFor(Medicament.class).withArrayElementSeparator(';').withColumnSeparator('\t');
MappingIterator<Medicament> it = mapper.reader(Medicament.class).with(schema).readValues(JXLS.class.getClassLoader().getResource("CIS_bdpm.txt"));

List<Medicament> medicaments = it.readAll();

Template Excel

Maintenant que nous avons notre jeu de données, nous pouvons maintenant définir notre template Excel. Nous partons simplement d’un fichier Excel "classique" (à quelques détails prês) :

En effet, vous pouvez voir que les cellules censées contenir les données de chaque médicament utilise la syntaxe suivante ${variable.propriete}. Cette syntaxe est connue de JXLS bien sûr et sera utilisée ultérieurement pour remplir le document avec les données finales (vous trouverez le template ici).

Afin de finaliser notre template, nous allons l’enrichir en utilisant un des mécanismes fournis par JXLS pour simplifier la gestion des données : le système de markup. Pour ce faire, Nous allons insérer des metadatas JXLS au sein du template via les commentaires natifs Excel (remarque : les markups JXLS utilise la syntaxe Apache JEXL).

Pour notre besoin, nous n’aurons besoin que de définir 2 markups :

le premier (jx:area(lastCell="L2")) défini la zone d’action de JXLS au sein du template (ici de la cellule A1 à la cellule L2). C’est une étape indispensable afin de permettre à JXLS de manipuler le fichier ; en effet, l’application de Command JXLS (ie. transformation et écriture au sein du fichier) ne peut se faire qu’au sein d’une Area. Il est bien sûr possible de définir plusieurs Areas ou même d’imbriquer des Areas au sein d’un même fichier mais dans notre cas, ça ne sera pas nécessaire.

le deuxième et dernier commentaire (jx:each(items="medicaments" var="medicament" lastCell="L2")) indique à JXLS que nous désirons itérer sur la variable medicaments (ie. liste des médicaments), chaque élément de cette liste est associé à la variable medicament et le mapping de cette dernière avec le template s’applique jusqu'à la cellule L2.

Voilà, notre template est prêt.

Génération du rapport

Il ne nous reste plus qu'à générer le rapport final en faisant le lien entre données et template via l’API JXLS :

AreaBuilder areaBuilder = new XlsCommentAreaBuilder(); // activation de la gestion JXLS des commentaires Excel

try (InputStream is = JXLS.class.getClassLoader().getResourceAsStream("./BDM.xls")) {
    try (OutputStream os = new FileOutputStream("./BDM_result.xls")) {
        Context context = new Context();
        context.putVar("medicaments", medicaments);

        Transformer transformer = TransformerFactory.createTransformer(is, os);

        areaBuilder.setTransformer(transformer);
        List xlsAreaList = areaBuilder.build();
        Iterator iterator = xlsAreaList.iterator();

        while (iterator.hasNext()) {
            Area xlsArea = (Area) iterator.next();
            xlsArea.applyAt(new CellRef(xlsArea.getStartCellRef().getCellName()), context);
        }

        transformer.write();
    }
}

On peut alors lancer la génération du rapport et là normalement…ça ne marche pas ! En effet, il nous reste un dernier point à gérer : l’exécution de la génération du rapport devrait vous donner en l'état l’exception suivante :

java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String

Le problème vient de notre objet Medicament. Ce dernier fournit 2 propriétés (voiesAdministration et titulaires) qui ne sont pas des types simples et donc non gérés par JXLS.

Pour ce genre de cas, il possible de fournir des fonctions custom qui vont transformer nos propriétés au bon format. Pour ce faire, nous allons tout d’abord définir une classe transformant notre liste d’objets en chaîne :

public static class ListUtil {

    public String join(List list) {
        StringBuilder builder = new StringBuilder();
        for (Object o : list) {
            if (builder.length() != 0) {
                builder.append(" / ");
            }
            builder.append(o);
        }
        return builder.toString();
    }

}

Puis pour utiliser cette fonction dans notre template, il est nécessaire de la référencer au sein du Transformer JXSL :

...
JexlExpressionEvaluator evaluator = (JexlExpressionEvaluator) transformer.getTransformationConfig().getExpressionEvaluator();
Map<String, Object> functionMap = new HashMap<>();
functionMap.put("joiner", new ListUtil());
evaluator.getJexlEngine().setFunctions(functionMap);
...

Pour utiliser notre fonction, il nous suffit alors de modifier, par exemple pour la liste des titulaires, le contenu de la cellule correspondante de ${medicament.titulaires} à ${joiner:join(medicament.titulaires)}.

Et si nous relançons la génération du rapport, cette fois-ci, cela passe sans problème :

Conclusion

La génération de rapport Excel est un besoin très courant et souvent stratégique pour les utilisateurs finaux, pourtant, il s’agit rarement du sujet le plus passionnant au sein d’un projet pour les développeurs. C’est en cela que JXLS est vraiment intéressant ; par sa simplicité et sa rapidité de mise en oeuvre, cette librairie vous fera gagner énormément de temps pour la mise en oeuvre de votre moteur de reporting Excel.

Les sources de cet article sont disponibles sur le Repository GitHub Ellixo - pour information, le fichier CIS_bdpm.txt n’est pas fourni dans le repository afin de ne pas stocker de données obsolètes : vous pourrez récupérer le fichier sur le site dédié.

Laisser un commentaire

          Please enable JavaScript to view the comments powered by Disqus.
          comments powered by Disqus

Copyright © Ellixo All Rights Reserved - Published with HubPress

            Accueil Ellixo - Mentions Légales


text:
import {Component} from '@angular/core';
import {FormControl, Validators} from '@angular/forms';

const EMAIL_REGEX = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;

/**
 * @title Input Errors
 */
@Component({
  selector: 'input-errors-example',
  templateUrl: 'input-errors-example.html',
  styleUrls: ['input-errors-example.css'],
})
export class InputErrorsExample {

  emailFormControl = new FormControl('', [
    Validators.required,
    Validators.pattern(EMAIL_REGEX)]);

}


text:
responsive Chart.js
=======
This distribution extending Chart.js capability by adding responsive feature.
Whole tribute and source of Chart.js can be download and update on its origin [repository](https://github.com/nnnick/Chart.js "Chart JS") + [documentation](http://www.chartjs.org/docs/ "Chart JS Documentation")

i'am wrap this feature in file chartjs-option.js through function

	respChart(selector,data)

Setting
------
1. Import Chart.js source at the first place. i recomended the head.js power to doing this
2. Import chartjs-option.js after step 1 declaration and make sure that this part only be execute after Chart.js ready.
3. Create a canvas and make sure it has container.

		...
		<canvas class="myChart" width="800" ></canvas>
		...

4. Prepare your data

		<script>
		...
		var data = {
			labels : ["January","February","March","April","May","June","July"],
			datasets : [
				{
					fillColor : "rgba(151,187,205,0.5)",
					strokeColor : "rgba(151,187,205,1)",
					pointColor : "rgba(151,187,205,1)",
					pointStrokeColor : "#fff",
					data : [28,48,40,19,96,27,100]
				}
			]
		};
		...

5. Call the extended function

		respChart($(".myChart"),data);

6. Enjoy your responsive chart


text:
/* Watchdog Related Defines */

#define ADDIDATA_TIMER			0
#define ADDIDATA_WATCHDOG		2

/*
 * (*insn_config) for the timer subdevice
 *
 * Configures The Timer, Counter or Watchdog
 * Data Pointer contains configuration parameters as below
 *	data[0] : 0 Configure As Timer
 *		  1 Configure As Counter
 *		  2 Configure As Watchdog
 *	data[1] : 1 Enable  Interrupt
 *		  0 Disable Interrupt
 *	data[2] : Time Unit
 *	data[3] : Reload Value
 */
static int apci3501_config_insn_timer(struct comedi_device *dev,
				      struct comedi_subdevice *s,
				      struct comedi_insn *insn,
				      unsigned int *data)
{
	struct apci3501_private *devpriv = dev->private;
	unsigned int ctrl;

	if (data[0] != ADDIDATA_WATCHDOG &&
	    data[0] != ADDIDATA_TIMER)
		return -EINVAL;

	devpriv->tsk_Current = current;

	devpriv->timer_mode = data[0];

	/* first, disable the watchdog or stop the timer */
	if (devpriv->timer_mode == ADDIDATA_WATCHDOG) {
		ctrl = 0;
	} else {
		ctrl = inl(devpriv->tcw + ADDI_TCW_CTRL_REG);
		ctrl &= ~(ADDI_TCW_CTRL_GATE | ADDI_TCW_CTRL_TRIG |
			  ADDI_TCW_CTRL_ENA);
	}
	outl(ctrl, devpriv->tcw + ADDI_TCW_CTRL_REG);

	/* enable/disable the timer interrupt */
	ctrl = (data[1] == 1) ? ADDI_TCW_CTRL_IRQ_ENA : 0;
	outl(ctrl, devpriv->tcw + ADDI_TCW_CTRL_REG);

	outl(data[2], devpriv->tcw + ADDI_TCW_TIMEBASE_REG);
	outl(data[3], devpriv->tcw + ADDI_TCW_RELOAD_REG);

	ctrl = inl(devpriv->tcw + ADDI_TCW_CTRL_REG);
	if (devpriv->timer_mode == ADDIDATA_WATCHDOG) {
		/* Set the mode (e2->e0) NOTE: this doesn't look correct */
		ctrl |= ~(ADDI_TCW_CTRL_CNT_UP | ADDI_TCW_CTRL_EXT_CLK_MASK |
			  ADDI_TCW_CTRL_MODE_MASK | ADDI_TCW_CTRL_GATE |
			  ADDI_TCW_CTRL_TRIG | ADDI_TCW_CTRL_TIMER_ENA |
			  ADDI_TCW_CTRL_RESET_ENA | ADDI_TCW_CTRL_WARN_ENA |
			  ADDI_TCW_CTRL_IRQ_ENA | ADDI_TCW_CTRL_ENA);
	} else {
		/* mode 2 */
		ctrl &= ~(ADDI_TCW_CTRL_CNTR_ENA | ADDI_TCW_CTRL_MODE_MASK |
			  ADDI_TCW_CTRL_GATE | ADDI_TCW_CTRL_TRIG |
			  ADDI_TCW_CTRL_TIMER_ENA | ADDI_TCW_CTRL_RESET_ENA |
			  ADDI_TCW_CTRL_WARN_ENA | ADDI_TCW_CTRL_ENA);
		ctrl |= ADDI_TCW_CTRL_MODE(2) | ADDI_TCW_CTRL_TIMER_ENA;
	}
	outl(ctrl, devpriv->tcw + ADDI_TCW_CTRL_REG);

	return insn->n;
}

/*
 * (*insn_write) for the timer subdevice
 *
 * Start / Stop The Selected Timer , Counter or Watchdog
 * Data Pointer contains configuration parameters as below
 *	data[0] : 0 Timer
 *		  1 Counter
 *		  2 Watchdog
 *	data[1] : 1 Start
 *		  0 Stop
 *		  2 Trigger
 */
static int apci3501_write_insn_timer(struct comedi_device *dev,
				     struct comedi_subdevice *s,
				     struct comedi_insn *insn,
				     unsigned int *data)
{
	struct apci3501_private *devpriv = dev->private;
	unsigned int ctrl;

	if (devpriv->timer_mode == ADDIDATA_WATCHDOG ||
	    devpriv->timer_mode == ADDIDATA_TIMER) {
		ctrl = inl(devpriv->tcw + ADDI_TCW_CTRL_REG);
		ctrl &= ~(ADDI_TCW_CTRL_GATE | ADDI_TCW_CTRL_TRIG);

		if (data[1] == 1) {		/* enable */
			ctrl |= ADDI_TCW_CTRL_ENA;
		} else if (data[1] == 0) {	/* stop */
			if (devpriv->timer_mode == ADDIDATA_WATCHDOG)
				ctrl = 0;
			else
				ctrl &= ~ADDI_TCW_CTRL_ENA;
		} else if (data[1] == 2) {	/* trigger */
			ctrl |= ADDI_TCW_CTRL_TRIG;
		}
		outl(ctrl, devpriv->tcw + ADDI_TCW_CTRL_REG);
	}

	inl(devpriv->tcw + ADDI_TCW_STATUS_REG);
	return insn->n;
}

/*
 * (*insn_read) for the timer subdevice
 *
 * Read The Selected Timer, Counter or Watchdog
 * Data Pointer contains configuration parameters as below
 *	data[0] : 0 Timer
 *		  1 Counter
 *		  2 Watchdog
 *	data[1] : Timer Counter Watchdog Number
 */
static int apci3501_read_insn_timer(struct comedi_device *dev,
				    struct comedi_subdevice *s,
				    struct comedi_insn *insn,
				    unsigned int *data)
{
	struct apci3501_private *devpriv = dev->private;

	if (devpriv->timer_mode != ADDIDATA_TIMER &&
	    devpriv->timer_mode != ADDIDATA_WATCHDOG)
		return -EINVAL;

	data[0] = inl(devpriv->tcw + ADDI_TCW_STATUS_REG) &
		  ADDI_TCW_STATUS_OVERFLOW;
	data[1] = inl(devpriv->tcw + ADDI_TCW_VAL_REG);

	return insn->n;
}


text:
This tool allows you to manage any ARK: Survival Evolved linux server without having to remember long commands.
It provides a lot of features, to get the full list check the **Commands** section on the bottom of this page.

## Pre-requisites

To install ARK Server Tools you must have already installed **SteamCMD** following this guide:

https://developer.valvesoftware.com/wiki/SteamCMD#Linux

We assume you have created the `steam` user to store steamcmd and your ARK server.

## Requirements

To allow your ARK server to communicate with the outside you have to open some ports in your firewall:

```sh
iptables -I INPUT -p udp --dport 27016 -j ACCEPT
iptables -I INPUT -p tcp --dport 27016 -j ACCEPT
iptables -I INPUT -p udp --dport 7778 -j ACCEPT
iptables -I INPUT -p tcp --dport 7778 -j ACCEPT
iptables -I INPUT -p tcp --dport 32330 -j ACCEPT
```

NB: Change the ports according to the ones set in your `arkmanager.cfg` file.

## Install ARK Server Tools

To install ARK Server Tools run this command:

```sh
curl -sL http://git.io/vtf5N | sudo bash -s steam
```

NB: You may want to change the `bash -s` parameter to fit your steam user if different from `steam`.

This will copy the `arkmanager` script and its daemon to the proper directories and will create an empty log directory in `/var/log` for ARK Server Tools.

## Configuration

Stored in `/etc/arkmanager/arkmanager.cfg` you can find the variables needed to start the server, like the port numbers, the system environment variables and so on.

Also, in this file, you can specify any parameter you want to add to the startup command of ARK server.
These parameters must be prefixed by the `ark_` string, some example could be:

```sh
ark_SessionName="My ARK server"
ark_MaxPlayers=50
ark_ServerPVE=False
ark_DifficultyOffset=1
```

Your session name may not contain special characters (eg. `!![EU]!! Aw&some ARK`) as it could break the startup command.
In this case you may want to comment out the `ark_SessionName` variable and define it inside your **GameUserSettings.ini** file instead.

You can override or add variables for a specific system user creating a file called `.arkmanager.cfg` in the home directory of the system user.

## Install ARK Server

To install ARK Server just run this command as normal user:

```sh
arkmanager install
```
## Commands

To get a complete list of the script commands you can run `arkmanager --help` or `arkmanager -h`.

#### arkmanager install
installs arkmanager to the directory specified in `/etc/arkmanager/arkmanager.cfg` or `~/.arkmanager.cfg`.

#### arkmanager start
starts ARK server

#### arkmanager stop
stops ARK server

#### arkmanager restart
restarts ARK server

#### arkmanager update
manually updates ARK server if a new version is available

#### arkmanager update --force
Apply update without check the current version

#### arkmanager update --safe
Waits for server to perform world save and then updates.

#### arkmanager status
Get the status of the server. Show if the process is running, if the server is up and the current version number

#### arkmanager checkupdate
Check if a new version of the server is available but not apply it

#### arkmanager upgrade
Check for a new ARK Server Tools version and upgrades it if needed

#### arkmanager backup
Saves a backup of your server inside the backup directory

## Credits

Original author of arkmanager: LeXaT


text:
layout: docs
title: Custom Configuration
---

## Custom Streams Configuration

Sometimes you need to pass a custom configuration to Kafka Streams:

    import com.madewithtea.mockedstreams.MockedStreams

      val props = new Properties
      props.put(StreamsConfig.DEFAULT_TIMESTAMP_EXTRACTOR_CLASS_CONFIG, classOf[CustomExtractor].getName)

      val mstreams = MockedStreams()
      .topology { builder => builder.stream(...) [...] } // Scala DSL
      .config(props)
      .input("in-a", strings, ints, inputA)
      .input("in-b", strings, ints, inputB)
      .stores(Seq("store-name"))

    mstreams.output("out-a", strings, ints) shouldEqual(expectedA)
    mstreams.output("out-b", strings, ints) shouldEqual(expectedB)


text:
.. _ref-kalman-smoother:

Kalman smoother
---------------

Note that this class inherits from :ref:`ref-kalman-filter`; its
documentation should be consulted for additional methods available in
``KalmanSmoother`` objects.

.. currentmodule:: dismalpy.ssm.kalman_smoother

.. autoclass:: KalmanSmoother
   :members:

.. autoclass:: SmootherResults
   :members:


text:
package com.dafelo.co.casona.internal.di.modules;

import android.content.Context;

import com.dafelo.co.casona.Casona;
import com.dafelo.co.casona.main.domain.threads.NewThread;
import com.dafelo.co.casona.main.domain.threads.UIThread;
import com.dafelo.co.casona.main.domain.schedulers.ObserveOn;
import com.dafelo.co.casona.main.domain.schedulers.SubscribeOn;
import com.dafelo.co.casona.order_detail.data.repository.MenuDataRepository;
import com.dafelo.co.casona.order_detail.data.repository.OrderDataRepository;
import com.dafelo.co.casona.order_detail.domain.usecase.MenuRepository;
import com.dafelo.co.casona.order_detail.domain.usecase.OrderRepository;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

@Module
public class ApplicationModule {
    private final Casona application;

    public ApplicationModule(Casona application) {
        this.application = application;
    }

    @Provides
    @Singleton
    Context provideApplicationContext() {
        return this.application;
    }

    @Provides
    @Singleton
    ObserveOn provideObserveOn(UIThread observeOn) {
        return observeOn;
    }

    @Provides
    @Singleton
    SubscribeOn provideSubscribeOn(NewThread subscribeOn) {
        return subscribeOn;
    }

    @Provides @Singleton
    MenuRepository provideMenuRepository(MenuDataRepository menuDataRepository) {
        return menuDataRepository;
    }

    @Provides @Singleton
    OrderRepository provideOrderRepository(OrderDataRepository orderDataRepository) {
        return orderDataRepository;
    }

}


text:
package edu.gatech.oad.antlab.pkg1;

/**
 * CS2340 Ant Lab
 *
 * AntLab11.java helper class
 * @author Robert
 * @version 1.0
 */
 public class AntLab11 {

   /**
    * retrieves a pre-stored string message
    * @return the string
    */
    public String getMessage() {
        return "Congrats!";
    }

 }


text:
CIvfMainFrame::CIvfMainFrame(void)
{
}

CIvfMainFrame::~CIvfMainFrame(void)
{
}

void
CIvfMainFrame::IvfOnCreate(CWnd * window) // virtual
{
}

BOOL
CIvfMainFrame::IvfOnCommand(WPARAM wparam, LPARAM lparam) // virtual
{
  return FALSE;
}

BOOL
CIvfMainFrame::IvfOnQueryNewPalette(void) // virtual
{
  return FALSE;
}

void
CIvfMainFrame::IvfSetViewerText(CString & text) // virtual
{
}

// *************************************************************************

void
CIvfMainFrame::IvfOnPaletteChanged(CWnd * focuswindow) // virtual
{
}

BOOL
CIvfMainFrame::IvfPreCreateWindow(CREATESTRUCT & cs, UINT x, UINT y) // virtual
{
  return FALSE;
}

BOOL
CIvfMainFrame::IvfOnUpdateFrameTitle(BOOL addtotitle, CString & title) // virtual
{
  return FALSE;
}

// *************************************************************************


text:
import app from './app';
import rooms from './rooms';

export default { app, rooms };


text:
package distributor

import (
	"io"
	"math/rand"
	"time"

	"github.com/coreos/torus"
	"github.com/coreos/torus/models"
)

// Goroutine which watches for new rings and kicks off
// the rebalance dance.
func (d *Distributor) ringWatcher(closer chan struct{}) {
	ch := make(chan torus.Ring)
	d.srv.MDS.SubscribeNewRings(ch)
exit:
	for {
		select {
		case <-closer:
			d.srv.MDS.UnsubscribeNewRings(ch)
			close(ch)
			break exit
		case newring, ok := <-ch:
			if ok {
				if newring.Version() == d.ring.Version() {
					// No problem. We're seeing the same ring.
					continue
				}
				if newring.Version() < d.ring.Version() {
					panic("replacing old ring with ring in the past!")
				}
				d.mut.Lock()
				d.ring = newring
				d.mut.Unlock()
			} else {
				break exit
			}
		}
	}
}

func (d *Distributor) rebalanceTicker(closer chan struct{}) {
	n := 0
	total := 0
	time.Sleep(time.Duration(250+rand.Intn(250)) * time.Millisecond)
exit:
	for {
		clog.Tracef("starting rebalance/gc cycle")
		volset, _, err := d.srv.MDS.GetVolumes()
		if err != nil {
			clog.Error(err)
		}
		for _, x := range volset {
			err := d.rebalancer.PrepVolume(x)
			if err != nil {
				clog.Errorf("gc prep for %s failed: %s", x.Name, err)
			}
		}
	ratelimit:
		for {
			timeout := 2 * time.Duration(n+1) * time.Millisecond
			select {
			case <-closer:
				break exit
			case <-time.After(timeout):
				written, err := d.rebalancer.Tick()
				if d.ring.Version() != d.rebalancer.VersionStart() {
					// Something is changed -- we are now rebalancing
					d.rebalancing = true
				}
				info := &models.RebalanceInfo{
					Rebalancing: d.rebalancing,
				}
				total += written
				info.LastRebalanceBlocks = uint64(total)
				if err == io.EOF {
					// Good job, sleep well, I'll most likely rebalance you in the morning.
					info.LastRebalanceFinish = time.Now().UnixNano()
					total = 0
					finishver := d.rebalancer.VersionStart()
					if finishver == d.ring.Version() {
						d.rebalancing = false
						info.Rebalancing = false
					}
					d.srv.UpdateRebalanceInfo(info)
					break ratelimit
				} else if err != nil {
					// This is usually really bad
					clog.Error(err)
				}
				n = written
				d.srv.UpdateRebalanceInfo(info)
			}
		}
		time.Sleep(time.Duration(rand.Intn(3)) * time.Second)
		d.rebalancer.Reset()
	}
}


text:
define(function (require) {
  require('ui/modules')
    .get('kibana')
    .filter('uriescape', function () {
      return function (str) {
        return encodeURIComponent(str);
      };
    });
});


text:
using namespace gl;

namespace globjects
{

AbstractUniformImplementation::AbstractUniformImplementation()
{
}

AbstractUniformImplementation::~AbstractUniformImplementation()
{
}

AbstractUniformImplementation * AbstractUniformImplementation::get(const AbstractUniform::BindlessImplementation impl)
{
    if (impl == AbstractUniform::BindlessImplementation::SeparateShaderObjectsARB
     && hasExtension(GLextension::GL_ARB_separate_shader_objects))
    {
        return UniformImplementation_SeparateShaderObjectsARB::instance();
    }
    else
    {
        return UniformImplementation_Legacy::instance();
    }
}

void AbstractUniformImplementation::set(const Program* program, GLint location, const TextureHandle & value) const
{
    set(program, location, value.handle());
}

void AbstractUniformImplementation::set(const Program* program, GLint location, const std::vector<TextureHandle> & value) const
{
    set(program, location, std::vector<GLuint64>{ value.begin(), value.end() });
}

} // namespace globjects


text:
// This file uses a static constructor to automatically register all of the
// kernels in this directory.  This can be used to simplify clients that don't
// care about selective registration of kernels. This file also registers
// a conversion function for RuntimeFallbackTensors.

#include "tensorflow/core/runtime_fallback/runtime/conversion_function.h"
#include "tfrt/host_context/kernel_registry.h"  // from @tf_runtime
#include "tfrt/tensor/conversion_registry.h"  // from @tf_runtime

namespace tensorflow {
namespace tfd {

void RegisterTfdDelegateKernels(::tfrt::KernelRegistry* registry);

TFRT_STATIC_KERNEL_REGISTRATION(RegisterTfdDelegateKernels);

static bool runtime_fallback_conversion_fn_registration = []() {
  tfrt::AddStaticTensorConversionFn(
      RegisterTFRuntimeFallbackTensorToHostConversionFn);
  return true;
}();

}  // namespace tfd
}  // namespace tensorflow


text:
"""
Created on Wed Mar  1 14:35:26 2017

@author: picku

This code carries out multifractal detrended fluctuation analysis (MF-DFA) as
described in:

Kantelhardt, Jan W., et al. "Multifractal detrended fluctuation analysis of
nonstationary timer series." Physica A: Statistical Mechanics and its Applications
316.1 (2002): 87-114

Unlike standard DFA, which is used to analyze (mono-) fractal scaling properties
of nonstationary time series, MF-DFA allows for analysis of multi-fractal
nonstationary time series using one additional step - a q dependent averaging
procedure - where q = 2 performs the standard DFA procedure developed in:

Peng, C-K., et al. "Quantification of scaling exponents and crossover phenomena
in nonstationary heartbeat time series." Chaos: An Interdisciplinary Journal of
Nonlinear Science 5.1 (1995): 82-87

Characterizing the short- and long-range correrlation properties of the RR interval
time series (a non-stationary physiological signal) is helpful in determining
fluctuations due to the intrinsic dynamics of the cardio-respiratory system itself
and those fluctuations that arise from external (environmental) stimuli. The scaling
exponent, alpha, can be used to represent the autocorrelatin properties of the signal:

alpha < 1/2 : anti-correlated
alpha = 1/2 : uncorrelated (white noise)
alpha > 1/2 : correlated
alpha = 1   : 1/f-noise
alpha > 1   : non-stationary
alpha = 3/2 : Brownian noise (random walk)

"""
import numpy as np
import matplotlib.pyplot as plt

def dfa(timeSeries, scale, q, m):
    '''
    Input Arguments  :

        -timeSeries  : [list] of RR intervals
        -scale       : [int]
        -m           : [int] order of polynomial fit
        -q           : [int] order of fluctuation coefficient

    Output Arguments:

        -F           : [float] fluctuation coefficient

    '''
    if len(timeSeries) < scale:
        print('Length of time series must be greater than scale')

    else:
        #Step(1): Determine the "profile" (integrated signal with subtracted offset)
        integratedSeries = np.cumsum(timeSeries - np.mean(timeSeries)) #y_k

        #Step(2): Divide profile into N non-overlapping segments of equal length s
        shape = (int(integratedSeries.shape[0]) // int(scale), int(scale))
        nwLength = shape[0] * shape[1]
        windowedData = np.reshape(integratedSeries[0:int(nwLength)], shape)

        #repeate same procedure from opposite end of integrated series
        windowedData2 = np.reshape(integratedSeries[len(integratedSeries) - int(nwLength):], shape)

        segments = np.concatenate((windowedData, windowedData2))
        #Step(3): Calculate local trend for each 2Ns segments by a least squares fit of the series.
        #Then determine the variance for each segment v, v = 1,...,Ns
        x = np.arange(segments.shape[1])
        rms = np.empty(segments.shape[0])

        for i, segment in enumerate(segments):

            pl = np.polyfit(x, segment, m)
            y_n = np.polyval(pl, x)
            rms[i] = np.sqrt(np.mean((segment - y_n) ** 2))

        #(Step 4): Average over all segments to obtain the qth order fluctuation coefficient
        F = np.mean(rms ** q) ** (1 / q)

        return F

def scalingExponent(timeSeries, lowerScaleLimit, upperScaleLimit, scaleDensity, m, q, plot):
    '''
    Input Arguments   :

    - timeSeries      : [list] of RR intervals
    - lowerScaleLimit : [int] minimum of scales for MF-DFA
    - upperScaleLimit : [int] maximum of scales for MF-DFA
    - scaleDensity    : [int] number of scales between lowerScaleLimit and upperScaleLimit in which DFA is conducted
    - m               : [int] order of polynomial fit
    - q               : [int] order of fluctuation coefficient
    - plot            : [1] --> plot of log(scales) vs log(F)

    Output Arguments  :

    - H               : [float] scaling exponent

    '''
    startBeatNum = np.log(lowerScaleLimit) / np.log(10)
    stopBeatNum = np.log(upperScaleLimit) / np.log(10)

    scales = np.floor(np.logspace(np.log10(10 ** startBeatNum), np.log10(10 ** stopBeatNum), scaleDensity))

    F = np.zeros(scales.shape[0])

    for j,scale in enumerate(scales):
        F[j] = dfa(timeSeries, int(scale), q, m)  #timeSeries = RR series to be analyzed

    #Step(5) Determine scale behavior of the fluctuation functions by analyzing
    #log-log plots of F versus s for each value of q
    pl2 = np.polyfit(np.log2(scales), np.log2(F), 1) #m = 1 ---> linear fit
    lineFit = np.polyval(pl2, np.log2(scales))

    scaleParameter = pl2[0] #Finding scaling exponent (Hurst exponent = h(m = 2))

    if plot == 1:

        plt.loglog(scales, F, '.', markersize = 3)
        plt.plot(scales, 2 ** lineFit, linewidth = 1, label = r'$\alpha$ = %0.2f' % (scaleParameter))
        plt.xlabel(r'$\log_{10}$(scale)')
        plt.ylabel(r'$\log_{10}$(F)')
        plt.title('F vs Scale')
        plt.legend(loc='best')


text:
set -e
/handler/install.py
/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        ('payment', '__first__'),
        ('shipping', '__first__'),
        ('core', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Criterion',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('content_id', models.PositiveIntegerField(verbose_name='Content id')),
                ('sub_type', models.CharField(max_length=100, verbose_name='Sub type', blank=True)),
                ('position', models.PositiveIntegerField(default=999, verbose_name='Position')),
                ('operator', models.PositiveIntegerField(null=True, verbose_name='Operator', blank=True)),
            ],
            options={
                'ordering': ('position',),
            },
        ),
        migrations.CreateModel(
            name='CartPriceCriterion',
            fields=[
                ('criterion_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='criteria.Criterion')),
                ('value', models.FloatField(default=0.0, verbose_name='Price')),
            ],
            bases=('criteria.criterion',),
        ),
        migrations.CreateModel(
            name='CombinedLengthAndGirthCriterion',
            fields=[
                ('criterion_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='criteria.Criterion')),
                ('value', models.FloatField(default=0.0, verbose_name='CLAG')),
            ],
            bases=('criteria.criterion',),
        ),
        migrations.CreateModel(
            name='CountryCriterion',
            fields=[
                ('criterion_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='criteria.Criterion')),
                ('value', models.ManyToManyField(to='core.Country', verbose_name='Countries')),
            ],
            bases=('criteria.criterion',),
        ),
        migrations.CreateModel(
            name='HeightCriterion',
            fields=[
                ('criterion_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='criteria.Criterion')),
                ('value', models.FloatField(default=0.0, verbose_name='Height')),
            ],
            bases=('criteria.criterion',),
        ),
        migrations.CreateModel(
            name='LengthCriterion',
            fields=[
                ('criterion_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='criteria.Criterion')),
                ('value', models.FloatField(default=0.0, verbose_name='Length')),
            ],
            bases=('criteria.criterion',),
        ),
        migrations.CreateModel(
            name='PaymentMethodCriterion',
            fields=[
                ('criterion_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='criteria.Criterion')),
                ('value', models.ManyToManyField(to='payment.PaymentMethod', verbose_name='Payment methods')),
            ],
            bases=('criteria.criterion',),
        ),
        migrations.CreateModel(
            name='ShippingMethodCriterion',
            fields=[
                ('criterion_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='criteria.Criterion')),
                ('value', models.ManyToManyField(to='shipping.ShippingMethod', verbose_name='Shipping methods')),
            ],
            bases=('criteria.criterion',),
        ),
        migrations.CreateModel(
            name='WeightCriterion',
            fields=[
                ('criterion_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='criteria.Criterion')),
                ('value', models.FloatField(default=0.0, verbose_name='Weight')),
            ],
            bases=('criteria.criterion',),
        ),
        migrations.CreateModel(
            name='WidthCriterion',
            fields=[
                ('criterion_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='criteria.Criterion')),
                ('value', models.FloatField(default=0.0, verbose_name='Width')),
            ],
            bases=('criteria.criterion',),
        ),
        migrations.AddField(
            model_name='criterion',
            name='content_type',
            field=models.ForeignKey(related_name='content_type', verbose_name='Content type', to='contenttypes.ContentType'),
        ),
    ]


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CommandLine;
using CommandLine.Text;

namespace Baker
{
    class Options
    {
        [Option('s', "serve", Required = false, HelpText = "Starts a development in-process web server and builds the project with live-reload.")]
        public string Serve { get; set; }

        [Option('b', "bake", Required = false, HelpText = "Builds an optimized version of the static website.")]
        public string Bake { get; set; }

        [ParserState]
        public IParserState LastParserState { get; set; }

        [HelpOption]
        public string GetUsage()
        {
            return HelpText.AutoBuild(this,
              (HelpText current) => HelpText.DefaultParsingErrorsHandler(this, current));
        }
    }
}


text:
<!DOCTYPE html>

    <title>matrix.js -- Tests</title>
    <link href='http://fonts.googleapis.com/css?family=Source+Code+Pro:400,900' rel='stylesheet' type='text/css'>

Test Result

Total time to execute tests: s


text:
package org.batfish.datamodel.vendor_family.cisco_xr;

import java.io.Serializable;

public class AaaAccountingCommands implements Serializable {

  /** TODO: Remove when meaningful fields are added to this class */
  public Object _placeholder;
}


text:
filenames="NC_004547.faa NC_013421.faa NC_010694.faa"
indir="rbbh_data"
outdir="rbbh_data/rbbh_output"

# Make the output directory, if needed
mkdir -p ${outdir}

# Make BLAST databases
echo "Making databases"
for f in ${filenames}
do
    cmd="time makeblastdb -in ${indir}/${f} -dbtype prot -out ${outdir}/${f}"
    echo ${cmd}
    eval ${cmd}
done

# Loop over files and run BLASTP on all pairs of files in all combinations
for f in ${filenames}
do
    for g in ${filenames}
    do
	if [ "${f}" != "${g}" ]; then
	    echo "Running BLASTP..."
	    cmd="time blastp -query ${indir}/${f} -db ${outdir}/${g} -outfmt \"6 qseqid sseqid qlen slen length nident pident evalue bitscore\" -out ${outdir}/${f%.faa}_vs_${g%.faa}.tab -max_target_seqs 1"
	    echo ${cmd}
	    eval ${cmd}
	fi
    done
done