text:
package org.kie.workbench.drools.client;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;

import com.google.gwt.animation.client.Animation;
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.user.client.Window;
import com.google.gwt.user.client.ui.RootPanel;
import org.guvnor.common.services.shared.config.AppConfigService;
import org.guvnor.common.services.shared.security.KieWorkbenchACL;
import org.guvnor.common.services.shared.security.KieWorkbenchPolicy;
import org.guvnor.common.services.shared.security.KieWorkbenchSecurityService;
import org.jboss.errai.common.client.api.Caller;
import org.jboss.errai.common.client.api.RemoteCallback;
import org.jboss.errai.ioc.client.api.AfterInitialization;
import org.jboss.errai.ioc.client.api.EntryPoint;
import org.jboss.errai.ioc.client.container.IOCBeanDef;
import org.jboss.errai.ioc.client.container.SyncBeanManager;
import org.jboss.errai.security.shared.api.Role;
import org.jboss.errai.security.shared.api.identity.User;
import org.jboss.errai.security.shared.service.AuthenticationService;
import org.jbpm.console.ng.ga.forms.service.PlaceManagerActivityService;
import org.kie.workbench.common.screens.social.hp.config.SocialConfigurationService;
import org.kie.workbench.common.services.shared.preferences.ApplicationPreferences;
import org.kie.workbench.common.widgets.client.menu.AboutMenuBuilder;
import org.kie.workbench.common.widgets.client.menu.ResetPerspectivesMenuBuilder;
import org.kie.workbench.common.widgets.client.menu.WorkbenchConfigurationMenuBuilder;
import org.kie.workbench.common.widgets.client.resources.RoundedCornersResource;
import org.kie.workbench.drools.client.home.HomeProducer;
import org.kie.workbench.drools.client.resources.i18n.AppConstants;
import org.uberfire.client.menu.CustomSplashHelp;
import org.uberfire.client.mvp.AbstractWorkbenchPerspectiveActivity;
import org.uberfire.client.mvp.ActivityBeansCache;
import org.uberfire.client.mvp.ActivityManager;
import org.uberfire.client.mvp.PlaceManager;
import org.uberfire.client.workbench.docks.UberfireDock;
import org.uberfire.client.workbench.docks.UberfireDockPosition;
import org.uberfire.client.workbench.docks.UberfireDocks;
import org.uberfire.client.workbench.widgets.menu.WorkbenchMenuBarPresenter;
import org.uberfire.mvp.Command;
import org.uberfire.mvp.impl.DefaultPlaceRequest;
import org.uberfire.workbench.model.menu.MenuFactory;
import org.uberfire.workbench.model.menu.MenuItem;
import org.uberfire.workbench.model.menu.MenuPosition;
import org.uberfire.workbench.model.menu.Menus;

import static org.kie.workbench.drools.client.security.KieWorkbenchFeatures.*;

/**
 * GWT's Entry-point for kie-drools-wb
 */
@EntryPoint
public class KieDroolsWorkbenchEntryPoint {

    private AppConstants constants = AppConstants.INSTANCE;

    @Inject
    private Caller<AppConfigService> appConfigService;

    @Inject
    private WorkbenchMenuBarPresenter menubar;

    @Inject
    private PlaceManager placeManager;

    @Inject
    private SyncBeanManager iocManager;

    @Inject
    private ActivityManager activityManager;

    @Inject
    private User identity;

    @Inject
    private KieWorkbenchACL kieACL;

    @Inject
    private HomeProducer homeProducer;

    @Inject
    private Caller<KieWorkbenchSecurityService> kieSecurityService;

    @Inject
    private Caller<PlaceManagerActivityService> pmas;

    @Inject
    private ActivityBeansCache activityBeansCache;

    @Inject
    private Caller<AuthenticationService> authService;

    @Inject
    private Caller<SocialConfigurationService> socialConfigurationService;

    @AfterInitialization
    public void startApp() {
        kieSecurityService.call( new RemoteCallback<String>() {
            public void callback( final String str ) {
                KieWorkbenchPolicy policy = new KieWorkbenchPolicy( str );
                kieACL.activatePolicy( policy );
                loadPreferences();
                loadStyles();
                setupMenu();
                hideLoadingPopup();
                homeProducer.init();
            }
        } ).loadPolicy();
        List<String> allActivities = activityBeansCache.getActivitiesById();
        pmas.call( new RemoteCallback<Void>() {

            @Override
            public void callback( Void response ) {

            }
        } ).initActivities( allActivities );
    }

    private void loadPreferences() {
        appConfigService.call( new RemoteCallback<Map<String, String>>() {
            @Override
            public void callback( final Map<String, String> response ) {
                ApplicationPreferences.setUp( response );
            }
        } ).loadPreferences();
    }

    private void loadStyles() {
        //Ensure CSS has been loaded
        //ShowcaseResources.INSTANCE.showcaseCss().ensureInjected();
        RoundedCornersResource.INSTANCE.roundCornersCss().ensureInjected();
    }

    private void setupMenu() {
        socialConfigurationService.call( new RemoteCallback<Boolean>() {
            public void callback( final Boolean socialEnabled ) {

                final AbstractWorkbenchPerspectiveActivity defaultPerspective = getDefaultPerspectiveActivity();

                final Menus menus =
                        MenuFactory.newTopLevelMenu( constants.home() ).withItems( getHomeViews( socialEnabled ) ).endMenu()
                                .newTopLevelMenu( constants.authoring() ).withRoles( kieACL.getGrantedRoles( G_AUTHORING ) ).withItems( getAuthoringViews() ).endMenu()
                                .newTopLevelMenu( constants.deploy() ).withRoles( kieACL.getGrantedRoles( G_AUTHORING ) ).withItems( getDeploymentViews() ).endMenu()
                                .newTopLevelMenu( constants.tasks() ).withItems( getTasksViews() ).endMenu()
                                .newTopLevelMenu( constants.extensions() ).withRoles( kieACL.getGrantedRoles( F_EXTENSIONS ) ).withItems( getExtensionsViews() ).endMenu()
                                .newTopLevelMenu( constants.find() ).withRoles( kieACL.getGrantedRoles( F_SEARCH ) ).position( MenuPosition.RIGHT ).respondsWith( new Command() {

                            @Override
                            public void execute() {
                                placeManager.goTo( "FindForm" );
                            }
                        } )
                                .endMenu()
                                .newTopLevelMenu( constants.User() + ": " + identity.getIdentifier() )
                                .position( MenuPosition.RIGHT )
                                .withItems( getRoles() )
                                .endMenu()
                                .newTopLevelCustomMenu( iocManager.lookupBean( WorkbenchConfigurationMenuBuilder.class ).getInstance() )
                                .endMenu()
                                .newTopLevelCustomMenu( iocManager.lookupBean( CustomSplashHelp.class ).getInstance() )
                                .endMenu()
                                .newTopLevelCustomMenu( iocManager.lookupBean( AboutMenuBuilder.class ).getInstance() )
                                .endMenu()
                                .newTopLevelCustomMenu( iocManager.lookupBean( ResetPerspectivesMenuBuilder.class ).getInstance() )
                                .endMenu()
                                .build();

                menubar.addMenus( menus );
            }
        } ).isSocialEnable();
    }

    private List<? extends MenuItem> getRoles() {
        final List<MenuItem> result = new ArrayList<MenuItem>( identity.getRoles().size() );
        for ( final Role role : identity.getRoles() ) {
            if ( !role.getName().equals( "IS_REMEMBER_ME" ) ) {
                result.add( MenuFactory.newSimpleItem( constants.Role() + ": " + role.getName() ).endMenu().build().getItems().get( 0 ) );
            }
        }
        result.add( MenuFactory.newSimpleItem( constants.LogOut() ).respondsWith( new LogoutCommand() ).endMenu().build().getItems().get( 0 ) );

        return result;
    }

    private List<? extends MenuItem> getHomeViews( Boolean socialEnabled ) {
        final AbstractWorkbenchPerspectiveActivity defaultPerspective = getDefaultPerspectiveActivity();
        final List<MenuItem> result = new ArrayList<MenuItem>( 1 );

        result.add( MenuFactory.newSimpleItem( constants.homePage() ).respondsWith( new Command() {
            @Override
            public void execute() {
                if ( defaultPerspective != null ) {
                    placeManager.goTo( new DefaultPlaceRequest( defaultPerspective.getIdentifier() ) );
                } else {
                    Window.alert( constants.missingDefaultPerspective() );
                }
            }
        } ).endMenu().build().getItems().get( 0 ) );
        if ( socialEnabled ) {
            result.add( MenuFactory.newSimpleItem( constants.timeline() ).respondsWith( new Command() {
                @Override
                public void execute() {
                    placeManager.goTo( new DefaultPlaceRequest( "SocialHomePagePerspective" ) );
                }
            } ).endMenu().build().getItems().get( 0 ) );

            result.add( MenuFactory.newSimpleItem( constants.people() ).respondsWith( new Command() {
                @Override
                public void execute() {
                    placeManager.goTo( new DefaultPlaceRequest( "UserHomePagePerspective" ) );
                }
            } ).endMenu().build().getItems().get( 0 ) );
        }
        return result;
    }

    private List<MenuItem> getAuthoringViews() {
        final List<MenuItem> result = new ArrayList<MenuItem>( 4 );

        result.add( MenuFactory.newSimpleItem( constants.project_authoring() ).withRoles( kieACL.getGrantedRoles( F_PROJECT_AUTHORING ) ).respondsWith( new Command() {
            @Override
            public void execute() {
                placeManager.goTo( new DefaultPlaceRequest( "AuthoringPerspective" ) );
            }
        } ).endMenu().build().getItems().get( 0 ) );

        result.add( MenuFactory.newSimpleItem( constants.contributors() ).withRoles( kieACL.getGrantedRoles( F_CONTRIBUTORS ) ).respondsWith( new Command() {
            @Override
            public void execute() {
                placeManager.goTo( new DefaultPlaceRequest( "ContributorsPerspective" ) );
            }
        } ).endMenu().build().getItems().get( 0 ) );

        result.add( MenuFactory.newSimpleItem( constants.artifactRepository() ).withRoles( kieACL.getGrantedRoles( F_ARTIFACT_REPO ) ).respondsWith( new Command() {
            @Override
            public void execute() {
                placeManager.goTo( new DefaultPlaceRequest( "org.guvnor.m2repo.client.perspectives.GuvnorM2RepoPerspective" ) );
            }
        } ).endMenu().build().getItems().get( 0 ) );

        result.add( MenuFactory.newSimpleItem( constants.administration() ).withRoles( kieACL.getGrantedRoles( F_ADMINISTRATION ) ).respondsWith( new Command() {
            @Override
            public void execute() {
                placeManager.goTo( new DefaultPlaceRequest( "AdministrationPerspective" ) );
            }
        } ).endMenu().build().getItems().get( 0 ) );

        return result;
    }

    private List<MenuItem> getDeploymentViews() {
        final List<MenuItem> result = new ArrayList<MenuItem>( 1 );

        result.add( MenuFactory.newSimpleItem( constants.ruleDeployments() ).withRoles( kieACL.getGrantedRoles( F_MANAGEMENT ) ).respondsWith( new Command() {
            @Override
            public void execute() {
                placeManager.goTo( new DefaultPlaceRequest( "ServerManagementPerspective" ) );
            }
        } ).endMenu().build().getItems().get( 0 ) );

        return result;
    }

    private List<? extends MenuItem> getTasksViews() {
        final List<MenuItem> result = new ArrayList<MenuItem>( 2 );

        result.add( MenuFactory.newSimpleItem( constants.Tasks_List() ).respondsWith( new Command() {
            @Override
            public void execute() {
                placeManager.goTo( new DefaultPlaceRequest( "Tasks" ) );
            }
        } ).endMenu().build().getItems().get( 0 ) );

        return result;
    }

