text:
title: Get involved
category: community
authors: beni, dneary, mrunge, rbowen, strider, dmsimard
wiki_category: Community
wiki_title: Get involved
wiki_revision_count: 49
wiki_last_updated: 2015-08-10
---

# Get Involved

Help us make the RDO community site a great place for users and cloud operators in the Red Hat ecosystem by sharing your OpenStack questions and solutions on [ask.openstack](http://ask.openstack.org), and by adding [the most useful solutions](/troubleshooting/) and [user stories](/user-stories/) to the RDO website.

Our community strives to operate according to the terms of the
[OpenStack Code of Conduct](https://www.openstack.org/legal/community-code-of-conduct/).

1. toc
{:toc}

## Discuss

Come chat in real-time with RDO users on **IRC** on the [Freenode](http://freenode.net) server:

* **#rdo**: Discussion around RDO in general
* **#rdo-puppet**: Discussion around deploying RDO with Packstack and it's puppet modules
* **#openstack**: Discussion around OpenStack with the broader OpenStack community
* **#centos-devel**: Discussion around the CentOS [Cloud Special Interest Group (SIG)](https://wiki.centos.org/SpecialInterestGroup/Cloud)

We have weekly IRC meetings you can participate in:

* [RDO meetings @ every Wednesday at 15:00 UTC on #rdo](/community/community-meeting)
* [CentOS Cloud SIG meetings @ every Thursday at 15:00 UTC on #centos-devel](/community/cloud-sig-meeting)

Join us for various [Events](/events/) around the world. [Organize-a-meetup](/community/organize-a-meetup/).

## Stay Informed

Follow us on Twitter at [@rdocommunity](//twitter.com/rdocommunity), on [Google+](https://plus.google.com/communities/110409030763231732154), or on [Facebook](https://www.facebook.com/rdocommunity), as you prefer.

[Tweets by RDOcommunity](https://twitter.com/RDOcommunity){:.twitter-timeline data-widget-id="482610699122638848" data-height="425"}
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src='//platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>

Join our [newsletter mailing list](//www.redhat.com/mailman/listinfo/rdo-newsletter) for monthly updates on RDO and the larger OpenStack world.

## Ask and Answer

- Check our [Frequently Asked Questions (FAQ) page](/rdo/faq/) for answers to common questions
- Try our [troubleshooting page](/troubleshooting/) for solutions to common problems
- Join the ask.openstack community to ask and answer questions:

The site [ask.openstack](http://ask.openstack.org) is the upstream Q&A for all manner of OpenStack issues.

- Search [ask.openstack](http://ask.openstack.org) to find previous discussions on the topic.
- If you ask a new question, consider adding the tag "rdo" to it. You can use [this link to add a new question with this tag](https://ask.openstack.org/en/questions/ask/?tags=rdo).
- [Find all questions on ask.openstack related to RDO](https://ask.openstack.org/en/questions/scope:all/sort:age-desc/page:1/query:rdo/).
- If you're a frequent poster on ask.openstack and wish to identify yourself as part of the RDO community, consider adding the RDO logo to your avatar, like Lars: [https://ask.openstack.org/en/users/1745/larsks/](https://ask.openstack.org/en/users/1745/larsks/) .

- Help improve our knowledge base by turning the best answers to questions on the [mailing lists](/community/mailing-lists/) or on [ask.openstack.org](http://ask.openstack.org) into a page in our [troubleshooting section](/troubleshooting/). In case of ask.openstack.org, a link might be sufficient.
- Blog about how you're using RDO. If you blog frequently about RDO and OpenStack, consider [requesting that your blog be added](https://wiki.openstack.org/wiki/AddingYourBlog) to the upstream [Planet OpenStack](http://planet.openstack.org/).
- [Fork the website on Github](https://github.com/redhat-openstack/website) and help us improve our documentation.

## Report

An important way that you can contribute to RDO is by reporting any
problems you encounter.

To file bugs against RDO, use the [RDO bugzilla](https://bugzilla.redhat.com/enter_bug.cgi?product=RDO).

To report problems with this website, use the [tracker on
GitHub](https://github.com/redhat-openstack/website/issues).

If you're not sure where the problem likes
[ask.openstack.org](http://ask.openstack.org/) is the best place to
start.

## Contribute

RDO is a large community interested in packaging and deploying [OpenStack](http://www.openstack.org) on RHEL and its derivatives.

We can always use your feedback and contributions to make RDO better.

### Packaging

Get started by looking at the [RDO Packaging documentation](https://www.rdoproject.org/packaging/rdo-packaging.html), taking a glance at our [packages](https://github.com/openstack-packages) and help with [patch reviews](https://review.gerrithub.io/#/q/status:open+project:^openstack-packages/.*,n,z).

### Installers

Packages provided by RDO to install and configure OpenStack are available through several projects which could all use your help:

* [Packstack](https://github.com/openstack/packstack)
* [Packaged openstack-puppet-modules](https://github.com/redhat-openstack/openstack-puppet-modules) and [upstream Puppet Modules](https://wiki.openstack.org/wiki/Puppet)
* [Triple-O](https://wiki.openstack.org/wiki/TripleO)
* [Kolla](https://github.com/openstack/kolla)

### Docs and Website

Help improve the documentation and website! The main pages for contributed content are [documentation](/documentation/), [troubleshooting](/troubleshooting/) and [user stories](/user-stories/).

* Take a look at the open issues list: [https://github.com/redhat-openstack/website/issues](https://github.com/redhat-openstack/website/issues)
* Update this or another page by submitting pull requests to the [https://github.com/redhat-openstack/website](https://github.com/redhat-openstack/website) repo, or by clicking the `Edit on Github` banner at the top right.
* Fork the whole website: [https://github.com/redhat-openstack/website](https://github.com/redhat-openstack/website)

Here are a few guidelines for contributing new content to the website:

*   Please [search](/search/) first to check if there is a similar page which you can update.
*   Use normal English case for page names. [Running an instance](Running an instance) is correct, [Get Involved](Get Involved) is not.
*   Please keep the website content connected! When you add a new page, add a link to it from the appropriate page(s).
*   Please be aware of our [terms of use](terms of use) — among other things, you agree to license your contributions under the [Creative Commons Attribution License version 3.0](http://creativecommons.org/licenses/by/3.0/), and you agree not to submit illegal content.


text:
<!DOCTYPE html>

    <title>Types Class Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset='utf-8'>

Sourcery Docs (100% documented)

View on GitHub

        Sourcery Reference

        Types Class Reference

            Guides

                Installing

                Usage

                Writing templates

            Examples

                Equatable

                Hashable

                Enum cases

                Lenses

                Mocks

                Diffable

                LinuxMain

                Decorator

            Types

                Types

                Type

                Protocol

                Class

                Struct

                Enum

                EnumCase

                AssociatedValue

                Variable

                Method

                MethodParameter

                TypeName

                TupleType

                TupleElement

                ArrayType

                DictionaryType

                ClosureType

                Attribute

            Other Extensions

                Typealias

            Other Protocols

                Annotated

                Definition

                Typed

Types

public final class Types: NSObject, SourceryModel

Collection of scanned types for accessing in templates

                    all

All known types, excluding protocols

Declaration

Swift

public lazy internal(set) var all: [Type] =

                    protocols

All known protocols

Declaration

Swift

public lazy internal(set) var protocols: [Protocol] =

                    classes

All known classes

Declaration

Swift

public lazy internal(set) var classes: [Class] =

                    structs

All known structs

Declaration

Swift

public lazy internal(set) var structs: [Struct] =

                    enums

All known enums

Declaration

Swift

public lazy internal(set) var enums: [Enum] =

                    extensions

All known extensions

Declaration

Swift

public lazy internal(set) var extensions: [Type] =

                    based

Types based on any other type, grouped by its name, even if they are not known.
types.based.MyType returns list of types based on MyType

Declaration

Swift

public lazy internal(set) var based: TypesCollection =

                    inheriting

Classes inheriting from any known class, grouped by its name.
types.inheriting.MyClass returns list of types inheriting from MyClass

Declaration

Swift

public lazy internal(set) var inheriting: TypesCollection =

                    implementing

Types implementing known protocol, grouped by its name.
types.implementing.MyProtocol returns list of types implementing MyProtocol

Declaration

Swift

public lazy internal(set) var implementing: TypesCollection =

Copyright © 2016 Pixle. All rights reserved.

Generated by jazzy ♪♫ v0.8.2, a Realm project.

redpajama_set_name: RedPajamaGithub


text:
from symengine.utilities import raises

from symengine import Integer, I, S, Symbol, pi, Rational
from symengine.lib.symengine_wrapper import (perfect_power, is_square, integer_nthroot)

def test_integer():
    i = Integer(5)
    assert str(i) == "5"
    assert int(i) == 5
    assert float(i) == 5.0
    assert complex(i) == 5.0 + 0j
    assert i.real == i
    assert i.imag == S.Zero

def test_integer_long():
    py_int = 123434444444444444444
    i = Integer(py_int)
    assert str(i) == str(py_int)
    assert int(i) == py_int

def test_integer_string():
    assert Integer("133") == 133

def test_rational():
    i = Integer(5)/10
    assert str(i) == "1/2"
    assert int(i) == 0
    assert float(i) == 0.5
    assert complex(i) == 0.5 + 0j
    assert i.real == i
    assert i.imag == S.Zero

def test_complex():
    i = Integer(5)/10 + I
    assert str(i) == "1/2 + I"
    assert complex(i) == 0.5 + 1j
    assert i.real == Integer(1)/2
    assert i.imag == 1

    i = 0.5 + I
    assert str(i) == "0.5 + 1.0*I"
    assert complex(i) == 0.5 + 1j
    assert i.real == 0.5
    assert i.imag == 1.0

def test_smallfloat_valid():
    i = Integer(7.5)
    assert str(i) == "7"

def test_bigfloat_valid():
    i = Integer(13333333333333334.5)
    assert str(i) == "13333333333333334"

def test_is_conditions():
    i = Integer(-123)
    assert not i.is_zero
    assert not i.is_positive
    assert i.is_negative
    assert i.is_nonzero
    assert i.is_nonpositive
    assert not i.is_nonnegative
    assert not i.is_complex

    i = Integer(123)
    assert not i.is_zero
    assert i.is_positive
    assert not i.is_negative
    assert i.is_nonzero
    assert not i.is_nonpositive
    assert i.is_nonnegative
    assert not i.is_complex

    i = Integer(0)
    assert i.is_zero
    assert not i.is_positive
    assert not i.is_negative
    assert not i.is_nonzero
    assert i.is_nonpositive
    assert i.is_nonnegative
    assert not i.is_complex

    i = Integer(1) + I
    assert not i.is_zero
    assert not i.is_positive
    assert not i.is_negative
    assert not i.is_nonzero
    assert not i.is_nonpositive
    assert not i.is_nonnegative
    assert i.is_complex

    assert pi.is_number

def test_perfect_power():
    assert perfect_power(1) == True
    assert perfect_power(7) == False
    assert perfect_power(8) == True
    assert perfect_power(9) == True
    assert perfect_power(10) == False
    assert perfect_power(1024) == True
    assert perfect_power(1025) == False
    assert perfect_power(6**7) == True
    assert perfect_power(-27) == True
    assert perfect_power(-64) == True
    assert perfect_power(-32) == True

def test_perfect_square():
    assert is_square(7) == False
    assert is_square(8) == False
    assert is_square(9) == True
    assert is_square(10) == False
    assert perfect_power(49) == True
    assert perfect_power(50) == False

def test_integer_nthroot():
    assert integer_nthroot(1, 2) == (1, True)
    assert integer_nthroot(1, 5) == (1, True)
    assert integer_nthroot(2, 1) == (2, True)
    assert integer_nthroot(2, 2) == (1, False)
    assert integer_nthroot(2, 5) == (1, False)
    assert integer_nthroot(4, 2) == (2, True)
    assert integer_nthroot(123**25, 25) == (123, True)
    assert integer_nthroot(123**25 + 1, 25) == (123, False)
    assert integer_nthroot(123**25 - 1, 25) == (122, False)
    assert integer_nthroot(1, 1) == (1, True)
    assert integer_nthroot(0, 1) == (0, True)
    assert integer_nthroot(0, 3) == (0, True)
    assert integer_nthroot(10000, 1) == (10000, True)
    assert integer_nthroot(4, 2) == (2, True)
    assert integer_nthroot(16, 2) == (4, True)
    assert integer_nthroot(26, 2) == (5, False)
    assert integer_nthroot(1234567**7, 7) == (1234567, True)
    assert integer_nthroot(1234567**7 + 1, 7) == (1234567, False)
    assert integer_nthroot(1234567**7 - 1, 7) == (1234566, False)
    b = 25**1000
    assert integer_nthroot(b, 1000) == (25, True)
    assert integer_nthroot(b + 1, 1000) == (25, False)
    assert integer_nthroot(b - 1, 1000) == (24, False)
    c = 10**400
    c2 = c**2
    assert integer_nthroot(c2, 2) == (c, True)
    assert integer_nthroot(c2 + 1, 2) == (c, False)
    assert integer_nthroot(c2 - 1, 2) == (c - 1, False)

def test_is_zero():
    assert Symbol('x').is_zero is None

def test_is_positive():
    assert Rational(1, 2).is_positive
    assert not Rational(-2, 3).is_positive
    assert Symbol('x').is_positive is None

def test_is_negative():
    assert not Rational(1, 2).is_negative
    assert Rational(-2, 3).is_negative
    assert Symbol('x').is_negative is None

def test_is_nonpositive():
    assert not Rational(1, 2).is_nonpositive
    assert Rational(-2, 3).is_nonpositive
    assert Symbol('x').is_nonpositive is None

def test_is_nonnegative():
    assert Rational(1, 2).is_nonnegative
    assert not Rational(-2, 3).is_nonnegative
    assert Symbol('x').is_nonnegative is None

def test_is_real():
    assert Rational(1, 2).is_real
    assert Symbol('x').is_real is None


text:
/**
 * @class Ext.util.Floating
 * A mixin to add floating capability to a Component
 */
Ext.define('Ext.util.Floating', {

    uses: ['Ext.Layer', 'Ext.window.Window'],

    /**
     * @cfg {Boolean} focusOnToFront
     * Specifies whether the floated component should be automatically {@link #focus focused} when it is
     * {@link #toFront brought to the front}. Defaults to true.
     */
    focusOnToFront: true,

    /**
     * @cfg {String/Boolean} shadow Specifies whether the floating component should be given a shadow. Set to
     * <tt>true</tt> to automatically create an {@link Ext.Shadow}, or a string indicating the
     * shadow's display {@link Ext.Shadow#mode}. Set to <tt>false</tt> to disable the shadow.
     * (Defaults to <tt>'sides'</tt>.)
     */
    shadow: 'sides',

    constructor: function(config) {
        this.floating = true;
        this.el = Ext.create('Ext.Layer', Ext.apply({}, config, {
            hideMode: this.hideMode,
            hidden: this.hidden,
            shadow: Ext.isDefined(this.shadow) ? this.shadow : 'sides',
            shadowOffset: this.shadowOffset,
            constrain: false,
            shim: this.shim === false ? false : undefined
        }), this.el);
    },

    onFloatRender: function() {
        var me = this;
        me.zIndexParent = me.getZIndexParent();
        me.setFloatParent(me.ownerCt);
        delete me.ownerCt;

        if (me.zIndexParent) {
            me.zIndexParent.registerFloatingItem(me);
        } else {
            Ext.WindowManager.register(me);
        }
    },

    setFloatParent: function(floatParent) {
        var me = this;

        // Remove listeners from previous floatParent
        if (me.floatParent) {
            me.mun(me.floatParent, {
                hide: me.onFloatParentHide,
                show: me.onFloatParentShow,
                scope: me
            });
        }

        me.floatParent = floatParent;

        // Floating Components as children of Containers must hide when their parent hides.
        if (floatParent) {
            me.mon(me.floatParent, {
                hide: me.onFloatParentHide,
                show: me.onFloatParentShow,
                scope: me
            });
        }

        // If a floating Component is configured to be constrained, but has no configured
        // constrainTo setting, set its constrainTo to be it's ownerCt before rendering.
        if ((me.constrain || me.constrainHeader) && !me.constrainTo) {
            me.constrainTo = floatParent ? floatParent.getTargetEl() : me.container;
        }
    },

    onFloatParentHide: function() {
        if (this.hideOnParentHide !== false) {
            this.showOnParentShow = this.isVisible();
            this.hide();
        }
    },

    onFloatParentShow: function() {
        if (this.showOnParentShow) {
            delete this.showOnParentShow;
            this.show();
        }
    },

    /**
     * @private
     *
Finds the ancestor Container responsible for allocating zIndexes for the passed Component.

     *
That will be the outermost floating Container (a Container which has no ownerCt and has floating:true).

     *
If we have no ancestors, or we walk all the way up to the document body, there's no zIndexParent,
     * and the global Ext.WindowManager will be used.

     */
    getZIndexParent: function() {
        var p = this.ownerCt,
            c;

        if (p) {
            while (p) {
                c = p;
                p = p.ownerCt;
            }
            if (c.floating) {
                return c;
            }
        }
    },

    // private
    // z-index is managed by the zIndexManager and may be overwritten at any time.
    // Returns the next z-index to be used.
    // If this is a Container, then it will have rebased any managed floating Components,
    // and so the next available z-index will be approximately 10000 above that.
    setZIndex: function(index) {
        var me = this;
        this.el.setZIndex(index);

        // Next item goes 10 above;
        index += 10;

        // When a Container with floating items has its z-index set, it rebases any floating items it is managing.
        // The returned value is a round number approximately 10000 above the last z-index used.
        if (me.floatingItems) {
            index = Math.floor(me.floatingItems.setBase(index) / 100) * 100 + 10000;
        }
        return index;
    },

    /**
     *
Moves this floating Component into a constrain region.

     *
By default, this Component is constrained to be within the container it was added to, or the element
     * it was rendered to.

     *
An alternative constraint may be passed.

     * @param {Mixed} constrainTo Optional. The Element or {@link Ext.util.Region Region} into which this Component is to be constrained.
     */
    doConstrain: function(constrainTo) {
        var me = this,
            vector = me.getConstrainVector(constrainTo),
            xy;

        if (vector) {
            xy = me.getPosition();
            xy[0] += vector[0];
            xy[1] += vector[1];
            me.setPosition(xy);
        }
    },

    /**
     * Gets the x/y offsets to constrain this float
     * @private
     * @param {Mixed} constrainTo Optional. The Element or {@link Ext.util.Region Region} into which this Component is to be constrained.
     * @return {Array} The x/y constraints
     */
    getConstrainVector: function(constrainTo){
        var me = this,
            el;

        if (me.constrain || me.constrainHeader) {
            el = me.constrainHeader ? me.header.el : me.el;
            constrainTo = constrainTo || (me.floatParent && me.floatParent.getTargetEl()) || me.container;
            return el.getConstrainVector(constrainTo);
        }
    },

    /**
     * Aligns this floating Component to the specified element
     * @param {Mixed} element The element or {@link Ext.Component} to align to. If passing a component, it must
     * be a omponent instance. If a string id is passed, it will be used as an element id.
     * @param {String} position (optional, defaults to "tl-bl?") The position to align to (see {@link Ext.core.Element#alignTo} for more details).
     * @param {Array} offsets (optional) Offset the positioning by [x, y]
     * @return {Component} this
     */
    alignTo: function(element, position, offsets) {
        if (element.isComponent) {
            element = element.getEl();
        }
        var xy = this.el.getAlignToXY(element, position, offsets);
        this.setPagePosition(xy);
        return this;
    },

    /**
     *
Brings this floating Component to the front of any other visible, floating Components managed by the same {@link Ext.ZIndexManager ZIndexManager}

     *
If this Component is modal, inserts the modal mask just below this Component in the z-index stack.

     * @param {Boolean} preventFocus (optional) Specify true to prevent the Component from being focused.
     * @return {Component} this
     */
    toFront: function(preventFocus) {
        var me = this;

        // Find the floating Component which provides the base for this Component's zIndexing.
        // That must move to front to then be able to rebase its zIndex stack and move this to the front
        if (me.zIndexParent) {
            me.zIndexParent.toFront(true);
        }
        if (me.zIndexManager.bringToFront(me)) {
            if (!Ext.isDefined(preventFocus)) {
                preventFocus = !me.focusOnToFront;
            }
            if (!preventFocus) {
                // Kick off a delayed focus request.
                // If another floating Component is toFronted before the delay expires
                // this will not receive focus.
                me.focus(false, true);
            }
        }
        return me;
    },

    /**
     *
This method is called internally by {@link Ext.ZIndexManager} to signal that a floating
     * Component has either been moved to the top of its zIndex stack, or pushed from the top of its zIndex stack.

     *
If a Window is superceded by another Window, deactivating it hides its shadow.

     *
This method also fires the {@link #activate} or {@link #deactivate} event depending on which action occurred.

     * @param {Boolean} active True to activate the Component, false to deactivate it (defaults to false)
     * @param {Component} newActive The newly active Component which is taking over topmost zIndex position.
     */
    setActive: function(active, newActive) {
        if (active) {
            if ((this instanceof Ext.window.Window) && !this.maximized) {
                this.el.enableShadow(true);
            }
            this.fireEvent('activate', this);
        } else {
            // Only the *Windows* in a zIndex stack share a shadow. All other types of floaters
            // can keep their shadows all the time
            if ((this instanceof Ext.window.Window) && (newActive instanceof Ext.window.Window)) {
                this.el.disableShadow();
            }
            this.fireEvent('deactivate', this);
        }
    },

    /**
     * Sends this Component to the back of (lower z-index than) any other visible windows
     * @return {Component} this
     */
    toBack: function() {
        this.zIndexManager.sendToBack(this);
        return this;
    },

    /**
     * Center this Component in its container.
     * @return {Component} this
     */
    center: function() {
        var xy = this.el.getAlignToXY(this.container, 'c-c');
        this.setPagePosition(xy);
        return this;
    },

    // private
    syncShadow : function(){
        if (this.floating) {
            this.el.sync(true);
        }
    },

    // private
    fitContainer: function() {
        var parent = this.floatParent,
            container = parent ? parent.getTargetEl() : this.container,
            size = container.getViewSize(false);

        this.setSize(size);
    }
});


text:
package com.pedroarthursimao.masterapp.sqlite;

import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class SimpleOpenHelper extends SQLiteOpenHelper{

    public static final String DB_NAME = "test.sqlite";
    public static final int DB_VERSION = 1;

    public SimpleOpenHelper(Context context) {
        super(context, DB_NAME, null, DB_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("CREATE TABLE test ( `_id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, `sometext` TEXT NULL)");
        ContentValues cv = new ContentValues();
        cv.put("sometext", "Value 1");
        db.insert("test", null, cv);
        Log.i("CREATE SQLITE", "Successfully created!");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {}

}


text:
/*
 * Block data types and constants.  Directly include this file only to
 * break include dependency loop.
 */
#ifndef __LINUX_BLK_TYPES_H
#define __LINUX_BLK_TYPES_H

#ifdef CONFIG_BLOCK

#include <linux/types.h>

struct bio_set;
struct bio;
struct bio_integrity_payload;
struct page;
struct block_device;
struct io_context;
struct cgroup_subsys_state;
typedef void (bio_end_io_t) (struct bio *, int);
typedef void (bio_destructor_t) (struct bio *);

/*
 * was unsigned short, but we might as well be ready for > 64kB I/O pages
 */
struct bio_vec {
	struct page	*bv_page;
	unsigned int	bv_len;
	unsigned int	bv_offset;
};

struct bvec_iter {
	sector_t		bi_sector;	/* device address in 512 byte
						   sectors */
	unsigned int		bi_size;	/* residual I/O count */

	unsigned int		bi_idx;		/* current index into bvl_vec */

	unsigned int            bi_bvec_done;	/* number of bytes completed in
						   current bvec */
};

/*
 * main unit of I/O for the block layer and lower layers (ie drivers and
 * stacking drivers)
 */
struct bio {
	struct bio		*bi_next;	/* request queue link */
	struct block_device	*bi_bdev;
	unsigned long		bi_flags;	/* status, command, etc */
	unsigned long		bi_rw;		/* bottom bits READ/WRITE,
						 * top bits priority
						 */

	struct bvec_iter	bi_iter;

	/* Number of segments in this BIO after
	 * physical address coalescing is performed.
	 */
	unsigned int		bi_phys_segments;

	/*
	 * To keep track of the max segment size, we account for the
	 * sizes of the first and last mergeable segments in this bio.
	 */
	unsigned int		bi_seg_front_size;
	unsigned int		bi_seg_back_size;

	atomic_t		bi_remaining;

	bio_end_io_t		*bi_end_io;

	void			*bi_private;
#ifdef CONFIG_BLK_CGROUP
	/*
	 * Optional ioc and css associated with this bio.  Put on bio
	 * release.  Read comment on top of bio_associate_current().
	 */
	struct io_context	*bi_ioc;
	struct cgroup_subsys_state *bi_css;
#endif
#if defined(CONFIG_BLK_DEV_INTEGRITY)
	struct bio_integrity_payload *bi_integrity;  /* data integrity */
#endif

	unsigned short		bi_vcnt;	/* how many bio_vec's */

	/*
	 * Everything starting with bi_max_vecs will be preserved by bio_reset()
	 */

	unsigned short		bi_max_vecs;	/* max bvl_vecs we can hold */

	atomic_t		bi_cnt;		/* pin count */

	struct bio_vec		*bi_io_vec;	/* the actual vec list */

	struct bio_set		*bi_pool;

	/*
	 * We can inline a number of vecs at the end of the bio, to avoid
	 * double allocations for a small number of bio_vecs. This member
	 * MUST obviously be kept at the very end of the bio.
	 */
	struct bio_vec		bi_inline_vecs[0];
};

#define BIO_RESET_BYTES		offsetof(struct bio, bi_max_vecs)

/*
 * bio flags
 */
#define BIO_UPTODATE	0	/* ok after I/O completion */
#define BIO_RW_BLOCK	1	/* RW_AHEAD set, and read/write would block */
#define BIO_EOF		2	/* out-out-bounds error */
#define BIO_SEG_VALID	3	/* bi_phys_segments valid */
#define BIO_CLONED	4	/* doesn't own data */
#define BIO_BOUNCED	5	/* bio is a bounce bio */
#define BIO_USER_MAPPED 6	/* contains user pages */
#define BIO_EOPNOTSUPP	7	/* not supported */
#define BIO_NULL_MAPPED 8	/* contains invalid user pages */
#define BIO_FS_INTEGRITY 9	/* fs owns integrity data, not block layer */
#define BIO_QUIET	10	/* Make BIO Quiet */
#define BIO_MAPPED_INTEGRITY 11/* integrity metadata has been remapped */
#define BIO_SNAP_STABLE	12	/* bio data must be snapshotted during write */

/*
 * Flags starting here get preserved by bio_reset() - this includes
 * BIO_POOL_IDX()
 */
#define BIO_RESET_BITS	13
#define BIO_OWNS_VEC	13	/* bio_free() should free bvec */

#define bio_flagged(bio, flag)	((bio)->bi_flags & (1 << (flag)))

/*
 * top 4 bits of bio flags indicate the pool this bio came from
 */
#define BIO_POOL_BITS		(4)
#define BIO_POOL_NONE		((1UL << BIO_POOL_BITS) - 1)
#define BIO_POOL_OFFSET		(BITS_PER_LONG - BIO_POOL_BITS)
#define BIO_POOL_MASK		(1UL << BIO_POOL_OFFSET)
#define BIO_POOL_IDX(bio)	((bio)->bi_flags >> BIO_POOL_OFFSET)

#endif /* CONFIG_BLOCK */

/*
 * Request flags.  For use in the cmd_flags field of struct request, and in
 * bi_rw of struct bio.  Note that some flags are only valid in either one.
 */
enum rq_flag_bits {
	/* common flags */
	__REQ_WRITE,		/* not set, read. set, write */
	__REQ_FAILFAST_DEV,	/* no driver retries of device errors */
	__REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */
	__REQ_FAILFAST_DRIVER,	/* no driver retries of driver errors */

	__REQ_SYNC,		/* request is sync (sync write or read) */
	__REQ_META,		/* metadata io request */
	__REQ_PRIO,		/* boost priority in cfq */
	__REQ_DISCARD,		/* request to discard sectors */
	__REQ_SECURE,		/* secure discard (used with __REQ_DISCARD) */
	__REQ_WRITE_SAME,	/* write same block many times */

	__REQ_NOIDLE,		/* don't anticipate more IO after this one */
	__REQ_FUA,		/* forced unit access */
	__REQ_FLUSH,		/* request for cache flush */

	/* bio only flags */
	__REQ_RAHEAD,		/* read ahead, can fail anytime */
	__REQ_THROTTLED,	/* This bio has already been subjected to
				 * throttling rules. Don't do it again. */

	/* request only flags */
	__REQ_SORTED,		/* elevator knows about this request */
	__REQ_SOFTBARRIER,	/* may not be passed by ioscheduler */
	__REQ_NOMERGE,		/* don't touch this for merging */
	__REQ_STARTED,		/* drive already may have started this one */
	__REQ_DONTPREP,		/* don't call prep for this one */
	__REQ_QUEUED,		/* uses queueing */
	__REQ_ELVPRIV,		/* elevator private data attached */
	__REQ_FAILED,		/* set if the request failed */
	__REQ_QUIET,		/* don't worry about errors */
	__REQ_PREEMPT,		/* set for "ide_preempt" requests */
	__REQ_ALLOCED,		/* request came from our alloc pool */
	__REQ_COPY_USER,	/* contains copies of user pages */
	__REQ_FLUSH_SEQ,	/* request for flush sequence */
	__REQ_IO_STAT,		/* account I/O stat */
	__REQ_MIXED_MERGE,	/* merge of different types, fail separately */
	__REQ_KERNEL, 		/* direct IO to kernel pages */
	__REQ_PM,		/* runtime pm request */
	__REQ_END,		/* last of chain of requests */
	__REQ_NR_BITS,		/* stops here */
};

#define REQ_WRITE		(1ULL << __REQ_WRITE)
#define REQ_FAILFAST_DEV	(1ULL << __REQ_FAILFAST_DEV)
#define REQ_FAILFAST_TRANSPORT	(1ULL << __REQ_FAILFAST_TRANSPORT)
#define REQ_FAILFAST_DRIVER	(1ULL << __REQ_FAILFAST_DRIVER)
#define REQ_SYNC		(1ULL << __REQ_SYNC)
#define REQ_META		(1ULL << __REQ_META)
#define REQ_PRIO		(1ULL << __REQ_PRIO)
#define REQ_DISCARD		(1ULL << __REQ_DISCARD)
#define REQ_WRITE_SAME		(1ULL << __REQ_WRITE_SAME)
#define REQ_NOIDLE		(1ULL << __REQ_NOIDLE)

#define REQ_FAILFAST_MASK \
	(REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER)
#define REQ_COMMON_MASK \
	(REQ_WRITE | REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_PRIO | \
	 REQ_DISCARD | REQ_WRITE_SAME | REQ_NOIDLE | REQ_FLUSH | REQ_FUA | \
	 REQ_SECURE)
#define REQ_CLONE_MASK		REQ_COMMON_MASK

#define BIO_NO_ADVANCE_ITER_MASK	(REQ_DISCARD|REQ_WRITE_SAME)

/* This mask is used for both bio and request merge checking */
#define REQ_NOMERGE_FLAGS \
	(REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA)

#define REQ_RAHEAD		(1ULL << __REQ_RAHEAD)
#define REQ_THROTTLED		(1ULL << __REQ_THROTTLED)

#define REQ_SORTED		(1ULL << __REQ_SORTED)
#define REQ_SOFTBARRIER		(1ULL << __REQ_SOFTBARRIER)
#define REQ_FUA			(1ULL << __REQ_FUA)
#define REQ_NOMERGE		(1ULL << __REQ_NOMERGE)
#define REQ_STARTED		(1ULL << __REQ_STARTED)
#define REQ_DONTPREP		(1ULL << __REQ_DONTPREP)
#define REQ_QUEUED		(1ULL << __REQ_QUEUED)
#define REQ_ELVPRIV		(1ULL << __REQ_ELVPRIV)
#define REQ_FAILED		(1ULL << __REQ_FAILED)
#define REQ_QUIET		(1ULL << __REQ_QUIET)
#define REQ_PREEMPT		(1ULL << __REQ_PREEMPT)
#define REQ_ALLOCED		(1ULL << __REQ_ALLOCED)
#define REQ_COPY_USER		(1ULL << __REQ_COPY_USER)
#define REQ_FLUSH		(1ULL << __REQ_FLUSH)
#define REQ_FLUSH_SEQ		(1ULL << __REQ_FLUSH_SEQ)
#define REQ_IO_STAT		(1ULL << __REQ_IO_STAT)
#define REQ_MIXED_MERGE		(1ULL << __REQ_MIXED_MERGE)
#define REQ_SECURE		(1ULL << __REQ_SECURE)
#define REQ_KERNEL		(1ULL << __REQ_KERNEL)
#define REQ_PM			(1ULL << __REQ_PM)
#define REQ_END			(1ULL << __REQ_END)

#endif /* __LINUX_BLK_TYPES_H */


text:
package de.isibboi.kspcraftinfo.db;

import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Collection;
import java.util.HashSet;
import java.util.Properties;

import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;

import java.sql.PreparedStatement;
import java.util.Iterator;

public class ModDatabase {
	private static final int BATCH_SIZE = 100;

	private static final Logger LOG = LogManager.getLogger(ModDatabase.class);
	private static final ModDatabase INSTANCE = new ModDatabase();

	private ModDatabase() {
		try {
			Properties p = new Properties();
			InputStream in = getClass().getResourceAsStream(".password");
			p.load(in);
			in.close();

			host = p.getProperty("host");
			database = p.getProperty("database");
			user = p.getProperty("user");
			password = p.getProperty("password");

			if (user == null || password == null) {
				throw new DatabaseException("Password file needs a user and a password entry.");
			}
		} catch (IOException e) {
			throw new DatabaseException("Missing password file.", e);
		}
	}

	public static ModDatabase getInstance() {
		return INSTANCE;
	}

	private String host;
	private String database;
	private String user;
	private String password;
	private Connection connection;

	private PreparedStatement insertPartStatement;

	private Multimap<String, String> inMemory = HashMultimap.<String, String> create();

	public void connect() {
		if (connection != null) {
			throw new IllegalStateException("Already connected!");
		}

		try {
			Class.forName("com.mysql.jdbc.Driver");
			connection = DriverManager.getConnection("jdbc:mysql://" + host + "/" + database
					+ "?useUnicode=true&characterEncoding=utf-8", user, password);

			Statement stmt = connection.createStatement();
			stmt.execute("CREATE TABLE IF NOT EXISTS PartTable (id INT PRIMARY KEY AUTO_INCREMENT, modName TEXT, partName TEXT, INDEX (partName(16)))");

			insertPartStatement = connection.prepareStatement("INSERT INTO PartTable (modName, partName) VALUES (?, ?)");

			// Read database, create index.
			ResultSet result = stmt.executeQuery("SELECT modName, partName FROM PartTable");

			while (result.next()) {
				inMemory.put(result.getString(2), result.getString(1));
			}

			result.close();
		} catch (SQLException | ClassNotFoundException e) {
			LOG.log(Level.FATAL, "Could not connect to database!", e);
			throw new RuntimeException(e);
		}
	}

	public void close() {
		if (connection == null) {
			throw new IllegalStateException("Not connected");
		}

		try {
			inMemory.clear();
			connection.close();
			connection = null;
		} catch (SQLException e) {
			LOG.log(Level.FATAL, "Could not close connection!", e);
		}
	}

	public void insertMod(String name, Iterable<String> parts) {
		Iterator<String> partIterator = parts.iterator();

		try {
			while (partIterator.hasNext()) {
				for (int i = 0; i < BATCH_SIZE && partIterator.hasNext(); i++) {
					String part = partIterator.next();

					insertPartStatement.setString(1, name);
					insertPartStatement.setString(2, part);
					insertPartStatement.addBatch();

					inMemory.put(part, name);
				}

				insertPartStatement.executeBatch();
			}
		} catch (SQLException e) {
			LOG.log(Level.FATAL, "Could insert mod!", e);
		}
	}

	public Collection<String> getMods(Iterable<String> parts) {
		Collection<String> mods = new HashSet<String>();

		for (String part :parts) {
			mods.addAll(inMemory.get(part));
		}

		return mods;
	}

	public void deleteAll() {
		try {
			connection.createStatement().execute("DROP TABLE PartTable");
			inMemory.clear();
		} catch (SQLException e) {
			LOG.error("Could not drop PartTable", e);
		}
	}
}


text:
layout:     post
title:      Tweets
date:       2018-04-22
summary:    These are the tweets for April 22, 2018.
categories:
---


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Analytics extends CI_Controller {

	var $settings = array();

	function __construct()
	{
		parent::__construct();
		$this->load->model('mdl_coupon');
		$this->load->model('broadcast_model');
		$this->load->model('payment_history_model');
		$this->load->model('credits_trx_model');

		if (!$this->ion_auth->logged_in())
		{
			redirect('auth/login');
		}
	}

	public function accounts(){
		$data = array();

		$data['left_sidebar'] = $this->load->view('v_left_sidebar',array(),true);
		$data['top_header'] = $this->load->view('v_top_header',array(),true);

		$this->load->view('v_header');
		$this->load->view('v_analytics_accounts',$data);
        $this->load->view('v_footer');
	}

	public function broadcasts(){
		$data = array();

		$data['left_sidebar'] = $this->load->view('v_left_sidebar',array(),true);
		$data['top_header'] = $this->load->view('v_top_header',array(),true);

		$this->load->view('v_header');
		$this->load->view('v_analytics_broadcasts',$data);
        $this->load->view('v_footer');
	}

	public function billing(){
		$data = array();

		$data['left_sidebar'] = $this->load->view('v_left_sidebar',array(),true);
		$data['top_header'] = $this->load->view('v_top_header',array(),true);

		$this->load->view('v_header');
		$this->load->view('v_analytics_billing',$data);
        $this->load->view('v_footer');
	}

	public function credits(){
		$data = array();

		$data['left_sidebar'] = $this->load->view('v_left_sidebar',array(),true);
		$data['top_header'] = $this->load->view('v_top_header',array(),true);

		$this->load->view('v_header');
		$this->load->view('v_analytics_credits',$data);
        $this->load->view('v_footer');
	}

	public function ajax_get_accounts_data(){

		$draw = (int)$this->input->post('draw');
		$start_limit = $this->input->post('start');
		$length_limit = $this->input->post('length');
		$order = $this->input->post('order');
		$order_column_index = $order[0]['column'];  //atenti if several order columns admited
		$order_dir = $order[0]['dir'];
		$columns = $this->input->post('columns');

		$like = array();
		foreach ($columns as $column_index => $column) {
			if ($column['search']['value']!=''){
				$column_name = $this->map_account_columns($column_index);
				$like[] = array('column_name' => $column_name,'column_value' => $column['search']['value']);
			}
		}

		$order_column_name = $this->map_account_columns($order_column_index);

		/* for multiples orders make an array
		$order_by = array();
		$order_by['order_column_name'] = $order_column_name;
		$order_by['order_dir'] = $order_dir;
		*/
		//$users = $this->ion_auth->get_root_users();
		$filters = array( 'order_column_name' => $order_column_name,
						 'order_dir' => $order_dir,
						 'start_limit' => $start_limit,
						 'length_limit' => $length_limit,
						 'like' => $like
						);
		$users_result = $this->ion_auth->dt_get_account_users($filters);
		$users = $users_result['rows'];
		$totalRows = $users_result['count_rows'];

		$data = array();
		foreach ($users as $user) {
			$row = array($user->first_name,
						$user->last_name,
						$user->email,
						$user->account_no,
						$user->primary_num,
						$user->created_at,
						$user->last_login,
						$user->package_name,
						$user->total_credits,
						//$this->get_oldest_creation_date($user),
						//$this->get_newest_login_date($user),
						);
			$data[] = $row;
		}
		$recordsFiltered = count($data);

		$dataTableResponse = array('draw'=> $draw,
				  'recordsTotal'=> $totalRows,
				  'recordsFiltered'=> $totalRows,
				  'data' => $data
					);

		/*
			 array(
						    [
						      'Eric',
						      'Ev',
						      'inux2012@gmail.com',
						      '132465',
						      '54654321',
						      '2017-05-05',
						      '2017-05-05 05:10:05',
						      '2017-05-05 04:00:00'
						    ],
						    [
						      'Eric',
						      'Eve',
						      'inux2012@gmail.com',
						      '132465',
						      '54654321',
						      '2017-05-05',
						      '2017-05-05 05:10:05',
						      '2017-05-05 04:00:00'
						    ]
						    )
		*/

		echo json_encode($dataTableResponse);
	}

	private function map_account_columns($column_id){

		$column_name = "";

		switch ($column_id) {
			case 0:
				$column_name = "first_name";
				break;
			case 1:
				$column_name = "last_name";
				break;
			case 2:
				$column_name = "email";
				break;
			case 3:
				$column_name = "account_no";
				break;
			case 4:
				$column_name = "primary_num";
				break;
			case 5:
				$column_name = "created_at";
				break;
			case 6:
				$column_name = "last_login";
				break;
			case 7:
				$column_name = "package_name";
				break;
			case 8:
				$column_name = "total_credits";
				break;
		}
		return $column_name;
	}

	public function ajax_get_broadcasts_data(){

		$draw = (int)$this->input->post('draw');
		$start_limit = $this->input->post('start');
		$length_limit = $this->input->post('length');
		$order = $this->input->post('order');
		$order_column_index = $order[0]['column'];  //atenti if several order columns admited
		$order_dir = $order[0]['dir'];

		$columns = $this->input->post('columns');

		$like = array();
		foreach ($columns as $column_index => $column) {
			if ($column['search']['value']!=''){
				$column_name = $this->map_broadcast_columns($column_index);
				$like[] = array('column_name' => $column_name,'column_value' => $column['search']['value']);
			}
		}

		$order_column_name = $this->map_broadcast_columns($order_column_index);

		$filters = array( 'order_column_name' => $order_column_name,
						 'order_dir' => $order_dir,
						 'start_limit' => $start_limit,
						 'length_limit' => $length_limit,
						 'like' => $like
						);
		$users_result = $this->broadcast_model->dt_get_broadcast($filters);
		$users = $users_result['rows'];
		$totalRows = $users_result['count_rows'];

		$data = array();
		foreach ($users as $user) {
			$row = array($user->first_name,
						$user->last_name,
						$user->email,
						$user->account_no,
						$user->primary_num,
						$user->start_time,
						$user->detail_count,
						$user->duration,
						//$this->get_oldest_creation_date($user),
						//$this->get_newest_login_date($user),
						);
			$data[] = $row;
		}
		$recordsFiltered = count($data);

		$dataTableResponse = array('draw'=> $draw,
				  'recordsTotal'=> $totalRows,
				  'recordsFiltered'=> $totalRows,
				  'data' => $data
					);

		echo json_encode($dataTableResponse);
	}

	private function map_broadcast_columns($column_id){

		$column_name = "";

		switch ($column_id) {
			case 0:
				$column_name = "first_name";
				break;
			case 1:
				$column_name = "last_name";
				break;
			case 2:
				$column_name = "email";
				break;
			case 3:
				$column_name = "account_no";
				break;
			case 4:
				$column_name = "primary_num";
				break;
			case 5:
				$column_name = "start_time";
				break;
			case 6:
				$column_name = "detail_count";
				break;
			case 7:
				$column_name = "duration";
				break;
			case 8:
				$column_name = "total_credits";
				break;
		}

		return $column_name;
	}

	public function ajax_get_billings_data(){

		$draw = (int)$this->input->post('draw');
		$start_limit = $this->input->post('start');
		$length_limit = $this->input->post('length');
		$order = $this->input->post('order');
		$order_column_index = $order[0]['column'];  //atenti if several order columns admited
		$order_dir = $order[0]['dir'];

		$columns = $this->input->post('columns');

		$like = array();
		foreach ($columns as $column_index => $column) {
			if ($column['search']['value']!=''){
				$column_name = $this->map_billing_columns($column_index);
				$like[] = array('column_name' => $column_name,'column_value' => $column['search']['value']);
			}
		}

		$order_column_name = $this->map_billing_columns($order_column_index);

		$filters = array( 'order_column_name' => $order_column_name,
						 'order_dir' => $order_dir,
						 'start_limit' => $start_limit,
						 'length_limit' => $length_limit,
						 'like' => $like
						);

		$users_result = $this->payment_history_model->dt_get_payment_history($filters);
		$users = $users_result['rows'];
		$totalRows = $users_result['count_rows'];

		$data = array();
		foreach ($users as $user) {
			$row = array($user->first_name,
						$user->last_name,
						$user->email,
						$user->account_no,
						$user->primary_num,
						$user->time_stamp,
						$user->total,
						$user->package_name,
						//$this->get_oldest_creation_date($user),
						//$this->get_newest_login_date($user),
						);
			$data[] = $row;
		}
		$recordsFiltered = count($data);

		$dataTableResponse = array('draw'=> $draw,
				  'recordsTotal'=> $totalRows,
				  'recordsFiltered'=> $totalRows,
				  'data' => $data
					);

		echo json_encode($dataTableResponse);
	}

	private function map_billing_columns($column_id){

		$column_name = "";

		switch ($column_id) {
			case 0:
				$column_name = "first_name";
				break;
			case 1:
				$column_name = "last_name";
				break;
			case 2:
				$column_name = "email";
				break;
			case 3:
				$column_name = "account_no";
				break;
			case 4:
				$column_name = "primary_num";
				break;
			case 5:
				$column_name = "time_stamp";
				break;
			case 6:
				$column_name = "total";
				break;
			case 7:
				$column_name = "package_name";
				break;
		}

		return $column_name;
	}

	public function ajax_get_credits_data(){

		$draw = (int)$this->input->post('draw');
		$start_limit = $this->input->post('start');
		$length_limit = $this->input->post('length');
		$order = $this->input->post('order');
		$order_column_index = $order[0]['column'];  //atenti if several order columns admited
		$order_dir = $order[0]['dir'];

		$columns = $this->input->post('columns');

		$like = array();
		foreach ($columns as $column_index => $column) {
			if ($column['search']['value']!=''){
				$column_name = $this->map_credit_columns($column_index);
				$like[] = array('column_name' => $column_name,'column_value' => $column['search']['value']);
			}
		}

		$order_column_name = $this->map_credit_columns($order_column_index);

		$filters = array( 'order_column_name' => $order_column_name,
						 'order_dir' => $order_dir,
						 'start_limit' => $start_limit,
						 'length_limit' => $length_limit,
						 'like' => $like
						);
		$users_result = $this->credits_trx_model->dt_get_credits_trx($filters);
		$users = $users_result['rows'];
		$totalRows = $users_result['count_rows'];

		$data = array();
		foreach ($users as $user) {
			$row = array($user->first_name,
						$user->last_name,
						$user->email,
						$user->account_no,
						$user->primary_num,
						$user->type,
						$user->credits_qty,
						);
			$data[] = $row;
		}
		$recordsFiltered = count($data);

		$dataTableResponse = array('draw'=> $draw,
				  'recordsTotal'=> $totalRows,
				  'recordsFiltered'=> $totalRows,
				  'data' => $data
					);

		echo json_encode($dataTableResponse);
	}

	private function map_credit_columns($column_id){

		$column_name = "";

		switch ($column_id) {
			case 0:
				$column_name = "first_name";
				break;
			case 1:
				$column_name = "last_name";
				break;
			case 2:
				$column_name = "email";
				break;
			case 3:
				$column_name = "account_no";
				break;
			case 4:
				$column_name = "primary_num";
				break;
			case 5:
				$column_name = "type";
				break;
			case 6:
				$column_name = "credits_qty";
				break;
		}

		return $column_name;
	}

	//returns the creation date of root_user table, or the oldest between the creatio date of
	//the user table and the creation date of the ivr_user table , or empty
	/* made in the model by sql
	private function get_oldest_creation_date($user){
		$date = "";
		if ($user->created_at != null){
			$date = date('m-d-Y H:i:s',strtotime($user->created_at));
		} else {
			if ($user->created_on != null){
				if ($user->time_stamp !=null){
					if ($user->created_on<strtotime($user->time_stamp)){
						$date = date('m-d-Y H:i:s',$user->created_on);
					} else {
						$date = date('m-d-Y H:i:s',strtotime($user->time_stamp));
					}
				} else {
					$date = date('m-d-Y H:i:s',$user->created_on);
				}
			} else {
				if ($user->time_stamp !=null){
					$date = date('m-d-Y H:i:s',strtotime($user->time_stamp));
				}
			}
		}
		return $date;
	}

	private function get_newest_login_date($user){
		$date = "";
		if ($user->last_ru_login != null){
			$date = date('m-d-Y H:i:s',strtotime($user->last_ru_login));
			$date = date('m-d-Y H:i:s',strtotime($user->last_ru_login));
		} else {
			if ($user->last_login != null){
				$date = date('m-d-Y H:i:s',$user->last_login);
			}
		}

		return $date;
	}

	*/

}


text:
package org.jboss.resteasy.test.finegrain.methodparams;

import org.jboss.resteasy.client.ClientRequest;
import org.jboss.resteasy.client.ClientResponse;
import org.jboss.resteasy.core.Dispatcher;
import org.jboss.resteasy.test.EmbeddedContainer;
import org.jboss.resteasy.util.HttpResponseCodes;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;

import javax.ws.rs.Encoded;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;

import static org.jboss.resteasy.test.TestPortProvider.generateURL;

/**
 * @author Bill Burke
 * @version $Revision: 1 $
 */
public class EncodedParamsTest
{
   private static Dispatcher dispatcher;

   @BeforeClass
   public static void before() throws Exception
   {
   }

   @AfterClass
   public static void after() throws Exception
   {
   }

   @Path("/encodedParam")
   public static class SimpleResource
   {
      @GET
      public String get(@QueryParam("hello world") int num, @QueryParam("stuff") @Encoded String stuff,
                        @QueryParam("stuff") String unStuff)
      {
         Assert.assertEquals(5, num);
         System.out.println("Hello " + num + " times");

         Assert.assertEquals("hello%20world", stuff);
         Assert.assertEquals("hello world", unStuff);
         return "HELLO";
      }

      @GET
      @Path("/{param}")
      public String goodbye(@PathParam("param") @Encoded String stuff)
      {
         System.out.println("Goodbye");
         Assert.assertEquals("hello%20world", stuff);
         return "GOODBYE";
      }
   }

   @Path("/encodedMethod")
   public static class SimpleResource2
   {
      @GET
      @Encoded
      public String get(@QueryParam("stuff") String stuff)
      {
         Assert.assertEquals("hello%20world", stuff);
         return "HELLO";
      }

      @GET
      @Encoded
      @Path("/{param}")
      public String goodbye(@PathParam("param") String stuff)
      {
         System.out.println("Goodbye");
         Assert.assertEquals("hello%20world", stuff);
         return "GOODBYE";
      }
   }

   private void _test(String path)
   {
      try
      {
         ClientRequest request = new ClientRequest(generateURL(path));
         ClientResponse<?> response = request.get();
         Assert.assertEquals(HttpResponseCodes.SC_OK, response.getStatus());
         response.releaseConnection();
      } catch (Exception e)
      {
         throw new RuntimeException(e);
      }
   }

   @Test
   public void testEncoded() throws Exception
   {
      dispatcher = EmbeddedContainer.start().getDispatcher();
      try
      {
         dispatcher.getRegistry().addPerRequestResource(SimpleResource.class);
         dispatcher.getRegistry().addPerRequestResource(SimpleResource2.class);
         _test("/encodedParam?hello%20world=5&stuff=hello%20world");
         _test("/encodedParam/hello%20world");
         _test("/encodedMethod?hello%20world=5&stuff=hello%20world");
         _test("/encodedMethod/hello%20world");
      }
      finally
      {
         EmbeddedContainer.stop();
      }
   }
}


text:
/**
 *
 */
package org.fusesource.restygwt.client.codec;

import java.util.List;

class LibraryWithWrapper {
    public List<LibraryItemWithWrapper> items;
    public boolean equals(Object other){
        return items.equals(((LibraryWithWrapper)other).items);
     }
}


text:
var Docker = require('../lib/docker');

var docker = new Docker({
  socketPath: '/var/run/docker.sock'
});

/**
 * Get env list from running container
 * @param container
 */
function runExec(container) {

  var options = {
    Cmd: ['bash', '-c', 'echo test $VAR'],
    Env: ['VAR=ttslkfjsdalkfj'],
    AttachStdout: true,
    AttachStderr: true
  };

  container.exec(options, function(err, exec) {
    if (err) return;
    exec.start(function(err, stream) {
      if (err) return;

      container.modem.demuxStream(stream, process.stdout, process.stderr);

      exec.inspect(function(err, data) {
        if (err) return;
        console.log(data);
      });
    });
  });
}

docker.createContainer({
  Image: 'ubuntu',
  Tty: true,
  Cmd: ['/bin/bash']
}, function(err, container) {
  container.start({}, function(err, data) {
    runExec(container);
  });
});


text:
.. currentmodule:: network
.. _network.CC3K:

class CC3K -- control CC3000 WiFi modules
=========================================

This class provides a driver for CC3000 WiFi modules.  Example usage::

    import network
    nic = network.CC3K(pyb.SPI(2), pyb.Pin.board.Y5, pyb.Pin.board.Y4, pyb.Pin.board.Y3)
    nic.connect('your-ssid', 'your-password')
    while not nic.isconnected():
        pyb.delay(50)
    print(nic.ifconfig())

    # now use socket as usual
    ...

For this example to work the CC3000 module must have the following connections:

    - MOSI connected to Y8
    - MISO connected to Y7
    - CLK connected to Y6
    - CS connected to Y5
    - VBEN connected to Y4
    - IRQ connected to Y3

It is possible to use other SPI busses and other pins for CS, VBEN and IRQ.

Constructors
------------

.. class:: CC3K(spi, pin_cs, pin_en, pin_irq)

   Create a CC3K driver object, initialise the CC3000 module using the given SPI bus
   and pins, and return the CC3K object.

   Arguments are:

     - *spi* is an :ref:`SPI object <pyb.SPI>` which is the SPI bus that the CC3000 is
       connected to (the MOSI, MISO and CLK pins).
     - *pin_cs* is a :ref:`Pin object <pyb.Pin>` which is connected to the CC3000 CS pin.
     - *pin_en* is a :ref:`Pin object <pyb.Pin>` which is connected to the CC3000 VBEN pin.
     - *pin_irq* is a :ref:`Pin object <pyb.Pin>` which is connected to the CC3000 IRQ pin.

   All of these objects will be initialised by the driver, so there is no need to
   initialise them yourself.  For example, you can use::

     nic = network.CC3K(pyb.SPI(2), pyb.Pin.board.Y5, pyb.Pin.board.Y4, pyb.Pin.board.Y3)

Methods
-------

.. method:: CC3K.connect(ssid, key=None, *, security=WPA2, bssid=None)

   Connect to a WiFi access point using the given SSID, and other security
   parameters.

.. method:: CC3K.disconnect()

   Disconnect from the WiFi access point.

.. method:: CC3K.isconnected()

   Returns True if connected to a WiFi access point and has a valid IP address,
   False otherwise.

.. method:: CC3K.ifconfig()

   Returns a 7-tuple with (ip, subnet mask, gateway, DNS server, DHCP server,
   MAC address, SSID).

.. method:: CC3K.patch_version()

   Return the version of the patch program (firmware) on the CC3000.

.. method:: CC3K.patch_program('pgm')

   Upload the current firmware to the CC3000.  You must pass 'pgm' as the first
   argument in order for the upload to proceed.

Constants
---------

.. data:: CC3K.WEP
.. data:: CC3K.WPA
.. data:: CC3K.WPA2

   security type to use


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Bull. Herb. Boissier 1: 35 (1892)

#### Original name
Thalloidima microlepis Müll. Arg.

### Remarks
null


text:
package brooklyn.event.basic;

import java.util.Map;

import brooklyn.config.ConfigKey;
import brooklyn.management.ExecutionContext;

import com.google.common.collect.Maps;

public abstract class AbstractStructuredConfigKey<T,RawT,V> extends BasicConfigKey<T> implements StructuredConfigKey {

    private static final long serialVersionUID = 7806267541029428561L;

    public final Class<V> subType;

    public AbstractStructuredConfigKey(Class<T> type, Class<V> subType, String name, String description, T defaultValue) {
        super(type, name, description, defaultValue);
        this.subType = subType;
    }

    protected ConfigKey<V> subKey(String subName) {
        return subKey(subName, "sub-element of " + getName() + ", named " + subName);
    }
    // it is not possible to supply default values
    protected ConfigKey<V> subKey(String subName, String description) {
        return new SubElementConfigKey<V>(this, subType, getName() + "." + subName, description, null);
    }

    protected static String getKeyName(Object contender) {
        if (contender==null) return null;
        if (contender instanceof ConfigKey) return ((ConfigKey<?>)contender).getName();
        return contender.toString();
    }

    public boolean acceptsKeyMatch(Object contender) {
        return (getName().equalsIgnoreCase(getKeyName(contender)));
    }

    public boolean acceptsSubkey(Object contender) {
        return contender!=null && getKeyName(contender).startsWith(getName()+".");
    }

    public String extractSubKeyName(Object o) {
        String name = getKeyName(o);
        assert name.startsWith(getName()+".");
        return name.substring(getName().length() + 1);
    }

    @Override
    public boolean acceptsSubkeyStronglyTyped(Object contender) {
        return (contender instanceof SubElementConfigKey) &&
            acceptsKeyMatch( ((SubElementConfigKey<?>) contender).parent );
    }

    @Override
    public boolean isSet(Map<?, ?> vals) {
        if (vals.containsKey(this))
            return true;
        for (Object contender : vals.keySet()) {
            if (acceptsKeyMatch(contender) || acceptsSubkey(contender)) {
                return true;
            }
        }
        return false;
    }

    protected RawT extractValue(Map<?,?> vals, ExecutionContext exec, boolean coerce, boolean unmodifiable) {
        RawT base = null;
        Map<String,Object> subkeys = Maps.newLinkedHashMap();
        for (Map.Entry<?,?> entry : vals.entrySet()) {
            Object k = entry.getKey();

            if (acceptsKeyMatch(k)) {
                base = extractValueMatchingThisKey(entry.getValue(), exec, coerce);
            }

            if (acceptsSubkey(k)) {
                String subKeyName = extractSubKeyName(k);
                Object value;
                if (coerce) {
                    @SuppressWarnings("unchecked")
                    SubElementConfigKey<V> kk = k instanceof SubElementConfigKey<?> ?
                        (SubElementConfigKey<V>) k : (SubElementConfigKey<V>) subKey(subKeyName);
                    value = kk.extractValue(vals, exec);
                } else {
                    value = vals.get(k);
                }
                subkeys.put(subKeyName, value);
            }
        }
        return merge(base, subkeys, unmodifiable);
    }

    @SuppressWarnings("unchecked")
    @Override
    public T extractValue(Map<?,?> vals, ExecutionContext exec) {
        return (T) extractValue(vals, exec, true, true);
    }

    /** returns the entries in the map against this config key and any sub-config-keys, without resolving
     * (like {@link #extractValue(Map, ExecutionContext)} but without resolving/coercing;
     * useful because values in this "map" are actually stored against {@link SubElementConfigKey}s */
    public RawT rawValue(Map<?,?> vals) {
        return extractValue(vals, null, false, false);
    }

    /** returns value against *this* key, if it is of an acceptable type (ignoring subkeys which are added on top) */
    protected abstract RawT extractValueMatchingThisKey(Object potentialBase, ExecutionContext exec, boolean coerce);

    protected abstract RawT merge(RawT base, Map<String, Object> subkeys, boolean unmodifiable);

}


text:
package sds

import java.io.{InputStream, ByteArrayInputStream}
import java.net.URL
import java.nio.file.Paths

import org.junit.Test
import org.scalatest.Assertions
import sds.classfile.MemberInfo
import sds.classfile.attribute.AnnotationGenerator.generate
import sds.classfile.attribute.{
  AnnotationDefault,
  BootstrapMethods,
  Code, Exceptions,
  InnerClasses,
  LineNumberTable,
  LocalVariable,
  MethodParameters,
  SourceFile,
  TypeAnnotation,
  RuntimeAnnotations => RunAnn,
  RuntimeParameterAnnotations => RunParamAnn,
  RuntimeTypeAnnotations => RunTypeAnn,
  StackMapTable => Stack
}
import sds.classfile.bytecode.{
  InvokeDynamic,
  LookupSwitch,
  MultiANewArray => Multi,
  OpcodeInfo,
  TableSwitch,
  HasReferenceOpcode => Has
}
import sds.classfile.constant_pool.Utf8ValueExtractor.extract
import sds.classfile.constant_pool.{ConstantInfo, InvokeDynamicInfo => Invoke}
import sds.util.AccessFlag.get
import sds.util.ClassfilePrinter

import scala.collection.mutable.{ArrayBuffer => Buffer}

class ClassfileReaderTest extends Assertions {
    private val cf_1: Classfile = setUp("Hello.class")
    private val cf_2: Classfile = setUpStream("AnnotatedTest.class")
    private val cf_3: Classfile = setUp("RuntimeAnnotation.class")
    private val cf_4: Classfile = setUpStream("Resize.class")
    private val cf_5: Classfile = setUp("HogeMain.class")
    private val cf_6: Classfile = setUpStream("HelloWorld.class")
    private val cf_7: Classfile = setUp("Test.class")

    private def setUp(file: String): Classfile = {
        val url: URL = getLoader.getResource(file)
        val read: ClassfileReader = new ClassfileReader(Paths.get(url.toURI()).toString())
        new ClassfilePrinter(read.classfile)._print()
        read.classfile
    }

    private def setUpStream(file: String): Classfile = {
        val stream: InputStream = getLoader.getResourceAsStream(file)
        val read: ClassfileReader = new ClassfileReader(stream)
        new ClassfilePrinter(read.classfile)._print()
        read.classfile
    }

    private def getLoader: ClassLoader = getClass.getClassLoader

    @Test
    def classfileIOExceptionTest(): Unit = {
        new ClassfileReader("xxx.class")
        new ClassfileReader(new ByteArrayInputStream(Array[Byte]()))
    }

    @Test
    def headerTest(): Unit = {
//        sds.Main.main(Array("Hello.class"))
        // header
        assert(Integer.toHexString(cf_1.magic) === "cafebabe")
        assert(cf_1.major === 52)
        assert(cf_1.minor === 0)
        assert(get(cf_1.access, "class") === "public class ")
        // constant pool
        val pool: Array[ConstantInfo] = cf_1.pool
        assert(extract(cf_1.thisClass, pool) === "Hello")
        assert(extract(cf_1.superClass, pool) === "Object")
        assert(pool(0).toString() === "Methodref\t#6.#17")
        assert(pool(2).toString() === "String\t#20")
        assert(pool(4).toString() === "Class\t#23")
        assert(pool(6).toString() === "Utf8\t<init>")
        assert(pool(16).toString() === "NameAndType\t#7:#8")

        val invoke: Invoke = cf_2.pool(1).asInstanceOf[Invoke]
        assert(invoke.toString() === "InvokeDynamic\t#0:#71")
        assert(extract(invoke, cf_2.pool) === "accept|(sds.AnnotatedTest)java.util.function.Consumer")
    }

    @Test
    def fieldTest(): Unit = {
        val f: MemberInfo = cf_2.fields(0)
        assert(f._type === "field")
        assert(f.toString() === "private String field")
        val ra: RunAnn = f.attributes(0).asInstanceOf[RunAnn]
        assert(ra.annotations === Array("@sds.RuntimeAnnotation(value = \"field\")"))
        val ta: TypeAnnotation = f.attributes(1).asInstanceOf[RunTypeAnn].annotations(0)
        assert(ta.target.toString() === "EmptyTarget")
        assert(generate(ta, cf_2.pool) === "@sds.RuntimeAnnotation(value = \"field\")")
        assert(ta.path === Array())
    }

    @Test
    def methodTest(): Unit = {
        val methods: Array[MemberInfo] = cf_1.methods
        // method header
        val const: MemberInfo = methods(0)
        assert(const.access === "public ")
        assert(const.desc === "()void")
        assert(const.name === "<init>")
        assert(const.toString() === "public <init>()void")
        assert(const._type === "method")
        // code
        val code1: Code = const.attributes(0).asInstanceOf[Code]
        assert(code1.maxStack === 1)
        assert(code1.maxLocals === 1)
        // opcode on code
        val ops1: Array[OpcodeInfo] = code1.opcodes
        assert(ops1(0).toString() === "0 - aload_0")
        assert(ops1(1).toString() === "1 - invokespecial: #1(Object.<init>|()void)")
        assert(ops1(2).toString() === "4 - _return")
        // line_number_table on code
        val line1: LineNumberTable = code1.attributes(0).asInstanceOf[LineNumberTable]
        assert(line1.table === Array(Array(0, 0, 1)))
        assert(line1.getTableStr()(0) === "[range:0-0|line:1]")
        // main method
        val main: MemberInfo = methods(1)
        assert(main.access === "public static ")
        assert(main.desc === "(String[])void")
        assert(main.name === "main")
        assert(main.toString() === "public static main(String[])void")
        val code2: Code = main.attributes(0).asInstanceOf[Code]
        val ops2: Array[OpcodeInfo] = code2.opcodes
        val ldc: Has = ops2(1).asInstanceOf[Has]
        assert(ldc.toString() === "3 - ldc: #3(\"Hello World!!\"(String))")
        // exceptions on code
        val ex: Exceptions = main.attributes(1).asInstanceOf[Exceptions]
        assert(ex.ex === Array("Exception"))
        assert(ex.toString() === "Exceptions: [Exception]")

        val methods2: Array[MemberInfo] = cf_2.methods
        val local: LocalVariable
            = methods2(0).attributes(0).asInstanceOf[Code].attributes(1).asInstanceOf[LocalVariable]
        assert(local.getNameTable()(0)(0) === "this")
        assert(local.getNameTable()(0)(1) === "sds.AnnotatedTest")
        assert(local.getTable()(0)(0) === 0)
        assert(local.getTable()(0)(1) === 5)
        assert(local.getTable()(0)(2) === 0)

        val cons: MemberInfo = methods2(1)
        val consCode: Code = cons.attributes(0).asInstanceOf[Code]
        val indy: InvokeDynamic = consCode.opcodes(1).asInstanceOf[InvokeDynamic]
        assert(indy.toString() === "1 - invokedynamic: #2(accept|(sds.AnnotatedTest)java.util.function.Consumer)")
        val rta2: RunTypeAnn = consCode.attributes(3).asInstanceOf[RunTypeAnn]
        assert(rta2.name === "RuntimeVisibleTypeAnnotations")
        assert(rta2.annotations(0).target.toString() === "LocalVarTarget: [start, len, index] = {[7,1,2]}")
        assert(cons.attributes(2).toString() === "Deprecated")
        assert(cons.attributes(3).toString() === "Signature: <T extends Object>(int)void")
        val rta3: Array[TypeAnnotation] = cons.attributes(5).asInstanceOf[RunTypeAnn].annotations
        assert(rta3(0).target.toString() === "TypeParamTarget: (type_param: 0)")
        assert(rta3(1).target.toString() === "TypeParamBoundTarget: (bounds: 0, type_param: 0)")
        assert(rta3(2).target.toString() === "ThrowsTarget: (throws_type: 0)")
        assert(rta3(3).target.toString() === "MethodFormalParamTarget: (formal_index: 0)")
        val rpa: RunParamAnn = cons.attributes(6).asInstanceOf[RunParamAnn]
        assert(rpa.annotations(0)(0) === "@sds.RuntimeAnnotation(value = \"method_arg\")")

        val methods3: Array[MemberInfo] = cf_3.methods
        val ad1: AnnotationDefault = methods3(0).attributes(0).asInstanceOf[AnnotationDefault]
        val ad2: AnnotationDefault = methods3(1).attributes(0).asInstanceOf[AnnotationDefault]
        val ad3: AnnotationDefault = methods3(2).attributes(0).asInstanceOf[AnnotationDefault]
        val ad4: AnnotationDefault = methods3(3).attributes(0).asInstanceOf[AnnotationDefault]
        val ad5: AnnotationDefault = methods3(4).attributes(0).asInstanceOf[AnnotationDefault]
        val ad6: AnnotationDefault = methods3(5).attributes(0).asInstanceOf[AnnotationDefault]
        val ad7: AnnotationDefault = methods3(6).attributes(0).asInstanceOf[AnnotationDefault]
        val annotation: String = "@java.lang.annotation.Target(value = {java.lang.annotation.ElementType.TYPE})"
        assert(ad1.toString() === "AnnotationDefault: \"placement\"")
        assert(ad2.toString() === "AnnotationDefault: '97'")
        assert(ad3.toString() === "AnnotationDefault: for_test.RuntimeAnnotation$Type.Default")
        assert(ad4.toString() === "AnnotationDefault: " + annotation)
        assert(ad5.toString() === "AnnotationDefault: 100")
        assert(ad6.toString() === "AnnotationDefault: {1,2,3}")
        assert(ad7.toString() === "AnnotationDefault: int.class")

        val methods5: Array[MemberInfo] = cf_5.methods
        val code5: Code = methods5(2).attributes(0).asInstanceOf[Code]
        val switch: TableSwitch = code5.opcodes(4).asInstanceOf[TableSwitch]
        assert(switch.toString() === "8 - tableswitch: [36, 41, 46, 52(default)]")

        val code5_1: Code = methods5(3).attributes(0).asInstanceOf[Code]
        val look: LookupSwitch = code5_1.opcodes(6).asInstanceOf[LookupSwitch]
        assert(look.toString() === "8 - lookupswitch: [2223141:28, default:39]")

        val methods6: Array[MemberInfo] = cf_6.methods
        val code6: Code = methods6(8).attributes(0).asInstanceOf[Code]
        val multi: Multi = code6.opcodes(22).asInstanceOf[Multi]
        assert(multi.toString() === "26 - multianewarray: #35(long[][]), dimensions:2")

        val methods7: Array[MemberInfo] = cf_7.methods
        val param: MethodParameters = methods7(6).attributes(1).asInstanceOf[MethodParameters]
        assert(param.toString() === "MethodParameters: [final f, i]")
    }

    @Test
    def stackMapFrameTest(): Unit = {
        val code1: Code = cf_4.methods(0).attributes(0).asInstanceOf[Code]
        val stack1: Stack = code1.attributes(1).asInstanceOf[Stack]
        val entry_1 = stack1.entries.iterator
        // FullFrame
        val full = entry_1.next()
        assert(full._1 === (255, 28))
        assert(full._2("stack") === Buffer[String]())
        assert(full._2("local") === Buffer("Resize", "String[]", "int"))
        // ChopFrame
        val chop = entry_1.next()
        assert(chop._2("local") === Buffer("Resize", "String[]"))
        // SameFrame
        val same = entry_1.next()
        assert(same._2("local") === Buffer("Resize", "String[]"))
        // AppendFrame
        val append = entry_1.next()
        assert(append._2("local") === Buffer("Resize", "String[]", "int"))

        val code4: Code = cf_4.methods(3).attributes(0).asInstanceOf[Code]
        val stack4: Stack = code4.attributes(1).asInstanceOf[Stack]
        val entry_4 = stack4.entries.iterator
        entry_4.next()
        val sameLocals = entry_4.next()
        assert(sameLocals._2("stack") === Buffer("Runnable"))

        val code5: Code = cf_4.methods(4).attributes(0).asInstanceOf[Code]
        val stack5: Stack = code5.attributes(1).asInstanceOf[Stack]
        val entry_5 = stack5.entries.iterator
        val sameLocalsExtended = entry_5.next()
        assert(sameLocalsExtended._2("stack") === Buffer("java.io.IOException"))
    }

    @Test
    def attributeTest(): Unit = {
        val source: SourceFile = cf_1.attributes(0).asInstanceOf[SourceFile]
        assert(source.toString() === "SourceFile: Hello.java")

        val inner: InnerClasses = cf_2.attributes(2).asInstanceOf[InnerClasses]
        val innerArray: Array[Array[String]] = Array(
            Array("sds.AnnotatedTest$Inner", "sds.AnnotatedTest", "Inner", "public class "),
            Array("sds.AnnotatedTest$Type", "sds.AnnotatedTest", "Type", "public static final enum "),
            Array("java.lang.invoke.MethodHandles$Lookup", "java.lang.invoke.MethodHandles",
                  "Lookup", "public static final class ")
        )
        assert(inner.classes === innerArray)
        val bsm: Array[(String, Array[String])] = cf_2.attributes(3).asInstanceOf[BootstrapMethods].bsm
        val bsmRef: String = "java.lang.invoke.LambdaMetafactory.metafactory|" +
              "(java.lang.invoke.MethodHandles$Lookup,String,java.lang.invoke.MethodType," +
              "java.lang.invoke.MethodType,java.lang.invoke.MethodHandle,java.lang.invoke.MethodType)" +
              "java.lang.invoke.CallSite"
        val obj: String = "(Object)void"
        val bsmArg1: Array[String] = Array(obj, "sds.AnnotatedTest.lambda$method$0|" + obj, obj)
        val bsmArg2: Array[String] = Array(obj, "sds.AnnotatedTest.lambda$method2$1|" + obj, obj)
        assert(bsm(0)._1 === bsmRef)
        assert(bsm(0)._2 === bsmArg1)
        assert(bsm(1)._1 === bsmRef)
        assert(bsm(1)._2 === bsmArg2)
    }
}


text:
goog.provide('goog.ui.RangeModelTest');
goog.setTestOnly('goog.ui.RangeModelTest');

goog.require('goog.testing.jsunit');
goog.require('goog.ui.RangeModel');

function reset(rm, step) {
  rm.setStep(step || 1);
  rm.setExtent(0);
  rm.setMinimum(0);
  rm.setMaximum(100);
  rm.setValue(0);
}

function getDescriptiveString(rm) {
  return rm.getMinimum() + ' < ' + rm.getValue() + '[' + rm.getExtent() +
      '] < ' + rm.getMaximum();
}

function testValue() {
  var rm = new goog.ui.RangeModel;

  assertEquals(0, rm.getValue());
  rm.setValue(50);
  assertEquals(50, rm.getValue());

  // setting smaller than min should keep min
  rm.setValue(-1);
  assertEquals(0, rm.getValue());

  // setting larger than max should keep max - extent
  rm.setValue(101);
  assertEquals(100, rm.getValue());
  rm.setValue(0);
  rm.setExtent(10);
  rm.setValue(100);
  assertEquals(90, rm.getValue());

  ////////////////
  // Change step
  reset(rm, 3);

  assertEquals(0, rm.getValue());
  rm.setValue(50);
  assertEquals(51, rm.getValue());

  // setting smaller than min should keep min
  rm.setValue(-1);
  assertEquals(0, rm.getValue());

  // setting larger than max should keep max - extent
  rm.setValue(101);
  assertEquals(99, rm.getValue());
  rm.setValue(0);
  rm.setExtent(10);
  rm.setValue(100);
  assertEquals(90, rm.getValue());
}

function testMinium() {
  var rm = new goog.ui.RangeModel;

  rm.setValue(50);
  rm.setMinimum(10);
  assertEquals(10, rm.getMinimum());

  reset(rm);

  // setting larger than value should change value
  rm.setMinimum(10);
  assertEquals(10, rm.getMinimum());
  assertEquals(10, rm.getValue());

  // setting larger than max should set max = min
  rm.setMinimum(200);
  assertEquals(200, rm.getMinimum());
  assertEquals(200, rm.getValue());
  assertEquals(200, rm.getMaximum());
  assertEquals(0, rm.getExtent());

  reset(rm);

  // should change extent
  rm.setExtent(10);
  rm.setMinimum(95);
  assertEquals(95, rm.getMinimum());
  assertEquals(95, rm.getValue());
  assertEquals(100, rm.getMaximum());
  assertEquals(5, rm.getExtent());

  ////////////////
  // Change step
  reset(rm, 3);

  rm.setValue(50);
  rm.setMinimum(10);
  assertEquals(10, rm.getMinimum());

  reset(rm, 3);

  // setting larger than value should change value
  rm.setMinimum(10);
  assertEquals(10, rm.getMinimum());
  assertEquals(10, rm.getValue());

  // setting larger than max should set max = min
  rm.setMinimum(200);
  assertEquals(200, rm.getMinimum());
  assertEquals(200, rm.getValue());
  assertEquals(200, rm.getMaximum());
  assertEquals(0, rm.getExtent());

  reset(rm, 3);

  // should change extent
  rm.setExtent(10);   // 0 < 0[9] < 99
  rm.setMinimum(95);  // 95 < 95[3] < 98
  assertEquals(95, rm.getMinimum());
  assertEquals(95, rm.getValue());
  assertEquals(98, rm.getMaximum());
  assertEquals(3, rm.getExtent());
}

function testMaximum() {
  var rm = new goog.ui.RangeModel;

  rm.setMaximum(50);
  assertEquals(50, rm.getMaximum());

  reset(rm);

  // setting to smaller than minimum should change minimum, value and extent
  rm.setValue(5);
  rm.setExtent(10);
  rm.setMinimum(50);
  rm.setMaximum(40);
  assertEquals(40, rm.getMaximum());
  assertEquals(0, rm.getExtent());
  assertEquals(40, rm.getValue());
  assertEquals(40, rm.getMinimum());

  reset(rm);

  // setting smaller than value should change value to max - extent
  rm.setExtent(10);
  rm.setValue(50);
  rm.setMaximum(40);
  assertEquals(40, rm.getMaximum());
  assertEquals(30, rm.getValue());

  reset(rm);

  // should change value, and keep extent constant,
  // unless extent is > max - min.
  rm.setExtent(10);
  rm.setValue(90);
  rm.setMaximum(95);
  assertEquals(95, rm.getMaximum());
  assertEquals(10, rm.getExtent());
  assertEquals(85, rm.getValue());

  ////////////////
  // Change step
  reset(rm, 3);

  rm.setMaximum(50);  // 0 < 0[0] < 51
  assertEquals(51, rm.getMaximum());

  reset(rm, 3);

  // setting to smaller than minimum should change minimum, value and extent
  rm.setValue(5);     // 0 < 6[0] < 99
  rm.setExtent(10);   // 0 < 6[9] < 99
  rm.setMinimum(50);  // 50 < 50[9] < 98
  rm.setMaximum(40);  // 41 < 41[0] < 41
  assertEquals(41, rm.getMaximum());
  assertEquals(0, rm.getExtent());
  assertEquals(41, rm.getValue());
  assertEquals(41, rm.getMinimum());

  reset(rm, 3);

  // setting smaller than value should change value to max - extent
  rm.setExtent(10);   // 0 < 0[9] < 99
  rm.setValue(50);    // 0 < 51[9] < 99
  rm.setMaximum(40);  // 0 < 30[9] < 39
  assertEquals(39, rm.getMaximum());
  assertEquals(30, rm.getValue());

  reset(rm, 3);

  // should change value, and keep extent constant,
  // unless extent is > max - min.
  rm.setExtent(10);   // 0 < 0[9] < 99
  rm.setValue(90);    // 0 < 90[9] < 99
  rm.setMaximum(95);  // 0 < 90[6] < 96
  assertEquals(96, rm.getMaximum());
  assertEquals(87, rm.getValue());
  assertEquals(9, rm.getExtent());
}

function testExtent() {
  var rm = new goog.ui.RangeModel;

  rm.setExtent(10);
  assertEquals(10, rm.getExtent());

  rm.setExtent(-10);
  assertEquals(0, rm.getExtent());

  rm.setValue(50);
  rm.setExtent(100);
  assertEquals(50, rm.getExtent());
  assertEquals(50, rm.getValue());

  ////////////////
  // Change step
  reset(rm, 3);

  rm.setExtent(10);  // 0 < 0[9] < 99
  assertEquals(9, rm.getExtent());

  rm.setExtent(-10);
  assertEquals(0, rm.getExtent());

  rm.setValue(50);    // 0 < 51[9] < 99
  rm.setExtent(100);  // 0 < 51[48] < 99
  assertEquals(48, rm.getExtent());
  assertEquals(51, rm.getValue());
}

function testRoundToStep() {
  var rm = new goog.ui.RangeModel;
  rm.setStep(0.5);

  assertEquals(1, rm.roundToStep(1));
  assertEquals(0.5, rm.roundToStep(0.5));
  assertEquals(1, rm.roundToStep(0.75));
  assertEquals(0.5, rm.roundToStep(0.74));
}

function testRoundToStepWithMin() {
  var rm = new goog.ui.RangeModel;
  rm.setStep(0.5);
  rm.setMinimum(0.25);

  assertEquals(1.25, rm.roundToStepWithMin(1));
  assertEquals(0.75, rm.roundToStepWithMin(0.5));
  assertEquals(0.75, rm.roundToStepWithMin(0.75));
  assertEquals(0.75, rm.roundToStepWithMin(0.74));
}


text:
<?php
/**
 * OcProductToStore
 *
 * --- BEGIN ModelDoc ---
 *
 * --- END ModelDoc ---
 */

class OcProductToStore extends CActiveRecord
{

    /**
     * Returns the static model of the specified AR class.
     * @param string $className active record class name.
     * @return OcProductToStore the static model class
     */
    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }

    /**
     * @return string the associated database table name
     */
    public function tableName()
    {
        return '{{product_to_store}}';
    }

    /**
     * @return array customized attribute labels (name=>label)
     */
    public function attributeLabels()
    {
        return array(
            'product_id' => Yii::t('app', 'Product'),
            'store_id' => Yii::t('app', 'Store'),
        );
    }

}


text:
var createNewLinkLi = function(addLink) {
    var newLinkLi = $('

').append(addLink);
    return newLinkLi;
}

var createAddLink = function(entityClassName , entityName){
    var addLink = $('Add a ' + entityName + '');

    return addLink;

}

var $addCityLink = createAddLink("add_city_link" , "city");
var $addInfoLink = createAddLink("add_info_link" , "customer information");
var $addTripCityLink  = createAddLink("add_trip_city_link" , "a trip city");

var $newLinkCityLi = createNewLinkLi($addCityLink);
var $newLinkInfoLi = createNewLinkLi($addInfoLink);
var $newLinkTripCityLi = createNewLinkLi($addTripCityLink);

jQuery(document).ready(function() {

    $collectionHolder = $('ul.cities');
    $collectionHolder2 = $('ul.info');
    $collectionHolder3 = $('ul.tripCities');

    prepareForm($collectionHolder, $newLinkCityLi, $addCityLink);
    prepareForm($collectionHolder2, $newLinkInfoLi, $addInfoLink);
    prepareForm($collectionHolder3, $newLinkTripCityLi, $addTripCityLink);

});

var prepareForm = function (collectionHolder, newLi, $addLink){
    collectionHolder.find('li').each(function() {
        addFormDeleteLink($(this));
    });
    collectionHolder.append(newLi);
    collectionHolder.data('index', collectionHolder.find(':input').length);
    $addLink.on('click', function(e) {
        e.preventDefault();

        addForm(collectionHolder, newLi);
    });

}

function addForm($collectionHolder, $newLinkLi) {
    var prototype = $collectionHolder.data('prototype');

    var index = $collectionHolder.data('index');

    var newForm = prototype.replace(/__name__/g, index);

    $collectionHolder.data('index', index + 1);

    var $newFormLi = $('

').append(newForm);
    $newLinkLi.before($newFormLi);

    addFormDeleteLink($newFormLi);

}

function addFormDeleteLink($tagFormLi) {
    var $removeFormA = $('Delete');
    $tagFormLi.append($removeFormA);

    $removeFormA.on('click', function(e) {
        // prevent the link from creating a "#" on the URL
        e.preventDefault();

        // remove the li for the tag form
        $tagFormLi.remove();
    });
}


text:
import os
import yaml

from mock import Mock
from rospkg import RosPack, RosStack

def get_test_dir():
    return os.path.abspath(os.path.join(os.path.dirname(__file__), 'tree'))

def get_rospkg():
    # configure inside of the test tree
    test_dir = get_test_dir()
    ros_root = os.path.join(test_dir, 'ros')
    ros_package_path = os.path.join(test_dir, 'stacks')
    ros_paths = [ros_root, ros_package_path]
    rospack = RosPack(ros_paths=ros_paths)
    rosstack = RosStack(ros_paths=ros_paths)
    return rospack, rosstack

def test_RosPkgLoader():
    from rospkg import ResourceNotFound

    from rosdep2.model import RosdepDatabase
    from rosdep2.rospkg_loader import RosPkgLoader, DEFAULT_VIEW_KEY
    from rosdep2.loader import InvalidData

    # Due to rosdep 2/REP 125 changes, this test is a bit overbuilt.
    # All stacks return the same.

    # tripwire
    loader = RosPkgLoader()
    assert loader._rospack is not None
    assert loader._rosstack is not None

    # configure inside of the test tree
    rospack, rosstack = get_rospkg()
    ros_root = rosstack.get_path('ros')
    loader = RosPkgLoader(rospack, rosstack)
    assert loader._rospack == rospack
    assert loader._rosstack == rosstack

    # test with mock db
    rosdep_db = Mock(spec=RosdepDatabase)
    rosdep_db.is_loaded.return_value = False

    # test with no rosdep.yaml stack
    loader.load_view('empty', rosdep_db)
    rosdep_db.is_loaded.assert_called_with('empty')
    rosdep_db.set_view_data.assert_called_with('empty', {}, [], '<nodata>')

    # test invalid stack
    try:
        loader.load_view('does not exist', rosdep_db)
        assert False, "should have raised"
    except ResourceNotFound as e:
        pass

    # Test with default view key
    loader.load_view(DEFAULT_VIEW_KEY, rosdep_db)
    rosdep_db.set_view_data.assert_called_with(DEFAULT_VIEW_KEY, {}, [], '<nodata>')

    # test with complicated ros stack.
    loader.load_view('ros', rosdep_db)
    rosdep_db.is_loaded.assert_called_with('ros')
    rosdep_db.set_view_data.assert_called_with('ros', {}, [], '<nodata>')

    # test call on db that is already loaded
    rosdep_db.reset_mock()
    rosdep_db.is_loaded.return_value = True
    loader.load_view('ros', rosdep_db)
    rosdep_db.is_loaded.assert_called_with('ros')
    assert rosdep_db.set_view_data.call_args_list == []

    # test get_view_key, always the same return value
    assert loader.get_view_key('stack1_p1') == DEFAULT_VIEW_KEY
    assert loader.get_view_key('stackless') == DEFAULT_VIEW_KEY
    try:
        loader.get_view_key('fake')
        assert False, "should error"
    except ResourceNotFound: pass

def test_RosPkgLoader_with_underlay_key():
    from rospkg import ResourceNotFound

    from rosdep2.model import RosdepDatabase
    from rosdep2.rospkg_loader import RosPkgLoader, DEFAULT_VIEW_KEY
    from rosdep2.loader import InvalidData

    # configure inside of the test tree
    rospack, rosstack = get_rospkg()
    ros_root = rosstack.get_path('ros')
    loader = RosPkgLoader(rospack, rosstack, underlay_key='underlay-key')
    assert loader._rospack == rospack
    assert loader._rosstack == rosstack

    # test with mock db
    rosdep_db = Mock(spec=RosdepDatabase)
    rosdep_db.is_loaded.return_value = False

    # test with no rosdep.yaml stack
    loader.load_view('empty', rosdep_db)
    rosdep_db.is_loaded.assert_called_with('empty')
    rosdep_db.set_view_data.assert_called_with('empty', {}, ['underlay-key'], '<nodata>')

    # test invalid stack
    try:
        loader.load_view('does not exist', rosdep_db)
        assert False, "should have raised"
    except ResourceNotFound as e:
        pass

    # test with complicated ros stack.
    loader.load_view('ros', rosdep_db)
    rosdep_db.is_loaded.assert_called_with('ros')
    rosdep_db.set_view_data.assert_called_with('ros', {}, ['underlay-key'], '<nodata>')

    # test call on db that is already loaded
    rosdep_db.reset_mock()
    rosdep_db.is_loaded.return_value = True
    loader.load_view('ros', rosdep_db)
    rosdep_db.is_loaded.assert_called_with('ros')
    assert rosdep_db.set_view_data.call_args_list == []

    # test get_view_key
    assert loader.get_view_key('stack1_p1') == DEFAULT_VIEW_KEY
    assert loader.get_view_key('stackless') == DEFAULT_VIEW_KEY
    try:
        loader.get_view_key('fake')
        assert False, "should error"
    except ResourceNotFound: pass

def test_RosPkgLoader_get_loadable():
    from rosdep2.rospkg_loader import RosPkgLoader

    rospack, rosstack = get_rospkg()
    loader = RosPkgLoader(rospack, rosstack)
    assert loader._rospack == rospack
    assert loader._rosstack == rosstack

    keys = loader.get_loadable_resources()
    for p in ['stack1_p1', 'stack1_p2', 'stack1_p3']:
        assert p in keys
    keys = loader.get_loadable_views()
    for s in ['ros', 'empty', 'invalid', 'stack1']:
        assert s in keys


text:
$:.unshift( File.expand_path("../../lib", __FILE__) )

require 'bitcoin'
require_relative '../../support/blockchain'

blockchain = Blockchain.new

time = blockchain.time
height = blockchain.next_height(:main)
b = blockchain.build_next_block(nil, height, [], time)
blockchain.chain[:main][height] = b
Bitcoin.network[:genesis_hash] = b.hash

6.times{
  height = blockchain.next_height(:main)
  b = blockchain.build_next_block(b, height, [], time+=Bitcoin.network[:next_block_time_target])
  blockchain.chain[:main][height] = b
}

# for the 8th block redeem the output from 2nd block and send to two new addresses
prev_tx, prev_tx_output_index = blockchain.chain[:main][1].tx.first, 0
value = prev_tx.outputs[prev_tx_output_index].value
new_tx = Bitcoin::Protocol::Tx.new
new_tx.add_in Bitcoin::Protocol::TxIn.new(prev_tx.binary_hash, prev_tx_output_index, 0)

key = blockchain.new_key('first recipient')
new_tx.add_out Bitcoin::Protocol::TxOut.value_to_address(value/2, key.addr)

key = blockchain.new_key('second recipient')
new_tx.add_out Bitcoin::Protocol::TxOut.value_to_address(value/2, key.addr)

input_index = 0
privkey = blockchain.wallet[ Bitcoin::Script.new(prev_tx.outputs[prev_tx_output_index].script).get_address ][:privkey]
key = Bitcoin::Key.from_base58(privkey)
signature = key.sign(new_tx.signature_hash_for_input(input_index, prev_tx))
new_tx.in[input_index].script_sig = Bitcoin::Script.to_signature_pubkey_script(signature, nil)

new_tx = Bitcoin::Protocol::Tx.new( new_tx.to_payload )
raise "failed to generate testbox tx" unless new_tx.verify_input_signature(input_index, prev_tx) == true

height = blockchain.next_height(:main)
b = blockchain.build_next_block(b, height, [new_tx], time+=Bitcoin.network[:next_block_time_target])
blockchain.chain[:main][height] = b

blockchain.pretty_print_json


text:
package mx.developerbus.foodbus.utl;

import java.util.concurrent.TimeUnit;

import mx.developerbus.foodbus.R;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;

public class foodBUtil {

	public static String milliSecondsToTimer(long milliseconds) {
		String finalTimerString = "";
		String secondsString = "";

		int hours = (int) (milliseconds / (1000*60*60));
		int minutes = (int) (milliseconds % (1000*60*60) / (1000*60));
		int seconds = (int) ((milliseconds % (1000*60*60)) % (1000*60) / 1000);

		if(hours > 0) {
			finalTimerString = hours + ":";
		}
		if(seconds < 10) {
			secondsString = "0" + seconds;
		}
		else {
			secondsString = "" + seconds;
		}

		finalTimerString = finalTimerString + minutes + ":" + secondsString;

		return finalTimerString;
	}

	public static int getProgressPercentage(long currentDuration, long totalDuration) {
		Double percentage = (double) 0;

		long currentSeconds = (int) (currentDuration / 1000);
		long totalSeconds = (int) (totalDuration / 1000);

		percentage = (((double) currentSeconds) / totalSeconds) * 100;

		return percentage.intValue();
	}

	public static int progressToTimer(int progress, int totalDuration) {
		int currentDuration = 0;
		totalDuration = (int) (totalDuration / 1000);
		currentDuration = (int) ((((double) progress) / 100) * totalDuration);

		return currentDuration * 1000;
	}

	public static String milliToMinutes(String milliseconds) {
		Long millis = Long.parseLong(milliseconds);
		milliseconds = String.format("%dmin : %dsec", TimeUnit.MILLISECONDS.toMinutes(millis),
			    TimeUnit.MILLISECONDS.toSeconds(millis) -
			    TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millis)));

		return milliseconds;
	}

	public static boolean setFragmentWorkspace(boolean multipane,
			FragmentManager fragmentManager,
			Class<? extends Fragment> fragmentClass, boolean stacked)
			throws Exception {
		boolean replace = false;
		try {
			replace = setFragmentWorkspace(multipane, fragmentManager, fragmentClass, null, 0, 0, 0, 0, stacked);
		} catch (Exception e) {
			throw new Exception("ERROR Home - setFragment : " + e.getMessage());
		}

		return replace;
	}

	public static boolean setFragmentWorkspace(boolean multipane, FragmentManager fragmentManager, Class<? extends Fragment> fragmentClass) throws Exception {
		boolean replace = false;
		try {
			replace = setFragmentWorkspace(multipane, fragmentManager, fragmentClass, null, 0, 0, 0, 0, false);
		} catch (Exception e) {
			throw new Exception("ERROR Home - setFragment : " + e.getMessage());
		}

		return replace;
	}

	public static boolean setFragmentWorkspace(boolean multipane, FragmentManager fragmentManager, Class<? extends Fragment> fragmentClass, Bundle args, int enter, int exit, int popEnter, int popExit, boolean staked) throws Exception {
		boolean replace = false;
		try {

			if (fragmentClass != null) {
				Fragment fp = fragmentManager.findFragmentById(R.id.frgWorkspace);
				FragmentTransaction tra = fragmentManager.beginTransaction();

				if (enter > 0 && exit > 0 && popEnter > 0 && popExit > 0) {
					tra.setCustomAnimations(enter, exit, popEnter, popExit);
					tra.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
				} else {
					tra.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
				}

				Fragment f = fragmentClass.newInstance();
				Bundle b = new Bundle();
				b.putBoolean("multipane", multipane);
				if (args != null) {
					b.putAll(args);
				}
				f.setArguments(b);

				if (fp != null) {
					if (fp.getClass() != fragmentClass) {
						tra.replace(R.id.frgWorkspace, f);
						if (staked) {
							tra.addToBackStack(null);
						}
						replace = true;
					}
				} else {
					tra.add(R.id.frgWorkspace, f);
					replace = true;
				}
				tra.commit();
			}
		} catch (Exception e) {
			throw new Exception("ERROR Home - setFragment : " + e.getMessage());
		}
		return replace;
	}

	public static String getResourceString(Context cc, int stringId) {
		String s = null;
		if (cc != null) {
			s = cc.getString(stringId);
		}
		return s;
	}

	public static boolean isNullOrEmpty(String value) {
		boolean v = true;
		if (value != null && value.trim().equals("") == false
				&& value.equalsIgnoreCase("null") == false) {
			v = false;
		}
		return v;
	}

}


text:
$testing = true
SPEC = File.expand_path("#{Require.root}/spec")
$:.unshift File.expand_path("#{Require.root}/lib")

# For use with rspec textmate bundle
def debug(object)
  puts "<pre>"
  puts object.pretty_inspect.gsub('<', '<').gsub('>', '>')
  puts "</pre>"
end