text:
This plugin is an enhanced version of the stock cordova-plugin-camera which provides an API for taking pictures and for choosing images from
the system's image library.

It has been modified to extract EXIF and GPS data from all images returned from the either the camera or the image galleries on Android and iOS devices. The image file name and the image metadata (exif,gps) is returned as a JSON string, which needs to be parsed.

The Camera.Destination must be set to FILE_URI and the build must be for Android or iOS to in order for this plugin to work as described above. It will behave as the stock camera plugin in all other cases, returning the image only for all devices.

This plugin is tightly integrated within the [Alpha Anywhere](http://www.alphasoftware.com) PhoneGap App Builder. Alpha Anywhere is a Rapid Mobile Application Development and Deployment platform.

    cordova plugin add com.alphasoftware.plugins.camera.withexif

## navigator.camera.getPicture

Takes a photo using the camera, or retrieves a photo from the device's
image gallery.  The image is passed to the success callback as a
base64-encoded `String`, or as the URI for the image file.  The method
itself returns a `CameraPopoverHandle` object that can be used to
reposition the file selection popover.

    navigator.camera.getPicture( cameraSuccess, cameraError, cameraOptions );

### Description

The `camera.getPicture` function opens the device's default camera
application that allows users to snap pictures. This behavior occurs
by default, when `Camera.sourceType` equals
`Camera.PictureSourceType.CAMERA`.  Once the user snaps the photo, the
camera application closes and the application is restored.

If `Camera.sourceType` is `Camera.PictureSourceType.PHOTOLIBRARY` or
`Camera.PictureSourceType.SAVEDPHOTOALBUM`, then a dialog displays
that allows users to select an existing image.  The
`camera.getPicture` function returns a `CameraPopoverHandle` object,
which can be used to reposition the image selection dialog, for
example, when the device orientation changes.

The return value is sent to the `cameraSuccess` callback function, in
one of the following formats, depending on the specified
`cameraOptions`:

- A `String` containing the base64-encoded photo image.

- A `String` representing the image file location on local storage (default).

You can do whatever you want with the encoded image or URI, for
example:

- Render the image in an `<img>` tag, as in the example below

- Save the data locally (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc.)

- Post the data to a remote server

__NOTE__: Photo resolution on newer devices is quite good. Photos
selected from the device's gallery are not downscaled to a lower
quality, even if a `quality` parameter is specified.  To avoid common
memory problems, set `Camera.destinationType` to `FILE_URI` rather
than `DATA_URL`.

### Supported Platforms

- Amazon Fire OS
- Android
- BlackBerry 10
- Browser
- Firefox OS
- iOS
- Tizen
- Windows Phone 7 and 8
- Windows 8

### Preferences (iOS)

-  __CameraUsesGeolocation__ (boolean, defaults to false). For capturing JPEGs, set to true to get geolocation data in the EXIF header. This will trigger a request for geolocation permissions if set to true.

        <preference name="CameraUsesGeolocation" value="false" />

Note: this preference is not required with this plugin. It is assumed that the only reason that you are using this plugin is to get geolocation and exif data. If present, this preference has no effect on this plugin.

### Amazon Fire OS Quirks

Amazon Fire OS uses intents to launch the camera activity on the device to capture
images, and on phones with low memory, the Cordova activity may be killed.  In this
scenario, the image may not appear when the cordova activity is restored.

### Android Quirks

Android uses intents to launch the camera activity on the device to capture
images, and on phones with low memory, the Cordova activity may be killed.  In this
scenario, the image may not appear when the Cordova activity is restored.

### Browser Quirks

Can only return photos as base64-encoded image.

### Firefox OS Quirks

Camera plugin is currently implemented using [Web Activities](https://hacks.mozilla.org/2013/01/introducing-web-activities/).

### iOS Quirks

Including a JavaScript `alert()` in either of the callback functions
can cause problems.  Wrap the alert within a `setTimeout()` to allow
the iOS image picker or popover to fully close before the alert
displays:

    setTimeout(function() {
        // do your thing here!
    }, 0);

### Windows Phone 7 Quirks

Invoking the native camera application while the device is connected
via Zune does not work, and triggers an error callback.

### Tizen Quirks

Tizen only supports a `destinationType` of
`Camera.DestinationType.FILE_URI` and a `sourceType` of
`Camera.PictureSourceType.PHOTOLIBRARY`.

### Example

Take a photo and retrieve the image's file location and image metadata (exif, geolocation):

    // This iOS/Android only example requires the dialog and the device plugin as well.

    navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
        destinationType: Camera.DestinationType.FILE_URI });

    function onSuccess(result) {
       // convert JSON string to JSON Object
       var thisResult = JSON.parse(result);

       // convert json_metadata JSON string to JSON Object
       var metadata = JSON.parse(thisResult.json_metadata);

        var image = document.getElementById('myImage');
        image.src = thisResult.filename

        if (thisResult.json_metadata != "{}") {
            if (device.platform) == 'iOS') {

              // notice the difference in the properties below and the format of the result when you run the app.
              // iOS and Android return the exif and gps differently and I am not converting or accounting for the Lat/Lon reference.
              // This is simply the raw data being returned.

              navigator.notification.alert('Lat: '+metadata.GPS.Latitude+' Lon: '+metadata.GPS.Longitude);
            } else {
               navigator.notification.alert('Lat: '+metadata.gpsLatitude+' Lon: '+metadata.gpsLongitude);
            }

        }
    }

    function onFail(message) {
        alert('Failed because: ' + message);
    }

## CameraOptions

Optional parameters to customize the camera settings.

    { quality : 75,
      destinationType : Camera.DestinationType.DATA_URL,
      sourceType : Camera.PictureSourceType.CAMERA,
      allowEdit : true,
      encodingType: Camera.EncodingType.JPEG,
      targetWidth: 100,
      targetHeight: 100,
      popoverOptions: CameraPopoverOptions,
      saveToPhotoAlbum: false };

### Options

- __quality__: Quality of the saved image, expressed as a range of 0-100, where 100 is typically full resolution with no loss from file compression. The default is 50. _(Number)_ (Note that information about the camera's resolution is unavailable.)

- __destinationType__: Choose the format of the return value. The default is FILE_URI. Defined in `navigator.camera.DestinationType` _(Number)_

        Camera.DestinationType = {
            DATA_URL : 0,      // Return image as base64-encoded string
            FILE_URI : 1,      // Return image file URI
            NATIVE_URI : 2     // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
        };

- __sourceType__: Set the source of the picture. The default is CAMERA. Defined in `navigator.camera.PictureSourceType` _(Number)_

        Camera.PictureSourceType = {
            PHOTOLIBRARY : 0,
            CAMERA : 1,
            SAVEDPHOTOALBUM : 2
        };

- __allowEdit__: Allow simple editing of image before selection. _(Boolean)_

- __encodingType__: Choose the  returned image file's encoding. Default is JPEG. Defined in `navigator.camera.EncodingType` _(Number)_

        Camera.EncodingType = {
            JPEG : 0,               // Return JPEG encoded image
            PNG : 1                 // Return PNG encoded image
        };

- __targetWidth__: Width in pixels to scale image. Must be used with __targetHeight__.  Aspect ratio remains constant. _(Number)_

- __targetHeight__: Height in pixels to scale image. Must be used with __targetWidth__. Aspect ratio remains constant. _(Number)_

- __mediaType__: Set the type of media to select from.  Only works when `PictureSourceType` is `PHOTOLIBRARY` or `SAVEDPHOTOALBUM`. Defined in `nagivator.camera.MediaType` _(Number)_

        Camera.MediaType = {
            PICTURE: 0,    // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType
            VIDEO: 1,      // allow selection of video only, WILL ALWAYS RETURN FILE_URI
            ALLMEDIA : 2   // allow selection from all media types
        };

- __correctOrientation__: Rotate the image to correct for the orientation of the device during capture. _(Boolean)_

- __saveToPhotoAlbum__: Save the image to the photo album on the device after capture. _(Boolean)_

- __popoverOptions__: iOS-only options that specify popover location in iPad.  Defined in `CameraPopoverOptions`.

- __cameraDirection__: Choose the camera to use (front- or back-facing). The default is BACK. Defined in `navigator.camera.Direction` _(Number)_

        Camera.Direction = {
            BACK : 0,      // Use the back-facing camera
            FRONT : 1      // Use the front-facing camera
        };

### Amazon Fire OS Quirks

- Any `cameraDirection` value results in a back-facing photo.

- Ignores the `allowEdit` parameter.

- `Camera.PictureSourceType.PHOTOLIBRARY` and `Camera.PictureSourceType.SAVEDPHOTOALBUM` both display the same photo album.

### Android Quirks

- Any `cameraDirection` value results in a back-facing photo.

- Ignores the `allowEdit` parameter.

- `Camera.PictureSourceType.PHOTOLIBRARY` and `Camera.PictureSourceType.SAVEDPHOTOALBUM` both display the same photo album.

### BlackBerry 10 Quirks

- Ignores the `quality` parameter.

- Ignores the `allowEdit` parameter.

- `Camera.MediaType` is not supported.

- Ignores the `correctOrientation` parameter.

- Ignores the `cameraDirection` parameter.

### Firefox OS Quirks

- Ignores the `quality` parameter.

- `Camera.DestinationType` is ignored and equals `1` (image file URI)

- Ignores the `allowEdit` parameter.

- Ignores the `PictureSourceType` parameter (user chooses it in a dialog window)

- Ignores the `encodingType`

- Ignores the `targetWidth` and `targetHeight`

- `Camera.MediaType` is not supported.

- Ignores the `correctOrientation` parameter.

- Ignores the `cameraDirection` parameter.

### iOS Quirks

- Set `quality` below 50 to avoid memory errors on some devices.

- When using `destinationType.FILE_URI`, photos are saved in the application's temporary directory. The contents of the application's temporary directory is deleted when the application ends.

### Tizen Quirks

- options not supported

- always returns a FILE URI

### Windows Phone 7 and 8 Quirks

- Ignores the `allowEdit` parameter.

- Ignores the `correctOrientation` parameter.

- Ignores the `cameraDirection` parameter.

- Ignores the `saveToPhotoAlbum` parameter.  IMPORTANT: All images taken with the wp7/8 cordova camera API are always copied to the phone's camera roll.  Depending on the user's settings, this could also mean the image is auto-uploaded to their OneDrive.  This could potentially mean the image is available to a wider audience than your app intended.  If this a blocker for your application, you will need to implement the CameraCaptureTask as documented on msdn : [http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx](http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx)
You may also comment or up-vote the related issue in the [issue tracker](https://issues.apache.org/jira/browse/CB-2083)

- Ignores the `mediaType` property of `cameraOptions` as the Windows Phone SDK does not provide a way to choose videos from PHOTOLIBRARY.

## CameraError

onError callback function that provides an error message.

    function(message) {
        // Show a helpful message
    }

### Parameters

- __message__: The message is provided by the device's native code. _(String)_

## cameraSuccess

onSuccess callback function that provides the image data.

    function(imageData) {
        // Do something with the image
    }

### Parameters

- __imageData__: Base64 encoding of the image data, _or_ the image file URI, depending on `cameraOptions` in effect. _(String)_

### Example

    // Show image
    //
    function cameraCallback(imageData) {
        var image = document.getElementById('myImage');
        image.src = "data:image/jpeg;base64," + imageData;
    }

## CameraPopoverHandle

A handle to the popover dialog created by `navigator.camera.getPicture`.

### Methods

- __setPosition__: Set the position of the popover.

### Supported Platforms

- iOS

### setPosition

Set the position of the popover.

__Parameters__:

- `cameraPopoverOptions`: the `CameraPopoverOptions` that specify the new position

### Example

     var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail,
         { destinationType: Camera.DestinationType.FILE_URI,
           sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
           popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)
         });

     // Reposition the popover if the orientation changes.
     window.onorientationchange = function() {
         var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
         cameraPopoverHandle.setPosition(cameraPopoverOptions);
     }