    private List<? extends MenuItem> getExtensionsViews() {
        final List<MenuItem> result = new ArrayList<MenuItem>( 2 );
        result.add( MenuFactory.newSimpleItem( constants.plugins() ).withRoles( kieACL.getGrantedRoles( F_PLUGIN_MANAGEMENT ) ).respondsWith( new Command() {
            @Override
            public void execute() {
                placeManager.goTo( new DefaultPlaceRequest( "PlugInAuthoringPerspective" ) );
            }
        } ).endMenu().build().getItems().get( 0 ) );
        result.add( MenuFactory.newSimpleItem( constants.Apps() ).withRoles( kieACL.getGrantedRoles( F_APPS ) ).respondsWith( new Command() {
            @Override
            public void execute() {
                placeManager.goTo( new DefaultPlaceRequest( "AppsPerspective" ) );
            }

        } ).endMenu().build().getItems().get( 0 ) );
        result.add( MenuFactory.newSimpleItem( constants.DataSets() ).withRoles( kieACL.getGrantedRoles( F_DATASETS ) ).respondsWith( new Command() {
            @Override
            public void execute() {
                placeManager.goTo( new DefaultPlaceRequest( "DataSetAuthoringPerspective" ) );
            }

        } ).endMenu().build().getItems().get( 0 ) );
        return result;
    }

    private AbstractWorkbenchPerspectiveActivity getDefaultPerspectiveActivity() {
        AbstractWorkbenchPerspectiveActivity defaultPerspective = null;
        final Collection<IOCBeanDef<AbstractWorkbenchPerspectiveActivity>> perspectives = iocManager.lookupBeans( AbstractWorkbenchPerspectiveActivity.class );
        final Iterator<IOCBeanDef<AbstractWorkbenchPerspectiveActivity>> perspectivesIterator = perspectives.iterator();
        outer_loop:
        while ( perspectivesIterator.hasNext() ) {
            final IOCBeanDef<AbstractWorkbenchPerspectiveActivity> perspective = perspectivesIterator.next();
            final AbstractWorkbenchPerspectiveActivity instance = perspective.getInstance();
            if ( instance.isDefault() ) {
                defaultPerspective = instance;
                break outer_loop;
            } else {
                iocManager.destroyBean( instance );
            }
        }
        return defaultPerspective;
    }

    //Fade out the "Loading application" pop-up
    private void hideLoadingPopup() {
        final Element e = RootPanel.get( "loading" ).getElement();

        new Animation() {

            @Override
            protected void onUpdate( double progress ) {
                e.getStyle().setOpacity( 1.0 - progress );
            }

            @Override
            protected void onComplete() {
                e.getStyle().setVisibility( Style.Visibility.HIDDEN );
            }
        }.run( 500 );
    }

    private class LogoutCommand implements Command {

        @Override
        public void execute() {
            authService.call( new RemoteCallback<Void>() {
                @Override
                public void callback( Void response ) {
                    final String location = GWT.getModuleBaseURL().replaceFirst( "/" + GWT.getModuleName() + "/", "/logout.jsp" );
                    redirect( location );
                }
            } ).logout();
        }
    }

    public static native void redirect( String url )/*-{
        $wnd.location = url;
    }-*/;

}


text:
namespace net {
class NetworkDelegate;
class URLRequest;
class URLRequestInterceptor;
}

namespace webkit_blob {
class BlobStorageContext;
}

namespace content {

class ServiceWorkerContextCore;
class ServiceWorkerContextWrapper;
class ServiceWorkerProviderHost;

// Abstract base class for routing network requests to ServiceWorkers.
// Created one per URLRequest and attached to each request.
class CONTENT_EXPORT ServiceWorkerRequestHandler
    : public base::SupportsUserData::Data {
 public:
  // Attaches a newly created handler if the given |request| needs to
  // be handled by ServiceWorker.
  // TODO(kinuko): While utilizing UserData to attach data to URLRequest
  // has some precedence, it might be better to attach this handler in a more
  // explicit way within content layer, e.g. have ResourceRequestInfoImpl
  // own it.
  static void InitializeHandler(
      net::URLRequest* request,
      ServiceWorkerContextWrapper* context_wrapper,
      webkit_blob::BlobStorageContext* blob_storage_context,
      int process_id,
      int provider_id,
      ResourceType::Type resource_type);

  // Returns the handler attached to |request|. This may return NULL
  // if no handler is attached.
  static ServiceWorkerRequestHandler* GetHandler(
      net::URLRequest* request);

  // Creates a protocol interceptor for ServiceWorker.
  static scoped_ptr<net::URLRequestInterceptor> CreateInterceptor();

  virtual ~ServiceWorkerRequestHandler();

  // Called via custom URLRequestJobFactory.
  virtual net::URLRequestJob* MaybeCreateJob(
      net::URLRequest* request,
      net::NetworkDelegate* network_delegate) = 0;

 protected:
  ServiceWorkerRequestHandler(
      base::WeakPtr<ServiceWorkerContextCore> context,
      base::WeakPtr<ServiceWorkerProviderHost> provider_host,
      base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context,
      ResourceType::Type resource_type);

  base::WeakPtr<ServiceWorkerContextCore> context_;
  base::WeakPtr<ServiceWorkerProviderHost> provider_host_;
  base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context_;
  ResourceType::Type resource_type_;

  DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler);
};

}  // namespace content

#endif  // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_

redpajama_set_name: RedPajamaGithub


text:
import requests

from flask import Flask, request, redirect, url_for, render_template
from flask.ext.assets import Environment, Bundle

app = Flask(__name__)

"""
Setup Flask app
"""

def configurate_app(config_file=''):
    """
    Configures Flask app

    :param config_file: Absolute path to Py config file, optional
    :returns: App object, host and port
    """
    # Load config
    app.config.from_pyfile('defaults.py')
    app.config.from_pyfile(config_file, silent=True)

    if app.config.get('MINIFY_HTML', False):
        app.jinja_env.add_extension('flask_utils.jinja2htmlcompress.HTMLCompress')

    # Setup web assets
    assets = Environment(app)

    js = Bundle('common.js', filters='jsmin', output='gen/main.%(version)s.js')
    css = Bundle('common.css', filters='cssmin', output='gen/main.%(version)s.css')

    assets.register('js_all', js)
    assets.register('css_all', css)

    # Set host and port
    port = app.config.get('PORT', 5000)
    host = app.config.get('HOST', '127.0.0.1')

    return app, host, port

def create_request(query):
    """
    Creates a GET request to Yarr! server

    :param query: Free-text search query
    :returns: Requests object
    """
    yarr_url = app.config.get('YARR_URL', False)

    if not yarr_url:
        raise('No URL to Yarr! server specified in config.')

    api_token = app.config.get('YARR_API_TOKEN', False)
    headers = {'X-API-KEY': api_token} if api_token else {}
    payload = {'q': query}
    url = '%s/search' % yarr_url

    return requests.get(url, params=payload, headers=headers)

"""
Routes
"""

@app.route('/')
def index():

    return render_template('index.html')

@app.route('/search')
def search():

    query = request.args.get('q', None)

    if not query:
        return redirect(url_for('index'))

    yarr_request = create_request(query)

    if yarr_request.status_code is not 200:
        return redirect(url_for('index'))

    data = yarr_request.json()

    params = {
        'torrent_name': data.get('name', 'None found'),
        'torrent_link': data.get('magnet', '')
    }

    return render_template('search.html', **params)


text:
#import <QuartzCore/CAStateElement.h>

@class CAAnimation, NSString;

@interface CAStateAddAnimation : CAStateElement
{
    NSString *_key;
    CAAnimation *_animation;
}

@property(retain, nonatomic) CAAnimation *animation; // @synthesize animation=_animation;
@property(copy, nonatomic) NSString *key; // @synthesize key=_key;
- (id)debugDescription;
- (void)dealloc;
- (id)initWithCoder:(id)arg1;
- (void)encodeWithCoder:(id)arg1;
- (id)CAMLTypeForKey:(id)arg1;
- (void)encodeWithCAMLWriter:(id)arg1;
- (id)copyWithZone:(struct _NSZone *)arg1;
- (void)apply:(id)arg1;
- (_Bool)matches:(id)arg1;
- (id)keyPath;

@end


text:
<?php
/**
 * Configuration file generated by ZF Apigility Admin
 *
 * The previous config file has been stored in ./config/application.config.old
 */
return array(
    'modules' => array(
        'Application',
        'ZF\\DevelopmentMode',
        'ZF\\Apigility',
        'ZF\\Apigility\\Provider',
        'ZF\\Apigility\\Documentation',
        'AssetManager',
        'ZF\\ApiProblem',
        'ZF\\Configuration',
        'ZF\\OAuth2',
        'ZF\\MvcAuth',
        'ZF\\Hal',
        'ZF\\ContentNegotiation',
        'ZF\\ContentValidation',
        'ZF\\Rest',
        'ZF\\Rpc',
        'ZF\\Versioning',
        'Auth',
        'DbAdapter',
        'Sql',
        'BlogApi',
        'BlogServices',
        'ContactApi',
        'ContactServices',
        'Email'
    ),
    'module_listener_options' => array(
        'module_paths' => array(
            './module',
            './vendor',
        ),
        'config_glob_paths' => array(
            '/var/www/pdizz-web/config/autoload/{,*.}{global,local}.php',
        ),
    ),
);


text:
package aws

import (
	"fmt"
	"log"
	"strings"
	"time"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/autoscaling"
	"github.com/hashicorp/terraform/helper/resource"
	"github.com/hashicorp/terraform/helper/schema"
)

// waitForASGCapacityTimeout gathers the current numbers of healthy instances
// in the ASG and its attached ELBs and yields these numbers to a
// capacitySatifiedFunction. Loops for up to wait_for_capacity_timeout until
// the capacitySatisfiedFunc returns true.
//
// See "Waiting for Capacity" in docs for more discussion of the feature.
func waitForASGCapacity(
	d *schema.ResourceData,
	meta interface{},
	satisfiedFunc capacitySatisfiedFunc) error {
	wait, err := time.ParseDuration(d.Get("wait_for_capacity_timeout").(string))
	if err != nil {
		return err
	}

	if wait == 0 {
		log.Printf("[DEBUG] Capacity timeout set to 0, skipping capacity waiting.")
		return nil
	}

	log.Printf("[DEBUG] Waiting on %s for capacity...", d.Id())

	err = resource.Retry(wait, func() *resource.RetryError {
		g, err := getAwsAutoscalingGroup(d.Id(), meta.(*AWSClient).autoscalingconn)
		if err != nil {
			return resource.NonRetryableError(err)
		}
		if g == nil {
			log.Printf("[WARN] Autoscaling Group (%s) not found, removing from state", d.Id())
			d.SetId("")
			return nil
		}
		elbis, err := getELBInstanceStates(g, meta)
		if err != nil {
			return resource.NonRetryableError(err)
		}
		albis, err := getTargetGroupInstanceStates(g, meta)
		if err != nil {
			return resource.NonRetryableError(err)
		}

		haveASG := 0
		haveELB := 0

		for _, i := range g.Instances {
			if i.HealthStatus == nil || i.InstanceId == nil || i.LifecycleState == nil {
				continue
			}

			if !strings.EqualFold(*i.HealthStatus, "Healthy") {
				continue
			}

			if !strings.EqualFold(*i.LifecycleState, "InService") {
				continue
			}

			haveASG++

			inAllLbs := true
			for _, states := range elbis {
				state, ok := states[*i.InstanceId]
				if !ok || !strings.EqualFold(state, "InService") {
					inAllLbs = false
				}
			}
			for _, states := range albis {
				state, ok := states[*i.InstanceId]
				if !ok || !strings.EqualFold(state, "healthy") {
					inAllLbs = false
				}
			}
			if inAllLbs {
				haveELB++
			}
		}

		satisfied, reason := satisfiedFunc(d, haveASG, haveELB)

		log.Printf("[DEBUG] %q Capacity: %d ASG, %d ELB/ALB, satisfied: %t, reason: %q",
			d.Id(), haveASG, haveELB, satisfied, reason)

		if satisfied {
			return nil
		}

		return resource.RetryableError(
			fmt.Errorf("%q: Waiting up to %s: %s", d.Id(), wait, reason))
	})

	if err == nil {
		return nil
	}

	recentStatus := ""

	conn := meta.(*AWSClient).autoscalingconn
	resp, aErr := conn.DescribeScalingActivities(&autoscaling.DescribeScalingActivitiesInput{
		AutoScalingGroupName: aws.String(d.Id()),
		MaxRecords:           aws.Int64(1),
	})
	if aErr == nil {
		if len(resp.Activities) > 0 {
			recentStatus = fmt.Sprintf("%s", resp.Activities[0])
		} else {
			recentStatus = "(0 activities found)"
		}
	} else {
		recentStatus = fmt.Sprintf("(Failed to describe scaling activities: %s)", aErr)
	}

	return fmt.Errorf("%s. Most recent activity: %s", err, recentStatus)
}

