text:
    <title>Passport</title>
    <? include "personalCode.php";
	     trackerGA(); ?>
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link href="/passport/css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection" />
    <link href="/passport/css/passr.css" type="text/css" rel="stylesheet" media="screen,projection" />
    <link href="/passport/css/animate.css" type="text/css" rel="stylesheet" media="screen,projection" />

    <meta name="theme-color" content="#D32F2F">

    <meta name="msapplication-navbutton-color" content="#D32F2F">

    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

  <? date_default_timezone_set('America/Chicago'); ?>

    <? include "sqlconnect.php"; ?>
    <?
    if ($closePassRequestOnDaysToggle == 1) {
        if(date("l") == "Sunday" OR date("l") == "Saturday") {
            $overlayClosedReasonH1 = "Pass Requests are closed on the weekends.";
            $closedFormAction = "";
            $blurClass = "blur-g";
            echo "";
        } else {
            $closedFormAction = "/passport/submit.php";
        }
      } else {
        $closedFormAction = "/passport/submit.php";
      }
 include "versionInfo.php";
    ?>

<? echo $overlayClosedReasonH1; ?>

    <div id="blurg" class="<? echo $blurClass; ?>">

            Passport
            <?echo $CurrentVersionOfPassport;?>

            assignment

report_problem

thumbs_up_down

live_help

info

Bug report

            <form class="col s12" method="post" action="">

 account_circle
                        <input id="bugname" name="bugname" required type="text" class="validate">
                        Name

 email
                        <input id="bugemail" name="bugemail" required type="email" class="validate">
                        Email

 comment
                        <textarea id="bugtext" name="bugtext" required class="materialize-textarea" length="255"></textarea>
                        Describe the bug or issue

Bug Severity Slider