## CameraPopoverOptions

iOS-only parameters that specify the anchor element location and arrow
direction of the popover when selecting images from an iPad's library
or album.

    { x : 0,
      y :  32,
      width : 320,
      height : 480,
      arrowDir : Camera.PopoverArrowDirection.ARROW_ANY
    };

### CameraPopoverOptions

- __x__: x pixel coordinate of screen element onto which to anchor the popover. _(Number)_

- __y__: y pixel coordinate of screen element onto which to anchor the popover. _(Number)_

- __width__: width, in pixels, of the screen element onto which to anchor the popover. _(Number)_

- __height__: height, in pixels, of the screen element onto which to anchor the popover. _(Number)_

- __arrowDir__: Direction the arrow on the popover should point.  Defined in `Camera.PopoverArrowDirection` _(Number)_

            Camera.PopoverArrowDirection = {
                ARROW_UP : 1,        // matches iOS UIPopoverArrowDirection constants
                ARROW_DOWN : 2,
                ARROW_LEFT : 4,
                ARROW_RIGHT : 8,
                ARROW_ANY : 15
            };

Note that the size of the popover may change to adjust to the
direction of the arrow and orientation of the screen.  Make sure to
account for orientation changes when specifying the anchor element
location.

## navigator.camera.cleanup

Removes intermediate photos taken by the camera from temporary
storage.

    navigator.camera.cleanup( cameraSuccess, cameraError );

### Description

Removes intermediate image files that are kept in temporary storage
after calling `camera.getPicture`. Applies only when the value of
`Camera.sourceType` equals `Camera.PictureSourceType.CAMERA` and the
`Camera.destinationType` equals `Camera.DestinationType.FILE_URI`.

### Supported Platforms

- iOS

### Example

    navigator.camera.cleanup(onSuccess, onFail);

    function onSuccess() {
        console.log("Camera cleanup success.")
    }

    function onFail(message) {
        alert('Failed because: ' + message);
    }


text:
package net.minidev.ovh.api.dedicated.server;

import net.minidev.ovh.api.complextype.OvhUnitAndValue;

/**
 * Server disks informations
 */
public class OvhRtmDisk {
	/**
	 * Disk
	 *
	 * canBeNull && readOnly
	 */
	public String disk;

	/**
	 * Disk temperature
	 *
	 * canBeNull && readOnly
	 */
	public OvhUnitAndValue<Long> temperature;

	/**
	 * Disk model
	 *
	 * canBeNull && readOnly
	 */
	public String model;

	/**
	 * Disk capacity
	 *
	 * canBeNull && readOnly
	 */
	public OvhUnitAndValue<Long> capacity;
}

redpajama_set_name: RedPajamaGithub


text:
package org.eclipse.net4j.util.registry;

import org.eclipse.net4j.internal.util.bundle.OM;
import org.eclipse.net4j.util.WrappedException;
import org.eclipse.net4j.util.container.Container;
import org.eclipse.net4j.util.container.ContainerEvent;
import org.eclipse.net4j.util.container.IContainerDelta;

import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 * @author Eike Stepper
 */
public abstract class Registry<K, V> extends Container<Map.Entry<K, V>> implements IRegistry<K, V>
{
  private boolean autoCommit;

  private Transaction transaction;

  protected Registry(boolean autoCommit)
  {
    this.autoCommit = autoCommit;
  }

  protected Registry()
  {
    this(true);
  }

  @Override
  public boolean isEmpty()
  {
    return keySet().isEmpty();
  }

  public int size()
  {
    return keySet().size();
  }

  public Set<Entry<K, V>> entrySet()
  {
    return getMap().entrySet();
  }

  public Set<K> keySet()
  {
    return getMap().keySet();
  }

  public Collection<V> values()
  {
    return getMap().values();
  }

  public boolean containsKey(Object key)
  {
    return keySet().contains(key);
  }

  public boolean containsValue(Object value)
  {
    return values().contains(value);
  }

  public V get(Object key)
  {
    return getMap().get(key);
  }

  /**
   * Requires {@link #commit()} to be called later if not {@link #isAutoCommit()}.
   */
  public synchronized V put(K key, V value)
  {
    V result = register(key, value);
    autoCommit();
    return result;
  }

  /**
   * Requires {@link #commit()} to be called later if not {@link #isAutoCommit()}.
   */
  public synchronized void putAll(Map<? extends K, ? extends V> t)
  {
    if (!t.isEmpty())
    {
      Iterator<? extends Entry<? extends K, ? extends V>> i = t.entrySet().iterator();
      while (i.hasNext())
      {
        Entry<? extends K, ? extends V> e = i.next();
        register(e.getKey(), e.getValue());
      }

      autoCommit();
    }
  }

  /**
   * Requires {@link #commit()} to be called later if not {@link #isAutoCommit()}.
   */
  public synchronized V remove(Object key)
  {
    V result = deregister(key);
    autoCommit();
    return result;
  }

  /**
   * Requires {@link #commit()} to be called later if not {@link #isAutoCommit()}.
   */
  public synchronized void clear()
  {
    if (!isEmpty())
    {
      for (Object key : keySet().toArray())
      {
        deregister(key);
      }

      autoCommit();
    }
  }

  @SuppressWarnings("unchecked")
  public Entry<K, V>[] getElements()
  {
    return entrySet().toArray(new Entry[size()]);
  }

  public boolean isAutoCommit()
  {
    return autoCommit;
  }

  public void setAutoCommit(boolean autoCommit)
  {
    this.autoCommit = autoCommit;
  }

  public synchronized void commit(boolean notifications)
  {
    if (transaction != null)
    {
      if (!transaction.isOwned())
      {
        OM.LOG.warn("Committing thread is not owner of transaction: " + Thread.currentThread()); //$NON-NLS-1$
      }

      transaction.commit(notifications);
      transaction = null;
      notifyAll();
    }
  }

  public void commit()
  {
    commit(true);
  }

  @Override
  public String toString()
  {
    return getMap().toString();
  }

  protected V register(K key, V value)
  {
    Transaction transaction = getTransaction();
    V oldValue = getMap().put(key, value);
    if (oldValue != null)
    {
      transaction.rememberDeregistered(key, oldValue);
    }

    transaction.rememberRegistered(key, value);
    return oldValue;
  }

  @SuppressWarnings("unchecked")
  protected V deregister(Object key)
  {
    V value = getMap().remove(key);
    if (value != null)
    {
      getTransaction().rememberDeregistered((K)key, value);
    }

    return value;
  }

  protected Transaction getTransaction()
  {
    for (;;)
    {
      if (transaction == null)
      {
        transaction = new Transaction();
        return transaction;
      }

      if (transaction.isOwned())
      {
        transaction.increaseNesting();
        return transaction;
      }

      try
      {
        wait();
      }
      catch (InterruptedException ex)
      {
        throw WrappedException.wrap(ex);
      }
    }
  }

  protected void autoCommit()
  {
    if (autoCommit)
    {
      commit();
    }
  }

  protected abstract Map<K, V> getMap();

  /**
   * @author Eike Stepper
   */
  protected class Transaction
  {
    private int nesting = 1;

    private ContainerEvent<Map.Entry<K, V>> event;

    private Thread owner;

    public Transaction()
    {
      owner = Thread.currentThread();
      initEvent();
    }

    private void initEvent()
    {
      event = newContainerEvent();
    }

    public boolean isOwned()
    {
      return owner == Thread.currentThread();
    }

    public void increaseNesting()
    {
      ++nesting;
    }

    public void commit(boolean notifications)
    {
      if (--nesting == 0)
      {
        if (notifications && !event.isEmpty())
        {
          fireEvent(event);
        }

        initEvent();
      }
    }

    public void rememberRegistered(K key, V value)
    {
      event.addDelta(new Element<K, V>(key, value), IContainerDelta.Kind.ADDED);
    }

    public void rememberDeregistered(K key, V value)
    {
      event.addDelta(new Element<K, V>(key, value), IContainerDelta.Kind.REMOVED);
    }
  }

  /**
   * @author Eike Stepper
   */
  private static final class Element<K, V> implements Map.Entry<K, V>
  {
    private final K key;

    private final V value;

    private Element(K key, V value)
    {
      this.key = key;
      this.value = value;
    }

    public K getKey()
    {
      return key;
    }

    public V getValue()
    {
      return value;
    }

    public V setValue(V value)
    {
      throw new UnsupportedOperationException();
    }
  }
}


text:
using Arragro.Core.Common.Models;
using Arragro.Core.Web.ApplicationModels;
using ArragroCMS.Core.Models;
using ArragroCMS.Web.Management.Extensions;
using ArragroCMS.Web.Management.Filters;
using ArragroCMS.Web.ReadOnlyApi.Extentions;
using ArragroCMS.Web.ReadOnlyApi.Handlers;
using HealthChecks.UI.Client;
using Microsoft.AspNetCore.Antiforgery;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Authorization;
using Microsoft.AspNetCore.ResponseCompression;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.IdentityModel.Tokens;
using Serilog;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;

namespace cms.arragro.com
{
    public class Startup
    {
        public const string ObjectIdentifierType = "http://schemas.microsoft.com/identity/claims/objectidentifier";
        public const string TenantIdType = "http://schemas.microsoft.com/identity/claims/tenantid";

