text:
<!DOCTYPE html>

<TITLE>Manpage of HEADER_CHECKS</TITLE>
<meta charset="utf-8">
<link rel="stylesheet" href="/css/main.css" type="text/css">

linux manpages

{"type":"documentation"}

HEADER_CHECKS

Section: File Formats (5)
Index
Return to Main Contents

NAME

header_checks
-
Postfix built-in content inspection

SYNOPSIS

header_checks = pcre:/etc/postfix/header_checks
mime_header_checks = pcre:/etc/postfix/mime_header_checks
nested_header_checks = pcre:/etc/postfix/nested_header_checks
body_checks = pcre:/etc/postfix/body_checks

postmap -q "string" pcre:/etc/postfix/filename
postmap -q - pcre:/etc/postfix/filename <inputfile

DESCRIPTION

This document describes access control on the content of
message headers and message body lines; it is implemented
by the Postfix cleanup(8) server before mail is queued.
See access(5) for access control on remote SMTP client
information.

Each message header or message body line is compared against
a list of patterns.
When a match is found the corresponding action is executed, and
the matching process is repeated for the next message header or
message body line.

For examples, see the EXAMPLES section at the end of this
manual page.

Postfix header or body_checks are designed to stop a flood of mail
from worms or viruses; they do not decode attachments, and they do
not unzip archives. See the documents referenced below in the README
FILES section if you need more sophisticated content analysis.

Postfix supports four built-in content inspection classes:

header_checks

These are applied to initial message headers (except for
the headers that are processed with mime_header_checks).

mime_header_checks (default: $header_checks)

These are applied to MIME related message headers only.

This feature is available in Postfix 2.0 and later.

nested_header_checks (default: $header_checks)

These are applied to message headers of attached email
messages (except for the headers that are processed with
mime_header_checks).

This feature is available in Postfix 2.0 and later.

body_checks

These are applied to all other content, including multi-part
message boundaries.

With Postfix versions before 2.0, all content after the initial
message headers is treated as body content.

Note: message headers are examined one logical header at a time,
even when a message header spans multiple lines. Body lines are
always examined one line at a time.

COMPATIBILITY

With Postfix version 2.2 and earlier specify "postmap
-fq" to query a table that contains case sensitive
patterns. By default, regexp: and pcre: patterns are case
insensitive.

TABLE FORMAT

This document assumes that header and body_checks rules are specified
in the form of Postfix regular expression lookup tables. Usually the
best performance is obtained with pcre (Perl Compatible Regular
Expression) tables, but the slower regexp (POSIX regular
expressions) support is more widely available.
Use the command "postconf -m" to find out what lookup table
types your Postfix system supports.

The general format of Postfix regular expression tables is
given below.
For a discussion of specific pattern or flags syntax,
see pcre_table(5) or regexp_table(5), respectively.

/pattern/flags action

When /pattern/ matches the input string, execute
the corresponding action. See below for a list
of possible actions.

!/pattern/flags action

When /pattern/ does not match the input string,
execute the corresponding action.

if /pattern/flags

endif

Match the input string against the patterns between if
and endif, if and only if the same input string also
matches /pattern/. The if..endif can nest.

Note: do not prepend whitespace to patterns inside
if..endif.

if !/pattern/flags

endif

Match the input string against the patterns between if
and endif, if and only if the same input string does
not match /pattern/. The if..endif
can nest.

blank lines and comments

