text:
/*
import * as React from 'react'
import * as Sb from '../../stories/storybook'
import Recipients from '.'

const oneUser = ['cecileb']
const muiltipleUsers = ['chris', 'cecileb', 'cdixon', 'max']

const store = Sb.createStoreWithCommon()

const load = () => {
  Sb.storiesOf('Crypto/Recipients', module)
    .addDecorator(Sb.updateStoreDecorator(store, _ => {}))
    .add('Empty', () => <Recipients />)

  Sb.storiesOf('Crypto/Recipients', module)
    .addDecorator(
      Sb.updateStoreDecorator(store, draftState => {
        draftState.crypto.encrypt.recipients = oneUser
      })
    )
    .add('Single User', () => <Recipients />)

  Sb.storiesOf('Crypto/Recipients', module)
    .addDecorator(
      Sb.updateStoreDecorator(store, draftState => {
        draftState.crypto.encrypt.recipients = muiltipleUsers
      })
    )
    .add('Multiple Users', () => <Recipients />)

  Sb.storiesOf('Crypto/Recipients', module)
    .addDecorator(
      Sb.updateStoreDecorator(store, draftState => {
        draftState.crypto.encrypt.recipients = muiltipleUsers
        draftState.crypto.encrypt.inProgress = true
      })
    )
    .add('Disabled (file operation in progress)', () => <Recipients />)
}

export default load
*/

export default {}


text:
function imdb = cnn_setup_data_voc07_ssw(varargin)
%CNN_SETUP_DATE_VOC07_SSW  Setup PASCAL VOC 2007 data with precomputed SSW proposals
%
% Copyright (C) 2016 Hakan Bilen.
% All rights reserved.
%
% This file is part of the VLFeat library and is made available under
% the terms of the BSD license (see the COPYING file).

opts.sswDir = fullfile('data','SSW') ;
opts.dataDir = 'data' ;
opts.addFlipped = true ;
opts.useDifficult = true ;
opts.fgThresh = 0.5 ;
opts.bgThreshHi = 0.5 ;
opts.bgThreshLo = 0.1 ;
opts = vl_argparse(opts, varargin) ;

%% Get selective search windows
files = {...
  'SelectiveSearchVOC2007trainval.mat', ...
  'SelectiveSearchVOC2007test.mat'} ;

if ~exist(opts.sswDir, 'dir')
  mkdir(opts.sswDir) ;
end

for i=1:numel(files)
  outPath = fullfile(opts.sswDir, files{i}) ;
  if ~exist(outPath, 'file')
    url = sprintf('http://koen.me/research/downloads/%s',files{i}) ;
    fprintf('Downloading %s to %s\n', url, outPath) ;
    urlwrite(url,outPath) ;
  end
end

%% Get image names and gt boxes.
imdb = cnn_setup_data_voc07(...
  'dataDir', opts.dataDir, ...
  'useDifficult', opts.useDifficult, ...
  'addFlipped', opts.addFlipped) ;

%% Load precomputed object proposals
train = load(fullfile(opts.sswDir, files{1})) ;
test = load(fullfile(opts.sswDir, files{2})) ;

% Check that all proposals are correctly matched to an image in imdb
assert(isempty(...
  setxor(vertcat(train.images,test.images), cellfun(@(x)x(1:6),imdb.images.name,'uniformoutput',0)))) ;

if opts.addFlipped
  boxes = horzcat(train.boxes,train.boxes,test.boxes) ;
  imnames = vertcat(train.images,train.images,test.images) ;
else
  boxes = horzcat(train.boxes,test.boxes) ;
  imnames = vertcat(train.images,test.images) ;
end
assert(numel(boxes)==numel(imdb.images.name)) ;

% Sort proposals by ascending image name, as this is also the order in imdb
[imnames,si] = sort(imnames);
boxes = boxes(si);

% Transpose XY in proposals
for i=1:numel(boxes)
  boxes{i} = boxes{i}(:,[2 1 4 3]);
end

% Check boxes and find corresponding image
for i=1:numel(imdb.images.name)

  bbox = boxes{i};
  assert(strcmp(imnames{i},imdb.images.name{i}(1:end-4)));
  assert(all(all(bbox(:,[1 2]) <= bbox(:,[3 4])))) ;
  assert(all(all(1 <= bbox & bsxfun(@le, bbox, imdb.images.size(i,[1 2 1 2]))))) ;

  % Flip the proposals if needed
  if imdb.boxes.flip(i)
    imageWidth = imdb.images.size(i,1) ;
    bbox(:,[3 1]) = imageWidth - bbox(:,[1 3]) + 1 ;
  end

  boxes{i} = bbox ;
end

imdb = attach_proposals(imdb,boxes,opts.fgThresh,opts.bgThreshHi,opts.bgThreshLo);
imdb = add_bboxreg_targets(imdb);

if 0
  for i = 1:100
    for c = 1:21
      sel = find(imdb.boxes.plabel{i} == c) ;
      if isempty(sel), continue ; end
      im = imread(fullfile(imdb.imageDir, imdb.images.name{i})) ;
      if imdb.boxes.flip(i), im = fliplr(im) ; end
      pbox = imdb.boxes.pbox{i}(sel,:) ;
      clf ; bbox_draw(im, pbox) ;
      title(sprintf('Class %d', c)) ;
      keyboard
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
package workers

import (
	"encoding/json"

	"github.com/customerio/gospec"
	. "github.com/customerio/gospec"
	"github.com/garyburd/redigo/redis"
)

func EnqueueSpec(c gospec.Context) {
	was := Config.Namespace
	Config.Namespace = "prod:"

	c.Specify("Enqueue", func() {
		conn := Config.Pool.Get()
		defer conn.Close()

		c.Specify("makes the queue available", func() {
			Enqueue("enqueue1", []int{1, 2})

			found, _ := redis.Bool(conn.Do("sismember", "prod:queues", "enqueue1"))
			c.Expect(found, IsTrue)
		})

		c.Specify("adds a job to the queue", func() {
			nb, _ := redis.Int(conn.Do("llen", "prod:queue:enqueue2"))
			c.Expect(nb, Equals, 0)

			Enqueue("enqueue2", []int{1, 2})

			nb, _ = redis.Int(conn.Do("llen", "prod:queue:enqueue2"))
			c.Expect(nb, Equals, 1)
		})

		c.Specify("saves the arguments", func() {
			Enqueue("enqueue3", []string{"foo", "bar"})

			b, _ := redis.Bytes(conn.Do("lpop", "prod:queue:enqueue3"))

			bytes := MustUncompress(b)

			var result []interface{}
			json.Unmarshal(bytes, &result)
			c.Expect(result[0], Equals, "foo")
			c.Expect(result[1], Equals, "bar")
		})

		c.Specify("saves the multiple jobs at once", func() {
			Enqueue("enqueue3", []string{"foo", "bar"}, []string{"foo", "bar"})

			b, err := redis.Bytes(conn.Do("lpop", "prod:queue:enqueue3"))
			if err != nil {
				panic(err)
			}

			bytes := MustUncompress(b)

			var result []interface{}
			json.Unmarshal(bytes, &result)
			c.Expect(result[0], Equals, "foo")
			c.Expect(result[1], Equals, "bar")

			b, err = redis.Bytes(conn.Do("lpop", "prod:queue:enqueue3"))
			if err != nil {
				panic(err)
			}

			bytes = MustUncompress(b)

			var result2 []interface{}
			json.Unmarshal(bytes, &result2)
			c.Expect(result2[0], Equals, "foo")
			c.Expect(result2[1], Equals, "bar")
		})
	})

	Config.Namespace = was
}


text:
body {
  font-family: Arial, sans-serif;
  color: blue;
}


text:
module BingSearchClient
  class News

    attr_reader :num_results, :params

    def initialize(num_results: 100, params: {})
      @num_results = num_results
      @params = params
    end

    def search(q:, offset: 0)
      query_string = 'q='
      query_portion = URI.encode_www_form_component('\'' + q + '\'')
      local_params = "&count=#{num_results}&offset=#{offset}"
      @params.each do |k,v|
        local_params << "&#{k.to_s}=#{v.to_s}"
      end
      full_address = [BingSearchClient.config.base_url, 'news/search'].join('/') + '?' + query_string + query_portion + local_params
      Client.new(url: full_address).get
    end
  end
end


text:
package com.labsmobile.example.util;

/**
 * Groups various constants used across the application.
 *
 * @author talosdev for LabsMobile
 * @version 1.0
*/
public class Constants {

    /**
     * The link to which the "Don't have an account" button should point to.
     */
    public static final String LABS_MOBILE_REGISTRATION_URL = "http://www.labsmobile.com";

    /**
     * The phone number entered by the user
     */
    public static final String EXTRA_PHONE_NUMBER = "com.labsmobile.extra.PHONE_NUMBER";

    /**
     * Whether a new code has been just requested. If false it means that there is an old request pending.
     */
    public static final String EXTRA_REQUESTED = "com.labsmobile.extra.REQUESTED";

}


text:
import React from 'react';
import PropTypes from 'prop-types';
import { QueryClientProvider, QueryClient } from 'react-query';
import { LibraryProvider, StrapiAppProvider } from '@strapi/helper-plugin';
import { Provider } from 'react-redux';
import { AdminContext } from '../../contexts';
import ConfigurationsProvider from '../ConfigurationsProvider';
import LanguageProvider from '../LanguageProvider';
import GuidedTour from '../GuidedTour';
import AutoReloadOverlayBlockerProvider from '../AutoReloadOverlayBlockerProvider';
import Notifications from '../Notifications';
import OverlayBlocker from '../OverlayBlocker';
import ThemeToggleProvider from '../ThemeToggleProvider';
import Theme from '../Theme';

const queryClient = new QueryClient({
  defaultOptions: {
    queries: {
      refetchOnWindowFocus: false,
    },
  },
});

const Providers = ({
  authLogo,
  children,
  components,
  fields,
  getAdminInjectedComponents,
  getPlugin,
  localeNames,
  menu,
  menuLogo,
  messages,
  plugins,
  runHookParallel,
  runHookSeries,
  runHookWaterfall,
  settings,
  showReleaseNotification,
  showTutorials,
  store,
  themes,
}) => {
  return (
    <ThemeToggleProvider themes={themes}>
      <Theme>
        <QueryClientProvider client={queryClient}>
          <Provider store={store}>
            <AdminContext.Provider value={{ getAdminInjectedComponents }}>
              <ConfigurationsProvider
                authLogo={authLogo}
                menuLogo={menuLogo}
                showReleaseNotification={showReleaseNotification}
                showTutorials={showTutorials}
              >
                <StrapiAppProvider
                  getPlugin={getPlugin}
                  menu={menu}
                  plugins={plugins}
                  runHookParallel={runHookParallel}
                  runHookWaterfall={runHookWaterfall}
                  runHookSeries={runHookSeries}
                  settings={settings}
                >
                  <LibraryProvider components={components} fields={fields}>
                    <LanguageProvider messages={messages} localeNames={localeNames}>
                      <AutoReloadOverlayBlockerProvider>
                        <OverlayBlocker>
                          <GuidedTour>
                            <Notifications>{children}</Notifications>
                          </GuidedTour>
                        </OverlayBlocker>
                      </AutoReloadOverlayBlockerProvider>
                    </LanguageProvider>
                  </LibraryProvider>
                </StrapiAppProvider>
              </ConfigurationsProvider>
            </AdminContext.Provider>
          </Provider>
        </QueryClientProvider>
      </Theme>
    </ThemeToggleProvider>
  );
};

