text:
var blocks = require('blocks'),
    Drone  = require('drone'),
    utils  = require('utils');
/*
 * TravelingSalesmanRenderer
 *
 * Description: Uses the drone to manage a representation of the map in minecraft
 *
 * Parameters:
 *  sender      - who is calling this
 *  callback    - callback called when initialization is complete
 */
var TravelingSalesmanRenderer = function (sender, callback) {
    if("function" !== typeof callback) callback = function() {}; // callback should always be a function

    var self = {};

    var __drone = new Drone(sender);

    var __start_location = {
        x: 0,
        y: 0,
        z: 0
    };

    var __colors = ['white','orange','magenta','lightblue','yellow','lime','pink','gray','lightgray','cyan','purple','blue','brown','green','red','black'];

    function _initialize() {
        var error;

        __drone.up().up();

        __start_location = {
            x: __drone.x,
            y: __drone.y,
            z: __drone.z
        };

        self.player = sender;

        callback(error, self);
    }

    // map is a flat map containing json objects with keys x,y,z and point
    self.renderMap = function(map, empty, callback) {
        if("function" !== typeof callback) callback = function() {}; // callback should always be a function

        utils.foreach(map, function(loc) {
            __drone.x = __start_location.x + loc.x;
            __drone.y = __start_location.y + loc.y;
            __drone.z = __start_location.z + loc.z;

            if (loc.point && ! empty) {
                self.drawPoint(loc);
            }
            else {
                self.clearPoint(loc);
            }
        }, undefined, 4, function() { callback(undefined, self); });
    };

    self.clearMap = function(map, callback) {
        if("function" !== typeof callback) callback = function() {}; // callback should always be a function

        __drone.x = __start_location.x;
        __drone.y = __start_location.y;
        __drone.z = __start_location.z;

        var range = map.getRange();

        __drone.box(blocks.air, range.x, range.y, range.z);

        callback(undefined, self);
    };

    self.renderPoints = function(points, callback) {
        if("function" !== typeof callback) callback = function() {}; // callback should always be a function

        utils.foreach(points, function(point) {
            __drone.x = __start_location.x + point.x;
            __drone.y = __start_location.y + point.y;
            __drone.z = __start_location.z + point.z;

            self.drawPoint(point);
        }, undefined, 4, function() { callback(undefined, self); });
    }

    self.clearPoints = function(points, callback) {
        if("function" !== typeof callback) callback = function() {}; // callback should always be a function

        utils.foreach(points, function(point) {
            __drone.x = __start_location.x + point.x;
            __drone.y = __start_location.y + point.y;
            __drone.z = __start_location.z + point.z;

            self.clearPoint(point);
        }, undefined, 4, function() { callback(undefined, self); });
    }

    self.renderPaths = function(paths, callback) {
        if("function" !== typeof callback) callback = function() {}; // callback should always be a function

        utils.foreach(paths, function(path) {
            self.drawLine(path.p1, path.p2);
        }, undefined, 4, function() { callback(undefined, self); });
    }

    self.clearPaths = function(paths, callback) {
        if("function" !== typeof callback) callback = function() {}; // callback should always be a function

        utils.foreach(paths, function(path) {
            self.drawLine(path.p1, path.p2, blocks.air);
        }, undefined, 4, function() { callback(undefined, self); });
    }

    self.drawPoint = function(loc) {
        var color = loc.point % 16 == 0 ? 15 : loc.point % 16 - 1; // repeat colors

        __drone.box( blocks.wool[ __colors[color] ] );

        var block = self.player.world.getBlockAt( __drone.x, __drone.y, __drone.z );
        var state = block.getState();

        state.update();
    };

    self.clearPoint = function(loc) {
        __drone.box( blocks.air );

        var block = self.player.world.getBlockAt( __drone.x, __drone.y, __drone.z );
        var state = block.getState();

        state.update();
    };

    self.drawLine = function(point_1, point_2, block_type) {
        if ("undefined" === typeof block_type) {
            block_type = blocks.stained_glass[ 'white' ];
        }

        // determine direction on each axis
        var x_mod = point_1.x > point_2.x ? -1 : point_1.x < point_2.x ? 1 : 0;
        var y_mod = point_1.y > point_2.y ? -1 : point_1.y < point_2.y ? 1 : 0;
        var z_mod = point_1.z > point_2.z ? -1 : point_1.z < point_2.z ? 1 : 0;

        // determine distance on each axis
        var x_diff = Math.abs(point_1.x - point_2.x);
        var y_diff = Math.abs(point_1.y - point_2.y);
        var z_diff = Math.abs(point_1.z - point_2.z);

        // determine max distance of the three axis
        var max_diff = Math.max(x_diff, y_diff, z_diff);

        var points = [];

        for ( var i = 1; i < max_diff; i++) {
            var x = x_mod === 0 ? point_2.x : point_1.x + (i * x_mod);
            var y = y_mod === 0 ? point_2.y : point_1.y + (i * y_mod);
            var z = z_mod === 0 ? point_2.z : point_1.z + (i * z_mod);

            var point = {
                "x": x,
                "y": y,
                "z": z
            };

            points.push(point);

            // update modifiers each point so line corrects direction based on axis
            x_mod = x > point_2.x ? -1 : x < point_2.x ? 1 : 0;
            y_mod = y > point_2.y ? -1 : y < point_2.y ? 1 : 0;
            z_mod = z > point_2.z ? -1 : z < point_2.z ? 1 : 0;
        }

        // run through calculated points and draw them
        utils.foreach(points, function(point) {
            __drone.x = __start_location.x + point.x;
            __drone.y = __start_location.y + point.y;
            __drone.z = __start_location.z + point.z;

            self.drawLinePoint(block_type);
        }, undefined, 4);
    };

    self.drawLinePoint = function(block_type) {
        __drone.box( block_type );

        var block = self.player.world.getBlockAt( __drone.x, __drone.y, __drone.z );
        var state = block.getState();

        state.update();
    };

    self.getColors = function() { return __colors; };

    // call constructor
    _initialize();

    return self;
};

module.exports = TravelingSalesmanRenderer;


text:
package org.camunda.bpm.application.impl;

import java.util.Set;

import javax.naming.NamingException;
import javax.servlet.ServletException;

import org.camunda.bpm.application.AbstractProcessApplication;
import org.camunda.bpm.application.ProcessApplication;
import org.camunda.bpm.application.ProcessApplicationExecutionException;
import org.camunda.bpm.application.ProcessApplicationUnavailableException;
import org.camunda.bpm.engine.ProcessEngineException;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.DelegateTask;
import org.camunda.bpm.engine.impl.ProcessEngineLogger;
import org.camunda.bpm.engine.impl.application.ProcessApplicationManager;
import org.camunda.bpm.engine.impl.cmmn.entity.repository.CaseDefinitionEntity;
import org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity;
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity;

/**
 * @author Daniel Meyer
 *
 */
public class ProcessApplicationLogger extends ProcessEngineLogger {

  public void taskNotRelatedToExecution(DelegateTask delegateTask) {
    logDebug(
        "001",
        "Task {} not related to an execution, target process application cannot be determined.",
        delegateTask);
  }

  public ProcessEngineException exceptionWhileNotifyingPaTaskListener(Exception e) {
    return new ProcessEngineException(exceptionMessage(
        "002",
        "Exception while notifying process application task listener."), e);
  }

  public void noTargetProcessApplicationForExecution(DelegateExecution execution) {
    logDebug(
        "003",
        "No target process application found for execution {}",
        execution);
  }

  public void paDoesNotProvideExecutionListener(String paName) {
    logDebug(
        "004",
        "Target process application '{}' does not provide an ExecutionListener.",
        paName);
  }

  public void cannotInvokeListenerPaUnavailable(String paName, ProcessApplicationUnavailableException e) {
    logDebug("005",
        "Exception while invoking listener: target process application '{}' unavailable", paName, e);
  }

  public void paDoesNotProvideTaskListener(String paName) {
    logDebug(
        "006",
        "Target process application '{}' does not provide a TaskListener.",
        paName);
  }

  public void paElResolversDiscovered(String summary) {
    logDebug("007", summary);
  }

  public void noElResolverProvided(String paName, String string) {
    logWarn("008",
        "Process Application '{}': No ELResolver provided by ProcessApplicationElResolver {}",
        paName,
        string);

  }

  public ProcessApplicationExecutionException processApplicationExecutionException(Exception e) {
    return new ProcessApplicationExecutionException(e);
  }

  public ProcessEngineException ejbPaCannotLookupSelfReference(NamingException e) {
    return new ProcessEngineException(exceptionMessage(
        "009",
        "Cannot lookup self reference to EjbProcessApplication"), e);
  }

  public ProcessEngineException ejbPaCannotAutodetectName(NamingException e) {
    return new ProcessEngineException(exceptionMessage(
        "010",
        "Could not autodetect EjbProcessApplicationName"), e);
  }

  public ProcessApplicationUnavailableException processApplicationUnavailableException(String name, Throwable cause) {
    return new ProcessApplicationUnavailableException(exceptionMessage(
        "011",
        "Process Application '{}' unavailable", name), cause);
  }

