text:
package org.apache.druid.indexing.overlord;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableList;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
import com.google.errorprone.annotations.concurrent.GuardedBy;
import org.apache.druid.indexer.RunnerTaskState;
import org.apache.druid.indexer.TaskLocation;
import org.apache.druid.indexer.TaskStatus;
import org.apache.druid.indexing.common.actions.TaskAction;
import org.apache.druid.indexing.common.actions.TaskActionClient;
import org.apache.druid.indexing.common.actions.TaskActionClientFactory;
import org.apache.druid.indexing.common.config.TaskStorageConfig;
import org.apache.druid.indexing.common.task.NoopTask;
import org.apache.druid.indexing.common.task.Task;
import org.apache.druid.indexing.overlord.autoscaling.ScalingStats;
import org.apache.druid.indexing.overlord.config.DefaultTaskConfig;
import org.apache.druid.indexing.overlord.config.TaskLockConfig;
import org.apache.druid.indexing.overlord.config.TaskQueueConfig;
import org.apache.druid.java.util.common.Pair;
import org.apache.druid.java.util.common.concurrent.ScheduledExecutors;
import org.apache.druid.java.util.common.io.Closer;
import org.apache.druid.java.util.common.logger.Logger;
import org.apache.druid.java.util.emitter.EmittingLogger;
import org.apache.druid.metadata.IndexerSQLMetadataStorageCoordinator;
import org.apache.druid.metadata.TaskLookup;
import org.apache.druid.metadata.TestDerbyConnector;
import org.apache.druid.segment.TestHelper;
import org.apache.druid.server.metrics.NoopServiceEmitter;
import org.joda.time.Duration;
import org.joda.time.Period;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;

import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

/**
 * Tests that {@link TaskQueue} is able to handle large numbers of concurrently-running tasks.
 */
public class TaskQueueScaleTest
{
  private static final String DATASOURCE = "ds";

  private final int numTasks = 1000;

  @Rule
  public final TestDerbyConnector.DerbyConnectorRule derbyConnectorRule = new TestDerbyConnector.DerbyConnectorRule();

  private TaskQueue taskQueue;
  private TaskStorage taskStorage;
  private TestTaskRunner taskRunner;
  private Closer closer;

  @Before
  public void setUp()
  {
    EmittingLogger.registerEmitter(new NoopServiceEmitter());

    closer = Closer.create();

    // Be as realistic as possible; use actual classes for storage rather than mocks.
    taskStorage = new HeapMemoryTaskStorage(new TaskStorageConfig(Period.hours(1)));
    taskRunner = new TestTaskRunner();
    closer.register(taskRunner::stop);
    final ObjectMapper jsonMapper = TestHelper.makeJsonMapper();

    final IndexerSQLMetadataStorageCoordinator storageCoordinator = new IndexerSQLMetadataStorageCoordinator(
        jsonMapper,
        derbyConnectorRule.metadataTablesConfigSupplier().get(),
        derbyConnectorRule.getConnector()
    );

    final TaskActionClientFactory unsupportedTaskActionFactory =
        task -> new TaskActionClient()
        {
          @Override
          public <RetType> RetType submit(TaskAction<RetType> taskAction)
          {
            throw new UnsupportedOperationException();
          }
        };

    taskQueue = new TaskQueue(
        new TaskLockConfig(),
        new TaskQueueConfig(null, Period.millis(1), null, null),
        new DefaultTaskConfig(),
        taskStorage,
        taskRunner,
        unsupportedTaskActionFactory, // Not used for anything serious
        new TaskLockbox(taskStorage, storageCoordinator),
        new NoopServiceEmitter()
    );

    taskQueue.start();
    closer.register(taskQueue::stop);
  }

  @After
  public void tearDown() throws Exception
  {
    closer.close();
  }

  @Test(timeout = 60_000L) // more than enough time if the task queue is efficient
  public void doMassLaunchAndExit() throws Exception
  {
    Assert.assertEquals("no tasks should be running", 0, taskRunner.getKnownTasks().size());
    Assert.assertEquals("no tasks should be known", 0, taskQueue.getTasks().size());
    Assert.assertEquals("no tasks should be running", 0, taskQueue.getRunningTaskCount().size());

    // Add all tasks.
    for (int i = 0; i < numTasks; i++) {
      final TestTask testTask = new TestTask(i, 2000L /* runtime millis */);
      taskQueue.add(testTask);
    }

    // in theory we can get a race here, since we fetch the counts at separate times
    Assert.assertEquals("all tasks should be known", numTasks, taskQueue.getTasks().size());
    long runningTasks = taskQueue.getRunningTaskCount().values().stream().mapToLong(Long::longValue).sum();
    long pendingTasks = taskQueue.getPendingTaskCount().values().stream().mapToLong(Long::longValue).sum();
    long waitingTasks = taskQueue.getWaitingTaskCount().values().stream().mapToLong(Long::longValue).sum();
    Assert.assertEquals("all tasks should be known", numTasks, (runningTasks + pendingTasks + waitingTasks));

    // Wait for all tasks to finish.
    final TaskLookup.CompleteTaskLookup completeTaskLookup =
        TaskLookup.CompleteTaskLookup.of(numTasks, Duration.standardHours(1));

    while (taskStorage.getTaskInfos(completeTaskLookup, DATASOURCE).size() < numTasks) {
      Thread.sleep(100);
    }

    Thread.sleep(100);

    Assert.assertEquals("no tasks should be active", 0, taskStorage.getActiveTasks().size());
    runningTasks = taskQueue.getRunningTaskCount().values().stream().mapToLong(Long::longValue).sum();
    pendingTasks = taskQueue.getPendingTaskCount().values().stream().mapToLong(Long::longValue).sum();
    waitingTasks = taskQueue.getWaitingTaskCount().values().stream().mapToLong(Long::longValue).sum();
    Assert.assertEquals("no tasks should be running", 0, runningTasks);
    Assert.assertEquals("no tasks should be pending", 0, pendingTasks);
    Assert.assertEquals("no tasks should be waiting", 0, waitingTasks);
  }

  @Test(timeout = 60_000L) // more than enough time if the task queue is efficient
  public void doMassLaunchAndShutdown() throws Exception
  {
    Assert.assertEquals("no tasks should be running", 0, taskRunner.getKnownTasks().size());

    // Add all tasks.
    final List<String> taskIds = new ArrayList<>();
    for (int i = 0; i < numTasks; i++) {
      final TestTask testTask = new TestTask(
          i,
          Duration.standardHours(1).getMillis() /* very long runtime millis, so we can do a shutdown */
      );
      taskQueue.add(testTask);
      taskIds.add(testTask.getId());
    }

    // wait for all tasks to progress to running state
    while (taskStorage.getActiveTasks().size() < numTasks) {
      Thread.sleep(100);
    }
    Assert.assertEquals("all tasks should be running", numTasks, taskStorage.getActiveTasks().size());

    // Shut down all tasks.
    for (final String taskId : taskIds) {
      taskQueue.shutdown(taskId, "test shutdown");
    }

    // Wait for all tasks to finish.
    while (!taskStorage.getActiveTasks().isEmpty()) {
      Thread.sleep(100);
    }

    Assert.assertEquals("no tasks should be running", 0, taskStorage.getActiveTasks().size());

    int completed = taskStorage.getTaskInfos(
        TaskLookup.CompleteTaskLookup.of(numTasks, Duration.standardHours(1)),
        DATASOURCE
    ).size();
    Assert.assertEquals("all tasks should have completed", numTasks, completed);
  }

  private static class TestTask extends NoopTask
  {
    private final int number;
    private final long runtime;

    public TestTask(int number, long runtime)
    {
      super(null, null, DATASOURCE, 0, 0, null, null, Collections.emptyMap());
      this.number = number;
      this.runtime = runtime;
    }

    public int getNumber()
    {
      return number;
    }

    public long getRuntimeMillis()
    {
      return runtime;
    }
  }

  private static class TestTaskRunner implements TaskRunner
  {
    private static final Logger log = new Logger(TestTaskRunner.class);
    private static final Duration T_PENDING_TO_RUNNING = Duration.standardSeconds(2);
    private static final Duration T_SHUTDOWN_ACK = Duration.millis(8);
    private static final Duration T_SHUTDOWN_COMPLETE = Duration.standardSeconds(2);

    @GuardedBy("knownTasks")
    private final Map<String, TestTaskRunnerWorkItem> knownTasks = new HashMap<>();

    private final ScheduledExecutorService exec = ScheduledExecutors.fixed(8, "TaskQueueScaleTest-%s");

    @Override
    public void start()
    {
      throw new UnsupportedOperationException();
    }

    @Override
    public ListenableFuture<TaskStatus> run(Task task)
    {
      // Production task runners generally do not take a long time to execute "run", but may take a long time to
      // go from "running" to "pending".
      synchronized (knownTasks) {
        final TestTaskRunnerWorkItem item = knownTasks.computeIfAbsent(task.getId(), TestTaskRunnerWorkItem::new);
        exec.schedule(
            () -> {
              try {
                synchronized (knownTasks) {
                  final TestTaskRunnerWorkItem item2 = knownTasks.get(task.getId());
                  if (item2.getState() == RunnerTaskState.PENDING) {
                    knownTasks.put(task.getId(), item2.withState(RunnerTaskState.RUNNING));
                  }
                }

                exec.schedule(
                    () -> {
                      try {
                        final TestTaskRunnerWorkItem item2;
                        synchronized (knownTasks) {
                          item2 = knownTasks.get(task.getId());
                          knownTasks.put(task.getId(), item2.withState(RunnerTaskState.NONE));
                        }
                        if (item2 != null) {
                          item2.setResult(TaskStatus.success(task.getId()));
                        }
                      }
                      catch (Throwable e) {
                        log.error(e, "Error in scheduled executor");
                      }
                    },
                    ((TestTask) task).getRuntimeMillis(),
                    TimeUnit.MILLISECONDS
                );
              }
              catch (Throwable e) {
                log.error(e, "Error in scheduled executor");
              }
            },
            T_PENDING_TO_RUNNING.getMillis(),
            TimeUnit.MILLISECONDS
        );

        return item.getResult();
      }
    }

    @Override
    public void shutdown(String taskid, String reason)
    {
      // Production task runners take a long time to execute "shutdown" if the task is currently running.
      synchronized (knownTasks) {
        if (!knownTasks.containsKey(taskid)) {
          return;
        }
      }

      threadSleep(T_SHUTDOWN_ACK);

      final TestTaskRunnerWorkItem existingTask;
      synchronized (knownTasks) {
        existingTask = knownTasks.get(taskid);
      }
      if (!existingTask.getResult().isDone()) {
        exec.schedule(() -> {
          existingTask.setResult(TaskStatus.failure("taskId", "stopped"));
          synchronized (knownTasks) {
            knownTasks.remove(taskid);
          }
        }, T_SHUTDOWN_COMPLETE.getMillis(), TimeUnit.MILLISECONDS);
      }
    }