type capacitySatisfiedFunc func(*schema.ResourceData, int, int) (bool, string)

// capacitySatisfiedCreate treats all targets as minimums
func capacitySatisfiedCreate(d *schema.ResourceData, haveASG, haveELB int) (bool, string) {
	minASG := d.Get("min_size").(int)
	if wantASG := d.Get("desired_capacity").(int); wantASG > 0 {
		minASG = wantASG
	}
	if haveASG < minASG {
		return false, fmt.Sprintf(
			"Need at least %d healthy instances in ASG, have %d", minASG, haveASG)
	}
	minELB := d.Get("min_elb_capacity").(int)
	if wantELB := d.Get("wait_for_elb_capacity").(int); wantELB > 0 {
		minELB = wantELB
	}
	if haveELB < minELB {
		return false, fmt.Sprintf(
			"Need at least %d healthy instances in ELB, have %d", minELB, haveELB)
	}
	return true, ""
}

// capacitySatisfiedUpdate only cares about specific targets
func capacitySatisfiedUpdate(d *schema.ResourceData, haveASG, haveELB int) (bool, string) {
	if wantASG := d.Get("desired_capacity").(int); wantASG > 0 {
		if haveASG != wantASG {
			return false, fmt.Sprintf(
				"Need exactly %d healthy instances in ASG, have %d", wantASG, haveASG)
		}
	}
	if wantELB := d.Get("wait_for_elb_capacity").(int); wantELB > 0 {
		if haveELB != wantELB {
			return false, fmt.Sprintf(
				"Need exactly %d healthy instances in ELB, have %d", wantELB, haveELB)
		}
	}
	return true, ""
}


text:
@interface PodsDummy_BlinkingLabeltest : NSObject
@end
@implementation PodsDummy_BlinkingLabeltest
@end


text:
import akka.actor.{ActorRef, ActorSystem}
import akka.testkit.{TestActorRef, TestProbe, TestKit}
import models._
import org.scalatest.{BeforeAndAfterAll, Matchers, GivenWhenThen, FeatureSpecLike}

import scala.util.{Success, Random}

class CCPClearingMechanismSpec extends TestKit(ActorSystem("CCPClearingMechanismSpec")) with
  FeatureSpecLike with
  GivenWhenThen with
  Matchers with
  BeforeAndAfterAll {

  /** Shutdown actor system when finished. */
  override def afterAll(): Unit = {
    system.shutdown()
  }

  def generateRandomPartialFill(askTradingPartyRef: ActorRef,
                                bidTradingPartyRef: ActorRef,
                                instrument: Stock,
                                maxPrice: Double = 1e6,
                                maxQuantity: Int = 10000): FillLike = {
    val price = generateRandomPrice()
    val quantity = generateRandomQuantity()

    PartialFill(askTradingPartyRef, bidTradingPartyRef, instrument, price, quantity)
  }

  def generateRandomTotalFill(askTradingPartyRef: ActorRef,
                              bidTradingPartyRef: ActorRef,
                              instrument: Stock,
                              maxPrice: Double = 1e6,
                              maxQuantity: Int = 10000): FillLike = {

    val price = generateRandomPrice()
    val quantity = generateRandomQuantity()

    TotalFill(askTradingPartyRef, bidTradingPartyRef, instrument, price, quantity)

  }

  def generateRandomPrice(maxPrice: Double = 1000.0): Double = {
    Random.nextDouble() * maxPrice
  }

  def generateRandomQuantity(maxQuantity: Int = 10000): Int = {
    Random.nextInt(maxQuantity)
  }

  feature("CCPClearingMechanism should process transactions.") {

    val testInstrument = Stock("APPL")

    val clearingMechanismRef = TestActorRef(new CCPClearingMechanism)
    val clearingMechanism = clearingMechanismRef.underlyingActor

    val askTradingParty = TestProbe()
    val bidTradingParty = TestProbe()

    scenario("CCPClearingMechanism receives a PartialFill.") {

      val fill = generateRandomPartialFill(askTradingParty.ref, bidTradingParty.ref, testInstrument)

      // store initial holdings of cash and securities
      val clearingMechanismInitialSecurities = clearingMechanism.assets(testInstrument)
      val clearingMechanismInitialCash = clearingMechanism.assets(Currency)

      When("CCPClearingMechanism receives a PartialFill")

      clearingMechanismRef ! fill

      Then("AskTradingParty should receive a request for Securities")

      askTradingParty.expectMsg(AssetsRequest(fill.instrument, fill.quantity))
      askTradingParty.reply(Success(Assets(fill.instrument, fill.quantity)))

      Then("BidTradingParty should receive a request for Payment")

      val paymentAmount = fill.price * fill.quantity
      bidTradingParty.expectMsg(PaymentRequest(paymentAmount))
      bidTradingParty.reply(Success(Payment(paymentAmount)))

      Then("AskTradingParty should receive a Payment")

      askTradingParty.expectMsg(Payment(paymentAmount))

      Then("BidTradingParty should receive a Securities")

      bidTradingParty.expectMsg(Assets(fill.instrument, fill.quantity))

      Then("CCPClearingMechanism securities holdings should remain unchanged.")

      clearingMechanism.assets(testInstrument) should be(clearingMechanismInitialSecurities)

      Then("CCPClearingMechanism cash holdings should remain unchanged.")

      clearingMechanism.assets(Currency) should be(clearingMechanismInitialCash)

    }

    scenario("CCPClearingMechanism receives a TotalFill.") {

      val fill = generateRandomTotalFill(askTradingParty.ref, bidTradingParty.ref, testInstrument)

      // store initial holdings of cash and securities
      val clearingMechanismInitialSecurities = clearingMechanism.assets(testInstrument)
      val clearingMechanismInitialCash = clearingMechanism.assets(Currency)

      When("CCPClearingMechanism receives a PartialFill")

      clearingMechanismRef ! fill

      Then("AskTradingParty should receive a request for Securities")

      askTradingParty.expectMsg(AssetsRequest(fill.instrument, fill.quantity))
      askTradingParty.reply(Success(Assets(fill.instrument, fill.quantity)))

      Then("BidTradingParty should receive a request for Payment")

      val paymentAmount = fill.price * fill.quantity
      bidTradingParty.expectMsg(PaymentRequest(paymentAmount))
      bidTradingParty.reply(Success(Payment(paymentAmount)))

      Then("AskTradingParty should receive a Payment")

      askTradingParty.expectMsg(Payment(paymentAmount))

      Then("BidTradingParty should receive a Securities")

      bidTradingParty.expectMsg(Assets(fill.instrument, fill.quantity))

      Then("CCPClearingMechanism securities holdings should remain unchanged.")

      clearingMechanism.assets(testInstrument) should be(clearingMechanismInitialSecurities)

      Then("CCPClearingMechanism cash holdings should remain unchanged.")

      clearingMechanism.assets(Currency) should be(clearingMechanismInitialCash)

    }

  }

}


text:
package com.test.sharksharding.core.shard;

import java.util.List;

import org.junit.Test;

import com.sharksharding.core.shard.ResolveShardkey;
import com.sharksharding.core.shard.ShardConfigInfo;

import junit.framework.Assert;

/**
 * 获取分库分表的关键字测试类
 *
 * @author gaoxianglong
 */
public class ResolveShardkeyTest {
	/**
	 * 测试解析并获取配置文件中库内分片模式下的分库分表关键字
	 *
	 * @author gaoxianglong
	 */
	public @Test void testGetNamebyMany() {
		ShardConfigInfo sharkInfo = ShardConfigInfo.getShardInfo();
		sharkInfo.setDbRuleArray("#uid|email_hash#%1024/32");
		sharkInfo.setTbRuleArray("#uid|email_hash#%1024%32");
		List<String> keyNames = ResolveShardkey.getShardKeys(sharkInfo);
		Assert.assertEquals(2, keyNames.size());
		Assert.assertEquals("uid", keyNames.get(0));
		Assert.assertEquals("email_hash", keyNames.get(1));
		/* 只有一个分库分表关键字 */
		sharkInfo.setDbRuleArray("#uid#%1024/32");
		keyNames = ResolveShardkey.getShardKeys(sharkInfo);
		Assert.assertEquals(1, keyNames.size());
		Assert.assertEquals("uid", keyNames.get(0));
	}

	/**
	 * 测试解析并获取配置文件中一库一片模式下的分库分表关键字
	 *
	 * @author gaoxianglong
	 */
	public @Test void testGetNamebyOne() {
		ShardConfigInfo sharkInfo = ShardConfigInfo.getShardInfo();
		sharkInfo.setDbRuleArray("#uid|email_hash#%32");
		List<String> keyNames = ResolveShardkey.getShardKeys(sharkInfo);
		Assert.assertEquals(2, keyNames.size());
		Assert.assertEquals("uid", keyNames.get(0));
		Assert.assertEquals("email_hash", keyNames.get(1));
		/* 只有一个分库分表关键字 */
		sharkInfo.setDbRuleArray("#uid#%32");
		keyNames = ResolveShardkey.getShardKeys(sharkInfo);
		Assert.assertEquals(1, keyNames.size());
		Assert.assertEquals("uid", keyNames.get(0));
	}
}


text:
/***************************************************************************//**
* \file cy_csd.h
* \version 1.10.2
*
* The header file of the CSD driver.
*
********************************************************************************
* \copyright
* (c) (2016-2022), Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*
* 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 expressed or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/

/**
* \addtogroup group_csd
*/

