text:
Urban planners used to see lines in the human canvas of America's cities. They used to see a series of communities and tribes, clustered and separately identifiable, each with its own history, customs and rights. This view of lines is antiquated in the equality-minded planning policy of today, theoretically blind to race, ethnicity and ancestry.

But the lines remain.

This project began as a recreation of [a 1976 map representing Chicago's racial and ancestral groups ca. 1950](https://upload.wikimedia.org/wikipedia/commons/b/b5/Chicago_Demographics_in_1950_Map.jpg). It expanded to include the complex picture that the original mapmakers missed - where the lines are blurry and where they seem fixed in the asphalt still. These updated maps incorporate the observations of [Jane Jacobs](https://en.wikipedia.org/wiki/The_Death_and_Life_of_Great_American_Cities#City_neighborhoods) and [Ta-Nehisi Coates](http://www.theatlantic.com/magazine/archive/2014/06/the-case-for-reparations/361631/); they show where people are coming together and where they are still separated by invisible lines.

### Then:
![original](original.png)

### Now:
![current](nyc_tribes.png)

## Methods
This is a tough map to recreate with 21st century data. The reason for using an aggregate approach is that the census [only reports ancestry for slightly more than half of the US population](http://factfinder.census.gov/faces/tableservices/jsf/pages/productview.xhtml?pid=ACS_13_5YR_B04001&prodType=table), including in configurations that fail to represent whole racial/ethnic groups, which are in turn detailed on other tables. In order to capture the conceptual spirit and geographic detail of the original map, it is worthwhile to combine the two in the most-representative way possible.

This map draws from [99 distinct ancestry/race/ethnicity/origin categories from across 5 census tables](data/census_community_fields.csv) to produce maps [like this](data/communities_17_031.geojson).

## Data sources
 - [Census TIGER geographic boundaries - tract-level](data/cook_county_blocks.geojson)
 - [Census API SF1 and ACS](https://api.census.gov/data/2010/sf1/variables.html)
 - [OpenStreetmap reference data via Mapbox](http://www.openstreetmap.org/)

## Processing steps
 1. [Hit the Census API for tabular data](processing/pull/index.js)
 2. Add `largest_group` aggregate field, populated with largest ancestry/racial/ethnic group in each census tract by proportion of the population; retain proportion stats
 3. Add plurality and population density
 4. Get geodata
 5. Join tract geometries, `community`, ancestry and race tables on geoid
 6. Delete empty tracts
 7. Expand block boundaries by 50m, dissolve, then erode by 150m and simplify a bit for cartographic effect
 8. Map [according to original style](cartography/redlines.tm2/style.mss) with additional small multiples and supporting charts

## Usage

### Dependencies
_(Sorry, things got out of hand)_

- [node.js](https://nodejs.org/en/)
- [GDAL/OGR](http://trac.osgeo.org/gdal/wiki/DownloadingGdalBinaries)
- [PostGIS](http://postgis.org)
- [csvkit](http://csvkit.readthedocs.org/en/540/)
- [Mapbox CLI](https://github.com/mapbox/mapbox-cli-py#upload)
- [Mapbox Studio Classic](https://www.mapbox.com/mapbox-studio-classic/#darwin) (Gotta have that CartoCSS)
- [Mercantile](https://github.com/mapbox/mercantile/blob/master/docs/cli.rst)
- [geojson-merge](https://github.com/mapbox/geojson-merge)
- [phantomjs](http://phantomjs.org/screen-capture.html) (to capture chart images)
- Census [API key](https://api.census.gov/data/key_signup.html)
- [jq](https://stedolan.github.io/jq/) for json parsing in bash

In theory this will work for any county in the country. Set location parameters as arguments in the order below:

```bash
bash build_communities.sh <state abbreviation (e.g. 'MA')> <county name (e.g. 'Suffolk')>
```

e.g. this:
```
bash build_communities.sh MA Suffolk
```
 . . . will get you a map of Suffolk county (Boston), MA

## Assumptions (a running list)
 - __Meta-assumption: ancestry can be inferred by race.__ This is a dramatic oversimplification, to say the least.
 - Census categories that dance around race, ancestry and ethnicity can be coherently flattened to a non-overlapping set of categories.
 - Counting multiple races as multiple people is legit, when trying to show community membership.
 - Asian and Hispanic/Latino groups can be represented by race in the absence of ancestral categories encompassing them.
 - In majority-black census blocks, "American" ancestry refers almost exclusively to African-Americans.
 - The "Mixed" racial group in a block is adequately represented by the largest ancestral group in the containing tract.
 - Margin of error can be ignored.
 - To make it under the API limit (50 variables), the smallest-population groups (<100,000 nationally) may be ignored.
 - Religion-based communities (e.g. Jewish, Mennonite) may be excluded; the Census does not collect information on religious practice.


text:
/* The function system_user_schema.util_inaction_logout looks at all logged in
* users and logs them out if there has been no action in a defined time interval.
*
* Its _inaction_interval parametrer specifies the inaction perod, in minutes
* after which the user is logged out
*/

CREATE OR REPLACE FUNCTION system_user_schema.util_inaction_logout (_inaction_interval integer) RETURNS integer
AS $$

DECLARE

	_integer_var integer;

	_timestamp_now	timestamp;

	_sysuser_id	uuid;
	_login	text;
	_datetime_last_active	timestamp;

	_users_cur CURSOR FOR SELECT sysuser_id, login, datetime_last_active
						FROM	system_user_schema.system_user_last_active
						ORDER BY datetime_last_active;

	_minutes_inactive	integer;

BEGIN

--	WHILE 1 < 2 LOOP

		_timestamp_now := (SELECT clock_timestamp());
		RAISE NOTICE 'current timestamp at loop start is %', _timestamp_now;
		_integer_var := (SELECT COUNT (*) FROM system_user_schema.system_user_last_active);
		RAISE NOTICE 'rows in system_user_last_active at loop start = %', _integer_var;

		OPEN _users_cur;
		LOOP
			FETCH _users_cur INTO _sysuser_id, _login, _datetime_last_active;
			if not found then
				exit;
			end if;

			_timestamp_now := (SELECT clock_timestamp());

			_minutes_inactive := (SELECT extract (minutes from (_timestamp_now - _datetime_last_active))::integer);
			RAISE NOTICE 'for login, %, current timestamp is %, _datetime_last_active = %, _minutes_inactive = % ', _login, _timestamp_now, _datetime_last_active, _minutes_inactive;
			RAISE NOTICE 'For _inaction_interval = %, test _minutes_inactive > _inaction_interval = %', _inaction_interval, (_minutes_inactive > _inaction_interval);
			IF _minutes_inactive > _inaction_interval THEN

				RAISE NOTICE 'In IF _minutes_inactive > _inaction_interval for % --- %', _login, _sysuser_id;

				UPDATE	system_user_schema.system_user_state
				   SET
						user_state = 'Timed Out',
						datetime_state_started = LOCALTIMESTAMP (0)
				WHERE	sysuser_id = _sysuser_id
				;
				GET DIAGNOSTICS _integer_var = ROW_COUNT;
				RAISE NOTICE 'rows updated = %', _integer_var;

				DELETE FROM system_user_schema.system_user_last_active
				WHERE sysuser_id = _sysuser_id
				;
				GET DIAGNOSTICS _integer_var = ROW_COUNT;
				RAISE NOTICE 'rows deleted = %', _integer_var;

				_integer_var := (SELECT COUNT (*) FROM system_user_schema.system_user_last_active);
				RAISE NOTICE 'rows in system_user_last_active at END IF = %', _integer_var;

			END IF;

		END LOOP;
		CLOSE _users_cur;

	--	PERFORM pg_sleep (60);

	--END LOOP;

	RETURN 0;

END;
$$ LANGUAGE plpgsql;

redpajama_set_name: RedPajamaGithub


text:
The easiest way of starting a new project using ABP with **ASP.NET Core MVC** is to create a template on the [download page](/Templates). After creating and downloading your project, follow the steps below to run your application.

-   Open your solution in **Visual Studio 2019 (v16.4)+** and **build**
    the solution.

- Select the '**Web.Mvc**' project as the startup project.

- Check the **connection string** in the **appsettings.json** file of the Web.Mvc project, change it if you want.

-   Open **Package Manager Console** and run the **Update-Database** command
    to create your database (ensure that the Default project is selected as
    **.EntityFrameworkCore** in the Package Manager Console window).

- Since it uses **libman**, go to **Web.Mvc** project. Right click to **libman.json** file. Then click to **Restore Client-Side Libraries**.

  (If you are not using Visual Studio and/or you are on a mac you can use [Libman CLI](https://github.com/aspnet/LibraryManager/wiki/Using-LibMan-CLI) . After installing it while in **Web.Mvc** folder run `libman restore`)

-   Run the application.

If you have problems with running the application, please try closing and
opening Visual Studio again. It sometimes fails on first package
restore.

#### Login

Once you run the application, you will see the following login page:

The username is '**admin**' and the password is '**123qwe**' by default. There
is also a "Default" tenant. After you login, you can see the
sample dashboard page:

#### About Multi-Tenancy

In this template, **multi-tenancy is enabled by default**. You can
disable it in Core project's module class if you don't need it.

### Token Based Authentication

The startup template uses cookie-based authentication for browsers. However,
if you want to consume Web APIs or application services (those that are
exposed via the [dynamic web api](/Pages/Documents/Dynamic-Web-API)) from a
mobile application, you'll probably want a token-based authentication
mechanism. The startup template includes JwtBearer token authentication
infrastructure.

Here, **Postman** (Chrome extension) will be used to demonstrate
requests and responses.

#### Authentication

Just send a **POST** request to
**http://localhost:62114/api/TokenAuth/Authenticate** with a
**Content-Type="application/json"** header as shown below:

We sent the values **usernameOrEmailAddress** and **password**. As seen
above, the result property of the returning JSON contains the token and expiration
time (which is 24 hours by default and can be configured). We can save
it and use for the next requests.

**About Multi-Tenancy
**The API will work as host users by default. You can send a **Abp.TenantId**
header value to work with a specified tenant. It's an integer value and
1 for the default tenant by default.

#### Use API

After you authenticate and get the **token**, we can use it to call any
**authorized** action. All **application services** can be
used remotely. For example, we can use the **User service** to get a
**list of users**:

Just made a **GET** request to
**http://localhost:62114/api/services/app/user/GetAll** with
**Content-Type="application/json"** and **Authorization="Bearer
*your-*** ***auth-token*** **"**.

Almost all operations available on the UI are also available as a Web API,
since the UI uses the same Web API, and can be easily consumed.

### Migrator Console Application

The startup template includes a tool, Migrator.exe, to easily migrate your
databases. You can run this application to create/migrate the host and
tenant databases.

This application gets the host connection string from it's **own
appsettings.json file**. In the beginning, it will be the
same in the appsettings.json in the .Web.Host project.
Be sure that the connection string
in the config file is the database you want. After getting the **host**
**connection string**, it first creates the host database and applies
migrations if they don't already exist. It then gets the connection strings of the
tenant databases and runs migrations against those databases. It skips a
tenant if it does not have a dedicated database or its database has already
been migrated by another tenant (for shared databases between multiple
tenants).

You can use this tool on the development or on the production environment to
migrate databases on deployment instead of EntityFramework's own
tooling (which requires some configuration and can only work for a single
database/tenant in one run).

### Unit Testing

The startup template includes the test infrastructure setup and a few tests
under the .Test project. You can check them and write similar tests
easily. They are actually integration tests rather than unit tests,
since they test your code with all the ASP.NET Boilerplate infrastructure
(including validation, authorization, unit of work...).

### Source Code

This template is developed as an open source project and is available for free on GitHub:
<https://github.com/aspnetboilerplate/module-zero-core-template>


text:
using Microsoft.Extensions.Options;
using OrchardCore.ResourceManagement;

namespace OrchardCore.Liquid
{
    public class ResourceManagementOptionsConfiguration : IConfigureOptions<ResourceManagementOptions>
    {
        private static ResourceManifest _manifest;

        static ResourceManagementOptionsConfiguration()
        {
            _manifest = new ResourceManifest();

            _manifest
                .DefineScript("monaco-liquid-intellisense")
                .SetUrl("~/OrchardCore.Liquid/monaco/liquid-intellisense.js")
                .SetDependencies("monaco")
                .SetVersion("1.0.0");

            _manifest
                .DefineScript("liquid-intellisense")
                .SetDependencies("monaco-liquid-intellisense")
                .SetUrl("~/OrchardCore.Liquid/Scripts/liquid-intellisense.js");
        }

        public void Configure(ResourceManagementOptions options)
        {
            options.ResourceManifests.Add(_manifest);
        }
    }
}


text:
package org.apache.hadoop.hdfs;

import org.junit.Test;

import java.io.*;
import java.util.ArrayList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference;

import org.apache.commons.logging.impl.Log4JLogger;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.hdfs.server.datanode.DataNode;
import org.apache.hadoop.hdfs.server.namenode.FSNamesystem;
import org.apache.hadoop.hdfs.server.namenode.LeaseManager;
import org.apache.hadoop.hdfs.server.namenode.NameNode;
import org.apache.hadoop.hdfs.server.protocol.InterDatanodeProtocol;
import org.apache.log4j.Level;

/**
 * This class tests the building blocks that are needed to
 * support HDFS appends.
 */
public class TestMultiThreadedSync {
  static final int blockSize = 1024*1024;
  static final int numBlocks = 10;
  static final int fileSize = numBlocks * blockSize + 1;

  private static final int NUM_THREADS = 10;
  private static final int WRITE_SIZE = 517;
  private static final int NUM_WRITES_PER_THREAD = 1000;

  private byte[] toWrite = null;

  {
    ((Log4JLogger)NameNode.stateChangeLog).getLogger().setLevel(Level.ALL);
    ((Log4JLogger)LeaseManager.LOG).getLogger().setLevel(Level.ALL);
    ((Log4JLogger)FSNamesystem.LOG).getLogger().setLevel(Level.ALL);
    ((Log4JLogger)DataNode.LOG).getLogger().setLevel(Level.ALL);
    ((Log4JLogger)DFSClient.LOG).getLogger().setLevel(Level.ALL);
    ((Log4JLogger)InterDatanodeProtocol.LOG).getLogger().setLevel(Level.ALL);
  }

  /*
   * creates a file but does not close it
   */
  private FSDataOutputStream createFile(FileSystem fileSys, Path name, int repl)
    throws IOException {
    FSDataOutputStream stm = fileSys.create(name, true,
                                            fileSys.getConf().getInt("io.file.buffer.size", 4096),
                                            (short)repl, (long)blockSize);
    return stm;
  }

  private void initBuffer(int size) {
    long seed = AppendTestUtil.nextLong();
    toWrite = AppendTestUtil.randomBytes(seed, size);
  }

  @Test
  public void testMultipleSyncers() throws Exception {
    Configuration conf = new Configuration();
    MiniDFSCluster cluster = new MiniDFSCluster(conf, 1, true, null);
    FileSystem fs = cluster.getFileSystem();
    Path p = new Path("/multiple-syncers.dat");
    try {
      doMultithreadedWrites(conf, p, NUM_THREADS, WRITE_SIZE, NUM_WRITES_PER_THREAD);
    } finally {
      fs.close();
      cluster.shutdown();
    }
  }

  public void doMultithreadedWrites(
    Configuration conf, Path p, int numThreads, int bufferSize, int numWrites)
    throws Exception {
    initBuffer(bufferSize);

    // create a new file.
    FileSystem fs = p.getFileSystem(conf);
    FSDataOutputStream stm = createFile(fs, p, 1);
    System.out.println("Created file simpleFlush.dat");

    // TODO move this bit to another test case
    // There have been a couple issues with flushing empty buffers, so do
    // some empty flushes first.
    stm.sync();
    stm.sync();
    stm.write(1);
    stm.sync();
    stm.sync();

    CountDownLatch countdown = new CountDownLatch(1);
    ArrayList<Thread> threads = new ArrayList<Thread>();
    AtomicReference<Throwable> thrown = new AtomicReference<Throwable>();
    for (int i = 0; i < numThreads; i++) {
      Thread t = new AppendTestUtil.WriterThread(stm, toWrite, thrown, countdown, numWrites);
      threads.add(t);
      t.start();
    }

    // Start all the threads at the same time for maximum raciness!
    countdown.countDown();

    for (Thread t : threads) {
      t.join();
    }
    if (thrown.get() != null) {

      throw new RuntimeException("Deferred", thrown.get());
    }
    stm.close();
    System.out.println("Closed file.");
  }

  public static void main(String args[]) throws Exception {
    TestMultiThreadedSync test = new TestMultiThreadedSync();
    Configuration conf = new Configuration();
    Path p = new Path("/user/todd/test.dat");
    long st = System.nanoTime();
    test.doMultithreadedWrites(conf, p, 10, 511, 50000);
    long et = System.nanoTime();

    System.out.println("Finished in " + ((et - st) / 1000000) + "ms");
  }

}


text:
var gulp = require('gulp');
//plugins
var jshint = require('gulp-jshint');
var nodemon = require('gulp-nodemon');
var browserSync = require('browser-sync');
//var changed = require('gulp-changed');
var plumber = require('gulp-plumber');
var imagemin = require('gulp-imagemin');
var rename = require("gulp-rename");                 // rename files
var cssmin = require('gulp-minify-css');
var sass = require('gulp-sass');
var uglify = require('gulp-uglify');
var prefixer = require('gulp-autoprefixer');

var SRC = './public/js/**/*.js';
var DEST = 'dist';

var paths = {
  styles:{
    src: './public/scss/*.scss',
    dest: './public/css/'
  },
  js:{
    src: './public/js/**/*.js',
    dest:'./public/js-dist/'
  }
};

// A display error function, to format and make custom errors more uniform
// Could be combined with gulp-util or npm colors for nicer output
var displayError = function(error) {

    // Initial building up of the error
    var errorString = '[' + error.plugin + ']';
    errorString += ' ' + error.message.replace("\n",''); // Removes new line at the end

    // If the error contains the filename or line number add it to the string
    if(error.fileName)
        errorString += ' in ' + error.fileName;

    if(error.lineNumber)
        errorString += ' on line ' + error.lineNumber;

    // This will output an error like the following:
    // [gulp-sass] error message in file_name on line 1
    console.error(errorString);
};

gulp.task('nodemon', function () {
  nodemon({ script: 'server.js',
          ext: 'html js',
          ignore: ['ignored.js'],
          tasks: ['jshint'] })
    .on('restart', function () {
      console.log('restarted!');
    });
});

gulp.task('sass', function(){
  gulp.src(paths.styles.src)
    .pipe(sass({
            //outputStyle: 'compressed',  //UNCOMMENT FOR MINIFIYNG CSS
            sourceComments: 'map',
    }))
    .on('error', function(err){
         displayError(err);
        })
        .pipe(prefixer(
           'last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'
        ))
    .pipe(gulp.dest(paths.styles.dest))
    .pipe(browserSync.stream());

});

// Static Server + watching scss/html files
gulp.task('serve', ['sass'], function() {

    browserSync.init({
        server: "./public",
        open:"external"
    });

    gulp.watch("public/scss/**/*.scss", ['sass']);
    gulp.watch("public/views/*.html").on('change', browserSync.reload);
});

gulp.task('jshint', function() {
  gulp.src(paths.js.src)
  .pipe(plumber())
  .pipe(jshint())
  .pipe(jshint.reporter('default'));
});

gulp.task('compress-images', function(){
  return gulp.src('./public/img/*.*')
    .pipe(imagemin({ progressive: true }))
    .pipe(gulp.dest('/public/img-dist/'));

});
/*
gulp.task('changed', function() {
  return gulp.src(SRC)
  .pipe(changed(DEST))
  .pipe(gulp.dest(DEST));
});*/

gulp.task('uglify', function(){
  return gulp.src(paths.js.src)
    .pipe(uglify())
    .pipe(gulp.dest(paths.js.dest));
});

// minify & concatinate all other js
gulp.task('js-concat', function() {
    gulp.src(paths.js.src)                      // get the files
        .pipe(uglify())                                 // uglify the files
        .pipe(concat('scripts.min.js'))                 // concatinate to one file
        .pipe(gulp.dest(target.js_dest))                // where to put the files
        .pipe(notify({message: 'JS processed!'}));      // notify when done
});

gulp.task('default', ['serve','jshint'], function() {
    // Watch the files in the paths object, and when there is a change, fun the functions in the array

    gulp.watch(paths.styles.src, ['sass'])
    // Also when there is a change, display what file was changed, only showing the path after the 'sass folder'
    .on('change', function(evt) {
        console.log(
            '[watcher] File ' + evt.path.replace(/.*(?=sass)/,'') + ' was ' + evt.type + ', compiling...'
        );
    });
});


text:
class ConcreteTool
		: public ToolBase
{
	Q_OBJECT

public:
	ConcreteTool(int& argc, char *argv[])
		: ToolBase(argc, argv)
	{
	}

	virtual void setup()
	{
		setDescription("Calculates the Polgenic Risk Score for a given set of PRS VCFs");
		addInfile("in", "Tabix indexed VCF.GZ file of the sample.", false);
		addInfileList("prs", "List of PRS VCFs.", false);
		addOutfile("out", "Output TSV file", false);

	}

	virtual void main()
	{
		//init
		QTextStream out(stdout);

		//load sample VCF
		TabixIndexedFile sample_vcf;
		sample_vcf.load(getInfile("in").toUtf8());

		//open output file and write header
		QSharedPointer<QFile> output_tsv = Helper::openFileForWriting(getOutfile("out"), true);
		QByteArrayList column_headers = QByteArrayList() << "pgs_id" << "trait" << "score" << "normal_score" << "build" << "n_var" << "pgp_id" << "citation";
		output_tsv->write("#" + column_headers.join("\t") + "\n");

		//iterate over all given PRS files
		foreach (const QString& prs_file_path, getInfileList("prs"))
		{
			//load PRS file
			VariantList prs_variant_list;
			prs_variant_list.load(prs_file_path);

			//get indices
			int weight_idx = prs_variant_list.annotationIndexByName("WEIGHT");

			//define PRS
			double prs = 0;
			QHash<QByteArray,QByteArray> column_entries;

			//parse comment lines
			foreach(const QString& comment_line, prs_variant_list.comments())
			{
				foreach(const QByteArray& column_name, column_headers)
				{
					if(comment_line.startsWith("##" + column_name))
					{
						if(column_entries.contains(column_name))
						{
							THROW(FileParseException, "Comment section of PRS VCF '" + prs_file_path + "' contains more than one entry for '" +column_name + "'!");
						}
						column_entries[column_name] = comment_line.section('=', 1).trimmed().toUtf8();
					}
				}
			}

			//check if all required comment lines are present
			QByteArrayList col_entries_not_in_header = QByteArrayList() << "score" << "normal_score";
			foreach (const QByteArray& key, column_headers)
			{
				if(col_entries_not_in_header.contains(key)) continue;
				if(!column_entries.contains(key))
				{
					THROW(FileParseException, "Comment section of PRS VCF '" + prs_file_path + "' misses the entry for '" + key + "'!");
				}
			}

                        //iterate over all variants in PRS
			for(int i = 0; i < prs_variant_list.count(); ++i)
			{
				const Variant& prs_variant = prs_variant_list[i];
                                //get all matching variants at this position
				QByteArrayList matching_lines = sample_vcf.getMatchingLines(prs_variant.chr(), prs_variant.start(), prs_variant.end(), true);
				QByteArrayList matching_variants;
				foreach(const QByteArray& line, matching_lines)
				{
					// check if variant has same ref/alternative base(s)
					if((Sequence(line.split('\t')[3]) == prs_variant.ref()) && (Sequence(line.split('\t')[4]) == prs_variant.obs())) matching_variants.append(line);
				}

				if(matching_variants.size() > 1)
				{
					THROW(FileParseException, "Variant '" + prs_variant.toString() + "' occures multiple times in sample VCF!");
				}

				if(matching_variants.size() == 1)
				{
					//get genotype
					QByteArrayList split_line = matching_variants[0].split('\t');
					QByteArrayList format_header_items = split_line[8].split(':');
					QByteArrayList format_value_items = split_line[9].split(':');
					int genotype_idx = format_header_items.indexOf("GT");
					if(genotype_idx < 0) THROW(FileParseException, "Genotype information is missing for variant '" + prs_variant.toString() + "'!");
					QByteArray genotype = format_value_items[genotype_idx].trimmed();
					int allele_count = 0;
					if(genotype == "0/1") allele_count = 1;
					else if(genotype == "1/1") allele_count = 2;
					else THROW(FileParseException, "Invalid genotype '" + genotype + "' in variant " + prs_variant.toString() + "'!");

					//calculate PRS part
					double weight = Helper::toDouble(prs_variant.annotations()[weight_idx], "PRS weight");
					prs += weight * allele_count;

				}
			}

			QByteArrayList prs_line = QByteArrayList() << column_entries["pgs_id"] << column_entries["trait"] << QByteArray::number(prs) << "."
														<< column_entries["build"] << column_entries["n_var"] << column_entries["pgp_id"] << column_entries["citation"];
			output_tsv->write(prs_line.join("\t") + "\n");

			//print final PRS
			out << column_entries["pgs_id"] << ":\t" << prs << endl;
		}

	}
};

#include "main.moc"

int main(int argc, char *argv[])
{
	ConcreteTool tool(argc, argv);
	return tool.execute();
}


text:
package com.chiclaim.rxjava.operator;

import android.os.Bundle;
import androidx.annotation.Nullable;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;

import com.chiclaim.rxjava.BaseFragment;
import com.chiclaim.rxjava.R;
import com.jakewharton.rxbinding.view.RxView;

import java.util.concurrent.TimeUnit;

import rx.Observable;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;
import rx.functions.Func1;

/**
 * Description:
 *

 * Created by kumu on 2018/1/11.
 */

public class FetchPhoneCodeFragment extends BaseFragment {

    private static final long INTERVAL_TIME = 50;

    private Button mBtn;
    private Subscription mSubscription;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_fetch_phone_code, container, false);
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        mBtn = (Button) view.findViewById(R.id.btn_fetch_phone_code);
        fetchPhoneCode();
    }

    /**
     * 获取验证的逻辑:
     *

     * 1,防止按钮在短时间内点击多次
     *

     * 2,调用获取验证码接口
     *

     * 3,验证码获取成功开始倒计时,此时按钮不可被点击
     *

     * 4,倒计时完毕后,点击可以再次被点击
     */

    public void fetchPhoneCode() {
        mSubscription = RxView.clicks(mBtn)
                .throttleFirst(1, TimeUnit.SECONDS)
                .flatMap(new Func1<Void, Observable<Boolean>>() {
                    @Override
                    public Observable<Boolean> call(Void aVoid) {
                        //弹出loading框(省略)
                        //调用获取验证码接口 (省略)
                        return Observable.just(true);
                    }
                })
                .flatMap(new Func1<Boolean, Observable<Boolean>>() {
                    @Override
                    public Observable<Boolean> call(Boolean aBoolean) {
                        //验证码获取成功,把按钮置为不可点
                        mBtn.setEnabled(false);
                        //关闭loading框(省略)
                        return intervalButton();
                    }
                })
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Action1<Boolean>() {
                    @Override
                    public void call(Boolean aBoolean) {
                        Log.e("FetchPhoneCodeFragment", "subscribe call");
                    }
                }, new Action1<Throwable>() {
                    @Override
                    public void call(Throwable throwable) {
                        throwable.printStackTrace();
                        //关闭loading框(省略)
                        //出错后把按钮设置为可用
                        mBtn.setEnabled(true);
                        Toast.makeText(getActivity(), throwable.getMessage(), Toast.LENGTH_SHORT).show();
                    }
                });
    }

    public Observable<Boolean> intervalButton() {
        //如果使用Observable.interval(interval, TimeUnit),会默认延迟interval执行
        return Observable.interval(0, 1000, TimeUnit.MILLISECONDS)

                .takeWhile(new Func1<Long, Boolean>() {
                    @Override
                    public Boolean call(Long aLong) {
                        return aLong <= INTERVAL_TIME;
                    }
                })

//                .filter(new Func1<Long, Boolean>() {
//                    @Override
//                    public Boolean call(Long aLong) {
//                        return aLong <= INTERVAL_TIME;
//                    }
//                })
                .observeOn(AndroidSchedulers.mainThread())
                .flatMap(new Func1<Long, Observable<Boolean>>() {
                    @Override
                    public Observable<Boolean> call(Long aLong) {
                        long diff = INTERVAL_TIME - aLong;
                        Log.e("FetchPhoneCodeFragment", "thread name:" + Thread.currentThread().getName() + ",aLong:" + aLong + ",diff:" + diff);
                        mBtn.setText(diff + "s");
                        //倒计时完毕后,按钮可以再次被点击,重新设置按钮文案
                        if (diff == 0) {
                            mBtn.setEnabled(true);
                            mBtn.setText("获取验证码");
                        }
                        return Observable.just(true);
                    }
                });
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        if (mSubscription != null && !mSubscription.isUnsubscribed()) {
            mSubscription.unsubscribe();
        }
    }
}


text:
DEPFLAGS := $(if $(word 2, $(TARGET_ARCH)), , -MMD)

ifndef CONFIG
  CONFIG=Debug
endif

ifeq ($(CONFIG),Debug)
  BINDIR := build
  LIBDIR := build
  OBJDIR := build/intermediate/Debug
  OUTDIR := build

  ifeq ($(TARGET_ARCH),)
    TARGET_ARCH := -march=native
  endif

  CPPFLAGS := $(DEPFLAGS) -std=c++11 -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -D "JUCE_APP_VERSION=3.1.0" -D "JUCE_APP_VERSION_HEX=0x30100" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../../../modules
  CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -g -ggdb -O0 -std=gnu++0x
  CXXFLAGS += $(CFLAGS)
  LDFLAGS += $(TARGET_ARCH) -L$(BINDIR) -L$(LIBDIR) -L/usr/X11R6/lib/ -lX11 -lXext -lXinerama -ldl -lfreetype -lpthread -lrt
  LDDEPS :=
  RESFLAGS :=  -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -D "JUCE_APP_VERSION=3.1.0" -D "JUCE_APP_VERSION_HEX=0x30100" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../../../modules
  TARGET := Introjucer
  BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH)
  CLEANCMD = rm -rf $(OUTDIR)/$(TARGET) $(OBJDIR)
endif

ifeq ($(CONFIG),Release)
  BINDIR := build
  LIBDIR := build
  OBJDIR := build/intermediate/Release
  OUTDIR := build

  ifeq ($(TARGET_ARCH),)
    TARGET_ARCH := -march=native
  endif

  CPPFLAGS := $(DEPFLAGS) -std=c++11 -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -D "JUCE_APP_VERSION=3.1.0" -D "JUCE_APP_VERSION_HEX=0x30100" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../../../modules
  CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -O3 -std=gnu++0x
  CXXFLAGS += $(CFLAGS)
  LDFLAGS += $(TARGET_ARCH) -L$(BINDIR) -L$(LIBDIR) -fvisibility=hidden -L/usr/X11R6/lib/ -lX11 -lXext -lXinerama -ldl -lfreetype -lpthread -lrt
  LDDEPS :=
  RESFLAGS :=  -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -D "JUCE_APP_VERSION=3.1.0" -D "JUCE_APP_VERSION_HEX=0x30100" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../../../modules
  TARGET := Introjucer
  BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH)
  CLEANCMD = rm -rf $(OUTDIR)/$(TARGET) $(OBJDIR)
endif

OBJECTS := \
  $(OBJDIR)/jucer_AppearanceSettings_788d9889.o \
  $(OBJDIR)/jucer_CommandLine_f35de107.o \
  $(OBJDIR)/jucer_DocumentEditorComponent_695dff1d.o \
  $(OBJDIR)/jucer_Main_f8488f5b.o \
  $(OBJDIR)/jucer_MainWindow_1e163aeb.o \
  $(OBJDIR)/jucer_OpenDocumentManager_4c72d210.o \
  $(OBJDIR)/jucer_SourceCodeEditor_461f5487.o \
  $(OBJDIR)/jucer_ComponentTypeHandler_6bec6262.o \
  $(OBJDIR)/jucer_ButtonDocument_56c341cc.o \
  $(OBJDIR)/jucer_ComponentDocument_92868083.o \
  $(OBJDIR)/jucer_ColouredElement_70cbc839.o \
  $(OBJDIR)/jucer_PaintElement_653460.o \
  $(OBJDIR)/jucer_PaintElementPath_908894a5.o \
  $(OBJDIR)/jucer_ComponentLayoutEditor_aeb44f8d.o \
  $(OBJDIR)/jucer_ComponentOverlayComponent_fd508d63.o \
  $(OBJDIR)/jucer_EditingPanelBase_6c2ed9ee.o \
  $(OBJDIR)/jucer_JucerDocumentEditor_2c581e26.o \
  $(OBJDIR)/jucer_PaintRoutineEditor_f6ac0344.o \
  $(OBJDIR)/jucer_PaintRoutinePanel_c309a0d7.o \
  $(OBJDIR)/jucer_ResourceEditorPanel_a558f2e2.o \
  $(OBJDIR)/jucer_TestComponent_db757dc4.o \
  $(OBJDIR)/jucer_BinaryResources_e0f99b46.o \
  $(OBJDIR)/jucer_ComponentLayout_6ea00129.o \
  $(OBJDIR)/jucer_GeneratedCode_9ca4ef7e.o \
  $(OBJDIR)/jucer_JucerDocument_ff8afcc2.o \
  $(OBJDIR)/jucer_ObjectTypes_4406f01c.o \
  $(OBJDIR)/jucer_PaintRoutine_e1e891ee.o \
  $(OBJDIR)/jucer_ProjectExporter_eefe2e5b.o \
  $(OBJDIR)/jucer_ResourceFile_6af120d3.o \
  $(OBJDIR)/jucer_Module_3f7666a5.o \
  $(OBJDIR)/jucer_Project_c131864a.o \
  $(OBJDIR)/jucer_ProjectContentComponent_60de0eee.o \
  $(OBJDIR)/jucer_ProjectType_1bc27a24.o \
  $(OBJDIR)/jucer_CodeHelpers_c317179c.o \
  $(OBJDIR)/jucer_FileHelpers_f98ed0ad.o \
  $(OBJDIR)/jucer_Icons_9db2f51e.o \
  $(OBJDIR)/jucer_JucerTreeViewBase_d043309d.o \
  $(OBJDIR)/jucer_MiscUtilities_25b68c82.o \
  $(OBJDIR)/jucer_SlidingPanelComponent_9aa7a2ab.o \
  $(OBJDIR)/jucer_StoredSettings_26078d2c.o \
  $(OBJDIR)/jucer_NewFileWizard_fac97f47.o \
  $(OBJDIR)/jucer_NewProjectWizardClasses_891f6fa2.o \
  $(OBJDIR)/BinaryData_ce4232d4.o \
  $(OBJDIR)/juce_core_1ee54a40.o \
  $(OBJDIR)/juce_cryptography_3b1f489a.o \
  $(OBJDIR)/juce_data_structures_84790dfc.o \
  $(OBJDIR)/juce_events_584896b4.o \
  $(OBJDIR)/juce_graphics_f9afc18.o \
  $(OBJDIR)/juce_gui_basics_90929794.o \
  $(OBJDIR)/juce_gui_extra_b81d9e1c.o \

.PHONY: clean

$(OUTDIR)/$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES)
	@echo Linking The Introjucer
	-@mkdir -p $(BINDIR)
	-@mkdir -p $(LIBDIR)
	-@mkdir -p $(OUTDIR)
	@$(BLDCMD)

clean:
	@echo Cleaning The Introjucer
	@$(CLEANCMD)

strip:
	@echo Stripping The Introjucer
	-@strip --strip-unneeded $(OUTDIR)/$(TARGET)

$(OBJDIR)/jucer_AppearanceSettings_788d9889.o: ../../Source/Application/jucer_AppearanceSettings.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_AppearanceSettings.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_CommandLine_f35de107.o: ../../Source/Application/jucer_CommandLine.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_CommandLine.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_DocumentEditorComponent_695dff1d.o: ../../Source/Application/jucer_DocumentEditorComponent.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_DocumentEditorComponent.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_Main_f8488f5b.o: ../../Source/Application/jucer_Main.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_Main.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_MainWindow_1e163aeb.o: ../../Source/Application/jucer_MainWindow.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_MainWindow.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_OpenDocumentManager_4c72d210.o: ../../Source/Application/jucer_OpenDocumentManager.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_OpenDocumentManager.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_SourceCodeEditor_461f5487.o: ../../Source/Code\ Editor/jucer_SourceCodeEditor.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_SourceCodeEditor.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_ComponentTypeHandler_6bec6262.o: ../../Source/ComponentEditor/components/jucer_ComponentTypeHandler.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_ComponentTypeHandler.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_ButtonDocument_56c341cc.o: ../../Source/ComponentEditor/documents/jucer_ButtonDocument.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_ButtonDocument.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_ComponentDocument_92868083.o: ../../Source/ComponentEditor/documents/jucer_ComponentDocument.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_ComponentDocument.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_ColouredElement_70cbc839.o: ../../Source/ComponentEditor/paintelements/jucer_ColouredElement.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_ColouredElement.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_PaintElement_653460.o: ../../Source/ComponentEditor/paintelements/jucer_PaintElement.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_PaintElement.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_PaintElementPath_908894a5.o: ../../Source/ComponentEditor/paintelements/jucer_PaintElementPath.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_PaintElementPath.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_ComponentLayoutEditor_aeb44f8d.o: ../../Source/ComponentEditor/ui/jucer_ComponentLayoutEditor.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_ComponentLayoutEditor.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_ComponentOverlayComponent_fd508d63.o: ../../Source/ComponentEditor/ui/jucer_ComponentOverlayComponent.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_ComponentOverlayComponent.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_EditingPanelBase_6c2ed9ee.o: ../../Source/ComponentEditor/ui/jucer_EditingPanelBase.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_EditingPanelBase.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_JucerDocumentEditor_2c581e26.o: ../../Source/ComponentEditor/ui/jucer_JucerDocumentEditor.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_JucerDocumentEditor.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_PaintRoutineEditor_f6ac0344.o: ../../Source/ComponentEditor/ui/jucer_PaintRoutineEditor.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_PaintRoutineEditor.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_PaintRoutinePanel_c309a0d7.o: ../../Source/ComponentEditor/ui/jucer_PaintRoutinePanel.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_PaintRoutinePanel.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_ResourceEditorPanel_a558f2e2.o: ../../Source/ComponentEditor/ui/jucer_ResourceEditorPanel.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_ResourceEditorPanel.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_TestComponent_db757dc4.o: ../../Source/ComponentEditor/ui/jucer_TestComponent.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_TestComponent.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_BinaryResources_e0f99b46.o: ../../Source/ComponentEditor/jucer_BinaryResources.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_BinaryResources.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_ComponentLayout_6ea00129.o: ../../Source/ComponentEditor/jucer_ComponentLayout.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_ComponentLayout.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_GeneratedCode_9ca4ef7e.o: ../../Source/ComponentEditor/jucer_GeneratedCode.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_GeneratedCode.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_JucerDocument_ff8afcc2.o: ../../Source/ComponentEditor/jucer_JucerDocument.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_JucerDocument.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_ObjectTypes_4406f01c.o: ../../Source/ComponentEditor/jucer_ObjectTypes.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_ObjectTypes.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_PaintRoutine_e1e891ee.o: ../../Source/ComponentEditor/jucer_PaintRoutine.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_PaintRoutine.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_ProjectExporter_eefe2e5b.o: ../../Source/Project\ Saving/jucer_ProjectExporter.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_ProjectExporter.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_ResourceFile_6af120d3.o: ../../Source/Project\ Saving/jucer_ResourceFile.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_ResourceFile.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_Module_3f7666a5.o: ../../Source/Project/jucer_Module.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_Module.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_Project_c131864a.o: ../../Source/Project/jucer_Project.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_Project.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_ProjectContentComponent_60de0eee.o: ../../Source/Project/jucer_ProjectContentComponent.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_ProjectContentComponent.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_ProjectType_1bc27a24.o: ../../Source/Project/jucer_ProjectType.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_ProjectType.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_CodeHelpers_c317179c.o: ../../Source/Utility/jucer_CodeHelpers.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_CodeHelpers.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_FileHelpers_f98ed0ad.o: ../../Source/Utility/jucer_FileHelpers.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_FileHelpers.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_Icons_9db2f51e.o: ../../Source/Utility/jucer_Icons.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_Icons.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_JucerTreeViewBase_d043309d.o: ../../Source/Utility/jucer_JucerTreeViewBase.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_JucerTreeViewBase.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_MiscUtilities_25b68c82.o: ../../Source/Utility/jucer_MiscUtilities.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_MiscUtilities.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_SlidingPanelComponent_9aa7a2ab.o: ../../Source/Utility/jucer_SlidingPanelComponent.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_SlidingPanelComponent.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_StoredSettings_26078d2c.o: ../../Source/Utility/jucer_StoredSettings.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_StoredSettings.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_NewFileWizard_fac97f47.o: ../../Source/Wizards/jucer_NewFileWizard.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_NewFileWizard.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/jucer_NewProjectWizardClasses_891f6fa2.o: ../../Source/Wizards/jucer_NewProjectWizardClasses.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling jucer_NewProjectWizardClasses.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/BinaryData_ce4232d4.o: ../../JuceLibraryCode/BinaryData.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling BinaryData.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/juce_core_1ee54a40.o: ../../../../modules/juce_core/juce_core.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling juce_core.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/juce_cryptography_3b1f489a.o: ../../../../modules/juce_cryptography/juce_cryptography.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling juce_cryptography.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/juce_data_structures_84790dfc.o: ../../../../modules/juce_data_structures/juce_data_structures.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling juce_data_structures.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/juce_events_584896b4.o: ../../../../modules/juce_events/juce_events.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling juce_events.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/juce_graphics_f9afc18.o: ../../../../modules/juce_graphics/juce_graphics.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling juce_graphics.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/juce_gui_basics_90929794.o: ../../../../modules/juce_gui_basics/juce_gui_basics.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling juce_gui_basics.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

$(OBJDIR)/juce_gui_extra_b81d9e1c.o: ../../../../modules/juce_gui_extra/juce_gui_extra.cpp
	-@mkdir -p $(OBJDIR)
	@echo "Compiling juce_gui_extra.cpp"
	@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"

-include $(OBJECTS:%.o=%.d)


text:
import React from "react";
//Components
import Icon from "../Icon";
//Styles
import styled from "styled-components";

const InputGroup = ({
  className,
  InputProps,
  IconProps,
  onChange,
  onKeyUp
}) => {
  return (
    <div className={`${className} input-group input-group-lg`}>

          <Icon {...IconProps} />

      <input onChange={onChange} onKeyUp={onKeyUp} {...InputProps} />

  );
};

InputGroup.defaultProps = {
  IconProps: { name: "fas fa-plus" },
  InputProps: {
    type: "text",
    className: "form-control",
    placeholder: "Some Text"
  }
};

export default styled(InputGroup)`
  box-shadow: ${props => props.theme.boxShadow};
  border: 1px solid ${props => props.theme.color.border};
  .input-group-text {
    background-color: ${props =>
      props.InputProps.readOnly ? "#E9ECEF" : props.theme.color.white};
    border: none;
    i {
      color: ${props => props.theme.text.secondary};
    }
  }
  input {
    border: none;
  }
`;


text:
using Documenter, QuadGK

makedocs(
    modules = [QuadGK],
    clean = false,
    sitename = "QuadGK.jl",
    authors = "Steven G. Johnson and contributors.",
    pages = [
        "Home" => "index.md",
    ],
)

deploydocs(
    repo = "github.com/JuliaMath/QuadGK.jl.git",
    target = "build",
    deps = nothing,
    make = nothing,
)


text:
package org.apache.ode.bpel.elang.xquery10.runtime;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.net.URI;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

import javax.xml.namespace.QName;
import javax.xml.transform.TransformerFactory;
import javax.xml.xpath.XPathConstants;
import javax.xml.xquery.XQConnection;
import javax.xml.xquery.XQConstants;
import javax.xml.xquery.XQDataSource;
import javax.xml.xquery.XQException;
import javax.xml.xquery.XQItem;
import javax.xml.xquery.XQItemType;
import javax.xml.xquery.XQPreparedExpression;
import javax.xml.xquery.XQResultSequence;
import javax.xml.xquery.XQSequence;
import javax.xml.xquery.XQSequenceType;
import javax.xml.xquery.XQStaticContext;

import net.sf.saxon.Configuration;
import net.sf.saxon.om.Validation;
import net.sf.saxon.trans.DynamicError;
import net.sf.saxon.value.DurationValue;
import net.sf.saxon.xqj.SaxonXQConnection;
import net.sf.saxon.xqj.SaxonXQDataSource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.common.FaultException;
import org.apache.ode.bpel.elang.xpath20.compiler.Constants;
import org.apache.ode.bpel.elang.xpath20.compiler.WrappedResolverException;
import org.apache.ode.bpel.elang.xpath20.runtime.JaxpFunctionResolver;
import org.apache.ode.bpel.elang.xpath20.runtime.JaxpVariableResolver;
import org.apache.ode.bpel.elang.xquery10.compiler.XQuery10BpelFunctions;
import org.apache.ode.bpel.elang.xquery10.o.OXQuery10ExpressionBPEL20;
import org.apache.ode.bpel.explang.ConfigurationException;
import org.apache.ode.bpel.explang.EvaluationContext;
import org.apache.ode.bpel.explang.EvaluationException;
import org.apache.ode.bpel.explang.ExpressionLanguageRuntime;
import org.apache.ode.bpel.o.OExpression;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.ISO8601DateParser;
import org.apache.ode.utils.NSContext;
import org.apache.ode.utils.xsd.Duration;
import org.apache.ode.utils.xsl.XslTransformHandler;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;

/**
 * XQuery 1.0 Expression Language run-time subsytem. Saxon implementation.
 */
@SuppressWarnings("deprecation")
public class XQuery10ExpressionRuntime implements ExpressionLanguageRuntime {
    static final short NODE_TYPE = 1;
    static final short NODESET_TYPE = 2;
    static final short STRING_TYPE = 3;
    static final short BOOLEAN_TYPE = 4;
    static final short NUMBER_TYPE = 5;

    /** Class-level logger. */
    private static final Log __log = LogFactory.getLog(XQuery10ExpressionRuntime.class);

    /**
     * Creates a new XQuery10ExpressionRuntime object.
     */
    public XQuery10ExpressionRuntime() {
    }

    /**
     * Initialize XSL Transformer
     *
     * @param properties properties
     *
     * @throws ConfigurationException ConfigurationException
     */
    public void initialize(Map properties) throws ConfigurationException {
        TransformerFactory trsf = new net.sf.saxon.TransformerFactoryImpl();
        XslTransformHandler.getInstance().setTransformerFactory(trsf);
    }

    /**
     *
     * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluateAsString(org.apache.ode.bpel.o.OExpression,
     *      org.apache.ode.bpel.explang.EvaluationContext)
     */
    public String evaluateAsString(OExpression cexp, EvaluationContext ctx)
        throws FaultException, EvaluationException {
        return (String) evaluate(cexp, ctx, XPathConstants.STRING);
    }

    /**
     *
     * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluateAsBoolean(org.apache.ode.bpel.o.OExpression,
     *      org.apache.ode.bpel.explang.EvaluationContext)
     */
    public boolean evaluateAsBoolean(OExpression cexp, EvaluationContext ctx)
        throws FaultException, EvaluationException {
        return (Boolean) evaluate(cexp, ctx, XPathConstants.BOOLEAN);
    }

    /**
     * Evaluate expression and return a number
     *
     * @param cexp cexp
     * @param ctx ctx
     *
     * @return type
     *
     * @throws FaultException FaultException
     * @throws EvaluationException EvaluationException
     */
    public Number evaluateAsNumber(OExpression cexp, EvaluationContext ctx)
        throws FaultException, EvaluationException {
        return (Number) evaluate(cexp, ctx, XPathConstants.NUMBER);
    }

    /**
     *
     * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluate(org.apache.ode.bpel.o.OExpression,
     *      org.apache.ode.bpel.explang.EvaluationContext)
     */
    public List evaluate(OExpression cexp, EvaluationContext ctx)
        throws FaultException, EvaluationException {
        List result;
        Object someRes = evaluate(cexp, ctx, XPathConstants.NODESET);

        if (someRes instanceof List) {
            result = (List) someRes;
            __log.debug("Returned list of size " + result.size());

            if ((result.size() == 1) && !(result.get(0) instanceof Node)) {
                // Dealing with a Java class
                Object simpleType = result.get(0);

                // Dates get a separate treatment as we don't want to call toString on them
                String textVal;

                if (simpleType instanceof Date) {
                    textVal = ISO8601DateParser.format((Date) simpleType);
                } else if (simpleType instanceof DurationValue) {
                    textVal = ((DurationValue) simpleType).getStringValue();
                } else {
                    textVal = simpleType.toString();
                }

                // Wrapping in a document
                Document d = DOMUtils.newDocument();

                // Giving our node a parent just in case it's an LValue expression
                Element wrapper = d.createElement("wrapper");
                Text text = d.createTextNode(textVal);
                wrapper.appendChild(text);
                d.appendChild(wrapper);
                result = Collections.singletonList(text);
            }
        } else if (someRes instanceof NodeList) {
            NodeList retVal = (NodeList) someRes;
            __log.debug("Returned node list of size " + retVal.getLength());
            result = new ArrayList(retVal.getLength());

            for (int m = 0; m < retVal.getLength(); ++m) {
                Node val = retVal.item(m);

                if (val.getNodeType() == Node.DOCUMENT_NODE) {
                    val = ((Document) val).getDocumentElement();
                }

                result.add(val);
            }
        } else {
            result = null;
        }

        return result;
    }

    /**
     * Evaluate expression and return a node
     *
     * @param cexp cexp
     * @param ctx ctx
     *
     * @return type
     *
     * @throws FaultException FaultException
     * @throws EvaluationException EvaluationException
     */
    public Node evaluateNode(OExpression cexp, EvaluationContext ctx)
        throws FaultException, EvaluationException {
        List retVal = evaluate(cexp, ctx);

        if (retVal.size() == 0) {
            throw new FaultException(cexp.getOwner().constants.qnSelectionFailure,
                "No results for expression: " + cexp);
        }

        if (retVal.size() > 1) {
            throw new FaultException(cexp.getOwner().constants.qnSelectionFailure,
                "Multiple results for expression: " + cexp);
        }

        return (Node) retVal.get(0);
    }

    /**
     * Evaluate expression and return a date
     *
     * @param cexp cexp
     * @param context context
     *
     * @return type
     *
     * @throws FaultException FaultException
     * @throws EvaluationException EvaluationException
     */
    public Calendar evaluateAsDate(OExpression cexp, EvaluationContext context)
        throws FaultException, EvaluationException {
        List literal = DOMUtils.toList(evaluate(cexp, context,
                    XPathConstants.NODESET));

        if (literal.size() == 0) {
            throw new FaultException(cexp.getOwner().constants.qnSelectionFailure,
                "No results for expression: " + cexp);
        }

        if (literal.size() > 1) {
            throw new FaultException(cexp.getOwner().constants.qnSelectionFailure,
                "Multiple results for expression: " + cexp);
        }

        Object date = literal.get(0);

        if (date instanceof Calendar) {
            return (Calendar) date;
        }

        if (date instanceof Date) {
            Calendar cal = Calendar.getInstance();
            cal.setTime((Date) date);

            return cal;
        }

        if (date instanceof Element) {
            date = ((Element) date).getTextContent();
        }

        try {
            return ISO8601DateParser.parseCal(date.toString());
        } catch (Exception ex) {
            String errmsg = "Invalid date: " + literal;
            __log.error(errmsg, ex);
            throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue,
                errmsg);
        }
    }

    /**
     * Evaluate expression and return duration
     *
     * @param cexp cexp
     * @param context context
     *
     * @return type
     *
     * @throws FaultException FaultException
     * @throws EvaluationException EvaluationException
     */
    public Duration evaluateAsDuration(OExpression cexp,
        EvaluationContext context) throws FaultException, EvaluationException {
        String literal = this.evaluateAsString(cexp, context);

        try {
            return new Duration(literal);
        } catch (Exception ex) {
            String errmsg = "Invalid duration: " + literal;
            __log.error(errmsg, ex);
            throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue,
                errmsg);
        }
    }

    /**
     * Evaluate expression and return opaque type
     *
     * @param cexp cexp
     * @param ctx ctx
     * @param type type
     *
     * @return type
     *
     * @throws FaultException FaultException
     * @throws EvaluationException EvaluationException
     */
    private Object evaluate(OExpression cexp, EvaluationContext ctx, QName type)
        throws FaultException, EvaluationException {
        try {
            OXQuery10ExpressionBPEL20 oxquery10 = ((OXQuery10ExpressionBPEL20) cexp);

            XQDataSource xqds = new SaxonXQDataSource();
            XQConnection xqconn = xqds.getConnection();

            Configuration configuration = ((SaxonXQConnection) xqconn).getConfiguration();
            configuration.setAllNodesUntyped(true);
            configuration.setHostLanguage(Configuration.XQUERY);

            XQStaticContext staticEnv = xqconn.getStaticContext();

            NSContext nsContext = oxquery10.namespaceCtx;
            Set<String> prefixes = nsContext.getPrefixes();
            for (String prefix : prefixes) {
                String uri = nsContext.getNamespaceURI(prefix);
                staticEnv.declareNamespace(prefix, uri);
            }

            configuration.setSchemaValidationMode(Validation.SKIP);
            xqconn.setStaticContext(staticEnv);

            // Prepare expression, for starters
            String xquery = oxquery10.xquery.replaceFirst(
                    Constants.XQUERY_FUNCTION_HANDLER_COMPILER,
                    Constants.XQUERY_FUNCTION_HANDLER_RUNTIME);
            XQPreparedExpression exp = xqconn.prepareExpression(xquery);

            JaxpFunctionResolver funcResolver = new JaxpFunctionResolver(ctx,
                    oxquery10);
            JaxpVariableResolver variableResolver = new JaxpVariableResolver(ctx,
                    oxquery10, configuration);
            // Bind external variables to runtime values
            for (QName variable : exp.getAllUnboundExternalVariables()) {
            	// Evaluate referenced variable
                Object value = variableResolver.resolveVariable(variable);

                // Figure out type of variable
                XQSequenceType xqType = getItemType(xqconn, value);

                // Saxon doesn't like binding sequences to variables
                if (value instanceof Node) {
                	// a node is a node-list, but the inverse isn't true.
                	// so, if the value is truly a node, leave it alone.
                } else if (value instanceof NodeList) {
                    // So extract the first item from the node list
                	NodeList nodeList = (NodeList) value;
                	ArrayList nodeArray = new ArrayList();
                	for (int i = 0; i < nodeList.getLength(); i++) {
                		nodeArray.add(nodeList.item(i));
                	}
                	value = xqconn.createSequence(nodeArray.iterator());
                }

                // Bind value with external variable
                if (value != null && xqType != null) {
                	if (value instanceof XQSequence) {
                		exp.bindSequence(variable, (XQSequence) value);
                	} else {
                		if (xqType instanceof XQItemType) {
			                exp.bindObject(variable, value, (XQItemType) xqType);
                		}
                	}
                }
            }

            // Set context node
            Node contextNode = (ctx.getRootNode() == null)
	            ? DOMUtils.newDocument() : ctx.getRootNode();
            contextNode.setUserData(XQuery10BpelFunctions.USER_DATA_KEY_FUNCTION_RESOLVER,
                funcResolver, null);
            exp.bindItem(XQConstants.CONTEXT_ITEM,
                xqconn.createItemFromNode(contextNode, xqconn.createNodeType()));

            // Execute query
            XQResultSequence result = exp.executeQuery();

            // Cast Saxon result to Java result
            Object evalResult = getResultValue(type, result);

            if ((evalResult != null) && __log.isDebugEnabled()) {
                __log.debug("Expression " + cexp.toString() +
                    " generated result " + evalResult + " - type=" +
                    evalResult.getClass().getName());

                if (ctx.getRootNode() != null) {
                    __log.debug("Was using context node " +
                        DOMUtils.domToString(ctx.getRootNode()));
                }
            }

            return evalResult;
        } catch (XQException xqe) {
            // Extracting the real cause from all this wrapping isn't a simple task
            Throwable cause = (xqe.getCause() != null) ? xqe.getCause() : xqe;

            if (cause instanceof DynamicError) {
                Throwable th = ((DynamicError) cause).getException();

                if (th != null) {
                    cause = th;

                    if (cause.getCause() != null) {
                        cause = cause.getCause();
                    }
                }
            }

            throw new EvaluationException(
                "Error while executing an XQuery expression: " + cause.toString(), cause);
        } catch (WrappedResolverException wre) {
            __log.debug("Could not evaluate expression because of ", wre);
            throw (FaultException) wre.getCause();
        }
    }

    /**
     * Return opaque object embedded in XQuery Item
     *
     * @param item item
     *
     * @return type
     *
     * @throws XQException XQException
     */
    private Object getItemValue(XQItem item) throws XQException {
        XQItemType itemType = item.getItemType();
        Object itemValue = null;

        switch (itemType.getBaseType()) {
        case XQItemType.XQBASETYPE_BOOLEAN:
            itemValue = item.getBoolean();

            break;

        case XQItemType.XQBASETYPE_DECIMAL:
            itemValue = item.getDouble();

            break;

        case XQItemType.XQBASETYPE_BYTE:
            itemValue = item.getByte();

            break;

        case XQItemType.XQBASETYPE_FLOAT:
            itemValue = item.getFloat();

            break;

        case XQItemType.XQBASETYPE_INT:
        case XQItemType.XQBASETYPE_INTEGER:
            itemValue = item.getInt();

            break;

        case XQItemType.XQBASETYPE_LONG:
            itemValue = item.getLong();

            break;

        case XQItemType.XQBASETYPE_ANYTYPE:
            itemValue = item.getNode();

            break;

        case XQItemType.XQBASETYPE_ANYURI:
            itemValue = item.getNodeUri();

            break;

        case XQItemType.XQBASETYPE_SHORT:
            itemValue = item.getShort();

            break;

        case XQItemType.XQBASETYPE_STRING:
        case XQItemType.XQBASETYPE_ANYATOMICTYPE:
            itemValue = item.getAtomicValue();

            break;

        }

        return itemValue;
    }

    /**
     * Return XQuery type corresponding to given value
     *
     * @param xqconn XQuery connection
     * @param value value
     *
     * @return type
     *
     * @throws XQException XQException
     */
    private XQSequenceType getItemType(XQConnection xqconn, Object value) throws XQException {
        XQSequenceType xqType = null;
        if (value instanceof Long) {
            xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_LONG);
        } else if (value instanceof String) {
            xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_STRING);
        } else if (value instanceof Boolean) {
        	xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_BOOLEAN);
        } else if (value instanceof Date) {
        	xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_DATETIME);
        } else if (value instanceof BigDecimal) {
        	xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_DECIMAL);
        } else if (value instanceof Float) {
        	xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_FLOAT);
        } else if (value instanceof URI) {
        	xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_ANYURI);
        } else if (value instanceof QName) {
        	xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_QNAME);
        } else if (value instanceof BigInteger) {
        	xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_INT);
        } else if (value instanceof Integer) {
        	xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_INTEGER);
        } else if (value instanceof Double) {
        	xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_DOUBLE);
        } else if (value instanceof Byte) {
        	xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_BYTE);
        } else if (value instanceof Node) {
        	xqType = xqconn.createNodeType();
        } else if (value instanceof NodeList || value instanceof XQSequence) {
            XQItemType xqItemType = xqconn.createNodeType();
            xqType = xqconn.createSequenceType(xqItemType, XQSequenceType.OCC_ZERO_OR_MORE);
        }
        return xqType;
    }

    /**
     * Cast XQuery sequence into an opaque list
     *
     * @param type type
     * @param result result
     *
     * @return value
     *
     * @throws XQException XQException
     */
    private Object getResultValue(QName type, XQResultSequence result) throws XQException {
    	Document document = DOMUtils.newDocument();
    	Object resultValue = null;
        if (XPathConstants.NODESET.equals(type)) {
            List list = new ArrayList();

            while (result.next()) {
                Object itemValue = getItemValue(result.getItem());
                if (itemValue instanceof Document) {
                	itemValue = DOMUtils.cloneNode(document, ((Document) itemValue).getDocumentElement());
                } else if (itemValue instanceof Node) {
                	itemValue = DOMUtils.cloneNode(document, (Node) itemValue);
                }

                if (itemValue != null) {
                    list.add(itemValue);
                }
            }

            resultValue = list;
        } else if (XPathConstants.NODE.equals(type)) {
        	XQItem item = null;
    		if (result.count() > 0) {
    			result.first();
    			if (result.isOnItem()) {
    				item = result.getItem();
    			}
    		}
    		if (item != null) {
	            resultValue = getItemValue(item);
	            if (resultValue instanceof Node) {
	            	resultValue = DOMUtils.cloneNode(document, (Node) resultValue);
	            }
    		}
        } else if (XPathConstants.STRING.equals(type)) {
        	resultValue = result.getSequenceAsString(new Properties());
        } else if (XPathConstants.NUMBER.equals(type)) {
        	resultValue = result.getSequenceAsString(new Properties());
    		resultValue = Integer.parseInt((String) resultValue);
        } else if (XPathConstants.BOOLEAN.equals(type)) {
        	resultValue = result.getSequenceAsString(new Properties());
    		resultValue = Boolean.parseBoolean((String) resultValue);
        }
    	return resultValue;
    }
}