    static void threadSleep(Duration duration)
    {
      try {
        Thread.sleep(duration.getMillis());
      }
      catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        throw new RuntimeException(e);
      }
    }

    @Override
    public void registerListener(TaskRunnerListener listener, Executor executor)
    {
      throw new UnsupportedOperationException();
    }

    @Override
    public void unregisterListener(String listenerId)
    {
      throw new UnsupportedOperationException();
    }

    @Override
    public List<Pair<Task, ListenableFuture<TaskStatus>>> restore()
    {
      // Do nothing, and return null. (TaskQueue doesn't use the return value.)
      return null;
    }

    @Override
    public void stop()
    {
      exec.shutdownNow();
    }

    @Override
    public Collection<? extends TaskRunnerWorkItem> getRunningTasks()
    {
      synchronized (knownTasks) {
        return knownTasks.values()
                         .stream()
                         .filter(item -> item.getState() == RunnerTaskState.RUNNING)
                         .collect(Collectors.toList());
      }
    }

    @Override
    public Collection<? extends TaskRunnerWorkItem> getPendingTasks()
    {
      synchronized (knownTasks) {
        return knownTasks.values()
                         .stream()
                         .filter(item -> item.getState() == RunnerTaskState.PENDING)
                         .collect(Collectors.toList());
      }
    }

    @Override
    public Collection<? extends TaskRunnerWorkItem> getKnownTasks()
    {
      synchronized (knownTasks) {
        return ImmutableList.copyOf(knownTasks.values());
      }
    }

    @Override
    public Optional<ScalingStats> getScalingStats()
    {
      throw new UnsupportedOperationException();
    }

    @Override
    public Map<String, Long> getTotalTaskSlotCount()
    {
      throw new UnsupportedOperationException();
    }

    @Override
    public Map<String, Long> getIdleTaskSlotCount()
    {
      throw new UnsupportedOperationException();
    }

    @Override
    public Map<String, Long> getUsedTaskSlotCount()
    {
      throw new UnsupportedOperationException();
    }

    @Override
    public Map<String, Long> getLazyTaskSlotCount()
    {
      throw new UnsupportedOperationException();
    }

    @Override
    public Map<String, Long> getBlacklistedTaskSlotCount()
    {
      throw new UnsupportedOperationException();
    }
  }

  private static class TestTaskRunnerWorkItem extends TaskRunnerWorkItem
  {
    private final RunnerTaskState state;

    public TestTaskRunnerWorkItem(final String taskId)
    {
      this(taskId, SettableFuture.create(), RunnerTaskState.PENDING);
    }

    private TestTaskRunnerWorkItem(
        final String taskId,
        final ListenableFuture<TaskStatus> result,
        final RunnerTaskState state
    )
    {
      super(taskId, result);
      this.state = state;
    }

    public RunnerTaskState getState()
    {
      return state;
    }

    @Override
    public TaskLocation getLocation()
    {
      return TaskLocation.unknown();
    }

    @Nullable
    @Override
    public String getTaskType()
    {
      throw new UnsupportedOperationException();
    }

    @Override
    public String getDataSource()
    {
      throw new UnsupportedOperationException();
    }

    public void setResult(final TaskStatus result)
    {
      ((SettableFuture<TaskStatus>) getResult()).set(result);

      // possibly a parallel shutdown request was issued during the
      // shutdown time; ignore it
    }

    public TestTaskRunnerWorkItem withState(final RunnerTaskState newState)
    {
      return new TestTaskRunnerWorkItem(getTaskId(), getResult(), newState);
    }
  }
}


text:
{% extends "admin_tools/dashboard/module.html" %}
{% load i18n %}
{% block module_content %}

    {% spaceless %}
    {% for campaign in module.children %}

        {{ campaign.created|date }}
        {{ campaign.project.title }}

    {% endfor %}
    {% endspaceless %}

        {%  trans "View all campaigns" %}

{% endblock %}

redpajama_set_name: RedPajamaGithub


text:
class WrongParent
end


text:
' The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkID=391641

''' <summary>
''' An empty page that can be used on its own or navigated to within a Frame.
''' </summary>
Public NotInheritable Class MainPage
    Inherits Page

    ''' <summary>
    ''' Invoked when this page is about to be displayed in a Frame.
    ''' </summary>
    ''' <param name="e">Event data that describes how this page was reached.
    ''' This parameter is typically used to configure the page.</param>
    Protected Overrides Sub OnNavigatedTo(e As Navigation.NavigationEventArgs)
        ' TODO: Prepare the page for display here.

        ' TODO: If your application contains multiple pages, ensure that you are
        ' handling the hardware Back button by registering for the
        ' Windows.Phone.UI.Input.HardwareButtons.BackPressed event.
        ' If you are using the NavigationHelper provided by some templates,
        ' this event is handled for you.
    End Sub

End Class


text:
<?php

/**
 * Skeleton subclass for performing query and update operations on the 'article' table.
 *
 *
 *
 * This class was autogenerated by Propel 1.5.0-dev on:
 *
 * Sat Apr  3 18:10:15 2010
 *
 * You should add additional methods to this class to meet the
 * application requirements.  This class will only be generated as
 * long as it does not already exist in the output directory.
 *
 * @package    propel.generator.lib.model
 */
class ArticleQuery extends BaseArticleQuery {

} // ArticleQuery


text:
#region License

// --------------------------------------------------------------------------------------------------------------------
// <copyright file="SymmetricEqualityComparer{T}.cs" company="MorseCode Software">
// Copyright (c) 2015 MorseCode Software
// </copyright>
// <summary>
// The MIT License (MIT)
//
// Copyright (c) 2015 MorseCode Software
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
#endregion

namespace MorseCode.FrameworkExtensions
{
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Diagnostics.Contracts;

    /// <summary>
    /// An equality comparer which compares two objects for symmetric equality, where two non-null objects are equal
    /// if and only if <c>a.Equals(b)</c> and <c>b.Equals(a)</c>.
    /// </summary>
    /// <typeparam name="T">
    /// The type of the objects being compared.
    /// </typeparam>
    /// <remarks>
    /// This class is valid for value types as it avoids boxing.  Use the non-generic version,
    /// <see cref="SymmetricEqualityComparer"/>, for reference types.
    /// </remarks>
    public class SymmetricEqualityComparer<T> : IEqualityComparer<T>, IEqualityComparer
        where T : struct
    {
        #region Static Fields

        private static readonly SymmetricEqualityComparer<T> PrivateInstance = new SymmetricEqualityComparer<T>();

        #endregion

        #region Constructors and Destructors

        private SymmetricEqualityComparer()
        {
        }

        #endregion

        #region Public Properties

        /// <summary>
        /// Gets the singleton instance of <see cref="SymmetricEqualityComparer{T}"/>.
        /// </summary>
        public static SymmetricEqualityComparer<T> Instance
        {
            get
            {
                Contract.Ensures(Contract.Result<SymmetricEqualityComparer<T>>() != null);

                return PrivateInstance;
            }
        }

        #endregion

        #region Explicit Interface Methods

        bool IEqualityComparer.Equals(object x, object y)
        {
            if (x is T && y is T)
            {
                return this.ImplicitlyConvert<IEqualityComparer<T>>().Equals((T)x, (T)y);
            }

            return x == y;
        }

        int IEqualityComparer.GetHashCode(object obj)
        {
            if (!(obj is T))
            {
                throw new ArgumentException("Parameter obj must be convertible to type " + typeof(T).FullName + ".", "obj");
            }

            return this.ImplicitlyConvert<IEqualityComparer<T>>().GetHashCode((T)obj);
        }

        bool IEqualityComparer<T>.Equals(T x, T y)
        {
            return x.SymmetricEquals(y);
        }

        int IEqualityComparer<T>.GetHashCode(T obj)
        {
            return obj.GetHashCode();
        }

        #endregion
    }
}


text:
// LambdaNative WKWebView loader

#ifdef USE_HYBRID

#import <LNCONFIG.h>

#import "WKWebViewController.h"

@interface WKWebViewController ()
@property (strong, nonatomic)WKWebView *appWebView;
@property (nonatomic, assign) NSTimer *heartbeatTimer;
@end

@implementation WKWebViewController

@synthesize heartbeatTimer;

- (void)viewDidLoad {
  [super viewDidLoad];
  WKWebViewConfiguration *theConfiguration = [[WKWebViewConfiguration alloc] init];
  WKPreferences *thisPref = [[WKPreferences alloc] init];
  thisPref.javaScriptCanOpenWindowsAutomatically = YES;
  thisPref.javaScriptEnabled = YES;
  theConfiguration.preferences = thisPref;
  _appWebView = [[WKWebView alloc] initWithFrame:self.view.frame configuration:theConfiguration];
  _appWebView.navigationDelegate = self;
  _appWebView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
  NSURL *nsurl=[NSURL URLWithString:@"http://127.0.0.1:8080"];
  NSURLRequest *nsrequest=[NSURLRequest requestWithURL:nsurl];
  [_appWebView loadRequest:nsrequest];
  [self.view addSubview:_appWebView];
  self.heartbeatTimer = [NSTimer scheduledTimerWithTimeInterval:0.02
    target:self selector:@selector(heartbeatCallback) userInfo:nil repeats:YES];
}

- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
}

- (void)didReceiveMemoryWarning {
  [super didReceiveMemoryWarning];
}

- (void) heartbeatCallback {
  ffi_event(EVENT_IDLE,0,0);
}

@end

#endif // USE_HYBRID


text:
declare namespace adone.collection {
    namespace I.BufferList {
        type Appendable = Buffer | BufferList | string | number | Array<Buffer | BufferList | string | number>;
    }

    /**
     * Represents a Node.js Buffer list collector, reader and streamer with callback/promise interface support
     */
    class BufferList extends std.stream.Duplex implements PromiseLike<Buffer> {
        /**
         * Creates a new buffer list
         */
        constructor();

        /**
         * Creates a new buffer list and initiates with the given value
         */
        constructor(buffer: I.BufferList.Appendable);

        /**
         * Creates a new buffer list and subscribes the given callback on the end/error event
         */
        constructor(callback: (err: any, data: Buffer) => void);

        /**
         * Adds an additional buffer or BufferList to the internal list
         */
        append(buf: I.BufferList.Appendable): this;

