text:
@interface ODBFileManager (Private)

+ (NSString*)writeFile:(NSString*)filename withData:(NSData*)data;

@end

@implementation ODBFileManager

+ (id)allocWithZone:(NSZone *)zone
{
    return nil; //on subsequent allocation attempts return nil
}

+ (BOOL)deleteFileInCache:(NSString*)filename
{
	NSError *error;
	NSString *appFile = [self fullpathOfFilenameInCache:filename];
	BOOL deleted = [[NSFileManager defaultManager] removeItemAtPath:appFile error:&error];
	if (!deleted){
		ODBLOG(@"File %@ was not deleted because: %@", appFile, error);
	}
	return deleted;
}

+ (BOOL)deleteFileInDocuments:(NSString*)filename
{
	NSError *error;
	NSString *appFile = [self fullpathOfFilename:filename];
	BOOL deleted = [[NSFileManager defaultManager] removeItemAtPath:appFile error:&error];
	if (!deleted){
		ODBLOG(@"File %@ was not deleted because: %@", appFile, error);
	}
	return deleted;
}

+(NSString*) fullPathFromRelativePath:(NSString*) relPath
{
	// do not convert an absolute path (starting with '/')
	if(([relPath length] > 0) && ([relPath characterAtIndex:0] == '/'))
	{
		return relPath;
	}

	NSMutableArray *imagePathComponents = [NSMutableArray arrayWithArray:[relPath pathComponents]];
	NSString *file = [imagePathComponents lastObject];

	[imagePathComponents removeLastObject];
	NSString *imageDirectory = [NSString pathWithComponents:imagePathComponents];

	NSString *fullpath = [[NSBundle mainBundle] pathForResource:file
														 ofType:nil
													inDirectory:imageDirectory];
	if (fullpath == nil)
		fullpath = relPath;

	return fullpath;
}

+ (NSString*)applicationFile:(NSString*)filename allowDownloadOverride:(BOOL)allowDownloadOverride
{
	NSString* path = nil;
	if (allowDownloadOverride)
	{
		path = [self fullpathOfFilenameIfExists:[@"downloads" stringByAppendingPathComponent:filename]];
	}
	if (path == nil)
	{
		path = [self fullPathFromRelativePath:filename];
		if (![[NSFileManager defaultManager] isReadableFileAtPath:path])
			path = nil;
	}

	return path;

}

+ (NSString*)fullpathOfFilenameIfExistsInCache:(NSString*)filename
{
	NSString* custom = [self fullpathOfFilenameInCache:filename];

	BOOL exists = [[NSFileManager defaultManager] isReadableFileAtPath:custom];

	if (exists)
		return custom;
	else
		return nil;
}

+ (NSString*)fullpathOfFilenameIfExists:(NSString*)filename
{
	NSString* custom = [self fullpathOfFilename:filename];

	BOOL exists = [[NSFileManager defaultManager] isReadableFileAtPath:custom];

	if (exists)
		return custom;
	else
		return nil;
}

+ (NSString*)fullpathOfFilename:(NSString*)filename
{
	if ([filename characterAtIndex:0]=='/')
		return [[filename retain]autorelease];

	NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
	NSString *directory = [paths objectAtIndex:0];

	if (!directory) {
		ODBLOG(@"Requested directory not found!");
		return nil;
	} else {
		NSString *appFile = [directory stringByAppendingPathComponent:filename];
		return appFile;
	}
}

+ (NSString*)fullpathOfFilenameInCache:(NSString*)filename
{
	if ([filename characterAtIndex:0]=='/')
		return [[filename retain]autorelease];

	NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
	NSString *directory = [paths objectAtIndex:0];

	if (!directory) {
		ODBLOG(@"Requested directory not found!");
		return nil;
	} else {
		NSString *appFile = [directory stringByAppendingPathComponent:filename];
		return appFile;
	}
}

+ (NSString*)writeFileToDocuments:(NSString*)filename withData:(NSData*)data
{
	NSString *appFile = [self fullpathOfFilename:filename];
	return [self writeFile:appFile withData:data];
}

+ (NSString*)writeFileToCache:(NSString*)filename withData:(NSData*)data
{
	NSString *appFile = [self fullpathOfFilenameInCache:filename];
	return [self writeFile:appFile withData:data];
}

+ (NSString*)writeFile:(NSString*)filename withData:(NSData*)data
{
	ODBLOG(@"Writing %@", filename);

	NSError *pError = nil;
	[data writeToFile:filename options:0 error:&pError];

	if (pError != nil)
	{
		ODBLOG(@"Error writing %@: %@", filename, pError);
		return nil;
	}
	return filename;
}

+ (NSData *)readFileInDocuments:(NSString *)filename {
	NSString *appFile = [self fullpathOfFilename:filename];
	return [[[NSData alloc] initWithContentsOfFile:appFile] autorelease];
}
+ (NSData *)readFileInCache:(NSString *)filename {
	NSString *appFile = [self fullpathOfFilenameInCache:filename];
	return [[[NSData alloc] initWithContentsOfFile:appFile] autorelease];
}

+ (id)loadObjectFromPlistAtPath:(NSString *)path
{
	NSData *rm_data = nil;
	NSString *error = nil;
	id retPlist = nil;

	NSPropertyListFormat format;
	rm_data = [[NSData alloc] initWithContentsOfFile:path];
	if (!rm_data) {
		//ODBLOG(@"resources file not returned.");
		return nil;
	}
	retPlist = [NSPropertyListSerialization propertyListFromData:rm_data  mutabilityOption:NSPropertyListImmutable format:&format errorDescription:&error];
	if (!retPlist){
		ODBLOG(@"Plist not returned, error: %@", error);
	}
	if (error) [error release];

	[rm_data release];

	return retPlist;
}

+ (BOOL)writeObject:(id)plist toPlistAtPath:(NSString *)path
{
	NSString *error;

	NSData *pData = [NSPropertyListSerialization dataFromPropertyList:plist format:NSPropertyListBinaryFormat_v1_0 errorDescription:&error];

	if (!pData) {

		ODBLOG(@"Error writing application plist: %@",error);
		return NO;
	}
	if (error)[error release];

	return ([self writeFile:path withData:pData] != nil);
}

+ (BOOL)writeObject:(id)plist toPlistFilenameInCache:(NSString *)filename
{
	return [self writeObject:plist toPlistAtPath:[self fullpathOfFilenameInCache:filename]];
}
+ (BOOL)writeObject:(id)plist toPlistFilenameInDocuments:(NSString *)fileName
{
	return [self writeObject:plist toPlistAtPath:[self fullpathOfFilename:fileName]];
}

+ (id)loadObjectFromPlistFilenameInDocuments:(NSString *)fileName {
	return [self loadObjectFromPlistAtPath:[self fullpathOfFilename:fileName]];
}

@end


text:
module Clearhaus # :nodoc: all

  module HttpClient

    class ErrorHandler < Faraday::Middleware

      def initialize(app)
        super(app)
      end

      # Checks on the API response to see if Clearhaus has reported any errors
      # Raises a ClientError with the code and message received from Clearhaus
      def call(env)
        @app.call(env).on_complete do
          next if Clearhaus.silent
          status = JSON.parse(env[:body])['status']
          case status['code']
          when 40000..50100
            raise Clearhaus::Error::ClientError.new(status['code'], status['message'] || "")
          end
        end
      end

    end

  end

end

