text:
package com.makerfaireorlando.makerfaireorlando.Utils;

public class Constants {
    public static final String EVENT = "OMF_EVENT";
    public static final String PROJECT = "OMF_PROJECT";
}


text:
def log(string):
  import logging
  logging.info('================ RECEIVED DATA')

  import shakesearch
  shakesearch.receive(string)

redpajama_set_name: RedPajamaGithub


text:
package org.apache.jena.sparql.core;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import org.apache.jena.graph.Graph;
import org.apache.jena.graph.Node;
import org.apache.jena.graph.TransactionHandler;
import org.apache.jena.graph.Triple;
import org.apache.jena.query.ReadWrite;
import org.apache.jena.shared.JenaException;
import org.apache.jena.sparql.JenaTransactionException;
import org.apache.jena.sparql.graph.GraphFactory;
import org.apache.jena.sparql.graph.GraphSink;
import org.apache.jena.sparql.graph.GraphZero;
import org.apache.jena.sparql.sse.SSE;
import org.apache.jena.system.Txn;
import org.junit.Test;

/** Tests for
 * {@link DatasetGraphZero},
 * {@link DatasetGraphSink} and
 * {@link DatasetGraphOne}
 * and (via their use in datasets):
 * {@link GraphZero} and
 * {@link GraphSink}
*/
public class TestSpecials {

    private static Quad quad = SSE.parseQuad("(:g :s :p :o)");
    private static Triple triple = SSE.parseTriple("(:s :p :o)");
    private static Node gn = SSE.parseNode(":gn");

    // -- zero

    @Test public void zero_basic_1() {
        DatasetGraph dsg = DatasetGraphZero.create();
        assertFalse(dsg.find().hasNext());
        assertTrue(dsg.supportsTransactionAbort());
        assertEquals(0, dsg.getDefaultGraph().size());
        assertFalse(dsg.getDefaultGraph().getCapabilities().addAllowed());
    }

    @Test public void zero_basic_2() {
        DatasetGraph dsg = DatasetGraphZero.create();
        assertNull(dsg.getGraph(gn));
    }

    @Test(expected=UnsupportedOperationException.class)
    public void zero_add_1() {
        DatasetGraph dsg = DatasetGraphZero.create();
        dsg.add(quad);
    }

    @Test(expected=UnsupportedOperationException.class)
    public void zero_add_2() {
        DatasetGraph dsg = DatasetGraphZero.create();
        dsg.getDefaultGraph().add(triple);
    }

    @Test(expected=UnsupportedOperationException.class)
    public void zero_add_3() {
        DatasetGraph dsg = DatasetGraphZero.create();
        dsg.addGraph(gn, GraphFactory.createGraphMem());
    }

    @Test(expected=UnsupportedOperationException.class)
    public void zero_delete_1() {
        DatasetGraph dsg = DatasetGraphZero.create();
        dsg.delete(quad);
    }

    @Test(expected=UnsupportedOperationException.class)
    public void zero_delete_2() {
        DatasetGraph dsg = DatasetGraphZero.create();
        dsg.getDefaultGraph().delete(triple);
    }

    @Test(expected=UnsupportedOperationException.class)
    public void zero_delete_3() {
        DatasetGraph dsg = DatasetGraphZero.create();
        dsg.deleteAny(Node.ANY, Node.ANY, Node.ANY, Node.ANY);
    }

    @Test public void zero_txn_1() {
        DatasetGraph dsg = DatasetGraphZero.create();
        Txn.executeRead(dsg, ()->{});
        Txn.executeWrite(dsg, ()->{});
    }

    @Test(expected=JenaTransactionException.class)
    public void zero_txn_2() {
        DatasetGraph dsg = DatasetGraphZero.create();
        dsg.begin(ReadWrite.READ);
        dsg.begin(ReadWrite.READ);
    }

    @Test(expected=JenaTransactionException.class)
    public void zero_txn_3() {
        DatasetGraph dsg = DatasetGraphZero.create();
        dsg.commit();
    }

    @Test(expected=JenaTransactionException.class)
    public void zero_txn_4() {
        DatasetGraph dsg = DatasetGraphZero.create();
        dsg.begin(ReadWrite.WRITE);
        dsg.commit();
        dsg.commit();
    }

    @Test public void zero_graph_txn_1() {
        DatasetGraph dsg = DatasetGraphZero.create();
        Graph g = dsg.getDefaultGraph();
        g.getTransactionHandler().execute(()->{});
    }

    @Test public void zero_graph_txn_2() {
        DatasetGraph dsg = DatasetGraphZero.create();
        Graph g = dsg.getDefaultGraph();
        TransactionHandler h = g.getTransactionHandler();
        h.begin();
        h.abort();
    }

    @Test(expected=JenaException.class)
    public void zero_graph_txn_3() {
        DatasetGraph dsg = DatasetGraphZero.create();
        Graph g = dsg.getDefaultGraph();
        TransactionHandler h = g.getTransactionHandler();
        h.begin();
        h.begin();
    }

    @Test(expected=JenaException.class)
    public void zero_graph_txn_4() {
        DatasetGraph dsg = DatasetGraphZero.create();
        Graph g = dsg.getDefaultGraph();
        TransactionHandler h = g.getTransactionHandler();
        h.begin();
        h.commit();
        h.abort();
    }

    @Test(expected=JenaException.class)
    public void zero_graph_txn_5() {
        DatasetGraph dsg = DatasetGraphZero.create();
        Graph g = dsg.getDefaultGraph();
        TransactionHandler h = g.getTransactionHandler();
        h.commit();
    }

    // -- sink

    @Test public void sink_basic_1() {
        DatasetGraph dsg = DatasetGraphSink.create();
        assertFalse(dsg.find().hasNext());
        assertTrue(dsg.supportsTransactionAbort());
        assertEquals(0, dsg.getDefaultGraph().size());
        assertTrue(dsg.getDefaultGraph().getCapabilities().addAllowed());
    }

    @Test public void sink_basic_2() {
        DatasetGraph dsg = DatasetGraphSink.create();
        assertNull(dsg.getGraph(gn));
    }

    @Test public void sink_add_1() {
        DatasetGraph dsg = DatasetGraphSink.create();
        dsg.add(quad);
    }

    @Test public void sink_add_2() {
        DatasetGraph dsg = DatasetGraphSink.create();
        dsg.getDefaultGraph().add(triple);
    }

    @Test
    public void sink_add_3() {
        DatasetGraph dsg = DatasetGraphSink.create();
        dsg.addGraph(gn, GraphFactory.createGraphMem());
    }

    @Test public void sink_delete_1() {
        DatasetGraph dsg = DatasetGraphSink.create();
        dsg.add(quad);
    }

    @Test public void sink_delete_2() {
        DatasetGraph dsg = DatasetGraphSink.create();
        dsg.getDefaultGraph().add(triple);
    }

    @Test
    public void sink_delete_3() {
        DatasetGraph dsg = DatasetGraphSink.create();
        dsg.deleteAny(Node.ANY, Node.ANY, Node.ANY, Node.ANY);
    }

    @Test public void sink_txn_1() {
        DatasetGraph dsg = DatasetGraphSink.create();
        Txn.executeRead(dsg, ()->{});
        Txn.executeWrite(dsg, ()->{});
    }

    @Test(expected=JenaTransactionException.class)
    public void sink_txn_2() {
        DatasetGraph dsg = DatasetGraphSink.create();
        dsg.begin(ReadWrite.READ);
        dsg.begin(ReadWrite.READ);
    }

    @Test(expected=JenaTransactionException.class)
    public void sink_txn_3() {
        DatasetGraph dsg = DatasetGraphSink.create();
        dsg.commit();
    }

    @Test(expected=JenaTransactionException.class)
    public void sink_txn_4() {
        DatasetGraph dsg = DatasetGraphSink.create();
        dsg.begin(ReadWrite.WRITE);
        dsg.commit();
        dsg.commit();
    }

