text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>FileUtils - FAKE - F# Make</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="Steffen Forkmann, Mauricio Scheffer, Colin Bull">

    <link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet">

    <link type="text/css" rel="stylesheet" href="http://fsharp.github.io/FAKE/content/style.css" />

fsharp.org

github page

FAKE - F# Make

FileUtils

Shell-like functions. Similar to Ruby's FileUtils.

Functions and values

Function or value	Description

            cd path

            Signature: path:string -> unit

Changes working directory

            chdir path

            Signature: path:string -> unit

Changes working directory

            cp src dest

            Signature: src:string -> dest:string -> unit

Like "cp" in a shell. Copies a single file.
<param name="src">The source</param>
<param name="dest">The destination</param>

            cp_r src dest

            Signature: src:string -> dest:string -> unit

Like "cp -r" in a shell. Copies a file or directory recursively.

            mkdir path

            Signature: path:string -> unit

Creates a directory if it doesn't exist.

            mv src dest

            Signature: src:string -> dest:string -> unit

Like "mv" in a shell. Moves/renames a file
<param name="src">The source</param>
<param name="dest">The destination</param>

            pwd ()

            Signature: unit -> string

Gets working directory

            rm fileName

            Signature: fileName:string -> unit

Deletes a file if it exists

            rm_rf f

            Signature: f:string -> unit

Like "rm -rf" in a shell. Removes files recursively, ignoring nonexisting files

FAKE - F# Make

Home page

Get FAKE - F# Make via NuGet

Source Code on GitHub

License (MS-PL)

Release Notes

Contributing to FAKE - F# Make

Who is using FAKE?

Ask a question

Tutorials

Getting started

NuGet package restore

Using FxCop in a build

Generating AssemblyInfo

Create NuGet packages

Running specific targets

Running FAKE from command line

Using the F# compiler from FAKE

Creating custom tasks

TeamCity integration

Running canopy tests

Octopus Deploy

TypeScript support

Fake.Deploy

Reference

API Reference


text:
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Web;
using Revenj.Http;

namespace Revenj.Bench
{
	public partial class Fortunes : IHtmlView
	{
		private readonly static StringBuilder Fake = new StringBuilder(0);
		public Fortunes(List<KeyValuePair<int, string>> arg)
		{
			this._fortunesField = arg;
			this.GenerationEnvironment = Fake;
		}

		private new void Write(string what) { writer.Write(what); }

		public void Show(int what) { writer.Write(what); }
		public void Show(string what) { HttpUtility.HtmlEncode(what, writer); }

		private TextWriter writer;