Empty lines and whitespace-only lines are ignored, as
are lines whose first non-whitespace character is a `#'.

multi-line text

A pattern/action line starts with non-whitespace text. A line that
starts with whitespace continues a logical line.

TABLE SEARCH ORDER

For each line of message input, the patterns are applied in the
order as specified in the table. When a pattern is found that matches
the input line, the corresponding action is executed and then the
next input line is inspected.

TEXT SUBSTITUTION

Substitution of substrings from the matched expression into the
action
string is possible using the conventional Perl syntax
($1, $2, etc.).
The macros in the result string may need to be written as ${n}
or $(n) if they aren't followed by whitespace.

Note: since negated patterns (those preceded by !) return a
result when the expression does not match, substitutions are not
available for negated patterns.

ACTIONS

Action names are case insensitive. They are shown in upper case
for consistency with other Postfix documentation.

DISCARD optional text...

Claim successful delivery and silently discard the message.
Log the optional text if specified, otherwise log a generic
message.

Note: this action disables further header or body_checks inspection
of the current message and affects all recipients.
To discard only one recipient without discarding the entire message,
use the transport(5) table to direct mail to the discard(8) service.

This feature is available in Postfix 2.0 and later.

DUNNO

Pretend that the input line did not match any pattern, and inspect the
next input line. This action can be used to shorten the table search.

For backwards compatibility reasons, Postfix also accepts
OK but it is (and always has been) treated as DUNNO.

This feature is available in Postfix 2.1 and later.

FILTER transport:destination

Write a content filter request to the queue file, and
inspect the next input line.
After the complete message is received it will be sent through
the specified external content filter.  More information about
external content filters is in the Postfix FILTER_README file.

Note: this action overrides the content_filter setting,
and affects all recipients of the message. In the case that multiple
FILTER actions fire, only the last one is executed.

This feature is available in Postfix 2.0 and later.

HOLD optional text...

Arrange for the message to be placed on the hold queue,
and inspect the next input line.  The message remains on hold
until someone either deletes it or releases it for delivery.
Log the optional text if specified, otherwise log a generic
message.

Mail that is placed on hold can be examined with the
postcat(1) command, and can be destroyed or released with
the postsuper(1) command.

Note: use "postsuper -r" to release mail that was kept on
hold for a significant fraction of $maximal_queue_lifetime
or $bounce_queue_lifetime, or longer. Use "postsuper -H"
only for mail that will not expire within a few delivery attempts.

Note: this action affects all recipients of the message.

This feature is available in Postfix 2.0 and later.

IGNORE

Delete the current line from the input, and inspect
the next input line.

PREPEND text...

Prepend one line with the specified text, and inspect the next
input line.

Notes:

*

The prepended text is output on a separate line, immediately
before the input that triggered the PREPEND action.

*

The prepended text is not considered part of the input
stream: it is not subject to header/body checks or address
rewriting, and it does not affect the way that Postfix adds
missing message headers.

*

When prepending text before a message header line, the prepended
text must begin with a valid message header label.

*

This action cannot be used to prepend multi-line text.

This feature is available in Postfix 2.1 and later.

REDIRECT user@domain

Write a message redirection request to the queue file, and
inspect the next input line. After the message is queued,
it will be sent to the specified address instead of the
intended recipient(s).

Note: this action overrides the FILTER action, and affects
all recipients of the message. If multiple REDIRECT actions
fire, only the last one is executed.

This feature is available in Postfix 2.1 and later.

REPLACE text...

Replace the current line with the specified text, and inspect the next
input line.

This feature is available in Postfix 2.2 and later. The
description below applies to Postfix 2.2.2 and later.

Notes:

*

When replacing a message header line, the replacement text
must begin with a valid header label.

*

The replaced text remains part of the input stream. Unlike
the result from the PREPEND action, a replaced message
header may be subject to address rewriting and may affect
the way that Postfix adds missing message headers.

REJECT optional text...

Reject the entire message. Reply with optional text... when
the optional text is specified, otherwise reply with a generic error
message.

Note: this action disables further header or body_checks inspection
of the current message and affects all recipients.

Postfix version 2.3 and later support enhanced status codes.
When no code is specified at the beginning of optional
text..., Postfix inserts a default enhanced status code of
"5.7.1".

WARN optional text...

Log a warning with the optional text... (or log a
generic message), and inspect the next input line. This
action is useful for debugging and for testing a pattern
before applying more drastic actions.

BUGS

Empty lines never match, because some map types mis-behave
when given a zero-length search string.  This limitation may
be removed for regular expression tables in a future release.

Many people overlook the main limitations of header and body_checks
rules.

*

These rules operate on one logical message header or one body
line at a time. A decision made for one line is not carried over
to the next line.

*

If text in the message body is encoded
(RFC 2045) then the rules need to be specified for the encoded
form.

*

Likewise, when message headers are encoded (RFC
2047) then the rules need to be specified for the encoded
form.

Message headers added by the cleanup(8) daemon itself
are excluded from inspection. Examples of such message headers
are From:, To:, Message-ID:, Date:.

Message headers deleted by the cleanup(8) daemon will
be examined before they are deleted. Examples are: Bcc:,
Content-Length:, Return-Path:.

CONFIGURATION PARAMETERS

body_checks

Lookup tables with content filter rules for message body lines.
These filters see one physical line at a time, in chunks of
at most $line_length_limit bytes.

body_checks_size_limit

The amount of content per message body segment (attachment) that is
subjected to $body_checks filtering.

header_checks

mime_header_checks (default: $header_checks)

nested_header_checks (default: $header_checks)

Lookup tables with content filter rules for message header lines:
respectively, these are applied to the initial message headers
(not including MIME headers), to the MIME headers anywhere in
the message, and to the initial headers of attached messages.

Note: these filters see one logical message header at a time, even
when a message header spans multiple lines. Message headers that
are longer than $header_size_limit characters are truncated.

disable_mime_input_processing

While receiving mail, give no special treatment to MIME related
message headers; all text after the initial message headers is
considered to be part of the message body. This means that
header_checks is applied to all the initial message headers,
and that body_checks is applied to the remainder of the
message.

Note: when used in this manner, body_checks will process
a multi-line message header one line at a time.

EXAMPLES

Header pattern to block attachments with bad file name
extensions.  For convenience, the PCRE /x flag is specified,
so that there is no need to collapse the pattern into a
single line of text.  The purpose of the [[:xdigit:]]
sub-expressions is to recognize Windows CLSID strings.

/etc/postfix/main.cf:
    header_checks = pcre:/etc/postfix/header_checks.pcre

/etc/postfix/header_checks.pcre:
    /^Content-(Disposition|Type).*name\s*=\s*"?(.*(\.|=2E)(
      ade|adp|asp|bas|bat|chm|cmd|com|cpl|crt|dll|exe|
      hlp|ht[at]|
      inf|ins|isp|jse?|lnk|md[betw]|ms[cipt]|nws|
      \{[[:xdigit:]]{8}(?:-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}\}|
      ops|pcd|pif|prf|reg|sc[frt]|sh[bsm]|swf|
      vb[esx]?|vxd|ws[cfh]))(\?=)?"?\s*(;|$)/x
        REJECT Attachment name "$2" may not end with ".$4"

Body pattern to stop a specific HTML browser vulnerability exploit.

/etc/postfix/main.cf:
    body_checks = regexp:/etc/postfix/body_checks

/etc/postfix/body_checks:
    /^<iframe src=(3D)?cid:.* height=(3D)?0 width=(3D)?0>$/
        REJECT IFRAME vulnerability exploit

SEE ALSO

cleanup(8), canonicalize and enqueue Postfix message
pcre_table(5), format of PCRE lookup tables
regexp_table(5), format of POSIX regular expression tables
postconf(1), Postfix configuration utility
postmap(1), Postfix lookup table management
postsuper(1), Postfix janitor
postcat(1), show Postfix queue file contents
RFC 2045, base64 and quoted-printable encoding rules
RFC 2047, message header encoding for non-ASCII text

README FILES

Use "postconf readme_directory" or
"postconf html_directory" to locate this information.

DATABASE_README, Postfix lookup table overview
CONTENT_INSPECTION_README, Postfix content inspection overview
BUILTIN_FILTER_README, Postfix built-in content inspection
BACKSCATTER_README, blocking returned forged mail

LICENSE

The Secure Mailer license must be distributed with this software.

AUTHOR(S)

Wietse Venema
IBM T.J. Watson Research
P.O. Box 704
Yorktown Heights, NY 10598, USA

Index

NAME

SYNOPSIS

DESCRIPTION

COMPATIBILITY

TABLE FORMAT

TABLE SEARCH ORDER

TEXT SUBSTITUTION

ACTIONS

BUGS

CONFIGURATION PARAMETERS

EXAMPLES

SEE ALSO

README FILES

LICENSE

AUTHOR(S)

This document was created by
man2html,
using the manual pages.

Time: 05:33:59 GMT, December 24, 2015


text:
<?php
/**
 * Created by PhpStorm.
 * User: trisatria
 * Date: 1/6/14
 * Time: 1:17 PM
 */
namespace Admin\Controller;

use Velacolib\Utility\Table;
use Velacolib\Utility\Table\AjaxTable;
use Velacolib\Utility\Table\Detail;

use Admin\Entity\Categories;
use Admin\Entity\Managetable;
use Admin\Model\categoryModel;
use Admin\Model\comboModel;
use Admin\Model\menuModel;
use Velacolib\Utility\Utility;
use Zend\View\Model\ViewModel;
use Zend\Mvc\Controller\AbstractActionController;

class ComboController extends AdminGlobalController
{
    protected   $modelCombo;
    protected   $modelMenu;
    protected  $translator;

    public function init(){
        parent::init();
        $this->modelCombo = new comboModel($this->doctrineService);
        $this->modelMenu = new menuModel($this->doctrineService);

    }

    public function indexAction()
    {

        $columns = array(

            array('title' =>'Id', 'db' => 'id', 'dt' => 0, 'search'=>false, 'type' => 'number' ),
            array('title' =>'Name', 'db' => 'name','dt' => 1, 'search'=>true, 'type' => 'text' ),
            array('title' =>'Category', 'db' => 'catId','dt' => 2, 'search'=>false, 'type' => 'number',
                'dataSelect' => Utility::getCategoryForSelect()
            ),
            array('title' =>'Cost', 'db' => 'cost','dt' => 3, 'search'=>false, 'type' => 'number',
                'formatter' => function($d, $row){
                    return Utility::formatCost($d);
                }
            ),
            array('title' =>'Take Away Cost', 'db' => 'taCost','dt' => 4, 'search'=>false, 'type' => 'number','formatter' => function($d, $row){
                return Utility::formatCost($d);
            } ),
            array('title' =>'Action','db'=>'id','dt' => 5, 'search'=>false, 'type' => 'number',
                'formatter' => function( $d, $row ) {
                    $actionUrl = '/admin/index';
                    return '

                    ';

                }
            ),

        );

        /////end column for table
        $table = new AjaxTable($columns, array(), 'admin/combo');
        $table->setTablePrefix('m');
        $table->setExtendSQl(array(
            array('AND','m.isdelete','=','0'),
            array('AND','m.isCombo','=','1'),
        ));

        $table->setAjaxCall('/admin/combo');
        $table->setActionDeleteAll('deleteall');
        $this->tableAjaxRequest($table,$columns,$this->modelMenu);
        //end config table

        return new ViewModel(array(
            'table' => $table,
            'title' => $this->translator->translate('Manage Combo')));
    }
    public function ajaxListAction()
    {

        $fields = array(
            'id',
            'menuParentId',
            'menuChildId',
            'menuQuantity',
        );

        $offset = $this->getDataTableQueryOffset();
        $limit = $this->getDataTableQueryLimit();
        $sortCol = $this->getDataTableQuerySortingColumn();
        $sortDirection = $this->getDataTableQuerySortingDirection();
        $search = $this->getDataTableQuerySearch();
        $customWhere  = ' c.isdelete = 0 ';
        // WHERE conditions

        $customQuery = $this->customWhereSql($customWhere);

        $dqlWhere = $this->getDataTableWhereDql('c', $fields, $search,$customWhere);

        if ( !empty($dqlWhere) ) {
            $customQuery = '';
        }

        // ORDERING
        $dqlOrder = $this->getDataTableOrderDql('c', $fields, $sortCol, $sortDirection);

        // DQL
        $dql = "SELECT c FROM Admin\Entity\MenuCombo c";

        // RESULTS
        $query = $this->getEntityManager()->createQuery($dql .$customQuery .$dqlWhere . $dqlOrder);
        if ( !empty($dqlWhere) ) {
            $query->setParameter(':search', '%' . $search . '%');
        }
        $results = $query->setMaxResults($limit)
            ->setFirstResult($offset)
            ->getResult();

        // TOTAL RESULTS COUNT
        $countDql = "SELECT COUNT(c.id) FROM Admin\Entity\MenuCombo c";
        $count = $this->getEntityManager()->createQuery($countDql)->getSingleScalarResult();

        $ret = array_map(function($item) {
            $linkEdit =   '/admin/index/add/'.$item->getMenuParentId() ;
            $linkDelete =  '/admin/index/delete/'.$item->getId() ;
            $linkDetail =   '/admin/index/detail/'.$item->getMenuParentId() ;

            return array(
                'id' => $item->getId(),
                'menuParentId' => $item->getMenuParentId()  ,
                'menuChildId' => $item->getMenuChildId()  ,
                'menuQuantity' => $item->getMenuQuantity()  ,
                'action'=>'

                 getId().'"  data-link="'.$linkDelete.'" data-id="'.$item->getId().'" href="javascript:void(0)" class="btn btn-danger btn-delete">'
            );
        }, $results);

        return $this->getDataTableJsonResponse($ret, $count, $dqlWhere);

    }

    public function addAction()
    {
//        $request = $this->getRequest();
//        $id = $this->params()->fromRoute('id');
//        //insert
//        if($id == ''){
//            if($request->isPost()) {
//                $cat = new Categories();
//                $cat->setName($this->params()->fromPost('name'));
//                $catInserted = $this->modelCategories->insert($cat);
//            }
//            //insert new user
//            //$this->redirect()->toRoute('admin/child',array('controller'=>'category'));
//            return new ViewModel(array('title'=>'Add New Category'));
//        }
//        else{
//
//            $cat = $this->modelCategories->findOneBy(array('id'=>$id));
//            if($request->isPost()){
//                $idFormPost = $this->params()->fromPost('id');
//                $cat = $this->modelCategories->findOneBy(array('id'=>$idFormPost));
//                $cat->setName($this->params()->fromPost('name'));
//                $this->modelCategories->edit($cat);
//            }
//            return new ViewModel(array(
//                'data' =>$cat,
//                'title' => 'Edit Category: '.$cat->getName()
//            ));
//        }
    }
    public function deleteAction()
    {
        //get user by id
        $request = $this->getRequest();
        if($request->isPost()){
            $id = $this->params()->fromPost('id');
            $combo = $this->modelCombo->findOneBy(array('id'=>$id));
            $combo->setIsdelete(1);
            $this->modelCombo->edit($combo);
            //$this->model->delete(array('id'=>$id));
            echo 1;
        }
        die;

    }
    public function editAction()
    {
//        //get user by id
//        $id = $this->params()->fromRoute('id');
//        $user = $this->model->findOneBy(array('id'=>$id));
//        $user->setFullName('tri 1234');
//        $this->model->edit($user);
//        //update user

    }

}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="Weather App for UD811">
  <link rel = "stylesheet" href = "/styles/ud811.css">
  <link rel = "manifest" href = "manifest.json">
  <meta name = "theme-color" content="#2F3BA2">
  <link rel = "apple-touch-icon" sizes = "60x60" href = "apple-60.png">
  <link rel = "apple-touch-icon" sizes = "76x76" href = "apple-76.png">
  <link rel = "apple-touch-icon" sizes = "120x120" href = "apple-120.png">
  <link rel = "apple-touch-icon" sizes = "152x152" href = "apple-152.png">
  <link rel = "apple-touch-icon" sizes = "167x167" href = "apple-167.png">
  <link rel = "apple-touch-icon" sizes = "180x180" href = "apple-180.png">
  <meta name = "apple-mobile-web-app-capable" content="yes">
  <meta name = "apple-mobile-web-app-status-bar-style" content="black-translucent">
  <meta name = "apple-mobile-web-app-title" content="Weather">
  <title>Weather</title>

Weather PWA

    <button id="butRefresh" class="headerButton" aria-label="Refresh"></button>
    <button id="butAdd" class="headerButton" aria-label="Add"></button>

            °F

            °F

            mph
            °

            °

            °

            °

            °

            °

            °

            °

            °

            °

            °

            °

            °

            °

            °

Add new city

        <select id="selectCityToAdd">
          <option value="austin">Austin, TX</option>
          <option value="boston">Boston, MA</option>
          <option value="chicago">Chicago, IL</option>
          <option value="portland">Portland, OR</option>
          <option value="sanfrancisco">San Francisco, CA</option>
          <option value="seattle">Seattle, WA</option>
        </select>

        <button id="butAddCity" class="button">Add</button>
        <button id="butAddCancel" class="button">Cancel</button>

    <svg viewBox="0 0 32 32" width="32" height="32">
      <circle id="ud811Spinner" cx="16" cy="16" r="14" fill="none"></circle>
    </svg>


text:
import numpy as np
from simulator import *
from Util import *
from ForwardKinematics import RevoluteRobot

class MDP:
  def __init__(self, obstacle, robot, STEP_SIZE=1):
    num_links = len(robot.Links)-1
    self.st = Simulator(obstacle, robot, [0]*num_links, False, STEP_SIZE)
    actions = [Actions.DEC, Actions.INC, Actions.NOTHING]
    self.gamma = 0.999
    self.threshold = .5
    self.max_k = 50
    self.actions = create_space(num_links, actions)

    self.V = [0]*len(self.st.state_space)
    self.Policies = [None]*len(self.V)

  def solve(self):
    self.value_iteration()
    #print self.V
    self.get_policy()
    #print self.Policies

  def value_iteration(self):
    k = 0
    V_prev = [0]*len(self.st.state_space)
    V_curr = [0]*len(self.st.state_space)
    cont_loop =True
    while cont_loop:
      #print V_curr
      k +=1
      V_prev = list(V_curr)
      precision_reached = True
      print k
      for state in self.st.state_space:
        idx = self.st.state_space.index(state)
        r = self.evaluate_state(state)
        max_value = 0
        for a in self.actions:
          next_state = self.evaluate_state_action(state, a)
          n_idx = self.st.state_space.index(next_state)
          max_value = V_prev[n_idx] if V_prev[n_idx] > max_value else max_value
        #print "V[%d] = %f" %(idx, max_value)
        V_curr[idx] = r + self.gamma*max_value
        prec = np.fabs(V_curr[idx] - V_prev[idx])
        if prec > self.threshold:
          #print prec
          precision_reached = False
      if precision_reached or k >= self.max_k:
        print "precision reached!!"
        cont_loop = False
    self.V = V_curr
  def evaluate_state_action(self, state, action):
    curr_state = self.st.discrete_action_from_state(state, action)
    return curr_state

  def evaluate_state (self, state):
    self.st.force_state(state)
    return self.st.reward

  def get_policy(self):
    for state in self.st.state_space:
        idx = self.st.state_space.index(state)
        max_value = 0
        max_a = Actions.NOTHING
        max_value = 0
        for a in self.actions:
          next_state = self.evaluate_state_action(state, a)
          n_idx = self.st.state_space.index(next_state)
          if self.V[n_idx] > max_value :
            max_value = self.V[n_idx]
            max_a = a
        self.Policies[idx]=max_a

class State(MDP):
  def __init__(self,object_idx, angles_idx):
    global angle_space, object_space
    self.object_idx = object_idx
    self.angles_idx = angles_idx
  def get_state(self):
    return [object_space[self.object_idx], angle_space[self.angles_idx] ]

  def __str__(self):
    return "object pose at %s, with link angles: %s"\
        % (self.object_idx, self.angles_idx)

def main(store):
  load = not store # and False
  center = np.array([0,.5])
  radius = 0.25
  num_links = 2
  step = 0.075
  link_lengths = [1]*num_links
  robot = RevoluteRobot(link_lengths)
  obstacle = Obstacle(center, radius)
  mdp = MDP(obstacle, robot, step)

  #mdp.solve()
  #policy = mdp.Policies

  filename = 'policy2.txt'
  np.random.seed(0)
  if store:
    mdp.solve()
    policy = mdp.Policies
    store_policy(filename,policy)
  elif load:
    policy = load_policy(filename, len(mdp.st.state_space))

  init_pos = [0]*num_links
  st = Simulator(obstacle, robot, init_pos, True, step)
  prev_idx = 0

  c = 0
  state = st.get_current_state()
  while c is not 'q':

    if c is 'n':
      idx = np.random.randint(0, len(st.state_space)-1)
      state = st.state_space[idx]
      a = policy[idx]
      state = st.discrete_action_from_state(state,a)
      while True in st.collisions:
        idx = np.random.randint(0, len(st.state_space)-1)
        state = st.state_space[idx]
        a = policy[idx]
        state = st.discrete_action_from_state(state,a)

    else:
      idx = st.state_space.index(state)
    a = policy[idx]
    print "idx %d, with action %s, and reward %f" %(idx, a, st.reward)
    state = st.discrete_action_from_state(state, a)
    c = raw_input("\n\n[q]uit or [n]ew initial angle ",)

if __name__=="__main__":
  store =False
  main(store)


text:
/*
 * Example JavaScript integration test that deploys the module that this project builds.
 *
 * Quite often in integration tests you want to deploy the same module for all tests and you don't want tests
 * to start before the module has been deployed.
 *
 * This test demonstrates how to do that.
 */

var container = require("vertx/container");
var vertx = require("vertx");
var vertxTests = require("vertx_tests");
var vassert = require("vertx_assert");

// The test methods must begin with "test"

function testPing() {
    vertx.eventBus.send("ping-address", "ping!", function (reply) {
        vassert.assertEquals("pong!", reply);
        /*
         If we get here, the test is complete
         You must always call `testComplete()` at the end. Remember that testing is *asynchronous* so
         we cannot assume the test is complete by the time the test method has finished executing like
         in standard synchronous tests
         */
        vassert.testComplete();
    });
}

function testSomethingElse() {
    vassert.assertEquals("foo", "foo");
    vassert.testComplete()
}

var script = this;
// The script is execute for each test, so this will deploy the module for each one
// Deploy the module - the System property `vertx.modulename` will contain the name of the module so you
// don't have to hardecode it in your tests
container.deployModule(java.lang.System.getProperty("vertx.modulename"), function (err, depID) {
    // Deployment is asynchronous and this this handler will be called when it's complete (or failed)
    vassert.assertNull(err);
    // If deployed correctly then start the tests!
    vertxTests.startTests(script);
});


text:
package com.mcleodmoores.analytics.convention.businessday;

import org.threeten.bp.LocalDate;
import org.threeten.bp.LocalDateTime;
import org.threeten.bp.ZonedDateTime;
import org.threeten.bp.temporal.TemporalAdjuster;

import com.mcleodmoores.date.CalendarAdapter;
import com.mcleodmoores.date.WorkingDayCalendar;
import com.opengamma.financial.convention.calendar.Calendar;

/**
 *
 */
public final class BusinessDayConventionAdapter implements BusinessDayConvention {

  public static BusinessDayConvention of(final com.opengamma.financial.convention.businessday.BusinessDayConvention convention) {
    return new BusinessDayConventionAdapter(convention);
  }

  private final com.opengamma.financial.convention.businessday.BusinessDayConvention _convention;

  private BusinessDayConventionAdapter(final com.opengamma.financial.convention.businessday.BusinessDayConvention convention) {
    _convention = convention;
  }

  @Override
  public LocalDate adjustDate(final Calendar workingDayCalendar, final LocalDate date) {
    return _convention.adjustDate(workingDayCalendar, date);
  }

  @Override
  public ZonedDateTime adjustDate(final Calendar workingDayCalendar, final ZonedDateTime dateTime) {
    return _convention.adjustDate(workingDayCalendar, dateTime);
  }

  @Override
  public TemporalAdjuster getTemporalAdjuster(final Calendar workingDayCalendar) {
    return _convention.getTemporalAdjuster(workingDayCalendar);
  }

  @Deprecated
  @Override
  public String getConventionName() {
    return _convention.getConventionName();
  }

  @Override
  public LocalDate adjustDate(final WorkingDayCalendar workingDayCalendar, final LocalDate date) {
    return adjustDate(CalendarAdapter.of(workingDayCalendar), date);
  }

  @Override
  public LocalDateTime adjustDate(final WorkingDayCalendar workingDayCalendar, final LocalDateTime date) {
    return adjustDate(CalendarAdapter.of(workingDayCalendar), date.toLocalDate()).atTime(date.toLocalTime());
  }

  @Override
  public ZonedDateTime adjustDate(final WorkingDayCalendar workingDayCalendar, final ZonedDateTime dateTime) {
    return adjustDate(CalendarAdapter.of(workingDayCalendar), dateTime);
  }

  @Override
  public TemporalAdjuster getTemporalAdjuster(final WorkingDayCalendar workingDayCalendar) {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public String getName() {
    return _convention.getName();
  }
}


text:
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Orleans;
using Orleans.Providers;
using Orleans.Providers.Streams.Generator;
using Orleans.Runtime;
using Orleans.Streams;
using TestGrainInterfaces;
using UnitTests.Grains;

namespace TestGrains
{
    [ImplicitStreamSubscription(StreamNamespace)]
    [StorageProvider(ProviderName = StorageProviderName)]
    public class ImplicitSubscription_RecoverableStream_CollectorGrain : Grain<StreamCheckpoint<int>>, IGeneratedEventCollectorGrain
    {
        public const string StreamNamespace = "RecoverableStream";
        public const string StorageProviderName = "AzureStorage";

        // grain instance state
        private ILogger logger;
        private IAsyncStream<GeneratedEvent> stream;

        public ImplicitSubscription_RecoverableStream_CollectorGrain(ILoggerFactory loggerFactory)
        {
            this.logger = loggerFactory.CreateLogger($"{this.GetType().Name}-{this.IdentityString}");
        }

        public override async Task OnActivateAsync(CancellationToken cancellationToken)
        {
            logger.LogInformation("OnActivateAsync");

            await ReadStateAsync();

            Guid streamGuid = this.GetPrimaryKey();
            if (State.StreamGuid != streamGuid)
            {
                State.StreamGuid = streamGuid;
                State.StreamNamespace = StreamNamespace;
                await WriteStateAsync();
            }

            var streamProvider = this.GetStreamProvider(GeneratedStreamTestConstants.StreamProviderName);
            stream = streamProvider.GetStream<GeneratedEvent>(State.StreamGuid, State.StreamNamespace);

            await stream.SubscribeAsync(OnNextAsync, OnErrorAsync, State.RecoveryToken);
        }

        private async Task OnNextAsync(GeneratedEvent evt, StreamSequenceToken sequenceToken)
        {

            // ignore duplicates
            if (State.IsDuplicate(sequenceToken))
            {
                logger.LogInformation("Received duplicate event. StreamGuid: {StreamGuid}, SequenceToken: {SequenceToken}", State.StreamGuid, sequenceToken);
                return;
            }

            logger.LogInformation("Received event. StreamGuid: {StreamGuid}, SequenceToken: {SequenceToken}", State.StreamGuid, sequenceToken);

            // We will only update the start token if this is the first event we're processed
            // In that case, we'll want to save the start token in case something goes wrong.
            if (State.TryUpdateStartToken(sequenceToken))
            {
                await WriteStateAsync();
            }

            State.Accumulator++;
            State.LastProcessedToken = sequenceToken;
            if (evt.EventType != GeneratedEvent.GeneratedEventType.Report)
            {
                // every 10 events, checkpoint our grain state
                if (State.Accumulator % 10 != 0) return;
                logger.LogInformation("Checkpointing: StreamGuid: {StreamGuid}, StreamNamespace: {StreamNamespace}, SequenceToken: {SequenceToken}, Accumulator: {Accumulator}.", State.StreamGuid, State.StreamNamespace, sequenceToken, State.Accumulator);
                await WriteStateAsync();
                return;
            }
            logger.LogInformation("Final checkpointing: StreamGuid: {StreamGuid}, StreamNamespace: {StreamNamespace}, SequenceToken: {SequenceToken}, Accumulator: {Accumulator}.", State.StreamGuid, State.StreamNamespace, sequenceToken, State.Accumulator);
            await WriteStateAsync();
            var reporter = GrainFactory.GetGrain<IGeneratedEventReporterGrain>(GeneratedStreamTestConstants.ReporterId);
            await reporter.ReportResult(this.GetPrimaryKey(), GeneratedStreamTestConstants.StreamProviderName, StreamNamespace, State.Accumulator);
        }

        private Task OnErrorAsync(Exception ex)
        {
            logger.LogInformation(ex, "Received an error on stream. StreamGuid: {StreamGuid}, StreamNamespace: {StreamNamespace}", State.StreamGuid, State.StreamNamespace);
            return Task.CompletedTask;
        }
    }
}


text:
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM

#include "tensorflow/core/kernels/cwise_ops_gpu_common.cu.h"

namespace tensorflow {
namespace functor {

#if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED)
DEFINE_BINARY5(xdivy, Eigen::half, float, double, complex64, complex128);
#endif

DEFINE_BINARY1(xdivy, bfloat16);

}  // namespace functor
}  // namespace tensorflow

#endif  // GOOGLE_CUDA || TENSORFLOW_USE_ROCM


text:
(function($){
    $.fn.modool = function(options){
        var settings = $.extend({ // Default settings
            title   : '',
            modal   : true,
            close   : true,
            text    :{
                'single':{
                    'rbtn':'Save',
                    'lbtn':'Close'
                },
                'multi':{
                    'rbtn':'Next',
                    'lbtn':'Back'
                }
            }
        }, options);
        var markup={
            modool_back:'

',
            modool_tmpl:'',
            modool_btn_close_tmpl:'',
            modool_btn_action_tmpl:'',
            modool_btn_next_tmpl: '',
            modool_btn_prev_tmpl :''
        }
        var data = {
            step_storage:settings
        }
        var methods = {
            btn:function(settings,step_num){
                methods.rbtn(settings,step_num); // setup right button
                methods.lbtn(settings,step_num); // setup left button
                $.fn.modool.update(settings,step_num); // update pos/dimensions
                $('.modool-btn').each(function(){ // set buttons rels
                    $(this).attr('rel',step_num);
                });
                $('#modool-close').unbind().click(function(){ // close button
                    if(typeof(settings.steps[step_num].lbtn_callback) != 'undefined'){
                        if($.isFunction(settings.steps[step_num].lbtn_callback)){
                            settings.steps[step_num].lbtn_callback();
                            //$.fn.modool.close();
                        }else{ // defined but no fn
                            $.fn.modool.close();
                        }
                    }else{ // not defined
                        $.fn.modool.close();
                    }
                });
                $('#modool-next').unbind().click(function(){ // next button
                    //var rel = parseInt($(this).attr('rel'));
                    if(typeof(settings.steps[step_num].rbtn_callback) != 'undefined'){
                        if($.isFunction(settings.steps[step_num].rbtn_callback)){
                            settings.steps[step_num].rbtn_callback();
                        }else{ // defined but no fn
                            methods.next(settings,step_num);
                        }
                    }else{ // not defined
                        methods.next(settings,step_num);
                    }

                });
                $('#modool-prev').unbind().click(function(){ // next button
                    //var rel = parseInt($(this).attr('rel'));
                    if(typeof(settings.steps[step_num].lbtn_callback) != 'undefined'){
                        if($.isFunction(settings.steps[step_num].lbtn_callback)){
                            settings.steps[step_num].lbtn_callback()
                        }else{ // defined but no fn
                            methods.prev(settings,step_num);
                        }
                    }else{ // not defined
                        methods.prev(settings,step_num);
                    }
                });
                $('#modool-action').unbind().click(function(){ // next button
                    //var rel = parseInt($(this).attr('rel'));
                    if(typeof(settings.steps[step_num].rbtn_callback) != 'undefined'){
                        if($.isFunction(settings.steps[step_num].rbtn_callback())){
                            settings.steps[step_num].rbtn_callback();
                        }
                    }else{
                        $.fn.modool.close();
                    }
                });
            },
            init : function(settings,callback) {
                data.step_storage = settings;
                $('head').append(markup.modool_tmpl).append(markup.modool_btn_close_tmpl).append(markup.modool_btn_action_tmpl).append(markup.modool_btn_next_tmpl).append(markup.modool_btn_prev_tmpl);
                if($('#modool-back').length == 0){
                    $('body').append(markup.modool_back);
                }else{
                    $('#modool-wrap:visible').remove();
                }
                if($('body').hasClass('modool')){
                    $('body').removeClass('modool');
                }
                $('body').addClass('modool');
                if(!settings.close){
                    markup.close = ''; // no close
                }
                if(typeof(settings.deeplink) != 'undefined'){ // DEEPLINK
                    methods.steps(settings,settings.deeplink); // yes
                }else{
                    methods.steps(settings,0); // no
                }
                if($.isFunction(callback)){
                    callback();
                }
            },
            lbtn:function(settings,rel){
                if(typeof(settings.steps[rel].lbtn) == 'undefined' || typeof(settings.steps[rel].lbtn) == false){
                    if(typeof(settings.steps[rel].text) == 'undefined'){
                        if(rel > 0){ // more than one - use back btn
                            $('#modool-head').prepend($('#modool_btn_prev_tmpl').tmpl(settings.text.multi)); // use default text
                        }else{
                            $('#modool-head').prepend($('#modool_btn_close_tmpl').tmpl(settings.text.single)); // use default text
                        }
                    }else{
                        if(typeof(settings.steps[rel].text.lbtn) == 'undefined'){
                            if(typeof(settings.steps[rel].lbtn_tmpl) == 'undefined'){
                                if(rel > 0){ // more than one - use back btn
                                    $('#modool-head').prepend($('#modool_btn_prev_tmpl').tmpl(settings.text.multi)); // use default text
                                }else{
                                    $('#modool-head').prepend($('#modool_btn_close_tmpl').tmpl(settings.text.single)); // use default text
                                }
                            }else{
                                if(rel > 0){ // more than one - use back btn
                                    $('#modool-head').prepend($(settings.steps[rel].lbtn_tmpl).tmpl(settings.text.multi)); // use default text
                                }else{
                                    $('#modool-head').prepend($(settings.steps[rel].lbtn_tmpl).tmpl(settings.text.single)); // use default text
                                }
                            }

                        }else{
                            //if(typeof(settings.steps[rel].lbtn) == true){ // true #TODO : Is this needed?
                            if(typeof(settings.steps[rel].lbtn_tmpl) == 'undefined'){
                                if(rel > 0){ // more than one - use back btn
                                    $('#modool-head').prepend($('#modool_btn_prev_tmpl').tmpl(settings.steps[rel].text)); // use custom text
                                }else{
                                    $('#modool-head').prepend($('#modool_btn_close_tmpl').tmpl(settings.steps[rel].text)); // use custom text
                                }
                            }else{
                                $('#modool-head').prepend($(settings.steps[rel].lbtn_tmpl).tmpl(settings.steps[rel].text)); // use custom text
                            }
                            //}
                        }
                    }
                }
            },
            next:function(params,rel){ // go to next step
                $('#modool-body').html($(params.steps[rel+1].tmpl).tmpl(params.steps[rel+1].data));
                $('.modool-btn-left').remove();
                $('.modool-btn-right').remove();
                if(typeof(params.steps[rel+1].css_classes) != undefined){ // Add classes
                    $('#modool').addClass(params.steps[rel+1].css_classes);
                }
                if(typeof(params.steps[rel+1].title) != 'undefined'){
                    $('#modool-title').html(params.steps[rel+1].title);
                }
                methods.btn(params,rel+1);
                if(typeof(params.steps[rel+1].tmpl_callback) != 'undefined'){
                    if($.isFunction(params.steps[rel+1].tmpl_callback)){
                        params.steps[rel+1].tmpl_callback();
                    }
                }
            },
            prev:function(params,rel){ // go to prev step
                $('#modool-body').html($(params.steps[rel-1].tmpl).tmpl(params.steps[rel-1].data));
                $('.modool-btn-left').remove();
                $('.modool-btn-right').remove();
                if(typeof(params.steps[rel-1].css_classes) != undefined){ // Add classes
                    $('#modool').addClass(params.steps[rel-1].css_classes);
                }
                if(typeof(params.steps[rel-1].title) != 'undefined'){
                    $('#modool-title').html(params.steps[rel-1].title);
                }
                methods.btn(params,rel-1);
                if(typeof(params.steps[rel-1].tmpl_callback) != 'undefined'){
                    if($.isFunction(params.steps[rel-1].tmpl_callback)){
                        params.steps[rel-1].tmpl_callback();
                    }
                }
            },
            rbtn:function(settings,rel){
                if(typeof(settings.steps[rel].rbtn) == 'undefined' || typeof(settings.steps[rel].rbtn) == false){
                    if(typeof(settings.steps[rel].text) == 'undefined'){
                        if(rel != settings.steps.length-1){ // not last - use next btn
                            $('#modool-head').prepend($('#modool_btn_next_tmpl').tmpl(settings.text.multi)); // use default text
                        }else{ // only one - use action btn
                            $('#modool-head').prepend($('#modool_btn_action_tmpl').tmpl(settings.text.single)); // use default text
                        }
                    }else{
                        if(typeof(settings.steps[rel].text.rbtn) == 'undefined'){
                            if(rel != settings.steps.length-1){ // not last - use next btn
                                $('#modool-head').prepend($('#modool_btn_next_tmpl').tmpl(settings.text.multi)); // use default text
                            }else{ // only one - use action btn
                                $('#modool-head').prepend($('#modool_btn_action_tmpl').tmpl(settings.text.single)); // use default text
                            }
                        }else{
                            if(rel != settings.steps.length-1){ // not last - use next btn
                                $('#modool-head').prepend($('#modool_btn_next_tmpl').tmpl(settings.steps[rel].text)); // use custom text
                            }else{
                                $('#modool-head').prepend($('#modool_btn_action_tmpl').tmpl(settings.steps[rel].text)); // use custom text
                            }
                        }
                    }
                }
            },
            seek:function(settings,step_num){ // go to any step
                $('#modool-body').html($(settings.steps[step_num].tmpl).tmpl(settings.steps[step_num].data));
                $('.modool-btn-left').remove();
                $('.modool-btn-right').remove();
                if(typeof(settings.steps[step_num].css_classes) != undefined){ // Add classes
                    $('#modool').addClass(settings.steps[step_num].css_classes);
                }
                if(typeof(settings.steps[step_num].title) != 'undefined'){
                    $('#modool-title').html(settings.steps[step_num].title);
                }
                methods.btn(settings,step_num);
                if(typeof(settings.steps[step_num].tmpl_callback) != 'undefined'){
                    if($.isFunction(settings.steps[step_num].tmpl_callback)){
                        settings.steps[step_num].tmpl_callback();
                    }
                }
            },
            steps:function(settings,step_num){
                data.step_num = step_num;
                if(typeof(settings.steps) != undefined){ // Check Steps
                    $.each(settings.steps,function(index){
                        if(typeof(this.data) == undefined){
                            this.data = '';
                        }
                        if(typeof(this.height) == 'undefined'){ // if no height
                            this.height = '420px'; // set default height
                        }
                        if(typeof(this.width) == 'undefined'){ // if no width
                            this.width = '500px'; // set default width
                        }
                    });
                    $('#modool-back').after($('#modool_tmpl').tmpl(settings.steps[step_num]));
                    if(typeof(settings.steps[step_num].css_classes) != undefined){ // Add classes
                        $('#modool').addClass(settings.steps[step_num].css_classes);
                    }
                    $('#modool-body').html($(settings.steps[step_num].tmpl).tmpl(settings.steps[step_num].data));
                    methods.btn(settings,step_num);
                    if(typeof(settings.steps[step_num].tmpl_callback) != 'undefined'){
                        if($.isFunction(settings.steps[step_num].tmpl_callback)){
                            settings.steps[step_num].tmpl_callback();
                        }
                    }
                }
            }
        };
        return this.each(function(){
            $(this).unbind().click(function(e){
                e.preventDefault();
                methods.init(settings,function(){
                    $.fn.modool.update(settings,0);
                    $('#modool').fadeIn(250);
                });
            });
        });

    }
    $.fn.modool.update=function(params,step_num){ // re-calc. position
        if(typeof(params) != 'undefined' && typeof(step_num) != 'undefined'){
            if(typeof(params.steps[step_num]).width != 'undefined' && typeof(params.steps[step_num]).height != 'undefined'){
                $('#modool').css({'width':params.steps[step_num].width});
                if(params.steps[step_num].height == '100%' && params.steps[step_num].width == '100%'){
                    $('#modool').css({'margin':'0 auto'});
                }
                $('#modool-body').css({'height':params.steps[step_num].height});
            }
        }
    }
    $.fn.modool.close=function(callback){
        $('#modool-wrap').fadeOut(250,function(){
            $(this).remove();
            $('#modool-back').fadeOut(250,function(){
                $(this).remove();
                $('body').removeClass('modool');
                if($.isFunction(callback)){
                    callback();
                }
            });
        });
    }
    $(window).resize(function(){
        $.fn.modool.update();
    });
}(jQuery));

// Usage example:
//$("a").showLinkLocation();


text:
A CLI application for interacting with a Cloudflare account. Powered by [cloudflare-go].

## Installation

Install it when you install our command-line library:

```sh
go get -u github.com/cloudflare/cloudflare-go/...
```

# Usage

You must set your API key and account email address in the environment variables `CF_API_KEY` and `CF_API_EMAIL`.

```
$ export CF_API_KEY=abcdef1234567890
$ export CF_API_EMAIL=someone@example.com