text:
package org.wso2.carbon.event.stream.core.internal.util;

import org.wso2.carbon.databridge.commons.AttributeType;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public interface EventStreamConstants {

    public static final String EVENT_STREAMS = "eventstreams";
    public static final String STREAM_DEFINITION_FILE_EXTENSION = ".json";
    public static final String STREAM_DEFINITION_FILE_EXTENSION_TYPE = "json";
    public static final String STREAM_DEFINITION_FILE_DELIMITER = "_";
    public static final String STREAM_DEFINITION_DELIMITER = ":";

    public static final String ATTR_TYPE_FLOAT = "float";
    public static final String ATTR_TYPE_DOUBLE = "double";
    public static final String ATTR_TYPE_INTEGER = "int";
    public static final String ATTR_TYPE_LONG = "long";
    public static final String ATTR_TYPE_STRING = "string";
    public static final String ATTR_TYPE_BOOLEAN = "boolean";
    public static final String ATTR_TYPE_BOOL = "bool";

    public static final Map<String, AttributeType> STRING_ATTRIBUTE_TYPE_MAP = Collections.unmodifiableMap(new HashMap<String, AttributeType>() {{
        put(ATTR_TYPE_BOOLEAN, AttributeType.BOOL);
        put(ATTR_TYPE_STRING, AttributeType.STRING);
        put(ATTR_TYPE_DOUBLE, AttributeType.DOUBLE);
        put(ATTR_TYPE_FLOAT, AttributeType.FLOAT);
        put(ATTR_TYPE_INTEGER, AttributeType.INT);
        put(ATTR_TYPE_LONG, AttributeType.LONG);
    }});

    public static final String XML_EVENT = "xml";
    public static final String JSON_EVENT = "json";
    public static final String TEXT_EVENT = "text";

    public static final String SAMPLE_EVENTS_PARENT_TAG = "events";
    public static final String SAMPLE_EVENT_PARENT_TAG = "event";
    public static final String SAMPLE_EVENT_META_TAG = "metaData";
    public static final String SAMPLE_EVENT_CORRELATION_TAG = "correlationData";
    public static final String SAMPLE_EVENT_PAYLOAD_TAG = "payloadData";

    public static final String META_PREFIX = "meta_";
    public static final String CORRELATION_PREFIX = "correlation_";
    public static final String EVENT_ATTRIBUTE_VALUE_SEPARATOR = ":";
    public static final String EVENT_ATTRIBUTE_SEPARATOR = ",";

}