redpajama_set_name: RedPajamaGithub


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>org.opencog</groupId>
	<artifactId>relex</artifactId>
	<packaging>jar</packaging>
	<version>1.6.3</version>
	<name>relex</name>
	<description>RelEx dependency relation extractor</description>
	<url>http://wiki.opencog.org/w/RelEx_Dependency_Relationship_Extractor</url>
	<scm>
		<url>https://github.com/opencog/relex</url>
		<connection>scm:git:git@github.com:opencog/relex.git</connection>
	</scm>
	<licenses>
		<license>
			<name>Apache License 2.0</name>
			<url>http://www.spdx.org/licenses/Apache-2.0</url>
		</license>
	</licenses>
	<developers>
		<developer>
			<name>Mike Ross</name>
			<email>mikenon@gmail.com</email>
			<roles>
				<role>in 2005</role>
			</roles>
		</developer>
		<developer>
			<name>Linas Vepstas</name>
			<email>linasvepstas@gmail.com</email>
			<url>http://linas.org/</url>
			<organization>OpenCog Foundation</organization>
			<organizationUrl>http://opencog.org/</organizationUrl>
			<roles>
				<role>as of 2008</role>
			</roles>
		</developer>
	</developers>
	<contributors>
		<contributor>
			<name>Murilo Queiroz</name>
			<email>muriloq@gmail.com</email>
		</contributor>
		<contributor>
			<name>Borislav Iordanov</name>
			<email>borislav.iordanov@gmail.com</email>
		</contributor>
		<contributor>
			<name>Evgenii Philippov</name>
			<email>efilippov@gmail.com</email>
		</contributor>
		<contributor>
			<name>Fabricio Silva</name>
			<email>fabaguiarsilva@gmail.com</email>
		</contributor>
		<contributor>
			<name>Blake Lemoine</name>
			<email>bal2277@louisiana.edu</email>
		</contributor>
		<contributor>
			<name>Rui P. Costa</name>
			<email>b4h0pe@gmail.com</email>
		</contributor>
		<contributor>
			<name>Jim White</name>
			<email>james.paul.white@gmail.com</email>
		</contributor>
		<contributor>
			<name>Rodas Solomon</name>
			<email>rodisolomon@gmail.com</email>
		</contributor>
		<contributor>
			<name>Lian Ruiting</name>
			<email>lianlian1022@gmail.com</email>
		</contributor>
		<contributor>
			<name>Jand Hashemi</name>
			<roles>
				<role>Lucky-- IRC freenode</role>
			</roles>
		</contributor>
		<contributor>
			<name>Alex van der Peet</name>
			<email>alex@yutani.nl</email>
		</contributor>
		<contributor>
			<name>David Hart</name>
			<email>dhart@opencog.org</email>
			<url>https://www.linkedin.com/in/davidhart</url>
			<organization>OpenCog Foundation</organization>
			<organizationUrl>http://opencog.org/</organizationUrl>
			<roles>
				<role>DevOps</role>
				<role>Systems Integration</role>
				<role>Artificial Intelligence</role>
				<role>Robotics</role>
				<role>Virtual Worlds</role>
			</roles>
		</contributor>
		<contributor>
			<name>Danny Brian</name>
			<email>danny@brians.org</email>
		</contributor>
		<contributor>
			<name>Hendy Irawan</name>
			<email>hendy@soluvas.com</email>
			<url>http://www.hendyirawan.com/</url>
			<organization>Soluvas</organization>
			<organizationUrl>http://www.soluvas.com/</organizationUrl>
			<timezone>Asia/Jakarta</timezone>
			<roles>
				<role>Maven, JUnit</role>
			</roles>
		</contributor>
	</contributors>
	<properties>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<slf4j.version>1.7.25</slf4j.version>
		<logback.version>1.2.3</logback.version>
	</properties>
	<build>
		<sourceDirectory>${basedir}/src/java</sourceDirectory>
		<testSourceDirectory>${basedir}/src/java_test</testSourceDirectory>
		<plugins>
			<!-- mvn -DskipTests package appassembler:assemble assembly:single -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>appassembler-maven-plugin</artifactId>
				<version>1.8</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>assemble</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<extraJvmArguments>
						-Djava.library.path=/usr/lib:/usr/lib/jni:/usr/local/lib:/usr/local/lib/jni
						-Drelex.tagalgpath=data/relex-tagging.algs
						-Drelex.semalgpath=data/relex-semantic.algs
						-Drelex.pennalgpath=data/relex-penn-tagging.algs
						-Drelex.sfalgpath=data/relex-stanford.algs
						-Dwordnet.configfile=data/wordnet/file_properties.xml
					</extraJvmArguments>
					<programs>
						<program>
							<id>relexd</id>
							<mainClass>relex.Server</mainClass>
							<jvmSettings>
								<maxMemorySize>1024m</maxMemorySize>
							</jvmSettings>
						</program>
						<program>
							<!-- This will return parsed text on the input socket. -->
							<id>relexd-relex</id>
							<mainClass>relex.Server</mainClass>
							<jvmSettings>
								<maxMemorySize>1024m</maxMemorySize>
							</jvmSettings>
							<commandLineArguments>
								<commandLineArgument>--relex</commandLineArgument>
							</commandLineArguments>
						</program>
						<program>
							<!-- Return with Link Grammar and Relex output on default port 4444. -->
							<id>relexd-link</id>
							<mainClass>relex.Server</mainClass>
							<jvmSettings>
								<maxMemorySize>1024m</maxMemorySize>
							</jvmSettings>
							<commandLineArguments>
								<commandLineArgument>--relex --link</commandLineArgument>
							</commandLineArguments>
						</program>
					</programs>
				</configuration>
			</plugin>
		</plugins>
		<resources>
			<resource>
				<targetPath>./</targetPath>
				<filtering>false</filtering>
				<directory>${basedir}/data</directory>
				<includes>
					<include>relex-penn-tagging.algs</include>
					<include>relex-semantic.algs</include>
					<include>relex-stanford.algs</include>
					<include>relex-tagging.algs</include>
				</includes>
			</resource>
			<resource>
				<targetPath>./</targetPath>
				<filtering>false</filtering>
				<directory>${basedir}/data/wordnet</directory>
				<includes>
					<include>file_properties.xml</include>
				</includes>
			</resource>
			<resource>
				<targetPath>./</targetPath>
				<filtering>false</filtering>
				<directory>${basedir}/data/sentence-detector</directory>
				<includes>
					<include>EnglishSD.bin.gz</include>
				</includes>
			</resource>
			<resource>
				<targetPath>./</targetPath>
				<filtering>false</filtering>
				<directory>${basedir}/data/opennlp/models-1.5</directory>
				<includes>
					<include>en-sent.bin</include>
				</includes>
			</resource>
			<resource>
				<targetPath>./</targetPath>
				<filtering>false</filtering>
				<directory>${basedir}/src/resources</directory>
			</resource>
		</resources>
	</build>
	<dependencies>
		<dependency>
			<groupId>org.opencog</groupId>
			<artifactId>linkgrammar</artifactId>
			<version>5.5.0</version>
		</dependency>
		<dependency>
			<groupId>net.sf.jwordnet</groupId>
			<artifactId>jwnl</artifactId>
			<version>1.4_rc3</version>
		</dependency>
		<dependency>
			<groupId>org.apache.opennlp</groupId>
			<artifactId>opennlp-tools</artifactId>
			<version>1.8.4</version>
		</dependency>
		<dependency>
			<groupId>net.sourceforge.owlapi</groupId>
			<artifactId>owlapi-distribution</artifactId>
			<version>3.5.7</version>
		</dependency>
		<!-- Logging -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j.version}</version>
		</dependency>

		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<version>${logback.version}</version>
		</dependency>

		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-core</artifactId>
			<version>${logback.version}</version>
		</dependency>
		<!-- Tests -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.11</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
</project>


text:
Does not work anymore. Address probably changed.

# ipfs-chat
Serverless chat application using IPFS pub sub.

