text:
import {DeckPage} from "./deck.po";
import {browser, by, protractor} from 'protractor';

describe('deck-page', () => {
    let page: DeckPage;

    beforeEach(() => {
        page = new DeckPage();
    });

    it('should have the correct header', () => {
        page.navigateTo('59de8a1f012e92ce86a57176');
        browser.sleep(1000);
        expect(page.getDeckHeader()).toEqual("test deck 1");
    });

    it('should have a synonym, antonym, general usage, and example usage for each card.', () => {
        page.navigateTo('59de8a1f012e92ce86a57176');
        browser.sleep(1000);
        page.getAllCards().each( e => {
           expect(e.element(by.className("card-synonym")).element(by.className("card-desc")).getText()).toContain("Synonym");
           expect(e.element(by.className("card-antonym")).element(by.className("card-desc")).getText()).toContain("Antonym");
           expect(e.element(by.className("card-general-usage")).element(by.className("card-desc")).getText()).toContain("General usage");
           expect(e.element(by.className("card-example-usage")).element(by.className("card-desc")).getText()).toContain("Example usage");

        });
    });

    it('should add one card', () => {
        page.navigateTo('59de8a1f012e92ce86a57177');
        page.getAllCards().count().then( beforecount => {
            page.addCard('Word test', 'Synonym test', 'Antonym test', 'General Sense test', 'Example Usage test');
            browser.sleep(500); // wait for card to be added to list
            expect(page.getAllCards().count()).toEqual(beforecount + 1);
        });
    });

    it('should add three cards', () => {
        page.navigateTo('59de8a1f012e92ce86a57177');
        page.getAllCards().count().then( beforecount => {
            page.addCard('Word test 1', 'Synonym test 1', 'Antonym test 1', 'General Sense test 1', 'Example Usage test 1');
            browser.sleep(2000); // wait for stuff
            page.addCard('Word test 2', 'Synonym test 2', 'Antonym test 2', 'General Sense test 2', 'Example Usage test 2');
            browser.sleep(2000); // wait for stuff
            page.addCard('Word test 3', 'Synonym test 3', 'Antonym test 3', 'General Sense test 3', 'Example Usage test 3');
            browser.sleep(2000); // wait for cards to be added to list
            expect(page.getAllCards().count()).toEqual(beforecount + 3);
        });
    });

    it('should add one card and check that its still there', () => {
        page.navigateTo('59de8a1f012e92ce86a57177');
        page.getAllCards().count().then( beforecount => {
            page.addCard('Word test', 'Synonym test', 'Antonym test', 'General Sense test', 'Example Usage test');
            page.navigateTo('59de8a1f012e92ce86a57177');
            expect(page.getAllCards().count()).toEqual(beforecount + 1);
        });
    });

    it('should add a random card and check that its there', () => {
        page.navigateTo('59de8a1f012e92ce86a57177');

        var word = page.randomText(10);
        var synonym = page.randomText(10);
        var antonym = page.randomText(10);
        var generalsense = page.randomText(30);
        var exampleusage = page.randomText(30);

        page.addCard(word, synonym, antonym, generalsense, exampleusage);
        browser.sleep(500); // wait for card to be added to list

        let e = page.getAllCards().last();
        expect(e.element(by.className("card-word")).getText()).toEqual(word);
        expect(e.element(by.className("card-synonym")).element(by.className("card-cont")).getText()).toEqual(synonym);
        expect(e.element(by.className("card-antonym")).element(by.className("card-cont")).getText()).toEqual(antonym);
        expect(e.element(by.className("card-general-usage")).element(by.className("card-cont")).getText()).toEqual(generalsense);
        expect(e.element(by.className("card-example-usage")).element(by.className("card-cont")).getText()).toEqual(exampleusage);

    });

});


text:
/*globals require, __dirname */
/* jshint node:true */
'use strict';

var csslint = require('gulp-csslint');
var gulp = require('gulp');
var jscs = require('gulp-jscs');
var jshint = require('gulp-jshint');
var karmaConfig = __dirname + '/karma.conf.js';
var lodash = require('lodash');
var paths = require('./paths');
var plato = require('plato');
var Server = require('karma').Server;
var path = require('path');

gulp.task('build-css', ['scss'], function () {
  var Comb = require('csscomb');
  var config = require('./.csscomb.json');
  var comb = new Comb(config);
  comb.processPath('./src/css/');
});

gulp.task('clean', function () {

  var del = require('del');
  return del([
    'build'
  ]);
});

gulp.task('default', ['clean:mobile']);

gulp.task('complexity', function (done) {

  var callback = function () {
    done();
  };

  plato.inspect(paths.lint, 'build/complexity', {title: 'prerender', recurse: true}, callback);
});

gulp.task('csslint', function () {
  return gulp.src(paths.css)
    .pipe(csslint())
    .pipe(csslint.reporter())
    .pipe(csslint.failReporter());
});

gulp.task('jscs', function () {
  return gulp
    .src(paths.lint)
    .pipe(jscs('.jscsrc'));
});

gulp.task('lint', function () {
  return gulp
    .src(paths.lint)
    .pipe(jshint('.jshintrc'))
    .pipe(jshint.reporter('default', {verbose: true}))
    .pipe(jshint.reporter('jshint-stylish'))
    .pipe(jshint.reporter('fail'));
});

gulp.task('scss', ['scss-lint'], function () {
  var scss = require('gulp-sass');
  var postcss = require('gulp-postcss');
  var sourcemaps = require('gulp-sourcemaps');
  var autoprefixer = require('autoprefixer');

  return gulp.src(paths.scss)
    .pipe(scss())
    .pipe(sourcemaps.init())
    .pipe(postcss([autoprefixer({browsers: ['last 2 versions']})]))
    .pipe(sourcemaps.write('.'))
    .pipe(gulp.dest('./src/css'));
});

gulp.task('scss-lint', function () {
  var scssLint = require('gulp-scss-lint');
  var scssLintStylish = require('gulp-scss-lint-stylish');
  return gulp.src('./src/scss/*.scss')
    .pipe(scssLint({customReport: scssLintStylish}));
});

var testConfig = function (options) {
  var travisOptions = process.env.TRAVIS &&
    {
      browsers: ['Firefox'],
      reporters: ['dots', 'coverage', 'threshold']
    };

  return lodash.assign(options, travisOptions);
};

gulp.task('templatecache', function () {
  var templateCache = require('gulp-angular-templatecache');
  var htmlMin = require('gulp-htmlmin');

  return gulp
    .src('src/templates/**/*.html')
    .pipe(htmlMin({removeComments: true}))
    .pipe(templateCache('datetimepicker.templates.js', {
      base: path.join(__dirname, 'src'),
      module: 'ui.bootstrap.datetimepicker'
    }))
    .pipe(gulp.dest('src/js'));
});

gulp.task('tdd', function (done) {
  gulp.watch(paths.all.concat(paths.scss), ['jscs', 'lint', 'build-css']);

  var config = testConfig(
    {
      autoWatch: true,
      browsers: ['PhantomJS'],
      configFile: karmaConfig,
      singleRun: false
    }
  );

  var server = new Server(config, done);
  server.start();
});

gulp.task('test', ['jscs', 'lint', 'csslint'], function (done) {

  var config = testConfig(
    {
      configFile: karmaConfig,
      singleRun: true,
      reporters: ['progress', 'coverage', 'threshold']
    }
  );

  var server = new Server(config, done);
  server.start();
});

gulp.task('default', ['complexity', 'test']);

redpajama_set_name: RedPajamaGithub


text:
/*
 */
package org.datadryad.rest.handler;

import org.apache.log4j.Logger;
import org.datadryad.rest.models.Manuscript;
import org.datadryad.rest.storage.StoragePath;
import org.dspace.core.ConfigurationManager;
import org.dspace.servicemanager.DSpaceKernelImpl;
import org.dspace.servicemanager.DSpaceKernelInit;
import org.dspace.workflow.ApproveRejectReviewItem;
import org.dspace.workflow.ApproveRejectReviewItemException;

/**
 * Processes accept/reject status and moves items in review.
 * @author Dan Leehr <dan.leehr@nescent.org>
 */
public class ManuscriptReviewStatusChangeHandler implements HandlerInterface<Manuscript> {
    private static final Logger log = Logger.getLogger(ManuscriptReviewStatusChangeHandler.class);
    private DSpaceKernelImpl kernelImpl;
    public ManuscriptReviewStatusChangeHandler() {
        // Requires DSpace kernel to be running
        try {
            kernelImpl = DSpaceKernelInit.getKernel(null);
            if (!kernelImpl.isRunning())
            {
                kernelImpl.start(ConfigurationManager.getProperty("dspace.dir"));
            }
        } catch (Exception ex) {
            // Failed to start so destroy it and log and throw an exception
            try {
                if(kernelImpl != null) {
                    kernelImpl.destroy();
                }
            } catch (Exception e1) {
                // Nothing to do
            }
            log.error("Error Initializing DSpace kernel in ManuscriptReviewStatusChangeHandler", ex);
        }
    }

    @Override
    public void handleCreate(StoragePath path, Manuscript manuscript) throws HandlerException {
        processChange(manuscript);
    }

    @Override
    public void handleUpdate(StoragePath path, Manuscript manuscript) throws HandlerException {
        processChange(manuscript);
    }

    @Override
    public void handleDelete(StoragePath path, Manuscript object) throws HandlerException {
        // Do nothing
    }

    private void processChange(Manuscript manuscript) throws HandlerException {
        if(kernelImpl == null) {
            throw new HandlerException("Cannot process change, DSpace Kernel is not initialized");
        } else if(!kernelImpl.isRunning()) {
            throw new HandlerException("Cannot process change, DSpace Kernel is not running");
        }
        try {
            if (manuscript.isSubmitted()) {
                // if it's just a submitted notice, there is no status to change.
                return;
            }
            ApproveRejectReviewItem.reviewManuscript(manuscript);
        } catch (ApproveRejectReviewItemException ex) {
            throw new HandlerException("Exception handling acceptance notice for manuscript " + manuscript.getManuscriptId(), ex);
        }
    }
}


text:
DELETE FROM `{table.users.settings}`
WHERE `user_id` = '{0}' AND `setting_key` = '{1}';


