text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta name="description" content="Landing page template with backend ready to use for launching new startup ideas.">
    <meta name="author" content="Filipe Oliveira <contato@fmoliveira.com.br>">
    <link rel="icon" href="favicon.ico">

    <title>Splash</title>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

    <link href="css/cover.css" rel="stylesheet">

Splash

Home

Features

Contact

Welcome to Splash.

Splash is a minimalistic landing page featuring a template from Bootstrap examples with a working backend based in Node.js and MongoDB. Use it for quickly launching new startup ideas.

                        Learn more

Splash by @fmoliveira.


text:
// cassandra-sharp - high performance .NET driver for Apache Cassandra
// Copyright (c) 2011-2013 Pierre Chalamet
//
// 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.

namespace CassandraSharp.CQLOrdinal
{
    using CassandraSharp.CQLBinaryProtocol;
    using CassandraSharp.Extensibility;
    using System.Collections.Generic;
    using System.Linq;

    internal sealed class OrdinalDataMapper : IDataMapper
    {
        public IEnumerable<IColumnData> MapToColumns(object dataSource, IEnumerable<IColumnSpec> columns)
        {
            object[] data = (object[])dataSource;

            foreach (var column in columns)
            {
                var value = data[column.Index];

                byte[] rawData = null;
                if (value != null)
                {
                    rawData = column.Serialize(value);
                }

                yield return new ColumnData(column, rawData);
            }
        }

        public object MapToObject(IEnumerable<IColumnData> rowData)
        {
            var rows = rowData.ToList();

            var instance = new object[rows.Count];
            foreach (var column in rows.OrderBy(x => x.ColumnSpec.Index))
            {
                var data = column.RawData != null ?
                    column.ColumnSpec.Deserialize(column.RawData) :
                    null;

                instance[column.ColumnSpec.Index] = data;
            }

            return instance;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

class Ess_M2ePro_Model_Resource_Template_Synchronization
    extends Ess_M2ePro_Model_Resource_Component_Parent_Abstract
{
    //########################################

    public function _construct()
    {
        $this->_init('M2ePro/Template_Synchronization', 'id');
    }

    //########################################
}


text:
 (function () {
 		var dragged,
		dragDom,
		donDrag,
		dragEl,

		R_SPACE = /\s+/g,
		R_FLOAT = /left|right|inline/;
	var _on = function(ele, event, fn){
		ele.addEventListener(event, fn, false);
	};

	var _dragStart = function(dragged){
		addClass(dragged, "sortable-ghost")
	};
	var _animate =  function (prevRect, target) {
			var ms =150;

			if (ms) {
				var currentRect = target.getBoundingClientRect();

				if (prevRect.nodeType === 1) {
					prevRect = prevRect.getBoundingClientRect();
				}

				_css(target, 'transition', 'none');
				_css(target, 'transform', 'translate3d('
					+ (prevRect.left - currentRect.left) + 'px,'
					+ (prevRect.top - currentRect.top) + 'px,0)'
				);

				target.offsetWidth; // repaint

				_css(target, 'transition', 'all ' + ms + 'ms');
				_css(target, 'transform', 'translate3d(0,0,0)');

				clearTimeout(target.animated);
				target.animated = setTimeout(function () {
					_css(target, 'transition', '');
					_css(target, 'transform', '');
					target.animated = false;
				}, ms);
			}
		};
	var _css = function (el, prop, val) {
		var style = el && el.style;

		if (style) {
			if (val === void 0) {
				if (document.defaultView && document.defaultView.getComputedStyle) {
					val = document.defaultView.getComputedStyle(el, '');
				}
				else if (el.currentStyle) {
					val = el.currentStyle;
				}

				return prop === void 0 ? val : val[prop];
			}
			else {
				if (!(prop in style)) {
					prop = '-webkit-' + prop;
				}
				style[prop] = val + (typeof val === 'string' ? '' : 'px');
			}
		}
	};
	function hasClass(ele, cls) {
    return ele.className.match(new RegExp("(\\s|^)" + cls + "(\\s|$)"));
}

function removeClass(ele, cls) {
    if (hasClass(ele, cls)) {
        var reg = new RegExp("(\\s|^)" + cls + "(\\s|$)");
        ele.className = ele.className.replace(reg, " ");
    }
}
function addClass(ele, cls) {
    	if (!this.hasClass(ele, cls)) ele.className = (ele.className + " " + cls).trim();
}
 	function _index(el) {
		var index = 0;

		if (!el || !el.parentNode) {
			return -1;
		}

		while (el && (el = el.previousElementSibling)) {
				index++;
		}

		return index;
	}

    var dnd = {

      // 初始化
      init: function () {
        var me = this;
        me.src = document.querySelector('#demo1-src');
        me.panelList = document.querySelector('.panel-list');

        me.src.addEventListener('dragstart', me.onDragStart, false);

        me.panelList.addEventListener('dragenter', me.onDragEnter, false);

        // 取消元素dragover默认行为,使其可拖放
        me.panelList.addEventListener('dragover', me.onDragOver, false);

        // 拖拽移出元素,清除视觉反馈
        me.panelList.addEventListener('dragleave', me.onDragLeave, false);

        // 鼠标释放,在拖放目标上接收数据并处理
        me.panelList.addEventListener('drop', me.onDrop, false);
      },
      onDragStart: function (e) {
      	dragged = e.target
      	dragEl = e.target
      	// console.log("start", "---------->",e.target.innerHTML)
        e.dataTransfer.setData('text/plain', 'demo1-src');
        setTimeout(function(){
      		e.target.classList.add('sortable-ghost');
      	}, 0);

      },
      onDragEnter: function (e) {
        if(e.target != dragged){
      		// console.log("enter", "---------->",e.target.nodeName)
      	}
      	var target= e.target;

		dragRect = dragEl.getBoundingClientRect();
		// if ( !target.animated && (target !== dragEl )) {

		if(e.target != dragged && !target.animated  && e.target.nodeName!="UL"){
			// console.log("enter")
			var lastEl;
			if (lastEl !== target) {
					lastEl = target;
					lastCSS = _css(target);
					lastParentCSS = _css(target.parentNode);
				}
				targetRect = target.getBoundingClientRect();

				var width = targetRect.right - targetRect.left,
					height = targetRect.bottom - targetRect.top,
					floating = R_FLOAT.test(lastCSS.cssFloat + lastCSS.display)
						|| (lastParentCSS.display == 'flex' && lastParentCSS['flex-direction'].indexOf('row') === 0),
					isWide = (target.offsetWidth > dragEl.offsetWidth),
					isLong = (target.offsetHeight > dragEl.offsetHeight),
					halfway = (floating ? (e.clientX - targetRect.left) / width : (e.clientY - targetRect.top) / height) > 0.5,
					nextSibling = target.nextElementSibling,
					// moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, e),
					after = false
				;
				after = (nextSibling !== dragEl) && !isLong || halfway && isLong;
				if (!dragEl.contains(document.querySelector('#Dondrag'))) {
						// console.log(1)
						target.parentNode.insertBefore(dragEl, after ? nextSibling : target);

				}
				parentEl = dragEl.parentNode; // actualization
				_animate(dragRect, dragEl);
				_animate(targetRect, target);
			// targetRect = target.getBoundingClientRect();

		}
      },
      onDragLeave: function (e) {
       if(e.target != dragged)
      		// console.log("leave", "---------->",e.target.innerHTML)
        if (e.target.classList.contains('panel-item')) {
          e.target.classList.remove('over');
        }
      },
      onDragOver: function (e) {
      	if(e.target != dragged)
      		// console.log("over", "---------->",e.target.innerHTML)
        e.preventDefault();
      },
      onDrop: function (e) {
      	// console.log("drop", "---------->",e.target.innerHTML)
      	e.target.classList.remove('sortable-ghost');
    	var id = e.dataTransfer.getData('text/plain');
    	var src = document.getElementById(id);
    	var target = e.target;
    	// dest = _index(target)
    	console.log(srcIndex)
      }

    };

    dnd.init();
  }());


text:
#include <QtTest/private/qbenchmarkmeasurement_p.h>
#include <QtTest/private/qbenchmark_p.h>
#include <QtTest/private/qbenchmarkmetric_p.h>
#include <QtTest/qbenchmark.h>
#include <qdebug.h>

QT_BEGIN_NAMESPACE

// QBenchmarkTimeMeasurer implementation

void QBenchmarkTimeMeasurer::start()
{
    time.start();
}

qint64 QBenchmarkTimeMeasurer::checkpoint()
{
    return time.elapsed();
}

qint64 QBenchmarkTimeMeasurer::stop()
{
    return time.elapsed();
}

bool QBenchmarkTimeMeasurer::isMeasurementAccepted(qint64 measurement)
{
    return (measurement > 50);
}

int QBenchmarkTimeMeasurer::adjustIterationCount(int suggestion)
{
    return suggestion;
}

bool QBenchmarkTimeMeasurer::needsWarmupIteration()
{
    return true;
}

int QBenchmarkTimeMeasurer::adjustMedianCount(int)
{
    return 1;
}

QTest::QBenchmarkMetric QBenchmarkTimeMeasurer::metricType()
{
    return QTest::WalltimeMilliseconds;
}

#ifdef HAVE_TICK_COUNTER // defined in 3rdparty/cycle_p.h

void QBenchmarkTickMeasurer::start()
{
    startTicks = getticks();
}

qint64 QBenchmarkTickMeasurer::checkpoint()
{
    CycleCounterTicks now = getticks();
    return qRound64(elapsed(now, startTicks));
}

qint64 QBenchmarkTickMeasurer::stop()
{
    CycleCounterTicks now = getticks();
    return qRound64(elapsed(now, startTicks));
}

bool QBenchmarkTickMeasurer::isMeasurementAccepted(qint64)
{
    return true;
}

int QBenchmarkTickMeasurer::adjustIterationCount(int)
{
    return 1;
}

int QBenchmarkTickMeasurer::adjustMedianCount(int)
{
    return 1;
}

bool QBenchmarkTickMeasurer::needsWarmupIteration()
{
    return true;
}

QTest::QBenchmarkMetric QBenchmarkTickMeasurer::metricType()
{
    return QTest::CPUTicks;
}

#endif

QT_END_NAMESPACE


text:
//
// Created by Matthew Hinkle on 6/1/15.
//

#ifdef WITH_XLIB

#include <X11/Xutil.h>
#include "x-window-manager.h"

using forge::xwm::log;

namespace forge {

