text:
package com.topeet.serialtest;

import android.R.integer;

//ÀûÓÃJNIµ÷Óõײ㴮¿Ú
public class serial {
	//ÐÂÔöÒ»¸ö¶Ë¿ÚÇø·Ö±êÖ¾£¬flag=0£¬flag=1;
	public native int 	Open(int Port,int Rate,int flag);
	public native int 	Close(int flag);
	public native int[]	Read(int flag);
	public native int	Write(int[] buffer,int len,int flag);

}

redpajama_set_name: RedPajamaGithub


text:
using System.IO;

namespace eidss.model.AVR.ServiceData
{
    public class StreamTablePacketDTO
    {
        public StreamTablePacketDTO()
        {
            Stream = new MemoryStream();
        }

        public StreamTablePacketDTO(int rowCount, int bodyLength)
        {
            RowCount = rowCount;
            Stream = new MemoryStream(bodyLength);
        }

        public int RowCount { get; set; }
        public bool IsArchive { get; set; }
        public Stream Stream { get; set; }
        public byte[] InputBuffer { get; set; }
        public byte[] OutputBuffer { get; set; }

        public Stream StreamCreator()
        {
            return Stream;
        }
    }
}


text:
package de.neue_phase.asterisk.ClickDial.jobs.exceptions;
public class JobCreationException extends Exception {
    public JobCreationException (String message) {
        super (message);
    }
}


text:
//
//  TLMUnlockEvent.h
//  MyoKit
//
//  Copyright (C) 2014 Thalmic Labs Inc.
//  Distributed under the Myo SDK license agreement. See LICENSE.txt.
//

#import <Foundation/Foundation.h>

@class TLMMyo;

@interface TLMUnlockEvent : NSObject <NSCopying>

/** The TLMMyo for this unlock event. */
@property (nonatomic, weak, readonly) TLMMyo *myo;

/** The time of the unlock event. */
@property (nonatomic, strong, readonly) NSDate *timestamp;

@end


text:
/* globals define */
define(function(require, exports, module) {
    var serverConfig = require('serverConfig');
    var serverIp = 'http://' + serverConfig;
    var evtSource = new EventSource(serverIp + ':8081/events');

    var view = require('main');
    var playlist = view[0];
    var playercontrols = view[1];
    var playLock = true;

    // Get initial player state
    var ajax = new XMLHttpRequest();

    ajax.open('GET', serverIp + ':8082/media/status', true);
    ajax.setRequestHeader('Content-Type', 'application/json');
    ajax.send();

    ajax.onreadystatechange = function() {
        if(ajax.readyState == 4 && ajax.status == 200) {
            if(ajax.responseText.indexOf('playing') != -1) {
                playLock = false;
                playercontrols._eventOutput.emit("playing");
            } else if(ajax.responseText.indexOf('paused') != -1) {
                playLock = false;
                playercontrols._eventOutput.emit("paused");
            } else {
                playLock = true;
                playercontrols._eventOutput.emit("stopped");
            }
        }
    }

    var ajax2 = new XMLHttpRequest();

    ajax2.open('GET', serverIp + ':8082/media/playlist', true);
    ajax2.setRequestHeader('Content-Type', 'application/json');
    ajax2.send();

    ajax2.onreadystatechange = function() {
        if(ajax2.readyState == 4 && ajax2.status == 200) {
            var jsonData = JSON.parse(ajax2.responseText);
            if(jsonData.Playlist) {

                for(var i = 0; i < jsonData.Playlist.length; i++) {
                    playlist.AddEntry(jsonData.Playlist[i]);
                }
                playlist.Reconstruct();

                playLock = false;
                playercontrols._eventOutput.emit("paused");

            }
        }
    }

    evtSource.addEventListener("playerStateChanged", function(e) {
        console.log("Server event: playerState - " + e.data);
        if(e.data == "stopped") {
            //playLock = true;
            playercontrols._eventOutput.emit("stopped");
        } else if(e.data == "paused") {
            playLock = false;
            playercontrols._eventOutput.emit("paused");
        } else if(e.data == "playing") {
            playLock = false;
            playercontrols._eventOutput.emit("playing");
        }
    });

    evtSource.addEventListener("playlistChanged", function(e) {
        console.log("Server event: playlistChanged - " + e.data);

        var ajax3 = new XMLHttpRequest();

        ajax3.open('GET', serverIp + ':8082/media/playlist', true);
        ajax3.setRequestHeader('Content-Type', 'application/json');
        ajax3.send();

        ajax3.onreadystatechange = function() {
            if(ajax3.readyState == 4 && ajax3.status == 200) {
                var jsonData = JSON.parse(ajax3.responseText);
                if(jsonData.Playlist) {

                    playlist.Clear();

                    for(var i = 0; i < jsonData.Playlist.length; i++) {
                        playlist.AddEntry(jsonData.Playlist[i]);
                    }

                    playlist.Reconstruct();

                }
            }
        }
    });

    playercontrols._eventInput.on("pause", function() {
        if(!playLock) {
            console.log("pause");

            // Talk to server
            var ajax = new XMLHttpRequest();

            ajax.open('GET', serverIp + ':8082/media/pause', true);
            ajax.setRequestHeader('Content-Type', 'application/json');
            ajax.send(null);

            playercontrols._eventOutput.emit("paused");
        }

    });

    playercontrols._eventInput.on("play", function() {
        if(!playLock) {
            console.log("play");

            // Talk to server
            var ajax = new XMLHttpRequest();

            ajax.open('GET', serverIp + ':8082/media/play', true);
            ajax.setRequestHeader('Content-Type', 'application/json');
            ajax.send(null);

            playercontrols._eventOutput.emit("playing");
        }

    });

    playercontrols._eventInput.on("prev", function() {
        playlist._eventOutput.emit("prevSelect");

        console.log(playlist.currentlySelectedIndex);

        // Talk to server

        playlist._eventOutput.emit("prevPlay");
    });

    playercontrols._eventInput.on("next", function() {
        playlist._eventOutput.emit("nextSelect");

        console.log(playlist.currentlySelectedIndex);

        // Talk to server

        playlist._eventOutput.emit("nextPlay");
    });

    playlist._eventInput.on("itemClicked", function(index) {
        playlist._eventOutput.emit("select", index);

        // Talk to server

        playlist._eventOutput.emit("play", index);
    });

    playlist._eventInput.on("playlistEntryAdded", function(data) {
        // Talk to server
        var ajax = new XMLHttpRequest();
        var serverResponse;

        ajax.open('POST', serverIp + ':8082/media/add', true);
        ajax.setRequestHeader('Content-Type', 'application/json');
        ajax.send('{"Url":"' + data + '"}');

    });

});


text:
package com.twosigma.beakerx.jvm.serialization;

import com.twosigma.beakerx.jvm.object.CyclingOutputContainerLayoutManager;
import com.fasterxml.jackson.core.JsonGenerator;

import java.io.IOException;

public class CyclingOutputContainerLayoutManagerSerializer extends OutputContainerLayoutManagerSerializer<CyclingOutputContainerLayoutManager>  {

  public CyclingOutputContainerLayoutManagerSerializer(BeakerObjectConverter osp) {
    super(osp);
  }

  @Override
  protected void serialize(CyclingOutputContainerLayoutManager value, JsonGenerator jgen) throws
                                                                                IOException {
    jgen.writeObjectField("period", value.getPeriod());
  }
}


text:
package edu.clemson.resolve.jetbrains.psi.impl;

import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
import com.intellij.psi.util.PsiTreeUtil;
import static edu.clemson.resolve.jetbrains.ResTypes.*;
import edu.clemson.resolve.jetbrains.psi.*;

public class ResExtensionPairingImpl extends ResCompositeElementImpl implements ResExtensionPairing {

  public ResExtensionPairingImpl(ASTNode node) {
    super(node);
  }

  public void accept(@NotNull ResVisitor visitor) {
    visitor.visitExtensionPairing(this);
  }

  public void accept(@NotNull PsiElementVisitor visitor) {
    if (visitor instanceof ResVisitor) accept((ResVisitor)visitor);
    else super.accept(visitor);
  }

  @Override
  @NotNull
  public List<ResModuleIdentifier> getModuleIdentifierList() {
    return PsiTreeUtil.getChildrenOfTypeAsList(this, ResModuleIdentifier.class);
  }

  @Override
  @NotNull
  public List<ResModuleLibraryIdentifier> getModuleLibraryIdentifierList() {
    return PsiTreeUtil.getChildrenOfTypeAsList(this, ResModuleLibraryIdentifier.class);
  }

  @Override
  @Nullable
  public ResModuleRealizArgList getModuleRealizArgList() {
    return findChildByClass(ResModuleRealizArgList.class);
  }

  @Override
  @Nullable
  public ResModuleSpecArgList getModuleSpecArgList() {
    return findChildByClass(ResModuleSpecArgList.class);
  }

  @Override
  @NotNull
  public PsiElement getEnhanced() {
    return findNotNullChildByType(ENHANCED);
  }

  @Override
  @Nullable
  public PsiElement getExternally() {
    return findChildByType(EXTERNALLY);
  }

  @Override
  @Nullable
  public PsiElement getRealized() {
    return findChildByType(REALIZED);
  }

  @Nullable
  public ResFile resolveSpecification() {
    return ResPsiImplUtil.resolveSpecification(this);
  }

  @Nullable
  public ResFile resolveImplementation() {
    return ResPsiImplUtil.resolveImplementation(this);
  }

}


text:
import { EventEmitter } from '../common/EventEmitter.js';
/**
 * BrowserContexts provide a way to operate multiple independent browser
 * sessions. When a browser is launched, it has a single BrowserContext used by
 * default. The method {@link Browser.newPage | Browser.newPage} creates a page
 * in the default browser context.
 *
 * @remarks
 *
 * The Browser class extends from Puppeteer's {@link EventEmitter} class and
 * will emit various events which are documented in the
 * {@link BrowserContextEmittedEvents} enum.
 *
 * If a page opens another page, e.g. with a `window.open` call, the popup will
 * belong to the parent page's browser context.
 *
 * Puppeteer allows creation of "incognito" browser contexts with
 * {@link Browser.createIncognitoBrowserContext | Browser.createIncognitoBrowserContext}
 * method. "Incognito" browser contexts don't write any browsing data to disk.
 *
 * @example
 *
 * ```ts
 * // Create a new incognito browser context
 * const context = await browser.createIncognitoBrowserContext();
 * // Create a new page inside context.
 * const page = await context.newPage();
 * // ... do stuff with page ...
 * await page.goto('https://example.com');
 * // Dispose context once it's no longer needed.
 * await context.close();
 * ```
 *
 * @public
 */
export class BrowserContext extends EventEmitter {
    /**
     * @internal
     */
    constructor() {
        super();
    }
    /**
     * An array of all active targets inside the browser context.
     */
    targets() {
        throw new Error('Not implemented');
    }
    waitForTarget() {
        throw new Error('Not implemented');
    }
    /**
     * An array of all pages inside the browser context.
     *
     * @returns Promise which resolves to an array of all open pages.
     * Non visible pages, such as `"background_page"`, will not be listed here.
     * You can find them using {@link Target.page | the target page}.
     */
    pages() {
        throw new Error('Not implemented');
    }
    /**
     * Returns whether BrowserContext is incognito.
     * The default browser context is the only non-incognito browser context.
     *
     * @remarks
     * The default browser context cannot be closed.
     */
    isIncognito() {
        throw new Error('Not implemented');
    }
    overridePermissions() {
        throw new Error('Not implemented');
    }
    /**
     * Clears all permission overrides for the browser context.
     *
     * @example
     *
     * ```ts
     * const context = browser.defaultBrowserContext();
     * context.overridePermissions('https://example.com', ['clipboard-read']);
     * // do stuff ..
     * context.clearPermissionOverrides();
     * ```
     */
    clearPermissionOverrides() {
        throw new Error('Not implemented');
    }
    /**
     * Creates a new page in the browser context.
     */
    newPage() {
        throw new Error('Not implemented');
    }
    /**
     * The browser this browser context belongs to.
     */
    browser() {
        throw new Error('Not implemented');
    }
    /**
     * Closes the browser context. All the targets that belong to the browser context
     * will be closed.
     *
     * @remarks
     * Only incognito browser contexts can be closed.
     */
    close() {
        throw new Error('Not implemented');
    }
    get id() {
        return undefined;
    }
}
//# sourceMappingURL=BrowserContext.js.map