        private readonly ILoggerFactory _loggerFactory;

        public Startup(IConfiguration configuration, IWebHostEnvironment env, ILoggerFactory loggerFactory)
        {
            Configuration = configuration;
            ConfigurationSettings = Configuration.Get<ConfigurationSettings>();
            Environment = env;
            _loggerFactory = loggerFactory;
        }

        public IConfiguration Configuration { get; }
        public ConfigurationSettings ConfigurationSettings { get; }
        public IWebHostEnvironment Environment { get; set; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            try
            {
                var logger = _loggerFactory.CreateLogger<Startup>();
                logger.LogInformation("Checking {Configuration}", Configuration);
                logger.LogInformation("Starting the configuration of the ArragroCmsServices");

                var defaultSchemas = new List<string>()
                {
                    JwtBearerDefaults.AuthenticationScheme,
                    CookieAuthenticationDefaults.AuthenticationScheme
                };
                if (ConfigurationSettings.ApplicationSettings.UseAccessTokenInQueryString)
                    defaultSchemas.Add(AccessTokenQueryStringAuthenticationHandler.AuthenticationScheme);

                services.AddCustomHealthCheck(ConfigurationSettings)
                    .AddDefaultArragroCmsServices(
                        Configuration,
                        Environment,
                        ConfigurationSettings,
                        new CultureInfo("en"),
                        new CultureInfo[] { new CultureInfo("en-nz") },
                        new TimeSpan(2, 0, 0),
                        defaultSchemas.ToArray(),
                        true);

                if (Configuration["ApplicationInsights:InstrumentationKey"] != null)
                    services.AddApplicationInsightsTelemetryWorkerService(Configuration["ApplicationInsights:InstrumentationKey"]);

                // Replace Image Provider with ImageServiceProvider
                // services.Remove(services.FirstOrDefault(descriptor => descriptor.ServiceType == typeof(IImageProvider)));
                // services.AddSingleton<IImageProvider>(s => new Arragro.Providers.ImageServiceProvider.ImageProvider(Configuration["ApplicationSettings:ImageServiceUrl"], 40000));

                //services.Remove<IStorageProvider>();
                //services.AddSingleton<IStorageProvider, S3StorageProvider>();

                services.AddSingleton<BaseSettings>(ConfigurationSettings);
                services.AddLogging(configure => configure.AddSerilog());

                ArragroCMS.Web.ReadOnlyApi.Extentions.ServiceCollectionExtensions.RegisterFilterAttributes(services);

                var authBuilder = services.BuildArragroCmsAuthentication(ConfigurationSettings, new TimeSpan(2, 0, 0));
                authBuilder
                    .AddJwtBearer(options =>
                    {
                        var cert = new X509Certificate2(File.ReadAllBytes(ConfigurationSettings.JwtSettings.CertificatePath), ConfigurationSettings.JwtSettings.Password);
                        var key = new X509SecurityKey(cert);

                        options.TokenValidationParameters = new TokenValidationParameters()
                        {
                            ValidIssuer = ConfigurationSettings.JwtSettings.Issuer,
                            ValidAudience = ConfigurationSettings.JwtSettings.Audience,
                            ValidateIssuerSigningKey = true,
                            IssuerSigningKey = key,
                            ValidateLifetime = true
                        };
                    });

                if (ConfigurationSettings.ApplicationSettings.UseAccessTokenInQueryString)
                    authBuilder.AddScheme<AuthenticationSchemeOptions, AccessTokenQueryStringAuthenticationHandler>(AccessTokenQueryStringAuthenticationHandler.AuthenticationScheme, null);

                services.AddArragroCmsReadOnylApiAuthorization(ConfigurationSettings);

                logger.LogInformation("Finished configuring of the ArragroCmsServices");

                services.Configure<GzipCompressionProviderOptions>
                    (options => options.Level = CompressionLevel.Fastest);

                services.AddResponseCompression(options =>
                {
                    options.Providers.Add<GzipCompressionProvider>();
                    options.EnableForHttps = true;
                });

                services.AddMvc(config =>
                {
                    config.Filters.Add(new AuthorizeFilter());
                    config.Filters.Add(new AutoValidateAntiforgeryTokenAttribute());
                    config.Filters.Add(new AuthenticationResultFilter());
                    config.Filters.Add(new ValidateModelAttribute());

                    var removals = new List<Type>
                    {
                        typeof(Arragro.Dynamic.Api.Controllers.TemplateController),
                        typeof(Arragro.Dynamic.Api.Controllers.ComponentController),
                        typeof(Arragro.Dynamic.Api.Controllers.OptionController),
                        typeof(Arragro.Dynamic.Api.Controllers.FieldControlController)
                    };

                    config.Conventions.Add(new RoutingControllerOverrideConvention(removals));
                }).AddApplicationPart(typeof(Arragro.Dynamic.Api.Controllers.ComponentController).GetTypeInfo().Assembly)
                  .AddApplicationPart(typeof(ArragroCMS.Web.Management.Controllers.AccountController).GetTypeInfo().Assembly)
                  .AddNewtonsoftJson();

                services.AddHsts(options =>
                {
                    options.Preload = true;
                    options.IncludeSubDomains = true;
                    options.MaxAge = TimeSpan.FromDays(60);
                    //options.ExcludedHosts.Add("example.com");
                    //options.ExcludedHosts.Add("www.example.com");
                });

                services.AddHttpsRedirection(options =>
                {
                    if (Environment.IsDevelopment())
                    {
                        options.RedirectStatusCode = StatusCodes.Status307TemporaryRedirect;
                        options.HttpsPort = 5003;
                    }
                });
            }
            catch (Exception ex)
            {
                Log.Logger.Error<Exception>("Configure Services Failed: {ex}", ex);
                throw;
            }
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IServiceProvider serviceProvider, IWebHostEnvironment env, IAntiforgery antiforgery)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseWhen(x => !x.Request.Path.Value.StartsWith("/api"), builder =>
                {
                    builder.UseExceptionHandler("/Home/Error");
                });
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseDefaultFiles();
            if (!env.IsDevelopment())
            {
                app.UseCompressedStaticFiles();
            }
            app.UseStaticFiles();

            app.UseRouting();
            app.UseAuthentication();
            app.UseAuthorization();

            app.UseArragroCMS(antiforgery);

            app.UseResponseCompression();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default-spa",
                    pattern: "{controller=ArragroCms}/{action=Index}/{id?}/{status?}");

                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=MicrosoftAccount}/{action=Index}/{id?}");

                endpoints.MapHealthChecks("/hc", new HealthCheckOptions()
                {
                    Predicate = _ => true,
                    ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse,
                    ResultStatusCodes =
                    {
                        [HealthStatus.Healthy] = StatusCodes.Status200OK,
                        [HealthStatus.Degraded] = StatusCodes.Status200OK,
                        [HealthStatus.Unhealthy] = StatusCodes.Status503ServiceUnavailable
                    }
                });
                endpoints.MapHealthChecks("/liveness", new HealthCheckOptions
                {
                    Predicate = r => r.Name.Contains("self")
                });

                endpoints.MapFallbackToController("Index", "ArragroCms");
            });
        }
    }
}


text:
package com.blazebit.persistence.view.processor.model;

import com.blazebit.persistence.WhereBuilder;
import com.blazebit.persistence.view.AttributeFilter;
import com.blazebit.persistence.view.EntityView;
import com.blazebit.persistence.view.EntityViewManager;
import com.blazebit.persistence.view.MappingParameter;
import com.blazebit.persistence.view.ViewFilter;
import com.blazebit.persistence.view.ViewFilterProvider;
import com.blazebit.persistence.view.filter.StartsWithFilter;

import java.io.Serializable;
import java.util.List;
import java.util.Optional;
import java.util.Set;

@EntityView(AEntity.class)
@ViewFilter(name = "test", value = AView.TestFilter.class)
public interface AView<X extends Serializable> extends IdHolderView<Integer> {

    @AttributeFilter(StartsWithFilter.class)
    String getName();

    void setName(String name);

    List<String> getNames();

    Optional<BView> getOptionalValue();

    @TypeUseAnnotation
    int getAge();

    List<X> getTest();

    X getTest2();

    EntityViewManager evm();

    byte[] getBytes();

    List<Set<String>> getMultiNames();

    @MappingParameter("listMappingParameter")
    List<Object> getListMappingParameter();

    class TestFilter extends ViewFilterProvider {

        private static final String CONSTANT = "myParam";

        @Override
        public <T extends WhereBuilder<T>> T apply(T whereBuilder) {
            return whereBuilder.setWhereExpression( ":" + CONSTANT );
        }
    }
}


text:
<?php defined('BX_DOL') or die('hack attempt');

/**
 * When profile is anonymous then use this special class.
 *
 * @section example Example of usage
 *
 * @code
 * if (0 > $iId)
 *     $oProfile = BxDolProfileAnonymous::getInstance();
 * else
 *     $oProfile = BxDolProfile::getInstance($iId);
 *
 * @endcode
 */
class BxDolProfileAnonymous extends BxDolProfileUndefined
{
    /**
     * Prevent cloning the instance
     */
    public function __clone()
    {
        $sClass = get_class($this);
        if (isset($GLOBALS['bxDolClasses'][$sClass]))
            trigger_error('Clone is not allowed for the class: ' . get_class($this), E_USER_ERROR);
    }

    /**
     * Get singleton instance of the class
     */
    public static function getInstance()
    {
        $sClass = __CLASS__;
        if(!isset($GLOBALS['bxDolClasses'][$sClass]))
            $GLOBALS['bxDolClasses'][$sClass] = new $sClass();

        return $GLOBALS['bxDolClasses'][$sClass];
    }

    /**
     * Get profile display name
     */
    public function getDisplayName()
    {
        return _t('_anonymous');
    }
}

/** @} */


text:
layout: page
title: Mcbride Gold Industries Trade Fair
date: 2016-05-24
author: Randy Mccoy
tags: weekly links, java
status: published
summary: Nullam quis nisi mollis, tempus.
banner: images/banner/office-01.jpg
booking:
  startDate: 05/17/2019
  endDate: 05/20/2019
  ctyhocn: PWMBAHX
  groupCode: MGITF