text:
<?php

  /**
   * project_progress helper
   *
   * @package activeCollab.modules.system
   * @subpackage helpers
   */

  /**
   * Render project progress bar
   *
   * @param array $params
   * @param Smarty $smarty
   * @return string
   */
  function smarty_function_project_progress($params, &$smarty) {
    $project = array_var($params, 'project');
    if(!instance_of($project, 'Project')) {
      return new InvalidParamError('project', $project, '$project is expected to be an instance of Project class', true);
    } // if

    $smarty->assign(array(
      '_project_progress' => $project,
      '_project_progress_info' => (boolean) array_var($params, 'info', true),
    ));
    return $smarty->fetch(get_template_path('_projects_progress', 'project', SYSTEM_MODULE));
  } // smarty_function_project_progress

?>


text:
eXecute Redis immediately utility

	As simple wrapper of `skynet.db.redis`:  --NOTE: may deprecated ?
		```
		xredis.init(conf)
		local db = xredis.client()
		db.set("hello", "world")
		... do other CRUD operators like above ...
		```
		NOTE: one service one connection to one Redis instance

	More connections with one Redis instance for conccurrency ?
		let uniquesvr(unique skynet service) true
		xredis.init(conf, true)
		local db = xredis.client()
		...
]]--
local skynet = require "skynet"
local redis = require "skynet.db.redis"
local log = require "tm.log"
local xdump = require "tm.xtable".dump

local PING_INTERVAL = 10*60*100

local xredis = {}

-- simple mode only
local cli
local cfg
local firsttime = true

local function watcher()
	local ok, ret
	while true do
		skynet.sleep(PING_INTERVAL)
		if cli then
			log.info("keep alive [%s:%s] ...", cfg.host, cfg.port)
			ok, ret = pcall(cli.ping, cli)
			if not ok then
				log.error("ping %s:%s failed:%s", cfg.host, cfg.port, ret)
			end
		end
	end
end

function xredis.init(conf, uniquesvr)
	-- multi redisc services mode
	if uniquesvr then
		local service = skynet.uniqueservice("tm/db/redisd")
		return skynet.call(service, "lua", "start", conf)
	end

	-- simple xredis utility mode
	if cli then
		log.warn("already initialized!")
		return true
	end

	if type(conf.auth) == "string" and #conf.auth == 0 then
		conf.auth = nil
	end

	log.debug("init by conf: %s", xdump(conf))
	local ok, c = pcall(redis.connect, conf)
	if not ok then
		log.error("connect failed! %s", c)
		return false, c
	end
	cli = c
	cfg = conf
	log.info("connect %s:%d succeed!", conf.host, conf.port)

	if firsttime then
		firsttime = false
		skynet.fork(watcher)
	end
	return true
end

function xredis.clear()
	if cli then
		cli:disconnect()
		cli = nil
		cfg = nil
	else
		local service = skynet.localname(".redisd")
		if service then
			skynet.send(service, "lua", "stop")
		end
	end
end

local simpleclient = setmetatable({}, {
	__index = function(_, key)
		return function(...)
			return cli[key](cli, ...)
		end
	end
})

local multimodeclient = setmetatable({}, {
	__index = function(_, key)
		return function(...)
			local c = skynet.call(".redisd", "lua", "client")
			if not c then
				log.error("have no client!")
				return nil, "have no client"
			end
			local ok, t = pcall(skynet.call, c, "lua", "exec", key, ...)
			if not ok then
				log.error("call failed: %s", t)
				return nil, t
			end
			return t
		end
	end
})

function xredis.client()
	if cli then
		return simpleclient
	else
		return multimodeclient
	end
end

return xredis


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _index = require('../Common/plugs/index.js');

var _index2 = _interopRequireDefault(_index);

require('../Common/css/Collapse-item.css');

var _CollapseTransition = require('./CollapseTransition');

var _CollapseTransition2 = _interopRequireDefault(_CollapseTransition);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } //提供style, classname方法

var CollapseItem = function (_Component) {
  _inherits(CollapseItem, _Component);

  function CollapseItem() {
    _classCallCheck(this, CollapseItem);

    return _possibleConstructorReturn(this, (CollapseItem.__proto__ || Object.getPrototypeOf(CollapseItem)).apply(this, arguments));
  }

  _createClass(CollapseItem, [{
    key: 'render',
    value: function render() {
      var _props = this.props,
          title = _props.title,
          isActive = _props.isActive,
          _onClick = _props.onClick,
          name = _props.name;

      return _react2.default.createElement(
        'div',
        {
          className: this.classNames({
            'ishow-collapse-item': true,
            'is-active': isActive
          })
        },
        _react2.default.createElement(
          'div',
          { className: 'ishow-collapse-item__header', onClick: function onClick() {
              return _onClick(name);
            } },
          _react2.default.createElement('i', { className: 'ishow-collapse-item__header__arrow ishow-icon-arrow-right' }),
          title
        ),
        _react2.default.createElement(
          _CollapseTransition2.default,
          { isShow: isActive },
          _react2.default.createElement(
            'div',
            { className: 'ishow-collapse-item__wrap' },
            _react2.default.createElement(
              'div',
              { className: 'ishow-collapse-item__content' },
              this.props.children
            )
          )
        )
      );
    }
  }]);

  return CollapseItem;
}(_index2.default);

exports.default = CollapseItem;

CollapseItem.propTypes = {
  onClick: _propTypes2.default.func,
  isActive: _propTypes2.default.bool,
  title: _propTypes2.default.node,
  name: _propTypes2.default.string
};


text:
namespace catalog {
class Store;
}

namespace service_manager {

class NativeRunnerDelegate;
class ServiceManager;

// BackgroundServiceManager starts up a Service Manager on a background thread,
// and
// destroys the thread in the destructor. Once created use CreateApplication()
// to obtain an InterfaceRequest for the Application. The InterfaceRequest can
// then be bound to an ApplicationImpl.
class BackgroundServiceManager {
 public:
  struct InitParams {
    InitParams();
    ~InitParams();

    NativeRunnerDelegate* native_runner_delegate = nullptr;
    std::unique_ptr<catalog::Store> catalog_store;
    // If true the edk is initialized.
    bool init_edk = true;
  };

  BackgroundServiceManager();
  ~BackgroundServiceManager();

  // Starts the background service manager. |command_line_switches| are
  // additional
  // switches applied to any processes spawned by this call.
  void Init(std::unique_ptr<InitParams> init_params);

  // Obtains an InterfaceRequest for the specified name.
  mojom::ServiceRequest CreateServiceRequest(const std::string& name);

  // Use to do processing on the thread running the Service Manager. The
  // callback is supplied a pointer to the Service Manager. The callback does
  // *not* own the Service Manager.
  using ServiceManagerThreadCallback = base::Callback<void(ServiceManager*)>;
  void ExecuteOnServiceManagerThread(
      const ServiceManagerThreadCallback& callback);

 private:
  class MojoThread;

  std::unique_ptr<MojoThread> thread_;

  DISALLOW_COPY_AND_ASSIGN(BackgroundServiceManager);
};

}  // namespace service_manager

#endif  // SERVICES_SERVICE_MANAGER_BACKGROUND_BACKGROUND_SERVICE_MANAGER_H_


text:
-   [Home](../../index.md)
-   [Documentation](../index.md)
-   Administration with KAAZING Gateway

Security Reference
=========================================

This document describes all of the elements and properties you can use to configure KAAZING Gateway security.

Overview
------------------------------------------

You can use the optional `security` element to configure secure communication with the Gateway.

Structure
--------------------------------------------

The Gateway configuration file (`gateway-config.xml` or `gateway-config-minimal.xml`) defines the `security` configuration element contained in the top-level `gateway-config` element:

- [gateway-config](r_configure_gateway_gwconfig.md)
  - [security](#security)
    - [keystore](#keystore)
      - [type](#keystore)
      - [file](#keystore)
      - [password-file](#keystore)
    - [truststore](#truststore)
      - [type](#truststore)
      - [file](#truststore)
      - [password-file](#truststore)
    - [realm](#realmf)
      - [name](#realm)
      - [description](#realm)
      - [authentication](#authentication)
        - [http-challenge-scheme](#authentication)
        - [http-header](#authentication)
        - [http-query-parameter](#authentication)
        - [http-cookie](#authentication)
        - [authorization-mode](#authentication)
        - [authorization-timeout](#authentication) ![This feature is available in KAAZING Gateway - Enterprise Edition](../images/enterprise-feature.png)
        - [session-timeout](#authentication) ![This feature is available in KAAZING Gateway - Enterprise Edition](../images/enterprise-feature.png)
        - [login-modules](#login-module)
           - [login-module](#login-module)
              - [type](#login-module)
              - [success](#login-module)
              - [options](#options-login-module)
                 - [debug](#options-login-module)
                 - [tryFirstToken](#options-login-module)
       - [user-principal-class](#realm)

**Note:** The security elements and properties must be specified in the order shown.

security
-------------------------------

**The** `security` element contains the following elements:

| Element    | Description                                                                                |
|------------|-------------------------------------------------------------------------------------------------------------------------------------------|
| keystore   | The keystore contains the encryption keys for secure communications with KAAZING Gateway (see [keystore](#keystore))                |
| truststore | The truststore contains digital certificates for certificate authorities trusted by KAAZING Gateway (see [truststore](#truststore)) |
| realm      | The realm associates an authenticated user with a set of authorized roles (see [realm](#realm))                                   |

### keystore

**Required?** Optional; **Occurs:** zero or one

Identifies the keystore file that contains the certificates for the host names accepted by the Gateway over TLS (formerly SSL). When the Gateway is configured to accept `https://` or `wss://` schemes, the Gateway uses the certificates and key pairs in the keystore to establish a TLS session with clients connecting via those schemes. `keystore` contains the following elements:

| Element                                           | Description                                                                                |
|---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| type                  | The type (format) of the keystore file. The supported type is `JCEKS` (Java Cryptography Extension key store). If the `type` element is not specified, the Gateway throws an exception. |
| file                  | The location of the keystore file (absolute path or path relative to the `gateway-config.xml` file).                                                                                |
| password-file | The name of the file containing the password used by the Gateway and other applications to access the keystore file.                                                                    |

#### Example

``` xml
<keystore>
  <type>JCEKS</type>
  <file>keystore.db</file>
  <password-file>keystore.pw</password-file>
</keystore>
```

#### Notes

-   The keystore database file is located in `GATEWAY_HOME/conf` and referenced in the keystore element in the Gateway configuration file.
-   The Gateway supports certificates that are generated for wildcard domains. For example, `*.example.com` represents example.com and all its subdomains, such as my.example.com and secure-mail.example.com.
-   See [Secure Network Traffic with the Gateway](../security/o_tls.md) for more information and examples.

### truststore

**Required?** Optional; **Occurs:** zero or one

Identifies the truststore file that contains certificates for hosts and certificate authorities trusted by the Gateway. To connect to a back-end service or message broker using TLS/SSL, the Gateway must have the certificate for the host name of the back-end service or message broker in the truststore. `truststore` contains the following elements:

| Element                                             | Description                                                                                |
|-----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| type                  | Not required by default. The type (format) of the truststore file. The default supported type is `JKS` (Java Key Store). If you specify `JCEKS` (Java Cryptography Extension Key Store) when importing a certificate into the truststore, then you must add `<type>JCEKS</type>` or the Gateway throws an exception. |
| file                  | The location of the truststore file (absolute path or path relative to the `gateway-config.xml` file). There is no password file associated with the truststore. The default password is `changeit`. You should modify this password using the `keytool -storepasswd` command.                                          |
| password-file | The name of the file containing the password used by the Gateway and other applications to access the truststore file.                                                                                |

#### Example

``` xml
<keystore>
  <type>JCEKS</type>
  <file>keystore.db</file>
  <password-file>keystore.pw</password-file>
</keystore>

<truststore>
  <file>truststore.db</file>
</truststore>
```

#### Notes

-   See [Secure Network Traffic with the Gateway](../security/o_tls.md) for more information and examples.

### realm

**Required?** Optional; **Occurs:** zero or more

This is the element that associates an authenticated user with a set of authorized roles. `realm` contains the following elements:

| Element                                               | Description                                                                                |
|-------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| name                         | The name of the realm.                                                                                |
| description           | The description of the realm.                                                                                |
| authentication                 | The authentication information the Gateway uses to challenge the user, respond to the challenge response, process logins, and govern the authorization and session timeouts (see [authentication](#authentication)).                                                                                |
| user-principal-class | The name of the class that represents a user principal that an administrator wants to know about. When a principal of this class is authenticated, a notification of such is sent through the management service. If no management service is configured, then this element is ignored. The class must implement [`java.security.Principal`](http://docs.oracle.com/javase/7/docs/api/java/security/Principal.html). |

#### Example

``` xml
<security>
  ...
  <realm>
    <name>demo</name>
    <description>KAAZING Gateway Demo</description>
    <authentication>
      <http-challenge-scheme>Basic</http-challenge-scheme>
      <http-header>X-Custom-Authorization-Header</http-header>
      <http-query-parameter>myCustomAuthParam</http-query-parameter>
      <http-cookie>sampleCookie1</http-cookie>
      <login-modules>
        <login-module>
          <type>file</type>
          <success>required</success>
          <options>
            <filename>jaas-config.xml</filename>
          </options>
        <login-module>

        <login-module>
          <type>ldap</type>
          <success>required</success>
          <options>
            <userProvider>ldap://ldap-svr:389/ou=people,dc=example,dc=com</userProvider>
            <userFilter>
              <![CDATA[(&(userPrincipalName={USERNAME}@MYCOMPANY.NET)
              (objectClass=inetOrgPerson))]]>
            </userFilter>
            <authzIdentity>{EMPLOYEENUMBER}</authzIdentity>
          </options>
        </login-module>
      </login-modules>
    </authentication>
  </realm>
</security>
```

#### Notes

-   See [Secure Network Traffic with the Gateway](../security/o_tls.md) for more information and examples.
-   See [Monitor with JMX](../management/p_monitor_jmx.md) for an example configuring notifications using `user-principal-class` to extract user information from a session using JMX.

### authentication

**Required?** Required; **Occurs:** at most once

Use `authentication` to configure the authentication parameters for the `realm`, which includes the challenge-scheme and the parts of the request that contain authentication information. `authentication` contains the following elements:

- ##### `http-challenge-scheme`
  This element is required and specifies the method used for authentication: `Basic`, `Application Basic`, `Negotiate`, `Application Negotiate`, or `Application Token`:

  - Use `Basic` or `Negotiate` to allow the browser to respond to authentication challenges.
  - Use `Application Basic` or `Application Negotiate` to allow the client to respond to authentication challenges. The client in this case is the KAAZING Gateway client that is built based on the KAAZING Gateway client libraries. To use client-level authentication, configure the client to handle the authentication information, as described in [developer how-to](../../index.md) documentation.
  - Use `Application Token` to allow the client to present a third-party token or custom token to be presented to your custom login module.
  - Use `Negotiate` or `Application Negotiate` if using Kerberos Network Authentication. For more information, see [Secure Network Traffic with the Gateway](../security/o_tls.md).

- ##### `http-header`
  Specifies the names of the header or headers that carry authentication data for use by the login modules in this realm. This element is optional. If you do not specify it, then the Gateway uses `<http-header>Authorization</http-header>` for the challenge response (see [Custom HTTP Authentication Tokens](#custom-http-authentication-tokens)).

- ##### `http-query-parameter`
  Specifies the name or names of query parameters that carry authentication data for use by the login modules in this realm. This element is optional. If you do not specify it, then the Gateway uses `<http-header>Authorization</http-header>` for the challenge response (see [Custom HTTP Authentication Tokens](#custom-http-authentication-tokens)).

- ##### `http-cookie`
  Specifies the name or names of HTTP cookies that carry authentication data for use by the login modules in this realm. This element is optional. If you do not specify it, then the Gateway uses `<http-header>Authorization</http-header>` for the challenge response (see [Custom HTTP Authentication Tokens](#custom-http-authentication-tokens)).

- ##### `authorization-mode`
  Specifies the challenge or recycle mode the Gateway uses to handle credentials provided when the client logs in.
  - Use `challenge` to enable the Gateway to challenge the client for credentials when none are presented. The Gateway will not write its own authorization session cookie.Use recycle to enable the Gateway to write its own authorization session cookie.
  - Use `recycle`to enable the Gateway to write its own authorization session cookie. The `recycle` option is only applicable to `Basic`, `Application Basic`, `Negotiate`, and `Application Negotiate` HTTP challenge schemes.

- ##### `authorization-timeout`![This feature is available in KAAZING Gateway - Enterprise Edition](../images/enterprise-feature.png)
  For directory services, this element specifies the time interval that must elapse without service access before the Gateway challenges the client for credentials.

  For WebSocket services, this is the time interval before which the client must reauthenticate the WebSocket. If reauthentication has not occurred within the specified time, then the Gateway closes the WebSocket connection.

- ##### `session-timeout`![This feature is available in KAAZING Gateway - Enterprise Edition](../images/enterprise-feature.png)
  For WebSocket services only. This is the time interval after which the Gateway closes the WebSocket connection, regardless of other settings. Effectively, the `session-timeout` element specifies the maximum lifetime of the WebSocket connection.

- ##### `login-modules`
  Specifies the container for a chain of individual login modules that communicate with a user database to validate user's credentials and to determine a set of authorized roles (see [login-module](#login-module)).

#### Custom HTTP Authentication Tokens

By default, the HTTP standard ([RFC 2617](http://tools.ietf.org/html/rfc2617)) specifies the use of the authorization header `(<http-header>Authorization</http-header>`) for sending credentials from the client to the server. The Gateway configuration elements `http-header`, `http-query-parameter`, and `http-cookie` provide a means of extending the standard. You use these elements to allow the Gateway configuration to specify other parts of an HTTP request that can carry authentication credentials.

For example, suppose the client's authentication system provides authentication information in an authorization header, a cookie and a query parameter to the server. In this scenario, you might set up the Gateway configuration, as follows:

1.  Declare this authentication information in the Gateway configuration.

    The Gateway always obtains the authentication values from the authorization header (if any) and the Gateway also obtains any declared values from one or more authorization headers, query parameters, or cookies that are explicitly specified in the `http-header`, `http-query-parameter`, and `http-cookie` elements, respectively. For example:

    ``` xml
    <http-header>X-Acme-Authorization</http-header>
    <http-query-parameter>auth</http-query-parameter>
    <http-cookie>Acme</http-cookie>
    ```

2.  Make the values sent via an HTTP request available to your custom login module using the `AuthenticationToken` object.

    To declare explicit values in the login modules (configured as a chain within the [realm](#realm) element), use the `AuthenticationToken` object made available to the login modules through an `AuthenticationTokenCallback`, as follows:

    ``` xml
    AuthenticationToken token = getTokenFromCallback();
    String headerPart = token.get("X-Acme-Authorization");
    String parameterPart = token.get("auth");
    String cookiePart = token.get("Acme");
    ```

For more detailed information about implementation, see [Create a Custom Login Module](../security/p_auth_configure_custom_login_module.md) and [Configure a Chain of Login Modules](../security/p_auth_configure_login_module.md).

#### login-module

**Required?** Required; **Occurs:** one or more

This element configures the login module, which communicates with a user database to validate user's credentials and to determine a set of authorized roles. See [Configure a Chain of Login Modules](../security/p_auth_configure_login_module.md). The `login-module` contains the elements described in the following table.

| Element | Description                                                                                |
|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| type    | The type of login module: `file`, `ldap`, `kerberos5`, `gss`, `jndi`, `keystore`, and `custom`. See the `login-module` examples that follow this table. Note: You must use the `kerberos5` and `gss` elements together, and in that sequence. For information about using these login-modules, see [Configure a Chain of Login Modules](../security/p_auth_configure_login_module.md).                                                                                |
| success | The behavior of the login module at the time it validates the user's credentials. Possible values are: `required`, `requisite`, `sufficient`, and `optional`. The success status options are defined in the `javax.security.auth.login.Configuration` class. Authentication succeeds if all required and requisite login modules succeed, or if a sufficient or optional login module succeeds. The table in [Configure a Chain of Login Modules](../security/p_auth_configure_login_module.md) provides more information about how the order of login modules and the setting of the success element controls authentication processing. |
| options | The configuration options specific to the type of login module (see [options login-module](#options-login-module)).                                                                                |

##### options (`login-module`)

**Required?** Optional; **Occurs:** zero or one

This is the element for adding options to specific types of login modules. The options listed here are specific to public KAAZING Gateway login modules. See [Configure a Chain of Login Modules](../security/p_auth_configure_login_module.md) for more information about the types of login modules.

`options` contains the following elements:

| Option        | Applies to login-module type | Description                                                                                |
|---------------|------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| debug         | `file`                       | If `true`, then the login module sends debug information (at the DEBUG level) to the logger. If `false` (the default), then the login module disables sending logging information to the logger. This is the default. |
| tryFirstToken | `gss`                        |    If `true`, then the login module looks in the JAAS shared state for a token using the key: `com.kaazing.gateway.server.auth.gss.token`. If `false` (the default), then the login module uses a CallbackHandler to discover the token from `LoginContext`.  |

##### Example of a `file` Login Module

The following example shows a `file`-based `login-module` element that uses the flat XML file,` jaas-config.xml`:

``` xml
<login-module>
  <type>file</type>
  <success>required</success>
  <options>
    <!-- This <file> element configures the path to the XML file
         that contains the database of users, passwords, and roles. -->
    <file>jaas-config.xml</file>
  </options>
</login-module>
```

For information about the `file` login module options, see the table in the [options (login-module)](#options-login-module) section.

##### Example of a `ldap` login module

The following example shows an LDAP-based `login-module` element:

``` xml
<login-module>
  <type>ldap</type>
  <success>required</success>
  <options>
    <userProvider>ldap://ldap-svr:389/ou=people,dc=example,dc=com</userProvider>
    <userFilter>
      <![CDATA[(&(userPrincipalName={USERNAME}@MYCOMPANY.NET)
      (objectClass=inetOrgPerson))]]>
    </userFilter>
    <authzIdentity>{EMPLOYEENUMBER}</authzIdentity>
  </options>
</login-module>
```

For information about configuring the LDAP login-module options, see the [Class LDAPLoginModule documentation](http://docs.oracle.com/javase/7/docs/jre/api/security/jaas/spec/com/sun/security/auth/module/LdapLoginModule.html).

##### Example of `kerberos5` login module

The following example shows a `kerberos5`-based `login-module` element. You must use the `kerberos5` and [`gss`](gss-login-module) elements together, and in that sequence. Both of these login modules are required when using the `Negotiate` or `Application Negotiate` [schemes](#authentication):

``` xml
<login-module>
  <type>kerberos5</type>
  <success>required</success>
  <options>
    <useKeyTab>true</useKeyTab>
    <keyTab>/etc/krb5.keytab</keyTab>
    <principal>HTTP/localhost@LOCAL.NETWORK</principal>
    <isInitiator>false</isInitiator>
    <doNotPrompt>true</doNotPrompt>
    <storeKey>true</storeKey>
  </options>
</login-module>
```

For information about configuring the Kerberos login module options, see the [Krb5LoginModule](http://docs.oracle.com/javase/7/docs/jre/api/security/jaas/spec/com/sun/security/auth/module/Krb5LoginModule.html "Krb5LoginModule (Java Authentication and Authorization Service )") documentation. For information about how to use KAAZING Gateway with Kerberos, see [Configure Kerberos V5 Network Authentication](../security/o_auth_configure.md).

##### `gss` login module

The following example shows a `gss`-based `login-module` element that you define after the Kerberos login module in the chain to enable the Kerberos tokens to travel over the Web. Both of these login modules are required when using the `Negotiate` or `Application Negotiate` [schemes](#authentication):

``` xml
<login-module>
  <type>gss</type>
  <success>required</success>
</login-module>
```

For information about the `gss` login module options, see the table in the [options (login-module)](#options-login-module) section. The `gss` login-module element requires no options but must follow the [kerberos5](#example-of-kerberos5-login-module) login-module element, because the `gss` login-module element uses the credentials obtained by the [kerberos5](#example-of-kerberos5-login-module) login-module element to verify the service ticket presented by the client. See [Configure Kerberos V5 Network Authentication](../security/u_kerberos_configure.md) and [Using Kerberos V5 Network Authentication with the Gateway](../security/u_kerberos_configure.md) for more information.

##### Example of a `jndi` login module

The following example shows a jndi-based `login-module` element. It translates the examples for the login module in the [JndiLoginModule](http://docs.oracle.com/javase/7/docs/jre/api/security/jaas/spec/com/sun/security/auth/module/JndiLoginModule.html) javadoc into the XML you would use in the `security.realm` section of the Gateway configuration:

``` xml
<login-module>
  <type>jndi</type>
  <success>required</success>
  <options>
    <!-- These options come directly from the JndiLoginModule javadoc;
        these are the NIS examples -->
    <user.provider.url>nis://NISServerHostName/NISDomain/user</user.provider.url>
    <group.provider.url>nis://NISServerHostName/NISDomain/system/group</group.provider.url>
  </options>
</login-module>
```

For information about configuring the JNDI login-module options, see the [JndiLoginModule](http://docs.oracle.com/javase/7/docs/jre/api/security/jaas/spec/com/sun/security/auth/module/JndiLoginModule.html) documentation.

##### Example of a `keystore` login module

The following example shows a keystore-based `login-module` element. It translates the examples in the [KeyStoreLoginModule](http://docs.oracle.com/javase/7/docs/jre/api/security/jaas/spec/com/sun/security/auth/module/KeyStoreLoginModule.html) javadoc into the XML you would use in the `security.realm` section of the Gateway configuration:

``` xml
<login-module>
  <type>keystore</type>
  <success>required</success>
  <options>
   <!-- These options come directly from the KeyStoreLoginModule javadoc  -->
    <keyStoreURL>file://path/to/keystore.db</keyStoreURL>
    <keyStorePasswordURL>file://path/to/keystore.pw</keyStorePasswordURL>
    <keyStoreAlias>keystore-alias</keyStoreAlias>
  </options>
</login-module>
```

For information about configuring the keystore login-module options, see the [KeyStoreLoginModule](http://docs.oracle.com/javase/7/docs/jre/api/security/jaas/spec/com/sun/security/auth/module/KeyStoreLoginModule.html) documentation.

##### Example of a `custom` login module

KAAZING Gateway also supports a plugin mechanism for integration with custom authentication modules based on the Java LoginModule API.

For information about creating a custom login module using this API, see:

-   [Java Authentication and Authorization Service (JAAS) LoginModule Developer's Guide](http://docs.oracle.com/javase/7/docs/technotes/guides/security/jaas/JAASLMDevGuide.html).
-   [Create a Custom Login Module](../security/p_auth_configure_custom_login_module.md)
-   [Integrate an Existing Custom Login Module into the Gateway](../security/p_auth_integrate_custom_login_module.md)

##### Example of a Complete Security Element

The following is an example of a complete `security` element that includes a chain of two login modules:

``` xml
<security>
  <keystore>
   <type>JCEKS</type>
   <file>keystore.db</file>
    <password-file>keystore.pw</password-file>
  </keystore>

  <truststore>
    <file>truststore.db</file>
  </truststore>

  <realm>
    <name>demo</name>
    <description>KAAZING Gateway Demo</description>
    <authentication>
      <http-challenge-scheme>Basic<http-challenge-scheme>
      <http-header>X-Custom-Authorization-Header</http-header>
      <http-query-parameter>myCustomAuthParam</http-query-parameter>
      <http-cookie>sampleCookie1</http-cookie>

      <login-modules>
        <login-module>
          <type>file</type>
          <success>required</success>
          <options>
            <filename>jaas-config.xml</filename>
          </options>
        <login-module>

        <login-module>
          <type>ldap</type>
          <success>required</success>
          <options>
            <userProvider>ldap://ldap-svr:389/ou=people,dc=example,dc=com</userProvider>
            <userFilter>
              <![CDATA[(&(userPrincipalName={USERNAME}@MYCOMPANY.NET)
              (objectClass=inetOrgPerson))]]>
            </userFilter>
            <authzIdentity>{EMPLOYEENUMBER}</authzIdentity>
          </options>
        </login-module>
      </login-modules>
    </authentication>
  </realm>
</security>
```

Summary
-------

In this document, you learned about the Gateway `security` configuration element and how to specify it in your Gateway configuration file. For more information about the location of the configuration files and starting the Gateway, see [Setting Up the Gateway](../about/setup-guide.md). For more information about KAAZING Gateway administration, see the [documentation](../index.md).


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * UseDomainDialog.java
 *
 * Created on 04.08.2011, 11:18:58
 */
package edacc.parametergrapheditor;

import edacc.parameterspace.Parameter;
import edacc.parameterspace.domain.Domain;
import java.util.Set;

/**
 *
 * @author simon
 */
public class UseDomainDialog extends javax.swing.JDialog {

    private Parameter selectedItem;
    /** Creates new form UseDomainDialog */
    public UseDomainDialog(java.awt.Frame parent, boolean modal, Set<Parameter> parameters, Class<? extends Domain> domain) {
        super(parent, modal);
        initComponents();
        comboDomain.removeAllItems();
        for (Parameter p : parameters) {
            if (p.getDomain().getClass().equals(domain)) {
                comboDomain.addItem(p);
            }
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        comboDomain = new javax.swing.JComboBox();
        btnAccept = new javax.swing.JButton();
        btnCancel = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(edacc.EDACCApp.class).getContext().getResourceMap(UseDomainDialog.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N
        setResizable(false);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel1.border.title"))); // NOI18N
        jPanel1.setName("jPanel1"); // NOI18N

        comboDomain.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        comboDomain.setName("comboDomain"); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(comboDomain, 0, 414, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(comboDomain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        btnAccept.setText(resourceMap.getString("btnAccept.text")); // NOI18N
        btnAccept.setName("btnAccept"); // NOI18N
        btnAccept.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAcceptActionPerformed(evt);
            }
        });

        btnCancel.setText(resourceMap.getString("btnCancel.text")); // NOI18N
        btnCancel.setName("btnCancel"); // NOI18N
        btnCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btnCancel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 290, Short.MAX_VALUE)
                .addComponent(btnAccept)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnAccept)
                    .addComponent(btnCancel))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed
        selectedItem = null;
        setVisible(false);
    }//GEN-LAST:event_btnCancelActionPerformed

    private void btnAcceptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAcceptActionPerformed
        selectedItem = (Parameter) comboDomain.getSelectedItem();
        setVisible(false);
    }//GEN-LAST:event_btnAcceptActionPerformed

    public Parameter getSelectedItem() {
        return selectedItem;
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAccept;
    private javax.swing.JButton btnCancel;
    private javax.swing.JComboBox comboDomain;
    private javax.swing.JPanel jPanel1;
    // End of variables declaration//GEN-END:variables
}


text:
package com.github.weisj.darklaf.ui.text;

import javax.swing.*;

import com.github.weisj.darklaf.ui.DemoResources;
import com.github.weisj.darklaf.ui.demo.DemoExecutor;

public class HTMLPaneDemo extends TextPaneDemo {

    public static void main(final String[] args) {
        DemoExecutor.showDemo(new HTMLPaneDemo());
    }

    @Override
    protected JTextPane createTextComponent() {
        JTextPane textPane = super.createTextComponent();
        textPane.setContentType("text/html");
        textPane.setText(DemoResources.HTML_DEMO);
        return textPane;
    }

    @Override
    public String getName() {
        return "HTML Demo";
    }
}


text:
package main.java.data;

import java.io.Serializable;

import main.java.util.CloneableInterface;

public class LoginInfo implements Serializable, CloneableInterface<LoginInfo>
{
// --------------------------------------------
// Attributes:
// --------------------------------------------
	private static final long		serialVersionUID	= 1735179230089796614L;
	public static final LoginInfo[]initialLoginTable	= {	new LoginInfo(false,	null,	true,	true,	-1),
															new LoginInfo(false,	null,	false,	false,	1),
															new LoginInfo(true,	null,	false,	false,	1),
															new LoginInfo(true,	null,	false,	false,	1), // TODO parameter n°3 = false
															new LoginInfo(true,	null,	false,	false,	2)};

	private boolean		isClosed;
	private String		playerName;
	private boolean		isHost;
	private boolean		isHuman;
	private int			aiLevel	= -1;

// --------------------------------------------
// Builder:
// --------------------------------------------
	public LoginInfo(boolean isClosed, String playerName, boolean isHost, boolean isHuman, int iaLevel)
	{
		this.isClosed	= isClosed;
		this.playerName	= (playerName == null) ? null : new String(playerName);
		this.isHost		= isHost;
		this.isHost		= isHost;
		this.isHuman	= isHuman;
		this.aiLevel	= iaLevel;
	}
	private LoginInfo(){}
	public LoginInfo getClone()
	{
		LoginInfo res = new LoginInfo();

		res.isClosed	= this.isClosed;
		res.playerName	= (this.playerName == null) ? null : new String(this.playerName);
		res.isHost		= this.isHost;
		res.isHuman		= this.isHuman;
		res.aiLevel		= this.aiLevel;
		return res;
	}

// --------------------------------------------
// Getter / setter:
// --------------------------------------------
	public void		setIsClosed(boolean isClosed)	{this.isClosed = isClosed;}
	public void		setFreeCell()					{this.playerName = null;}
	public boolean	isClosed()						{return this.isClosed;}
	public String	getPlayerName()					{return (this.playerName == null) ? null : new String(this.playerName);}
	public boolean	isHost()						{return this.isHost;}
	public boolean	isHuman()						{return this.isHuman;}
	public int		getAiLevel()					{return this.aiLevel;}
	public boolean	isOccupiedCell()				{return (this.playerName != null);}
	public boolean equals(LoginInfo li)
	{
		if (this.isClosed	!= li.isClosed)						return false;
		if (this.isHost		!= li.isHost)						return false;
		if (this.isHuman	!= li.isHuman)						return false;
		if ((!this.isHuman) && (this.aiLevel != li.aiLevel))	return false;
		return true;
	}

// --------------------------------------------
// Local Methodes:
// --------------------------------------------
	public static LoginInfo[] getInitialLoggedPlayerTable()
	{
		LoginInfo[]	res = new LoginInfo[Data.maxNbrPlayer];

		for (int i=0; i<Data.maxNbrPlayer; i++) res[i] = initialLoginTable[i].getClone();
		return res;
	}
	public static LoginInfo getInitialLoggedPlayerTableCell(int index)
	{
		return initialLoginTable[index].getClone();
	}
	public String toString()
	{
		String res = "";

		res += "LoginInfo:";
		res += "\n\t- isClosed\t:"		+ this.isClosed;
		res += "\n\t- playerName\t:"	+ this.playerName;
		res += "\n\t- isHost\t:"		+ this.isHost;
		res += "\n\t- isHuman\t:"		+ this.isHuman;
		res += "\n\t- AI_level\t:"		+ this.aiLevel;
		return res;
	}
}


text:
#include <stdlib.h>
#include <string.h>
#ifndef WIN32
#include "config.h"
#endif

#ifdef ENABLE_NLS
#include <libintl.h>
#endif

#define         _ISOC9X_SOURCE  1
#define         _ISOC99_SOURCE  1
#define         __USE_ISOC99    1
#define         __USE_ISOC9X    1

#include <math.h>

#include "ladspa.h"

#ifdef WIN32
#define _WINDOWS_DLL_EXPORT_ __declspec(dllexport)
int bIsFirstTime = 1;
static void __attribute__((constructor)) swh_init(); // forward declaration
#else
#define _WINDOWS_DLL_EXPORT_
#endif

#line 9 "ringmod_1188.xml"

#include "ladspa-util.h"

int refcount;
LADSPA_Data *sin_tbl, *tri_tbl, *saw_tbl, *squ_tbl;
long sample_rate;

#define RINGMOD_2I1O_DEPTH             0
#define RINGMOD_2I1O_INPUT             1
#define RINGMOD_2I1O_MODULATOR         2
#define RINGMOD_2I1O_OUTPUT            3
#define RINGMOD_1I1O1L_DEPTHP          0
#define RINGMOD_1I1O1L_FREQ            1
#define RINGMOD_1I1O1L_SIN             2
#define RINGMOD_1I1O1L_TRI             3
#define RINGMOD_1I1O1L_SAW             4
#define RINGMOD_1I1O1L_SQU             5
#define RINGMOD_1I1O1L_INPUT           6
#define RINGMOD_1I1O1L_OUTPUT          7

static LADSPA_Descriptor *ringmod_2i1oDescriptor = NULL;

typedef struct {
	LADSPA_Data *depth;
	LADSPA_Data *input;
	LADSPA_Data *modulator;
	LADSPA_Data *output;
	LADSPA_Data run_adding_gain;
} Ringmod_2i1o;

static LADSPA_Descriptor *ringmod_1i1o1lDescriptor = NULL;

typedef struct {
	LADSPA_Data *depthp;
	LADSPA_Data *freq;
	LADSPA_Data *sin;
	LADSPA_Data *tri;
	LADSPA_Data *saw;
	LADSPA_Data *squ;
	LADSPA_Data *input;
	LADSPA_Data *output;
	LADSPA_Data  offset;
	LADSPA_Data run_adding_gain;
} Ringmod_1i1o1l;

_WINDOWS_DLL_EXPORT_
const LADSPA_Descriptor *ladspa_descriptor(unsigned long index) {

#ifdef WIN32
	if (bIsFirstTime) {
		swh_init();
		bIsFirstTime = 0;
	}
#endif
	switch (index) {
	case 0:
		return ringmod_2i1oDescriptor;
	case 1:
		return ringmod_1i1o1lDescriptor;
	default:
		return NULL;
	}
}

static void cleanupRingmod_2i1o(LADSPA_Handle instance) {
	free(instance);
}

static void connectPortRingmod_2i1o(
 LADSPA_Handle instance,
 unsigned long port,
 LADSPA_Data *data) {
	Ringmod_2i1o *plugin;

	plugin = (Ringmod_2i1o *)instance;
	switch (port) {
	case RINGMOD_2I1O_DEPTH:
		plugin->depth = data;
		break;
	case RINGMOD_2I1O_INPUT:
		plugin->input = data;
		break;
	case RINGMOD_2I1O_MODULATOR:
		plugin->modulator = data;
		break;
	case RINGMOD_2I1O_OUTPUT:
		plugin->output = data;
		break;
	}
}

static LADSPA_Handle instantiateRingmod_2i1o(
 const LADSPA_Descriptor *descriptor,
 unsigned long s_rate) {
	Ringmod_2i1o *plugin_data = (Ringmod_2i1o *)calloc(1, sizeof(Ringmod_2i1o));
	plugin_data->run_adding_gain = 1.0f;

	return (LADSPA_Handle)plugin_data;
}

#undef buffer_write
#undef RUN_ADDING
#undef RUN_REPLACING

#define buffer_write(b, v) (b = v)
#define RUN_ADDING    0
#define RUN_REPLACING 1

static void runRingmod_2i1o(LADSPA_Handle instance, unsigned long sample_count) {
	Ringmod_2i1o *plugin_data = (Ringmod_2i1o *)instance;

	/* Modulation depth (0=none, 1=AM, 2=RM) (float value) */
	const LADSPA_Data depth = *(plugin_data->depth);

	/* Input (array of floats of length sample_count) */
	const LADSPA_Data * const input = plugin_data->input;

	/* Modulator (array of floats of length sample_count) */
	const LADSPA_Data * const modulator = plugin_data->modulator;

	/* Output (array of floats of length sample_count) */
	LADSPA_Data * const output = plugin_data->output;

#line 24 "ringmod_1188.xml"
	unsigned long pos;
	float tmpa = depth * 0.5f;
	float tmpb = 2.0f - depth;

	for (pos = 0; pos < sample_count; pos++) {
	        buffer_write(output[pos], input[pos] * (tmpa * modulator[pos] + tmpb));
	}
}
#undef buffer_write
#undef RUN_ADDING
#undef RUN_REPLACING

#define buffer_write(b, v) (b += (v) * run_adding_gain)
#define RUN_ADDING    1
#define RUN_REPLACING 0

static void setRunAddingGainRingmod_2i1o(LADSPA_Handle instance, LADSPA_Data gain) {
	((Ringmod_2i1o *)instance)->run_adding_gain = gain;
}

static void runAddingRingmod_2i1o(LADSPA_Handle instance, unsigned long sample_count) {
	Ringmod_2i1o *plugin_data = (Ringmod_2i1o *)instance;
	LADSPA_Data run_adding_gain = plugin_data->run_adding_gain;

	/* Modulation depth (0=none, 1=AM, 2=RM) (float value) */
	const LADSPA_Data depth = *(plugin_data->depth);

	/* Input (array of floats of length sample_count) */
	const LADSPA_Data * const input = plugin_data->input;

	/* Modulator (array of floats of length sample_count) */
	const LADSPA_Data * const modulator = plugin_data->modulator;

	/* Output (array of floats of length sample_count) */
	LADSPA_Data * const output = plugin_data->output;

#line 24 "ringmod_1188.xml"
	unsigned long pos;
	float tmpa = depth * 0.5f;
	float tmpb = 2.0f - depth;

	for (pos = 0; pos < sample_count; pos++) {
	        buffer_write(output[pos], input[pos] * (tmpa * modulator[pos] + tmpb));
	}
}

static void activateRingmod_1i1o1l(LADSPA_Handle instance) {
	Ringmod_1i1o1l *plugin_data = (Ringmod_1i1o1l *)instance;
	LADSPA_Data offset = plugin_data->offset;
#line 89 "ringmod_1188.xml"
	offset = 0;
	plugin_data->offset = offset;

}

static void cleanupRingmod_1i1o1l(LADSPA_Handle instance) {
#line 93 "ringmod_1188.xml"
	Ringmod_1i1o1l *plugin_data = (Ringmod_1i1o1l *)instance;
	plugin_data = plugin_data;
	if (--refcount == 0) {
	        free(sin_tbl);
	        free(tri_tbl);
	        free(squ_tbl);
	        free(saw_tbl);
	}
	free(instance);
}

static void connectPortRingmod_1i1o1l(
 LADSPA_Handle instance,
 unsigned long port,
 LADSPA_Data *data) {
	Ringmod_1i1o1l *plugin;

	plugin = (Ringmod_1i1o1l *)instance;
	switch (port) {
	case RINGMOD_1I1O1L_DEPTHP:
		plugin->depthp = data;
		break;
	case RINGMOD_1I1O1L_FREQ:
		plugin->freq = data;
		break;
	case RINGMOD_1I1O1L_SIN:
		plugin->sin = data;
		break;
	case RINGMOD_1I1O1L_TRI:
		plugin->tri = data;
		break;
	case RINGMOD_1I1O1L_SAW:
		plugin->saw = data;
		break;
	case RINGMOD_1I1O1L_SQU:
		plugin->squ = data;
		break;
	case RINGMOD_1I1O1L_INPUT:
		plugin->input = data;
		break;
	case RINGMOD_1I1O1L_OUTPUT:
		plugin->output = data;
		break;
	}
}

static LADSPA_Handle instantiateRingmod_1i1o1l(
 const LADSPA_Descriptor *descriptor,
 unsigned long s_rate) {
	Ringmod_1i1o1l *plugin_data = (Ringmod_1i1o1l *)calloc(1, sizeof(Ringmod_1i1o1l));
	LADSPA_Data offset;

#line 59 "ringmod_1188.xml"
	long i;

	sample_rate = s_rate;

	if (refcount++ == 0) {
	        sin_tbl = malloc(sizeof(LADSPA_Data) * sample_rate);
	        for (i = 0; i < sample_rate; i++) {
	                sin_tbl[i] = sin(i * 2 * M_PI / sample_rate);
	        }

	        tri_tbl = malloc(sizeof(LADSPA_Data) * sample_rate);
	        for (i = 0; i < sample_rate; i++) {
	                tri_tbl[i] = acos(cos(i * 2 * M_PI / sample_rate)) / M_PI * 2 - 1;
	        }

	        squ_tbl = malloc(sizeof(LADSPA_Data) * sample_rate);
	        for (i = 0; i < sample_rate; i++) {
	                squ_tbl[i] = (i < sample_rate/2) ? 1 : -1;
	        }

	        saw_tbl = malloc(sizeof(LADSPA_Data) * sample_rate);
	        for (i = 0; i < sample_rate; i++) {
	                saw_tbl[i] = ((2.0 * i) - (float)sample_rate) / (float)sample_rate;
	        }
	}

	offset = 0;

	plugin_data->offset = offset;

	return (LADSPA_Handle)plugin_data;
}

#undef buffer_write
#undef RUN_ADDING
#undef RUN_REPLACING

#define buffer_write(b, v) (b = v)
#define RUN_ADDING    0
#define RUN_REPLACING 1

static void runRingmod_1i1o1l(LADSPA_Handle instance, unsigned long sample_count) {
	Ringmod_1i1o1l *plugin_data = (Ringmod_1i1o1l *)instance;

	/* Modulation depth (0=none, 1=AM, 2=RM) (float value) */
	const LADSPA_Data depthp = *(plugin_data->depthp);

	/* Frequency (Hz) (float value) */
	const LADSPA_Data freq = *(plugin_data->freq);

	/* Sine level (float value) */
	const LADSPA_Data sin = *(plugin_data->sin);

	/* Triangle level (float value) */
	const LADSPA_Data tri = *(plugin_data->tri);

	/* Sawtooth level (float value) */
	const LADSPA_Data saw = *(plugin_data->saw);

	/* Square level (float value) */
	const LADSPA_Data squ = *(plugin_data->squ);

	/* Input (array of floats of length sample_count) */
	const LADSPA_Data * const input = plugin_data->input;

	/* Output (array of floats of length sample_count) */
	LADSPA_Data * const output = plugin_data->output;
	LADSPA_Data offset = plugin_data->offset;

#line 24 "ringmod_1188.xml"
	LADSPA_Data scale = fabs(sin) + fabs(tri) +
	 fabs(saw) + fabs(squ);
	int o;
	unsigned long pos;

	// Rescale to more useful value
	const float depth = depthp * 0.5f;

	if (scale == 0.0) {
	        scale = 1.0;
	}

	for (pos = 0; pos < sample_count; pos++) {
	        o = f_round(offset);
	        buffer_write(output[pos], input[pos] *
	         (depth * (((sin / scale) * sin_tbl[o]) +
	           ((tri / scale) * tri_tbl[o]) +
	           ((saw / scale) * saw_tbl[o]) +
	           ((squ / scale) * squ_tbl[o])) +
	           (1.0f - depth)));
	        offset += freq;
	        if (offset > sample_rate) {
	                offset -= sample_rate;
	        }
	}

	plugin_data->offset = offset;
}
#undef buffer_write
#undef RUN_ADDING
#undef RUN_REPLACING

#define buffer_write(b, v) (b += (v) * run_adding_gain)
#define RUN_ADDING    1
#define RUN_REPLACING 0

static void setRunAddingGainRingmod_1i1o1l(LADSPA_Handle instance, LADSPA_Data gain) {
	((Ringmod_1i1o1l *)instance)->run_adding_gain = gain;
}

static void runAddingRingmod_1i1o1l(LADSPA_Handle instance, unsigned long sample_count) {
	Ringmod_1i1o1l *plugin_data = (Ringmod_1i1o1l *)instance;
	LADSPA_Data run_adding_gain = plugin_data->run_adding_gain;

	/* Modulation depth (0=none, 1=AM, 2=RM) (float value) */
	const LADSPA_Data depthp = *(plugin_data->depthp);

	/* Frequency (Hz) (float value) */
	const LADSPA_Data freq = *(plugin_data->freq);

	/* Sine level (float value) */
	const LADSPA_Data sin = *(plugin_data->sin);

	/* Triangle level (float value) */
	const LADSPA_Data tri = *(plugin_data->tri);

	/* Sawtooth level (float value) */
	const LADSPA_Data saw = *(plugin_data->saw);

	/* Square level (float value) */
	const LADSPA_Data squ = *(plugin_data->squ);

	/* Input (array of floats of length sample_count) */
	const LADSPA_Data * const input = plugin_data->input;

	/* Output (array of floats of length sample_count) */
	LADSPA_Data * const output = plugin_data->output;
	LADSPA_Data offset = plugin_data->offset;

#line 24 "ringmod_1188.xml"
	LADSPA_Data scale = fabs(sin) + fabs(tri) +
	 fabs(saw) + fabs(squ);
	int o;
	unsigned long pos;

	// Rescale to more useful value
	const float depth = depthp * 0.5f;

	if (scale == 0.0) {
	        scale = 1.0;
	}

	for (pos = 0; pos < sample_count; pos++) {
	        o = f_round(offset);
	        buffer_write(output[pos], input[pos] *
	         (depth * (((sin / scale) * sin_tbl[o]) +
	           ((tri / scale) * tri_tbl[o]) +
	           ((saw / scale) * saw_tbl[o]) +
	           ((squ / scale) * squ_tbl[o])) +
	           (1.0f - depth)));
	        offset += freq;
	        if (offset > sample_rate) {
	                offset -= sample_rate;
	        }
	}

	plugin_data->offset = offset;
}

static void __attribute__((constructor)) swh_init() {
	char **port_names;
	LADSPA_PortDescriptor *port_descriptors;
	LADSPA_PortRangeHint *port_range_hints;

#ifdef ENABLE_NLS
#define D_(s) dgettext(PACKAGE, s)
	bindtextdomain(PACKAGE, PACKAGE_LOCALE_DIR);
#else
#define D_(s) (s)
#endif

	ringmod_2i1oDescriptor =
	 (LADSPA_Descriptor *)malloc(sizeof(LADSPA_Descriptor));

	if (ringmod_2i1oDescriptor) {
		ringmod_2i1oDescriptor->UniqueID = 1188;
		ringmod_2i1oDescriptor->Label = "ringmod_2i1o";
		ringmod_2i1oDescriptor->Properties =
		 LADSPA_PROPERTY_HARD_RT_CAPABLE;
		ringmod_2i1oDescriptor->Name =
		 D_("Ringmod with two inputs");
		ringmod_2i1oDescriptor->Maker =
		 "Steve Harris <steve@plugin.org.uk>";
		ringmod_2i1oDescriptor->Copyright =
		 "GPL";
		ringmod_2i1oDescriptor->PortCount = 4;

		port_descriptors = (LADSPA_PortDescriptor *)calloc(4,
		 sizeof(LADSPA_PortDescriptor));
		ringmod_2i1oDescriptor->PortDescriptors =
		 (const LADSPA_PortDescriptor *)port_descriptors;

		port_range_hints = (LADSPA_PortRangeHint *)calloc(4,
		 sizeof(LADSPA_PortRangeHint));
		ringmod_2i1oDescriptor->PortRangeHints =
		 (const LADSPA_PortRangeHint *)port_range_hints;

		port_names = (char **)calloc(4, sizeof(char*));
		ringmod_2i1oDescriptor->PortNames =
		 (const char **)port_names;

		/* Parameters for Modulation depth (0=none, 1=AM, 2=RM) */
		port_descriptors[RINGMOD_2I1O_DEPTH] =
		 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
		port_names[RINGMOD_2I1O_DEPTH] =
		 D_("Modulation depth (0=none, 1=AM, 2=RM)");
		port_range_hints[RINGMOD_2I1O_DEPTH].HintDescriptor =
		 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_0;
		port_range_hints[RINGMOD_2I1O_DEPTH].LowerBound = 0;
		port_range_hints[RINGMOD_2I1O_DEPTH].UpperBound = 2;

		/* Parameters for Input */
		port_descriptors[RINGMOD_2I1O_INPUT] =
		 LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO;
		port_names[RINGMOD_2I1O_INPUT] =
		 D_("Input");
		port_range_hints[RINGMOD_2I1O_INPUT].HintDescriptor = 0;

		/* Parameters for Modulator */
		port_descriptors[RINGMOD_2I1O_MODULATOR] =
		 LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO;
		port_names[RINGMOD_2I1O_MODULATOR] =
		 D_("Modulator");
		port_range_hints[RINGMOD_2I1O_MODULATOR].HintDescriptor =
		 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_0;
		port_range_hints[RINGMOD_2I1O_MODULATOR].LowerBound = -1;
		port_range_hints[RINGMOD_2I1O_MODULATOR].UpperBound = +1;

		/* Parameters for Output */
		port_descriptors[RINGMOD_2I1O_OUTPUT] =
		 LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO;
		port_names[RINGMOD_2I1O_OUTPUT] =
		 D_("Output");
		port_range_hints[RINGMOD_2I1O_OUTPUT].HintDescriptor = 0;

		ringmod_2i1oDescriptor->activate = NULL;
		ringmod_2i1oDescriptor->cleanup = cleanupRingmod_2i1o;
		ringmod_2i1oDescriptor->connect_port = connectPortRingmod_2i1o;
		ringmod_2i1oDescriptor->deactivate = NULL;
		ringmod_2i1oDescriptor->instantiate = instantiateRingmod_2i1o;
		ringmod_2i1oDescriptor->run = runRingmod_2i1o;
		ringmod_2i1oDescriptor->run_adding = runAddingRingmod_2i1o;
		ringmod_2i1oDescriptor->set_run_adding_gain = setRunAddingGainRingmod_2i1o;
	}

	ringmod_1i1o1lDescriptor =
	 (LADSPA_Descriptor *)malloc(sizeof(LADSPA_Descriptor));

	if (ringmod_1i1o1lDescriptor) {
		ringmod_1i1o1lDescriptor->UniqueID = 1189;
		ringmod_1i1o1lDescriptor->Label = "ringmod_1i1o1l";
		ringmod_1i1o1lDescriptor->Properties =
		 LADSPA_PROPERTY_HARD_RT_CAPABLE;
		ringmod_1i1o1lDescriptor->Name =
		 D_("Ringmod with LFO");
		ringmod_1i1o1lDescriptor->Maker =
		 "Steve Harris <steve@plugin.org.uk>";
		ringmod_1i1o1lDescriptor->Copyright =
		 "GPL";
		ringmod_1i1o1lDescriptor->PortCount = 8;

		port_descriptors = (LADSPA_PortDescriptor *)calloc(8,
		 sizeof(LADSPA_PortDescriptor));
		ringmod_1i1o1lDescriptor->PortDescriptors =
		 (const LADSPA_PortDescriptor *)port_descriptors;

		port_range_hints = (LADSPA_PortRangeHint *)calloc(8,
		 sizeof(LADSPA_PortRangeHint));
		ringmod_1i1o1lDescriptor->PortRangeHints =
		 (const LADSPA_PortRangeHint *)port_range_hints;

		port_names = (char **)calloc(8, sizeof(char*));
		ringmod_1i1o1lDescriptor->PortNames =
		 (const char **)port_names;

		/* Parameters for Modulation depth (0=none, 1=AM, 2=RM) */
		port_descriptors[RINGMOD_1I1O1L_DEPTHP] =
		 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
		port_names[RINGMOD_1I1O1L_DEPTHP] =
		 D_("Modulation depth (0=none, 1=AM, 2=RM)");
		port_range_hints[RINGMOD_1I1O1L_DEPTHP].HintDescriptor =
		 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_0;
		port_range_hints[RINGMOD_1I1O1L_DEPTHP].LowerBound = 0;
		port_range_hints[RINGMOD_1I1O1L_DEPTHP].UpperBound = 2;

		/* Parameters for Frequency (Hz) */
		port_descriptors[RINGMOD_1I1O1L_FREQ] =
		 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
		port_names[RINGMOD_1I1O1L_FREQ] =
		 D_("Frequency (Hz)");
		port_range_hints[RINGMOD_1I1O1L_FREQ].HintDescriptor =
		 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_440;
		port_range_hints[RINGMOD_1I1O1L_FREQ].LowerBound = 1;
		port_range_hints[RINGMOD_1I1O1L_FREQ].UpperBound = 1000;

		/* Parameters for Sine level */
		port_descriptors[RINGMOD_1I1O1L_SIN] =
		 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
		port_names[RINGMOD_1I1O1L_SIN] =
		 D_("Sine level");
		port_range_hints[RINGMOD_1I1O1L_SIN].HintDescriptor =
		 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_1;
		port_range_hints[RINGMOD_1I1O1L_SIN].LowerBound = -1;
		port_range_hints[RINGMOD_1I1O1L_SIN].UpperBound = +1;

		/* Parameters for Triangle level */
		port_descriptors[RINGMOD_1I1O1L_TRI] =
		 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
		port_names[RINGMOD_1I1O1L_TRI] =
		 D_("Triangle level");
		port_range_hints[RINGMOD_1I1O1L_TRI].HintDescriptor =
		 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_0;
		port_range_hints[RINGMOD_1I1O1L_TRI].LowerBound = -1;
		port_range_hints[RINGMOD_1I1O1L_TRI].UpperBound = +1;

		/* Parameters for Sawtooth level */
		port_descriptors[RINGMOD_1I1O1L_SAW] =
		 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
		port_names[RINGMOD_1I1O1L_SAW] =
		 D_("Sawtooth level");
		port_range_hints[RINGMOD_1I1O1L_SAW].HintDescriptor =
		 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_0;
		port_range_hints[RINGMOD_1I1O1L_SAW].LowerBound = -1;
		port_range_hints[RINGMOD_1I1O1L_SAW].UpperBound = +1;

		/* Parameters for Square level */
		port_descriptors[RINGMOD_1I1O1L_SQU] =
		 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
		port_names[RINGMOD_1I1O1L_SQU] =
		 D_("Square level");
		port_range_hints[RINGMOD_1I1O1L_SQU].HintDescriptor =
		 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_0;
		port_range_hints[RINGMOD_1I1O1L_SQU].LowerBound = -1;
		port_range_hints[RINGMOD_1I1O1L_SQU].UpperBound = +1;

		/* Parameters for Input */
		port_descriptors[RINGMOD_1I1O1L_INPUT] =
		 LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO;
		port_names[RINGMOD_1I1O1L_INPUT] =
		 D_("Input");
		port_range_hints[RINGMOD_1I1O1L_INPUT].HintDescriptor = 0;

		/* Parameters for Output */
		port_descriptors[RINGMOD_1I1O1L_OUTPUT] =
		 LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO;
		port_names[RINGMOD_1I1O1L_OUTPUT] =
		 D_("Output");
		port_range_hints[RINGMOD_1I1O1L_OUTPUT].HintDescriptor = 0;

		ringmod_1i1o1lDescriptor->activate = activateRingmod_1i1o1l;
		ringmod_1i1o1lDescriptor->cleanup = cleanupRingmod_1i1o1l;
		ringmod_1i1o1lDescriptor->connect_port = connectPortRingmod_1i1o1l;
		ringmod_1i1o1lDescriptor->deactivate = NULL;
		ringmod_1i1o1lDescriptor->instantiate = instantiateRingmod_1i1o1l;
		ringmod_1i1o1lDescriptor->run = runRingmod_1i1o1l;
		ringmod_1i1o1lDescriptor->run_adding = runAddingRingmod_1i1o1l;
		ringmod_1i1o1lDescriptor->set_run_adding_gain = setRunAddingGainRingmod_1i1o1l;
	}
}

static void __attribute__((destructor)) swh_fini() {
	if (ringmod_2i1oDescriptor) {
		free((LADSPA_PortDescriptor *)ringmod_2i1oDescriptor->PortDescriptors);
		free((char **)ringmod_2i1oDescriptor->PortNames);
		free((LADSPA_PortRangeHint *)ringmod_2i1oDescriptor->PortRangeHints);
		free(ringmod_2i1oDescriptor);
	}
	ringmod_2i1oDescriptor = NULL;
	if (ringmod_1i1o1lDescriptor) {
		free((LADSPA_PortDescriptor *)ringmod_1i1o1lDescriptor->PortDescriptors);
		free((char **)ringmod_1i1o1lDescriptor->PortNames);
		free((LADSPA_PortRangeHint *)ringmod_1i1o1lDescriptor->PortRangeHints);
		free(ringmod_1i1o1lDescriptor);
	}
	ringmod_1i1o1lDescriptor = NULL;

}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Admin extends CI_Controller {

	public function index(){

		if($this->session->userdata('is_logged_in') == true){
			$this->load->model('menu_model');

			$data['cat'] = $this->menu_model->get_categories();

			$data['manufacturer'] = $this->menu_model->get_manufacturers();

			$this->load->view('admin_home',$data);
		}
		else{
			$this->load->view('404');
		}
	}

	public function create_new() {
		$data['errors'] = array();

		if($this->session->userdata('is_logged_in') == true){
			$this->load->model('menu_model');

			$data['cat'] = $this->menu_model->get_categories();

			$data['manufacturer'] = $this->menu_model->get_manufacturers();

			$this->load->view('create_new_admin', $data);
		}
		else{
			$this->load->view('404');
		}
	}

	public function confirm_new_admin()
	{
		if($this->session->userdata('is_logged_in') == true){
			$this->load->library('form_validation');

		  	$this->form_validation->set_rules('first_name', 'First Name', 'trim|required');
		  	$this->form_validation->set_rules('last_name', 'Last Name', 'trim|required');
		  	$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email');
		  	$this->form_validation->set_rules('password', 'Password', 'trim|required|min_length[4]|max_length[32]');
		  	$this->form_validation->set_rules('confirm_password', 'Confirm Password', 'trim|required|matches[password]');

		  	if($this->form_validation->run() == FALSE)
		  	{
		   		$data['errors'] = validation_errors();
		   		$this->load->view('create_new_admin', $data);
		  	}
		  	else
		  	{
		  		$this->load->model('login_model');
		   		$p = $this->login_model->entry_new_admin();
		   		if($p){
		   			//echo "success";
		   			$this->load_admin_list();
		   		}
		   		else
		   			echo "failure";
		  	}
		}

		else{
			$this->load->view('404');
		}
	}

	public function load_admin_list()
	{
		if($this->session->userdata('is_logged_in') == true){
			$this->load->model('login_model');
			$d['result'] = $this->login_model->get_admin();
			$count = $this->login_model->get_count();

			if($count == 1) {
				$d['stat'] = 1;
			}
			else {
				$d['stat'] = 0;
			}

			$this->load->view('admin_list', $d);
		}

		else{
			$this->load->view('404');
		}
	}

	public function delete_admin(){
		if($this->session->userdata('is_logged_in') == true){
			$id = $_GET['id'];

			$this->load->model('login_model');

			$d = $this->login_model->delete_admin($id);

			if($d) {
				$this->load_admin_list();
			}
		}
		else{
			$this->load->view('404');
		}

	}
}


text:
package com.amazonaws.services.config.model;

import javax.annotation.Generated;

/**
 *
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum OrganizationConfigRuleTriggerType {

    ConfigurationItemChangeNotification("ConfigurationItemChangeNotification"),
    OversizedConfigurationItemChangeNotification("OversizedConfigurationItemChangeNotification"),
    ScheduledNotification("ScheduledNotification");

    private String value;

    private OrganizationConfigRuleTriggerType(String value) {
        this.value = value;
    }

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

    /**
     * Use this in place of valueOf.
     *
     * @param value
     *        real value
     * @return OrganizationConfigRuleTriggerType corresponding to the value
     *
     * @throws IllegalArgumentException
     *         If the specified value does not map to one of the known values in this enum.
     */
    public static OrganizationConfigRuleTriggerType fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

        for (OrganizationConfigRuleTriggerType enumEntry : OrganizationConfigRuleTriggerType.values()) {
            if (enumEntry.toString().equals(value)) {
                return enumEntry;
            }
        }

        throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
    }
}


text:
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Enterprise.Invoicing.Entities.Models.Mapping
{
    public class V_StockOutPurchaseMap : EntityTypeConfiguration<V_StockOutPurchase>
    {
        public V_StockOutPurchaseMap()
        {
            // Primary Key
            this.HasKey(t => new { t.bomOrderNo, t.supplierName, t.Amount, t.Price, t.sellAmount, t.materialNo, t.materialName, t.xslength, t.createDate, t.status, t.isover, t.depotId, t.outAmount, t.returnAmount, t.outPrice, t.orderSn, t.outDetailSn, t.totalCost, t.outCost, t.returnCost });

            // Properties
            this.Property(t => t.bomOrderNo)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.supplierName)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.materialNo)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.materialName)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.materialModel)
                .HasMaxLength(50);

            this.Property(t => t.category)
                .HasMaxLength(50);

            this.Property(t => t.unit)
                .HasMaxLength(50);

            this.Property(t => t.tunumber)
                .HasMaxLength(50);

            this.Property(t => t.xslength)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.stockoutNo)
                .HasMaxLength(50);

            this.Property(t => t.status)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.isover)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.depotId)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.orderSn)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.outDetailSn)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.remark)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("V_StockOutPurchase");
            this.Property(t => t.bomOrderNo).HasColumnName("bomOrderNo");
            this.Property(t => t.supplierId).HasColumnName("supplierId");
            this.Property(t => t.supplierName).HasColumnName("supplierName");
            this.Property(t => t.Amount).HasColumnName("Amount");
            this.Property(t => t.Price).HasColumnName("Price");
            this.Property(t => t.sellAmount).HasColumnName("sellAmount");
            this.Property(t => t.materialNo).HasColumnName("materialNo");
            this.Property(t => t.materialName).HasColumnName("materialName");
            this.Property(t => t.materialModel).HasColumnName("materialModel");
            this.Property(t => t.category).HasColumnName("category");
            this.Property(t => t.unit).HasColumnName("unit");
            this.Property(t => t.tunumber).HasColumnName("tunumber");
            this.Property(t => t.xslength).HasColumnName("xslength");
            this.Property(t => t.stockoutNo).HasColumnName("stockoutNo");
            this.Property(t => t.createDate).HasColumnName("createDate");
            this.Property(t => t.status).HasColumnName("status");
            this.Property(t => t.isover).HasColumnName("isover");
            this.Property(t => t.depotId).HasColumnName("depotId");
            this.Property(t => t.outAmount).HasColumnName("outAmount");
            this.Property(t => t.returnAmount).HasColumnName("returnAmount");
            this.Property(t => t.outPrice).HasColumnName("outPrice");
            this.Property(t => t.orderSn).HasColumnName("orderSn");
            this.Property(t => t.outDetailSn).HasColumnName("outDetailSn");
            this.Property(t => t.remark).HasColumnName("remark");
            this.Property(t => t.totalCost).HasColumnName("totalCost");
            this.Property(t => t.outCost).HasColumnName("outCost");
            this.Property(t => t.returnCost).HasColumnName("returnCost");
        }
    }
}


text:
Clazz.declarePackage ("J.render");
Clazz.load (["J.render.LabelsRenderer"], "J.render.EchoRenderer", ["JM.Atom", "J.render.TextRenderer", "JU.C", "$.Txt"], function () {
c$ = Clazz.declareType (J.render, "EchoRenderer", J.render.LabelsRenderer);
Clazz.overrideMethod (c$, "render",
function () {
if (this.vwr.isPreviewOnly) return false;
var echo = this.shape;
var scalePixelsPerMicron = (this.vwr.getBoolean (603979845) ? this.vwr.getScalePixelsPerAngstrom (true) * 10000 : 0);
this.imageFontScaling = this.vwr.imageFontScaling;
var haveTranslucent = false;
this.setZcutoff ();
for (var t, $t = echo.objects.values ().iterator (); $t.hasNext () && ((t = $t.next ()) || true);) {
if (!t.visible || t.hidden) {
continue;
}if (Clazz.instanceOf (t.pointerPt, JM.Atom)) {
if (!(t.pointerPt).checkVisible ()) continue;
}if (t.valign == 4) {
this.tm.transformPtScr (t.xyz, this.pt0i);
t.setXYZs (this.pt0i.x, this.pt0i.y, this.pt0i.z, this.pt0i.z);
}if (t.movableZPercent != 2147483647) {
var z = this.vwr.tm.zValueFromPercent (t.movableZPercent % 1000);
if (t.valign == 4 && Math.abs (t.movableZPercent) >= 1000) z = this.pt0i.z - this.vwr.tm.zValueFromPercent (0) + z;
t.setZs (z, z);
}if (t.zSlab >= this.zCutoff) continue;
if (t.pointerPt == null) {
t.pointer = 0;
} else {
t.pointer = 1;
this.tm.transformPtScr (t.pointerPt, this.pt0i);
t.atomX = this.pt0i.x;
t.atomY = this.pt0i.y;
t.atomZ = this.pt0i.z;
if (t.zSlab == -2147483648) t.zSlab = 1;
}if (J.render.TextRenderer.render (t, this.g3d, scalePixelsPerMicron, this.imageFontScaling, false, null, this.xy) && t.valign == 1 && t.align == 12) this.vwr.noFrankEcho = false;
if (JU.C.renderPass2 (t.bgcolix) || JU.C.renderPass2 (t.colix)) haveTranslucent = true;
}
if (!this.isExport) {
var frameTitle = this.vwr.getFrameTitle ();
if (frameTitle != null && frameTitle.length > 0) {
if (this.g3d.setC (this.vwr.cm.colixBackgroundContrast)) {
if (frameTitle.indexOf ("%{") >= 0 || frameTitle.indexOf ("@{") >= 0) frameTitle = JU.Txt.formatText (this.vwr, frameTitle);
this.renderFrameTitle (frameTitle);
}}}return haveTranslucent;
});
Clazz.defineMethod (c$, "renderFrameTitle",
 function (frameTitle) {
this.vwr.gdata.setFontFid (this.vwr.gdata.getFontFidFS ("arial", Clazz.floatToInt (24 * this.imageFontScaling)));
var y = Clazz.doubleToInt (Math.floor (this.vwr.getScreenHeight () * (this.g3d.isAntialiased () ? 2 : 1) - 10 * this.imageFontScaling));
var x = Clazz.doubleToInt (Math.floor (5 * this.imageFontScaling));
this.g3d.drawStringNoSlab (frameTitle, null, x, y, 0, 0);
}, "~S");
});


text:
<!DOCTYPE HTML>
<?php
	require_once("php/controller/create-db.php");
?>

		<title>Awesomenauts by Karpinski</title>
		<link rel="stylesheet" type="text/css" media="screen" href="index.css">

		<meta id="viewport" name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon" href="icons/touch-icon-iphone-60x60.png">
        <link rel="apple-touch-icon" sizes="76x76" href="icons/touch-icon-ipad-76x76.png">
        <link rel="apple-touch-icon" sizes="120x120" href="icons/touch-icon-iphone-retina-120x120.png">
        <link rel="apple-touch-icon" sizes="152x152" href="icons/touch-icon-ipad-retina-152x152.png">

        <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/themes/smoothness/jquery-ui.css" />

		<form id="input" method="post">

				Username
				<input type='text' name='username' id='username' autocomplete='off'>

				Password
				<input type='password' name='password' id='password'>

			<button type='button' id='register'>Register</button>
			<button type='button' id='load'>Load</button>
			<button type='button' id='mainmenu'>Main Menu</button>
		</form>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>TP3v1: Référence du fichier Texture2D.cpp</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">

Page principale

Modules

Structures de données

Fichiers

Liste des fichiers

Portée globale

Référence du fichier Texture2D.cpp
Définit la classe CTexture2D qui implémente une texture2D openGL. Plus de détails...

#include "Texture2D.h"

Graphe des dépendances par inclusion de Texture2D.cpp:

<map name="Texture2D.cpp_map">
<area href="_texture2_d_8h.html" shape="rect" coords="167,107,263,133" alt="">
<area href="_texture_abstraite_8h.html" shape="rect" coords="312,107,445,133" alt="">
<area href="_var_8h.html" shape="rect" coords="499,208,552,235" alt="">
<area href="_cst_8h.html" shape="rect" coords="499,157,552,184" alt="">
<area href="_singleton_8h.html" shape="rect" coords="607,157,695,184" alt="">
</map>

Description détaillée

Définit la classe CTexture2D qui implémente une texture2D openGL.

Auteur:

Frédéric Plourde

Date:

2008-01-18

Version:

1.0

<address style="align: right;">Généré le Wed Sep 17 08:53:49 2008 pour TP3v1 par

 1.4.7 </address>