text:
namespace google {
namespace cloud {
namespace storage {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
namespace internal {
namespace {

using ::google::cloud::storage::testing::MockObjectReadSource;
using ::google::cloud::storage::testing::canonical_errors::PermanentError;
using ::google::cloud::storage::testing::canonical_errors::TransientError;
using ::testing::_;
using ::testing::Contains;
using ::testing::HasSubstr;
using ::testing::Pair;
using ::testing::Return;

class BackoffPolicyMockState {
 public:
  MOCK_METHOD(std::chrono::milliseconds, OnCompletion, ());

  int num_calls_from_last_clone_{0};
  int num_clones_{0};
};

// Pretend independent backoff policies, but be only one under the hood.
// This is a trick to count the number of `clone()` calls.
class BackoffPolicyMock : public BackoffPolicy {
 public:
  BackoffPolicyMock() : state_(new BackoffPolicyMockState) {}

  std::chrono::milliseconds OnCompletion() override {
    ++state_->num_calls_from_last_clone_;
    return state_->OnCompletion();
  }

  std::unique_ptr<BackoffPolicy> clone() const override {
    state_->num_calls_from_last_clone_ = 0;
    ++state_->num_clones_;
    return std::unique_ptr<BackoffPolicy>(new BackoffPolicyMock(*this));
  }

  int NumCallsFromLastClone() { return state_->num_calls_from_last_clone_; }
  int NumClones() { return state_->num_clones_; }