text:
/**
 * udp.h
 *
 * A class to handle UDP broadcasts.
 *
 * @author Adrien Perkins <adrienp@stanford.edu>
 */
#ifndef UDP_H_
#define UDP_H_

#include <netdb.h>
#include <sys/socket.h>

#define SERVICE_PORT	21234	/* hard coded port to send data to */

// list of the possible bearing types
enum bearing_type_t {
	TYPE_BEARING_CC = 1,
	TYPE_BEARING_MLE
};

class UDP {

public:

	/* constructor */
	UDP();
	UDP(const char *server);

	/* destructor */
	~UDP();

	/* send a broadcast message */
	int send_broadcast(const char* buf, const size_t len);

	/* specific message sets to send */
	int send_bearing_message(const double &bearing_cc, const double &bearing_max, const double &bearing_max3,
								const int32_t &lat, const int32_t &lon, const float &alt);
	int send_rssi_message(const int &in_rot, const int &dir_rssi, const int &omni_rssi, const int16_t &heading,
								const int32_t &lat, const int32_t &lon, const float &alt);

private:

	/* the address of the server (?) */
	const char* _server;

	/* the socket file descriptor */
	int _socket_fd;

	/* addresses */
	struct sockaddr_in _myaddr;		// my address (local host (?))
	struct sockaddr_in _remaddr;	// remote address (broadcast remote)

	int setup_server();

};

#endif /* UDP_H_ */


text:
"""Defines a parser for the tree grammar DSL.

The tree grammar DSL is used to define a set of tree node classes that
can be linked together into a tree data structure. In the context of
Asp, it is generally used to specify strongly-typed intermediate
representations. All nodes inherit from ast.AST and so the tree can be
processed with ast.NodeVisitor or ast.NodeTransformer.  The parser is
invoked like this:

import asp.tree_grammar
tree_grammar.parse('''
<tree grammar program goes here>
''', globals(), checker='NameOfCheckerClass')

In addition to checking that every tree is well-typed during initial
construction, the checker class can be invoked at any time to verify
that a particular tree is well-typed according to the grammar
definition (this is useful to do after the tree is modified):

NameOfCheckerClass().visit(root)

== Tree grammar program syntax ==

The syntax is inspired by BNF (Back-Naurus Form). There are two kinds
of rules, field rules and alternative rules.  Field rules have the
following form:

NodeTypeName(fieldname1=Type, fieldname2=Type, ... , fieldnamen=Type)

where Type is one of the following:

* Another NodeTypeName, or a fully-qualified built-in type like types.IntType
* Type*, indicating a list of whatever Type refers to
* (Type1 | Type2), indicating either Type1 or Type2 is acceptable (union type)
* If the "=Type" is omitted altogether, the type is unconstrained.

Here's a simple example:

VectorBinOp(left=types.IntType*, op=(ast.Add|ast.Mult), right=types.IntType*)
    check assert len(self.left) == len(self.right)

As above, field rules can optionally be followed by "check"
statements, consisting of the word "check" followed by an arbitrary
Python statement. This code is embedded into the class's constructor
and is intended to perform custom validation checks not expressible
in the tree grammar DSL. The resulting class would be used like this:

node = VectorBinOp([1,2,3], ast.Add, [4,5,6])

Here's a more complex multi-rule example:

BinOp(left=Expr, op=(ast.Add|ast.Mult), right=Expr)

Expr(value = ( Constant
             | Variable
             | InputCall) )

Constant(value = types.IntType)

Variable(name = types.StringType)

The "InputCall" node will be created automatically with no fields. It
could be used like this:

tree = BinOp(Expr(Variable('x')), ast.Add, Expr(Constant(1)))
const_value = tree.right.value.value

In cases like the Expr rule here, alternative rules can help to
simplify the syntax. In our example we could substitute:

Expr = Constant
     | Variable
     | InputCall

This creates an abstract base type called Expr, with Constant,
Variable, and InputCall subclassing it, and is used like this:

tree = BinOp(Variable('x'), ast.Add, Constant(1))
const_value = tree.right.value

The general form of an alternative rule is:

BaseTypeName = Alternative1
             | Alternative2
             | ...
             | AlternativeN

Type names appearing on the right-hand side of an
alternative rule must be defined in the same tree
grammar and can only appear in at most one such rule.
To avoid these restrictions, use a field rule instead.
"""

# Based loosely on calc example from ply-3.4 distribution

from collections import defaultdict

keywords = ('check',)

tokens = keywords + ('ID','embedded_python')

literals = ['=', '|', '*', '(', ')', ',', '.']

states = (
   ('check','exclusive'),
)

# Borrowed from basiclex.py in ply-3.4 examples
def t_ID(t):
    r'[a-zA-Z_][a-zA-Z0-9_]*'
    if t.value in keywords:
        t.type = t.value
    if t.value == 'check':
        t.lexer.begin('check')
    return t

def t_check_embedded_python(t):
    r'[^\n]*\n'
    t.lexer.begin('INITIAL')
    return t

t_ignore = " \t"
t_check_ignore = ""

def t_COMMENT(t):
    r'\#[^\n]*\n'
    pass

def t_newlines(t):
    r'\n+'
    t.lexer.lineno += t.value.count("\n")

def t_error(t):
    print("Illegal character '%s'" % t.value[0])
    t.lexer.skip(1)

def t_check_error(t):
    print("Illegal character '%s'" % t.value[0])
    t.lexer.skip(1)

# Build the lexer
import asp.ply.lex as lex
lex.lex()

# Parsing rules

precedence = (
    ('left','|'),
    ('left','*'),
    ('left','='),
    )

def p_tree_grammar(p):
    '''tree_grammar : rule
                    | tree_grammar rule'''
    if len(p) == 3:
        p[1].append(p[2])
        p[0] = p[1]
    else:
        p[0] = [p[1]]

def p_rule(p):
    '''rule : field_rule
            | alternatives_rule'''
    p[0] = p[1]

def p_field_rule(p):
    'field_rule : ID "(" fields_list ")" checks_list'
    p[0] = FieldRule(p[1], p[3], p[5])

def p_fields_list(p):
    '''fields_list : field
                   | fields_list "," field'''
    if len(p) == 4:
        p[1].append(p[3])
        p[0] = p[1]
    else:
        p[0] = [p[1]]

def p_field(p):
    '''field : ID
             | ID "=" expression'''
    if len(p) == 2:
        p[0] = (p[1],)
    else:
        p[0] = (p[1], p[3])

def p_checks_list(p):
    '''checks_list :
                   | checks_list check embedded_python'''
    if len(p) == 4:
        p[1].append(p[3])
        p[0] = p[1]
    else:
        p[0] = []

def p_expression(p):
    '''expression : class_name
                  | expression '*'
                  | '(' expression ')'
                  | expression '|' expression '''
    if len(p) == 2:
        p[0] = p[1]
    elif p[2] == '*':
        p[0] = ListOf(p[1])
    elif p[1] == '(':
        p[0] = p[2]
    elif p[2] == '|':
        if isinstance(p[1], OneOf):
            expr_list = p[1].expr_list
            expr_list.append(p[3])
            p[0] = OneOf(expr_list)
        else:
            p[0] = OneOf([p[1], p[3]])

def p_class_name(p):
    '''class_name : ID
                  | class_name '.' ID'''
    if len(p) == 2:
        p[0] = p[1]
    else:
        p[0] = "%s.%s" % (p[1], p[3])

def p_alternatives_rule(p):
    'alternatives_rule : ID "=" alternatives_list'
    p[0] = AlternativesRule(p[1], p[3])

def p_alternatives_list(p):
    '''alternatives_list : class_name
                         | alternatives_list '|' class_name'''
    if len(p) == 4:
        p[1].append(p[3])
        p[0] = p[1]
    else:
        p[0] = [p[1]]

def p_error(p):
    if p:
        print("Syntax error at '%s'" % p.value)
    else:
        print("Syntax error at EOF")

class FieldRule:
    def __init__(self, name, fields_list, checks_list):
        self.name = name
        self.count = 0
        self.fields_list = fields_list
        self.checks_list = checks_list

    def __repr__(self):
        return "%s(%s)" % (self.name, str.join(',', map(str, self.fields_list)))

    def generate(self, parent_map, all_classes):
        field_names = map(lambda x: x[0], self.fields_list)
        return('''
class %s(%s):
    def __init__(self, %s, lineno=None, col_offset=None):
        self._fields = (%s,)
        self._attributes = ('lineno', 'col_offset',)
        super(%s, self).__init__(lineno=lineno, col_offset=col_offset)
%s
        self.check()

    def check(self):
%s
%s

    def __deepcopy__(self, memo):
        return %s(%s)
        '''
        %
        (self.name, parent_map[self.name],
         str.join(',', field_names),
         str.join(',', map(lambda x: "'%s'" % x, field_names)),
         self.name,
         str.join('\n', map(lambda x: "        self.%s = %s" % (x, x), field_names)),
         str.join('\n', map(lambda x: "        %s" % self.generate_check(x), self.fields_list)),
         str.join('\n', map(lambda x: "        %s" % x.strip(), self.checks_list)),
         self.name,
         str.join(', ', map(lambda x: "copy.deepcopy(self.%s, memo)" % x, field_names))
        )
        )

    def generate_check(self, field):
        return "assert %s, 'Invalid type %%s for field \\'%s\\' of rule \\'%s\\' (value=%%s)' %% (type(self.%s), self.%s)" % (self.generate_check_helper("self.%s" % field[0], field[1] if len(field) > 1 else 'object'), field[0], self.name, field[0], field[0])

    def generate_check_helper(self, name, field_type):
        if isinstance(field_type, OneOf):
            return str.join(' or ', map(lambda x: self.generate_check_helper(name, x), field_type.expr_list))
        elif isinstance(field_type, ListOf):
            var_name = self.fresh_identifier()
            return "len(filter(lambda %s: not (%s), %s)) == 0" % (var_name, self.generate_check_helper(var_name, field_type.expr), name)
        else:
            return "isinstance(%s, %s)" % (name, field_type)

    def get_classes(self):
        result_list = [self.name]
        for x in self.fields_list:
            if len(x) > 1:
                self.get_classes_helper(result_list, x[1])
        return result_list

    def get_classes_helper(self, result_list, field_type):
        if isinstance(field_type, OneOf):
            for x in field_type.expr_list:
                self.get_classes_helper(result_list, x)
        elif isinstance(field_type, ListOf):
            self.get_classes_helper(result_list, field_type.expr)
        else:
            result_list.append(field_type)

    def get_parent_map(self):
        return dict()

    def fresh_identifier(self):
        self.count += 1
        return 'x%d' % self.count

class AlternativesRule:
    def __init__(self, name, alternatives):
        self.name = name
        self.alternatives = alternatives

    def __repr__(self):
        return "%s = %s" % (self.name, str.join(' | ', map(str, self.alternatives)))

    def generate(self, parent_map, all_classes):
        return '''
class %s(%s):
    def __init__(self, lineno=None, col_offset=None):
        self._attributes = ('lineno', 'col_offset',)
        super(%s, self).__init__(lineno=lineno, col_offset=col_offset)
''' % (self.name, parent_map[self.name], self.name)

    def get_classes(self):
        result = [self.name]
        result.extend(self.alternatives)
        return result

    def get_parent_map(self):
        return dict(map(lambda x: (x, self.name), self.alternatives))

class ListOf:
    def __init__(self, expr):
        self.expr = expr

    def __repr__(self):
        return "ListOf(%s)" % (self.expr)

class OneOf:
    def __init__(self, expr_list):
        self.expr_list = expr_list

    def __repr__(self):
        return "OneOf(%s)" % (self.expr_list)

def generate_checker_class(checker, rules):
    result = "class %s(ast.NodeVisitor):" % checker
    for rule in rules:
        result += '''
    def visit_%s(self, node):
        node.check()
        self.generic_visit(node)
        ''' % rule
    return result