Build with [ipfs-pubsub-room](https://github.com/ipfs-shipyard/ipfs-pubsub-room).

Preview via [github.io](https://t-gebauer.github.io/ipfs-chat/).


text:
require 'rubygems'
require 'test/unit'
require 'shoulda'
require 'dm-core'

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'dm-encrypted'

PUBLIC_KEY, PRIVATE_KEY = RCrypt.generate_key_pair.values


text:
'use strict';

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

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

var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16;

var _aureliaTemplating = require('aurelia-templating');

var _aureliaDependencyInjection = require('aurelia-dependency-injection');

var _aureliaFramework = require('aurelia-framework');

var _attributeManager = require('../common/attributeManager');

var _attributes = require('../common/attributes');

var _control = require('../control/control');

function _initDefineProp(target, property, descriptor, context) {
    if (!descriptor) return;
    Object.defineProperty(target, property, {
        enumerable: descriptor.enumerable,
        configurable: descriptor.configurable,
        writable: descriptor.writable,
        value: descriptor.initializer ? descriptor.initializer.call(context) : void 0
    });
}

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

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

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

function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
    var desc = {};
    Object['ke' + 'ys'](descriptor).forEach(function (key) {
        desc[key] = descriptor[key];
    });
    desc.enumerable = !!desc.enumerable;
    desc.configurable = !!desc.configurable;

    if ('value' in desc || desc.initializer) {
        desc.writable = true;
    }

    desc = decorators.slice().reverse().reduce(function (desc, decorator) {
        return decorator(target, property, desc) || desc;
    }, desc);

    if (context && desc.initializer !== void 0) {
        desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
        desc.initializer = undefined;
    }

    if (desc.initializer === void 0) {
        Object['define' + 'Property'](target, property, desc);
        desc = null;
    }

    return desc;
}

function _initializerWarningHelper(descriptor, context) {
    throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.');
}

var Ui5FormLayout = exports.Ui5FormLayout = (_dec = (0, _aureliaTemplating.customElement)('ui5-form-layout'), _dec2 = (0, _aureliaDependencyInjection.inject)(Element), _dec3 = (0, _aureliaTemplating.bindable)(), _dec4 = (0, _aureliaTemplating.bindable)(), _dec5 = (0, _aureliaTemplating.bindable)(), _dec6 = (0, _aureliaTemplating.bindable)(), _dec7 = (0, _aureliaTemplating.bindable)(), _dec8 = (0, _aureliaTemplating.bindable)(), _dec9 = (0, _aureliaTemplating.bindable)(), _dec10 = (0, _aureliaTemplating.bindable)(), _dec11 = (0, _aureliaTemplating.bindable)(), _dec12 = (0, _aureliaTemplating.bindable)(), _dec13 = (0, _aureliaTemplating.bindable)(), _dec14 = (0, _aureliaTemplating.bindable)(), _dec15 = (0, _aureliaFramework.computedFrom)('_formlayout'), _dec(_class = _dec2(_class = (_class2 = function (_Ui5Control) {
    _inherits(Ui5FormLayout, _Ui5Control);

    function Ui5FormLayout(element) {
        _classCallCheck(this, Ui5FormLayout);

        var _this = _possibleConstructorReturn(this, _Ui5Control.call(this, element));

        _this._formlayout = null;
        _this._parent = null;
        _this._relation = null;

        _initDefineProp(_this, 'ui5Id', _descriptor, _this);

        _initDefineProp(_this, 'ui5Class', _descriptor2, _this);

        _initDefineProp(_this, 'ui5Tooltip', _descriptor3, _this);

        _initDefineProp(_this, 'prevId', _descriptor4, _this);

        _initDefineProp(_this, 'backgroundDesign', _descriptor5, _this);

        _initDefineProp(_this, 'busy', _descriptor6, _this);

        _initDefineProp(_this, 'busyIndicatorDelay', _descriptor7, _this);

        _initDefineProp(_this, 'busyIndicatorSize', _descriptor8, _this);

        _initDefineProp(_this, 'visible', _descriptor9, _this);

        _initDefineProp(_this, 'fieldGroupIds', _descriptor10, _this);

        _initDefineProp(_this, 'validateFieldGroup', _descriptor11, _this);

        _initDefineProp(_this, 'validationSuccess', _descriptor12, _this);

        _initDefineProp(_this, 'validationError', _descriptor13, _this);

        _initDefineProp(_this, 'parseError', _descriptor14, _this);

        _initDefineProp(_this, 'formatError', _descriptor15, _this);

        _initDefineProp(_this, 'modelContextChange', _descriptor16, _this);

        _this.element = element;
        _this.attributeManager = new _attributeManager.AttributeManager(_this.element);
        return _this;
    }

    Ui5FormLayout.prototype.fillProperties = function fillProperties(params) {
        params.backgroundDesign = this.backgroundDesign;

        _Ui5Control.prototype.fillProperties.call(this, params);
    };

    Ui5FormLayout.prototype.defaultFunc = function defaultFunc() {};

    Ui5FormLayout.prototype.attached = function attached() {
        var that = this;
        var params = {};
        this.fillProperties(params);
        if (this.ui5Id) this._formlayout = new sap.ui.layout.form.FormLayout(this.ui5Id, params);else this._formlayout = new sap.ui.layout.form.FormLayout(params);
        if (this.ui5Class) this._formlayout.addStyleClass(this.ui5Class);
        if (this.ui5Tooltip) this._formlayout.setTooltip(this.ui5Tooltip);

        if ($(this.element).closest("[ui5-container]").length > 0) {
            this._parent = $(this.element).closest("[ui5-container]")[0].au.controller.viewModel;
            if (!this._parent.UIElement || this._parent.UIElement.sId != this._formlayout.sId) {
                var prevSibling = null;

                this._relation = this._parent.addChild(this._formlayout, this.element, this.prevId);
                this.attributeManager.addAttributes({ "ui5-container": '' });
            } else {
                this._parent = $(this.element.parentElement).closest("[ui5-container]")[0].au.controller.viewModel;
                var prevSibling = null;
                this._relation = this._parent.addChild(this._formlayout, this.element, this.prevId);

                this.attributeManager.addAttributes({ "ui5-container": '' });
            }
        } else {
            if (this._formlayout.placeAt) this._formlayout.placeAt(this.element.parentElement);
            this.attributeManager.addAttributes({ "ui5-container": '' });
            this.attributeManager.addClasses("ui5-hide");
        }

        this.attributeManager.addAttributes({ "ui5-id": this._formlayout.sId });
    };

    Ui5FormLayout.prototype.detached = function detached() {
        try {
            if ($(this.element).closest("[ui5-container]").length > 0) {
                if (this._parent && this._relation) {
                    if (this._formlayout) this._parent.removeChildByRelation(this._formlayout, this._relation);
                }
            } else {
                this._formlayout.destroy();
            }
            _Ui5Control.prototype.detached.call(this);
        } catch (err) {}
    };

    Ui5FormLayout.prototype.addChild = function addChild(child, elem, afterElement) {
        var path = jQuery.makeArray($(elem).parentsUntil(this.element));
        for (var _iterator = path, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
            if (_isArray) {
                if (_i >= _iterator.length) break;
                elem = _iterator[_i++];
            } else {
                _i = _iterator.next();
                if (_i.done) break;
                elem = _i.value;
            }

            try {
                if (elem.localName == 'tooltip') {
                    this._formlayout.setTooltip(child);return elem.localName;
                }
                if (elem.localName == 'customdata') {
                    var _index = afterElement ? Math.floor(afterElement + 1) : null;if (_index) this._formlayout.insertCustomData(child, _index);else this._formlayout.addCustomData(child, 0);return elem.localName;
                }
                if (elem.localName == 'layoutdata') {
                    this._formlayout.setLayoutData(child);return elem.localName;
                }
                if (elem.localName == 'dependents') {
                    var _index = afterElement ? Math.floor(afterElement + 1) : null;if (_index) this._formlayout.insertDependent(child, _index);else this._formlayout.addDependent(child, 0);return elem.localName;
                }
                if (elem.localName == 'dragdropconfig') {
                    var _index = afterElement ? Math.floor(afterElement + 1) : null;if (_index) this._formlayout.insertDragDropConfig(child, _index);else this._formlayout.addDragDropConfig(child, 0);return elem.localName;
                }
            } catch (err) {}
        }
    };

    Ui5FormLayout.prototype.removeChildByRelation = function removeChildByRelation(child, relation) {
        try {
            if (relation == 'tooltip') {
                this._formlayout.destroyTooltip(child);
            }
            if (relation == 'customdata') {
                this._formlayout.removeCustomData(child);
            }
            if (relation == 'layoutdata') {
                this._formlayout.destroyLayoutData(child);
            }
            if (relation == 'dependents') {
                this._formlayout.removeDependent(child);
            }
            if (relation == 'dragdropconfig') {
                this._formlayout.removeDragDropConfig(child);
            }
        } catch (err) {}
    };

    Ui5FormLayout.prototype.backgroundDesignChanged = function backgroundDesignChanged(newValue) {
        if (newValue != null && newValue != undefined && this._formlayout !== null) {
            this._formlayout.setBackgroundDesign(newValue);
        }
    };

    Ui5FormLayout.prototype.busyChanged = function busyChanged(newValue) {
        if (this._formlayout !== null) {
            this._formlayout.setBusy((0, _attributes.getBooleanFromAttributeValue)(newValue));
        }
    };

    Ui5FormLayout.prototype.busyIndicatorDelayChanged = function busyIndicatorDelayChanged(newValue) {
        if (this._formlayout !== null) {
            this._formlayout.setBusyIndicatorDelay(newValue);
        }
    };

    Ui5FormLayout.prototype.busyIndicatorSizeChanged = function busyIndicatorSizeChanged(newValue) {
        if (this._formlayout !== null) {
            this._formlayout.setBusyIndicatorSize(newValue);
        }
    };

    Ui5FormLayout.prototype.visibleChanged = function visibleChanged(newValue) {
        if (this._formlayout !== null) {
            this._formlayout.setVisible((0, _attributes.getBooleanFromAttributeValue)(newValue));
        }
    };

    Ui5FormLayout.prototype.fieldGroupIdsChanged = function fieldGroupIdsChanged(newValue) {
        if (this._formlayout !== null) {
            this._formlayout.setFieldGroupIds(newValue);
        }
    };

    Ui5FormLayout.prototype.validateFieldGroupChanged = function validateFieldGroupChanged(newValue) {
        if (newValue != null && newValue != undefined && this._formlayout !== null) {
            this._formlayout.attachValidateFieldGroup(newValue);
        }
    };

    Ui5FormLayout.prototype.validationSuccessChanged = function validationSuccessChanged(newValue) {
        if (newValue != null && newValue != undefined && this._formlayout !== null) {
            this._formlayout.attachValidationSuccess(newValue);
        }
    };

    Ui5FormLayout.prototype.validationErrorChanged = function validationErrorChanged(newValue) {
        if (newValue != null && newValue != undefined && this._formlayout !== null) {
            this._formlayout.attachValidationError(newValue);
        }
    };

    Ui5FormLayout.prototype.parseErrorChanged = function parseErrorChanged(newValue) {
        if (newValue != null && newValue != undefined && this._formlayout !== null) {
            this._formlayout.attachParseError(newValue);
        }
    };

    Ui5FormLayout.prototype.formatErrorChanged = function formatErrorChanged(newValue) {
        if (newValue != null && newValue != undefined && this._formlayout !== null) {
            this._formlayout.attachFormatError(newValue);
        }
    };

    Ui5FormLayout.prototype.modelContextChangeChanged = function modelContextChangeChanged(newValue) {
        if (newValue != null && newValue != undefined && this._formlayout !== null) {
            this._formlayout.attachModelContextChange(newValue);
        }
    };

    _createClass(Ui5FormLayout, [{
        key: 'UIElement',
        get: function get() {
            return this._formlayout;
        }
    }]);

    return Ui5FormLayout;
}(_control.Ui5Control), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, 'ui5Id', [_aureliaTemplating.bindable], {
    enumerable: true,
    initializer: function initializer() {
        return null;
    }
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, 'ui5Class', [_aureliaTemplating.bindable], {
    enumerable: true,
    initializer: function initializer() {
        return null;
    }
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, 'ui5Tooltip', [_aureliaTemplating.bindable], {
    enumerable: true,
    initializer: function initializer() {
        return null;
    }
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, 'prevId', [_aureliaTemplating.bindable], {
    enumerable: true,
    initializer: function initializer() {
        return null;
    }
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, 'backgroundDesign', [_dec3], {
    enumerable: true,
    initializer: function initializer() {
        return 'Translucent';
    }
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, 'busy', [_dec4], {
    enumerable: true,
    initializer: function initializer() {
        return false;
    }
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, 'busyIndicatorDelay', [_dec5], {
    enumerable: true,
    initializer: function initializer() {
        return 1000;
    }
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, 'busyIndicatorSize', [_dec6], {
    enumerable: true,
    initializer: function initializer() {
        return 'Medium';
    }
}), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, 'visible', [_dec7], {
    enumerable: true,
    initializer: function initializer() {
        return true;
    }
}), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, 'fieldGroupIds', [_dec8], {
    enumerable: true,
    initializer: function initializer() {
        return '[]';
    }
}), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, 'validateFieldGroup', [_dec9], {
    enumerable: true,
    initializer: function initializer() {
        return this.defaultFunc;
    }
}), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, 'validationSuccess', [_dec10], {
    enumerable: true,
    initializer: function initializer() {
        return this.defaultFunc;
    }
}), _descriptor13 = _applyDecoratedDescriptor(_class2.prototype, 'validationError', [_dec11], {
    enumerable: true,
    initializer: function initializer() {
        return this.defaultFunc;
    }
}), _descriptor14 = _applyDecoratedDescriptor(_class2.prototype, 'parseError', [_dec12], {
    enumerable: true,
    initializer: function initializer() {
        return this.defaultFunc;
    }
}), _descriptor15 = _applyDecoratedDescriptor(_class2.prototype, 'formatError', [_dec13], {
    enumerable: true,
    initializer: function initializer() {
        return this.defaultFunc;
    }
}), _descriptor16 = _applyDecoratedDescriptor(_class2.prototype, 'modelContextChange', [_dec14], {
    enumerable: true,
    initializer: function initializer() {
        return this.defaultFunc;
    }
}), _applyDecoratedDescriptor(_class2.prototype, 'UIElement', [_dec15], Object.getOwnPropertyDescriptor(_class2.prototype, 'UIElement'), _class2.prototype)), _class2)) || _class) || _class);


text:
/**
 * Support and FAQ: visit Atmel Support
 */

#ifndef I2S_CALLBACK_H_INCLUDED
#define I2S_CALLBACK_H_INCLUDED

#ifdef __cplusplus
extern "C" {
#endif

/**
 * \addtogroup asfdoc_sam0_i2s_group
 *
 * @{
 */

#include <i2s.h>

/**
 * Enum for the possible types of I2S asynchronous jobs that may be issued to
 * the driver.
 */
enum i2s_job_type {
	/** Asynchronous I2S write from a user provided buffer */
	I2S_JOB_WRITE_BUFFER,
	/** Asynchronous I2S read into a user provided buffer */
	I2S_JOB_READ_BUFFER
};

/**
 * \name Callback Management
 * @{
 */

/**
 * \brief Registers a callback for serializer
 *
 * Registers a callback function which is implemented by the user.
 *
 * \note The callback must be enabled by for the interrupt handler to call it
 * when the condition for the callback is met.
 *
 * \param[in] module         Pointer to ADC software instance struct
 * \param[in] serializer     The serializer that generates callback
 * \param[in] callback_func  Pointer to callback function
 * \param[in] callback_type  Callback type given by an enum
 *
 */
static inline void i2s_serializer_register_callback(
		struct i2s_module *const module_inst,
		const enum i2s_serializer serializer,
		const i2s_serializer_callback_t callback_func,
		const enum i2s_serializer_callback callback_type)
{
	/* Sanity check arguments */
	Assert(module_inst);
	Assert(serializer < I2S_SERIALIZER_N);

	module_inst->serializer[serializer].callback[callback_type] = callback_func;
	module_inst->serializer[serializer].registered_callback_mask |=
			(1u << callback_type);
}

/**
 * \brief Unregisters a callback for serializer
 *
 * Unregisters a callback function which is implemented by the user.
 *
 * \param[in] module         Pointer to ADC software instance struct
 * \param[in] serializer     The serializer that generates callback
 * \param[in] callback_type  Callback type given by an enum
 *
 */
static inline void i2s_serializer_unregister_callback(
		struct i2s_module *const module_inst,
		const enum i2s_serializer serializer,
		const enum i2s_serializer_callback callback_type)
{
	/* Sanity check arguments */
	Assert(module_inst);
	Assert(serializer < I2S_SERIALIZER_N);

	module_inst->serializer[serializer].callback[callback_type] = NULL;
	module_inst->serializer[serializer].registered_callback_mask &=
			~(1u << callback_type);
}

/**
 * \brief Enables callback for serializer
 *
 * Enables the callback function registered by \ref
 * i2s_serializer_register_callback. The callback function will be called from
 * the interrupt handler when the conditions for the callback type are met.
 *
 * \param[in] module         Pointer to ADC software instance struct
 * \param[in] serializer     The serializer that generates callback
 * \param[in] callback_type  Callback type given by an enum
 *
 */
static inline void i2s_serializer_enable_callback(
		struct i2s_module *const module_inst,
		const enum i2s_serializer serializer,
		const enum i2s_serializer_callback callback_type)
{
	/* Sanity check arguments */
	Assert(module_inst);
	Assert(module_inst->hw);
	Assert(serializer < I2S_SERIALIZER_N);

	module_inst->serializer[serializer].enabled_callback_mask |=
			(1u << callback_type);
	if (I2S_SERIALIZER_CALLBACK_OVER_UNDER_RUN != callback_type) {
		return;
	}
	module_inst->hw->INTENSET.reg =
		(module_inst->serializer[serializer].mode == I2S_SERIALIZER_TRANSMIT) ?
			(I2S_INTFLAG_TXUR0 << serializer) :
			(I2S_INTFLAG_RXOR0 << serializer);
}

/**
 * \brief Disables callback for Serializer
 *
 * Disables the callback function registered by the \ref
 * i2s_serializer_register_callback.
 *
 * \param[in] module         Pointer to ADC software instance struct
 * \param[in] serializer     The serializer that generates callback
 * \param[in] callback_type  Callback type given by an enum
 *
 */
static inline void i2s_serializer_disable_callback(
		struct i2s_module *const module_inst,
		const enum i2s_serializer serializer,
		const enum i2s_serializer_callback callback_type)
{
	/* Sanity check arguments */
	Assert(module_inst);
	Assert(module_inst->hw);
	Assert(serializer < I2S_SERIALIZER_N);

	module_inst->serializer[serializer].enabled_callback_mask &=
			~(1u << callback_type);
	if (I2S_SERIALIZER_CALLBACK_OVER_UNDER_RUN != callback_type) {
		return;
	}
	module_inst->hw->INTENCLR.reg =
		(module_inst->serializer[serializer].mode == I2S_SERIALIZER_TRANSMIT) ?
			(I2S_INTFLAG_TXUR0 << serializer) :
			(I2S_INTFLAG_RXOR0 << serializer);
}

/** @} */

/**
 * \name Job Management
 *
 * @{
 */

enum status_code i2s_serializer_write_buffer_job(
		struct i2s_module *const module_inst,
		const enum i2s_serializer serializer,
		const void *buffer,
		const uint32_t size);

enum status_code i2s_serializer_read_buffer_job(
		struct i2s_module *const module_inst,
		const enum i2s_serializer serializer,
		void *buffer,
		const uint32_t size);

void i2s_serializer_abort_job(
		struct i2s_module *const module_inst,
		const enum i2s_serializer serializer,
		const enum i2s_job_type job_type);

enum status_code i2s_serializer_get_job_status(
		const struct i2s_module *const module_inst,
		const enum i2s_serializer serializer,
		const enum i2s_job_type job_type);

/** @} */

/** @} */

#ifdef __cplusplus
}
#endif

#endif /* #ifndef I2S_CALLBACK_H_INCLUDED */


text:
<title>GetTemporaryDirectory</title>

GetTemporaryDirectory()

Syntax

Result$ = GetTemporaryDirectory()

Description

Returns the temporary directory name.

Parameters

None.

Return value

Returns the full path to the temporary directory. It will end with a directory separator ('\' on Windows and '/' otherwise).

It's very unlikely, but if this function fails, it will return an empty string.

Remarks

This directory provides read and write access and should be used to store temporary files. Depending on the operating system
and settings, the contents of this directory may be deleted on a regular basis. It is however better to delete temporary files
when they are no longer needed and not rely on such automatic cleanup.

See Also

GetCurrentDirectory(),
GetHomeDirectory()

Supported OS
All

<- GetPathPart() - FileSystem Index - IsDirectory() ->


text:
for i in {1..19}
do
    ./main.py --experiment Experiment/E6/config --jb Experiment/E6/jobs/PPS$i  > Experiment/E6/result$i
done
cd Experiment/E6
mkdir b
mv result* b
mv b result


text:
package org.hive2hive.core.processes.files.add;

import java.util.List;

import net.tomp2p.peers.PeerAddress;

import org.hive2hive.core.model.FolderIndex;
import org.hive2hive.core.model.Index;
import org.hive2hive.core.network.messages.direct.BaseDirectMessage;
import org.hive2hive.core.processes.ProcessFactory;
import org.hive2hive.core.processes.files.util.FileRecursionUtil;
import org.hive2hive.processframework.abstracts.ProcessComponent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * This message is sent after an upload has finished. It downloads the newest version at the receiver side
 *
 * @author Nico
 *
 */
public class UploadNotificationMessage extends BaseDirectMessage {

	private static final long serialVersionUID = -695268345354561544L;
	private static final Logger logger = LoggerFactory.getLogger(UploadNotificationMessage.class);

	private final Index index;

	public UploadNotificationMessage(PeerAddress targetAddress, Index index) {
		super(targetAddress);
		this.index = index;
	}

	@Override
	public void run() {
		logger.debug("Notification message received.");
		if (index.isFile()) {
			downloadSingle();
		} else {
			FolderIndex folder = (FolderIndex) index;
			if (folder.getChildren().isEmpty()) {
				downloadSingle();
			} else {
				downloadTree(folder);
			}
		}
	}

	private void downloadSingle() {
		try {
			logger.debug("Got notified and start to download the file '{}'.", index.getName());
			ProcessComponent process = ProcessFactory.instance().createDownloadFileProcess(index.getFilePublicKey(),
					networkManager);
			process.start();
		} catch (Exception e) {
			logger.error("Got notified but cannot download the file.", e);
		}
	}

	private void downloadTree(FolderIndex folder) {
		List<Index> files = Index.getIndexList(folder);
		try {
			ProcessComponent process = FileRecursionUtil.buildDownloadProcess(files, networkManager);
			process.start();
			logger.debug("Got notified and start downloading a file tree.");
		} catch (Exception e) {
			logger.error("Could not download the full tree.", e);
		}
	}
}


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using Repairis.Orders;

namespace Repairis.Authorization.Users
{
    [Table("EmployeeInfo")]
    public class EmployeeInfo : Entity<long>, IDeletionAudited
    {
        [Required]
        public long EmployeeUserId { get; set; }

        [ForeignKey(nameof(EmployeeUserId))]
        public virtual User EmployeeUser { get; set; }

        public bool SalaryIsFlat { get; set; } = false;

        public decimal SalaryValue { get; set; }

        public bool IsDeleted { get; set; } = false;
        public DateTime? DeletionTime { get; set; }
        public long? DeleterUserId { get; set; }

        public virtual List<Order> AssignedOrders { get; set; } = new List<Order>();
    }
}


text:
package org.gluu.oxtrust.util.jsf;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringEscapeUtils;
import org.gluu.oxtrust.model.User;
import org.gluu.oxtrust.service.PermissionService;
import org.gluu.persist.ldap.impl.LdapEntryManager;
import org.gluu.persist.model.base.Entry;
import org.xdi.model.DisplayNameEntry;
import org.xdi.service.LookupService;
import org.xdi.service.cdi.util.CdiUtil;
import org.xdi.util.StringHelper;

//import org.gluu.site.model.Entry;

/**
 * Tag library to help display data in facelets
 *
 * @author Yuriy Movchan Date: 11.09.2010
 */
public class JsfFunctions {

	public static DisplayNameEntry getDisplayNameEntry(String dn) {
		if (dn == null) {
			return null;
		}

		try {
			return CdiUtil.bean(LookupService.class).getDisplayNameEntry(dn);
		} catch (Exception ex) {
			return null;
		}
	}

	public static List<DisplayNameEntry> getDisplayNameEntries(String baseDn, List<? extends Entry> entries) {
		if ((baseDn == null) || (entries == null)) {
			return null;
		}

		try {
			return CdiUtil.bean(LookupService.class).getDisplayNameEntriesByEntries(baseDn, entries);
		} catch (Exception ex) {
			return null;
		}
	}

	public static String encodeString(String str) {
		if ((str == null) || (str.length() == 0)) {
			return str;
		}
		try {
			return (new URI(null, str, null)).toString();
		} catch (URISyntaxException ex) {
			return null;
		}
	}

	public static String splitByLines(String str, int maxLength) {
		if ((str == null) || (str.length() == 0) || (maxLength == 0)) {
			return str;
		}

		String tmpStr = StringEscapeUtils.escapeHtml(str);

		StringBuilder result = new StringBuilder();
		int startIndex = -1;
		int oldStartIndex = -1;
		while (startIndex + 1 < tmpStr.length()) {
			startIndex = tmpStr.indexOf(' ', startIndex + 1);
			if (startIndex == -1) {
				break;
			}
			if ((startIndex - oldStartIndex + 1) > maxLength) {
				result.append(tmpStr.substring(oldStartIndex + 1, startIndex));
				result.append("<br/>");
				oldStartIndex = startIndex;
			}
			startIndex++;
		}

		if (oldStartIndex < tmpStr.length()) {
			result.append(tmpStr.substring(oldStartIndex + 1));
		}

		return result.toString();
	}

	public static String trimFileName(String str, int maxLength) {
		if ((str == null) || (str.length() == 0) || (maxLength < 10)) {
			return str;
		}

		int length = str.length();
		int middleMaxLength = (maxLength - 3) / 2;

		if (length <= maxLength) {
			return str;
		}

		return str.substring(0, middleMaxLength - 1) + "..." + str.substring(length - middleMaxLength - 2);
	}

	public static String getColor(String color, String defaultColor) {
		String tmpColor = StringHelper.isEmpty(color) ? defaultColor : color;
		return "#" + tmpColor + ";";
	}

	public static String getPersonDisplayName(User person) {
		if (person == null) {
			return null;
		}

		if (StringHelper.isEmpty(person.getDisplayName())) {
			return person.getUid();
		}

		return person.getDisplayName();
	}

	public static boolean hasPermission(Object target, String action) {
		return CdiUtil.bean(PermissionService.class).hasPermission(target, action);
	}

	public static List<Map.Entry<?, ?>> toList(Map<?, ?> map) {
		return map != null ? new ArrayList<Map.Entry<?, ?>>(map.entrySet()) : null;
	}

	public static String trim(String str) {
		if ((str == null) || (str.length() == 0)) {
			return str;
		}
		return str.trim();
	}

	public static String trimToLength(String str, int maxLength) {
		if (str == null) {
			return str;
		}

		int length = str.length();
		if (length <= maxLength) {
			return str;
		}

		return str.substring(0, maxLength) + "...";
	}

	public static String convertLdapTimeToDisplay(String timeStamp) {
		if ((timeStamp == null) || (timeStamp.length() == 0)) {
			return timeStamp;
		}

		return CdiUtil.bean(LdapEntryManager.class).decodeGeneralizedTime(timeStamp).toGMTString();

	}

}


text:
UCLASS(MinimalAPI, config=Editor, collapsecategories, hidecategories=Object)
class UActorFactoryTriggerBox : public UActorFactory
{
	GENERATED_UCLASS_BODY()

};


text:
/* eslint-env jest */
import React from 'react'
import { shallow } from 'enzyme'
import PackageList from '../PackageList'

const setup = (propOverrides) => {
  const props = Object.assign({
    onRefresh: () => null,
    packages: [
      {
        name: 'react',
        version: '15.4.2',
        description: 'React is a JavaScript library for building user interfaces.'
      },
      {
        name: 'redux',
        version: '3.6.0',
        description: 'Predictable state container for JavaScript apps'
      }
    ]
  }, propOverrides)

  const wrapper = shallow(<PackageList {...props} />)

  return {
    props,
    wrapper,
    refreshButton: wrapper.find('button')
  }
}

it('renders correctly', () => {
  const { wrapper } = setup()
  expect(wrapper).toMatchSnapshot()
})

it('calls its onRefresh handler', () => {
  const onRefresh = jest.fn()
  const { refreshButton } = setup({ onRefresh })

  refreshButton.simulate('click')

  expect(onRefresh.mock.calls.length).toBe(1)
})


text:
This library allows you to connect to and query Apache Drill programmatically.  It is loosely modeled after PHP's mysql interface, so if you are familiar with that, you already pretty much know how to use the Drill connector.

## Installing the Connector
The connector is on the Packageist (https://packagist.org/packages/thedataist/drill-connector) and can be installed by using composer as follows:
```
composer require thedataist/drill-connector:dev-master
```

## Using the Connector
The first step is to connect to Drill.  The module uses Drill's RESTful interface, so it doesn't really make a "connection" in the same sense as MySQL.

```php
  $drill = new DrillConnection( 'localhost', 8047 );
```

As mentioned earlier, this creates the object, but doesn't actually send anything to Drill. You can use the `is_active()` menthod to verify that your connection is active.
```php
  if( $drill->is_active() ) {
    print( "Connection Active" );
  } else {
    print( "Connection Inactive" );
  }
```

## Querying Drill
Now that you've connected to Drill, you can query drill in much a similar way as MySQL by calling the `query()` method. Once you've called the `query()` method, you can use one of the `fetch()` methods to retrieve the results, in a similar manner as MySQL.  Currently the Drill connector currently has:
* **`fetch_all()`**:  Returns all query results in an associative array.
* **`fetch_assoc()`**:  Returns a single query row as an associative array.
* **`fetch_object()`**:  Returns a single row as a PHP Object.

You might also find these functions useful:
* **`data_seek($n)`**: Returns the row at index `$n` and sets the current row to `$n`.
* **`num_rows()`**: Returns the number of rows returned by the query.
* **`field_count()`**:  Returns the number of columns returned by the query.

Thus, if you want to execute a query in Drill, you can do so as follows:
```
$query_result = $drill->query( "SELECT * FROM cp.`employee.json` LIMIT 20" );
while( $row = $query_result->fetch_assoc() ) {
  print( "Field 1: {$row['field1']}\n" );
  print( "Field 2: {$row['field2']}\n" );
}
```
## Interacting with Drill
You can also use the connector to activate/deactivate Drill's storage as well as get information about Drill's plugins.

* **`disable_plugin( $plugin )`**  Disables the given plugin.  Returns true if successful, false if not.
* **`enable_plugin( $plugin )`**   Enables the given plugin.  Returns true if successful, false if not.
* **`get_all_storage_plugins()`**  Returns an array of all storage plugins.
* **`get_disabled_storage_plugins()`**  Returns an array of all disabled plugins.
* **`get_enabled_storage_plugins()`**  Returns an array of all enabled plugins.
* **`get_storage_plugins()`**  Returns an associative array of plugins and associated configuration options for all plugins.
* **`get_storage_plugin_info( $plugin )`**  Returns an associative array of configuration options for a given plugin.


text:
#include <aws/lexv2-models/model/DeleteCustomVocabularyRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::LexModelsV2::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;

DeleteCustomVocabularyRequest::DeleteCustomVocabularyRequest() :
    m_botIdHasBeenSet(false),
    m_botVersionHasBeenSet(false),
    m_localeIdHasBeenSet(false)
{
}

Aws::String DeleteCustomVocabularyRequest::SerializePayload() const
{
  return {};
}


text:
<?php

namespace AnyContent\Filter\Interfaces;

use AnyContent\Client\Record;

interface Filter
{

    /**
     * @param Record $record
     *
     * @return boolean
     */
    public function match(Record $record);

}


text:
document
========

.. automodule:: cloudant.document
    :members:
    :undoc-members:
    :show-inheritance:


text:
#ifndef CONVOLVE_H
#define CONVOLVE_H

#include "mtypes.h"

#if _HAVE_FULL_GL
extern void GLAPIENTRY
_mesa_ConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width,
                          GLenum format, GLenum type, const GLvoid *image);

extern void GLAPIENTRY
_mesa_ConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width,
                          GLsizei height, GLenum format, GLenum type,
                          const GLvoid *image);

extern void GLAPIENTRY
_mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat params);

extern void GLAPIENTRY
_mesa_ConvolutionParameterfv(GLenum target, GLenum pname,
                             const GLfloat *params);

extern void GLAPIENTRY
_mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint params);