  std::shared_ptr<BackoffPolicyMockState> state_;
};

Options BasicTestPolicies() {
  using us = std::chrono::microseconds;
  return Options{}
      .set<RetryPolicyOption>(LimitedErrorCountRetryPolicy(3).clone())
      .set<BackoffPolicyOption>(
          // Make the tests faster.
          ExponentialBackoffPolicy(us(1), us(2), 2).clone())
      .set<IdempotencyPolicyOption>(StrictIdempotencyPolicy().clone());
}

/// @test No failures scenario.
TEST(RetryObjectReadSourceTest, NoFailures) {
  auto raw_client = std::make_shared<testing::MockClient>();
  auto client =
      RetryClient::Create(std::shared_ptr<internal::RawClient>(raw_client));
  google::cloud::internal::OptionsSpan const span(BasicTestPolicies());

  EXPECT_CALL(*raw_client, ReadObject)
      .WillOnce([](ReadObjectRangeRequest const&) {
        auto source = absl::make_unique<MockObjectReadSource>();
        EXPECT_CALL(*source, Read).WillOnce(Return(ReadSourceResult{}));
        return std::unique_ptr<ObjectReadSource>(std::move(source));
      });

  auto source = client->ReadObject(ReadObjectRangeRequest{});
  ASSERT_STATUS_OK(source);
  ASSERT_STATUS_OK((*source)->Read(nullptr, 1024));
}

/// @test Permanent failure when creating the raw source
TEST(RetryObjectReadSourceTest, PermanentFailureOnSessionCreation) {
  auto raw_client = std::make_shared<testing::MockClient>();
  auto client =
      RetryClient::Create(std::shared_ptr<internal::RawClient>(raw_client));
  google::cloud::internal::OptionsSpan const span(BasicTestPolicies());

  EXPECT_CALL(*raw_client, ReadObject)
      .WillOnce([](ReadObjectRangeRequest const&) { return PermanentError(); });

  auto source = client->ReadObject(ReadObjectRangeRequest{});
  ASSERT_FALSE(source);
  EXPECT_EQ(PermanentError().code(), source.status().code());
}

/// @test Transient failures exhaust retry policy when creating the raw source
TEST(RetryObjectReadSourceTest, TransientFailuresExhaustOnSessionCreation) {
  auto raw_client = std::make_shared<testing::MockClient>();
  auto client =
      RetryClient::Create(std::shared_ptr<internal::RawClient>(raw_client));
  google::cloud::internal::OptionsSpan const span(BasicTestPolicies());

  EXPECT_CALL(*raw_client, ReadObject)
      .Times(4)
      .WillRepeatedly(
          [](ReadObjectRangeRequest const&) { return TransientError(); });

  auto source = client->ReadObject(ReadObjectRangeRequest{});
  ASSERT_FALSE(source);
  EXPECT_EQ(TransientError().code(), source.status().code());
}

/// @test Recovery from a transient failures when creating the raw source
TEST(RetryObjectReadSourceTest, SessionCreationRecoversFromTransientFailures) {
  auto raw_client = std::make_shared<testing::MockClient>();
  auto client =
      RetryClient::Create(std::shared_ptr<internal::RawClient>(raw_client));
  google::cloud::internal::OptionsSpan const span(BasicTestPolicies());

  EXPECT_CALL(*raw_client, ReadObject)
      .WillOnce([](ReadObjectRangeRequest const&) { return TransientError(); })
      .WillOnce([](ReadObjectRangeRequest const&) { return TransientError(); })
      .WillOnce([](ReadObjectRangeRequest const&) {
        auto source = absl::make_unique<MockObjectReadSource>();
        EXPECT_CALL(*source, Read).WillOnce(Return(ReadSourceResult{}));
        return std::unique_ptr<ObjectReadSource>(std::move(source));
      });

  auto source = client->ReadObject(ReadObjectRangeRequest{});
  ASSERT_STATUS_OK(source);
  EXPECT_STATUS_OK((*source)->Read(nullptr, 1024));
}

/// @test A permanent error after a successful read
TEST(RetryObjectReadSourceTest, PermanentReadFailure) {
  auto raw_client = std::make_shared<testing::MockClient>();
  auto* raw_source = new MockObjectReadSource;
  auto client =
      RetryClient::Create(std::shared_ptr<internal::RawClient>(raw_client));
  google::cloud::internal::OptionsSpan const span(BasicTestPolicies());

  EXPECT_CALL(*raw_client, ReadObject)
      .WillOnce([raw_source](ReadObjectRangeRequest const&) {
        return std::unique_ptr<ObjectReadSource>(raw_source);
      });
  EXPECT_CALL(*raw_source, Read)
      .WillOnce(Return(ReadSourceResult{}))
      .WillOnce(Return(PermanentError()));

  auto source = client->ReadObject(ReadObjectRangeRequest{});
  ASSERT_STATUS_OK(source);
  ASSERT_STATUS_OK((*source)->Read(nullptr, 1024));
  auto res = (*source)->Read(nullptr, 1024);
  ASSERT_FALSE(res);
  EXPECT_EQ(PermanentError().code(), res.status().code());
}

/// @test Test if backoff policy is reset on success
TEST(RetryObjectReadSourceTest, BackoffPolicyResetOnSuccess) {
  auto raw_client = std::make_shared<testing::MockClient>();
  int num_backoff_policy_called = 0;
  BackoffPolicyMock backoff_policy_mock;
  EXPECT_CALL(*backoff_policy_mock.state_, OnCompletion()).WillRepeatedly([&] {
    ++num_backoff_policy_called;
    return std::chrono::milliseconds(0);
  });
  auto client =
      RetryClient::Create(std::shared_ptr<internal::RawClient>(raw_client));
  google::cloud::internal::OptionsSpan const span(
      BasicTestPolicies().set<BackoffPolicyOption>(
          backoff_policy_mock.clone()));

  EXPECT_EQ(0, num_backoff_policy_called);

  EXPECT_CALL(*raw_client, ReadObject)
      .WillOnce([](ReadObjectRangeRequest const&) {
        auto source = absl::make_unique<MockObjectReadSource>();
        EXPECT_CALL(*source, Read).WillOnce(Return(TransientError()));
        return std::unique_ptr<ObjectReadSource>(std::move(source));
      })
      .WillOnce([](ReadObjectRangeRequest const&) {
        auto source = absl::make_unique<MockObjectReadSource>();
        EXPECT_CALL(*source, Read).WillOnce(Return(TransientError()));
        return std::unique_ptr<ObjectReadSource>(std::move(source));
      })
      .WillOnce([](ReadObjectRangeRequest const&) {
        auto source = absl::make_unique<MockObjectReadSource>();
        EXPECT_CALL(*source, Read)
            .WillOnce(Return(ReadSourceResult{}))
            .WillOnce(Return(TransientError()));
        return std::unique_ptr<ObjectReadSource>(std::move(source));
      })
      .WillOnce([](ReadObjectRangeRequest const&) {
        auto source = absl::make_unique<MockObjectReadSource>();
        EXPECT_CALL(*source, Read).WillOnce(Return(ReadSourceResult{}));
        return std::unique_ptr<ObjectReadSource>(std::move(source));
      });

  // We really do not care how many times the policy is closed before we make
  // the first `Read()` call.  We only care about how it increases.
  auto const initial_clone_count = backoff_policy_mock.NumClones();
  auto source = client->ReadObject(ReadObjectRangeRequest{});
  ASSERT_STATUS_OK(source);
  EXPECT_EQ(initial_clone_count + 1, backoff_policy_mock.NumClones());
  EXPECT_EQ(0, num_backoff_policy_called);

  // raw_source1 and raw_source2 fail, then a success
  ASSERT_STATUS_OK((*source)->Read(nullptr, 1024));
  // Two retries, so the backoff policy was called twice.
  EXPECT_EQ(2, num_backoff_policy_called);
  // The backoff should have been cloned during the read.
  EXPECT_EQ(initial_clone_count + 2, backoff_policy_mock.NumClones());
  // The backoff policy was used twice in the first retry.
  EXPECT_EQ(2, backoff_policy_mock.NumCallsFromLastClone());

  // raw_source3 fails, then a success
  ASSERT_STATUS_OK((*source)->Read(nullptr, 1024));
  // This read caused a third retry.
  EXPECT_EQ(3, num_backoff_policy_called);
  // The backoff should have been cloned during the read.
  EXPECT_EQ(initial_clone_count + 3, backoff_policy_mock.NumClones());
  // The backoff policy was only once in the second retry.
  EXPECT_EQ(1, backoff_policy_mock.NumCallsFromLastClone());
}

/// @test Check that retry policy is shared between reads and resetting session
TEST(RetryObjectReadSourceTest, RetryPolicyExhaustedOnResetSession) {
  auto raw_client = std::make_shared<testing::MockClient>();
  auto client =
      RetryClient::Create(std::shared_ptr<internal::RawClient>(raw_client));
  google::cloud::internal::OptionsSpan const span(BasicTestPolicies());

  EXPECT_CALL(*raw_client, ReadObject)
      .WillOnce([](ReadObjectRangeRequest const&) {
        auto source = absl::make_unique<MockObjectReadSource>();
        EXPECT_CALL(*source, Read)
            .WillOnce(Return(ReadSourceResult{}))
            .WillOnce(Return(TransientError()));
        return std::unique_ptr<ObjectReadSource>(std::move(source));
      })
      .WillOnce([](ReadObjectRangeRequest const&) { return TransientError(); })
      .WillOnce([](ReadObjectRangeRequest const&) { return TransientError(); })
      .WillOnce([](ReadObjectRangeRequest const&) { return TransientError(); });

  auto source = client->ReadObject(ReadObjectRangeRequest{});
  ASSERT_STATUS_OK(source);
  ASSERT_STATUS_OK((*source)->Read(nullptr, 1024));
  auto res = (*source)->Read(nullptr, 1024);
  // It takes 4 retry attempts to exhaust the policy. Only a retry policy shared
  // between reads and resetting the session could exhaust it.
  ASSERT_FALSE(res);
  EXPECT_EQ(TransientError().code(), res.status().code());
  EXPECT_THAT(res.status().message(), HasSubstr("Retry policy exhausted"));
}

/// @test `ReadLast` behaviour after a transient failure
TEST(RetryObjectReadSourceTest, TransientFailureWithReadLastOption) {
  auto raw_client = std::make_shared<testing::MockClient>();
  auto client =
      RetryClient::Create(std::shared_ptr<internal::RawClient>(raw_client));
  google::cloud::internal::OptionsSpan const span(BasicTestPolicies());

  EXPECT_CALL(*raw_client, ReadObject)
      .WillOnce([](ReadObjectRangeRequest const& req) {
        EXPECT_EQ(1029, req.GetOption<ReadLast>().value());
        auto source = absl::make_unique<MockObjectReadSource>();
        EXPECT_CALL(*source, Read)
            .WillOnce(Return(ReadSourceResult{static_cast<std::size_t>(1024),
                                              HttpResponse{100, "", {}}}))
            .WillOnce(Return(TransientError()));
        return std::unique_ptr<ObjectReadSource>(std::move(source));
      })
      .WillOnce([](ReadObjectRangeRequest const& req) {
        EXPECT_EQ(5, req.GetOption<ReadLast>().value());
        auto source = absl::make_unique<MockObjectReadSource>();
        EXPECT_CALL(*source, Read).WillOnce(Return(ReadSourceResult{}));
        return std::unique_ptr<ObjectReadSource>(std::move(source));
      });

  ReadObjectRangeRequest req("test_bucket", "test_object");
  req.set_option(ReadLast(1029));
  auto source = client->ReadObject(req);
  ASSERT_STATUS_OK(source);
  ASSERT_STATUS_OK((*source)->Read(nullptr, 1024));
  auto res = (*source)->Read(nullptr, 1024);
  ASSERT_TRUE(res);
}

/// @test The generation is captured such that we resume from the same version
TEST(RetryObjectReadSourceTest, TransientFailureWithGeneration) {
  auto raw_client = std::make_shared<testing::MockClient>();
  auto client =
      RetryClient::Create(std::shared_ptr<internal::RawClient>(raw_client));
  google::cloud::internal::OptionsSpan const span(BasicTestPolicies());

  EXPECT_CALL(*raw_client, ReadObject)
      .WillOnce([](ReadObjectRangeRequest const& req) {
        EXPECT_FALSE(req.HasOption<ReadRange>());
        EXPECT_FALSE(req.HasOption<Generation>());
        auto source = absl::make_unique<MockObjectReadSource>();
        auto result = ReadSourceResult{static_cast<std::size_t>(1024),
                                       HttpResponse{200, "", {}}};
        result.generation = 23456;
        EXPECT_CALL(*source, Read)
            .WillOnce(Return(result))
            .WillOnce(Return(TransientError()));
        return std::unique_ptr<ObjectReadSource>(std::move(source));
      })
      .WillOnce([](ReadObjectRangeRequest const& req) {
        EXPECT_EQ(1024, req.GetOption<ReadFromOffset>().value_or(0));
        EXPECT_EQ(23456, req.GetOption<Generation>().value_or(0));
        auto source = absl::make_unique<MockObjectReadSource>();
        EXPECT_CALL(*source, Read).WillOnce(Return(ReadSourceResult{}));
        return std::unique_ptr<ObjectReadSource>(std::move(source));
      });

  ReadObjectRangeRequest req("test_bucket", "test_object");
  auto source = client->ReadObject(req);
  ASSERT_STATUS_OK(source);
  ASSERT_STATUS_OK((*source)->Read(nullptr, 1024));
  auto res = (*source)->Read(nullptr, 1024);
  ASSERT_TRUE(res);
}

/// @test Downloads with decompressive transcoding require discarding data.
TEST(RetryObjectReadSourceTest, DiscardDataForDecompressiveTranscoding) {
  auto mock = std::make_shared<testing::MockClient>();
  auto client = RetryClient::Create(std::shared_ptr<internal::RawClient>(mock));
  google::cloud::internal::OptionsSpan const span(
      BasicTestPolicies().set<RetryPolicyOption>(
          LimitedErrorCountRetryPolicy(10).clone()));

  EXPECT_CALL(*mock, ReadObject)
      .WillOnce([](ReadObjectRangeRequest const&) {
        // Simulate an initial download that reveals the object is subject to
        // decompressive transcoding. It returns the requested amount of data
        // (512 * 1024 bytes), and then fails with a transient error.
        auto source = absl::make_unique<MockObjectReadSource>();
        auto r0 = ReadSourceResult{
            static_cast<std::size_t>(512 * 1024),
            HttpResponse{100, "", {{"x-test-only", "download 1 r0"}}}};
        r0.generation = 23456;
        r0.transformation = "gunzipped";
        EXPECT_CALL(*source, Read)
            .WillOnce(Return(r0))
            .WillOnce(Return(TransientError()));
        return std::unique_ptr<ObjectReadSource>(std::move(source));
      })
      .WillOnce([](ReadObjectRangeRequest const& req) {
        // The previous transient error should trigger a second download. We
        // simulate a successful start, but the download is interrupted before
        // it can reach the previous offset.
        EXPECT_EQ(512 * 1024, req.GetOption<ReadFromOffset>().value_or(0));
        EXPECT_EQ(23456, req.GetOption<Generation>().value_or(0));
        auto r0 = ReadSourceResult{
            static_cast<std::size_t>(128 * 1024),
            HttpResponse{100, "", {{"x-test-only", "download 2 r0"}}}};
        r0.generation = 23456;
        r0.transformation = "gunzipped";

        auto r1 = ReadSourceResult{
            static_cast<std::size_t>(128 * 1024),
            HttpResponse{200, "", {{"x-test-only", "download 2 r1"}}}};

        auto source = absl::make_unique<MockObjectReadSource>();
        EXPECT_CALL(*source, Read).WillOnce(Return(r0)).WillOnce(Return(r1));
        return std::unique_ptr<ObjectReadSource>(std::move(source));
      })
      .WillOnce([](ReadObjectRangeRequest const&) {
        // Because the previous download "completes" before reaching the desired
        // offset, we need to start a third download. Let's have this one fail
        // immediately.
        return TransientError();
      })
      .WillOnce([](ReadObjectRangeRequest const& req) {
        // That triggers a fourth download. We simulate a successful download.
        EXPECT_EQ(512 * 1024, req.GetOption<ReadFromOffset>().value_or(0));
        EXPECT_EQ(23456, req.GetOption<Generation>().value_or(0));
        // We expect the RetryReadObjectSource class to initiative a third
        // download. Let's make it succeed, but then return a short download
        // on the next attempt.
        auto r0 = ReadSourceResult{
            static_cast<std::size_t>(128 * 1024),
            HttpResponse{100, "", {{"x-test-only", "download 3 r0"}}}};
        r0.generation = 23456;
        r0.transformation = "gunzipped";

        auto r1 = ReadSourceResult{
            static_cast<std::size_t>(64 * 1024),
            HttpResponse{200, "", {{"x-test-only", "download 3 r1"}}}};
        r1.generation = 23456;
        r1.transformation = "gunzipped";

        auto source = absl::make_unique<MockObjectReadSource>();
        // We expect 4 reads to reach the desired offset, and then return the
        // real data.
        ::testing::InSequence sequence;
        EXPECT_CALL(*source, Read(_, 128 * 1024L))
            .Times(4)
            .WillRepeatedly(Return(r0));
        EXPECT_CALL(*source, Read(_, 256 * 1024L)).WillOnce(Return(r1));
        return std::unique_ptr<ObjectReadSource>(std::move(source));
      });

  std::vector<char> buffer(1024 * 1024L);

  ReadObjectRangeRequest req("test_bucket", "test_object");
  auto source = client->ReadObject(req);
  ASSERT_STATUS_OK(source);
  auto response = (*source)->Read(nullptr, 512 * 1024);
  ASSERT_STATUS_OK(response);
  EXPECT_EQ(response->bytes_received, 512 * 1024);
  EXPECT_EQ(response->transformation.value_or(""), "gunzipped");
  EXPECT_THAT(response->response.headers,
              Contains(Pair("x-test-only", "download 1 r0")));

  response = (*source)->Read(nullptr, 256 * 1024);
  ASSERT_STATUS_OK(response);
  EXPECT_EQ(response->bytes_received, 64 * 1024);
  EXPECT_EQ(response->transformation.value_or(""), "gunzipped");
  EXPECT_THAT(response->response.headers,
              Contains(Pair("x-test-only", "download 3 r1")));
}

}  // namespace
}  // namespace internal
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
}  // namespace storage
}  // namespace cloud
}  // namespace google


text:
Dockerized base container image of the JDK.