Providers.propTypes = {
  authLogo: PropTypes.oneOfType([PropTypes.string, PropTypes.any]).isRequired,
  children: PropTypes.element.isRequired,
  components: PropTypes.object.isRequired,
  fields: PropTypes.object.isRequired,
  getAdminInjectedComponents: PropTypes.func.isRequired,
  getPlugin: PropTypes.func.isRequired,
  localeNames: PropTypes.objectOf(PropTypes.string).isRequired,
  menu: PropTypes.arrayOf(
    PropTypes.shape({
      to: PropTypes.string.isRequired,
      icon: PropTypes.func.isRequired,
      intlLabel: PropTypes.shape({
        id: PropTypes.string.isRequired,
        defaultMessage: PropTypes.string.isRequired,
      }).isRequired,
      permissions: PropTypes.array,
      Component: PropTypes.func,
    })
  ).isRequired,
  menuLogo: PropTypes.oneOfType([PropTypes.string, PropTypes.any]).isRequired,
  messages: PropTypes.object.isRequired,
  plugins: PropTypes.object.isRequired,
  runHookParallel: PropTypes.func.isRequired,
  runHookWaterfall: PropTypes.func.isRequired,
  runHookSeries: PropTypes.func.isRequired,
  settings: PropTypes.object.isRequired,
  showReleaseNotification: PropTypes.bool.isRequired,
  showTutorials: PropTypes.bool.isRequired,
  store: PropTypes.object.isRequired,
  themes: PropTypes.shape({
    light: PropTypes.shape({
      colors: PropTypes.object.isRequired,
      shadows: PropTypes.object.isRequired,
      sizes: PropTypes.object.isRequired,
      zIndices: PropTypes.array.isRequired,
      spaces: PropTypes.array.isRequired,
      borderRadius: PropTypes.string.isRequired,
      mediaQueries: PropTypes.object.isRequired,
      fontSizes: PropTypes.array.isRequired,
      lineHeights: PropTypes.array.isRequired,
      fontWeights: PropTypes.object.isRequired,
    }).isRequired,
    dark: PropTypes.shape({
      colors: PropTypes.object.isRequired,
      shadows: PropTypes.object.isRequired,
      sizes: PropTypes.object.isRequired,
      zIndices: PropTypes.array.isRequired,
      spaces: PropTypes.array.isRequired,
      borderRadius: PropTypes.string.isRequired,
      mediaQueries: PropTypes.object.isRequired,
      fontSizes: PropTypes.array.isRequired,
      lineHeights: PropTypes.array.isRequired,
      fontWeights: PropTypes.object.isRequired,
    }).isRequired,
    custom: PropTypes.object,
  }).isRequired,
};

export default Providers;


text:
void processFrontConnected(Task *task);

void processFrontDisconnected(Task *task);

void processRtnNotice(Task *task);

void processRspError(Task *task);

void processRspStockUserLogin(Task *task);

void processRspStockUserLogout(Task *task);

void processRspSOPUserLogin(Task *task);

void processRspSOPUserLogout(Task *task);

void processRspFASLUserLogin(Task *task);

void processRspFASLUserLogout(Task *task);

void processRspStockSubMarketData(Task *task);

void processRspStockUnSubMarketData(Task *task);

void processRspSOPSubMarketData(Task *task);

void processRspSOPUnSubMarketData(Task *task);

void processStockMarketData(Task *task);

void processSOPMarketData(Task *task);

void processRspStockAvailableQuot(Task *task);

void processRspSopAvailableQuot(Task *task);

void processRspUserMDPasswordUpdate(Task *task);


text:
<?php
    include_once("connect.php");
	include_once("common.php");

	$user_id = (isset($user_id)) ? $user_id : $_GET['user_id'];
	$response = "";

	if ($user_id) {
		if (checkId($user_id)) {
			$response = userById($user_id);
		}
		else {
			$response = errorResponse("The user id provided is not valid");
		}
	}
	else {
		$response = errorResponse("The user id was not provided");
	}

	echo $response;

	function userById ($user_id) {
		$result = getUserById($user_id);
		return formJson($result);
	}

	function getUserById ($user_id) {
		$sql = sprintf("SELECT user_id, first_name, last_name, age, email, receive_notifications, is_new, lang_id FROM user WHERE user_id = '%d'",
				$user_id);

		return executeSql($sql);
	}

	function formJson ($result) {
		$users = array();

		while ($item = mysql_fetch_array($result)) {
			$user = array(
				"user_id" => $item['user_id'],
				"first_name" => $item['first_name'],
				"last_name" => $item['last_name'],
				"age" => $item['age'],
				"email" => $item['email'],
				"receive_notifications" => $item['receive_notifications'],
				"is_new" => $item['is_new'],
				"lang_id" => $item['lang_id']
			);

			array_push($users, $user);
	  	}

		$response = array(
    		"status" => "ok",
    		"users" => $users
		);

		return json_encode($response);
	}
?>


text:
package org.apereo.cas.ticket.registry;

import org.apereo.cas.CipherExecutor;
import org.apereo.cas.ticket.Ticket;

import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.apache.commons.lang3.StringUtils;

import java.util.Collection;
import java.util.Map;
import java.util.function.Predicate;

/**
 * This is {@link AbstractMapBasedTicketRegistry}.
 *
 * @author Misagh Moayyed
 * @since 5.2.0
 */
@Slf4j
@NoArgsConstructor
public abstract class AbstractMapBasedTicketRegistry extends AbstractTicketRegistry {

    /**
     * Creates a new, empty registry with the cipher.
     *
     * @param cipherExecutor the cipher executor
     */
    public AbstractMapBasedTicketRegistry(final CipherExecutor cipherExecutor) {
        setCipherExecutor(cipherExecutor);
    }

    @Override
    public void addTicket(@NonNull final Ticket ticket) {
        val encTicket = encodeTicket(ticket);
        LOGGER.debug("Added ticket [{}] to registry.", ticket.getId());
        getMapInstance().put(encTicket.getId(), encTicket);
    }

    @Override
    public Ticket getTicket(final String ticketId, final Predicate<Ticket> predicate) {
        val encTicketId = encodeTicketId(ticketId);
        if (StringUtils.isBlank(ticketId)) {
            return null;
        }
        val found = getMapInstance().get(encTicketId);
        if (found == null) {
            LOGGER.debug("Ticket [{}] could not be found", encTicketId);
            return null;
        }

        val result = decodeTicket(found);
        if (!predicate.test(result)) {
            LOGGER.debug("The condition enforced by the predicate [{}] cannot successfully accept/test the ticket id [{}]", ticketId,
                predicate.getClass().getSimpleName());
            return null;
        }
        return result;
    }

    @Override
    public boolean deleteSingleTicket(final String ticketId) {
        val encTicketId = encodeTicketId(ticketId);
        if (StringUtils.isBlank(encTicketId)) {
            return false;
        }
        return getMapInstance().remove(encTicketId) != null;
    }

    @Override
    public long deleteAll() {
        val size = getMapInstance().size();
        getMapInstance().clear();
        return size;
    }

    @Override
    public Collection<Ticket> getTickets() {
        return decodeTickets(getMapInstance().values());
    }

    @Override
    public Ticket updateTicket(final Ticket ticket) {
        addTicket(ticket);
        return ticket;
    }

    /**
     * Create map instance, which must ben created during initialization phases
     * and always be the same instance.
     *
     * @return the map
     */
    public abstract Map<String, Ticket> getMapInstance();
}


text:
.. _acknowledge:

==================
How to cite signac
==================

Please acknowledge the use of this software within the body of your publication for example by copying or adapting the following formulation:

*The computational workflow in general and data management in particular for this publication was primarily supported by the signac data management framework [1, 2].*

  [1] C. S. Adorf, P. M. Dodd, V. Ramasubramani, and S. C. Glotzer. Simple data and workflow management with the signac framework. Comput. Mater. Sci., 146(C):220-229, 2018. DOI:10.1016/j.commatsci.2018.01.035.

  [2] C. S. Adorf, P. M. Dodd, V. Ramasubramani, B. Swerdlow, J. Glaser, and B. Dice. csadorf/signac v0.9.2. dec 2017. URL: https://doi.org/10.5281/zenodo.1117952, DOI:10.5281/zenodo.1117952.

References for other specific release versions can be found `here <https://zenodo.org/badge/latestdoi/72946496>`_.
A preprint of the paper published in the Journal of Computational Materials Science is available on the `arXiv: <https://arxiv.org/abs/1611.03543>`_.

To cite these references, you can use the following BibTeX entries:

.. code-block:: bibtex

    @article{signac_commat,
      author        = {Carl S. Adorf and
                       Paul M. Dodd and
                       Vyas Ramasubramani and
                       Sharon C. Glotzer},
      title         = {Simple data and workflow management with the signac framework},
      journal       = {Comput. Mater. Sci.},
      volume        = {146},
      number        = {C},
      year          = {2018},
      pages         = {220-229},
      doi           = {10.1016/j.commatsci.2018.01.035}
    }
    @misc{signac_0_9_2,
      author       = {Carl S. Adorf and
                      Paul M. Dodd and
                      Vyas Ramasubramani and
                      Benjamin Swerdlow and
                      Jens Glaser and
                      Bradley Dice},
      title        = {csadorf/signac v0.9.2},
      month        = {dec},
      year         = {2017},
      doi          = {10.5281/zenodo.1117952},
      url          = {https://doi.org/10.5281/zenodo.1117952}
    }


text:
const _ = require('lodash');
const indexArguments = require('../../../handlers/lib/index_arguments');

module.exports = function invokeSeriesFn(fnDef, args, tlConfigOverrides) {
  const tlConfig = _.merge(require('../fixtures/tlConfig')(), tlConfigOverrides);

  return Promise.all(args).then(function (args) {
    args.byName = indexArguments(fnDef, args);

    const input = _.cloneDeep(args);

    return Promise.resolve(fnDef.originalFn(args, tlConfig)).then(function (output) {

      const result = {
        output: output,
        input: input
      };
      return result;
    });
  });
};


text:
/**
 * Chunk Manager Checks.
 */
package org.apache.hadoop.ozone.container.keyvalue;


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <title>dependencies_ok? (Gem::Uninstaller)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />

# File lib/rubygems/uninstaller.rb, line 238
  def dependencies_ok?(spec)
    return true if @force_ignore

    deplist = Gem::DependencyList.from_source_index @source_index
    deplist.add(*@user_index.gems.values) if @user_install
    deplist.ok_to_remove?(spec.full_name) || ask_if_ok(spec)
  end


text:
package org.apache.geode.distributed.internal;

import java.util.Set;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
import org.apache.geode.internal.cache.DirectReplyMessage;

/**
 * This interface is used by direct ack messages to send a reply to the original sender of the
 * message. Any message which implements {@link DirectReplyMessage} must reply by calling
 * putOutgoing on the ReplySender returned by
 * {@link DistributionMessage#getReplySender(DistributionManager)}
 *
 * The reply sender may be the distribution manager itself, or it may send the reply directly back
 * on the same socket the message as received on.
 *
 */
public interface ReplySender {

  /**
   * @param message to send.
   * @return recipients who did not receive the message. May return an immutable set.
   */
  @Nullable
  Set<InternalDistributedMember> putOutgoing(@NotNull DistributionMessage message);

}


text:
<?php

namespace APY\DataGridBundle\Grid\Column;

use Symfony\Component\Security\Core\SecurityContextInterface;
use APY\DataGridBundle\Grid\Filter;

abstract class Column
{
    const DEFAULT_VALUE = null;

    /**
     * Filter
     */
    const DATA_CONJUNCTION = 0;
    const DATA_DISJUNCTION = 1;

    const OPERATOR_EQ     = 'eq';
    const OPERATOR_NEQ    = 'neq';
    const OPERATOR_LT     = 'lt';
    const OPERATOR_LTE    = 'lte';
    const OPERATOR_GT     = 'gt';
    const OPERATOR_GTE    = 'gte';
    const OPERATOR_BTW    = 'btw';
    const OPERATOR_BTWE   = 'btwe';
    const OPERATOR_LIKE   = 'like';
    const OPERATOR_NLIKE  = 'nlike';
    const OPERATOR_RLIKE  = 'rlike';
    const OPERATOR_LLIKE  = 'llike';
    const OPERATOR_ISNULL  = 'isNull';
    const OPERATOR_ISNOTNULL  = 'isNotNull';

    /**
     * Align
     */
    const ALIGN_LEFT = 'left';
    const ALIGN_RIGHT = 'right';
    const ALIGN_CENTER = 'center';

    protected static $aligns = array(
        self::ALIGN_LEFT,
        self::ALIGN_RIGHT,
        self::ALIGN_CENTER,
    );

    /**
     * Internal parameters
     */
    protected $id;
    protected $title;
    protected $sortable;
    protected $filterable;
    protected $visible;
    protected $callback;
    protected $order;
    protected $size;
    protected $visibleForSource;
    protected $primary;
    protected $align;
    protected $inputType;
    protected $field;
    protected $role;
    protected $filterType;
    protected $filter;
    protected $params;
    protected $isSorted = false;
    protected $orderUrl;
    protected $securityContext;
    protected $data;
    protected $operatorsVisible;
    protected $operators;
    protected $defaultOperator;
    protected $values = array();
    protected $selectFrom;
    protected $selectMulti;
    protected $selectExpanded;
    protected $searchOnClick = false;
    protected $safe;

    protected $dataJunction = self::DATA_CONJUNCTION;

    /**
     * Default Column constructor
     *
     * @param array $params
     */
    public function __construct($params = null)
    {
        $this->__initialize((array) $params);
    }

    public function __initialize(array $params)
    {
        $this->params = $params;
        $this->setId($this->getParam('id'));
        $this->setTitle($this->getParam('title', ''));
        $this->setSortable($this->getParam('sortable', true));
        $this->setVisible($this->getParam('visible', true));
        $this->setSize($this->getParam('size', -1));
        $this->setFilterable($this->getParam('filterable', true));
        $this->setVisibleForSource($this->getParam('source', false));
        $this->setPrimary($this->getParam('primary', false));
        $this->setAlign($this->getParam('align', self::ALIGN_LEFT));
        $this->setInputType($this->getParam('inputType', 'text'));
        $this->setField($this->getParam('field'));
        $this->setRole($this->getParam('role'));
        $this->setOrder($this->getParam('order'));
        $this->setFilterType($this->getParam('filter', 'input'));
        $this->setSelectFrom($this->getParam('selectFrom', 'query'));
        $this->setValues($this->getParam('values', array()));
        $this->setOperatorsVisible($this->getParam('operatorsVisible', true));
        // Order is important for the order display
        $this->setOperators($this->getParam('operators', array(
            self::OPERATOR_EQ,
            self::OPERATOR_NEQ,
            self::OPERATOR_LT,
            self::OPERATOR_LTE,
            self::OPERATOR_GT,
            self::OPERATOR_GTE,
            self::OPERATOR_BTW,
            self::OPERATOR_BTWE,
            self::OPERATOR_LIKE,
            self::OPERATOR_NLIKE,
            self::OPERATOR_RLIKE,
            self::OPERATOR_LLIKE,
            self::OPERATOR_ISNULL,
            self::OPERATOR_ISNOTNULL,
        )));
        $this->setDefaultOperator($this->getParam('defaultOperator', self::OPERATOR_LIKE));
        $this->setSelectMulti($this->getParam('selectMulti', false));
        $this->setSelectExpanded($this->getParam('selectExpanded', false));
        $this->setSearchOnClick($this->getParam('searchOnClick'), false);
        $this->setSafe($this->getParam('safe'), 'html');
    }

    protected function getParam($id, $default = null)
    {
        return isset($this->params[$id]) ? $this->params[$id] : $default;
    }

    /**
     * Draw cell
     *
     * @param string $value
     * @param Row $row
     * @param $router
     * @return string
     */
    public function renderCell($value, $row, $router)
    {
        if (is_callable($this->callback)) {
            return call_user_func($this->callback, $value, $row, $router);
        }

        if (array_key_exists((string)$value, $this->values)) {
            $value = $this->values[$value];
        }

        return $value;
    }

    /**
     * Set column callback
     *
     * @param  $callback
     * @return self
     */
    public function manipulateRenderCell($callback)
    {
        $this->callback = $callback;

        return $this;
    }

    /**
     * Set column identifier
     *
     * @param $id
     * @return self
     */
    public function setId($id)
    {
        $this->id = $id;

        return $this;
    }

    /**
     * get column identifier
     *
     * @return int|string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * get column render block identifier
     *
     * @return int|string
     */
    public function getRenderBlockId()
    {
        // For Mapping fields and aggregate dql functions
        return str_replace(array('.', ':'), '_', $this->id);
    }

    /**
     * Set column title
     *
     * @param string $title
     * @return \APY\DataGridBundle\Grid\Column\Column
     */
    public function setTitle($title)
    {
        $this->title = $title;

        return $this;
    }

    /**
     * Get column title
     *
     * @return string
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * Set column visibility
     *
     * @param boolean $visible
     */
    public function setVisible($visible)
    {
        $this->visible = $visible;

        return $this;
    }

    /**
     * Return column visibility
     *
     * @return bool return true when column is visible
     */
    public function isVisible()
    {
        if ($this->visible && $this->securityContext !== null && $this->getRole() != null) {
            return $this->securityContext->isGranted($this->getRole());
        }

        return $this->visible;
    }

    /**
     * Return true if column is sorted
     *
     * @return bool return true when column is sorted
     */
    public function isSorted()
    {
        return $this->isSorted;
    }

    public function setSortable($sortable)
    {
        $this->sortable = $sortable;

        return $this;
    }

    /**
     * column ability to sort
     *
     * @return bool return true when column can be sorted
     */
    public function isSortable()
    {
        return $this->sortable;
    }

    /**
     * Return true if column is filtered
     *
     * @return boolean return true when column is filtered
     */
    public function isFiltered()
    {
        return ( (isset($this->data['from']) && $this->isQueryValid($this->data['from']) && $this->data['from'] != static::DEFAULT_VALUE)
              || (isset($this->data['to']) && $this->isQueryValid($this->data['to']) && $this->data['to'] != static::DEFAULT_VALUE)
              || (isset($this->data['operator']) && ($this->data['operator'] === self::OPERATOR_ISNULL || $this->data['operator'] === self::OPERATOR_ISNOTNULL)) );
    }

    public function setFilterable($filterable)
    {
        $this->filterable = $filterable;

        return $this;
    }

    /**
     * column ability to filter
     *
     * @return bool return true when column can be filtred
     */
    public function isFilterable()
    {
        return $this->filterable;
    }

    /**
     * set column order
     *
     * @param string $order asc|desc
     * @return \APY\DataGridBundle\Grid\Column\Column
     */
    public function setOrder($order)
    {
        if ($order !== null) {
            $this->order = $order;
            $this->isSorted = true;
        }

        return $this;
    }

    /**
     * get column order
     *
     * @return string asc|desc
     */
    public function getOrder()
    {
        return $this->order;
    }

    /**
     * Set column width
     *
     * @param int $size in pixels
     * @return \APY\DataGridBundle\Grid\Column\Column
     */
    public function setSize($size)
    {
        if ($size < -1) {
            throw new \InvalidArgumentException(sprintf('Unsupported column size %s, use positive value or -1 for auto resize', $size));
        }

        $this->size = $size;

        return $this;
    }

    /**
     * get column width
     *
     * @return int column width in pixels
     */
    public function getSize()
    {
        return $this->size;
    }

    public function setOrderUrl($orderUrl)
    {
        $this->orderUrl = $orderUrl;

        return $this;
    }

    public function getOrderUrl()
    {
        return $this->orderUrl;
    }

    /**
     * set filter data from session | request
     *
     * @param  $data
     * @return \APY\DataGridBundle\Grid\Column\Column
     */
    public function setData($data)
    {
        $this->data = array('operator' => $this->getDefaultOperator(), 'from' => static::DEFAULT_VALUE, 'to' => static::DEFAULT_VALUE);

        $hasValue = false;
        if (isset($data['from']) && $this->isQueryValid($data['from'])) {
            $this->data['from'] = $data['from'];
            $hasValue = true;
        }

        if (isset($data['to']) && $this->isQueryValid($data['to'])) {
            $this->data['to'] = $data['to'];
            $hasValue = true;
        }

        $isNullOperator = (isset($data['operator']) && ($data['operator'] === self::OPERATOR_ISNULL || $data['operator'] === self::OPERATOR_ISNOTNULL) );
        if (($hasValue || $isNullOperator) && isset($data['operator']) && $this->hasOperator($data['operator'])) {
            $this->data['operator'] = $data['operator'];
        }

        return $this;
    }

    /**
     * get filter data from session | request
     *
     * @return array data
     */
    public function getData()
    {
        $result = array();

        $hasValue = false;
        if ($this->data['from'] != $this::DEFAULT_VALUE) {
            $result['from'] = $this->data['from'];
            $hasValue = true;
        }

        if ($this->data['to'] != $this::DEFAULT_VALUE) {
            $result['to'] = $this->data['to'];
            $hasValue = true;
        }

        $isNullOperator = (isset($this->data['operator']) && ($this->data['operator'] === self::OPERATOR_ISNULL || $this->data['operator'] === self::OPERATOR_ISNOTNULL) );
        if ($hasValue || $isNullOperator) {
            $result['operator'] = $this->data['operator'];
        }

        return $result;
    }

    /**
     * Return true if filter value is correct (has to be overridden in each Column class that can be filtered, in order to catch wrong values)
     *
     * @return boolean
     */
    public function isQueryValid($query)
    {
        return true;
    }

    /**
     * Set column visibility for source class
     * @param $value
     * @return \APY\DataGridBundle\Grid\Column\Column
     */
    public function setVisibleForSource($visibleForSource)
    {
        $this->visibleForSource = $visibleForSource;

        return $this;
    }

    /**
     * Return true is column in visible for source class
     * @return boolean
     */
    public function isVisibleForSource()
    {
        return $this->visibleForSource;
    }

    /**
     * Set column as primary
     *
     * @param boolean $primary
     */
    public function setPrimary($primary)
    {
        $this->primary = $primary;

        return $this;
    }

    /**
     * Return true is column in primary
     * @return boolean
     */
    public function isPrimary()
    {
        return $this->primary;
    }

    /**
     * Set column align
     * @param string $align left/right/center
     */
    public function setAlign($align)
    {
        if (!in_array($align, self::$aligns)) {
            throw new \InvalidArgumentException(sprintf('Unsupported align %s, just left, right and center are supported', $align));
        }

        $this->align = $align;

        return $this;
    }

    /**
     * get column align
     * @return bool
     */
    public function getAlign()
    {
        return $this->align;
    }

    public function setInputType($inputType)
    {
        return $this->inputType = $inputType;
    }

    public function getInputType()
    {
        return $this->inputType;
    }

    public function setField($field)
    {
        $this->field = $field;

        return $this;
    }

    public function getField()
    {
        return $this->field;
    }

    public function setRole($role)
    {
        $this->role = $role;

        return $this;
    }

    public function getRole()
    {
        return $this->role;
    }

    /**
     * Filter
     */

    public function setFilterType($filterType)
    {
        $this->filterType = strtolower($filterType);

        return  $this;
    }

    public function getFilterType()
    {
        return $this->filterType;
    }

    public function getFilters($source)
    {
        $filters = array();

        if ($this->hasOperator($this->data['operator'])) {
            if ($this instanceof ArrayColumn && in_array($this->data['operator'], array(self::OPERATOR_EQ, self::OPERATOR_NEQ))) {
                $filters[] = new Filter($this->data['operator'], $this->data['from']);
            } else {
                switch ($this->data['operator']) {
                    case self::OPERATOR_BTW:
                        if ($this->data['from'] != static::DEFAULT_VALUE) {
                            $filters[] = new Filter(self::OPERATOR_GT, $this->data['from']);
                        }
                        if ($this->data['to'] != static::DEFAULT_VALUE) {
                                $filters[] = new Filter(self::OPERATOR_LT, $this->data['to']);
                        }
                        break;
                    case self::OPERATOR_BTWE:
                        if ($this->data['from'] != static::DEFAULT_VALUE) {
                            $filters[] = new Filter(self::OPERATOR_GTE, $this->data['from']);
                        }
                        if ($this->data['to'] != static::DEFAULT_VALUE) {
                            $filters[] = new Filter(self::OPERATOR_LTE, $this->data['to']);
                        }
                        break;
                    case self::OPERATOR_ISNULL:
                    case self::OPERATOR_ISNOTNULL:
                        $filters[] = new Filter($this->data['operator']);
                        break;
                    case self::OPERATOR_LIKE:
                    case self::OPERATOR_RLIKE:
                    case self::OPERATOR_LLIKE:
                        if ($this->getSelectMulti()) {
                            $this->setDataJunction(self::DATA_DISJUNCTION);
                        }
                    case self::OPERATOR_EQ:
                    case self::OPERATOR_NEQ:
                    case self::OPERATOR_NLIKE:
                        foreach ((array) $this->data['from'] as $value) {
                            $filters[] = new Filter($this->data['operator'], $value);
                        }
                        break;
                    default:
                        $filters[] = new Filter($this->data['operator'], $this->data['from']);
                }
            }
        }

        return $filters;
    }

    public function setDataJunction($dataJunction)
    {
        $this->dataJunction = $dataJunction;

        return $this;
    }

    /**
     * get data filter junction (how column filters are connected with column data)
     *
     * @return bool self::DATA_CONJUNCTION | self::DATA_DISJUNCTION
     */
    public function getDataJunction()
    {
        return $this->dataJunction;
    }

    public function setOperators(array $operators)
    {
        $this->operators = $operators;

        return $this;
    }

    /**
     * Return column filter operators
     *
     * @return array $operators
     */
    public function getOperators()
    {
        // Issue with Doctrine (See http://www.doctrine-project.org/jira/browse/DDC-1857 and http://www.doctrine-project.org/jira/browse/DDC-1858)
        if ($this->hasDQLFunction()) {
            return array_intersect($this->operators, array(self::OPERATOR_EQ,
                self::OPERATOR_NEQ,
                self::OPERATOR_LT,
                self::OPERATOR_LTE,
                self::OPERATOR_GT,
                self::OPERATOR_GTE,
                self::OPERATOR_BTW,
                self::OPERATOR_BTWE));
        }

        return $this->operators;
    }

    public function setDefaultOperator($defaultOperator)
    {
        if (!$this->hasOperator($defaultOperator)) {
            throw new \Exception($defaultOperator . ' operator not found in operators list.');
        }

        $this->defaultOperator = $defaultOperator;

        return $this;
    }

    public function getDefaultOperator()
    {
        return $this->defaultOperator;
    }

    /**
     * Return true if $operator is in $operators
     *
     * @param string $operator
     * @return boolean
     */
    public function hasOperator($operator)
    {
        return in_array($operator, $this->operators);
    }

    public function setOperatorsVisible($operatorsVisible)
    {
        $this->operatorsVisible = $operatorsVisible;

        return $this;
    }

    public function getOperatorsVisible()
    {
        return $this->operatorsVisible;
    }

    public function setValues(array $values)
    {
        $this->values = $values;

        return $this;
    }

    public function getValues()
    {
        return $this->values;
    }

    public function setSelectFrom($selectFrom)
    {
        $this->selectFrom = $selectFrom;

        return $this;
    }

    public function getSelectFrom()
    {
        return $this->selectFrom;
    }

    public function getSelectMulti()
    {
        return $this->selectMulti;
    }

    public function setSelectMulti($selectMulti)
    {
        $this->selectMulti = $selectMulti;
    }

    public function getSelectExpanded()
    {
        return $this->selectExpanded;
    }

    public function setSelectExpanded($selectExpanded)
    {
        $this->selectExpanded = $selectExpanded;
    }

    public function hasDQLFunction(&$matches = null)
    {
        $regex = '/(?P<all>(?P<field>\w+):(?P<function>\w+)(:)?(?P<parameters>\w*))$/';

        return ($matches === null) ? preg_match($regex, $this->field) : preg_match($regex, $this->field, $matches);
    }

    /**
     * Internal function
     *
     * @param $securityContext
     */
    public function setSecurityContext(SecurityContextInterface $securityContext)
    {
        $this->securityContext = $securityContext;

        return $this;
    }

    public function getParentType()
    {
        return '';
    }

    public function getType()
    {
        return '';
    }

    /**
     * By default all filers include a JavaScript onchange=submit block.  This
     * does not make sense in some cases, such as with multi-select filters.
     *
     * @todo Eventaully make this configurable via annotations?
     */
    public function isFilterSubmitOnChange()
    {
        return !$this->getSelectMulti();
    }

    public function setSearchOnClick($searchOnClick)
    {
        $this->searchOnClick = $searchOnClick;

        return $this;
    }

    public function getSearchOnClick()
    {
        return $this->searchOnClick;
    }

    /**
     * Allows to set twig escaping parameter (html, js, css, url, html_attr)
     * or to display raw value if type is false
     * @param type $safeOption can be one of raw, html, js, css, url, html_attr
     * @return \APY\DataGridBundle\Grid\Column\Column
     */
    public function setSafe($safeOption)
    {
        $this->safe = $safeOption;

        return $this;
    }

    public function getSafe()
    {
        return $this->safe;
    }
}


text:
using Lucene.Net.Fluent.Documents.Types;

namespace Lucene.Net.Fluent.Documents.FieldProperties
{
	public interface ICanBeCompressed<out TResult>
	{
		/// <summary>
		/// Compresses the entire value with the best compression level.
		/// </summary>
		TResult WithCompression();

		/// <summary>
		/// Compresses the entire value with the provided compression level.
		/// </summary>
		/// <param name="compressionLevel">The compression level</param>
		TResult WithCompression(CompressionLevel compressionLevel);
	}
}


text:
package nativekttypes;

import javaemul.internal.annotations.KtNative;

@KtNative(
    value = "nativekttypes.nativekt.KFunctionalInterfaceRequiringBridge",
    bridgeWith = "nativekttypes.nativekt.KFunctionalInterfaceBridge")
public interface NativeFunctionalInterfaceRequiringBridge<V> {
  V foo(V t);
}


text:
package org.aikodi.java.input.parser;

import static org.objectweb.asm.Opcodes.ACC_ABSTRACT;
import static org.objectweb.asm.Opcodes.ACC_FINAL;
import static org.objectweb.asm.Opcodes.ACC_INTERFACE;
import static org.objectweb.asm.Opcodes.ACC_PRIVATE;
import static org.objectweb.asm.Opcodes.ACC_PROTECTED;
import static org.objectweb.asm.Opcodes.ACC_PUBLIC;
import static org.objectweb.asm.Opcodes.ACC_STATIC;
import static org.objectweb.asm.Opcodes.ACC_STRICT;
import static org.objectweb.asm.Opcodes.ACC_SUPER;
import static org.objectweb.asm.Opcodes.ACC_SYNTHETIC;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

import org.aikodi.chameleon.core.declaration.Name;
import org.aikodi.chameleon.core.document.Document;
import org.aikodi.chameleon.core.element.Element;
import org.aikodi.chameleon.core.language.Language;
import org.aikodi.chameleon.core.lookup.LookupException;
import org.aikodi.chameleon.core.modifier.Modifier;
import org.aikodi.chameleon.core.namespace.LazyRootNamespace;
import org.aikodi.chameleon.core.namespace.RootNamespaceReference;
import org.aikodi.chameleon.core.namespacedeclaration.NamespaceDeclaration;
import org.aikodi.chameleon.exception.ChameleonProgrammerException;
import org.aikodi.chameleon.oo.method.Method;
import org.aikodi.chameleon.oo.method.MethodHeader;
import org.aikodi.chameleon.oo.method.NativeImplementation;
import org.aikodi.chameleon.oo.method.exception.ExceptionClause;
import org.aikodi.chameleon.oo.method.exception.TypeExceptionDeclaration;
import org.aikodi.chameleon.oo.plugin.ObjectOrientedFactory;
import org.aikodi.chameleon.oo.type.Type;
import org.aikodi.chameleon.oo.type.TypeReference;
import org.aikodi.chameleon.oo.type.generics.TypeArgumentWithTypeReference;
import org.aikodi.chameleon.oo.type.generics.ExtendsConstraint;
import org.aikodi.chameleon.oo.type.generics.FormalTypeParameter;
import org.aikodi.chameleon.oo.type.generics.TypeParameter;
import org.aikodi.chameleon.oo.type.inheritance.SubtypeRelation;
import org.aikodi.chameleon.oo.variable.FormalParameter;
import org.aikodi.chameleon.oo.variable.VariableDeclaration;
import org.aikodi.chameleon.plugin.output.Syntax;
import org.aikodi.chameleon.support.member.simplename.variable.MemberVariableDeclarator;
import org.aikodi.chameleon.support.modifier.Abstract;
import org.aikodi.chameleon.support.modifier.Enum;
import org.aikodi.chameleon.support.modifier.Final;
import org.aikodi.chameleon.support.modifier.Interface;
import org.aikodi.chameleon.support.modifier.Native;
import org.aikodi.chameleon.support.modifier.Private;
import org.aikodi.chameleon.support.modifier.Protected;
import org.aikodi.chameleon.support.modifier.Public;
import org.aikodi.chameleon.support.modifier.Static;
import org.aikodi.chameleon.util.Pair;
import org.aikodi.chameleon.util.Util;
import org.aikodi.chameleon.workspace.Project;
import org.aikodi.java.core.language.Java7;
import org.aikodi.java.core.language.Java7LanguageFactory;
import org.aikodi.java.core.modifier.StrictFP;
import org.aikodi.java.core.modifier.Synchronized;
import org.aikodi.java.core.modifier.Volatile;
import org.aikodi.java.core.namespacedeclaration.JavaNamespaceDeclaration;
import org.aikodi.java.core.type.ArrayTypeReference;
import org.aikodi.java.core.type.BasicJavaTypeReference;
import org.aikodi.java.core.type.JavaEqualityTypeArgument;
import org.aikodi.java.core.type.JavaExtendsWildcard;
import org.aikodi.java.core.type.JavaPureWildcard;
import org.aikodi.java.core.type.JavaSuperWildcard;
import org.aikodi.java.core.type.JavaTypeReference;
import org.aikodi.java.core.variable.JavaVariableDeclaration;
import org.aikodi.java.core.variable.MultiFormalParameter;
import org.aikodi.java.workspace.JavaView;
import org.aikodi.rejuse.association.SingleAssociation;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.signature.SignatureReader;
import org.objectweb.asm.signature.SignatureVisitor;

public class ASMClassParser {

  private static final int OPCODES = Opcodes.ASM5;

	public ASMClassParser(ZipFile file, ZipEntry entry, String className, String packageFQN) {
    if(className == null) {
      throw new ChameleonProgrammerException("The class name cannot be null.");
    }
    if(className.equals("")) {
      throw new ChameleonProgrammerException("The class name cannot be the empty string.");
    }
    _jarFile = file;
    _entry = entry;
    _name = className;
    _packageFQN = packageFQN;
  }

  private String _packageFQN;

  public String packageFQN() {
    return _packageFQN;
  }

  private String _name;

  public String name() {
    return _name;
  }

  public void add(ASMClassParser child, String qn) {
    if(_children == null) {
      _children = new HashMap<String,ASMClassParser>();
    }
    String next = Util.getAllButFirstPart(qn);
    if(next == null) {
      _children.put(qn,child);
    } else {
      ASMClassParser c = _children.get(Util.getFirstPart(qn));
      if(c != null) {
        c.add(child, next);
      }
    }
  }

  /**
   * A map that keeps track of the names of the inner classes, and the
   * files that they read.
   */
  private Map<String,ASMClassParser> _children;

  private ZipFile _jarFile;

  private ZipEntry _entry;

  public Document load(Java7 language) throws FileNotFoundException, IOException, LookupException {
    Type t = read(language);
    Document doc = new Document();

    NamespaceDeclaration decl;
    if(packageFQN() != null) {
      decl = new JavaNamespaceDeclaration(packageFQN());
    } else {
      decl = new JavaNamespaceDeclaration(new RootNamespaceReference());
    }
    doc.add(decl);
    decl.add(t);
    return doc;
  }

  protected Type read(Java7 language) throws FileNotFoundException, IOException {

    InputStream inputStream = new BufferedInputStream(_jarFile.getInputStream(_entry));
    ClassReader reader = new ClassReader(inputStream);
    ClassExtractor extractor = new ClassExtractor(language);
    reader.accept(extractor, OPCODES);
    inputStream.close();
    Type result = extractor.type();
    if(_children != null) {
      for(ASMClassParser child: _children.values()) {
        result.add(child.read(language));
      }
    }
    return result;
  }

  protected JavaTypeReference toRef(String tref, Java7 language) {
    return language.createTypeReference(toDots(tref));
  }

  public static String toDots(String name) {
    String withoutSlashes = name.replace('/', '.');
    if(withoutSlashes.endsWith("$")) {
    	return withoutSlashes.substring(0, withoutSlashes.length()-1).replace('$', '.')+"$";
    } else {
    	return withoutSlashes.replace('$', '.');
    }
  }

  protected ObjectOrientedFactory factory(Language language) {
    return language.plugin(ObjectOrientedFactory.class);
  }

  protected class ClassExtractor extends ClassVisitor {

    private Java7 _language;

    private Type _type;

    public Type type() {
      return _type;
    }

    public ClassExtractor(Java7 language) {
      super(OPCODES);
      _language = language;
      initMethodAccessMap();
      initClassAccessMap();
      initFieldAccessMap();
    }

    /**
     * Visit a class
     */
    @Override
    public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
      if(! isSynthetic(access)) {
        String n = Util.getLastPart(toDots(name));
        Type type = factory(_language).createRegularType(n);
        // OK, so ASM only creates a signature when there are generic parameters.
        // otherwise you only get superName and interfaces (you'll get them as well with generics though).
        // What a bad design. You're forcing me to write crap code.
        if(signature != null) {
          new SignatureReader(signature).accept(new ClassSignatureExtractor(type,language()));
        } else {
          // Object has null as its super name
          if(superName != null) {
            TypeReference zuppaKlass = toRef(superName,_language);
            type.addInheritanceRelation(new SubtypeRelation(zuppaKlass));
          }
          if(interfaces != null) {
            for(String iface: interfaces) {
              type.addInheritanceRelation(new SubtypeRelation(toRef(iface,_language)));
            }
          }
        }
        type.addModifiers(accessToClassModifier(access));
        _type = type;
      }
    }

    @Override
    public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
      if(! isSynthetic(access)) {
        MemberVariableDeclarator decl = new MemberVariableDeclarator();
        decl.addModifiers(accessToFieldModifier(access));
        VariableDeclaration declaration = new JavaVariableDeclaration(name);
        decl.add(declaration);
        if(signature != null) {
          new SignatureReader(signature).accept(new FieldSignatureExtractor(decl,language()));
        } else {
          new SignatureReader(desc).accept(new FieldSignatureExtractor(decl,language()));
        }
        _type.add(decl);
      }
      return null;
    }

    @Override
    public void visitInnerClass(String name, String outerName, String innerName, int access) {
      if(! isSynthetic(access)) {

      }
    }

    public Java7 language() {
      return _language;
    }

    @Override
    public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
      if(! isSynthetic(access)) {
        Method m = factory(_language).createNormalMethod(name,null);
        boolean constructor = false;
        if(name.equals("<init>")) {
          name = _type.name();
          m.setName(name);
          factory(_language).transformToConstructor(m);
          m.setReturnTypeReference(_language.createTypeReference(name));
          constructor = true;
        }
        _type.add(m);
        List<Modifier> mods = accessToMethodModifier(access);
        m.addModifiers(mods);
        m.setImplementation(new NativeImplementation());
        MethodExtractor extractor;
        if(constructor) {
          extractor = new ConstructorExtractor(m,language());
        } else {
          extractor = new MethodExtractor(m,language());
        }
        if(signature != null) {
          new SignatureReader(signature).accept(extractor);
        } else {
          new SignatureReader(desc).accept(extractor);
        }
        if(isVarargs(access)) {
          FormalParameter param = m.lastFormalParameter();
          MultiFormalParameter multi = MultiFormalParameter.createUnsafe(param.name(), (JavaTypeReference)param.getTypeReference());
          SingleAssociation<Element, Element> parentLink = param.parentLink();
          parentLink.getOtherRelation().replace(parentLink, multi.parentLink());
        }

        ExceptionClause clause = new ExceptionClause();
        m.setExceptionClause(clause);
        if(exceptions != null) {
          for(String ex:exceptions) {
            clause.add(new TypeExceptionDeclaration(toRef(ex,_language)));
          }
        }
      }
      return null;
    }

    protected boolean isSynthetic(int access) {
      return (access & ACC_SYNTHETIC) != 0;
    }

    protected List<Modifier> accessToFieldModifier(int access) {
      List<Modifier> result = new ArrayList<Modifier>();
      for(Integer i: _fieldAccessList) {
        if((access & i) != 0) {
          result.add(Util.clone(_fieldAccessMap.get(i)));
        }
      }
      return result;
    }

    private void initFieldAccessMap() {
      _fieldAccessMap = new HashMap<Integer, Modifier>();
      _fieldAccessMap.put(ACC_PUBLIC, new Public());
      _fieldAccessMap.put(ACC_PRIVATE, new Private());
      _fieldAccessMap.put(ACC_PROTECTED, new Protected());
      _fieldAccessMap.put(ACC_STATIC, new Static());
      _fieldAccessMap.put(ACC_FINAL, new Final());
      _fieldAccessMap.put(Opcodes.ACC_VOLATILE, new Volatile());
      _classAccessMap.put(Opcodes.ACC_ENUM, new Enum());
      _fieldAccessList = new ArrayList<Integer>(_fieldAccessMap.keySet());
    }

    private Map<Integer, Modifier> _fieldAccessMap;

    private List<Integer> _fieldAccessList;

    protected List<Modifier> accessToMethodModifier(int access) {
      List<Modifier> result = new ArrayList<Modifier>();
      for(Integer i: _methodAccessList) {
        if((access & i) != 0) {
          result.add(Util.clone(_methodAccessMap.get(i)));
        }
      }
      return result;
    }

    protected boolean isVarargs(int access) {
      return ((access & Opcodes.ACC_VARARGS) != 0);
    }

    private void initMethodAccessMap() {
      _methodAccessMap = new HashMap<Integer, Modifier>();
      _methodAccessMap.put(ACC_PUBLIC, new Public());
      _methodAccessMap.put(ACC_PRIVATE, new Private());
      _methodAccessMap.put(ACC_PROTECTED, new Protected());
      _methodAccessMap.put(ACC_STATIC, new Static());
      _methodAccessMap.put(Opcodes.ACC_SYNCHRONIZED, new Synchronized());
      _methodAccessMap.put(ACC_FINAL, new Final());
      _methodAccessMap.put(Opcodes.ACC_NATIVE, new Native());
      _methodAccessMap.put(ACC_STRICT, new StrictFP());
      _methodAccessMap.put(ACC_INTERFACE, new Interface());
      _methodAccessMap.put(ACC_ABSTRACT, new Abstract());
      _methodAccessList = new ArrayList<Integer>(_methodAccessMap.keySet());
    }

    private Map<Integer, Modifier> _methodAccessMap;

    private List<Integer> _methodAccessList;

    protected List<Modifier> accessToClassModifier(int access) {
      List<Modifier> result = new ArrayList<Modifier>();
      for(Integer i: _classAccessList) {
        if((access & i) != 0) {
          Modifier modifier = _classAccessMap.get(i);
          if(modifier != null) {
            result.add(Util.clone(modifier));
          }
        }
      }
      return result;
    }

    private void initClassAccessMap() {
      _classAccessMap = new HashMap<Integer, Modifier>();
      _classAccessMap.put(ACC_PUBLIC, new Public());
      _classAccessMap.put(ACC_PRIVATE, new Private());
      _classAccessMap.put(ACC_PROTECTED, new Protected());
      _classAccessMap.put(ACC_FINAL, new Final());
      _classAccessMap.put(ACC_STATIC, new Static()); // not according to Opcodes, but I think that is wrong
      _classAccessMap.put(ACC_STRICT, new StrictFP()); // not according to Opcodes, but I think that is wrong
      _classAccessMap.put(ACC_SUPER, null); // What is this?
      _classAccessMap.put(ACC_INTERFACE, new Interface());
      _classAccessMap.put(ACC_ABSTRACT, new Abstract());
      _classAccessMap.put(Opcodes.ACC_ENUM, new Enum());
      _classAccessList = new ArrayList<Integer>(_classAccessMap.keySet());
    }

    private Map<Integer, Modifier> _classAccessMap;

    private List<Integer> _classAccessList;
  }

  protected class FieldSignatureExtractor extends TypeReferenceExtractor {

    public FieldSignatureExtractor(MemberVariableDeclarator var, Java7 language) {
      super(language);
      _var = var;
    }

    private MemberVariableDeclarator _var;

    @Override
    protected void connect(TypeReference tref) {
      _var.setTypeReference(tref);
    }
  }

  protected class MethodExtractor extends SignatureVisitor {

    public MethodExtractor(Method method, Java7 language) {
      super(OPCODES);
      _method = method;
      _language = language;
    }

    public Java7 language() {
      return _language;
    }

    protected Java7 _language;

    private Method _method;

    private int _nbArgs = 0;

    private FormalTypeParameter _currentTypeParameter;

    @Override
    public void visitFormalTypeParameter(String name) {
      _currentTypeParameter = new FormalTypeParameter(name);
      _method.header().addTypeParameter(_currentTypeParameter);
    }

    @Override
    public SignatureVisitor visitClassBound() {
      return new TypeParameterBoundExtractor(_currentTypeParameter,language());
    }

    @Override
    public SignatureVisitor visitInterfaceBound() {
      return new TypeParameterBoundExtractor(_currentTypeParameter,language());
    }

    @Override
    public SignatureVisitor visitParameterType() {
      return new TypeReferenceExtractor(language()) {
        @Override
        protected void connect(TypeReference tref) {
          String name = "arg" + _nbArgs++;
          _method.header().addFormalParameter(new FormalParameter(name, tref));
        }

      };
    }

    @Override
    public SignatureVisitor visitReturnType() {
      return new TypeReferenceExtractor(_language) {
        @Override
        protected void connect(TypeReference tref) {
          _method.setReturnTypeReference(tref);
        }
      };
    }

  }

  private class ConstructorExtractor extends MethodExtractor {

    public ConstructorExtractor(Method method, Java7 language) {
      super(method,language);
    }

    @Override
    public SignatureVisitor visitReturnType() {
      // for a constructor, the return type of the method is already set.
      return new TypeReferenceExtractor(_language);
    }
  }

  private class TypeParameterBoundExtractor extends TypeReferenceExtractor {

    private FormalTypeParameter _param;

    public TypeParameterBoundExtractor(FormalTypeParameter param, Java7 language) {
      super(language);
      _param = param;
    }

    @Override
    protected void connect(TypeReference tref) {
      if(_param != null) {
        _param.addConstraint(new ExtendsConstraint(tref));
      }
    }

  }

  protected class ClassSignatureExtractor extends SignatureVisitor {

    private Java7 _language;

    public Java7 language() {
      return _language;
    }

    private class InheritanceExtractor extends TypeReferenceExtractor {
      private InheritanceExtractor(Java7 language) {
        super(language);
      }

      @Override
      protected void connect(TypeReference tref) {
        _type.addInheritanceRelation(new SubtypeRelation(tref));
      }

    }

    public ClassSignatureExtractor(Type type, Java7 language) {
      super(OPCODES);
      _type = type;
      _language = language;
    }

    private Type _type;

    @Override
    public SignatureVisitor visitSuperclass() {
      return new InheritanceExtractor(language());
    }

    @Override
    public SignatureVisitor visitInterface() {
      return new InheritanceExtractor(language());
    }

    @Override
    public void visitFormalTypeParameter(String name) {
      _param = new FormalTypeParameter(name);
      _type.addParameter(TypeParameter.class, _param);
    }

    private FormalTypeParameter _param;

    @Override
    public SignatureVisitor visitClassBound() {
      return new TypeParameterBoundExtractor(_param,language());
    }

    @Override
    public SignatureVisitor visitInterfaceBound() {
      return new TypeParameterBoundExtractor(_param,language());
    }
  }

  protected class TypeReferenceExtractor extends SignatureVisitor {

    public TypeReferenceExtractor(Java7 language) {
      super(OPCODES);
      _language = language;
      initPrimitiveMap();
    }

    private Java7 _language;

    public Java7 language() {
      return _language;
    }

    /**
     * For some reason, inner classes are presented via a different method.
     * For now, we simply discard the existing type reference since
     * for the following code:
     * <code>
     * class A extends B {
     *   class C extends X<C>
     * }
     * </code>
     *
     * the super class of C is presented as B.X<C>.
     * {@inheritDoc}
     */
    @Override
    public void visitInnerClassType(String name) {
    	TypeReference old = _tref;
      _tref = toRef(name,_language);
      ((BasicJavaTypeReference)_tref).setTarget(old.clone(old));
      old.replaceWith(_tref);
    }

    private void initPrimitiveMap() {
      _primitiveMap = new HashMap<Character, String>();
      _primitiveMap.put('C', "char");
      _primitiveMap.put('V', "void");
      _primitiveMap.put('Z', "boolean");
      _primitiveMap.put('B', "byte");
      _primitiveMap.put('S', "short");
      _primitiveMap.put('I', "int");
      _primitiveMap.put('F', "float");
      _primitiveMap.put('J', "long");
      _primitiveMap.put('D', "double");
    }

    private String getPrimitiveTypeName(char c) {
      return _primitiveMap.get(c);
    }

    private JavaTypeReference _tref;

    public JavaTypeReference typeReference() {
      return _tref;
    }

    private Map<Character, String> _primitiveMap;

    @Override
    public void visitBaseType(char t) {
      _tref = _language.createTypeReference(getPrimitiveTypeName(t));
      connect(_tref);
    }

    @Override
    public void visitTypeVariable(String name) {
      _tref = _language.createTypeReference(name);
      connect(_tref);
    }

    @Override
    public void visitClassType(String fqn) {
      _tref = toRef(fqn,_language);
      connect(_tref);
    }

    protected void connect(TypeReference tref) {
      // do nothing by default;
    }

    @Override
    public SignatureVisitor visitArrayType() {
      return new TypeReferenceExtractor(language()) {
        @Override
        protected void connect(TypeReference tref) {
          _tref = new ArrayTypeReference((JavaTypeReference) tref);
          TypeReferenceExtractor.this.connect(_tref);
        }

      };
    }

    @Override
    public void visitTypeArgument() {
      ((BasicJavaTypeReference)typeReference()).addArgument(new JavaPureWildcard());
    }

    @Override
    public SignatureVisitor visitTypeArgument(char kind) {
      // create visitor with 'this' as its parent.
      final TypeArgumentWithTypeReference arg;
      if(kind == SignatureVisitor.INSTANCEOF) {
        arg = _language.createEqualityTypeArgument(null);
      } else if(kind == SignatureVisitor.EXTENDS) {
        arg = _language.createExtendsWildcard(null);
      } else if(kind == SignatureVisitor.SUPER) {
        arg = _language.createSuperWildcard(null);
      } else {
        throw new ChameleonProgrammerException();
      }
      ((BasicJavaTypeReference)typeReference()).addArgument(arg);
      return new TypeReferenceExtractor(language()) {
        /**
         * If there is no bound, we replace the type argument with a pure wildcard.
         * I GUESS that ? is modeled as an EXTENDS bound without a type reference.
         */
        //FIXME Or is this method no invoked for ??
        @Override
        public void visitEnd() {
          if(this.typeReference() == null) {
            SingleAssociation parentLink = arg.parentLink();
            parentLink.getOtherRelation().replace(parentLink, new JavaPureWildcard().parentLink());
          }
        }
        protected void connect(TypeReference tref) {
          arg.setTypeReference(tref);
        }
      };
    }

  }

  public static void main(String[] args) throws IOException, Exception {
    String jarPath = args[0];
    JarFile jar = new JarFile(jarPath);
    Java7 lang = new Java7LanguageFactory().create();
    Project project = new Project("test", new File("."), new JavaView(new LazyRootNamespace(), lang));

    Enumeration<JarEntry> entries = jar.entries();
    List<Pair<Pair<String,String>, JarEntry>> names = new ArrayList<Pair<Pair<String,String>, JarEntry>>();
    while(entries.hasMoreElements()) {
      JarEntry entry = entries.nextElement();
      String name = entry.getName();
      if(name.endsWith(".class")) {
        String tmp = Util.getAllButLastPart(name).replace('/', '.').replace('$', '.');
        if(! tmp.matches(".*\\.[0-9].*")) {
          names.add(new Pair<Pair<String,String>, JarEntry>(new Pair<String,String>(tmp,Util.getLastPart(Util.getAllButLastPart(name).replace('/', '.')).replace('$', '.')), entry));
        }
      }
    }
    Collections.sort(names, new Comparator<Pair<Pair<String,String>,JarEntry>>(){
      @Override
      public int compare(Pair<Pair<String,String>, JarEntry> o1, Pair<Pair<String,String>, JarEntry> o2) {
        int first = o1.first().first().length();
        int second = o2.first().first().length();
        return first - second;
      }
    });
    List<ASMClassParser> parsers = new ArrayList<ASMClassParser>();
    Map<String, ASMClassParser> map = new HashMap<String, ASMClassParser>();
    for(Pair<Pair<String,String>,JarEntry> pair: names) {
      JarEntry entry = pair.second();
      String qn = pair.first().second();
      String name = Util.getLastPart(qn);
      String packageFQN = packageFQN(entry.getName());
      ASMClassParser parser = new ASMClassParser(jar,entry, name, packageFQN);
      String second = Util.getAllButFirstPart(qn);
      String key = (packageFQN == null ? name : packageFQN+"."+Util.getFirstPart(qn));
      if(second != null) {
        ASMClassParser asmClassParser = map.get(key);
        // Deal with bad jars that contain class files of inner classes but not the outer class
        // e.g. the OS X rt.jar.
        if(asmClassParser != null) {
          asmClassParser.add(parser, second);
        }
      } else {
        map.put(key, parser);
        parsers.add(parser);
      }
    }

    Syntax syntax = lang.plugin(Syntax.class);
    //  	for(ASMClassParser parser: parsers) {
    //  		Type t = parser.load();
    //  		System.out.println("<<<<<<<<<<<<<<<");
    //  		System.out.println(syntax.toCode(t));
    //  		System.out.println(">>>>>>>>>>>>>>>");
    //  	}
    System.out.println(syntax.toCode(map.get("java.util.Set").load(lang)));
    System.out.println(syntax.toCode(map.get("java.util.Collection").load(lang)));
    jar.close();
  }

  private static String packageFQN(String entryName) {
    return Util.getAllButLastPart(Util.getAllButLastPart(entryName).replace('/', '.'));
  }

	public String resourceName() {
		return _jarFile.getName() + " : " +_entry.getName();
	}
}