/**
********************************************************************************
* \addtogroup group_csd
********************************************************************************
* \{
*
* The CSD HW block enables multiple sensing capabilities on PSoC™ devices,
* including self-cap and mutual-cap capacitive touch sensing solutions,
* a 10-bit ADC, IDAC, and Comparator.
*
* The CAPSENSE™ solution includes:
* * The CAPSENSE™ Configurator tool, which is a configuration wizard to create
*   and configure CAPSENSE™ widgets. It can be launched in ModusToolbox™
*   from the CSD personality as well as in standalone mode.
*   It contains separate documentation on how to create and
*   configure widgets, parameters, and algorithm descriptions.
* * An API to control the design from the application program. This
*   documentation describes the API with code snippets about how to use them.
* * The CAPSENSE™ Tuner tool for real-time tuning, testing, and debugging,
*   for easy and smooth design of human interfaces on customer products.
*   The Tuner tool communicates with a device through a HW bridge and
*   communication drivers (EzI2C, UART, etc.) and allows monitoring of
*   widget statuses, sensor signals, detected touch positions, gestures, etc.
* The application program does not need to interact with the CSD driver
* and/or other drivers such as GPIO or SysClk directly. All of that is
* configured and managed by middleware.
*
* \image html capsense_solution.png "CAPSENSE™ Solution" width=800px
* \image latex capsense_solution.png
*
* This section describes only the CSD driver. Refer to the corresponding
* sections for documentation of middleware supported by the CSD HW block.
*
* The CSD driver is a low-level peripheral driver that provides an interface to
* a complex mixed signal of the CSD HW block.
*
* The CSD driver alone does not provide system-level functions. Instead, it is
* used by upper-level middleware to configure the CSD HW block required by
* an application.
*
* The CSD HW block can support only one function at a time. To allow seamless
* time-multiplex implementation of functionality and to avoid conflicting access
* to hardware from the upper level, the CSD driver also implements a lock
* semaphore mechanism.
*
* The CSD driver supports re-entrance. If a device contains several
* CSD HW blocks, the same CSD driver is used to configure any HW block. For
* that, each function of the CSD driver contains a base address to define
* the CSD HW block to which the CSD driver communicates.
*
* There is no restriction on the CSD Driver usage in RTOS.
*
********************************************************************************
* \section group_csd_config_usage Usage
********************************************************************************
*
* The CSD driver is a simple wrapper driver specifically designed to be used
* by higher level middleware. Hence, is highly not recommended to use the CSD
* driver directly in the application program. To incorporate CSD HW block
* functionality in the application program, an associated middleware
* should be used.
*
* The CSD Driver can be used to implement a custom sensing solution. In such
* a case, the application program must acquire and lock the CSD HW block prior
* to accessing it.
*
* Setting up and using the CSD driver can be summed up in these four stages:
* * Define configuration in the config structure.
* * Allocate context structure variable for the driver.
* * Capture the CSD HW block.
* * Execute the action required to perform any kind of conversion.
*
* The following code snippet demonstrates how to capture the CSD HW block for
* custom implementation:
*
* \snippet csd_snippet.c snippet_Cy_CSD_Conversion
*
* The entire solution, like CAPSENSE™ or CSDADC, in addition to
* the CSD HW block, incorporates the following instances:
*
* * \ref group_csd_config_clocks
* * \ref group_csd_config_vref
* * \ref group_csd_config_iref
* * \ref group_csd_config_interrupts
* * \ref group_csd_config_pin
*
* The CSD driver does not configure those blocks and they should be managed by
* an upper level. When using CAPSENSE™ or CSDADC, those blocks are managed by
* middleware.
*
********************************************************************************
* \subsection group_csd_config_clocks Clocks
********************************************************************************
*
* The CSD HW block requires a peripheral clock (clk_peri) input. It can be
* assigned using two methods:
* * Using the Device Configurator (Peripheral-Clocks tab).
* * Using the SysClk (System Clock) driver. Refer to \ref group_sysclk driver
*   section for more details.
* If middleware is used, the clock is managed by middleware.
*
********************************************************************************
* \subsection group_csd_config_pin GPIO Pins
********************************************************************************
*
* Any analog-capable GPIO pin that can be connected to an analog multiplexed
* bus (AMUXBUS) can be connected to the CSD HW block as an input.
*
* GPIO input can be assigned to the CSD HW block using the following methods:
* * Using the Device Configurator (Pins tab).
* * Using the GPIO (General Purpose Input Output) driver. Refer
*   to \ref group_gpio driver section.
*
* If middleware is used, pin configuration is managed by middleware. When
* using the CSD driver for custom implementation, the application program must
* manage pin connections.
*
* Each AMUXBUS can be split into multiple segments. Ensure the CSD HW block
* and a GPIO belong to the same bus segment or join the segments to establish
* connection of the GPIO to the CSD HW block.
*
* For more information about pin configuration, refer to the \ref group_gpio
* driver.
*
********************************************************************************
* \subsection group_csd_config_vref Reference Voltage Input
********************************************************************************
*
* The CSD HW block requires a reference voltage input to generate a programmable
* reference voltage within the CSD HW block. The SRSS is used as the on-chip
* source of the reference voltage.
*
********************************************************************************
* \subsection group_csd_config_iref Reference Current Input
********************************************************************************
*
* The CSD HW block requires a reference current input for the CSD IDACs operation.
* The SRSS is used as the on-chip source of the reference current.
*
********************************************************************************
* \subsection group_csd_config_interrupts Interrupts
********************************************************************************
*
* The CSD HW block has one interrupt. The CSD HW block can generate interrupts
* on the following events:
*
* * End of sample: when scanning of a single sensor is complete.
* * End of initialization: when initialization of an analog circuit is complete.
* * End of measurement: when conversion of an CSDADC channel is complete.
*
* Additionally, the CSD interrupt can wake the device from the Sleep power mode.
* The CSD HW block is powered down in the Deep Sleep power mode.
* So, it cannot be used as a wake-up source in this power mode.
*
* If a CAPSENSE™ is used, the interrupt service routine is managed
* by middleware. When using the CSD driver for custom implementation or other
* middleware, the application program must manage the interrupt service routine.
*
* Implement an interrupt routine and assign it to the CSD interrupt. Use the
* pre-defined enumeration as the interrupt source of the CSD HW block.
* The CSD interrupt to the NVIC is raised any time the intersection
* (logic AND) of the interrupt flags and the corresponding interrupt
* masks are non-zero. The peripheral interrupt status register should be
* read in the ISR to detect which condition generated the interrupt.
* The appropriate interrupt registers should be cleared so that
* subsequent interrupts can be handled.
*
* The following code snippet demonstrates how to implement a routine to handle
* the interrupt. The routine is called when a CSD interrupt is triggered.
*
* \snippet csd_snippet.c snippet_Cy_CSD_IntHandler
*
* The following code snippet demonstrates how to configure and enable
* the CSD interrupt:
*
* \snippet csd_snippet.c snippet_Cy_CSD_IntEnabling
*
* For more information, refer to the \ref group_sysint driver.
*
* Alternatively, instead of handling the interrupts, the
* \ref Cy_CSD_GetConversionStatus() function allows for firmware
* polling of the CSD block status.
*
********************************************************************************
* \section group_csd_config_power_modes Power Modes
********************************************************************************
*
* The CSD HW block can operate in Active and Sleep CPU power modes. It is also
* possible to switch between Low power and Ultra Low power system modes.
* In Deep Sleep power mode, the CSD HW block is powered off.
* When the device wakes up from Deep Sleep, the CSD HW block resumes operation
* without the need for re-initialization.
*
* \note
* 1. The CSD driver does not provide a callback function to facilitate the
*    low-power mode transitions. The responsibility belongs to an upper
*    level that uses the CSD HW block to ensure the CSD HW block is not
*    busy prior to a power mode transition.
* 2. A power mode transition is not recommended while the CSD HW block is busy.
*    The CSD HW block status must be checked using the Cy_CSD_GetStatus()
*    function prior to a power mode transition. Instead, use the same power mode
*    for active operation of the CSD HW block. This restriction is not
*    applicable to Sleep mode and the device can seamlessly enter and exit
*    Sleep mode while the CSD HW block is busy.
*
* \warning
* 1. Do not enter Deep Sleep power mode if the CSD HW block conversion is in
*    progress. Unexpected behavior may occur.
* 2. Analog start up time for the CSD HW block is 10 us. Initiate
*    any kind of conversion only after 10 us from Deep Sleep exit.
*
* Refer to the \ref group_syspm driver for more information about
* low-power mode transitions.
*
********************************************************************************
* \section group_csd_more_information More Information
********************************************************************************
*
* Important information about the CAPSENSE™ technology overview, appropriate
* Infineon device for the design, CAPSENSE™ system and sensor design guidelines,
* different interfaces and tuning guidelines necessary for a successful design
* of a CAPSENSE™ system is available in the Getting Started with CAPSENSE™
* document and the product-specific CAPSENSE™ design guide. Infineon highly
* recommends starting with these documents. They can be found on the
* Infineon web site at www.infineon.com
*
* For more information, refer to the following documents:
*
* * CAPSENSE™ Overview:
*
*   *
*     CAPSENSE™ Middleware Library
*
*   *
*     CAPSENSE™ Middleware API Reference Guide
*
*   *
*     CSDADC Middleware Library
*
*   *
*     CSDADC Middleware API Reference Guide
*
*   *
*     CSDIDAC Middleware Library
*
*   *
*     CSDIDAC Middleware API Reference Guide
*
*   *
*     ModusToolbox™ CAPSENSE™ Configurator Tool Guide
*
*   *
*     ModusToolbox™ CAPSENSE™ Tuner Tool Guide
*
*   *
*     CAPSENSE™ Design Guide
*
* * ModusToolbox™ Overview:
*
*   *
*     ModusToolbox™ Software Environment, Quick Start Guide, Documentation, and Videos
*
*   *
*     ModusToolbox™ Device Configurator Tool Guide
*
* * Infineon Kits:
*
*   *
*     CY8CKIT-145-40XX PSoC™ 4000S CAPSENSE™ Prototyping Kit
*
*   *
*     CY8CKIT-149 PSoC™ 4100S Plus Prototyping Kit
*
*   *
*     CY8CKIT-041-41XX PSoC™ 4100S CAPSENSE™ Pioneer Kit
*
* * General Information:
*
*   *
*     PDL API Reference
*
*   *
*     PSoC™ 4000S Family: PSoC™ 4 Architecture Technical Reference Manual (TRM)
*
*   *
*     PSoC™ 4100S and PSoC™ 4100S Plus: PSoC™ 4 Architecture Technical Reference Manual (TRM)
*
*   * Infineon Technologies GitHub
*
*   * Infineon Technologies
*
* \note
* The links to another software component's documentation (middleware and PDL)
* point to GitHub to the latest available version of the software.
* To get documentation of the specified version, download from GitHub and unzip
* the component archive. The documentation is available in the docs folder.
*
********************************************************************************
* \section group_csd_changelog Changelog
********************************************************************************
*

*
Version	Changes	Reason for Change

*

*     1.10.2
*     Minor documentation updates
*     Documentation improvement
*

*

*     1.10.1
*     Update the paths to the code snippets
*     PDL structure update
*

*

*     1.10
*     Added Cy_CSD_Capture() function
*     CAPSENSE™ memory consumption optimization
*

*

*     1.0
*     The initial version
*
*

*

*/

/** \} group_csd */

/**
********************************************************************************
* \addtogroup group_csd
********************************************************************************
* \{
* \defgroup group_csd_macros                Macros
* \defgroup group_csd_functions             Functions
* \defgroup group_csd_data_structures       Data Structures
* \defgroup group_csd_enums                 Enumerated Types
*/

#if !defined(CY_CSD_H)
#define CY_CSD_H

#include <stdint.h>
#include <stddef.h>
#include "cy_device_headers.h"
#include "cy_syslib.h"

#if defined(CY_IP_M0S8CSDV2)