[![](https://badge.imagelayers.io/aeonproject/java-jdk:latest.svg)](https://imagelayers.io/?images=aeonproject/java-jdk:latest 'Get your own badge on imagelayers.io')

[![Docker Repository on Quay](https://quay.io/repository/aeonproject/java-jre/status "Docker Repository on Quay")](https://quay.io/repository/aeonproject/java-jre)

redpajama_set_name: RedPajamaGithub


text:
import {createSelector} from 'reselect';

import {selectors as configSelectors} from './common/config';
import {selectors as roomsSelectors} from './common/rooms';
import {selectors as userSelectors} from './common/user';

export const isInitializing = createSelector(
  configSelectors.hasLoadedConfig,
  userSelectors.hasLoadedUserInfo,
  roomsSelectors.hasLoadedRooms,
  roomsSelectors.hasLoadedEquipmentTypes,
  (...ready) => ready.some(x => !x)
);

export function filtersAreSet(state) {
  // check that recurrence + start date + start/end time are set
  const {
    filters: {
      recurrence,
      dates: {startDate},
    },
  } = state.bookRoom;
  return !!(recurrence.type && startDate);
}


text:
package com.thinkbiganalytics.security.rest.controller;

import com.thinkbiganalytics.rest.model.RestResponseStatus;
import com.thinkbiganalytics.security.rest.model.UserGroup;
import com.thinkbiganalytics.security.rest.model.User;
import com.thinkbiganalytics.security.service.user.UserService;

import org.springframework.stereotype.Component;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.List;

import javax.annotation.Nonnull;
import javax.inject.Inject;
import javax.ws.rs.BadRequestException;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.NotFoundException;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Tag;

/**
 * Endpoint for accessing Kylo groups.
 */
@Api(tags = "Security - Groups")
@Component
@Path("/v1/security/groups")
@SwaggerDefinition(tags = @Tag(name = "Security - Groups", description = "manages groups"))
public class GroupsController {

    /**
     * Service for accessing Kylo groups
     */
    @Inject
    UserService userService;

    /**
     * Adds for updates a Kylo group.
     *
     * @param group the group
     * @return the result
     */
    @POST
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    @ApiOperation("Adds or updates a Kylo group.")
    @ApiResponses({
                      @ApiResponse(code = 204, message = "The group was added or updated."),
                      @ApiResponse(code = 500, message = "There was a problem adding or updating the group.", response = RestResponseStatus.class)
                  })
    @Nonnull
    public Response addGroup(@Nonnull final UserGroup group) {
        userService.updateGroup(group);
        return Response.noContent().build();
    }

    /**
     * Deletes the specified group.
     *
     * @param groupId the system name of the group
     * @return the result
     * @throws NotFoundException if the group does not exist
     */
    @DELETE
    @Path("{groupId}")
    @ApiOperation("Deletes the specified group.")
    @ApiResponses({
                      @ApiResponse(code = 204, message = "The group was deleted."),
                      @ApiResponse(code = 404, message = "The group was not found.", response = RestResponseStatus.class),
                      @ApiResponse(code = 500, message = "There was a problem deleting the group.", response = RestResponseStatus.class)
                  })
    @Nonnull
    public Response deleteGroup(@Nonnull @PathParam("groupId") final String groupId) {
        if (userService.deleteGroup(decodeGroupId(groupId))) {
            return Response.noContent().build();
        } else {
            throw new NotFoundException();
        }
    }

    /**
     * Returns the specified group.
     *
     * @param groupId the system name of the group
     * @return the group
     * @throws NotFoundException if the group does not exist
     */
    @GET
    @Path("{groupId}")
    @Produces(MediaType.APPLICATION_JSON)
    @ApiOperation("Returns the specified group.")
    @ApiResponses({
                      @ApiResponse(code = 200, message = "The requested group.", response = UserGroup.class),
                      @ApiResponse(code = 404, message = "The group was not found.", response = RestResponseStatus.class),
                      @ApiResponse(code = 500, message = "There was a problem accessing the group.", response = RestResponseStatus.class)
                  })
    @Nonnull
    public Response getGroup(@Nonnull @PathParam("groupId") final String groupId) {
        final UserGroup group = userService.getGroup(decodeGroupId(groupId)).orElseThrow(NotFoundException::new);
        return Response.ok(group).build();
    }

    /**
     * Returns a list of all groups.
     *
     * @return all groups
     */
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    @ApiOperation("Returns a list of all groups.")
    @ApiResponses({
                      @ApiResponse(code = 200, message = "The list of groups.", response = UserGroup.class, responseContainer = "List"),
                      @ApiResponse(code = 500, message = "There was a problem accessing the groups.", response = RestResponseStatus.class)
                  })
    @Nonnull
    public Response getGroups() {
        final List<UserGroup> groups = userService.getGroups();
        return Response.ok(groups).build();
    }

    /**
     * Returns a list of all users in the specified group.
     *
     * @param groupId the system name of the group
     * @return the list of users
     * @throws NotFoundException if the group does not exist
     */
    @GET
    @Path("{groupId}/users")
    @Produces(MediaType.APPLICATION_JSON)
    @ApiOperation("Returns a list of all users in the specified group.")
    @ApiResponses({
                      @ApiResponse(code = 200, message = "The list of users.", response = User.class, responseContainer = "List"),
                      @ApiResponse(code = 404, message = "The group was not found.", response = RestResponseStatus.class),
                      @ApiResponse(code = 500, message = "There was a problem accessing the group.", response = RestResponseStatus.class)
                  })
    @Nonnull
    public Response getUsers(@Nonnull @PathParam("groupId") final String groupId) {
        final List<User> users = userService.getUsersByGroup(decodeGroupId(groupId)).orElseThrow(NotFoundException::new);
        return Response.ok(users).build();
    }

    /**
     * Decodes the specified group name. This should only be used on path parameters.
     *
     * @param groupId the path parameter
     * @return the system name of the group
     */
    @Nonnull
    private String decodeGroupId(@Nonnull final String groupId) {
        try {
            return URLDecoder.decode(groupId, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            throw new BadRequestException("Only UTF-8 encoding is supported.");
        }
    }
}


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('democracy', '0007_section_plugins'),
    ]

    operations = [
        migrations.AddField(
            model_name='hearingcomment',
            name='plugin_data',
            field=models.TextField(blank=True, verbose_name='plugin data'),
        ),
        migrations.AddField(
            model_name='hearingcomment',
            name='plugin_identifier',
            field=models.CharField(blank=True, max_length=255, verbose_name='plugin identifier'),
        ),
        migrations.AddField(
            model_name='sectioncomment',
            name='plugin_data',
            field=models.TextField(blank=True, verbose_name='plugin data'),
        ),
        migrations.AddField(
            model_name='sectioncomment',
            name='plugin_identifier',
            field=models.CharField(blank=True, max_length=255, verbose_name='plugin identifier'),
        ),
    ]


text:
package it.jnrpe.events;

/**
 * LogEvent object. Used to send log mesages.
 *
 * @author Massimiliano Ziccardi
 *
 * @version $Revision: 1.0 $
 */
public final class LogEvent implements IJNRPEEvent {

    /**
     * All the accepted Log Event types.
     *
     * @author Massimiliano Ziccardi
     */
    public enum LogEventType {
        /**
         * Trace Log Event.
         */
        TRACE,
        /**
         * Debug Log Event.
         */
        DEBUG,
        /**
         * Info Log Event.
         */
        INFO,
        /**
         * Warning Log Event.
         */
        WARNING,
        /**
         * Error Log Event.
         */
        ERROR,
        /**
         * Fatal Log Event.
         */
        FATAL;
    };

    /**
     * The log severity.
     */
    private final LogEventType logType;

    /**
     * The log message.
     */
    private final String message;

    /**
     * The error cause (if any).
     */
    private final Throwable error;

    /**
     * The instance that generated the log.
     */
    private final Object source;

    /**
     * Generates a new LogEvent object.
     *
     * @param evtSource the originator of the event
     * @param type the event type
     * @param logMessage the event message
     * @param cause the cause (if any)
     */
    public LogEvent(final Object evtSource, final LogEventType type, final String logMessage, final Throwable cause) {
        logType = type;
        message = logMessage;
        error = cause;
        source = evtSource;
    }

    /**
     * Generates a new LogEvent object.
     *
     * @param evtSource the originator of the event
     * @param type the event type
     * @param logMessage the event message
     */
    public LogEvent(final Object evtSource, final LogEventType type, final String logMessage) {
        logType = type;
        message = logMessage;
        error = null;
        source = evtSource;
    }

    /**

     * @return the event type */
    public LogEventType getLogType() {
        return logType;
    }

    /**

     * @return the message * @see it.jnrpe.events.IJNRPEEvent#getMessage()
     */
    public String getMessage() {
        return message;
    }

    /**

     * @return the cause */
    public Throwable getCause() {
        return error;
    }

    /**

     * @return the event originator * @see it.jnrpe.events.IJNRPEEvent#getSource()
     */
    public Object getSource() {
        return source;
    }

    /**

     * @return the event name * @see it.jnrpe.events.IJNRPEEvent#getEventName()
     */
    public String getEventName() {
        return getLogType().name();
    }

    /**
     * Method toString.
     * @return String
     */
    @Override
    public String toString() {
        return "LogEvent [logType=" + logType + ", message=" + message + ", error=" + error + ", source=" + source + "]";
    }

}


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

<TITLE>
L-Index
</TITLE>

<META NAME="date" CONTENT="2011-01-03">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
      Use
      Tree
      Deprecated
    Index
      Help

 PREV LETTER
 NEXT LETTER

  FRAMES
 NO FRAMES

  All Classes

A B C D E F G H I L M N P R S T U V

L

language -
Variable in class toxi.data.feeds.RSSChannel

lastBuiltDate -
Variable in class toxi.data.feeds.RSSChannel

lastUpdated -
Variable in class toxi.data.feeds.AtomFeed

length -
Variable in class toxi.data.feeds.RSSEnclosure

link -
Variable in class toxi.data.feeds.RSSChannel

link -
Variable in class toxi.data.feeds.RSSItem

links -
Variable in class toxi.data.feeds.AtomEntry

links -
Variable in class toxi.data.feeds.AtomFeed

LONGEST_ENTITY -
Static variable in class toxi.data.feeds.util.EntityStripper

Longest an entity can be 10, at least in our
 tables, including the lead & and trail ;.

      Overview
      Package
      Class
      Use
      Tree
      Deprecated
    Index
      Help

 PREV LETTER
 NEXT LETTER

  FRAMES
 NO FRAMES

  All Classes

A B C D E F G H I L M N P R S T U V


text:
//
//  HBOfficialContactCell.m
//  HZBicycle
//
//  Created by MADAO on 16/11/17.
//  Copyright © 2016年 MADAO. All rights reserved.
//

#import "HBDefaultSettingCell.h"

@interface HBDefaultSettingCell(){
    HBSettintCellType _type;
    NSString *_title;
    UIImage *_icon;
}

/**
 背景View
 */
@property (nonatomic, strong) UIView *backView;

/**
 标题标签
 */
@property (nonatomic, strong) UILabel *lblTitle;

/**
 图标
 */
@property (nonatomic, strong) UIImageView *iconView;

@end

#pragma mark - Constant
static CGFloat const kDefaultInsets = 10.f;
static CGFloat const kTitleInsets = 15.f;
static CGFloat const kIconWidth = 24.f;

static NSString *const kReuseIdentifier = @"staticReuseIdentifier";

@implementation HBDefaultSettingCell

- (instancetype)initWithTitle:(NSString *)title
                         icon:(UIImage *)image
                     cellType:(HBSettintCellType)type
{
    if (self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kReuseIdentifier]) {
        self.backgroundColor = [UIColor clearColor];
        _title = title;
        _icon = image;
        _type = type;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        //设置子视图
        [self setupSubViews];
    }
    return self;
}

- (void)setupSubViews {
    @WEAKSELF;
    self.backView = [[UIView alloc] init];
    self.backView.backgroundColor = HB_COLOR_DARKBLUE;
    [self addSubview:self.backView];
    if (_type == HBSettintCellTypeTop) {
        //需要顶部预留空间
        [self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.left.equalTo(weakSelf).with.offset(kDefaultInsets);
            make.right.equalTo(weakSelf).with.offset(-kDefaultInsets);
            make.bottom.equalTo(weakSelf);
        }];
    }else {
        [self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(weakSelf);
            make.left.equalTo(weakSelf).with.offset(kDefaultInsets);
            make.right.equalTo(weakSelf).with.offset(-kDefaultInsets);
            make.bottom.equalTo(weakSelf);
        }];
    }
    //添加白色分割线
    UIView *whiteLineView = [[UIView alloc] init];
    whiteLineView.backgroundColor = [UIColor lightGrayColor];
    [self.backView addSubview:whiteLineView];
    [whiteLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.backView).with.offset(kDefaultInsets);
        make.right.equalTo(weakSelf.backView).with.offset(-kDefaultInsets);
        make.bottom.equalTo(weakSelf.backView);
        make.height.mas_offset(@(1.f/[UIScreen mainScreen].scale));
    }];
    whiteLineView.hidden = _type == HBSettintCellTypeBottom;

    self.lblTitle = [[UILabel alloc] init];
    self.lblTitle.font = HB_FONT_MEDIUM_SIZE(15);
    self.lblTitle.textAlignment = NSTextAlignmentLeft;
    self.lblTitle.textColor = [UIColor whiteColor];
    self.lblTitle.text = _title;
    [self.backView addSubview:self.lblTitle];
    [self.lblTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(weakSelf.backView).with.offset(kTitleInsets);
        make.height.mas_equalTo(@19);
        make.right.equalTo(weakSelf.backView.mas_right).with.offset(-kTitleInsets);
    }];

    self.iconView = [[UIImageView alloc] init];
    self.iconView.image = _icon;
    self.iconView.contentMode = UIViewContentModeScaleAspectFill;
    [self.backView addSubview:self.iconView];
    [self.iconView mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.width.height.mas_equalTo(@(kIconWidth));
        make.centerY.equalTo(weakSelf.backView);
        make.right.equalTo(weakSelf.backView.mas_right).with.offset(-kTitleInsets);
    }];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    [self setupLayers];
}