        /**
         * Ends the stream
         */
        end(chunk?: Buffer): void;
        end(chunk?: () => void): void;

        /**
         * Returns the byte at the specified index
         */
        get(idx: number): number;

        /**
         * Returns a new Buffer object containing the bytes within the range specified.
         */
        slice(start?: number, end?: number): Buffer;

        /**
         * Copies the content of the list in the dest buffer
         * starting from destStart and containing the bytes within the range specified with srcStart to srcEnd
         *
         * @param dstStart writes from this position
         * @param srcStart reads bytes from this position
         * @param srcEnd  read bytes to this position
         */
        copy<T extends Buffer = Buffer>(dst: T, dstStart?: number, srcStart?: number, srcEnd?: number): T;

        /**
         * Returns a new BufferList object containing the bytes within the range specified.
         * No copies will be performed. All buffers in the result share memory with the original list.
         *
         * @param start slice from
         * @param end slice to
         */
        shallowSlice(start?: number, end?: number): BufferList;

        /**
         * Return a string representation of the buffer
         */
        toString(encoding?: fs.I.Encoding, start?: number, end?: number): string;

        /**
         * Shifts bytes off the start of the list
         */
        consume(bytes: number): this;

        /**
         * Performs a shallow-copy of the list.
         */
        duplicate(): BufferList;

        /**
         * Destroys the stream
         */
        destroy(): void;

        then<T1 = Buffer, T2 = never>(
            onfulfilled?: ((value: Buffer) => T1 | PromiseLike<T1>) | null,
            onrejected?: ((reason: any) => T2 | PromiseLike<T2>) | null
        ): PromiseLike<T1 | T2>;

        catch<T>(onrejected?: ((reason: any) => T | PromiseLike<T>) | null): PromiseLike<T | Buffer>;
    }
}


text:
package jni;

/**
 * @author Grégory Van den Borre
 */
public class JniSceneManager {

    /**
     * Delete the object in native code.
     *
     * @param address Address of the native object.
     */
    public native void delete(final long address);

    /**
     * Create an Ogre::Entity from a mesh.
     *
     * @param pointerAddress Address to the native yz::SceneManager*.
     * @param meshName       Name of the mesh to use to build the entity.
     * @param nodePointer    The entity will be attached to this node.
     * @return The created entity pointer address.
     */
    public native long createMeshEntity(final long pointerAddress, final String meshName, final long nodePointer);

    /**
     * Create an Ogre::Entity from a box shape.
     *
     * @param pointerAddress Address to the native yz::SceneManager*.
     * @param nodePointer    The entity will be attached to this node.
     * @return The created entity pointer address.
     */
    public native long createBoxEntity(final long pointerAddress, final long nodePointer);

    /**
     * Create an Ogre::Entity from a plane shape.
     *
     * @param pointerAddress Address to the native yz::SceneManager*.
     * @param nodePointer    The entity will be attached to this node.
     * @return The created entity pointer address.
     */
    public native long createPlaneEntity(final long pointerAddress, final long nodePointer);

    /**
     * Create an Ogre::Entity from a sphere shape.
     *
     * @param pointerAddress Address to the native yz::SceneManager*.
     * @param nodePointer    The entity will be attached to this node.
     * @param name Entity name.
     * @return The created entity pointer address.
     */
    public native long createSphereEntity(final long pointerAddress, final long nodePointer, final String name);

    /**
     * Set the scene ambient light in native code.
     *
     * @param pointerAddress Address to the native yz::SceneManager*.
     * @param red            Light red value.
     * @param green          Light green value.
     * @param blue           Light blue value.
     * @param alpha          Light intensity.
     */
    public native void setAmbientLight(final long pointerAddress, final float red, final float green, final float blue, final float alpha);

    /**
     * Create a particle system in native code.
     *
     * @param pointerAddress Address to the native yz::SceneManager*.
     * @return The particle system pointer address.
     */
    public native long createParticleSystem(final long pointerAddress);

    /**
     * Set the sky box in native code.
     *
     * @param pointerAddress Address to the native yz::SceneManager*.
     * @param skybox         Sky box material to use.
     */
    public native void setSkybox(final long pointerAddress, final String skybox);

    /**
     * Build an yz::Node in native code.
     *
     * @param pointerAddress Address to the native yz::SceneManager*.
     * @param name           Node unique name.
     * @return The created yz::Node pointer address.
     */
    public native long createNode(final long pointerAddress, final String name);

    /**
     * Build an yz::Node in native code, it is associated with an id to be retrieved when using picking.
     *
     * @param pointerAddress Address to the native yz::SceneManager*.
     * @param associatedId   Id to associate to the node, used to identify the node when interactions occurs(raycast...).
     * @param name           Node unique name.
     * @return The created yz::Node pointer address.
     */
    public native long createNodeId(final long pointerAddress, final long associatedId, final String name);

    /**
     * Create a lens flare object in native code.
     *
     * @param name Object name.
     * @param pointerAddress Address to the native yz::SceneManager*.
     * @param camPointer     currently used camera.
     * @param light          Material used for the light.
     * @param streak         Material used for the streak.
     * @param haloMaterial   Material used for the halo.
     * @param burstMaterial  Material used for the burst.
     * @param posX           Lens flare position X value.
     * @param posY           Lens flare position Y value.
     * @param posZ           Lens flare position Z value.
     * @return The pointer address to the newly built lens flare.
     */
    // FIXME does not support camera switch.
    public native long createLensFlare(final String name, final long pointerAddress, final long camPointer, final long light, final long streak, final long haloMaterial, final long burstMaterial,
                                        final float posX, final float posY, final float posZ);

    /**
     * Create a camera in native code.
     *
     * @param pointerAddress Address to the native yz::SceneManager*.
     * @param name           Camera name.
     * @return The pointer address to the camera native object.
     */
    public native long createCamera(final long pointerAddress, final String name);

    public native long createQuery(final long pointerAddress, final long providerPointerAddress);

    public native long createGroundQuery(final long pointerAddress, final long providerPointerAddress, final long groundNodePointerAddress);

    public native long createDummyGround(final long pointerAddress);

    /**
     * Create an electric arc in native code.
     *
     * @param pointerAddress Address to the native yz::SceneManager*.
     * @param name           Arc unique name.
     * @param x              Arc origin position X value.
     * @param y              Arc origin position Y value.
     * @param z              Arc origin position Z value.
     * @param x2             Arc end position X value.
     * @param y2             Arc end position Y value.
     * @param z2             Arc end position Z value.
     * @param width          elements width.
     * @return The pointer address to the newly built arc.
     */
    public native long createElectricArc(final long pointerAddress, final String name, final float x, final float y, final float z, final float x2, final float y2, final float z2, final float width);

    /**
     * Create a new point light in native code.
     *
     * @param pointerAddress Address to the native yz::SceneManager*.
     * @param name           Light name, must be unique.
     * @param posX           Light position X value.
     * @param posY           Light position Y value.
     * @param posZ           Light position Z value.
     * @return The pointer address to the light native object.
     */
    public native long createPointLight(final long pointerAddress, final String name, final float posX, final float posY, final float posZ);

    /**
     * Set the shadow technique in Ogre native code.
     *
     * @param pointer        Address to the native yz::SceneManager*.
     * @param techniqueIndex Index of the technique to use.
     */
    public native void setShadowTechnique(final long pointer, final int techniqueIndex);

    /**
     * Create a new spot light in native code.
     *
     * @param pointerAddress Address to the native yz::SceneManager*.
     * @param name           Light name, must be unique.
     * @param posX           Light position X value.
     * @param posY           Light position Y value.
     * @param posZ           Light position Z value.
     * @param dirX           Spot direction X value.
     * @param dirY           Spot direction Y value.
     * @param dirZ           Spot direction Z value.
     * @return The pointer address to the light native object.
     */
    public native long createSpotLight(final long pointerAddress, final String name, final float posX, final float posY, final float posZ, final float dirX, final float dirY, final float dirZ);

    /**
     * Create a new directional light in native code.
     *
     * @param pointerAddress Address to the native yz::SceneManager*.
     * @param name           Light name, must be unique.
     * @param posX           Light position X value.
     * @param posY           Light position Y value.
     * @param posZ           Light position Z value.
     * @param dirX           Spot direction X value.
     * @param dirY           Spot direction Y value.
     * @param dirZ           Spot direction Z value.
     * @return The pointer address to the light native object.
     */
    public native long createDirectionalLight(final long pointerAddress, final String name, final float posX, final float posY, final float posZ, final float dirX, final float dirY, final float dirZ);

    /**
     * Set the shadow type in native code.
     *
     * @param pointerAddress Address to the native yz::SceneManager*.
     * @param type           Type value.
     */
    public native void setShadowType(final long pointerAddress, final int type);

    /**
     * Create a new billboard set in native code.
     *
     * @param pointerAddress Address to the native yz::SceneManager*.
     * @param material       Set material.
     * @return The created set pointer address.
     */
    public native long createBillboardSet(final long pointerAddress, final long material);

    /**
     * Retrieve the root scene node in native code.
     *
     * @param pointerAddress Address to the native yz::SceneManager*.
     * @return The pointer of the native yz::Node root object.
     */
    public native long getRootNode(final long pointerAddress);

    /**
     * Set the size for texture used for shadows.
     *
     * @param pointer Address to the native yz::SceneManager*.
     * @param size    Texture size.
     */
    public native void setShadowTextureSize(final long pointer, final int size);

    /**
     * Set the distance to display shadows.
     *
     * @param pointer  Address to the native yz::SceneManager*.
     * @param distance Maximum distance to display shadows..
     */
    public native void setShadowFarDistance(final long pointer, final int distance);

}


text:
package ru.agolovin.models;

/**
 * Class for chess figure Bishop.
 *
 * @author agolovin (agolovin@list.ru)
 * @version $Id$
 * @since 0.1
 */
public class Bishop extends Figure {

    /**
     * constructor.
     * @param cell cell
     */
    Bishop(final Cell cell) {
        super(cell);
    }

    /**
     * clone figure to dist cell.
     * @param dist cell
     * @return new figure.
     */
    @Override
    public final Bishop clone(final Cell dist) {
        return new Bishop(dist);
    }