1 being low priority and 5 being high priority

                            <input type="range" id="bugseverity" name="bugseverity" min="1" max="5" value="3" />

                    <button class="btn waves-effect waves-light modal-action modal-close" type="submit" name="submitbug">Submit Bug Report
                        send
                    </button>

            </form>

    <?

    //bug report submit code

    if(isset($_POST['submitbug'])){

        foreach ($_POST as $key => $value) {

    }
    {

        $bugname = $_POST['bugname'];
        $bugemail = $_POST['bugemail'];
        $bugseverity = $_POST['bugseverity'];
        $bugdate = date( 'Y-m-d', strtotime(" today "));
        $bugtext = htmlspecialchars($_POST['bugtext'],ENT_QUOTES);
        $bugReportType = "bug";
        $bugRole = "student";
        $bugVersion = $CurrentVersionOfPassport;
    }

        $sqlbug = $conn->prepare("INSERT INTO feedback (name, email, comment, rating, report_type, `date`, role, forVersion)
        VALUES (?, ?, ?, ?, ?, ?, ?, ?)");

        $sqlbug->bind_param("sssissss", $bugname, $bugemail, $bugtext, $bugseverity, $bugReportType, $bugdate, $bugRole, $bugVersion);
        if ($sqlbug->execute()) {
          echo "";
        } else {
          echo "";
        }
        $sqlbug->close();

    }

    ?>

Reminder

A review should include helpful information. Reviews that are bias and/or spam will be ignored.

      I Agree

Leave a review

            <form class="col s12" method="post" action="">

 account_circle
                        <input id="reviewname" name="reviewname" required type="text" class="validate">
                        Name

 email
                        <input id="reviewemail" name="reviewemail" required type="email" class="validate">
                        Email

 comment
                        <textarea id="reviewtext" name="reviewtext" class="materialize-textarea" length="255"></textarea>
                        Comment

Rating Slider

                            <input type="range" id="rating" name="rating" min="1" max="10" value="5" />

                    <button class="btn waves-effect waves-light modal-action modal-close" type="submit" name="submitreview">Submit Review
                        send
                    </button>

            </form>

    <?

    //bug report submit code

    if(isset($_POST['submitreview'])){

        foreach ($_POST as $key => $value) {

    }
    {

        $reviewname = $_POST['reviewname'];
        $reviewemail = $_POST['reviewemail'];
        $reviewtext = htmlspecialchars($_POST['reviewtext'],ENT_QUOTES);
        $reviewseverity = $_POST['rating'];
        $reviewdate = date( 'Y-m-d', strtotime(" today "));
        $reviewReportType = "review";
        $reviewRole = "student";
        $reviewVersion = $CurrentVersionOfPassport;
    }

        $sqlbug = $conn->prepare("INSERT INTO feedback (name, email, comment, rating, report_type, `date`, role, forVersion)
        VALUES (?, ?, ?, ?, ?, ?, ?, ?)");

        $sqlbug->bind_param("sssissss", $reviewname, $reviewemail, $reviewtext, $reviewseverity, $reviewReportType, $reviewdate, $reviewRole, $reviewVersion);
        if ($sqlbug->execute()) {
          echo "";
        } else {
          echo "";
        }
        $sqlbug->close();
    }

    ?>

      <? include "function.php"; ?>

        <? allStudentMess(); ?>

        <form method="post" action=" <? echo $closedFormAction; ?> ">

Executive Functioning

Math

Library

Help Desk

Writing Lab

Foreign Language

Athletic Mentor

                                <? LECout(); ?>

                                    <? LECmess(); ?>

                                        <input class="with-gap" type="radio" name="place" value="lec" required id="lecConfirm" />
                                        Confirm Executive Functioning

                                        <? reasonSel('LEC'); ?>

                                <? MATHout(); ?>

                                    <? MATHmess(); ?>

                                        <input class="with-gap" type="radio" name="place" value="math" id="mathConfirm" />
                                        Confirm Math

                                        <? reasonSel('Math Department'); ?>

                                <? LIBout(); ?>

                                    <? LIBmess(); ?>

                                        <input class="with-gap" type="radio" name="place" value="library" id="libConfirm" />
                                        Confirm Library

                                        <? reasonSel('Library'); ?>

                                <? HDout(); ?>

                                    <? HDmess(); ?>

                                        <input class="with-gap" type="radio" name="place" value="hd" id="HDConfirm" />
                                        Confirm Help Desk

                                        <? reasonSel('Help Desk'); ?>

                                <? WLout(); ?>

                                    <? WLmess(); ?>

                                        <input class="with-gap" type="radio" name="place" value="Writing Lab" id="WLConfirm" />
                                        Confirm Writing Lab

                                        <? reasonSel('Writing Lab'); ?>

                                <? FLout(); ?>

                                    <? FLmess(); ?>

                                        <input class="with-gap" type="radio" name="place" value="Foreign Language" id="FLConfirm" />
                                        Confirm Foreign Language

                                        <? reasonSel('Foreign Language'); ?>

                                <? AMout(); ?>

                                    <? AMmess(); ?>

                                        <input class="with-gap" type="radio" name="place" value="Athletic Mentor" id="AMConfirm" />
                                        Confirm Athletic Mentor

                                        <? reasonSel('Athletic Mentor'); ?>

                                <input id="first_name" name="first_name" type="text" required class="validate">
                                First Name

                                <input id="last_name" name="last_name" type="text" required class="validate">
                                Last Name

                                <input id="email" name="email" type="email" required class="validate">
                                Email

                                <input id="student_id" name="student_id" type="text" required class="validate">
                                Student ID

Pick the day that you are coming.

                                        <input type="radio" id="monday" onclick="incBlur('day')" name="day" on required value="<? echo date( 'Y-m-d', strtotime("monday this week")); ?>">
                                        Monday
                                        &nbsp &nbsp
                                        <input type="radio" id="tuesday" onclick="incBlur('day')" name="day" value="<? echo date( 'Y-m-d', strtotime(" tuesday this week ")); ?>">
                                        Tuesday
                                        &nbsp &nbsp
                                        <input type="radio" id="wednesday" onclick="incBlur('day')" name="day" value="<? echo date( 'Y-m-d', strtotime(" wednesday this week ")); ?>">
                                        Wednesday
                                        &nbsp &nbsp
                                        <input type="radio" id="thursday" onclick="incBlur('day')" name="day" value="<? echo date( 'Y-m-d', strtotime(" thursday this week ")); ?>">
                                        Thursday
                                        &nbsp &nbsp
                                        <input type="radio" id="friday" onclick="incBlur('day')" name="day" value="<? echo date( 'Y-m-d', strtotime(" friday this week ")); ?>">
                                        Friday

A Period

B Period

C Period

D Period

E Period

F Period

G Period

H Period

                                    <select name="shTeacherA" class="browser-default" onchange="perTabBundCheck('shTeacher')">
                                        <option selected value="">Choose Your Teacher</option>

                                        <?

                                    $sql="SELECT name_title,firstname,lastname,email FROM teachers WHERE period='a' ORDER BY lastname";
                                    $result = $conn->query($sql);

                                    if ($result->num_rows > 0) {
                                        // output data of each row
                                        while($row = $result->fetch_assoc()) {

                                            echo '<option value="'. $row['email'] . '">' .$row['name_title'] . ' ' . $row['firstname'] . ' ' . $row['lastname'] . "</option>";
                                        }

                                    } else {

                                    }
                                ?>
                                    </select>
                                    <input class="with-gap" type="radio" onclick="perTabBundCheck('confirm')" name="perTab" value="a" required id="aConfirm" />
                                    Confirm Study Hall and Period

                                    <select name="shTeacherB" class="browser-default" onchange="perTabBundCheck('shTeacher')">
                                        <option selected disabled value="">Choose Your Teacher</option>

                                        <?

                                    $sql="SELECT name_title,firstname,lastname,email FROM teachers WHERE period='b' ORDER BY lastname";
                                    $result = $conn->query($sql);

                                    if ($result->num_rows > 0) {
                                        // output data of each row
                                        while($row = $result->fetch_assoc()) {

                                            echo '<option value="'. $row['email'] . '">' .$row['name_title'] . ' ' . $row['firstname'] . ' ' . $row['lastname'] . "</option>";
                                        }

                                    } else {

                                    }
                                ?>
                                    </select>

                                    <input class="with-gap" type="radio" onclick="perTabBundCheck('confirm')" name="perTab" value="b" id="bConfirm" />
                                    Confirm Study Hall and Period

                                    <select name="shTeacherC" class="browser-default" onchange="perTabBundCheck('shTeacher')">
                                        <option selected disabled value="">Choose Your Teacher</option>

                                        <?

                                    $sql="SELECT name_title,firstname,lastname,email FROM teachers WHERE period='c' ORDER BY lastname";
                                    $result = $conn->query($sql);

                                    if ($result->num_rows > 0) {
                                        // output data of each row
                                        while($row = $result->fetch_assoc()) {

                                            echo '<option value="'. $row['email'] . '">' .$row['name_title'] . ' ' . $row['firstname'] . ' ' . $row['lastname'] . "</option>";
                                        }

                                    } else {

                                    }
                                ?>
                                    </select>

                                    <input class="with-gap" type="radio" onclick="perTabBundCheck('confirm')" name="perTab" value="c" id="cConfirm" />
                                    Confirm Study Hall and Period

                                    <select name="shTeacherD" class="browser-default" onchange="perTabBundCheck('shTeacher')">
                                        <option selected disabled value="">Choose Your Teacher</option>

                                        <?

                                    $sql="SELECT name_title,firstname,lastname,email FROM teachers WHERE period='d' ORDER BY lastname";
                                    $result = $conn->query($sql);

                                    if ($result->num_rows > 0) {
                                        // output data of each row
                                        while($row = $result->fetch_assoc()) {

                                            echo '<option value="'. $row['email'] . '">' .$row['name_title'] . ' ' . $row['firstname'] . ' ' . $row['lastname'] . "</option>";
                                        }

                                    } else {

                                    }
                                ?>
                                    </select>
                                    <input class="with-gap" type="radio" onclick="perTabBundCheck('confirm')" name="perTab" value="d" id="dConfirm" />
                                    Confirm Study Hall and Period

                                    <select name="shTeacherE" class="browser-default" onchange="perTabBundCheck('shTeacher')">
                                        <option selected disabled value="">Choose Your Teacher</option>

                                        <?

                                    $sql="SELECT name_title,firstname,lastname,email FROM teachers WHERE period='e' ORDER BY lastname";
                                    $result = $conn->query($sql);

                                    if ($result->num_rows > 0) {
                                        // output data of each row
                                        while($row = $result->fetch_assoc()) {

                                            echo '<option value="'. $row['email'] . '">' .$row['name_title'] . ' ' . $row['firstname'] . ' ' . $row['lastname'] . "</option>";
                                        }

                                    } else {

                                    }
                                ?>
                                    </select>
                                    <input class="with-gap" type="radio" onclick="perTabBundCheck('confirm')" name="perTab" value="eL1" id="eL1Confirm" />
                                    Confirm E Period (First Lunch)
                                    <input class="with-gap" type="radio" onclick="perTabBundCheck('confirm')" name="perTab" value="eL2" id="eL2Confirm" />
                                    Confirm E Period (Second Lunch)

                                    <select name="shTeacherF" class="browser-default" onchange="perTabBundCheck('shTeacher')">
                                        <option selected disabled value="">Choose Your Teacher</option>

                                        <?

                                    $sql="SELECT name_title,firstname,lastname,email FROM teachers WHERE period='f' ORDER BY lastname";
                                    $result = $conn->query($sql);

                                    if ($result->num_rows > 0) {
                                        // output data of each row
                                        while($row = $result->fetch_assoc()) {

                                            echo '<option value="'. $row['email'] . '">' .$row['name_title'] . ' ' . $row['firstname'] . ' ' . $row['lastname'] . "</option>";
                                        }

                                    } else {
                                    }
                                ?>
                                    </select>
                                    <input class="with-gap" type="radio" onclick="perTabBundCheck('confirm')" name="perTab" value="f" id="fConfirm" />
                                    Confirm Study Hall and Period

                                    <select name="shTeacherG" class="browser-default" onchange="perTabBundCheck('shTeacher')">
                                        <option selected disabled value="">Choose Your Teacher</option>

                                        <?

                                    $sql="SELECT name_title,firstname,lastname,email FROM teachers WHERE period='g' ORDER BY lastname";
                                    $result = $conn->query($sql);

                                    if ($result->num_rows > 0) {
                                        // output data of each row
                                        while($row = $result->fetch_assoc()) {

                                            echo '<option value="'. $row['email'] . '">' .$row['name_title'] . ' ' . $row['firstname'] . ' ' . $row['lastname'] . "</option>";
                                        }

                                    } else {
                                    }
                                ?>
                                    </select>
                                    <input class="with-gap" type="radio" onclick="perTabBundCheck('confirm')" name="perTab" value="g" id="gConfirm" />
                                    Confirm Study Hall and Period

                                    <select name="shTeacherH" class="browser-default" onchange="perTabBundCheck('shTeacher')">
                                        <option selected disabled value="">Choose Your Teacher</option>

                                        <?

                                    $sql="SELECT name_title,firstname,lastname,email FROM teachers WHERE period='h' ORDER BY lastname";
                                    $result = $conn->query($sql);

                                    if ($result->num_rows > 0) {
                                        // output data of each row
                                        while($row = $result->fetch_assoc()) {

                                            echo '<option value="'. $row['email'] . '">' .$row['name_title'] . ' ' . $row['firstname'] . ' ' . $row['lastname'] . "</option>";
                                        }

                                    } else {
                                    }
                                ?>
                                    </select>
                                    <input class="with-gap" type="radio" onclick="perTabBundCheck('confirm')" name="perTab" value="h" id="hConfirm" />
                                    Confirm Study Hall and Period

                <button id="finPassSubmitThang" class="btn waves-effect waves-light tooltipped blur-sect" data-position="top" data-delay="50" data-tooltip="You CANNOT cancel this pass.  You are required to come. " type="submit" name="submit">Request a pass
                    send
                </button>

                <input type="checkbox" id="rememberMe" checked="checked" disabled="disabled" />
                Remember Me (COMING VERY SOON)

        </form>

                    Copyright © 2016 Joseph Hassell &nbsp &nbsp
                    License  &nbsp &nbsp
                    Project Page &nbsp &nbsp&nbsp &nbsp


text:
package io.burt.jmespath.parser;

import java.util.List;
import java.util.ArrayList;
import java.util.Arrays;

import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.tree.ParseTree;

import io.burt.jmespath.Expression;
import io.burt.jmespath.Adapter;
import io.burt.jmespath.function.Function;
import io.burt.jmespath.function.ArgumentConstraint;
import io.burt.jmespath.function.ArityException;
import io.burt.jmespath.util.StringEscapeHelper;
import io.burt.jmespath.util.AntlrHelper;
import io.burt.jmespath.node.NodeFactory;
import io.burt.jmespath.node.Node;
import io.burt.jmespath.node.CreateObjectNode.Entry;
import io.burt.jmespath.node.Operator;

public class ExpressionParser<T> extends JmesPathBaseVisitor<Node<T>> {
  private static final StringEscapeHelper identifierEscapeHelper = new StringEscapeHelper(
    true,
    '"', '"',
    '/', '/',
    '\\', '\\',
    'b', '\b',
    'f', '\f',
    'n', '\n',
    'r', '\r',
    't', '\t'
  );

  private static final StringEscapeHelper rawStringEscapeHelper = new StringEscapeHelper(
    false,
    '\'', '\'',
    '\\', '\\'
  );

  private static final StringEscapeHelper jsonLiteralEscapeHelper = new StringEscapeHelper(
    false,
    '`', '`'
  );

  private final ParseTree tree;
  private final Adapter<T> runtime;
  private final NodeFactory<T> nodeFactory;
  private final ParseErrorAccumulator errors;

  private Node<T> chainedNode;

  public static <U> Expression<U> fromString(Adapter<U> runtime, String rawExpression) {
    ParseErrorAccumulator errors = new ParseErrorAccumulator();
    JmesPathParser parser = AntlrHelper.createParser(rawExpression, errors);
    ParseTree tree = parser.jmesPathExpression();
    Expression<U> expression = null;
    if (errors.isEmpty()) {
      ExpressionParser<U> visitor = new ExpressionParser<>(runtime, tree, errors);
      expression = visitor.expression();
    }
    if (!errors.isEmpty()) {
      throw new ParseException(rawExpression, errors);
    }
    return expression;
  }

  private ExpressionParser(Adapter<T> runtime, ParseTree tree, ParseErrorAccumulator errors) {
    this.runtime = runtime;
    this.nodeFactory = runtime.nodeFactory();
    this.tree = tree;
    this.errors = errors;
  }

  public Expression<T> expression() {
    return visit(tree);
  }

  private String identifierToString(JmesPathParser.IdentifierContext ctx) {
    String id = ctx.getText();
    if (ctx.STRING() != null) {
      id = identifierEscapeHelper.unescape(id.substring(1, id.length() - 1));
    }
    return id;
  }

  private void checkForUnescapedBackticks(Token token) {
    int unescapedBacktickIndex = indexOfUnescapedBacktick(token.getText());
    if (unescapedBacktickIndex > -1) {
      errors.parseError("syntax error unexpected `", token.getStartIndex() + unescapedBacktickIndex);
    }
  }

  private int indexOfUnescapedBacktick(String str) {
    int backtickIndex = str.indexOf('`');
    while (backtickIndex > -1) {
      if (backtickIndex == 0 || str.charAt(backtickIndex - 1) != '\\') {
        return backtickIndex;
      }
      backtickIndex = str.indexOf('`', backtickIndex + 1);
    }
    return -1;
  }

  private Node<T> createProjectionIfChained(Node<T> node) {
    if (chainedNode != null) {
      node = nodeFactory.createSequence(Arrays.asList(node, nodeFactory.createProjection(chainedNode)));
      chainedNode = null;
    }
    return node;
  }

  private Node<T> createSequenceIfChained(Node<T> node) {
    if (chainedNode != null) {
      node = nodeFactory.createSequence(Arrays.asList(node, chainedNode));
      chainedNode = null;
    }
    return node;
  }

  private Node<T> nonChainingVisit(ParseTree tree) {
    Node<T> stashedNextNode = chainedNode;
    chainedNode = null;
    Node<T> result = createSequenceIfChained(visit(tree));
    chainedNode = stashedNextNode;
    return result;
  }

  @Override
  public Node<T> visitJmesPathExpression(JmesPathParser.JmesPathExpressionContext ctx) {
    return createSequenceIfChained(visit(ctx.expression()));
  }

  @Override
  public Node<T> visitPipeExpression(JmesPathParser.PipeExpressionContext ctx) {
    Node<T> right = createSequenceIfChained(visit(ctx.expression(1)));
    Node<T> left = createSequenceIfChained(visit(ctx.expression(0)));
    return nodeFactory.createSequence(Arrays.asList(left, right));
  }

  @Override
  public Node<T> visitIdentifierExpression(JmesPathParser.IdentifierExpressionContext ctx) {
    return visit(ctx.identifier());
  }

  @Override
  public Node<T> visitNotExpression(JmesPathParser.NotExpressionContext ctx) {
    return nodeFactory.createNegate(createSequenceIfChained(visit(ctx.expression())));
  }

  @Override
  public Node<T> visitRawStringExpression(JmesPathParser.RawStringExpressionContext ctx) {
    String quotedString = ctx.RAW_STRING().getText();
    String unquotedString = rawStringEscapeHelper.unescape(quotedString.substring(1, quotedString.length() - 1));
    return nodeFactory.createString(unquotedString);
  }

  @Override
  public Node<T> visitComparisonExpression(JmesPathParser.ComparisonExpressionContext ctx) {
    Operator operator = Operator.fromString(ctx.COMPARATOR().getText());
    Node<T> right = nonChainingVisit(ctx.expression(1));
    Node<T> left = nonChainingVisit(ctx.expression(0));
    return createSequenceIfChained(nodeFactory.createComparison(operator, left, right));
  }

  @Override
  public Node<T> visitParenExpression(JmesPathParser.ParenExpressionContext ctx) {
    return createSequenceIfChained(nonChainingVisit(ctx.expression()));
  }

  @Override
  public Node<T> visitBracketExpression(JmesPathParser.BracketExpressionContext ctx) {
    Node<T> result = visit(ctx.bracketSpecifier());
    if (result == null) {
      result = chainedNode;
      chainedNode = null;
    }
    return result;
  }

  @Override
  public Node<T> visitOrExpression(JmesPathParser.OrExpressionContext ctx) {
    Node<T> left = nonChainingVisit(ctx.expression(0));
    Node<T> right = nonChainingVisit(ctx.expression(1));
    return createSequenceIfChained(nodeFactory.createOr(left, right));
  }

  @Override
  public Node<T> visitChainExpression(JmesPathParser.ChainExpressionContext ctx) {
    chainedNode = visit(ctx.chainedExpression());
    return createSequenceIfChained(visit(ctx.expression()));
  }

  @Override
  public Node<T> visitAndExpression(JmesPathParser.AndExpressionContext ctx) {
    Node<T> left = nonChainingVisit(ctx.expression(0));
    Node<T> right = nonChainingVisit(ctx.expression(1));
    return createSequenceIfChained(nodeFactory.createAnd(left, right));
  }

  @Override
  public Node<T> visitWildcardExpression(JmesPathParser.WildcardExpressionContext ctx) {
    return visit(ctx.wildcard());
  }

  @Override
  public Node<T> visitBracketedExpression(JmesPathParser.BracketedExpressionContext ctx) {
    Node<T> chainAfterExpression = visit(ctx.bracketSpecifier());
    Node<T> expression = createSequenceIfChained(visit(ctx.expression()));
    chainedNode = chainAfterExpression;
    return createSequenceIfChained(expression);
  }

  @Override
  public Node<T> visitWildcard(JmesPathParser.WildcardContext ctx) {
    return createProjectionIfChained(nodeFactory.createFlattenObject());
  }

  @Override
  public Node<T> visitMultiSelectList(JmesPathParser.MultiSelectListContext ctx) {
    int n = ctx.expression().size();
    List<Expression<T>> entries = new ArrayList<>(n);
    for (int i = 0; i < n; i++) {
      entries.add(nonChainingVisit(ctx.expression(i)));
    }
    return createSequenceIfChained(nodeFactory.createCreateArray(entries));
  }

  @Override
  public Node<T> visitMultiSelectHash(JmesPathParser.MultiSelectHashContext ctx) {
    int n = ctx.keyvalExpr().size();
    List<Entry<T>> entries = new ArrayList<>(n);
    for (int i = 0; i < n; i++) {
      JmesPathParser.KeyvalExprContext kvCtx = ctx.keyvalExpr(i);
      String key = identifierToString(kvCtx.identifier());
      Node<T> value = nonChainingVisit(kvCtx.expression());
      entries.add(new Entry<>(key, value));
    }
    return createSequenceIfChained(nodeFactory.createCreateObject(entries));
  }

  @Override
  public Node<T> visitBracketIndex(JmesPathParser.BracketIndexContext ctx) {
    int index = Integer.parseInt(ctx.SIGNED_INT().getText());
    chainedNode = createSequenceIfChained(nodeFactory.createIndex(index));
    return null;
  }

  @Override
  public Node<T> visitBracketStar(JmesPathParser.BracketStarContext ctx) {
    Node<T> projection = (chainedNode == null) ? nodeFactory.createCurrent() : chainedNode;
    chainedNode = nodeFactory.createProjection(projection);
    return null;
  }

  @Override
  public Node<T> visitBracketSlice(JmesPathParser.BracketSliceContext ctx) {
    Integer start = null;
    Integer stop = null;
    Integer step = null;
    JmesPathParser.SliceContext sliceCtx = ctx.slice();
    if (sliceCtx.start != null) {
      start = Integer.parseInt(sliceCtx.start.getText());
    }
    if (sliceCtx.stop != null) {
      stop = Integer.parseInt(sliceCtx.stop.getText());
    }
    if (sliceCtx.step != null) {
      step = Integer.parseInt(sliceCtx.step.getText());
      if (step == 0) {
        errors.parseError(String.format("invalid value %d for step size", step), sliceCtx.step.getStartIndex());
      }
    }
    chainedNode = createProjectionIfChained(nodeFactory.createSlice(start, stop, step));
    return null;
  }

  @Override
  public Node<T> visitBracketFlatten(JmesPathParser.BracketFlattenContext ctx) {
    return createProjectionIfChained(nodeFactory.createFlattenArray());
  }

  @Override
  public Node<T> visitSelect(JmesPathParser.SelectContext ctx) {
    chainedNode = createProjectionIfChained(nodeFactory.createSelection(nonChainingVisit(ctx.expression())));
    return null;
  }

  @Override
  public Node<T> visitFunctionExpression(JmesPathParser.FunctionExpressionContext ctx) {
    String name = ctx.NAME().getText();
    int n = ctx.functionArg().size();
    List<Expression<T>> args = new ArrayList<>(n);
    for (int i = 0; i < n; i++) {
      args.add(nonChainingVisit(ctx.functionArg(i)));
    }
    Function implementation = runtime.functionRegistry().getFunction(name);
    if (implementation == null) {
      Token token = ctx.NAME().getSymbol();
      errors.parseError(String.format("unknown function \"%s\"", name), token.getStartIndex());
    } else {
      ArgumentConstraint argumentConstraints = implementation.argumentConstraints();
      if (argumentConstraints.arityViolated(n)) {
        Token token = ctx.NAME().getSymbol();
        String message = ArityException.createMessage(implementation, n, false);
        errors.parseError(message, token.getStartIndex());
      }
    }
    return createSequenceIfChained(nodeFactory.createFunctionCall(implementation, args));
  }

  @Override
  public Node<T> visitCurrentNode(JmesPathParser.CurrentNodeContext ctx) {
    if (chainedNode == null) {
      return nodeFactory.createCurrent();
    } else {
      Node<T> result = chainedNode;
      chainedNode = null;
      return result;
    }
  }

  @Override
  public Node<T> visitExpressionType(JmesPathParser.ExpressionTypeContext ctx) {
    Node<T> expression = createSequenceIfChained(visit(ctx.expression()));
    return nodeFactory.createExpressionReference(expression);
  }

  @Override
  public Node<T> visitLiteral(JmesPathParser.LiteralContext ctx) {
    visit(ctx.jsonValue());
    String string = jsonLiteralEscapeHelper.unescape(ctx.jsonValue().getText());
    return nodeFactory.createJsonLiteral(string);
  }

  @Override
  public Node<T> visitJsonStringValue(JmesPathParser.JsonStringValueContext ctx) {
    checkForUnescapedBackticks(ctx.getStart());
    return super.visitJsonStringValue(ctx);
  }

  @Override
  public Node<T> visitJsonObjectPair(JmesPathParser.JsonObjectPairContext ctx) {
    checkForUnescapedBackticks(ctx.STRING().getSymbol());
    return super.visitJsonObjectPair(ctx);
  }

  @Override
  public Node<T> visitIdentifier(JmesPathParser.IdentifierContext ctx) {
    return createSequenceIfChained(nodeFactory.createProperty(identifierToString(ctx)));
  }
}

redpajama_set_name: RedPajamaGithub


text:
import { W as WidgetBehavior, i as isEqual, d as deepQueryAll, a as scrollParentToChild, b as BOOL_TYPE } from './index-1e8b6f76.js';

/**
 * @see https://www.w3.org/TR/wai-aria-practices/examples/listbox/listbox-collapsible.html
 */

class ListBoxBehavior extends WidgetBehavior {
  static get params() {
    return {
      input: true,
      provideValue: true,
    };
  }

  init() {
    this.props.multiple = (val) => {
      const bool = BOOL_TYPE(val);

      if (bool) {
        this.setAttr('type', 'array');
      }

      this.setAria('aria-multiselectable', bool);

      return bool;
    };

    this.multiple = this.host.hasAttribute('multiple');

    this.isPopup = this.host.hasAttribute('nu-popup');

    if (this.isPopup) {
      this.forceLinkValue();
    }

    this.host.nuListBox = this;
    this.options = [];

    super.init();

    this.setName('listbox');
    this.setContext('listbox', this, true);

    // this.on('blur', () => {
    // Clear active descendant
    // this.setActive();
    // });

    this.linkContext('button', (button) => {
      if (button && this.linkValue) {
        button.listbox = this;

        if (button.popup) {
          button.setAria('haspopup', 'listbox');
        }
      }
    });

    this.on('keydown', this.onKeyDown.bind(this));
    this.on('keyup', this.onKeyUp.bind(this));
  }

  connected() {
    super.connected();

    setTimeout(() => {
      if (!this.current && this.options.length) {
        this.current = this.options[0].value;
      }
    });
  }

  setValue(value, silent) {
    if (this.multiple && !Array.isArray(value) && value != null) {
      if (typeof value ==='string') {
        value = value.split(/,/g).map(val => val.trim());
      } else {
        value = [value];
      }
    }

    if (isEqual(this.value, value)) return;

    super.setValue(value, silent);
  }

  toggleOption(toggleValue, silent) {
    if (!this.multiple) {
      this.setValue(toggleValue, silent);

      return;
    }

    const option = this.getOptionByValue(toggleValue);

    // ignore if there is no option with such value
    if (!option) return;

    let value = [...(this.value || [])];

    if (!Array.isArray(value)) {
      value = [];
    }

    this.current = toggleValue;

    // toggle option value
    if (value.includes(toggleValue)) {
      value.splice(value.indexOf(toggleValue), 1);
    } else {
      value.push(toggleValue);
    }

    this.updateCurrent();

    this.setValue(value, silent);
  }

  onKeyUp(evt) {
    switch (evt.key) {
      case ' ':
        evt.stopPropagation();
        evt.preventDefault();
        this.toggleOption(this.current);

        if (!this.multiple && evt.target === this.host && this.isPopup) {
          this.use('popup')
            .then(Popup => Popup.close());
        }
        break;
      default:
        return;
    }

    evt.nuListBoxHandled = true;
  }

  onKeyDown(evt) {
    const options = this.orderedOptions;
    const currentOption = this.currentOption;

    if (!options.length || (currentOption && !options.includes(currentOption))) return;

    const index = options.indexOf(currentOption);

    let newCurrent;

    switch (evt.key) {
      case 'Home':
        if (!this.isEdgeMoveAllowed()) return;

        newCurrent = options[0].value;

        break;
      case 'End':
        if (!this.isEdgeMoveAllowed()) return;

        newCurrent = options.slice(-1)[0].value;

        break;
      case 'ArrowUp':
        if (index > 0) {
          newCurrent = options[index - 1].value;
        } else if (index === -1) {
          newCurrent = options.slice(-1)[0].value;
        } else {
          return;
        }

        this.openPopup();

        break;
      case 'ArrowDown':
        if (index < options.length - 1) {
          newCurrent = options[index + 1].value;
        } else if (index === -1) {
          newCurrent = options[0].value;
        } else {
          return;
        }

        this.openPopup();

        break;
      case ' ':
        evt.preventDefault();
        evt.stopPropagation();
        return;
      case 'Enter':
        this.setValue(this.current);

        if (evt.target === this.host && this.isPopup) {
          this.use('popup')
            .then(Popup => Popup.close());
        }
        break;
      default:
        return;
    }

    evt.nuListBoxHandled = true;

    setTimeout(() => {
      if (newCurrent != null) {
        this.current = newCurrent;
      }

      this.updateCurrent();
    });

    evt.preventDefault();
    // evt.stopPropagation();
  }

  isEdgeMoveAllowed() {
    if (!this.isPopup) return true;

    const popup = this.host.nuPopup;

    if (popup) {
      return popup.isOpen;
    }

    return true;
  }

  openPopup() {
    if (!this.isPopup) return;

    const popup = this.host.nuPopup;

    if (!popup || popup.isOpen) return;

    if (this.button) {
      this.button.set(true, true);
    }
  }

  addOption(option) {
    if (!this.options.includes(option)) {
      this.options.push(option);

      if (!this.current) {
        if (this.multiple ? (this.value || []).includes(option.value) : isEqual(this.value, option.value)) {
          this.current = option.value;
        }
      }
    }
  }

  get orderedOptions() {
    const ownHosts = this.options.map(option => option.host);

    return deepQueryAll(this.host, '[nu-option]:not([disabled])')
      .filter(host => ownHosts.includes(host))
      .map(host => this.options.find(option => option.host === host))
      .filter(option => option);
  }

  get currentOption() {
    return this.options.find(option => isEqual(option.value, this.current));
  }

  removeOption(option) {
    if (this.options.includes(option)) {
      this.options.splice(this.options.indexOf(option), 1);

      if (this.current === option.value) {
        this.current = false;
      }
    }
  }

  getOptionByValue(value) {
    return this.options.find(option => isEqual(option.value, value));
  }

  updateCurrent() {
    this.options.forEach(option => {
      option.setCurrent();
    });

    setTimeout(() => {
      const currentOption = this.currentOption;

      if (currentOption) {
        scrollParentToChild(this.host, currentOption.host);
      }
    });
  }
}

export default ListBoxBehavior;


text:
title:  Kimlik Sorunu
date:  26/12/2020
---

### Konuyla İlgili Metinler
Yeşaya 1:1-9; Yeşaya 1:10-17; Yeşaya 1:18; Yeşaya 1:19-31; Yeşaya 5:1-7.

>
Hatırlama Metni

> "Gelin, şimdi davamızı görelim. Günahlarınız sizi kana boyamış bile olsa kar gibi ak pak olacaksınız. Elleriniz kırmız böceği gibi kızıl olsa da yapağı gibi bembeyaz olacak." (Yşa 1:18).

UNUTKANLIKLAR ÜLKESİNDE KAYBOLMAK. İrlanda'da çalılardan yapılmış çitler boyunca uzanan uzun toprak yollardan otomobilinizle geçtiğinizde yolunuz sık sık otlamasını bitirmiş sakin sakin ahırına dönen inek sürüleri tarafından kesilir. Yanlarında çobanları bulunmasa bile onlar doğruca sahibinin ahırına giderler. Onlar nereye ve kime ait olduklarını çok iyi bilirler.

Büyük bir dükkanda annesini kaybetmiş küçük bir çocuk "Annemi kaybettim!" diye bağırdığında belki dükkanın içinde bulunan bir sürü anneler denizinin ortasında tam olarak annesinin yerini bilmese bile dükkanın her tarafını dolaşıp kendi annesini bulabilir.

Üzücü olan, hem İrlandalı ineklere hem de kaybolan küçük çocuğa kıyasla, Yahudalıların Rab'be, Göksel Rab'be ait olduklarını unutmaları ve bu yüzden de antlaşma halkı olarak gerçek kimliklerini kaybetmeleriydi. "Çocuklar yetiştirip büyüttüm, ama bana başkaldırdılar. Öküz sahibini, eşek efendisinin yemliğini bilir, ama İsrail halkı bu kadarını bile bilmiyor, halkım anlamıyor" (Yşa 1:2, 3).

Bu hafta Rab'bin, halkını yeniden kendisine yöneltmek için verdiği uğraşı gözden geçireceğiz.

*2 Ocak Sebt Günü'ne hazırlık için bu haftanın dersini çalışın.


text:
from ...errors.httpconflictexception import HttpConflictException
import saklient

# module saklient.cloud.errors.diskorssinmigrationexception

class DiskOrSsInMigrationException(HttpConflictException):
    ## 要求された操作を行えません。このディスク または このディスクのスナップショットから他のリソースへのコピー処理が進行中です。完了後に再度お試しください。

    ## @param {int} status
    # @param {str} code=None
    # @param {str} message=""
    def __init__(self, status, code=None, message=""):
        super(DiskOrSsInMigrationException, self).__init__(status, code, "要求された操作を行えません。このディスク または このディスクのスナップショットから他のリソースへのコピー処理が進行中です。完了後に再度お試しください。" if message is None or message == "" else message)


text:
#ifndef BOOST_SIGNALS2_POSTCONSTRUCTIBLE_HPP
#define BOOST_SIGNALS2_POSTCONSTRUCTIBLE_HPP

namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost
{
  template<typename T> class shared_ptr;

  namespace signals2
  {
    namespace postconstructible_adl_barrier
    {
      class postconstructible;
    }
    namespace detail
    {
      void do_postconstruct(const mars_boost::signals2::postconstructible_adl_barrier::postconstructible *ptr);
    } // namespace detail

    namespace postconstructible_adl_barrier
    {
      class postconstructible
      {
      public:
        friend void detail::do_postconstruct(const postconstructible *ptr);
        template<typename T>
          friend void adl_postconstruct(const shared_ptr<T> &, postconstructible *p)
        {
          p->postconstruct();
        }
      protected:
        postconstructible() {}
        virtual ~postconstructible() {}
        virtual void postconstruct() = 0;
      };
    } // namespace postconstructible_adl_barrier
    using postconstructible_adl_barrier::postconstructible;

  }
}

#endif // BOOST_SIGNALS2_POSTCONSTRUCTIBLE_HPP


text:
#ifndef PCL_REGISTRATION_CORRESPONDENCE_ESTIMATION_NORMAL_SHOOTING_H_
#define PCL_REGISTRATION_CORRESPONDENCE_ESTIMATION_NORMAL_SHOOTING_H_

#include <pcl/registration/correspondence_types.h>
#include <pcl/registration/correspondence_estimation.h>

namespace pcl
{
  namespace registration
  {
    /** \brief @b CorrespondenceEstimationNormalShooting computes correspondences as points in the target cloud which
      *  have minimum distance to normals computed on the input cloud
      * \author Aravindhan K Krishnan
      * \ingroup registration
      */
    template <typename PointSource, typename PointTarget, typename NormalT>
    class CorrespondenceEstimationNormalShooting : public CorrespondenceEstimation <PointSource, PointTarget>
    {
      public:
        using PCLBase<PointSource>::initCompute;
        using PCLBase<PointSource>::deinitCompute;
        using PCLBase<PointSource>::input_;
        using PCLBase<PointSource>::indices_;
        using CorrespondenceEstimation<PointSource, PointTarget>::getClassName;

        typedef typename pcl::KdTree<PointTarget> KdTree;
        typedef typename pcl::KdTree<PointTarget>::Ptr KdTreePtr;

        typedef pcl::PointCloud<PointSource> PointCloudSource;
        typedef typename PointCloudSource::Ptr PointCloudSourcePtr;
        typedef typename PointCloudSource::ConstPtr PointCloudSourceConstPtr;

        typedef pcl::PointCloud<PointTarget> PointCloudTarget;
        typedef typename PointCloudTarget::Ptr PointCloudTargetPtr;
        typedef typename PointCloudTarget::ConstPtr PointCloudTargetConstPtr;

        typedef typename KdTree::PointRepresentationConstPtr PointRepresentationConstPtr;
        typedef typename pcl::PointCloud<NormalT>::Ptr NormalsPtr;

        /** \brief Empty constructor. */
        CorrespondenceEstimationNormalShooting ()
        {
          corr_name_ = "NormalShooting";
        }

        /** \brief Set the normals computed on the input point cloud
          * \param[in] normals the normals computed for the input cloud
          */
        inline void
        setSourceNormals (NormalsPtr &normals) { source_normals_ = normals; }

        /** \brief Get the normals of the input point cloud
          */
        inline NormalsPtr
        getSourceNormals () const { return (source_normals_); }

        /** \brief Determine the correspondences between input and target cloud.
          * \param[out] correspondences the found correspondences (index of query point, index of target point, distance)
          * \param[in] max_distance maximum distance between the normal on the source point cloud and the corresponding point in the target
          * point cloud
          */
        void
        determineCorrespondences (pcl::Correspondences &correspondences,
                                  float max_distance = std::numeric_limits<float>::max ());

        /** \brief Set the number of nearest neighbours to be considered in the target point cloud
          * \param[in] k the number of nearest neighbours to be considered
          */
        inline void
        setKSearch (unsigned int k) { k_ = k; }

        /** \brief Get the number of nearest neighbours considered in the target point cloud for computing correspondence
          */
        inline void
        getKSearch () const { return (k_); }

      protected:

        using CorrespondenceEstimation<PointSource, PointTarget>::corr_name_;
        using CorrespondenceEstimation<PointSource, PointTarget>::tree_;
        using CorrespondenceEstimation<PointSource, PointTarget>::target_;

      private:

        /** \brief The normals computed at each point in the input cloud */
        NormalsPtr source_normals_;

        /** \brief The number of neighbours to be considered in the target point cloud */
        unsigned int k_;
    };
  }
}

#include <pcl/registration/impl/correspondence_estimation_normal_shooting.hpp>
#endif /* PCL_REGISTRATION_CORRESPONDENCE_ESTIMATION_NORMAL_SHOOTING_H_ */


text:
from math import gcd
from random import randrange
from sys import getrecusionlimit

def gcd3(alist):
    """Returns the gcd of a list of 3 integers"""
    assert len(alist) == 3, "There must 3 integers in the list"
    return gcd(alist[0], gcd(alist[1],alist[2]))

def gcd_many(alist):
	"""Returns the gcd of a list of several (at least 2) ints.
	The sie of the list must be less than or equal to the system's recursion limit to avoid recursion depth exceptions.
	This function serves no prupose in this module, but may be used freely in other programs."""
	assert len(alist) >= 1, "The size of the input list must be at least 2"
	assert len(alist) <= getrecursionlimit(), f"The size of the list must be less than {getrecursionlimit()} in order to avoid maximum recusrion depth exceptions"
	if len(alist) == 2:
		return gcd(alist[0], alist[1])
	else:
		return gcd(alist[0], gcd_many(alist[1:]))

def aperyEstimate(num):
    count = 0
    for i in range(num):
        mylist = []
        for j in range(3):
            x = randrange(int(1e6))
            mylist.append(x)
        if gcd3(mylist) == 1:
            count += 1
    return num / count

def main(num):
    print(aperyEstimate(num))

if __name__ == "__main__":
    import sys
    main(int(sys.argv[1]))


text:
"""
:mod:`tier_1_mn_read_getsystemmetadata`
=======================================

:Created: 2011-04-22
:Author: DataONE (Dahl)
:Dependencies:
  - python 2.6
"""

import pytest

import context
import test_client

import d1_common.types.exceptions

import d1_test_case

class Test080GetSystemMetadata(d1_test_case.D1TestCase):
    def test_010_get_sysmeta_by_invalid_pid(self):
        """404 NotFound when attempting to get non-existing SysMeta."""
        client = test_client.TestClient(context.node["baseurl"])
        with pytest.raises(d1_common.types.exceptions.NotFound):
            client.getSystemMetadata(context.TOKEN, "_invalid_pid_")

    def test_020_get_sysmeta_by_valid_pid(self):
        """Successful retrieval of valid SysMeta objects."""
        client = test_client.TestClient(context.node["baseurl"])
        for object_list in context.slices:
            for object_info in object_list.objectInfo:
                pid = object_info.identifier.value()
                sys_meta = client.getSystemMetadata(context.TOKEN, pid)
                # Verify that identifier in SysMeta matches the one that was retrieved.
                assert object_info.identifier.value() == sys_meta.identifier.value()
                # Verify that object format matches listObjects.
                assert object_info.objectFormat == sys_meta.objectFormat
                # Verify that date matches listObjects.
                assert (
                    object_info.dateSysMetadataModified
                    == sys_meta.dateSysMetadataModified
                )
                # Verify that size matches listObjects.
                assert object_info.size == sys_meta.size
                # Verify that checksum and checksum algorithm matches listObjects.
                assert object_info.checksum.value() == sys_meta.checksum.value()
                assert object_info.checksum.algorithm == sys_meta.checksum.algorithm


text:
<project
		xmlns="http://maven.apache.org/POM/4.0.0"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>

	<parent>
        <groupId>org.adbcj</groupId>
		<artifactId>mysql-build</artifactId>
		<version>0.2-SNAPSHOT</version>
	</parent>

	<artifactId>mysql-codec</artifactId>
	<packaging>jar</packaging>
	<name>ADBCJ - MySQL Codec</name>

	<dependencies>
		<dependency>
			<artifactId>slf4j-log4j12</artifactId>
			<groupId>org.slf4j</groupId>
			<version>${slf4j.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

</project>


text:
package camelinaction.producer;

import java.util.Random;

public class WordBean {

    private String[] words = new String[]{
        "Camel",
        "Rocks",
        "Whiskey",
        "Beer",
        "Bad",
        "Donkey",
        "Cool",
        "Dude",
        "Hawt",
        "Fabric8"
    };

    private int counter;

    public String generateWord() {
        int ran = new Random().nextInt(words.length);
        return "#" + ++counter + "-" + words[ran];
    }
}


text:
/* app css stylesheet */
/*
 * Base structure
 */

/* Move down content because we have a fixed navbar that is 50px tall */
body {
  padding-top: 50px;
}

/*
 * Global add-ons
 */

.sub-header {
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

/*
 * Sidebar
 */

/* Hide for mobile, show later */
.sidebar {
  display: none;
}
@media (min-width: 768px) {
  .sidebar {
    position: fixed;
    top: 51px;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: block;
    padding: 20px;
    overflow-x: hidden;
    overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
    background-color: #f5f5f5;
    border-right: 1px solid #eee;
  }
}

/* Sidebar navigation */
.nav-sidebar {
  margin-right: -21px; /* 20px padding + 1px border */
  margin-bottom: 20px;
  margin-left: -20px;
}
.nav-sidebar > li > a {
  padding-right: 20px;
  padding-left: 20px;
}
.nav-sidebar > .active > a {
  color: #fff;
  background-color: #428bca;
}

/*
 * Main content
 */

.main {
  padding: 20px;
}
@media (min-width: 768px) {
  .main {
    padding-right: 40px;
    padding-left: 40px;
  }
}
.main .page-header {
  margin-top: 0;
}

/*
 * Placeholder dashboard ideas
 */

.placeholders {
  margin-bottom: 30px;
  text-align: center;
}
.placeholders h4 {
  margin-bottom: 0;
}
.placeholder {
  margin-bottom: 20px;
}
.placeholder img {
  display: inline-block;
  border-radius: 50%;
}

.fm-loader, .fm-ui-popup-maskLayer {
    position: fixed;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 10000;
}
.fm-ui-popup-maskLayer {
    background: gray;
    opacity: 0.5;
}

.fm-ui-popup-container {
    position: absolute;
    margin: 100px auto;
    top: 0;
    left: 0;
    right: 0;
    background: white;
}
fm-view{
    display: block;
}

.fm-ui-popup-cross {
    float: right;
}

@-webkit-keyframes spin {
	to { -webkit-transform: rotate(1turn); }
}
.loading {
	position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
	display: inline-block;
	width: 5em;
	height: 5em;
	margin: auto;
	font-size: 12px;
	text-indent: 999em;
	overflow: hidden;
	-webkit-animation: spin 1s infinite steps(8);
}

.small.loading {
	font-size: 6px;
}

.large.loading {
	font-size: 24px;
}

.loading:before,
.loading:after,
.loading > div:before,
.loading > div:after {
	content: '';
	position: absolute;
	top: 0;
	left: 2.25em; /* (container width - part width)/2  */
	width: .5em;
	height: 1.5em;
	border-radius: .2em;
	background: #eee;
	box-shadow: 0 3.5em #eee; /* container height - part height */
	-webkit-transform-origin: 50% 2.5em; /* container height / 2 */
}

.loading:before {
	background: #555;
}

.loading:after {
	-webkit-transform: rotate(-45deg);
	background: #777;
}

.loading > div:before {
	-webkit-transform: rotate(-90deg);
	background: #999;
}

.loading > div:after {
	-webkit-transform: rotate(-135deg);
	background: #bbb;
}


text:
/// Copyright (c) 2012 Ecma International.  All rights reserved.
/**
 * @path ch15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-5.js
 * @description Duplicate combined parameter name in Function constructor allowed if body is not strict
 */

function testcase()
{
    Function('a,a','return;');
    return true;
 }
runTestCase(testcase);


text:
require 'json'
require 'pp'

module JsonExpressions
  module Test
    module Unit
      module Helpers
        def assert_json_match(exp, act, msg = nil)
          unless JsonExpressions::Matcher === exp
            exp = JsonExpressions::Matcher.new(exp)
          end

          if String === act
            begin
              act = JSON.parse(act)
            rescue
              assert false, "Expected #{pp(act)} to be valid JSON"
            end
          end

          unless exp =~ act
            assert false, "Expected #{pp(exp)} to match #{pp(act)}\n #{exp.last_error}"
          end

          # Return the matcher
          return exp
        end
      end
    end
  end
end


text:
from rest_framework.serializers import ModelSerializer
from coffeecups.models import Take, Throw, CupPolicy

class TakeSerializer(ModelSerializer):
    class Meta:
        model = Take
        fields = ('id', 'user', 'date',)

class ThrowSerializer(ModelSerializer):
    class Meta:
        model = Throw
        fields = ('id', 'user', 'date',)

class CupPolicySerializer(ModelSerializer):
    class Meta:
        model = CupPolicy
        read_only_fields = ('users',)
        fields = (
            'id',
            'name',
            'comment',
            'users',
            'no_takes',
            'take_of_the_day',
            'take_malus',
            'throw',
        )


text:
'use strict';

angular.module('umm3601ursamajorApp')

    .controller('SubformCtrl', function ($scope, $http, Auth, $location, socket, $filter, $window, Modal) {

        if(Auth.isLoggedIn() === false) {
            $location.path('/');
        }

        // Authentication Stuff
        $scope.isAdmin = Auth.isAdmin;
        $scope.isLoggedIn = Auth.isLoggedIn;

        // Status Stuff
        $scope.statusArray = [];
        $scope.startingStatus = "";

        // Text Content for the Form
        $scope.submissionTextArray = [];
        $scope.submissionText = {};

        // Resubmission Stuff
        $scope.submissions = [];
        $scope.flaggedSubmissions = [];
        $scope.resubmitParent = null;
        $scope.isResubmitting = false;
        $scope.adviserChanged = false;

        // Misc. Stuff
        $scope.timestamp = Date();

        // Admin / Testing Specific Stuff
        $scope.attemptEmail = true; //Used to prevent the attempted sending of emails during testing.
        $scope.attemptRedirect = true; //Used to prevent attempted redirecting during testing.

        // ---------------------------------------- General HTTP requests ----------------------------------------
        $http.get('/api/submissions').success(function(submissions) {
            $scope.submissions = submissions;
            $scope.updateFlaggedSubmissions(submissions);
            socket.syncUpdates('submission', $scope.submissions);
        });

        $http.get('/api/statuss').success(function(statusArray) {
            $scope.statusArray = statusArray;
            for(var i = 0; i < $scope.statusArray.length; i++) {
                if ($scope.statusArray[i].priority == -15) {
                    $scope.startingStatus = $scope.statusArray[i].strict;
                    $scope.submissionData.status = {strict: $scope.startingStatus, priority: -15, text: ""};
                }
            }
        });

        $http.get('/api/subformtexts').success(function(submissionTextArray) {
            $scope.submissionTextArray = submissionTextArray;
            $scope.submissionText = $scope.submissionTextArray[0];
        });

        // --------------------------------------- Data maintenance functions ------------------------------------

        /**
         * Updates $scope.flaggedSubmissions with any submissions owned by the user that have active resubmit flags.
         *
         * @param subs  - Array of submissions to update from. (usually $scope.submissions)
         */
        $scope.updateFlaggedSubmissions = function(subs){
            $scope.flaggedSubmissions = $filter('filter')(subs, function(sub){return (sub.resubmissionData.resubmitFlag && (Auth.getCurrentUser().email === sub.presenterInfo.email))});
        };

        /**
         * Checks if the user has any submissions with active resubmit flags.
         *
         * @returns {boolean}  - Whether the user has any active resubmit flags.
         */
        $scope.hasResubmitFlags = function(){
            return $scope.flaggedSubmissions.length > 0;
        };

        // --------------------------------------- Default data for View ------------------------------------------

        $scope.formatOptions =
            ['Artist Statement',
                'Humanities Proposal',
                'Science or Social Science Abstract'
            ];

        $scope.presentationTypes =
            ['Poster or visual display',
                'Oral presentation',
                'Performance'
            ];

        $scope.fundingSources = [
            'UROP',
            'MAP',
            'MMP',
            'LSAMP'
        ];

        $scope.numberOfSources = $scope.fundingSources.length;

        $scope.submissionData = {
            title: "",
            format: "",
            abstract: "",
            presentationType: "",
            formatChange: Boolean,
            presenterInfo: {first: "", last: "", email: ""},
            copresenterOne: {first: "", last: "", email: ""},
            copresenterTwo: {first: "", last: "", email: ""},
            discipline: "",
            sponsors: [],
            sponsorsFinal: [],
            adviserInfo: {first: "", last: "", email: ""},
            coadviserOneInfo: {first: "", last: "", email: ""},
            coadviserTwoInfo: {first: "", last: "", email: ""},
            featuredPresentation: Boolean,
            mediaServicesEquipment: "",
            specialRequirements: "",
            otherInfo: "",
            approval: false,
            cc: false,
            rejection: false,
            resubmitComment: "",
            resubmitParent: "",
            resubmitFlag: false,
            status: {strict: $scope.startingStatus, priority: -15, text: ""},
            comments: [],
            group: 0,
            roomAssignment: "",
            reviewVotes: {
                Accepted: [],
                Minor: [],
                Major: [],
                TotalRewrite: []
            }
        };

        // ----------------------------- Misc Helper Functions --------------------------------------

        /**
         * Opens a new email (gmail) in a new tab using parameters specified in opts.
         *
         * @param opts  - Options for the generated email:
         *
         * to: Array of emails to send to.
         * subject: Subject of email.
         * message: Body of email.
         */
        var sendGmail = function(opts){
            var str = 'http://mail.google.com/mail/?view=cm&fs=1'+
                '&to=' + opts.to +
                '&su=' + opts.subject +
                '&body=' + opts.message +
                '&ui=1';
            $window.open(str);
        };

        /**
         * Returns the number of chatacters the user has left for their abstract.
         *
         * @returns {number}  - The number of remaining characters (out of 1000).
         */
        $scope.charsRemaining = function() {
            return 1000 - $scope.submissionData.abstract.length;
        };

        /**
         * Resets the submissionData to its default values.
         */
        $scope.resetData = function(){
            $scope.submissionData = {
                title: "",
                format: "",
                abstract: "",
                presentationType: "",
                formatChange: Boolean,
                presenterInfo: {first: "", last: "", email: ""},
                copresenterOne: {first: "", last: "", email: ""},
                copresenterTwo: {first: "", last: "", email: ""},
                discipline: "",
                sponsors: [],
                sponsorsFinal: [],
                adviserInfo: {first: "", last: "", email: ""},
                coadviserOneInfo: {first: "", last: "", email: ""},
                coadviserTwoInfo: {first: "", last: "", email: ""},
                featuredPresentation: Boolean,
                mediaServicesEquipment: "",
                specialRequirements: "",
                otherInfo: "",
                approval: false,
                cc: false,
                rejection: false,
                resubmitComment: "",
                resubmitParent: "",
                resubmitFlag: false,
                status: {strict: $scope.startingStatus, priority: -15, text: ""},
                comments: [],
                group: 0,
                roomAssignment: "",
                reviewVotes: {
                    Accepted: [],
                    Minor: [],
                    Major: [],
                    TotalRewrite: []
                }
            };
        };

        /**
         * Sends a canned email to the advisers of the submission. (if attemptEmail is true).
         */
        $scope.sendAdviserEmail = function() {
            if($scope.attemptEmail){
                sendGmail({
                    to: [$scope.submissionData.adviserInfo.email, $scope.submissionData.coadviserOneInfo.email, $scope.submissionData.coadviserTwoInfo.email],
                    subject: 'A URS Submission Requires Your Approval',
                    message: $scope.submissionData.presenterInfo.first + " " + $scope.submissionData.presenterInfo.last +
                        ' has submitted a URS submission that requires your approval. ' +
                        'By approving the submission, you are authorizing the student(s) to submit this abstract for consideration by the Undergraduate Research Symposium. ' +
                        'This is not approving the final abstract; the student(s) will have the opportunity to further revise, improve, and finalize their submission. '+
                        'Please go to the URS website and login with your X500 UMN email. Once there, navigate to the "Submissions List" tab and choose your advisees ' +
                        'submission to approve (or reject) it. You will have the option to be included in future emails pertaining to the submission, please read carefully.'
                });
            }
        };

        //----------------------------------- Resubmission Functions --------------------------------------

        /**
         * Converts array of sponsors from a submission into a format suitable for the submission form.
         *
         * @param arry  - the array to be converted. IE: ["UROP", "MMP"]
         * @returns {Array}  - the array which is suitable for use in the submission form. IE: ["UROP", "",  "MMP", ""]
         */
        $scope.convertSponsorArray = function(arry) {
            var tempSponsors = [];
            var addedToggle = false;

            for(var x = 0; x <= $scope.fundingSources.length; x++){
                addedToggle = false;
                for(var y = 0; y < arry.length; y++){
                    if(x == $scope.fundingSources.length){
                        if($scope.fundingSources.indexOf(arry[arry.length - 1]) == -1){
                            tempSponsors.push(arry[arry.length - 1]);
                        }
                        break;
                    } else if(arry[y] === $scope.fundingSources[x]){
                        tempSponsors.push(arry[y]);
                        addedToggle = true;
                    }
                }
                if(!addedToggle){
                    if(x == $scope.fundingSources.length){
                        addedToggle = !addedToggle;
                    } else {
                        tempSponsors.push("");
                        addedToggle = !addedToggle;
                    }
                }
            }
//        console.log("~~~~~~~~~~~~~~sponsors from parent submission~~~~~~~~~~~~~~~~~~");
//        console.log(tempSponsors);
            return tempSponsors;
        };

        /**
         * Checks for changes to primary adviser during a resubmission.
         *
         * If any aspect of the primary adviser has changed from the parent submission, the user will be prompted to send an email to the new adviser.
         */
        $scope.checkAdviserChanges = function(){
            var same = true;
            if($scope.isResubmitting){
                for(var key in $scope.submissionData.adviserInfo){
                    if($scope.submissionData.adviserInfo.hasOwnProperty(key)){
                        if($scope.submissionData.adviserInfo[key] != $scope.resubmitParent.adviserInfo[key]){
                            //console.log("Adviser difference!");
                            //console.log($scope.submissionData.adviserInfo[key] + " | " + $scope.resubmitParent.adviserInfo[key]);
                            same = false;
                            break;
                        }
                    }
                }

                if(!same){
                    $scope.submissionData.approval = false;
                    $scope.adviserChanged = true;
                    Modal.confirm.info($scope.sendSpecialAdviserEmail)("You have changed your primary adviser from " + $scope.resubmitParent.adviserInfo.first + " " + $scope.resubmitParent.adviserInfo.last + " [" + $scope.resubmitParent.adviserInfo.email + "] to " +
                       $scope.submissionData.adviserInfo.first + " " + $scope.submissionData.adviserInfo.last + " [" + $scope.submissionData.adviserInfo.email + "]. " + " Your submission will now require the approval of this new adviser. Send email to new adviser?");
                }
            }
        };

        /**
         * Gathers relevant data from the parent submission for resubmission.
         *
         * @param submission  - The parent submission.
         */
        $scope.getResubmitData = function(submission){
            $scope.submissionData = {
                title: submission.title,
                format: submission.format,
                abstract: submission.abstract,
                presentationType: submission.presentationType,
                formatChange: submission.formatChange,
                presenterInfo: {first: submission.presenterInfo.first, last: submission.presenterInfo.last, email: submission.presenterInfo.email},
                copresenterOne: {first: submission.copresenterOneInfo.first, last: submission.copresenterOneInfo.last, email: submission.copresenterOneInfo.email},
                copresenterTwo: {first: submission.copresenterTwoInfo.first, last: submission.copresenterTwoInfo.last, email: submission.copresenterTwoInfo.email},
                discipline: submission.discipline,
                sponsors: $scope.convertSponsorArray(submission.sponsors),
                sponsorsFinal: [],
                adviserInfo: {first: submission.adviserInfo.first, last: submission.adviserInfo.last, email: submission.adviserInfo.email},
                coadviserOneInfo: {first: submission.coadviserOneInfo.first, last: submission.coadviserOneInfo.last, email: submission.coadviserOneInfo.email},
                coadviserTwoInfo: {first: submission.coadviserTwoInfo.first, last: submission.coadviserTwoInfo.last, email: submission.coadviserTwoInfo.email},
                featuredPresentation: submission.featured,
                mediaServicesEquipment: submission.mediaServicesEquipment,
                specialRequirements: submission.specialRequirements,
                otherInfo: submission.otherInfo,
                approval: submission.approval,
                cc: submission.cc,
                rejection: submission.rejection,
                resubmitComment: "",
                resubmitParent: submission._id,
                resubmitFlag: false,
                status: submission.status,
                comments: submission.comments,
                group: submission.group,
                roomAssignment: submission.roomAssignment,
                reviewVotes: {
                    Accepted: submission.reviewVotes.Accepted,
                    Minor: submission.reviewVotes.Minor,
                    Major: submission.reviewVotes.Major,
                    TotalRewrite: submission.reviewVotes.TotalRewrite
                }
            };
//            console.log("submissionData: ");
//            console.log($scope.submissionData);
//            console.log(submission.comments);

            $scope.isResubmitting = true;
            $scope.resubmitParent = submission;
        };

        //--------------------------- Email Validation -------------------------------

        /**
         * Checks if emails in the submission data are U of M addresses. (not specifically morris).
         *
         * @returns {boolean}  - Whether or not all emails are U of M addresses.
         */
        $scope.checkEmailsAreUofM = function (){
            var presenterEmail = $scope.submissionData.presenterInfo.email;
            var copresenterOneEmail = $scope.submissionData.copresenterOne.email;
            var copresenterTwoEmail = $scope.submissionData.copresenterTwo.email;
            var adviserEmail = $scope.submissionData.adviserInfo.email;
            var coadviserOneEmail = $scope.submissionData.coadviserOneInfo.email;
            var coadviserTwoEmail = $scope.submissionData.coadviserTwoInfo.email;

            var copresenterOneCheck = true;
            var copresenterTwoCheck = true;
            var coadviserOneCheck = true;
            var coadviserTwoCheck = true;

            var presenterCheck = (presenterEmail.indexOf("umn.edu") != -1);

            if(copresenterOneEmail != ""){
                copresenterOneCheck = (copresenterOneEmail.indexOf("umn.edu") != -1);
            }

            if(copresenterTwoEmail != ""){
                copresenterTwoCheck = (copresenterTwoEmail.indexOf("umn.edu") != -1);
            }

            var adviserEmailCheck = (adviserEmail.indexOf("umn.edu") != -1);

            if(coadviserOneEmail != ""){
                coadviserOneCheck = (coadviserOneEmail.indexOf("umn.edu") != -1);
            }

            if(coadviserTwoEmail != ""){
                coadviserTwoCheck = (coadviserTwoEmail.indexOf("umn.edu") != -1);
            }

            return presenterCheck && copresenterOneCheck &&
                copresenterTwoCheck && adviserEmailCheck
                && coadviserOneCheck && coadviserTwoCheck;
        };

        /**
         * Checks if all emails in submission data are U of M Morris addresses.
         *
         * @returns {boolean}  - Whether or not all emails are U of M Morris addresses.
         */
        $scope.checkEmailsAreMorris = function (){
            var presenterEmail = $scope.submissionData.presenterInfo.email;
            var copresenterOneEmail = $scope.submissionData.copresenterOne.email;
            var copresenterTwoEmail = $scope.submissionData.copresenterTwo.email;
            var adviserEmail = $scope.submissionData.adviserInfo.email;
            var coadviserOneEmail = $scope.submissionData.coadviserOneInfo.email;
            var coadviserTwoEmail = $scope.submissionData.coadviserTwoInfo.email;

            var copresenterOneCheck = true;
            var copresenterTwoCheck = true;
            var coadviserOneCheck = true;
            var coadviserTwoCheck = true;

            var presenterCheck = (presenterEmail.indexOf("morris.umn.edu") != -1);

            if(copresenterOneEmail != ""){
                copresenterOneCheck = (copresenterOneEmail.indexOf("morris.umn.edu") != -1);
            }

            if(copresenterTwoEmail != ""){
                copresenterTwoCheck = (copresenterTwoEmail.indexOf("morris.umn.edu") != -1);
            }

            var adviserEmailCheck = (adviserEmail.indexOf("morris.umn.edu") != -1);

            if(coadviserOneEmail != ""){
                coadviserOneCheck = (coadviserOneEmail.indexOf("morris.umn.edu") != -1);
            }

            if(coadviserTwoEmail != ""){
                coadviserTwoCheck = (coadviserTwoEmail.indexOf("morris.umn.edu") != -1);
            }

            return presenterCheck && copresenterOneCheck &&
                copresenterTwoCheck && adviserEmailCheck
                && coadviserOneCheck && coadviserTwoCheck;
        };

        //must check that primary adviser is Morris, but all others can be just umn, because primary must log in with Morris email
        $scope.checkPrimaryEmails = function(){
            var presenterEmail = $scope.submissionData.presenterInfo.email;
            var adviserEmail = $scope.submissionData.adviserInfo.email;

            var presenterEmailCheck = (presenterEmail.indexOf("morris.umn.edu") != -1);
            var adviserEmailCheck = (adviserEmail.indexOf("morris.umn.edu") != -1);

            return presenterEmailCheck && adviserEmailCheck;
        };

        /**
         * Runs email validation (above) and alerts the user if necessary.
         *
         * If validation passes, submission process will begin.
         */
        $scope.preSubmitChecks = function(){
            var checkUMM = $scope.checkEmailsAreMorris();

            // If all emails are UMM, proceed with submission
            if(checkUMM){
                $scope.submitSubmissionConfirm();
            } else {
                var checkPrimary = $scope.checkPrimaryEmails();
                var checkUofM = $scope.checkEmailsAreUofM();

                if(!checkPrimary){
                    Modal.confirm.warning()("Either your main presenter email or primary adviser email is not currently a U of M Morris email.");
                } else if(!checkUofM){
                    Modal.confirm.warning()("One of the emails you entered is not a University of Minnesota email.");
                } else if (checkUofM && !checkUMM){
                    Modal.confirm.info($scope.submitSubmissionConfirm)("At least one of the emails you entered is not a Morris email address. Would you like to continue?");
                }
            }
        };

        //---------------------------- Submitting Submission(s) ------------------------------

        /**
         * Opens confirmation modal (info) to confirm the user's desire to submit their submission.
         */
        $scope.submitSubmissionConfirm = function(){
            Modal.confirm.info($scope.submitSubmission)("Are you sure you want to submit?");
        };

        /**
         * Does a variety of things in order to submit a submission to the database.
         */
        $scope.submitSubmission = function(){

            // checking for changes to primary adviser.
            $scope.checkAdviserChanges();

            // Converts the submissionData sponsors array into a readable format for storage as part of the submission.
            for (var i = 0; i < $scope.submissionData.sponsors.length; i++) {
                if ($scope.submissionData.sponsors[i] != "" && $scope.submissionData.sponsors[i] != null) {
                    $scope.submissionData.sponsorsFinal.push($scope.submissionData.sponsors[i]);
                }
            }

            // if the user IS resubmitting, transfers the comments from the parent submission into submissionData for inclusion in the resubmission.
            if($scope.isResubmitting){
                //console.log("saving comments from original submission");
                //console.log("original comments: " + $scope.resubmitParent.comments);
                $scope.submissionData.comments = $scope.resubmitParent.comments;
                //console.log($scope.submissionData.comments);
            }

            $http.post('/api/submissions/',
                {   title: $scope.submissionData.title,
                    format: $scope.submissionData.format,
                    abstract: $scope.submissionData.abstract,
                    presentationType: $scope.submissionData.presentationType,
                    formatChange: $scope.submissionData.formatChange,
                    presenterInfo: {first: $scope.submissionData.presenterInfo.first, last: $scope.submissionData.presenterInfo.last, email: $scope.submissionData.presenterInfo.email},
                    copresenterOneInfo: {first: $scope.submissionData.copresenterOne.first, last: $scope.submissionData.copresenterOne.last, email: $scope.submissionData.copresenterOne.email},
                    copresenterTwoInfo: {first: $scope.submissionData.copresenterTwo.first, last: $scope.submissionData.copresenterTwo.last, email: $scope.submissionData.copresenterTwo.email},
                    discipline: $scope.submissionData.discipline,
                    sponsors: $scope.submissionData.sponsorsFinal,
                    adviserInfo: {first: $scope.submissionData.adviserInfo.first, last: $scope.submissionData.adviserInfo.last, email: $scope.submissionData.adviserInfo.email},
                    coadviserOneInfo: {first: $scope.submissionData.coadviserOneInfo.first, last: $scope.submissionData.coadviserOneInfo.last, email: $scope.submissionData.coadviserOneInfo.email},
                    coadviserTwoInfo: {first: $scope.submissionData.coadviserTwoInfo.first, last: $scope.submissionData.coadviserTwoInfo.last, email: $scope.submissionData.coadviserTwoInfo.email},
                    featured: $scope.submissionData.featuredPresentation,
                    mediaServicesEquipment: $scope.submissionData.mediaServicesEquipment,
                    specialRequirements: $scope.submissionData.specialRequirements,
                    otherInfo: $scope.submissionData.otherInfo,
                    approval: $scope.submissionData.approval,
                    cc: $scope.submissionData.cc,
                    rejection: $scope.submissionData.rejection,
                    status: $scope.submissionData.status,
                    timestamp: $scope.timestamp,
                    group: $scope.submissionData.group,
                    roomAssignment: $scope.submissionData.roomAssignment,
                    resubmissionData: {comment: $scope.submissionData.resubmitComment, parentSubmission: $scope.submissionData.resubmitParent, isPrimary: !$scope.isResubmitting, resubmitFlag: $scope.submissionData.resubmitFlag },
                    comments: $scope.submissionData.comments,
                    reviewVotes: {
                        Accepted: $scope.submissionData.reviewVotes.Accepted,
                        Minor: $scope.submissionData.reviewVotes.Minor,
                        Major: $scope.submissionData.reviewVotes.Major,
                        TotalRewrite: $scope.submissionData.reviewVotes.TotalRewrite
                    }
                });

            // Alter resubmissionData of parent submission to reflect the fact that a resubmission has been made.
            if ($scope.isResubmitting) {
                $http.patch('api/submissions/' + $scope.submissionData.resubmitParent,
                    {
                        resubmissionData: {comment: $scope.resubmitParent.resubmissionData.comment, parentSubmission: $scope.resubmitParent.resubmissionData.parentSubmission, resubmitFlag: false, isPrimary: true}
                    }
                ).success(function () {
                        //console.log("Successfully unflagged the original submission for resbumission.");
                    });
            }

            // Default attempt to send adviser email if submission is not a resubmission.
            if(!$scope.isResubmitting && $scope.attemptEmail){
                Modal.confirm.warning($scope.sendSpecialAdviserEmail)("If you do not send the email that will be automatically generated, your adviser will not receive a notification to approve your submission.");
            };

            if($scope.isResubmitting && !$scope.adviserChanged) {
              $scope.resetAndRedirect();
            };

        };

        $scope.resetAndRedirect = function(){
                $scope.resetData();
                //console.log('reseting data');
            if($scope.attemptRedirect){
                $location.path('/submissionpage');
               //console.log('redirecting');
            };
        };

        $scope.sendSpecialAdviserEmail = function(){
            $scope.sendAdviserEmail();
            $scope.resetAndRedirect();
        };

        ///**
        // * Helper function for adminAutoSubmit.
        // *
        // * @returns {number}  -random number that serves as a valid index in $scope.submissions
        // */
        //$scope.randomSubmissionIndex = function(){
        //    return Math.floor(($scope.submissions.length - 1) * Math.random());;
        //};
        //
        ///**
        // * Selects a random submission from the existing submissions in the database and submits it as a new submission. (n times)
        // * Used to test system performance with large numbers of submissions.
        // *
        // * @param n  - The number of random submissions to make.
        // */
        //$scope.adminAutoSubmit = function(n){
        //    if(n > 1){$scope.attemptRedirect = false;}
        //    for(var i=0; i<=n; i++){
        //        $scope.getResubmitData($scope.submissions[$scope.randomSubmissionIndex()]);
        //
        //        $scope.submissionData.resubmitFlag = false;
        //
        //        $scope.isResubmitting = false;
        //
        //        $scope.submissionData.title = $scope.submissionData.title + " [FILLER SUBMISSION]";
        //
        //        $scope.attemptEmail = false;
        //
        //        console.log("auto submitting admin auto generated submission!");
        //
        //        $scope.submitSubmission();
        //    }
        //}

    });


text:
package Request;

public enum RequestType {
	Login ("Login <user> <password>		# Login to the system using credentials"),
	Set ("Set <dev> <oid> <val>		# set <val> of <oid> on a given <dev>"),
	Get ("Get <dev> <oid>			# get value of <oid> on a given <dev>"),
	Devices ("Devices				# list available network elements"),
	List ("list <dev>			# list available oids on a <dev>"),
	Name ("Name <dev> <oid>		# given <dev> and <oid>, return oid's string name"),
	Help ("Help				# HELPZZ!!"),
	Invalid ("");

	private final String help;
	RequestType(String help) {
		this.help = help;
	}

	public String getHelpString() {return help;}
}


text:
<?php

namespace denbora\R_T_G_Services\examples\RESTv3\Player;

use denbora\R_T_G_Services\examples\RESTv3\RestExample;

class GetAccountBalanceGET extends RestExample
{
}


text:
namespace boost {
namespace numeric {
namespace bindings {
namespace blas {

//
// The detail namespace contains value-type-overloaded functions that
// dispatch to the appropriate back-end BLAS-routine.
//
namespace detail {

#if defined BOOST_NUMERIC_BINDINGS_BLAS_CBLAS
//
// Overloaded function for dispatching to
// * CBLAS backend, and
// * float value-type.
//
inline float dot( const int n, const float* x, const int incx, const float* y,
        const int incy ) {
    return cblas_sdot( n, x, incx, y, incy );
}

//
// Overloaded function for dispatching to
// * CBLAS backend, and
// * double value-type.
//
inline double dot( const int n, const double* x, const int incx,
        const double* y, const int incy ) {
    return cblas_ddot( n, x, incx, y, incy );
}

//
// Overloaded function for dispatching to
// * CBLAS backend, and
// * complex<float> value-type.
//
inline std::complex<float> dot( const int n, const std::complex<float>* x,
        const int incx, const std::complex<float>* y, const int incy ) {
    std::complex<float> result;
    cblas_cdotu_sub( n, x, incx, y, incy, &result );
    return result;
}

//
// Overloaded function for dispatching to
// * CBLAS backend, and
// * complex<double> value-type.
//
inline std::complex<double> dot( const int n, const std::complex<double>* x,
        const int incx, const std::complex<double>* y, const int incy ) {
    std::complex<double> result;
    cblas_zdotu_sub( n, x, incx, y, incy, &result );
    return result;
}

#elif defined BOOST_NUMERIC_BINDINGS_BLAS_CUBLAS
//
// Overloaded function for dispatching to
// * CUBLAS backend, and
// * float value-type.
//
inline float dot( const int n, const float* x, const int incx, const float* y,
        const int incy ) {
    return cublasSdot( n, x, incx, y, incy );
}

//
// Overloaded function for dispatching to
// * CUBLAS backend, and
// * double value-type.
//
inline double dot( const int n, const double* x, const int incx,
        const double* y, const int incy ) {
    return cublasDdot( n, x, incx, y, incy );
}

//
// Overloaded function for dispatching to
// * CUBLAS backend, and
// * complex<float> value-type.
//
inline std::complex<float> dot( const int n, const std::complex<float>* x,
        const int incx, const std::complex<float>* y, const int incy ) {
    return cublasCdotu( n, x, incx, y, incy );
}

//
// Overloaded function for dispatching to
// * CUBLAS backend, and
// * complex<double> value-type.
//
inline std::complex<double> dot( const int n, const std::complex<double>* x,
        const int incx, const std::complex<double>* y, const int incy ) {
    return cublasZdotu( n, x, incx, y, incy );
}

#else
//
// Overloaded function for dispatching to
// * netlib-compatible BLAS backend (the default), and
// * float value-type.
//
inline float dot( const fortran_int_t n, const float* x,
        const fortran_int_t incx, const float* y, const fortran_int_t incy ) {
    return BLAS_SDOT( &n, x, &incx, y, &incy );
}

//
// Overloaded function for dispatching to
// * netlib-compatible BLAS backend (the default), and
// * double value-type.
//
inline double dot( const fortran_int_t n, const double* x,
        const fortran_int_t incx, const double* y, const fortran_int_t incy ) {
    return BLAS_DDOT( &n, x, &incx, y, &incy );
}

//
// Overloaded function for dispatching to
// * netlib-compatible BLAS backend (the default), and
// * complex<float> value-type.
//
inline std::complex<float> dot( const fortran_int_t n,
        const std::complex<float>* x, const fortran_int_t incx,
        const std::complex<float>* y, const fortran_int_t incy ) {
    return BLAS_CDOTU( &n, x, &incx, y, &incy );
}

//
// Overloaded function for dispatching to
// * netlib-compatible BLAS backend (the default), and
// * complex<double> value-type.
//
inline std::complex<double> dot( const fortran_int_t n,
        const std::complex<double>* x, const fortran_int_t incx,
        const std::complex<double>* y, const fortran_int_t incy ) {
    return BLAS_ZDOTU( &n, x, &incx, y, &incy );
}

#endif

} // namespace detail

//
// Value-type based template class. Use this class if you need a type
// for dispatching to dot.
//
template< typename Value >
struct dot_impl {

    typedef Value value_type;
    typedef typename remove_imaginary< Value >::type real_type;
    typedef value_type result_type;

    //
    // Static member function that
    // * Deduces the required arguments for dispatching to BLAS, and
    // * Asserts that most arguments make sense.
    //
    template< typename VectorX, typename VectorY >
    static result_type invoke( const VectorX& x, const VectorY& y ) {
        namespace bindings = ::boost::numeric::bindings;
        BOOST_STATIC_ASSERT( (is_same< typename remove_const<
                typename bindings::value_type< VectorX >::type >::type,
                typename remove_const< typename bindings::value_type<
                VectorY >::type >::type >::value) );
        BOOST_STATIC_ASSERT( (bindings::has_linear_array< VectorX >::value) );
        BOOST_STATIC_ASSERT( (bindings::has_linear_array< VectorY >::value) );
        return detail::dot( bindings::size(x),
                bindings::begin_value(x), bindings::stride(x),
                bindings::begin_value(y), bindings::stride(y) );
    }
};

//
// Functions for direct use. These functions are overloaded for temporaries,
// so that wrapped types can still be passed and used for write-access. Calls
// to these functions are passed to the dot_impl classes. In the
// documentation, the const-overloads are collapsed to avoid a large number of
// prototypes which are very similar.
//

//
// Overloaded function for dot. Its overload differs for
//
template< typename VectorX, typename VectorY >
inline typename dot_impl< typename bindings::value_type<
        VectorX >::type >::result_type
dot( const VectorX& x, const VectorY& y ) {
    return dot_impl< typename bindings::value_type<
            VectorX >::type >::invoke( x, y );
}

} // namespace blas
} // namespace bindings
} // namespace numeric
} // namespace boost

#endif


text:
// Unit test code for Event::Connect

#include "test.hpp"
#include <iostream>

#include <subject.hpp>
#include <observer.hpp>

using namespace std;
using sigcxx::Slot;

Test::Test()
    : testing::Test() {
}

Test::~Test() {

}

/*
 *
 */
TEST_F(Test, connect_method_once) {
  Subject s;
  Observer o;

  s.signal1().Connect(&o, &Observer::OnTest1IntegerParam);

  ASSERT_TRUE((s.CountSignalBindings() == 0) && (s.signal1().CountConnections() == 1) && (o.CountSignalBindings() == 1));
}

/*
 *
 */
TEST_F(Test, connect_method_4_times) {
  using namespace sigcxx;

  Subject s;
  Observer o;

  s.signal1().Connect(&o, &Observer::OnTest1IntegerParam);
  s.signal1().Connect(&o, &Observer::OnTest1IntegerParam);
  s.signal1().Connect(&o, &Observer::OnTest1IntegerParam);
  s.signal1().Connect(&o, &Observer::OnTest1IntegerParam);

  s.emit_signal1(1);    // this should call 4 times

  ASSERT_TRUE(o.test1_count() == 4 &&
      s.signal1().CountConnections() == 4 &&
      o.CountSignalBindings() == 4);
}

/*
 * This testcase test the connectiong between events -- chain load
 */
TEST_F(Test, connect_event_once) {
  Subject s1;
  sigcxx::Signal<int> s2;
  Observer o;

  s2.Connect(&o, &Observer::OnTest1IntegerParam);
  s1.signal1().Connect(s2);

  s1.emit_signal1(1);  // cause chain signal_base

  ASSERT_TRUE((o.test1_count() == 1) && (s1.signal1().CountConnections() == 1) && (s2.CountSignalBindings() == 1)
                  && (s2.CountConnections() == 1) && (o.CountSignalBindings() == 1));
}

/*
 * Disconnect 1
 */
TEST_F(Test, disconnect_once) {
  Subject s;
  Observer c;

  s.signal1().Connect(&c, &Observer::OnTest1IntegerParam);
  s.signal1().Connect(&c, &Observer::OnTest1IntegerParam);
  s.signal1().Connect(&c, &Observer::OnTest1IntegerParam);

  s.signal1().Disconnect(&c, &Observer::OnTest1IntegerParam, 0);
  s.signal1().Disconnect(&c, &Observer::OnTest1IntegerParam, -1);

  s.emit_signal1(1);

  ASSERT_TRUE(c.test1_count() == 1);
}

TEST_F(Test, selfconsumer) {
  Subject s;

  s.signal1().Connect(&s, &Subject::OnTest1IntegerParam);

  s.emit_signal1(1);
  s.emit_signal1(2);

  ASSERT_TRUE(s.test1_count() == 2);
}

TEST_F(Test, event_chaining) {
  Subject s1;
  sigcxx::Signal<int> s2;
  Observer c;

  s1.signal1().Connect(s2);
  s2.Connect(&c, &Observer::OnTest1IntegerParam);

  s1.emit_signal1(1);

  ASSERT_TRUE(c.CountSignalBindings() == 1 && c.test1_count() == 1);
}

TEST_F(Test, delete_when_called) {
  Subject s;
  Observer c1;
  Observer c2;
  Observer c3;
  Observer *obj = new Observer;

  s.signal0().Connect(&c1, &Observer::OnTest0);
  s.signal0().Connect(obj, &Observer::OnTestDestroy);
  s.signal0().Connect(&c2, &Observer::OnTest0);
  s.signal0().Connect(&c3, &Observer::OnTest0);

  s.emit_signal0();

  ASSERT_TRUE((c1.test0_count() == 1) &&
      (c2.test0_count() == 1) &&
      (c3.test0_count() == 1) &&
      (s.signal0().CountConnections() == 3));
}

TEST_F(Test, delete_more_when_called) {
  Subject s;
  Observer c1;
  Observer c2;
  Observer c3;
  Observer *obj1 = new Observer;
  Observer *obj2 = new Observer;
  Observer *obj3 = new Observer;

  s.signal0().Connect(&c1, &Observer::OnTest0);
  s.signal0().Connect(obj1, &Observer::OnTestDestroy);
  s.signal0().Connect(&c2, &Observer::OnTest0);
  s.signal0().Connect(&c3, &Observer::OnTest0);
  s.signal0().Connect(obj2, &Observer::OnTestDestroy);
  s.signal0().Connect(obj3, &Observer::OnTestDestroy);

  s.emit_signal0();

  ASSERT_TRUE((c1.test0_count() == 1) &&
      (c2.test0_count() == 1) &&
      (c3.test0_count() == 1) &&
      (s.signal0().CountConnections() == 3));
}

TEST_F(Test, count_event_connections) {
  Subject s1;
  sigcxx::Signal<> s2;
  Observer c;

  s1.signal0().Connect(s2);
  s1.signal0().Connect(&c, &Observer::OnTest0);
  s1.signal0().Connect(s2);

  ASSERT_TRUE(
      (s1.signal0().CountConnections(s2) == 2) &&
          (s1.signal0().CountConnections(&c, &Observer::OnTest0) == 1)
  );
}