- (void)setupLayers {
    //设置上部圆角
    switch (_type) {
        case HBSettintCellTypeDefault:

            break;
        case HBSettintCellTypeTop:
        {
            UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.backView.bounds byRoundingCorners:(UIRectCornerTopLeft | UIRectCornerTopRight) cornerRadii:CGSizeMake(5,5)];//圆角大小
            CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
            maskLayer.frame = self.backView.bounds;
            maskLayer.path = maskPath.CGPath;
            self.backView.layer.mask = maskLayer;
        }
            break;
        case HBSettintCellTypeBottom:
        {
            UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.backView.bounds byRoundingCorners:(UIRectCornerBottomLeft | UIRectCornerBottomRight) cornerRadii:CGSizeMake(5,5)];//圆角大小
            CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
            maskLayer.frame = self.backView.bounds;
            maskLayer.path = maskPath.CGPath;
            self.backView.layer.mask = maskLayer;
        }
        default:
            break;
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end


text:
import png

r = png.Reader('GroupsAndLabels.png')
data = r.read()
width = data[0]
height = data[1]
pixels = list(data[2])
newPixels = list()
for row in pixels:
    newRow = list()
    for col in xrange(width):
        alpha = row[4 * col]
        newRow.append(255)
        newRow.append(255)
        newRow.append(255)
        newRow.append(alpha)
    newPixels.append(newRow)

outfile = open('GroupsAndLabelsMask.png', 'wb')
w = png.Writer(width, height, alpha=True)
w.write(outfile, newPixels)

outfile.close()


text:
import { BrowserUtil } from './browser_util';
import * as contrib from './contrib';
import * as xhr_dataset from './data/xhr-dataset';
import * as environment from './environment';
import * as gpgpu_util from './kernels/webgl/gpgpu_util';
import * as webgl_util from './kernels/webgl/webgl_util';
import * as conv_util from './ops/conv_util';
import * as test_util from './test_util';
import * as util from './util';
import { version } from './version';
export { CheckpointLoader } from './data/checkpoint_loader';
export { DataStats, InMemoryDataset } from './data/dataset';
export { InCPUMemoryShuffledInputProviderBuilder, InGPUMemoryShuffledInputProviderBuilder, InputProvider } from './data/input_provider';
export { XhrDataset, XhrDatasetConfig, XhrModelConfig } from './data/xhr-dataset';
export { ENV, Environment, Features } from './environment';
export { Graph, SymbolicTensor } from './graph/graph';
export { GraphRunner, GraphRunnerEventObserver, MetricReduction } from './graph/graph_runner';
export { ConstantInitializer, Initializer, OnesInitializer, RandomNormalInitializer, RandomTruncatedNormalInitializer, RandomUniformInitializer, TensorInitializer, VarianceScalingInitializer, ZerosInitializer } from './graph/initializers';
export { CostReduction, FeedEntry, Session } from './graph/session';
export { MathBackendCPU, NDArrayMathCPU } from './kernels/backend_cpu';
export { MathBackendWebGL, NDArrayMathGPU, WebGLTimingInfo } from './kernels/backend_webgl';
export { GPGPUContext } from './kernels/webgl/gpgpu_context';
export { NDArrayMath } from './math';
export { Model } from './model';
export { LSTMCell } from './ops/lstm';
export { MatrixOrientation } from './ops/matmul';
export { AdadeltaOptimizer } from './optimizers/adadelta_optimizer';
export { AdagradOptimizer } from './optimizers/adagrad_optimizer';
export { AdamOptimizer } from './optimizers/adam_optimizer';
export { AdamaxOptimizer } from './optimizers/adamax_optimizer';
export { MomentumOptimizer } from './optimizers/momentum_optimizer';
export { Optimizer } from './optimizers/optimizer';
export { RMSPropOptimizer } from './optimizers/rmsprop_optimizer';
export { SGDOptimizer } from './optimizers/sgd_optimizer';
export { Array1D, Array2D, Array3D, Array4D, NDArray, Scalar, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, variable, Variable } from './tensor';
export { Rank } from './types';
export { loadWeights } from './weights_loader';
export { version };
export { contrib, conv_util, environment, gpgpu_util, test_util, util, webgl_util, xhr_dataset };
export * from './ops/ops';
export * from './train';
export * from './globals';
export declare const setBackend: typeof environment.Environment.setBackend;
export declare const getBackend: typeof environment.Environment.getBackend;
export declare const memory: typeof environment.Environment.memory;
export declare const nextFrame: typeof BrowserUtil.nextFrame;


text:
/* See license.txt for terms of usage */