  public ProcessApplicationUnavailableException processApplicationUnavailableException(String name) {
    return new ProcessApplicationUnavailableException(exceptionMessage(
        "011",
        "Process Application '{}' unavailable", name));
  }

  public void servletDeployerNoPaFound(String ctxName) {
    logDebug("012",
        "Listener invoked for context '{}' but no process application annotation detected.", ctxName);
  }

  public ServletException multiplePasException(Set<Class<?>> c, String appId) {

    StringBuilder builder = new StringBuilder();
    builder.append("An application must not contain more than one class annotated with @ProcessApplication.\n Application '");
    builder.append(appId);
    builder.append("' contains the following @ProcessApplication classes:\n");
    for (Class<?> clazz : c) {
      builder.append("  ");
      builder.append(clazz.getName());
      builder.append("\n");
    }
    String msg = builder.toString();

    return new ServletException(exceptionMessage("013", msg));
  }

  public ServletException paWrongTypeException(Class<?> paClass) {
    return new ServletException(exceptionMessage(
        "014",
        "Class '{}' is annotated with @{} but is not a subclass of {}",
        paClass, ProcessApplication.class.getName(), AbstractProcessApplication.class.getName()));
  }

  public void detectedPa(Class<?> paClass) {
    logInfo(
        "015",
        "Detected @ProcessApplication class '{}'",
        paClass.getName());
  }

  public void alreadyDeployed() {
    logWarn(
        "016",
        "Ignoring call of deploy() on process application that is already deployed.");
  }

  public void notDeployed() {
    logWarn(
        "017",
        "Calling undeploy() on process application that is not deployed.");
  }

  public void couldNotRemoveDefinitionsFromCache(Throwable t) {
    logError(
        "018",
        "Unregistering process application for deployment but could not remove process definitions from deployment cache.", t);
  }

  public ProcessEngineException exceptionWhileRegisteringDeploymentsWithJobExecutor(Exception e) {
    return new ProcessEngineException(exceptionMessage(
        "019",
        "Exception while registering deployment with job executor"), e);
  }

  public void exceptionWhileUnregisteringDeploymentsWithJobExecutor(Exception e) {
    logError(
        "020",
        "Exceptions while unregistering deployments with job executor", e);

  }

  public void registrationSummary(String string) {
    logInfo(
        "021",
        string);
  }

  public void exceptionWhileLoggingRegistrationSummary(Throwable e) {
    logError(
        "022",
        "Exception while logging registration summary",
        e);
  }

  public boolean isContextSwitchLoggable() {
    return isDebugEnabled();
  }

  public void debugNoTargetProcessApplicationFound(ExecutionEntity execution, ProcessApplicationManager processApplicationManager) {
    logDebug("023",
        "no target process application found for Execution[{}], ProcessDefinition[{}], Deployment[{}] Registrations[{}]",
            execution.getId(),
            execution.getProcessDefinitionId(),
            execution.getProcessDefinition().getDeploymentId(),
            processApplicationManager.getRegistrationSummary());
  }

  public void debugNoTargetProcessApplicationFoundForCaseExecution(CaseExecutionEntity execution, ProcessApplicationManager processApplicationManager) {
    logDebug("024",
        "no target process application found for CaseExecution[{}], CaseDefinition[{}], Deployment[{}] Registrations[{}]",
            execution.getId(),
            execution.getCaseDefinitionId(),
            ((CaseDefinitionEntity)execution.getCaseDefinition()).getDeploymentId(),
            processApplicationManager.getRegistrationSummary());
  }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $this->call(UserAndNotesSeeder::class);
    }
}


text:
from adminator.model import Model

__all__ = ['User']

class User(Model):
    def init(self):
        self.table_name = 'user'
        self.pkey = 'cn'
        self.include_relations = {'item': [], 'list': []}

# vim:set sw=4 ts=4 et:


text:
#ifndef SHELLVIEW_H
#define SHELLVIEW_H

#include <Messenger.h>
#include <TextView.h>
#include <ScrollView.h>
#include <String.h>

// Predefinitions
class ExecThread;

class ShellView : public BTextView {
public:
	// 'what' codes that are used internally by this class
	enum WhatCodes {
		SV_LAUNCH 	= 'svLA',
		SV_DATA	 	= 'svDA',
		SV_DONE	 	= 'svDO'
	};

					ShellView(const char* name, const BMessenger& messenger, uint32 what);
		void		MessageReceived(BMessage* msg);

		BScrollView*	ScrollView() { return fScrollView; }

		status_t	SetCommand(BString command);
		status_t	SetExecDir(BString execDir);
		status_t	Exec();
		status_t	Exec(BString command, BString execDir = ".");
		void 		Clear();

private:
		BString			fCommand;
		BString			fExecDir;

		ExecThread*		fExecThread;
		BScrollView*	fScrollView;

		BMessenger		fMessenger;
		uint32			fNotifyFinishedWhat;
};

#endif // SHELLVIEW_H


text:
module Usman
  class ApplicationController < Kuppayam::BaseController

    include Usman::AuthenticationHelper

    layout 'kuppayam/admin'

    before_action :current_user
    before_action :require_user

    helper_method :breadcrumb_home_path

    private

    def set_default_title
      set_title("Usman Admin | User Management Module")
    end

    def configure_filter_param_mapping
      @filter_param_mapping = default_filter_param_mapping
      @filter_param_mapping[:super_admin] = :sa
      @filter_param_mapping[:user] = :us
      @filter_param_mapping[:feature] = :ft
    end

    def breadcrumb_home_path
      usman.dashboard_path
    end

  end
end


text:
salt.states.rabbitmq_plugin
===========================

.. automodule:: salt.states.rabbitmq_plugin
    :members:


text:
<?php

declare(strict_types=1);

namespace Valkyrja\Auth\Constants;

/**
 * Constant RouteName.
 *
 * @author Melech Mizrachi
 */
final class RouteName
{
    public const AUTHENTICATE     = 'auth.authenticate';
    public const PASSWORD_CONFIRM = 'auth.password.confirm';
    public const PASSWORD_FORGOT  = 'auth.password.forgot';
    public const PASSWORD_REST    = 'auth.password.reset';
    public const REGISTER         = 'auth.register';
    public const DASHBOARD        = 'dashboard';
}


text:
class BaseSinceIdProvider(object):

    def __init__(self, *args, **kwargs):
        """
        Create an instance of provider
        :return: Instantiated provider
        """
        # Hook for future functionality
        pass

    def get(self):
        """
        Retrieve the value for since_id
        :return: The since_id previously stored, or empty string if none available
        """
        raise NotImplementedError("Child class must implement get(self)")

    def set(self, since_id):
        """
        Set the value for since_id
        :param since_id: The since_id value to be stored
        :return: Some truthy value if successful
        """
        raise NotImplementedError("Child class must implement set(self, since_id)")

    def delete(self):
        """
        Delete the saved value for since_id
        :return: Some truthy value if successful
        """
        raise NotImplementedError("Child class must implement delete(self)")

__all__ = ["BaseSinceIdProvider"]


text:
<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <script src="../../webcomponentsjs/webcomponents.js"></script>
    <script src="../../web-component-tester/browser.js"></script>
  </head>
  <body>
    <script>
      WCT.loadSuites([
        'polymer-unit-convert.html',
        'polymer-unit-convert-complex.html'
      ]);
    </script>
  </body>
</html>


text:
require 'turnpike/base'

module Turnpike
  class Queue < Base
    # Pop one or more items from the queue.
    #
    # n - Integer number of items to pop.
    #
    # Returns an item, an Array of items, or nil if the queue is empty.
    def pop(n = 1)
      items = n.times.reduce([]) { |ary, _|
        break ary unless item = redis.lpop(name)
        ary << unpack(item)
      }

      n == 1 ? items.first : items
    end

    # Pop one or more items from the queue and block if the queue is empty.
    #
    # n - Integer number of items to pop.
    #
    # Returns an item or an Array of items.
    def bpop(n = 1)
      items = n.times.map { unpack(redis.blpop(name).last) }
      n == 1 ? items.first : items
    end

    # Push items to the end of the queue.
    #
    # items - A splat Array of items.
    #
    # Returns nothing.
    def push(*items)
      redis.rpush(name, items.map { |i| pack(i) })
    end

    alias << push

    # Returns the Integer size of the queue.
    def size
      redis.llen(name)
    end

    # Push items to the front of the queue.
    #
    # items - A splat Array of items.
    #
    # Returns nothing.
    def unshift(*items)
      redis.lpush(name, items.map { |i| pack(i) })
    end
  end
end


text: DROP TRIGGER IF EXISTS `happy`.`insertRecord`


text:
package au.edu.uts.eng.remotelabs.schedserver.rigmanagement.intf.types;

import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;

import org.apache.axiom.om.OMConstants;
import org.apache.axiom.om.OMDataSource;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.impl.llom.OMSourcedElementImpl;
import org.apache.axis2.databinding.ADBBean;
import org.apache.axis2.databinding.ADBDataSource;
import org.apache.axis2.databinding.ADBException;
import org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter;

/**
 * PutRigOfflineResponse bean class.
 */
