text:
package com.coolweather.app.db;

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

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

import com.coolweather.app.model.City;
import com.coolweather.app.model.Country;
import com.coolweather.app.model.Province;

public class CoolWeatherDB
{
	/**
	 * 数据库名
	 */
	public static final String DB_NAME = "cool_weather";

	/**
	 * 数据库版本
	 */
	public static final int VERSION = 1;

	private static CoolWeatherDB coolWeatherDB;

	private SQLiteDatabase db;

	/**
	 * 构造函数私有化
	 */
	private CoolWeatherDB(Context context)
	{
		CoolWeatherOpenHelper helper = new CoolWeatherOpenHelper(context,DB_NAME,null,VERSION);
		db = helper.getWritableDatabase();
	}

	/**
	 * 获取 CoolWeatherDB 的实例
	 */
	public synchronized static CoolWeatherDB getCoolWeatherDB(Context context)
	{
		if(coolWeatherDB == null)
		{
			coolWeatherDB = new CoolWeatherDB(context);
		}
		return coolWeatherDB;
	}

	/**
	 * 将Province 实例存储到数据库
	 */
	public void saveProvince(Province province)
	{
		if(province != null)
		{
			ContentValues values = new ContentValues();
			values.put("province_name", province.getProvinceName());
			values.put("province_code", province.getProvinceCode());
			db.insert("PROVINCE", null, values);
		}
	}

	/**
	 * 从数据库中读取全国所有的省份信息
	 */
	public List<Province> loadProvince()
	{
		List<Province> list = new ArrayList<Province>();
		Cursor cursor = db.query("PROVINCE", null, null, null, null, null, null);
		if(cursor.moveToFirst())
		{
			do
			{
				Province province = new Province();
				province.setId(cursor.getInt(cursor.getColumnIndex("id")));
				province.setProvinceName(cursor.getString(cursor.getColumnIndex("province_name")));
				province.setProvinceCode(cursor.getString(cursor.getColumnIndex("province_code")));
				list.add(province);
			}while(cursor.moveToNext());
		}
		if(cursor!=null)
		{
			cursor.close();
		}
		return list;
	}

	/**
	 * 将City 实例存储到数据库
	 */
	public void saveCity(City city)
	{
		if(city != null)
		{
			ContentValues values = new ContentValues();
			values.put("city_name", city.getCityName());
			values.put("city_code", city.getCityCode());
			values.put("province_id", city.getProvinceId());
			db.insert("CITY", null, values);
		}
	}

	private void loadCity(List<City> list,Cursor cursor)
	{
		if(cursor.moveToFirst())
		{
			do
			{
				City city = new City();
				city.setId(cursor.getInt(cursor.getColumnIndex("id")));
				city.setCityName(cursor.getString(cursor.getColumnIndex("city_name")));
				city.setCityCode(cursor.getString(cursor.getColumnIndex("city_code")));
				city.setProvinceId(cursor.getInt(cursor.getColumnIndex("province_id")));
				list.add(city);
			}while(cursor.moveToNext());
		}
		if(cursor!=null)
		{
			cursor.close();
		}
	}
	/**
	 * 获取一个省内的所有城市
	 * @param privinceId 省的 id
	 */
	public List<City> loadCityOfProvince(int provinceId)
	{
		List<City> list = new ArrayList<City>();
		Cursor cursor = db.query("CITY", null, "province_id = ?", new String[]{String.valueOf(provinceId)}, null, null, null);
		loadCity(list,cursor);
//		if(cursor.moveToFirst())
//		{
//			do
//			{
//				City city = new City();
//				city.setId(cursor.getInt(cursor.getColumnIndex("id")));
//				city.setCityName(cursor.getString(cursor.getColumnIndex("city_name")));
//				city.setCityCode(cursor.getString(cursor.getColumnIndex("city_code")));
//				city.setProvinceId(cursor.getInt(cursor.getColumnIndex("province_id")));
//				list.add(city);
//			}while(cursor.moveToNext());
//		}
//		if(cursor!=null)
//		{
//			cursor.close();
//		}
		return list;
	}

	/**
	 * 从数据库中读取全国所有的城市信息
	 */
	public List<City> loadAllCity()
	{
		List<City> list = new ArrayList<City>();
		Cursor cursor = db.query("CITY", null, null, null, null, null, null);
		loadCity(list,cursor);
//		if(cursor.moveToFirst())
//		{
//			do
//			{
//				City city = new City();
//				city.setId(cursor.getInt(cursor.getColumnIndex("id")));
//				city.setCityName(cursor.getString(cursor.getColumnIndex("city_name")));
//				city.setCityCode(cursor.getString(cursor.getColumnIndex("city_code")));
//				city.setProvinceId(cursor.getInt(cursor.getColumnIndex("province_id")));
//				list.add(city);
//			}while(cursor.moveToNext());
//		}
//		if(cursor!=null)
//		{
//			cursor.close();
//		}
		return list;
	}

	/**
	 * 将Country 实例存储到数据库
	 */
	public void saveCountry(Country country)
	{
		if(country != null)
		{
			ContentValues values = new ContentValues();
			values.put("country_name", country.getCountryName());
			values.put("country_code", country.getCountryCode());
			values.put("city_id", country.getCityId());
			db.insert("COUNTRY", null, values);
		}
	}

	private void loadCountry(List<Country> list,Cursor cursor)
	{
		if(cursor.moveToFirst())
		{
			do
			{
				Country country = new Country();
				country.setId(cursor.getInt(cursor.getColumnIndex("id")));
				country.setCountryName(cursor.getString(cursor.getColumnIndex("country_name")));
				country.setCountryCode(cursor.getString(cursor.getColumnIndex("country_code")));
				country.setCityId(cursor.getInt(cursor.getColumnIndex("city_id")));
				list.add(country);
			}while(cursor.moveToNext());
		}
		if(cursor!=null)
		{
			cursor.close();
		}
	}

	/**
	 * 从数据库中读出一个城市里的所有县信息
	 */
	public List<Country> loadCountryOfCity(int cityId)
	{
		List<Country> list = new ArrayList<Country>();
		Cursor cursor = db.query("COUNTRY", null, "city_id = ?", new String[]{String.valueOf(cityId)}, null, null, null);
		loadCountry(list,cursor);
		return list;
	}
	/**
	 * 从数据库中读取全国所有的县信息
	 */
	public List<Country> loadAllCountry()
	{
		List<Country> list = new ArrayList<Country>();
		Cursor cursor = db.query("COUNTRY", null, null, null, null, null, null);
		loadCountry(list,cursor);
		return list;
	}

}


text:
'use strict';

var browserSync = require('browser-sync');
var del = require('del');
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')();
var reworkNpm = require('rework-npm');
var runSequence = require('run-sequence');  // Temporary solution until Gulp 4
                                            // https://github.com/gulpjs/gulp/issues/355
var gzip = require('gulp-gzip');

var pkg = require('./package.json');
var dirs = pkg['h5bp-configs'].directories;
var reload = browserSync.reload;

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

var browserSyncOptions = {

    // In-depth information about the options:
    // http://www.browsersync.io/docs/options/

    logPrefix: 'H5BP',
    notify: false,
    port: 8080
};

var supportedBrowsers = [

    // In-depth information about the options:
    // https://github.com/postcss/autoprefixer#browsers

    'last 2 versions',
    'ie > 8',
    '> 1%'
];

// ---------------------------------------------------------------------
// | Helper tasks                                                      |
// ---------------------------------------------------------------------

gulp.task('clean:before', function (done) {
    del([dirs.dist]).then(function () {
        done();
    });
});

gulp.task('clean:after', function (done) {
    del([
        dirs.dist + '/{css,css/**}',
        dirs.dist + '/{img,/img/**}',
        dirs.dist + '/{js,/js/**}'
    ]).then(function () {
        done();
    });
});

gulp.task('copy', [
    'copy:html',
    'copy:css',
    'copy:misc'
]);

gulp.task('copy:html', function () {
    return gulp.src(dirs.src + '/index.html')
        .pipe(plugins.replace(/{{h5bp-version}}/g, pkg.version))
        .pipe(plugins.useref())
        .pipe(gulp.dest('dist'));
});

gulp.task('copy:css', function () {
    return gulp.src(dirs.src + '/css/main.css')
        .pipe(gulp.dest(dirs.dist + '/css/'));
});

gulp.task('copy:misc', function () {
    return gulp.src([

        // Copy all files
        dirs.src + '/**',

        // Exclude the following files
        // (other tasks will handle the copying of these files)
        '!' + dirs.src + '/index.html',
        '!' + dirs.src + '/{css,css/**}'

    ], {

        // Include hidden files by default
        dot: true

    }).pipe(gulp.dest(dirs.dist));
});

gulp.task('generate:main.css', function () {
    return gulp.src(dirs.src + '/css/index.css')
            .pipe(plugins.rework(reworkNpm()))
            .pipe(plugins.autoprefixer({
                browsers: supportedBrowsers
            }))
            .pipe(plugins.cssBase64())
            .pipe(plugins.uncss({
                html: [dirs.src + '/index.html']
            }))
            .pipe(plugins.csso())
            .pipe(plugins.rename('main.css'))
            .pipe(gulp.dest(dirs.src + '/css/'))
            .pipe(reload({ stream: true }));
});

gulp.task('lint:js', function () {
    return gulp.src([
        'gulpfile.js',
        dirs.src + '/js/**/*.js',
    ]).pipe(plugins.jshint())
      .pipe(plugins.jshint.reporter('jshint-stylish'))
      .pipe(plugins.if(!browserSync.active, plugins.jshint.reporter('fail')));
});

gulp.task('minify:html', function () {

    // In-depth information about the `htmlmin` options:
    // https://github.com/kangax/html-minifier#options-quick-reference
    var htmlminOptions = {
        collapseBooleanAttributes: true,
        collapseWhitespace: true,
        minifyJS: true,
        removeAttributeQuotes: true,
        removeComments: true,
        removeEmptyAttributes: true,
        removeOptionalTags: true,
        removeRedundantAttributes: true
    };

    return gulp.src([
        dirs.dist + '/index.html'
    ]).pipe(plugins.smoosher())
      .pipe(plugins.htmlmin(htmlminOptions))
      .pipe(gulp.dest(dirs.dist));

});
// ---------------------------------------------------------------------
// | Main tasks                                                        |
// ---------------------------------------------------------------------