		public void Render(TextWriter writer)
		{
			this.writer = writer;
			TransformText();
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
class Solution(object):
    def maxProfit(self, prices):
        """
        :type prices: List[int]
        :rtype: int
        """
        maxprofit = 0
        for i in range(1, len(prices)):
            if prices[i] > prices[i - 1]:
                maxprofit += prices[i] - prices[i - 1]
        return maxprofit


text:
<?php

namespace Phalcon\Db;

interface IndexInterface
{

	/**
	 * Phalcon\Db\Index constructor
	 *
	 * @param string $indexName
	 * @param array $columns
	 * @param string $type
	 *
	 */
	public function __construct($indexName, array $columns, $type=null);

	/**
	 * Gets the index name
	 *
	 * @return string
	 */
	public function getName();

	/**
	 * Gets the columns that comprends the index
	 *
	 * @return array
	 */
	public function getColumns();

	/**
	 * Gets the index type
	 *
	 * @return string
	 */
	public function getType();

	/**
	 * Restore a Phalcon\Db\Index object from export
	 *
	 * @param array $data
	 *
	 * @return IndexInterface
	 */
	public static function __set_state(array $data);

}


text:
import dns.rdtypes.nsbase
import dns.immutable

@dns.immutable.immutable
class NSAP_PTR(dns.rdtypes.nsbase.UncompressedNS):

    """NSAP-PTR record"""


text:
{{movie?.title}}

    ...  all the details go here ...

    <button (click)="goToList()" class="btn btn-danger">Back to list</button>


text:
package ros

func systemNote() Command {
	return Command{
		Path:    "/system note",
		Command: "print",
	}
}

func (r *Ros) SystemNote() (map[string]string, error) {
	return r.Values(systemNote())
}

func setSystemNote(note string) Command {
	return Command{
		Path:    "/system note",
		Command: "set",
		Params: map[string]string{
			"note": note,
		},
	}
}

func (r *Ros) SetSystemNote(note string) error {
	return r.Exec(setSystemNote(note))
}

func setSystemNoteShowAtLogin(show bool) Command {
	return Command{
		Path:    "/system note",
		Command: "set",
		Params: map[string]string{
			"show-at-login": FormatBool(show),
		},
	}
}
func (r *Ros) SetSystemNoteShowAtLogin(show bool) error {
	return r.Exec(setSystemNoteShowAtLogin(show))
}


text:
<!DOCTYPE html>
<!--
Copyright (c) 2013 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<link rel="import" href="/tracing/core/test_utils.html">
<link rel="import" href="/tracing/model/event_set.html">
<link rel="import" href="/tracing/model/model.html">
<link rel="import" href="/tracing/ui/analysis/single_event_sub_view.html">
<link rel="import" href="/tracing/ui/base/deep_utils.html">

<script>
'use strict';

tr.b.unittest.testSuite(function() {
  var Model = tr.Model;
  var Thread = tr.model.Thread;
  var EventSet = tr.model.EventSet;
  var newSliceEx = tr.c.test_utils.newSliceEx;

  function createSelection(customizeThreadCallback) {
    var model = tr.c.test_utils.newModelWithEvents([], {
      customizeModelCallback: function(model) {
        var t53 = model.getOrCreateProcess(52).getOrCreateThread(53);
        customizeThreadCallback(t53, model);
      }
    });

    var t53 = model.processes[52].threads[53];
    var t53track = {};
    t53track.thread = t53;

    var selection = new EventSet();
    selection.push(t53.sliceGroup.slices[0]);
    assert.equal(selection.length, 1);

    return selection;
  }

  function createSelectionWithSingleSlice(opt_options) {
    var options = opt_options || {};
    return createSelection(function(t53, model) {
      if (options.withStartStackFrame || options.withEndStackFrame) {
        var fA = tr.c.test_utils.newStackTrace(model, 'cat', ['a1', 'a2']);
        var fB = tr.c.test_utils.newStackTrace(model, 'cat', ['b1', 'b2']);
      }

      var slice = newSliceEx({title: 'b', start: 0, duration: 0.002});
      slice.category = options.withCategory ? 'foo' : '';

      if (options.withStartStackFrame)
        slice.startStackFrame = options.withStartStackFrame === 'a' ? fA : fB;

      if (options.withEndStackFrame)
        slice.endStackFrame = options.withEndStackFrame === 'a' ? fA : fB;

      t53.sliceGroup.pushSlice(slice);
    });
  };

  test('instantiate_withSingleSlice', function() {
    var selection = createSelectionWithSingleSlice();

    var analysisEl = document.createElement('tr-ui-a-single-event-sub-view');
    analysisEl.selection = selection;
    this.addHTMLOutput(analysisEl);
  });

  test('alerts', function() {
    var slice = newSliceEx({title: 'b', start: 0, duration: 0.002});

    var ALERT_INFO_1 = new tr.model.EventInfo(
        'Alert 1', 'Critical alert');

    var alert = new tr.model.Alert(ALERT_INFO_1, 5, [slice]);

    var selection = new EventSet();
    selection.push(slice);

    var analysisEl = document.createElement('tr-ui-a-single-event-sub-view');
    analysisEl.selection = selection;
    this.addHTMLOutput(analysisEl);
  });

  test('instantiate_withSingleSliceWithArg', function() {
    var selection = createSelection(function(t53) {
      var slice = newSliceEx({title: 'my_slice', start: 0, duration: 1.0});
      slice.args = {
        'complex': {
          'b': '2 as a string',
          'c': [3, 4, 5]
        }
      };
      t53.sliceGroup.pushSlice(slice);
    });

    var subView = document.createElement('tr-ui-a-single-event-sub-view');
    subView.selection = selection;
    this.addHTMLOutput(subView);

    var gov = tr.b.findDeepElementMatching(subView,
                                           'tr-ui-a-generic-object-view');
    assert.isDefined(gov);
  });

  test('instantiate_withSingleSliceCategory', function() {
    var selection = createSelectionWithSingleSlice({withCategory: true});

    var analysisEl = document.createElement('tr-ui-a-single-event-sub-view');
    analysisEl.selection = selection;
    this.addHTMLOutput(analysisEl);
  });

  test('instantiate_withSingleStartStackFrame', function() {
    var selection = createSelectionWithSingleSlice(
        {withStartStackFrame: 'a'});

    var analysisEl = document.createElement('tr-ui-a-single-event-sub-view');
    analysisEl.selection = selection;
    this.addHTMLOutput(analysisEl);

    var e = tr.b.findDeepElementWithTextContent(
        analysisEl, /Start Stack Trace/);
    assert.isDefined(e);
    assert.isDefined(e.nextSibling.children[0].stackFrame);
  });

  test('instantiate_withSingleEndStackFrame', function() {
    var selection = createSelectionWithSingleSlice(
        {withEndStackFrame: 'b'});

    var analysisEl = document.createElement('tr-ui-a-single-event-sub-view');
    analysisEl.selection = selection;
    this.addHTMLOutput(analysisEl);

    var e = tr.b.findDeepElementWithTextContent(
        analysisEl, /End Stack Trace/);
    assert.isDefined(e);
    assert.isDefined(e.nextSibling.children[0].stackFrame);
    assert.equal(e.nextSibling.children[0].stackFrame.title, 'b2');
  });

  test('instantiate_withDifferentStartAndEndStackFrames', function() {
    var selection = createSelectionWithSingleSlice(
        {withStartStackFrame: 'a',
         withEndStackFrame: 'b'});

    var analysisEl = document.createElement('tr-ui-a-single-event-sub-view');
    analysisEl.selection = selection;
    this.addHTMLOutput(analysisEl);

    var eA = tr.b.findDeepElementWithTextContent(
        analysisEl, /Start Stack Trace/);
    assert.isDefined(eA);
    assert.isDefined(eA.nextSibling.children[0].stackFrame);
    assert.equal(eA.nextSibling.children[0].stackFrame.title, 'a2');

    var eB = tr.b.findDeepElementWithTextContent(
        analysisEl, /End Stack Trace/);
    assert.isDefined(eB);
    assert.isDefined(eB.nextSibling.children[0].stackFrame);
    assert.equal(eB.nextSibling.children[0].stackFrame.title, 'b2');
  });

  test('instantiate_withSameStartAndEndStackFrames', function() {
    var selection = createSelectionWithSingleSlice(
        {withStartStackFrame: 'a',
         withEndStackFrame: 'a'});

    var analysisEl = document.createElement('tr-ui-a-single-event-sub-view');
    analysisEl.selection = selection;
    this.addHTMLOutput(analysisEl);

    var e = tr.b.findDeepElementWithTextContent(
        analysisEl, /Start\+End Stack Trace/);
    assert.isDefined(e);
    assert.isDefined(e.nextSibling.children[0].stackFrame);
    assert.equal(e.nextSibling.children[0].stackFrame.title, 'a2');
  });

  test('analyzeSelectionWithSingleSlice', function() {
    var selection = createSelectionWithSingleSlice();
    var subView = document.createElement('tr-ui-a-single-event-sub-view');
    subView.selection = selection;
    this.addHTMLOutput(subView);

    var table = tr.b.findDeepElementMatching(
        subView, 'tr-ui-b-table');
    assert.equal(table.tableRows.length, 3);
    assert.equal(table.tableRows[0].value, 'b');
    assert.equal(table.tableRows[1].value.timestamp, 0);
    assert.equal(table.tableRows[2].value.duration, 0.002);
  });

  test('analyzeSelectionWithSingleSliceCategory', function() {
    var selection = createSelectionWithSingleSlice({withCategory: true});

    var subView = document.createElement('tr-ui-a-single-event-sub-view');
    subView.selection = selection;
    this.addHTMLOutput(subView);

    var table = tr.b.findDeepElementMatching(
        subView, 'tr-ui-b-table');
    assert.equal(table.tableRows.length, 4);
    assert.equal(table.tableRows[0].value, 'b');
    assert.equal(table.tableRows[1].value, 'foo');
    assert.equal(table.tableRows[2].value.timestamp, 0);
    assert.equal(table.tableRows[3].value.duration, 0.002);
  });

  test('instantiate_withSingleSliceContainingIDRef', function() {
    var model = new Model();
    var p1 = model.getOrCreateProcess(1);
    var myObjectSlice = p1.objects.addSnapshot(
        '0x1000', 'cat', 'my_object', 0);

    var t1 = p1.getOrCreateThread(1);
    t1.sliceGroup.pushSlice(newSliceEx({title: 'b', start: 0, duration: 2}));
    t1.sliceGroup.slices[0].args.my_object = myObjectSlice;

    var t1track = {};
    t1track.thread = t1;

    var selection = new EventSet();
    selection.push(t1.sliceGroup.slices[0]);
    assert.equal(selection.length, 1);

    var subView = document.createElement('tr-ui-a-single-event-sub-view');
    subView.selection = selection;
    this.addHTMLOutput(subView);

    var analysisLink = tr.b.findDeepElementMatching(subView,
                                                    'tr-ui-a-analysis-link');
    assert.isDefined(analysisLink);
  });

  test('instantiate_withSingleSliceContainingInfo', function() {
    var slice = newSliceEx({title: 'b', start: 0, duration: 1});
    slice.info = new tr.model.EventInfo(
        'Info title', 'Description');

    var selection = new EventSet();
    selection.push(slice);

    var analysisEl = document.createElement('tr-ui-a-single-event-sub-view');
    analysisEl.selection = selection;
    this.addHTMLOutput(analysisEl);
  });
});
</script>


text:
export function parsePullToRefresh (routeOptions) {
  const windowOptions = routeOptions.window

  if (windowOptions.enablePullDownRefresh || (windowOptions.pullToRefresh && windowOptions.pullToRefresh.support)) {
    const pullToRefreshStyles = Object.create(null)
    // 初始化默认值
    if (plus.os.name === 'Android') {
      Object.assign(pullToRefreshStyles, {
        support: true,
        style: 'circle'
      })
    } else {
      Object.assign(pullToRefreshStyles, {
        support: true,
        style: 'default',
        height: '50px',
        range: '200px',
        contentdown: {
          caption: ''
        },
        contentover: {
          caption: ''
        },
        contentrefresh: {
          caption: ''
        }
      })
    }

    if (windowOptions.backgroundTextStyle) {
      pullToRefreshStyles.color = windowOptions.backgroundTextStyle
      pullToRefreshStyles.snowColor = windowOptions.backgroundTextStyle
    }

    Object.assign(pullToRefreshStyles, windowOptions.pullToRefresh || {})

    return pullToRefreshStyles
  }
}


text:
/*
 * User: anna
 * Date: 16-Jan-2008
 */
package com.intellij.ide.util.scopeChooser;

import com.intellij.icons.AllIcons;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.ToggleAction;
import com.intellij.packageDependencies.DependencyUISettings;

public class ShowModuleGroupsAction extends ToggleAction {
  private final Runnable myUpdate;

  public ShowModuleGroupsAction(final Runnable update) {
    super("Show Module Groups",
          "Show/hide module groups", AllIcons.Actions.GroupByModuleGroup);
    myUpdate = update;
  }

  @Override
  public boolean isSelected(AnActionEvent event) {
    return DependencyUISettings.getInstance().UI_SHOW_MODULE_GROUPS;
  }

  @Override
  public void setSelected(AnActionEvent event, boolean flag) {
    DependencyUISettings.getInstance().UI_SHOW_MODULE_GROUPS = flag;
    myUpdate.run();
  }

  @Override
  public void update(final AnActionEvent e) {
    super.update(e);
    e.getPresentation().setEnabled(DependencyUISettings.getInstance().UI_SHOW_MODULES);
  }
}


text:
'use strict';

var app = angular.module('crmApp', [
  'ngRoute',
  'crmApp.services',
  'crmApp.controllers',
  'breeze.angular',
  'breeze.directives',
  'ui.bootstrap'
]).
config(['$routeProvider', function ($routeProvider) {
    $routeProvider
        .when('/customer', {
            templateUrl: 'partials/CustomerList.html',
            controller: 'CustomerListController'
        })
        .when('/customer/:customerId/edit', {
            controller: 'EditCustomerController',
            templateUrl: 'partials/EditCustomer.html'
        })
        .when('/customer/new', {
            controller: 'CreateCustomerController',
            templateUrl: 'partials/EditCustomer.html'
        })
        .otherwise({ redirectTo: '/customer' });
}]).config(['zDirectivesConfigProvider', configDirective]); //configure breeze validation directive

angular.module('crmApp')
       .factory('entityManagerFactory', ['breeze', emFactory]); //breeze service

//Configure the Breeze Validation Directive for bootstrap 3
function configDirective(cfg) {
    // Custom template with warning icon before the error message
    cfg.zValidateTemplate =
       '' +
       ' %error%';
};

function emFactory(breeze) {
    // Convert properties between server-side PascalCase and client-side camelCase
    breeze.NamingConvention.camelCase.setAsDefault();

    // Identify the endpoint for the remote data service
    var serviceName = 'breeze/Customer';

    // the "factory" services exposes two members
    var factory = {
        newManager: function () { return new breeze.EntityManager(serviceName); },
        serviceName: serviceName
    };

    return factory;
};


text:
define(["app", "backbone", "localstorage"], function(Chatter, Backbone, LocalStorage) {
	"use strict";
	var gui = require("nw.gui");
	var version = gui.App.manifest.version;
	var Settings = Backbone.Model.extend({
		modelName: "Settings",
		localStorage: new Backbone.LocalStorage("settings"),
		defaults: {
			notifications: {
				onMessage: false,
				onNotice: true,
				onPM: true,
				sound: true
			},
			channels: {
				hideJoinPart: true,
				quitMessage: "Chatter v" + version + " " + "https://github.com/Jake0oo0/chatter",
				partMessage: "Leaving!"
			},
			window: {
				minimizeToTray: true
			}
		},
		getValue: function(key) {
			var parts;
			if (key.indexOf(".") > -1) {
				parts = key.split(".");
			}
			if (parts) {
				return this.get(parts[0])[parts[1]];
			} else {
				return this.get(key);
			}
		}
	});
	return Settings;
});


text:
/*global AndroidApp*/

import React, { Component } from 'react';
import { connect } from 'react-redux'
import {bindActionCreators} from 'redux';

import { loadFrames } from '../frames/actions'

class Frames extends Component {

  constructor() {
    super()
    this.state = {newFrameName: ''}
    this.selectFrame = this.selectFrame.bind(this);
  }

  componentWillMount() {
    this.props.loadFrames()
  }

  render() {
    return (

Select a Frame

        {this.props.frames.items.map(frame => (
          <li key={`frame${frame.name}`}  className="select-frame-item"><button onClick={() => this.selectFrame(frame)}>{frame.name}</button>

        ))}

)

  }

  selectFrame(frame) {
    const { name, id, access_key } = frame;

    if (typeof AndroidApp !== 'undefined') {

      // We run inside Android WebView with AndroidApp refere to object
      // injected by the Android application.
      AndroidApp.selectFrame(name, id.toString(), access_key)

    } else {

      localStorage.setItem('frameId', id);
      localStorage.setItem('accessKey', access_key);

      // location.pathname = '/frame-client';
    }
  }

}

function mapDispatchToProps(dispatch) {
    return bindActionCreators({loadFrames}, dispatch);
}

function mapStateToProps(state) {
    return {
        frames: state.frames
    };
}

export default connect(
  mapStateToProps,
  mapDispatchToProps
)(Frames)


text:
ReactJS powered multi-system emulator framework, built on modern JavaScript with WebGL

## Design Principles
1. Implement a ReactJS and flux-powered pattern.
  * Keeps menu components completely separate from the underlying emulator.
  * No `document.getElementById()` and especially no `jQuery()` should exist inside of emulator code.
2. Use ArrayBuffer with TypedArrays (e.g. Uint8Array).
  * Quickly and accurately models memory space.
  * Don't `<< 8` and `& 0xFF` all over the place - model registers and memory as the type they are, instead.
3. Use modern WebGL, including pixel shaders, to move as much of the graphical heavy lifting.
  * This is a big advantage of going in-browser: graceful degradation is easier to implement.
  * No need to install 3rd-party rendering libs, either.
4. Speed and playing experience are more important than doing things exactly the same way as the original hardware.
  * Dynamic recompiling should be considered upfront, not as an afterthought.
  * Even if it's more authentic, jittery background scrolling and maximum tiles per line limits should be avoided in favour of a more modern experience.
  * The goal is to provide a performant, enjoyable, modern experience.


text:
import electron from "electron";
const Menu = electron.remote.Menu;

var mainWindow = null;
var appIcon = null;
var menu_array = [];

export default {
	init() {
		mainWindow = electron.remote.getCurrentWindow();
		appIcon = electron.remote.getGlobal('appIcon');

		mainWindow.on('show', this.refreshTrayMenu);
		mainWindow.on('hide', this.refreshTrayMenu);
		this.refreshTrayMenu();
	},
	refreshTrayMenu() {
		var contextMenu = Menu.buildFromTemplate([{
			label: mainWindow.isVisible() ? 'Hide App' : 'Show App',
			click() {
				if (mainWindow.isVisible()) {
					mainWindow.hide();
				} else {
					mainWindow.show();
					if (mainWindow.isMinimized()) mainWindow.restore();
				}
			}
		}, { type: 'separator' }, {
			label: 'Quit',
			click() {
				electron.remote.app.isQuiting = true;
				electron.remote.app.quit();
			}
		}]);

		appIcon.setContextMenu(contextMenu);

		if (mainWindow.isVisible()) {
			mainWindow.setVisibleOnAllWorkspaces(false);
		} else {
			mainWindow.setVisibleOnAllWorkspaces(true);
		}
	},
	setRacks(racks, rackfolder_cb, note_cb) {
		menu_array = [];
		var submenu_element = [];
		var group_num = 0;
		for (var i = 0; i < racks.length; i++) {
			if (racks[i].data.separator) {
				group_num += 1;
				menu_array.push({
					label: 'Rack Group ' + group_num,
					submenu: submenu_element.slice()
				});
				submenu_element = [];
			} else {
				submenu_element.push(this.oneRackMenuItem(racks[i], rackfolder_cb, note_cb));
			}
		}
		if (submenu_element && group_num == 0) {
			menu_array = submenu_element;
		} else if (submenu_element) {
			group_num += 1;
			menu_array.push({
				label: 'Rack Group ' + group_num,
				submenu: submenu_element.slice()
			});
		}
		if (appIcon) this.refreshTrayMenu();
	},
	oneRackMenuItem(rack, rackfolder_cb, note_cb) {
		var folder_array = [];
		if (rack.folders) {
			for (var i = 0; i < rack.folders.length; i++) {
				folder_array.push(this.oneFolderMenuItem(rack.folders[i], rackfolder_cb, note_cb));
			}
		}

		return {
			label: rack.name,
			submenu: folder_array.length > 0 ? folder_array : undefined,
			click: function() {
				if (rackfolder_cb) rackfolder_cb(rack);
			}
		};
	},
	oneFolderMenuItem(folder, rackfolder_cb, note_cb) {
		var note_array = [];
		if (folder.notes) {
			for (var i = 0; i < folder.notes.length; i++) {
				note_array.push(this.oneNoteMenuItem(folder.notes[i], note_cb));
			}
		}

		return {
			label: folder.name,
			submenu: note_array.length > 0 ? note_array : undefined,
			click: function() {
				if (rackfolder_cb) rackfolder_cb(folder);
			}
		};
	},
	oneNoteMenuItem(note, note_cb) {
		return {
			label: note.title,
			click: function() {
				if (!mainWindow.isVisible()) mainWindow.show();
				if (note_cb) note_cb(note);
			}
		};
	}
};


text:
<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

    <EditText
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:hint="Номер группы"
        android:id="@+id/edittext_dialog"
        android:paddingTop="10dp"
        android:layout_alignParentTop="true"
        android:paddingRight="10dp"
        android:paddingBottom="10dp"
        android:password="false"
        android:layout_alignParentRight="true"
        android:layout_alignParentLeft="true"/>
</RelativeLayout>


text:
package org.apache.causeway.commons.internal.ioc;

import org.springframework.beans.factory.ObjectProvider;

import org.apache.causeway.commons.collections.Can;

import lombok.Value;
import lombok.val;

@Value(staticConstructor="of")
final class _ManagedBeanAdapter_Spring implements _ManagedBeanAdapter {

    private final String id;
    private final Class<?> beanClass;
    private final ObjectProvider<?> beanProvider;

    @Override
    public Can<?> getInstance() {
        val allMatchingBeans = beanProvider.stream()
                .collect(Can.toCan());
        return allMatchingBeans;
    }

    @Override
    public boolean isCandidateFor(Class<?> requiredType) {
        return beanProvider.stream()
                .map(Object::getClass)
                .anyMatch(requiredType::isAssignableFrom);
    }

}


text:
package org.scalacoin.protocol.transaction

import org.scalacoin.util.TestUtil
import org.scalatest.{FlatSpec, MustMatchers}

/**
 * Created by chris on 3/30/16.
 */
class TransactionOutPointFactoryTest extends FlatSpec with MustMatchers  {

  "TransactionOutPointFactory" must "create an outpoint from its base components" in {
    val outPoint = TransactionOutPoint(TestUtil.parentSimpleTransaction.outputs(0), TestUtil.parentSimpleTransaction)
    outPoint.vout must be (0)
    outPoint.txId must be (TestUtil.parentSimpleTransaction.txId)
  }

  it must "throw an exception if the given output is not part of the given transaciton" in {
    intercept[RuntimeException] {
      val outPoint = TransactionOutPoint(TestUtil.simpleTransaction.outputs(0), TestUtil.parentSimpleTransaction)
    }
  }
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information

namespace DotNetNuke.Tests.Core.Providers.Folder
{
    using System;
    using System.IO;
    using System.Linq;

    using DotNetNuke.Common.Utilities;
    using DotNetNuke.Services.FileSystem;
    using DotNetNuke.Services.FileSystem.Internal;
    using DotNetNuke.Tests.Utilities;
    using DotNetNuke.Tests.Utilities.Mocks;
    using Moq;
    using NUnit.Framework;

    [TestFixture]
    public class SecureFolderProviderTests
    {
        private SecureFolderProvider _sfp;
        private Mock<IFolderInfo> _folderInfo;
        private Mock<IFileInfo> _fileInfo;
        private Mock<IFile> _fileWrapper;
        private Mock<IDirectory> _directoryWrapper;
        private Mock<IFolderManager> _folderManager;
        private Mock<IFileManager> _fileManager;
        private Mock<IPathUtils> _pathUtils;

        [SetUp]
        public void Setup()
        {
            this._sfp = new SecureFolderProvider();
            this._folderInfo = new Mock<IFolderInfo>();
            this._fileInfo = new Mock<IFileInfo>();
            this._fileWrapper = new Mock<IFile>();
            this._directoryWrapper = new Mock<IDirectory>();
            this._folderManager = new Mock<IFolderManager>();
            this._fileManager = new Mock<IFileManager>();
            this._pathUtils = new Mock<IPathUtils>();

            FileWrapper.RegisterInstance(this._fileWrapper.Object);
            DirectoryWrapper.RegisterInstance(this._directoryWrapper.Object);
            FolderManager.RegisterInstance(this._folderManager.Object);
            FileManager.RegisterInstance(this._fileManager.Object);
            PathUtils.RegisterInstance(this._pathUtils.Object);
        }

        [TearDown]
        public void TearDown()
        {
            MockComponentProvider.ResetContainer();
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void AddFile_Throws_On_Null_Folder()
        {
            var stream = new Mock<Stream>();

            this._sfp.AddFile(null, Constants.FOLDER_ValidFileName, stream.Object);
        }

        [Test]
        [TestCase(null)]
        [TestCase("")]
        [ExpectedException(typeof(ArgumentException))]
        public void AddFile_Throws_On_NullOrEmpty_FileName(string fileName)
        {
            var stream = new Mock<Stream>();

            this._sfp.AddFile(this._folderInfo.Object, fileName, stream.Object);
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void AddFile_Throws_On_Null_Content()
        {
            this._sfp.AddFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, null);
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void DeleteFile_Throws_On_Null_File()
        {
            this._sfp.DeleteFile(null);
        }

        [Test]
        public void DeleteFile_Calls_FileWrapper_Delete_When_File_Exists()
        {
            this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath);

            this._fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidSecureFilePath)).Returns(true);

            this._sfp.DeleteFile(this._fileInfo.Object);

            this._fileWrapper.Verify(fw => fw.Delete(Constants.FOLDER_ValidSecureFilePath), Times.Once());
        }

        [Test]
        public void DeleteFile_Does_Not_Call_FileWrapper_Delete_When_File_Does_Not_Exists()
        {
            this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath);

            this._fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidFilePath)).Returns(false);

            this._sfp.DeleteFile(this._fileInfo.Object);

            this._fileWrapper.Verify(fw => fw.Delete(Constants.FOLDER_ValidFilePath), Times.Never());
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void ExistsFile_Throws_On_Null_Folder()
        {
            this._sfp.FileExists(null, Constants.FOLDER_ValidFileName);
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void ExistsFile_Throws_On_Null_FileName()
        {
            this._sfp.FileExists(this._folderInfo.Object, null);
        }

        [Test]
        public void ExistsFile_Calls_FileWrapper_Exists()
        {
            this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath);

            this._sfp.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName);

            this._fileWrapper.Verify(fw => fw.Exists(Constants.FOLDER_ValidSecureFilePath), Times.Once());
        }

