text:
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding field 'Chapter.member_count_placeholder'
        db.add_column(u'chapters_chapter', 'member_count_placeholder',
                      self.gf('django.db.models.fields.IntegerField')(null=True, blank=True),
                      keep_default=False)

    def backwards(self, orm):
        # Deleting field 'Chapter.member_count_placeholder'
        db.delete_column(u'chapters_chapter', 'member_count_placeholder')

    models = {
        u'auth.group': {
            'Meta': {'object_name': 'Group'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        },
        u'auth.permission': {
            'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        u'chapters.chapter': {
            'Meta': {'object_name': 'Chapter'},
            u'_awards_excerpt': ('django.db.models.fields.TextField', [], {}),
            u'_description_excerpt': ('django.db.models.fields.TextField', [], {}),
            u'_philanthropy_excerpt': ('django.db.models.fields.TextField', [], {}),
            u'_potential_new_members_excerpt': ('django.db.models.fields.TextField', [], {}),
            'awards': ('model_utils.fields.SplitField', [], {u'no_excerpt_field': 'True', 'blank': 'True'}),
            'chapter_address': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'chapter_website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
            'cost': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
            'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
            'description': ('model_utils.fields.SplitField', [], {u'no_excerpt_field': 'True', 'blank': 'True'}),
            'facebook': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
            'fb_status': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'founding_year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'fraternity': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['fraternities.Fraternity']", 'null': 'True', 'blank': 'True'}),
            'fraternity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'gpa': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '3', 'decimal_places': '2', 'blank': 'True'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['auth.Group']", 'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'linked_active_group': ('django.db.models.fields.related.OneToOneField', [], {'blank': 'True', 'related_name': "'linked_chapter_active'", 'unique': 'True', 'null': 'True', 'to': u"orm['auth.Group']"}),
            'linked_admin_group': ('django.db.models.fields.related.OneToOneField', [], {'blank': 'True', 'related_name': "'linked_chapter_admin'", 'unique': 'True', 'null': 'True', 'to': u"orm['auth.Group']"}),
            'linked_call_group': ('django.db.models.fields.related.OneToOneField', [], {'blank': 'True', 'related_name': "'linked_chapter_call'", 'unique': 'True', 'null': 'True', 'to': u"orm['auth.Group']"}),
            'linked_group': ('django.db.models.fields.related.OneToOneField', [], {'blank': 'True', 'related_name': "'linked_chapter'", 'unique': 'True', 'null': 'True', 'to': u"orm['auth.Group']"}),
            'linked_pending_group': ('django.db.models.fields.related.OneToOneField', [], {'blank': 'True', 'related_name': "'linked_chapter_pending'", 'unique': 'True', 'null': 'True', 'to': u"orm['auth.Group']"}),
            'linked_pledge_group': ('django.db.models.fields.related.OneToOneField', [], {'blank': 'True', 'related_name': "'linked_chapter_pledge'", 'unique': 'True', 'null': 'True', 'to': u"orm['auth.Group']"}),
            'linked_rush_group': ('django.db.models.fields.related.OneToOneField', [], {'blank': 'True', 'related_name': "'linked_chapter_rush'", 'unique': 'True', 'null': 'True', 'to': u"orm['auth.Group']"}),
            'location': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'member_count_placeholder': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
            'philanthropy': ('model_utils.fields.SplitField', [], {u'no_excerpt_field': 'True', 'blank': 'True'}),
            'potential_new_members': ('model_utils.fields.SplitField', [], {u'no_excerpt_field': 'True', 'blank': 'True'}),
            'rush_form': ('django.db.models.fields.related.OneToOneField', [], {'blank': 'True', 'related_name': "'chapter'", 'unique': 'True', 'null': 'True', 'to': u"orm['rush_forms.Form']"}),
            'slug': ('django.db.models.fields.CharField', [], {'max_length': '2000', 'null': 'True', 'blank': 'True'}),
            'status': ('model_utils.fields.StatusField', [], {'default': "'excellence'", 'max_length': '100', u'no_check_for_status': 'True'}),
            'status_changed': ('model_utils.fields.MonitorField', [], {'default': 'datetime.datetime.now', u'monitor': "u'status'"}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
            'university': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['universities.University']", 'null': 'True', 'blank': 'True'}),
            'university_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'})
        },
        u'chapters.position': {
            'Meta': {'object_name': 'Position'},
            'chapter': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['chapters.Chapter']"}),
            'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
            'slug': ('django.db.models.fields.CharField', [], {'max_length': '2000', 'null': 'True', 'blank': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '500'})
        },
        u'contenttypes.contenttype': {
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        u'fraternities.fraternity': {
            'Meta': {'object_name': 'Fraternity'},
            u'_description_excerpt': ('django.db.models.fields.TextField', [], {}),
            'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
            'description': ('model_utils.fields.SplitField', [], {u'no_excerpt_field': 'True', 'blank': 'True'}),
            'facebook': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
            'fb_status': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'gpa': ('django.db.models.fields.FloatField', [], {'default': '0'}),
            'group': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['auth.Group']", 'unique': 'True', 'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
            'slug': ('django.db.models.fields.CharField', [], {'max_length': '2000', 'null': 'True', 'blank': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '500'})
        },
        u'rush_forms.form': {
            'Meta': {'object_name': 'Form'},
            'button_text': ('django.db.models.fields.CharField', [], {'default': "u'Submit'", 'max_length': '50'}),
            'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
            'email_copies': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
            'email_from': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'email_message': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'email_subject': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
            'response': ('django.db.models.fields.TextField', [], {}),
            'send_email': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'slug': ('django.db.models.fields.CharField', [], {'max_length': '2000', 'null': 'True', 'blank': 'True'}),
            'status': ('model_utils.fields.StatusField', [], {'default': "u'draft'", 'max_length': '100', u'no_check_for_status': 'True'}),
            'status_changed': ('model_utils.fields.MonitorField', [], {'default': 'datetime.datetime.now', u'monitor': "u'status'"}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '500'})
        },
        u'universities.university': {
            'Meta': {'object_name': 'University'},
            'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
            'group': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.Group']", 'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
            'slug': ('django.db.models.fields.CharField', [], {'max_length': '2000', 'null': 'True', 'blank': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '500'})
        }
    }

    complete_apps = ['chapters']


text:
package org.kaazing.net.ws.amqp.impl;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Stack;

import org.kaazing.net.ws.amqp.AmqpArguments;
import org.kaazing.net.ws.amqp.AmqpArguments.AmqpTableEntry;

import org.kaazing.gateway.client.util.WrappedByteBuffer;

/**
 * Internal class
 * @private
 */
public final class AmqpBuffer extends WrappedByteBuffer {

    /**
     * Data and framing layer for the AMQP protocol
     */
    private byte bitCount;

    public enum Type{
        BIT, SHORTSTRING, LONGSTRING, TABLE, INT, UNSIGNEDINT, UNSIGNEDSHORT,
        UNSIGNED, SHORT, LONG, PATH, LONGLONG, VOID, OCTET, FIELDTABLE,
        TIMESTAMP
    }

    public enum InType{
        CLASSID, CONSUMERTAG, DELIVERYTAG, EXCHANGENAME, METHODID, NOACK, NOLOCAL, NOWAIT, PATH, PEERPROPERTIES,
        QUEUENAME, REDELIVERED, MESSAGECOUNT, REPLYCODE, REPLYTEXT, BIT, OCTET, SHORT, LONG, LONGLONG, SHORTSTR,
        LONGSTR, TIMESTAMP, TABLE, VOID, FIELDTABLE, INT
    }
    private HashMap<Character, String> typeIdentifierMap = new HashMap<Character, String>();
    private HashMap<String, String> typeNameMap = new HashMap<String, String>();
    private HashMap<String, Object> contentProperties = new HashMap<String, Object>();

    public static ArrayList<BasicProperties> basicProperties;

   /**
    * Internal class
    * Data and framing layer for the AMQP protocol
    * @param bytes
    */
    private AmqpBuffer(byte[] bytes)
    {
        // consecutive bit counter for bit packing
        super(bytes);
        this.bitCount = 0;
        this.init();
    }

    public AmqpBuffer()
    {
        this.init();
    }

    private void init()
    {
        typeIdentifierMap.put('S', "Longstr");
        typeIdentifierMap.put('I', "int");
        typeIdentifierMap.put('F', "FieldTable");
        typeIdentifierMap.put('V', "Void");

        typeNameMap.put("Longstr", "S");
        typeNameMap.put("int", "I");
        typeNameMap.put("Void", "V");
    }