public class PutRigOfflineResponse implements ADBBean
{
    private static final long serialVersionUID = -8743903527781228810L;

    public static final QName MY_QNAME = new QName("http://remotelabs.eng.uts.edu.au/rigmanagement",
            "putRigOfflineResponse", "ns1");

    protected OperationResponseType putRigOfflineResponse;

    public OperationResponseType getPutRigOfflineResponse()
    {
        return this.putRigOfflineResponse;
    }

    public void setPutRigOfflineResponse(final OperationResponseType param)
    {
        this.putRigOfflineResponse = param;
    }

    public static boolean isReaderMTOMAware(final XMLStreamReader reader)
    {
        boolean isReaderMTOMAware = false;

        try
        {
            isReaderMTOMAware = Boolean.TRUE.equals(reader.getProperty(OMConstants.IS_DATA_HANDLERS_AWARE));
        }
        catch (final IllegalArgumentException e)
        {
            isReaderMTOMAware = false;
        }
        return isReaderMTOMAware;
    }

    public OMElement getOMElement(final QName parentQName, final OMFactory factory) throws ADBException
    {
        final OMDataSource dataSource = new ADBDataSource(this, PutRigOfflineResponse.MY_QNAME)
        {
            @Override
            public void serialize(final MTOMAwareXMLStreamWriter xmlWriter) throws XMLStreamException
            {
                PutRigOfflineResponse.this.serialize(PutRigOfflineResponse.MY_QNAME, factory, xmlWriter);
            }
        };
        return new OMSourcedElementImpl(PutRigOfflineResponse.MY_QNAME, factory, dataSource);
    }

    @Override
    public void serialize(final QName parentQName, final OMFactory factory, final MTOMAwareXMLStreamWriter xmlWriter)
            throws XMLStreamException, ADBException
    {
        this.serialize(parentQName, factory, xmlWriter, false);
    }

    @Override
    public void serialize(final QName parentQName, final OMFactory factory, final MTOMAwareXMLStreamWriter xmlWriter,
            final boolean serializeType) throws XMLStreamException, ADBException
    {
        if (this.putRigOfflineResponse == null)
        {
            throw new ADBException("Property cannot be null!");
        }
        this.putRigOfflineResponse.serialize(PutRigOfflineResponse.MY_QNAME, factory, xmlWriter);
    }

    @Override
    public XMLStreamReader getPullParser(final QName qName) throws ADBException
    {
        return this.putRigOfflineResponse.getPullParser(PutRigOfflineResponse.MY_QNAME);
    }

    public static class Factory
    {
        public static PutRigOfflineResponse parse(final XMLStreamReader reader) throws Exception
        {
            final PutRigOfflineResponse object = new PutRigOfflineResponse();
            try
            {
                while (!reader.isStartElement() && !reader.isEndElement())
                {
                    reader.next();
                }

                while (!reader.isEndElement())
                {
                    if (reader.isStartElement())
                    {
                        if (reader.isStartElement()
                                && new QName("http://remotelabs.eng.uts.edu.au/rigmanagement", "putRigOfflineResponse")
                                        .equals(reader.getName()))
                        {
                            object.setPutRigOfflineResponse(OperationResponseType.Factory.parse(reader));
                        }
                        else
                        {
                            throw new ADBException("Unexpected subelement " + reader.getLocalName());
                        }
                    }
                    else
                    {
                        reader.next();
                    }
                }
            }
            catch (final XMLStreamException e)
            {
                throw new Exception(e);
            }

            return object;
        }
    }
}


text:
/**
  * Created by salim on 10/02/2016.
  */

package configuration

import pureconfig._

import scala.util.{Failure, Success}

object ConfigDemo extends App {

  val config = loadConfig[Config] match {
    case Failure(f) => throw f
    case Success(conf) => conf
  }

  println("dirwatch.path: " + config.dirwatch.path)
  println("dirwatch.filter: " + config.dirwatch.filter)
  println("dirwatch.email.host: " + config.dirwatch.email.host)
  println("dirwatch.email.port: " + config.dirwatch.email.port)
  println("dirwatch.email.message: " + config.dirwatch.email.message)
  println("dirwatch.email.recipients: " + config.dirwatch.email.recipients)
  println("dirwatch.email.sender: " + config.dirwatch.email.sender)

  println("The loaded configuration is: " ++ config.toString)

}


text:
<?xml version="1.0" encoding="us-ascii"?>
<AssetDeclaration xmlns="uri:ea.com:eala:asset" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<Tags></Tags>
	<Includes>
		<Include
			type="all"
			source="ART:GUDropPod_DR03.w3x" />
		<Include
			type="instance"
			source="DATA:BaseObjects/BaseDebris.xml" />
	</Includes>
	<GameObject
		id="GDIDropPod_DR03"
		inheritFrom="BaseDebris"
		EditorName="GDIDropPod_DR03">
		<Draws>
			<ScriptedModelDraw
				id="ModuleTag_Draw"
				OkToChangeModelColor="true">
				<ModelConditionState
					ParseCondStateType="PARSE_DEFAULT">
					<Model
						Name="GUDropPod_DR03" />
					<ParticleSysBone
						BoneName="ROOTTRANSFORM"
						FXParticleSystemTemplate="DropPodSteam"
						FollowBone="true" />
					<ParticleSysBone
						BoneName="ROOTTRANSFORM"
						FXParticleSystemTemplate="DropPodSteam2"
						FollowBone="true" />
				</ModelConditionState>
			</ScriptedModelDraw>
		</Draws>
		<Behaviors>
			<Physics
				id="ModuleTag_Physics"
				TumbleRandomly="true"
				MaxXRotationVelocity="360"
				MaxYRotationVelocity="0"
				MaxZRotationVelocity="360"
				BounceCount="0"
				KillWhenRestingOnGround="true" />
<!--
			<FXListBehavior
				id="ModuleTag_FXList">
				<DieMuxData
					DeathTypes="ALL" />
				<Event
					Index="onCreate"
					FX="FX_GDIAirVehicleExplode" />
			</FXListBehavior>
-->
		</Behaviors>
	</GameObject>
</AssetDeclaration>


text:
public class Shakespeare {
  void quote() {
    String theQuote = "A fool thinks himself to be wise, <caret>but a wise man knows himself to be a fool.";
  }
}


text:
module Softlayer
  module Auxiliary
    module Notification
      class Emergency
        class Status < Softlayer::Entity
          attr_accessor :name

          class Representer < Softlayer::Entity::Representer
            include Representable::Hash
            include Representable::Coercion
            property :name, type: String
          end
        end
      end
    end
  end
end


text:
package align2;

import java.io.File;
import dna.AminoAcid;

/**
 * @author Jonathan Rood
 * @date Jul 18, 2014
 *
 */
public class BandedAlignerJNI extends BandedAligner{

        static {
                String name = "bbtoolsjni";
                try {
                        System.loadLibrary(name);
                } catch (UnsatisfiedLinkError e1) {
			// System.loadLibrary() does not work with MPI.
			// Need to use System.load() with an explicit full
			// path to the native library file for the MPI case.
                        boolean success = false;
                        String libpath=System.getProperty("java.library.path");
                        libpath = libpath.replace("-Djava.library.path=","");
                        String[] libpathEntries = libpath.split(File.pathSeparator);
                        for(int i = 0; i < libpathEntries.length; i++) {
                                if(success) break;
                                String lib = libpathEntries[i]+"/"+System.mapLibraryName(name);
                                try {
                                        System.load(lib);
                                        success = true;
                                } catch (UnsatisfiedLinkError e2) {
                                        success = false;
                                        if((i+1) >= libpathEntries.length) {
                                                System.err.println("Native library can not be found in java.library.path. ");
                                                System.exit(1);
                                        }
                                }
                        }
                }
        }

	private native int alignForwardJNI(byte[] query, byte[] ref, int qstart, int rstart, int maxEdits, boolean exact, int maxWidth, byte[] baseToNumber, int[] returnVals);

	private native int alignForwardRCJNI(byte[] query, byte[] ref, int qstart, int rstart, int maxEdits, boolean exact, int maxWidth, byte[] baseToNumber, byte[] baseToComplementExtended, int[] returnVals);

	private native int alignReverseJNI(byte[] query, byte[] ref, int qstart, int rstart, int maxEdits, boolean exact, int maxWidth, byte[] baseToNumber, int[] returnVals);

	private native int alignReverseRCJNI(byte[] query, byte[] ref, int qstart, int rstart, int maxEdits, boolean exact, int maxWidth, byte[] baseToNumber, byte[] baseToComplementExtended, int[] returnVals);