published: true
---
Duis mattis molestie purus ut blandit. Ut a pulvinar dolor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam volutpat mi leo, id pellentesque nibh condimentum quis. Suspendisse porttitor arcu nisl, eget imperdiet sem pharetra quis. Aliquam consectetur lobortis lectus, et consequat turpis. Aliquam sit amet neque et massa cursus tincidunt. Fusce vel justo ut turpis pulvinar bibendum ut in elit. Etiam non ante at sem scelerisque porta sed quis sapien. Mauris ante ex, imperdiet at vulputate ut, tempus eget neque. Integer consectetur nulla quis elit auctor auctor non nec nibh. Pellentesque ut accumsan magna. Sed a risus vehicula, suscipit enim vel, cursus massa. In faucibus euismod justo, et vestibulum tellus ultrices non. Donec eu hendrerit turpis, et convallis libero. Fusce diam est, feugiat elementum cursus in, iaculis id metus.

* Proin eget libero quis odio elementum posuere
* Sed eu mi quis augue facilisis iaculis
* Nunc nec lectus vulputate, laoreet mi aliquet, auctor purus
* Morbi et dolor bibendum, lacinia diam sit amet, lobortis elit
* Quisque mollis tortor vel tortor eleifend placerat ut non ante.

Fusce faucibus odio vel massa scelerisque tempor. Nulla cursus mattis nisi auctor tempor. Morbi eu turpis tempus, eleifend risus at, vehicula mauris. Suspendisse dapibus risus a erat iaculis aliquam. Aliquam id lobortis turpis. Nulla gravida sem vel arcu vulputate, vel condimentum nunc lacinia. Pellentesque sodales odio ultrices, consectetur magna non, congue nibh. Morbi tincidunt elit venenatis elit efficitur, vehicula porttitor erat ultricies.
Nunc pretium dapibus orci, vehicula malesuada libero efficitur ac. In nec varius tellus. Nam efficitur purus et augue aliquet, eget malesuada justo pellentesque. Nullam risus metus, imperdiet non scelerisque eget, vestibulum eget enim. Integer eget mollis leo. Ut malesuada enim non dui blandit, nec sollicitudin dui interdum. Etiam et dignissim ante.


text:
package spec;

import org.junit.Test;
import org.junit.Ignore;
import static org.junit.Assert.*;
import org.hamcrest.*;

import src.*;

public class GraphTest {

    @Test
    public void graphShouldHaveAnArrayOfTowns() {
        assertArrayEquals("A graph should have an array of town objects.", Fixtures.towns, Fixtures.graph.getTowns());
    }

    @Test
    public void graphShouldHaveAnArrayOfTracks() {
        assertArrayEquals("A graph should have an array of track objects.", Fixtures.tracks, Fixtures.graph.getTracks());
    }

    @Test
    public void graphShouldBeAbleToGetATownByName() {
    	 assertSame("A graph should be able to get a town by its name.", Fixtures.townA, Fixtures.graph.getTown("A"));
    }

    @Test
    public void graphShouldBeAbleToFindAllTracksOutOfATown() {
    	 assertEquals("A graph should be able to find all tracks out of a town.", Fixtures.tracksOutForTownA, Fixtures.graph.findAllTracksOutOfTown(Fixtures.townA));
    }

    @Test
    public void graphShouldBeAbleToFindAllTracksIntoATown() {
    	 assertEquals("A graph should be able to find all tracks into a town.", Fixtures.tracksInForTownC, Fixtures.graph.findAllTracksIntoTown(Fixtures.townC));
    }

    @Test
    public void graphShouldBeAbleToFindATrackBetweenTwoTowns() {
    	 assertSame("A graph should be able to find a track between two towns if it exists.", Fixtures.trackAB, Fixtures.graph.findDirectedTrackBetweenTwoTowns(Fixtures.townA, Fixtures.townB));
    }

   @Test
    public void graphShouldNotBeAbleToFindATrackBetweenTwoTownsIfItDoesntExist() {
    	 assertSame("A graph should NOT be able to find a track between two towns if it doesn't exist.", null, Fixtures.graph.findDirectedTrackBetweenTwoTowns(Fixtures.townD, Fixtures.townC));
    }

    @Test
    public void graphShouldBeAbleToFindTotalDistanceOfARoute() {
    	 assertSame("A graph should be able to find the total distance of a route.", 25, Fixtures.graph.findTotalDistanceOfRoute(Fixtures.testRoute));
    }

    @Test
    public void graphShouldBeAbleToGetAllNeighboringTownsForATown() {
    	 assertEquals("A graph should be able to get all neighboring towns for a town.", Fixtures.adjacentTowns, Fixtures.graph.getAllNeighboringTowns(Fixtures.townA));
    }

    @Test
    public void graphShouldBeAbleToFindAllRoutesWithMaxStops() {
    	 assertEquals("A graph should be able to find all routes given origin, destination, and max stops.", Fixtures.routesForCC3, Fixtures.graph.findRoutesWithMaxStops(Fixtures.townC, Fixtures.townC, 3));
    }

    @Test
    public void graphShouldBeAbleToFindAllRoutesWithExactStops() {
    	 assertEquals("A graph should be able to find all routes given origin, destination, and exact stops.", Fixtures.routesForAC4, Fixtures.graph.findRoutesWithMaxStops(Fixtures.townA, Fixtures.townC, 4));
    }
}


text:
package org.araqne.logdb.mongo.query;

public enum MongoOp {
	DBS, COLS, FIND, INSERT, UPDATE;

	public static MongoOp parse(String s) {
		for (MongoOp op : values())
			if (op.name().equalsIgnoreCase(s))
				return op;

		return null;
	}
}


text:
@interface MMRLocation ()
{
    NSDateFormatter * formatter;
    NSMutableDictionary * currentAddress;
    NSArray * myPlace;

}

@end

@implementation MMRLocation

@synthesize myCurrentlocation;

-(id) init
{
    self = [super init];
    if(self)
    {
        currentAddress = [[NSMutableDictionary alloc] initWithDictionary:[self setDefaultAddress]];
        [self setLocationManager];
        [self setDateFormat];

    }
    [self startLocationUpdate];

    return self;
}

+(id)shareInstance{
    static MMRLocation *__instance = nil;
    if(__instance == nil){
        __instance = [[MMRLocation alloc] init];
    }

    return __instance;
}

- (void) setLocationManager
{
    if (locationManager == nil){

        locationManager = [[CLLocationManager alloc]init];

	}
    [locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
    locationManager.delegate = self;

}

- (void) setDateFormat
{
    formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"hh:mm:ss a z"];
}

- (void) startLocationUpdate
{
    [locationManager startUpdatingLocation];

}

- (void) stopLocationUpdate
{
    [locationManager stopUpdatingLocation];
}

- (CLLocationCoordinate2D) getCurrent2Dlocation
{
    [self startLocationUpdate];

    //Assign location value
    self.lat = location.coordinate.latitude;
    self.lon = location.coordinate.longitude;

    currentLoc =  CLLocationCoordinate2DMake(self.lat , self.lon);

    return currentLoc;
}

#pragma mark -
#pragma mark CLLocationManagerDelegate

- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
    location = [locations lastObject];

    //Get timeStemp of lastest location update
    NSDate * eventDate = [(CLLocation *)[locations lastObject] timestamp];

    NSTimeInterval howRecent = [eventDate timeIntervalSinceNow];
    if (abs(howRecent) < 1.0 || location.horizontalAccuracy < 100 ) {
       //Assign location value
        self.lat = location.coordinate.latitude;
        self.lon = location.coordinate.longitude;

        recently = YES;
        myCurrentlocation = nil;
        myCurrentlocation = [locations lastObject];

    }

}

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
    if(error.code == kCLErrorDenied) {
        [locationManager stopUpdatingLocation];
    } else if(error.code == kCLErrorLocationUnknown) {
        // retry
    } else {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Retrieving location error"
                                                        message:[error description]
                                                       delegate:nil
                                              cancelButtonTitle:@"OK"
                                              otherButtonTitles:nil];
        [alert show];
    }
}

- (CLLocation *)getMyCurrentLocation
{

    NSDate * eventDate = [myCurrentlocation timestamp];

    NSTimeInterval howRecent = [eventDate timeIntervalSinceNow];

        if (abs(howRecent) < 5.0 || location.horizontalAccuracy < 100) {

            return myCurrentlocation;

        }
        else{
            [self startLocationUpdate];
            [self performSelector:@selector(getMyCurrentLocation) withObject:nil afterDelay:1.0];

        }

    return myCurrentlocation;

}

- (void)isLocationUpdated:(CLLocation *)storeLocation
{
    NSTimeInterval t = [[storeLocation timestamp] timeIntervalSinceNow];

    if (t< - 60) {

        [self startLocationUpdate];

         ///Deley action to get Curent Location for debugging
        double delayInSeconds = 2.0;
        dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
        dispatch_after(popTime, dispatch_get_main_queue(), ^(void){

            if (myCurrentlocation != nil) {
                [self.delegate locationDidUpdate:myCurrentlocation];

                [self stopLocationUpdate];

            }
            if (myCurrentlocation == nil) {

                [self performSelector:@selector(isLocationUpdated:) withObject:storeLocation afterDelay:1.0];
            }

        });////End delay

    }

}

- (void) addressFromLocation :(CLLocation *)currentLocation
{

    CLGeocoder *geocoder = [[CLGeocoder alloc] init] ;

    [geocoder reverseGeocodeLocation:currentLocation
                   completionHandler:^(NSArray *placemarks, NSError *error) {

                       if (error){
                           NSString *msg = @"Sorry,the system can't reverse locations to address. Please check the Internet connection";
                           [self alert:@"Error" withDetails:msg];

                           return;

                       }

                       if(placemarks && placemarks.count > 0)

                       {
                           // [nearby thoroughfare] - street
                           //[nearby locality] - town
                           CLPlacemark *nearby = [placemarks objectAtIndex:0];

                           //////// add default address /////
                           NSString *adminArea = ([nearby administrativeArea].length > 0 ? [nearby thoroughfare] : @"Unknown");
                           NSString *subAdminArea = ([nearby subAdministrativeArea].length > 0 ? [nearby thoroughfare] : @"Unknown");

                           NSString *street = ([nearby thoroughfare].length > 0 ? [nearby thoroughfare] : @"Unknown");
                           NSString *locality = ([nearby locality].length > 0 ? [nearby locality] : @"Unknown");
                           NSString *postalCode = ([nearby postalCode].length > 0 ? [nearby postalCode] : @"Unknown");
                           NSString *country = ([nearby country].length > 0 ? [nearby country] : @"Unknown");

                          // NSArray *result = [NSArray arrayWithObjects:[nearby thoroughfare],
                            //                  [nearby locality], [nearby postalCode],
                              //                [nearby country], nil];
                           NSArray *result = [NSArray arrayWithObjects:street, subAdminArea, adminArea, locality, postalCode, country, nil];

                           [self setPlaceMark:result];

                       }else{

                           [self alert:@"" withDetails:@"No maching location"];
                           return;
                       }

                   }];

    //return currentAddress;
}

