text:
(async function() {
  TestRunner.addResult(`Tests inspector's composite progress bar.\n`);

  var MockProgressIndicator = function() {};

  MockProgressIndicator.prototype = {
    // Implementation of Common.Progress interface.
    isCanceled: function() {
      return this._isCanceled;
    },

    done: function() {
      TestRunner.addResult('progress indicator: done');
    },

    setTotalWork: function(totalWork) {
      this._totalWork = totalWork;
    },

    setWorked: function(worked, title) {
      this._worked = worked;
      if (typeof title !== 'undefined')
        this._title = title;
    },

    setTitle: function(title) {
      this._title = title;
    },

    // Test methods.
    cancel: function() {
      this._isCanceled = true;
    },

    dump: function() {
      const roundFactor = 10000;

      var worked = this._worked;
      var totalWork = this._totalWork;

      if (typeof worked === 'number')
        worked = Math.round(worked * roundFactor) / roundFactor;
      if (typeof totalWork === 'number')
        totalWork = Math.round(totalWork * roundFactor) / roundFactor;

      TestRunner.addResult('progress: `' + this._title + '\' ' + worked + ' out of ' + totalWork + ' done.');
    }
  };

  TestRunner.runTestSuite([
    function testOneSubProgress(next) {
      var indicator = new MockProgressIndicator();
      var composite = new Common.CompositeProgress(indicator);
      var subProgress = composite.createSubProgress();

      TestRunner.addResult('Testing CompositeProgress with a single subprogress:');
      indicator.dump();
      subProgress.setTitle('cuckooing');
      subProgress.setWorked(10);
      indicator.dump();
      subProgress.setTotalWork(100);
      indicator.dump();
      subProgress.setWorked(20, 'meowing');
      indicator.dump();
      subProgress.done();
      indicator.dump();
      next();
    },

    function testMultipleSubProgresses(next) {
      var indicator = new MockProgressIndicator();
      var composite = new Common.CompositeProgress(indicator);
      var subProgress1 = composite.createSubProgress();
      var subProgress2 = composite.createSubProgress(3);

      TestRunner.addResult('Testing CompositeProgress with multiple subprogresses:');
      indicator.dump();

      subProgress1.setTitle('cuckooing');
      subProgress1.setTotalWork(100);
      subProgress1.setWorked(20);
      indicator.dump();

      subProgress2.setWorked(10);
      indicator.dump();

      subProgress2.setTotalWork(10);
      subProgress2.setWorked(3, 'barking');
      indicator.dump();

      subProgress1.setWorked(50, 'meowing');
      subProgress2.setWorked(5);
      indicator.dump();

      subProgress2.done();
      indicator.dump();

      subProgress1.done();
      indicator.dump();
      next();
    },

    function testCancel(next) {
      var indicator = new MockProgressIndicator();
      var composite = new Common.CompositeProgress(indicator);
      var subProgress = composite.createSubProgress();

      TestRunner.addResult('Testing isCanceled:');
      TestRunner.assertTrue(!subProgress.isCanceled(), 'progress should not be canceled');
      indicator.cancel();
      TestRunner.assertTrue(subProgress.isCanceled(), 'progress should be canceled');
      next();
    },

    function testNested(next) {
      var indicator = new MockProgressIndicator();
      var composite0 = new Common.CompositeProgress(indicator);
      var subProgress01 = composite0.createSubProgress();
      var composite1 = new Common.CompositeProgress(subProgress01);
      var subProgress11 = composite1.createSubProgress(10);  // Weight should have no effect.

      TestRunner.addResult('Testing nested subprogresses:');
      indicator.dump();

      subProgress11.setWorked(10);
      indicator.dump();

      subProgress11.setTotalWork(100);
      indicator.dump();

      subProgress11.setWorked(50, 'meowing');
      indicator.dump();

      TestRunner.assertTrue(!subProgress11.isCanceled());
      indicator.cancel();
      TestRunner.assertTrue(subProgress11.isCanceled());

      subProgress11.done();
      indicator.dump();
      next();
    }
  ]);
})();


text:
package aQute.tester.testclasses.bundle.engine;

import junit.framework.TestCase;

public class JUnit3AndVenusTest extends TestCase {

	@org.junit.venus.Test
	public void someTest() {}

	public void testSomethingElse() {

	}
}

redpajama_set_name: RedPajamaGithub


text:
package com.microsoft.azure.management.features.v2015_12_01.implementation;

import com.microsoft.azure.arm.model.implementation.WrapperImpl;
import com.microsoft.azure.management.features.v2015_12_01.Features;
import rx.Observable;
import rx.functions.Func1;
import com.microsoft.azure.Page;
import com.microsoft.azure.management.features.v2015_12_01.FeatureResult;

class FeaturesImpl extends WrapperImpl<FeaturesInner> implements Features {
    private final FeaturesManager manager;

    FeaturesImpl(FeaturesManager manager) {
        super(manager.inner().features());
        this.manager = manager;
    }

    public FeaturesManager manager() {
        return this.manager;
    }

    private FeatureResultImpl wrapModel(FeatureResultInner inner) {
        return  new FeatureResultImpl(inner, manager());
    }

    @Override
    public Observable<FeatureResult> registerAsync(String resourceProviderNamespace, String featureName) {
        FeaturesInner client = this.inner();
        return client.registerAsync(resourceProviderNamespace, featureName)
        .map(new Func1<FeatureResultInner, FeatureResult>() {
            @Override
            public FeatureResult call(FeatureResultInner inner) {
                return new FeatureResultImpl(inner, manager());
            }
        });
    }

    @Override
    public Observable<FeatureResult> listAsync() {
        FeaturesInner client = this.inner();
        return client.listAsync()
        .flatMapIterable(new Func1<Page<FeatureResultInner>, Iterable<FeatureResultInner>>() {
            @Override
            public Iterable<FeatureResultInner> call(Page<FeatureResultInner> page) {
                return page.items();
            }
        })
        .map(new Func1<FeatureResultInner, FeatureResult>() {
            @Override
            public FeatureResult call(FeatureResultInner inner) {
                return new FeatureResultImpl(inner, manager());
            }
        });
    }

    @Override
    public Observable<FeatureResult> list1Async(final String resourceProviderNamespace) {
        FeaturesInner client = this.inner();
        return client.list1Async(resourceProviderNamespace)
        .flatMapIterable(new Func1<Page<FeatureResultInner>, Iterable<FeatureResultInner>>() {
            @Override
            public Iterable<FeatureResultInner> call(Page<FeatureResultInner> page) {
                return page.items();
            }
        })
        .map(new Func1<FeatureResultInner, FeatureResult>() {
            @Override
            public FeatureResult call(FeatureResultInner inner) {
                return wrapModel(inner);
            }
        });
    }

    @Override
    public Observable<FeatureResult> getAsync(String resourceProviderNamespace, String featureName) {
        FeaturesInner client = this.inner();
        return client.getAsync(resourceProviderNamespace, featureName)
        .map(new Func1<FeatureResultInner, FeatureResult>() {
            @Override
            public FeatureResult call(FeatureResultInner inner) {
                return wrapModel(inner);
            }
       });
    }

}


text:
using System;

namespace MsieJavaScriptEngine.JsRt
{
	/// <summary>
	/// The background work item callback
	/// </summary>
	/// <remarks>
	/// This is passed to the host's thread service (if provided) to allow the host to
	/// invoke the work item callback on the background thread of its choice.
	/// </remarks>
	/// <param name="callbackData">Data argument passed to the thread service</param>
	internal delegate void JsBackgroundWorkItemCallback(IntPtr callbackData);
}


text:
(function () {
    'use strict';

    angular.module('simple-chat.app')
        .factory('Auth', function Auth($http, $log, $cookieStore, $q, User) {
            return {

                /**
                 * Authenticate user and save token
                 * @param  {Object}   user     - login info
                 * @return {Promise}
                 */
                login: function (user) {
                    var deferred = $q.defer();

                    $http.post('/auth/local', {
                        email: user.email,
                        password: user.password
                    }).
                        success(function (data) {
                            $cookieStore.put('token', data.token);
                            $log.log("Auth - login: Success login.");
                            deferred.resolve(data);
                        }).
                        error(function (err) {
                            this.logout();
                            $log.log("Auth - login: Failure login.");
                            deferred.reject(err);
                        }.bind(this));

                    return deferred.promise;
                },

                /**
                 * Delete access token and user info
                 */
                logout: function () {
                    $cookieStore.remove('token');
                    $log.log("Auth - logout: Reset user. Remove token.");
                },

                /**
                 * Change password
                 * @param  {String}   oldPassword
                 * @param  {String}   newPassword
                 * @return {Promise}
                 */
                changePassword: function (oldPassword, newPassword) {
                    return User.changePassword({}, {oldPassword: oldPassword, newPassword: newPassword}).$promise;
                },

                /**
                 * Check if a user is an admin
                 * @return {Boolean}
                 */
                isAdmin: function () {
                    return User.isAdmin().$promise.then(function (res) {
                        return res.isAdmin;
                    });
                },

                /**
                 * Get auth token
                 */
                getToken: function () {
                    return $cookieStore.get('token');
                }
            };
        }
    );
})();


text:
<!DOCTYPE html>

		<title>three.js webgl - collada - kinematics</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">

			three.js -
			robot from collada robots


text:
<?php

class bikes_CollectionVosArrayIsEmptyException extends Exception{

}


text:
using ActivityStreamEntry = struct os_activity_stream_entry_s;

/// Provides a unified wrapper around os_log()-style log messages.
///
/// The lifetime of this class is intended to be very short.  The caller
/// must ensure that the passed in ActivityStore and ActivityStreamEntry
/// outlive this LogMessageOsLog entry.

class LogMessageOsLog : public LogMessage {
public:
  static void SetFormatterFunction(os_log_copy_formatted_message_t format_func);

  LogMessageOsLog(const ActivityStore &activity_store,
                  ActivityStreamEntry &entry);

  // API methods

  bool HasActivity() const override;

  const char *GetActivity() const override;

  std::string GetActivityChain() const override;

  bool HasCategory() const override;

  const char *GetCategory() const override;

  bool HasSubsystem() const override;

  const char *GetSubsystem() const override;

  const char *GetMessage() const override;

private:
  const ActivityStore &m_activity_store;
  ActivityStreamEntry &m_entry;
  mutable std::string m_message;
};

#endif // LLDB_TOOLS_DEBUGSERVER_SOURCE_MACOSX_DARWINLOG_LOGMESSAGEOSLOG_H


text:
'use strict';

const utils = require('../utils/utils');
const emberUtils = require('../utils/ember');

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

const ERROR_MESSAGE = "Don't specify injected service name as an argument when it matches the property name.";