#if defined(__cplusplus)
extern "C" {
#endif

/**
* \addtogroup group_csd_macros
* \{
*/

/** Driver major version */
#define CY_CSD_DRV_VERSION_MAJOR            (1)

/** Driver minor version */
#define CY_CSD_DRV_VERSION_MINOR            (10)

/** Driver version */
#define CY_CSD_DRV2_VERSION                 (110)

/** Macro to support the backward compatibility. Do not use for new designs. */
#define CY_CSD_DRV_VERSION                  (100)

/******************************************************************************
* API Constants
******************************************************************************/

/** CSD driver identifier */
#define CY_CSD_ID                           (CY_PDL_DRV_ID(0x41U))

/** Initialization macro for the driver context variable */
#define CY_CSD_CONTEXT_INIT_VALUE           {.lockKey = CY_CSD_NONE_KEY}

/** Nominal Vref stored in SFLASH register */
#define CY_CSD_ADC_VREF_2P4                 (2400u)
/** One hundred percentage */
#define CY_CSD_PERCENTAGE_100               (100u)
/** Max deviation for trim */
#define CY_CSD_VREF_TRIM_MAX_DEVIATION      (20u)
/** 8-bit shift */
#define CY_CSD_8_BIT_SHIFT                  (8u)
/** The lowest 8-bit mask */
#define CY_CSD_LSB_MASK                     (0x000000FFu)

/*******************************************************************************
* The CSD HW Block Registers Constants
*******************************************************************************/

/**
* \defgroup group_csd_reg_const Registers Constants
* \{
*/

/** \} group_csd_reg_const */

/** \} group_csd_macros */

/*******************************************************************************
 * Enumerations
 ******************************************************************************/

/**
* \addtogroup group_csd_enums
* \{
*/

/** CSD status definitions */
typedef enum
{
    /** Successful */
    CY_CSD_SUCCESS = 0x00U,

    /** One or more invalid parameters */
    CY_CSD_BAD_PARAM = CY_CSD_ID | CY_PDL_STATUS_ERROR | 0x01U,

    /** The CSD HW block performs conversion */
    CY_CSD_BUSY =  CY_CSD_ID | CY_PDL_STATUS_ERROR | 0x02U,

    /** The CSD HW block is captured by another middleware */
    CY_CSD_LOCKED =  CY_CSD_ID | CY_PDL_STATUS_ERROR | 0x03U

} cy_en_csd_status_t;

/**
* Definitions of upper level keys that use the driver.
*
* Each middleware has a unique key assigned. When middleware successfully
* captures the CSD HW block, this key is placed into the CSD driver context
* structure. All attempts to capture the CSD HW block by other middleware
* are rejected. When the first middleware releases the CSD HW block,
* CY_CSD_NONE_KEY is written to the lockKey variable of the CSD driver context
* structure and any other middleware can capture the CSD HW block.
*/
typedef enum
{
    /** The CSD HW block is unused and not captured by any middleware */
    CY_CSD_NONE_KEY = 0U,

    /**
    * The CSD HW block is captured by the application program
    * directly to implement a customer's specific case
    */
    CY_CSD_USER_DEFINED_KEY = 1U,

    /** The CSD HW block is captured by a CAPSENSE™ middleware */
    CY_CSD_CAPSENSE_KEY = 2U,

    /** The CSD HW block is captured by a CSDADC middleware */
    CY_CSD_ADC_KEY = 3U,

    /** The CSD HW block is captured by a CSDIDAC middleware */
    CY_CSD_IDAC_KEY = 4U,

    /** The CSD HW block is captured by a CMP middleware */
    CY_CSD_CMP_KEY = 5U

}cy_en_csd_key_t;

/** \} group_csd_enums */

/*******************************************************************************
*       Type Definitions
*******************************************************************************/

/**
* \addtogroup group_csd_data_structures
* \{
*/

/**
* CSD configuration structure.
*
* This structure contains all register values of the CSD HW block. This
* structure is provided by middleware through the Cy_CSD_Init() and
* Cy_CSD_Configure() functions to implement the CSD HW block supported
* sensing modes like self-cap / mutual-cap scanning, etc.
*/
typedef struct
{
    uint32_t config;       /**< Stores the CSD.CONFIG register value */
    uint32_t spare;        /**< Stores the CSD.SPARE register value */
    uint32_t status;       /**< Stores the CSD.STATUS register value */
    uint32_t statSeq;      /**< Stores the CSD.STAT_SEQ register value */
    uint32_t statCnts;     /**< Stores the CSD.STAT_CNTS register value */
    uint32_t statHcnt;     /**< Reserved */
    uint32_t resultVal1;   /**< Stores the CSD.RESULT_VAL1 register value */
    uint32_t resultVal2;   /**< Stores the CSD.RESULT_VAL2 register value */
    uint32_t adcRes;       /**< Stores the CSD.ADC_RES register value */
    uint32_t intr;         /**< Stores the CSD.INTR register value */
    uint32_t intrSet;      /**< Stores the CSD.INTR_SET register value */
    uint32_t intrMask;     /**< Stores the CSD.INTR_MASK register value */
    uint32_t intrMasked;   /**< Stores the CSD.INTR_MASKED register value */
    uint32_t hscmp;        /**< Stores the CSD.HSCMP register value */
    uint32_t ambuf;        /**< Stores the CSD.AMBUF register value */
    uint32_t refgen;       /**< Stores the CSD.REFGEN register value */
    uint32_t csdCmp;       /**< Stores the CSD.CSDCMP register value */
    uint32_t swRes;        /**< Stores the CSD.SW_RES register value */
    uint32_t sensePeriod;  /**< Stores the CSD.SENSE_PERIOD register value */
    uint32_t senseDuty;    /**< Stores the CSD.SENSE_DUTY register value */
    uint32_t swHsPosSel;   /**< Stores the CSD.SW_HS_P_SEL register value */
    uint32_t swHsNegSel;   /**< Stores the CSD.SW_HS_N_SEL register value */
    uint32_t swShieldSel;  /**< Stores the CSD.SW_SHIELD_SEL register value */
    uint32_t swAmuxbufSel; /**< Stores the CSD.SW_AMUXBUF_SEL register value */
    uint32_t swBypSel;     /**< Stores the CSD.SW_BYP_SEL register value */
    uint32_t swCmpPosSel;  /**< Stores the CSD.SW_CMP_P_SEL register value */
    uint32_t swCmpNegSel;  /**< Stores the CSD.SW_CMP_N_SEL register value */
    uint32_t swRefgenSel;  /**< Stores the CSD.SW_REFGEN_SEL register value */
    uint32_t swFwModSel;   /**< Stores the CSD.SW_FW_MOD_SEL register value */
    uint32_t swFwTankSel;  /**< Stores the CSD.SW_FW_TANK_SEL register value */
    uint32_t swDsiSel;     /**< Stores the CSD.SW_DSI_SEL register value */
    uint32_t ioSel;        /**< Reserved */
    uint32_t seqTime;      /**< Stores the CSD.SEQ_TIME register value */
    uint32_t seqInitCnt;   /**< Stores the CSD.SEQ_INIT_CNT register value */
    uint32_t seqNormCnt;   /**< Stores the CSD.SEQ_NORM_CNT register value */
    uint32_t adcCtl;       /**< Stores the CSD.ADC_CTL register value */
    uint32_t seqStart;     /**< Stores the CSD.SEQ_START register value */
    uint32_t idacA;        /**< Stores the CSD.IDACA register value */
    uint32_t idacB;        /**< Stores the CSD.IDACB register value */
} cy_stc_csd_config_t;

/**
* CSD driver context structure.
* This structure is an internal structure of the CSD driver and should not be
* accessed directly by the application program.
*/
typedef struct
{
    /** Middleware ID that currently captured CSD */
    cy_en_csd_key_t lockKey;
} cy_stc_csd_context_t;

/** \} group_csd_data_structures */

/**
* \addtogroup group_csd_reg_const
* \{
*/

/** The register offset */
#define CY_CSD_REG_OFFSET_CONFIG            (offsetof(CSD_Type, CONFIG))
/** The register offset */
#define CY_CSD_REG_OFFSET_SPARE             (offsetof(CSD_Type, SPARE))
/** The register offset */
#define CY_CSD_REG_OFFSET_STATUS            (offsetof(CSD_Type, STATUS))
/** The register offset */
#define CY_CSD_REG_OFFSET_STAT_SEQ          (offsetof(CSD_Type, STAT_SEQ))
/** The register offset */
#define CY_CSD_REG_OFFSET_STAT_CNTS         (offsetof(CSD_Type, STAT_CNTS))
/** The register offset */
#define CY_CSD_REG_OFFSET_RESULT_VAL1       (offsetof(CSD_Type, RESULT_VAL1))
/** The register offset */
#define CY_CSD_REG_OFFSET_RESULT_VAL2       (offsetof(CSD_Type, RESULT_VAL2))
/** The register offset */
#define CY_CSD_REG_OFFSET_ADC_RES           (offsetof(CSD_Type, ADC_RES))
/** The register offset */
#define CY_CSD_REG_OFFSET_INTR              (offsetof(CSD_Type, INTR))
/** The register offset */
#define CY_CSD_REG_OFFSET_INTR_SET          (offsetof(CSD_Type, INTR_SET))
/** The register offset */
#define CY_CSD_REG_OFFSET_INTR_MASK         (offsetof(CSD_Type, INTR_MASK))
/** The register offset */
#define CY_CSD_REG_OFFSET_INTR_MASKED       (offsetof(CSD_Type, INTR_MASKED))
/** The register offset */
#define CY_CSD_REG_OFFSET_HSCMP             (offsetof(CSD_Type, HSCMP))
/** The register offset */
#define CY_CSD_REG_OFFSET_AMBUF             (offsetof(CSD_Type, AMBUF))
/** The register offset */
#define CY_CSD_REG_OFFSET_REFGEN            (offsetof(CSD_Type, REFGEN))
/** The register offset */
#define CY_CSD_REG_OFFSET_CSDCMP            (offsetof(CSD_Type, CSDCMP))
/** The register offset */
#define CY_CSD_REG_OFFSET_SW_RES            (offsetof(CSD_Type, SW_RES))
/** The register offset */
#define CY_CSD_REG_OFFSET_SENSE_PERIOD      (offsetof(CSD_Type, SENSE_PERIOD))
/** The register offset */
#define CY_CSD_REG_OFFSET_SENSE_DUTY        (offsetof(CSD_Type, SENSE_DUTY))
/** The register offset */
#define CY_CSD_REG_OFFSET_SW_HS_P_SEL       (offsetof(CSD_Type, SW_HS_P_SEL))
/** The register offset */
#define CY_CSD_REG_OFFSET_SW_HS_N_SEL       (offsetof(CSD_Type, SW_HS_N_SEL))
/** The register offset */
#define CY_CSD_REG_OFFSET_SW_SHIELD_SEL     (offsetof(CSD_Type, SW_SHIELD_SEL))
/** The register offset */
#define CY_CSD_REG_OFFSET_SW_AMUXBUF_SEL    (offsetof(CSD_Type, SW_AMUXBUF_SEL))
/** The register offset */
#define CY_CSD_REG_OFFSET_SW_BYP_SEL        (offsetof(CSD_Type, SW_BYP_SEL))
/** The register offset */
#define CY_CSD_REG_OFFSET_SW_CMP_P_SEL      (offsetof(CSD_Type, SW_CMP_P_SEL))
/** The register offset */
#define CY_CSD_REG_OFFSET_SW_CMP_N_SEL      (offsetof(CSD_Type, SW_CMP_N_SEL))
/** The register offset */
#define CY_CSD_REG_OFFSET_SW_REFGEN_SEL     (offsetof(CSD_Type, SW_REFGEN_SEL))
/** The register offset */
#define CY_CSD_REG_OFFSET_SW_FW_MOD_SEL     (offsetof(CSD_Type, SW_FW_MOD_SEL))
/** The register offset */
#define CY_CSD_REG_OFFSET_SW_FW_TANK_SEL    (offsetof(CSD_Type, SW_FW_TANK_SEL))
/** The register offset */
#define CY_CSD_REG_OFFSET_SW_DSI_SEL        (offsetof(CSD_Type, SW_DSI_SEL))
/** The register offset */
#define CY_CSD_REG_OFFSET_SEQ_TIME          (offsetof(CSD_Type, SEQ_TIME))
/** The register offset */
#define CY_CSD_REG_OFFSET_SEQ_INIT_CNT      (offsetof(CSD_Type, SEQ_INIT_CNT))
/** The register offset */
#define CY_CSD_REG_OFFSET_SEQ_NORM_CNT      (offsetof(CSD_Type, SEQ_NORM_CNT))
/** The register offset */
#define CY_CSD_REG_OFFSET_ADC_CTL           (offsetof(CSD_Type, ADC_CTL))
/** The register offset */
#define CY_CSD_REG_OFFSET_SEQ_START         (offsetof(CSD_Type, SEQ_START))
/** The register offset */
#define CY_CSD_REG_OFFSET_IDACA             (offsetof(CSD_Type, IDACA))
/** The register offset */
#define CY_CSD_REG_OFFSET_IDACB             (offsetof(CSD_Type, IDACB))
/** \} group_csd_reg_const */

/*******************************************************************************
*        Function Prototypes
*******************************************************************************/

/**
* \addtogroup group_csd_functions
* \{
*/

cy_en_csd_status_t Cy_CSD_Init(CSD_Type * base, cy_stc_csd_config_t const * config, cy_en_csd_key_t key, cy_stc_csd_context_t * context);
cy_en_csd_status_t Cy_CSD_DeInit(const CSD_Type * base, cy_en_csd_key_t key, cy_stc_csd_context_t * context);
cy_en_csd_status_t Cy_CSD_Capture(CSD_Type * base, cy_en_csd_key_t key, cy_stc_csd_context_t * context);
cy_en_csd_status_t Cy_CSD_Configure(CSD_Type * base, const cy_stc_csd_config_t * config, cy_en_csd_key_t key, const cy_stc_csd_context_t * context);

__STATIC_INLINE cy_en_csd_key_t Cy_CSD_GetLockStatus(const CSD_Type * base, const cy_stc_csd_context_t * context);
__STATIC_INLINE cy_en_csd_status_t Cy_CSD_GetConversionStatus(const CSD_Type * base, const cy_stc_csd_context_t * context);

uint32_t Cy_CSD_GetVrefTrim(uint32_t referenceVoltage);

__STATIC_INLINE uint32_t Cy_CSD_ReadReg(const CSD_Type * base, uint32_t offset);
__STATIC_INLINE void Cy_CSD_WriteReg(CSD_Type * base, uint32_t offset, uint32_t value);
__STATIC_INLINE void Cy_CSD_SetBits(CSD_Type * base, uint32_t offset, uint32_t mask);
__STATIC_INLINE void Cy_CSD_ClrBits(CSD_Type * base, uint32_t offset, uint32_t mask);
__STATIC_INLINE void Cy_CSD_WriteBits(CSD_Type* base, uint32_t offset, uint32_t mask, uint32_t value);

/*******************************************************************************
* Function Name: Cy_CSD_ReadReg
****************************************************************************//**
*
* Reads value from the specified the CSD HW block register.
*
* \param base
* Pointer to a CSD HW block base address.
*
* \param offset
* Register offset relative to base address.
*
* \return
* Returns a value of the CSD HW block register, specified by the offset
* parameter.
*
*******************************************************************************/
__STATIC_INLINE uint32_t Cy_CSD_ReadReg(const CSD_Type * base, uint32_t offset)
{
    return(* (volatile uint32_t *)((uint32_t)base + offset));
}

/*******************************************************************************
* Function Name: Cy_CSD_WriteReg
****************************************************************************//**
*
* Writes a value to the specified CSD HW block register.
*
* \param base
* Pointer to a CSD HW block base address.
*
* \param offset
* Register offset relative to base address.
*
* \param value
* Value to be written to the register.
*
*******************************************************************************/
__STATIC_INLINE void Cy_CSD_WriteReg(CSD_Type * base, uint32_t offset, uint32_t value)
{
    (* (volatile uint32_t *)((uint32_t)base + offset)) = value;
}

/*******************************************************************************
* Function Name: Cy_CSD_SetBits
****************************************************************************//**
*
* Sets bits, specified by the Mask parameter in the CSD HW block register,
* specified by the Offset parameter.
*
* \param base
* Pointer to a CSD HW block base address.
*
* \param offset
* Register offset relative to base address.
*
* \param mask
* Mask value for register bits to be set.
*
*******************************************************************************/
__STATIC_INLINE void Cy_CSD_SetBits(CSD_Type * base, uint32_t offset, uint32_t mask)
{
    volatile uint32_t * regPtr = (volatile uint32_t *)((uint32_t)base + offset);
    (* regPtr) |= mask;
}

/*******************************************************************************
* Function Name: Cy_CSD_ClrBits
****************************************************************************//**
*
* Clears bits, specified by the Mask parameter in the CSD HW block register,
* specified by the Offset parameter.
*
* \param base
* Pointer to a CSD HW block base address.
*
* \param offset
* Register offset relative to base address.
*
* \param mask
* Mask value for register bits to be cleared.
*
*******************************************************************************/
__STATIC_INLINE void Cy_CSD_ClrBits(CSD_Type * base, uint32_t offset, uint32_t mask)
{
    volatile uint32_t * regPtr = (volatile uint32_t *)((uint32_t)base + offset);
    (* regPtr) &= ~mask;
}

/*******************************************************************************
* Function Name: Cy_CSD_WriteBits
****************************************************************************//**
*
* Writes field, specified by the Mask parameter with the value, specified by
* the Value parameter.
*
* \param base
* Pointer to a CSD HW block base address.
*
* \param offset
* Register offset relative to base address.
*
* \param mask
* Specifies bits to be modified.
*
* \param value
* Specifies a value to be written to the register.
*
*******************************************************************************/
__STATIC_INLINE void Cy_CSD_WriteBits(CSD_Type * base, uint32_t offset, uint32_t mask, uint32_t value)
{
    volatile uint32_t * regPtr = (volatile uint32_t *)((uint32_t)base + offset);
    (* regPtr) = ((* regPtr) & ~mask) | (value & mask);
}

/*******************************************************************************
* Function Name: Cy_CSD_GetLockStatus
****************************************************************************//**
*
* Verifies whether the specified CSD HW block is acquired and locked by a
* higher-level firmware.
*
* \param base
* Pointer to a CSD HW block base address.
*
* \param context
* The pointer to the context structure allocated by a user or middleware.
*
* \return
* Returns a key code. See \ref cy_en_csd_key_t.
*
* \funcusage
*
* \snippet csd_snippet.c snippet_Cy_CSD_CheckKey
*
*******************************************************************************/
__STATIC_INLINE cy_en_csd_key_t Cy_CSD_GetLockStatus(const CSD_Type * base, const cy_stc_csd_context_t * context)
{
    (void)base;
    return(context->lockKey);
}

/*******************************************************************************
* Function Name: Cy_CSD_GetConversionStatus
****************************************************************************//**
*
* Verifies whether the specified CSD HW block is busy
* (performing scan or conversion).
*
* \param base
* Pointer to a CSD HW block base address.
*
* \param context
* The pointer to the context structure allocated by a user or middleware.
*
* \return
* Returns status code. See \ref cy_en_csd_status_t.
*
* \funcusage
*
* \snippet csd_snippet.c snippet_Cy_CSD_CheckStatus
*
*******************************************************************************/
__STATIC_INLINE cy_en_csd_status_t Cy_CSD_GetConversionStatus(const CSD_Type * base, const cy_stc_csd_context_t * context)
{
    cy_en_csd_status_t csdStatus = CY_CSD_BUSY;

    (void)context;
    if (((base->SEQ_START & CSD_SEQ_START_START_Msk) == 0u) &&
        ((base->STAT_SEQ & (CSD_STAT_SEQ_SEQ_STATE_Msk | CSD_STAT_SEQ_ADC_STATE_Msk)) == 0u))
    {
        csdStatus = CY_CSD_SUCCESS;
    }

    return(csdStatus);
}
/** \} group_csd_functions */

/** \} group_csd */

#if defined(__cplusplus)
}
#endif