	public static void main(String[] args){
		byte[] query=args[0].getBytes();
		byte[] ref=args[1].getBytes();
		int qstart=-1;
		int rstart=-1;
		int maxedits=big;
		int width=5;
		if(args.length>2){qstart=Integer.parseInt(args[2]);}
		if(args.length>3){rstart=Integer.parseInt(args[3]);}
		if(args.length>4){maxedits=Integer.parseInt(args[4]);}
		if(args.length>4){width=Integer.parseInt(args[5]);}

		BandedAlignerJNI ba=new BandedAlignerJNI(width);

		int edits;

		edits=ba.alignForward(query, ref, (qstart==-1 ? 0 : qstart), (rstart==-1 ? 0 : rstart), maxedits, true);
		System.out.println("Forward:    \tedits="+edits+", lastRow="+ba.lastRow+", score="+ba.score());
		System.out.println("***********************\n");
//
//		edits=ba.alignForwardRC(query, ref, (qstart==-1 ? query.length-1 : qstart), (rstart==-1 ? 0 : rstart), maxedits, true);
//		System.out.println("ForwardRC:  \tedits="+edits+", lastRow="+ba.lastRow+", score="+ba.score());
//		System.out.println("***********************\n");

		edits=ba.alignReverse(query, ref, (qstart==-1 ? query.length-1 : qstart), (rstart==-1 ? ref.length-1 : rstart), maxedits, true);
		System.out.println("Reverse:    \tedits="+edits+", lastRow="+ba.lastRow+", score="+ba.score());
		System.out.println("***********************\n");

//		edits=ba.alignReverseRC(query, ref, (qstart==-1 ? 0 : qstart), (rstart==-1 ? ref.length-1 : rstart), maxedits, true);
//		System.out.println("ReverseRC:  \tedits="+edits+", lastRow="+ba.lastRow+", score="+ba.score());
//		System.out.println("***********************\n");
	}

	public BandedAlignerJNI(int width_){
		super(width_);
		assert(big>maxWidth/2);
	}

	/**
	 * @param query
	 * @param ref
	 * @param qstart
	 * @param rstart
	 * @return Edit distance
	 */
	public int alignForward(final byte[] query, final byte[] ref, final int qstart, final int rstart, final int maxEdits, final boolean exact){
		int[] returnVals = new int[5];
		returnVals[0] = lastQueryLoc;
		returnVals[1] = lastRefLoc;
		returnVals[2] = lastRow;
		returnVals[3] = lastEdits;
		returnVals[4] = lastOffset;
		int edits = alignForwardJNI(query,ref,qstart,rstart,maxEdits,exact,maxWidth,AminoAcid.baseToNumber,returnVals);
		lastQueryLoc = returnVals[0];
		lastRefLoc = returnVals[1];
		lastRow = returnVals[2];
		lastEdits = returnVals[3];
		lastOffset = returnVals[4];
		return edits;
	}

	/**
	 * @param query
	 * @param ref
	 * @param qstart
	 * @param rstart
	 * @return Edit distance
	 */
	public int alignForwardRC(final byte[] query, final byte[] ref, final int qstart, final int rstart, final int maxEdits, final boolean exact){
		int[] returnVals = new int[5];
		returnVals[0] = lastQueryLoc;
		returnVals[1] = lastRefLoc;
		returnVals[2] = lastRow;
		returnVals[3] = lastEdits;
		returnVals[4] = lastOffset;
		int edits = alignForwardRCJNI(query,ref,qstart,rstart,maxEdits,exact,maxWidth,AminoAcid.baseToNumber,AminoAcid.baseToComplementExtended,returnVals);
		lastQueryLoc = returnVals[0];
		lastRefLoc = returnVals[1];
		lastRow = returnVals[2];
		lastEdits = returnVals[3];
		lastOffset = returnVals[4];
		return edits;
	}

	/**
	 * @param query
	 * @param ref
	 * @param qstart
	 * @param rstart
	 * @return Edit distance
	 */
	public int alignReverse(final byte[] query, final byte[] ref, final int qstart, final int rstart, final int maxEdits, final boolean exact){
		int[] returnVals = new int[5];
		returnVals[0] = lastQueryLoc;
		returnVals[1] = lastRefLoc;
		returnVals[2] = lastRow;
		returnVals[3] = lastEdits;
		returnVals[4] = lastOffset;
		int edits = alignReverseJNI(query,ref,qstart,rstart,maxEdits,exact,maxWidth,AminoAcid.baseToNumber,returnVals);
		lastQueryLoc = returnVals[0];
		lastRefLoc = returnVals[1];
		lastRow = returnVals[2];
		lastEdits = returnVals[3];
		lastOffset = returnVals[4];
		return edits;
	}

	/**
	 * @param query
	 * @param ref
	 * @param qstart
	 * @param rstart
	 * @return Edit distance
	 */
	public int alignReverseRC(final byte[] query, final byte[] ref, final int qstart, final int rstart, final int maxEdits, final boolean exact){
		int[] returnVals = new int[5];
		returnVals[0] = lastQueryLoc;
		returnVals[1] = lastRefLoc;
		returnVals[2] = lastRow;
		returnVals[3] = lastEdits;
		returnVals[4] = lastOffset;
		int edits = alignReverseRCJNI(query,ref,qstart,rstart,maxEdits,exact,maxWidth,AminoAcid.baseToNumber,AminoAcid.baseToComplementExtended,returnVals);
		lastQueryLoc = returnVals[0];
		lastRefLoc = returnVals[1];
		lastRow = returnVals[2];
		lastEdits = returnVals[3];
		lastOffset = returnVals[4];
		return edits;
	}
}


text:
package com.sharpershape.scala.metrics

import scala.concurrent.duration.Duration

class NullMetricsSender extends MetricsSender {
  override def increment(metric: MetricName, n: Int): Unit = ()
  override def duration(metric: MetricName, duration: Duration): Unit = ()
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Tiny, opensource, Bootstrap WYSIWYG rich text editor from MindMup</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="keywords" content="opensource rich wysiwyg text editor jquery bootstrap execCommand html5" />
    <meta name="description" content="This tiny jQuery Bootstrap WYSIWYG plugin turns any DIV into a HTML5 rich text editor" />
    <link rel="apple-touch-icon" href="//mindmup.s3.amazonaws.com/lib/img/apple-touch-icon.png" />
    <link rel="shortcut icon" href="http://mindmup.s3.amazonaws.com/lib/img/favicon.ico" >
    <link href="external/google-code-prettify/prettify.css" rel="stylesheet">
    <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
    <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-responsive.min.css" rel="stylesheet">
		<link href="http://netdna.bootstrapcdn.com/font-awesome/3.0.2/css/font-awesome.css" rel="stylesheet">

		<link href="css/text-editor.css" rel="stylesheet">

bootstrap-wysiwyg
 tiny wysiwyg rich text editor for Bootstrap

Huge

Normal

Small

			    <input class="span2" placeholder="URL" type="text" data-edit="createLink"/>
			    <button class="btn" type="button">Add</button>

        <input type="file" data-role="magic-overlay" data-target="#pictureBtn" data-edit="insertImage" />

      <input type="text" data-edit="inserttext" id="voiceBtn" x-webkit-speech="">

      Go ahead…


text: #include <otbBinaryFunctorNeighborhoodVectorImageFilter.h>


text:
import * as lunr from 'lunr';

function basic_test() {
    const index = lunr(function() {
        this.field("title");
        this.field("body");
        this.field("content", {
            boost: 2,
            extractor: (doc: object) => "oof"
        });
        this.ref("id");
        this.add({
            id: 1,
            title: "Foo",
            body: "Foo foo foo!"
        },
        {
            boost: 2
        });
        this.add({
            id: 2,
            title: "Bar",
            body: "Bar bar bar!"
        });
    });

    index.search("foo");

    index.query(q => {
        q.term(
            lunr.tokenizer('search terms'),
            {
                wildcard: lunr.Query.wildcard.TRAILING,
                presence: lunr.Query.presence.REQUIRED
            }
        );
    });
}

function pipeline_test() {
    const index = lunr(function() {
        this.pipeline.add((token, tokenIndex, tokens) => {
            // text processing in here
            return token;
        });

        this.pipeline.after(lunr.stopWordFilter, (token, tokenIndex, tokens) => {
            // text processing in here
            return token;
        });
    });
}

function pipeline_function_test() {
    const stemmer: lunr.PipelineFunction = lunr.stemmer;
    const stopWordFilter: lunr.PipelineFunction = lunr.stopWordFilter;
    const trimmer: lunr.PipelineFunction = lunr.trimmer;
}


text:
class UsersController < ApplicationController
  before_action :set_user, only: %i[show edit update destroy]

  def index
    @users = User.all
  end

  def show; end

  def edit; end

  def update
    respond_to do |format|
      if @user.update(user_params)
        format.html { redirect_to @user, notice: "ユーザー #{@user.nickname}さん を更新しました。" }
        format.json { render :show, status: :ok, location: @user }
      else
        format.html { render :edit }
        format.json { render json: @user.errors, status: :unprocessable_entity }
      end
    end
  end

  def destroy
    @user.destroy
    respond_to do |format|
      format.html { redirect_to users_url, notice: "ユーザー #{@user.nickname}さん を削除しました。" }
      format.json { head :no_content }
    end
  end

  private

  def set_user
    @user = User.find(params[:id])
  end