-(void)setPlaceMark:(NSArray *)placeDetail
{

    NSArray  *addressKey = [NSArray arrayWithObjects:@"street",@"subArea", @"adminArea", @"county", @"postCode", @"country", nil];

    myPlace = [NSArray arrayWithArray:placeDetail];

    if (myPlace.count == 0) {

        return;
    }
    if (myPlace.count>0) {
        //remove default setting
        [currentAddress removeAllObjects];

        for (int i=0; i<6; i++) {

            @try {
                [currentAddress setObject:[myPlace objectAtIndex:i] forKey:[addressKey objectAtIndex:i]];
            }
            @catch (NSException *exception) {
                NSLog(@"%@",exception);
            }
            @finally {

            }

        }

    }

}

-(NSDictionary *)getAddressDict
{
    return currentAddress;
}

-(NSDictionary *)setDefaultAddress
{

    NSMutableDictionary *defaultAdress = [[NSMutableDictionary alloc] init];

    NSArray  *addressKey = [NSArray arrayWithObjects:@"street",@"subArea", @"adminArea", @"county", @"postCode", @"country", nil];

    NSArray *addressValue = [NSArray arrayWithObjects:@"unknow",@"unknow", @"unknow", @"unknow", @"unknow", @"unknow", nil];

    for (int i=0; i<6; i++) {

        [defaultAdress setObject:[addressValue objectAtIndex:i] forKey:[addressKey objectAtIndex:i]];
    }

    return defaultAdress;

}

- (void)alert:(NSString*)title withDetails:(NSString*)details {

    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title
                                                    message:details
                                                   delegate:nil
                                          cancelButtonTitle:@"Ok"
                                          otherButtonTitles:nil];
    [alert show];
}

@end


text:
module IdentityCache
  module Cached
    module Reference
      class Association < Cached::Association # :nodoc:
        def embedded_by_reference?
          true
        end

        def embedded_recursively?
          false
        end
      end
    end
  end
end


text:
namespace gameplay
{

void luaRegister_TileSet();

}

#endif


text:
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# 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.

from clr import AddReference
AddReference("System")
AddReference("QuantConnect.Algorithm")
AddReference("QuantConnect.Algorithm.Framework")
AddReference("QuantConnect.Common")

from System import *
from QuantConnect import *
from QuantConnect.Orders import *
from QuantConnect.Algorithm import *
from QuantConnect.Algorithm.Framework import *
from QuantConnect.Algorithm.Framework.Alphas import *
from QuantConnect.Algorithm.Framework.Execution import *
from QuantConnect.Algorithm.Framework.Portfolio import *
from QuantConnect.Algorithm.Framework.Selection import *
from Risk.CompositeRiskManagementModel import CompositeRiskManagementModel
from Risk.MaximumDrawdownPercentPortfolio import MaximumDrawdownPercentPortfolio
from datetime import timedelta
import numpy as np

class MaximumPortfolioDrawdownFrameworkAlgorithm(QCAlgorithm):
    '''Show example of how to use the MaximumDrawdownPercentPortfolio Risk Management Model'''

    def Initialize(self):

        # Set requested data resolution
        self.UniverseSettings.Resolution = Resolution.Minute

        self.SetStartDate(2013,10,7)   #Set Start Date
        self.SetEndDate(2013,10,11)    #Set End Date
        self.SetCash(100000)           #Set Strategy Cash

        # set algorithm framework models
        self.SetUniverseSelection(ManualUniverseSelectionModel([ Symbol.Create("SPY", SecurityType.Equity, Market.USA) ]))
        self.SetAlpha(ConstantAlphaModel(InsightType.Price, InsightDirection.Up, timedelta(minutes = 20), 0.025, None))
        self.SetPortfolioConstruction(EqualWeightingPortfolioConstructionModel())
        self.SetExecution(ImmediateExecutionModel())

        # define risk management model as a composite of several risk management models
        self.SetRiskManagement(CompositeRiskManagementModel(
            MaximumDrawdownPercentPortfolio(0.01),         # Avoid loss of initial capital
            MaximumDrawdownPercentPortfolio(0.015, True)   # Avoid profit losses
            ))


text:
NS_ASSUME_NONNULL_BEGIN

@interface DWBalanceDisplayOptionsStub : NSObject <DWBalanceDisplayOptionsProtocol>

@end

NS_ASSUME_NONNULL_END


text:
The LOOM.NET project aims to investigate and promote the usage of AOP in the context of the Microsoft .NET framework.

The concept of aspect-oriented programming (AOP) offers an interesting alternative for the specification of non-functional component properties (such as fault-tolerance properties or timing behaviour), as well as other crosscutting concerns. These are implemented as so-called aspects and at some point "weaved" to the other functional parts of the software.

The LOOM.NET approach is an approach that offers both: a static and a dynamic aspect weaver. The project was started in 2001 with the advent of Microsoft.Net and subsequently we released the first available aspect weaver for .NET. Like no other AOP-frameworks LOOM.NET significantly influences the Microsoft.NET AOP community.

## How it works
Realized as a class library, LOOM.NET allows the language-independend definition of aspect code in the form of standard .NET classes. Both aspect weavers are fully binary compatible. Aspects written for Rapier-LOOM.NET would work with Gripper-LOOM.NET and vice versa.

![](Home_weaving.gif)

An _aspect class_ is a special .NET class with methods constructors and fields as well. At defined _join points_ an aspect class becomes interwoven with a _target class_. Interweaving, strictly speaking, means that an aspect method will be interwoven with a target class method. The aspect method itself contains the aspect code and is defined within the aspect class. It has a special aspect method attribute applied. This aspect method attribute declares a method in the aspect class as an aspect method. Not necessarily every method in an aspect class is an aspect method and has this attribute applied. Methods without this attribute will not be considered for the weaving process.

A target class is a regular .NET class. The one and only restriction is that target class methods (which should become interwoven) either have to be virtual or to be defined via an interface. The weaving process will be initiated during runtime with a factory. Instead of using the new operator one uses the weavers factory method to produce interwoven objects.