define([
    "httpmonitor/lib/trace",
    "httpmonitor/lib/object",
],
function(FBTrace, Obj) {

// ********************************************************************************************* //
// Implementation

function Protocol(connection, listener)
{
    this.connection = connection;
    this.listener = listener;
}

Protocol.prototype =
{
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    // Trace API

    attachTrace: function(callback)
    {
        var traceEvent = Obj.bind(this.onTraceEvent, this);

        var self = this;
        this.connection.sendPacket("root", "traceActor", true, function(packet)
        {
            self.currentTraceActor = packet.actor;
            self.connection.sendPacket(packet.actor, "attach", false, traceEvent);
            callback();
        });
    },

    detachTrace: function(callback)
    {
        this.connection.sendPacket(this.currentTraceActor.id, "detach", true, function()
        {
            this.currentTraceActor = null;
            callback();
        });
    },

    onTraceEvent: function(packet)
    {
        this.listener.onTraceEvent(packet);
    },

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    // Network Monitor API

    getTabList: function(callback)
    {
        this.connection.sendPacket("root", "listTabs", true, callback);
    },

    selectTab: function(tab, callback)
    {
        if (FBTrace.DBG_REMOTEBUG)
            FBTrace.sysout("remotebug; Selected remote tab: " + tab.id, tab);

        if (this.currentTab)
            this.unselectTab(this.currentTab)

        var self = this;
        this.connection.sendPacket(tab.id, "attach", true, function(packet)
        {
            if (FBTrace.DBG_REMOTEBUG)
                FBTrace.sysout("remotebug; Remote tab selected: " + packet.from, packet);

            self.currentTab = tab;

            self.onTabSelected(tab);

            callback();

            // xxxHonza; do we need this?
            //Events.dispatch(self.fbListeners, "onTabSelected", [tab.id]);
        });
    },

    unselectTab: function(tabActor)
    {
        this.onTabUnselected(tabActor);
    },

    getCurrentTab: function()
    {
        return this.currentTab;
    },

    getCurrentTabActor: function()
    {
        return this.currentTab ? this.currentTab.actor : null;
    },

    getNetActor: function(tabActor, callback)
    {
        this.connection.sendPacket(tabActor, "networkMonitorActor", true, callback);
    },

    subscribe: function(netActor, callback)
    {
        if (this.currentNetActor)
            this.unsubscribe(this.currentNetActor);

        this.connection.sendPacket(netActor, "subscribe", false, callback);
        this.currentNetActor = netActor;
    },

    unsubscribe: function(netActor)
    {
        this.connection.removeCallback(netActor);
        this.connection.sendPacket(netActor, "unsubscribe", true, function(packet)
        {
            if (FBTrace.DBG_REMOTENETMONITOR)
                FBTrace.sysout("remotenet; Unsubscribed from: " + packet.from);
            return;
        });
    },

    sendRequest: function(data, callback)
    {
        this.connection.sendPacket(this.currentNetActor, "sendRequest", true, callback, data);
    },

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

    /**
     * Executed by RemoteBug.Module if a remote tab is selected.
     * @param {Object} tabActor The selected tab descriptor
     */
    onTabSelected: function(tabActor)
    {
        var self = this;
        var netEvent = Obj.bind(this.onNetworkEvent, this);
        var tabNavigated = Obj.bind(self.onTabNavigated, self);

        // A tab has been selected so, subscribe to the Net monitor actor. The callback
        // will receive events about any HTTP traffic within the target tab.
        this.getNetActor(tabActor.id, function(packet)
        {
            self.subscribe(packet.actor, netEvent);

            // Also register callback for 'tabNavigated' events.
            self.connection.addCallback(tabActor.id, tabNavigated, false);
        });
    },

    onTabUnselected: function(tabActor)
    {
        this.connection.removeCallback(tabActor.id);
    },

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    // Hooks

    /**
     * Executed when the remote attached tab is reloaded
     * @param {Object} tabActor The selected tab descriptor
     */
    onTabNavigated: function(packet)
    {
        if (FBTrace.DBG_REMOTENETMONITOR)
            FBTrace.sysout("remotenet; onTabNavigated: " + packet.from);

        if (packet.type != "tabNavigated")
            return;

        try
        {
            this.listener.onTabNavigated(packet);
        }
        catch (e)
        {
            if (FBTrace.DBG_ERRORS)
                FBTrace.sysout("Protocol.onNetworkEvent; EXCEPTION " + e, e);
        }
    },

    /**
     * Executed when NetworkMonitorActor send data about server side HTTP activity
     * @param {Object} packet
     */
    onNetworkEvent: function(packet)
    {
        if (packet.subscribe)
        {
            if (FBTrace.DBG_REMOTENETMONITOR)
                FBTrace.sysout("remotenet; Subscribed to: " + packet.from);
            return;
        }

        if (packet.type != "notify")
            return;

        try
        {
            this.listener.onNetworkEvent(packet);
        }
        catch (e)
        {
            if (FBTrace.DBG_ERRORS)
                FBTrace.sysout("Protocol.onNetworkEvent; EXCEPTION " + e, e);
        }
    }
};

// ********************************************************************************************* //
// Registration

return Protocol;

// ********************************************************************************************* //
});


text:
var API_URLS = {
  test:       'http://universe-js.test:8081/api/v1',
  staging:    'https://staging.services.sparkart.net/api/v1',
  production: 'https://services.sparkart.net/api/v1'
};

var SolidusClient = require('solidus-client');
var Resource = require('solidus-client/lib/resource');

var Universe = function(options) {
  if (!(this instanceof Universe)) return new Universe(options);

  SolidusClient.call(this, options);

  options || (options = {});
  this.environment = options.environment || 'production';
  this.key         = options.key;
};

Universe.prototype = Object.create(SolidusClient.prototype);

Universe.prototype.init = function(callback) {
  var self = this;
  var data = {};

  getFanclub.call(self, function(err, fanclub) {
    data.fanclub = fanclub;
    if (err) {
      if (callback) callback(err, data);
      return setTimeout(function() {self.emit('error', err)}, 0);
    }

    getCustomer.call(self, function(err, customer) {
      data.customer = customer;
      if (callback) callback(err, data);
      if (!err) setTimeout(function() {self.emit('ready', data)}, 0);
    });
  });
};

Universe.prototype.render = function() {
  expandResourcesEndpoints.call(this, arguments[0]);
  return SolidusClient.prototype.render.apply(this, arguments);
};

Universe.prototype.get = function(endpoint, callback) {
  requestResource.call(this, 'get', endpoint, null, callback);
};

Universe.prototype.post = function(endpoint, payload, callback) {
  requestResource.call(this, 'post', endpoint, payload, callback);
};

Universe.prototype.resource = function(endpoint) {
  const resource = {
    url: resourceUrl.call(this, endpoint),
    query: {
      key: this.key
    },
    headers: {}
  };

  if (localStorage.getItem('universeAccessToken')) {
    resource.headers.Authorization = 'Bearer ' + localStorage.getItem('universeAccessToken');
  }

  return resource;
};

Universe.prototype.jsonpResource = function(endpoint) {
  return {
    url: resourceUrl.call(this, endpoint),
    jsonp: true
  };
};

// PRIVATE

var getFanclub = function(callback) {
  if (this.context && this.context.resources && this.context.resources.fanclub) {
    callback(null, this.context.resources.fanclub.fanclub);
  } else {
    this.get('/fanclub', function(err, data) {
      callback(err, data ? data.fanclub : null);
    });
  }
};

var getCustomer = function(callback) {
  if (localStorage.getItem('universeAccessToken')) {
    this.get('/account', function(err, data) {
      callback(err, data ? data.customer : null);
    });
  } else {
    callback();
  }
};

var expandResourcesEndpoints = function(view) {
  if (!view || typeof view !== 'object') return;

  for (var name in view.resources) {
    var resource = view.resources[name];
    if (typeof resource === 'string' && resource[0] === '/') {
      resource = this.resource(resource);
    } else if (resource !== null && typeof resource === 'object' && typeof resource.url === 'string' && resource.url[0] === '/') {
      resource.url = resourceUrl.call(this, resource.url);
    }
    view.resources[name] = resource;
  }
};

var resourceUrl = function(endpoint) {
  return (API_URLS[this.environment] || API_URLS['production']) + endpoint;
};

var requestResource = function(method, endpoint, payload, callback) {
  const self = this;

  validateTokens.call(self, function(err) {
    function cb(err, response) {callback(err, response ? response.data : undefined)};
    const resource = new Resource(self.resource(endpoint), self.resources_options);
    if (method === 'get') {
      resource.get(cb);
    } else if (method === 'post') {
      if (resource.requestType() == 'jsonp') {
        resource.options.query || (resource.options.query = {});
        resource.options.query._method = 'POST';
      }
      resource.post(payload, cb);
    }
  });
}

var validateTokens = function(callback) {
  const now = new Date().getTime();

  if (localStorage.getItem('universeAccessToken') && now < (localStorage.getItem('universeAccessTokenExpiration') || 0)) {
    // Valid access token
    return callback();
  } else {
    localStorage.removeItem('universeAccessToken');
    localStorage.removeItem('universeAccessTokenExpiration');
  }

  if (!localStorage.getItem('universeRefreshToken') || now >= (localStorage.getItem('universeRefreshTokenExpiration') || 0)) {
    // Missing or expired refresh token
    localStorage.removeItem('universeRefreshToken');
    localStorage.removeItem('universeRefreshTokenExpiration');
    return callback(true);
  }

  // Refresh the access token
  const resource = new Resource(this.resource('/refresh'), this.resources_options);
  resource.post({refresh_token: localStorage.getItem('universeRefreshToken')}, function (err, response) {
    if (err) {
      if (response && response.data && response.data.status === 'error') {
        // Invalid refresh token
        localStorage.removeItem('universeRefreshToken');
        localStorage.removeItem('universeRefreshTokenExpiration');
      }
      callback(err);
    } else {
      localStorage.setItem('universeAccessToken', response.data.access.access_token);
      localStorage.setItem('universeAccessTokenExpiration', response.data.access.access_token_expiration * 1000);
      localStorage.setItem('universeRefreshToken', response.data.access.refresh_token);
      localStorage.setItem('universeRefreshTokenExpiration', response.data.access.refresh_token_expiration * 1000);
      callback();
    }
  });
}

module.exports = Universe;


text:
function [Dtf, Dtph] = spm_eeg_tf(S)
% Compute instantaneous power and phase in peri-stimulus time and frequency
% FORMAT [Dtf, Dtph] = spm_eeg_tf(S)
%
% S                     - input structure
%
% fields of S:
%   S.D                 - MEEG object or filename of M/EEG mat-file with
%
%   S.channels          - cell array of channel names. Can include generic
%                         wildcards: 'All', 'EEG', 'MEG' etc.
%
%   S.frequencies      - vector of frequencies of interest
%
%   S.timewin          - time window of interest in PST in ms.
%
%   S.method           - name for the spectral estimation to use. This
%                        corresponds to the name of a plug-in function that comes
%                        after 'spm_eeg_specest_' prefix.
%   S.settings         - plug-in specific settings
%
%   S.phase            - also save phase dataset (1) or not (0)
%                        phase dataset cannot be computed for some
%                        spectral estimation methods
% Output:
% Dtf                   - M/EEG object with power (also written on disk)
% Dtph                  - M/EEG object with phase (also written on disk)
%__________________________________________________________________________
% This is a modular function for which plugins can be developed implementing
% specific spectral estimation methods. There are 3 basic plugins presently
% implemented and they can be used as templates for new plugins.
% The name of a plugin function should start with 'spm_eeg_specest_'
%
% morlet (spm_eeg_specest_morlet) - Morlet wavelet transform
%
% hilbert (spm_eeg_specest_hilbert) - filtering + Hilbert transform
%
% ft_mtmconvol (spm_eeg_specest_ft_mtmconvol) - Fieldtrip implementation
%                                           of multi-taper spectral
%                                           analysis
%__________________________________________________________________________
% Copyright (C) 2010 Wellcome Trust Centre for Neuroimaging