module.exports = {
  meta: {
    docs: {
      description: 'Disallow unnecessary argument when injecting service',
      category: 'Best Practices',
      recommended: false
    },
    fixable: 'code',
    ERROR_MESSAGE
  },

  create(context) {
    return {
      Property(node) {
        if (!emberUtils.isInjectedServiceProp(node.value) ||
            node.value.arguments.length !== 1 ||
            !utils.isLiteral(node.value.arguments[0])) {
          return;
        }

        const keyName = node.key.name;
        const firstArgValue = node.value.arguments[0].value;
        if (keyName === firstArgValue) {
          context.report({
            node: node.value.arguments[0],
            message: ERROR_MESSAGE,
            fix(fixer) {
              return fixer.remove(node.value.arguments[0]);
            }
          });
        }
      }
    };
  }
};


text:
from __future__ import unicode_literals

import uuid

from django.conf import settings
from django.db.backends.base.operations import BaseDatabaseOperations
from django.utils import six, timezone
from django.utils.encoding import force_text

class DatabaseOperations(BaseDatabaseOperations):
    compiler_module = "django.db.backends.mysql.compiler"

    # MySQL stores positive fields as UNSIGNED ints.
    integer_field_ranges = dict(BaseDatabaseOperations.integer_field_ranges,
        PositiveSmallIntegerField=(0, 4294967295),
        PositiveIntegerField=(0, 18446744073709551615),
    )

    def date_extract_sql(self, lookup_type, field_name):
        # http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html
        if lookup_type == 'week_day':
            # DAYOFWEEK() returns an integer, 1-7, Sunday=1.
            # Note: WEEKDAY() returns 0-6, Monday=0.
            return "DAYOFWEEK(%s)" % field_name
        else:
            return "EXTRACT(%s FROM %s)" % (lookup_type.upper(), field_name)

    def date_trunc_sql(self, lookup_type, field_name):
        fields = ['year', 'month', 'day', 'hour', 'minute', 'second']
        format = ('%%Y-', '%%m', '-%%d', ' %%H:', '%%i', ':%%s')  # Use double percents to escape.
        format_def = ('0000-', '01', '-01', ' 00:', '00', ':00')
        try:
            i = fields.index(lookup_type) + 1
        except ValueError:
            sql = field_name
        else:
            format_str = ''.join([f for f in format[:i]] + [f for f in format_def[i:]])
            sql = "CAST(DATE_FORMAT(%s, '%s') AS DATETIME)" % (field_name, format_str)
        return sql

    def _convert_field_to_tz(self, field_name, tzname):
        if settings.USE_TZ:
            field_name = "CONVERT_TZ(%s, 'UTC', %%s)" % field_name
            params = [tzname]
        else:
            params = []
        return field_name, params

    def datetime_cast_date_sql(self, field_name, tzname):
        field_name, params = self._convert_field_to_tz(field_name, tzname)
        sql = "DATE(%s)" % field_name
        return sql, params

    def datetime_extract_sql(self, lookup_type, field_name, tzname):
        field_name, params = self._convert_field_to_tz(field_name, tzname)
        sql = self.date_extract_sql(lookup_type, field_name)
        return sql, params

    def datetime_trunc_sql(self, lookup_type, field_name, tzname):
        field_name, params = self._convert_field_to_tz(field_name, tzname)
        fields = ['year', 'month', 'day', 'hour', 'minute', 'second']
        format = ('%%Y-', '%%m', '-%%d', ' %%H:', '%%i', ':%%s')  # Use double percents to escape.
        format_def = ('0000-', '01', '-01', ' 00:', '00', ':00')
        try:
            i = fields.index(lookup_type) + 1
        except ValueError:
            sql = field_name
        else:
            format_str = ''.join([f for f in format[:i]] + [f for f in format_def[i:]])
            sql = "CAST(DATE_FORMAT(%s, '%s') AS DATETIME)" % (field_name, format_str)
        return sql, params

    def date_interval_sql(self, timedelta):
        return "INTERVAL '%d 0:0:%d:%d' DAY_MICROSECOND" % (
            timedelta.days, timedelta.seconds, timedelta.microseconds), []

    def format_for_duration_arithmetic(self, sql):
        if self.connection.features.supports_microsecond_precision:
            return 'INTERVAL %s MICROSECOND' % sql
        else:
            return 'INTERVAL FLOOR(%s / 1000000) SECOND' % sql

    def drop_foreignkey_sql(self):
        return "DROP FOREIGN KEY"

    def force_no_ordering(self):
        """
        "ORDER BY NULL" prevents MySQL from implicitly ordering by grouped
        columns. If no ordering would otherwise be applied, we don't want any
        implicit sorting going on.
        """
        return [(None, ("NULL", [], False))]

    def fulltext_search_sql(self, field_name):
        return 'MATCH (%s) AGAINST (%%s IN BOOLEAN MODE)' % field_name

    def last_executed_query(self, cursor, sql, params):
        # With MySQLdb, cursor objects have an (undocumented) "_last_executed"
        # attribute where the exact query sent to the database is saved.
        # See MySQLdb/cursors.py in the source distribution.
        return force_text(getattr(cursor, '_last_executed', None), errors='replace')

    def no_limit_value(self):
        # 2**64 - 1, as recommended by the MySQL documentation
        return 18446744073709551615

    def quote_name(self, name):
        if name.startswith("`") and name.endswith("`"):
            return name  # Quoting once is enough.
        return "`%s`" % name

    def random_function_sql(self):
        return 'RAND()'

    def sql_flush(self, style, tables, sequences, allow_cascade=False):
        # NB: The generated SQL below is specific to MySQL
        # 'TRUNCATE x;', 'TRUNCATE y;', 'TRUNCATE z;'... style SQL statements
        # to clear all tables of all data
        if tables:
            sql = ['SET FOREIGN_KEY_CHECKS = 0;']
            for table in tables:
                sql.append('%s %s;' % (
                    style.SQL_KEYWORD('TRUNCATE'),
                    style.SQL_FIELD(self.quote_name(table)),
                ))
            sql.append('SET FOREIGN_KEY_CHECKS = 1;')
            sql.extend(self.sequence_reset_by_name_sql(style, sequences))
            return sql
        else:
            return []

    def validate_autopk_value(self, value):
        # MySQLism: zero in AUTO_INCREMENT field does not work. Refs #17653.
        if value == 0:
            raise ValueError('The database backend does not accept 0 as a '
                             'value for AutoField.')
        return value

    def adapt_datetimefield_value(self, value):
        if value is None:
            return None

        # MySQL doesn't support tz-aware datetimes
        if timezone.is_aware(value):
            if settings.USE_TZ:
                value = timezone.make_naive(value, self.connection.timezone)
            else:
                raise ValueError("MySQL backend does not support timezone-aware datetimes when USE_TZ is False.")

        if not self.connection.features.supports_microsecond_precision:
            value = value.replace(microsecond=0)

        return six.text_type(value)

    def adapt_timefield_value(self, value):
        if value is None:
            return None

        # MySQL doesn't support tz-aware times
        if timezone.is_aware(value):
            raise ValueError("MySQL backend does not support timezone-aware times.")

        return six.text_type(value)

    def max_name_length(self):
        return 64

    def bulk_insert_sql(self, fields, num_values):
        items_sql = "(%s)" % ", ".join(["%s"] * len(fields))
        return "VALUES " + ", ".join([items_sql] * num_values)

    def combine_expression(self, connector, sub_expressions):
        """
        MySQL requires special cases for ^ operators in query expressions
        """
        if connector == '^':
            return 'POW(%s)' % ','.join(sub_expressions)
        return super(DatabaseOperations, self).combine_expression(connector, sub_expressions)

    def get_db_converters(self, expression):
        converters = super(DatabaseOperations, self).get_db_converters(expression)
        internal_type = expression.output_field.get_internal_type()
        if internal_type == 'TextField':
            converters.append(self.convert_textfield_value)
        elif internal_type in ['BooleanField', 'NullBooleanField']:
            converters.append(self.convert_booleanfield_value)
        elif internal_type == 'DateTimeField':
            converters.append(self.convert_datetimefield_value)
        elif internal_type == 'UUIDField':
            converters.append(self.convert_uuidfield_value)
        return converters

    def convert_textfield_value(self, value, expression, connection, context):
        if value is not None:
            value = force_text(value)
        return value

    def convert_booleanfield_value(self, value, expression, connection, context):
        if value in (0, 1):
            value = bool(value)
        return value

    def convert_datetimefield_value(self, value, expression, connection, context):
        if value is not None:
            if settings.USE_TZ:
                value = timezone.make_aware(value, self.connection.timezone)
        return value

    def convert_uuidfield_value(self, value, expression, connection, context):
        if value is not None:
            value = uuid.UUID(value)
        return value


text:
namespace base {
namespace {

class DiscardableMemoryShmemChunkImpl : public DiscardableMemoryShmemChunk {
 public:
  explicit DiscardableMemoryShmemChunkImpl(
      scoped_ptr<DiscardableSharedMemory> shared_memory)
      : shared_memory_(shared_memory.Pass()) {}

  // Overridden from DiscardableMemoryShmemChunk:
  bool Lock() override { return shared_memory_->Lock(0, 0); }
  void Unlock() override { shared_memory_->Unlock(0, 0); }
  void* Memory() const override { return shared_memory_->memory(); }
  bool IsMemoryResident() const override {
    return shared_memory_->IsMemoryResident();
  }

 private:
  scoped_ptr<DiscardableSharedMemory> shared_memory_;

  DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryShmemChunkImpl);
};

// Default allocator implementation that allocates in-process
// DiscardableSharedMemory instances.
class DiscardableMemoryShmemAllocatorImpl
    : public DiscardableMemoryShmemAllocator {
 public:
  // Overridden from DiscardableMemoryShmemAllocator:
  scoped_ptr<DiscardableMemoryShmemChunk>
  AllocateLockedDiscardableMemory(size_t size) override {
    scoped_ptr<DiscardableSharedMemory> memory(new DiscardableSharedMemory);
    if (!memory->CreateAndMap(size))
      return nullptr;

    return make_scoped_ptr(new DiscardableMemoryShmemChunkImpl(memory.Pass()));
  }
};

LazyInstance<DiscardableMemoryShmemAllocatorImpl>::Leaky g_default_allocator =
    LAZY_INSTANCE_INITIALIZER;

DiscardableMemoryShmemAllocator* g_allocator = nullptr;

}  // namespace

// static
void DiscardableMemoryShmemAllocator::SetInstance(
    DiscardableMemoryShmemAllocator* allocator) {
  DCHECK(allocator);

  // Make sure this function is only called once before the first call
  // to GetInstance().
  DCHECK(!g_allocator);

  g_allocator = allocator;
}

// static
DiscardableMemoryShmemAllocator*
DiscardableMemoryShmemAllocator::GetInstance() {
  if (!g_allocator)
    g_allocator = g_default_allocator.Pointer();

  return g_allocator;
}

}  // namespace base


text:
<?php

use yii\widgets\ListView;

/* @var $this yii\web\View */
/* @var $searchModel app\models\form\Content */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = $breadcrum;
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="content-index">
    <?=ListView::widget([
'dataProvider' => $dataProvider,
'itemView' => '/content/listItem',
'layout' => "{items}\n{pager}",
]);?>

</div>