    /**
     * Encodes the AMQPLAIN authentication response as an AmqpArguments
     */
    public String encodeAuthAmqPlain(String username, String password)
    {

        AmqpBuffer bytes = new AmqpBuffer();
        bytes.putShortString("LOGIN");
        bytes.putTypeIdentifier("Longstr");
        bytes.putLongString(username);

        bytes.putShortString("PASSWORD");
        bytes.putTypeIdentifier("Longstr");
        bytes.putLongString(password);
        bytes.flip();

        int len = bytes.remaining();
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < len; i++)
        {
            builder.append((char)(bytes.getUnsigned()));
        }
        String s = builder.toString();
        return s;
    }

    /**
     * getLongString returns an AMQP long String, which is a String prefixed
     * by a unsigned 32 bit integer.
     *
     * @public
     * @function
     * @name getLongString
     * @memberOf AmqpBuffer
     */

    private String getLongString()
    {
        long len = this.getUnsignedInt();
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < len; i++)
        {
            builder.append((char)(this.getUnsigned()));
        }
        String s = builder.toString();
        return s;
    }

    /**
     * getShortString returns an AMQP Short String
     * @return
     */
    private String getShortString()
    {
        int len = this.getUnsigned();
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < len; i++)
        {
            builder.append((char)(this.getUnsigned()));
        }
        String s = builder.toString();
        return s;
    }

    /**
     * putUnsignedLong puts an AMQP unsigned Long
     * @param v
     * @return ByteBuffer
     */
    private WrappedByteBuffer putUnsignedLong(long v)
    {
        this.putInt(0);
        return this.putUnsignedInt((int)v);
    }

    /**
     * getUnsignedLong gets an AMQP unsigned Long
     * @return long
     */
    private long getUnsignedLong()
    {
        // For unsigned longs (8 byte integers)
        // throw away the first word, then read the next
        // word as an unsigned int
        this.getInt();
        return this.getUnsignedInt();
    }

    private long getMilliseconds() {
        return this.getLong();
    }

    private WrappedByteBuffer putMilliseconds(long millis) {
        return this.putLong(millis);
    }

    private String getTypeIdentifier()
    {
        char c = (char)(this.getUnsigned());
        return typeIdentifierMap.get(c);
    }

    private void putTypeIdentifier(String type)
    {
        String ti = typeNameMap.get(type);
        char c = ti.charAt(0);
        byte charCode = (byte)c;
        this.putUnsigned(charCode);
    }

    private Object getFieldValue() {
        int typeCode = getUnsigned();
        switch(typeCode) {
        case 116:   // 't'
            boolean b = getUnsigned() != 0;
            return b;
        default:
            throw new IllegalStateException("Decoding Error in AmqpBuffer: cannot decode field value");
        }
    }

    private Map<String,Object> getFieldTable() {
        Map<String,Object> t = new HashMap<String,Object>();
        int len = (int)getUnsignedInt();
        int initial = position();
        while (len > (position()-initial)) {
            String key = getShortString();
            Object value = getFieldValue();
            t.put(key,value);
        }
        return t;
    }

    private AmqpArguments getTable()
    {
        long len = (long)getUnsignedInt();
        long end = this.position() + len;

        ArrayList<AmqpTableEntry> entries = new ArrayList<AmqpTableEntry>();
        while (position() < end) {
            String key = getShortString();
            String ti = getTypeIdentifier();
            String typeCodec = getMappedType(ti);
            Object value = getObjectOfType(typeCodec);

            AmqpArguments.AmqpTableEntry entry =
                      new AmqpArguments.AmqpTableEntry(key, value, ti);
            entries.add(entry);
        }

        if (entries.isEmpty()) {
            return null;
        }

        AmqpArguments args = new AmqpArguments();
        args.tableEntryArray = entries;
        return args;
    }

     private int getBit()
    {
        return this.getUnsigned();
    }

    /**
     * Packs one (of possibly several) boolean values as bits into a single 8-bit
     * field.
     *
     * If the last value written was a bit, the buffer's bit flag is false.
     * If the buffer's bit flag is set, putBit will try to pack the current bit
     * value into the same byte.
     */

     private AmqpBuffer putBit(Boolean v)
    {
        byte value = 0;
        if (v)
        {
            value = 1;
        }
        if (this.bitCount > 0)
        {
            byte lastByte = this.getAt(this.position() - 1);
            lastByte = (byte)((value << this.bitCount) | lastByte);
            this.putAt(this.position() - 1, lastByte);
        }
        else
        {
            this.putUnsigned(value);
        }
        return this;
    }

     private void putLongString(String s)
    {
        this.putUnsignedInt(s.length());
        for (int i = 0; i < s.length(); i++)
        {
            char c = s.charAt(i);
            byte charCode = (byte)c;

            this.putUnsigned(charCode);
        }
    }

     private void putShortString(String s)
    {
        this.putUnsigned((byte)s.length());
        for (int i = 0; i < s.length(); i++)
        {
            char c = s.charAt(i);
            byte charCode = (byte)c;
            this.putUnsigned(charCode);
        }
    }

    private void putTable(Object table)
    {
        if (table == null)
        {
            this.putUnsignedInt(0);
        }
        else
        {
            AmqpArguments arg = (AmqpArguments)table;
            List<AmqpTableEntry> entries = (List<AmqpTableEntry>)arg.tableEntryArray;
            AmqpTableEntry entry = null;
            AmqpBuffer bytes = new AmqpBuffer();
            for (int i = 0; i < entries.size(); i++)
            {
                entry = (AmqpTableEntry)entries.get(i);

                bytes.putShortString(entry.getKey());

                bytes.putTypeIdentifier(entry.getType());

                String type1 = getMappedType(entry.getType());

                bytes.putObjectOfType(type1, entry.getValue());

            }
            bytes.flip();
            this.putUnsignedInt(bytes.remaining());
            this.putBuffer(bytes);
        }
    }

    ////////////////////////////////////////////////////////////////////////////////
    // Frame types
    ////////////////////////////////////////////////////////////////////////////////

    private FrameHeader getFrameHeader()
    {
        int frameType = this.getUnsigned();
        int channel = this.getUnsignedShort();
        long size =  this.getUnsignedInt();

        FrameHeader header = new FrameHeader();
        header.frameType = frameType;
        header.size = size;
        header.channel = channel;

        return header;
    }

    /**
     * Decodes arguments given a method's parameter list
     */

     private Arg[] getMethodArguments(List<Parameter> param)
    {

         Arg[] val = new Arg[param.size()];
        for (int i = 0; i < param.size(); i++)
        {
            String type = param.get(i).type;

            Arg arg = new Arg();
            arg.type = type;
            arg.name = param.get(i).name;
            Object v = null;
            String type1 = null;
            try
            {
                type1 = this.getMappedType(type);
                v = getObjectOfType(type1);
            }
            catch (Exception e)
            {
                throw new IllegalStateException("type codec failed for type " + type + " for domain " + e.getMessage());
            }

            // support unpacking of consecutive bits from a single byte
            this.bitCount = (byte)((type1 == "Bit") ? this.bitCount + 1 : 0);

            arg.value = v;
            val[i]=arg;
        }

        return val;
    }

     /**
      * Parses the ByteBuffer and returns an AMQP frame
      * @return AmqpFrame
      */
     public AmqpFrame getFrame()
    {
        int pos = this.position();
        AmqpMethod method = new AmqpMethod();
        int classIndex;
        AmqpFrame frame = new AmqpFrame();

        // If there is at least one Frame in the buffer, attempt to decode it.
        if (this.remaining() > 7)
        {
            frame.setHeader(this.getFrameHeader());
            frame.setChannelId((short) frame.getHeader().channel);
            frame.setType((short) frame.getHeader().frameType);
            // the buffer must have an additional byte for the Frame end marker

            if (this.remaining() >= frame.getHeader().size + 1)
            {
                switch (frame.getType())
                {
                    case AmqpConstants.FRAME_BODY:
                        WrappedByteBuffer body = new AmqpBuffer();
                        // copy body into new Buffer
                        int end = this.position() + (int)frame.getHeader().size;
                        while (position() < end)
                        {
                            body.put(get());
                        }
                        frame.setBody(body);
                        frame.setMethodName("body");
                        break;

                    case AmqpConstants.FRAME_HEADER:
                        classIndex = this.getUnsignedShort();
                        @SuppressWarnings("unused")
                        short weight = (short)this.getUnsignedShort();
                        @SuppressWarnings("unused")
                        long bodySize = this.getUnsignedLong();

                        frame.setContentProperties(this.getContentProperties());
                        frame.setMethodName("header");
                        break;

                    case AmqpConstants.FRAME_METHOD:
                         classIndex = this.getUnsignedShort();
                        int methodIndex = this.getUnsignedShort();
                        String indexes = String.valueOf(classIndex) + String.valueOf(methodIndex);
                        method = MethodLookup.LookupMethod(indexes);

                        // pull parameter list off of method
                        List<Parameter> params = method.allParameters;

                        frame.setMethodName(method.name);
                        frame.setArgs(this.getMethodArguments(params));
                        break;

                    case AmqpConstants.FRAME_HEARTBEAT:
                    case AmqpConstants.FRAME_RABBITMQ_HEARTBEAT:
                    	throw new IllegalStateException("Received heartbeat frame even though the client has expressed no interest in heartbeat via tune-ok method.");

                    default:
                    	throw new IllegalStateException("Unrecognized AMQP 0-9-1 Frame type = " + frame.getType());
                }

                short frameEnd = (short) this.getUnsigned();
                if (frameEnd != AmqpConstants.FRAME_END)
                {
                    throw new IllegalStateException("Invalid end of AMQP method frame");
                }
            }
            else
            {
                this.position(pos);
                return null;
            }
            return frame;
        }
        return null;
    }

     public AmqpBuffer putMethodFrame(AmqpMethod method, short channel, Object[] args)
    {

        short classIndex = method.classIndex;
        short methodIndex = method.index;

        AmqpBuffer payload = new AmqpBuffer();
        payload.putUnsignedShort(classIndex);

        payload.putUnsignedShort(methodIndex);

        payload.putMethodArguments(args, method.allParameters);

        // compute size from payload bytes
        payload.flip();

        return this.putFrame((byte)AmqpConstants.FRAME_METHOD, channel, payload);

    }

     private AmqpBuffer putFrame(byte type, short channel, WrappedByteBuffer payload)
    {
        this.putUnsigned(type);
        this.putUnsignedShort(channel);

        // compute size from payload bytes
        int size = payload.remaining();
        this.putUnsignedInt(size);
        this.putBuffer(payload);

        // write terminator
        this.putUnsigned((byte)AmqpConstants.FRAME_END);
        return this;
    }

    public AmqpBuffer putHeaderFrame(short channel, short classIndex, short weight, long bodySize, HashMap<String, Object> contentProperties)
    {
        AmqpBuffer payload = new AmqpBuffer();
        payload.putUnsignedShort(classIndex);
        payload.putUnsignedShort(weight);
        payload.putUnsignedLong(bodySize);
        payload.putContentProperties(contentProperties);

        payload.flip();
        return this.putFrame((byte)AmqpConstants.FRAME_HEADER, channel, payload);
    }

    public AmqpBuffer putBodyFrame(short channel, WrappedByteBuffer payload)
    {
        return this.putFrame((byte)AmqpConstants.FRAME_BODY, channel, payload);
    }

    /**
     * Encodes arguments given a method's parameter list and the provided arguments
     */
    AmqpBuffer putMethodArguments(Object[] args, List<Parameter> formalParams)
    {

        for (int i = 0; i < formalParams.size(); i++)
        {

            String type = formalParams.get(i).type;

            if (type == null)
            {
                throw new IllegalStateException("Unknown AMQP domain " + type);
            }
            String typeMap = getMappedType(type);

            putObjectOfType(typeMap, args[i]);
            // support packing of consecutive bits into a single byte
            this.bitCount = (byte)((typeMap == "Bit") ? this.bitCount + 1 : 0);
        }
        return this;
    }

    private Object getObjectOfType(String type)
    {
        Object value = null;
        switch (Type.valueOf(type.toUpperCase()))
        {
            case BIT:
                value = this.getBit();
                break;
            case SHORTSTRING:
                value = this.getShortString();
                break;
            case LONGSTRING:
                value = this.getLongString();
                break;
            case FIELDTABLE:
                value = this.getFieldTable();
                break;
            case TABLE:
                value = this.getTable();
                break;
            case INT:
                value = this.getInt();
                break;
            case UNSIGNEDINT:
                value = this.getUnsignedInt();
                break;
            case UNSIGNEDSHORT:
                value = this.getUnsignedShort();
                break;
            case UNSIGNED:
                value = this.getUnsigned();
                break;
            case SHORT:
                value = this.getUnsignedShort();
                break;
            case LONG:
                value = this.getUnsignedInt();
                break;
            case OCTET:
                value = this.getUnsigned();
                break;
            case PATH:
                value = this.getShortString();
                break;
            case LONGLONG:
                value = this.getUnsignedLong();
                break;
            case TIMESTAMP:
                long millis = this.getMilliseconds();
                value = new Timestamp(millis);
                break;
            case VOID:
                value = null;
                break;
            default:
                String s = "Invalid type: '" + type + "' not found in _typeCodeMap";
                throw new IllegalStateException(s);
        }
        return value;
    }

    private void putObjectOfType(String type, Object value)
    {
          switch (Type.valueOf(type.toUpperCase()))
          {
                case BIT:
                    this.putBit((Boolean)value);
                    break;
                case SHORTSTRING:
                    this.putShortString((String)value);
                    break;
                case LONGSTRING:
                    this.putLongString((String)value);
                    break;
                case TABLE:
                    this.putTable(value);
                    break;
                case INT:
                    this.putInt((Integer)value);
                    break;
                case UNSIGNEDINT:
                    this.putUnsignedInt((Integer)value);
                    break;
                case UNSIGNEDSHORT:
                    this.putUnsignedShort((Short)value);
                    break;
                case UNSIGNED:
                    this.putUnsigned((Integer)value);
                    break;
                case SHORT:
                    int channelmax = (Integer)value;
                    this.putUnsignedShort((short)channelmax);
                    break;
                case LONG:
                    this.putUnsignedInt((Integer)value);
                    break;
                case PATH:
                    this.putShortString((String)value);
                    break;
                case LONGLONG:
                    long val = (Long)value;
                    this.putUnsignedLong((long)val);
                    break;
                case TIMESTAMP:
                    long millis = ((Timestamp)value).getTime();
                    this.putMilliseconds(millis);
                    break;
                case VOID:
                    // We do not encode the null value on the wire. The type 'V'
                    // indicates a null value.
                    break;
                default:
                    String s = "Invalid type: '" + type + "' not found in _typeCodeMap";
                    throw new IllegalStateException(s);
          }
    }

    private HashMap<String, Object> getContentProperties()
    {
        int packedPropertyFlags = this.getUnsignedShort();
        Stack<Integer> propertyFlags = new Stack<Integer>();
        int k=0;
        for (int i = 0; i <= 15; i++)
        {
            int bit = (packedPropertyFlags >> (i)) & 0x01;
            if (bit != 0)
            {
                propertyFlags.push(i+1);
            }
        }
        // int len = basicProperties.size();
        int sz = propertyFlags.size();

        for (int i = 0; i < sz; i++)
        {
            k = 16 - propertyFlags.pop();

            String propertyName = basicProperties.get(k).name;
            String propertyDomain = basicProperties.get(k).domain;
            String propertyType = this.getMappedType(propertyDomain);

            contentProperties.put(propertyName, getObjectOfType(propertyType));
        }
        return contentProperties;
    }

    private AmqpBuffer putContentProperties(HashMap<String, Object> contentProperties)
    {
        if (contentProperties.size() == 0) {
            this.putUnsignedShort((short) 0);
            return this;
        }

        int tempPackedPropertyFlags=0;
        short packedPropertyFlags = 0x00;
        List<Properties> properties = new ArrayList<Properties>();

        for (BasicProperties property : basicProperties) {
            Object propertyValue = contentProperties.get(property.name);
            if (propertyValue != null)
            {
                properties.add(new Properties(property.name, propertyValue, property.domain));
                tempPackedPropertyFlags = tempPackedPropertyFlags << 1 | 0x1;
            }
            else
            {
                tempPackedPropertyFlags = tempPackedPropertyFlags << 1;
            }
        }

        packedPropertyFlags = (short)(tempPackedPropertyFlags << 2);
        this.putUnsignedShort(packedPropertyFlags);

        for (int i = 0; i < properties.size(); i++)
        {
            Properties property = new Properties();
            property = properties.get(i);
            String propertyDomain = property.domain;
            String type = getMappedType(propertyDomain);
            this.putObjectOfType(type, property.propertyValue);
        }
        return this;
    }

    private String getMappedType(String inType)
    {
        switch (InType.valueOf(inType.toUpperCase()))
        {
            case CLASSID:
                return "Short";
            case CONSUMERTAG:
                return "ShortString";
            case DELIVERYTAG:
                return "LongLong";
            case EXCHANGENAME:
                return "ShortString";
            case METHODID:
                return "Short";
            case NOACK:
                return "Bit";
            case NOLOCAL:
                return "Bit";
            case NOWAIT:
                return "Bit";
            case PATH:
                return "ShortString";
            case PEERPROPERTIES:
                return "Table";
            case QUEUENAME:
                return "ShortString";
            case REDELIVERED:
                return "Bit";
            case MESSAGECOUNT:
                return "Long";
            case REPLYCODE:
                return "Short";
            case REPLYTEXT:
                return "ShortString";
            case BIT:
                return "Bit";
            case OCTET:
                return "Unsigned";
            case SHORT:
                return "Short";
            case LONG:
                return "Long";
            case LONGLONG:
                return "LongLong";
            case SHORTSTR:
                return "ShortString";
            case LONGSTR:
                return "LongString";
            case TIMESTAMP:
                return "Timestamp";
            case TABLE:
                return "Table";
            case FIELDTABLE:
                return "FieldTable";
            case INT:
                return "Int";
            case VOID:
                return "Void";
            default:
                throw new IllegalStateException("Error in getMappedType()");
        }
    }

    WrappedByteBuffer readBuffer = WrappedByteBuffer.allocate(1024);

    public void appendBuffer(WrappedByteBuffer in) {
        int p = readBuffer.position();
        readBuffer.skip(readBuffer.remaining());
        readBuffer.putBuffer(in);
        readBuffer.flip();
        readBuffer.position(p);
    }

    public AmqpFrame readFrame() {
        return null;
    }

    public static class BasicProperties
    {
         public String name;
         public String domain;
         public String label;
    }

    public class Arg
    {
        public String name;
        public String type;
        public Object value;
    }
}

