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

<title>itso.rad80.bank.impl Class Hierarchy</title>
<meta name="date" content="2015-12-29">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package itso.rad80.bank.impl

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

itso.rad80.bank.impl.ITSOBank (implements itso.rad80.bank.ifc.Bank)

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
package com.aspose.cloud.sdk.tasks.model;

import com.aspose.cloud.sdk.common.BaseResponse;
import com.google.gson.annotations.SerializedName;

/**
 * Created by muhammadsohailismail on 5/18/15.
 */
public class AddCalendarToProjectResponse extends BaseResponse {

    @SerializedName("CalendarItem")
    public CalendarItemModel calendarItem;
    @SerializedName("Message")
    public String message;

}

redpajama_set_name: RedPajamaGithub


text:
namespace FriendsApi.Representations
{
    public static class FriendsLinks
    {
        public const string Friends = "friends";
        public const string Friend = "friends/{slug}";

        public const string Image = "image/{slug}";
    }
}


text:
package org.rest.client.ui.desktop;

import java.util.ArrayList;
import java.util.Iterator;

import org.rest.client.RestClient;
import org.rest.client.ui.MenuItemView;
import org.rest.client.ui.MenuView;
import org.rest.client.ui.html5.HTML5Element;
import org.rest.client.ui.html5.ListItem;
import org.rest.client.ui.html5.ListPanel;

import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.Style.FontStyle;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.MouseOutEvent;
import com.google.gwt.event.dom.client.MouseOutHandler;
import com.google.gwt.event.dom.client.MouseOverEvent;
import com.google.gwt.event.dom.client.MouseOverHandler;
import com.google.gwt.place.shared.Place;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

public class MenuItemViewImpl extends Composite implements MenuItemView,
		ClickHandler, MouseOutHandler, MouseOverHandler {
	private static RequestViewImplUiBinder uiBinder = GWT
			.create(RequestViewImplUiBinder.class);

	interface RequestViewImplUiBinder extends
			UiBinder<Widget, MenuItemViewImpl> {
	}

	class WidgetStyle {
		final String selected = "selected";
		final String hover = "hover";
	}

	private HTML5Element _element = null;
	private Place place = null;
	private Presenter listener = null;
	private ArrayList<Widget> children = new ArrayList<Widget>();
	private ListPanel childrenPanel;
	private Label emptyLabel = null;

	WidgetStyle style = new WidgetStyle();

	/**
	 * Parent menu
	 */
	private MenuItemView parent;
	/**
	 * Has not null value if this item is in top level of menu
	 */
	private MenuView root;

	@UiField ListItem mainListItem;

	public MenuItemViewImpl() {
		initWidget(uiBinder.createAndBindUi(this));
		_element = (HTML5Element) getElement().cast();

		getElement().setAttribute("aria-selected", "false");
		getElement().setAttribute("role", "tab");

		addDomHandler(this, ClickEvent.getType());
		addDomHandler(this, MouseOverEvent.getType());
		addDomHandler(this, MouseOutEvent.getType());
	}

	@Override
	public void addChild(Widget item) {
		if(emptyLabel != null && !item.equals(emptyLabel)){
			emptyLabel.removeFromParent();
			emptyLabel = null;
		}
		maybeRemoveItemFromParent(item);
		add(item);
		children.add(item);
		if(item instanceof MenuItemView){
			((MenuItemView)item).setParentItem(this);
		}
	}

	@Override
	public void setPlace(Place place) {
		this.place = place;
	}

	@Override
	public void setText(String text) {
		_element.setInnerText(text);
	}

	@Override
	public String getText() {
		return _element.getInnerText();
	}

	@Override
	public void add(Widget w) {
		if(childrenPanel == null){
			childrenPanel = new ListPanel();
			mainListItem.add(childrenPanel);
		}
		childrenPanel.add(w);
	}

	@Override
	public void clear() {
		mainListItem.clear();
	}

	@Override
	public Iterator<Widget> iterator() {
		return mainListItem.iterator();
	}

	@Override
	public boolean remove(Widget w) {
		return mainListItem.remove(w);
	}

	@Override
	public String getHTML() {
		return _element.getInnerHTML();
	}

	@Override
	public void setHTML(String html) {
		_element.setInnerHTML(html);
	}

	@Override
	public void setSelected(boolean isSelected) {
		if(isSelected && root != null){
			root.deselectCurrent();
		}
		getElement().setAttribute("aria-selected", String.valueOf(isSelected));
		if(isSelected)
			addStyleName(style.selected);
		else
			removeStyleName(style.selected);
	}

	@Override
	public void setOpened(boolean isOpened) {
		if(children.size() == 0) return;
		if(isOpened){
			childrenPanel.removeStyleName("hidden");
		} else {
			childrenPanel.addStyleName("hidden");
		}
	}

	public boolean isOpened(){
		if(children.size() == 0) return false;
		return !childrenPanel.getStyleName().contains("hidden");
	}

	@Override
	public void onClick(ClickEvent event) {
		event.stopPropagation();
		event.preventDefault();

		Element e = event.getNativeEvent().getCurrentEventTarget().cast();
		if(!(e != null && e.equals(getElement()))) return;

		if (children.size() > 0) {
			setOpened(!isOpened());
		} else {
			if (place != null && listener != null) {
				listener.goTo(place);
			} else {
				//open and show "empty" info
				if(emptyLabel == null){
					emptyLabel = new Label("empty");
					Style labelStyle = emptyLabel.getElement().getStyle();
					labelStyle.setColor("#7C7C7C");
					labelStyle.setMarginLeft(14, Unit.PX);
					labelStyle.setMarginTop(14, Unit.PX);
					labelStyle.setFontStyle(FontStyle.ITALIC);
					addChild(emptyLabel);
				}
				setOpened(true);
			}
		}
	}

	@Override
	public void setPresenter(Presenter listener) {
		this.listener = listener;
	}

	@Override
	public void remove() {
		if (parent != null) {
			// If this item has a parent, remove self from it.
			parent.removeChild(this);
		} else {
			if(RestClient.isDebug()){
				Log.debug("This menu item has no parent set. Can't remove it.");
			}
		}
	}

	private void maybeRemoveItemFromParent(Widget item) {
		if(item instanceof MenuItemView){
			MenuItemView _item = (MenuItemView)item;
			if (_item.getParentItem() != null) {
				_item.remove();
			}
		} else {
			if(item.getParent()!=null){
				item.removeFromParent();
			}
		}
	}

	@Override
	public MenuItemView getParentItem() {
		return parent;
	}
	@Override
	public void setParentItem(MenuItemView parent) {
		this.parent = parent;
	}

	@Override
	public void setRoot(MenuView root) {
		this.root = root;
	}

	@Override
	public void onMouseOver(MouseOverEvent event) {
		if(children.size() > 0) return;
		addStyleName(style.hover);
	}

	@Override
	public void onMouseOut(MouseOutEvent event) {
		removeStyleName(style.hover);
	}

	public void setData(String key, String value){
		getElement().setAttribute("data-"+key, value);
	}

	@Override
	public String getData(String key) {
		return getElement().getAttribute("data-"+key);
	}

	@Override
	public void removeChild(MenuItemView child) {
		if(!children.contains(child)){
			return;
		}
		children.remove(child);
		if(childrenPanel == null) {
			return;
		}
		childrenPanel.remove((Widget)child);
	}

}


text:
<?php

require 'methods'.DIRECTORY_SEPARATOR.'BaseMethod.php';
require 'database'.DIRECTORY_SEPARATOR.'Database.php';

class GetOrdersMethod extends BaseMethod {