extern void GLAPIENTRY
_mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params);

extern void GLAPIENTRY
_mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalformat,
                              GLint x, GLint y, GLsizei width);

extern void GLAPIENTRY
_mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalformat,
                              GLint x, GLint y, GLsizei width, GLsizei height);

extern void GLAPIENTRY
_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type,
                           GLvoid *image);

extern void GLAPIENTRY
_mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params);

extern void GLAPIENTRY
_mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params);

extern void GLAPIENTRY
_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
                         GLvoid *row, GLvoid *column, GLvoid *span);

extern void GLAPIENTRY
_mesa_SeparableFilter2D(GLenum target, GLenum internalformat,
                        GLsizei width, GLsizei height,
                        GLenum format, GLenum type,
                        const GLvoid *row, const GLvoid *column);

extern void
_mesa_convolve_1d_image(const GLcontext *ctx, GLsizei *width,
                        const GLfloat *srcImage, GLfloat *dstImage);

extern void
_mesa_convolve_2d_image(const GLcontext *ctx, GLsizei *width, GLsizei *height,
                        const GLfloat *srcImage, GLfloat *dstImage);

extern void
_mesa_convolve_sep_image(const GLcontext *ctx,
                         GLsizei *width, GLsizei *height,
                         const GLfloat *srcImage, GLfloat *dstImage);