        [Test]
        public void ExistsFile_Returns_True_When_File_Exists()
        {
            this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath);

            this._fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidSecureFilePath)).Returns(true);

            var result = this._sfp.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName);

            Assert.IsTrue(result);
        }

        [Test]
        public void ExistsFile_Returns_False_When_File_Does_Not_Exist()
        {
            this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath);

            this._fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidSecureFilePath)).Returns(false);

            var result = this._sfp.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName);

            Assert.IsFalse(result);
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void ExistsFolder_Throws_On_Null_FolderMapping()
        {
            this._sfp.FolderExists(Constants.FOLDER_ValidFolderPath, null);
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void ExistsFolder_Throws_On_Null_FolderPath()
        {
            var folderMapping = new FolderMappingInfo();

            this._sfp.FolderExists(null, folderMapping);
        }

        [Test]
        public void ExistsFolder_Calls_DirectoryWrapper_Exists()
        {
            var folderMapping = new FolderMappingInfo { PortalID = Constants.CONTENT_ValidPortalId };

            this._pathUtils.Setup(pu => pu.GetPhysicalPath(folderMapping.PortalID, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath);

            this._sfp.FolderExists(Constants.FOLDER_ValidFolderRelativePath, folderMapping);

            this._directoryWrapper.Verify(dw => dw.Exists(Constants.FOLDER_ValidFolderPath), Times.Once());
        }

        [Test]
        public void ExistsFolder_Returns_True_When_Folder_Exists()
        {
            var folderMapping = new FolderMappingInfo { PortalID = Constants.CONTENT_ValidPortalId };

            this._pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath);

            this._directoryWrapper.Setup(dw => dw.Exists(Constants.FOLDER_ValidFolderPath)).Returns(true);

            var result = this._sfp.FolderExists(Constants.FOLDER_ValidFolderRelativePath, folderMapping);

            Assert.IsTrue(result);
        }

        [Test]
        public void ExistsFolder_Returns_False_When_Folder_Does_Not_Exist()
        {
            var folderMapping = new FolderMappingInfo { PortalID = Constants.CONTENT_ValidPortalId };

            this._pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath);

            this._directoryWrapper.Setup(dw => dw.Exists(Constants.FOLDER_ValidFolderPath)).Returns(false);

            var result = this._sfp.FolderExists(Constants.FOLDER_ValidFolderRelativePath, folderMapping);

            Assert.IsFalse(result);
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void GetFileAttributes_Throws_On_Null_File()
        {
            this._sfp.GetFileAttributes(null);
        }

        [Test]
        public void GetFileAttributes_Calls_FileWrapper_GetAttributes()
        {
            this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath);

            this._sfp.GetFileAttributes(this._fileInfo.Object);

            this._fileWrapper.Verify(fw => fw.GetAttributes(Constants.FOLDER_ValidSecureFilePath), Times.Once());
        }

        [Test]
        public void GetFileAttributes_Returns_File_Attributes_When_File_Exists()
        {
            var expectedFileAttributes = FileAttributes.Normal;

            this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath);

            this._fileWrapper.Setup(fw => fw.GetAttributes(Constants.FOLDER_ValidSecureFilePath)).Returns(expectedFileAttributes);

            var result = this._sfp.GetFileAttributes(this._fileInfo.Object);

            Assert.AreEqual(expectedFileAttributes, result);
        }

        [Test]
        public void GetFileAttributes_Returns_Null_When_File_Does_Not_Exist()
        {
            this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath);

            this._fileWrapper.Setup(fw => fw.GetAttributes(Constants.FOLDER_ValidSecureFilePath)).Throws<FileNotFoundException>();

            var result = this._sfp.GetFileAttributes(this._fileInfo.Object);

            Assert.IsNull(result);
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void GetFiles_Throws_On_Null_Folder()
        {
            this._sfp.GetFiles(null);
        }

        [Test]
        public void GetFiles_Calls_DirectoryWrapper_GetFiles()
        {
            this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath);

            this._sfp.GetFiles(this._folderInfo.Object);

            this._directoryWrapper.Verify(dw => dw.GetFiles(Constants.FOLDER_ValidFolderPath));
        }

        [Test]
        public void GetFiles_Count_Equals_DirectoryWrapper_GetFiles_Count()
        {
            this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath);

            var filesReturned = new string[] { "C:\\folder\\file1.txt.resources", "C:\\folder\\file2.txt.resources", "C:\\folder\\file3.txt.resources" };

            this._directoryWrapper.Setup(dw => dw.GetFiles(Constants.FOLDER_ValidFolderPath)).Returns(filesReturned);

            var files = this._sfp.GetFiles(this._folderInfo.Object);

            Assert.AreEqual(filesReturned.Length, files.Length);
        }

        [Test]
        public void GetFiles_Return_Valid_FileNames_When_Folder_Contains_Files()
        {
            this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath);

            var filesReturned = new string[] { "C:\\folder\\file1.txt.resources", "C:\\folder\\file2.txt.resources", "C:\\folder\\file3.txt.resources" };
            var expectedValues = new string[] { "file1.txt", "file2.txt", "file3.txt" };

            this._directoryWrapper.Setup(dw => dw.GetFiles(Constants.FOLDER_ValidFolderPath)).Returns(filesReturned);

            var files = this._sfp.GetFiles(this._folderInfo.Object);

            CollectionAssert.AreEqual(expectedValues, files);
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void GetFileStream_Throws_On_Null_Folder()
        {
            this._sfp.GetFileStream(null, Constants.FOLDER_ValidFileName);
        }

        [Test]
        [ExpectedException(typeof(ArgumentException))]
        public void GetFileStream_Throws_On_Null_FileName()
        {
            this._sfp.GetFileStream(this._folderInfo.Object, null);
        }

        [Test]
        public void GetFileStream_Calls_FileWrapper_OpenRead()
        {
            this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath);

            this._sfp.GetFileStream(this._folderInfo.Object, Constants.FOLDER_ValidFileName);

            this._fileWrapper.Verify(fw => fw.OpenRead(Constants.FOLDER_ValidSecureFilePath), Times.Once());
        }

        [Test]
        public void GetFileStream_Returns_Valid_Stream_When_File_Exists()
        {
            var validFileBytes = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
            var memoryStream = new MemoryStream(validFileBytes);

            this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath);

            this._fileWrapper.Setup(fw => fw.OpenRead(Constants.FOLDER_ValidSecureFilePath)).Returns(memoryStream);

            var result = this._sfp.GetFileStream(this._folderInfo.Object, Constants.FOLDER_ValidFileName);

            byte[] resultBytes;
            var buffer = new byte[16 * 1024];
            using (var ms = new MemoryStream())
            {
                int read;
                while ((read = result.Read(buffer, 0, buffer.Length)) > 0)
                {
                    ms.Write(buffer, 0, read);
                }

                resultBytes = ms.ToArray();
            }

            Assert.AreEqual(validFileBytes, resultBytes);
        }

        [Test]
        public void GetFileStream_Returns_Null_When_File_Does_Not_Exist()
        {
            this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath);

            this._fileWrapper.Setup(fw => fw.OpenRead(Constants.FOLDER_ValidSecureFilePath)).Throws<FileNotFoundException>();

            var result = this._sfp.GetFileStream(this._folderInfo.Object, Constants.FOLDER_ValidFileName);

            Assert.IsNull(result);
        }

        [Test]
        public void GetImageUrl_Calls_IconControllerWrapper_IconURL()
        {
            var iconControllerWrapper = new Mock<IIconController>();
            IconControllerWrapper.RegisterInstance(iconControllerWrapper.Object);

            this._sfp.GetFolderProviderIconPath();

            iconControllerWrapper.Verify(icw => icw.IconURL("FolderSecure", "32x32"), Times.Once());
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void GetLastModificationTime_Throws_On_Null_File()
        {
            this._sfp.GetLastModificationTime(null);
        }

        [Test]
        public void GetLastModificationTime_Calls_FileWrapper_GetLastWriteTime()
        {
            this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath);

            this._sfp.GetLastModificationTime(this._fileInfo.Object);

            this._fileWrapper.Verify(fw => fw.GetLastWriteTime(Constants.FOLDER_ValidSecureFilePath), Times.Once());
        }

        [Test]
        public void GetLastModificationTime_Returns_Valid_Date_When_File_Exists()
        {
            var expectedDate = DateTime.Now;

            this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath);

            this._fileWrapper.Setup(fw => fw.GetLastWriteTime(Constants.FOLDER_ValidSecureFilePath)).Returns(expectedDate);

            var result = this._sfp.GetLastModificationTime(this._fileInfo.Object);

            Assert.AreEqual(expectedDate, result);
        }

        [Test]
        public void GetLastModificationTime_Returns_Null_Date_When_File_Does_Not_Exist()
        {
            var expectedDate = Null.NullDate;

            this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath);

            this._fileWrapper.Setup(fw => fw.GetLastWriteTime(Constants.FOLDER_ValidSecureFilePath)).Throws<FileNotFoundException>();

            var result = this._sfp.GetLastModificationTime(this._fileInfo.Object);

            Assert.AreEqual(expectedDate, result);
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void GetSubFolders_Throws_On_Null_FolderMapping()
        {
            this._sfp.GetSubFolders(Constants.FOLDER_ValidFolderPath, null).ToList();
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void GetSubFolders_Throws_On_Null_FolderPath()
        {
            var folderMapping = new FolderMappingInfo();

            this._sfp.GetSubFolders(null, folderMapping).ToList();
        }

        [Test]
        public void GetSubFolders_Calls_DirectoryWrapper_GetFiles()
        {
            var folderMapping = new FolderMappingInfo { PortalID = Constants.CONTENT_ValidPortalId };

            this._pathUtils.Setup(pu => pu.GetPhysicalPath(folderMapping.PortalID, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath);

            this._sfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList();

            this._directoryWrapper.Verify(dw => dw.GetDirectories(Constants.FOLDER_ValidFolderPath), Times.Once());
        }

        [Test]
        public void GetSubFolders_Count_Equals_DirectoryWrapper_GetDirectories_Count()
        {
            var folderMapping = new FolderMappingInfo { PortalID = Constants.CONTENT_ValidPortalId };

            this._pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath);
            this._pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidSubFolderPath)).Returns(Constants.FOLDER_ValidSubFolderRelativePath);
            this._pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_OtherValidSubFolderPath)).Returns(Constants.FOLDER_OtherValidSubFolderRelativePath);

            var subFolders = new[]
            {
                Constants.FOLDER_ValidSubFolderPath,
                Constants.FOLDER_OtherValidSubFolderPath,
            };

            this._directoryWrapper.Setup(dw => dw.GetDirectories(Constants.FOLDER_ValidFolderPath)).Returns(subFolders);

            var result = this._sfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList();

            Assert.AreEqual(subFolders.Length, result.Count);
        }

        [Test]
        public void GetSubFolders_Returns_Valid_SubFolders_When_Folder_Is_Not_Empty()
        {
            var expectedSubFolders = new[]
            {
                Constants.FOLDER_ValidSubFolderRelativePath,
                Constants.FOLDER_OtherValidSubFolderRelativePath,
            };

            var folderMapping = new FolderMappingInfo { PortalID = Constants.CONTENT_ValidPortalId };

            this._pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath);
            this._pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidSubFolderPath)).Returns(Constants.FOLDER_ValidSubFolderRelativePath);
            this._pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_OtherValidSubFolderPath)).Returns(Constants.FOLDER_OtherValidSubFolderRelativePath);

            var subFolders = new[]
            {
                Constants.FOLDER_ValidSubFolderPath,
                Constants.FOLDER_OtherValidSubFolderPath,
            };

            this._directoryWrapper.Setup(dw => dw.GetDirectories(Constants.FOLDER_ValidFolderPath)).Returns(subFolders);

            var result = this._sfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList();

            CollectionAssert.AreEqual(expectedSubFolders, result);
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void IsInSync_Throws_On_Null_File()
        {
            this._sfp.IsInSync(null);
        }

        [Test]
        public void IsInSync_Returns_True_When_File_Is_In_Sync()
        {
            this._fileInfo.Setup(fi => fi.SHA1Hash).Returns(Constants.FOLDER_UnmodifiedFileHash);

            var sfp = new Mock<SecureFolderProvider> { CallBase = true };
            sfp.Setup(fp => fp.GetHash(this._fileInfo.Object)).Returns(Constants.FOLDER_UnmodifiedFileHash);

            var result = sfp.Object.IsInSync(this._fileInfo.Object);

            Assert.IsTrue(result);
        }

        [Test]
        public void IsInSync_Returns_True_When_File_Is_Not_In_Sync()
        {
            this._fileInfo.Setup(fi => fi.SHA1Hash).Returns(Constants.FOLDER_UnmodifiedFileHash);

            var sfp = new Mock<SecureFolderProvider> { CallBase = true };
            sfp.Setup(fp => fp.GetHash(this._fileInfo.Object)).Returns(Constants.FOLDER_ModifiedFileHash);

            var result = sfp.Object.IsInSync(this._fileInfo.Object);

            Assert.IsTrue(result);
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void RenameFile_Throws_On_Null_File()
        {
            this._sfp.RenameFile(null, Constants.FOLDER_ValidFileName);
        }

        [Test]
        [TestCase(null)]
        [TestCase("")]
        [ExpectedException(typeof(ArgumentException))]
        public void RenameFile_Throws_On_NullOrEmpty_NewFileName(string newFileName)
        {
            this._sfp.RenameFile(this._fileInfo.Object, newFileName);
        }

        [Test]
        public void RenameFile_Calls_FileWrapper_Move_When_FileNames_Are_Not_Equal()
        {
            this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath);
            this._fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName);
            this._fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId);
            this._folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(this._folderInfo.Object);
            this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath);

            this._sfp.RenameFile(this._fileInfo.Object, Constants.FOLDER_OtherValidFileName);

            this._fileWrapper.Verify(fw => fw.Move(Constants.FOLDER_ValidSecureFilePath, Constants.FOLDER_OtherValidSecureFilePath), Times.Once());
        }

        [Test]
        public void RenameFile_Does_Not_Call_FileWrapper_Move_When_FileNames_Are_Equal()
        {
            this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath);
            this._fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName);

            this._sfp.RenameFile(this._fileInfo.Object, Constants.FOLDER_ValidFileName);

            this._fileWrapper.Verify(fw => fw.Move(It.IsAny<string>(), It.IsAny<string>()), Times.Never());
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void SetFileAttributes_Throws_On_Null_File()
        {
            this._sfp.SetFileAttributes(null, FileAttributes.Archive);
        }

        [Test]
        public void SetFileAttributes_Calls_FileWrapper_SetAttributes()
        {
            const FileAttributes validFileAttributes = FileAttributes.Archive;

            this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath);

            this._sfp.SetFileAttributes(this._fileInfo.Object, validFileAttributes);

            this._fileWrapper.Verify(fw => fw.SetAttributes(Constants.FOLDER_ValidSecureFilePath, validFileAttributes), Times.Once());
        }

        [Test]
        public void SupportsFileAttributes_Returns_True()
        {
            var result = this._sfp.SupportsFileAttributes();

            Assert.IsTrue(result);
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void UpdateFile_Throws_On_Null_Folder()
        {
            var stream = new Mock<Stream>();

            this._sfp.UpdateFile(null, Constants.FOLDER_ValidFileName, stream.Object);
        }

        [Test]
        [TestCase(null)]
        [TestCase("")]
        [ExpectedException(typeof(ArgumentException))]
        public void UpdateFile_Throws_On_NullOrEmpty_FileName(string fileName)
        {
            var stream = new Mock<Stream>();

            this._sfp.UpdateFile(this._folderInfo.Object, fileName, stream.Object);
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void UpdateFile_Throws_On_Null_Content()
        {
            this._sfp.UpdateFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, null);
        }

        [Test]
        public void UpdateFile_Calls_FileWrapper_Delete_When_File_Exists()
        {
            this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath);

            this._fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidSecureFilePath)).Returns(true);

            var stream = new Mock<Stream>();

            this._sfp.UpdateFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, stream.Object);

            this._fileWrapper.Verify(fw => fw.Delete(Constants.FOLDER_ValidSecureFilePath), Times.Once());
        }

        [Test]
        public void UpdateFile_Calls_FileWrapper_Create()
        {
            this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath);

            this._fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidSecureFilePath)).Returns(false);

            var stream = new Mock<Stream>();

            this._sfp.UpdateFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, stream.Object);

            this._fileWrapper.Verify(fw => fw.Create(Constants.FOLDER_ValidSecureFilePath), Times.Once());
        }
    }
}