  def user_params
    params.require(:user).permit(:nickname)
  end
end


text:
'use strict';

let express = require('express'),
   passport = require('passport'),
   Strategy = require('passport-local').Strategy,
         db = require('./db'),
         fs = require('fs'),
       http = require('http'),
      https = require('https'),
   nunjucks = require('nunjucks');

// Credentials are only needed in the production https environment
var privateKey, certificate, credentials;
if (process.argv[2] == 'local') {
    privateKey  = null;
    certificate = null;
    credentials = null;
} else {
    privateKey  = fs.readFileSync('/etc/letsencrypt/live/ogilvie.us.com/privkey.pem', 'utf8');
    certificate = fs.readFileSync('/etc/letsencrypt/live/ogilvie.us.com/cert.pem', 'utf8');
    credentials = {key: privateKey, cert: certificate};
}

// The server we're building and the TCP port it will listen on
var server;
let port = 4002;

// Configure the local strategy for use by Passport.
// input: credencials (username, passord), callback (cb)
//
// The verify function (db.users.findByUsername) verified that
// the given password is correct for the provided password.
// and invokes the provied callback with success or failure.
//
// User object is set to req.user after authentication.
passport.use(new Strategy(function(username, password, cb) {

        db.users.findByUsername(username, function(err, user) {

            if (err)
                return cb(err);

            if (!user)
                return cb(null, false);

            if (user.password != password)
                return cb(null, false);

            return cb(null, user);
        });
}));

/*
 *             PASSPORT AUTHENTICATED SESSION PERSISTENCE.
 */
passport.serializeUser(function(user, cb) {
    cb(null, user.id);
});

passport.deserializeUser(function(id, cb) {

    db.users.findById(id, function (err, user) {

        if (err)
            return cb(err);

        cb(null, user);
    });
});

/*
 *             E X P R E S S
 */
var app = express();

/*
 *             M I D D L E W A R E
 */

// Template Engine
nunjucks.configure('views', {
    autoescape: true,
    express: app
});

// Logging
app.use(require('morgan')('combined'));

// Cookies
app.use(require('cookie-parser')());

// http request parsing
app.use(require('body-parser').urlencoded({ extended: true }));

// http session handling
app.use(require('express-session')({ secret: 'keyboard cat', resave: false, saveUninitialized: false }));

// Authentication
app.use(passport.initialize());
app.use(passport.session());

// Static Files
app.use(express.static('lib'));    // CSS and JS Libraris

/*
 *            A P P L I C A T I O N  R O U T I N G
 */

app.get('/',  function(req, res) {
    res.render('home.njk', { user: req.user });
});

app.get('/login', function(req, res){
    res.render('login.njk');
});

app.post('/login',
  passport.authenticate('local', { failureRedirect: '/login' }),
  function(req, res) {
    res.redirect('/');
  });

app.get('/logout', function(req, res){
    req.logout();
    res.redirect('/');
 });

app.get('/profile', require('connect-ensure-login').ensureLoggedIn(),
  function(req, res){
    res.render('profile.njk', { user: req.user });
});

if (process.argv[2] === 'local') {
    server = http.createServer(app);
    console.log(`Running http on port: ${port}`);
}
else {
    server = https.createServer(credentials, app);
    console.log(`Running https on port: ${port}`);
}

server.listen(port);


text:
Filling nodata areas
********************

.. todo::

    fillnodata()


text:
<?php

namespace PeterVanDommelen\Parser\BacktrackingStreaming\Compiler;

use PeterVanDommelen\Parser\BacktrackingStreaming\BacktrackingStreamingCompilerInterface;
use PeterVanDommelen\Parser\Compiler\CompilerInterface;
use PeterVanDommelen\Parser\BacktrackingStreaming\Parser\EndOfStringParser;
use PeterVanDommelen\Parser\Expression\ExpressionInterface;
use PeterVanDommelen\Parser\Parser\ParserInterface;

class EndOfStringCompiler implements BacktrackingStreamingCompilerInterface
{
    public function compile(ExpressionInterface $expression)
    {
        return new EndOfStringParser();
    }

}


text:
layout: default
title: "Just a pug"
hide-in-nav: true
description: "Whatever you where looking for, this is better. For sure"
header-img: "img/pug.jpg"
---

<!-- Page Header -->
{% include intro-header.html type="page" %}

<script>
	document.body.classList.add('page-fullscreen');
</script>


text:
const { findBestMatch } = require( 'string-similarity' )

const $ = require( 'jquery' )

class Kinotracker {

    constructor() {
        this.properties = {
            addTag: false,
            tag: 'DVDRip',
            sort: 4,
            sortOrder: 2
        }

        this.el = $( 'h1[itemprop=name]' )

        this.links = require( './data/links' )
        this.template = require( './templates/kinotracker.pug' )
        this.markerTemplate = require( './templates/marker.pug' )
        this.bubbleTemplate = require( './templates/bubble.pug' )
        this.loadProperties( this.properties )
        this.highlightMarkers()
        this.bindEvents()
    }

    render( data ) {
        this.el.append( this.template( data ) )
    }

    bindEvents() {
        const template = this.bubbleTemplate
        const links = this.links

        document.addEventListener( "mouseup", () => {
            const needle = window.getSelection().toString()
            const selectedRange = window.getSelection().getRangeAt( 0 ).cloneRange()

            if ( selectedRange.endOffset - selectedRange.startOffset <= 3 ) return

            fetch( "https://www.kinopoisk.ru/search/handler-chromium-extensions?v=1&query=" + encodeURIComponent( needle ) )
                .then( res => res.json() )
                .then( data => {
                    const bestMatch = findBestMatch( needle, [ data.name, data.rus ] ).bestMatch

                    if ( bestMatch.rating < .5 ) return

                    const selectedRangeRect = selectedRange.getBoundingClientRect()

                    const $bubble = $( template( { data, links } ) )

                    const left = selectedRangeRect.right + window.scrollX + "px"
                    const top = selectedRangeRect.top + window.scrollY + "px"

                    $bubble[ 0 ].style.setProperty( "left", left, "important" )
                    $bubble[ 0 ].style.setProperty( "top", top, "important" )

                    $( document.body ).append( $bubble )

                    const onClickOutside = () =>
                        document.removeEventListener( "mousedown", onClickOutside )
                    setTimeout( () => $bubble.remove(), 1000 )

                    document.addEventListener( "mousedown", onClickOutside )
                } )
        } )
    }

    addLinks( dyn_url, options, filmname ) {
        this.linksData = {
            links: this.links,
            clue: dyn_url,
            options: options,
            marker: filmname
        }

        this.render( this.linksData )
    }

    loadProperties( options ) {
        if ( location.host !== 'www.kinopoisk.ru' ) return
        chrome.extension.sendRequest( options, this.getInfo )
    }

    getInfo( opt ) {
        const banned_chars = /"|«|»|\(ТВ\)|&|:|!|·|\(сериал\)/g

        const mov_orig_name = $( 'span[itemprop=alternativeHeadline]' ).text()
        const year = $( 'table.info tr:first-of-type a:first-of-type' ).text()
        const filmname = ( mov_orig_name || this.el.text() )
        const mov = filmname.replace( banned_chars, '' )
        const marker = [ this.el.text(), mov_orig_name ].join( "&" )
        const dyn_url = `?o=${ opt.Sort }&s=${ opt.SortOrder }&nm=${ mov } ${ year}`

        opt.Tag = ( opt.AddTag === "true" ) ? opt.Tag : ""

        this.addLinks( dyn_url, opt.Tag, marker )
    }

    highlightMarkers() {
        const markerTemplate = this.markerTemplate

        if ( !this.links[ location.hostname ] ) return

        const markers = location
            .hash
            .replace( "#marker=", "" )
            .split( "&" )

        const $scopeElements = $( this.links[ location.hostname ].link_selector )

        $scopeElements.each( () => {
            const $this = $( this )
            let html = $this.html()

            markers.forEach( element => {
                const regexp = new RegExp( element, "i" )
                const marker = markerTemplate( { data: { marker: element } } )

                html = html.replace( regexp, marker )
            } )
            $this.html( html )
        } )
    }
}

module.exports = new Kinotracker


text:
module TreeService
  class AnswerQuiz
    attr_reader :player_test

    def initialize(options)
      @answers = options.fetch(:answers)
      @player_test = options.fetch(:player_test)
    end

    def process!
      self
    end

    def result
      answers_result = @answers.map do |answer|
        correct_answer = correct_answer?(answer)
        {
          correct: !!correct_answer,
          content_id: answer["content_id"],
          question: Content.find(answer["content_id"]).title
        }
      end
      @player_test.answers = answers_result
      @player_test.save
      answers_result
    end

    private