text:
using PipServices.Commons.Config;
using PipServices.Commons.Connect;

using System.Threading.Tasks;

using Xunit;

namespace PipServices.Azure.Messaging
{
    /*
    public class ServiceBusMessageQueueTest
    {
        ServiceBusMessageQueue Queue { get; set; }
        MessageQueueFixture Fixture { get; set; }

        public ServiceBusMessageQueueTest()
        {
            var config = YamlConfigReader.ReadConfig(null, "..\\..\\..\\..\\config\\test_connections.yaml", null);
            var connection = ConnectionParams.FromString(config.GetAsString("sb_queue"));
            Queue = new ServiceBusMessageQueue("TestQueue", connection);
            Queue.OpenAsync(null).Wait();
            Fixture = new MessageQueueFixture(Queue);
        }

        [Fact]
        public async Task TestSBQueueSendReceiveMessageAsync()
        {
            await Queue.ClearAsync(null);
            await Fixture.TestSendReceiveMessageAsync();
        }

        [Fact]
        public async Task TestSBQueueReceiveSendMessageAsync()
        {
            await Queue.ClearAsync(null);
            await Fixture.TestReceiveSendMessageAsync();
        }

        [Fact]
        public async Task TestSBQueueReceiveAndCompleteAsync()
        {
            await Queue.ClearAsync(null);
            await Fixture.TestReceiveAndCompleteMessageAsync();
        }

        [Fact]
        public async Task TestSBQueueReceiveAndAbandonAsync()
        {
            await Queue.ClearAsync(null);
            await Fixture.TestReceiveAndAbandonMessageAsync();
        }

        [Fact]
        public async Task TestSBQueueSendPeekMessageAsync()
        {
            await Queue.ClearAsync(null);
            await Fixture.TestSendPeekMessageAsync();
        }

        [Fact]
        public async Task TestSBQueuePeekNoMessageAsync()
        {
            await Queue.ClearAsync(null);
            //await Fixture.TestPeekNoMessageAsync();
        }

        [Fact]
        public async Task TestSBQueueOnMessageAsync()
        {
            await Queue.ClearAsync(null);
            await Fixture.TestOnMessageAsync();
        }

        [Fact]
        // For some reasons it randomly fails
        public async Task TestSBQueueMoveToDeadMessageAsync()
        {
            await Queue.ClearAsync(null);
            await Fixture.TestMoveToDeadMessageAsync();
        }

        [Fact]
        public async Task TestSBQueueMessageCountAsync()
        {
            await Fixture.TestMessageCountAsync();
        }
    }
    */
}