extern void
_mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions,
                                   GLsizei *width, GLsizei *height);

#else
#define _mesa_adjust_image_for_convolution(c, d, w, h) ((void)0)
#define _mesa_convolve_1d_image(c,w,s,d) ((void)0)
#define _mesa_convolve_2d_image(c,w,h,s,d) ((void)0)
#define _mesa_convolve_sep_image(c,w,h,s,d) ((void)0)
#endif

#endif


text:
Finds values and indices of the `k` largest entries for the last dimension.

If the input is a vector (rank-1), finds the `k` largest entries in the vector
and outputs their values and indices as vectors.  Thus `values[j]` is the
`j`-th largest entry in `input`, and its index is `indices[j]`.

For matrices (resp. higher rank input), computes the top `k` entries in each
row (resp. vector along the last dimension).  Thus,

    values.shape = indices.shape = input.shape[:-1] + [k]

If two elements are equal, the lower-index element appears first.

##### Args:

*  <b>`input`</b>: 1-D or higher `Tensor` with last dimension at least `k`.
*  <b>`k`</b>: 0-D `int32` `Tensor`.  Number of top elements to look for along the last
    dimension (along each row for matrices).
*  <b>`sorted`</b>: If true the resulting `k` elements will be sorted by the values in
    descending order.