text:
package quotaservice

import (
	"context"
	"fmt"
	"math/rand"
	"net/http"
	"sort"
	"sync"
	"time"

	"github.com/pkg/errors"
	"github.com/square/quotaservice/admin"
	"github.com/square/quotaservice/config"
	"github.com/square/quotaservice/events"
	"github.com/square/quotaservice/lifecycle"
	"github.com/square/quotaservice/logging"
	pb "github.com/square/quotaservice/protos/config"
	"github.com/square/quotaservice/stats"
)

// Implements the quotaservice.Server interface
type server struct {
	currentStatus     lifecycle.Status
	bucketContainer   *bucketContainer
	bucketFactory     BucketFactory
	rpcEndpoints      []RpcEndpoint
	listener          events.Listener
	statsListener     stats.Listener
	eventQueueBufSize int
	maxJitterMillis   int
	producer          *events.EventProducer
	cfgs              *pb.ServiceConfig
	persister         config.ConfigPersister
	reaperConfig      config.ReaperConfig
	sync.RWMutex      // Embedded mutex
}

func (s *server) String() string {
	return fmt.Sprintf("Quota Server running with status %v", s.currentStatus)
}

func (s *server) Start() (bool, error) {
	bufSize := s.eventQueueBufSize

	if bufSize < 1 {
		bufSize = 1
	}

	// Set up listeners
	s.producer = events.RegisterListener(func(e events.Event) {
		if s.listener != nil {
			s.listener(e)
		}

		if s.statsListener != nil {
			s.statsListener.HandleEvent(e)
		}
	}, bufSize)

	logging.Printf("Creating bucket container")
	s.createBucketContainer()
	logging.Printf("Creating bucket container: OK")

	logging.Printf("Waiting for persister to start")
	<-s.persister.ConfigChangedWatcher()
	logging.Printf("Waiting for persister to start: OK")

	logging.Printf("Reading latest config")
	s.readUpdatedConfig(0)
	logging.Printf("Reading latest config: OK")

	go s.configListener(s.persister.ConfigChangedWatcher())

	// Start the RPC servers
	logging.Printf("Starting RPC servers")
	for _, rpcServer := range s.rpcEndpoints {
		rpcServer.Init(s)
		rpcServer.Start()
	}
	logging.Printf("Starting RPC servers: OK")

	s.currentStatus = lifecycle.Started
	return true, nil
}