% Vladimir Litvak
% $Id: spm_eeg_tf.m 4021 2010-07-28 12:43:16Z vladimir $

SVNrev = '$Rev: 4021 $';

%-Startup
%--------------------------------------------------------------------------
spm('FnBanner', mfilename, SVNrev);
spm('FigName','M/EEG Time-Frequency'); spm('Pointer','Watch');

if nargin == 0
    S = [];
end

%-Ensure backward compatibility
%--------------------------------------------------------------------------
S = spm_eeg_compatibility(S, mfilename);

%-Get MEEG object
%--------------------------------------------------------------------------
try
    D = S.D;
catch
    [D, sts] = spm_select(1, 'mat', 'Select M/EEG mat file');
    if ~sts, D = []; return; end
    S.D = D;
end

D = spm_eeg_load(D);

if isequal(D.type, 'continuous')
    error('Time-frequency analysis can only be applied to epoched data');
end

%-Configure the analysis
%--------------------------------------------------------------------------
if ~isfield(S, 'channels')
    S.channels = 'all';
end

chanind = D.selectchannels(S.channels);

if isempty(chanind)
    error('No channels selected.');
end

if ~isfield(S, 'frequencies') || isempty(S.frequencies)
    S.frequencies = 1:48;
end

if ~isfield(S, 'timewin')
    S.timewin = 1e3*[D.time(1) D.time(end)];
end

timeind = D.indsample(1e-3*min(S.timewin)):D.indsample(1e-3*max(S.timewin));

if ~isfield(S, 'method')
    S.method = 'morlet';
    S.settings = [];
end

if ~isfield(S, 'phase')
    S.phase = 0;
end

if isfield(S, 'settings')
    S1 = S.settings;
else
    S1 = [];
end

S1.frequencies = S.frequencies;

%-Run the analysis on all trials
%--------------------------------------------------------------------------
spm_progress_bar('Init', D.ntrials, 'trials done');
if D.ntrials > 100, Ibar = floor(linspace(1, D.ntrials, 100));
else Ibar = 1:D.ntrials; end

for k = 1:D.ntrials
    trial = feval(['spm_eeg_specest_' S.method], S1, D(chanind, timeind, k), D.time(timeind));

    if k == 1

        if isfield(trial, 'fourier')
            outdata = trial.fourier;
        else
            outdata = trial.pow;
        end

        Nchannels = size(outdata, 1);
        Nfrequencies = size(outdata, 2);
        Nsamples = size(outdata, 3);

        %-Generate output datasets
        %--------------------------------------------------------------------------
        Dtf = clone(D, ['tf_' D.fnamedat], [Nchannels Nfrequencies Nsamples D.ntrials]);
        Dtf = Dtf.frequencies(:, trial.freq);
        Dtf = timeonset(Dtf, trial.time(1));
        Dtf = fsample(Dtf, 1/diff(trial.time(1:2)));
        Dtf = transformtype(Dtf, 'TF');

        Dtf = chanlabels(Dtf, 1:Nchannels, D.chanlabels(chanind));
        Dtf = badchannels(Dtf, 1:Nchannels, D.badchannels(chanind));
        Dtf = chantype(Dtf, 1:Nchannels, D.chantype(chanind));
        Dtf = coor2D(Dtf, 1:Nchannels, coor2D(D,chanind));

        if S.phase && isfield(trial, 'fourier')
            Dtph = clone(Dtf, ['tph_' D.fnamedat]);
            Dtph = transformtype(Dtph, 'TFphase');
        else
            if ~isfield(trial, 'fourier')
                warning('Phase cannot be estimated with the requested method. Estimating power only.');
            end

            Dtph = [];
        end

    end

    if isfield(trial, 'fourier')
        Dtf(:, :, :, k) = trial.fourier.*conj(trial.fourier);

        if S.phase
            Dtph(:, :, :, k) = angle(trial.fourier);
        end
    elseif isfield(trial, 'pow')
        Dtf(:, :, :, k) = trial.pow;
    else
        error('The plug-in returned unexpected output');
    end

    if ismember(k, Ibar), spm_progress_bar('Set', k); end
end

spm_progress_bar('Clear');

%-Save new M/EEG dataset(s)
%--------------------------------------------------------------------------
Dtf = Dtf.history('spm_eeg_tf', S);
save(Dtf);
if ~isempty(Dtph)
    Dtph = Dtph.history('spm_eeg_tf', S);
    save(Dtph);
end

%-Cleanup
%--------------------------------------------------------------------------
spm('FigName','M/EEG Time Frequency: done'); spm('Pointer','Arrow');


text:
var gulp = require('gulp'),
    inject = require('gulp-inject'),
    browserSync = require('browser-sync').create(),
    config = require('../../gulp.config'),
    mainBowerFiles = require('main-bower-files');

gulp.task('test:unit', ['scripts', 'app-config'], function() {
    runUnitTests();
    serveTests();
});

function runUnitTests() {
    var target = gulp.src('./gulp/test/SpecRunner.html'),
        bowerFiles = gulp.src(mainBowerFiles({includeDev: true, filter: '**/*.js'}), {read: false}),
        appFiles = gulp.src([].concat(
            config.build + '**/app.js',
            config.build + '**/*.js'
        ), {read: false}),
        specFiles = gulp.src([].concat(
            config.src + '**/*.spec.js',
            config.components.dir + '**/*.spec.js'
        ), {read: false}),
        jasmineFiles = gulp.src([
            './node_modules/jasmine-core/lib/jasmine-core/jasmine.css',
            './node_modules/jasmine-core/lib/jasmine-core/jasmine.js',
            './node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js',
            './node_modules/jasmine-core/lib/jasmine-core/boot.js'
        ], {read:false});

    return target
        .pipe(inject(jasmineFiles, {name: 'jasmine'}))
        .pipe(inject(bowerFiles, {name: 'bower'}))
        .pipe(inject(appFiles))
        .pipe(inject(specFiles, {name: 'spec'}))
        .pipe(gulp.dest('./gulp/test/'));
}

function serveTests() {
    console.log(config.root + config.src.replace('.', '') + 'app/');
    browserSync.init({
        logLevel: 'silent',
        notify: false,
        open: true,
        port: 4520,
        files: [
            config.build + '**/*.js'
        ],
        server: {
            index: 'SpecRunner.html',
            baseDir: [
                config.root,
                config.components.dir + '/../',
                __dirname,
                config.root + config.src.replace('.', '') + 'app/'
            ]
        },
        ui: false
    });
}

module.exports = {
    RunUnitTests: runUnitTests,
    ServeTests: serveTests
};


text:
const emptyListItemSnippets = [
  { name: "empty list items (issue 4122)", code: "1.\n2.\n3.\n4." },
  {
    name: "empty list items with spaces (issue 4122)",
    code: "1. \n2. \n3. \n4. ",
  },
];

run_spec(
  { dirname: __dirname, snippets: emptyListItemSnippets },
  ["markdown"],
  { proseWrap: "always" }
);
run_spec(__dirname, ["markdown"], { proseWrap: "always", tabWidth: 4 });
run_spec(__dirname, ["markdown"], { proseWrap: "always", tabWidth: 999 });
run_spec(__dirname, ["markdown"], { proseWrap: "always", tabWidth: 0 });


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.jreaper.common.model.entity.search.impl" auto-import="true">
    <class name="FieldImpl" table="FIELD">
        <cache usage="nonstrict-read-write" region="com.jreaper.EHCOMMON"/>
        <id column="ID" name="id" unsaved-value="0">
            <generator class="native"/>
        </id>

        <property column="UUID" name="uuid" unique="true" not-null="true"/>
        <property column="ENTITY_TYPE" name="entityType" not-null="true" index="ENTITY_TYPE_INDEX" type="com.jreaper.common.util.FieldEntityUserType"/>
        <property column="PROPERTY_NAME" name="propertyName" not-null="true"/>
        <property column="ABBREVIATION" name="abbreviation"/>
        <property column="SEARCHABLE" name="searchable"/>
        <property column="FACET_FIELD_TYPE" name="facetFieldType" type="com.jreaper.common.util.FieldTypeUserType"/>
        <property column="TRANSLATABLE" name="translatable"/>
        <bag name="searchableFieldTypes" table="FIELD_SEARCH_TYPES" batch-size="50" lazy="false">
            <cache usage="nonstrict-read-write" region="com.jreaper.EHCOMMON"/>
            <key column="FIELD_ID" foreign-key="FK_FIELD"/>
            <element column="SEARCHABLE_FIELD_TYPE" type="com.jreaper.common.util.FieldTypeUserType" />
        </bag>

    </class>
</hibernate-mapping>


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- From: file:/Volumes/Woogis-Dev/Git%20Repository/SisatongPodcast/app/build/intermediates/exploded-aar/SisatongPodcast/core/unspecified/res/values-v19/values-v19.xml -->
    <eat-comment/>
    <color name="selection_background_color_dark">#484B4D</color>
    <color name="selection_background_color_light">#E3E3E3</color>
</resources>