gulp.task('build', function (done) {
    runSequence(
        ['clean:before', 'lint:js'],
        'generate:main.css',
        'copy',
        'minify:html',
        'clean:after',
        'compress',
    done);
});

gulp.task('compress', function() {
   gulp.src(dirs.dist + '/**/*.{css,html,ico,js,svg,txt,xml}')
        .pipe(gzip())
        .pipe(gulp.dest(dirs.dist));
});

gulp.task('default', ['build']);

gulp.task('serve', ['generate:main.css'], function () {

    browserSyncOptions.server = dirs.src;
    browserSync(browserSyncOptions);

    gulp.watch([
        dirs.src + '/**/*.html'
    ], reload);

    gulp.watch([
        dirs.src + '/css/**/*.css',
        dirs.src + '/img/**/*',
        '!' + dirs.src + '/css/main.css'
    ], ['generate:main.css']);

    gulp.watch([
        dirs.src + '/js/**/*.js',
        'gulpfile.js'
    ], ['lint:js', reload]);

});

gulp.task('serve:build', ['build'], function () {
    browserSyncOptions.server = dirs.dist;
    browserSync(browserSyncOptions);
});

redpajama_set_name: RedPajamaGithub


text:
package org.apache.mina.util;

import java.util.Collection;
import java.util.IdentityHashMap;
import java.util.Set;

/**
 * An {@link IdentityHashMap}-backed {@link Set}.
 *
 * @author Apache MINA Project
 */
public class IdentityHashSet<E> extends MapBackedSet<E> {

    private static final long serialVersionUID = 6948202189467167147L;

    public IdentityHashSet() {
        super(new IdentityHashMap<E, Boolean>());
    }

    public IdentityHashSet(int expectedMaxSize) {
        super(new IdentityHashMap<E, Boolean>(expectedMaxSize));
    }

    public IdentityHashSet(Collection<E> c) {
        super(new IdentityHashMap<E, Boolean>(), c);
    }
}


text:
package org.spotter.eclipse.ui;

import java.io.InputStream;
import java.net.ConnectException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.eclipse.core.runtime.preferences.InstanceScope;
import org.lpe.common.config.ConfigParameterDescription;
import org.osgi.service.prefs.BackingStoreException;
import org.osgi.service.prefs.Preferences;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spotter.client.SpotterServiceClient;
import org.spotter.eclipse.ui.model.ExtensionMetaobject;
import org.spotter.eclipse.ui.util.DialogUtils;
import org.spotter.eclipse.ui.util.SpotterProjectSupport;
import org.spotter.shared.configuration.JobDescription;
import org.spotter.shared.configuration.SpotterExtensionType;
import org.spotter.shared.hierarchy.model.RawHierarchyFactory;
import org.spotter.shared.hierarchy.model.XPerformanceProblem;
import org.spotter.shared.status.SpotterProgress;

import com.sun.jersey.api.client.ClientHandlerException;

/**
 *

 * A wrapper for the Spotter Service Client that delegates to the client and
 * handles arising exceptions by providing meaningful screen messages to the
 * user. Exceptions thrown during a request are stored and can be retrieved
 * afterwards via {@link #getLastException()}.
 *

 *

 * This wrapper class also caches requested information from the server for
 * future use. Whenever the client settings change, the cache will also be
 * cleared automatically or it can be cleared on demand.
 *

 *
 * @author Denis Knoepfle
 *
 */
public class ServiceClientWrapper {

	public static final String DEFAULT_SERVICE_HOST = "localhost";
	public static final String DEFAULT_SERVICE_PORT = "8080";
	public static final String KEY_SERVICE_HOST = "spotter.service.host";
	public static final String KEY_SERVICE_PORT = "spotter.service.port";

	private static final Logger LOGGER = LoggerFactory.getLogger(ServiceClientWrapper.class);

	private static enum HandlerStyle {
		SILENT, LOG_ONLY, SHOW
	}

	private static final String DIALOG_TITLE = "DynamicSpotter Service Client";
	private static final String ERR_MSG_CONN = "Connection to '%s' at port %s could not be established!";
	private static final String MSG_FAIL_SAFE = "Error while storing preferences. Please try again.";
	private static final String MSG_NO_ACTION = "Action cannot be performed without connection to DynamicSpotter Service. "
			+ "Please check connection settings and try again.";
	private static final String MSG_START_DIAGNOSIS = "Could not start diagnosis!";
	private static final String MSG_REQU_RESULTS = "Could not retrieve diagnosis results!";
	private static final String MSG_NO_STATUS = "Could not retrieve status.";
	private static final String MSG_NO_RUN_EXCEPTION = "Could not retrieve the last run exception.";
	private static final String MSG_NO_CONFIG_PARAMS = "Could not retrieve configuration parameters.";
	private static final String MSG_NO_EXTENSIONS = "Could not retrieve list of extensions.";
	private static final String MSG_NO_DEFAULT_HIER = "Could not retrieve the default hierarchy.";
	private static final String MSG_NO_SATTELITE_TEST = "Could not test satellite connection.";

	private final String projectName;
	private final SpotterServiceClient client;
	private Exception lastClientException;
	private String host;
	private String port;

	// used for caching
	private Set<ConfigParameterDescription> cachedSpotterConfParameters;
	private Map<String, ConfigParameterDescription> cachedSpotterConfParamsMap;
	private Map<SpotterExtensionType, Set<String>> cachedExtensionNames = new HashMap<>();
	private Map<SpotterExtensionType, ExtensionMetaobject[]> cachedExtensionMetaobjects = new HashMap<>();
	private Map<String, Set<ConfigParameterDescription>> cachedExtensionConfParamters = new HashMap<>();
	private Map<String, String> cachedExtensionDescriptions = new HashMap<>();
	private long lastClearTime;

	/**
	 * Creates a new instance using the default host and port.
	 */
	public ServiceClientWrapper() {
		this(null, true);
	}

	/**
	 * Creates a new instance. Service client settings will be stored using the
	 * given project name as identifier. Providing null means that
	 * those settings will be saved in the plugin's root scope instead.
	 *
	 * @param projectName
	 *            The project the settings should be saved for or
	 *            null to store them at the plugin's root scope
	 */
	public ServiceClientWrapper(String projectName) {
		this(projectName, false);
	}

	private ServiceClientWrapper(String projectName, boolean useDefaults) {
		if (useDefaults) {
			this.host = DEFAULT_SERVICE_HOST;
			this.port = DEFAULT_SERVICE_PORT;
		} else {
			Preferences prefs;
			if (projectName == null) {
				prefs = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID);
			} else {
				prefs = SpotterProjectSupport.getProjectPreferences(projectName);
			}
			this.host = prefs.get(KEY_SERVICE_HOST, DEFAULT_SERVICE_HOST);
			this.port = prefs.get(KEY_SERVICE_PORT, DEFAULT_SERVICE_PORT);
		}