func (s *server) Stop() (bool, error) {
	s.currentStatus = lifecycle.Stopped

	// Stop the RPC servers
	for _, rpcServer := range s.rpcEndpoints {
		rpcServer.Stop()
	}

	// Referencing s.bucketContainer should be guarded
	s.RLock()
	defer s.RUnlock()
	s.bucketContainer.Stop()
	return true, nil
}

func (s *server) Allow(ctx context.Context, namespace, name string, tokensRequested int64, maxWaitMillisOverride int64, maxWaitTimeOverride bool) (time.Duration, bool, error) {
	s.RLock()
	b, e := s.bucketContainer.FindBucket(namespace, name)
	s.RUnlock()

	if e != nil {
		// Attempted to create a dynamic bucket and failed.
		s.Emit(events.NewBucketMissedEvent(namespace, name, true))
		return 0, true, newError("Cannot create dynamic bucket "+config.FullyQualifiedName(namespace, name), ER_TOO_MANY_BUCKETS)
	}

	if b == nil {
		s.Emit(events.NewBucketMissedEvent(namespace, name, false))
		return 0, false, newError("No such bucket "+config.FullyQualifiedName(namespace, name), ER_NO_BUCKET)
	}

	if b.Config().MaxTokensPerRequest < tokensRequested && b.Config().MaxTokensPerRequest > 0 {
		s.Emit(events.NewTooManyTokensRequestedEvent(namespace, name, b.Dynamic(), tokensRequested))
		return 0, b.Dynamic(), newError(fmt.Sprintf("Too many tokens requested. Bucket %v:%v, tokensRequested=%v, maxTokensPerRequest=%v",
			namespace, name, tokensRequested, b.Config().MaxTokensPerRequest),
			ER_TOO_MANY_TOKENS_REQUESTED)
	}

	maxWaitTime := time.Millisecond
	if maxWaitTimeOverride && maxWaitMillisOverride < b.Config().WaitTimeoutMillis {
		// Use the max wait time override from the request.
		maxWaitTime *= time.Duration(maxWaitMillisOverride)
	} else {
		// Fall back to the max wait time configured on the bucket.
		maxWaitTime *= time.Duration(b.Config().WaitTimeoutMillis)
	}

	w, success, err := b.Take(ctx, tokensRequested, maxWaitTime)
	if err != nil {
		s.Emit(events.NewBucketErrorEvent(namespace, name, b.Dynamic()))
		return 0, b.Dynamic(), errors.Wrap(err, "failed to take tokens")
	}

	if !success {
		// Could not claim tokens within the given max wait time
		s.Emit(events.NewTimedOutEvent(namespace, name, b.Dynamic(), tokensRequested))
		return 0, b.Dynamic(), newError(fmt.Sprintf("Timed out waiting on %v:%v", namespace, name), ER_TIMEOUT)
	}

	// The only result that successfully claims tokens
	s.Emit(events.NewTokensServedEvent(namespace, name, b.Dynamic(), tokensRequested, w))
	return w, b.Dynamic(), nil
}