text:
import chai, { expect } from 'chai';
import { Howl } from 'howler';
import sinon from 'sinon';
import sinonChai from 'sinon-chai';
import importFresh from 'import-fresh';

import soundMiddleware from '../src/index';

const howlerIntegration = require('../src/howler_integration');
const { isObjectWithValues } = require('../src/utils');

const howlerIntegration2 = importFresh('../src/howler_integration');
const soundMiddleware2 = importFresh('../src/index');

chai.use(sinonChai);
const warnStub = sinon.stub(console, 'warn');
const logStub = sinon.stub(console, 'log');

const soundsData = {
  endTurn: 'path/to/sound.mp3',
  winGame: {
    src: ['path/to/other_sound.mp3'],
    volume: 0.75
  },
  allSounds: {
    src: ['sound1.mp3'],
    sprite: {
      boom: [0, 1000],
      bang: [1500, 2000],
      crash: [2000, 2345]
    }
  }
};

// TODO: TEST ADDING SOUNDS TO EMPTY INTEGRATION

const addedSoundsData = {
  heavyCoin: 'https://s3.amazonaws.com/bucketName/gold_coin.mp3',
  lightCoin: {
    src: 'https://s3.amazonaws.com/bucketName/gold_coin.mp3', // just lower volume
    volume: 0.75
  },
  randomCoins: {
    src: ['https://s3.amazonaws.com/bucketName/coin_collection.mp3'],
    sprite: {
      one: [0, 1000],
      two: [1000, 2500],
      three: [3500, 10000]
    }
  }
};