    def correct_answer?(answer)
      question = player_test.questions.detect do |question|
        question["content_id"] == answer["content_id"]
      end
      answered = question["possible_answers"].detect do |possible_answer|
        possible_answer["id"] == answer["answer_id"]
      end
      answered && answered["correct"]
    end
  end
end


text:
/*
* cgeNativeLibrary.cpp
*
*  Created on: 2015-7-9
*      Author: Wang Yang
*        Mail: admin@wysaid.org
*/

#include <jni.h>
#include <android/bitmap.h>
#include <ctime>

#include "cgeNativeLibrary.h"
#include "cgeGlobal.h"
#include "cgeGLFunctions.h"
#include "cgeSharedGLContext.h"

#include "cgeFilters.h"

#include "cgeUtilFunctions.h"

using namespace CGE;

extern "C" {

/*
 * Class:     org_wysaid_nativePort_CGENativeLibrary
 * Method:    filterImage_MultipleEffects
 * Signature: (Landroid/graphics/Bitmap;Ljava/lang/String;)Landroid/graphics/Bitmap;
 */
JNIEXPORT jobject JNICALL Java_org_wysaid_nativePort_CGENativeLibrary_cgeFilterImage_1MultipleEffects
  (JNIEnv *env, jclass cls, jobject bmp, jstring config, jfloat intensity)
{
    CGETexLoadArg texLoadArg;
    texLoadArg.env = env;
    texLoadArg.cls = cls;

    AndroidBitmapInfo info;
    int w, h, ret;
    char* row;

    CGE_LOG_CODE(clock_t tm = clock();)

    if ((ret = AndroidBitmap_getInfo(env, bmp, &info)) < 0)
    {
        CGE_LOG_ERROR("AndroidBitmap_getInfo() failed ! error=%d", ret);
        return nullptr;
    }
    CGE_LOG_INFO("color image :: width is %d; height is %d; stride is %d; format is %d;flags is %d", info.width, info.height, info.stride, info.format, info.flags);
    if (info.format != ANDROID_BITMAP_FORMAT_RGBA_8888)
    {
        CGE_LOG_ERROR("Bitmap format is not RGBA_8888 !");
        return nullptr;
    }

    // get the basic information of the image
    w = info.width;
    h = info.height;

    jobject newBitmap;
    jclass bitmapCls = env->GetObjectClass(bmp);

    ret = AndroidBitmap_lockPixels(env, bmp, (void**) &row);
    if (ret < 0)
    {
        CGE_LOG_ERROR("AndroidBitmap_lockPixels() failed ! error=%d", ret);
        return nullptr;
    }

    CGESharedGLContext* glContext = CGESharedGLContext::create();
    if(glContext == nullptr)
    {
        CGE_LOG_ERROR("Create Context Failed!");
        return bmp;
    }

    glContext->makecurrent();

    {
        CGEImageHandler handler;
        handler.initWithRawBufferData(row, w, h, CGE_FORMAT_RGBA_INT8, false);
        AndroidBitmap_unlockPixels(env, bmp);

        CGEMutipleEffectFilter* filter = new CGEMutipleEffectFilter;

        filter->setTextureLoadFunction(cgeGlobalTextureLoadFunc, &texLoadArg);

        const char* strConfig = env->GetStringUTFChars(config, 0);
        filter->initWithEffectString(strConfig);
        env->ReleaseStringUTFChars(config, strConfig);

        filter->setIntensity(intensity);

        handler.addImageFilter(filter);
        handler.processingFilters();

        jmethodID createBitmapFunction = env->GetStaticMethodID(bitmapCls, "createBitmap", "(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;");
        jstring configName = env->NewStringUTF("ARGB_8888");
        jclass bitmapConfigClass = env->FindClass("android/graphics/Bitmap$Config");
        jmethodID valueOfBitmapConfigFunction = env->GetStaticMethodID(bitmapConfigClass, "valueOf", "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;");
        jobject bitmapConfig = env->CallStaticObjectMethod(bitmapConfigClass, valueOfBitmapConfigFunction, configName);
        env->DeleteLocalRef(configName);
        newBitmap = env->CallStaticObjectMethod(bitmapCls, createBitmapFunction, info.width, info.height, bitmapConfig);

        ret = AndroidBitmap_lockPixels(env, newBitmap, (void**) &row);
        if (ret < 0)
        {
            CGE_LOG_ERROR("AndroidBitmap_lockPixels() failed ! error=%d", ret);
            // AndroidBitmap_unlockPixels(env, bmp);
            return nullptr;
        }

        handler.getOutputBufferData(row, CGE_FORMAT_RGBA_INT8);
        AndroidBitmap_unlockPixels(env, newBitmap);
    }

    CGE_LOG_INFO("unlocked pixels, function totalTime: %g s", (clock() - tm) / (float)CLOCKS_PER_SEC);

    delete glContext;
    return newBitmap;
}

/*
 * Class:     org_wysaid_nativePort_CGENativeLibrary
 * Method:    filterImage_MultipleEffectsWriteBack
 * Signature: (Landroid/graphics/Bitmap;Ljava/lang/String;)V
 */
JNIEXPORT void JNICALL Java_org_wysaid_nativePort_CGENativeLibrary_cgeFilterImage_1MultipleEffectsWriteBack
  (JNIEnv *env, jclass cls, jobject bmp, jstring config, jfloat intensity)
{
    CGETexLoadArg texLoadArg;
    texLoadArg.env = env;
    texLoadArg.cls = cls;

    AndroidBitmapInfo info;
    int w, h, ret;
    char* row;

    CGE_LOG_CODE(clock_t tm = clock();)

    if ((ret = AndroidBitmap_getInfo(env, bmp, &info)) < 0) {
        CGE_LOG_ERROR("AndroidBitmap_getInfo() failed ! error=%d", ret);
        return;
    }
    CGE_LOG_INFO("color image :: width is %d; height is %d; stride is %d; format is %d;flags is %d", info.width, info.height, info.stride, info.format, info.flags);
    if (info.format != ANDROID_BITMAP_FORMAT_RGBA_8888) {
        CGE_LOG_ERROR("Bitmap format is not RGBA_8888 !");
        return;
    }
    // get the basic information of the image
    w = info.width;
    h = info.height;

    ret = AndroidBitmap_lockPixels(env, bmp, (void**) &row);

    if (ret < 0)
    {
        CGE_LOG_ERROR("AndroidBitmap_lockPixels() failed ! error=%d", ret);
        return;
    }

    CGESharedGLContext* glContext = CGESharedGLContext::create();

    if(glContext == nullptr)
    {
        CGE_LOG_ERROR("Create Context Failed!");
        return ;
    }

    glContext->makecurrent();

    {
        CGEImageHandler handler;
        handler.initWithRawBufferData(row, w, h, CGE_FORMAT_RGBA_INT8, false);

        CGEMutipleEffectFilter* filter = new CGEMutipleEffectFilter;

        filter->setTextureLoadFunction(cgeGlobalTextureLoadFunc, &texLoadArg);

        const char* strConfig = env->GetStringUTFChars(config, 0);
        filter->initWithEffectString(strConfig);
        env->ReleaseStringUTFChars(config, strConfig);

        filter->setIntensity(intensity);

        handler.addImageFilter(filter);
        handler.processingFilters();

        CGE_LOG_INFO("Reading results....");
        handler.getOutputBufferData(row, CGE_FORMAT_RGBA_INT8);
        CGE_LOG_INFO("Reading results OK....");
        CGE_LOG_INFO("unlocking pixels....");
        AndroidBitmap_unlockPixels(env, bmp);
        CGE_LOG_INFO("unlocked pixels, function totalTime: %g s", (clock() - tm) / (float)CLOCKS_PER_SEC);
    }

    delete glContext;

}

JNIEXPORT jlong JNICALL Java_org_wysaid_nativePort_CGENativeLibrary_cgeCreateFilterWithConfig
  (JNIEnv *env, jclass, jstring config)
{
    CGETexLoadArg texLoadArg;
    texLoadArg.env = env;
    texLoadArg.cls = env->FindClass("org/wysaid/nativePort/CGENativeLibrary");

    const char* configStr = env->GetStringUTFChars(config, 0);

    CGEMutipleEffectFilter* filter = new CGEMutipleEffectFilter;
    filter->setTextureLoadFunction(cgeGlobalTextureLoadFunc, &texLoadArg);

    if(!filter->initWithEffectString(configStr))
    {
        delete filter;
        filter = nullptr;
    }

    env->ReleaseStringUTFChars(config, configStr);

    return (jlong)filter;
}

JNIEXPORT void JNICALL Java_org_wysaid_nativePort_CGENativeLibrary_cgeDeleteFilterWithAddress
  (JNIEnv *env, jclass, jlong addr)
{
    delete (CGEImageFilterInterfaceAbstract*)addr;
}

// filterType: normal, keep_ratio, tile

JNIEXPORT jlong JNICALL Java_org_wysaid_nativePort_CGENativeLibrary_cgeCreateBlendFilter
  (JNIEnv *env, jclass, jint blendMode, jint texID, jint texWidth, jint texHeight, jint filterType, jfloat intensity)
{
    CGEBlendWithResourceFilter* filter = nullptr;

    switch(filterType)
    {
    case 0:
        filter = new CGEBlendWithResourceFilter();
        CGE_LOG_INFO("Creating normal blend filter...");
        break;
    case 1:
        filter = new CGEBlendKeepRatioFilter();
        CGE_LOG_INFO("Creating keep-ratio blend filter...");
        break;
    case 2:
        filter = new CGEBlendTileFilter();
        CGE_LOG_INFO("Creating tile blend filter...");
        break;
    default:
        CGE_LOG_ERROR("Invalid filter type!\n");
        return 0;
    }

    if(filter->initWithMode((CGETextureBlendMode)blendMode))
    {
        filter->setSamplerID(texID);
        filter->setTexSize(texWidth, texHeight);
        filter->setIntensity(intensity);
    }
    else
    {
        delete filter;
        filter = nullptr;
    }

    return (jlong)filter;
}

}


text:
require 'sslyze/xml/plugin'
require 'sslyze/xml/types'

module SSLyze
  class XML
    class Reneg < Plugin
      #
      # Represents the `<sessionRenegotiation>` XML element.
      #
      # @since 1.0.0
      #
      class SessionRenegotiation