    /**
     * array of move cells.
     * @param dist Cell
     * @return array of cells
     * @throws ImpossibleMoveException error
     */
    @Override
    public final Cell[] way(final Cell dist) throws ImpossibleMoveException {
        int startCol = this.getPosition().getCol();
        int startRow = this.getPosition().getRow();
        int endCol = dist.getCol();
        int endRow = dist.getRow();
        int maxSize = Math.abs(endCol - startCol);

        int step = 1;

        Cell[] res = new Cell[maxSize];

        if ((Math.abs(endCol - startCol) == Math.abs(endRow - startRow))
                && ((endCol - startCol) != 0) && (endRow - startRow) != 0) {
            if (startCol > endCol) {
                step = -1;
            }

            for (int i = 1; i <= maxSize; i++) {
                int stepCol = startCol + step * i;
                int stepRow = (stepCol - startCol) * (endRow - startRow)
                        / (endCol - startCol) + startRow;
                res[i - 1] = new Cell(stepCol, stepRow);
            }
        } else {
            throw new ImpossibleMoveException("Error: impossible move");
        }

        return res;
    }
}


text:
using Google.Api.Gax;
using NHibernate;

namespace Google.Cloud.Spanner.NHibernate
{
    /// <summary>
    /// Extension methods for NHibernate <see cref="IQuery"/> when working with Google Cloud Spanner.
    /// All methods in this class assume that the given <see cref="IQuery"/> is used on a Google Cloud Spanner
    /// connection.
    /// </summary>
    public static class IQueryExtensions
    {
        /// <summary>
        /// Sets the hints to use for this query.
        /// </summary>
        /// <param name="query">The query to set the hints on</param>
        /// <param name="hints">The hints to set</param>
        /// <returns>The query with the hints</returns>
        public static IQuery SetHints(this IQuery query, Hints hints)
        {
            GaxPreconditions.CheckNotNull(hints, nameof(hints));
            return query.SetComment(hints.CommentString);
        }
    }
}