func (s *server) ServeAdminConsole(mux *http.ServeMux, assetsDir string, development bool) {
	admin.ServeAdminConsole(s, mux, assetsDir, development)
}

func (s *server) SetLogger(logger logging.Logger) {
	if s.currentStatus == lifecycle.Started {
		panic("Cannot set logger after server has started!")
	}
	logging.SetLogger(logger)
}

func (s *server) SetStatsListener(listener stats.Listener) {
	if s.currentStatus == lifecycle.Started {
		panic("Cannot add listener after server has started!")
	}

	s.statsListener = listener
}

func (s *server) SetListener(listener events.Listener, eventQueueBufSize int) {
	if s.currentStatus == lifecycle.Started {
		panic("Cannot add listener after server has started!")
	}

	if eventQueueBufSize < 1 {
		panic("Event queue buffer size must be greater than 0")
	}

	s.listener = listener
	s.eventQueueBufSize = eventQueueBufSize
}

func (s *server) Emit(e events.Event) {
	if s.producer != nil {
		s.producer.Emit(e)
	}
}

func (s *server) configListener(ch <-chan struct{}) {
	for range ch {
		jitter := 0
		if s.maxJitterMillis != 0 {
			// Pick a random number between 0 and maxJitterMillis
			jitter = rand.Intn(s.maxJitterMillis)
		}
		s.readUpdatedConfig(time.Duration(jitter) * time.Millisecond)
	}
}

func (s *server) readUpdatedConfig(jitter time.Duration) {
	newConfig, err := s.persister.ReadPersistedConfig()

	if err != nil {
		logging.Println("error reading persisted config", err)
		return
	}

	if jitter != 0 {
		time.Sleep(jitter)
	}

	s.updateBucketContainer(newConfig)
}

func (s *server) createBucketContainer() {
	s.Lock()
	defer s.Unlock()

	if s.bucketContainer != nil {
		logging.Fatalf("A bucketcontainer already exists; this shouldn't happen. BucketContainer=%v", s.bucketContainer)
	}
	s.bucketContainer = NewBucketContainer(s.bucketFactory, s, s.reaperConfig)
}

func (s *server) updateBucketContainer(newConfig *pb.ServiceConfig) {
	s.Lock()
	defer s.Unlock()

	// Guard against updating the existing config with a lower valued version number
	if s.cfgs != nil && newConfig.Version <= s.cfgs.Version {
		logging.Printf("Proposed config version %d is lower than existing config version %d. Ignoring.",
			newConfig.Version, s.cfgs.Version)
		return
	}

	s.bucketContainer.Lock()
	defer s.bucketContainer.Unlock()

	// Initialize buckets
	s.bucketFactory.Init(newConfig)

	// If there is no existing config, then this bucket container is brand-new and hasn't been used before.
	firstTime := s.bucketContainer.cfg == nil

	// Set the new config on the the server
	s.cfgs = newConfig

	if firstTime {
		s.bucketContainer.initLocked(newConfig)
		return
	}

	s.bucketContainer.cfg = newConfig
	// Diff existing configs, buckets and namespaces against the new config and see what needs to be evicted

	// Start with the globalDefaultBucket
	var currentDefaultBucketCfg *pb.BucketConfig
	if s.bucketContainer.defaultBucket != nil {
		currentDefaultBucketCfg = s.bucketContainer.defaultBucket.Config()
	}

	if config.DifferentBucketConfigs(currentDefaultBucketCfg, newConfig.GlobalDefaultBucket) {
		if s.bucketContainer.defaultBucket != nil {
			// We need to destroy existing buckets even if we are replacing them.
			s.bucketContainer.defaultBucket.Destroy()
		}

		if newConfig.GlobalDefaultBucket == nil {
			s.bucketContainer.defaultBucket = nil
		} else {
			s.bucketContainer.createGlobalDefaultBucketLocked(s.cfgs.GlobalDefaultBucket)
		}
	}

	// Scan through all namespaces in s.bucketContainer.namespaces and update the config to point to
	// the new instance, *regardless* of whether the config has changed or not. Also, if the config *has*
	// changed, throw away the old namespace and recreate it. We *could* scan all the buckets in a namespace
	// and only recreate the ones that have changed, but this may have little benefit, since the real cost
	// here is with dynamic buckets, and if the namespace config has changed, it's very likely that the
	// change involves the dynamic bucket template.
	for name, ns := range s.bucketContainer.namespaces {
		newNsCfg, exists := newConfig.Namespaces[name]
		if exists {
			if config.DifferentNamespaceConfigs(ns.cfg, newNsCfg) {
				// We need to destroy the old namespace before overwriting.
				ns.destroy()
				// This will overwrite the existing namespace
				s.bucketContainer.createNamespaceLocked(newNsCfg)
			} else {
				// Just correct the config pointer on the old namespace
				ns.swapCfg(newNsCfg)
			}
		} else {
			ns.destroy()
			delete(s.bucketContainer.namespaces, name)
		}
	}

	// Now look for any new namespaces in the new config and add them
	for name, nsCfg := range newConfig.Namespaces {
		if _, exists := s.bucketContainer.namespaces[name]; !exists {
			s.bucketContainer.createNamespaceLocked(nsCfg)
		}
	}
}

func (s *server) updateConfig(user string, updater func(*pb.ServiceConfig) error) error {
	s.Lock()
	clonedCfg := config.CloneConfig(s.cfgs)
	currentVersion := clonedCfg.Version
	s.Unlock()

	err := updater(clonedCfg)

	if err != nil {
		return err
	}

	config.ApplyDefaults(clonedCfg)

	clonedCfg.User = user
	clonedCfg.Date = time.Now().Unix()
	clonedCfg.Version = currentVersion + 1

	// TODO(manik) make use of the old hash for an optimistic version check
	return s.persister.PersistAndNotify("", clonedCfg)
}

// Implements admin.Administrable
func (s *server) Configs() *pb.ServiceConfig {
	s.RLock()
	defer s.RUnlock()
	return s.cfgs
}

func (s *server) UpdateConfig(c *pb.ServiceConfig, user string) error {
	return s.updateConfig(user, func(clonedCfg *pb.ServiceConfig) error {
		*clonedCfg = *c
		return nil
	})
}

func (s *server) AddBucket(namespace string, b *pb.BucketConfig, user string) error {
	return s.updateConfig(user, func(clonedCfg *pb.ServiceConfig) error {
		return config.CreateBucket(clonedCfg, namespace, b)
	})
}

func (s *server) UpdateBucket(namespace string, b *pb.BucketConfig, user string) error {
	return s.updateConfig(user, func(clonedCfg *pb.ServiceConfig) error {
		return config.UpdateBucket(clonedCfg, namespace, b)
	})
}

func (s *server) DeleteBucket(namespace, name, user string) error {
	return s.updateConfig(user, func(clonedCfg *pb.ServiceConfig) error {
		return config.DeleteBucket(clonedCfg, namespace, name)
	})
}

func (s *server) AddNamespace(n *pb.NamespaceConfig, user string) error {
	return s.updateConfig(user, func(clonedCfg *pb.ServiceConfig) error {
		return config.CreateNamespace(clonedCfg, n)
	})
}

func (s *server) UpdateNamespace(n *pb.NamespaceConfig, user string) error {
	return s.updateConfig(user, func(clonedCfg *pb.ServiceConfig) error {
		return config.UpdateNamespace(clonedCfg, n)
	})
}

func (s *server) DeleteNamespace(n, user string) error {
	return s.updateConfig(user, func(clonedCfg *pb.ServiceConfig) error {
		return config.DeleteNamespace(clonedCfg, n)
	})
}

func (s *server) TopDynamicHits(namespace string) []*stats.BucketScore {
	if s.statsListener == nil {
		return nil
	}

	return s.statsListener.TopHits(namespace)
}

func (s *server) TopDynamicMisses(namespace string) []*stats.BucketScore {
	if s.statsListener == nil {
		return nil
	}

	return s.statsListener.TopMisses(namespace)
}

func (s *server) DynamicBucketStats(namespace, bucket string) *stats.BucketScores {
	if s.statsListener == nil {
		return nil
	}

	return s.statsListener.Get(namespace, bucket)
}

func (s *server) HistoricalConfigs() ([]*pb.ServiceConfig, error) {
	configs, err := s.persister.ReadHistoricalConfigs()
	if err != nil {
		return nil, err
	}
	sorted := make(sortedConfigs, len(configs))
	copy(sorted, configs)
	sort.Sort(sorted)

	return sorted, nil
}

func (s *server) GetServerAdministrable() admin.Administrable {
	return s
}


text:
package org.hisp.dhis.commons.action;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.hisp.dhis.common.IdentifiableObjectUtils;
import org.hisp.dhis.paging.ActionPagingSupport;
import org.hisp.dhis.user.UserGroup;
import org.hisp.dhis.user.UserGroupService;

/*
 * @author mortenoh
 */