#endif /* CY_IP_M0S8CSDV2 */

#endif /* CY_CSD_H */

/* [] END OF FILE */


text:
package io.aeron.driver;

import io.aeron.driver.media.SendChannelEndpoint;
import io.aeron.driver.media.UdpChannel;
import org.agrona.concurrent.status.AtomicCounter;

public interface SendChannelEndpointSupplier
{
    SendChannelEndpoint newInstance(UdpChannel udpChannel, AtomicCounter statusIndicator, MediaDriver.Context context);
}


text:
from AccessControl.SecurityInfo import ClassSecurityInfo
from Acquisition import Implicit
from App.class_init import InitializeClass
from OFS.PropertyManager import PropertyManager
from OFS.SimpleItem import SimpleItem
from Products.BeakerSessionDataManager.interfaces import ISessionDataObject
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from Products.Sessions.SessionDataManager import SessionDataManagerErr
from Products.Sessions.SessionDataManager import SessionDataManagerTraverser
from Products.Sessions.SessionPermissions import ACCESS_CONTENTS_PERM
from Products.Sessions.SessionPermissions import ACCESS_SESSIONDATA_PERM
from Products.Sessions.SessionPermissions import ARBITRARY_SESSIONDATA_PERM
from Products.Sessions.interfaces import ISessionDataManager
from ZPublisher.BeforeTraverse import registerBeforeTraverse
from ZPublisher.BeforeTraverse import unregisterBeforeTraverse
from collective.beaker.interfaces import ISession
from six.moves import UserDict
from zope.interface import implementer

import time

@implementer(ISessionDataManager)
class BeakerSessionDataManager(SimpleItem, PropertyManager):
    """Implement a session data manager which uses Beaker sessions."""

    security = ClassSecurityInfo()

    ok = {
        "meta_type": 1,
        "id": 1,
        "title": 1,
        "icon": 1,
        "bobobase_modification_time": 1,
        "title_or_id": 1,
    }
    security.setDefaultAccess(ok)

    def __init__(self, title=""):
        self.title = title

    #
    #   ZMI
    #

    meta_type = "Beaker Session Data Manager"
    _requestSessionName = "SESSION"

    _properties = ({"id": "title", "type": "string", "mode": "w", "label": "Title"},)

    manage_options = PropertyManager.manage_options + SimpleItem.manage_options

    def _session(self):
        """Here's the core logic which looks up the Beaker session."""
        session = ISession(self.REQUEST)
        return BeakerSessionDataObject(session)

    #
    #   ISessionDataManager implementation
    #

    security.declareProtected(ACCESS_SESSIONDATA_PERM, "getSessionData")

    def getSessionData(self, create=1):
        """ """
        return self._session()

    security.declareProtected(ACCESS_SESSIONDATA_PERM, "hasSessionData")

    def hasSessionData(self):
        """ """
        return True

    security.declareProtected(ARBITRARY_SESSIONDATA_PERM, "getSessionDataByKey")

    def getSessionDataByKey(self, key):
        raise SessionDataManagerErr(
            "Beaker session data manager does not support retrieving arbitrary sessions."
        )

    security.declareProtected(ACCESS_CONTENTS_PERM, "getBrowserIdManager")

    def getBrowserIdManager(self):
        """ """
        raise SessionDataManagerErr(
            "Beaker session data manager does not support browser id managers."
        )

    # Traversal hook

    def manage_afterAdd(self, item, container):
        """Add our traversal hook"""
        self.updateTraversalData(self._requestSessionName)

    def manage_beforeDelete(self, item, container):
        """Clean up on delete"""
        self.updateTraversalData(None)

    def updateTraversalData(self, requestSessionName=None):
        # Note this can't be called directly at add -- manage_afterAdd will
        # work though.
        parent = self.aq_inner.aq_parent

        if getattr(self, "_hasTraversalHook", None):
            unregisterBeforeTraverse(parent, "BeakerSessionDataManager")
            del self._hasTraversalHook
            self._requestSessionName = None

        if requestSessionName:
            hook = SessionDataManagerTraverser(requestSessionName, self.id)
            registerBeforeTraverse(parent, hook, "BeakerSessionDataManager", 50)
            self._hasTraversalHook = 1
            self._requestSessionName = requestSessionName

InitializeClass(BeakerSessionDataManager)

def addBeakerSessionDataManager(dispatcher, id, title="", REQUEST=None):
    """Add a BSDM to dispatcher."""
    sdc = BeakerSessionDataManager(title=title)
    sdc._setId(id)
    dispatcher._setObject(id, sdc)
    if REQUEST is not None:  # pragma: no cover
        REQUEST["RESPONSE"].redirect("%s/manage_workspace" % dispatcher.absolute_url())

addBeakerSessionDataManagerForm = PageTemplateFile("www/add_sdm.pt", globals())

def session_mutator(func):
    """Decorator to make a UserDict mutator save the session."""

    def mutating_func(self, *args, **kw):
        res = func(self, *args, **kw)
        self.data.save()
        return res

    return mutating_func

@implementer(ISessionDataObject)
class BeakerSessionDataObject(Implicit):
    """Adapts a beaker session object to the interface expected of Zope sessions."""

    security = ClassSecurityInfo()
    security.setDefaultAccess("allow")
    security.declareObjectPublic()

    def __init__(self, session):
        self.data = self.session = session

    #
    # IMapping methods
    #

    clear = session_mutator(UserDict.clear)
    update = session_mutator(UserDict.update)
    setdefault = session_mutator(UserDict.setdefault)
    pop = session_mutator(UserDict.pop)
    popitem = session_mutator(UserDict.popitem)
    __setitem__ = session_mutator(UserDict.__setitem__)
    __delitem__ = session_mutator(UserDict.__delitem__)
    set = __setitem__
    __guarded_setitem__ = __setitem__
    __guarded_delitem__ = __delitem__
    delete = __delitem__

    def __len__(self):
        try:
            return self.data.__len__()
        except AttributeError:
            return len(self.data.keys())

    #
    # ISessionDataObject
    #

    def getId(self):
        return self.session.id

    def invalidate(self):
        self.session.invalidate()

    def isValid(self):
        return True

    def getCreated(self):
        return time.mktime(self.session["_creation_time"].timetuple())

    getContainerKey = getId

    #
    # compatibility with standard persistent Zope sessions
    #

    def _get_p_changed(self):
        return 1

    def _set_p_changed(self, v):
        if v:
            self.session.save()

    _p_changed = property(_get_p_changed, _set_p_changed)

    # dict API compatibility used by some plone addons e.g. collective.z3cform.wizard

    def has_key(self, key):
        return key in self.session.keys()

    def get(self, key):
        return self.session.get(key)

    def __getitem__(self, key):
        return self.get(key)

InitializeClass(BeakerSessionDataObject)


text:
package colossus.examples

import akka.actor._
import akka.util.ByteString
import colossus.IOSystem
import colossus.core.ServerRef
import colossus.service._
import colossus.protocols.redis._
import scala.concurrent.{Promise, Future}

class KeyValDB extends Actor {

  import KeyValDB._

  val db = collection.mutable.Map[ByteString, ByteString]()

  def receive = {
    case Get(key, promise) => promise.success(db.get(key))
    case Set(key, value, promise) => {
      db(key) = value
      promise.success(())
    }
  }
}

object KeyValDB {
  case class Get(key: ByteString, promise: Promise[Option[ByteString]] = Promise())
  case class Set(key: ByteString, value: ByteString, promise: Promise[Unit] = Promise())
}

object KeyValExample {