text:
// @HEADER
// ************************************************************************
//
//                           Intrepid Package
//                 Copyright (2007) Sandia Corporation
//
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// license for use of this work by or on behalf of the U.S. Government.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the Corporation nor the names of the
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Questions? Contact Pavel Bochev  (pbboche@sandia.gov)
//                    Denis Ridzal  (dridzal@sandia.gov), or
//                    Kara Peterson (kjpeter@sandia.gov)
//
// ************************************************************************
// @HEADER

/** \file   example_17.cpp
    \brief  Application of Laplace operator on a
    hexahedral mesh using arbitrary-degree elements by
    using DGEMM and dual transformations.

    \verbatim
    div grad u = f in Omega
    u = 0 on Gamma

    Discrete linear system for nodal coefficients(x):

    Kx = b

    K - HGrad stiffness matrix
    b - right hand side vector

    \endverbatim

    \author Created by P. Bochev, R. Kirby, D. Ridzal and K. Peterson.

    \remark Usage
    \verbatim

    ./Intrepid_example_Drivers_Example_14.exe N verbose
    int degree          - polynomial degree
    int NX              - num intervals in x direction (assumed box domain, 0,1)
    int NY              - num intervals in x direction (assumed box domain, 0,1)
    int NZ              - num intervals in x direction (assumed box domain, 0,1)
    verbose (optional)  - any character, indicates verbose output

    \endverbatim

    \remark Sample command line
    \code   ./Intrepid_example_Drivers_Example_14.exe 2 10 10 10 \endcode
*/