text:
EmberXmpp.Entity = Ember.Object.extend({

    xcEntity: null,

    init: function(){
        this._super();
    },

    jid: function(){
        return this.get('xcEntity').getBareJID();
    }.property('xcEntity'),

    id: function(){
        return this.get('jid');
    }.property('jid'),

    //TODO: dependency should go down deeper than just xcEntity
    //Node is seen as username/name
    name: function(){
        var e = this.get('xcEntity');

        if(e) {
            return e.getJIDNode();
        }
        return null;
    }.property('xcEntity'),

    presence: function(key, value){
        // getter
        if (arguments.length === 1) {
            return this.get('xcEntity').presence;

        // setter
        } else {
            this.get('xcEntity').presence = value;

            return value;
        }
    }.property('xcEntity'),

    online: function(){
       var e = this.get('xcEntity');

       if(e){
           return this.get('xcEntity').presence.available;
       }
       return null;
    }.property('presence'),

    sendChat: function(body, subject, thread, id){
        return this.get('xcEntity').sendChat(body, subject, thread, id);
    }
});


text:
[![npm version](https://badge.fury.io/js/xunit-to-nunit.svg)](https://badge.fury.io/js/xunit-to-nunit)
[![Build Status](https://travis-ci.org/jmsv/xunit-to-nunit.svg?branch=master)](https://travis-ci.org/jmsv/xunit-to-nunit)
[![Dependencies](https://www.versioneye.com/user/projects/59819587368b080078e5cabc/badge.svg)](https://www.versioneye.com/user/projects/59819587368b080078e5cabc?child=summary)

[![NPM](https://nodei.co/npm/xunit-to-nunit.png)](https://nodei.co/npm/xunit-to-nunit/)

Converts C# XUnit tests to NUnit tests.

_Disclaimer: Far from perfect - something I used as a quick hack to convert loads of large tests_

## Links

- Converter app: [jmsv.github.io/xunit-to-nunit](https://jmsv.github.io/xunit-to-nunit)
- Node module: [npmjs.com/package/xunit-to-nunit](https://www.npmjs.com/package/xunit-to-nunit)

## :package: Installation

```bash
npm install xunit-to-nunit
```

## Usage

### Require

```javascript
var x2n = require('xunit-to-nunit')
```

### Convert test from string

```javascript
var nunitTest = x2n.convertCode(xunitTest)
```

### Convert test from file

```javascript
x2n.convertFile('xunit-source-path.cs', 'nunit-destination-path.cs')
```

### Convert tests from directory

```javascript
x2n.convertFiles('xunit/source/directory', 'nunit/destination/directory')
```

This function calls `convertFile` for all files in the source directory.

#### Options

`convertFiles` has a third (optional) parameter: `options`. This should be a dictionary value, containing all or any of the following  parameters:

##### :wrench: recursive (default: `false`)

Set to `true`, this parameter will convert tests in all subdirectories including those at the source root. Directory structure is maintained at the conversion destination.

##### :wrench: verbose (default: `true`)

When `true`, the module logs an info message to the terminal when a file is converted. When a file conversion fails, a error log message is displayed regardless of the value of `verbose`.

For example,

```javascript
var options = {
  recursive: true,
  verbose: false
}

x2n.convertFiles('xunit/source/directory', 'nunit/destination/directory', options)
```

#### Writing converted tests to source directory

When _source = destination_, '`_NUnit`' is appended to the filename. For example, where _destination = `dir`_, `dir/SomeTests.cs` is converted and the result is written to `dir/SomeTests_NUnit.cs`.

This behaviour can be changed with the following parameters:

##### :wrench: append (default: `'_NUnit'`)

String to be appended to filenames when writing destination files to the source directory.

##### :wrench: overwrite (default: `false`)

If _`overwrite` = true_, `append` is ignored, and source files are overwritten at destination.

For example,

```javascript
// Append destination filenames with `append` text
var options = {
  append: '_Test',
  overwrite: false // `overwrite` is false by default
}

// or, overwrite source files
var options = {
  overwrite: true
}

x2n.convertFiles('xunit/source/directory', 'nunit/destination/directory', options)

```

## Contributing

Feel free to add things / suggest things to be added by either [opening an issue](https://github.com/jmsv/xunit-to-nunit/issues) or by submitting a pull request.

## References

- https://xunit.github.io/docs/comparisons.html


text:
import sys
import numpy as np
import scipy as sp
from numpy import *
if __name__=="__main__":
    if(sys.version_info < (2,6,0)):
        print "Wrong Python version ", sys.version_info
        sys.exit(1)
    a = np.array([1,2,3])
    print "___CTS_AUDIO_PASS___"


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Non-lichenized Pyrenomycetes of Sweden (Lund) 7 (1992)

#### Original name
Mycosphaerella chamaemori (P. Karst.) Lindau, 1897

### Remarks
null


text:
title: Setting up a new API channel
layout: article
sort: 2
Description: Learn how to set up an API channel in Compass.
---

#Setting up a new API channel

If we don't yet have an integration in Compass, you can use our API to connect to your website or blog. For more information about the API, click [here](https://docs.google.com/document/d/1eIZ9RZznh69VXRv0k1Ys0a6hQYqU4DesfN_-VEFLN1s/edit?usp=sharing).

In this article, you'll learn how to set up a new connection to publish content via our API.

## Before your start

* Make sure we don't already have a stock integration built in Compass.
* Learn more about our API [here](https://docs.google.com/document/d/1eIZ9RZznh69VXRv0k1Ys0a6hQYqU4DesfN_-VEFLN1s/edit?usp=sharing).

## Set up a new API connection

1. Navigate to the Settings Page and click on "Channels"
2. Find API, and click "Add New"
3. Fill in a name to identify the connection and provide a Payload URL to which we'll send POST requests with scheduled times and content updates
   ![API Channel page](/images/api_details.png)
4. Click "Create"


text:
class AutoBalancePresenter < BalancePresenter
  def manually_edited
  end
end


text:
namespace MediatR.Examples.Unity
{
    using System;
    using System.Linq;
    using Microsoft.Practices.Unity;

    internal class Program
    {
        private static void Main(string[] args)
        {
            var mediator = BuildMediator();

            Runner.Run(mediator, Console.Out);

            Console.ReadKey();
        }

        private static IMediator BuildMediator()
        {
            var container = new UnityContainer();
            container.RegisterType<IMediator, Mediator>();
            container.RegisterTypes(AllClasses.FromAssemblies(typeof(Ping).Assembly), WithMappings.FromAllInterfaces, GetName, GetLifetimeManager);
            container.RegisterType(typeof(INotificationHandler<>), typeof(GenericHandler), GetName(typeof(GenericHandler)));
            container.RegisterType(typeof(IAsyncNotificationHandler<>), typeof(GenericAsyncHandler), GetName(typeof(GenericAsyncHandler)));
            container.RegisterInstance(Console.Out);
            container.RegisterInstance<SingleInstanceFactory>(t => container.Resolve(t));
            container.RegisterInstance<MultiInstanceFactory>(t => container.ResolveAll(t));

            var mediator = container.Resolve<IMediator>();

            return mediator;
        }

        static bool IsNotificationHandler(Type type)
        {
            return type.GetInterfaces().Any(x => x.IsGenericType && (x.GetGenericTypeDefinition() == typeof(INotificationHandler<>) || x.GetGenericTypeDefinition() == typeof(IAsyncNotificationHandler<>)));
        }

        static LifetimeManager GetLifetimeManager(Type type)
        {
            return IsNotificationHandler(type) ? new ContainerControlledLifetimeManager() : null;
        }

        static string GetName(Type type)
        {
            return IsNotificationHandler(type) ? string.Format("HandlerFor" + type.Name) : string.Empty;
        }
    }
}


text:
'use strict';

module.exports = {
  createInteractionHandle: function createInteractionHandle() {},
  clearInteractionHandle: function clearInteractionHandle() {}
};


text:
/**
 * TriggerObserver.java
 *
 * Interface for trigger observers
 *
 * @author Agent Team
 */

package edu.wheaton.simulator.entity;

public interface TriggerObserver {

	public void update(AgentID caller, Trigger trigger, int step);

}


text:
class GridServiceHook
  include Mongoid::Document

  field :name, type: String
  field :type, type: String
  field :cmd, type: String
  field :instances, type: Array, default: ['*']
  field :oneshot, type: Boolean, default: false
  field :done, type: Array, default: []

  embedded_in :grid_service

  # @param [Fixnum, String] instance_number
  # @return [Boolean]
  def done_for?(instance_number)
    return false unless self.oneshot
    self.done.include?(instance_number.to_s)
  end
end


text:
namespace {
class StreamStateSaver : private std::ios {
  WTF_MAKE_NONCOPYABLE(StreamStateSaver);

 public:
  StreamStateSaver(std::ios& other) : std::ios(nullptr), m_other(other) {
    copyfmt(other);
  }
  ~StreamStateSaver() { m_other.copyfmt(*this); }

 private:
  std::ios& m_other;
};
}  // unnamed namespace

namespace blink {

void PrintTo(const PaintChunk& chunk, std::ostream* os) {
  *os << "PaintChunk(begin=" << chunk.beginIndex << ", end=" << chunk.endIndex
      << ", id=";
  if (!chunk.id) {
    *os << "null";
  } else {
    *os << "(" << &chunk.id->client << ", ";
#ifndef NDEBUG
    *os << DisplayItem::typeAsDebugString(chunk.id->type);
#else
    *os << static_cast<int>(chunk.id->type);
#endif
    *os << ")";
  }
  *os << ", props=";
  PrintTo(chunk.properties, os);
  *os << ", bounds=";
  PrintTo(chunk.bounds, os);
  *os << ", knownToBeOpaque=" << chunk.knownToBeOpaque << ")";

  *os << ", rerasterizationRects=[";
  bool first = true;
  for (auto& r : chunk.rasterInvalidationRects) {
    if (!first)
      *os << ", ";
    first = false;
    PrintTo(r, os);
  };
  *os << "]";
}

void PrintTo(const PaintChunkProperties& properties, std::ostream* os) {
  *os << "PaintChunkProperties(";
  bool printedProperty = false;
  if (properties.propertyTreeState.transform()) {
    *os << "transform=";
    PrintTo(*properties.propertyTreeState.transform(), os);
    printedProperty = true;
  }

  if (properties.propertyTreeState.clip()) {
    if (printedProperty)
      *os << ", ";
    *os << "clip=";
    PrintTo(*properties.propertyTreeState.clip(), os);
    printedProperty = true;
  }

  if (properties.propertyTreeState.effect()) {
    if (printedProperty)
      *os << ", ";
    *os << "effect=";
    PrintTo(*properties.propertyTreeState.effect(), os);
    printedProperty = true;
  }

  if (properties.propertyTreeState.scroll()) {
    if (printedProperty)
      *os << ", ";
    *os << "scroll=";
    PrintTo(*properties.propertyTreeState.scroll(), os);
    printedProperty = true;
  }

  if (printedProperty)
    *os << ", ";
  *os << "backfaceHidden=" << properties.backfaceHidden;

  *os << ")";
}

void PrintTo(const ClipPaintPropertyNode& node, std::ostream* os) {
  *os << "ClipPaintPropertyNode(" << node.toString().ascii().data() << ")";
}

void PrintTo(const TransformPaintPropertyNode& node, std::ostream* os) {
  *os << "TransformPaintPropertyNode(" << node.toString().ascii().data() << ")";
}

void PrintTo(const EffectPaintPropertyNode& node, std::ostream* os) {
  *os << "EffectPaintPropertyNode(" << node.toString().ascii().data() << ")";
}

void PrintTo(const ScrollPaintPropertyNode& node, std::ostream* os) {
  *os << "ScrollPaintPropertyNode(" << node.toString().ascii().data() << ")";
}

}  // namespace blink


text: FROM gcr.io/google_containers/kubedns-amd64:1.9


text:
package tonius.emobile.network.message;

import io.netty.buffer.ByteBuf;
import tonius.emobile.EMobile;
import tonius.emobile.config.EMConfig;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;

public class MessageConfigSync implements IMessage, IMessageHandler<MessageConfigSync, IMessage> {

    public boolean allowTeleportPlayers;
    public boolean allowTeleportHome;
    public boolean allowTeleportSpawn;
    public int fluxCellphoneMaxEnergy;
    public int fluxCellphoneMaxInput;
    public int fluxCellphoneEnergyPerUse;

    @Override
    public void fromBytes(ByteBuf buf) {
        this.allowTeleportPlayers = buf.readBoolean();
        this.allowTeleportHome = buf.readBoolean();
        this.allowTeleportSpawn = buf.readBoolean();
        this.fluxCellphoneMaxEnergy = buf.readInt();
        this.fluxCellphoneMaxInput = buf.readInt();
        this.fluxCellphoneEnergyPerUse = buf.readInt();
    }

    @Override
    public void toBytes(ByteBuf buf) {
        buf.writeBoolean(EMConfig.allowTeleportPlayers);
        buf.writeBoolean(EMConfig.allowTeleportHome);
        buf.writeBoolean(EMConfig.allowTeleportSpawn);
        buf.writeInt(EMConfig.fluxCellphoneMaxEnergy);
        buf.writeInt(EMConfig.fluxCellphoneMaxInput);
        buf.writeInt(EMConfig.fluxCellphoneEnergyPerUse);
    }

    @Override
    public IMessage onMessage(MessageConfigSync msg, MessageContext ctx) {
        EMConfig.allowTeleportPlayers = msg.allowTeleportPlayers;
        EMConfig.allowTeleportHome = msg.allowTeleportHome;
        EMConfig.allowTeleportSpawn = msg.allowTeleportSpawn;
        if (EMobile.cellphoneRF != null) {
            EMobile.cellphoneRF.maxEnergy = msg.fluxCellphoneMaxEnergy;
            EMobile.cellphoneRF.maxInput = msg.fluxCellphoneMaxInput;
            EMobile.cellphoneRF.energyPerUse = msg.fluxCellphoneEnergyPerUse;
        }

        EMobile.logger.info("Received server configuration");
        return null;
    }

}


text:
using System;
using System.Drawing;
using System.Windows.Forms;
using BetterDiscordWI.panels;

namespace BetterDiscordWI {

    public partial class FormMain : Form {

        private readonly IPanel[] _panels = { new LicensePanel(), new ConfigPanel(), new InstallPanel() };
        private int _currentPanel;

        public string DiscordPath = null;
        public bool RestartDiscord = true;
        public bool Stable = true, Canary, Ptb;

        public FormMain() {
            InitializeComponent();

            foreach (var panel in _panels) {
                panel.SetForm(this);
                panel.Control.Dock = DockStyle.Fill;
                panelDock.Controls.Add(panel.Control);
            }
            SwitchPanel(0);
        }

        public void SetTitle(string title) => lblTitle.Text = title;

        public void SwitchPanel(int index) {
            _currentPanel = index;
            foreach (var panel in _panels) { panel.HidePanel(); }
            SetTitle($"BetterDiscord {_panels[index].Title}");
            _panels[index].ShowPanel();
        }

        private readonly Pen _borderPen = new Pen(Color.FromArgb(160, 160, 160));
        protected override void OnPaint(PaintEventArgs e) {
            base.OnPaint(e);

            var g = e.Graphics;
            g.FillRectangle(SystemBrushes.Window, new Rectangle(0, 0, Width, 85));
            g.DrawLine(_borderPen, 0, 85, Width, 85);
            g.DrawLine(SystemPens.Window, 0, 86, Width, 86);

            g.DrawLine(_borderPen, 0, 445, Width, 445);
            g.DrawLine(SystemPens.Window, 0, 446, Width, 446);
        }

        private void btnNext_Click(object sender, EventArgs e) {
            _currentPanel++;
            SwitchPanel(_currentPanel);
        }

        private void btnCancel_Click(object sender, EventArgs e) {
            Application.Exit();
        }

        private void btnBack_Click(object sender, EventArgs e) {
            _currentPanel--;
            SwitchPanel(_currentPanel);
        }

        public void Fail() {
            btnCancel.ShowEnable();
            btnNext.ShowDisable();
            btnBack.ShowEnable();
        }
    }
}


text:
/**
 * @summary Profile Module's Tests
 */

/**
 * Login function
 */
var login = function(authenticationService, $httpBackend, scope) {
    fake_user = {
        token: 'myfaketoken',
        user: {
            id: 4,
            username: 'lorierif',
            email: '',
            is_patient: false,
            is_doctor: true,
            is_surgeon: true
        }
    };
    $httpBackend.when('POST', "http://localhost:8000/nocc/api/v1/auth/login/").respond(fake_user);
    authenticationService.login('lorierif', 'fabrizio');
    $httpBackend.flush();
    // $scope.auth is set by the NoccController on $stateChangeSuccess
    scope.auth = {isAuthenticated: authenticationService.isAuthenticated(), user: authenticationService.getAuthenticatedUser()};
};

describe('profile: ', function() {

    var $rootScope, $modalInstance, $state, $controller, Upload;
    var doctorService, authenticationService, hospitalService, contactService, fake_user;
    var files, dialogs, $window, $httpBackend, $q, to_edit_contact;

    beforeEach(function() {
        module('nocc');
        inject(function(_$rootScope_, _$state_, _$controller_, _Upload_, _doctorService_, _authenticationService_, _hospitalService_, _contactService_, _files_, _dialogs_, _$window_, _$httpBackend_, _$q_) {
            // remove locaStorage data from previous tests
            $rootScope = _$rootScope_;
            $modalInstance = {                    // Create a mock object using spies
                close: jasmine.createSpy('modalInstance.close'),
                dismiss: jasmine.createSpy('modalInstance.dismiss'),
                result: {
                    then: jasmine.createSpy('modalInstance.result.then')
                }
            };
            $state = _$state_;
            Upload = _Upload_;
            doctorService = _doctorService_;
            contactService = _contactService_;
            hospitalService = _hospitalService_;
            authenticationService = _authenticationService_;
            files = _files_;
            $controller = _$controller_;
            $window = _$window_;
            $httpBackend = _$httpBackend_;
            $q = _$q_;
            dialogs = _dialogs_;

            var fakeModal = {
                result: {
                    then: function (confirmCallback, cancelCallback) {
                        confirmCallback('yes');
                        return this;
                    }
                },
                close: function (item) {
                    this.result.confirmCallBack(item);
                },
                dismiss: function (item) {
                    this.result.cancelCallback(item);
                }
            };
            var MokedDialogs = {
                confirm: function() { return fakeModal; }
            };
            dialogs = MokedDialogs;
        });
    });

    /**
     * Let's test access permissions
     */
    describe( 'profile permissions: ', function() {

        /**
         * An authenticated doctor can see its profile page
         */
        describe('authenticated user: ', function() {

            // authenticate
            beforeEach(function () {
                login(authenticationService, $httpBackend, {});
            });

            /**
             * Login service should set proper cookies when user successfully logs in
             */
            it( 'user can access the profile page', inject( function() {
                $state.go('profile');
                $rootScope.$digest();
                expect($state.current.name).toBe('profile');
            }));
        });

    });

    describe('main form update: ', function() {
        var scope1, scope2;
        beforeEach(function() {

            scope1 = $rootScope.$new();
            scope2 = $rootScope.$new();

            login(authenticationService, $httpBackend, scope1);

            // init user
            var fake_doctor_data = {
                id: 1,
                firstname: 'Fabrizio',
                lastname: 'Lorieri',
                is_oncologist: false,
                is_radiotherapist: false,
                is_surgeon: true,
                user: {
                    id: 1,
                    username: 'lorierif'
                }
            };
            $httpBackend.when('GET', "http://localhost:8000/nocc/api/v1/doctors/lorierif/").respond(fake_doctor_data);

            // update user
            var fake_put_doctor_data = {
                firstname: 'Fabrizio edited',
                lastname: 'Lorieri edited',
                is_oncologist: false,
                is_radiotherapist: false,
                is_surgeon: true
            };
            $httpBackend.when('PUT', "http://localhost:8000/nocc/api/v1/doctors/lorierif/").respond(fake_put_doctor_data);

            // contacts
            var fake_get_doctor_contacts = [
                {
                    id: 1,
                    phone: '144',
                    email: 'florieri@molinette.it',
                    hospital: 2,
                    hospital_obj: {
                        id: 2,
                        name: 'Molinette'
                    }
                }
            ];
            $httpBackend.when('GET', "http://localhost:8000/nocc/api/v1/doctors/lorierif/contacts/").respond(fake_get_doctor_contacts);

            var fake_get_contact_exceptions = [
                {
                    id: 1,
                    doctor_contact: 1,
                    date: '2015-06-07'
                }
            ];
            $httpBackend.when('GET', "http://localhost:8000/nocc/api/v1/doctors/lorierif/contacts/1/exceptions/").respond(fake_get_contact_exceptions);

        });

        it('profile fullname gets updated after saving the profile form', function() {
            var ProfileController = $controller('DoctorProfileCtrl', {
                $scope: scope1,
                $state: $state,
                authenticationService: authenticationService,
                doctorService: doctorService,
                files: files,
                dialogs: dialogs
            });
            $httpBackend.flush();

            expect(ProfileController.doctor.fullname).toBe('Fabrizio Lorieri');

            EditDoctorProfileCtrl = $controller('EditDoctorProfileCtrl', {
                $scope: scope2,
                $modalInstance: $modalInstance,
                $state: $state,
                Upload: Upload,
                doctorService: doctorService,
                authenticationService: authenticationService,
                data: ProfileController.doctor
            });
            // before saving
            expect(scope2.doctor.firstname).toBe('Fabrizio');
            scope2.save();
            $httpBackend.flush();

            // after saving
            expect(scope2.doctor.firstname).toBe('Fabrizio edited');
            expect(ProfileController.doctor.fullname).toBe('Fabrizio edited Lorieri edited');

        });

    });

    describe('adding contact: ', function() {
        var scope1, scope2;

        beforeEach(function() {

            scope1 = $rootScope.$new();
            scope2 = $rootScope.$new();

            login(authenticationService, $httpBackend, scope1);

            // init user
            var fake_doctor_data = {
                id: 1,
                firstname: 'Fabrizio',
                lastname: 'Lorieri',
                is_oncologist: false,
                is_radiotherapist: false,
                is_surgeon: true,
                user: {
                    id: 1,
                    username: 'lorierif'
                }
            };
            $httpBackend.when('GET', "http://localhost:8000/nocc/api/v1/doctors/lorierif/").respond(fake_doctor_data);

            // contacts
            var fake_get_doctor_contacts = [
                {
                    id: 1,
                    phone: '144',
                    email: 'florieri@molinette.it',
                    hospital: 2,
                    hospital_obj: {
                        id: 2,
                        name: 'Molinette'
                    }
                }
            ];
            $httpBackend.when('GET', "http://localhost:8000/nocc/api/v1/doctors/lorierif/contacts/").respond(fake_get_doctor_contacts);

            fake_post_contact_data = {
                id: '10',
                phone: '999',
                email: 'test@test.it',
                doctor: '2',
                hospital: '2'
            };
            $httpBackend.when('POST', "http://localhost:8000/nocc/api/v1/doctors/lorierif/contacts/").respond(fake_post_contact_data);

            var fake_get_contact_exceptions = [
                {
                    id: 1,
                    doctor_contact: 1,
                    date: '2015-06-07'
                }
            ];
            $httpBackend.when('GET', "http://localhost:8000/nocc/api/v1/doctors/lorierif/contacts/1/exceptions/").respond(fake_get_contact_exceptions);

            var fake_get_hospital_data = [
                {
                    id: 1,
                    name: 'ospedale1'
                },
                {
                    id: 2,
                    name: 'ospedale2'
                }
            ];
            $httpBackend.when('GET', "http://localhost:8000/nocc/api/v1/hospitals/").respond(fake_get_hospital_data);

        });

        it('profile contacts get updated after adding one', function() {
            var ProfileController = $controller('DoctorProfileCtrl', {
                $scope: scope1,
                $state: $state,
                authenticationService: authenticationService,
                contactService: contactService,
                doctorService: doctorService,
                files: files,
                dialogs: dialogs
            });
            $httpBackend.flush();

            AddEditDoctorContactCtrl = $controller('AddEditDoctorContactCtrl', {
                $scope: scope2,
                $modalInstance: $modalInstance,
                $state: $state,
                Upload: Upload,
                doctorService: doctorService,
                contactService: contactService,
                hospitalService: hospitalService,
                authenticationService: authenticationService,
                data: { ctrl: ProfileController, contact: null }
            });

            expect(ProfileController.doctor.contacts.length).toBe(1);
            scope2.save();
            $httpBackend.flush();
            // after saving
            expect(ProfileController.doctor.contacts.length).toBe(2);

        });

    });

    describe('editing contact: ', function() {
        var scope1, scope2;

        beforeEach(function() {

            scope1 = $rootScope.$new();
            scope2 = $rootScope.$new();

            login(authenticationService, $httpBackend, scope1);

            // init user
            var fake_doctor_data = {
                id: 1,
                firstname: 'Fabrizio',
                lastname: 'Lorieri',
                is_oncologist: false,
                is_radiotherapist: false,
                is_surgeon: true,
                user: {
                    id: 1,
                    username: 'lorierif'
                }
            };
            $httpBackend.when('GET', "http://localhost:8000/nocc/api/v1/doctors/lorierif/").respond(fake_doctor_data);

            // contacts
            var fake_get_doctor_contacts = [
                {
                    id: 1,
                    phone: '144',
                    email: 'florieri@molinette.it',
                    hospital: 2,
                    hospital_obj: {
                        id: 2,
                        name: 'Molinette'
                    }
                }
            ];
            $httpBackend.when('GET', "http://localhost:8000/nocc/api/v1/doctors/lorierif/contacts/").respond(fake_get_doctor_contacts);
            var fake_get_hospital_data = [
                {
                    id: 1,
                    name: 'ospedale1'
                },
                {
                    id: 2,
                    name: 'ospedale2'
                }
            ];
            $httpBackend.when('GET', "http://localhost:8000/nocc/api/v1/hospitals/").respond(fake_get_hospital_data);

            fake_put_contact_data = {
                id: '2',
                phone: '999',
                email: 'test@test.it',
                doctor: '2',
                hospital: '3',
                hospital_obj: {
                    id: 3,
                    name: 'Mauriziano'
                }
            };
            $httpBackend.when('PUT', "http://localhost:8000/nocc/api/v1/doctors/lorierif/contacts/1/").respond(fake_put_contact_data);

            var fake_get_contact_exceptions = [
                {
                    id: 1,
                    doctor_contact: 1,
                    date: '2015-06-07'
                }
            ];
            $httpBackend.when('GET', "http://localhost:8000/nocc/api/v1/doctors/lorierif/contacts/1/exceptions/").respond(fake_get_contact_exceptions);

        });

        it('profile editing contact, change hospital', function() {
            var ProfileController = $controller('DoctorProfileCtrl', {
                $scope: scope1,
                $state: $state,
                authenticationService: authenticationService,
                contactService: contactService,
                doctorService: doctorService,
                files: files,
                dialogs: dialogs
            });
            $httpBackend.flush();

            expect(ProfileController.doctor.contacts[0].hospital_obj.name).toBe('Molinette');

            AddEditDoctorContactCtrl = $controller('AddEditDoctorContactCtrl', {
                $scope: scope2,
                $modalInstance: $modalInstance,
                $state: $state,
                Upload: Upload,
                doctorService: doctorService,
                contactService: contactService,
                hospitalService: hospitalService,
                authenticationService: authenticationService,
                data: {
                    ctrl: ProfileController,
                    contact:  ProfileController.doctor.contacts[0]
                }
            });

            scope2.save();
            $httpBackend.flush();
            // after saving
            expect(ProfileController.doctor.contacts[0].hospital_obj.name).toBe('Mauriziano');

        });
    });

    describe('deleting contact: ', function() {
        var scope1;

        beforeEach(function() {

            scope1 = $rootScope.$new();

            login(authenticationService, $httpBackend, scope1);

            // init user
            var fake_doctor_data = {
                id: 1,
                firstname: 'Fabrizio',
                lastname: 'Lorieri',
                is_oncologist: false,
                is_radiotherapist: false,
                is_surgeon: true,
                user: {
                    id: 1,
                    username: 'lorierif'
                }
            };
            $httpBackend.when('GET', "http://localhost:8000/nocc/api/v1/doctors/lorierif/").respond(fake_doctor_data);

            // contacts
            var fake_get_doctor_contacts = [
                {
                    id: 1,
                    phone: '144',
                    email: 'florieri@molinette.it',
                    hospital: 2,
                    hospital_obj: {
                        id: 2,
                        name: 'Molinette'
                    }
                }
            ];
            $httpBackend.when('GET', "http://localhost:8000/nocc/api/v1/doctors/lorierif/contacts/").respond(fake_get_doctor_contacts);

            var fake_get_contact_exceptions = [
                {
                    id: 1,
                    doctor_contact: 1,
                    date: '2015-06-07'
                }
            ];
            $httpBackend.when('GET', "http://localhost:8000/nocc/api/v1/doctors/lorierif/contacts/1/exceptions/").respond(fake_get_contact_exceptions);

            // delete contact
            $httpBackend.when('DELETE', "http://localhost:8000/nocc/api/v1/doctors/lorierif/contacts/1/").respond({});

        });

        it('profile delete contact', function() {
            var ProfileController = $controller('DoctorProfileCtrl', {
                $scope: scope1,
                $state: $state,
                authenticationService: authenticationService,
                contactService: contactService,
                doctorService: doctorService,
                files: files,
                dialogs: dialogs
            });
            $httpBackend.flush();

            expect(ProfileController.doctor.contacts.length).toBe(1);

            ProfileController.confirmAndDelete(ProfileController.doctor.contacts[0]);
            $httpBackend.flush();
            expect(ProfileController.doctor.contacts.length).toBe(0);
        });
    });

    // @TODO test exceptions creation
    describe('deleting exception: ', function() {
        var scope1;

        beforeEach(function() {

            scope1 = $rootScope.$new();

            login(authenticationService, $httpBackend, scope1);

            // init user
            var fake_doctor_data = {
                id: 1,
                firstname: 'Fabrizio',
                lastname: 'Lorieri',
                is_oncologist: false,
                is_radiotherapist: false,
                is_surgeon: true,
                user: {
                    id: 1,
                    username: 'lorierif'
                }
            };
            $httpBackend.when('GET', "http://localhost:8000/nocc/api/v1/doctors/lorierif/").respond(fake_doctor_data);

            // contacts
            var fake_get_doctor_contacts = [
                {
                    id: 1,
                    phone: '144',
                    email: 'florieri@molinette.it',
                    hospital: 2,
                    hospital_obj: {
                        id: 2,
                        name: 'Molinette'
                    }
                }
            ];
            $httpBackend.when('GET', "http://localhost:8000/nocc/api/v1/doctors/lorierif/contacts/").respond(fake_get_doctor_contacts);

            var fake_get_contact_exceptions = [
                {
                    id: 1,
                    doctor_contact: 1,
                    date: '2015-06-07'
                }
            ];
            $httpBackend.when('GET', "http://localhost:8000/nocc/api/v1/doctors/lorierif/contacts/1/exceptions/").respond(fake_get_contact_exceptions);

            // delete exception
            $httpBackend.when('DELETE', "http://localhost:8000/nocc/api/v1/doctors/lorierif/contacts/1/exceptions/1/").respond({});

        });

        it('profile delete contact exception', function() {
            var ProfileController = $controller('DoctorProfileCtrl', {
                $scope: scope1,
                $state: $state,
                authenticationService: authenticationService,
                contactService: contactService,
                doctorService: doctorService,
                files: files,
                dialogs: dialogs
            });
            $httpBackend.flush();

            expect(ProfileController.doctor.contacts[0].exceptions.length).toBe(1);

            ProfileController.confirmAndDeleteException(ProfileController.doctor.contacts[0], ProfileController.doctor.contacts[0].exceptions[0]);
            $httpBackend.flush();
            expect(ProfileController.doctor.contacts[0].exceptions.length).toBe(0);
        });
    });

});


text:
<title>Testcase for bug 25663</title>

        Welcome to the new DaveCentral!
I have a new
        Linux software archive as well as the Windows archive
        you have come to know and love.

        ANDOVER.NET
E-COMMERCE

        Buy some smart stuff from Andover.Net


text:
@implementation PUAppDelegate

- (UIWindow *)window
{
    if (!_window) {
        _window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    }

    return _window;
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[[PUViewController alloc] init]];
    [self.window makeKeyAndVisible];

    return YES;
}

@end


text:
define.class('$base/node', function (require, exports, self){
	self.event('move')
	self.attribute('x', {type:float})
	self.attribute('y', {type:float})
	self.attribute('isdown', {type:int})
	self.attribute('left', {type:int})
	self.attribute('middle', {type:int})
	self.attribute('right', {type:int})
	self.attribute('click', {type:Object})
	self.attribute('dblclick', {type:Object})
	self.attribute('clicker', {type:int})
	self.attribute('leftdown', {type:int})
	self.attribute('leftup', {type:int})
	self.attribute('rightdown', {type:int})
	self.attribute('rightup', {type:int})

	self.ratio = 0

	self.activedown = 0;

	self.clickspeed = 350

	self.atConstructor = function(){
		x = 0
		y = 0
		if(this.ratio == 0) this.ratio = window.devicePixelRatio

		document.ontouchmove = function(e){
			e.preventDefault()
		}
		// allright we need to figure out how we send back the mouse events to the worker
		// are we going to send a vec2? or something else
		window.addEventListener('click', function(e){
			this.click = 1
		}.bind(this))

		window.addEventListener('dblclick', function(e){
			this.dblclick = 1
		}.bind(this))

		var click_count = 0

		window.addEventListener('mousedown', function(e){
			var now = Date.now()
			if (this.activedown == 0){
				//document.body.setCapture();
			}
			this.activedown++;
			if(this.last_click !== undefined && now - this.last_click < this.clickspeed){
				click_count ++
			}
			else click_count = 1
			this.last_click = now

			this.clicker = this.click_count

			this.x = e.pageX// / this.ratio//* window.devicePixelRatio
			this.y = e.pageY// / this.ratio//* window.devicePixelRatio

			if(e.button === 0 ) this.cancapture = 1, this.left = 1, this.leftdown = 1
			if(e.button === 1 ) this.cancapture = 3, this.middle = 1
			if(e.button === 2 ) this.cancapture = 2, this.right = 1, this.rightdown = 1
			this.isdown = 1
		}.bind(this))

		window.addEventListener('mouseup', function(e){
			this.activedown--;
			if (this.activedown == 0){
				//document.body.releaseCapture();
			}

			this.x = e.pageX// / this.ratio//* window.devicePixelRatio
			this.y = e.pageY// / this.ratio //* window.devicePixelRatio
			this.cancapture = 0
			if(e.button === 0) this.left = 0, this.leftup = 1
			if(e.button === 1) this.middle = 0
			if(e.button === 2) this.right = 0, this.rightup = 1
			this.isdown = 0
		}.bind(this))

		window.addEventListener('mousemove', function(e){
			//last_click = undefined
			//if(layer) hit = layer.hitTest2D(e.pageX * ratio, e.pageY * ratio)
			this.x = e.pageX// / this.ratio//* window.devicePixelRatio
			this.y = e.pageY// / this.ratio//* window.devicePixelRatio
			this.move = 1
		}.bind(this))
	}
})


text: export { default } from 'yuidork/models/yuidoc-version';


text:
[![Build Status](https://travis-ci.org/Nevon/express-physical.svg?branch=master)](https://travis-ci.org/Nevon/express-physical) [![npm version](https://badge.fury.io/js/express-physical.svg)](https://badge.fury.io/js/express-physical) [![DeepScan Grade](https://deepscan.io/api/projects/1064/branches/2168/badge/grade.svg)](https://deepscan.io/dashboard/#view=project&pid=1064&bid=2168) [![Known Vulnerabilities](https://snyk.io/test/github/nevon/express-physical/badge.svg)](https://snyk.io/test/github/nevon/express-physical)

Healthcheck middleware for Express.

[![asciicast](https://asciinema.org/a/115940.png)](https://asciinema.org/a/115940?preload=1&autoplay=1&speed=1.7)

## Purpose

`express-physical` is intended to be more or less a port of [physical](https://github.com/alde/physical). The intention is to have Dropwizard-style healthchecks for Node.

## Installation

```shell
npm install --save express-physical
# or
yarn add express-physical
```

## Usage

```javascript
const express = require('express')
const physical = require('express-physical')

const app = express()

const passingCheck = () => physical.response({
  name: 'Sample passing check',
  actionable: false,
  healthy: true,
  type: physical.type.SELF
})

app.use('/healthcheck', physical([passingCheck]))
```

`/healthcheck` will respond with the result of all checks, with a status code of 200.

## API

```javascript
const physical = require('express-physical')
```

The `physical` function expects an array of `Check`s and returns a middleware.

### `physical([Check])`

Returns a middleware that returns an object with the currently healthy and unhealthy checks:

```
const middleware = physical([alwaysPassing, alwaysFailing])

// Will send a 200 OK with the following payload:

{
  "healthy": [{
    "name": "Always passing",
    "actionable": false,
    "type": "SELF",
    "healthy": true
  }],
  "unhealthy": [{
    "name": "Always failing",
    "actionable": false,
    "type": "SELF",
    "healthy": false,
    "message": "What can you do...?",
    "severity": "WARNING"
  }]
}
```

### Check(fn)

`Check` is not a class provided by `physical`, it is simply a function with one of two forms:

```javascript
//Synchronous check
const synchronousCheck = function () {
  return physical.response(...)
}

// Async Check
const asyncCheck = function (done) {
  done(physical.response(...))
}
```

The check must always return or call the callback with a `physical.response`.

If the check throws an error, it will be forwarded to the next middleware where it has to be handled by the application. It will **not** be caught by the `physical` middleware and treated as a failing check.

### `physical.response({ options })`

| Option | Description | Mandatory |
| --- | --- | --- |
| `name` string | A descriptive name | Yes |
| `healthy` boolean | | Yes |
| `type` physical.type | The type of this check | Yes |
| `severity` physical.severity | | When the check is unhealthy |
| `actionable` boolean | Whether or not the owner can act on this check failing | Yes |
| `message` string | | When the check is unhealthy |
| `dependentOn` string | The name of a service that this check relies on | When the `type` is one of `INFRASTRUCTURE`, `INTERNAL_DEPENDENCY` and `EXTERNAL_DEPENDENCY`. Excluded otherwise.
| `info` object{string,object} | Object of any depth with additional info about this check. | No |
| `link` string | A URL to where more information can be found | No

If your `physical.response` is invalid, an `InvalidHealthcheckResponse` error will be thrown. The original response data is available at `InvalidHealthcheckResponse.responseData`.

### `physical.type`

Constants representing the type of a check.

* `SELF`
* `METRICS`
* `INFRASTRUCTURE`
* `INTERNAL_DEPENDENCY`
* `EXTERNAL_DEPENDENCY`
* `INTERNET_CONNECTIVITY`

### `physical.severity`

Constants representing the severity of a failing check.

* `WARNING`
* `CRITICAL`
* `DOWN`

## Prior art

* [express-healthcheck](https://www.npmjs.com/package/express-healthcheck) - A little _too_ simple for my use case, where I can have multiple independently failing checks where I want to provide data regarding all of them. `express-physical` could be implemented within `express-healthcheck`, but I'm looking for something a little more structured.
* [node-healthchecks](https://github.com/broadly/node-healthchecks) - Checks the system by trying to request public resources, but couldn't, for example, tell you if you're unable to connect to the database.
* Heavily inspired by [physical](https://github.com/alde/physical). The API contract is essentially the same.

## Tips

### Some of my healthchecks are more expensive than others to run

`express-physical` does not expose a way to configure the interval at which healthchecks are invoked. If one of your healthchecks is too expensive to be run every time your monitoring system polls the healthcheck endpoint, throttle your function call so that it returns a cached value if called multiple times within a certain interval.

### I need to pass arguments into my healthcheck

Checks _need_ to receive either one or zero arguments, where that argument is a callback that will be provided by `express-physical`. If you have to pass more arguments into it, pass them when you create the check rather than at time of invokation.

```
const (db) => (done) => db.isHealthy((err, res) => done(physical.response({ ... })))
```

### Avoiding repeating data for `responses`

Use a higher-order function to avoid having to repeat certain elements when creating `responses`. Ex.

```javascript
const physical = require('express-physical')

const createDatabaseHealthCheck = (data) => (db) => (done) => {
  if (db.connection.readyState === 1) {
    done(Object.assign({}, data, physical.response({
      healthy: true,
      actionable: false
    })))
  } else {
    done(Object.assign({}, data, physical.response({
      healthy: false,
      actionable: true,
      severity: physical.severity.CRITICAL,
      message: 'Failed to connect to db'
    })))
  }
}

const canConnectToDatabase = createDatabaseHealthCheck({
  name: 'Database connection',
  type: physical.type.INTERNAL_DEPENDENCY,
  dependentOn: {
    serviceName: 'mongodb'
  }
})(db)

app.use('/healthcheck', physical([canConnectToDatabase]))
```

## Contributing

Contributions are more than welcome. However, if your contribution goes beyond bug fixing, it is recommended that you first [create an issue](https://github.com/Nevon/express-physical/issues/new), in order to agree on a solution before investing time into implementing something that may not be merged. Changes that affect the schema are very unlikely to be accepted.

### Testing

Contributions are expected to be tested to a reasonable degree.

* Run unit tests with `npm run test:unit`
* Run API tests with `npm run test:integration`
* Run the linter with `npm run lint`

### Formatting

Formatting is done using [Prettier](https://github.com/prettier/prettier). There is a pre-commit hook that should format your code automatically, but if you want to manually format it, run `npm run format`.

### Benchmarks

If you are concerned with the performance implications of your change, there are benchmarks that you can run to find out. In order to run them, you need to have `docker` and `docker-compose` installed. Information on [how to install Docker is available here](https://docs.docker.com/compose/install/).

To run the benchmarks, run `npm run benchmark`. The benchmarks will be run against your local branch and a reference version of physical. Some variance is to be expected, but if your change has a drastic impact, consider creating an issue to discuss it if you need help.

To change the reference version of physical that you want to run the benchmarks against, change the version in [scripts/performance/benchmarks/package.json](scripts/performance/benchmarks/package.json) and run `npm run benchmark:rebuild`.

**📣 Note that the benchmarks are a work in progress. Contributions for adding more benchmarks are very welcome!**


text:
package com.funtl.framework.alipay.trade.pay.protocol.downloadbill.internal.util;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StringWriter;
import java.security.KeyFactory;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

import javax.crypto.Cipher;

import com.funtl.framework.alipay.trade.pay.protocol.downloadbill.api.AlipayApiException;
import com.funtl.framework.alipay.trade.pay.protocol.downloadbill.api.AlipayConstants;
import com.funtl.framework.alipay.trade.pay.protocol.downloadbill.internal.codec.Base64;

/**
 * @author runzhi
 */
public class AlipaySignature {

	/**
	 * RSA最大加密明文大小
	 */
	private static final int MAX_ENCRYPT_BLOCK = 117;

	/**
	 * RSA最大解密密文大小
	 */
	private static final int MAX_DECRYPT_BLOCK = 128;

	public static String getSignatureContent(RequestParametersHolder requestHolder) {
		Map<String, String> sortedParams = new TreeMap<String, String>();
		AlipayHashMap appParams = requestHolder.getApplicationParams();
		if (appParams != null && appParams.size() > 0) {
			sortedParams.putAll(appParams);
		}
		AlipayHashMap protocalMustParams = requestHolder.getProtocalMustParams();
		if (protocalMustParams != null && protocalMustParams.size() > 0) {
			sortedParams.putAll(protocalMustParams);
		}
		AlipayHashMap protocalOptParams = requestHolder.getProtocalOptParams();
		if (protocalOptParams != null && protocalOptParams.size() > 0) {
			sortedParams.putAll(protocalOptParams);
		}

		return getSignContent(sortedParams);
	}

	/**
	 * @param sortedParams
	 * @return
	 */
	public static String getSignContent(Map<String, String> sortedParams) {
		StringBuffer content = new StringBuffer();
		List<String> keys = new ArrayList<String>(sortedParams.keySet());
		Collections.sort(keys);
		int index = 0;
		for (int i = 0; i < keys.size(); i++) {
			String key = keys.get(i);
			String value = sortedParams.get(key);
			if (StringUtils.areNotEmpty(key, value)) {
				content.append((index == 0 ? "" : "&") + key + "=" + value);
				index++;
			}
		}
		return content.toString();
	}

	public static String rsaSign(String content, String privateKey, String charset) throws AlipayApiException {
		try {
			PrivateKey priKey = getPrivateKeyFromPKCS8(AlipayConstants.SIGN_TYPE_RSA, new ByteArrayInputStream(privateKey.getBytes()));

			java.security.Signature signature = java.security.Signature.getInstance(AlipayConstants.SIGN_ALGORITHMS);

			signature.initSign(priKey);

			if (StringUtils.isEmpty(charset)) {
				signature.update(content.getBytes());
			} else {
				signature.update(content.getBytes(charset));
			}

			byte[] signed = signature.sign();

			return new String(Base64.encodeBase64(signed));
		} catch (Exception e) {
			throw new AlipayApiException("RSAcontent = " + content + "; charset = " + charset, e);
		}
	}

	public static String rsaSign(Map<String, String> params, String privateKey, String charset) throws AlipayApiException {
		String signContent = getSignContent(params);

		return rsaSign(signContent, privateKey, charset);

	}

	public static PrivateKey getPrivateKeyFromPKCS8(String algorithm, InputStream ins) throws Exception {
		if (ins == null || StringUtils.isEmpty(algorithm)) {
			return null;
		}

		KeyFactory keyFactory = KeyFactory.getInstance(algorithm);

		byte[] encodedKey = StreamUtil.readText(ins).getBytes();

		encodedKey = Base64.decodeBase64(encodedKey);

		return keyFactory.generatePrivate(new PKCS8EncodedKeySpec(encodedKey));
	}

	public static String getSignCheckContentV1(Map<String, String> params) {
		if (params == null) {
			return null;
		}

		params.remove("sign");
		params.remove("sign_type");

		StringBuffer content = new StringBuffer();
		List<String> keys = new ArrayList<String>(params.keySet());
		Collections.sort(keys);

		for (int i = 0; i < keys.size(); i++) {
			String key = keys.get(i);
			String value = params.get(key);
			content.append((i == 0 ? "" : "&") + key + "=" + value);
		}

		return content.toString();
	}

	public static String getSignCheckContentV2(Map<String, String> params) {
		if (params == null) {
			return null;
		}

		params.remove("sign");

		StringBuffer content = new StringBuffer();
		List<String> keys = new ArrayList<String>(params.keySet());
		Collections.sort(keys);

		for (int i = 0; i < keys.size(); i++) {
			String key = keys.get(i);
			String value = params.get(key);
			content.append((i == 0 ? "" : "&") + key + "=" + value);
		}

		return content.toString();
	}

	public static boolean rsaCheckV1(Map<String, String> params, String publicKey, String charset) throws AlipayApiException {
		String sign = params.get("sign");
		String content = getSignCheckContentV1(params);

		return rsaCheckContent(content, sign, publicKey, charset);
	}

	public static boolean rsaCheckV2(Map<String, String> params, String publicKey, String charset) throws AlipayApiException {
		String sign = params.get("sign");
		String content = getSignCheckContentV2(params);

		return rsaCheckContent(content, sign, publicKey, charset);
	}

	public static boolean rsaCheckContent(String content, String sign, String publicKey, String charset) throws AlipayApiException {
		try {
			PublicKey pubKey = getPublicKeyFromX509("RSA", new ByteArrayInputStream(publicKey.getBytes()));

			java.security.Signature signature = java.security.Signature.getInstance(AlipayConstants.SIGN_ALGORITHMS);

			signature.initVerify(pubKey);

			if (StringUtils.isEmpty(charset)) {
				signature.update(content.getBytes());
			} else {
				signature.update(content.getBytes(charset));
			}

			return signature.verify(Base64.decodeBase64(sign.getBytes()));
		} catch (Exception e) {
			throw new AlipayApiException("RSAcontent = " + content + ",sign=" + sign + ",charset = " + charset, e);
		}
	}

	public static PublicKey getPublicKeyFromX509(String algorithm, InputStream ins) throws Exception {
		KeyFactory keyFactory = KeyFactory.getInstance(algorithm);

		StringWriter writer = new StringWriter();
		StreamUtil.io(new InputStreamReader(ins), writer);

		byte[] encodedKey = writer.toString().getBytes();

		encodedKey = Base64.decodeBase64(encodedKey);

		return keyFactory.generatePublic(new X509EncodedKeySpec(encodedKey));
	}

	/**
	 * 验签并解密
	 *

	 * 目前适用于公众号

	 * params参数示例:
	 *
{
	 *
biz_content=M0qGiGz+8kIpxe8aF4geWJdBn0aBTuJRQItLHo9R7o5JGhpic/MIUjvXo2BLB++BbkSq2OsJCEQFDZ0zK5AJYwvBgeRX30gvEj6eXqXRt16/IkB9HzAccEqKmRHrZJ7PjQWE0KfvDAHsJqFIeMvEYk1Zei2QkwSQPlso7K0oheo/iT+HYE8aTATnkqD/ByD9iNDtGg38pCa2xnnns63abKsKoV8h0DfHWgPH62urGY7Pye3r9FCOXA2Ykm8X4/Bl1bWFN/PFCEJHWe/HXj8KJKjWMO6ttsoV0xRGfeyUO8agu6t587Dl5ux5zD/s8Lbg5QXygaOwo3Fz1G8EqmGhi4+soEIQb8DBYanQOS3X+m46tVqBGMw8Oe+hsyIMpsjwF4HaPKMr37zpW3fe7xOMuimbZ0wq53YP/jhQv6XWodjT3mL0H5ACqcsSn727B5ztquzCPiwrqyjUHjJQQefFTzOse8snaWNQTUsQS7aLsHq0FveGpSBYORyA90qPdiTjXIkVP7mAiYiAIWW9pCEC7F3XtViKTZ8FRMM9ySicfuAlf3jtap6v2KPMtQv70X+hlmzO/IXB6W0Ep8DovkF5rB4r/BJYJLw/6AS0LZM9w5JfnAZhfGM2rKzpfNsgpOgEZS1WleG4I2hoQC0nxg9IcP0Hs+nWIPkEUcYNaiXqeBc=,
	 *
sign=rlqgA8O+RzHBVYLyHmrbODVSANWPXf3pSrr82OCO/bm3upZiXSYrX5fZr6UBmG6BZRAydEyTIguEW6VRuAKjnaO/sOiR9BsSrOdXbD5Rhos/Xt7/mGUWbTOt/F+3W0/XLuDNmuYg1yIC/6hzkg44kgtdSTsQbOC9gWM7ayB4J4c=,
	 * sign_type=RSA,
	 *
charset=UTF-8
	 *
}
	 *

	 *
	 * @param params
	 * @param alipayPublicKey 支付宝公钥
	 * @param cusPrivateKey   商户私钥
	 * @param isCheckSign     是否验签
	 * @param isDecrypt       是否解密
	 * @return 解密后明文,验签失败则异常抛出
	 * @throws AlipayApiException
	 */
	public static String checkSignAndDecrypt(Map<String, String> params, String alipayPublicKey, String cusPrivateKey, boolean isCheckSign, boolean isDecrypt) throws AlipayApiException {
		String charset = params.get("charset");
		String bizContent = params.get("biz_content");
		if (isCheckSign) {
			if (!rsaCheckV2(params, alipayPublicKey, charset)) {
				throw new AlipayApiException("rsaCheck failure:rsaParams=" + params);
			}
		}

		if (isDecrypt) {
			return rsaDecrypt(bizContent, cusPrivateKey, charset);
		}

		return bizContent;
	}

	/**
	 * 加密并签名

	 * 目前适用于公众号
	 *
	 * @param bizContent      待加密、签名内容
	 * @param alipayPublicKey 支付宝公钥
	 * @param cusPrivateKey   商户私钥
	 * @param charset         字符集,如UTF-8, GBK, GB2312
	 * @param isEncrypt       是否加密,true-加密  false-不加密
	 * @param isSign          是否签名,true-签名  false-不签名
	 * @return 加密、签名后xml内容字符串
	 *

	 * 返回示例:
	 * <alipay>
	 * <response>密文</response>
	 * <encryption_type>RSA</encryption_type>
	 * <sign>sign</sign>
	 * <sign_type>RSA</sign_type>
	 * </alipay>
	 *

	 * @throws AlipayApiException
	 */
	public static String encryptAndSign(String bizContent, String alipayPublicKey, String cusPrivateKey, String charset, boolean isEncrypt, boolean isSign) throws AlipayApiException {
		StringBuilder sb = new StringBuilder();
		if (StringUtils.isEmpty(charset)) {
			charset = AlipayConstants.CHARSET_GBK;
		}
		sb.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>");
		if (isEncrypt) {// 加密
			sb.append("<alipay>");
			String encrypted = rsaEncrypt(bizContent, alipayPublicKey, charset);
			sb.append("<response>" + encrypted + "</response>");
			sb.append("<encryption_type>RSA</encryption_type>");
			if (isSign) {
				String sign = rsaSign(encrypted, cusPrivateKey, charset);
				sb.append("<sign>" + sign + "</sign>");
				sb.append("<sign_type>RSA</sign_type>");
			}
			sb.append("</alipay>");
		} else if (isSign) {// 不加密,但需要签名
			sb.append("<alipay>");
			sb.append("<response>" + bizContent + "</response>");
			String sign = rsaSign(bizContent, cusPrivateKey, charset);
			sb.append("<sign>" + sign + "</sign>");
			sb.append("<sign_type>RSA</sign_type>");
			sb.append("</alipay>");
		} else {// 不加密,不加签
			sb.append(bizContent);
		}
		return sb.toString();
	}

	/**
	 * 公钥加密
	 *
	 * @param content   待加密内容
	 * @param publicKey 公钥
	 * @param charset   字符集,如UTF-8, GBK, GB2312
	 * @return 密文内容
	 * @throws AlipayApiException
	 */
	public static String rsaEncrypt(String content, String publicKey, String charset) throws AlipayApiException {
		try {
			PublicKey pubKey = getPublicKeyFromX509(AlipayConstants.SIGN_TYPE_RSA, new ByteArrayInputStream(publicKey.getBytes()));
			Cipher cipher = Cipher.getInstance(AlipayConstants.SIGN_TYPE_RSA);
			cipher.init(Cipher.ENCRYPT_MODE, pubKey);
			byte[] data = StringUtils.isEmpty(charset) ? content.getBytes() : content.getBytes(charset);
			int inputLen = data.length;
			ByteArrayOutputStream out = new ByteArrayOutputStream();
			int offSet = 0;
			byte[] cache;
			int i = 0;
			// 对数据分段加密
			while (inputLen - offSet > 0) {
				if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {
					cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);
				} else {
					cache = cipher.doFinal(data, offSet, inputLen - offSet);
				}
				out.write(cache, 0, cache.length);
				i++;
				offSet = i * MAX_ENCRYPT_BLOCK;
			}
			byte[] encryptedData = Base64.encodeBase64(out.toByteArray());
			out.close();

			return StringUtils.isEmpty(charset) ? new String(encryptedData) : new String(encryptedData, charset);
		} catch (Exception e) {
			throw new AlipayApiException("EncryptContent = " + content + ",charset = " + charset, e);
		}
	}

	/**
	 * 私钥解密
	 *
	 * @param content    待解密内容
	 * @param privateKey 私钥
	 * @param charset    字符集,如UTF-8, GBK, GB2312
	 * @return 明文内容
	 * @throws AlipayApiException
	 */
	public static String rsaDecrypt(String content, String privateKey, String charset) throws AlipayApiException {
		try {
			PrivateKey priKey = getPrivateKeyFromPKCS8(AlipayConstants.SIGN_TYPE_RSA, new ByteArrayInputStream(privateKey.getBytes()));
			Cipher cipher = Cipher.getInstance(AlipayConstants.SIGN_TYPE_RSA);
			cipher.init(Cipher.DECRYPT_MODE, priKey);
			byte[] encryptedData = StringUtils.isEmpty(charset) ? Base64.decodeBase64(content.getBytes()) : Base64.decodeBase64(content.getBytes(charset));
			int inputLen = encryptedData.length;
			ByteArrayOutputStream out = new ByteArrayOutputStream();
			int offSet = 0;
			byte[] cache;
			int i = 0;
			// 对数据分段解密
			while (inputLen - offSet > 0) {
				if (inputLen - offSet > MAX_DECRYPT_BLOCK) {
					cache = cipher.doFinal(encryptedData, offSet, MAX_DECRYPT_BLOCK);
				} else {
					cache = cipher.doFinal(encryptedData, offSet, inputLen - offSet);
				}
				out.write(cache, 0, cache.length);
				i++;
				offSet = i * MAX_DECRYPT_BLOCK;
			}
			byte[] decryptedData = out.toByteArray();
			out.close();

			return StringUtils.isEmpty(charset) ? new String(decryptedData) : new String(decryptedData, charset);
		} catch (Exception e) {
			throw new AlipayApiException("EncodeContent = " + content + ",charset = " + charset, e);
		}
	}

}


text:
/**
 * EmailFileAttachment.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */

package com.sforce.soap.partner;

public class EmailFileAttachment  implements java.io.Serializable {
    private byte[] body;

    private java.lang.String contentType;

    private java.lang.String fileName;

    private java.lang.Boolean inline;

    public EmailFileAttachment() {
    }

    public EmailFileAttachment(
           byte[] body,
           java.lang.String contentType,
           java.lang.String fileName,
           java.lang.Boolean inline) {
           this.body = body;
           this.contentType = contentType;
           this.fileName = fileName;
           this.inline = inline;
    }

    /**
     * Gets the body value for this EmailFileAttachment.
     *
     * @return body
     */
    public byte[] getBody() {
        return body;
    }

    /**
     * Sets the body value for this EmailFileAttachment.
     *
     * @param body
     */
    public void setBody(byte[] body) {
        this.body = body;
    }

    /**
     * Gets the contentType value for this EmailFileAttachment.
     *
     * @return contentType
     */
    public java.lang.String getContentType() {
        return contentType;
    }

    /**
     * Sets the contentType value for this EmailFileAttachment.
     *
     * @param contentType
     */
    public void setContentType(java.lang.String contentType) {
        this.contentType = contentType;
    }

    /**
     * Gets the fileName value for this EmailFileAttachment.
     *
     * @return fileName
     */
    public java.lang.String getFileName() {
        return fileName;
    }

    /**
     * Sets the fileName value for this EmailFileAttachment.
     *
     * @param fileName
     */
    public void setFileName(java.lang.String fileName) {
        this.fileName = fileName;
    }

    /**
     * Gets the inline value for this EmailFileAttachment.
     *
     * @return inline
     */
    public java.lang.Boolean getInline() {
        return inline;
    }

    /**
     * Sets the inline value for this EmailFileAttachment.
     *
     * @param inline
     */
    public void setInline(java.lang.Boolean inline) {
        this.inline = inline;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof EmailFileAttachment)) return false;
        EmailFileAttachment other = (EmailFileAttachment) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
            ((this.body==null && other.getBody()==null) ||
             (this.body!=null &&
              java.util.Arrays.equals(this.body, other.getBody()))) &&
            ((this.contentType==null && other.getContentType()==null) ||
             (this.contentType!=null &&
              this.contentType.equals(other.getContentType()))) &&
            ((this.fileName==null && other.getFileName()==null) ||
             (this.fileName!=null &&
              this.fileName.equals(other.getFileName()))) &&
            ((this.inline==null && other.getInline()==null) ||
             (this.inline!=null &&
              this.inline.equals(other.getInline())));
        __equalsCalc = null;
        return _equals;
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        if (getBody() != null) {
            for (int i=0;
                 i<java.lang.reflect.Array.getLength(getBody());
                 i++) {
                java.lang.Object obj = java.lang.reflect.Array.get(getBody(), i);
                if (obj != null &&
                    !obj.getClass().isArray()) {
                    _hashCode += obj.hashCode();
                }
            }
        }
        if (getContentType() != null) {
            _hashCode += getContentType().hashCode();
        }
        if (getFileName() != null) {
            _hashCode += getFileName().hashCode();
        }
        if (getInline() != null) {
            _hashCode += getInline().hashCode();
        }
        __hashCodeCalc = false;
        return _hashCode;
    }

    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(EmailFileAttachment.class, true);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("urn:partner.soap.sforce.com", "EmailFileAttachment"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("body");
        elemField.setXmlName(new javax.xml.namespace.QName("urn:partner.soap.sforce.com", "body"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "base64Binary"));
        elemField.setMinOccurs(0);
        elemField.setNillable(true);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("contentType");
        elemField.setXmlName(new javax.xml.namespace.QName("urn:partner.soap.sforce.com", "contentType"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setMinOccurs(0);
        elemField.setNillable(true);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("fileName");
        elemField.setXmlName(new javax.xml.namespace.QName("urn:partner.soap.sforce.com", "fileName"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("inline");
        elemField.setXmlName(new javax.xml.namespace.QName("urn:partner.soap.sforce.com", "inline"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }

    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }

    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }

    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }

}


text:
Liste de pionnières de la musique électronique et électro-acoustique

Clara Rockmore (1911 – 1998)
https://fr.wikipedia.org/wiki/Clara_Rockmore

Else Marie Pade (1924 - 2016)
https://fr.wikipedia.org/wiki/Else_Marie_Pade

Daphne Oram (1925 – 2003)
https://fr.wikipedia.org/wiki/Daphne_Oram

Bebe Barron (1925 – 2008),
https://fr.wikipedia.org/wiki/Bebe_et_Louis_Barron

Pauline Oliveros (1932 - 2016)
https://fr.wikipedia.org/wiki/Pauline_Oliveros

Delia Ann Derbyshire (1937 - 2011)
https://fr.wikipedia.org/wiki/Delia_Derbyshire

Eliane Radigue (née en 1932)
https://fr.wikipedia.org/wiki/%C3%89liane_Radigue

Maryanne Amacher (1938 – 2009)
https://fr.wikipedia.org/wiki/Maryanne_Amacher

Joanna Brouk (1949 - 2017)
https://en.wikipedia.org/wiki/Joanna_Brouk

Laurie Spiegel (1945 -)
https://fr.wikipedia.org/wiki/Laurie_Spiegel

Suzanne Ciani (1946 -)
https://fr.wikipedia.org/wiki/Suzanne_Ciani

Si vous en connaissez d'autres qui ne sont pas citées ici, merci de nous les signaler.

## Sisters with transistors

Site officiel du documentaire de Lisa Rovner "Sisters with transistors" (en attente de distributeur en France) :

https://sisterswithtransistors.com/

Discussion autour du documentaire (merci à Thibaut pour ce lien) :

https://www.youtube.com/watch?v=uldUbp229EY

Si vous voulez proposer ce programme à la chaîne Arte, c'est par ici que ça se passe :

https://www.arte.tv/question/?lang=fr

## Ressources complémentaires :

https://culturacolectiva.com/music/female-electronic-music-pioneers

https://www.pinterest.ca/thistastylife/women-pioneers-of-electronic-music-/

https://thevinylfactory.com/features/the-pioneering-women-of-electronic-music-an-interactive-timeline/

https://www.flavorwire.com/335503/10-female-electronic-music-pioneers-you-should-know

https://cdm.link/2021/01/a-new-look-at-electronic-musics-female-pioneers-in-limited-streaming-now/

https://metrograph.com/live-screenings/sisters-with-transistors/

## Documentaire sur Delia Derbyshire ("The Delian Mode")

https://www.youtube.com/watch?v=nXnmSgaeGAI

## Ressources spécifiques à Joanna Brouk :

https://www.allmusic.com/artist/joanna-brouk-mn0002169359/biography?cmpredirect

https://www.junodownload.com/artists/Joanna+Brouk/

https://archive.org/search.php?query=joanna%20brouk

Interview de Joanna Brouk après un concert donné à Nantes en 2017 :

https://www.youtube.com/watch?v=1T5o2Lh42H0

## Un mot sur Kate Bush (1958 - )

https://fr.wikipedia.org/wiki/Kate_Bush

Peut-on classer Kate Bush dans la catégorie des pionnières de la musique électro ? On serait tenté de dire "oui", mais tout le monde ne sera peut être pas d'accord.

En tout cas, ce qui est certain, c'est que par sa manière très personnelle d'utiliser les synthés et les samples, et de gérer la spatialisation du son, dans des albums aujourd'hui cultes comme "Hounds of Love" (1985), elle a durablement marqué l'industrie du disque. Ses dernières productions sont sans doute plus "sages" (ou plus "apaisées" ?) que celles des années 80 et 90, mais elle demeure une source d'inpiration pour un grand nombre d'artistes actuels.

On peut dire, sans trop de risque de se tromper, qu'elle a été pionnière dans le monde des "Producers", au sens où on entend le terme de Producteur dans le lexique anglophone propre à la musique électro actuelle.

Deux documentaires et une vidéo pour découvrir l'univers de cette immense artiste :

https://www.youtube.com/watch?v=c4sLwt8mhZs

https://www.youtube.com/watch?v=bfn66mUK0WI

https://www.youtube.com/watch?v=m17Eivz_L1o

## Ressources bibliographiques :

"Le Chant de la machine" de David Blot et Mathias Cousin, BD publiée en 2016 (merci Anaïs)