*  <b>`name`</b>: Optional name for the operation.

##### Returns:

*  <b>`values`</b>: The `k` largest elements along each last dimensional slice.
*  <b>`indices`</b>: The indices of `values` within the last dimension of `input`.


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

/******************************************************************************
 * This file is auto-generated from a template file by the GenerateTests.csx  *
 * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make    *
 * changes, please update the corresponding template and run according to the *
 * directions listed in the file.                                             *
 ******************************************************************************/

using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;

namespace JIT.HardwareIntrinsics.X86
{
    public static partial class Program
    {
        private static void ZeroHighBitsUInt32()
        {
            var test = new ScalarBinaryOpTest__ZeroHighBitsUInt32();

            if (test.IsSupported)
            {
                // Validates basic functionality works, using Unsafe.ReadUnaligned
                test.RunBasicScenario_UnsafeRead();

                // Validates calling via reflection works, using Unsafe.ReadUnaligned
                test.RunReflectionScenario_UnsafeRead();

                // Validates passing a static member works
                test.RunClsVarScenario();

                // Validates passing a local works, using Unsafe.ReadUnaligned
                test.RunLclVarScenario_UnsafeRead();

                // Validates passing the field of a local class works
                test.RunClassLclFldScenario();

                // Validates passing an instance member of a class works
                test.RunClassFldScenario();

                // Validates passing the field of a local struct works
                test.RunStructLclFldScenario();

                // Validates passing an instance member of a struct works
                test.RunStructFldScenario();
            }
            else
            {
                // Validates we throw on unsupported hardware
                test.RunUnsupportedScenario();
            }

            if (!test.Succeeded)
            {
                throw new Exception("One or more scenarios did not complete as expected.");
            }
        }
    }

    public sealed unsafe class ScalarBinaryOpTest__ZeroHighBitsUInt32
    {
        private struct TestStruct
        {
            public UInt32 _fld1;
            public UInt32 _fld2;

            public static TestStruct Create()
            {
                var testStruct = new TestStruct();

                testStruct._fld1 = 0xFFFFFFFF;
                testStruct._fld2 = 16;

                return testStruct;
            }

            public void RunStructFldScenario(ScalarBinaryOpTest__ZeroHighBitsUInt32 testClass)
            {
                var result = Bmi2.ZeroHighBits(_fld1, _fld2);
                testClass.ValidateResult(_fld1, _fld2, result);
            }
        }

        private static UInt32 _data1;
        private static UInt32 _data2;

        private static UInt32 _clsVar1;
        private static UInt32 _clsVar2;

        private UInt32 _fld1;
        private UInt32 _fld2;

        static ScalarBinaryOpTest__ZeroHighBitsUInt32()
        {
            _clsVar1 = 0xFFFFFFFF;
            _clsVar2 = 16;
        }

        public ScalarBinaryOpTest__ZeroHighBitsUInt32()
        {
            Succeeded = true;

            _fld1 = 0xFFFFFFFF;
            _fld2 = 16;

            _data1 = 0xFFFFFFFF;
            _data2 = 16;
        }

        public bool IsSupported => Bmi2.IsSupported;

        public bool Succeeded { get; set; }