const moreAddedSoundsData = {
  heavierCoin: 'https://s3.amazonaws.com/bucketName/uranium_coin.mp3',
  lighterCoin: {
    src: 'https://s3.amazonaws.com/bucketName/magnesium_coin.mp3',
    volume: 0.75
  },
  radCoins: {
    src: ['https://s3.amazonaws.com/bucketName/rad_coin_collection.mp3'],
    sprite: {
      one: [0, 1000],
      two: [1000, 2500],
      three: [3500, 10000]
    }
  }
};

describe('utils', () => {
  const truthy = [{ hello: 'world' }];
  const falsy = [
    undefined,
    null,
    false,
    true,
    '',
    'test',
    234,
    new Date(),
    {},
    Object.create(null)
  ];

  describe('#isObjectWithValues', () => {
    it('returns falsy for an empty Object or non-object', () => {
      falsy.forEach((obj) => {
        expect(!!isObjectWithValues(obj)).to.equal(false);
      });
    });
    it('returns truthy for an empty Object', () => {
      truthy.forEach((obj) => {
        expect(!!isObjectWithValues(obj)).to.equal(true);
      });
    });
  });
});

describe('howlerIntegration', () => {
  const sounds = howlerIntegration.initialize(soundsData);
  const { playing } = howlerIntegration;
  const playingNames = Object.keys(playing);
  const playingValues = playingNames.map((name) => playing[name]);
  const soundNames = Object.keys(sounds);
  const soundValues = soundNames.map((name) => sounds[name]);

  let actual;
  let expected;

  describe('#initialize', () => {
    it('contains keys for each sound name', () => {
      expected = ['endTurn', 'winGame', 'allSounds'];
      actual = soundNames;

      expect(expected).to.deep.equal(actual);
    });

    it('contains a hashmap with all possible playing names', () => {
      expected = [
        'endTurn',
        'winGame',
        'allSoundsboom',
        'allSoundsbang',
        'allSoundscrash'
      ];
      actual = playingNames;

      expect(expected).to.deep.equal(actual);
    });

    it('contains Howler instances for each sound value', () => {
      soundValues.forEach((sound) => {
        expect(sound).to.be.an.instanceof(Howl);
      });
    });

    it('contains Set instances for each possible playing name', () => {
      playingValues.forEach((ids) => {
        expect(ids).to.be.an.instanceof(Set);
      });
    });

    it('set up the URL for endTurn (string-based)', () => {
      expected = ['path/to/sound.mp3'];
      actual = sounds.endTurn._src;

      expect(expected).to.deep.equal(actual);
    });

    it('set up the URL for winGame (property-based)', () => {
      expected = ['path/to/other_sound.mp3'];
      actual = sounds.winGame._src;

      expect(expected).to.deep.equal(actual);
    });

    it('set up the volume for winGame (property-based)', () => {
      expected = 0.75;
      actual = sounds.winGame._volume;

      expect(expected).to.deep.equal(actual);
    });

    it('set up the sprites for allSounds', () => {
      expected = { boom: [0, 1000], bang: [1500, 2000], crash: [2000, 2345] };
      actual = sounds.allSounds._sprite;

      expect(expected).to.deep.equal(actual);
    });

    it('offers a "play" method for triggering sounds', () => {
      soundValues.forEach((sound) => {
        expect(sound.play).to.be.a('function');
      });
    });

    it('offers a "fade" method for setting a sound or sprite\'s volume', () => {
      soundValues.forEach((sound) => {
        expect(sound.fade).to.be.a('function');
      });
    });

    it('has a method for deleting a sound id', () => {
      const id = howlerIntegration.play('allSounds', 'boom');
      expect(playingValues[2].has(id)).to.equal(true);
      howlerIntegration.removeId(id);
      expect(playingValues[2].has(id)).to.equal(false);
    });
  });
});