text:
package com.amazonaws.services.waf.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 *

 * Contains one or more IP addresses or blocks of IP addresses specified in Classless Inter-Domain Routing (CIDR)
 * notation. AWS WAF supports /8, /16, /24, and /32 IP address ranges for IPv4, and /24, /32, /48, /56, /64 and /128 for
 * IPv6.
 *

 *

 * To specify an individual IP address, you specify the four-part IP address followed by a /32, for
 * example, 192.0.2.0/31. To block a range of IP addresses, you can specify a /128, /64,
 * /56, /48, /32, /24, /16, or /8 CIDR.
 * For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing.
 *

 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class IPSet implements Serializable, Cloneable, StructuredPojo {

    /**
     *

     * The IPSetId for an IPSet. You use IPSetId to get information about an
     * IPSet (see GetIPSet), update an IPSet (see UpdateIPSet), insert an
     * IPSet into a Rule or delete one from a Rule (see UpdateRule), and
     * delete an IPSet from AWS WAF (see DeleteIPSet).
     *

     *

     * IPSetId is returned by CreateIPSet and by ListIPSets.
     *

     */
    private String iPSetId;
    /**
     *

     * A friendly name or description of the IPSet. You can't change the name of an IPSet after you
     * create it.
     *

     */
    private String name;
    /**
     *

     * The IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation) that web
     * requests originate from. If the WebACL is associated with a CloudFront distribution, this is the
     * value of one of the following fields in CloudFront access logs:
     *

     *

     *

     *

     * c-ip, if the viewer did not use an HTTP proxy or a load balancer to send the request
     *

     *

     *

     *

     * x-forwarded-for, if the viewer did use an HTTP proxy or a load balancer to send the request
     *

     *

     *

     */
    private java.util.List<IPSetDescriptor> iPSetDescriptors;

    /**
     *

     * The IPSetId for an IPSet. You use IPSetId to get information about an
     * IPSet (see GetIPSet), update an IPSet (see UpdateIPSet), insert an
     * IPSet into a Rule or delete one from a Rule (see UpdateRule), and
     * delete an IPSet from AWS WAF (see DeleteIPSet).
     *

     *

     * IPSetId is returned by CreateIPSet and by ListIPSets.
     *

     *
     * @param iPSetId
     *        The IPSetId for an IPSet. You use IPSetId to get information about
     *        an IPSet (see GetIPSet), update an IPSet (see UpdateIPSet), insert
     *        an IPSet into a Rule or delete one from a Rule (see
     *        UpdateRule), and delete an IPSet from AWS WAF (see DeleteIPSet).

     *

     *        IPSetId is returned by CreateIPSet and by ListIPSets.
     */

    public void setIPSetId(String iPSetId) {
        this.iPSetId = iPSetId;
    }

    /**
     *

     * The IPSetId for an IPSet. You use IPSetId to get information about an
     * IPSet (see GetIPSet), update an IPSet (see UpdateIPSet), insert an
     * IPSet into a Rule or delete one from a Rule (see UpdateRule), and
     * delete an IPSet from AWS WAF (see DeleteIPSet).
     *

     *

     * IPSetId is returned by CreateIPSet and by ListIPSets.
     *

     *
     * @return The IPSetId for an IPSet. You use IPSetId to get information about
     *         an IPSet (see GetIPSet), update an IPSet (see UpdateIPSet),
     *         insert an IPSet into a Rule or delete one from a Rule (see
     *         UpdateRule), and delete an IPSet from AWS WAF (see DeleteIPSet).

     *

     *         IPSetId is returned by CreateIPSet and by ListIPSets.
     */

    public String getIPSetId() {
        return this.iPSetId;
    }

    /**
     *

     * The IPSetId for an IPSet. You use IPSetId to get information about an
     * IPSet (see GetIPSet), update an IPSet (see UpdateIPSet), insert an
     * IPSet into a Rule or delete one from a Rule (see UpdateRule), and
     * delete an IPSet from AWS WAF (see DeleteIPSet).
     *

     *

     * IPSetId is returned by CreateIPSet and by ListIPSets.
     *

     *
     * @param iPSetId
     *        The IPSetId for an IPSet. You use IPSetId to get information about
     *        an IPSet (see GetIPSet), update an IPSet (see UpdateIPSet), insert
     *        an IPSet into a Rule or delete one from a Rule (see
     *        UpdateRule), and delete an IPSet from AWS WAF (see DeleteIPSet).

     *

     *        IPSetId is returned by CreateIPSet and by ListIPSets.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public IPSet withIPSetId(String iPSetId) {
        setIPSetId(iPSetId);
        return this;
    }

    /**
     *

     * A friendly name or description of the IPSet. You can't change the name of an IPSet after you
     * create it.
     *

     *
     * @param name
     *        A friendly name or description of the IPSet. You can't change the name of an IPSet
     *        after you create it.
     */

    public void setName(String name) {
        this.name = name;
    }

    /**
     *

     * A friendly name or description of the IPSet. You can't change the name of an IPSet after you
     * create it.
     *

     *
     * @return A friendly name or description of the IPSet. You can't change the name of an IPSet
     *         after you create it.
     */

    public String getName() {
        return this.name;
    }

    /**
     *

     * A friendly name or description of the IPSet. You can't change the name of an IPSet after you
     * create it.
     *

     *
     * @param name
     *        A friendly name or description of the IPSet. You can't change the name of an IPSet
     *        after you create it.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public IPSet withName(String name) {
        setName(name);
        return this;
    }

    /**
     *

     * The IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation) that web
     * requests originate from. If the WebACL is associated with a CloudFront distribution, this is the
     * value of one of the following fields in CloudFront access logs:
     *

     *

     *

     *

     * c-ip, if the viewer did not use an HTTP proxy or a load balancer to send the request
     *

     *

     *

     *

     * x-forwarded-for, if the viewer did use an HTTP proxy or a load balancer to send the request
     *

     *

     *

     *
     * @return The IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation)
     *         that web requests originate from. If the WebACL is associated with a CloudFront
     *         distribution, this is the value of one of the following fields in CloudFront access logs:

     *

     *

     *

     *         c-ip, if the viewer did not use an HTTP proxy or a load balancer to send the request
     *

     *

     *

     *

     *         x-forwarded-for, if the viewer did use an HTTP proxy or a load balancer to send the request
     *

     *

     */

    public java.util.List<IPSetDescriptor> getIPSetDescriptors() {
        return iPSetDescriptors;
    }

    /**
     *

     * The IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation) that web
     * requests originate from. If the WebACL is associated with a CloudFront distribution, this is the
     * value of one of the following fields in CloudFront access logs:
     *

     *

     *

     *

     * c-ip, if the viewer did not use an HTTP proxy or a load balancer to send the request
     *

     *

     *

     *

     * x-forwarded-for, if the viewer did use an HTTP proxy or a load balancer to send the request
     *

     *

     *

     *
     * @param iPSetDescriptors
     *        The IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation)
     *        that web requests originate from. If the WebACL is associated with a CloudFront distribution,
     *        this is the value of one of the following fields in CloudFront access logs:

     *

     *

     *

     *        c-ip, if the viewer did not use an HTTP proxy or a load balancer to send the request
     *

     *

     *

     *

     *        x-forwarded-for, if the viewer did use an HTTP proxy or a load balancer to send the request
     *

     *

     */

    public void setIPSetDescriptors(java.util.Collection<IPSetDescriptor> iPSetDescriptors) {
        if (iPSetDescriptors == null) {
            this.iPSetDescriptors = null;
            return;
        }

        this.iPSetDescriptors = new java.util.ArrayList<IPSetDescriptor>(iPSetDescriptors);
    }

    /**
     *

     * The IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation) that web
     * requests originate from. If the WebACL is associated with a CloudFront distribution, this is the
     * value of one of the following fields in CloudFront access logs:
     *

     *

     *

     *

     * c-ip, if the viewer did not use an HTTP proxy or a load balancer to send the request
     *

     *

     *

     *

     * x-forwarded-for, if the viewer did use an HTTP proxy or a load balancer to send the request
     *

     *

     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setIPSetDescriptors(java.util.Collection)} or {@link #withIPSetDescriptors(java.util.Collection)} if you
     * want to override the existing values.
     *

     *
     * @param iPSetDescriptors
     *        The IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation)
     *        that web requests originate from. If the WebACL is associated with a CloudFront distribution,
     *        this is the value of one of the following fields in CloudFront access logs:

     *

     *

     *

     *        c-ip, if the viewer did not use an HTTP proxy or a load balancer to send the request
     *

     *

     *

     *

     *        x-forwarded-for, if the viewer did use an HTTP proxy or a load balancer to send the request
     *

     *

     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public IPSet withIPSetDescriptors(IPSetDescriptor... iPSetDescriptors) {
        if (this.iPSetDescriptors == null) {
            setIPSetDescriptors(new java.util.ArrayList<IPSetDescriptor>(iPSetDescriptors.length));
        }
        for (IPSetDescriptor ele : iPSetDescriptors) {
            this.iPSetDescriptors.add(ele);
        }
        return this;
    }

    /**
     *

     * The IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation) that web
     * requests originate from. If the WebACL is associated with a CloudFront distribution, this is the
     * value of one of the following fields in CloudFront access logs:
     *

     *

     *

     *

     * c-ip, if the viewer did not use an HTTP proxy or a load balancer to send the request
     *

     *

     *

     *

     * x-forwarded-for, if the viewer did use an HTTP proxy or a load balancer to send the request
     *

     *

     *

     *
     * @param iPSetDescriptors
     *        The IP address type (IPV4 or IPV6) and the IP address range (in CIDR notation)
     *        that web requests originate from. If the WebACL is associated with a CloudFront distribution,
     *        this is the value of one of the following fields in CloudFront access logs:

     *

     *

     *

     *        c-ip, if the viewer did not use an HTTP proxy or a load balancer to send the request
     *

     *

     *

     *

     *        x-forwarded-for, if the viewer did use an HTTP proxy or a load balancer to send the request
     *

     *

     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public IPSet withIPSetDescriptors(java.util.Collection<IPSetDescriptor> iPSetDescriptors) {
        setIPSetDescriptors(iPSetDescriptors);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getIPSetId() != null)
            sb.append("IPSetId: ").append(getIPSetId()).append(",");
        if (getName() != null)
            sb.append("Name: ").append(getName()).append(",");
        if (getIPSetDescriptors() != null)
            sb.append("IPSetDescriptors: ").append(getIPSetDescriptors());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof IPSet == false)
            return false;
        IPSet other = (IPSet) obj;
        if (other.getIPSetId() == null ^ this.getIPSetId() == null)
            return false;
        if (other.getIPSetId() != null && other.getIPSetId().equals(this.getIPSetId()) == false)
            return false;
        if (other.getName() == null ^ this.getName() == null)
            return false;
        if (other.getName() != null && other.getName().equals(this.getName()) == false)
            return false;
        if (other.getIPSetDescriptors() == null ^ this.getIPSetDescriptors() == null)
            return false;
        if (other.getIPSetDescriptors() != null && other.getIPSetDescriptors().equals(this.getIPSetDescriptors()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getIPSetId() == null) ? 0 : getIPSetId().hashCode());
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
        hashCode = prime * hashCode + ((getIPSetDescriptors() == null) ? 0 : getIPSetDescriptors().hashCode());
        return hashCode;
    }

    @Override
    public IPSet clone() {
        try {
            return (IPSet) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

    @com.amazonaws.annotation.SdkInternalApi
    @Override
    public void marshall(ProtocolMarshaller protocolMarshaller) {
        com.amazonaws.services.waf.model.waf_regional.transform.IPSetMarshaller.getInstance().marshall(this, protocolMarshaller);
    }
}


text:
//
//  PPAutomationBridge.h
//  PPHCore
//
//  Created by Erceg,Boris on 10/8/13.
//  Copyright 2013 PayPal. All rights reserved.
//
//
////////////////////////////////////////////////////////////////////////////////////////////////////

#import <Foundation/Foundation.h>

@class PPAutomationBridge;
@class PPAutomationBridgeAction;

////////////////////////////////////////////////////////////////////////////////////////////////////
/**
 *  The delegate of PPAutomationBridge object must adopt PPAutomationBridgeDelegate protocol.
 */
@protocol PPAutomationBridgeDelegate <NSObject>

/**
 *  Enables PPAutomationBridge to send messages to application under test.
 *  Most general use case scenario is to make this method call [action resultFromTarget:self]; in PPAutomationBridgeDelegate and
 *  make PPAutomationBridgeDelegate object implement all methods you might get from PPAutomationBridge.
 *  This method will always be called on main thread
 *
 *  Example:
 *
 *   ```
 *      - (NSDictionary *)automationBridge:(PPAutomationBridge *)bridge receivedAction:(PPAutomationBridgeAction *)action {
 *
 *          return [action resultFromTarget:self];
 *
 *      }
 *   ```
 *
 *  @param bridge PPAutomationBridge sending a message.
 *  @param action PPAutomationBridgeAction object describing message bridge wants to send.
 *
 *  @return NSDictionary presenting data app returns to the testing framework trough bridge. nil is allowed value
 */
- (NSDictionary *)automationBridge:(PPAutomationBridge *)bridge receivedAction:(PPAutomationBridgeAction *)action;

@end

////////////////////////////////////////////////////////////////////////////////////////////////////
/**
 *  @discussion Represents message bridge wants to send to application under test
*/
@interface PPAutomationBridgeAction : NSObject

/**
 *  String representation of selector you want to excecute on target with resultFromTarget: or get a real
 *  selector with NSSelectorFromString.
*/
@property (nonatomic, strong) NSString *selector;

/**
 *  Arguments passed to selector when calling it.
*/
@property (nonatomic, strong) NSDictionary *arguments;

/**
 *  Will perform selector on target with arguments and return result.
 *
 *  @param target target to perform selector on.
 *
 *  @return returns return value of performing selector on target.
 */
- (NSDictionary *)resultFromTarget:(id)target;

@end

////////////////////////////////////////////////////////////////////////////////////////////////////
/**
 *  @discussion The PPAutomationBridge class provides a singleton instance representing a bridge that comunicates with
 *  UIAutomation through socket interface.
 *
 *  How To Use:
 *
 *  - Add PPAutomationBridge class to your project
 *  - Make an object that conforms to PPAutomationBridgeDelegate protocol
 *  - Implement automationBridge:receivedAction: method (if you want default implementation type @see PPAutomationBridgeDelegate example
 *  - Start your bridge with startAutomationBridgeWithDelegate:
 *
 *  For more information look at sample app implementation
 */

@interface PPAutomationBridge : NSObject

/**
 *  Determines if we want to close socket after response. In UIAutomation bridge case we want to leave this to default YES
 *  but there are use cases when you are not using bridge as UIAutomation bridge and you might want to keep socket open
 */
@property (nonatomic) BOOL closeAfterResponse;

/**
 *  Returns an object representing bridge.
 *
 *  @return A singleton object that represents the bridge.
 */
+ (instancetype)bridge;

/**
 *  Start the server with a specific port and Bonjour prefix
 *  Use when you dont need bridge for UIAutomation purposes
 *
 *  @param bonjourPrefix bonjour prefix
 *  @param port          port to run server on
 *  @param delegate       Object conforming to PPAutomationBridgeDelegate that will recive messages when bridge is called from UIAutomation
 */
- (void)startAutomationBridgeWithPrefix:(NSString*)bonjourPrefix onPort:(int)port WithDelegate:(id <PPAutomationBridgeDelegate>)delegate;

/**
 *  Starts automation bridge advertising and registers delegate object to recive automation bridge messages
 *  Does not retain delegate, you have to do it yourself
 *  Bonjour prefix will default to UIAutomation and port will default to 4200
 *
 *  @param delegate Object conforming to PPAutomationBridgeDelegate that will recive messages when bridge is called from UIAutomation
 */
- (void)startAutomationBridgeWithDelegate:(id <PPAutomationBridgeDelegate>)delegate;

/**
 *  Stops automation bridge advertising.
 */
- (void)stopAutomationBridge;

/**
 *  Send values to a connected client. Returns YES if there was a connected client, NO if there was not
 *  (and no queuing is done, so your message is not sent in that case).
 *
 *  @param args The value that will be JSON encoded and sent.
 */
- (BOOL)sendToConnectedClient:(NSDictionary*)args;

/**
 *  Perform a check if autoamtion bridge was started or not.
 *  Bridge is considered activated after it receives first message.
 */
@property (nonatomic, assign) BOOL isActivated;

@end


text:
package org.om.core.api.persistence.result;

import java.util.*;

public interface CollectionResult extends PersistenceResult {
	@Override
	public Collection<?> getValue();
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>JSDoc: Index</title>

    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">

Index

Web Page Annotation

This is an implementation of Google Chrome Annotation Extension. Extensions are small software programs that can modify and enhance the functionality of the Chrome browser.
This Extension is capable of implementing Annotation, Free Hand Drawing on web pages on the fly, using canvas feature. It can be used for web apps and for presentation purposes.

Version:

1.0

Author:

albinantony (Albin Antony)

Basic Setup

Install Chrome latest version (Version 39.0 or above).

Open the Chrome Menu and select the More tools->Extension option. You can also do this by going directly to chrome://extensions/ on your Chrome browser.

Enable Developer mode.

Clone the annotator to a directory of your choice.

On the Chrome extensions page, click on Load unpacked extension. Browse to the directory where you cloned the annotator.

How to use?

Click on the extension icon.

Click on annotation to append the canvas on web pages for annotating/marking.

To clear the annotation click on clear tab appended on the web page.

To close the canvas, click on close icon appended on web page.

Features

Annotates or marks web pages on the fly.

Implements Free Hand Drawing on web pages.

Include jQuery ,

<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.0.min.js" />

Resources

<script src="../src/js/background.js"></script>
<script src="../src/js/HandDrawing.js"></script>
<link rel="styleSheet" href="../src/css/Annotation.css">
    <link rel="styleSheet" href="../src/css/injectStyle.css">

Dependency

<script src="../src/lib/jquery-1.9.0.min.js"></script>

Index

Classes

Background

HandDrawing

    Documentation generated by JSDoc 3.3.0-dev on Tue May 12 2015 16:52:12 GMT+0530 (IST)


text:
module.exports = {
  url() {
    return this.api.launch_url;
  },
  elements: {
    trackUrlField: '.links-sender input',
    trackSubmitButton: '.links-sender form',
    playerBlock: '.player',
    playButton: 'a[title=Play]',
    pauseButton: 'a[title=Pause]',
    nextButton: 'a[title=Next]',
    prevButton: 'a[title=Prev]',
    openClearModalButton: 'button[title="Clear Playlist"]',
    clearModal: '.clear-playlist-modal',
    clearButton: '.clear-playlist-modal .submit-clear-button',
    noLoopButton: 'a[title=Queue]',
    oneLoopButton: 'a[title="One Loop"]',
    playlistLoopButton: 'a[title="Playlist Loop"]',
    history: '.history',
    playlist: '.playlist',
    tabs: '.tabs',
    historyTabButton: '.history-tab-button',
    playlistTabButton: '.playlist-tab-button'
  }
};


text:
using System.Collections.Generic;
using System.Diagnostics;
using System.Text.RegularExpressions;
using BlackDesertLogin.network.Protocol;
using BlackDesertLogin.Utils;
using Hik.Communication.Scs.Communication.EndPoints.Tcp;
using Hik.Communication.Scs.Server;
using NLog;

namespace BlackDesertLogin.network
{
    public class TcpServer
    {
        protected static readonly Logger Log = LogManager.GetCurrentClassLogger();

        protected string BindAddress;
        protected int BindPort;
        protected int MaxConnections;
        protected Dictionary<string, long> ConnectionsTime;

        public IScsServer Server;

        public TcpServer(string bindAddress, int bindPort, int maxConnections)
        {
            BindAddress = bindAddress;
            BindPort = bindPort;
            MaxConnections = maxConnections;
            ConnectionsTime = new Dictionary<string, long>();
        }

        public void BeginListening()
        {
            Log.Info("Start TcpServer at {0}:{1}...", BindAddress, BindPort);
            Server = ScsServerFactory.CreateServer(new ScsTcpEndPoint(BindAddress, BindPort));
            Server.Start();

            Server.ClientConnected += OnConnected;
            Server.ClientDisconnected += OnDisconnected;
        }

        public void ShutdownServer()
        {
            Log.Info("Shutdown TcpServer...");
            Server.Stop();
        }

        protected void OnConnected(object sender, ServerClientEventArgs e)
        {
            Log.Info("Client connected!");
            new Connection(e.Client);
        }

        protected void OnDisconnected(object sender, ServerClientEventArgs e)
        {
            Log.Info("Client disconnected!");

        }
    }
}


text:
package org.lwjgl.vulkan;

/**
 * This extension adds support for the following SPIR-V extension in Vulkan:
 *
 *

 *
{@code SPV_KHR_post_depth_coverage}

 *

 *
 *
which allows the fragment shader to control whether values in the {@code SampleMask} built-in input variable reflect the coverage after early depth and stencil tests are applied.

 *
 *
This extension adds a new {@code PostDepthCoverage} execution mode under the {@code SampleMaskPostDepthCoverage} capability. When this mode is specified along with {@code EarlyFragmentTests}, the value of an input variable decorated with the {@code SampleMask} built-in reflects the coverage after the early fragment tests are applied. Otherwise, it reflects the coverage before the depth and stencil tests.

 *
 *
When using GLSL source-based shading languages, the {@code post_depth_coverage} layout qualifier from GL_ARB_post_depth_coverage or GL_EXT_post_depth_coverage maps to the {@code PostDepthCoverage} execution mode.

 *
 *
VK_EXT_post_depth_coverage

 *
 *

 *
Name String

 *
{@code VK_EXT_post_depth_coverage}

 *
Extension Type

 *
Device extension

 *
Registered Extension Number

 *
156

 *
Revision

 *
1

 *
Extension and Version Dependencies

 *

 *
Requires support for Vulkan 1.0

 *

 *
Contact

 *

 *
Daniel Koch dgkoch

 *

 *

 *
 *
Other Extension Metadata

 *
 *

 *
Last Modified Date

 *
2017-07-17

 *
Interactions and External Dependencies

 *

 *
This extension requires {@code SPV_KHR_post_depth_coverage}

 *
This extension provides API support for {@code GL_ARB_post_depth_coverage} and {@code GL_EXT_post_depth_coverage}

 *

 *
Contributors

 *

 *
Jeff Bolz, NVIDIA

 *

 *

 */
public final class EXTPostDepthCoverage {

    /** The extension specification version. */
    public static final int VK_EXT_POST_DEPTH_COVERAGE_SPEC_VERSION = 1;

    /** The extension name. */
    public static final String VK_EXT_POST_DEPTH_COVERAGE_EXTENSION_NAME = "VK_EXT_post_depth_coverage";

    private EXTPostDepthCoverage() {}

}


text:
A test suite is a set of tests that establish compliance to the thing they're named after.  Example: Passing the "ASTM F3548-21" test suite should indicate the systems under test are compliant with ASTM F3548-21.

A test suite is composed of a list of {test suite|test scenario}; each element on the list is executed sequentially.

A test suite is defined with a YAML file following the [`TestSuiteDefinition` schema](definitions.py).


text:
import * as React from 'react';
import { Spinner, Tooltip } from '../AtlaskitDummy';
import AsyncSelect from 'react-select/async';
import { ColourOption, colourOptions } from '../data';

const LoadingIndicator = (props: any) => {
    return (
        <Tooltip content={'Custom Loader'}>
            <Spinner {...props} delay={0} />
        </Tooltip>
    );
};

interface State {
    inputValue: string;
}

const filterColors = (inputValue: string) =>
    colourOptions.filter(i => i.label.toLowerCase().includes(inputValue.toLowerCase()));

const promiseOptions = (inputValue: string) =>
    new Promise<ColourOption[]>(resolve => {
        setTimeout(() => {
            resolve(filterColors(inputValue));
        }, 1000);
    });

export default class CustomLoadingIndicator extends React.Component<any, State> {
    state = { inputValue: '' };
    handleInputChange = (newValue: string) => {
        const inputValue = newValue.replace(/\W/g, '');
        this.setState({ inputValue });
        return inputValue;
    }
    render() {
        return (
            <AsyncSelect cacheOptions defaultOptions loadOptions={promiseOptions} components={{ LoadingIndicator }} />
        );
    }
}


text:
#ifndef HELLO_H_
#define HELLO_H_

extern void printHelloWorld();

extern int (*PrintFormated)(const char*, ...);

#endif /*HELLO_H_*/


text:
Copyright 2017-2020 Crown Copyright

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Proxy Store
============

The `ProxyStore` implementation is simply a Gaffer store which delegates all
operations to a Gaffer REST API.

To create a `ProxyStore` you just need to provide a host, port and context
root. This can be done via the `ProxyStore.Builder`:

```java
Graph graph = new Graph.Builder()
    .store(new ProxyStore.Builder()
            .graphId(uniqueNameOfYourGraph)
            .host("localhost")
            .port(8080)
            .contextRoot("rest/v1")
            .build())
    .build();
```

You can then write your queries in Java and the `ProxyStore` will convert
them into JSON and execute them over the REST API.

These are the full set of configurable properties:

```properties
gaffer.host
gaffer.port
gaffer.context-root
gaffer.jsonserialiser.class

# Timeouts specified in milliseconds
gaffer.connect-timeout
gaffer.read-timeout
```


text:
#ifndef CMARK_EXPORT_H
#define CMARK_EXPORT_H

#ifdef CMARK_STATIC_DEFINE
#  define CMARK_EXPORT
#  define CMARK_NO_EXPORT
#else
#  ifndef CMARK_EXPORT
#    ifdef libcmark_EXPORTS
        /* We are building this library */
#      define CMARK_EXPORT __attribute__((visibility("default")))
#    else
        /* We are using this library */
#      define CMARK_EXPORT __attribute__((visibility("default")))
#    endif
#  endif

#  ifndef CMARK_NO_EXPORT
#    define CMARK_NO_EXPORT __attribute__((visibility("hidden")))
#  endif
#endif

#ifndef CMARK_DEPRECATED
#  define CMARK_DEPRECATED __attribute__ ((__deprecated__))
#  define CMARK_DEPRECATED_EXPORT CMARK_EXPORT __attribute__ ((__deprecated__))
#  define CMARK_DEPRECATED_NO_EXPORT CMARK_NO_EXPORT __attribute__ ((__deprecated__))
#endif

#define DEFINE_NO_DEPRECATED 0
#if DEFINE_NO_DEPRECATED
# define CMARK_NO_DEPRECATED
#endif

#endif


text:
pub mod syscall_table;

use libc;
use std::ffi::CStr;
use std::{ptr, slice};
use std::mem::size_of;
use std::collections::HashMap;
use chrono::{DateTime, UTC};
use value::Value;

#[repr(C, packed)]
pub struct Syscall {
    /// timestamp in nanoseconds from epoch
    pub ts: u64,
    /// the thread id that generated the syscall
    pub tid: u64,
    /// length of the syscall + header
    pub len: u32,
    /// the identifier of the syscall
    pub id: u16
}

pub struct SyscallMeta {
    /// name of the system call
    pub name: &'static str,
    /// syscall category
    pub category: Category,
    /// flags for this syscall
    pub flags: Vec<Flags>,
    /// the number of parameters
    pub nparams: usize,
    /// the list of syscall's parameters
    pub params: Vec<SyscallParam>
}

pub struct SyscallParam {
    /// parameter name
    pub name: &'static str,
    /// parameter type
    pub kind: ParamType,
    /// parameter rendering format
    pub fmt: ParamFormat
}

#[derive(Serialize, Debug)]
pub struct SyscallInfo {
    /// timestamp expressed as UTC date/time structure
    pub ts: DateTime<UTC>,
    /// name of the system call
    pub name: String,
    /// syscall's parameter map
    pub params: HashMap<String, Value>

}

/// determines the syscall category
pub enum Category {
    Unknown,
    Other,
    File,
    Net,
    IPC,
    Memory,
    Process,
    Sleep,
    System,
    Signal,
    User,
    Time,
    Processing,
    IOBase,
    IORead,
    IOWrite,
    IOOther,
    Wait,
    Scheduler,
    Internal

}

pub enum Flags {
    None,
    CreatesFd,
    DestroysFd,
    UsesFd,
    ReadsFromFd,
    WritesToFd,
    ModifiesState,
    Unused,
    Waits,
    SkipParser,
    OldVesion

}

pub enum ParamType {
    None,
    Int8,
    Int16,
    Int32,
    Int64,
    UInt8,
    UInt16,
    UInt32,
    UInt64,
    /// a NULL terminated printable buffer of bytes
    CharBuffer,
    ByteBuffer,
    ErrNo,
    SockAddr,
    SockTuple,
    Fd,
    Pid,
    FdList,
    FsPath,
    SyscallId,
    SigType,
    /// a relative time
    RelTime,
    /// an absolute time interval
    AbsTime,
    Port,
    L4Proto,
    SockFamily,
    Bool,
    Ipv4Addr,
    Dyn,
    Flags8,
    Flags16,
    Flags32,
    Uid,
    Gid,
    Double,
    Sigset,
    CharBufferArray,
    CharBufferPairArray,
    Ipv4Net
}

pub enum ParamFormat {
    Na,
    Dec,
    Hex,
    PaddedDec,
    Id,
    Dir
}

pub enum Direction {
    Enter,
    Exit
}

impl SyscallMeta {
    /// Populates the syscall parameter map by applying pointer arithmetic
    /// operations on the system call structure. The parameter's buffer is extracted
    /// from the slice which is constructed from syscall structure pointer
    /// and the number of parameters.
    /// For each parameter found in the slice, the parsing stage is delegated to
    /// the `SyscallParam::parse` method. The return value of the previous method is put into
    /// the hash map and indexed by parameter name.
    ///
    pub fn build_params(&self, syscall: *mut Syscall) -> HashMap<String, Value> {
        let mut params = HashMap::<String, Value>::default();
        unsafe {
            let lens = syscall.offset(1) as *const u16;
            let mut buf = lens.offset(self.nparams as isize) as *const u8;
            for (i, len) in slice::from_raw_parts(lens, self.nparams)
                        .iter()
                        .enumerate() {
                let ref param = self.params[i];
                params.insert(param.name.to_string(), param.parse(buf));
                buf = buf.offset(*len as isize);
            }
        }
        params
    }
}

impl SyscallParam {
    /// Transforms the raw buffer which contains the parameter value to a native
    /// data type suitable for serialization.
    pub fn parse(&self, buf: *const u8) -> Value {
        match self.kind {
            ParamType::Int8 => {
                unsafe { Value::Int8(*(buf as *const i8)) }
            },
            ParamType::Int16 => {
                unsafe { Value::Int16(*(buf as *const i16)) }
            },
            ParamType::Int32 => {
                unsafe { Value::Int32(*(buf as *const i32)) }
            },
            ParamType::Int64 => {
                unsafe { Value::Int64(*(buf as *const i64)) }
            },
            ParamType::UInt8 => {
                unsafe { Value::UInt8(*(buf as *const u8)) }
            },
            ParamType::UInt16 => {
                unsafe { Value::UInt16(*(buf as *const u16)) }
            },
            ParamType::UInt32 => {
                unsafe { Value::UInt32(*(buf as *const u32)) }
            },
            ParamType::UInt64 => {
                unsafe { Value::UInt64(*(buf as *const u64)) }
            },
            ParamType::FsPath => {
                Value::String(self.to_string(buf))
            },
            ParamType::ErrNo => {
                unsafe { Value::Int64(*(buf as *const i64)) }
            },
            ParamType::Fd => {
                unsafe { Value::Int64(*(buf as *const i64)) }
            },
            ParamType::Pid => {
                unsafe { Value::Int64(*(buf as *const i64)) }
            },
            ParamType::Uid | ParamType::Gid  => {
                unsafe { Value::UInt32(*(buf as *const u32)) }
            },
            ParamType::SyscallId => {
                unsafe { Value::UInt16(*(buf as *const u16)) }
            },
            ParamType::CharBuffer => {
                Value::String(self.to_string(buf))
            },
            ParamType::ByteBuffer => {
                Value::String(self.to_string(buf))
            }
            _ => Value::None
        }
    }

    fn to_string(&self, buf: *const u8) -> String {
        unsafe {
            CStr::from_ptr(buf as *const libc::c_char).to_string_lossy().into_owned()
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <link rel="dns-prefetch" href="//fonts.googleapis.com" />
    <link rel="dns-prefetch" href="//themes.googleusercontent.com" />
    <link rel="dns-prefetch" href="https://www.google-analytics.com" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>Bootstrap UI Documentation</title>
    <meta name="description" content="Bootstrap UI is a Bootstrap 3 extension for building beautiful web apps user interfaces." />
    <meta name="author" content="VisionApps, s.r.o. [www.visionapps.cz]" />
    <meta name="generator" content="kss" />

    <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Titillium+Web:400,300,700&subset=latin,latin-ext" type="text/css" />
    <link rel="stylesheet" href="assets/css/bootstrap-ui.min.css?v3.1.1" type="text/css" />
    <link rel="stylesheet" href="kss-assets/css/kss.min.css?v3.1.1" type="text/css" />

    <link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAAEEfUpiAAAACXBIWXMAAAsSAAALEgHS3X78AAAB5klEQVRYw82Wv0vDQBTHPwmddNFBV5u1ONT/wP4FbXCxdRJEnAodhYJKB0fRSURREVsXaYqDWxG3QsEO4tp01UEXXePSC7G5pmkuWr/b/Xjf9+577707DYBs3qEPXQwcq9qfGIBvQvPauzscq6rCEWgheB2ryvJiSk4JsHdzy87qSjgXGtl8F0gOWTf1gEWAemIwQJc6V/AHqeUK7oJAQnbMj88v+QZh7XUnZRhL6lE6jISuYjz0Lr0JBbC8mHLnRBIEEgTh4flFjWC3n2WRCbyXHOqawohoqhBoZPM5oB7B1qZRM1SPYOuoIalK8LOahlWUwPrRMRfNx3B5IKp/dm2DTrcHwHlxK1wtDCbOUml7vGLyYmZ6iqeDfQA3kkANgrQ4vLsPH4HQQMsVXOEiaSDUj6yBrIQjayCLJJZyZpIEpko/iAOmPkHnAHWdCSMRZlNQi5LBarW5bD5itdqh3gQn7gC8nczYLPqewrEVkPUZ6fswP0f35PBHJ0wbSd9vINY6HK3Cp3oORLmSTrdHplwJlP9XFUgbC7xfn5Kcn4tfgWE5APB0sE/aWHDH58UtMuXK3ylgv779jxwQZVg6u4o/gFFOrVabvZtbnxqRG9FvQgfsCfq3dRo1o//H/8tAbMCkUTO+AZMSviJnMSU2AAAAAElFTkSuQmCC" />

    ⚠ Bootstrap UI is in maintenance mode.
    There are no plans to upgrade to a higher version of Bootstrap since v4 introduced most of what we missed in v3.

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#menu">
                    Menu

                </button>

                    Bootstrap UI
                    SUI

                            Typography

                            Layout

                            Navigation

                            Forms

                            Common

                            JavaScript

5.6. Item Actions

Item actions extend Bootstrap button component. They are optimized for long
lists of items where each item offers one or more actions to be taken. They look the best when used only with icons.

Example

        Share

        Remove

Used in table:

                Article

                Hotforwords Can Explain Lorem Ipsum far better than I can

                Which to isn't lesser together years land heaven brought

<p>
    <a href="#" class="item-action" title="Edit">
        <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
    </a>
    <a href="#" class="item-action item-action-danger" title="Delete">
        <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
    </a>
    <a href="#" class="item-action">
        <span class="glyphicon glyphicon-share-alt" aria-hidden="true"></span>
        Share
    </a>
    <a href="#" class="item-action item-action-danger">
        <span class="glyphicon glyphicon-remove-sign" aria-hidden="true"></span>
        Remove
    </a>
</p>
<p><strong>Used in table:</strong></p>
<div class="table-responsive">
    <table class="table">
        <thead>
            <tr>
                <th>Article</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>Hotforwords Can Explain Lorem Ipsum far better than I can</td>
                <td class="table-cell-actions">
                    <a href="#" class="item-action" title="Edit">
                        <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
                    </a>
                    <a href="#" class="item-action item-action-danger" title="Delete">
                        <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
                    </a>
                </td>
            </tr>
            <tr>
                <td>Which to isn't lesser together years land heaven brought</td>
                <td class="table-cell-actions">
                    <a href="#" class="item-action" title="Edit">
                        <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
                    </a>
                    <a href="#" class="item-action item-action-danger" title="Delete">
                        <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
                    </a>
                </td>
            </tr>
        </tbody>
    </table>
</div>

                        ↑ Top

                © VisionApps team 2021,
                code licensed under MIT
                |
                Currently 3.1.1
                |
                GitHub


text:
namespace Ui {
class SettingsWidget;
}

class SettingsWidget : public QWidget
{
    Q_OBJECT

    QVector<double> *rpmP, *x;
    QVector<double> *pointsX, *pointsY;
    QVector<PlotPoint*> *pointsMarks;
    PlotPoint* current;
    PlotPoint* currentState;
    QPointF cPos;
    QCustomPlot* customPlot;
    bool dragFlag = false;
    FanCurve fanCurve;

    QColor defaultColor = Qt::lightGray,
    dragColor = Qt::red,
    graphColor = QColor(92, 170, 21);
    double deadZone;

public:
    explicit SettingsWidget(QWidget *parent = 0);

    explicit SettingsWidget(Fan *fan, QWidget *parent = 0);
    void addPoint();
    void setGraphToAuto();
    ~SettingsWidget();
public slots:
    void dragPointFlag(QMouseEvent *event);
    void dragPoint(QMouseEvent *event);
private:
    void initSettingsGraph();
    void initFanCurveGraph();
    void initSettingsCommonCode();
    Ui::SettingsWidget *ui;
};

#endif // SETTINGSWIDGET_H


text:
const Mongoose    =   require('mongoose');
const Schema      =   Mongoose.Schema;

const Joi           =   require('Joi');
const Boom          =   require('Boom');

const TestDataSchema  =   new Schema({
  testId: { type: String, unique: true, required: true },
  randomString: { type: String, unique: false, required: true }
});

const TestData = Mongoose.model('testData', TestDataSchema);

showAPI = {
    handler: function(request, reply) {
        reply({
            'message': 'Hello API!'
        })
    }
};

getTestData = {
    handler: function(request, reply) {
        TestData.find({}, function(err, testData) {
            if (err) reply(Boom.badRequest(err));
            reply(testData);
        });
    }
}

getOneTestData =  {
    validate: {
        payload: {
            testId: Joi.string().required()
        }
    },
    handler: function(request, reply) {
        TestData.findOne({
            testId: request.payload.testId
        }, function(err, testData) {
            console.log(request.payload);
            if (err) reply(Boom.badRequest(err));
            console.log("Success!");
            reply(testData);

        });
    }
}

create = {
    validate: {
        payload: {
            testId: Joi.string().required(),
            randomString: Joi.string().required()
        }
    },
    handler: function(request, reply) {
        const testData = new TestData(request.payload);
        //testData._id = Mongoose.Types.ObjectId();
        TestData.findOne({
            testId: request.payload.testId
        }, function(err, exists) {
            console.log(request.payload);
            if (!exists) {
                testData.save(function(err, testData) {
                    if (!err) {
                        return reply(testData).created(); // HTTP 201
                    }
                    else {
                        if (11000 === err.code || 11001 === err.code) {
                            reply(Boom.forbidden("Failure"));
                        }
                        else reply(Boom.forbidden(getErrorMessageFrom(err))); // HTTP 403
                    }
                });
            }
            else {
                reply(Boom.badRequest());
            }
        })
    }
}

update = {
    validate: {
        payload: {
            testId: Joi.string().required(),
            randomString: Joi.string().required()
        }
    },
    handler: function(request, reply) {
        TestData.findOneAndUpdate(
            { testId: request.payload.testId },
            { randomString: request.payload.randomString },
            function(err, updatedTestData) {
                if (err) reply(Boom.badRequest());
                reply('Success');
            }
        )
    }
};
        /*TestData.findOne({
            testId: request.params.testId
        }, function(err, testData) {
            if (!err) {
                testData.randomString = request.payload.randomString;
                testData.save(function(err, testData) {
                    if (!err) {
                        reply(testData).updated('/api/testData/' + testData._id); // HTTP 201
                    }
                    else {
                        if (11000 === err.code || 11001 === err.code) {
                            reply(Boom.forbidden("please provide another user id, it already exist"));
                        }
                        else reply(Boom.forbidden(getErrorMessageFrom(err))); // HTTP 403
                    }
                });
            }
            reply(Boom.badRequest(err)); // 500 error

        });
    }*/

remove = {
    handler: function(request, reply) {
        TestData.findOne({
            'testId': request.params.testId
        }, function(err, testId) {
            if (!err && testId) {
                testId.remove();
                reply({
                    message: "User deleted successfully"
                });
            }
            else if (!err) {
                // Couldn't find the object.
                reply(Boom.notFound());
            }
            else {
                reply(Boom.badRequest("Could not delete user"));
            }
        });
    }
};

//module.exports = Mongoose.model('TestData', TestDataSchema);

module.exports = {
    TestData,
    showAPI,
    getTestData,
    getOneTestData,
    create,
    update,
    remove
};


text:
CFDE_CSSTextBuf::CFDE_CSSTextBuf()
    : m_bExtBuf(false),
      m_pBuffer(nullptr),
      m_iBufLen(0),
      m_iDatLen(0),
      m_iDatPos(0) {}

CFDE_CSSTextBuf::~CFDE_CSSTextBuf() {
  Reset();
}

void CFDE_CSSTextBuf::Reset() {
  if (!m_bExtBuf) {
    FX_Free(m_pBuffer);
    m_pBuffer = nullptr;
  }
  m_iDatPos = m_iDatLen = m_iBufLen;
}

bool CFDE_CSSTextBuf::AttachBuffer(const FX_WCHAR* pBuffer, int32_t iBufLen) {
  Reset();
  m_pBuffer = const_cast<FX_WCHAR*>(pBuffer);
  m_iDatLen = m_iBufLen = iBufLen;
  return m_bExtBuf = true;
}

bool CFDE_CSSTextBuf::EstimateSize(int32_t iAllocSize) {
  ASSERT(iAllocSize > 0);
  Clear();
  m_bExtBuf = false;
  return ExpandBuf(iAllocSize);
}

int32_t CFDE_CSSTextBuf::LoadFromStream(
    const CFX_RetainPtr<IFGAS_Stream>& pTxtStream,
    int32_t iStreamOffset,
    int32_t iMaxChars,
    bool& bEOS) {
  ASSERT(iStreamOffset >= 0 && iMaxChars > 0);
  Clear();
  m_bExtBuf = false;
  if (!ExpandBuf(iMaxChars))
    return 0;

  if (pTxtStream->GetPosition() != iStreamOffset)
    pTxtStream->Seek(FX_STREAMSEEK_Begin, iStreamOffset);

  m_iDatLen = pTxtStream->ReadString(m_pBuffer, iMaxChars, bEOS);
  return m_iDatLen;
}

bool CFDE_CSSTextBuf::ExpandBuf(int32_t iDesiredSize) {
  if (m_bExtBuf)
    return false;
  if (!m_pBuffer)
    m_pBuffer = FX_Alloc(FX_WCHAR, iDesiredSize);
  else if (m_iBufLen != iDesiredSize)
    m_pBuffer = FX_Realloc(FX_WCHAR, m_pBuffer, iDesiredSize);
  else
    return true;

  if (!m_pBuffer) {
    m_iBufLen = 0;
    return false;
  }
  m_iBufLen = iDesiredSize;
  return true;
}

void CFDE_CSSTextBuf::Subtract(int32_t iStart, int32_t iLength) {
  ASSERT(iStart >= 0 && iLength >= 0);

  iLength = std::max(std::min(iLength, m_iDatLen - iStart), 0);
  FXSYS_memmove(m_pBuffer, m_pBuffer + iStart, iLength * sizeof(FX_WCHAR));
  m_iDatLen = iLength;
}


text:
package uk.co.amyboyd.utils;

/**
 * A listener for expired object events.
 *
 * @author The Apache MINA Project (dev@mina.apache.org)
 * @version $Rev: 589932 $, $Date: 2007-10-30 02:50:39 +0100 (Tue, 30 Oct 2007) $
 * TODO Make this a inner interface of ExpiringMap
 *
 *  Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you under the Apache License, Version 2.0 (the
 *  "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 */
interface ExpirationListener<E> {
    void expired(E expiredObject);
}


text:
#pragma once

#include "modules/localization/msf/local_pyramid_map/base_map/base_map_node_index.h"
#include "modules/localization/msf/local_pyramid_map/base_map/base_map_pool.h"
#include "modules/localization/msf/local_pyramid_map/ndt_map/ndt_map_config.h"
#include "modules/localization/msf/local_pyramid_map/ndt_map/ndt_map_node.h"

namespace apollo {
namespace localization {
namespace msf {
namespace pyramid_map {

/**@brief The memory pool for the data structure of BaseMapNode. */
class NdtMapNodePool : public BaseMapNodePool {
 public:
  /**@brief Constructor
   * @param <pool_size> The memory pool size.
   * @param <thread_size> The thread pool size.
   */
  NdtMapNodePool(unsigned int pool_size, unsigned int thread_size);
  /**@brief Destructor */
  virtual ~NdtMapNodePool() {}

 private:
  virtual BaseMapNode* AllocNewMapNode();
};

}  // namespace pyramid_map
}  // namespace msf
}  // namespace localization
}  // namespace apollo


text:
<?php

namespace Google\AdsApi\Examples\Dfp\v201611\ExchangeRateService;

require '../../../../vendor/autoload.php';

use Google\AdsApi\Common\OAuth2TokenBuilder;
use Google\AdsApi\Dfp\DfpServices;
use Google\AdsApi\Dfp\DfpSession;
use Google\AdsApi\Dfp\DfpSessionBuilder;
use Google\AdsApi\Dfp\Util\v201611\StatementBuilder;
use Google\AdsApi\Dfp\v201611\ExchangeRateService;

/**
 * This example gets the exchange rate for a specific currency code.
 *
 * <p>It is meant to be run from a command line (not as a webpage) and requires
 * that you've setup an `adsapi_php.ini` file in your home directory with your
 * API credentials and settings. See README.md for more info.
 */
class GetExchangeRatesForCurrencyCode {

  const CURRENCY_CODE = 'INSERT_CURRENCY_CODE_HERE';

  public static function runExample(DfpServices $dfpServices,
      DfpSession $session, $currencyCode) {
    $exchangeRateService =
        $dfpServices->get($session, ExchangeRateService::class);

    // Create a statement to select exchange rates.
    $pageSize = StatementBuilder::SUGGESTED_PAGE_LIMIT;
    $statementBuilder = (new StatementBuilder())
        ->where('currencyCode = :currencyCode')
        ->orderBy('id ASC')
        ->limit($pageSize)
        ->withBindVariableValue('currencyCode', $currencyCode);

    // Retrieve a small amount of exchange rates at a time, paging
    // through until all exchange rates have been retrieved.
    $totalResultSetSize = 0;
    do {
      $page = $exchangeRateService->getExchangeRatesByStatement(
          $statementBuilder->toStatement());

      // Print out some information for each exchange rate.
      if ($page->getResults() !== null) {
        $totalResultSetSize = $page->getTotalResultSetSize();
        $i = $page->getStartIndex();
        foreach ($page->getResults() as $exchangeRate) {
          printf(
              "%d) Exchange rate with ID %d, currency code '%s', and exchange "
                  . "rate %.2f was found.\n",
              $i++,
              $exchangeRate->getId(),
              $exchangeRate->getCurrencyCode(),
              $exchangeRate->getExchangeRate() / 10000000000
          );
        }
      }

      $statementBuilder->increaseOffsetBy($pageSize);
    } while ($statementBuilder->getOffset() < $totalResultSetSize);

    printf("Number of results found: %d\n", $totalResultSetSize);
  }

  public static function main() {
    // Generate a refreshable OAuth2 credential for authentication.
    $oAuth2Credential = (new OAuth2TokenBuilder())
        ->fromFile()
        ->build();

    // Construct an API session configured from a properties file and the OAuth2
    // credentials above.
    $session = (new DfpSessionBuilder())
        ->fromFile()
        ->withOAuth2Credential($oAuth2Credential)
        ->build();

    self::runExample(new DfpServices(), $session, self::CURRENCY_CODE);
  }
}

GetExchangeRatesForCurrencyCode::main();


text:
package net.cserna.bence.bulletzone.core;

import com.google.inject.AbstractModule;

public class BulletZoneModule extends AbstractModule {

	@Override
	protected void configure() {
		bind(ActionDispatcher.class).to(ThreadBasedActionDispatcher.class).asEagerSingleton();
		bind(FieldManagerCore.class);
		bind(AsyncFieldManager.class);
		bind(BulletZoneServer.class).to(BulletZoneLocalProxy.class);

	}
}


text:
from functools import reduce

def indent_text(text, indent):
    return reduce(lambda line1,line2: '%s\n%s' % (line1, line2),
                  map(lambda line: (' ' * 4 * indent) + line,
                      text.splitlines()))


text:
import setuptools

# Don't install deps for development mode.
setuptools.bootstrap_install_from = None

setuptools.setup(
  name = 'trax',
  version = '0.1',
  license = 'BSD',
  description = 'Music DB & Transcoding Utilities',
  author = 'Dan Sully',
  author_email = 'daniel-python@electricrain.com',
  url = 'https://github.com/dsully/trax',
  platforms = 'any',

  packages = ['trax'],

  scripts = [
    'bin/find-albumartist',
    'bin/find-empty-genre',
    'bin/find-missing-puid',
    'bin/fix-various-artists-compilations',
    'bin/flac-add-padding',
    'bin/flac-add-replaygain',
    'bin/trax-import',
    'bin/trax-transcode',
  ],

  zip_safe = False,
  verbose = False,
)


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

namespace Eco
{
	public static class SettingsPath
	{
        public const char Separator = '.';

        public const string Root = ".";

        public const char TypeSeparator = ':';

        public static string Combine(string left, string right)
        {
            return $"{left}{Separator}{right}".Trim(Separator);
        }

        public static string AddType(string path, string objectType)
        {
            return $"{path}{TypeSeparator}{objectType}";
        }

		public static string AddType(string path, string objectType, int index)
		{
			return $"{path}[{index}]{TypeSeparator}{objectType}";
        }
	}
}


text:
require "exceptionist"
require 'rails'

module Exceptionist
  class Engine < Rails::Engine
  end
end