    static const int PROPERTY_FORMAT_8 = 8;
    static const int PROPERTY_FORMAT_32 = 32;

    std::once_flag one_time_init_flag;
    static void one_time_init(struct wm * wm, unsigned options) {
        if(WM_OPTION_THREADS & options) {
            if(!XInitThreads()) {
                log.warn("Failed to initialize X11 with threads.  This is expected on a single core.\n");
            }
        }
    }

    static Display * open_display()
    {
        int event = 0;
        int error = 0;
        int major = XkbMajorVersion;
        int minor = XkbMinorVersion;
        int reason = 0;
        Display * d = XkbOpenDisplay(NULL, &event, &error, &major, &minor, &reason);
        switch(reason) {
            case XkbOD_Success: return d;
            case XkbOD_BadLibraryVersion: log.error("Failed to initialize Xkb: version incompatibility between compile and run-time Xlib/Xkb libraries.\n"); break;
            case XkbOD_ConnectionRefused: log.error("Failed to initialize Xkb: connection refused when attempting to open display.\n"); break;
            case XkbOD_BadServerVersion: log.error("Failed to initialize Xkb: incompatible Xkb extension version between library and server.\n"); break;
            case XkbOD_NonXkbServer: log.warn("Failed to initialize Xkb: server does not support Xkb.\n"); break;
            default: log.warn("Unknown XkbOpenDisplay reason [id = %d] encountered.\n", reason); break;
        }

        log.warn("Falling back to core Xlib keyboard implemenation.\n");
        return XOpenDisplay(NULL);
    }

    extern void init_wm(struct wm * wm, unsigned options) {
        std::call_once(one_time_init_flag, one_time_init, wm, options);

        assert(wm);

        Display * d = open_display();
        int default_screen = XDefaultScreen(d);

        assert(d);

        wm->display = d;
        wm->default_screen = default_screen;
    }

    extern void destroy_wm(struct wm * wm) {
        if(!wm) return;

        XCloseDisplay(wm->display);
        wm->display = NULL;
    }

    extern void wm_init_glctx(struct wm * wm, struct window * w, struct glctx * ctx, unsigned ctxoptions) {
        assert(wm);
        assert(w);
        assert(ctx);

        const int fbattr[] = {
                GLX_DOUBLEBUFFER, ctxoptions ? True : False,
                None
        };

        int fbcount = 0;
        GLXFBConfig * fbconfigs = glXChooseFBConfig(wm->display, wm->default_screen, fbattr, &fbcount);

        assert(fbconfigs);
        assert(fbcount > 0);

        GLXContext c = glXCreateNewContext(wm->display, *fbconfigs, GLX_RGBA_TYPE, NULL, True);

        assert(c);

        ctx->display = wm->display;
        ctx->drawable = w->w;
        ctx->native = c;
    }

    extern void wm_destroy_glctx(struct wm * wm, struct glctx * ctx) {
        if(!ctx) return;

        if(ctx->display && ctx->native) {
            glXDestroyContext(ctx->display, ctx->native);
            ctx->native = 0;
            ctx->display = 0;
        }
    }

    extern void * glctx_get_native(const struct glctx * ctx) {
        assert(ctx);

        return ctx->native;
    }

    extern void glctx_make_current(struct glctx * ctx) {
        assert(ctx);

        glXMakeContextCurrent(ctx->display, ctx->drawable, ctx->drawable, ctx->native);
    }

    extern void glctx_swap_buffers(struct glctx * ctx) {
        assert(ctx);

        glXSwapBuffers(ctx->display, ctx->drawable);
    }

    static const unsigned long EVENT_MASK = ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | PointerMotionMask | PointerMotionHintMask;
    static const unsigned long VALUE_MASK =  CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;

    static const int DEPTH_SIZE = 32;

    static int VI_ATTR_SINGLE_BUFFERED[] = {
            GLX_RGBA,
            GLX_DEPTH_SIZE, DEPTH_SIZE,
            None
    };

    static int VI_ATTR[] = {
            GLX_RGBA,
            GLX_DOUBLEBUFFER,
            GLX_DEPTH_SIZE, DEPTH_SIZE,
            None
    };

    static const unsigned char HINTS_FULLSCREEN[] = {
            2,		/* flags: specify we are changing the decorations field (idx 2) */
            0,		/* functions: unused for fullscreen */
            0,		/* decorations: remove decorations */
            0,		/* inputMode: unused */
            0		/* status: unused */
    };

    static const unsigned char HINTS_WINDOWED[] = {
            2,		/* flags: specify we are changing the decorations field (idx 2) */
            0,		/* functions: unused for windowed */
            1,		/* decorations: add decorations */
            0,		/* inputMode: unused */
            0		/* status: unused */
    };

    static void _set_fullscreen(struct window * w) {
        assert(w);

        Atom prop = XInternAtom(w->display, "_MOTIF_WM_HINTS", True);
        assert(prop);

        static const int hint_count = sizeof(HINTS_FULLSCREEN) / sizeof(*HINTS_FULLSCREEN);

        XChangeProperty(w->display,
                        w->w,
                        prop,
                        prop,
                        PROPERTY_FORMAT_32,
                        PropModeReplace,
                        HINTS_FULLSCREEN,
                        hint_count);
    }

    extern void wm_init_window(struct wm * wm,
                               struct window * w,
                               const char * name,
                               int x, int y, int width, int height,
                               unsigned options) {
        assert(wm);
        assert(w);
        assert(name);

        const bool is_double_buffered = false;//WINDOW_OPTION_DOUBLE_BUFFERED & options;
        XVisualInfo * vinfo = glXChooseVisual(wm->display, wm->default_screen, is_double_buffered ? VI_ATTR : VI_ATTR_SINGLE_BUFFERED);
        assert(vinfo);

        Window root = XRootWindow(wm->display, vinfo->screen);
        assert(root);

        if(WINDOW_OPTION_FULLSCREEN & options) {
            const Screen * s = XScreenOfDisplay(wm->display, wm->default_screen);
            x = 0;
            y = 0;
            width = s->width;
            height = s->height;
        }

        Colormap cmap = XCreateColormap(wm->display, root, vinfo->visual, AllocNone);
        XSetWindowAttributes attr;
        attr.background_pixel = 0;
        attr.border_pixel = 0;
        attr.colormap = cmap;
        attr.event_mask = EVENT_MASK;

        ::Window window = XCreateWindow(
                wm->display,
                root,
                x, y, static_cast<unsigned>(width), static_cast<unsigned>(height),
                0,  /* no border */
                vinfo->depth,
                InputOutput,
                vinfo->visual,
                VALUE_MASK,
                &attr
        );
        assert(window);

        w->display = wm->display;
        w->w = window;
        w->colormap = cmap;
        w->vinfo = vinfo;

        if(WINDOW_OPTION_FULLSCREEN & options) _set_fullscreen(w);
        if(name) window_set_name(w, name);
        if(!(WINDOW_OPTION_HIDDEN & options)) XMapWindow(wm->display, window);

        XFlush(wm->display);
    }

    extern void wm_destroy_window(struct wm * wm, struct window * w) {
        assert(wm);
        assert(w);

        if(w) {
            XFreeColormap(wm->display, w->colormap);
            XDestroyWindow(wm->display, w->w);

            w->colormap = 0;
            w->w = 0;
        }
    }

    static const int MAX_NAME_LENGTH = 1024;