		this.projectName = projectName;
		this.client = new SpotterServiceClient(host, port);
		this.lastClientException = null;
		this.lastClearTime = System.currentTimeMillis();
	}

	/**
	 * @return The name of the project this client is associated with.
	 */
	public String getProjectName() {
		return this.projectName;
	}

	/**
	 * @return The host of this client.
	 */
	public String getHost() {
		return this.host;
	}

	/**
	 * @return The port of this client.
	 */
	public String getPort() {
		return this.port;
	}

	/**
	 * Returns a value that determines the last time the cache was cleared. If a
	 * previous received value is smaller than the current one it means that the
	 * cache has been cleared in the meantime.
	 *
	 * @return a number that can be used for comparison to check if cache has
	 *         been cleared meanwhile
	 */
	public long getLastClearTime() {
		return lastClearTime;
	}

	/**
	 * Updates the URL of the wrapped client.
	 *
	 * @param newHost
	 *            The new host
	 * @param newPort
	 *            The new port
	 */
	public void updateUrl(String newHost, String newPort) {
		if (!host.equals(newHost) || !port.equals(newPort)) {
			client.updateUrl(newHost, newPort);
			host = newHost;
			port = newPort;
			clearCache();
		}
	}

	/**
	 * Saves preferences for the service client for the given project at the
	 * workspace level and updates the plugin's Spotter Service Client.
	 *
	 * @param newHost
	 *            The new host
	 * @param newPort
	 *            The new port
	 * @return true on success, otherwise false
	 */
	public boolean saveServiceClientSettings(String newHost, String newPort) {
		Preferences prefs;
		if (projectName == null) {
			prefs = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID);
		} else {
			prefs = SpotterProjectSupport.getProjectPreferences(projectName);
		}
		String oldHost = prefs.get(KEY_SERVICE_HOST, DEFAULT_SERVICE_HOST);
		String oldPort = prefs.get(KEY_SERVICE_PORT, DEFAULT_SERVICE_PORT);

		prefs.put(KEY_SERVICE_HOST, newHost);
		prefs.put(KEY_SERVICE_PORT, newPort);

		// force save
		try {
			prefs.flush();
			// update current client
			updateUrl(newHost, newPort);
			return true;
		} catch (BackingStoreException e) {
			LOGGER.error("Saving Service Client settings failed.", e);
			// restore old values
			prefs.put(KEY_SERVICE_HOST, oldHost);
			prefs.put(KEY_SERVICE_PORT, oldPort);

			DialogUtils.handleError(MSG_FAIL_SAFE, e);
		}
		return false;
	}

	/**
	 * Starts the diagnosis using the given job description. Returns the
	 * retrieved job id or null on failure.
	 *
	 * @param jobDescription
	 *            The job description to use.
	 * @return The retrieved job id or null on failure.
	 */
	public Long startDiagnosis(final JobDescription jobDescription) {
		lastClientException = null;
		try {
			return client.startDiagnosis(jobDescription);
		} catch (Exception e) {
			handleException("startDiagnosis", MSG_START_DIAGNOSIS, e, HandlerStyle.SHOW, false);
		}
		return null;
	}

	/**
	 * Requests the results of a the run with the given job id.
	 *
	 * @param jobId
	 *            the job id of the diagnosis run
	 * @return input stream containing the zipped run result folder or
	 *         null if none found
	 */
	public InputStream requestResults(final String jobId) {
		lastClientException = null;
		try {
			return client.requestResults(jobId);
		} catch (Exception e) {
			handleException("requestResults", MSG_REQU_RESULTS, e, HandlerStyle.SHOW, false);
		}
		return null;
	}

	/**
	 * Returns true if DynamicSpotter diagnostics is currently
	 * running, otherwise false.
	 *
	 * @param silent
	 *            true to disable dialog pop-up and logging
	 * @return true if currently running, otherwise
	 *         false
	 */
	public boolean isRunning(boolean silent) {
		lastClientException = null;
		try {
			return client.isRunning();
		} catch (Exception e) {
			HandlerStyle style = silent ? HandlerStyle.SILENT : HandlerStyle.SHOW;
			handleException("isRunning", MSG_NO_STATUS, e, style, true);
		}
		return false;
	}

	/**
	 * Returns the exception thrown during the last diagnosis run or
	 * null if none.
	 *
	 * @param silent
	 *            true to disable dialog pop-up and logging
	 * @return the exception thrown during the last diagnosis run or
	 *         null if none
	 */
	public Exception getLastRunException(boolean silent) {
		lastClientException = null;
		try {
			return client.getLastRunException();
		} catch (Exception e) {
			HandlerStyle style = silent ? HandlerStyle.SILENT : HandlerStyle.SHOW;
			handleException("getLastRunException", MSG_NO_RUN_EXCEPTION, e, style, true);
		}
		return null;
	}

	/**
	 * @return set of configuration parameter descriptions for DynamicSpotter
	 *         configuration.
	 */
	public Set<ConfigParameterDescription> getConfigurationParameters() {
		lastClientException = null;
		if (cachedSpotterConfParameters != null) {
			return cachedSpotterConfParameters;
		}
		try {
			cachedSpotterConfParameters = client.getConfigurationParameters();
		} catch (Exception e) {
			handleException("getConfigurationParameters", MSG_NO_CONFIG_PARAMS, e, HandlerStyle.SHOW, false);
		}
		return cachedSpotterConfParameters;
	}

	/**
	 * Returns the ConfigParameterDescription that suits the given
	 * name.
	 *
	 * @param name
	 *            name of the description object to retrieve
	 * @return the matching description object or null if not found
	 */
	public ConfigParameterDescription getSpotterConfigParam(String name) {
		lastClientException = null;
		if (cachedSpotterConfParamsMap == null) {
			cachedSpotterConfParamsMap = initSpotterConfParamsMap();
			if (cachedSpotterConfParamsMap == null) {
				return null;
			}
		}
		return cachedSpotterConfParamsMap.get(name);
	}

	/**
	 * Returns an array of extension meta objects for the given extension type
	 * or null on failure.
	 *
	 * @param extType
	 *            extension type of interest
	 * @return array of extension meta objects for the given extension type. In
	 *         the case of an error null is returned.
	 */
	public ExtensionMetaobject[] getAvailableExtensions(SpotterExtensionType extType) {
		lastClientException = null;
		ExtensionMetaobject[] metaobjects = cachedExtensionMetaobjects.get(extType);
		if (metaobjects != null) {
			return metaobjects;
		}
		Set<String> extNames = getAvailableExtensionNames(extType);
		if (extNames == null) {
			return null;
		}

		List<ExtensionMetaobject> list = new ArrayList<ExtensionMetaobject>();
		for (String extName : extNames) {
			// force caching and ignore invalid extensions
			if (getExtensionConfigParamters(extName, HandlerStyle.LOG_ONLY) == null) {
				continue;
			}
			list.add(new ExtensionMetaobject(projectName, extName));
		}

		metaobjects = list.toArray(new ExtensionMetaobject[list.size()]);
		cachedExtensionMetaobjects.put(extType, metaobjects);
		return metaobjects;
	}

	/**
	 * Returns a set of extension names for the given extension type.
	 *
	 * @param extType
	 *            extension type of interest
	 * @return a set of extension names for the given extension type
	 */
	public Set<String> getAvailableExtensionNames(SpotterExtensionType extType) {
		lastClientException = null;
		Set<String> extNames = cachedExtensionNames.get(extType);
		if (extNames != null) {
			return extNames;
		}
		try {
			extNames = client.getAvailableExtensions(extType);
			cachedExtensionNames.put(extType, extNames);
		} catch (Exception e) {
			handleException("getAvailableExtensions", MSG_NO_EXTENSIONS, e, HandlerStyle.SHOW, false);
		}
		return extNames;
	}

	/**
	 * Returns the extension configuration parameters for the given extension or
	 * null if the extension doesn't exist.
	 *
	 * @param extName
	 *            The name of the extension
	 * @return the extension configuration parameters for the extension or
	 *         null
	 */
	public Set<ConfigParameterDescription> getExtensionConfigParamters(String extName) {
		return getExtensionConfigParamters(extName, HandlerStyle.SHOW);
	}

	private Set<ConfigParameterDescription> getExtensionConfigParamters(String extName, HandlerStyle style) {
		lastClientException = null;
		Set<ConfigParameterDescription> confParams = cachedExtensionConfParamters.get(extName);
		if (confParams != null) {
			if (!cachedExtensionDescriptions.containsKey(extName)) {
				cachedExtensionDescriptions.put(extName, findExtensionDescription(confParams));
			}
			return confParams;
		}
		try {
			confParams = client.getExtensionConfigParamters(extName);
			if (confParams != null) {
				cachedExtensionConfParamters.put(extName, confParams);
				cachedExtensionDescriptions.put(extName, findExtensionDescription(confParams));
			}
		} catch (Exception e) {
			handleException("getExtensionConfigParameters", MSG_NO_CONFIG_PARAMS, e, style, false);
		}
		return confParams;
	}

	/**
	 * Returns the textual description of the given extension.
	 *
	 * @param extName
	 *            The name of the extension
	 * @return the textual description of the given extension
	 */
	public String getExtensionDescription(String extName) {
		lastClientException = null;
		if (!cachedExtensionConfParamters.containsKey(extName)) {
			// force caching of the extension description
			getExtensionConfigParamters(extName);
		}
		return cachedExtensionDescriptions.get(extName);
	}

	/**
	 * Returns the default hierarchy.
	 *
	 * @return the default hierarchy
	 */
	public XPerformanceProblem getDefaultHierarchy() {
		lastClientException = null;
		try {
			return client.getDefaultHierarchy();
		} catch (Exception e) {
			handleException("getDefaultHierarchy", MSG_NO_DEFAULT_HIER, e, HandlerStyle.LOG_ONLY, true);
		}
		return RawHierarchyFactory.getInstance().createEmptyHierarchy();
	}

	/**
	 * Returns a report on the progress of the current job.
	 *
	 * @return a report on the progress of the current job
	 */
	public SpotterProgress getCurrentProgressReport() {
		lastClientException = null;
		try {
			return client.getCurrentProgressReport();
		} catch (Exception e) {
			handleException("getCurrentProgressReport", MSG_NO_STATUS, e, HandlerStyle.SHOW, false);
		}
		return null;
	}

	/**
	 * Returns the id of the currently running job.
	 *
	 * @return the id of the currently running job
	 */
	public Long getCurrentJobId() {
		lastClientException = null;
		try {
			return client.getCurrentJobId();
		} catch (Exception e) {
			handleException("getCurrentJobId", MSG_NO_STATUS, e, HandlerStyle.SHOW, false);
		}
		return null;
	}

	/**
	 * Returns the root problem of the currently running job.
	 *
	 * @param silent
	 *            true to disable dialog pop-up and logging
	 * @return the root problem
	 */
	public XPerformanceProblem getCurrentRootProblem(boolean silent) {
		lastClientException = null;
		try {
			return client.getCurrentRootProblem();
		} catch (Exception e) {
			HandlerStyle style = silent ? HandlerStyle.SILENT : HandlerStyle.SHOW;
			handleException("getCurrentRootProblem", MSG_NO_STATUS, e, style, false);
		}
		return null;
	}

	/**
	 * Tests connection to the satellite specified by the given extension name,
	 * host and port. If extension is not a satellite this method returns
	 * false!
	 *
	 * @param extName
	 *            The name of the extension
	 * @param host
	 *            The host/ip to connect to
	 * @param port
	 *            The port to connect to
	 * @return true if connection could have been established,
	 *         otherwise false
	 */
	public boolean testConnectionToSattelite(String extName, String host, String port) {
		lastClientException = null;
		try {
			return client.testConnectionToSattelite(extName, host, port);
		} catch (Exception e) {
			handleException("testConnectionToSattelite", MSG_NO_SATTELITE_TEST, e, HandlerStyle.SHOW, false);
		}
		return false;
	}

	/**
	 * Tests connection to the DS Service.
	 *
	 * @param showErrorDialog
	 *            true to show an error dialog on failure
	 *
	 * @return true if connection could have been established,
	 *         otherwise false
	 */
	public boolean testConnection(boolean showErrorDialog) {
		lastClientException = null;
		boolean connection;
		try {
			connection = client.testConnection();
		} catch (Exception e) {
			connection = false;
			lastClientException = e;
		}
		if (showErrorDialog && !connection) {
			showConnectionProblemMessage(MSG_NO_ACTION, host, port, false);
		}
		return connection;
	}

	/**
	 * Returns the last exception thrown on the client side during a request.
	 *
	 * @return the last exception thrown
	 */
	public Exception getLastClientException() {
		return lastClientException;
	}

	/**
	 * Returns whether the reason for the last exception was a connection issue.
	 *
	 * @return true if it was connection issue, false
	 *         otherwise
	 */
	public boolean isConnectionIssue() {
		if (lastClientException instanceof ClientHandlerException) {
			if (lastClientException.getCause() instanceof ConnectException) {
				return true;
			}
		}
		return false;
	}

	/**
	 * Clears the cache deleting all data that was fetched from the server.
	 */
	public void clearCache() {
		// collections as a whole are returned or they are related,
		// so set to null after clear
		if (cachedSpotterConfParameters != null) {
			cachedSpotterConfParameters.clear();
			cachedSpotterConfParameters = null;
		}
		if (cachedSpotterConfParamsMap != null) {
			cachedSpotterConfParamsMap.clear();
			cachedSpotterConfParamsMap = null;
		}
		// only values of these maps are returned, so clear() is enough
		cachedExtensionNames.clear();
		cachedExtensionMetaobjects.clear();
		cachedExtensionConfParamters.clear();
		cachedExtensionDescriptions.clear();

		lastClearTime = System.currentTimeMillis();
	}

	/**
	 * Shows a message on the screen explaining the connection problem. If cause
	 * is not null it will be appended to the message.
	 *
	 * @param cause
	 *            The cause of the problem
	 * @param host
	 *            The host used for the connection
	 * @param port
	 *            The port used for the connection
	 * @param warning
	 *            true to show a warning only, otherwise an error
	 *            is shown
	 */
	public static void showConnectionProblemMessage(String cause, String host, String port, boolean warning) {
		String msg = String.format(ERR_MSG_CONN, host, port);
		if (cause != null) {
			msg += "\n\n" + cause;
		}
		if (warning) {
			DialogUtils.openWarning(DIALOG_TITLE, msg);
		} else {
			DialogUtils.openError(DIALOG_TITLE, msg);
		}
	}

	/**
	 * Handles an exception and stores the given exception which can then be
	 * retrieved later via {@link #getLastException()}.
	 *
	 * @param requestName
	 *            The name of the requester. This name is only used for logging.
	 * @param requestErrorMsg
	 *            The error message for the request failure. This message is
	 *            included in the screen message in case of a connection issue.
	 * @param exception
	 *            The exception thrown in the request
	 * @param style
	 *            the style how the exception should be communicated
	 * @param warning
	 *            true for warning, false for error
	 */
	private void handleException(String requestName, String requestErrorMsg, Exception exception, HandlerStyle style,
			boolean warning) {
		lastClientException = exception;

		if (style == HandlerStyle.SILENT) {
			return;
		}

		if (warning) {
			LOGGER.warn("{} request failed! Cause: {}", requestName, exception.toString());
		} else {
			LOGGER.error("{} request failed! Cause: {}", requestName, exception.toString());
		}

		if (style == HandlerStyle.LOG_ONLY) {
			return;
		}

		if (isConnectionIssue()) {
			showConnectionProblemMessage(requestErrorMsg, host, port, warning);
		} else {
			// illegal response state or server error
			String header = "DS Service returned with an error!";
			String message = exception.getMessage();
			if (message == null) {
				message = "Exception (" + exception.getClass().getName() + ") contains no message.";
			}
			String fullMessage = header + "\n\n" + message;
			if (warning) {
				DialogUtils.openWarning(DIALOG_TITLE, fullMessage);
			} else {
				DialogUtils.handleError(header, exception);
			}
		}
	}

	private Map<String, ConfigParameterDescription> initSpotterConfParamsMap() {
		Map<String, ConfigParameterDescription> map = new HashMap<String, ConfigParameterDescription>();
		Set<ConfigParameterDescription> settings = getConfigurationParameters();
		if (settings == null) {
			return null;
		}
		for (ConfigParameterDescription desc : settings) {
			map.put(desc.getName(), desc);
		}
		return map;
	}

	private String findExtensionDescription(Set<ConfigParameterDescription> confParams) {
		for (ConfigParameterDescription desc : confParams) {
			if (desc.getName().equals(ConfigParameterDescription.EXT_DESCRIPTION_KEY)) {
				return desc.getDefaultValue();
			}
		}
		return null;
	}

}