class FrameHeader
{
     int frameType;
     long size;
     int channel;
}

 class Entry
{
     String key;
     String type;
     String value;
}

class Properties
{
     String propertyName;
     Object propertyValue;
     String domain;

     Properties(String propertyName, Object propertyValue, String domain)
    {
        this.propertyName = propertyName;
        this.propertyValue = propertyValue;
        this.domain = domain;
    }
     Properties()
    {
    }
}

redpajama_set_name: RedPajamaGithub


text:
package gr.charos.mailer.service;

import java.util.Set;

public interface AddressReader {

	Set<String> readAddresses(String path);
}


text:
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require('@angular/core');
var router_1 = require('@angular/router');
var user_component_1 = require('./user.component');
var user_profile_component_1 = require('./user-profile/user-profile.component');
var update_profile_component_1 = require('./update-profile/update-profile.component');
var user_publications_component_1 = require('./user-publications/user-publications.component');
var past_orders_component_1 = require('./past-orders/past-orders.component');
var routes = [
    {
        path: '',
        component: user_component_1.UserComponent,
        children: [
            {
                path: '',
                component: user_profile_component_1.UserProfileComponent
            },
            {
                path: 'update',
                component: update_profile_component_1.UpdateProfileComponent,
            },
            {
                path: 'publications',
                component: user_publications_component_1.UserPublicationsComponent,
            },
            {
                path: 'pastorders',
                component: past_orders_component_1.PastOrdersComponent,
            },
        ]
    },
];
var UserRoutingModule = (function () {
    function UserRoutingModule() {
    }
    UserRoutingModule = __decorate([
        core_1.NgModule({
            imports: [router_1.RouterModule.forChild(routes)],
            exports: [router_1.RouterModule],
        }),
        __metadata('design:paramtypes', [])
    ], UserRoutingModule);
    return UserRoutingModule;
}());
exports.UserRoutingModule = UserRoutingModule;
exports.routedComponents = [
    user_profile_component_1.UserProfileComponent,
    user_component_1.UserComponent,
    update_profile_component_1.UpdateProfileComponent,
    user_publications_component_1.UserPublicationsComponent,
    past_orders_component_1.PastOrdersComponent
];
//# sourceMappingURL=user-routing.module.js.map


text:
SitemapGenerator::Sitemap.default_host = "http://www.psara-institute.com"
SitemapGenerator::Sitemap.sitemaps_path = 'sitemaps/'
SitemapGenerator::Sitemap.create do
  # Put links creation logic here.
  add 'static_pages/logo'
  add 'static_pages/jobs'
  add 'static_pages/home'
  add 'static_pages/message'
  add 'inquiry'

  Post.find_each do |post|
    add post_path(product), :lastmod => product.updated_at
  end

  # The root path '/' and sitemap index file are added automatically for you.
  # Links are added to the Sitemap in the order they are specified.
  #
  # Usage: add(path, options={})
  #        (default options are used if you don't specify)
  #
  # Defaults: :priority => 0.5, :changefreq => 'weekly',
  #           :lastmod => Time.now, :host => default_host
  #
  # Examples:
  #
  # Add '/articles'
  #
  #   add articles_path, :priority => 0.7, :changefreq => 'daily'
  #
  # Add all articles:
  #
  #   Article.find_each do |article|
  #     add article_path(article), :lastmod => article.updated_at
  #   end
end


text:
using Swashbuckle.Swagger;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
using System.Web.Http.Description;

namespace Stardust.Aadb2c.Swagger
{
    internal class AssignOAuth2SecurityRequirements : IOperationFilter
    {
        private readonly ScopeDescription[] _scopes;

        internal AssignOAuth2SecurityRequirements(ScopeDescription[] scopes)
        {
            _scopes = scopes;
        }

        public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription)
        {
            var scopes = new List<string> { "openid" };
            scopes.AddRange(_scopes.Select(s => s.ScopeName));
            var actFilters = apiDescription.ActionDescriptor.GetFilterPipeline();
            var allowsAnonymous = actFilters.Select(f => f.Instance).OfType<OverrideAuthorizationAttribute>().Any();
            if (allowsAnonymous)
                return;
            if (operation.security == null)
                operation.security = new List<IDictionary<string, IEnumerable<string>>>();

            var oAuthRequirements = new Dictionary<string, IEnumerable<string>>
            {
                {"oauth2", scopes}
            };

            operation.security.Add(oAuthRequirements);
        }
    }
}


text:
#include <boost/assert.hpp>
#include <boost/thread.hpp>
#include "stromx/runtime/Enum.h"
#include "stromx/runtime/Exception.h"
#include "stromx/runtime/ExceptionObserver.h"
#include "stromx/runtime/None.h"
#include "stromx/runtime/Operator.h"
#include "stromx/runtime/OperatorKernel.h"
#include "stromx/runtime/Primitive.h"
#include "stromx/runtime/Registry.h"
#include "stromx/runtime/Stream.h"
#include "stromx/runtime/Thread.h"
#include "stromx/runtime/impl/InputNode.h"
#include "stromx/runtime/impl/MutexHandle.h"
#include "stromx/runtime/impl/Network.h"
#include "stromx/runtime/impl/OutputNode.h"
#include "stromx/runtime/impl/ThreadImplObserver.h"

namespace stromx
{
    namespace runtime
    {
        /** \cond */
        class Stream::InternalThreadObserver : public impl::ThreadImplObserver
        {
        public:
            InternalThreadObserver(const Stream* const stream, const Thread* const thread)
              : m_stream(stream),
                m_thread(thread)
            {}

            virtual void observe(const OperatorError & ex) const
            {
                m_stream->observeException(ExceptionObserver::EXECUTION, ex, m_thread);
            }

        private:
            const Stream* m_stream;
            const Thread* m_thread;
        };

        class Stream::InternalNetworkObserver : public impl::NetworkObserver
        {
        public:
            InternalNetworkObserver(const Stream* const stream)
              : m_stream(stream)
            {}

            virtual void observe(const OperatorError & ex, const ExceptionObserver::Phase phase) const
            {
                m_stream->observeException(phase, ex, 0);
            }

        private:
            const Stream* m_stream;
        };
        /** \endcond */

        Stream::Stream()
          : m_network(new impl::Network()),
            m_threads(0),
            m_observerMutex(new impl::MutexHandle),
            m_status(INACTIVE),
            m_factory(0),
            m_delayMutex(new impl::MutexHandle),
            m_delay(0)
        {
            InternalNetworkObserver* observer = new InternalNetworkObserver(this);
            m_network->setObserver(observer);
        }