describe('soundMiddleware', () => {
  const next = sinon.spy();

  let storeHandler;
  let nextHandler;
  let actionHandler;

  afterEach(() => {
    // reset our spies and stubs
    warnStub.resetHistory();
    next.resetHistory();
  });

  describe('initialization', () => {
    it('can be initialized without sounds', () => {
      expect(soundMiddleware).not.to.throw();
    });
  });

  describe('curried application', () => {
    it('loads the middleware with sounds data, returns a function', () => {
      storeHandler = soundMiddleware(soundsData);
      expect(storeHandler).to.be.a('function');
    });

    it('loads the store, and returns a function', () => {
      // We don't use the store in my middleware at all.
      // Pass in an empty object, just to match the real-world input type.
      nextHandler = storeHandler({});
      expect(nextHandler).to.be.a('function');
    });

    it('loads next, and returns a function', () => {
      actionHandler = nextHandler(next);
      expect(actionHandler).to.be.a('function');
    });
  });

  describe('dispatching actions', () => {
    it('console.warns when the sound is not found when trying to play', () => {
      const action = {
        name: 'LOSE_GAME',
        meta: { sound: { play: 'loseGame' } }
      };
      actionHandler(action);

      expect(warnStub).to.have.been.calledOnce;
      expect(next).to.have.been.calledOnce;
    });

    it('console.warns when the sound is not found when trying to stop', () => {
      const action = {
        name: 'LOSE_GAME',
        meta: { sound: { stop: 'loseGame' } }
      };
      actionHandler(action);

      expect(warnStub).to.have.been.calledOnce;
      expect(next).to.have.been.calledOnce;
    });

    it('console.warns when the sound is found, but not the sprite', () => {
      const action = {
        name: 'CLANG',
        meta: { sound: { play: 'allSounds.clang' } }
      };
      actionHandler(action);

      expect(warnStub).to.have.been.calledOnce;
      expect(next).to.have.been.calledOnce;
    });

    it('forwards actions with no meta.sound', () => {
      const action = { name: 'UNRELATED_ACTION' };
      actionHandler(action);

      expect(warnStub).to.not.have.been.called;
      expect(next).to.have.been.calledOnce;
    });

    it('forwards actions with meta.sound', () => {
      const action = { name: 'WIN_GAME', meta: { sound: { play: 'winGame' } } };
      actionHandler(action);

      expect(warnStub).to.not.have.been.called;
      expect(next).to.have.been.calledOnce;
    });
  });

  describe('howlerIntegration handoff', () => {
    let playSpy;
    let addSpy;
    let endTurnSpy;
    let winGameSpy;
    let allSoundsSpy;
    let proxySpy;
    let endTurnStopSpy;
    let winGameStopSpy;
    let allSoundsStopSpy;
    let endTurnFadeSpy;
    let winGameFadeSpy;
    let allSoundsFadeSpy;

    before(() => {
      playSpy = sinon.spy(howlerIntegration, 'play');
      addSpy = sinon.spy(howlerIntegration, 'add');
      endTurnSpy = sinon.spy(howlerIntegration.sounds.endTurn, 'play');
      winGameSpy = sinon.spy(howlerIntegration.sounds.winGame, 'play');
      allSoundsSpy = sinon.spy(howlerIntegration.sounds.allSounds, 'play');
      proxySpy = sinon.spy(howlerIntegration, 'proxy');
      endTurnStopSpy = sinon.spy(howlerIntegration.sounds.endTurn, 'stop');
      winGameStopSpy = sinon.spy(howlerIntegration.sounds.winGame, 'stop');
      allSoundsStopSpy = sinon.spy(howlerIntegration.sounds.allSounds, 'stop');
      endTurnFadeSpy = sinon.spy(howlerIntegration.sounds.endTurn, 'fade');
      winGameFadeSpy = sinon.spy(howlerIntegration.sounds.winGame, 'fade');
      allSoundsFadeSpy = sinon.spy(howlerIntegration.sounds.allSounds, 'fade');
    });
    afterEach(() => {
      playSpy.resetHistory();
      addSpy.resetHistory();
      endTurnSpy.resetHistory();
      winGameSpy.resetHistory();
      allSoundsSpy.resetHistory();
      proxySpy.resetHistory();
      endTurnStopSpy.resetHistory();
      winGameStopSpy.resetHistory();
      allSoundsStopSpy.resetHistory();
      endTurnFadeSpy.resetHistory();
      winGameFadeSpy.resetHistory();
      allSoundsFadeSpy.resetHistory();
    });
    after(() => {
      playSpy.restore();
      addSpy.restore();
      endTurnSpy.restore();
      winGameSpy.restore();
      allSoundsSpy.restore();
      proxySpy.restore();
      endTurnStopSpy.restore();
      winGameStopSpy.restore();
      allSoundsStopSpy.restore();
      endTurnFadeSpy.restore();
      winGameFadeSpy.restore();
      allSoundsFadeSpy.restore();
    });

    describe('adds sounds', () => {
      it('calls to add the sounds to the Howler integration', () => {
        const action = {
          type: 'ADD_COIN_SOUNDS',
          meta: {
            sound: {
              add: addedSoundsData
            }
          }
        };
        actionHandler(action);

        expect(addSpy).to.have.been.calledOnce;
      });

      it('contains a hashmap which includes the additional playing names', () => {
        const action = {
          type: 'ADD_COIN_SOUNDS',
          meta: {
            sound: {
              add: addedSoundsData
            }
          }
        };
        actionHandler(action);

        const playingNames = Object.keys(howlerIntegration.playing);
        const expected = [
          'endTurn',
          'winGame',
          'allSoundsboom',
          'allSoundsbang',
          'allSoundscrash',
          'heavyCoin',
          'lightCoin',
          'randomCoinsone',
          'randomCoinstwo',
          'randomCoinsthree'
        ];
        expect(addSpy).to.have.been.calledOnce;
        expect(expected).to.deep.equal(playingNames);
      });

      it('can add sounds dynamically multiple times', () => {
        const action = {
          type: 'ADD_COIN_SOUNDS',
          meta: {
            sound: {
              add: addedSoundsData
            }
          }
        };
        const action2 = {
          type: 'ADD_COIN_SOUNDS_1',
          meta: {
            sound: {
              add: moreAddedSoundsData
            }
          }
        };
        actionHandler(action);
        actionHandler(action2);

        const playingNames = Object.keys(howlerIntegration.playing);
        const soundNames = Object.keys(howlerIntegration.sounds);
        const expectedPlaying = [
          'endTurn',
          'winGame',
          'allSoundsboom',
          'allSoundsbang',
          'allSoundscrash',
          'heavyCoin',
          'lightCoin',
          'randomCoinsone',
          'randomCoinstwo',
          'randomCoinsthree',
          'heavierCoin',
          'lighterCoin',
          'radCoinsone',
          'radCoinstwo',
          'radCoinsthree'
        ];
        const expectedSounds = [
          'endTurn',
          'winGame',
          'allSounds',
          'heavyCoin',
          'lightCoin',
          'randomCoins',
          'heavierCoin',
          'lighterCoin',
          'radCoins'
        ];
        expect(addSpy).to.have.been.calledTwice;
        expect(expectedPlaying).to.deep.equal(playingNames);
        expect(expectedSounds).to.deep.equal(soundNames);
      });
    });

    it('invokes .play with endTurn', () => {
      const action = { name: 'END_TURN', meta: { sound: { play: 'endTurn' } } };
      actionHandler(action);

      expect(playSpy).to.have.been.calledOnce;
      expect(playSpy).to.have.been.calledWithExactly('endTurn', undefined);
      expect(endTurnSpy).to.have.been.calledOnce;
      expect(endTurnSpy).to.have.been.calledWithExactly(undefined);
    });

    it('invokes .stop with endTurn', () => {
      const action = { name: 'END_TURN', meta: { sound: { stop: 'endTurn' } } };
      actionHandler(action);

      expect(proxySpy).to.have.been.calledOnce;
      expect(proxySpy).to.have.been.calledWithExactly(
        'endTurn',
        undefined,
        'stop'
      );
      expect(endTurnStopSpy).to.have.callCount(
        howlerIntegration.playing.endTurn.size
      );
      expect(endTurnStopSpy).to.have.been.calledWithExactly(
        howlerIntegration.playing.endTurn.values().next().value
      );
    });

    it('invokes .fade with endTurn', () => {
      const action = {
        name: 'END_TURN',
        meta: { sound: { fade: ['endTurn', 0, 1, 2] } }
      };
      actionHandler(action);

      expect(proxySpy).to.have.been.calledOnce;
      expect(proxySpy).to.have.been.calledWithExactly(
        'endTurn',
        undefined,
        'fade',
        0,
        1,
        2
      );
      expect(endTurnFadeSpy).to.have.callCount(
        howlerIntegration.playing.endTurn.size
      );
      expect(endTurnFadeSpy).to.have.been.calledWithExactly(
        0,
        1,
        2,
        howlerIntegration.playing.endTurn.values().next().value
      );
    });

    it('invokes .play with winGame', () => {
      const action = { name: 'WIN_GAME', meta: { sound: { play: 'winGame' } } };
      actionHandler(action);

      expect(playSpy).to.have.been.calledOnce;
      expect(playSpy).to.have.been.calledWithExactly('winGame', undefined);
      expect(winGameSpy).to.have.been.calledOnce;
      expect(winGameSpy).to.have.been.calledWithExactly(undefined);
    });

    it('invokes .stop with winGame', () => {
      const action = { name: 'WIN_GAME', meta: { sound: { stop: 'winGame' } } };
      actionHandler(action);

      expect(proxySpy).to.have.been.calledOnce;
      expect(proxySpy).to.have.been.calledWithExactly(
        'winGame',
        undefined,
        'stop'
      );
      expect(winGameStopSpy).to.have.callCount(
        howlerIntegration.playing.winGame.size
      );
      expect(winGameStopSpy).to.have.been.calledWithExactly(
        howlerIntegration.playing.winGame.values().next().value
      );
    });

    it('invokes .fade with winGame', () => {
      const action = {
        name: 'END_TURN',
        meta: { sound: { fade: ['winGame', 0, 1, 2] } }
      };
      actionHandler(action);

      expect(proxySpy).to.have.been.calledOnce;
      expect(proxySpy).to.have.been.calledWithExactly(
        'winGame',
        undefined,
        'fade',
        0,
        1,
        2
      );
      expect(winGameFadeSpy).to.have.callCount(
        howlerIntegration.playing.winGame.size
      );
      expect(winGameFadeSpy).to.have.been.calledWithExactly(
        0,
        1,
        2,
        howlerIntegration.playing.winGame.values().next().value
      );
    });

    it('invokes .play with allSounds (with spriteName)', () => {
      const action = {
        name: 'BOOM',
        meta: { sound: { play: 'allSounds.boom' } }
      };
      actionHandler(action);

      expect(playSpy).to.have.been.calledOnce;
      expect(playSpy).to.have.been.calledWithExactly('allSounds', 'boom');
      expect(allSoundsSpy).to.have.been.calledOnce;
      expect(allSoundsSpy).to.have.been.calledWithExactly('boom');
    });

    it('invokes .stop with allSounds (with spriteName)', () => {
      const action = {
        name: 'WIN_GAME',
        meta: { sound: { stop: 'allSounds.boom' } }
      };
      actionHandler(action);

      expect(proxySpy).to.have.been.calledOnce;
      expect(proxySpy).to.have.been.calledWithExactly(
        'allSounds',
        'boom',
        'stop'
      );
      expect(allSoundsStopSpy).to.have.callCount(
        howlerIntegration.playing.allSoundsboom.size
      );
      expect(allSoundsStopSpy).to.have.been.calledWithExactly(
        howlerIntegration.playing.allSoundsboom.values().next().value
      );
    });

    it('invokes .fade with allSounds (with spriteName)', () => {
      const action = {
        name: 'END_TURN',
        meta: { sound: { fade: ['allSounds.boom', 0, 1, 2] } }
      };
      actionHandler(action);

      expect(proxySpy).to.have.been.calledOnce;
      expect(proxySpy).to.have.been.calledWithExactly(
        'allSounds',
        'boom',
        'fade',
        0,
        1,
        2
      );
      expect(allSoundsFadeSpy).to.have.callCount(
        howlerIntegration.playing.allSoundsboom.size
      );
      expect(allSoundsFadeSpy).to.have.been.calledWithExactly(
        0,
        1,
        2,
        howlerIntegration.playing.allSoundsboom.values().next().value
      );
    });
  });
});