## Papers
Wolfgang Schult
Architektur Komponentenbasierter Systeme mit LOOM - Aspekte, Muster, Werkzeuge
PhD Thesis, Cuvillier, 2009.
[https://www.amazon.de/ARCHITEKTUR-KOMPONENTEN-BASIERTER-SYSTEME-WERKZEUGE/dp/3869550317/ref=sr_1_25?s=books&ie=UTF8&qid=1319717920&sr=1-25](https://www.amazon.de/ARCHITEKTUR-KOMPONENTEN-BASIERTER-SYSTEME-WERKZEUGE/dp/3869550317/ref=sr_1_25?s=books&ie=UTF8&qid=1319717920&sr=1-25)

Andreas Rasche and Wolfgang Schult
Dynamic Updates of Graphical Components in the .NET Framework
In Proceedings of Workshop on Selbstorganisierende, Adaptive, Kontextsensitive verteilte Systeme im Rahmen der GI/ITG-Tagung Kommunikation in Verteilten Systemen, Bern / Schweiz, 1. March 2007
[http://www.dcl.hpi.uni-potsdam.de/papers/papers/rasche_updategraphical_saks2007.pdf](http://www.dcl.hpi.uni-potsdam.de/papers/papers/rasche_updategraphical_saks2007.pdf)

Andreas Rasche, Wolfgang Schult, and Andreas Polze
Self-Adaptive Multithreaded Applications - A Case for Dynamic Aspect Weaving
In Proceedings of the 4th Workshop on Adaptive and Reflective Middleware (ARM 2005), Grenoble, France - November 28, 2005
[http://www.dcl.hpi.uni-potsdam.de/papers/papers/rasche_self-adaptive.pdf](http://www.dcl.hpi.uni-potsdam.de/papers/papers/rasche_self-adaptive.pdf)

Wolfgang Schult
Rapier-LOOM.NET — A Dynamic Aspect Weaver for .NET
Microsoft Research AOP Goes .NET Workshop, Redmond, USA, 2005
[http://research.microsoft.com/apps/mobile/showpage.aspx?page=/en-us/events/aop/default.aspx](http://research.microsoft.com/apps/mobile/showpage.aspx?page=/en-us/events/aop/default.aspx)

Kai Köhne, Wolfgang Schult, Andreas Polze
Design by Contract in .NET Using Aspect Oriented Programming, 2005
[http://www.dcl.hpi.uni-potsdam.de/people/schult/Slides/DBC.pdf](http://www.dcl.hpi.uni-potsdam.de/people/schult/Slides/DBC.pdf)

Wolfgang Schult, Andreas Polze
Speed vs. Memory Usage - An Approach to Deal with Contrary Aspects.
The Second AOSD Workshop on Aspects, Components, and Patterns for Infrastructure Software (ACP4IS) at the International Conference on
Aspect-Oriented Software Development, Boston, Massachusetts, March 17 - 21 2003.
[http://www.dcl.hpi.uni-potsdam.de/cms/papers/papers/acp4is_aosd2003.pdf](http://www.dcl.hpi.uni-potsdam.de/cms/papers/papers/acp4is_aosd2003.pdf)

Wolfgang Schult, Andreas Polze
Dynamic Aspect-Weaving with .NET.
Workshop zur Beherrschung nicht-funktionaler Eigenschaften in Betriebssystemen und verteilten Systemen, TU Berlin, Germany, 7-8 November 2002
[http://www.dcl.hpi.uni-potsdam.de/cms/papers/papers/GI2002.ps](http://www.dcl.hpi.uni-potsdam.de/cms/papers/papers/GI2002.ps)

Wolfgang Schult, Andreas Polze
Aspect-Oriented Programming with C# and .NET.
In Proceedings of International Symposium on Object-oriented Real-time distributed Computing (ISORC) 2002, pp. 241-248, Washington D.C., April 2002.
[http://www.dcl.hpi.uni-potsdam.de/cms/papers/papers/isorc2002.pdf](http://www.dcl.hpi.uni-potsdam.de/cms/papers/papers/isorc2002.pdf)


text:
module Main where
 {- an example how to select from a list
   not satisfactory yet:
       - there should be a simpler way to render a simple list
       - i could not convert the model i got back to a list
           from which to get the value

       - the interface offers a great number of functions
           and it is very difficult to find which ones are
           really needed for simple tasks
  -}
import Graphics.UI.Gtk
import Graphics.UI.Gtk.ModelView as Model
main :: IO ()
main = do
   initGUI       -- is start
   window <- windowNew
   list <- listStoreNew ["Vince", "Jhen", "Chris", "Sharon", "Ram"]
   treeview <- Model.treeViewNewWithModel list
   Model.treeViewSetHeadersVisible treeview True
           -- there should be a simpler way to render a list as the following!
   col <- Model.treeViewColumnNew
   Model.treeViewColumnSetTitle col "colTitle"
   renderer <- Model.cellRendererTextNew
   Model.cellLayoutPackStart col renderer False
   Model.cellLayoutSetAttributes col renderer list
           $ \ind -> [Model.cellText := ind]
   Model.treeViewAppendColumn treeview col
   tree <- Model.treeViewGetSelection treeview
   Model.treeSelectionSetMode tree  SelectionSingle
   Model.onSelectionChanged tree (oneSelection list tree)
   set window [ windowDefaultWidth := 100
               , windowDefaultHeight := 200
               , containerChild := treeview
              ]
   onDestroy window mainQuit
   widgetShowAll window
   mainGUI
   return ()
oneSelection :: ListStore String -> Model.TreeSelection ->  IO ()
oneSelection list tree = do
   sel <- Model.treeSelectionGetSelectedRows tree
   let s = head  (head sel)
   v <- Model.listStoreGetValue list s
   putStrLn $ "selected " ++ v


text:
/*                                                                      *\
** Squants                                                              **
**                                                                      **
** Scala Quantities and Units of Measure Library and DSL                **
** (c) 2013-2015, Gary Keorkunian                                       **
**                                                                      **
\*                                                                      */

package squants.radio

import squants._
import squants.space.SquareMeters

/**
 * @author  Hunter Payne
 *
 * @param value Double
 */
final class AreaTime private (val value: Double, val unit: AreaTimeUnit)
    extends Quantity[AreaTime] {

  def dimension = AreaTime

  def /(that: Area): Time =
    Seconds(this.toSquareMeterSeconds / that.toSquareMeters)
  def /(that: Time): Area =
    SquareMeters(this.toSquareMeterSeconds / that.toSeconds)

  def toSquareMeterSeconds = to(SquareMeterSeconds)
  def toSquareCentimeterSeconds = to(SquareCentimeterSeconds)
}

/**
 * Factory singleton for [[squants.radio.AreaTime]] values
 */
object AreaTime extends Dimension[AreaTime] {
  private[radio] def apply[A](n: A, unit: AreaTimeUnit)(
    implicit num: Numeric[A]) =
    new AreaTime(num.toDouble(n), unit)
  def apply(area: Area, time: Time): AreaTime =
    SquareMeterSeconds(area.toSquareMeters * time.toSeconds)
  def apply(value: Any) = parse(value)
  def name = "AreaTime"
  def primaryUnit = SquareMeterSeconds
  def siUnit = SquareMeterSeconds
  def units = Set(SquareMeterSeconds, SquareCentimeterSeconds)
}

trait AreaTimeUnit extends UnitOfMeasure[AreaTime] {
  def apply[A](n: A)(implicit num: Numeric[A]) = AreaTime(n, this)
}

object SquareMeterSeconds extends AreaTimeUnit with PrimaryUnit with SiUnit {
  val symbol = "m²‧s"
}

object SquareCentimeterSeconds extends AreaTimeUnit with UnitConverter {
  val symbol = "cm²‧s"
  val conversionFactor = 0.0001
}

object AreaTimeConversions {
  lazy val squareMeterSeconds = SquareMeterSeconds(1)
  lazy val squareCentimeterSeconds = SquareCentimeterSeconds(1)

  implicit class AreaTimeConversions[A](n: A)(implicit num: Numeric[A]) {
    def squareMeterSeconds = SquareMeterSeconds(n)
    def squareCentimeterSeconds = SquareCentimeterSeconds(n)
  }

  implicit object AreaTimeNumeric extends AbstractQuantityNumeric[AreaTime](AreaTime.primaryUnit)
}


text:
package de.decoit.simu.cbor.ifmap.response.model;

import co.nstant.in.cbor.CborBuilder;
import co.nstant.in.cbor.CborEncoder;
import co.nstant.in.cbor.builder.ArrayBuilder;
import de.decoit.simu.cbor.ifmap.AbstractTestBase;
import de.decoit.simu.cbor.ifmap.util.IfMapNamespaces;
import de.decoit.simu.cbor.xml.dictionary.DictionaryProvider;
import de.decoit.simu.cbor.xml.dictionary.DictionarySimpleElement;
import java.io.ByteArrayOutputStream;
import java.util.Arrays;
import javax.xml.bind.DatatypeConverter;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author Thomas Rix (rix@decoit.de)
 */
@Slf4j
public class CBORPublishReceivedTest extends AbstractTestBase {
	@Test
	public void testConstructor() {
		CBORPublishReceived instance = new CBORPublishReceived();

		assertEquals("publishReceived", instance.getElementName());
	}

	@Test
	public void testCborSerialize() throws Exception {
		DictionarySimpleElement parentElementEntry = DictionaryProvider.getInstance().findElementByPath("<" + IfMapNamespaces.IFMAP + ">response");

		CBORPublishReceived instance = new CBORPublishReceived();

		CborBuilder cb = new CborBuilder();
		ArrayBuilder ab = cb.addArray();

		instance.cborSerialize(ab, parentElementEntry);

		ab.end();

		ByteArrayOutputStream bos = new ByteArrayOutputStream();
		CborEncoder ce = new CborEncoder(bos);
		ce.encode(cb.build());

		log.info("CBOR serialize:");
		log.info(DatatypeConverter.printHexBinary(bos.toByteArray()));

		byte[] expResult = DatatypeConverter.parseHexBinary("84F6048080");

		assertTrue("Byte array mismatch", Arrays.equals(expResult, bos.toByteArray()));
	}
}


text:
import * as R_complement from '../ramda/dist/src/complement';

declare const string: string;
declare const string_string_to_boolean: (a: string, b: string) => boolean;

// @dts-jest:pass
R_complement(string_string_to_boolean);
// @dts-jest:pass
R_complement(string_string_to_boolean)(string, string);


text:
package io.grpc.netty;

import static com.google.common.base.Charsets.UTF_8;
import static io.netty.handler.codec.http2.Http2CodecUtil.DEFAULT_WINDOW_SIZE;
import static org.junit.Assert.assertEquals;
import static org.mockito.AdditionalAnswers.delegatesTo;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyLong;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import com.google.errorprone.annotations.CanIgnoreReturnValue;
import io.grpc.InternalChannelz.TransportStats;
import io.grpc.internal.FakeClock;
import io.grpc.internal.MessageFramer;
import io.grpc.internal.StatsTraceContext;
import io.grpc.internal.TransportTracer;
import io.grpc.internal.WritableBuffer;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import io.netty.buffer.ByteBufUtil;
import io.netty.buffer.CompositeByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.buffer.UnpooledByteBufAllocator;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPromise;
import io.netty.channel.EventLoop;
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.handler.codec.http2.DefaultHttp2FrameReader;
import io.netty.handler.codec.http2.DefaultHttp2FrameWriter;
import io.netty.handler.codec.http2.Http2CodecUtil;
import io.netty.handler.codec.http2.Http2Connection;
import io.netty.handler.codec.http2.Http2ConnectionHandler;
import io.netty.handler.codec.http2.Http2Exception;
import io.netty.handler.codec.http2.Http2FrameReader;
import io.netty.handler.codec.http2.Http2FrameWriter;
import io.netty.handler.codec.http2.Http2Headers;
import io.netty.handler.codec.http2.Http2HeadersDecoder;
import io.netty.handler.codec.http2.Http2LocalFlowController;
import io.netty.handler.codec.http2.Http2Settings;
import io.netty.handler.codec.http2.Http2Stream;
import io.netty.util.concurrent.DefaultPromise;
import io.netty.util.concurrent.Promise;
import io.netty.util.concurrent.ScheduledFuture;
import java.io.ByteArrayInputStream;
import java.util.concurrent.Delayed;
import java.util.concurrent.TimeUnit;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.mockito.ArgumentCaptor;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.mockito.verification.VerificationMode;

/**
 * Base class for Netty handler unit tests.
 */
@RunWith(JUnit4.class)
public abstract class NettyHandlerTestBase<T extends Http2ConnectionHandler> {

  private ByteBuf content;

  private EmbeddedChannel channel;

  private ChannelHandlerContext ctx;

  private Http2FrameWriter frameWriter;

  private Http2FrameReader frameReader;

  private T handler;

  private WriteQueue writeQueue;

  /**
   * Does additional setup jobs. Call it manually when necessary.
   */
  protected void manualSetUp() throws Exception {}

  protected final TransportTracer transportTracer = new TransportTracer();
  protected int flowControlWindow = DEFAULT_WINDOW_SIZE;

  private final FakeClock fakeClock = new FakeClock();

  FakeClock fakeClock() {
    return fakeClock;
  }

  /**
   * Must be called by subclasses to initialize the handler and channel.
   */
  protected final void initChannel(Http2HeadersDecoder headersDecoder) throws Exception {
    content = Unpooled.copiedBuffer("hello world", UTF_8);
    frameWriter = mock(Http2FrameWriter.class, delegatesTo(new DefaultHttp2FrameWriter()));
    frameReader = new DefaultHttp2FrameReader(headersDecoder);

    channel = new FakeClockSupportedChanel();
    handler = newHandler();
    channel.pipeline().addLast(handler);
    ctx = channel.pipeline().context(handler);

    writeQueue = initWriteQueue();
  }

  private final class FakeClockSupportedChanel extends EmbeddedChannel {
    EventLoop eventLoop;

    FakeClockSupportedChanel(ChannelHandler... handlers) {
      super(handlers);
    }

    @Override
    public EventLoop eventLoop() {
      if (eventLoop == null) {
        createEventLoop();
      }
      return eventLoop;
    }

    void createEventLoop() {
      EventLoop realEventLoop = super.eventLoop();
      if (realEventLoop == null) {
        return;
      }
      eventLoop = mock(EventLoop.class, delegatesTo(realEventLoop));
      doAnswer(
          new Answer<ScheduledFuture<Void>>() {
            @Override
            public ScheduledFuture<Void> answer(InvocationOnMock invocation) throws Throwable {
              Runnable command = (Runnable) invocation.getArguments()[0];
              Long delay = (Long) invocation.getArguments()[1];
              TimeUnit timeUnit = (TimeUnit) invocation.getArguments()[2];
              return new FakeClockScheduledNettyFuture(eventLoop, command, delay, timeUnit);
            }
          }).when(eventLoop).schedule(any(Runnable.class), anyLong(), any(TimeUnit.class));
    }
  }

  private final class FakeClockScheduledNettyFuture extends DefaultPromise<Void>
      implements ScheduledFuture<Void> {
    final java.util.concurrent.ScheduledFuture<?> future;

    FakeClockScheduledNettyFuture(
        EventLoop eventLoop, final Runnable command, long delay, TimeUnit timeUnit) {
      super(eventLoop);
      Runnable wrap = new Runnable() {
        @Override
        public void run() {
          try {
            command.run();
          } catch (Throwable t) {
            setFailure(t);
            return;
          }
          if (!isDone()) {
            Promise<Void> unused = setSuccess(null);
          }
          // else: The command itself, such as a shutdown task, might have cancelled all the
          // scheduled tasks already.
        }
      };
      future = fakeClock.getScheduledExecutorService().schedule(wrap, delay, timeUnit);
    }

    @Override
    public boolean cancel(boolean mayInterruptIfRunning) {
      if (future.cancel(mayInterruptIfRunning)) {
        return super.cancel(mayInterruptIfRunning);
      }
      return false;
    }

    @Override
    public long getDelay(TimeUnit unit) {
      return Math.max(future.getDelay(unit), 1L); // never return zero or negative delay.
    }

    @Override
    public int compareTo(Delayed o) {
      return future.compareTo(o);
    }
  }

  protected final T handler() {
    return handler;
  }

  protected final EmbeddedChannel channel() {
    return channel;
  }

  protected final ChannelHandlerContext ctx() {
    return ctx;
  }

  protected final Http2FrameWriter frameWriter() {
    return frameWriter;
  }

  protected final Http2FrameReader frameReader() {
    return frameReader;
  }

  protected final ByteBuf content() {
    return content;
  }

  protected final byte[] contentAsArray() {
    return ByteBufUtil.getBytes(content());
  }

  protected final Http2FrameWriter verifyWrite() {
    return verify(frameWriter);
  }

  protected final Http2FrameWriter verifyWrite(VerificationMode verificationMode) {
    return verify(frameWriter, verificationMode);
  }

  protected final void channelRead(Object obj) throws Exception {
    channel.writeInbound(obj);
  }

  protected ByteBuf grpcDataFrame(int streamId, boolean endStream, byte[] content) {
    final ByteBuf compressionFrame = Unpooled.buffer(content.length);
    MessageFramer framer = new MessageFramer(
        new MessageFramer.Sink() {
          @Override
          public void deliverFrame(
              WritableBuffer frame, boolean endOfStream, boolean flush, int numMessages) {
            if (frame != null) {
              ByteBuf bytebuf = ((NettyWritableBuffer) frame).bytebuf();
              compressionFrame.writeBytes(bytebuf);
            }
          }
        },
        new NettyWritableBufferAllocator(ByteBufAllocator.DEFAULT),
        StatsTraceContext.NOOP);
    framer.writePayload(new ByteArrayInputStream(content));
    framer.flush();
    ChannelHandlerContext ctx = newMockContext();
    new DefaultHttp2FrameWriter().writeData(ctx, streamId, compressionFrame, 0, endStream,
        newPromise());
    return captureWrite(ctx);
  }

  protected final ByteBuf dataFrame(int streamId, boolean endStream, ByteBuf content) {
    // Need to retain the content since the frameWriter releases it.
    content.retain();

    ChannelHandlerContext ctx = newMockContext();
    new DefaultHttp2FrameWriter().writeData(ctx, streamId, content, 0, endStream, newPromise());
    return captureWrite(ctx);
  }

  protected final ByteBuf pingFrame(boolean ack, long payload) {
    ChannelHandlerContext ctx = newMockContext();
    new DefaultHttp2FrameWriter().writePing(ctx, ack, payload, newPromise());
    return captureWrite(ctx);
  }

  protected final ByteBuf headersFrame(int streamId, Http2Headers headers) {
    ChannelHandlerContext ctx = newMockContext();
    new DefaultHttp2FrameWriter().writeHeaders(ctx, streamId, headers, 0, false, newPromise());
    return captureWrite(ctx);
  }

  protected final ByteBuf goAwayFrame(int lastStreamId) {
    return goAwayFrame(lastStreamId, 0, Unpooled.EMPTY_BUFFER);
  }

  protected final ByteBuf goAwayFrame(int lastStreamId, int errorCode, ByteBuf data) {
    ChannelHandlerContext ctx = newMockContext();
    new DefaultHttp2FrameWriter().writeGoAway(ctx, lastStreamId, errorCode, data, newPromise());
    return captureWrite(ctx);
  }

  protected final ByteBuf rstStreamFrame(int streamId, int errorCode) {
    ChannelHandlerContext ctx = newMockContext();
    new DefaultHttp2FrameWriter().writeRstStream(ctx, streamId, errorCode, newPromise());
    return captureWrite(ctx);
  }

  protected final ByteBuf serializeSettings(Http2Settings settings) {
    ChannelHandlerContext ctx = newMockContext();
    new DefaultHttp2FrameWriter().writeSettings(ctx, settings, newPromise());
    return captureWrite(ctx);
  }

  protected final ByteBuf windowUpdate(int streamId, int delta) {
    ChannelHandlerContext ctx = newMockContext();
    new DefaultHttp2FrameWriter().writeWindowUpdate(ctx, 0, delta, newPromise());
    return captureWrite(ctx);
  }

  protected final ChannelPromise newPromise() {
    return channel.newPromise();
  }

  protected final Http2Connection connection() {
    return handler().connection();
  }

  @CanIgnoreReturnValue
  protected final ChannelFuture enqueue(WriteQueue.QueuedCommand command) {
    ChannelFuture future = writeQueue.enqueue(command, true);
    channel.runPendingTasks();
    return future;
  }

  protected final ChannelHandlerContext newMockContext() {
    ChannelHandlerContext ctx = mock(ChannelHandlerContext.class);
    when(ctx.alloc()).thenReturn(UnpooledByteBufAllocator.DEFAULT);
    EventLoop eventLoop = mock(EventLoop.class);
    when(ctx.executor()).thenReturn(eventLoop);
    when(ctx.channel()).thenReturn(channel);
    return ctx;
  }

  protected final ByteBuf captureWrite(ChannelHandlerContext ctx) {
    ArgumentCaptor<ByteBuf> captor = ArgumentCaptor.forClass(ByteBuf.class);
    verify(ctx, atLeastOnce()).write(captor.capture(), any(ChannelPromise.class));
    CompositeByteBuf composite = Unpooled.compositeBuffer();
    for (ByteBuf buf : captor.getAllValues()) {
      composite.addComponent(buf);
      composite.writerIndex(composite.writerIndex() + buf.readableBytes());
    }
    return composite;
  }

  protected abstract T newHandler() throws Http2Exception;

  protected abstract WriteQueue initWriteQueue();

  protected abstract void makeStream() throws Exception;

  @Test
  public void dataPingSentOnHeaderRecieved() throws Exception {
    manualSetUp();
    makeStream();
    AbstractNettyHandler handler = (AbstractNettyHandler) handler();
    handler.setAutoTuneFlowControl(true);

    channelRead(dataFrame(3, false, content()));

    assertEquals(1, handler.flowControlPing().getPingCount());
  }

  @Test
  public void dataPingAckIsRecognized() throws Exception {
    manualSetUp();
    makeStream();
    AbstractNettyHandler handler = (AbstractNettyHandler) handler();
    handler.setAutoTuneFlowControl(true);

    channelRead(dataFrame(3, false, content()));
    long pingData = handler.flowControlPing().payload();
    channelRead(pingFrame(true, pingData));

    assertEquals(1, handler.flowControlPing().getPingCount());
    assertEquals(1, handler.flowControlPing().getPingReturn());
  }

  @Test
  public void dataSizeSincePingAccumulates() throws Exception {
    manualSetUp();
    makeStream();
    AbstractNettyHandler handler = (AbstractNettyHandler) handler();
    handler.setAutoTuneFlowControl(true);
    long frameData = 123456;
    ByteBuf buff = ctx().alloc().buffer(16);
    buff.writeLong(frameData);
    int length = buff.readableBytes();

    channelRead(dataFrame(3, false, buff.copy()));
    channelRead(dataFrame(3, false, buff.copy()));
    channelRead(dataFrame(3, false, buff.copy()));

    assertEquals(length * 3, handler.flowControlPing().getDataSincePing());
  }

  @Test
  public void windowUpdateMatchesTarget() throws Exception {
    manualSetUp();
    Http2Stream connectionStream = connection().connectionStream();
    Http2LocalFlowController localFlowController = connection().local().flowController();
    makeStream();
    AbstractNettyHandler handler = (AbstractNettyHandler) handler();
    handler.setAutoTuneFlowControl(true);

    ByteBuf data = ctx().alloc().buffer(1024);
    while (data.isWritable()) {
      data.writeLong(1111);
    }
    int length = data.readableBytes();
    ByteBuf frame = dataFrame(3, false, data.copy());
    channelRead(frame);
    int accumulator = length;
    // 40 is arbitrary, any number large enough to trigger a window update would work
    for (int i = 0; i < 40; i++) {
      channelRead(dataFrame(3, false, data.copy()));
      accumulator += length;
    }
    long pingData = handler.flowControlPing().payload();
    channelRead(pingFrame(true, pingData));

    assertEquals(accumulator, handler.flowControlPing().getDataSincePing());
    assertEquals(2 * accumulator, localFlowController.initialWindowSize(connectionStream));
  }

  @Test
  public void windowShouldNotExceedMaxWindowSize() throws Exception {
    manualSetUp();
    makeStream();
    AbstractNettyHandler handler = (AbstractNettyHandler) handler();
    handler.setAutoTuneFlowControl(true);
    Http2Stream connectionStream = connection().connectionStream();
    Http2LocalFlowController localFlowController = connection().local().flowController();
    int maxWindow = handler.flowControlPing().maxWindow();

    handler.flowControlPing().setDataSizeSincePing(maxWindow);
    long payload = handler.flowControlPing().payload();
    channelRead(pingFrame(true, payload));

    assertEquals(maxWindow, localFlowController.initialWindowSize(connectionStream));
  }

  @Test
  public void transportTracer_windowSizeDefault() throws Exception {
    manualSetUp();
    TransportStats transportStats = transportTracer.getStats();
    assertEquals(Http2CodecUtil.DEFAULT_WINDOW_SIZE, transportStats.remoteFlowControlWindow);
    assertEquals(flowControlWindow, transportStats.localFlowControlWindow);
  }

  @Test
  public void transportTracer_windowSize() throws Exception {
    flowControlWindow = 1024 * 1024;
    manualSetUp();
    TransportStats transportStats = transportTracer.getStats();
    assertEquals(Http2CodecUtil.DEFAULT_WINDOW_SIZE, transportStats.remoteFlowControlWindow);
    assertEquals(flowControlWindow, transportStats.localFlowControlWindow);
  }

  @Test
  public void transportTracer_windowUpdate_remote() throws Exception {
    manualSetUp();
    TransportStats before = transportTracer.getStats();
    assertEquals(Http2CodecUtil.DEFAULT_WINDOW_SIZE, before.remoteFlowControlWindow);
    assertEquals(Http2CodecUtil.DEFAULT_WINDOW_SIZE, before.localFlowControlWindow);

    ByteBuf serializedSettings = windowUpdate(0, 1000);
    channelRead(serializedSettings);
    TransportStats after = transportTracer.getStats();
    assertEquals(Http2CodecUtil.DEFAULT_WINDOW_SIZE + 1000,
        after.remoteFlowControlWindow);
    assertEquals(flowControlWindow, after.localFlowControlWindow);
  }

  @Test
  public void transportTracer_windowUpdate_local() throws Exception {
    manualSetUp();
    TransportStats before = transportTracer.getStats();
    assertEquals(Http2CodecUtil.DEFAULT_WINDOW_SIZE, before.remoteFlowControlWindow);
    assertEquals(flowControlWindow, before.localFlowControlWindow);

    // If the window size is below a certain threshold, netty will wait to apply the update.
    // Use a large increment to be sure that it exceeds the threshold.
    connection().local().flowController().incrementWindowSize(
        connection().connectionStream(), 8 * Http2CodecUtil.DEFAULT_WINDOW_SIZE);

    TransportStats after = transportTracer.getStats();
    assertEquals(Http2CodecUtil.DEFAULT_WINDOW_SIZE, after.remoteFlowControlWindow);
    assertEquals(flowControlWindow + 8 * Http2CodecUtil.DEFAULT_WINDOW_SIZE,
        connection().local().flowController().windowSize(connection().connectionStream()));
  }
}


text:
<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Martin
 * Date: 14-02-04
 * Time: 17:06
 * To change this template use File | Settings | File Templates.
 */

namespace Nucleus\Bundle\CoreBundle\Tests\DependencyInjection;

use Nucleus\Bundle\CoreBundle\EventDispatcher\IEvent;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

class ListenerService
{
    public static $called = false;

    public static $subject;

    public static $eventName;

    public static $param1;

    public static $event;

    public function listen(WebTestCase $test,IEvent $event, $eventName, $param1)
    {
        static::$called = true;
        static::$subject = $test;
        static::$eventName = $eventName;
        static::$event = $event;
        static::$param1 = $param1;
    }
}


text:
echo "Sourcing ./bin/env/testing.sh as environment …"
source ./bin/env/testing.sh
export MONGO_URL="mongodb://localhost:27017/cache"
echo "Running meteor with --settings ../config/testing.json …"
node ./bin/_helpers/cache-build-and-dependencies.js


text:
#ifndef _BOX3_H

#define _BOX3_H

#include "maxheap.h"
#include "point3.h"
#include "matrix3.h"

/*! \sa  Class Point3, Class Matrix3.\n\n
\par Description:
This class represents a 3D box volume described by two 3D corner coordinates.
Box3 provides methods that return individual coordinates of the box, scale and
translate it, retrieve its center, modify its size, expand it to include points
or other boxes, and determine if points are inside the box. All methods are
implemented by the system.
\par Data Members:
Point3 pmin,pmax;\n\n
The corners of the 3D box.  */
class Box3: public MaxHeapOperators {
	public:
		Point3 pmin,pmax;
		/*! \remarks Constructor. The corners of the box are initialized such
		that the box is 'empty'. See IsEmpty(). */
		DllExport Box3();
		/*! \remarks Constructor. The corners of the box are initialized to
		the points passed. pmin=p; pmax = q. */
		Box3(const Point3& p, const Point3& q) { pmin = p; pmax = q;}
		/*! \remarks Initializes this box such that pmin is a very
		large value while pmax is a small value. Thus the box is
		'empty'. See IsEmpty(). */
		DllExport void Init();

		/*! \remarks Modifies this box such that half the side length is
		subtracted from pmin and added to pmax. This creates a
		cube with the specified center p and side length side.
		\par Parameters:
		const Point3\& p\n\n
		Specifies the center point of the cube.\n\n
		float side\n\n
		Specifies the side length. */
		DllExport void MakeCube(const Point3& p, float side);

		// Access
		/*! \remarks Returns the value of corner pmin. */
		Point3 Min() const { return pmin; }
		/*! \remarks Returns the value of corner pmax. */
		Point3 Max() const { return pmax; }
		/*! \remarks Returns the center of this Box3 as a Point3. */
		Point3 Center() const { return(pmin+pmax)/(float)2.0; }
		/*! \remarks Returns the width of the box as a Point3. This is
		pmax-pmin. */
		Point3 Width() const { return(pmax-pmin); }

		/* operator[] returns ith corner point: (i == (0..7) )
			Mapping:
			        X   Y   Z
			[0] : (min,min,min)
			[1] : (max,min,min)
			[2] : (min,max,min)
			[3] : (max,max,min)
			[4] : (min,min,max)
			[5] : (max,min,max)
			[6] : (min,max,max)
			[7] : (max,max,max)
			*/
		/*! \remarks Operator[] returns the 'i-th' corner point:\n\n
		Mapping : X Y Z\n\n
		[0] : (min,min,min)\n\n
		[1] : (max,min,min)\n\n
		[2] : (min,max,min)\n\n
		[3] : (max,max,min)\n\n
		[4] : (min,min,max)\n\n
		[5] : (max,min,max)\n\n
		[6] : (min,max,max)\n\n
		[7] : (max,max,max)
		\par Parameters:
		int i\n\n
		Specifies the corner to retrieve (0 \<= i \<= 7)
		\return  The 'i-th' corner point as a Point3. */
		DllExport Point3 operator[](int i) const;

		// Modifiers
		/*! \remarks Expands this Box3 to include the Point3 p.
		\par Parameters:
		const Point3\& p\n\n
		Specifies the point to expand the box to include. */
		DllExport Box3& operator+=(const Point3& p);	// expand this box to include Point3
		/*! \remarks Expands this Box3 to include the Box3 b.
		\par Parameters:
		const Box3\& b\n\n
		Specifies the Box3 to expand this box to include. */
		DllExport Box3& operator+=(const Box3& b);   // expand this box to include  Box3

		/*! \remarks Scales this box about its center by the specified scale.
		\par Parameters:
		float s\n\n
		Specifies the scale factor for this Box3. */
		DllExport void Scale(float s); // scale box about center
		/*! \remarks Translates this box by the distance specified. The point
		is added to each corner.
		\par Parameters:
		const Point3 \&p\n\n
		Specifies the distance to translate the box. */
		DllExport void Translate(const Point3 &p); // translate box
		/*! \remarks Enlarges this box. A Point3 is created from s as
		Point3(s,s,s) and added to pmax and subtracted from pmin.
		If the box is 'empty', the box is centered at (0,0,0) and then
		enlarged. */
		DllExport void EnlargeBy(float s); // enlarge by this amount on all sides

		// include an array of points, optionally transformed by tm
		DllExport void IncludePoints(Point3 *pts, int numpoints, Matrix3 *tm=NULL);

		// Returns a box that bounds the 8 transformed corners of the input box.
		/*! \remarks Returns a box that bounds the 8 transformed corners of
		the input box.
		\par Parameters:
		const Matrix3\& tm\n\n
		Specifies the matrix to transform the box corners by. */
		DllExport Box3 operator*(const Matrix3& tm) const;

		// Tests
		/*! \remarks Determines if the box is empty. This indicates the box
		has not had specific values set by the developer.
		\return  Nonzero if the box is empty; otherwise 0. */
		DllExport int IsEmpty() const;   // is this box empty?
		/*! \remarks Determines if the specified point p is contained
		in this box.
		\par Parameters:
		const Point3\& p\n\n
		Specifies the point to check.
		\return  Nonzero if the specified point is contained in this box;
		otherwise 0. */
		DllExport int Contains(const Point3& p) const;  // is point in this box?
		/*! \remarks Determines if the specified Box3 is contained totally
		within this box.
		\par Parameters:
		const Box3\& b\n\n
		Specifies the box to check.
		\return  Nonzero if the specified box is entirely contained within this
		box; otherwise 0.
		\par Operators:
		*/
		DllExport int Contains(const Box3& b) const;  // is box b totally in this box?
		DllExport int Intersects(const Box3& b) const;  // does  box b intersect this box at all?

	};

#endif


text:
namespace blink {

WebEncryptedMediaKeyInformation::WebEncryptedMediaKeyInformation()
{
}

WebEncryptedMediaKeyInformation::~WebEncryptedMediaKeyInformation()
{
}

WebData WebEncryptedMediaKeyInformation::id() const
{
    return m_id;
}

void WebEncryptedMediaKeyInformation::setId(const WebData& id)
{
    m_id.assign(id);
}

WebEncryptedMediaKeyInformation::KeyStatus WebEncryptedMediaKeyInformation::status() const
{
    return m_status;
}

void WebEncryptedMediaKeyInformation::setStatus(KeyStatus status)
{
    m_status = status;
}

uint32_t WebEncryptedMediaKeyInformation::systemCode() const
{
    return m_systemCode;
}

void WebEncryptedMediaKeyInformation::setSystemCode(uint32_t systemCode)
{
    m_systemCode = systemCode;
}

} // namespace blink


text:
module.exports = function (grunt) {
  var standaloneFiles = [
    'node_modules/sockjs-client/dist/sockjs.min.js',
    'node_modules/@stomp/stompjs/lib/stomp.min.js',
    'src/ng-stomp.js'
  ]

  grunt.initConfig({
    fileExists: {
      scripts: standaloneFiles
    },
    uglify: {
      main: {
        options: {
          preserveComments: 'some'
        },
        files: {
          'dist/ng-stomp.min.js': ['src/ng-stomp.js'],
          'dist/ng-stomp.standalone.min.js': standaloneFiles
        }
      }
    }
  })

  grunt.loadNpmTasks('grunt-file-exists')
  grunt.loadNpmTasks('grunt-contrib-uglify')
  grunt.registerTask('default', ['fileExists', 'uglify'])
}