        include Types

        #
        # Initializes the {SessionRenegotiation} object.
        #
        # @param [Nokogiri::XML::Element] node
        #   The `<sessionRenegotiation>` XML element.
        #
        def initialize(node)
          @node = node
        end

        #
        # Returns the `canBeClientInitiated` attribute.
        #
        # @return [Boolean]
        #
        def can_be_client_initiated?
          Boolean[@node['canBeClientInitiated']]
        end

        alias client_initiated? can_be_client_initiated?

        #
        # Returns the `isSecure` attribute.
        #
        # @return [Boolean]
        #
        def is_secure?
          Boolean[@node['isSecure']]
        end

        alias secure? is_secure?

      end
    end
  end
end


text:
Generate fixtures from JSON schemas

[![Build Status](https://secure.travis-ci.org/winton/json_schema_spec.png)](http://travis-ci.org/winton/json_schema_spec)

###Goals

* Generate webmock requests and responses from JSON schema
* Easily alter parameters for testing
* Automatically validate altered parameters against schema
* Rake helpers for client code to download JSON schema

###Requirements

You serve a `schema.json` file at the root of a URL that describes your resources.

####Example schema.json

    {
        "user.json": {
            "get": {
                "request": {
                    "title": "GET user.json (request)",
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                        "id":    { "type": "integer" },
                        "token": { "type": "string" }
                    }
                },
                "response": {
                    "title": "GET user.json (response)",
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                        "id":     { "type": "integer" },
                        "avatar": { "type": "string", "optional": true },
                        "name":   { "type": "string" }
                    }
                }
            }
        }
    }

###Install

    gem install json_schema_spec

###Require

In your `spec_helper`:

    require "json_schema_spec"

###Client side project setup

In your `Rakefile`:

    require "json_schema_spec"
    JsonSchemaSpec::Tasks.new("http://127.0.0.1:3000/schema.json")

####Download schema

Download `schema.json` from the URL specified in your `Rakefile`:

    rake spec:schema

The schema lives at `schema/fixtures/schema.yml`.

###Server side project setup

In Rails, your schema is automatically detected at `/schema.json`.

###Generate test parameters

    request, response = json_schema_params(:user, :get)

The `request` hash looks like this:

    { :id => 123, :token => "token" }

The `response` hash looks like this:

    { :avatar => "avatar", :name => "name" }

**Integer** values are given the value 123.

**String** values are given the same name as the key.

**Optional** parameters are not included.

###Modify test parameters

    request, response = json_schema_params(:user, :get, :request => { :id => 1 })

The `request` hash now looks like this:

    { :id => 1, :token => "token" }

Modified parameters are validated against your schema using [json-schema](https://github.com/hoxworth/json-schema).

###Webmock example

    request, response = json_schema_params(:user, :get)

    request  = params[:request]
    response = params[:response]

    stub_request(:get, "http://127.0.0.1:3000/user.json").
      with(:body => request).
      to_return(:body => response.to_json)

### Contribute

[Create an issue](https://github.com/winton/json_schema_spec/issues/new) to discuss template changes.

Pull requests for template changes and new branches are even better.

### Stay up to date

[Star this project](https://github.com/winton/json_schema_spec#) on Github.

[Follow Winton Welsh](http://twitter.com/intent/user?screen_name=wintonius) on Twitter.


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 334955 $ -->
<phpdoc:classref xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="class.OCI-Lob" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
 <title>The OCI-Lob class</title>
 <titleabbrev>OCI-Lob</titleabbrev>

 <partintro>

<!-- {{{ ClassName intro -->
  <section xml:id="OCI-Lob.intro">
   &reftitle.intro;
   <para>
    OCI8 LOB functionality for large binary (BLOB) and character (CLOB) objects.
   </para>
  </section>
<!-- }}} -->

  <section xml:id="OCI-Lob.synopsis">
   &reftitle.classsynopsis;

<!-- {{{ Synopsis -->
   <classsynopsis>
    <ooclass><classname>OCI-Lob</classname></ooclass>

<!-- {{{ Class synopsis -->
    <classsynopsisinfo>
     <ooclass>
      <classname>OCI-Lob</classname>
     </ooclass>
    </classsynopsisinfo>
<!-- }}} -->

    <classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.OCI-Lob')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='oop'])" />
   </classsynopsis>
<!-- }}} -->

  </section>

 </partintro>

 &reference.oci8.entities.OCI-Lob;

</phpdoc:classref>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->


text:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.cardview.widget.CardView
        android:id="@+id/hewitts"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="8dp"
        android:layout_marginStart="16dp"
        android:layout_marginTop="16dp"
        android:clickable="true"
        android:focusable="true"
        android:foreground="?attr/selectableItemBackground"
        app:layout_constraintBottom_toTopOf="@+id/guideline4"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toLeftOf="@+id/centre_vertical_line"
        app:layout_constraintTop_toTopOf="@+id/one_quarter_horizontal">

        <ImageView
            android:id="@+id/hewitts_image"
            style="@style/menu_grid_imageview"
            android:layout_gravity="top|center_vertical"
            android:scaleType="centerCrop"
            android:src="@drawable/snowdon"></ImageView>

        <TextView

            style="@style/cardview_title"
            android:text="Hewitts" />
    </androidx.cardview.widget.CardView>

    <androidx.cardview.widget.CardView
        android:id="@+id/nuttalls"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="16dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="16dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="16dp"
        android:clickable="true"
        android:focusable="true"
        android:foreground="?attr/selectableItemBackground"
        app:layout_constraintBottom_toTopOf="@+id/guideline4"

        app:layout_constraintLeft_toLeftOf="@+id/centre_vertical_line"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="@+id/one_quarter_horizontal">

        <ImageView
            android:id="@+id/nuttalls_image"
            style="@style/menu_grid_imageview"
            android:layout_gravity="top|center_vertical"
            android:src="@drawable/glyder_fawr"></ImageView>

        <TextView

            style="@style/cardview_title"
            android:text="Nuttalls" />

    </androidx.cardview.widget.CardView>

    <androidx.cardview.widget.CardView
        android:id="@+id/marilyns"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="16dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="16dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:background="@drawable/button_text"
        android:clickable="true"
        android:focusable="true"
        android:foreground="?attr/selectableItemBackground"
        app:layout_constraintBottom_toTopOf="@+id/centre_horizontal"
        app:layout_constraintHorizontal_bias="0.47"
        app:layout_constraintLeft_toLeftOf="@+id/centre_vertical_line"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="@+id/guideline4">

        <ImageView
            android:id="@+id/marilyns_image"
            style="@style/menu_grid_imageview"
            android:src="@drawable/high_stile"></ImageView>

        <TextView

            style="@style/cardview_title"
            android:text="@string/label_marilyns" />

    </androidx.cardview.widget.CardView>

    <androidx.cardview.widget.CardView
        android:id="@+id/county_tops"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="8dp"
        android:layout_marginStart="16dp"
        android:layout_marginTop="8dp"
        android:background="@drawable/button_text"
        android:clickable="true"
        android:focusable="true"
        android:foreground="?attr/selectableItemBackground"
        app:layout_constraintBottom_toTopOf="@+id/centre_horizontal"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toLeftOf="@+id/centre_vertical_line"
        app:layout_constraintTop_toTopOf="@+id/guideline4">

        <ImageView
            android:id="@+id/wainrights_image"
            style="@style/menu_grid_imageview"
            android:src="@drawable/goatfell"></ImageView>

        <TextView

            style="@style/cardview_title"
            android:text="@string/label_county_tops" />

    </androidx.cardview.widget.CardView>

    <androidx.cardview.widget.CardView
        android:id="@+id/deweys"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="8dp"
        android:layout_marginStart="16dp"
        android:layout_marginTop="8dp"
        android:clickable="true"
        android:focusable="true"
        android:foreground="?attr/selectableItemBackground"
        app:layout_constraintBottom_toBottomOf="@+id/three_quarter_horizontal"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toLeftOf="@+id/centre_vertical_line"
        app:layout_constraintTop_toTopOf="@+id/centre_horizontal">

        <ImageView

            android:id="@+id/wainright_outlying_fells_image"
            style="@style/menu_grid_imageview"
            android:src="@drawable/high_seat"></ImageView>

        <TextView
            style="@style/cardview_title"
            android:text="@string/label_deweys" />

    </androidx.cardview.widget.CardView>

    <androidx.cardview.widget.CardView
        android:id="@+id/iomni"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginBottom="8dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="16dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:clickable="true"
        android:focusable="true"
        android:foreground="?attr/selectableItemBackground"
        app:layout_constraintBottom_toBottomOf="@+id/three_quarter_horizontal"
        app:layout_constraintLeft_toLeftOf="@+id/centre_vertical_line"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="@+id/centre_horizontal">

        <ImageView

            android:id="@+id/english_hills_image"
            style="@style/menu_grid_imageview"
            android:src="@drawable/northern_ireland_map"></ImageView>

        <TextView
            style="@style/cardview_title"
            android:text="@string/label_iomni" />

    </androidx.cardview.widget.CardView>

    <androidx.cardview.widget.CardView
        android:id="@+id/t100"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginBottom="16dp"
        android:layout_marginEnd="16dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="16dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:clickable="true"
        android:focusable="true"
        android:foreground="?attr/selectableItemBackground"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="@+id/left_vertical_line"
        app:layout_constraintRight_toRightOf="@+id/right_vertical_line"
        app:layout_constraintTop_toTopOf="@+id/three_quarter_horizontal">

        <ImageView

            android:id="@+id/t100_image"
            style="@style/menu_grid_imageview"
            android:src="@drawable/bidean_nam_bian"></ImageView>

        <TextView
            style="@style/cardview_title"
            android:text="@string/label_trail100" />

    </androidx.cardview.widget.CardView>

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/centre_vertical_line"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintGuide_percent="0.5"
        tools:layout_editor_absoluteX="206dp"
        tools:layout_editor_absoluteY="0dp" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/left_vertical_line"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintGuide_percent="0.25" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/right_vertical_line"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintGuide_percent="0.75" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/centre_horizontal"
        android:layout_width="411dp"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:layout_constraintGuide_percent="0.5"
        tools:layout_editor_absoluteX="0dp"
        tools:layout_editor_absoluteY="302dp" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/guideline4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:layout_constraintGuide_percent="0.25"
        tools:layout_editor_absoluteX="0dp"
        tools:layout_editor_absoluteY="151dp" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/three_quarter_horizontal"
        android:layout_width="411dp"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:layout_constraintGuide_percent="0.75"
        tools:layout_editor_absoluteX="0dp"
        tools:layout_editor_absoluteY="452dp" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/one_quarter_horizontal"
        android:layout_width="411dp"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:layout_constraintGuide_percent="0.0"
        tools:layout_editor_absoluteX="0dp"
        tools:layout_editor_absoluteY="452dp" />

</androidx.constraintlayout.widget.ConstraintLayout>


text:
package main

import (
	"flag"
	"fmt"
	"log"
	"strings"

	irc "github.com/fluffle/goirc/client"
	"gopkg.in/jcelliott/turnpike.v2"
)

var (
	ircAddr, wampAddr string
	ircPass           string
	channel           string
	wampRealm         string
	nick              string
)

func init() {
	flag.StringVar(&ircAddr, "ircaddr", "localhost:6667", "address of IRC server")
	flag.StringVar(&wampAddr, "wampaddr", "localhost:8000", "address of WAMP server")
	flag.StringVar(&wampRealm, "wamprealm", "turnpike.examples", "IRC realm to connect to")
	flag.StringVar(&nick, "nick", "nick", "nickname of the irc bot")
	flag.StringVar(&ircPass, "pass", "", "password to use when connecting to the irc server")
	flag.StringVar(&channel, "channel", "#channel", "irc channel to connect to")
	flag.Parse()
}

type client struct {
	quit chan bool
	tp   *turnpike.Client
	conn *irc.Conn
}

func New() (*client, error) {
	tp, err := turnpike.NewWebsocketClient(turnpike.JSON, "ws://"+wampAddr)
	if err != nil {
		return nil, err
	} else if _, err = tp.JoinRealm("turnpike.examples", turnpike.ALLROLES, nil); err != nil {
		return nil, err
	}

	return &client{quit: make(chan bool), tp: tp}, nil
}

func (c *client) handleWampMsg(args []interface{}, kwargs map[string]interface{}) {
	if len(args) == 2 {
		if from, ok := args[0].(string); !ok {
			log.Println("First argument not a string:", args[0])
		} else if msg, ok := args[1].(string); !ok {
			log.Println("Second argument not a string:", args[1])
		} else {
			log.Printf("%s: %s", from, msg)
			c.conn.Privmsg(channel, from+" -> "+msg)
		}
	}
}

func (c *client) handleIrcMsg(conn *irc.Conn, line *irc.Line) {
	c.tp.Publish("chat", []interface{}{line.Nick, strings.Join(line.Args, " ")}, nil)
}

func (c *client) connected(conn *irc.Conn, line *irc.Line) {
	fmt.Println("Joining channel")
	c.tp.Subscribe("chat", c.handleWampMsg)

	c.conn = conn

	conn.Join(channel)
	conn.Privmsg(channel, "I'm a hippopotamus!")
}

func (c *client) disconnected(conn *irc.Conn, line *irc.Line) {
	c.quit <- true
}

func (c *client) run() {
	<-c.quit
}

func main() {
	// Creating a simple IRC client is simple.
	cl, err := New()
	if err != nil {
		log.Fatalln("Error connecting to WAMP:", err)
	}
	c := irc.SimpleClient(nick)

	// Add handlers to do things here!
	// e.g. join a channel on connect.
	c.HandleFunc("connected", cl.connected)
	// And a signal on disconnect
	c.HandleFunc("disconnected", cl.disconnected)
	c.HandleFunc("privmsg", cl.handleIrcMsg)

	if err := c.ConnectTo(ircAddr, ircPass); err != nil {
		log.Fatalln("Connection error:", err)
	}

	cl.run()
}


text:
<!--
  Copyright 2014 Google Inc. All rights reserved.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->

<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:iosched="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <com.saarang.samples.apps.iosched.ui.widget.MessageCardView
        android:id="@+id/message_card"
        android:layout_width="match_parent"
        android:layout_marginTop="8dp"
        android:layout_marginBottom="8dp"
        android:layout_marginLeft="4dp"
        android:layout_marginRight="4dp"
        android:layout_height="wrap_content"
        android:clickable="true"
        android:focusable="true"
        iosched:messageTitle="@string/experts_directory_header_title"
        iosched:messageText="@string/experts_directory_header_body"
        iosched:button1text="@string/experts_directory_header_dismiss"
        iosched:button1emphasis="true"
        iosched:cardBackgroundColor="#fff" />
</FrameLayout>


text:
package com.hazelcast.jet.sql.impl.connector.infoschema;

import com.hazelcast.jet.Traverser;
import com.hazelcast.jet.Traversers;
import com.hazelcast.jet.core.AbstractProcessor;
import com.hazelcast.jet.core.DAG;
import com.hazelcast.jet.core.ProcessorSupplier;
import com.hazelcast.jet.core.Vertex;
import com.hazelcast.jet.sql.impl.connector.SqlConnector;
import com.hazelcast.jet.sql.impl.ExpressionUtil;
import com.hazelcast.jet.sql.impl.schema.MappingField;
import com.hazelcast.spi.impl.NodeEngine;
import com.hazelcast.sql.impl.expression.Expression;
import com.hazelcast.sql.impl.schema.Table;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;
import java.util.Map;

import static com.hazelcast.jet.core.ProcessorMetaSupplier.forceTotalParallelismOne;

/**
 * A connector for tables in the {@code information_schema}.
 */
final class InfoSchemaConnector implements SqlConnector {

    public static final InfoSchemaConnector INSTANCE = new InfoSchemaConnector();

    private static final String TYPE_NAME = "InformationSchema";

    private InfoSchemaConnector() {
    }

    @Override
    public String typeName() {
        return TYPE_NAME;
    }

    @Override
    public boolean isStream() {
        return false;
    }

    @Nonnull
    @Override
    public List<MappingField> resolveAndValidateFields(
            @Nonnull NodeEngine nodeEngine,
            @Nonnull Map<String, String> options,
            @Nonnull List<MappingField> userFields
    ) {
        throw new UnsupportedOperationException();
    }

    @Nonnull
    @Override
    public Table createTable(
            @Nonnull NodeEngine nodeEngine,
            @Nonnull String schemaName,
            @Nonnull String tableName,
            @Nonnull Map<String, String> options,
            @Nonnull List<MappingField> resolvedFields
    ) {
        throw new UnsupportedOperationException();
    }

    @Override
    public boolean supportsFullScanReader() {
        return true;
    }

    @Nonnull
    @Override
    public Vertex fullScanReader(
            @Nonnull DAG dag,
            @Nonnull Table table0,
            @Nullable Expression<Boolean> predicate,
            @Nonnull List<Expression<?>> projection
    ) {
        InfoSchemaTable table = (InfoSchemaTable) table0;

        List<Object[]> rows = ExpressionUtil.evaluate(predicate, projection, table.rows());

        return dag.newVertex(
                table.toString(),
                forceTotalParallelismOne(ProcessorSupplier.of(() -> new StaticSourceP(rows)))
        );
    }

    private static final class StaticSourceP extends AbstractProcessor {

        private final List<Object[]> rows;

        private Traverser<Object[]> traverser;

        private StaticSourceP(List<Object[]> rows) {
            this.rows = rows;
        }

        @Override
        protected void init(@Nonnull Context context) {
            traverser = Traversers.traverseIterable(rows);
        }

        @Override
        public boolean complete() {
            return emitFromTraverser(traverser);
        }
    }
}