    public function execute($params, &$result, &$error) {

        $resultData = NULL;

        try {

            // Create database handler
            $dbh = new Database();

            // Find the user
            $sth = $dbh->prepare('SELECT * FROM users WHERE token = ?');
            $sth->execute(array($params['token']));

            // If not found then return NOT_LOGGED_IN
            // SQLite does not support rowCount: http://stackoverflow.com/questions/12720648/php-sqlite-pdo-check-if-user-is-in-table
            //if ($sth->rowCount() == 0) {
            $userRow = $sth->fetch();

            if (!$userRow) {

                $error['code'] = 'NOT_LOGGED_IN';
                $error['message'] = 'Please login. Bad token.';

                // Otherwise proceed with the login
            } else {

                //Select last update_date
                $sth = $dbh->prepare('SELECT o.id order_id, o.date, oi.id item_id, i.title FROM orders o, order_items oi, items i WHERE o.user_id = ? AND o.id = oi.order_id AND oi.item_id = i.id ORDER BY o.id, oi.id');
                $sth->execute(array($userRow['id']));

                //setup array to hold information
                $orders = NULL;

                //setup holders for the different types so that we can filter out the data
                $orderId = 0;
                $orderItemId = 0;

                //setup to hold our current index
                $orderIndex = -1;
                $orderItemIndex = -1;

                //Go through the rows
                while ($orderItemRow = $sth->fetch()) {

                    if ($orderId != $orderItemRow['order_id']) {
                        $orderIndex++;
                        $orderItemIndex = -1;
                        $orderId = $orderItemRow['order_id'];

                        //add the order
                        $orders[$orderIndex]['order_id'] = intval($orderItemRow['order_id']);
                        $orders[$orderIndex]['date'] = $orderItemRow['date'];

                        //setup the items array
                        $orders[$orderIndex]['items'] = array();
                    }

                    if ($orderItemId != $orderItemRow['item_id']) {
                        $orderItemIndex++;
                        $orderItemId = $orderItemRow['item_id'];

                        //setup the title array
                        $orders[$orderIndex]['items'][$orderItemIndex] = array();
                    }

                    //add the game to the current console and model
                    $orders[$orderIndex]['items'][$orderItemIndex][] = array(
                        'title' => $orderItemRow['title']
                    );
                }

                $resultData['orders'] = $orders;
            }
        } catch (PDOException $e) {

            $error['code'] = 'DATABASE_ERROR';
            $error['message'] = $e->getMessage();
        }

        $result = $resultData;
    }
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.network.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.JsonFlatten;
import com.azure.core.management.Resource;
import com.azure.core.management.SubResource;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.network.models.P2SConnectionConfiguration;
import com.azure.resourcemanager.network.models.ProvisioningState;
import com.azure.resourcemanager.network.models.VpnClientConnectionHealth;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** P2SVpnGateway Resource. */
@JsonFlatten
@Fluent
public class P2SVpnGatewayInner extends Resource {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnGatewayInner.class);

    /*
     * A unique read-only string that changes whenever the resource is updated.
     */
    @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY)
    private String etag;

    /*
     * The VirtualHub to which the gateway belongs.
     */
    @JsonProperty(value = "properties.virtualHub")
    private SubResource virtualHub;

    /*
     * List of all p2s connection configurations of the gateway.
     */
    @JsonProperty(value = "properties.p2SConnectionConfigurations")
    private List<P2SConnectionConfiguration> p2SConnectionConfigurations;

    /*
     * The provisioning state of the P2S VPN gateway resource.
     */
    @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

    /*
     * The scale unit for this p2s vpn gateway.
     */
    @JsonProperty(value = "properties.vpnGatewayScaleUnit")
    private Integer vpnGatewayScaleUnit;

    /*
     * The VpnServerConfiguration to which the p2sVpnGateway is attached to.
     */
    @JsonProperty(value = "properties.vpnServerConfiguration")
    private SubResource vpnServerConfiguration;

    /*
     * All P2S VPN clients' connection health status.
     */
    @JsonProperty(value = "properties.vpnClientConnectionHealth", access = JsonProperty.Access.WRITE_ONLY)
    private VpnClientConnectionHealth vpnClientConnectionHealth;

    /*
     * List of all customer specified DNS servers IP addresses.
     */
    @JsonProperty(value = "properties.customDnsServers")
    private List<String> customDnsServers;

    /*
     * Resource ID.
     */
    @JsonProperty(value = "id")
    private String id;

    /**
     * Get the etag property: A unique read-only string that changes whenever the resource is updated.
     *
     * @return the etag value.
     */
    public String etag() {
        return this.etag;
    }

    /**
     * Get the virtualHub property: The VirtualHub to which the gateway belongs.
     *
     * @return the virtualHub value.
     */
    public SubResource virtualHub() {
        return this.virtualHub;
    }

    /**
     * Set the virtualHub property: The VirtualHub to which the gateway belongs.
     *
     * @param virtualHub the virtualHub value to set.
     * @return the P2SVpnGatewayInner object itself.
     */
    public P2SVpnGatewayInner withVirtualHub(SubResource virtualHub) {
        this.virtualHub = virtualHub;
        return this;
    }

    /**
     * Get the p2SConnectionConfigurations property: List of all p2s connection configurations of the gateway.
     *
     * @return the p2SConnectionConfigurations value.
     */
    public List<P2SConnectionConfiguration> p2SConnectionConfigurations() {
        return this.p2SConnectionConfigurations;
    }

    /**
     * Set the p2SConnectionConfigurations property: List of all p2s connection configurations of the gateway.
     *
     * @param p2SConnectionConfigurations the p2SConnectionConfigurations value to set.
     * @return the P2SVpnGatewayInner object itself.
     */
    public P2SVpnGatewayInner withP2SConnectionConfigurations(
        List<P2SConnectionConfiguration> p2SConnectionConfigurations) {
        this.p2SConnectionConfigurations = p2SConnectionConfigurations;
        return this;
    }

    /**
     * Get the provisioningState property: The provisioning state of the P2S VPN gateway resource.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the vpnGatewayScaleUnit property: The scale unit for this p2s vpn gateway.
     *
     * @return the vpnGatewayScaleUnit value.
     */
    public Integer vpnGatewayScaleUnit() {
        return this.vpnGatewayScaleUnit;
    }

    /**
     * Set the vpnGatewayScaleUnit property: The scale unit for this p2s vpn gateway.
     *
     * @param vpnGatewayScaleUnit the vpnGatewayScaleUnit value to set.
     * @return the P2SVpnGatewayInner object itself.
     */
    public P2SVpnGatewayInner withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit) {
        this.vpnGatewayScaleUnit = vpnGatewayScaleUnit;
        return this;
    }

    /**
     * Get the vpnServerConfiguration property: The VpnServerConfiguration to which the p2sVpnGateway is attached to.
     *
     * @return the vpnServerConfiguration value.
     */
    public SubResource vpnServerConfiguration() {
        return this.vpnServerConfiguration;
    }

    /**
     * Set the vpnServerConfiguration property: The VpnServerConfiguration to which the p2sVpnGateway is attached to.
     *
     * @param vpnServerConfiguration the vpnServerConfiguration value to set.
     * @return the P2SVpnGatewayInner object itself.
     */
    public P2SVpnGatewayInner withVpnServerConfiguration(SubResource vpnServerConfiguration) {
        this.vpnServerConfiguration = vpnServerConfiguration;
        return this;
    }

    /**
     * Get the vpnClientConnectionHealth property: All P2S VPN clients' connection health status.
     *
     * @return the vpnClientConnectionHealth value.
     */
    public VpnClientConnectionHealth vpnClientConnectionHealth() {
        return this.vpnClientConnectionHealth;
    }

    /**
     * Get the customDnsServers property: List of all customer specified DNS servers IP addresses.
     *
     * @return the customDnsServers value.
     */
    public List<String> customDnsServers() {
        return this.customDnsServers;
    }

    /**
     * Set the customDnsServers property: List of all customer specified DNS servers IP addresses.
     *
     * @param customDnsServers the customDnsServers value to set.
     * @return the P2SVpnGatewayInner object itself.
     */
    public P2SVpnGatewayInner withCustomDnsServers(List<String> customDnsServers) {
        this.customDnsServers = customDnsServers;
        return this;
    }

    /**
     * Get the id property: Resource ID.
     *
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

    /**
     * Set the id property: Resource ID.
     *
     * @param id the id value to set.
     * @return the P2SVpnGatewayInner object itself.
     */
    public P2SVpnGatewayInner withId(String id) {
        this.id = id;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (p2SConnectionConfigurations() != null) {
            p2SConnectionConfigurations().forEach(e -> e.validate());
        }
        if (vpnClientConnectionHealth() != null) {
            vpnClientConnectionHealth().validate();
        }
    }
}


text:
<?php

// run this file to test your source install of Balanced

require(__DIR__ . "/httpful/bootstrap.php");
require(__DIR__ . "/restful/bootstrap.php");
require(__DIR__ . "/balanced/bootstrap.php");