text:
extern JSClass  *jsb_cocos2d_extension_Control_class;
extern JSObject *jsb_cocos2d_extension_Control_prototype;

bool js_cocos2dx_extension_Control_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_extension_Control_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_extension_Control(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_extension(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_extension_Control_setEnabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_Control_getState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_Control_sendActionsForControlEvents(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_Control_setSelected(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_Control_isEnabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_Control_needsLayout(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_Control_hasVisibleParents(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_Control_isSelected(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_Control_isTouchInside(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_Control_setHighlighted(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_Control_getTouchLocation(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_Control_isHighlighted(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_Control_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_Control_Control(JSContext *cx, uint32_t argc, jsval *vp);

extern JSClass  *jsb_cocos2d_extension_ControlButton_class;
extern JSObject *jsb_cocos2d_extension_ControlButton_prototype;

bool js_cocos2dx_extension_ControlButton_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_extension_ControlButton_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_extension_ControlButton(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_extension(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_extension_ControlButton_isPushed(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_setTitleLabelForState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_setAdjustBackgroundImage(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_setTitleForState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_setLabelAnchorPoint(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_getLabelAnchorPoint(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_initWithBackgroundSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_getTitleTTFSizeForState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_setTitleTTFForState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_setTitleTTFSizeForState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_setTitleLabel(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_setPreferredSize(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_getCurrentTitleColor(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_setZoomOnTouchDown(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_setBackgroundSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_getBackgroundSpriteForState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_getHorizontalOrigin(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_initWithTitleAndFontNameAndFontSize(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_setTitleBMFontForState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_getScaleRatio(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_getTitleTTFForState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_getBackgroundSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_getTitleColorForState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_setTitleColorForState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_doesAdjustBackgroundImage(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_setBackgroundSpriteFrameForState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_setBackgroundSpriteForState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_setScaleRatio(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_getTitleBMFontForState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_getTitleLabel(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_getPreferredSize(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_getVerticalMargin(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_getTitleLabelForState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_setMargins(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_getCurrentTitle(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_initWithLabelAndBackgroundSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_getZoomOnTouchDown(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_getTitleForState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlButton_ControlButton(JSContext *cx, uint32_t argc, jsval *vp);

extern JSClass  *jsb_cocos2d_extension_ControlHuePicker_class;
extern JSObject *jsb_cocos2d_extension_ControlHuePicker_prototype;

bool js_cocos2dx_extension_ControlHuePicker_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_extension_ControlHuePicker_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_extension_ControlHuePicker(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_extension(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlHuePicker_setHue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlHuePicker_getStartPos(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlHuePicker_getHue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlHuePicker_getSlider(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlHuePicker_setBackground(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlHuePicker_setHuePercentage(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlHuePicker_getBackground(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlHuePicker_getHuePercentage(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlHuePicker_setSlider(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlHuePicker_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlHuePicker_ControlHuePicker(JSContext *cx, uint32_t argc, jsval *vp);

extern JSClass  *jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class;
extern JSObject *jsb_cocos2d_extension_ControlSaturationBrightnessPicker_prototype;

bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_extension_ControlSaturationBrightnessPicker_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_extension_ControlSaturationBrightnessPicker(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_extension(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getShadow(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPos(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getStartPos(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getOverlay(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSlider(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBackground(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSaturation(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBrightness(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_ControlSaturationBrightnessPicker(JSContext *cx, uint32_t argc, jsval *vp);

extern JSClass  *jsb_cocos2d_extension_ControlColourPicker_class;
extern JSObject *jsb_cocos2d_extension_ControlColourPicker_prototype;

bool js_cocos2dx_extension_ControlColourPicker_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_extension_ControlColourPicker_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_extension_ControlColourPicker(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_extension(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_extension_ControlColourPicker_hueSliderValueChanged(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlColourPicker_getHuePicker(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlColourPicker_getcolourPicker(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlColourPicker_setBackground(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlColourPicker_setcolourPicker(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlColourPicker_colourSliderValueChanged(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlColourPicker_setHuePicker(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlColourPicker_getBackground(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlColourPicker_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlColourPicker_ControlColourPicker(JSContext *cx, uint32_t argc, jsval *vp);

extern JSClass  *jsb_cocos2d_extension_ControlPotentiometer_class;
extern JSObject *jsb_cocos2d_extension_ControlPotentiometer_prototype;

bool js_cocos2dx_extension_ControlPotentiometer_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_extension_ControlPotentiometer_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_extension_ControlPotentiometer(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_extension(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_extension_ControlPotentiometer_setPreviousLocation(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlPotentiometer_setValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlPotentiometer_getProgressTimer(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlPotentiometer_getMaximumValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlPotentiometer_potentiometerBegan(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlPotentiometer_setMaximumValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlPotentiometer_getMinimumValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlPotentiometer_setThumbSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlPotentiometer_getValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlPotentiometer_getPreviousLocation(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlPotentiometer_potentiometerEnded(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlPotentiometer_setProgressTimer(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlPotentiometer_setMinimumValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlPotentiometer_getThumbSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlPotentiometer_initWithTrackSprite_ProgressTimer_ThumbSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlPotentiometer_potentiometerMoved(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlPotentiometer_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlPotentiometer_ControlPotentiometer(JSContext *cx, uint32_t argc, jsval *vp);

extern JSClass  *jsb_cocos2d_extension_ControlSlider_class;
extern JSObject *jsb_cocos2d_extension_ControlSlider_prototype;

bool js_cocos2dx_extension_ControlSlider_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_extension_ControlSlider_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_extension_ControlSlider(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_extension(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_extension_ControlSlider_setBackgroundSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_getMaximumAllowedValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_initWithSprites(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_getMinimumAllowedValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_getMaximumValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_getSelectedThumbSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_setProgressSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_setMaximumValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_getMinimumValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_setThumbSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_getValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_getBackgroundSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_getThumbSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_setValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_locationFromTouch(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_setMinimumValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_setMinimumAllowedValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_getProgressSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_setSelectedThumbSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_setMaximumAllowedValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSlider_ControlSlider(JSContext *cx, uint32_t argc, jsval *vp);

extern JSClass  *jsb_cocos2d_extension_ControlStepper_class;
extern JSObject *jsb_cocos2d_extension_ControlStepper_prototype;

bool js_cocos2dx_extension_ControlStepper_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_extension_ControlStepper_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_extension_ControlStepper(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_extension(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_extension_ControlStepper_getMinusSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_setValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_setStepValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_initWithMinusSpriteAndPlusSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_setValueWithSendingEvent(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_setMaximumValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_getMinusLabel(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_getPlusLabel(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_setWraps(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_setMinusLabel(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_startAutorepeat(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_updateLayoutUsingTouchLocation(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_isContinuous(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_stopAutorepeat(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_setMinimumValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_setPlusLabel(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_getValue(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_getPlusSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_setPlusSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_setMinusSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlStepper_ControlStepper(JSContext *cx, uint32_t argc, jsval *vp);

extern JSClass  *jsb_cocos2d_extension_ControlSwitch_class;
extern JSObject *jsb_cocos2d_extension_ControlSwitch_prototype;

bool js_cocos2dx_extension_ControlSwitch_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_extension_ControlSwitch_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_extension_ControlSwitch(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_extension(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_extension_ControlSwitch_setOn(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSwitch_locationFromTouch(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSwitch_isOn(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSwitch_initWithMaskSprite(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSwitch_hasMoved(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSwitch_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ControlSwitch_ControlSwitch(JSContext *cx, uint32_t argc, jsval *vp);

extern JSClass  *jsb_cocos2d_extension_ScrollView_class;
extern JSObject *jsb_cocos2d_extension_ScrollView_prototype;

bool js_cocos2dx_extension_ScrollView_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_extension_ScrollView_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_extension_ScrollView(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_extension(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_extension_ScrollView_isClippingToBounds(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_setContainer(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_setContentOffsetInDuration(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_setZoomScaleInDuration(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_updateTweenAction(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_setMaxScale(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_hasVisibleParents(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_getDirection(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_getContainer(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_setMinScale(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_getZoomScale(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_updateInset(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_initWithViewSize(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_pause(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_setDirection(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_stopAnimatedContentOffset(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_setContentOffset(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_isDragging(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_isTouchEnabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_isBounceable(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_setTouchEnabled(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_getContentOffset(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_resume(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_setClippingToBounds(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_setViewSize(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_getViewSize(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_maxContainerOffset(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_setBounceable(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_isTouchMoved(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_isNodeVisible(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_minContainerOffset(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_setZoomScale(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_ScrollView_ScrollView(JSContext *cx, uint32_t argc, jsval *vp);

extern JSClass  *jsb_cocos2d_extension_TableViewCell_class;
extern JSObject *jsb_cocos2d_extension_TableViewCell_prototype;

bool js_cocos2dx_extension_TableViewCell_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_extension_TableViewCell_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_extension_TableViewCell(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_extension(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_extension_TableViewCell_reset(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_TableViewCell_getIdx(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_TableViewCell_setIdx(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_TableViewCell_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_TableViewCell_TableViewCell(JSContext *cx, uint32_t argc, jsval *vp);

extern JSClass  *jsb_cocos2d_extension_TableView_class;
extern JSObject *jsb_cocos2d_extension_TableView_prototype;

bool js_cocos2dx_extension_TableView_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_extension_TableView_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_extension_TableView(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_extension(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_extension_TableView_updateCellAtIndex(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_TableView_setVerticalFillOrder(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_TableView_scrollViewDidZoom(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_TableView__updateContentSize(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_TableView_getVerticalFillOrder(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_TableView_removeCellAtIndex(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_TableView_initWithViewSize(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_TableView_scrollViewDidScroll(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_TableView_reloadData(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_TableView_insertCellAtIndex(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_TableView_cellAtIndex(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_TableView_dequeueCell(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_TableView_TableView(JSContext *cx, uint32_t argc, jsval *vp);

extern JSClass  *jsb_cocos2d_extension_EventAssetsManagerEx_class;
extern JSObject *jsb_cocos2d_extension_EventAssetsManagerEx_prototype;

bool js_cocos2dx_extension_EventAssetsManagerEx_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_extension_EventAssetsManagerEx_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_extension_EventAssetsManagerEx(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_extension(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_extension_EventAssetsManagerEx_getAssetsManagerEx(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_EventAssetsManagerEx_getAssetId(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_EventAssetsManagerEx_getCURLECode(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_EventAssetsManagerEx_getMessage(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_EventAssetsManagerEx_getCURLMCode(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_EventAssetsManagerEx_getPercentByFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_EventAssetsManagerEx_getEventCode(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_EventAssetsManagerEx_getPercent(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_EventAssetsManagerEx_EventAssetsManagerEx(JSContext *cx, uint32_t argc, jsval *vp);

extern JSClass  *jsb_cocos2d_extension_Manifest_class;
extern JSObject *jsb_cocos2d_extension_Manifest_prototype;

bool js_cocos2dx_extension_Manifest_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_extension_Manifest_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_extension_Manifest(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_extension(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_extension_Manifest_getManifestFileUrl(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_Manifest_isVersionLoaded(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_Manifest_isLoaded(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_Manifest_getPackageUrl(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_Manifest_getVersion(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_Manifest_getVersionFileUrl(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_Manifest_getSearchPaths(JSContext *cx, uint32_t argc, jsval *vp);

extern JSClass  *jsb_cocos2d_extension_AssetsManagerEx_class;
extern JSObject *jsb_cocos2d_extension_AssetsManagerEx_prototype;

bool js_cocos2dx_extension_AssetsManagerEx_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_extension_AssetsManagerEx_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_extension_AssetsManagerEx(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_extension(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_extension_AssetsManagerEx_getState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_AssetsManagerEx_checkUpdate(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_AssetsManagerEx_getStoragePath(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_AssetsManagerEx_update(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_AssetsManagerEx_getLocalManifest(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_AssetsManagerEx_getRemoteManifest(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_AssetsManagerEx_downloadFailedAssets(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_AssetsManagerEx_create(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_extension_AssetsManagerEx_AssetsManagerEx(JSContext *cx, uint32_t argc, jsval *vp);

extern JSClass  *jsb_cocos2d_extension_EventListenerAssetsManagerEx_class;
extern JSObject *jsb_cocos2d_extension_EventListenerAssetsManagerEx_prototype;

bool js_cocos2dx_extension_EventListenerAssetsManagerEx_constructor(JSContext *cx, uint32_t argc, jsval *vp);
void js_cocos2dx_extension_EventListenerAssetsManagerEx_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_extension_EventListenerAssetsManagerEx(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_extension(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_extension_EventListenerAssetsManagerEx_EventListenerAssetsManagerEx(JSContext *cx, uint32_t argc, jsval *vp);

#endif // __cocos2dx_extension_h__


text:
//==============================================================================
// Core GUI utilities
//==============================================================================

#pragma once

//==============================================================================

#include "coreglobal.h"
#include "filetypeinterface.h"

//==============================================================================

#include <QColor>
#include <QIcon>
#include <QKeySequence>
#include <QString>

//==============================================================================

class QAction;
class QFrame;
class QLabel;
class QMainWindow;
class QMenu;
class QWidget;

//==============================================================================

namespace OpenCOR {
namespace Core {

//==============================================================================

class CentralWidget;

//==============================================================================

#include "coreguiutils.h.inl"

//==============================================================================

CentralWidget CORE_EXPORT * centralWidget();

QString CORE_EXPORT getOpenFileName(const QString &pCaption,
                                    const QStringList &pFilters = QStringList(),
                                    QString *pSelectedFilter = 0);
QStringList CORE_EXPORT getOpenFileNames(const QString &pCaption,
                                         const QStringList &pFilters = QStringList(),
                                         QString *pSelectedFilter = 0);
QString CORE_EXPORT getSaveFileName(const QString &pCaption,
                                    const QString &pFileName,
                                    const QStringList &pFilters = QStringList(),
                                    QString *pSelectedFilter = 0);

QString CORE_EXPORT getExistingDirectory(const QString &pCaption,
                                         const QString &pDirName = QString(),
                                         const bool &pEmptyDir = false);

void CORE_EXPORT setFocusTo(QWidget *pWidget);

QMenu CORE_EXPORT * newMenu(const QString &pName, QWidget *pParent);
QMenu CORE_EXPORT * newMenu(const QIcon &pIcon, QWidget *pParent);

QAction CORE_EXPORT * newAction(const bool &pCheckable, const QIcon &pIcon,
                                const QKeySequence &pKeySequence,
                                QWidget *pParent);
QAction CORE_EXPORT * newAction(const bool &pCheckable, const QIcon &pIcon,
                                QWidget *pParent);
QAction CORE_EXPORT * newAction(const bool &pCheckable,
                                const QKeySequence &pKeySequence,
                                QWidget *pParent);
QAction CORE_EXPORT * newAction(const bool &pCheckable, QWidget *pParent);
QAction CORE_EXPORT * newAction(const QIcon &pIcon,
                                const QList<QKeySequence> &pKeySequences,
                                QWidget *pParent);
QAction CORE_EXPORT * newAction(const QIcon &pIcon,
                                const QKeySequence &pKeySequence,
                                QWidget *pParent);
QAction CORE_EXPORT * newAction(const QIcon &pIcon, QWidget *pParent);
QAction CORE_EXPORT * newAction(const QKeySequence &pKeySequence,
                                QWidget *pParent);
QAction CORE_EXPORT * newAction(const QKeySequence::StandardKey &pStandardKey,
                                QWidget *pParent);
QAction CORE_EXPORT * newAction(QWidget *pParent);

QFrame CORE_EXPORT * newLineWidget(const bool &pHorizontal,
                                   const QColor &pColor, QWidget *pParent);
QFrame CORE_EXPORT * newLineWidget(const bool &pHorizontal, QWidget *pParent);
QFrame CORE_EXPORT * newLineWidget(const QColor &pColor, QWidget *pParent);
QFrame CORE_EXPORT * newLineWidget(QWidget *pParent);

QString CORE_EXPORT iconDataUri(const QString &pIcon, const int &pWidth = -1,
                                const int &pHeight = -1,
                                const QIcon::Mode &pMode = QIcon::Normal);

void CORE_EXPORT showEnableWidget(QWidget *pWidget, const bool &pVisible,
                                  const bool &pEnabled = true);

QColor CORE_EXPORT lockedColor(const QColor &pColor);

QStringList CORE_EXPORT filters(const FileTypes &pFileTypes);
QStringList CORE_EXPORT filters(const FileTypes &pFileTypes,
                                const QStringList &pMimeTypes);

//==============================================================================

}   // namespace Core
}   // namespace OpenCOR

//==============================================================================
// End of file
//==============================================================================


text:
CXX=icpc

# Flags passed to the C++ compiler.
CXXFLAGS =-m64 -fast -xCORE-AVX-I -unroll -Wall -std=c++11 -std=c++0x -pthread

TESTS_DIR = tests
INCLUDE_DIR = ./include
SRC_DIR = src
LIB_DIR = lib
BIN_DIR = bin

MKLPATH   = $(MKLROOT)/lib/intel64
MKLINCLUDE = $(MKLROOT)/include

#dynamic linking
LAPACKLIB = -ldl -L$(MKLPATH) -I$(MKLINCLUDE) -mkl=sequential

all: susceptibility susceptibility_sc susceptibility_sc_square susceptibility_square rho_lieb rho_square test

susceptibility: common.o susceptibility.o
	xiar rcs $(LIB_DIR)/libsusceptibility.a $(SRC_DIR)/common.o $(SRC_DIR)/susceptibility.o
	$(CXX) $(CXXFLAGS) -static $(SRC_DIR)/X_q_Lieb.cc -I$(INCLUDE_DIR) -L$(LIB_DIR) -lsusceptibility -o $(BIN_DIR)/susceptibility

susceptibility_sc: common.o susceptibility_sc.o
	xiar rcs $(LIB_DIR)/libsusceptibility_sc.a $(SRC_DIR)/common.o $(SRC_DIR)/susceptibility_sc.o
	$(CXX) $(CXXFLAGS) -static $(SRC_DIR)/X_q_Lieb_sc.cc -I$(INCLUDE_DIR) -L$(LIB_DIR) -lsusceptibility_sc -o $(BIN_DIR)/susceptibility_sc

susceptibility_square: common.o susceptibility_square.o
	xiar rcs $(LIB_DIR)/libsusceptibility_square.a $(SRC_DIR)/common.o $(SRC_DIR)/susceptibility_square.o
	$(CXX) $(CXXFLAGS) $(SRC_DIR)/X_q_square.cc -I$(INCLUDE_DIR) -L$(LIB_DIR) -lsusceptibility_square -o $(BIN_DIR)/susceptibility_square

susceptibility_sc_square: common.o susceptibility_sc_square.o
	xiar rcs $(LIB_DIR)/libsusceptibility_sc_square.a $(SRC_DIR)/common.o $(SRC_DIR)/susceptibility_sc_square.o
	$(CXX) $(CXXFLAGS) $(SRC_DIR)/X_q_square_sc.cc -I$(INCLUDE_DIR) -L$(LIB_DIR) -lsusceptibility_sc_square -o $(BIN_DIR)/susceptibility_sc_square

test:
	(cd $(TESTS_DIR);$(MAKE))

rho_lieb: rho_lieb.o common.o $(INCLUDE_DIR)/common.h
	xiar rcs $(LIB_DIR)/librho.a $(SRC_DIR)/rho.o $(SRC_DIR)/common.o
	$(CXX) $(CXXFLAGS) -I$(INCLUDE_DIR) $(SRC_DIR)/rho_lieb.cc -L$(LIB_DIR) -lrho -o $(BIN_DIR)/rho_lieb

rho_square: rho_square.o common.o $(INCLUDE_DIR)/common.h
	xiar rcs $(LIB_DIR)/librho_square.a $(SRC_DIR)/rho_square.o $(SRC_DIR)/common.o
	$(CXX) $(CXXFLAGS) -I$(INCLUDE_DIR) $(SRC_DIR)/rho_square_generate.cc -L$(LIB_DIR) -lrho_square -o $(BIN_DIR)/rho_square

mean_field_phase_diagram: mean_field_phase_diagram.o mean_field.o common.o lapack_wrapper.o
	xiar rcs $(LIB_DIR)/libmean_field.a $(SRC_DIR)/common.o $(SRC_DIR)/mean_field.o $(SRC_DIR)/mean_field_phase_diagram.o $(SRC_DIR)/lapack_wrapper.o
	$(CXX) $(CXXFLAGS) -static -I$(INCLUDE_DIR) $(SRC_DIR)/mean_field_phase_diagram.cc -L$(LIB_DIR) $(LAPACKLIB) -lmean_field -o $(BIN_DIR)/create_mean_field_phase_diagram

common.o: $(SRC_DIR)/common.cc $(INCLUDE_DIR)/common.h
	$(CXX) $(CXXFLAGS) -c -I$(INCLUDE_DIR) $(SRC_DIR)/common.cc -o $(SRC_DIR)/common.o

lapack_wrapper.o: $(SRC_DIR)/lapack_wrapper.cc $(INCLUDE_DIR)/lapack_wrapper.h
	$(CXX) $(CXXFLAGS) -c -I$(INCLUDE_DIR) $(SRC_DIR)/lapack_wrapper.cc -o $(SRC_DIR)/lapack_wrapper.o

susceptibility.o: common.o
	$(CXX) $(CXXFLAGS) -c -I$(INCLUDE_DIR) $(SRC_DIR)/susceptibility.cc -o $(SRC_DIR)/susceptibility.o

rho_lieb.o: common.o
	$(CXX) $(CXXFLAGS) -c -I$(INCLUDE_DIR) $(SRC_DIR)/rho.cc -o $(SRC_DIR)/rho.o

rho_square.o: common.o
	$(CXX) $(CXXFLAGS) -c -I$(INCLUDE_DIR) $(SRC_DIR)/rho_square.cc -o $(SRC_DIR)/rho_square.o

susceptibility_sc.o: common.o
	$(CXX) $(CXXFLAGS) -c -I$(INCLUDE_DIR) $(LAPACKLIB) $(SRC_DIR)/susceptibility_sc.cc -o $(SRC_DIR)/susceptibility_sc.o

susceptibility_sc_square.o: common.o
	$(CXX) $(CXXFLAGS) -c -I$(INCLUDE_DIR) $(LAPACKLIB) $(SRC_DIR)/susceptibility_sc_square.cc -o $(SRC_DIR)/susceptibility_sc_square.o

susceptibility_square.o: common.o
	$(CXX) $(CXXFLAGS) -c -I$(INCLUDE_DIR) $(LAPACKLIB) $(SRC_DIR)/susceptibility_square.cc -o $(SRC_DIR)/susceptibility_square.o

mean_field.o:
	$(CXX) $(CXXFLAGS) -c -I$(INCLUDE_DIR) $(LAPACKLIB) $(SRC_DIR)/mean_field.cc -o $(SRC_DIR)/mean_field.o

mean_field_phase_diagram.o: $(SRC_DIR)/mean_field_phase_diagram.cc $(INCLUDE_DIR)/mean_field_phase_diagram.h mean_field.o common.o
	$(CXX) $(CXXFLAGS) -c -I$(INCLUDE_DIR) $(LAPACKLIB) $(SRC_DIR)/mean_field_phase_diagram.cc -o $(SRC_DIR)/mean_field_phase_diagram.o


text:
class Category < ApplicationRecord

  has_many :expenses, dependent: :destroy

  validates :name, presence: true

end


text:
package com.raizlabs.android.dbflow.annotation;

/**
 * Represents a SQL Collate method for comparing string columns.
 */
public enum Collate {

    /**
     * Tells the table creation and condition that we wont use collation
     */
    NONE,

    /**
     * Compares string data normally
     */
    BINARY,

    /**
     * Ignores case for the 26 upper case characters of ASCII are folded to lower case equivalents.
     * Does not attempt to fold UTF so be careful!
     */
    NOCASE,

    /**
     * Trims trailing space characters before performing comparison.
     */
    RTRIM,

    /**
     * Takes the current locale data into account.
     */
    LOCALIZED,

    /**
     * The Unicode Collation Algorithm and not tailored to the current locale.
     */
    UNICODE
}


text:
/*
FPF - Frame Processing Framework
See the file COPYING for copying permission.
*/
/*
CNode_CADUdump - dumper of TF (CADU) frame structures

History:
    created: 2015-11 - A.Shumilin.
*/

#ifndef CNODE_CADUDUMP_H
#define CNODE_CADUDUMP_H
#include <fstream>
#include "fpf.h"

#define  FACTORY_CNODE_CADUDUMP(c) FACTORY_ADD_NODE(c,CNode_CADUdump)

class CNode_CADUdump : public INode
{
enum t_dump_formats { FORMAT_LINES_SHORT = 1 , FORMAT_LINES_LONG, FORMAT_BLOCK };

    public:
        CNode_CADUdump();
        virtual ~CNode_CADUdump();
        //INode
        bool init(t_ini& ini, string& name, CChain* chain);
        void start(void);
        void stop(void);
        void close(void);
        void take_frame(CFrame* pf);
    protected:
    private:
        ostream* output;
        ofstream outfile;
        int trace_every;
        unsigned long c_counter;
        t_dump_formats dump_format ;
        bool use_hex;
        bool dump_times;
        int tf_version;
        string outfile_name;
        unsigned long c_dumped;
        //
        void do_frame_processing(CFrame* pf);

};
#endif // CNODE_CADUDUMP_H


text:
<?php

namespace Camelearn\MainBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class UserController extends Controller
{
    public function getParentAccountCreationFormAction()
    {
        return $this->render('CamelearnMainBundle:UserManagement:parentEditionPage.html.twig');
    }
}


text:
package soamodel;

/**
 *
 * A representation of the model object 'Rest Method'.
 *
 *
 *

 * The following features are supported:
 *

 *
{@link soamodel.RestMethod#getHttpMethod Http Method}

 *
{@link soamodel.RestMethod#getPath Path}

 *

 *

 *
 * @see soamodel.SoamodelPackage#getRestMethod()
 * @model
 * @generated
 */
public interface RestMethod extends ServiceMethod {
	/**
	 * Returns the value of the 'Http Method' attribute.
	 * The literals are from the enumeration {@link soamodel.HttpMethod}.
	 *
	 *

	 * If the meaning of the 'Http Method' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Http Method' attribute.
	 * @see soamodel.HttpMethod
	 * @see #setHttpMethod(HttpMethod)
	 * @see soamodel.SoamodelPackage#getRestMethod_HttpMethod()
	 * @model required="true"
	 * @generated
	 */
	HttpMethod getHttpMethod();

	/**
	 * Sets the value of the '{@link soamodel.RestMethod#getHttpMethod Http Method}' attribute.
	 *
	 *
	 * @param value the new value of the 'Http Method' attribute.
	 * @see soamodel.HttpMethod
	 * @see #getHttpMethod()
	 * @generated
	 */
	void setHttpMethod(HttpMethod value);

	/**
	 * Returns the value of the 'Path' attribute.
	 *
	 *

	 * If the meaning of the 'Path' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Path' attribute.
	 * @see #setPath(String)
	 * @see soamodel.SoamodelPackage#getRestMethod_Path()
	 * @model
	 * @generated
	 */
	String getPath();

	/**
	 * Sets the value of the '{@link soamodel.RestMethod#getPath Path}' attribute.
	 *
	 *
	 * @param value the new value of the 'Path' attribute.
	 * @see #getPath()
	 * @generated
	 */
	void setPath(String value);

} // RestMethod


text:
package org.data2semantics.platform.core;

import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.maven.model.Dependency;
import org.data2semantics.platform.core.data.DataType;
import org.data2semantics.platform.core.data.Input;
import org.data2semantics.platform.core.data.JavaType;
import org.data2semantics.platform.core.data.MultiInput;
import org.data2semantics.platform.core.data.Output;
import org.data2semantics.platform.core.data.RawInput;
import org.data2semantics.platform.core.data.ReferenceInput;
import org.data2semantics.platform.domain.Domain;
import org.data2semantics.platform.exception.InconsistentWorkflowException;

/**
 * This class represents a workflow. We guarantee the following:
 *
 *

 *
After creation, a the object represents a consistent workflow.

 *
The modules are sorted by rank, and can be executed in order.

 *

 *
 * The workflow class is immutable.
 *
 *
 * @author Peter
 *
 */
public final class Workflow implements Serializable{

	// * Map from names to modules
	private Map<String, WorkflowBuilder.ModuleImpl> modules = new LinkedHashMap<String, WorkflowBuilder.ModuleImpl>();

	private ArrayList<Module> sortedList = null;

	private transient List<Dependency> dependencies = new ArrayList<Dependency>();
	/**
	 * Name of this workflow
	 */
	private String name;

	private File file;

	private Workflow() {

	}

	public void setDependencies(List<Dependency> dependencies){
		this.dependencies = dependencies;
	}

	public List<Dependency> getDependencies(){
		return dependencies;
	}

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

	public File file() {
		return file;
	}
	/**
	 * Returns modules within a workflow, sorted according to their ranks.
	 * This means that iterating through this modules would start with the one with the lowest ranks,
	 * Which in turns means the first ones, with lowest ranks, are the ones without dependency.
	 * @return
	 */
	public List<Module> modules(){
			if(sortedList != null) return sortedList;

			sortedList = new ArrayList<Module>(modules.values());
			Collections.sort(sortedList, new ModuleComparator());
			return sortedList;
	}

	public Module getModuleByName(String name){
		return modules.get(name);
	}

	/**
	 * Compare modules based on their ranks.
	 * @author Adianto
	 *
	 */

	private class ModuleComparator implements Comparator<Module>
	{

		public int compare(Module first, Module second)
		{
			return Double.compare(first.rank(), second.rank());
		}
	}

	public static WorkflowBuilder builder()
	{
		return new WorkflowBuilder();
	}

	/**
	 * A builder class to construct workflows
	 *
	 * TODO: How to communicate a list of references or a list of mixed raw
	 * values and references?
	 *
	 * @author Peter
	 *
	 */
	public static class WorkflowBuilder
	{
		private boolean dead = false;

		// * Cached references (stored until all modules have been created).
		private List<List<Object>> references = new ArrayList<List<Object>>();

		private List<List<Object>> multiReferences = new ArrayList<List<Object>>();

		private Workflow workflow;

		private WorkflowBuilder()
		{
			workflow = new Workflow();
		}

		/**
		 * Add a module to the workflow
		 *
		 * @param name
		 * @return
		 */
		public WorkflowBuilder module(String name, Domain domain)
		{
			check();

			if(! workflow.modules.containsKey(name))
				workflow.modules.put(name, new ModuleImpl(workflow, name, domain));
			else
				throw new IllegalArgumentException("Module ("+name+") already exists.");

			return this;
		}

		public WorkflowBuilder name(String name)
		{
			check();
			workflow.name = name;
			return this;
		}

		public WorkflowBuilder file(File file)
		{
			check();
			workflow.file = file;
			return this;
		}

		public WorkflowBuilder source(String moduleName, String source)
		{
			check();
			if(! workflow.modules.containsKey(moduleName))
				throw new IllegalArgumentException("Module ("+moduleName+") does not exist.");

			ModuleImpl module = workflow.modules.get(moduleName);
			module.setSource(source);

			return this;
		}

		/**
		 * Add an atomic value to the workflow
		 *
		 * @param module
		 * @param name
		 * @param value
		 * @return
		 */
		public WorkflowBuilder rawInput(String moduleName, String description, String name, Object value, DataType type, boolean print)
		{
			check();
			if(! workflow.modules.containsKey(moduleName))
				throw new IllegalArgumentException("Module ("+moduleName+") does not exist.");

			ModuleImpl module = workflow.modules.get(moduleName);
			module.addInput(name, description, value, type, print);

			return this;
		}

		/**
		 * Add a multivalue input to the workflow
		 *
		 * @param module
		 * @param name
		 * @param value
		 * @return
		 */
		public WorkflowBuilder multiInput(String moduleName, String description, String name, List<?> value, DataType inputDataType, boolean print)
		{
			check();
			if(! workflow.modules.containsKey(moduleName))
				throw new IllegalArgumentException("Module ("+moduleName+") does not exist.");

			ModuleImpl module = workflow.modules.get(moduleName);
			module.addMultiInput(name, description, value, inputDataType, print);

			return this;
		}

		public WorkflowBuilder multiInputRef(String moduleName, String description, String inputName, List<?> value, DataType inputDataType, boolean print)
		{
			check();
			if(! workflow.modules.containsKey(moduleName))
				throw new IllegalArgumentException("Module ("+moduleName+") does not exist.");

			multiReferences.add(Arrays.asList(moduleName, inputName, description, value, inputDataType, print));

			return this;
		}

		/**
		 * Add a reference input to the workflow
		 * @param module
		 * @param name
		 * @param reference
		 * @return
		 */
		public WorkflowBuilder refInput(String moduleName, String inputName, String description, String referencedModule, String referencedOutput, DataType inputType, boolean print)
		{
			check();
			if(! workflow.modules.containsKey(moduleName))
				throw new IllegalArgumentException("Module ("+moduleName+") does not exist.");

			references.add(Arrays.asList(moduleName, inputName, description, referencedModule, referencedOutput, inputType, print));

			return this;
		}

		public WorkflowBuilder output(String moduleName, String name, String description, DataType type, boolean print)
		{
			check();
			if(! workflow.modules.containsKey(moduleName))
				throw new IllegalArgumentException("Module ("+moduleName+") does not exist.");

			ModuleImpl module = workflow.modules.get(moduleName);
			module.addOutput(name, description, type, print);

			return this;
		}

		public WorkflowBuilder coupledInputs(String moduleName, List<String> coupledInputs)
		{
			check();
			if(! workflow.modules.containsKey(moduleName))
				throw new IllegalArgumentException("Module ("+moduleName+") does not exist.");

			ModuleImpl module = workflow.modules.get(moduleName);
			module.addCoupledInputs(coupledInputs);

			return this;
		}

		public WorkflowBuilder datasetsInputs(String moduleName, List<String> datasetInputs){
			check();
			if(! workflow.modules.containsKey(moduleName))
				throw new IllegalArgumentException("Module ("+moduleName+") does not exist.");

			ModuleImpl module = workflow.modules.get(moduleName);
			module.addDataSets(datasetInputs);

			return this;
		}

		public WorkflowBuilder aggregatorsInputs(String moduleName, List<String> aggregatorInputs){
			check();
			if(! workflow.modules.containsKey(moduleName))
				throw new IllegalArgumentException("Module ("+moduleName+") does not exist.");

			ModuleImpl module = workflow.modules.get(moduleName);
			module.addAggregators(aggregatorInputs);

			return this;
		}

		public WorkflowBuilder resultOutputs(String moduleName, List<String> resultOutputs){
			check();
			if(! workflow.modules.containsKey(moduleName))
				throw new IllegalArgumentException("Module ("+moduleName+") does not exist.");

			ModuleImpl module = workflow.modules.get(moduleName);
			module.addResults(resultOutputs);

			return this;
		}

		/**
		 * Returns the workflow object
		 *
		 * Note that this method should be called only once. After it has been
		 * called, the @WorkflowBuilder will "die", and a call to any of its
		 * methods will results in an exception.
		 *
		 * @return
		 */
		public Workflow workflow()
		{
			List<String> errors = new ArrayList<String>();

			if(! consistent(errors))
				throw new InconsistentWorkflowException(errors);

			for(List<Object> reference : references)
			{
				String moduleName = (String) reference.get(0),
				       inputName = (String) reference.get(1),
				       description = (String) reference.get(2),
				       refModuleName = (String) reference.get(3),
				       refOutputName = (String) reference.get(4);

				DataType type = (DataType) reference.get(5);
				boolean print = (Boolean) reference.get(6);

				ModuleImpl module = workflow.modules.get(moduleName),
				           refModule = workflow.modules.get(refModuleName);

				Output refOutput = refModule.output(refOutputName);
				Domain inputDomain = module.domain();

				DataType outputType = refOutput.dataType();
				module.addRefInput(inputName, description, refOutput, type, false, print);

				if(inputDomain.typeMatches(refOutput, module.input(inputName))){
					// Single reference input case
					((ReferenceInput) module.input(inputName)).setMultiValue(false);

				} else
				if(isList(outputType)){
					((ReferenceInput) module.input(inputName)).setMultiValue(true);

				} else
					throw new InconsistentWorkflowException("Input type of "+moduleName + "."+inputName+" ("+module.input(inputName).dataType()+") and output type "+refModuleName+"."+refOutputName+" ("+outputType+") does not match ");

			}

			for(List<Object> multiRef : multiReferences){
				String  moduleName 	= (String) multiRef.get(0),
						inputName 	= (String) multiRef.get(1),
						description = (String) multiRef.get(2);

				List<?> multiValues = (List<?>) multiRef.get(3);
				DataType inputType = (DataType) multiRef.get(4);
				boolean print = (Boolean) multiRef.get(5);

				ModuleImpl module = workflow.modules.get(moduleName);

				module.addMultiRefInput(inputName, description, multiValues, inputType, print);

			}

			// Set boolean flag for individual inputs and outputs
			for (Module m : workflow.modules()){
				for(Input i : m.inputs()){
					i.dataset(m.isInputDataSet(i.name()));
					i.aggregator(m.isInputAggregator(i.name()));
				}
				for(Output o : m.outputs()) {
					o.result(m.isOutputResult(o.name()));
				}
			}

			// * Kill the WorkflowBuilder
			Workflow result = workflow;
			dead = true;
			workflow = null;

			return result;
		}

		private static boolean isList(DataType outputType) {
			if(!(outputType instanceof JavaType)) return false;
			JavaType jType = (JavaType)outputType;
			return List.class.isAssignableFrom(jType.clazz());
		}

		/**
		 * Determines whether the builder currently represents a consistent,
		 * runnable workflow.
		 */
		public boolean consistent(List<String> errors)
		{
			int eSize = errors.size();

			if(workflow.name == null)
				errors.add("Workflow name not set.");

			for(List<Object> reference : references)
			{
				String moduleName = (String) reference.get(0),
				       inputName = (String) reference.get(1),
				       description = (String) reference.get(2),
				       referencedModule = (String) reference.get(3),
				       referencedOutput = (String) reference.get(4);

				if(! workflow.modules.containsKey(moduleName))
					errors.add("Module ("+moduleName+") does not exist.");

				if(! workflow.modules.containsKey(referencedModule))
					errors.add("Module ("+referencedModule+") does not exist, referenced by "+inputName + " " + description);
				else if(! workflow.modules.get(referencedModule).hasOutput(referencedOutput))
					errors.add("Referenced module ("+referencedModule+") does not have output "+referencedOutput+".");

			}

			for(List<Object> multiRef : multiReferences){
				String  moduleName 	= (String) multiRef.get(0),
						inputName 	= (String) multiRef.get(1),
						description = (String) multiRef.get(2);
				List<?> multiValues = (List<?>) multiRef.get(3);

				if(! workflow.modules.containsKey(moduleName))
					errors.add("Module ("+moduleName+") does not exist.");

				for(Object value : multiValues){
					if(value instanceof Map){

						@SuppressWarnings("unchecked")
						Map<String,String> ref = (Map <String,String>) value;
						String referenceString = (String) ref.get("reference");

						// Reference is in : module.output format, we split using .
						String referencedModule = referenceString.split("\\.")[0];
						String referencedOutput = referenceString.split("\\.")[1];
						if(! workflow.modules.containsKey(referencedModule))
							errors.add("Module ("+referencedModule+") does not exist, referenced by "+inputName + " " + description);
						else if(! workflow.modules.get(referencedModule).hasOutput(referencedOutput))
							errors.add("Referenced module ("+referencedModule+") does not have output "+referencedOutput+".");

					}
				}

			}

			return eSize == errors.size();

		}

		private void check()
		{
			if(dead)
				throw new IllegalStateException("This workflowbuilder is dead. The method workflow has been called.");
		}

		private static class ModuleImpl extends AbstractModule implements Serializable
		{

			public ModuleImpl(){

			}

			public ModuleImpl(Workflow workflow, String name, Domain domain)
			{
				super(workflow, domain);
				this.name = name;
			}

			public void addDataSets(List<String> datasetInputs) {
				dataSets.addAll(datasetInputs);
			}

			public void addAggregators(List<String> aggregatorInputs) {
				aggregators.addAll(aggregatorInputs);
			}

			public void addResults(List<String> resultOutputs) {
				results.addAll(resultOutputs);
			}

			public void addCoupledInputs(List<String> cInputs){
				Set<String> coupledSet = new HashSet<String>(cInputs);
				for(String inputName : coupledSet)
				coupledInputs.put(inputName, coupledSet);
			}

			public void addMultiRefInput(
					String inputName, String description,
					List<?> multiValues, DataType inputType,
					boolean print) {
				List< Input> multiInputRefs = new ArrayList<Input>();

				for(Object value : multiValues){
					if(value instanceof Map){

						@SuppressWarnings("unchecked")
						Map<String,String> ref = (Map<String,String>) value;
						String referenceString = (String) ref.get("reference");

						// Reference is in : module.output format, we split using .
						String referencedModule = referenceString.split("\\.")[0];
						String referencedOutput = referenceString.split("\\.")[1];

				        Module  refModule = workflow.modules.get(referencedModule);

				        Output refOutput = refModule.output(referencedOutput);

				        ReferenceInput newInput = new ReferenceInput(this, inputName, description, inputType, refOutput, false, print);

				        if(domain().typeMatches(refOutput, newInput))
				        	newInput.setMultiValue(false);
				        else
				        if(isList(refOutput.dataType())){
				        	newInput.setMultiValue(true);
					    }
				        multiInputRefs.add(newInput);

					} else {

						RawInput newInput = new RawInput(value, inputName, description, inputType, this, print);
						multiInputRefs.add(newInput);
					}
				}

				inputs.put(inputName, new MultiInput(inputName, description, inputType, this, multiInputRefs, print));
			}

			public void addRefInput(String inputName, String description, Output referencedOutput, DataType type, boolean multiRef, boolean print)
			{

				if(inputs.containsKey(inputName))
					throw new IllegalArgumentException("Module ("+name()+") already contains input with the given name ("+inputName+")");

				inputs.put(inputName,
						new ReferenceInput(this, inputName, description, type, referencedOutput, multiRef, print));
			}

			public boolean hasOutput(String output)
			{
				return outputs.containsKey(output);
			}

			public void addOutput(String name, String description, DataType type, boolean print)
			{
				if(outputs.containsKey(name))
					throw new IllegalArgumentException("Module ("+name()+") already contains output with the given name ("+name+")");

				outputs.put(name, new Output(name, description, this, type, print));
			}

			public void setSource(String source)
			{
				this.source = source;
			}

			@SuppressWarnings("unused")
			public void setDomain(Domain domain){
				this.domain = domain;
			}

			public void addMultiInput(String name, String description, List<?> values, DataType type, boolean print)
			{
				if(inputs.containsKey(name))
					throw new IllegalArgumentException("Module ("+name()+") already contains input with the given name ("+name+")");

				List<RawInput> rawInputs = new ArrayList<RawInput>(values.size());
				for(Object value : values)
					rawInputs.add(new RawInput(value, name, description,  type, this, print));

				inputs.put(name, new MultiInput(name, description, type, this, rawInputs, print));
			}

			public void addInput(String name, String description, Object value, DataType type, boolean print)
			{
				if(inputs.containsKey(name))
					throw new IllegalArgumentException("Module ("+name()+") already contains input with the given name ("+name+")");

				inputs.put(name, new RawInput(value,  name, description,  type, this, print));
			}

			@Override
			public boolean isInputDataSet(String inputName) {
				return dataSets.contains(inputName);
			}

			@Override
			public boolean isOutputResult(String outputName) {
				return results.contains(outputName);
			}

			@Override
			public boolean isInputAggregator(String inputName) {
				return aggregators.contains(inputName);
			}

			@Override
			public void instances(List<ModuleInstance> remoteInstances) {
				instances = remoteInstances;
			}
		}

	}

}


text:
(function(global){

    var di = {

        _dependencies: {},

        _toRegister: {},

        process: function(target) {
            var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m,
                FN_ARG_SPLIT = /,/,
                FN_ARG = /^\s*(_?)(\S+?)\1\s*$/,
                STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,
                text = target.toString(),
                args = text.match(FN_ARGS)[1].split(/\s*,\s*/);

            return target.apply(target, this.getDependencies(args));
        },

        getDependencies: function(arr) {
            var self = this,
                dep = arr.map(function(value) {
                    // if the dependency has been queued for registration, but hasn't been registered yet,
                    // force the registration process
                    if(!self._dependencies.hasOwnProperty(value) && self._toRegister.hasOwnProperty(value)) {
                        self._register(value, self._toRegister[value]);
                    }

                    return self._dependencies[value];
                });
            return dep;
        },

        _register: function(name, dependency) {
            this._dependencies[name] = this.util.isFn(dependency) ? di.process(dependency) : dependency;
        },

        register: function(name, dependency) {
            this._toRegister[name] = dependency;
        },

        util: {
            isFn: function(fn) {
                return typeof fn == 'function';
            }
        }

    };

    // give back Ceaser what's Ceaser's
    global.dragonInjector = di;
})(this);

// demo
(function(di, global, undefined) {
	// an example that shows the DI magic

	// this is a dog
    di.register('dog', function dog() {
        return "I'm a dog";
    });

	// this is a cat
    di.register('cat', function cat() {
        return "I'm a cat";
    });

	// this is a smart dude, but he needs
	// a dog and acat in order to be smart
	// note: you can alter the number/order
	// of the arguments and see it's still working
    di.register('smartyPants', function smartyPants(a, b, cat, dog, e, f) {
        return 'the dog says: "' + dog + '", \nwhile the cat says: "'+ cat +'"';
    });

    di.process(function(smartyPants) {
        console.log('The smartyPants guy sais:\n' + smartyPants);
    });

    // another example

    // you can hijack jQuery
    // by registering a function as $
    di.register('$', function() {
        return function() {
            alert('hijacked jQuery!');
        };
    });

    // and use that function instead of the normal jQuery
    di.process(function($) {
        $('selector');
    });

})(this.dragonInjector, this);


text:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <remote  name="origin"
           fetch=".." />

  <default revision="refs/heads/master"
           remote="origin"
           sync-j="4" />

  <!-- Main app -->
  <project name="BleToolbox" remote="origin" path="app/BleToolbox"/>

  <!-- Lib list-->
  <project name="loglib" remote="origin" path="libs/loglib"/>
  <project name="rxpermlib" remote="origin" path="libs/rxpermlib"/>
  <project name="utils" remote="origin" path="libs/utils"/>
  <project name="blescanner" remote="origin" path="libs/blescanner"/>
  <project name="otalib" remote="origin" path="libs/otalib"/>
  <project name="ccparser" remote="origin" path="libs/ccparser"/>
  <project name="unityahrs" remote="origin" path="libs/unityahrs"/>

</manifest>