    @Test public void sink_graph_txn_1() {
        DatasetGraph dsg = DatasetGraphSink.create();
        Graph g = dsg.getDefaultGraph();
        g.getTransactionHandler().execute(()->{});
    }

    @Test public void sink_graph_txn_2() {
        DatasetGraph dsg = DatasetGraphSink.create();
        Graph g = dsg.getDefaultGraph();
        TransactionHandler h = g.getTransactionHandler();
        h.begin();
        h.abort();
    }

    @Test(expected=JenaException.class)
    public void sink_graph_txn_3() {
        DatasetGraph dsg = DatasetGraphSink.create();
        Graph g = dsg.getDefaultGraph();
        TransactionHandler h = g.getTransactionHandler();
        h.begin();
        h.begin();
    }

    @Test(expected=JenaException.class)
    public void sink_graph_txn_4() {
        DatasetGraph dsg = DatasetGraphSink.create();
        Graph g = dsg.getDefaultGraph();
        TransactionHandler h = g.getTransactionHandler();
        h.begin();
        h.commit();
        h.abort();
    }

    @Test(expected=JenaException.class)
    public void sink_graph_txn_5() {
        DatasetGraph dsg = DatasetGraphSink.create();
        Graph g = dsg.getDefaultGraph();
        TransactionHandler h = g.getTransactionHandler();
        h.commit();
    }
}


text:
package se.unlogic.standardutils.xml;

import javax.xml.transform.Source;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.URIResolver;
import javax.xml.transform.stream.StreamSource;
import java.io.File;

public class CachedXSLTFile extends CachedXSLTBase{

	private File file;
	private URIResolver uriResolver;

	public void reloadStyleSheet() throws TransformerConfigurationException{
		this.cacheStyleSheet(file);
	}

	public CachedXSLTFile(File f) throws TransformerConfigurationException{
		this.file = f;
		this.cacheStyleSheet(f);
	}

	public CachedXSLTFile(File file, URIResolver uriResolver) throws TransformerConfigurationException {

		this.file =  file;
		this.uriResolver = uriResolver;
		this.cacheStyleSheet(file);
	}

	private void cacheStyleSheet(File f) throws TransformerConfigurationException{
		Source xsltSource = new StreamSource(f);
		TransformerFactory transFact = TransformerFactory.newInstance();

		if(uriResolver != null){
			transFact.setURIResolver(uriResolver);
		}

		this.templates = transFact.newTemplates(xsltSource);
		this.file = f;
	}

	@Override
	public String toString() {

		return "CachedXSLTFile: " + file;
	}
}


text:
luarocks install https://raw.githubusercontent.com/eladhoffer/lmdb.torch/master/lmdb.torch-scm-1.rockspec

luarocks install protobuf


text:
"use strict";

/**
 * Handles loading/refreshing external resources associated with a
 * CA. The set of resources needed are updated in a transactional manner and
 * recreated after migration/failure.
 *
 *
 * The name of this component in a ca.json description should be pull_ca.
 *
 * @name caf_pull/plug_ca_pull
 * @namespace
 * @augments gen_transactional
 *
 */

var caf = require('caf_core');
var genTransactional = caf.gen_transactional;
var json_rpc = caf.json_rpc;

var addResourceOp = function(alias, url, updatedMethod) {
    return {'op' : 'addResource', 'alias' : alias, 'url': url,
             'updatedMethod' : updatedMethod};
};

var removeResourceOp = function(alias) {
     return {'op' : 'removeResource', 'alias' : alias};
};

var refreshResourceOp = function(alias) {
    return {'op' : 'refreshResource', 'alias' : alias};
};

/*
 * Factory method to create a plug for this CA  to  access locally
 * cached resources.
 *
 */
exports.newInstance = function(context, spec, secrets, cb) {

    var $ = context;
    /*
     * Resource Type:
     * {String : {'url' : <string>, 'updatedMethod' : <string>}}
     *
     *
     */
    var resources = {};
    var logActions = [];

    var that = genTransactional.constructor(spec, secrets);

    that.addResource = function(alias, url, updatedMethod) {
        logActions.push(addResourceOp(alias, url, updatedMethod));
    };

    that.removeResource = function(alias) {
        logActions.push(removeResourceOp(alias));
    };

    that.refreshResource = function(alias) {
        logActions.push(refreshResourceOp(alias));
    };

    that.getResourceInfo = function(alias) {
        return resources[alias];
    };

    that.listResources = function() {
         return Object.keys(resources);
    };

    var newUpdateF = function(alias, methodName) {
        return function(fileName, version, cb0) {
            var cb1 = function(err, data) {
                if (err) {
                    cb0(err);
                } else {
                    if (json_rpc.isSystemError(data)) {
                        /*
                         * CA shutdown. Cleanup cached resource.
                         */
                        cb0(data);
                    } else {
                        // ignore application errors
                        cb0(err, data);
                    }
                }
            };
            // signature is function(alias, fileName, version, cb)
            var notifMsg = json_rpc.request(json_rpc.SYSTEM_TOKEN, secrets.myId,
                                            json_rpc.SYSTEM_FROM,
                                            json_rpc.SYSTEM_SESSION_ID,
                                            methodName,
                                            alias, fileName, version);
            secrets.inqMgr && secrets.inqMgr.process(notifMsg, cb1);
        };
    };

    var replayLog = function() {
        logActions.forEach(
            function(action) {
                switch (action.op) {
                case 'addResource' :
                    var res = {'url' : action.url,
                               'alias' : action.alias,
                               'updatedMethod' : action.updatedMethod};
                    resources[action.alias] = res;
                    var notifyF = newUpdateF(action.alias,
                                             action.updatedMethod);
                    $.pull_mux.addResource(secrets.myId, action.alias,
                                           action.url, notifyF);
                    break;
                case 'removeResource':
                    delete resources[action.alias];
                    $.pull_mux.removeResource(secrets.myId, action.alias);
                    break;
                case 'refreshResource':
                    $.pull_mux.refreshResource(secrets.myId, action.alias);
                    break;
                default:
                    throw new Error('CA Pull : invalid log action ' +
                                    action.op);
                }
            });
        logActions = [];
    };

    // Framework methods

    that.__ca_init__ = function(cb0) {
        resources = {};
        logActions = [];
        cb0(null);
    };

    var restore = function(target) {
      var result = [];
      for (var name in target) {
          var alias = target[name].alias;
          var url = target[name].url;
          var updatedMethod = target[name].updatedMethod;
          result.push(addResourceOp(alias, url, updatedMethod));
      }
      return result;
    };

    that.__ca_resume__ = function(cp, cb0) {
        cp = cp || {};
        resources = cp.resources || {};
        logActions = restore(resources);
        logActions = logActions.concat(cp.logActions || []);
        replayLog();
        cb0(null);
    };

    that.__ca_begin__ = function(msg, cb0) {
        logActions = [];
        cb0(null);
    };

    that.__ca_prepare__ = function(cb0) {
        var dumpState = {
            'logActions' : logActions,
            'resources' : resources
        };
        cb0(null, JSON.stringify(dumpState));
    };

    that.__ca_commit__ = function(cb0) {
        replayLog();
        cb0(null);
    };

    that.__ca_abort__ = function(cb0) {
        logActions = [];
        cb0(null);
    };

    cb(null, that);

};


text:
<?php

namespace ANDS\API\Task\ImportSubTask;

use ANDS\Registry\Providers\RelationshipProvider;
use ANDS\RegistryObject;

/**
 * Class PopulateAffectedList
 * @package ANDS\API\Task\ImportSubTask
 */
class PopulateAffectedList extends ImportSubTask
{
    protected $requireImportedRecords = true;
    protected $title = "GENERATING AFFECTED LIST";
    private $chunkLimit = 100;