text:
namespace pddl
{
namespace normalizedAST
{

////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Output
//
////////////////////////////////////////////////////////////////////////////////////////////////////

using ast::print;

////////////////////////////////////////////////////////////////////////////////////////////////////
// Forward declarations
////////////////////////////////////////////////////////////////////////////////////////////////////

inline colorlog::ColorStream &print(colorlog::ColorStream &stream, const DerivedPredicate &derivedPredicate, pddl::detail::PrintContext &printContext);
inline colorlog::ColorStream &print(colorlog::ColorStream &stream, const DerivedPredicateDeclaration &derivedPredicateDeclaration, pddl::detail::PrintContext &printContext);

inline colorlog::ColorStream &print(colorlog::ColorStream &stream, const Action &action, pddl::detail::PrintContext &printContext);
inline colorlog::ColorStream &print(colorlog::ColorStream &stream, const Domain &domain, pddl::detail::PrintContext &printContext);
inline colorlog::ColorStream &print(colorlog::ColorStream &stream, const InitialState &initialState, pddl::detail::PrintContext &printContext);
inline colorlog::ColorStream &print(colorlog::ColorStream &stream, const Problem &problem, pddl::detail::PrintContext &printContext);
inline colorlog::ColorStream &print(colorlog::ColorStream &stream, const Requirement &requirement, pddl::detail::PrintContext &printContext);
inline colorlog::ColorStream &print(colorlog::ColorStream &stream, const Description &description, pddl::detail::PrintContext &printContext);

////////////////////////////////////////////////////////////////////////////////////////////////////
// Compounds
////////////////////////////////////////////////////////////////////////////////////////////////////

inline colorlog::ColorStream &print(colorlog::ColorStream &stream, const DerivedPredicate &derivedPredicate, pddl::detail::PrintContext &printContext)
{
	// TODO: implement correctly

	stream << "(" << pddl::detail::Identifier(derivedPredicate.declaration->name);

	for (const auto &argument : derivedPredicate.arguments)
	{
		stream << " ";
		print(stream, argument, printContext);
	}

	return (stream << ")");
}

////////////////////////////////////////////////////////////////////////////////////////////////////

inline colorlog::ColorStream &print(colorlog::ColorStream &stream, const DerivedPredicateDeclaration &derivedPredicateDeclaration, pddl::detail::PrintContext &printContext)
{
	stream << "(" << colorlog::Keyword(":derived-predicate") << " " << pddl::detail::Identifier(derivedPredicateDeclaration.name);

	printContext.indentationLevel++;

	if (!derivedPredicateDeclaration.parameters.empty())
	{
		pddl::detail::printIndentedNewline(stream, printContext);
		stream << colorlog::Keyword(":parameters");

		printContext.indentationLevel++;

		pddl::detail::printIndentedNewline(stream, printContext);
		stream << "(";

		for (const auto &parameter : derivedPredicateDeclaration.parameters)
		{
			if (&parameter != &derivedPredicateDeclaration.parameters.front())
				pddl::detail::printIndentedNewline(stream, printContext);

			print(stream, *parameter, printContext);
		}

		stream << ")";

		printContext.indentationLevel--;
	}

	if (!derivedPredicateDeclaration.existentialParameters.empty())
	{
		pddl::detail::printIndentedNewline(stream, printContext);
		stream << colorlog::Keyword(":exists");

		printContext.indentationLevel++;

		pddl::detail::printIndentedNewline(stream, printContext);
		stream << "(";

		for (const auto &parameter : derivedPredicateDeclaration.existentialParameters)
		{
			if (parameter.get() != derivedPredicateDeclaration.existentialParameters.front().get())
				pddl::detail::printIndentedNewline(stream, printContext);

			print(stream, *parameter, printContext);
		}

		stream << ")";

		printContext.indentationLevel--;
	}

	if (derivedPredicateDeclaration.precondition)
	{
		pddl::detail::printIndentedNewline(stream, printContext);
		stream << colorlog::Keyword(":precondition");

		printContext.indentationLevel++;

		pddl::detail::printIndentedNewline(stream, printContext);
		print(stream, derivedPredicateDeclaration.precondition.value(), printContext);

		printContext.indentationLevel--;
	}

	printContext.indentationLevel--;

	return (stream << ")");
}

////////////////////////////////////////////////////////////////////////////////////////////////////
// PDDL Structure
////////////////////////////////////////////////////////////////////////////////////////////////////

inline colorlog::ColorStream &print(colorlog::ColorStream &stream, const Action &action, pddl::detail::PrintContext &printContext)
{
	stream << "(" << colorlog::Keyword(":action") << " " << pddl::detail::Identifier(action.name);

	printContext.indentationLevel++;

	if (!action.parameters.empty())
	{
		printIndentedNewline(stream, printContext);
		stream << colorlog::Keyword(":parameters");

		printContext.indentationLevel++;

		printIndentedNewline(stream, printContext);
		stream << "(";
		print(stream, action.parameters, printContext);
		stream << ")";

		printContext.indentationLevel--;
	}

	if (action.precondition)
	{
		printIndentedNewline(stream, printContext);
		stream << colorlog::Keyword(":precondition");

		printContext.indentationLevel++;

		printIndentedNewline(stream, printContext);
		print(stream, action.precondition.value(), printContext);

		printContext.indentationLevel--;
	}

	if (action.effect)
	{
		printIndentedNewline(stream, printContext);
		stream << colorlog::Keyword(":effect");

		printContext.indentationLevel++;

		printIndentedNewline(stream, printContext);
		print(stream, action.effect.value(), printContext);

		printContext.indentationLevel--;
	}

	printContext.indentationLevel--;

	return (stream << ")");
}

////////////////////////////////////////////////////////////////////////////////////////////////////

inline colorlog::ColorStream &print(colorlog::ColorStream &stream, const Domain &domain, pddl::detail::PrintContext &printContext)
{
	stream << "(" << colorlog::Keyword("define") << " (" << colorlog::Keyword("domain") << " " << pddl::detail::Identifier(domain.name) << ")";

	printContext.indentationLevel++;

	if (!domain.types.empty())
	{
		printIndentedNewline(stream, printContext);
		stream << "(" << colorlog::Keyword(":types");

		printContext.indentationLevel++;

		printIndentedNewline(stream, printContext);
		print(stream, domain.types, printContext);
		stream << ")";

		printContext.indentationLevel--;
	}

	if (!domain.constants.empty())
	{
		printIndentedNewline(stream, printContext);
		stream << "(" << colorlog::Keyword(":constants");

		printContext.indentationLevel++;

		printIndentedNewline(stream, printContext);
		print(stream, domain.constants, printContext);
		stream << ")";

		printContext.indentationLevel--;
	}

	if (!domain.predicates.empty())
	{
		printIndentedNewline(stream, printContext);
		stream << "(" << colorlog::Keyword(":predicates");

		printContext.indentationLevel++;

		printIndentedNewline(stream, printContext);
		print(stream, domain.predicates, printContext);
		stream << ")";

		printContext.indentationLevel--;
	}

	if (!domain.derivedPredicates.empty())
	{
		printIndentedNewline(stream, printContext);
		print(stream, domain.derivedPredicates, printContext);
	}

	if (!domain.actions.empty())
	{
		printIndentedNewline(stream, printContext);
		print(stream, domain.actions, printContext);
	}

	printContext.indentationLevel--;

	return (stream << ")");
}

////////////////////////////////////////////////////////////////////////////////////////////////////

inline colorlog::ColorStream &print(colorlog::ColorStream &stream, const InitialState &initialState, pddl::detail::PrintContext &printContext)
{
	assert(!initialState.facts.empty());

	stream << "(" << colorlog::Keyword(":init");

	printContext.indentationLevel++;

	printIndentedNewline(stream, printContext);
	print(stream, initialState.facts, printContext);

	printContext.indentationLevel--;

	return (stream << ")");
}

////////////////////////////////////////////////////////////////////////////////////////////////////

inline colorlog::ColorStream &print(colorlog::ColorStream &stream, const Problem &problem, pddl::detail::PrintContext &printContext)
{
	stream << "(" << colorlog::Keyword("define") << " (" << colorlog::Keyword("problem") << " " << pddl::detail::Identifier(problem.name) << ")";

	printContext.indentationLevel++;

	printIndentedNewline(stream, printContext);
	stream << "(" << colorlog::Keyword(":domain") << " " << pddl::detail::Identifier(problem.domain->name) << ")";

	if (!problem.derivedPredicates.empty())
	{
		printIndentedNewline(stream, printContext);
		print(stream, problem.derivedPredicates, printContext);
	}

	if (!problem.objects.empty())
	{
		printIndentedNewline(stream, printContext);
		stream << "(" << colorlog::Keyword(":objects");

		printContext.indentationLevel++;

		printIndentedNewline(stream, printContext);
		print(stream, problem.objects, printContext);
		stream << ")";

		printContext.indentationLevel--;
	}

	if (!problem.initialState.facts.empty())
	{
		printIndentedNewline(stream, printContext);
		print(stream, problem.initialState, printContext);
	}

	if (problem.goal)
	{
		printIndentedNewline(stream, printContext);
		stream << "(" << colorlog::Keyword(":goal");

		printContext.indentationLevel++;

		printIndentedNewline(stream, printContext);
		print(stream, problem.goal.value(), printContext);
		stream << ")";

		printContext.indentationLevel--;
	}

	printContext.indentationLevel--;

	return (stream << ")");
}

////////////////////////////////////////////////////////////////////////////////////////////////////

inline colorlog::ColorStream &print(colorlog::ColorStream &stream, const Description &description, pddl::detail::PrintContext &printContext)
{
	print(stream, *description.domain, printContext);
	stream << std::endl;

	if (description.problem)
	{
		stream << std::endl;
		print(stream, *description.problem.value(), printContext);
		stream << std::endl;
	}

	return stream;
}

////////////////////////////////////////////////////////////////////////////////////////////////////

inline colorlog::ColorStream &operator<<(colorlog::ColorStream &stream, const Description &description)
{
	pddl::detail::PrintContext printContext;

	return print(stream, description, printContext);
}

////////////////////////////////////////////////////////////////////////////////////////////////////

}
}

#endif


text:
package org.encog;

import java.util.Map;

import junit.framework.TestCase;

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

public class TestEncog extends TestCase {

	@Test
	public void testProperties() throws Throwable {
		Encog instance1 = Encog.getInstance();
		Encog instance2 = Encog.getInstance();
		Assert.assertSame(instance1, instance2);
		Map<String, String> map = instance1.getProperties();
		Assert.assertNotNull(map);
	}

	public void testConsole() throws Throwable {
		ConsoleStatusReportable console = new ConsoleStatusReportable();
		console.report(0, 1, "Test console");
		console.report(1, 1, "Test console");

		NullStatusReportable n = new NullStatusReportable();
		n.report(0, 1, "Test console");
		n.report(1, 1, "Test console");
	}
}