        public void RunBasicScenario_UnsafeRead()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));

            var result = Bmi2.ZeroHighBits(
                Unsafe.ReadUnaligned<UInt32>(ref Unsafe.As<UInt32, byte>(ref _data1)),
                Unsafe.ReadUnaligned<UInt32>(ref Unsafe.As<UInt32, byte>(ref _data2))
            );

            ValidateResult(_data1, _data2, result);
        }

        public void RunReflectionScenario_UnsafeRead()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));

            var result = typeof(Bmi2).GetMethod(nameof(Bmi2.ZeroHighBits), new Type[] { typeof(UInt32), typeof(UInt32) })
                                     .Invoke(null, new object[] {
                                        Unsafe.ReadUnaligned<UInt32>(ref Unsafe.As<UInt32, byte>(ref _data1)),
                                        Unsafe.ReadUnaligned<UInt32>(ref Unsafe.As<UInt32, byte>(ref _data2))
                                     });

            ValidateResult(_data1, _data2, (UInt32)result);
        }

        public void RunClsVarScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));

            var result = Bmi2.ZeroHighBits(
                _clsVar1,
                _clsVar2
            );

            ValidateResult(_clsVar1, _clsVar2, result);
        }

        public void RunLclVarScenario_UnsafeRead()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));

            var data1 = Unsafe.ReadUnaligned<UInt32>(ref Unsafe.As<UInt32, byte>(ref _data1));
            var data2 = Unsafe.ReadUnaligned<UInt32>(ref Unsafe.As<UInt32, byte>(ref _data2));
            var result = Bmi2.ZeroHighBits(data1, data2);

            ValidateResult(data1, data2, result);
        }

        public void RunClassLclFldScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));

            var test = new ScalarBinaryOpTest__ZeroHighBitsUInt32();
            var result = Bmi2.ZeroHighBits(test._fld1, test._fld2);

            ValidateResult(test._fld1, test._fld2, result);
        }

        public void RunClassFldScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));

            var result = Bmi2.ZeroHighBits(_fld1, _fld2);
            ValidateResult(_fld1, _fld2, result);
        }

        public void RunStructLclFldScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));

            var test = TestStruct.Create();
            var result = Bmi2.ZeroHighBits(test._fld1, test._fld2);

            ValidateResult(test._fld1, test._fld2, result);
        }

        public void RunStructFldScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));

            var test = TestStruct.Create();
            test.RunStructFldScenario(this);
        }

        public void RunUnsupportedScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));

            bool succeeded = false;

            try
            {
                RunBasicScenario_UnsafeRead();
            }
            catch (PlatformNotSupportedException)
            {
                succeeded = true;
            }

            if (!succeeded)
            {
                Succeeded = false;
            }
        }

        private void ValidateResult(UInt32 left, UInt32 right, UInt32 result, [CallerMemberName] string method = "")
        {
            var isUnexpectedResult = false;

            uint expectedResult = 0xFFFF; isUnexpectedResult = (expectedResult != result);

            if (isUnexpectedResult)
            {
                TestLibrary.TestFramework.LogInformation($"{nameof(Bmi2)}.{nameof(Bmi2.ZeroHighBits)}<UInt32>(UInt32, UInt32): ZeroHighBits failed:");
                TestLibrary.TestFramework.LogInformation($"    left: {left}");
                TestLibrary.TestFramework.LogInformation($"   right: {right}");
                TestLibrary.TestFramework.LogInformation($"  result: {result}");
                TestLibrary.TestFramework.LogInformation(string.Empty);

                Succeeded = false;
            }
        }
    }
}


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

    <title>ActionView::TestCase</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/github.css" type="text/css" media="screen" />

            Ruby on Rails 4.2.3

            Class
            ActionView::TestCase

                <

                    ActiveSupport::TestCase

/Users/lee/.rvm/gems/ruby-2.2.2@playme/gems/actionview-4.2.3/lib/action_view/test_case.rb

Action View Test Case

Namespace

          MODULE
          ActionView::TestCase::Behavior

          CLASS
          ActionView::TestCase::TestController

Included Modules

              ActionView::TestCase::Behavior


text:
var utils = require('../utils.js');
var bidfactory = require('../bidfactory.js');
var bidmanager = require('../bidmanager.js');

/**
 * Adapter for requesting bids from Pubmatic.
 *
 * @returns {{callBids: _callBids}}
 * @constructor
 */
var PubmaticAdapter = function PubmaticAdapter() {

  var bids;
  var _pm_pub_id;
  var _pm_optimize_adslots = [];

  function _callBids(params) {
    bids = params.bids;
    for (var i = 0; i < bids.length; i++) {
      var bid = bids[i];
      bidmanager.pbCallbackMap['' + bid.params.adSlot] = bid;
      _pm_pub_id = _pm_pub_id || bid.params.publisherId;
      _pm_optimize_adslots.push(bid.params.adSlot);
    }

    // Load pubmatic script in an iframe, because they call document.write
    _getBids();
  }

  function _getBids() {

    // required variables for pubmatic pre-bid call
    window.pm_pub_id = _pm_pub_id;
    window.pm_optimize_adslots = _pm_optimize_adslots;

    //create the iframe
    var iframe = utils.createInvisibleIframe();
    var elToAppend = document.getElementsByTagName('head')[0];

    //insert the iframe into document
    elToAppend.insertBefore(iframe, elToAppend.firstChild);

    var iframeDoc = utils.getIframeDocument(iframe);
    iframeDoc.write(_createRequestContent());
    iframeDoc.close();
  }

  function _createRequestContent() {
    var content = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"' +
      ' "http://www.w3.org/TR/html4/loose.dtd"><base target="_top" /><scr' +
      'ipt>inDapIF=true;</scr' + 'ipt>';
    content += '';
    content += '<scr' + 'ipt>';
    content += '' +
      'window.pm_pub_id  = "%%PM_PUB_ID%%";' +
      'window.pm_optimize_adslots     = [%%PM_OPTIMIZE_ADSLOTS%%];';
    content += '</scr' + 'ipt>';

    var map = {};
    map.PM_PUB_ID = _pm_pub_id;
    map.PM_OPTIMIZE_ADSLOTS = _pm_optimize_adslots.map(function (adSlot) {
      return "'" + adSlot + "'";
    }).join(',');

    content += '<scr' + 'ipt src="https://ads.pubmatic.com/AdServer/js/gshowad.js"></scr' + 'ipt>';
    content += '<scr' + 'ipt>';
    content += 'window.parent.pbjs.handlePubmaticCallback({progKeyValueMap: progKeyValueMap,' +
      ' bidDetailsMap: bidDetailsMap})';
    content += '</scr' + 'ipt>';
    content += '';
    content = utils.replaceTokenInString(content, map, '%%');

    return content;
  }

  pbjs.handlePubmaticCallback = function (response) {
    var i;
    var adUnit;
    var adUnitInfo;
    var bid;
    var bidResponseMap = (response && response.bidDetailsMap) || {};
    var bidInfoMap = (response && response.progKeyValueMap) || {};
    var dimensions;

    for (i = 0; i < bids.length; i++) {
      var adResponse;
      bid = bids[i].params;

      adUnit = bidResponseMap[bid.adSlot] || {};

      // adUnitInfo example: bidstatus=0;bid=0.0000;bidid=39620189@320x50;wdeal=

      // if using DFP GPT, the params string comes in the format:
      // "bidstatus;1;bid;5.0000;bidid;hb_test@468x60;wdeal;"
      // the code below detects and handles this.
      if (bidInfoMap[bid.adSlot].indexOf('=') === -1) {
        bidInfoMap[bid.adSlot] = bidInfoMap[bid.adSlot].replace(/([a-z]+);(.[^;]*)/ig, '$1=$2');
      }

      adUnitInfo = (bidInfoMap[bid.adSlot] || '').split(';').reduce(function (result, pair) {
        var parts = pair.split('=');
        result[parts[0]] = parts[1];
        return result;
      }, {});

      if (adUnitInfo.bidstatus === '1') {
        dimensions = adUnitInfo.bidid.split('@')[1].split('x');
        adResponse = bidfactory.createBid(1);
        adResponse.bidderCode = 'pubmatic';
        adResponse.adSlot = bid.adSlot;
        adResponse.cpm = Number(adUnitInfo.bid);
        adResponse.ad = unescape(adUnit.creative_tag);  // jshint ignore:line
        adResponse.ad += utils.createTrackPixelHtml(decodeURIComponent(adUnit.tracking_url));
        adResponse.width = dimensions[0];
        adResponse.height = dimensions[1];
        adResponse.dealId = adUnitInfo.wdeal;

        bidmanager.addBidResponse(bids[i].placementCode, adResponse);
      } else {
        // Indicate an ad was not returned
        adResponse = bidfactory.createBid(2);
        adResponse.bidderCode = 'pubmatic';
        bidmanager.addBidResponse(bids[i].placementCode, adResponse);
      }
    }
  };

  return {
    callBids: _callBids
  };

};

module.exports = PubmaticAdapter;


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>OL3-Cesium API Documentation - Class: VectorSynchronizer</title>

    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/bootstrap.min.css">
    <link type="text/css" rel="stylesheet" href="styles/jaguar.css">

OL3-Cesium

        <input id="search" type="text" class="form-control input-sm" placeholder="Search Documentation">

                olcs.AbstractSynchronizer

            Methods

                    synchronize

                olcs.Camera

            Methods

                    getAltitude

                    getCenter

                    getDistance

                    getHeading

                    getPosition

                    getTilt

                    lookAt

                    setAltitude

                    setCenter

                    setDistance

                    setHeading

                    setPosition

                    setTilt

                    updateView

                olcs.DragBox

            Members