    public function run_task()
    {
        $ids = [];
        $keys = [];
        foreach (['party', 'activity', 'collection', 'service'] as $class) {
            if ($this->parent()->getTaskData("imported_".$class."_ids")) {
                $ids = array_merge(
                    $ids, $this->parent()->getTaskData("imported_".$class."_ids")
                );
                $keys = array_merge(
                    $keys, $this->parent()->getTaskData("imported_".$class."_keys")
                );
            }
        }

        // try importedRecords if the imported_$class_ids are not populated
        // this is the case for ManualImport pipeline
        if (sizeof($ids) == 0) {
            $importedRecords = $this->parent()->getTaskData('importedRecords');
            $ids = $importedRecords;
            $keys = RegistryObject::whereIn('registry_object_id', $ids)
                ->get()->pluck('key')->toArray();
        }

        $total = count($ids);

        $this->log("Getting affectedIDs for $total records");

        $chunkIDs = collect($ids)->chunk($this->chunkLimit);
        $chunkKeys = collect($keys)->chunk($this->chunkLimit);
        $numChunk = count($chunkIDs);

        $this->log("Number of chunks: $numChunk");

        $affectedRecordIDs = [];
        foreach ($chunkIDs as $index => $chunk) {
            $affectedRecordIDs = array_merge(
                $affectedRecordIDs,
                RelationshipProvider::getAffectedIDsFromIDs(
                    $chunk->toArray(),
                    $chunkKeys->get($index)->toArray(),
                    true
                )
            );

            $affectedRecordIDs = collect($affectedRecordIDs)
                ->flatten()->unique()->values()->toArray();

            $this->updateProgress($index, $numChunk, "Processed ($index/$numChunk)");
        }

        $affectedRecordIDs = collect($affectedRecordIDs)->filter(function($item) use ($ids){
            return !in_array($item, $ids);
        })->unique()->values()->toArray();

        $currentAffectedRecords = $this->parent()->getTaskData('affectedRecords') ? $this->parent()->getTaskData('affectedRecords') : [];
        if ($currentAffectedRecords) {
            $affectedRecordIDs = array_merge($currentAffectedRecords, $affectedRecordIDs);
        }

        // make absolute sure that it's a unique list
        $affectedRecordIDs = collect($affectedRecordIDs)
            ->flatten()->unique()->values()->toArray();

        $countAffected = count($affectedRecordIDs);
        $this->log("Found $countAffected affected records");

        $this->parent()->setTaskData("affectedRecords", $affectedRecordIDs);
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>AndroidSQLiteStorageEngine.SQLiteCursorWrapper</title>
<meta name="date" content="2014-04-23">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

com.google.android.glass.TMM

Class AndroidSQLiteStorageEngine.SQLiteCursorWrapper

java.lang.Object

com.google.android.glass.TMM.AndroidSQLiteStorageEngine.SQLiteCursorWrapper

All Implemented Interfaces:

com.couchbase.lite.storage.Cursor

Enclosing class:

AndroidSQLiteStorageEngine

private class AndroidSQLiteStorageEngine.SQLiteCursorWrapper
extends java.lang.Object
implements com.couchbase.lite.storage.Cursor

Field Summary

Fields

Modifier and Type
Field and Description

private android.database.Cursor
delegate

Constructor Summary

Constructors

Constructor and Description

SQLiteCursorWrapper(android.database.Cursor delegate)

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

void
close()

byte[]
getBlob(int columnIndex)

int
getInt(int columnIndex)

long
getLong(int columnIndex)

java.lang.String
getString(int columnIndex)

boolean
isAfterLast()

boolean
moveToNext()

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

delegate

private android.database.Cursor delegate

Constructor Detail

SQLiteCursorWrapper

public SQLiteCursorWrapper(android.database.Cursor delegate)

Method Detail

moveToNext

public boolean moveToNext()

Specified by:

moveToNext in interface com.couchbase.lite.storage.Cursor

isAfterLast

public boolean isAfterLast()

Specified by:

isAfterLast in interface com.couchbase.lite.storage.Cursor

getString

public java.lang.String getString(int columnIndex)

Specified by:

getString in interface com.couchbase.lite.storage.Cursor

getInt

public int getInt(int columnIndex)

Specified by:

getInt in interface com.couchbase.lite.storage.Cursor

getLong

public long getLong(int columnIndex)

Specified by:

getLong in interface com.couchbase.lite.storage.Cursor

getBlob

public byte[] getBlob(int columnIndex)

Specified by:

getBlob in interface com.couchbase.lite.storage.Cursor

close

public void close()

Specified by:

close in interface com.couchbase.lite.storage.Cursor

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
*/
/*
    Created on : 29/03/2016, 08:05:48 PM
    Author     : veroh
*/

div#menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
    float: left;
}

div#menu li {
    position: relative;
    z-index: 9;
    margin: 0;
    padding: 0 5px 0 0;
    display: block;
    float: left;
}

div#pie{
    color:white;
    background: darkblue;
}


text:
<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Welcome extends Controller {

	public function action_index()
	{

        /** @var Model_Test $model */
        $model = Model::factory('Test');
	    print_r($model->getData());
		$this->response->body('hello, world!');
	}

} // End Welcome


text:
package com.hp.ov.sdk.messaging.scmb;

public interface ScmbMessageHandler {

    void handleMessage(ScmbMessage message);

}