  def start(port: Int)(implicit io: IOSystem): ServerRef = {
    import io.actorSystem.dispatcher

    val db = io.actorSystem.actorOf(Props[KeyValDB])

    Service.serve[Redis]("key-value-example", port){ context =>
      context.handle{ connection =>
        import connection.callbackExecutor
        connection.become {
          case Command("GET", args) => {
            val dbCmd = KeyValDB.Get(args(0))
            db ! dbCmd
            Callback.fromFuture(dbCmd.promise.future).map{
              case Some(value) => BulkReply(value)
              case None => NilReply
            }
          }
          case Command("SET", args) => {
            val dbCmd = KeyValDB.Set(args(0), args(1))
            db ! dbCmd
            Callback.fromFuture(dbCmd.promise.future).map{_ =>
              StatusReply("OK")
            }
          }
        }
      }
    }
  }
}


text:
package org.elasticsearch.action.support.master;

import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.ActionRequestBuilder;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.client.ElasticsearchClient;
import org.elasticsearch.common.unit.TimeValue;

/**
 * Base request builder for master node operations
 */
public abstract class MasterNodeOperationRequestBuilder<Request extends MasterNodeRequest<Request>, Response extends ActionResponse,
        RequestBuilder extends MasterNodeOperationRequestBuilder<Request, Response, RequestBuilder>>
        extends ActionRequestBuilder<Request, Response> {

    protected MasterNodeOperationRequestBuilder(ElasticsearchClient client, ActionType<Response> action, Request request) {
        super(client, action, request);
    }

    /**
     * Sets the master node timeout in case the master has not yet been discovered.
     */
    @SuppressWarnings("unchecked")
    public final RequestBuilder setMasterNodeTimeout(TimeValue timeout) {
        request.masterNodeTimeout(timeout);
        return (RequestBuilder) this;
    }

    /**
     * Sets the master node timeout in case the master has not yet been discovered.
     */
    @SuppressWarnings("unchecked")
    public final RequestBuilder setMasterNodeTimeout(String timeout) {
        request.masterNodeTimeout(timeout);
        return (RequestBuilder) this;
    }

}


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#ifndef IOTHUBTRANSPORTAMQP_AMQP_CONNECTION_H
#define IOTHUBTRANSPORTAMQP_AMQP_CONNECTION_H

#include "azure_c_shared_utility/umock_c_prod.h"
#include "azure_c_shared_utility/macro_utils.h"
#include "azure_c_shared_utility/xio.h"
#include "azure_uamqp_c/session.h"
#include "azure_uamqp_c/cbs.h"

#ifdef __cplusplus
extern "C"
{
#endif

#define AMQP_CONNECTION_STATE_VALUES \
    AMQP_CONNECTION_STATE_OPENED,    \
    AMQP_CONNECTION_STATE_CLOSED,    \
    AMQP_CONNECTION_STATE_ERROR

DEFINE_ENUM(AMQP_CONNECTION_STATE, AMQP_CONNECTION_STATE_VALUES);

typedef void(*ON_AMQP_CONNECTION_STATE_CHANGED)(const void* context, AMQP_CONNECTION_STATE old_state, AMQP_CONNECTION_STATE new_state);

typedef struct AMQP_CONNECTION_CONFIG_TAG
{
	const char* iothub_host_fqdn;
	XIO_HANDLE underlying_io_transport;
	bool create_sasl_io;
	bool create_cbs_connection;
	bool is_trace_on;

	ON_AMQP_CONNECTION_STATE_CHANGED on_state_changed_callback;
	const void* on_state_changed_context;
    size_t svc2cl_keep_alive_timeout_secs;
    double cl2svc_keep_alive_send_ratio;
} AMQP_CONNECTION_CONFIG;

typedef struct AMQP_CONNECTION_INSTANCE* AMQP_CONNECTION_HANDLE;

MOCKABLE_FUNCTION(, AMQP_CONNECTION_HANDLE, amqp_connection_create, AMQP_CONNECTION_CONFIG*, config);
MOCKABLE_FUNCTION(, void, amqp_connection_destroy, AMQP_CONNECTION_HANDLE, conn_handle);
MOCKABLE_FUNCTION(, void, amqp_connection_do_work, AMQP_CONNECTION_HANDLE, conn_handle);
MOCKABLE_FUNCTION(, int, amqp_connection_get_session_handle, AMQP_CONNECTION_HANDLE, conn_handle, SESSION_HANDLE*, session_handle);
MOCKABLE_FUNCTION(, int, amqp_connection_get_cbs_handle, AMQP_CONNECTION_HANDLE, conn_handle, CBS_HANDLE*, cbs_handle);
MOCKABLE_FUNCTION(, int, amqp_connection_set_logging, AMQP_CONNECTION_HANDLE, conn_handle, bool, is_trace_on);

#ifdef __cplusplus
}
#endif

#endif /*IOTHUBTRANSPORTAMQP_AMQP_CONNECTION_H*/


text:
//#define LOG_NDEBUG 0
#define LOG_TAG "DrmPassthruPlugIn"
#include <utils/Log.h>

#include <drm/DrmRights.h>
#include <drm/DrmConstraints.h>
#include <drm/DrmMetadata.h>
#include <drm/DrmInfo.h>
#include <drm/DrmInfoEvent.h>
#include <drm/DrmInfoStatus.h>
#include <drm/DrmConvertedStatus.h>
#include <drm/DrmInfoRequest.h>
#include <drm/DrmSupportInfo.h>
#include <DrmPassthruPlugIn.h>

using namespace android;

// This extern "C" is mandatory to be managed by TPlugInManager
extern "C" IDrmEngine* create() {
    return new DrmPassthruPlugIn();
}

// This extern "C" is mandatory to be managed by TPlugInManager
extern "C" void destroy(IDrmEngine* pPlugIn) {
    delete pPlugIn;
    pPlugIn = NULL;
}

DrmPassthruPlugIn::DrmPassthruPlugIn()
    : DrmEngineBase() {

}

DrmPassthruPlugIn::~DrmPassthruPlugIn() {

}

DrmMetadata* DrmPassthruPlugIn::onGetMetadata(int uniqueId, const String8* path) {
    return NULL;
}

DrmConstraints* DrmPassthruPlugIn::onGetConstraints(
        int uniqueId, const String8* path, int action) {
    ALOGV("DrmPassthruPlugIn::onGetConstraints From Path: %d", uniqueId);
    DrmConstraints* drmConstraints = new DrmConstraints();

    String8 value("dummy_available_time");
    char* charValue = NULL;
    charValue = new char[value.length() + 1];
    strncpy(charValue, value.string(), value.length());
    charValue[value.length()] = '\0';

    //Just add dummy available time for verification
    drmConstraints->put(&(DrmConstraints::LICENSE_AVAILABLE_TIME), charValue);
    delete[] charValue;
    return drmConstraints;
}

DrmInfoStatus* DrmPassthruPlugIn::onProcessDrmInfo(int uniqueId, const DrmInfo* drmInfo) {
    ALOGV("DrmPassthruPlugIn::onProcessDrmInfo - Enter : %d", uniqueId);
    DrmInfoStatus* drmInfoStatus = NULL;
    if (NULL != drmInfo) {
        switch (drmInfo->getInfoType()) {
        case DrmInfoRequest::TYPE_REGISTRATION_INFO: {
            const DrmBuffer* emptyBuffer = new DrmBuffer();
            drmInfoStatus = new DrmInfoStatus(DrmInfoStatus::STATUS_OK,
                    DrmInfoRequest::TYPE_REGISTRATION_INFO, emptyBuffer, drmInfo->getMimeType());
            break;
        }
        case DrmInfoRequest::TYPE_UNREGISTRATION_INFO: {
            const DrmBuffer* emptyBuffer = new DrmBuffer();
            drmInfoStatus = new DrmInfoStatus(DrmInfoStatus::STATUS_OK,
                    DrmInfoRequest::TYPE_UNREGISTRATION_INFO, emptyBuffer, drmInfo->getMimeType());
            break;
        }
        case DrmInfoRequest::TYPE_RIGHTS_ACQUISITION_INFO: {
            String8 licenseString("dummy_license_string");
            const int bufferSize = licenseString.size();
            char* data = NULL;
            data = new char[bufferSize];
            memcpy(data, licenseString.string(), bufferSize);
            const DrmBuffer* buffer = new DrmBuffer(data, bufferSize);
            drmInfoStatus = new DrmInfoStatus(DrmInfoStatus::STATUS_OK,
                    DrmInfoRequest::TYPE_RIGHTS_ACQUISITION_INFO, buffer, drmInfo->getMimeType());
            break;
        }
        }
    }
    ALOGV("DrmPassthruPlugIn::onProcessDrmInfo - Exit");
    return drmInfoStatus;
}

status_t DrmPassthruPlugIn::onSetOnInfoListener(
            int uniqueId, const IDrmEngine::OnInfoListener* infoListener) {
    ALOGV("DrmPassthruPlugIn::onSetOnInfoListener : %d", uniqueId);
    return DRM_NO_ERROR;
}

status_t DrmPassthruPlugIn::onInitialize(int uniqueId) {
    ALOGV("DrmPassthruPlugIn::onInitialize : %d", uniqueId);
    return DRM_NO_ERROR;
}

status_t DrmPassthruPlugIn::onTerminate(int uniqueId) {
    ALOGV("DrmPassthruPlugIn::onTerminate : %d", uniqueId);
    return DRM_NO_ERROR;
}

DrmSupportInfo* DrmPassthruPlugIn::onGetSupportInfo(int uniqueId) {
    ALOGV("DrmPassthruPlugIn::onGetSupportInfo : %d", uniqueId);
    DrmSupportInfo* drmSupportInfo = new DrmSupportInfo();
    // Add mimetype's
    drmSupportInfo->addMimeType(String8("application/vnd.passthru.drm"));
    // Add File Suffixes
    drmSupportInfo->addFileSuffix(String8(".passthru"));
    // Add plug-in description
    drmSupportInfo->setDescription(String8("Passthru plug-in"));
    return drmSupportInfo;
}

status_t DrmPassthruPlugIn::onSaveRights(int uniqueId, const DrmRights& drmRights,
            const String8& rightsPath, const String8& contentPath) {
    ALOGV("DrmPassthruPlugIn::onSaveRights : %d", uniqueId);
    return DRM_NO_ERROR;
}

DrmInfo* DrmPassthruPlugIn::onAcquireDrmInfo(int uniqueId, const DrmInfoRequest* drmInfoRequest) {
    ALOGV("DrmPassthruPlugIn::onAcquireDrmInfo : %d", uniqueId);
    DrmInfo* drmInfo = NULL;

    if (NULL != drmInfoRequest) {
        String8 dataString("dummy_acquistion_string");
        int length = dataString.length();
        char* data = NULL;
        data = new char[length];
        memcpy(data, dataString.string(), length);
        drmInfo = new DrmInfo(drmInfoRequest->getInfoType(),
            DrmBuffer(data, length), drmInfoRequest->getMimeType());
    }
    return drmInfo;
}

bool DrmPassthruPlugIn::onCanHandle(int uniqueId, const String8& path) {
    ALOGV("DrmPassthruPlugIn::canHandle: %s ", path.string());
    String8 extension = path.getPathExtension();
    extension.toLower();
    return (String8(".passthru") == extension);
}

String8 DrmPassthruPlugIn::onGetOriginalMimeType(int uniqueId, const String8& path, int fd) {
    ALOGV("DrmPassthruPlugIn::onGetOriginalMimeType() : %d", uniqueId);
    return String8("video/passthru");
}

int DrmPassthruPlugIn::onGetDrmObjectType(
            int uniqueId, const String8& path, const String8& mimeType) {
    ALOGV("DrmPassthruPlugIn::onGetDrmObjectType() : %d", uniqueId);
    return DrmObjectType::UNKNOWN;
}

int DrmPassthruPlugIn::onCheckRightsStatus(int uniqueId, const String8& path, int action) {
    ALOGV("DrmPassthruPlugIn::onCheckRightsStatus() : %d", uniqueId);
    int rightsStatus = RightsStatus::RIGHTS_VALID;
    return rightsStatus;
}

status_t DrmPassthruPlugIn::onConsumeRights(int uniqueId, DecryptHandle* decryptHandle,
            int action, bool reserve) {
    ALOGV("DrmPassthruPlugIn::onConsumeRights() : %d", uniqueId);
    return DRM_NO_ERROR;
}

status_t DrmPassthruPlugIn::onSetPlaybackStatus(int uniqueId, DecryptHandle* decryptHandle,
            int playbackStatus, int64_t position) {
    ALOGV("DrmPassthruPlugIn::onSetPlaybackStatus() : %d", uniqueId);
    return DRM_NO_ERROR;
}