    extern void window_set_name(struct window * w, const char * name) {
        assert(w);
        assert(name);

        const Atom prop = XInternAtom(w->display, "WM_NAME", True);
        const Atom type = XInternAtom(w->display, "STRING", True);

        assert(prop);
        assert(type);

        char * name_copy = const_cast<char *>(name);

        XChangeProperty(w->display,
                        w->w,
                        prop,
                        type,
                        PROPERTY_FORMAT_8,
                        PropModeReplace,
                        reinterpret_cast<unsigned char *>(name_copy),
                        MAX_NAME_LENGTH);
        XFlush(w->display);
    }

    enum {
        _NET_WM_STATE_REMOVE = 0,
        _NET_WM_STATE_ADD = 1,
        _NET_WM_STATE_TOGGLE = 2
    };

    extern void window_set_bounds(struct window * w, int x, int y, int width, int height) {
        assert(w);
        assert(width >= 0);
        assert(height >= 0);

        XMoveResizeWindow(w->display, w->w, x, y, static_cast<unsigned>(width), static_cast<unsigned>(height));
        XFlush(w->display);
    }

    extern void window_set_fullscreen(struct window * w, bool fullscreen) {
        assert(w);

        Atom state = XInternAtom(w->display, "_NET_WM_STATE", True);
        Atom fs = XInternAtom(w->display, "_NET_WM_STATE_FULLSCREEN", True);

        assert(state);
        assert(fs);

        XClientMessageEvent e;
        e.type = ClientMessage;
        e.display = w->display;
        e.window = w->w;
        e.message_type = state;
        e.format = 32;
        e.data.l[0] = fullscreen ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
        e.data.l[1] = fs;
        e.data.l[2] = 0;
        e.data.l[3] = 0;
        e.data.l[4] = 0;

        XSendEvent(w->display,
                   w->w,
                   True,
                   SubstructureRedirectMask | SubstructureNotifyMask,
                   reinterpret_cast<XEvent *>(&e));
        XFlush(w->display);
    }

    extern void window_map(struct window * w) {
        assert(w);

        XMapWindow(w->display, w->w);
        XFlush(w->display);
    }

}

#endif


text:
    since = "TBD",
    reason = "all constants in this module replaced by associated constants on `i64`"
)]

int_module! { i64 }


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

	<title>PubTal Manual Contents</title>
	<link href="../style/site.css" type="text/css" rel="stylesheet">

PubTal Manual Contents

Contents of the PubTal manual.

The PubTal manual is divided into several different sections.  If you are new to PubTal it is probably easiest to start with the Quick Start section.

Quick Start - A quick start guide to using PubTal.

Installation Guide - A guide to installing PubTal on Linux, MacOS X and Windows.

Template Basics - Describes the basics of the PubTal templating system.

Authoring Web Content

HTMLText - How to author web pages using the HTMLText content type.

OpenOffice - How to author web pages using OpenOffice.

Catalogues - How to create Photo Albums using PubTal's Catalogue support.

Raw & Binary - What are the Raw and Binary content types?

Weblog - Maintaining a Weblog using PubTal.

Configuration - Configuration options in PubTal.

Uploading - How to make PubTal upload your website.

Optional Plugins - A guide to the optional plugins.

Plugin API - How to write new plugins.

Commands Reference - Reference guide for the commands.

  Contents

PubTal Version 3.5

File: index.txt

Last modified: Fri, 27 Jul 2007 18:34:31 BST

Copyright 2011 Colin Stewart

Made with PubTal 3.5


text:
.. Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed
   with this work for additional information regarding copyright
   ownership.  The ASF licenses this file to you 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.

.. include:: ../../../common.defs

.. default-domain:: c

TSContThreadAffinitySet
***********************

Synopsis
========

.. code-block:: cpp

    #include <ts/ts.h>

.. function:: TSReturnCode TSContThreadAffinitySet(TSCont contp, TSEventThread ethread)

Description
===========

Set the thread affinity of continuation :arg:`contp` to :arg:`ethread`. Future calls to
:func:`TSContScheduleOnPool`, and :func:`TSContScheduleOnPool` that has the same type as :arg:`ethread`
will schedule the continuation on :arg:`ethread`, rather than an arbitrary thread of that type.

:func:`TSContScheduleOnPool` and :func:`TSContScheduleEveryOnPool` will default the affinity to calling thread
when invoked without explicitly setting the thread affinity.

Return Values
=============

:data:`TS_SUCCESS` if thread affinity of continuation :arg:`contp` was set to :arg:`ethread`,
:data:`TS_ERROR` if not.


text:
package com.sun.org.apache.bcel.internal.classfile;

/* ====================================================================
 * The Apache Software License, Version 1.1
 *
 * Copyright (c) 2001 The Apache Software Foundation.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by the
 *        Apache Software Foundation (http://www.apache.org/)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Apache" and "Apache Software Foundation" and
 *    "Apache BCEL" must not be used to endorse or promote products
 *    derived from this software without prior written permission. For
 *    written permission, please contact apache@apache.org.
 *
 * 5. Products derived from this software may not be called "Apache",
 *    "Apache BCEL", nor may "Apache" appear in their name, without
 *    prior written permission of the Apache Software Foundation.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation.  For more
 * information on the Apache Software Foundation, please see
 * <http://www.apache.org/>.
 */
import java.io.*;
import  com.sun.org.apache.bcel.internal.Constants;

/**
 * Abstract super class for Fieldref and Methodref constants.
 *
 * @author  M. Dahm
 * @see     ConstantFieldref
 * @see     ConstantMethodref
 * @see     ConstantInterfaceMethodref
 */
public abstract class ConstantCP extends Constant {
  /** References to the constants containing the class and the field signature
   */
  protected int class_index, name_and_type_index;

  /**
   * Initialize from another object.
   */
  public ConstantCP(ConstantCP c) {
    this(c.getTag(), c.getClassIndex(), c.getNameAndTypeIndex());
  }

  /**
   * Initialize instance from file data.
   *
   * @param tag  Constant type tag
   * @param file Input stream
   * @throws IOException
   */
  ConstantCP(byte tag, DataInputStream file) throws IOException
  {
    this(tag, file.readUnsignedShort(), file.readUnsignedShort());
  }

  /**
   * @param class_index Reference to the class containing the field
   * @param name_and_type_index and the field signature
   */
  protected ConstantCP(byte tag, int class_index,
                       int name_and_type_index) {
    super(tag);
    this.class_index         = class_index;
    this.name_and_type_index = name_and_type_index;
  }

  /**
   * Dump constant field reference to file stream in binary format.
   *
   * @param file Output file stream
   * @throws IOException
   */
  public final void dump(DataOutputStream file) throws IOException
  {
    file.writeByte(tag);
    file.writeShort(class_index);
    file.writeShort(name_and_type_index);
  }

  /**
   * @return Reference (index) to class this field or method belongs to.
   */
  public final int getClassIndex()       { return class_index; }

  /**
   * @return Reference (index) to signature of the field.
   */
  public final int getNameAndTypeIndex() { return name_and_type_index; }

  /**
   * @param class_index points to Constant_class
   */
  public final void setClassIndex(int class_index) {
    this.class_index = class_index;
  }

  /**
   * @return Class this field belongs to.
   */
  public String getClass(ConstantPool cp) {
    return cp.constantToString(class_index, Constants.CONSTANT_Class);
  }

  /**
   * @param name_and_type_index points to Constant_NameAndType
   */
  public final void setNameAndTypeIndex(int name_and_type_index) {
    this.name_and_type_index = name_and_type_index;
  }

  /**
   * @return String representation.
   */
  public final String toString() {
    return super.toString() + "(class_index = " + class_index +
      ", name_and_type_index = " + name_and_type_index + ")";
  }
}


text:
package us.corenetwork.pumpkinchallenge;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;

public class Util {

	public static void Message(String message, CommandSender sender)
	{
		message = message.replaceAll("\\&([0-9abcdefklmnor])", ChatColor.COLOR_CHAR + "$1");

		final String newLine = "\\[NEWLINE\\]";
		String[] lines = message.split(newLine);

		for (int i = 0; i < lines.length; i++) {
			lines[i] = lines[i].trim();

			if (i == 0)
				continue;

			int lastColorChar = lines[i - 1].lastIndexOf(ChatColor.COLOR_CHAR);
			if (lastColorChar == -1 || lastColorChar >= lines[i - 1].length() - 1)
				continue;

			char lastColor = lines[i - 1].charAt(lastColorChar + 1);
			lines[i] = Character.toString(ChatColor.COLOR_CHAR).concat(Character.toString(lastColor)).concat(lines[i]);
		}

		for (int i = 0; i < lines.length; i++)
			sender.sendMessage(lines[i]);

	}

	public static boolean hasPermission(CommandSender player, String permission)
	{
		while (true)
		{
			if (player.hasPermission(permission))
				return true;

			if (permission.length() < 2)
				return false;

			if (permission.endsWith("*"))
				permission = permission.substring(0, permission.length() - 2);

			int lastIndex = permission.lastIndexOf(".");
			if (lastIndex < 0)
				return false;

			permission = permission.substring(0, lastIndex).concat(".*");
		}
	}
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Clavaria megalorrhiza Berk. & Broome

### Remarks
null


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
                           http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
                           http://www.springframework.org/schema/jdbc
                           http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd">