echo "[ OK ]\n";
echo "balanced version -- " . \Balanced\Settings::VERSION . " \n";
echo "restful version -- " . \RESTful\Settings::VERSION . " \n";
echo "httpful version -- " . \Httpful\Httpful::VERSION . " \n";


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Hendersonia serbica Bubák & Ranoj.

### Remarks
null


text:
'use strict'

import React from 'react'
import Cell from './cell'

class CellGrid extends React.Component {
  render () {
    let cells = []
    let idx = 0
    let size = this.props.cells.length

    this.props.cells.forEach((row) => {
      row.forEach((cell) => {
        let classes = cell === 1 ? `alive cell-${size}` : `dead cell-${size}`

        cells.push(<Cell key={idx++} classes={classes} />)
      })
    })

    return <section>{cells}</section>
  }
}

CellGrid.propTypes = {cells: React.PropTypes.array.isRequired}

export default CellGrid


text:
package com.perfume.tech.hibernate.dao.impl;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.hibernate.Session;

import com.perfume.tech.hibernate.dao.BaseDaoInterface;
import com.perfume.tech.hibernate.utils.HibernateUtils;

public abstract class AbstractBaseDao<T> implements BaseDaoInterface<T> {

	protected HibernateUtils hibernateUtils;

	public void setHibernateUtils(HibernateUtils hibernateUtils) {
		this.hibernateUtils = hibernateUtils;
	}

	@Override
	public final void save(T t) {
		Session session = hibernateUtils.getSession();
		session.beginTransaction();
		try {
			session.save(t);
			session.getTransaction().commit();
		} catch (Exception e) {
			e.printStackTrace();
			session.getTransaction().rollback();
		} finally {
			hibernateUtils.closeSession();
		}
	}

	@Override
	public final void delete(T t) {
		Session session = hibernateUtils.getSession();
		session.beginTransaction();
		try {
			session.delete(t);
			session.getTransaction().commit();
		} catch (Exception e) {
			e.printStackTrace();
			session.getTransaction().rollback();
		} finally {
			hibernateUtils.closeSession();
		}
	}

	@Override
	public final void update(T t) {
		Session session = hibernateUtils.getSession();
		session.beginTransaction();
		try {
			session.update(t);
			session.getTransaction().commit();
		} catch (Exception e) {
			e.printStackTrace();
			session.getTransaction().rollback();
		} finally {
			hibernateUtils.closeSession();
		}
	}

	@SuppressWarnings("unchecked")
	public Set<T> loadAll(Class<T> c) {
		String hql = "from " + ((Class<?>) c).getSimpleName();
		Session session = hibernateUtils.getSession();
		List<T> list = session.createQuery(hql).list();
		hibernateUtils.closeSession();
		return new HashSet<T>(list);
	}

}


text:
@if (_rythmPlugin.enableCodeMarker){
<link rel="stylesheet" media="screen" href="/public/stylesheets/code-marker@(_rythmPlugin.fontawesome ? "-fontawesome" : "").css">
<script type="text/javascript" src="/public/javascripts/code-marker.js"></script>
}