// Intrepid includes
#include "Intrepid_FunctionSpaceTools.hpp"
#include "Intrepid_FunctionSpaceToolsInPlace.hpp"
#include "Intrepid_FieldContainer.hpp"
#include "Intrepid_CellTools.hpp"
#include "Intrepid_CubaturePolylib.hpp"
#include "Intrepid_CubatureTensor.hpp"
#include "Intrepid_HGRAD_HEX_Cn_FEM.hpp"
#include "Intrepid_TensorProductSpaceTools.hpp"
#include "Intrepid_Utils.hpp"

// Epetra includes
#include "Epetra_Time.h"
#include "Epetra_Map.h"
#include "Epetra_FEVector.h"
#include "Epetra_SerialComm.h"

// Teuchos includes
#include "Teuchos_oblackholestream.hpp"
#include "Teuchos_RCP.hpp"
#include "Teuchos_Time.hpp"
#include "Teuchos_SerialDenseMatrix.hpp"

// Shards includes
#include "Shards_CellTopology.hpp"

// EpetraExt includes
#include "EpetraExt_MultiVectorOut.h"

using namespace std;
using namespace Intrepid;
using Teuchos::rcp;

int main(int argc, char *argv[]) {

  //Check number of arguments
  if (argc < 4) {
    std::cout <<"\n>>> ERROR: Invalid number of arguments.\n\n";
    std::cout <<"Usage:\n\n";
    std::cout <<"  ./Intrepid_example_Drivers_Example_14.exe deg NX NY NZ verbose\n\n";
    std::cout <<" where \n";
    std::cout <<"   int deg             - polynomial degree to be used (assumed >= 1) \n";
    std::cout <<"   int NX              - num intervals in x direction (assumed box domain, 0,1) \n";
    std::cout <<"   int NY              - num intervals in y direction (assumed box domain, 0,1) \n";
    std::cout <<"   int NZ              - num intervals in y direction (assumed box domain, 0,1) \n";
    std::cout <<"   verbose (optional)  - any character, indicates verbose output \n\n";
    exit(1);
  }

  // This little trick lets us print to std::cout only if
  // a (dummy) command-line argument is provided.
  int iprint     = argc - 1;
  Teuchos::RCP<std::ostream> outStream;
  Teuchos::oblackholestream bhs; // outputs nothing
  if (iprint > 2)
    outStream = Teuchos::rcp(&std::cout, false);
  else
    outStream = Teuchos::rcp(&bhs, false);

  // Save the format state of the original std::cout.
  Teuchos::oblackholestream oldFormatState;
  oldFormatState.copyfmt(std::cout);

  *outStream								\
    << "===============================================================================\n" \
    << "|                                                                             |\n" \
    << "|  Example: Apply Stiffness Matrix for                                        |\n" \
    << "|                   Poisson Operator on Hexahedral Mesh with BLAS             |\n" \
    << "|                                                                             |\n" \
    << "|  Questions? Contact  Pavel Bochev  (pbboche@sandia.gov),                    |\n" \
    << "|                      Denis Ridzal  (dridzal@sandia.gov),                    |\n" \
    << "|                      Kara Peterson (kjpeter@sandia.gov).                    |\n" \
    << "|                                                                             |\n" \
    << "|  Intrepid's website: http://trilinos.sandia.gov/packages/intrepid           |\n" \
    << "|  Trilinos website:   http://trilinos.sandia.gov                             |\n" \
    << "|                                                                             |\n" \
    << "===============================================================================\n";

  // ************************************ GET INPUTS **************************************

  int deg          = atoi(argv[1]);  // polynomial degree to use
  int NX           = atoi(argv[2]);  // num intervals in x direction (assumed box domain, 0,1)
  int NY           = atoi(argv[3]);  // num intervals in y direction (assumed box domain, 0,1)
  int NZ           = atoi(argv[4]);  // num intervals in y direction (assumed box domain, 0,1)

  // *********************************** CELL TOPOLOGY **********************************

  // Get cell topology for base hexahedron
  typedef shards::CellTopology    CellTopology;
  CellTopology hex_8(shards::getCellTopologyData<shards::Hexahedron<8> >() );

  // Get dimensions
  int numNodesPerElem = hex_8.getNodeCount();
  int spaceDim = hex_8.getDimension();

  // *********************************** GENERATE MESH ************************************

  *outStream << "Generating mesh ... \n\n";

  *outStream << "   NX" << "   NY" << "   NZ\n";
  *outStream << std::setw(5) << NX <<
    std::setw(5) << NY << std::setw(5) << NZ << "\n\n";

  // Print mesh information
  int numElems = NX*NY*NZ;
  int numNodes = (NX+1)*(NY+1)*(NZ+1);
  *outStream << " Number of Elements: " << numElems << " \n";
  *outStream << "    Number of Nodes: " << numNodes << " \n\n";

  // Cube
  double leftX = 0.0, rightX = 1.0;
  double leftY = 0.0, rightY = 1.0;
  double leftZ = 0.0, rightZ = 1.0;

  // Mesh spacing
  double hx = (rightX-leftX)/((double)NX);
  double hy = (rightY-leftY)/((double)NY);
  double hz = (rightZ-leftZ)/((double)NZ);

  // Get nodal coordinates
  FieldContainer<double> nodeCoord(numNodes, spaceDim);
  FieldContainer<int> nodeOnBoundary(numNodes);
  int inode = 0;
  for (int k=0; k<NZ+1; k++)
    {
      for (int j=0; j<NY+1; j++)
	{
	  for (int i=0; i<NX+1; i++)
	    {
	      nodeCoord(inode,0) = leftX + (double)i*hx;
	      nodeCoord(inode,1) = leftY + (double)j*hy;
	      nodeCoord(inode,2) = leftZ + (double)k*hz;
	      if (k==0 || k==NZ || j==0 || i==0 || j==NY || i==NX)
		{
		  nodeOnBoundary(inode)=1;
		}
	      else
		{
		  nodeOnBoundary(inode)=0;
		}
	      inode++;
	    }
	}
    }
//#define DUMP_DATA
#ifdef DUMP_DATA
  // Print nodal coords
  ofstream fcoordout("coords.dat");
  for (int i=0; i<numNodes; i++) {
    fcoordout << nodeCoord(i,0) <<" ";
    fcoordout << nodeCoord(i,1) <<" ";
    fcoordout << nodeCoord(i,2) <<"\n";
  }
  fcoordout.close();
#endif

  // ********************************* CUBATURE AND BASIS ***********************************
  *outStream << "Getting cubature and basis ... \n\n";

  // Get numerical integration points and weights
  // I only need this on the line since I'm doing tensor products
  Teuchos::RCP<Cubature<double,FieldContainer<double>,FieldContainer<double> > > glcub
    = Teuchos::rcp(new CubaturePolylib<double,FieldContainer<double>,FieldContainer<double> >(2*deg-1,PL_GAUSS_LOBATTO) );

  const int numCubPoints1D = glcub->getNumPoints();

  FieldContainer<double> cubPoints1D(numCubPoints1D, 1);
  FieldContainer<double> cubWeights1D(numCubPoints1D);

  glcub->getCubature(cubPoints1D,cubWeights1D);

  std::vector<Teuchos::RCP<Cubature<double,FieldContainer<double>,FieldContainer<double> > > >
    cub_to_tensor;
  cub_to_tensor.push_back( glcub );
  cub_to_tensor.push_back( glcub );
  cub_to_tensor.push_back( glcub );

  CubatureTensor<double,FieldContainer<double>,FieldContainer<double> > cubhex( cub_to_tensor );

  Basis_HGRAD_HEX_Cn_FEM<double, FieldContainer<double> > hexBasis( deg , POINTTYPE_SPECTRAL );
  const int numFields = hexBasis.getCardinality();

  // get the bases tabulated at the quadrature points, dimension-by-dimension
  const int numCubPoints = cubhex.getNumPoints();
  FieldContainer<double> cubPoints3D( numCubPoints , spaceDim );
  FieldContainer<double> cubWeights3D( numCubPoints );
  FieldContainer<double> basisGrads( numFields , numCubPoints , spaceDim );
  cubhex.getCubature( cubPoints3D , cubWeights3D );
  hexBasis.getValues( basisGrads , cubPoints3D , OPERATOR_GRAD );

  FieldContainer<int> elemToNode(numElems, numNodesPerElem);
  int ielem = 0;
  for (int k=0; k<NZ; k++)
    {
      for (int j=0; j<NY; j++)
        {
          for (int i=0; i<NX; i++)
            {
              elemToNode(ielem,0) = k * ( NX + 1 ) * ( NY + 1 ) + j * ( NX + 1 ) + i;
              elemToNode(ielem,1) = k * ( NX + 1 ) * ( NY + 1 ) + j * ( NX + 1 ) + i + 1;
              elemToNode(ielem,2) = k * ( NX + 1 ) * ( NY + 1 ) + ( j + 1 ) * ( NX + 1 ) + i + 1;
              elemToNode(ielem,3) = k * ( NX + 1 ) * ( NY + 1 ) + ( j + 1 ) * ( NX + 1 ) + i;
              elemToNode(ielem,4) = ( k + 1 ) * ( NX + 1 ) * ( NY + 1 ) + j * ( NX + 1 ) + i;
              elemToNode(ielem,5) = ( k + 1 ) * ( NX + 1 ) * ( NY + 1 ) + j * ( NX + 1 ) + i + 1;
              elemToNode(ielem,6) = ( k + 1 ) * ( NX + 1 ) * ( NY + 1 ) + ( j + 1 ) * ( NX + 1 ) + i + 1;
              elemToNode(ielem,7) = ( k + 1 ) * ( NX + 1 ) * ( NY + 1 ) + ( j + 1 ) * ( NX + 1 ) + i;
              ielem++;
            }
        }
    }
#ifdef DUMP_DATA
  // Output connectivity
  ofstream fe2nout("elem2node.dat");
  for (int k=0;k<NZ;k++)
    {
      for (int j=0; j<NY; j++)
        {
          for (int i=0; i<NX; i++)
            {
              int ielem = i + j * NX + k * NY * NY;
              for (int m=0; m<numNodesPerElem; m++)
                {
                  fe2nout << elemToNode(ielem,m) <<"  ";
                }
              fe2nout <<"\n";
            }
        }
    }
  fe2nout.close();
#endif

  // ********************************* 3-D LOCAL-TO-GLOBAL MAPPING *******************************
  FieldContainer<int> ltgMapping(numElems,numFields);
  const int numDOF = (NX*deg+1)*(NY*deg+1)*(NZ*deg+1);
  ielem=0;
  for (int k=0;k<NZ;k++)
    {
      for (int j=0;j<NY;j++)
	{
	  for (int i=0;i<NX;i++)
	    {
	      const int start = k * ( NY * deg + 1 ) * ( NX * deg + 1 ) + j * ( NX * deg + 1 ) + i * deg;
	      // loop over local dof on this cell
	      int local_dof_cur=0;
	      for (int kloc=0;kloc<=deg;kloc++)
		{
		  for (int jloc=0;jloc<=deg;jloc++)
		    {
		      for (int iloc=0;iloc<=deg;iloc++)
			{
			  ltgMapping(ielem,local_dof_cur) = start
			    + kloc * ( NX * deg + 1 ) * ( NY * deg + 1 )
			    + jloc * ( NX * deg + 1 )
			    + iloc;
			  local_dof_cur++;
			}
		    }
		}
	      ielem++;
	    }
	}
    }
#ifdef DUMP_DATA
  // Output ltg mapping
  ielem = 0;
  ofstream ltgout("ltg.dat");
  for (int k=0;k<NZ;k++)
    {
      for (int j=0; j<NY; j++)
	{
	  for (int i=0; i<NX; i++)
	    {
	      int ielem = i + j * NX + k * NX * NY;
	      for (int m=0; m<numFields; m++)
		{
		  ltgout << ltgMapping(ielem,m) <<"  ";
		}
	      ltgout <<"\n";
	    }
	}
    }
  ltgout.close();
#endif

  // ********** DECLARE GLOBAL OBJECTS *************
  Epetra_SerialComm Comm;
  Epetra_Map globalMapG(numDOF, 0, Comm);
  Epetra_FEVector u(globalMapG);  u.Random();
  Epetra_FEVector Ku(globalMapG);

  // ************* For Jacobians **********************
  FieldContainer<double> cellVertices(numElems,numNodesPerElem,spaceDim);
  FieldContainer<double> cellJacobian(numElems,numCubPoints,spaceDim,spaceDim);
  FieldContainer<double> cellJacobInv(numElems,numCubPoints,spaceDim,spaceDim);
  FieldContainer<double> cellJacobDet(numElems,numCubPoints);

  // get vertices of cells (for computing Jacobians)
  for (int i=0;i<numElems;i++)
    {
      for (int j=0;j<numNodesPerElem;j++)
        {
          const int nodeCur = elemToNode(i,j);
          for (int k=0;k<spaceDim;k++)
            {
              cellVertices(i,j,k) = nodeCoord(nodeCur,k);
            }
        }
    }

  // jacobian evaluation
  CellTools<double>::setJacobian(cellJacobian,cubPoints3D,cellVertices,hex_8);
  CellTools<double>::setJacobianInv(cellJacobInv, cellJacobian );
  CellTools<double>::setJacobianDet(cellJacobDet, cellJacobian );

  // ************* MATRIX-FREE APPLICATION
  FieldContainer<double> uScattered(numElems,1,numFields);
  FieldContainer<double> KuScattered(numElems,1,numFields);
  FieldContainer<double> gradU(numElems,1,numFields,3);

  // get views in SDM format for BLAS purposes
  Teuchos::SerialDenseMatrix<int,double> refGradsAsMat( Teuchos::View ,
						     &basisGrads[0] ,
						     numCubPoints * spaceDim ,
						     numCubPoints * spaceDim ,
						     numFields );
  Teuchos::SerialDenseMatrix<int,double> uScatAsMat( Teuchos::View ,
						     &uScattered[0] ,
						     numFields ,
						     numFields ,
						     numElems );
  Teuchos::SerialDenseMatrix<int,double> GraduScatAsMat( Teuchos::View ,
							 &gradU[0] ,
							 numCubPoints * spaceDim ,
							 numCubPoints * spaceDim ,
							 numElems );
  Teuchos::SerialDenseMatrix<int,double> KuScatAsMat( Teuchos::View ,
						      &KuScattered[0] ,
						      numFields ,
						      numFields ,
						      numElems );

  u.GlobalAssemble();

  Ku.PutScalar(0.0);
  Ku.GlobalAssemble();

  double *uVals = u[0];
  double *KuVals = Ku[0];

  Teuchos::Time full_timer( "Time to apply operator matrix-free:" );
  Teuchos::Time scatter_timer( "Time to scatter dof:" );
  Teuchos::Time elementwise_timer( "Time to do elementwise computation:" );
  Teuchos::Time grad_timer( "Time to compute gradients:" );
  Teuchos::Time pointwise_timer( "Time to do pointwise transformations:" );
  Teuchos::Time moment_timer( "Time to compute moments:" );
  Teuchos::Time gather_timer( "Time to gather dof:" );

  full_timer.start();

  scatter_timer.start();
  for (int k=0; k<numElems; k++)
    {
      for (int i=0;i<numFields;i++)
        {
          uScattered(k,0,i) = uVals[ltgMapping(k,i)];
        }
    }
  scatter_timer.stop();

  elementwise_timer.start();

  grad_timer.start();
  // reference grad per cell with BLAS
  GraduScatAsMat.multiply( Teuchos::NO_TRANS , Teuchos::NO_TRANS ,
			   1.0 , refGradsAsMat , uScatAsMat , 0.0 );

  grad_timer.stop();
  pointwise_timer.start();
  // pointwise transformations of gradients
  Intrepid::FunctionSpaceToolsInPlace::HGRADtransformGRAD<double>( gradU , cellJacobian );
  Intrepid::FunctionSpaceToolsInPlace::HGRADtransformGRADDual<double>( gradU , cellJacobian );
  Intrepid::FunctionSpaceToolsInPlace::multiplyMeasure<double>( gradU , cellJacobDet );
  pointwise_timer.stop();
  moment_timer.start();

  KuScatAsMat.multiply( Teuchos::TRANS , Teuchos::NO_TRANS , 1.0 , refGradsAsMat , GraduScatAsMat , 0.0 );

  moment_timer.stop();
  elementwise_timer.stop();
  gather_timer.start();
  for (int k=0;k<numElems;k++)
    {
      for (int i=0;i<numFields;i++)
        {
          KuVals[ltgMapping(k,i)] += KuScattered(k,0,i);
        }
    }
  gather_timer.stop();
  full_timer.stop();

  *outStream << full_timer.name() << " " << full_timer.totalElapsedTime() << " sec\n";
  *outStream << "\t" << scatter_timer.name() << " " << scatter_timer.totalElapsedTime() << " sec\n";
  *outStream << "\t" << elementwise_timer.name() << " " << elementwise_timer.totalElapsedTime() << " sec\n";
  *outStream << "\t\t" << grad_timer.name() << " " << grad_timer.totalElapsedTime() << " sec\n";
  *outStream << "\t\t" << pointwise_timer.name() << " " << pointwise_timer.totalElapsedTime() << " sec\n";
  *outStream << "\t\t" << moment_timer.name() << " " << moment_timer.totalElapsedTime() << " sec\n";
  *outStream << "\t" << gather_timer.name() << " " << gather_timer.totalElapsedTime() << " sec\n";

  *outStream << "End Result: TEST PASSED\n";

  // reset format state of std::cout
  std::cout.copyfmt(oldFormatState);

  return 0;
}