bool DrmPassthruPlugIn::onValidateAction(int uniqueId, const String8& path,
            int action, const ActionDescription& description) {
    ALOGV("DrmPassthruPlugIn::onValidateAction() : %d", uniqueId);
    return true;
}

status_t DrmPassthruPlugIn::onRemoveRights(int uniqueId, const String8& path) {
    ALOGV("DrmPassthruPlugIn::onRemoveRights() : %d", uniqueId);
    return DRM_NO_ERROR;
}

status_t DrmPassthruPlugIn::onRemoveAllRights(int uniqueId) {
    ALOGV("DrmPassthruPlugIn::onRemoveAllRights() : %d", uniqueId);
    return DRM_NO_ERROR;
}

status_t DrmPassthruPlugIn::onOpenConvertSession(int uniqueId, int convertId) {
    ALOGV("DrmPassthruPlugIn::onOpenConvertSession() : %d", uniqueId);
    return DRM_NO_ERROR;
}

DrmConvertedStatus* DrmPassthruPlugIn::onConvertData(
            int uniqueId, int convertId, const DrmBuffer* inputData) {
    ALOGV("DrmPassthruPlugIn::onConvertData() : %d", uniqueId);
    DrmBuffer* convertedData = NULL;

    if (NULL != inputData && 0 < inputData->length) {
        int length = inputData->length;
        char* data = NULL;
        data = new char[length];
        convertedData = new DrmBuffer(data, length);
        memcpy(convertedData->data, inputData->data, length);
    }
    return new DrmConvertedStatus(DrmConvertedStatus::STATUS_OK, convertedData, 0 /*offset*/);
}

DrmConvertedStatus* DrmPassthruPlugIn::onCloseConvertSession(int uniqueId, int convertId) {
    ALOGV("DrmPassthruPlugIn::onCloseConvertSession() : %d", uniqueId);
    return new DrmConvertedStatus(DrmConvertedStatus::STATUS_OK, NULL, 0 /*offset*/);
}

status_t DrmPassthruPlugIn::onOpenDecryptSession(
            int uniqueId, DecryptHandle* decryptHandle, int fd, off64_t offset, off64_t length) {
    ALOGV("DrmPassthruPlugIn::onOpenDecryptSession() : %d", uniqueId);

#ifdef ENABLE_PASSTHRU_DECRYPTION
    decryptHandle->mimeType = String8("video/passthru");
    decryptHandle->decryptApiType = DecryptApiType::ELEMENTARY_STREAM_BASED;
    decryptHandle->status = DRM_NO_ERROR;
    decryptHandle->decryptInfo = NULL;
    return DRM_NO_ERROR;
#endif

    return DRM_ERROR_CANNOT_HANDLE;
}

status_t DrmPassthruPlugIn::onOpenDecryptSession(
            int uniqueId, DecryptHandle* decryptHandle, const char* uri) {
    return DRM_ERROR_CANNOT_HANDLE;
}

status_t DrmPassthruPlugIn::onCloseDecryptSession(int uniqueId, DecryptHandle* decryptHandle) {
    ALOGV("DrmPassthruPlugIn::onCloseDecryptSession() : %d", uniqueId);
    if (NULL != decryptHandle) {
        if (NULL != decryptHandle->decryptInfo) {
            delete decryptHandle->decryptInfo; decryptHandle->decryptInfo = NULL;
        }
        delete decryptHandle; decryptHandle = NULL;
    }
    return DRM_NO_ERROR;
}

status_t DrmPassthruPlugIn::onInitializeDecryptUnit(int uniqueId, DecryptHandle* decryptHandle,
            int decryptUnitId, const DrmBuffer* headerInfo) {
    ALOGV("DrmPassthruPlugIn::onInitializeDecryptUnit() : %d", uniqueId);
    return DRM_NO_ERROR;
}

status_t DrmPassthruPlugIn::onDecrypt(int uniqueId, DecryptHandle* decryptHandle,
            int decryptUnitId, const DrmBuffer* encBuffer, DrmBuffer** decBuffer, DrmBuffer* IV) {
    ALOGV("DrmPassthruPlugIn::onDecrypt() : %d", uniqueId);
    /**
     * As a workaround implementation passthru would copy the given
     * encrypted buffer as it is to decrypted buffer. Note, decBuffer
     * memory has to be allocated by the caller.
     */
    if (NULL != (*decBuffer) && 0 < (*decBuffer)->length) {
        if ((*decBuffer)->length >= encBuffer->length) {
            memcpy((*decBuffer)->data, encBuffer->data, encBuffer->length);
            (*decBuffer)->length = encBuffer->length;
        } else {
            ALOGE("decBuffer size (%d) too small to hold %d bytes",
                (*decBuffer)->length, encBuffer->length);
            return DRM_ERROR_UNKNOWN;
        }
    }
    return DRM_NO_ERROR;
}

status_t DrmPassthruPlugIn::onFinalizeDecryptUnit(
            int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId) {
    ALOGV("DrmPassthruPlugIn::onFinalizeDecryptUnit() : %d", uniqueId);
    return DRM_NO_ERROR;
}

ssize_t DrmPassthruPlugIn::onPread(int uniqueId, DecryptHandle* decryptHandle,
            void* buffer, ssize_t numBytes, off64_t offset) {
    ALOGV("DrmPassthruPlugIn::onPread() : %d", uniqueId);
    return 0;
}


text:
/* eslint-env browser */

import { setChildren } from 'redom';

import Grid from './grid';
import PuyoGameBase from './game-base';

import { NetworkGameEngine } from '../../common/engine';

export default class PuyoEndlessGame extends PuyoGameBase {
  constructor(args) {
    super(args);

    this.el.classList.add('puyo-endless');

    this.playerGrid = null;
  }

  onEstablishConnection({ socket, game, spectating, metadata }) {
    this.engine = NetworkGameEngine.unserialize(game);
    this.engine.installSocket(socket);

    this.playerGrid = new Grid(
      this.engine.currentState,
      false,
      metadata.players[0].name,
      '.endless',
    );
    setChildren(this.el, this.playerGrid);
    if (spectating) {
      this.spectating = true;
    } else {
      this.playerGrid.installEventListeners();
    }
  }

  onClock({ time }) {
    if (!this.isRunning) {
      return;
    }
    while (this.engine.time < time) {
      this.step();
    }
  }

  step() {
    const state = this.engine.step();

    this.playerGrid.update(state);
    this.playerGrid.piece.canPlay = this.engine.callStepper('canPlay');
  }
}


text:
[![DOI](https://zenodo.org/badge/4234/UNH-CORE/RM2-CACTUS.svg)](https://zenodo.org/badge/latestdoi/4234/UNH-CORE/RM2-CACTUS)

This repository contains configuration files and scripts for modeling the
DOE/Sandia RM2 cross-flow turbine with [CACTUS](http://energy.sandia.gov/energy
/renewable-energy/wind-power/wind-resources/wind-software-downloads/cactus-
software-download/). Note that the simulation may require an unreleased,
non-backwards-compatible version of CACTUS, as indicated by the `cactus`
submodule.

## Getting started

Runs are automated and post-processed with Python. It is recommended users
download and install the
[Anaconda Python distribution](http://continuum.io/downloads) (3.5).

This project has been mostly run on Linux. On an Ubuntu-like system, all
non-Python dependencies can be installed with

    sudo apt-get install gfortran libblas-dev liblapack-dev octave

To download and compile CACTUS and related tools along with this repo, execute

    git clone https://github.com/UNH-CORE/RM2-CACTUS.git --recursive

then run

    make cactus

Note that if this repo was cloned without the `--recursive` option, the
submdules can be cloned with

    git submodule update --init --recursive

One additional Python plotting dependency (beyond Anaconda) can be installed
with

    pip install pxl

## Usage

Executing CACTUS is done with `run.py`. To see usage and options, execute

    python run.py -h

A similar script, `plot.py` is used for plotting the results.

### Examples

Run at a single tip speed ratio without dynamic stall:

    python run.py --tsr=3.1 --dynamic-stall=0

Calculate turbine performance curve:

    python run.py -p tsr 1.1 4.7 0.5

Run time step dependence parameter sweep:

    python run.py -p nti 8 65 4

Run parameter sweep for number of blade elements:

    python run.py -p nbelem 4 65 4

Run parameter sweep for free stream velocity:

    python run.py -p u_infty 0.2 2.1 0.2

### Viewing walls

Open `config/walls.xyz` in ParaView using the "Auto Detect Format" and "Multi
Grid" options only.

To visualize the turbine geometry, download and rotate the STL file with
`./scripts/stl.sh`, then open `./figures/turbine-y-up.stl` in ParaView.

## Acknowledgements

Original configuration files (added in
[`e42f3ad3`](https://github.com/UNH-CORE/RM2-CACTUS/commit/e42f3ad36f224e5e59e2d13fc2a9224a132c962b))
from Andrew Murphy Wilson (@awilmurph). The script for creating the wall mesh
(`./scripts/makewalls.py`) was based on one by Phillip Chiu (@whophil), who
implemented the wall panels in CACTUS.

### Foil data

| File name | Reference |
|-----------|-----------|
| `NACA_0021_Sheldahl.dat` | Sheldahl, R. and Klimas, P. (1981) "Aerodynamic Characteristics of Seven Symmetrical Airfoil Sections Through 180-Degrees Angle of Attack for Use in Aerodynamic Analysis of Vertical Axis Wind Turbines". |
| `NACA_0021_Gregorek.csv` | Static data from Gregorek, G. M.; Hoffman, M. J. and Berchak, M. J. (1989) "Steady state and oscillatory aerodynamic characteristics of a NACA 0021 airfoil". Reynolds number values are divided by 1 million. |
| `NACA_0021_Jacobs*.csv` | Lift coefficient data manually digitized from Jacobs (1932) "The aerodynamic characteristics of eight very thick airfoils from tests in the variable density wind tunnel". |
| `NACA_0018_Jacobs*` | Data from Jacobs and Sherman (1937), tabulated in Miley (1982) "A catalog of low Reynolds number airfoil data for wind turbine applications". |
| `NACA_0021_XFOIL*` | Generated by Andrew Wilson. |

## How to cite

This work can be cited via DOI thanks to Zenodo: [![DOI](https://zenodo.org/badge/4234/UNH-CORE/RM2-CACTUS.svg)](https://zenodo.org/badge/latestdoi/4234/UNH-CORE/RM2-CACTUS)

## License

Code licensed under the MIT license. See `LICENSE` for details.
All other materials licensed under a
Creative Commons Attribution 4.0 International License.


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package eu.diversify.ffbpg.evolution;

import eu.diversify.ffbpg.Application;
import eu.diversify.ffbpg.BPGraph;
import eu.diversify.ffbpg.evolution.applications.ApplicationEvolutionOperator;
import eu.diversify.ffbpg.evolution.applications.ChangeForBetterEquitability;
import java.util.ArrayList;
import java.util.Collections;

/**
 *
 * @author ffl
 */
public class ChangeLinksForEquitabilityEvolutionScenario extends ApplicationLinksEvolutionScenario{

    public ChangeLinksForEquitabilityEvolutionScenario() {
        super("Change To Better Equitability Links", null, null);
    }

    ChangeForBetterEquitability operator = new ChangeForBetterEquitability();

    @Override
    public void step(BPGraph graph) {
       ArrayList<Application> apps = (ArrayList<Application>)graph.getApplications().clone();

       int op_count = 0;

       // Try to remove a set of links for each app
       Collections.shuffle(apps);
       for(Application a : apps) {
            if (operator.execute(graph, a)) op_count++;
       }

        System.out.println("Step complete. Operator applied on " + apps.size() +" applications and swaped " + op_count + " links.");

    }

}


text:
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { BootstrapComponent } from './bootstrap.component';
import { ModalsComponent } from './modals/modals.component';
import { ButtonsComponent } from './buttons/buttons.component';
import { FormInputsComponent } from './form-inputs/form-inputs.component';

const routes: Routes = [{
  path: '',
  component: BootstrapComponent,
  children: [
    {
      path: 'inputs',
      component: FormInputsComponent,
    },
    {
      path: 'buttons',
      component: ButtonsComponent,
    },
    {
      path: 'modal',
      component: ModalsComponent,
    },
  ],
}];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class BootstrapRoutingModule { }