describe('howler integration without sound data', () => {
  const next = sinon.spy();
  afterEach(() => {
    // reset our spies and stubs
    warnStub.resetHistory();
    next.resetHistory();
  });

  const storeHandler = soundMiddleware2();
  expect(storeHandler).to.be.a('function');

  const nextHandler = storeHandler({});
  expect(nextHandler).to.be.a('function');

  const actionHandler = nextHandler(next);
  const addAction = {
    type: 'ADD_COIN_SOUNDS',
    meta: {
      sound: {
        add: addedSoundsData
      }
    }
  };
  actionHandler(addAction);

  describe('howler integration without initial sound data hand-off', () => {
    let playSpy;
    let addSpy;
    let heavyCoinSpy;
    let lightCoinSpy;
    let randomCoinsSpy;
    let proxySpy;
    let heavyCoinStopSpy;
    let lightCoinStopSpy;
    let randomCoinsStopSpy;
    let heavyCoinFadeSpy;
    let lightCoinFadeSpy;
    let randomCoinsFadeSpy;

    before(() => {
      playSpy = sinon.spy(howlerIntegration2, 'play');
      addSpy = sinon.spy(howlerIntegration2, 'add');
      heavyCoinSpy = sinon.spy(howlerIntegration2.sounds.heavyCoin, 'play');
      lightCoinSpy = sinon.spy(howlerIntegration2.sounds.lightCoin, 'play');
      randomCoinsSpy = sinon.spy(howlerIntegration2.sounds.randomCoins, 'play');
      proxySpy = sinon.spy(howlerIntegration2, 'proxy');
      heavyCoinStopSpy = sinon.spy(howlerIntegration2.sounds.heavyCoin, 'stop');
      lightCoinStopSpy = sinon.spy(howlerIntegration2.sounds.lightCoin, 'stop');
      randomCoinsStopSpy = sinon.spy(
        howlerIntegration2.sounds.randomCoins,
        'stop'
      );
      heavyCoinFadeSpy = sinon.spy(howlerIntegration2.sounds.heavyCoin, 'fade');
      lightCoinFadeSpy = sinon.spy(howlerIntegration2.sounds.lightCoin, 'fade');
      randomCoinsFadeSpy = sinon.spy(
        howlerIntegration2.sounds.randomCoins,
        'fade'
      );
    });
    afterEach(() => {
      playSpy.resetHistory();
      addSpy.resetHistory();
      heavyCoinSpy.resetHistory();
      lightCoinSpy.resetHistory();
      randomCoinsSpy.resetHistory();
      proxySpy.resetHistory();
      heavyCoinStopSpy.resetHistory();
      lightCoinStopSpy.resetHistory();
      randomCoinsStopSpy.resetHistory();
      heavyCoinFadeSpy.resetHistory();
      lightCoinFadeSpy.resetHistory();
      randomCoinsFadeSpy.resetHistory();
    });
    after(() => {
      playSpy.restore();
      addSpy.restore();
      heavyCoinSpy.restore();
      lightCoinSpy.restore();
      randomCoinsSpy.restore();
      proxySpy.restore();
      heavyCoinStopSpy.restore();
      lightCoinStopSpy.restore();
      randomCoinsStopSpy.restore();
      heavyCoinFadeSpy.restore();
      lightCoinFadeSpy.restore();
      randomCoinsFadeSpy.restore();
    });

    describe('adds sounds', () => {
      it('contains a hashmap which includes only the additional dynamic playing names', () => {
        actionHandler(addAction);
        const playingNames = Object.keys(howlerIntegration2.playing);
        const expected = [
          'heavyCoin',
          'lightCoin',
          'randomCoinsone',
          'randomCoinstwo',
          'randomCoinsthree'
        ];
        expect(addSpy).to.have.been.calledOnce;
        expect(expected).to.deep.equal(playingNames);
      });
    });

    it('invokes .play with heavyCoin', () => {
      const heavyAction = {
        name: 'HEAVY_COIN',
        meta: { sound: { play: 'heavyCoin' } }
      };
      actionHandler(heavyAction);

      expect(playSpy).to.have.been.calledOnce;
      expect(playSpy).to.have.been.calledWithExactly('heavyCoin', undefined);
      expect(heavyCoinSpy).to.have.been.calledOnce;
      expect(heavyCoinSpy).to.have.been.calledWithExactly(undefined);
    });
  });
});


text:
/**
 *
 */
package net.freecoder.restdemo.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import net.freecoder.restdemo.constant.ErrorCode;

/**
 * Result is common object for all of controllers. Provides uniform data format
 * for client.
 *
 * @author JiTing
 */
public class Result {

	public static String COUNT = "count";
	public static String TOTALCOUNT = "totalCount";

	private boolean success = true;
	private String errMsg;
	private ErrorCode errCode;
	private Map<String, Object> data = new HashMap<String, Object>(1);

	/**
	 * @return the success
	 */
	public boolean isSuccess() {
		return success;
	}

	/**
	 * @param success
	 *            the success to set
	 */
	public Result setSuccess(boolean success) {
		this.success = success;
		return this;
	}

	/**
	 * @return the errCode
	 */
	public ErrorCode getErrCode() {
		return errCode;
	}

	/**
	 * @param errCode
	 *            the errCode to set
	 */
	public Result setErrCode(ErrorCode errCode) {
		this.success = false;
		this.errCode = errCode;
		return this;
	}

	/**
	 * @return the errMsg
	 */
	public String getErrMsg() {
		return errMsg;
	}

	/**
	 * @param errMsg
	 *            the errMsg to set
	 */
	public Result setErrMsg(String errMsg) {
		this.success = false;
		this.errMsg = errMsg;
		return this;
	}

	/**
	 * @return the data
	 */
	public Map<String, Object> getData() {
		return data;
	}

	/**
	 * @param data
	 *            the data to set
	 */
	public Result setDataMap(Map<String, Object> data) {
		this.data = data;
		return this;
	}

	/**
	 *
	 * @param key
	 *            the key of value.
	 * @param value
	 *            the value to set.
	 */
	public Result setData(String key, Object value) {
		this.data.put(key, value);
		// this.data.put("entityType", value.getClass().getSimpleName());
		return this;
	}

	/**
	 *
	 * @param key
	 * @return
	 */
	public Object getData(String key) {
		return this.data.get(key);
	}

	/**
	 *
	 * @param value
	 */
	public Result setData(Object value) {
		this.data.put(value.getClass().getSimpleName(), value);
		return this;
	}

	/**
	 * Set count and total count for result.
	 *
	 * @param count
	 * @param totalCount
	 */
	public Result setCount(long count, long totalCount) {
		this.data.put(Result.COUNT, count);
		this.data.put(Result.TOTALCOUNT, totalCount);
		return this;
	}

	/**
	 * Set count for result.
	 *
	 * @param count
	 */
	public Result setDataCount(long count) {
		this.data.put(Result.COUNT, count);
		return this;
	}

	/**
	 * Set total count for result.
	 *
	 * @param totalCount
	 */
	public Result setDataTotalCount(long totalCount) {
		this.data.put(Result.TOTALCOUNT, totalCount);
		return this;
	}

	/**
	 * Quick method to setData("entity", entity);
	 *
	 * @param entity
	 * @return
	 */
	public Result setEntity(Object entity) {
		this.data.put("entity", entity);
		if (entity == null) {
			setDataCount(0);
		} else if (entity instanceof List) {
			setDataCount(((List) entity).size());
		} else if (entity instanceof Object[]) {
			setDataCount(((Object[]) entity).length);
		} else {
			setDataCount(1);
		}
		return this;
	}
}


text:
GUIEditor = {
    window = {},
    edit = {},
    label = {},
	button = {}
}

function sendToSv()
	houseInfo = {}
	houseInfo["interiorID"] = guiGetText(GUIEditor.edit[1])
	houseInfo["x"] = guiGetText(GUIEditor.edit[2])
	houseInfo["y"] = guiGetText(GUIEditor.edit[3])
	houseInfo["z"] = guiGetText(GUIEditor.edit[4])
	houseInfo["name"] = guiGetText(GUIEditor.edit[5])
	houseInfo["price"] = guiGetText(GUIEditor.edit[6])

	triggerServerEvent("UCDhousing.makeHouse", resourceRoot)
end
function close()
	destroyElement(GUIEditor.window[1])
	showCursor(false)
end

function openPanel()
	if (not localPlayer) then outputDebugString("nigger") return end
	if (not isPedOnGround(localPlayer)) then exports.UCDdx:new("You must be on the ground for this feature to work", 255, 0, 0) return end

	x, y, z = getElementPosition(localPlayer)

	GUIEditor.window[1] = guiCreateWindow(457, 192, 468, 335, "UCDhousing | Creation Panel", false)
	guiWindowSetSizable(GUIEditor.window[1], false)

	GUIEditor.label[1] = guiCreateLabel(30, 47, 55, 17, "interiorID:", false, GUIEditor.window[1])
	GUIEditor.label[2] = guiCreateLabel(30, 78, 55, 17, "x:", false, GUIEditor.window[1])
	GUIEditor.label[3] = guiCreateLabel(30, 105, 55, 17, "y:", false, GUIEditor.window[1])
	GUIEditor.label[4] = guiCreateLabel(30, 136, 55, 17, "z:", false, GUIEditor.window[1])
	GUIEditor.label[5] = guiCreateLabel(30, 169, 55, 17, "Name:", false, GUIEditor.window[1])
	GUIEditor.label[6] = guiCreateLabel(30, 204, 55, 17, "Price: ", false, GUIEditor.window[1])
	GUIEditor.edit[1] = guiCreateEdit(149, 43, 262, 21, "", false, GUIEditor.window[1])
	GUIEditor.edit[2] = guiCreateEdit(149, 74, 262, 21, exports.UCDmisc:mathround(x, 4), false, GUIEditor.window[1])
	GUIEditor.edit[3] = guiCreateEdit(149, 105, 262, 21, exports.UCDmisc:mathround(y, 4), false, GUIEditor.window[1])
	GUIEditor.edit[4] = guiCreateEdit(149, 132, 262, 21, exports.UCDmisc:mathround(z, 4), false, GUIEditor.window[1])
	GUIEditor.edit[5] = guiCreateEdit(149, 165, 262, 21, "", false, GUIEditor.window[1])
	GUIEditor.edit[6] = guiCreateEdit(149, 200, 262, 21, "", false, GUIEditor.window[1])
	GUIEditor.label[7] = guiCreateLabel(30, 259, 303, 49, "houseIDs will be automatically assigned.\nThe price you set will be the initial price, bought for price and the current market price\nThe owner will be UCDhousing..", false, GUIEditor.window[1])
	GUIEditor.button[1] = guiCreateButton(364, 259, 88, 59, "Submit", false, GUIEditor.window[1])
	guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
	GUIEditor.button[2] = guiCreateButton(428, 43, 30, 183, "close", false, GUIEditor.window[1])
	guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA")

	showCursor(true)

	addEventHandler("onClientGUIClick", GUIEditor.button[1], sendToSv)
	addEventHandler("onClientGUIClick", GUIEditor.button[2], close)
end
addCommandHandler("chouse", openPanel)