text:
function add_error(header, description){
	var e = document.createElement("div");
	e.className = "alert alert-danger alert-dismissible"
	e.setAttribute("role", "alert");
	e.appendChild(build_dismiss());
	var top_wrapper = document.createElement("strong");
	var top_message = document.createTextNode(header);
	top_wrapper.appendChild(top_message);
	e.appendChild(top_wrapper);
	var main_message = document.createTextNode(description);
	e.appendChild(document.createElement("br"));
	e.appendChild(main_message);
	return $("#error-list").append(e);
}

function build_dismiss() {
	var dis = document.createElement("button");
	dis.className = "close";
	dis.setAttribute("type", "button");
	dis.setAttribute("data-dismiss", "alert");
	dis.setAttribute("aria-label", "Close");
	var c = document.createElement("span");
	c.setAttribute("aria-hidden", "true");
	c.innerHTML = "×";
	dis.appendChild(c);
	return dis;
}


text:
package at.ac.tuwien.iter.exceptions;

public class TestExecutionException extends Exception {

	private static final long serialVersionUID = -1771695276788094290L;

	public TestExecutionException() {
		super();
	}

	public TestExecutionException(String message, Throwable t) {
		super(message, t);
	}

	public TestExecutionException(String message) {
		super(message);
	}

	public TestExecutionException(Throwable t) {
		super("Test execution failed due to the following exception:\n", t);
	}
}