public class GetUserGroupsAction
    extends ActionPagingSupport<UserGroup>
{
    // -------------------------------------------------------------------------
    // Dependencies
    // -------------------------------------------------------------------------

    private UserGroupService userGroupService;

    public void setUserGroupService( UserGroupService userGroupService )
    {
        this.userGroupService = userGroupService;
    }

    // -------------------------------------------------------------------------
    // Input & Output
    // -------------------------------------------------------------------------

    private String key;

    public void setKey( String key )
    {
        this.key = key;
    }

    private List<UserGroup> userGroups;

    public List<UserGroup> getUserGroups()
    {
        return userGroups;
    }

    // -------------------------------------------------------------------------
    // Action Implementation
    // -------------------------------------------------------------------------

    @Override
    public String execute()
        throws Exception
    {
        userGroups = new ArrayList<>( userGroupService.getAllUserGroups() );

        if ( key != null )
        {
            userGroups = IdentifiableObjectUtils.filterNameByKey( userGroups, key, true );
        }

        Collections.sort( userGroups );

        if ( usePaging )
        {
            this.paging = createPaging( userGroups.size() );

            userGroups = userGroups.subList( paging.getStartPos(), paging.getEndPos() );
        }

        return SUCCESS;
    }
}


text:
Pod
=======

## What is pod ?

Pod is a Middleware chaining module, compatible with
every mux who respect the ` http.Handler ` interface.

## Features

- Use Standard ` func (rw http.ResponseWriter, req *http.Request) ` as Middleware.
- Support also ` func (http.Handler) http.Handler ` signature.
- Middleware Chaining.
- Global Middleware declaration.
- Create Middleware Schema
- Standard Lib compatibily
- Compatible with every custom mux,
who respect the ` http.Handler ` interface.

## Example
```go
package main

import "github.com/squiidz/pod"

func main() {
	// Create a new Pod instance, and set some Global Middleware.
	po := pod.NewPod(GlobalMiddleWare)

	// You can also, create a Schema(), which is a stack
	// of MiddleWare for a specific task
	auth := pod.NewSchema(CheckUser, CheckToken, ValidSession)

	// You can pass multiple schema to the same Handler.
	http.Handle("/account", po.Fuse(AccountHandler).Schema(auth).Add(random))

	// Wrap your global middleware with your handler
	http.Handle("/home", po.Fuse(YourHandler))

	// Add some middleware on a specific handler.
	http.Handle("/", po.Fuse(YourOtherHandler).Add(OtherMiddle))

	// Start Listening
	http.ListenAndServe(":8080", nil)
}
```

## Contributing

1. Fork it
2. Create your feature branch (git checkout -b my-new-feature)
3. Write Tests!
4. Commit your changes (git commit -am 'Add some feature')
5. Push to the branch (git push origin my-new-feature)
6. Create new Pull Request

## License
MIT


text:
package com.svbio.cloudkeeper.model.runtime.execution;

import com.svbio.cloudkeeper.model.bare.execution.BareOverride;
import com.svbio.cloudkeeper.model.runtime.element.RuntimeAnnotatedConstruct;

import java.util.List;

public interface RuntimeOverride extends BareOverride, RuntimeAnnotatedConstruct {
    @Override
    List<? extends RuntimeOverrideTarget> getTargets();
}


text:
class EosSpeedMasterBlock : public OneInputBlock {

    Q_OBJECT

    Q_PROPERTY(QStringList effectNumbers READ getEffectNumbers NOTIFY effectNumbersChanged)

public:

    static BlockInfo info() {
        static BlockInfo info;
        info.typeName = "Eos Speed Master";
        info.nameInUi = "Speed Master";
        info.category << "ETC Consoles" << "Eos";
        info.helpText = "Controls the speed of multiple Eos Effects.\n\n"
                        "All effects will be set to the same speed, except that "
                        "a multiplication factor can be set for each effect.\n\n"
                        "Connect a BPM Tap and BPM Detection Block to a Crossfade Block "
                        "and the Crossfade Block to this Speed Master to be able to "
                        "switch between the detected and tapped BPM easily.\n\n"
                        "This block uses Eos OSC user 0.";
        info.qmlFile = "qrc:/qml/Blocks/Eos/EosSpeedMasterBlock.qml";
        info.complete<EosSpeedMasterBlock>();
        return info;
    }

    explicit EosSpeedMasterBlock(MainController* controller, QString uid);

    virtual void getAdditionalState(QJsonObject& state) const override;
    virtual void setAdditionalState(const QJsonObject& state) override;

signals:
    void bpmChanged();
    void effectNumbersChanged();
    void multipliersChanged();

public slots:
    virtual BlockInfo getBlockInfo() const override { return info(); }

    void onInputChanged();

    void addEffect(double effectNumber);

    void removeEffect(int index);

    void setMultiplier(int index, double newValue);

    double getMultiplier(int index) const;

    QStringList getEffectNumbers() const;

    double getBpm() const { return m_bpm; }

private slots:
    void sendBpm();

protected:
    DoubleAttribute m_bpm;

    QStringList m_effectNumbers;
    QVector<double> m_multipliers;

    BoolAttribute m_sendRegularly;
    QTimer m_timer;
};

#endif // EOSSPEEDMASTERBLOCK_H


text:
package org.apache.felix.ipojo.test.scenarios.annotations;

import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
import org.apache.felix.ipojo.metadata.Element;

public class Dependency extends OSGiTestCase {

    private IPOJOHelper helper;

    public void setUp() {
        helper = new IPOJOHelper(this);
    }

    public void testDependencyDeclaration() {
        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Dependency");
        Element[] deps = meta.getElements("requires");

        // Check fs
        Element dep = getDependencyById(deps, "fs");
        String field = dep.getAttribute("field");
        String id = dep.getAttribute("id");
        String bind = getBind(dep);
        String unbind = getUnbind(dep);
        assertNotNull("Check fs field", field);
        assertEquals("Check fs field", "fs", field);
        assertNull("Check fs bind", bind);
        assertNull("Check fs unbind", unbind);
        assertNull("Check fs id", id);

        // Check bar
        dep = getDependencyById(deps, "Bar");
        field = dep.getAttribute("field");
        id = dep.getAttribute("id");
        bind = getBind(dep);
        unbind = getUnbind(dep);
        assertNull("Check bar field", field);
        assertEquals("Check bar bind", "bindBar", bind);
        assertEquals("Check bar unbind", "unbindBar", unbind);
        assertEquals("Check bar id", "Bar", id);

        // Check baz
        dep = getDependencyById(deps, "Baz");
        field = dep.getAttribute("field");
        id = dep.getAttribute("id");
        bind = getBind(dep);
        unbind = getUnbind(dep);
        assertNull("Check baz field", field);
        assertEquals("Check baz bind", "bindBaz", bind);
        assertEquals("Check baz unbind", "unbindBaz", unbind);
        assertEquals("Check baz id", "Baz", id);

        // Check fs2
        dep = getDependencyById(deps, "fs2");
        field = dep.getAttribute("field");
        id = dep.getAttribute("id");
        bind = getBind(dep);
        unbind = getUnbind(dep);
        assertNotNull("Check fs2 field", field);
        assertEquals("Check fs2 field", "fs2", field);
        assertEquals("Check fs2 bind", "bindFS2", bind);
        assertEquals("Check fs2 unbind", "unbindFS2", unbind);

        // Check fs2inv
        dep = getDependencyById(deps, "fs2inv");
        field = dep.getAttribute("field");
        id = dep.getAttribute("id");
        bind = getBind(dep);
        unbind = getUnbind(dep);
        assertNotNull("Check fs2inv field", field);
        assertEquals("Check fs2 field", "fs2inv", field);
        assertEquals("Check fs2 bind", "bindFS2Inv", bind);
        assertEquals("Check fs2 unbind", "unbindFS2Inv", unbind);
        assertEquals("Check fs2 id", "inv", id);

        // Check mod
        dep = getDependencyById(deps, "mod");
        id = dep.getAttribute("id");
        bind = getBind(dep);
        unbind = getUnbind(dep);
        String mod = getModified(dep);
        assertEquals("Check mod bind", "bindMod", bind);
        assertEquals("Check mod unbind", "unbindMod", unbind);
        assertEquals("Check mod modified", "modifiedMod", mod);
        assertEquals("Check mod id", "mod", id);

        // Check not proxied
        dep = getDependencyById(deps, "notproxied");
        assertEquals("Check not proxied", "false", dep.getAttribute("proxy"));
    }

    private Element getDependencyById(Element[] deps, String name) {
        for (int i = 0; i < deps.length; i++) {
            String na = deps[i].getAttribute("id");
            String field = deps[i].getAttribute("field");
            if (na != null && na.equalsIgnoreCase(name)) {
                return deps[i];
            }
            if (field != null && field.equalsIgnoreCase(name)) {
                return deps[i];
            }
        }
        fail("Dependency  " + name + " not found");
        return null;
    }

    private String getBind(Element dep) {
        Element[] elem = dep.getElements("callback");
        for (int i = 0; elem != null && i < elem.length; i++) {
            if (elem[i].getAttribute("type").equalsIgnoreCase("bind")) {
                return elem[i].getAttribute("method");
            }
        }
        return null;
    }

    private String getUnbind(Element dep) {
        Element[] elem = dep.getElements("callback");
        for (int i = 0; elem != null && i < elem.length; i++) {
            if (elem[i].getAttribute("type").equalsIgnoreCase("unbind")) {
                return elem[i].getAttribute("method");
            }
        }
        return null;
    }

    private String getModified(Element dep) {
        Element[] elem = dep.getElements("callback");
        for (int i = 0; elem != null && i < elem.length; i++) {
            if (elem[i].getAttribute("type").equalsIgnoreCase("modified")) {
                return elem[i].getAttribute("method");
            }
        }
        return null;
    }

}


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: pingpong.proto

package org.wildfly.camel.test.grpc.subA;

/**
 *

 * The ping request message
 *

 *
 * Protobuf type {@code org.wildfly.camel.test.grpc.subA.test.PingRequest}
 */