	<jdbc:embedded-database id="dataSource" type="H2"></jdbc:embedded-database>
</beans>


text:
{% extends "layout.html" %}

{% block pageTitle %}
	GOV.UK prototyping kit
{% endblock %}

{% block content %}

{% import "release2-1/elements.html" as elements %}
{% for page in data %}
{% for question in page.speech %}

	{{ elements.backButton(page,question) }}

				<form action="/release2-1/speech{% if edit %}?edit=true{% endif %}" method="post" class="form">
					{{ elements.header(page,question) }}

					{% set seq  = [
						{"id":"monitored","value":"Yes","showPanel":"speechDetails"},
						{"id":"monitored", "value":"No"}
					] %}
					{{ elements.radioSelect('monitored',question.question,question.qHintText,answers.monitored,seq,"inline") }}

						{{ elements.genericInput('howManyHours',question.question2  |  safe,answers.howManyHours,"","form-control-1-2") }}
						{{ elements.textarea("whyNeedMonitoring",question.question3  |  safe,answers.whyNeedMonitoring) }}

					{{ elements.submit(page,question) }}

				</form>

				{{ elements.helpline(page) }}
{{ elements.validation(page,question) }}

{% endfor %}
{% endfor %}
{% endblock %}


text:
/* */
var path = require('path');
var rewriteUrls = require('./rewrite');
function rebaseUrls(data, context) {
  var rebaseOpts = {
    absolute: context.options.explicitRoot,
    relative: !context.options.explicitRoot && context.options.explicitTarget,
    fromBase: context.options.relativeTo
  };
  if (!rebaseOpts.absolute && !rebaseOpts.relative)
    return data;
  if (rebaseOpts.absolute && context.options.explicitTarget)
    context.warnings.push('Both \'root\' and output file given so rebasing URLs as absolute paths');
  if (rebaseOpts.absolute)
    rebaseOpts.toBase = path.resolve(context.options.root);
  if (rebaseOpts.relative)
    rebaseOpts.toBase = path.resolve(context.options.target);
  if (!rebaseOpts.fromBase || !rebaseOpts.toBase)
    return data;
  return rewriteUrls(data, rebaseOpts, context);
}
module.exports = rebaseUrls;


text:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/person_common_container">

    <include layout="@layout/state_loading"/>

</FrameLayout>


text:
* v0.4.2
  * The property `super_` is now exposed on "classes" to make migrations from
    NodeJS `inherits` easy.

* v0.4.1
  * `merge` now accepts arrays of objects.
  * Documentation improvements.

* v0.4.0
  * Mayor source code re-organization.
  * Browser bundles are generated using Browserify.

  **API Changes**