        Stream::~Stream()
        {
            // stop all visible threads
            for (std::vector<Thread*>::iterator iter = m_threads.begin();
                iter != m_threads.end();
                ++iter)
            {
                (*iter)->stop();
            }

            // interrupt the network
            m_network->interrupt();

            // in the meantime delete all uninitialized operators
            for (std::set<Operator*>::iterator iter = m_uninitializedOperators.begin();
                iter != m_uninitializedOperators.end();
                ++iter)
            {
                delete (*iter);
            }
            m_uninitializedOperators.clear();

            // ...the same for the hidden operators...
            for (std::set<Operator*>::iterator iter = m_hiddenOperators.begin();
                iter != m_hiddenOperators.end();
                ++iter)
            {
                delete (*iter);
            }
            m_hiddenOperators.clear();

            // ...and the hidden threads
            for (std::set<Thread*>::iterator iter = m_hiddenThreads.begin();
                iter != m_hiddenThreads.end();
                ++iter)
            {
                delete (*iter);
            }
            m_hiddenThreads.clear();

            // now join and delete the threads
            for (std::vector<Thread*>::iterator iter = m_threads.begin();
                iter != m_threads.end();
                ++iter)
            {
                delete (*iter);
            }

            // delete the rest
            delete m_network;
            delete m_observerMutex;
            delete m_delayMutex;
        }

        const std::vector<Operator*>& Stream::operators() const
        {
            return m_operators;
        }

        void Stream::setFactory(const AbstractFactory*const factory)
        {
            if (m_status != INACTIVE)
                throw WrongState("Factory can not be set if the stream is not inactive.");

            m_factory = factory;

            for (std::vector<Operator*>::iterator iter = m_operators.begin();
                 iter != m_operators.end();
                 ++iter)
            {
                (*iter)->setFactory(factory);
            }
        }

        const std::vector<Operator*>& Stream::initializedOperators() const
        {
            return m_network->operators();
        }

        void Stream::start()
        {
            if (m_status != INACTIVE)
            {
                throw WrongState("Stream object not inactive.");
            }

            try
            {
                m_network->activate();
                for (std::vector<Thread*>::iterator iter = m_threads.begin();
                    iter != m_threads.end();
                    ++iter)
                {
                    (*iter)->start();
                }

                m_status = ACTIVE;
            }
            catch(OperatorError &)
            {
                // an error occurred while activating the network
                // make sure all operators are deactivated
                m_network->deactivate();
                throw;
            }
        }

        void Stream::pause()
        {
            if (m_status != ACTIVE)
            {
                throw WrongState("Stream object not active.");
            }

            for (std::vector<Thread*>::iterator iter = m_threads.begin();
                iter != m_threads.end();
                ++iter)
            {
                (*iter)->pause();
            }

            m_status = PAUSED;
        }

        void Stream::resume()
        {
            if (m_status != PAUSED)
            {
                throw WrongState("Stream object not active.");
            }

            for (std::vector<Thread*>::iterator iter = m_threads.begin();
                iter != m_threads.end();
                ++iter)
            {
                (*iter)->resume();
            }

            m_status = ACTIVE;
        }

        void Stream::join()
        {
            if (m_status == INACTIVE)
            {
                return;
            }

            if (m_status != DEACTIVATING)
            {
                throw WrongState("Stream object not deactivating.");
            }

            for (std::vector<Thread*>::iterator iter = m_threads.begin();
                iter != m_threads.end();
                ++iter)
            {
                (*iter)->join();
                BOOST_ASSERT((*iter)->status() == Thread::INACTIVE);
            }

            try
            {
                m_network->deactivate();
            }
            catch(OperatorError & ex)
            {
                // send any operator exceptions to the observers
                observeException(ExceptionObserver::DEACTIVATION, ex, 0);
            }

            m_status = INACTIVE;
        }

        void Stream::stop()
        {
            if (m_status == INACTIVE)
            {
                return;
            }

            for (std::vector<Thread*>::iterator iter = m_threads.begin();
                iter != m_threads.end();
                ++iter)
            {
                (*iter)->stop();
            }

            m_network->interrupt();

            m_status = DEACTIVATING;
        }

        Thread* Stream::addThread()
        {
            if (m_status != INACTIVE)
                throw WrongState("Cannot add thread while the stream is active.");

            Thread* thread = new Thread(m_network);
            attachThread(thread);
            return thread;
        }

        void Stream::removeThread(Thread* const thread)
        {
            detachThread(thread);
            delete thread;
        }

        const std::vector<Thread*> & Stream::threads() const
        {
            return m_threads;
        }

        void Stream::connect(Operator* const sourceOp, const unsigned int outputId,
                             Operator* const targetOp, const unsigned int inputId)
        {
            if (targetOp == 0 || sourceOp == 0)
                throw WrongArgument("Operator must not be null.");

            if (! isPartOfStream(targetOp) || ! isPartOfStream(sourceOp))
                throw WrongArgument("Operator has not been added to stream.");

            if (m_status != INACTIVE)
                throw WrongState("Cannot connect operators while the stream is active.");

            if (targetOp->status() == Operator::NONE || sourceOp->status() == Operator::NONE)
                throw WrongState("Operator must be initialized.");

            m_network->connect(sourceOp, outputId, targetOp, inputId);
        }

        void Stream::disconnect(Operator* const targetOp, const unsigned int inputId)
        {

            if (targetOp == 0)
                throw WrongArgument("Operator must not be null.");

            if (! isPartOfStream(targetOp))
                throw WrongArgument("Operator has not been added to stream.");

            if (m_status != INACTIVE)
                throw WrongState("Cannot disconnect operators while the stream is active.");

            if (targetOp->status() == Operator::NONE)
                throw WrongState("Operator must be initialized.");

            disconnectInput(targetOp, inputId);
        }

        unsigned int Stream::delay() const
        {
            boost::lock_guard<boost::mutex> lock(m_delayMutex->mutex());

            return m_delay;
        }

        void Stream::setDelay(const unsigned int delay)
        {
            boost::lock_guard<boost::mutex> lock(m_delayMutex->mutex());

            m_delay = delay;

            for(std::vector<Thread*>::const_iterator iter = m_threads.begin();
                iter != m_threads.end();
                ++iter)
            {
                (*iter)->setDelay(delay);
            }
        }

        Operator* Stream::addOperator(OperatorKernel* const op)
        {
            if (op == 0)
                throw WrongArgument("Operator must not be null");

            if (m_status != INACTIVE)
                throw WrongState("Cannot add operator while the stream is active.");

            if (isPartOfStream(op))
                throw WrongArgument("Operator has already been added to the stream.");

            Operator* newOp = new Operator(op);
            attachOperator(newOp);
            return newOp;
        }

        void Stream::removeOperator(Operator* const op)
        {
            detachOperator(op);
            delete op;
        }

        void Stream::initializeOperator(Operator*const op)
        {
            if (op == 0)
                throw WrongArgument("Operator must not be null");

            if (m_status != INACTIVE)
                throw WrongState("Cannot initialize operator while the stream is active.");

            if (! isPartOfStream(op))
                throw WrongArgument("Operator is not part of the stream.");

            op->initialize();
            m_network->addOperator(op);
            m_uninitializedOperators.erase(op);
        }

        void Stream::deinitializeOperator(Operator*const op)
        {
            if (op == 0)
                throw WrongArgument("Operator must not be null");

            if (m_status != INACTIVE)
                throw WrongState("Cannot deinitialize operator while the stream is active.");

            if (isPartOfUninitializedStream(op))
                return;

            for (std::vector<const Input*>::const_iterator iter = op->info().inputs().begin();
                 iter != op->info().inputs().end(); ++iter)
            {
                disconnectInput(op, (*iter)->id());
            }

            for (std::vector<const Output*>::const_iterator iter = op->info().outputs().begin();
                 iter != op->info().outputs().end(); ++iter)
            {
                disconnectOutput(op, (*iter)->id());
            }

            op->deinitialize();
            m_network->removeOperator(op);
            m_uninitializedOperators.insert(op);
        }

        const OutputConnector Stream::connectionSource(const Operator* const targetOp, const unsigned int inputId) const
        {
            if (targetOp == 0)
                throw WrongArgument("Operator must not be null.");

            if (! isPartOfStream(targetOp))
                throw WrongArgument("Operator has not been added to stream.");

            if (targetOp->status() == Operator::NONE)
                throw WrongState("Operator must be initialized.");

            return m_network->connectionSource(targetOp, inputId);
        }

        void Stream::addObserver(const ExceptionObserver*const observer)
        {
            boost::lock_guard<boost::mutex> lock(m_observerMutex->mutex());

            if(! observer)
                throw WrongArgument("Observer must not be null.");

            m_observers.insert(observer);
        }

        void Stream::removeObserver(const ExceptionObserver*const observer)
        {
            boost::lock_guard<boost::mutex> lock(m_observerMutex->mutex());

            if(m_observers.erase(observer) != 1)
                throw WrongArgument("Observer has not been added to stream.");
        }

        void Stream::observeException(const ExceptionObserver::Phase phase, const OperatorError& ex, const Thread* const thread) const
        {
            boost::lock_guard<boost::mutex> lock(m_observerMutex->mutex());

            for(std::set<const ExceptionObserver*>::const_iterator iter = m_observers.begin();
                iter != m_observers.end();
                ++iter)
            {
                try
                {
                    (*iter)->observe(phase, ex, thread);
                }
                catch(...)
                {
                    // catch all exceptions which are thrown while observing exceptions...
                }
            }
        }

        bool Stream::isPartOfStream(const OperatorInfo*const op) const
        {
            for (std::vector<Operator*>::const_iterator iter = operators().begin();
                 iter != operators().end();
                 ++iter)
            {
                if (&(*iter)->info() == op)
                    return true;
            }

            return false;
        }

        bool Stream::isPartOfStream(const Operator*const op) const
        {
            return isPartOfInitializedStream(op) || isPartOfUninitializedStream(op);
        }

        bool Stream::isPartOfInitializedStream(const Operator*const op) const
        {
            std::vector<Operator*>::const_iterator iter =
                std::find(m_network->operators().begin(), m_network->operators().end(), op);

            return iter != m_network->operators().end();
        }

        bool Stream::isPartOfUninitializedStream(const Operator*const op) const
        {
            std::set<Operator*>::const_iterator iter =
                std::find(m_uninitializedOperators.begin(), m_uninitializedOperators.end(), op);

            return iter != m_uninitializedOperators.end();
        }

        void Stream::hideOperator(Operator*const op)
        {
            detachOperator(op);
            m_hiddenOperators.insert(op);
        }

        void Stream::showOperator(Operator*const op)
        {
            if (op == 0)
                throw WrongArgument("Operator must not be null");

            if (m_status != INACTIVE)
                throw WrongState("Cannot add operator while the stream is active.");

            if (isPartOfStream(op))
                throw WrongArgument("Operator has already been added to the stream.");

            std::set<Operator*>::iterator iter =
                std::find(m_hiddenOperators.begin(), m_hiddenOperators.end(), op);

            if (iter == m_hiddenOperators.end())
                throw WrongArgument("Operator has not been hidden.");

            m_hiddenOperators.erase(iter);
            attachOperator(op);
        }

        void Stream::hideThread(Thread*const thread)
        {
            detachThread(thread);
            m_hiddenThreads.insert(thread);
        }

        void Stream::showThread(Thread*const thread)
        {
            if (m_status != INACTIVE)
                throw WrongState("Cannot show thread while the stream is active.");

            std::set<Thread*>::iterator iter =
                std::find(m_hiddenThreads.begin(), m_hiddenThreads.end(), thread);

            if (iter == m_hiddenThreads.end())
                throw WrongArgument("Thread has not been hidden.");

            m_hiddenThreads.erase(iter);
            attachThread(thread);
        }

        void Stream::attachOperator(Operator*const op)
        {
            m_uninitializedOperators.insert(op);
            op->setFactory(m_factory);
            m_operators.push_back(op);
        }