text:
package com.astronautlabs.mc.rezolve.core;

import java.util.Iterator;

import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;

import net.minecraft.launchwrapper.IClassTransformer;

public class EntityPlayerTransformer implements IClassTransformer {

	@Override
	public byte[] transform(String name, String transformedName, byte[] basicClass) {
		if ("net.minecraft.entity.player.EntityPlayer".equals(transformedName))
			return this.patchEntityPlayer(name, transformedName, basicClass);
		if ("net.minecraft.entity.player.EntityPlayerMP".equals(transformedName))
			return this.patchEntityPlayer(name, transformedName, basicClass);

		return basicClass;
	}

	private byte[] patchEntityPlayer(String name, String transformedName, byte[] bytes) {

		System.out.println("REZOLVE Transforming EntityPlayer class with name: "+name+" -- Transformed name: "+transformedName);

		String targetMethodName = "onUpdate";
		String targetInvokedMethodName = "canInteractWith";
		String targetInvokedMethodOwner = "net/minecraft/inventory/Container";
		String targetInvokedMethodDesc = "(Lnet/minecraft/entity/player/EntityPlayer;)Z";

		if (!name.equals(transformedName)) {
			targetMethodName = "func_70071_h_";
			targetInvokedMethodName = "func_75145_c";
		}

		//set up ASM class manipulation stuff. Consult the ASM docs for details
		ClassNode classNode = new ClassNode();
		ClassReader classReader = new ClassReader(bytes);
		classReader.accept(classNode, 0);

		Iterator<MethodNode> methods = classNode.methods.iterator();
		while(methods.hasNext()) {
			MethodNode m = methods.next();
			int target_index = -1;

			System.out.println("REZOLVE: EntityPlayer method "+m.name);
			//Check if this is doExplosionB and it's method signature is ()V which means that it takes no args ("()") and returns a void ("V")
			if (!m.name.equals(targetMethodName) || !m.desc.equals("()V"))
				continue;

			System.out.println("********* Inside target method!");

			MethodInsnNode targetNode = null;

			@SuppressWarnings("unchecked")
			Iterator<AbstractInsnNode> iter = m.instructions.iterator();

			int index = -1;

			//Loop over the instruction set and find the instruction FDIV which does the division of 1/explosionSize
			while (iter.hasNext())
			{
				index++;
				AbstractInsnNode node = iter.next();

				// mv.visitFieldInsn(GETFIELD, "net/minecraft/entity/player/EntityPlayer", "openContainer", "Lnet/minecraft/inventory/Container;");
				// mv.visitVarInsn(ALOAD, 0); // loading the player onto the stack
				// // stack is [container, player]
				// mv.visitMethodInsn(INVOKEVIRTUAL, "net/minecraft/inventory/Container", "canInteractWith", "(Lnet/minecraft/entity/player/EntityPlayer;)Z", false);

				//Found it! save the index location and node for this instruction
				if (node.getOpcode() == Opcodes.INVOKEVIRTUAL) {

					MethodInsnNode invokeNode = (MethodInsnNode)node;

					System.out.println("Looking at an invocation to "+invokeNode.owner+"::"+invokeNode.name+"::"+invokeNode.desc);
					boolean matches =
						targetInvokedMethodOwner.equals(invokeNode.owner)
						&& targetInvokedMethodName.equals(invokeNode.name)
						&& targetInvokedMethodDesc.equals(invokeNode.desc)
					;

					if (matches) {
						System.out.println("Identified canInteractWith instruction...");
						targetNode = invokeNode;
						target_index = index;
						break;
					}
				}
			}

			if (targetNode == null) {
				throw new RuntimeException("Could not locate canInteractWith instruction!");
			} else {

				System.out.println("Patching canInteractWith instruction...");
				m.instructions.insertBefore(
					targetNode,
					new MethodInsnNode(Opcodes.INVOKESTATIC,
						"com/astronautlabs/mc/rezolve/RezolveMod",
						"canInteractWith",
						Type.getMethodDescriptor(
							Type.BOOLEAN_TYPE,
							Type.getObjectType("java/lang/Object"),
							Type.getObjectType("java/lang/Object")
						),
						false
					)
				);

				m.instructions.remove(targetNode);

				System.out.println("[Rezolve/EntityPlayer.onUpdate] Patching Complete!");
			}

			break;
		}

		//ASM specific for cleaning up and returning the final bytes for JVM processing.
		ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
		classNode.accept(writer);
		return writer.toByteArray();

	}

}