text:
<component name="ArtifactManager">
  <artifact type="jar" name="Informer:jar">
    <output-path>$PROJECT_DIR$/out/artifacts/Informer_jar</output-path>
    <root id="archive" name="Informer.jar">
      <element id="module-output" name="Informer" />
      <element id="extracted-dir" path="$PROJECT_DIR$/jfoenix.jar" path-in-jar="/" />
      <element id="extracted-dir" path="$PROJECT_DIR$/../InformerAPI/out/artifacts/InformerAPI/InformerAPI.jar" path-in-jar="/" />
      <element id="extracted-dir" path="$PROJECT_DIR$/emoji-java-3.1.3.jar" path-in-jar="/" />
      <element id="extracted-dir" path="$PROJECT_DIR$/json-20160810.jar" path-in-jar="/" />
    </root>
  </artifact>
</component>


text:
Software broadband access server (BBRAS)

### Features

- User sessions AAA (Authentication, Authorization and Accounting)
- Rich set of various rules for user service customization
  - Firewall (restrict or grant access to specific ports)
  - Forwarding rules (as DNAT)
  - Deferred rules
  - Bandwidth limiting rules
- Realtime traffic monitoring
- Dynamic ARP inspection
- IP source verify
- HTTP URL blacklisting
- Virtual instances

### Build instructions

You need the following libraries installed:
- [cmake](http://www.cmake.org/), >= 2.8, cross-platform, open-source build system
- [libevent](http://libevent.org/), >= 2.0, event-based network I/O library
- [libconfig](https://github.com/hyperrealm/libconfig), >= 1.4, configuration management library
- [netmap](https://github.com/luigirizzo/netmap), >= 20131019, fast network packet I/O framework
- [libfreeradius-client](https://github.com/FreeRADIUS/freeradius-client), >=1.7, framework and library for writing RADIUS Clients
- [libbson](https://github.com/mongodb/libbson), >= 1.0, building, parsing, and iterating BSON documents
- [python](https://www.python.org/), >= 3.0, interactive high-level object-oriented language
- [pymongo](https://github.com/mongodb/mongo-python-driver), BSON implementation for python
- [libpcap](https://github.com/the-tcpdump-group/libpcap), the LIBpcap interface to various kernel packet capture mechanism
- [libpcre](http://www.pcre.org/), Perl Compatible Regular Expressions
- [jemalloc](https://github.com/jemalloc/jemalloc), >= 3.0, general purpose malloc(3) implementation

Build using cmake:
```bash
mkdir build
cd build
cmake ..
make
```


text:
var Flow	= function(){
	var self, stack = [], timerId = setTimeout(function(){ timerId = null; self._next(); }, 0);
	return self = {
		destroy : function(){ timerId && clearTimeout(timerId); },
		par	: function(callback, isSeq){
			if(isSeq || !(stack[stack.length-1] instanceof Array)) stack.push([]);
			stack[stack.length-1].push(callback);
			return self;
		},seq	: function(callback){ return self.par(callback, true);	},
		_next	: function(err, result){
			var errors = [], results = [], callbacks = stack.shift() || [], nbReturn = callbacks.length, isSeq = nbReturn == 1;
			for(var i = 0; i < callbacks.length; i++){
				(function(fct, index){
					fct(function(error, result){
						errors[index]	= error;
						results[index]	= result;
						if(--nbReturn == 0)	self._next(isSeq?errors[0]:errors, isSeq?results[0]:results)
					}, err, result)
				})(callbacks[i], i);
			}
		}
	}
};

// export in common js
if( typeof module !== "undefined" && ('exports' in module)){
	module.exports	= Flow;
}

// Asynchronous Module Definition - http://requirejs.org/docs/whyamd.html
if( typeof define === 'function' && define.amd) {
	define('Flow', [], function () { return Flow; } );
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Shop Item - Start Bootstrap Template</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/custom.css" rel="stylesheet">
    <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">

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

                    </button>
                    everyjob

                        Home

                        About

                        Services

                        Register

                        Sign In

I can write an SEO friendly article in about 3000 words on any topic.

                    by sumeetbajra
                     2015-03-02
                    Category: Creative Writing and Editing

Service Description

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum

3 reviews

                            4.0 stars

                        Leave a Review

                            Anonymous
                            10 days ago

This product was great in terms of quality. I would definitely buy another!

                            Anonymous
                            12 days ago

I've alredy ordered another one!

                            Anonymous
                            15 days ago

I've seen some better than this, but not at this price. I definitely recommend this item.

         Service Statistics

Sold: 4532 Queue: 34

Rs4500.00

                     Order
                     Add to Cart

Manning Hilton

                    View profile

                          Location

                          5th Avenue Street, Oklahoma

                          Age

                          23 years

                          Hobby

                          Singing, Dancing, Music, Travel

                          Joined date

                          5th November, 2014

About me

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ex ligula, scelerisque nec turpis ac, placerat porta magna. Duis tincidunt pharetra turpis in interdum. Donec sem tortor, varius scelerisque enim eget, pharetra sollicitudin velit. Ut lectus felis, consequat non iaculis ut, finibus a purus. Ut eget massa gravida, gravida felis eget, molestie lorem. Aenean porta ligula vel metus sollicitudin blandit. Suspendisse nec nisi non enim sagittis fermentum. Nunc fringilla sem vel feugiat luctus. Integer sit amet molestie tellus. Curabitur pulvinar urna et sem pretium, et cursus arcu feugiat. Sed nibh lorem, vestibulum nec augue at, euismod aliquet arcu.
Read more...

                        everyjob

About Unify dolor sit amet, consectetur adipiscing elit. Maecenas eget nisl id libero tincidunt sodales.

Duis eleifend fermentum ante ut aliquam. Cras mi risus, dignissim sed adipiscing ut, placerat non arcu.

Latest Posts

                                    Incredible content
                                    May 8, 2014

                                    Best shoots
                                    June 23, 2014

                                    New Terms and Conditions
                                    September 15, 2014

Useful Links

About us

Portfolio

Latest jobs

Community

Contact us

Contact Us

                        <address class="md-margin-bottom-40">
                            25, Lorem Lis Street, Orange

                            California, US

                            Phone: 800 123 3456

                            Fax: 800 123 3456

                            Email: info@anybiz.com
                        </address>

                            2014 © All Rights Reserved.
                           Privacy Policy | Terms of Service


text:
<component name="libraryTable">
  <library name="SBT: mysql:mysql-connector-java:5.1.34:jar">
    <CLASSES>
      <root url="jar://$USER_HOME$/.ivy2/cache/mysql/mysql-connector-java/jars/mysql-connector-java-5.1.34.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>


text:
using namespace std;

int main()
{
	Game snakeGame;
	snakeGame.Menu();

	system("pause");
	return 0;
}


text:
//#include "../include/cfrtil32.h"
//#include "config.h"
//#include "i18n.h"

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <sys/types.h>
#include <string.h>
#include <time.h>

#include <fx.h>
#include <fxkeys.h>
#include <FXPNGIcon.h>

void
foxWindow ( int argc, char *argv[] ) {

  FXApp application("Hello", "FoxTest");
  application.init(argc, argv);
  FXMainWindow *main=new FXMainWindow(&application, "Hello", NULL, NULL, DECOR_ALL);
  new FXButton(main, "&Hello, World!", NULL, &application, FXApp::ID_QUIT);
  application.create();
  main->show(PLACEMENT_SCREEN);
  application.run();
}

#if 0
/* first include the standard headers that we're likely to need */
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xresource.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int
xwindow ( int width, int height )
{
    int screen_num ; //, width, height ;
    unsigned long background, border ;
    Window win ;
    XEvent ev ;
    Display *dpy ;

    /* First connect to the display server */
    dpy = XOpenDisplay ( NULL ) ;
    if ( ! dpy )
    {
        fprintf ( stderr, "unable to connect to display\n" ) ;
        return 7 ;
    }

    /* these are macros that pull useful data out of the display object */
    /* we use these bits of info enough to want them in their own variables */
    screen_num = DefaultScreen ( dpy ) ;
    background = BlackPixel ( dpy, screen_num ) ;
    border = WhitePixel ( dpy, screen_num ) ;

    width = 400 ; /* start with a small window */
    height = 400 ;

    win = XCreateSimpleWindow ( dpy, DefaultRootWindow ( dpy ), /* display, parent */
        10, 10, /* x, y: the window manager will place the window elsewhere */
        width, height, /* width, height */
        2, border, /* border width & colour, unless you have a window manager */
        background ) ; /* background colour */

    /* tell the display server what kind of events we would like to see */
    XSelectInput ( dpy, win, ButtonPressMask | StructureNotifyMask ) ;

    /* okay, put the window on the screen, please */
    XMapWindow ( dpy, win ) ;

    Atom wmDeleteMessage = XInternAtom ( dpy, "WM_DELETE_WINDOW", False ) ;
    XSetWMProtocols ( dpy, win, &wmDeleteMessage, 1 ) ; /* as each event that we asked about occurs, we respond.  In this
     * case we note if the window's shape changed, and exit if a button
     * is pressed inside the window */
    Boolean running = true ;
    while ( running )
    {
        XNextEvent ( dpy, &ev ) ;
        switch ( ev.type )
        {
            case ConfigureNotify:
                if ( width != ev.xconfigure.width
                    || height != ev.xconfigure.height )
                {
                    width = ev.xconfigure.width ;
                    height = ev.xconfigure.height ;
                    printf ( "Size changed to: %d by %d\n", width, height ) ;
                }
                break ;
            case ButtonPress:
                //XCloseDisplay ( dpy ) ;
                return 0 ;
                //goto done ;
            case ClientMessage:
            {
                if ( ev.xclient.data.l[0] == wmDeleteMessage )
                    running = false ;
                //break ;
                    return 0 ;
            }
        }
    }
    //done :
    //XDestroyWindow(dpy,ev.xclient.window);
    //XDestroyWindow(dpy,ev.xclient.window);
    XDestroyWindow(dpy,ev.xdestroywindow.window);
    //XCloseDisplay(dpy);
}

#endif


text:
var fs = require('fs');
var path = require('path');

var files = fs.readdirSync(__dirname);

files.forEach(function(file){
	var fileName = path.basename(file, '.js');

	if(fileName !== 'index'){
		exports[fileName] = require('./'+ fileName);
	}

});


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Bull. Soc. mycol. Fr. 30: 73 (1914)

#### Original name
Peronospora trifoliorum var. manshurica Naumov, 1914

### Remarks
null