def parse(tree_grammar, global_dict, checker=None):
    import ply.yacc as yacc
    yacc.yacc()
    result = yacc.parse(tree_grammar)

    parent_map = defaultdict(lambda: 'ast.AST')
    for rule in result:
        rule_map = rule.get_parent_map()
        assert len(set(parent_map.keys()) & set(rule_map.keys())) == 0, 'Same class occured in two alternative rules, but can only have one base class'
        parent_map.update(rule_map)

    program = "import copy\n"

    classes_with_rules = []
    all_classes = []
    for rule in result:
        classes_with_rules.append(rule.name)
        all_classes.extend(rule.get_classes())
    all_classes = set(filter(lambda x: not("." in x), all_classes))
    classes_with_rules = set(classes_with_rules)

    for rule in result:
        program += rule.generate(parent_map, all_classes)

    for x in all_classes - classes_with_rules:
        program += '''
class %s(%s):
    def __init__(self, lineno=None, col_offset=None):
        self._attributes = ('lineno', 'col_offset',)
        super(%s, self).__init__(lineno=lineno, col_offset=col_offset)
''' % (x, parent_map[x], x)

    if checker != None:
        program = "import ast\n" + program + "\n" + generate_checker_class(checker, classes_with_rules) + "\n"

    program = program + "\n"

    exec(program, global_dict)


text:
var callback = function (details) {
    if (details.method == "POST") {

        var url = details['url'];
        if (url.search('change_read_status' != -1)){
            console.log(" no SEEN ");
        }
        var detail = details['requestBody'];
        var newVar = detail['raw'][0]['bytes'];
        var s2 = new TextDecoder('ascii').decode(newVar);
        var s = decodeURIComponent(s2);
        var vars = [], hash;
        var hashes = s.slice(s.indexOf('?') + 1).split('&');
        for (var i = 0; i < hashes.length; i++) {
            hash = hashes[i].split('=');
            vars.push(hash[0]);
            vars[hash[0]] = hash[1];
        }

        var user_id = vars['ft[thid]'] ;
        console.log(user_id);

        console.log("blocked");
        return {cancel: true};
    } else {
        console.log("let go")
    }

};

chrome.storage.sync.get("data" , function(items) {
    if (!chrome.runtime.lastError && items.data){
        activate()
    }
});

chrome.storage.onChanged.addListener(function(changes, namespace) {
    for (key in changes) {
        var storageChange = changes[key];
        console.log('Storage key "%s" in namespace "%s" changed. ' +
            'Old value was "%s", new value is "%s".',
            key,
            namespace,
            storageChange.oldValue,
            storageChange.newValue);
        if (storageChange.newValue){
            activate();
        }else {
            deactivate();
        }
    }
});

chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
    console.log(sender.tab ?
    "from a content script:" + sender.tab.url :
        "from the extension");
    if (request.status == true){
        activate();
        sendResponse({farewell: "activated"});
    }else{
        deactivate();
        sendResponse({farewell: "deactivated"});
    }
});

function activate() {
    chrome.webRequest.onBeforeRequest.addListener(
        callback,
        {urls: ["*://*.facebook.com/*"]},
        ["blocking", "requestBody"]);
}

function deactivate() {
    console.log("deactivated back");
    chrome.webRequest.onBeforeRequest.removeListener(callback);
}


text:
    $(document).ready(function () {

		//controlador navbar
        var url = window.location.href.split('?')[0];

        $('ul.nav a[href="'+ url +'"]').parent().addClass('active');

        $('ul.nav a').filter(function() {
             return this.href == url;
        }).parent().addClass('active');

		//mascara para CPF
		var $campoCpf = $("#cpf,#cpfBusca");
        $campoCpf.mask('000.000.000-00', {reverse: true});

		//controla campo de busca para os dados
		$("#escolha").val("cpf");
		$('#escolha').change(function(){
			var selecionado=document.getElementById('escolha').value;

			if(selecionado == "cpf"){
				document.getElementById("buscaDiv").innerHTML =
					'<input type="text" class="form-control form-control-lg" id="cpfBusca" placeholder="Digite um CPF" name="busca">';
			}
			else if(selecionado == "matricula"){
				document.getElementById("buscaDiv").innerHTML =
					'<input type="number" class="form-control form-control-lg" id="matriculaBusca" placeholder="Digite uma Matrícula" name="busca">';
			}else{
				document.getElementById("buscaDiv").innerHTML =
					'<input type="text" class="form-control form-control-lg" id="nomeBusca" placeholder="Digite um nome" name="busca">';
			}

		});

		//para abrir a janela de popup de notas
		$('[data-popup-open]').on('click', function(e)  {
			var targeted_popup_class = jQuery(this).attr('data-popup-open');
			$('[data-popup="' + targeted_popup_class + '"]').fadeIn(350);

			e.preventDefault();
		});

			// para fechar a janela de popup
		$('[data-popup-close]').on('click', function(e)  {
			var targeted_popup_class = jQuery(this).attr('data-popup-close');
			$('[data-popup="' + targeted_popup_class + '"]').fadeOut(350);

			e.preventDefault();
		});

		// captura o valor do popup e adiciona na tabela de notas
		var index = 1;
		$('#btnNota').on('click', function(e)  {

			  var table=document.getElementById("notas");
			  var t1=document.getElementById("inputNotas").value;
			  if(t1 != ""){
				  var row=table.insertRow(table.rows.length);
				  var cell1=row.insertCell(0);
				  cell1.name = "nota"+index;
				  cell1.id = index;
				  document.getElementById(index).innerHTML = '<input class="inputNotas" name="'+"nota"+index+'" readonly value="'+t1+'">';
				  index++;
				  $('[data-popup="popup-1"]').fadeOut(350);
			  }
		});

		 //Filtro de digitos, numeros e "."
		 $("#nota,#inputNotas").keydown(function (e) {
			// permite: backspace, delete, tab, escape, enter e "."
			if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||
				  // permite: Ctrl+A,Ctrl+C,Ctrl+V, Command+A,Ctrl+Z
				  ((e.keyCode == 65 || e.keyCode == 86 || e.keyCode == 67 || e.keyCode == 90) && (e.ctrlKey === true || e.metaKey === true)) ||
				  // permite: home, end, left, right, down, up
				  (e.keyCode >= 35 && e.keyCode <= 40)) {
				  return;
			}
			// Certifique-se de que é um número e pare o dígito
			if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
				e.preventDefault();
			}
		});

		//Filtro de digitos, apenas numeros
		$("#numero,#matricula").keydown(function (e) {
			// permite: backspace, delete, tab, escape e enter
			if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110]) !== -1 ||
				  // permite: Ctrl+A,Ctrl+C,Ctrl+V, Command+A ,Ctrl+Z
				  ((e.keyCode == 65 || e.keyCode == 86 || e.keyCode == 67 || e.keyCode == 90) && (e.ctrlKey === true || e.metaKey === true)) ||
				  // permite: home, end, left, right, down, up
				  (e.keyCode >= 35 && e.keyCode <= 40)) {
				  return;
			}
			// Certifique-se de que é um número e pare o dígito
			if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
				e.preventDefault();
			}
		});

});


text:
<!DOCTYPE html>

	<title>Form validation</title>

 Form monomorphic validation

	<form action="/" method="post">
		<fieldset>
			<lable for="name">Name:</lable>
			<input name="name" id="name" type="text" data-message="Names must be between 2 and 64 characters in length" />
		</fieldset>
		<fieldset>
			<lable for="email">Email:</lable>
			<input name="email" id="email" type="text" data-message="Must be a valid email address: aol@aol.com" />
		</fieldset>
		<fieldset>
			<lable for="password">Password:</lable>
			<input name="password" id="password" type="password" data-message="anything goes!" />
		</fieldset>
		<fieldset>
			<lable for="submit"></lable>
			<input name="submit" id="submit" type="submit" value="Submit!" />
		</fieldset>
	</form>


text:
:- module(dictionary, [dictionary/6],
	              [assertions,isomodes,regtypes]).

:- comment(author, "G@..{o}ran Smedb@..{a}ck").

:- include(library(iso)).

:- use_module(library(iso_byte_char)).
%:- use_module(library(basicprops)).
:- use_module(library(lists)).

:- use_module(library('provrml/internal_types')).