listen

            Methods

                    setScene

                olcs.OLCesium

            Methods

                    getCamera

                    getCesiumScene

                    getEnabled

                    getOlMap

                    setEnabled

                    warmUp

                olcs.RasterSynchronizer

                olcs.VectorSynchronizer

                olcs.core

            Methods

                    applyHeightOffsetToGeometry

                    computeAngleToZenith

                    computePixelSizeAtCoordinate

                    computePlainStyle

                    computeSignedTiltAngleOnGlobe

                    extentToRectangle

                    lookAt

                    ol4326CoordinateArrayToCsCartesians

                    ol4326CoordinateToCesiumCartesian

                    olCircleGeometryToCesium

                    olFeatureToCesium

                    olGeometry4326TextPartToCesium

                    olLineStringGeometryToCesium

                    olMultiGeometryToCesium

                    olPointGeometryToCesium

                    olPolygonGeometryToCesium

                    olStyleToCesium

                    olVectorLayerToCesium

                    pickBottomPoint

                    pickCenterPoint

                    pickOnTerrainOrEllipsoid

                    rotateAroundAxis

                    setHeadingUsingBottomCenter

                    tileLayerToImageryLayer

                    updateCesiumLayerProperties

                olcs.core.OlLayerPrimitive

            Methods

                    convert

Class: VectorSynchronizer

VectorSynchronizer

            new olcs.VectorSynchronizer(map, scene)

experimental

            src/vectorsynchronizer.js, line 19

Unidirectionally synchronize OpenLayers vector layers to Cesium.

		Name

		Type

		Description

                map

ol.Map

                scene

Cesium.Scene

Extends

olcs.AbstractSynchronizer.<olcs.core.OlLayerPrimitive>

            Documentation generated by JSDoc 3.3.0 on Fri May 29 2015 17:47:52 GMT+0200 (CEST)


text:
package net.rithms.riot.api.endpoints.static_data.dto;

import java.io.Serializable;
import java.util.Map;

import net.rithms.riot.api.Dto;

/**
 * This object contains mastery list data.
 */
public class MasteryList extends Dto implements Serializable {

	private static final long serialVersionUID = -2255568964283725298L;

	private Map<String, Mastery> data;
	private MasteryTree tree;
	private String type;
	private String version;

	public Map<String, Mastery> getData() {
		return data;
	}

	public MasteryTree getTree() {
		return tree;
	}

	public String getType() {
		return type;
	}

	public String getVersion() {
		return version;
	}

	@Override
	public String toString() {
		return getType();
	}
}


text:
package org.apache.drill.exec.expr.fn.impl;

import io.netty.buffer.DrillBuf;
import org.apache.drill.exec.expr.DrillSimpleFunc;
import org.apache.drill.exec.expr.annotations.FunctionTemplate;
import org.apache.drill.exec.expr.annotations.Output;
import org.apache.drill.exec.expr.annotations.Param;
import org.apache.drill.exec.expr.holders.VarCharHolder;
import org.apache.drill.exec.vector.complex.writer.BaseWriter;

import javax.inject.Inject;

@FunctionTemplate(
        name="parse_url",
        scope= FunctionTemplate.FunctionScope.SIMPLE,
        nulls = FunctionTemplate.NullHandling.NULL_IF_NULL
)

public class ParseUrlFunction implements DrillSimpleFunc {

    @Param VarCharHolder input;

    @Output BaseWriter.ComplexWriter outWriter;

    @Inject DrillBuf outBuffer;

    public void setup() {}

    public void eval() {

        org.apache.drill.exec.vector.complex.writer.BaseWriter.MapWriter urlMapWriter = outWriter.rootAsMap();

        String urlString = org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(input.start, input.end, input.buffer);

        try {
            java.net.URL aURL = new java.net.URL(urlString);

            String protocol = aURL.getProtocol();
            String authority = aURL.getAuthority();
            String host = aURL.getHost();
            java.lang.Integer port = aURL.getPort();
            String path = aURL.getPath();
            String query = aURL.getQuery();
            String filename = aURL.getFile();
            String ref = aURL.getRef();

            org.apache.drill.exec.expr.holders.VarCharHolder rowHolder = new org.apache.drill.exec.expr.holders.VarCharHolder();

            byte[] rowStringBytes = protocol.getBytes();

            outBuffer.reallocIfNeeded(rowStringBytes.length);
            outBuffer.setBytes(0, rowStringBytes);

            rowHolder.start = 0;
            rowHolder.end = rowStringBytes.length;
            rowHolder.buffer = outBuffer;

            urlMapWriter.varChar("protocol").write(rowHolder);

            byte[] authRowStringBytes = authority.getBytes();

            outBuffer.reallocIfNeeded(authRowStringBytes.length);
            outBuffer.setBytes(0, authRowStringBytes);

            rowHolder.start = 0;
            rowHolder.end = authRowStringBytes.length;
            rowHolder.buffer = outBuffer;

            urlMapWriter.varChar("authority").write(rowHolder);

            byte[] hostRowStringBytes = host.getBytes();

            outBuffer.reallocIfNeeded(hostRowStringBytes.length);
            outBuffer.setBytes(0, hostRowStringBytes);

            rowHolder.start = 0;
            rowHolder.end = hostRowStringBytes.length;
            rowHolder.buffer = outBuffer;

            urlMapWriter.varChar("host").write(rowHolder);

            byte[] pathRowStringBytes = path.getBytes();

            outBuffer.reallocIfNeeded(pathRowStringBytes.length);
            outBuffer.setBytes(0, pathRowStringBytes);

            rowHolder.start = 0;
            rowHolder.end = pathRowStringBytes.length;
            rowHolder.buffer = outBuffer;

            urlMapWriter.varChar("path").write(rowHolder);

            byte[] queryRowStringBytes = query.getBytes();

            outBuffer.reallocIfNeeded(queryRowStringBytes.length);
            outBuffer.setBytes(0, queryRowStringBytes);

            rowHolder.start = 0;
            rowHolder.end = queryRowStringBytes.length;
            rowHolder.buffer = outBuffer;

            urlMapWriter.varChar("query").write(rowHolder);

            byte[] filenameRowStringBytes = filename.getBytes();

            outBuffer.reallocIfNeeded(filenameRowStringBytes.length);
            outBuffer.setBytes(0, filenameRowStringBytes);

            rowHolder.start = 0;
            rowHolder.end = filenameRowStringBytes.length;
            rowHolder.buffer = outBuffer;

            urlMapWriter.varChar("filename").write(rowHolder);

            byte[] refRowStringBytes = ref.getBytes();

            outBuffer.reallocIfNeeded(refRowStringBytes.length);
            outBuffer.setBytes(0, refRowStringBytes);

            rowHolder.start = 0;
            rowHolder.end = refRowStringBytes.length;
            rowHolder.buffer = outBuffer;

            urlMapWriter.varChar("ref").write(rowHolder);

            org.apache.drill.exec.expr.holders.IntHolder intHolder = new org.apache.drill.exec.expr.holders.IntHolder();
            intHolder.value = port;
            urlMapWriter.integer("port").write(intHolder);
        }
        catch (Exception e ) {}
    }
}


text:
echo "`whoami`" | sudo -S chmod 777 /dev/kvm > /dev/null 2>&1

export PATH=$PATH:/studio-data/platform-tools/

# Default to 'bash' if no arguments are provided
args="$@"
if [ -z "$args" ]; then
  args="~/android-studio/bin/studio.sh"
fi

exec $args


text:
package io.druid.query.groupby.epinephelinae;

import com.google.common.base.Suppliers;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.collect.Ordering;
import com.google.common.primitives.Ints;
import io.druid.data.input.MapBasedRow;
import io.druid.query.aggregation.AggregatorFactory;
import io.druid.query.aggregation.CountAggregatorFactory;
import io.druid.query.aggregation.LongSumAggregatorFactory;
import io.druid.query.groupby.epinephelinae.Grouper.Entry;
import org.junit.Assert;
import org.junit.Test;

import java.nio.ByteBuffer;
import java.util.Comparator;
import java.util.List;

public class BufferArrayGrouperTest
{
  @Test
  public void testAggregate()
  {
    final TestColumnSelectorFactory columnSelectorFactory = GrouperTestUtil.newColumnSelectorFactory();
    final IntGrouper grouper = newGrouper(columnSelectorFactory, 1024);

    columnSelectorFactory.setRow(new MapBasedRow(0, ImmutableMap.of("value", 10L)));
    grouper.aggregate(12);
    grouper.aggregate(6);
    grouper.aggregate(10);
    grouper.aggregate(6);
    grouper.aggregate(12);
    grouper.aggregate(6);

    final List<Entry<Integer>> expected = ImmutableList.of(
        new Grouper.Entry<>(6, new Object[]{30L, 3L}),
        new Grouper.Entry<>(10, new Object[]{10L, 1L}),
        new Grouper.Entry<>(12, new Object[]{20L, 2L})
    );
    final List<Entry<Integer>> unsortedEntries = Lists.newArrayList(grouper.iterator(false));

    Assert.assertEquals(
        expected,
        Ordering.from((Comparator<Entry<Integer>>) (o1, o2) -> Ints.compare(o1.getKey(), o2.getKey()))
                .sortedCopy(unsortedEntries)
    );
  }

  private BufferArrayGrouper newGrouper(
      TestColumnSelectorFactory columnSelectorFactory,
      int bufferSize
  )
  {
    final ByteBuffer buffer = ByteBuffer.allocate(bufferSize);

    final BufferArrayGrouper grouper = new BufferArrayGrouper(
        Suppliers.ofInstance(buffer),
        columnSelectorFactory,
        new AggregatorFactory[]{
            new LongSumAggregatorFactory("valueSum", "value"),
            new CountAggregatorFactory("count")
        },
        1000
    );
    grouper.init();
    return grouper;
  }
}