        void Stream::attachThread(Thread*const thread)
        {
            impl::ThreadImplObserver* observer = new InternalThreadObserver(this, thread);
            thread->setObserver(observer);
            thread->setDelay(m_delay);

            m_threads.push_back(thread);
        }

        void Stream::detachOperator(Operator*const op)
        {
            if (op == 0)
                throw WrongArgument("Operator must not be null");

            if (m_status != INACTIVE)
                throw WrongState("Cannot remove operator while the stream is active.");

            if (! isPartOfStream(op))
                throw WrongArgument("Operator is not part of the stream.");

            deinitializeOperator(op);
            m_uninitializedOperators.erase(op);

            std::vector<Operator*>::iterator iter =
                std::find(m_operators.begin(), m_operators.end(), op);

            (*iter)->setFactory(0);
            m_operators.erase(iter);
        }

        void Stream::detachThread(Thread*const thread)
        {
            if (thread == 0)
                throw WrongArgument("Thread must not be null");

            if (m_status != INACTIVE)
                throw WrongState("Cannot remove thread while the stream is active.");

            bool foundThread = false;
            for (std::vector<Thread*>::iterator iter = m_threads.begin();
                iter != m_threads.end();
                ++iter)
            {
                if ((*iter) == thread)
                {
                    m_threads.erase(iter);
                    foundThread = true;
                    break;
                }
            }

            if (! foundThread)
                throw WrongArgument("Thread does not exists");
        }

        void Stream::setConnectorType(Operator* const op, const unsigned int id,
                                      const Description::Type type, const Description::UpdateBehavior behavior)
        {
            if (op == 0)
                throw WrongArgument("Operator must not be null");

            if (m_status != INACTIVE)
                throw WrongState("Cannot remove operator while the stream is active.");

            if (! isPartOfStream(op))
                throw WrongArgument("Operator is not part of the stream.");

            const Description& description = op->info().description(id);
            if (type == Description::PARAMETER)
            {
                switch (description.currentType())
                {
                case Description::INPUT:
                    disconnectInput(op, id);
                    break;
                case Description::OUTPUT:
                    disconnectOutput(op, id);
                    break;
                default:
                    break;
                }
            }

            op->setConnectorType(id, type, behavior);
        }

        void Stream::disconnectInput(Operator* const op, const unsigned int id)
        {
            m_network->disconnect(op, id);
            for (std::vector<Thread*>::iterator iter = m_threads.begin();
                 iter != m_threads.end(); ++iter)
            {
                (*iter)->removeInput(op, id);
            }
        }

        void Stream::disconnectOutput(Operator* const op, const unsigned int id)
        {
            const std::set<impl::InputNode*> inputs = m_network->getOutputNode(op, id)->connectedInputs();
            for(std::set<impl::InputNode*>::const_iterator iter = inputs.begin();
                iter != inputs.end(); ++iter)
            {
                disconnectInput((*iter)->op(), (*iter)->inputId());
            }
        }
    }
}


text:
.pp_wrap .nav-tab
{
	border: 0;
	color: #444;
	clear:both;
	display: block;
	width: 120px;
	-webkit-border-radius: 0px;
	-moz-border-radius: 0px;
	border-radius: 0px;
	padding: 11px 20px 11px 20px;
	margin: 0px;
	text-shadow: none;
	background: transparent;
	left:1px;
	position: relative;
	opacity: 0.6;
	border-top: 1px solid #ddd;
	border-bottom: 1px solid #ddd;
}

.pp_wrap h2
{
	font-size: 1.7em;
	margin-top: 27px;
	padding-bottom: 5px;
	margin-bottom: 0;
}

.pp_wrap h2 span
{
	font-size :13px;
	margin-left: 10px;
}

.pp_wrap label h2
{
	margin: 0 0 20px 0;
	font-weight: bold;
	font-size: 18px;
	color: #000;
	text-align: left;
	padding-bottom: 20px;
	font-weight: 300;
	border-bottom: 1px solid #d4d4d4;
}

.pp_wrap .nav-tab:first-child
{
	margin-top: 0px;
	border-top: 0;
}

.pp_wrap .nav-tab img
{
	max-width: 16px;
	height: auto;
}

.pp_wrap .nav-tab-active, .pp_wrap .nav-tab:hover
{
	background: #fff;
	z-index: 9;
	opacity: 1;
}

.pp_wrap .nav-tab:active
{
	outline: none;
	-moz-outline-style: none;
	opacity: 1;
}

:-moz-any-link:focus {
  outline: none;
}

.pp_wrap
{
	margin: 0;
	border-bottom: 1px solid #ccc;
	background: #f0f0f0;
	float: left;
}

.rm_wrap{
	width: 700px;
	margin: 17px 0 40px 10px;
	border: 1px solid #ccc;
	background: #fff;
	overflow-x: hidden;
}

.header_wrap
{
	padding: 0 20px 0 20px;
	background: #ffffff;
	background-color: rgba(256,256,256, 0.95);
	border-bottom: 1px solid #ddd;
}

.rm_section{
	display: none;
	background: transparent;
}

#pp_panel_general.rm_section {
	display: block;
}

.rm_options
{
	/*background: -webkit-gradient(linear, 0% 100%, 0% 0%, from(#f9f9f9), to(#ebebeb));
	text-shadow: 0 1px 1px #ffffff;*/
	margin-top: -18px;
}

.rm_opts label{
	font-size:12px;
	font-weight:700;
	width:100%;
	clear:both;
	padding: 0 0 5px 0;
}
.rm_input {
	padding:20px;
}

.rm_opts small{
	display:block;
	width:160px;
	padding: 15px 0 10px 20px;
	float:right;
	color:#999;
	font-size: 11px;
	margin-top: -12px;
	margin-right: 0px;
}
.rm_opts input[type="text"], .rm_opts input[type="password"]{
	width:290px;
	font-size:12px;
	padding:5px;
	float: left;
	border: 1px solid #dddddd;
	background: #f9f9f9;
	margin-top: 5px;
}

.rm_opts input[type="file"]
{
	width: 280px;
}

.rm_opts input[type="file"]#pp_import_current
{
	width: 220px;
	margin-right: 10px;
	background:#f0f0f0;
	padding: 6px;
	margin-top: -1px;
}

.rm_input input:focus, .rm_input textarea:focus, .rm_input input:hover, .rm_input textarea:hover {
    border: 1px solid #ccc;
}
.rm_input textarea{
	width: 290px;
	height: 80px;
	font-size:12px;
	padding:5px;
	border: 1px solid #dddddd;
	background: #f9f9f9;
	margin-top: 5px;
}
.rm_title h3 {
	cursor:pointer;
	font-size:1em;
	margin:0;
	font-weight:bold;
	color:#232323;
	float:left;
	width:80%;
	padding:14px 4px;
	text-shadow: 0 1px 1px #fff;
}

.rm_title{
	cursor:pointer;
	border-bottom:1px solid #ddd;
	background:#eee;
	padding:0;
	background: -webkit-gradient(linear, 0% 100%, 0% 0%, from(#ebebeb), to(#f9f9f9));
	text-shadow: 0 1px 1px #ffffff;
	display: none;
}

.rm_title h3 img.inactive{
	margin:-8px 10px 0 2px;
	width:32px;
	height:32px;
	background:url('images/pointer.png') no-repeat 0 0;
	float:left;
	display: none;
}

.rm_title h3 img.active{
	margin:-8px 10px 0 2px;
	width:32px;
	height:32px;
	background:url('images/pointer.png') no-repeat  0 -32px;
	float:left;
}

.rm_title h3:hover img{

}

.rm_title span.submit{
	display:block;
	float:right;
	margin:0;
	padding:0;
	width:15%;
	padding:14px 0;
}

.clearfix{
	clear:both;
}

.rm_table th, .rm_table td{
	border:1px solid #bbb;
	padding:10px;
	text-align:center;
}

.rm_table th, .rm_table td.feature{
	border-color:#888;
	}

.rm_list
{
	margin: 20px 0 0 20px;
}

.iPhoneCheckContainer {
  position: relative;
  height: 27px;
  cursor: pointer;
  overflow: hidden;
  float: left;
  margin-top: 5px;
   }
  .iPhoneCheckContainer input {
    position: absolute;
    top: 5px;
    left: 30px;
    opacity: 0;
    -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
    filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); }
  .iPhoneCheckContainer label {
    white-space: nowrap;
    font-size: 12px;
    line-height: 17px;
    font-weight: bold;
    font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
    text-transform: uppercase;
    cursor: pointer;
    display: block;
    height: 27px;
    position: absolute;
    width: auto;
    top: 0;
    padding-top: 5px;
    overflow: hidden; }
  .iPhoneCheckContainer, .iPhoneCheckContainer label {
    user-select: none;
    -moz-user-select: none;
    -khtml-user-select: none; }

.iPhoneCheckDisabled {
  opacity: 0.5;
  -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50);
  filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); }

label.iPhoneCheckLabelOn {
  color: white;
  background: url('images/iphone-style-checkboxes/on.png?1282083753') no-repeat;
  text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.6);
  left: 0;
  padding-top: 5px; }
  label.iPhoneCheckLabelOn span {
    padding-left: 8px; }
label.iPhoneCheckLabelOff {
  color: #8b8b8b;
  background: url('images/iphone-style-checkboxes/off.png?1282083753') no-repeat right 0;
  text-shadow: 0px 0px 2px rgba(255, 255, 255, 0.6);
  text-align: right;
  right: 0; }
  label.iPhoneCheckLabelOff span {
    padding-right: 8px; }

.iPhoneCheckHandle {
  display: block;
  height: 27px;
  cursor: pointer;
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  background: url('images/iphone-style-checkboxes/slider_left.png?1282083753') no-repeat;
  padding-left: 3px; }

.iPhoneCheckHandleRight {
  height: 100%;
  width: 100%;
  padding-right: 3px;
  background: url('images/iphone-style-checkboxes/slider_right.png?1282083753') no-repeat right 0; }

.iPhoneCheckHandleCenter {
  height: 100%;
  width: 100%;
  background: url('images/iphone-style-checkboxes/slider_center.png?1282083753'); }

.jslider .jslider-bg i,
.jslider .jslider-pointer
{ background: url(images/jslider.png) no-repeat 0 0; display: block;  }

.jslider { display: block; width: 100%; height: 1em; position: relative; top: 1.5em; font-family: Arial, sans-serif; margin-bottom: 20px; }
.jslider table { width: 100%; border-collapse: collapse; border: 0; }
.jslider td, .jslider th { padding: 0; vertical-align: top; text-align: left; border: 0; }

.jslider table,
.jslider table tr,
.jslider table tr td { width: 100%; vertical-align: top; }

.jslider .jslider-bg { position: relative; }
.jslider .jslider-bg i { height: 5px; position: absolute; font-size: 0; top: 0; }
.jslider .jslider-bg .l { width: 50%; background-position: 0 0; left: 0; }
.jslider .jslider-bg .r { width: 50%; left: 50%; background-position: right 0; }
.jslider .jslider-bg .v { position: absolute; width: 60%; left: 20%; top: 0; height: 5px; background-position: 0 -20px; }

.jslider .jslider-pointer { width: 13px; height: 15px; background-position: 0 -40px; position: absolute; left: 20%; top: -4px; margin-left: -6px; cursor: pointer; cursor: hand; }
.jslider .jslider-pointer-hover { background-position: -20px -40px; }
.jslider .jslider-pointer-to { left: 80%; }