$ flarectl:

   flarectl - Cloudflare CLI

USAGE:
   flarectl [global options] command [command options] [arguments...]

VERSION:
   2017.10.0

COMMANDS:
   ips, i		Print Cloudflare IP ranges
   user, u		User information
   zone, z		Zone information
   dns, d		DNS records
   user-agents, ua	User-Agent blocking
   pagerules, p		Page Rules
   railgun, r		Railgun information
   firewall, f		Firewall
   help, h		Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h		show help
   --version, -v	print the version

```

## Examples

## Block an IP via the IP Firewall

```sh
flarectl firewall rules create --zone="example.com" --value="8.8.8.8" --mode="block" --notes="Block bad actor"

ID                               Value   Scope Mode  Notes
-------------------------------- ------- ----- ----- ----------------
7bc6fa4569f78777039ef5ebd7b4cedd 8.8.8.8 zone  block Block bad actor
```

### List Firewall Rules

```sh
~ flarectl firewall rules list

ID                               Value           Scope Mode      Notes
-------------------------------- --------------- ----- --------- -----
210173b610198c8ce3dfe39987e4df78 8.8.8.8         user  whitelist
36e86aebff4cb8cb2020e622c2ff2b90 8.8.4.4         user  whitelist
ba6bea6e646e2d453c394a41c6ab931a 45.55.2.6       user  whitelist
edff311e3f81b35e9cd64e4fa9d18465 45.55.2.5       user  whitelist
```

### Challenge All Requests for a specific User-Agent

```
~ flarectl ua create --zone="example.com" --mode="challenge" --description="Challenge Chrome v61" --value="Mozilla/5.0 (Macintosh Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML like Gecko) Chrome/61.0.3163.100 Safari/537.36"