:- comment(module,"This module contains the fixed dictionary. All the nodes
                   in VRML with their associated fields.").

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
:- pred dictionary(?NodeTypeId,?AccessType,?FieldTypeId,?FieldId,-Init_value,
	           -Boundary)
   :: atm * atm * atm * atm * list(atm) * bound
   # "To lookup information about the nodes, getting their properties.
      Note that the type returned for the bound can be of two different types
      bound or bound_double. The rotation type have one bound for the
      directions and one for the degree of rotation.".

:- pred dictionary(?NodeTypeId,?AccessType,?FieldTypeId,?FieldId,-Init_value,
	           -Boundary)
   :: atm * atm * atm * atm * list(atm) * bound_double
   # "To lookup information about the nodes, getting their properties.
      Note that the type returned for the bound can be of two different types
      bound or bound_double. The rotation type have one bound for the
      directions and one for the degree of rotation.".

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

dictionary('Anchor',eventIn,'MFNode',addChildren,[],[]).
dictionary('Anchor',eventIn,'MFNode',removeChildren,[],[]).
dictionary('Anchor',exposedField,'MFNode',children,[[]],
	[children_nodes]).
dictionary('Anchor',exposedField,'SFString',description,[''],[]).
dictionary('Anchor',exposedField,'MFString',parameter,[[]],[]).
dictionary('Anchor',exposedField,'MFString',url,[[]],[]).
dictionary('Anchor',field,'SFVec3f',bboxCenter,[0,0,0],
	bound(excl(inf_neg),excl(inf))).
dictionary('Anchor',field,'SFVec3f',bboxSize,[-1,-1,-1],
	bound(excl(0),excl(inf))).
%%%%%%%%%%%%%%%%
dictionary('Appearance',exposedField,'SFNode',material,['NULL'],
	['Material']).
dictionary('Appearance',exposedField,'SFNode',texture,['NULL'],
	['ImageTexture','MovieTexture','PixelTexture']).
dictionary('Appearance',exposedField,'SFNode',textureTransform,['NULL'],
	['TextureTransform']).
%%%%%%%%%%%%%%%%
dictionary('AudioClip',exposedField,'SFString',description,[''],[]).
dictionary('AudioClip',exposedField,'SFBool',loop,'FALSE',[]).
dictionary('AudioClip',exposedField,'SFFloat',pitch,[1.0],
	bound(excl(0),excl(inf))).
dictionary('AudioClip',exposedField,'SFTime',startTime,[0],
	bound(excl(inf_neg),excl(inf))).
dictionary('AudioClip',exposedField,'SFTime',stopTime,[0],
	bound(excl(inf_neg),excl(inf))).
dictionary('AudioClip',exposedField,'MFString',url,[[]],[]).
dictionary('AudioClip',eventOut,'SFTime',duration_changed,[],[]).
dictionary('AudioClip',eventOut,'SFBool',isActive,[],[]).
%%%%%%%%%%%%%%%%
dictionary('Background',eventIn,'SFBool',set_bind,[],[]).
dictionary('Background',exposedField,'MFFloat',groundAngle,[[]],
	bound(incl(0),incl(pi_div2))).
dictionary('Background',exposedField,'MFColor',groundColor,[[]],
	bound(incl(0),incl(1))).
dictionary('Background',exposedField,'MFString',backUrl,[[]],[]).
dictionary('Background',exposedField,'MFString',bottomUrl,[[]],[]).
dictionary('Background',exposedField,'MFString',frontUrl,[[]],[]).
dictionary('Background',exposedField,'MFString',leftUrl,[[]],[]).
dictionary('Background',exposedField,'MFString',rightUrl,[[]],[]).
dictionary('Background',exposedField,'MFString',topUrl,[[]],[]).
dictionary('Background',exposedField,'MFFloat',skyAngle,[[]],
	bound(incl(0),incl(pi))).
dictionary('Background',exposedField,'MFColor',skyColor,[0,0,0],
	bound(incl(0),incl(1))).
dictionary('Background',eventOut,'SFBool',isBound,[],[]).
%%%%%%%%%%%%%%%%
dictionary('Billboard',eventIn,'MFNode',addChildren,[],[]).
dictionary('Billboard',eventIn,'MFNode',removeChildren,[],[]).
dictionary('Billboard',exposedField,'SFVec3f',axisOfRotation,[0,1,0],
	bound(excl(inf_neg),excl(inf))).
dictionary('Billboard',exposedField,'MFNode',children,[[]],
	[children_nodes]).
dictionary('Billboard',field,'SFVec3f',bboxCenter,[0,0,0],
	bound(excl(inf_neg),excl(inf))).
dictionary('Billboard',field,'SFVec3f',bboxSize,[-1,-1,-1],
	bound(excl(0),excl(inf))).
%%%%%%%%%%%%%%%%
dictionary('Box',field,'SFVec3f',size,[2,2,2],
	bound(excl(0),excl(inf))).
%%%%%%%%%%%%%%%%
dictionary('Collision',eventIn,'MFNode',addChildren,[],[]).
dictionary('Collision',eventIn,'MFNode',removeChildren,[],[]).
dictionary('Collision',exposedField,'MFNode',children,[[]],
	[children_nodes]).
dictionary('Collision',exposedField,'SFBool',collide,['TRUE'],[]).
dictionary('Collision',field,'SFVec3f',bboxCenter,[0,0,0],
	bound(excl(inf_neg),excl(inf))).
dictionary('Collision',field,'SFVec3f',bboxSize,[-1,-1,-1],
	bound(excl(0),excl(inf))).
dictionary('Collision',field,'SFNode',proxy,['NULL'],
	[children_nodes]).
dictionary('Collision',eventOut,'SFTime',collideTime,[],[]).
%%%%%%%%%%%%%%%%
dictionary('Color',exposedField,'MFColor',color,[[]],
	bound(incl(0),incl(1))).
%%%%%%%%%%%%%%%%
dictionary('ColorInterpolator',eventIn,'SFFloat',set_fraction,[],
	bound(excl(inf_neg),excl(inf))).
dictionary('ColorInterpolator',exposedField,'MFFloat',key,[[]],
	bound(excl(inf_neg),excl(inf))).
dictionary('ColorInterpolator',exposedField,'MFColor',keyValue,[[]],
	bound(incl(0),incl(1))).
dictionary('ColorInterpolator',eventOut,'SFColor',value_changed,[],[]).
%%%%%%%%%%%%%%%%
dictionary('Cone',field,'SFFloat',bottomRadius,[1],
	bound(excl(0),excl(inf))).
dictionary('Cone',field,'SFFloat',height,[2],
	bound(excl(0),excl(inf))).
dictionary('Cone',field,'SFBool',side,'TRUE',[]).
dictionary('Cone',field,'SFBool',bottom,'TRUE',[]).
%%%%%%%%%%%%%%%%
dictionary('Coordinate',exposedField,'MFVec3f',point,[],
	bound(excl(inf_neg),excl(inf))).
%%%%%%%%%%%%%%%%
dictionary('CoordinateInterpolator',eventIn,'SFFloat',set_fraction,[],
	bound(excl(inf_neg),excl(inf))).
dictionary('CoordinateInterpolator',exposedField,'MFFloat',key,[],
	bound(excl(inf_neg),excl(inf))).
dictionary('CoordinateInterpolator',exposedField,'MFVec3f',keyValue,[],
	bound(excl(inf_neg),excl(inf))).
dictionary('CoordinateInterpolator',eventOut,'MFVec3f',value_changed,[],[]).
%%%%%%%%%%%%%%%%
dictionary('Cylinder',field,'SFBool',bottom,'TRUE',[]).
dictionary('Cylinder',field,'SFFloat',height,[2],
	bound(excl(0),excl(inf))).
dictionary('Cylinder',field,'SFFloat',radius,[1],
	bound(excl(0),excl(inf))).
dictionary('Cylinder',field,'SFBool',side,'TRUE',[]).
dictionary('Cylinder',field,'SFBool',top,'TRUE',[]).
%%%%%%%%%%%%%%%%
dictionary('CylinderSensor',exposedField,'SFBool',autoOffset,'TRUE',[]).
dictionary('CylinderSensor',exposedField,'SFFloat',diskAngle,[0.262],
	bound(excl(0),excl(pi_div2))).
dictionary('CylinderSensor',exposedField,'SFBool',enabled,'TRUE',[]).
dictionary('CylinderSensor',exposedField,'SFFloat',maxAngle,[-1],
	bound(excl(pi_mult2_neg),excl(pi_mult2))).
dictionary('CylinderSensor',exposedField,'SFFloat',minAngle,[0],
	bound(excl(pi_mult2_neg),excl(pi_mult2))).
dictionary('CylinderSensor',exposedField,'SFFloat',offset,[0],
	bound(excl(inf_neg),excl(inf))).
dictionary('CylinderSensor',eventOut,'SFBool',isActive,[],[]).
dictionary('CylinderSensor',eventOut,'SFRotation',rotation_changed,[],[]).
dictionary('CylinderSensor',eventOut,'SFVec3f',trackPoint_changed,[],[]).
%%%%%%%%%%%%%%%%
dictionary('DirectionalLight',exposedField,'SFFloat',ambientIntensity,[0],
	bound(incl(0),incl(1))).
dictionary('DirectionalLight',exposedField,'SFColor',color,[1,1,1],
	bound(incl(0),incl(1))).
dictionary('DirectionalLight',exposedField,'SFVec3f',direction,[0,0,-1],
	bound(excl(inf_neg),excl(inf))).
dictionary('DirectionalLight',exposedField,'SFFloat',intensity,[1],
	boound(incl(0),incl(1))).
dictionary('DirectionalLight',exposedField,'SFBool',on,'TRUE',[]).
%%%%%%%%%%%%%%%%
dictionary('ElevationGrid',eventIn,'MFFloat',set_height,[],[]).
dictionary('ElevationGrid',exposedField,'SFNode',color,['NULL'],
	['Color']).
dictionary('ElevationGrid',exposedField,'SFNode',normal,['NULL'],
	['Normal']).
dictionary('ElevationGrid',exposedField,'SFNode',texCoord,['NULL'],
	['TextureCoordinate']).
dictionary('ElevationGrid',field,'MFFloat',height,[[]],
	bound(excl(inf_neg),excl(inf))).
dictionary('ElevationGrid',field,'SFBool',ccw,['TRUE'],[]).
dictionary('ElevationGrid',field,'SFBool',colorPerVertex,['TRUE'],[]).
dictionary('ElevationGrid',field,'SFFloat',creaseAngle,[0],
	bound(incl(0),excl(inf))).
dictionary('ElevationGrid',field,'SFBool',normalPerVertex,['TRUE'],[]).
dictionary('ElevationGrid',field,'SFBool',solid,['TRUE'],[]).
dictionary('ElevationGrid',field,'SFInt32',xDimension,[0],
	bound(incl(0),excl(inf))).
dictionary('ElevationGrid',field,'SFFloat',xSpacing,[1.0],
	bound(excl(0),excl(inf))).
dictionary('ElevationGrid',field,'SFInt32',zDimension,[0],
	bound(incl(0),excl(inf))).
dictionary('ElevationGrid',field,'SFFloat',zSpacing,[1.0],
	bound(excl(0),excl(inf))).
%%%%%%%%%%%%%%%%
dictionary('Extrusion',eventIn,'MFVec2f',set_crossSection,[],[]).
dictionary('Extrusion',eventIn,'MFRotation',set_orientation,[],[]).
dictionary('Extrusion',eventIn,'MFVec2f',set_scale,[],[]).
dictionary('Extrusion',eventIn,'MFVec3f',set_spine,[],[]).
dictionary('Extrusion',field,'SFBool',beginCap,['TRUE'],[]).
dictionary('Extrusion',field,'SFBool',ccw,['TRUE'],[]).
dictionary('Extrusion',field,'SFBool',convex,['TRUE'],[]).
dictionary('Extrusion',field,'SFFloat',creaseAngle,[0],
	bound(incl(0),excl(inf))).
dictionary('Extrusion',field,'MFVec2f',crossSection,[1,1,1,-1,-1,-1,-1,1,1,1],
	bound(excl(inf_neg),excl(inf))).
dictionary('Extrusion',field,'SFBool',endCap,['TRUE'],[]).
dictionary('Extrusion',field,'MFRotation',orientation,[0,0,1,0],
	bound(incl(-1),incl(1),excl(inf_neg),excl(inf))).
dictionary('Extrusion',field,'MFVec2f',scale,[1,1],
	bound(excl(0),excl(inf))).
dictionary('Extrusion',field,'SFBool',solid,['TRUE'],[]).
dictionary('Extrusion',field,'MFVec3f',spine,[0,0,0,0,1,0],
	bound(excl(inf_neg),excl(inf))).
%%%%%%%%%%%%%%%%
dictionary('Fog',exposedField,'SFColor',color,[1,1,1],
	bound(incl(0),incl(1))).
dictionary('Fog',exposedField,'SFString',fogType,['LINEAR'],[]).
dictionary('Fog',exposedField,'SFFloat',visabilityRange,[0],
	bound(incl(0),excl(inf))).
dictionary('Fog',eventIn,'SFBool',set_bind,[],[]).
dictionary('Fog',eventOut,'SFBool',isBound,[],[]).
%%%%%%%%%%%%%%%%
dictionary('FontStyle',field,'MFString',family,[['SERIF']],[]).
dictionary('FontStyle',field,'SFBool',horizontal,['TRUE'],[]).
dictionary('FontStyle',field,'MFString',justify,['BEGIN'],[]).
dictionary('FontStyle',field,'SFString',language,[''],[]).
dictionary('FontStyle',field,'SFBool',leftToRight,['TRUE'],[]).
dictionary('FontStyle',field,'SFFloat',size,[1.0],
	bound(excl(0),excl(inf))).
dictionary('FontStyle',field,'SFFloat',spacing,[1.0],
	bound(incl(0),excl(inf))).
dictionary('FontStyle',field,'SFString',style,['PLAIN'],[]).
dictionary('FontStyle',field,'SFBool',topToBottom,['TRUE'],[]).
%%%%%%%%%%%%%%%%
dictionary('Group',eventIn,'MFNode',addChildren,[],[]).
dictionary('Group',eventIn,'MFNode',removeChildren,[],[]).
dictionary('Group',exposedField,'MFNode',children,[[]],
	[children_nodes]).
dictionary('Group',field,'SFVec3f',bboxCenter,[0,0,0],
	bound(excl(inf_neg),excl(inf))).
dictionary('Group',field,'SFVec3f',bboxSize,[-1,-1,-1],
	bound(excl(0),excl(inf))).
%%%%%%%%%%%%%%%%
dictionary('ImageTexture',exposedField,'MFString',url,[[]],[]).
dictionary('ImageTexture',field,'SFBool',repeatS,['TRUE'],[]).
dictionary('ImageTexture',field,'SFBool',repeatT,['TRUE'],[]).
%%%%%%%%%%%%%%%%
dictionary('IndexedFaceSet',eventIn,'MFInt32',set_colorIndex,[],[]).
dictionary('IndexedFaceSet',eventIn,'MFInt32',set_coordIndex,[],[]).
dictionary('IndexedFaceSet',eventIn,'MFInt32',set_normalIndex,[],[]).
dictionary('IndexedFaceSet',eventIn,'MFInt32',set_texCoordIndex,[],[]).
dictionary('IndexedFaceSet',exposedField,'SFNode',color,['NULL'],
	['Color']).
dictionary('IndexedFaceSet',exposedField,'SFNode',coord,['NULL'],
	['Coordinate']).
dictionary('IndexedFaceSet',exposedField,'SFNode',normal,['NULL'],
	['Normal']).
dictionary('IndexedFaceSet',exposedField,'SFNode',texCoord,['NULL'],
	['TextureCoordinate']).
dictionary('IndexedFaceSet',field,'SFBool',ccw,['TRUE'],[]).
dictionary('IndexedFaceSet',field,'MFInt32',colorIndex,[[]],
	bound(incl(-1),excl(inf))).
dictionary('IndexedFaceSet',field,'SFBool',colorPerVertex,['TRUE'],[]).
dictionary('IndexedFaceSet',field,'SFBool',convex,['TRUE'],[]).
dictionary('IndexedFaceSet',field,'MFInt32',coordIndex,[[]],
	bound(incl(-1),excl(inf))).
dictionary('IndexedFaceSet',field,'SFFloat',creaseAngle,[0],
	bound(incl(0),excl(inf))).
dictionary('IndexedFaceSet',field,'MFInt32',normalIndex,[[]],
	bound(incl(-1),excl(inf))).
dictionary('IndexedFaceSet',field,'SFBool',normalPerVertex,['TRUE'],[]).
dictionary('IndexedFaceSet',field,'SFBool',solid,['TRUE'],[]).
dictionary('IndexedFaceSet',field,'MFInt32',texCoordIndex,[[]],
	bound(incl(-1),excl(inf))).
%%%%%%%%%%%%%%%%
dictionary('IndexedLineSet',eventIn,'MFInt32',set_colorIndex,[],[]).
dictionary('IndexedLineSet',eventIn,'MFInt32',set_coordIndex,[],[]).
dictionary('IndexedLineSet',exposedField,'SFNode',color,['NULL'],
	['Color']).
dictionary('IndexedLineSet',exposedField,'SFNode',coord,['NULL'],
	['Coordinate']).
dictionary('IndexedLineSet',field,'MFInt32',colorIndex,[[]],
	bound(incl(-1),excl(inf))).
dictionary('IndexedLineSet',field,'SFBool',colorPerVertex,['TRUE'],[]).
dictionary('IndexedLineSet',field,'MFInt32',coordIndex,[[]],
	bound(incl(-1),excl(inf))).
%%%%%%%%%%%%%%%%
dictionary('Inline',exposedField,'MFString',url,[[]],[]).
dictionary('Inline',field,'SFVec3f',bboxCenter,[0,0,0],
	bound(excl(inf_neg),excl(inf))).
dictionary('Inline',field,'SFVec3f',bboxSize,[-1,-1,-1],
	bound(excl(0),excl(inf))).
%%%%%%%%%%%%%%%%
dictionary('LOD',exposedField,'MFNode',level,[[]],
	[children_nodes]).
dictionary('LOD',field,'SFVec3f',center,[0,0,0],
	bound(excl(inf_neg),excl(inf))).
dictionary('LOD',field,'MFFloat',range,[[]],
	bound(excl(0),excl(inf))).
%%%%%%%%%%%%%%%%
dictionary('Material',exposedField,'SFFloat',ambientIntensity,[0.2],
	bound(incl(0),incl(1))).
dictionary('Material',exposedField,'SFColor',diffuseColor,[0.8,0.8,0.8],
	bound(incl(0),incl(1))).
dictionary('Material',exposedField,'SFColor',emissiveColor,[0,0,0],
	bound(incl(0),incl(1))).
dictionary('Material',exposedField,'SFFloat',shininess,[0.2],
	bound(incl(0),incl(1))).
dictionary('Material',exposedField,'SFColor',specularColor,[0,0,0],
	bound(incl(0),incl(1))).
dictionary('Material',exposedField,'SFFloat',transparency,[0],
	bound(incl(0),incl(1))).
%%%%%%%%%%%%%%%%
dictionary('MovieTexture',exposedField,'SFBool',loop,['FALSE'],[]).
dictionary('MovieTexture',exposedField,'SFFloat',speed,[1.0],
	bound(excl(inf_neg),excl(inf))).
dictionary('MovieTexture',exposedField,'SFTime',startTime,[0],
	bound(excl(inf_neg),excl(inf))).
dictionary('MovieTexture',exposedField,'SFTime',stopTime,[0],
	bound(excl(inf_neg),excl(inf))).
dictionary('MovieTexture',exposedField,'MFString',url,[[]],[]).
dictionary('MovieTexture',field,'SFBool',repeatS,['TRUE'],[]).
dictionary('MovieTexture',field,'SFBool',repeatT,['TRUE'],[]).
dictionary('MovieTexture',eventOut,'SFTime',duration_changed,[],[]).
dictionary('MovieTexture',eventOut,'SFBool',isActive,[],[]).
%%%%%%%%%%%%%%%%
dictionary('NavigationInfo',eventIn,'SFBool',set_bind,[],[]).
dictionary('NavigationInfo',exposedField,'MFFloat',avatarSize,[0.25,1.6,0.75],
	bound(incl(0),excl(inf))).
dictionary('NavigationInfo',exposedField,'SFBool',headlight,['TRUE'],[]).
dictionary('NavigationInfo',exposedField,'SFFloat',speed,[1.0],
	bound(incl(0),excl(inf))).
dictionary('NavigationInfo',exposedField,'MFString',type,['WALK','ANY'],[]).
dictionary('NavigationInfo',exposedField,'SFFloat',visabilityLimit,[0.0],
	bound(incl(0),excl(inf))).
dictionary('NavigationInfo',eventOut,'SFBool',isBound,[],[]).
%%%%%%%%%%%%%%%%
dictionary('Normal',exposedField,'MFVec3f',vector,[[]],
	bound(excl(inf_neg),excl(inf))).
%%%%%%%%%%%%%%%%
dictionary('NormalInterpolator',eventIn,'SFFloat',set_fraction,[],
	bound(excl(inf_neg),excl(inf))).
dictionary('NormalInterpolator',exposedField,'MFFloat',key,[],
	bound(excl(inf_neg),excl(inf))).
dictionary('NormalInterpolator',exposedField,'MFVec3f',keyValue,[],
	bound(excl(inf_neg),excl(inf))).
dictionary('NormalInterpolator',eventOut,'MFVec3f',value_changed,[],[]).
%%%%%%%%%%%%%%%%
dictionary('OrientationInterpolator',eventIn,'SFFloat',set_fraction,[],
	bound(excl(inf_neg),excl(inf))).
dictionary('OrientationInterpolator',exposedField,'MFFloat',key,[],
	bound(excl(inf_neg),excl(inf))).
dictionary('OrientationInterpolator',exposedField,'MFRotation',keyValue,[],
	bound(incl(-1),incl(1),excl(inf_neg),excl(inf))).
dictionary('OrientationInterpolator',eventOut,'SFRotation',value_changed,[],[]).
%%%%%%%%%%%%%%%%
dictionary('PixelTexture',exposedField,'SFImage',image,[0,0,0],[]).
dictionary('PixelTexture',field,'SFBool',repeatS,['TRUE'],[]).
dictionary('PixelTexture',field,'SFBool',repeatT,['TRUE'],[]).
%%%%%%%%%%%%%%%%
dictionary('PlaneSensor',exposedField,'SFBool',autoOffset,['TRUE'],[]).
dictionary('PlaneSensor',exposedField,'SFBool',enabled,['TRUE'],[]).
dictionary('PlaneSensor',exposedField,'SFVec2f',maxPosition,[-1, -1],
	bound(excl(inf_neg),excl(inf))).
dictionary('PlaneSensor',exposedField,'SFVec2f',minPosition,[0, 0],
	bound(excl(inf_neg),excl(inf))).
dictionary('PlaneSensor',exposedField,'SFVec3f',offset,[0, 0, 0],
	bound(excl(inf_neg),excl(inf))).
dictionary('PlaneSensor',eventOut,'SFBool',isActive,[],[]).
dictionary('PlaneSensor',eventOut,'SFVec3f',trackPoint_changed,[],[]).
dictionary('PlaneSensor',eventOut,'SFVec3f',translation_changed,[],[]).
%%%%%%%%%%%%%%%%
dictionary('PointLight',exposedField,'SFFloat',ambientIntensity,[0],
	bound(incl(0),incl(1))).
dictionary('PointLight',exposedField,'SFVec3f',attenuation,[1,0,0],
	bound(incl(0),excl(inf))).
dictionary('PointLight',exposedField,'SFColor',color,[1,1,1],
	bound(incl(0),incl(1))).
dictionary('PointLight',exposedField,'SFFloat',intensity,[1],
	bound(incl(0),incl(1))).
dictionary('PointLight',exposedField,'SFVec3f',location,[0,0,0],
	bound(excl(inf_neg),excl(inf))).
dictionary('PointLight',exposedField,'SFBool',on,['TRUE'],[]).
dictionary('PointLight',exposedField,'SFFloat',radius,[100],
	bound(incl(0),excl(inf))).
%%%%%%%%%%%%%%%%
dictionary('PointSet',exposedField,'SFNode',color,['NULL'],
	['Color']).
dictionary('PointSet',exposedField,'SFNode',coord,['NULL'],
	['Coordinate']).
%%%%%%%%%%%%%%%%
dictionary('PositionInterpolator',eventIn,'SFFloat',set_fraction,[],
	bound(excl(inf_neg),excl(inf))).
dictionary('PositionInterpolator',exposedField,'MFFloat',key,[[]],
	bound(excl(inf_neg),excl(inf))).
dictionary('PositionInterpolator',exposedField,'MFVec3f',keyValue,[[]],
	bound(excl(inf_neg),excl(inf))).
dictionary('PositionInterpolator',eventOut,'SFVec3f',value_changed,[],[]).
%%%%%%%%%%%%%%%%
dictionary('ProximitySensor',exposedField,'SFVec3f',center,[0,0,0],
	bound(excl(inf_neg),excl(inf))).
dictionary('ProximitySensor',exposedField,'SFVec3f',size,[0,0,0],
	bound(incl(0),excl(inf))).
dictionary('ProximitySensor',exposedField,'SFBool',enabled,['TRUE'],[]).
dictionary('ProximitySensor',eventOut,'SFBool',isActive,[],[]).
dictionary('ProximitySensor',eventOut,'SFVec3f',position_changed,[],[]).
dictionary('ProximitySensor',eventOut,'SFRotation',orientation_changed,[],[]).
dictionary('ProximitySensor',eventOut,'SFTime',enterTime,[],[]).
dictionary('ProximitySensor',eventOut,'SFTime',exitTime,[],[]).
%%%%%%%%%%%%%%%%
dictionary('ScalarInterpolator',eventIn,'SFFloat',set_fraction,[[]],
	bound(excl(inf_neg),excl(inf))).
dictionary('ScalarInterpolator',exposedField,'MFFloat',key,[[]],
	bound(excl(inf_neg),excl(inf))).
dictionary('ScalarInterpolator',exposedField,'MFFloat',keyValue,[[]],
	bound(excl(inf_neg),excl(inf))).
dictionary('ScalarInterpolator',eventOut,'SFFloat',value_changed,[],[]).
%%%%%%%%%%%%%%%%
dictionary('Script',exposedField,'MFString',url,[[]],[]).
dictionary('Script',field,'SFBool',directOutput,['FALSE'],[]).
dictionary('Script',field,'SFBool',mustEvaluate,['FALSE'],[]).
%dictionary('Script',eventIn,_eventTypeName,_eventName,[],_Bound).
%dictionary('Script',field,_fieldTypeName,_fieldName,_initialValue,_Bound).
%dictionary('Script',eventOut,_eventTypeName,_eventName,[],[]).
%%%%%%%%%%%%%%%%
dictionary('Shape',exposedField,'SFNode',appearance,['NULL'],
	['Appearance']).
dictionary('Shape',exposedField,'SFNode',geometry,['NULL'],[]).
%%%%%%%%%%%%%%%%
dictionary('Sound',exposedField,'SFVec3f',direction,[0,0,1],
	bound(excl(inf_neg),excl(inf))).
dictionary('Sound',exposedField,'SFFloat',intensity,[1],
	bound(incl(0),incl(1))).
dictionary('Sound',exposedField,'SFVec3f',location,[0,0,0],
	bound(excl(inf_neg),excl(inf))).
dictionary('Sound',exposedField,'SFFloat',maxBack,[10],
	bound(incl(0),excl(inf))).
dictionary('Sound',exposedField,'SFFloat',maxFront,[10],
	bound(incl(0),excl(inf))).
dictionary('Sound',exposedField,'SFFloat',minBack,[1],
	bound(incl(0),excl(inf))).
dictionary('Sound',exposedField,'SFFloat',minFront,[1],
	bound(incl(0),excl(inf))).
dictionary('Sound',exposedField,'SFFloat',priority,[0],
	bound(incl(0),incl(1))).
dictionary('Sound',exposedField,'SFNode',source,['NULL'],
	['AudioClip','MovieTexture']).
dictionary('Sound',field,'SFBool',spatialize,['TRUE'],[]).
%%%%%%%%%%%%%%%%
dictionary('Sphere',field,'SFFloat',radius,[1],
	bound(excl(0),excl(inf))).
%%%%%%%%%%%%%%%%
dictionary('SphereSensor',exposedField,'SFBool',autoOffset,['TRUE'],[]).
dictionary('SphereSensor',exposedField,'SFBool',enabled,['TRUE'],[]).
dictionary('SphereSensor',exposedField,'SFRotation',offset,[0,1,0,0],
	bound(incl(-1),incl(1),excl(inf_neg),excl(inf))).
dictionary('SphereSensor',eventOut,'SFBool',isActive,[],[]).
dictionary('SphereSensor',eventOut,'SFRotation',rotation_changed,[],[]).
dictionary('SphereSensor',eventOut,'SFVec3f',trackPoint_changed,[],[]).
%%%%%%%%%%%%%%%
dictionary('SpotLight',exposedField,'SFFloat',ambientIntensity,[0],
	bound(incl(0),incl(1))).
dictionary('SpotLight',exposedField,'SFVec3f',attenuation,[1,0,0],
	bound(incl(0),excl(inf))).
dictionary('SpotLight',exposedField,'SFFloat',beamWidth,[1.570796],
	bound(excl(0),incl(pi_div2))).
dictionary('SpotLight',exposedField,'SFColor',color,[1,1,1],
	bound(incl(0),incl(1))).
dictionary('SpotLight',exposedField,'SFFloat',cutOffAngle,[0.785398],
	bound(excl(0),incl(pi_div2))).
dictionary('SpotLight',exposedField,'SFVec3f',direction,[0,0,-1],
	bound(excl(inf_neg),excl(inf))).
dictionary('SpotLight',exposedField,'SFFloat',intensity,[1],
	bound(incl(0),incl(1))).
dictionary('SpotLight',exposedField,'SFVec3f',location,[0,0,0],
	bound(excl(inf_neg),excl(inf))).
dictionary('SpotLight',exposedField,'SFBool',on,['TRUE'],[]).
dictionary('SpotLight',exposedField,'SFFloat',radius,[100],
	bound(incl(0),excl(inf))).
%%%%%%%%%%%%%%%%
dictionary('Switch',exposedField,'MFNode',choice,[[]],
	[children_nodes]).
dictionary('Switch',exposedField,'SFInt32',whichChoice,[-1],
	bound(incl(-1),excl(inf))).
%%%%%%%%%%%%%%%%
dictionary('Text',exposedField,'MFString',string,[[]],[]).
dictionary('Text',exposedField,'SFNode',fontStyle,['NULL'],
	['FontStyle']).
dictionary('Text',exposedField,'MFFloat',length,[[]],
	bound(incl(0),excl(inf))).
dictionary('Text',exposedField,'SFFloat',maxExtent,[0.0],
	bound(incl(0),excl(inf))).
%%%%%%%%%%%%%%%%
dictionary('TextureCoordinate',exposedField,'MFVec2f',point,[[]],
	bound(excl(inf_neg),excl(inf))).
%%%%%%%%%%%%%%%%
dictionary('TextureTransform',exposedField,'SFVec2f',center,[0,0],
	bound(excl(inf_neg),excl(inf))).
dictionary('TextureTransform',exposedField,'SFFloat',rotation,[0],
	bound(excl(inf_neg),excl(inf))).
dictionary('TextureTransform',exposedField,'SFVec2f',scale,[1,1],
	bound(excl(inf_neg),excl(inf))).
dictionary('TextureTransform',exposedField,'SFVec2f',translation,[0,0],
	bound(excl(inf_neg),excl(inf))).
%%%%%%%%%%%%%%%%
dictionary('TimeSensor',exposedField,'SFTime',cycleInterval,[1],
	bound(excl(0),excl(inf))).
dictionary('TimeSensor',exposedField,'SFBool',enabled,['TRUE'],[]).
dictionary('TimeSensor',exposedField,'SFBool',loop,['FALSE'],[]).
dictionary('TimeSensor',exposedField,'SFTime',startTime,[0],
	bound(excl(inf_neg),excl(inf))).
dictionary('TimeSensor',exposedField,'SFTime',stopTime,[0],
	bound(excl(inf_neg),excl(inf))).
dictionary('TimeSensor',eventOut,'SFTime',cycleTime,[],[]).
dictionary('TimeSensor',eventOut,'SFFloat',fraction_changed,[],[]).
dictionary('TimeSensor',eventOut,'SFBool',isActive,[],[]).
dictionary('TimeSensor',eventOut,'SFTime',time,[],[]).
%%%%%%%%%%%%%%%%
dictionary('TouchSensor',exposedField,'SFBool',enabled,['TRUE'],[]).
dictionary('TouchSensor',eventOut,'SFVec3f',hitNormal_changed,[],[]).
dictionary('TouchSensor',eventOut,'SFVec3f',hitPoint_changed,[],[]).
dictionary('TouchSensor',eventOut,'SFVec2f',hitTexCoord_changed,[],[]).
dictionary('TouchSensor',eventOut,'SFBool',isActive,[],[]).
dictionary('TouchSensor',eventOut,'SFBool',isOver,[],[]).
dictionary('TouchSensor',eventOut,'SFTime',touchTime,[],[]).
%%%%%%%%%%%%%%%%
dictionary('Transform',eventIn,'MFNode',addChildren,[],[]).
dictionary('Transform',eventIn,'MFNode',removeChildren,[],[]).
dictionary('Transform',exposedField,'SFVec3f',center,[0,0,0],
	bound(excl(inf_neg),excl(inf))).
dictionary('Transform',exposedField,'MFNode',children,[[]],
	[children_nodes]).
dictionary('Transform',exposedField,'SFRotation',rotation,[0,0,1,0],
	bound(incl(-1),incl(1),excl(inf_neg),excl(inf))).
dictionary('Transform',exposedField,'SFVec3f',scale,[1,1,1],
	bound(excl(0),excl(inf))).
dictionary('Transform',exposedField,'SFRotation',scaleOrientation,[0,0,1,0],
	bound(incl(-1),incl(1),excl(inf_neg),excl(inf))).
dictionary('Transform',exposedField,'SFVec3f',translation,[0,0,0],
	bound(excl(inf_neg),excl(inf))).
dictionary('Transform',field,'SFVec3f',bboxCenter,[0,0,0],
	bound(excl(inf_neg),excl(inf))).
dictionary('Transform',field,'SFVec3f',bboxSize,[-1,-1,-1],
	bound(excl(0),excl(inf))).
%%%%%%%%%%%%%%%%
dictionary('Viewpoint',eventIn,'SFBool',set_bind,[],[]).
dictionary('Viewpoint',exposedField,'SFFloat',fieldOfView,[0.785398],
	bound(excl(0),excl(pi))).
dictionary('Viewpoint',exposedField,'SFBool',jump,['TRUE'],[]).
dictionary('Viewpoint',exposedField,'SFRotation',orientation,[0,0,1,0],
	bound(incl(-1),incl(1),excl(inf_neg),excl(inf))).
dictionary('Viewpoint',exposedField,'SFVec3f',position,[0,0,10],
	bound(excl(inf_neg),excl(inf))).
dictionary('Viewpoint',field,'SFString',description,[''],[]).
dictionary('Viewpoint',eventOut,'SFTime',bindTime,[],[]).
dictionary('Viewpoint',eventOut,'SFBool',isBound,[],[]).
%%%%%%%%%%%%%%%%
dictionary('VisibilitySensor',exposedField,'SFVec3f',center,[0,0,0],
	bound(excl(inf_neg),excl(inf))).
dictionary('VisibilitySensor',exposedField,'SFBool',enabled,['TRUE'],[]).
dictionary('VisibilitySensor',exposedField,'SFVec3f',size,[0,0,0],
	bound(incl(0),excl(inf))).
dictionary('VisibilitySensor',eventOut,'SFTime',enterTime,[],[]).
dictionary('VisibilitySensor',eventOut,'SFTime',exitTime,[],[]).
dictionary('VisibilitySensor',eventOut,'SFBool',isActive,[],[]).
%%%%%%%%%%%%%%%%
dictionary('WorldInfo',field,'MFString',info,[[]],[]).
dictionary('WorldInfo',field,'SFString',title,[''],[]).


text:
goog.provide('box2d.JointNode');

/**
 @constructor
 */
box2d.JointNode = function() {
  this.other = null;
  this.joint = null;
  this.prev = null;
  this.next = null;
};


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/checkbox_selected" android:state_checked="true" />
    <item android:drawable="@drawable/checkbox_selected" android:state_selected="true" />
    <item android:drawable="@drawable/checkbox_unselected" android:state_checked="false" />
    <item android:drawable="@drawable/checkbox_unselected" android:state_selected="false" />
</selector>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Documentation</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <base href="../">
    <link rel="icon" href="images/favicon.ico"/>
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/base.css">
            <link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap" rel="stylesheet">
        <link rel="stylesheet" href="css/template.css">
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />

Documentation

    <input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />

        Search for
        <svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
            <circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
            <line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
        </svg>
        <input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />

            <input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />

    Menu

Namespaces

UnitConverter

Calculator

Exception

Registry

Support

Unit

Reports

Deprecated

Errors

Markers

Indices

Files

UnitConverter

Unit

Mass

    Interfaces, Classes and Traits

Gram

Gram data class.

Kilogram

Kilogram data class.

LongTon

Long ton (U.K.) data class. Also known as 'weight ton', or 'gross ton'.

MassUnit

Mass unit base data class. Any new mass units should
extend this class and implement their name, symbol and units;
overriding the $unitOf and $base properties only if necessary.

Milligram

Milligram data class.

Newton

Newton data class.

Ounce

Ounce data class.

Pound

Pound data class.

ShortTon

Short ton data class. Also known as 'net ton', or 'U.S. ton'

Stone

Stone data class.

Tonne

Tonne data class.

Search results

            <button class="phpdocumentor-search-results__close"></button>


text:
export default function ( component ) {
	var ancestor, query;

	// If there's a live query for this component type, add it
	ancestor = component.root;
	while ( ancestor ) {
		if ( query = ancestor._liveComponentQueries[ '_' + component.name ] ) {
			query.push( component.instance );
		}

		ancestor = ancestor._parent;
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="testConf.xsl"?>

<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

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

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

<configuration>
  <!-- Normal mode is test. To run just the commands and dump the output
       to the log, set it to nocompare -->
  <mode>test</mode>

  <!--  Comparator types:
           ExactComparator
           SubstringComparator
           RegexpComparator
           TokenComparator
           -->
  <tests>

    <test> <!--Tested -->
      <description>Testing basic usage</description>
      <test-commands>
        <cache-admin-command></cache-admin-command>
      </test-commands>
      <cleanup-commands>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>Usage: bin/hdfs cacheadmin [COMMAND]</expected-output>
        </comparator>
      </comparators>
    </test>

    <test> <!--Tested -->
      <description>Testing listing no cache pools</description>
      <test-commands>
        <cache-admin-command>-listPools</cache-admin-command>
      </test-commands>
      <cleanup-commands>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>Found 0 results.</expected-output>
        </comparator>
      </comparators>
    </test>

    <test> <!--Tested -->
      <description>Testing adding a cache pool</description>
      <test-commands>
        <cache-admin-command>-addPool foo</cache-admin-command>
      </test-commands>
      <cleanup-commands>
        <cache-admin-command>-removePool foo</cache-admin-command>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>Successfully added cache pool foo.</expected-output>
        </comparator>
      </comparators>
    </test>

    <test> <!--Tested -->
      <description>Testing modifying a cache pool</description>
      <test-commands>
        <cache-admin-command>-addPool poolparty -owner alice -group alicegroup -mode 0000 -limit 50</cache-admin-command>
        <cache-admin-command>-modifyPool poolparty -owner bob -group bobgroup -mode 0777 -limit 51</cache-admin-command>
        <cache-admin-command>-listPools</cache-admin-command>
      </test-commands>
      <cleanup-commands>
        <cache-admin-command>-removePool poolparty</cache-admin-command>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>poolparty  bob    bobgroup  rwxrwxrwx      51</expected-output>
        </comparator>
      </comparators>
    </test>

    <test> <!--Tested -->
      <description>Testing deleting a cache pool</description>
      <test-commands>
        <cache-admin-command>-addPool foo</cache-admin-command>
        <cache-admin-command>-removePool foo</cache-admin-command>
      </test-commands>
      <cleanup-commands>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>Successfully removed cache pool foo.</expected-output>
        </comparator>
      </comparators>
    </test>

    <test> <!--Tested -->
      <description>Testing listing all cache pools</description>
      <test-commands>
        <cache-admin-command>-addPool foo -owner bob -group bob -mode 0664</cache-admin-command>
        <cache-admin-command>-addPool bar -owner alice -group alicegroup -mode 0755</cache-admin-command>
        <cache-admin-command>-listPools</cache-admin-command>
      </test-commands>
      <cleanup-commands>
        <cache-admin-command>-removePool foo</cache-admin-command>
        <cache-admin-command>-removePool bar</cache-admin-command>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>Found 2 results.</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>bar   alice  alicegroup  rwxr-xr-x   unlimited</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>foo   bob    bob         rw-rw-r--   unlimited</expected-output>
        </comparator>
      </comparators>
    </test>

    <test> <!--Tested -->
      <description>Testing listing a single cache pool</description>
      <test-commands>
        <cache-admin-command>-addPool foo -owner bob -group bob -mode 0664</cache-admin-command>
        <cache-admin-command>-addPool bar -owner alice -group alicegroup -mode 0755</cache-admin-command>
        <cache-admin-command>-listPools foo</cache-admin-command>
      </test-commands>
      <cleanup-commands>
        <cache-admin-command>-removePool foo</cache-admin-command>
        <cache-admin-command>-removePool bar</cache-admin-command>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>Found 1 result.</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>foo   bob    bob    rw-rw-r--   unlimited</expected-output>
        </comparator>
      </comparators>
    </test>

    <test> <!--Tested -->
      <description>Testing creating cache paths</description>
      <test-commands>
        <cache-admin-command>-addPool pool1</cache-admin-command>
        <cache-admin-command>-addDirective -path /foo -pool pool1 -ttl 2d</cache-admin-command>
        <cache-admin-command>-addDirective -path /bar -pool pool1 -ttl 24h</cache-admin-command>
        <cache-admin-command>-addDirective -path /baz -replication 2 -pool pool1 -ttl 60m</cache-admin-command>
        <cache-admin-command>-listDirectives -pool pool1</cache-admin-command>
      </test-commands>
      <cleanup-commands>
        <cache-admin-command>-removePool pool1</cache-admin-command>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>Found 3 entries</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>  1 pool1      1</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>  2 pool1      1</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>  3 pool1      2 </expected-output>
        </comparator>
      </comparators>
    </test>

    <test> <!--Tested -->
      <description>Testing removing cache paths</description>
      <test-commands>
        <cache-admin-command>-addPool pool1</cache-admin-command>
        <cache-admin-command>-addDirective -path /foo -pool pool1</cache-admin-command>
        <cache-admin-command>-addDirective -path /bar -pool pool1</cache-admin-command>
        <cache-admin-command>-removePool pool1</cache-admin-command>
        <cache-admin-command>-listDirectives -pool pool1</cache-admin-command>
      </test-commands>
      <cleanup-commands>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>Found 0 entries</expected-output>
        </comparator>
      </comparators>
    </test>

    <test> <!--Tested -->
      <description>Testing listing directives filtered by pool</description>
      <test-commands>
        <cache-admin-command>-addPool pool1</cache-admin-command>
        <cache-admin-command>-addPool pool2</cache-admin-command>
        <cache-admin-command>-addDirective -path /foo -pool pool1</cache-admin-command>
        <cache-admin-command>-addDirective -path /bar -pool pool1</cache-admin-command>
        <cache-admin-command>-addDirective -path /baz -pool pool2</cache-admin-command>
        <cache-admin-command>-addDirective -path /buz -pool pool2</cache-admin-command>
        <cache-admin-command>-listDirectives -pool pool2</cache-admin-command>
      </test-commands>
      <cleanup-commands>
        <cache-admin-command>-removePool pool1</cache-admin-command>
        <cache-admin-command>-removePool pool2</cache-admin-command>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>Found 2 entries</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>  8 pool2      1 never   /baz </expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>  9 pool2      1 never   /buz </expected-output>
        </comparator>
      </comparators>
    </test>

    <test> <!--Tested -->
      <description>Testing listing directives filtered by path</description>
      <test-commands>
        <cache-admin-command>-addPool pool1</cache-admin-command>
        <cache-admin-command>-addPool pool2</cache-admin-command>
        <cache-admin-command>-addDirective -path /foo -pool pool1</cache-admin-command>
        <cache-admin-command>-addDirective -path /bar -pool pool1</cache-admin-command>
        <cache-admin-command>-addDirective -path /foo -pool pool2</cache-admin-command>
        <cache-admin-command>-addDirective -path /bar -pool pool2</cache-admin-command>
        <cache-admin-command>-listDirectives -path /foo</cache-admin-command>
      </test-commands>
      <cleanup-commands>
        <cache-admin-command>-removePool pool1</cache-admin-command>
        <cache-admin-command>-removePool pool2</cache-admin-command>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>Found 2 entries</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output> 10 pool1      1 never   /foo </expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output> 12 pool2      1 never   /foo </expected-output>
        </comparator>
      </comparators>
    </test>

    <test> <!--Tested -->
      <description>Testing listing directives filtered by path and pool</description>
      <test-commands>
        <cache-admin-command>-addPool pool1</cache-admin-command>
        <cache-admin-command>-addPool pool2</cache-admin-command>
        <cache-admin-command>-addDirective -path /foo -pool pool1</cache-admin-command>
        <cache-admin-command>-addDirective -path /bar -pool pool1</cache-admin-command>
        <cache-admin-command>-addDirective -path /foo -pool pool2</cache-admin-command>
        <cache-admin-command>-addDirective -path /bar -pool pool2</cache-admin-command>
        <cache-admin-command>-listDirectives -path /foo -pool pool2</cache-admin-command>
      </test-commands>
      <cleanup-commands>
        <cache-admin-command>-removePool pool1</cache-admin-command>
        <cache-admin-command>-removePool pool2</cache-admin-command>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>Found 1 entry</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output> 16 pool2      1 never   /foo </expected-output>
        </comparator>
      </comparators>
    </test>

    <test> <!--Tested -->
      <description>Testing removing a directive</description>
      <test-commands>
        <cache-admin-command>-addPool pool1</cache-admin-command>
        <cache-admin-command>-addDirective -path /foo -pool pool1</cache-admin-command>
        <cache-admin-command>-addDirective -path /bar -pool pool1</cache-admin-command>
        <cache-admin-command>-removeDirective 18</cache-admin-command>
        <cache-admin-command>-listDirectives</cache-admin-command>
      </test-commands>
      <cleanup-commands>
        <cache-admin-command>-removePool pool1</cache-admin-command>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>Found 1 entry</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output> 19 pool1      1 never   /bar </expected-output>
        </comparator>
      </comparators>
    </test>

    <test> <!--Tested -->
      <description>Testing removing every directive for a path</description>
      <test-commands>
        <cache-admin-command>-addPool pool1</cache-admin-command>
        <cache-admin-command>-addPool pool2</cache-admin-command>
        <cache-admin-command>-addDirective -path /foo -pool pool1</cache-admin-command>
        <cache-admin-command>-addDirective -path /foo -pool pool1</cache-admin-command>
        <cache-admin-command>-addDirective -path /bar -pool pool1</cache-admin-command>
        <cache-admin-command>-addDirective -path /foo -pool pool2</cache-admin-command>
        <cache-admin-command>-addDirective -path /bar -pool pool2</cache-admin-command>
        <cache-admin-command>-removeDirectives -path ../../foo</cache-admin-command>
        <cache-admin-command>-listDirectives</cache-admin-command>
      </test-commands>
      <cleanup-commands>
        <cache-admin-command>-removePool pool1</cache-admin-command>
        <cache-admin-command>-removePool pool2</cache-admin-command>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>Found 2 entries</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output> 22 pool1      1 never   /bar </expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output> 24 pool2      1 never   /bar </expected-output>
        </comparator>
      </comparators>
    </test>

    <test> <!--Tested -->
      <description>Testing modifying directives</description>
      <test-commands>
        <cache-admin-command>-addPool pool1</cache-admin-command>
        <cache-admin-command>-addPool pool2</cache-admin-command>
        <cache-admin-command>-addDirective -path /foo -pool pool2</cache-admin-command>
        <cache-admin-command>-modifyDirective -id 25 -path /bar2</cache-admin-command>
        <cache-admin-command>-modifyDirective -id 25 -pool pool1 -path /bar3</cache-admin-command>
        <cache-admin-command>-listDirectives -path /bar3</cache-admin-command>
      </test-commands>
      <cleanup-commands>
        <cache-admin-command>-removePool pool1</cache-admin-command>
        <cache-admin-command>-removePool pool2</cache-admin-command>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>Found 1 entry</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output> 25 pool1      1 never   /bar3 </expected-output>
        </comparator>
      </comparators>
    </test>

    <test>
      <description>Testing the help usage</description>
      <test-commands>
        <cache-admin-command>-help addPool</cache-admin-command>
      </test-commands>
      <cleanup-commands>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>Add a new cache pool.</expected-output>
        </comparator>
      </comparators>
    </test>

    <test> <!--Tested -->
      <description>Testing listing cache pool statistics</description>
      <test-commands>
        <cache-admin-command>-addPool foo -owner bob -group bob -mode 0664</cache-admin-command>
        <cache-admin-command>-addPool bar -owner alice -group alicegroup -mode 0755</cache-admin-command>
        <cache-admin-command>-listPools -stats</cache-admin-command>
      </test-commands>
      <cleanup-commands>
        <cache-admin-command>-removePool foo</cache-admin-command>
        <cache-admin-command>-removePool bar</cache-admin-command>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>Found 2 results.</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>bar   alice  alicegroup  rwxr-xr-x   unlimited   never             0             0                0             0             0</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>foo   bob    bob         rw-rw-r--   unlimited   never             0             0                0             0             0</expected-output>
        </comparator>
      </comparators>
    </test>

    <test> <!--Tested -->
      <description>Testing listing cache directive statistics</description>
      <test-commands>
        <cache-admin-command>-addPool pool1</cache-admin-command>
        <cache-admin-command>-addDirective -path /foo -pool pool1 -ttl 2d</cache-admin-command>
        <cache-admin-command>-addDirective -path /bar -pool pool1 -ttl 24h</cache-admin-command>
        <cache-admin-command>-addDirective -path /baz -replication 2 -pool pool1 -ttl 60m</cache-admin-command>
        <cache-admin-command>-listDirectives -pool pool1 -stats</cache-admin-command>
      </test-commands>
      <cleanup-commands>
        <cache-admin-command>-removePool pool1</cache-admin-command>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>Found 3 entries</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>/foo              0             0             0             0</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>/bar              0             0             0             0</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>/baz              0             0             0             0</expected-output>
        </comparator>
      </comparators>
    </test>

    <test> <!--Tested -->
      <description>Testing pool max ttl settings</description>
      <test-commands>
        <cache-admin-command>-addPool pool1 -owner andrew -group andrew</cache-admin-command>
        <cache-admin-command>-addPool pool2 -owner andrew -group andrew -maxTtl 999d</cache-admin-command>
        <cache-admin-command>-modifyPool pool2 -maxTtl never</cache-admin-command>
        <cache-admin-command>-addPool pool3 -owner andrew -group andrew -maxTtl 4h</cache-admin-command>
        <cache-admin-command>-listPools</cache-admin-command>
      </test-commands>
      <cleanup-commands>
        <cache-admin-command>-removePool pool1</cache-admin-command>
        <cache-admin-command>-removePool pool2</cache-admin-command>
        <cache-admin-command>-removePool pool3</cache-admin-command>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>Found 3 results</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>pool1  andrew  andrew  rwxr-xr-x   unlimited             never</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>pool2  andrew  andrew  rwxr-xr-x   unlimited             never</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>pool3  andrew  andrew  rwxr-xr-x   unlimited  000:04:00:00.000</expected-output>
        </comparator>
      </comparators>
    </test>

    <test> <!--Tested -->
      <description>Testing setting pool unlimited limits</description>
      <test-commands>
        <cache-admin-command>-addPool pool1 -limit unlimited -owner andrew -group andrew</cache-admin-command>
        <cache-admin-command>-addPool pool2 -limit 10 -owner andrew -group andrew</cache-admin-command>
        <cache-admin-command>-modifyPool pool2 -limit unlimited</cache-admin-command>
        <cache-admin-command>-listPools</cache-admin-command>
      </test-commands>
      <cleanup-commands>
        <cache-admin-command>-removePool pool1</cache-admin-command>
        <cache-admin-command>-removePool pool2</cache-admin-command>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>Found 2 results</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>pool1  andrew  andrew  rwxr-xr-x   unlimited   never</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>pool2  andrew  andrew  rwxr-xr-x   unlimited   never</expected-output>
        </comparator>
      </comparators>
    </test>

    <test> <!--Tested -->
      <description>Testing listing a single cache directive</description>
      <test-commands>
        <cache-admin-command>-addPool pool1</cache-admin-command>
        <cache-admin-command>-addDirective -path /foo -pool pool1 -ttl 2d</cache-admin-command>
        <cache-admin-command>-addDirective -path /bar -pool pool1 -ttl 24h</cache-admin-command>
        <cache-admin-command>-addDirective -path /baz -replication 2 -pool pool1 -ttl 60m</cache-admin-command>
        <cache-admin-command>-listDirectives -stats -id 30</cache-admin-command>
      </test-commands>
      <cleanup-commands>
        <cache-admin-command>-removePool pool1</cache-admin-command>
      </cleanup-commands>
      <comparators>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>Found 1 entry</expected-output>
        </comparator>
        <comparator>
          <type>SubstringComparator</type>
          <expected-output>30 pool1      1</expected-output>
        </comparator>
      </comparators>
    </test>
  </tests>
</configuration>


text:
package appeng.api.implementations.parts;

import appeng.api.networking.IGridHost;
import appeng.api.parts.BusSupport;
import appeng.api.parts.IPart;
import appeng.api.parts.IPartHost;
import appeng.api.util.AECableType;
import appeng.api.util.AEColor;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.common.util.ForgeDirection;

import java.util.EnumSet;

/**
 * Implemented on the {@link IPart}s cable objects that can be placed at {@link ForgeDirection}.UNKNOWN in
 * {@link IPartHost}s
 */
public interface IPartCable extends IPart, IGridHost
{

	/**
	 * does this cable support buses?
	 */
	BusSupport supportsBuses();

	/**
	 * @return the current color of the cable.
	 */
	AEColor getCableColor();

	/**
	 * @return the Cable type.
	 */
	AECableType getCableConnectionType();

	/**
	 * Change the color of the cable, this should cost a small amount of dye, or something.
	 *
	 * @param newColor new color
	 * @return if the color change was successful.
	 */
	boolean changeColor(AEColor newColor, EntityPlayer who);

	/**
	 * Change sides on the cables node.
	 *
	 * Called by AE, do not invoke.
	 *
	 * @param sides sides of cable
	 */
	void setValidSides(EnumSet<ForgeDirection> sides);

	/**
	 * used to tests if a cable connects to neighbors visually.
	 *
	 * @param side neighbor side
	 * @return true if this side is currently connects to an external block.
	 */
	boolean isConnected(ForgeDirection side);

}


text:
import sys
from struct import Struct, calcsize

IS_LITTLE = sys.byteorder == "little"

_INT_SIZE = calcsize("!i")
_SHORT_SIZE = calcsize("!H")
_LONG_SIZE = calcsize("!Q")
_FLOAT_SIZE = calcsize("!f")
_DOUBLE_SIZE = calcsize("!d")

_byte_struct = Struct("!B")
_sbyte_struct = Struct("!b")
_ushort_struct = Struct("!H")
_int_struct = Struct("!i")
_uint_struct = Struct("!I")
_long_struct = Struct("!q")
_ulong_struct = Struct("!Q")
_float_struct = Struct("!f")
_double_struct = Struct("!d")
_ushort_le_struct = Struct("<H")
_uint_le_struct = Struct("<I")

pack_byte = _byte_struct.pack
pack_sbyte = _sbyte_struct.pack
pack_ushort = _ushort_struct.pack
pack_int = _int_struct.pack
pack_uint = _uint_struct.pack
pack_long = _long_struct.pack
pack_ulong = _ulong_struct.pack
pack_float = _float_struct.pack
pack_double = _double_struct.pack
pack_ushort_le = _ushort_le_struct.pack
pack_uint_le = _uint_le_struct.pack

unpack_byte = _byte_struct.unpack  # ord() might be faster
unpack_sbyte = _sbyte_struct.unpack
unpack_ushort = _ushort_struct.unpack
unpack_int = _int_struct.unpack
unpack_uint = _uint_struct.unpack
unpack_long = _long_struct.unpack
unpack_ulong = _ulong_struct.unpack
unpack_float = _float_struct.unpack
unpack_double = _double_struct.unpack
unpack_ushort_le = _ushort_le_struct.unpack
unpack_uint_le = _uint_le_struct.unpack

if sys.version_info[0] < 3:
    emptybytes = ""
else:
    emptybytes = "".encode("latin-1")


text:
define([
       'jquery',
       'underscore',
       'backbone',
       'models/webRTCSession',
], function($, _, Backbone, WebRTCSession){
  var CallView = Backbone.View.extend({
    el: $('#caller'),
    events: {
      "click .call" : 'startCall'
    },
    initialize: function(){
      var self= this;
      this.dispatcher = this.options.dispatcher;
      console.log(this.dispatcher);
    },
    startCall: function(id){
      var self = this;
      var number = '2155544944';
      this.model = new WebRTCSession({voiceOnly: true});
      // map the dispatcher inbound signaling for this webrtc session
      this.dispatcher.on('rtc_server_message', function(data){
                          self.model.onSignalingMessage(data)});
      // give the session a method for communicating to the server
      this.model.emitSignalingMessage = (function(data){
        self.dispatcher.trigger('rtc_client_message',data);});
      this.model.bind('change:state', function(model){
        self.renderState(model);
      });
      //bind to the remoteStreamAdded event so you can render the video or audio
      this.model.bind('remoteStreamAdded', function(model){
        self.renderRemoteStream(model);
      }, this);
      this.model.bind('localStreamAdded', function(model){
        self.renderLocalStream(model);
      }, this);
      //Wait for the model to be ready
      this.model.bind('ready', function(){
        console.log('session ready. calling');
        //if we were doing a video call we could use localStream to bind to a video
        //tag now, but this is a voice only call
        self.model.call({number:number});
      });
      //catch any webrtc related errors
      this.model.bind('error', function(error){
        console.log('ERROR!!!! something went wrong with the webrtc session' + error);
      });
    },
    renderState: function(model){
      var self = this;
      var state = this.model.get('state');
      if(state === 'waiting'){
        $("#callform").hide();
        $("#statusarea").animate({opacity:0},600, function(){
          $("#statusarea").html("
Calling " + self.model.get('currentTarget') + "
");
          $("#statusarea").animate({opacity:1},300);
        });
      }
      else if(state === 'connected'){
        $("#statusarea").animate({opacity:0},600, function(){
          $("#statusarea").html("
Voice Only Call with " + self.model.get('currentTarget')+ "
");
          $("#statusarea").animate({opacity:1},300);
        });
      }else if(state === 'disconnected'){
        $("#statusarea").animate({opacity: 1},600, function(){
          $("#statusarea").html("
type in a phone number to start
");
          $("#callform").show();
          $("#statusarea").show();
        });
        this.model = undefined;
      }
    },
    renderRemoteStream: function(){
      var audioElement = document.createElement('audio');
      audioElement.setAttribute('autoplay', 'autoplay');
      this.$el.append(audioElement);
      this.model.attachMediaStream(audioElement, this.model.get('remoteStream'));
      console.log('added remote stream');
      console.log(this.model.toJSON());
    },
    renderLocalStream: function(){
      var audioElement = document.createElement('audio');
      audioElement.setAttribute('autoplay', 'autoplay');
      this.$el.append(audioElement);
      this.model.attachMediaStream(audioElement, this.model.get('localStream'));
      console.log('added local stream');
      console.log(this.model.toJSON());
    }
  });
  return CallView;
});


text:
"use strict";
/*global $:false */

// http://stackoverflow.com/a/210733/2397542 - jQuery center function from Tony L.
jQuery.fn.center = function () {
    this.css("position", "fixed");

    this.css("top", Math.max(0, (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop()) + "px");
    this.css("left", Math.max(0, (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft()) + "px");

    return this;
};

var WMcycler = {

    KEYCODE_ESCAPE: 27,
    KEYCODE_LEFT: 37,
    KEYCODE_RIGHT: 39,
    KEYCODE_SPACE: 32,

    period: 0,
    fullscreen: 0,
    poller_cycle: 0,
    current: 0,
    countdown: 0,
    nmaps: 0,
    paused: false,
    timer_counter: null,
    timer_reloader: null,

    updateProgress: function () {
        // update the countdown bar - 450 is the max width in pixels
        var progress = this.countdown / (this.period / 200) * 450;
        $("#wm_progress").css("width", progress);
    },

    counterHandler: function () {
        if (this.paused) {
            $("#wm_progress").toggleClass("paused");
        } else {
            this.updateProgress();
            this.countdown--;

            if (this.countdown < 0) {
                this.switchMap(1);
            }
        }
    },
    forceReload: function (that) {
        var d = new Date(),
            newurl = $(that).find('img').attr("src");

        if (newurl !== undefined) {
            newurl = newurl.replace(/time=\d+/, "time=" + d.getTime());
            $(that).find('img').attr("src", newurl);
        }
    },

    // change to the next (or previous) map, reset the countdown, update the bar
    switchMap: function (direction) {
        var wm_new = this.current + direction;

        if (wm_new < 0) {
            wm_new += this.nmaps;
        }
        wm_new = wm_new % this.nmaps;

        var now = $(".weathermapholder").eq(this.current),
            next = $(".weathermapholder").eq(wm_new);

        if (this.fullscreen) {
            // in fullscreen, we centre everything, layer it with z-index and
            // cross-fade
            next.center();
            now.css("z-index", 2);
            next.css("z-index", 3);

            now.fadeOut(1200, function () {
                // now that we're done with it, force a reload on the image just
                // passed
                WMcycler.forceReload(this);
            });
            next.fadeIn(1200);
        } else {
            // in non-fullscreen mode, the fades just make things look strange.
            // Snap-changes
            now.hide(1, function () {
                // now that we're done with it, force a reload on the image just
                // passed
                // WMcycler.forceReload();
            });
            next.show(1);
        }

        this.countdown = this.period / 200;
        this.current = wm_new;

        $("#wm_current_map").text(this.current + 1);
        this.updateProgress();
    },

    hideControls: function () {
        $("#wmcyclecontrolbox").fadeOut(500);
    },

    showControls: function () {
        $("#wmcyclecontrolbox").fadeIn(100);
    },

    start: function (initialData) {
        $('.weathermapholder').hide();

        this.period = initialData.period;
        this.poller_cycle = initialData.poller_cycle;
        this.fullscreen = initialData.fullscreen;

        this.nmaps = $(".weathermapholder").length;
        $("#wm_total_map").text(this.nmaps);

        // copy of this that we can pass into callbacks
        var that = this;

        this.initEvents(that);
        this.initKeys(that);

        // stop here if there were no maps
        if (this.nmaps > 0) {
            this.current = 0;

            this.switchMap(0);

            // figure out how long the refresh is, so that we get
            // through all the maps in exactly one poller cycle
            if (this.period === 0) {
                this.period = this.poller_cycle / this.nmaps;
            }
            this.countdown = this.period / 200;

            // a countdown timer in the top corner
            this.timer_counter = setInterval(function () {
                that.counterHandler();
            }, 200);

            // when to reload the whole page (with new map data)
            this.timer_reloader = setTimeout(function () {
                that.reloadPage();
            }, this.poller_cycle);

            this.initIdle(that);
        }
    },

    reloadPage: function () {
        location.reload(true);
    },

    initKeys: function (that) {
        $(document).keyup(function (event) {
            if (event.keyCode === that.KEYCODE_ESCAPE) {
                window.location.href = $('#cycle_stop').attr('href');
                event.preventDefault();
            }

            if (event.keyCode === that.KEYCODE_SPACE) {
                that.pauseAction();
                event.preventDefault();
            }
            // left
            if (event.keyCode === that.KEYCODE_LEFT) {
                that.previousAction();
                event.preventDefault();
            }
            // right
            if (event.keyCode === that.KEYCODE_RIGHT) {
                that.nextAction();
                event.preventDefault();
            }
        });
    },

    initEvents: function (that) {

        $("#cycle_pause").click(function () {
            that.pauseAction();
        });
        $("#cycle_next").click(function () {
            that.nextAction();
        });
        $("#cycle_prev").click(function () {
            that.previousAction();
        });
    },

    initIdle: function (that) {
        // aim to get a video-player style OSD for fullscreen mode:
        // if the pointer is off the controls for more than 5 seconds, fade the
        // controls away
        // if the pointer moves after that, bring the controls back
        // if the pointer is over the controls, don't fade
        if (this.fullscreen) {

            $(document).idleTimer({
                timeout: 5000
            });

            $(document).on("idle.idleTimer", function () {
                that.hideControls();
            });
            $(document).on("active.idleTimer", function () {
                that.showControls();
            });

        }
    },

    nextAction: function () {
        this.switchMap(1);
    },
    previousAction: function () {
        this.switchMap(-1);
    },
    pauseAction: function () {
        this.paused = !this.paused;
        // remove the paused class on the progress bar, if we're mid-flash and
        // no longer paused
        if (!this.paused) {
            $("#wm_progress").removeClass("paused");
        }
    }
};