.jslider .jslider-label { font-size: 9px; line-height: 12px; color: black; opacity: 0.4; white-space: nowrap; padding: 0px 2px; position: absolute; top: -18px; left: 0px; }
.jslider .jslider-label-to { left: auto; right: 0; }

.jslider .jslider-value { font-size: 11px; white-space: nowrap; padding: 1px 2px 0; position: absolute; top: -19px; left: 20%; background: white; line-height: 10px; -moz-border-radius: 2px; -webkit-border-radius: 2px; -o-border-radius: 2px; border-radius: 2px; }
.jslider .jslider-value-to { left: 80%; }

.jslider .jslider-label small,
.jslider .jslider-value small { position: relative; top: -0.4em; }

.jslider .jslider-scale { position: relative; top: 9px; }
.jslider .jslider-scale span { position: absolute; height: 5px; border-left: 1px solid #999; font-size: 0; }
.jslider .jslider-scale ins { font-size: 9px; text-decoration: none; position: absolute; left: 0px; top: 5px; color: #999; }

.jslider-single .jslider-pointer-to,
.jslider-single .jslider-value-to,
.jslider-single .jslider-bg .v,
.jslider-limitless .jslider-label
{ display: none; }

  .jslider_blue .jslider-bg i,
  .jslider_blue .jslider-pointer
  { background-image: url(images/jslider.blue.png); }

  .jslider_round .jslider-bg i,
  .jslider_round .jslider-pointer
  { background-image: url(images/jslider.round.png); }

  .jslider_round .jslider-pointer { width: 17px; height: 17px; top: -6px; margin-left: -8px; }

.jslider_round_plastic .jslider-bg i,
  .jslider_round_plastic .jslider-pointer { background-image: url(images/jslider.round.plastic.png); }

  .jslider_round_plastic .jslider-pointer { width: 18px; height: 18px; top: -7px; margin-left: -8px; }

  .jslider_plastic .jslider-bg i,
  .jslider_plastic .jslider-pointer { background-image: url(images/jslider.plastic.png); }

input[type="radio"]
{
	vertical-align: top;
	margin-top: 13px;
	margin-right: 5px;
}

.one_half
{
	width: 50%;
	float: left;
	text-align:center;
	margin-bottom: 50px;
}

.one_half.last
{
	margin-right: 0;
}

.one_half img
{
	height: auto;
}

.theme_detail_wrapper
{
	width: 300px;
	margin: auto;
}

.theme_name
{
	float: left;
	width: 150px;
	text-align: left;
}

.theme_buy
{
	float:right;
	width: 150px;
	text-align: right;
}

.theme_title
{
	font-size: 14px;
}

.theme_desc
{
	color: #888;
	font-size: 11px;
}

.pp_sortable, .ppb_sortable, .pp_skin_mgmt
{
	list-style-type: none;
	margin: 0;
	padding: 0;
	width: 100%;
}

.pp_sortable li, .ppb_sortable li, .pp_skin_mgmt li
{
	background: #fff;
	margin: 5px 0 5px 0;
	padding: 1em;
	padding-left: 0;
	padding-right: 0;
	font-size: 1em;
	color: #000;
	cursor: move;
	border: 1px solid #ddd;
	float: left;
	width: 100%;
	box-sizing: border-box;
}

.pp_sortable li
{
	padding: 1em;
}

#content_builder_sort.ppb_sortable li div.thumb
{
	float: left;
	margin-right: 10px;
}

#content_builder_sort.ppb_sortable li div.thumb img
{
	max-height: 30px;
}

#content_builder_sort.ppb_sortable li div.size
{
	float: left;
	height: 34px;
	margin-right: 10px;
	margin-left: 0;
	position: relative;
	top: -8px;
}

#content_builder_sort.ppb_sortable li div.size a.button
{
	line-height: 20px;
	float: none;
	clear: both;
	display: block;
	border-radius: 0;
	width: 25px;
	height: 25px;
	text-align: center;
	padding: 0;
	margin: 0;
}

.pp_sortable li div.title, .pp_skin_mgmt li div.title, .ppb_sortable li div.title
{
	float: left;
	margin-top: 3px;
	max-width: 75%;
	font-weight: bold;
	color: #000;
	font-size: 14px;
	line-height: 26px;
}

.ppb_sortable li .shortcode_title
{
	font-weight: normal;
	color: #999;
	font-size: 10px;
}

.ppb_sortable li .shortcode_title:after
{
	content: " | ";
}

.pp_sortable li a.button, .ppb_sortable li a.button
{
	float: left;
	padding: 3px;
	margin-right: 5px;
	padding: 3px 5px 3px 5px;
	margin-right: 5px;
	line-height: 12px;
	height: 20px;
	line-height: 26px;
}

.pp_sortable li a.ppb_edit, .ppb_sortable li a.ppb_edit
{
	float: right;
	display: block;
	background: #ebebeb;
	width: 60px;
	height: 24px;
	-moz-border-radius: 25px;
	-webkit-border-radius: 25px;
	-o-border-radius: 25px;
	border-radius: 25px;
	margin-left: 5px;
	text-align: center;
	font-weight: normal;
	color: #000;
	line-height: 24px;
	margin-top: 5px;
}

.pp_sortable li a.ppb_edit:hover, .ppb_sortable li a.ppb_edit:hover
{
	opacity: 0.7;
}

.pp_sortable li a.ppb_edit:active, .ppb_sortable li a.ppb_edit:active
{
	outline: none;
}

.pp_sortable li a.ppb_edit:after, .ppb_sortable li a.ppb_edit:after {
   content: "Edit";
}

.pp_sortable li.ppb_divider a.ppb_edit, .ppb_sortable li.ppb_divider a.ppb_edit
{
	display: none;
}

.pp_sortable li a.remove, .pp_skin_mgmt li a.remove, .ppb_sortable li a.remove
{
	float: right;
	display: block;
	background: #e62c22;
	width: 16px;
	height: 16px;
	text-indent: 9999px;
	-moz-border-radius: 25px;
	-webkit-border-radius: 25px;
	-o-border-radius: 25px;
	border-radius: 25px;
	margin-top: 3px;
	margin-left: 5px;
}

.pp_sortable li a.ppb_remove, .ppb_sortable li a.ppb_remove
{
	float: right;
	display: block;
	background: #e62c22;
	width: 16px;
	height: 16px;
	text-indent: 9999px;
	-moz-border-radius: 25px;
	-webkit-border-radius: 25px;
	-o-border-radius: 25px;
	border-radius: 25px;
	margin-top: 8px;
	margin-left: 5px;
}

.pp_sortable li a.ppb_remove:hover, .ppb_sortable li a.ppb_remove:hover
{
	opacity: 0.7;
}

.pp_sortable li a.ppb_unsave, .ppb_sortable li a.ppb_unsave
{
	float: left;
	display: block;
	background: #00a0d2;
	color: #fff;
	margin-left: 10px;
	text-align: center;
	font-weight: normal;
	line-height: 20px;
	margin-top: 7px;
	width: 62px;
	height: 20px;
	font-size: 11px;
}

.pp_sortable li a.ppb_unsave, .ppb_sortable li a.ppb_unsave, .pp_sortable li a.ppb_edit, .ppb_sortable li a.ppb_edit
{
	text-decoration: none;
}

html>body .pp_sortable li, , html>body .pp_skin_mgmt li, html>body .ppb_sortable li { line-height: 1.2em; }
.pp_sortable .ui-state-highlight, .ppb_sortable .ui-state-highlight { height: 1.5em; line-height: 1.2em; background: transparent; border: 1px dashed #888; }

.pp_sortable_wrapper
{
	text-align: center;
	width: 100%;
	padding: 10px;
	box-sizing: border-box;
	width: 100%;
	background: #f5f5f5;
	float: left;
}

.pp_sortable_header
{
	padding: 10px;
	text-align: center;
	background: #ebebeb;
	font-weight: bold;
	margin-top: 20px;
}

.pp_checkbox_wrapper
{
	padding: 10px;
	width: 110px;
	float: left;
	-moz-border-radius: 5px; -webkit-border-radius: 5px; -o-border-radius: 5px; border-radius: 5px;
	background: #f9f9f9;
	border: 1px solid #dddddd;
	font-size: 10px;
}

#content_builder_sort.pp_sortable, #content_builder_sort.ppb_sortable
{
	float: left;
	padding: 10px;
	box-sizing: border-box;
	width: 100%;
	background: #f5f5f5;
}

#content_builder_sort.pp_sortable.empty, #content_builder_sort.ppb_sortable.empty
{
	display: none;
}

.ppb_inline
{
	width: 100%;
	margin: auto;
	max-height: 90%;
}

.ppb_inline .wrap
{
	width: 100%;
}

.ppb_inline label
{
	font-weight: bold;
	vertical-align: baseline;
	font-size: 12px;
}

.ppb_inline .label_desc
{
	font-size: 10px;
	color: #999;
	margin-top: 7px;
}

.ppb_inline input[type=text], .ppb_inline textarea
{
	width: 99%;
}

.ppb_inline input[type=text].color_picker
{
	width: 95% !important;
}

.ppb_inline input[type=text].ppb_file
{
	display: inline;
	width: 89%;
}

.ppb_inline input[type=range]
{
	width: 600px;
}

output
{
  position: absolute;
  width: 40px;
  text-align: center;
  color: #fff;
  background: #00a0d2;
  border-radius: 3px;
  display: inline-block;
  bottom: 18px;
  left: 615px;
  line-height: 30px;
}

.ppb_image_fullwidth_image_button
{
	display: inline;
}

#content_builder_sort.ppb_sortable li
{
	padding-left: 9px;
	padding-right: 9px;
}

#content_builder_sort.ppb_sortable li.one_fourth
{
	width: 25%;
	float: left;
}

#content_builder_sort.ppb_sortable li.one_fourth div.thumb, #content_builder_sort.ppb_sortable li.one_fourth div.title .shortcode_title
{
	display: none;
}

#content_builder_sort.ppb_sortable li.one_half
{
	width: 50%;
	float: left;
}

#content_builder_sort.ppb_sortable li.one_third
{
	width: 33.3%;
	float: left;
}

#content_builder_sort.ppb_sortable li.one_third div.thumb, #content_builder_sort.ppb_sortable li.one_third div.title .shortcode_title
{
	display: none;
}

#content_builder_sort.ppb_sortable li.two_third
{
	width: 66.6%;
	float: left;
}

#content_builder_sort.ppb_sortable li.ppb_divider div.size
{
	display: none;
}

#content_builder_sort.ppb_sortable li.one:hover
{
	box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.check_thumb
{
	max-width: 100px;
	max-height: 30px;
}

#event_date_raw_wrapper
{
	display: none;
}

.pp_sample_text
{
	margin: 10px 0 10px 0;
	padding: 15px;
	background: #ebebeb;
	font-size: 20px;
	text-align: center;
}

#pp_panel
{
	width: 160px;
	float:left;
	border-right: 1px solid #ddd;
}

.rm_opts
{
	float:left;
	width: 539px;
	background: #fff;
	padding-bottom: 20px;
	margin-top: 0;
	min-height: 760px;
	border-left: 1px solid #ddd;
	margin-left:-1px;
}

.header_wrap input.button, .header_wrap input.button-primary
{

}

#current_sidebar
{
	margin: 15px 0 0 5px;
}

.ver_mid
{
	vertical-align: middle;
	margin: -2px 10px 0 0;
}

#current_sidebar,  #current_ggfont
{
	list-style-type: none;
	margin: 0;
	padding: 0;
	width: 100%;
	margin-top: 8px;
}

#current_sidebar li,  #current_ggfont li
{
	background: #fff; margin: 5px 0 5px 0; padding: 1em; font-size: 1em; color: #000; border: 1px solid #ddd;
}

#current_sidebar li div.title,  #current_ggfont li div.title
{
	float: left;
}

#current_sidebar li .sidebar_del, #current_ggfont li .ggfont_del
{
	float: right;
	display: block;
	background: #e62c22;
	width: 16px;
	height: 16px;
	text-indent: 9999px;
	-moz-border-radius: 25px;
	-webkit-border-radius: 25px;
	-o-border-radius: 25px;
	border-radius: 25px;
}

.pp_widget_description
{
	color: #999;
	font-size: 11px;
}

.pp_widget_description strong
{
	color: #444;
}

.pp_widget_hr
{
	border: 0;
	border-top: 1px solid #DFDFDF;;
	border-bottom: 1px solid #fff;
}

#pp_loading
{
	padding: 70px 20px 20px 20px;
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	-o-border-radius: 5px;
	border-radius: 5px;
	background: #464646 url('images/ajax-loader.gif') no-repeat center 30%;
	box-shadow: rgba(0,0,0, 0.4) 0px 0px 5px;
    -moz-box-shadow: rgba(0,0,0, 0.4) 0px 0px 5px;
    -webkit-box-shadow: rgba(0,0,0, 0.4) 0px 0px 5px;
	position: fixed;
	top: 40%;
	left: 49%;
	color: #fff;
	text-align: center;
	display: none;
}

#pp_success
{
	padding: 20px 15px 20px 15px;
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	-o-border-radius: 5px;
	border-radius: 5px;
	background: #4db2ec;
	position: fixed;
	top: 40%;
	left: 49%;
	color: #fff;
	text-align: center;
	display: none;
	z-index: 9999;
}

.woocommerce_options_panel label, .woocommerce_options_panel legend
{
	float: none !important;
}

.primary_button
{
	background: #4db2ec !important;
	border: 0 !important;
	color: #fff !important;
	text-shadow: none !important;
	height: 30px !important;
	line-height: 30px !important;
	padding-left: 15px !important;
	padding-right: 15px !important;
	text-transform: uppercase;
}

.primary_button:active
{
	background: #71d5fe !important;
}

.secondary_button
{
	background: #999 !important;
	border: 0 !important;
	color: #fff !important;
	text-shadow: none !important;
	height: 30px !important;
	line-height: 30px !important;
	padding-left: 15px !important;
	padding-right: 15px !important;
	text-transform: uppercase;
}

.rm_opts select
{
	min-width: 270px;
	margin-top: 10px;
	background: #fff;
	border: 1px solid #ccc;
}

.icheckbox_flat-green, .iradio_flat-green
{
	float: left;
	margin-right: 8px !important;
}

textarea.blur, input[type=text].blur
{
	color: #ccc;
}

.meta_post_img
{
	max-width: 100%;
	height: auto;
	margin-bottom: 10px;
}

.meta_post_img.hidden, .meta_post_img_remove.hidden
{
	display: none;
}

/**
	Demo Styles
**/

.demo_list
{
	list-style: none;
	display: block;
	margin: 15px 0 20px 0;
}

.demo_list > li
{
	display: inline-block;
	position: relative;
	margin-bottom: 10px;
	width: 45%;
	margin-right: 3%;
	height: auto;
	overflow: hidden;
	cursor: pointer;
	padding: 2px;
	background: #f9f9f9;
	border-radius: 3px;
}

.demo_list > li.fullwidth
{
	width: 100%;
	margin-right: 0;
}

.demo_list > li.selected, .demo_list > li:hover
{
	background: #0074a2;
}

.demo_list > li img
{
	max-width: 100%;
	height: auto;
	line-height: 0;
}

.demo_list > li.selected img
{
	opacity: 1;
}

.demo_list > li .item_content_wrapper
{
	display: table;
	width: 100%;
	height: 100px;
}

.demo_list > li .item_content_wrapper .item_content
{
	width: 100%;
	padding: 15px;
	box-sizing: border-box;
	display: table-cell;
    vertical-align: middle;
    text-align: center;
}

.demo_list > li .item_content_wrapper .item_content .item_thumb
{
	float: left;
	margin-right: 5%;
	width: 30%;
}

.demo_list > li .item_content_wrapper .item_content .item_thumb img
{
	max-width: 100%;
	height: auto;
}

.demo_list li > .item_content_wrapper .item_content .item_content
{
	float: right;
	width: 65%;
	text-align: left;
}

.demo_list > li.selected .item_content_wrapper .item_content, .demo_list > li:hover .item_content_wrapper .item_content, .demo_list > li.selected .item_content_wrapper .item_content a, .demo_list > li:hover .item_content_wrapper .item_content a
{
	color: #fff;
}

.meta_date_raw
{
	display: none;
}

#ppb_module_wrapper
{
	list-style: none;
	width: 100%;
	margin-top: 20px;
}

#ppb_module_wrapper li
{
	width: 79px;
	height:130px;
	vertical-align: top;
	margin: 0;
	padding: 3px;
	display: inline-block;
	border: 1px solid #fff;
	cursor: pointer;
	text-align: center;
	font-size: 8px;

	-webkit-transition: .2s ease-in-out;
	-moz-transition: .2s ease-in-out;
	-o-transition: .2s ease-in-out;
	transition: .2s ease-in-out;
}

#ppb_module_wrapper li:hover
{
	border-color: #e1e1e1;
}

#ppb_module_wrapper li img
{
	width: 79px;
	height: 79px;
}

#ppb_module_wrapper li .builder_page_icon
{
	width: 77px;
	height: 77px;
	background: #f0f0f0;
	border: 1px solid #ebebeb;
}

#ppb_module_wrapper li .builder_page_icon span.dashicons
{
	line-height: 77px;
	font-size: 24px;
	color: #777;
}

#ppb_module_wrapper li.selected
{
	border-color: #000;
}

#ppb_sortable_add_button
{
	width: 100%;
	box-sizing: border-box;
	text-align: center;
	height: 44px;
	line-height: 42px;
	border-radius: 0;
	border: 0;
	box-shadow: 0 0 0 0;
	margin-left: 0 !important;
	margin-bottom: 5px;
}

.tipsy-inner:empty { display: none !important; }
.tipsy { font-size: 10px; position: absolute; padding: 5px; z-index: 100000; }
  .tipsy-inner { background-color: #000; color: #FFF; max-width: 200px; padding: 5px 8px 4px 8px; text-align: center; }

  /* Rounded corners */
  .tipsy-inner { border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; }

  /* Uncomment for shadow */
  /*.tipsy-inner { box-shadow: 0 0 5px #000000; -webkit-box-shadow: 0 0 5px #000000; -moz-box-shadow: 0 0 5px #000000; }*/

  .tipsy-arrow { position: absolute; width: 0; height: 0; line-height: 0; border: 5px dashed #000; }

  /* Rules to colour arrows */
  .tipsy-arrow-n { border-bottom-color: #000; }
  .tipsy-arrow-s { border-top-color: #000; }
  .tipsy-arrow-e { border-left-color: #000; }
  .tipsy-arrow-w { border-right-color: #000; }

	.tipsy-n .tipsy-arrow { top: 0px; left: 50%; margin-left: -5px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent; }
    .tipsy-nw .tipsy-arrow { top: 0; left: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;}
    .tipsy-ne .tipsy-arrow { top: 0; right: 10px; border-bottom-style: solid; border-top: none;  border-left-color: transparent; border-right-color: transparent;}
  .tipsy-s .tipsy-arrow { bottom: 0; left: 50%; margin-left: -5px; border-top-style: solid; border-bottom: none;  border-left-color: transparent; border-right-color: transparent; }
    .tipsy-sw .tipsy-arrow { bottom: 0; left: 10px; border-top-style: solid; border-bottom: none;  border-left-color: transparent; border-right-color: transparent; }
    .tipsy-se .tipsy-arrow { bottom: 0; right: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
  .tipsy-e .tipsy-arrow { right: 0; top: 50%; margin-top: -5px; border-left-style: solid; border-right: none; border-top-color: transparent; border-bottom-color: transparent; }
  .tipsy-w .tipsy-arrow { left: 0; top: 50%; margin-top: -5px; border-right-style: solid; border-left: none; border-top-color: transparent; border-bottom-color: transparent; }

.ui-tabs .ui-tabs-nav li
{
	background: #f0f0f0;
	margin: 0;
	border: 1px solid #e1e1e1 !important;
	padding-top: 2px;
	top: 1px;
}

#ppb_tab .ui-widget-header
{
	border-bottom: 1px solid #e1e1e1;
}

#ppb_tab.ui-tabs .ui-tabs-nav li
{
	top: 2px;
}

.vertical.ui-tabs .ui-tabs-nav li
{
	width: 100%;
	clear: both;
}

.ui-tabs .ui-tabs-nav li:hover
{
	background: #fff;
}

.ui-tabs .ui-tabs-nav li.ui-tabs-selected
{
	border: 1px solid #e1e1e1;
	border-top: 3px solid #e1e1e1;
}

.ui-tabs .ui-tabs-nav li.ui-state-active
{
	background: #fff !important;
	border-bottom: 1px solid #fff !important;
	outline: none;
	position: relative;
	z-index: 9;
}

.ui-tabs .ui-tabs-nav li.ui-state-active a
{
	outline: none;
}

.ui-tabs .ui-tabs-nav li a
{
	padding: 8px 20px 7px 20px;
	outline: none;
}

.tabs .ui-tabs .ui-tabs-nav li
{
	font-weight: bold;
	text-shadow: 0 1px 1px #fff;
	display: block;
}

.tabs .ui-tabs-panel
{
	border: 1px solid #e1e1e1;
	border-top: 0;
	margin:0;
	padding-top: 0em;
	background: #fff;
	-moz-border-radius: 0;
	-webkit-border-radius: 0;
	border-radius: 0;
	z-index: 2;
	position: relative;
}

.tabs .ui-state-active a
{
	color: #333;
	font-weight: bold;
}

.ui-tabs.vertical li:first-child
{
	margin-left: 0;
}

#ppb_tab.ui-tabs .ui-tabs-panel
{
	padding: 0.5em;
}

.import_message, .update_message
{
	text-align: center;
	display: none;
}

.import_message_success, .update_message_success
{
	color: #6a863b;
}

.ppb_inline_wrap
{
	margin: 0;
	width: 100%;
	max-width: 700px;
	background: #ebebeb;
	float: left;
	position: fixed;
	z-index: 9;
	top: 30px;
}

.ppb_inline_wrap h2
{
	font-size: 16px;
	font-weight: 600;
	display: block;
	float: left;
	width: 50%;
	padding-left: 20px;
}

.ppb_inline_option_wrap
{
	width: 100%;
	padding: 60px 20px 0 20px;
	box-sizing: border-box;
}

.ppb_inline_option
{
	margin-bottom: 5px;
	position: relative;
}

.ppb_inline_wrap h2
{
	float: left;
}

.ppb_inline_wrap .ppb_inline_save, .ppb_inline_wrap .button
{
	float: right;
	min-height: 44px;
	border-radius: 0;
	line-height: 44px;
	border: 0;
	box-shadow: 0 0 0 0;
	width: 22%;
	text-align: center;
	font-weight: 600;
}

.ppb_file_image
{
	max-height: 200px;
	display: block;
	margin: 5px 0 5px 0;
}

.ppb_inline_option select
{
	width: 100%;
}

.ppb_inline_option[type=text] .color_picker
{
	width: 94.5%;
}

body.wp-customizer #customize-theme-controls .control-section.open .accordion-section-title, #customize-theme-controls .control-section.open .accordion-section-title:after {
  color: #fff !important;
}

.customize-control-image img
{
	width: auto;
}

#customize-controls .description
{
	color: #999;
	font-size: 11px;
	font-style: normal;
}

.customize-control-checkbox label
{
	font-weight: bold;
	font-size: 14px;
	margin-bottom: 5px;
	line-height: 24px;
}

.customize-control select
{
	margin-bottom: 15px;
}

.customize-control-radio-buttonset label.ui-state-active
{
	color: #fff !important;
}

.tg_system_status_wrapper
{
	background: #f9f9f9;
	padding: 20px;
	margin-bottom: 20px;
}

.tg_system_status_wrapper h4
{
	margin: 0;
}

.tg_system_status_wrapper > div
{
	color: #7ad03a;
	font-weight: bold;
}

.tg_system_status_wrapper > div:before
{
	font-family: 'FontAwesome';
	content: "\f00c";
	margin-right: 5px;
}

.tg_system_status_wrapper > div.tg_error, .tg_system_status_wrapper span.tg_error
{
	color: #dd3d36;
	font-weight: bold;
}

.tg_system_status_wrapper > div.tg_error:before
{
	font-family: 'FontAwesome';
	content: "\f12a";
	margin-right: 5px;
}

/**
*
* Some content builder modules which are not support multiple size
*
**/
#content_builder_sort.ppb_sortable li.ppb_text_sidebar div.size,
#content_builder_sort.ppb_sortable li.ppb_image_fullwidth div.size,
#content_builder_sort.ppb_sortable li.ppb_image_parallax div.size,
#content_builder_sort.ppb_sortable li.ppb_content_half_bg div.size,
#content_builder_sort.ppb_sortable li.ppb_image_half_fixed_width div.size,
#content_builder_sort.ppb_sortable li.ppb_image_half_fullwidth div.size,
#content_builder_sort.ppb_sortable li.ppb_fullwidth_button div.size,
#content_builder_sort.ppb_sortable li.ppb_gallery_slider div.size,
#content_builder_sort.ppb_sortable li.ppb_gallery_grid div.size,
#content_builder_sort.ppb_sortable li.ppb_gallery_masonry div.size,
#content_builder_sort.ppb_sortable li.ppb_portfolio_classic div.size,
#content_builder_sort.ppb_sortable li.ppb_portfolio_classic_masonry div.size,
#content_builder_sort.ppb_sortable li.ppb_portfolio_grid div.size,
#content_builder_sort.ppb_sortable li.ppb_portfolio_grid_masonry div.size,
#content_builder_sort.ppb_sortable li.ppb_blog_grid div.size,
#content_builder_sort.ppb_sortable li.ppb_team_column div.size,
#content_builder_sort.ppb_sortable li.ppb_client_slider div.size,
#content_builder_sort.ppb_sortable li.ppb_testimonial_column div.size,
#content_builder_sort.ppb_sortable li.ppb_pricing div.size,
#content_builder_sort.ppb_sortable li.ppb_contact_map div.size,
#content_builder_sort.ppb_sortable li.ppb_contact_sidebar div.size,
#content_builder_sort.ppb_sortable li.ppb_map div.size,
#content_builder_sort.ppb_sortable li.ppb_revslider div.size
{
	display: none !important;
}

#adminmenuwrap
{
	z-index: 999;
}

/**
*
* Custom CSS for handle post options box
*
**/
#post_option_portfolio_video_id, #post_option_portfolio_mp4_url, #post_option_portfolio_link_url
{
	display: none;
}

#post_option_post_ft_gallery, #post_option_post_ft_vimeo, #post_option_post_ft_youtube
{
	display: none;
}

#page_option_page_gallery_id, #page_option_page_ft_vimeo, #page_option_page_ft_youtube
{
	display: none;
}


text: sap.ui.define(["jquery.sap.global"],function(q){"use strict";var M={};M.render=function(r,c){};return M;},true);


text:
import { LogicError } from '../../errors';
import { d } from '../../io';
import { Actor, AnswersQuestions, UsesAbilities } from '../actor';
import { Answerable } from '../Answerable';
import { Question, QuestionAdapter } from '../Question';
import { Task } from '../Task';
import { Expectation } from './Expectation';
import { ExpectationMet } from './expectations';
import { MetaQuestion } from './MetaQuestion';

/**
 * Serenity/JS Screenplay Pattern-style wrapper around {@apilink Array}
 * and array-like structures - see {@apilink PageElements}.
 *
 * @group Questions
 */
export class List<Item_Type> extends Question<Promise<Item_Type[]>> {
    private subject: string;

    static of<IT>(collection: Answerable<Array<IT>>): List<IT> {
        return new List<IT>(collection);
    }

    constructor(
        protected readonly collection: Answerable<Array<Item_Type>>,
    ) {
        super();
        this.subject = d`${ collection }`;
    }

    eachMappedTo<Mapped_Item_Type>(
        question: MetaQuestion<Item_Type, Promise<Mapped_Item_Type> | Mapped_Item_Type>,
    ): List<Mapped_Item_Type> {
        return new List(
            new EachMappedTo(this.collection, question, this.subject)
        );
    }

    forEach(callback: (current: CurrentItem<Item_Type>, index: number, items: Array<Item_Type>) => Promise<void> | void): Task {
        return new ForEachLoop(this.collection, this.subject, callback);
    }

    where<Answer_Type>(
        question: MetaQuestion<Item_Type, Promise<Answer_Type> | Answer_Type>,
        expectation: Expectation<Answer_Type>
    ): this {
        return new List<Item_Type>(
            new Where(this.collection, question, expectation, this.subject)
        ) as this;
    }

    count(): QuestionAdapter<number> {
        return Question.about(`the number of ${ this.subject }`, async actor => {
            const items = await this.answeredBy(actor);
            return items.length;
        });
    }

    first(): QuestionAdapter<Item_Type> {
        return Question.about(`the first of ${ this.subject }`, async actor => {
            const items = await this.answeredBy(actor);

            if (items.length === 0) {
                throw new LogicError(d`Can't retrieve the first item from a list with 0 items: ${ items }`)
            }

            return items[0];
        });
    }

    last(): QuestionAdapter<Item_Type> {
        return Question.about(`the last of ${ this.subject }`, async actor => {
            const items = await this.answeredBy(actor);

            if (items.length === 0) {
                throw new LogicError(d`Can't retrieve the last item from a list with 0 items: ${ items }`)
            }

            return items[items.length - 1];
        });
    }

    get(index: number): QuestionAdapter<Item_Type> {
        return Question.about(`the ${ ordinal(index + 1) } of ${ this.subject }`, async actor => {
            const items = await this.answeredBy(actor);

            if (index < 0 || items.length <= index) {
                throw new LogicError(`Can't retrieve the ${ ordinal(index) } item from a list with ${ items.length } items: ` + d`${ items }`)
            }

            return items[index];
        });
    }

    async answeredBy(actor: AnswersQuestions & UsesAbilities): Promise<Array<Item_Type>> {
        const collection = await actor.answer(this.collection);

        if (! Array.isArray(collection)) {
            throw new LogicError(d`A List has to wrap an Array-compatible object. ${ collection } given.`);
        }

        return collection;
    }

    describedAs(subject: string): this {
        this.subject = subject;
        return this;
    }

    toString(): string {
        return this.subject;
    }
}

/**
 * @package
 * @param {number} index
 */
function ordinal(index: number): string {
    const
        lastDigit     = Math.abs(index) % 10,
        lastTwoDigits = Math.abs(index) % 100;

    switch (true) {
        case (lastDigit === 1 && lastTwoDigits !== 11):
            return index + 'st';
        case (lastDigit === 2 && lastTwoDigits !== 12):
            return index + 'nd';
        case (lastDigit === 3 && lastTwoDigits !== 13):
            return index + 'rd';
        default:
            return index + 'th';
    }
}

/**
 * @package
 */
class Where<Item_Type, Answer_Type>
    extends Question<Promise<Array<Item_Type>>>
{
    private subject: string;

    constructor(
        private readonly collection: Answerable<Array<Item_Type>>,
        private readonly question: MetaQuestion<Item_Type, Promise<Answer_Type> | Answer_Type>,
        private readonly expectation: Expectation<Answer_Type>,
        originalSubject: string,
    ) {
        super();

        const prefix = this.collection instanceof Where
            ? ' and'
            : ' where';

        this.subject = originalSubject + prefix + d` ${ question } does ${ expectation }`;
    }

    async answeredBy(actor: AnswersQuestions & UsesAbilities): Promise<Array<Item_Type>> {
        try {
            const collection    = await actor.answer(this.collection);
            const results: Item_Type[] = [];

            for (const item of collection) {
                const actual = this.question.of(item) as Answerable<Answer_Type>;
                const expectationOutcome = await actor.answer(this.expectation.isMetFor(actual));

                if (expectationOutcome instanceof ExpectationMet) {
                    results.push(item);
                }
            }

            return results;
        } catch (error) {
            throw new LogicError(d`Couldn't check if ${ this.question } of an item of ${ this.collection } does ${ this.expectation }`, error);
        }
    }

    describedAs(subject: string): this {
        this.subject = subject;
        return this;
    }

    toString(): string {
        return this.subject;
    }
}

/**
 * @package
 */
class EachMappedTo<Item_Type, Mapped_Item_Type> extends Question<Promise<Array<Mapped_Item_Type>>> {

    private subject: string;

    constructor(
        private readonly collection: Answerable<Array<Item_Type>>,
        private readonly mapping: MetaQuestion<Item_Type, Promise<Mapped_Item_Type> | Mapped_Item_Type>,
        originalSubject: string,
    ) {
        super();

        this.subject = originalSubject + d` mapped to ${ this.mapping }`;
    }

    async answeredBy(actor: AnswersQuestions & UsesAbilities): Promise<Array<Mapped_Item_Type>> {
        const collection: Array<Item_Type> = await actor.answer(this.collection);

        const mapped: Mapped_Item_Type[] = [];

        for (const item of collection) {
            mapped.push(await actor.answer(this.mapping.of(item)))
        }

        return mapped;
    }

    describedAs(subject: string): this {
        this.subject = subject;
        return this;
    }

    toString(): string {
        return this.subject;
    }
}

/**
 * @package
 */
class ForEachLoop<Item_Type> extends Task {

    constructor(
        private readonly collection: Answerable<Array<Item_Type>>,
        private readonly subject: string,
        private readonly fn: (current: CurrentItem<Item_Type>, index: number, items: Array<Item_Type>) => Promise<void> | void,
    ) {
        super();
    }

    async performAs(actor: Actor): Promise<void> {
        const collection: Array<Item_Type> = await actor.answer(this.collection);

        for (const [index, item] of collection.entries()) {
            await this.fn({ actor, item }, index, collection);
        }
    }

    toString(): string {
        return `#actor iterates over ${ this.subject }`;
    }
}

/**
 * @group Questions
 */
export interface CurrentItem<Item_Type> {
    item: Item_Type;
    actor: Actor;
}