text:
An acceptance test harness runs on
[circleci.com](https://circleci.com/gh/jumanjihouse/docker-duoauthproxy)
for each pull request.
The easiest way to test is to open a PR, which tests changes on CircleCI.

As an alternative, you can run the acceptance test harness locally to verify operation.
First, create a free personal account at https://signup.duosecurity.com/
and create two integrations.

First integration:

* Integration type: RADIUS
* Integration name: test-radius-allow
* Policy: Allow access (Unenrolled users will pass through without two-factor authentication)
* Username normalization: None

Second integration:

* Integration type: RADIUS
* Integration name: test-radius-deny
* Policy: Deny access (Unenrolled users will be denied access)
* Username normalization: None

:warning: This test harness assumes your Duo account does *not*
have a user named "test".

Create a local file at the root of the repo named `environment`.
The file holds keys for the integrations you created above.

    # environment
    export API_HOST=api-xxxxxxxx.duosecurity.com

    # This integration allows users without 2fa.
    export IKEY_ALLOW=DIxxxxxxxxxxxxxxxxxx
    export SKEY_ALLOW=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    # This integration denies users without 2fa.
    export IKEY_DENY=DIxxxxxxxxxxxxxxxxxx
    export SKEY_DENY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    # Test harness uses a real radius server and client.
    # See https://github.com/jumanjihouse/docker-radius
    # Specify an optimistic or pessimistic tag here.
    export RADIUS_TAG="latest"

Run the test harness on a single image:

    ci/test

The test harness uses [BATS](https://github.com/sstephenson/bats).
Output resembles:

    ok radius auth via duo authproxy is allowed when 2fa succeeds
    ok radius auth via duo authproxy is rejected when 2fa fails
    ok There are no suid files
    ok duo user exists
    ok duo user is denied interactive login
    ok duo is the only user account
    ok duo is the only user account
    ok duo group exists
    ok duo is the only group account
    ok duo is the only group account
    ok bash is available
    ok chown is available
    ok chgrp is available
    ok ln is available
    ok chmod is available
    ok ci-build-url label is present

    16 tests, 0 failures


text:
  <form>

      <input type="text" class="form-control">

            <button class="btn btn-primary" type="submit" title="Digest">Digest</button>

</form>


text:
source "${DOTFILES_ROOT}/script/shared/common.sh"

generate_gitconfig () {
  if ! [ -f git/gitconfig.symlink ]
  then
    info 'setup gitconfig'

    user ' - What is your github author name?'
    read -e git_authorname
    user ' - What is your github author email?'
    read -e git_authoremail

    sed -e "s/AUTHORNAME/$git_authorname/g" -e "s/AUTHOREMAIL/$git_authoremail/g" git/gitconfig.template > git/gitconfig.symlink

    success 'generated gitconfig'
  else
    info 'skipped gitconfig'
    echo ''
  fi
}


text:
//
//  TableViewController.m
//  SampleApp
//
//  Created by Lukas Petr on 12/3/16.
//  Copyright © 2016 Glimsoft. All rights reserved.
//

#import "TableViewController.h"
#import "GSTimeIntervalPicker.h"

@interface TableViewController ()

@end

@implementation TableViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;

    self.tableView.rowHeight = UITableViewAutomaticDimension;
    self.tableView.estimatedRowHeight = 44;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 2;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    if (indexPath.row == 0) {
        return [tableView dequeueReusableCellWithIdentifier:@"LabelCellID" forIndexPath:indexPath];
    }
    else if (indexPath.row == 1) {
        static NSString *pickerCellID = @"PickerCellID";
        UITableViewCell *pickerCell = [tableView dequeueReusableCellWithIdentifier:pickerCellID forIndexPath:indexPath];

        GSTimeIntervalPicker *picker = pickerCell.contentView.subviews.firstObject;
        picker.maxTimeInterval = 3600 * 3;
        picker.minuteInterval = 5;
        picker.timeInterval = 3600 * 1.5;
        picker.onTimeIntervalChanged = ^(NSTimeInterval newTimeInterval) {
            UITableViewCell *labelCell = [tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
            NSInteger hours = (NSInteger)(newTimeInterval / 3600);
            NSInteger minutes = ((NSInteger)newTimeInterval % 3600) / 60;
            labelCell.textLabel.text = [NSString stringWithFormat:@"%ld hours, %ld minutes", (long)hours, (long)minutes];
        };
        return pickerCell;
    }
    return nil;
}

- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section {
    return @"Time interval picker, limiting the input to 3 hours.";
}

/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


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

<title>Overview</title>
<meta name="date" content="2014-08-19">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Packages

Package
Description

ec

ec.breed

ec.coevolve

ec.de

ec.display

ec.display.chart

ec.display.portrayal

ec.es

ec.eval

ec.evolve

ec.exchange

ec.gp

ec.gp.breed

ec.gp.build

ec.gp.ge

ec.gp.koza

ec.gp.push

ec.multiobjective

ec.multiobjective.nsga2

ec.multiobjective.spea2

ec.parsimony

ec.pso

ec.rule

ec.rule.breed

ec.select

ec.simple

ec.spatial

ec.steadystate

ec.util

ec.vector

ec.vector.breed

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
namespace arangodb {
namespace basics {

class LocalTaskQueue;

class LocalTask : public std::enable_shared_from_this<LocalTask> {
 public:
  LocalTask() = delete;
  LocalTask(LocalTask const&) = delete;
  LocalTask& operator=(LocalTask const&) = delete;

  explicit LocalTask(std::shared_ptr<LocalTaskQueue> const& queue);
  virtual ~LocalTask() {}

  virtual void run() = 0;
  void dispatch();

 protected:
  //////////////////////////////////////////////////////////////////////////////
  /// @brief the underlying queue
  //////////////////////////////////////////////////////////////////////////////

  std::shared_ptr<LocalTaskQueue> _queue;
};

class LocalCallbackTask
    : public std::enable_shared_from_this<LocalCallbackTask> {
 public:
  LocalCallbackTask() = delete;
  LocalCallbackTask(LocalCallbackTask const&) = delete;
  LocalCallbackTask& operator=(LocalCallbackTask const&) = delete;

  LocalCallbackTask(std::shared_ptr<LocalTaskQueue> const& queue, std::function<void()> cb);
  virtual ~LocalCallbackTask() {}

  virtual void run();
  void dispatch();

 protected:
  //////////////////////////////////////////////////////////////////////////////
  /// @brief the underlying queue
  //////////////////////////////////////////////////////////////////////////////

  std::shared_ptr<LocalTaskQueue> _queue;

  //////////////////////////////////////////////////////////////////////////////
  /// @brief the callback executed by run() (any exceptions will be caught and
  /// ignored; must not call queue->setStatus() or queue->enqueue())
  //////////////////////////////////////////////////////////////////////////////

  std::function<void()> _cb;
};

class LocalTaskQueue {
 public:
  LocalTaskQueue(LocalTaskQueue const&) = delete;
  LocalTaskQueue& operator=(LocalTaskQueue const&) = delete;

  explicit LocalTaskQueue();

  ~LocalTaskQueue();

  void startTask();
  void stopTask();

  //////////////////////////////////////////////////////////////////////////////
  /// @brief enqueue a task to be run
  //////////////////////////////////////////////////////////////////////////////

  void enqueue(std::shared_ptr<LocalTask>);

  //////////////////////////////////////////////////////////////////////////////
  /// @brief enqueue a callback task to be run after all normal tasks finish;
  /// useful for cleanup tasks
  //////////////////////////////////////////////////////////////////////////////

  void enqueueCallback(std::shared_ptr<LocalCallbackTask>);

  //////////////////////////////////////////////////////////////////////////////
  /// @brief join a single task. reduces the number of waiting tasks and wakes
  /// up the queues's dispatchAndWait() routine
  //////////////////////////////////////////////////////////////////////////////

  void join();

  //////////////////////////////////////////////////////////////////////////////
  /// @brief dispatch all tasks, including those that are queued while running,
  /// and wait for all tasks to join; then dispatch all callback tasks and wait
  /// for them to join
  //////////////////////////////////////////////////////////////////////////////

  void dispatchAndWait();

  //////////////////////////////////////////////////////////////////////////////
  /// @brief set status of queue
  //////////////////////////////////////////////////////////////////////////////

  void setStatus(int);

  //////////////////////////////////////////////////////////////////////////////
  /// @brief return overall status of queue tasks
  //////////////////////////////////////////////////////////////////////////////

  int status();

 private:
  //////////////////////////////////////////////////////////////////////////////
  /// @brief internal task queue
  //////////////////////////////////////////////////////////////////////////////

  std::queue<std::shared_ptr<LocalTask>> _queue;

  //////////////////////////////////////////////////////////////////////////////
  /// @brief internal callback task queue
  //////////////////////////////////////////////////////////////////////////////

  std::queue<std::shared_ptr<LocalCallbackTask>> _callbackQueue;

  //////////////////////////////////////////////////////////////////////////////
  /// @brief condition variable
  //////////////////////////////////////////////////////////////////////////////

  arangodb::basics::ConditionVariable _condition;

  //////////////////////////////////////////////////////////////////////////////
  /// @brief internal mutex
  //////////////////////////////////////////////////////////////////////////////

  Mutex _mutex;

  //////////////////////////////////////////////////////////////////////////////
  /// @brief number of dispatched, non-joined tasks
  //////////////////////////////////////////////////////////////////////////////

  size_t _missing;

  //////////////////////////////////////////////////////////////////////////////
  /// @brief number of dispatched and started tasks
  //////////////////////////////////////////////////////////////////////////////

  size_t _started;

  //////////////////////////////////////////////////////////////////////////////
  /// @brief overall status of queue tasks
  //////////////////////////////////////////////////////////////////////////////

  int _status;
};

}  // namespace arangodb::basics
}  // namespace arangodb

#endif


text:
package com.placemi.commons;

import org.apache.commons.dbcp2.BasicDataSource;
import org.springframework.core.io.ClassPathResource;

import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Properties;

/**
 * @author Created by brendenpalmer on 2016-02-06.
 */
public final class DatabaseHelper {
    private static final BasicDataSource source = new BasicDataSource();
    private static final String resourcePath = "/database.properties";
    private static Properties properties = null;

    static {
        try {
            source.setDriverClassName(getProperties().getProperty("driver"));
            source.setUrl(getProperties().getProperty("url"));
            source.setUsername(getProperties().getProperty("username"));
            source.setPassword(getProperties().getProperty("password"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private DatabaseHelper() {
        // do nothing, private member, no need for external access
    }

    /**
     * Gets the database properties file
     *
     * @return The database properties
     * @throws IOException
     */
    private static synchronized Properties getProperties() throws IOException {
        if (properties != null) {
            return properties;
        } else {
            InputStream inputStream = new ClassPathResource(resourcePath).getInputStream();
            properties = new Properties();
            properties.load(inputStream);
            inputStream.close();
            return properties;
        }
    }

    /**
     * Gets the database connection
     *
     * @return The database connection
     * @throws SQLException
     */
    public static Connection getConnection() throws SQLException {
        return source.getConnection();
    }
}


text:
class CollatableOptionSeeder

  @@default_options = {
    'user.volunteering_history' => [
      ["What habit? (I haven't really volunteered before)", "never"],
      ["I volunteered 3 times or less in the last 12 months", "3-or-less-times"],
      ["I volunteer once a month", "once-per-month"],
      ["I volunteer once a week", "once-per-week"],
      ["I've practically got a degree in volunteering (I volunteer more than twice a week)", "two-plus-per-week"]
    ],
    'user.gender' => [
      ['Male', 'male'],
      ['Female', 'female'],
      ['Transgender', 'transgender'],
      ['Other', 'other']
    ]
  }

  def self.seed(name)
    options = @@default_options[name]
    return if options.blank?
    options.each do |set|
      next if CollatableOption.where(:scope_key => name, :value => set[1]).exists?
      CollatableOption.create! :scope_key => name, :name => set[0], :value => set[1]
    end
  end

  def self.unseed(name)
    options = @@default_options[name]
    return if options.blank?
    CollatableOption.where(:scope_key => name, :value => options.map(&:last)).delete_all
  end

end


text:
package org.springframework.security.config.http;

import java.io.IOException;
import java.security.Principal;
import java.util.List;

import javax.servlet.Filter;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;

import org.apache.http.HttpStatus;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockHttpSession;
import org.springframework.security.config.test.SpringTestContext;
import org.springframework.security.config.test.SpringTestContextExtension;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.session.SessionRegistry;
import org.springframework.security.util.FieldUtils;
import org.springframework.security.web.FilterChainProxy;
import org.springframework.security.web.authentication.RememberMeServices;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.authentication.logout.CompositeLogoutHandler;
import org.springframework.security.web.authentication.logout.LogoutFilter;
import org.springframework.security.web.authentication.logout.LogoutHandler;
import org.springframework.security.web.authentication.logout.LogoutSuccessEventPublishingLogoutHandler;
import org.springframework.security.web.authentication.session.SessionAuthenticationException;
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy;
import org.springframework.security.web.context.HttpSessionSecurityContextRepository;
import org.springframework.security.web.session.ConcurrentSessionFilter;
import org.springframework.security.web.session.SessionManagementFilter;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.test.web.servlet.ResultMatcher;
import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.WebApplicationContext;

import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf;
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.httpBasic;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.cookie;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.redirectedUrl;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

/**
 * Tests session-related functionality for the <http> namespace element and
 * <session-management>
 *
 * @author Luke Taylor
 * @author Rob Winch
 * @author Josh Cummings
 * @author Onur Kagan Ozcan
 * @author Mazen Aissa
 */
@ExtendWith(SpringTestContextExtension.class)
public class SessionManagementConfigTests {

	private static final String CONFIG_LOCATION_PREFIX = "classpath:org/springframework/security/config/http/SessionManagementConfigTests";

	public final SpringTestContext spring = new SpringTestContext(this);

	@Autowired
	MockMvc mvc;

	@Test
	public void requestWhenCreateSessionAlwaysThenAlwaysCreatesSession() throws Exception {
		this.spring.configLocations(xml("CreateSessionAlways")).autowire();
		MockHttpServletRequest request = get("/").buildRequest(this.servletContext());
		MockHttpServletResponse response = request(request, this.spring.getContext());
		assertThat(response.getStatus()).isEqualTo(HttpStatus.SC_OK);
		assertThat(request.getSession(false)).isNotNull();
	}

	@Test
	public void requestWhenCreateSessionIsSetToNeverThenDoesNotCreateSessionOnLoginChallenge() throws Exception {
		this.spring.configLocations(xml("CreateSessionNever")).autowire();
		MockHttpServletRequest request = get("/auth").buildRequest(this.servletContext());
		MockHttpServletResponse response = request(request, this.spring.getContext());
		assertThat(response.getStatus()).isEqualTo(HttpStatus.SC_MOVED_TEMPORARILY);
		assertThat(request.getSession(false)).isNull();
	}

	@Test
	public void requestWhenCreateSessionIsSetToNeverThenDoesNotCreateSessionOnLogin() throws Exception {
		this.spring.configLocations(xml("CreateSessionNever")).autowire();
		// @formatter:off
		MockHttpServletRequest request = post("/login")
				.param("username", "user")
				.param("password", "password")
				.buildRequest(this.servletContext());
		// @formatter:on
		request = csrf().postProcessRequest(request);
		MockHttpServletResponse response = request(request, this.spring.getContext());
		assertThat(response.getStatus()).isEqualTo(HttpStatus.SC_MOVED_TEMPORARILY);
		assertThat(request.getSession(false)).isNull();
	}

	@Test
	public void requestWhenCreateSessionIsSetToNeverThenUsesExistingSession() throws Exception {
		this.spring.configLocations(xml("CreateSessionNever")).autowire();
		// @formatter:off
		MockHttpServletRequest request = post("/login")
				.param("username", "user")
				.param("password", "password")
				.buildRequest(this.servletContext());
		// @formatter:on
		request = csrf().postProcessRequest(request);
		MockHttpSession session = new MockHttpSession();
		request.setSession(session);
		MockHttpServletResponse response = request(request, this.spring.getContext());
		assertThat(response.getStatus()).isEqualTo(HttpStatus.SC_MOVED_TEMPORARILY);
		assertThat(request.getSession(false)).isNotNull();
		assertThat(request.getSession(false)
				.getAttribute(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY)).isNotNull();
	}

	@Test
	public void requestWhenCreateSessionIsSetToStatelessThenDoesNotCreateSessionOnLoginChallenge() throws Exception {
		this.spring.configLocations(xml("CreateSessionStateless")).autowire();
		// @formatter:off
		this.mvc.perform(get("/auth"))
				.andExpect(status().isFound())
				.andExpect(session().exists(false));
		// @formatter:on
	}

	@Test
	public void requestWhenCreateSessionIsSetToStatelessThenDoesNotCreateSessionOnLogin() throws Exception {
		this.spring.configLocations(xml("CreateSessionStateless")).autowire();
		// @formatter:off
		MockHttpServletRequestBuilder loginRequest = post("/login")
				.param("username", "user")
				.param("password", "password")
				.with(csrf());
		this.mvc.perform(loginRequest)
				.andExpect(status().isFound())
				.andExpect(session().exists(false));
		// @formatter:on
	}

	@Test
	public void requestWhenCreateSessionIsSetToStatelessThenIgnoresExistingSession() throws Exception {
		this.spring.configLocations(xml("CreateSessionStateless")).autowire();
		// @formatter:off
		MockHttpServletRequestBuilder loginRequest = post("/login")
				.param("username", "user")
				.param("password", "password")
				.session(new MockHttpSession())
				.with(csrf());
		MvcResult result = this.mvc.perform(loginRequest)
				.andExpect(status().isFound())
				.andExpect(session()).andReturn();
		// @formatter:on
		assertThat(result.getRequest().getSession(false)
				.getAttribute(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY)).isNull();
	}

	@Test
	public void requestWhenCreateSessionIsSetToIfRequiredThenDoesNotCreateSessionOnPublicInvocation() throws Exception {
		this.spring.configLocations(xml("CreateSessionIfRequired")).autowire();
		ServletContext servletContext = this.mvc.getDispatcherServlet().getServletContext();
		MockHttpServletRequest request = get("/").buildRequest(servletContext);
		MockHttpServletResponse response = request(request, this.spring.getContext());
		assertThat(response.getStatus()).isEqualTo(HttpStatus.SC_OK);
		assertThat(request.getSession(false)).isNull();
	}

	@Test
	public void requestWhenCreateSessionIsSetToIfRequiredThenCreatesSessionOnLoginChallenge() throws Exception {
		this.spring.configLocations(xml("CreateSessionIfRequired")).autowire();
		ServletContext servletContext = this.mvc.getDispatcherServlet().getServletContext();
		MockHttpServletRequest request = get("/auth").buildRequest(servletContext);
		MockHttpServletResponse response = request(request, this.spring.getContext());
		assertThat(response.getStatus()).isEqualTo(HttpStatus.SC_MOVED_TEMPORARILY);
		assertThat(request.getSession(false)).isNotNull();
	}

	@Test
	public void requestWhenCreateSessionIsSetToIfRequiredThenCreatesSessionOnLogin() throws Exception {
		this.spring.configLocations(xml("CreateSessionIfRequired")).autowire();
		ServletContext servletContext = this.mvc.getDispatcherServlet().getServletContext();
		// @formatter:off
		MockHttpServletRequest request = post("/login")
				.param("username", "user")
				.param("password", "password")
				.buildRequest(servletContext);
		// @formatter:on
		request = csrf().postProcessRequest(request);
		MockHttpServletResponse response = request(request, this.spring.getContext());
		assertThat(response.getStatus()).isEqualTo(HttpStatus.SC_MOVED_TEMPORARILY);
		assertThat(request.getSession(false)).isNotNull();
	}

	/**
	 * SEC-1208
	 */
	@Test
	public void requestWhenRejectingUserBasedOnMaxSessionsExceededThenDoesNotCreateSession() throws Exception {
		this.spring.configLocations(xml("Sec1208")).autowire();
		// @formatter:off
		this.mvc.perform(get("/auth").with(httpBasic("user", "password")))
				.andExpect(status().isOk())
				.andExpect(session());
		this.mvc.perform(get("/auth").with(httpBasic("user", "password")))
				.andExpect(status().isUnauthorized())
				.andExpect(session().exists(false));
		// @formatter:on
	}

	/**
	 * SEC-2137
	 */
	@Test
	public void requestWhenSessionFixationProtectionDisabledAndConcurrencyControlEnabledThenSessionNotInvalidated()
			throws Exception {
		this.spring.configLocations(xml("Sec2137")).autowire();
		MockHttpSession session = new MockHttpSession();
		// @formatter:off
		this.mvc.perform(get("/auth").session(session).with(httpBasic("user", "password")))
				.andExpect(status().isOk())
				.andExpect(session().id(session.getId()));
		// @formatter:on
	}

	@Test
	public void autowireWhenExportingSessionRegistryBeanThenAvailableForWiring() {
		this.spring.configLocations(xml("ConcurrencyControlSessionRegistryAlias")).autowire();
		this.sessionRegistryIsValid();
	}

	@Test
	public void requestWhenExpiredUrlIsSetThenInvalidatesSessionAndRedirects() throws Exception {
		this.spring.configLocations(xml("ConcurrencyControlExpiredUrl")).autowire();
		// @formatter:off
		MockHttpServletRequestBuilder request = get("/auth")
				.session(expiredSession())
				.with(httpBasic("user", "password"));
		this.mvc.perform(request)
				.andExpect(redirectedUrl("/expired"))
				.andExpect(session().exists(false));
		// @formatter:on
	}

	@Test
	public void requestWhenConcurrencyControlAndCustomLogoutHandlersAreSetThenAllAreInvokedWhenSessionExpires()
			throws Exception {
		this.spring.configLocations(xml("ConcurrencyControlLogoutAndRememberMeHandlers")).autowire();
		// @formatter:off
		MockHttpServletRequestBuilder request = get("/auth")
				.session(expiredSession())
				.with(httpBasic("user", "password"));
		this.mvc.perform(request)
				.andExpect(status().isOk())
				.andExpect(cookie().maxAge("testCookie", 0))
				.andExpect(cookie().exists("rememberMeCookie"))
				.andExpect(session().valid(true));
		// @formatter:on
	}

	@Test
	public void requestWhenConcurrencyControlAndRememberMeAreSetThenInvokedWhenSessionExpires() throws Exception {
		this.spring.configLocations(xml("ConcurrencyControlRememberMeHandler")).autowire();
		// @formatter:off
		MockHttpServletRequestBuilder request = get("/auth")
				.session(expiredSession())
				.with(httpBasic("user", "password"));
		this.mvc.perform(request)
				.andExpect(status().isOk()).andExpect(cookie().exists("rememberMeCookie"))
				.andExpect(session().exists(false));
		// @formatter:on
	}

	/**
	 * SEC-2057
	 */
	@Test
	public void autowireWhenConcurrencyControlIsSetThenLogoutHandlersGetAuthenticationObject() throws Exception {
		this.spring.configLocations(xml("ConcurrencyControlCustomLogoutHandler")).autowire();
		MvcResult result = this.mvc.perform(get("/auth").with(httpBasic("user", "password"))).andExpect(session())
				.andReturn();
		MockHttpSession session = (MockHttpSession) result.getRequest().getSession(false);
		SessionRegistry sessionRegistry = this.spring.getContext().getBean(SessionRegistry.class);
		sessionRegistry.getSessionInformation(session.getId()).expireNow();
		// @formatter:off
		this.mvc.perform(get("/auth").session(session))
				.andExpect(header().string("X-Username", "user"));
		// @formatter:on
	}

	@Test
	public void requestWhenConcurrencyControlIsSetThenDefaultsToResponseBodyExpirationResponse() throws Exception {
		this.spring.configLocations(xml("ConcurrencyControlSessionRegistryAlias")).autowire();
		// @formatter:off
		MockHttpServletRequestBuilder request = get("/auth")
				.session(expiredSession())
				.with(httpBasic("user", "password"));
		this.mvc.perform(request)
				.andExpect(content().string("This session has been expired (possibly due to multiple concurrent "
						+ "logins being attempted as the same user)."));
		// @formatter:on
	}

	@Test
	public void requestWhenCustomSessionAuthenticationStrategyThenInvokesOnAuthentication() throws Exception {
		this.spring.configLocations(xml("SessionAuthenticationStrategyRef")).autowire();
		// @formatter:off
		this.mvc.perform(get("/auth").with(httpBasic("user", "password")))
				.andExpect(status().isIAmATeapot());
		// @formatter:on
	}

	@Test
	public void autowireWhenSessionRegistryRefIsSetThenAvailableForWiring() {
		this.spring.configLocations(xml("ConcurrencyControlSessionRegistryRef")).autowire();
		this.sessionRegistryIsValid();
	}

	@Test
	public void requestWhenMaxSessionsIsSetThenErrorsWhenExceeded() throws Exception {
		this.spring.configLocations(xml("ConcurrencyControlMaxSessions")).autowire();
		// @formatter:off
		this.mvc.perform(get("/auth").with(httpBasic("user", "password")))
				.andExpect(status().isOk());
		this.mvc.perform(get("/auth").with(httpBasic("user", "password")))
				.andExpect(status().isOk());
		this.mvc.perform(get("/auth").with(httpBasic("user", "password")))
				.andExpect(redirectedUrl("/max-exceeded"));
		// @formatter:on
	}

	@Test
	public void requestWhenMaxSessionsIsSetWithPlaceHolderThenErrorsWhenExceeded() throws Exception {
		System.setProperty("sessionManagement.maxSessions", "1");
		this.spring.configLocations(xml("ConcurrencyControlMaxSessionsPlaceHolder")).autowire();
		// @formatter:off
		this.mvc.perform(get("/auth").with(httpBasic("user", "password")))
				.andExpect(status().isOk());
		this.mvc.perform(get("/auth").with(httpBasic("user", "password")))
				.andExpect(redirectedUrl("/max-exceeded"));
		// @formatter:on
	}

	@Test
	public void autowireWhenSessionFixationProtectionIsNoneAndCsrfDisabledThenSessionManagementFilterIsNotWired() {
		this.spring.configLocations(xml("NoSessionManagementFilter")).autowire();
		assertThat(this.getFilter(SessionManagementFilter.class)).isNull();
	}

	@Test
	public void requestWhenSessionFixationProtectionIsNoneThenSessionNotInvalidated() throws Exception {
		this.spring.configLocations(xml("SessionFixationProtectionNone")).autowire();
		MockHttpSession session = new MockHttpSession();
		String sessionId = session.getId();
		// @formatter:off
		this.mvc.perform(get("/auth").session(session).with(httpBasic("user", "password")))
				.andExpect(session().id(sessionId));
		// @formatter:on
	}

	@Test
	public void requestWhenSessionFixationProtectionIsMigrateSessionThenSessionIsReplaced() throws Exception {
		this.spring.configLocations(xml("SessionFixationProtectionMigrateSession")).autowire();
		MockHttpSession session = new MockHttpSession();
		String sessionId = session.getId();
		// @formatter:off
		MvcResult result = this.mvc.perform(get("/auth").session(session).with(httpBasic("user", "password")))
				.andExpect(session())
				.andReturn();
		// @formatter:on
		assertThat(result.getRequest().getSession(false).getId()).isNotEqualTo(sessionId);
	}

	@Test
	public void requestWhenSessionFixationProtectionIsNoneAndInvalidSessionUrlIsSetThenStillRedirectsOnInvalidSession()
			throws Exception {
		this.spring.configLocations(xml("SessionFixationProtectionNoneWithInvalidSessionUrl")).autowire();
		// @formatter:off
		MockHttpServletRequestBuilder authRequest = get("/auth")
				.with((request) -> {
					request.setRequestedSessionId("1");
					request.setRequestedSessionIdValid(false);
					return request;
				});
		this.mvc.perform(authRequest)
				.andExpect(redirectedUrl("/timeoutUrl"));
		// @formatter:on
	}

	private void sessionRegistryIsValid() {
		SessionRegistry sessionRegistry = this.spring.getContext().getBean("sessionRegistry", SessionRegistry.class);
		assertThat(sessionRegistry).isNotNull();
		assertThat(this.getFilter(ConcurrentSessionFilter.class)).returns(sessionRegistry,
				this::extractSessionRegistry);
		assertThat(this.getFilter(UsernamePasswordAuthenticationFilter.class)).returns(sessionRegistry,
				this::extractSessionRegistry);
		// SEC-1143
		assertThat(this.getFilter(SessionManagementFilter.class)).returns(sessionRegistry,
				this::extractSessionRegistry);
	}

	private SessionRegistry extractSessionRegistry(ConcurrentSessionFilter filter) {
		return getFieldValue(filter, "sessionRegistry");
	}

	private SessionRegistry extractSessionRegistry(UsernamePasswordAuthenticationFilter filter) {
		SessionAuthenticationStrategy strategy = getFieldValue(filter, "sessionStrategy");
		List<SessionAuthenticationStrategy> strategies = getFieldValue(strategy, "delegateStrategies");
		return getFieldValue(strategies.get(0), "sessionRegistry");
	}

	private SessionRegistry extractSessionRegistry(SessionManagementFilter filter) {
		SessionAuthenticationStrategy strategy = getFieldValue(filter, "sessionAuthenticationStrategy");
		List<SessionAuthenticationStrategy> strategies = getFieldValue(strategy, "delegateStrategies");
		return getFieldValue(strategies.get(0), "sessionRegistry");
	}

	private <T> T getFieldValue(Object target, String fieldName) {
		try {
			return (T) FieldUtils.getFieldValue(target, fieldName);
		}
		catch (Exception ex) {
			throw new RuntimeException(ex);
		}
	}

	private static SessionResultMatcher session() {
		return new SessionResultMatcher();
	}

	/**
	 * SEC-2680
	 */
	@Test
	public void checkConcurrencyAndLogoutFilterHasSameSizeAndHasLogoutSuccessEventPublishingLogoutHandler() {
		this.spring.configLocations(xml("ConcurrencyControlLogoutAndRememberMeHandlers")).autowire();
		ConcurrentSessionFilter concurrentSessionFilter = getFilter(ConcurrentSessionFilter.class);
		LogoutFilter logoutFilter = getFilter(LogoutFilter.class);
		LogoutHandler csfLogoutHandler = getFieldValue(concurrentSessionFilter, "handlers");
		LogoutHandler lfLogoutHandler = getFieldValue(logoutFilter, "handler");
		assertThat(csfLogoutHandler).isInstanceOf(CompositeLogoutHandler.class);
		assertThat(lfLogoutHandler).isInstanceOf(CompositeLogoutHandler.class);
		List<LogoutHandler> csfLogoutHandlers = getFieldValue(csfLogoutHandler, "logoutHandlers");
		List<LogoutHandler> lfLogoutHandlers = getFieldValue(lfLogoutHandler, "logoutHandlers");
		assertThat(csfLogoutHandlers).hasSameSizeAs(lfLogoutHandlers);
		assertThat(csfLogoutHandlers).hasAtLeastOneElementOfType(LogoutSuccessEventPublishingLogoutHandler.class);
		assertThat(lfLogoutHandlers).hasAtLeastOneElementOfType(LogoutSuccessEventPublishingLogoutHandler.class);
	}

	private static MockHttpServletResponse request(MockHttpServletRequest request, ApplicationContext context)
			throws IOException, ServletException {
		MockHttpServletResponse response = new MockHttpServletResponse();
		FilterChainProxy proxy = context.getBean(FilterChainProxy.class);
		proxy.doFilter(request, new EncodeUrlDenyingHttpServletResponseWrapper(response), (req, resp) -> {
		});
		return response;
	}

	private MockHttpSession expiredSession() {
		MockHttpSession session = new MockHttpSession();
		SessionRegistry sessionRegistry = this.spring.getContext().getBean(SessionRegistry.class);
		sessionRegistry.registerNewSession(session.getId(), "user");
		sessionRegistry.getSessionInformation(session.getId()).expireNow();
		return session;
	}

	private <T extends Filter> T getFilter(Class<T> filterClass) {
		return (T) getFilters().stream().filter(filterClass::isInstance).findFirst().orElse(null);
	}

	private List<Filter> getFilters() {
		FilterChainProxy proxy = this.spring.getContext().getBean(FilterChainProxy.class);
		return proxy.getFilters("/");
	}

	private ServletContext servletContext() {
		WebApplicationContext context = this.spring.getContext();
		return context.getServletContext();
	}

	private String xml(String configName) {
		return CONFIG_LOCATION_PREFIX + "-" + configName + ".xml";
	}

	static class TeapotSessionAuthenticationStrategy implements SessionAuthenticationStrategy {

		@Override
		public void onAuthentication(Authentication authentication, HttpServletRequest request,
				HttpServletResponse response) throws SessionAuthenticationException {
			response.setStatus(org.springframework.http.HttpStatus.I_AM_A_TEAPOT.value());
		}

	}

	static class CustomRememberMeServices implements RememberMeServices, LogoutHandler {

		@Override
		public Authentication autoLogin(HttpServletRequest request, HttpServletResponse response) {
			return null;
		}

		@Override
		public void loginFail(HttpServletRequest request, HttpServletResponse response) {
		}

		@Override
		public void loginSuccess(HttpServletRequest request, HttpServletResponse response,
				Authentication successfulAuthentication) {
		}

		@Override
		public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {
			response.addHeader("X-Username", authentication.getName());
		}

	}

	@RestController
	static class BasicController {

		@GetMapping("/")
		String ok() {
			return "ok";
		}

		@GetMapping("/auth")
		String auth(Principal principal) {
			return principal.getName();
		}

	}

	private static class SessionResultMatcher implements ResultMatcher {

		private String id;

		private Boolean valid;

		private Boolean exists = true;

		ResultMatcher exists(boolean exists) {
			this.exists = exists;
			return this;
		}

		ResultMatcher valid(boolean valid) {
			this.valid = valid;
			return this.exists(true);
		}

		ResultMatcher id(String id) {
			this.id = id;
			return this.exists(true);
		}

		@Override
		public void match(MvcResult result) {
			if (!this.exists) {
				assertThat(result.getRequest().getSession(false)).isNull();
				return;
			}
			assertThat(result.getRequest().getSession(false)).isNotNull();
			MockHttpSession session = (MockHttpSession) result.getRequest().getSession(false);
			if (this.valid != null) {
				if (this.valid) {
					assertThat(session.isInvalid()).isFalse();
				}
				else {
					assertThat(session.isInvalid()).isTrue();
				}
			}
			if (this.id != null) {
				assertThat(session.getId()).isEqualTo(this.id);
			}
		}

	}

	private static class EncodeUrlDenyingHttpServletResponseWrapper extends HttpServletResponseWrapper {

		EncodeUrlDenyingHttpServletResponseWrapper(HttpServletResponse response) {
			super(response);
		}

		@Override
		public String encodeURL(String url) {
			throw new RuntimeException("Unexpected invocation of encodeURL");
		}

		@Override
		public String encodeRedirectURL(String url) {
			throw new RuntimeException("Unexpected invocation of encodeURL");
		}

		@Override
		public String encodeUrl(String url) {
			throw new RuntimeException("Unexpected invocation of encodeURL");
		}

		@Override
		public String encodeRedirectUrl(String url) {
			throw new RuntimeException("Unexpected invocation of encodeURL");
		}

	}

}


text:
/*
 *
 * 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.
 *
 */

package com.flaminem.flamy.model.files

import java.io.File
import java.net.URI

import com.flaminem.flamy.conf.FlamyGlobalContext

/**
  * Created by fpin on 3/5/17.
  */
case class FilePath(path: String) {

  override def toString: String = {
    val absoluteFile = new File(path).getAbsoluteFile
    if(FlamyGlobalContext.USE_HYPERLINKS.getProperty && absoluteFile.exists()) {
      new URI("file", "", absoluteFile.getPath, null, null).toASCIIString
    }
    else {
      path
    }
  }

}


text:
#pragma once
#include <aws/iot/IoT_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSMap.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace IoT
{
namespace Model
{

  /**
   *
Details of the job execution status.

See Also:
   AWS
   * API Reference

   */
  class AWS_IOT_API JobExecutionStatusDetails
  {
  public:
    JobExecutionStatusDetails();
    JobExecutionStatusDetails(Aws::Utils::Json::JsonView jsonValue);
    JobExecutionStatusDetails& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
The job execution status.

     */
    inline const Aws::Map<Aws::String, Aws::String>& GetDetailsMap() const{ return m_detailsMap; }

    /**
     *
The job execution status.

     */
    inline bool DetailsMapHasBeenSet() const { return m_detailsMapHasBeenSet; }

    /**
     *
The job execution status.

     */
    inline void SetDetailsMap(const Aws::Map<Aws::String, Aws::String>& value) { m_detailsMapHasBeenSet = true; m_detailsMap = value; }

    /**
     *
The job execution status.

     */
    inline void SetDetailsMap(Aws::Map<Aws::String, Aws::String>&& value) { m_detailsMapHasBeenSet = true; m_detailsMap = std::move(value); }

    /**
     *
The job execution status.

     */
    inline JobExecutionStatusDetails& WithDetailsMap(const Aws::Map<Aws::String, Aws::String>& value) { SetDetailsMap(value); return *this;}

    /**
     *
The job execution status.

     */
    inline JobExecutionStatusDetails& WithDetailsMap(Aws::Map<Aws::String, Aws::String>&& value) { SetDetailsMap(std::move(value)); return *this;}

    /**
     *
The job execution status.

     */
    inline JobExecutionStatusDetails& AddDetailsMap(const Aws::String& key, const Aws::String& value) { m_detailsMapHasBeenSet = true; m_detailsMap.emplace(key, value); return *this; }

    /**
     *
The job execution status.

     */
    inline JobExecutionStatusDetails& AddDetailsMap(Aws::String&& key, const Aws::String& value) { m_detailsMapHasBeenSet = true; m_detailsMap.emplace(std::move(key), value); return *this; }

    /**
     *
The job execution status.

     */
    inline JobExecutionStatusDetails& AddDetailsMap(const Aws::String& key, Aws::String&& value) { m_detailsMapHasBeenSet = true; m_detailsMap.emplace(key, std::move(value)); return *this; }

    /**
     *
The job execution status.

     */
    inline JobExecutionStatusDetails& AddDetailsMap(Aws::String&& key, Aws::String&& value) { m_detailsMapHasBeenSet = true; m_detailsMap.emplace(std::move(key), std::move(value)); return *this; }

    /**
     *
The job execution status.

     */
    inline JobExecutionStatusDetails& AddDetailsMap(const char* key, Aws::String&& value) { m_detailsMapHasBeenSet = true; m_detailsMap.emplace(key, std::move(value)); return *this; }

    /**
     *
The job execution status.

     */
    inline JobExecutionStatusDetails& AddDetailsMap(Aws::String&& key, const char* value) { m_detailsMapHasBeenSet = true; m_detailsMap.emplace(std::move(key), value); return *this; }

    /**
     *
The job execution status.

     */
    inline JobExecutionStatusDetails& AddDetailsMap(const char* key, const char* value) { m_detailsMapHasBeenSet = true; m_detailsMap.emplace(key, value); return *this; }

  private:

    Aws::Map<Aws::String, Aws::String> m_detailsMap;
    bool m_detailsMapHasBeenSet;
  };

} // namespace Model
} // namespace IoT
} // namespace Aws


text:
// @flow

import { createElement } from 'react'
import PropTypes from 'prop-types'

import type { Theme } from './ThemeProvider'
import createWarnTooManyClasses from '../utils/createWarnTooManyClasses'

import validAttr from '../utils/validAttr'
import isTag from '../utils/isTag'
import isStyledComponent from '../utils/isStyledComponent'
import getComponentName from '../utils/getComponentName'
import type { RuleSet, Target } from '../types'

import AbstractStyledComponent from './AbstractStyledComponent'
import { CHANNEL } from './ThemeProvider'
import StyleSheet, { CONTEXT_KEY } from './StyleSheet'

const escapeRegex = /[[\].#*$><+~=|^:(),"'`]/g
const multiDashRegex = /--+/g

export default (ComponentStyle: Function, constructWithOptions: Function) => {
  /* We depend on components having unique IDs */
  const identifiers = {}
  const generateId = (_displayName: string) => {
    const displayName = typeof _displayName !== 'string' ?
      'sc' : _displayName
        .replace(escapeRegex, '-') // Replace all possible CSS selectors
        .replace(multiDashRegex, '-') // Replace multiple -- with single -

    const nr = (identifiers[displayName] || 0) + 1
    identifiers[displayName] = nr

    const hash = ComponentStyle.generateName(displayName + nr)
    return `${displayName}-${hash}`
  }

  class BaseStyledComponent extends AbstractStyledComponent {
    static target: Target
    static styledComponentId: string
    static attrs: Object
    static componentStyle: Object
    static warnTooManyClasses: Function

    attrs = {}
    state = {
      theme: null,
      generatedClassName: '',
    }

    buildExecutionContext(theme: any, props: any) {
      const { attrs } = this.constructor
      const context = { ...props, theme }
      if (attrs === undefined) {
        return context
      }

      this.attrs = Object.keys(attrs).reduce((acc, key) => {
        const attr = attrs[key]
        // eslint-disable-next-line no-param-reassign
        acc[key] = typeof attr === 'function' ? attr(context) : attr
        return acc
      }, {})

      return { ...context, ...this.attrs }
    }

    generateAndInjectStyles(theme: any, props: any) {
      const { componentStyle, warnTooManyClasses } = this.constructor
      const executionContext = this.buildExecutionContext(theme, props)
      const styleSheet = this.context[CONTEXT_KEY] || StyleSheet.instance
      const className = componentStyle.generateAndInjectStyles(executionContext, styleSheet)

      if (warnTooManyClasses !== undefined) warnTooManyClasses(className)

      return className
    }

    componentWillMount() {
      // If there is a theme in the context, subscribe to the event emitter. This
      // is necessary due to pure components blocking context updates, this circumvents
      // that by updating when an event is emitted
      if (this.context[CHANNEL]) {
        const subscribe = this.context[CHANNEL]
        this.unsubscribe = subscribe(nextTheme => {
          // This will be called once immediately

          // Props should take precedence over ThemeProvider, which should take precedence over
          // defaultProps, but React automatically puts defaultProps on props.
          const { defaultProps } = this.constructor
          const isDefaultTheme = defaultProps && this.props.theme === defaultProps.theme
          const theme = this.props.theme && !isDefaultTheme ? this.props.theme : nextTheme
          const generatedClassName = this.generateAndInjectStyles(theme, this.props)
          this.setState({ theme, generatedClassName })
        })
      } else {
        const theme = this.props.theme || {}
        const generatedClassName = this.generateAndInjectStyles(
          theme,
          this.props,
        )
        this.setState({ theme, generatedClassName })
      }
    }

    componentWillReceiveProps(nextProps: { theme?: Theme, [key: string]: any }) {
      this.setState((oldState) => {
        // Props should take precedence over ThemeProvider, which should take precedence over
        // defaultProps, but React automatically puts defaultProps on props.
        const { defaultProps } = this.constructor
        const isDefaultTheme = defaultProps && nextProps.theme === defaultProps.theme
        const theme = nextProps.theme && !isDefaultTheme ? nextProps.theme : oldState.theme
        const generatedClassName = this.generateAndInjectStyles(theme, nextProps)

        return { theme, generatedClassName }
      })
    }

    componentWillUnmount() {
      if (this.unsubscribe) {
        this.unsubscribe()
      }
    }

    render() {
      const { innerRef } = this.props
      const { generatedClassName } = this.state
      const { styledComponentId, target } = this.constructor

      const isTargetTag = isTag(target)

      const className = [
        this.props.className,
        styledComponentId,
        this.attrs.className,
        generatedClassName,
      ].filter(Boolean).join(' ')

      const baseProps = {
        ...this.attrs,
        className,
      }

      if (isStyledComponent(target)) {
        baseProps.innerRef = innerRef
      } else {
        baseProps.ref = innerRef
      }

      const propsForElement = Object
        .keys(this.props)
        .reduce((acc, propName) => {
          // Don't pass through non HTML tags through to HTML elements
          // always omit innerRef
          if (
            propName !== 'innerRef' &&
            propName !== 'className' &&
            (!isTargetTag || validAttr(propName))
          ) {
            // eslint-disable-next-line no-param-reassign
            acc[propName] = this.props[propName]
          }

          return acc
        }, baseProps)

      return createElement(target, propsForElement)
    }
  }

  const createStyledComponent = (
    target: Target,
    options: Object,
    rules: RuleSet,
  ) => {
    const {
      displayName = isTag(target) ? `styled.${target}` : `Styled(${getComponentName(target)})`,
      componentId = generateId(options.displayName),
      ParentComponent = BaseStyledComponent,
      rules: extendingRules,
      attrs,
    } = options

    const styledComponentId = (options.displayName && options.componentId) ?
      `${options.displayName}-${options.componentId}` : componentId

    let warnTooManyClasses
    if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production') {
      warnTooManyClasses = createWarnTooManyClasses(displayName)
    }

    const componentStyle = new ComponentStyle(
      extendingRules === undefined ? rules : extendingRules.concat(rules),
      styledComponentId,
    )

    class StyledComponent extends ParentComponent {
      static contextTypes = {
        [CHANNEL]: PropTypes.func,
        [CONTEXT_KEY]: PropTypes.instanceOf(StyleSheet),
      }

      static displayName = displayName
      static styledComponentId = styledComponentId
      static attrs = attrs
      static componentStyle = componentStyle
      static warnTooManyClasses = warnTooManyClasses
      static target = target

      static withComponent(tag) {
        const { displayName: _, componentId: __, ...optionsToCopy } = options
        const newOptions = { ...optionsToCopy, ParentComponent: StyledComponent }
        return createStyledComponent(tag, newOptions, rules)
      }

      static get extend() {
        const {
          displayName: _,
          componentId: __,
          rules: rulesFromOptions,
          ...optionsToCopy
        } = options

        const newRules = rulesFromOptions === undefined
          ? rules
          : rulesFromOptions.concat(rules)

        const newOptions = {
          ...optionsToCopy,
          rules: newRules,
          ParentComponent: StyledComponent,
        }

        return constructWithOptions(createStyledComponent, target, newOptions)
      }
    }

    return StyledComponent
  }

  return createStyledComponent
}