text:
package builtin_md;

public class builtin_concurrent_Future extends builtin.reflect.Class implements io.datawire.quark.runtime.QObject {
    public static builtin.reflect.Class singleton = new builtin_concurrent_Future();
    public builtin_concurrent_Future() {
        super("builtin.concurrent.Future");
        (this).name = "builtin.concurrent.Future";
        (this).parameters = new java.util.ArrayList(java.util.Arrays.asList(new Object[]{}));
        (this).fields = new java.util.ArrayList(java.util.Arrays.asList(new Object[]{new builtin.reflect.Field("builtin.concurrent.Context", "_context"), new builtin.reflect.Field("builtin.bool", "_finished"), new builtin.reflect.Field("builtin.String", "_error"), new builtin.reflect.Field("builtin.List<builtin.concurrent.FutureCompletion>", "_callbacks"), new builtin.reflect.Field("builtin.concurrent.Lock", "_lock")}));
        (this).methods = new java.util.ArrayList(java.util.Arrays.asList(new Object[]{new builtin_concurrent_Future_onFinished_Method(), new builtin_concurrent_Future_finish_Method(), new builtin_concurrent_Future_isFinished_Method(), new builtin_concurrent_Future_getError_Method(), new builtin_concurrent_Future_await_Method(), new builtin_concurrent_Future_getContext_Method()}));
    }
    public Object construct(java.util.ArrayList<Object> args) {
        return new builtin.concurrent.Future();
    }
    public String _getClass() {
        return (String) (null);
    }
    public Object _getField(String name) {
        return null;
    }
    public void _setField(String name, Object value) {}
}