  * `Class.create`, `include`, `subclassOf` **has been removed and replaced
    by `newclass`**.
  * An equivalent method to `newclass` but for object instances called `mix`
    has been added.
  * The previous _non-public_ implementation using _class factories_
    has been removed.

* v0.3.0
  * **Breaking change**: `_callSuper` and `_applySuper` were removed.
    You can replace `_callSuper` with the longer
    `MyClass.__super__.method.call(this, args)` (yes it's ugly but
    `_callSuper` didn't worked as expected in some cases).

* v0.2.4
  * Fixed a bug in `merge` that incorrectly marked a conflict when trying to
  define an `Object.prototype` function.

  * A workaround was added into integration tests to make them run in IE (see
  this [mocha issue](https://github.com/visionmedia/mocha/issues/502))

* v0.2.1/v0.2.3 - `include` composition changed to throw exceptions when a
  conflict is found.

  >**Note:** some _patch_ versions were increased due to fixes in comments and
  Bower tagging. There is no functionality difference between 0.2.1 and 0.2.3.

* v0.2.0

  * Support for Internet Explorer 8

  **API Changes**

  * `_super` was removed, instead use `_callSuper` or `_applySuper`.
  * `withTraits` was renamed to `include` (helpful for people that never heard
    about traits before).
  * `subclassOf` added as a convenience method to extend non-Barman classes.

* v0.1.1 - Removal of `underscore` dependency. Better documentation (both
  source and readme). Source code refactoring.

* v0.1.0 - Initial release, it had a dependency with `underscore`.


text:
module Buff
  RC_VERSION = "0.0.1"
  class Setup

    def initialize(args="~/.bufferapprc")
      @path = Pathname.new(args)
      if exists?
        @content = YAML.load_file(File.expand_path path)
      else
        raise Buff::Error::ConfigFileMissing
      end
    end

    def path
      @path.to_s
    end

    def exists?
      File.exists?(File.expand_path path)
    end

  end
end


text:
namespace printing {

// Global SequenceNumber used for generating unique cookie values.
static base::AtomicSequenceNumber cookie_seq(base::LINKER_INITIALIZED);

PrintSettings::PrintSettings()
    : min_shrink(1.25),
      max_shrink(2.0),
      desired_dpi(72),
      selection_only(false),
      use_overlays(true),
      dpi_(0),
      landscape_(false),
      supports_alpha_blend_(true) {
}

PrintSettings::~PrintSettings() {
}

void PrintSettings::Clear() {
  ranges.clear();
  min_shrink = 1.25;
  max_shrink = 2.;
  desired_dpi = 72;
  selection_only = false;
  printer_name_.clear();
  device_name_.clear();
  page_setup_device_units_.Clear();
  dpi_ = 0;
  landscape_ = false;
  supports_alpha_blend_ = true;
}

void PrintSettings::SetPrinterPrintableArea(
    gfx::Size const& physical_size_device_units,
    gfx::Rect const& printable_area_device_units,
    int units_per_inch) {

  int header_footer_text_height = 0;
  int margin_printer_units = 0;
  if (use_overlays) {
    // Hard-code text_height = 0.5cm = ~1/5 of inch.
    header_footer_text_height = ConvertUnit(500, kHundrethsMMPerInch,
                                            units_per_inch);
    // Default margins 1.0cm = ~2/5 of an inch.
    margin_printer_units = ConvertUnit(1000, kHundrethsMMPerInch,
                                       units_per_inch);
  }
  // Start by setting the user configuration
  page_setup_device_units_.Init(physical_size_device_units,
                                printable_area_device_units,
                                header_footer_text_height);

  // Apply default margins (not user configurable just yet).
  // Since the font height is half the margin we put the header and footers at
  // the font height from the margins.
  PageMargins margins;
  margins.header = header_footer_text_height;
  margins.footer = header_footer_text_height;
  margins.left = margin_printer_units;
  margins.top = margin_printer_units;
  margins.right = margin_printer_units;
  margins.bottom = margin_printer_units;
  page_setup_device_units_.SetRequestedMargins(margins);
}

bool PrintSettings::Equals(const PrintSettings& rhs) const {
  // Do not test the display device name (printer_name_) for equality since it
  // may sometimes be chopped off at 30 chars. As long as device_name is the
  // same, that's fine.
  return ranges == rhs.ranges &&
      min_shrink == rhs.min_shrink &&
      max_shrink == rhs.max_shrink &&
      desired_dpi == rhs.desired_dpi &&
      overlays.Equals(rhs.overlays) &&
      device_name_ == rhs.device_name_ &&
      page_setup_device_units_.Equals(rhs.page_setup_device_units_) &&
      dpi_ == rhs.dpi_ &&
      landscape_ == rhs.landscape_;
}

int PrintSettings::NewCookie() {
  // A cookie of 0 is used to mark a document as unassigned, count from 1.
  return cookie_seq.GetNext() + 1;
}

void PrintSettings::SetOrientation(bool landscape) {
  if (landscape_ != landscape) {
    landscape_ = landscape;
    page_setup_device_units_.FlipOrientation();
  }
}

}  // namespace printing


text:
angular.module('PubMeApp').directive('specialOffer', specialOffer);
specialOffer.$inject = ['$state'];

function specialOffer ($state) {
    return {
        restrict: 'AE',
        templateUrl: '/js/directives/specialOffer.templ.html',
        scope: {
            item: '=',
            savefc: '=',
            removefc: '='
        },
        controller: function($scope, $attrs){
            $scope.var = $scope.item;
            $scope.modalShow = false;
            $scope.modalData = {
                description: "none"
            };

            $scope.editOffer = function(){
                $scope.modalShow = true;
                $scope.modalData = $scope.item;
            };

            $scope.removeOffer = function(){
                swal({
                    title: "Delete Offer",
                    type: "warning",
                    showCancelButton: true,
                    closeOnConfirm: false,
                    closeOnCancel: false
                },
                function(isConfirm){
                    if (isConfirm){
                        $scope.removefc($scope.item);
                    }
                    else {
                        swal("Cancelled", "Action is canceled", "error");
                    }
                });
            };

            $scope.save = function() {
                $scope.modalShow = false;
                console.log($scope.var);
                $scope.modalData = null;

                $scope.savefc($scope.item);
            };
        }
    }
}


text:
package com.navercorp.pinpoint.plugin.paho.mqtt.interceptor;

import com.navercorp.pinpoint.bootstrap.context.MethodDescriptor;
import com.navercorp.pinpoint.bootstrap.context.SpanRecorder;
import com.navercorp.pinpoint.bootstrap.context.Trace;
import com.navercorp.pinpoint.bootstrap.context.TraceContext;
import com.navercorp.pinpoint.common.plugin.util.HostAndPort;
import com.navercorp.pinpoint.common.util.ArrayArgumentUtils;
import com.navercorp.pinpoint.common.util.BytesUtils;
import com.navercorp.pinpoint.plugin.paho.mqtt.accessor.MqttV3ClientCommsGetter;
import com.navercorp.pinpoint.plugin.paho.mqtt.accessor.SocketGetter;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.eclipse.paho.client.mqttv3.internal.ClientComms;
import org.eclipse.paho.client.mqttv3.internal.NetworkModule;
import org.eclipse.paho.client.mqttv3.internal.wire.MqttPublish;

import java.net.Socket;

import static com.navercorp.pinpoint.plugin.paho.mqtt.PahoMqttConstants.MQTT_MESSAGE_PAYLOAD_ANNOTATION_KEY;
import static com.navercorp.pinpoint.plugin.paho.mqtt.PahoMqttConstants.UNKNOWN;

/**
 * @author Younsung Hwang
 */
public class MqttV3CallbackMessageArrivedInterceptor extends MqttCallbackMessageArrivedInterceptor {

    public MqttV3CallbackMessageArrivedInterceptor(TraceContext traceContext, MethodDescriptor methodDescriptor) {
        super(traceContext, methodDescriptor);
    }

    @Override
    protected Trace createTraceByVersion(Object target, Object[] args) {
        // MQTT Version 3 not supoort custom properties, so can't match publish trace
        return traceContext.newTraceObject();
    }

    @Override
    protected boolean validateArgs(Object[] args) {

        if (args[0] instanceof MqttPublish) {
            return true;
        }
        return false;

    }

    @Override
    protected void recordDataByVersion(Object target, SpanRecorder recorder, Object[] args) {
        MqttPublish mqttPublish = ArrayArgumentUtils.getArgument(args, 0, MqttPublish.class);
        if (mqttPublish != null) {
            recorder.recordRpcName(buildRpcName(mqttPublish.getTopicName(), mqttPublish.getMessage().getQos()));

            MqttMessage mqttMessage = mqttPublish.getMessage();
            String payload = BytesUtils.toString(mqttMessage.getPayload());
            recorder.recordAttribute(MQTT_MESSAGE_PAYLOAD_ANNOTATION_KEY, payload);

            String endPoint = getEndPoint(target);
            recorder.recordEndPoint(endPoint);
        }
    }

    private String getEndPoint(Object target) {

        ClientComms clientComms = ((MqttV3ClientCommsGetter) target)._$PINPOINT$_getMqttV3ClientComms();
        if (clientComms == null) {
            return UNKNOWN;
        }

        NetworkModule networkModule = clientComms.getNetworkModules()[clientComms.getNetworkModuleIndex()];
        if (networkModule == null) {
            return UNKNOWN;
        }

        Socket socket = ((SocketGetter) networkModule)._$PINPOINT$_getSocket();
        return HostAndPort.toHostAndPortString(socket.getLocalAddress().getHostAddress(), socket.getLocalPort());
    }

}


text:
const axiosLib = require('axios');
let axios = axiosLib.create();
const qs = require('qs')

const baseURL = 'https://my.tado.com/api/v2'
let log, storage, token, settings, homeId

module.exports = async function (platform) {
	log = platform.log
	storage = platform.storage

	const storageSettings = await storage.getItem('settings')
	if (storageSettings) {
		settings = storageSettings
		log.easyDebug(`Got settings from storage`)
	} else {
		settings = {}
	}

	axios.defaults.params = {
		username: platform.username,
		password: platform.password
	}

	axios.defaults.baseURL = baseURL

	if (platform.homeId)
		homeId = platform.homeId
	else {
		try {
			homeId = await get.HomeId()
		} catch(err) {
			log(`ERROR: Can't start the plugin without Home ID !!`)
			throw err
		}
	}

	return {

		getAllDevices: async () => {
			try {
				const temperatureUnit = await get.TemperatureUnit()
				const zones = await get.Zones()
				const installations = await get.Installations()

				const devices = zones.map(async zone => {
					let zoneState, capabilities
					try {
						zoneState = await get.State(zone.id)
						capabilities = await get.ZoneCapabilities(zone.id)
					} catch (err) {
						log(err)
						log(`COULD NOT get Zone ${zone.id} state and capabilities !! skipping device...`)
						return null
					}

					return {
						...zone,
						temperatureUnit: temperatureUnit,
						installation: installations[zone.id] || 'NON_THERMOSTATIC',
						capabilities: capabilities,
						state: zoneState,

					}
				})

				return await Promise.all(devices)
			} catch(err) {
				log(`Failed to get devices and states!!`)
				throw err
			}
		},

		setDeviceState: async (zoneId, overlay) => {
			const method = overlay ? 'put' : 'delete'
			const path = `/homes/${homeId}/zones/${zoneId}/overlay`
			return await setRequest(method, path, overlay)
		},

		getWeather: async () => {
			log.easyDebug(`Getting Weather Status from tado° API`)
			const path = `/homes/${homeId}/weather`
			try {
				const weather = await getRequest(path)
				weather.id = homeId
				settings.weather = weather
				storage.setItem('settings', settings)
				return weather
			} catch (err) {
				log.easyDebug(`The plugin was not able to retrieve Weather Status from tado° API !!`)
				if (settings.weather) {
					log.easyDebug(`Got Weather Status from storage  (NOT TO CRASH HOMEBRIDGE)  >>>`)
					log.easyDebug(JSON.stringify(settings.weather))
					return settings.weather
				}
				throw err
			}
		},

		getUsers: async () => {
			log.easyDebug(`Getting Users from tado° API`)
			const path = `/homes/${homeId}/users`
			try {
				const response = await getRequest(path)

				const users = response.filter(user => {
					user.trackedDevice = user.mobileDevices.find(device => device.settings.geoTrackingEnabled)
					return user.trackedDevice
				})

				settings.users = users
				log.easyDebug(`>>> Got Users from tado° API`)
				// log.easyDebug(JSON.stringify(users))
				storage.setItem('settings', settings)
				return users
			} catch (err) {
				log.easyDebug(`The plugin was not able to retrieve Users from tado° API !!`)
				if (settings.users) {
					log.easyDebug(`Got Users from storage  >>>`)
					log.easyDebug(JSON.stringify(settings.users))
					return settings.users
				}
				throw err
			}
		}
	}

}

function getRequest(url) {
	return new Promise((resolve, reject) => {

		log.easyDebug(`Creating GET request to tado° API --->`)
		log.easyDebug(baseURL + url)

		axios.get(url)
			.then(response => {
				const json = response.data
				log.easyDebug(`Successful GET response:`)
				log.easyDebug(JSON.stringify(json))
				resolve(json)
			})
			.catch(err => {
				log(`ERROR: ${err.message}`)
				if (err.response)
					log.easyDebug(err.response.data)
				reject(err)
			})
	})
}

function setRequest(method, url, data) {
	// eslint-disable-next-line no-async-promise-executor
	return new Promise(async (resolve, reject) => {

		let headers
		try {
			const tokenResponse = await getToken()
			headers = {
				'Authorization': 'Bearer ' + tokenResponse
			}
		} catch (err) {
			log('The plugin was NOT able to find stored token or acquire one from tado° API ---> it will not be able to set the state !!')
			reject(err)
		}

		log.easyDebug(`Creating ${method.toUpperCase()} request to tado° API --->`)
		log.easyDebug(baseURL + url)
		if (data)
			log.easyDebug('data: ' +JSON.stringify(data))

		axios({url, data, method, headers})
			.then(response => {
				const json = response.data
				log.easyDebug(`Successful ${method.toUpperCase()} response:`)
				log.easyDebug(JSON.stringify(json))
				resolve(json)
			})
			.catch(err => {
				log(`ERROR: ${err.message}`)
				if (err.response)
					log.easyDebug(err.response.data)
				reject(err)
			})
	})
}

function getToken() {
	// eslint-disable-next-line no-async-promise-executor
	return new Promise(async (resolve, reject) => {

		if (token && new Date().getTime() < token.expirationDate) {
			// log.easyDebug('Found valid token in cache')
			resolve(token.key)
			return
		}

		let data = {
			grant_type: 'password',
			client_id: 'tado-web-app',
			client_secret: 'wZaRN7rpjn3FoNyF5IFuxg9uMzYJcvOoQ8QWiIqS3hfk6gLhVlG57j5YNoZL2Rtc',
			scope: 'home.user'
		}
		data = qs.stringify(data, { encode: false })
		const url = `https://auth.tado.com/oauth/token`

		axios.post(url, data)
			.then(async response => {
				if (response.data.access_token) {
					token = {
						key: response.data.access_token,
						expirationDate: new Date().getTime() + response.data.expires_in*1000
					}
					log.easyDebug('Token successfully acquired from tado° API')
					// log.easyDebug(token)
					resolve(token.key)
				} else {
					const error = `Could NOT complete the token request -> ERROR: "${response.data}"`
					log(error)
					reject(error)
				}
			})
			.catch(err => {
				const error = `Could NOT complete the token request -> ERROR: "${err.response.data.error_description || err.response.data.error}"`
				log(error)
				reject(error)
			})
	})
}

const get = {
	HomeId: async () => {
		if (settings.homeId) {
			log.easyDebug(`Got Home ID from Storage  >>> ${settings.homeId} <<<`)
			return settings.homeId
		}

		log.easyDebug(`Getting Home ID from tado° API`)
		const path = '/me'
		try {
			const response = await getRequest(path)
			settings.homeId = response.homes[0].id
			log.easyDebug(`Got Home ID from tado° API  >>> ${settings.homeId} <<<`)
			storage.setItem('settings', settings)
			return settings.homeId
		} catch (err) {
			log.easyDebug(`The plugin was not able to retrieve Home ID from tado° API !!`)
			throw err
		}
	},

	TemperatureUnit: async () => {
		if (settings.temperatureUnit) {
			log.easyDebug(`Got Temperature Unit from Storage  >>> ${settings.temperatureUnit} <<<`)
			return settings.temperatureUnit
		}

		log.easyDebug(`Getting Temperature Unit from tado° API`)
		const path = `/homes/${homeId}`
		try {
			const response = await getRequest(path)
			settings.temperatureUnit = response.temperatureUnit
			log.easyDebug(`Got Temperature Unit from tado° API  >>> ${settings.temperatureUnit} <<<`)
			storage.setItem('settings', settings)
			return settings.temperatureUnit
		} catch (err) {
			log.easyDebug(`The plugin was not able to retrieve Temperature Unit from tado° API !! Using Celsius`)
			settings.temperatureUnit = 'CELSIUS'
			return settings.temperatureUnit
		}
	},

	Zones: async () => {
		log.easyDebug(`Getting Zones from tado° API`)
		const path = `/homes/${homeId}/zones`
		try {
			const response = await getRequest(path)
			const zones = response.filter(zone => zone.type === 'AIR_CONDITIONING')
			settings.zones = zones
			log.easyDebug(`>>> Got Zones from tado° API`)
			// log.easyDebug(JSON.stringify(zones))
			storage.setItem('settings', settings)
			return zones
		} catch (err) {
			log.easyDebug(`The plugin was not able to retrieve Zones from tado° API !!`)
			if (settings.zones) {
				log.easyDebug(`Got Zones from storage  >>>`)
				log.easyDebug(JSON.stringify(settings.zones))
				return settings.zones
			}
			throw err
		}
	},

	Installations: async () => {
		log.easyDebug(`Getting Installations from tado° API`)
		const path = `/homes/${homeId}/installations`
		try {
			const response = await getRequest(path)
			const installations = {}
			response.forEach(installation => {
				if (installation.acInstallationInformation) {
					const zoneId = installation.acInstallationInformation.createdZone.id
					installations[zoneId] = installation.acInstallationInformation.selectedSetupBranch
				}
			})

			settings.installations = installations
			log.easyDebug(`Got Installations from tado° API  >>>`)
			log.easyDebug(JSON.stringify(installations))
			storage.setItem('settings', settings)
			return installations
		} catch (err) {
			log(err)
			log.easyDebug(`The plugin was not able to retrieve Installations from tado° API !!`)
			if (settings.installations) {
				log.easyDebug(`Got Installations from storage  >>>`)
				log.easyDebug(JSON.stringify(settings.installations))
				return settings.installations
			}
			return false
		}
	},

	ZoneCapabilities: async (zoneId) => {
		log.easyDebug(`Getting Zone Capabilities from tado° API`)
		const path = `/homes/${homeId}/zones/${zoneId}/capabilities`
		try {
			const capabilities = await getRequest(path)
			log.easyDebug(`>>> Got Zone ${zoneId} Capabilities from tado° API`)
			// log.easyDebug(JSON.stringify(capabilities))

			if (!settings.capabilities)
				settings.capabilities = {}

			settings.capabilities[zoneId] = capabilities
			storage.setItem('settings', settings)
			return capabilities
		} catch (err) {
			log.easyDebug(`The plugin was not able to retrieve Zone ${zoneId} Capabilities from tado° API !!`)
			if (settings.capabilities && settings.capabilities[zoneId]) {
				log.easyDebug(`Got Zone ${zoneId} Capabilities from storage  >>>`)
				log.easyDebug(JSON.stringify(settings.capabilities[zoneId]))
				return settings.capabilities[zoneId]
			}
			throw err
		}
	},

	State: async (zoneId) => {
		log.easyDebug(`Getting Zone state from tado° API`)
		const path = `/homes/${homeId}/zones/${zoneId}/state`
		try {
			const state = await getRequest(path)
			log.easyDebug(`>>> Got Zone ${zoneId} state from tado° API  >>>`)
			// log.easyDebug(JSON.stringify(state))

			if (!settings.states)
				settings.states = {}

			settings.states[zoneId] = state
			storage.setItem('settings', settings)
			return state
		} catch (err) {
			log.easyDebug(`The plugin was not able to retrieve Zone ${zoneId} state from tado° API !!`)
			if (settings.states && settings.states[zoneId]) {
				log.easyDebug(`Got Zone ${zoneId} state from storage  (NOT TO CRASH HOMEBRIDGE) >>>`)
				log.easyDebug(JSON.stringify(settings.states[zoneId]))
				return settings.states[zoneId]
			}
			throw err
		}
	}
}


text:
package info.dgjones.abora.gold.x;

import info.dgjones.abora.gold.java.AboraSupport;
import info.dgjones.abora.gold.java.missing.smalltalk.Set;
import info.dgjones.abora.gold.x.PrimValue;
import info.dgjones.abora.gold.xcvr.Rcvr;
import info.dgjones.abora.gold.xpp.basic.Heaper;

/**
 * A boxed representation of a primitive data type
 */
public class PrimValue extends Heaper {

/*
udanax-top.st:34696:
Heaper subclass: #PrimValue
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'X++ PrimArrays'!
*/
/*
udanax-top.st:34700:
PrimValue comment:
'A boxed representation of a primitive data type'!
*/
/*
udanax-top.st:34702:
(PrimValue getOrMakeCxxClassDescription)
	attributes: ((Set new) add: #ON.CLIENT; add: #DEFERRED; yourself)!
*/
/*
udanax-top.st:34706:
PrimValue class
	instanceVariableNames: ''!
*/
/*
udanax-top.st:34709:
(PrimValue getOrMakeCxxClassDescription)
	attributes: ((Set new) add: #ON.CLIENT; add: #DEFERRED; yourself)!
*/
public static void initializeClassAttributes() {
	AboraSupport.findAboraClass(PrimValue.class).setAttributes( new Set().add("ONCLIENT").add("DEFERRED"));
/*

Generated during transformation: AddMethod
*/
}
/**
 * {PrimSpec CLIENT} spec
 */
public static void infostProtocol() {
/*
udanax-top.st:34714:PrimValue class methodsFor: 'smalltalk: system'!
info.stProtocol
"{PrimSpec CLIENT} spec
"!
*/
}
public PrimValue() {
/*

Generated during transformation
*/
}
public PrimValue(Rcvr receiver) {
	super(receiver);
/*

Generated during transformation
*/
}
}


text:
var fs = require("fs");
var path = require("path");

function isExcluded(file, excludes) {
    var i, l;
    for (i = 0, l = excludes.length; i < l; ++i) {
        if (excludes[i].test(file)) {
            return true;
        }
    }

    return false;
}

function excludeRegExes(excludes) {
    if (!excludes) { return []; }

    return excludes.map(function (exclude) {
        if (typeof exclude === "string") {
            return new RegExp(exclude);
        } else {
            return exclude;
        }
    });
}

var walkTreeWithExcludes;

function fileProcessor(directory, excludes, callback) {
    return function (item) {
        var file = path.join(directory, item);

        fs.stat(file, function (err, stat) {
            if (err) { return callback(err); }
            if (!stat.isDirectory() || isExcluded(file, excludes)) { return; }
            callback(null, file);
            walkTreeWithExcludes(file, excludes, callback);
        });
    };
}

function walkTreeWithExcludes(directory, excludes, callback) {
    fs.readdir(directory, function (err, items) {
        if (err) { return callback(err); }
        items.forEach(fileProcessor(directory, excludes, callback));
    });
}

module.exports = {
    excludeRegExes: excludeRegExes,
    isExcluded: isExcluded,

    walkTree: function walkTree(directory, options, callback) {
        var opt = options, cb = callback;

        if (arguments.length === 2 && typeof options === "function") {
            cb = options;
            opt = null;
        }

        var excludes = excludeRegExes(opt && opt.exclude);
        walkTreeWithExcludes(directory, excludes, cb);
    }
};


text:
if [[ "$OSTYPE" =~ ^darwin ]]
then

  # Check for Homebrew
  if ! command -v brew >/dev/null;
  then
    echo "  You should have homebrew installed before installing ruby."
    exit
  fi

  if ! command -v rbenv >/dev/null;
  then
    echo "  Installing rbenv for you via homebrew."
    brew install rbenv > /tmp/rbenv-install.log
  fi

  if ! command -v ruby-build >/dev/null;
  then
    echo "  Installing ruby-build for you via homebrew."
    brew install ruby-build > /tmp/ruby-build-install.log
  fi

else
  if [[ -d ~/.rbenv ]]
  then
    cd ~/.rbenv && git pull --rebase origin master
  else
    git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
  fi
  if [[ -d ~/.rbenv/plugins/ruby-build ]]
  then
    cd ~/.rbenv/plugins/ruby-build && git pull --rebase origin master
  else
    git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
  fi
fi

if [[ -d ~/.rbenv ]]
then
  export PATH="$HOME/.rbenv/bin:$PATH"
  eval "$(rbenv init -)"
  rbenv rehash 2>/dev/null
fi


text:
class CreateResponses < ActiveRecord::Migration
  def change
    create_table :responses do |t|
      t.references :request
      t.references :system
      t.string :status
      t.references :modified_by
      t.timestamps
    end
  end
end


text:
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
COMMIT;
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE FOLDERS (folderid INTEGER PRIMARY KEY AUTOINCREMENT, folder_name varchar(255), time_created TEXT, last_edited TEXT);
CREATE TABLE files (fileid INTEGER PRIMARY KEY AUTOINCREMENT, file_name varchar(255), parent_folder_id INTEGER, time_created TEXT, last_edited TEXT, FOREIGN KEY(parent_folder_id) REFERENCES FOLDERS(folderid));
COMMIT;


text:
package backup

import (
	"github.com/corestoreio/pkg/config/cfgmodel"
	"github.com/corestoreio/pkg/config/element"
)

// Backend will be initialized in the init() function together with ConfigStructure.
var Backend *PkgBackend

// PkgBackend just exported for the sake of documentation. See fields
// for more information. The PkgBackend handles the reading and writing
// of configuration values within this package.
type PkgBackend struct {
	cfgmodel.PkgBackend
	// SystemBackupEnabled => Enable Scheduled Backup.
	// Path: system/backup/enabled
	// SourceModel: Magento\Config\Model\Config\Source\Yesno
	SystemBackupEnabled cfgmodel.Bool

	// SystemBackupType => Backup Type.
	// Path: system/backup/type
	// SourceModel: Magento\Backup\Model\Config\Source\Type
	SystemBackupType cfgmodel.Str

	// SystemBackupTime => Start Time.
	// Path: system/backup/time
	SystemBackupTime cfgmodel.Str

	// SystemBackupFrequency => Frequency.
	// Path: system/backup/frequency
	// BackendModel: Magento\Backup\Model\Config\Backend\Cron
	// SourceModel: Magento\Cron\Model\Config\Source\Frequency
	SystemBackupFrequency cfgmodel.Str

	// SystemBackupMaintenance => Maintenance Mode.
	// Please put your store into maintenance mode during backup.
	// Path: system/backup/maintenance
	// SourceModel: Magento\Config\Model\Config\Source\Yesno
	SystemBackupMaintenance cfgmodel.Bool
}

// NewBackend initializes the global Backend variable. See init()
func NewBackend(cfgStruct element.Sections) *PkgBackend {
	return (&PkgBackend{}).init(cfgStruct)
}

func (pp *PkgBackend) init(cfgStruct element.Sections) *PkgBackend {
	pp.Lock()
	defer pp.Unlock()
	pp.SystemBackupEnabled = cfgmodel.NewBool(`system/backup/enabled`, cfgmodel.WithFieldFromSectionSlice(cfgStruct))
	pp.SystemBackupType = cfgmodel.NewStr(`system/backup/type`, cfgmodel.WithFieldFromSectionSlice(cfgStruct))
	pp.SystemBackupTime = cfgmodel.NewStr(`system/backup/time`, cfgmodel.WithFieldFromSectionSlice(cfgStruct))
	pp.SystemBackupFrequency = cfgmodel.NewStr(`system/backup/frequency`, cfgmodel.WithFieldFromSectionSlice(cfgStruct))
	pp.SystemBackupMaintenance = cfgmodel.NewBool(`system/backup/maintenance`, cfgmodel.WithFieldFromSectionSlice(cfgStruct))

	return pp
}


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class voldemort.store.cachestore.CacheBlock (cachestore-storage 4.0.4 API)</title>
<meta name="date" content="2016-03-09">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
voldemort.store.cachestore.CacheBlock

Packages that use CacheBlock

Package
Description

voldemort.store.cachestore

voldemort.store.cachestore.impl

Uses of CacheBlock in voldemort.store.cachestore

Methods in voldemort.store.cachestore with parameters of type CacheBlock

Modifier and Type
Method and Description

static void
BlockUtil.checkVersion(CacheBlock block,
            Value value)

if value's version == 0, it will not perform checking, just increament current vrsion no
 otherwise it value's version against block's version , if it is less than block's version
 if it is greater than block's version, multiPuts block version to value's version

 throw a StoreException

static void
BlockUtil.copyBlock(CacheBlock src,
         CacheBlock dst)

copy the content of block from source to destination exception size2version info

static void
BlockUtil.copyBlock(CacheBlock src,
         CacheBlock dst)

copy the content of block from source to destination exception size2version info

void
BlockOps.removeBlock(CacheBlock<T> block)

void
BlockOps.writeExistBlock(CacheBlock<T> block)

void
BlockOps.writeNewBlock(CacheBlock<T> block,
             long keyoffset2Len,
             byte[] key)

Uses of CacheBlock in voldemort.store.cachestore.impl

Fields in voldemort.store.cachestore.impl with type parameters of type CacheBlock

Modifier and Type
Field and Description

protected ConcurrentMap<Key,CacheBlock>
CacheStore.map

protected Map<Key,CacheBlock<byte[]>>
SortedCacheStore.metaDataMap

Methods in voldemort.store.cachestore.impl that return CacheBlock

Modifier and Type
Method and Description

CacheBlock
WriteBackBlock.getBlock()

CacheBlock
DelayBlock.getBlock()

CacheBlock
CacheStore.makeBlock(int record,
         int blockSize,
         int dataLen,
         long version,
         short node)

Methods in voldemort.store.cachestore.impl that return types with arguments of type CacheBlock

Modifier and Type
Method and Description

ConcurrentMap<Key,CacheBlock>
CacheStore.getMap()

Methods in voldemort.store.cachestore.impl with parameters of type CacheBlock

Modifier and Type
Method and Description

ChannelStore
CacheStore.getChannel(CacheBlock block)

void
ChannelStore.removeBlock(CacheBlock<byte[]> block)

void
CacheStore.writeBack(CacheBlock block,
         Key key)

void
ChannelStore.writeExistBlock(CacheBlock<byte[]> block)

void
LogChannel.writeIndexBlock(CacheBlock<byte[]> block,
               long keyOffset2Len,
               FileChannel channel)

void
ChannelStore.writeIndexBlock(CacheBlock<byte[]> block,
               long keyOffset2Len,
               FileChannel channel)

void
LogChannel.writeNewBlock(CacheBlock<byte[]> block,
             long keyOffset2Len,
             byte[] key)

void
ChannelStore.writeNewBlock(CacheBlock<byte[]> block,
             long keyOffset2Len,
             byte[] key)

Constructors in voldemort.store.cachestore.impl with parameters of type CacheBlock

Constructor and Description

DelayBlock(CacheBlock block,
          Key key)

WriteBackBlock(T object,
              ReferenceQueue referenceQueue,
              CacheBlock block,
              Key key)

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2016. All rights reserved.


text:
'use strict';

var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var dashboardRoutes = require('./routes/dashboardRoutes');
var loadBalancerRoutes = require('./routes/loadbalancerRoutes');
var authenticateRoutes = require('./routes/authenticateRoutes');
var authorisationRoutes = require('./routes/authorisationRoutes');
var auditRoutes = require('./routes/auditRoutes');
var applicationRoutes = require('./routes/applicationRoutes');
var featureRoutes = require('./routes/featureRoutes');
var path = require('path');
var acl = require('./acl');
var config = require('./../config/config.json');
var _ = require('underscore');
var passport = require('./auth').init(config);

app.set('views', path.join(__dirname, '/../client/views'));
app.set('view engine', 'pug');
app.set('port', process.env.PORT || 3006);

app.use(express.json());       // to support JSON-encoded bodies
app.use(express.urlencoded()); // to support URL-encoded bodies
app.use(express.favicon());

if (config.loggingMiddleware && config.loggingMiddleware.path) {
    app.use(require(config.loggingMiddleware.path)(config.loggingMiddleware.settings));
} else {
    app.use(express.logger('dev'));
}

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));

app.use(express.cookieParser('featuretoggle'));
app.use(require('./session').init(config, express));
app.use(passport.initialize());
app.use(passport.session());
app.use(app.router);

app.use(express.static(path.join(__dirname, '/../public')));
app.use('/bower_components', express.static(path.join(__dirname, '/../public/bower_components')));

app.get('/_lbstatus', loadBalancerRoutes.lbstatus);
app.get('/service-status', function (req, res) {
    res.status(200).end();
});

var isAuthenticated = function (req) {
    return !config.RequiresAuth || req.isAuthenticated();
};

var ensureAuthenticatedOrRedirectToLogin = function (req, res, next) {
    if (isAuthenticated(req)) {
        return next();
    }
    res.redirect('/login');
};

var ensureAuthenticated = function (req, res, next) {
    if (isAuthenticated(req)) {
        return next();
    }
    res.send(403);
};

var authoriseUserForThisApplication = function (req, res, next) {
    if (!config.RequiresAuth) {
        next();
        return;
    }

    var applicationName = req.params.applicationName;
    var userEmail = req.user._json.email;

    acl.assert(userEmail, applicationName, function (err, isAuthorised) {
        if (err || !isAuthorised) {
            res.send(403);
        } else {
            next();
        }
    });
};

var passportGoogleAuthenticateParams = function () {
    var defaultParams = {
        scope: ['https://www.googleapis.com/auth/userinfo.profile', 'https://www.googleapis.com/auth/userinfo.email']
    };

    var conf = (config.AuthProviders && config.AuthProviders.GoogleAuth && config.AuthProviders.GoogleAuth.authentication) || {};

    return _.extend(defaultParams, conf);
};

app.use(express.static(path.join(__dirname, '/../client')));
app.get('/login', authenticateRoutes.login);
app.get('/', ensureAuthenticatedOrRedirectToLogin, dashboardRoutes.dashboard);
app.get('/partials/:name', dashboardRoutes.partials);
app.get('/logout', authenticateRoutes.logout);

app.get('/auth/google',
    passport.authenticate('google', passportGoogleAuthenticateParams()),
    function (req, res) {
        // The request will be redirected to Google for authentication
    }
);

app.get('/auth/google/callback',
    passport.authenticate('google', {failureRedirect: '/oops', failureFlash: true}),
    function (req, res) {
        res.redirect('/#!/');
    }
);

app.get('/auth/azureadoauth2',
  passport.authenticate('azure')
);

app.get('/auth/azureadoauth2/callback',
  passport.authenticate('azure', { failureRedirect: '/oops' }),
  function (req, res) {
    // Successful authentication, redirect home.
    res.redirect('/');
  });

if (config.plugin && config.plugin.path) {
    require(config.plugin.path)(app);
}

app.post('/api/applications/:applicationName/users', ensureAuthenticated, authoriseUserForThisApplication, authorisationRoutes.grant);
app.get('/api/applications/:applicationName/users', authorisationRoutes.getUsers);
app.delete('/api/applications/:applicationName/users/:userEmail', ensureAuthenticated, authoriseUserForThisApplication, authorisationRoutes.revoke);
app.get('/api/applications/:applicationName/users/:userEmail', authorisationRoutes.assert);

applicationRoutes.registerRoutes(app, ensureAuthenticated);
featureRoutes.registerRoutes(app, ensureAuthenticated, authoriseUserForThisApplication);

app.get('/api/audit/feature/:applicationName/:featureName', auditRoutes.getFeatureAuditTrail);
app.get('/api/audit/application/:applicationName', auditRoutes.getApplicationAuditTrail);

console.log('Starting up feature toggle dashboard on port ' + app.get('port'));

app.listen(app.get('port'));


text:
/*
 * 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.
 */
package com.facebook.presto.metadata;

import com.facebook.presto.operator.aggregation.InternalAggregationFunction;
import com.facebook.presto.operator.scalar.ScalarFunctionImplementation;
import com.facebook.presto.operator.window.WindowFunctionSupplier;
import com.facebook.presto.spi.function.OperatorType;
import com.facebook.presto.spi.type.Type;
import com.facebook.presto.spi.type.TypeSignature;
import com.facebook.presto.sql.analyzer.TypeSignatureProvider;
import com.facebook.presto.sql.tree.QualifiedName;

import javax.annotation.concurrent.ThreadSafe;

import java.util.List;

import static java.util.Objects.requireNonNull;

@ThreadSafe
class FunctionNamespace
{
    private final FunctionRegistry registry;

    public FunctionNamespace(FunctionRegistry registry)
    {
        this.registry = requireNonNull(registry, "registry is null");
    }

    public void addFunctions(List<? extends SqlFunction> functions)
    {
        registry.addFunctions(functions);
    }

    public List<SqlFunction> listFunctions()
    {
        return registry.list();
    }

    public Signature resolveFunction(QualifiedName name, List<TypeSignatureProvider> parameterTypes)
    {
        return registry.resolveFunction(name, parameterTypes);
    }

    public WindowFunctionSupplier getWindowFunctionImplementation(Signature signature)
    {
        return registry.getWindowFunctionImplementation(signature);
    }

    public InternalAggregationFunction getAggregateFunctionImplementation(Signature signature)
    {
        return registry.getAggregateFunctionImplementation(signature);
    }

    public ScalarFunctionImplementation getScalarFunctionImplementation(Signature signature)
    {
        return registry.getScalarFunctionImplementation(signature);
    }

    public boolean isAggregationFunction(QualifiedName name)
    {
        return registry.isAggregationFunction(name);
    }

    public boolean canResolveOperator(OperatorType operatorType, Type returnType, List<? extends Type> argumentTypes)
    {
        return registry.canResolveOperator(operatorType, returnType, argumentTypes);
    }

    public Signature resolveOperator(OperatorType operatorType, List<? extends Type> argumentTypes)
            throws OperatorNotFoundException
    {
        return registry.resolveOperator(operatorType, argumentTypes);
    }

    public Signature getCoercion(TypeSignature fromType, TypeSignature toType)
    {
        return registry.getCoercion(fromType, toType);
    }

    public boolean isRegistered(Signature signature)
    {
        return registry.isRegistered(signature);
    }
}


text:
package org.tools.hqlbuilder.common;

import java.awt.image.BufferedImage;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;

public class HqlBuilderImages {
    public static final String LOGO = "hql-builder-logo.png";

    public static final String ICON16 = "bricks-icon.png";

    public static ImageIcon getIcon() {
        return new ImageIcon(HqlBuilderImages.class.getClassLoader().getResource(ICON16));
    }

    public static BufferedImage getLogo() throws IOException {
        return ImageIO.read(HqlBuilderImages.class.getClassLoader().getResource(LOGO));
    }
}


text:
ArcGIS GeoEvent Extension for Server utility to monitor the number of messages waiting to be processed by GeoEvent Services and outputs.
This application is a JavaFX application that connects to the local GeoEvent Extension through JMX and displays current message backlog counts of message buffers.

![App](backlog-for-geoevent.png?raw=true)

## Instructions

Building the source code:

1. Open a command prompt in the directory containing the pom.xml file.
2. Make sure JavaFX is on the classpath with this command "mvn com.zenjava:javafx-maven-plugin:2.0:fix-classpath"   (for details on this, see http://zenjava.com/javafx/maven/fix-classpath.html)
3. Build the application - "mvn clean jfx:jar" which creates a jar file in target/jfx/app.
4. Now you can run the executable jar file by going to the folder where the jar file is, and running "java -jar <jarfile>"

## Requirements

* ArcGIS GeoEvent Extension for Server.
* Java JDK 1.7 or greater.
* JavaFX.
* Maven.

## Usage

The lines on the display represent the number of messages in each backlog.  Over time, the backlog should not be growing.  There might be temporary
"spikes" in the graph when a burst of messages come in, and the server processes the messages.  However, if one of the lines is consistently growing,
then the server is not likely to recover, and it will eventually run out of resources.

Following is a healthy server example:

![alt text](healthy.png?raw=true)

Following is an unhealthy server example:

![alt text](unhealthy.png?raw=true)

## Resources

* [ArcGIS GeoEvent Extension for Server Resources](http://links.esri.com/geovent)
* [ArcGIS Blog](http://blogs.esri.com/esri/arcgis/)
* [twitter@esri](http://twitter.com/esri)

## Issues

Find a bug or want to request a new feature?  Please let us know by submitting an issue.

## Contributing

Esri welcomes contributions from anyone and everyone. Please see our [guidelines for contributing](https://github.com/esri/contributing).

## Licensing
Copyright 2013 Esri

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.

A copy of the license is available in the repository's [license.txt](license.txt?raw=true) file.


text:
require "warden"
require "dynamic_form"
module Tenant
  class Engine < ::Rails::Engine
    isolate_namespace Tenant
    config.generators do |g|
      g.test_framework :rspec, :view_specs => false
    end

    initializer "tenant.middleware.warden" do
      Rails.application.config.middleware.use Warden::Manager do |manager|
        manager.default_strategies :password

        manager.serialize_into_session do |user|
          user.id
        end

        manager.serialize_from_session do |id|
          Tenant::User.find(id)
        end
      end
    end

  end
end