public  final class PingRequest extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:org.wildfly.camel.test.grpc.subA.test.PingRequest)
    PingRequestOrBuilder {
  // Use PingRequest.newBuilder() to construct.
  private PingRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private PingRequest() {
    pingName_ = "";
    pingId_ = 0;
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
  }
  private PingRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    int mutable_bitField0_ = 0;
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          default: {
            if (!input.skipField(tag)) {
              done = true;
            }
            break;
          }
          case 10: {
            java.lang.String s = input.readStringRequireUtf8();

            pingName_ = s;
            break;
          }
          case 16: {

            pingId_ = input.readInt32();
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return org.wildfly.camel.test.grpc.subA.PingPongProto.internal_static_org_apache_camel_component_grpc_test_PingRequest_descriptor;
  }

  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return org.wildfly.camel.test.grpc.subA.PingPongProto.internal_static_org_apache_camel_component_grpc_test_PingRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            org.wildfly.camel.test.grpc.subA.PingRequest.class, org.wildfly.camel.test.grpc.subA.PingRequest.Builder.class);
  }

  public static final int PING_NAME_FIELD_NUMBER = 1;
  private volatile java.lang.Object pingName_;
  /**
   * string ping_name = 1;
   */
  public java.lang.String getPingName() {
    java.lang.Object ref = pingName_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs =
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      pingName_ = s;
      return s;
    }
  }
  /**
   * string ping_name = 1;
   */
  public com.google.protobuf.ByteString
      getPingNameBytes() {
    java.lang.Object ref = pingName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      pingName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int PING_ID_FIELD_NUMBER = 2;
  private int pingId_;
  /**
   * int32 ping_id = 2;
   */
  public int getPingId() {
    return pingId_;
  }

  private byte memoizedIsInitialized = -1;
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (!getPingNameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pingName_);
    }
    if (pingId_ != 0) {
      output.writeInt32(2, pingId_);
    }
  }

  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!getPingNameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, pingName_);
    }
    if (pingId_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(2, pingId_);
    }
    memoizedSize = size;
    return size;
  }

  private static final long serialVersionUID = 0L;
  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof org.wildfly.camel.test.grpc.subA.PingRequest)) {
      return super.equals(obj);
    }
    org.wildfly.camel.test.grpc.subA.PingRequest other = (org.wildfly.camel.test.grpc.subA.PingRequest) obj;

    boolean result = true;
    result = result && getPingName()
        .equals(other.getPingName());
    result = result && (getPingId()
        == other.getPingId());
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + PING_NAME_FIELD_NUMBER;
    hash = (53 * hash) + getPingName().hashCode();
    hash = (37 * hash) + PING_ID_FIELD_NUMBER;
    hash = (53 * hash) + getPingId();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static org.wildfly.camel.test.grpc.subA.PingRequest parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.wildfly.camel.test.grpc.subA.PingRequest parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.wildfly.camel.test.grpc.subA.PingRequest parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.wildfly.camel.test.grpc.subA.PingRequest parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.wildfly.camel.test.grpc.subA.PingRequest parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.wildfly.camel.test.grpc.subA.PingRequest parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.wildfly.camel.test.grpc.subA.PingRequest parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.wildfly.camel.test.grpc.subA.PingRequest parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }
  public static org.wildfly.camel.test.grpc.subA.PingRequest parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static org.wildfly.camel.test.grpc.subA.PingRequest parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static org.wildfly.camel.test.grpc.subA.PingRequest parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.wildfly.camel.test.grpc.subA.PingRequest parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(org.wildfly.camel.test.grpc.subA.PingRequest prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *

   * The ping request message
   *

   *
   * Protobuf type {@code org.wildfly.camel.test.grpc.subA.test.PingRequest}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:org.wildfly.camel.test.grpc.subA.test.PingRequest)
      org.wildfly.camel.test.grpc.subA.PingRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.wildfly.camel.test.grpc.subA.PingPongProto.internal_static_org_apache_camel_component_grpc_test_PingRequest_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.wildfly.camel.test.grpc.subA.PingPongProto.internal_static_org_apache_camel_component_grpc_test_PingRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.wildfly.camel.test.grpc.subA.PingRequest.class, org.wildfly.camel.test.grpc.subA.PingRequest.Builder.class);
    }

    // Construct using org.wildfly.camel.test.grpc.subA.PingRequest.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    public Builder clear() {
      super.clear();
      pingName_ = "";

      pingId_ = 0;

      return this;
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return org.wildfly.camel.test.grpc.subA.PingPongProto.internal_static_org_apache_camel_component_grpc_test_PingRequest_descriptor;
    }

    public org.wildfly.camel.test.grpc.subA.PingRequest getDefaultInstanceForType() {
      return org.wildfly.camel.test.grpc.subA.PingRequest.getDefaultInstance();
    }

    public org.wildfly.camel.test.grpc.subA.PingRequest build() {
      org.wildfly.camel.test.grpc.subA.PingRequest result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public org.wildfly.camel.test.grpc.subA.PingRequest buildPartial() {
      org.wildfly.camel.test.grpc.subA.PingRequest result = new org.wildfly.camel.test.grpc.subA.PingRequest(this);
      result.pingName_ = pingName_;
      result.pingId_ = pingId_;
      onBuilt();
      return result;
    }

    public Builder clone() {
      return (Builder) super.clone();
    }
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        Object value) {
      return (Builder) super.setField(field, value);
    }
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return (Builder) super.clearField(field);
    }
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return (Builder) super.clearOneof(oneof);
    }
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof org.wildfly.camel.test.grpc.subA.PingRequest) {
        return mergeFrom((org.wildfly.camel.test.grpc.subA.PingRequest)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(org.wildfly.camel.test.grpc.subA.PingRequest other) {
      if (other == org.wildfly.camel.test.grpc.subA.PingRequest.getDefaultInstance()) return this;
      if (!other.getPingName().isEmpty()) {
        pingName_ = other.pingName_;
        onChanged();
      }
      if (other.getPingId() != 0) {
        setPingId(other.getPingId());
      }
      onChanged();
      return this;
    }

    public final boolean isInitialized() {
      return true;
    }

    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      org.wildfly.camel.test.grpc.subA.PingRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (org.wildfly.camel.test.grpc.subA.PingRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object pingName_ = "";
    /**
     * string ping_name = 1;
     */
    public java.lang.String getPingName() {
      java.lang.Object ref = pingName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        pingName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * string ping_name = 1;
     */
    public com.google.protobuf.ByteString
        getPingNameBytes() {
      java.lang.Object ref = pingName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        pingName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * string ping_name = 1;
     */
    public Builder setPingName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }

      pingName_ = value;
      onChanged();
      return this;
    }
    /**
     * string ping_name = 1;
     */
    public Builder clearPingName() {

      pingName_ = getDefaultInstance().getPingName();
      onChanged();
      return this;
    }
    /**
     * string ping_name = 1;
     */
    public Builder setPingNameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);

      pingName_ = value;
      onChanged();
      return this;
    }

    private int pingId_ ;
    /**
     * int32 ping_id = 2;
     */
    public int getPingId() {
      return pingId_;
    }
    /**
     * int32 ping_id = 2;
     */
    public Builder setPingId(int value) {

      pingId_ = value;
      onChanged();
      return this;
    }
    /**
     * int32 ping_id = 2;
     */
    public Builder clearPingId() {

      pingId_ = 0;
      onChanged();
      return this;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return this;
    }

    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return this;
    }

    // @@protoc_insertion_point(builder_scope:org.wildfly.camel.test.grpc.subA.test.PingRequest)
  }

  // @@protoc_insertion_point(class_scope:org.wildfly.camel.test.grpc.subA.test.PingRequest)
  private static final org.wildfly.camel.test.grpc.subA.PingRequest DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new org.wildfly.camel.test.grpc.subA.PingRequest();
  }

  public static org.wildfly.camel.test.grpc.subA.PingRequest getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<PingRequest>
      PARSER = new com.google.protobuf.AbstractParser<PingRequest>() {
    public PingRequest parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
        return new PingRequest(input, extensionRegistry);
    }
  };

  public static com.google.protobuf.Parser<PingRequest> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<PingRequest> getParserForType() {
    return PARSER;
  }

  public org.wildfly.camel.test.grpc.subA.PingRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}


text:
#ifndef BT_COMPOUND_COLLISION_ALGORITHM_H
#define BT_COMPOUND_COLLISION_ALGORITHM_H

#include "btActivatingCollisionAlgorithm.h"
#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"

#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
class btDispatcher;
#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
#include "btCollisionCreateFunc.h"
#include "LinearMath/btAlignedObjectArray.h"
class btDispatcher;
class btCollisionObject;

/// btCompoundCollisionAlgorithm  supports collision between CompoundCollisionShapes and other collision shapes
class btCompoundCollisionAlgorithm  : public btActivatingCollisionAlgorithm
{
	btAlignedObjectArray<btCollisionAlgorithm*> m_childCollisionAlgorithms;
	bool m_isSwapped;

	class btPersistentManifold*	m_sharedManifold;
	bool					m_ownsManifold;

	int	m_compoundShapeRevision;//to keep track of changes, so that childAlgorithm array can be updated

	void	removeChildAlgorithms();

	void	preallocateChildAlgorithms(const btCollisionObjectWrapper* body0Wrap,const btCollisionObjectWrapper* body1Wrap);

public:

	btCompoundCollisionAlgorithm( const btCollisionAlgorithmConstructionInfo& ci,const btCollisionObjectWrapper* body0Wrap,const btCollisionObjectWrapper* body1Wrap,bool isSwapped);

	virtual ~btCompoundCollisionAlgorithm();

	virtual void processCollision (const btCollisionObjectWrapper* body0Wrap,const btCollisionObjectWrapper* body1Wrap,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

	btScalar	calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
	{
		int i;
		for (i=0;i<m_childCollisionAlgorithms.size();i++)
		{
			if (m_childCollisionAlgorithms[i])
				m_childCollisionAlgorithms[i]->getAllContactManifolds(manifoldArray);
		}
	}

	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
	{
		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, const btCollisionObjectWrapper* body0Wrap,const btCollisionObjectWrapper* body1Wrap)
		{
			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btCompoundCollisionAlgorithm));
			return new(mem) btCompoundCollisionAlgorithm(ci,body0Wrap,body1Wrap,false);
		}
	};

	struct SwappedCreateFunc :public 	btCollisionAlgorithmCreateFunc
	{
		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, const btCollisionObjectWrapper* body0Wrap,const btCollisionObjectWrapper* body1Wrap)
		{
			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btCompoundCollisionAlgorithm));
			return new(mem) btCompoundCollisionAlgorithm(ci,body0Wrap,body1Wrap,true);
		}
	};

};

#endif //BT_COMPOUND_COLLISION_ALGORITHM_H