text:
- The main configuration parameter used to request the allocation of executor memory is
*spark.executor.memory*.
- Spark running on YARN, Kubernetes or Mesos, adds to that a memory overhead  to cover for additional memory usage (OS, redundancy, filesystem cache, off-heap allocations, etc), which is calculated as memory_overhead_factor * spark.executor.memory  (with a minimum of 384 MB). The overhead factor is 0.1 (10%),
it can be configured when running on Kubernetes (only) using *spark.kubernetes.memoryOverheadFactor*.
- When using PySpark additional memory can be allocated using *spark.executor.pyspark.memory*.
- Additional memory for off-heap allocation is configured using *spark.memory.offHeap.size=<size>* and
*spark.memory.offHeap.enabled=true*. This works on YARN, for K8S, see SPARK-32661.
- Note also parameters for driver memory allocation: *spark.driver.memory and spark.driver.memoryOverhead*.
- Note: this covers recent versions of Spark at the time of this writing, notably Spark 3.0 and 2.4.
  See also [Spark documentation](https://spark.apache.org/docs/latest/configuration.html#application-properties)

![Spark Executor Memory Configuration](https://cern.ch/canali/docs/SparkExecutorMemory.png)

**Figure 1:** Pictorial representation of the memory areas allocated and used by Spark executors and
the main parameters for their configuration.
- Image in png format: [SparkExecutorMemory.png](https://cern.ch/canali/docs/SparkExecutorMemory.png)
- Image source, in powerpoint format: [SparkExecutorMemory.pptx](SparkExecutorMemory.pptx)

## Spark unified memory pool
Spark tasks allocate memory for execution and storage from the JVM heap of the executors using a unified memory pool
managed by the Spark memory management system.
Unified memory occupies by default 60% of the JVM heap: *0.6 * (spark.executor.memory - 300 MB)*.
The factor 0.6 (60%) is the default value of the configuration parameter spark.memory.fraction.
300MB is a hard-coded value of "reserved memory". The rest of the memory is used for user data structures,
internal metadata in Spark, and safeguarding against OOM errors.
Spark will manage execution and storage memory from the unified memory pool.
Additional structure is exposed with the configuration parameter spark.memory.storageFraction (default is 0.5),
which guarantees that the stored blocks will not be evicted from the unified memory by execution below the specified threshold.
The unified memory pool can optionally be allocated using off-heap memory, the relevant configuration parameters are: spark.memory.offHeap.size and spark.memory.offHeap.enabled.

## Opportunities for memory configuration settings
The first key configuration to get right is *spark.executor.memory*. Monitoring data can help you understand if you need to increase the memory allocated to Spark executors and or if you are already allocating plenty of memory and can consider reducing the memory footprint.
There are other memory-related configuration parameters that may need some adjustments for specific workloads: this can be analyzed and tested using memory monitoring data.
In particular, increasing *spark.memory.fraction* (default is 0.6) may be useful when deploying large Java heap,
as there is a chance that you will not need to set aside 40% of the JVM heap for user memory.
With similar reasoning, when using large Java heap allocation, manually setting *spark.executor.memoryOverhead*
to a value lower than the default (0.1 * spark.executor.memory) can be tested.

## Links:
[Apache Spark 3.0 Memory Monitoring Improvements](https://externaltable.blogspot.com/2020/08/apache-spark-30-memory-monitoring.html)


text:
git clone --depth 1 --single-branch --branch boost-1.69.0 https://github.com/boostorg/boost.git boost
pushd boost
rmdir libs/program_options libs/filesystem libs/iostreams libs/system libs/timer libs/chrono
git clone --depth 50 https://github.com/boostorg/program_options.git libs/program_options
git clone --depth 50 https://github.com/boostorg/filesystem.git libs/filesystem
git clone --depth 50 https://github.com/boostorg/iostreams.git libs/iostreams
git clone --depth 50 https://github.com/boostorg/system.git libs/system
git clone --depth 50 https://github.com/boostorg/timer.git libs/timer
git clone --depth 50 https://github.com/boostorg/chrono.git libs/chrono
git submodule update -q --init libs/accumulators
git submodule update -q --init libs/functional
git submodule update -q --init tools/boostdep
git submodule update -q --init tools/build
git submodule update -q --init tools/inspect
python2 tools/boostdep/depinst/depinst.py program_options --include example
python2 tools/boostdep/depinst/depinst.py filesystem --include example
python2 tools/boostdep/depinst/depinst.py iostreams --include example
python2 tools/boostdep/depinst/depinst.py system --include example
python2 tools/boostdep/depinst/depinst.py timer --include example
python2 tools/boostdep/depinst/depinst.py chrono --include example
python2 tools/boostdep/depinst/depinst.py accumulators --include example
python2 tools/boostdep/depinst/depinst.py functional --include example

CXXFLAGS="${CXXFLAGS} -fPIC"
INCLUDE_PATH="${PREFIX}/include"
LIBRARY_PATH="${PREFIX}/lib"
LINKFLAGS="${LINKFLAGS} -L${LIBRARY_PATH}"

cat <<EOF > tools/build/src/site-config.jam
using gcc : : ${CXX} ;
EOF

# compile and install boost
BOOST_BUILT="${SRC_DIR}/boost_built"
mkdir $BOOST_BUILT
./bootstrap.sh --prefix="${BOOST_BUILT}" --with-libraries=program_options,filesystem,iostreams,system,timer,chrono --with-toolset=gcc
./b2 -q \
    variant=release \
    address-model="${ARCH}" \
    architecture=x86 \
    debug-symbols=off \
    threading=multi \
    runtime-link=shared \
    link=static,shared \
    toolset=gcc \
    include="${INCLUDE_PATH}" \
    cxxflags="${CXXFLAGS}" \
    linkflags="${LINKFLAGS}" \
    --layout=system \
    -j"${CPU_COUNT}" \
    install
popd

# set up other dependencies
rmdir externals/apegrunt
git clone https://github.com/santeripuranen/apegrunt.git externals/apegrunt
pushd externals/apegrunt
git checkout 889986582ab6be9e1edfc307e7cfc25a705cfa2b
git apply ${RECIPE_DIR}/0001-use-no-apple-in-apegrunt.patch ${RECIPE_DIR}/0002-AVX-to-SSE3-in-apegrunt.patch
popd

# build spydrpick
export CMAKE_MODULE_PATH=${RECIPE_DIR}
mkdir build && pushd build
cmake -DTBB_ROOT=${PREFIX} -DBoost_INCLUDE_DIR=${BOOST_BUILT}/include -DBoost_LIBRARY_DIR=${BOOST_BUILT}/lib ..
make VERBOSE=1
install -d ${PREFIX}/bin
install bin/SpydrPick ${PREFIX}/bin
popd


text:
module.exports = function(karma) {
  const config = {
    autoWatch: false,
    basePath: '',
    // for full list of options, see
    // https://github.com/FormidableLabs/karma-benchmarkjs-reporter
    benchmarkReporter: {
      decorator: '-',
      terminalWidth: 60,
      hzWidth: 4,
      hzUnits: 'ops/sec',
      browserWidth: 40,
      showBrowser: false,
      showSuiteSummary: true
    },
    browsers: ['Chrome'],
    colors: true,
    concurrency: 1,
    exclude: [],
    files: ['bench/**/*.bench.js'],
    frameworks: ['benchmark'],
    junitReporter: {
      outputDir: 'reports',
      outputFile: 'benchmark.xml'
    },
    logLevel: karma.LOG_INFO,
    port: 9876,
    preprocessors: {},
    reporters: ['benchmark', 'junit'],
    singleRun: true
  };

  // for full list of options, see
  // https://github.com/etpinard/karma-benchmark-plotly-reporter
  // for more examples, see
  // https://github.com/etpinard/karma-benchmark-plotly-reporter/tree/master/example
  if (process.env.PLOTLY_API_KEY && process.env.PLOTLY_USERNAME) {
    config.reporters.push('benchmark-plotly');
    config.benchmarkPlotlyReporter = {
      apiKey: process.env.PLOTLY_API_KEY,
      cloudFilename: 'karma-benchmark-plotly-example',
      imageFilename: 'karma-benchmark-plotly-example.png',
      username: process.env.PLOTLY_USERNAME
    };
  }

  karma.set(config);
};


text:
import { h } from 'omi';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(h("path", {
  d: "M14 7l-5 5 5 5V7z"
}), 'ArrowLeftSharp');


text:
package com.toolazydogs.maiden.api;

/**
 *
 */
public interface IronContext
{
    boolean addListener(IronListener listener);

    boolean removeListener(IronListener listener);
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.network.fluent;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.polling.PollerFlux;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.network.fluent.models.ConnectionResetSharedKeyInner;
import com.azure.resourcemanager.network.fluent.models.ConnectionSharedKeyInner;
import com.azure.resourcemanager.network.fluent.models.VirtualNetworkGatewayConnectionInner;
import com.azure.resourcemanager.network.models.TagsObject;
import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete;
import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet;
import java.nio.ByteBuffer;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * An instance of this class provides access to all the operations defined in VirtualNetworkGatewayConnectionsClient.
 */
public interface VirtualNetworkGatewayConnectionsClient
    extends InnerSupportsGet<VirtualNetworkGatewayConnectionInner>, InnerSupportsDelete<Void> {
    /**
     * Creates or updates a virtual network gateway connection in the specified resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param parameters Parameters supplied to the create or update virtual network gateway connection operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a common class for general resource information.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Response<Flux<ByteBuffer>>> createOrUpdateWithResponseAsync(
        String resourceGroupName,
        String virtualNetworkGatewayConnectionName,
        VirtualNetworkGatewayConnectionInner parameters);

    /**
     * Creates or updates a virtual network gateway connection in the specified resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param parameters Parameters supplied to the create or update virtual network gateway connection operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a common class for general resource information.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    PollerFlux<PollResult<VirtualNetworkGatewayConnectionInner>, VirtualNetworkGatewayConnectionInner>
        beginCreateOrUpdateAsync(
            String resourceGroupName,
            String virtualNetworkGatewayConnectionName,
            VirtualNetworkGatewayConnectionInner parameters);

    /**
     * Creates or updates a virtual network gateway connection in the specified resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param parameters Parameters supplied to the create or update virtual network gateway connection operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a common class for general resource information.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<VirtualNetworkGatewayConnectionInner>, VirtualNetworkGatewayConnectionInner>
        beginCreateOrUpdate(
            String resourceGroupName,
            String virtualNetworkGatewayConnectionName,
            VirtualNetworkGatewayConnectionInner parameters);

    /**
     * Creates or updates a virtual network gateway connection in the specified resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param parameters Parameters supplied to the create or update virtual network gateway connection operation.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a common class for general resource information.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<VirtualNetworkGatewayConnectionInner>, VirtualNetworkGatewayConnectionInner>
        beginCreateOrUpdate(
            String resourceGroupName,
            String virtualNetworkGatewayConnectionName,
            VirtualNetworkGatewayConnectionInner parameters,
            Context context);

    /**
     * Creates or updates a virtual network gateway connection in the specified resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param parameters Parameters supplied to the create or update virtual network gateway connection operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a common class for general resource information.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<VirtualNetworkGatewayConnectionInner> createOrUpdateAsync(
        String resourceGroupName,
        String virtualNetworkGatewayConnectionName,
        VirtualNetworkGatewayConnectionInner parameters);

    /**
     * Creates or updates a virtual network gateway connection in the specified resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param parameters Parameters supplied to the create or update virtual network gateway connection operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a common class for general resource information.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    VirtualNetworkGatewayConnectionInner createOrUpdate(
        String resourceGroupName,
        String virtualNetworkGatewayConnectionName,
        VirtualNetworkGatewayConnectionInner parameters);

    /**
     * Creates or updates a virtual network gateway connection in the specified resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param parameters Parameters supplied to the create or update virtual network gateway connection operation.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a common class for general resource information.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    VirtualNetworkGatewayConnectionInner createOrUpdate(
        String resourceGroupName,
        String virtualNetworkGatewayConnectionName,
        VirtualNetworkGatewayConnectionInner parameters,
        Context context);

    /**
     * Gets the specified virtual network gateway connection by resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the specified virtual network gateway connection by resource group.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Response<VirtualNetworkGatewayConnectionInner>> getByResourceGroupWithResponseAsync(
        String resourceGroupName, String virtualNetworkGatewayConnectionName);

    /**
     * Gets the specified virtual network gateway connection by resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the specified virtual network gateway connection by resource group.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<VirtualNetworkGatewayConnectionInner> getByResourceGroupAsync(
        String resourceGroupName, String virtualNetworkGatewayConnectionName);

    /**
     * Gets the specified virtual network gateway connection by resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the specified virtual network gateway connection by resource group.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    VirtualNetworkGatewayConnectionInner getByResourceGroup(
        String resourceGroupName, String virtualNetworkGatewayConnectionName);

    /**
     * Gets the specified virtual network gateway connection by resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the specified virtual network gateway connection by resource group.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<VirtualNetworkGatewayConnectionInner> getByResourceGroupWithResponse(
        String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context);

    /**
     * Deletes the specified virtual network Gateway connection.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the completion.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(
        String resourceGroupName, String virtualNetworkGatewayConnectionName);

    /**
     * Deletes the specified virtual network Gateway connection.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the completion.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    PollerFlux<PollResult<Void>, Void> beginDeleteAsync(
        String resourceGroupName, String virtualNetworkGatewayConnectionName);

    /**
     * Deletes the specified virtual network Gateway connection.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the completion.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<Void>, Void> beginDelete(
        String resourceGroupName, String virtualNetworkGatewayConnectionName);

    /**
     * Deletes the specified virtual network Gateway connection.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the completion.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<Void>, Void> beginDelete(
        String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context);

    /**
     * Deletes the specified virtual network Gateway connection.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the completion.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Void> deleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName);

    /**
     * Deletes the specified virtual network Gateway connection.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void delete(String resourceGroupName, String virtualNetworkGatewayConnectionName);

    /**
     * Deletes the specified virtual network Gateway connection.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void delete(String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context);

    /**
     * Updates a virtual network gateway connection tags.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param parameters Parameters supplied to update virtual network gateway connection tags.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a common class for general resource information.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Response<Flux<ByteBuffer>>> updateTagsWithResponseAsync(
        String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters);

    /**
     * Updates a virtual network gateway connection tags.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param parameters Parameters supplied to update virtual network gateway connection tags.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a common class for general resource information.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    PollerFlux<PollResult<VirtualNetworkGatewayConnectionInner>, VirtualNetworkGatewayConnectionInner>
        beginUpdateTagsAsync(
            String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters);

    /**
     * Updates a virtual network gateway connection tags.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param parameters Parameters supplied to update virtual network gateway connection tags.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a common class for general resource information.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<VirtualNetworkGatewayConnectionInner>, VirtualNetworkGatewayConnectionInner> beginUpdateTags(
        String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters);

    /**
     * Updates a virtual network gateway connection tags.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param parameters Parameters supplied to update virtual network gateway connection tags.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a common class for general resource information.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<VirtualNetworkGatewayConnectionInner>, VirtualNetworkGatewayConnectionInner> beginUpdateTags(
        String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters, Context context);

    /**
     * Updates a virtual network gateway connection tags.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param parameters Parameters supplied to update virtual network gateway connection tags.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a common class for general resource information.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<VirtualNetworkGatewayConnectionInner> updateTagsAsync(
        String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters);

    /**
     * Updates a virtual network gateway connection tags.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param parameters Parameters supplied to update virtual network gateway connection tags.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a common class for general resource information.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    VirtualNetworkGatewayConnectionInner updateTags(
        String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters);

    /**
     * Updates a virtual network gateway connection tags.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param parameters Parameters supplied to update virtual network gateway connection tags.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a common class for general resource information.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    VirtualNetworkGatewayConnectionInner updateTags(
        String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters, Context context);

    /**
     * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key
     * for passed virtual network gateway connection in the specified resource group through Network resource provider.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name.
     * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation
     *     throughNetwork resource provider.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return response for GetConnectionSharedKey API service call.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Response<Flux<ByteBuffer>>> setSharedKeyWithResponseAsync(
        String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters);

    /**
     * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key
     * for passed virtual network gateway connection in the specified resource group through Network resource provider.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name.
     * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation
     *     throughNetwork resource provider.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return response for GetConnectionSharedKey API service call.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    PollerFlux<PollResult<ConnectionSharedKeyInner>, ConnectionSharedKeyInner> beginSetSharedKeyAsync(
        String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters);

    /**
     * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key
     * for passed virtual network gateway connection in the specified resource group through Network resource provider.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name.
     * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation
     *     throughNetwork resource provider.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return response for GetConnectionSharedKey API service call.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<ConnectionSharedKeyInner>, ConnectionSharedKeyInner> beginSetSharedKey(
        String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters);

    /**
     * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key
     * for passed virtual network gateway connection in the specified resource group through Network resource provider.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name.
     * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation
     *     throughNetwork resource provider.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return response for GetConnectionSharedKey API service call.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<ConnectionSharedKeyInner>, ConnectionSharedKeyInner> beginSetSharedKey(
        String resourceGroupName,
        String virtualNetworkGatewayConnectionName,
        ConnectionSharedKeyInner parameters,
        Context context);

    /**
     * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key
     * for passed virtual network gateway connection in the specified resource group through Network resource provider.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name.
     * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation
     *     throughNetwork resource provider.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return response for GetConnectionSharedKey API service call.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<ConnectionSharedKeyInner> setSharedKeyAsync(
        String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters);

    /**
     * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key
     * for passed virtual network gateway connection in the specified resource group through Network resource provider.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name.
     * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation
     *     throughNetwork resource provider.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return response for GetConnectionSharedKey API service call.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ConnectionSharedKeyInner setSharedKey(
        String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters);

    /**
     * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key
     * for passed virtual network gateway connection in the specified resource group through Network resource provider.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name.
     * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation
     *     throughNetwork resource provider.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return response for GetConnectionSharedKey API service call.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ConnectionSharedKeyInner setSharedKey(
        String resourceGroupName,
        String virtualNetworkGatewayConnectionName,
        ConnectionSharedKeyInner parameters,
        Context context);

    /**
     * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual
     * network gateway connection shared key through Network resource provider.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return response for GetConnectionSharedKey API service call.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Response<ConnectionSharedKeyInner>> getSharedKeyWithResponseAsync(
        String resourceGroupName, String virtualNetworkGatewayConnectionName);

    /**
     * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual
     * network gateway connection shared key through Network resource provider.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return response for GetConnectionSharedKey API service call.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<ConnectionSharedKeyInner> getSharedKeyAsync(
        String resourceGroupName, String virtualNetworkGatewayConnectionName);

    /**
     * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual
     * network gateway connection shared key through Network resource provider.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return response for GetConnectionSharedKey API service call.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ConnectionSharedKeyInner getSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName);

    /**
     * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual
     * network gateway connection shared key through Network resource provider.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return response for GetConnectionSharedKey API service call.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ConnectionSharedKeyInner> getSharedKeyWithResponse(
        String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context);

    /**
     * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections
     * created.
     *
     * @param resourceGroupName The name of the resource group.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return response for the ListVirtualNetworkGatewayConnections API service call.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedFlux<VirtualNetworkGatewayConnectionInner> listByResourceGroupAsync(String resourceGroupName);

    /**
     * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections
     * created.
     *
     * @param resourceGroupName The name of the resource group.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return response for the ListVirtualNetworkGatewayConnections API service call.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<VirtualNetworkGatewayConnectionInner> listByResourceGroup(String resourceGroupName);

    /**
     * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections
     * created.
     *
     * @param resourceGroupName The name of the resource group.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return response for the ListVirtualNetworkGatewayConnections API service call.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<VirtualNetworkGatewayConnectionInner> listByResourceGroup(String resourceGroupName, Context context);

    /**
     * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared
     * key for passed virtual network gateway connection in the specified resource group through Network resource
     * provider.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name.
     * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation
     *     through network resource provider.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the virtual network connection reset shared key.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Response<Flux<ByteBuffer>>> resetSharedKeyWithResponseAsync(
        String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionResetSharedKeyInner parameters);

    /**
     * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared
     * key for passed virtual network gateway connection in the specified resource group through Network resource
     * provider.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name.
     * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation
     *     through network resource provider.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the virtual network connection reset shared key.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    PollerFlux<PollResult<ConnectionResetSharedKeyInner>, ConnectionResetSharedKeyInner> beginResetSharedKeyAsync(
        String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionResetSharedKeyInner parameters);

    /**
     * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared
     * key for passed virtual network gateway connection in the specified resource group through Network resource
     * provider.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name.
     * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation
     *     through network resource provider.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the virtual network connection reset shared key.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<ConnectionResetSharedKeyInner>, ConnectionResetSharedKeyInner> beginResetSharedKey(
        String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionResetSharedKeyInner parameters);

    /**
     * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared
     * key for passed virtual network gateway connection in the specified resource group through Network resource
     * provider.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name.
     * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation
     *     through network resource provider.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the virtual network connection reset shared key.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<ConnectionResetSharedKeyInner>, ConnectionResetSharedKeyInner> beginResetSharedKey(
        String resourceGroupName,
        String virtualNetworkGatewayConnectionName,
        ConnectionResetSharedKeyInner parameters,
        Context context);

    /**
     * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared
     * key for passed virtual network gateway connection in the specified resource group through Network resource
     * provider.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name.
     * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation
     *     through network resource provider.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the virtual network connection reset shared key.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<ConnectionResetSharedKeyInner> resetSharedKeyAsync(
        String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionResetSharedKeyInner parameters);

    /**
     * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared
     * key for passed virtual network gateway connection in the specified resource group through Network resource
     * provider.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name.
     * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation
     *     through network resource provider.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the virtual network connection reset shared key.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ConnectionResetSharedKeyInner resetSharedKey(
        String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionResetSharedKeyInner parameters);

    /**
     * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared
     * key for passed virtual network gateway connection in the specified resource group through Network resource
     * provider.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name.
     * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation
     *     through network resource provider.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the virtual network connection reset shared key.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ConnectionResetSharedKeyInner resetSharedKey(
        String resourceGroupName,
        String virtualNetworkGatewayConnectionName,
        ConnectionResetSharedKeyInner parameters,
        Context context);
}


text:
<?php

namespace Sylius\Bundle\RbacBundle;

use Sylius\Bundle\ResourceBundle\AbstractResourceBundle;
use Sylius\Bundle\ResourceBundle\SyliusResourceBundle;

/**
 * Rbac bundle.
 *
 * @author Paweł Jędrzejewski <pjedrzejewski@sylius.pl>
 */
class SyliusRbacBundle extends AbstractResourceBundle
{
    /**
     * {@inheritdoc}
     */
    public static function getSupportedDrivers()
    {
        return array(
            SyliusResourceBundle::DRIVER_DOCTRINE_ORM,
        );
    }

    /**
     * {@inheritdoc}
     */
    protected function getModelInterfaces()
    {
        return array(
            'Sylius\Component\Rbac\Model\RoleInterface' => 'sylius.model.role.class',
            'Sylius\Component\Rbac\Model\PermissionInterface' => 'sylius.model.permission.class',
        );
    }

    /**
     * {@inheritdoc}
     */
    protected function getModelNamespace()
    {
        return 'Sylius\Component\Rbac\Model';
    }
}


text:
define([
  'aeris/util',
  'aeris/api/models/pointdata',
  'aeris/errors/apiresponseerror'
], function(_, PointData, ApiResponseError) {
  /**
   * @publicApi
   * @class Fire
   * @namespace aeris.api.models
   * @extends aeris.api.models.PointData
   *
   * @constructor
   * @override
   */
  var Fire = function(opt_attrs, opt_options) {
    var options = _.defaults(opt_options || {}, {
      params: {
        from: 'today'
      }
    });

    PointData.call(this, opt_attrs, options);
  };
  _.inherits(Fire, PointData);

  /**
   * @method parse
   */
  Fire.prototype.parse = function(res) {
    var attrs = PointData.prototype.parse.apply(this, arguments);

    if (!res.report || !res.report.id) {
      throw new ApiResponseError('Missing fire report id');
    }

    attrs.id = res.report.id;

    return attrs;
  };

  return _.expose(Fire, 'aeris.api.models.Fire');
});


text:
/**************************************************************/
/*
 * Copyright (c) 2014-2015, Ohad Rodeh, IBM Research
 * All rights reserved.
 *
 * 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.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR 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.
 *
 * The views and conclusions contained in the software and documentation are those
 * of the authors and should not be interpreted as representing official policies,
 * either expressed or implied, of IBM Research.
 *
 */
/**************************************************************/
/**********************************************************************/
/* OC_BPT_OP_VALIDATE.C
 *
 * Validate a b+-tree
 */
/**********************************************************************/
/* The algorithm is: decend through the tree and verify range invariants.
 * If an index node has key K pointing to a subnode N then N must include
 * keys only between K and the key after it.
 */
/**********************************************************************/
#include <string.h>

#include "oc_bpt_int.h"
#include "oc_bpt_op_validate.h"
#include "oc_bpt_nd.h"
/**********************************************************************/
typedef struct Range {
    struct Oc_bpt_key *lo_p, *hi_p; // place to store the keys
} Range;

/**********************************************************************/
// validate the internal structure of a node
bool validate_single_node(
    struct Oc_bpt_state *s_p,
    Oc_bpt_node *node_p)
{
    int i, num_entries;
    struct Oc_bpt_key *key_p, *prev_key_p;

    num_entries = oc_bpt_nd_num_entries(s_p, node_p);
    if (oc_bpt_nd_is_root(s_p, node_p) &&
        !oc_bpt_nd_is_leaf(s_p, node_p)) {
        if (num_entries == 1)
            return FALSE;
    }

    if (num_entries < (int)s_p->cfg_p->min_num_ent && !oc_bpt_nd_is_root(s_p, node_p))
        return FALSE;

    // check that the keys are arrange in ascending order
    prev_key_p = oc_bpt_nd_get_kth_key(s_p, node_p, 0);
    for (i=1; i<num_entries; i++) {
        key_p = oc_bpt_nd_get_kth_key(s_p, node_p, i);

        if (s_p->cfg_p->key_compare(prev_key_p, key_p) != 1)
            return FALSE;
        prev_key_p = key_p;
    }

    return TRUE;
}

static bool validate_node(
    struct Oc_wu *wu_p,
    Oc_bpt_state *s_p,
    Oc_bpt_node *node_p,
    Range *range_p)
{
    struct Oc_bpt_key *lo_p, *hi_p;

    lo_p = oc_bpt_nd_min_key(s_p, node_p);
    hi_p = oc_bpt_nd_max_key(s_p, node_p);

    if (!validate_single_node(s_p, node_p)) {
        char lo[10], hi[10];

        s_p->cfg_p->key_to_string(lo_p, lo, 10);
        s_p->cfg_p->key_to_string(hi_p, hi, 10);
        printf("   // node did not pass validation lo_p=%s hi=%s\n", lo, hi);
        printf("   // num_entries=%d\n", oc_bpt_nd_num_entries(s_p, node_p));
        return FALSE;
    }

    // Check that this node falls under the range dictated from above
    if (!oc_bpt_nd_is_root(s_p, node_p)) {
        if (s_p->cfg_p->key_compare(range_p->lo_p, lo_p) == -1) {
            char range_lo[10], lo[10];

            s_p->cfg_p->key_to_string(range_p->lo_p, range_lo, 10);
            s_p->cfg_p->key_to_string(lo_p, lo, 10);
            printf ("    // range violation range->lo_p=%s > lo=%s\n", range_lo, lo);
            return FALSE;
        }
        if (range_p->hi_p != NULL &&
            s_p->cfg_p->key_compare(hi_p, range_p->hi_p) != 1) {
            char range_hi[10], hi[10];

            s_p->cfg_p->key_to_string(range_p->hi_p, range_hi, 10);
            s_p->cfg_p->key_to_string(hi_p, hi, 10);
            printf ("    // range violation hi_p=%s >= range_p->hi_p=%s \n",
                    hi, range_hi);
            return FALSE;
        }
    }

    if (oc_bpt_nd_is_leaf(s_p, node_p)) {
        return TRUE;
    }
    else {
        // An index node, recurse through its children
        int i;
        int num_entries = oc_bpt_nd_num_entries(s_p, node_p);
        Range child_range;
        uint64 child_addr = 0;
        Oc_bpt_node *child_node_p;
        bool rc;

        for (i=0; i< num_entries; i++) {
            oc_bpt_nd_index_get_kth(s_p, node_p, i,
                                    &child_range.lo_p,
                                    &child_addr);

            // the last key is bounded from above by the dictated range
            if (i == num_entries-1) {
                child_range.hi_p = range_p->hi_p;
            } else {
                uint64 dummy;

                oc_bpt_nd_index_get_kth(s_p, node_p, i+1,
                                        &child_range.hi_p,
                                        &dummy);
            }

            child_node_p = oc_bpt_nd_get_for_read(wu_p, s_p, child_addr);
            rc = validate_node(wu_p, s_p, child_node_p, &child_range);
            oc_bpt_nd_release(wu_p, s_p, child_node_p);
            if (FALSE == rc)
                return rc;
        }
        return TRUE;
    }
}

bool oc_bpt_op_validate_b(
    struct Oc_wu *wu_p,
    Oc_bpt_state *s_p)
{
    Range r;
    bool rc;

    if (oc_bpt_nd_num_entries(s_p, s_p->root_node_p) == 0) {
        rc = TRUE;
    }
    else {
        r.lo_p = oc_bpt_nd_min_key(s_p, s_p->root_node_p);
        r.hi_p = NULL;
        rc = validate_node(wu_p, s_p, s_p->root_node_p, &r);
    }

    return rc;
}


text:
from toee import *
from utilities import *
from Co8 import *
from py00439script_daemon import *
from combat_standard_routines import *

def san_dialog( attachee, triggerer ):
	if (game.quests[109].state == qs_completed):
		triggerer.begin_dialog( attachee, 430 )
	elif (game.global_flags[537] == 1):
		triggerer.begin_dialog( attachee, 400 )
	elif (attachee.leader_get() != OBJ_HANDLE_NULL):
		triggerer.begin_dialog( attachee, 180 )
	elif (game.global_flags[536] == 1):
		triggerer.begin_dialog( attachee, 420 )
	elif (attachee.has_met(triggerer)):
		triggerer.begin_dialog( attachee, 110 )
	else:
		triggerer.begin_dialog( attachee, 10 )
	return SKIP_DEFAULT

def san_first_heartbeat( attachee, triggerer ):
	if (attachee.map == 5169 and game.global_vars[549] == 3):
		if (attachee.leader_get() == OBJ_HANDLE_NULL):
			attachee.object_flag_set(OF_OFF)
	elif (attachee.map == 5172 and game.global_vars[549] == 3):
		if (attachee.leader_get() == OBJ_HANDLE_NULL):
			attachee.object_flag_unset(OF_OFF)
	elif (attachee.map == 5141):
		if (game.quests[109].state == qs_completed and game.global_vars[542] == 3):
			attachee.object_flag_set(OF_OFF)
		elif (is_daytime() == 1):
			attachee.object_flag_set(OF_OFF)
		elif (is_daytime() == 0):
			attachee.object_flag_unset(OF_OFF)
	return RUN_DEFAULT

def san_dying( attachee, triggerer ):
	if should_modify_CR( attachee ):
		modify_CR( attachee, get_av_level() )
	for pc in game.party:
		pc.condition_add('fallen_paladin')
	game.global_flags[539] = 1
	return RUN_DEFAULT

def san_enter_combat( attachee, triggerer ):
	if (triggerer.type == obj_t_pc):
		if (game.quests[109].state == qs_unknown or game.quests[109].state == qs_completed or game.quests[109].state == qs_botched):
			ProtectTheInnocent(attachee, triggerer)
	return RUN_DEFAULT

def san_start_combat( attachee, triggerer ):
	if (game.global_flags[537] == 1):
		leader = game.party[0]
		StopCombat(attachee, 0)
		leader.begin_dialog( attachee, 400 )
	return SKIP_DEFAULT

def san_resurrect( attachee, triggerer ):
	game.global_flags[539] = 0
	return RUN_DEFAULT

def san_heartbeat( attachee, triggerer ):
	if (not game.combat_is_active()):
		for obj in game.obj_list_vicinity(attachee.location,OLC_PC):
			if (is_better_to_talk(attachee,obj)):
				game.timevent_add( howdy_ho, ( attachee, triggerer ), 2000 )
				game.new_sid = 0
	return RUN_DEFAULT

def san_spell_cast( attachee, triggerer, spell ):
	if ( spell.spell == spell_cause_fear or spell.spell == spell_fear ):
		game.global_flags[537] = 1
		game.timevent_add( revert_ggf_537, ( attachee, triggerer ), 3600000 )
	return RUN_DEFAULT

def increment_var_536( attachee, triggerer ):
	if (not attachee.has_met(triggerer)):
		game.global_vars[536] = game.global_vars[536] + 1
	return

def increment_var_543( attachee, triggerer ):
	game.global_vars[543] = game.global_vars[543] + 1
	return

def increment_var_544( attachee, triggerer ):
	game.global_vars[544] = game.global_vars[544] + 1
	return

def increment_var_545( attachee, triggerer ):
	game.global_vars[545] = game.global_vars[545] + 1
	return

def increment_var_555( attachee, triggerer ):
	game.global_vars[555] = game.global_vars[555] + 1
	game.new_sid = 0
	return

def increment_var_556( attachee, triggerer ):
	game.global_vars[556] = game.global_vars[556] + 1
	game.new_sid = 0
	return

def is_better_to_talk(speaker,listener):
	if (speaker.can_see(listener)):
		if (speaker.distance_to(listener) <= 40):
			return 1
	return 0

def howdy_ho( attachee, triggerer ):
	attachee.turn_towards(game.party[0])
	game.party[0].begin_dialog( attachee, 10 )
	return RUN_DEFAULT

def gen_panathaes_loc( attachee, triggerer ):
	if (game.global_vars[539] == 0):
		chooser = game.random_range(1,8)
		if (chooser == 1):
			game.global_vars[539] = 1
		elif (chooser == 2):
			game.global_vars[539] = 2
		elif (chooser == 3):
			game.global_vars[539] = 3
		elif (chooser == 4):
			game.global_vars[539] = 4
		elif (chooser == 5):
			game.global_vars[539] = 5
		elif (chooser == 6):
			game.global_vars[539] = 6
		elif (chooser == 7):
			game.global_vars[539] = 7
		elif (chooser == 8):
			game.global_vars[539] = 8
	return

def pick_kidnapper( attachee, triggerer ):
	if (game.global_vars[542] == 0):
		picker = game.random_range(1,4)
		if (picker == 1):
			game.global_vars[542] = 1
			# boroquin is kidnapper
		elif (picker == 2 or picker == 3):
			game.global_vars[542] = 2
			# panathaes is kidnapper
		elif (picker == 4):
			game.global_vars[542] = 3
			# rakham is kidnapper
	return

def gen_kids_loc( attachee, triggerer ):
	if (game.global_vars[540] == 0 and game.global_vars[541] == 0):
		chooser = game.random_range(1,4)
		if (chooser == 1):
			game.global_vars[540] = 1
			game.global_vars[541] = 1
		elif (chooser == 2):
			game.global_vars[540] = 2
			game.global_vars[541] = 2
		elif (chooser == 3):
			game.global_vars[540] = 3
			game.global_vars[541] = 3
		elif (chooser == 4):
			game.global_vars[540] = 4
			game.global_vars[541] = 4
	return

def check_for_locket( attachee, triggerer ):
	if (game.global_vars[542] == 3):
		create_item_in_inventory(11061,attachee)
	return

def check_evidence_rep_bor( attachee, triggerer ):
	if (game.party[0].reputation_has(72)==1):
		game.party[0].reputation_add(75)
		game.party[0].reputation_remove(72)
	elif (game.party[0].reputation_has(69)==1):
		game.party[0].reputation_add(72)
		game.party[0].reputation_remove(69)
	elif (game.party[0].reputation_has(69)==0):
		if (game.party[0].reputation_has(72)==0):
			if (game.party[0].reputation_has(75)==0):
				game.party[0].reputation_add(69)
	return

def check_evidence_rep_pan( attachee, triggerer ):
	if (game.party[0].reputation_has(73)==1):
		game.party[0].reputation_add(76)
		game.party[0].reputation_remove(73)
	elif (game.party[0].reputation_has(70)==1):
		game.party[0].reputation_add(73)
		game.party[0].reputation_remove(70)
	elif (game.party[0].reputation_has(70)==0):
		if (game.party[0].reputation_has(73)==0):
			if (game.party[0].reputation_has(76)==0):
				game.party[0].reputation_add(70)
	return

def check_evidence_rep_rak( attachee, triggerer ):
	if (game.party[0].reputation_has(74)==1):
		game.party[0].reputation_add(77)
		game.party[0].reputation_remove(74)
	elif (game.party[0].reputation_has(71)==1):
		game.party[0].reputation_add(74)
		game.party[0].reputation_remove(71)
	elif (game.party[0].reputation_has(71)==0):
		if (game.party[0].reputation_has(74)==0):
			if (game.party[0].reputation_has(77)==0):
				game.party[0].reputation_add(71)
	return

def revert_ggf_537( attachee, triggerer ):
	game.global_flags[537] = 0
	return


text:
<?php
namespace CLI\Output\Handler;

class EchoOutput implements IOutputHandler {
	function output($string){
		echo $string;
	}
}


text:
exports.load = function(c, def, done) {
  var command = 'dpkg';
  var args = [ '-s', def.name ];

  c.exec(command, args, function(err, cmd) {
    if (err) { return done(err); }

    var out = '';

    cmd.on('data', function(data, ext) {
      out += data;
    });
    cmd.on('exit', function(code, signal) {
      var status = /^Status:\s+(.+)$/m
        , version = /^Version:\s+(.+)$/m
        , re;

      var pkg = new APTPackage(def.name);
      re = status.exec(out);
      if (re) {
        if (re[1].match(/installed/)) {
          pkg.status = 'installed';
        }
      }
      re = version.exec(out);
      if (re) {
        // TODO: parse version according to Debian versioning:
        // http://manpages.ubuntu.com/manpages/natty/man5/deb-version.5.html

        pkg.version = re[1];
      }

      return done(null, pkg);
    });
  });
}

exports.sync = function(c, pkg, def, done) {
  switch (def.ensure) {
    case undefined:
    case 'present':
    case 'installed':
      pkg.install(c, def, done);
      break;
    case 'absent':
      pkg.remove(c, def, done);
      break;
    case 'purged':
      pkg.purge(c, def, done);
      break;
    default:
      return done(new Error("Unknown ensure value '" + def.ensure + "'"));
  }
}

function APTPackage(name, options) {
  options = options || {};
  this.name = name;
  this.status = 'not-installed';
  this.version = null;
}

APTPackage.prototype.install = function(c, options, cb) {
  // TODO: Implement support for skipping this command if the status is
  //       already installed and the version is satisfied.

  var self = this
    , command = 'apt-get'
    , args = [ '-y', 'install', this.name ];

  if (options.version) {
    args.pop();
    args.push(this.name + '=' + options.version);
  }

  c.exec(command, args, function(err, cmd) {
    if (err) { return cb(err); }

    cmd.on('data', function(data, ext) {
    });
    cmd.on('exit', function(code, signal) {
      if (code !== 0) { return cb(new Error("Failed to install '" + self.name + "'")); };
      return cb();
    });
  });
}

APTPackage.prototype.remove = function(c, options, cb) {
  if (this.status == 'not-installed') { return cb(); }

  var command = 'apt-get';
  var args = [ '-y', 'remove', this.name ];

  c.exec(command, args, function(err, cmd) {
    if (err) { return cb(err); }

    cmd.on('data', function(data, ext) {
    });
    cmd.on('exit', function(code, signal) {
      if (code !== 0) { return cb(new Error("Failed to remove '" + self.name + "'")); };
      return cb();
    });
  });
};

APTPackage.prototype.purge = function(c, options, cb) {
  if (this.status == 'not-installed') { return cb(); }

  var command = 'apt-get';
  var args = [ '-y', 'purge', this.name ];

  c.exec(command, args, function(err, cmd) {
    if (err) { return cb(err); }

    cmd.on('data', function(data, ext) {
    });
    cmd.on('exit', function(code, signal) {
      if (code !== 0) { return cb(new Error("Failed to purge '" + self.name + "'")); };
      return cb();
    });
  });
};