ID                               Description          Mode      Value                                                                                Paused
-------------------------------- -------------------- --------- --------------------------------------------------------------------------------------------------------------------- ------
a23b50de3c064a5a860e8b84cd2b382c Challenge Chrome v61 challenge Mozilla/5.0 (Macintosh Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML like Gecko) Chrome/61.0.3163.100 Safari/537.36 false
```

### Add a DNS record

```sh
~ flarectl dns create --zone="example.com" --name="app" --type="CNAME" --content="myapp.herokuapp.com" --proxy

ID                               Name                      Type  Content             TTL Proxiable Proxy Locked
-------------------------------- ------------------------- ----- ------------------- --- --------- ----- ------
5c5d051f7944cf4715127270dd4d05f4 app.questionable.services CNAME myapp.herokuapp.com 1   true      true  false
```

## License

BSD licensed. See the [LICENSE](LICENSE) file for details.


text:
/*
bool input_init() {

    // down (is currently pressed)
    // hit (was down on for one frame)
    // released (was down on last frame but no longer)

    vm_global_get("keyboard");
    vm_field_set_integer(""); // constants
    vm_field_set_function("count", NULL);
    vm_field_set_function("down", NULL);
    vm_field_set_function("hit", NULL);
    vm_field_set_function("released", NULL);
    vm_rewind();

    vm_global_get("mouse");
    vm_field_set_integer(""); // constants
    vm_field_set_function("getPosition", NULL);
    vm_field_set_function("down", NULL);
    vm_field_set_function("hit", NULL);
    vm_field_set_function("released", NULL);
    vm_rewind();

}
*/


text:
namespace XamlViewer
{
    using System;
    using System.Globalization;
    using System.Windows.Data;
    using OmniXaml.Visualization;

    public class NodeTypeToUriConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var relativePath = parameter == null ? "" : RemoveEndingSlash((string)parameter);

            var nodeType = (NodeType)value;
            switch (nodeType)
            {
                case NodeType.Root:
                    return new Uri(CombineRelative(relativePath, "root.png"), UriKind.Relative);
                case NodeType.Value:
                    return new Uri(CombineRelative(relativePath, "value.png"), UriKind.Relative);
                case NodeType.NamespaceDeclaration:
                    return new Uri(CombineRelative(relativePath, "namespace.png"), UriKind.Relative);
                case NodeType.GetObject:
                    return new Uri(CombineRelative(relativePath, "collection.png"), UriKind.Relative);
                case NodeType.Object:
                    return new Uri(CombineRelative(relativePath, "object.png"), UriKind.Relative);
                case NodeType.Member:
                    return new Uri(CombineRelative(relativePath, "member.png"), UriKind.Relative);
            }

            throw new InvalidOperationException($"Cannot find a matching Uri for the type {nodeType}");
        }

        private static string RemoveEndingSlash(string str)
        {
            return str.EndsWith("/") || str.EndsWith("\\") ? str.Remove(str.Length-1, 1) : str;
        }

        private static string CombineRelative(string relativePath, string fileName)
        {
            return relativePath + "/" + fileName;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new InvalidOperationException();
        }
    }
}


text:
'use strict';

if (process.env.NODE_ENV === 'production') {
  module.exports = require('./cjs/jest-mock-scheduler.production.min.js');
} else {
  module.exports = require('./cjs/jest-mock-scheduler.development.js');
}


text:
package es.um.nosql.s13e.json2dbschema.intermediate.firsto;

import org.apache.commons.lang3.Range;

/**
 * @author dsevilla
 *
 */
public interface Ranged
{
  public abstract Range<? extends Comparable<?>> getRange();
}


text:
package com.intellij.ide;

public interface CommandLineInspectionProgressReporter {
  void reportError(String message);

  void reportMessage(int minVerboseLevel, String message);
}


text:
<?php

namespace System\Form\System;

use Home\Form\FormBase;
use Zend\Form\Element\Text;
use Zend\Form\Element\Select;

class Role extends FormBase{

}


text:
class Mailer
  attr_reader :name, :location, :wearing, :contact

  def initialize(params)
    @name, @location, @wearing, @contact = params.values
  end

  def send
    client = SendGrid::Client.new(api_user: ENV['SENDGRID_USERNAME'],
                                  api_key: ENV['SENDGRID_PASSWORD'])
    client.send(email)
  end

  private

  def email_body
    body = "#{name} needs help at #{location}."
    body << " He/she is wearing #{wearing}." unless wearing.empty?
    body << " Contact him/her at #{contact}" unless contact.empty?
    body
  end

  def email
    SendGrid::Mail.new do |m|
      m.to = ENV['EMAIL']
      m.from = 'help@cis196.party'
      m.subject = "#{name} needs help"
      m.html = email_body
    end
  end
end


text:
package blackjack

import (
	"fmt"

	"github.com/gin-gonic/gin"
)

func GetGame(c *gin.Context) {
	var request TokenReq
	err := c.Bind(&request)

	if err != nil {
		fmt.Println(err)
		c.JSON(400, gin.H{
			"status":  1,
			"message": "Incorrect data",
			"body":    nil,
		})
		return
	}

	index, err := FindPlayer(request.Token)

	if err != nil {
		c.JSON(400, gin.H{
			"status":  3,
			"message": "Game not found",
			"body":    nil,
		})
		return
	}

	c.JSON(200, gin.H{
		"status":  0,
		"message": "Success",
		"body":    CurrentGames[index],
	})
}

func GetAllGames(c *gin.Context) {
	c.JSON(200, gin.H{
		"status":  0,
		"message": "Success",
		"body":    CurrentGames,
	})
}

func GetAllEndedGames(c *gin.Context) {
	c.JSON(200, gin.H{
		"status":  0,
		"message": "Success",
		"body":    EndedGames,
	})
}

func StartGame(c *gin.Context) {
	var request StartReq
	err := c.Bind(&request)

	if err != nil {
		fmt.Println(err)
		c.JSON(400, gin.H{
			"status":  1,
			"message": "Incorrect data",
			"body":    nil,
		})
		return
	}

	if request.Decks == 0 {
		request.Decks = 1
	}

	if (request.Decks < 0 || request.Decks > 10) || (request.Players < 2 || request.Players > 10) {
		c.JSON(400, gin.H{
			"status":  2,
			"message": "Deck can not be less than zero and more than ten. Players can not be less than two and more than ten.",
			"body":    nil,
		})
		return
	}

	var decks []Card
	for i := 0; i < request.Decks; i++ {
		decks = append(decks, GenerateDeck()...)
	}

	var emptyPlayers []Player
	newGame := Game{
		Ended:        false,
		FinalMessage: "",
		Winner:       emptyPlayers,
		Cards:        decks,
		Players:      GeneratePlayer(request.Players),
		Token:        GenerateToken(26),
	}

	for index, _ := range newGame.Players {
		TakeCard(&newGame, &newGame.Players[index])
		TakeCard(&newGame, &newGame.Players[index])
	}

	CurrentGames = append(CurrentGames, newGame)

	CheckFullWinners(&newGame)

	c.JSON(200, gin.H{
		"status":  0,
		"message": "Success",
		"body":    newGame,
	})

	if newGame.Ended {
		DeactivateGame(newGame.Token)
	}

	return
}

func TakeCardGame(c *gin.Context) {
	var request TokenReq
	err := c.Bind(&request)

	if err != nil {
		fmt.Println(err)
		c.JSON(400, gin.H{
			"status":  1,
			"message": "Incorrect data",
			"body":    nil,
		})
		return
	}

	index, err := FindPlayer(request.Token)

	if err != nil {
		c.JSON(400, gin.H{
			"status":  3,
			"message": "Game not found",
			"body":    nil,
		})
		return
	}

	emptyDeck := CheckCardsLen(&CurrentGames[index])

	if !emptyDeck {
		TakeCard(&CurrentGames[index], &CurrentGames[index].Players[0])
	}

	CheckFullWinners(&CurrentGames[index])

	AllPlayersCicle(&CurrentGames[index])

	if !CurrentGames[index].Ended && CurrentGames[index].Players[0].Sum > 20 {
		CurrentGames[index].Players[0].Stay = true
		AllPlayersCicle(&CurrentGames[index])
	}

	c.JSON(200, gin.H{
		"status":  0,
		"message": "Success",
		"body":    CurrentGames[index],
	})

	if CurrentGames[index].Ended {
		DeactivateGame(CurrentGames[index].Token)
	}

	return
}

func StopTakeGame(c *gin.Context) {
	var request TokenReq
	err := c.Bind(&request)

	if err != nil {
		fmt.Println(err)
		c.JSON(400, gin.H{
			"status":  1,
			"message": "Incorrect data",
			"body":    nil,
		})
		return
	}

	index, err := FindPlayer(request.Token)

	if err != nil {
		c.JSON(400, gin.H{
			"status":  3,
			"message": "Game not found",
			"body":    nil,
		})
		return
	}

	CurrentGames[index].Players[0].Stay = true

	AllPlayersCicle(&CurrentGames[index])

	c.JSON(200, gin.H{
		"status":  0,
		"message": "Success",
		"body":    CurrentGames[index],
	})

	if CurrentGames[index].Ended {
		DeactivateGame(CurrentGames[index].Token)
	}

	return
}