text:
package com.evolveum.midpoint.web.component.prism;

import java.util.List;

import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.request.resource.ResourceReference;

import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;

/**
 * @author lazyman
 */
public class PrismObjectPanel<O extends ObjectType> extends Panel {
	private static final long serialVersionUID = 1L;

	private static final String STRIPED_CLASS = "striped";

    private static final String ID_HEADER = "header";
    private static final String ID_CONTAINERS = "containers";
    private static final String ID_CONTAINER = "container";

    private static final Trace LOGGER = TraceManager.getTrace(PrismObjectPanel.class);

    private PageBase pageBase;

    public PrismObjectPanel(String id, IModel<ObjectWrapper<O>> model, ResourceReference image, Form<ObjectWrapper<O>> form, PageBase pageBase) {
        super(id);
        setOutputMarkupId(true);

        LOGGER.trace("Creating object panel for {}", model.getObject());

        this.pageBase = pageBase;
        initLayout(model, image, form);
    }

    private void initLayout(final IModel<ObjectWrapper<O>> model, ResourceReference image, final Form<ObjectWrapper<O>> form) {
        Component headerComponent = createHeader(ID_HEADER, model);
        add(headerComponent);

        ListView<ContainerWrapper> containers = new ListView<ContainerWrapper>(ID_CONTAINERS,
                createContainerModel(model)) {
			private static final long serialVersionUID = 1L;

			@Override
            protected void populateItem(ListItem<ContainerWrapper> item) {
                createContainerPanel(item, form);
            }
        };
        containers.setReuseItems(true);
        add(containers);
    }

	public void removeAllContainerWrappers() {
		((ListView<ContainerWrapper>) get(ID_CONTAINERS)).removeAll();
	}

    protected Component createHeader(String id, IModel<ObjectWrapper<O>> model) {
    	PrismHeaderPanel header = new PrismHeaderPanel(ID_HEADER, model) {
			private static final long serialVersionUID = 1L;

			@Override
			protected void onButtonClick(AjaxRequestTarget target) {
				target.add(PrismObjectPanel.this);
			}

			@Override
			public boolean isButtonsVisible() {
				return true;
			}
    	};
        return header;
    }

    protected IModel<List<ContainerWrapper>> createContainerModel(IModel<ObjectWrapper<O>> model){
        return new PropertyModel<>(model, ObjectWrapper.PROPERTY_CONTAINERS);
    }

    protected void createContainerPanel(ListItem<ContainerWrapper> item, Form form){
        PrismContainerPanel panel = new PrismContainerPanel(ID_CONTAINER, item.getModel(), true, form, pageBase);
        panel.setOutputMarkupPlaceholderTag(true);
        item.add(panel);
    }

}


text:
<back-button back="Back" ng-if="backButton === true"></back-button>

                {{user.login}}
                {{emails[user.login]}}

        More